!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("fedopsLogger",[],e):"object"==typeof exports?exports.fedopsLogger=e():t.fedopsLogger=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="https://static.parastorage.com/services/fedops-logger/5.69.0/",n(n.s=26)}([function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a}));var r={},o=function(){return"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:void 0!==t?t:"undefined"!=typeof WorkerGlobalScope?WorkerGlobalScope:r};function i(){return"undefined"!=typeof navigator&&navigator&&navigator.sendBeacon}function a(t){return navigator.sendBeacon(t)}}).call(this,n(12))},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return s})),n.d(e,"d",(function(){return u})),n.d(e,"e",(function(){return c}));var r=n(0);function o(t){return((Object(r.a)().fedops||{}).apps||{})[t]}function i(){Object(r.a)().fedops=Object(r.a)().fedops||{},Object(r.a)().fedops.apps=Object(r.a)().fedops.apps||{}}function a(t){i(),function(t){Object(r.a)().fedops.apps[t]=Object(r.a)().fedops.apps[t]||{}}(t)}function s(t){return(o(t)||{}).startLoadTime||0}function u(t,e){return(o(t)||{}).startLoadTime=e}function c(t){return(Object(r.a)().fedops||{}).sessionId=t}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i}));var r={policy:"getCurrentConsentPolicy",header:"_getConsentPolicyHeader",isMethod:!0},o={policy:"consentPolicy",header:"consentPolicyHeader",isMethod:!1},i={essential:!0,dataToThirdParty:!0,advertising:!0,functional:!0,analytics:!0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getGlobal=e.getWindowIfTop=e.isBackoffice=e.isWebWorker=e.getHost=e.setHost=void 0;var r,o,i=n(8);function a(t){if("undefined"!=typeof window&&window)try{return window.top===window.self?t?t(window):window:null}catch(t){return null}return null}function s(t,e){return void 0===e&&(e=null),"undefined"!=typeof self&&self&&t(self)||e}e.setHost=function(t){r=t},e.getHost=function(t){return void 0===t&&(t=i.DefaultBrand),r||(void 0===o&&(o=s((function(t){return t.location&&t.location.hostname&&(t.location.hostname.match(/\.(wix|editorx)\.com$/)||[])[1]||null}),null)),"frog."+(o||i.BrandToHostMap[t]||i.BrandToHostMap[i.DefaultBrand])+".com")},e.isWebWorker=function(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope},e.isBackoffice=function(){return a((function(t){var e=t.document;return i.BackofficeDomains.some((function(t){return-1!==e.location.host.indexOf(t)}))}))},e.getWindowIfTop=a,e.getGlobal=s},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return c}));var r,o=n(2);function i(){return window}function a(){return self}function s(){return t}function u(){return globalThis}function c(t){var e;void 0===t&&(t=void 0),t&&(r=t),r||t||([u,s,a,i].forEach((function(t){try{r||(r=t())}catch(t){}})),r=r);try{"object"==typeof r.commonConfig&&r.commonConfig.consentPolicy&&(e=d(r.commonConfig,o.c)),e||"object"!=typeof r.consentPolicyManager||(e=d(r.consentPolicyManager,o.b)),e||"object"!=typeof r.Wix||"object"!=typeof r.Wix.Utils||"function"!=typeof r.Wix.Utils.getCurrentConsentPolicy||(e=d(r.Wix.Utils,o.b))}catch(t){}return e}function d(t,e){return{getCurrentConsentPolicy:function(){var n=t[e.policy];return e.isMethod?n():n},_getConsentPolicyHeader:function(){var n=t[e.header];return e.isMethod?n():n},deleteReference:!e.isMethod}}}).call(this,n(12))},function(t,e,n){"use strict";var r="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};var o=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.name=n.constructor.name,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,Error),e}();t.exports.defined=function(t,e){if(void 0===t)throw new o(e)},t.exports.object=function(t,e){if(void 0!==t&&("object"!==(void 0===t?"undefined":r(t))||Array.isArray(t)||null===t))throw new o(e)},t.exports.ok=function(t,e){if(!t)throw new o(e)},t.exports.func=function(t,e){if(void 0!==t&&"function"!=typeof t)throw new o(e)},t.exports.boolean=function(t,e){if(void 0!==t&&"boolean"!=typeof t)throw new o(e)},t.exports.number=function(t,e){if(void 0!==t&&"number"!=typeof t)throw new o(e)},t.exports.AssertionError=o},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.APINotSupportedError=e.AssertionError=void 0;var i=function(t){function e(e){var n=t.call(this,e)||this;return n.name=n.constructor.name,n}return o(e,t),e}(Error);e.AssertionError=i;var a=function(t){function e(e){var n=t.call(this,e)||this;return n.name=n.constructor.name,n}return o(e,t),e}(Error);e.APINotSupportedError=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.readCookie=e.sendBeacon=e.getWindowSize=e.getDesktopSize=e.now=void 0,e.now=function(){return"undefined"!=typeof performance&&performance&&performance.now?performance.now():-1},e.getDesktopSize=function(t){return(t.screen&&t.screen.width||0)+"x"+(t.screen&&t.screen.height||0)},e.getWindowSize=function(t){var e=0,n=0;return t.innerWidth?(e=t.innerWidth,n=t.innerHeight):t.document&&(t.document.documentElement&&t.document.documentElement.clientWidth?(e=t.document.documentElement.clientWidth,n=t.document.documentElement.clientHeight):t.document.body&&t.document.body.clientWidth&&(e=t.document.body.clientWidth,n=t.document.body.clientHeight)),e+"x"+n},e.sendBeacon=function(t,e){return!("undefined"==typeof navigator||!navigator||!navigator.sendBeacon)&&navigator.sendBeacon(t,e)},e.readCookie=function(t){if("undefined"==typeof document)return null;for(var e=0,n=document.cookie.split(";");e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(t,["src","evid","params"]);return this.log(r({src:e,evid:n},o),a)}},{key:"log",value:function(t,e,n){var o=this;i.defined(t,"Event object or event key must be provided.");var a=this._extractEventAndContext(t,e,n),s=a.event,u=a.context,c=m(this._consentPolicyGetter),d=r({},this._context,u);if(this._isMuted()||h(c,d.category))return Promise.resolve();if(d.useBatch){var p=this._initBuffer(d,c),f=r({},this._getDynamicDefaults(this._defaults),this._getDynamicNonEssentialDefaults(c),s,this._getPolicyFields(c,d.category)),l=this._eventTransformer(f,d);return p.feed(l,d)}return this._getDefaults(this._defaults).then((function(t){var e=Object.assign(t,o._getDynamicNonEssentialDefaults(c),o._getStaticNonEssentialDefaults(c),s,o._getPolicyFields(c,d.category));if(!(0===o._validators.length||o._validators.some((function(t){return t.match(e)&&(t.execute(e)||!0)}))))throw new Error("No validator accepted the event. Source: "+e.src+" Evid: "+(e.evid||e.evtId));var n=o._eventTransformer(e,d);return n=o._payloadTransformer(n,d),o._send(n,d)}))}},{key:"flush",value:function(){return this._buffer?this._buffer.flush():Promise.resolve()}},{key:"_send",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Promise.all(this._publishers.map((function(o){var i=r({},t);return Promise.resolve().then((function(){return o(i,n)})).catch((function(n){return e._onPublisherFailHandler(n,{publisherName:o.name,payload:t})}))}))).then((function(){}))}},{key:"_extractEventAndContext",value:function(t,e,n){var o=void 0,a={};if("string"!=typeof t)o=t,a=e||a;else{if(!(o=this._events[t]))throw new i.AssertionError("Event with key '"+t+"' not found in event map.");e&&(o=r({},o,e),a=n||a)}return{event:o,context:a}}},{key:"_initBuffer",value:function(t,e){var n=this;return this._buffer||(this._buffer=new p(!0===t.useBatch?300:t.useBatch,this._maxBatchSize).onFlush((function(r){r.g=Object.assign(n._getStaticDefaults(n._defaults),n._getStaticNonEssentialDefaults(e));var o=n._payloadTransformer(r,t);return n._send(o,t)})))}},{key:"_handleDefaultsError",value:function(t){return this._defaultContinueOnFail?(d.error(t),null):Promise.reject(t)}},{key:"_getDynamicNonEssentialDefaults",value:function(t){if(!l(t))return this._getDynamicDefaults(this._nonEssentialDefaults)}},{key:"_getStaticNonEssentialDefaults",value:function(t){if(!l(t))return this._getStaticDefaults(this._nonEssentialDefaults)}},{key:"_getDynamicDefaults",value:function(t){var e=u(t,(function(t){return"function"==typeof t}));return s(e,(function(t){return t()}))}},{key:"_getStaticDefaults",value:function(t){return u(t,(function(t){return"function"!=typeof t}))}},{key:"_getDefaults",value:function(t){var e=this;if(!t)return Promise.resolve({});var n=s(t,(function(t,n){if("function"==typeof t)try{t=t()}catch(t){return e._handleDefaultsError(t)}return t&&"function"==typeof t.then?c.timedPromise(t,{message:"Cannot get default value '"+n+" for BI Event'",timeout:e._defaultValueTimeout}).catch((function(t){return e._handleDefaultsError(t)})):t}));return c.allAsObject(n)}},{key:"_encodePolicyValue",value:function(t,e){return t?"boolean"==typeof t[e]?t[e]?1:0:t[e]:1}},{key:"_getPolicyFields",value:function(t,e){return{_isca:this._encodePolicyValue(t,"analytics"),_iscf:this._encodePolicyValue(t,"functional"),_ispd:t.__default?1:0,_ise:"essential"===e?1:0}}}],[{key:"_defaultPublisherFailHandler",value:function(t,e){return e.publisherName}}]),t}();t.exports=v},function(t,e,n){"use strict";var r=function(){function t(t,e){for(var n=0;n-1};function M(t,e){return(M=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var L={xmlhttprequest:{count:"countXhr",unsupported:"unsprtXhr",duration:"timeXhr",total:"sizeXhr",longest:"longXhr",http2:"h2Xhr"},script:{count:"countJs",unsupported:"unsprtJs",duration:"timeJs",total:"sizeJs",cached:"cachedJs",http2:"h2Js"},link:{count:"countCss",unsupported:"unsprtCss",duration:"timeCss",total:"sizeCss",cached:"cachedCss",http2:"h2Css"},img:{count:"countImg",unsupported:"unsprtImg",duration:"timeImg",total:"sizeImg",cached:"cachedImages",http2:"h2Images"},fetch:{count:"countFetch",unsupported:"unsprtFetch",duration:"timeFetch",total:"sizeFetch",cached:"cachedFetch",http2:"h2Fetch"},other:{count:"countOther",unsupported:"unsprtOther",duration:"timeOther",total:"sizeOther",cached:"cachedOther",http2:"h2Other"}},B={link:function(t){return/(.\.css$|.\.css?.)/g.test(t.name)}},R=function(t){return t.responseEnd-t.startTime};function H(t,e){var n=B[e];return t.filter((function(t){return e===t.initiatorType&&(!n||n(t))}))}function W(t){return!t.name.match(/http(s)?:\/\/frog.wix.com\//)}function V(t){return e=t.name,(n=N())&&-1===e.indexOf(n)&&0===t.transferSize&&0===t.requestStart;var e,n}function U(t){var e=t.filter((function(t){return!V(t)}));return Object.keys(L).reduce((function(n,r){var o=H(t,r),i=H(e,r),a=L[r];return n[a.count]=i.length,n[a.duration]=function(t){if(0===t.length)return 0;var e={startTime:1/0,responseEnd:0};return t.forEach((function(t){e.startTime>t.startTime&&(e.startTime=t.startTime),e.responseEnd=R(t)?e:t}));return R(e)}(i)),a.cached&&(n[a.cached]=function(t){if(0===t.length)return 0;var e=t.filter((function(t){return 0===t.transferSize}));return Math.round(e.length/t.length*100)}(i)),n}),{})}function z(t){return{url:t.name,downloadDuration:t.responseEnd-t.startTime,bytesTransferred:t.transferSize,isHTTP2:"h2"===t.nextHopProtocol}}var G=function(t){var e,n;function r(){return t.apply(this,arguments)||this}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,M(e,n),r.prototype.performNetworkAnalysis=function(t){if(0===t.length)return null;var e=S(),n=t.filter(W),r=U(n);r.overhead=S()-e;var o=function(t){return Object.keys(t).reduce((function(e,n){var r=parseInt(t[n]);return isNaN(r)||"number"!=typeof r||(e[n]=r),e}),{})}(r);if(console.debug&&A()){var i=function(t){var e=t.reduce((function(t,e){return V(e)?t.unsupported.push(e):t.supported.push(e),t}),{supported:[],unsupported:[]});return Object.keys(L).reduce((function(t,n){return t[n]={},t[n].supported=H(e.supported,n).map((function(t){return z(t)})),t[n].unsupported=H(e.unsupported,n).map((function(t){return z(t)})),t}),{})}(n);console.debug("[fedops network analysis] [bytes analysis]\n"+JSON.stringify(o,null,4)),console.debug("[fedops network analysis] [resources breakdown]\n",i)}return o},r}(F),J=Object.keys(L).reduce((function(t,e){return t.concat(Object.values(L[e]))}),[]),q=function(){function t(t){var e=this;void 0===t&&(t=null),this.items=[],t&&(void 0===t.length?[t]:t).forEach((function(t){return e.addItem(t)}))}var e=t.prototype;return e.clone=function(){return new t(this.items.slice())},e.addItem=function(t){return this.items.push(t instanceof F?t:new F(t)),this},e.mergeItems=function(){for(var t={},e=0;e=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function st(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ot(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);no&&t.startTime+t.duration0){var r=JSON.stringify(e);t.addItem(this.dataItems.customParams(r))}},o.appLoaded=function(e){var n=void 0===e?{}:e,r=n.appId,o=n.customParams,i=n.paramsOverrides;if(!(r&&this._appLoadedCalled[r]||!r&&this._appLoadedCalled[this.appName])){t._clearLoadTimeout(),t._markAndMeasureAppLoad(this.appName),this._appLoadedCalled[r||this.appName]=!0,this._sendLastAppLoadPhaseIfNeeded(),this.reportNetworkAnalysis({appId:r});var a=this.dataSource.addItem(this.dataItems.biAppLoadFinish()).addItem(this.dataItems.appContext({appId:r||this.appId,widgetId:this.widgetId,isServerSide:this.isServerSide})).addItem(this.dataItems.duration(this._times.getAppLoadTime({appId:r})).setFirstRequestDuration(this._times.getFirstRequestDuration())).addItem(this._getDataItemWithDefaultParamsOverrides({appName:r})).addItem(this.dataItems.dataItem(i));return r&&this._changeAppNameForEvent(a,r),this._shouldAddCustomParams(o)&&this._addCustomParamsToEvent(a,o),this._report(a,this._getEndpoint())}},o.appLoadingPhaseStart=function(t,e){var n=void 0===e?{}:e,r=n.appId,o=n.widgetId,i=n.paramsOverrides;this.loadingPhases.createCodeParsingPhaseIfNotExist({appId:r,widgetId:o}),this.loadingPhases.saveLoadingPhase({name:t,appId:r,widgetId:o}),this._sendPreviousPhaseIfNeeded(t,{appId:r,widgetId:o,paramsOverrides:i}),T("[fedops] "+t+" started"),T("[fedops] phase:"+t+" "+r+(o?" "+o:"")+" started");var a=this.dataSource.addItem(this.dataItems.biLoadPhaseStart()).addItem(this.dataItems.appContext({appId:r,widgetId:o})).addItem(this.dataItems.loadingPhaseStart({name:t})).addItem(this._getDataItemWithDefaultParamsOverrides({appName:r})).addItem(this.dataItems.dataItem(i));r&&this._changeAppNameForEvent(a,r),this._report(a,this._getEndpoint())},o._changeAppNameForEvent=function(t,e){t.addItem(this.dataItems.appName({appName:e,isServerSide:this.isServerSide}))},o._sendPreviousPhaseIfNeeded=function(t,e){var n=void 0===e?{}:e,r=n.appId,o=n.widgetId,i=n.paramsOverrides,a=this.loadingPhases.getPhasePreviousTo({name:t,appId:r,widgetId:o});if(this.phasesConfig===dt.SEND_ON_START||a&&"code-parsing-phase"===a.name){T("[fedops] "+a.name+" finished");var s=this.dataItems.loadingPhaseFinish(a),u=this.dataItems.biLoadPhaseFinish(),c=this.dataItems.dataItem(i),d=this.dataSource.addItem(s).addItem(u).addItem(this._getDataItemWithDefaultParamsOverrides({appName:r})).addItem(c);this._report(d)}},o.appLoadingPhaseFinish=function(t,e){var n=void 0===e?{}:e,r=n.appId,o=n.widgetId,i=n.widgetArray,a=n.paramsOverrides;if(this.phasesConfig===dt.SEND_ON_START)throw new Error('To use appLoadingPhaseFinish you must use "phasesConfig: SEND_START_AND_FINISH" setting');T("[fedops] "+t+" finished"),T("[fedops] phase:"+t+" "+r+(o?" "+o:"")+" finished");var s=this.loadingPhases.getAppLoadingPhaseData({name:t,appId:r,widgetId:o});if(!s)throw new Error("Cannot report end of a phase that wasn't started. Phase "+t+" doesn't exist");var u=this.dataItems.loadingPhaseFinish(s),c=this.dataItems.biLoadPhaseFinish(),d=this._getDataItemWithDefaultParamsOverrides({appName:r}),p=this.dataItems.dataItem(a),f=this.dataItems.appContext({appId:r,widgetId:o,widgetArray:i,isServerSide:this.isServerSide}),h=this.dataSource.addItem(u).addItem(c).addItem(f).addItem(d).addItem(p);return r&&this._changeAppNameForEvent(h,r),this._report(h,this._getEndpoint())},o._getEndpoint=function(){return this.isPersistent?this._preset.persistentEndpoint:this._preset.nonPersistentEndpoint},o._getDataItemWithDefaultParamsOverrides=function(t){var e=(void 0===t?{}:t).appName,n=void 0===e?null:e;return this.dataItems.dataItem(yt(yt({},this._cookiesParamsOverrides.getCookieOverridesForApp(n||this.appName)),this._constructorParamsOverrides))},o._sendLastAppLoadPhaseIfNeeded=function(){var t=this.loadingPhases.getNextPhaseToReport();this.phasesConfig===dt.SEND_ON_START&&t&&"code-parsing-phase"!==t.name&&this._report(this.dataSource.addItem(this.dataItems.loadingPhaseFinish(t)).addItem(this.dataItems.biLoadPhaseFinish()))},t._clearLoadTimeout=function(){Object(g.a)()&&Object(g.a)().fedops&&"function"==typeof Object(g.a)().fedops.clearLoadTimeout&&Object(g.a)().fedops.clearLoadTimeout()},o.clearResourceTimings=function(){w()},t._markAppLoadStarted=function(t){T("[fedops] "+t+" app-load-started")},t._markAndMeasureAppLoad=function(t){T("[fedops] "+t+" app-loaded");try{x("[fedops] "+t+" app-loaded","[fedops] "+t+" app-load-started","[fedops] "+t+" app-loaded")}catch(t){}},o._markInteractionStarted=function(t){T("[fedops] "+this.appName+" interaction "+t+" started")},o._markAndMeasureInteractionEnded=function(t,e){if(e){T("[fedops] "+this.appName+" interaction "+t+" ended");try{x("[fedops] "+t+" duration","[fedops] "+this.appName+" interaction "+t+" started","[fedops] "+this.appName+" interaction "+t+" ended")}catch(t){}}},o.interactionStarted=function(t,e){var n=this,r=void 0===e?{}:e,o=r.timeOverride,i=r.interactionTimeout,a=r.startHook,s=r.timeoutHook,u=r.customParams,c=r.paramsOverrides;this._markInteractionStarted(t);var d=this.dataSource.addItem({name:t}).addItem(this.dataItems.biInteractionStart()).addItem(this._getDataItemWithDefaultParamsOverrides()).addItem(this.dataItems.dataItem(c));return this._shouldAddCustomParams(u)&&this._addCustomParamsToEvent(d,u),this._outgoingInteractions[t]={timestamp:o||S(),timeout:i||this.interactionTimeout},this._report(d),Et(a||this.startHook,{name:t}),{timeoutId:function(){if(i||n.interactionTimeout)return setTimeout((function(){var e=n.dataSource.addItem({interactionName:t}).addItem({errorType:"timeout"}).addItem(n.dataItems.biError());n._report(e),Et(s||n.timeoutHook,{name:t,timeout:i||n.interactionTimeout})}),i||n.interactionTimeout)}()}},o.interactionEnded=function(t,e){var n=void 0===e?{}:e,r=n.timeOverride,o=n.timeoutId,i=n.endHook,a=n.customParams,s=n.paramsOverrides,u=this._outgoingInteractions[t];this._markAndMeasureInteractionEnded(t,u),o&&clearTimeout(o);var c=this._outgoingInteractions[t]||this._getInteractionFromWindowIfPresent(t),d=r||S(),p=c?Math.floor(d-c.timestamp):"";Et(i||this.endHook,{name:t,duration:p,timeout:this._outgoingInteractions[t]&&this._outgoingInteractions[t].timeout});var f=this.dataSource.addItem({name:t}).addItem({duration:p}).addItem(this.dataItems.biInteractionEnd()).addItem(this._getDataItemWithDefaultParamsOverrides()).addItem(this.dataItems.dataItem(s));this._shouldAddCustomParams(a)&&this._addCustomParamsToEvent(f,a),delete this._outgoingInteractions[t],this._report(f)},o._getInteractionsObjectFromWindow=function(){var t,e,n,r;return(null==(t=Object(g.a)())||null==(e=t.fedops)||null==(n=e.apps)||null==(r=n[this.appName])?void 0:r.interactions)||{}},o._getInteractionFromWindowIfPresent=function(t){return this._getInteractionsObjectFromWindow()[t]},o.flush=function(){this.reporter.flush()},o._handleBlackboxPerformance=function(){var t=this,e=Object(g.a)(),n=e[St];n&&this._handleBlackboxPerformanceEntries(e,n),e.addEventListener&&e.addEventListener(St,(function(n){var r=n.detail;return t._handleBlackboxPerformanceEntries(e,r)}))},o._handleBlackboxPerformanceEntries=function(t,e){var n=this;e.filter((function(t){return t.then})).forEach((function(e){e.then((function(e){switch(e.entryType){case"loaded":n._webVitalsLoadedPromise.resolve(e);break;case"first-input":n._webVitalsFirstInputPromise.resolve(e);break;case"page-transitions":case"crux-cls-s":return void(e.eventName&&t.addEventListener&&t.addEventListener(e.eventName,(function(t){var e=t.detail;return n._sendBlackboxMeasurement(e)})))}n._sendBlackboxMeasurement(e)}))}))},o._sendBlackboxMeasurement=function(t){var e=this.dataItems.biBlackbox(t);if(e){var n,r=this.dataItems.blackboxPerformance(t),o=(new q).addItem(e).addItem(r);"loaded"===t.entryType&&(n={useBatch:!1}),this._report(o,"bpm",n),"crux"===t.entryType&&this.flush()}},o.getLoggerForWidget=function(e){var n=e.appName,r=e.appId,o=e.widgetId,i=e.version,a=e.timeoutHook,s=e.startHook,u=e.endHook,c=e.useGlobalLogger,d=e.paramsOverrides,p=e.phasesConfig;return new t(n||r+"_"+o,i||this.getAppVersion(),c?this.reporter:y({biLoggerFactory:this.reporter._factory,preset:this._preset}),{isServerSide:this.isServerSide,appId:r,widgetId:o,sessionId:this.sessionId,phasesConfig:p||dt.SEND_ON_START,isPersistent:this.isPersistent,timeoutHook:a,startHook:s,endHook:u,customParams:this._customParams,presetType:this._presetType,paramsOverrides:yt(yt({},this._constructorParamsOverrides),d)})},o._getUnReportedErrorFlows=function(t){var e=this;return t.filter((function(t){return!e._firstErrorFiredInFlow[t]}))},o.reportErrorThrownOncePerFlow=function(){var t=this,e=this._getFlowsOfError(),n=this._getUnReportedErrorFlows(e);n.length&&n.forEach((function(e){t._firstErrorFiredInFlow[e]=!0;var n=t.dataSource.addItem({interactionName:e}).addItem(t.dataItems.biError());t._report(n)}))},o._errorHappenedInOneOfAppLoadFlows=function(){return this._errorHappenedInAppLoadFlow()||this._errorHappenedInAppLoadingPhasesFlow()},o._errorHappenedInAppLoadFlow=function(){var t=this._getAppLoadStartedIndication(),e=this._getAppLoadedIndication();return t&&!e},o._getAppLoadStartedIndication=function(){var t,e="[fedops] "+this.appName+" app-load-started",n=null==(t=j(e))?void 0:t[0],r=this._times.getLoadStartTime();return n||r},o._getAppLoadedIndication=function(){var t,e="[fedops] "+this.appName+" app-loaded";return(null==(t=j(e))?void 0:t[0])||this._appLoadedCalled[this.appName]},o._errorHappenedInAppLoadingPhasesFlow=function(t){for(var e,n=(void 0===t?{appId:this.appName}:t).appId,r=this._getAppLoadingPhaseMarksForApp({appId:n}),o=Pt(this._getPhaseNamesFromMarks(r));!(e=o()).done;){var i=e.value,a=this._getTimesOfPhase({phaseName:i,appPhasesMarks:r,appId:n}),s=a.startMarkTime,u=a.finishMarkTime;if(s&&!u)return!0}return!1},o._getFlowsOfError=function(){var t=this._errorHappenedInOneOfAppLoadFlows()?["app-load"]:[];return[].concat(t,this._getInteractionNamesWhereErrorHappened())},o._getInteractionNamesWhereErrorHappened=function(){var t=this._getInteractionNamesWhereErrorHappenedFromInstance();if(t.length)return t;var e=Object.keys(this._getInteractionsObjectFromWindow());return e.length?e:this._getInteractionNamesWhereErrorHappenedFromPerformanceMarks()},o._getInteractionNamesWhereErrorHappenedFromInstance=function(){return Object.keys(this._outgoingInteractions)},o._getInteractionNamesWhereErrorHappenedFromPerformanceMarks=function(){var e=this._getInteractionMarksOfCurrentApp();return t._getInteractionsThatDidntEndFromMarks(e)},o._getInteractionMarksOfCurrentApp=function(){var t=this;return O().reduce((function(e,n){var r=function(t){var e=Y.exec(t);if(e)return{appName:e[1],interactionName:e[2]}}(n.name);return r&&r.appName===t.appName&&(e[r.interactionName]=e[r.interactionName]||[],e[r.interactionName].push({startTime:n.startTime,name:n.name})),e}),{})},t._getInteractionsThatDidntEndFromMarks=function(e){var n=[];for(var r in e)if(e.hasOwnProperty(r)){var o=t._countStartedEndedInteractionMarks(e[r]),i=o.startedInteractions,a=o.endedInteractions;(!i&&!a||i-a!=0)&&n.push(r)}return n},t._countStartedEndedInteractionMarks=function(t){var e=0,n=0;return t.forEach((function(t){t.name.includes("started")?e++:t.name.includes("ended")&&n++})),{startedInteractions:e,endedInteractions:n}},o.registerPlatformTenants=function(t){this._platformTenantsPromise.resolve(t)},o._reportWebVitalsWhenAvailable=function(){var t=this;Promise.all([this._webVitalsLoadedPromise,this._platformTenantsPromise]).then((function(e){var n=e[0],r=e[1],o=n.cls,i=n.lcp;r.forEach((function(e){var n=t.dataSource.addItem(t.dataItems.webVitalsLoaded()).addItem(t.dataItems.appName({appName:e})).addItem({cls:o,lcp:i});t._report(n)}))})),Promise.all([this._webVitalsFirstInputPromise,this._platformTenantsPromise]).then((function(e){var n=e[0],r=e[1],o=n.delay;r.forEach((function(e){var n=t.dataSource.addItem(t.dataItems.webVitalsFirstInput()).addItem(t.dataItems.appName({appName:e})).addItem({fid:o});t._report(n)}))}))},e=t,(n=[{key:"dataSource",get:function(){return this.dataSourceBase.clone()}},{key:"sessionId",get:function(){return this.getParam("sessionId")},set:function(t){this.params.sessionId=t}}])&&wt(e.prototype,n),r&&wt(e,r),t}();function xt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function jt(t){for(var e=1;e0,"Max Batch Size must be higher than 0"),this._maxBatchSize=t,this}},{key:"withEventTransformer",value:function(t){return i.defined(t,"Event Transformer must be provided"),i.func(t,"Event Transformer must be a function"),this._eventTransformer=t,this}},{key:"withPayloadTransformer",value:function(t){return i.defined(t,"Payload Transformer must be provided"),i.func(t,"Payload Transformer must be a function"),this._payloadTransformer=t,this}},{key:"withConsentPolicyGetter",value:function(t){return i.defined(t,"Consent Policy Getter must be provided"),i.func(t,"Consent Policy Getter must be a function"),this._consentPolicyGetter=t,this}},{key:"logger",value:function(t){var e=this,n=new a({publishers:this._publishers,validators:this._validators,defaults:this._defaults,events:this._events,defaultValueTimeout:this._defaultValueTimeout,defaultContinueOnFail:this._defaultContinueOnFail,onPublisherFailHandler:this._onPublisherFailHandler,isMuted:function(){return e._isMuted},eventTransformer:this._eventTransformer,payloadTransformer:this._payloadTransformer,consentPolicyGetter:this._consentPolicyGetter,nonEssentialDefaults:this._nonEssentialDefaults,maxBatchSize:this._maxBatchSize},t);return s.manager.notifyLoggerCreated(n),n}}]),t}();t.exports=u},function(t,e,n){"use strict";t.exports.mapValues=function(t,e){return t?Object.keys(t).reduce((function(n,r){return n[r]=e(t[r],r,t),n}),{}):{}},t.exports.filterValues=function(t,e){return t?Object.keys(t).reduce((function(n,r){return e(t[r],r,t)&&(n[r]=t[r]),n}),{}):{}}},function(t,e,n){"use strict";t.exports.timedPromise=function(t,e){var n=e.message,r=e.timeout,o=new Promise((function(t,e){setTimeout(e,r,n?"Timeout: "+n:"Timeout")}));return Promise.race([t,o])},t.exports.allAsObject=function(t){var e=Object.keys(t);return Promise.all(e.map((function(e){return t[e]}))).then((function(t){return t.reduce((function(t,n,r){return t[e[r]]=n,t}),{})}))}},function(t,e,n){"use strict";t.exports={error:function(){var t;console&&console.error&&(t=console).error.apply(t,arguments)}}},function(t,e,n){"use strict";var r=function(){function t(t,e){for(var n=0;n