zipy-for-rd
Version:
SDK for zipy
2 lines • 192 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).zipyForRd={})}(this,function(e){var t,n,r;!function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.ReplayerEvent=11]="ReplayerEvent",e[e.ConsoleInfo=50]="ConsoleInfo",e[e.ConsoleError=51]="ConsoleError",e[e.ConsoleWarning=52]="ConsoleWarning",e[e.ConsoleDebug=53]="ConsoleDebug",e[e.Error=70]="Error",e[e.RangeError=71]="RangeError",e[e.ReferenceError=72]="ReferenceError",e[e.TypeError=73]="TypeError",e[e.SyntaxError=74]="SyntaxError",e[e.URIError=75]="URIError",e[e.EvalError=76]="EvalError",e[e.UnhandledRejection=77]="UnhandledRejection",e[e.BROWSERDATA=100]="BROWSERDATA",e[e.NAVIGATION=101]="NAVIGATION",e[e.Online=102]="Online",e[e.Offline=103]="Offline",e[e.XHR=104]="XHR",e[e.WSOPEN=105]="WSOPEN",e[e.WSCLOSE=106]="WSCLOSE",e[e.WSMESSAGE=107]="WSMESSAGE",e[e.WSERROR=108]="WSERROR",e[e.Fonts=109]="Fonts",e[e.Link=110]="Link",e[e.Css=111]="Css",e[e.Image=112]="Image",e[e.Js=113]="Js",e[e.Media=114]="Media",e[e.ZipyLogMessage=115]="ZipyLogMessage",e[e.ZipyLogException=116]="ZipyLogException",e[e.ZipyLogFrontendError=117]="ZipyLogFrontendError",e[e.ZipyLogNetworkError=118]="ZipyLogNetworkError",e[e.Performance=119]="Performance",e[e.PerfNavigation=120]="PerfNavigation",e[e.OtherNetworkCall=121]="OtherNetworkCall",e[e.WebVitals=122]="WebVitals",e[e.NavigationStart=123]="NavigationStart",e[e.DEBUG_INFO=124]="DEBUG_INFO",e[e.CustomEvent=125]="CustomEvent"}(t||(t={})),function(e){e[e.MESSAGESEND=0]="MESSAGESEND",e[e.MESSAGERECEIVED=1]="MESSAGERECEIVED",e[e.SOCKETCLOSE=2]="SOCKETCLOSE",e[e.SOCKETERROR=3]="SOCKETERROR",e[e.SOCKETOPEN=4]="SOCKETOPEN"}(n||(n={})),function(e){e[e.ELEMENT=0]="ELEMENT",e[e.EVENT=1]="EVENT",e[e.FIRST_INPUT=2]="FIRST_INPUT",e[e.LARGEST_CONTENTFUL_PAINT=3]="LARGEST_CONTENTFUL_PAINT",e[e.LAYOUT_SHIFT=4]="LAYOUT_SHIFT",e[e.LONGTASK=5]="LONGTASK",e[e.MARK=6]="MARK",e[e.MEASURE=7]="MEASURE",e[e.NAVIGATION=8]="NAVIGATION",e[e.PAINT=9]="PAINT",e[e.RESOURCE=10]="RESOURCE"}(r||(r={}));var o,i,a,s="zipy",c="rrweb";!function(e){e[e.POSTENDUSERINFOANDGETUSERCONFIG=0]="POSTENDUSERINFOANDGETUSERCONFIG",e[e.POSTENDUSERINFO=1]="POSTENDUSERINFO",e[e.GETUSERCONFIG=2]="GETUSERCONFIG"}(o||(o={})),function(e){e[e.ANONYMS=0]="ANONYMS",e[e.IDENTIFIED=1]="IDENTIFIED"}(i||(i={})),function(e){e[e.NORECORDING=0]="NORECORDING",e[e.RECORDINGPENDING=1]="RECORDINGPENDING",e[e.RECORDINGSUCCESSFUL=2]="RECORDINGSUCCESSFUL"}(a||(a={}));var l,u,d,p,f="logEvent",g="exceptionEvent",h="errorEvent",m=1024,v="startIframeRecording",y="stopIframeRecording",w="iframeContentLoaded";(p=l||(l={})).DEBUG="1",p.WARNING="2",p.ERROR="3",p.LOG="4",function(e){e[e.BLOCKING=0]="BLOCKING",e[e.NON_BLOCKING=1]="NON_BLOCKING"}(u||(u={})),function(e){e.session_data="_zsession-data",e.total_data_sent="_ztotal-data-sent",e.enduser_last_activity_time="_zenduser-last-activity-time",e.last_activity_time="_zlast-activity-time",e.utms="_utms"}(d||(d={}));var I,S=/^(?!-)[A-Za-z0-9-]+([\-\.]{1}[a-z0-9]+)*\.[A-Za-z]{2,6}$/,C=/^(https?|ftp):\/\/(([a-z\d]([a-z\d-]*[a-z\d])?\.)+[a-z]{2,}|localhost)(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?(\#[-a-z\d_]*)?$/i,E=499;!function(e){e[e.FCP=0]="FCP",e[e.FP=1]="FP",e[e.FID=2]="FID",e[e.CLS=3]="CLS",e[e.LCP=4]="LCP"}(I||(I={}));var b,k,A,T={"Content-Type":"application/json","Content-Encoding":"gzip"};!function(e){e.INIT="init",e.REINIT="reinit",e.PAGE_OUT="pageout"}(b||(b={})),function(e){e.PAGELOAD="pageload",e.VISIBLE="visibility visible",e.HIDDEN="visibility hidden",e.IDENTIFY="identify",e.ANONYMIZE="anonymize",e.STREAMDATARECORDINGPAUSE="streamdata recording paused",e.STREAMDATAEXPIRE="streamdata session expired",e.NA=""}(k||(k={})),function(e){e[e.IDLE=0]="IDLE",e[e.PENDING=1]="PENDING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILED=3]="FAILED"}(A||(A={}));var N,R=["utm_source","utm_medium","utm_term","utm_content","utm_campaign"];!function(e){e[e.STOP=0]="STOP",e[e.START=1]="START"}(N||(N={}));var O,z={streamMgrUrl:"https://services.zipy.ai/sdk-session-manager/v2/enduser-info",registerSessionUrl:"https://services.zipy.ai/sdk-session-manager/v1/register-sdk-session",sdkVersion:"1.0.37",errorUrl:"divolte.collector",streamMgrRetryCount:5,zipyDeploymentEnviornment:"Production",sdkLoopTime:1e3,perfLoopTime:5e3,ignoreEmptyErros:!0,ignoreLargeResponse:!0,debugLogs:!1,sessionLinkUrl:"https://app.zipy.ai",isNPM:!0,streamMgrRetryDelay:5e3},M=!1;function D(e){M&&console.info(s,e)}function x(e){M&&console.debug(s,e)}function U(e){M&&console.log(s,e)}function L(e){M&&console.error(s,e)}function P(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function F(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function G(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(_).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function _(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=G(e.styleSheet)||t}catch(e){}return t}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(O||(O={}));var B=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function W(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.maskInputFn,i=e.value||"",a=r&&r.toLowerCase();return(t[n.toLowerCase()]||a&&t[a])&&(i=o?o(i):"*".repeat(i.length)),i}var Z,V,q="__rrweb_original__",K=1,J=new RegExp("[^a-z0-9-_:]"),H=-2;function j(){return K++}var Y=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,X=/^(?:[a-z+]+:)?\/\//i,Q=/^www\..*/i,$=/^(data:)([^,]*),(.*)/i;function ee(e,t){return(e||"").replace(Y,function(e,n,r,o,i,a){var s,c=r||i||a,l=n||o||"";if(!c)return e;if(X.test(c)||Q.test(c))return"url(".concat(l).concat(c).concat(l,")");if($.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var p=0,f=d;p<f.length;p++){var g=f[p];"."!==g&&(".."===g?u.pop():u.push(g))}return"url(".concat(l).concat(u.join("/")).concat(l,")")})}var te=/^[^ \t\n\r\u000c]+/,ne=/^[, \t\n\r\u000c]+/;function re(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function oe(){var e=document.createElement("a");return e.href="",e.href}function ie(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?re(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(n+=(r=o[0]).length,r):""}for(var o=[];r(ne),!(n>=t.length);){var i=r(te);if(","===i.slice(-1))i=re(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=re(e,i);for(var s=!1;;){var c=t.charAt(n);if(""===c){o.push((i+a).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){n+=1,o.push((i+a).trim());break}"("===c&&(s=!0)}a+=c,n+=1}}}return o.join(", ")}(e,r):"style"===n?ee(r,oe()):"object"===t&&"data"===n?re(e,r):r:re(e,r):r}function ae(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function se(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&se(e.parentNode,t,n);for(var r=e.classList.length;r--;)if(t.test(e.classList[r]))return!0;return!!n&&se(e.parentNode,t,n)}function ce(e,t,n,r){var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if(r)return!0;if("string"==typeof t){if(o.classList.contains(t))return!0;if(o.closest(".".concat(t)))return!0}else if(se(o,t,!0))return!0;if(n){if(o.matches(n))return!0;if(o.closest(n))return!0}return!1}function le(e){return null==e?"":e.toLowerCase()}function ue(e,t){var n,r=t.doc,o=t.mirror,i=t.blockClass,a=t.blockSelector,s=t.maskTextClass,c=t.maskTextSelector,l=t.skipChild,u=void 0!==l&&l,d=t.inlineStylesheet,p=void 0===d||d,f=t.maskInputOptions,g=void 0===f?{}:f,h=t.maskTextFn,m=t.maskInputFn,v=t.slimDOMOptions,y=t.dataURLOptions,w=void 0===y?{}:y,I=t.inlineImages,S=void 0!==I&&I,C=t.recordCanvas,E=void 0!==C&&C,b=t.onSerialize,k=t.onIframeLoad,A=t.iframeLoadTimeout,T=void 0===A?5e3:A,N=t.onStylesheetLoad,R=t.stylesheetLoadTimeout,z=void 0===R?5e3:R,M=t.keepIframeSrcFn,D=void 0===M?function(){return!1}:M,x=t.newlyAddedElement,U=t.maskAllText,L=void 0!==U&&U,_=t.preserveWhiteSpace,B=void 0===_||_,K=function(e,t){var n=t.doc,r=t.blockClass,o=t.blockSelector,i=t.maskTextClass,a=t.maskTextSelector,s=t.inlineStylesheet,c=t.maskInputOptions,l=void 0===c?{}:c,u=t.maskTextFn,d=t.maskInputFn,p=t.dataURLOptions,f=void 0===p?{}:p,g=t.inlineImages,h=t.recordCanvas,m=t.keepIframeSrcFn,v=t.newlyAddedElement,y=void 0!==v&&v,w=t.maskAllText,I=void 0!==w&&w,S=function(e,t){if(t.hasNode(e)){var n=t.getId(e);return 1===n?void 0:n}}(n,t.mirror);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:O.Document,childNodes:[],compatMode:e.compatMode}:{type:O.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:O.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,r=t.inlineStylesheet,o=t.maskInputOptions,i=void 0===o?{}:o,a=t.maskInputFn,s=t.dataURLOptions,c=void 0===s?{}:s,l=t.inlineImages,u=t.recordCanvas,d=t.keepIframeSrcFn,p=t.newlyAddedElement,f=void 0!==p&&p,g=t.rootId,h=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;)if(t.test(e.classList[r]))return!0;return!!n&&e.matches(n)}(e,t.blockClass,t.blockSelector),m=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return J.test(t)?"div":t}(e),v={},y=e.attributes.length,w=0;w<y;w++){var I=e.attributes[w];ae(m,I.name)||(v[I.name]=ie(n,m,I.name,I.value))}if("link"===m&&r){var S=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),C=null;S&&(C=G(S)),C&&(delete v.rel,delete v.href,v._cssText=ee(C,S.href))}if("style"===m&&e.sheet&&!(e.innerText||e.textContent||"").trim().length&&(C=G(e.sheet))&&(v._cssText=ee(C,oe())),"input"===m||"textarea"===m||"select"===m){var E=e.value,b=e.checked;if("radio"!==v.type&&"checkbox"!==v.type&&"submit"!==v.type&&"button"!==v.type&&E){var k=e.hasAttribute("data-rr-is-password")?"password":"string"==typeof v.type?v.type.toLowerCase():null;v.value=W({type:k,tagName:m,value:E,maskInputOptions:i,maskInputFn:a})}else b&&(v.checked=b)}if("option"===m&&(e.selected&&!i.select?v.selected=!0:delete v.selected),"canvas"===m&&u)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData;if(new Uint32Array((q in o?o[q]:o).call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(function(e){return 0!==e}))return!1}return!0})(e)||(v.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var A=e.toDataURL(c.type,c.quality),T=document.createElement("canvas");T.width=e.width,T.height=e.height,A!==T.toDataURL(c.type,c.quality)&&(v.rr_dataURL=A)}if("img"===m&&l){Z||(Z=n.createElement("canvas"),V=Z.getContext("2d"));var N=e,R=N.crossOrigin;N.crossOrigin="anonymous";var z=function(){N.removeEventListener("load",z);try{Z.width=N.naturalWidth,Z.height=N.naturalHeight,V.drawImage(N,0,0),v.rr_dataURL=Z.toDataURL(c.type,c.quality)}catch(e){console.warn("Cannot inline img src=".concat(N.currentSrc,"! Error: ").concat(e))}R?v.crossOrigin=R:N.removeAttribute("crossorigin")};N.complete&&0!==N.naturalWidth?z():N.addEventListener("load",z)}if("audio"!==m&&"video"!==m||(v.rr_mediaState=e.paused?"paused":"played",v.rr_mediaCurrentTime=e.currentTime),f||(e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop)),h){var M=e.getBoundingClientRect(),D=M.height;v={class:v.class,rr_width:"".concat(M.width,"px"),rr_height:"".concat(D,"px")}}return"iframe"!==m||d(v.src)||(e.contentDocument||(v.rr_src=v.src),delete v.src),{type:O.Element,tagName:m,attributes:v,childNodes:[],isSVG:(x=e,Boolean("svg"===x.tagName||x.ownerSVGElement)||void 0),needBlock:h,rootId:g};var x}(e,{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:s,maskInputOptions:l,maskInputFn:d,dataURLOptions:f,inlineImages:g,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:y,rootId:S});case e.TEXT_NODE:return function(e,t){var n,r,o=t.maskTextClass,i=t.maskTextSelector,a=t.maskTextFn,s=t.rootId,c=t.maskAllText,l=e.parentNode&&e.parentNode.tagName,u=e.textContent,d="STYLE"===l||void 0,p="SCRIPT"===l||void 0;if(d&&u){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(u=(r=e.parentNode.sheet).cssRules?Array.from(r.cssRules).map(function(e){return e.cssText||""}).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}u=ee(u,oe())}return p&&(u="SCRIPT_PLACEHOLDER"),!d&&!p&&u&&ce(e,o,i,c)&&(u=a?a(u):u.replace(/[\S]/g,"*")),{type:O.Text,textContent:u||"",isStyle:d,rootId:s}}(e,{maskTextClass:i,maskTextSelector:a,maskTextFn:u,rootId:S,maskAllText:I});case e.CDATA_SECTION_NODE:return{type:O.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:O.Comment,textContent:e.textContent||"",rootId:S};default:return!1}}(e,{doc:r,mirror:o,blockClass:i,blockSelector:a,maskTextClass:s,maskTextSelector:c,inlineStylesheet:p,maskInputOptions:g,maskTextFn:h,maskInputFn:m,dataURLOptions:w,inlineImages:S,recordCanvas:E,keepIframeSrcFn:D,newlyAddedElement:void 0!==x&&x,maskAllText:L});if(!K)return console.warn(e,"not serialized"),null;n=o.hasNode(e)?o.getId(e):!function(e,t){if(t.comment&&e.type===O.Comment)return!0;if(e.type===O.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(le(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===le(e.attributes.name)||"icon"===le(e.attributes.rel)||"apple-touch-icon"===le(e.attributes.rel)||"shortcut icon"===le(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&le(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(le(e.attributes.property).match(/^(og|twitter|fb):/)||le(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===le(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===le(e.attributes.name)||"googlebot"===le(e.attributes.name)||"bingbot"===le(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===le(e.attributes.name)||"generator"===le(e.attributes.name)||"framework"===le(e.attributes.name)||"publisher"===le(e.attributes.name)||"progid"===le(e.attributes.name)||le(e.attributes.property).match(/^article:/)||le(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===le(e.attributes.name)||"yandex-verification"===le(e.attributes.name)||"csrf-token"===le(e.attributes.name)||"p:domain_verify"===le(e.attributes.name)||"verify-v1"===le(e.attributes.name)||"verification"===le(e.attributes.name)||"shopify-checkout-api-token"===le(e.attributes.name)))return!0}}return!1}(K,v)&&(B||K.type!==O.Text||K.isStyle||K.textContent.replace(/^\s+|\s+$/gm,"").length)?j():H;var Y=Object.assign(K,{id:n});if(o.add(e,Y),n===H)return null;b&&b(e);var X=!u;if(Y.type===O.Element){X=X&&!Y.needBlock,delete Y.needBlock;var Q=e.shadowRoot;Q&&F(Q)&&(Y.isShadowHost=!0)}if((Y.type===O.Document||Y.type===O.Element)&&X){v.headWhitespace&&Y.type===O.Element&&"head"===Y.tagName&&(B=!1);for(var $={doc:r,mirror:o,blockClass:i,blockSelector:a,maskTextClass:s,maskTextSelector:c,skipChild:u,inlineStylesheet:p,maskInputOptions:g,maskTextFn:h,maskInputFn:m,slimDOMOptions:v,dataURLOptions:w,inlineImages:S,recordCanvas:E,preserveWhiteSpace:B,onSerialize:b,onIframeLoad:k,iframeLoadTimeout:T,onStylesheetLoad:N,stylesheetLoadTimeout:z,keepIframeSrcFn:D,maskAllText:L},te=0,ne=Array.from(e.childNodes);te<ne.length;te++)(de=ue(ne[te],$))&&Y.childNodes.push(de);if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var re=0,se=Array.from(e.shadowRoot.childNodes);re<se.length;re++){var de;(de=ue(se[re],$))&&(F(e.shadowRoot)&&(de.isShadow=!0),Y.childNodes.push(de))}}return e.parentNode&&P(e.parentNode)&&F(e.parentNode)&&(Y.isShadow=!0),Y.type===O.Element&&"iframe"===Y.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,i=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener("load",function(){clearTimeout(s),i=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&k){var n=ue(t,{doc:t,mirror:o,blockClass:i,blockSelector:a,maskTextClass:s,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:h,maskInputFn:m,slimDOMOptions:v,dataURLOptions:w,inlineImages:S,recordCanvas:E,preserveWhiteSpace:B,onSerialize:b,onIframeLoad:k,iframeLoadTimeout:T,onStylesheetLoad:N,stylesheetLoadTimeout:z,keepIframeSrcFn:D,maskAllText:L});n&&k(e,n)}},T),Y.type===O.Element&&"link"===Y.tagName&&"stylesheet"===Y.attributes.rel&&function(e,t,n){var r,o=!1;try{r=e.sheet}catch(e){return}if(!r){var i=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(i),o=!0,t()})}}(e,function(){if(N){var t=ue(e,{doc:r,mirror:o,blockClass:i,blockSelector:a,maskTextClass:s,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:h,maskInputFn:m,slimDOMOptions:v,dataURLOptions:w,inlineImages:S,recordCanvas:E,preserveWhiteSpace:B,onSerialize:b,onIframeLoad:k,iframeLoadTimeout:T,onStylesheetLoad:N,stylesheetLoadTimeout:z,keepIframeSrcFn:D,maskAllText:L});t&&N(e,t)}},z),Y}function de(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const pe="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let fe={map:{},getId:()=>(console.error(pe),-1),getNode:()=>(console.error(pe),null),removeNodeFromMap(){console.error(pe)},has:()=>(console.error(pe),!1),reset(){console.error(pe)}};function ge(e,t,n={}){let r=null,o=0;return function(...i){const a=Date.now();o||!1!==n.leading||(o=a);const s=t-(a-o),c=this;s<=0||s>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(c,i)):r||!1===n.trailing||(r=setTimeout(()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(c,i)},s))}}function he(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>he(e,t,i||{},!0)}function me(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch(e){return()=>{}}}function ve(e){var t,n,r,o,i,a;const s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==s?void 0:s.documentElement.scrollLeft)||(null===(n=null===(t=null==s?void 0:s.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==s?void 0:s.body)||void 0===r?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null===(i=null===(o=null==s?void 0:s.body)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.scrollTop)||(null===(a=null==s?void 0:s.body)||void 0===a?void 0:a.scrollTop)||0}}function ye(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function we(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ie(e,t,n,r){if(!e)return!1;const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(se(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function Se(e,t){return t.getId(e)===H}function Ce(e,t){if(P(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||Ce(e.parentNode,t))}function Ee(e){return Boolean(e.changedTouches)}function be(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function ke(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ae(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(fe=new Proxy(fe,{get:(e,t,n)=>("map"===t&&console.error(pe),Reflect.get(e,t,n))}));class Te{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Ne(e){var t,n;let r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function Re(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||function(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=Ne(n);)n=t;return n}(e);return t.contains(n)}(e))}function Oe(e){return e.hasAttribute("data-rr-is-password")?"password":e.hasAttribute("type")?e.getAttribute("type").toLowerCase():null}var ze=/* @__PURE__ */(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(ze||{}),Me=/* @__PURE__ */(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(Me||{}),De=/* @__PURE__ */(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(De||{}),xe=/* @__PURE__ */(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(xe||{});function Ue(e){return"__ln"in e}class Le{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ue(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Ue(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const Pe=(e,t)=>`${e}@${t}`;class Fe{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Le,n=e=>{let t=e,n=H;for(;n===H;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{if(!r.parentNode||!Re(r))return;const o=P(r.parentNode)?this.mirror.getId(Ne(r)):this.mirror.getId(r.parentNode),i=n(r);if(-1===o||-1===i)return t.addNode(r);const a=ue(r,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,maskAllText:this.maskAllText,onSerialize:e=>{be(e,this.mirror)&&this.iframeManager.addIframe(e),ke(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ae(r)&&this.shadowDomManager.addShadowRoot(r.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});a&&e.push({parentId:o,nextId:i,node:a})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)_e(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||r(e);for(const e of this.addedSet)We(this.droppedSet,e)||_e(this.removes,e,this.mirror)?We(this.movedSet,e)?r(e):this.droppedSet.add(e):r(e);let o=null;for(;t.length;){let e=null;if(o){const t=this.mirror.getId(o.value.parentNode),r=n(o.value);-1!==t&&-1!==r&&(e=o)}if(!e)for(let r=t.length-1;r>=0;r--){const o=t.get(r);if(o){const t=this.mirror.getId(o.value.parentNode);if(-1===n(o.value))continue;if(-1!==t){e=o;break}{const t=o.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&-1!==this.mirror.getId(t.parentNode.host)){e=o;break}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}o=e.previous,t.removeNode(e.value),r(e.value)}const i={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>({id:this.mirror.getId(e.node),attributes:e.attributes})).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(i))},this.processMutation=e=>{if(!Se(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;Ie(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ce(e.target,this.maskTextClass,this.maskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const e=Oe(t);r=W({maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(Ie(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let o=this.attributes.find(t=>t.node===e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;n="rr_src"}if(o||(o={node:e.target,attributes:{}},this.attributes.push(o)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),"style"===n){const n=this.doc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue),null==o.attributes.style&&(o.attributes.style={});const r=o.attributes.style;for(const e of Array.from(t.style)){const o=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);o===n.style.getPropertyValue(e)&&i===n.style.getPropertyPriority(e)||(r[e]=""===i?o:[o,i])}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(r[e]=!1)}else ae(t.tagName,n)||(o.attributes[n]=ie(this.doc,t.tagName,n,r));break}case"childList":if(Ie(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=P(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Ie(e.target,this.blockClass,this.blockSelector,!1)||Se(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ge(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Ce(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Pe(n,r)]?Ge(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!P(e.target)||!F(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)){if(this.mirror.hasNode(e)){if(Se(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Pe(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ie(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach(e=>this.genAdds(e)),Ae(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","maskAllText"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Ge(e,t){e.delete(t),t.childNodes.forEach(t=>Ge(e,t))}function _e(e,t,n){return 0!==e.length&&Be(e,t,n)}function Be(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return!!e.some(e=>e.id===o)||Be(e,r,n)}function We(e,t){return 0!==e.size&&Ze(e,t)}function Ze(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||Ze(e,n))}let Ve;function qe(e){Ve=e}function Ke(){Ve=void 0}const Je=e=>Ve?(...t)=>{try{return e(...t)}catch(e){if(Ve&&!0===Ve(e))return;throw e}}:e;function He(e){let t="";return!e||e&&!e.length||Object.values(e).forEach(e=>{if(e&&e.nodeName){let n=e.nodeName,r=e.nodeValue;"class"==n?t=t+"."+r:"id"==n?t=t+"#"+r:"type"==n&&(t+=`[${n}="${r}"]`)}}),t}function je(e){const t=function(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t}else if("path"in e&&e.path.length)return e.path;return null}catch(e){return null}}(e);return t?function(e){if(!e||!Array.isArray(e))return"";let t="";for(let n=e.length>3?3:e.length-1;n>=0;n--){let r="",o=e[n];o&&o.tagName&&o.attributes&&o.attributes.length&&(r=n>0?o.tagName.toLowerCase()+He(o.attributes)+" > ":o.tagName.toLowerCase()+He(o.attributes),t+=r)}return t}(t):""}const Ye=[];function Xe(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function Qe(e,t){var n,r;const o=new Fe;Ye.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const a=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);const s=new i(Je(o.processMutations.bind(o)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function $e({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){return de("scroll",Je(ge(Je(i=>{const a=Xe(i);if(!a||Ie(a,r,o,!0))return;const s=n.getId(a);if(a===t&&t.defaultView){const n=ve(t.defaultView);e({id:s,x:n.left,y:n.top})}else e({id:s,x:a.scrollLeft,y:a.scrollTop})}),i.scroll||100)),t)}function et(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const tt=["INPUT","TEXTAREA","SELECT"],nt=new WeakMap;function rt(e){return function(e,t){if(st("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||st("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||st("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||st("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function ot(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function it({mirror:e,stylesheetManager:t},n){var r,o,i;let a=null;a=e.getId("#document"===n.nodeName?n:n.host);const s="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(i=null===(o=n.ownerDocument)||void 0===o?void 0:o.defaultView)||void 0===i?void 0:i.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets");return null!==a&&-1!==a&&s&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var n;const r=null===(n=c.set)||void 0===n?void 0:n.call(this,e);if(null!==a&&-1!==a)try{t.adoptStyleSheets(e,a)}catch(e){}return r}}),Je(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})):()=>{}}function at(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:p,selectionCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),a(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),f(...e)}}(e,t);const r=Qe(e,e.doc),o=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let a,s=[];const c=ge(Je(t=>{const n=Date.now()-a;e(s.map(e=>(e.timeOffset-=n,e)),t),s=[],a=null}),i),l=Je(ge(Je(e=>{const t=Xe(e),{clientX:n,clientY:o}=Ee(e)?e.changedTouches[0]:e;a||(a=Date.now()),s.push({x:n,y:o,id:r.getId(t),timeOffset:Date.now()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?Me.Drag:e instanceof MouseEvent?Me.MouseMove:Me.TouchMove)}),o,{trailing:!1})),u=[de("mousemove",l,n),de("touchmove",l,n),de("drag",l,n)];return Je(()=>{u.forEach(e=>e())})}(e),i=function({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i,captureClickEvents:a}){if(!1===i.mouseInteraction)return()=>{};const s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,c=[];let l=0,u="";return Object.keys(De).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(i=>{const s=i.toLowerCase(),d=(t=>i=>{const s=Xe(i);if(Ie(s,r,o,!0))return;const c=Ee(i)?i.changedTouches[0]:i;if(!c)return;const d=n.getId(s),{clientX:p,clientY:f}=c,g=je(i);let h={type:De[t],id:d,x:p,y:f,nodePath:g};if(De[t]===De.Click){const e=window.innerHeight?window.innerHeight:null,t=window.innerWidth?window.innerWidth:null,n=window.location.href||"",r=function(e){let t=e.target;return t?t.innerText||"":(console.error("Event target is not an HTML element."),"")}(i),o=!!a&&function(e){const t=e.target,n=t?null==t?void 0:t.nodeName.toLowerCase():"",r=t instanceof HTMLAnchorElement||null!==t.onclick||t.hasAttribute("onclick");return"a"!==n&&!r}(i),s=i.offsetX,c=i.offsetY,[d,p]=function(e){let t=e.target;return t?[t.clientHeight,t.clientWidth]:(console.error("Event target is not an HTML element."),[0,0])}(i),f=function(e){const t=e.target.ownerDocument.location.ancestorOrigins.length;let n=e.target;if(n){if(!n||!n.parentNode)return null;const r=[];let o=e.target;for(;o&&(null==o?void 0:o.tagName);){let e=o.tagName.toLowerCase(),t=Array.from(o.parentNode.children).indexOf(o)+1;r.unshift("body"!==e?e+(t>1?`:nth-child(${t})`:""):e),o=o.parentNode?o.parentNode:null}return t>0&&r.unshift(`iframe_context.level-${t}`),r.join(" > ")}return null}(i),g=(new Date).getTime();let m=!1;a&&u===f&&(m=g-l<3e3),l=new Date(g).getTime(),u=f||"",h=Object.assign(Object.assign({},h),{deadClick:o,innerText:r,offsetX:s,offsetY:c,rageClick:m,screenHeight:e,screenWidth:t,navigationUrl:n,elementHeight:d,elementWidth:p,selector:f})}Je(e)(h)})(i);c.push(de(s,d,t))}),Je(()=>{c.forEach(e=>e())})}(e),a=$e(e),s=function({viewportResizeCb:e}){let t=-1,n=-1;return de("resize",Je(ge(Je(()=>{const r=ye(),o=we();t===r&&n===o||(e({width:Number(o),height:Number(r)}),t=r,n=o)}),200)),window)}(e),c=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,maskInputOptions:a,maskInputFn:s,sampling:c,userTriggeredOnInput:l}){function u(e){let n=Xe(e);const c=je(e),u=e.isTrusted,p=n&&n.tagName;if(n&&"OPTION"===p&&(n=n.parentElement),!n||!p||tt.indexOf(p)<0||Ie(n,r,o,!0))return;if(n.classList.contains(i))return;let f=n.value,g=!1;const h=Oe(n)||"";"radio"===h||"checkbox"===h?g=n.checked:(a[p.toLowerCase()]||a[h])&&(f=W({maskInputOptions:a,tagName:p,type:h,value:f,maskInputFn:s})),d(n,Je(et)({text:f,isChecked:g,userTriggered:u,nodePath:c},l));const m=n.name;"radio"===h&&m&&g&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach(e=>{e!==n&&d(e,Je(et)({text:e.value,isChecked:!g,userTriggered:!1,nodePath:""},l))})}function d(t,r){const o=nt.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){nt.set(t,r);const o=n.getId(t);Je(e)(Object.assign(Object.assign({},r),{id:o}))}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>de(e,Je(u),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value");return g&&g.set&&p.push(...[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]].map(e=>he(e[0],e[1],{set(){Je(u)({target:this,isTrusted:!1})}},!1,f))),Je(()=>{p.forEach(e=>e())})}(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o}){const i=Je(i=>ge(Je(o=>{const a=Xe(o);if(!a||Ie(a,t,n,!0))return;const{currentTime:s,volume:c,muted:l,playbackRate:u}=a;e({type:i,id:r.getId(a),currentTime:s,volume:c,muted:l,playbackRate:u})}),o.media||500)),a=[de("play",i(0)),de("pause",i(1)),de("seeked",i(2)),de("volumechange",i(3)),de("ratechange",i(4))];return Je(()=>{a.forEach(e=>e())})}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Je((r,o,i)=>{const[a,s]=i,{id:c,styleId:l}=ot(o,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:a,index:s}]}),r.apply(o,i)})});const i=r.CSSStyleSheet.prototype.deleteRule;let a,s;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Je((r,o,i)=>{const[a]=i,{id:s,styleId:c}=ot(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,removes:[{index:a}]}),r.apply(o,i)})}),r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Je((r,o,i)=>{const[a]=i,{id:s,styleId:c}=ot(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,replace:a}),r.apply(o,i)})})),r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:Je((r,o,i)=>{const[a]=i,{id:s,styleId:c}=ot(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,replaceSync:a}),r.apply(o,i)})}));const c={};ct("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(ct("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),ct("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),ct("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach(([r,o])=>{l[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(l[r].insertRule,{apply:Je((r,o,i)=>{const[a,s]=i,{id:c,styleId:l}=ot(o.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:a,index:[...rt(o),s||0]}]}),r.apply(o,i)})}),o.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Je((r,o,i)=>{const[a]=i,{id:s,styleId:c}=ot(o.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,removes:[{index:[...rt(o),a]}]}),r.apply(o,i)})})}),Je(()=>{try{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),s&&(r.CSSStyleSheet.prototype.replaceSync=s)}catch(e){}try{Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})}catch(e){}})}(e,{win:n}),d=it(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Je((o,a,s)=>{var c;const[l,u,d]=s;if(n.has(l))return i.apply(a,[l,u,d]);const{id:p,styleId:f}=ot(null===(c=a.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||f&&-1!==f)&&e({id:p,styleId:f,set:{property:l,value:u,priority:d},index:rt(a.parentRule)}),o.apply(a,s)})});const a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Je((o,i,s)=>{var c;const[l]=s;if(n.has(l))return a.apply(i,[l]);const{id:u,styleId:d}=ot(null===(c=i.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,r.styleMirror);return(u&&-1!==u||d&&-1!==d)&&e({id:u,styleId:d,remove:{property:l},index:rt(i.parentRule)}),o.apply(i,s)})}),Je(()=>{try{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}catch(e){}})}(e,{win:n}),f=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const r=new i(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=me(t.fonts,"add",function(t){return function(n){return setTimeout(Je(()=>{const t=o.get(n);t&&(e(t),o.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=i}),r.push(a),Je(()=>{r.forEach(e=>e())})}(e):()=>{},g=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let a=!0;const s=Je(()=>{const e=t.getSelection();if(!e||a&&(null==e?void 0:e.isCollapsed))return;a=e.isCollapsed||!1;const s=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const i=e.getRangeAt(t),{startContainer:a,startOffset:c,endContainer:l,endOffset:u}=i;Ie(a,r,o,!0)||Ie(l,r,o,!0)||s.push({start:n.getId(a),startOffset:c,end:n.getId(l),endOffset:u})}i({ranges:s})});return s(),de("selectionchange",s)}(e),h=[];for(const t of e.plugins)h.push(t.observer(t.callback,n,t.options));return Je(()=>{Ye.forEach(e=>e.reset()),r.disconnect(),o(),i(),a(),s(),c(),l(),u(),d(),p(),f(),g(),h.forEach(e=>e())})}function st(e){return void 0!==window[e]}function ct(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class lt{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),i.set(a,t)),a}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:r.get(t)||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class ut{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new lt(j),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new lt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case ze.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:ze.IncrementalSnapshot,data:{source:Me.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ze.Meta:case ze.Load:case ze.DomContentLoaded:return!1;case ze.Plugin:return t;case ze.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ze.IncrementalSnapshot:switch(t.data.source){case Me.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Me.Drag:case Me.TouchMove:case Me.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Me.ViewportResize:return!1;case Me.MediaInteraction:case Me.MouseInteraction:case Me.Scroll:case Me.CanvasMutation:case Me.Input:return this.replaceIds(t.data,e,["id"]),t;case Me.StyleSheetRule:case Me.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Me.Font:return t;case Me.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Me.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(t[o]=Array.isArray(t[o])?e.getIds(n,t[o]):e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===O.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class dt{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!F(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=Qe(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push($e(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(it({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(me(e.prototype,"attachShadow",function(e){return function(r){const o=e.call(this,r);return this.shadowRoot&&Re(this)&&n.addShadowRoot(this.shadowRoot,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var pt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ft="undefined"==typeof Uint8Array?[]:new Uint8Array(256),gt=0;gt<64;gt++)ft[pt.charCodeAt(gt)]=gt;const ht=new Map,mt=(e,t,n)=>{if(!e||!wt(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=ht.get(e);return n||(n=new Map,ht.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function vt(e,t,n){if(e instanceof Array)return e.map(e=>vt(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=pt[n[t]>>2],o+=pt[(3&n[t])<<4|n[t+1]>>4],o+=pt[(15&n[t+1])<<2|n[t+2]>>6],o+=pt[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:n}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[vt(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[vt(e.data,t,n),e.width,e.height]}:wt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:mt(e,t,n)}:e}const yt=(e,t,n)=>[...e].map(e=>vt(e,t,n)),wt=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function It(e,t,n){const r=[];try{const o=me(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(r,...o){return Ie(this,t,n,!0)||"__context"in this||(this.__context=r),e.apply(this,[r,...o])}});r.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(e=>e())}}function St(e,t,n,r,o,i,a){const s=[],c=Object.getOwnPropertyNames(e);for(const i of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if("function"!=typeof e[i])continue;const c=me(e,i,function(e){return function(...s){const c=e.apply(this,s);if(mt(c,a,this),!Ie(this.canvas,r,o,!0)){const e=yt([...s],a,this);n(this.canvas,{type:t,property:i,args:e})}return c}});s.push(c)}catch(r){const o=he(e,i,{set(e){n(this.canvas,{type:t,property:i,args:[e],setter:!0})}});s.push(o)}return s}var Ct,Et=function(e){return Ct=Ct||(n=(t=atob("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=")).indexOf("\n",10)+1,r=t.substring(n)+"",o=new Blob([r],{type:"application/javascript"}),URL.createObjectURL(o)),new Worker(Ct,e);var t,n,r,o};class bt{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:i,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,r,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,o){const i=It(t,n,r),a=new Map,s=new Et;s.onmessage=e=>{const{id:t}=e.data;if(a.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:i}=e.data;this.mutationCb({id:t,type:xe["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const c=1e3/e;let l,u=0;const d=e=>{u&&e-u<c||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Ie(t,n,r,!0)||e.push(t)}),e})().forEach(e=>{return t=this,r=function*(){var t;const n=this.mirror.getId(e);if(a.get(n))return;if(a.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const r=yield createImageBitmap(e);s.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[r])},new((n=void 0)||(n=Promise))(function(e,o){function i(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n(function(e){e(r)})).then(i,a)}s((r=r.apply(t,[])).next())});var t,n,r})),l=requestAnimationFrame(d)};l=requestAnimationFrame(d),this.resetObservers=()=>{i(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=It(e,t,n),o=function(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])continue;const i=me(t.CanvasRenderingContext2D.prototype,a,function(o){return function(...i){return Ie(this.canvas,n,r,!0)||setTimeout(()=>{const n=yt([...i],t,this);e(this.canvas,{type:xe["2D"],property:a,args:n})},0),o.apply(this,i)}});o.push(i)}catch(n){const r=he(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:xe["2D"],property:a,args:[t],setter:!0})}});o.push(r)}return()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r,o){const i=[];return i.push(...St(t.WebGLRenderingContext.prototype,xe.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&i.push(...St(t.WebGL2RenderingContext.prototype,xe.WebGL2,e,n,r,0,t)),()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t}),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class kt{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Te,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);r.push({styleId:e,rules:n.map((e,t)=>({rule:_(e),index:t}))})}n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class At{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function Tt(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let Nt,Rt,Ot,zt=!1;const Mt=new B;function Dt(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:l=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:g,hooks:h,packFn:m,sampling:v={},dataURLOptions:y={},mousemoveWait:w,recordCanvas:I=!1,recordCrossOriginIframes:S=!1,recordAfter:C=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:b=!1,inlineImages:k=!1,plugins:A,keepIframeSrcFn:T=(()=>!1),ignoreCSSAttributes:N=new Set([]),errorHandler:R,captureClickEvents:O=!1,maskAllText:z=!1}=e;qe(R);const M=!S||window.parent===window;let D=!1;if(!M)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(M&&!t)throw new Error("emit function is required");void 0!==w&&void 0===v.mousemove&&(v.mousemove=w),Mt.reset();const x=!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==d?d:{password:!0},U=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p}:p||{};let L;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let P=0;const F=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return m&&!D&&(e=m(e)),e};Nt=(e,o)=>{var i;if(!(null===(i=Ye[0])||void 0===i?void 0:i.isFrozen())||e.type===ze.FullSnapshot||e.type===ze.IncrementalSnapshot&&e.data.source===Me.Mutation||Ye.forEach(e=>e.unfreeze()),M)null==t||t(F(e),o);else if(D){const t={type:"rrweb",event:F(e),origin:window.location.origin,isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===ze.FullSnapshot)L=e,P=0;else if(e.type===ze.IncrementalSnapshot){if(e.data.source===Me.Mutation&&e.data.isAttachIframe)return;P++,(r&&P>=r||n&&e.timestamp-L.timestamp>n)&&Rt(!0)}};const G=e=>{Nt(Tt({type:ze.IncrementalSnapshot,data:Object.assign({source:Me.Mutation},e)}))},_=e=>Nt(Tt({type:ze.IncrementalSnapshot,data:Object.assign({source:Me.Scroll},e)})),W=e=>Nt(Tt({type:ze.IncrementalSnapshot,data:Object.assign({source:Me.CanvasMutation},e)})),Z=new kt({mutationCb:G,adoptedStyleSheetCb:e=>Nt(Tt({type:ze.IncrementalSnapshot,data:Object.assign({source:Me.AdoptedStyleSheet},e)}))}),V=new ut({mirror:Mt,mutationCb:G,stylesheetManager:Z,recordCrossOriginIframes:S,wrappedEmit:Nt});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:Mt,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});const q=new At;Ot=new bt({recordCanvas:I,mutationCb:W,win:window,blockClass:o,blockSelector:i,mirror:Mt,sampling:v.canvas,dataURLOptions:y});const K=new dt({mutationCb:G,scrollCb:_,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:l,maskInputOptions:x,dataURLOptions:y,maskTextFn:g,maskInputFn:f,recordCanvas:I,inlineImages:k,sampling:v,slimDOMOptions:U,iframeManager:V,stylesheetManager:Z,canvasManager:Ot,keepIframeSrcFn:T,processedNodeManager:q,maskAllText:z},mirror:Mt});Rt=(e=!1)=>{Nt(Tt({type:ze.Meta,data:{href:window.location.href,width:we(),height:ye()}}),e),Z.reset(),K.init(),Ye.forEach(e=>e.lock());const t=function(e,t){var n=t||{},r=n.mirror,o=void 0===r?new B:r,i=n.blockClass,a=n.blockSelector,s=n.maskTextClass,c=n.maskTextSelector,l=n.inlineStylesheet,u=n.inlineImages,d=n.recordCanvas,p=n.maskAllInputs,f=void 0!==p&&p,g=n.slimDOM,h=void 0!==g&&g,m=n.keepIframeSrcFn,v=n.maskAllText;return ue(e,{doc:e,mirror:o,blockClass:void 0===i?"rr-block":i,blockSelector:void 0===a?null:a,maskTextClass:void 0===s?"rr-mask":s,maskTextSelector:void 0===c?null:c,skipChild:!1,inlineStylesheet:void 0===l||l,maskInputOptions:!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===f?{password:!0}:f,maskTextFn:n.maskTextFn,maskInputFn:n.maskInputFn,slimDOMOptions:!0===h||"all"===h?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===h,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===h?{}:h,dataURLOptions:n.dataURLOptions,inlineImages:void 0!==u&&u,recordCanvas:void 0!==d&&d,preserveWhiteSpace:n.preserveWhiteSpace,onSerialize:n.onSerialize,onIframeLoad:n.onIframeLoad,iframeLoadTimeout:n.iframeLoadTimeout,onStylesheetLoad:n.onStylesheetLoad,stylesheetLoadTimeout:n.stylesheetLoadTimeout,keepIframeSrcFn:void 0===m?function(){return!1}:m,newlyAddedElement:!1,maskAllText:void 0!==v&&v})}(document,{mirror:Mt,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:l,maskAllInputs:x,maskTextFn:g,slimDOM:U,dataURLOptions:y,recordCanvas:I,inlineImages:k,maskAllText:z,onSerialize:e=>{be(e,Mt)&&V.addIframe(e),ke(e,Mt)&&Z.trackLinkElement(e),Ae(e)&&K.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{V.attachIframe(e,t),K.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Z.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!t)return console.warn("Failed to snapshot the document");Nt(Tt({type:ze.FullSnapshot,data:{node:t,initialOffset:ve(window)}}),e),Ye.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Z.adoptStyleSheets(document.adoptedStyleSheets,Mt.getId(document))};try{const e=[],t=e=>{var t;return Je(at)({mutationCb:G,mousemoveCb:(e,t)=>Nt(Tt({type:ze.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Nt(Tt({type:ze.IncrementalSnapshot,data:Object.assign({source:Me.MouseInteraction},e)})),scrollCb:_,viewportResizeCb:e=>Nt(Tt({type:ze.IncrementalSnapshot,data:Object.assign({source:Me.ViewportResize},e)})),inputCb:e=>Nt(Tt({type:ze.IncrementalSnapshot,data:Object.assign({source:Me.Input},e)})),mediaInteractionCb:e=>Nt(Tt({type:ze.IncrementalSnapshot,data:Object.assign({source:Me.MediaInteraction},e)})),styleSheetRuleCb:e=>Nt(Tt({type:ze.IncrementalSnapshot,data:Object.assign({source:Me.StyleSheetRule},e)})),styleDeclarationCb:e=>Nt(Tt({type:ze.IncrementalSnapshot,data:Object.assign({source:Me.StyleDeclaration},e)})),canvasMutationCb:W,fontCb:e=>Nt(Tt({type:ze.IncrementalSnapshot,data:Object.assign({source:Me.Font},e)})),selectionCb:e=>{Nt(Tt({type:ze.IncrementalSnapshot,data:Object.assign({source:Me.Selection},e)}))},blockClass:o,ignoreClass:a,maskTextClass:s,maskTextSelector:c,maskInputOptions:x,inlineStylesheet:l,sampling:v,recordCanvas:I,inlineImages:k,userTriggeredOnInput:E,collectFonts:b,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:U,dataURLOptions:y,mirror:Mt,iframeManager:V,stylesheetManager:Z,shadowDomManager:K,processedNodeManager:q,canvasManager:Ot,ignoreCSSAttributes:N,plugins:(null===(t=null==A?void 0:A.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Nt(Tt({type:ze.Plugin,data:{plugin:e.name,payload:t}}))})))||[],captureClickEvents:O,maskAllText:z},h)};V.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});const n=()=>{Rt(),e.push(t(document)),zt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(de("DOMContentLoaded",()=>{Nt(Tt({type:ze.DomContentLoaded,data:{}})),"DOMContentLoaded"===C&&n()})),e.push(de("load",()=>{Nt(Tt({type:ze.Load,data:{}})),"load"===C&&n()},window))),()=>{e.forEach(e=>e()),q.destroy(),zt=!1,Ke()}}catch(e){console.warn(e)}}Dt.addCustomEvent=(e,t)=>{if(!zt)throw new Error("please add custom event after start recording");Nt(Tt({type:ze.Custom,data:{tag:e,payload:t}}))},Dt.freezePage=()=>{Ye.forEach(e=>e.freeze())},Dt.takeFullSnapshot=e=>{if(!zt)throw new Error("please take full snapshot after start recording");Rt(e)},Dt.mirror=Mt;var xt=Uint8Array,Ut=Uint16Array,Lt=Uint32Array,Pt=new xt([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,0,0,0]),Ft=new xt([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,0,0]),Gt=new xt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_t=function(e,t){for(var n=new Ut(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new Lt(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return[n,o]},Bt=_t(Pt,2),Wt=Bt[1];Bt[0][28]=258,Wt[258]=28;for(var Zt=_t(Ft,0)[1],Vt=new Ut(32768),qt=0;qt<32768;++qt){var Kt=(43690&qt)>>>1|(21845&qt)<<1;Vt[qt]=((65280&(Kt=(61680&(Kt=(52428&Kt)>>>2|(13107&Kt)<<2))>>>4|(3855&Kt)<<4))>>>8|(255&Kt)<<8)>>>1}var Jt=function(e,t,n){for(var r=e.length,o=0,i=new Ut(t);o<r;++o)++i[e[o]-1];var a,s=new Ut(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(n){a=new Ut(1<<t);var c=15-t;for(o=0;o<r;++o)if(e[o])for(var l=o<<4|e[o],u=t-e[o],d=s[e[o]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)a[Vt[d]>>>c]=l}else for(a=new Ut(r),o=0;o<r;++o)a[o]=Vt[s[e[o]-1]++]>>>15-e[o];return a},Ht=new xt(288);for(qt=0;qt<144;++qt)Ht[qt]=8;for(qt=144;qt<256;++qt)Ht[qt]=9;for(qt=256;qt<280;++qt)Ht[qt]=7;for(qt=280;qt<288;++qt)Ht[qt]=8;var jt=new xt(32);for(qt=0;qt<32;++qt)jt[qt]=5;var Yt=/*#__PURE__*/Jt(Ht,9,0),Xt=/*#__PURE__*/Jt(jt,5,0),Qt=function(e){return(e/8|0)+(7&e&&1)},$t=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Ut?Ut:e instanceof Lt?Lt:xt)(n-t);return r.set(e.subarray(t,n)),r},en=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},tn=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},nn=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,i=n.slice();if(!o)return[new xt(0),0];if(1==o){var a=new xt(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=o-1;)s=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var p=i[0].s;for(r=1;r<o;++r)i[r].s>p&&(p=i[r].s);var f=new Ut(p+1),g=rn(n[u-1],f,0);if(g>t){r=0;var h=0,m=g-t,v=1<<m;for(i.sort(function(e,t){return f[t.s]-f[e.s]||e.f-t.f});r<o;++r){var y=i[r].s;if(!(f[y]>t))break;h+=v-(1<<g-f[y]),f[y]=t}for(h>>>=m;h>0;){var w=i[r].s;f[w]<t?h-=1<<t-f[w]++-1:++r}for(;r>=0&&h;--r){var I=i[r].s;f[I]==t&&(--f[I],++h)}g=t}return[new xt(f),g]},rn=function(e,t,n){return-1==e.s?Math.max(rn(e.l,t,n+1),rn(e.r,t,n+1)):t[e.s]=n},on=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Ut(++t),r=0,o=e[0],i=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return[n.subarray(0,r),t]},an=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},sn=function(e,t,n){var r=n.length,o=Qt(t+2);e[o]=255&r,e[o+1]=r>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<r;++i)e[o+i+4]=n[i];return 8*(o+4+r)},cn=function(e,t,n,r,o,i,a,s,c,l,u){en(t,u++,n),++o[256];for(var d=nn(o,15),p=d[0],f=d[1],g=nn(i,15),h=g[0],m=g[1],v=on(p),y=v[0],w=v[1],I=on(h),S=I[0],C=I[1],E=new Ut(19),b=0;b<y.length;++b)E[31&y[b]]++;for(b=0;b<S.length;++b)E[31&S[b]]++;for(var k=nn(E,7),A=k[0],T=k[1],N=19;N>4&&!A[Gt[N-1]];--N);var R,O,z,M,D=l+5<<3,x=an(o,Ht)+an(i,jt)+a,U=an(o,p)+an(i,h)+a+14+3*N+an(E,A)+(2*E[16]+3*E[17]+7*E[18]);if(D<=x&&D<=U)return sn(t,u,e.subarray(c,c+l));if(en(t,u,1+(U<x)),u+=2,U<x){R=Jt(p,f,0),O=p,z=Jt(h,m,0),M=h;var L=Jt(A,T,0);for(en(t,u,w-257),en(t,u+5,C-1),en(t,u+10,N-4),u+=14,b=0;b<N;++b)en(t,u+3*b,A[Gt[b]]);u+=3*N;for(var P=[y,S],F=0;F<2;++F){var G=P[F];for(b=0;b<G.length;++b)en(t,u,L[_=31&G[b]]),u+=A[_],_>15&&(en(t,u,G[b]>>>5&127),u+=G[b]>>>12)}}else R=Yt,O=Ht,z=Xt,M=jt;for(b=0;b<s;++b)if(r[b]>255){var _;tn(t,u,R[257+(_=r[b]>>>18&31)]),u+=O[_+257],_>7&&(en(t,u,r[b]>>>23&31),u+=Pt[_]);var B=31&r[b];tn(t,u,z[B]),u+=M[B],B>3&&(tn(t,u,r[b]>>>5&8191),u+=Ft[B])}else tn(t,u,R[r[b]]),u+=O[r[b]];return tn(t,u,R[256]),u+O[256]},ln=/*#__PURE__*/new Lt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]);const un=e=>{const t=Object.assign(Object.assign({},e),{v:"v1"});return function(e,t){for(var n="",r=0;r<e.length;){var o=e[r++];n+=String.fromCharCode(o)}return n}(function(e,t){void 0===t&&(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var r=e,o=t,i=n.length,a=0;a!=i;){for(var s=Math.min(a+5552,i);a<s;++a)o+=r+=n[a];r%=65521,o%=65521}e=r,t=o},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();n.p(e);var r,o,i,a,s,c=function(e,t,n,r,o,i){var a=e.length,s=new xt(2+a+5*(1+Math.floor(a/7e3))+4),c=s.subarray(2,s.length-4),l=0;if(!t||a<8)for(var u=0;u<=a;u+=65535){var d=u+65535;d<a?l=sn(c,l,e.subarray(u,d)):(c[u]=i,l=sn(c,l,e.subarray(u,a)))}else{for(var p=ln[t-1],f=p>>>13,g=8191&p,h=(1<<n)-1,m=new Ut(32768),v=new Ut(h+1),y=Math.ceil(n/3),w=2*y,I=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<w)&h},S=new Lt(25e3),C=new Ut(288),E=new Ut(32),b=0,k=0,A=(u=0,0),T=0,N=0;u<a;++u){var R=I(u),O=32767&u,z=v[R];if(m[O]=z,v[R]=O,T<=u){var M=a-u;if((b>7e3||A>24576)&&M>423){l=cn(e,c,0,S,C,E,k,A,N,u-N,l),A=b=k=0,N=u;for(var D=0;D<286;++D)C[D]=0;for(D=0;D<30;++D)E[D]=0}var x=2,U=0,L=g,P=O-z&32767;if(M>2&&R==I(u-P))for(var F=Math.min(f,M)-1,G=Math.min(32767,u),_=Math.min(258,M);P<=G&&--L&&O!=z;){if(e[u+x]==e[u+x-P]){for(var B=0;B<_&&e[u+B]==e[u+B-P];++B);if(B>x){if(x=B,U=P,B>F)break;var W=Math.min(P,B-2),Z=0;for(D=0;D<W;++D){var V=u-P+D+32768&32767,q=V-m[V]+32768&32767;q>Z&&(Z=q,z=V)}}}P+=(O=z)-(z=m[O])+32768&32767}if(U){S[A++]=268435456|Wt[x]<<18|Zt[U];var K=31&Wt[x],J=31&Zt[U];k+=Pt[K]+Ft[J],++C[257+K],++E[J],T=u+x,++b}else S[A++]=e[u],++C[e[u]]}}l=cn(e,c,i,S,C,E,k,A,N,u-N,l)}return $t(s,0,2+Qt(l)+4)}(r=e,null==(o=t).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,0,0,!0);return s=0==(a=t.level)?0:a<6?1:9==a?3:2,(i=c)[0]=120,i[1]=s<<6|(s?32-2*s:1),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(c,c.length-4,n.d()),c}(function(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new xt(e.length+(e.length>>>1)),o=0,i=function(e){r[o++]=e},a=0;a<n;++a){if(o+5>r.length){var s=new xt(o+8+(n-a<<1));s.set(r),r=s}var c=e.charCodeAt(a);c<128?i(c):c<2048?(i(192|c>>>6),i(128|63&c)):c>55295&&c<57344?(i(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++a))>>>18),i(128|c>>>12&63),i(128|c>>>6&63),i(128|63&c)):(i(224|c>>>12),i(128|c>>>6&63),i(128|63&c))}return $t(r,0,o)}(JSON.stringify(t))))};function dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return dn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fn(){return fn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fn.apply(null,arguments)}function gn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(gn=function(){return!!e})()}function hn(e,t){return hn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hn(e,t)}var mn,vn=new Map;function yn(e){try{var t=window.localStorage.getItem(e);return D("inside zLocalStorageGetItem for key :"+e+" and value :"+t),!t&&(D("fetched value from hashmap :"+(t=vn.get(e))),t)?(D("Going to update local storage:"),function(){try{D("inside localStorageUpdate function");for(var e,t=pn(vn.entries());!(e=t()).done;){var n=e.value;window.localStorage.getItem(n[0])||(D("Going inside localStorageUpdate-2 for key :"+n[0]+" and value :"+n[1]),wn(n[0],n[1]))}}catch(e){L("inside updateLocalStorage catch block ${e.message}")}}(),t):t}catch(e){return void L("inside zLocalStorageGetItem catch block ${e.message}")}}function wn(e,t){try{D("inside zLocalStorageSetItem for key :"+e+" and value :"+t),vn.set(e,t),window.localStorage.setItem(e,t)}catch(e){L("inside zLocalStorageSetItem catch block ${e.message}")}}function In(e){try{D("inside zLocalStorageRemoveItem for key :"+e),vn.delete(e),window.localStorage.removeItem(e)}catch(e){L("inside zLocalStorageSetItem catch block ${e.message}")}}var Sn=new Uint8Array(16);function Cn(){if(!mn&&!(mn="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return mn(Sn)}for(var En=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,bn=[],kn=0;kn<256;++kn)bn.push((kn+256).toString(16).substr(1));function An(e,t,n){var r=(e=e||{}).random||(e.rng||Cn)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(bn[e[t+0]]+bn[e[t+1]]+bn[e[t+2]]+bn[e[t+3]]+"-"+bn[e[t+4]]+bn[e[t+5]]+"-"+bn[e[t+6]]+bn[e[t+7]]+"-"+bn[e[t+8]]+bn[e[t+9]]+"-"+bn[e[t+10]]+bn[e[t+11]]+bn[e[t+12]]+bn[e[t+13]]+bn[e[t+14]]+bn[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&En.test(e)}(n))throw TypeError("Stringified UUID is invalid");return n}(r)}var Tn=/*#__PURE__*/function(){function e(){this.sessionId="",this.isSessionExpired=!1,this.lastActivityTime=void 0,this.enduserLastActivityTime=void 0,this.sessionBlockInfo={isBlocked:!1,blockedEndTime:0,apiKey:""},this.apiKey="",this.isNewSession=!1,this.isCheckoutFlowTriggered=!1}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e}();function Nn(){var e=yn("zsdk-config");if(e)try{return JSON.parse(e)}catch(e){return void L("Failed to parse sdk Config Data")}}function Rn(e){if(e)try{D("Updating zsession-blocked-info"+JSON.stringify(e)),wn("zsession-blocked-info",JSON.stringify(e))}catch(e){L("Failed to stringify zsession-blocked-info ")}}function On(e){var t=Tn.getInstance(),n={isBlocked:!1,blockedEndTime:0,apiKey:e};try{t.sessionBlockInfo=n,D("Updating zsession-blocked-info"+JSON.stringify(n)),wn("zsession-blocked-info",JSON.stringify(n))}catch(e){L("Failed to stringify zsession-blocked-info ")}}function zn(){var e=yn("zsession-blocked-info"),t=Tn.getInstance();if(e)try{var n=JSON.parse(e);return t.sessionBlockInfo=n,n}catch(e){return void L("Failed to parse zsession-blocked-info")}}function Mn(){var e=yn("zId");return e||(wn("zId",e=mr()),e)}function Dn(){var e=yn("zenduser-info");if(e)try{return JSON.parse(e)}catch(e){return void L("Failed to parse end user Info data")}}function xn(){var e=yn("zenduser-info-temp");if(e)try{return JSON.parse(e)}catch(e){return void L("Failed to parse end user Info data")}}function Un(e){Mn(),Dn()||D("Creating new enduser-info"+JSON.stringify(e));try{D("Updating enduser-info"+JSON.stringify(e)),wn("zenduser-info",JSON.stringify(e))}catch(e){L("Failed to stringify enduser-info ")}}function Ln(e){Mn(),Dn()||D("Creating new enduser-info-temp"+JSON.stringify(e));try{D("Updating enduser-info-temp"+JSON.stringify(e)),wn("zenduser-info-temp",JSON.stringify(e))}catch(e){L("Failed to stringify enduser-info-temp ")}}function Pn(){xn()?(D("Removing zenduser-info-temp"),In("zenduser-info-temp")):D("zenduser temp Data dosen't exists")}function Fn(){var e=Dn();return e?e.userType===i.IDENTIFIED:(D("zenduser-info doesn't exists"),!1)}function Gn(e,t){e.euId=0,e.euZName="",e.isBlocked=!1,e.zAnonymsUserInfo={euId:0,euZName:"",zId:null!=t?t:""}}function _n(e,t){var n,r,o=Mn();(null==e||null==(n=e.zAnonymsUserInfo)?void 0:n.zId)===o?(D("ZId match"),e.euId=e.zAnonymsUserInfo.euId,e.euZName=e.zAnonymsUserInfo.euZName):(D("ZId dosen't match Zid : "+o+" and Anonyms user Zid: "+(null==e||null==(r=e.zAnonymsUserInfo)?void 0:r.zId)),Gn(e,o)),t?Ln(e):Un(e)}function Bn(){if(xn())return D("Temp storage has some pending data to post"),!0;var e=Dn();if(!e)return D("zenduser Data dosen't exists"),!0;if(0===e.euId)return D("Euid value is 0, required to fetch data again"),!0;if(e.userType===i.ANONYMS){var t,n;if(null==e||null==(t=e.zExternalUserInfo)?void 0:t.externalId)return D("External User details exists, and userType is ANONYMS need to post data"),!0;var r=Mn();if((null==(n=e.zAnonymsUserInfo)?void 0:n.zId)!==r)return D("ZId dosen't match Zid : "+r+" and Anonyms user Zid: "+e.zAnonymsUserInfo.zId),Gn(e,r),Un(e),!0;D("ZId match No need to update for anonyms user")}return!1}Tn.instance=void 0;var Wn=/*#__PURE__*/function(){function e(){this.rootDomain="",this.releaseVer="",this.recordOnlyIframe=!1,this.proxyURL="",this.rootDomain="",this.releaseVer="",this.recordOnlyIframe=!1,this.proxyURL=""}var t=e.prototype;return t.saveOptions=function(e){this.releaseVer=e.releaseVer?e.releaseVer:this.releaseVer,this.rootDomain=this.isValidRootDomain(e.rootDomain)?e.rootDomain:this.rootDomain,this.recordOnlyIframe="boolean"==typeof e.recordOnlyIframe?e.recordOnlyIframe:this.recordOnlyIframe,this.proxyURL=this.isValidProxyURL(e.proxyURL)?e.proxyURL:this.proxyURL},t.isValidRootDomain=function(e){return!(!e||!new RegExp(S).test(e))},t.isValidProxyURL=function(e){return!(!e||!new RegExp(C).test(e))},e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e}();function Zn(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}Wn.instance=void 0;var Vn=function e(t,n,r){try{return Promise.resolve(Zn(function(){var o=Er(),i=Wn.getInstance();return Promise.resolve(fetch(t,{method:"POST",headers:yr(o.customEventUrl,i.proxyURL,T),body:JSON.stringify(n)})).then(function(o){return o.ok?(x("Response status = "+o.status),!0):(x("Error :: Response status = "+o.status),r>0?e(t,n,r-1):(L("Not able to send data after all retries"),!1))})},function(e){return L("Not able to get response from server with ERROR: "+e),!1}))}catch(e){return Promise.reject(e)}},qn=function e(t,n,r,o,i){void 0===n&&(n=5),void 0===i&&(i={});try{return Promise.resolve(Zn(function(){var a=Wn.getInstance(),s=new URL(t),c=new URL((a.proxyURL?a.proxyURL:s.origin)+s.pathname);return null!=r&&Object.keys(r).forEach(function(e){return c.searchParams.append(e,r[e])}),Promise.resolve(fetch(c.href,{method:"POST",headers:yr(s.origin,a.proxyURL,{"Content-Type":"application/json"}),body:JSON.stringify(o)})).then(function(a){return a.ok?(x("postDataOnServer :: Response status = "+a.status),Promise.resolve(a.json()).then(function(e){return x("postDataOnServer :: Response JSON = "+e),e})):404==a.status?(wn("is-api-key-valid","false"),$n(!1),!1):(x("Error :: Response status = "+a.status),n>0?void setTimeout(function(){return Xn+=z.streamMgrRetryDelay,e(t,n-1,r,o,i)},Xn):(L("Not able to post enduser config after multiple retries"),!1))})},function(e){return L("Not able to get response from server with ERROR: "+e),!1}))}catch(e){return Promise.reject(e)}},Kn=function e(t,n,r){try{return Promise.resolve(Zn(function(){var o=Er(),i=Wn.getInstance();return Promise.resolve(fetch(t,{method:"POST",headers:yr(o.pagePerfUrl,i.proxyURL,T),body:JSON.stringify(n)})).then(function(o){return o.ok?(x("Response status = "+o.status),!0):(x("Error :: Response status = "+o.status),r>0?e(t,n,r-1):(L("Not able to send data after all retries"),!1))})},function(e){return L("Not able to get response from server with ERROR: "+e),!1}))}catch(e){return Promise.reject(e)}},Jn=function e(t,n,r){try{return Promise.resolve(Zn(function(){var o=Er(),i=Wn.getInstance();return Promise.resolve(fetch(t,{method:"POST",headers:yr(o.heatMapUrl,i.proxyURL,T),body:JSON.stringify(n)})).then(function(o){return o.ok?(x("Response status = "+o.status),!0):(x("Error :: Response status = "+o.status),r>0?e(t,n,r-1):(L("Not able to send data after all retries"),!1))})},function(e){return L("Not able to get response from server with ERROR: "+e),!1}))}catch(e){return Promise.reject(e)}},Hn=function e(t,n,r){try{return Promise.resolve(Zn(function(){var o=Er(),i=Wn.getInstance();return Promise.resolve(fetch(t,{method:"POST",headers:yr(o.perfUrl,i.proxyURL,T),body:JSON.stringify(n)})).then(function(o){return o.ok?(x("Response status = "+o.status),!0):(x("Error :: Response status = "+o.status),r>0?e(t,n,r-1):(L("Not able to send data after all retries"),!1))})},function(e){return L("Not able to get response from server with ERROR: "+e),!1}))}catch(e){return Promise.reject(e)}},jn=function e(t){var n=t.divolteUrl,r=t.divolteJson,o=t.failureRetryCount;try{return Promise.resolve(Zn(function(){var t=JSON.stringify(r),i=Er(),a=Wn.getInstance();return Promise.resolve(fetch(n,{method:"POST",headers:yr(i.streamUrl,a.proxyURL,T),body:t})).then(function(i){return Er()&&Er().splitSessionSize>0&&(U("Request size "+(new TextEncoder).encode(t).byteLength),function(e){try{var t=JSON.parse(e).events,n=qo(t),r=Tn.getInstance(),o=yn("ztotal-data-sent")?yn("ztotal-data-sent"):"0",i=parseInt(o)+n;U("Current data size "+o),U("Merged data size "+i);var a=!0;r.isCheckoutFlowTriggered?a=!function(e){for(var t,n=Tn.getInstance(),r=0,o=e.length-1;r<o;){if(!0===e[r].isCheckout){t=r,n.isCheckoutFlowTriggered=!1;break}if(!0===e[o].isCheckout){t=o,n.isCheckoutFlowTriggered=!1;break}r++,o--}return t>=0&&(wn("ztotal-data-sent",qo(e.slice(t,e.length)).toString()),!0)}(t):i>Er().splitSessionSize&&!r.isCheckoutFlowTriggered&&function(){try{U("Trigger checkout flow triggered"),Dt.takeFullSnapshot(!0)}catch(e){L("Error in checking full snapshot. Error is - "+e.message)}}(),a&&wn("ztotal-data-sent",JSON.stringify(i))}catch(e){L("Error in checking data size. Error is - "+e.message)}}(r.parameters.eventData)),i.ok?(x("Response status = "+i.status),!0):(x("Error :: Response status = "+i.status),o>0?e({divolteUrl:n,divolteJson:r,failureRetryCount:o-1}):(L("Not able to send data after all retries"),!1))})},function(e){return L("Not able to get response from server with ERROR: "+e),!1}))}catch(e){return Promise.reject(e)}},Yn=!0,Xn=z.streamMgrRetryDelay;function Qn(){return Yn}function $n(e){Yn=e}function er(){var e=yn("session-data");if(e)try{return JSON.parse(e)}catch(e){return void L("Failed to parse session data")}}function tr(e){var t=Tn.getInstance();if(t.isSessionExpired)return x("Session is already expired"),!0;var n=(er()||{}).sessionId,r=Number(yn("last-activity-time"));return!n||r+e.sessionTimeout<=Date.now()?(D("Session is expired"),t.isSessionExpired=!0,!0):!function(e){var t=nr();return!(!t||t+e.sessionTimeout<=Date.now())}(e)&&(t.isSessionExpired=!0,!0)}function nr(){try{var e=Tn.getInstance().enduserLastActivityTime;if(!e){if(!(e=Number(yn("zenduser-last-activity-time"))))return 0;e=Number(e)}return e}catch(e){return L("inside getZendUserActivityTime catch block"),0}}function rr(){var e=yn("pack");if(!e){var t=Er();wn("pack",e=t.pack?t.pack.toString():(!1).toString())}return"true"===e}function or(e){On(e),wn("ztotal-data-sent","0"),In("zUTMParams"),In("session-data"),ur(e+d.utms)}function ir(e){var t=Tn.getInstance(),n=yn("zId");n||wn("zId",n=mr());var r=mr(),o="0:"+mr().replace("-",":");or(e);var i={sessionId:r,dSession:o,isNewSession:!0,sdkKey:e};wn("is-api-key-valid","true"),$n(!0);try{D("Created new Session"+JSON.stringify(i)),t.sessionId=i.sessionId,t.apiKey=i.sdkKey,t.isNewSession=i.isNewSession,t.isSessionExpired=!1,t.lastActivityTime=Date.now(),t.enduserLastActivityTime=Date.now(),t.isCheckoutFlowTriggered=!1,window.buffered=!1,wn("last-activity-time",t.lastActivityTime.toString()),wn("zenduser-last-activity-time",t.enduserLastActivityTime.toString()),wn("session-data",JSON.stringify(i))}catch(e){L("Failed to stringify session data")}}function ar(e){var t=er();return!!t&&e!==(null==t?void 0:t.sdkKey)&&(D("Sdk key is chnaged going to create session data"),!0)}function sr(){window.zEventsPerfData=[],window.zClickEventsData=[],window.zFetchTempData=[],window.zEventsData=[],window.zCustomEventData=[],window.zPagePerfData=[]}var cr=function(e){try{var t,n,r=document.cookie,o=null==r?void 0:r.split(";"),i=!1;return o.forEach(function(r){var o=r.split("=");if(o[0].trim()===e){var a=o[1].split(",");a.length>1?(n=dr(a),i=!0):t=o[1]?o[1]:""}}),i?n:t}catch(e){return void L("inside zGetCookie catch block")}},lr=function(e,t){var n=Wn.getInstance(),r=new Date((new Date).valueOf()+216e5).toUTCString();document.cookie=e+"="+t+"; path=/; domain="+n.rootDomain+"; expires="+r+";"},ur=function(e){var t=Wn.getInstance(),n=new Date((new Date).valueOf()-1e3).toUTCString();document.cookie=e+'=""; path=/; domain='+t.rootDomain+"; expires="+n+";"},dr=function(e){var t={};return e.forEach(function(e){var n=e.split("#");t[n[0]]=n[1]?n[1]:""}),t||{}},pr=function(e){var t=cr(e+d.enduser_last_activity_time),n=cr(e+d.total_data_sent)?cr(e+d.total_data_sent):"0",r=cr(e+d.session_data),o=cr(e+d.last_activity_time),i=Tn.getInstance();try{if(o){(t||r||o)&&(i.isSessionExpired=!1);var a="0:"+mr().replace("-",":");wn("ztotal-data-sent",n),wn("last-activity-time",o),wn("zenduser-last-activity-time",t),i.enduserLastActivityTime=t,i.lastActivityTime=o;var s=Dn()||{},c=zn()||{},l=er()||{};s.isBlocked="true"===(null==r?void 0:r.isBlocked),s.euId=Number(null==r?void 0:r.euId),s.zAnonymsUserInfo.zId=(null==r?void 0:r.zId)||"",Fn()||(s.zExternalUserInfo.externalId=(null==r?void 0:r.externalId)||""),c.isBlocked="true"===(null==r?void 0:r.isBlocked),l.dSession=a,l.sessionId=(null==r?void 0:r.sessionId)||"",l.sdkKey=(null==r?void 0:r.sdkKey)||"",wn("zId",(null==r?void 0:r.zId)||""),Rn(c),wn("zenduser-info",JSON.stringify(s)),wn("zenduser-info-temp",JSON.stringify(s)),wn("session-data",JSON.stringify(l))}}catch(e){return void L("inside zSetLocalStorageDataFromCookie catch block")}},fr=function(e){var t=function(){try{var e=Dn(),t=zn(),n=er()||{},r=yn("zId"),o=yn("last-activity-time"),i=yn("ztotal-data-sent")?yn("ztotal-data-sent"):"0",a=yn("zenduser-last-activity-time");return{sessionId:null==n?void 0:n.sessionId,zId:r,euId:null==e?void 0:e.euId,isBlocked:null==t?void 0:t.isBlocked,sdkKey:null==n?void 0:n.sdkKey,lastActivityTime:o,totalDataSent:i,endUserLastActivityTime:a,externalId:(null==e?void 0:e.zExternalUserInfo.externalId)||""}}catch(e){return void L("inside zGetCookieDatafromLocalStorage catch block")}}();try{var n="sessionId#"+t.sessionId+",isBlocked#"+t.isBlocked+",sdkKey#"+e+",zId#"+t.zId+",euId#"+Number(t.euId)+",externalId#"+t.externalId;lr(e+d.session_data,n),lr(e+d.last_activity_time,t.lastActivityTime),lr(e+d.enduser_last_activity_time,t.endUserLastActivityTime),lr(e+d.total_data_sent,t.totalDataSent)}catch(e){return void L("inside zSetCookieDataFromLocalStorage catch block")}};function gr(){return Date.now()}function hr(e,t,n){var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}function mr(){var e=Math.floor(Date.now()/1e3);return An()+"-"+e}function vr(e){var t={externalId:"enduser_external_id",firstName:"eu_first_name",lastName:"eu_last_name",email:"eu_email",age:"eu_age",customerName:"eu_customer_name",avatar:"eu_avatar",phone:"eu_phone"};return e in t?t[e]:e}function yr(e,t,n){var r=e.split("//")[1];return t&&(n["X-host"]=r),n}var wr,Ir={attributes:!0,childList:!0,characterData:!0,subtree:!0};!function(e){e[e.Progress=0]="Progress",e[e.Completed=1]="Completed",e[e.Failed=2]="Failed"}(wr||(wr={}));var Sr={domCapture:!0,consoleCapture:!0,networkCapture:!0,stackTraceCapture:!0,webSocketsCapture:!1,ipCapture:!0,inputMasking:!0,textMasking:!1,paid:!1,apiKey:"",streamUrl:"https://collector.zipy.ai",perfUrl:"https://perfcollector.zipy.ai",heatMapUrl:"https://heatmapcollector.zipy.ai",pagePerfUrl:"https://pageperfcollector.zipy.ai",customEventUrl:"https://customeventcollector.zipy.ai",maxBufferSize:5e6,compression:!0,compressionType:"gzip",timeFrequency:1e3,perfTimeFrequency:5e3,clickTimeFrequency:1e3,encodingType:"",sessionTimeout:18e5,failureRetryCount:5,bufferSizeFrequency:1048576,perfBufferSizeFrequency:1024,clickBufferSizeFrequency:1024,ignoreUrl:["google.com","zipy.ai","mixpanel","extreme-ip-lookup.com","hotjar","smartlook.com","newrelic.com","bugsnag","fullstory","sentry.io","google-analytics.com","bam.nr-data.net","wistia.com","amplitude.com","segment.io","pendo.io","raygun","smartlook.cloud","segment.com","visualstudio.com","stats.g.doubleclick.net","pagead2.googlesyndication.com","r.lr-in.com","clarity.ms","appcues.net","datadoghq.com"],ignoreError:["rrweb","zipy","Script error","pagead2.googlesyndication.com","adsbygoogle"],ignoreConsole:["{}"],isIgnoreUrlError:["google.com","zipy.ai","mixpanel","extreme-ip-lookup.com","hotjar","smartlook.com","newrelic.com","bugsnag","fullstory","sentry.io","google-analytics.com","bam.nr-data.net","wistia.com","amplitude.com","segment.io","pendo.io","raygun","smartlook.cloud","segment.com","visualstudio.com","stats.g.doubleclick.net","pagead2.googlesyndication.com","r.lr-in.com","clarity.ms","appcues.net","datadoghq.com"],isIgnoreConsoleError:["{}"],ip:"",pack:!0,blockClasses:"zipy-block",xhrReqPayloadCapture:!1,xhrRespPayloadCapture:!1,canvasCapture:!1,scrubbingKey:["password","secret","passwd","api_key","apikey","access_token","auth","credentials","mysql_pwd","stripetoken","cardnumber"],requestCapSize:1e6,responseCapSize:1e6,sizeExceededMessage:{message:"size too large",source:"zipy"},eventCountCapInSingleChunk:0,captureCustomZipyLogMessage:!1,captureCustomZipyLogError:!1,captureCustomZipyLogException:!1,startCaptureWithoutUserActivity:!1,consoleLogLevel:"3",recordCrossOriginIframes:!0,splitSessionSize:0,capturePerformance:!1,capturePagePerf:!1,captureClickEvents:!1,captureCustomEvents:!1,isApiIdentifierEnable:!1,apiUniqueIdentifier:[],ignoreUrlErrorCodes:{},ignoreUrlCodes:{},sessionStitching:!1,captureCancelledRequest:!1,clsEventCount:5,clsTimeout:3e4,xhrEventsTimeout:3e4,blockSelector:"",maxCustomEventProperties:10,maxCustomEventPayloadSize:524288,sanitizePayloadResponse:!0,captureUTM:!1};function Cr(e){return fn({},e,{timestamp:gr()})}function Er(){try{return window.sdkConfig?window.sdkConfig:Sr}catch(e){return L("Failed to parse end user Info data"),Sr}}function br(e){try{var t=Er();return t&&t.hasOwnProperty&&t.hasOwnProperty(e)?t[e]:null}catch(e){return L(e.message?JSON.stringify(e):e),null}}var kr=function(e,t,n){return e&&e.constructor===String&&n.indexOf(e)===t},Ar=function(e){return e&&e.constructor===String&&e.trim()};function Tr(){var e=br("headersToSanitize");return e&&e.length?e.split(","):[]}function Nr(e){if(!Array.isArray(e))return[];for(var t,n=[],r=pn(e);!(t=r()).done;){var o=t.value;try{o&&"object"==typeof o&&JSON.stringify(o)?o.constructor.name.toLowerCase().includes("error")?n.push({message:o.message,name:o.name,stack:o.stack}):n.push(o):n.push(String(o))}catch(e){n.push("[console log value cannot be serialized]")}}return n}var Rr=[];try{Rr=br("scrubbingKey")||[]}catch(e){L("Error in obtaining scrubbing keys"),Rr=Sr.scrubbingKey}function Or(e){try{var t=new URL(e);if(e){var n=new URLSearchParams(new URL(e).search);n.forEach(function(e,t){Rr.includes(t.toLowerCase())&&n.set(t,"xxx")}),t.search=n.toString()}return t.toString()}catch(t){return L("updateQueryStringFromRequestUrl: ERROR WHILE HIDING QUERY PARAM VALUE: "+t),e}}function zr(e,t,n){n++;try{e&&"object"==typeof e&&n<=2&&Object.keys(e).forEach(function(r){Rr.includes(r.toLowerCase())&&(e[r]="xxx"),t.push(r);var o=e[r];"object"==typeof o&&zr(o,t,n)})}catch(e){L("error while hiding the sensitive information: "+e)}return JSON.stringify(e)}function Mr(e,t,n,r){var o=r?e.request:e.response,i=br(r?"xhrReqPayloadCapture":"xhrRespPayloadCapture"),a=function(t){try{r?(e.request=t,""!=e.request&&(e.requestByteSize=n)):(e.response=t,""!=e.response&&(e.responseByteSize=n))}catch(e){L("error while converting xhr data to string"+e)}};if(i){var s=br("responseCapSize")||1e6,c=br("requestCapSize")||1e6,l=r?c:s,u=br("sizeExceededMessage"),d=br("sanitizePayloadResponse");"string"==typeof o&&o.length>0?(n=n||o.length)<=l?d&&function(){try{a(zr(JSON.parse(o),[],t))}catch(t){var e=Rr.some(function(e){return o.indexOf(e)>=0});a(o=r?e?"No request payload captured for this request as you may have some sensitive information in the payload.":o:e?"No response captured for this request as you may have some sensitive information in the payload.":o)}}():n>0&&a(JSON.stringify(u)):"object"==typeof o?(n=n||JSON.stringify(o,null,4).length)<=l?d&&a(zr(o,[],t)):n>0&&a(u):o&&o.length>0&&((n=n||o.length)<=l?d&&a(zr(o,[],t)):n>0&&a(JSON.stringify(u)))}else r?e.request="":e.response="";return e}function Dr(e){if(!e)return!1;var t=e.toLowerCase(),n=br("ignoreError")||[];try{if(n.some(function(e){return t.includes(e.toLowerCase())}))return x("Ignoring error for data: "+e),!0}catch(e){L("Error in ignore errors. Error - "+e.message)}return!1}function xr(){try{return window.self!==window.top}catch(e){return!0}}function Ur(e,n){if(e&&null!=e)try{var r="";r="string"!=typeof e?JSON.stringify(e):e;for(var o=t.RangeError;o<=t.EvalError;o++)if(-1!=r.search(t[o]))return o}catch(e){L(e)}return n}function Lr(e){switch(e){case"link":case"css":return t.Link;case"img":case"image":return t.Image;case"script":return t.Js;case"fetch":case"beacon":case"xmlhttprequest":return t.XHR;case"other":return t.OtherNetworkCall;default:return 0}}var Pr=["img","script","css","link","image","script"];function Fr(e,t,n){try{var r=br("isIgnoreUrlError"),o=br("ignoreUrl"),i=br("ignoreUrlErrorCodes"),a=br("ignoreUrlCodes"),s=[],c={};n?(s=r,c=i||{}):(s=o,c=a||{});var l=function(e,n){return!!e.includes(n.toLowerCase())&&function(e){return!c.hasOwnProperty(e)||c[e].includes(t)}(n)},u=e.toLowerCase(),d=_r(u),p=u.indexOf("?"),f=u,g=d;return p>0&&(f=f.substring(0,p),g=_r(f)),s.some(function(e){return e.includes("?")?e.includes("{id}")?l(d,e):l(u,e):e.includes("{id}")?l(g,e):l(f,e)})}catch(t){L("Error in url decoding for url : "+e+" Error is - "+t)}return!1}function Gr(e){return{initiatorType:e.initiatorType,nextHopProtocol:e.nextHopProtocol,workerStart:e.workerStart,redirectStart:e.redirectStart,redirectEnd:e.redirectEnd,fetchStart:e.fetchStart,domainLookupStart:e.domainLookupStart,domainLookupEnd:e.domainLookupEnd,connectStart:e.connectStart,connectEnd:e.connectEnd,secureConnectionStart:e.secureConnectionStart,requestStart:e.requestStart,responseStart:e.responseStart,responseEnd:e.responseEnd,transferSize:e.transferSize,encodedBodySize:e.encodedBodySize,decodedBodySize:e.decodedBodySize,responseStatus:e.responseStatus,renderBlockingStatus:e.renderBlockingStatus,duration:e.duration,entryType:e.entryType,name:e.name,startTime:e.startTime}}function _r(e){try{var t=e.match(/\/\d+\//g);if(t)for(var n,r=pn(t);!(n=r()).done;)e=e.replace(n.value,"/{id}/")}catch(e){L("Error while masking numeric value.")}return e}function Br(e,t){if(!(e.indexOf("http://")>-1||e.indexOf("https://")>-1)){var n=new URL(t);return n.pathname+n.search===e}return!1}function Wr(){var e=window.navigator.userAgent;return/Mobi|Android/i.test(e)?"Mobile":/Tablet|iPad/i.test(e)?"Tablet":"Web"}function Zr(e){if("online"!=(navigator.onLine?"online":"offline")){if(!window.iszInternetDisconnected)return window.iszInternetDisconnected=!0,x("handleConnectionChange :: send internet disconnected"),e(Cr({eventType:t.Offline,data:{status:"Offline",type:""},isError:!1}))}else var n=setInterval(function(){fetch("//google.com",{mode:"no-cors"}).then(function(){return window.iszInternetDisconnected&&(window.iszInternetDisconnected=!1,x("handleConnectionChange :: send internet connected"),e(Cr({eventType:t.Online,data:{status:"Online",type:""},isError:!1}))),clearInterval(n)}).catch(function(){window.iszInternetDisconnected||(window.iszInternetDisconnected=!0,x("handleConnectionChange :: send internet disconnected"),e(Cr({eventType:t.Offline,data:{status:"Offline",type:""},isError:!1})))})},5e3)}var Vr,qr=function(e){try{var t,n=function(n,r){try{var o="string"==typeof e.data.response?(t=1,e):"xmlHttpClient"===e.data.sourceLibrary&&"Blob"===(null==(i=e.data.response)||null==(i=i.constructor)?void 0:i.name)?Promise.resolve(new Response(e.data.response).text()).then(function(t){e.data.response=t}):function(){if("fetch"===e.data.sourceLibrary&&e.data.response instanceof Promise)return Promise.resolve(e.data.response).then(function(t){e.data.response=t});throw new Error("Unsupported response type: "+typeof e.data.response)}()}catch(e){return r(e)}var i;return o&&o.then?o.then(void 0,r):o}(0,function(t){L("Error in resolving response. Error is - "+t.message),e.data.response=""});return Promise.resolve(n&&n.then?n.then(function(n){return t?n:e}):t?n:e)}catch(e){return Promise.reject(e)}},Kr=Uint8Array,Jr=Uint16Array,Hr=Int32Array,jr=new Kr([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,0,0,0]),Yr=new Kr([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,0,0]),Xr=new Kr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Qr=function(e,t){for(var n=new Jr(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new Hr(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return{b:n,r:o}},$r=Qr(jr,2),eo=$r.r;$r.b[28]=258,eo[258]=28;for(var to=Qr(Yr,0).r,no=new Jr(32768),ro=0;ro<32768;++ro){var oo=(43690&ro)>>1|(21845&ro)<<1;no[ro]=((65280&(oo=(61680&(oo=(52428&oo)>>2|(13107&oo)<<2))>>4|(3855&oo)<<4))>>8|(255&oo)<<8)>>1}var io=function(e,t,n){for(var r=e.length,o=0,i=new Jr(t);o<r;++o)e[o]&&++i[e[o]-1];var a,s=new Jr(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(n){a=new Jr(1<<t);var c=15-t;for(o=0;o<r;++o)if(e[o])for(var l=o<<4|e[o],u=t-e[o],d=s[e[o]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)a[no[d]>>c]=l}else for(a=new Jr(r),o=0;o<r;++o)e[o]&&(a[o]=no[s[e[o]-1]++]>>15-e[o]);return a},ao=new Kr(288);for(ro=0;ro<144;++ro)ao[ro]=8;for(ro=144;ro<256;++ro)ao[ro]=9;for(ro=256;ro<280;++ro)ao[ro]=7;for(ro=280;ro<288;++ro)ao[ro]=8;var so=new Kr(32);for(ro=0;ro<32;++ro)so[ro]=5;var co=/*#__PURE__*/io(ao,9,0),lo=/*#__PURE__*/io(so,5,0),uo=function(e){return(e+7)/8|0},po=function(e,t,n){return(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length),new Kr(e.subarray(t,n))},fo=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>8},go=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>8,e[r+2]|=n>>16},ho=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,i=n.slice();if(!o)return{t:Co,l:0};if(1==o){var a=new Kr(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=o-1;)s=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var p=i[0].s;for(r=1;r<o;++r)i[r].s>p&&(p=i[r].s);var f=new Jr(p+1),g=mo(n[u-1],f,0);if(g>t){r=0;var h=0,m=g-t,v=1<<m;for(i.sort(function(e,t){return f[t.s]-f[e.s]||e.f-t.f});r<o;++r){var y=i[r].s;if(!(f[y]>t))break;h+=v-(1<<g-f[y]),f[y]=t}for(h>>=m;h>0;){var w=i[r].s;f[w]<t?h-=1<<t-f[w]++-1:++r}for(;r>=0&&h;--r){var I=i[r].s;f[I]==t&&(--f[I],++h)}g=t}return{t:new Kr(f),l:g}},mo=function(e,t,n){return-1==e.s?Math.max(mo(e.l,t,n+1),mo(e.r,t,n+1)):t[e.s]=n},vo=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Jr(++t),r=0,o=e[0],i=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return{c:n.subarray(0,r),n:t}},yo=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},wo=function(e,t,n){var r=n.length,o=uo(t+2);e[o]=255&r,e[o+1]=r>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<r;++i)e[o+i+4]=n[i];return 8*(o+4+r)},Io=function(e,t,n,r,o,i,a,s,c,l,u){fo(t,u++,n),++o[256];for(var d=ho(o,15),p=d.t,f=d.l,g=ho(i,15),h=g.t,m=g.l,v=vo(p),y=v.c,w=v.n,I=vo(h),S=I.c,C=I.n,E=new Jr(19),b=0;b<y.length;++b)++E[31&y[b]];for(b=0;b<S.length;++b)++E[31&S[b]];for(var k=ho(E,7),A=k.t,T=k.l,N=19;N>4&&!A[Xr[N-1]];--N);var R,O,z,M,D=l+5<<3,x=yo(o,ao)+yo(i,so)+a,U=yo(o,p)+yo(i,h)+a+14+3*N+yo(E,A)+2*E[16]+3*E[17]+7*E[18];if(c>=0&&D<=x&&D<=U)return wo(t,u,e.subarray(c,c+l));if(fo(t,u,1+(U<x)),u+=2,U<x){R=io(p,f,0),O=p,z=io(h,m,0),M=h;var L=io(A,T,0);for(fo(t,u,w-257),fo(t,u+5,C-1),fo(t,u+10,N-4),u+=14,b=0;b<N;++b)fo(t,u+3*b,A[Xr[b]]);u+=3*N;for(var P=[y,S],F=0;F<2;++F){var G=P[F];for(b=0;b<G.length;++b)fo(t,u,L[B=31&G[b]]),u+=A[B],B>15&&(fo(t,u,G[b]>>5&127),u+=G[b]>>12)}}else R=co,O=ao,z=lo,M=so;for(b=0;b<s;++b){var _=r[b];if(_>255){var B;go(t,u,R[257+(B=_>>18&31)]),u+=O[B+257],B>7&&(fo(t,u,_>>23&31),u+=jr[B]);var W=31&_;go(t,u,z[W]),u+=M[W],W>3&&(go(t,u,_>>5&8191),u+=Yr[W])}else go(t,u,R[_]),u+=O[_]}return go(t,u,R[256]),u+O[256]},So=/*#__PURE__*/new Hr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Co=/*#__PURE__*/new Kr(0),Eo=function(){var e=1,t=0;return{p:function(n){for(var r=e,o=t,i=0|n.length,a=0;a!=i;){for(var s=Math.min(a+2655,i);a<s;++a)o+=r+=n[a];r=(65535&r)+15*(r>>16),o=(65535&o)+15*(o>>16)}e=r,t=o},d:function(){return(255&(e%=65521))<<24|(65280&e)<<8|(255&(t%=65521))<<8|t>>8}}},bo=function(e,t,n,r,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),a=new Kr(i.length+e.length);a.set(i),a.set(e,i.length),e=a,o.w=i.length}return function(e,t,n,r,o,i){var a=i.z||e.length,s=new Kr(r+a+5*(1+Math.ceil(a/7e3))+o),c=s.subarray(r,s.length-o),l=i.l,u=7&(i.r||0);if(t){u&&(c[0]=i.r>>3);for(var d=So[t-1],p=d>>13,f=8191&d,g=(1<<n)-1,h=i.p||new Jr(32768),m=i.h||new Jr(g+1),v=Math.ceil(n/3),y=2*v,w=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&g},I=new Hr(25e3),S=new Jr(288),C=new Jr(32),E=0,b=0,k=i.i||0,A=0,T=i.w||0,N=0;k+2<a;++k){var R=w(k),O=32767&k,z=m[R];if(h[O]=z,m[R]=O,T<=k){var M=a-k;if((E>7e3||A>24576)&&(M>423||!l)){u=Io(e,c,0,I,S,C,b,A,N,k-N,u),A=E=b=0,N=k;for(var D=0;D<286;++D)S[D]=0;for(D=0;D<30;++D)C[D]=0}var x=2,U=0,L=f,P=O-z&32767;if(M>2&&R==w(k-P))for(var F=Math.min(p,M)-1,G=Math.min(32767,k),_=Math.min(258,M);P<=G&&--L&&O!=z;){if(e[k+x]==e[k+x-P]){for(var B=0;B<_&&e[k+B]==e[k+B-P];++B);if(B>x){if(x=B,U=P,B>F)break;var W=Math.min(P,B-2),Z=0;for(D=0;D<W;++D){var V=k-P+D&32767,q=V-h[V]&32767;q>Z&&(Z=q,z=V)}}}P+=(O=z)-(z=h[O])&32767}if(U){I[A++]=268435456|eo[x]<<18|to[U];var K=31&eo[x],J=31&to[U];b+=jr[K]+Yr[J],++S[257+K],++C[J],T=k+x,++E}else I[A++]=e[k],++S[e[k]]}}for(k=Math.max(k,T);k<a;++k)I[A++]=e[k],++S[e[k]];u=Io(e,c,l,I,S,C,b,A,N,k-N,u),l||(i.r=7&u|c[u/8|0]<<3,u-=7,i.h=m,i.p=h,i.i=k,i.w=T)}else{for(k=i.w||0;k<a+l;k+=65535){var H=k+65535;H>=a&&(c[u/8|0]=l,H=a),u=wo(c,u+1,e.subarray(k,H))}i.i=a}return po(s,0,r+uo(u)+o)}(e,null==t.level?6:t.level,null==t.mem?o.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,n,r,o)},ko=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Ao=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var o=Eo();o.p(t.dictionary),ko(e,2,o.d())}},To="undefined"!=typeof TextEncoder&&/*#__PURE__*/new TextEncoder,No="undefined"!=typeof TextDecoder&&/*#__PURE__*/new TextDecoder;try{No.decode(Co,{stream:!0})}catch(e){}function Ro(e){try{return window.sessionStorage.getItem(e)||""}catch(e){return L("inside zSessionStorageGetItem catch block "+e.message),""}}function Oo(e,t){try{window.sessionStorage.setItem(e,t)}catch(e){console.error("inside zSessionStorageSetItem catch block "+e.message)}}var zo=/*#__PURE__*/function(){function e(){this.dataSync=void 0,this.sdkTimer=void 0,this.dataSync=A.IDLE,this.sdkTimer=N.START}return e.prototype.isDataProcessingDone=function(){var e=this;return new Promise(function(t,n){var r=setInterval(function(){e.dataSync!==A.PENDING&&(t(!0),clearInterval(r))},1)})},e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e}();zo.instance=void 0;var Mo=function(e,t,n){void 0===t&&(t=0);try{var r={v:z.sdkVersion,e:"Production",o:t,ns:n};if(t==o.POSTENDUSERINFOANDGETUSERCONFIG||t==o.GETUSERCONFIG){var a=Nn();window.sdkConfig=a||Sr}var s=zn(),c=Tn.getInstance();if(s&&s.isBlocked)return D("Not going to call post end user info as session is already blocked"),Promise.resolve(window.sdkConfig);window.iszHandshakeDone=!1,window.zpendingOp=t,x("config.sdkversion"+z.sdkVersion);var l=xn()||{zAnonymsUserInfo:{}},u={},d=i.ANONYMS;if(l){var p,f=l.zExternalUserInfo||{};for(var g in f)u[vr(g)]=f[g]?f[g]:"";u.enduser_zipy_id=null==(p=l.zAnonymsUserInfo)?void 0:p.zId,f.externalId&&(D("Get User info for user Type Identified "+f.externalId),d=i.IDENTIFIED)}return window.ztryForHandshake=!1,Promise.resolve(qn(z.streamMgrUrl+"/"+e,z.streamMgrRetryCount,r,u)).then(function(n){if(n)if((null==n?void 0:n.api_key)==e){var r=zn(),a=er()||{},s=!(null==n||!n.is_blocked)&&(null==n?void 0:n.is_blocked);if(c.sessionId=a.sessionId,c.apiKey=a.sdkKey,c.isNewSession=a.isNewSession,c.isSessionExpired=!1,c.lastActivityTime=Date.now(),c.enduserLastActivityTime=Date.now(),c.sessionBlockInfo=r,r&&(r.isBlocked||function(e,t){var n,r=(null==e?void 0:e.blocked_till)>0?null==e?void 0:e.blocked_till:0,o=r>0?gr()+r:0,i=!(null==e||!e.is_blocked)&&(null==e?void 0:e.is_blocked);Tn.getInstance().sessionBlockInfo=n={isBlocked:i,apiKey:t,blockedEndTime:o},Rn(n)}(n,e)),s)return window.sdkConfig;if(t==o.POSTENDUSERINFOANDGETUSERCONFIG||t==o.GETUSERCONFIG){var u=Wo(n);window.iszHandshakeDone=!0,D("sdkConfigResp"+JSON.stringify(u)),u&&(window.sdkConfig=u)}if(t==o.POSTENDUSERINFOANDGETUSERCONFIG||t==o.POSTENDUSERINFO){var p=n.enduser_info||{};D("Response object received for End User from stream manager: "+JSON.stringify(p)),p&&(D("Going to add enduser info after data parsing"),l.userType=d,l.euId=p.id?p.id:0,l.euZName=p.zipy_eu_name?p.zipy_eu_name:"",l.isBlocked=!!p.is_blocked&&p.is_blocked,d==i.ANONYMS&&(l.zAnonymsUserInfo.euId=l.euId,l.zAnonymsUserInfo.euZName=l.euZName,l.zExternalUserInfo={}),Un(l),Pn())}}else L("Not able to get response from stream manager for sdk Key: "+e);else L("Not able to get response from stream manager ");return window.sdkConfig})}catch(e){return Promise.reject(e)}},Do=function(e){try{var n,r=Er(),o=window.zCustomEventData||[],i=Wn.getInstance(),a="";try{a=JSON.stringify(o)}catch(e){L("Failed to stringify zEvents")}var s=o.length,c=function(){if(2*a.length>=r.bufferSizeFrequency||window.customEventLastSynctime+r.timeFrequency<=Date.now()&&s>0){var c=o.slice(0,s),l=er()||{},u={key:e,s_id:l.sessionId,events:c,eventType:t.CustomEvent},d=(i.proxyURL?i.proxyURL:r.customEventUrl)+"/customevent";return Qn()?(window.isDataSyncInProgress=!0,Promise.resolve(Vn(d,u,r.failureRetryCount)).then(function(e){if(e)return window.customEventLastSynctime=Date.now(),function(e){window.zCustomEventData&&Array.isArray(window.zCustomEventData)?window.zCustomEventData.splice(0,e):window.zCustomEventData=[]}(s),window.isDataSyncInProgress=!1,n=!0;window.isDataSyncInProgress=!1})):(n=1,!1)}}();return Promise.resolve(c&&c.then?c.then(function(e){return!n||e}):!n||c)}catch(e){return Promise.reject(e)}},xo=function(e){try{var n,r=Er(),o=window.zPagePerfData||[],i="",a=Wn.getInstance();try{i=JSON.stringify(o)}catch(e){L("Failed to stringify zEvents")}var s=o.length,c=function(){if(2*i.length>=r.perfBufferSizeFrequency||window.pagePerfLastSynctime+r.perfTimeFrequency<=Date.now()&&s>0){var c,l,u=o.slice(0,s),d=er()||{},p=Dn()||{},f=yn("zId"),g=null!=(c=p.zExternalUserInfo)&&c.externalId?null==(l=p.zExternalUserInfo)?void 0:l.externalId:"",h=/\((.*)\)/.exec((new Date).toString())[1],m=rr(),v={key:e,sdk_ver:z.sdkVersion,src:"Frontend",s_id:d.sessionId,euz_id:f,eue_id:g,events:u,eu_info_id:p.euId,rel_ver:window.zRelVer,handshake_status:window.iszHandshakeDone,ip:r.ip,deviceName:Wr()||"",userAgent:window.navigator.userAgent,timeZone:h,eventType:t.WebVitals,pack:m},y=(a.proxyURL?a.proxyURL:r.pagePerfUrl)+"/pageperf";return Qn()?(window.isDataSyncInProgress=!0,Promise.resolve(Kn(y,v,r.failureRetryCount)).then(function(e){if(e)return window.pagePerfLastSynctime=Date.now(),function(e){window.zPagePerfData&&Array.isArray(window.zPagePerfData)?window.zPagePerfData.splice(0,e):window.zPagePerfData=[]}(s),window.isDataSyncInProgress=!1,n=!0;window.isDataSyncInProgress=!1})):(n=1,!1)}}();return Promise.resolve(c&&c.then?c.then(function(e){return!n||e}):!n||c)}catch(e){return Promise.reject(e)}},Uo=function(e){try{var t,n=Er(),r=window.zClickEventsData||[],o=Wn.getInstance(),i="";try{i=JSON.stringify(r)}catch(e){L("Failed to stringify zEvents")}var a=r.length,s=function(){if(2*i.length>=n.bufferSizeFrequency||window.clickLastSyncTime+n.timeFrequency<=Date.now()&&a>0){var s,c,l=r.slice(0,a),u=er()||{},d=Dn()||{},p=yn("zId"),f=null!=(s=d.zExternalUserInfo)&&s.externalId?null==(c=d.zExternalUserInfo)?void 0:c.externalId:"",g=/\((.*)\)/.exec((new Date).toString())[1],h=rr(),m={key:e,sdk_ver:z.sdkVersion,src:"Frontend",s_id:u.sessionId,euz_id:p,eue_id:f,events:l,eu_info_id:d.euId,rel_ver:o.releaseVer,handshake_status:window.iszHandshakeDone,ip:n.ip,deviceName:Wr()||"",userAgent:window.navigator.userAgent,timeZone:g,eventType:De.Click,pack:h},v=(o.proxyURL?o.proxyURL:n.heatMapUrl)+"/heatmap";return Qn()?(window.isDataSyncInProgress=!0,Promise.resolve(Jn(v,m,n.failureRetryCount)).then(function(e){if(e)return window.clickLastSyncTime=Date.now(),function(e){window.zClickEventsData&&Array.isArray(window.zClickEventsData)?window.zClickEventsData.splice(0,e):window.zClickEventsData=[]}(a),window.isDataSyncInProgress=!1,t=!0;window.isDataSyncInProgress=!1})):(t=1,!1)}}();return Promise.resolve(s&&s.then?s.then(function(e){return!t||e}):!t||s)}catch(e){return Promise.reject(e)}},Lo=function(e){try{var t,n=Er(),r=Wn.getInstance();x("Data Length for direct streaming ");var o=window.zEventsPerfData||[],i=o.length,a=function(){if(2*o.length>=n.perfBufferSizeFrequency||window.perfLastSyncTime+n.perfTimeFrequency<=Date.now()&&i>0){var a,s,c=o.slice(0,i),l=er()||{},u=Dn()||{},d=yn("zId"),p=null!=(a=u.zExternalUserInfo)&&a.externalId?null==(s=u.zExternalUserInfo)?void 0:s.externalId:"",f=/\((.*)\)/.exec((new Date).toString())[1],g={key:e,sdk_ver:z.sdkVersion,isNPM:z.isNPM,src:"Frontend",s_id:l.sessionId,euz_id:d,eue_id:p,events:c,eu_info_id:u.euId,rel_ver:r.releaseVer,handshake_status:window.iszHandshakeDone,ip:n.ip,deviceName:"",screenWidth:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,screenHeight:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,userAgent:window.navigator.userAgent,timeZone:f},h=(r.proxyURL?r.proxyURL:n.perfUrl)+"/perf";return Qn()?(window.isDataSyncInProgress=!0,Promise.resolve(Hn(h,g,n.failureRetryCount)).then(function(e){if(e)return window.perfLastSyncTime=Date.now(),n=i,window.zEventsPerfData&&Array.isArray(window.zEventsPerfData)?window.zEventsPerfData.splice(0,n):window.zEventsPerfData=[],window.isDataSyncInProgress=!1,t=!0;var n;window.isDataSyncInProgress=!1})):(t=1,!1)}}();return Promise.resolve(a&&a.then?a.then(function(e){return!t||e}):!t||a)}catch(e){return Promise.reject(e)}},Po=function(e){try{var t=Er(),n=window.zEventsData||[],r=Wn.getInstance(),o=Tn.getInstance(),i=zo.getInstance();x("Data Length for direct streaming ");var a="";try{a=JSON.stringify(n)}catch(e){L("Failed to stringify zEvents")}var s=null!=t&&t.eventCountCapInSingleChunk?t.eventCountCapInSingleChunk:0,c=s>0&&n.length>s?s:n.length;if(window.lastSyncDataLength=c,D("Going to send data with chunk "+c+" total events count "+n.length+" chunk size "+s),2*a.length>=t.bufferSizeFrequency||window.lastSyncTime+t.timeFrequency<=Date.now()&&c>0){var l,u,d=n.slice(0,c),p=er()||{},f=Dn()||{},g=yn("zId"),h=null!=(l=f.zExternalUserInfo)&&l.externalId?null==(u=f.zExternalUserInfo)?void 0:u.externalId:"",m=/\((.*)\)/.exec((new Date).toString())[1],v=rr(),y={key:e,sdk_ver:z.sdkVersion,isNPM:z.isNPM,src:"Frontend",s_id:p.sessionId,euz_id:g,eue_id:h,events:d,eu_info_id:f.euId,rel_ver:r.releaseVer,handshake_status:window.iszHandshakeDone,ip:t.ip,deviceName:"",screenWidth:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,screenHeight:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,userAgent:window.navigator.userAgent,timeZone:m,pack:v},w="";try{w=JSON.stringify(y)}catch(e){L("Failed to stringify zipyDataJson")}var I={eventData:w};if(Zo())return function(){for(;window.zEventsData.length;)window.zEventsData.pop();window.zEventsData=[]}(),Promise.resolve(!0);var S={session_id:p.dSession,event_id:"AruZ~Em0WNlAnbyzVmwM~GR0cMb6Xl9r",is_new_party:p.isNewSession,is_new_session:p.isNewSession,client_timestamp_iso:(new Date).toISOString(),event_type:"MyEventRecord",parameters:I},C=(r.proxyURL?r.proxyURL:t.streamUrl)+"?p="+p.sessionId;return Qn()?(window.isDataSyncInProgress=!0,i.dataSync=A.PENDING,Promise.resolve(jn({divolteUrl:C,divolteJson:S,failureRetryCount:t.failureRetryCount})).then(function(e){if(e){if(window.lastSyncTime=Date.now(),function(e){window.zEventsData&&Array.isArray(window.zEventsData)?window.zEventsData.splice(0,e):window.zEventsData=[]}(c),window.isDataSyncInProgress=!1,i.dataSync=A.SUCCESS,wn("last-activity-time",o.lastActivityTime.toString()),wn("zenduser-last-activity-time",o.enduserLastActivityTime.toString()),p.isNewSession){var t=er();if(t){t.isNewSession=!1,o.isNewSession=!1;try{wn("session-data",JSON.stringify(t))}catch(e){L("Failed to set session-data in localstorage")}}}return!0}return window.isDataSyncInProgress=!1,i.dataSync=A.FAILED,!1})):(wn("last-activity-time",o.lastActivityTime.toString()),wn("zenduser-last-activity-time",o.enduserLastActivityTime.toString()),i.dataSync=A.FAILED,Promise.resolve(!1))}return Promise.resolve(!1)}catch(e){return Promise.reject(e)}};function Fo(e,n){void 0===e&&(e=Sr.inputMasking);var r=Wn.getInstance(),o=Tn.getInstance();x("Going to init rrweb Recorder"),window.zrrwebRecorderStatus=a.RECORDINGPENDING;var i,s=function(){};try{var c=Er();s=Dt({emit:function(e,n){if(!xr()||r.recordOnlyIframe){var i=-1;e.type!=ze.IncrementalSnapshot?i=t.ReplayerEvent:(i=e.data.source?e.data.source:t.ReplayerEvent,(c.startCaptureWithoutUserActivity||i>=t.MouseInteraction&&i<=t.MediaInteraction)&&(window.zrrwebRecorderStatus=a.RECORDINGSUCCESSFUL,o.enduserLastActivityTime=Date.now()));try{var s=!1;window.reinitializationInProgress||(s=rr());var l={data:s?un(e):JSON.stringify(e),time:e.timestamp,type:i,rrwebEvent:null==e?void 0:e.type,isError:!1,navigatedUrl:window.location.origin+window.location.pathname};if(n&&e.type==ze.Meta?(o.isCheckoutFlowTriggered=!0,U("Checkout flow is triggered. Meta event expected type - "+ze.Meta+" actual event "+e.type),l.isCheckout=n):n&&U("Full snapshot event. Expected event type - "+ze.FullSnapshot+" Event type "+e.type),_o(l),ze.IncrementalSnapshot&&i===t.MouseInteraction&&c.captureClickEvents){var u=e.data;if(u.type&&u.type===De.Click){var d=function(e){D("Heatmap: Pack event");try{var t=function(e,t){var n;if(To)return To.encode(e);var r=e.length,o=new Kr(e.length+(e.length>>1)),i=0,a=function(e){o[i++]=e};for(n=0;n<r;++n){if(i+5>o.length){var s=new Kr(i+8+(r-n<<1));s.set(o),o=s}var c=e.charCodeAt(n);c<128?a(c):c<2048?(a(192|c>>6),a(128|63&c)):c>55295&&c<57344?(a(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++n))>>18),a(128|c>>12&63),a(128|c>>6&63),a(128|63&c)):(a(224|c>>12),a(128|c>>6&63),a(128|63&c))}return po(o,0,i)}(JSON.stringify(e));return function(e,t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}(function(e,t){t||(t={});var n=Eo();n.p(e);var r=bo(e,t,t.dictionary?6:2,4);return Ao(r,t),ko(r,r.length-4,n.d()),r}(t))}catch(e){return D("Heatmap: Unable to pack the data"),""}}(u);!function(e){var t=Er();window.zrecordingPaused||Zo()&&!tr(t)||Qn()&&t.captureClickEvents&&window.zClickEventsData.push(e)}({data:d,time:e.timestamp,type:u.type,isError:!1})}}}catch(e){L("Failed to store rrweb recorder events")}}},recordCanvas:br("canvasCapture"),blockClass:(i=br("blockClasses"),i&&"string"==typeof i?new RegExp(i):i instanceof RegExp?i:/zipy-block/),blockSelector:br("blockSelector"),ignoreClass:"zipy-ignore",maskAllInputs:e,sampling:{mousemove:150,scroll:150,mouseInteraction:{MouseUp:!0,MouseDown:!0,Click:!0,ContextMenu:!1,DblClick:!0,Focus:!1,Blur:!1,TouchStart:!0,TouchEnd:!0}},userTriggeredOnInput:!0,recordCrossOriginIframes:!r.recordOnlyIframe,captureClickEvents:c.captureClickEvents||!1,maskAllText:c.textMasking})}catch(e){L(e)}return s}function Go(e){var r=Tn.getInstance();return x("Going to init zipy Recorder"),function(e){void 0===e&&(e={});var r=e.emit;if(!r)return L("emit function is required to record data from zipy-event-recorder"),function(){};Vr=function(e){r(e)};try{var o=[],i=Er();return o.push(i.capturePagePerf?function(e){var n="",r=window.history.pushState,o=window.history.replaceState;if(window.history.pushState=function(){r.apply(window.history,arguments),window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange"))},window.history.replaceState=function(){o.apply(window.history,arguments),window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange"))},window.PerformanceObserver&&"function"==typeof window.PerformanceObserver){var i=function(t){var r=t.loadTime,o=t.navigationType,i=t.isRouteChange,a=t.navigationUrl,s=void 0===a?"":a,c=t.eventType;try{var l={navigatedUrl:s||window.location.href,loadTime:r,navigationType:o,isRouteChange:i};n!==s&&(e(Cr({eventType:c,data:l,isError:!1})),l.loadTime>-1&&(n=l.navigatedUrl))}catch(e){L("not able to capture the navigation url")}},a=function(){i({loadTime:-1,navigationType:"navigate",isRouteChange:!0,navigationUrl:window.location.href,eventType:t.NavigationStart});var e=0,n=0,r=null,o=1,a=window.location.href,s=new PerformanceObserver(function(e){e.getEntries().filter(function(e){return"fetch"!==e.initiatorType&&"xmlhttprequest"!==e.initiatorType}).forEach(function(e){n=performance.now()})}),c=new MutationObserver(function(){try{return n=performance.now(),Promise.resolve()}catch(e){return Promise.reject(e)}});e=performance.now(),n=performance.now(),s.observe({entryTypes:["resource"]}),c.observe(document,Ir),o>0&&(o=0,r=setInterval(function(){performance.now()-n>100&&(clearInterval(r),function(){s.disconnect(),c.disconnect(),r&&clearInterval(r);var l=n-e;x("Page Performance Observer: Page Load Time:"),i({loadTime:l,navigationType:"navigate",isRouteChange:!0,navigationUrl:a,eventType:t.NAVIGATION}),e=0,n=0,r=null,o=1}())},1e3))};window.buffered||i({loadTime:-1,navigationType:"current",isRouteChange:!1,navigationUrl:window.location.href,eventType:t.NAVIGATION});var s=new PerformanceObserver(function(e){var n=e.getEntries().find(function(e){return"navigation"===e.entryType});if(n){var r=n.name,o=n.loadEventEnd-n.startTime;o>0&&(x("Page Performance: Initial Page Load Time:"),i({loadTime:o,navigationType:n.type,isRouteChange:!1,navigationUrl:r,eventType:t.NAVIGATION}))}});return s.observe({type:"navigation",buffered:window.buffered}),window.addEventListener("locationchange",a,!1),window.addEventListener("popstate",a),window.addEventListener("hashchange",a),function(){history.pushState=r,history.replaceState=o,window.removeEventListener("locationchange",a),window.removeEventListener("popstate",a),window.removeEventListener("hashchange",a),s.disconnect()}}return function(){}}(Vr):function(e){var n=location.href,r=performance.getEntriesByType("navigation")[0],o={navigatedUrl:window.location.href,loadTime:-1,navigationType:window.location.href===(null==r?void 0:r.name)?"reload":"navigate",isRouteChange:!1};e(Cr({eventType:t.NAVIGATION,data:o,isError:!1}));var i=window.history.pushState,a=window.history.replaceState;function s(){try{var o={navigatedUrl:window.location.href,loadTime:-1,navigationType:window.location.href===(null==r?void 0:r.name)?"reload":"navigate",isRouteChange:!0};n!=o.navigatedUrl&&(e(Cr({eventType:t.NAVIGATION,data:o,isError:!1})),n=o.navigatedUrl)}catch(e){L("not able to capture the navigation url")}}return window.history.pushState=function(){i.apply(window.history,arguments),window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange"))},window.history.replaceState=function(){a.apply(window.history,arguments),window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange"))},window.addEventListener("locationchange",s,!1),window.addEventListener("popstate",s),window.addEventListener("hashchange",s),function(){history.pushState=i,history.replaceState=a,window.removeEventListener("locationchange",s),window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s)}}(Vr)),D("In zipy-event-record "+JSON.stringify(i)),i.consoleCapture&&o.push(function(e){function n(e){var t="";if("string"!=typeof e)try{t=JSON.stringify(e)}catch(e){}else t=e;try{if(-1!=t.search(s)||-1!=t.search(c))return!0}catch(e){return!0}return!1}function r(n,r){try{var o;o=function(e){if(!Array.isArray(e))return"";for(var t,n=[],r=pn(e);!(t=r()).done;){var o=t.value;try{o&&"object"==typeof o&&o instanceof Error?n.push(String(o)):n.push(new Error(JSON.stringify(o)))}catch(e){n.push("[console log value cannot be serialized]")}}return n.join(" ")}(Array.from(r));var i=n==t.ConsoleError,a=i?function(e){if(!Array.isArray(e))return{hasErrorObj:!1};for(var t,n=pn(e);!(t=n()).done;){var r=t.value;try{if(r&&"object"==typeof r&&(r.constructor.name.toLowerCase().includes("error")||(null==r?void 0:r.name).toLowerCase().includes("error")))return{hasErrorObj:!0,errObj:r}}catch(e){L("Error in checking error argument. Error is - "+e.message)}}return{hasErrorObj:!1}}(Array.from(r)):{hasErrorObj:!1};if(function(e,t,n){if(null==e)return!1;var r,o=e.toLowerCase(),i=Er();if(n[0]instanceof Error&&Dr(o))return!0;try{r=t?i.isIgnoreConsoleError:i.ignoreConsole}catch(e){L(e)}try{if(r.some(function(e){return o.includes(e.toLowerCase())&&function(e){try{var t=JSON.parse(e.split("error:")[1]);return Object.keys(t).length<1||"{}"===t}catch(e){return!0}}(o)}))return!0}catch(e){return!1}return!1}(o,i,r))return;if(i&&a.hasErrorObj){var s={message:o,error:a.errObj.stack,filename:"",colno:0,lineno:0};e(Cr({eventType:Ur(o,t.Error),data:s,isError:!0}))}else e(Cr({eventType:n,data:{arguments:o,argumentsObj:Nr(Array.from(r))},isError:i}))}catch(e){return void L("Error in parsing console log. Error is: "+e.message)}}try{var o,i,a,u,d;d=Er().consoleLogLevel.split(",");try{d.includes(l.ERROR)&&(o=console.error.bind(console),console.error=function(){n(arguments[0])||r(t.ConsoleError,arguments),o.apply(console,arguments)})}catch(e){L("Error in parsing console error. Error is: "+e.message)}try{d.includes(l.LOG)&&(i=console.log.bind(console),console.log=function(){n(arguments[0])||r(t.ConsoleInfo,arguments),i.apply(console,arguments)})}catch(e){L("Error in parsing console log. Error is: "+e.message)}try{d.includes(l.WARNING)&&(a=console.warn.bind(console),console.warn=function(){n(arguments[0])||r(t.ConsoleWarning,arguments),a.apply(console,arguments)})}catch(e){L("Error in parsing console warning. Error is: "+e.message)}try{d.includes(l.DEBUG)&&(u=console.debug.bind(console),console.debug=function(){n(arguments[0])||r(t.ConsoleDebug,arguments),u.apply(console,arguments)})}catch(e){L("Error in parsing console debug. Error is: "+e.message)}return function(){o&&(console.error=o),i&&(console.log=i),a&&(console.warn=a),u&&(console.debug=u)}}catch(e){return L("Error while getting console log level from sdk config. Error is: "+e.message),function(){}}}(Vr)),i.stackTraceCapture&&o.push(function(e){var n=[hr("error",function(n){!function(e,n){var r=e.message,o=e.filename,i=e.lineno,a=e.colno;if(Dr(r)||Dr(o))x("Ignoring error from error callback "+r);else if(e.error){var s,c,l;if(Dr(null==(s=e.error)?void 0:s.stack))return void x("Ignoring error from error callback "+(null==(l=e.error)?void 0:l.stack));var u,d=null==(c=e.error)?void 0:c.stack;try{u="string"!=typeof d?JSON.stringify(d):d}catch(e){L("Failed to stringfy errorMsg inside error callback with exception"+e)}var p={message:r,filename:o,lineno:i,colno:a,error:u};n(Cr({eventType:Ur(r,t.Error),data:p,isError:!0}))}else{if((null==r||""==r)&&z.ignoreEmptyErros)return void x("Ignored empty error");var f={message:r,filename:o,lineno:i,colno:a,error:""};n(Cr({eventType:Ur(r,t.Error),data:f,isError:!0}))}}(n,e)},window)];return n.push(hr("unhandledrejection",function(n){var r,o="reason"in n?null==n?void 0:n.reason:n,i=null!=n&&n.reason.stack?n.reason.stack:n;try{r="string"!=typeof i?JSON.stringify(i):i}catch(n){L("Failed to stringfy errorMsg inside unhandledrejection callback with exception"+n)}var a={message:""+o,error:r,filename:"",colno:0,lineno:0};if(null!=o&&""!=o||""!=a.error&&null!=a.error||!z.ignoreEmptyErros){var s="";try{s=JSON.stringify(a.error)}catch(n){L("Failed to stringfy exception")}Dr(a.message)||Dr(s)?x("Ignoring error from unhandled "+o):e(Cr({eventType:Ur(o,t.UnhandledRejection),data:a,isError:!0}))}else x("Ignoring empty errors")},window)),function(){n.forEach(function(e){return e()})}}(Vr)),i.networkCapture&&(o.push(function(e){var n=0;function r(e,t){if(br("networkCapture")&&!window.stopRecording&&!Fr(t.requestUrl,t.status,t.status>=400)){t.requestUrl=Or(t.requestUrl);var r=Er();if(r&&r.isApiIdentifierEnable&&r.apiUniqueIdentifier.length>0){var o=r.apiUniqueIdentifier.filter(function(e){return e.apiUrl===t.requestUrl});o.length>0&&(t.apiIdentifier=function(e,t){try{var n=JSON.parse(e);if(n&&"object"==typeof n)for(var r=Object.keys(n),o=0,i=r;o<i.length;o++){var a=i[o];if(a===t)return"string"==typeof n[a]?n[a]:""}}catch(e){L("error while parsing api payload: "+e)}return""}(t.request,o[0].identifierName))}D("Pushing fetch Data when performance is enabled "+(t=Mr(t,n,t.requestByteSize||0,!0)).requestUrl),window.zFetchTempData.push({eventType:e,data:t,isError:t.status>=400})}}function o(e,t){if("GET"==t||"get"==t)try{var n=e.split("/"),r=n[n.length-1];if(""==r&&n.length>=2&&(r=n[n.length-2]),-1!=r.indexOf(".js")&&!r.indexOf(".json")||-1!=r.indexOf(".map")||-1!=r.indexOf(".html")||-1!=r.indexOf(".css"))return D("Going to ignore response text for url "+e),!0}catch(e){return!1}return!1}if(null!=window.zxhrInit||1==window.zxhrInit)return D("Network in already initialized"),function(){};var i=window.XMLHttpRequest.prototype.open;window.XMLHttpRequest.prototype.open=function(){var e="";null!=arguments[1]&&null!=arguments[1]&&("string"==typeof arguments[1]?e=arguments[1]:arguments[1]instanceof URL&&(e=arguments[1].href));var n,a,l={request:"",requestMethod:arguments[0]?arguments[0]:"",requestUrl:e,sourceLibrary:"xmlHttpClient",headers:{},response:"",responseHeaders:{},status:400,requestStartTime:0,duration:0,requestByteSize:0,responseByteSize:0},u=this.send;this.send=function(){l.requestStartTime=Date.now(),l.request=arguments[0]?arguments[0]:"",l=Mr(l,0,0,!0),u.apply(this,arguments)};var d=this.setRequestHeader;this.setRequestHeader=function(){var e,t;2!==arguments.length||(e=arguments[0],(t=Tr()).length>0&&t.indexOf(e)>-1)||(l.headers[arguments[0]]=arguments[1]),d.apply(this,arguments)},this.addEventListener("load",function(){try{var i=this;if(n=Date.now(),!o(e,l.requestMethod))try{var s,u=c(i),d=u["content-length"]?u["content-length"]:0;l.responseHeaders=u,"blob"===(null==i?void 0:i.responseType)?(d=d||(null==i||null==(s=i.response)?void 0:s.size),a=null==i?void 0:i.response):(a=null!=i&&i.responseText?i.responseText:"",d=d||a.length),l.responseByteSize=d,l.response=a}catch(e){x("Error while capturing response text")}return l.status=i.status,l.duration=n-l.requestStartTime,r(t.XHR,l),Promise.resolve()}catch(e){return Promise.reject(e)}}),this.addEventListener("error",function(){if(n=Date.now(),!o(e,l.requestMethod))try{var i,s=c(this),u=s["content-length"]?s["content-length"]:0;l.responseHeaders=s,"blob"===(null==this?void 0:this.responseType)?(u=u||(null==this||null==(i=this.response)?void 0:i.size),a=null==this?void 0:this.response):(a=null!=this&&this.responseText?this.responseText:"",u=u||a.length),l.responseByteSize=u,l.response=a}catch(e){x("Error while capturing response text")}l.status=this.status?this.status:404,l.duration=n-l.requestStartTime,r(t.XHR,l)}),this.addEventListener("abort",function(){D("Request got aborted in fetch"),s(l,e,this)}),this.addEventListener("timeout",function(){D("Request got timeout"),s(l,e,this)}),i.apply(this,arguments)};var a=window.fetch;return window.fetch=function(){var e,n,i,s,c="",l={sourceLibrary:"fetch",requestUrl:"",requestMethod:"",headers:"",request:"",response:"",responseHeaders:{},status:400,requestStartTime:0,duration:0,requestByteSize:0,responseByteSize:0};l.requestStartTime=Date.now(),null!=arguments[0]&&null!=arguments[0]&&(c="string"==typeof(e=arguments[0])?e:e?e instanceof URL?e.href:e instanceof Request?e.url:"":"");try{if(null!=arguments[1]&&null!=arguments[1]){var u=arguments[1].body;u&&(l.requestByteSize=JSON.stringify(u,null,4).length)}}catch(e){L("error while capturing data length")}try{arguments[1]&&arguments[1].headers&&(n=fn({},arguments[1].headers))}catch(e){L("header is not present in the call")}l=Mr(l={sourceLibrary:"fetch",requestUrl:c||"",requestMethod:arguments[1]&&arguments[1].method?arguments[1].method:"GET",headers:n?(i=n,s=Tr(),s.length>0?(s.forEach(function(e){return delete i[e]}),i):i):"",request:arguments[1]&&arguments[1].body?arguments[1].body:"",response:"",responseHeaders:{},status:400,duration:0,requestByteSize:0,responseByteSize:0,requestStartTime:l.requestStartTime},0,0,!0);var d=a.apply(window,arguments);return new Promise(function(e,n){var i={status:400},a=0;d.then(function(n){i={status:n.status};for(var s,u=pn(n.headers);!(s=u()).done;){var d=s.value;d&&(l.responseHeaders[d[0]]=d[1],!a&&d[0]&&"content-length"==d[0].toLowerCase()&&(a=d[1]))}var p=Date.now(),f=br("xhrRespPayloadCapture");if(!o(c,l.requestMethod)&&i.status>=400||f){var g=n.clone(),h=null;try{if(window.TextDecoder&&g&&g.body){var m=g.body.getReader(),v=new TextDecoder("utf-8"),y="";h=m.read().then(function e(t){var n=t.done,r=t.value,o=r?v.decode(r,{stream:!0}):"";return y+=o,n?y:m.read().then(e)})}else h=g.text()}catch(e){L("Not able to extract fetch response: "+e.message)}l.response=h,l.responseByteSize=a}l.duration=p-l.requestStartTime,l.status=i.status,r(t.XHR,l),e(n.clone())}).catch(function(o){var i=Er();if("AbortError"===o.name&&i.captureCancelledRequest){var a=Date.now();l.status=E,l.duration=a-l.requestStartTime,r(t.XHR,l),e(o)}L("Error in fetch response: "+o.message),n(o)})})},window.zxhrInit=!0,function(){};function s(e,n,i){var a,s;if(Er().captureCancelledRequest){if(!o(n,e.requestMethod))try{a=Date.now();var l,u=c(i),d=u["content-length"]?u["content-length"]:0;e.responseHeaders=u,"blob"===(null==i?void 0:i.responseType)?(d=d||(null==i||null==(l=i.response)?void 0:l.size),s=null==i?void 0:i.response):(s=null!=i&&i.responseText?i.responseText:"",d=d||s.length),e.responseByteSize=d,e.response=s}catch(e){x("Error while capturing response text")}e.duration=a-e.requestStartTime,e.status=null!=i&&i.status?null==i?void 0:i.status:E,r(t.XHR,e)}}function c(e){var t=e.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};return t&&t.length&&t.forEach(function(e){try{if(""!==e){var t=null==e?void 0:e.split(": "),r=null==t?void 0:t.shift(),o=null==t?void 0:t.join(": ");n[r]=o||""}}catch(e){L("Error in extracting response headers: "+e.message)}}),n}}()),o.push(function(e){var t=[hr("online",function(t){Zr(e)},window)];return t.push(hr("offline",function(t){Zr(e)},window)),function(){t.forEach(function(e){return e()})}}(Vr))),o.push(function(e){var n=[];return n.push(hr(f,function(n){try{var r=null==n?void 0:n.detail,o=r.message,i=r.options,a=void 0===i?{}:i;x("Capturing log message for message : "+o+" options: "+JSON.stringify(a)),o&&a&&a.constructor===Object?e(Cr({eventType:t.ZipyLogMessage,data:{message:o.length<m?o:o.substring(0,m),options:a},isError:!1})):D("Didn't capture log message for message : "+o+" options: "+JSON.stringify(a))}catch(e){L("Error in capturing log message. Error is - "+e.message)}},window)),n.push(hr(g,function(n){try{var r,o=(null==(r=n.detail)?void 0:r.error)||{},i=o.message,a=o.name,s=void 0===a?"":a,c=o.filename,l=void 0===c?"":c,u=o.lineno,d=void 0===u?0:u,p=o.colno,f=void 0===p?0:p,g=o.cause,h=void 0===g?"":g,m=o.stack,v=void 0===m?"":m;if(h=h?String(h):"",x("Capturing exception message for message : "+i+" name: "+s+" stack: "+v),Dr(i)||Dr(s))return void x("Ignoring exception logs for message: "+i);i?e(Cr({eventType:t.ZipyLogException,data:{message:i,name:s,filename:l,lineno:d,colno:f,cause:h,stack:v},isError:!0})):D("Didn't capture exception message for message : "+i+" name: "+s)}catch(e){L("Error in capturing log message. Error is - "+e.message)}},window)),n.push(hr(h,function(n){try{var r=null==n?void 0:n.detail,o=r.name,i=r.message,a=void 0===i?"":i,s=r.category,c=void 0===s?"FE":s,l=r.options,u=void 0===l?{}:l;if(x("Capturing exception message for message : "+a+" name: "+o),Dr(a)||Dr(o))return void x("Ignoring error logs for message: "+a);a&&o&&u&&u.constructor===Object?e(Cr({eventType:"NE"===c?t.ZipyLogNetworkError:t.ZipyLogFrontendError,data:{message:a.length<m?a:a.substring(0,m),name:o,category:c,options:u},isError:!0})):D("Didn't capture error message for message : "+a+" name: "+o+" category:"+c+" options: "+JSON.stringify(u))}catch(e){L("Error in capturing log message. Error is - "+e.message)}},window)),function(){n.forEach(function(e){return e()})}}(Vr)),o.push(function(e){if(window.PerformanceObserver&&"function"==typeof window.PerformanceObserver){var n=new PerformanceObserver(function(n){var r=n.getEntries();D("perf event size is - "+r.length),L("Perf entires"),L(r.filter(function(e){return"fetch"==e.initiatorType||"xmlhttprequest"==e.initiatorType}));for(var o,i=pn(r);!(o=i()).done;){var a=o.value;try{var s=Lr(a.initiatorType);if(s===t.XHR&&window.zFetchTempData&&window.zFetchTempData.length>0)for(var c=[].concat(window.zFetchTempData)||[],l=function(n){var r;L("Compare tempData[j].data?.requestUrl {} and entries[i].name"),D("Merging XHR calls");var o=(null==(r=c[n].data)?void 0:r.requestUrl)||"",i=Or(a.name)||"";if(i&&o&&decodeURIComponent(o)===decodeURIComponent(i)||Br(o,i)){var s,l,u,d;D("INSIDE :: Compare xhrUrl "+o+" and perfURL "+i);var p=Gr(a);p.responseStatus=a.responseStatus?a.responseStatus:null==(s=c[n].data)?void 0:s.status,p.transferSize=a.transferSize?a.transferSize:null==(l=c[n].data)?void 0:l.responseByteSize,p.apiIdentifier=(null==(u=c[n].data)?void 0:u.apiIdentifier)||"",p.name=i,o.indexOf("http://")>-1||o.indexOf("https://")>-1||(c[n].data.requestUrl=i);var f=fn({},c[n].data,p);return c[n]=fn({},c[n],{data:f}),D("Merged XHR calls is "+c[n]),e(Cr({eventType:t.Performance,data:fn({},p,{method:null==(d=c[n].data)?void 0:d.requestMethod}),isError:p.responseStatus>=400})),qr(c[n]).then(function(t){t.data=Mr(t.data,0,t.data.responseByteSize||0,!1),e(Cr(t))}).catch(function(e){L("Error in capturing perf data. Error is - "+e.message)}),D("Old temp XHR data calls length "+window.zFetchTempData.length),window.zFetchTempData=window.zFetchTempData.filter(function(e,t){return t!=n}),D("New temp XHR data calls length "+window.zFetchTempData.length),1}},u=0;u<c.length&&!l(u);u++);else if(s&&s!=t.XHR){var d=Gr(a),p=d.responseStatus>=400;Fr(a.name,a.responseStatus,p)||e(Cr({eventType:t.Performance,data:fn({},d,{method:"GET"}),isError:p}))}else L("XHR request but zFetchTempData is empty. API: "+a.name+", Event type: "+s+". Initiator type - "+a.initiatorType)}catch(e){L("Error in capturing perf data. Error is - "+e.message)}}var f=[].concat(window.zFetchTempData)||[];if(f.length>0)for(var g=function(t){var n=f[t].data,r=n.requestStartTime,o=n.duration,i=br("xhrEventsTimeout");Date.now()-(r+o)>i&&qr(f[t]).then(function(n){n.data=Mr(n.data,0,n.data.responseByteSize||0,!1),e(Cr(n)),window.zFetchTempData=window.zFetchTempData.filter(function(e,n){return n!=t})}).catch(function(e){L("Error in capturing perf data. Error is - "+e.message)})},h=0;h<f.length;h++)g(h)});return n.observe({entryTypes:["resource"]}),function(){return n.disconnect()}}return function(){}}(Vr)),o.push(function(e){if(window.buffered){var n=performance.getEntriesByType("resource").filter(function(e){return Pr.indexOf(e.initiatorType)>-1});x("Inside initial perf event function. Size of data is - "+n.length);for(var r,o=pn(n);!(r=o()).done;){var i=r.value;if(!Fr(i.name,i.responseStatus,i.responseStatus>=400)){var a=Gr(i);e(Cr({eventType:t.Performance,data:fn({},a,{method:"GET"}),isError:(null==a?void 0:a.responseStatus)>=400}))}}}return function(){}}(Vr)),i.capturePagePerf&&o.push(function(e){if(window.PerformanceObserver&&"function"==typeof window.PerformanceObserver){x("Page Performance: PerfObserver is supported");var n=new PerformanceObserver(function(n){var r=n.getEntries(),o=window.location.href,i=r.find(function(e){return"first-contentful-paint"===e.name});if(i){var a=window.performance.timeOrigin+i.startTime,s={data:{name:"FCP",type:I.FCP,value:i.startTime,navigationUrl:o},type:t.WebVitals,time:a};x("Page Performance: FCP entries present",JSON.stringify(s)),Bo(s),e(Cr({eventType:t.WebVitals,data:s,isError:!1}))}var c=r.find(function(e){return"first-paint"===e.name});if(c){var l=window.performance.timeOrigin+c.startTime,u={data:{name:"FP",type:I.FP,value:c.startTime,navigationUrl:o},type:t.WebVitals,time:l};x("Page Performance: FP entries present",JSON.stringify(u)),Bo(u),e(Cr({eventType:t.WebVitals,data:u,isError:!1}))}});n.observe({type:"paint",buffered:window.buffered});var r=new PerformanceObserver(function(n){var r=n.getEntries(),o=window.location.href,i=r.find(function(e){return"largest-contentful-paint"===e.entryType});if(i){var a=window.performance.timeOrigin+i.startTime,s={data:{name:"LCP",type:I.LCP,value:i.startTime,navigationUrl:o},type:t.WebVitals,time:a};x("Page Performance: LCP entries present",JSON.stringify(s)),Bo(s),e(Cr({eventType:t.WebVitals,data:s,isError:!1}))}});r.observe({type:"largest-contentful-paint",buffered:window.buffered});var o,i=0,a=new PerformanceObserver(function(n){var r=n.getEntries(),a=window.location.href,s=r.find(function(e){return"layout-shift"===e.entryType}),c=Er();if(s){var l=window.performance.timeOrigin+s.startTime,u={data:{name:"CLS",type:I.CLS,value:s.value,navigationUrl:a},type:t.WebVitals,time:l};x("Page Performance: CLS entries present",JSON.stringify(u)),i<c.clsEventCount&&(x("Page Performance: CLS within the threshold",JSON.stringify(u)),Bo(u),e(Cr({eventType:t.WebVitals,data:u,isError:!1})),i++),o||(o=setTimeout(function(){i=0,o=null},c.clsTimeout))}});a.observe({type:"layout-shift",buffered:window.buffered});var s=new PerformanceObserver(function(n){var r=n.getEntries(),o=window.location.href,i=r.find(function(e){return"first-input"===e.entryType});if(i){var a=window.performance.timeOrigin+i.startTime,s={data:{name:"FID",type:I.FID,value:i.processingStart-i.startTime,navigationUrl:o},type:t.WebVitals,time:a};x("Page Performance: FID entries present",JSON.stringify(s)),Bo(s),e(Cr({eventType:t.WebVitals,data:s,isError:!1}))}});return s.observe({type:"first-input",buffered:window.buffered}),function(){n.disconnect(),r.disconnect(),a.disconnect(),s.disconnect(),o&&(clearTimeout(o),o=null)}}return function(){}}(Vr)),i.webSocketsCapture&&(U("Going to init websockets",window),window.sdkInit!==wr.Completed?function(e){function r(n,r){window.stopRecording||e(Cr({eventType:n,data:r,isError:n==t.WSERROR}))}function o(e){U("onmessage: ");var o={data:e.data,type:e.type,wsTimestamp:e.timeStamp},i={requestUrl:this.url?this.url:"",responseData:{},status:"",protocols:this.protocol,extension:"string"==typeof this.extensions?[this.extensions]:this.extensions,readyState:this.readyState,timestamp:Date.now(),wsMsgType:n.MESSAGERECEIVED};i.responseData=o,r(t.WSMESSAGE,i)}function i(e){U("onclose: ");var o=window._websockets.indexOf(this.ws);o>-1&&window._websockets.splice(o,1);var i={requestUrl:this.url?this.url:"",responseData:{},status:"",protocols:this.protocol,extension:"string"==typeof this.extensions?[this.extensions]:this.extensions,readyState:this.readyState,timestamp:Date.now(),wsMsgType:n.SOCKETCLOSE};i.responseData={code:e.code,reason:e.reason,type:e.type,wsTimestamp:e.timeStamp},r(t.WSCLOSE,i)}function a(e){U("onopen: ");var o={requestUrl:this.url?this.url:"",responseData:{},status:"",protocols:this.protocol,extension:"string"==typeof this.extensions?[this.extensions]:this.extensions,readyState:this.readyState,timestamp:Date.now(),wsMsgType:n.SOCKETERROR};r(t.WSOPEN,o)}function s(e){U("onerror: ");var o={requestUrl:this.url?this.url:"",responseData:{},status:"",protocols:this.protocol,extension:"string"==typeof this.extensions?[this.extensions]:this.extensions,readyState:this.readyState,timestamp:Date.now(),wsMsgType:n.SOCKETERROR};o.responseData={code:e.code,reason:e.reason,type:e.type,wsTimestamp:e.timeStamp},r(t.WSERROR,o)}U("Inside captureWebSocketRequest"),U("Going to call WebSocket connection");var c=new Proxy(window.WebSocket,{construct:function(e,c){U("WebSocket connection");var l=function(e,t,n){if(gn())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&hn(o,n.prototype),o}(e,c),u=o,d=i,p=a,f=s,g=l.send;return l.zRecordStatus="initiated",l.zRecordStart=function(){"started"!==l.zRecordStatus&&(function(e){var o=e.send;e.send=function(e){U("onsend");var i={requestUrl:this.url?this.url:"",status:"",protocols:this.protocol,extension:"string"==typeof this.extensions?[this.extensions]:this.extensions,readyState:this.readyState,requestData:arguments[0]?arguments[0]:"",timestamp:Date.now(),wsMsgType:n.MESSAGESEND};o.apply(this,[e]),r(t.WSMESSAGE,i)}}(l),l.addEventListener("message",u),l.addEventListener("open",p),l.addEventListener("error",f),l.addEventListener("close",d),l.zRecordStatus="started")},l.zRecordStop=function(){"stopped"!==l.zRecordStatus&&(l.send=g,l.removeEventListener("message",u),l.removeEventListener("open",p),l.removeEventListener("error",f),l.removeEventListener("close",d),l.zRecordStatus="stopped")},window._websockets=window._websockets||[],window._websockets.push(l),window.stopRecording||l.zRecordStart(),l}});U("Going to set WebSocket connection"),window.WebSocket=c}(Vr):function(){if(U("Start recording"),window._websockets&&window._websockets.length)for(var e=0;e<window._websockets.length;e++)window._websockets[e]&&window._websockets[e].zRecordStart&&"function"==typeof window._websockets[e].zRecordStart&&(window._websockets[e].zRecordStart(),U("Zipy Recording Status:"))}()),function(){o.forEach(function(e){return e()}),function(){if(U("Stop recording"),window._websockets&&window._websockets.length)for(var e=0;e<window._websockets.length;e++)window._websockets[e]&&window._websockets[e].zRecordStop&&"function"==typeof window._websockets[e].zRecordStop&&(window._websockets[e].zRecordStop(),U("Zipy Recording Status:"))}()}}catch(e){return L(e),function(){}}}({emit:function(e){try{var n=Er();if(e.eventType!=t.Online||window.iszHandshakeDone||(window.ztryForHandshake=!0),r.isSessionExpired)return void x("Don't store zipy events if session is expired");(n.startCaptureWithoutUserActivity||e.eventType>=t.Error&&e.eventType<=t.UnhandledRejection)&&(window.zrrwebRecorderStatus=a.RECORDINGSUCCESSFUL);var o,i={data:JSON.stringify(e.data),time:e.timestamp,type:e.eventType===t.Performance?Lr(e.data.initiatorType):e.eventType,isError:e.isError,navigatedUrl:window.location.origin+window.location.pathname};i.type===t.XHR&&e.eventType==t.Performance||_o(i),n.capturePerformance&&t.Performance===e.eventType&&function(e){var t=Er();window.zrecordingPaused||Zo()&&!tr(t)||Qn()&&window.zEventsPerfData.push(e)}({data:e.data,type:null==(o=e.data)?void 0:o.initiatorType,time:e.timestamp})}catch(e){L("Failed to store events")}}})}function _o(e){var t=Er(),n=Tn.getInstance();window.zrecordingPaused||Zo()&&!tr(t)||Qn()&&window.zEventsData.push(e),n.lastActivityTime=Date.now()}function Bo(e){var t=Er();window.zrecordingPaused||Zo()&&!tr(t)||Qn()&&window.zPagePerfData.push(e)}var Wo=function(e){var t,n,r=Wn.getInstance(),o={domCapture:"boolean"==typeof(null==e?void 0:e.dom_capture)?null==e?void 0:e.dom_capture:Sr.domCapture,consoleCapture:"boolean"==typeof(null==e?void 0:e.console_capture)?null==e?void 0:e.console_capture:Sr.consoleCapture,networkCapture:"boolean"==typeof(null==e?void 0:e.network_capture)?null==e?void 0:e.network_capture:Sr.networkCapture,stackTraceCapture:"boolean"==typeof(null==e?void 0:e.stack_trace_capture)?null==e?void 0:e.stack_trace_capture:Sr.stackTraceCapture,webSocketsCapture:"boolean"==typeof(null==e?void 0:e.web_sockets_capture)?null==e?void 0:e.web_sockets_capture:Sr.webSocketsCapture,ipCapture:"boolean"==typeof(null==e?void 0:e.ip_capture)?null==e?void 0:e.ip_capture:Sr.ipCapture,inputMasking:"boolean"==typeof(null==e?void 0:e.input_masking)?null==e?void 0:e.input_masking:Sr.inputMasking,textMasking:"boolean"==typeof(null==e?void 0:e.text_masking)?null==e?void 0:e.text_masking:Sr.textMasking,paid:"boolean"==typeof(null==e?void 0:e.paid)?null==e?void 0:e.paid:Sr.paid,apiKey:null==e?void 0:e.api_key,streamUrl:null!=e&&e.stream_url?null==e?void 0:e.stream_url:Sr.streamUrl,maxBufferSize:null!=e&&e.max_buffer_size?1024*(null==e?void 0:e.max_buffer_size):Sr.maxBufferSize,compression:"boolean"==typeof(null==e?void 0:e.compression)?null==e?void 0:e.compression:Sr.compression,compressionType:null!=e&&e.compression_type?null==e?void 0:e.compression_type:Sr.compressionType,timeFrequency:null!=e&&e.time_frequency?1e3*(null==e?void 0:e.time_frequency):Sr.timeFrequency,encodingType:null==e?void 0:e.encoding_type,sessionTimeout:null!=e&&e.session_timeout?1e3*(null==e?void 0:e.session_timeout):Sr.sessionTimeout,failureRetryCount:null!=e&&e.failure_retry_count?null==e?void 0:e.failure_retry_count:Sr.failureRetryCount,bufferSizeFrequency:null!=e&&e.buffer_size_frequency?1024*(null==e?void 0:e.buffer_size_frequency):Sr.bufferSizeFrequency,ignoreUrl:null!=e&&e.ignoreUrl?null==e?void 0:e.ignoreUrl:Sr.ignoreUrl,ignoreError:null!=e&&e.ignoreError?null==e?void 0:e.ignoreError:Sr.ignoreError,ignoreConsole:null!=e&&e.ignoreConsole?null==e?void 0:e.ignoreConsole:Sr.ignoreConsole,isIgnoreUrlError:null!=e&&e.isIgnoreUrlError?null==e?void 0:e.isIgnoreUrlError:Sr.isIgnoreUrlError,isIgnoreConsoleError:null!=e&&e.isIgnoreConsoleError?null==e?void 0:e.isIgnoreConsoleError:Sr.isIgnoreConsoleError,ip:null!=e&&e.ip?null==e?void 0:e.ip:"",pack:!(null==e||!e.pack||!e.pack),blockClasses:(t=null!=e&&e.blockClasses?null==e?void 0:e.blockClasses:Sr.blockClasses,n="zipy-block",t=(t=t&&t.length?t+(n?","+n:""):n).split(",").filter(kr).map(Ar).join("|"),new RegExp(t)),customerId:null==e?void 0:e.cId,headersToSanitize:null!=e&&e.headersToSanitize?e.headersToSanitize:"",xhrReqPayloadCapture:"boolean"==typeof(null==e?void 0:e.xhrReqPayloadCap)?null==e?void 0:e.xhrReqPayloadCap:Sr.xhrReqPayloadCapture,xhrRespPayloadCapture:"boolean"==typeof(null==e?void 0:e.xhrRespPayloadCap)?null==e?void 0:e.xhrRespPayloadCap:Sr.xhrRespPayloadCapture,canvasCapture:"boolean"==typeof(null==e?void 0:e.canvasCapture)?null==e?void 0:e.canvasCapture:Sr.canvasCapture,requestCapSize:null!=e&&e.requestCapSize?null==e?void 0:e.requestCapSize:Sr.requestCapSize,responseCapSize:null!=e&&e.responseCapSize?null==e?void 0:e.responseCapSize:Sr.responseCapSize,sizeExceededMessage:null!=e&&e.sizeExceededMessage?null==e?void 0:e.sizeExceededMessage:Sr.sizeExceededMessage,eventCountCapInSingleChunk:"number"==typeof(null==e?void 0:e.eventCountCapInSingleChunk)?e.eventCountCapInSingleChunk:Sr.eventCountCapInSingleChunk,captureCustomZipyLogMessage:"boolean"==typeof(null==e?void 0:e.captureCustomZipyLogMessage)?e.captureCustomZipyLogMessage:Sr.captureCustomZipyLogMessage,captureCustomZipyLogError:"boolean"==typeof(null==e?void 0:e.captureCustomZipyLogError)?e.captureCustomZipyLogError:Sr.captureCustomZipyLogError,captureCustomZipyLogException:"boolean"==typeof(null==e?void 0:e.captureCustomZipyLogException)?e.captureCustomZipyLogException:Sr.captureCustomZipyLogException,startCaptureWithoutUserActivity:"boolean"==typeof(null==e?void 0:e.startCaptureWithoutUserActivity)?e.startCaptureWithoutUserActivity:Sr.startCaptureWithoutUserActivity,consoleLogLevel:null!=e&&e.consoleLogLevel?e.consoleLogLevel:Sr.consoleLogLevel,recordCrossOriginIframes:!r.recordOnlyIframe,splitSessionSize:"number"==typeof(null==e?void 0:e.splitSessionSize)?e.splitSessionSize:Sr.splitSessionSize,capturePerformance:"boolean"==typeof(null==e?void 0:e.capturePerformance)?e.capturePerformance:Sr.capturePerformance,perfUrl:null!=e&&e.perfUrl?null==e?void 0:e.perfUrl:Sr.perfUrl,perfTimeFrequency:"number"==typeof(null==e?void 0:e.perfTimeFrequency)?e.perfTimeFrequency:Sr.perfTimeFrequency,perfBufferSizeFrequency:"number"==typeof(null==e?void 0:e.perfBufferSizeFrequency)?e.perfBufferSizeFrequency:Sr.perfBufferSizeFrequency,clickTimeFrequency:"number"==typeof(null==e?void 0:e.clickTimeFrequency)?e.clickTimeFrequency:Sr.clickTimeFrequency,clickBufferSizeFrequency:"number"==typeof(null==e?void 0:e.clickBufferSizeFrequency)?e.clickBufferSizeFrequency:Sr.clickBufferSizeFrequency,isApiIdentifierEnable:"boolean"==typeof(null==e?void 0:e.isApiIdentifierEnable)?e.isApiIdentifierEnable:Sr.isApiIdentifierEnable,apiUniqueIdentifier:null!=e&&e.apiUniqueIdentifier&&Array.isArray(e.apiUniqueIdentifier)?e.apiUniqueIdentifier:Sr.apiUniqueIdentifier,ignoreUrlErrorCodes:null!=e&&e.ignoreUrlErrorCodes?e.ignoreUrlErrorCodes:Sr.ignoreUrlErrorCodes,ignoreUrlCodes:null!=e&&e.ignoreUrlCodes?e.ignoreUrlCodes:Sr.ignoreUrlCodes,heatMapUrl:null!=e&&e.heatMapUrl?e.heatMapUrl:Sr.heatMapUrl,captureClickEvents:"boolean"==typeof(null==e?void 0:e.captureClickEvents)?e.captureClickEvents:Sr.captureClickEvents,sessionStitching:null!=e&&e.sessionStitching?e.sessionStitching:Sr.sessionStitching,captureCancelledRequest:"boolean"==typeof(null==e?void 0:e.captureCancelledRequest)?e.captureCancelledRequest:Sr.captureCancelledRequest,capturePagePerf:null!=e&&e.capturePagePerf?e.capturePagePerf:Sr.capturePagePerf,clsEventCount:null!=e&&e.clsEventCount?e.clsEventCount:Sr.clsEventCount,clsTimeout:null!=e&&e.clsTimeout?e.clsTimeout:Sr.clsTimeout,pagePerfUrl:null!=e&&e.pagePerfUrl?e.pagePerfUrl:Sr.pagePerfUrl,xhrEventsTimeout:null!=e&&e.xhrEventsTimeout?e.xhrEventsTimeout:Sr.xhrEventsTimeout,blockSelector:null!=e&&e.blockSelector?null==e?void 0:e.blockSelector:Sr.blockSelector,captureCustomEvents:"boolean"==typeof(null==e?void 0:e.captureCustomEvents)?null==e?void 0:e.captureCustomEvents:null==Sr?void 0:Sr.captureCustomEvents,customEventUrl:null!=e&&e.customEventUrl?null==e?void 0:e.customEventUrl:Sr.customEventUrl,maxCustomEventProperties:null!=e&&e.maxCustomEventProperties?null==e?void 0:e.maxCustomEventProperties:Sr.maxCustomEventProperties,maxCustomEventPayloadSize:null!=e&&e.maxCustomEventPayloadSize?null==e?void 0:e.maxCustomEventPayloadSize:Sr.maxCustomEventPayloadSize,sanitizePayloadResponse:"boolean"==typeof(null==e?void 0:e.sanitizePayloadResponse)?null==e?void 0:e.sanitizePayloadResponse:Sr.sanitizePayloadResponse,captureUTM:"boolean"==typeof(null==e?void 0:e.captureUTM)?null==e?void 0:e.captureUTM:Sr.captureUTM};return o.ignoreUrl.push(o.streamUrl.substring(o.streamUrl.indexOf("://")+3)),o.ignoreUrl.push(o.streamUrl.substring(o.perfUrl.indexOf("://")+3)),o.ignoreUrl.push(o.streamUrl.substring(o.heatMapUrl.indexOf("://")+3)),o.ignoreUrl.push(z.streamMgrUrl.substring(z.streamMgrUrl.indexOf("://")+3)),o.ignoreUrl.push("google.com"),o.isIgnoreUrlError.push(o.streamUrl.substring(o.streamUrl.indexOf("://")+3)),o.isIgnoreUrlError.push(z.streamMgrUrl.substring(z.streamMgrUrl.indexOf("://")+3)),o.isIgnoreUrlError.push("google.com"),function(e){if(e)try{var t;D("Updating zsdk-config"+JSON.stringify(e)),e.blockClasses=null==(t=e.blockClasses)?void 0:t.source,wn("zsdk-config",JSON.stringify(e))}catch(e){L("Failed to stringify zsdk-config ")}}(o),o};function Zo(){var e=Tn.getInstance().sessionBlockInfo;return!(null==e||!e.isBlocked)&&e.isBlocked}var Vo=function(e,n){var r={},o=Tn.getInstance();e===b.PAGE_OUT?r.type="visibility hidden":(e===b.INIT||b.REINIT)&&(r.type=e,r.newSession=o.isNewSession,r.initiator=n),r.tabId=Ro("zTId"),_o({data:JSON.stringify(r),time:Date.now(),type:t.DEBUG_INFO,isError:!1,navigatedUrl:window.location.origin+window.location.pathname,rrwebEvent:0})};function qo(e){var t=new TextEncoder,n=JSON.stringify(e);return t.encode(n).byteLength}function Ko(e,t){try{for(var n,r=pn(window.document.querySelectorAll("iframe"));!(n=r()).done;){var o=n.value;try{var i=new URL(o.src);if(t){if(i.origin!==window.document.location.origin&&o.contentWindow===(null==t?void 0:t.source))return x("sending message to iframe to start recording"),void o.contentWindow.postMessage({action:v,config:e},"*");continue}i.origin!==window.document.location.origin&&(x("sending message to iframe to start recording"),o.contentWindow.postMessage({action:v,config:e},"*"))}catch(e){L("failed to start recording for iframe:")}}}catch(e){L("failed to start recording")}}function Jo(){try{var e=window.document.querySelectorAll("iframe");x("going to stop iframe");for(var t,n=pn(e);!(t=n()).done;){var r=t.value;try{new URL(r.src).origin!==window.document.location.origin&&(x("sending message to iframe to stop recording"),r.contentWindow.postMessage({action:y},"*"))}catch(e){L("failed to stop recording for iframe:")}}}catch(e){L("failed to stop recording")}}var Ho=function(e){var t={exports:{}};return function(e){var t=function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",r={};function o(e,t){if(!r[e]){r[e]={};for(var n=0;n<e.length;n++)r[e][e.charAt(n)]=n}return r[e][t]}var i={compressToBase64:function(e){if(null==e)return"";var n=i._compress(e,6,function(e){return t.charAt(e)});switch(n.length%4){default:case 0:return n;case 1:return n+"===";case 2:return n+"==";case 3:return n+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:i._decompress(e.length,32,function(n){return o(t,e.charAt(n))})},compressToUTF16:function(t){return null==t?"":i._compress(t,15,function(t){return e(t+32)})+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:i._decompress(e.length,16384,function(t){return e.charCodeAt(t)-32})},compressToUint8Array:function(e){for(var t=i.compress(e),n=new Uint8Array(2*t.length),r=0,o=t.length;r<o;r++){var a=t.charCodeAt(r);n[2*r]=a>>>8,n[2*r+1]=a%256}return n},decompressFromUint8Array:function(t){if(null==t)return i.decompress(t);for(var n=new Array(t.length/2),r=0,o=n.length;r<o;r++)n[r]=256*t[2*r]+t[2*r+1];var a=[];return n.forEach(function(t){a.push(e(t))}),i.decompress(a.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":i._compress(e,6,function(e){return n.charAt(e)})},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),i._decompress(e.length,32,function(t){return o(n,e.charAt(t))}))},compress:function(t){return i._compress(t,16,function(t){return e(t)})},_compress:function(e,t,n){if(null==e)return"";var r,o,i,a={},s={},c="",l="",u="",d=2,p=3,f=2,g=[],h=0,m=0;for(i=0;i<e.length;i+=1)if(c=e.charAt(i),Object.prototype.hasOwnProperty.call(a,c)||(a[c]=p++,s[c]=!0),l=u+c,Object.prototype.hasOwnProperty.call(a,l))u=l;else{if(Object.prototype.hasOwnProperty.call(s,u)){if(u.charCodeAt(0)<256){for(r=0;r<f;r++)h<<=1,m==t-1?(m=0,g.push(n(h)),h=0):m++;for(o=u.charCodeAt(0),r=0;r<8;r++)h=h<<1|1&o,m==t-1?(m=0,g.push(n(h)),h=0):m++,o>>=1}else{for(o=1,r=0;r<f;r++)h=h<<1|o,m==t-1?(m=0,g.push(n(h)),h=0):m++,o=0;for(o=u.charCodeAt(0),r=0;r<16;r++)h=h<<1|1&o,m==t-1?(m=0,g.push(n(h)),h=0):m++,o>>=1}0==--d&&(d=Math.pow(2,f),f++),delete s[u]}else for(o=a[u],r=0;r<f;r++)h=h<<1|1&o,m==t-1?(m=0,g.push(n(h)),h=0):m++,o>>=1;0==--d&&(d=Math.pow(2,f),f++),a[l]=p++,u=String(c)}if(""!==u){if(Object.prototype.hasOwnProperty.call(s,u)){if(u.charCodeAt(0)<256){for(r=0;r<f;r++)h<<=1,m==t-1?(m=0,g.push(n(h)),h=0):m++;for(o=u.charCodeAt(0),r=0;r<8;r++)h=h<<1|1&o,m==t-1?(m=0,g.push(n(h)),h=0):m++,o>>=1}else{for(o=1,r=0;r<f;r++)h=h<<1|o,m==t-1?(m=0,g.push(n(h)),h=0):m++,o=0;for(o=u.charCodeAt(0),r=0;r<16;r++)h=h<<1|1&o,m==t-1?(m=0,g.push(n(h)),h=0):m++,o>>=1}0==--d&&(d=Math.pow(2,f),f++),delete s[u]}else for(o=a[u],r=0;r<f;r++)h=h<<1|1&o,m==t-1?(m=0,g.push(n(h)),h=0):m++,o>>=1;0==--d&&(d=Math.pow(2,f),f++)}for(o=2,r=0;r<f;r++)h=h<<1|1&o,m==t-1?(m=0,g.push(n(h)),h=0):m++,o>>=1;for(;;){if(h<<=1,m==t-1){g.push(n(h));break}m++}return g.join("")},decompress:function(e){return null==e?"":""==e?null:i._decompress(e.length,32768,function(t){return e.charCodeAt(t)})},_decompress:function(t,n,r){var o,i,a,s,c,l,u,d=[],p=4,f=4,g=3,h="",m=[],v={val:r(0),position:n,index:1};for(o=0;o<3;o+=1)d[o]=o;for(a=0,c=Math.pow(2,2),l=1;l!=c;)s=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=r(v.index++)),a|=(s>0?1:0)*l,l<<=1;switch(a){case 0:for(a=0,c=Math.pow(2,8),l=1;l!=c;)s=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=r(v.index++)),a|=(s>0?1:0)*l,l<<=1;u=e(a);break;case 1:for(a=0,c=Math.pow(2,16),l=1;l!=c;)s=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=r(v.index++)),a|=(s>0?1:0)*l,l<<=1;u=e(a);break;case 2:return""}for(d[3]=u,i=u,m.push(u);;){if(v.index>t)return"";for(a=0,c=Math.pow(2,g),l=1;l!=c;)s=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=r(v.index++)),a|=(s>0?1:0)*l,l<<=1;switch(u=a){case 0:for(a=0,c=Math.pow(2,8),l=1;l!=c;)s=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=r(v.index++)),a|=(s>0?1:0)*l,l<<=1;d[f++]=e(a),u=f-1,p--;break;case 1:for(a=0,c=Math.pow(2,16),l=1;l!=c;)s=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=r(v.index++)),a|=(s>0?1:0)*l,l<<=1;d[f++]=e(a),u=f-1,p--;break;case 2:return m.join("")}if(0==p&&(p=Math.pow(2,g),g++),d[u])h=d[u];else{if(u!==f)return null;h=i+i.charAt(0)}m.push(h),d[f++]=i+h.charAt(0),i=h,0==--p&&(p=Math.pow(2,g),g++)}}};return i}();null!=e?e.exports=t:"undefined"!=typeof angular&&null!=angular&&angular.module("LZString",[]).factory("LZString",function(){return t})}(t),t.exports}(),jo=/*#__PURE__*/function(){function e(){this.zipySessionData=void 0,this.zipyStates=void 0,this.zipySessionData=Tn.getInstance(),this.zipyStates=zo.getInstance()}e.getInstance=function(){return e.instance||(e.instance=new e),e.instance};var t=e.prototype;return t.stopHandlers=function(){var e=this,t=zo.getInstance();this.zipyStates.isDataProcessingDone().then(function(n){if(n){t.sdkTimer=N.STOP,window.zrrwebRecorderStatus=a.RECORDINGPENDING,window.sdkInit=wr.Failed;var r=window.zStop;r&&r(),sr(),or(e.zipySessionData.apiKey)}})},t.stop=function(){this.stopHandlers()},e}();function Yo(e,t,n){if(!e.s){if(n instanceof Qo){if(!n.s)return void(n.o=Yo.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Yo.bind(null,e,t),Yo.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}jo.instance=void 0;var Xo=function(e){try{var t,n=function(n){if(t)return n;function i(){function t(t){function n(){function t(t){function n(t){function n(t){function n(t){t&&x("Successfully sent custom event data to server via session storage"),ii(z.sdkLoopTime,e)}t&&x("Successfully sent page perf data to server via session storage");var r=!window.iszInternetDisconnected&&window.zrrwebRecorderStatus!==a.RECORDINGPENDING;return r?Promise.resolve(Do(e)).then(n):n(r)}t&&x("Successfully sent click data to server via session storage");var r=!window.iszInternetDisconnected&&window.zrrwebRecorderStatus!=a.RECORDINGPENDING;return r?Promise.resolve(xo(e)).then(n):n(r)}t&&x("Successfully sent pref data to server via session storage");var o=!window.iszInternetDisconnected&&window.zrrwebRecorderStatus!=a.RECORDINGPENDING&&r.captureClickEvents;return o?Promise.resolve(Uo(e)).then(n):n(o)}var n=!window.iszInternetDisconnected&&window.zrrwebRecorderStatus!=a.RECORDINGPENDING&&r.capturePerformance;return n?Promise.resolve(Lo(e)).then(t):t(n)}var i=function(){if(t){var n=function(){x("Successfully send data to server via session storage")},i=function(){if(window.zrecordingPaused){window.zrecordingPaused=!1,window.reinitializationInProgress=!0;var t=o.GETUSERCONFIG;return Bn()&&(t=o.POSTENDUSERINFOANDGETUSERCONFIG),Promise.resolve(Mo(e,t,!1)).then(function(e){r=e,window.zStop=oi(),Vo(b.REINIT,k.STREAMDATARECORDINGPAUSE)})}}();return i&&i.then?i.then(n):n()}var a=window.zEventsData||[],s="";try{s=JSON.stringify(a)}catch(e){L("Failed stringify events while stream data server")}0!=r.maxBufferSize&&2*s.length>r.maxBufferSize&&!window.zrecordingPaused&&(window.zrecordingPaused=!0,D("Max Buffer size is reached going to pause recording"))}();return i&&i.then?i.then(n):n()}var n=!window.iszInternetDisconnected&&window.zrrwebRecorderStatus!=a.RECORDINGPENDING;return n?Promise.resolve(Po(e)).then(t):t(n)}var s=function(){if(window.ztryForHandshake)return Promise.resolve(Mo(e,window.zpendingOp,!1)).then(function(e){r=e})}();return s&&s.then?s.then(i):i()};if(window.sdkInit!==wr.Completed)return D("Sdk is not initialized yet"),ii(z.sdkLoopTime,e),Promise.resolve();if(window.isDataSyncInProgress)return x("Data sync in in progress"),ii(z.sdkLoopTime,e),Promise.resolve();if(window.reinitializationInProgress)return x("Reinit is in progress"),ii(z.sdkLoopTime,e),Promise.resolve();var r=Er(),i=function(){if(tr(r)&&window.zEventsData&&window.zEventsData.length>0&&!window.iszInternetDisconnected&&window.zrrwebRecorderStatus!=a.RECORDINGPENDING){D("Session is expired Going to recreate session"),window.reinitializationInProgress=!0,ir(e);var n=o.GETUSERCONFIG;return Bn()&&(n=o.POSTENDUSERINFOANDGETUSERCONFIG),Promise.resolve(Mo(e,n,!0)).then(function(n){r=n,window.zrecordingPaused=!1,window.zStop=oi(),Vo(b.REINIT,k.STREAMDATAEXPIRE),ii(z.sdkLoopTime,e),t=1})}}();return Promise.resolve(i&&i.then?i.then(n):n(i))}catch(e){return Promise.reject(e)}},Qo=/*#__PURE__*/function(){function e(){}return e.prototype.then=function(t,n){var r=new e,o=this.s;if(o){var i=1&o?t:n;if(i){try{Yo(r,1,i(this.v))}catch(e){Yo(r,2,e)}return r}return this}return this.o=function(e){try{var o=e.v;1&e.s?Yo(r,1,t?t(o):o):n?Yo(r,1,n(o)):Yo(r,2,o)}catch(e){Yo(r,2,e)}},r},e}();function $o(e){return e instanceof Qo&&1&e.s}var ei=5,ti=function(e,t){void 0===t&&(t={releaseVer:"",rootDomain:""});try{try{if(void 0!==window.sdkInit&&window.sdkInit!==wr.Failed)return Promise.resolve();var n=Wn.getInstance();if(window.sdkInit=wr.Progress,n.saveOptions(t),M=z.debugLogs,xr()){if(function(){try{return window.top.window.zipy?(x("Zipy is present in parent"),!0):(x("Zipy is not present in parent"),!1)}catch(e){return L("Error in is same origin method. Error - "+(e?e.message:e)),!1}}())return D("Not initializing sdk as function is called inside iframe."),Promise.resolve();if(!function(e){var t=null;try{var n,r,o=null==e||null==(n=e.window)||null==(n=n.top)?void 0:n.document;t=null==o||null==(r=o.body)?void 0:r.innerHTML}catch(e){x("iframe is cross-domain")}return null!==t}(window.self)&&Sr&&!n.recordOnlyIframe){window.recordingStatus||(window.recordingStatus=!1);try{window.onload=function(){x("Iframe content loaded!"),window.parent.postMessage({action:w},"*")}}catch(e){L("not able to notify about iframe content loaded event:")}var r=e;try{D("init: We will start recording cross-origin iframe now!"),function(e,t){window.addEventListener("message",function(n){try{var r,o;(null==n||null==(r=n.data)?void 0:r.action)===v&&(null==n||null==(o=n.data)||null==(o=o.config)?void 0:o.apiKey)==e&&!0!==window.recordingStatus&&(x("going to init iframe recording"),t.push(Fo(n.data.config.inputMasking)),window.sdkConfig=n.data.config,window.recordingStatus=!0)}catch(e){L("cannot start recording for iframe:")}try{var i;(null==n||null==(i=n.data)?void 0:i.action)==y&&!1!==window.recordingStatus&&(x("going to stop recording for iframe"),window.stopRecording=!0,t.forEach(function(e){return e()}),window.recordingStatus=!1)}catch(e){L("failed to stop iframe recording:")}})}(r,[])}catch(e){L(e.message)}return Promise.resolve()}}var s=new RegExp(/^[a-zA-Z0-9]{8}$/);if(!e||!s.test(e))return L("Not able to process as sdk api key null or invalid."),Promise.resolve();window.zRelVer=t.releaseVer,window.zsdkKey=e,function(){try{for(var e=Object.keys(localStorage),t=0;t<e.length;t++)["zsession-blocked-info","session-data","zId","zenduser-info-temp","zenduser-info","last-activity-time","pack","zsdk-config","is-api-key-valid","zenduser-last-activity-time","ztotal-data-sent"].includes(e[t])&&(vn.set(e[t],localStorage.getItem(e[t])),D("updated value in map is :"+vn.get(e[t])))}catch(e){L("inside zLocalStorgeMapUpdate catch block ${e.message}")}}(),function(e){var t=[];try{var n=Tn.getInstance();window.isDataSyncInProgress=!1,window.iszInternetDisconnected=!1,n.lastActivityTime=Date.now(),window.buffered=!0,sr(),n.enduserLastActivityTime=nr(),n.enduserLastActivityTime||(n.enduserLastActivityTime=Date.now()),window.zrecordingPaused=!1,window.ztryForHandshake=!1,n.isSessionExpired=!1,window.zrrwebRecorderStatus=a.NORECORDING;var r=Wn.getInstance();zo.getInstance().sdkTimer=N.START,Ro("zTId")||Oo("zTId",Math.floor(1e4*Math.random()).toString());var s=Nn()||{},c=Ro("pending-zEvents");if(c&&!tr(s))try{var l;l=Ho.decompressFromUTF16(c),window.zEventsData=JSON.parse(l)}catch(e){L("Failed to parse pendingEvents")}finally{!function(e){try{window.sessionStorage.removeItem("pending-zEvents")}catch(e){console.error("inside zSessionStorageRemoveItem catch block "+e.message)}}()}var u=zn();u&&u.apiKey==e||On(e),x("Zipy Recorder init"),ar(e)&&(Dn()?(D("Removing enduser-info"),In("zenduser-info")):D("zenduser Data dosen't exists"),Pn());var p=o.GETUSERCONFIG;if(!Dn()&&!xn()){p=o.POSTENDUSERINFOANDGETUSERCONFIG;var f=Mn(),g={euId:0,euZName:"",userType:i.ANONYMS,isBlocked:!1,zExternalUserInfo:{},zAnonymsUserInfo:{zId:f,euId:0,euZName:""}};Ln(g),Un(g)}Bn()&&(p=o.POSTENDUSERINFOANDGETUSERCONFIG);var h=!1;r.rootDomain&&pr(e),(tr(s)||ar(e))&&(ir(e),h=!0),Vo(b.INIT,k.PAGELOAD),Mo(e,p,h).then(function(n){if(window.lastSyncTime=0,window.perfLastSyncTime=0,window.clickLastSyncTime=0,window.pagePerfLastSynctime=0,window.customEventLastSynctime=0,null!=n&&n.captureUTM&&function(e){try{var t=Tn.getInstance(),n=new URL(e),r=Er();if(c=n.searchParams,R.some(function(e){return c.has(e)})){var o=[];if(r.sessionStitching){var i=cr(t.apiKey+d.utms);i&&"undefined"!==i&&(o=JSON.parse(decodeURIComponent(i)))}else{var a=yn("zUTMParams");a&&"undefined"!==a&&(o=JSON.parse(a))}o.find(function(e){return e===n.searchParams.toString()})||o.push(n.searchParams.toString());var s=JSON.stringify(o);wn("zUTMParams",s),r.sessionStitching&&lr(t.apiKey+d.utms,encodeURIComponent(s))}}catch(e){L("Error in handling UTM")}var c}(window.location.href),n.domCapture){var r=Fo(n.inputMasking);t.push(r)}t.push(Go());try{window.addEventListener("message",function(e){var t;(null==e||null==(t=e.data)?void 0:t.action)===w&&!0!==window.stopRecording&&Ko(n,e)})}catch(e){L("failed to start recording for iframe content loaded event")}Ko(n),window.zStop=function(){try{window.stopRecording=!0,t.forEach(function(e){return e()}),U("Calling zipy Stop Recorder"),Jo()}catch(e){L("Failed to stop recording")}},window.sdkInit=wr.Completed,ii(z.sdkLoopTime,e),function(e){var t=Wn.getInstance();document.addEventListener("visibilitychange",function(n){try{var r=Er();if(t.rootDomain&&r.sessionStitching)try{document.hidden?fr(e):pr(e)}catch(e){L("Failed to set CookieData on tab visibility. Error - "+e.message)}var o=function(){if("visible"===document.visibilityState)try{if(window.zrecordingPaused=!1,tr(e)){var t=window.zStop;t&&t(),window.stopRecording=!1;var n=Er();window.zStop=Fo(n.inputMasking)}else window.reinitializationInProgress=!0,window.buffered=!1,window.zStop=oi(),Vo(b.REINIT,k.VISIBLE),D("reinitializing the session on tabActive event")}catch(e){L("Failed to reinit on tab visibility. Error - "+e.message)}else{Vo(b.PAGE_OUT,k.NA);var r=zo.getInstance(),o=Er(),i=window.zStop;i&&i();var s=function(t,n){try{var i=function(){function t(){window.zEventsData=[]}var n=r.dataSync!==A.PENDING&&!tr(o)&&!window.iszInternetDisconnected&&window.zEventsData&&window.zEventsData.length>0&&window.zrrwebRecorderStatus!==a.RECORDINGPENDING,i=function(){if(n){var t,r=0,o=function(e,t,n){for(var r;;){var o=e();if($o(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!$o(i)){r=1;break}i=i.s}if(t){var a=t();if(a&&a.then&&!$o(a)){r=2;break}}}var s=new Qo,c=Yo.bind(null,s,2);return(0===r?o.then(u):1===r?i.then(l):a.then(d)).then(void 0,c),s;function l(r){i=r;do{if(t&&(a=t())&&a.then&&!$o(a))return void a.then(d).then(void 0,c);if(!(o=e())||$o(o)&&!o.v)return void Yo(s,1,i);if(o.then)return void o.then(u).then(void 0,c);$o(i=n())&&(i=i.v)}while(!i||!i.then);i.then(l).then(void 0,c)}function u(e){e?(i=n())&&i.then?i.then(l).then(void 0,c):l(i):Yo(s,1,i)}function d(){(o=e())?o.then?o.then(u).then(void 0,c):u(o):Yo(s,1,i)}}(function(){return!t&&r<5},void 0,function(){return Promise.resolve(Po(e)).then(function(e){e&&0!==window.zEventsData.length?r++:t=1})});if(o&&o.then)return o.then(function(){})}}();return i&&i.then?i.then(t):t()}()}catch(e){return n(e)}return i&&i.then?i.then(void 0,n):i}(0,function(e){L("Failed to send the pending rrweb events. Error - "+e.message)});if(s&&s.then)return s.then(function(){})}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}})}(e),function(e){var t=Wn.getInstance();window.addEventListener("beforeunload",function(n){var r=Er();try{if(window.zEventsData&&window.zEventsData.length&&window.zrrwebRecorderStatus!==a.RECORDINGPENDING){var o=JSON.stringify(window.zEventsData);Oo("pending-zEvents",Ho.compressToUTF16(o))}}catch(e){L("Failed to set data in session storage on tab beforeunload. Error - "+e.message)}try{t.rootDomain&&r.sessionStitching&&fr(e)}catch(e){L("Failed to set CookieData on tab beforeunload. Error - "+e.message)}})}(e),window.addEventListener("storage",function(e){var t=Tn.getInstance();if("session-data"===e.key){var n=JSON.parse(e.newValue),r=JSON.parse(e.oldValue);if(n.sessionId!==r.sessionId&&""!==n.sessionId){var o=parseInt(yn("last-activity-time")),i=parseInt(yn("zenduser-last-activity-time")),a=JSON.parse(yn("zsession-blocked-info")),s=JSON.parse(yn("session-data"));t.apiKey=s.sdkKey,t.isNewSession=s.isNewSession,t.sessionId=s.sessionId,t.enduserLastActivityTime=i,t.isSessionExpired=!1,t.lastActivityTime=o,t.sessionBlockInfo=a}}})}).catch(function(e){window.sdkInit=wr.Failed,L("Failed to get get sdk config from server: ")})}catch(e){L(e)}}(e)}catch(e){L("Not able to init SDK: "+e.message)}return Promise.resolve()}catch(e){return Promise.reject(e)}},ni=function(e,t){void 0===t&&(t={});try{if(!Wn.getInstance().recordOnlyIframe&&window.self!==window.parent)return}catch(e){L(e.message?e.message:e)}try{if(window.sdkInit!==wr.Completed)return L("Identify: SDK not initialized"),void setTimeout(function(){D("Calling identify again after 10 seconds"),function(e,t,n){void 0===t&&(t={}),n>0?ni(e,t):L("Identify session retries count exceeded")}(e,t,ei-=1)},1e4);if(!e||"string"!=typeof e||e.length<=0||e.trim().length<=0)return void L("Got wrong external UUID, Please validate: "+e);D("identify :: externalUUId - "+e);var n=Dn(),r=er()||{},a=o.POSTENDUSERINFO,s=t;s.externalId=e;var c=!1;if(n){var l;n.userType==i.ANONYMS||(p=null==(l=n)?void 0:l.zExternalUserInfo,f=s,D("NewEndUserInfo :: "+JSON.stringify(f)),D("PrevEndUserInfo :: "+JSON.stringify(p)),(null==p?void 0:p.externalId)===(null==f?void 0:f.externalId)?a=o.POSTENDUSERINFOANDGETUSERCONFIG:(n.euId=0,n.euZName="",n.userType=i.ANONYMS,n.isBlocked=!1,c=!0,a=o.POSTENDUSERINFOANDGETUSERCONFIG,ir(r.sdkKey),window.reinitializationInProgress=!0))}else{var u=Mn();n={euId:0,euZName:"",userType:i.ANONYMS,isBlocked:!1,zExternalUserInfo:{},zAnonymsUserInfo:{zId:u,euId:0,euZName:""}}}window.iszHandshakeDone||(a=o.POSTENDUSERINFOANDGETUSERCONFIG),n.zExternalUserInfo=s,Ln(n);var d=zn();d&&r?!c&&d.isBlocked?D("No need to do backend call if session is blocked"):Mo(r.sdkKey,a,c).then(function(e){c&&(window.zStop=oi(),Vo(b.REINIT,k.IDENTIFY))}).catch(function(e){L("Failed to post/get sdk config from server: ")}):L("Value doesn't exists in sessionBlockInfo or sessionData : ")}catch(e){L("Not able to identify SDK: "+e.message)}var p,f},ri=function(){try{if(!Wn.getInstance().recordOnlyIframe&&window.self!==window.parent)return}catch(e){L(e.message?e.message:e)}if(window.sdkInit===wr.Completed){D("Going to anonymize end user");var e,t=!1;(Fn()||((e=xn())?e.userType===i.IDENTIFIED:(D("zenduser-info doesn't exists"),0)))&&(t=!0);var n=function(){var e=Dn();return e?(e.zExternalUserInfo={},e.userType=i.ANONYMS,_n(e,!1),e):(D("zenduser Data dosen't exists"),function(){var e=xn();if(e)return e.zExternalUserInfo={},e.userType=i.ANONYMS,_n(e,!0),e;D("zenduser Data dosen't exists in temp storage")}())}()||{},r=o.GETUSERCONFIG;0===n.euId?(r=o.POSTENDUSERINFOANDGETUSERCONFIG,Ln(n),Un(n)):(Un(n),Pn());var a=er();a&&t?(window.reinitializationInProgress=!0,ir(null==a?void 0:a.sdkKey),Mo(null==a?void 0:a.sdkKey,r,!0).then(function(e){window.zStop=oi(),Vo(b.REINIT,k.ANONYMIZE)}).catch(function(e){L("Failed to post/get sdk config from server: ")})):D("Identified user doesn't exists in system No need to break session")}else L("Anonymize: SDK not initialized")};function oi(e){var t=[];try{if(x("Zipy Recorder Reinit"),window.sdkConfig=Nn(),window.isDataSyncInProgress=!1,!window.stopRecording){D("Going to stop recording ");var n=window.zStop;n&&n()}window.iszInternetDisconnected=!1,sr(),window.stopRecording=!1,window.zrecordingPaused=!1;var r=Er();if(r.domCapture){var o=Fo(r.inputMasking);t.push(o)}return t.push(Go()),Ko(r),window.reinitializationInProgress=!1,function(){try{window.stopRecording=!0,U("Calling zipy Stop Recorder"),t.forEach(function(e){return e()}),Jo()}catch(e){L("Failed to stop recording")}}}catch(e){L(e)}return function(){}}function ii(e,t){zo.getInstance().sdkTimer===N.START&&setTimeout(Xo,e,t)}var ai=function(){try{if(!Wn.getInstance().recordOnlyIframe&&window.self!==window.parent)return""}catch(e){L(e.message?e.message:e)}try{var e=Er(),t=yn("zsession-blocked-info"),n=JSON.parse(t);if(window.sdkInit!==wr.Completed||n.is_blocked)return L("SessionLink: SDK not initialized"),"";var r=er()||{},o=yn("zId");return e.customerId?z.sessionLinkUrl+"/"+r.sdkKey+"/"+e.customerId+"?is_error=false&id="+o+"&euid="+r.sessionId:(L("SessionLink: Could not find customer id"),"")}catch(e){return L("Error in generating session url. Error is - "+e.message),""}},si=function(e,t){try{var n=Er();if(!n||n&&!n.captureCustomZipyLogMessage)return void D("Custom Zipy Message not enabled.");if(e&&"string"==typeof e){var r=new CustomEvent(f,{detail:{message:e,options:t}});window.dispatchEvent(r)}else x("Mandatory params missing for zipy logs")}catch(e){x("Error in capturing zipy logs. Error - "+e.message)}},ci=function(e){try{var t=Er();if(!t||t&&!t.captureCustomZipyLogMessage)return void D("Custom Zipy Exception not enabled.");if(e){var n=new CustomEvent(g,{detail:{error:e instanceof Error?e:{message:String(e)}}});window.dispatchEvent(n)}else x("Mandatory params missing for zipy exception missing")}catch(e){x("Error in capturing zipy exception event. Error - "+e.message)}},li=function(e,t,n,r){try{var o=Er();if(!o||o&&!o.captureCustomZipyLogError)return void D("Custom Zipy Error not enabled.");if(e&&t&&"string"==typeof e&&"string"==typeof t){var i=new CustomEvent(h,{detail:{name:e,message:t,category:n,options:r}});window.dispatchEvent(i)}else x("Mandatory params missing for zipy error logs")}catch(e){L("Error in capturing zipy error event. Error - "+e.message)}},ui=function(){try{if(!Wn.getInstance().recordOnlyIframe&&window.self!==window.parent)return[]}catch(e){L(e.message?e.message:e)}try{var e=Er(),t=Tn.getInstance(),n=[];if(null!=e&&e.captureUTM)if(e.sessionStitching){var r=cr(t.apiKey+d.utms);r&&"undefined"!==r&&(n=JSON.parse(decodeURIComponent(r)))}else{var o=yn("zUTMParams");o&&(n=JSON.parse(o))}return n}catch(e){return L("Error in getting utm params. Error is - "+e.message),[]}},di={stop:jo.getInstance().stop.bind(jo.getInstance())},pi=function(e,n){void 0===n&&(n={});try{if(window.sdkInit!==wr.Completed)throw new Error("SDK is not initialized");var r=Er();if(!r.captureCustomEvents)return;var o=function(e){var n=e.eventName,r=e.properties,o=e.maxLength,i=e.maxPayloadSize;if(!n.trim()||n.length>255)throw new Error("Event name doesn't meet the requirement.");for(var a={},s=0,c=Object.entries(r);s<c.length;s++){var l=c[s],u=l[0],d=l[1];if(("number"==typeof d||"boolean"==typeof d||"string"==typeof d&&d.trim().length<255||Array.isArray(d)&&d.length>0&&d.length<o)&&(a[u]=d,Object.keys(a).length>=o))break}if(2*JSON.stringify(a).length>i)throw new Error("Max Payload limit exceeded.");return{data:{eventName:n,properties:a},type:t.CustomEvent,time:Date.now()}}({eventName:e,properties:n,maxLength:r.maxCustomEventProperties,maxPayloadSize:r.maxCustomEventPayloadSize});i=o,a=Er(),window.zrecordingPaused||Zo()&&!tr(a)||Qn()&&window.zCustomEventData.push(i),_o({data:JSON.stringify(o.data),type:t.CustomEvent,time:o.time,isError:!1,navigatedUrl:window.location.origin+window.location.pathname})}catch(e){L("Custom Events: Failed to send custom event. Error - "+e.message)}var i,a},fi={init:ti,identify:ni,anonymize:ri,getCurrentSessionURL:ai,logError:li,logException:ci,logMessage:si,logEvent:pi,extractUTMParameters:ui,record:di};e.anonymize=ri,e.default=fi,e.extractUTMParameters=ui,e.getCurrentSessionURL=ai,e.identify=ni,e.init=ti,e.logError=li,e.logEvent=pi,e.logException=ci,e.logMessage=si,e.record=di});