(self.webpackChunkCE2=self.webpackChunkCE2||[]).push([[544,812],{7353:function(e,t,r){"use strict";r.r(t),r.d(t,{pageState:function(){return P}});var n={tagsOfIgnoredDocHeadElements:["script","noscript"],tagsOfIgnoredDocBodyElements:["script","meta","noscript"]},s=r(477),a=r.n(s);function o(){return a()('/*! For license information please see diff.worker.worker.js.LICENSE.txt */\n!function(){var e={342:function(){!function(e){var t=e.CE2BH={};function n(){return t.extends=n=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(s[n]=e[n]);return s}}("undefined"==typeof window?self:window)}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}!function(){"use strict";n(342);function e(){if(!(this instanceof e))return new e;this.boundary=`------RWWorkerFormDataBoundary${Math.random().toString(36)}`;const t=this.data=[];this.__append=function(e){let n,r=0;if("string"==typeof e)for(n=e.length;r=500&&e.status<600}function s(e,n,i,a){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;const u=new XMLHttpRequest;u.onreadystatechange=function(){u.readyState==XMLHttpRequest.DONE&&(r(u)&&o<5?setTimeout((()=>{s(e,n,i,a,o+1)}),1e3):r(u)?a(u.status?u:{status:"network-error"}):i(u))},u.open("POST",e,!0),n instanceof t&&(n.__endedMultipart||n.__append(`--${n.boundary}--\\r\\n`),n.__endedMultipart=!0,u.setRequestHeader("Content-type",`multipart/form-data; boundary=${n.boundary}`),n=new Uint8Array(n.data)),u.send(n)}var i={post:function(e,t,n,r){return s(e,t,n,r)},get(e,t){const n={};return t&&(n.Authorization=`Bearer ${t}`),function(e,t){return Promise.race([fetch(e,t),new Promise(((e,t)=>setTimeout((()=>t(new Error("timeout"))),1e4)))])}(e,{method:"GET",mode:"cors",headers:n})}},a=["a","c","n","ns","p","t","i"];let o=!1;let u,p,d,f={},l=[],c=[];function g(){if(p)return;let e=c.shift();e&&function(e){const{splitResult:n,timestamp:r,visitID:s,apiHost:o}=e;let l=f[n.page_url];const c=()=>{h({type:"success",state:e})},g=m(n);if(g)!l||l.md5===n.md5&&u===s||(n.debug.push(`PageState upload skipped existing on capturer ${n.page_url} ${n.md5}`),n.prefix=g.prefix,c());else{p=!0;let r=n.content;if(l){const t=(y=l.content,b=r,jsondiffpatch.create({cloneDiffValues:!0}).diff(self.JSON.parse(y),self.JSON.parse(b)));try{const n=jsondiffpatch.create({cloneDiffValues:!0}).patch(self.JSON.parse(l.content),self.JSON.parse(self.JSON.stringify(t)));e.valid=md5(self.JSON.stringify(n,a)).toString()}catch(t){n.debug.push(`verification of diff failed: ${n.md5} : ${t.message}`),e.valid="error"}e.valid!==n.md5?(r=n.content,l=void 0):r=self.JSON.stringify(t)}const s=CE2libs.compress(r),u=t=>{const n=t.status?`Unexpected status ${t.status}`:t.message;h({type:"error",error:{status:t.status||"error",resource:"api",message:n},state:e})},f=t=>{const n=t.status?`Unexpected status ${t.status}`:t.message;h({type:"error",error:{status:t.status||"error",resource:"s3",message:n},state:e})};if("TESTMODE"===o)return c();i.post(function(e,t,n,r){let s=`${e}/page-states?md5=${t.md5}&url=${t.page_url}&uid=${t.uid}&tk=${d}`;n&&(s+=`&parent_md5=${n.md5}`);void 0!==r&&(s+=`&valid=${r}`);return s}(o,n,l),null,(e=>{try{if(200===e.status&&e.responseText){const r=JSON.parse(e.responseText);if(n.prefix=r.prefix,r.url){const e=new t;for(let t=0,n=Object.entries(r.fields);t{204===e.status?(n.debug.push(`PageState upload new ${n.page_url} ${n.md5}`),c()):f(e)}),f)}else n.debug.push(`PageState upload skipped existing on s3 ${n.page_url} ${n.md5}`),c()}else u(e)}catch(e){u(e)}}),u)}var y,b}(e)}function m(e){for(let t=0,n=l;t100&&(l=l.slice(1)),m(e)||l.push({page_url:e.page_url,md5:e.md5,prefix:e.prefix})}(t),u=r,f[i]=t,postMessage({type:"success",state:c})):"error"===e.type&&postMessage({type:"error",error:e.error,state:c}),p=!1,setTimeout(g,1)}self.onmessage=e=>{if(!o&&e.data.initialize)return self.importScripts(e.data.initialize.thirdPartyScriptUrl),"undefined"==typeof md5&&(self.md5=CryptoJS.MD5),o=!0,void(d=e.data.initialize.trackingKey);c.push(e.data),g()}}()}();',"Worker",void 0,void 0)}function i(){return a()('/*! For license information please see state.worker.worker.js.LICENSE.txt */\n!function(){var e={342:function(){!function(e){var t=e.CE2BH={};function r(){return t.extends=r=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(s[r]=e[r]);return s}}("undefined"==typeof window?self:window)}},t={};function r(a){var s=t[a];if(void 0!==s)return s.exports;var o=t[a]={exports:{}};return e[a](o,o.exports,r),o.exports}!function(){"use strict";r(342);const e=["class"],t={a:["href","target"],area:["coords","shape","type","target","alt","href","hreflang","media","rel"],audio:["controls","autoplay","loop","muted","src","preload"],base:["href","target"],bdo:["dir"],blockquote:["cite"],button:["type","value"],col:["span"],colgroup:["span"],data:["value"],del:["cite","datetime"],details:["open"],dialog:["open"],embed:["src","type"],iframe:["src","sandbox","srcdoc"],img:["src","alt","srcset","sizes","crossorigin"],input:["type","name","value","checked","src"],ins:["cite","datetime"],label:["for"],li:["value"],max:["value","high","low","optimum","max","min"],meta:["name","content","charset","http-equiv"],object:["data"],ol:["type","start","reversed"],optgroup:["label"],option:["value","selected","label"],progress:["value","max"],select:["value"],source:["src","type","srcset","media","sizes"],td:["colspan","rowspan","headers"],textarea:["name","cols","rows","wrap"],th:["colspan","rowspan","scope","sorted","abbr","headers"],time:["datetime"],video:["controls","autoplay","loop","muted","poster","src","preload"],style:["media","type"],link:["rel","href","media","crossorigin","referrerpolicy"]};function a(r){let a=t[r]||[];return"style"===r||"link"===r?a:e.concat(a)}var s={a:0,address:1,area:2,article:3,aside:4,audio:5,base:6,bdi:7,bdo:8,blockquote:9,body:10,button:11,canvas:12,caption:13,cite:14,col:15,colgroup:16,data:17,datalist:18,dd:19,del:20,details:21,dfn:22,dialog:23,div:24,dl:25,dt:26,em:27,embed:28,fieldset:29,figure:30,footer:31,form:32,h1:33,h2:34,h3:35,h4:36,h5:37,h6:38,head:39,header:40,hgroup:41,hr:42,i:43,iframe:44,input:45,ins:46,keygen:47,label:48,legend:49,li:50,link:51,main:52,map:53,mark:54,menu:55,menuitem:56,meta:57,meter:58,nav:59,noscript:60,object:61,ol:62,optgroup:63,option:64,output:65,param:66,pre:67,progress:68,q:69,rb:70,rp:71,rt:72,rtc:73,ruby:74,s:75,script:76,section:77,select:78,small:79,source:80,span:81,strong:82,style:83,sub:84,summary:85,sup:86,table:87,tbody:88,td:89,template:90,textarea:91,tfoot:92,th:93,thead:94,time:95,tr:96,track:97,u:98,ul:99,var:100,video:101,html:102,"#shadowroot":103},o=["a","c","n","ns","p","t","i"];class n{constructor(e){this._state=e}process(){const e=this.convertToFiles();return{md5:this.calculateMD5(e),pathMd5:this.calculateMD5(this._state.path),content:e}}convertToFiles(){return this._getHtmlObject()}calculateMD5(e){return md5(e)}handleUrlProps(e,t,r){return t&&0===t.indexOf("data:")&&"img"===r?`/data-urls/${t.length}`:t}_handleElmCss(e){let t=e.t,r="";if("text"===e.t)return{p:e.p};{r=[];const o=[],n=[];let l=a(t),i=null;l.forEach(((a,s)=>{void 0!==e.p[a]?(i=null,/^javascript:/i.test(e.p[a].value)||r.push(this.handleUrlProps(a,e.p[a].value,t))):(null===i&&(i=s),r.push("_"))})),null!==i&&(r=r.slice(0,i)),"style"!==t&&"link"!==t&&Object.keys(e.p).forEach((r=>{-1!==l.indexOf(r)||"data-ce-key"===r||/^on/i.test(r)||/^javascript:/i.test(e.p[r].value)||(e.p[r].ns?n.push(`${e.p[r].ns}=${r}=${e.p[r].value}`):o.push(`${r}=${this.handleUrlProps(r,e.p[r].value,t)}`))}));const c={t:void 0===s[t]?t:s[t]};return r&&r.length>0&&(c.p=r),o&&o.length>0&&(c.a=o),n&&n.length>0&&(c.ns=n),e.ns&&(c.n=e.ns),e.i&&(c.i=e.i),c}}_recursiveWalk(e){let t;return t=this._handleElmCss(e),e.c&&e.c.length>0&&(t.c=e.c.map((e=>this._recursiveWalk(e)))),t}_getHtmlObject(){let e=this._recursiveWalk(this._state.html);return self.JSON.stringify(e,o)}}let l=!1;self.onmessage=e=>{if(!l&&e.data.initialize)return self.importScripts(e.data.initialize.thirdPartyScriptUrl),"undefined"==typeof md5&&(self.md5=CryptoJS.MD5),void(l=!0);const{state:t}=e.data;let r=new n(t).process();postMessage(r)}}()}();',"Worker",void 0,void 0)}var l=["top","left","right","bottom","display","visibility","position","margin","float","padding","border","borderStyle","borderWidth","zIndex","clear","tableLayout","transform","order","grid","gridArea","gridAutoColumns","gridAutoFlow","gridAutoRows","gridColumn","gridColumnEnd","gridColumnGap","gridColumnStart","gridGap","gridRow","gridRowEnd","gridRowGap","gridRowStart","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","flex","flexBasis","flexDirection","flexFlow","flexGrow","flexShrink","flexWrap","justifyContent","alignItems","alignContent","alignSelf","verticalAlign"];function c(e,t){if("undefined"==typeof CE_DEBUG||!CE_DEBUG)return!1;let r;r="string"==typeof e?`CE: ${e}`:e;const n=[r];t&&n.push(t),window.console&&window.console.log&&console.log(...n)}function d(e,t){if(!("undefined"!=typeof CE_DEBUG&&CE_DEBUG>=2))return!1;c(e,t)}function u(e,t,r){let n;r&&(t+=`,${t} *`);const s=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;if(s)return s.call(e,t);const a=(e.getRootNode&&e.getRootNode()||e.document||e.ownerDocument).querySelectorAll(t);for(n=a.length;n>=0&&a.item(n)!==e;n--);return n>-1}let p;const h=1,f=3,m=8;function g(e,t){if(!e[t])throw new Error(`Missing required option ${t}`);return e[t]}class y{constructor(e){this._isHead=!1,this._apiHost="undefined"!=typeof CE_TEST_MODE&&CE_TEST_MODE?"TESTMODE":g(e,"trackURL"),this._uid=g(e,"uid"),this._getVisitId=g(e,"getVisitId"),this._getUrl=g(e,"getUrl"),this._onPageStateError=g(e,"onPageStateError"),this._onPageState=g(e,"onPageState"),this._thirdPartyScriptUrl=e.thirdPartyScriptUrl||CE_USER_THIRDPARTY_SCRIPT_URL,this._censoredElements=(e.censoredElements||[]).join(","),this._hideIframes=e.hideIframes,this._disableMasking=e.disableMasking,this._disableEmailMasking=e.disableEmailMasking,this._stylesheetPerformance=e.stylesheetPerformance,this._diffWorker=new o,this._diffWorker.postMessage({initialize:{thirdPartyScriptUrl:this._thirdPartyScriptUrl,trackingKey:CE2.data.tracking_key}}),this._pageStateWorker=new i,this._pageStateWorker.postMessage({initialize:{thirdPartyScriptUrl:this._thirdPartyScriptUrl}}),document.ce_count||(document.ce_count=1),document.ceIds||(document.ceIds=new WeakMap)}shouldIgnoreElm(e){return e.nodeType===m||e.nodeType!==f&&(e.nodeType!==h||"HEAD"!==e.tagName&&(!!(this._isHead&&n.tagsOfIgnoredDocHeadElements&&n.tagsOfIgnoredDocHeadElements.indexOf(e.tagName.toLowerCase())>-1||!this._isHead&&n.tagsOfIgnoredDocBodyElements&&n.tagsOfIgnoredDocBodyElements.indexOf(e.tagName.toLowerCase())>-1)||("META"===e.tagName?"viewport"!==e.name&&!e.getAttribute("charset"):"LINK"===e.tagName&&!(e.rel&&e.rel.match&&e.rel.match(/stylesheet/i)))))}handleTextNode(e){let t;return t=this._disableMasking||this._disableEmailMasking?e.nodeValue:e.nodeValue&&e.nodeValue.replace(/\b([a-zA-Z0-9_\-\.]+)@(([a-zA-Z0-9]+)(\.([a-zA-Z]{2,5})){1,2})\b/g,((e,t,r)=>t.replace(/./g,"*")+"@"+r.replace(/./g,"*"))),{t:"text",p:t}}nodeNamespace(e){return"http://www.w3.org/1999/xhtml"!==e.namespaceURI?e.namespaceURI:null}cleanup(){this._diffWorker.terminate(),this._pageStateWorker.terminate()}_handleElm(e,t){if(e.nodeType===f)return this.handleTextNode(e);if(t)return{t:"#shadowroot",p:{}};const r=this.nodeNamespace(e),n={t:r?e.tagName:e.tagName.toLowerCase(),p:{},ns:r};for(let t=0;t-1&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS")}hasFullShadowrootSupport(){if(void 0!==p||this.isSafari()){if(void 0===p){const e=(new DOMParser).parseFromString("","text/html"),t=e.createElement("style");t.textContent=":host(.example) { color: black; }",e.getElementsByTagName("head")[0].appendChild(t),p=":host(.example) { color: black; }"===t.sheet.rules[0].cssText}}else p=!0;return p}getSheetText(e,t,r){const n=e;if(n.ce_cacheCss)return n.ce_cacheCss;if(r&&"STYLE"===r.tagName&&t&&!this.hasFullShadowrootSupport())return r.textContent;const s=[];if(e)for(let t=0,r=e.cssRules;t0){r.c||(r.c=[]);for(let e=0;e0))for(let t=0,n=e.adoptedStyleSheets;t{if("error"===e.data.type)this._onPageStateError(e.data);else if("success"===e.data.type){const{page_url:t,prefix:r,md5:n,timestamp:s,visitID:a,debug:o,valid:i}=e.data.state;for(let e=0;e{const s=CE2BH.extends(e.data,{page_url:a,uid:t,debug:[]});this.startDiffWorkerQueue(s,n,r)}}catch(e){this._onPageStateError(e)}}}const v=[];function _(e){window.ce_styleSheetOverridden||"undefined"!=typeof CSSStyleSheet&&(["insertRule","addRule","deleteRule","removeRule"].forEach((e=>{const t=CSSStyleSheet.prototype[e];t&&(CSSStyleSheet.prototype[e]=function(){return b(this,e),t.apply(this,arguments)})})),window.ce_styleSheetOverridden=!0),v.push(e)}function b(e,t){v.forEach((r=>{r(e,t)}))}const w={},E=700;let S,x,k,C,A={};function O(e){A[e.type]=!0}function T(e){let{key:t,ctrlKey:r,altKey:n,metaKey:s}=e;const a=function(e){const t=e.composedPath&&e.composedPath();let{target:r}=e;return r.shadowRoot&&t&&t.length>0&&([r]=t),r}(e);(u(a,"[ce-dont-mask]",!0)||"INPUT"!==a.tagName&&"TEXTAREA"!==a.tagName||r||n||s||"Enter"===t||"Tab"===t)&&O(e)}w.startCapture=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};A={},!this._stylesheetPerformance&&e.stylesheetPerformance&&(this._stylesheetPerformance=!0,_((e=>{delete e.ce_cacheCss}))),k||(k=new y(e),d("PageState started new capturer")),k.capture(),window.addEventListener("mousedown",O,!0),window.addEventListener("keydown",T,!0),window.addEventListener("mousemove",O,!0),window.addEventListener("scroll",O,!0),x=new MutationObserver((e=>{O({type:"dom"})})),x.observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0});const t=()=>{const{mousedown:e,keydown:r,mousemove:n,scroll:s,dom:a}=A;let o=C!==k._getVisitId();o&&(C=k._getVisitId()),o||e||r||a&&(s||n)?(k.capture(),A={}):A.scroll=A.mousemove=!1,S=setTimeout(t,E)};S=setTimeout(t,E)},w.stopCapture=function(){S&&clearTimeout(S),x&&x.disconnect(),k.cleanup(),S=null,x=null,k=null,window.removeEventListener("mousedown",O,!0),window.removeEventListener("keydown",T,!0),window.removeEventListener("mousemove",O,!0),window.removeEventListener("scroll",O,!0)};var P=w},477:function(e){"use strict";e.exports=function(e,t,r,n){var s=self||window;try{try{var a;try{a=new s.Blob([e])}catch(t){(a=new(s.BlobBuilder||s.WebKitBlobBuilder||s.MozBlobBuilder||s.MSBlobBuilder)).append(e),a=a.getBlob()}var o=s.URL||s.webkitURL,i=o.createObjectURL(a),l=new s[t](i,r);return o.revokeObjectURL(i),l}catch(n){return new s[t]("data:application/javascript,".concat(encodeURIComponent(e)),r)}}catch(e){if(!n)throw Error("Inline worker is not supported");return new s[t](n,r)}}}},function(e){var t,r=(t=7353,e(e.s=t)),n=CE2="undefined"==typeof CE2?{}:CE2;for(var s in r)n[s]=r[s];r.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})}]);