var CS_CONF={"isSMB":false,"projectId":4765,"status":1,"hostnames":["ikea.com"],"crossDomainTracking":0,"crossDomainSingleIframeTracking":0,"consentRequired":1,"allowSubdomains":1,"visitorCookieTimeout":34164000000,"sampleRate":20,"replayRecordingRate":1,"validationRate":10,"lastTrackingDraw":1604929575,"trackerDomain":"c.contentsquare.net","recordingDomain":"r.contentsquare.net","useMalkaPipeline":1,"ed":"l.contentsquare.net/log/web","eMerchandisingEnabled":0,"mouseMoveHeatmapEnabled":1,"autoInsightsEnabled":0,"jsErrorsEnabled":0,"customErrorsEnabled":0,"jsCustomErrorsEnabled":0,"apiErrorsEnabled":0,"customHashIdEnabled":0,"recordingEncryptionEnabled":0,"recordingEncryptionPublicKey":null,"recordingEncryptionPublicKeyId":0,"secureCookiesEnabled":0,"triggerSessionReplayEnabled":0,"triggerSessionReplayRegex":null,"dynamicIdRegex":null,"whitelistedAttributes":[],"replayRecordingUnmaskedUrlRegex":null,"replayRecordingUnmaskedUrlRegexRules":[],"replayRecordingMaskedUrlRegexRules":[],"replayRecordingMaskedUrlRegex":null,"anonymisationMethod":"replayRecordingUnmaskedUrlRegex","tagDeploymentMode":"CONTENTSQUARE","experimental":null,"iframesTracking":0,"textVisibilityEnabled":0,"cookielessTrackingEnabled":0,"malkaUrlEnabled":0,"malkaEtrEnabled":0,"pathComputationRules":{},"asyncSerializerEnabled":1,"pendingInactivityTimeout":5000,"accessibilityEnabled":0,"uxaDomain":"app.contentsquare.com","webviewsTrackingEnabled":0,"useStaticResourceManager":1,"performanceTimingOptions":{"withResource":false,"withNavigation":false},"replayConsentRequiredForSession":0,"eventsApiEnabled":0,"clickedElementTextEnabled":0,"collectHierarchy":0,"displayAdOptions":null,"taskSchedulerOptions":{"enabled":1},"malkaQuotaServiceDomain":"q-aeu1.contentsquare.net","malkaRecordingDomain":"k-aeu1.contentsquare.net","staticResourceManagerDomain":"srm.ba.contentsquare.net","voc":{"siteId":null,"enabled":0}}; ; (()=>{"use strict";var t={d:(s,e)=>{for(var i in e)t.o(e,i)&&!t.o(s,i)&&Object.defineProperty(s,i,{enumerable:!0,get:e[i]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,s)=>Object.prototype.hasOwnProperty.call(t,s),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};function e(t,s){let e;return window.Zone&&"function"==typeof window.Zone.__symbol__&&(e=t[window.Zone.__symbol__(s)]),e||(e=t[s]),e}t.r(s),t.d(s,{getRequestParameters:()=>yc});const i="undefined"==typeof window;const n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t.g?t.g:"undefined"!=typeof process?process:Function("return this")();const r="cs-native-frame",o={navigatorProperties:[{propertyName:"sendBeacon",binding:navigator}],nodeProperties:["childNodes","parentNode","nextSibling","firstChild"],elementProperties:["shadowRoot"],elementPropertiesValues:["matches","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector"],eventProperties:["target"],imageProperties:["src"],constructors:{Date:"csDate",JSON:"csJSON",Array:"csArray",String:"csString",URL:"csURL",MutationObserver:"csMutationObserver",screen:"csScreen",RegExp:"csRegExp"}};function h(t,s,e){const i=function(t,s){let e,i=t;for(;i&&!(e=Object.getOwnPropertyDescriptor(i,s));)i=Object.getPrototypeOf(i);return e}(t,s);if(!i)return function(){return this[s]};switch(e){case"get":return i.get;case"set":return i.set;case"value":return i.value}}function c(t){var s,i;Object.keys(o.constructors).forEach((s=>{window[o.constructors[s]]=t[s]instanceof Function&&null==t[s].prototype?t[s].bind(window):t[s]})),function(t){window.csquerySelector={1:t.Element.prototype.querySelector,9:t.Document.prototype.querySelector,11:t.DocumentFragment.prototype.querySelector},window.csquerySelectorAll={1:t.Element.prototype.querySelectorAll,9:t.Document.prototype.querySelectorAll,11:t.DocumentFragment.prototype.querySelectorAll}}(t),("Prototype"in window||/^((?!chrome|android).)*safari/i.test(navigator.userAgent))&&(window.csMutationObserver=null!==(i=null!==(s=e(window,"MutationObserver"))&&void 0!==s?s:window.WebKitMutationObserver)&&void 0!==i?i:window.MutationObserver),a("csNode",o.nodeProperties,t.Node.prototype,"get"),a("csElement",o.elementProperties,t.Element.prototype,"get"),a("csElement",o.elementPropertiesValues,t.Element.prototype,"value",!1),a("csHTMLImageElement",o.imageProperties,t.HTMLImageElement.prototype,"set"),a("csEvent",o.eventProperties,t.Event.prototype,"get"),a("csNavigator",o.navigatorProperties,t.navigator,"value")}function a(t,s,e,i,n=!0){s.forEach((s=>{const r="string"!=typeof s&&"binding"in s,o=r?s.propertyName:s;(n||o in e)&&(window[`${t+o}`]=h(e,o,i),r&&(window[`${t+o}`]=window[`${t+o}`].bind(s.binding)))}))}function u(t,s){window.CSProtectnativeFunctionsLogs=window.CSProtectnativeFunctionsLogs||{},window.CSProtectnativeFunctionsLogs[t]=s}if(window.csSetTimeout=e(window,"setTimeout"),window.csQueueMicrotask=e(window,"queueMicrotask"),window.csClearTimeout=e(window,"clearTimeout"),window.csSetInterval=e(window,"setInterval"),window.csClearInterval=e(window,"clearInterval"),(()=>{var t;let s=0;function e(t){return"cs$Symbol_"+t}function i(t){return e(t)+ ++s}i.for=e,window.csSymbol=null!==(t=window.Symbol)&&void 0!==t?t:i})(),!function(){try{const t=function(){const t=document.createElement("iframe");t.id=r,t.setAttribute("hidden",""),t.setAttribute("title","Intentionally blank"),t.setAttribute("sandbox","allow-same-origin");const s=document.createElement("cs-native-frame-holder");if(s.setAttribute("hidden",""),document.body.appendChild(s),Boolean(Element.prototype.attachShadow)){const e=s.attachShadow({mode:"closed"});return e.innerHTML=t.outerHTML,e.firstElementChild.contentWindow}return s.innerHTML=t.outerHTML,s.firstElementChild.contentWindow}();return!!t&&(window.CSPureWindow=t,c(window.CSPureWindow),!0)}catch(t){return u("Warning",`failed to copy references from pure iframe: ${t.message}`),!1}}())try{c(n)}catch(ah){u("Critical",`failed to copy references from window: ${ah.message}`)}function l(t){return d(csString.prototype.toLowerCase.call(t.localName))}function d(t){return csString.prototype.replace.call(t,/([#;&,.+*~':"!^$[\]()<=>|/%?@`{}\\ ])/g,"\\$1")}function f(t){return g(t)&&("number"==typeof t||t instanceof Number)&&!isNaN(t)}function v(t){return t===parseInt(t,10)}function m(t){return g(t)&&("string"==typeof t||t instanceof csString)}function p(t){return"boolean"==typeof t}function w(t){return"object"==typeof t}function g(t){return void 0!==t}function y(t){return g(t)&&null!==t}function E(t){return"function"==typeof t}function A(t){return t instanceof Element}function _(t){return t instanceof Error}function S(t){const s=t.length;for(let e=0;eG.call(t,s)))}const Q=[/\d{4}/,/^ember\d+$/],Y="data-cs-override-id",K="data-cs-dynamic-id";function J(t,s,e,i){const n=i.dynamicIdRegex||null,r=i.dynamicElementNameRegex;let o=l(t);if(r){r.test(t.localName)&&(o=csString.prototype.replace.call(o,r,"$1@"))}if(function(t,s){const e=X(t);return e&&csString.prototype.match.call(e,/^[\w-]+$/)&&tt(Y,e,s)}(t,e)){const s=X(t);return{hasUniqueIdentifier:!0,elementSelector:`${o}[${Y}="${s}"]`}}const h=function(t,s,e){if(!e.uniqueAttributes)return{success:!1};for(const i of e.uniqueAttributes){const e=t.getAttribute(i);if(null!==e){if(tt(i,e,s))return{attributeName:i,attributeValue:e,success:!0}}}return{success:!1}}(t,e,i);if(h.success)return{hasUniqueIdentifier:!0,elementSelector:`${o}#UA[${h.attributeName}="${h.attributeValue}"]`};const c=function(t,s,e){if(!e.uniqueCssSelectors)return;for(const i of e.uniqueCssSelectors)if(G.call(t,i)&&st(i,s))return i;return}(t,e,i);if(c)return{hasUniqueIdentifier:!0,elementSelector:`${o}#UCS[${c}]`};const a=function(t){const s=t.getAttribute("id");return s?d(s):s}(t);if(function(t,s,e,i){return s&&!function(t){return null!==X(t)}(t)&&!function(t,s,e){return t.hasAttribute(K)||function(t,s){let e=!1;t&&s&&(e=s.test(t));return t&&(csArray.prototype.some.call(Q,(s=>s.test(t)))||e)}(s,e)}(t,s,i)&&function(t,s){return t&&tt("id",t,s)}(s,e)}(t,a,e,n))return{hasUniqueIdentifier:!0,elementSelector:`${o}#${a}`};const u=function(t,s){if(!s.reliableSelectors)return;for(const e of s.reliableSelectors)if(G.call(t,e))return e;return}(t,i);if(u){const e=function(t,s,e){if(t===F||9===t.nodeType)return 0;let i=0,n=s.previousElementSibling;for(;n;)G.call(n,e)&&(i+=1),n=n.previousElementSibling;return i}(s,t,u);return{hasUniqueIdentifier:!1,elementSelector:`${o}[${u}](${e})`}}const f=function(t,s,e){if(t===F||9===t.nodeType)return 0;const i=e.dynamicElementNameRegex,n=!!(null==i?void 0:i.test(s.localName)),r=l(s);let o=0,h=s.previousElementSibling;for(;h;)(l(h)===r||n&&(null==i?void 0:i.test(h.localName)))&&!W(h,e.reliableSelectors)&&(o+=1),h=h.previousElementSibling;return o}(s,t,i);return{hasUniqueIdentifier:!1,elementSelector:`${o}:eq(${f})`}}function X(t){return t.getAttribute(Y)}function tt(t,s,e){try{return 1===window.csquerySelectorAll[e.nodeType].call(e,`[${t}="${s}"]`).length}catch(t){if("SyntaxError"!==t.name)throw t}return!1}function st(t,s){try{return 1===window.csquerySelectorAll[s.nodeType].call(s,t).length}catch(t){if("SyntaxError"!==t.name)throw t}return!1}function et(t,s,e){const i=csArray.prototype.shift.call(t);if(0===t.length)return it(i,e);const n=i,r=t[0],{elementSelector:o,hasUniqueIdentifier:h}=J(n,r,s,e);if(!e.fullPath&&h){return`${it(t[t.length-1],e)}${o}`}const c=et(t,s,e);return`${c?`${c}>`:""}${o}`}function it(t,s){if(t===F)return"|detached|";if(t.host){const{ancestors:e,selectionRoot:i}=H(t.host);return`${et(e,i,s)}|shadow-root|`}return 11===t.nodeType?"|fragment|":""}class nt{constructor(t){this.options=t,this.done=!1,this.path=null}getPath(){if(null===this.path)throw new Error("getPath was called before serializeElement");return this.path}isDone(){return this.done}}class rt extends nt{constructor(){super(...arguments),this.t=!1,this.i=!1,this.h=!1}u(t,s){return this.t&&!(null===s&&z(t))&&!(11===t.nodeType)&&!t.host}A(t){return!t.localName}serializeElement(t,s,e){var i;if(null!==(i=this.path)&&void 0!==i||(this.path=""),this.u(t,s))return;let n=!1;null===s&&z(t)&&(n=!0,this.done=!0);const r=this.i&&!this.options.fullPath?"":">",o=!!t.host;if(o&&this.path&&(this.path="|shadow-root|"+r+this.path,this.h=!0,this.t=!1,this.i=!1),!o&&null===s&&11===t.nodeType)return this.path="|fragment|"+r+this.path,void(this.done=!0);if(this.A(t))return;const h=null!=s?s:"detached",{elementSelector:c,hasUniqueIdentifier:a}=J(t,h,e,this.options);a&&(this.i=!0,this.t=!this.options.fullPath);const u=`${n?`|detached|${r}`:""}${this.t&&!a?"":c}`,l=!a&&this.i&&!this.options.fullPath?"":this.path&&!this.h?">":"";this.h=!1,this.path=`${u}${l}${this.path}`}}var ot,ht;function ct(t,s=lt.SHOW_ALL){const e=s|lt.SHOW_ELEMENT,i=[document.createTreeWalker(t,e,null,!1)];let n=at(t);n&&csArray.prototype.push.call(i,document.createTreeWalker(n,e,null,!1));let r=null;return{root:t,nextNode(){if(n){const t=n;return n=null,t}for(;i.length>0;){if(r){const t=r;return r=null,t}const t=i[i.length-1].nextNode();if(!t){csArray.prototype.pop.call(i);continue}const n=at(t);if(s<.SHOW_DOCUMENT_FRAGMENT&&n&&(r=n),n&&csArray.prototype.push.call(i,document.createTreeWalker(n,e,null,!1)),dt[t.nodeType]&s)return t}return null},visitAll(e){dt[t.nodeType]&s&&e(t);let i=this.nextNode();for(;i;)dt[i.nodeType]&s?(e(i),i=this.nextNode()):i=this.nextNode()},collectAll(t){const s=[];return this.visitAll((e=>csArray.prototype.push.call(s,t?t(e):e))),s}}}function at(t){return t&&D(t)?t.shadowRoot:null}const ut=null!==(ot=n.Node)&&void 0!==ot?ot:{},lt=null!==(ht=n.NodeFilter)&&void 0!==ht?ht:{},dt={2:lt.SHOW_ATTRIBUTE,4:lt.SHOW_CDATA_SECTION,8:lt.SHOW_COMMENT,11:lt.SHOW_DOCUMENT_FRAGMENT,9:lt.SHOW_DOCUMENT,10:lt.SHOW_DOCUMENT_TYPE,1:lt.SHOW_ELEMENT,[ut.ENTITY_NODE]:lt.SHOW_ENTITY,[ut.ENTITY_REFERENCE_NODE]:lt.SHOW_ENTITY_REFERENCE,[ut.NOTATION_NODE]:lt.SHOW_NOTATION,7:lt.SHOW_PROCESSING_INSTRUCTION,3:lt.SHOW_TEXT};let ft={debug(...t){},warn(...t){},implementation(...t){},error(...t){},critical(...t){},isPerfLoggingActive:()=>!1};const vt=t=>(s,e,i)=>{const n=(null==e?void 0:e.toString())||"",r=t||`${s.constructor&&s.constructor.name}.${n}`;if(i){const t=i.value;i.value=function(...s){return mt(r,t.bind(this))(...s)}}};function mt(t,s){return(...e)=>{try{const i=s(...e);return g(window.Promise)&&i instanceof window.Promise?i.then((t=>t),(s=>ft.error(_(s)?s:new Error(s),t))):i}catch(s){try{ft.error(_(s)?s:new Error(s),t)}catch{}}}}class pt{constructor(){this._=0}get length(){return this._}get isEmpty(){return!this.S}pushAll(t){for(let s=0;s=gt&&csArray.prototype.push.call(St,{mName:t,mDuration:+e.toFixed(2)}),csArray.prototype.pop.call(_t),0===_t.length&&(e>wt&&Et.push(St),St=[])}function It(t,s){return function(...e){if(!yt)return t.apply(this,e);Rt(s);const i=t.apply(this,e);return Tt(s),i}}const Pt=function(t){return function(s,e,i){const n=i.value;i.value=function(){if(!yt)return i.value=n,n.apply(this,arguments);Rt(t);const s=n.apply(this,arguments);return Tt(t),s}}};var bt,Vt,Ct;function kt(t){var s;const e=null!==(s=t.length)&&void 0!==s?s:0,i=new csArray(e);for(let s=0;scsArray.prototype.push.call(e,t))),e}function $t(t,s){if(t.length>=0){const e=t.length;for(let i=0;icsArray.prototype.push.call(e,s?[i,t]:t))),e}!function(t){t.isSupported=function(){return!!Element.prototype.attachShadow},t.getShadowRoot=function(t){return t&&D(t)?t.shadowRoot:null},t.getAllShadowHosts=It((function(t){return ct(t,NodeFilter.SHOW_DOCUMENT_FRAGMENT).collectAll((t=>t.host))}),"getAllShadowHosts")}(bt||(bt={})),function(t){function s(){const t=[i()];return document.documentElement&&csArray.prototype.push.call(t,document.documentElement.scrollHeight,document.documentElement.offsetHeight,document.documentElement.clientHeight),document.body&&csArray.prototype.push.call(t,document.body.scrollHeight,document.body.offsetHeight),Math.max(...t)}function e(){return document.documentElement.scrollWidth}function i(){return window.innerHeight}function n(){return window.innerWidth}function r(){const t=window.csScreen.width;return v(t)&&t>0?t:window.screen.width}function o(){const t=window.csScreen.height;return v(t)&&t>0?t:window.screen.height}t.documentHeight=s,t.documentWidth=e,t.windowHeight=i,t.windowWidth=n,t.screenWidth=r,t.screenHeight=o,t.windowOffsetX=function(){return window.pageXOffset},t.windowOffsetY=function(){return window.pageYOffset},t.getRequestParameters=function(){return{dw:`${e()}`,dh:`${s()}`,ww:`${n()}`,wh:`${i()}`,sw:`${r()}`,sh:`${o()}`}}}(Vt||(Vt={}));const Ft=null!==(Ct=n.Node)&&void 0!==Ct?Ct:Object;var Ht,zt;!function(t){const s="isConnected"in Ft.prototype?t=>t.isConnected:t=>!(t.ownerDocument&&t.ownerDocument.compareDocumentPosition(t)&t.DOCUMENT_POSITION_DISCONNECTED);t.forEachChild=function(t,s){for(let e=t;e;e=csNodenextSibling.apply(e))s(t)},t.isConnected=function(t){return s(t)},t.getAncestors=function(t,s){const e=[];for(const n of i(t,s))csArray.prototype.push.call(e,n);return e};const e=(t,s)=>{var e;return null!==(e=csNodeparentNode.apply(t))&&void 0!==e?e:s&&L(t)?t.host:null};function*i(t,s=!1){let i=t;for(;i;){yield i;const t=e(i,s);if(!t||t===i)break;i=t}}function n(s){var e;return s.parentElement?s.parentElement:t.getRootNode(s)?null===(e=t.getRootNode(s))||void 0===e?void 0:e.host:null}function r(t){var s,e;if(!1===(null===(s=t.checkVisibility)||void 0===s?void 0:s.call(t,{checkOpacity:!0,checkVisibilityCSS:!0})))return!0;if(!t.offsetParent){if(!t.getBoundingClientRect)return ft.warn(`SUP-11432: Element doesn't have getBoundingClientRect. Node: ${t instanceof Ft} Ctor: ${null===(e=null==t?void 0:t.constructor)||void 0===e?void 0:e.name}`),!1;const s=t.getBoundingClientRect();if(0==s.width&&0==s.height)return!0}const i=window.getComputedStyle(t);if(!i)return!0;var n;return"none"===i.display||"hidden"===i.visibility||"collapse"===i.visibility||"0"===i.opacity||"opacity(0)"===i.filter||"0px"===i.width&&"0px"===i.height||("transparent"===(n=i.color)||/^(rgba|hsla)\(\d+, \d+%?, \d+%?, 0\)$/.test(n))}function o(t){const s=t.getBoundingClientRect(),e=s.left+.5*s.width,i=s.top+.5*s.height;return h(document,e,i)}function h(s,e,i){const n=s.elementFromPoint(e,i);if(!n)return null;const r=bt.getShadowRoot(n);return r&&r!=t.getRootNode(document.body)&&r!==s?h(r,e,i):n}function c(t){const s=o(t);return null!==s&&(t===s||(a(t)?""!==t.textContent&&s.contains(t):t.contains(s)))}function a(t){return"span"===t.localName||"a"===t.localName||"b"===t.localName||"i"===t.localName||"button"===t.localName||"input"===t.localName||"label"===t.localName||"cite"===t.localName||"small"===t.localName||"strong"===t.localName||"code"===t.localName||"abbr"===t.localName||"em"===t.localName||"dfn"===t.localName||"time"===t.localName||"output"===t.localName||"object"===t.localName||"sub"===t.localName}t.findAncestor=function(t,s,i=!1){let n=t;for(;n;){if(s(n))return n;const t=e(n,i);if(!t||t===n)break;n=t}return null},t.walkUp=i,t.isDescendantOf=function s(e,i){if(e===i||i.contains(e))return!0;const n=t.getParentElement(e);return!(!n||n===e)&&s(n,i)},t.getParentElement=n,t.findAllElements=function(t,s=document){const e=kt(window.csquerySelectorAll[s.nodeType].call(s,t)),i=bt.getAllShadowHosts(s);for(const s of i){const i=bt.getShadowRoot(s);if(!i)continue;const n=kt(window.csquerySelectorAll[i.nodeType].call(i,t));csArray.prototype.push.call(e,...n)}return e},t.getRootNode=(()=>{if("getRootNode"in Ft.prototype)return(t,s)=>t.getRootNode(s);function t(e){const i=s(e);return L(i)?t(i.host):i}function s(t){return null!=csNodeparentNode.apply(t)?s(csNodeparentNode.apply(t)):t}return(e,i)=>"object"==typeof i&&Boolean(i.composed)?t(e):s(e)})(),t.isHiddenByCSS=r,t.areAncestorsHiddenByCSS=function t(s){if(r(s))return!0;const e=n(s);return null!=e&&t(e)},t.getTopAncestorHiddenByCSS=function(t){let s=null,e=t;do{if(!r(e))break;s=e}while(e=n(e));return s},t.getTopElement=o,t.getElementOnTop=function(s){if(!s.getBoundingClientRect)return null;const e=s.getBoundingClientRect(),i=e.x+e.width/2,n=e.y+e.height/2;return t.getTopElementFromPoint(document,i,n)},t.getTopElementFromPoint=h,t.isVisibleInDocument=function(t){return!function(t){const s=t.getBoundingClientRect();return s.right+Vt.windowOffsetX()<0||s.bottom+Vt.windowOffsetY()<0}(t)&&!r(t)&&!function(t){const s=o(t);return null!==s&&!t.contains(s)&&!s.contains(t)}(t)},t.isVisibleInViewportInForeground=function(t){return!r(t)&&c(t)},t.isInViewPort=c,t.getAttributeNS=function(t,s,e){const i=t.getAttributeNS(s,e);return""===i?t.hasAttributeNS(s,e)?i:null:i},t.isElementFocusable=function(t){return!!t.hasAttribute("tabIndex")||("true"===t.getAttribute("contentEditable")||(!(!P(t)||!t.hasAttribute("href"))||(!(!($(t)||k(t)||C(t)||(s=t,R(s)&&"button"===s.localName))||t.hasAttribute("disabled"))||!(!function(t){return R(t)&&"details"===t.localName}(t)&&!function(t){return R(t)&&"summary"===t.localName}(t)))));var s},t.isInlineElement=a}(Ht||(Ht={}));class Bt{constructor(t){this.T=t}run(t){const s=[...this.T];let e=Ht.getAncestors(t,!1),i=e[e.length-1];for(;s.length>0&&e.length>0;){const t=csArray.prototype.shift.call(e),n=e[0]||null;if(this.I(s,t,n,i),this.P(s),0===s.length)break;0===e.length&&t.host&&(e=Ht.getAncestors(t.host,!1),i=e[e.length-1])}}I(t,s,e,i){for(const n of t)n.serializeElement(s,e,i)}P(t){for(let s=0;s0))return;let e=this.V(t);e+=e.length>0?"|":"",this.path.length+e.length>this.options.hierarchyMaxLength?this.done=!0:this.path=e+this.path}V(t){if(!t.localName)return"";let s=`@${t.localName};`;return s+=this.C(t.id),t.classList&&(s+=this.N(csArray.from(t.classList))),t.attributes&&(s+=this.O(t)),s}C(t){return t?`#${t};`:""}N(t){return t.length>0?`.${csArray.prototype.join.call(csArray.prototype.sort.call(t),";.")};`:""}$(t,s){var e,i;return(null===(i=(e=this.options).isAttributeSensitive)||void 0===i?void 0:i.call(e,t,s))||-1!==csArray.prototype.indexOf.call(this.options.attributeIgnoreTokens,s)||O(t)&&-1===csString.prototype.indexOf.call(s,"data-")&&"aria-label"!==s||C(t)&&"value"===s}M(t,s){return this.options.useAnonymization&&!this.options.allWhitelistedAttributes.has(t)||s.length>this.options.attrMaxLength}L(t){const s={};for(const e of csArray.from(t.attributes))this.$(t,e.name)||(s[e.name]=e.value);return s}O(t){var s,e;if(null===(e=(s=this.options).isNodeSensitive)||void 0===e?void 0:e.call(s,t))return"";const i=Object.entries(this.L(t));return csArray.prototype.join.call(csArray.prototype.sort.call(csArray.prototype.map.call(csArray.prototype.filter.call(i,(([t])=>t.lengththis.M(t,s)?`[${t}]`:`[${t}=${s}]`))),";")+(i.length>0?";":"")}}!function(t){function s(t){return!!t&&"localName"in t&&"getAttribute"in t&&"hasAttribute"in t&&"parentNode"in t}function e(t){return t&&"jquery"in t&&1===t.length?t[0]:t}t.INVALID_ELEMENT="INVALID_ELEMENT",t.isValidElement=s,t.getElementPathAndHierarchy=function(i,n,r={fullPath:!1,dynamicIdRegex:null}){const o=e(i);if(o===document)return{path:"",hierarchy:""};if(!s(o))return{path:t.INVALID_ELEMENT,hierarchy:t.INVALID_ELEMENT};const h=new rt(r),c=new qt(n);return new Bt([h,c]).run(o),{path:h.getPath(),hierarchy:c.getPath()}},t.getElementPath=function(i,n={fullPath:!1,dynamicIdRegex:null}){const r=e(i);if(r===document)return"";if(!s(r))return t.INVALID_ELEMENT;const{ancestors:o,selectionRoot:h}=H(r);return et(o,h,n)},t.getElementPathAndFirstAnchorParent=function(i,n={fullPath:!1,dynamicIdRegex:null}){const r=e(i);if(r===document)return{path:"",firstAnchorParent:null};if(!s(r))return{path:t.INVALID_ELEMENT,firstAnchorParent:null};const{firstAnchorParent:o,ancestors:h,selectionRoot:c}=function(t){let s=t;const e=[s];let i=null;for(;null!==csNodeparentNode.apply(s);)null===i&&P(s)&&(i=s),csArray.prototype.push.call(e,csNodeparentNode.apply(s)),s=csNodeparentNode.apply(s);return z(s)&&csArray.prototype.push.call(e,F),{firstAnchorParent:i,ancestors:e,selectionRoot:s}}(r);return{path:et(h,c,n),firstAnchorParent:o}}}(zt||(zt={})),window.CSPathComputation=window.CSPathComputation||zt;const jt=Number.MAX_SAFE_INTEGER||9007199254740991;function Gt(){}function Zt(t,s){return 0===csString.prototype.lastIndexOf.call(t,s,0)}const Wt=34164e6,Qt={percentage:()=>Math.floor(1e4*Math.random())/100,boolean(t){return this.percentage()Math.floor(Math.random()*t)},Yt=csSymbol("cachedJson");const Kt=void 0!==window.Symbol?function(t){if(t[Yt])return t[Yt];if(csArray.isArray(t)){if(0===t.length)return"[]";let s="["+Kt(t[0]);for(let e=1;e-1?"staging":"production",this.performanceTimingOptions=t.performanceTimingOptions,this.replayConsentRequiredForSession=!!t.replayConsentRequiredForSession,this.isWebView=!1,t.displayAdOptions&&t.displayAdOptions.length&&(this.displayAdOptions=t.displayAdOptions),t.voc&&(this.voc={...t.voc,enabled:!!t.voc.enabled}),t.heapEnvironment&&(this.heapEnvironment=t.heapEnvironment),t.implementations&&t.implementations.length&&(this.implementations=t.implementations),this.eventsApiEnabled=!!t.eventsApiEnabled,this.anonymizeDigits=null!==(r=t.anonymizeDigits)&&void 0!==r?r:null,this.isHeapPresent=void 0!==window.heap,this.clickedElementTextEnabled=!!t.clickedElementTextEnabled,this.recordTargetingRules=null!==(o=t.recordTargetingRules)&&void 0!==o?o:[],this.paProxyDomainUri=t.paProxyDomainUri||null,this.emitRecordInfoEvents=0!=t.emitRecordInfoEvents,this.collectHierarchy=!!t.collectHierarchy}getTrackerUri(){return`${this.U()}://${this.trackerDomain}`}getSentryFileUri(){return`${this.U()}://${this.tagDomain}/uxa/smb/errors.js`}getSentryDSNUri(){return`https://f553e78fb58e051e51fe8074c4c6e73e@${this.loggerDomain}/4508608369131520`}getRecordingUri(){return`${this.U()}://${this.malkaRecordingDomain}`}getLegacyQuotaUri(){return`${this.U()}://${this.malkaQuotaServiceDomain}`}getLoggerUri(){return`${this.U()}://${this.loggerDomain}`}getMetricsUri(){return`${this.U()}://${this.loggerDomain}/metrics`}getStaticResourceManagerUri(){return`${this.U()}://${this.staticResourceManagerDomain}`}getQuotaUri(){return`${this.U()}://${this.dynamicConfDomain}/${this.projectId}.json`}isQuotaEnabled(){return this.isSMB&&!!this.dynamicConfDomain}getPaProxyDomainUri(){return`${this.U()}://${this.paProxyDomainUri}`}U(){return this.useHttps?"https":"http"}isProjectActive(){return 1===this.status}processOptionOverrides(t){t&&t.forEach&&t.forEach((([t,...s])=>{if("setOption"===t){const[t,e]=s;this.F(t,e)}}))}F(t,s){"trackerDomain"===t&&(this.trackerDomain=s),"loggerDomain"===t&&(this.loggerDomain=s),"malkaRecordingDomain"===t&&(this.malkaRecordingDomain=s),"malkaQuotaServiceDomain"===t&&(this.malkaQuotaServiceDomain=s),"staticResourceManagerDomain"===t&&(this.staticResourceManagerDomain=s),"minLogLevel"===t&&(this.minLogLevel=s),"useHttps"===t&&(this.useHttps=!!s),"isWebView"===t&&(this.isWebView=s)}D(t){return t?this.H(t):null}getRequestParameters(){return{pid:`${this.projectId}`}}updateDynamicFields(t,s){"emitDebugEvents"===t&&(this.emitDebugEvents=s),"minLogLevel"===t&&(this.minLogLevel=s)}H(t){try{const s=/^\/(.*)\/([gim]*)$/.exec(t);if(s){const[,t,e]=s;return new csRegExp(`^${t}$`,e)}return new csRegExp(`^${t}$`)}catch(t){return null}}isHeaderCollectionActive(){var t,s;return this.apiErrors.collectStandardHeaders||!!(null===(t=this.apiErrors.validCustomHeaders)||void 0===t?void 0:t.length)||!!(null===(s=this.apiErrors.plainCustomHeaders)||void 0===s?void 0:s.length)}isCsSideloadingHeap(){var t;return"cs_sideloads_heap"===(null===(t=this.heapEnvironment)||void 0===t?void 0:t.heap_tag_status)&&!this.isHeapPresent}isHeapSideloadsCs(){var t;return"heap_sideloads_cs"===(null===(t=this.heapEnvironment)||void 0===t?void 0:t.heap_tag_status)}isHeapSideloadsCsV5(){var t;return"heap_sideloads_cs"===(null===(t=this.heapEnvironment)||void 0===t?void 0:t.heap_tag_status)&&this.B()}isHeapSideloadsStartDataCollection(){if(this.isHeapSideloadsCs()){if(this.B())return!0;const t=(t=>{if(!Jt.test(t))return;const[s,e,i]=csArray.prototype.map.call(csString.prototype.split.call(t,"."),Number);return{major:s,minor:e,patch:!i||Number.isNaN(i)?0:i}})(this.getHeapVersion()||"");if(t&&4===t.major&&((t,s)=>((t,s)=>t.major!==s.major?t.major-s.major:t.minor!==s.minor?t.minor-s.minor:t.patch-s.patch)(t,s)>=0)(t,{major:4,minor:23,patch:5}))return!0}return!1}B(){var t;return"function"==typeof(null===(t=window.heap)||void 0===t?void 0:t.getUserId)}getHeapVersion(){var t,s,e,i,n,r;return"function"==typeof(null===(t=window.heap)||void 0===t?void 0:t.getConfig)&&(null===(i=null===(e=null===(s=window.heap)||void 0===s?void 0:s.getConfig())||void 0===e?void 0:e.sdk)||void 0===i?void 0:i.version)||(null===(r=null===(n=window.heap)||void 0===n?void 0:n.version)||void 0===r?void 0:r.heapJsVersion)||void 0}isCsCrosswritingHeap(){var t;return"cs_crosswrites_heap"===(null===(t=this.heapEnvironment)||void 0===t?void 0:t.heap_tag_status)}isClickedElementTextEnabled(){return this.isSMB||this.clickedElementTextEnabled}isNetworkDetailsEnabled(){return!!this.performanceTimingOptions&&(this.performanceTimingOptions.withResource||this.performanceTimingOptions.withNavigation)}hasTargetingRules(){var t;return!!(null===(t=this.recordTargetingRules)||void 0===t?void 0:t.length)}}class ts{constructor(t,s){this.q=t,this.j=s}init(){this.G=this.q!==this.q.top,this.Z=this.j.isWebView&&this.q===this.q.top,this.j.iframesTracking&&this.G||this.Z?this.W=!1:this.W=!0}isInIframeContext(){return this.G}isTopWindowTracker(){return this.W}isInWebViewContext(){return this.Z}}var ss,es;!function(t){t.debug="debug",t.warn="warn",t.implementation="implementation",t.error="error",t.critical="critical"}(ss||(ss={})),function(t){t.toQuery=function(t){return csArray.prototype.join.call(csArray.prototype.map.call(Object.keys(t),(s=>`${encodeURIComponent(s)}=${encodeURIComponent(t[s])}`)),"&")}}(es||(es={}));class is{constructor(t,s){this.domainUri=t,this.path=s,this.beforeRequestCallbacks=[],this.afterRequestCallbacks=[]}setRequestParametersProviders(...t){this.requestParametersProviders=t}before(t){csArray.prototype.push.call(this.beforeRequestCallbacks,t)}after(t){csArray.prototype.push.call(this.afterRequestCallbacks,t)}retrieveParameters(){return this.requestParametersProviders?csArray.prototype.reduce.call(csArray.prototype.map.call(this.requestParametersProviders,(t=>t.getRequestParameters())),((t,s)=>({...t,...s}))):{}}}class ns extends is{constructor(t,s){super(t,s)}send(){csArray.prototype.forEach.call(this.beforeRequestCallbacks,(t=>t()));const t=this.retrieveParameters();this.Y(t);const s=es.toQuery(t);this.K(s),csArray.prototype.forEach.call(this.afterRequestCallbacks,(t=>t()))}K(t){const s=new window.Image(1,1);s.onload=Gt,s.onerror=Gt,csHTMLImageElementsrc.call(s,`${this.domainUri}${this.path?`/${this.path}`:""}?${t}`)}Y(t){t.r=csString.prototype.slice.call(`${Math.random()}`,2,8)}}class rs{constructor(t,s){this.J=t,this.X=s}init(){this.tt=new ns(this.J.getLoggerUri()),this.tt.setRequestParametersProviders(this,this.X)}send(t){this.st=t,this.tt.send()}getRequestParameters(){return{a:this.st.app,l:this.st.level,m:this.st.message,s:this.st.stacktrace}}}function os(t,s,e,i){var n,r=arguments.length,o=r<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,e,i);else for(var h=t.length-1;h>=0;h--)(n=t[h])&&(o=(r<3?n(o):r>3?n(s,e,o):n(s,e))||o);return r>3&&o&&Object.defineProperty(s,e,o),o}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;class hs{static setGlobalService(t){hs.globalService=t}constructor(t){this.name=t}_get(){return this._values}_reset(){this._values={}}aggregate(){if(!hs.globalService)return;const t=this._get(),s=Object.keys(t);s.length&&(hs.globalService.push(csArray.prototype.map.call(s,(s=>({name:this.name,parameter:s,value:t[s]})))),this._reset())}}hs.globalService=null,os([vt("Metric.aggregate")],hs.prototype,"aggregate",null);class cs extends hs{constructor(t,s=100){super(t),this.et=s,this.it=null,this._values={}}count(t,s=1){this._values[t]=(this._values[t]||0)+s,this._debounce()}_debounce(){hs.globalService&&(this.it&&window.csClearTimeout(this.it),this.it=window.csSetTimeout((()=>{this.aggregate(),this.it=null}),this.et))}}const as={counters:{commandsFromIntegrations:new cs("commands-from-integrations"),commandsFromCSTC:new cs("commands-from-cstc"),commandsFromIframe:new cs("commands-from-iframe"),commandApplied:new cs("command-applied"),commandError:new cs("command-error"),commandMisuse:new cs("command-misuse"),CSTCSnippetUsed:new cs("cstc-snippet-used"),redactedPII:new cs("redacted-pii"),pageAnonymisation:new cs("page-anonymisation"),sensitiveElements:new cs("sensitive-elements")},setService(t){hs.setGlobalService(t)}},us=/[a-zA-Z0-9._%+-]+(?:@|%40|%2540)[a-zA-Z0-9.%-_]+((?:\.|%2[eE])[a-zA-Z0-9-]+)+/g,ls=/[a-zA-Z0-9+_-](?:@|%40|%2540)/,ds="([-A-Za-z0-9+/=_]|=[^=]|={3,})+",fs=new csRegExp(`(ey${ds}\\.ey${ds}\\.${ds})`,"g"),vs=/[0-9]{4}/,ms=/(^|[^a-zA-Z0-9*.,-])([45*][0-9*]{3}([ -]?)[0-9*]{4}\3[0-9*]{4}\3[0-9*]{4})($|[^a-zA-Z0-9*.,-])/g,ps=/\d/g,ws=/([+(]{0,2}\d[-_ ()/]{0,4}){9,}/,gs=/(?:\d{1,3}\.){3}\d{1,3}/,ys=/(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}/;var Es;!function(t){t.replaceEmail=function(t){return csString.prototype.replace.call(t,us,"CS_ANONYMIZED_EMAIL")},t.replaceJWT=function(t){return csString.prototype.replace.call(t,fs,"CS_ANONYMIZED_JWT")},t.replaceCreditCardNumber=function(t,s){return csString.prototype.replace.call(t,ms,s)},t.replaceDigits=function(t){return csString.prototype.replace.call(t,ps,"•")},t.mayHaveIPAddress=function(t){return gs.test(t)||ys.test(t)},t.mayHaveNumberSequence=function(t){return ws.test(t)},t.mayHaveCreditCardNumber=function(t){return vs.test(t)},t.mayHaveEmail=function(t){return ls.test(t)}}(Es||(Es={}));class As{constructor(){this.nt={}}getLogs(){const{fullCreditCard:t,partialCreditCard:s}=this.nt,e=[];return t&&csArray.prototype.push.call(e,`Full cc found and anonymized (${t})`),s&&csArray.prototype.push.call(e,`Partial cc found and anonymized (${s})`),e}hasPII(t,s){return t!==this.checkAndAnonymizePII(t,s)}checkAndAnonymizePII(t,s=null){this.ot();let e=this.ht(this.ut(t));return!0===s?e=this.lt(e):!1===s&&(e=this.ft(e)),e}anonymizePII(t){return this.ot(),this.ut(t)}anonymizeJwt(t){return this.ot(),Es.replaceJWT(t)}anonymizeFields(t,s){return this.ot(),csArray.prototype.forEach.call(s,(s=>{t[s]=this.ut(t[s])})),t}ot(){this.nt={}}ut(t){if(Es.mayHaveEmail(t)){const s=Es.replaceEmail(t);return s!==t&&as.counters.redactedPII.count("email"),s}return t}lt(t){return Es.replaceDigits(t)}ft(t){return Es.mayHaveNumberSequence(t)?Es.replaceDigits(t):t}ht(t){return Es.mayHaveCreditCardNumber(t)?Es.replaceCreditCardNumber(t,((t,s,e,i,n)=>{if(-1===csString.prototype.indexOf.call(e,"*")){const s=i.length?csArray.prototype.join.call(csString.prototype.split.call(e,i),""):e;if(!this.vt(s))return t;as.counters.redactedPII.count("cc"),this.nt.fullCreditCard=(this.nt.fullCreditCard||0)+1}else as.counters.redactedPII.count("cc-partial"),this.nt.partialCreditCard=(this.nt.partialCreditCard||0)+1;return`${s}CS_ANONYMIZED_PII${n}`})):t}vt(t){const s=parseInt(t[t.length-1]);let e=0;for(let s=t.length-2;s>=0;s--){let i=parseInt(t[s]);s%2==0&&(i*=2),e+=Math.floor(i/10)+i%10}return 10-e%10===s}}const _s="15.84.1";function Ss(){return{v:_s}}var Rs;const Ts="undefined"!=typeof performance&&!!performance.now,Is=Ts?()=>performance.now():csDate.now,Ps=Ts?null===(Rs=performance.timing)||void 0===Rs?void 0:Rs.navigationStart:0,bs={now:()=>Math.round(Is()+Ps),elapsed:()=>Is()};function Vs(){return Math.floor(bs.now()/1e3)}function Cs(){return"function"==typeof window.Promise}function ks(){var t,s;return"function"==typeof(null===(t=window.navigation)||void 0===t?void 0:t.addEventListener)&&"function"==typeof(null===(s=window.navigation)||void 0===s?void 0:s.removeEventListener)}function Ns(t,s){return 0===csString.prototype.lastIndexOf.call(t,s,0)}function Os(t,s){return-1!==csString.prototype.indexOf.call(t,s,t.length-s.length)}class $s{constructor(t,s){this.wt=t,this.gt=s}getRequestParameters(){return{d:`${bs.now()}`,p:this.gt.anonymizePII(window.location.href),...this.wt.getRequestParameters(),...Ss()}}}const xs="snippet-",Ms="implementation-snippet-";var Ls;!function(t){t.IMPLEMENTATION="implementation",t.DYNAMIC="dynamic"}(Ls||(Ls={}));const Ds={[ss.debug]:0,[ss.warn]:1,[ss.implementation]:1,[ss.error]:2,[ss.critical]:3};class Us{constructor(t,s,e){this.yt=s,this.gt=new As,this.Et=Ds[ss.warn],this.Et=Ds[t.minLogLevel||ss.warn],this.tt=e||new rs(t,new $s(t,this.gt)),this.At={[ss.debug]:[],[ss.warn]:[],[ss.implementation]:[],[ss.error]:[],[ss.critical]:[]},this._t={implementation:{},dynamic:{}},this.tt.init()}send(t,s="",e=ss.warn){if(!this.St(e,s))return;csArray.prototype.push.call(this.At[e],s||"");const i={message:this.Rt(t,s),stacktrace:this.Tt(t),app:"uxa",level:e};this.tt.send(i)}Rt(t,s){let e=_(t)?this.gt.anonymizePII(t.message||t.toString()):t;return s&&(e+=` ErrorCode: ${s}`),e}Tt(t){return _(t)?`${t.stack||"No stacktrace"} ${this.It()}`:this.It()}It(){const t=this.yt.getVisitorService(),s=null==t?void 0:t.getVisitor();if(!s)return"No context";const e=this.yt.getSessionService(),i=e&&e.getSession(),n={userId:s.id,sessionNumber:s.visitsCount,pageNumber:i&&i.pageNumber};return csJSON.stringify(n)}St(t,s){if(Ds[t]=5)&&(!s||!csArray.prototype.some.call(e,(t=>t===s)))}Pt(t,s){return t in this._t[s]?!(this._t[s][t]>=5)&&(this._t[s][t]+=1,!0):(this._t[s][t]=1,!0)}}const Fs=!i&&document.createElement("a"),Hs=/(:443|:80)$/;function zs(t){return Fs?(Fs.href=t,Fs.href):""}function Bs(t){const s=Gs(t);return null===s?"":decodeURIComponent(s.hostname)}function qs(t,s){return csArray.prototype.some.call(s,(s=>Os(t,`.${s}`)||t===s||""===s))}function js(t){return csString.prototype.replace.call(t,Hs,"")}function Gs(t){return Fs&&(Ns(t,"http://")||Ns(t,"https://"))?(Fs.href=t,{hash:Fs.hash,host:js(Fs.host),hostname:Fs.hostname,href:Fs.href,origin:Fs.origin?Fs.origin:js(`${Fs.protocol}//${Fs.host}`),pathname:(s=Fs.pathname,"/"===s[0]?s:`/${s}`),port:Fs.port,protocol:Fs.protocol,search:Fs.search}):null;var s}const Zs="CS_IFRAME_MESSAGE";var Ws,Qs,Ys,Ks;!function(t){t.AfterPageView="afterPageView",t.GetSessionKey="getSessionKey"}(Ws||(Ws={})),function(t){t.Parent="parent",t.Child="child"}(Qs||(Qs={})),function(t){t.Discovery="discovery",t.Stop="stop",t.RecordingContext="recordingContext",t.SensitiveStatus="sensitiveStatus",t.RecordingEvent="recordingEvent",t.EndOfBufferedMessages="endOfBufferedMessages",t.ChildLogMessage="childLogMessage",t.AnalysisEvent="analysisEvent",t.JavascriptError="javascriptError",t.ApiError="apiError",t.Assets="assets",t.DetailedApiError="detailedApiError",t.EmerchandisingMessage="emerchandisingMessage",t.Commands="commands",t.IntegrationCallback="integrationCallback",t.StaticResource="staticResource",t.TrackingContextResultMessage="trackingContextResultMessage",t.TrackingContextRequestMessage="trackingContextRequestMessage",t.CustomError="customError"}(Ys||(Ys={})),function(t){t.buildBaseMessage=function(t,s,e,i){const n={type:t,from:s,pid:e,signature:Zs};return void 0!==i&&i>=0&&(n.id=i),n},t.isMessageValid=function(t,s,e,i){const n=Bs(t.origin);return!!t.data&&!!t.data.type&&t.data.signature===Zs&&t.data.from===s&&t.data.pid===e&&qs(n,i)},t.sendPostMessage=function(t,s,e,i){i?t.postMessage(e,s,i):t.postMessage(e,s)},t.getNewChannelMessage=function(){return new MessageChannel},t.sendChannelMessage=function(t,s){t.postMessage(s)},t.closeChannelPort=function(t){t.close()}}(Ks||(Ks={}));class Js{constructor(t){this.wt=t}send(t,s="",e=ss.warn){const i={message:t,errorCode:s,level:e},n=Ks.buildBaseMessage(Ys.ChildLogMessage,Qs.Child,this.wt.projectId);n.content=i,Ks.sendPostMessage(window.parent,"*",n)}}class Xs{setContext(t,s){this.bt=t,this.Vt=s}getVisitorService(){return this.bt}getSessionService(){return this.Vt}}const te=["t.contentsquare.net","clicktale"];window.addEventListener("error",(t=>{"string"!=typeof t.filename||!csArray.prototype.some.call(te,(s=>csString.prototype.indexOf.call(t.filename,s)>-1))||csString.prototype.indexOf.call(t.filename,"blob")>-1&&(null==t.message?void 0:csString.prototype.indexOf.call(t.message,"importScripts"))>-1||se.critical(`Uncaught jsError: filename: ${t.filename} - lineno: ${t.lineno} - colno: ${t.colno} - message: ${t.message} `)}));class se{constructor(){}static whiteListFilename(t){csArray.prototype.push.call(te,t)}static setStrategy(t){se.Ct=t}static computeIsActive(t){se.kt=Qt.boolean(t),se.kt?se.Nt=Qt.boolean(10):se.Nt=!1}static isLoggingActive(){return se.kt}static getStrategy(){return se.Ct}static debug(t,s=""){se.kt&&this.Ct.send(t,s,ss.debug)}static warn(t,s=!0,e=""){var i;se.kt&&s&&this.Ct.send(t,e,ss.warn),null===(i=window.UXAnalytics.Console)||void 0===i||i.warn(t)}static implementation(t,s=""){se.kt&&this.Ct.send(t,s,ss.implementation)}static error(t,s=""){var e;se.kt&&this.Ct.send(t,s,ss.error),null===(e=window.UXAnalytics.Console)||void 0===e||e.error(t)}static critical(t,s=""){this.Ct.send(t,s,ss.critical)}static tryToExecute(t,s){return(...e)=>{try{const i=s(...e);return g(window.Promise)&&i instanceof window.Promise?i.then((t=>t),(s=>this.error(_(s)?s:new Error(s),t))):i}catch(s){try{this.error(_(s)?s:new Error(s),t)}catch{}}}}static isPerfLoggingActive(){return se.Nt}}se.kt=!1,se.Nt=!1;let ee=!1;function ie(){return(t,s,e)=>{if(e){const t=e.value;e.value=function(s,e){!1===(null==s?void 0:s.isTrusted)&&ee||t.call(this,s,e)}}else{const e=t[s];if("function"!=typeof e)return;t[s]=function(t,...s){!1===(null==t?void 0:t.isTrusted)&&ee||e.call(this,t,s)}}}}function ne(t,s,e,i){var n,r=arguments.length,o=r<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,e,i);else for(var h=t.length-1;h>=0;h--)(n=t[h])&&(o=(r<3?n(o):r>3?n(s,e,o):n(s,e))||o);return r>3&&o&&Object.defineProperty(s,e,o),o}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var re,oe,he,ce;!function(t){function s(t){const s=new csRegExp(`(^|;)[ ]*${t}=([^;]*)`).exec(document.cookie);return s?decodeURIComponent(s[2]):null}function e(s,e,n,r,o,h){const c=encodeURIComponent(`${e}`),a=n===t.CURRENT_DOMAIN?void 0:n,u=i(r);let l=`${s}=${c}${u?`;expires=${u.toUTCString()}`:""};path=/${y(a)?`;domain=${a}`:""}`;return g(o)&&o!==he.NotSet&&(l=`${l};SameSite=${o}`),g(h)&&h===ce.Yes&&(l=`${l};Secure`),document.cookie=l,!0}function i(t){return f(t)?new csDate(bs.now()+t):t}function n(t,i){s(t)&&e(t,"",i,new csDate(0)),s(t)&&e(t,"",i,new csDate(0),he.None,ce.Yes)}t.CURRENT_DOMAIN="CURRENT_DOMAIN",t.get=s,t.set=e,t.toExpireDate=i,t.remove=n,t.isCookiePresent=function(){return document.cookie.length>0},t.getRootDomain=function(t,i){const r="_cs_root-domain";let o=s(r);if(null!==o&&"1"!==o)return o;const h=csString.prototype.split.call(window.location.hostname,".");let c=csArray.prototype.pop.call(h);for(;h.length&&(null===o||"1"===o);)c=csArray.prototype.join.call([csArray.prototype.pop.call(h),c],"."),e(r,c,c,void 0,t,i),o=s(r);return n(r,c),c}}(re||(re={})),function(t){t.browserIsSafariV12=function(){return window.navigator.vendor&&csString.prototype.indexOf.call(window.navigator.vendor,"Apple")>-1&&window.navigator.appVersion&&csString.prototype.indexOf.call(window.navigator.appVersion,"Version/12.")>-1}}(oe||(oe={})),function(t){t.None="None",t.Lax="Lax",t.NotSet="X"}(he||(he={})),function(t){t[t.Yes=1]="Yes",t[t.No=0]="No"}(ce||(ce={}));class ae{constructor(t,s,e){this.wt=t,this.Ot=s,this.$t=e,this.xt=!1,this.Mt=he.NotSet,this.Lt=ce.No}getSameSiteFlag(){return this.Mt}getSecureFlag(){return this.Lt}getDomain(){return this.Dt}getRootDomain(){return this.Ut}init(){if(this.wt.cookielessTrackingEnabled)return;const t=this.Ft(),s=this.Ht();this.xt=this.zt(t,s),this.xt?(this.Mt=t,this.Lt=s):this.wt.secureCookiesEnabled&&"https:"===this.Ot.getUrlProtocol()&&(this.Lt=ce.Yes),this.Ut=this.Bt(),this.Dt=this.qt(this.Ut)}zt(t,s){return!oe.browserIsSafariV12()&&(re.set(ae.COOKIE_TEST_FOR_SAME_SITE,"Test same site",ae.CURRENT_DOMAIN,void 0,t,s),!!re.get(ae.COOKIE_TEST_FOR_SAME_SITE)&&(re.remove(ae.COOKIE_TEST_FOR_SAME_SITE,ae.CURRENT_DOMAIN),!0))}Ft(){return"http:"===this.Ot.getUrlProtocol()?he.Lax:this.$t.isSameSiteNoneSecureNeeded()||this.wt.crossDomainTracking?he.None:he.Lax}Ht(){return"http:"===this.Ot.getUrlProtocol()?ce.No:this.wt.secureCookiesEnabled||this.wt.crossDomainTracking||this.$t.isSameSiteNoneSecureNeeded()?ce.Yes:ce.No}isSameSiteSupported(){return this.xt}set(t,s,e){const i=re.toExpireDate(e);re.set(t,s,this.Dt,i,this.getSameSiteFlag(),this.getSecureFlag())}get(t){const s=new csRegExp(`(^|;)[ ]*${t}=([^;]*)`).exec(document.cookie);return s?decodeURIComponent(s[2]):null}delete(t,s){const e=s||this.Dt;re.remove(t,e)}Bt(){const t=this.$t.isSameSiteNoneSecureNeeded()&&this.isSameSiteSupported(),s=t?he.None:void 0,e=t?ce.Yes:void 0;return re.getRootDomain(s,e)}qt(t){return this.wt.allowSubdomains?t:re.CURRENT_DOMAIN}}ae.CURRENT_DOMAIN="CURRENT_DOMAIN",ae.COOKIE_TEST_FOR_SAME_SITE="_cs_same_site";const ue="_cs_t";class le{constructor(t,s){this.jt=t,this.wt=s,this.Gt=!1,this.Zt=!1}init(){if(!this.wt.cookielessTrackingEnabled&&this.jt.isTopWindowTracker()&&"cookie"in document){if(!this.jt.isInIframeContext()&&re.isCookiePresent())return this.Gt=!0,void(this.Zt=!1);if(re.set(ue,"1",re.CURRENT_DOMAIN),null!==re.get(ue))return this.Gt=!0,this.Zt=!1,void re.remove(ue,re.CURRENT_DOMAIN);re.set(ue,"1",re.CURRENT_DOMAIN,void 0,he.None,ce.Yes),null!==re.get(ue)&&(this.Gt=!0,this.Zt=!0,re.remove(ue,re.CURRENT_DOMAIN))}}areCookiesEnabled(){return this.Gt}isSameSiteNoneSecureNeeded(){return this.Zt}}class de{constructor(t,s){this.wt=t,this.$t=s}canTrack(){return this.wt.isProjectActive()&&this.Wt()&&this.Qt()&&this.Yt()}canTrackInChild(){return this.wt.isProjectActive()&&this.Kt()&&(this.Qt()||this.Jt())}Yt(){return this.wt.cookielessTrackingEnabled?function(){const t="CSSessionStorageTest";try{return sessionStorage.setItem(t,t),sessionStorage.getItem(t)===t&&(sessionStorage.removeItem(t),!0)}catch{return!1}}():this.$t.areCookiesEnabled()}Qt(){return qs(window.location.hostname,this.wt.hostnames)}Wt(){return!this.Xt()&&this.ss()}Kt(){return!this.Xt()&&this.es()}Jt(){return"about:"===window.location.protocol&&""===window.location.hostname}Xt(){return"visibilityState"in document&&"prerender"===document.visibilityState}ss(){return this.ns()&&this.rs()}es(){return this.ns()}rs(){try{return!!window.localStorage}catch{return!1}}ns(){return"pageXOffset"in window&&"pageYOffset"in window&&"onpagehide"in window&&"JSON"in window&&"parse"in window.csJSON&&"stringify"in window.csJSON&&"addEventListener"in window&&"removeEventListener"in window&&"Node"in window&&"filter"in csArray.prototype&&"forEach"in csArray.prototype&&"querySelectorAll"in document&&"now"in csDate&&"keys"in Object&&"performance"in window&&"Map"in window&&"Set"in window}}class fe{constructor(t,s){this.hs=!1,this.cs=new Map,this.us=new Map,this.ls=new Map,this.ds="CS_WORKER_SIGNATURE";const e=`\n const algorithm = ${t.algorithm};\n const compressor = (${t.getCompressorSourceCode()})();\n (()=>{"use strict";var e;!function(e){e.UNCOMPRESSED="0",e.GZIP="2"}(e||(e={}));let t={debug(...e){},warn(...e){},implementation(...e){},error(...e){},critical(...e){},isPerfLoggingActive:()=>!1};class s{constructor(e){var t;this.queryParams={},this.headers={},this.handleRecoveredRequests=e=>{for(const t of e){const{metadata:e,events:s}=t;this.send(s,e)}},this.endpoint=e.endpoint,this.compressionOpts=e.compressionOpts,this.recoveryStorage=e.recoveryStorage,this.mandatoryParameters=null!==(t=e.mandatoryParameters)&&void 0!==t?t:[],this.worker=!!e.worker,this.recoveryStorage&&this.recoveryStorage.recover(this.handleRecoveredRequests)}setQueryParams(e){Object.keys(e).forEach((t=>{this.queryParams[t]=e[t]}))}removeQueryParams(e){e?e.forEach((e=>{delete this.queryParams[e]})):this.queryParams={}}send(s,r){const a=r||{...this.queryParams},o=!("ct"in a),i="string"!=typeof s&&!this.isArrayBuffer(s);"ct"in a||(this.compressionOpts&&o?a.ct=this.compressionOpts.compressionType:a.ct=e.UNCOMPRESSED);const n=i?JSON.stringify(s):s,h=Object.keys(a).map((e=>\`\${encodeURIComponent(e)}=\${encodeURIComponent(a[e])}\`)).join("&"),c=\`\${this.endpoint}?\${h}\`;!function(e,t){const s=e.length;for(let r=0;rnull==a[e]))?this.compressionOpts&&o&&"string"==typeof n?this.compressionOpts.compressor(n,this.compressionOpts.compressionOutputType,(e=>this.doSend(c,a,e))):this.doSend(c,a,n):t.warn(\`[\${this.worker?"WORKER":"MAIN"}] All mandatory parameters are not present on \${c}\`)}onLoad(e){this.onLoadCallback=e}onError(e){this.onErrorCallback=e}onTimeout(e,t){this.onTimeoutCallback=e,this.timeout=t}abort(){this.abortCurrentXhrCall&&this.abortCurrentXhrCall()}setRequestHeader(e,t){this.headers[e]=t}getQueryParams(){return this.queryParams}isArrayBuffer(e){return e&&void 0!==e.byteLength}doSend(e,t,s){const r=new XMLHttpRequest,a=Object.keys(t).map((e=>\`\${encodeURIComponent(e)}=\${encodeURIComponent(t[e])}\`)).join("&");r.open("POST",e),r.onload=()=>{if(this.recoveryStorage&&this.recoveryStorage.recover(this.handleRecoveredRequests),this.onLoadCallback){const e={params:t,responseText:r.responseText,status:r.status};this.onLoadCallback(e)}},r.onerror=()=>{this.recoveryStorage&&this.recoveryStorage.save({key:a,metadata:t,events:s}),this.onErrorCallback&&this.onErrorCallback({params:t})},this.timeout&&this.onTimeoutCallback&&(r.timeout=this.timeout,r.ontimeout=()=>{this.onTimeoutCallback()}),this.abortCurrentXhrCall=()=>r.abort(),Object.keys(this.headers).forEach((e=>{r.setRequestHeader(e,this.headers[e])})),r.send(s)}}class r{constructor(e){this.maxStoredBytes=e,this.storageBytesUsed=0}addString(e){this.storageBytesUsed+=2*e.length}addArrayBuffer(e){this.storageBytesUsed+=e.byteLength}isThresholdReached(){return this.storageBytesUsed>this.maxStoredBytes}reset(){this.storageBytesUsed=0}}class a{constructor(e){this.ramStorage={},this.byteSizeCounter=new r(e)}save({key:e,metadata:t,events:s}){this.byteSizeCounter.isThresholdReached()||(this.byteSizeCounter.addString(e),"string"==typeof s?this.byteSizeCounter.addString(s):this.byteSizeCounter.addArrayBuffer(s),this.byteSizeCounter.isThresholdReached()||(this.ramStorage[e]={metadata:t,events:s}))}recover(e){const t=[];this.getStorageKeys().forEach((e=>{const s=this.ramStorage[e];void 0!==s&&(delete s.metadata.datatype,t.push(s),this.removeItem(e))})),0!==t.length&&(e(t),this.byteSizeCounter.reset())}getStorageKeys(){return Object.keys(this.ramStorage)}removeItem(e){delete this.ramStorage[e]}}var o;!function(e){e[e.NOT_STARTED=0]="NOT_STARTED",e[e.OPEN_IN_PROGRESS=1]="OPEN_IN_PROGRESS",e[e.OPEN_FAILED=2]="OPEN_FAILED",e[e.READY=3]="READY"}(o||(o={}));class i{constructor(e,t,s){this.storageName=e,this.onOpenError=s,this.cacheState=o.NOT_STARTED,this.toBeSavedBuffer=[],this.recoveryInProgress=0,this.origin=self.origin,this.context="object"==typeof window?"":"worker-",this.byteSizeCounter=new r(t),this.init()}async init(){await this.openCache(),this.cacheState===o.READY?this.flushToBeSavedBuffer():this.onOpenError(this.toBeSavedBuffer)}flushToBeSavedBuffer(){this.toBeSavedBuffer.forEach((e=>{this.save(e)})),this.toBeSavedBuffer=[]}async save(e){try{if(this.cacheState===o.OPEN_IN_PROGRESS)return void this.toBeSavedBuffer.push(e);if(this.cacheState!==o.READY)return;if(this.byteSizeCounter.isThresholdReached())return;const{key:t,metadata:s,events:r}=e;if(this.byteSizeCounter.addString(t),"string"==typeof r?this.byteSizeCounter.addString(r):this.byteSizeCounter.addArrayBuffer(r),this.byteSizeCounter.isThresholdReached())return;await this.cache.put(\`\${this.origin}/\${t}\`,new Response(r,{headers:s}))}catch{}}async recover(e){(this.cache||(await this.openCache(),this.cacheState===o.READY))&&this.doRecover(e)}async openCache(){try{this.cacheState=o.OPEN_IN_PROGRESS,this.cache=await self.caches.open(\`\${this.context}\${this.storageName}\`),this.cacheState=o.READY}catch{this.cacheState=o.OPEN_FAILED}}async doRecover(e){try{if(this.recoveryInProgress++,this.recoveryInProgress>1)return;const t=await this.cache.keys();if(0===t.length)return;const s=(await this.cache.matchAll()).map((e=>{const t={};e.headers.forEach(((e,s)=>{t[s]=e})),delete t["content-type"];const s=t.datatype;return delete t.datatype,"json"===s||"base64"===s?e.text().then((e=>({metadata:t,events:e}))):e.arrayBuffer().then((e=>({metadata:t,events:e})))})),r=await Promise.all(s);await Promise.all(t.map((e=>this.cache.delete(e)))),e(r),this.byteSizeCounter.reset()}catch{}finally{this.recoveryInProgress--}}}class n{constructor(e){try{this.initializeStorageStrategy(e)}catch(e){this.setRamStorageStrategy()}}initializeStorageStrategy(e){self.caches?this.setCachesStrategy(e):this.setRamStorageStrategy()}save(e){this.storageStrategy.save(e)}recover(e){this.storageStrategy.recover(e)}setCachesStrategy(e){this.storageStrategy=new i(e,n.MAX_SIZE,(e=>{this.setRamStorageStrategy(e)}))}setRamStorageStrategy(e){this.storageStrategy=new a(n.MAX_SIZE),e&&e.forEach((e=>{this.storageStrategy.save(e)}))}}n.MAX_SIZE=16777216,function(){const e="CS_WORKER_SIGNATURE",t=new Map,r=new n("csPersisted");function a(a){var o;if((o=a)&&o.WORKER_SIGNATURE===e)switch(a.type){case"CreatePostRequest":{const{endpoint:o,compressionOutputType:i,useRetry:n,mandatoryParameters:h}=a,c={endpoint:o,mandatoryParameters:h,worker:!0};i&&(c.compressionOpts={compressor,compressionOutputType:i,compressionType:algorithm}),n&&(c.recoveryStorage=r);const d=new s(c);t.set(o,d),d.onLoad((t=>{const s={type:"onLoad",endpoint:o,response:t,WORKER_SIGNATURE:e};self.postMessage(s)})),d.onError((t=>{const s={type:"onError",endpoint:o,response:t,WORKER_SIGNATURE:e};self.postMessage(s)}))}break;case"SetQueryParams":{const{endpoint:e,queryParams:s}=a,r=t.get(e);r&&r.setQueryParams(s)}break;case"RemoveQueryParams":{const{endpoint:e,queryParams:s}=a,r=t.get(e);r&&r.removeQueryParams(s)}break;case"Send":{const{endpoint:e,payload:s,queryParams:r}=a,o=t.get(e);o&&o.send(s,r)}break;case"Abort":{const{endpoint:e}=a,s=t.get(e);s&&s.abort()}break;case"SetHeader":{const{endpoint:e,headerName:s,headerValue:r}=a,o=t.get(e);o&&o.setRequestHeader(s,r)}break;case"SetTimeout":{const{endpoint:s,timeout:r}=a,o=t.get(s);o&&o.onTimeout((()=>{const t={type:"onTimeout",endpoint:s,WORKER_SIGNATURE:e};self.postMessage(t)}),r)}break;default:throw new Error(JSON.stringify(a))}}self.addEventListener("message",(function(e){e.data.getReader?async function(e,t){const s=e.getReader();for(;;){const{done:e,value:r}=await s.read();if(e)break;t(r)}}(e.data,a):a(e.data)}))}()})();`;try{this.fs=this.vs(s||e),this.hs=!0,fe.isTransferableStreamSupported()&&(this.ps=new ReadableStream({start:t=>{this.ws=t},cancel:()=>{this.ws=null}}),this.fs.postMessage(this.ps,[this.ps]))}catch(t){this.hs=!1}}postMessage(t){t.WORKER_SIGNATURE=this.ds,this.ws?this.ws.enqueue(t):this.fs.postMessage(t)}vs(t){const s=window.csURL||window.webkitURL,e=window.Blob,i=window.Worker,n=new e([t],{type:"application/javascript"}),r=s.createObjectURL(n);se.whiteListFilename(r);const o=new i(r);return o.onmessage=t=>{const{type:s,endpoint:e,WORKER_SIGNATURE:i}=t.data;if(i===this.ds)if("onLoad"===s){const{response:s}=t.data,i=this.cs.get(e);i&&i(s)}else if("onError"===s){const{response:s}=t.data,i=this.us.get(e);i&&i(s)}else if("onTimeout"===s){const t=this.ls.get(e);t&&t()}},o}registerOnLoadCallback(t,s){this.cs.set(t,s)}registerOnErrorCallback(t,s){this.us.set(t,s)}registerOnTimeoutCallback(t,s){this.ls.set(t,s)}isSupported(){return this.hs}static isTransferableStreamSupported(){try{const t=new ReadableStream;return structuredClone(t,{transfer:[t]}),!0}catch{return!1}}}class ve{constructor(t){var s;this.gs={},this.ys=t.endpoint,this.Es=t.networkWorker,this.As=t.compressionOutputType,this._s=t.useRetry,this.Es.postMessage({type:"CreatePostRequest",endpoint:this.ys,compressionOutputType:this.As,useRetry:this._s,mandatoryParameters:null!==(s=t.mandatoryParameters)&&void 0!==s?s:[]})}setQueryParams(t){this.Es.postMessage({type:"SetQueryParams",endpoint:this.ys,queryParams:t}),csArray.prototype.forEach.call(Object.keys(t),(s=>{this.gs[s]=t[s]}))}getQueryParams(){return this.gs}removeQueryParams(t){this.Es.postMessage({type:"RemoveQueryParams",endpoint:this.ys,queryParams:t}),t&&csArray.prototype.forEach.call(t,(t=>{delete this.gs[t]}))}send(t,s){this.Es.postMessage({type:"Send",endpoint:this.ys,payload:t,queryParams:s})}abort(){this.Es.postMessage({type:"Abort",endpoint:this.ys})}onLoad(t){this.Es.registerOnLoadCallback(this.ys,t)}onError(t){this.Es.registerOnErrorCallback(this.ys,t)}setRequestHeader(t,s){this.Es.postMessage({type:"SetHeader",endpoint:this.ys,headerName:t,headerValue:s})}onTimeout(t,s){this.Es.registerOnTimeoutCallback(this.ys,t),this.Es.postMessage({type:"SetTimeout",endpoint:this.ys,timeout:s})}}var me;!function(t){t.UNCOMPRESSED="0",t.GZIP="2"}(me||(me={}));class pe{constructor(t){this.onError=t}}class we{constructor(t){var s;this.gs={},this.Ss={},this.Rs=t=>{for(const s of t){const{metadata:t,events:e}=s;this.send(e,t)}},this.ys=t.endpoint,this.Ts=t.compressionOpts,this.Is=t.recoveryStorage,this.mandatoryParameters=null!==(s=t.mandatoryParameters)&&void 0!==s?s:[],this.worker=!!t.worker,this.Is&&this.Is.recover(this.Rs)}setQueryParams(t){Object.keys(t).forEach((s=>{this.gs[s]=t[s]}))}removeQueryParams(t){t?t.forEach((t=>{delete this.gs[t]})):this.gs={}}send(t,s){const e=s||{...this.gs},i=!("ct"in e),n="string"!=typeof t&&!this.Ps(t);"ct"in e||(this.Ts&&i?e.ct=this.Ts.compressionType:e.ct=me.UNCOMPRESSED);const r=n?JSON.stringify(t):t,o=Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&"),h=`${this.ys}?${o}`;Mt(this.mandatoryParameters,(t=>null==e[t]))?ft.warn(`[${this.worker?"WORKER":"MAIN"}] All mandatory parameters are not present on ${h}`):this.Ts&&i&&"string"==typeof r?this.Ts.compressor(r,this.Ts.compressionOutputType,(t=>this.bs(h,e,t))):this.bs(h,e,r)}onLoad(t){this.Vs=t}onError(t){this.Cs=t}onTimeout(t,s){this.ks=t,this.Ns=s}abort(){this.Os&&this.Os()}setRequestHeader(t,s){this.Ss[t]=s}getQueryParams(){return this.gs}Ps(t){return t&&void 0!==t.byteLength}bs(t,s,e){const i=new XMLHttpRequest,n=Object.keys(s).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(s[t])}`)).join("&");i.open("POST",t),i.onload=()=>{if(this.Is&&this.Is.recover(this.Rs),this.Vs){const t={params:s,responseText:i.responseText,status:i.status};this.Vs(t)}},i.onerror=()=>{this.Is&&this.Is.save({key:n,metadata:s,events:e}),this.Cs&&this.Cs({params:s})},this.Ns&&this.ks&&(i.timeout=this.Ns,i.ontimeout=()=>{this.ks()}),this.Os=()=>i.abort(),Object.keys(this.Ss).forEach((t=>{i.setRequestHeader(t,this.Ss[t])})),i.send(e)}}class ge{constructor(t){this.$s=t,this.Es=new fe(this.$s)}create(t,s,e,i,n=[]){if(this.Es.isSupported()&&s)return new ve({networkWorker:this.Es,endpoint:t,compressionOutputType:e,useRetry:!!i,mandatoryParameters:n});{const s=e?{compressor:this.$s.compress,compressionOutputType:e,compressionType:this.$s.algorithm}:void 0;return new we({endpoint:t,compressionOpts:s,recoveryStorage:i})}}}class ye{constructor(t,s,e,i,n){this.bt=t,this.Vt=s,this.xs=e,this.Ms=i,this.wt=n}get(){return{exclusion:this.xs.getAppliedTrackingDraw(),visitor:this.bt.getVisitor(),session:this.Vt.getSession(),cvars:this.Ms.getCustomVariablesSession()}}apply(t){t&&(t.exclusion?this.exclude():this.include(t))}exclude(){this.xs.exclude(this.wt),this.bt.removeVisitor(),this.Vt.removeSession(),this.Ms.removeCustomVariablesSession()}include(t){this.xs.removeExclusion(),this.bt.setVisitor(t.visitor),t.session?this.Vt.setSession(t.session):this.Vt.removeSession(),t.cvars?this.Ms.setCustomVariableSession(t.cvars):this.Ms.removeCustomVariablesSession()}}function Ee(){const t=new Error;let s=t.stack?csArray.prototype.filter.call(csString.prototype.split.call(t.stack,"\n"),(t=>"Error"!==t&&-1===csString.prototype.indexOf.call(csString.prototype.toLowerCase.call(t),"promise ")&&-1===csString.prototype.indexOf.call(t,"[native code]")&&-1===csString.prototype.indexOf.call(t,"()"))):[];if(0===s.length)return"";const e=function(t){return t.length>0?Ae(t[0]):""}(s);return""===e?"":(s=function(t,s){return csArray.prototype.filter.call(t,(t=>-1===csString.prototype.indexOf.call(t,s)))}(s,e),0===s.length?"":Ae(s[0]))}function Ae(t){let s,e="";var i;i=t,s=-1!==csString.prototype.indexOf.call(i,"@")?new csRegExp("@(.+):(\\d+):(\\d+)$"):new csRegExp("\\((.+):(\\d+):(\\d+)\\)");const n=s.exec(t);return n&&(e=n[1]),e}const _e=t=>t;function Se(t,s){const e=csSymbol.for(s);if(t[e]){return t[e]}const i=Object.getOwnPropertyDescriptor(t,s);if(!(null==i?void 0:i.writable)&&!(null==i?void 0:i.set))return ft.warn(`Cannot intercept read only function '${csString(s)}' of object '${t}'`),null;const n=new Set;t[e]=n;const r=t[s];if("function"==typeof r){const e=function(){const t=arguments;let s=[];try{s=csArray.prototype.map.call(Ut(n),(s=>s(t)))}catch(t){ft.error(t)}const e=r.apply(this,t);try{for(let i=0;ih.toString()}),t[s]=e}var o,h;return n}function Re({target:t,methodName:s,hook:e,hookPrepareArgs:i=_e,options:n}){const r=Se(t,s);if(!r)return null;const o=t=>{const s=i(t),r=(null==n?void 0:n.withCallerName)?{callerName:Ee()}:{};return t=>e({...t,...r,args:s})};return{activate:()=>{r.add(o)},deactivate:()=>{r.delete(o)}}}function Te(t,s,e){const i=function(t,s){const e=csSymbol.for(s);if(t[e])return t[e];const i=new Set,n=Object.getOwnPropertyDescriptor(t,s);return n?n.configurable?(t[e]=i,Object.defineProperty(t,s,{set(){var t;const e=arguments,r=this[s],o=null===(t=n.set)||void 0===t?void 0:t.apply(this,e);try{i.forEach((t=>t(this,e[0],r)))}catch(t){ft.error(t)}return o}}),i):(ft.warn(`Cannot intercept read only property '${csString(s)}' of object '${t}'`),null):i}(t,s);if(!i)return null;const n=(t,s,i)=>e(t,s,i);return{activate:()=>{i.add(n)},deactivate:()=>{i.delete(n)}}}var Ie;class Pe{static Ls(t){this.Ds.forEach((s=>{t(s,"initial")}))}static Us(t){if(this.Fs||(this.Fs=new csMutationObserver((t=>{for(const s of t)s.target.isConnected&&$t(s.addedNodes,this.Hs),$t(s.removedNodes,this.zs)}))),csArray.prototype.push.call(this.Bs,t),!this.qs){this.qs=!0,this.Fs.observe(document,this.js);for(const t of bt.getAllShadowHosts(document)){const s=csElementshadowRoot.apply(t);this.Ds.add(s),this.Fs.observe(s,this.js)}this.Gs||(this.Gs=Re({target:Element.prototype,methodName:"attachShadow",hook:t=>t.result.isConnected&&this.Zs(t.result)})),this.Gs.activate()}this.Ls(t)}static Ws(t){var s,e;this.Bs=csArray.prototype.filter.call(this.Bs,(s=>s!==t)),0===this.Bs.length&&(this.Bs=[],this.qs=!1,null===(s=this.Fs)||void 0===s||s.disconnect(),null===(e=this.Gs)||void 0===e||e.deactivate(),this.Ds.clear())}constructor(t){this.Qs=t,this.Qs=mt("DocumentShadowRootObserver:callback",((s,e)=>t(s,e)))}get shadowRoots(){return Ut(Ie.Ds)}takeRecords(){var t,s;return null!==(s=null===(t=Ie.Fs)||void 0===t?void 0:t.takeRecords())&&void 0!==s?s:[]}observe(){bt.isSupported()&&Ie.Us(this.Qs)}disconnect(){bt.isSupported()&&Ie.Ws(this.Qs)}}Ie=Pe,Pe.Bs=[],Pe.Ds=new Set,Pe.qs=!1,Pe.js={childList:!0,subtree:!0},Pe.Zs=t=>{Ie.Ds.has(t)||(Ie.Fs.observe(t,Ie.js),Ie.Ds.add(t),$t(Ie.Bs,(s=>s(t,"added"))))},Pe.Hs=t=>{ct(t,NodeFilter.SHOW_DOCUMENT_FRAGMENT).visitAll(Ie.Zs)},Pe.zs=t=>{t.isConnected||ct(t,NodeFilter.SHOW_DOCUMENT_FRAGMENT).visitAll((t=>{Ie.Ds.has(t)&&(Ie.Ds.delete(t),$t(Ie.Bs,(s=>s(t,"removed"))))}))},os([vt()],Pe.prototype,"observe",null),os([vt()],Pe.prototype,"disconnect",null);function be(t,s=true){t.boundElement.addEventListener(t.type,t.listener,s)}function Ve(t,s=true){t.boundElement.removeEventListener(t.type,t.listener,s)}function Ce(t,s=0){const e=Math.pow(10,s);return Math.round(t*e)/e}function ke(t,s){"number"==typeof s&&(s={wait:s});const e=s.wait;if(s.ignoreThrottledCalls){let s=0;return function(...i){const n=bs.now();if(n-s>e)return s=n,t.apply(this,i)}}let i,n,r=[],o=null,h=0;const c=()=>{h=bs.now(),o=null,n=t.apply(i,r)},a=function(...s){const a=bs.now(),u=e-(a-h);return i=null!=this?this:window,r=[...s],u<=0||u>e?(h=a,n=t.apply(i,r),o?(window.csClearTimeout(o),o=null):r=[]):o||(o=window.csSetTimeout(c,u)),n};return a.cancel=()=>{o&&(window.csClearTimeout(o),h=0,o=null,r=[])},a.flushPending=()=>{o&&(window.csClearTimeout(o),c())},a}const Ne=t=>(s,e,i)=>{i.value=ke(i.value,t)};var Oe,$e,xe,Me,Le;function De(t){const s=csEventtarget.apply(t);return s&&1===s.nodeType&&csElementshadowRoot.apply(s)&&t.composedPath?t.__csOriginalTarget||t.composedPath()[0]:s}!function(t){t[t.MUTATION_INSERT=1]="MUTATION_INSERT",t[t.MUTATION_REMOVE=2]="MUTATION_REMOVE",t[t.MUTATION_ATTRIBUTE=3]="MUTATION_ATTRIBUTE",t[t.MUTATION_CHARACTER_DATA=4]="MUTATION_CHARACTER_DATA",t[t.INITIAL_DOM=5]="INITIAL_DOM",t[t.SCROLL=6]="SCROLL",t[t.CLICK=8]="CLICK",t[t.RESIZE=9]="RESIZE",t[t.INPUT_CHECKABLE=10]="INPUT_CHECKABLE",t[t.INPUT_SELECT=11]="INPUT_SELECT",t[t.INPUT_TEXT=12]="INPUT_TEXT",t[t.HASH_CHANGE=13]="HASH_CHANGE",t[t.UNANONYMIZED_CONSENT_GRANTED=14]="UNANONYMIZED_CONSENT_GRANTED",t[t.UNANONYMIZED_CONSENT_WITHDRAWN=15]="UNANONYMIZED_CONSENT_WITHDRAWN",t[t.MOUSE_OVER=16]="MOUSE_OVER",t[t.VISIBILITY_CHANGE=17]="VISIBILITY_CHANGE",t[t.STYLESHEET_RULE_INSERT=18]="STYLESHEET_RULE_INSERT",t[t.STATIC_RESOURCE_URL=19]="STATIC_RESOURCE_URL",t[t.PERFORMANCE_TIMINGS=20]="PERFORMANCE_TIMINGS",t[t.ATTACH_SHADOW=22]="ATTACH_SHADOW",t[t.STYLESHEET_CSS_TEXT_UPDATE=23]="STYLESHEET_CSS_TEXT_UPDATE",t[t.JAVASCRIPT_ERROR=26]="JAVASCRIPT_ERROR",t[t.PAGE_EVENT=27]="PAGE_EVENT",t[t.API_ERROR=28]="API_ERROR",t[t.TEXT_VISIBILITY=29]="TEXT_VISIBILITY",t[t.MUTATION_ENCRYPTED_CHARACTER_DATA=30]="MUTATION_ENCRYPTED_CHARACTER_DATA",t[t.INPUT_ENCRYPTED_TEXT=31]="INPUT_ENCRYPTED_TEXT",t[t.KEY_DOWN=32]="KEY_DOWN",t[t.KEY_UP=33]="KEY_UP",t[t.CLIPBOARD_COMMAND=34]="CLIPBOARD_COMMAND",t[t.STYLESHEET_RULE_DELETE=37]="STYLESHEET_RULE_DELETE",t[t.USER_IDENTIFIER=38]="USER_IDENTIFIER",t[t.TOUCH_START=41]="TOUCH_START",t[t.TOUCH_MOVE=42]="TOUCH_MOVE",t[t.TOUCH_END=43]="TOUCH_END",t[t.GESTURE_RECOGNITION=44]="GESTURE_RECOGNITION",t[t.POINTER_DOWN=47]="POINTER_DOWN",t[t.POINTER_MOVE=48]="POINTER_MOVE",t[t.POINTER_UP=49]="POINTER_UP",t[t.CUSTOM_ERROR=50]="CUSTOM_ERROR",t[t.CUSTOM_ELEMENT_REGISTRATION=54]="CUSTOM_ELEMENT_REGISTRATION",t[t.REGISTER_ADOPTED_STYLE_SHEET=60]="REGISTER_ADOPTED_STYLE_SHEET",t[t.SET_ADOPTED_STYLE_SHEETS=61]="SET_ADOPTED_STYLE_SHEETS",t[t.ADOPTED_STYLESHEET_RULE_INSERT=62]="ADOPTED_STYLESHEET_RULE_INSERT",t[t.ADOPTED_STYLESHEET_RULE_DELETE=63]="ADOPTED_STYLESHEET_RULE_DELETE",t[t.SCREEN_RESIZE=65]="SCREEN_RESIZE",t[t.RESOURCE_HASHES=66]="RESOURCE_HASHES",t[t.PERFORMANCE_NAVIGATION_TIMING=67]="PERFORMANCE_NAVIGATION_TIMING",t[t.PERFORMANCE_RESOURCE_TIMING=68]="PERFORMANCE_RESOURCE_TIMING",t[t.RECORDING_INFO_EVENT=72]="RECORDING_INFO_EVENT",t[t.TEXT_REF=73]="TEXT_REF",t[t.TOUCH_CANCEL=74]="TOUCH_CANCEL",t[t.MUTATION_MOVE=75]="MUTATION_MOVE",t[t.STYLESHEET_RULE_UPDATE=76]="STYLESHEET_RULE_UPDATE",t[t.ADOPTED_STYLESHEET_RULE_UPDATE=77]="ADOPTED_STYLESHEET_RULE_UPDATE",t[t.VIDEO_PLAY=78]="VIDEO_PLAY",t[t.VIDEO_PAUSE=79]="VIDEO_PAUSE",t[t.VIDEO_SEEK=80]="VIDEO_SEEK",t[t.DEBUG=999]="DEBUG"}(Oe||(Oe={})),function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right",t[t.Fourth=3]="Fourth",t[t.Fifth=4]="Fifth"}($e||($e={})),function(t){t[t.SWIPE=0]="SWIPE",t[t.PINCH_IN=1]="PINCH_IN",t[t.PINCH_OUT=2]="PINCH_OUT",t[t.LONG_PRESS=3]="LONG_PRESS",t[t.TAP=4]="TAP",t[t.DOUBLE_TAP=5]="DOUBLE_TAP"}(xe||(xe={})),function(t){t[t.SPACE=0]="SPACE",t[t.ENTER=1]="ENTER",t[t.BACKSPACE=2]="BACKSPACE",t[t.DELETE=3]="DELETE",t[t.ARROWUP=4]="ARROWUP",t[t.ARROWDOWN=5]="ARROWDOWN",t[t.ARROWLEFT=6]="ARROWLEFT",t[t.ARROWRIGHT=7]="ARROWRIGHT",t[t.CAPSLOCK=8]="CAPSLOCK",t[t.SHIFT=9]="SHIFT",t[t.TAB=10]="TAB",t[t.ALPHANUMERICAL=11]="ALPHANUMERICAL",t[t.ESCAPE=12]="ESCAPE",t[t.END=13]="END",t[t.ALT=14]="ALT",t[t.CTRL=15]="CTRL",t[t.META=16]="META"}(Me||(Me={})),function(t){t[t.COPY=0]="COPY",t[t.CUT=1]="CUT",t[t.PASTE=2]="PASTE"}(Le||(Le={}));const Ue=!!window.chrome,Fe="data-cs-scroll-container";var He;!function(t){t.isEventOnScrollContainer=function(t){return!!(y(t)&&function(t){try{if(y(csEventtarget.apply(t)))return!0}catch{}return!1}(t)&&A(csEventtarget.apply(t))&&null!==csEventtarget.apply(t).getAttribute(Fe))},t.getScrollContainer=function(){return window.csquerySelector[document.nodeType].call(document,`[${Fe}]`)}}(He||(He={}));const ze=function(){const t=csSymbol.for("propStore");return{getStore:s=>s[t],get(s,e){const i=s[t];return null==i?void 0:i[e]},set(s,e,i){let n=s[t];n||(n={},s[t]=n),n[e]=i}}}();var Be;!function(t){function s(t,s){e(t,void 0,s)}function e(t,s,i){let n=!1;if(i(t,s,(()=>n=!0)),n)return;const r=t.shadowRoot;r&&e(r,t,i);const o=t.children;if(null==o?void 0:o.length)for(const s of o)if(s&&(e(s,t,i),n))break}t.setProperty=function(t,s,e){var i;t instanceof Node?ze.set(t,s,e):(null!==(i=t.props)&&void 0!==i||(t.props={}),t.props[s]=e)},t.getProperty=function(t,s){var e;return t instanceof Node?ze.get(t,s):null===(e=t.props)||void 0===e?void 0:e[s]},t.getProperties=function(t){return t instanceof Node?ze.getStore(t):t.props},t.findDescendant=function(t,e){let i=null;return s(t,((t,s,n)=>e(t)&&(i=t)&&!!n())),i},t.traverse=s}(Be||(Be={}));let qe=1,je=csSymbol("nodeIdentifier");function Ge(t){const s=Be.getProperty(t,je);return null!=s?s:(Be.setProperty(t,je,qe++),Be.getProperty(t,je))}let Ze;function We(t){Ze||(Ze=document.createElement("div"));if(!(!!t&&m(t)))return ft.warn(`isValidSelector: invalid selector provided '${t}'`),!1;try{return G.call(Ze,t),!0}catch{return ft.warn(`isValidSelector: invalid selector provided '${t}'`),!1}}function Qe(t,s){if(Z)return Z.call(t,s);let e=t;do{if(G.call(e,s))return e;e=null==e?void 0:e.parentElement}while(null!==e&&1===e.nodeType);return null}var Ye;!function(t){let s;!function(t){t[t.NotMasked=0]="NotMasked",t[t.Parent=1]="Parent",t[t.Child=2]="Child"}(s=t.MaskedElementState||(t.MaskedElementState={})),t.maskedProp="masked",t.maskedAttributeProp="maskedAttribute",t.isSelectorUserInput=function(t){return!!(w(t)&&"Attributes"in t&&"PIISelectors"in t)&&(t.Attributes instanceof Array&&t.PIISelectors instanceof Array)},t.sanitizeSelectorUserInput=function(t){return w(t)&&null!==t?("Attributes"in t||(t.Attributes=[]),"PIISelectors"in t||(t.PIISelectors=[]),t):(ft.implementation(`setPIISelectors called with invalid input of type ${typeof t}: ${csJSON.stringify(t)}`),{Attributes:[],PIISelectors:[]})},t.getMaskedElementDetails=function(e){var i;return null!==(i=Be.getProperty(e,t.maskedProp))&&void 0!==i?i:{state:s.NotMasked}},t.getMaskedAttributeDetails=function(s){var e;return null!==(e=Be.getProperty(s,t.maskedAttributeProp))&&void 0!==e?e:{attributes:[]}},t.isMaskedElement=function(e){const i=Be.getProperty(e,t.maskedProp);return(null==i?void 0:i.state)===s.Parent},t.isMaskedElementChild=function(e){const i=Be.getProperty(e,t.maskedProp);return(null==i?void 0:i.state)===s.Child},t.isMaskedAttribute=function(s,e){const i=Be.getProperty(s,t.maskedAttributeProp);return(null==(null==i?void 0:i.attributes)?void 0:csArray.prototype.indexOf.call(null==i?void 0:i.attributes,e))>-1},t.setMaskedElementProperty=function(s,e){Be.setProperty(s,t.maskedProp,e)},t.unsetMaskedElementProperty=function(s){Be.setProperty(s,t.maskedProp,void 0)},t.setMaskedAttributeProperty=function(s,e){Be.setProperty(s,t.maskedAttributeProp,e)},t.getComputedSelectorSettings=function(t,s){const e=csArray.prototype.filter.call(t.PIISelectors,(t=>We(t)));s.elementSelector.length>0&&csArray.prototype.push.call(e,...csString.prototype.split.call(s.elementSelector,","));const i=function(t){if(t.length<=1)return t;const s=[];for(const e of t){const t=csString.prototype.split.call(e,",");for(const e of t)-1===csArray.prototype.indexOf.call(s,e)&&csArray.prototype.push.call(s,e)}return s}([...e]),n={elementSelector:csArray.prototype.join.call(i,","),attrSelector:s.attrSelector,attrSelectors:s.attrSelectors};return csArray.prototype.forEach.call(t.Attributes,(t=>{(null==t?void 0:t.attrName)&&(null==t?void 0:t.selector)&&We(t.selector)&&!function(t,s){return csArray.prototype.some.call(t,(t=>t.selector===s.selector&&t.attrName===s.attrName))}(n.attrSelectors,t)&&csArray.prototype.push.call(n.attrSelectors,t)})),n.attrSelector=function(t){let s="";return csArray.prototype.forEach.call(t,(t=>{const e=csString.prototype.split.call(t.selector,",");csArray.prototype.forEach.call(e,(t=>{We(t)&&(s&&(s+=","),s+=t)}))})),s}(n.attrSelectors),n}}(Ye||(Ye={}));class Ke{constructor(){this.eventType="user",this.Ys=[],this.Ks=[{type:"pointerup",listener:t=>this.pointerUpListener(t),boundElement:document},{type:"pointermove",listener:t=>this.pointerMoveListener(t),boundElement:document},{type:"pointerdown",listener:t=>this.pointerDownListener(t),boundElement:document}],this.Js=[{type:"touchstart",listener:t=>this.touchStartListener(t),boundElement:document},{type:"touchmove",listener:t=>this.touchMoveListener(t),boundElement:document},{type:"touchend",listener:t=>this.touchEndCancelListener(t),boundElement:document},{type:"touchcancel",listener:t=>this.touchEndCancelListener(t),boundElement:document}],this.Xs=[{type:"click",listener:t=>this.clickListener(t),boundElement:document},{type:"keyup",listener:t=>this.keyUpListener(t),boundElement:document},{type:"keydown",listener:t=>this.keyDownListener(t),boundElement:document},{type:"copy",listener:t=>this.copyListener(t),boundElement:document},{type:"cut",listener:t=>this.cutListener(t),boundElement:document},{type:"paste",listener:t=>this.pasteListener(t),boundElement:document},{type:"scroll",listener:t=>this.scrollListener(csEventtarget.apply(t)),boundElement:document},{type:"mouseover",listener:t=>this.mouseOverListener(t),boundElement:document}],this.te=[{type:"scroll",listener:t=>this.scrollListener(csEventtarget.apply(t))}];const t=function(t){if(!m(t))return null;const s=/iP(ad|hone|od).+Version\/(\d+)\..*Safari/i.exec(t);return s?Number(s[2]):null}(window.navigator.userAgent);(null===t||t&&t>=16)&&csArray.prototype.push.call(this.te,{type:"mouseover",listener:t=>this.mouseOverListener(t)}),this.se=new Pe(((t,s)=>{switch(s){case"initial":case"added":this.ee(t);break;case"removed":this.ie(t)}}))}init(){this.ne(),this.re(),this.oe()}onEvent(t){csArray.prototype.push.call(this.Ys,t)}he(t,s=!1){csArray.prototype.forEach.call(this.Ys,(e=>e(t,s)))}start(){this.ce(),this.ee(document),this.se.observe()}stop(){this.ie(document),this.se.disconnect()}re(){this.ae()&&csArray.prototype.push.call(this.Xs,...this.Ks)}ne(){this.ue()&&csArray.prototype.push.call(this.Xs,...this.Js)}ee(t){M(t)?csArray.prototype.forEach.call(this.Xs,(t=>be(t))):csArray.prototype.forEach.call(this.te,(s=>{be({type:s.type,listener:s.listener,boundElement:t})}))}ie(t){M(t)?csArray.prototype.forEach.call(this.Xs,(t=>Ve(t))):csArray.prototype.forEach.call(this.te,(s=>{Ve({type:s.type,listener:s.listener,boundElement:t})}))}ae(){return"PointerEvent"in window&&"function"==typeof window.PointerEvent}ue(){return"TouchEvent"in window&&"function"==typeof window.TouchEvent}ce(){this.le()}le(){const t=He.getScrollContainer()||document,s=Ge(t),e=this.de(t);if(0!==e.top||0!==e.left){const t={type:Oe.SCROLL,args:[s,e.left,e.top],date:bs.now()};this.he(t,!0)}}de(t){return t===document?{top:window.pageYOffset,left:window.pageXOffset}:{top:t.scrollTop,left:t.scrollLeft}}scrollListener(t){if(Ye.isMaskedElement(t)||Ye.isMaskedElementChild(t))return;const s=Ge(t),e=this.de(t),i={type:Oe.SCROLL,args:[s,e.left,e.top],date:bs.now()};this.he(i)}mouseOverListener(t){if(Ye.isMaskedElementChild(t.target))return;const s=Ge(t.target),e={type:Oe.MOUSE_OVER,args:[s],date:bs.now()};this.he(e)}clickListener(t){const s=De(t);if(Ye.isMaskedElementChild(s))return;const e=Ge(s),i={type:Oe.CLICK,args:[e],date:bs.now()};this.he(i)}keyUpListener(t){const s=De(t);if(Ye.isMaskedElementChild(s))return;const e=Ge(s),i=this.fe[t.key];if(void 0===i)return;const n={type:Oe.KEY_UP,args:[e,i],date:bs.now()};this.he(n)}keyDownListener(t){const s=De(t);if(Ye.isMaskedElementChild(s))return;const e=Ge(s),i=this.fe[t.key];if(void 0===i)return;const n={type:Oe.KEY_DOWN,args:[e,i],date:bs.now()};this.he(n)}copyListener(t){const s=De(t);if(Ye.isMaskedElementChild(s))return;const e=Ge(s),i={type:Oe.CLIPBOARD_COMMAND,args:[e,Le.COPY],date:bs.now()};this.he(i)}cutListener(t){const s=De(t);if(Ye.isMaskedElementChild(s))return;const e=Ge(s),i={type:Oe.CLIPBOARD_COMMAND,args:[e,Le.CUT],date:bs.now()};this.he(i)}pasteListener(t){const s=De(t);if(Ye.isMaskedElementChild(s))return;const e=Ge(s),i={type:Oe.CLIPBOARD_COMMAND,args:[e,Le.PASTE],date:bs.now()};this.he(i)}pointerUpListener(t){const s=De(t);if(Ye.isMaskedElementChild(s))return;const e=Ge(s),i={type:Oe.POINTER_UP,args:[t.pointerId,t.pointerType,Ce(t.clientX,1),Ce(t.clientY,1),e,t.button],date:bs.now()};this.he(i)}pointerMoveListener(t){const s={type:Oe.POINTER_MOVE,args:[t.pointerId,t.pointerType,Ce(t.clientX,1),Ce(t.clientY,1)],date:bs.now()};this.he(s)}pointerDownListener(t){const s=De(t);if(Ye.isMaskedElementChild(s))return;const e=Ge(s),i={type:Oe.POINTER_DOWN,args:[t.pointerId,t.pointerType,Ce(t.clientX,1),Ce(t.clientY,1),e,t.button,{pageX:Ce(t.pageX,1),pageY:Ce(t.pageY,1)}],date:bs.now()};this.he(i)}touchStartListener(t){if(!t.changedTouches)return;const{changedTouches:s}=t;for(let t=0;t{const i=e.value;return i&&(e.value=function(t){if(De(t)===csEventtarget.apply(t))return i.call(this,t)}),e}],Ke.prototype,"mouseOverListener",null),ne([vt("click"),ie()],Ke.prototype,"clickListener",null),ne([vt("Event handler type: keyup")],Ke.prototype,"keyUpListener",null),ne([vt("Event handler type: keydown")],Ke.prototype,"keyDownListener",null),ne([vt("Event handler type: copy")],Ke.prototype,"copyListener",null),ne([vt("Event handler type: cut")],Ke.prototype,"cutListener",null),ne([vt("Event handler type: paste")],Ke.prototype,"pasteListener",null),ne([vt("Event handler type: pointerup"),ie()],Ke.prototype,"pointerUpListener",null),ne([vt("Event handler type: pointermove"),ie(),Ne({wait:33,ignoreThrottledCalls:!1})],Ke.prototype,"pointerMoveListener",null),ne([vt("Event handler type: pointerdown"),ie()],Ke.prototype,"pointerDownListener",null),ne([vt("Event handler type: touchstart"),ie()],Ke.prototype,"touchStartListener",null),ne([vt("Event handler type: touchmove"),ie()],Ke.prototype,"touchMoveListener",null),ne([vt("Event handler type: touchend-cancel"),ie()],Ke.prototype,"touchEndCancelListener",null);class Je{constructor(t){this.ve=t,this.pe=0}addString(t){this.pe+=2*t.length}addArrayBuffer(t){this.pe+=t.byteLength}isThresholdReached(){return this.pe>this.ve}reset(){this.pe=0}}class Xe{constructor(t=[],s=2048e3){this.we=t,this.ge=new Je(s)}addEvent(t){this.ge.addString(Kt(t)),csArray.prototype.push.call(this.we,t)}addEventByTimestamp(t){let s=0;for(;s=t.date)break}csArray.prototype.splice.call(this.we,s,0,t)}eventsCount(){return this.we.length}clearEvents(){this.ge.reset(),this.we=[]}isFull(){return this.eventsCount()>=200}isThresholdReached(){return this.ge.isThresholdReached()}getEvents(){return this.we}extractEvents(...t){const s=[],e=[];return csArray.prototype.forEach.call(this.we,(i=>{-1!==csArray.prototype.indexOf.call(t,i.type)?csArray.prototype.push.call(s,i):csArray.prototype.push.call(e,i)})),this.we=e,s}stringifyEvents(){return Kt(this.we)}ye(t){t.type===Oe.INITIAL_DOM&&(window.CSDomSerialized=window.CSDomSerialized?window.CSDomSerialized+1:1)}}ne([Pt("RecordingBatch.addEvent")],Xe.prototype,"addEvent",null);class ti{constructor(){this.Ee=1}getCurrentIndex(){return this.Ee}increment(){this.Ee+=1}reset(){this.Ee=1}getRequestParameters(){return{ri:`${this.Ee}`}}}class si{emit(t,s,e,i=document){const n=`${void 0!==e?`${e}`:`${si.Ae}`}${t}`,r=si.createEvent(n,{detail:s});null!==r&&i.dispatchEvent(r)}static createEvent(t,s={}){if("function"==typeof CustomEvent)return new CustomEvent(t,s);const e=this._e();if(null===e)return null;const{bubbles:i=!1,cancelable:n=!1,detail:r}=s;return e.initCustomEvent(t,i,n,r),e}static _e(){try{return document.createEvent("CustomEvent")}catch{return null}}}si.Ae="cs.tracking.";class ei{constructor(){this._isStarted=!1}get isStarted(){return this._isStarted}start(...t){this._isStarted||(this._isStarted=!0,this.onStart(...t))}stop(){this._isStarted&&(this._isStarted=!1,this.onStop())}restart(){this.stop(),this.start()}}let ii="null",ni=null;const ri=[];function oi(t){null==ni||ni.postMessage(t)}!i&&(()=>{var t;return i||!!(null===(t=document.body)||void 0===t?void 0:t.getAttribute("data-cs-tag-extension"))})()&&(window._uxa?_uxa.push(["debugEvents",!0]):window._uxa=[["debugEvents",!0]],ni=new BroadcastChannel("cs-tag"),document.addEventListener("cs.tracking.recordingEvent",(t=>{oi({type:"UXA_EVENT",event:t.detail})})),ni.addEventListener("message",(t=>{if("CONNECT"===t.data.type){if(t.data.sessionId===ii)return;ii=t.data.sessionId,csArray.prototype.forEach.call(ri,(t=>t())),null==ni||ni.postMessage({type:"CONNECTED",sessionId:ii})}})));class hi{constructor(t,s=""){this.name=t,this.format=s}}class ci extends hi{constructor(t){super(t,"Value: {count}"),this.count=0}increase(t=1){this.count+=t}decrease(){this.count>0&&this.count--}clear(){this.count=0}getData(){return{count:this.count}}}class ai extends hi{constructor(t){super(t,"Living intances: {instances}
Added: {added}
Removed: {removed}"),this.added=0,this.removed=0}get value(){return this.added-this.removed}increase(){this.added++}decrease(){this.removed++}getData(){return{added:this.added,removed:this.removed,instances:this.added-this.removed}}}class ui extends hi{constructor(t){super(t,"Count: {count}
Average: {average}ms
Total: {total}ms"),this.total=0,this.count=0}get average(){return this.count?this.total/this.count:0}measure(t){const s=bs.elapsed();t(),this.count++,this.total+=bs.elapsed()-s}asyncMeasure(){const t=bs.elapsed();return()=>{this.count++,this.total+=bs.elapsed()-t}}getData(){return{total:this.total,count:this.count,average:this.average}}}const li={general:{category:"General",nbEvents:new ci("Nb of Events"),pendingTasks:new ci("Pending Tasks"),pendingEvents:new ci("Pending Tasks"),nbOfMutationObservers:new ai("Nb of Mutation Observers")},mutations:{category:"Mutations",initialDOM:new ui("Initial DOM"),pendingMutations:new ci("Nb of Mutations scheduled"),serializedMutations:new ui("Serialized Mutations"),count:new ci("Mutation Count"),elementMutationObserved:new ai("Nb of Elements Observed by MutationObserver"),unobserveGarbageCollection:new ui("Unobserve GC")},visibilityObserver:{category:"Visibility Observer",hiddenElements:new ci("Nb of Hidden Elements "),nbElements:new ci("Nb of Elements")}};let di=null;var fi,vi,mi,pi,wi;fi=()=>{const t=t=>Object.keys(t),s=csArray.prototype.map.call(t(li),(t=>li[t])),e=csArray.prototype.map.call(s,(s=>csArray.prototype.filter.call(csArray.prototype.map.call(t(s),(t=>s[t])),(t=>t instanceof hi)))),i=csArray.prototype.map.call(s,((t,s)=>({category:t.category,performanceCounters:csArray.prototype.map.call(e[s],(t=>({name:t.name,format:t.format})))})));oi({type:"UXA_PERFORMANCE_COUNTER_SCHEMA",event:i}),di||(di=csSetInterval((()=>{const t=Ot(Nt(e,(t=>Nt(t,(t=>t.getData())))),(t=>t));oi({type:"UXA_PERFORMANCE_COUNTER",event:t})}),1e3))},i||(null!==ii&&csSetTimeout(fi),csSetTimeout((()=>csArray.prototype.push.call(ri,fi)))),function(t){t.QUOTA_REACHED="X",t.RECORDING_RULES_TARGETING="8",t.ANALYTICS_ONLY_RULES_TARGETING="9",t.ANALYTICS_ONLY="0",t.RECORDING_GLOBAL_SAMPLING="5",t.RECORDING_TEMPORARILY="T",t.RECORDING_URL_SAMPLING="6",t.RECORDING_ETR_SAMPLING="7",t.RECORDING_BLOCKED_BY_CONSENT_NOT_EXPRESSED="B",t.RECORDING_BLOCKED_BY_CONSENT_WITHDRAWN="W"}(vi||(vi={})),function(t){t.ETR_OFF="0",t.ETR_ON="1"}(mi||(mi={})),function(t){t.ETR_LEGACY="0",t.ETR_SESSION="1",t.ETR_PAGE="2"}(pi||(pi={})),function(t){t.ETR_DISABLED="0",t.ETR_PENDING="1",t.ETR_SAVED_PAGE="2",t.ETR_SAVED_SESSION="3",t.ETR_NOT_SAVED_SESSION="9"}(wi||(wi={}));function gi(t,s,e,i){var n,r=arguments.length,o=r<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,e,i);else for(var h=t.length-1;h>=0;h--)(n=t[h])&&(o=(r<3?n(o):r>3?n(s,e,o):n(s,e))||o);return r>3&&o&&Object.defineProperty(s,e,o),o}Object.create;Object.create;function yi(t){return Ns(t,"data:")}function Ei(t){const s=csString.prototype.trim.call(t);if(""===t)return[];let[e,i]=(n=s,csString.prototype.split.call(n,/\s(.+)/));var n;return i?(Os(e,",")||(i=function(t){return csString.prototype.split.call(t,/,(.+)/)[1]||""}(i)),[Ai(e),...Ei(i)]):[Ai(e)]}function Ai(t){return csString.prototype.split.call(t,/,$/)[0]}const _i=/(@import\s*("([^"]+)"|'([^']+)'))|(url\s*\(\s*((("([^"\]]+)"|'([^'\]]+)')\s*)|([^)\]]+))\))/g;function Si(t,s){const e=csString.prototype.replace.call(t,_i,((...t)=>{const e=t[3]||t[4],i=t[9]||t[10]||t[11],n=function(t){const s=/(\\)*\\(?:([a-fA-F0-9]{1,6})|(.))[\n\t\x20]?/g;return csString.prototype.replace.call(t,s,((t,s,e,i)=>{if("\\"===s)return csString.prototype.slice.call(t,1);if(i)return i;const n=parseInt(e,16);return 55296<=n&&n<=57343||0===n||n>1114111?"�":csString.fromCodePoint(n)}))}((e||i).trim());return`${e?"@import ":""}url(${function(t){if(-1===csString.prototype.indexOf.call(t,'"'))return`"${t}"`;if(-1===csString.prototype.indexOf.call(t,"'"))return`'${t}'`;return t}(s(n)||n)})`}));return e}function Ri(t){const s=new Set;return Si(t,(t=>{var e,i;return s.add(null!==(i=null===(e=csString.prototype.match.call(t,/^["|'](.*)?["|']$/))||void 0===e?void 0:e[1])&&void 0!==i?i:t),t})),Ut(s)}const Ti=new Map,Ii=!i&&document.implementation.createHTMLDocument("");function Pi(t){if(!V(t))return null;const s=bi(t);if(null===s||0===s.length)return null;let e="";if(S(t.textContent))$t(s,(t=>e+=t.cssText));else{const i=function(t){if(!Ii)return 0;let s=Ti.get(t.textContent);if(s)return s;const e=t.cloneNode(!0);e.textContent=t.textContent,Ii.head.appendChild(e);const i=bi(e);return s=i?i.length:0,Ti.set(t.textContent,s),Ii.head.removeChild(e),s}(t);if(i===s.length)return null;if(i>s.length)return null;const n=new csArray(s.length-i);for(let t=i,e=0;te+=t.cssText))}return e}function bi(t){try{if(t.disabled)return null;const s=t.sheet;return s?s.cssRules||s.rules:null}catch(t){if("SecurityError"!==t.name&&"InvalidAccessError"!==t.name)throw t;return null}}const Vi=t=>t instanceof HTMLFormElement?"form":t.localName;class Ci{constructor(t){this.csId=Ge(t),this.props=ze.getStore(t)}}class ki extends Ci{constructor(t){super(t),this.nodeType=3,this.data=t.data}}class Ni extends Ci{constructor(t){var s;super(t),this.attributes=[],this.nodeType=1,this.localName=Vi(t),this.namespaceURI=null!==(s=t.namespaceURI)&&void 0!==s?s:void 0,this.children=[];const e=Pi(t);if(e){this.children=new csArray(csNodechildNodes.apply(t).length);const s=document.createTextNode(e),i=new ki(s);csArray.prototype.push.call(this.children,i)}O(t)&&Be.setProperty(this,"SVG",!0)}static isElement(t){return 1===t.nodeType}static getAttribute(t,s){return xt(t.attributes,(t=>t.name===s))}static getAttributeValue(t,s){var e;return null===(e=this.getAttribute(t,s))||void 0===e?void 0:e.value}}class Oi{constructor(t){this.type="asyncEvent",this.Se=!1,t&&t((t=>this.resolve(t)))}resolve(t){if(this.Se)throw new Error("AsyncEvent already resolve.");null==t.timestamp&&(t={...t,timestamp:this.timestamp}),this.Re=t,this.Se=!0,this.Qs&&this.Qs(this.Re)}complete(t){this.Se&&t(this.Re),this.Qs=t}wait(){return new Promise((t=>this.complete(t)))}}let $i=(xi="queueMicrotask",Mi=csSetTimeout,void 0!==n[xi]?n[xi]:Mi);var xi,Mi;"object"==typeof window&&E(window.csQueueMicrotask)&&($i=window.csQueueMicrotask);const Li=new pt,Di=new pt;let Ui=1;function Fi(t,s="high"){const e=Ui;Li.isEmpty&&Di.isEmpty&&Hi((()=>{if(Ui!==e)return;const t=It((()=>{for(;!Di.isEmpty;){Di.pop()()}for(;!Li.isEmpty;){Li.pop()()}Di.isEmpty||t()}),"groupMicrotask.run");t()}));const i=mt(`groupMicrotask:${s}:${t.name||t.toString()}`,t);"high"===s?Di.push(i):Li.push(i)}function Hi(t,s=10){$i(0===s?t:()=>Hi(t,s-1))}async function zi(t=1){for(let s=0;sFi(t)))}const Bi=(t,s=0)=>csSetTimeout(function(t){return function(){try{t.apply(window,arguments)}catch(t){ft.critical(t)}}}(t),s);function qi(){const t=new Set;return{add(s){t.add(s),1===t.size&&csSetTimeout((()=>{t.clear()}))},has:s=>t.has(s),del(s){t.delete(s)},clear(){t.clear()},values:()=>Ut(t),get count(){return t.size}}}function ji(t,s=!1){const e=qi();return{push(i){if(0===e.count){(s?Fi:csSetTimeout)((()=>{t(e.values()),e.clear()}))}e.add(i)}}}const Gi=csSymbol();class Zi{constructor(t){var s,e,i,n,r,o,h,c;this.Qs=t,this.Te=null,this.Ie=null,this.Pe=null,this.be=null,this.Ve=ji((t=>this.processUpdateRulesInATick(t))),this.Qs=s=>Fi((()=>t(s))),"function"==typeof(null===(e=null===(s=window.CSSStyleSheet)||void 0===s?void 0:s.prototype)||void 0===e?void 0:e.insertRule)&&(this.Te=Re({target:window.CSSStyleSheet.prototype,methodName:"insertRule",hook:({context:t,args:s})=>{this.processInsertRule(t,s)}})),"function"==typeof(null===(n=null===(i=window.CSSStyleSheet)||void 0===i?void 0:i.prototype)||void 0===n?void 0:n.deleteRule)&&(this.Ie=Re({target:window.CSSStyleSheet.prototype,methodName:"deleteRule",hook:({context:t,args:s})=>{this.processDeleteRule(t,s)}})),"function"==typeof(null===(o=null===(r=window.CSSGroupingRule)||void 0===r?void 0:r.prototype)||void 0===o?void 0:o.insertRule)&&(this.Pe=Re({target:window.CSSGroupingRule.prototype,methodName:"insertRule",hook:({context:t})=>this.processUpdateRule(t)})),"function"==typeof(null===(c=null===(h=window.CSSGroupingRule)||void 0===h?void 0:h.prototype)||void 0===c?void 0:c.deleteRule)&&(this.be=Re({target:window.CSSGroupingRule.prototype,methodName:"deleteRule",hook:({context:t})=>this.processUpdateRule(t)}))}observe(){var t,s,e,i;null===(t=this.Te)||void 0===t||t.activate(),null===(s=this.Ie)||void 0===s||s.activate(),null===(e=this.Pe)||void 0===e||e.activate(),null===(i=this.be)||void 0===i||i.activate()}disconnect(){var t,s,e,i;null===(t=this.Te)||void 0===t||t.deactivate(),null===(s=this.Ie)||void 0===s||s.deactivate(),null===(e=this.Pe)||void 0===e||e.deactivate(),null===(i=this.be)||void 0===i||i.deactivate()}processInsertRule(t,[s,e]){if(null==t[Gi]&&!t.ownerNode)return;const i={type:"cssRuleInserted",sheet:t,rule:s,index:e};this.Qs(i)}processUpdateRule(t){let s=t;for(;null!==s.parentRule;)s=s.parentRule;null!==s.parentStyleSheet&&this.Ve.push(s)}processUpdateRulesInATick(t){for(const s of t){if(null===s.parentStyleSheet)return;const t=s.parentStyleSheet,e=csArray.prototype.indexOf.call(kt(t.cssRules),s);if(-1===e)return;const i={type:"cssRuleUpdated",sheet:t,rule:s.cssText,index:e};this.Qs(i)}}processDeleteRule(t,[s]){if(null==t[Gi]&&!t.ownerNode)return;const e={type:"cssRuleDeleted",sheet:t,index:s};this.Qs(e)}}os([vt()],Zi.prototype,"observe",null),os([vt()],Zi.prototype,"disconnect",null),os([vt()],Zi.prototype,"processInsertRule",null),os([vt()],Zi.prototype,"processUpdateRule",null),os([vt()],Zi.prototype,"processUpdateRulesInATick",null),os([vt()],Zi.prototype,"processDeleteRule",null);class Wi{constructor(t){this.Ce=1,this.ke=new Set,this.Ne=null,this.Oe=null,this.$e=(t,s)=>{"initial"!==s&&"added"!==s||this.setStyleSheets(t,t.adoptedStyleSheets)},this.xe=t=>{const s=t.sheet;if(this.ke.has(s))if("cssRuleInserted"===t.type){const e={type:"adoptedStyleSheetRuleInserted",sheetId:s[Gi],rule:t.rule,index:t.index};this.Qs(e)}else if("cssRuleDeleted"===t.type){const e={type:"adoptedStyleSheetRuleDeleted",sheetId:s[Gi],index:t.index};this.Qs(e)}else if("cssRuleUpdated"===t.type){const e={type:"adoptedStyleSheetRuleUpdated",sheetId:s[Gi],rule:t.rule,index:t.index};this.Qs(e)}},this.Qs=s=>Fi((async()=>{await zi(2),t(s)})),this.se=new Pe(this.$e),"adoptedStyleSheets"in Document.prototype&&(this.Ne=Te(window.Document.prototype,"adoptedStyleSheets",((t,s)=>{this.setStyleSheets(t,s)}))),"ShadowRoot"in window&&"adoptedStyleSheets"in window.ShadowRoot.prototype&&(this.Oe=Te(window.ShadowRoot.prototype,"adoptedStyleSheets",((t,s)=>{this.setStyleSheets(t,s)}))),this.Me=new Zi(this.xe)}observe(){var t,s;this.setStyleSheets(document,document.adoptedStyleSheets),this.se.observe(),null===(t=this.Ne)||void 0===t||t.activate(),null===(s=this.Oe)||void 0===s||s.activate(),this.Me.observe()}disconnect(){var t,s;this.ke.clear(),this.se.disconnect(),null===(t=this.Ne)||void 0===t||t.deactivate(),null===(s=this.Oe)||void 0===s||s.deactivate(),this.Me.disconnect()}setStyleSheets(t,s){if(!s.length)return;this.Le(s);const e={type:"adoptedStyleSheetsSet",target:t,sheetsIds:Nt(s,(t=>t[Gi]))};this.Qs(e)}Le(t){$t(t,(t=>{if(this.ke.has(t))return;const s=this.Ce++;t[Gi]=s,this.ke.add(t);const e={type:"adoptedStyleSheetRegistered",sheetId:s,cssRules:this.De(t)};this.Qs(e)}))}De(t){let s=[];try{s=Nt(t.cssRules,(t=>t.cssText))}catch{}return s}}os([vt()],Wi.prototype,"observe",null),os([vt()],Wi.prototype,"disconnect",null),os([vt()],Wi.prototype,"setStyleSheets",null);const Qi=It((function(t){const s=function(){const t=new Set,s=new Set,e=new Set,i=new Set,n=new Map,r=new Map,o=new Map,h=new Set,c=new Set,a=new Map,u=new Set;return{isMovedNode:s=>t.has(s),markAsMovedNode(s){u.delete(s),t.add(s)},isDetachedMove:t=>!!Ht.findAncestor(t,(t=>u.has(t)),!0),isAddedNode(e){const i=Ht.findAncestor(e,(e=>s.has(e)||c.has(e)||t.has(e)),!0);return!!i&&!t.has(i)},isMovedNodeIntoAddedNode:e=>t.has(e)&&!!Ht.findAncestor(e,(t=>s.has(t)||c.has(t)),!0),markAsAddedNode(t){u.delete(t),c.delete(t),s.add(t)},markAsPendingInsert(t){c.add(t)},isPendingInsert:t=>c.has(t),isRemovedNode:t=>!!Ht.findAncestor(t,(t=>e.has(t)),!0),markAsRemovedNode(t){e.add(t)},isUselessNode:t=>i.has(t),markAsUselessNode(t){i.add(t)},getPlaceholder(t,s){const e="previous"===s?r:n;return t&&e.has(t)?e.get(t)||null:t},getSiblings(t){const s=t.addedNodes.length,e=this.getPlaceholder(t.previousSibling,"previous"),i=this.getPlaceholder(t.nextSibling,"next");if(s){let o=e,h=i,c=t.previousSibling!==e,a=t.nextSibling!==i;for(let e=0;ea.get(t)===s,markAsFutureAddedNode(t){a.has(t)||u.add(t)},isTextMutated:t=>h.has(t),setTextMutated:t=>h.add(t)}}(),e=[];for(const e of t)"childList"===e.type&&Ki(e,s);for(const i of t)switch(i.type){case"attributes":Xi(i,s,e);break;case"characterData":Ji(i,s,e);break;case"childList":sn(i,s,e)}return e}),"optimizeMutations"),Yi=csSymbol.for("ignoreNextSerialization");function Ki(t,s){for(let e=0;e{if(a){const{childListType:t,movedNodes:s,...i}=a;csArray.prototype.push.call(e,"added"===t?i:{...i,movedNodes:s}),a=null}},l=s=>s===(null==a?void 0:a.childListType)?a:(u(),{childListType:s,type:"childList",target:t.target,addedNodes:[],removedNodes:[],movedNodes:[],previousSibling:c,nextSibling:h});if(i){for(let e=0;e{if(Ht.isConnected(t)){if(!n&&!s.isPendingInsert(t)){if(s.isDetachedMove(t))return!0;s.markAsMovedNode(t),s.isMovedNodeIntoAddedNode(t)&&(t[Yi]=!0)}return!1}return!s.isUselessNode(t)&&(s.markAsRemovedNode(t),!0)}));return d.length&&csArray.prototype.push.call(e,{type:"childList",removedNodes:d,addedNodes:[],movedNodes:[],target:t.target,nextSibling:h,previousSibling:c}),e}var en;const nn={childList:!0,subtree:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,attributeOldValue:!0};class rn{static setShadowRootFilter(t){csArray.prototype.push.call(en.shadowRootFilters,t)}static Ue(t){if(en.shadowRootFilters.length>0&&L(t))for(let s=0;s{this.isRefreshing=!1;const t=this.mutationObserver.takeRecords();t.length&&en.mutationCallback(t),this.mutationObserver.disconnect(),this.observedTargets.forEach((t=>{this.mutationObserver.observe(t,nn)}))}))))}static observe(t,s){csArray.prototype.push.call(this.callbacks,t),s&&csArray.prototype.push.call(this.shadowRootCallbacks,s),this.started?s&&csArray.prototype.forEach.call(bt.getAllShadowHosts(document),(t=>s(csElementshadowRoot.apply(t),"initial"))):(this.mutationObserver=new csMutationObserver(this.mutationCallback),this.Ue(document),this.shadowRootObserver=new Pe(this.onShadowRoot),this.shadowRootObserver.observe(),this.started=!0,$t(this.shadowRootObserver.shadowRoots,(t=>{this.Ue(t)})))}static disconnect(t,s){var e,i;this.callbacks=csArray.prototype.filter.call(this.callbacks,(s=>s!==t)),s&&(this.shadowRootCallbacks=csArray.prototype.filter.call(this.shadowRootCallbacks,(t=>t!==s))),0===this.callbacks.length&&(this.callbacks=[],this.shadowRootCallbacks=[],en.shadowRootFilters=[],null===(e=this.shadowRootObserver)||void 0===e||e.disconnect(),null===(i=this.mutationObserver)||void 0===i||i.disconnect(),this.observedTargets.clear(),this.started=!1)}constructor(t,s){this.Qs=t,this.Fe=s;const e=ji((s=>t(s,this)),!0);this.Qs=mt("DocumentMutationObserver:callback",(t=>{$t(t,(t=>e.push(t)))}))}get shadowRoots(){var t,s;return null!==(s=null===(t=en.shadowRootObserver)||void 0===t?void 0:t.shadowRoots)&&void 0!==s?s:[]}takeRecords(){var t;const s=null===(t=en.mutationObserver)||void 0===t?void 0:t.takeRecords(),e=en.shadowRootObserver.takeRecords();return(null==s?void 0:s.length)&&e.length?function(t,s,e){const i=t.length+s.length+((null==e?void 0:e.length)||0),n=new csArray(i);let r=0;for(let s=0;s{li.mutations.count.increase(t.length),csArray.prototype.forEach.call(en.callbacks,(s=>s(t,en.mutationObserver)))},rn.onShadowRoot=(t,s)=>{$t(en.shadowRootCallbacks,(e=>e(t,s))),"removed"!==s?en.Ue(t):en.disconnectShadowRoot(t)},rn.isRefreshing=!1,os([vt()],rn.prototype,"observe",null),os([vt()],rn.prototype,"disconnect",null);class on{constructor(t){this.Qs=t,this.He=t=>{t.sheet.ownerNode&&("cssRuleInserted"===t.type?this.Qs({type:t.type,target:t.sheet.ownerNode,rule:t.rule,index:t.index}):"cssRuleDeleted"===t.type?this.Qs({type:t.type,target:t.sheet.ownerNode,index:t.index}):"cssRuleUpdated"===t.type&&this.Qs({type:t.type,target:t.sheet.ownerNode,rule:t.rule,index:t.index}))},this.Qs=s=>Fi((()=>t(s))),this.ze=new Zi((t=>Fi((async()=>{await zi(),this.He(t)})))),"adoptedStyleSheets"in Document.prototype&&(this.Be=new Wi(t))}observe(){var t;this.Fs=new rn((t=>this.qe(t)),((t,s)=>{"added"===s&&this.je(t)})),this.Fs.observe(),this.ze.observe(),null===(t=this.Be)||void 0===t||t.observe()}disconnect(){var t,s;null===(t=this.Fs)||void 0===t||t.disconnect(),this.ze.disconnect(),null===(s=this.Be)||void 0===s||s.disconnect()}qe(t){const s=Qi(t);for(let t=0;tt))};this.Qs(s)}}je(t){const s={type:"shadowRootAttached",target:t.host,shadowRoot:t};this.Qs(s)}}os([vt()],on.prototype,"processAttributeChanged",null),os([vt()],on.prototype,"processCharacterDataChanged",null),os([vt()],on.prototype,"processChildListChanged",null);class hn extends Ci{constructor(t){super(t),this.nodeType=4,this.data=t.data}}class cn extends Ci{constructor(t){super(t),this.nodeType=8,this.data=t.data}}class an extends Ci{constructor(t){super(t),this.nodeType=10,this.name=t.name,this.publicId=t.publicId,this.systemId=t.systemId}}class un extends Ci{constructor(t){super(t),this.nodeType=9,this.baseURI=un.getBaseURI(t),this.children=[]}static getBaseURI(t){let s=t.baseURI;if(null==s){const e=t.getElementsByTagName("base");s=0!==e.length?e[0].href:t.URL}return s}}class ln extends Ci{constructor(t){super(t),this.nodeType=11,this.mode=t.mode,this.children=[]}}class dn{constructor(t,s,e){var i;"string"==typeof t?(this.name=t,this.value=s,this.namespaceURI=null!=e?e:""):(this.name=t.name,this.value=t.value,this.namespaceURI=null!==(i=t.namespaceURI)&&void 0!==i?i:"")}static create(t){var s,e;const i=t.attributes,n=new csArray(i.length);for(let r=0;re(t))),r=new pt,o=(s,e)=>{s.hasChildNodes()&&r.push({node:s,serializedNode:e});const i=s instanceof Element&&csElementshadowRoot.apply(s);if(i){const s=e.shadowRoot=yn(i);t.async&&t.initialDOM&&Be.setProperty(i,vn,!0),o(i,s)}};let h,c=!0,a=8;const u=mt("work",(()=>{var i;if(c)h=yn(s),t.async&&t.initialDOM&&Be.setProperty(s,vn,!0),o(s,h),c=!1;else if(r.isEmpty)return;const l=function(t){if(t<1)throw new Error("Precision should be >= 1");let s=0,e=performance.now();return{started:e,elapsed(){return++s%t==0&&(e=performance.now()),e-this.started}}}(100);for(;!r.isEmpty;){if(t.async&&l.elapsed()>=t.workTime)return void(--a<=0&&csSetTimeout(u));const{node:s,serializedNode:e}=r.pop(),n=null!==(i=e.children)&&void 0!==i?i:[];if(N(s))continue;let h=0;for(let e=csNodefirstChild.apply(s);e;e=csNodenextSibling.apply(e)){if(pn(e))continue;const s=yn(e);t.async&&t.initialDOM&&Be.setProperty(e,vn,!0),n[h++]=s,o(e,s)}}t.async?csSetTimeout((()=>n(h))):e(h)}));if(t.async)for(let t=0;ts(t))))}onStop(){}start(){this.isStarted||(this.isStarted=!0,this.onStart())}stop(){this.isStarted&&(this.isStarted=!1,this.onStop(),this.Ge=[])}stopForInactivity(){this.isStarted&&(this.isStarted=!1,this.onStop())}subscribe(t){return csArray.prototype.push.call(this.Ge,t),()=>{const s=csArray.prototype.indexOf.call(this.Ge,t);csArray.prototype.splice.call(this.Ge,s,1)}}}const An=wn();class _n extends En{constructor(){super(...arguments),this.Ze=!1}onStart(){this.Ze=!0,this.Qs=function(t,s){let e=!1;const i=function(){if(!e)return t.apply(s,arguments)};return i.cancel=()=>e=!0,i}(this.We,this),this.Qe=new on(this.Qs),this.Qe.observe();const t=li.mutations.initialDOM.asyncMeasure(),s=()=>{this.Ze=!1,vn=csSymbol("InitialDom"),t()};this.produceEvent(new Oi((t=>An(document,(e=>{s(),t({type:"DomEvent",domEvent:"initialDOM",initialDOM:e})})))))}onStop(){var t,s;this.Ze=!1,null===(t=this.Qs)||void 0===t||t.cancel(),null===(s=this.Qe)||void 0===s||s.disconnect()}Ye(t,s){const e={type:"DomEvent",domEvent:s.type,target:0,targetProps:{}};return"target"in s&&(e.target=Ge(s.target),e.targetProps=Be.getProperties(s.target)),[s,e]}We(t){if(!this.Ke(t))switch(t.type){case"attributeChanged":{const[s,e]=this.Ye(t.type,t);e.attribute=s.attribute,e.isSvg=O(s.target),e.namespace=s.namespace,e.newValue=s.newValue,e.oldValue=s.oldValue,e.localName=Vi(s.target),e.linkRel=I(s.target)?s.target.rel:null,e.parentLocalName=s.target.parentElement?Vi(s.target.parentElement):void 0,"input"===e.localName&&(e.inputType=s.target.getAttribute("type")),this.produceEvent(e)}break;case"characterDataChanged":{const[s,e]=this.Ye(t.type,t);e.newValue=s.newValue,e.oldValue=s.oldValue,e.targetNodeType=s.target.nodeType,e.parentLocalName=s.target.parentElement?Vi(s.target.parentElement):null,e.parentProps=s.target.parentElement?Be.getProperties(s.target.parentElement):void 0,this.produceEvent(e)}break;case"nodesAdded":{const[s,e]=this.Ye(t.type,t);e.targetLocalName=R(s.target)?Vi(s.target):null,e.nextSibling=s.nextSibling?Ge(s.nextSibling):null,e.previousSibling=s.previousSibling?Ge(s.previousSibling):null,li.mutations.serializedMutations.measure((()=>{e.nodes=Nt(s.nodes,gn)})),this.produceEvent(e);break}case"nodesMoved":{const[s,e]=this.Ye(t.type,t);e.previousSibling=s.previousSibling?Ge(s.previousSibling):null,e.nextSibling=s.nextSibling?Ge(s.nextSibling):null,e.nodesIds=Nt(s.nodes,Ge),this.produceEvent(e);break}case"nodesRemoved":{const[s,e]=this.Ye(t.type,t);e.nodesIds=Nt(s.nodes,Ge),this.produceEvent(e);break}case"shadowRootAttached":{const[s,e]=this.Ye(t.type,t);e.shadowRoot=yn(s.shadowRoot),this.produceEvent(e);break}case"cssRuleInserted":{const[s,e]=this.Ye(t.type,t);e.index=s.index,e.rule=s.rule,this.produceEvent(e);break}case"cssRuleDeleted":{const[s,e]=this.Ye(t.type,t);e.index=s.index,this.produceEvent(e);break}case"cssRuleUpdated":{const[s,e]=this.Ye(t.type,t);e.rule=s.rule,e.index=s.index,this.produceEvent(e);break}case"adoptedStyleSheetRegistered":{const[s,e]=this.Ye(t.type,t);e.sheetId=s.sheetId,e.cssRules=s.cssRules,this.produceEvent(e);break}case"adoptedStyleSheetsSet":{const[s,e]=this.Ye(t.type,t);e.sheetsIds=s.sheetsIds,this.produceEvent(e);break}case"adoptedStyleSheetRuleInserted":{const[s,e]=this.Ye(t.type,t);e.sheetId=s.sheetId,e.rule=s.rule,e.index=s.index,this.produceEvent(e);break}case"adoptedStyleSheetRuleDeleted":{const[s,e]=this.Ye(t.type,t);e.sheetId=s.sheetId,e.index=s.index,this.produceEvent(e);break}case"adoptedStyleSheetRuleUpdated":{const[s,e]=this.Ye(t.type,t);e.sheetId=s.sheetId,e.rule=s.rule,e.index=s.index,this.produceEvent(e);break}}}Je(t){return this.Ze&&!Be.getProperty(t,vn)}Ke(t){switch(t.type){case"nodesAdded":case"nodesMoved":case"nodesRemoved":case"shadowRootAttached":return this.Je(t.target)||Ye.isMaskedElement(t.target)||Ye.isMaskedElementChild(t.target);case"characterDataChanged":{const s=t.target.parentElement;return null!==s&&(this.Je(s)||Ye.isMaskedElement(s)||Ye.isMaskedElementChild(s))}case"attributeChanged":return this.Je(t.target)||Ye.isMaskedElementChild(t.target)||Ye.isMaskedAttribute(t.target,t.attribute);case"cssRuleInserted":case"cssRuleDeleted":case"cssRuleUpdated":return this.Je(t.target)||Ye.isMaskedElementChild(t.target);default:return!1}}}var Sn,Rn,Tn,In;!function(t){t.isDOMEvent=function(t){return"DomEvent"===t.type}}(Sn||(Sn={}));class Pn{constructor(){this.Ge=[]}start(){}stop(){this.Ge.length=0,this.Ge=[]}pushEvent(t){if(Pn.pendingEvents++,this.isListening(t)){const s=this.Ge;csSetTimeout((()=>{const e=mt("Processor:processEvent",(t=>this.processEvent(t))),i=e(t);null!=i&&csArray.prototype.forEach.call(s,(t=>t(i))),Pn.pendingEvents--}))}else csSetTimeout((()=>{csArray.prototype.forEach.call(this.Ge,(s=>s(t)))}))}subscribe(t){return csArray.prototype.push.call(this.Ge,t),()=>{this.Ge=csArray.prototype.filter.call(this.Ge,(s=>s!==t))}}emitEvent(t){Fi((()=>csArray.prototype.forEach.call(this.Ge,(s=>s(t)))))}}function bn(t){const s=new ArrayBuffer(t.length),e=new Uint8Array(s);for(let s=0,i=t.length;scsString.prototype.padStart.call(t.toString(16),2,"0"))),"")}function Nn(t){const s=-1!==csString.prototype.indexOf.call(t,";base64,"),e=csString.prototype.indexOf.call(t,","),i=s?[csString.prototype.substring.call(t,0,e-7),csString.prototype.substring.call(t,e+1)]:[csString.prototype.substring.call(t,0,e),csString.prototype.substring.call(t,e+1)];if(!s&&/^%3Csvg/i.test(i[1]))try{i[1]=decodeURIComponent(i[1])}catch(t){ft.warn(`${t}, calling decodeURIComponent on: ${i[1]}`)}const n=s?Cn(i[1]):bn(i[1]);return new Blob([n],{type:csString.prototype.replace.call(i[0],"data:","")})}Pn.pendingEvents=0,function(t){t.ELLIPSIS="…",t.stringReplaceAll=function(t,s,e){if("replaceAll"in csString.prototype)return csString.prototype.replaceAll.call(t,s,e);const i=new csRegExp((n=s,csString.prototype.replace.call(n,/[.*+?^${}()|[\]\\]/g,"\\$&")),"g");var n;return csString.prototype.replace.call(t,i,e)},t.truncate=function(t,s,e=""){return t.length<=s?t:csString.prototype.slice.call(t,0,s-e.length)+e}}(Rn||(Rn={}));class On{static async toStaticResourceEvent(t,s,e){const i=await On.Xe(t);if(!i)return null;const n=await On.ti(i),r=yi(t)?void 0:t,o={type:"StaticResourceManagerEvent",timestamp:e,resourceId:s,resource:{hash:n,data:i}};return r&&(o.originalResourceName=r),o}static async toCSSStaticResourceEvent(t,s,e,i){const n=await On.si(t,i),r=zs(t),o=n.get(r);if(!o)return null;const h={type:"StaticResourceManagerEvent",timestamp:e,resourceId:s,resource:{hash:o.hash,data:o.data}};return n.delete(r),n.size&&(h.nestedResources=[],n.forEach((t=>{t&&csArray.prototype.push.call(h.nestedResources,{hash:t.hash,data:t.data})}))),h}static async ti(t){const s=await t.arrayBuffer();return kn(await crypto.subtle.digest(this.ei,s))}static async Xe(t){let s;if(yi(t)){const e=Nn(t);if(!e)return null;s=e}else{const e=await window.fetch(t);s=await e.blob()}return s}static async si(t,s){const e=new Map,i=[{resourceRawPath:t,resourceAbsolutePath:zs(t)}];for(;i.length>0;){const t=csArray.prototype.pop.call(i);if(!s&&null!==t.resourceAbsolutePath&&!yi(t.resourceAbsolutePath))e.set(t.resourceAbsolutePath,null);else if(void 0===e.get(t.resourceAbsolutePath))try{if(null===t.resourceRawPath||csString.prototype.indexOf.call(t.resourceRawPath,".css")>0){if(!t.data){const s=await fetch(t.resourceAbsolutePath);t.data=await s.text()}t.nestedResources||(t.nestedResources=Ri(t.data));let s=!1,o=!1;for(const h of t.nestedResources){const c=yi(h)?h:t.resourceAbsolutePath?(n=h,r=t.resourceAbsolutePath,new csURL(n,r).href):zs(h),a=e.get(c);if(void 0!==a){if(null!==a){const s=On.ii(a,h);t.data=Rn.stringReplaceAll(t.data,h,s)}continue}const u=void 0!==xt(i,(t=>t.resourceAbsolutePath===c));u||(s=!0,o||(csArray.prototype.push.call(i,t),o=!0),csArray.prototype.push.call(i,{resourceRawPath:h,resourceAbsolutePath:c}))}if(!s){const s=await On.ni(t.data);e.set(t.resourceAbsolutePath,{hash:s.hash,data:s.data})}}else{let s;if(yi(t.resourceAbsolutePath)){const i=Nn(t.resourceAbsolutePath);if(!i){e.set(t.resourceAbsolutePath,null);continue}s=i}else{const e=await fetch(t.resourceAbsolutePath);s=await e.blob()}const i=await On.ti(s);e.set(t.resourceAbsolutePath,{hash:i,data:s})}}catch{e.set(t.resourceAbsolutePath,null)}}var n,r;return e}static ii(t,s){let e=`cs://resources/${t.hash}`;return yi(s)||(e+=`?${On.oi}=${s}`),e}static async ni(t){const s=new Blob([t],{type:"text/css"}),e=await s.arrayBuffer();return{data:s,hash:kn(await crypto.subtle.digest(On.ei,e))}}}On.ei="SHA-256",On.oi="original-resource-name";class $n extends Pn{constructor(){super(),this.hi="cssrm://",this.ci=0,this.ai=!1}isListening(t){return!!$n.isSupported()&&(!!Sn.isDOMEvent(t)&&("initialDOM"===t.domEvent||"nodesAdded"===t.domEvent||"attributeChanged"===t.domEvent||"characterDataChanged"===t.domEvent))}processEvent(t){switch(t.domEvent){case"initialDOM":case"nodesAdded":this.ui(t);break;case"attributeChanged":this.li(t);break;case"characterDataChanged":this.fi(t)}return t}disableOnlineAssets(){this.ai=!1}enableOnlineAssets(){this.ai=!0}isOnlineAssetsActivated(){return this.ai}ui(t){const s="initialDOM"===t.domEvent?[t.initialDOM]:t.nodes;for(const t of s)Be.traverse(t,((t,s)=>{if(3===t.nodeType&&s)return void this.mi(t,s.localName);if(!Ni.isElement(t))return;const e=xt(t.attributes,(t=>"style"===t.name));if(e&&(e.value=this.pi(e.value)),this.wi(t)||this.gi(t,s)){const s=xt(t.attributes,(t=>"src"===t.name));s&&s.value&&(s.value=this.yi(s.value));const e=xt(t.attributes,(t=>"srcset"===t.name));if(e)return void(e.value=this.Ei(e.value))}if(this.Ai(t)&&this.ai){const s=xt(t.attributes,(t=>"href"===t.name));if(!s||!s.value)return;this.ci++,this._i(zs(s.value),this.ci,!0),this.Si(t,s,this.ci)}}))}Si(t,s,e){csArray.prototype.push.call(t.attributes,{name:"data-cs-original-href",namespaceURI:"",value:s.value}),s.value=this.hi+e}mi(t,s){if(!t||"style"!==s)return;const e=this.pi(t.data);null!==e&&(t.data=e)}fi(t){if("style"!==t.parentLocalName||!t.newValue)return;const s=this.pi(t.newValue);null!==s&&(t.newValue=s)}li(t){if(!t.newValue||t.newValue===t.oldValue)return;const s="src"===t.attribute,e="srcset"===t.attribute;if("style"===t.attribute)return void(t.newValue=this.pi(t.newValue));if(!s&&!e)return;const i="img"===t.localName,n="source"===t.localName&&t.parentLocalName&&"picture"===t.parentLocalName;(i||n)&&(s&&(t.newValue=this.yi(t.newValue)),e&&(t.newValue=this.Ei(t.newValue)))}yi(t){return yi(t)||this.ai?(this.ci++,this._i(t,this.ci,!1,bs.now()),this.hi+this.ci):t}Ei(t){if(!this.ai)return t;let s=t;const e=Ei(t),i=bs.now();for(const t of e)this.ci++,this._i(zs(t),this.ci,!1,i),s=csString.prototype.replace.call(s,t,this.hi+this.ci);return s}pi(t){const s=Ri(t);let e=t;const i=bs.now();for(const t of s){const s=yi(t);if(!s&&!this.ai)continue;if(this.Ri(t))continue;this.ci++,e=csString.prototype.replace.call(e,t,this.hi+this.ci);const r=!!(n=t)&&Os(n,".css");s?this._i(t,this.ci,!1,i):this.ai&&(r?this._i(t,this.ci,!0,i):this._i(zs(t),this.ci,!1,i))}var n;return e}_i(t,s,e,i=bs.now()){const n=e?On.toCSSStaticResourceEvent:On.toStaticResourceEvent,r=new Oi((async e=>{try{const r=await n(t,s,i,this.ai);e(r||{type:"warning",message:`Failed to process static resource: ${t}`})}catch(t){e({type:"warning",message:t})}}));this.emitEvent(r)}wi(t){return"img"===t.localName}gi(t,s){return"source"===t.localName&&!!s&&"picture"===s.localName}Ai(t){return"link"===t.localName&&csArray.prototype.some.call(t.attributes,(t=>"rel"===t.name&&"stylesheet"===t.value))}static isSupported(){return Cs()&&function(){var t;return"undefined"!=typeof crypto&&E(null===(t=crypto.subtle)||void 0===t?void 0:t.digest)}()&&!!csArray.from}Ri(t){return 0===csString.prototype.replace.call(t,/['"]+/g,"").length}}gi([Pt("StaticResourceManagerProcessor.processEvent")],$n.prototype,"processEvent",null),function(t){t.Visible="visible",t.Hidden="hidden",t.Blur="blur",t.PagehideVisible="pagehideVisible",t.PagehideHidden="pagehideHidden",t.ExitPageByNavigate="exitPageByNavigate"}(Tn||(Tn={}));class xn{constructor(){this.Ti=!1,this.Ii=t=>{try{switch(t.type){case"visibilitychange":return"hidden"===document.visibilityState?this.Pi(Tn.Hidden):this.Pi(Tn.Visible);case"pagehide":return"hidden"===document.visibilityState?this.Pi(Tn.PagehideHidden):this.Pi(Tn.PagehideVisible);case"blur":return this.Pi(Tn.Blur);case"navigate":return this.bi(t)?this.Pi(Tn.ExitPageByNavigate):void 0;default:return}}catch{}}}start(){this.Ti||(this.Ti=!0,this.Vi(),this.Ci(),this.ki(),ks()&&this.Ni())}stop(){this.Ti&&(this.Ti=!1,this.Oi(),this.$i(),this.xi(),ks()&&this.Mi())}onEvent(t){this.Pi=t}Ni(){window.navigation.addEventListener("navigate",this.Ii)}Mi(){window.navigation.removeEventListener("navigate",this.Ii)}Vi(){document.addEventListener("visibilitychange",this.Ii)}Oi(){document.removeEventListener("visibilitychange",this.Ii)}Ci(){window.addEventListener("pagehide",this.Ii)}$i(){window.removeEventListener("pagehide",this.Ii)}ki(){window.addEventListener("blur",this.Ii)}xi(){window.removeEventListener("blur",this.Ii)}bi(t){return t instanceof NavigateEvent!=!1&&(!t.hashChange&&!t.downloadRequest&&!t.formData)}}!function(t){t[t.Active=0]="Active",t[t.Paused=1]="Paused",t[t.Stopped=2]="Stopped"}(In||(In={}));class Mn{constructor(t,s,e=[]){this.Li=t,this.Di=s,this.Ui=e,this.Fi=null,this.Hi=In.Active,this.zi=[]}reset(){this.Fi=null,this.zi=[],this.Hi=In.Active}disconnect(){this.Hi=In.Stopped}Bi(){this.Di(In.Paused),this.Hi=In.Paused,csSetTimeout((()=>{this.Hi===In.Paused&&this.qi()}),Mn.STOP_TIMEOUT)}ji(){this.Di(In.Active),this.Hi=In.Active,$t(this.zi,this.Li),this.zi=[]}qi(){this.zi=[],this.Di(In.Stopped),this.Hi=In.Stopped}pushEvent(t,s){if(s.isUserEvent&&(this.Fi=t.date,this.Hi!==In.Active))return this.ji(),void this.Li(t);if(this.Gi(t))this.Li(t);else switch(this.Hi){case In.Active:if(this.Zi(t,s))return this.Bi(),void csArray.prototype.push.call(this.zi,t);this.Li(t);break;case In.Paused:csArray.prototype.push.call(this.zi,t);case In.Stopped:}}Zi(t,s){return!s.isUserEvent&&null!==this.Fi&&t.date-this.Fi>Mn.INACTIVITY_TIMEOUT}Gi(t){return csArray.prototype.indexOf.call(this.Ui,t.type)>-1}}Mn.INACTIVITY_TIMEOUT=5e3,Mn.STOP_TIMEOUT=5e3;class Ln extends ei{constructor(t,s,e,i,n,r,o,h,c,a,u,l,d,f,v=[],m,p,w,g,y){super(),this.wt=t,this.Wi=s,this.Qi=e,this.Yi=i,this.Ki=n,this.Vt=r,this.Ji=o,this.Xi=h,this.tn=c,this.en=a,this.nn=u,this.rn=l,this.hn=d,this.cn=f,this.an=v,this.un=m,this.ln=p,this.dn=w,this.fn=g,this.vn=y,this.mn=0,this.wn=new si,this.gn={allowFromQuotaService:!0,allowFromSerialization:!0},this.yn=ke((()=>{this.Wi.eventsCount()>0&&this.En()}),2e3),this.An=t=>this.processBrowserEvent(t),this._n=t=>this.Sn(t),this.Rn=0,this.Tn=0,this.In=new xn,this.Pn=!1,this.bn=51200,this.Vn=!1,this.Cn=!1,this.kn=[],this.Nn=new Mn((t=>this.On(t)),(t=>{switch(t){case In.Active:this.$n();break;case In.Stopped:this.xn()}}),[Oe.RESOURCE_HASHES,Oe.TEXT_VISIBILITY]),this.Mn=t=>{this.rn.removeBatchInProgress(`${t.params.sn}.${t.params.pn}.${t.params.ri}`)}}init(){this.Ln(),this.nn.onLoad(this.Mn),this.nn.onError(this.Mn)}$n(){csArray.prototype.forEach.call(this.un,(t=>t.start()))}xn(){csArray.prototype.forEach.call(this.un,(t=>t.stopForInactivity()))}Ln(){var t,s,e;this.cn.onEvent(this.An,this._n),null===(t=this.en)||void 0===t||t.onInputNodeToEncrypt(this._n),null===(s=this.en)||void 0===s||s.onApiErrorToEncrypt((t=>{this.Dn(t)})),null===(e=this.en)||void 0===e||e.onUserIdentifierToEncrypt(this.An),this.In.onEvent((t=>{if(csSetTimeout((()=>this.Un("page-state",t))),t!==Tn.Visible){if(t===Tn.Blur)return this.Fn();if(!this.Pn)return this.Pn=!0,csSetTimeout((()=>{this.Pn=!1})),t===Tn.Hidden?this.Fn():this.Hn()}}))}isRecording(){return this.Vt.hasValidSession()&&this.isStarted}Fn(){if(!this.canSendEvents())return;this.cn.flush(),this.rn.saveBatchesInProgress(),$t(this.an,(t=>{var s,e;return $t(null!==(e=null===(s=t.getPendingEvents)||void 0===s?void 0:s.call(t))&&void 0!==e?e:[],(t=>this.Wi.addEvent(t)))}));const t=this.Wi.getEvents();if(0===t.length)return;this.Un("pending-events",this.cn.pendingEvents);const s=this.nn.getQueryParams();s.rst=this.getRecordingStartTimestamp(),s.let=this.getRecordingLastEventTimestamp();const e=this.Yi.getCurrentIndex();s.ri=e.toString(),this.hn.removeQueryParams(),this.hn.setQueryParams(s),this.Tn=t[t.length-1].date;const i=this.Wi.stringifyEvents();if(i.length>this.bn){const t=this.zn();if(t.length>0){const e=Kt(t);this.hn.send(e)||this.rn.save({key:`${s.sn}.${s.pn}.${s.ri}.last`,metadata:{...s,datatype:"json"},events:e}),this.Yi.increment()}if(this.Wi.eventsCount()>0){s.ri=this.Yi.getCurrentIndex().toString();const t=this.Wi.stringifyEvents();this.rn.save({key:`${s.sn}.${s.pn}.${s.ri}.last`,metadata:{...s,datatype:"json"},events:t}),this.Yi.increment()}}else{this.hn.send(i)||this.rn.save({key:`${s.sn}.${s.pn}.${s.ri}.last`,metadata:{...s,datatype:"json"},events:i}),this.Yi.increment()}this.hn.removeQueryParams(),this.Wi.clearEvents()}Hn(){if(!this.canSendEvents())return;this.cn.flush();const t=this.nn.getQueryParams();this.rn.saveBatchesInProgress(),t.rst=this.getRecordingStartTimestamp(),delete t.ri,t.hlm="true",this.hn.removeQueryParams(),$t(this.an,(t=>{var s,e;return $t(null!==(e=null===(s=t.getPendingEvents)||void 0===s?void 0:s.call(t))&&void 0!==e?e:[],(t=>this.Wi.addEvent(t)))}));const s=this.Wi.getEvents();if(0===s.length)return delete t.let,delete t.rst,this.hn.setQueryParams(t),this.hn.send(),void this.hn.removeQueryParams();this.Un("pending-events",this.cn.pendingEvents),this.Tn=s[s.length-1].date,t.let=this.getRecordingLastEventTimestamp(),this.hn.setQueryParams(t);const e=this.Wi.stringifyEvents();if(e.length>this.bn){const s=this.zn();if(s.length>0){const e=Kt(s);this.hn.send(e)||this.rn.save({key:`${t.sn}.${t.pn}.last`,metadata:{...t,datatype:"json"},events:e})}else delete t.let,delete t.rst,delete t.ri,this.hn.removeQueryParams(),this.hn.setQueryParams(t),this.hn.send(),this.hn.removeQueryParams();if(this.Wi.eventsCount()>0){t.rst=this.getRecordingStartTimestamp(),t.let=this.getRecordingLastEventTimestamp();const s=this.Yi.getCurrentIndex();t.ri=s.toString();const e=this.Wi.stringifyEvents();this.rn.save({key:`${t.sn}.${t.pn}.${t.ri}.last`,metadata:{...t,datatype:"json"},events:e}),this.Yi.increment()}}else{this.hn.send(e)||(this.rn.save({key:`${t.sn}.${t.pn}.${t.ri}.last`,metadata:{...t,datatype:"json"},events:e}),this.Yi.increment())}this.hn.removeQueryParams(),this.Wi.clearEvents()}blockSendingEventsFromQuotaService(){this.gn.allowFromQuotaService=!1}allowSendingEventsFromQuotaService(){this.gn.allowFromQuotaService=!0}blockSendingEventsFromSerialization(){this.gn.allowFromSerialization=!1}allowSendingEventsFromSerialization(){this.gn.allowFromSerialization=!0}canSendEvents(){return this.gn.allowFromQuotaService&&this.gn.allowFromSerialization}onIframeJavascriptError(t){var s;if(this.Ji&&this.fn){null===(s=this.Ji)||void 0===s||s.anonymize(t);const e=this.fn.translate({message:t.message,colno:t.colno,lineno:t.lineno,filename:t.filename,timestamp:bs.now(),type:"JSError"});e&&this.An(e)}}onIframeCustomError(t){if(this.vn){const s=this.vn.translate({...t,timestamp:bs.now(),type:"CustomError"});s&&this.An(s)}}onIframeDetailedApiError(t){this.Bn(t)}onIframeRecordingUserEvent(t){for(const s of t)this.Sn(s)}onIframeRecordingBrowserEvent(t){if(this.isStarted)for(const s of t)this.processBrowserEvent(s)}processBrowserEvent(t){this.Ki.isCurrentPageviewValid()&&this.Nn.pushEvent(t,{isUserEvent:!1})}Sn(t){this.Ki.refreshSession(),this.Ki.isSessionValid()&&this.Nn.pushEvent(t,{isUserEvent:!0})}On(t){li.general.nbEvents.increase(),this.Wi.addEvent(t);this.Wi.isThresholdReached()?this.pushEvents():this.Wi.isFull()&&this.yn(),this.qn(t)}qn(t){this.wt.emitDebugEvents&&this.wn.emit("recordingEvent",{...t,typeName:Oe[t.type]})}onStart(){var t;this.Un("tag-version","15.84.1"),this.Un("page-state",document.visibilityState),this.Nn.reset(),this.In.start(),this.initStates(),this.cn.start(),this.Xi&&this.tn&&this.Xi.subscribe(Ln.jn,(t=>this.Bn(t)),{detailedEvent:!0}),this.wt.emitDebugEvents&&this.wn.emit("replayRecordingStarted"),csArray.prototype.forEach.call(this.kn,(t=>this.Gn(t))),this.kn=[],this.Vn&&(null===(t=this.ln)||void 0===t||t.enableOnlineAssets(),this.Vn=!1)}onStop(){var t;this.In.stop(),this.Xi&&this.Xi.unsubscribe(Ln.jn),this.cn.stop(),this.Nn.disconnect(),null===(t=this.ln)||void 0===t||t.disableOnlineAssets()}clearStates(){this.cn.flush(),this.yn.cancel(),this.pushEvents(),this.nn.removeQueryParams()}initStates(){this.Rn=bs.now(),this.Yi.reset(),this.mn=0,this.nn.setQueryParams(this.Qi.getRequestParameters())}pushEvents(){$t(this.an,(t=>{var s;return null===(s=t.flushEvents)||void 0===s?void 0:s.call(t)})),this.Wi.eventsCount()>0&&(this.isStarted?this.En():this.Wi.clearEvents())}En(){if(!this.canSendEvents())return;const t=this.Wi.getEvents();this.Tn=t[t.length-1].date;const s=this.Yi.getCurrentIndex();this.nn.setQueryParams({ri:s.toString(),rst:this.getRecordingStartTimestamp(),let:this.getRecordingLastEventTimestamp()});const e=this.nn.getQueryParams();this.rn.addBatchInProgress(`${e.sn}.${e.pn}.${s}`,this.nn.getQueryParams(),t),this.nn.send(t),this.Yi.increment(),this.Wi.clearEvents(),this.Zn&&this.Zn()}addInitialDom(t){this.Wi.addEventByTimestamp(t),this.qn(t)}Bn(t){if(this.dn&&(t.plainCustomRequestHeaders||t.plainCustomResponseHeaders||t.requestBodyAttributes||t.responseBodyAttributes||t.customRequestHeaders||t.customResponseHeaders||t.queryParameters||t.requestBody||t.responseBody)){if(this.dn.truncate(t),this.en)return void this.en.registerApiErrorToEncrypt(t);t.customRequestHeaders="",t.customResponseHeaders="",t.requestBodyAttributes="",t.responseBodyAttributes="",t.queryParameters="",t.requestBody="",t.responseBody=""}this.Dn(t)}Dn(t){if(this.mn{var s;return null===(s=t.releaseResources)||void 0===s?void 0:s.call(t)}))}Un(t,s){if(!this.wt.emitRecordInfoEvents)return;const e={date:bs.now(),type:Oe.RECORDING_INFO_EVENT,args:null==s?[t]:[t,s]};this.Wi.addEvent(e)}zn(){return this.Wi.extractEvents(Oe.API_ERROR,Oe.JAVASCRIPT_ERROR,Oe.CUSTOM_ERROR,Oe.TEXT_VISIBILITY,Oe.POINTER_DOWN)}}Ln.jn="RecordingService",Ln.tr=255,Ln.Wn=20,Ln.Jn="etrp",Ln.Yn="etrs",Ln.Kn="1",ne([Pt("addInitialDom")],Ln.prototype,"addInitialDom",null);class Dn extends ei{constructor(t,s,e){super(),this.Is=t,this.hn=s,this.nn=e,this.er=!1,this.ir={},this.nr=t=>{if(0!==t.length)for(const s of t){const{metadata:t,events:e}=s;this.rr(t.rt)&&this.nn.send(e,t)}},window.addEventListener("focus",(()=>{this.recover()}))}onStart(){this.ir={}}onStop(){}recover(){this.Is.recover(this.nr)}addBatchInProgress(t,s,e){this.ir[t]={metadata:{...s},events:e}}removeBatchInProgress(t){delete this.ir[t]}blockSendingLastMessage(){this.er=!1}allowSendingLastMessage(){this.er=!0}sendLastMessageBeacon(){if(this.er){const{ri:t,rst:s,let:e,...i}=this.nn.getQueryParams();i.hlm="true",this.hn.setQueryParams(i),this.hn.send()}}rr(t){return!!t&&-1===csString.prototype.indexOf.call(t,vi.RECORDING_TEMPORARILY)}saveBatchesInProgress(){csArray.prototype.forEach.call(Object.keys(this.ir),(t=>{const{metadata:s,events:e}=this.ir[t];this.Is.save({key:`${s.sn}.${s.pn}.${s.ri}`,metadata:{...s,datatype:"json"},events:csJSON.stringify(e)})}))}save(t){this.Is.save(t)}}ne([vt("RecordingRecovery")],Dn.prototype,"recover",null);class Un{constructor(...t){this.hr=t}addProvider(t){csArray.prototype.push.call(this.hr,t)}getRequestParameters(){return csArray.prototype.reduce.call(this.hr,((t,s)=>({...s.getRequestParameters(),...t})),{})}}class Fn{constructor(t,s){this.cr=t,this.gt=s,this.ar=[{boundElement:window,type:"hashchange",listener:()=>this.hashChangeListener()},{boundElement:document,type:"visibilitychange",listener:()=>this.visibilityChangeListener()}]}onEvent(t){this.ur=t}start(){this.ee(),this.triggerInitialEvents()}stop(){this.ie()}ee(){csArray.prototype.forEach.call(this.ar,(t=>be(t)))}ie(){csArray.prototype.forEach.call(this.ar,(t=>Ve(t)))}triggerInitialEvents(){this.hashChangeListener()}hashChangeListener(){const t={type:Oe.HASH_CHANGE,args:[this.gt.anonymizePII(this.cr.href)],date:bs.now()};this.ur(t)}visibilityChangeListener(){const t={type:Oe.VISIBILITY_CHANGE,args:[document.visibilityState],date:bs.now()};this.ur(t)}}ne([vt("hashChange")],Fn.prototype,"hashChangeListener",null),ne([vt("visibilityChange")],Fn.prototype,"visibilityChangeListener",null);class Hn{constructor(){}onScannedAsset(t){this.lr=t}scanCssString(t){this.vr(Ri(t))}scanElement(t,s){Ye.getMaskedElementDetails(t).state!==Ye.MaskedElementState.NotMasked||s&&Ye.isMaskedAttribute(t,s)||(V(t)?this.mr(t):b(t)?this.pr(t,s):(this.wr(t,s),this.gr(t,s),this.yr(t,s)))}pr(t,s){var e;if((!s||"href"===s)&&t.href){const s={assetId:(null===(e=t.sheet)||void 0===e?void 0:e.href)||t.href,assetBasePath:window.location.href,assetRawPath:t.getAttribute("href")};this.lr({type:"stylesheet",asset:s})}}mr(t){var s;const e=new Set;if(t.textContent)for(const s of Ri(t.textContent))e.add(s);let i;try{i=null===(s=t.sheet)||void 0===s?void 0:s.cssRules}catch(t){"SecurityError"===t.name||"InvalidAccessError"===t.name||se.error(t.message)}if(i)for(let t=0;tthis.Er(t))),(t=>({rawUrl:t,absoluteUrl:zs(t)}))),(t=>{const s={assetId:t.absoluteUrl,assetBasePath:window.location.href,assetRawPath:t.rawUrl};this.lr({type:"asset",asset:s})}))}Ar(t){return/^https:\/\/\w+:\w+@/.test(t)}}var zn;class Bn{constructor(t){this.Qs=t}observe(){if(this.Sr=zn.Rr.subscribe((t=>this.Qs(t))),!zn.Tr){zn.Tr=!0,zn.Ir.observe();ct(document,NodeFilter.SHOW_ELEMENT).visitAll((t=>{zn.Pr.add(t),zn.Rr.next(t)}))}}disconnect(){zn.Tr&&(this.Sr(),zn.Rr.hasObservers()||(zn.Tr=!1,zn.Ir.disconnect(),zn.Rr.clear(),zn.Pr.clear()))}}zn=Bn,Bn.Pr=qi(),Bn.Rr=new class{constructor(t=Number.POSITIVE_INFINITY){this.br=[],this.zi=[],this.Vr=t}next(t){this.zi.length===this.Vr&&csArray.prototype.shift.call(this.zi),csArray.prototype.push.call(this.zi,t),1===this.zi.length&&csSetTimeout((()=>this.clear()));for(const s of this.br)s(t)}subscribe(t){if(xt(this.br,(s=>t===s)))return()=>{this.br=csArray.prototype.filter.call(this.br,(s=>s!==t))};csArray.prototype.push.call(this.br,t);for(const s of this.zi)t(s);return()=>{this.br=csArray.prototype.filter.call(this.br,(s=>s!==t))}}clear(){this.zi=[]}hasObservers(){return this.br.length>0}},Bn.Cr=It((t=>{Fi((()=>{for(const s of t)"childList"===s.type&&$t(s.addedNodes,(t=>{ct(t,NodeFilter.SHOW_ELEMENT).visitAll((t=>{zn.Pr.has(t)||(zn.Pr.add(t),zn.Rr.next(t))}))}))}))}),"ElementObserver.findAllElements"),Bn.Tr=!1,Bn.Ir=new rn(zn.Cr),os([vt()],Bn.prototype,"observe",null),os([vt()],Bn.prototype,"disconnect",null);class qn{constructor(t,s=30,e=0){this.kr=t,this.Nr=s,this.Or=e,this.$r=new pt,this.kt=!1,this.Mr=0,this.Lr=()=>{for(this.Mr=0;this.$r.length;){if(this.Mr>=this.Nr)return void csSetTimeout(this.Lr,this.Or);const t=bs.elapsed(),s=this.$r.pop();if(!s)break;this.runTask(s);const e=bs.elapsed()-t;this.Mr+=e}this.kt=!1}}schedule(t,s=!1){this.kr&&!s?(li.general.pendingTasks.increase(),this.$r.push(t),this.Dr()):t()}Dr(){this.kt||(this.kt=!0,csSetTimeout((()=>{this.Lr()})))}runTask(t){li.general.pendingTasks.decrease(),t()}runPendingTasks(){this.$r.forEach((t=>{this.runTask(t)})),this.$r.clear()}clearQueue(){li.general.pendingTasks.clear(),li.mutations.pendingMutations.clear(),this.$r.clear()}isEmpty(){return 0===this.$r.length}}ne([vt("TaskScheduler"),Pt("runTask")],qn.prototype,"runTask",null),ne([Pt("runPendingTasks")],qn.prototype,"runPendingTasks",null);class jn{constructor(){this.qs=!1,this.Ur=new Zi((t=>"cssRuleInserted"===t.type&&this.Fr(t))),this.Hr=ji((t=>{this.qs&&t.length>0&&this.zr.schedule((()=>$t(t,(t=>this.Br.scanElement(t)))))})),this.qr=({type:t,asset:s})=>{var e,i,n;"stylesheet"===t&&(null===(e=this.jr)||void 0===e||e.call(this,s)),null===(i=this.Gr)||void 0===i||i.call(this,s);const r={date:bs.now(),type:Oe.STATIC_RESOURCE_URL,args:[s.assetId]};null===(n=this.ur)||void 0===n||n.call(this,r)},this.zr=new qn(!0,30,0),this.Zr=new Bn((t=>this.Wr(t))),this.Fs=new rn((t=>this.Qr(t))),this.Br=new Hn,this.Br.onScannedAsset(this.qr)}onEvent(t){this.ur=t}onAsset(t){this.Gr=t}onStyleSheetFound(t){this.jr=t}start(){this.qs||(this.qs=!0,this.Ur.observe(),this.Zr.observe(),this.Fs.observe())}stop(){this.qs&&(this.Ur.disconnect(),this.Zr.disconnect(),this.Fs.disconnect(),this.qs=!1)}Fr(t){t.rule&&this.qs&&this.Br.scanCssString(t.rule)}Wr(t){this.qs&&Ye.getMaskedElementDetails(t).state===Ye.MaskedElementState.NotMasked&&this.Hr.push(t)}Qr(t){csSetTimeout((()=>{for(const s of t)switch(s.type){case"attributes":this.Br.scanElement(s.target,s.attributeName);break;case"characterData":this.Yr(s.target)}}))}Yr(t){T(t)&&csNodeparentNode.apply(t)&&V(csNodeparentNode.apply(t))&&this.Br.scanCssString(t.data)}}class Gn{constructor(t){this.Kr=[],this.Jr=[],this.gs={},this.ys=t}setQueryParams(t){csArray.prototype.forEach.call(Object.keys(t),(s=>{this.gs[s]=t[s]}))}removeQueryParams(t){t?csArray.prototype.forEach.call(t,(t=>{delete this.gs[t]})):this.gs={}}onBeaconSuccess(t){csArray.prototype.push.call(this.Kr,t)}onBeaconFailure(t){csArray.prototype.push.call(this.Jr,t)}send(t){const s=es.toQuery({...this.gs,ct:me.UNCOMPRESSED}),e=this.Xr(s,t);return e?csArray.prototype.forEach.call(this.Kr,(t=>t())):csArray.prototype.forEach.call(this.Jr,(t=>t(this.gs))),e}Xr(t,s){try{if("function"!=typeof csNavigatorsendBeacon)return!1;const e=csNavigatorsendBeacon(`${this.ys}?${t}`,s||"");if(e)return e}catch{}return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(`${this.ys}?${t}`,s||"")}}class Zn{constructor(t){this.so={},this.eo=new Je(t)}save({key:t,metadata:s,events:e}){this.eo.isThresholdReached()||(this.eo.addString(t),"string"==typeof e?this.eo.addString(e):this.eo.addArrayBuffer(e),this.eo.isThresholdReached()||(this.so[t]={metadata:s,events:e}))}recover(t){const s=[];csArray.prototype.forEach.call(this.io(),(t=>{const e=this.so[t];void 0!==e&&(delete e.metadata.datatype,csArray.prototype.push.call(s,e),this.no(t))})),0!==s.length&&(t(s),this.eo.reset())}io(){return Object.keys(this.so)}no(t){delete this.so[t]}}var Wn,Qn;!function(t){t[t.NOT_STARTED=0]="NOT_STARTED",t[t.OPEN_IN_PROGRESS=1]="OPEN_IN_PROGRESS",t[t.OPEN_FAILED=2]="OPEN_FAILED",t[t.READY=3]="READY"}(Wn||(Wn={}));class Yn{constructor(t,s,e){this.ro=t,this.oo=e,this.ho=Wn.NOT_STARTED,this.co=[],this.ao=0,this.uo=self.origin,this.lo="object"==typeof window?"":"worker-",this.eo=new Je(s),this.do()}async do(){await this.fo(),this.ho===Wn.READY?this.vo():this.oo(this.co)}vo(){csArray.prototype.forEach.call(this.co,(t=>{this.save(t)})),this.co=[]}async save(t){try{if(this.ho===Wn.OPEN_IN_PROGRESS)return void csArray.prototype.push.call(this.co,t);if(this.ho!==Wn.READY)return;if(this.eo.isThresholdReached())return;const{key:s,metadata:e,events:i}=t;if(this.eo.addString(s),"string"==typeof i?this.eo.addString(i):this.eo.addArrayBuffer(i),this.eo.isThresholdReached())return;await this.mo.put(`${this.uo}/${s}`,new Response(i,{headers:e}))}catch{}}async recover(t){(this.mo||(await this.fo(),this.ho===Wn.READY))&&this.po(t)}async fo(){try{this.ho=Wn.OPEN_IN_PROGRESS,this.mo=await self.caches.open(`${this.lo}${this.ro}`),this.ho=Wn.READY}catch{this.ho=Wn.OPEN_FAILED}}async po(t){try{if(this.ao++,this.ao>1)return;const s=await this.mo.keys();if(0===s.length)return;const e=await this.mo.matchAll(),i=csArray.prototype.map.call(e,(t=>{const s={};t.headers.forEach(((t,e)=>{s[e]=t})),delete s["content-type"];const e=s.datatype;return delete s.datatype,"json"===e||"base64"===e?t.text().then((t=>({metadata:s,events:t}))):t.arrayBuffer().then((t=>({metadata:s,events:t})))})),n=await Promise.all(i);await Promise.all(csArray.prototype.map.call(s,(t=>this.mo.delete(t)))),t(n),this.eo.reset()}catch{}finally{this.ao--}}}class Kn{constructor(t){try{this.wo(t)}catch(t){this.yo()}}wo(t){self.caches?this.Eo(t):this.yo()}save(t){this.Ao.save(t)}recover(t){this.Ao.recover(t)}Eo(t){this.Ao=new Yn(t,Kn._o,(t=>{this.yo(t)}))}yo(t){this.Ao=new Zn(Kn._o),t&&csArray.prototype.forEach.call(t,(t=>{this.Ao.save(t)}))}}Kn._o=16777216;class Jn extends Pn{isListening(t){return Sn.isDOMEvent(t)&&("initialDOM"===t.domEvent||"nodesAdded"===t.domEvent)}processEvent(t){let s=0;const e="initialDOM"===t.domEvent?[t.initialDOM]:t.nodes;for(const i of e){if(i instanceof Ni){const t=Ye.getMaskedAttributeDetails(i);i.attributes=this.So(i,t)}if(Ye.getMaskedElementDetails(i).state!==Ye.MaskedElementState.Child)Be.traverse(i,(t=>{if(t instanceof Ni){const e=Ye.getMaskedAttributeDetails(t);t.attributes=this.So(t,e);const i=Ye.getMaskedElementDetails(t);i.state===Ye.MaskedElementState.Parent&&(this.Ro(t,i),s++)}}));else{if("initialDOM"===t.domEvent)return null;t.nodes=csArray.prototype.filter.call(t.nodes,(t=>t!==i))}}return s>0&&as.counters.sensitiveElements.count("masked-elements",s),t}So(t,s){return 0===s.attributes.length?t.attributes:csArray.prototype.filter.call(t.attributes,(t=>-1===csArray.prototype.indexOf.call(s.attributes,t.name)))}Ro(t,s){const e=`width: ${s.width}px !important; height: ${s.height}px !important;`;t.children=[],t.shadowRoot=void 0,csArray.prototype.push.call(t.attributes,{name:"style",value:e,namespaceURI:""}),Ni.getAttribute(t,"data-cs-mask")||csArray.prototype.push.call(t.attributes,{name:"data-cs-mask",value:"",namespaceURI:""})}}gi([Pt("MaskedElementProcessor.processEvent")],Jn.prototype,"processEvent",null),function(t){t.ANONYMIZED_TEXT_STATUS_PROP="anonymizationStatus",t.WHITELISTED_STATUS="whitelisted",t.isWhitelistedElement=function(s){return Be.getProperty(s,t.ANONYMIZED_TEXT_STATUS_PROP)===t.WHITELISTED_STATUS},t.whitelistElement=function(s){Be.setProperty(s,t.ANONYMIZED_TEXT_STATUS_PROP,t.WHITELISTED_STATUS)},t.removeWhitelistElement=function(s){Be.setProperty(s,t.ANONYMIZED_TEXT_STATUS_PROP,void 0)}}(Qn||(Qn={}));const Xn=/[\u4E00-\u9FFF]|[\u3000-\u303F]|[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]/g,tr=/[^a\s]/g;function sr(t){const s=csString.prototype.replace.call(t,Xn,"a");return csString.prototype.replace.call(s,tr,"a")}const er=["id","class","style","srcset","sizes","rel","type","width","height","media","align","dir","bgcolor","color","border","colspan","rowspan","cols","rows","size","start","slot","data-cs-override-id"],ir=t=>{const s=new Set(er);return csArray.prototype.forEach.call(t,(t=>{s.add(t)})),s},nr=["svg","slot"],rr={href:new Set(["a"]),src:new Set(["iframe"])};class or{constructor(t,s,e,i=null,n=!1){this.To=t,this.Io=s,this.gt=e,this.Po=i,this.bo=n,this.Vo=ir(this.Io)}Co(t,s=null,e=!0){const i=this.gt.checkAndAnonymizePII(t,s);if(this.bo)for(const t of this.gt.getLogs())e?(as.counters.redactedPII.count("cc-in-text-nodes"),ft.implementation(`${t} - text-node`)):ft.implementation(`${t} - attribute`);return i}sanitize(t){return Be.traverse(t,((t,s)=>{if(t.anonymized=this.To,3===t.nodeType){const{anonymizedValue:e,withAnonymization:i}=this.getAnonymizedValue(t.data,null==s?void 0:s.localName,s?Be.getProperties(s):void 0);return t.anonymized=i,void(t.data=e)}if(Ni.isElement(t))return this.ko(t);4!==t.nodeType||(t.data=this.To?sr(t.data):this.Co(t.data,this.Po))})),t}setAnonymization(t){this.To=t}getAnonymizedValue(t,s,e){if("style"===s)return{anonymizedValue:t,withAnonymization:!1};const i=(null==e?void 0:e[Qn.ANONYMIZED_TEXT_STATUS_PROP])===Qn.WHITELISTED_STATUS;return this.To&&!i?{anonymizedValue:sr(t),withAnonymization:!0}:{anonymizedValue:this.Co(t,this.Po),withAnonymization:!1}}ko(t){if(Be.getProperty(t,"SVG"))return;const s=xt(t.attributes,(t=>"type"===t.name)),e=null==s?void 0:s.value;t.attributes=csArray.prototype.map.call(t.attributes,(s=>(s.anonymized=this.To,s.value=this.getAnonymizedAttributeValue(t.localName,s.name,s.value,e),s)))}getAnonymizedAttributeValue(t,s,e,i){return this.Oo(t,s,i)?e:(t=>rr.hasOwnProperty(t))(s)?((t,s,e)=>{var i;return(null===(i=rr[s])||void 0===i?void 0:i.has(t))&&!yi(e)})(t,s,e)?this.gt.anonymizePII(e):e:this.To&&((t,s,e)=>("submit"===e||"button"===e)&&"input"===t&&"value"===s)(t,s,i)?sr(e):("contenteditable"===s&&"false"!==e&&ft.implementation("Element found with contenteditable attr","contenteditable-attr"),this.To?"":this.Co(e,null,!1))}Oo(t,s,e){return((t,s,e)=>"radio"===e&&"input"===t&&"name"===s||csArray.prototype.indexOf.call(nr,t)>-1)(t,s,e)||this.Vo.has(s)}}class hr{static create(t,s){if(!hr.isSupported())throw new Error("IntersectionObserver is not supported");if(s&&s.delay&&s.delay<100)throw new Error("Visibility delay should be > 100ms");return(null==s?void 0:s.trackVisibility)&&(t=hr.$o(t)),new IntersectionObserver(t,s)}static isSupported(){return!!window.IntersectionObserver&&!!window.IntersectionObserverEntry}static $o(t){return(s,e)=>t(Nt(s,cr),e)}}function cr(t){return t.isVisible||!Ht.isVisibleInViewportInForeground(t.target)?t:{boundingClientRect:t.boundingClientRect,intersectionRatio:t.intersectionRatio,intersectionRect:t.intersectionRect,isIntersecting:t.isIntersecting,rootBounds:t.rootBounds,target:t.target,time:t.time,isVisible:!0}}var ar;const ur=()=>(t,s,e)=>{e.value=function(t){const s=csSymbol("oncePerTickSymbol");let e=null;const i={},n=function(){var n;const r=null!==(n=this)&&void 0!==n?n:i;if(e=arguments,r[s])return;r[s]=!0;lr((()=>{r[s]=!1,t.apply(r,e)}))};return n.oncePerTickSymbol=s,n}(e.value)},lr=null!==(ar=n.csQueueMicrotask)&&void 0!==ar?ar:csSetTimeout;ur.isScheduled=(t,s)=>t[s.oncePerTickSymbol];class dr{constructor(t){this.Qs=t,this.xo=new Map,this.Mo=t=>{const s=t.target;if(this.xo.has(s))return!0;let e=!1;return this.xo.forEach(((t,i)=>{!e&&this.xo.get(i).subtree&&(e=i.contains(s))})),e},li.general.nbOfMutationObservers.increase(),this.Fs=new csMutationObserver((s=>{ur.isScheduled(this,this.garbageCollect)&&(s=Lt(s,this.Mo)),s.length&&Fi((()=>t(s,this)))}))}disconnect(){li.general.nbOfMutationObservers.decrease(),this.Fs.disconnect(),this.xo=new Map}takeRecords(){return this.Fs.takeRecords()}observe(t,s){return li.mutations.elementMutationObserved.increase(),this.xo.set(t,s),this.Fs.observe(t,s)}unobserve(t){this.xo.has(t)&&(li.mutations.elementMutationObserved.decrease(),this.xo.delete(t),this.garbageCollect())}garbageCollect(){li.mutations.unobserveGarbageCollection.measure((()=>{const t=Lt(this.takeRecords(),this.Mo);t.length&&this.Qs(t,this),this.Fs.disconnect(),this.xo.forEach(((t,s)=>this.Fs.observe(s,t)))}))}}os([ur()],dr.prototype,"garbageCollect",null);class fr{constructor(t){this.Qs=t,this.Lo=new Set}onMutations(t){if(Mt(t,(t=>{var s;return!!(null===(s=t.removedNodes)||void 0===s?void 0:s.length)})))for(const t of this.Lo.values())Ht.isConnected(t)||(this.Lo.delete(t),this.Qs(t))}observe(t){this.Qe||(this.Qe=new rn((t=>csSetTimeout((()=>this.onMutations(t))))),this.Qe.observe()),this.Lo.add(t)}disconnect(){var t;null===(t=this.Qe)||void 0===t||t.disconnect(),this.Lo.clear(),this.Qe=void 0}}os([vt("NodeDisconnectedObserver.onMutations")],fr.prototype,"onMutations",null);class vr{constructor(t){this.Do=new Set,this.Uo=new fr((t=>this.Fo(t))),this.qs=!1,this.Ho=t?{...pr,...t}:pr}stop(){var t,s;this.qs=!1,null===(t=this.zo)||void 0===t||t.disconnect(),null===(s=this.Fs)||void 0===s||s.disconnect()}start(t){if(this.qs)throw new Error("VisibilityObserver is already started");this.Qs=mt("VisibilityObserver:callback",((s,e)=>t(s,e)));const s={root:null,rootMargin:"0px",threshold:.5,trackVisibility:!0,delay:300};this.zo=hr.create((t=>this.handleIntersection(t)),s),this.Fs=new dr((t=>csSetTimeout((()=>{$t(t,(t=>this.Fo(t.target)))})))),this.do(),this.qs=!0}observe(t){if(!this.qs)throw new Error("Observer is stopped.");!1===this.Ho.reobserve&&t[this.Bo]||(li.visibilityObserver.nbElements.increase(),t[this.Bo]=!0,this.watchIntersection(t))}do(){this.qo=csSymbol("isVisible"),this.Bo=csSymbol("ObservedElement"),this.jo=csSymbol("LinkedElement"),this.Go=csSymbol("Tracked")}Fo(t){this.Do.add(t);for(const s of this.Zo(t))this.Do.add(s);this.recheckCssVisibilityAll()}recheckCssVisibilityAll(){$t(this.Do.keys(),(t=>{t.isConnected&&!Ht.areAncestorsHiddenByCSS(t)&&t[this.Bo]&&this.watchIntersection(t)})),this.Do.clear()}watchIntersection(t){this.Fs.unobserve(t),this.zo.unobserve(t);const s=Ht.getTopAncestorHiddenByCSS(t);s?(s!==t&&(this.Wo(s,t),this.watchMutation(s)),this.watchMutation(t)):this.zo.observe(t)}watchMutation(t,s=!0){s&&delete t[this.qo],this.zo.unobserve(t);this.Fs.observe(t,{attributeFilter:["style","class","hidden"]})}handleIntersection(t){for(const s of t){const t=s.target;if(!s.isVisible){Ht.isVisibleInDocument(t)||this.Qo(t);continue}const e=this.Ho.allowSameMatch||!s.target[this.qo];s.target[this.qo]=!0,e&&!this.Ho.delay&&this.onVisibilityChanged(s.target,mr.VisibleInViewPort)}this.Ho.delay&&csSetTimeout((()=>{for(const s of t){const t=s.isIntersecting&&s.isVisible;s.target[this.qo]&&t&&this.onVisibilityChanged(s.target,mr.VisibleInViewPort)}}),this.Ho.delay)}Qo(t){li.visibilityObserver.hiddenElements.increase();const s=Ht.getTopElement(t);this.watchMutation(t),s&&(this.Uo.observe(s),this.Wo(s,t),this.watchMutation(s,!1))}Wo(t,s){var e;(t[this.jo]=null!==(e=t[this.jo])&&void 0!==e?e:new Set).add(s)}Zo(t){var s,e;const i=[];return $t(null!==(e=null===(s=t[this.jo])||void 0===s?void 0:s.values())&&void 0!==e?e:[],(t=>csArray.prototype.push.call(i,t))),i}onVisibilityChanged(t,s){if(s===mr.VisibleInViewPort&&this.Ho.trackOnce){if(this.zo.unobserve(t),this.Fs.unobserve(t),t[this.Go])return;t[this.Go]=!0}this.Qs(t,s)}static isSupported(){return hr.isSupported()}}var mr;os([vt()],vr.prototype,"observe",null),os([Ne({wait:50}),vt(),Pt("recheckCssVisibilityAll")],vr.prototype,"recheckCssVisibilityAll",null),os([vt()],vr.prototype,"watchIntersection",null),os([vt()],vr.prototype,"watchMutation",null),os([vt(),Pt("VisibilityObserver.handleIntersection")],vr.prototype,"handleIntersection",null),os([vt()],vr.prototype,"onVisibilityChanged",null),function(t){t.VisibleInViewPort="VisibleInViewPort",t.HiddenByAnother="HiddenByAnother",t.Hidden="Hidden"}(mr||(mr={}));const pr={delay:1e3,trackOnce:!0,reobserve:!1};class wr{constructor(t){this.Qs=t,this.Pr=qi(),this.Yo=t=>{Fi((()=>{for(const s of t)"childList"===s.type&&$t(s.addedNodes,(t=>{ct(t,NodeFilter.SHOW_TEXT).visitAll((t=>{this.Pr.has(t)||(this.Pr.add(t),this.Qs(t))}))}))}))},this.Ir=new rn(this.Yo)}observe(){this.Ir.observe();ct(document,NodeFilter.SHOW_TEXT).visitAll((t=>{this.Pr.add(t),this.Qs(t)}))}disconnect(){this.Pr.clear(),this.Ir.disconnect()}}var gr,yr;!function(t){t.ENCRYPTED_NODE_PROP="toEncrypt",t.shouldEncrypt=function(s){return!0===Be.getProperty(s,t.ENCRYPTED_NODE_PROP)},t.markEncryptedNode=function(s){Be.setProperty(s,t.ENCRYPTED_NODE_PROP,!0)},t.unmarkEncryptedNode=function(s){Be.setProperty(s,t.ENCRYPTED_NODE_PROP,void 0)}}(gr||(gr={}));gi([vt()],class extends En{constructor(t){super(),this.Ko=new Set,this.Jo=new Set,this.Xo=!1,this.th=new Set,this.To=!1,this.eh=new vr(t),this.ih=new wr((t=>{const s=Ht.getParentElement(t);!s||!s.isConnected||Ye.isMaskedElement(s)||Ye.isMaskedElementChild(s)||gr.shouldEncrypt(s)||V(s)||N(s)||k(s)||S(t.data)||(this.Ko.add(s),this.nh())}))}onStart(){vr.isSupported()&&(this.eh.start(((t,s)=>this.onVisibilityChanged(t,s))),this.ih.observe())}onStop(){vr.isSupported()&&(this.eh.stop(),this.ih.disconnect(),this.Ko.clear(),this.Jo.clear(),this.th.clear(),this.Xo=!1)}setAnonymization(t){this.To=t}nh(){this.Xo||(this.Xo=!0,Bi((()=>{if(!this.isStarted)return;this.Xo=!1;const t=this.Ko;this.Ko=new Set;for(const s of Ut(t))s.isConnected&&!this.Jo.has(s)&&(this.Jo.add(s),Mt(csNodechildNodes.apply(s),(t=>3===t.nodeType))&&this.eh.observe(s))}),1001))}onVisibilityChanged(t,s){s!==mr.VisibleInViewPort||this.To&&!Qn.isWhitelistedElement(t)||$t(csNodechildNodes.apply(t),(t=>{if(3!==t.nodeType)return;const e=t.data;this.th.has(e)||(this.th.add(e),this.produceEvent({type:"TextVisibility",text:e,state:s}))}))}}.prototype,"onVisibilityChanged",null),function(t){t.isTextVisibilityEvent=function(t){return"TextVisibility"===t.type}}(yr||(yr={}));class Er extends Pn{constructor(t,s,e,i=null){super(),this.gt=e,this.Po=i;this.rh=new or(t,s,e,i,!0)}setAnonymization(t){this.rh.setAnonymization(t)}isListening(t){return yr.isTextVisibilityEvent(t)||Sn.isDOMEvent(t)&&("initialDOM"===t.domEvent||"nodesAdded"===t.domEvent||"attributeChanged"===t.domEvent||"characterDataChanged"===t.domEvent)}processEvent(t){if(yr.isTextVisibilityEvent(t))return t.text=this.gt.checkAndAnonymizePII(t.text,this.Po),t;switch(t.domEvent){case"initialDOM":case"nodesAdded":this.oh(t);break;case"attributeChanged":this.hh(t);break;case"characterDataChanged":this.ah(t)}return t}oh(t){const s="initialDOM"===t.domEvent?[t.initialDOM]:t.nodes;for(const t of s)this.rh.sanitize(t)}hh(t){t.isSvg||t.newValue&&(null!==t.localName?t.newValue=this.rh.getAnonymizedAttributeValue(t.localName,t.attribute,t.newValue,t.inputType):t.newValue="")}ah(t){t.newValue=this.rh.getAnonymizedValue(t.newValue,t.parentLocalName,t.parentProps).anonymizedValue}}gi([Pt("AnonymizedTextProcessor.processEvent")],Er.prototype,"processEvent",null);class Ar extends Pn{constructor(t){super(),this.uh=t}isListening(t){return Sn.isDOMEvent(t)&&"initialDOM"===t.domEvent}processEvent(t){return"initialDOM"===t.domEvent&&(t.initialDOM.baseURI=this.uh.anonymizeUrl(t.initialDOM.baseURI)),t}}gi([Pt("UrlAnonymizationProcessor.processEvent")],Ar.prototype,"processEvent",null);const _r="textarea";class Sr extends Pn{isListening(t){return Sn.isDOMEvent(t)&&("initialDOM"===t.domEvent||"nodesAdded"===t.domEvent||"characterDataChanged"===t.domEvent)}processEvent(t){switch(t.domEvent){case"initialDOM":this.fh(t);break;case"nodesAdded":this.mh(t);break;case"characterDataChanged":this.ph(t)}return t}fh(t){Be.traverse(t.initialDOM,((t,s)=>{this.gh(t,s)&&(t.data=this.yh(t.data))}))}mh(t){for(const s of t.nodes)Be.traverse(s,((s,e)=>{this.Eh(s,e,t)&&(s.data=this.yh(s.data))}))}ph(t){t.parentLocalName===_r&&(t.newValue=this.yh(t.newValue))}yh(t){return csString.prototype.replace.call(t,/\S/g,"•")}Eh(t,s,e){return this.Ah(t,e)||this.gh(t,s)}Ah(t,s){return 3===t.nodeType&&s.targetLocalName===_r}gh(t,s){return 3===t.nodeType&&g(s)&&s.localName===_r}}gi([Pt("AnonymizedTextAreaProcessor.processEvent")],Sr.prototype,"processEvent",null);class Rr{constructor(t){this.Qs=t,this._h={boundElement:window,type:"resize",listener:()=>this.resizeListener()},this.Qs=t}observe(){be(this._h),this.ce()}ce(){this.resizeListener()}disconnect(){Ve(this._h)}resizeListener(){const t={width:Vt.windowWidth(),height:Vt.windowHeight()};this.Qs(t)}}var Tr,Ir,Pr,br,Vr,Cr,kr;os([vt("resize")],Rr.prototype,"resizeListener",null),function(t){t.PORTRAIT="Portrait",t.LANDSCAPE="Landscape"}(Tr||(Tr={})),function(t){t.PORTRAIT_PRIMARY="portrait-primary",t.PORTRAIT_SECONDARY="portrait-secondary",t.LANDSCAPE_PRIMARY="landscape-primary",t.LANDSCAPE_SECONDARY="landscape-secondary"}(Ir||(Ir={})),function(t){t[t.PORTRAIT=0]="PORTRAIT",t[t.PORTRAIT_REVERSE=180]="PORTRAIT_REVERSE",t[t.LANDSCAPE=-90]="LANDSCAPE",t[t.LANDSCAPE_REVERSE=90]="LANDSCAPE_REVERSE"}(Pr||(Pr={})),function(t){let s=null;t.isScreenOrientationApiSupported=()=>{var t;return null!=s?s:s=!!(null===(t=n.screen)||void 0===t?void 0:t.orientation)},t.isDeprecatedScreenOrientationApiSupported=()=>"orientation"in n,t.getCurrentOrientation=function(){return t.isScreenOrientationApiSupported()?function(){var t;switch(null===(t=n.screen.orientation)||void 0===t?void 0:t.type){case Ir.PORTRAIT_PRIMARY:case Ir.PORTRAIT_SECONDARY:return Tr.PORTRAIT;case Ir.LANDSCAPE_PRIMARY:case Ir.LANDSCAPE_SECONDARY:return Tr.LANDSCAPE;default:return Tr.PORTRAIT}}():t.isDeprecatedScreenOrientationApiSupported()?function(){switch(window.orientation){case Pr.PORTRAIT:case Pr.PORTRAIT_REVERSE:return Tr.PORTRAIT;case Pr.LANDSCAPE:case Pr.LANDSCAPE_REVERSE:return Tr.LANDSCAPE;default:return Tr.PORTRAIT}}():Tr.LANDSCAPE}}(br||(br={}));class Nr extends En{constructor(){super(...arguments),this.Sh=null,this.Rh=null,this.Th=new Rr((t=>{this.produceEvent({...t,type:"viewportResize"}),this.onScreenPotentiallyChanged()}))}onScreenPotentiallyChanged(){const t=br.getCurrentOrientation(),{screenWidth:s,screenHeight:e}=this.Ih(t);if(s!==this.Sh||e!==this.Rh){this.Sh=s,this.Rh=e;const t={type:"screenResize",width:s,height:e};this.produceEvent(t)}}Ih(t){let s,e;const i=Vt.screenWidth(),n=Vt.screenHeight();return t===Tr.PORTRAIT?(s=i,e=n):(s=Math.max(i,n),e=Math.min(i,n)),{screenWidth:s,screenHeight:e}}onStart(){this.Th.observe()}onStop(){this.Sh=null,this.Rh=null,this.Th.disconnect()}}function Or(t){const s=csEventtarget.apply(t);return s&&R(s)&&csElementshadowRoot.apply(s)&&t.composedPath?t.__csOriginalTarget||t.composedPath()[0]:s}class $r{get selectors(){return""===this.Ph?null:this.Ph}constructor(t,s={closest:!1}){this.Qs=t,this.Ho=s,this.Ph="",this.bh=qi(),this.Qr=It((t=>{if(""===this.Ph)return;const s=[];for(const e of Ot(t,(t=>t.addedNodes))){if(!(x(e)||this.Ho.closest&&T(e)))continue;Dt(this.Ho.closest?this.Vh(e,this.Ph):this.findMatchingElements(e,this.Ph),s)}s.length&&this.Qs(s,"added")}),"SelectorObserver.processMutations"),this.Ch=(t,s)=>{if(""===this.Ph||"added"!==s)return;const e=this.findMatchingElements(t,this.Ph);e.length&&this.Qs(e,"added")},this.Qe=new rn(this.Qr,this.Ch)}observe(t){""===this.Ph?this.Qe.observe():this.Ph+=",",this.Ph+=t;const s=this.findMatchingElements(document,t);for(const e of this.Qe.shadowRoots){Dt(this.findMatchingElements(e,t),s)}s.length&&($t(s,(t=>{this.bh.add(t)})),this.Qs(s,"initial"))}processPendingMutations(){this.Qr(this.Qe.takeRecords())}disconnect(){this.Qe.disconnect(),this.bh.clear(),this.Ph=""}Vh(t,s){const e=[];if(T(t)){if(t.parentElement){const i=Qe(t.parentElement,s);i&&csArray.prototype.push.call(e,i)}return csArray.prototype.filter.call(e,(t=>!1===this.bh.has(t)))}if(A(t)){const i=Qe(t,s);if(i)return csArray.prototype.push.call(e,i),csArray.prototype.filter.call(e,(t=>!1===this.bh.has(t)))}return this.findMatchingElements(t,s)}findMatchingElements(t,s){const e=kt(window.csquerySelectorAll[t.nodeType].call(t,s));return R(t)&&G.call(t,s)&&csArray.prototype.push.call(e,t),csArray.prototype.filter.call(e,(t=>!1===this.bh.has(t)))}}os([vt()],$r.prototype,"observe",null),os([vt()],$r.prototype,"disconnect",null),os([Pt("SelectorObserver.findMatchingElements")],$r.prototype,"findMatchingElements",null);class xr extends En{constructor(){super(),this.kh=t=>{const s=Or(t);s&&this.Nh(s,t.type)},this.se=new Pe(((t,s)=>{switch(s){case"initial":case"added":this.Oh(t);break;case"removed":this.$h(t)}})),this.xh=new $r(((t,s)=>{"initial"!==s&&"added"!==s||this.Mh(t)}))}static shouldProcessElement(t){return"VIDEO"===t.tagName&&Ht.isConnected(t)&&!Ye.isMaskedElement(t)&&!Ye.isMaskedElementChild(t)}static isPlaying(t){return!t.paused&&!t.ended}onStart(){this.Oh(document),this.se.observe(),this.xh.observe("video")}onStop(){this.$h(document),this.se.disconnect(),this.xh.disconnect()}Nh(t,...s){if(this.isStarted&&xr.shouldProcessElement(t))for(const e of s){const s={type:"VideoEvent",videoEventType:e,nodeId:Ge(t)};"seeked"===e&&(s.newTimePositionInSec=t.currentTime),$i((()=>this.produceEvent(s)))}}Mh(t){for(const s of t)this.Nh(s,"seeked"),xr.isPlaying(s)&&this.Nh(s,"play")}Oh(t){for(const s of["play","pause","seeked"])be({type:s,listener:this.kh,boundElement:t})}$h(t){for(const s of["play","pause","seeked"])Ve({type:s,listener:this.kh,boundElement:t})}}function Mr(t){return"INPUT"===t.nodeName}function Lr(t){return Mr(t)&&"number"===t.type}function Dr(t){return Mr(t)&&("checkbox"===t.type||"radio"===t.type)}class Ur extends En{constructor(t){super(),this.en=t,this.Lh=qi(),this.Dh=t=>this.inputHandler(t),this.Uh=[],this.Fh(),this.Hh(),this.xh=new $r((t=>{for(const s of t)this.zh(s)&&Fi((()=>{this.Bh(s,Ge(s))}),"low")})),this.se=new Pe(((t,s)=>{switch(s){case"initial":case"added":be({type:"change",listener:this.Dh,boundElement:t});break;case"removed":Ve({type:"change",boundElement:t,listener:this.Dh})}}))}onStart(){be({type:"keyup",boundElement:document,listener:this.Dh}),be({type:"change",boundElement:document,listener:this.Dh}),$t(this.Uh,(t=>t.activate())),this.xh.observe(csArray.prototype.join.call(Ur.qh,",")),this.se.observe()}onStop(){Ve({type:"keyup",boundElement:document,listener:this.Dh}),Ve({type:"change",boundElement:document,listener:this.Dh}),$t(this.Uh,(t=>t.deactivate())),this.xh.disconnect(),this.se.disconnect(),this.Lh.clear()}Bh(t,s){var e,i,n;if(this.Lh.has(t))return;if(this.Lh.add(t),function(t){return"SELECT"===t.nodeName}(t)){const s={type:"InputEvent",inputType:"select",target:Ge(t),selectedIndex:t.selectedIndex,timestamp:bs.now()};return void this.produceEvent(s)}if(Dr(t)){const s={type:"InputEvent",inputType:"checkable",target:Ge(t),checked:t.checked,timestamp:bs.now()};return void this.produceEvent(s)}const r=function(t){return"TEXTAREA"===t.nodeName||Mr(t)&&!Lr(t)&&!Dr(t)}(t),o=Lr(t);if(r||o){const r=null!==(e=t.value)&&void 0!==e?e:"";if(null===(i=this.en)||void 0===i?void 0:i.shouldEncrypt(t))return void(null===(n=this.en)||void 0===n||n.registerInputNodeToEncrypt({targetId:s,targetValue:r,date:bs.now()}));const h=o?"0":"•",c={type:"InputEvent",inputType:"text",target:Ge(t),value:csString.prototype.replace.call(r,/\S/g,h),timestamp:bs.now()};this.produceEvent(c)}}inputHandler(t){if(!this.isStarted)return;const s=De(t),e=Ge(s);e&&this.zh(s)&&Ht.isConnected(s)&&Fi((()=>{this.Bh(s,e)}),"low")}Fh(){this.trackChanges(HTMLInputElement,"checked"),this.trackChanges(HTMLInputElement,"value"),this.trackChanges(HTMLTextAreaElement,"value")}Hh(){this.trackChanges(HTMLSelectElement,"selectedIndex"),this.trackChanges(HTMLSelectElement,"value"),this.trackChanges(HTMLOptionElement,"selected",!0)}trackChanges(t,s,e=!1){const i=Te(t.prototype,s,((t,s,i)=>{if(i!==s&&Ht.isConnected(t)){const s=e?t.parentElement:t;this.jh(s)}}));i&&csArray.prototype.push.call(this.Uh,i)}zh(t){return!Ye.isMaskedElement(t)&&!Ye.isMaskedElementChild(t)&&(C(t)||$(t)||k(t))}jh(t){if(this.isStarted&&Ht.isConnected(t)){const s=Ge(t);s&&this.zh(t)&&Fi((()=>{this.Bh(t,s)}),"low")}}}Ur.qh=["textarea","input:not([type])",'input[type="text"]','input[type="email"]','input[type="search"]','input[type="tel"]','input[type="url"]','input[type="password"]','input[type="number"]','input[type="checkbox"]','input[type="radio"]',"select"],gi([ie()],Ur.prototype,"inputHandler",null),gi([vt()],Ur.prototype,"trackChanges",null);class Fr extends En{constructor(){super(),this.Gh="object"==typeof window.customElements&&"function"==typeof window.customElements.whenDefined&&"function"==typeof window.Promise,this.Zh=mt("CustomElementRegistrationProducer:onElementsFound",(t=>{for(const e of t)Ye.isMaskedElement(e)||Ye.isMaskedElementChild(e)||R(s=e)&&y(s.tagName)&&csString.prototype.indexOf.call(s.tagName,"-")>0&&-1===csString.prototype.indexOf.call(s.tagName,":")&&-1===csString.prototype.indexOf.call(s.tagName,'"')&&-1===csString.prototype.indexOf.call(s.tagName,",")&&csArray.prototype.indexOf.call(U,csString.prototype.toLocaleLowerCase.call(s.tagName))<0&&this.register(csString.prototype.toLowerCase.call(e.tagName));var s}));const t=ji(this.Zh);this.Zr=new Bn((s=>t.push(s))),this.Ko=new Set}onStart(){this.Gh&&this.Zr.observe()}onStop(){this.Ko.clear(),this.Zr.disconnect()}async register(t){this.Ko.has(t)||(this.Ko.add(t),await window.customElements.whenDefined(t),this.produceEvent({type:"CustomElementRegistration",tagName:csString.prototype.toLowerCase.call(t)}))}}gi([vt()],Fr.prototype,"register",null);class Hr{static isNavigationTimingObserverSupported(){var t,s;return(null==(null===(t=window.PerformanceObserver)||void 0===t?void 0:t.supportedEntryTypes)?void 0:csArray.prototype.indexOf.call(null===(s=window.PerformanceObserver)||void 0===s?void 0:s.supportedEntryTypes,"navigation"))>=0}static getTimeOrigin(){return window.performance.timeOrigin}static Wh(){if(this.isNavigationTimingObserverSupported())return new window.PerformanceObserver((t=>Hr.Qh(t)))}static Qh(t){const s=t.getEntriesByType("navigation")[0];s&&(this.Yh=s,Hr.Kh(s))}static Us(t){this.Jh(t),this.Yh&&t(this.Yh),this.Xh||this.tc()}static Jh(t){this.sc.add(t)}static ec(t){this.sc.delete(t)}static tc(){if(this.nc||(this.nc=this.Wh()),!this.nc)return this.Yh||(this.Yh={requestStart:window.performance.timing.requestStart,domInteractive:window.performance.timing.domInteractive}),void this.Kh(this.Yh);this.nc.observe({type:"navigation",buffered:!0}),this.Xh=!0}static Kh(t){this.sc.forEach((s=>s(t)))}static Ws(t){this.ec(t),0===this.sc.size&&this.rc()}static rc(){var t;this.Xh&&(null===(t=this.nc)||void 0===t||t.disconnect(),this.Xh=!1,this.Yh=null,this.nc=this.Wh())}constructor(t){this.Qs=t}observe(){Hr.Us(this.Qs)}disconnect(){Hr.Ws(this.Qs)}}Hr.Xh=!1,Hr.sc=new Set,Hr.Yh=null;class zr extends En{constructor(){super(...arguments),this.oc=null,this.hc=new Hr((t=>{if(this.oc)return;const s=this.cc(t);s&&(this.oc=s,this.produceEvent(s))}))}onStart(){this.oc?this.produceEvent(this.oc):this.hc.observe()}onStop(){this.hc.disconnect()}cc(t){const s=Hr.getTimeOrigin();return{type:"PerformanceTiming",timings:{timeOrigin:s,requestStart:Math.floor(s+t.requestStart),domInteractive:Math.floor(s+t.domInteractive)},timestamp:bs.now()}}}!function(t){t[t.TAP=0]="TAP",t[t.LONG_PRESS=1]="LONG_PRESS",t[t.DRAG=2]="DRAG",t[t.FLICK=3]="FLICK",t[t.PINCH_IN=4]="PINCH_IN",t[t.PINCH_OUT=5]="PINCH_OUT"}(Vr||(Vr={})),function(t){t[t.UP=1]="UP",t[t.DOWN=2]="DOWN",t[t.LEFT=3]="LEFT",t[t.RIGHT=4]="RIGHT"}(Cr||(Cr={}));class Br{compute(t,s){const e=this.ac(s.x)-this.ac(t.x),i=this.ac(s.y)-this.ac(t.y),n=s.time-t.time;return{duration:n,distance:this.lc(e,i),direction:this.fc(e,i),velocity:this.vc(e,i,n)}}computePinchMetrics(t,s){const e=this.ac(s.x)-this.ac(t.x),i=this.ac(s.y)-this.ac(t.y);return{duration:s.time-t.time,distance:this.lc(e,i)}}getScale(t,s){return Math.abs(s/t-1)}ac(t){return t/window.devicePixelRatio}lc(t,s){return Math.round(Math.sqrt(t*t+s*s))}vc(t,s,e){const i=e/1e3,n=t/i,r=s/i;return Math.round(Math.abs(n)+Math.abs(r))}fc(t,s){return Math.abs(t)>Math.abs(s)?t>0?Cr.RIGHT:Cr.LEFT:s>0?Cr.DOWN:Cr.UP}}const qr="undefined"!=typeof performance&&!!performance.now,jr=qr?()=>performance.now():csDate.now,Gr=qr?null===(kr=performance.timing)||void 0===kr?void 0:kr.navigationStart:0,Zr={now:()=>Math.round(jr()+Gr),elapsed:()=>jr()};function Wr(t,s=0){const e=Math.pow(10,s);return Math.round(t*e)/e}class Qr{constructor(){this.mc={},this.wc=()=>{},this.gc=new Br,this.yc()}static isGestureDetectionSupported(){return"undefined"!=typeof devicePixelRatio}onGesture(t){this.wc=t}isValidTouchEvent(t){return"touches"in t&&"changedTouches"in t}processActionDown(t){if(!this.Ec(t))return;this.Ac(t)&&this.yc();const s={x:t.touches[0].clientX,y:t.touches[0].clientY,time:Zr.now()};if(1===t.touches.length)this.mc.startPinchTime=s.time,this.mc.firstTouch=s;else if(2===t.touches.length&&(this.mc.secondTouch={x:t.touches[1].clientX,y:t.touches[1].clientY,time:Zr.now()},this.mc.firstTouch&&this.mc.secondTouch)){const t=this.gc.computePinchMetrics(this.mc.firstTouch,this.mc.secondTouch);this._c=t.distance}csArray.prototype.push.call(this.Sc,s),this.Rc=De(t)}processActionMove(){this.Tc=!0}processActionUp(t){if(this.Ic(t)){if(csArray.prototype.push.call(this.Sc,{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY,time:Zr.now()}),this.Pc(t)&&this.mc.startPinchTime){const s={x:t.touches[0].clientX,y:t.touches[0].clientY,time:this.mc.startPinchTime},e={x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY,time:Zr.now()};this.mc.firstTouch&&(this.mc.firstTouch=s,this.mc.secondTouch=e),this.bc(t)}this._c||this.Vc()&&this.Cc(t)}}yc(){this.Sc=[],this.Rc=null,this.Tc=!1,this._c=null,this.kc=!0}Cc(t){const s=this.gc.compute(this.Sc[0],this.Sc[1]);this.kc=t.isTrusted;const e=this.Tc?this.Nc(s):this.Oc(s);if(this.$c(e.type,t.changedTouches)){const s=t.changedTouches[0];e.pageX=Wr(s.pageX,1),e.pageY=Wr(s.pageY,1)}this.wc(e,t)}bc(t){if(!this.mc.firstTouch||!this.mc.secondTouch)return;const s=this.gc.computePinchMetrics(this.mc.firstTouch,this.mc.secondTouch);this.kc=t.isTrusted;const e=this.xc(s);e&&this.wc(e,t)}xc(t){if(!this._c)return;if(this.gc.getScale(this._c,t.distance)<.1)return;return{type:this._c>t.distance?Vr.PINCH_IN:Vr.PINCH_OUT,target:this.Rc,distance:t.distance,isTrusted:this.kc}}Nc(t){return{type:t.velocity<100?Vr.DRAG:Vr.FLICK,target:this.Rc,velocity:t.velocity,distance:t.distance,direction:t.direction,isTrusted:this.kc}}Oc(t){return{type:t.duration<1e3?Vr.TAP:Vr.LONG_PRESS,target:this.Rc,isTrusted:this.kc}}$c(t,s){return t===Vr.TAP&&s&&1===s.length}Ac(t){return 1===t.touches.length}Vc(){return 2===this.Sc.length}Ec(t){return t.touches.length>0}Ic(t){return t.changedTouches.length>0}Pc(t){return this.Tc&&!!this._c&&1===t.changedTouches.length&&1===t.touches.length}}class Yr{constructor(t){this.Qs=t}observe(){Yr.Mc&&Yr.Lc(this.Qs)}disconnect(){Yr.Mc&&Yr.Dc(this.Qs)}static Uc(t,s){csArray.prototype.forEach.call(Ut(Yr.sc),(e=>e(t,s)))}static Lc(t){Yr.sc.has(t)||(Yr.sc.add(t),1===Yr.sc.size&&(Yr.Fc.onGesture(Yr.Uc),csArray.prototype.forEach.call(Yr.ar,(t=>be(t)))))}static Dc(t){Yr.sc.delete(t),0===Yr.sc.size&&csArray.prototype.forEach.call(Yr.ar,(t=>Ve(t)))}static Hc(t){if(Yr.Fc.isValidTouchEvent(t))switch(t.type){case"touchstart":Yr.Fc.processActionDown(t);break;case"touchmove":Yr.Fc.processActionMove();break;case"touchend":Yr.Fc.processActionUp(t)}}}Yr.ar=[{boundElement:n.document,type:"touchstart",listener:t=>Yr.Hc(t)},{boundElement:n.document,type:"touchmove",listener:t=>Yr.Hc(t)},{boundElement:n.document,type:"touchend",listener:t=>Yr.Hc(t)}],Yr.Mc=Qr.isGestureDetectionSupported(),Yr.sc=new Set,Yr.Fc=new Qr;class Kr extends En{constructor(){super(),this.zc=new Yr(this.Bc.bind(this))}onStart(){this.zc.observe()}onStop(){this.zc.disconnect()}Bc(t){const s=this.qc(t);s&&this.produceEvent(s)}qc(t){if(!this.jc(t))return null;const s=(e=t.target,Be.getProperty(e,je));var e;return s?{type:"Gesture",targetId:s,data:{type:t.type,direction:t.direction,distance:t.distance,velocity:t.velocity,pageX:t.pageX,pageY:t.pageY}}:null}jc(t){return null!==t.target&&!(R(t.target)&&Ye.isMaskedElementChild(t.target))}}let Jr=[],Xr=!1;const to=It((function(){const t=csDate.now();for(let s=0;s=35)return Jr=csArray.prototype.slice.call(Jr,s+1),void csSetTimeout(to);Jr=[],Xr=!1}),"executeTasks");var so;!function(t){t[t.Started=0]="Started",t[t.Stopped=1]="Stopped",t[t.Processing=2]="Processing",t[t.Completed=3]="Completed"}(so||(so={}));class eo{constructor(){this.Gc=new pt,this.Hi=so.Stopped,this.Qs=null,this.Zc=t=>{this.Hi!==so.Stopped&&t&&(this.Qs(t),this.Wc())}}get queueLength(){return this.Gc.length}start(t){if(this.Qs)throw new Error("callback already set");this.Hi=so.Started,this.Qs=t}push(t){this.Gc.push(t),this.Qc()}stop(){this.Qs=null,this.Hi=so.Stopped,this.Gc.clear()}static pipe(t,s){let e=t;const i=new csArray;for(const t of s){const s=new eo;s.start((s=>{t.pushEvent(s)})),csArray.prototype.push.call(i,s),$t(e,(t=>t.subscribe((t=>s.push(t))))),e=[t]}const n=new io(i);return $t(e,(t=>t.subscribe((t=>n.push(t))))),n}Yc(){return this.Hi===so.Stopped}Kc(){return this.Hi===so.Processing}Wc(){this.Yc()||(this.Gc.isEmpty?this.Hi=so.Completed:(this.Hi=so.Processing,function(t){if(csArray.prototype.push.call(Jr,t),!Xr){for(let t=0;t<3;t++)csSetTimeout(to);Xr=!0}}((()=>{const t=this.Gc.pop();t instanceof Oi?t.complete(this.Zc):this.Zc(t)}))))}Qc(){this.Yc()||this.Kc()||this.Wc()}}class io extends eo{constructor(t){super(),this.Jc=t}get queueLength(){return csArray.prototype.reduce.call(this.Jc,((t,s)=>t+s.queueLength),0)}stop(){super.stop(),$t(this.Jc,(t=>t.stop()))}}class no{constructor(t,s=[]){this.producers=t,this.processors=s,this.qs=!1,this.sc=[]}get pendingEvents(){var t,s;return null!==(s=null===(t=this.Gc)||void 0===t?void 0:t.queueLength)&&void 0!==s?s:0}start(){if(this.qs)throw new Error("Recording is already started.");const t=this.sc;this.Gc=eo.pipe(this.producers,this.processors),this.Gc.start((s=>csArray.prototype.forEach.call(t,(t=>t(s))))),$t(this.producers,(t=>t.start())),$t(this.processors,(t=>t.start())),this.qs=!0}stop(){this.Gc.stop(),this.sc.length=0;for(const t of this.producers)t.stop();for(const t of this.processors)t.stop();this.qs=!1,this.sc=[]}subscribe(t){if(this.qs)throw new Error("Recording is already started.");return csArray.prototype.push.call(this.sc,t),()=>this.sc=csArray.prototype.filter.call(this.sc,(s=>s!==t))}}class ro extends En{constructor(t){super(),this.an=t}subscribe(t){return super.subscribe(t)}onStart(){$t(this.an,(t=>{t.onEvent((s=>{var e;return this.Li(s,null!==(e=t.eventType)&&void 0!==e?e:"browser")}))})),$t(this.an,(t=>{var s;null===(s=t.start)||void 0===s||s.call(t)}))}onStop(){$t(this.an,(t=>{var s;return null===(s=t.stop)||void 0===s?void 0:s.call(t)}))}Li(t,s){this.produceEvent({timestamp:bs.now(),type:"Legacy",originalEvent:t,eventType:s})}}function oo(t){const s=function(t){const s={type:ho(t.type)};for(const e in t){const i=t[e];void 0!==i&&"type"!==e&&(s[e]=i)}return s}(t.data);return{type:Oe.GESTURE_RECOGNITION,args:[t.targetId,s],date:t.timestamp}}function ho(t){switch(t){case Vr.DRAG:case Vr.FLICK:return xe.SWIPE;case Vr.LONG_PRESS:return xe.LONG_PRESS;case Vr.TAP:return xe.TAP;case Vr.PINCH_IN:return xe.PINCH_IN;case Vr.PINCH_OUT:return xe.PINCH_OUT}}function co(t){return function(t,s){let e=[],i=!1;return{push(t){csArray.prototype.push.call(e,t),e.length!==s.batchSize?s.autoFlushDelay&&s.autoFlushDelay>0&&!i&&(i=!0,csSetTimeout((()=>{i=!1,e.length>0&&this.flush()}),s.autoFlushDelay)):this.flush()},flush(){if(!e.length)return;const s=e;e=[],t(s)}}}((s=>{const e={visibleInViewPort:s},i={type:Oe.TEXT_VISIBILITY,date:bs.now(),args:[e]};t(i)}),{batchSize:20,autoFlushDelay:1e3})}var ao;!function(t){t.REQUEST_START="requestStart",t.DOM_INTERACTIVE="domInteractive",t.TIME_ORIGIN="timeOrigin"}(ao||(ao={}));let uo=0;class lo{get pendingEvents(){return this.Xc.pendingEvents}constructor(t,s,e,i,n){this.Xc=t,this.ta=s,this.sa=e,this.fn=i,this.vn=n,this.ea=()=>{},this.ia=()=>{},this.na=co((t=>this.ea(t)))}start(){var t,s;this.ra={processEvent(t,s){if(t.originalEvent.type===Oe.PERFORMANCE_RESOURCE_TIMING)return uo>=500?null:(uo+=1,s({...t.originalEvent,date:t.timestamp}));s(t.originalEvent)},reset(){uo=0}},this.Xc.subscribe((t=>{var s,e,i,n,r,o;const h=t,{timestamp:c}=h;switch(h.type){case"Legacy":{const t="user"===h.eventType?null!==(s=this.ia)&&void 0!==s?s:()=>{}:this.ea;this.ra.processEvent(h,t)}break;case"CustomElementRegistration":this.ea({type:Oe.CUSTOM_ELEMENT_REGISTRATION,date:c,args:[h.tagName]});break;case"DomEvent":!function(t,s,e){const{timestamp:i}=t;switch(t.domEvent){case"initialDOM":{const{initialDOM:s}=t,n={type:Oe.INITIAL_DOM,date:i,args:[s]};e.emitInitialDomDone(n);break}case"nodesAdded":csArray.prototype.forEach.call(t.nodes,(e=>{s({type:Oe.MUTATION_INSERT,date:i,args:[t.target,t.nextSibling,e]})}));break;case"nodesMoved":for(const e of t.nodesIds)s({type:Oe.MUTATION_MOVE,date:i,args:[e,t.nextSibling,t.target]});break;case"nodesRemoved":csArray.prototype.forEach.call(t.nodesIds,(t=>{s({type:Oe.MUTATION_REMOVE,date:i,args:[t]})}));break;case"attributeChanged":{const{target:e,namespace:n,attribute:r,newValue:o}=t;s({type:Oe.MUTATION_ATTRIBUTE,date:i,args:[e,n,r,o]});break}case"characterDataChanged":{const{target:e,newValue:n}=t;s({type:Oe.MUTATION_CHARACTER_DATA,date:i,args:[e,n]});break}case"cssRuleInserted":{const{target:e,rule:n,index:r}=t,o=g(r)?[e,n,r]:[e,n];s({type:Oe.STYLESHEET_RULE_INSERT,date:i,args:o});break}case"cssRuleDeleted":{const{target:e,index:n}=t;s({type:Oe.STYLESHEET_RULE_DELETE,date:i,args:[e,n]});break}case"cssRuleUpdated":{const{target:e,rule:n,index:r}=t;s({type:Oe.STYLESHEET_RULE_UPDATE,date:i,args:[e,n,r]});break}case"shadowRootAttached":{const{target:e,shadowRoot:n}=t;s({type:Oe.ATTACH_SHADOW,date:i,args:[e,n]});break}case"adoptedStyleSheetRegistered":{const{sheetId:e,cssRules:n}=t;s({type:Oe.REGISTER_ADOPTED_STYLE_SHEET,date:i,args:[e,{cssRules:n}]});break}case"adoptedStyleSheetsSet":{const{target:e,sheetsIds:n}=t;s({type:Oe.SET_ADOPTED_STYLE_SHEETS,date:i,args:[e,n]});break}case"adoptedStyleSheetRuleInserted":{const{sheetId:e,rule:n,index:r}=t,o=g(r)?[e,n,r]:[e,n];s({type:Oe.ADOPTED_STYLESHEET_RULE_INSERT,date:i,args:o});break}case"adoptedStyleSheetRuleDeleted":{const{sheetId:e,index:n}=t;s({type:Oe.ADOPTED_STYLESHEET_RULE_DELETE,date:i,args:[e,n]});break}case"adoptedStyleSheetRuleUpdated":{const{sheetId:e,rule:n,index:r}=t,o=[e,n,r];s({type:Oe.ADOPTED_STYLESHEET_RULE_UPDATE,date:i,args:o});break}default:se.error("translateDOMEvent: DOMEvent not supported")}}(h,this.ea,this.ta);break;case"InputEvent":{const t=function(t){switch(t.inputType){case"text":return{type:Oe.INPUT_TEXT,args:[t.target,t.value],date:t.timestamp};case"select":return{type:Oe.INPUT_SELECT,args:[t.target,t.selectedIndex],date:t.timestamp};case"checkable":return{type:Oe.INPUT_CHECKABLE,args:[t.target,t.checked],date:t.timestamp}}}(h);null===(e=this.ia)||void 0===e||e.call(this,t);break}case"encryptedCharacterDataChanged":{const{target:t,rawData:s,encryptedData:e,encryptionMetadata:i}=h;this.ea({type:Oe.MUTATION_ENCRYPTED_CHARACTER_DATA,date:c,args:[t,s,e,i]});break}case"StaticResource":{const{url:t}=h;this.ea({type:Oe.STATIC_RESOURCE_URL,date:c,args:[t]});break}case"ResizeMaskedElement":{const{target:t,width:s,height:e}=h;this.ea({type:Oe.MUTATION_ATTRIBUTE,date:c,args:[t,"","style",`width:${s}px !important;height:${e}px !important;`]});break}case"Gesture":{const s=oo(t);null===(i=this.ia)||void 0===i||i.call(this,s);break}case"TextVisibility":this.na.push(h.text);break;case"StaticResourceManagerEvent":null===(n=this.sa)||void 0===n||n.processEvent(h);break;case"screenResize":{const{width:t,height:s}=h,e={type:Oe.SCREEN_RESIZE,date:c,args:[t,s]};this.ea(e);break}case"viewportResize":{const{width:t,height:s}=h,e={type:Oe.RESIZE,date:c,args:[t,s]};this.ea(e);break}case"PerformanceTiming":this.ea(function(t){return{type:Oe.PERFORMANCE_TIMINGS,args:[{performanceTiming:ao.REQUEST_START,timestamp:t.timings.requestStart},{performanceTiming:ao.DOM_INTERACTIVE,timestamp:t.timings.domInteractive},{performanceTiming:ao.TIME_ORIGIN,timestamp:t.timings.timeOrigin}],date:t.timestamp}}(h));break;case"CustomError":{const t=null===(r=this.vn)||void 0===r?void 0:r.translate(h);t&&this.ea(t);break}case"JSError":{const t=null===(o=this.fn)||void 0===o?void 0:o.translate(h);t&&this.ea(t);break}case"VideoEvent":{const t=function(t){switch(t.videoEventType){case"play":return{type:Oe.VIDEO_PLAY,args:[t.nodeId],date:t.timestamp};case"pause":return{type:Oe.VIDEO_PAUSE,args:[t.nodeId],date:t.timestamp};case"seeked":{const s=t;return{type:Oe.VIDEO_SEEK,args:[s.nodeId,s.newTimePositionInSec],date:t.timestamp}}default:return null}}(h);t&&this.ea(t);break}case"warning":se.warn(h.message);break;default:se.error(`WebRecorderEventTranslator: Event not supported (${h.type})`)}})),this.ta.emitInitialDomStart(),null===(t=this.fn)||void 0===t||t.start(),null===(s=this.vn)||void 0===s||s.start(),this.Xc.start()}stop(){var t,s,e;this.reset(),this.flush(),this.Xc.stop(),null===(t=this.sa)||void 0===t||t.flushEvents(),null===(s=this.fn)||void 0===s||s.stop(),null===(e=this.vn)||void 0===e||e.stop()}flush(){this.na.flush()}onEvent(t,s){var e;this.ea=t,this.ia=s,null===(e=this.sa)||void 0===e||e.onEvent((t=>this.ea(t)))}reset(){this.ra.reset()}}class fo{constructor(t=100){this.oa=t,this.ha={},this.ca=null,this.oi="original-resource-name"}onEvent(t){this.aa=t}processEvent(t){this.ua(t.resourceId,t.resource.hash,t.originalResourceName),this.da(t)}flushEvents(){this.ca&&csClearTimeout(this.ca),this.fa()}onSendStaticResource(t){this.da=t}fa(){if(!Object.keys(this.ha).length)return;const t={type:Oe.RESOURCE_HASHES,date:bs.now(),args:[this.ha]};this.ca=null,this.ha={},this.aa(t)}ua(t,s,e){let i=s;e&&(i+=`?${this.oi}=${e}`),this.ha[t]=i,this.ca||(this.ca=window.csSetTimeout((()=>this.fa()),this.oa))}}class vo{constructor(t,s,e){this.ta=t,this.Vt=s,this.va=e,this.ma=wi.ETR_DISABLED,this.pa=wi.ETR_PENDING,this.wa=!0}getEtrStatus(t){void 0===t&&(t=this.Vt.getSession());const s=null==t?void 0:t.etrStatus;return this.ga()&&s===wi.ETR_SAVED_SESSION?s:this.ma}onEventTriggerRecording(t,s){switch(s){case pi.ETR_PAGE:this.ya(wi.ETR_SAVED_PAGE);break;case pi.ETR_LEGACY:case pi.ETR_SESSION:this.ya(wi.ETR_SAVED_SESSION)}}handleCollectStateChange(t){this.wa=!1,t?this.Ea(this.pa):this.Ea(wi.ETR_DISABLED)}handleArtificialPageview(){this.va?(this.wa=!0,this.Ea(wi.ETR_DISABLED)):this.ga()&&this.Ea(wi.ETR_PENDING)}handleSessionRenewal(){this.wa=!0,this.Ea(wi.ETR_DISABLED)}Ea(t){this.ma=t,this.pa=wi.ETR_PENDING,this.Aa(t),this.ta.emitRecordingContextChange()}ya(t){this.wa?Number(t)>Number(this.pa)&&(this.pa=t):this.ga()&&Number(t)>Number(this.ma)&&(this.ma=t,this.Aa(t),this.ta.emitRecordingContextChange())}Aa(t){const s=this.Vt.getSession();null!==s&&s.etrStatus===wi.ETR_NOT_SAVED_SESSION&&t===wi.ETR_SAVED_SESSION&&(s.etrStatus=t,this.Vt.setSession(s))}ga(){return this.ma!==wi.ETR_DISABLED}}function mo(t,s){let e,i,n,r,o=null;const h=c=>{const a=bs.elapsed();if(!c&&null!==o){const t=s-(a-o);if(t>0)return void(i=window.csSetTimeout(h,t))}const u=a-n;i=null,o=null,n=null,r=t(u,...e)},c=(...t)=>{if(e=[...t],!n)return n=bs.elapsed(),i=window.csSetTimeout(h,s),r;o=bs.elapsed()};return c.flushPending=()=>{i&&(window.csClearTimeout(i),h(!0))},c.cancel=()=>{o=null,n=null,i&&(window.csClearTimeout(i),i=null)},c}function po(t=0){return(s,e,i)=>{const n=i.value;let r=!1;i.value=function(...s){r||(r=!0,csSetTimeout((()=>{r=!1,n.apply(this,s)}),t))}}}var wo;!function(t){t[t.NOT_EXIST=2]="NOT_EXIST"}(wo||(wo={}));class go extends ei{constructor(t,s,e){super(),this.sa=t,this._a=s,this.Sa=e,this.Ra={},this.Ta=new Set,this.Kc=!1}initState(){Cs()&&(this.Ia=this.Sa.getRequestParameters(),this.Pa=`${this._a}/exist?${es.toQuery(this.Ia)}`,this.ba=`${this._a}/putTag?${es.toQuery(this.Ia)}`,this.Va=mo((async()=>{if(this.Kc)this.Va();else{this.Kc=!0;try{await this.Ca()}finally{this.Kc=!1}}}),300),this.sa.onSendStaticResource((t=>{this.ka(t)})))}onStart(){}onStop(){}onIframeStaticResource(t){this.ka(t)}ka(t){this.Na(t.resource.hash,t.resource.data),t.nestedResources&&t.nestedResources.length>0&&csArray.prototype.forEach.call(t.nestedResources,(t=>{this.Na(t.hash,t.data)}))}Na(t,s){this.Ta.has(t)||(this.Ta.add(t),this.Ra[t]=s,this.Va())}async Ca(){const t=this.Ra;this.Ra={};const s=await this.Oa(t);if(!s.length)return;const e=this.$a(s);await Promise.all(csArray.prototype.map.call(e,(t=>window.fetch(this.ba,{method:"POST",body:t}))))}async xa(t){try{const s=Object.keys(t);if(!s.length)return[];const e={projectId:this.Ia.pid,filter:wo.NOT_EXIST,hashes:s,touch:!0},i=await window.fetch(this.Pa,{method:"POST",body:csJSON.stringify(e)});return await i.json()}catch(t){return[]}}async Oa(t){const s=[],e=await this.xa(t);return csArray.prototype.forEach.call(e,(e=>{const i=t[e];i?csArray.prototype.push.call(s,{hash:e,data:i}):se.warn("SRM: received unknown hash: "+e)})),s}$a(t){let s=0;const e=[new FormData];for(const i of t){const{data:t,hash:n}=i,r=e.length-1;if(s+=t.size,s<8388608)e[r].append("",t,n);else{const i=new FormData;i.append("",t,n),s=t.size,csArray.prototype.push.call(e,i)}}return e}}const yo="v2/recording",Eo=["isRecording"],Ao=["replay:resourceManager:enableForOnlineResource:nextPageviewOnly","cssrm:onlineAssets:activateForNextPageview"],_o=["replay:resourceManager:getStatus","cssrm:getStatus"];class So{constructor(t,s,e,i,n,r,o,h,c,a,u,l,d,f,v,m,p,w,g,y,E,A){this.Ma=t,this.Vt=s,this.wt=e,this.Ia=i,this.La=n,this.gt=r,this.Ki=o,this.Da=h,this.Ji=c,this.Xi=a,this.tn=u,this.Ua=l,this.ta=d,this.Fa=f,this.Ha=v,this.za=m,this.Ba=p,this.uh=w,this.dn=g,this.qa=y,this.ja=E,this.en=A}init(){const t=[],s=[];csArray.prototype.push.call(s,new Jn),this.Ga=new Er(this.qa.shouldUseAnonymization(),this.wt.whitelistedAttributes,this.gt,this.wt.anonymizeDigits),this.Za();const e=new Kn("csPersisted");this.Wa(e);const i=new ti;this.Wi=new Xe;const n=new jn;csArray.prototype.push.call(t,n),this.wt.useStaticResourceManager&&$n.isSupported()&&(this.ln=new $n,this.sa=new fo,this.Qa=new go(this.sa,this.wt.getStaticResourceManagerUri(),this.Ia),this.Ha.addListener(this.Qa),csArray.prototype.push.call(s,this.ln));const r=new Un(i,this.Ia,{getRequestParameters:()=>({let:this.recordingService.getRecordingLastEventTimestamp()})},{getRequestParameters:()=>({rst:this.recordingService.getRecordingStartTimestamp()})},{getRequestParameters:()=>({rt:csArray.prototype.join.call(this.Vt.getCollectStates(),",")})}),o=new Gn(`${this.wt.getRecordingUri()}/${yo}`);csArray.prototype.push.call(s,this.Ga),csArray.prototype.push.call(s,new Ar(this.uh)),csArray.prototype.push.call(s,new Sr),this.Ya=new Ke,this.Ya.init(),csArray.prototype.push.call(t,this.Ya),this.rn=new Dn(e,o,this.nn),csArray.prototype.push.call(t,new Fn(window.location,this.gt));const h=new _n,c=new Nr,a=new xr,u=new Ur(this.en),l=new Fr,d=[c,this.Da,h,new ro(csArray.prototype.filter.call(t,(t=>t))),l,new zr,new Kr,u,a];const f=new no(d,s),v=new lo(f,this.ta,this.sa,this.fn,this.vn),m=[h,c,a,u,l];this.recordingService=new Ln(this.wt,this.Wi,r,i,this.Ki,this.Vt,this.Ji,this.Xi,this.tn,this.en,this.nn,this.rn,o,v,t,m,this.ln,this.dn,this.fn,this.vn),this.Fa.addListener(this.recordingService),this.Ha.addListener(this.recordingService),this.recordingService.init(),this.La.register(Eo,(()=>this.Vt.isReplayRecorded()&&!this.za.isUrlExcludedForSessionReplay())),this.La.register(Ao,(()=>{this.recordingService.activateOnlineAssetsOnNextPageview(),this.ta.emitRecordingContextChange()})),this.La.register(_o,(()=>this.recordingService.getStaticResourceManagerStatus())),this.Ka=new vo(this.ta,this.Vt,this.wt.malkaUrlEnabled),this.Fa.addListener(this.Ka),this.Ma.enableRecordingContext(this.recordingService,this.Vt,this.Ka),this.Ja()}onAfterNaturalPageView(){var t;this.za.isUrlExcludedForSessionReplay()?this.recordingService.resetOnlineAssetsOnPageview():this.recordingService.updateOnlineAssetsOnPageview(),null===(t=this.Qa)||void 0===t||t.initState()}onStartTracking(){this.rn.recover(),this.Za(),this.Vt.isReplayRecorded()&&!this.za.isUrlExcludedForSessionReplay()&&(this.Vt.isTemporarilyRecorded()&&this.recordingService.blockSendingEventsFromQuotaService(),this.Xa())}onArtificialPageViewEnd(){!this.Vt.isReplayRecorded()||this.za.isUrlExcludedForSessionReplay()||this.Vt.isTemporarilyRecorded()||this.rn.sendLastMessageBeacon(),this.recordingService.clearStates()}onBeforeArtificialPageView(){this.Ka.handleArtificialPageview()}onAfterArtificialPageView(){this.Za(),this.Vt.isReplayRecorded()&&!this.za.isUrlExcludedForSessionReplay()?(this.Vt.isTemporarilyRecorded()&&this.recordingService.blockSendingEventsFromQuotaService(),this.recordingService.updateOnlineAssetsOnPageview(),this.tu()):(this.recordingService.resetOnlineAssetsOnPageview(),this.su())}onBeforeSessionRenewal(){this.Ka.handleSessionRenewal(),this.recordingService.clearStates(),this.su()}onOptout(){this.su(),this.recordingService.onOptOut()}onReplayUnanonymizationConsentGranted(){this.Za(),this.recordingService.triggerUnanonymizationConsentGranted(),this.ta.emitRecordingContextChange()}onReplayUnanonymizationConsentWithdrawn(){this.Za(),this.recordingService.triggerUnanonymizationConsentWithdrawn(),this.ta.emitRecordingContextChange()}onCollectStateChange(t,s){if(t===vi.QUOTA_REACHED||t===vi.ANALYTICS_ONLY&&s===mi.ETR_OFF)this.recordingService.clearEvents(),this.su();else{this.nn.setQueryParams({rt:csArray.prototype.join.call(this.Vt.getCollectStates(),",")}),this.recordingService.allowSendingEventsFromQuotaService(),this.recordingService.pushEvents();const e=t===vi.ANALYTICS_ONLY&&s===mi.ETR_ON;this.Ka.handleCollectStateChange(e)}}onInitialDomStart(){this.recordingService.blockSendingEventsFromSerialization(),this.rn.blockSendingLastMessage()}onInitialDomDone(t){this.recordingService.allowSendingEventsFromSerialization(),this.recordingService.addInitialDom(t),this.rn.allowSendingLastMessage(),this.Ya.start(),this.recordingService.pushEvents()}onAfterReplayRecordingConsentGranted(){this.Vt.isReplayRecorded()&&!this.za.isUrlExcludedForSessionReplay()&&(this.Vt.isTemporarilyRecorded()&&this.recordingService.blockSendingEventsFromQuotaService(),this.Xa(),this.recordingService.triggerRecordingForSessionGranted())}onAfterReplayRecordingConsentWithdrawn(){this.recordingService.isRecording()&&(this.recordingService.triggerRecordingForSessionWithdrawn(),this.recordingService.clearStates(),this.su())}Ja(){var t,s,e,i;if(null===(s=null===(t=this.wt.experimental.sessionReplay)||void 0===t?void 0:t.shadowRoot)||void 0===s?void 0:s.filterByHostSelector){$t(null===(i=null===(e=this.wt.experimental.sessionReplay)||void 0===e?void 0:e.shadowRoot)||void 0===i?void 0:i.filterByHostSelector,(t=>{We(t)&&rn.setShadowRootFilter((s=>{try{return G.call(s.host,t)}catch{return!1}}))}))}}Xa(){this.recordingService.start(),this.rn.start(),this.ta.emitRecordingContextChange()}su(){!function(t=!1){t&&(qe=1),je=csSymbol("nodeIdentifier")}(),this.recordingService.stop(),this.rn.stop(),this.ta.emitRecordingContextChange()}tu(){this.su(),this.Xa()}Wa(t){this.nn=this.Ba.create(`${this.wt.getRecordingUri()}/${yo}`,!0,"byteArray",t,["rt","v","pid","pn","sn","uu"])}Za(){var t;const s=this.qa.shouldUseAnonymization();this.Ga.setAnonymization(s),null===(t=this.eu)||void 0===t||t.setAnonymization(s)}}var Ro,To;ne([Pt("Recording.onStartTracking")],So.prototype,"onStartTracking",null),ne([Pt("onInitialDomDone")],So.prototype,"onInitialDomDone",null),function(t){t[t.NOT_NEEDED=1]="NOT_NEEDED",t[t.NOT_EXPRESSED=2]="NOT_EXPRESSED",t[t.WITHDRAWN=3]="WITHDRAWN",t[t.GRANTED=4]="GRANTED"}(Ro||(Ro={})),function(t){t.isReplayConsentNeeded=function(t){return t.replayConsentRequiredForSession},t.isRecordingBlockedByConsent=function(t){return t.collectState===vi.RECORDING_BLOCKED_BY_CONSENT_NOT_EXPRESSED||t.collectState===vi.RECORDING_BLOCKED_BY_CONSENT_WITHDRAWN},t.isRecordingWithDrawn=function(t){return t.collectState===vi.RECORDING_BLOCKED_BY_CONSENT_WITHDRAWN}}(To||(To={}));class Io{constructor(t,s,e,i){this.bt=t,this.Vt=s,this.wt=e,this.iu=i,this.nu=!1}isNaturalPageViewSent(){return this.nu}setNaturalPageViewSent(t){this.nu=t}getTrackingContext(){const t=this.Vt.getSession();if(!t)return null;const s=this.getSessionKey();if(!s)return null;const e=this.wt.projectId,i=this.wt.uxaDomain;return{projectId:e,sessionKey:s,pageNumber:t.pageNumber,pageViewType:this.iu.getPageViewType(),isRecording:this.Vt.isReplayRecorded(),uxaDomain:i,recordingConsentState:this.ru(t),...this.wt.smbConfig}}getSessionKey(){const t=this.bt.getVisitor();return t?`${t.id}.${t.visitsCount}`:null}ru(t){return To.isReplayConsentNeeded(this.wt)?t.collectState===vi.RECORDING_BLOCKED_BY_CONSENT_NOT_EXPRESSED?Ro.NOT_EXPRESSED:t.collectState===vi.RECORDING_BLOCKED_BY_CONSENT_WITHDRAWN?Ro.WITHDRAWN:Ro.GRANTED:Ro.NOT_NEEDED}}class Po{constructor(t){this.ou=t,this.hu=[]}handleCommand(t){if(E(t)&&(this.au(t),this.ou.isNaturalPageViewSent())){const s=this.ou.getTrackingContext();null!==s&&this.lu(t,s)}}au(t){csArray.prototype.push.call(this.hu,t)}executeRegisteredCallbacks(){const t=this.ou.getTrackingContext();null!==t&&csArray.prototype.map.call(this.hu,(s=>this.lu(s,t)))}lu(t,s){csSetTimeout((()=>{t(s)}))}}class bo{constructor(t){this.ou=t,this.du=[]}handleCommand(t){return this.ou.isNaturalPageViewSent()?this.fu(t):void this.vu(t)}fu(t){const s=this.ou.getSessionKey();return this.mu(t)&&null!==s&&this.lu(t.callback,s),s}vu(t){this.mu(t)&&csArray.prototype.push.call(this.du,t.callback)}flushPendingCallbacks(){const t=this.ou.getSessionKey();null!==t&&csArray.prototype.forEach.call(this.du,(s=>{this.lu(s,t)})),this.du=[]}mu(t){return t&&"function"==typeof t.callback}lu(t,s){csSetTimeout((()=>{t(s)}))}}class Vo{constructor(t,s){this.pu=t,this.ou=s}onTrackingContextRequestCallback(t){const s=this.ou.getTrackingContext();null!==s&&this.pu.sendToChildren(Ys.TrackingContextResultMessage,{...t,trackingContext:s})}onIframeIntegrationCallback(t){if(!this.ou.isNaturalPageViewSent())return;const s=this.ou.getTrackingContext();null!==s&&(t.trackingContext=s,this.pu.sendToChildren(Ys.IntegrationCallback,t))}sendAfterPageViewCallbackToChildren(){const t=this.ou.getTrackingContext();if(null===t)return;const s={trackingContext:t,initiator:Ws.AfterPageView};this.pu.sendToChildren(Ys.IntegrationCallback,s)}}class Co{constructor(t){this.ou=t}handleCommand(t,s){w(t)&&E(s)&&this.lu(t,s)}lu(t,s){csSetTimeout((()=>{const e=this.ou.getTrackingContext();if(e){const i=function(t,s){const{isRecording:e,pageNumber:i,projectId:n,siteId:r,uxaDomain:o,csLiteDomain:h}=t,c=/^(.+)\.(\d+)$/.exec(t.sessionKey);let a;if(e&&c){const[,t,e]=c;a=r?`${h}/sites/${r}/player?uu=${t}&sn=${e}&pn=${i}`:`${o}/quick-playback/index.html?pid=${n}&uu=${t}&sn=${e}&pvid=${i}&recordingType=cs`,s.withTimestamp&&(a+="&t="+(bs.now()-s.recordingStartTimestamp))}return{replayLink:a,isRecording:e}}(e,t);s(i)}}))}}class ko{constructor(){this.hu=new Set}handleCommand(t,s){return E(t)?this.hu.has(t)?null:(this.hu.add(t),s&&(this.lo=s,this.wu(t,s)),()=>this.hu.delete(t)):null}executeCallbacks(t){this.gu(t)&&(this.lo=t,this.hu.forEach((s=>this.wu(s,t))))}wu(t,s){csSetTimeout((()=>{try{t(s)}catch(t){}}))}gu(t){const{isRecording:s,recordingStartTimestamp:e,etrState:i,etrStatus:n,collectState:r}=t;return this.lo&&(this.lo.isRecording!==s||this.lo.recordingStartTimestamp!==e||this.lo.etrState!==i||this.lo.etrStatus!==n||this.lo.collectState!==r)}}const No=["afterPageView"],Oo=["getSessionKey"],$o=["onRecordingContextChange","onRecordingStateChange"],xo=["replay:link:generate"];class Mo{constructor(t,s,e,i,n,r,o,h){this.bt=t,this.Vt=s,this.La=e,this.yu=i,this.pu=n,this.wt=r,this.iu=o,this.Ma=h}init(){this.ou=new Io(this.bt,this.Vt,this.wt,this.iu),this.Eu=new Po(this.ou),this.Au=new bo(this.ou),this._u=new ko,this.Su=new Co(this.ou),this.Ru=new Vo(this.pu,this.ou),this.yu.addListener(this.Ru),this.La.register(Oo,(t=>this.Au.handleCommand(t))),this.La.register(No,(t=>this.Eu.handleCommand(t))),this.La.register($o,(t=>{this._u.handleCommand(t,this.Ma.getRecordingContext())})),this.La.register(xo,((t,s)=>{this.Tu&&this.Su.handleCommand({...t,recordingStartTimestamp:this.Ma.getRecordingContext().recordingStartTimestamp},s)}))}onAfterNaturalPageView(){this.ou.setNaturalPageViewSent(!0),this.Au.flushPendingCallbacks(),this.Eu.executeRegisteredCallbacks(),this.Ru.sendAfterPageViewCallbackToChildren()}onAfterArtificialPageView(){this.Eu.executeRegisteredCallbacks(),this.Ru.sendAfterPageViewCallbackToChildren()}onCollectStateChange(){this.executeRecordingContextChangeCallbacks()}onRecordingContextChange(){this.executeRecordingContextChangeCallbacks()}executeRecordingContextChangeCallbacks(){this._u.executeCallbacks(this.Ma.getRecordingContext())}setRecordingService(t){this.Tu=t}}ne([po()],Mo.prototype,"executeRecordingContextChangeCallbacks",null);class Lo{constructor(t,s){this.key=csString.prototype.slice.call(t,0,512),this.value=m(s)?csString.prototype.slice.call(s,0,255):s}static isKeyValid(t){return m(t)}static isValueValid(t){return m(t)||v(t)}}class Do extends ei{constructor(t,s){super(),this.Iu=t,this.gt=s,this.Pu=[]}onStart(){csArray.prototype.forEach.call(this.Pu,(t=>this.trackDynamicVariable(t.key,t.value))),this.Pu=[]}onStop(){}trackDynamicVariable(t,s){if(this.isStarted)if(Lo.isKeyValid(t)&&Lo.isValueValid(s)){const e=this.gt.anonymizePII(t),i=v(s)?s:this.gt.anonymizePII(s);this.Iu.add(new Lo(e,i)),as.counters.commandApplied.count("dvars")}else as.counters.commandMisuse.count("dvars");else csArray.prototype.push.call(this.Pu,{key:t,value:s})}}class Uo{constructor(t){this.bu=t,this.Iu=[]}add(t){csArray.prototype.push.call(this.Iu,t),this.setBatchReadyCall()}clear(){this.Iu=[]}onBatchReady(t){this.Vu=t}getRequestParameters(){const t={};for(const s of this.Iu)t[s.key]=s.value;return{dv:this.bu.compressSync(csJSON.stringify(t),"base64"),ct:this.bu.algorithm}}setBatchReadyCall(){this.Vu()}}ne([po(),vt("dynamicVariablesBatchReady")],Uo.prototype,"setBatchReadyCall",null);const Fo=["trackDynamicVariable"];class Ho{constructor(t,s,e,i,n,r){this.La=t,this.Vt=s,this.wt=e,this.Ia=i,this.bu=n,this.gt=r,this.tt=new ns(this.wt.getTrackerUri(),"dvar"),this.Iu=new Uo(this.bu),this.Cu=new Do(this.Iu,this.gt)}init(){this.tt.setRequestParametersProviders(this.Ia,this.Iu),this.Vt.setDynamicVariablesService(this.Cu),this.Iu.onBatchReady((()=>this.tt.send())),this.tt.after((()=>this.Iu.clear())),this.La.register(Fo,(({key:t,value:s}={})=>{this.Cu.trackDynamicVariable(t,s)}))}onStartTracking(){this.Cu.start()}}class zo{constructor(t,s){this.id=t,this.revenue=s}static from(t){const s=new zo(t.id,parseFloat(t.revenue));return isNaN(parseFloat(t.tax))||(s.tax=parseFloat(t.tax)),isNaN(parseFloat(t.shipping))||(s.shipping=parseFloat(t.shipping)),m(t.currency)&&t.currency.length<=10&&(s.currency=t.currency),s}hasValidRevenue(){return!isNaN(this.revenue)&&this.revenue>=0}static isValid(t){return y(t)&&f(t.revenue)&&m(t.currency)&&t.currency.length<=10&&(!y(t.id)||m(t.id))}}class Bo{constructor(t,s,e,i){this.id=t,this.name=s,this.price=e,this.quantity=i}static from(t){if(!Bo.ku(t))return null;const s=new Bo(t.id,t.name,parseFloat(t.price),parseInt(t.quantity,10));return g(t.sku)&&(s.sku=t.sku),g(t.category)&&(s.category=t.category),g(t.merchant)&&t.merchant.length>0&&(s.merchant=t.merchant.slice(0,100)),s}static ku(t){return y(t)&&m(t.id)&&m(t.name)&&f(parseFloat(t.price))&&v(parseInt(t.quantity,10))&&(!g(t.sku)||m(t.sku))&&(!g(t.category)||m(t.category))&&(!g(t.merchant)||m(t.merchant))}}class qo extends ei{constructor(t,s,e){super(),this.gt=t,this.Nu=s,this.Ki=e,this.Ou=[],this.clear()}onStart(){csArray.prototype.forEach.call(this.Ou,(t=>{this.$u=t.transaction,this.xu=t.transactionItems,this.sendTransaction()})),this.Ou=[]}onStop(){}addTransaction(t){const s=this.gt.anonymizeFields(t,["id"]);this.$u=zo.from(s)}getTransaction(){return this.$u}sendTransaction(){if(!this.isStarted)return csArray.prototype.push.call(this.Ou,{transaction:this.$u,transactionItems:[...this.xu]}),void this.clear();null!==this.Nu&&null!==this.Ki&&(this.Ki.refreshSession(),this.Ki.isSessionValid()&&(this.$u.hasValidRevenue()?this.Nu.send():se.warn("Transaction Service: unable to send transaction with invalid parameters")))}addItem(t){if(E(t))return;const s=this.gt.anonymizeFields(t,["id","name","sku","category"]),e=Bo.from(s);null!==e&&csArray.prototype.push.call(this.xu,e)}getItems(){return this.xu}clear(){this.$u=zo.from({revenue:NaN}),this.xu=[]}getRequestParameters(){const t={id:this.$u.id?`${this.$u.id}`:"",revenue:`${this.$u.revenue}`};return g(this.$u.tax)&&(t.tax=`${this.$u.tax}`),g(this.$u.shipping)&&(t.shipping=`${this.$u.shipping}`),g(this.$u.currency)&&(t.cu=`${this.$u.currency}`),t.items=window.csJSON.stringify(this.xu),t}}class jo extends ei{constructor(t,s){super(),this.Mu=t,this.Ki=s,this.Lu=null,this.Du=[]}onStart(){csArray.prototype.forEach.call(this.Du,(t=>{this.Lu=t,this.Uu()})),this.Du=[]}onStop(){}addToCart(t){const s={};m(t.sku)&&(s.sku=csString.prototype.slice.call(t.sku,0,100)),m(t.merchant)&&(s.merchant=csString.prototype.slice.call(t.merchant,0,100)),(s.sku||s.merchant)&&(this.Lu=s,this.Uu())}getCartItem(){return this.Lu}Uu(){if(!this.isStarted&&null!==this.Lu)return csArray.prototype.push.call(this.Du,this.Lu),void this.clear();this.Ki.refreshSession(),this.Ki.isSessionValid()&&this.Mu.send()}clear(){this.Lu=null}getRequestParameters(){if(!this.Lu)return{};const t={};return m(this.Lu.sku)&&this.Lu.sku.length>0&&(t.sku=this.Lu.sku),m(this.Lu.merchant)&&this.Lu.merchant.length>0&&(t.me=this.Lu.merchant),t}}const Go=["ecommerce:addToCart","ec:cart:add"],Zo=["ecommerce:addTransaction","ec:transaction:create"],Wo=["ecommerce:addItem","ec:transaction:items:add"],Qo=["ecommerce:send","ec:transaction:send"];class Yo{constructor(t,s,e,i,n,r,o){this.wt=t,this.Sa=s,this.bt=e,this.La=i,this.gt=n,this.Ki=r,this.Ot=o}init(){const t=new ns(this.wt.getTrackerUri(),"transaction"),s=new ns(this.wt.getTrackerUri(),"addtocart");this.Fu=new qo(this.gt,t,this.Ki),this.Hu=new jo(s,this.Ki);const e=new Un(this.Sa,this.bt,this.Ot,this.Fu);t.setRequestParametersProviders(e),t.after((()=>{this.Fu.clear()}));const i=new Un(this.Sa,this.bt,this.Ot,this.Hu);s.setRequestParametersProviders(i),s.after((()=>{this.Hu.clear()})),this.La.register(Zo,(t=>{this.Fu.addTransaction(t)})),this.La.register(Wo,(t=>this.Fu.addItem(t))),this.La.register(Qo,(()=>this.Fu.sendTransaction())),this.La.register(Go,(t=>{this.Hu.addToCart(t)}))}onStartTracking(){this.Fu.start(),this.Hu.start()}}class Ko{constructor(t){this.zu=t.performance}getRequestParameters(){if(this.Bu())return{};const t=this.qu();return{str:t.startRender,di:t.domInteractive,dc:t.domComplete,fl:t.fullyLoaded}}qu(){const t=this.zu.timing;return{startRender:""+(t.domLoading-t.requestStart),domInteractive:""+(t.domInteractive-t.requestStart),domComplete:""+(t.domComplete-t.requestStart),fullyLoaded:""+(t.loadEventEnd-t.requestStart)}}Bu(){return!(this.zu&&this.zu.timing&&this.zu.timing.loadEventEnd>0)}}var Jo,Xo;function th(t){return void 0!==t.tgt}!function(t){t[t.RESIZE=0]="RESIZE",t[t.SCROLL=1]="SCROLL",t[t.MOUSEMOVE=2]="MOUSEMOVE",t[t.MOUSEDOWN=3]="MOUSEDOWN",t[t.MOUSEUP=4]="MOUSEUP",t[t.CLICK=5]="CLICK",t[t.MOUSEOVER=6]="MOUSEOVER",t[t.MOUSEOUT=7]="MOUSEOUT",t[t.CHANGE=10]="CHANGE",t[t.FOCUSIN=11]="FOCUSIN",t[t.FOCUSOUT=12]="FOCUSOUT",t[t.TAP=14]="TAP",t[t.KEYDOWN=15]="KEYDOWN",t[t.KEYUP=16]="KEYUP",t[t.COMMAND=17]="COMMAND",t[t.SUBMIT_COMMAND=18]="SUBMIT_COMMAND",t[t.PERFORMANCE=19]="PERFORMANCE",t[t.DRAG=20]="DRAG",t[t.FLICK=21]="FLICK",t[t.KEYBOARD_NAVIGATION=22]="KEYBOARD_NAVIGATION",t[t.ZOOM=23]="ZOOM",t[t.VIEWPORT_SCALE=24]="VIEWPORT_SCALE",t[t.TEXT_HIGHLIGHT=25]="TEXT_HIGHLIGHT",t[t.DEAD_CLICK=30]="DEAD_CLICK",t[t.DEAD_ZOOM=31]="DEAD_ZOOM",t[t.PAGE_RELOAD=32]="PAGE_RELOAD",t[t.THRASHED_CURSOR=33]="THRASHED_CURSOR",t[t.BLANK_PAGE=34]="BLANK_PAGE",t[t.EXTERNAL_EVENT=35]="EXTERNAL_EVENT",t[t.SUBMIT=36]="SUBMIT"}(Jo||(Jo={})),function(t){t.SUCCESS="success",t.FAILURE="failure",t.ATTEMPT="attempt"}(Xo||(Xo={}));class sh{static build(t,s,e){return csArray.prototype.reduce.call(e,((s,e)=>e.enhanceAnalysisEvent(t,s)),s)}}class eh{constructor(t,s,e){this.ju=t,this.Gu=s,this.Ho=e}processGesture(t,s){switch(t.type){case Vr.TAP:this.Zu(s);break;case Vr.FLICK:this.Wu(t,s);break;case Vr.DRAG:this.Qu(t,s)}}Zu(t){const s={type:Jo.TAP,ts:0,x:0,y:0,tgt:""},e=sh.build(t,s,this.ju);e.tgt!==zt.INVALID_ELEMENT&&this.ur(e)}Qu(t,s){var e,i;const n={type:Jo.DRAG,ts:0,fd:t.direction,tgt:""};(null===(e=this.Ho)||void 0===e?void 0:e.collectGestureDistance)&&(n.distance=t.distance),(null===(i=this.Ho)||void 0===i?void 0:i.collectGestureVelocity)&&(n.velocity=t.velocity);const r=sh.build(s,n,this.ju);r.tgt!==zt.INVALID_ELEMENT&&this.ur(r)}Wu(t,s){var e,i;const n={type:Jo.FLICK,ts:0,fd:t.direction,tgt:""};(null===(e=this.Ho)||void 0===e?void 0:e.collectGestureDistance)&&(n.distance=t.distance),(null===(i=this.Ho)||void 0===i?void 0:i.collectGestureVelocity)&&(n.velocity=t.velocity);const r=sh.build(s,n,this.ju);r.tgt!==zt.INVALID_ELEMENT&&this.ur(r)}onEvent(t){this.ur=t}start(){this.Gu.subscribe(eh.Yu,((t,s)=>this.processGesture(t,s)))}stop(){this.Gu.unsubscribe(eh.Yu)}}eh.Yu="AnalysisGestureTracker",ne([ie()],eh.prototype,"processGesture",null);class ih{constructor(t,s,e,i=["submit"]){this.ju=t,this.Ku=s,this.Ju=e,this.Xu=i,this.tl="select, select *, input, textarea",this.sl="select, select *, input, textarea",this.el="a, a *, button, button *, select, select *, input, textarea",this.il="input, select, textarea",this.nl="form",this.rl=150,this.ol=400,this.hl=!1,this.cl=mo(((t,s)=>this.scrollListener(t,s)),this.rl),this.al=mo((t=>this.resizeListener(t)),this.rl),this.ul=ke((t=>this.mouseMoveListener(t)),this.ol),this.ll=[{boundElement:window,type:"resize",listener:()=>this.al()},{boundElement:document,type:"scroll",listener:t=>this.cl(t)},{boundElement:window,type:"mousemove",listener:t=>{this.ul(function(t){return t.composedPath&&Object.defineProperty(t,"__csOriginalTarget",{value:t.composedPath()[0],writable:!1,enumerable:!1}),t}(t))}},{boundElement:document,type:"mousedown",listener:t=>this.mouseDownListener(t)},{boundElement:document,type:"mouseup",listener:t=>this.mouseUpListener(t)},{boundElement:document,type:"click",listener:t=>this.clickListener(t)}],this.dl=[{type:"change",listener:this.Ju.on(this.sl,(t=>this.changeListener(t)))},{type:"submit",listener:this.Ju.on(this.nl,(t=>this.submitListener(t)))}],this.vl=[{boundElement:document,type:"mouseover",listener:this.Ju.on(this.el,(t=>this.mouseOverListener(t)))},{boundElement:document,type:"mouseout",listener:this.Ju.on(this.el,(t=>this.mouseOutListener(t)))},{boundElement:document,type:"focusin",listener:this.Ju.on(this.tl,(t=>this.focusInListener(t)))},{boundElement:document,type:"focusout",listener:this.Ju.on(this.tl,(t=>this.focusOutListener(t)))},{boundElement:document,type:"keyup",listener:this.Ju.on(this.il,(t=>this.keyUpListener(t)))},{boundElement:document,type:"keydown",listener:this.Ju.on(this.il,(t=>this.keyDownListener(t)))},{boundElement:document,type:"copy",listener:this.Ju.on(this.il,(t=>this.copyListener(t)))},{boundElement:document,type:"cut",listener:this.Ju.on(this.il,(t=>this.cutListener(t)))},{boundElement:document,type:"paste",listener:this.Ju.on(this.il,(t=>this.pasteListener(t)))},...csArray.prototype.map.call(this.dl,(t=>({...t,boundElement:document})))],this.fe={},this.$e=(t,s)=>{switch(s){case"initial":case"added":this.ee(t);break;case"removed":this.ie(t)}},this.se=new Pe(this.$e),this.oe()}ee(t){if(M(t)){const t=this.ml();csArray.prototype.forEach.call(t,(t=>be(t)))}else{const s=this.pl();csArray.prototype.forEach.call(s,(s=>{be({...s,boundElement:t})}))}}ie(t){if(M(t)){const t=this.ml();csArray.prototype.forEach.call(t,(t=>Ve(t)))}else{const s=this.pl();csArray.prototype.forEach.call(s,(s=>{Ve({...s,boundElement:t})}))}}onEvent(t){this.ur=t}start(){this.se.observe(),this.ee(document),this.resizeListener()}stop(){this.ie(document),this.se.disconnect()}flushPendingDebouncedListeners(){this.cl.flushPending(),this.al.flushPending()}wl(t){return csArray.prototype.some.call(this.Xu,(s=>s===t))}pl(){return this.Ju.isMatchesSelectorSupported()?csArray.prototype.filter.call(this.dl,(t=>!this.wl(t.type))):(se.warn("Element.matches is not implemented yet"),[])}ml(){const t=[];return csArray.prototype.push.call(t,...this.ll),this.Ju.isMatchesSelectorSupported()?csArray.prototype.push.call(t,...this.vl):se.warn("Element.matches is not implemented yet"),csArray.prototype.filter.call(t,(t=>!this.wl(t.type)))}resizeListener(t){const s=He.getScrollContainer(),e=A(s);e&&(this.hl=!0);const i={type:Jo.RESIZE,ts:0,x:e?s.clientWidth:Vt.windowWidth(),y:e?s.clientHeight:Vt.windowHeight()};void 0!==t&&(i.d=t),this.ur(i)}scrollListener(t,s){const e=He.isEventOnScrollContainer(s);!this.hl&&e&&this.resizeListener();const i={type:Jo.SCROLL,ts:0,x:e?csEventtarget.apply(s).scrollLeft:Vt.windowOffsetX(),y:e?csEventtarget.apply(s).scrollTop:Vt.windowOffsetY(),d:t},n=sh.build(s,i,this.ju);this.ur(n)}mouseMoveListener(t){const s={type:Jo.MOUSEMOVE,ts:0,x:t.pageX,y:t.pageY},e=sh.build(t,s,this.ju);this.ur(e)}mouseDownListener(t){const s={type:Jo.MOUSEDOWN,ts:0,x:t.pageX,y:t.pageY,tgt:""},e=sh.build(t,s,this.ju);this.gl(e)}mouseUpListener(t){const s={type:Jo.MOUSEUP,ts:0,x:t.pageX,y:t.pageY,tgt:""},e=sh.build(t,s,this.ju);this.gl(e)}clickListener(t){const s={type:Jo.CLICK,ts:0,x:t.pageX,y:t.pageY,tgt:""},e=sh.build(t,s,this.ju);this.gl(e)}mouseOverListener(t){const s={type:Jo.MOUSEOVER,ts:0,x:t.pageX,y:t.pageY,tgt:""},e=sh.build(t,s,this.ju);this.gl(e)}mouseOutListener(t){const s={type:Jo.MOUSEOUT,ts:0,x:t.pageX,y:t.pageY,tgt:this.Ku.getEventTargetPath(t)},e=sh.build(t,s,this.ju);this.gl(e)}focusInListener(t){const s={type:Jo.FOCUSIN,ts:0,tgt:this.Ku.getEventTargetPath(t)},e=sh.build(t,s,this.ju);this.gl(e)}focusOutListener(t){const s={type:Jo.FOCUSOUT,ts:0,tgt:this.Ku.getEventTargetPath(t)},e=sh.build(t,s,this.ju);this.gl(e)}changeListener(t){const s={type:Jo.CHANGE,ts:0,tgt:""},e=sh.build(t,s,this.ju);this.gl(e)}submitListener(t){const s={type:Jo.SUBMIT,ts:0,tgt:""},e=sh.build(t,s,this.ju);this.gl(e)}copyListener(t){const s={type:Jo.COMMAND,ts:0,tgt:this.Ku.getEventTargetPath(t),key:Le.COPY};this.gl(s)}cutListener(t){const s={type:Jo.COMMAND,ts:0,tgt:this.Ku.getEventTargetPath(t),key:Le.CUT};this.gl(s)}pasteListener(t){const s={type:Jo.COMMAND,ts:0,tgt:this.Ku.getEventTargetPath(t),key:Le.PASTE};this.gl(s)}keyUpListener(t){const s={type:Jo.KEYUP,ts:0,tgt:this.Ku.getEventTargetPath(t),key:this.yl(t)};this.gl(s)}keyDownListener(t){const s={type:Jo.KEYDOWN,ts:0,tgt:this.Ku.getEventTargetPath(t),key:this.yl(t)};this.gl(s)}yl(t){const s=this.fe[t.key];return void 0===s?Me.ALPHANUMERICAL:s}gl(t){th(t)&&t.tgt!==zt.INVALID_ELEMENT&&this.ur(t)}oe(){this.fe[" "]=Me.SPACE,this.fe.Spacebar=Me.SPACE,this.fe.Enter=Me.ENTER,this.fe.Backspace=Me.BACKSPACE,this.fe.Delete=Me.DELETE,this.fe.ArrowUp=Me.ARROWUP,this.fe.ArrowDown=Me.ARROWDOWN,this.fe.ArrowLeft=Me.ARROWLEFT,this.fe.ArrowRight=Me.ARROWRIGHT,this.fe.Up=Me.ARROWUP,this.fe.Down=Me.ARROWDOWN,this.fe.Left=Me.ARROWLEFT,this.fe.Right=Me.ARROWRIGHT,this.fe.CapsLock=Me.CAPSLOCK,this.fe.Shift=Me.SHIFT,this.fe.Tab=Me.TAB}}ne([vt("Event handler type: resize")],ih.prototype,"resizeListener",null),ne([vt("Event handler type: scroll")],ih.prototype,"scrollListener",null),ne([vt("Event handler type: mouseMove"),ie()],ih.prototype,"mouseMoveListener",null),ne([vt("Event handler type: mouseDown"),ie()],ih.prototype,"mouseDownListener",null),ne([vt("Event handler type: mouseUp"),ie()],ih.prototype,"mouseUpListener",null),ne([vt("Event handler type: click"),ie()],ih.prototype,"clickListener",null),ne([vt("Event handler type: mouseOver"),ie()],ih.prototype,"mouseOverListener",null),ne([vt("Event handler type: mouseOut"),ie()],ih.prototype,"mouseOutListener",null),ne([vt("Event handler type: focusIn")],ih.prototype,"focusInListener",null),ne([vt("Event handler type: focusOut")],ih.prototype,"focusOutListener",null),ne([vt("Event handler type: change")],ih.prototype,"changeListener",null),ne([vt("Event handler type: submit"),ie()],ih.prototype,"submitListener",null),ne([vt("Event handler type: copy")],ih.prototype,"copyListener",null),ne([vt("Event handler type: cut")],ih.prototype,"cutListener",null),ne([vt("Event handler type: paste")],ih.prototype,"pasteListener",null),ne([vt("Event handler type: keyup")],ih.prototype,"keyUpListener",null),ne([vt("Event handler type: keydown")],ih.prototype,"keyDownListener",null);class nh{constructor(){this.El=100,this.Al=0,this._l=Vt.documentHeight(),this.Sl={boundElement:document,type:"scroll",listener:t=>this.maxScrollRateListener(t)},this.Al=this.Rl(He.getScrollContainer()).maxScrollRate}onEvent(t){this.ur=t}start(){be(this.Sl)}stop(){Ve(this.Sl)}reset(){const t=He.getScrollContainer(),{maxScrollRate:s,maxDocumentHeight:e}=this.Rl(t);this._l=e,this.Al=s,this.ur()}Rl(t){let s=0,e=0;if(null===t)e=Vt.documentHeight(),s=this.Tl(e);else{const i=this.Il(t);e=this.Pl(t,i),s=this.bl(t,i)}return{maxScrollRate:s,maxDocumentHeight:e}}maxScrollRateListener(t){let s=null;He.isEventOnScrollContainer(t)&&(s=csEventtarget.apply(t));const{maxScrollRate:e,maxDocumentHeight:i}=this.Rl(s);(e>this.Al||i>this._l)&&(this.Al=e,i>this._l&&(this._l=i),this.ur())}Tl(t){const s=Math.round(this.Vl()/t*100);return Math.min(s,this.El)}Vl(){const t=Vt.windowHeight();return Vt.windowOffsetY()+t}bl(t,s){const e=t.scrollTop+t.clientHeight+t.getBoundingClientRect().top+s,i=this.Pl(t,s),n=Math.round(e/i*100);return Math.min(n,this.El)}Il(t){const s=window.getComputedStyle(t).paddingTop||"0px";return parseInt(s,10)}Pl(t,s){return t.scrollHeight+t.getBoundingClientRect().top+s}getRequestParameters(){return{sr:`${this.Al}`,mdh:`${this._l}`}}}ne([vt("MaxScrollRate handler")],nh.prototype,"maxScrollRateListener",null);class rh{constructor(t,s,e,i,n,r,o,h,c,a,u,l,d,f,v,m,p,w,g,y,E){this.wt=t,this.Cl=s,this.Gu=e,this.kl=i,this.Nl=n,this.Ol=r,this.$l=o,this.xl=h,this.Ki=c,this.Is=a,this.Ml=u,this.Ll=l,this.In=d,this.nn=f,this.Dl=v,this.Ul=m,this.Fl=p,this.Hl=w,this.zl=g,this.Bl=y,this.ql=E,this.wn=new si,this.jl=!1}init(){var t,s,e,i,n,r,o;this.Cl.onEvent((t=>this.Sn(t))),this.Gu.onEvent((t=>this.Sn(t))),this.kl.onEvent((()=>{const t=this.kl.getRequestParameters();this.nn.setQueryParams(t),this.$l.setQueryParams(t)})),this.Ll.onEvent((t=>this.Gl(t))),this.Zl(),null===(t=this.Dl)||void 0===t||t.onEvent((t=>this.Sn(t))),null===(s=this.zl)||void 0===s||s.onEvent((t=>this.Sn(t))),null===(e=this.Ul)||void 0===e||e.onEvent((t=>this.Sn(t))),null===(i=this.Fl)||void 0===i||i.onEvent((t=>this.Sn(t))),this.Wl(),null===(n=this.Hl)||void 0===n||n.onEvent((t=>this.Gl(t))),null===(r=this.Bl)||void 0===r||r.onEvent((t=>this.Gl(t))),null===(o=this.ql)||void 0===o||o.onEvent((t=>this.Gl(t)))}Wl(){this.$l.onBeaconSuccess((()=>{this.Ol.clearEvents()})),this.$l.onBeaconFailure((t=>{this.Ql(t)}))}initStates(){const t=this.xl.getRequestParameters(),s=this.Nl.getRequestParameters(),e=this.kl.getRequestParameters();this.nn.setQueryParams(t),this.nn.setQueryParams(s),this.nn.setQueryParams(e),this.$l.setQueryParams(t),this.$l.setQueryParams(s),this.$l.setQueryParams(e),this.Yl()}clearStates(t){var s,e;this.Cl.flushPendingDebouncedListeners(),null===(s=this.Ul)||void 0===s||s.flushPendingKeyboardNavigationEvent(),null===(e=this.Fl)||void 0===e||e.flushPendingTextHighlightEvent(),t?(this.Kl(),this.sendLastMessageBeacon()):this.sendEvents(),this.kl.reset(),this.nn.removeQueryParams()}start(t){var s,e,i,n,r,o,h;t||null===(s=this.Hl)||void 0===s||s.start(),this.In.start(),this.Cl.start(),this.kl.start(),this.Gu.start(),null===(e=this.Dl)||void 0===e||e.start(),null===(i=this.Fl)||void 0===i||i.start(),t||this.Ll.start(),null===(n=this.Ul)||void 0===n||n.start(),null===(r=this.zl)||void 0===r||r.start(),null===(o=this.Bl)||void 0===o||o.start(),null===(h=this.ql)||void 0===h||h.start()}collectInitialEvents(){var t;null===(t=this.Dl)||void 0===t||t.collectInitialEvents()}onIframeAnalysisBrowserEvent(t){this.Gl(t)}onIframeAnalysisUserEvent(t){this.Sn(t)}onExternalEvent(t){this.On(t)}Gl(t){this.Ki.isCurrentPageviewValid()&&this.On(t)}Sn(t){this.Ki.refreshSession(),this.Ki.isSessionValid()&&this.On(t)}On(t){this.Ol.addEvent(this.Jl(t)),this.Ol.isFull()&&this.sendEvents(),this.wt.emitDebugEvents&&this.wn.emit("analysisEvent",{...t,typeName:Jo[t.type]})}Jl(t){return t.ts=this.Xl(),t}Kl(){this.$l.setQueryParams({hlm:"true"}),this.jl=!0}sendLastMessageBeacon(){this.$l.setQueryParams(this.Nl.getRequestParameters()),this.$l.send(this.Ol.stringifyEvents()),this.$l.removeQueryParams(["hlm"]),this.jl=!1}sendEvents(){this.Ol.isEmpty()||(this.nn.setQueryParams(this.xl.getRequestParameters()),this.nn.setQueryParams(this.Nl.getRequestParameters()),this.nn.send(this.Ol.getEvents()),this.Ol.clearEvents())}stop(){var t,s,e,i,n,r,o;this.In.stop(),this.Cl.stop(),this.kl.stop(),this.Gu.stop(),this.Ll.stop(),null===(t=this.Dl)||void 0===t||t.stop(),null===(s=this.Ul)||void 0===s||s.stop(),null===(e=this.Fl)||void 0===e||e.stop(),null===(i=this.zl)||void 0===i||i.stop(),this.Ol.empty(),null===(n=this.Hl)||void 0===n||n.stop(),null===(r=this.Bl)||void 0===r||r.stop(),null===(o=this.ql)||void 0===o||o.stop()}Yl(){this.td=bs.now()}Xl(){return bs.now()-this.td}Zl(){this.In.onEvent((t=>{var s,e;t!==Tn.Visible&&(null===(s=this.Ul)||void 0===s||s.flushPendingKeyboardNavigationEvent(),null===(e=this.Fl)||void 0===e||e.flushPendingTextHighlightEvent(),t===Tn.PagehideVisible?this.Kl():t===Tn.PagehideHidden?(this.Kl(),this.sendLastMessageBeacon()):this.Ol.isEmpty()&&!this.jl||this.sendLastMessageBeacon())}))}Ql(t){try{this.Ol.isEmpty()&&!this.jl||this.Is.save({requestParameters:t,events:this.Ol.getEvents()})}catch{}}pushSubmitCommandEvent(t,s){if(!function(t){return t===Xo.SUCCESS||t===Xo.FAILURE||t===Xo.ATTEMPT}(t))return void se.warn(`AnalysisEvents Service: invalid submit status: ${t}`);if(!A(s))return void se.warn(`AnalysisEvents Service: invalid element: ${s}`);const e={status:t,type:Jo.SUBMIT_COMMAND,ts:0,tgt:this.Ml.getElementPath(s)};e.tgt!==zt.INVALID_ELEMENT&&this.Gl(e)}}class oh{constructor(t,s){this.Is=t,this.nn=s,this.sd=()=>{"visible"===document.visibilityState&&this.nd()}}start(){this.nd(),this.Vi()}stop(){this.Oi()}getRecoveryStorage(){return this.Is}nd(){const t=this.Is.recover();if(null!==t){const{requestParameters:s,events:e}=t;this.nn.send(e,s)}}Vi(){document.addEventListener("visibilitychange",this.sd)}Oi(){document.removeEventListener("visibilitychange",this.sd)}}class hh{constructor(t){this.ro=t}save(t){localStorage.setItem(this.ro,csJSON.stringify(t))}clear(){localStorage.removeItem(this.ro)}recover(){const t=localStorage.getItem(this.ro);if(null===t)return null;let s=null;try{s=csJSON.parse(t)}catch{se.error(`Invalid item in localStorage.\n (key:${this.ro}; value:${t})`)}finally{this.clear()}return s}}class ch{constructor(t){this.rd=t,this.od=t=>this.processMetric(t),this.Ti=!1}onEvent(t){this.ur=t}start(){this.Ti||(this.Ti=!0,this.rd.onFCP(this.od),this.rd.onCLS(this.od),this.rd.onFID(this.od),this.rd.onLCP(this.od),this.rd.onTTFB(this.od),this.rd.onINP(this.od))}stop(){this.Ti=!1}processMetric(t){if(!this.Ti)return;const s={type:Jo.PERFORMANCE,name:t.name,val:t.value,ts:0};this.ur(s)}}ne([vt("Performance metric handler")],ch.prototype,"processMetric",null);var ah,uh,lh,dh,fh,vh=-1,mh=function(t){addEventListener("pageshow",(function(s){s.persisted&&(vh=s.timeStamp,t(s))}),!0)},ph=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},wh=function(){var t=ph();return t&&t.activationStart||0},gh=function(t,s){var e=ph(),i="navigate";return vh>=0?i="back-forward-cache":e&&(document.prerendering||wh()>0?i="prerender":document.wasDiscarded?i="restore":e.type&&(i=e.type.replace(/_/g,"-"))),{name:t,value:void 0===s?-1:s,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},yh=function(t,s,e){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var i=new PerformanceObserver((function(t){Promise.resolve().then((function(){s(t.getEntries())}))}));return i.observe(Object.assign({type:t,buffered:!0},e||{})),i}}catch(t){}},Eh=function(t,s,e,i){var n,r;return function(o){s.value>=0&&(o||i)&&((r=s.value-(n||0))||void 0===n)&&(n=s.value,s.delta=r,s.rating=function(t,s){return t>s[1]?"poor":t>s[0]?"needs-improvement":"good"}(s.value,e),t(s))}},Ah=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},_h=function(t){var s=function(s){"pagehide"!==s.type&&"hidden"!==document.visibilityState||t(s)};addEventListener("visibilitychange",s,!0),addEventListener("pagehide",s,!0)},Sh=function(t){var s=!1;return function(e){s||(t(e),s=!0)}},Rh=-1,Th=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Ih=function(t){"hidden"===document.visibilityState&&Rh>-1&&(Rh="visibilitychange"===t.type?t.timeStamp:0,bh())},Ph=function(){addEventListener("visibilitychange",Ih,!0),addEventListener("prerenderingchange",Ih,!0)},bh=function(){removeEventListener("visibilitychange",Ih,!0),removeEventListener("prerenderingchange",Ih,!0)},Vh=function(){return Rh<0&&(Rh=Th(),Ph(),mh((function(){setTimeout((function(){Rh=Th(),Ph()}),0)}))),{get firstHiddenTime(){return Rh}}},Ch=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},kh=[1800,3e3],Nh=function(t,s){s=s||{},Ch((function(){var e,i=Vh(),n=gh("FCP"),r=yh("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(r.disconnect(),t.startTime=0&&uh1e12?new Date:performance.now())-t.timeStamp;"pointerdown"==t.type?function(t,s){var e=function(){Mh(t,s),n()},i=function(){n()},n=function(){removeEventListener("pointerup",e,$h),removeEventListener("pointercancel",i,$h)};addEventListener("pointerup",e,$h),addEventListener("pointercancel",i,$h)}(s,t):Mh(s,t)}},Uh=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach((function(s){return t(s,Dh,$h)}))},Fh=[100,300],Hh=0,zh=1/0,Bh=0,qh=function(t){t.forEach((function(t){t.interactionId&&(zh=Math.min(zh,t.interactionId),Bh=Math.max(Bh,t.interactionId),Hh=Bh?(Bh-zh)/7+1:0)}))},jh=function(){return fh?Hh:performance.interactionCount||0},Gh=function(){"interactionCount"in performance||fh||(fh=yh("event",qh,{type:"event",buffered:!0,durationThreshold:0}))},Zh=[200,500],Wh=0,Qh=function(){return jh()-Wh},Yh=[],Kh={},Jh=function(t){var s=Yh[Yh.length-1],e=Kh[t.interactionId];if(e||Yh.length<10||t.duration>s.latency){if(e)e.entries.push(t),e.latency=Math.max(e.latency,t.duration);else{var i={id:t.interactionId,latency:t.duration,entries:[t]};Kh[i.id]=i,Yh.push(i)}Yh.sort((function(t,s){return s.latency-t.latency})),Yh.splice(10).forEach((function(t){delete Kh[t.id]}))}},Xh=[2500,4e3],tc={},sc=[800,1800],ec=function t(s){document.prerendering?Ch((function(){return t(s)})):"complete"!==document.readyState?addEventListener("load",(function(){return t(s)}),!0):setTimeout(s,0)},ic=function(t,s){s=s||{};var e=gh("TTFB"),i=Eh(t,e,sc,s.reportAllChanges);ec((function(){var n=ph();if(n){var r=n.responseStart;if(r<=0||r>performance.now())return;e.value=Math.max(r-wh(),0),e.entries=[n],i(!0),mh((function(){e=gh("TTFB",0),(i=Eh(t,e,sc,s.reportAllChanges))(!0)}))}}))};class nc{onFCP(t){Nh(t,{reportAllChanges:!0})}onCLS(t){!function(t,s){s=s||{},Nh(Sh((function(){var e,i=gh("CLS",0),n=0,r=[],o=function(t){t.forEach((function(t){if(!t.hadRecentInput){var s=r[0],e=r[r.length-1];n&&t.startTime-e.startTime<1e3&&t.startTime-s.startTime<5e3?(n+=t.value,r.push(t)):(n=t.value,r=[t])}})),n>i.value&&(i.value=n,i.entries=r,e())},h=yh("layout-shift",o);h&&(e=Eh(t,i,Oh,s.reportAllChanges),_h((function(){o(h.takeRecords()),e(!0)})),mh((function(){n=0,i=gh("CLS",0),e=Eh(t,i,Oh,s.reportAllChanges),Ah((function(){return e()}))})),setTimeout(e,0))})))}(t,{reportAllChanges:!0})}onFID(t){!function(t,s){s=s||{},Ch((function(){var e,i=Vh(),n=gh("FID"),r=function(t){t.startTime0&&(n.value=0,n.entries=[]),i(!0)})),mh((function(){Yh=[],Wh=jh(),n=gh("INP"),i=Eh(t,n,Zh,s.reportAllChanges)})))}))}(t,{reportAllChanges:!0})}}class rc{constructor(t=[]){this.we=t}stringifyEvents(){return csJSON.stringify(this.we)}addEvent(t){csArray.prototype.push.call(this.we,t)}eventsCount(){return this.we.length}clearEvents(){this.we=[]}empty(){this.clearEvents()}isFull(){return this.eventsCount()>=50}isEmpty(){return 0===this.we.length}getEvents(){return this.we}}class oc{isEventTypeSupported(t){return-1!==csArray.prototype.indexOf.call(this.supportedEventTypes,t)}enhanceAnalysisEvent(t,s){return this.isEventTypeSupported(s.type)?this.baseEnhanceAnalysisEvent(t,s):s}}class hc extends oc{constructor(){super(...arguments),this.supportedEventTypes=[Jo.CHANGE],this.ad=["text","email","number","search","tel","url","password"]}baseEnhanceAnalysisEvent(t,s){const e=De(t);return C(e)&&csArray.prototype.indexOf.call(this.ad,e.type)>=0&&(s.isBlank=""===e.value),s}}class cc extends oc{constructor(t){super(),this.Ku=t,this.supportedEventTypes=[Jo.MOUSEDOWN,Jo.MOUSEUP,Jo.CLICK,Jo.MOUSEOVER,Jo.TAP,Jo.DRAG,Jo.FLICK,Jo.SUBMIT,Jo.CHANGE]}baseEnhanceAnalysisEvent(t,s){return s.tgt||(s.tgt=this.Ku.getEventTargetPath(t)),s}}var ac,uc;!function(t){t.getRelativePosition=function(t){const s=De(t);if(!(s&&R(s)&&E(s.getBoundingClientRect)&&y(t.pageX)&&y(t.pageY)))return{xRel:-1,yRel:-1,valid:!1};const e=s.getBoundingClientRect();let i=t.pageX-e.left-Vt.windowOffsetX(),n=t.pageY-e.top-Vt.windowOffsetY();s!==document.documentElement&&(i+=s.scrollLeft,n+=s.scrollTop);const r=Math.max(s.scrollWidth,e.width),o=Math.max(s.scrollHeight,e.height);return{xRel:Math.round(i/r*65535),yRel:Math.round(n/o*65535),valid:!0}}}(ac||(ac={}));class lc extends oc{constructor(t,s){super(),this.J=t,this.Ku=s,this.supportedEventTypes=[Jo.MOUSEMOVE,Jo.CLICK],this.ud=""}baseEnhanceAnalysisEvent(t,s){const{valid:e,xRel:i,yRel:n}=ac.getRelativePosition(t);if(e){const e=this.Ku.getEventTargetPath(t);e!==zt.INVALID_ELEMENT&&(s.xRel=i,s.yRel=n,s.type===Jo.MOUSEMOVE&&(e!==this.ud||this.J.iframesTracking?(this.ud=e,s.tgtHM=e):s.tgtHM=""))}else s.type===Jo.MOUSEMOVE&&(this.ud="");return s}}!function(t){t[t.ANONYMIZED=0]="ANONYMIZED",t[t.CAPTURED=1]="CAPTURED",t[t.MASKED=2]="MASKED",t[t.ENCRYPTED=3]="ENCRYPTED"}(uc||(uc={}));class dc extends oc{constructor(t,s,e){super(),this.wt=t,this.ld=s,this.gt=e,this.supportedEventTypes=[Jo.TAP,Jo.CLICK]}dd(t){let s="";const e=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let i=e.nextNode();for(;i;){if(s+=i.textContent,this.ld.getElementSensitiveStatus(i.parentElement)!==uc.CAPTURED)return!0;if(csString.prototype.trim.call(s).length>=100)break;i=e.nextNode()}return!1}baseEnhanceAnalysisEvent(t,s){if(A(csEventtarget.apply(t))){const e=Qe(csEventtarget.apply(t),"button,a");if(e&&m(e.textContent)&&!this.dd(e)&&!this.gt.hasPII(e.textContent,this.wt.anonymizeDigits)){const t=Rn.truncate(csString.prototype.trim.call(e.textContent),100);t.length>0&&(s.text=t)}}return s}}const fc="v2/events",vc=["submit"];class mc{constructor(t,s,e,i,n,r,o,h,c,a,u,l){this.wt=t,this.Sa=s,this.bt=e,this.Ml=i,this.Ju=n,this.La=r,this.Ki=o,this.Gu=h,this.yu=c,this.Ba=a,this.vd=u,this.ld=l}init(){const t=new rc,s=this.Ba.create(`${this.wt.getTrackerUri()}/${fc}`,!0,"base64");this.md=this.pd(s),this.wd=this.gd(t,this.md.getRecoveryStorage(),s),this.wd.init(),this.vd.addListener(this.wd),this.yu.addListener(this.wd),this.La.register(vc,((t,s)=>{this.wd.pushSubmitCommandEvent(t,s)}))}onStartTracking(t){this.md.start(),this.wd.start(t)}onAfterNaturalPageView(){this.wd.initStates()}onAfterArtificialPageView(){this.wd.initStates(),this.wd.collectInitialEvents()}onArtificialPageViewEnd(){this.wd.clearStates(!0)}onBeforeSessionRenewal(){this.wd.clearStates(),this.wd.stop(),this.md.stop()}onOptout(){this.wd.stop(),this.md.stop()}gd(t,s,e){const i=new Ko(window),n=new nh,r=function(t,s,e){const i=[];return t.mouseMoveHeatmapEnabled&&csArray.prototype.push.call(i,new lc(t,s)),t.isClickedElementTextEnabled()&&csArray.prototype.push.call(i,new dc(t,e,new As)),csArray.prototype.push.call(i,new hc,new cc(s)),i}(this.wt,this.Ml,this.ld),o=[];this.wt.collectHierarchy||csArray.prototype.push.call(o,"submit");const h=new ih(r,this.Ml,this.Ju,o),c=function(t,s,e){const i=[];return t.isClickedElementTextEnabled()&&csArray.prototype.push.call(i,new dc(t,e,new As)),csArray.prototype.push.call(i,new cc(s)),i}(this.wt,this.Ml,this.ld),a=new eh(c,this.Gu),u=new ch(new nc),l=new xn;const d=new Gn(`${this.wt.getTrackerUri()}/${fc}`),f=new Un(this.Sa,this.bt);return new rh(this.wt,h,a,n,i,t,d,f,this.Ki,s,this.Ml,u,l,e,undefined,undefined,undefined,undefined,undefined,undefined,undefined)}pd(t){return new oh(new hh("csAnalysisEventsPersisted"),t)}}var pc;!function(t){t.Artificial="a",t.Renewal="r",t.Natural="n"}(pc||(pc={}));class wc extends ei{constructor(t,s,e,i,n){super(),this.ta=t,this.vd=s,this.yd=e,this.Ot=i,this.iu=n}init(){this.Ed()}onStart(t){t?this.Ad():this._d()}onStop(){}triggerArtificialPageView(t,s){this.isStarted?this.Sd(t,s):y(t)&&this.Ot.overridePath(t,s),this.isStarted||(this.vd.emitTargetingRulesArtificialPageview(this.Ot.getUrl()),this.Ot.cleanupOverrideLifespan())}_d(){this.iu.setPageViewType(pc.Natural),this.ta.emitBeforeNaturalPageView(),this.yd.send(),this.Ot.cleanupOverrideLifespan(),this.ta.emitAfterNaturalPageView()}Ad(){this.iu.setPageViewType(pc.Renewal),this.ta.emitBeforeNaturalPageView(),this.yd.send(),this.ta.emitAfterNaturalPageView()}Sd(t,s){this.iu.setPageViewType(pc.Artificial),this.ta.emitArtificialPageViewEnd(),y(t)&&this.Ot.overridePath(t,s),this.ta.emitBeforeArtificialPageView(),this.yd.send(),this.Ot.cleanupOverrideLifespan(),this.ta.emitAfterArtificialPageView()}Ed(){window.addEventListener("pageshow",(t=>{this.isStarted&&t.persisted&&this.Sd()}))}}const gc=window.navigator.language||window.navigator.userLanguage||window.navigator.browserLanguage||window.navigator.systemLanguage||"unknown";function yc(){return{la:gc}}class Ec{constructor(t,s){this.uh=t,this.Ua=s,this.Rd=!1}getRequestParameters(){return{dr:this.Td()}}addUrlMaskingPattern(t){this.Ua.addUrlMaskingPattern(t)}enableRemoveQueryString(){this.Rd=!0}disableRemoveQueryString(){this.Rd=!1}Td(){const t=this.Rd?this.uh.removeQueryString(this.Id()):this.Id();return this.uh.anonymizeUrl(t,this.Ua.getUrlMaskingPatterns())}Id(){let t="";try{t=window.top.document.referrer}catch(s){if(window.parent)try{t=window.parent.document.referrer}catch{t=""}}return""===t&&(t=document.referrer),"string"!=typeof t&&(t=""),t}}class Ac{constructor(t){this.Vt=t,this.Pd=this.bd()&&window.CSCurrentScript}Vd(){const t=window.CSCurrentScript;if(!t)return null;const s=window.performance.getEntriesByName(t.src,"resource")[0];return!s||this.Cd(s)?null:Math.round(s.responseEnd-s.fetchStart)}Cd(t){const s=t.transferSize;return void 0!==s?0===s||300===s||s{m(t)?this.Fd(s)?this.Ud.triggerArtificialPageView(t,s):this.Ud.triggerArtificialPageView(t):this.Ud.triggerArtificialPageView()})),this.La.register(Tc,((t,s)=>{m(t)&&(this.Fd(s)?this.Ot.overridePath(t,s):this.Ot.overridePath(t))})),this.La.register(Ic,((t,s)=>{m(t)&&(this.Fd(s)?this.Ot.overrideQuery(t,s):this.Ot.overrideQuery(t))})),this.La.register(Pc,(t=>{m(t)&&i.addUrlMaskingPattern(t)})),this.La.register(bc,(()=>i.enableRemoveQueryString())),this.La.register(Vc,(()=>i.disableRemoveQueryString()))}start(t){this.Ud.start(t)}onBeforeSessionRenewal(){this.Ud.stop()}Fd(t){return w(t)&&null!==t}}class kc{constructor(t){this.Ku=t}on(t,s){return e=>{this.Ku.hasValidEventTarget(e)&&this.Hd(e,t)&&s(e)}}Hd(t,s){const e=De(t);return G.call(e,s)}isMatchesSelectorSupported(){return!!G}}class Nc{constructor(){}onLoad(t){this.Vs=t}onLoadCallbackExecute(){this.Vs()}start(){const t=this.onLoadCallbackExecute.bind(this);this.zd(t)}zd(t){function s(){document.removeEventListener("DOMContentLoaded",s),window.removeEventListener("load",s),t()}"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?csSetTimeout(t):(document.addEventListener("DOMContentLoaded",s),window.addEventListener("load",s))}}ne([vt("onLoad")],Nc.prototype,"onLoadCallbackExecute",null);class Oc{constructor(t,s,e){this.wt=t,this.bt=s,this.Vt=e,this.td=bs.now()}resetStartTime(){this.td=bs.now()}getSessionData(){const{projectId:t}=this.wt,s=this.bt.getVisitor();null==s&&se.warn("Visitor is null. This happens when a snippet tries to get Session Data before the tag was initialized.");const{id:e,visitsCount:i}=null!=s?s:{},n=this.Vt.getSession();null===n&&se.warn("Session is null. This happens when a snippet tries to get Session Data before the tag was initialized.");const{pageNumber:r}=null!=n?n:{};return{projectId:t,userId:e,sessionNumber:i,pageNumber:r,relativeTimestamp:bs.now()-this.td}}}const $c=["clearSession"],xc=["extendSession"],Mc=["getSessionData"],Lc=["session:start:newVisitor"],Dc=["session:clear:visitor"];class Uc{constructor(t,s,e,i){this.wt=t,this.bt=s,this.Vt=e,this.La=i}init(){this.Bd=new Oc(this.wt,this.bt,this.Vt),this.La.register($c,(()=>this.Vt.removeSession())),this.La.register(xc,(()=>this.Vt.extendSessionPeriodically()),{disableApplyPending:!0}),this.La.register(Mc,(()=>this.Bd.getSessionData()),{disableApplyPending:!0}),this.La.register(Lc,(()=>this.bt.renewVisitor())),this.La.register(Dc,(()=>{this.bt.resetVisitor()}),{disableApplyImmediate:!0})}onBeforeNaturalPageView(){this.bt.createOrUpdateVisitor(),this.Vt.createOrUpdateSession()}onBeforeArtificialPageView(){this.Vt.abortQuotaServiceRequest(),this.bt.createOrUpdateVisitor(),this.Vt.createOrUpdateSession()}onAfterNaturalPageView(){this.Bd.resetStartTime()}onAfterArtificialPageView(){this.Bd.resetStartTime()}onOptout(){this.bt.removeVisitor(),this.Vt.removeSession()}onCollectStateChange(t,s){this.Vt.updateCollectState(t,s)}}class Fc{constructor(t,s){this.Vt=t,this.bt=s,this.qd=!1,this.jd=ke((()=>this.Vt.refreshSession()),3e4)}onSessionExpired(t){this.Gd=t}isSessionValid(){return!!this.qd||!!this.Vt.hasValidSession()&&(!this.Vt.pollCacheRefreshEvent()||!this.bt.isSessionRenewed())}isCurrentPageviewValid(){const t=this.Vt.hasValidSession();return this.Vt.pollCacheRefreshEvent(!1)?!this.bt.isSessionRenewed():t}refreshSession(){this.isSessionValid()?this.jd():this.Zd()&&(this.Wd=bs.now(),this.renewSession())}renewSession(){this.qd=!0,this.Gd(),this.qd=!1}Zd(){return!g(this.Wd)||bs.now()-this.Wd>6e4}}var Hc,zc;function Bc(t){return t.tagDeploymentMode===Hc.DualCollectionReview||t.tagDeploymentMode===Hc.DualCollection}!function(t){t.ContentSquare="CONTENTSQUARE",t.LoadedByClicktale="LOADED_BY_CLICKTALE",t.LoadClicktalePtc="LOAD_CLICKTALE_PTC",t.DualCollectionReview="DUAL_COLLECTION_REVIEW",t.DualCollection="DUAL_COLLECTION",t.ContentSquareTagClickTaleEndpoints="CONTENTSQUARE_TAG_CLICKTALE_ENDPOINTS"}(Hc||(Hc={})),function(t){t.isRecording=function(){return window.ClickTaleIsRecording&&window.ClickTaleIsRecording()},t.stopRecording=function(){window.ClickTaleStop&&window.ClickTaleStop()},t.triggerLogicalPageView=function(t){window.ClickTaleLogicalWithUploadPage&&window.ClickTaleLogicalWithUploadPage(t)},t.sendPageEvent=function(t){window.ClickTaleEvent&&window.ClickTaleEvent(t)},t.sendEventTriggerRecording=function(t){window.ClickTaleEventTrigger&&window.ClickTaleEventTrigger(t)}}(zc||(zc={}));const qc="RSA-OAEP",jc="AES-CTR";var Gc;!function(t){var s;let e,i=!1,r=null;const o="undefined"!=typeof TextEncoder?new TextEncoder:null;let h;function c(){var t,s;return null!=(null===(s=null===(t=n.self.crypto)||void 0===t?void 0:t.subtle)||void 0===s?void 0:s.encrypt)&&null!=n.self.CryptoKey}async function a(s){if(!c()||i)return null;await e;let n=bn(s);n.byteLength>190&&(n=n.slice(0,190));try{return Vn(await t.crypto.encrypt({name:qc},r,n))}catch{return null}}t.crypto=null===(s=n.crypto)||void 0===s?void 0:s.subtle,t.MAX_DIGEST_INPUT_SIZE=100,t.isKeyImported=function(){return!i},t.getCryptoKey=function(){return r},t.isSupported=c,t.importKey=async function(s){e=t.crypto.importKey("spki",Cn(s),{name:qc,hash:"SHA-256"},!1,["encrypt"]).catch((()=>(i=!0,null))),r=await e,e=void 0,r||ft.warn(`Fail to import public key '${s}'`)},t.asymmetricEncrypt=a,t.symmetricEncrypt=async function(s,e){if(!c()||i)return null;const n={counter:e.initializationVector,name:jc,length:64},r=o.encode(s);try{return Vn(await t.crypto.encrypt(n,e.cryptoKey,r))}catch{return null}},t.encryptSecret=async function(s){const e=await async function(s){var e;if(!c())return null;try{return null!==(e=(await t.crypto.exportKey("jwk",s)).k)&&void 0!==e?e:null}catch{return null}}(s);if(!e)throw new Error("Export secret failed");const i=await a(e);if(!i)throw new Error("Encrypt secret failed");return i},t.generateSymmetricKey=async function(){if(!c()||i)return null;try{return{cryptoKey:await t.crypto.generateKey({name:jc,length:128},!0,["encrypt","decrypt"]),initializationVector:n.crypto.getRandomValues(new Uint8Array(16))}}catch{return null}},t.setDigestSalt=function(t){h=t},t.digest=async function(s){s=csString.prototype.toLocaleLowerCase.call(csString.prototype.trim.call(s)),h&&(s=`${s}:${h}`);const e=o.encode(s);try{return kn(await t.crypto.digest("SHA-1",e))}catch{return null}},t.generateKeyPair=function(){return n.crypto.subtle.generateKey({name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!0,["encrypt","decrypt"])}}(Gc||(Gc={}));const Zc="@user-identifier@";class Wc extends ei{constructor(t,s,e,i){super(),this.wt=t,this.Qd=s,this.bu=e,this.vd=i,this.Yd=[],this.kn=[]}onStart(){csArray.prototype.forEach.call(this.Yd,(t=>this.trackPageEvent(t))),this.Yd=[],csArray.prototype.forEach.call(this.kn,(t=>this.trackEventTriggerRecording(t))),this.kn=[]}onStop(){}trackPageEvent(t){this.isStarted?Wc.Kd(t)&&(this.Jd(t)?Gc.isSupported()&&this.Xd(t):this.tf(t)):csArray.prototype.push.call(this.Yd,t)}Jd(t){return Zt(t,Zc)}async Xd(t){if(!this.wt.customHashIdEnabled)return;const s=csString.prototype.slice.call(t,17);if(s.length>Gc.MAX_DIGEST_INPUT_SIZE)return void se.warn("UserIdentifier event: invalid user identifier");const e=await Gc.digest(s);e?(this.sf={eventName:e,isETR:!1,isCustomHashId:!0},this.ef()):se.warn("Page event: unable to compute customHashId"),this.wt.encryptionEnabled&&this.vd.emitUserIdentifierEvent(s)}tf(t){this.vd.emitPageEvent(t),this.sf={eventName:t,isETR:!1,isCustomHashId:!1},this.ef(),this.wt.tagDeploymentMode===Hc.LoadClicktalePtc&&zc.sendPageEvent(t)}trackEventTriggerRecording(t){this.isStarted?Wc.Kd(t)&&(this.wt.malkaEtrEnabled?this.if(t):this.nf(t)):csArray.prototype.push.call(this.kn,t)}if(t){Zt(t,"@ETP@")?this.vd.emitEventTriggerRecording(t,pi.ETR_PAGE):this.vd.emitEventTriggerRecording(t,pi.ETR_SESSION),this.sf={eventName:t,isETR:!0,isCustomHashId:!1},this.ef()}nf(t){var s;(Bc(s=this.wt)||s.tagDeploymentMode===Hc.LoadClicktalePtc)&&(this.vd.emitEventTriggerRecording(t,pi.ETR_LEGACY),this.sf={eventName:t,isETR:!0,isCustomHashId:!1},this.ef(),this.wt.tagDeploymentMode===Hc.LoadClicktalePtc&&zc.sendEventTriggerRecording(t))}getRequestParameters(){return{value:this.bu.compressSync(this.sf.eventName,"base64"),ct:this.bu.algorithm,isETR:`${this.sf.isETR}`,isCustomHashId:`${this.sf.isCustomHashId}`}}ef(){this.Qd.send()}static Kd(t){return m(t)&&!!csString.prototype.trim.call(t)}}const Qc=["trackPageEvent"],Yc=["trackEventTriggerRecording"];class Kc{constructor(t,s,e,i,n){this.wt=t,this.La=s,this.bu=e,this.Ia=i,this.vd=n}init(){const t=new ns(this.wt.getTrackerUri(),"pageEvent");this.rf=new Wc(this.wt,t,this.bu,this.vd),t.setRequestParametersProviders(this.rf,this.Ia),this.La.register(Qc,(t=>{this.rf.trackPageEvent(t)})),this.La.register(Yc,(t=>{this.rf.trackEventTriggerRecording(t)}))}onStartTracking(){this.rf.start()}}class Jc{constructor(t){this.La=t}init(){this.hf(Jc.cf,Ms),this.hf(Jc.af,xs)}hf(t,s){this.La.register([t],((t,e)=>{m(t)&&(m(e)||_(e))&&se.error(e,`${s}${t}`)}))}}Jc.af="logSnippetError",Jc.cf="logImplementationSnippetError";class Xc{constructor(t,s,e,i,n){this.wt=t,this.pu=s,this.Ma=e,this.ld=i,this.yu=n}init(){this.pu.onChildMessage(((t,s,e)=>this.yu.emitIframeEvent(t,s,e))),this.pu.setSentiveStatusCallback((()=>this.ld.getSensitiveStatus())),this.pu.setRecordingContextCallback((()=>this.Ma.getRecordingContext()))}onStartTracking(){this.wt.iframesTracking&&this.pu.start()}onOptout(){this.wt.iframesTracking&&this.pu.stop()}onSensitiveStatusChange(){if(this.wt.iframesTracking){const t=this.ld.getSensitiveStatus();this.pu.onSensitiveStatusChange(t)}}onRecordingContextChange(){if(this.wt.iframesTracking){const t=this.Ma.getRecordingContext();this.pu.onRecordingContextChange(t)}}}class ta extends ei{constructor(t){super(),this.wt=t,this.uf=0,this.lf=new Map,this.df={boundElement:window,type:"message",listener:t=>this.ff(t)}}onChildMessage(t){this.vf=t}setRecordingContextCallback(t){this.mf=t}setSentiveStatusCallback(t){this.pf=t}onSensitiveStatusChange(t){const s=Ks.buildBaseMessage(Ys.SensitiveStatus,Qs.Parent,this.wt.projectId);s.content=t;const e=Ks.buildBaseMessage(Ys.SensitiveStatus,Qs.Parent,this.wt.projectId);e.content={...t,started:!1,useAnonymization:!0,capturedElementSelector:""},this.lf.forEach((t=>{if(t.port){const i=this.wf(t)?e:s;this.gf(t,i)}}))}onRecordingContextChange(t){const s=Ks.buildBaseMessage(Ys.RecordingContext,Qs.Parent,this.wt.projectId);s.content=t,this.lf.forEach((t=>{!this.wf(t)&&t.port&&this.gf(t,s)}))}sendToChildren(t,s){const e=Ks.buildBaseMessage(t,Qs.Parent,this.wt.projectId);e.content=s,this.yf(e)}onStart(){be(this.df,!1),this.Ef()}onStop(){this.Af(),Ve(this.df,!1),this._f()}Ef(){const t=this.Sf();this.Rf(t),csArray.prototype.forEach.call(t,(t=>{if(null===this.Tf(t)){const s={iframe:t};this.lf.set(this.uf,s),this.uf+=1}})),this.If()}Sf(){return csArray.prototype.filter.call(Ht.findAllElements("iframe"),(t=>this.Pf(t)))}Rf(t){this.lf.forEach(((s,e)=>{s.iframe&&-1===csArray.prototype.indexOf.call(t,s.iframe)&&this.bf(e,s)}))}bf(t,s){s.port&&Ks.closeChannelPort(s.port),this.lf.delete(t)}_f(){this.lf.forEach((t=>{t.port&&Ks.closeChannelPort(t.port)})),this.lf.clear()}Tf(t){let s=null;return this.lf.forEach(((e,i)=>{null===s&&e.iframe===t&&(s=i)})),s}Pf(t){return t.id!==r&&(!t.src||Ns(t.src,"about:")||qs(Bs(t.src),this.wt.hostnames))}yf(t){this.lf.forEach((s=>{this.gf(s,t)}))}gf(t,s){const e=s.type===Ys.SensitiveStatus||s.type===Ys.RecordingContext;!t.port||e&&!t.initialStatusSent||Ks.sendChannelMessage(t.port,s)}If(){this.lf.forEach(((t,s)=>{if(t.iframe.contentWindow){const e=this.Vf(s);Ks.sendPostMessage(t.iframe.contentWindow,"*",e)}}))}Af(){const t=this.Cf();this.lf.forEach((s=>{s.port?Ks.sendChannelMessage(s.port,t):s.iframe.contentWindow&&Ks.sendPostMessage(s.iframe.contentWindow,"*",t)}))}Vf(t){return Ks.buildBaseMessage(Ys.Discovery,Qs.Parent,this.wt.projectId,t)}Cf(){return Ks.buildBaseMessage(Ys.Stop,Qs.Parent,this.wt.projectId)}kf(t,s){const e=this.lf.get(t);void 0!==e?(e.port=s,e.port.onmessage=t=>{this.Nf(t,e)}):se.error(`Parent received channel messaging initialization from unknow child id : ${t} (${this.uf})`)}Of(t){if(!t.port)return;const s=Ks.buildBaseMessage(Ys.SensitiveStatus,Qs.Parent,this.wt.projectId),e=this.pf();this.wf(t)&&(e.started=!1,e.capturedElementSelector="",e.useAnonymization=!0),s.content=e,Ks.sendChannelMessage(t.port,s)}$f(t){if(!t.port)return;const s=Ks.buildBaseMessage(Ys.RecordingContext,Qs.Parent,this.wt.projectId),e=this.mf();this.wf(t)&&(e.isRecording=!1,e.isMutationTrackerStarted=!1),s.content=e,Ks.sendChannelMessage(t.port,s)}Nf(t,s){if(void 0===s)return void se.error(`Parent received channelMessage from unknown child : ${csJSON.stringify(t.data)}`);const e=t.data.type,i=t.data.content;e===Ys.EndOfBufferedMessages?(this.Of(s),this.$f(s),s.initialStatusSent=!0):this.vf(s.iframe,e,i)}ff(t){if(Ks.isMessageValid(t,Qs.Child,this.wt.projectId,this.wt.hostnames))switch(t.data.type){case Ys.Discovery:if(void 0===t.data.id)return void this.Ef();if(t.ports&&1===t.ports.length&&this.lf.has(t.data.id))return void this.kf(t.data.id,t.ports[0]);se.error(`Parent received wrong channelMessage initialization : (${t.origin}) : ${csJSON.stringify(t.data)}`);break;case Ys.ChildLogMessage:this.vf(null,Ys.ChildLogMessage,t.data.content);break;default:se.warn(`Parent received unexpected postMessage type from child (${t.origin}) : ${csJSON.stringify(t.data)}`)}}wf(t){return Ye.isMaskedElement(t.iframe)||Ye.isMaskedElementChild(t.iframe)}}class sa{constructor(){this.subscriptions={}}subscribe(t,s){this.subscriptions[t]=s,1===Object.keys(this.subscriptions).length&&this.onStartTracking()}unsubscribe(t){delete this.subscriptions[t],0===Object.keys(this.subscriptions).length&&this.onStopTracking()}}class ea extends sa{constructor(t){super(),this.xf=t,this.ar=[{boundElement:document,type:"touchstart",listener:t=>this.On(t)},{boundElement:document,type:"touchmove",listener:t=>this.On(t)},{boundElement:document,type:"touchend",listener:t=>this.On(t)}],this.Mf=new Qr,this.Mf.onGesture(((t,s)=>this.Bc(t,s)))}Bc(t,s){for(const e in this.subscriptions){(0,this.subscriptions[e])(t,s)}}onStartTracking(){this.canDetectGesture()&&csArray.prototype.forEach.call(this.ar,(t=>be(t)))}onStopTracking(){this.canDetectGesture()&&csArray.prototype.forEach.call(this.ar,(t=>Ve(t)))}canDetectGesture(){return"undefined"!=typeof devicePixelRatio}On(t){this.xf.tryToExecute("process gesture event",(()=>{if(this.Mf.isValidTouchEvent(t))switch(t.type){case"touchstart":this.Mf.processActionDown(t);break;case"touchmove":this.Mf.processActionMove();break;case"touchend":this.Mf.processActionUp(t)}}))()}static isSwipe(t){return t.type===Vr.FLICK||t.type===Vr.DRAG}}class ia extends ei{constructor(t,s){super(),this.nn=t,this.Lf=s,this.Df=0}onStart(){se.isPerfLoggingActive()&&(this.Uf=window.csSetInterval((()=>this.Ff()),ia.Hf))}onStop(){se.isPerfLoggingActive()&&(this.Ff(),csClearInterval(this.Uf))}Ff(){if(Et.isEmpty||this.Df>=ia.zf)return;this.Df++;const t={a:ia.Bf,l:ia.qf,...this.Lf.getRequestParameters()},s=[];Et.forEach((e=>{csArray.prototype.forEach.call(e,(e=>{csArray.prototype.push.call(s,{...e,...t})}))})),this.nn.send(s),Et.clear()}}ia.Bf="uxa",ia.qf="perf",ia.Hf=5e3,ia.zf=5;class na{constructor(t,s,e){this.wt=t,this.Lf=s,this.Ba=e}init(){this.jf=new ia(this.Ba.create(this.wt.getLoggerUri(),!0),this.Lf)}onStartTracking(){this.jf.start()}onOptout(){this.jf.stop()}}class ra{constructor(t){this.ld=t,this.Gf=!1}enableRecordingContext(t,s,e){this.Gf=!0,this.Tu=t,this.Vt=s,this.Ka=e}getRecordingContext(){var t,s,e,i;if(!this.Gf)return{isRecording:!1,recordingStartTimestamp:0,etrState:mi.ETR_OFF,etrStatus:wi.ETR_DISABLED,collectState:vi.ANALYTICS_ONLY};const n=this.Vt.getSession();return{isRecording:this.Tu.isRecording(),isMutationTrackerStarted:this.Tu.isStarted,useAnonymization:this.ld.getSensitiveStatus().useAnonymization,enableOnlineResources:null===(t=this.Tu.getStaticResourceManagerStatus())||void 0===t?void 0:t.onlineAssets.activated,enableOnlineResourcesOnNextPageview:null===(s=this.Tu.getStaticResourceManagerStatus())||void 0===s?void 0:s.onlineAssets.enabledOnNextPageview,recordingStartTimestamp:parseInt(this.Tu.getRecordingStartTimestamp(),10),etrState:null!==(e=null==n?void 0:n.etrState)&&void 0!==e?e:mi.ETR_OFF,etrStatus:this.Ka.getEtrStatus(n),collectState:null!==(i=null==n?void 0:n.collectState)&&void 0!==i?i:vi.ANALYTICS_ONLY}}}class oa{static isRecordingSupported(){return"MutationObserver"in window&&"visibilityState"in document}static isAsyncSerializationSupported(){return"Promise"in window&&"findIndex"in csArray.prototype}}class ha{constructor(){this.Zf=pc.Natural}setPageViewType(t){this.Zf=t}getPageViewType(){return this.Zf}getRequestParameters(){return{pvt:this.Zf}}}class ca{constructor(t){this.Ki=t}onAfterVisitorRenewal(){this.Ki.renewSession()}}var aa,ua;!function(t){t.replayRecordingUnmaskedUrlRegex="replayRecordingUnmaskedUrlRegex",t.replayRecordingMaskedUrlRegex="replayRecordingMaskedUrlRegex",t.replayRecordingUnmaskedUrlRegexRules="replayRecordingUnmaskedUrlRegexRules",t.replayRecordingMaskedUrlRegexRules="replayRecordingMaskedUrlRegexRules"}(aa||(aa={})),function(t){t.START="start",t.NOT_START="not-start",t.END="end",t.NOT_END="not-end",t.CONTAIN="contain",t.NOT_CONTAIN="not-contain",t.EXACT="exact",t.NOT_EXACT="not-exact"}(ua||(ua={}));class la{constructor(t,s,e,i){this.Md=t,this.wt=s,this.Ot=e,this.Wf=i}init(){this.Qf()}shouldMaskNonTextElements(){return this.wt.isSMB&&this.wt.anonymisationMethod===aa.replayRecordingMaskedUrlRegexRules&&this.shouldUseAnonymization()}shouldUseAnonymization(){if(this.Md.isReplayUnanonymizedAllowedByConsent()){switch(this.wt.anonymisationMethod){case null:case aa.replayRecordingMaskedUrlRegex:return!(!this.wt.replayRecordingMaskedUrlRegex||!this.wt.replayRecordingMaskedUrlRegex.test(this.Ot.getAnonymizedUrl()));case aa.replayRecordingMaskedUrlRegexRules:return this.Wf.evaluateUrl(this.Ot.getAnonymizedUrl())}return!1}switch(this.wt.anonymisationMethod){case null:case aa.replayRecordingUnmaskedUrlRegex:return!(this.wt.replayRecordingUnmaskedUrlRegex&&this.wt.replayRecordingUnmaskedUrlRegex.test(this.Ot.getAnonymizedUrl()));case aa.replayRecordingUnmaskedUrlRegexRules:return!this.Wf.evaluateUrl(this.Ot.getAnonymizedUrl())}return!0}Qf(){this.wt.anonymisationMethod===aa.replayRecordingMaskedUrlRegexRules&&this.wt.replayRecordingMaskedUrlRegexRules?this.Wf.setRegexRules(this.wt.replayRecordingMaskedUrlRegexRules):this.wt.anonymisationMethod===aa.replayRecordingUnmaskedUrlRegexRules&&this.wt.replayRecordingUnmaskedUrlRegexRules&&this.Wf.setRegexRules(this.wt.replayRecordingUnmaskedUrlRegexRules)}}class da{constructor(){this.Yf=[]}setRegexRules(t){this.Yf=csArray.prototype.map.call(t,(t=>this.Kf(t)))}evaluateUrl(t){return csArray.prototype.some.call(this.Yf,(s=>{var e,i;const n=this.Jf(t,s);return(null==s?void 0:s.notOperator)?!(null===(e=s.regex)||void 0===e?void 0:e.test(n)):null===(i=s.regex)||void 0===i?void 0:i.test(n)}))}Jf(t,s){const e=Gs(t);return e?s.ignoreQueryParams&&s.ignoreURIFragments?`${e.origin}${e.pathname}`:s.ignoreQueryParams?`${e.origin}${e.pathname}${e.hash}`:s.ignoreURIFragments?`${e.origin}${e.pathname}${e.search}`:t:t}Xf(t){return t.ignoreCaseSensitivity?"i":""}Kf(t){switch(t.operator){case ua.NOT_START:t.notOperator=!0;case ua.START:t.regex=new csRegExp(`^${t.value}`,this.Xf(t));break;case ua.NOT_END:t.notOperator=!0;case ua.END:t.regex=new csRegExp(`${t.value}$`,this.Xf(t));break;case ua.NOT_CONTAIN:t.notOperator=!0;case ua.CONTAIN:t.regex=new csRegExp(`${t.value}`,this.Xf(t));break;case ua.NOT_EXACT:t.notOperator=!0;case ua.EXACT:t.regex=new csRegExp(`^${t.value}$`,this.Xf(t));break;default:se.warn(`buildRegexWithRule, unknown type: ${t.operator}`)}return t}}class fa extends En{constructor(t){super(),this.xh=null,this.tv=null,this.Fs=null,this.Th=null,this.sv=["value","checked","src","data","alt"],this.ev={state:Ye.MaskedElementState.Child},this.iv=t=>{for(const s of t){if(Ye.isMaskedElement(s.target)||Ye.isMaskedElementChild(s.target))for(let t=0;t"added"===s&&this.lv(t)))),this.Fs.observe(),csSetTimeout(this.ov)}onStop(){var t,s,e;this.xh&&(this.rv(document),this.xh.disconnect()),null===(t=this.tv)||void 0===t||t.disconnect(),null===(s=this.Fs)||void 0===s||s.disconnect(),null===(e=this.Th)||void 0===e||e.disconnect()}cv(){return window.ResizeObserver?new ResizeObserver((t=>{csArray.prototype.forEach.call(t,(t=>{this.resizeObserverCallback(t)}))})):null}av(){return new $r((t=>{csArray.prototype.forEach.call(t,(t=>{this.fv(t)?this.nv(t):(this.vv(t),this.mv(t))}))}))}uv(t){return new $r((s=>{csArray.prototype.forEach.call(s,(s=>this.pv(s,t)))}))}resizeObserverCallback(t){const s=t.target.getBoundingClientRect(),e=Ye.getMaskedElementDetails(t.target);if(e.state!==Ye.MaskedElementState.Parent)return;if(s.width===e.width&&s.height===e.height)return;const i={state:Ye.MaskedElementState.Parent,width:s.width,height:s.height};Ye.setMaskedElementProperty(t.target,i),this.produceEvent({type:"ResizeMaskedElement",target:Ge(t.target),width:s.width,height:s.height})}mv(t){this.Th&&R(t)&&!N(t)&&this.Th.observe(t)}fv(t){const s=csNodeparentNode.apply(t);return s?Ye.isMaskedElement(s)||Ye.isMaskedElementChild(s):!!L(t)&&(Ye.isMaskedElement(t.host)||Ye.isMaskedElementChild(t.host))}lv(t){(Ye.isMaskedElement(t.host)||Ye.isMaskedElementChild(t.host))&&Ye.setMaskedElementProperty(t,this.ev)}rv(t){ct(t,NodeFilter.SHOW_ELEMENT).visitAll((t=>{Ye.unsetMaskedElementProperty(t)}))}vv(t){const s=t.getBoundingClientRect(),e={state:Ye.MaskedElementState.Parent,width:s.width,height:s.height};Ye.setMaskedElementProperty(t,e),this.wv(t),ct(t).visitAll((s=>s!=t&&Ye.setMaskedElementProperty(s,this.ev)))}nv(t){Ye.setMaskedElementProperty(t,this.ev),ct(t).visitAll((s=>s!=t&&Ye.setMaskedElementProperty(s,this.ev)))}wv(t){var s;const e=null!==(s=Be.getProperty(t,Ye.maskedAttributeProp))&&void 0!==s?s:{attributes:[]};for(let t=0;tcsString.prototype.indexOf.call(s.attrName,n)>-1&&G.call(t,s.selector)))&&csArray.prototype.push.call(i.attributes,n)}0!==i.attributes.length&&Ye.setMaskedAttributeProperty(t,i)}}gi([vt()],fa.prototype,"resizeObserverCallback",null);class va{constructor(){this.gv=0,this.Ti=!1,this.yv="data-cs-capture",this.Ev=t=>{for(const s of t){if(Qn.isWhitelistedElement(s.target))for(let t=0;t$t(t,(t=>this.Av(t))))));const t=this.Rv?`[${this.yv}], ${this.Rv}`:`[${this.yv}]`;this.xh.observe(t),this.Fs||(this.Fs=new rn(this.Ev,((t,s)=>"added"===s&&this.Tv(t)))),this.Fs.observe()}stop(){this.Ti&&(this.gv--,0===this.gv&&(this.Ti=!1,this.Iv()))}Iv(){this.xh&&(this._v(document),this.xh.disconnect()),this.Fs&&this.Fs.disconnect()}setWhitelistedElementsSelector(t){We(t)&&(this.Rv=t)}getWhitelistedElementsSelector(){return this.Rv}Av(t){ct(t).visitAll((t=>{Qn.whitelistElement(t)}))}Tv(t){Qn.isWhitelistedElement(t.host)&&Qn.whitelistElement(t)}_v(t){ct(t,NodeFilter.SHOW_ELEMENT).visitAll((t=>{Qn.removeWhitelistElement(t)}))}}class ma{constructor(t,s,e,i,n){this.qa=t,this.Pv=s,this.bv=e,this.Vv=i,this.en=n}getSensitiveStatus(){var t,s;return{started:this.bv.isStarted,useAnonymization:this.qa.shouldUseAnonymization(),capturedElementSelector:this.Vv.getWhitelistedElementsSelector(),maskedElementSettings:this.Pv.getMaskedElementSettings(null===(t=this.qa)||void 0===t?void 0:t.shouldMaskNonTextElements()),encryptionSelectors:null===(s=this.en)||void 0===s?void 0:s.getEncryptionSelectors()}}getElementSensitiveStatus(t){const s=this.bv.isStarted,e=this.qa.shouldUseAnonymization();return s?Ye.isMaskedElement(t)||Ye.isMaskedElementChild(t)?uc.MASKED:gr.shouldEncrypt(t)?uc.ENCRYPTED:e?Qn.isWhitelistedElement(t)?uc.CAPTURED:uc.ANONYMIZED:uc.CAPTURED:uc.ANONYMIZED}}const pa=["setEncryptionSelectors"],wa=["setPIISelectors"],ga=["setCapturedElementsSelector"];class ya{constructor(t,s,e,i,n,r,o){this.ta=t,this.La=s,this.Pv=e,this.bv=i,this.Vv=n,this.en=r,this.Cv=o}init(){var t,s;this.Cv&&this.en&&(null===(t=this.Cv)||void 0===t||t.addSelector(null===(s=this.en)||void 0===s?void 0:s.getEncryptionSelectors())),this.kv()}onStartTracking(t){this.bv.start(),this.ta.emitSensitiveStatusChange()}onBeforeArtificialPageView(){this.bv.stop(),this.ta.emitSensitiveStatusChange()}onAfterArtificialPageView(){this.bv.start(),this.ta.emitSensitiveStatusChange()}onBeforeSessionRenewal(){this.bv.stop(),this.ta.emitSensitiveStatusChange()}onOptout(){this.bv.stop(),this.ta.emitSensitiveStatusChange()}onReplayUnanonymizationConsentGranted(){this.ta.emitSensitiveStatusChange()}onReplayUnanonymizationConsentWithdrawn(){this.ta.emitSensitiveStatusChange()}kv(){this.La.register(wa,(t=>{this.Pv.setMaskedElementSettingsFromCommand(t),this.ta.emitSensitiveStatusChange()})),this.La.register(ga,(t=>{this.Vv.setWhitelistedElementsSelector(t),this.ta.emitSensitiveStatusChange()})),this.La.register(pa,(t=>{var s,e;null===(s=this.en)||void 0===s||s.setEncryptionSelectors(t),null===(e=this.Cv)||void 0===e||e.addSelector(t)}))}}class Ea extends ei{constructor(t,s,e,i,n){super(),this.Da=t,this.Pv=s,this.Vv=e,this.Cv=i,this.qa=n}onStart(){var t,s;this.Vv.start(),this.Da.setMaskedElementSettings(this.Pv.getMaskedElementSettings(null===(t=this.qa)||void 0===t?void 0:t.shouldMaskNonTextElements())),this.Da.startIdentifier(),null===(s=this.Cv)||void 0===s||s.start()}onStop(){var t;this.Vv.stop(),this.Da.stopIdentifier(),null===(t=this.Cv)||void 0===t||t.stop()}}var Aa,_a;!function(t){function s(t,s){const n=function(t,s){"date"!==t.rule_type||"less_than"!==t.match_operation&&"greater_than"!==t.match_operation||(s=(new csDate(s).valueOf()/1e3).toFixed(0));switch(t.match_operation){case"exact":switch(t.rule_type){case"string":return!!m(t.pattern)&&csString.prototype.toLowerCase.call(s)===csString.prototype.toLowerCase.call(t.pattern);case"boolean":return s===t.pattern||s===csString(t.pattern);case"number":return!!y(s)&&Number(s)===Number(t.pattern);default:return s===t.pattern}case"starts_with":return!!m(t.pattern)&&0===csString.prototype.indexOf.call(s,t.pattern);case"ends_with":return!!m(t.pattern)&&Os(s,t.pattern);case"contains":return!!m(t.pattern)&&-1!==csString.prototype.indexOf.call(s,t.pattern);case"regex":if(!m(t.pattern))return!1;try{return new csRegExp(t.pattern).test(s)}catch(t){return se.warn(`targeting.matchOperation.regex invalid ${null==t?void 0:t.message}`),!1}case"simple":return!!m(t.pattern)&&i(s)===i(t.pattern);case"greater_than":return Number(s)>Number(t.pattern);case"less_than":return Number(s)=r.getTime()}(t,s);case"unknown":return function(t){if(!y(t))return!0;if(m(t))return""===csString.prototype.trim.call(t);if(p(t))return!0===t;if(f(t))return 0!==t;return!1}(s);default:return se.warn(`targeting.matchOperation.regex not managed operation ${t.match_operation}`),!1}}(t,s);return t.negate?!n:n}function e(t,s){const e=new csDate,i=e.setDate(e.getDate()-Number(t.pattern)),n=new csDate(i);return new csDate(s).toDateString()===n.toDateString()}function i(t){const s=Gs(Ns(t,"http://")||Ns(t,"https://")?t:`https://${t}`);return null!==s?csString.prototype.replace.call(s.host,/^www./,""):t}t.isUrlMatching=function(t,e){for(const i of t)if(s(i,e))return!0;return!1},t.isMatching=function(t,e){if(m(e)){for(const i of t)if(s(i,e))return!0}else if(p(e))for(const i of t)if(s(i,csString(e)))return!0;return!1}}(Aa||(Aa={}));class Sa{constructor(){this.Nv=[],this.Ov=[]}setTargetingRules(t){for(const s of t)"url"===s.component?csArray.prototype.push.call(this.Nv,s):"trigger"===s.component&&csArray.prototype.push.call(this.Ov,s)}matchUrl(t){return Aa.isUrlMatching(this.Nv,t)}matchTrigger(t){return Aa.isMatching(this.Ov,t)}}class Ra extends ei{constructor(t,s,e){super(),this.$v=t,this.xv=s,this.Ot=e}init(){this.Mv=new Sa,this.$v&&this.Mv.setTargetingRules(this.$v)}onStart(){}checkInitialUrlTargetingRules(){const t=this.Ot.getAnonymizedUrl();this.Lv(t,"url")&&this.xv()}onStop(){}onTargetingRulesArtificialPageview(t){this.isStarted&&this.Lv(t,"url")&&this.xv()}onExternalEvent(t){this.isStarted&&this.Lv(t.name,"trigger")&&this.xv()}Lv(t,s){var e,i;return!("url"!==s||!m(t)||!(null===(e=this.Mv)||void 0===e?void 0:e.matchUrl(t)))||!("trigger"!==s||!(null===(i=this.Mv)||void 0===i?void 0:i.matchTrigger(t)))}}class Ta{constructor(t,s,e,i,n,r){this.$v=t,this.Dv=s,this.ta=e,this.Uv=i,this.vd=n,this.Ot=r}init(){this.Fv=new Ra(this.$v,this.Dv,this.Ot),this.vd.addListener(this.Fv),this.Fv.init()}start(){this.Fv.start()}stop(){this.Fv.stop()}checkInitialUrlTargetingRules(){this.Fv.checkInitialUrlTargetingRules()}emitTargetingCollectState(){const t=this.Uv.getInitialCollectState();t===vi.ANALYTICS_ONLY?this.ta.emitCollectStateChange(vi.ANALYTICS_ONLY_RULES_TARGETING,mi.ETR_OFF):t===vi.RECORDING_GLOBAL_SAMPLING&&this.ta.emitCollectStateChange(vi.RECORDING_RULES_TARGETING,mi.ETR_OFF)}}class Ia{constructor(t,s,e,i,n,r,o,h,c,a,u,l,d,f,v,m,p,w,g,y,E,A,_,S,R,T,I,P,b){this.Sa=t,this.bu=s,this.bt=e,this.Vt=i,this.ta=n,this.La=r,this.Hv=o,this.wt=h,this.zv=c,this.Bv=a,this.qv=u,this.Md=l,this.gt=d,this.Ml=f,this.uh=v,this.Ot=m,this.jv=p,this.vd=w,this.yu=g,this.Ms=y,this.Gv=E,this.za=A,this.Zv=_,this.zr=S,this.Ba=R,this.Wv=T,this.Qv=I,this.Uv=P,this.Pv=b,this.Yv=(t=!1)=>{const s=this.Vt.getSession();null===s?(this.Kv=new Ta(this.wt.recordTargetingRules,this.Jv,this.ta,this.Uv,this.vd,this.Ot),this.Kv.init(),this.Kv.start()):s.collectState!==vi.RECORDING_RULES_TARGETING&&s.collectState!==vi.ANALYTICS_ONLY_RULES_TARGETING||this.Jv(t)},this.Jv=(t=!1)=>{this.Xv.onLoad((()=>{var s,e;null===(s=this.Kv)||void 0===s||s.emitTargetingCollectState(),null===(e=this.Kv)||void 0===e||e.stop(),this.ta.emitStartTracking(t)})),this.tm(t)},this.tm=(t=!1)=>{this.Bv.isActive()||(this.Pv.init(),this.sm.start(t),this.Xv.start())},this.im=()=>{this.ta.emitBeforeSessionRenewal(),this.nm(!0),this.ta.emitAfterSessionRenewal()},this.rm=()=>{this.ta.emitBeforeSessionRenewal(),this.Uv.refreshQuota(),this.Uv.onQuotaReady((t=>{t!==vi.QUOTA_REACHED&&(this.nm(!0),this.ta.emitAfterSessionRenewal())}))}}start(){if(this.zv.init(),this.Bv.init(),this.Bv.isActive())return;let t,s,e,i,n,r,o,h,c,a,u,l,d,f,v,m,p;this.zr.schedule((()=>{u=new Fc(this.Vt,this.bt),f=new ca(u),a=new kc(this.Ml),l=new fa((()=>{})),v=new va;const w=new Ea(l,this.Pv,v,p,this.om());d=new ma(this.om(),this.Pv,w,v,m);const g=new ya(this.ta,this.La,this.Pv,w,v,m,p);g.init(),this.ta.addListener(g),t=new mc(this.wt,this.Sa,this.bt,this.Ml,a,this.La,u,new ea(se),this.yu,this.Ba,this.vd,d),s=new Ho(this.La,this.Vt,this.wt,this.Sa,this.bu,this.gt),c=new ra(d);const y=new ta(this.wt);h=new Xc(this.wt,y,c,d,this.yu),h.init();const E=new ha;e=new Mo(this.bt,this.Vt,this.La,this.yu,y,this.wt,E,c),i=new Yo(this.wt,this.Sa,this.bt,this.La,this.gt,u,this.Ot),this.sm=new Cc(this.wt,this.La,this.ta,this.Sa,this.bt,this.Vt,this.Md,this.Ms,this.uh,this.Ot,this.za,E,this.vd,this.Ld,undefined),this.hm=new Uc(this.wt,this.bt,this.Vt,this.La),n=new Kc(this.wt,this.La,this.bu,this.Sa,this.vd),r=new Jc(this.La),o=new na(this.wt,new $s(this.wt,this.gt),this.Ba),this.Xv=new Nc})),this.zr.schedule((()=>{this.qv.init()})),this.zr.schedule((()=>{e.init()})),this.zr.schedule((()=>{s.init()})),this.zr.schedule((()=>{i.init()})),this.zr.schedule((()=>{this.Gv.init()})),this.zr.schedule((()=>{this.sm.init()})),this.zr.schedule((()=>{this.hm.init()})),this.zr.schedule((()=>{n.init()})),this.zr.schedule((()=>{this.jv.init()})),this.zr.schedule((()=>{r.init()})),this.zr.schedule((()=>{o.init()})),this.zr.schedule((()=>{this.Zv.init()})),this.zr.schedule((()=>{this.ta.addListener(this.hm),this.ta.addListener(this.Hv),this.ta.addListener(t),this.ta.addListener(this.qv),this.ta.addListener(e),this.ta.addListener(i),this.ta.addListener(this.Gv),this.ta.addListener(this.sm),this.ta.addListener(n),this.ta.addListener(s),this.ta.addListener(h),this.ta.addListener(o),this.ta.addListener(f)})),oa.isRecordingSupported()&&this.zr.schedule((()=>{const t=new So(c,this.Vt,this.wt,this.Sa,this.La,this.gt,u,l,this.Ji,this.Xi,this.tn,this.Ua,this.ta,this.vd,this.yu,this.za,this.Ba,this.uh,this.dn,this.om(),this.am,m);t.init(),this.ta.addListener(t),e.setRecordingService(t.recordingService)})),this.zr.schedule((()=>{t.init()})),this.zr.schedule((()=>{this.wt.isQuotaEnabled()?u.onSessionExpired((()=>{this.rm()})):u.onSessionExpired((()=>{this.im()})),this.nm()}))}nm(t=!1){if(this.wt.hasTargetingRules())return this.Yv(t),this.La.start(),void(this.Kv&&this.Kv.checkInitialUrlTargetingRules());this.La.start(),this.Xv.onLoad((()=>{this.ta.emitStartTracking(t)})),Bc(this.wt)&&!t||this.tm(t)}om(){if(this.qa)return this.qa;const t=new da;return this.qa=new la(this.Md,this.wt,this.Ot,t),this.qa.init(),this.qa.shouldUseAnonymization()&&as.counters.pageAnonymisation.count("anonymized-on-start"),this.qa}}class Pa{constructor(t,s,e,i,n,r,o,h){this.wt=t,this.bt=s,this.xs=e,this.um=i,this.lm=n,this.dm=r,this.fm=o,this.vm=h}compute(t){var s,e;this.wt.crossDomainTracking&&!this.wt.cookielessTrackingEnabled?this.wt.crossDomainSingleIframeTracking?null===(s=this.fm)||void 0===s||s.start((()=>this.pm(t))):null===(e=this.dm)||void 0===e||e.applyUpToDate((()=>this.pm(t))):this.pm(t)}pm(t){this.lm.handle(),this.um.clear(),this.wm()?(this.um.restoreClearedVisitor(),t(!0)):(this.xs.exclude(this.wt),t(!1))}wm(){const t=Qt.boolean(this.wt.sampleRate);return this.vm.isForceIncluded()||!this.xs.isExcluded()&&this.bt.doesVisitorExist()||!this.xs.isExcluded()&&t}}!function(t){t.generate=function(){const t=navigator.userAgent+navigator.language+navigator.platform,s=csString.prototype.slice.call(function(t){let s=0;for(let e=0;e{const s=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?s:7&s|8).toString(16)}));return csString.prototype.replace.call(i,"hhhh",s)}}(_a||(_a={}));class ba{constructor(t,s,e,i){this.wt=t,this.gm=s,this.ta=e,this.Vt=i,this.ym=1e4}createOrUpdateVisitor(){var t;let s=this.getVisitor();null===s&&(s=this.Em(),null===(t=this.Vt)||void 0===t||t.removeSession()),this.Am(s),this.setVisitor(s)}Em(){return{id:_a.generate(),visitsCount:0,appliedTrackingDraw:this.wt.lastTrackingDraw,creationTimestamp:Vs(),lastVisitTimestamp:0,hitTimestamp:0,expires:bs.now()+this.wt.visitorCookieTimeout,allowSubdomains:this.wt.allowSubdomains,identityPrint:null}}Am(t){const s=Vs();this.Vt&&!this.Vt.doesSessionExist()&&(t.visitsCount+=1,t.lastVisitTimestamp=s),t.hitTimestamp=s,t.appliedTrackingDraw=this.wt.lastTrackingDraw,this._m=t.visitsCount}getRequestParameters(){const t=this.getVisitor();return t?{uu:t.id,sn:`${t.visitsCount}`,hd:`${t.hitTimestamp}`}:{}}getVisitor(){return this.gm.get()}setVisitor(t){this.gm.set(t)}doesVisitorExist(){return null!==this.gm.get()}resetVisitor(){this.Sm(),this.ta.emitAfterVisitorCleared()}removeVisitor(){this.gm.remove()}hasAllowSubdomainsChanged(){const t=this.getVisitor();if(!t)return!1;return t.allowSubdomains!==this.wt.allowSubdomains}handleSubdomainChange(){this.gm.handleSubdomainChange()}isSessionRenewed(){const t=this.getVisitor();return null!==t&&void 0!==this._m&&t.visitsCount!==this._m}Rm(){return!g(this.Tm)||bs.now()-this.Tm>this.ym}renewVisitor(){this.Rm()?(this.Tm=bs.now(),this.Sm(),this.ta.emitAfterVisitorRenewal()):se.warn("session:start:newVisitor is trying to renew visitor under time limit")}Sm(){this.ta.emitBeforeVisitorRenewal(),this.removeVisitor()}}const Va="_cs_s",Ca=18e5,ka=/^(\d+\.[01356789TBWX](\.[01UNWG])?(\.[39])?)(\.\d+)?$/,Na=".";var Oa;!function(t){t[t.NOT_FOUND=0]="NOT_FOUND",t[t.EXPIRED=1]="EXPIRED",t[t.FOUND=2]="FOUND"}(Oa||(Oa={}));class $a{constructor(t,s,e){this.wt=t,this.Wv=s,this.Im=e,this.mo=null,this.Pm=!1}get(t){const s=this.getRawSession(t);return this.isValid(s)?$a.fromString(s):null}getRawSession(t){if(t){const t=this.bm();return $a.Vm(t)}const{sessionString:s,status:e}=this.Cm(),i=$a.Vm(s);if(e!==Oa.EXPIRED)return i;if(this.wt.cookielessTrackingEnabled)return null;const n=this.bm();if(!n)return null;const r=csString.prototype.split.call(n,Na);if(!$a.km(r))return n;const o=r[r.length-1],h=parseInt(o,10);return isNaN(h)||this.Nm(h),i}onCookieToSet(t){this.Om=t}onCookieToRemove(t){this.$m=t}set(t,s=18e5){var e;const i=bs.now()+s;let n=this.toString(t);n+=`${Na}${i}`,this.xm(n,i),this.wt.cookielessTrackingEnabled?this.Im.setItem(Va,n):(this.Wv.set(Va,n,s),null===(e=this.Om)||void 0===e||e.call(this,Va,n,s))}remove(){var t;this.wt.cookielessTrackingEnabled?this.Im.removeItem(Va):(this.Wv.delete(Va),null===(t=this.$m)||void 0===t||t.call(this,Va)),this.Mm()}handleSubdomainChange(){if(this.wt.cookielessTrackingEnabled)return;const t=this.get(!0);t&&(this.wt.allowSubdomains?this.Wv.delete(Va,ae.CURRENT_DOMAIN):this.Wv.delete(Va,this.Wv.getRootDomain()),this.set(t))}isValid(t){return null!==t&&$a.isValidSessionString(t)}toString(t){return csArray.prototype.join.call([t.pageNumber,t.collectState,t.etrState,t.etrStatus],Na)}xm(t,s){this.mo={sessionString:t,expires:s}}Cm(){return this.mo?this.mo&&bs.now()<=this.mo.expires?{sessionString:this.mo.sessionString,status:Oa.FOUND}:{sessionString:this.mo.sessionString,status:Oa.EXPIRED}:{sessionString:this.bm(),status:Oa.NOT_FOUND}}Mm(){this.mo=null}Nm(t){this.mo&&(this.mo.expires=t,this.Pm=!0)}isCacheRefreshed(){return this.Pm}resetCacheRefreshed(){this.Pm=!1}bm(){if(this.wt.cookielessTrackingEnabled){const t=this.Im.getItem(Va);return!t||this.Lm(t)?null:t}const t=this.Wv.get(Va);return!t||this.Lm(t)?null:t}Lm(t){const s=csString.prototype.split.call(t,Na);if(!$a.km(s))return!1;const e=parseInt(s[s.length-1],10);return!isNaN(e)&&bs.now()>e}static km(t){return 13===t[t.length-1].length}static Vm(t){var s;if(!t)return null;const e=null===(s=csString.prototype.match.call(t,ka))||void 0===s?void 0:s[1];return null!=e?e:null}static fromRawString(t){const s=$a.Vm(t);return null!==s?$a.fromString(s):null}static fromString(t){var s,e;const[i,n,r,o]=csString.prototype.split.call(t,Na);return{collectState:n,etrState:null!==(s=r)&&void 0!==s?s:mi.ETR_OFF,etrStatus:null!==(e=o)&&void 0!==e?e:wi.ETR_NOT_SAVED_SESSION,pageNumber:parseInt(i,10)}}static isValidSessionString(t){return ka.test(t)}}var xa;!function(t){t[t.NO=0]="NO",t[t.WITHDRAWN=1]="WITHDRAWN",t[t.GRANTED=2]="GRANTED"}(xa||(xa={}));class Ma{constructor(t,s){this.Dm=t,this.Uv=s,this.Um=null,this.Fm=0,this.Hm=xa.NO}setDynamicVariablesService(t){this.zm=t}createOrUpdateSession(){this.Bm(),this.qm=bs.now(),this.Fm=0;let t=this.jm();null===t?(t=this.Gm(),this.Zm(t),this.Wm(t)):(t=this.Uv.sanitizeSessionCollectState(t),this.Zm(t),t.collectState=this.Uv.getEligibleCollectState(t)),this.setSession(t)}grantReplayRecording(t){t.collectState=this.Uv.getInitialCollectState(),t.collectState=this.Uv.computeInitialCollectStateFromRecordingConsentGranted(t),this.setSession(t)}grantReplayRecordingBeforeSessionStart(){this.Hm=xa.GRANTED}withdrawnReplayRecording(t){t.collectState=this.Uv.getRecordingConsentWithdrawn(),this.setSession(t)}withdrawnReplayRecordingBeforeSessionStart(){this.Hm=xa.WITHDRAWN}Wm(t){this.Hm===xa.WITHDRAWN?(t.collectState=this.Uv.getRecordingConsentWithdrawn(),this.setSession(t)):this.Hm===xa.GRANTED?t.collectState=this.Uv.computeInitialCollectStateFromRecordingConsentGranted(t):t.collectState=this.Uv.computeInitialCollectState(t),this.Hm=xa.NO}Gm(){return{pageNumber:0,collectState:this.Uv.getInitialCollectState(),etrState:mi.ETR_OFF,etrStatus:wi.ETR_NOT_SAVED_SESSION}}Zm(t){t.pageNumber+=1}isReplayRecorded(){const t=this.getSession();return!!t&&this.Uv.isReplayRecorded(t)}isTemporarilyRecorded(){const t=this.getSession();return(null==t?void 0:t.collectState)===vi.RECORDING_TEMPORARILY}abortQuotaServiceRequest(){this.Uv.abortQuotaServiceRequest()}getRequestParameters(){const t={},s=this.getSession();return null!==s&&(t.pn=`${s.pageNumber}`),t}getSession(){return this.Dm.get()}jm(){return this.Dm.get(!0)}doesSessionExist(){return null!==this.Dm.get()}setSession(t){this.Dm.set(t)}refreshSession(){const t=this.jm();t&&this.setSession(t)}removeSession(){this.Dm.remove()}getCollectStates(){const t=this.getSession(),s=[];return t&&(t.collectState!==vi.ANALYTICS_ONLY&&csArray.prototype.push.call(s,t.collectState===vi.RECORDING_RULES_TARGETING?vi.RECORDING_GLOBAL_SAMPLING:t.collectState),t.etrState===mi.ETR_ON&&csArray.prototype.push.call(s,vi.RECORDING_ETR_SAMPLING)),s}updateCollectState(t,s){const e=this.getSession();null!==e&&(e.collectState=t,e.etrState=s,this.setSession(e))}hasValidSession(){const t=this.Dm.getRawSession();return this.Dm.isValid(t)}handleSubdomainChange(){this.Dm.handleSubdomainChange()}pollCacheRefreshEvent(t=!0){const s=this.Dm.isCacheRefreshed();return s&&t&&this.Dm.resetCacheRefreshed(),s}extendSessionPeriodically(){this.Um||this.Qm()}extendSession(){const t=this.getSession();return null===t?(se.warn("extendSession is trying to extend an expired session"),this.Bm(),!1):(this.Dm.set(t,Ca),!0)}Qm(){if(this.Ym())return void this.Bm();this.extendSession()&&(this.Km(),this.Jm())}Jm(){this.Um=window.csSetTimeout((()=>{this.Qm()}),174e4)}Ym(){return 1434e4-(bs.now()+Ca-this.qm)<0}Bm(){this.Um&&(window.csClearTimeout(this.Um),this.Um=null)}Km(){this.Fm+=1,this.zm.trackDynamicVariable("session_expiry_update",this.Fm)}}class La{constructor(t,s,e){this.wt=t,this.bt=s,this.xs=e}clear(){this.Xm()&&(this.tp=this.bt.getVisitor(),this.bt.removeVisitor()),this.sp()&&this.xs.removeExclusion()}Xm(){return this.bt.doesVisitorExist()&&this.bt.getVisitor().appliedTrackingDraw!==this.wt.lastTrackingDraw}sp(){return this.xs.getAppliedTrackingDraw()!==this.wt.lastTrackingDraw}restoreClearedVisitor(){this.tp&&this.bt.setVisitor(this.tp)}}class Da{constructor(t,s,e){this.bt=t,this.Vt=s,this.ep=e}handle(){this.bt.hasAllowSubdomainsChanged()&&(this.bt.handleSubdomainChange(),this.Vt.handleSubdomainChange(),this.ep.handleSubdomainChange())}}const Ua="_cs_c";var Fa;!function(t){t[t.NOT_REQUIRED=0]="NOT_REQUIRED",t[t.NOT_EXPRESSED=1]="NOT_EXPRESSED",t[t.GRANTED=2]="GRANTED",t[t.WITHDRAWN=3]="WITHDRAWN"}(Fa||(Fa={}));class Ha{constructor(t,s,e){this.wt=t,this.Wv=s,this.Qv=e}get(){let t;return t=this.wt.cookielessTrackingEnabled?this.Qv.getItem(Ua):this.Wv.get(Ua),null===t?t:Number(t)}set(t){this.wt.cookielessTrackingEnabled?this.Qv.setItem(Ua,csString(t)):this.Wv.set(Ua,csString(t),Wt)}remove(){this.wt.cookielessTrackingEnabled?this.Qv.removeItem(Ua):this.Wv.delete(Ua)}handleSubdomainChange(){this.wt.cookielessTrackingEnabled||(this.wt.allowSubdomains?this.Wv.delete(Ua,ae.CURRENT_DOMAIN):this.Wv.delete(Ua,this.Wv.getRootDomain()))}}class za{constructor(t,s,e){this.wt=t,this.Vt=s,this.ta=e}grantReplayConsent(){if(!To.isReplayConsentNeeded(this.wt))return;const t=this.Vt.getSession();t?To.isRecordingBlockedByConsent(t)&&(this.Vt.grantReplayRecording(t),this.ta.emitAfterReplayRecordingConsentGranted()):this.Vt.grantReplayRecordingBeforeSessionStart()}withdrawReplayConsent(){if(!To.isReplayConsentNeeded(this.wt))return;const t=this.Vt.getSession();t?To.isRecordingWithDrawn(t)||(this.Vt.withdrawnReplayRecording(t),this.ta.emitAfterReplayRecordingConsentWithdrawn()):this.Vt.withdrawnReplayRecordingBeforeSessionStart()}}const Ba=["replay:consent:unanonymized:granted","trackConsentGranted"],qa=["replay:consent:unanonymized:withdrawn","trackConsentWithdrawn"],ja=["replay:consent:startForSession:granted"],Ga=["replay:consent:startForSession:withdrawn"];class Za{constructor(t,s,e,i,n){this.wt=t,this.La=s,this.Md=e,this.Vt=i,this.ta=n}init(){this.ip=new za(this.wt,this.Vt,this.ta),this.Md.setInitialConsent(),this.kv()}kv(){this.La.register(Ba,(()=>{this.Md.grantReplayAnonymizationConsent()})),this.La.register(qa,(()=>{this.Md.withdrawReplayAnonymizationConsent()})),this.La.register(ja,(()=>{this.ip.grantReplayConsent()})),this.La.register(Ga,(()=>{this.ip.withdrawReplayConsent()}))}onOptout(){this.Md.removeAllConsents()}onBeforeVisitorRenewal(){this.Md.removeAllConsents()}onAfterVisitorRenewal(){this.Md.setInitialConsent()}onAfterVisitorCleared(){this.Md.setInitialConsent()}}class Wa{constructor(t,s,e){this.wt=t,this.gm=s,this.ta=e}setInitialConsent(){const t=this.gm.get();(null===t||this.hasConsentRequiredChanged(t))&&this.setDefaultReplayAnonymization()}hasConsentRequiredChanged(t){const s=this.wt.consentRequired;return s&&t===Fa.NOT_REQUIRED||!s&&t!==Fa.NOT_REQUIRED}handleSubdomainChange(){this.gm.handleSubdomainChange()}setDefaultReplayAnonymization(){const t=this.wt.consentRequired?Fa.NOT_EXPRESSED:Fa.NOT_REQUIRED;this.gm.set(t)}grantReplayAnonymizationConsent(){this.wt.consentRequired&&(this.gm.set(Fa.GRANTED),this.ta.emitReplayUnanonymizationConsentGranted())}withdrawReplayAnonymizationConsent(){this.wt.consentRequired&&(this.gm.set(Fa.WITHDRAWN),this.ta.emitReplayUnanonymizationConsentWithdrawn())}removeAllConsents(){this.gm.remove()}isReplayUnanonymizedAllowedByConsent(){return!this.wt.consentRequired||this.gm.get()===Fa.GRANTED}getRequestParameters(){return{uc:`${this.gm.get()}`}}}class Qa{constructor(t,s,e,i,n,r,o){this.ta=t,this.La=s,this.Hv=e,this.zv=i,this.Bv=n,this.np=r,this.qv=o}start(){this.ta.addListener(this.np),this.ta.addListener(this.qv),this.ta.addListener(this.Hv),this.qv.init(),this.zv.init(),this.Bv.init(),this.Bv.isActive()||this.La.start()}}const Ya="_cs_ex",Ka=2592e6,Ja=/^[0-9]+$/;class Xa{constructor(t,s,e){this.wt=t,this.Wv=s,this.Im=e}onCookieToSet(t){this.Om=t}onCookieToRemove(t){this.$m=t}get(){return this.wt.cookielessTrackingEnabled?Number(this.Im.getItem(Ya)):Number(this.Wv.get(Ya))}set(t){var s;this.wt.cookielessTrackingEnabled?this.Im.setItem(Ya,t):(this.Wv.set(Ya,t,Ka),null===(s=this.Om)||void 0===s||s.call(this,Ya,t,Ka))}remove(){var t;this.wt.cookielessTrackingEnabled?this.Im.removeItem(Ya):(this.Wv.delete(Ya),null===(t=this.$m)||void 0===t||t.call(this,Ya))}static isValidExclusionString(t){return Ja.test(t)}}class tu{constructor(t,s){this.cr=t,this.gm=s}exclude(t){this.gm.set(csString(t.lastTrackingDraw))}removeExclusion(){this.gm.remove()}isExcluded(){return this.rp()||this.op()}rp(){return 0!==this.getAppliedTrackingDraw()}getAppliedTrackingDraw(){return this.gm.get()}op(){return csString.prototype.indexOf.call(this.cr.href,Ya)>0}}class su{constructor(t){this.Cu=t}onOptout(){this.Cu.removeExclusion()}}var eu;!function(t){t.SessionReplay="SR",t.None=""}(eu||(eu={}));class iu{constructor(t){this.Ot=t,this.hp=new csRegExp(".^")}setExcludeUrlForSessionReplay(t){try{this.hp=new csRegExp(t)}catch{se.warn(`excludeURLforReplay - invalid regex '${t}'`),this.hp=new csRegExp(".*")}}cp(){return this.hp.test(this.Ot.getAnonymizedUrl())?eu.SessionReplay:eu.None}isUrlExcludedForSessionReplay(){return this.cp()===eu.SessionReplay}getRequestParameters(){return{ex:this.cp()}}}const nu=["excludeURLforReplay"];class ru{constructor(t,s){this.Cu=t,this.La=s}init(){this.La.register(nu,(t=>{m(t)&&this.Cu.setExcludeUrlForSessionReplay(t)}))}}const ou="_cs_inc";class hu{constructor(t,s){this.cr=t,this.Wv=s}isForceIncluded(){return this.ap()||this.up()}isForceReplayRecorded(){return this.lp(vi.RECORDING_GLOBAL_SAMPLING)}ap(){return null!==this.Wv.get(ou)}lp(t){return this.Wv.get(ou)===t}up(){return csString.prototype.indexOf.call(this.cr.href,ou)>0}}const cu="_cs_optout";class au{constructor(t,s,e){this.wt=t,this.Wv=s,this.Qv=e}get(){return this.wt.cookielessTrackingEnabled?this.Qv.getItem(cu):this.Wv.get(cu)}set(t){this.wt.cookielessTrackingEnabled?this.Qv.setItem(cu,t):this.Wv.set(cu,t,Wt)}}class uu{constructor(t,s,e){this.ta=t,this.cr=s,this.gm=e}init(){!this.isActive()&&this.dp()&&this.activate()}isActive(){return"1"===this.gm.get()}activate(){this.ta.emitOptout(),this.gm.set("1")}dp(){return csString.prototype.indexOf.call(this.cr.href,cu)>0}}const lu=["optout"];class du{constructor(t,s){this.La=t,this.Bv=s}init(){this.La.register(lu,(()=>{this.Bv.activate()}))}}class fu{constructor(t,s){this.La=t,this.yu=s}init(){this.yu.addListener(this.La)}onOptout(){this.La.stop()}onBeforeSessionRenewal(){this.La.stop()}}var vu,mu;!function(t){t.UXA="_uxa",t.WVT="cs_wvt"}(vu||(vu={}));class pu extends ei{constructor(t){super(),this.fp=t,this.vp={}}register(t,s,e){for(const i of t)this.vp[i]={callback:s,configuration:e},this.vp}onStart(){this.mp(),this.pp()}onStop(){for(const t of this.fp)window[t]=[]}applyFromIntegration(t,s,e){this.wp(t,s,`Commands.apply.from.integration: ${e}`),as.counters.commandsFromIntegrations.count(t)}applyFromImplementation(t,s,e){this.wp(t,s,`Commands.apply.from.implementation: ${e}`),as.counters.commandsFromCSTC.count(t)}onIframeCommands(t){for(const s of t.commands)this.gp(s.name,s.params,t.iframePath),as.counters.commandsFromIframe.count(s.name)}wp(t,s,e){this.isStarted?se.tryToExecute(e,(()=>{if(this.vp[t])return this.vp[t].callback(...s)}))():window._uxa.push([t,...s])}gp(t,s,e){se.tryToExecute(`Commands.apply.from.iframe: ${e}`,(()=>{if(this.vp[t])return this.vp[t].callback(...s)}))()}mp(){for(const t of this.fp)window[t].forEach((([t,...s])=>this.yp(t,s,!1)))}pp(){for(const t of this.fp)window[t]={push:([t,...s])=>this.yp(t,s,!0)}}yp(t,s,e){var i,n;if(this.vp[t]){if((null===(i=this.vp[t].configuration)||void 0===i?void 0:i.disableApplyPending)&&!e||(null===(n=this.vp[t].configuration)||void 0===n?void 0:n.disableApplyImmediate)&&e)return;try{return this.vp[t].callback(...s)}catch(e){as.counters.commandError.count(t),se.error(`Command ${t} failed - params: ${csJSON.stringify(s)}`,e)}}}}class wu{constructor(t,s,e,i){this.wt=t,this.bt=s,this.Vt=e,this.Ep=i}getRequestParameters(){var t,s,e,i,n;const r={...Ss(),...this.wt.getRequestParameters()},o=this.Vt.getSession();o&&(r.pn=`${o.pageNumber}`);const h=this.bt.getVisitor();if(h&&(r.sn=`${h.visitsCount}`,r.uu=`${h.id}`),(null===(t=this.Ep)||void 0===t?void 0:t.hasSubProjectId())&&(r.subProjectID=`${this.Ep.getSubProjectId()}`),window.heap)try{r.happid=window.heap.appid,r.hsid=null===(e=(s=window.heap).getSessionId)||void 0===e?void 0:e.call(s),r.huu=(null===(n=(i=window.heap).getUserId)||void 0===n?void 0:n.call(i))||window.heap.userId}catch{delete r.happid,delete r.hsid,delete r.huu}return r}}class gu{constructor(t,s){this.La=t,this.J=s}init(){this.La.register(["debugEvents"],(t=>{"boolean"==typeof t&&this.J.updateDynamicFields("emitDebugEvents",t)}))}}function yu(t,s,e){if(!g(s)&&!g(e))return t.href;const i=g(s)?Eu(s):t.pathname,n=g(e)?Au(e):t.search;return`${t.protocol}//${t.host}${i}${n}`}function Eu(t){return Zt(t,"/")?t:`/${t}`}function Au(t){return Zt(t,"?")||""===t?t:`?${t}`}!function(t){t[t.page=1]="page",t[t.onNextPageviewOnly=2]="onNextPageviewOnly"}(mu||(mu={}));class _u{constructor(t,s){this.cr=t,this.uh=s,this.Ap=10}overridePath(t,s){if(""===t)return void(this._p=void 0);const e=this.Sp(s);e&&(this.Rp=e),this._p=s?this.Tp(t,s):t}overrideQuery(t,s){const e=this.Sp(s);e&&(this.Ip=e),this.Pp=s?this.Tp(t,s):t}computeOverriddenUrl(t){return this.bp(t)?this.getAnonymizedUrl():t}Vp(t){return("string"==typeof t||"number"==typeof t)&&t in mu}bp(t){const s=this.Cp(this.cr.href);return this.Cp(t)===s}Cp(t){return s=t,e="/",-1!==csString.prototype.indexOf.call(s,e,s.length-e.length)?csString.prototype.slice.call(t,0,-1):t;var s,e}Sp(t){return g(null==t?void 0:t.lifespan)&&this.Vp(null==t?void 0:t.lifespan)?null==t?void 0:t.lifespan:null}kp(){return this.Rp&&this.Rp in mu}Np(){return this.Ip&&this.Ip in mu}cleanupOverrideLifespan(){this.kp()&&(this._p=void 0,this.Rp=void 0),this.Np()&&(this.Pp=void 0,this.Ip=void 0)}getAnonymizedUrl(){const t=yu(this.cr,this._p,this.Pp);return this.uh.anonymizeUrl(t)}getUrl(){return yu(this.cr,this._p,this.Pp)}getAnonymizedPathAndQuery(){const t=g(this._p)?Eu(this._p):this.cr.pathname,s=g(this.Pp)?Au(this.Pp):this.cr.search;return this.uh.anonymizeUrl(t+s)}getUrlProtocol(){return this.cr.protocol}getRequestParameters(){return{url:this.getAnonymizedUrl()}}Tp(t,s){return this.Op(s)?this.$p(t):this.xp(s)?this.Mp(t):t}xp(t){return Boolean(t.decodeURI)}Mp(t){return this.Lp(t,1,!1)}Op(t){return Boolean(t.decodeURIDeep)}$p(t){return this.Lp(t,this.Ap,!0)}Lp(t,s,e){let i=t;for(let t=0;t{var n;const r=e.toString(),o=`${null===(n=s.constructor)||void 0===n?void 0:n.name}.${r}`,h=i.value;(function(t,s){var e;if(null==t)return!1;return t===s||!!(null===(e=csString.prototype.match.call(t,new csRegExp("(^|,)("+s+")(,|$)")))||void 0===e?void 0:e.length)})(bu.getString("debugLog"),t)&&(i.value=function(...t){return console.log(o,...t),h.bind(this)(...t)})}}}function Vu(){function t(t){let s=t.length;for(;--s>=0;)t[s]=0}const s=256,e=286,i=30,n=15,r=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),o=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),c=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=new Array(576);t(a);const u=new Array(60);t(u);const l=new Array(512);t(l);const d=new Array(256);t(d);const f=new Array(29);t(f);const v=new Array(i);function m(t,s,e,i,n){this.static_tree=t,this.extra_bits=s,this.extra_base=e,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let p,w,g;function y(t,s){this.dyn_tree=t,this.max_code=0,this.stat_desc=s}t(v);const E=t=>t<256?l[t]:l[256+(t>>>7)],A=(t,s)=>{t.pending_buf[t.pending++]=255&s,t.pending_buf[t.pending++]=s>>>8&255},_=(t,s,e)=>{t.bi_valid>16-e?(t.bi_buf|=s<>16-t.bi_valid,t.bi_valid+=e-16):(t.bi_buf|=s<{_(t,e[2*s],e[2*s+1])},R=(t,s)=>{let e=0;do{e|=1&t,t>>>=1,e<<=1}while(--s>0);return e>>>1},T=(t,s,e)=>{const i=new Array(16);let r,o,h=0;for(r=1;r<=n;r++)i[r]=h=h+e[r-1]<<1;for(o=0;o<=s;o++){let s=t[2*o+1];0!==s&&(t[2*o]=R(i[s]++,s))}},I=t=>{let s;for(s=0;s{t.bi_valid>8?A(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},b=(t,s,e,i)=>{const n=2*s,r=2*e;return t[n]{const i=t.heap[e];let n=e<<1;for(;n<=t.heap_len&&(n{let n,h,c,a,u=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*u]<<8|t.pending_buf[t.d_buf+2*u+1],h=t.pending_buf[t.l_buf+u],u++,0===n?S(t,h,e):(c=d[h],S(t,c+s+1,e),a=r[c],0!==a&&(h-=f[c],_(t,h,a)),n--,c=E(n),S(t,c,i),a=o[c],0!==a&&(n-=v[c],_(t,n,a)))}while(u{const e=s.dyn_tree,i=s.stat_desc.static_tree,r=s.stat_desc.has_stree,o=s.stat_desc.elems;let h,c,a,u=-1;for(t.heap_len=0,t.heap_max=573,h=0;h>1;h>=1;h--)V(t,e,h);a=o;do{h=t.heap[1],t.heap[1]=t.heap[t.heap_len--],V(t,e,1),c=t.heap[1],t.heap[--t.heap_max]=h,t.heap[--t.heap_max]=c,e[2*a]=e[2*h]+e[2*c],t.depth[a]=(t.depth[h]>=t.depth[c]?t.depth[h]:t.depth[c])+1,e[2*h+1]=e[2*c+1]=a,t.heap[1]=a++,V(t,e,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,s)=>{const e=s.dyn_tree,i=s.max_code,r=s.stat_desc.static_tree,o=s.stat_desc.has_stree,h=s.stat_desc.extra_bits,c=s.stat_desc.extra_base,a=s.stat_desc.max_length;let u,l,d,f,v,m,p=0;for(f=0;f<=n;f++)t.bl_count[f]=0;for(e[2*t.heap[t.heap_max]+1]=0,u=t.heap_max+1;u<573;u++)l=t.heap[u],f=e[2*e[2*l+1]+1]+1,f>a&&(f=a,p++),e[2*l+1]=f,l>i||(t.bl_count[f]++,v=0,l>=c&&(v=h[l-c]),m=e[2*l],t.opt_len+=m*(f+v),o&&(t.static_len+=m*(r[2*l+1]+v)));if(0!==p){do{for(f=a-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[a]--,p-=2}while(p>0);for(f=a;0!==f;f--)for(l=t.bl_count[f];0!==l;)d=t.heap[--u],d>i||(e[2*d+1]!==f&&(t.opt_len+=(f-e[2*d+1])*e[2*d],e[2*d+1]=f),l--)}})(t,s),T(e,u,t.bl_count)},N=(t,s,e)=>{let i,n,r=-1,o=s[1],h=0,c=7,a=4;for(0===o&&(c=138,a=3),s[2*(e+1)+1]=65535,i=0;i<=e;i++)n=o,o=s[2*(i+1)+1],++h{let i,n,r=-1,o=s[1],h=0,c=7,a=4;for(0===o&&(c=138,a=3),i=0;i<=e;i++)if(n=o,o=s[2*(i+1)+1],!(++h{_(t,0+(i?1:0),3),((t,s,e,i)=>{P(t),i&&(A(t,e),A(t,~e)),t.pending_buf.set(t.window.subarray(s,s+e),t.pending),t.pending+=e})(t,s,e,!0)};var M=t=>{$||((()=>{let t,s,c,y,E;const A=new Array(16);for(c=0,y=0;y<28;y++)for(f[y]=c,t=0;t<1<>=7;y{let r,o,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e{let s;for(N(t,t.dyn_ltree,t.l_desc.max_code),N(t,t.dyn_dtree,t.d_desc.max_code),k(t,t.bl_desc),s=18;s>=3&&0===t.bl_tree[2*c[s]+1];s--);return t.opt_len+=3*(s+1)+5+5+4,s})(t),r=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=r&&(r=o)):r=o=i+5,i+4<=r&&-1!==e?x(t,e,i,n):4===t.strategy||o===r?(_(t,2+(n?1:0),3),C(t,a,u)):(_(t,4+(n?1:0),3),((t,s,e,i)=>{let n;for(_(t,s-257,5),_(t,e-1,5),_(t,i-4,4),n=0;n(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(d[i]+s+1)]++,t.dyn_dtree[2*E(e)]++),t.last_lit===t.lit_bufsize-1),U=t=>{_(t,2,3),S(t,256,a),(t=>{16===t.bi_valid?(A(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)},F={_tr_init:M,_tr_stored_block:x,_tr_flush_block:L,_tr_tally:D,_tr_align:U};var H=(t,s,e,i)=>{let n=65535&t,r=t>>>16&65535,o=0;for(;0!==e;){o=e>2e3?2e3:e,e-=o;do{n=n+s[i++]|0,r=r+n|0}while(--o);n%=65521,r%=65521}return n|r<<16};const z=new Uint32Array((()=>{let t,s=[];for(var e=0;e<256;e++){t=e;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;s[e]=t}return s})());var B=(t,s,e,i)=>{const n=z,r=i+e;t^=-1;for(let e=i;e>>8^n[255&(t^s[e])];return~t},q={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:G,_tr_stored_block:Z,_tr_flush_block:W,_tr_tally:Q,_tr_align:Y}=F,{Z_NO_FLUSH:K,Z_PARTIAL_FLUSH:J,Z_FULL_FLUSH:X,Z_FINISH:tt,Z_BLOCK:st,Z_OK:et,Z_STREAM_END:it,Z_STREAM_ERROR:nt,Z_DATA_ERROR:rt,Z_BUF_ERROR:ot,Z_DEFAULT_COMPRESSION:ht,Z_FILTERED:ct,Z_HUFFMAN_ONLY:at,Z_RLE:ut,Z_FIXED:lt,Z_DEFAULT_STRATEGY:dt,Z_UNKNOWN:ft,Z_DEFLATED:vt}=j,mt=258,pt=262,wt=103,gt=113,yt=666,Et=(t,s)=>(t.msg=q[s],s),At=t=>(t<<1)-(t>4?9:0),_t=t=>{let s=t.length;for(;--s>=0;)t[s]=0};let St=(t,s,e)=>(s<{const s=t.state;let e=s.pending;e>t.avail_out&&(e=t.avail_out),0!==e&&(t.output.set(s.pending_buf.subarray(s.pending_out,s.pending_out+e),t.next_out),t.next_out+=e,s.pending_out+=e,t.total_out+=e,t.avail_out-=e,s.pending-=e,0===s.pending&&(s.pending_out=0))},Tt=(t,s)=>{W(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,s),t.block_start=t.strstart,Rt(t.strm)},It=(t,s)=>{t.pending_buf[t.pending++]=s},Pt=(t,s)=>{t.pending_buf[t.pending++]=s>>>8&255,t.pending_buf[t.pending++]=255&s},bt=(t,s,e,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,s.set(t.input.subarray(t.next_in,t.next_in+n),e),1===t.state.wrap?t.adler=H(t.adler,s,n,e):2===t.state.wrap&&(t.adler=B(t.adler,s,n,e)),t.next_in+=n,t.total_in+=n,n)},Vt=(t,s)=>{let e,i,n=t.max_chain_length,r=t.strstart,o=t.prev_length,h=t.nice_match;const c=t.strstart>t.w_size-pt?t.strstart-(t.w_size-pt):0,a=t.window,u=t.w_mask,l=t.prev,d=t.strstart+mt;let f=a[r+o-1],v=a[r+o];t.prev_length>=t.good_match&&(n>>=2),h>t.lookahead&&(h=t.lookahead);do{if(e=s,a[e+o]===v&&a[e+o-1]===f&&a[e]===a[r]&&a[++e]===a[r+1]){r+=2,e++;do{}while(a[++r]===a[++e]&&a[++r]===a[++e]&&a[++r]===a[++e]&&a[++r]===a[++e]&&a[++r]===a[++e]&&a[++r]===a[++e]&&a[++r]===a[++e]&&a[++r]===a[++e]&&ro){if(t.match_start=s,o=i,i>=h)break;f=a[r+o-1],v=a[r+o]}}}while((s=l[s&u])>c&&0!=--n);return o<=t.lookahead?o:t.lookahead},Ct=t=>{const s=t.w_size;let e,i,n,r,o;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-pt)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,i=t.hash_size,e=i;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--i);i=s,e=i;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--i);r+=s}if(0===t.strm.avail_in)break;if(i=bt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=i,t.lookahead+t.insert>=3)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=St(t,t.ins_h,t.window[o+1]);t.insert&&(t.ins_h=St(t,t.ins_h,t.window[o+3-1]),t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead{let e,i;for(;;){if(t.lookahead=3&&(t.ins_h=St(t,t.ins_h,t.window[t.strstart+3-1]),e=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==e&&t.strstart-e<=t.w_size-pt&&(t.match_length=Vt(t,e)),t.match_length>=3)if(i=Q(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=St(t,t.ins_h,t.window[t.strstart+3-1]),e=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=St(t,t.ins_h,t.window[t.strstart+1]);else i=Q(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(Tt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,s===tt?(Tt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Tt(t,!1),0===t.strm.avail_out)?1:2},Nt=(t,s)=>{let e,i,n;for(;;){if(t.lookahead=3&&(t.ins_h=St(t,t.ins_h,t.window[t.strstart+3-1]),e=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==e&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=Q(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=St(t,t.ins_h,t.window[t.strstart+3-1]),e=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(Tt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=Q(t,0,t.window[t.strstart-1]),i&&Tt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=Q(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,s===tt?(Tt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Tt(t,!1),0===t.strm.avail_out)?1:2};function Ot(t,s,e,i,n){this.good_length=t,this.max_lazy=s,this.nice_length=e,this.max_chain=i,this.func=n}const $t=[new Ot(0,0,0,0,((t,s)=>{let e=65535;for(e>t.pending_buf_size-5&&(e=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Ct(t),0===t.lookahead&&s===K)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const i=t.block_start+e;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,Tt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-pt&&(Tt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,s===tt?(Tt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Tt(t,!1),t.strm.avail_out),1)})),new Ot(4,4,8,4,kt),new Ot(4,5,16,8,kt),new Ot(4,6,32,32,kt),new Ot(4,4,16,16,Nt),new Ot(8,16,32,32,Nt),new Ot(8,16,128,128,Nt),new Ot(8,32,128,256,Nt),new Ot(32,128,258,1024,Nt),new Ot(32,258,258,4096,Nt)];function xt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=vt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),_t(this.dyn_ltree),_t(this.dyn_dtree),_t(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),_t(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),_t(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Mt=t=>{if(!t||!t.state)return Et(t,nt);t.total_in=t.total_out=0,t.data_type=ft;const s=t.state;return s.pending=0,s.pending_out=0,s.wrap<0&&(s.wrap=-s.wrap),s.status=s.wrap?42:gt,t.adler=2===s.wrap?0:1,s.last_flush=K,G(s),et},Lt=t=>{const s=Mt(t);return s===et&&(t=>{t.window_size=2*t.w_size,_t(t.head),t.max_lazy_match=$t[t.level].max_lazy,t.good_match=$t[t.level].good_length,t.nice_match=$t[t.level].nice_length,t.max_chain_length=$t[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0})(t.state),s},Dt=(t,s,e,i,n,r)=>{if(!t)return nt;let o=1;if(s===ht&&(s=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),n<1||n>9||e!==vt||i<8||i>15||s<0||s>9||r<0||r>lt)return Et(t,nt);8===i&&(i=9);const h=new xt;return t.state=h,h.strm=t,h.wrap=o,h.gzhead=null,h.w_bits=i,h.w_size=1<{let e,i;if(!t||!t.state||s>st||s<0)return t?Et(t,nt):nt;const n=t.state;if(!t.output||!t.input&&0!==t.avail_in||n.status===yt&&s!==tt)return Et(t,0===t.avail_out?ot:nt);n.strm=t;const r=n.last_flush;if(n.last_flush=s,42===n.status)if(2===n.wrap)t.adler=0,It(n,31),It(n,139),It(n,8),n.gzhead?(It(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),It(n,255&n.gzhead.time),It(n,n.gzhead.time>>8&255),It(n,n.gzhead.time>>16&255),It(n,n.gzhead.time>>24&255),It(n,9===n.level?2:n.strategy>=at||n.level<2?4:0),It(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(It(n,255&n.gzhead.extra.length),It(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=B(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(It(n,0),It(n,0),It(n,0),It(n,0),It(n,0),It(n,9===n.level?2:n.strategy>=at||n.level<2?4:0),It(n,3),n.status=gt);else{let s=vt+(n.w_bits-8<<4)<<8,e=-1;e=n.strategy>=at||n.level<2?0:n.level<6?1:6===n.level?2:3,s|=e<<6,0!==n.strstart&&(s|=32),s+=31-s%31,n.status=gt,Pt(n,s),0!==n.strstart&&(Pt(n,t.adler>>>16),Pt(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(e=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>e&&(t.adler=B(t.adler,n.pending_buf,n.pending-e,e)),Rt(t),e=n.pending,n.pending!==n.pending_buf_size));)It(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>e&&(t.adler=B(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){e=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>e&&(t.adler=B(t.adler,n.pending_buf,n.pending-e,e)),Rt(t),e=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexe&&(t.adler=B(t.adler,n.pending_buf,n.pending-e,e)),0===i&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){e=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>e&&(t.adler=B(t.adler,n.pending_buf,n.pending-e,e)),Rt(t),e=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexe&&(t.adler=B(t.adler,n.pending_buf,n.pending-e,e)),0===i&&(n.status=wt)}else n.status=wt;if(n.status===wt&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Rt(t),n.pending+2<=n.pending_buf_size&&(It(n,255&t.adler),It(n,t.adler>>8&255),t.adler=0,n.status=gt)):n.status=gt),0!==n.pending){if(Rt(t),0===t.avail_out)return n.last_flush=-1,et}else if(0===t.avail_in&&At(s)<=At(r)&&s!==tt)return Et(t,ot);if(n.status===yt&&0!==t.avail_in)return Et(t,ot);if(0!==t.avail_in||0!==n.lookahead||s!==K&&n.status!==yt){let e=n.strategy===at?((t,s)=>{let e;for(;;){if(0===t.lookahead&&(Ct(t),0===t.lookahead)){if(s===K)return 1;break}if(t.match_length=0,e=Q(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,e&&(Tt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,s===tt?(Tt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Tt(t,!1),0===t.strm.avail_out)?1:2})(n,s):n.strategy===ut?((t,s)=>{let e,i,n,r;const o=t.window;for(;;){if(t.lookahead<=mt){if(Ct(t),t.lookahead<=mt&&s===K)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){r=t.strstart+mt;do{}while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(e=Q(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(e=Q(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),e&&(Tt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,s===tt?(Tt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Tt(t,!1),0===t.strm.avail_out)?1:2})(n,s):$t[n.level].func(n,s);if(3!==e&&4!==e||(n.status=yt),1===e||3===e)return 0===t.avail_out&&(n.last_flush=-1),et;if(2===e&&(s===J?Y(n):s!==st&&(Z(n,0,0,!1),s===X&&(_t(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Rt(t),0===t.avail_out))return n.last_flush=-1,et}return s!==tt?et:n.wrap<=0?it:(2===n.wrap?(It(n,255&t.adler),It(n,t.adler>>8&255),It(n,t.adler>>16&255),It(n,t.adler>>24&255),It(n,255&t.total_in),It(n,t.total_in>>8&255),It(n,t.total_in>>16&255),It(n,t.total_in>>24&255)):(Pt(n,t.adler>>>16),Pt(n,65535&t.adler)),Rt(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?et:it)},Ft=(t,s)=>{let e=s.length;if(!t||!t.state)return nt;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return nt;if(1===n&&(t.adler=H(t.adler,s,e,0)),i.wrap=0,e>=i.w_size){0===n&&(_t(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(s.subarray(e-i.w_size,e),0),s=t,e=i.w_size}const r=t.avail_in,o=t.next_in,h=t.input;for(t.avail_in=e,t.next_in=0,t.input=s,Ct(i);i.lookahead>=3;){let t=i.strstart,s=i.lookahead-2;do{i.ins_h=St(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--s);i.strstart=t,i.lookahead=2,Ct(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=o,t.input=h,t.avail_in=r,i.wrap=n,et},Ht={deflateInit:(t,s)=>Dt(t,s,vt,15,8,dt),deflateInit2:Dt,deflateReset:Lt,deflateResetKeep:Mt,deflateSetHeader:(t,s)=>t&&t.state?2!==t.state.wrap?nt:(t.state.gzhead=s,et):nt,deflate:Ut,deflateEnd:t=>{if(!t||!t.state)return nt;const s=t.state.status;return 42!==s&&69!==s&&73!==s&&91!==s&&s!==wt&&s!==gt&&s!==yt?Et(t,nt):(t.state=null,s===gt?Et(t,rt):et)},deflateSetDictionary:Ft,deflateInfo:"pako deflate (from Nodeca project)"};const zt=(t,s)=>Object.prototype.hasOwnProperty.call(t,s);var Bt=function(t){const s=Array.prototype.slice.call(arguments,1);for(;s.length;){const e=s.shift();if(e){if("object"!=typeof e)throw new TypeError(e+"must be non-object");for(const s in e)zt(e,s)&&(t[s]=e[s])}}return t},qt=t=>{let s=0;for(let e=0,i=t.length;e=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Gt[254]=Gt[254]=1;const Zt=(t,s=t.length)=>{if(s<65534&&t.subarray&&jt)return String.fromCharCode.apply(null,t.length===s?t:t.subarray(0,s));let e="";for(let i=0;i{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let s,e,i,n,r,o=t.length,h=0;for(n=0;n>>6,s[r++]=128|63&e):e<65536?(s[r++]=224|e>>>12,s[r++]=128|e>>>6&63,s[r++]=128|63&e):(s[r++]=240|e>>>18,s[r++]=128|e>>>12&63,s[r++]=128|e>>>6&63,s[r++]=128|63&e);return s};var Qt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Yt=Object.prototype.toString,{Z_NO_FLUSH:Kt,Z_SYNC_FLUSH:Jt,Z_FULL_FLUSH:Xt,Z_FINISH:ts,Z_OK:ss,Z_STREAM_END:es,Z_DEFAULT_COMPRESSION:is,Z_DEFAULT_STRATEGY:ns,Z_DEFLATED:rs}=j;function os(t){this.options=Bt({level:is,method:rs,chunkSize:16384,windowBits:15,memLevel:8,strategy:ns},t||{});let s=this.options;s.raw&&s.windowBits>0?s.windowBits=-s.windowBits:s.gzip&&s.windowBits>0&&s.windowBits<16&&(s.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;let e=Ht.deflateInit2(this.strm,s.level,s.method,s.windowBits,s.memLevel,s.strategy);if(e!==ss)throw new Error(q[e]);if(s.header&&Ht.deflateSetHeader(this.strm,s.header),s.dictionary){let t;if(t="string"==typeof s.dictionary?Wt(s.dictionary):"[object ArrayBuffer]"===Yt.call(s.dictionary)?new Uint8Array(s.dictionary):s.dictionary,e=Ht.deflateSetDictionary(this.strm,t),e!==ss)throw new Error(q[e]);this._dict_set=!0}}function hs(t,s){return(s=s||{}).gzip=!0,function(t,s){const e=new os(s=s||{});if(e.push(t,!0),e.err)throw e.msg||q[e.err];return e.result}(t,s)}return os.prototype.push=function(t,s){const e=this.strm,i=this.options.chunkSize;let n,r;if(this.ended)return!1;for(r=s===~~s?s:!0===s?ts:Kt,"string"==typeof t?e.input=Wt(t):"[object ArrayBuffer]"===Yt.call(t)?e.input=new Uint8Array(t):e.input=t,e.next_in=0,e.avail_in=e.input.length;;)if(0===e.avail_out&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),(r===Jt||r===Xt)&&e.avail_out<=6)this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;else{if(n=Ht.deflate(e,r),n===es)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),n=Ht.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===ss;if(0!==e.avail_out){if(r>0&&e.next_out>0)this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;else if(0===e.avail_in)break}else this.onData(e.output)}return!0},os.prototype.onData=function(t){this.chunks.push(t)},os.prototype.onEnd=function(t){t===ss&&(this.result=qt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},(t,s,e)=>{let i=hs(t);return i="base64"===s?btoa(Zt(i)):i.buffer,e&&e(i),i}}class Cu extends pe{constructor(t){super(t),this.algorithm=me.GZIP,this.ow=Vu(),this.hw=(t,s,e)=>{e(this.ow(t,s))},this.compress=ku();"undefined"!=typeof CompressionStream&&Ue||(this.compress=this.hw,this.getCompressorSourceCode=()=>Vu.toString())}compressSync(t,s){return this.ow(t,s)}getCompressorSourceCode(){return ku.toString()}}function ku(){return(t,s,e)=>{const i=new Response(t).body.pipeThrough(new CompressionStream("gzip")),n=new Response(i).arrayBuffer();"base64"!==s?n.then((t=>e(t))):n.then((t=>{return s=t,new Promise((t=>{const e=new FileReader;e.onload=s=>t(s.target.result.split(",")[1]),e.readAsDataURL(new Blob([s]))}));var s})).then((t=>e(t)))}}class Nu extends pe{constructor(){super(...arguments),this.algorithm=me.UNCOMPRESSED}compress(t,s,e){e(this.compressSync(t,s))}compressSync(t,s){return t}getCompressorSourceCode(){return function(){return(t,s,e)=>e(t)}.toString()}}class Ou{static create(t,s=!0){return this.instance?this.instance:s&&!bu.isCompressionEnabled()?new Nu(t):this.instance=new Cu(t)}}class $u{setItem(t,s){window.sessionStorage.setItem(t,s)}getItem(t){return window.sessionStorage.getItem(t)}removeItem(t){window.sessionStorage.removeItem(t)}}class xu{setItem(t,s){window.localStorage.setItem(t,s)}getItem(t){return window.localStorage.getItem(t)}removeItem(t){window.localStorage.removeItem(t)}}const Mu="_cs_cvars";class Lu{constructor(t,s,e){this.wt=t,this.Wv=s,this.Im=e}onCookieToSet(t){this.Om=t}onCookieToRemove(t){this.$m=t}get(){return this.wt.cookielessTrackingEnabled?this.Im.getItem(Mu):this.Wv.get(Mu)}set(t){var s;this.wt.cookielessTrackingEnabled?this.Im.setItem(Mu,t):(this.Wv.set(Mu,t),null===(s=this.Om)||void 0===s||s.call(this,Mu,t))}remove(){var t;this.wt.cookielessTrackingEnabled?this.Im.removeItem(Mu):(this.Wv.delete(Mu),null===(t=this.$m)||void 0===t||t.call(this,Mu))}static isValidCustomVarString(t){return"string"==typeof t}}const Du=["visit",2],Uu=["page",3],Fu=["nextPageOnly",4];class Hu{constructor(t,s){this.gt=t,this.gm=s,this.aw={},this.uw={}}set(t,s,e,i){let n,r;if((f(t)||m(t))&&Number(t)>0&&y(s)&&y(e)&&!E(s)&&!E(e)&&this.lw(i)){const o=this.gt.anonymizePII(csString(s)),h=this.gt.anonymizePII(csString(e));if(n=[csString.prototype.slice.call(o,0,512),csString.prototype.slice.call(h,0,255)],r=""!==e,!g(i)||csArray.prototype.indexOf.call(Du,i)>=0){const s=this.getCustomVariablesSession();r?s[t]=n:delete s[t],this.setCustomVariableSession(s)}(!g(i)||csArray.prototype.indexOf.call(Uu,i)>=0)&&(r?this.aw[t]=n:delete this.aw[t]),g(i)&&csArray.prototype.indexOf.call(Fu,i)>=0&&(r?this.uw[t]=n:delete this.uw[t]),as.counters.commandApplied.count("cvars")}else as.counters.commandMisuse.count("cvars")}getCustomVariablesSession(){const t=this.gm.get();if(!t)return{};const s=window.csJSON.parse(t);return null!==s&&w(s)?s:{}}setCustomVariableSession(t){this.gm.set(window.csJSON.stringify(t))}removeCustomVariablesSession(){this.gm.remove()}removeCustomVariablesPage(){this.aw={}}getRequestParameters(){const t=this.getCustomVariablesSession();for(const t in this.uw)this.uw.hasOwnProperty(t)&&(this.aw[t]=this.uw[t]);for(const s in this.aw)this.aw.hasOwnProperty(s)&&(t[s]=this.aw[s]);if(window.csJSON.stringify(t).length<=2)return{};const s={cvars:this.fw(t)};return this.aw&&window.csJSON.stringify(this.aw).length>2&&(s.cvarp=this.fw(this.aw)),s}deleteNextPageOnlyCustomVariables(){if(Object.keys(this.uw).length>0)for(const t in this.uw)this.uw[t]===this.aw[t]&&(delete this.aw[t],delete this.uw[t])}mw(t){for(const n in t)if(t.hasOwnProperty(n)){const r=parseInt(n,10),o=t[n],h=o[0],c=o[1];e=1,i=20,(!(v(s=r)&&s>=e&&s<=i)||h.length>512||c.length>255)&&delete t[n]}var s,e,i}fw(t){this.mw(t);const s=function(t){let s;for(s in t)return!1;return!0}(t)?[]:t;return window.csJSON.stringify(s)}lw(t){return!g(t)||m(t)||f(t)}getAllValidCustomVars(){const t=this.getCustomVariablesSession();for(const t in this.uw)this.uw.hasOwnProperty(t)&&(this.aw[t]=this.uw[t]);for(const s in this.aw)this.aw.hasOwnProperty(s)&&(t[s]=this.aw[s]);return this.mw(t),t}}const zu=["setCustomVariable"];class Bu{constructor(t,s){this.La=t,this.Ms=s}init(){this.La.register(zu,((t,s,e,i)=>{this.Ms.set(t,s,e,i)}))}onAfterArtificialPageView(){this.Ms.deleteNextPageOnlyCustomVariables()}onAfterNaturalPageView(){this.Ms.deleteNextPageOnlyCustomVariables()}onOptout(){this.Ms.removeCustomVariablesSession()}onBeforeVisitorRenewal(){this.Ms.removeCustomVariablesSession(),this.Ms.removeCustomVariablesPage()}}const qu="_cs_id",ju=/^(([a-z0-9\-])+(\.[0-9]+){6})(\.(None|Lax|X)\.(0|1))?(\.[0-1])?(\.\b(x|[0-9a-fA-F]{12})\b)?$/;class Gu{constructor(t,s,e){this.wt=t,this.Wv=s,this.Im=e}onCookieToSet(t){this.Om=t}onCookieToRemove(t){this.$m=t}get(){let t;return t=this.wt.cookielessTrackingEnabled?this.Im.getItem(qu):this.Wv.get(qu),t?Gu.fromString(t):null}set(t){var s;const e=Gu.toString(t);if(this.wt.cookielessTrackingEnabled)this.Im.setItem(qu,e);else{const i=new csDate(t.expires);this.Wv.set(qu,e,i),null===(s=this.Om)||void 0===s||s.call(this,qu,e,i)}}remove(){var t;this.wt.cookielessTrackingEnabled?this.Im.removeItem(qu):(this.Wv.delete(qu),null===(t=this.$m)||void 0===t||t.call(this,qu))}handleSubdomainChange(){if(this.wt.cookielessTrackingEnabled)return;const t=this.get();t&&(t.allowSubdomains=this.wt.allowSubdomains,this.wt.allowSubdomains?this.Wv.delete(qu,ae.CURRENT_DOMAIN):this.Wv.delete(qu,this.Wv.getRootDomain()),this.set(t))}static fromString(t){const[s,e,i,n,r,o,h,c,a]=csString.prototype.split.call(t,".");return{id:s,creationTimestamp:Number(e),visitsCount:Number(i),hitTimestamp:Number(n),lastVisitTimestamp:Number(r),appliedTrackingDraw:Number(o),expires:Number(h),allowSubdomains:void 0===c?void 0:!!Number(c),identityPrint:void 0===a||"x"===a?null:a}}static toString(t){var s;return csArray.prototype.join.call([t.id,t.creationTimestamp,t.visitsCount,t.hitTimestamp,t.lastVisitTimestamp,t.appliedTrackingDraw,t.expires,t.allowSubdomains?1:0,null!==(s=t.identityPrint)&&void 0!==s?s:"x"],".")}static isValidVisitorString(t){return ju.test(t)}}class Zu{constructor(t){this.gt=t}anonymizeUrl(t,s=[],e=[]){let i=this.gt.anonymizePII(t);i=this.gt.anonymizeJwt(i);const n=this.pw(i,s);return n!==i?n:this.gw(i,e)}removeQueryString(t){const{path:s,queryString:e}=this.yw(t);return""!==e?`${s}?`:s}yw(t){const s=csString.prototype.indexOf.call(t,"?");let e,i="";return-1!==s?(e=csString.prototype.slice.call(t,0,s),i=csString.prototype.slice.call(t,s,t.length)):e=t,{path:e,queryString:i}}pw(t,s){if(0===s.length)return t;const{path:e,queryString:i}=this.yw(t),n=csString.prototype.split.call(e,"/");for(const t of s){const s=this.Ew(n,t);if(null!==s)return`${s}${i}`}return t}Ew(t,s){if(t.length=s.length){csArray.prototype.push.call(e,n);continue}const r=s[i].key;if(this.Aw(r)){const t=s[i].value;csArray.prototype.push.call(e,t)}else{if(n!==r)return null;csArray.prototype.push.call(e,n)}}return csArray.prototype.join.call(e,"/")}gw(t,s){if(0===s.length)return t;const{path:e,queryString:i}=this.yw(t);let n=csString.prototype.split.call(e,"/");for(const t of s)n=this._w(n,t);return`${csArray.prototype.join.call(n,"/")}${i}`}_w(t,s){const e=[];let i=0;const n="http:"===t[0]||"https:"===t[0]?2:0;for(let r=0;r=n){const t=s[i].value;csArray.prototype.push.call(e,o.length>0?t:""),i++,i===s.length&&(i=0)}else if(o!==h){for(let s=0;sYe.isMaskedElement(t)||Ye.isMaskedElementChild(t),isAttributeSensitive:(t,s)=>Ye.isMaskedAttribute(t,s),allWhitelistedAttributes:ir(this.wt.whitelistedAttributes),attributeIgnoreTokens:Wu,useAnonymization:s,attrMaxLength:1024,hierarchyMaxLength:1024};return this.Ku.getElementPathAndHierarchy(e,i,{dynamicIdRegex:this.wt.dynamicIdRegex,...this.wt.pathComputationRules})}getEventTargetPath(t){const s=De(t);return this.Ku.getElementPath(s,{dynamicIdRegex:this.wt.dynamicIdRegex,...this.wt.pathComputationRules})}getEventTargetPathAndTargetLink(t){const s=De(t),{path:e,firstAnchorParent:i}=this.Ku.getElementPathAndFirstAnchorParent(s,{dynamicIdRegex:this.wt.dynamicIdRegex,...this.wt.pathComputationRules});return{path:e,targetLink:this.Sw(i)?i.href:""}}hasValidEventTarget(t){const s=De(t);return this.Ku.isValidElement(s)}getElementPath(t){return this.Ku.getElementPath(t,{dynamicIdRegex:this.wt.dynamicIdRegex,...this.wt.pathComputationRules})}Sw(t){var s;return null!==t&&t.hasAttribute("href")&&!Zt(null!==(s=t.getAttribute("href"))&&void 0!==s?s:"","#")}}class Yu{constructor(t){this.Ml=t}transformEvent(t,s){this.Rw(t,s.event);const e=this.Ml.getElementPath(t);return this.Tw(e,s.event),s}Rw(t,s){if(function(t){return void 0!==t.x&&void 0!==t.y}(s)){const e=t.getBoundingClientRect();s.x=Math.round(e.left+s.x+Vt.windowOffsetX()),s.y=Math.round(e.top+s.y+Vt.windowOffsetY())}}Tw(t,s){th(s)&&(s.tgt=`${t}${Tu}${s.tgt}`),function(t){return void 0!==t.tgtHM}(s)&&(s.tgtHM=`${t}${Tu}${s.tgtHM}`),function(t){return void 0!==t.tgtLk}(s)&&(s.tgtLk=`${t}${Tu}${s.tgtLk}`)}}class Ku{constructor(t){this.Ml=t}transformEvent(t,s){const e=this.Ml.getElementPath(t);return{iframePath:s.iframePath?`${e}${Tu}${s.iframePath}`:e,commands:s.commands}}}class Ju{constructor(t){this.Ml=t}transformEvent(t,s){if(0===s.products.length)return s;const e=this.Ml.getElementPath(t),i=csArray.prototype.map.call(s.products,(t=>({...t,targetPath:`${e}${Tu}${t.targetPath}`})));return{...s,products:i}}}class Xu{constructor(){this.Iw={clientX:2,clientY:3},this.Pw={clientX:1,clientY:2},this.bw=[Oe.POINTER_DOWN,Oe.POINTER_MOVE,Oe.POINTER_UP],this.Vw=[Oe.TOUCH_START,Oe.TOUCH_MOVE,Oe.TOUCH_END]}transformEvents(t,s){if(!Ht.isConnected(t))return s.events=csArray.prototype.filter.call(s.events,(t=>t.type!==Oe.VISIBILITY_CHANGE)),0===s.events.length||(se.warn(`IframeRecordingEventsTransformer received event ${Ys.RecordingEvent}\n from disconnected iframe, content:${csJSON.stringify(s.events)}`),s.events=[]),s;const e=Ge(t);let i=null;csArray.prototype.some.call(s.events,(t=>this.Cw(t)||this.kw(t)))&&(i=t.getBoundingClientRect());for(const t of s.events)this.Cw(t)?this.Nw(i,t):this.kw(t)&&this.Ow(i,t),t.context=t.context&&t.context.length>0?`${e}/${t.context}`:`${e}`;return s}Ow(t,s){this.$w(this.Pw,t,s)}Nw(t,s){this.$w(this.Iw,t,s)}$w(t,s,e){e.args&&(e.args[t.clientX]=Math.round(s.left+e.args[t.clientX]),e.args[t.clientY]=Math.round(s.top+e.args[t.clientY]))}Cw(t){return-1!==csArray.prototype.indexOf.call(this.bw,t.type)}kw(t){return-1!==csArray.prototype.indexOf.call(this.Vw,t.type)}}class tl{constructor(t){this.xw=t}start(){this.xw.onEvent((t=>this.On(t))),this.xw.start()}stop(){this.xw.stop()}On(t){const s=`Content Security Policy error. Violated directive: ${t.violatedDirective} - Source file: ${t.sourceFile}`;se.warn(s)}}class sl{constructor(){this._h={boundElement:document,type:"securitypolicyviolation",listener:t=>this.securityPolicyViolationListener(t)}}start(){be(this._h)}stop(){Ve(this._h)}onEvent(t){this.ur=t}Mw(t){if(!t)return!1;const s=t.disposition;return m(t.sourceFile)&&csArray.prototype.some.call(sl.Lw,(s=>csString.prototype.indexOf.call(t.sourceFile,s)>0))&&"report"!==s}securityPolicyViolationListener(t){this.Mw(t)&&this.ur({violatedDirective:t.violatedDirective,sourceFile:t.sourceFile})}}sl.Lw=["contentsquare","cdnssl.clicktale.net"],ne([vt("Event handler type: securitypolicyviolation")],sl.prototype,"securityPolicyViolationListener",null);class el{init(){this.Dw=new tl(new sl),this.Dw.start()}onOptout(){this.Dw.stop()}}class il extends is{constructor(t,s,e){super(t,s),this.Uw=null,this.Fw=(null==e?void 0:e.type)||"json",this.Hw=null==e?void 0:e.cacheMinutes,this.Ns=null==e?void 0:e.timeout}onLoad(t){this.Vs=t}onError(t){this.Cs=t}onTimeout(t,s){this.ks=t,this.Ns=s}send(){csArray.prototype.forEach.call(this.beforeRequestCallbacks,(t=>t()));const t=this.retrieveParameters();this.Y(t);const s=es.toQuery(t),e=`${this.domainUri}${this.path?`/${this.path}`:""}?${s}`;this.Td(e,this.Fw)}abort(){this.Uw&&(this.Uw.abort(),this.Uw=null)}isInProgress(){return null!==this.Uw}Td(t,s){var e;const i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType=s,i.onerror=()=>{var t;return null===(t=this.Cs)||void 0===t?void 0:t.call(this,i)},i.ontimeout=()=>{var t;return null===(t=this.ks)||void 0===t?void 0:t.call(this,i)},i.onload=()=>{var t,e;i.status>=200&&i.status<400?(null===(t=this.Vs)||void 0===t||t.call(this,this.zw(i,s)?i.response:i.responseText),csArray.prototype.forEach.call(this.afterRequestCallbacks,(t=>t()))):null===(e=this.Cs)||void 0===e||e.call(this,i)},i.onloadend=()=>{this.Uw=null},i.timeout=null!==(e=this.Ns)&&void 0!==e?e:5e3,this.Uw=i,i.send()}zw(t,s){const e=t.getResponseHeader("Content-Type");return null===e?"json"===s:csString.prototype.indexOf.call(csString.prototype.toLowerCase.call(e),"json")>0}Y(t){let s;s=this.Hw?`${(t=>{const s=60*t*1e3;return`${Math.floor(csDate.now()/s)}`})(this.Hw)}`:csString.prototype.slice.call(`${Math.random()}`,2,8),t.r=s}}class nl{constructor(t){this.configuration=t}}class rl extends nl{constructor(t,s,e){super(t),this.configuration=t,this.Bw=s,this.ta=e,this.qw=vi.RECORDING_GLOBAL_SAMPLING}refreshQuota(){this.jw=void 0,this.Gw()}onQuotaReady(t){this.Zw=t}init(){this.Ww()}sanitizeSessionCollectState(t){return t}canCollect(t){return null!==t&&t.collectState!==vi.QUOTA_REACHED}computeInitialCollectState(t){return this.jw?(this.ta.emitCollectStateChange(this.jw,mi.ETR_OFF),this.jw):(se.warn("Quota file error computeInitialCollectState() called before quota answered"),vi.QUOTA_REACHED)}getEligibleCollectState(t){return t.collectState===vi.QUOTA_REACHED?vi.QUOTA_REACHED:!oa.isRecordingSupported()&&this.isReplayRecorded(t)?vi.ANALYTICS_ONLY:t.collectState===vi.RECORDING_RULES_TARGETING?vi.RECORDING_RULES_TARGETING:t.collectState===vi.ANALYTICS_ONLY_RULES_TARGETING?vi.ANALYTICS_ONLY_RULES_TARGETING:t.collectState===vi.RECORDING_GLOBAL_SAMPLING?vi.RECORDING_GLOBAL_SAMPLING:vi.ANALYTICS_ONLY}abortQuotaServiceRequest(){}isReplayRecorded(t){return t.collectState===vi.RECORDING_GLOBAL_SAMPLING||t.collectState===vi.RECORDING_RULES_TARGETING}getInitialCollectState(){return this.jw||vi.QUOTA_REACHED}setVisitorService(t){}computeInitialCollectStateFromRecordingConsentGranted(t){return vi.ANALYTICS_ONLY}Qw(t){this.jw=t,this.Zw&&this.Zw(t)}Ww(){this.Bw.onError((t=>this.quotaServiceErrorHandler(`HTTP:${t.status} - fetching quota file for pid: ${this.configuration.projectId}`))),this.Bw.onTimeout((()=>this.quotaServiceErrorHandler("timeout"))),this.Bw.onLoad((t=>this.quotaFileHandler(t)))}Gw(){this.Bw.isInProgress()||this.Bw.send()}quotaFileHandler(t){var s;(null===(s=null==t?void 0:t.quotas)||void 0===s?void 0:s.length)?this.Yw(t):this.quotaServiceErrorHandler("Quota types missing from config file")}quotaServiceErrorHandler(t){const s=`Quota error - ${t}`;se.warn(s),this.Qw(this.qw)}Yw(t){let s=!1,e=!1;for(const i of t.quotas)"ANALYTICS"===i.quotaType&&i.value?s=!0:"RECORDING"===i.quotaType&&i.value&&Qt.boolean(Math.round(100*i.value))&&(e=!0);!s&&e?this.quotaServiceErrorHandler(`Quota types impossible: replay without analytics - ${csJSON.stringify(t)}`):s&&e?oa.isRecordingSupported()?this.Qw(vi.RECORDING_GLOBAL_SAMPLING):this.Qw(vi.ANALYTICS_ONLY):s&&!e?this.Qw(vi.ANALYTICS_ONLY):this.Qw(vi.QUOTA_REACHED)}getRecordingConsentWithdrawn(){return vi.ANALYTICS_ONLY}}ne([vt("Quota File: quotaFileHandler")],rl.prototype,"quotaFileHandler",null),ne([vt("Quota File: onerror")],rl.prototype,"quotaServiceErrorHandler",null);class ol extends nl{constructor(t,s,e,i,n){super(t),this.configuration=t,this.Kw=s,this.ta=e,this.vm=i,this.Ot=n,this.Jw=[]}refreshQuota(){}onQuotaReady(t){}canCollect(t){return!0}init(){this.Xw()}sanitizeSessionCollectState(t){return t.collectState!==vi.QUOTA_REACHED&&t.collectState!==vi.RECORDING_RULES_TARGETING&&t.collectState!==vi.RECORDING_TEMPORARILY||(t.collectState=vi.ANALYTICS_ONLY),t}computeInitialCollectState(t){return To.isReplayConsentNeeded(this.configuration)?vi.RECORDING_BLOCKED_BY_CONSENT_NOT_EXPRESSED:this.Wm(t)}computeInitialCollectStateFromRecordingConsentGranted(t){return this.Wm(t)}Wm(t){return oa.isRecordingSupported()?(this.Jw=[],Qt.percentage()0?(this.Gw(t),vi.RECORDING_TEMPORARILY):vi.ANALYTICS_ONLY):vi.ANALYTICS_ONLY}getEligibleCollectState(t){return oa.isRecordingSupported()?To.isRecordingBlockedByConsent(t)?t.collectState===vi.RECORDING_BLOCKED_BY_CONSENT_WITHDRAWN?vi.RECORDING_BLOCKED_BY_CONSENT_WITHDRAWN:vi.RECORDING_BLOCKED_BY_CONSENT_NOT_EXPRESSED:t.collectState===vi.RECORDING_GLOBAL_SAMPLING?vi.RECORDING_GLOBAL_SAMPLING:(this.Jw=[],this.configuration.malkaUrlEnabled&&(csArray.prototype.push.call(this.Jw,vi.RECORDING_URL_SAMPLING),this.configuration.malkaEtrEnabled&&csArray.prototype.push.call(this.Jw,vi.RECORDING_ETR_SAMPLING)),this.Jw.length>0?(this.Gw(t),vi.RECORDING_TEMPORARILY):(t.etrState===mi.ETR_ON&&this.ta.emitCollectStateChange(vi.ANALYTICS_ONLY,mi.ETR_ON),vi.ANALYTICS_ONLY)):vi.ANALYTICS_ONLY}Gw(t){var s;const e=null===(s=this.bt)||void 0===s?void 0:s.getVisitor();this.Kw.send({recordingTypes:csArray.prototype.map.call(this.Jw,Number),url:this.Ot.getAnonymizedUrl(),projectId:this.configuration.projectId,uu:(null==e?void 0:e.id)||"",sn:(null==e?void 0:e.visitsCount)||"",pn:(null==t?void 0:t.pageNumber)||""})}abortQuotaServiceRequest(){this.Kw.abort()}isReplayRecorded(t){return!To.isRecordingBlockedByConsent(t)&&(t.collectState===vi.RECORDING_TEMPORARILY||t.collectState===vi.RECORDING_GLOBAL_SAMPLING||t.collectState===vi.RECORDING_URL_SAMPLING||t.etrState===mi.ETR_ON)}Xw(){this.Kw.onError((()=>this.quotaServiceErrorHandler("NetworkError"))),this.Kw.onTimeout((()=>this.quotaServiceTimeoutHandler()),3e3),this.Kw.onLoad((t=>this.quotaServiceLoadHandler(t)))}quotaServiceErrorHandler(t){this.tg(`error - ${t}`)}quotaServiceTimeoutHandler(){this.tg("timeout")}tg(t){let s=vi.ANALYTICS_ONLY;this.sg(this.Jw)?(s=vi.RECORDING_GLOBAL_SAMPLING,se.warn(`Quota Service: request ${t} - bypassed by GLOBAL_SAMPLING`)):se.warn(`Quota Service: request ${t}`),this.ta.emitCollectStateChange(s,mi.ETR_OFF)}quotaServiceLoadHandler(t){if(200!==t.status)return void this.quotaServiceErrorHandler(`Status code: ${t.status}`);let s;try{s=csJSON.parse(t.responseText)}catch(s){return void this.quotaServiceErrorHandler(`Unable to parse the quota service response: ${t.responseText}`)}const e=null==s.allowedRecordingTypes?void 0:csArray.prototype.map.call(s.allowedRecordingTypes,csString);if(!e)return void this.quotaServiceErrorHandler("recording types missing from quota service response");let i=mi.ETR_OFF,n=vi.ANALYTICS_ONLY;this.sg(e)?n=vi.RECORDING_GLOBAL_SAMPLING:this.eg(e)&&(n=vi.RECORDING_URL_SAMPLING),this.ig(e)&&(i=mi.ETR_ON),this.ta.emitCollectStateChange(n,i)}sg(t){return csArray.prototype.some.call(t,(t=>t===vi.RECORDING_GLOBAL_SAMPLING))}eg(t){return csArray.prototype.some.call(t,(t=>t===vi.RECORDING_URL_SAMPLING))}ig(t){return csArray.prototype.some.call(t,(t=>t===vi.RECORDING_ETR_SAMPLING))}setVisitorService(t){this.bt=t}getInitialCollectState(){return vi.ANALYTICS_ONLY}getRecordingConsentWithdrawn(){return vi.RECORDING_BLOCKED_BY_CONSENT_WITHDRAWN}}ne([vt("Quota Service: onerror")],ol.prototype,"quotaServiceErrorHandler",null),ne([vt("Quota Service: ontimeout")],ol.prototype,"quotaServiceTimeoutHandler",null),ne([vt("Quota Service: onload")],ol.prototype,"quotaServiceLoadHandler",null);class hl{constructor(){this.ng={PIISelectors:["picture","img","video","audio"],Attributes:[]},this.hv={elementSelector:"",attrSelector:"",attrSelectors:[]};const t={PIISelectors:["[data-cs-mask]","#c1_card_info_id",".ctHidden","[data-heap-redact-text]","[heap-ignore]","[data-heap-ignore]","[data-heap-redact-attributes]","[data-hj-suppress]",".data-hj-suppress","[data-hj-masked]"],Attributes:[{selector:".ctHidden,input:not([type=button]):not([type=submit])",attrName:"value"}]};this.hv=Ye.getComputedSelectorSettings(t,this.hv)}init(){this.rg()}setMaskedElementSettingsFromCommand(t){t=Ye.sanitizeSelectorUserInput(t),Ye.isSelectorUserInput(t)&&this.og(t)}setMaskedElementSettingsFromParent(t){const s={PIISelectors:csString.prototype.split.call(t.elementSelector,","),Attributes:t.attrSelectors};this.og(s)}getMaskedElementSettings(t){return t?this.hg(this.ng):this.hv}rg(){var t,s,e,i,n,r;const o={PIISelectors:[],Attributes:[]};(null===(e=null===(s=null===(t=null===window||void 0===window?void 0:window.ClickTaleSettings)||void 0===t?void 0:t.DOM)||void 0===s?void 0:s.PII)||void 0===e?void 0:e.Text)instanceof Array&&o.PIISelectors.push(...window.ClickTaleSettings.DOM.PII.Text),(null===(r=null===(n=null===(i=null===window||void 0===window?void 0:window.ClickTaleSettings)||void 0===i?void 0:i.DOM)||void 0===n?void 0:n.PII)||void 0===r?void 0:r.Attributes)instanceof Array&&window.ClickTaleSettings.DOM.PII.Attributes.forEach((t=>{m(t.attr)&&m(t.rule)&&o.Attributes.push({selector:t.rule,attrName:t.attr})})),this.og(o)}og(t){this.hv=this.hg(t)}hg(t){return Ye.getComputedSelectorSettings(t,this.hv)}}class cl{constructor(t,s,e,i,n){this.wt=t,this.$t=s,this.yt=e,this.zr=i,this.ta=n,this.cg=()=>{var t;const s=re.get(Va);null!==s&&$a.isValidSessionString(s)?this.Uv.canCollect($a.fromRawString(s))?this.init():null===(t=this.wt.voc)||void 0===t||t.enabled:(this.Uv.onQuotaReady((t=>{var s;t!==vi.QUOTA_REACHED?this.init():null===(s=this.wt.voc)||void 0===s||s.enabled})),this.Uv.refreshQuota())}}initWithQuota(){var t,s;if(!1===(null===(t=this.wt.smbConfig)||void 0===t?void 0:t.record))return void(null===(s=this.wt.voc)||void 0===s||s.enabled);const e=new il(this.wt.getQuotaUri(),"",{type:"json",cacheMinutes:15});this.Uv=new rl(this.wt,e,this.ta),this.Uv.init(),this.cg()}init(){let t,s,e,i,n,r,o,h,c,a,u,l,d,f,v,m,p,w,g,y,E,A,_,S,R,T,I,P,b,V,C;Gc.isSupported()&&Gc.setDigestSalt(this.wt.projectId.toString()),this.zr.schedule((()=>{t=new As,s=new Zu(t),i=new _u(window.location,s),e=new ae(this.wt,i,this.$t),e.init()})),this.zr.schedule((()=>{n=new $u,r=new xu,m=new hu(window.location,e);(new el).init(),p=Ou.create(se.warn),v=new ge(p);const t=v.create(`${this.wt.getLegacyQuotaUri()}/quota`,!0);void 0===this.Uv&&(this.Uv=new ol(this.wt,t,this.ta,m,i),this.Uv.init())})),this.zr.schedule((()=>{o=new $a(this.wt,e,n),h=new Ma(o,this.Uv)})),this.zr.schedule((()=>{c=new Gu(this.wt,e,n),a=new ba(this.wt,c,this.ta,h),this.yt.setContext(a,h),this.Uv.setVisitorService(a)})),this.zr.schedule((()=>{C=new Wa(this.wt,new Ha(this.wt,e,r),this.ta),u=new Da(a,h,C),l=new Xa(this.wt,e,n),d=new tu(window.location,l),f=new su(d),w=new La(this.wt,a,d),b=new Qu(zt,this.wt),S=new Yu(b),R=new Ku(b),T=new Ju(b),I=new Xu,P=new Iu(S,R,T,I),_=new pu([vu.UXA]),g=new fu(_,P),y=new iu(i),E=new ru(y,_);const s=new Lu(this.wt,e,n);V=new Hu(t,s),A=new Bu(_,V);new ye(a,h,d,V,this.wt)})),this.zr.schedule((()=>{new Pa(this.wt,a,d,w,u,undefined,undefined,m).compute((n=>{this.zr.schedule((()=>{g.init();const o=new Ru,c=new Za(this.wt,_,C,h,this.ta),u=new au(this.wt,e,r),l=new uu(this.ta,window.location,u),d=new du(_,l),m=new gu(_,this.wt);const w=new wu(this.wt,a,h,undefined);if(n){this.ta.emitInitTracking();const n=new hl;new Ia(w,p,a,h,this.ta,_,g,this.wt,d,l,c,C,t,b,s,i,m,o,P,V,A,y,E,this.zr,v,e,r,this.Uv,n).start()}else{new Qa(this.ta,_,g,d,l,f,c).start()}}))}))}))}}var al,ul;!function(t){let s;const e={loadBundle(t){const r=t.source,o=t.data;if(i(o)){const i=()=>{const s=function(t,s){return csString.prototype.replace.call(csString.prototype.replace.call(csString.prototype.replace.call(t,"{version}",s.version),"{token}",s.token),"{domain}",s.domain)}("{domain}/tag/tag.bundle.js?v={version}",o);!function(t,s){const e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=t,e.onload=s,e.charset="utf-8",document.head.appendChild(e)}(s,(()=>r.postMessage("csBundleLoaded",t.origin)))};s=o.token,c(e.loadBundle),n(t.origin)&&i()}}};function i(t){return t&&"csBundleInjection"===t.type&&n(t.domain)&&o(t.version)&&r(t.token)}function n(s){return/^https?:\/\/[a-zA-Z0-9\.\-]+\.(content-square\.fr|contentsquare\.com|csq\.io)$/.test(s)||t.hjDomainRegex.test(s)}function r(t){return/^[a-zA-Z0-9]+$/.test(t)}function o(t){return/^[a-zA-Z0-9\.]+$/.test(t)}function h(t){window.addEventListener("message",t,!1)}function c(t){window.removeEventListener("message",t,!1)}t.getToken=function(){return s},t.isAuthorizedIncomingMessage=i,t.hjDomainRegex=/^https?:\/\/[a-zA-Z0-9\.\-]+\.hotjar\.com$/,t.isAuthorizedDomain=n,t.isAuthorizedToken=r,t.isAuthorizedTagVersion=o,t.isActivable=function(){const t=window.opener||window.parent;return window!==t&&window.addEventListener},t.waitForBundleInjection=function(){h(e.loadBundle)},t.listen=h,t.removeListener=c}(al||(al={})),function(t){const s=window.opener||window.parent,e=[/^https:\/\/app\.contentsquare\.com$/,/^https:\/\/dev-app\.contentsquare\.com$/,/^https:\/\/staging-app\.contentsquare\.com$/,/^https:\/\/.*\.test\.contentsquare\.com$/,/^https:\/\/app\.[a-z0-9-]+\.csiab\.[a-z0-9-]+\.csq\.io$/,al.hjDomainRegex];let i,n;const r={ping(t){if("string"==typeof t.data&&"ping"===t.data&&o(t.origin)){n=t.origin;const s=al.hjDomainRegex.test(t.origin);i=s?"https://app.contentsquare.com":t.origin,a(r.ping),c(r.insertMessageScript),h(`${"utils.js"}?cb=${(new csDate).getTime()}`)}},insertMessageScript:u((t=>{"string"==typeof t.data&&"ping"!==t.data&&(a(r.insertMessageScript),h(t.data))}))};function o(t){return csArray.prototype.some.call(e,(s=>s.test(t)))}function h(t,s){const e=document.createElement("script");e.type="text/javascript",e.async=!0;const n=null==i?void 0:csString.prototype.replace.call(i,/^https?:/,"");e.src=`${n}/tag/${t}`,e.onload=s,e.charset="utf-8",document.getElementsByTagName("head")[0].appendChild(e),function(t){csString.prototype.includes.call(t,"&mode=")&&sessionStorage.setItem("_hjRetakerMode",csString.prototype.split.call(t,"&mode=")[1])}(t)}function c(t){window.addEventListener("message",t,!1)}function a(t){window.removeEventListener("message",t,!1)}function u(t){return function(s){s.origin===n&&t(s)}}t.getToken=function(){return al.getToken()},t.isActivable=function(){return window!==s&&window.addEventListener},t.isAuthorizedDomain=o,t.waitForConnection=function(){c(r.ping),al.waitForBundleInjection()},t.listen=c,t.removeListener=a,t.secureListener=u,t.post=function(t){n&&s.postMessage(t,n)}}(ul||(ul={}));const ll=window.CSFrameCommunication||ul;class dl extends Su{constructor(t){super(),this.zr=t}emitBeforeNaturalPageView(){for(const t of this.listeners)t.onBeforeNaturalPageView&&t.onBeforeNaturalPageView()}emitAfterNaturalPageView(){for(const t of this.listeners)t.onAfterNaturalPageView&&t.onAfterNaturalPageView()}emitInitTracking(){for(const t of this.listeners)t.onInitTracking&&t.onInitTracking()}emitStartTracking(t){for(const s of this.listeners)s.onStartTracking&&this.zr.schedule((()=>s.onStartTracking(t)))}emitArtificialPageViewEnd(){for(const t of this.listeners)if(t.onArtificialPageViewEnd)try{t.onArtificialPageViewEnd()}catch(t){se.error(t)}}emitBeforeArtificialPageView(){for(const t of this.listeners)t.onBeforeArtificialPageView&&t.onBeforeArtificialPageView()}emitAfterArtificialPageView(){for(const t of this.listeners)t.onAfterArtificialPageView&&t.onAfterArtificialPageView()}emitBeforeSessionRenewal(){for(const t of this.listeners)t.onBeforeSessionRenewal&&t.onBeforeSessionRenewal()}emitAfterSessionRenewal(){for(const t of this.listeners)t.onAfterSessionRenewal&&t.onAfterSessionRenewal()}emitOptout(){for(const t of this.listeners)t.onOptout&&t.onOptout()}emitReplayUnanonymizationConsentGranted(){for(const t of this.listeners)t.onReplayUnanonymizationConsentGranted&&t.onReplayUnanonymizationConsentGranted()}emitReplayUnanonymizationConsentWithdrawn(){for(const t of this.listeners)t.onReplayUnanonymizationConsentWithdrawn&&t.onReplayUnanonymizationConsentWithdrawn()}emitAfterReplayRecordingConsentGranted(){for(const t of this.listeners)t.onAfterReplayRecordingConsentGranted&&t.onAfterReplayRecordingConsentGranted()}emitAfterReplayRecordingConsentWithdrawn(){for(const t of this.listeners)t.onAfterReplayRecordingConsentWithdrawn&&t.onAfterReplayRecordingConsentWithdrawn()}emitCollectStateChange(t,s){for(const e of this.listeners)e.onCollectStateChange&&e.onCollectStateChange(t,s)}emitInitialDomStart(){for(const t of this.listeners)t.onInitialDomStart&&t.onInitialDomStart()}emitInitialDomDone(t){for(const s of this.listeners)s.onInitialDomDone&&s.onInitialDomDone(t)}emitRecordingContextChange(){for(const t of this.listeners)t.onRecordingContextChange&&t.onRecordingContextChange()}emitSensitiveStatusChange(){var t;for(const s of this.listeners)null===(t=s.onSensitiveStatusChange)||void 0===t||t.call(s)}emitBeforeVisitorRenewal(){for(const t of this.listeners)t.onBeforeVisitorRenewal&&t.onBeforeVisitorRenewal()}emitAfterVisitorCleared(){for(const t of this.listeners)t.onAfterVisitorCleared&&t.onAfterVisitorCleared()}emitAfterVisitorRenewal(){for(const t of this.listeners)t.onAfterVisitorRenewal&&t.onAfterVisitorRenewal()}}ne([Pt("emitStartTracking")],dl.prototype,"emitStartTracking",null);class fl{constructor(t,s,e){this.wt=t,this.jt=s,this.yt=e}start(){var t,s,e,i,n;if(window.UXAnalytics)return;window.UXAnalytics={};const r=new qn(!!(null===(t=this.wt.taskSchedulerOptions)||void 0===t?void 0:t.enabled),null===(s=this.wt.taskSchedulerOptions)||void 0===s?void 0:s.maxProcessingTime,null===(e=this.wt.taskSchedulerOptions)||void 0===e?void 0:e.waitDuration),o=new le(this.jt,this.wt);o.init();const h=new de(this.wt,o);if(this.jt.isTopWindowTracker()&&h.canTrack()){if((null===(i=window.CSProtectnativeFunctionsLogs)||void 0===i?void 0:i.Warning)&&se.warn(`protectNativeFunctions failed: ${window.CSProtectnativeFunctionsLogs.Warning}`),null===(n=window.CSProtectnativeFunctionsLogs)||void 0===n?void 0:n.Critical)return void se.error(`protectNativeFunctions failed: ${window.CSProtectnativeFunctionsLogs.Critical}`);const t=new dl(r),s=new cl(this.wt,o,this.yt,r,t);this.wt.isQuotaEnabled()?s.initWithQuota():s.init()}else 0;const c=csString.prototype.indexOf.call(window.location.href,"csDebug=1")>-1;window.UXAnalytics={Sensitive:{isNodeSensitive:t=>Ye.isMaskedElement(t)||Ye.isMaskedElementChild(t),isAttributeSensitive:(t,s)=>Ye.isMaskedAttribute(t,s),getSensitiveAttributes:t=>Lt(t.attributes,(s=>Ye.isMaskedAttribute(t,s.name)))},Console:{warn(t){c&&console.warn("cs.tracking.warning",t)},error(t){c&&console.error("cs.tracking.error",t)}},Version:_s},!window.CSFrameCommunication&&ll.isActivable()&&(window.CSFrameCommunication=ll,ll.waitForConnection())}}ne([Pt("main.start"),vt("main.start")],fl.prototype,"start",null);var vl;!function(t){t.isCSJavascriptBridgeDefined=function(){return"object"==typeof window.CSJavascriptBridge&&"function"==typeof window.CSJavascriptBridge.optIn&&"function"==typeof window.CSJavascriptBridge.optOut&&"function"==typeof window.CSJavascriptBridge.sendEvent&&"function"==typeof window.CSJavascriptBridge.sendDynamicVar&&"function"==typeof window.CSJavascriptBridge.sendTransaction},t.getBridgeVersion=function(){if("function"==typeof window.CSJavascriptBridge.getVersion)try{const t=window.CSJavascriptBridge.getVersion();if(f(t))return t}catch(t){se.warn("an error occurred when calling getVersion")}return null},t.notifyIsReadyForTracking=function(){"function"==typeof window.CSJavascriptBridge.onWebviewTrackingReady&&window.CSJavascriptBridge.onWebviewTrackingReady()},t.sendAnalysisEvent=function(t){window.CSJavascriptBridge.sendEvent(csJSON.stringify(t))},t.sendSREvent=function(t){if(window.CSJavascriptBridge.sendSREvent)for(const s of t.events)window.CSJavascriptBridge.sendSREvent(csJSON.stringify(s))},t.sendLog=function(t){window.CSJavascriptBridge&&window.CSJavascriptBridge.sendLog&&window.CSJavascriptBridge.sendLog(csJSON.stringify(t))},t.sendOptIn=function(){window.CSJavascriptBridge.optIn()},t.sendOptOut=function(){window.CSJavascriptBridge.optOut()},t.sendDynamicVariable=function(t,s){window.CSJavascriptBridge.sendDynamicVar(t,s)},t.sendTransaction=function(t,s,e){window.CSJavascriptBridge.sendTransaction(t,s,e)},t.sendAssets=function(t,s){if(window.CSJavascriptBridge.sendAssets){const e=csJSON.stringify(t);window.CSJavascriptBridge.sendAssets(e,s||null)}else window.CSJavascriptBridge.sendSRAssets&&window.CSJavascriptBridge.sendSRAssets(csArray.prototype.map.call(t,(t=>t.assetId)))},t.sendNativeSREvent=function(t){window.CSJavascriptBridge&&window.CSJavascriptBridge.sendNativeSREvent&&window.CSJavascriptBridge.sendNativeSREvent(csJSON.stringify(t))}}(vl||(vl={}));class ml{constructor(){}send(t,s,e=ss.warn){const i={message:t,errorCode:s,level:e};vl.sendLog(i)}}class pl{constructor(t,s,e){this.nn=t,this.gt=s,this.ag=e,this.Gc=[],this.it=null,this.ug=Ss().v}lg(){0!==this.Gc.length&&(this.nn.send({m:csArray.prototype.map.call(this.Gc,(t=>({n:t.name,p:t.parameter,v:t.value}))),p:this.gt.anonymizePII(window.location.pathname),pid:this.ag,v:this.ug}),this.Gc=[])}push(t){csArray.prototype.push.call(this.Gc,...t),this.it&&(csClearTimeout(this.it),this.it=null),this.Gc.length>=pl.MAX_QUEUE_SIZE?this.lg():this.it=window.csSetTimeout((()=>{this.lg(),this.it=null}),pl.DEBOUNCE_INTERVAL)}}function wl(){const t=new Xt(window.CS_CONF);window._uxa=window._uxa||[],t.processOptionOverrides(window._uxa);const s=new ts(window,t);s.init();const e=new Xs;if(ft=se,ee=!0,se.computeIsActive(t.validationRate),s.isTopWindowTracker()){const s=new Us(t,e);se.setStrategy(s)}else if(s.isInIframeContext()){const s=new Js(t);se.setStrategy(s)}else if(s.isInWebViewContext()){const t=new ml;se.setStrategy(t)}At(),function(t,s){const e=t.validationRate/10,i=Qt.boolean(e);if(("staging"===t.environment||i)&&!s.isInWebViewContext())try{const e=Ou.create(se.warn,s.isTopWindowTracker()),i=new ge(e).create(t.getMetricsUri(),!0),n=new As,r=new pl(i,n,t.projectId);as.setService(r)}catch(t){se.warn(`Error initializing metrics: ${t.message}`)}}(t,s);new fl(t,s,e).start()}pl.DEBOUNCE_INTERVAL=5e3,pl.MAX_QUEUE_SIZE=100,window.CSCurrentScript=document.currentScript,csSetTimeout((()=>{try{t=wl,(null===document||void 0===document?void 0:document.prerendering)?document.addEventListener("prerenderingchange",t,{once:!0}):t()}catch{}var t}))})();