!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.EmawwsWebLib=e():t.EmawwsWebLib=e()}(self,(()=>(()=>{var t={660:(t,e,r)=>{
/*! *****************************************************************************
Copyright (C) Microsoft. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var n;!function(t){!function(e){var n="object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),o=i(t);function i(t,e){return function(r,n){"function"!=typeof t[r]&&Object.defineProperty(t,r,{configurable:!0,writable:!0,value:n}),e&&e(r,n)}}void 0===n.Reflect?n.Reflect=t:o=i(n.Reflect,o),function(t){var e=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,n=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",i="function"==typeof Object.create,a={__proto__:[]}instanceof Array,c=!i&&!a,u={create:i?function(){return nt(Object.create(null))}:a?function(){return nt({__proto__:null})}:function(){return nt({})},has:c?function(t,r){return e.call(t,r)}:function(t,e){return e in t},get:c?function(t,r){return e.call(t,r)?t[r]:void 0}:function(t,e){return t[e]}},s=Object.getPrototypeOf(Function),l="object"==typeof process&&{NODE_ENV:"production",LIBRARY_API_BASE_URL:"https://awwtagbackup.emaww.com",AWW22_BUILD_VERSION:"22.1.3",AWWS_CLIENT_LIB_WEB_API_URL:"https://dnu3v8fk2whvx.cloudfront.net",LIBRARY_DEMO_APP_TOKEN:"192.168.1.127",LIBRARY_DEMO_APP_PORT:"8081",LIBRARY_DEMO_APP_URL:"0.0.0.0",TIMER_EVENT_INTERVAL:"1000"}&&"true"==={NODE_ENV:"production",LIBRARY_API_BASE_URL:"https://awwtagbackup.emaww.com",AWW22_BUILD_VERSION:"22.1.3",AWWS_CLIENT_LIB_WEB_API_URL:"https://dnu3v8fk2whvx.cloudfront.net",LIBRARY_DEMO_APP_TOKEN:"192.168.1.127",LIBRARY_DEMO_APP_PORT:"8081",LIBRARY_DEMO_APP_URL:"0.0.0.0",TIMER_EVENT_INTERVAL:"1000"}.REFLECT_METADATA_USE_MAP_POLYFILL,f=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?tt():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,h=new(l||"function"!=typeof WeakMap?rt():WeakMap);function y(t,e,r,n){if(C(r)){if(!H(t))throw new TypeError;if(!z(e))throw new TypeError;return P(t,e)}if(!H(t))throw new TypeError;if(!V(e))throw new TypeError;if(!V(n)&&!C(n)&&!N(n))throw new TypeError;return N(n)&&(n=void 0),O(t,e,r=B(r),n)}function v(t,e){function r(r,n){if(!V(r))throw new TypeError;if(!C(n)&&!q(n))throw new TypeError;L(t,e,r,n)}return r}function d(t,e,r,n){if(!V(r))throw new TypeError;return C(n)||(n=B(n)),L(t,e,r,n)}function m(t,e,r){if(!V(e))throw new TypeError;return C(r)||(r=B(r)),k(t,e,r)}function g(t,e,r){if(!V(e))throw new TypeError;return C(r)||(r=B(r)),x(t,e,r)}function b(t,e,r){if(!V(e))throw new TypeError;return C(r)||(r=B(r)),j(t,e,r)}function w(t,e,r){if(!V(e))throw new TypeError;return C(r)||(r=B(r)),_(t,e,r)}function S(t,e){if(!V(t))throw new TypeError;return C(e)||(e=B(e)),A(t,e)}function E(t,e){if(!V(t))throw new TypeError;return C(e)||(e=B(e)),R(t,e)}function T(t,e,r){if(!V(e))throw new TypeError;C(r)||(r=B(r));var n=I(e,r,!1);if(C(n))return!1;if(!n.delete(t))return!1;if(n.size>0)return!0;var o=h.get(e);return o.delete(r),o.size>0||h.delete(e),!0}function P(t,e){for(var r=t.length-1;r>=0;--r){var n=(0,t[r])(e);if(!C(n)&&!N(n)){if(!z(n))throw new TypeError;e=n}}return e}function O(t,e,r,n){for(var o=t.length-1;o>=0;--o){var i=(0,t[o])(e,r,n);if(!C(i)&&!N(i)){if(!V(i))throw new TypeError;n=i}}return n}function I(t,e,r){var n=h.get(t);if(C(n)){if(!r)return;n=new f,h.set(t,n)}var o=n.get(e);if(C(o)){if(!r)return;o=new f,n.set(e,o)}return o}function k(t,e,r){if(x(t,e,r))return!0;var n=Z(e);return!N(n)&&k(t,n,r)}function x(t,e,r){var n=I(e,r,!1);return!C(n)&&F(n.has(t))}function j(t,e,r){if(x(t,e,r))return _(t,e,r);var n=Z(e);return N(n)?void 0:j(t,n,r)}function _(t,e,r){var n=I(e,r,!1);if(!C(n))return n.get(t)}function L(t,e,r,n){I(r,n,!0).set(t,e)}function A(t,e){var r=R(t,e),n=Z(t);if(null===n)return r;var o=A(n,e);if(o.length<=0)return r;if(r.length<=0)return o;for(var i=new p,a=[],c=0,u=r;c<u.length;c++){var s=u[c];i.has(s)||(i.add(s),a.push(s))}for(var l=0,f=o;l<f.length;l++){s=f[l];i.has(s)||(i.add(s),a.push(s))}return a}function R(t,e){var r=[],n=I(t,e,!1);if(C(n))return r;for(var o=Q(n.keys()),i=0;;){var a=J(o);if(!a)return r.length=i,r;var c=K(a);try{r[i]=c}catch(t){try{$(o)}finally{throw t}}i++}}function D(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function C(t){return void 0===t}function N(t){return null===t}function M(t){return"symbol"==typeof t}function V(t){return"object"==typeof t?null!==t:"function"==typeof t}function G(t,e){switch(D(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var r=3===e?"string":5===e?"number":"default",o=X(t,n);if(void 0!==o){var i=o.call(t,r);if(V(i))throw new TypeError;return i}return W(t,"default"===r?"number":r)}function W(t,e){if("string"===e){var r=t.toString;if(Y(r))if(!V(o=r.call(t)))return o;if(Y(n=t.valueOf))if(!V(o=n.call(t)))return o}else{var n;if(Y(n=t.valueOf))if(!V(o=n.call(t)))return o;var o,i=t.toString;if(Y(i))if(!V(o=i.call(t)))return o}throw new TypeError}function F(t){return!!t}function U(t){return""+t}function B(t){var e=G(t,3);return M(e)?e:U(e)}function H(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function Y(t){return"function"==typeof t}function z(t){return"function"==typeof t}function q(t){switch(D(t)){case 3:case 4:return!0;default:return!1}}function X(t,e){var r=t[e];if(null!=r){if(!Y(r))throw new TypeError;return r}}function Q(t){var e=X(t,o);if(!Y(e))throw new TypeError;var r=e.call(t);if(!V(r))throw new TypeError;return r}function K(t){return t.value}function J(t){var e=t.next();return!e.done&&e}function $(t){var e=t.return;e&&e.call(t)}function Z(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===s)return e;if(e!==s)return e;var r=t.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return e;var o=n.constructor;return"function"!=typeof o||o===t?e:o}function tt(){var t={},e=[],r=function(){function t(t,e,r){this._index=0,this._keys=t,this._values=e,this._selector=r}return t.prototype["@@iterator"]=function(){return this},t.prototype[o]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var r=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var r=this._find(t,!0);return this._values[r]=e,this},e.prototype.delete=function(e){var r=this._find(e,!1);if(r>=0){for(var n=this._keys.length,o=r+1;o<n;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new r(this._keys,this._values,n)},e.prototype.values=function(){return new r(this._keys,this._values,i)},e.prototype.entries=function(){return new r(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[o]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function n(t,e){return t}function i(t,e){return e}function a(t,e){return[t,e]}}function et(){return function(){function t(){this._map=new f}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[o]=function(){return this.keys()},t}()}function rt(){var t=16,r=u.create(),n=o();return function(){function t(){this._key=o()}return t.prototype.has=function(t){var e=i(t,!1);return void 0!==e&&u.has(e,this._key)},t.prototype.get=function(t){var e=i(t,!1);return void 0!==e?u.get(e,this._key):void 0},t.prototype.set=function(t,e){return i(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=i(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=o()},t}();function o(){var t;do{t="@@WeakMap@@"+s()}while(u.has(r,t));return r[t]=!0,t}function i(t,r){if(!e.call(t,n)){if(!r)return;Object.defineProperty(t,n,{value:u.create()})}return t[n]}function a(t,e){for(var r=0;r<e;++r)t[r]=255*Math.random()|0;return t}function c(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):a(new Uint8Array(t),t):a(new Array(t),t)}function s(){var e=c(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var r="",n=0;n<t;++n){var o=e[n];4!==n&&6!==n&&8!==n||(r+="-"),o<16&&(r+="0"),r+=o.toString(16).toLowerCase()}return r}}function nt(t){return t.__=void 0,delete t.__,t}t("decorate",y),t("metadata",v),t("defineMetadata",d),t("hasMetadata",m),t("hasOwnMetadata",g),t("getMetadata",b),t("getOwnMetadata",w),t("getMetadataKeys",S),t("getOwnMetadataKeys",E),t("deleteMetadata",T)}(o)}()}(n||(n={}))},308:(t,e)=>{"use strict";function r(t,e){void 0===e&&(e=function(t){return t instanceof Error});var r=t?t+"/":"";function n(t,n,o){void 0===o&&(o=e);var i=r+t;return Object.assign((function(t,e){var r={type:i,payload:t};return(n||e)&&(r.meta=Object.assign({},n,e)),o&&("boolean"==typeof o||o(t))&&(r.error=!0),r}),{type:i,toString:function(){return i},match:function(t){return t.type===i}})}return Object.assign(n,{async:function(t,e){return{type:r+t,started:n(t+"_STARTED",e,!1),done:n(t+"_DONE",e,!1),failed:n(t+"_FAILED",e,!0)}}})}e.P9=function(t,e){return t.type===e.type},e.ZP=r},42:(t,e,r)=>{t.exports=r.p+"204.emaww-library.worker.js"},595:(t,e,r)=>{t.exports=r.p+"500.emaww-library.worker.js"}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.p="https://dnu3v8fk2whvx.cloudfront.net/js/";var n={};return(()=>{"use strict";r.r(n);var t;r(660);!function(t){t[t.Transient=0]="Transient",t[t.Singleton=1]="Singleton",t[t.ResolutionScoped=2]="ResolutionScoped",t[t.ContainerScoped=3]="ContainerScoped"}(t||(t={}));const e=t;
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},o(t,e)};function i(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function a(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function c(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,c)}u((n=n.apply(t,e||[])).next())}))}function c(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}function u(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function l(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t}function f(t){return!!t.useClass}function p(t){return!!t.useFactory}var h=function(){function t(t){this.wrap=t,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return t.prototype.createProxy=function(t){var e,r=this,n=!1;return new Proxy({},this.createHandler((function(){return n||(e=t(r.wrap()),n=!0),e})))},t.prototype.createHandler=function(t){var e={};return this.reflectMethods.forEach((function(r){e[r]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e[0]=t(),Reflect[r].apply(void 0,l(e))}})),e},t}();function y(t){return"string"==typeof t||"symbol"==typeof t}function v(t){return"object"==typeof t&&"token"in t&&"transform"in t}function d(t){return!!t.useToken}function m(t){return null!=t.useValue}var g=function(){function t(){this._registryMap=new Map}return t.prototype.entries=function(){return this._registryMap.entries()},t.prototype.getAll=function(t){return this.ensure(t),this._registryMap.get(t)},t.prototype.get=function(t){this.ensure(t);var e=this._registryMap.get(t);return e[e.length-1]||null},t.prototype.set=function(t,e){this.ensure(t),this._registryMap.get(t).push(e)},t.prototype.setAll=function(t,e){this._registryMap.set(t,e)},t.prototype.has=function(t){return this.ensure(t),this._registryMap.get(t).length>0},t.prototype.clear=function(){this._registryMap.clear()},t.prototype.ensure=function(t){this._registryMap.has(t)||this._registryMap.set(t,[])},t}();const b=g;const w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(b);const S=function(){this.scopedResolutions=new Map};function E(t,e,r){var n,o,i=s(t.toString().match(/constructor\(([\w, ]+)\)/)||[],2)[1],a=function(t,e){return null===t?"at position #"+e:'"'+t.split(",")[e].trim()+'" at position #'+e}(void 0===i?null:i,e);return n="Cannot inject the dependency "+a+' of "'+t.name+'" constructor. Reason:',void 0===o&&(o="    "),l([n],r.message.split("\n").map((function(t){return o+t}))).join("\n")}var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(b),P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(b);const O=function(){this.preResolution=new T,this.postResolution=new P};var I=new Map,k=function(){function t(t){this.parent=t,this._registry=new w,this.interceptors=new O,this.disposed=!1,this.disposables=new Set}return t.prototype.register=function(t,r,n){var o;if(void 0===n&&(n={lifecycle:e.Transient}),this.ensureNotDisposed(),o=function(t){return f(t)||m(t)||d(t)||p(t)}(r)?r:{useClass:r},d(o))for(var i=[t],a=o;null!=a;){var c=a.useToken;if(i.includes(c))throw new Error("Token registration cycle detected! "+l(i,[c]).join(" -> "));i.push(c);var u=this._registry.get(c);a=u&&d(u.provider)?u.provider:null}if((n.lifecycle===e.Singleton||n.lifecycle==e.ContainerScoped||n.lifecycle==e.ResolutionScoped)&&(m(o)||p(o)))throw new Error('Cannot use lifecycle "'+e[n.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:o,options:n}),this},t.prototype.registerType=function(t,e){return this.ensureNotDisposed(),y(e)?this.register(t,{useToken:e}):this.register(t,{useClass:e})},t.prototype.registerInstance=function(t,e){return this.ensureNotDisposed(),this.register(t,{useValue:e})},t.prototype.registerSingleton=function(t,r){if(this.ensureNotDisposed(),y(t)){if(y(r))return this.register(t,{useToken:r},{lifecycle:e.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:e.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var n=t;return r&&!y(r)&&(n=r),this.register(t,{useClass:n},{lifecycle:e.Singleton})},t.prototype.resolve=function(t,e){void 0===e&&(e=new S),this.ensureNotDisposed();var r=this.getRegistration(t);if(!r&&y(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),r){var n=this.resolveRegistration(r,e);return this.executePostResolutionInterceptor(t,n,"Single"),n}if(function(t){return"function"==typeof t||t instanceof h}(t)){n=this.construct(t,e);return this.executePostResolutionInterceptor(t,n,"Single"),n}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},t.prototype.executePreResolutionInterceptor=function(t,e){var r,n;if(this.interceptors.preResolution.has(t)){var o=[];try{for(var i=u(this.interceptors.preResolution.getAll(t)),a=i.next();!a.done;a=i.next()){var c=a.value;"Once"!=c.options.frequency&&o.push(c),c.callback(t,e)}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}this.interceptors.preResolution.setAll(t,o)}},t.prototype.executePostResolutionInterceptor=function(t,e,r){var n,o;if(this.interceptors.postResolution.has(t)){var i=[];try{for(var a=u(this.interceptors.postResolution.getAll(t)),c=a.next();!c.done;c=a.next()){var s=c.value;"Once"!=s.options.frequency&&i.push(s),s.callback(t,e,r)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(t,i)}},t.prototype.resolveRegistration=function(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===e.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var n,o=t.options.lifecycle===e.Singleton,i=t.options.lifecycle===e.ContainerScoped,a=o||i;return n=m(t.provider)?t.provider.useValue:d(t.provider)?a?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):f(t.provider)?a?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):p(t.provider)?t.provider.useFactory(this):this.construct(t.provider,r),t.options.lifecycle===e.ResolutionScoped&&r.scopedResolutions.set(t,n),n},t.prototype.resolveAll=function(t,e){var r=this;void 0===e&&(e=new S),this.ensureNotDisposed();var n=this.getAllRegistrations(t);if(!n&&y(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),n){var o=n.map((function(t){return r.resolveRegistration(t,e)}));return this.executePostResolutionInterceptor(t,o,"All"),o}var i=[this.construct(t,e)];return this.executePostResolutionInterceptor(t,i,"All"),i},t.prototype.isRegistered=function(t,e){return void 0===e&&(e=!1),this.ensureNotDisposed(),this._registry.has(t)||e&&(this.parent||!1)&&this.parent.isRegistered(t,!0)},t.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},t.prototype.clearInstances=function(){var t,e;this.ensureNotDisposed();try{for(var r=u(this._registry.entries()),n=r.next();!n.done;n=r.next()){var o=s(n.value,2),i=o[0],a=o[1];this._registry.setAll(i,a.filter((function(t){return!m(t.provider)})).map((function(t){return t.instance=void 0,t})))}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.createChildContainer=function(){var r,n;this.ensureNotDisposed();var o=new t(this);try{for(var i=u(this._registry.entries()),a=i.next();!a.done;a=i.next()){var c=s(a.value,2),l=c[0],f=c[1];f.some((function(t){return t.options.lifecycle===e.ContainerScoped}))&&o._registry.setAll(l,f.map((function(t){return t.options.lifecycle===e.ContainerScoped?{provider:t.provider,options:t.options}:t})))}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return o},t.prototype.beforeResolution=function(t,e,r){void 0===r&&(r={frequency:"Always"}),this.interceptors.preResolution.set(t,{callback:e,options:r})},t.prototype.afterResolution=function(t,e,r){void 0===r&&(r={frequency:"Always"}),this.interceptors.postResolution.set(t,{callback:e,options:r})},t.prototype.dispose=function(){return a(this,void 0,void 0,(function(){var t;return c(this,(function(e){switch(e.label){case 0:return this.disposed=!0,t=[],this.disposables.forEach((function(e){var r=e.dispose();r&&t.push(r)})),[4,Promise.all(t)];case 1:return e.sent(),[2]}}))}))},t.prototype.getRegistration=function(t){return this.isRegistered(t)?this._registry.get(t):this.parent?this.parent.getRegistration(t):null},t.prototype.getAllRegistrations=function(t){return this.isRegistered(t)?this._registry.getAll(t):this.parent?this.parent.getAllRegistrations(t):null},t.prototype.construct=function(t,e){var r=this;if(t instanceof h)return t.createProxy((function(t){return r.resolve(t,e)}));var n,o=function(){var n=I.get(t);if(!n||0===n.length){if(0===t.length)return new t;throw new Error('TypeInfo not known for "'+t.name+'"')}var o=n.map(r.resolveParams(e,t));return new(t.bind.apply(t,l([void 0],o)))}();return"function"!=typeof(n=o).dispose||n.dispose.length>0||this.disposables.add(o),o},t.prototype.resolveParams=function(t,e){var r=this;return function(n,o){var i,a,c,u;try{return"object"==typeof(u=n)&&"token"in u&&"multiple"in u?v(n)?n.multiple?(i=r.resolve(n.transform)).transform.apply(i,l([r.resolveAll(n.token)],n.transformArgs)):(a=r.resolve(n.transform)).transform.apply(a,l([r.resolve(n.token,t)],n.transformArgs)):n.multiple?r.resolveAll(n.token):r.resolve(n.token,t):v(n)?(c=r.resolve(n.transform,t)).transform.apply(c,l([r.resolve(n.token,t)],n.transformArgs)):r.resolve(n,t)}catch(t){throw new Error(E(e,o,t))}}},t.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},t}(),x=new k;var j="injectionTokens";const _=function(t){return e=t,function(t,n,o){var i=Reflect.getOwnMetadata(j,t)||{};i[o]=r?{token:e,transform:r.transformToken,transformArgs:r.args||[]}:e,Reflect.defineMetadata(j,i,t)};var e,r};const L=function(){return function(t){I.set(t,function(t){var e=Reflect.getMetadata("design:paramtypes",t)||[],r=Reflect.getOwnMetadata(j,t)||{};return Object.keys(r).forEach((function(t){e[+t]=r[t]})),e}(t))}};function A(t){var e;return function(r){return null==e&&(e=t(r)),e}}if("undefined"==typeof Reflect||!Reflect.getMetadata)throw new Error("tsyringe requires a reflect polyfill. Please add 'import \"reflect-metadata\"' to the top of your entry point.");var R="IVisitorService",D="IVisitorRepository",C="IVisitorDataProvider",N="Visitor-ILibrarySessionRepository";function M(t){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function V(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==M(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==M(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===M(i)?i:String(i)),n)}var o,i}var G,W=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._id=e}var e,r,n;return e=t,(r=[{key:"id",get:function(){return this._id}},{key:"equal",value:function(t){return this.id===t.id}}])&&V(e.prototype,r),n&&V(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),F=function(t){return t.GET="GET",t.POST="POST",t.PUT="PUT",t.DELETE="DELETE",t.PATCH="PATCH",t}({});function U(t){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},U(t)}function B(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==U(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==U(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===U(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var H=function(t){return t.APPLICATION_GZIP="application/gzip",t.APPLICATION_JSON="application/json",t.APPLICATION_JSON_CHAR_SET_UTF8="application/json; charset=utf8",t.APPLICATION_OCTET_STREAM="application/octet-stream",t.APPLICATION_PDF="application/pdf",t.APPLICATION_XML="application/xml",t.APPLICATION_X_MATLAB_DATA="application/x-matlab-data",t.APPLICATION_ZIP="application/zip",t.TEXT_CSV="text/csv",t.TEXT_PLAIN="text/plain",t}({}),Y=function(t){return t.FILE_EXTENSION_APPLICATION_GZIP="gz",t.FILE_EXTENSION_APPLICATION_JSON="json",t.FILE_EXTENSION_APPLICATION_PDF="pdf",t.FILE_EXTENSION_APPLICATION_XML="xml",t.FILE_EXTENSION_APPLICATION_X_MATLAB_DATA="mat",t.FILE_EXTENSION_APPLICATION_ZIP="zip",t.FILE_EXTENSION_TEXT_CSV="csv",t.FILE_EXTENSION_TEXT_PLAIN="txt",t}(Y||{}),z=(B(G={},Y.FILE_EXTENSION_APPLICATION_GZIP,H.APPLICATION_GZIP),B(G,Y.FILE_EXTENSION_APPLICATION_JSON,H.APPLICATION_JSON),B(G,Y.FILE_EXTENSION_APPLICATION_PDF,H.APPLICATION_PDF),B(G,Y.FILE_EXTENSION_APPLICATION_XML,H.APPLICATION_XML),B(G,Y.FILE_EXTENSION_APPLICATION_X_MATLAB_DATA,H.APPLICATION_X_MATLAB_DATA),B(G,Y.FILE_EXTENSION_APPLICATION_ZIP,H.APPLICATION_ZIP),B(G,Y.FILE_EXTENSION_TEXT_CSV,H.TEXT_CSV),B(G,Y.FILE_EXTENSION_TEXT_PLAIN,H.TEXT_PLAIN),function(t){return t.Accept="Accept",t.ContentDisposition="Content-Disposition",t.ContentType="Content-Type",t.Authorization="Authorization",t}({}));function q(t,e){return function(){return t.apply(e,arguments)}}const{toString:X}=Object.prototype,{getPrototypeOf:Q}=Object,K=(J=Object.create(null),t=>{const e=X.call(t);return J[e]||(J[e]=e.slice(8,-1).toLowerCase())});var J;const $=t=>(t=t.toLowerCase(),e=>K(e)===t),Z=t=>e=>typeof e===t,{isArray:tt}=Array,et=Z("undefined");const rt=$("ArrayBuffer");const nt=Z("string"),ot=Z("function"),it=Z("number"),at=t=>null!==t&&"object"==typeof t,ct=t=>{if("object"!==K(t))return!1;const e=Q(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},ut=$("Date"),st=$("File"),lt=$("Blob"),ft=$("FileList"),pt=$("URLSearchParams");function ht(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),tt(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{const o=r?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let a;for(n=0;n<i;n++)a=o[n],e.call(null,t[a],a,t)}}function yt(t,e){e=e.toLowerCase();const r=Object.keys(t);let n,o=r.length;for(;o-- >0;)if(n=r[o],e===n.toLowerCase())return n;return null}const vt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,dt=t=>!et(t)&&t!==vt;const mt=(gt="undefined"!=typeof Uint8Array&&Q(Uint8Array),t=>gt&&t instanceof gt);var gt;const bt=$("HTMLFormElement"),wt=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),St=$("RegExp"),Et=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};ht(r,((r,o)=>{!1!==e(r,o,t)&&(n[o]=r)})),Object.defineProperties(t,n)},Tt="abcdefghijklmnopqrstuvwxyz",Pt="0123456789",Ot={DIGIT:Pt,ALPHA:Tt,ALPHA_DIGIT:Tt+Tt.toUpperCase()+Pt};const It={isArray:tt,isArrayBuffer:rt,isBuffer:function(t){return null!==t&&!et(t)&&null!==t.constructor&&!et(t.constructor)&&ot(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{const e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||X.call(t)===e||ot(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&rt(t.buffer),e},isString:nt,isNumber:it,isBoolean:t=>!0===t||!1===t,isObject:at,isPlainObject:ct,isUndefined:et,isDate:ut,isFile:st,isBlob:lt,isRegExp:St,isFunction:ot,isStream:t=>at(t)&&ot(t.pipe),isURLSearchParams:pt,isTypedArray:mt,isFileList:ft,forEach:ht,merge:function t(){const{caseless:e}=dt(this)&&this||{},r={},n=(n,o)=>{const i=e&&yt(r,o)||o;ct(r[i])&&ct(n)?r[i]=t(r[i],n):ct(n)?r[i]=t({},n):tt(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&ht(arguments[t],n);return r},extend:(t,e,r,{allOwnKeys:n}={})=>(ht(e,((e,n)=>{r&&ot(e)?t[n]=q(e,r):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let o,i,a;const c={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)a=o[i],n&&!n(a,t,e)||c[a]||(e[a]=t[a],c[a]=!0);t=!1!==r&&Q(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:K,kindOfTest:$,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(tt(t))return t;let e=t.length;if(!it(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:bt,hasOwnProperty:wt,hasOwnProp:wt,reduceDescriptors:Et,freezeMethods:t=>{Et(t,((e,r)=>{if(ot(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];ot(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach((t=>{r[t]=!0}))};return tt(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,r){return e.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:yt,global:vt,isContextDefined:dt,ALPHABET:Ot,generateString:(t=16,e=Ot.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r},isSpecCompliantForm:function(t){return!!(t&&ot(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(at(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=tt(t)?[]:{};return ht(t,((t,e)=>{const i=r(t,n+1);!et(i)&&(o[e]=i)})),e[n]=void 0,o}}return t};return r(t,0)}};function kt(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}It.inherits(kt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:It.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const xt=kt.prototype,jt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{jt[t]={value:t}})),Object.defineProperties(kt,jt),Object.defineProperty(xt,"isAxiosError",{value:!0}),kt.from=(t,e,r,n,o,i)=>{const a=Object.create(xt);return It.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),kt.call(a,t.message,e,r,n,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const _t=kt,Lt=null;function At(t){return It.isPlainObject(t)||It.isArray(t)}function Rt(t){return It.endsWith(t,"[]")?t.slice(0,-2):t}function Dt(t,e,r){return t?t.concat(e).map((function(t,e){return t=Rt(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const Ct=It.toFlatObject(It,{},null,(function(t){return/^is[A-Z]/.test(t)}));const Nt=function(t,e,r){if(!It.isObject(t))throw new TypeError("target must be an object");e=e||new(Lt||FormData);const n=(r=It.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!It.isUndefined(e[t])}))).metaTokens,o=r.visitor||s,i=r.dots,a=r.indexes,c=(r.Blob||"undefined"!=typeof Blob&&Blob)&&It.isSpecCompliantForm(e);if(!It.isFunction(o))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(It.isDate(t))return t.toISOString();if(!c&&It.isBlob(t))throw new _t("Blob is not supported. Use a Buffer instead.");return It.isArrayBuffer(t)||It.isTypedArray(t)?c&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function s(t,r,o){let c=t;if(t&&!o&&"object"==typeof t)if(It.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(It.isArray(t)&&function(t){return It.isArray(t)&&!t.some(At)}(t)||(It.isFileList(t)||It.endsWith(r,"[]"))&&(c=It.toArray(t)))return r=Rt(r),c.forEach((function(t,n){!It.isUndefined(t)&&null!==t&&e.append(!0===a?Dt([r],n,i):null===a?r:r+"[]",u(t))})),!1;return!!At(t)||(e.append(Dt(o,r,i),u(t)),!1)}const l=[],f=Object.assign(Ct,{defaultVisitor:s,convertValue:u,isVisitable:At});if(!It.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!It.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),It.forEach(r,(function(r,i){!0===(!(It.isUndefined(r)||null===r)&&o.call(e,r,It.isString(i)?i.trim():i,n,f))&&t(r,n?n.concat(i):[i])})),l.pop()}}(t),e};function Mt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function Vt(t,e){this._pairs=[],t&&Nt(t,this,e)}const Gt=Vt.prototype;Gt.append=function(t,e){this._pairs.push([t,e])},Gt.toString=function(t){const e=t?function(e){return t.call(this,e,Mt)}:Mt;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const Wt=Vt;function Ft(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ut(t,e,r){if(!e)return t;const n=r&&r.encode||Ft,o=r&&r.serialize;let i;if(i=o?o(e,r):It.isURLSearchParams(e)?e.toString():new Wt(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const Bt=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){It.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},Ht={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Yt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Wt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};const zt=function(t){function e(t,r,n,o){let i=t[o++];const a=Number.isFinite(+i),c=o>=t.length;if(i=!i&&It.isArray(n)?n.length:i,c)return It.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a;n[i]&&It.isObject(n[i])||(n[i]=[]);return e(t,r,n[i],o)&&It.isArray(n[i])&&(n[i]=function(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],e[i]=t[i];return e}(n[i])),!a}if(It.isFormData(t)&&It.isFunction(t.entries)){const r={};return It.forEachEntry(t,((t,n)=>{e(function(t){return It.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,r,0)})),r}return null},qt={"Content-Type":void 0};const Xt={transitional:Ht,adapter:["xhr","http"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=It.isObject(t);o&&It.isHTMLForm(t)&&(t=new FormData(t));if(It.isFormData(t))return n&&n?JSON.stringify(zt(t)):t;if(It.isArrayBuffer(t)||It.isBuffer(t)||It.isStream(t)||It.isFile(t)||It.isBlob(t))return t;if(It.isArrayBufferView(t))return t.buffer;if(It.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Nt(t,new Yt.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return Yt.isNode&&It.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=It.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Nt(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,r){if(It.isString(t))try{return(e||JSON.parse)(t),It.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Xt.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(t&&It.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw _t.from(t,_t.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Yt.classes.FormData,Blob:Yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};It.forEach(["delete","get","head"],(function(t){Xt.headers[t]={}})),It.forEach(["post","put","patch"],(function(t){Xt.headers[t]=It.merge(qt)}));const Qt=Xt,Kt=It.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Jt=Symbol("internals");function $t(t){return t&&String(t).trim().toLowerCase()}function Zt(t){return!1===t||null==t?t:It.isArray(t)?t.map(Zt):String(t)}function te(t,e,r,n,o){return It.isFunction(n)?n.call(this,e,r):(o&&(e=r),It.isString(e)?It.isString(n)?-1!==e.indexOf(n):It.isRegExp(n)?n.test(e):void 0:void 0)}class ee{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=$t(e);if(!o)throw new Error("header name must be a non-empty string");const i=It.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=Zt(t))}const i=(t,e)=>It.forEach(t,((t,r)=>o(t,r,e)));return It.isPlainObject(t)||t instanceof this.constructor?i(t,e):It.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim())?i((t=>{const e={};let r,n,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!r||e[r]&&Kt[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)})),e})(t),e):null!=t&&o(e,t,r),this}get(t,e){if(t=$t(t)){const r=It.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(It.isFunction(e))return e.call(this,t,r);if(It.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=$t(t)){const r=It.findKey(this,t);return!(!r||void 0===this[r]||e&&!te(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=$t(t)){const o=It.findKey(r,t);!o||e&&!te(0,r[o],o,e)||(delete r[o],n=!0)}}return It.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const o=e[r];t&&!te(0,this[o],o,t,!0)||(delete this[o],n=!0)}return n}normalize(t){const e=this,r={};return It.forEach(this,((n,o)=>{const i=It.findKey(r,o);if(i)return e[i]=Zt(n),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,r)=>e.toUpperCase()+r))}(o):String(o).trim();a!==o&&delete e[o],e[a]=Zt(n),r[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return It.forEach(this,((r,n)=>{null!=r&&!1!==r&&(e[n]=t&&It.isArray(r)?r.join(", "):r)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach((t=>r.set(t))),r}static accessor(t){const e=(this[Jt]=this[Jt]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=$t(t);e[n]||(!function(t,e){const r=It.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+r,{value:function(t,r,o){return this[n].call(this,e,t,r,o)},configurable:!0})}))}(r,t),e[n]=!0)}return It.isArray(t)?t.forEach(n):n(t),this}}ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),It.freezeMethods(ee.prototype),It.freezeMethods(ee);const re=ee;function ne(t,e){const r=this||Qt,n=e||r,o=re.from(n.headers);let i=n.data;return It.forEach(t,(function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function oe(t){return!(!t||!t.__CANCEL__)}function ie(t,e,r){_t.call(this,null==t?"canceled":t,_t.ERR_CANCELED,e,r),this.name="CanceledError"}It.inherits(ie,_t,{__CANCEL__:!0});const ae=ie;const ce=Yt.isStandardBrowserEnv?{write:function(t,e,r,n,o,i){const a=[];a.push(t+"="+encodeURIComponent(e)),It.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),It.isString(n)&&a.push("path="+n),It.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function ue(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const se=Yt.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let r;function n(r){let n=r;return t&&(e.setAttribute("href",n),n=e.href),e.setAttribute("href",n),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return r=n(window.location.href),function(t){const e=It.isString(t)?n(t):t;return e.protocol===r.protocol&&e.host===r.host}}():function(){return!0};const le=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(c){const u=Date.now(),s=n[a];o||(o=u),r[i]=c,n[i]=u;let l=a,f=0;for(;l!==i;)f+=r[l++],l%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),u-o<e)return;const p=s&&u-s;return p?Math.round(1e3*f/p):void 0}};function fe(t,e){let r=0;const n=le(50,250);return o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,c=i-r,u=n(c);r=i;const s={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&i<=a?(a-i)/u:void 0,event:o};s[e?"download":"upload"]=!0,t(s)}}const pe="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){let n=t.data;const o=re.from(t.headers).normalize(),i=t.responseType;let a;function c(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}It.isFormData(n)&&(Yt.isStandardBrowserEnv||Yt.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let u=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",r=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(e+":"+r))}const s=ue(t.baseURL,t.url);function l(){if(!u)return;const n=re.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new _t("Request failed with status code "+r.status,[_t.ERR_BAD_REQUEST,_t.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}((function(t){e(t),c()}),(function(t){r(t),c()}),{data:i&&"text"!==i&&"json"!==i?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u}),u=null}if(u.open(t.method.toUpperCase(),Ut(s,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(new _t("Request aborted",_t.ECONNABORTED,t,u)),u=null)},u.onerror=function(){r(new _t("Network Error",_t.ERR_NETWORK,t,u)),u=null},u.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const n=t.transitional||Ht;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(new _t(e,n.clarifyTimeoutError?_t.ETIMEDOUT:_t.ECONNABORTED,t,u)),u=null},Yt.isStandardBrowserEnv){const e=(t.withCredentials||se(s))&&t.xsrfCookieName&&ce.read(t.xsrfCookieName);e&&o.set(t.xsrfHeaderName,e)}void 0===n&&o.setContentType(null),"setRequestHeader"in u&&It.forEach(o.toJSON(),(function(t,e){u.setRequestHeader(e,t)})),It.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),i&&"json"!==i&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",fe(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",fe(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=e=>{u&&(r(!e||e.type?new ae(null,t,u):e),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const f=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(s);f&&-1===Yt.protocols.indexOf(f)?r(new _t("Unsupported protocol "+f+":",_t.ERR_BAD_REQUEST,t)):u.send(n||null)}))},he={http:Lt,xhr:pe};It.forEach(he,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const ye={getAdapter:t=>{t=It.isArray(t)?t:[t];const{length:e}=t;let r,n;for(let o=0;o<e&&(r=t[o],!(n=It.isString(r)?he[r.toLowerCase()]:r));o++);if(!n){if(!1===n)throw new _t(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(It.hasOwnProp(he,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!It.isFunction(n))throw new TypeError("adapter is not a function");return n},adapters:he};function ve(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ae(null,t)}function de(t){ve(t),t.headers=re.from(t.headers),t.data=ne.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return ye.getAdapter(t.adapter||Qt.adapter)(t).then((function(e){return ve(t),e.data=ne.call(t,t.transformResponse,e),e.headers=re.from(e.headers),e}),(function(e){return oe(e)||(ve(t),e&&e.response&&(e.response.data=ne.call(t,t.transformResponse,e.response),e.response.headers=re.from(e.response.headers))),Promise.reject(e)}))}const me=t=>t instanceof re?t.toJSON():t;function ge(t,e){e=e||{};const r={};function n(t,e,r){return It.isPlainObject(t)&&It.isPlainObject(e)?It.merge.call({caseless:r},t,e):It.isPlainObject(e)?It.merge({},e):It.isArray(e)?e.slice():e}function o(t,e,r){return It.isUndefined(e)?It.isUndefined(t)?void 0:n(void 0,t,r):n(t,e,r)}function i(t,e){if(!It.isUndefined(e))return n(void 0,e)}function a(t,e){return It.isUndefined(e)?It.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function c(r,o,i){return i in e?n(r,o):i in t?n(void 0,r):void 0}const u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(t,e)=>o(me(t),me(e),!0)};return It.forEach(Object.keys(t).concat(Object.keys(e)),(function(n){const i=u[n]||o,a=i(t[n],e[n],n);It.isUndefined(a)&&i!==c||(r[n]=a)})),r}const be="1.3.5",we={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{we[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const Se={};we.transitional=function(t,e,r){function n(t,e){return"[Axios v1.3.5] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,o,i)=>{if(!1===t)throw new _t(n(o," has been removed"+(e?" in "+e:"")),_t.ERR_DEPRECATED);return e&&!Se[o]&&(Se[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,o,i)}};const Ee={assertOptions:function(t,e,r){if("object"!=typeof t)throw new _t("options must be an object",_t.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],a=e[i];if(a){const e=t[i],r=void 0===e||a(e,i,t);if(!0!==r)throw new _t("option "+i+" must be "+r,_t.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new _t("Unknown option "+i,_t.ERR_BAD_OPTION)}},validators:we},Te=Ee.validators;class Pe{constructor(t){this.defaults=t,this.interceptors={request:new Bt,response:new Bt}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=ge(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;let i;void 0!==r&&Ee.assertOptions(r,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),null!=n&&(It.isFunction(n)?e.paramsSerializer={serialize:n}:Ee.assertOptions(n,{encode:Te.function,serialize:Te.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase(),i=o&&It.merge(o.common,o[e.method]),i&&It.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=re.concat(i,o);const a=[];let c=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(c=c&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const u=[];let s;this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)}));let l,f=0;if(!c){const t=[de.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,u),l=t.length,s=Promise.resolve(e);f<l;)s=s.then(t[f++],t[f++]);return s}l=a.length;let p=e;for(f=0;f<l;){const t=a[f++],e=a[f++];try{p=t(p)}catch(t){e.call(this,t);break}}try{s=de.call(this,p)}catch(t){return Promise.reject(t)}for(f=0,l=u.length;f<l;)s=s.then(u[f++],u[f++]);return s}getUri(t){return Ut(ue((t=ge(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}It.forEach(["delete","get","head","options"],(function(t){Pe.prototype[t]=function(e,r){return this.request(ge(r||{},{method:t,url:e,data:(r||{}).data}))}})),It.forEach(["post","put","patch"],(function(t){function e(e){return function(r,n,o){return this.request(ge(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Pe.prototype[t]=e(),Pe.prototype[t+"Form"]=e(!0)}));const Oe=Pe;class Ie{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const r=this;this.promise.then((t=>{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t,n,o){r.reason||(r.reason=new ae(t,n,o),e(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new Ie((function(e){t=e})),cancel:t}}}const ke=Ie;const xe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(xe).forEach((([t,e])=>{xe[e]=t}));const je=xe;const _e=function t(e){const r=new Oe(e),n=q(Oe.prototype.request,r);return It.extend(n,Oe.prototype,r,{allOwnKeys:!0}),It.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(ge(e,r))},n}(Qt);_e.Axios=Oe,_e.CanceledError=ae,_e.CancelToken=ke,_e.isCancel=oe,_e.VERSION=be,_e.toFormData=Nt,_e.AxiosError=_t,_e.Cancel=_e.CanceledError,_e.all=function(t){return Promise.all(t)},_e.spread=function(t){return function(e){return t.apply(null,e)}},_e.isAxiosError=function(t){return It.isObject(t)&&!0===t.isAxiosError},_e.mergeConfig=ge,_e.AxiosHeaders=re,_e.formToJSON=t=>zt(It.isHTMLForm(t)?new FormData(t):t),_e.HttpStatusCode=je,_e.default=_e;const Le=_e;function Ae(t){return Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ae(t)}function Re(t){return function(t){if(Array.isArray(t))return De(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return De(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return De(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function De(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ce(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Ae(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ae(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Ae(i)?i:String(i)),n)}var o,i}function Ne(t){var e=Ge();return function(){var r,n=Fe(t);if(e){var o=Fe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===Ae(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function Me(t){var e="function"==typeof Map?new Map:void 0;return Me=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return Ve(t,arguments,Fe(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),We(n,t)},Me(t)}function Ve(t,e,r){return Ve=Ge()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&We(o,r.prototype),o},Ve.apply(null,arguments)}function Ge(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function We(t,e){return We=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},We(t,e)}function Fe(t){return Fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fe(t)}var Ue=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&We(t,e)}(i,t);var e,r,n,o=Ne(i);function i(t,e,r,n){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(a=o.call(this,r)).code=t,a.name=e,a.errorStack=n,a}return e=i,(r=[{key:"toErrorObject",value:function(){return{code:this.code,name:this.name,message:this.message,errorStack:this.errorStack}}},{key:"toErrorStack",value:function(){return[{code:this.code,name:this.name,detail:this.message}].concat(Re(this.errorStack||[]))}},{key:"toString",value:function(){var t=this.errorStack?this.errorStack.reduce((function(t,e){return t+="\t".concat(e.code||""," ").concat(e.name||""," ").concat(e.detail,"\n")}),""):"";return"Service Error: ".concat(this.code," - ").concat(this.message,". ErrorStack:\n")+t}}])&&Ce(e.prototype,r),n&&Ce(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Me(Error));function Be(t){return Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Be(t)}function He(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qe(n.key),n)}}function Ye(t,e,r){return e&&He(t.prototype,e),r&&He(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ze(t,e,r){return(e=qe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qe(t){var e=function(t,e){if("object"!==Be(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Be(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Be(e)?e:String(e)}var Xe=Ye((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}));ze(Xe,"ERROR_CODE_UNDEFINED",9999999),ze(Xe,"ERROR_NAME_UNDEFINED","Undefined error");function Qe(t){return Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qe(t)}function Ke(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Qe(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Qe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Qe(i)?i:String(i)),n)}var o,i}function Je(t,e){return Je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Je(t,e)}function $e(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ze(t);if(e){var o=Ze(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===Qe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function Ze(t){return Ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ze(t)}var tr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Je(t,e)}(i,t);var e,r,n,o=$e(i);function i(t,e,r,n,a){var c;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(c=o.call(this,t,e,r,a)).httpErrorCode=n,c}return e=i,r&&Ke(e.prototype,r),n&&Ke(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(Ue);function er(t){return er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},er(t)}function rr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==er(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==er(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===er(i)?i:String(i)),n)}var o,i}var nr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.responseData=e}var e,r,n;return e=t,n=[{key:"create",value:function(e){return new t(e)}}],(r=[{key:"getBody",value:function(){return this.responseData.data}},{key:"locationHeader",get:function(){return this.responseData.headers.location}}])&&rr(e.prototype,r),n&&rr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function or(t){return or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},or(t)}function ir(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ir=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==or(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ar(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function cr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ur(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?cr(Object(r),!0).forEach((function(e){lr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function sr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fr(n.key),n)}}function lr(t,e,r){return(e=fr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fr(t){var e=function(t,e){if("object"!==or(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===or(e)?e:String(e)}var pr=function(){function t(e,r,n){var o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),lr(this,"config",{headers:{},params:{}}),this.config=ur(ur(ur({},this.config),null!=n?n:{}),{},{params:ur({},null!==(o=null==n?void 0:n.params)&&void 0!==o?o:{})}),this.config.method=e,this.config.url=r,this.cancelTokenSource=Le.CancelToken.source()}var e,r,n,o,i;return e=t,r=[{key:"getUrl",value:function(){return Le.getUri(this.config)}},{key:"execute",value:(o=ir().mark((function t(){var e,r,n,o,i;return ir().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Le.request(ur(ur({},this.config),{},{cancelToken:this.cancelTokenSource.token}));case 3:return e=t.sent,t.abrupt("return",nr.create(e));case 7:if(t.prev=7,t.t0=t.catch(0),!this.isAxiosError(t.t0)){t.next=13;break}throw o=(null===(r=t.t0.response)||void 0===r?void 0:r.status)||t.t0.code&&parseInt(t.t0.code)||void 0,i=null===(n=t.t0.response)||void 0===n?void 0:n.data,new tr((null==i?void 0:i.code)||Xe.ERROR_CODE_UNDEFINED,(null==i?void 0:i.name)||Xe.ERROR_NAME_UNDEFINED,(null==i?void 0:i.message)||"Unknown http error",o,null==i?void 0:i.errorStack);case 13:throw new tr(Xe.ERROR_CODE_UNDEFINED,Xe.ERROR_NAME_UNDEFINED,t.t0.message);case 14:case"end":return t.stop()}}),t,this,[[0,7]])})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){ar(i,r,n,a,c,"next",t)}function c(t){ar(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"cancel",value:function(){this.cancelTokenSource&&this.cancelTokenSource.cancel()}},{key:"setBody",value:function(t,e){this.config.data=t,this.config.headers&&(this.config.headers[z.ContentType]=e||H.APPLICATION_JSON)}},{key:"setQueryParameter",value:function(t,e){this.config.params[t]=e}},{key:"setHeaderField",value:function(t,e){this.config.headers&&(this.config.headers[t]=e)}},{key:"setResponseType",value:function(t){this.config.responseType=t}},{key:"setTimeout",value:function(t){this.config.timeout=t}},{key:"isAxiosError",value:function(t){return"object"===or(t)&&Boolean(t)&&!0===t.isAxiosError}}],r&&sr(e.prototype,r),n&&sr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function hr(t){return hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hr(t)}function yr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==hr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==hr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===hr(i)?i:String(i)),n)}var o,i}var vr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUri=e,this.defaultRequestConfig={headers:{},params:{}}}var e,r,n;return e=t,(r=[{key:"setDefaultRequestHeader",value:function(t,e){this.defaultRequestConfig.headers&&(this.defaultRequestConfig.headers[t]=e)}},{key:"createRequest",value:function(t,e){return new pr(t,this.getFullUri(e),this.defaultRequestConfig)}},{key:"getFullUri",value:function(t){return t?this.baseUri.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):this.baseUri}}])&&yr(e.prototype,r),n&&yr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),dr=function(t){return t.Development="development",t.Production="production",t}({});function mr(t){var e,r=void 0;"undefined"!=typeof window&&((r=null===(e=sessionStorage)||void 0===e?void 0:e.getItem(t))&&0!==r.length||(r=void 0));var n=r||{NODE_ENV:"production",LIBRARY_API_BASE_URL:"https://awwtagbackup.emaww.com",AWW22_BUILD_VERSION:"22.1.3",AWWS_CLIENT_LIB_WEB_API_URL:"https://dnu3v8fk2whvx.cloudfront.net",LIBRARY_DEMO_APP_TOKEN:"192.168.1.127",LIBRARY_DEMO_APP_PORT:"8081",LIBRARY_DEMO_APP_URL:"0.0.0.0",TIMER_EVENT_INTERVAL:"1000"}[t];if(!n)throw new Error("Process env ".concat(t," is missing"));return n}const gr={nodeEnv:(Sr="production",Sr||dr.Development),libraryApiBaseUrl:mr("LIBRARY_API_BASE_URL"),timerEventInterval:(br="TIMER_EVENT_INTERVAL",wr=mr(br),parseInt(wr)),awwBuildVersion:mr("AWW22_BUILD_VERSION")};var br,wr,Sr;function Er(t){return Er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Er(t)}function Tr(t){var e=function(t,e){if("object"!==Er(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Er(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Er(e)?e:String(e)}function Pr(t,e,r){return(e=Tr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Or(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ir(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Or(Object(r),!0).forEach((function(e){Pr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Or(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function kr(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var xr,jr,_r="function"==typeof Symbol&&Symbol.observable||"@@observable",Lr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Ar={INIT:"@@redux/INIT"+Lr(),REPLACE:"@@redux/REPLACE"+Lr(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Lr()}};function Rr(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Dr(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var o=e[n];0,"function"==typeof t[o]&&(r[o]=t[o])}var i,a=Object.keys(r);try{!function(t){Object.keys(t).forEach((function(e){var r=t[e];if(void 0===r(void 0,{type:Ar.INIT}))throw new Error(kr(12));if(void 0===r(void 0,{type:Ar.PROBE_UNKNOWN_ACTION()}))throw new Error(kr(13))}))}(r)}catch(t){i=t}return function(t,e){if(void 0===t&&(t={}),i)throw i;for(var n=!1,o={},c=0;c<a.length;c++){var u=a[c],s=r[u],l=t[u],f=s(l,e);if(void 0===f){e&&e.type;throw new Error(kr(14))}o[u]=f,n=n||f!==l}return(n=n||a.length!==Object.keys(t).length)?o:t}}function Cr(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}var Nr="true"===(null===(xr=sessionStorage)||void 0===xr?void 0:xr.getItem("aww22_debug_isDevToolsEnabled")),Mr=(gr.nodeEnv===dr.Development||Nr)&&(null===(jr=window)||void 0===jr?void 0:jr.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)||Cr;function Vr(t){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vr(t)}function Gr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Wr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wr(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function Wr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Fr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ur(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Fr(Object(r),!0).forEach((function(e){Hr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Br(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Yr(n.key),n)}}function Hr(t,e,r){return(e=Yr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yr(t){var e=function(t,e){if("object"!==Vr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Vr(e)?e:String(e)}var zr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Hr(this,"keysToRemove",[]),this.reducers=Ur({},e),this.combinedReducer=Dr(this.reducers)}var e,r,n;return e=t,r=[{key:"getRootReducer",value:function(){var t=this;return function(e,r){if(0===t.keysToRemove.length)return t.combinedReducer(e,r);var n,o=Ur({},e),i=Gr(t.keysToRemove);try{for(i.s();!(n=i.n()).done;)delete o[n.value]}catch(t){i.e(t)}finally{i.f()}return t.keysToRemove=[],t.combinedReducer(o,r)}}},{key:"add",value:function(t,e){t&&!this.reducers[t]&&(this.reducers[t]=e,this.combinedReducer=Dr(this.reducers),Xr.dispatch({type:"ADD_REDUCER"}))}},{key:"remove",value:function(t){t&&this.reducers[t]&&(delete this.reducers[t],this.keysToRemove.push(t),this.combinedReducer=Dr(this.reducers),Xr.dispatch({type:"REMOVE_REDUCER"}))}}],r&&Br(e.prototype,r),n&&Br(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),qr=new zr({APP:function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}}),Xr=function t(e,r,n){var o;if("function"==typeof r&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(kr(0));if("function"==typeof r&&void 0===n&&(n=r,r=void 0),void 0!==n){if("function"!=typeof n)throw new Error(kr(1));return n(t)(e,r)}if("function"!=typeof e)throw new Error(kr(2));var i=e,a=r,c=[],u=c,s=!1;function l(){u===c&&(u=c.slice())}function f(){if(s)throw new Error(kr(3));return a}function p(t){if("function"!=typeof t)throw new Error(kr(4));if(s)throw new Error(kr(5));var e=!0;return l(),u.push(t),function(){if(e){if(s)throw new Error(kr(6));e=!1,l();var r=u.indexOf(t);u.splice(r,1),c=null}}}function h(t){if(!Rr(t))throw new Error(kr(7));if(void 0===t.type)throw new Error(kr(8));if(s)throw new Error(kr(9));try{s=!0,a=i(a,t)}finally{s=!1}for(var e=c=u,r=0;r<e.length;r++){(0,e[r])()}return t}return h({type:Ar.INIT}),(o={dispatch:h,subscribe:p,getState:f,replaceReducer:function(t){if("function"!=typeof t)throw new Error(kr(10));i=t,h({type:Ar.REPLACE})}})[_r]=function(){var t,e=p;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(kr(11));function r(){t.next&&t.next(f())}return r(),{unsubscribe:e(r)}}})[_r]=function(){return this},t},o}(qr.getRootReducer(),{},Mr(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return function(){var r=t.apply(void 0,arguments),n=function(){throw new Error(kr(15))},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=e.map((function(t){return t(o)}));return n=Cr.apply(void 0,i)(r.dispatch),Ir(Ir({},r),{},{dispatch:n})}}}.apply(void 0,[])));function Qr(t){return Qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qr(t)}function Kr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Jr(n.key),n)}}function Jr(t){var e=function(t,e){if("object"!==Qr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Qr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Qr(e)?e:String(e)}var $r=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.store=e,this.reducerManager=r}var e,r,n;return e=t,n=[{key:"create",value:function(t,e){var r=new t(Xr,qr);return r.initializeReducer(e),r}}],(r=[{key:"dispose",value:function(){this.reducerManager.remove(this.REDUCER_NAME)}},{key:"initializeReducer",value:function(t){var e=this.reducer(t);this.reducerManager.add(this.REDUCER_NAME,e)}},{key:"state",get:function(){return this.store.getState()[this.REDUCER_NAME]}}])&&Kr(e.prototype,r),n&&Kr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();var Zr=r(308);function tn(t){return tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tn(t)}function en(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function rn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,sn(n.key),n)}}function nn(t,e){return nn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nn(t,e)}function on(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=cn(t);if(e){var o=cn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===tn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return an(t)}(this,r)}}function an(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cn(t){return cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cn(t)}function un(t,e,r){return(e=sn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sn(t){var e=function(t,e){if("object"!==tn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==tn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===tn(e)?e:String(e)}var ln=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nn(t,e)}(i,t);var e,r,n,o=on(i);function i(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return un(an(t=o.call.apply(o,[this].concat(r))),"REDUCER_NAME","visitorState"),t}return e=i,r=[{key:"emptyState",value:function(){this.store.dispatch(i.emptyStateAction())}},{key:"setVisitor",value:function(t){this.store.dispatch(i.setVisitorAction(t))}},{key:"setScreenRatio",value:function(t){this.store.dispatch(i.setScreenRatio(t))}},{key:"setPageMaxHeight",value:function(t){this.store.dispatch(i.setPageMaxHeight(t))}},{key:"setPageMaxWidth",value:function(t){this.store.dispatch(i.setPageMaxWidth(t))}},{key:"setDebugInfo",value:function(t){this.store.dispatch(i.setDebugInfo(t))}},{key:"getVisitor",value:function(){return this.store.getState().visitorState.visitor}},{key:"getScreenRatio",value:function(){return this.store.getState().visitorState.screenRatio}},{key:"getPageMaxHeight",value:function(){return this.store.getState().visitorState.pageMaxHeight}},{key:"getPageMaxWidth",value:function(){return this.store.getState().visitorState.pageMaxWidth}},{key:"getDebugInfo",value:function(){return this.store.getState().visitorState.debugInfo||[]}},{key:"reducer",value:function(t){return function(){var e=arguments.length>1?arguments[1]:void 0,r=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?en(Object(r),!0).forEach((function(e){un(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):en(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:t);return(0,Zr.P9)(e,i.emptyStateAction)&&(r.visitor=void 0,r.screenRatio=void 0),(0,Zr.P9)(e,i.setVisitorAction)&&(r.visitor=e.payload),(0,Zr.P9)(e,i.setScreenRatio)&&(r.screenRatio=e.payload),(0,Zr.P9)(e,i.setPageMaxHeight)&&(r.pageMaxHeight=e.payload),(0,Zr.P9)(e,i.setPageMaxWidth)&&(r.pageMaxWidth=e.payload),(0,Zr.P9)(e,i.setDebugInfo)&&(r.debugInfo=e.payload),r}}}],r&&rn(e.prototype,r),n&&rn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}($r);un(ln,"actionCreator",(0,Zr.ZP)("VISITOR_STATE")),un(ln,"emptyStateAction",ln.actionCreator("EMPTY_STATE")),un(ln,"setVisitorAction",ln.actionCreator("SET_VISITOR")),un(ln,"setScreenRatio",ln.actionCreator("SET_SCREEN_RATIO")),un(ln,"setPageMaxHeight",ln.actionCreator("SET_PAGE_MAX_HEIGHT")),un(ln,"setPageMaxWidth",ln.actionCreator("SET_PAGE_MAX_WIDTH")),un(ln,"setDebugInfo",ln.actionCreator("SET_DEBUG_INFO"));var fn="ILibrarySessionService",pn="ILibrarySessionRepository",hn="ILibrarySessionDataProvider";function yn(t){return yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yn(t)}function vn(t){return function(t){if(Array.isArray(t))return dn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return dn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dn(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function mn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function gn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?mn(Object(r),!0).forEach((function(e){Pn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function bn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,On(n.key),n)}}function wn(t,e){return wn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wn(t,e)}function Sn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Tn(t);if(e){var o=Tn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===yn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return En(t)}(this,r)}}function En(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Tn(t){return Tn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Tn(t)}function Pn(t,e,r){return(e=On(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function On(t){var e=function(t,e){if("object"!==yn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==yn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===yn(e)?e:String(e)}var In,kn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wn(t,e)}(i,t);var e,r,n,o=Sn(i);function i(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return Pn(En(t=o.call.apply(o,[this].concat(r))),"REDUCER_NAME","librarySessionState"),t}return e=i,r=[{key:"setActionTrackerState",value:function(t){this.store.dispatch(i.setActionTrackerStateAction(t))}},{key:"setImageSettingState",value:function(t){this.store.dispatch(i.setImageSettingStateAction(t))}},{key:"setTextSettingState",value:function(t){this.store.dispatch(i.setTextSettingStateAction(t))}},{key:"setPageTextHashState",value:function(t){this.store.dispatch(i.setPageTextHashStateAction(t))}},{key:"updateOrCreatePageTextHashState",value:function(t){this.store.dispatch(i.updateOrCreatePageTextHashStateAction(t))}},{key:"setIphoneCompatibilitySettingsState",value:function(t){this.store.dispatch(i.setIphoneCompatibilitySettingsStateAction(t))}},{key:"setVisitorState",value:function(t){this.store.dispatch(i.setVisitorStateAction(t))}},{key:"updateVisitorState",value:function(t){this.store.dispatch(i.updateVisitorStateAction(t))}},{key:"setTabUniqueId",value:function(t){this.store.dispatch(i.setTabUniqueIdAction(t))}},{key:"setLibraryExipresAtLocalTime",value:function(t){this.store.dispatch(i.setLibraryExipresAtLocalTimeAction(t))}},{key:"setLibrarySessionId",value:function(t){this.store.dispatch(i.setLibrarySessionIdAction(t))}},{key:"setDeviceDocumentLoadTime",value:function(t){this.store.dispatch(i.setDeviceDocumentLoadTimeAction(t))}},{key:"setIsTouchDevice",value:function(t){this.store.dispatch(i.setIsTouchDeviceAction(t))}},{key:"getCurrentUrl",value:function(){return this.state.currentUrl}},{key:"getPreviousUrl",value:function(){return this.state.previousUrl}},{key:"getActionTracker",value:function(){return this.state.actionTrackerState}},{key:"getImageSetting",value:function(){return this.state.imageSettingState}},{key:"getTextSetting",value:function(){return this.state.textSettingState}},{key:"getPageTextHashes",value:function(){return this.state.pageTextHashStates||[]}},{key:"getPageTextHashesForPage",value:function(t){return(this.state.pageTextHashStates||[]).find((function(e){return e.pageId===t}))}},{key:"getIphoneCompatibilitySettings",value:function(){return this.state.iphoneCompatibilitySettingsState}},{key:"getVisitor",value:function(){return this.state.visitorState}},{key:"getTabUniqueId",value:function(){return this.state.tabUniqueId}},{key:"getLibraryExpiresAtLocalTime",value:function(){return this.state.libraryExipresAtLocalTime}},{key:"getLibrarySessionId",value:function(){return this.state.librarySessionId}},{key:"getDeviceDocumentLoadTime",value:function(){return this.state.deviceDocumentLoadTime}},{key:"getIsTouchDevice",value:function(){return this.state.isTouchDevice}},{key:"reducer",value:function(t){return function(){var e=arguments.length>1?arguments[1]:void 0,r=gn({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:t);if((0,Zr.P9)(e,i.pushCurrentUrlAction)&&(r.currentUrl=e.payload.currentUrl,r.previousUrl=e.payload.previousUrl),(0,Zr.P9)(e,i.setActionTrackerStateAction)&&(r.actionTrackerState=e.payload),(0,Zr.P9)(e,i.setImageSettingStateAction)&&(r.imageSettingState=e.payload),(0,Zr.P9)(e,i.setTextSettingStateAction)&&(r.textSettingState=e.payload),(0,Zr.P9)(e,i.setPageTextHashStateAction)&&(r.pageTextHashStates=e.payload),(0,Zr.P9)(e,i.updateOrCreatePageTextHashStateAction)){var n=e.payload,o=r.pageTextHashStates||[],a=o.findIndex((function(t){return t.pageId===n.pageId}));r.pageTextHashStates=-1===a?[].concat(vn(o),[n]):[].concat(vn(o.slice(0,a)),[n],vn(o.slice(a+1)))}if((0,Zr.P9)(e,i.setIphoneCompatibilitySettingsStateAction)&&(r.iphoneCompatibilitySettingsState=e.payload),(0,Zr.P9)(e,i.setVisitorStateAction)&&(r.visitorState=e.payload),(0,Zr.P9)(e,i.updateVisitorStateAction)){var c=e.payload,u=r.visitorState;if(!u)throw new Error("Visitor state is not set");r.visitorState=gn(gn({},u),{},{visitor:gn(gn({},u.visitor),c)})}return(0,Zr.P9)(e,i.setTabUniqueIdAction)&&(r.tabUniqueId=e.payload),(0,Zr.P9)(e,i.setLibraryExipresAtLocalTimeAction)&&(r.libraryExipresAtLocalTime=e.payload),(0,Zr.P9)(e,i.setLibrarySessionIdAction)&&(r.librarySessionId=e.payload),(0,Zr.P9)(e,i.setDeviceDocumentLoadTimeAction)&&(r.deviceDocumentLoadTime=e.payload),(0,Zr.P9)(e,i.setIsTouchDeviceAction)&&(r.isTouchDevice=e.payload),r}}}],r&&bn(e.prototype,r),n&&bn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}($r);function xn(t){return xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xn(t)}function jn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */jn=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==xn(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function _n(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Ln(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){_n(i,n,o,a,c,"next",t)}function c(t){_n(i,n,o,a,c,"throw",t)}a(void 0)}))}}function An(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Rn(n.key),n)}}function Rn(t){var e=function(t,e){if("object"!==xn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==xn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===xn(e)?e:String(e)}Pn(kn,"actionCreator",(0,Zr.ZP)("LIBRARY_SESSION_STATE")),Pn(kn,"pushCurrentUrlAction",kn.actionCreator("PUSH_CURRENT_URL")),Pn(kn,"setActionTrackerStateAction",kn.actionCreator("SET_ACTION_TRACKER_STATE")),Pn(kn,"setImageSettingStateAction",kn.actionCreator("SET_IMAGE_SETTING_STATE")),Pn(kn,"setTextSettingStateAction",kn.actionCreator("SET_TEXT_SETTING_STATE")),Pn(kn,"setPageTextHashStateAction",kn.actionCreator("SET_PAGE_TEXT_HASH_STATE")),Pn(kn,"updateOrCreatePageTextHashStateAction",kn.actionCreator("UPDATE_OR_CREATE_PAGE_TEXT_HASH_STATE")),Pn(kn,"setIphoneCompatibilitySettingsStateAction",kn.actionCreator("SET_IPHONE_COMPATIBILITY_SETTINGS_STATE")),Pn(kn,"setVisitorStateAction",kn.actionCreator("SET_VISITOR_STATE")),Pn(kn,"updateVisitorStateAction",kn.actionCreator("UPDATE_VISITOR_STATE")),Pn(kn,"setTabUniqueIdAction",kn.actionCreator("SET_TAB_UNIQUE_ID")),Pn(kn,"setLibraryExipresAtLocalTimeAction",kn.actionCreator("SET_LIBRARY_EXPIRES_AT_LOCAL_TIME")),Pn(kn,"setLibrarySessionIdAction",kn.actionCreator("SET_LIBRARY_SESSION_ID")),Pn(kn,"setDeviceDocumentLoadTimeAction",kn.actionCreator("SET_DEVICE_DOCUMENT_LOAD_TIME")),Pn(kn,"setIsTouchDeviceAction",kn.actionCreator("SET_IS_TOUCH_DEVICE"));var Dn,Cn=L()(In=function(t,e){return _(kn)(t,void 0,0)}(In=function(t,e){return _(pn)(t,void 0,1)}(In=Reflect.metadata("design:type",Function)(In=Reflect.metadata("design:paramtypes",[void 0===kn?Object:kn,"undefined"==typeof ILibrarySessionRepository?Object:ILibrarySessionRepository])(In=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.librarySessionStateManager=e,this.librarySessionRepository=r}var e,r,n,o,i;return e=t,r=[{key:"load",value:(i=Ln(jn().mark((function t(e){return jn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.librarySessionRepository.load({applicationPublicId:e});case 2:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"unload",value:(o=Ln(jn().mark((function t(){return jn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.librarySessionRepository.unload();case 1:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"updateOrCreatePageTextHashState",value:function(t){this.librarySessionStateManager.updateOrCreatePageTextHashState(t)}},{key:"updateVisitor",value:function(t){this.librarySessionStateManager.updateVisitorState(t)}}],r&&An(e.prototype,r),n&&An(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||In)||In)||In)||In)||In;function Nn(t){return Nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nn(t)}function Mn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Vn(n.key),n)}}function Vn(t){var e=function(t,e){if("object"!==Nn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Nn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Nn(e)?e:String(e)}var Gn=L()(Dn=function(t,e){return _(kn)(t,void 0,0)}(Dn=function(t,e){return _(pn)(t,void 0,1)}(Dn=Reflect.metadata("design:type",Function)(Dn=Reflect.metadata("design:paramtypes",[void 0===kn?Object:kn,"undefined"==typeof ILibrarySessionRepository?Object:ILibrarySessionRepository])(Dn=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.librarySessionStateManager=e,this.librarySessionRepository=r}var e,r,n;return e=t,(r=[{key:"isTouchDevice",value:function(){return this.librarySessionRepository.isTouchDevice()}},{key:"getActionTracker",value:function(){return this.librarySessionStateManager.getActionTracker()}},{key:"getImageSetting",value:function(){return this.librarySessionStateManager.getImageSetting()}},{key:"getTextSetting",value:function(){return this.librarySessionStateManager.getTextSetting()}},{key:"getPageTextHashesForPage",value:function(t){return this.librarySessionStateManager.getPageTextHashesForPage(t)}},{key:"getIphoneCompatibilitySettings",value:function(){return this.librarySessionStateManager.getIphoneCompatibilitySettings()}},{key:"getVisitor",value:function(){return this.librarySessionStateManager.getVisitor()}},{key:"getLibrarySessionId",value:function(){return this.librarySessionStateManager.getLibrarySessionId()}},{key:"getDeviceDocumentLoadTime",value:function(){return this.librarySessionStateManager.getDeviceDocumentLoadTime()}},{key:"getIsTouchDevice",value:function(){return this.librarySessionStateManager.getIsTouchDevice()}},{key:"getTabUniqueId",value:function(){return this.librarySessionStateManager.getTabUniqueId()}}])&&Mn(e.prototype,r),n&&Mn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Dn)||Dn)||Dn)||Dn)||Dn;var Wn,Fn="ITouchProcessorRepository",Un="ITouchProcessorService",Bn="ITouchProcessorDataProvider",Hn="TouchProcessor-ILibrarySession",Yn="TouchProcessor-IContent",zn="TouchProcessor-IphoneCompatibility",qn="TouchProcessor-IVisitorRepository",Xn="TouchProcessor-IPageVisitRepository";function Qn(t){return Qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qn(t)}function Kn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Kn=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Qn(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Jn(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function $n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Zn(n.key),n)}}function Zn(t){var e=function(t,e){if("object"!==Qn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Qn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Qn(e)?e:String(e)}var to,eo=L()(Wn=function(t,e){return _(Fn)(t,void 0,0)}(Wn=Reflect.metadata("design:type",Function)(Wn=Reflect.metadata("design:paramtypes",["undefined"==typeof ITouchProcessorRepository?Object:ITouchProcessorRepository])(Wn=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.touchProcessorRepository=e}var e,r,n,o,i;return e=t,r=[{key:"load",value:(o=Kn().mark((function t(){return Kn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.touchProcessorRepository.load();case 2:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){Jn(i,r,n,a,c,"next",t)}function c(t){Jn(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"unload",value:function(){this.touchProcessorRepository.unload()}},{key:"handleTouchEvent",value:function(t){this.touchProcessorRepository.handleTouchEvent(t)}},{key:"handleTimerEvent",value:function(){this.touchProcessorRepository.handleTimerEvent()}}],r&&$n(e.prototype,r),n&&$n(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Wn)||Wn)||Wn)||Wn;function ro(t){return ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ro(t)}function no(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */no=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==ro(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function oo(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function io(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ao(n.key),n)}}function ao(t){var e=function(t,e){if("object"!==ro(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ro(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ro(e)?e:String(e)}var co=L()(to=function(t,e){return _(Fn)(t,void 0,0)}(to=Reflect.metadata("design:type",Function)(to=Reflect.metadata("design:paramtypes",["undefined"==typeof ITouchProcessorRepository?Object:ITouchProcessorRepository])(to=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.touchProcessorRepository=e}var e,r,n,o,i;return e=t,r=[{key:"getWorker",value:(o=no().mark((function t(){return no().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.touchProcessorRepository.getWorker();case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){oo(i,r,n,a,c,"next",t)}function c(t){oo(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"handleScrollEventGroupComplete",value:function(t,e,r){this.touchProcessorRepository.handleScrollEventGroupComplete(t,e,r)}},{key:"handleScrollEventGroupStart",value:function(t,e,r){this.touchProcessorRepository.handleScrollEventGroupStart(t,e,r)}},{key:"getIsRunning",value:function(){return this.touchProcessorRepository.getIsRunning()}}],r&&io(e.prototype,r),n&&io(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||to)||to)||to)||to,uo=function(t){return t.Line="Line",t.Tap="Tap",t.Unknown="Unknown",t}({}),so=function(t){return t.TouchStart="TouchStart",t.TouchMove="TouchMove",t.TouchEnd="TouchEnd",t}({}),lo=function(t){return t.UseFakeScreenSize="UseFakeScreenSize",t}({});function fo(t){return fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fo(t)}function po(t){return function(t){if(Array.isArray(t))return ho(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ho(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ho(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ho(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function yo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function vo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?yo(Object(r),!0).forEach((function(e){Eo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function mo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,To(n.key),n)}}function go(t,e){return go=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},go(t,e)}function bo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=So(t);if(e){var o=So(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===fo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return wo(t)}(this,r)}}function wo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function So(t){return So=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},So(t)}function Eo(t,e,r){return(e=To(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function To(t){var e=function(t,e){if("object"!==fo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==fo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===fo(e)?e:String(e)}var Po=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&go(t,e)}(i,t);var e,r,n,o=bo(i);function i(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return Eo(wo(t=o.call.apply(o,[this].concat(r))),"REDUCER_NAME","touchProcessorState"),t}return e=i,r=[{key:"emptyState",value:function(){this.store.dispatch(i.emptyStateAction())}},{key:"pushTouchEventGroup",value:function(t){this.store.dispatch(i.pushTouchEventGroupAction(t))}},{key:"updateSafeToDelete",value:function(t){this.store.dispatch(i.updateSafeToDeleteAction(t))}},{key:"getTouchEventGroupItems",value:function(){return this.state.touchEventGroupItems||[]}},{key:"reducer",value:function(t){return function(){var e=arguments.length>1?arguments[1]:void 0,r=vo({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:t);return(0,Zr.P9)(e,i.emptyStateAction)&&(r.touchEventGroupItems=[]),(0,Zr.P9)(e,i.pushTouchEventGroupAction)&&(r.touchEventGroupItems=[].concat(po(r.touchEventGroupItems||[]),[{safeToDelete:!1,touchEventGroupDto:e.payload.touchEventGroupDto,pageVisitId:e.payload.pageVisitId,librarySessionId:e.payload.librarySessionId,pageMaxHeight:e.payload.pageMaxHeight,pageMaxWidth:e.payload.pageMaxWidth,screenRatio:e.payload.screenRatio,pageId:e.payload.pageId,deviceDocumentLoadTime:e.payload.deviceDocumentLoadTime}])),(0,Zr.P9)(e,i.updateSafeToDeleteAction)&&(r.touchEventGroupItems=(r.touchEventGroupItems||[]).map((function(t){return t.touchEventGroupDto.id===e.payload.touchEventGroupDtoId?vo(vo({},t),{},{safeToDelete:e.payload.safeToDelete}):t}))),r}}}],r&&mo(e.prototype,r),n&&mo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}($r);Eo(Po,"actionCreator",(0,Zr.ZP)("TOUCH_PROCESSOR_STATE")),Eo(Po,"emptyStateAction",Po.actionCreator("EMPTY_STATE")),Eo(Po,"pushTouchEventGroupAction",Po.actionCreator("PUSH_TOUCH_GROUP")),Eo(Po,"updateSafeToDeleteAction",Po.actionCreator("UPDATE_SAFE_TO_DELETE"));var Oo="IIphoneCompatibilityRepository",Io="IIphoneCompatibilityService",ko="IphoneCompatibility-ILibrarySessionRepository",xo="IIphoneCompatibilityDataProvider",jo=function(t){return t.EstimateNumberOfEmpulses="ESTIMATE_NUMBER_OF_EMPULSES",t}({});function _o(t){return _o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_o(t)}function Lo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ao(t){return function(t){if(Array.isArray(t))return Ro(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Ro(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ro(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ro(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Do(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wo(n.key),n)}}function Co(t,e){return Co=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Co(t,e)}function No(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Vo(t);if(e){var o=Vo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===_o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Mo(t)}(this,r)}}function Mo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Vo(t){return Vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vo(t)}function Go(t,e,r){return(e=Wo(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wo(t){var e=function(t,e){if("object"!==_o(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==_o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===_o(e)?e:String(e)}var Fo,Uo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Co(t,e)}(i,t);var e,r,n,o=No(i);function i(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return Go(Mo(t=o.call.apply(o,[this].concat(r))),"REDUCER_NAME","iphoneCompatibilityState"),t}return e=i,r=[{key:"emptyState",value:function(){this.store.dispatch(i.emptyStateAction())}},{key:"setIphoneCompatibilitySettings",value:function(t){this.store.dispatch(i.setIphoneCompatibilitySettingsAction(t))}},{key:"setIsIphoneDevice",value:function(t){this.store.dispatch(i.setIsIphoneDeviceAction(t))}},{key:"addIphoneCompatibilityStrategy",value:function(t){this.store.dispatch(i.addIphoneCompatibilityStrategyAction(t))}},{key:"removeIphoneCompatibilityStrategy",value:function(t){this.store.dispatch(i.removeIphoneCompatibilityStrategyAction(t))}},{key:"getIphoneCompatibilitySettings",value:function(){return this.state.iphoneCompatibilitySettingsDto}},{key:"getIsIphoneDevice",value:function(){return this.state.isIphoneDevice}},{key:"getIphoneCompatibilityStrategyActive",value:function(t){return Ao(this.state.iphoneCompatibilityStrategies||[]).includes(t)}},{key:"reducer",value:function(t){return function(){var e=arguments.length>1?arguments[1]:void 0,r=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Lo(Object(r),!0).forEach((function(e){Go(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Lo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:t);return(0,Zr.P9)(e,i.emptyStateAction)&&(r.iphoneCompatibilitySettingsDto=void 0,r.isIphoneDevice=void 0,r.iphoneCompatibilityStrategies=[]),(0,Zr.P9)(e,i.setIphoneCompatibilitySettingsAction)&&(r.iphoneCompatibilitySettingsDto=e.payload),(0,Zr.P9)(e,i.setIsIphoneDeviceAction)&&(r.isIphoneDevice=e.payload),(0,Zr.P9)(e,i.addIphoneCompatibilityStrategyAction)&&(r.iphoneCompatibilityStrategies||(r.iphoneCompatibilityStrategies=[]),r.iphoneCompatibilityStrategies.find((function(t){return t===e.payload}))||r.iphoneCompatibilityStrategies.push(e.payload)),(0,Zr.P9)(e,i.removeIphoneCompatibilityStrategyAction)&&(r.iphoneCompatibilityStrategies||(r.iphoneCompatibilityStrategies=[]),r.iphoneCompatibilityStrategies=r.iphoneCompatibilityStrategies.filter((function(t){return t!==e.payload}))),r}}}],r&&Do(e.prototype,r),n&&Do(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}($r);function Bo(t){return Bo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bo(t)}function Ho(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ho=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Bo(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Yo(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function zo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qo(n.key),n)}}function qo(t){var e=function(t,e){if("object"!==Bo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Bo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Bo(e)?e:String(e)}Go(Uo,"actionCreator",(0,Zr.ZP)("IPHONE_COMPATIBILITY_STATE")),Go(Uo,"emptyStateAction",Uo.actionCreator("EMPTY_STATE")),Go(Uo,"setIphoneCompatibilitySettingsAction",Uo.actionCreator("SET_IPHONE_COMPATIBILITY_SETTINGS")),Go(Uo,"setIsIphoneDeviceAction",Uo.actionCreator("SET_IS_IPHONE_DEVICE")),Go(Uo,"addIphoneCompatibilityStrategyAction",Uo.actionCreator("ADD_IPHONE_COMPATIBILITY_STRATEGY")),Go(Uo,"removeIphoneCompatibilityStrategyAction",Uo.actionCreator("REMOVE_IPHONE_COMPATIBILITY_STRATEGY"));var Xo,Qo=L()(Fo=function(t,e){return _(Uo)(t,void 0,0)}(Fo=function(t,e){return _(Oo)(t,void 0,1)}(Fo=Reflect.metadata("design:type",Function)(Fo=Reflect.metadata("design:paramtypes",[void 0===Uo?Object:Uo,"undefined"==typeof IIphoneCompatibilityRepository?Object:IIphoneCompatibilityRepository])(Fo=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.iphoneCompatibilityStateManager=e,this.iphoneCompatibilityRepository=r}var e,r,n,o,i;return e=t,r=[{key:"load",value:function(){this.iphoneCompatibilityRepository.load()}},{key:"unload",value:(o=Ho().mark((function t(){return Ho().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.iphoneCompatibilityRepository.unload();case 1:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){Yo(i,r,n,a,c,"next",t)}function c(t){Yo(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"updateTouchProcessorRunningState",value:function(t){this.iphoneCompatibilityRepository.updateTouchProcessorRunningState(t)}},{key:"handleTouchExpressionDetected",value:function(t){this.iphoneCompatibilityRepository.handleTouchExpressionDetected(t)}}],r&&zo(e.prototype,r),n&&zo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Fo)||Fo)||Fo)||Fo)||Fo;function Ko(t){return Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ko(t)}function Jo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$o(n.key),n)}}function $o(t){var e=function(t,e){if("object"!==Ko(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ko(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ko(e)?e:String(e)}var Zo,ti=L()(Xo=function(t,e){return _(Oo)(t,void 0,0)}(Xo=function(t,e){return _(Uo)(t,void 0,1)}(Xo=Reflect.metadata("design:type",Function)(Xo=Reflect.metadata("design:paramtypes",["undefined"==typeof IIphoneCompatibilityRepository?Object:IIphoneCompatibilityRepository,void 0===Uo?Object:Uo])(Xo=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.iphoneCompatibilityRepository=e,this.iphoneCompatibilityStateManager=r}var e,r,n;return e=t,(r=[{key:"getIphoneCompatibilityStrategyActive",value:function(t){return this.iphoneCompatibilityStateManager.getIphoneCompatibilityStrategyActive(t)}}])&&Jo(e.prototype,r),n&&Jo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Xo)||Xo)||Xo)||Xo)||Xo;function ei(t){return ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ei(t)}function ri(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ri=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==ei(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ni(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function oi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ii(n.key),n)}}function ii(t){var e=function(t,e){if("object"!==ei(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ei(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ei(e)?e:String(e)}var ai,ci=L()(Zo=function(t,e){return _(D)(t,void 0,0)}(Zo=function(t,e){return _(ln)(t,void 0,1)}(Zo=Reflect.metadata("design:type",Function)(Zo=Reflect.metadata("design:paramtypes",["undefined"==typeof IVisitorRepository?Object:IVisitorRepository,void 0===ln?Object:ln])(Zo=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.visitorRepository=e,this.visitorStateManager=r}var e,r,n,o,i;return e=t,r=[{key:"load",value:(o=ri().mark((function t(){return ri().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.visitorRepository.load();case 2:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){ni(i,r,n,a,c,"next",t)}function c(t){ni(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"unload",value:function(){this.visitorRepository.unload()}},{key:"normalizeCalibrateTouchExpression",value:function(t){return this.visitorRepository.normalizeCalibrateTouchExpression(t)}},{key:"handleResizeEvent",value:function(t){this.visitorRepository.handleResizeEvent(t)}}],r&&oi(e.prototype,r),n&&oi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Zo)||Zo)||Zo)||Zo)||Zo;function ui(t){return ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ui(t)}function si(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,li(n.key),n)}}function li(t){var e=function(t,e){if("object"!==ui(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ui(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ui(e)?e:String(e)}var fi=L()(ai=function(t,e){return _(D)(t,void 0,0)}(ai=function(t,e){return _(ln)(t,void 0,1)}(ai=Reflect.metadata("design:type",Function)(ai=Reflect.metadata("design:paramtypes",["undefined"==typeof IVisitorRepository?Object:IVisitorRepository,void 0===ln?Object:ln])(ai=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.visitorRepository=e,this.visitorStateManger=r}var e,r,n;return e=t,(r=[{key:"getPageMaxHeight",value:function(){return this.visitorStateManger.getPageMaxHeight()}},{key:"getPageMaxWidth",value:function(){return this.visitorStateManger.getPageMaxWidth()}},{key:"getScreenRatio",value:function(){return this.visitorStateManger.getScreenRatio()}},{key:"getDebugInfo",value:function(){return this.visitorStateManger.getDebugInfo()}},{key:"getVisitor",value:function(){return this.visitorStateManger.getVisitor()}},{key:"getNormlizedPagePositionForTouchEvent",value:function(t){return this.visitorRepository.getNormlizedPagePositionForTouchEvent(t)}}])&&si(e.prototype,r),n&&si(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||ai)||ai)||ai)||ai)||ai;var pi,hi="IPageVisitService",yi="IPageVisitRepository",vi="IPageVisitDataProvider",di="PageVisit-ILibrarySessionRepository";function mi(t){return mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mi(t)}function gi(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */gi=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==mi(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function bi(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function wi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Si(n.key),n)}}function Si(t){var e=function(t,e){if("object"!==mi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==mi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===mi(e)?e:String(e)}var Ei=L()(pi=function(t,e){return _(yi)(t,void 0,0)}(pi=Reflect.metadata("design:type",Function)(pi=Reflect.metadata("design:paramtypes",["undefined"==typeof IPageVisitRepository?Object:IPageVisitRepository])(pi=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pageVisitRepository=e}var e,r,n,o,i;return e=t,r=[{key:"load",value:(o=gi().mark((function t(){return gi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.pageVisitRepository.load();case 2:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){bi(i,r,n,a,c,"next",t)}function c(t){bi(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"unload",value:function(){this.pageVisitRepository.unload()}},{key:"handleLocationChangedEvent",value:function(){var t;(t=this.pageVisitRepository).handleLocationChangedEvent.apply(t,arguments)}},{key:"handleExpresionDetected",value:function(t){this.pageVisitRepository.handleExpresionDetected(t)}}],r&&wi(e.prototype,r),n&&wi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||pi)||pi)||pi)||pi;function Ti(t){return Ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ti(t)}function Pi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Oi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Li(n.key),n)}}function Ii(t,e){return Ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ii(t,e)}function ki(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ji(t);if(e){var o=ji(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===Ti(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return xi(t)}(this,r)}}function xi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ji(t){return ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ji(t)}function _i(t,e,r){return(e=Li(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Li(t){var e=function(t,e){if("object"!==Ti(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ti(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ti(e)?e:String(e)}var Ai,Ri=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ii(t,e)}(i,t);var e,r,n,o=ki(i);function i(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return _i(xi(t=o.call.apply(o,[this].concat(r))),"REDUCER_NAME","pageVisit"),t}return e=i,r=[{key:"emptyState",value:function(){this.store.dispatch(i.emptyStateAction())}},{key:"setUrlNavigationStart",value:function(t){this.store.dispatch(i.setUrlNavigationStartAction(t))}},{key:"setPageId",value:function(t){this.store.dispatch(i.setPageIdAction(t))}},{key:"setPageVisitId",value:function(t){this.store.dispatch(i.setPageVisitIdAction(t))}},{key:"setReferrer",value:function(t){this.store.dispatch(i.setReferrerAction(t))}},{key:"setPageTitle",value:function(t){this.store.dispatch(i.setPageTitleAction(t))}},{key:"getUrlNavigationStart",value:function(){return this.state.urlNavigationStart}},{key:"getPageId",value:function(){return this.state.pageId}},{key:"getPageVisitId",value:function(){return this.state.pageVisitId}},{key:"getReferrer",value:function(){return this.state.referrer}},{key:"getPageTitle",value:function(){return this.state.pageTitle}},{key:"reducer",value:function(t){return function(){var e=arguments.length>1?arguments[1]:void 0,r=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Pi(Object(r),!0).forEach((function(e){_i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:t);return(0,Zr.P9)(e,i.emptyStateAction),(0,Zr.P9)(e,i.setUrlNavigationStartAction)&&(r.urlNavigationStart=e.payload),(0,Zr.P9)(e,i.setPageIdAction)&&(r.pageId=e.payload),(0,Zr.P9)(e,i.setPageVisitIdAction)&&(r.pageVisitId=e.payload),(0,Zr.P9)(e,i.setReferrerAction)&&(r.referrer=e.payload),(0,Zr.P9)(e,i.setPageTitleAction)&&(r.pageTitle=e.payload),r}}}],r&&Oi(e.prototype,r),n&&Oi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}($r);function Di(t){return Di="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Di(t)}function Ci(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ni(n.key),n)}}function Ni(t){var e=function(t,e){if("object"!==Di(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Di(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Di(e)?e:String(e)}_i(Ri,"actionCreator",(0,Zr.ZP)("PAGE_VISIT_STATE")),_i(Ri,"emptyStateAction",Ri.actionCreator("EMPTY_STATE")),_i(Ri,"setUrlNavigationStartAction",Ri.actionCreator("SET_URL_NAVIGATION_START")),_i(Ri,"setPageIdAction",Ri.actionCreator("SET_PAGE_ID")),_i(Ri,"setPageVisitIdAction",Ri.actionCreator("SET_PAGE_VISIT_ID")),_i(Ri,"setReferrerAction",Ri.actionCreator("SET_REFERRER")),_i(Ri,"setPageTitleAction",Ri.actionCreator("SET_PAGE_TITLE"));var Mi=L()(Ai=function(t,e){return _(Ri)(t,void 0,0)}(Ai=function(t,e){return _(yi)(t,void 0,1)}(Ai=Reflect.metadata("design:type",Function)(Ai=Reflect.metadata("design:paramtypes",[void 0===Ri?Object:Ri,"undefined"==typeof IPageVisitRepository?Object:IPageVisitRepository])(Ai=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pageVisitStateManager=e,this.pageVisitRepository=r}var e,r,n;return e=t,(r=[{key:"getCurrentPageVisit",value:function(){return this.pageVisitRepository.getCurrentPageVisitDto()}}])&&Ci(e.prototype,r),n&&Ci(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Ai)||Ai)||Ai)||Ai)||Ai;var Vi,Gi="IActionRepository",Wi="IActionService",Fi="Action-ILibrarySessionRepository",Ui="Action-ITouchProcessorRepository",Bi="Action-IPageVisitRepository";function Hi(t){return Hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hi(t)}function Yi(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Yi=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Hi(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function zi(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function qi(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){zi(i,n,o,a,c,"next",t)}function c(t){zi(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Xi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qi(n.key),n)}}function Qi(t){var e=function(t,e){if("object"!==Hi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Hi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Hi(e)?e:String(e)}var Ki=L()(Vi=function(t,e){return _(Gi)(t,void 0,0)}(Vi=Reflect.metadata("design:type",Function)(Vi=Reflect.metadata("design:paramtypes",["undefined"==typeof IActionRepository?Object:IActionRepository])(Vi=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.actionRepository=e}var e,r,n,o,i;return e=t,r=[{key:"load",value:(i=qi(Yi().mark((function t(){return Yi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.actionRepository.load();case 2:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"unload",value:function(){this.actionRepository.unload()}},{key:"handleTimerEvent",value:function(){this.actionRepository.handleTimerEvent()}},{key:"handleScrollEventDto",value:(o=qi(Yi().mark((function t(e){return Yi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.actionRepository.handleScrollEventDto(e);case 1:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})}],r&&Xi(e.prototype,r),n&&Xi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Vi)||Vi)||Vi)||Vi,Ji=function(t){return t.Click="Click",t.Scroll="Scroll",t.Swipe="Swipe",t}({});function $i(t){return $i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$i(t)}function Zi(t){return function(t){if(Array.isArray(t))return ta(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ta(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ta(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ta(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ea(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ra(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ea(Object(r),!0).forEach((function(e){ua(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ea(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function na(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,sa(n.key),n)}}function oa(t,e){return oa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},oa(t,e)}function ia(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ca(t);if(e){var o=ca(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===$i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return aa(t)}(this,r)}}function aa(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ca(t){return ca=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ca(t)}function ua(t,e,r){return(e=sa(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sa(t){var e=function(t,e){if("object"!==$i(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==$i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===$i(e)?e:String(e)}var la=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oa(t,e)}(i,t);var e,r,n,o=ia(i);function i(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return ua(aa(t=o.call.apply(o,[this].concat(r))),"REDUCER_NAME","actionState"),t}return e=i,r=[{key:"emptyState",value:function(){this.store.dispatch(i.emptyStateAction())}},{key:"addActionWatcher",value:function(t){this.store.dispatch(i.addActionWatcherAction(t))}},{key:"updateActionWatcher",value:function(t,e){this.store.dispatch(i.updateActionWatcherAction({actionWatcherId:t,actionWatcherDto:e}))}},{key:"removeActionWatcher",value:function(t){this.store.dispatch(i.removeActionWatcherAction(t))}},{key:"addSwipeItemsUnderTouchStart",value:function(t){this.store.dispatch(i.addSwipeItemsUnderTouchStartAction(t))}},{key:"updateSwipeItemsUnderTouchStartSafeToDelete",value:function(t){this.store.dispatch(i.updateSwipeItemsUnderTouchStartSafeToDeleteAction(t))}},{key:"getActionWatchers",value:function(){return this.state.actionWatchers||[]}},{key:"getActionWatcher",value:function(t){return this.getActionWatchers().find((function(e){return e.id===t}))}},{key:"getSwipeItemsUnderTouchStart",value:function(){return this.state.swipeItemsUnderTouchStart||[]}},{key:"reducer",value:function(t){return function(){var e=arguments.length>1?arguments[1]:void 0,r=ra({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:t);if((0,Zr.P9)(e,i.emptyStateAction)&&(r.actionWatchers=[],r.swipeItemsUnderTouchStart=[]),(0,Zr.P9)(e,i.addActionWatcherAction)&&(r.actionWatchers=[].concat(Zi(r.actionWatchers||[]),[e.payload])),(0,Zr.P9)(e,i.updateActionWatcherAction)){if(!r.actionWatchers)throw new Error("Action watchers not initialized");var n=r.actionWatchers.findIndex((function(t){return t.id===e.payload.actionWatcherId}));r.actionWatchers[n]=ra(ra({},r.actionWatchers[n]),e.payload.actionWatcherDto)}if((0,Zr.P9)(e,i.removeActionWatcherAction)){if(!r.actionWatchers)throw new Error("Action watchers not initialized");var o=r.actionWatchers.findIndex((function(t){return t.id===e.payload}));r.actionWatchers.splice(o,1)}return(0,Zr.P9)(e,i.addSwipeItemsUnderTouchStartAction)&&(r.swipeItemsUnderTouchStart=[].concat(Zi(r.swipeItemsUnderTouchStart||[]),[e.payload])),(0,Zr.P9)(e,i.updateSwipeItemsUnderTouchStartSafeToDeleteAction)&&(r.swipeItemsUnderTouchStart=(r.swipeItemsUnderTouchStart||[]).map((function(t){return t.actionWatcherDtoId===e.payload.actionWatcherDtoId&&t.pageVisitId===e.payload.pageVisitId&&t.deviceDocumentLoadTime===e.payload.deviceDocumentLoadTime&&t.touchStartTimestamp===e.payload.touchStartTimestamp?ra(ra({},t),{},{safeToDelete:e.payload.safeToDelete}):t}))),r}}}],r&&na(e.prototype,r),n&&na(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}($r);function fa(t){return fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fa(t)}function pa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ha(n.key),n)}}function ha(t){var e=function(t,e){if("object"!==fa(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==fa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===fa(e)?e:String(e)}function ya(t,e){return ya=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ya(t,e)}function va(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=da(t);if(e){var o=da(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===fa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function da(t){return da=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},da(t)}ua(la,"actionCreator",(0,Zr.ZP)("ACTION_STATE")),ua(la,"emptyStateAction",la.actionCreator("EMPTY_STATE")),ua(la,"addActionWatcherAction",la.actionCreator("ADD_ACTION_WATCHER")),ua(la,"updateActionWatcherAction",la.actionCreator("UPDATE_ACTION_WATCHER")),ua(la,"removeActionWatcherAction",la.actionCreator("REMOVE_ACTION_WATCHER")),ua(la,"addSwipeItemsUnderTouchStartAction",la.actionCreator("ADD_SWIPE_ITEMS_UNDER_TOUCH_START")),ua(la,"updateSwipeItemsUnderTouchStartSafeToDeleteAction",la.actionCreator("UPDATE_SWIPE_ITEMS_UNDER_TOUCH_START_SAFE_TO_DELETE"));var ma=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ya(t,e)}(i,t);var e,r,n,o=va(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t.id)).dto=t,e}return e=i,(r=[{key:"toDto",value:function(){return this.dto}}])&&pa(e.prototype,r),n&&pa(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(W);var ga="IScrollProcessorRepository",ba="IScrollProcessorService",wa="IScrollProcessorDataProvider",Sa="ScrollProcessor-ILibrarySession",Ea="ScrollProcessor-ITouchProcessorRepository",Ta="ScrollProcessor-IPageVisitRepository";function Pa(t){return Pa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pa(t)}function Oa(t){return function(t){if(Array.isArray(t))return Ia(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Ia(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ia(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ia(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ka(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xa(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ka(Object(r),!0).forEach((function(e){Da(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ka(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ja(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ca(n.key),n)}}function _a(t,e){return _a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_a(t,e)}function La(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ra(t);if(e){var o=Ra(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===Pa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Aa(t)}(this,r)}}function Aa(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ra(t){return Ra=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ra(t)}function Da(t,e,r){return(e=Ca(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ca(t){var e=function(t,e){if("object"!==Pa(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Pa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Pa(e)?e:String(e)}var Na,Ma=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_a(t,e)}(i,t);var e,r,n,o=La(i);function i(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return Da(Aa(t=o.call.apply(o,[this].concat(r))),"REDUCER_NAME","scrollProcessorState"),t}return e=i,r=[{key:"emptyState",value:function(){this.store.dispatch(i.emptyStateAction())}},{key:"pushScrollEventGroup",value:function(t){this.store.dispatch(i.pushScrollEventGroupDtoAction(t))}},{key:"updateSafeToDelete",value:function(t){this.store.dispatch(i.updateSafeToDeleteAction(t))}},{key:"getScrollEventGroupItems",value:function(){return this.state.scrollEventGroupItems||[]}},{key:"getScrollEventGroupItem",value:function(t){var e;return null===(e=this.state.scrollEventGroupItems)||void 0===e?void 0:e.find((function(e){return e.scrollEventGroupDto.id===t}))}},{key:"reducer",value:function(t){return function(){var e,r=arguments.length>1?arguments[1]:void 0,n=xa({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:t);return(0,Zr.P9)(r,i.emptyStateAction)&&(n.scrollEventGroupItems=[]),(0,Zr.P9)(r,i.pushScrollEventGroupDtoAction)&&(n.scrollEventGroupItems=[].concat(Oa(n.scrollEventGroupItems||[]),[r.payload])),(0,Zr.P9)(r,i.updateSafeToDeleteAction)&&(n.scrollEventGroupItems=null===(e=n.scrollEventGroupItems)||void 0===e?void 0:e.map((function(t){return t.scrollEventGroupDto.id===r.payload.scrollEventGroupDtoId?xa(xa({},t),{},{safeToDelete:r.payload.safeToDelete}):t}))),n}}}],r&&ja(e.prototype,r),n&&ja(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}($r);function Va(t){return Va="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Va(t)}function Ga(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ga=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Va(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Wa(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Fa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ua(n.key),n)}}function Ua(t){var e=function(t,e){if("object"!==Va(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Va(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Va(e)?e:String(e)}Da(Ma,"actionCreator",(0,Zr.ZP)("SCROLL_PROCESSOR_STATE")),Da(Ma,"emptyStateAction",Ma.actionCreator("EMPTY_STATE")),Da(Ma,"pushScrollEventGroupDtoAction",Ma.actionCreator("PUSH_SCROLL_EVENT_GROUP_DTO")),Da(Ma,"updateSafeToDeleteAction",Ma.actionCreator("UPDATE_SAFE_TO_DELETE"));var Ba,Ha=L()(Na=function(t,e){return _(ga)(t,void 0,0)}(Na=function(t,e){return _(Ma)(t,void 0,1)}(Na=Reflect.metadata("design:type",Function)(Na=Reflect.metadata("design:paramtypes",["undefined"==typeof IScrollProcessorRepository?Object:IScrollProcessorRepository,void 0===Ma?Object:Ma])(Na=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.scrollProcessorRepository=e,this.scrollProcessorStateManager=r}var e,r,n,o,i;return e=t,r=[{key:"load",value:(o=Ga().mark((function t(){return Ga().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.scrollProcessorRepository.load();case 2:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){Wa(i,r,n,a,c,"next",t)}function c(t){Wa(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"handleScrollEvent",value:function(t){this.scrollProcessorRepository.handleScrollEvent(t)}},{key:"handleTimerEvent",value:function(){this.scrollProcessorRepository.handleTimerEvent()}},{key:"unload",value:function(){this.scrollProcessorRepository.unload()}}],r&&Fa(e.prototype,r),n&&Fa(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Na)||Na)||Na)||Na)||Na;function Ya(t){return Ya="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ya(t)}function za(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qa(n.key),n)}}function qa(t){var e=function(t,e){if("object"!==Ya(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ya(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ya(e)?e:String(e)}var Xa=L()(Ba=function(t,e){return _(Ma)(t,void 0,0)}(Ba=Reflect.metadata("design:type",Function)(Ba=Reflect.metadata("design:paramtypes",[void 0===Ma?Object:Ma])(Ba=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.scrollProcessorStateManager=e}var e,r,n;return e=t,(r=[{key:"getScrollEventGroupItem",value:function(t){return this.scrollProcessorStateManager.getScrollEventGroupItem(t)}},{key:"getScrollEventGroupItems",value:function(){return this.scrollProcessorStateManager.getScrollEventGroupItems()}}])&&za(e.prototype,r),n&&za(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Ba)||Ba)||Ba)||Ba;var Qa="IVisitorActivityRepository",Ka="IVisitorActivityService",Ja="VisitorActivity-IDataReporterRepository";function $a(t){return $a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$a(t)}function Za(t){return function(t){if(Array.isArray(t))return tc(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return tc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tc(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ec(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function rc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ec(Object(r),!0).forEach((function(e){uc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ec(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function nc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,sc(n.key),n)}}function oc(t,e){return oc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},oc(t,e)}function ic(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=cc(t);if(e){var o=cc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===$a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ac(t)}(this,r)}}function ac(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cc(t){return cc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cc(t)}function uc(t,e,r){return(e=sc(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sc(t){var e=function(t,e){if("object"!==$a(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==$a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===$a(e)?e:String(e)}var lc=function(t){return t.Open="Open",t.Closed="Closed",t}({}),fc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oc(t,e)}(i,t);var e,r,n,o=ic(i);function i(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return uc(ac(t=o.call.apply(o,[this].concat(r))),"REDUCER_NAME","visitorActivityState"),t}return e=i,r=[{key:"emptyState",value:function(){this.store.dispatch(i.emptyStateAction())}},{key:"pushTouchExpressionStateItem",value:function(t){this.store.dispatch(i.pushTouchExpressionStateItemAction(t))}},{key:"updateTouchExpressionStateItem",value:function(t){this.store.dispatch(i.updateTouchExpressionStateItemAction(t))}},{key:"pushActionStateItem",value:function(t){this.store.dispatch(i.pushActionStateItemAction(t))}},{key:"updateActionStateItem",value:function(t){this.store.dispatch(i.updateActionStateItemAction(t))}},{key:"pushPageVisitStateItem",value:function(t){this.store.dispatch(i.pushPageVisitStateItemAction(t))}},{key:"updatePageVisitStateItem",value:function(t){this.store.dispatch(i.updatePageVisitStateItemAction(t))}},{key:"updatePageVisitGroup",value:function(t){this.store.dispatch(i.updatePageVisitGroupAction(t))}},{key:"getTouchExpressionStateItems",value:function(){return this.state.touchExpressionStateItems||[]}},{key:"getActionStateItems",value:function(){return this.state.actionStateItems||[]}},{key:"getPageVisitStateItems",value:function(){return this.state.pageVisitStateItems||[]}},{key:"getPageVisitGroup",value:function(){return this.state.PageVisitGroup}},{key:"reducer",value:function(t){return function(){var e=arguments.length>1?arguments[1]:void 0,r=rc({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:t);return(0,Zr.P9)(e,i.emptyStateAction)&&(r.hasActivity=!1,r.activityTime=0,r.activities=[],r.touchExpressionStateItems=[],r.actionStateItems=[],r.pageVisitStateItems=[]),(0,Zr.P9)(e,i.pushTouchExpressionStateItemAction)&&(r.touchExpressionStateItems=[].concat(Za(r.touchExpressionStateItems||[]),[e.payload])),(0,Zr.P9)(e,i.updateTouchExpressionStateItemAction)&&(r.touchExpressionStateItems=(r.touchExpressionStateItems||[]).map((function(t){return t.touchExpressionItem.touchExpression.id===e.payload.touchExpressionItem.touchExpression.id&&t.touchExpressionItem.touchExpression.pageVisitId===e.payload.touchExpressionItem.touchExpression.pageVisitId&&t.touchExpressionItem.touchExpression.deviceDocumentLoadTime===e.payload.touchExpressionItem.touchExpression.deviceDocumentLoadTime?rc(rc({},t),e.payload):t}))),(0,Zr.P9)(e,i.pushActionStateItemAction)&&(r.actionStateItems=[].concat(Za(r.actionStateItems||[]),[e.payload])),(0,Zr.P9)(e,i.updateActionStateItemAction)&&(r.actionStateItems=(r.actionStateItems||[]).map((function(t){return t.actionItem.actionTrackerDto.id===e.payload.actionItem.actionTrackerDto.id&&t.actionItem.pageVisitId===e.payload.actionItem.pageVisitId&&t.actionItem.deviceDocumentLoadTime===e.payload.actionItem.deviceDocumentLoadTime?rc(rc({},t),e.payload):t}))),(0,Zr.P9)(e,i.pushPageVisitStateItemAction)&&(r.pageVisitStateItems=[].concat(Za(r.pageVisitStateItems||[]),[e.payload])),(0,Zr.P9)(e,i.updatePageVisitStateItemAction)&&(r.pageVisitStateItems=(r.pageVisitStateItems||[]).map((function(t){return t.pageVisitItem.pageVisitDto.id===e.payload.pageVisitItem.pageVisitDto.id?rc(rc({},t),e.payload):t}))),(0,Zr.P9)(e,i.updatePageVisitGroupAction)&&(r.PageVisitGroup=e.payload),r}}}],r&&nc(e.prototype,r),n&&nc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}($r);uc(fc,"actionCreator",(0,Zr.ZP)("VISITOR_ACTIVITY_STATE")),uc(fc,"emptyStateAction",fc.actionCreator("EMPTY_STATE")),uc(fc,"pushTouchExpressionStateItemAction",fc.actionCreator("PUSH_TOUCH_EXPRESSION_STATE_ITEM")),uc(fc,"updateTouchExpressionStateItemAction",fc.actionCreator("UPDATE_TOUCH_EXPRESSION_STATE_ITEM")),uc(fc,"pushActionStateItemAction",fc.actionCreator("PUSH_ACTION_STATE_ITEM")),uc(fc,"updateActionStateItemAction",fc.actionCreator("UPDATE_ACTION_STATE_ITEM")),uc(fc,"pushPageVisitStateItemAction",fc.actionCreator("PUSH_PAGE_VISIT_STATE_ITEM")),uc(fc,"updatePageVisitStateItemAction",fc.actionCreator("UPDATE_PAGE_VISIT_STATE_ITEM")),uc(fc,"updatePageVisitGroupAction",fc.actionCreator("UPDATE_PAGE_VISIT_GROUP"));var pc,hc="IDataReporterRepository",yc="IDataReporterService",vc="IDataReporterDataProvider";function dc(t){return dc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dc(t)}function mc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */mc=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==dc(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function gc(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function bc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wc(n.key),n)}}function wc(t){var e=function(t,e){if("object"!==dc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==dc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===dc(e)?e:String(e)}var Sc,Ec=L()(pc=function(t,e){return _(hc)(t,void 0,0)}(pc=Reflect.metadata("design:type",Function)(pc=Reflect.metadata("design:paramtypes",["undefined"==typeof IDataReporterRepository?Object:IDataReporterRepository])(pc=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.dataReporterRepository=e}var e,r,n,o,i;return e=t,r=[{key:"load",value:(o=mc().mark((function t(){return mc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.dataReporterRepository.load();case 2:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){gc(i,r,n,a,c,"next",t)}function c(t){gc(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"unload",value:function(){this.dataReporterRepository.unload()}},{key:"handleTimerEvent",value:function(){this.dataReporterRepository.handleTimerEvent()}},{key:"pushData",value:function(t,e){this.dataReporterRepository.pushData(t,e)}}],r&&bc(e.prototype,r),n&&bc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||pc)||pc)||pc)||pc;function Tc(t){return Tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tc(t)}function Pc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Pc=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Tc(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Oc(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Ic(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,kc(n.key),n)}}function kc(t){var e=function(t,e){if("object"!==Tc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Tc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Tc(e)?e:String(e)}var xc=L()(Sc=function(t,e){return _(hc)(t,void 0,0)}(Sc=Reflect.metadata("design:type",Function)(Sc=Reflect.metadata("design:paramtypes",["undefined"==typeof IDataReporterRepository?Object:IDataReporterRepository])(Sc=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.dataReporterRepository=e}var e,r,n,o,i;return e=t,r=[{key:"getWorker",value:(o=Pc().mark((function t(){return Pc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.dataReporterRepository.getWorker();case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){Oc(i,r,n,a,c,"next",t)}function c(t){Oc(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})}],r&&Ic(e.prototype,r),n&&Ic(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Sc)||Sc)||Sc)||Sc,jc=function(t){return t.TouchExpression="TouchExpression",t.Action="Action",t.PageVisits="PageVisits",t}({});function _c(t){return _c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_c(t)}function Lc(t){return function(t){if(Array.isArray(t))return Ac(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Ac(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ac(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ac(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Rc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Dc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Rc(Object(r),!0).forEach((function(e){Wc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Rc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Cc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Fc(n.key),n)}}function Nc(t,e){return Nc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Nc(t,e)}function Mc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Gc(t);if(e){var o=Gc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===_c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Vc(t)}(this,r)}}function Vc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Gc(t){return Gc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gc(t)}function Wc(t,e,r){return(e=Fc(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fc(t){var e=function(t,e){if("object"!==_c(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==_c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===_c(e)?e:String(e)}var Uc,Bc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nc(t,e)}(i,t);var e,r,n,o=Mc(i);function i(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return Wc(Vc(t=o.call.apply(o,[this].concat(r))),"REDUCER_NAME","dataReporterState"),t}return e=i,r=[{key:"emptyState",value:function(){this.store.dispatch(i.emptyStateAction())}},{key:"pushNetworkDataItem",value:function(t){this.store.dispatch(i.pushNetworkDataItemAction(t))}},{key:"updateNetworkDataItem",value:function(t){this.store.dispatch(i.updateNetworkDataItemAction(t))}},{key:"getNetworkDataItems",value:function(){return this.state.networkDataItems||[]}},{key:"reducer",value:function(t){return function(){var e=arguments.length>1?arguments[1]:void 0,r=Dc({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:t);return(0,Zr.P9)(e,i.emptyStateAction)&&(r.networkDataItems=[]),(0,Zr.P9)(e,i.pushNetworkDataItemAction)&&(r.networkDataItems=[].concat(Lc(r.networkDataItems||[]),[{isSent:!1,networkDataItemDto:e.payload.networkDataItemDto}])),(0,Zr.P9)(e,i.updateNetworkDataItemAction)&&(r.networkDataItems=(r.networkDataItems||[]).map((function(t){return t.networkDataItemDto.id===e.payload.networkDataItemDtoId?Dc(Dc({},t),{},{isSent:e.payload.isSent}):t}))),r}}}],r&&Cc(e.prototype,r),n&&Cc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}($r);function Hc(t){return Hc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hc(t)}function Yc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Yc=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Hc(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function zc(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function qc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Xc(n.key),n)}}function Xc(t){var e=function(t,e){if("object"!==Hc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Hc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Hc(e)?e:String(e)}Wc(Bc,"actionCreator",(0,Zr.ZP)("DATA_REPORTER_STATE")),Wc(Bc,"emptyStateAction",Bc.actionCreator("EMPTY_STATE")),Wc(Bc,"pushNetworkDataItemAction",Bc.actionCreator("PUSH_NETWORK_PACKET")),Wc(Bc,"updateNetworkDataItemAction",Bc.actionCreator("UPDATE_NETWORK_PACKET"));var Qc=L()(Uc=function(t,e){return _(Qa)(t,void 0,0)}(Uc=function(t,e){return _(fc)(t,void 0,1)}(Uc=Reflect.metadata("design:type",Function)(Uc=Reflect.metadata("design:paramtypes",["undefined"==typeof IVisitorActivityRepository?Object:IVisitorActivityRepository,void 0===fc?Object:fc])(Uc=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.visitorActivityRepository=e,this.visitorActivityStateManager=r}var e,r,n,o,i;return e=t,r=[{key:"load",value:(o=Yc().mark((function t(){return Yc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.visitorActivityRepository.load();case 2:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){zc(i,r,n,a,c,"next",t)}function c(t){zc(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"unload",value:function(){this.visitorActivityRepository.unload()}},{key:"handleTimerEvent",value:function(){this.visitorActivityRepository.handleTimerEvent()}},{key:"pushTouchExpressionItem",value:function(t,e){this.visitorActivityStateManager.pushTouchExpressionStateItem({touchExpressionItem:t,safeToDelete:!1}),this.visitorActivityRepository.pushTouchExpressionItem(t,e)}},{key:"pushActionItem",value:function(t,e){this.visitorActivityStateManager.pushActionStateItem({actionItem:t,safeToDelete:!1}),this.visitorActivityRepository.pushActionItem(t,e)}},{key:"pushPageVisitItem",value:function(t){this.visitorActivityStateManager.pushPageVisitStateItem({pageVisitItem:t,safeToDelete:!1}),this.visitorActivityRepository.updatePagevisitGroup()}},{key:"handleNewPageVisitStartDetected",value:function(t){this.visitorActivityRepository.handlePageVisitStartDetected(t)}}],r&&qc(e.prototype,r),n&&qc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Uc)||Uc)||Uc)||Uc)||Uc;var Kc,Jc="IContentRepository",$c="IContentService",Zc="Content-ILibrarySessionRepository",tu="IContentDataProvider",eu="Content-IPageVisitRepository";function ru(t){return ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ru(t)}function nu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ou(n.key),n)}}function ou(t){var e=function(t,e){if("object"!==ru(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ru(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ru(e)?e:String(e)}var iu,au=L()(Kc=function(t,e){return _(Jc)(t,void 0,0)}(Kc=Reflect.metadata("design:type",Function)(Kc=Reflect.metadata("design:paramtypes",["undefined"==typeof IContentRepository?Object:IContentRepository])(Kc=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.contentRepository=e}var e,r,n;return e=t,(r=[{key:"load",value:function(){this.contentRepository.load()}},{key:"unload",value:function(){this.contentRepository.unload()}},{key:"handleTouchEventGroupStart",value:function(t){this.contentRepository.handleTouchEventGroupStart(t)}},{key:"handleTouchExpressionDetected",value:function(t){this.contentRepository.handleTouchExpressionDetected(t)}},{key:"updateTouchProcessorRunningState",value:function(t){this.contentRepository.updateTouchProcessorRunningState(t)}}])&&nu(e.prototype,r),n&&nu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Kc)||Kc)||Kc)||Kc;function cu(t){return cu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cu(t)}function uu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,su(n.key),n)}}function su(t){var e=function(t,e){if("object"!==cu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==cu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===cu(e)?e:String(e)}var lu=L()(iu=function(t,e){return _(Jc)(t,void 0,0)}(iu=Reflect.metadata("design:type",Function)(iu=Reflect.metadata("design:paramtypes",["undefined"==typeof IContentRepository?Object:IContentRepository])(iu=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.contentRepository=e}var e,r,n;return e=t,(r=[{key:"getTouchExpressionContent",value:function(t){return this.contentRepository.getTouchExpressionContent(t)}}])&&uu(e.prototype,r),n&&uu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||iu)||iu)||iu)||iu,fu=function(t){return t.Image="Image",t.Text="Text",t}({});function pu(t){return pu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pu(t)}function hu(t){return function(t){if(Array.isArray(t))return yu(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return yu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yu(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yu(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function vu(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function du(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?vu(Object(r),!0).forEach((function(e){Eu(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vu(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function mu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Tu(n.key),n)}}function gu(t,e){return gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},gu(t,e)}function bu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Su(t);if(e){var o=Su(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===pu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return wu(t)}(this,r)}}function wu(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Su(t){return Su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Su(t)}function Eu(t,e,r){return(e=Tu(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Tu(t){var e=function(t,e){if("object"!==pu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==pu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===pu(e)?e:String(e)}var Pu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gu(t,e)}(i,t);var e,r,n,o=bu(i);function i(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return Eu(wu(t=o.call.apply(o,[this].concat(r))),"REDUCER_NAME","contentState"),t}return e=i,r=[{key:"emptyState",value:function(){this.store.dispatch(i.emptyStateAction())}},{key:"addContentWatcherItem",value:function(t){this.store.dispatch(i.addContentWatcherItemAction(t))}},{key:"updateContentWatcherItem",value:function(t){this.store.dispatch(i.updateContentWatcherItemAction(t))}},{key:"getContentWatcherItems",value:function(){return this.state.contentWatcherItems||[]}},{key:"getContentWatcherItemById",value:function(t){var e;return null===(e=this.state.contentWatcherItems)||void 0===e?void 0:e.find((function(e){return e.id===t}))}},{key:"getContentWatcherVisibleItems",value:function(){var t;return(null===(t=this.state.contentWatcherItems)||void 0===t?void 0:t.filter((function(t){return t.isVisible})))||[]}},{key:"addVisibleWatcherItemsAtTimeStamp",value:function(t){this.store.dispatch(i.addVisibleWatcherItemsAtTimeStampAction(t))}},{key:"updateVisibleWatcherItemsAtTimeStampSafeToDelete",value:function(t){var e=t.timeStamp,r=t.pageVisitId,n=t.deviceDocumentLoadTime,o=t.safeToDelete;this.store.dispatch(i.updateVisibleWatcherItemsAtTimeStampSafeToDeleteAction({timeStamp:e,pageVisitId:r,deviceDocumentLoadTime:n,safeToDelete:o}))}},{key:"getVisibleWatcherItemsAtTimeStamp",value:function(t){var e,r=t.timeStamp,n=t.pageVisitId,o=t.deviceDocumentLoadTime;return(null===(e=this.state.visibleWatcherItemsAtTimeStamps)||void 0===e?void 0:e.filter((function(t){return t.timeStamp===r&&t.pageVisitId===n&&t.deviceDocumentLoadTime===o})))||[]}},{key:"getAllVisibleWatcherItemsAtTimeStamp",value:function(){return this.state.visibleWatcherItemsAtTimeStamps||[]}},{key:"getTurnedVisibleWatcherItems",value:function(t){var e,r=t.pageVisitId,n=t.deviceDocumentLoadTime,o=t.timeStampStart,i=t.timeStampEnd;return(null===(e=this.state.turnedVisibleWatcherItems)||void 0===e?void 0:e.filter((function(t){return t.pageVisitId===r&&t.deviceDocumentLoadTime===n&&t.timeStamp>=o&&t.timeStamp<=i})))||[]}},{key:"getAllTurnedVisibleWatcherItems",value:function(){return this.state.turnedVisibleWatcherItems||[]}},{key:"addTurnedVisibleWatcherItem",value:function(t){this.store.dispatch(i.addTurnedVisibleWatcherItemAction(t))}},{key:"updateTurnedVisibleWatcherItemSafeToDelete",value:function(t){var e=t.timeStamp,r=t.pageVisitId,n=t.deviceDocumentLoadTime,o=t.safeToDelete;this.store.dispatch(i.updateTurnedVisibleWatcherItemSafeToDeleteAction({timeStamp:e,pageVisitId:r,deviceDocumentLoadTime:n,safeToDelete:o}))}},{key:"reducer",value:function(t){return function(){var e=arguments.length>1?arguments[1]:void 0,r=du({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:t);return(0,Zr.P9)(e,i.emptyStateAction)&&(r.contentWatcherItems=[],r.visibleWatcherItemsAtTimeStamps=[],r.turnedVisibleWatcherItems=[]),(0,Zr.P9)(e,i.addContentWatcherItemAction)&&(r.contentWatcherItems=[].concat(hu(r.contentWatcherItems||[]),[e.payload])),(0,Zr.P9)(e,i.updateContentWatcherItemAction)&&(r.contentWatcherItems=(r.contentWatcherItems||[]).map((function(t){return t.id===e.payload.id?{id:e.payload.id,isVisible:e.payload.isVisible,contentTrackerDtoIds:e.payload.contentTrackerDtoIds,contentWatchedElement:t.contentWatchedElement}:t}))),(0,Zr.P9)(e,i.addVisibleWatcherItemsAtTimeStampAction)&&(r.visibleWatcherItemsAtTimeStamps=[].concat(hu(r.visibleWatcherItemsAtTimeStamps||[]),[e.payload])),(0,Zr.P9)(e,i.updateVisibleWatcherItemsAtTimeStampSafeToDeleteAction)&&(r.visibleWatcherItemsAtTimeStamps=(r.visibleWatcherItemsAtTimeStamps||[]).map((function(t){return t.timeStamp===e.payload.timeStamp&&t.pageVisitId===e.payload.pageVisitId&&t.deviceDocumentLoadTime===e.payload.deviceDocumentLoadTime?du(du({},t),{},{safeToDelete:e.payload.safeToDelete}):t}))),(0,Zr.P9)(e,i.addTurnedVisibleWatcherItemAction)&&(r.turnedVisibleWatcherItems=[].concat(hu(r.turnedVisibleWatcherItems||[]),[e.payload])),(0,Zr.P9)(e,i.updateTurnedVisibleWatcherItemSafeToDeleteAction)&&(r.turnedVisibleWatcherItems=(r.turnedVisibleWatcherItems||[]).map((function(t){return t.timeStamp===e.payload.timeStamp&&t.pageVisitId===e.payload.pageVisitId&&t.deviceDocumentLoadTime===e.payload.deviceDocumentLoadTime?du(du({},t),{},{safeToDelete:e.payload.safeToDelete}):t}))),r}}}],r&&mu(e.prototype,r),n&&mu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}($r);function Ou(t){return Ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ou(t)}function Iu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ku(n.key),n)}}function ku(t){var e=function(t,e){if("object"!==Ou(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ou(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ou(e)?e:String(e)}function xu(t,e){return xu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xu(t,e)}function ju(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_u(t);if(e){var o=_u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===Ou(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function _u(t){return _u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_u(t)}Eu(Pu,"actionCreator",(0,Zr.ZP)("CONTENT_STATE")),Eu(Pu,"emptyStateAction",Pu.actionCreator("EMPTY_STATE")),Eu(Pu,"addContentWatcherItemAction",Pu.actionCreator("ADD_CONTENT_WATCHER_ITEM")),Eu(Pu,"updateContentWatcherItemAction",Pu.actionCreator("UPDATE_CONTENT_WATCHER_ITEM")),Eu(Pu,"addVisibleWatcherItemsAtTimeStampAction",Pu.actionCreator("ADD_VISIBLE_WATCHER_ITEMS_AT_TIME_STAMP")),Eu(Pu,"updateVisibleWatcherItemsAtTimeStampSafeToDeleteAction",Pu.actionCreator("UPDATE_VISIBLE_WATCHER_ITEMS_AT_TIME_STAMP_SAFE_TO_DELETE")),Eu(Pu,"addTurnedVisibleWatcherItemAction",Pu.actionCreator("ADD_TURNED_VISIBLE_WATCHER_ITEM")),Eu(Pu,"updateTurnedVisibleWatcherItemSafeToDeleteAction",Pu.actionCreator("UPDATE_TURNED_VISIBLE_WATCHER_ITEM_SAFE_TO_DELETE"));var Lu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xu(t,e)}(i,t);var e,r,n,o=ju(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t.id)).dto=t,e}return e=i,(r=[{key:"toDto",value:function(){return this.dto}}])&&Iu(e.prototype,r),n&&Iu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(W);function Au(){x.register(kn,{useFactory:A((function(){return kn.create(kn,{})}))}),x.register(fn,{useClass:Cn}),x.register(hn,{useClass:Gn}),x.register(Ri,{useFactory:A((function(){return Ri.create(Ri,{})}))}),x.register(hi,{useClass:Ei}),x.register(vi,{useClass:Mi}),x.register(ln,{useFactory:A((function(){return ln.create(ln,{})}))}),x.register(R,{useClass:ci}),x.register(C,{useClass:fi}),x.register(fc,{useFactory:A((function(){return fc.create(fc,{})}))}),x.register(Ka,{useClass:Qc}),x.register(la,{useFactory:A((function(){return la.create(la,{})}))}),x.register(Wi,{useClass:Ki}),x.register(Po,{useFactory:A((function(){return Po.create(Po,{})}))}),x.register(Un,{useClass:eo}),x.register(Bn,{useClass:co}),x.register(Ma,{useFactory:A((function(){return Ma.create(Ma,{})}))}),x.register(ba,{useClass:Ha}),x.register(wa,{useClass:Xa}),x.register(Bc,{useFactory:A((function(){return Bc.create(Bc,{})}))}),x.register(yc,{useClass:Ec}),x.register(vc,{useClass:xc}),x.register(Pu,{useFactory:A((function(){return Pu.create(Pu,{})}))}),x.register($c,{useClass:au}),x.register(tu,{useClass:lu}),x.register(Uo,{useFactory:A((function(){return Uo.create(Uo,{})}))}),x.register(Io,{useClass:Qo}),x.register(xo,{useClass:ti})}function Ru(t){return Ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(t)}function Du(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Cu(n.key),n)}}function Cu(t){var e=function(t,e){if("object"!==Ru(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ru(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ru(e)?e:String(e)}function Nu(t,e){return Nu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Nu(t,e)}function Mu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Vu(t);if(e){var o=Vu(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===Ru(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function Vu(t){return Vu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vu(t)}var Gu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nu(t,e)}(i,t);var e,r,n,o=Mu(i);function i(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,gr.libraryApiBaseUrl)}return e=i,(r=[{key:"createRequest",value:function(t,e){return new pr(t,this.getFullUri(e))}}])&&Du(e.prototype,r),n&&Du(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(vr);function Wu(t){return Wu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wu(t)}function Fu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Bu(n.key),n)}}function Uu(t,e,r){return e&&Fu(t.prototype,e),r&&Fu(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Bu(t){var e=function(t,e){if("object"!==Wu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Wu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Wu(e)?e:String(e)}var Hu=Uu((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){(e=Bu(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(this,"API_ENDPOINT","./js"),this.libraryHttpClient=new Gu}));function Yu(t){return Yu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yu(t)}function zu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qu(n.key),n)}}function qu(t){var e=function(t,e){if("object"!==Yu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Yu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Yu(e)?e:String(e)}var Xu=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,n;return e=t,n=[{key:"setObject",value:function(t,e){sessionStorage.setItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t),JSON.stringify(e))}},{key:"pushArrayItem",value:function(t,e){var r=this.getArray(t);r.push(e),this.setObject(t,r)}},{key:"getLastArrayItem",value:function(t){var e=this.getArray(t);return e[e.length-1]}},{key:"removeArrayItem",value:function(t,e){var r=this.getArray(t),n=r.findIndex((function(t){return t===e}));-1!==n&&(r.splice(n,1),this.setObject(t,r))}},{key:"getArray",value:function(t){var e=sessionStorage.getItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t));return e?JSON.parse(e):[]}},{key:"getObject",value:function(t){var e=sessionStorage.getItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t));return e?JSON.parse(e):void 0}},{key:"setItem",value:function(t,e){sessionStorage.setItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t),e)}},{key:"getItem",value:function(t){return sessionStorage.getItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t))}},{key:"getNumber",value:function(t){var e=sessionStorage.getItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t));return e?Number(e):void 0}},{key:"removeItem",value:function(t){sessionStorage.removeItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t))}},{key:"popItem",value:function(t){var e=sessionStorage.getItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t));return e&&sessionStorage.removeItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t)),e}}],(r=null)&&zu(e.prototype,r),n&&zu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Qu(t){return Qu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qu(t)}function Ku(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ju(n.key),n)}}function Ju(t){var e=function(t,e){if("object"!==Qu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Qu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Qu(e)?e:String(e)}!function(t,e,r){(e=qu(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(Xu,"STORAGE_NAME_SPACE","aww22");var $u=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,n;return e=t,n=[{key:"setObject",value:function(t,e){localStorage.setItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t),JSON.stringify(e))}},{key:"getObject",value:function(t){var e=localStorage.getItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t));return e?JSON.parse(e):void 0}},{key:"setItem",value:function(t,e){localStorage.setItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t),e)}},{key:"getItem",value:function(t){return localStorage.getItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t))}},{key:"getNumber",value:function(t){var e=localStorage.getItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t));return e?Number(e):void 0}},{key:"removeItem",value:function(t){localStorage.removeItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t))}},{key:"popItem",value:function(t){var e=localStorage.getItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t));return e&&localStorage.removeItem("".concat(this.STORAGE_NAME_SPACE,"_").concat(t)),e}}],(r=null)&&Ku(e.prototype,r),n&&Ku(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Zu(t){return Zu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zu(t)}function ts(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,es(n.key),n)}}function es(t){var e=function(t,e){if("object"!==Zu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Zu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Zu(e)?e:String(e)}!function(t,e,r){(e=Ju(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}($u,"STORAGE_NAME_SPACE","aww22");var rs,ns=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,n;return e=t,n=[{key:"isHTMLElement",value:function(t){if(!t)return!1;try{return t instanceof HTMLElement}catch(e){return"object"===Zu(t)&&1===t.nodeType&&"object"===Zu(t.style)&&"object"===Zu(t.ownerDocument)}}},{key:"getElementsFromXPath",value:function(t){for(var e=[],r=document.evaluate(t,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),n=0,o=r.snapshotLength;n<o;++n){var i=r.snapshotItem(n);this.isHTMLElement(i)&&e.push(i)}return e}},{key:"buildQuerySelectorStringFromTagName",value:function(t){var e,r=t.tagName,n=t.attributeName,o=t.attributeValue;if(r&&n){var i="*"===r?"":r.toLowerCase();switch("*"===n?"":n.toLowerCase()){case"":e="".concat(i);break;case"id":o&&(e="".concat(i,"#").concat(o));break;case"class":o&&(e="".concat(i,".").concat(o.replace(/\s+/g,".").replace(/^\./g,"").replace(/\.$/g,"")));break;case"name":case"href":case"src":case"value":e="".concat(i,"[").concat(n,'="').concat(o,'"]')}}return e}},{key:"getElementsFromQuerySelector",value:function(t){var e=[],r=this.buildQuerySelectorStringFromTagName(t);if(r)for(var n=document.querySelectorAll(r),o=0,i=n.length;o<i;++o){var a=n[o];this.isHTMLElement(a)&&e.push(a)}return e}},{key:"getElementsFromTrackerDefinition",value:function(t){var e=[];return"tagName"in t?e=this.getElementsFromQuerySelector(t):"xpath"in t&&(e=this.getElementsFromXPath(t.xpath)),e}},{key:"isVisibleByOpacity",value:function(t){var e=!0,r=t.currentStyle||window.getComputedStyle(t);if(null!=r&&r.opacity&&Number(r.opacity)<.5&&(e=!1),e){var n,o=void 0;if(t.parentElement){var i=t.parentElement;o=i.currentStyle||window.getComputedStyle(i)}null!==(n=o)&&void 0!==n&&n.opacity&&Number(o.opacity)<.5&&(e=!1)}return e}},{key:"isVisibleByPosition",value:function(t){var e=t.innerWidth,r=t.innerHeight,n=t.domRect,o=n.top,i=n.left,a=n.bottom,c=n.right;return(i>=0&&i<=e||c>=0&&c<=e||i<=0&&c>=e)&&(o>=0&&o<=r||a>=0&&a<=r||o<=0&&a>=r)}},{key:"getImageUrlFromElement",value:function(t){var e;if(this.isHTMLElement(t)&&("img"===t.tagName.toLowerCase()&&(e=t.src),"string"!=typeof e||!e.length)){var r=window.getComputedStyle(t).backgroundImage;if(r){var n=r.match(/url\(['"]?([^'"]+)['"]?\)/);n&&(e=n[1])}}return e}}],(r=null)&&ts(e.prototype,r),n&&ts(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function os(t){return os="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},os(t)}function is(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */is=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==os(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function as(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function cs(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){as(i,n,o,a,c,"next",t)}function c(t){as(i,n,o,a,c,"throw",t)}a(void 0)}))}}function us(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ys(n.key),n)}}function ss(t,e){return ss=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ss(t,e)}function ls(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ps(t);if(e){var o=ps(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===os(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return fs(t)}(this,r)}}function fs(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ps(t){return ps=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ps(t)}function hs(t,e,r){return(e=ys(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ys(t){var e=function(t,e){if("object"!==os(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==os(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===os(e)?e:String(e)}var vs,ds=function(t){return t.ActionTracker="actionTracker",t.ImageSetting="imageSetting",t.TextSetting="textSetting",t.PageTextHash="pageTextHash",t.IphoneCompatibilitySettings="iphoneCompatibilitySettings",t.Visitor="visitor",t}({}),ms=L()(rs=function(t,e){return _(kn)(t,void 0,0)}(rs=Reflect.metadata("design:type",Function)(rs=Reflect.metadata("design:paramtypes",[void 0===kn?Object:kn])(rs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ss(t,e)}(s,t);var e,r,n,o,i,a,c,u=ls(s);function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),hs(fs(e=u.call(this)),"GET_LIBRARY_SESSION_HANDLER","aww22LibrarySessionGet"),hs(fs(e),"ACTION_TRACKER","actionTracker"),hs(fs(e),"IMAGE_SETTING","imageSetting"),hs(fs(e),"TEXT_SETTING","textSetting"),hs(fs(e),"PAGE_TEXT_HASHES","pageTextHashes"),hs(fs(e),"IPHONE_COMPATIBILITY_SETTINGS","iphoneCompatibilitySettings"),hs(fs(e),"LIBRARY_EXPIRES_AT_LOCAL_TIME","libraryExpiresAtLocalTime"),hs(fs(e),"VISITOR","visitor"),hs(fs(e),"TABS_OPENED","tabsOpened"),hs(fs(e),"LIBRARY_SESSION_ID","librarySessionId"),hs(fs(e),"TAB_UNIQUE_ID","tabUniqueId"),hs(fs(e),"dataExpireInMs",3e5),hs(fs(e),"libraryExpiredInMs",12e4),e.librarySessionStateManager=t,e}return e=s,r=[{key:"load",value:(c=cs(is().mark((function t(e){var r,n,o,i,a,c,u,s,l,f,p,h,y;return is().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.applicationPublicId,n=this.loadState(),o=n.actionTrackerState,i=n.imageSettingState,a=n.textSettingState,c=n.pageTextHashStates,u=n.iphoneCompatibilitySettingsState,s=n.visitorState,l=n.libraryExpiresAtLocalTime,f=n.librarySessionId,p=n.tabUniqueId,void 0!==o&&this.librarySessionStateManager.setActionTrackerState(o),void 0!==i&&this.librarySessionStateManager.setImageSettingState(i),void 0!==a&&this.librarySessionStateManager.setTextSettingState(a),void 0!==c&&this.librarySessionStateManager.setPageTextHashState(c),void 0!==u&&this.librarySessionStateManager.setIphoneCompatibilitySettingsState(u),void 0!==s&&this.librarySessionStateManager.setVisitorState(s),void 0!==l&&this.librarySessionStateManager.setLibraryExipresAtLocalTime(l),void 0!==f&&this.librarySessionStateManager.setLibrarySessionId(f),void 0!==p&&this.librarySessionStateManager.setTabUniqueId(p),h=performance.timeOrigin||performance.timing.navigationStart||(new Date).getTime(),this.librarySessionStateManager.setDeviceDocumentLoadTime(h),y=this.isTouchDevice(),this.librarySessionStateManager.setIsTouchDevice(y),t.next=17,this.handleExpiredLibrarySession({applicationPublicId:r});case 17:this.saveState();case 18:case"end":return t.stop()}}),t,this)}))),function(t){return c.apply(this,arguments)})},{key:"unload",value:(a=cs(is().mark((function t(){return is().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.storageSetTabsOpened(0),this.saveState();case 2:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"isTouchDevice",value:function(){var t=navigator,e=window;return"ontouchstart"in window||t.maxTouchPoints>0||Boolean(t.msMaxTouchPoints&&t.msMaxTouchPoints>0)||Boolean(e.DocumentTouch)}},{key:"loadState",value:function(){var t,e=$u.getObject(this.ACTION_TRACKER)||void 0,r=$u.getObject(this.IMAGE_SETTING)||void 0,n=$u.getObject(this.TEXT_SETTING)||void 0,o=$u.getObject(this.PAGE_TEXT_HASHES)||void 0,i=$u.getObject(this.IPHONE_COMPATIBILITY_SETTINGS)||void 0,a=$u.getObject(this.VISITOR)||void 0,c=Xu.getItem(this.LIBRARY_EXPIRES_AT_LOCAL_TIME);return c&&(t=parseInt(c,10)),{actionTrackerState:e,imageSettingState:r,textSettingState:n,pageTextHashStates:o,iphoneCompatibilitySettingsState:i,visitorState:a,libraryExpiresAtLocalTime:t,librarySessionId:Xu.getItem(this.LIBRARY_SESSION_ID)||void 0,tabUniqueId:$u.getItem(this.TAB_UNIQUE_ID)||void 0}}},{key:"saveState",value:function(){var t=this.librarySessionStateManager.getActionTracker();t&&$u.setObject(this.ACTION_TRACKER,t);var e=this.librarySessionStateManager.getImageSetting();e&&$u.setObject(this.IMAGE_SETTING,e);var r=this.librarySessionStateManager.getTextSetting();r&&$u.setObject(this.TEXT_SETTING,r);var n=this.librarySessionStateManager.getPageTextHashes();n&&$u.setObject(this.PAGE_TEXT_HASHES,n);var o=this.librarySessionStateManager.getIphoneCompatibilitySettings();o&&$u.setObject(this.IPHONE_COMPATIBILITY_SETTINGS,o);var i=this.librarySessionStateManager.getVisitor();i&&$u.setObject(this.VISITOR,i);var a=this.librarySessionStateManager.getLibraryExpiresAtLocalTime();a&&Xu.setItem(this.LIBRARY_EXPIRES_AT_LOCAL_TIME,a.toString());var c=this.librarySessionStateManager.getLibrarySessionId();c&&Xu.setItem(this.LIBRARY_SESSION_ID,c);var u=this.librarySessionStateManager.getTabUniqueId();u&&$u.setItem(this.TAB_UNIQUE_ID,u)}},{key:"getExpiredDataItems",value:function(){var t=[],e=document.location.href,r=this.librarySessionStateManager.getActionTracker();r?r.createdAtLocalTime+this.dataExpireInMs<(new Date).getTime()&&t.push(ds.ActionTracker):t.push(ds.ActionTracker);var n=this.librarySessionStateManager.getImageSetting();n?n.createdAtLocalTime+this.dataExpireInMs<(new Date).getTime()&&t.push(ds.ImageSetting):t.push(ds.ImageSetting);var o=this.librarySessionStateManager.getTextSetting();o?o.createdAtLocalTime+this.dataExpireInMs<(new Date).getTime()&&t.push(ds.TextSetting):t.push(ds.TextSetting);var i=this.librarySessionStateManager.getPageTextHashesForPage(e);i?i.createdAtLocalTime+this.dataExpireInMs<(new Date).getTime()&&t.push(ds.PageTextHash):t.push(ds.PageTextHash);var a=this.librarySessionStateManager.getIphoneCompatibilitySettings();a?a.createdAtLocalTime+this.dataExpireInMs<(new Date).getTime()&&t.push(ds.IphoneCompatibilitySettings):t.push(ds.IphoneCompatibilitySettings);var c=this.librarySessionStateManager.getVisitor();return c?c.createdAtLocalTime+this.dataExpireInMs<(new Date).getTime()&&t.push(ds.Visitor):t.push(ds.Visitor),t}},{key:"handleExpiredLibrarySession",value:(i=cs(is().mark((function t(e){var r,n,o,i,a,c,u,s,l,f;return is().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.applicationPublicId,n=Xu.getItem(this.LIBRARY_SESSION_ID),o=this.librarySessionStateManager.getLibrarySessionId(),i=o||n,a=!0,(c=this.librarySessionStateManager.getLibraryExpiresAtLocalTime())&&c>(new Date).getTime()&&(a=!1),u=this.getExpiredDataItems(),s=this.getIsNewTab(),"string"==typeof i&&!a&&0===u.length&&!s){t.next=28;break}if(l=this.librarySessionStateManager.getTabUniqueId(),s&&(l=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)),l){t.next=16;break}throw new Error("Tab unique id not found");case 16:return t.next=18,this.getLibrarySession({applicationPublicId:r,expiredDataItems:u,tabUniqueId:l});case 18:f=t.sent,this.librarySessionStateManager.setLibraryExipresAtLocalTime(f.librarySessionDto.deviceDocumentLoadTime+this.libraryExpiredInMs),this.librarySessionStateManager.setTabUniqueId(l),f.actionTrackers&&this.librarySessionStateManager.setActionTrackerState({createdAtLocalTime:f.librarySessionDto.deviceDocumentLoadTime,actionTrackers:f.actionTrackers}),f.imageSettings&&this.librarySessionStateManager.setImageSettingState({createdAtLocalTime:f.librarySessionDto.deviceDocumentLoadTime,imageSettings:f.imageSettings}),f.textSettings&&this.librarySessionStateManager.setTextSettingState({createdAtLocalTime:f.librarySessionDto.deviceDocumentLoadTime,textSettings:f.textSettings}),f.textHashes&&this.librarySessionStateManager.updateOrCreatePageTextHashState({createdAtLocalTime:f.librarySessionDto.deviceDocumentLoadTime,pageId:window.location.href,textHashes:f.textHashes}),f.iphoneCompatibilitySettings&&this.librarySessionStateManager.setIphoneCompatibilitySettingsState({createdAtLocalTime:f.librarySessionDto.deviceDocumentLoadTime,iphoneCompatibilitySettings:f.iphoneCompatibilitySettings}),f.visitor&&this.librarySessionStateManager.setVisitorState({createdAtLocalTime:f.librarySessionDto.deviceDocumentLoadTime,visitor:f.visitor}),this.librarySessionStateManager.setLibrarySessionId(f.librarySessionDto.id);case 28:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"getLibrarySession",value:(o=cs(is().mark((function t(e){var r,n,o,i,a,c,u,s,l,f,p,h,y,v,d,m,g,b,w,S,E,T,P;return is().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.applicationPublicId,n=e.expiredDataItems,o=void 0===n?[]:n,i=e.tabUniqueId,a=Xu.getItem(this.LIBRARY_SESSION_ID),c=this.librarySessionStateManager.getLibrarySessionId(),u=c||a,s=this.getIsNewTab(),l=performance.timeOrigin||performance.timing.navigationStart||(new Date).getTime(),f=this.isTouchDevice(),p=this.librarySessionStateManager.getVisitor(),h=window.location.href,(y=this.libraryHttpClient.createRequest(F.GET,this.API_ENDPOINT)).setQueryParameter("queryHandler",this.GET_LIBRARY_SESSION_HANDLER),y.setQueryParameter("token",r),y.setQueryParameter("visitorId",null==p?void 0:p.visitor.id),y.setQueryParameter("tabUniqueId",i),y.setQueryParameter("deviceDocumentLoadTime",l),y.setQueryParameter("isNewTab",s),y.setQueryParameter("isTouchDevice",f),y.setQueryParameter("expiredDataItems",o.join(",")),y.setQueryParameter("currentUrl",encodeURIComponent(h)),y.setQueryParameter("librarySessionId",u),y.setQueryParameter("pageTitle",document.title),t.next=23,y.execute();case 23:if(v=t.sent,d=v.getBody(),m=d.librarySessionId,g=d.actionTrackers,b=d.imageSettings,w=d.textSettings,S=d.textHashes,E=d.iphoneCompatibilitySettings,T=d.visitor,m){t.next=28;break}throw new Error("Library session not found l4");case 28:return P={id:m,deviceDocumentLoadTime:l,isTouchDevice:f,tabUniqueId:i},t.abrupt("return",{librarySessionDto:P,actionTrackers:g,imageSettings:b,textSettings:w,textHashes:S,iphoneCompatibilitySettings:E,visitor:T});case 30:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"getIsNewTab",value:function(){var t=this.storageGetTabsOpened();return Xu.getItem(this.LIBRARY_SESSION_ID)?void 0!==this.isNewTab?this.isNewTab:(void 0===t&&(this.isNewTab=!0,t=0,this.storageSetTabsOpened(t)),(t=Number(t)+1)>=2&&(t=1,this.isNewTab=!0,this.storageSetTabsOpened(t)),Boolean(this.isNewTab)):(this.isNewTab=!0,Boolean(this.isNewTab))}},{key:"storageSetTabsOpened",value:function(t){Xu.setItem(this.TABS_OPENED,t.toString())}},{key:"storageGetTabsOpened",value:function(){var t=Xu.getItem(this.TABS_OPENED);if(t)return Number(t)}}],r&&us(e.prototype,r),n&&us(e,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(Hu))||rs)||rs)||rs)||rs;function gs(t){return gs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gs(t)}function bs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ws(n.key),n)}}function ws(t){var e=function(t,e){if("object"!==gs(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==gs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===gs(e)?e:String(e)}var Ss,Es=L()(vs=function(t,e){return _(hn)(t,void 0,0)}(vs=Reflect.metadata("design:type",Function)(vs=Reflect.metadata("design:paramtypes",["undefined"==typeof ILibrarySessionDataProvider?Object:ILibrarySessionDataProvider])(vs=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.librarySessionDataProvider=e}var e,r,n;return e=t,(r=[{key:"isTouchDevice",value:function(){return this.librarySessionDataProvider.isTouchDevice()}},{key:"getVisitor",value:function(){return this.librarySessionDataProvider.getVisitor()}}])&&bs(e.prototype,r),n&&bs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||vs)||vs)||vs)||vs;function Ts(t){return Ts="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ts(t)}function Ps(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Os(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ps(Object(r),!0).forEach((function(e){Ns(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ps(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Is(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ks(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ks(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function ks(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function xs(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */xs=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Ts(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function js(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _s(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){js(i,n,o,a,c,"next",t)}function c(t){js(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Ls(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ms(n.key),n)}}function As(t,e){return As=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},As(t,e)}function Rs(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Cs(t);if(e){var o=Cs(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===Ts(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ds(t)}(this,r)}}function Ds(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Cs(t){return Cs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Cs(t)}function Ns(t,e,r){return(e=Ms(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ms(t){var e=function(t,e){if("object"!==Ts(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ts(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ts(e)?e:String(e)}var Vs=L()(Ss=function(t,e){return _(N)(t,void 0,0)}(Ss=function(t,e){return _(ln)(t,void 0,1)}(Ss=function(t,e){return _(fn)(t,void 0,2)}(Ss=Reflect.metadata("design:type",Function)(Ss=Reflect.metadata("design:paramtypes",["undefined"==typeof ILibrarySessionRepository?Object:ILibrarySessionRepository,void 0===ln?Object:ln,"undefined"==typeof ILibrarySessionService?Object:ILibrarySessionService])(Ss=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&As(t,e)}(u,t);var e,r,n,o,i,a,c=Rs(u);function u(t,e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),Ns(Ds(n=c.call(this)),"UPDATING_RADIUS_HANDLER","aww22VisitorUpdateRadius"),Ns(Ds(n),"UPDATING_FORCE_HANDLER","aww22VisitorUpdateForce"),n.visitorStateManager=e,n.librarySessionRepository=t,n.librarySessionService=r,n}return e=u,r=[{key:"load",value:(a=_s(xs().mark((function t(){var e,r,n,o,i,a,c,u,s,l;return xs().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=this.loadState(),r=e.visitor,this.visitorStateManager.setVisitor(r),this.librarySessionRepository.isTouchDevice()&&(n=r.screenHeightCm,o=r.screenWidthCm,i=.19184880959048886,n&&o?(a=screen,c=a.height,u=a.width,s=Math.sqrt(Math.pow(c,2)+Math.pow(u,2)),l=Math.sqrt(Math.pow(n,2)+Math.pow(o,2)),i=l/s):this.visitorStateManager.setDebugInfo([lo.UseFakeScreenSize]),this.visitorStateManager.setScreenRatio(i));case 3:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"unload",value:function(){this.visitorStateManager.emptyState()}},{key:"normalizeCalibrateTouchExpression",value:function(t){if(!this.librarySessionRepository.isTouchDevice())throw new Error("Not touch device");var e=this.ncTouchExpressionRadius(t);return this.ncTouchExpressionForce(e)}},{key:"normalizePagePosition",value:function(t,e){return t/e*1e4}},{key:"getPageMaxDimension",value:function(){var t=screen.height,e=screen.width,r=document.elementFromPoint(screen.width/2,screen.height/2);if(null!==r){t=r.getBoundingClientRect().height;for(var n=r;null!==n;){var o=n.getBoundingClientRect(),i=n.parentElement,a=null==i?void 0:i.getBoundingClientRect(),c=Math.max(n.scrollHeight,o.height);if(c>t&&(t=c,i&&a&&(t+=a.top)),null===i)break;n=i}}return{pageMaxHeight:t,pageMaxWidth:e}}},{key:"getNormlizedPagePositionForTouchEvent",value:function(t){if(t.touches.length){var e,r=this.getPageMaxDimension(),n=r.pageMaxHeight,o=r.pageMaxWidth,i=0,a=Is(t.composedPath());try{for(a.s();!(e=a.n()).done;){var c=e.value;c instanceof HTMLElement&&c.scrollTop&&c.scrollTop>0&&(i+=c.scrollTop)}}catch(t){a.e(t)}finally{a.f()}var u={pageYNormalized:this.normalizePagePosition(t.touches[0].clientY+i,n),pageXNormalized:this.normalizePagePosition(t.touches[0].clientX,o),pageMaxHeight:n,pageMaxWidth:o};return this.visitorStateManager.setPageMaxHeight(n),this.visitorStateManager.setPageMaxWidth(o),u}}},{key:"handleResizeEvent",value:function(t){var e=this.getPageMaxDimension(),r=e.pageMaxHeight,n=e.pageMaxWidth;this.visitorStateManager.setPageMaxHeight(r),this.visitorStateManager.setPageMaxWidth(n)}},{key:"updateForce",value:(i=_s(xs().mark((function t(){var e,r,n,o;return xs().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.visitorStateManager.getVisitor()){t.next=3;break}throw new Error("Visitor not found");case 3:if(r=e.userAgentId,n=e.forceMax){t.next=6;break}throw new Error("Force not found");case 6:return(o=this.libraryHttpClient.createRequest(F.GET,this.API_ENDPOINT)).setQueryParameter("queryHandler",this.UPDATING_FORCE_HANDLER),o.setQueryParameter("userAgentId",r),o.setQueryParameter("forceMax",n.toString()),t.next=12,o.execute();case 12:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"handleNewForce",value:function(t){var e=this.visitorStateManager.getVisitor();if(!e)throw new Error("Visitor not found");var r=Os(Os({},e),{},{forceMax:t});this.visitorStateManager.setVisitor(r),this.librarySessionService.updateVisitor(r),this.updateForce()}},{key:"normalizeForce",value:function(t,e){return 0===e?0:t/e}},{key:"ncTouchExpressionForce",value:function(t){var e=this,r=this.visitorStateManager.getVisitor();if(!r)throw new Error("Visitor not found");var n=r.forceMax,o=n||0;return t.empulses.forEach((function(t){t.touchEvents.forEach((function(t){t.touches.forEach((function(t){t.force>o&&(o=t.force)}))}))})),o!==n&&this.handleNewForce(o),Os(Os({},t),{},{empulses:t.empulses.map((function(t){return Os(Os({},t),{},{touchEvents:t.touchEvents.map((function(t){return Os(Os({},t),{},{touches:t.touches.map((function(t){return Os(Os({},t),{},{forceNormalized:e.normalizeForce(t.force,o)})}))})}))})}))})}},{key:"updateRadius",value:(o=_s(xs().mark((function t(){var e,r,n,o,i;return xs().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.visitorStateManager.getVisitor()){t.next=3;break}throw new Error("Visitor not found");case 3:if(r=e.userAgentId,n=e.radiusXMax,o=e.radiusYMax,n&&o){t.next=6;break}throw new Error("Radius not found");case 6:return(i=this.libraryHttpClient.createRequest(F.GET,this.API_ENDPOINT)).setQueryParameter("queryHandler",this.UPDATING_RADIUS_HANDLER),i.setQueryParameter("userAgentId",r),i.setQueryParameter("radiusXMax",n.toString()),i.setQueryParameter("radiusYMax",o.toString()),t.next=13,i.execute();case 13:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"handleNewRadius",value:function(t,e){var r=this.visitorStateManager.getVisitor();if(!r)throw new Error("Visitor not found");var n=Os(Os({},r),{},{radiusXMax:t,radiusYMax:e});this.visitorStateManager.setVisitor(n),this.librarySessionService.updateVisitor(n),this.updateRadius()}},{key:"normalizeRadius",value:function(t,e){return 0===e?0:t/e}},{key:"ncTouchExpressionRadius",value:function(t){var e=this,r=this.visitorStateManager.getVisitor();if(!r)throw new Error("Visitor not found");var n=r.radiusXMax,o=r.radiusYMax,i=n||0,a=o||0;return t.empulses.forEach((function(t){t.touchEvents.forEach((function(t){t.touches.forEach((function(t){t.radiusX>i&&(i=t.radiusX),t.radiusY>a&&(a=t.radiusY)}))}))})),i===n&&a===o||this.handleNewRadius(i,a),Os(Os({},t),{},{empulses:t.empulses.map((function(t){return Os(Os({},t),{},{touchEvents:t.touchEvents.map((function(t){return Os(Os({},t),{},{touches:t.touches.map((function(t){return Os(Os({},t),{},{radiusXNormalized:e.normalizeRadius(t.radiusX,i),radiusYNormalized:e.normalizeRadius(t.radiusY,a)})}))})}))})}))})}},{key:"loadState",value:function(){return{visitor:this.storageLoadCurrentVisitor()}}},{key:"storageLoadCurrentVisitor",value:function(){var t=this.librarySessionRepository.getVisitor();if(!t)throw new Error("Visitor not found");return t.visitor}}],r&&Ls(e.prototype,r),n&&Ls(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(Hu))||Ss)||Ss)||Ss)||Ss)||Ss)||Ss;var Gs,Ws=function(t){return t.TimerEvent="TimerEvent",t.PushNetworkDataItem="PushNetworkDataItem",t}({}),Fs=function(t){return t.Loaded="Loaded",t.NetworkDataItemIsSent="NetworkDataItemIsSent",t}({});function Us(t){return Us="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Us(t)}function Bs(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Hs(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Bs(Object(r),!0).forEach((function(e){Zs(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bs(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ys(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ys=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Us(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function zs(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function qs(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){zs(i,n,o,a,c,"next",t)}function c(t){zs(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Xs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,tl(n.key),n)}}function Qs(t,e){return Qs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qs(t,e)}function Ks(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=$s(t);if(e){var o=$s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===Us(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Js(t)}(this,r)}}function Js(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $s(t){return $s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$s(t)}function Zs(t,e,r){return(e=tl(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tl(t){var e=function(t,e){if("object"!==Us(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Us(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Us(e)?e:String(e)}var el,rl=L()(Gs=function(t,e){return _(fc)(t,void 0,0)}(Gs=function(t,e){return _(Ja)(t,void 0,1)}(Gs=function(t,e){return _(yc)(t,void 0,2)}(Gs=Reflect.metadata("design:type",Function)(Gs=Reflect.metadata("design:paramtypes",[void 0===fc?Object:fc,"undefined"==typeof IDataReporterRepository?Object:IDataReporterRepository,"undefined"==typeof IDataReporterService?Object:IDataReporterService])(Gs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qs(t,e)}(u,t);var e,r,n,o,i,a,c=Ks(u);function u(t,e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),Zs(Js(n=c.call(this)),"STORAGE_TOUCH_EXPRESSIONS","visitorActivityTouchExpressions"),Zs(Js(n),"STORAGE_ACTIONS","visitorActivityActions"),Zs(Js(n),"STORAGE_PAGE_VISITS","visitorActivityPageVisits"),Zs(Js(n),"pageVisitSendInterval",5e3),n.visitorActivityStateManager=t,n.dataReporterRepository=e,n.dataReporterService=r,n.handleWorkerMessage=n.handleWorkerMessage.bind(Js(n)),n}return e=u,r=[{key:"load",value:(a=qs(Ys().mark((function t(){var e,r,n,o=this;return Ys().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getDataReporterWorker();case 2:e=this.loadState(),r=e.touchExpressionStateItems,n=e.actionStateItems,e.pageVisitStateItems.forEach((function(t){o.visitorActivityStateManager.pushPageVisitStateItem(t)})),r.forEach((function(t){o.visitorActivityStateManager.pushTouchExpressionStateItem(t),o.pushTouchExpressionItem(t.touchExpressionItem)})),n.forEach((function(t){o.visitorActivityStateManager.pushActionStateItem(t),o.pushActionItem(t.actionItem)})),this.updatePagevisitGroup();case 7:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"unload",value:function(){var t;this.saveState(),null===(t=u.dataReporterWorker)||void 0===t||t.removeEventListener("message",this.handleWorkerMessage),u.dataReporterWorker=void 0,this.visitorActivityStateManager.emptyState()}},{key:"pushActionItem",value:function(t,e){var r=this.visitorActivityStateManager.getPageVisitStateItems().map((function(t){return t.pageVisitItem.pageVisitDto}));e&&r.push(e),t.pageVisits=r,this.dataReporterService.pushData(jc.Action,t)}},{key:"pushTouchExpressionItem",value:function(t,e){var r=this.visitorActivityStateManager.getPageVisitStateItems().map((function(t){return t.pageVisitItem.pageVisitDto}));e&&r.push(e),t.touchExpression.pageVisits=r,this.dataReporterService.pushData(jc.TouchExpression,t)}},{key:"updatePagevisitGroup",value:function(){var t=this.getGroup(),e=t.status,r=t.length,n=t.lastSentTime,o=void 0===n?void 0:(new Date).getTime()-n;r<3||e!==lc.Closed&&(void 0===o||o>this.pageVisitSendInterval&&r>1)&&(this.visitorActivityStateManager.updatePageVisitGroup(Hs(Hs({},t),{},{status:lc.Closed})),this.pushPageVisitGroup(t))}},{key:"handlePageVisitStartDetected",value:function(t){var e=this.getGroup();this.visitorActivityStateManager.updatePageVisitGroup(Hs(Hs({},e),{},{status:lc.Closed})),this.pushPageVisitGroup(e,t)}},{key:"getGroup",value:function(){var t=this.visitorActivityStateManager.getPageVisitStateItems().filter((function(t){return!t.safeToDelete})),e=this.visitorActivityStateManager.getPageVisitGroup();return e||(e={firstPageVisitId:void 0,lastPageVisitId:void 0,status:lc.Open,length:0}),e.status===lc.Closed||(e.firstPageVisitId=t.length>0?t[0].pageVisitItem.pageVisitDto.id:void 0,e.lastPageVisitId=t.length>0?t[t.length-1].pageVisitItem.pageVisitDto.id:void 0,e.length=t.length),e}},{key:"handleTimerEvent",value:(i=qs(Ys().mark((function t(){return Ys().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getDataReporterWorker();case 2:this.updatePagevisitGroup();case 3:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"pushPageVisitGroup",value:function(t,e){var r=this.visitorActivityStateManager.getPageVisitStateItems(),n=[],o=r.findIndex((function(e){return e.pageVisitItem.pageVisitDto.id===t.firstPageVisitId})),i=r.findIndex((function(e){return e.pageVisitItem.pageVisitDto.id===t.lastPageVisitId}));if(-1!==o||-1!==i)for(var a=o;a<=i;a++)n.push(r[a].pageVisitItem);e&&n.push({pageVisitDto:e}),0!==n.length?this.dataReporterService.pushData(jc.PageVisits,n):console.warn("pageVisitItems.length === 0",{pageVisitGroup:t,pageVisitStartedDto:e})}},{key:"handlePageVisitGroupIsSent",value:function(t){var e=this,r=this.visitorActivityStateManager.getPageVisitStateItems();if(t.length>2)for(var n=function(){var n=t[o];r.find((function(t){return t.pageVisitItem.pageVisitDto.id===n.pageVisitDto.id}))&&e.visitorActivityStateManager.updatePageVisitStateItem({pageVisitItem:n,safeToDelete:!0})},o=0;o<t.length-2;o++)n();this.visitorActivityStateManager.updatePageVisitGroup({firstPageVisitId:void 0,lastPageVisitId:void 0,status:lc.Open,lastSentTime:(new Date).getTime(),length:0})}},{key:"getDataReporterWorker",value:(o=qs(Ys().mark((function t(){return Ys().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!u.dataReporterWorker){t.next=4;break}return t.abrupt("return",u.dataReporterWorker);case 4:return t.next=6,this.dataReporterRepository.getWorker();case 6:return u.dataReporterWorker=t.sent,u.dataReporterWorker.addEventListener("message",this.handleWorkerMessage),t.abrupt("return",u.dataReporterWorker);case 9:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"handleNetworkDataItemIsSent",value:function(t){var e=t.networkDataItemDto;if(t.isSent){var r=e.contentType,n=e.content;switch(r){case jc.Action:this.visitorActivityStateManager.updateActionStateItem({actionItem:n,safeToDelete:!0});break;case jc.TouchExpression:this.visitorActivityStateManager.updateTouchExpressionStateItem({touchExpressionItem:n,safeToDelete:!0});break;case jc.PageVisits:this.handlePageVisitGroupIsSent(n)}}}},{key:"handleWorkerMessage",value:function(t){t.data.type===Fs.NetworkDataItemIsSent&&this.handleNetworkDataItemIsSent(t.data.payload)}},{key:"loadState",value:function(){return{touchExpressionStateItems:Xu.getArray(this.STORAGE_TOUCH_EXPRESSIONS),actionStateItems:Xu.getArray(this.STORAGE_ACTIONS),pageVisitStateItems:Xu.getArray(this.STORAGE_PAGE_VISITS)}}},{key:"saveState",value:function(){var t=this.visitorActivityStateManager.getTouchExpressionStateItems().filter((function(t){return!t.safeToDelete}));Xu.setObject(this.STORAGE_TOUCH_EXPRESSIONS,t);var e=this.visitorActivityStateManager.getActionStateItems().filter((function(t){return!t.safeToDelete}));Xu.setObject(this.STORAGE_ACTIONS,e);var r=this.visitorActivityStateManager.getPageVisitStateItems().filter((function(t){return!t.safeToDelete}));Xu.setObject(this.STORAGE_PAGE_VISITS,r)}}],r&&Xs(e.prototype,r),n&&Xs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(Hu))||Gs)||Gs)||Gs)||Gs)||Gs)||Gs;function nl(t){return nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nl(t)}function ol(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ol=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==nl(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function il(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function al(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,cl(n.key),n)}}function cl(t){var e=function(t,e){if("object"!==nl(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==nl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===nl(e)?e:String(e)}var ul=L()(el=function(t,e){return _(vc)(t,void 0,0)}(el=Reflect.metadata("design:type",Function)(el=Reflect.metadata("design:paramtypes",["undefined"==typeof IDataReporterDataProvider?Object:IDataReporterDataProvider])(el=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.dataReporterDataProvider=e}var e,r,n,o,i;return e=t,r=[{key:"getWorker",value:(o=ol().mark((function t(){return ol().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.dataReporterDataProvider.getWorker();case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){il(i,r,n,a,c,"next",t)}function c(t){il(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})}],r&&al(e.prototype,r),n&&al(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||el)||el)||el)||el;var sl,ll,fl=function(t){return t.Percent="procent",t.Pixel="pixel",t}({}),pl=function(t){return t.Click="click",t.Scroll="scroll",t.Swipe="swipe",t}({}),hl=function(t){return t.Percent="Percent",t.Pixel="Pixel",t}({}),yl=function(t){return t.A="A",t.BUTTON="BUTTON",t.DIV="DIV",t.H1="H1",t.H2="H2",t.H3="H3",t.H4="H4",t.H5="H5",t.H6="H6",t.INPUT="INPUT",t.LI="LI",t.OL="OL",t.P="P",t.SPAN="SPAN",t.TABLE="TABLE",t.TD="TD",t.TH="TH",t.TR="TR",t.UL="UL",t}({}),vl=function(t){return t.PushTouchGroupComplete="PushTouchGroupComplete",t.TimerEvent="TimerEvent",t.PushScrollEventGroupComplete="PushScrollEventGroupComplete",t.ScrollEventGroupStart="ScrollEventGroupStart",t.TouchEventGroupStart="TouchEventGroupStart",t}({}),dl=function(t){return t.ExpresionDetected="ExpresionDetected",t.Loaded="Loaded",t.EmptyQueue="EmptyQueue",t}({});function ml(t){return ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ml(t)}function gl(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */gl=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==ml(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function bl(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function wl(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){bl(i,n,o,a,c,"next",t)}function c(t){bl(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Sl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,kl(n.key),n)}}function El(t,e){return El=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},El(t,e)}function Tl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ol(t);if(e){var o=Ol(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===ml(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Pl(t)}(this,r)}}function Pl(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ol(t){return Ol=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ol(t)}function Il(t,e,r){return(e=kl(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kl(t){var e=function(t,e){if("object"!==ml(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ml(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ml(e)?e:String(e)}var xl,jl=L()(sl=function(t,e){return _(Fi)(t,void 0,0)}(sl=function(t,e){return _(la)(t,void 0,1)}(sl=function(t,e){return _(Ui)(t,void 0,2)}(sl=function(t,e){return _(Ka)(t,void 0,3)}(sl=function(t,e){return _(Bi)(t,void 0,4)}(sl=Reflect.metadata("design:type",Function)(sl=Reflect.metadata("design:paramtypes",["undefined"==typeof ILibrarySessionRepository?Object:ILibrarySessionRepository,void 0===la?Object:la,"undefined"==typeof ITouchProcessorRepository?Object:ITouchProcessorRepository,"undefined"==typeof IVisitorActivityService?Object:IVisitorActivityService,"undefined"==typeof IPageVisitRepository?Object:IPageVisitRepository])((ll=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&El(t,e)}(u,t);var e,r,n,o,i,a,c=Tl(u);function u(t,e,r,n,o){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),Il(Pl(i=c.call(this)),"STORAGE_SWIPE_ITEMS_UNDER_TOUCH_START","swipeItemsUnderTouchStart"),Il(Pl(i),"trigerScrollActionWatcher",(function(t,e){t.triggerCount++,i.actionStateManager.updateActionWatcher(t.id,t);var r=i.getCurrentPageVisitDto();i.handleActionDetected({pageVisitId:r.id,deviceDocumentLoadTime:r.deviceDocumentLoadTime,timeStamp:e,actionTrackerDto:t.actionTrackerDto,librarySessionId:r.librarySessionId,pageVisits:[]})})),Il(Pl(i),"trigerClickActionWatcher",(function(t,e){t.triggerCount++,i.actionStateManager.updateActionWatcher(t.id,t);var r=i.getCurrentPageVisitDto();i.handleActionDetected({pageVisitId:r.id,deviceDocumentLoadTime:r.deviceDocumentLoadTime,timeStamp:e,actionTrackerDto:t.actionTrackerDto,librarySessionId:r.librarySessionId,pageVisits:[]})})),Il(Pl(i),"triggerSwipeActionWatcher",(function(t){var e=t.pageVisitId,r=t.deviceDocumentLoadTime,n=t.timeStamp,o=t.actionWatcherDto,a=t.librarySessionId,c=t.pageVisits;o.triggerCount++,i.actionStateManager.updateActionWatcher(o.id,o),i.handleActionDetected({pageVisitId:e,deviceDocumentLoadTime:r,timeStamp:n,actionTrackerDto:o.actionTrackerDto,librarySessionId:a,pageVisits:c})})),i.librarySessionRepository=t,i.actionStateManager=e,i.touchProcessorRepository=r,i.visitorActivityService=n,i.pageVisitRepository=o,i.handleWorkerMessage=i.handleWorkerMessage.bind(Pl(i)),i.handleClickEvent=i.handleClickEvent.bind(Pl(i)),i.handleTouchStartEvent=i.handleTouchStartEvent.bind(Pl(i)),i}return e=u,r=[{key:"load",value:(a=wl(gl().mark((function t(){var e,r,n,o=this;return gl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.librarySessionRepository.isTouchDevice()){t.next=3;break}return t.next=3,this.getTouchProcessorWorker();case 3:e=this.loadState(),r=e.swipeItemsUnderTouchStart,n=e.actionTrackers,r.forEach((function(t){o.actionStateManager.addSwipeItemsUnderTouchStart(t)})),n.forEach((function(t){o.installActionTracker(t)}));case 6:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"unload",value:function(){var t,e=this;this.saveState(),u.actionWatcherSerialId=0,this.librarySessionRepository.isTouchDevice()&&(null===(t=u.touchProcessorWorker)||void 0===t||t.removeEventListener("message",this.handleWorkerMessage),u.touchProcessorWorker=void 0),u.clickWatcherItems.forEach((function(t){t.element.removeEventListener("click",e.handleClickEvent)})),u.clickWatcherItems=[],u.swipeWatcherItems.forEach((function(t){t.element.removeEventListener("touchstart",e.handleTouchStartEvent)})),u.swipeWatcherItems=[],this.actionStateManager.emptyState()}},{key:"handleScrollEventDto",value:function(t){var e=this,r=this.actionStateManager.getActionWatchers().filter((function(t){return t.actionTrackerDto.actionTrackerType===Ji.Scroll&&0===t.triggerCount}));if(0!==r.length){var n=t.scrollPosition,o=t.timeStamp,i=r.filter((function(t){return e.checkIfScrollWatcherConditionIsMet(t,n)}));i.forEach((function(t){return e.trigerScrollActionWatcher(t,o)}))}}},{key:"handleTimerEvent",value:(i=wl(gl().mark((function t(){return gl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.librarySessionRepository.isTouchDevice()){t.next=3;break}return t.next=3,this.getTouchProcessorWorker();case 3:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"getTouchProcessorWorker",value:(o=wl(gl().mark((function t(){return gl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!u.touchProcessorWorker){t.next=4;break}return t.abrupt("return",u.touchProcessorWorker);case 4:return t.next=6,this.touchProcessorRepository.getWorker();case 6:return u.touchProcessorWorker=t.sent,u.touchProcessorWorker.addEventListener("message",this.handleWorkerMessage),t.abrupt("return",u.touchProcessorWorker);case 9:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"getCurrentPageVisitDto",value:function(){var t=this.pageVisitRepository.getCurrentPageVisitDto();if(!t)throw new Error("Page visit not found");return t}},{key:"handleTouchStartEvent",value:function(t){var e=this.getCurrentPageVisitDto(),r=t,n=u.swipeWatcherItems.find((function(e){return e.element===t.target}));n&&this.actionStateManager.addSwipeItemsUnderTouchStart({actionWatcherDtoId:n.actionWatcherDto.id,pageVisitId:e.id,deviceDocumentLoadTime:e.deviceDocumentLoadTime,touchStartTimestamp:r.timeStamp,localTime:e.deviceDocumentLoadTime+r.timeStamp,safeToDelete:!1,actionWatcherDto:n.actionWatcherDto})}},{key:"handleClickEvent",value:function(t){var e=u.clickWatcherItems.find((function(e){return e.element===t.target}));e&&this.trigerClickActionWatcher(e.actionWatcherDto,t.timeStamp)}},{key:"checkIfEmpulseIsSwipe",value:function(t){return t.angle>160&&t.angle<200||t.angle>340||t.angle<20}},{key:"handleSwipeEvent",value:function(t){var e=this,r=t.empulses.filter((function(t){return t.geometryAnalysis.type===uo.Line&&void 0!==t.geometryAnalysis.line&&e.checkIfEmpulseIsSwipe(t.geometryAnalysis.line)}));r.length&&this.actionStateManager.getSwipeItemsUnderTouchStart().forEach((function(n){r.forEach((function(r){n.touchStartTimestamp===r.touchEvents[0].timeStamp&&n.pageVisitId===t.pageVisitId&&n.deviceDocumentLoadTime===t.deviceDocumentLoadTime&&e.triggerSwipeActionWatcher({pageVisitId:n.pageVisitId,deviceDocumentLoadTime:n.deviceDocumentLoadTime,timeStamp:r.touchEvents[0].timeStamp,actionWatcherDto:n.actionWatcherDto,librarySessionId:t.librarySessionId,pageVisits:[]})}))}))}},{key:"handleSafeToDelete",value:function(t){var e=this;this.actionStateManager.getSwipeItemsUnderTouchStart().filter((function(t){return!t.safeToDelete})).forEach((function(r){r.deviceDocumentLoadTime<t&&e.actionStateManager.updateSwipeItemsUnderTouchStartSafeToDelete({actionWatcherDtoId:r.actionWatcherDtoId,pageVisitId:r.pageVisitId,deviceDocumentLoadTime:r.deviceDocumentLoadTime,touchStartTimestamp:r.touchStartTimestamp,safeToDelete:!0})}))}},{key:"handleExpresionDetected",value:function(t){var e=this;t.forEach((function(t){e.handleSwipeEvent(t),e.handleSafeToDelete(t.deviceDocumentLoadTime)}))}},{key:"handleEmptyQueue",value:function(){var t=this.getCurrentPageVisitDto();this.handleSafeToDelete(t.deviceDocumentLoadTime)}},{key:"handleWorkerMessage",value:function(t){switch(t.data.type){case dl.ExpresionDetected:this.handleExpresionDetected(t.data.payload.touchExpressionDtos);break;case dl.EmptyQueue:this.handleEmptyQueue()}}},{key:"loadState",value:function(){return{swipeItemsUnderTouchStart:Xu.getArray(this.STORAGE_SWIPE_ITEMS_UNDER_TOUCH_START),actionTrackers:this.storageLoadCurrentActionTrackers()}}},{key:"saveState",value:function(){if(this.touchProcessorRepository.getIsRunning()){var t=this.actionStateManager.getSwipeItemsUnderTouchStart().filter((function(t){return!t.safeToDelete}));Xu.setObject(this.STORAGE_SWIPE_ITEMS_UNDER_TOUCH_START,t)}}},{key:"storageLoadCurrentActionTrackers",value:function(){var t=this,e=[],r=this.librarySessionRepository.getActionTracker();return r&&r.actionTrackers.length&&r.actionTrackers.forEach((function(r){e.push(t.fromActionTrackerModel(r))})),e}},{key:"checkIfScrollWatcherConditionIsMet",value:function(t,e){switch(t.actionTrackerDto.actionTrackerDefinition.unit){case hl.Percent:return e.percent>=t.actionTrackerDto.actionTrackerDefinition.scrollDepth;case hl.Pixel:return e.pixel>=t.actionTrackerDto.actionTrackerDefinition.scrollDepth}return!1}},{key:"handleActionDetected",value:function(t){var e=this.getCurrentPageVisitDto();this.visitorActivityService.pushActionItem(t,e)}},{key:"installActionClick",value:function(t){var e=this,r=t.toDto();ns.getElementsFromTrackerDefinition(r.actionTrackerDefinition).forEach((function(t){var n="".concat(u.actionWatcherSerialId++),o={id:n,actionTrackerDto:r,triggerCount:0};u.clickWatcherItems.push({id:n,element:t,actionWatcherDto:o}),t.addEventListener("click",e.handleClickEvent),e.actionStateManager.addActionWatcher(o)}))}},{key:"installActionScroll",value:function(t){var e={id:"".concat(u.actionWatcherSerialId++),actionTrackerDto:t.toDto(),triggerCount:0};this.actionStateManager.addActionWatcher(e)}},{key:"installActionSwipe",value:function(t){var e=this,r=t.toDto();ns.getElementsFromTrackerDefinition(r.actionTrackerDefinition).forEach((function(t){var n="".concat(u.actionWatcherSerialId++),o={id:n,actionTrackerDto:r,triggerCount:0};u.swipeWatcherItems.push({id:n,element:t,actionWatcherDto:o}),t.addEventListener("touchstart",e.handleTouchStartEvent),e.actionStateManager.addActionWatcher(o)}))}},{key:"installActionTracker",value:function(t){switch(t.toDto().actionTrackerType){case Ji.Scroll:this.installActionScroll(t);break;case Ji.Click:this.installActionClick(t);break;case Ji.Swipe:this.installActionSwipe(t)}}},{key:"fromActionTrackerModel",value:function(t){var e,r=t.actionType,n=t.actionValue,o=this.fromActionTrackerModelType(r);switch(o){case Ji.Scroll:e={unit:this.fromActionTrackerModelValueScrollUnit(n.unit),scrollDepth:n.scrollDepth};break;case Ji.Click:case Ji.Swipe:if(n.xpath)e={xpath:n.xpath};else{if(!n.tagName)throw new Error("Action value not found");e={tagName:n.tagName,attributeValue:n.attributeValue,attributeName:n.attributeName}}}if(!e)throw new Error("Action value not found");var i={id:t.actionId,actionTrackerType:o,actionTrackerDefinition:e};return new ma(i)}},{key:"fromActionTrackerModelType",value:function(t){switch(t){case pl.Scroll:return Ji.Scroll;case pl.Click:return Ji.Click;case pl.Swipe:return Ji.Swipe;default:throw new Error("Action type not found")}}},{key:"fromActionTrackerModelValueScrollUnit",value:function(t){switch(t){case fl.Percent:return hl.Percent;case fl.Pixel:return hl.Pixel;default:throw new Error("Action value scroll unit not found")}}}],r&&Sl(e.prototype,r),n&&Sl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(Hu),Il(ll,"actionWatcherSerialId",0),Il(ll,"clickWatcherItems",[]),Il(ll,"swipeWatcherItems",[]),sl=ll))||sl)||sl)||sl)||sl)||sl)||sl)||sl)||sl;function _l(t){return _l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_l(t)}function Ll(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Al(n.key),n)}}function Al(t){var e=function(t,e){if("object"!==_l(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==_l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===_l(e)?e:String(e)}var Rl,Dl=L()(xl=function(t,e){return _(hn)(t,void 0,0)}(xl=Reflect.metadata("design:type",Function)(xl=Reflect.metadata("design:paramtypes",["undefined"==typeof ILibrarySessionDataProvider?Object:ILibrarySessionDataProvider])(xl=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.librarySessionDataProvider=e}var e,r,n;return e=t,(r=[{key:"isTouchDevice",value:function(){return this.librarySessionDataProvider.isTouchDevice()}},{key:"getActionTracker",value:function(){return this.librarySessionDataProvider.getActionTracker()}}])&&Ll(e.prototype,r),n&&Ll(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||xl)||xl)||xl)||xl;function Cl(t){return Cl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cl(t)}function Nl(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Nl=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Cl(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Ml(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Vl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Gl(n.key),n)}}function Gl(t){var e=function(t,e){if("object"!==Cl(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Cl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Cl(e)?e:String(e)}var Wl,Fl=L()(Rl=function(t,e){return _(Bn)(t,void 0,0)}(Rl=Reflect.metadata("design:type",Function)(Rl=Reflect.metadata("design:paramtypes",["undefined"==typeof ITouchProcessorDataProvider?Object:ITouchProcessorDataProvider])(Rl=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.touchProcessorDataProvider=e}var e,r,n,o,i;return e=t,r=[{key:"getWorker",value:(o=Nl().mark((function t(){return Nl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.touchProcessorDataProvider.getWorker();case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){Ml(i,r,n,a,c,"next",t)}function c(t){Ml(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"getIsRunning",value:function(){return this.touchProcessorDataProvider.getIsRunning()}}],r&&Vl(e.prototype,r),n&&Vl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Rl)||Rl)||Rl)||Rl;function Ul(t){return Ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ul(t)}function Bl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Hl(n.key),n)}}function Hl(t){var e=function(t,e){if("object"!==Ul(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ul(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ul(e)?e:String(e)}var Yl,zl=L()(Wl=function(t,e){return _(vi)(t,void 0,0)}(Wl=Reflect.metadata("design:type",Function)(Wl=Reflect.metadata("design:paramtypes",["undefined"==typeof IPageVisitDataProvider?Object:IPageVisitDataProvider])(Wl=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pageVisitDataProvider=e}var e,r,n;return e=t,(r=[{key:"getCurrentPageVisitDto",value:function(){return this.pageVisitDataProvider.getCurrentPageVisit()}}])&&Bl(e.prototype,r),n&&Bl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Wl)||Wl)||Wl)||Wl;function ql(t){return ql="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ql(t)}function Xl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ql(n.key),n)}}function Ql(t){var e=function(t,e){if("object"!==ql(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ql(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ql(e)?e:String(e)}var Kl,Jl,$l=L()(Yl=function(t,e){return _(hn)(t,void 0,0)}(Yl=Reflect.metadata("design:type",Function)(Yl=Reflect.metadata("design:paramtypes",["undefined"==typeof ILibrarySessionDataProvider?Object:ILibrarySessionDataProvider])(Yl=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.librarySessionDataProvider=e}var e,r,n;return e=t,(r=[{key:"isTouchDevice",value:function(){return this.librarySessionDataProvider.isTouchDevice()}}])&&Xl(e.prototype,r),n&&Xl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Yl)||Yl)||Yl)||Yl,Zl=r(595),tf=r.n(Zl);function ef(t){return ef="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ef(t)}function rf(t){return function(t){if(Array.isArray(t))return nf(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return nf(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nf(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nf(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function of(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function af(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?of(Object(r),!0).forEach((function(e){vf(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):of(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function cf(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */cf=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==ef(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function uf(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function sf(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){uf(i,n,o,a,c,"next",t)}function c(t){uf(i,n,o,a,c,"throw",t)}a(void 0)}))}}function lf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,df(n.key),n)}}function ff(t,e){return ff=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ff(t,e)}function pf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=yf(t);if(e){var o=yf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===ef(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return hf(t)}(this,r)}}function hf(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yf(t){return yf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yf(t)}function vf(t,e,r){return(e=df(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function df(t){var e=function(t,e){if("object"!==ef(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ef(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ef(e)?e:String(e)}var mf,gf=L()(Kl=function(t,e){return _(Po)(t,void 0,0)}(Kl=function(t,e){return _(Hn)(t,void 0,1)}(Kl=function(t,e){return _(Ka)(t,void 0,2)}(Kl=function(t,e){return _($c)(t,void 0,3)}(Kl=function(t,e){return _(Yn)(t,void 0,4)}(Kl=function(t,e){return _(Io)(t,void 0,5)}(Kl=function(t,e){return _(zn)(t,void 0,6)}(Kl=function(t,e){return _(R)(t,void 0,7)}(Kl=function(t,e){return _(qn)(t,void 0,8)}(Kl=function(t,e){return _(Xn)(t,void 0,9)}(Kl=function(t,e){return _(hi)(t,void 0,10)}(Kl=Reflect.metadata("design:type",Function)(Kl=Reflect.metadata("design:paramtypes",[void 0===Po?Object:Po,"undefined"==typeof ILibrarySessionRepository?Object:ILibrarySessionRepository,"undefined"==typeof IVisitorActivityService?Object:IVisitorActivityService,"undefined"==typeof IContentService?Object:IContentService,"undefined"==typeof IContentRepository?Object:IContentRepository,"undefined"==typeof IIphoneCompatibilityService?Object:IIphoneCompatibilityService,"undefined"==typeof IIphoneCompatibilityRepository?Object:IIphoneCompatibilityRepository,"undefined"==typeof IVisitorService?Object:IVisitorService,"undefined"==typeof IVisitorRepository?Object:IVisitorRepository,"undefined"==typeof IPageVisitRepository?Object:IPageVisitRepository,"undefined"==typeof IPageVisitService?Object:IPageVisitService])((Jl=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ff(t,e)}(h,t);var e,r,n,o,i,a,c,u,s,l,f,p=pf(h);function h(t,e,r,n,o,i,a,c,u,s,l){var f;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),vf(hf(f=p.call(this)),"STORAGE_TOUCH_EVENT_GROUPS","touchEventGroups"),f.touchProcessorStateManager=t,f.librarySessionRepository=e,f.visitorActivityService=r,f.contentService=n,f.contentRepository=o,f.iphoneCompatibilityService=i,f.iphoneCompatibilityRepository=a,f.visitorService=c,f.visitorRepository=u,f.pageVisitRepository=s,f.pageVisitService=l,f.handleWorkerMessage=f.handleWorkerMessage.bind(hf(f)),f}return e=h,r=[{key:"load",value:(f=sf(cf().mark((function t(){var e,r=this;return cf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.librarySessionRepository.isTouchDevice()){t.next=8;break}return t.next=3,this.getWorker();case 3:e=t.sent,this.contentService.updateTouchProcessorRunningState(!0),this.iphoneCompatibilityService.updateTouchProcessorRunningState(!0),this.loadState().touchEventGroupItems.forEach((function(t){r.touchProcessorStateManager.pushTouchEventGroup({touchEventGroupDto:t.touchEventGroupDto,pageVisitId:t.pageVisitId,librarySessionId:t.librarySessionId,pageMaxHeight:t.pageMaxHeight,pageMaxWidth:t.pageMaxWidth,screenRatio:t.screenRatio,pageId:t.pageId,deviceDocumentLoadTime:t.deviceDocumentLoadTime});var n={type:vl.PushTouchGroupComplete,payload:{touchEventGroupDto:t.touchEventGroupDto,pageVisitId:t.pageVisitId,librarySessionId:t.librarySessionId,pageMaxHeight:t.pageMaxHeight,pageMaxWidth:t.pageMaxWidth,screenRatio:t.screenRatio,pageId:t.pageId,deviceDocumentLoadTime:t.deviceDocumentLoadTime}};e.postMessage(n)}));case 8:case"end":return t.stop()}}),t,this)}))),function(){return f.apply(this,arguments)})},{key:"unload",value:function(){var t,e;this.saveState(),null===(t=h.worker)||void 0===t||t.removeEventListener("message",this.handleWorkerMessage),null===(e=h.worker)||void 0===e||e.terminate(),this.contentService.updateTouchProcessorRunningState(!1),this.iphoneCompatibilityService.updateTouchProcessorRunningState(!1),h.worker=void 0,h.touchEventTouchSerialId=0,h.touchEventSerialId=0,h.touchEventGroupDtos=[],h.isRunning=!1,this.touchProcessorStateManager.emptyState(),h.workerLoadingSatus=void 0}},{key:"handleTouchEvent",value:function(t){var e=this.fromTouchEvent(t);this.pushToGroup(e,t)}},{key:"handleTimerEvent",value:(l=sf(cf().mark((function t(){var e,r;return cf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.internalMemoryCleanUp(),!this.librarySessionRepository.isTouchDevice()){t.next=7;break}return t.next=4,this.getWorker();case 4:e=t.sent,r={type:vl.TimerEvent,payload:void 0},e.postMessage(r);case 7:case"end":return t.stop()}}),t,this)}))),function(){return l.apply(this,arguments)})},{key:"handleScrollEventGroupComplete",value:(s=sf(cf().mark((function t(e,r,n){var o,i,a;return cf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=void 0,this.iphoneCompatibilityRepository.getIphoneCompatibilityStrategyActive(jo.EstimateNumberOfEmpulses)&&(o=e),!this.librarySessionRepository.isTouchDevice()){t.next=9;break}return t.next=6,this.getWorker();case 6:i=t.sent,a={type:vl.PushScrollEventGroupComplete,payload:{scrollEventGroupId:e.id,scrollEventGroupStartTimestamp:e.scrollEvents[0].timeStamp,scrollEventGroupEndTimestamp:e.scrollEvents[e.scrollEvents.length-1].timeStamp,pageVisitId:r,deviceDocumentLoadTime:n,scrollEventGroupDto:o}},i.postMessage(a);case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return s.apply(this,arguments)})},{key:"handleScrollEventGroupStart",value:(u=sf(cf().mark((function t(e,r,n){var o,i;return cf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.librarySessionRepository.isTouchDevice()){t.next=6;break}return t.next=3,this.getWorker();case 3:o=t.sent,i={type:vl.ScrollEventGroupStart,payload:{scrollEventGroupDto:e,pageVisitId:r,deviceDocumentLoadTime:n}},o.postMessage(i);case 6:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return u.apply(this,arguments)})},{key:"getWorker",value:(c=sf(cf().mark((function t(){return cf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.librarySessionRepository.isTouchDevice(),this.librarySessionRepository.isTouchDevice()){t.next=3;break}throw new Error("Touch device not found");case 3:if(!h.worker){t.next=7;break}return t.abrupt("return",h.worker);case 7:return t.next=9,this.loadWorker();case 9:if(h.worker){t.next=11;break}throw new Error("Worker not found");case 11:return t.abrupt("return",h.worker);case 12:case"end":return t.stop()}}),t,this)}))),function(){return c.apply(this,arguments)})},{key:"getIsRunning",value:function(){return h.isRunning}},{key:"getCurrentPageVisitDto",value:function(){var t=this.pageVisitRepository.getCurrentPageVisitDto();if(!t)throw new Error("Page visit not found");return t}},{key:"loadWorker",value:(a=sf(cf().mark((function t(){var e=this;return cf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t){if("loaded"===h.workerLoadingSatus&&t(void 0),"error"===h.workerLoadingSatus)throw new Error("Worker loading error");"loading"===h.workerLoadingSatus&&setTimeout((function(){if("loaded"===h.workerLoadingSatus&&t(void 0),"error"===h.workerLoadingSatus)throw new Error("Worker loading error")}),1e3),void 0===h.workerLoadingSatus&&(h.workerLoadingSatus="loading",fetch(tf()).then((function(t){return t.text()})).then((function(r){var n=new Blob([r],{type:"application/javascript"});h.worker=new Worker(URL.createObjectURL(n)),h.worker.addEventListener("message",e.handleWorkerMessage),h.worker.addEventListener("message",(function(e){e.data.type===dl.Loaded&&(h.isRunning=!0,t(void 0))}))})))}));case 2:case"end":return t.stop()}}),t)}))),function(){return a.apply(this,arguments)})},{key:"loadState",value:function(){return{touchEventGroupItems:Xu.getArray(this.STORAGE_TOUCH_EVENT_GROUPS)}}},{key:"saveState",value:function(){var t=this.touchProcessorStateManager.getTouchEventGroupItems().filter((function(t){return!t.safeToDelete}));Xu.setObject(this.STORAGE_TOUCH_EVENT_GROUPS,t)}},{key:"internalMemoryCleanUp",value:function(){h.touchEventGroupDtos.length>3&&h.touchEventGroupDtos.splice(0,h.touchEventGroupDtos.length-3)}},{key:"handleTouchGroupComplete",value:(i=sf(cf().mark((function t(e){var r,n,o,i,a,c,u;return cf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getWorker();case 2:if(r=t.sent,n=h.touchEventGroupDtos.find((function(t){return t.id===e}))){t.next=6;break}throw new Error("Touch event group not found");case 6:if(o=this.getCurrentPageVisitDto(),i=this.visitorRepository.getPageMaxHeight()){t.next=10;break}throw new Error("Page max height not found");case 10:if(a=this.visitorRepository.getPageMaxWidth()){t.next=13;break}throw new Error("Page max width not found");case 13:if(c=this.visitorRepository.getScreenRatio()){t.next=16;break}throw new Error("Screen ratio not found");case 16:this.touchProcessorStateManager.pushTouchEventGroup({touchEventGroupDto:n,pageVisitId:o.id,librarySessionId:o.librarySessionId,pageMaxHeight:i,pageMaxWidth:a,screenRatio:c,pageId:o.pageId,deviceDocumentLoadTime:o.deviceDocumentLoadTime}),u={type:vl.PushTouchGroupComplete,payload:{touchEventGroupDto:n,pageVisitId:o.id,librarySessionId:o.librarySessionId,pageMaxHeight:i,pageMaxWidth:a,screenRatio:c,pageId:o.pageId,deviceDocumentLoadTime:o.deviceDocumentLoadTime}},r.postMessage(u);case 19:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"handleTouchEventGroupStart",value:(o=sf(cf().mark((function t(e,r){var n,o,i,a,c,u;return cf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.visitorRepository.getNormlizedPagePositionForTouchEvent(r),o=af(af({},e),{},{touches:e.touches.map((function(t){return af(af({},t),{},{pageXNormalized:null==n?void 0:n.pageXNormalized,pageYNormalized:null==n?void 0:n.pageYNormalized})}))}),t.next=4,this.getWorker();case 4:i=t.sent,a={id:"".concat(h.touchEventGroupSerialId++),touchEvents:[o]},h.touchEventGroupDtos.push(a),c=this.getCurrentPageVisitDto(),u={type:vl.TouchEventGroupStart,payload:{touchEventGroupDto:a,pageVisitDto:c}},i.postMessage(u),this.contentService.handleTouchEventGroupStart(a);case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return o.apply(this,arguments)})},{key:"handleSafeToDelete",value:function(t){var e=this,r=[],n=this.touchProcessorStateManager.getTouchEventGroupItems();t.forEach((function(t){t.empulses.forEach((function(e){n.filter((function(t){return!t.safeToDelete})).forEach((function(n){var o=n.pageVisitId===t.pageVisitId,i=n.deviceDocumentLoadTime===t.deviceDocumentLoadTime,a=n.touchEventGroupDto.touchEvents.length===e.touchEvents.length,c=n.touchEventGroupDto.touchEvents[0].timeStamp===e.touchEvents[0].timeStamp,u=n.touchEventGroupDto.touchEvents[n.touchEventGroupDto.touchEvents.length-1].timeStamp===e.touchEvents[e.touchEvents.length-1].timeStamp;o&&i&&a&&c&&u&&r.push(n.touchEventGroupDto.id)}))}))})),r.forEach((function(t){e.touchProcessorStateManager.updateSafeToDelete({touchEventGroupDtoId:t,safeToDelete:!0})}))}},{key:"handleExpresionDetected",value:function(t){var e=this;t.forEach((function(t){var r=e.visitorService.normalizeCalibrateTouchExpression(t),n=e.contentRepository.getTouchExpressionContent(r),o=n.images,i=n.texts;e.contentService.handleTouchExpressionDetected(r),e.iphoneCompatibilityService.handleTouchExpressionDetected(r);var a=e.visitorRepository.getVisitor();if(!a)throw new Error("Visitor not found");var c=e.getCurrentPageVisitDto(),u=e.visitorRepository.getDebugInfo();e.visitorActivityService.pushTouchExpressionItem({touchExpression:af(af({},r),{},{images:o,texts:i,pageVisits:[],visitorId:a.id,applicationId:a.applicationId,version:"22",debugInfo:rf(u)})},c)})),this.handleSafeToDelete(t),this.pageVisitService.handleExpresionDetected(t)}},{key:"handleWorkerMessage",value:function(t){t.data.type===dl.ExpresionDetected&&this.handleExpresionDetected(t.data.payload.touchExpressionDtos)}},{key:"pushToLastGroup",value:function(t){var e=h.touchEventGroupDtos[h.touchEventGroupDtos.length-1];e?e.touchEvents.push(t):console.error("No touch event group")}},{key:"pushToGroup",value:function(t,e){switch(t.type){case so.TouchStart:this.handleTouchEventGroupStart(t,e);break;case so.TouchMove:this.pushToLastGroup(t);break;case so.TouchEnd:this.pushToLastGroup(t),h.touchEventGroupDtos.length>0&&this.handleTouchGroupComplete(h.touchEventGroupDtos[h.touchEventGroupDtos.length-1].id);break;default:throw new Error("Unknown touch event type: ".concat(t.type))}}},{key:"fromTouchEventType",value:function(t){switch(t){case"touchstart":return so.TouchStart;case"touchmove":return so.TouchMove;case"touchend":return so.TouchEnd;default:throw new Error("Unknown touch event type: ".concat(t))}}},{key:"fromTouchEvent",value:function(t){for(var e=[],r=0;r<t.touches.length;r++){var n=t.touches.item(r);n&&e.push({id:"".concat(h.touchEventTouchSerialId++),identifier:n.identifier,pageX:n.pageX,pageY:n.pageY,clientX:n.clientX,clientY:n.clientY,screenX:n.screenX,screenY:n.screenY,radiusX:n.radiusX,radiusY:n.radiusY,force:n.force})}return{id:"".concat(h.touchEventSerialId++),type:this.fromTouchEventType(t.type),timeStamp:t.timeStamp,touches:e}}}],r&&lf(e.prototype,r),n&&lf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),h}(Hu),vf(Jl,"touchEventTouchSerialId",0),vf(Jl,"touchEventSerialId",0),vf(Jl,"touchEventGroupSerialId",0),vf(Jl,"touchEventGroupDtos",[]),vf(Jl,"isRunning",!1),vf(Jl,"workerLoadingSatus",void 0),Kl=Jl))||Kl)||Kl)||Kl)||Kl)||Kl)||Kl)||Kl)||Kl)||Kl)||Kl)||Kl)||Kl)||Kl)||Kl;function bf(t){return bf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bf(t)}function wf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Sf(n.key),n)}}function Sf(t){var e=function(t,e){if("object"!==bf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==bf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===bf(e)?e:String(e)}var Ef,Tf=L()(mf=function(t,e){return _(tu)(t,void 0,0)}(mf=Reflect.metadata("design:type",Function)(mf=Reflect.metadata("design:paramtypes",["undefined"==typeof IContentDataProvider?Object:IContentDataProvider])(mf=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.contentDataProvider=e}var e,r,n;return e=t,(r=[{key:"getTouchExpressionContent",value:function(t){return this.contentDataProvider.getTouchExpressionContent(t)}}])&&wf(e.prototype,r),n&&wf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||mf)||mf)||mf)||mf;function Pf(t){return Pf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pf(t)}function Of(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,If(n.key),n)}}function If(t){var e=function(t,e){if("object"!==Pf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Pf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Pf(e)?e:String(e)}var kf,xf=L()(Ef=function(t,e){return _(xo)(t,void 0,0)}(Ef=Reflect.metadata("design:type",Function)(Ef=Reflect.metadata("design:paramtypes",["undefined"==typeof IIphoneCompatibilityDataProvider?Object:IIphoneCompatibilityDataProvider])(Ef=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.iphoneCompatibilityDataProvider=e}var e,r,n;return e=t,(r=[{key:"getIphoneCompatibilityStrategyActive",value:function(t){return this.iphoneCompatibilityDataProvider.getIphoneCompatibilityStrategyActive(t)}}])&&Of(e.prototype,r),n&&Of(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Ef)||Ef)||Ef)||Ef;function jf(t){return jf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jf(t)}function _f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Lf(n.key),n)}}function Lf(t){var e=function(t,e){if("object"!==jf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===jf(e)?e:String(e)}var Af,Rf=L()(kf=function(t,e){return _(C)(t,void 0,0)}(kf=Reflect.metadata("design:type",Function)(kf=Reflect.metadata("design:paramtypes",["undefined"==typeof IVisitorDataProvider?Object:IVisitorDataProvider])(kf=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.visitorDataProvider=e}var e,r,n;return e=t,(r=[{key:"getPageMaxHeight",value:function(){return this.visitorDataProvider.getPageMaxHeight()}},{key:"getPageMaxWidth",value:function(){return this.visitorDataProvider.getPageMaxWidth()}},{key:"getScreenRatio",value:function(){return this.visitorDataProvider.getScreenRatio()}},{key:"getDebugInfo",value:function(){return this.visitorDataProvider.getDebugInfo()}},{key:"getVisitor",value:function(){return this.visitorDataProvider.getVisitor()}},{key:"getNormlizedPagePositionForTouchEvent",value:function(t){return this.visitorDataProvider.getNormlizedPagePositionForTouchEvent(t)}}])&&_f(e.prototype,r),n&&_f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||kf)||kf)||kf)||kf;function Df(t){return Df="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Df(t)}function Cf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Nf(n.key),n)}}function Nf(t){var e=function(t,e){if("object"!==Df(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Df(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Df(e)?e:String(e)}var Mf,Vf=L()(Af=function(t,e){return _(vi)(t,void 0,0)}(Af=Reflect.metadata("design:type",Function)(Af=Reflect.metadata("design:paramtypes",["undefined"==typeof IPageVisitDataProvider?Object:IPageVisitDataProvider])(Af=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pageVisitDataProvider=e}var e,r,n;return e=t,(r=[{key:"getCurrentPageVisitDto",value:function(){return this.pageVisitDataProvider.getCurrentPageVisit()}}])&&Cf(e.prototype,r),n&&Cf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Af)||Af)||Af)||Af;function Gf(t){return Gf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gf(t)}function Wf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ff(n.key),n)}}function Ff(t){var e=function(t,e){if("object"!==Gf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Gf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Gf(e)?e:String(e)}var Uf,Bf,Hf=L()(Mf=function(t,e){return _(hn)(t,void 0,0)}(Mf=Reflect.metadata("design:type",Function)(Mf=Reflect.metadata("design:paramtypes",["undefined"==typeof ILibrarySessionDataProvider?Object:ILibrarySessionDataProvider])(Mf=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.librarySessionDataProvider=e}var e,r,n;return e=t,(r=[{key:"isTouchDevice",value:function(){return this.librarySessionDataProvider.isTouchDevice()}}])&&Wf(e.prototype,r),n&&Wf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Mf)||Mf)||Mf)||Mf;function Yf(t){return Yf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yf(t)}function zf(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */zf=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Yf(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function qf(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Xf(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){qf(i,n,o,a,c,"next",t)}function c(t){qf(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Qf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ep(n.key),n)}}function Kf(t,e){return Kf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Kf(t,e)}function Jf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Zf(t);if(e){var o=Zf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===Yf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return $f(t)}(this,r)}}function $f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Zf(t){return Zf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zf(t)}function tp(t,e,r){return(e=ep(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ep(t){var e=function(t,e){if("object"!==Yf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Yf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Yf(e)?e:String(e)}var rp,np=L()(Uf=function(t,e){return _(Ma)(t,void 0,0)}(Uf=function(t,e){return _(Sa)(t,void 0,1)}(Uf=function(t,e){return _(Ea)(t,void 0,2)}(Uf=function(t,e){return _(Wi)(t,void 0,3)}(Uf=function(t,e){return _(Ta)(t,void 0,4)}(Uf=Reflect.metadata("design:type",Function)(Uf=Reflect.metadata("design:paramtypes",[void 0===Ma?Object:Ma,"undefined"==typeof ILibrarySessionRepository?Object:ILibrarySessionRepository,"undefined"==typeof ITouchProcessorRepository?Object:ITouchProcessorRepository,"undefined"==typeof IActionService?Object:IActionService,"undefined"==typeof IPageVisitRepository?Object:IPageVisitRepository])((Bf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Kf(t,e)}(u,t);var e,r,n,o,i,a,c=Jf(u);function u(t,e,r,n,o){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),tp($f(i=c.call(this)),"STORAGE_SCROLL_EVENT_GROUPS","scrollEventGroups"),tp($f(i),"scrollEventMaxGapMs",300),i.scrollProcessorStateManager=t,i.librarySessionRepository=e,i.touchProcessorRepository=r,i.actionService=n,i.pageVisitRepository=o,i.handleWorkerMessage=i.handleWorkerMessage.bind($f(i)),i}return e=u,r=[{key:"load",value:(a=Xf(zf().mark((function t(){var e=this;return zf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.librarySessionRepository.isTouchDevice()){t.next=3;break}return t.next=3,this.getTouchProcessorWorker();case 3:this.loadState().scrollProcessorStateItems.forEach((function(t){e.scrollProcessorStateManager.pushScrollEventGroup({pageVisitId:t.pageVisitId,deviceDocumentLoadTime:t.deviceDocumentLoadTime,safeToDelete:t.safeToDelete,scrollEventGroupDto:t.scrollEventGroupDto}),e.touchProcessorRepository.handleScrollEventGroupComplete(t.scrollEventGroupDto,t.pageVisitId,t.deviceDocumentLoadTime)}));case 5:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"unload",value:function(){var t;this.saveState(),this.librarySessionRepository.isTouchDevice()&&(null===(t=u.touchProcessorWorker)||void 0===t||t.removeEventListener("message",this.handleWorkerMessage),u.touchProcessorWorker=void 0),u.scrollEventSerialId=0,u.scrollEventGroupSerialId=0,u.scrollEventGroups=[],u.handledScrollEventGroupIds=[],this.scrollProcessorStateManager.emptyState()}},{key:"handleScrollEvent",value:function(t){var e=this.getScrollPosition(),r=this.fromScrollEvent(t,e);this.actionService.handleScrollEventDto(r),this.pushToGroup(r)}},{key:"handleTimerEvent",value:(i=Xf(zf().mark((function t(){return zf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.librarySessionRepository.isTouchDevice()){t.next=3;break}return t.next=3,this.getTouchProcessorWorker();case 3:this.analyzeScrollEventGroups(),this.internalMemoryCleanUp();case 5:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"getCurrentPageVisitDto",value:function(){var t=this.pageVisitRepository.getCurrentPageVisitDto();if(!t)throw new Error("Page visit not found");return t}},{key:"getTouchProcessorWorker",value:(o=Xf(zf().mark((function t(){return zf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!u.touchProcessorWorker){t.next=4;break}return t.abrupt("return",u.touchProcessorWorker);case 4:return t.next=6,this.touchProcessorRepository.getWorker();case 6:return u.touchProcessorWorker=t.sent,u.touchProcessorWorker.addEventListener("message",this.handleWorkerMessage),t.abrupt("return",u.touchProcessorWorker);case 9:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"loadState",value:function(){return{scrollProcessorStateItems:Xu.getArray(this.STORAGE_SCROLL_EVENT_GROUPS)}}},{key:"saveState",value:function(){if(this.touchProcessorRepository.getIsRunning()){var t=this.scrollProcessorStateManager.getScrollEventGroupItems().filter((function(t){return!t.safeToDelete}));Xu.setObject(this.STORAGE_SCROLL_EVENT_GROUPS,t)}}},{key:"handleSafeToDelete",value:function(t){var e=this;this.scrollProcessorStateManager.getScrollEventGroupItems().filter((function(t){return!t.safeToDelete})).forEach((function(r){var n=r.scrollEventGroupDto.scrollEvents;n[n.length-1].timeStamp+r.deviceDocumentLoadTime<=t&&e.scrollProcessorStateManager.updateSafeToDelete({scrollEventGroupDtoId:r.scrollEventGroupDto.id,safeToDelete:!0})}))}},{key:"handleExpresionDetected",value:function(t){var e=this;t.forEach((function(t){e.handleSafeToDelete(t.deviceDocumentLoadTime)}))}},{key:"handleEmptyQueue",value:function(){var t=this.getCurrentPageVisitDto();this.handleSafeToDelete(t.deviceDocumentLoadTime)}},{key:"handleWorkerMessage",value:function(t){switch(t.data.type){case dl.ExpresionDetected:this.handleExpresionDetected(t.data.payload.touchExpressionDtos);break;case dl.EmptyQueue:this.handleEmptyQueue()}}},{key:"internalMemoryCleanUp",value:function(){if(u.scrollEventGroups.length>3){var t=u.scrollEventGroups.splice(0,u.scrollEventGroups.length-3);t.length>0&&t.forEach((function(t){var e=t.id,r=u.handledScrollEventGroupIds.indexOf(e);r>-1&&u.handledScrollEventGroupIds.splice(r,1)}))}}},{key:"handleScrollEventGroupComplete",value:function(t){if(!u.handledScrollEventGroupIds.includes(t)){u.handledScrollEventGroupIds.push(t);var e=u.scrollEventGroups.find((function(e){return e.id===t}));if(void 0===e)throw new Error("scrollEventGroup is undefined");var r=this.getCurrentPageVisitDto();this.scrollProcessorStateManager.pushScrollEventGroup({pageVisitId:r.id,deviceDocumentLoadTime:r.deviceDocumentLoadTime,safeToDelete:!1,scrollEventGroupDto:e}),this.touchProcessorRepository.handleScrollEventGroupComplete(e,r.id,r.deviceDocumentLoadTime)}}},{key:"handleScrollEventGroupStart",value:function(t){var e=this.getCurrentPageVisitDto();this.touchProcessorRepository.handleScrollEventGroupStart(t,e.id,e.deviceDocumentLoadTime)}},{key:"analyzeScrollEventGroups",value:function(t){var e,r,n=null===(e=u.scrollEventGroups[u.scrollEventGroups.length-1])||void 0===e?void 0:e.scrollEvents[u.scrollEventGroups[u.scrollEventGroups.length-1].scrollEvents.length-1],o=null==n?void 0:n.timeStamp,i=null!==(r=null==t?void 0:t.timeStamp)&&void 0!==r?r:performance.now(),a=void 0!==o&&i-o>this.scrollEventMaxGapMs,c=u.scrollEventGroups.length;if(0===u.scrollEventGroups.length)u.scrollEventGroups.push({id:"".concat(u.scrollEventGroupSerialId++),scrollEvents:[]});else if(a){var s=u.scrollEventGroups[u.scrollEventGroups.length-1].id;u.scrollEventGroups.push({id:"".concat(u.scrollEventGroupSerialId++),scrollEvents:[]}),this.handleScrollEventGroupComplete(s)}var l=u.scrollEventGroups.length;t&&(c<l||c===l&&0===u.scrollEventGroups[u.scrollEventGroups.length-1].scrollEvents.length)&&this.handleScrollEventGroupStart({id:u.scrollEventGroups[u.scrollEventGroups.length-1].id,scrollEvents:[t]})}},{key:"pushToGroup",value:function(t){this.analyzeScrollEventGroups(t),u.scrollEventGroups[u.scrollEventGroups.length-1].scrollEvents.push(t)}},{key:"getScrollPosition",value:function(){var t=Math.max(Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),Math.max(document.body.offsetHeight,document.documentElement.offsetHeight),Math.max(document.body.clientHeight,document.documentElement.clientHeight)),e=window.pageYOffset||window.document.documentElement.scrollTop||window.document.body.scrollTop,r=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;return{percent:Math.min(Math.round((e+r)/t*100),100),pixel:e+r}}},{key:"fromScrollEvent",value:function(t,e){return{id:"".concat(u.scrollEventSerialId++),timeStamp:t.timeStamp,scrollPosition:e}}}],r&&Qf(e.prototype,r),n&&Qf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(Hu),tp(Bf,"scrollEventSerialId",0),tp(Bf,"scrollEventGroupSerialId",0),tp(Bf,"scrollEventGroups",[]),tp(Bf,"handledScrollEventGroupIds",[]),Uf=Bf))||Uf)||Uf)||Uf)||Uf)||Uf)||Uf)||Uf)||Uf;function op(t){return op="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},op(t)}function ip(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ip=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==op(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ap(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function cp(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,up(n.key),n)}}function up(t){var e=function(t,e){if("object"!==op(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==op(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===op(e)?e:String(e)}var sp,lp=L()(rp=function(t,e){return _(Bn)(t,void 0,0)}(rp=Reflect.metadata("design:type",Function)(rp=Reflect.metadata("design:paramtypes",["undefined"==typeof ITouchProcessorDataProvider?Object:ITouchProcessorDataProvider])(rp=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.touchProcessorDataProvider=e}var e,r,n,o,i;return e=t,r=[{key:"getWorker",value:(o=ip().mark((function t(){return ip().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.touchProcessorDataProvider.getWorker();case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){ap(i,r,n,a,c,"next",t)}function c(t){ap(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"handleScrollEventGroupComplete",value:function(t,e,r){this.touchProcessorDataProvider.handleScrollEventGroupComplete(t,e,r)}},{key:"handleScrollEventGroupStart",value:function(t,e,r){this.touchProcessorDataProvider.handleScrollEventGroupStart(t,e,r)}},{key:"getIsRunning",value:function(){return this.touchProcessorDataProvider.getIsRunning()}}],r&&cp(e.prototype,r),n&&cp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||rp)||rp)||rp)||rp;function fp(t){return fp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fp(t)}function pp(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,hp(n.key),n)}}function hp(t){var e=function(t,e){if("object"!==fp(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==fp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===fp(e)?e:String(e)}var yp=L()(sp=function(t,e){return _(vi)(t,void 0,0)}(sp=Reflect.metadata("design:type",Function)(sp=Reflect.metadata("design:paramtypes",["undefined"==typeof IPageVisitDataProvider?Object:IPageVisitDataProvider])(sp=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pageVisitDataProvider=e}var e,r,n;return e=t,(r=[{key:"getCurrentPageVisitDto",value:function(){return this.pageVisitDataProvider.getCurrentPageVisit()}}])&&pp(e.prototype,r),n&&pp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||sp)||sp)||sp)||sp;var vp,dp,mp=r(42),gp=r.n(mp);function bp(t){return bp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bp(t)}function wp(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Sp(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?wp(Object(r),!0).forEach((function(e){_p(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wp(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ep(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ep=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==bp(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Tp(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Pp(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Tp(i,n,o,a,c,"next",t)}function c(t){Tp(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Op(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Lp(n.key),n)}}function Ip(t,e){return Ip=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ip(t,e)}function kp(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=jp(t);if(e){var o=jp(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===bp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return xp(t)}(this,r)}}function xp(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jp(t){return jp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},jp(t)}function _p(t,e,r){return(e=Lp(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lp(t){var e=function(t,e){if("object"!==bp(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==bp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===bp(e)?e:String(e)}var Ap,Rp,Dp=L()(vp=function(t,e){return _(Bc)(t,void 0,0)}(vp=Reflect.metadata("design:type",Function)(vp=Reflect.metadata("design:paramtypes",[void 0===Bc?Object:Bc])((dp=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ip(t,e)}(f,t);var e,r,n,o,i,a,c,u,s,l=kp(f);function f(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),(e=l.call(this)).dataReporterStateManager=t,e.handleWorkerMessage=e.handleWorkerMessage.bind(xp(e)),e}return e=f,r=[{key:"load",value:(s=Pp(Ep().mark((function t(){return Ep().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getWorker();case 2:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"unload",value:function(){var t,e;null===(t=f.worker)||void 0===t||t.removeEventListener("message",this.handleWorkerMessage),null===(e=f.worker)||void 0===e||e.terminate(),f.worker=void 0,f.networkDataItemSerialId=0,this.dataReporterStateManager.emptyState(),f.workerLoadingSatus=void 0}},{key:"handleTimerEvent",value:(u=Pp(Ep().mark((function t(){var e,r;return Ep().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getWorker();case 2:e=t.sent,r={type:Ws.TimerEvent,payload:void 0},e.postMessage(r);case 5:case"end":return t.stop()}}),t,this)}))),function(){return u.apply(this,arguments)})},{key:"pushData",value:function(t,e){switch(t){case jc.Action:this.handlePushActionItem(e);break;case jc.TouchExpression:this.handlePushTouchExpressionItem(e);break;case jc.PageVisits:this.handlePushPageVisitItem(e)}}},{key:"getWorker",value:(c=Pp(Ep().mark((function t(){return Ep().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!f.worker){t.next=4;break}return t.abrupt("return",f.worker);case 4:return t.next=6,this.loadWorker();case 6:if(f.worker){t.next=8;break}throw new Error("DataReporterRepository:worker is undefined");case 8:return t.abrupt("return",f.worker);case 9:case"end":return t.stop()}}),t,this)}))),function(){return c.apply(this,arguments)})},{key:"handlePushNetworkDataItem",value:(a=Pp(Ep().mark((function t(e){var r,n;return Ep().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getWorker();case 2:r=t.sent,this.dataReporterStateManager.pushNetworkDataItem({networkDataItemDto:e}),n={type:Ws.PushNetworkDataItem,payload:e},r.postMessage(n);case 6:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})},{key:"handlePushActionItem",value:function(t){var e=this.networkDataItemDtoFromActionItem(t);this.handlePushNetworkDataItem(e)}},{key:"handlePushTouchExpressionItem",value:function(t){var e=this.networkDataItemDtoFromTouchExpressionItem(t);this.handlePushNetworkDataItem(e)}},{key:"handlePushPageVisitItem",value:(i=Pp(Ep().mark((function t(e){var r;return Ep().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.networkDataItemDtoFromPageVisitItem(e),t.next=3,this.handlePushNetworkDataItem(r);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"loadWorker",value:(o=Pp(Ep().mark((function t(){var e=this;return Ep().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t){if("loaded"===f.workerLoadingSatus&&t(void 0),"error"===f.workerLoadingSatus)throw new Error("DataReporterRepository:workerLoadingSatus is error");"loading"===f.workerLoadingSatus&&setTimeout((function(){if("loaded"===f.workerLoadingSatus&&t(void 0),"error"===f.workerLoadingSatus)throw new Error("DataReporterRepository:workerLoadingSatus is error")}),1e3),void 0===f.workerLoadingSatus&&(f.workerLoadingSatus="loading",fetch(gp()).then((function(t){return t.text()})).then((function(r){var n="self.config = ".concat(JSON.stringify(Sp({},gr)),";")+"\n"+r,o=new Blob([n],{type:"application/javascript"});f.worker=new Worker(URL.createObjectURL(o)),f.worker.addEventListener("message",e.handleWorkerMessage),f.worker.addEventListener("message",(function(e){e.data.type===Fs.Loaded&&t(void 0)}))})))}));case 2:case"end":return t.stop()}}),t)}))),function(){return o.apply(this,arguments)})},{key:"handleNetworkDataItemIsSent",value:function(t){var e=t.networkDataItemDto,r=t.isSent;this.dataReporterStateManager.updateNetworkDataItem({networkDataItemDtoId:e.id,isSent:r})}},{key:"handleWorkerMessage",value:function(t){t.data.type===Fs.NetworkDataItemIsSent&&this.handleNetworkDataItemIsSent(t.data.payload)}},{key:"networkDataItemDtoFromActionItem",value:function(t){return{id:"".concat(f.networkDataItemSerialId++),contentType:jc.Action,content:t}}},{key:"networkDataItemDtoFromTouchExpressionItem",value:function(t){return{id:"".concat(f.networkDataItemSerialId++),contentType:jc.TouchExpression,content:t}}},{key:"networkDataItemDtoFromPageVisitItem",value:function(t){return{id:"".concat(f.networkDataItemSerialId++),contentType:jc.PageVisits,content:t}}}],r&&Op(e.prototype,r),n&&Op(e,n),Object.defineProperty(e,"prototype",{writable:!1}),f}(Hu),_p(dp,"networkDataItemSerialId",0),_p(dp,"workerLoadingSatus",void 0),vp=dp))||vp)||vp)||vp)||vp;function Cp(t){return Cp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cp(t)}function Np(t){return function(t){if(Array.isArray(t))return Mp(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Mp(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mp(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mp(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Vp(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Hp(n.key),n)}}function Gp(t,e){return Gp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gp(t,e)}function Wp(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Up(t);if(e){var o=Up(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===Cp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Fp(t)}(this,r)}}function Fp(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Up(t){return Up=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Up(t)}function Bp(t,e,r){return(e=Hp(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hp(t){var e=function(t,e){if("object"!==Cp(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Cp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Cp(e)?e:String(e)}var Yp,zp=L()(Ap=function(t,e){return _(Pu)(t,void 0,0)}(Ap=function(t,e){return _(Zc)(t,void 0,1)}(Ap=function(t,e){return _(fn)(t,void 0,2)}(Ap=function(t,e){return _(eu)(t,void 0,3)}(Ap=Reflect.metadata("design:type",Function)(Ap=Reflect.metadata("design:paramtypes",[void 0===Pu?Object:Pu,"undefined"==typeof ILibrarySessionRepository?Object:ILibrarySessionRepository,"undefined"==typeof ILibrarySessionService?Object:ILibrarySessionService,"undefined"==typeof IPageVisitRepository?Object:IPageVisitRepository])((Rp=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gp(t,e)}(i,t);var e,r,n,o=Wp(i);function i(t,e,r,n){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Bp(Fp(a=o.call(this)),"STORAGE_VISIBLE_WATCHER_ITEMS_AT_TIME_STAMPS","visibleWatcherItemsAtTimeStamps"),Bp(Fp(a),"STORAGE_TURNED_VISIBLE_WATCHER_ITEMS","turnedVisibleWatcherItems"),a.contentStateManager=t,a.librarySessionRepository=e,a.librarySessionSevice=r,a.pageVisitRepository=n,a.intersectionObserverCallback=a.intersectionObserverCallback.bind(Fp(a)),a.getTextChunksFromElement=a.getTextChunksFromElement.bind(Fp(a)),a}return e=i,r=[{key:"load",value:function(){var t=this;if(this.librarySessionRepository.isTouchDevice()){var e=this.loadState(),r=e.contentTrackers,n=e.visibleWatcherItemsAtTimeStamp,o=e.turnedVisibleWatcherItems;n.forEach((function(e){t.contentStateManager.addVisibleWatcherItemsAtTimeStamp(e)})),o.forEach((function(e){t.contentStateManager.addTurnedVisibleWatcherItem(e)})),r.forEach((function(e){t.installContentTracker(e)}))}}},{key:"unload",value:function(){this.saveState(),i.touchProcessorIsRunning=!1,i.contentWatcherSerialId=0,i.contentWatcherElements.forEach((function(t){t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),t.intersectionObserver.unobserve(t.element)})),i.contentWatcherElements=[],this.contentStateManager.emptyState()}},{key:"handleTouchEventGroupStart",value:function(t){var e=this.getCurrentPageVisitDto(),r=this.contentStateManager.getContentWatcherVisibleItems().map((function(t){return{contentTrackerDtoIds:t.contentTrackerDtoIds,contentWatchedElement:t.contentWatchedElement}}));this.contentStateManager.addVisibleWatcherItemsAtTimeStamp({timeStamp:t.touchEvents[0].timeStamp,pageVisitId:e.id,deviceDocumentLoadTime:e.deviceDocumentLoadTime,localTime:e.deviceDocumentLoadTime+t.touchEvents[0].timeStamp,safeToDelete:!1,visibleElements:r})}},{key:"handleTouchExpressionDetected",value:function(t){var e=this;this.contentStateManager.getAllVisibleWatcherItemsAtTimeStamp().filter((function(t){return!t.safeToDelete})).filter((function(e){return e.localTime<=t.deviceDocumentLoadTime+t.startTimeStamp})).forEach((function(t){e.contentStateManager.updateVisibleWatcherItemsAtTimeStampSafeToDelete({timeStamp:t.timeStamp,pageVisitId:t.pageVisitId,deviceDocumentLoadTime:t.deviceDocumentLoadTime,safeToDelete:!0})})),this.contentStateManager.getAllTurnedVisibleWatcherItems().filter((function(t){return!t.safeToDelete})).filter((function(e){return e.localTime<=t.deviceDocumentLoadTime+t.startTimeStamp})).forEach((function(t){e.contentStateManager.updateTurnedVisibleWatcherItemSafeToDelete({timeStamp:t.timeStamp,pageVisitId:t.pageVisitId,deviceDocumentLoadTime:t.deviceDocumentLoadTime,safeToDelete:!0})}))}},{key:"getTouchExpressionContent",value:function(t){var e=this,r=[],n=[],o=[],i=[],a=[],c=this.librarySessionRepository.getPageTextHashesForPage(t.pageId);c&&(a=c.textHashes),this.contentStateManager.getVisibleWatcherItemsAtTimeStamp({timeStamp:t.startTimeStamp,pageVisitId:t.pageVisitId,deviceDocumentLoadTime:t.deviceDocumentLoadTime}).forEach((function(t){t.visibleElements.forEach((function(t){var e=t.contentWatchedElement,r=t.contentTrackerDtoIds;"imageUrl"in e?o.push({imageUrl:e.imageUrl,contentTrackerDtoIds:r}):"text"in e&&i.push({text:e.text,contentTrackerDtoIds:r})}))})),this.contentStateManager.getTurnedVisibleWatcherItems({pageVisitId:t.pageVisitId,deviceDocumentLoadTime:t.deviceDocumentLoadTime,timeStampStart:t.startTimeStamp,timeStampEnd:t.endTimeStamp}).forEach((function(t){var e=t.contentTrackerDtoIds,r=t.contentWatchedElement;"imageUrl"in r?o.push({imageUrl:r.imageUrl,contentTrackerDtoIds:e}):"text"in r&&i.push({text:r.text,contentTrackerDtoIds:e})})),o.forEach((function(t){var e=r.find((function(e){return e.imageUrl===t.imageUrl}));e?t.contentTrackerDtoIds.forEach((function(t){e.imageSettingIds.includes(t)||e.imageSettingIds.push(t)})):r.push({imageUrl:t.imageUrl,imageSettingIds:t.contentTrackerDtoIds})}));var u=[];return i.forEach((function(t){var r=n.find((function(e){return e.text===t.text}));if(r)t.contentTrackerDtoIds.forEach((function(t){r.textSettingIds.includes(t)||r.textSettingIds.push(t)}));else{var o=e.cyrb53(t.text),i=a.find((function(t){return t===o}))?void 0:t.text;i&&i.length>0&&u.push({text:i,hash:o}),n.push({text:i,hash:o,textSettingIds:t.contentTrackerDtoIds})}})),u.length>0&&this.librarySessionSevice.updateOrCreatePageTextHashState({pageId:t.pageId,textHashes:[].concat(Np(a.map((function(t){return t}))),Np(u.map((function(t){return t.hash})))),createdAtLocalTime:t.deviceDocumentLoadTime+t.startTimeStamp}),{images:r,texts:n}}},{key:"updateTouchProcessorRunningState",value:function(t){i.touchProcessorIsRunning=t}},{key:"cyrb53",value:function(t){for(var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=3735928559^r,o=1103547991^r,i=0;i<t.length;i++)e=t.charCodeAt(i),n=Math.imul(n^e,2654435761),o=Math.imul(o^e,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),4294967296*(2097151&(o=Math.imul(o^o>>>16,2246822507)^Math.imul(n^n>>>13,3266489909)))+(n>>>0)}},{key:"getCurrentPageVisitDto",value:function(){var t=this.pageVisitRepository.getCurrentPageVisitDto();if(!t)throw new Error("Page visit not found");return t}},{key:"saveState",value:function(){if(i.touchProcessorIsRunning){var t=this.contentStateManager.getAllVisibleWatcherItemsAtTimeStamp().filter((function(t){return!t.safeToDelete}));Xu.setObject(this.STORAGE_VISIBLE_WATCHER_ITEMS_AT_TIME_STAMPS,t);var e=this.contentStateManager.getAllTurnedVisibleWatcherItems().filter((function(t){return!t.safeToDelete}));Xu.setObject(this.STORAGE_TURNED_VISIBLE_WATCHER_ITEMS,e)}}},{key:"loadState",value:function(){return{contentTrackers:this.storageLoadCurrentContentTrackers(),visibleWatcherItemsAtTimeStamp:Xu.getArray(this.STORAGE_VISIBLE_WATCHER_ITEMS_AT_TIME_STAMPS),turnedVisibleWatcherItems:Xu.getArray(this.STORAGE_TURNED_VISIBLE_WATCHER_ITEMS)}}},{key:"storageLoadCurrentContentTrackers",value:function(){var t=this,e=[],r=this.librarySessionRepository.getImageSetting();r&&r.imageSettings.length>0&&r.imageSettings.forEach((function(r){var n=t.fromContentTrackerModel(r);e.push(n)}));var n=this.librarySessionRepository.getTextSetting();return n&&n.textSettings.length>0&&n.textSettings.forEach((function(r){var n=t.fromContentTrackerModel(r);e.push(n)})),e}},{key:"isContentWatchedElementVisible",value:function(t,e,r){var n=!1;return"imageUrl"in t?n=e:"text"in t&&(n=r.some((function(r){return t.text===r.text&&e&&r.DOMRects.some((function(t){return ns.isVisibleByPosition({domRect:t,innerHeight:window.innerHeight,innerWidth:window.innerWidth})}))}))),n}},{key:"handleVisibilityUpdate",value:function(t,e){var r=this,n=this.getCurrentPageVisitDto(),o=i.contentWatcherElements.find((function(e){return e.element===t}));if(o){var a=e||!1,c=t.getBoundingClientRect(),u=window.innerHeight,s=window.innerWidth,l=c.width*c.height,f=u*s;void 0===e&&(a=ns.isVisibleByPosition({domRect:c,innerHeight:u,innerWidth:s}));var p=[];o.contentWatcherDtos.some((function(t){return"text"in t.contentWatchedElement}))&&(p=this.getTextChunksFromElement(t)),l>f&&a&&p.length>0&&(o.timeoutId&&(clearTimeout(o.timeoutId),o.timeoutId=void 0),o.timeoutId=setTimeout((function(){r.handleVisibilityUpdate(t)}),1e3)),a&&(a=ns.isVisibleByOpacity(t)),o.lastTime=performance.now(),o.timeoutId&&!a&&(clearTimeout(o.timeoutId),o.timeoutId=void 0),o.contentWatcherDtos.forEach((function(t){var e=r.contentStateManager.getContentWatcherItemById(t.id);if(e){var o=r.isContentWatchedElementVisible(t.contentWatchedElement,a,p);if(r.contentStateManager.updateContentWatcherItem({id:t.id,isVisible:o,contentTrackerDtoIds:e.contentTrackerDtoIds,contentWatchedElement:e.contentWatchedElement}),!e.isVisible&&o){var i=performance.now();r.contentStateManager.addTurnedVisibleWatcherItem({timeStamp:i,pageVisitId:n.id,deviceDocumentLoadTime:n.deviceDocumentLoadTime,localTime:n.deviceDocumentLoadTime+i,safeToDelete:!1,contentTrackerDtoIds:e.contentTrackerDtoIds,contentWatchedElement:e.contentWatchedElement})}}else console.error("Content watcher item not found")}))}}},{key:"intersectionObserverCallback",value:function(t){var e=t[0],r=e.target,n=e.isIntersecting,o=e.intersectionRatio,i=r,a=!1;n&&o>=0&&(a=!0),this.handleVisibilityUpdate(i,a)}},{key:"imageHasBigSize",value:function(t){var e=t.clientWidth>50&&t.clientHeight>50,r=!1;return"naturalWidth"in t&&"naturalHeight"in t&&(r=parseInt("".concat(t.naturalWidth))>50&&parseInt("".concat(t.naturalHeight))>50),e||r}},{key:"getOptimalThresholds",value:function(t){var e=0,r=[],n=t.getBoundingClientRect(),o=n.width*n.height,i=window.innerHeight*window.innerWidth;if(o<=i)e=.1;else{for(var a=1/(o/i*10),c=0;c<=1;c+=a)r.push(parseFloat(c.toFixed(2)));e=r}return e}},{key:"installContentTrackerImage",value:function(t){var e=this,r=t.toDto();ns.getElementsFromTrackerDefinition(r.contentTrackerDefinition).forEach((function(t){var n=ns.getImageUrlFromElement(t);if(n&&e.imageHasBigSize(t)){var o="".concat(i.contentWatcherSerialId++),a={id:o,contentTrackerDtoIds:[r.id],contentWatchedElement:{imageUrl:n}},c=i.contentWatcherElements.find((function(e){return e.element===t}));if(c)c.contentWatcherDtos.push(a);else{var u=e.getOptimalThresholds(t),s=new IntersectionObserver(e.intersectionObserverCallback,{threshold:u});s.observe(t),c={element:t,intersectionObserver:s,contentWatcherDtos:[a]},i.contentWatcherElements.push(c)}var l=ns.isVisibleByOpacity(t),f=ns.isVisibleByPosition({domRect:t.getBoundingClientRect(),innerHeight:window.innerHeight,innerWidth:window.innerWidth});e.contentStateManager.addContentWatcherItem({id:o,contentTrackerDtoIds:[r.id],isVisible:l&&f,contentWatchedElement:a.contentWatchedElement})}}))}},{key:"cleanTextRemoveSpace",value:function(t){return t.replace(/(\r\n|\n|\r|\t|\s)/gm,"")}},{key:"cleanTextRemoveDoubleSpace",value:function(t){return t.replace(/(\r\n|\n|\r|\t|\s){2,}/gm," ")}},{key:"getInsideText",value:function(t){var e="";return"tagName"in t&&"INPUT"===t.tagName&&"value"in t?e=t.value||"":t.nodeType===Node.TEXT_NODE?e=t.textContent||"":"innerText"in t?e=t.innerText||"":"textContent"in t&&(e=t.textContent||""),e}},{key:"containsText",value:function(t){var e=this.getInsideText(t);return(e=this.cleanTextRemoveSpace(e)).length>0}},{key:"getTextChunksFromChildNode",value:function(t){var e=[];if(this.containsText(t))if(ns.isHTMLElement(t)&&"INPUT"===t.tagName&&"value"in t){var r=this.cleanTextRemoveDoubleSpace(t.value),n=[];"getClientRects"in t&&"function"==typeof t.getClientRects&&(n=Array.from(t.getClientRects()));var o={text:r,path:t.nodeName.toLowerCase(),element:t,DOMRects:n};r.length>0&&n.length>0&&e.push(o)}else if(t.nodeType===Node.TEXT_NODE&&t.textContent&&t.parentNode)for(var a=0;a<(null===(c=t.textContent)||void 0===c?void 0:c.length);a+=Math.min(i.maxChunkLength,t.textContent.length-a)){var c,u=document.createRange();u.setStart(t,a),u.setEnd(t,a+Math.min(i.maxChunkLength,t.textContent.length-a));var s=Array.from(u.getClientRects()),l="".concat(t.parentNode.nodeName.toLowerCase(),"/").concat(t.nodeName.toLowerCase(),"[").concat(Array.from(t.parentNode.childNodes).indexOf(t),"](").concat(a,")"),f={text:this.cleanTextRemoveDoubleSpace(t.textContent.substr(a,Math.min(i.maxChunkLength,t.textContent.length-a))),element:t.parentNode,path:l,DOMRects:s};f.text.length>0&&" "!==f.text&&f.DOMRects.length>0&&e.push(f)}return e}},{key:"getTextChunksFromElement",value:function(t){return 0===t.childNodes.length?this.containsText(t)?this.getTextChunksFromChildNode(t):[]:Array.from(t.childNodes).map(this.getTextChunksFromElement).flat()}},{key:"getTextElementsFromTrackerDefinition",value:function(t){var e=[];return("tagName"in t&&"*"===t.tagName?Object.values(yl).map((function(e){return ns.getElementsFromTrackerDefinition({tagName:e,attributeName:t.attributeName,attributeValue:t.attributeValue})})).flat():ns.getElementsFromTrackerDefinition(t)).forEach((function(t){e.some((function(e){return e===t}))||e.push(t)})),e}},{key:"installContentTrackerText",value:function(t){var e=this,r=t.toDto();this.getTextElementsFromTrackerDefinition(r.contentTrackerDefinition).forEach((function(t){e.containsText(t)&&e.getTextChunksFromElement(t).forEach((function(n){var o,a,c=e.contentStateManager.getContentWatcherItems(),u=i.contentWatcherElements.find((function(t){return t.element===n.element}));u&&c.forEach((function(t){u&&!a&&"text"in t.contentWatchedElement&&t.contentWatchedElement.text===n.text&&t.contentWatchedElement.path===n.path&&(a=u.contentWatcherDtos.find((function(e){return e.id===t.id})))}));var s=ns.isVisibleByOpacity(n.element),l=n.DOMRects.some((function(t){return ns.isVisibleByPosition({domRect:t,innerHeight:window.innerHeight,innerWidth:window.innerWidth})}));if(a?(o=a.id,a.contentTrackerDtoIds.includes(r.id)||(a.contentTrackerDtoIds.push(r.id),e.contentStateManager.updateContentWatcherItem({id:a.id,isVisible:s&&l,contentTrackerDtoIds:a.contentTrackerDtoIds,contentWatchedElement:a.contentWatchedElement}))):(o="".concat(i.contentWatcherSerialId++),a={id:o,contentTrackerDtoIds:[r.id],contentWatchedElement:{text:n.text,path:n.path}},e.contentStateManager.addContentWatcherItem({id:o,contentTrackerDtoIds:[r.id],isVisible:s&&l,contentWatchedElement:a.contentWatchedElement})),u)u.contentWatcherDtos.push(a);else{var f=e.getOptimalThresholds(t),p=new IntersectionObserver(e.intersectionObserverCallback,{threshold:f});p.observe(n.element),u={element:n.element,intersectionObserver:p,contentWatcherDtos:[a]},i.contentWatcherElements.push(u)}}))}))}},{key:"installContentTracker",value:function(t){switch(t.toDto().contentTrackerType){case fu.Image:this.installContentTrackerImage(t);break;case fu.Text:this.installContentTrackerText(t)}}},{key:"fromContentTrackerModel",value:function(t){var e;if(t.xpath?e={xpath:t.xpath}:t.tagName&&(e={tagName:t.tagName,attributeName:t.attributeName,attributeValue:t.attributeValue}),!e)throw new Error("Content tracker definition not found");var r="imageSettingId"in t?fu.Image:fu.Text,n="imageSettingId"in t?t.imageSettingId:t.textSettingId;return new Lu({id:n,contentTrackerType:r,contentTrackerDefinition:e})}}],r&&Vp(e.prototype,r),n&&Vp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Hu),Bp(Rp,"maxChunkLength",300),Bp(Rp,"touchProcessorIsRunning",!1),Bp(Rp,"contentWatcherSerialId",0),Bp(Rp,"contentWatcherElements",[]),Ap=Rp))||Ap)||Ap)||Ap)||Ap)||Ap)||Ap)||Ap;function qp(t){return qp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qp(t)}function Xp(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qp(n.key),n)}}function Qp(t){var e=function(t,e){if("object"!==qp(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==qp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===qp(e)?e:String(e)}var Kp,Jp=L()(Yp=function(t,e){return _(hn)(t,void 0,0)}(Yp=Reflect.metadata("design:type",Function)(Yp=Reflect.metadata("design:paramtypes",["undefined"==typeof ILibrarySessionDataProvider?Object:ILibrarySessionDataProvider])(Yp=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.librarySessionDataProvider=e}var e,r,n;return e=t,(r=[{key:"isTouchDevice",value:function(){return this.librarySessionDataProvider.isTouchDevice()}},{key:"getImageSetting",value:function(){return this.librarySessionDataProvider.getImageSetting()}},{key:"getTextSetting",value:function(){return this.librarySessionDataProvider.getTextSetting()}},{key:"getPageTextHashesForPage",value:function(t){return this.librarySessionDataProvider.getPageTextHashesForPage(t)}}])&&Xp(e.prototype,r),n&&Xp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Yp)||Yp)||Yp)||Yp;function $p(t){return $p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$p(t)}function Zp(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,th(n.key),n)}}function th(t){var e=function(t,e){if("object"!==$p(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==$p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===$p(e)?e:String(e)}var eh,rh,nh=L()(Kp=function(t,e){return _(vi)(t,void 0,0)}(Kp=Reflect.metadata("design:type",Function)(Kp=Reflect.metadata("design:paramtypes",["undefined"==typeof IPageVisitDataProvider?Object:IPageVisitDataProvider])(Kp=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pageVisitDataProvider=e}var e,r,n;return e=t,(r=[{key:"getCurrentPageVisitDto",value:function(){return this.pageVisitDataProvider.getCurrentPageVisit()}}])&&Zp(e.prototype,r),n&&Zp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Kp)||Kp)||Kp)||Kp;function oh(t){return oh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(t)}function ih(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ih=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==oh(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ah(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function ch(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ph(n.key),n)}}function uh(t,e){return uh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},uh(t,e)}function sh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=fh(t);if(e){var o=fh(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===oh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return lh(t)}(this,r)}}function lh(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fh(t){return fh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fh(t)}function ph(t){var e=function(t,e){if("object"!==oh(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==oh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===oh(e)?e:String(e)}var hh,yh=L()(eh=function(t,e){return _(Uo)(t,void 0,0)}(eh=function(t,e){return _(ko)(t,void 0,1)}(eh=Reflect.metadata("design:type",Function)(eh=Reflect.metadata("design:paramtypes",[void 0===Uo?Object:Uo,"undefined"==typeof ILibrarySessionRepository?Object:ILibrarySessionRepository])((rh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&uh(t,e)}(c,t);var e,r,n,o,i,a=sh(c);function c(t,e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(r=a.call(this)).iphoneCompatibilityStateManager=t,r.librarySessionRepository=e,r.handleTouchEvent=r.handleTouchEvent.bind(lh(r)),r}return e=c,r=[{key:"load",value:function(){var t=this.loadState(),e=t.isIphoneDevice,r=t.iphoneCompatibilitySettingsDto;this.iphoneCompatibilityStateManager.setIsIphoneDevice(e),this.iphoneCompatibilityStateManager.setIphoneCompatibilitySettings(r),e&&this.installCompatibilityFixes(r)}},{key:"unload",value:(o=ih().mark((function t(){return ih().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.saveState(),document.body.removeEventListener("touchstart",this.handleTouchEvent),c.touchProcessorIsRunning=!1,this.iphoneCompatibilityStateManager.emptyState();case 4:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){ah(i,r,n,a,c,"next",t)}function c(t){ah(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"updateTouchProcessorRunningState",value:function(t){c.touchProcessorIsRunning=t}},{key:"handleTouchExpressionDetected",value:function(t){}},{key:"loadState",value:function(){return{isIphoneDevice:this.isIphoneDevice(),iphoneCompatibilitySettingsDto:this.storageLoadIphoneCompatibilitySettings()}}},{key:"saveState",value:function(){c.touchProcessorIsRunning}},{key:"storageLoadIphoneCompatibilitySettings",value:function(){var t={id:"iphoneCompatibilitySettings",iphoneCompatibilityVersion:0},e=this.librarySessionRepository.getIphoneCompatibilitySettings();return e&&(t.iphoneCompatibilityVersion=e.iphoneCompatibilitySettings.iphoneCompatibilityVersion),t}},{key:"isIphoneDevice",value:function(){return(["iPhone","iPhone Simulator","iPod","iPod Simulator","iPad","iPad Simulator"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document||!window.MSStream&&/iPad|iPhone|iPod/.test(navigator.userAgent))&&this.librarySessionRepository.isTouchDevice()}},{key:"handleTouchEvent",value:function(){}},{key:"installCommonCompatibilityFixes",value:function(){document.body.addEventListener("touchstart",this.handleTouchEvent)}},{key:"installCompatibilityFixesV0",value:function(){this.iphoneCompatibilityStateManager.addIphoneCompatibilityStrategy(jo.EstimateNumberOfEmpulses)}},{key:"installCompatibilityFixesV1",value:function(){}},{key:"installCompatibilityFixes",value:function(t){switch(this.installCommonCompatibilityFixes(),t.iphoneCompatibilityVersion){case 0:this.installCompatibilityFixesV0();break;case 1:this.installCompatibilityFixesV1()}}}],r&&ch(e.prototype,r),n&&ch(e,n),Object.defineProperty(e,"prototype",{writable:!1}),c}(Hu),function(t,e,r){(e=ph(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(rh,"touchProcessorIsRunning",!1),eh=rh))||eh)||eh)||eh)||eh)||eh;function vh(t){return vh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vh(t)}function dh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mh(n.key),n)}}function mh(t){var e=function(t,e){if("object"!==vh(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==vh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===vh(e)?e:String(e)}var gh,bh=L()(hh=function(t,e){return _(hn)(t,void 0,0)}(hh=Reflect.metadata("design:type",Function)(hh=Reflect.metadata("design:paramtypes",["undefined"==typeof ILibrarySessionDataProvider?Object:ILibrarySessionDataProvider])(hh=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.librarySessionDataProvider=e}var e,r,n;return e=t,(r=[{key:"isTouchDevice",value:function(){return this.librarySessionDataProvider.isTouchDevice()}},{key:"getIphoneCompatibilitySettings",value:function(){return this.librarySessionDataProvider.getIphoneCompatibilitySettings()}}])&&dh(e.prototype,r),n&&dh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||hh)||hh)||hh)||hh;function wh(t){return wh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wh(t)}function Sh(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Sh=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==wh(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Eh(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Th(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xh(n.key),n)}}function Ph(t,e){return Ph=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ph(t,e)}function Oh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=kh(t);if(e){var o=kh(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===wh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ih(t)}(this,r)}}function Ih(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function kh(t){return kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kh(t)}function xh(t){var e=function(t,e){if("object"!==wh(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==wh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===wh(e)?e:String(e)}var jh,_h=L()(gh=function(t,e){return _(Ri)(t,void 0,0)}(gh=function(t,e){return _(di)(t,void 0,1)}(gh=function(t,e){return _(Ka)(t,void 0,2)}(gh=Reflect.metadata("design:type",Function)(gh=Reflect.metadata("design:paramtypes",[void 0===Ri?Object:Ri,"undefined"==typeof ILibrarySessionRepository?Object:ILibrarySessionRepository,"undefined"==typeof IVisitorActivityService?Object:IVisitorActivityService])(gh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ph(t,e)}(c,t);var e,r,n,o,i,a=Oh(c);function c(t,e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),function(t,e,r){(e=xh(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(Ih(n=a.call(this)),"PAGE_VISITS","pageVisits"),n.pageVisitStateManager=t,n.librarySessionRepository=e,n.visitorActivityService=r,n}return e=c,r=[{key:"load",value:(o=Sh().mark((function t(){var e;return Sh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.loadState(),(e=this.createNewPageVisitDto()).referrer=document.referrer,this.expandToState(e),this.handleNewPageVisitStartDetected(e);case 5:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){Eh(i,r,n,a,c,"next",t)}function c(t){Eh(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"unload",value:function(){var t=this.getCurrentPageVisitDto();t&&(t.deviceDocumentEndTime=(new Date).getTime(),this.handleNewPageVisitEndDetected(t),this.saveState())}},{key:"handleLocationChangedEvent",value:function(){var t=(new Date).getTime();arguments.length&&PopStateEvent;var e=this.getCurrentPageVisitDto();if(!e)throw new Error("pageVisitDto is undefined");e.deviceDocumentEndTime=t,this.handleNewPageVisitEndDetected(e);var r=this.createNewPageVisitDto();r.referrer=e.pageId,r.urlNavigationStart=t,this.expandToState(r),this.handleNewPageVisitStartDetected(r)}},{key:"handleExpresionDetected",value:function(t){}},{key:"expandToState",value:function(t){if(!t)throw new Error("pageVisitDto is undefined");this.pageVisitStateManager.setUrlNavigationStart(t.urlNavigationStart),this.pageVisitStateManager.setPageId(t.pageId),this.pageVisitStateManager.setPageVisitId(t.id),this.pageVisitStateManager.setReferrer(t.referrer),this.pageVisitStateManager.setPageTitle(t.pageTitle)}},{key:"loadState",value:function(){}},{key:"saveState",value:function(){}},{key:"getCurrentPageVisitDto",value:function(){var t=this.librarySessionRepository.getLibrarySessionId(),e=this.librarySessionRepository.getDeviceDocumentLoadTime(),r=this.librarySessionRepository.getIsTouchDevice(),n=this.librarySessionRepository.getTabUniqueId(),o=this.pageVisitStateManager.getPageVisitId(),i=this.pageVisitStateManager.getPageId(),a=this.pageVisitStateManager.getUrlNavigationStart();if(void 0!==t&&void 0!==e&&void 0!==r&&void 0!==n&&void 0!==o&&void 0!==i&&void 0!==a)return{id:o,librarySessionId:t,pageId:i,deviceDocumentLoadTime:e,deviceDocumentEndTime:e,urlNavigationStart:a,isTouchDevice:r,tabUniqueId:n,referrer:this.pageVisitStateManager.getReferrer(),pageTitle:this.pageVisitStateManager.getPageTitle()}}},{key:"createNewPageVisitDto",value:function(){var t=this.librarySessionRepository.getLibrarySessionId();if(void 0===t)throw new Error("librarySessionId is undefined");var e=this.librarySessionRepository.getDeviceDocumentLoadTime();if(void 0===e)throw new Error("deviceDocumentLoadTime is undefined");var r=this.librarySessionRepository.getIsTouchDevice();if(void 0===r)throw new Error("isTouchDevice is undefined");var n=this.librarySessionRepository.getTabUniqueId();if(void 0===n)throw new Error("tabUniqueId is undefined");return{id:Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),librarySessionId:t,pageId:window.location.href,deviceDocumentLoadTime:e,deviceDocumentEndTime:e,urlNavigationStart:e,isTouchDevice:r,tabUniqueId:n,pageTitle:document.title}}},{key:"handleNewPageVisitEndDetected",value:function(t){this.visitorActivityService.pushPageVisitItem({pageVisitDto:t})}},{key:"handleNewPageVisitStartDetected",value:function(t){this.visitorActivityService.handleNewPageVisitStartDetected(t)}}],r&&Th(e.prototype,r),n&&Th(e,n),Object.defineProperty(e,"prototype",{writable:!1}),c}(Hu))||gh)||gh)||gh)||gh)||gh)||gh;function Lh(t){return Lh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lh(t)}function Ah(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Rh(n.key),n)}}function Rh(t){var e=function(t,e){if("object"!==Lh(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Lh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Lh(e)?e:String(e)}var Dh,Ch=L()(jh=function(t,e){return _(hn)(t,void 0,0)}(jh=Reflect.metadata("design:type",Function)(jh=Reflect.metadata("design:paramtypes",["undefined"==typeof ILibrarySessionDataProvider?Object:ILibrarySessionDataProvider])(jh=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.librarySessionDataProvider=e}var e,r,n;return e=t,(r=[{key:"getLibrarySessionId",value:function(){return this.librarySessionDataProvider.getLibrarySessionId()}},{key:"getDeviceDocumentLoadTime",value:function(){return this.librarySessionDataProvider.getDeviceDocumentLoadTime()}},{key:"getIsTouchDevice",value:function(){return this.librarySessionDataProvider.getIsTouchDevice()}},{key:"getTabUniqueId",value:function(){return this.librarySessionDataProvider.getTabUniqueId()}}])&&Ah(e.prototype,r),n&&Ah(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||jh)||jh)||jh)||jh;function Nh(){x.register(D,{useClass:Vs}),x.register(N,{useClass:Es}),x.register(pn,{useClass:ms}),x.register(yi,{useClass:_h}),x.register(di,{useClass:Ch}),x.register(Qa,{useClass:rl}),x.register(Ja,{useClass:ul}),x.register(Gi,{useClass:jl}),x.register(Fi,{useClass:Dl}),x.register(Ui,{useClass:Fl}),x.register(Bi,{useClass:zl}),x.register(Fn,{useClass:gf}),x.register(Hn,{useClass:$l}),x.register(Yn,{useClass:Tf}),x.register(zn,{useClass:xf}),x.register(qn,{useClass:Rf}),x.register(Xn,{useClass:Vf}),x.register(ga,{useClass:np}),x.register(Sa,{useClass:Hf}),x.register(Ea,{useClass:lp}),x.register(Ta,{useClass:yp}),x.register(hc,{useClass:Dp}),x.register(Jc,{useClass:zp}),x.register(Zc,{useClass:Jp}),x.register(eu,{useClass:nh}),x.register(Oo,{useClass:yh}),x.register(ko,{useClass:bh})}function Mh(t){return Mh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mh(t)}function Vh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Gh(n.key),n)}}function Gh(t){var e=function(t,e){if("object"!==Mh(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Mh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Mh(e)?e:String(e)}var Wh,Fh=L()(Dh=Reflect.metadata("design:type",Function)(Dh=Reflect.metadata("design:paramtypes",[])(Dh=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onBeforeUnloadEvent=this.onBeforeUnloadEvent.bind(this)}var e,r,n;return e=t,(r=[{key:"startListenEvent",value:function(e){t.callback=e,window.addEventListener("beforeunload",this.onBeforeUnloadEvent)}},{key:"stopListenEvent",value:function(){window.removeEventListener("beforeunload",this.onBeforeUnloadEvent)}},{key:"onBeforeUnloadEvent",value:function(){t.callback&&t.callback()}}])&&Vh(e.prototype,r),n&&Vh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Dh)||Dh)||Dh;function Uh(t){return Uh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uh(t)}function Bh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Hh(n.key),n)}}function Hh(t){var e=function(t,e){if("object"!==Uh(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Uh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Uh(e)?e:String(e)}var Yh,zh=L()(Wh=function(t,e){return _(hi)(t,void 0,0)}(Wh=Reflect.metadata("design:type",Function)(Wh=Reflect.metadata("design:paramtypes",["undefined"==typeof IPageVisitService?Object:IPageVisitService])(Wh=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pageVisitService=e,this.handleLocationChangedEvent=this.handleLocationChangedEvent.bind(this)}var e,r,n;return e=t,r=[{key:"startListenEvent",value:function(){var t=history.pushState,e=history.replaceState,r=this.handleLocationChangedEvent.bind(this);history.pushState=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];t.apply(history,n),r.apply(void 0,n)},history.replaceState=function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];e.apply(history,n),r.apply(void 0,n)},window.addEventListener("popstate",this.handleLocationChangedEvent)}},{key:"stopListenEvent",value:function(){window.removeEventListener("popstate",this.handleLocationChangedEvent)}},{key:"handleLocationChangedEvent",value:function(){var t;(t=this.pageVisitService).handleLocationChangedEvent.apply(t,arguments)}}],r&&Bh(e.prototype,r),n&&Bh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Wh)||Wh)||Wh)||Wh;function qh(t){return qh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qh(t)}function Xh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qh(n.key),n)}}function Qh(t){var e=function(t,e){if("object"!==qh(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==qh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===qh(e)?e:String(e)}var Kh,Jh=L()(Yh=function(t,e){return _(Ka)(t,void 0,0)}(Yh=function(t,e){return _(Un)(t,void 0,1)}(Yh=function(t,e){return _(ba)(t,void 0,2)}(Yh=function(t,e){return _(yc)(t,void 0,3)}(Yh=function(t,e){return _(Wi)(t,void 0,4)}(Yh=Reflect.metadata("design:type",Function)(Yh=Reflect.metadata("design:paramtypes",["undefined"==typeof IVisitorActivityService?Object:IVisitorActivityService,"undefined"==typeof ITouchProcessorService?Object:ITouchProcessorService,"undefined"==typeof IScrollProcessorService?Object:IScrollProcessorService,"undefined"==typeof IDataReporterService?Object:IDataReporterService,"undefined"==typeof IActionService?Object:IActionService])(Yh=function(){function t(e,r,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.visitorActivityService=e,this.touchProcessorService=r,this.scrollProcessorService=n,this.dataReporterService=o,this.actionService=i,this.onTimer=this.onTimer.bind(this)}var e,r,n;return e=t,(r=[{key:"startListenEvent",value:function(){this.onTimer()}},{key:"stopListenEvent",value:function(){null!==this.onTimerId&&clearTimeout(this.onTimerId)}},{key:"onTimer",value:function(){null!==this.onTimerId&&clearTimeout(this.onTimerId),this.onTimerId=setTimeout(this.onTimer,gr.timerEventInterval),this.visitorActivityService.handleTimerEvent(),this.touchProcessorService.handleTimerEvent(),this.scrollProcessorService.handleTimerEvent(),this.dataReporterService.handleTimerEvent(),this.actionService.handleTimerEvent()}}])&&Xh(e.prototype,r),n&&Xh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Yh)||Yh)||Yh)||Yh)||Yh)||Yh)||Yh)||Yh;function $h(t){return $h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$h(t)}function Zh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ty(n.key),n)}}function ty(t){var e=function(t,e){if("object"!==$h(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==$h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===$h(e)?e:String(e)}var ey,ry=L()(Kh=function(t,e){return _(Un)(t,void 0,0)}(Kh=function(t,e){return _(hn)(t,void 0,1)}(Kh=Reflect.metadata("design:type",Function)(Kh=Reflect.metadata("design:paramtypes",["undefined"==typeof ITouchProcessorService?Object:ITouchProcessorService,"undefined"==typeof ILibrarySessionDataProvider?Object:ILibrarySessionDataProvider])(Kh=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.touchProcessorService=e,this.librarySessionDataProvider=r,this.handleClickEvent=this.handleClickEvent.bind(this),this.handleTouchEvent=this.handleTouchEvent.bind(this)}var e,r,n;return e=t,(r=[{key:"startListenEvent",value:function(){this.librarySessionDataProvider.isTouchDevice()?(window.addEventListener("touchstart",this.handleTouchEvent),window.addEventListener("touchmove",this.handleTouchEvent),window.addEventListener("touchend",this.handleTouchEvent)):window.addEventListener("click",this.handleClickEvent)}},{key:"stopListenEvent",value:function(){this.librarySessionDataProvider.isTouchDevice()?(window.removeEventListener("touchstart",this.handleTouchEvent),window.removeEventListener("touchmove",this.handleTouchEvent),window.removeEventListener("touchend",this.handleTouchEvent)):window.removeEventListener("click",this.handleClickEvent)}},{key:"handleClickEvent",value:function(t){t.isTrusted}},{key:"handleTouchEvent",value:function(t){t.isTrusted&&this.touchProcessorService.handleTouchEvent(t)}}])&&Zh(e.prototype,r),n&&Zh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||Kh)||Kh)||Kh)||Kh)||Kh;function ny(t){return ny="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ny(t)}function oy(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,iy(n.key),n)}}function iy(t){var e=function(t,e){if("object"!==ny(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ny(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ny(e)?e:String(e)}var ay,cy=L()(ey=function(t,e){return _(Ha)(t,void 0,0)}(ey=Reflect.metadata("design:type",Function)(ey=Reflect.metadata("design:paramtypes",["undefined"==typeof IScrollProcessorService?Object:IScrollProcessorService])(ey=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.scrollProcessorService=e,this.handleScrollEvent=this.handleScrollEvent.bind(this),this.handleInputEvent=this.handleInputEvent.bind(this)}var e,r,n;return e=t,(r=[{key:"startListenEvent",value:function(){window.addEventListener("pointerdown",this.handleInputEvent,{capture:!0}),window.addEventListener("mousewheel",this.handleInputEvent,{capture:!0}),window.addEventListener("keydown",this.handleInputEvent,{capture:!0})}},{key:"stopListenEvent",value:function(){var e=this;window.removeEventListener("pointerdown",this.handleInputEvent),window.removeEventListener("mousewheel",this.handleInputEvent),window.removeEventListener("keydown",this.handleInputEvent),t.scrollableNodes&&t.scrollableNodes.forEach((function(t){t.removeEventListener("scroll",e.handleScrollEvent)})),window.removeEventListener("scroll",this.handleScrollEvent)}},{key:"handleInputEvent",value:function(e){var r=this,n=e.composedPath().filter((function(t){return t instanceof HTMLElement&&t.scrollHeight>t.clientHeight}));if(n.length){t.scrollableNodes||(t.scrollableNodes=[]);var o=n.filter((function(e){return!t.scrollableNodes.includes(e)}));o.length&&o.forEach((function(e){e===document.documentElement?window.addEventListener("scroll",r.handleScrollEvent):e.addEventListener("scroll",r.handleScrollEvent),t.scrollableNodes.push(e)}))}}},{key:"handleScrollEvent",value:function(t){t.isTrusted&&this.scrollProcessorService.handleScrollEvent(t)}}])&&oy(e.prototype,r),n&&oy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||ey)||ey)||ey)||ey;function uy(t){return uy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uy(t)}function sy(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ly(n.key),n)}}function ly(t){var e=function(t,e){if("object"!==uy(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==uy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===uy(e)?e:String(e)}var fy,py=function(t){return t.UnloadLibrary="unload-library",t.CheckLibraryLoadedQuery="check-library-loaded-query",t.CheckLibraryLoadedResponse="check-library-loaded-response",t}({}),hy=L()(ay=function(t,e){return _(fn)(t,void 0,0)}(ay=function(t,e){return _(Un)(t,void 0,1)}(ay=function(t,e){return _(ba)(t,void 0,2)}(ay=function(t,e){return _(Ka)(t,void 0,3)}(ay=function(t,e){return _(Wi)(t,void 0,4)}(ay=function(t,e){return _(yc)(t,void 0,5)}(ay=function(t,e){return _($c)(t,void 0,6)}(ay=Reflect.metadata("design:type",Function)(ay=Reflect.metadata("design:paramtypes",["undefined"==typeof ILibrarySessionService?Object:ILibrarySessionService,"undefined"==typeof ITouchProcessorService?Object:ITouchProcessorService,"undefined"==typeof IScrollProcessorService?Object:IScrollProcessorService,"undefined"==typeof IVisitorActivityService?Object:IVisitorActivityService,"undefined"==typeof IActionService?Object:IActionService,"undefined"==typeof IDataReporterService?Object:IDataReporterService,"undefined"==typeof IContentService?Object:IContentService])(ay=function(){function t(e,r,n,o,i,a,c){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.librarySessionService=e,this.touchProcessorService=r,this.scrollProcessorService=n,this.visitorActivityService=o,this.actionService=i,this.dataReporterService=a,this.contentService=c,this.handleCustomEvent=this.handleCustomEvent.bind(this)}var e,r,n;return e=t,(r=[{key:"startListenEvent",value:function(){window.addEventListener("emaww22-custom-event",this.handleCustomEvent)}},{key:"stopListenEvent",value:function(){window.removeEventListener("emaww22-custom-event",this.handleCustomEvent)}},{key:"handleCustomEvent",value:function(t){switch(t.detail.type){case py.UnloadLibrary:this.handleUnloadLibraryEvent();break;case py.CheckLibraryLoadedQuery:this.handleCheckLibraryLoadedQueryEvent()}}},{key:"handleCheckLibraryLoadedQueryEvent",value:function(){var t=new CustomEvent("emaww22-custom-event",{detail:{type:py.CheckLibraryLoadedResponse}});window.dispatchEvent(t)}},{key:"handleUnloadLibraryEvent",value:function(){this.touchProcessorService.unload(),this.scrollProcessorService.unload(),this.librarySessionService.unload(),this.visitorActivityService.unload(),this.actionService.unload(),this.dataReporterService.unload(),this.contentService.unload()}}])&&sy(e.prototype,r),n&&sy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||ay)||ay)||ay)||ay)||ay)||ay)||ay)||ay)||ay)||ay;function yy(t){return yy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yy(t)}function vy(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dy(n.key),n)}}function dy(t){var e=function(t,e){if("object"!==yy(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==yy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===yy(e)?e:String(e)}var my=L()(fy=function(t,e){return _(R)(t,void 0,0)}(fy=Reflect.metadata("design:type",Function)(fy=Reflect.metadata("design:paramtypes",["undefined"==typeof IVisitorService?Object:IVisitorService])(fy=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.visitorService=e,this.handleResizeEvent=this.handleResizeEvent.bind(this),this.resizeObserverCallback=this.resizeObserverCallback.bind(this)}var e,r,n;return e=t,(r=[{key:"startListenEvent",value:function(){window.addEventListener("resize",this.handleResizeEvent),t.resizeObserver=new ResizeObserver(this.resizeObserverCallback),t.resizeObserver.observe(document.body)}},{key:"stopListenEvent",value:function(){window.removeEventListener("resize",this.handleResizeEvent),t.resizeObserver.disconnect()}},{key:"resizeObserverCallback",value:function(t,e){this.handleResizeEvent(new UIEvent("resize"))}},{key:"handleResizeEvent",value:function(t){this.visitorService.handleResizeEvent(t)}}])&&vy(e.prototype,r),n&&vy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())||fy)||fy)||fy)||fy;function gy(t){return gy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gy(t)}function by(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */by=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function p(){}function h(){}function y(){}var v={};u(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(I([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==gy(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y,n(g,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:h,configurable:!0}),h.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function wy(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Sy(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){wy(i,n,o,a,c,"next",t)}function c(t){wy(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Ey(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ty(n.key),n)}}function Ty(t){var e=function(t,e){if("object"!==gy(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==gy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===gy(e)?e:String(e)}var Py=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.buildLibIocContainer(),this.visitorService=x.resolve(R),this.librarySessionService=x.resolve(fn),this.pageVisitService=x.resolve(hi),this.actionService=x.resolve(Wi),this.touchProcessorService=x.resolve(Un),this.scrollProcessorService=x.resolve(ba),this.visitorActivityService=x.resolve(Ka),this.dataReporterService=x.resolve(yc),this.contentService=x.resolve($c),this.iphoneCompatibilityService=x.resolve(Io),this.handleUnloadEvent=this.handleUnloadEvent.bind(this),t.applicationPublicId=this.getTokenQuery()}var e,r,n,o,i,a,c;return e=t,r=[{key:"buildLibIocContainer",value:function(){Nh(),Au(),x.register(zh,{useClass:zh}),x.register(Fh,{useClass:Fh}),x.register(Jh,{useClass:Jh}),x.register(ry,{useClass:ry}),x.register(cy,{useClass:cy}),x.register(hy,{useClass:hy}),x.register(my,{useClass:my})}},{key:"init",value:(c=Sy(by().mark((function e(){return by().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!window.aww22_pageMonitorStarted){e.next=3;break}return console.warn("EMAWW Library already started"),e.abrupt("return");case 3:return window.aww22_pageMonitorStarted=!0,e.next=6,t.checkIfLoaded();case 6:if(!e.sent){e.next=9;break}return e.abrupt("return");case 9:return e.next=11,this.load();case 11:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"load",value:(a=Sy(by().mark((function e(){return by().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.applicationPublicId){e.next=2;break}throw new Error("Application public id is missing");case 2:return e.next=4,this.librarySessionService.load(t.applicationPublicId);case 4:return e.next=6,this.visitorActivityService.load();case 6:return e.next=8,this.pageVisitService.load();case 8:return e.next=10,this.visitorService.load();case 10:return e.next=12,this.touchProcessorService.load();case 12:return e.next=14,this.dataReporterService.load();case 14:return e.next=16,this.actionService.load();case 16:return e.next=18,this.scrollProcessorService.load();case 18:this.contentService.load(),this.iphoneCompatibilityService.load(),this.startListenEvent();case 21:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"handleUnloadEvent",value:(i=Sy(by().mark((function t(){return by().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.scrollProcessorService.unload(),this.librarySessionService.unload(),this.pageVisitService.unload(),this.visitorActivityService.unload(),this.actionService.unload(),this.contentService.unload(),this.iphoneCompatibilityService.unload(),this.touchProcessorService.unload(),this.visitorService.unload(),this.dataReporterService.unload();case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"startListenEvent",value:function(){var t=x.resolve(zh),e=x.resolve(Fh),r=x.resolve(Jh),n=x.resolve(ry),o=x.resolve(cy),i=x.resolve(hy),a=x.resolve(my);t.startListenEvent(),e.startListenEvent(this.handleUnloadEvent),n.startListenEvent(),r.startListenEvent(),o.startListenEvent(),i.startListenEvent(),a.startListenEvent()}},{key:"stopListenEvent",value:function(){var t=x.resolve(zh),e=x.resolve(Fh),r=x.resolve(Jh),n=x.resolve(ry),o=x.resolve(cy),i=x.resolve(hy),a=x.resolve(my);t.stopListenEvent(),e.stopListenEvent(),n.stopListenEvent(),r.stopListenEvent(),o.stopListenEvent(),i.stopListenEvent(),a.stopListenEvent()}},{key:"getTokenQueryV2",value:function(){var t;try{var e=document.getElementsByTagName("script"),r=Array.from(e).find((function(t){return t.text.includes("fetch('https://awwtag.emaww.com/js?token=")}));r&&(t=r.text.split("https://awwtag.emaww.com/js?token=")[1].split("',{")[0])}catch(t){console.error(t)}return t}},{key:"getTokenQuery",value:function(){var e,r;if(t.applicationPublicId)return t.applicationPublicId;var n=null===(e=document.currentScript)||void 0===e?void 0:e.getAttribute("src");if(!(r=n?new URL(n,window.location.href).searchParams.get("token"):this.getTokenQueryV2()))throw new Error("Token is missing");return t.applicationPublicId=r,r}}],n=[{key:"checkIfLoaded",value:(o=Sy(by().mark((function e(){return by().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){if(t.isLibraryLoaded)e(!0);else{window.addEventListener("emaww22-custom-event",(function(r){r.detail.type===py.CheckLibraryLoadedResponse&&(t.isLibraryLoaded=!0,e(!0))}));var r=new CustomEvent("emaww22-custom-event",{detail:{type:py.CheckLibraryLoadedQuery}});window.dispatchEvent(r),setTimeout((function(){e(!1)}),300)}})));case 1:case"end":return e.stop()}}),e)}))),function(){return o.apply(this,arguments)})}],r&&Ey(e.prototype,r),n&&Ey(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();!function(t,e,r){(e=Ty(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(Py,"isLibraryLoaded",!1),(new Py).init().then((function(){console.info("EMAWW Library ".concat(gr.awwBuildVersion))}))})(),n})()));