window.NOIBUJS_CONFIG={"scriptID":"1.86.0","domain":"."};(()=>{var e={181:(e,t,n)=>{var r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,l="object"==typeof self&&self&&self.Object===Object&&self,u=c||l||Function("return this")(),d=Object.prototype.toString,h=Math.max,p=Math.min,g=function(){return u.Date.now()};function f(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(f(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=f(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=o.test(e);return n||s.test(e)?a(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,o,s,a,c,l=0,u=!1,d=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,o=i;return r=i=void 0,l=t,s=e.apply(o,n)}function b(e){return l=e,a=setTimeout(C,t),u?y(e):s}function I(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function C(){var e=g();if(I(e))return w(e);a=setTimeout(C,function(e){var n=t-(e-c);return d?p(n,o-(e-l)):n}(e))}function w(e){return a=void 0,v&&r?y(e):(r=i=void 0,s)}function S(){var e=g(),n=I(e);if(r=arguments,i=this,c=e,n){if(void 0===a)return b(c);if(d)return a=setTimeout(C,t),y(c)}return void 0===a&&(a=setTimeout(C,t)),s}return t=m(t)||0,f(n)&&(u=!!n.leading,o=(d="maxWait"in n)?h(m(n.maxWait)||0,t):o,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==a&&clearTimeout(a),l=0,r=c=i=a=void 0},S.flush=function(){return void 0===a?s:w(g())},S}},471:e=>{for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var r=n||0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},814:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},550:(e,t,n)=>{var r=n(814),i=n(471);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[o+a]=s[a];return t||i(s)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e,t,r,i,o,s,a,c,l,u,d,h,p,g,f={};n.r(f),n.d(f,{CLSThresholds:()=>si,FCPThresholds:()=>ii,FIDThresholds:()=>Ki,INPThresholds:()=>Ci,LCPThresholds:()=>Fi,TTFBThresholds:()=>Wi,onCLS:()=>ai,onFCP:()=>ci,onFID:()=>Yi,onINP:()=>Pi,onLCP:()=>Ui,onTTFB:()=>Hi}),function(e){e.TwoG="2g",e.ThreeG="3g",e.FourG="4g",e.Slow2g="slow-2g"}(e||(e={})),function(e){e.JS="js",e.Http="http",e.Gql="gql",e.Csp="csp",e.Resource="res",e.PageCheck="pagecheck_err",e.HttpResponseMatch="http_match"}(t||(t={})),function(e){e.Error="err",e.UserStep="userstep",e.Http="http",e.Loc="loc",e.Page="page",e.WebVital="wv",e.ECommerce="ecommerce",e.NetworkStats="network",e.Sample="sample",e.ApplicationNavigation="app_nav",e.PageCheck="pagecheck",e.VisualError="visual_error",e.Title="title",e.PageType="page_type",e.PageGroups="page_groups"}(r||(r={})),function(e){e.VideoBlock="vid_block",e.PageVisitBlock="pv_block",e.FullBlock="full_block",e.CloseConnection="close_conn",e.OK="ok"}(i||(i={})),function(e){e.StorageFull="sf",e.StorageUnavailable="su",e.StorageUnavailableSecurityError="suse"}(o||(o={})),function(e){e.XMLHttpRequest="XMLHttpRequest",e.ErrorEvent="ErrorEvent",e.UnhandledRejectionError="UnhandledRejectionError",e.Event="Event",e.Response="Response",e.WrappedException="WrappedException",e.FetchException="FetchException",e.ErrorLogEvent="ErrorLogEvent",e.CustomError="CustomError",e.ReactError="ReactError",e.VueError="VueError",e.PageCheckError="PageCheckError"}(s||(s={})),function(e){e.WARN="warn",e.INFO="info",e.DEBUG="debug",e.ERROR="error"}(a||(a={})),function(e){e.Click="click",e.Keyboard="kbd",e.Navigation="navigation"}(c||(c={})),function(e){e.RRWeb="RRWeb",e.AndroidNative="AndroidNative",e.IOSNative="IOSNative"}(l||(l={})),function(e){e.PageVisitPart="pvp",e.PageVisitVideoFile="pvvf",e.PageVisitHttp="pvh",e.PageVisitMeta="pvm",e.WorkRequest="wr"}(u||(u={})),function(e){e.CumulativeLayoutShift="CLS",e.FirstContentfulPaint="FCP",e.FirstInputDelay="FID",e.InteractionToNextPaint="INP",e.LargestContentfulPaint="LCP",e.TimeToFirstByte="TTFB"}(d||(d={})),function(e){e.Good="good",e.NeedsImprovement="needs-improvement",e.Poor="poor",e.Unknown="unknown"}(h||(h={})),function(e){e.HelpCode="hc"}(p||(p={})),function(e){e.PageVisitPart="pv_part",e.CollectError="collect_error",e.Metrics="metrics",e.PageVisit="pv"}(g||(g={}));const m=["metroplexSocketBase","metroplexHTTPBase"],v="Response data unavailable due to an improperly wrapped fetch call",y=["authorization","from","proxy-authorization","content-md5","cookie","x-forwarded-for","x-real-ip","x-device-id","x-auth-token","x-user-id","x-forwarded-for","x-uidh","set-cookie","forwarded"],b=/[0-9]+/g,I=/\b[a-z0-9!#$%&'*+/=?^_‘{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_‘{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)*[a-z0-9-]*[a-z]\w*\b/gi,C=[/\b4\d{12}(?:\d{3})?\b/g,/\b(?:5[1-5]\d{2}|222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}\b/g,/\b3[47]\d{13}\b/g,/\b3(?:0[0-5]|[68]\d)\d{11}\b/g,/\b6(?:011|5\d{2})\d{12}\b/g,/\b(?:2131|1800|35\d{3})\d{11}\b/g,I,/\b(?!000|666)[0-8]\d{2}[-.● ]?(?!00)\d{2}[-.● ]?(?!0000)\d{4}\b/g,/\b(\d{3}[-.● ]?\d{3}[-.● ]?\d{3})\b/g,/\+(?:\d●?){6,14}\d\b/g,/(\b|\+)?(1[-.● ]?)?\(?(\d{3})\)?[-.● ]?(\d{3})[-.● ]?(\d{4})\b/g],w=/^www\d{0,2}$/,S=/(getElementById\(')([^']*)('\)\.value = )('[^']*')/g,E=a.ERROR,A=a.WARN,k=(a.INFO,a.DEBUG,["Image","EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"]),T=u.PageVisitPart,_=u.PageVisitVideoFile,R=u.PageVisitMeta,M=u.PageVisitHttp,N="type",x="tag",L="src",D="txt",O="hid",P="class",F=p.HelpCode,V=u.WorkRequest,U=(o.StorageFull,o.StorageUnavailable,o.StorageUnavailableSecurityError,t.Http),W=r.Http,B=t.JS,H=t.Gql,q=t.Csp,G=t.Resource,j=r.UserStep,z=r.WebVital,Z=c.Click,$=c.Keyboard,K=(c.Navigation,r.Loc),Y=r.Error,J=r.Page,Q=r.NetworkStats,X=r.ECommerce,ee=(r.Sample,t.PageCheck),te=r.VisualError,ne=r.Title,re=r.PageGroups,ie=u.PageVisitPart,oe=u.PageVisitVideoFile,se=u.PageVisitMeta,ae=u.PageVisitHttp,ce=l.RRWeb;function le(){return self.NOIBUJS_CONFIG||{}}const ue=["i.noibu","i.staging.noibu","input.staging.noibu","input.b.noibu","input.noibu","vf.staging.noibu","vf.noibu"],de=g.PageVisitPart,he=g.CollectError,pe=(g.Metrics,g.PageVisit),ge=i.VideoBlock,fe=i.PageVisitBlock,me=i.FullBlock,ve=i.CloseConnection,ye=i.OK,be=s.XMLHttpRequest,Ie=s.ErrorEvent,Ce=s.UnhandledRejectionError,we=s.Event,Se=s.Response,Ee=s.PageCheckError,Ae=s.WrappedException,ke=s.FetchException,Te=s.ErrorLogEvent,_e=s.CustomError,Re=s.ReactError,Me=s.VueError,Ne=["error","warn","log"],xe=["pagehide","pageshow","popstate","online","offline","messageerror","languagechange","hashchange","beforeprint","afterprint","load","resize"],Le=["blur","focus"],De=["visibilitychange","resume","freeze","readystatechange","cut","copy","paste"],Oe=new Set(["background-position-x","background-position-y","background-size","background-attachment","background-origin","background-clip","background-color","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-width","border-right-width","border-bottom-width","border-left-width","flex-wrap","list-style-image","list-style-position","max-width","outline-color","outline-style","outline-width","max-height","height","color","border-collapse","text-indent","width","position","line-height","white-space","display","top","pointer-events","right","overflow-x","overflow-y","text-align","padding-top","padding-bottom","padding-right","padding-left","transform","text-decoration-line","font-variant-ligatures","font-variant-caps","font-variant-alternates","font-variant-numeric","font-variant-east-asian","font-variant-position","background-image"].map(e=>"--quantum-metric-"+e));function Pe(){return"beta"===le().njs_version}function Fe(){return Pe()?"1.86.0-beta":"1.86.0"}function Ve(){return le().att_sel||{}}function Ue(){return Pe()?"wss://input.b.noibu.com":"wss://input.noibu.com"}function We(){return Pe()?"https://input.b.noibu.com":"https://input.noibu.com"}function Be(){return`${We()}/${pe}`}const He=[e=>/AppMeasurement Debug/i.test(e)],qe=new Set(["button","radio","checkbox","reset","submit"]),Ge=[e=>"button"===e,(e,t)=>"input"===e&&qe.has(t.type),e=>"a"===e,e=>"select"===e,e=>"option"===e];var je,ze=n(550),Ze=n.n(ze);function $e(e){return e.nodeType===e.ELEMENT_NODE}function Ke(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function Ye(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Je(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(Qe).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 Qe(e){var t;if(function(e){return"styleSheet"in e}(e))try{t=Je(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}return function(e){if(e.includes(":")){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}return e}(t||e.cssText)}!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"}(je||(je={}));var Xe=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);if(this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)})),e.nodeType===Node.ELEMENT_NODE){var r=e;r.shadowRoot&&r.shadowRoot.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){var n=t.id;this.idNodeMap.set(n,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 et(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.value,s=e.maskInputFn,a=o||"",c=i&&tt(i);return(n[r.toLowerCase()]||c&&n[c])&&(a=s?s(a,t):"*".repeat(a.length)),a}function tt(e){return e.toLowerCase()}function nt(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?tt(t):null}var rt,it,ot=1,st=new RegExp("[^a-z0-9-_:]");function at(){return ot++}var ct=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,lt=/^(?:[a-z+]+:)?\/\//i,ut=/^www\..*/i,dt=/^(data:)([^,]*),(.*)/i;function ht(e,t){return(e||"").replace(ct,(function(e,n,r,i,o,s){var a,c=r||o||s,l=n||i||"";if(!c)return e;if(lt.test(c)||ut.test(c))return"url(".concat(l).concat(c).concat(l,")");if(dt.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+c)).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var h=0,p=d;h<p.length;h++){var g=p[h];"."!==g&&(".."===g?u.pop():u.push(g))}return"url(".concat(l).concat(u.join("/")).concat(l,")")}))}var pt=/^[^ \t\n\r\u000c]+/,gt=/^[, \t\n\r\u000c]+/;function ft(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function mt(){var e=document.createElement("a");return e.href="",e.href}function vt(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?ft(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,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}for(var i=[];r(gt),!(n>=t.length);){var o=r(pt);if(","===o.slice(-1))o=ft(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=ft(e,o);for(var a=!1;;){var c=t.charAt(n);if(""===c){i.push((o+s).trim());break}if(a)")"===c&&(a=!1);else{if(","===c){n+=1,i.push((o+s).trim());break}"("===c&&(a=!0)}s+=c,n+=1}}}return i.join(", ")}(e,r):"style"===n?ht(r,mt()):"object"===t&&"data"===n?ft(e,r):r:ft(e,r):r}function yt(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function bt(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&bt(e.parentNode,t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&bt(e.parentNode,t,n)}function It(e,t,n){try{var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(".".concat(t)))return!0}else if(bt(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}}catch(e){}return!1}function Ct(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,u=void 0===l?{}:l,d=t.maskTextFn,h=t.maskInputFn,p=t.dataURLOptions,g=void 0===p?{}:p,f=t.inlineImages,m=t.recordCanvas,v=t.keepIframeSrcFn,y=t.newlyAddedElement,b=void 0!==y&&y,I=t.maskCurrentNode,C=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:je.Document,childNodes:[],compatMode:e.compatMode}:{type:je.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:je.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,r=t.blockClass,i=t.blockSelector,o=t.inlineStylesheet,s=t.maskInputOptions,a=void 0===s?{}:s,c=t.maskInputFn,l=t.dataURLOptions,u=void 0===l?{}:l,d=t.inlineImages,h=t.recordCanvas,p=t.keepIframeSrcFn,g=t.newlyAddedElement,f=void 0!==g&&g,m=t.rootId,v=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,i),y=function(e){if(e instanceof HTMLFormElement)return"form";var t=tt(e.tagName);return st.test(t)?"div":t}(e),b={},I=e.attributes.length,C=0;C<I;C++){var w=e.attributes[C];yt(y,w.name,w.value)||(b[w.name]=vt(n,y,tt(w.name),w.value))}if("link"===y&&o){var S=Array.from(n.styleSheets).find((function(t){return t.href===e.href})),E=null;S&&(E=Je(S)),E&&(delete b.rel,delete b.href,b._cssText=ht(E,S.href))}if("style"===y&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(E=Je(e.sheet))&&(b._cssText=ht(E,mt()))}if("input"===y||"textarea"===y||"select"===y){var A=e.value,k=e.checked;if("radio"!==b.type&&"checkbox"!==b.type&&"submit"!==b.type&&"button"!==b.type&&A){var T=nt(e);b.value=et({element:e,type:T,tagName:y,value:A,maskInputOptions:a,maskInputFn:c})}else k&&(b.checked=k)}"option"===y&&(e.selected&&!a.select?b.selected=!0:delete b.selected);if("canvas"===y&&h)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 i=t.getImageData,o="__rrweb_original__"in i?i.__rrweb_original__:i;if(new Uint32Array(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)||(b.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var _=e.toDataURL(u.type,u.quality),R=document.createElement("canvas");R.width=e.width,R.height=e.height;var M=R.toDataURL(u.type,u.quality);_!==M&&(b.rr_dataURL=_)}if("img"===y&&d){rt||(rt=n.createElement("canvas"),it=rt.getContext("2d"));var N=e,x=N.crossOrigin;N.crossOrigin="anonymous";var L=function(){N.removeEventListener("load",L);try{rt.width=N.naturalWidth,rt.height=N.naturalHeight,it.drawImage(N,0,0),b.rr_dataURL=rt.toDataURL(u.type,u.quality)}catch(e){}x?b.crossOrigin=x:N.removeAttribute("crossorigin")};N.complete&&0!==N.naturalWidth?L():N.addEventListener("load",L)}"audio"!==y&&"video"!==y||(b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime);f||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop));if(v){var D=e.getBoundingClientRect(),O=D.width,P=D.height;b={class:b.class,rr_width:"".concat(O,"px"),rr_height:"".concat(P,"px")}}"iframe"!==y||p(b.src)||(e.contentDocument||(b.rr_src=b.src),delete b.src);return{type:je.Element,tagName:y,attributes:b,childNodes:[],isSVG:(F=e,Boolean("svg"===F.tagName||F.ownerSVGElement)||void 0),needBlock:v,rootId:m};var F}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:c,maskInputOptions:u,maskInputFn:h,dataURLOptions:g,inlineImages:f,recordCanvas:m,keepIframeSrcFn:v,newlyAddedElement:b,rootId:C});case e.TEXT_NODE:return function(e,t){var n,r=t.maskTextClass,i=t.maskTextSelector,o=t.maskTextFn,s=t.rootId,a=t.maskCurrentNode,c=e.parentNode&&e.parentNode.tagName,l=e.textContent,u="STYLE"===c||void 0,d="SCRIPT"===c||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(l=Je(e.parentNode.sheet))}catch(e){}l=ht(l,mt())}d&&(l="SCRIPT_PLACEHOLDER");if(!u&&!d&&l){(void 0===a?It(e,r,i):a)&&(l=o?o(l):l.replace(/[\S]/g,"*"))}return{type:je.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{maskTextClass:s,maskTextSelector:a,maskTextFn:d,rootId:C,maskCurrentNode:I});case e.CDATA_SECTION_NODE:return{type:je.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:je.Comment,textContent:e.textContent||"",rootId:C};default:return!1}}function wt(e){return null==e?"":e.toLowerCase()}function St(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,c=t.skipChild,l=void 0!==c&&c,u=t.inlineStylesheet,d=void 0===u||u,h=t.maskInputOptions,p=void 0===h?{}:h,g=t.maskTextFn,f=t.maskInputFn,m=t.slimDOMOptions,v=t.dataURLOptions,y=void 0===v?{}:v,b=t.inlineImages,I=void 0!==b&&b,C=t.recordCanvas,w=void 0!==C&&C,S=t.onSerialize,E=t.onIframeLoad,A=t.iframeLoadTimeout,k=void 0===A?5e3:A,T=t.onStylesheetLoad,_=t.stylesheetLoadTimeout,R=void 0===_?5e3:_,M=t.keepIframeSrcFn,N=void 0===M?function(){return!1}:M,x=t.newlyAddedElement,L=void 0!==x&&x,D=t.maskedElements,O=void 0===D?[]:D,P=t.preserveWhiteSpace,F=void 0===P||P,V=t.maskCurrentNode;!1===V&&(V=O.includes(e));var U,W=Ct(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,inlineStylesheet:d,maskInputOptions:p,maskTextFn:g,maskInputFn:f,dataURLOptions:y,inlineImages:I,recordCanvas:w,keepIframeSrcFn:N,newlyAddedElement:L,maskCurrentNode:V});if(!W)return null;U=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===je.Comment)return!0;if(e.type===je.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&&(wt(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===wt(e.attributes.name)||"icon"===wt(e.attributes.rel)||"apple-touch-icon"===wt(e.attributes.rel)||"shortcut icon"===wt(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&wt(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(wt(e.attributes.property).match(/^(og|twitter|fb):/)||wt(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===wt(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===wt(e.attributes.name)||"googlebot"===wt(e.attributes.name)||"bingbot"===wt(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===wt(e.attributes.name)||"generator"===wt(e.attributes.name)||"framework"===wt(e.attributes.name)||"publisher"===wt(e.attributes.name)||"progid"===wt(e.attributes.name)||wt(e.attributes.property).match(/^article:/)||wt(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===wt(e.attributes.name)||"yandex-verification"===wt(e.attributes.name)||"csrf-token"===wt(e.attributes.name)||"p:domain_verify"===wt(e.attributes.name)||"verify-v1"===wt(e.attributes.name)||"verification"===wt(e.attributes.name)||"shopify-checkout-api-token"===wt(e.attributes.name)))return!0}}return!1}(W,m)&&(F||W.type!==je.Text||W.isStyle||W.textContent.replace(/^\s+|\s+$/gm,"").length)?at():-2;var B=Object.assign(W,{id:U});if(r.add(e,B),-2===U)return null;S&&S(e);var H=!l;if(B.type===je.Element){H=H&&!B.needBlock,delete B.needBlock;var q=e.shadowRoot;q&&Ye(q)&&(B.isShadowHost=!0)}if((B.type===je.Document||B.type===je.Element)&&H){m.headWhitespace&&B.type===je.Element&&"head"===B.tagName&&(F=!1);for(var G={doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:d,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:m,dataURLOptions:y,inlineImages:I,recordCanvas:w,preserveWhiteSpace:F,onSerialize:S,onIframeLoad:E,iframeLoadTimeout:k,onStylesheetLoad:T,stylesheetLoadTimeout:R,keepIframeSrcFn:N,maskCurrentNode:V,maskedElements:O},j=0,z=Array.from(e.childNodes);j<z.length;j++){(K=St(z[j],G))&&B.childNodes.push(K)}if($e(e)&&e.shadowRoot)for(var Z=0,$=Array.from(e.shadowRoot.childNodes);Z<$.length;Z++){var K;(K=St($[Z],G))&&(Ye(e.shadowRoot)&&(K.isShadow=!0),B.childNodes.push(K))}}return e.parentNode&&Ke(e.parentNode)&&Ye(e.parentNode)&&(B.isShadow=!0),B.type===je.Element&&"iframe"===B.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){if("about:blank"!==r.location.href||"about:blank"===e.src||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&E){var n=St(t,{doc:t,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:m,dataURLOptions:y,inlineImages:I,recordCanvas:w,preserveWhiteSpace:F,onSerialize:S,onIframeLoad:E,iframeLoadTimeout:k,onStylesheetLoad:T,stylesheetLoadTimeout:R,keepIframeSrcFn:N,maskCurrentNode:V,maskedElements:O});n&&E(e,n)}}),k),B.type===je.Element&&"link"===B.tagName&&"stylesheet"===B.attributes.rel&&function(e,t,n){var r,i=!1;try{r=e.sheet}catch(e){return}if(!r){var o=setTimeout((function(){i||(t(),i=!0)}),n);e.addEventListener("load",(function(){clearTimeout(o),i=!0,t()}))}}(e,(function(){if(T){var t=St(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:m,dataURLOptions:y,inlineImages:I,recordCanvas:w,preserveWhiteSpace:F,onSerialize:S,onIframeLoad:E,iframeLoadTimeout:k,onStylesheetLoad:T,stylesheetLoadTimeout:R,keepIframeSrcFn:N,maskCurrentNode:V,maskedElements:O});t&&T(e,t)}}),R),B}var Et=/([^\\]):hover/;new RegExp(Et.source,"g");function At(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}let kt={map:{},getId:()=>-1,getNode:()=>null,removeNodeFromMap(){},has:()=>!1,reset(){}};function Tt(e,t,n={}){let r=null,i=0;return function(...o){const s=Date.now();i||!1!==n.leading||(i=s);const a=t-(s-i),c=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),i=s,e.apply(c,o)):r||!1===n.trailing||(r=setTimeout(()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(c,o)},a))}}function _t(e,t,n,r,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>_t(e,t,o||{},!0)}function Rt(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(kt=new Proxy(kt,{get:(e,t,n)=>Reflect.get(e,t,n)}));let Mt=Date.now;function Nt(e){var t,n,r,i,o,s;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null===(n=null===(t=null==a?void 0:a.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==a?void 0:a.body)||void 0===r?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null===(o=null===(i=null==a?void 0:a.body)||void 0===i?void 0:i.parentElement)||void 0===o?void 0:o.scrollTop)||(null===(s=null==a?void 0:a.body)||void 0===s?void 0:s.scrollTop)||0}}function xt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Lt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Dt(e,t,n,r){if(!e)return!1;const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if(bt(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function Ot(e,t){return-2===t.getId(e)}function Pt(e){return Boolean(e.changedTouches)}function Ft(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Vt(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ut(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Mt=()=>(new Date).getTime());class Wt{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 Bt(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 Ht(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=Bt(n);)n=t;return n}(e);return t.contains(n)}function qt(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||Ht(e))}var Gt=(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))(Gt||{}),jt=(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))(jt||{}),zt=(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))(zt||{}),Zt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Zt||{}),$t=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))($t||{});function Kt(e){return"__ln"in e}class Yt{constructor(){this.length=0,this.head=null,this.tail=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&&Kt(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&&Kt(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;null===t.next&&(this.tail=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.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Jt=(e,t)=>`${e}@${t}`;class Qt{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=>{const t=e=>{e.forEach(this.processMutation),this.emit()};if(this.deferProcessMutations){const n=100;for(let r=0;r<Math.ceil(e.length/n);r++){const i=r*n,o=(r+1)*n;setTimeout(()=>t(e.slice(i,o)))}}else t(e)},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new Yt,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{if(!i.parentNode||!qt(i))return;const o=Ke(i.parentNode)?this.mirror.getId(Bt(i)):this.mirror.getId(i.parentNode),s=r(i);if(-1===o||-1===s)return n.addNode(i);const a=St(i,{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,onSerialize:e=>{Ft(e,this.mirror)&&this.iframeManager.addIframe(e),Vt(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ut(i)&&this.shadowDomManager.addShadowRoot(i.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:s,node:a}),t.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)en(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||i(e);for(const e of this.addedSet)tn(this.droppedSet,e)||en(this.removes,e,this.mirror)?tn(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let o=null;for(;n.length;){let e=null;if(o){const t=this.mirror.getId(o.value.parentNode),n=r(o.value);-1!==t&&-1!==n&&(e=o)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}o=e.previous,n.removeNode(e.value),i(e.value)}const s={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=e=>{try{if(Qt.shouldSkipMutation(e))return}catch(e){}if(Ot(e.target,this.mirror))return;let t;try{t=document.implementation.createHTMLDocument()}catch(e){t=this.doc}switch(e.type){case"characterData":{const t=e.target.textContent;Dt(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:It(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if("value"===r){const e=nt(n);i=et({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:i,maskInputFn:this.maskInputFn})}if(Dt(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let o=this.attributes.find(t=>t.node===e.target);if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(i)){if(n.contentDocument)return;try{e.attributeName="rr_src"}catch(e){return}}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!yt(n.tagName,r)&&(o.attributes[r]=vt(this.doc,tt(n.tagName),tt(r),i),"style"===r)){const r=t.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(n.style)){const t=n.style.getPropertyValue(e),i=n.style.getPropertyPriority(e);t!==r.style.getPropertyValue(e)||i!==r.style.getPropertyPriority(e)?o.styleDiff[e]=""===i?t:[t,i]:o._unchangedStyles[e]=[t,i]}for(const e of Array.from(r.style))""===n.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}break}case"childList":if(Dt(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=Ke(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Dt(e.target,this.blockClass,this.blockSelector,!1)||Ot(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Xt(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||function e(t,n){if(Ke(t))return!1;const r=n.getId(t);return!n.has(r)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode,n))}(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Jt(n,r)]?Xt(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!Ke(e.target)||!Ye(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Ot(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[Jt(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Dt(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach(e=>this.genAdds(e)),Ut(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","deferProcessMutations"].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()}static shouldSkipMutation(e){var t;const n=e.attributeName||"",r="attributes"===e.type,i=e.oldValue,o=null===(t=e.target.attributes.getNamedItem(n))||void 0===t?void 0:t.value;if(r&&i===o)return!0;const s=window.location.hostname.toLowerCase();if("uat.jtv.com"===s||"www.jtv.com"===s){const e="id"===n&&(0===(i||"").indexOf("sizzle-")||0===(o||"").indexOf("sizzle-"));if(r&&("tabindex"===n||e||"data-slick-index"===n))return!0}return!1}}function Xt(e,t){e.delete(t),t.childNodes.forEach(t=>Xt(e,t))}function en(e,t,n){return 0!==e.length&&function e(t,n,r){const{parentNode:i}=n;if(!i)return!1;const o=r.getId(i);if(t.some(e=>e.id===o))return!0;return e(t,i,r)}(e,t,n)}function tn(e,t){return 0!==e.size&&function e(t,n){const{parentNode:r}=n;if(!r)return!1;if(t.has(r))return!0;return e(t,r)}(e,t)}let nn;function rn(e){nn=e}function on(){nn=void 0}const sn=e=>{if(!nn)return e;return(...t)=>{try{return e(...t)}catch(e){if(nn&&!0===nn(e))return;throw e}}},an=[];function cn(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]}catch(e){}return e&&e.target}function ln(e,t){var n,r;const i=new Qt;an.push(i),i.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const s=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");s&&window[s]&&(o=window[s]);const a=new o(sn(i.processMutations.bind(i)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function un({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let c=null;return Object.keys(zt).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(o=>{let s=tt(o);const l=(t=>o=>{const s=cn(o);if(Dt(s,r,i,!0))return;let a=null,l=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Zt.Mouse;break;case"touch":a=Zt.Touch;break;case"pen":a=Zt.Pen}a===Zt.Touch?zt[t]===zt.MouseDown?l="TouchStart":zt[t]===zt.MouseUp&&(l="TouchEnd"):Zt.Pen}else Pt(o)&&(a=Zt.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===Zt.Touch||l.startsWith("Mouse")&&a===Zt.Mouse)&&(a=null)):zt[t]===zt.Click&&(a=c,c=null);const u=Pt(o)?o.changedTouches[0]:o;if(!u)return;const d=n.getId(s),{clientX:h,clientY:p}=u;sn(e)(Object.assign({type:zt[l],id:d,x:h,y:p},null!==a&&{pointerType:a}))})(o);if(window.PointerEvent)switch(zt[o]){case zt.MouseDown:case zt.MouseUp:s=s.replace("mouse","pointer");break;case zt.TouchStart:case zt.TouchEnd:return}a.push(At(s,l,t))}),sn(()=>{a.forEach(e=>e())})}function dn({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){return At("scroll",sn(Tt(sn(o=>{const s=cn(o);if(!s||Dt(s,r,i,!0))return;const a=n.getId(s);if(s===t&&t.defaultView){const n=Nt(t.defaultView);e({id:a,x:n.left,y:n.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}function hn(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const pn=["INPUT","TEXTAREA","SELECT"],gn=new WeakMap;function fn(e){return function(e,t){if(bn("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||bn("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||bn("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||bn("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 mn(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function vn({mirror:e,stylesheetManager:t},n){var r,i,o;let s=null;s="#document"===n.nodeName?e.getId(n):e.getId(n.host);const a="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(o=null===(i=n.ownerDocument)||void 0===i?void 0:i.defaultView)||void 0===o?void 0:o.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==s&&-1!==s&&a&&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!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return r}}),sn(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})):()=>{}}function yn(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p}=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),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...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),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}}(e,t);const r=ln(e,e.doc),i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const i="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const c=Tt(sn(t=>{const n=Date.now()-s;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],s=null}),o),l=sn(Tt(sn(e=>{const t=cn(e),{clientX:n,clientY:i}=Pt(e)?e.changedTouches[0]:e;s||(s=Mt()),a.push({x:n,y:i,id:r.getId(t),timeOffset:Mt()-s}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?jt.Drag:e instanceof MouseEvent?jt.MouseMove:jt.TouchMove)}),i,{trailing:!1})),u=[At("mousemove",l,n),At("touchmove",l,n),At("drag",l,n)];return sn(()=>{u.forEach(e=>e())})}(e),o=un(e),s=dn(e),a=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return At("resize",sn(Tt(sn(()=>{const t=xt(),i=Lt();n===t&&r===i||(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}(e,{win:n}),c=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function d(e){let n=cn(e);const l=e.isTrusted,d=n&&n.tagName;if(n&&"OPTION"===d&&(n=n.parentElement),!n||!d||pn.indexOf(d)<0||Dt(n,r,i,!0))return;if(n.classList.contains(o)||s&&n.matches(s))return;let p=n.value,g=!1;const f=nt(n)||"";"radio"===f||"checkbox"===f?g=n.checked:(a[d.toLowerCase()]||a[f])&&(p=et({element:n,maskInputOptions:a,tagName:d,type:f,value:p,maskInputFn:c})),h(n,sn(hn)({text:p,isChecked:g,userTriggered:l},u));const m=n.name;"radio"===f&&m&&g&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach(e=>{e!==n&&h(e,sn(hn)({text:e.value,isChecked:!g,userTriggered:!1},u))})}function h(t,r){const i=gn.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){gn.set(t,r);const i=n.getId(t);sn(e)(Object.assign(Object.assign({},r),{id:i}))}}const p=("last"===l.input?["change"]:["input","change"]).map(e=>At(e,sn(d),t)),g=t.defaultView;if(!g)return()=>{p.forEach(e=>e())};const f=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),m=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];try{g.document.querySelectorAll('input[type="checkbox"]').forEach(e=>{g.Object.getOwnPropertyDescriptor(e,"checked")&&m.push([e,"checked"])})}catch(e){}return f&&f.set&&p.push(...m.map(e=>_t(e[0],e[1],{set(){sn(d)({target:this,isTrusted:!1})}},!1,g))),sn(()=>{p.forEach(e=>e())})}(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){const s=sn(o=>Tt(sn(i=>{const s=cn(i);if(!s||Dt(s,t,n,!0))return;const{currentTime:a,volume:c,muted:l,playbackRate:u}=s;e({type:o,id:r.getId(s),currentTime:a,volume:c,muted:l,playbackRate:u})}),i.media||500)),a=[At("play",s(0),o),At("pause",s(1),o),At("seeked",s(2),o),At("volumechange",s(3),o),At("ratechange",s(4),o)];return sn(()=>{a.forEach(e=>e())})}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:sn((r,i,o)=>{const[s,a]=o,{id:c,styleId:l}=mn(i,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:s,index:a}]}),r.apply(i,o)})});const o=r.CSSStyleSheet.prototype.deleteRule;let s,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:sn((r,i,o)=>{const[s]=o,{id:a,styleId:c}=mn(i,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:s}]}),r.apply(i,o)})}),r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:sn((r,i,o)=>{const[s]=o,{id:a,styleId:c}=mn(i,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replace:s}),r.apply(i,o)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:sn((r,i,o)=>{const[s]=o,{id:a,styleId:c}=mn(i,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replaceSync:s}),r.apply(i,o)})}));const c={};In("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(In("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),In("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),In("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:sn((r,i,o)=>{const[s,a]=o,{id:c,styleId:l}=mn(i.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:s,index:[...fn(i),a||0]}]}),r.apply(i,o)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:sn((r,i,o)=>{const[s]=o,{id:a,styleId:c}=mn(i.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:[...fn(i),s]}]}),r.apply(i,o)})})}),sn(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}(e,{win:n}),d=vn(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:sn((i,s,a)=>{var c;const[l,u,d]=a;if(n.has(l))return o.apply(s,[l,u,d]);const{id:h,styleId:p}=mn(null===(c=s.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,r.styleMirror);return(h&&-1!==h||p&&-1!==p)&&e({id:h,styleId:p,set:{property:l,value:u,priority:d},index:fn(s.parentRule)}),i.apply(s,a)})});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:sn((i,o,a)=>{var c;const[l]=a;if(n.has(l))return s.apply(o,[l]);const{id:u,styleId:d}=mn(null===(c=o.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:fn(o.parentRule)}),i.apply(o,a)})}),sn(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}(e,{win:n}),p=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,n){const r=new o(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const s=Rt(t.fonts,"add",(function(t){return function(n){return setTimeout(sn(()=>{const t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}}));return r.push(()=>{n.FontFace=o}),r.push(s),sn(()=>{r.forEach(e=>e())})}(e):()=>{},g=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e;let s=!0;const a=sn(()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const o=e.getRangeAt(t),{startContainer:s,startOffset:c,endContainer:l,endOffset:u}=o;Dt(s,r,i,!0)||Dt(l,r,i,!0)||a.push({start:n.getId(s),startOffset:c,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),At("selectionchange",a)}(e),f=[];for(const t of e.plugins)f.push(t.observer(t.callback,n,t.options));return sn(()=>{an.forEach(e=>e.reset()),r.disconnect(),i(),o(),s(),a(),c(),l(),u(),d(),h(),p(),g(),f.forEach(e=>e())})}function bn(e){return void 0!==window[e]}function In(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Cn{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e);let s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}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);if("number"!=typeof t)return t;const i=r.get(t);return i||-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 wn{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Cn(at),this.crossOriginIframeRootIdMap=new WeakMap,this.ignoreIframes=e.ignoreIframes,this.ignoreIframes||(this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Cn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this)))}addIframe(e){this.ignoreIframes||(this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e))}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.ignoreIframes||(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 Gt.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:Gt.IncrementalSnapshot,data:{source:jt.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Gt.Meta:case Gt.Load:case Gt.DomContentLoaded:return!1;case Gt.Plugin:return t;case Gt.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Gt.IncrementalSnapshot:switch(t.data.source){case jt.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 jt.Drag:case jt.TouchMove:case jt.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case jt.ViewportResize:return!1;case jt.MediaInteraction:case jt.MouseInteraction:case jt.Scroll:case jt.CanvasMutation:case jt.Input:return this.replaceIds(t.data,e,["id"]),t;case jt.StyleSheetRule:case jt.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case jt.Font:return t;case jt.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case jt.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 i of r)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));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===je.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Sn{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.active=!0,this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!this.active)return;if(!Ye(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=ln(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(dn(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(vn({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;Rt(e.prototype,"attachShadow",(function(e){return function(r){const i=e.call(this,r);return this.shadowRoot&&qt(this)&&n.addShadowRoot(this.shadowRoot,t),i}}))}reset(){this.active=!1,this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}function En(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}for(var An="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Tn=0;Tn<An.length;Tn++)kn[An.charCodeAt(Tn)]=Tn;const _n=new Map;const Rn=(e,t,n)=>{if(!e||!xn(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=_n.get(e);return n||(n=new Map,_n.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i};function Mn(e,t,n){if(e instanceof Array)return e.map(e=>Mn(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){return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=An[n[t]>>2],i+=An[(3&n[t])<<4|n[t+1]>>4],i+=An[(15&n[t+1])<<2|n[t+2]>>6],i+=An[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Mn(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}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Mn(e.data,t,n),e.width,e.height]}}if(xn(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Rn(e,t,n)}}return e}const Nn=(e,t,n)=>[...e].map(e=>Mn(e,t,n)),xn=(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 Ln(e,t,n,r){const i=[];try{const o=Rt(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i,...o){if(!Dt(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...o])}}));i.push(o)}catch(e){}return()=>{i.forEach(e=>e())}}function Dn(e,t,n,r,i,o,s){const a=[],c=Object.getOwnPropertyNames(e);for(const o of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(o))try{if("function"!=typeof e[o])continue;const c=Rt(e,o,(function(e){return function(...a){const c=e.apply(this,a);if(Rn(c,s,this),"tagName"in this.canvas&&!Dt(this.canvas,r,i,!0)){const e=Nn([...a],s,this),r={type:t,property:o,args:e};n(this.canvas,r)}return c}}));a.push(c)}catch(r){const i=_t(e,o,{set(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});a.push(i)}return a}function On(e,t,n){var r=void 0===t?null:t,i=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),i=0,o=n.length;i<o;++i)r[i]=n.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),o=i.indexOf("\n",10)+1,s=i.substring(o)+(r?"//# sourceMappingURL="+r:""),a=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(a)}var Pn,Fn,Vn,Un,Wn=(Pn="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",Fn=null,Vn=!1,function(e){return Un=Un||On(Pn,Fn,Vn),new Worker(Un,e)});class Bn{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}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:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(n,r,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,i,{dataURLOptions:s})}initCanvasFPSObserver(e,t,n,r,i){const o=Ln(t,n,r,!0),s=new Map,a=new Wn;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:i,height:o}=e.data;this.mutationCb({id:t,type:$t["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{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=>{Dt(t,n,r,!0)||e.push(t)}),e})().forEach(e=>En(this,void 0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(s.get(n))return;if(s.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)&&n.clear(n.COLOR_BUFFER_BIT)}const r=yield createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[r])})))),l=requestAnimationFrame(d)};l=requestAnimationFrame(d),this.resetObservers=()=>{o(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Ln(e,t,n,!1),i=function(e,t,n,r){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=Rt(t.CanvasRenderingContext2D.prototype,s,(function(i){return function(...o){return Dt(this.canvas,n,r,!0)||setTimeout(()=>{const n=Nn([...o],t,this);e(this.canvas,{type:$t["2D"],property:s,args:n})},0),i.apply(this,o)}}));i.push(o)}catch(n){const r=_t(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:$t["2D"],property:s,args:[t],setter:!0})}});i.push(r)}return()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r,i){const o=[];return o.push(...Dn(t.WebGLRenderingContext.prototype,$t.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&o.push(...Dn(t.WebGL2RenderingContext.prototype,$t.WebGL2,e,n,r,0,t)),()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),i(),o()}}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=>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 i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"])),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}class Hn{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Wt,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:Qe(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 qn{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 Gn(e){return Object.assign(Object.assign({},e),{timestamp:Mt()})}let jn,zn,Zn,$n=!1;const Kn=new Xe;function Yn(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,deferProcessMutations:i=!1,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:d=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:g,maskInputFn:f,maskTextFn:m,hooks:v,packFn:y,sampling:b={},dataURLOptions:I={},mousemoveWait:C,recordCanvas:w=!1,recordCrossOriginIframes:S=!1,recordAfter:E=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:k=!1,inlineImages:T=!1,plugins:_,keepIframeSrcFn:R=(()=>!1),ignoreCSSAttributes:M=new Set([]),errorHandler:N,ignoreIframes:x=!1}=e;rn(N);const L=!S||window.parent===window;let D=!1;if(!L)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(L&&!t)throw new Error("emit function is required");void 0!==C&&void 0===b.mousemove&&(b.mousemove=C),Kn.reset();const O=!0===h?{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,hidden:!0}:void 0!==p?p:{password:!0},P=!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===g,headMetaDescKeywords:"all"===g}:g||{};let F;!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 V=0;const U=e=>{for(const t of _||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!D&&(e=y(e)),e};jn=(e,i)=>{var o;if(!(null===(o=an[0])||void 0===o?void 0:o.isFrozen())||e.type===Gt.FullSnapshot||e.type===Gt.IncrementalSnapshot&&e.data.source===jt.Mutation||an.forEach(e=>e.unfreeze()),L)null==t||t(U(e),i);else if(D){const t={type:"rrweb",event:U(e),origin:window.location.origin,isCheckout:i};window.parent.postMessage(t,"*")}if(e.type===Gt.FullSnapshot)F=e,V=0;else if(e.type===Gt.IncrementalSnapshot){if(e.data.source===jt.Mutation&&e.data.isAttachIframe)return;V++;const t=r&&V>=r,i=n&&e.timestamp-F.timestamp>n;(t||i)&&zn(!0)}};const W=e=>{jn(Gn({type:Gt.IncrementalSnapshot,data:Object.assign({source:jt.Mutation},e)}))},B=e=>jn(Gn({type:Gt.IncrementalSnapshot,data:Object.assign({source:jt.Scroll},e)})),H=e=>jn(Gn({type:Gt.IncrementalSnapshot,data:Object.assign({source:jt.CanvasMutation},e)})),q=new Hn({mutationCb:W,adoptedStyleSheetCb:e=>jn(Gn({type:Gt.IncrementalSnapshot,data:Object.assign({source:jt.AdoptedStyleSheet},e)}))}),G=new wn({mirror:Kn,mutationCb:W,stylesheetManager:q,recordCrossOriginIframes:S,wrappedEmit:jn,ignoreIframes:x});for(const e of _||[])e.getMirror&&e.getMirror({nodeMirror:Kn,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const j=new qn;Zn=new Bn({recordCanvas:w,mutationCb:H,win:window,blockClass:o,blockSelector:s,mirror:Kn,sampling:b.canvas,dataURLOptions:I});const z=new Sn({mutationCb:W,scrollCb:B,bypassOptions:{blockClass:o,blockSelector:s,deferProcessMutations:i,maskTextClass:l,maskTextSelector:u,inlineStylesheet:d,maskInputOptions:O,dataURLOptions:I,maskTextFn:m,maskInputFn:f,recordCanvas:w,inlineImages:T,sampling:b,slimDOMOptions:P,iframeManager:G,stylesheetManager:q,canvasManager:Zn,keepIframeSrcFn:R,processedNodeManager:j},mirror:Kn});zn=(e=!1)=>{jn(Gn({type:Gt.Meta,data:{href:window.location.href,width:Lt(),height:xt()}}),e),q.reset(),z.init(),an.forEach(e=>e.lock());const t=function(e,t){var n,r,i=t||{},o=i.mirror,s=void 0===o?new Xe:o,a=i.blockClass,c=void 0===a?"rr-block":a,l=i.blockSelector,u=void 0===l?null:l,d=i.maskTextClass,h=void 0===d?"rr-mask":d,p=i.maskTextSelector,g=void 0===p?null:p,f=i.inlineStylesheet,m=void 0===f||f,v=i.inlineImages,y=void 0!==v&&v,b=i.recordCanvas,I=void 0!==b&&b,C=i.maskAllInputs,w=void 0!==C&&C,S=i.maskTextFn,E=i.maskInputFn,A=i.slimDOM,k=void 0!==A&&A,T=i.dataURLOptions,_=i.preserveWhiteSpace,R=i.onSerialize,M=i.onIframeLoad,N=i.iframeLoadTimeout,x=i.onStylesheetLoad,L=i.stylesheetLoadTimeout,D=i.keepIframeSrcFn,O=void 0===D?function(){return!1}:D,P=!0===w?{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,hidden:!0}:!1===w?{password:!0}:w,F=!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k;if("string"==typeof h){var V=e.querySelectorAll("."+h);if(n=!1,r=Array.from(V),g){var U=e.querySelectorAll(g);r=r.concat(Array.from(U))}}return St(e,{doc:e,mirror:s,blockClass:c,blockSelector:u,maskTextClass:h,maskTextSelector:g,skipChild:!1,inlineStylesheet:m,maskInputOptions:P,maskTextFn:S,maskInputFn:E,slimDOMOptions:F,dataURLOptions:T,inlineImages:y,recordCanvas:I,preserveWhiteSpace:_,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:N,onStylesheetLoad:x,stylesheetLoadTimeout:L,keepIframeSrcFn:O,newlyAddedElement:!1,maskCurrentNode:n,maskedElements:r})}(document,{mirror:Kn,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:u,inlineStylesheet:d,maskAllInputs:O,maskTextFn:m,maskInputFn:f,slimDOM:P,dataURLOptions:I,recordCanvas:w,inlineImages:T,onSerialize:e=>{Ft(e,Kn)&&G.addIframe(e),Vt(e,Kn)&&q.trackLinkElement(e),Ut(e)&&z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{q.attachLinkElement(e,t)},keepIframeSrcFn:R});t&&(jn(Gn({type:Gt.FullSnapshot,data:{node:t,initialOffset:Nt(window)}}),e),an.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&q.adoptStyleSheets(document.adoptedStyleSheets,Kn.getId(document)))};try{const e=[],t=e=>{var t;return sn(yn)({mutationCb:W,mousemoveCb:(e,t)=>jn(Gn({type:Gt.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>jn(Gn({type:Gt.IncrementalSnapshot,data:Object.assign({source:jt.MouseInteraction},e)})),scrollCb:B,viewportResizeCb:e=>jn(Gn({type:Gt.IncrementalSnapshot,data:Object.assign({source:jt.ViewportResize},e)})),inputCb:e=>jn(Gn({type:Gt.IncrementalSnapshot,data:Object.assign({source:jt.Input},e)})),mediaInteractionCb:e=>jn(Gn({type:Gt.IncrementalSnapshot,data:Object.assign({source:jt.MediaInteraction},e)})),styleSheetRuleCb:e=>jn(Gn({type:Gt.IncrementalSnapshot,data:Object.assign({source:jt.StyleSheetRule},e)})),styleDeclarationCb:e=>jn(Gn({type:Gt.IncrementalSnapshot,data:Object.assign({source:jt.StyleDeclaration},e)})),canvasMutationCb:H,fontCb:e=>jn(Gn({type:Gt.IncrementalSnapshot,data:Object.assign({source:jt.Font},e)})),selectionCb:e=>{jn(Gn({type:Gt.IncrementalSnapshot,data:Object.assign({source:jt.Selection},e)}))},blockClass:o,deferProcessMutations:i,ignoreClass:a,ignoreSelector:c,maskTextClass:l,maskTextSelector:u,maskInputOptions:O,inlineStylesheet:d,sampling:b,recordCanvas:w,inlineImages:T,userTriggeredOnInput:A,collectFonts:k,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:R,blockSelector:s,slimDOMOptions:P,dataURLOptions:I,mirror:Kn,iframeManager:G,stylesheetManager:q,shadowDomManager:z,processedNodeManager:j,canvasManager:Zn,ignoreCSSAttributes:M,plugins:(null===(t=null==_?void 0:_.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>jn(Gn({type:Gt.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},v)};G.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){}});const n=()=>{zn(),e.push(t(document)),$n=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(At("DOMContentLoaded",()=>{jn(Gn({type:Gt.DomContentLoaded,data:{}})),"DOMContentLoaded"===E&&n()})),e.push(At("load",()=>{jn(Gn({type:Gt.Load,data:{}})),"load"===E&&n()},window))),()=>{e.forEach(e=>e()),j.destroy(),$n=!1,on()}}catch(e){}}Yn.addCustomEvent=(e,t)=>{if(!$n)throw new Error("please add custom event after start recording");jn(Gn({type:Gt.Custom,data:{tag:e,payload:t}}))},Yn.freezePage=()=>{an.forEach(e=>e.freeze())},Yn.takeFullSnapshot=e=>{if(!$n)throw new Error("please take full snapshot after start recording");zn(e)},Yn.mirror=Kn;const{addCustomEvent:Jn}=Yn,{freezePage:Qn}=Yn;var Xn=Uint8Array,er=Uint16Array,tr=Uint32Array,nr=new Xn([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]),rr=new Xn([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]),ir=new Xn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),or=function(e,t){for(var n=new er(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new tr(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},sr=or(nr,2),ar=sr[0],cr=sr[1];ar[28]=258,cr[258]=28;for(var lr=or(rr,0),ur=(lr[0],lr[1]),dr=new er(32768),hr=0;hr<32768;++hr){var pr=(43690&hr)>>>1|(21845&hr)<<1;pr=(61680&(pr=(52428&pr)>>>2|(13107&pr)<<2))>>>4|(3855&pr)<<4,dr[hr]=((65280&pr)>>>8|(255&pr)<<8)>>>1}var gr=function(e,t,n){for(var r=e.length,i=0,o=new er(t);i<r;++i)++o[e[i]-1];var s,a=new er(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new er(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)s[dr[d]>>>c]=l}else for(s=new er(r),i=0;i<r;++i)s[i]=dr[a[e[i]-1]++]>>>15-e[i];return s},fr=new Xn(288);for(hr=0;hr<144;++hr)fr[hr]=8;for(hr=144;hr<256;++hr)fr[hr]=9;for(hr=256;hr<280;++hr)fr[hr]=7;for(hr=280;hr<288;++hr)fr[hr]=8;var mr=new Xn(32);for(hr=0;hr<32;++hr)mr[hr]=5;var vr=gr(fr,9,0),yr=gr(mr,5,0),br=function(e){return(e/8>>0)+(7&e&&1)},Ir=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof er?er:e instanceof tr?tr:Xn)(n-t);return r.set(e.subarray(t,n)),r},Cr=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},wr=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Sr=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new Xn(0),0];if(1==i){var s=new Xn(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=i-1;)a=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:a.f+c.f,l:a,r:c};var h=o[0].s;for(r=1;r<i;++r)o[r].s>h&&(h=o[r].s);var p=new er(h+1),g=Er(n[u-1],p,0);if(g>t){r=0;var f=0,m=g-t,v=1<<m;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var y=o[r].s;if(!(p[y]>t))break;f+=v-(1<<g-p[y]),p[y]=t}for(f>>>=m;f>0;){var b=o[r].s;p[b]<t?f-=1<<t-p[b]++-1:++r}for(;r>=0&&f;--r){var I=o[r].s;p[I]==t&&(--p[I],++f)}g=t}return[new Xn(p),g]},Er=function(e,t,n){return-1==e.s?Math.max(Er(e.l,t,n+1),Er(e.r,t,n+1)):t[e.s]=n},Ar=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new er(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},kr=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Tr=function(e,t,n){var r=n.length,i=br(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},_r=function(e,t,n,r,i,o,s,a,c,l,u){Cr(t,u++,n),++i[256];for(var d=Sr(i,15),h=d[0],p=d[1],g=Sr(o,15),f=g[0],m=g[1],v=Ar(h),y=v[0],b=v[1],I=Ar(f),C=I[0],w=I[1],S=new er(19),E=0;E<y.length;++E)S[31&y[E]]++;for(E=0;E<C.length;++E)S[31&C[E]]++;for(var A=Sr(S,7),k=A[0],T=A[1],_=19;_>4&&!k[ir[_-1]];--_);var R,M,N,x,L=l+5<<3,D=kr(i,fr)+kr(o,mr)+s,O=kr(i,h)+kr(o,f)+s+14+3*_+kr(S,k)+(2*S[16]+3*S[17]+7*S[18]);if(L<=D&&L<=O)return Tr(t,u,e.subarray(c,c+l));if(Cr(t,u,1+(O<D)),u+=2,O<D){R=gr(h,p,0),M=h,N=gr(f,m,0),x=f;var P=gr(k,T,0);Cr(t,u,b-257),Cr(t,u+5,w-1),Cr(t,u+10,_-4),u+=14;for(E=0;E<_;++E)Cr(t,u+3*E,k[ir[E]]);u+=3*_;for(var F=[y,C],V=0;V<2;++V){var U=F[V];for(E=0;E<U.length;++E){var W=31&U[E];Cr(t,u,P[W]),u+=k[W],W>15&&(Cr(t,u,U[E]>>>5&127),u+=U[E]>>>12)}}}else R=vr,M=fr,N=yr,x=mr;for(E=0;E<a;++E)if(r[E]>255){W=r[E]>>>18&31;wr(t,u,R[W+257]),u+=M[W+257],W>7&&(Cr(t,u,r[E]>>>23&31),u+=nr[W]);var B=31&r[E];wr(t,u,N[B]),u+=x[B],B>3&&(wr(t,u,r[E]>>>5&8191),u+=rr[B])}else wr(t,u,R[r[E]]),u+=M[r[E]];return wr(t,u,R[256]),u+M[256]},Rr=new tr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Mr=new Xn(0),Nr=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new Xn(r+s+5*(1+Math.floor(s/7e3))+i),c=a.subarray(r,a.length-i),l=0;if(!t||s<8)for(var u=0;u<=s;u+=65535){var d=u+65535;d<s?l=Tr(c,l,e.subarray(u,d)):(c[u]=o,l=Tr(c,l,e.subarray(u,s)))}else{for(var h=Rr[t-1],p=h>>>13,g=8191&h,f=(1<<n)-1,m=new er(32768),v=new er(f+1),y=Math.ceil(n/3),b=2*y,I=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&f},C=new tr(25e3),w=new er(288),S=new er(32),E=0,A=0,k=(u=0,0),T=0,_=0;u<s;++u){var R=I(u),M=32767&u,N=v[R];if(m[M]=N,v[R]=M,T<=u){var x=s-u;if((E>7e3||k>24576)&&x>423){l=_r(e,c,0,C,w,S,A,k,_,u-_,l),k=E=A=0,_=u;for(var L=0;L<286;++L)w[L]=0;for(L=0;L<30;++L)S[L]=0}var D=2,O=0,P=g,F=M-N&32767;if(x>2&&R==I(u-F))for(var V=Math.min(p,x)-1,U=Math.min(32767,u),W=Math.min(258,x);F<=U&&--P&&M!=N;){if(e[u+D]==e[u+D-F]){for(var B=0;B<W&&e[u+B]==e[u+B-F];++B);if(B>D){if(D=B,O=F,B>V)break;var H=Math.min(F,B-2),q=0;for(L=0;L<H;++L){var G=u-F+L+32768&32767,j=G-m[G]+32768&32767;j>q&&(q=j,N=G)}}}F+=(M=N)-(N=m[M])+32768&32767}if(O){C[k++]=268435456|cr[D]<<18|ur[O];var z=31&cr[D],Z=31&ur[O];A+=nr[z]+rr[Z],++w[257+z],++S[Z],T=u+D,++E}else C[k++]=e[u],++w[e[u]]}}l=_r(e,c,o,C,w,S,A,k,_,u-_,l),o||(l=Tr(c,l,Mr))}return Ir(a,0,r+br(l)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)};function xr(e,t){void 0===t&&(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,o=n.length,s=0;s!=o;){for(var a=Math.min(s+5552,o);s<a;++s)i+=r+=n[s];r%=65521,i%=65521}e=r,t=i},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();n.p(e);var r=Nr(e,t,2,4);return function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)}(r,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(r,r.length-4,n.d()),r}const Lr=(e,t)=>{const n=Object.assign(Object.assign({},e),{v:"v1"});return function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}return n}(xr(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Xn(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new Xn(i+8+(n-s<<1));a.set(r),r=a}var c=e.charCodeAt(s);c<128||t?o(c):c<2048?(o(192|c>>>6),o(128|63&c)):c>55295&&c<57344?(o(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++s))>>>18),o(128|c>>>12&63),o(128|c>>>6&63),o(128|63&c)):(o(224|c>>>12),o(128|c>>>6&63),o(128|63&c))}return Ir(r,0,i)}(JSON.stringify(n)),t),!0)};var Dr,Or,Pr,Fr=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Vr=function(e){if("loading"===document.readyState)return"loading";var t=Fr();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},Ur=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Wr=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:Ur(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},Br=-1,Hr=function(){return Br},qr=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Br=t.timeStamp,e(t))}),!0)},Gr=function(){var e=Fr();return e&&e.activationStart||0},jr=function(e,t){var n=Fr(),r="navigate";return Hr()>=0?r="back-forward-cache":n&&(document.prerendering||Gr()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},zr=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},Zr=function(e,t,n,r){var i,o;return function(s){t.value>=0&&(s||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},$r=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Kr=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Yr=function(e){var t=!1;return function(){t||(e(),t=!0)}},Jr=-1,Qr=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Xr=function(e){"hidden"===document.visibilityState&&Jr>-1&&(Jr="visibilitychange"===e.type?e.timeStamp:0,ti())},ei=function(){addEventListener("visibilitychange",Xr,!0),addEventListener("prerenderingchange",Xr,!0)},ti=function(){removeEventListener("visibilitychange",Xr,!0),removeEventListener("prerenderingchange",Xr,!0)},ni=function(){return Jr<0&&(Jr=Qr(),ei(),qr((function(){setTimeout((function(){Jr=Qr(),ei()}),0)}))),{get firstHiddenTime(){return Jr}}},ri=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},ii=[1800,3e3],oi=function(e,t){t=t||{},ri((function(){var n,r=ni(),i=jr("FCP"),o=zr("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Gr(),0),i.entries.push(e),n(!0)))}))}));o&&(n=Zr(e,i,ii,t.reportAllChanges),qr((function(r){i=jr("FCP"),n=Zr(e,i,ii,t.reportAllChanges),$r((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},si=[.1,.25],ai=function(e,t){!function(e,t){t=t||{},oi(Yr((function(){var n,r=jr("CLS",0),i=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,n())},a=zr("layout-shift",s);a&&(n=Zr(e,r,si,t.reportAllChanges),Kr((function(){s(a.takeRecords()),n(!0)})),qr((function(){i=0,r=jr("CLS",0),n=Zr(e,r,si,t.reportAllChanges),$r((function(){return n()}))})),setTimeout(n,0))})))}((function(t){var n=function(e){var t,n={};if(e.entries.length){var r=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(r&&r.sources&&r.sources.length){var i=(t=r.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];i&&(n={largestShiftTarget:Wr(i.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:i,largestShiftEntry:r,loadState:Vr(r.startTime)})}}return Object.assign(e,{attribution:n})}(t);e(n)}),t)},ci=function(e,t){oi((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Vr(Hr())};if(e.entries.length){var n=Fr(),r=e.entries[e.entries.length-1];if(n){var i=n.activationStart||0,o=Math.max(0,n.responseStart-i);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:Vr(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)},li=0,ui=1/0,di=0,hi=function(e){e.forEach((function(e){e.interactionId&&(ui=Math.min(ui,e.interactionId),di=Math.max(di,e.interactionId),li=di?(di-ui)/7+1:0)}))},pi=function(){"interactionCount"in performance||Dr||(Dr=zr("event",hi,{type:"event",buffered:!0,durationThreshold:0}))},gi=[],fi=new Map,mi=0,vi=function(){return(Dr?li:performance.interactionCount||0)-mi},yi=[],bi=function(e){if(yi.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=gi[gi.length-1],n=fi.get(e.interactionId);if(n||gi.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};fi.set(r.id,r),gi.push(r)}gi.sort((function(e,t){return t.latency-e.latency})),gi.length>10&&gi.splice(10).forEach((function(e){return fi.delete(e.id)}))}}},Ii=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Yr(e),"hidden"===document.visibilityState?e():(n=t(e),Kr(e)),n},Ci=[200,500],wi=[],Si=new Map,Ei=[],Ai=new WeakMap,ki=new Map,Ti=-1,_i=function(e){wi=wi.concat(e),Ri()},Ri=function(){Ti<0&&(Ti=Ii(Mi))},Mi=function(){ki.size>10&&ki.forEach((function(e,t){fi.has(t)||ki.delete(t)})),Ei=Ei.slice(-50);var e=new Set(Ei.concat(gi.map((function(e){return Ai.get(e.entries[0])}))));Si.forEach((function(t,n){e.has(n)||Si.delete(n)}));var t=new Set;Si.forEach((function(e){Oi(e.startTime,e.processingEnd).forEach((function(e){t.add(e)}))}));for(var n=0;n<50;n++){var r=wi[wi.length-1-n];if(!r||r.startTime<Pr)break;t.add(r)}wi=Array.from(t),Ti=-1};yi.push((function(e){e.interactionId&&e.target&&!ki.has(e.interactionId)&&ki.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;Pr=Math.max(Pr,e.processingEnd);for(var r=Ei.length-1;r>=0;r--)if(t=Ei[r],Math.abs(n-t)<=8){var i=Si.get(t);i.startTime=Math.min(e.startTime,i.startTime),i.processingStart=Math.min(e.processingStart,i.processingStart),i.processingEnd=Math.max(e.processingEnd,i.processingEnd),i.entries.push(e),n=t;break}n!==t&&(Ei.push(n),Si.set(n,{startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,entries:[e]})),(e.interactionId||"first-input"===e.entryType)&&Ai.set(e,n),Ri()}));var Ni,xi,Li,Di,Oi=function(e,t){for(var n,r=[],i=0;n=wi[i];i++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r},Pi=function(e,t){Or||(Or=zr("long-animation-frame",_i)),function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},ri((function(){var n;pi();var r,i=jr("INP"),o=function(e){Ii((function(){e.forEach(bi);var t,n=(t=Math.min(gi.length-1,Math.floor(vi()/50)),gi[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())}))},s=zr("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=Zr(e,i,Ci,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Kr((function(){o(s.takeRecords()),r(!0)})),qr((function(){mi=0,gi.length=0,fi.clear(),i=jr("INP"),r=Zr(e,i,Ci,t.reportAllChanges)})))})))}((function(t){var n=function(e){var t=e.entries[0],n=Ai.get(t),r=Si.get(n),i=t.processingStart,o=r.processingEnd,s=r.entries.sort((function(e,t){return e.processingStart-t.processingStart})),a=Oi(t.startTime,o),c=e.entries.find((function(e){return e.target})),l=c&&c.target||ki.get(t.interactionId),u=[t.startTime+t.duration,o].concat(a.map((function(e){return e.startTime+e.duration}))),d=Math.max.apply(Math,u),h={interactionTarget:Wr(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:d,processedEventEntries:s,longAnimationFrameEntries:a,inputDelay:i-t.startTime,processingDuration:o-i,presentationDelay:Math.max(d-o,0),loadState:Vr(t.startTime)};return Object.assign(e,{attribution:h})}(t);e(n)}),t)},Fi=[2500,4e3],Vi={},Ui=function(e,t){!function(e,t){t=t||{},ri((function(){var n,r=ni(),i=jr("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Gr(),0),i.entries=[e],n())}))},s=zr("largest-contentful-paint",o);if(s){n=Zr(e,i,Fi,t.reportAllChanges);var a=Yr((function(){Vi[i.id]||(o(s.takeRecords()),s.disconnect(),Vi[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Ii(a)}),!0)})),Kr(a),qr((function(r){i=jr("LCP"),n=Zr(e,i,Fi,t.reportAllChanges),$r((function(){i.value=performance.now()-r.timeStamp,Vi[i.id]=!0,n(!0)}))}))}}))}((function(t){var n=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n=Fr();if(n){var r=n.activationStart||0,i=e.entries[e.entries.length-1],o=i.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===i.url}))[0],s=Math.max(0,n.responseStart-r),a=Math.max(s,o?(o.requestStart||o.startTime)-r:0),c=Math.max(a,o?o.responseEnd-r:0),l=Math.max(c,i.startTime-r);t={element:Wr(i.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:c-a,elementRenderDelay:l-c,navigationEntry:n,lcpEntry:i},i.url&&(t.url=i.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)},Wi=[800,1800],Bi=function(e,t){t=t||{};var n=jr("TTFB"),r=Zr(e,n,Wi,t.reportAllChanges);!function e(t){document.prerendering?ri((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)}((function(){var i=Fr();i&&(n.value=Math.max(i.responseStart-Gr(),0),n.entries=[i],r(!0),qr((function(){n=jr("TTFB",0),(r=Zr(e,n,Wi,t.reportAllChanges))(!0)})))}))},Hi=function(e,t){Bi((function(t){var n=function(e){var t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){var n=e.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),o=Math.max(n.domainLookupStart-r,0),s=Math.max(n.connectStart-r,0),a=Math.max(n.connectEnd-r,0);t={waitingDuration:i,cacheDuration:o-i,dnsDuration:s-o,connectionDuration:a-s,requestDuration:e.value-a,navigationEntry:n}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)},qi={passive:!0,capture:!0},Gi=new Date,ji=function(e,t){Ni||(Ni=t,xi=e,Li=new Date,$i(removeEventListener),zi())},zi=function(){if(xi>=0&&xi<Li-Gi){var e={entryType:"first-input",name:Ni.type,target:Ni.target,cancelable:Ni.cancelable,startTime:Ni.timeStamp,processingStart:Ni.timeStamp+xi};Di.forEach((function(t){t(e)})),Di=[]}},Zi=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){ji(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,qi),removeEventListener("pointercancel",r,qi)};addEventListener("pointerup",n,qi),addEventListener("pointercancel",r,qi)}(t,e):ji(t,e)}},$i=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,Zi,qi)}))},Ki=[100,300],Yi=function(e,t){!function(e,t){t=t||{},ri((function(){var n,r=ni(),i=jr("FID"),o=function(e){e.startTime<r.firstHiddenTime&&(i.value=e.processingStart-e.startTime,i.entries.push(e),n(!0))},s=function(e){e.forEach(o)},a=zr("first-input",s);n=Zr(e,i,Ki,t.reportAllChanges),a&&(Kr(Yr((function(){s(a.takeRecords()),a.disconnect()}))),qr((function(){var r;i=jr("FID"),n=Zr(e,i,Ki,t.reportAllChanges),Di=[],xi=-1,Ni=null,$i(addEventListener),r=o,Di.push(r),zi()})))}))}((function(t){var n=function(e){var t=e.entries[0],n={eventTarget:Wr(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:Vr(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)}),t)},Ji=n(181),Qi=n.n(Ji);const Xi=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"<unknown>",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]};function eo(e,t,n,r){const i={file:e,mname:t};return void 0!==n&&(i.line=n),void 0!==r&&(i.column=r),i}const to=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,no=/\((\S*)(?::(\d+))(?::(\d+))\)/,ro=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,io=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,oo=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,so=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,ao=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i;function co(e,t=!1){const n=e.split("\n");return n.length>50?[]:n.reduce((function(e,n,r){if(n.length>1024)return e;const i=(e=>{const t=so.exec(e);return t?eo(t[2],t[3]||"<unknown>",+t[1]):void 0})(n)||(e=>{const t=ao.exec(e);return t?eo(t[5],t[3]||t[4]||"<unknown>",+t[1],+t[2]):void 0})(n)||(e=>{const t=to.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=no.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=Xi(t[1]||"<unknown>",t[2]);return eo(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}})(n)||(e=>{const t=oo.exec(e);return t?eo(t[2],t[1]||"<unknown>",+t[3],t[4]?+t[4]:void 0):void 0})(n)||(e=>{const t=ro.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=io.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||"<unknown>";return[n,e]=Xi(n,e),eo(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}})(n);return i&&(t?e.push(Object.assign(Object.assign({},i),{_frameLocationIndexInOrigString:r})):e.push(i)),e}),[])}let lo,uo,ho=null,po=null,go=!1;function fo(){mo(),po&&(window.clearTimeout(po),po=null),go&&(go=!1,document.removeEventListener("readystatechange",bo))}function mo(){ho&&(window.clearTimeout(ho),ho=null)}function vo(){fo(),uo(!1)}function yo(){fo(),uo(!0)}function bo(){switch(document.readyState){case"complete":fo(),uo(!0);break;case"interactive":mo(),po=window.setTimeout(yo,3e3);break;case"loading":ho=window.setTimeout(vo,5e3);break;default:fo(),uo(!1)}}function Io(){return"undefined"==typeof window?Promise.resolve(!0):(!lo&&window.NOIBUJS_DOCUMENT_READY_PROMISE instanceof Promise&&(lo=window.NOIBUJS_DOCUMENT_READY_PROMISE),lo||(lo=new Promise(e=>{uo=e,"complete"!==document.readyState&&(go=!0,document.addEventListener("readystatechange",bo)),bo()}),window.NOIBUJS_DOCUMENT_READY_PROMISE=lo,lo))}const Co=(e,t,n)=>{if(!e||!(t in e))return;const r=e[t];if(null==r?void 0:r.__noibu_wrapped__)return;const i=Object.getOwnPropertyDescriptor(e,t);let o=null==i?void 0:i.writable;const s=null==i?void 0:i.configurable,a=!!(null==i?void 0:i.get);function c(e){const r=n(e);if("function"==typeof r)try{r.prototype=r.prototype||{},Object.defineProperties(r,{__noibu__:{enumerable:!1,value:!0},__noibu_original__:Object.assign(Object.assign({},i),{enumerable:!1}),__noibu_wrapped__:{enumerable:!1,value:r}})}catch(e){}i.set?i.set.call(this,r):o&&(this[t]=r)}if(o||s){if(s&&a){const r=Object.assign({},i);return i.set&&(r.set=function(e){c.call(this,e)}),Object.defineProperty(e,t,Object.assign(Object.assign({},r),{get(){const e=i.get.call(this);return n(e)}})),!0}return o||(Object.defineProperty(e,t,Object.assign(Object.assign({},i),{writable:!0})),o=!0),c.call(e,r),!0}};const wo=e=>{if(!function(e){if(!e)return!1;try{return"function"==typeof e[Symbol.iterator]}catch(e){return!1}}(e))return{};const t={};try{for(const[n,r]of e)t[n]=r}catch(e){}return t};function So(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(e,t,{set(e){r.set.call(this,n(e))}})}function Eo(e){return e&&e.__noibu_original__||e}function Ao(e,t=1024){return"string"!=typeof e?"":e.length<t?e:e.substring(0,t)}function ko(e,t=1){try{return co(e).length>t}catch(e){return!1}}function To(e){if(!e)return"";return function(e){if(ko(e)){const t=co(e,!0),n=e.split("\n"),r=Object.fromEntries(t.map(e=>[e._frameLocationIndexInOrigString,!0]));return n.filter((e,t)=>!r[t]).join("\n")}return e}(Ao(e)).replace(S,"$1$2$3'*'").replace(I,"******")}function _o(e){return Ho(e)?new URL(e).host:""}function Ro(e,t){const n=new URL(e);Object.assign(n,t);let r=n.toString();return t.protocol&&t.protocol!==n.protocol&&(r=`${t.protocol}:${r.slice(n.protocol.length)}`),r}function Mo(){var e,t,n,r,i;let o=null===(e=self.location)||void 0===e?void 0:e.href;return o?(!o.startsWith("http")&&(null===(i=null===(r=null===(n=null===(t=self.parent)||void 0===t?void 0:t.location)||void 0===n?void 0:n.href)||void 0===r?void 0:r.startsWith)||void 0===i?void 0:i.call(r,"http"))&&(o=self.parent.location.href),Ao(o)):""}function No(e){return e.map(e=>{const t={line:"_",mname:"_",file:"_"};return e.line&&Number.isInteger(e.line)&&(t.line=String(e.line)),e.mname&&"<unknown>"!==e.mname&&(t.mname=String(e.mname)),e.file&&"<unknown>"!==e.file&&(t.file=String(e.file)),e.column&&Number.isInteger(e.column)&&(t.column=e.column),t})}function xo(e,t=!0){let n=[{line:"_",mname:"_",file:"_"}];if("object"!=typeof e||!e)return{frames:n,msg:""};const r=e;if(r.stack)n=No(co(r.stack));else{const t=e;t.fileName&&"string"==typeof t.fileName&&(n[0].file=t.fileName),t.lineNumber&&(n[0].line=String(t.lineNumber)),t.columnNumber&&Number.isInteger(t.columnNumber)&&(n[0].column=t.columnNumber)}n.length>=50&&(n=n.slice(0,50));const i={frames:(o=n,o?o.filter(e=>!e.mname.toLowerCase().includes("nbuwrapper")):[]),msg:To(r.message)};var o;return e.cause&&(i.cause=function(e){if(!Array.isArray(e))return[];const t=e.filter(e=>[D,O,L,x,N,P].every(t=>"string"==typeof e[t]));return t.length?t:[]}(e.cause)),t&&i.cause&&delete i.cause,i}function Lo(e){let t="";try{e&&e.stack&&(t=`(stack: ${e.stack})`)}catch(e){}return t}function Do(e){const t=[];try{const n=JSON.stringify(e,(function(e,n){try{if("object"!=typeof n||null===n)return n;if("undefined"!=typeof Node&&n instanceof Node)return{};for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?{}:(t.push(n),n)}catch(e){return{}}}));return void 0===n?"null":n}catch(e){return"{}"}}function Oo(e){if(Array.prototype.toJSON){const t=Array.prototype.toJSON;delete Array.prototype.toJSON;const n=Do(e);return Array.prototype.toJSON=t,n}return Do(e)}function Po(e){const t=e;if(t.className){const n=typeof t.className;if("string"===n)return t.className;if("object"===n&&"baseVal"in e.className)return e.className.baseVal}return""}function Fo(e){return"string"==typeof e.id?e.id:""}function Vo(e){return e?"object"==typeof e?Oo(e):String(e):""}function Uo(e,t,n,r=!1,i=0){const o=Eo(self.fetch);if(!o)return Promise.resolve();const s={method:"POST",headers:n,body:Vo(t),keepalive:r};let a=0;const c="function"==typeof AbortController;if(i&&c){const e=new AbortController;s.signal=e.signal,a=self.setTimeout(()=>e.abort(),i)}const l=o(e,s);return a&&l.finally(()=>self.clearTimeout(a)),l}function Wo(){const e=le();return function(){const e=le();return e.http_re&&Array.isArray(e.http_re)}()?e.http_re:[]}function Bo(){const e=le(),t=[".noibu-blocked",".creditCard"];return function(){const e=le();return e.sel&&Array.isArray(e.sel)}()&&t.push(...e.sel),""+t.join(",")}function Ho(e=""){if("function"==typeof URL.canParse)return URL.canParse(e);try{return new URL(e),!0}catch(e){return!1}}function qo(){return function(e){let t=e;return t||(t=self.navigator.userAgent),"string"==typeof t&&(t=t.toLowerCase(),new RegExp("(bot|crawl(er)?|sp(i|y)der|search|worm|fetch|nutch|headless|baidu|teoma|yandex|woorankreview|pingdom|synthetic|dataprovider|qaautomation|morningscore|wappalyzer|foregenix|StatusCake|SpeedCurve|Outlook-iOS|bitdiscovery|testing|webflow|bingpreview|(r|R)igor|facebookexternalhit/\\d+\\.\\d+)","i").test(t))}(null)}function Go(e){return"string"!=typeof e?"":e.trim()}function jo(e,t=!1){let n=Mo();if(t&&!Ho(e))n=Ro(n,{pathname:e});else{const t=Go(e);t&&"undefined"!==t&&(n=e)}return Ao(n)}function zo(e,t){try{return"function"==typeof t&&e instanceof t}catch(e){return!1}}function Zo(e){return"string"==typeof e||e instanceof String}function $o(e,t,n){Io().then(()=>{try{const r=document.createElement("script");r.setAttribute("src",e),r.setAttribute("async","true"),"function"==typeof n&&(r.onerror=n),"function"==typeof t&&(r.onload=t),setTimeout(()=>{document.body.appendChild(r)})}catch(e){n(e)}})}function Ko(){return"object"==typeof window}class Yo{constructor(e){this._provider=e}static isAvailable(e){let t=!0,n=null;try{const t=e();if(!t||!t.setItem||!t.removeItem)return{result:!1,error:"provider is nullish"};t.setItem("n_key",0),t.removeItem("n_key")}catch(e){t=!1,n=e}return{result:t,error:n}}load(e){return this._provider.getItem(e)}loadWithExpiry(e){const t=this.load(e);if(!t)return null;const n=JSON.parse(t);return Date.now()>n.expiry?(this.remove(e),null):n.value}updateExpiry(e,t){const n=this.load(e);if(!n)return;const r=JSON.parse(n);r.expiry=Date.now()+t,this.save(e,JSON.stringify(r))}save(e,t){this._provider.setItem(e,t)}saveWithExpiry(e,t,n){const r={value:t,expiry:Date.now()+n};this.save(e,Oo(r))}remove(e){this._provider.removeItem(e)}calculateUsedSize(){let e=0;for(let t=0;t<this._provider.length;t++){const n=this._provider.key(t);if(n){e+=n.length;const t=this._provider.getItem(n);t&&(e+=t.length)}}return e}}class Jo extends Yo{constructor(){super(window.localStorage)}static isAvailable(){return Yo.isAvailable(()=>window.localStorage)}}class Qo extends Yo{constructor(){super(window.sessionStorage)}static isAvailable(){return Yo.isAvailable(()=>window.sessionStorage)}}class Xo{constructor(){const e=Jo.isAvailable(),t=Qo.isAvailable();this._isLocalStorageAvailable=e.result,this._isSessionStorageAvailable=t.result,this._localStorageError=e.error,this._sessionStorageError=t.error,this._provider=null,this._type="unavailable",this._isLocalStorageAvailable?(this._provider=new Jo,this._type="LocalStorage"):this._isSessionStorageAvailable&&(this._provider=new Qo,this._type="SessionStorage")}static getInstance(){return this._instance||(this._instance=new Xo),this._instance}isAvailable(){return null!=this._provider}load(e){return this.isAvailable()?this._provider.load(e):null}loadWithExpiry(e){return this.isAvailable()?this._provider.loadWithExpiry(e):null}save(e,t){this.isAvailable()&&this._provider.save(e,t)}saveWithExpiry(e,t,n){this.isAvailable()&&this._provider.saveWithExpiry(e,t,n)}updateExpiry(e,t){this.isAvailable()&&this._provider.updateExpiry(e,t)}remove(e){this.isAvailable()&&this._provider.remove(e)}calculateUsedSize(){return this.isAvailable()?this._provider.calculateUsedSize():0}getDiagnoseInfo(){return{storageProvider:this._type,localStorageAvailable:this._isLocalStorageAvailable,localStorageError:this._localStorageError,sessionStorageAvailable:this._isSessionStorageAvailable,sessionStorageError:this._sessionStorageError,storageUsedSize:this.calculateUsedSize()}}}class es{static get scriptInitializeTime(){return this._scriptInitializeTime}static get recordingStartTime(){return this._recordingStartTime}static get recordingStopTime(){return this._recordingStopTime}static setScriptInitializeTime(){null===this._scriptInitializeTime&&(this._scriptInitializeTime=performance.now())}static setRecordingStartTime(){null===this._recordingStartTime&&(this._recordingStartTime=performance.now())}static setRecordingStopTime(){null===this._recordingStopTime&&(this._recordingStopTime=performance.now())}}function ts(){return!("now"in Date)||("number"!=typeof Date.now()||(!("toISOString"in new Date)||"string"!=typeof(new Date).toISOString()))}function ns(e){if("number"!=typeof e&&ts()){if(Date.prototype.hasOwnProperty("valueOf")&&"function"==typeof e.valueOf&&"number"==typeof e.valueOf())return e.valueOf();os.getInstance().postNoibuErrorAndOptionallyDisableClient("The date object has been overwritten and can't be processed properly.\nClient has been disabled.",!0,E,!0)}return e}function rs(e,t){const n=Date.now()-t;return e<new Date(n)}function is(e){return!(e instanceof Date)||isNaN(e.getTime())}es._scriptInitializeTime=null,es._recordingStartTime=null,es._recordingStopTime=null;class os{static configureInstance(e){this.instance||(es.setScriptInitializeTime(),this.instance=new os(e))}static getInstance(){if(!this.instance)throw new Error("ClientConfig was not configured.");return this.instance}constructor(e){this.inactiveThresholdTime=174e4,this.pvCountResetTime=27e5,this.pvCountOveruseLockTime=27e5,this.pvCountLimit=300,this.collectErrorLimit=50,this.storage=Xo.getInstance(),this.pvId=Ze()(),this.isBeta=Pe(),this.scriptId=Fe(),this.deviceEnvironment="browser",this.config=null,this.isStorageAvailable=!0,this.collectErrorCount=0,this.initialPageVisitSequence=0,this.collectErrorUrl=e;try{this.initialize()}catch(e){const t="ClientConfig initialization failed. "+e;this.collectError(t,a.ERROR,!1)}Ko()&&ss(window.document,"visibilitychange",()=>{"visible"===window.document.visibilityState&&this.initialize()})}initialize(){const e=null===this.config;this.restoreConfig();const t=this.config;if(this.isStorageAvailable){if(t.DisabledStatus)if(null===t.ClientUnlockTime)t.DisabledStatus=!1;else{new Date>t.ClientUnlockTime&&(t.DisabledStatus=!1,t.ClientUnlockTime=null)}else t.ClientUnlockTime=null;if(!t.DisabledStatus){if(e){rs(t.LastActive,this.pvCountResetTime)&&(t.CurrentPageVisitCount=0),t.CurrentPageVisitCount+=1,this.initialPageVisitSequence=t.CurrentPageVisitCount-1}t.LastActive=new Date}this.saveConfig(),this.lockClientIfPageVisitCountOverused()}else t.DisabledStatus=!0}restoreConfig(){let e=null;try{e=this.storage.load("n_browser_data")}catch(e){this.isStorageAvailable=!1}let t={};if(null!==e)try{t=JSON.parse(e)}catch(e){}"string"!=typeof t.BrowserId&&(t.BrowserId=Ze()()),"number"!=typeof t.CurrentPageVisitCount&&(t.CurrentPageVisitCount=0),"boolean"!=typeof t.DisabledStatus&&(t.DisabledStatus=!1),"string"==typeof t.LastActive&&(t.LastActive=new Date(t.LastActive)),is(t.LastActive)&&(t.LastActive=new Date),null!==t.ClientUnlockTime&&("string"==typeof t.ClientUnlockTime&&(t.ClientUnlockTime=new Date(t.ClientUnlockTime)),is(t.ClientUnlockTime)&&(t.ClientUnlockTime=null)),this.config=t}saveConfig(){if(this.isStorageAvailable)try{const e=Oo(this.config);this.storage.save("n_browser_data",e)}catch(e){this.config.DisabledStatus=!0,this.isStorageAvailable=!1}}get browserId(){return this.config.BrowserId}get pageVisitId(){return this.pvId}get pageVisitSequence(){return this.initialPageVisitSequence}get lastActiveTime(){return this.config.LastActive}get isDisabled(){return this.config.DisabledStatus}get isInactive(){return rs(this.config.LastActive,this.inactiveThresholdTime)}postNoibuErrorAndOptionallyDisableClient(e,t,n,r=!1,i=!1){if(!this.config.DisabledStatus||i){if(t&&(this.config.DisabledStatus=!0,this.saveConfig()),this.collectErrorCount+=1,this.collectErrorCount>this.collectErrorLimit)return e="Shutting collect off (reached the limit of collect errors).",void this.lockClient(10,e);this.collectError(e,n,r)}}updateLastActiveTime(e=new Date){this.config.LastActive=e,this.saveConfig()}lockClient(e,t){const n=new Date;n.setMinutes(n.getMinutes()+e),this.config.DisabledStatus=!0,this.config.ClientUnlockTime=n,this.saveConfig(),this.collectError(t,E,!1)}lockClientUntilNextPage(e){if(this.config.DisabledStatus)return;this.config.DisabledStatus=!0,this.saveConfig();const t=this.isBeta?E:A;this.collectError(e,t,!1)}lockClientIfPageVisitCountOverused(){if(this.config.CurrentPageVisitCount<this.pvCountLimit)return;this.config.CurrentPageVisitCount=0;const e=this.pvCountOveruseLockTime/1e3/60;this.lockClient(e,"Hit max page visits, disabling client.")}collectError(e,t,n){var r;if(t!==E)return;const i={browserId:(null===(r=this.config)||void 0===r?void 0:r.BrowserId)||Ze()(),pageVisitId:this.pvId,scriptId:this.scriptId,deviceEnv:this.deviceEnvironment,ua:self.navigator.userAgent||"",error:e},o={url:Mo(),err_msg:i,sev:t},{collectErrorUrl:s}=this;Uo(s,o,{"content-type":"application/json"},n,2e3).catch(()=>{})}}function ss(e,t,n,r){if(!e||!t||!n)return;const i=e=>{try{n(e)}catch(e){os.getInstance().postNoibuErrorAndOptionallyDisableClient("addEventListener callback error: "+e.message,!1,E)}},o=n=>{if(n instanceof TypeError){if((()=>{if(!Reflect)return!1;try{Reflect.get(e,"addEventListener")(t,i,r)}catch(e){return!1}return!0})())return;if(!e.addEventListener)return void os.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in addSafeEventListener: '${e.addEventListener}' is supposed to be a function. ${n}`,!1,E)}os.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in addSafeEventListener: "+n,!1,E)};try{e.addEventListener(t,i,r)}catch(e){o(e)}}function as(e,t,n,r,i,o,s,a){a(`Wait for element. Timeout: ${i}s. Selector: "${t}".`);const c=ls(e,t,n,r,a);if(c)return a("Found target element: true."),Promise.resolve(c);if(0===i){a("Found target element: false.");const e=new Error(`Element not found: "${t}".`);return Promise.reject(e)}return new Promise((c,l)=>{let u=0;const d=()=>{a("Process mutation.");const i=ls(e,t,n,r,a);i&&(a(`Found target element: ${!!i}.`),window.clearTimeout(u),o.unsubscribe(d),c(i))};o.subscribe(d),s.subscribe(()=>{o.unsubscribe(d);const e=new Error(`Waiting for element has been cancelled: "${t}".`);l(e)});if(i>0){const e=1e3*i;u=window.setTimeout(()=>{o.unsubscribe(d);const e=new Error(`Timeout waiting for element: "${t}".`);l(e)},e)}})}function cs(e,t,n,r,i){let o=function(e,t,n,r,i){let o;if(o=t?[...e.querySelectorAll(t)].filter(e=>e.nodeType===Node.ELEMENT_NODE):[e],i(`Filtered ${o.length} elements by selector.`),(n||r)&&(o=o.filter(e=>"string"==typeof e.innerText),0!==o.length&&(n&&(i(`Filtering by text: "${n=n.toLowerCase()}".`),o=o.filter(e=>e.innerText.toLowerCase().includes(n)),i(`Filtered ${o.length} elements by text.`)),r))){const e=new RegExp(r,"im");i(`Filtering by regexp: '${e}'.`),o=o.filter(t=>e.test(t.innerText)),i(`Filtered ${o.length} elements by regexp.`)}return o}(e,t,n,r,i);return o.length&&(o=o.filter(e=>function(e){if(e.checkVisibility)return e.checkVisibility({visibilityProperty:!0,opacityProperty:!0});const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility}(e)),i(`Filtered ${o.length} elements by visibility.`)),o}function ls(e,t,n,r,i){const o=cs(e,t,n,r,i);return 0===o.length?void 0:o[0]}function us(e){let t="";if(e.tag&&(t+=e.tag),e.id&&(t+="#"+e.id),e.class&&(t+=Go(e.class).split(/\s+/).map(e=>"."+e).join("")),e.attributes)for(const[n,r]of Object.entries(e.attributes))t+=`[${n}="${r}"]`;if(e.parentSelector){t=`${us(e.parentSelector)} ${t}`}if(""===t)throw new Error("Incorrect element selector.");return t}function ds(){return le().page_groups||null}function hs(){let e=window.location.hostname+window.location.pathname;return e+=e.endsWith("/")?"":"/",e.startsWith("www.")&&(e=e.slice(4)),e}const ps=new Map;function gs(e){let t=ps.get(e);if(void 0===t||0===t.length){t=e.replace(/https?:\\\/\\\/|www\\\./g,""),t.startsWith("^")||(t="^"+t);t.endsWith(")")&&(t.endsWith("/",t.length-1)||t.endsWith("*",t.length-1)||(t+="/")),t.endsWith("$")||(t+="$"),ps.set(e,t)}return new RegExp(t).test(hs())}function fs(e){try{if(e.url_regex){if(gs(e.url_regex))return!0}else if(e.urls){const t=hs();if(e.urls.includes(t))return!0}if(e.element_selector){const t=us(e.element_selector);if(window.document.querySelector(t))return!0}}catch(e){}return!1}function ms(){const e=ds();return e?Object.values(e).filter(fs).map(e=>e.name).filter(Go):[]}class vs{constructor(){this.expectedVideoLength=0,this.expectedVfSeq=0,this.expectedPvPart=0,this.httpSequenceNumber=0,this.httpPayloadCount=0,this.httpDroppedPayloadByLengthCount=0,this.httpDroppedPayloadByTypeCount=0,this.httpOverLimitCount=0,this.videoClicks=0,this.pvClicks=0,this.didCutPv=!1,this.didCutVideo=!1,this.didStartVideo=!1,this.httpCount=0,this.errCount=0,this.customAttributeTotalCount=0,this.customAttributeFailCount=0,this.customAttributeKeyCount=0,this.otherMetrics={},this._setupListeners()}static getInstance(){return this.instance||(this.instance=new vs),this.instance}addVideoFragData(e,t){this.expectedVfSeq=e,this.expectedVideoLength=t}setPvPart(e){this.expectedPvPart=e}addVideoClick(){this.videoClicks+=1}addPvClick(){this.pvClicks+=1}addError(){this.errCount+=1}addHttpEvent(){this.httpCount+=1}addHttpData(){this.httpSequenceNumber+=1}addHttpDataOverLimit(){this.httpOverLimitCount+=1}addHttpDataDropByType(){this.httpDroppedPayloadByTypeCount+=1}addHttpDataDropByLength(){this.httpDroppedPayloadByLengthCount+=1}addHttpDataPayloadCount(){this.httpPayloadCount+=1}addCustomAttributeTotalCount(){this.customAttributeTotalCount+=1}addCustomAttributeFailCount(){this.customAttributeFailCount+=1}setCustomAttributeKeyCount(e){this.customAttributeKeyCount=e}addOtherMetricsCount(e,t=1){this.otherMetrics[e]||(this.otherMetrics[e]=0),this.otherMetrics[e]+=t}setDidCutVideo(){this.didCutVideo=!0}setDidStartVideo(){this.didStartVideo=!0}setDidCutPv(){this.didCutPv=!0}_setupListeners(){if(!Ko())return;ss(window,"pagehide",()=>{this._postMetricsIfActive()})}_postMetricsIfActive(){os.getInstance().isDisabled||os.getInstance().isInactive}}var ys,bs=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class Is{constructor(){this.flushedStorage=!1;Xo.getInstance().isAvailable()&&this._postPreviousPageVisit()}static getInstance(){return this.instance||(this.instance=new Is),this.instance}checkAndStoreRetryQueue(e,t){const{type:n,payload:r}=e[e.length-1];if(n!==T||!r[ie])return;(r[ie].events?r[ie].events:[]).filter(e=>e[N]===j||e[N]===Y||e[N]===K||e[N]===z).length>0&&this.writePageVisitsFromRetryQueue(e,t)}writePageVisitsFromRetryQueue(e,t){const n=e.filter(({type:e})=>e===T).map(({payload:e})=>e[ie]);this._writePageVisitFrags(n,t)}_writePageVisitFrags(e,t){const n={pageVisitFrags:e,pageVisitInfo:t,timestamp:new Date},r=Xo.getInstance(),i=Oo(n);try{r.save("n_stored_page_visit",i)}catch(e){r.remove("n_stored_page_visit"),os.getInstance().postNoibuErrorAndOptionallyDisableClient({details:`Error writing pv to storage: ${e.toString()}${Lo(e)}`,diagnosis:r.getDiagnoseInfo()},!1,E)}}_getPostData(){const e=Xo.getInstance(),t=e.load("n_stored_page_visit");if(!t)return null;let n={};try{n=JSON.parse(t)}catch(n){return e.remove("n_stored_page_visit"),os.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error parsing page visit string '${t}': ${n}`,!1,E),null}if(n.timestamp){const e=new Date;if(e.setSeconds(e.getSeconds()-1740),+e>=Date.parse(n.timestamp))return null}const r={pvi:n.pageVisitInfo,[ie]:[],[oe]:[]};return r.pvi.last=!0,r[ie].push(...n.pageVisitFrags),r}_postPreviousPageVisit(){return bs(this,void 0,void 0,(function*(){const e=this._getPostData();if(e){const t={"content-type":"application/json"};try{yield Uo(Be(),e,t,!1,6e4)}catch(e){}}this._updateStorageFlushed()}))}_updateStorageFlushed(){this.flushedStorage=!0;Xo.getInstance().remove("n_stored_page_visit")}}function Cs(){return window.performance&&window.performance.now?window.performance.now():ns(Date.now())}function ws(e,t=[],n=1.5,r=2){return new Proxy(t,{get:(t,i)=>"push"===i?(...i)=>{t.push(...i),t.length>=n*e&&t.splice(0,e/r)}:t[i]})}class Ss{constructor(e){this.retryMessageQueue=ws(500),this.inactivityTimeout=0;const t=Ue();this.forceClosed=!1,this.socket=null,this.socketInstanceId=null,this.previousMessageType="",this.currentConnectionAttempts=0,this.connectionCount=0,this.sessionStartTime=Cs(),this.connectionPromise=null,this.pageVisitInfoSent=!1,this.connectionURL=`${t}/${de}`,this.postURL=Be(),this.messageSequenceNum=0,this.latestReceivedSeqNumber=-1,this.isRetryLoopDisabled=!1,this.metroplexTypeLock={},this.initialURL=Mo();const n=Ko()&&window.document.referrer;this.initialReferingURL=n?Ao(window.document.referrer):"",this.initialPageTitle=Ko()?window.document.title:"",this.sessionTimestamp=new Date,this.latestReceivedSeqNumStoredTime=new Date,this.instanceId=Ze()(),this.scriptInstanceId=e,this.sessionLength=0,this.socketCloseCodes=[],this.socketOpens=[],this.ackedOnce=!1,this.metroRetryFrequencyMS=3e4,this.debouncedInactivityHandler=Qi()(()=>{this._socketTimeout()},5e3)}static getInstance(e){return this.instance||(this.instance=new Ss(e),this.instance.start()),this.instance}start(){this.connectSocket(),this._setupOffloadEvents()}_addSeqNumToPayload(e,t){switch(e){case u.PageVisitPart:this._setSeqNumInPayloadAndIncrementSeqNum(ie,t);break;case u.PageVisitVideoFile:this._setSeqNumInPayloadAndIncrementSeqNum(oe,t);break;case u.PageVisitHttp:this._setSeqNumInPayloadAndIncrementSeqNum(ae,t);break;case u.PageVisitMeta:this._setSeqNumInPayloadAndIncrementSeqNum(se,t)}}_setSeqNumInPayloadAndIncrementSeqNum(e,t){t[e].seq_num=this.messageSequenceNum,this.messageSequenceNum+=1}sendMessage(e,t){if(e in this.metroplexTypeLock||os.getInstance().isDisabled)return!1;const n=t;if(e!==V&&(this._addSeqNumToPayload(e,n),this.retryMessageQueue.push({payload:n,type:e}),Is.getInstance().checkAndStoreRetryQueue(this.retryMessageQueue,this.getPageInformation())),this.isConnected()&&this.pageVisitInfoSent&&this._sendSocketMessage(n),this.previousMessageType=e,e===T&&t[ie]){const e=t[ie].events?t[ie].events:[];this._updateLatestPvTimestamp(e)}return!0}_updateLatestPvTimestamp(e){this._filterUserEvents(e).length>0&&(os.getInstance().updateLastActiveTime(),this.debouncedInactivityHandler())}_socketTimeout(){this.inactivityTimeout&&self.clearTimeout(this.inactivityTimeout),this.inactivityTimeout=self.setTimeout(()=>{this.closeIfInactive()},174e4)}_filterUserEvents(e){return e.filter(e=>e[N]===j)}isConnected(){return null!==this.socket&&1===this.socket.readyState}isConnecting(){return null!==this.socket&&0===this.socket.readyState}close(){this.forceClosed=!0,(this.isConnected()||this.isConnecting())&&this.socket.close(1e3)}handleConnect(e,t){(t||!this.isConnected()&&!this.isConnecting())&&(this.currentConnectionAttempts+=1,this.socket=new WebSocket(this.connectionURL),this.socketInstanceId=Ze()(),this.socket.onerror=()=>{},this.socket.onclose=t=>{this.pageVisitInfoSent=!1,this.forceClosed||(this.socketCloseCodes.push(`${ts()?"":(new Date).toISOString()}:${t.code}`),this.isConnecting()||(clearInterval(this.retryMetroplexInterval),this.currentConnectionAttempts>=20?os.getInstance().lockClientUntilNextPage("Too many reconnection attempts, locking until next page"):this.connectionCount>=100?os.getInstance().lockClientUntilNextPage("Too many connections, locking until next page"):setTimeout(()=>{this.handleConnect(e,!1)},Math.pow(this.currentConnectionAttempts,2)*("undefined"!=typeof METROPLEX_CONSECUTIVE_CONNECTION_DELAY?METROPLEX_CONSECUTIVE_CONNECTION_DELAY:1e3))))},this.socket.onmessage=t=>{this._onSocketMessage(t,e)},this.socket.onopen=()=>{this.socketOpens.push(""+(ts()?"":(new Date).toISOString())),this._onSocketOpen()})}connectSocket(){return this.isConnected()||this.isConnecting()||(this.connectionPromise=new Promise(e=>{if(!Ko())return void this.handleConnect(e,!1);"visible"===window.document.visibilityState&&!window.document.hidden&&this.handleConnect(e,!1),ss(window,"visibilitychange",()=>{const t="visible"===window.document.visibilityState;if(t){if(os.getInstance().isDisabled)return;this.forceClosed=!1,this._closeForVisibilityChange(),this.handleConnect(e,t)}else this._closeForVisibilityChange()})})),this.connectionPromise}_closeForVisibilityChange(){(this.isConnected()||this.isConnecting())&&(this.socket.onclose=()=>{},this.socket.close(1e3))}addEndTimeToPayload(e,t){const n=Math.ceil(Cs()-this.sessionStartTime);t&&(this.sessionLength=n);const r=new Date(this.sessionTimestamp.getTime()+n).toISOString();e.end_at=r}_onSocketOpen(){this.isConnected()&&!os.getInstance().isDisabled&&(this._sendSocketMessage(this.getPageInformation()),this.pageVisitInfoSent=!0,this.currentConnectionAttempts=0,this.previousMessageType="",this._sendUnconfirmedMessages(!1),this.setupRetryMechanism(),this.connectionCount+=1)}_onSocketMessage(e,t){switch(e.data){case ge:this.metroplexTypeLock[_]=!0,vs.getInstance().setDidCutVideo();break;case fe:this.metroplexTypeLock[T]=!0,vs.getInstance().setDidCutPv();break;case me:os.getInstance().lockClient(1440,"Metroplex blocked script"),this.close();break;case ve:this.close();break;case ye:break;default:if(e.data.includes("seq_num")){const n=e.data.split("seq_num:");if(n.length<2){os.getInstance().postNoibuErrorAndOptionallyDisableClient("Invalid message received from metroplex while clearing retry queue "+e.data,!1,E);break}const r=parseInt(n[1],10);if(-1===r)break;r<=this.latestReceivedSeqNumber?this.isRetryLoopDisabled=!0:(this.isRetryLoopDisabled=!1,this.latestReceivedSeqNumber=r,this._clearRetryQueue(r)),!this.ackedOnce&&t&&(this.ackedOnce=!0,t())}if(this._tryProcessHelpCodeResponse(e.data))break}}_messagePayloadHasLargerSeqNum(e,t,n){return e.payload[t]&&e.payload[t].seq_num&&e.payload[t].seq_num>n}_clearRetryQueue(e){this.latestReceivedSeqNumStoredTime=new Date;const t=this.retryMessageQueue.filter(t=>this._messagePayloadHasLargerSeqNum(t,ie,e)||this._messagePayloadHasLargerSeqNum(t,oe,e));this.retryMessageQueue=ws(500,t)}_sendUnconfirmedMessages(e){if(!this.isConnected()||os.getInstance().isDisabled)return;if(e){const e=new Date;if(e.setMilliseconds(e.getMilliseconds()-this.metroRetryFrequencyMS),e<this.latestReceivedSeqNumStoredTime)return;if(this.isRetryLoopDisabled)return}const t=this.retryMessageQueue.filter(e=>!(e.type in this.metroplexTypeLock));this.retryMessageQueue=ws(500,t);for(let e=0;e<this.retryMessageQueue.length;e+=1){const{type:t,payload:n}=this.retryMessageQueue[e];if(!this._sendSocketMessage(n))break;this.previousMessageType=t}}setupRetryMechanism(){this.retryMetroplexInterval=setInterval(()=>{this._sendUnconfirmedMessages(!0)},3e4)}_setupOffloadEvents(){Ko()&&ss(window,"pagehide",()=>{this._handleUnload()})}_handleUnload(){this.close(),os.getInstance().isDisabled||os.getInstance().isInactive||0!=this.messageSequenceNum&&this.postFullPageVisit()}postFullPageVisit(e=59e3){if(0===this.retryMessageQueue.length)return;const t=[],n={[_]:0,[T]:0};let r=0,i={pvi:this.getPageInformation(),[ie]:[],[oe]:[],[ae]:[],vpnum:this.connectionCount};if(i.pvi.last=!0,this.retryMessageQueue.forEach(o=>{let{type:s,payload:a}=o;const c=new Blob([Oo(a)]).size;if(c>e)n[s]+=1;else{if(r+=c,r>=e){this.postMessage(i);let e="Vid: "+i[oe].length;e+=" PV: "+i[ie].length,e+=` HTTP: ${i[ae].length},`,t.push(e),i={pvi:this.getPageInformation(),[ie]:[],[oe]:[],[ae]:[],vpnum:i.vpnum},i.pvi.last=!0,r=c}switch(s){case _:i[oe].push(a[oe]);break;case T:i[ie].push(a[ie]);break;case M:i[ae].push(a[ae])}}}),this.postMessage(i),this.retryMessageQueue.length>500){let e="Vid: "+i[oe].length;e+=" PV: "+i[ie].length,e+=` HTTP: ${i[ae].length},`,t.push(e);let r="POST Full PV complete";r+=", POSTs count: "+t.length,r+=", POSTs info: "+Oo(t),r+=", Retry message queue size: "+this.retryMessageQueue.length,n[_]>0&&(r+=", Video parts dropped: "+n[_]),n[T]>0&&(r+=", Page visit parts dropped: "+n[T]),n[M]>0&&(r+=", HTTP data parts dropped: "+n[M]),r+=", Sequence Info: Latest "+this.messageSequenceNum,r+=` Ack'd ${this.latestReceivedSeqNumStoredTime} ${this.latestReceivedSeqNumber}`;const o=!1,s=!0;os.getInstance().postNoibuErrorAndOptionallyDisableClient(r,!1,E,o,s)}}postMessage(e){const t=e;t.vpnum+=1;Uo(this.postURL,t,{"content-type":"application/json"},!0)}_sendSocketMessage(e){return!this.closeIfInactive()&&(this.socket.send(Oo(e)),!0)}closeIfInactive(){const e=os.getInstance().isInactive;return e&&!os.getInstance().isDisabled&&(os.getInstance().lockClientUntilNextPage("Session is inactive, locking until next page"),this.close(),this.postFullPageVisit()),e}getPageInformation(){const e=os.getInstance(),t={br_id:e.browserId,pv_id:e.pageVisitId,v:5,seq:e.pageVisitSequence,on_url:this.initialURL,page_title:this.initialPageTitle,page_groups:ms(),ref_url:this.initialReferingURL,start_at:this.sessionTimestamp.toISOString(),conc:this.connectionCount,cv:2,last:!1,script_id:Fe(),script_inst_id:this.scriptInstanceId,mp_sock_inst_id:this.instanceId,sock_inst_id:this.socketInstanceId,video_recorder:ce},n=function(){const e=self.navigator.userLanguage||self.navigator.language;return"string"==typeof e?e.toLowerCase():null}();return n&&(t.lang=n),t}_tryProcessHelpCodeResponse(e){const t=F+":";if("string"!=typeof e||!e.startsWith(t))return!1;const n=e.substring(t.length),r=/^\d{6}$/.test(n),i=new CustomEvent("noibuHelpCode",{detail:{success:r,data:n}});return self.dispatchEvent(i),!0}}class Es{constructor(){this.partCounter=0,this.pvMap={},this.partCounter=0,this.pvEventLength=0,this.visibilityChangedCounter=0,this.totalPvEventLength=0,this.inDebounceHandle=0,this.isInAcceleratedPvPostMode=!1,this.liveViewEnabled=!1}static configureInstance(){this.instance||(this.instance=new Es)}static getInstance(){if(!this.instance)throw new Error("Pagevisit was never configured");return this.instance}addPageVisitEvents(e,t){e.forEach(e=>{this._addPageVisitEvent(e,t)}),this._sendPageVisitMessage(),this.postEvents(t,e)}addPageVisitEvent(e,t){const n=this._addPageVisitEvent(e,t);return this._sendPageVisitMessage(),this.postEvents(t,[e]),n}_addPageVisitEvent(e,t){if(!("occurredAt"in e)||!("event"in e))throw new Error("missing attributes in the eventObj");const n={[N]:t,occ_at:e.occurredAt,[t]:e.event};this.pvEventLength>=200&&this._sendPageVisitMessage();const r=Ze()();return this.pvMap[r]=n,this.pvEventLength+=1,this.totalPvEventLength+=1,r}static makePageVisitFrag(e,t){const n={};return n.events=e,n.pc=t,Ss.getInstance().addEndTimeToPayload(n,!0),n}_sendPageVisitMessage(){const e=Object.keys(this.pvMap).map(e=>this.pvMap[e]);if(0===e.length)return;if(this.partCounter>=1e4)return void os.getInstance().lockClientUntilNextPage(`NoibuJS will stop processing parts because we reached max parts: 10000. Variables: \n      total Pv Event Length: ${this.totalPvEventLength}\n      visibility Changed Counter: ${this.visibilityChangedCounter}\n      `);const t=Es.makePageVisitFrag(e,this.partCounter);vs.getInstance().setPvPart(this.partCounter);const n={[ie]:t};Ss.getInstance().sendMessage(T,n),this.pvMap={},this.pvEventLength=0,this.partCounter+=1}postEvents(e,t){this.liveViewEnabled&&self.dispatchEvent(new CustomEvent("noibuPageVisitEvent",{detail:{type:e,eventObjects:t}}))}requestLiveView(){this.liveViewEnabled=!0}disableLiveView(){this.liveViewEnabled=!1}}class As{constructor(e){this.unmaskedInputSelectors=null,this.unmaskedInputCache=new Set,this.maskedInputCache=new Set,this.unmaskedInputSelectors=e}maskInputSafely(e,t){try{return this.maskInput(e,t)}catch(e){return"*"}}maskInput(e,t){if(null==this.unmaskedInputSelectors)return As.mask(e);if(this.maskedInputCache.has(t))return As.mask(e);if(this.unmaskedInputCache.has(t))return e;for(const n of this.unmaskedInputSelectors){const r=document.querySelectorAll(n);for(const n of r){if(n===t)return this.unmaskedInputCache.add(t),e}}return this.maskedInputCache.add(t),As.mask(e)}static mask(e){return"*".repeat(e.length)}}!function(e){e[e.Init=0]="Init",e[e.Fail=1]="Fail",e[e.Ready=2]="Ready"}(ys||(ys={}));var ks=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class Ts{constructor(e,t){this.status=ys.Init,this.recordSnapshotId=0,this.scriptUrl=e,this.errorCallback=t,this.stats={start:0,fetch:0,read:0,create:0,ping:0,pong:0,init:0,error:0,send:0,receive:0,queue:0,first:0,max:0,avg:0}}ready(){return this.statusPromise}start(){this.statusPromise=new Promise((e,t)=>{const n=performance.now();this.statusResolver={timestamp:n,resolve:e,reject:t},this.init()})}processRecordSnapshot(e){if(this.status!==ys.Ready){const e=new Error("Worker is not initialized.");return Promise.reject(e)}return new Promise((t,n)=>{const r=this.getNextRecordSnapshotId(),i={timestamp:performance.now(),resolve:t,reject:n};this.recordSnapshotResolvers.set(r,i),this.sendRecordSnapshotMessage(r,e)})}reportError(e,t){const n=!!this.recordSnapshotResolvers;this.stats.queue=n?this.recordSnapshotResolvers.size:0;const r=Oo({error:`${e} ${t} ${Lo(t)}`,status:this.status,stats:this.stats});this.errorCallback(r)}init(){return ks(this,void 0,void 0,(function*(){try{this.worker=yield Ts.createWorker(this.scriptUrl,this.stats),this.worker.addEventListener("error",e=>{this.stats.error+=1,this.handleInitError(e.error)}),this.worker.addEventListener("message",e=>{this.receiveMessage(e.data)}),this.worker.addEventListener("messageerror",e=>{this.reportError("Message error.",e.data)}),this.setupInitTimeout(),this.sendPingMessage()}catch(e){this.handleInitError(e)}}))}static createWorker(e,t){return ks(this,void 0,void 0,(function*(){t.start=performance.now();const n=yield fetch(e);if(t.fetch=performance.now(),!n.ok)throw new Error(`Failed to fetch worker script. Code: ${n.status}. Status: ${n.statusText}.`);const r=yield n.text();t.read=performance.now();const i=new Blob([r],{type:"application/javascript"}),o=URL.createObjectURL(i),s=new Worker(o);return t.create=performance.now(),s}))}handleReady(){this.status===ys.Init&&(this.recordSnapshotResolvers=new Map,this.stats.init=performance.now()-this.statusResolver.timestamp,this.status=ys.Ready,this.statusResolver.resolve(this.status),this.setupRecordSnapshotCleanup())}handleInitError(e){if(this.status===ys.Init){this.status=ys.Fail,this.statusResolver.resolve(this.status);Ts.isInitErrorAcknowledged(e)||this.reportError("Init error.",e)}}static isInitErrorAcknowledged(e){if(!e)return!0;const t=(""+e).trim();return 0===t.length||Ts.knownInitErrors.some(e=>t.includes(e))}setupInitTimeout(){window.setTimeout(()=>{const e=new Error("Init timeout.");this.handleInitError(e)},5e3)}sendMessage(e){this.status===ys.Ready&&(this.stats.send+=1,this.worker.postMessage(e))}sendPingMessage(){this.stats.ping=performance.now(),this.worker.postMessage({type:"ping"})}sendRecordSnapshotMessage(e,t){const n={type:"record-snapshot-request",payload:{id:e,snapshot:t}};this.sendMessage(n)}receiveMessage(e){switch(e.type){case"pong":this.stats.pong=this.stats.pong||performance.now(),this.handleReady();break;case"record-snapshot-response":this.receiveRecordSnapshotResponse(e.payload);break;case"messageerror":this.reportError("Received message error.",null)}}receiveRecordSnapshotResponse(e){const{id:t}=e,n=this.recordSnapshotResolvers.get(t);n&&(Ts.updateReceiveStats(n,this.stats),this.recordSnapshotResolvers.delete(t),e.error?(this.reportError("Service error.",e.error),n.reject(e.error)):n.resolve(e))}static updateReceiveStats(e,t){const n=performance.now()-e.timestamp,r=t.receive+1;let{avg:i}=t;i-=i/r,i+=n/r,t.receive=r,t.avg=i,0===t.first&&(t.first=n),n>t.max&&(t.max=n)}setupRecordSnapshotCleanup(){window.setInterval(()=>this.cleanupRecordSnapshot(),12e4)}cleanupRecordSnapshot(){let e=0;const t=[...this.recordSnapshotResolvers.entries()];for(const[n,r]of t){if(performance.now()-r.timestamp>12e4){this.recordSnapshotResolvers.delete(n);const t=new Error("Resolver expired.");r.reject(t),e+=1}}if(e){const t=new Error(`Collected ${e} expired resolvers.`);this.reportError("Cleanup.",t)}}getNextRecordSnapshotId(){return this.recordSnapshotId+=1,this.recordSnapshotId}}var _s,Rs;Ts.knownInitErrors=["SecurityError: The operation is insecure","TypeError: Load failed","TypeError: Failed to fetch","SecurityError: Failed to construct","QuotaExceededError: Failed to construct","TypeError: NetworkError when attempting to fetch resource","AbortError: The operation was aborted"];const Ms=(null===(Rs=null===(_s=null==Promise?void 0:Promise.all)||void 0===_s?void 0:_s.bind)||void 0===Rs?void 0:Rs.call(_s,Promise))||(e=>new Promise((function(t,n){const r=[];let i=0;e.forEach((o,s)=>{Promise.resolve(o).then(n=>{r[s]=n,i+=1,i===e.length&&t(r)}).catch(n)})})));var Ns,xs,Ls,Ds;!function(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"}(Ns||(Ns={})),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"}(xs||(xs={})),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.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"}(Ls||(Ls={})),function(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"}(Ds||(Ds={}));var Os=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class Ps{constructor(e,t){if(this.isRecordingAllowedHandled=!1,this.isRecordingLoadedHandled=!1,this.liveViewRecording=!1,this.eventBuffer=[],this.vfCounter=0,this.didSetupRecorder=!1,this.recordStopper=null,this.firstRecordedTimestamp=null,this.lastRecordedTimestamp=null,this.invalidVideoLength=!1,this.lastFragPostTimestamp=Date.now(),this.pauseTimeout=null,this.freezingEvents=!1,this.cssURLs=new Map,this.pageStateHistory=[],this.lastRRWebEvent=null,t)return void(this.didSetupRecorder=!0);const n=function(){const e=le().unmask;return Array.isArray(e)?e:null}();this.inputMaskManager=new As(n),this.setupUnloadHandler(),e&&(this.workerAgent=new Ts("https://cdn.noibu.com/collect-worker.js",Ps.postWorkerError),this.workerAgent.start())}static configureInstance(e=!0){this.instance||(this.instance=new Ps(e,!1),ss(window,"click",()=>{this.instance.handleFragPost()}))}static getInstance(){if(!this.instance)throw new Error("SessionRecorder was not configured");return this.instance}static postWorkerError(e){os.getInstance().postNoibuErrorAndOptionallyDisableClient("Worker error: "+e,!1,A)}addCSSURLs(e){this.cssURLs.get(e)||this.cssURLs.set(e,{seq_sent:Ss.getInstance().messageSequenceNum,received:!1})}searchObjectForCSSUrls(e){(function(e){const t=[];return function e(n){if(n)for(const[r,i]of Object.entries(n)){const o="href"===r,s="string"==typeof i&&!!i.length;if(o&&s){const e=i.includes(".css"),r="text/css"===n.type,o="stylesheet"===n.rel;if(e||r||o){const e=i.replace(/['"]/g,"");t.push(e)}}else"object"==typeof i&&null!==i&&e(i)}}(e),t})(e).forEach(e=>{this.addCSSURLs(e)})}checkForCSSURLs(e){3!==e.type&&2!==e.type||this.searchObjectForCSSUrls(e)}getCSSURLsNotReceived(){const{latestReceivedSeqNumber:e}=Ss.getInstance(),t=[];return this.cssURLs.forEach((n,r)=>{if(!n.received&&n.seq_sent<e){const e=n;e.received=!0,this.cssURLs.set(r,e)}else n.received||t.push(r)}),t}setupUnloadHandler(){["pagehide","visibilitychange"].forEach(e=>ss(window,e,()=>{this.pageStateHistory.push(`${ts()?"":(new Date).toISOString()}: ${e}`),"pagehide"===e&&this.handleFragPost()}))}recordUserSession(e={}){if(Ss.getInstance().closeIfInactive()||vs.getInstance().didCutVideo)return;if(this.didSetupRecorder)return;const{domain:t}=le(),n="uat.jtv.com"===t||"www.jtv.com"===t,r="console.noibu.com"===t,i=Object.assign({emit:e=>{this.handleNewRRwebEvent(e,2e3)},inlineStylesheet:!1,maskAllInputs:!0,maskInputFn:this.inputMaskManager.maskInputSafely.bind(this.inputMaskManager),deferProcessMutations:n,maskTextSelector:Bo(),ignoreCSSAttributes:Oe,ignoreIframes:r},e);es.setRecordingStartTime(),vs.getInstance().setDidStartVideo(),this.recordStopper=this.rrwebRecord(i),this.didSetupRecorder=!0}handleNewRRwebEvent(e,t){return Os(this,void 0,void 0,(function*(){if(Ss.getInstance().closeIfInactive()||vs.getInstance().didCutVideo){if(this.recordStopper)try{this.recordStopper()}catch(e){os.getInstance().postNoibuErrorAndOptionallyDisableClient("Error during handleNewRRwebEvent in recordStopper: "+e,!0,E)}return}if(e.type===Ns.Custom&&"unfreeze"===e.data.tag)return;if(e.type===Ns.IncrementalSnapshot&&e.data.source===Ls.Mutation||(this.pauseTimeout&&(clearTimeout(this.pauseTimeout),this.freezingEvents=!1),this.pauseTimeout=setTimeout(()=>{this.rrwebRecord.freezePage&&(this.freezingEvents=!0,this.rrwebRecord.freezePage())},t)),e.timestamp=ns(e.timestamp),this.firstRecordedTimestamp||(this.firstRecordedTimestamp=e.timestamp),(!this.lastRecordedTimestamp||e.timestamp>this.lastRecordedTimestamp)&&(this.lastRecordedTimestamp=e.timestamp),this.firstRecordedTimestamp&&e.timestamp<this.firstRecordedTimestamp)return void os.getInstance().postNoibuErrorAndOptionallyDisableClient("Detected time rewind. Client has been disabled.",!0,E,!0);const n=yield this.packAndParseCss(e);this.handleLiveView(n),this.eventBuffer.push(n),this.lastRRWebEvent=e,e.type===Ns.IncrementalSnapshot&&(e.data.source!==Ls.MouseInteraction||e.data.type!==Ds.Click&&e.data.type!==Ds.DblClick||vs.getInstance().addVideoClick());const r=Date.now()-this.lastFragPostTimestamp;(this.eventBuffer.length>=10||r>500)&&this.handleFragPost()}))}packAndParseCss(e){return Os(this,void 0,void 0,(function*(){let t=null;if(this.workerAgent){if((yield this.workerAgent.ready())===ys.Ready){const n=Object.assign(Object.assign({},e),{v:"v1"});try{const e=yield this.workerAgent.processRecordSnapshot(n);t=e.compressedData,e.cssUrls.forEach(e=>this.addCSSURLs(e))}catch(e){t=null}}}return null==t&&(t=this.rrwebPack(e,{level:1}),this.checkForCSSURLs(e)),t}))}handleFragPost(){if(!Ss.getInstance().closeIfInactive()&&this.didSetupRecorder&&0!==this.eventBuffer.length){try{let e=0;this.firstRecordedTimestamp&&this.lastRecordedTimestamp&&!this.invalidVideoLength&&(e=this.lastRecordedTimestamp-this.firstRecordedTimestamp),!this.invalidVideoLength&&(e<0||e>=Number.MAX_SAFE_INTEGER)&&(os.getInstance().postNoibuErrorAndOptionallyDisableClient(`video lengthMS is invalid: ${e}, start time: ${this.firstRecordedTimestamp}, end time: `+this.lastRecordedTimestamp,!1,E),this.invalidVideoLength=!0,e=0),this.vfCounter+=1;const t={};t.vid=Oo(this.eventBuffer),t.seq=this.vfCounter,t.len=e,t.css_urls=this.getCSSURLsNotReceived(),Ss.getInstance().addEndTimeToPayload(t,!1),vs.getInstance().addVideoFragData(this.vfCounter,e);const n={};n[oe]=t,Ss.getInstance().sendMessage(_,n),this.lastFragPostTimestamp=Date.now()}catch(e){if(os.getInstance().postNoibuErrorAndOptionallyDisableClient("video frag socket closed with err: "+e.message,!1,E),this.recordStopper)try{this.recordStopper()}catch(e){os.getInstance().postNoibuErrorAndOptionallyDisableClient("Error during handleFragPost in recordStopper: "+e,!1,E)}}this.eventBuffer=[]}}unfreeze(){this.freezingEvents&&this.rrwebAddCustomEvent("unfreeze",{})}downloadIfAllowed(){if(!this.isRecordingAllowed())return this.listenRecordingAllowedEvent(),void this.listenRecordingLoadedEvent();this.download()}download(){this.listenRecordingLoadedEvent(),$o("https://cdn.noibu.com/collect-recording.js",null,e=>{os.getInstance().postNoibuErrorAndOptionallyDisableClient("Error loading session recording script. "+e,!0,E)})}isRecordingAllowed(){try{const{src:e}=document.currentScript;if(new URL(e).searchParams.has("hold"))return!1}catch(e){}return!0}listenRecordingAllowedEvent(){this.isRecordingAllowedHandled||(this.isRecordingAllowedHandled=!0,ss(window,"noibuRecordingAllowed",()=>{this.download()}))}listenRecordingLoadedEvent(){this.isRecordingLoadedHandled||(this.isRecordingLoadedHandled=!0,ss(window,"noibuRecordingLoaded",e=>{this.handleRRWebLoaded(e.detail)}))}handleRRWebLoaded(e){if(e){if(this.setRRWeb(e)){const e=Ss.getInstance();Ms([Io(),e.connectionPromise]).then(()=>{this.recordUserSession()})}}else os.getInstance().postNoibuErrorAndOptionallyDisableClient("Error loading rrweb script",!0,E)}setRRWeb(e){return e&&e.record&&e.pack&&e.addCustomEvent?(this.rrwebRecord=e.record,this.rrwebPack=e.pack,this.rrwebAddCustomEvent=e.addCustomEvent,!0):(os.getInstance().postNoibuErrorAndOptionallyDisableClient("RRweb functions not all present",!0,E),!1)}requestLiveView(){this.liveViewRecording=!0,this.rrwebRecord.takeFullSnapshot(!0)}disableLiveView(){this.liveViewRecording=!1}handleLiveView(e){this.liveViewRecording&&Hs.getInstance().sendData(e)}}const Fs=0,Vs=1,Us=2;function Ws(){}class Bs extends class{_e=new Map;on(e,t){let n=this._e.get(e);n||this._e.set(e,n=[]),n.push(t)}emit(e,...t){const n=this._e.get(e);if(n)for(const e of n)e.apply(null,t)}}{id;connected=!1;_t;_s;_n;_i;_o;_r=[];_c;_a=!0;constructor(e,t){super(),this._t=e,this._s=Object.assign({path:"/socket.io/",reconnectionDelay:2e3},t),this._h()}_h(){this._n=new WebSocket(this._u()),this._n.onmessage=({data:e})=>this._p(e),this._n.onerror=Ws,this._n.onclose=()=>this._l("transport close")}_u(){return`${this._t.replace(/^http/,"ws")}${this._s.path}?EIO=4&transport=websocket`}_p(e){if("string"==typeof e)switch(e[0]){case"0":this._d(e);break;case"1":this._l("transport close");break;case"2":this._T(),this._m("3");break;case"4":let t;try{t=function(e){let t=1;const n={type:parseInt(e.charAt(t++),10)},r=e.indexOf(",");e.substring(t,r);if(t=r+1,e.charAt(t)&&(n.data=JSON.parse(e.substring(t))),!function(e){switch(e.type){case Fs:return"object"==typeof e.data;case Vs:return void 0===e.data;case Us:{const t=e.data;return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]}default:return!1}}(n))throw new Error("invalid format");return n}(e)}catch(e){return this._l("parse error")}this._f(t);break;default:this._l("parse error")}}_d(e){let t;try{t=JSON.parse(e.substring(1))}catch(e){return this._l("parse error")}this._o=t.pingInterval+t.pingTimeout,this._T(),this._C()}_f(e){switch(e.type){case Fs:this._g(e);break;case Vs:this._a=!1,this._l("io server disconnect");break;case Us:super.emit.apply(this,e.data);break;default:this._l("parse error")}}_g(e){this.id=e.data.sid,this.connected=!0,this._r.forEach(e=>this._y(e)),this._r.slice(0),super.emit("connect")}_l(e){this._n&&(this._n.onclose=Ws,this._n.close()),clearTimeout(this._i),clearTimeout(this._c),this.connected?(this.connected=!1,this.id=void 0,super.emit("disconnect",e)):super.emit("connect_error",e),this._a&&(this._c=setTimeout(()=>this._h(),this._s.reconnectionDelay))}_T(){clearTimeout(this._i),this._i=setTimeout(()=>{this._l("ping timeout")},this._o)}_m(e){this._n.readyState===WebSocket.OPEN&&this._n.send(e)}_y(e){const t=this._s.namespace;this._m("4"+function(e){let n=""+e.type;return t&&(n+="/"+t+","),e.data&&(n+=Oo(e.data)),n}(e))}_C(){this._y({type:Fs})}emit(...e){const t={type:Us,data:e};this.connected?this._y(t):this._r.push(t)}disconnect(){this._a=!1,this._l("io client disconnect")}}class Hs{constructor(){this.socket=null,this.throttledUpdate=null,this.idleConnectionTimer=null,this.connectionTimeout=12e4}static getInstance(){return Hs.instance||(Hs.instance=new Hs),Hs.instance}monitor(){const e=Xo.getInstance();if(!e.isAvailable())return;const t=e.loadWithExpiry("noibuHC");t?(e.updateExpiry("noibuHC",12e4),this.connectToSocketIoServer(t)):ss(window,"noibuHCAlert",e=>this.handleHelpCode(e)),ss(window,"noibuPageVisitEvent",e=>this.sendPVEvents(e.detail.type,e.detail.eventObjects))}handleHelpCode(e){const{data:t}=e.detail;Xo.getInstance().saveWithExpiry("noibuHC",t,12e4),this.connectToSocketIoServer(t)}connectToSocketIoServer(e){const{domain:t}=le();if(t&&(this.helpcode=e,!this.socket)){try{this.socket=function(e,t){return"string"!=typeof e&&(t=e,e=location.origin),new Bs(e,t)}("https://live.noibu.com",{namespace:t,reconnectionDelay:500})}catch(e){return}try{this.throttledUpdate=Qi()(this.updateTTL.bind(this),6e4,{leading:!0,maxWait:6e4,trailing:!1}),this.socket.on("connect",this.errorHandler(()=>{this.socket.emit("join_as_recorder",e)})),this.socket.on("start_sending_data",this.errorHandler(e=>{this.helpcode===e&&(Ps.getInstance().requestLiveView(),Es.getInstance().requestLiveView(),Xo.getInstance().updateExpiry("noibuHC",12e4),this.cancelConnectionDisconnectTime())})),this.socket.on("stop_sending_data",this.errorHandler(e=>{this.helpcode===e&&(Ps.getInstance().disableLiveView(),Es.getInstance().disableLiveView(),this.startConnectionDisconnectTimer())})),this.socket.on("user-event",this.errorHandler(()=>{})),this.startConnectionDisconnectTimer()}catch(e){this.disconnectAndCancelThrottledUpdate()}}}startConnectionDisconnectTimer(){this.cancelConnectionDisconnectTime(),this.idleConnectionTimer=setTimeout(()=>{this.disconnectAndCancelThrottledUpdate()},this.connectionTimeout)}cancelConnectionDisconnectTime(){clearTimeout(this.idleConnectionTimer),this.idleConnectionTimer=null}sendData(e){if(this.socket){try{this.socket.emit("send-event-compressed",{event:e,helpcode:this.helpcode})}catch(e){}this.throttledUpdate()}}sendPVEvents(e,t){if(this.socket){try{this.socket.emit("send-njs-events",{type:e,events:t,helpcode:this.helpcode})}catch(e){}this.throttledUpdate()}}updateTTL(){Xo.getInstance().updateExpiry("noibuHC",12e4)}disconnectAndCancelThrottledUpdate(){try{this.socket.disconnect()}catch(e){}if(this.socket=null,this.throttledUpdate){try{this.throttledUpdate.cancel()}catch(e){}this.throttledUpdate=null}}errorHandler(e){const t=e=>{this.disconnectAndCancelThrottledUpdate()};return(...n)=>{try{const r=e.apply(this,n);r&&"function"==typeof r.catch&&r.catch(t)}catch(e){t()}}}getSocket(){return this.socket}}class qs{constructor(){this.eventsToDebounce={},this.registerInputType(K,0),this.registerInputType(ne,0),this.registerInputType(re,0),this.registerInputType(J,500),this.registerInputType(Y,500),this.registerInputType(W,500),this.registerInputType(Q,500),this.registerInputType($,500,j),this.registerInputType(X,500),this._setupUnloadHandler()}static getInstance(){return this.instance||(this.instance=new qs),this.instance}registerInputType(e,t,n=e){e in this.eventsToDebounce||(this.eventsToDebounce[e]={timeout:null,events:[],debouncePeriod:t,eventName:n})}addEvent(e,t,n){t in this.eventsToDebounce?(n||(n=Date.now()),this.eventsToDebounce[t].events.push({event:e,occurredAt:new Date(ns(n)).toISOString()}),this._debouncePvEvents(t)):os.getInstance().postNoibuErrorAndOptionallyDisableClient(new Error(`Type: ${t} is not in eventsToDebounce`),!1,E)}_debouncePvEvents(e){clearTimeout(this.eventsToDebounce[e].timeout),this.eventsToDebounce[e].timeout=setTimeout(()=>{this.eventsToDebounce[e].timeout=null,Es.getInstance().addPageVisitEvents(this.eventsToDebounce[e].events,this.eventsToDebounce[e].eventName),this.eventsToDebounce[e].events=[]},this.eventsToDebounce[e].debouncePeriod)}_setupUnloadHandler(){ss(window,"pagehide",()=>{Object.values(this.eventsToDebounce).forEach(e=>{Es.getInstance().addPageVisitEvents(e.events,e.eventName)})})}}const Gs={"input.noibu.com":!0,"input.staging.noibu.com":!0,"vf.noibu.com":!0,"vf.staging.noibu.com":!0,"cdn.noibu.com":!0};function js(e,t=!0){return{url:jo(e.filename),[N]:B,j_err:xo(e.error,t)}}function zs(e,t,n){var r;let i=t;(null===(r=null==t?void 0:t.error)||void 0===r?void 0:r.originalError)&&(i=t.error.originalError);let o,s=e;switch(e){case be:o=function(e,t){const n={url:jo(e.responseURL,!0),[N]:U,h_code:Math.max(e.status,0)};return(t||0===t)&&(n.seq=t),n}(i,n);break;case Ie:o=js(i);break;case Se:o=function(e,t){const n={url:jo(e.url,!0),[N]:U,h_code:Math.max(e.status,0)};return(t||0===t)&&(n.seq=t),n}(i,n);break;case"GQLError":s=Se,o=function(e,t){const n={url:Mo(),[N]:H,gql_err:e};return(t||0===t)&&(n.seq=t),n}(i,n);break;case"CSPError":s=Ie,a=i,o={url:Mo(),[N]:q,csp_err:a};break;case"ImageError":s=Ie,o=function(e){return{url:Mo(),[N]:G,res_err:e}}(i);break;case Ee:o=function(e){return{url:Mo(),[N]:ee,pagecheck_err:e}}(i);break;case Ae:o=js(i,!1);break;case ke:o=js(i);break;case Te:o=function(e){return{url:Mo(),[N]:B,j_err:xo(e)}}(i);break;case Ce:case _e:o=js(i);break;default:try{o=js(i),i instanceof Event&&(!function(e,t,n){let r=null;if(n.detail)try{r=Oo(n.detail)}catch(e){r="non-serializable"}let i=`Fire error event of type ${e}.`;null!=r&&(i+=` Detail: ${r}.`),t.j_err.msg=Ao(i)}(s,o,i),s=Ie)}catch(e){return null}}var a;return o&&(o.err_src=s),o}const Zs=_o(No(co((new Error).stack)).pop().file);function $s(e,t,n,r){if(e===we)return;const i=zs(e,t,n);if(!i||!i.url)return;const o=i.url;if(Ho(o)){const e=new URL(o);if(e.hostname in Gs||!e.protocol.startsWith("http"))return}if(function(e){const t=Oo(e);return He.some(e=>e(t))}(i))return;(function(e){if(e[N]===B){if(e.j_err){const t=e.j_err.frames;if(t&&t.length>0){const n=t[0].file.toLowerCase(),r=t[0].mname.toLowerCase();if(n.includes("noibu")&&_o(n)===Zs&&!r.includes("nbuwrapper")&&!n.includes("noibu-customer-session-playback"))return os.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,E),!0}}if(e.msg){const t=e.msg.toLowerCase();if(t.includes("input.noibu")||t.includes("input.b.noibu"))return os.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,E),!0}}else if(e[N]===U&&e.url){const t=e.url;if("string"==typeof t)for(let n=0;n<ue.length;n+=1){const r=ue[n];if(t.includes(r))return os.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,E),!0}}return!1})(i)||(vs.getInstance().addError(),qs.getInstance().addEvent(i,Y,r))}class Ks{static configure(e){return this.allowUntrustedEvents=e,this.initialRequest=!1,this.instance||(this.instance=new Ks),this.instance}static getInstance(){if(!this.instance)throw new Error("HelpCode was not configured");return this.instance}constructor(){this.requestContext=null,Ko()&&(ss(window,"hashchange",e=>this._handleHashChange(e)),ss(window,"noibuHelpCode",e=>this._receiveHelpCode(e)))}requestHelpCode(e=!0){if(null!=this.requestContext)return this.requestContext.promise;const t={alertUser:e,resolve:null,reject:null,promise:null};t.promise=new Promise((e,n)=>{t.resolve=e,t.reject=n}),this.requestContext=t;return!1===this._sendRequest()?(this.requestContext=null,Promise.reject(new Error("noibu connection is unavailable"))):this.requestContext.promise}checkInitialRequest(){Mo().toLowerCase().includes("#helpcode")&&!1===Ks.initialRequest&&(Ks.initialRequest=!0,this._sendRequest())}_handleHashChange(e){if(!e.isTrusted&&!Ks.allowUntrustedEvents)return;!e.oldURL.toLowerCase().includes("#helpcode")&&e.newURL.toLowerCase().includes("#helpcode")&&(window.history.back(),this._sendRequest())}_receiveHelpCode(e){if(null==this.requestContext)return void this._presentHelpCode(e);const t=this.requestContext;this.requestContext=null,!0===t.alertUser&&this._presentHelpCode(e);const{success:n,data:r}=e.detail;n?t.resolve(r):t.reject(new Error(r))}_presentHelpCode(e){const{success:t,data:n}=e.detail;if(t){window.prompt("",n);const e=new CustomEvent("noibuHCAlert",{detail:{data:n}});window.dispatchEvent(e)}else{const e="Noibu help code is not available due to "+n;window.alert(e),os.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,E)}}_sendRequest(){return Ss.getInstance().sendMessage(V,{[V]:F})}}class Ys{constructor(){this.customIDs={},this.customErrorsCount=0,this.internalCustomIDs={},this.TOO_MANY_IDS_ADDED_MSG="TOO_MANY_IDS_ADDED",this.ID_NAME_ALREADY_ADDED_MSG="ID_NAME_ALREADY_ADDED",this.NAME_TOO_LONG_MSG="NAME_TOO_LONG",this.VALUE_TOO_LONG_MSG="VALUE_TOO_LONG",this.INVALID_NAME_TYPE_MSG="INVALID_NAME_TYPE",this.INVALID_VALUE_TYPE_MSG="INVALID_VALUE_TYPE",this.NAME_HAS_NO_LENGTH_MSG="NAME_HAS_NO_LENGTH",this.VALUE_HAS_NO_LENGTH_MSG="VALUE_HAS_NO_LENGTH",this.SUCCESS_MSG="SUCCESS",this.ERROR_HAS_NO_MSG_MSG="ERROR_HAS_NO_MSG",this.ERROR_HAS_NO_STACK_MSG="ERROR_HAS_NO_STACK",this.NULL_CUSTOM_ERR_MSG="NULL_CUSTOM_ERROR",this.ERROR_ALREADY_RECEIVED_MSG="ERROR_ALREADY_RECEIVED",this.INVALID_ERROR_SOURCE_MSG="INVALID_ERROR_SOURCE_MSG",this.TOO_MANY_ERRORS_RECEIVED_PER_PAGEVISIT_MSG="TOO_MANY_ERRORS_RECEIVED_PER_PAGEVISIT"}static getInstance(){return this.instance||(this.instance=new Ys),this.instance}exposeFunctions(){const e=this._getSDKWindowObject();window.NOIBUJS=e,window.dispatchEvent(new CustomEvent("noibuSDKReady"))}_getSDKWindowObject(){return{requestHelpCode:this.requestHelpCode.bind(this),addCustomAttribute:this.addCustomAttribute.bind(this),addError:this.addCustomError.bind(this),addJsSdkError:this._addErrorFromJSSdk.bind(this),noibuBrowserID:this.noibuBrowserID.bind(this)}}_validateCustomError(e){return e?e.message?e.stack?this.SUCCESS_MSG:this.ERROR_HAS_NO_STACK_MSG:this.ERROR_HAS_NO_MSG_MSG:this.NULL_CUSTOM_ERR_MSG}_validateAndSetCustomError(e){if(this.customErrorsCount>=500)return this.TOO_MANY_ERRORS_RECEIVED_PER_PAGEVISIT_MSG;const t=this._validateCustomError(e);return t!==this.SUCCESS_MSG?t:(this.customErrorsCount+=1,this.SUCCESS_MSG)}_addErrorFromJSSdk(e,t){const n=this._validateAndSetCustomError(e);return n!==this.SUCCESS_MSG?n:t!==Re&&t!==Me?this.INVALID_ERROR_SOURCE_MSG:($s(t,{error:e}),n)}addCustomError(e){const t=this._validateAndSetCustomError(e);return t!==this.SUCCESS_MSG||$s(_e,{error:e}),t}addCustomAttribute(e,t){return this.addCustomAttributeInternal(e,t,!1)}addNoibuInternalCustomAttribute(e,t){return this.addCustomAttributeInternal(e,t,!0)}addCustomAttributeInternal(e,t,n){let r=this.customIDs;if(n&&(r=this.internalCustomIDs),vs.getInstance().addCustomAttributeTotalCount(),!n&&Object.keys(r).length>=20)return vs.getInstance().addCustomAttributeFailCount(),this.TOO_MANY_IDS_ADDED_MSG;const i=this._validateCustomIDInput(e,t);if(i!==this.SUCCESS_MSG)return vs.getInstance().addCustomAttributeFailCount(),i;if(e in r)return vs.getInstance().addCustomAttributeFailCount(),this.ID_NAME_ALREADY_ADDED_MSG;if(r[e]=t,Ss.getInstance().sendMessage(R,{[se]:{id_name:e,id_val:t}}),!n){const e=Object.keys(r).length;vs.getInstance().setCustomAttributeKeyCount(e)}return this.SUCCESS_MSG}_validateCustomIDInput(e,t){return"string"!=typeof e?this.INVALID_NAME_TYPE_MSG:"string"!=typeof t?this.INVALID_VALUE_TYPE_MSG:t.length>500?this.VALUE_TOO_LONG_MSG:e.length>100?this.NAME_TOO_LONG_MSG:0===t.length?this.VALUE_HAS_NO_LENGTH_MSG:0===e.length?this.NAME_HAS_NO_LENGTH_MSG:this.SUCCESS_MSG}requestHelpCode(e=!0){return Ks.getInstance().requestHelpCode(e)}noibuBrowserID(){return os.getInstance().browserId}}class Js{constructor(){this.eventDebouncer=qs.getInstance(),this.inputManager=Ys.getInstance()}static getInstance(){return this.instance||(this.instance=new Js),this.instance}monitor(){window.addEventListener("message",e=>{if(e.data)if("noibuShopifyEvent"===e.data.type){if("ping"===e.data.payload){return void e.source.postMessage("ping","*")}this.handleStandardEvent(e.data.payload,null)}else if("noibuShopifyEventWithName"===e.data.type){if(!e.data.payload)return;if("ping"===e.data.payload){return void e.source.postMessage("ping","*")}"StandardEvent"===e.data.payload.type?this.handleStandardEvent(e.data.payload.data,e.data.payload.extra):"CustomEvent"===e.data.payload.type?this.handleCustomEvent(e.data.payload.data):"DomEvent"===e.data.payload.type&&this.handleDomEvent(e.data.payload.data)}}),this.notifyPixels()}notifyPixels(){document.querySelectorAll("iframe").forEach(e=>{try{e.contentWindow.postMessage("ping","*")}catch(e){}})}handleStandardEvent(e,t){let{data:n}=e;"page_viewed"===e.name&&(n={location:e.context.window.location.href,title:e.context.document.title},this.inputManager.addCustomAttributeInternal("clientId",e.clientId,!0),(null==t?void 0:t.cartId)&&this.inputManager.addCustomAttributeInternal("cartId",t.cartId,!0),(null==t?void 0:t.customerId)&&this.inputManager.addCustomAttributeInternal("customerId",t.customerId,!0));const r={platform:"shopify",name:e.name,data:Oo(n)};this.eventDebouncer.addEvent(r,X)}handleCustomEvent(e){const{customData:t}=e,n={platform:"shopify",name:e.name,data:Oo(t)};this.eventDebouncer.addEvent(n,X)}handleDomEvent(e){const{data:t}=e,n={platform:"shopify",name:e.name,data:Oo(t)};this.eventDebouncer.addEvent(n,X)}}Js.instance=null;class Qs{constructor(){this.eventDebouncer=qs.getInstance()}static getInstance(){return this.instance||(this.instance=new Qs)}monitor(){const e=this.subscribeEvents.bind(this);ss(window,"load",e,!1)}subscribeEvents(){const e=window.bodlEvents;if(!e)return;const{banner:t,product:n,cart:r,checkout:i}=e,o=(e,t,n)=>{if("object"==typeof e&&"function"==typeof e[t]){const r=e=>this.handleEvent(n,e);e[t](r)}};o(t,"viewed","banner_viewed"),o(n,"searchPerformed","search_submitted"),o(n,"pageViewed","product_viewed"),o(n,"categoryViewed","collection_viewed"),o(r,"viewed","cart_viewed"),o(r,"addItem","product_added_to_cart"),o(r,"removeItem","product_removed_from_cart"),o(i,"checkoutBegin","checkout_started"),o(i,"shippingDetailsProvided","checkout_shipping_info_submitted"),o(i,"paymentDetailsProvided","payment_info_submitted"),o(i,"orderPurchased","checkout_completed")}handleEvent(e,t){const n={name:e,platform:"bigcommerce",data:Oo(t)};this.eventDebouncer.addEvent(n,X)}}Qs.instance=null;const Xs=["password","address","credit","postal","token","phone","mobile","expir","account","email","cardnumber","lastname"],ea=["firstname","lastname","street","fullname","creditcard","postcode","zipcode","city","town","county","cc","cardtype","cardnumber","email","nameoncard"];function ta(e){return ea.some(t=>e===t)||Xs.some(t=>e.indexOf(t)>=0)}function na(e){return"string"!=typeof e?null:e.length?e=function(e){return C.forEach(t=>{e=e.replace(t,"******")}),e}(e=function(e){const t=e[0];if(!("{"===t||"["===t))return e;let n=!1;try{const t=JSON.parse(e);return((e,t,n={depth:10})=>{const r=(e,i)=>{if(!(i>n.depth))for(const n in e)try{const o=t(e,n,e[n]);void 0!==o&&(e[n]=o),null!==e[n]&&"object"==typeof e[n]&&r(e[n],i+1)}catch(e){}};r(e,1)})(t,(e,t)=>{if("string"!=typeof t)return;return ta(t.toLowerCase())?(n=!0,"******"):void 0}),n?Oo(t):e}catch(t){return e}}(e)):e}var ra=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class ia{constructor(){this.contentTypeReadableRegex=new RegExp("text|json|xml|html|graphql|x-www-form-urlencoded|form-data","i");const e=Mo();if(this.initialURLPartsReversed=[],this.hostname="",e&&e.length>0)try{this.hostname=new URL(e).hostname,this.initialURLPartsReversed=this.hostname.split("."),w.test(this.initialURLPartsReversed[0])&&this.initialURLPartsReversed.shift(),this.initialURLPartsReversed.reverse()}catch(e){os.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to determine hostname for initial URL: "+e,!1,A)}this.httpDataCollectionEnabled=!!le().http_data_collection;const t=Wo();this.httpDataAllowedAbsoluteRegex=ia.buildAllowedRegex(t,!0),this.httpDataAllowedRelativeRegex=ia.buildAllowedRegex(t,!1)}static getInstance(){return this.instance||(this.instance=new ia),this.instance}static buildAllowedRegex(e,t){if(!e||!Array.isArray(e))return null;const n=e.map(e=>Go(e).toLowerCase()).filter(e=>{const n=ia.isAbsoluteURL(e);return t?e&&n:e&&!n});return n.length>0?new RegExp(n.join("|")):null}static headersMapFromIterable(e){const t=new Map;for(const n of e)"string"!=typeof n[0]&&(n[0]=String(n[0])),"string"!=typeof n[1]&&(n[1]=String(n[1])),t.set(n[0].toLowerCase(),n[1]);return t}static headersMapFromString(e){const t=new Map;if(!e||"string"!=typeof e)return t;return e.split("\r\n").filter(Boolean).forEach((function(e){const n=e.split(": ");2===n.length&&n[0].length>0&&n[1].length>0&&t.set(n[0].toLowerCase(),n[1])})),t}static getResponseStringFromXHR(e){return ra(this,void 0,void 0,(function*(){var t;if(!e)return null;if(""===e.responseType||"text"===e.responseType)return e.responseText;if(!e.response)return"null";if(null===(t=e.response.documentElement)||void 0===t?void 0:t.innerHTML)return e.response.documentElement.innerHTML;if("function"==typeof e.response.text)return yield e.response.text();if("json"===e.responseType)try{const t=Oo(e.response);return"{}"===t?null:t}catch(e){return os.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to stringify JSON response: "+e,!1,A),null}return null}))}isURLSameDomain(e,t=!1){if("string"!=typeof e||!this.initialURLPartsReversed||this.initialURLPartsReversed.length<1)return!1;let n=t?e:"";if(!t)try{let t=e;e.startsWith("//")&&(t="https:"+e),n=new URL(t).hostname}catch(e){return os.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to determine hostname for request URL: "+e,!1,A),!1}const r=n.split(".");if(r.length<1)return!1;if(w.test(r[0])&&r.shift(),r.reverse(),!t&&r.length<this.initialURLPartsReversed.length)return!1;if(t){const e=r.length>=this.initialURLPartsReversed.length&&this.initialURLPartsReversed.every((e,t)=>e===r[t]),t=r.length<=this.initialURLPartsReversed.length&&r.every((e,t)=>e===this.initialURLPartsReversed[t]);return e||t}return this.initialURLPartsReversed.every((e,t)=>e===r[t])}bundleHTTPData(e,t,n,r,i,o,s){if(!this.isValidRequest(e,o))return null;let a="",c="";this.shouldCollectPayloadForURL(e)&&(a=this.getReasonPayloadIsDropped(t,s)||this.stringFromRequestBody(n,t),c=this.getReasonPayloadIsDropped(r,s)||this.stringFromRequestBody(i,r));const l=t||new Map,u=a||"",d=r||new Map,h=c||"";if(0===l.size&&!u&&0===d.size&&!h)return null;const p=this.restrictPayload(u,e,s),g=this.restrictPayload(h,e,s);return{rqh:wo(this.removePIIHeaders(t)),rqp:p,rsh:wo(this.removePIIHeaders(r)),rsp:g}}isValidRequest(e,t){return!!this.httpDataCollectionEnabled&&!(!t||"string"!=typeof t)}shouldContinueForURL(e){return!!this.httpDataCollectionEnabled&&(!(!e||"string"!=typeof e||!this.initialURLPartsReversed)&&!(ia.isAbsoluteURL(e)&&!this.isURLSameDomain(e)&&!this.shouldCollectPayloadForURL(e)))}static isAbsoluteURL(e){return!(!e||"string"!=typeof e)&&(e.indexOf("://")>0||0===e.indexOf("//"))}shouldCollectPayloadForURL(e){if(!e||"string"!=typeof e)return!1;const t=!!this.httpDataAllowedAbsoluteRegex&&this.httpDataAllowedAbsoluteRegex.test(e.toLowerCase()),n=(!ia.isAbsoluteURL(e)||this.isURLSameDomain(e))&&!!this.httpDataAllowedRelativeRegex&&this.httpDataAllowedRelativeRegex.test(e.toLowerCase());return t||n}restrictPayload(e,t,n){if(!e||!this.shouldCollectPayloadForURL(t))return"null";if("string"!=typeof e)return os.getInstance().postNoibuErrorAndOptionallyDisableClient({msg:"restrictPayload received non string payload",payloadType:typeof e},!1,E),"null";if("null"===e||e.startsWith&&(e.startsWith("Dropped due to length.")||e.startsWith("Dropped due to unsupported type."))||e.indexOf&&(0===e.indexOf("Dropped due to length.")||0===e.indexOf("Dropped due to unsupported type.")))return e;let r=n?262144:65536;return"www.holtrenfrew.com"===this.hostname&&(r=1572864),e.length>r?(vs.getInstance().addHttpDataDropByLength(),"Dropped due to length. Payload length: "+e.length):(vs.getInstance().addHttpDataPayloadCount(),na(e))}contentLengthAcceptable(e,t){let n=t?262144:65536;return"www.holtrenfrew.com"===this.hostname&&(n=1572864),this.contentLength(e)<=n}contentTypeAcceptable(e){const t=e.get("content-type");return!(t&&!this.contentTypeReadableRegex.test(t.toLowerCase()))}getReasonPayloadIsDropped(e,t){if(!(null==e?void 0:e.get))return"";const n=ia.getInstance();return n.contentTypeAcceptable(e)?n.contentLengthAcceptable(e,t)?"":(vs.getInstance().addHttpDataDropByLength(),"Dropped due to length. Payload length: "+n.contentLength(e)):(vs.getInstance().addHttpDataDropByType(),"Dropped due to unsupported type. Payload type: "+e.get("content-type"))}contentLength(e){if(!(null==e?void 0:e.get))return 0;let t=0;const n=e.get("content-length");if(!n)return-1;try{if(t=parseInt(n,10),Number.isNaN(t))return-1}catch(e){return-1}return t}stringFromRequestBody(e,t){if(null==e)return null;try{if(Zo(e)&&t instanceof Map){const n=t.get("content-type");n&&n.toLowerCase().includes("application/x-www-form-urlencoded")&&(e=new URLSearchParams(e))}}catch(e){}try{(e instanceof FormData||e instanceof URLSearchParams)&&(e=Array.from(e.entries()).reduce((e,[t,n])=>(e[t]=this.stringFromRequestBody(n,null),e),{}))}catch(e){}try{const t=e.toString();if(!t.includes("[object"))return t}catch(e){}try{return e.documentElement.innerHTML}catch(e){}try{return Oo(e)}catch(e){os.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to stringify request body: "+e,!1,A)}return null}removePIIHeaders(e){if(!(e instanceof Map))return null;if(!e.size)return e;const t=new Map(e);return t.forEach((e,t,n)=>{y.includes(t.toLowerCase())?n.set(t,"******"):n.set(t,na(e))}),t}}function oa(e){return"number"!=typeof e||(e>=400||e<=0)}class sa{constructor(e,t,n=null){const r=e=>!e||e<0?0:e;this.httpEvent={code:r(e.code),r_time:r(e.r_time),mtd:(e.mtd||"get").toUpperCase(),url:Ao(Vo(e.url))},this.httpData=t,this.gqlError=n}saveHTTPEvent(){if(!this.httpEvent||!Go(this.httpEvent.url))return;vs.getInstance().addHttpEvent();const e=this.httpEvent.code,t=!!this.gqlError;if(this.httpData){const n=vs.getInstance().httpSequenceNumber;if(sa.isSendAllowed(e,n,t)){this.httpData.seq=n,this.httpEvent.seq=n,vs.getInstance().addHttpData();const e={};e[ae]=this.httpData,Ss.getInstance().sendMessage(M,e)}else vs.getInstance().addHttpDataOverLimit()}oa(e)?Es.getInstance().addPageVisitEvent({event:this.httpEvent,occurredAt:new Date(ns(Date.now())).toISOString()},W):qs.getInstance().addEvent(this.httpEvent,W)}static isSendAllowed(e,t,n=!1){const r=oa(e)||n;if(!r){if(t<100)return!0;0}return r&&t<120}}var aa=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};function ca(e){try{const{origin:t}=e,n=new CustomEvent("noibuFrameAttach",{detail:e});window.dispatchEvent(n)}catch(e){}}function la(e){e.forEach(e=>{"childList"===e.type&&e.addedNodes.forEach(e=>{const t=e;if("IFRAME"===t.tagName||"FRAME"===t.tagName){const e=t,{contentWindow:n}=e;n&&ca(n)}})})}function ua(){return aa(this,void 0,void 0,(function*(){yield Io(),function(){try{const e={childList:!0,subtree:!0};new MutationObserver(la).observe(document.body,e)}catch(e){}}();try{for(let e=0;e<window.frames.length;e++){ca(window.frames[e])}}catch(e){}}))}const da=["Click","Change","Input","Submit"];class ha{constructor(){this.subscribers=new Set,this.cancelled=!1}subscribe(e){this.cancelled?e():this.subscribers.add(e)}cancel(){this.cancelled=!0;for(const e of this.subscribers)try{e()}catch(e){}this.subscribers.clear()}assert(){if(this.cancelled)throw new Error("Cancelled.")}}class pa extends Error{constructor(e,t,n,r,i){super(e.message),this.name=this.constructor.name,this.original=e,this.checkId=t||null,this.version=n||null,this.triggerId=r||null,this.assertionId=i||null}}var ga,fa=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};!function(e){e[e.Started=1]="Started",e[e.TriggerCompleted=2]="TriggerCompleted",e[e.AssertionCompleted=3]="AssertionCompleted"}(ga||(ga={}));class ma{get cancelled(){return this.cancellation.cancelled}constructor(e,t,n,r,i,o,s){this.tag=`${t.id}-${Date.now()}`,this.pageVisitId=e,this.check=t,this.watcher=n,this.dispatcher=r,this.cancellation=i,this.inputManager=o,this.logger=s}start(){return fa(this,void 0,void 0,(function*(){const e=this.logger.tag(this.tag,this.logger.log);try{this.submitStatus(ga.Started),yield this.waitTriggers(e),this.submitStatus(ga.TriggerCompleted),yield this.waitAssertions(e),this.submitStatus(ga.AssertionCompleted)}catch(t){throw e(`Check failed. ${t} Stack: ${t.stack}`),t}}))}cancel(){return fa(this,void 0,void 0,(function*(){this.logger.tag(this.tag,this.logger.log)("Cancel."),this.cancellation.cancel()}))}waitTriggers(e){return fa(this,void 0,void 0,(function*(){const t=this.check.triggers.map(t=>this.waitTriggerSafely(t,e));yield Promise.all(t),this.cancellation.assert()}))}waitAssertions(e){return fa(this,void 0,void 0,(function*(){const t=this.check.assertions.map(t=>this.waitAssertionSafely(t,e));yield Promise.all(t),this.cancellation.assert()}))}waitTriggerSafely(e,t){return fa(this,void 0,void 0,(function*(){try{yield this.waitTrigger(e,t)}catch(t){throw new pa(t,this.check.id,this.check.version,e.id,null)}}))}waitAssertionSafely(e,t){return fa(this,void 0,void 0,(function*(){try{yield this.waitAssertion(e,window.document.body,t)}catch(t){throw new pa(t,this.check.id,this.check.version,null,e.id)}}))}waitTrigger(e,t){return fa(this,void 0,void 0,(function*(){(t=this.logger.tag(e.id,t))("Wait trigger",e);const n=e.trigger_type,r=e.element_selector;switch(n){case"PageLoad":yield this.waitPageLoadEvent(e.trigger_value,t);break;case"Click":yield this.waitCommonElementEvent("click",r);break;case"Input":yield this.waitCommonElementEvent("input",r);break;case"Submit":yield this.waitCommonElementEvent("submit",r);break;case"Change":{const t=e.trigger_value;yield this.waitChangeEvent(r,t);break}default:throw new Error(`Trigger type "${n}" is not supported.`)}}))}waitAssertion(e,t,n){return fa(this,void 0,void 0,(function*(){(n=this.logger.tag(e.id,n))("Wait assertion",e);const r=e.assertion_type,i=e.element_selector,o=e.assertion_value,{timeout:s,text:a,group:c}=o;let l=!1;try{switch(r){case"ElementExists":{const e=yield this.waitElement(t,i,a,s,n);c&&(yield this.assertGroup(e,c,n));break}case"TextExists":yield this.waitText(t,a,s,n);break;default:l=!0}}catch(e){if(o.negated)return;throw e}if(l)throw new Error(`Assertion type "${r}" is not supported.`);if(o.negated)throw new Error("Assertion failed (negated).")}))}waitElement(e,t,n,r,i){return fa(this,void 0,void 0,(function*(){const o=us(t);return this.waitElementBySelector(e,o,n,r,i)}))}waitText(e,t,n,r){return fa(this,void 0,void 0,(function*(){return this.waitElementBySelector(e,null,t,n,r)}))}waitElementBySelector(e,t,n,r,i){return fa(this,void 0,void 0,(function*(){return as(e,t,null==n?void 0:n.content,null==n?void 0:n.regex,r,this.watcher,this.cancellation,i)}))}assertGroup(e,t,n){return fa(this,void 0,void 0,(function*(){const r=us(t.element_selector),i=[...e.querySelectorAll(r)];let{max:o,min:s}=t;if(-1===o&&(o=Number.MAX_SAFE_INTEGER),-1===s&&(s=Number.MAX_SAFE_INTEGER),i.length>o)throw new Error("The maximum number of elements has been exceeded.");if(i.length<s)throw new Error("The minimum number of elements has not been met.");let a=Date.now();const c=[];for(const e of i)for(const r of t.items){r.id=a+=1,r.assertion_value.timeout=0;const t=this.waitAssertion(r,e,n);c.push(t)}yield Promise.all(c)}))}waitPageLoadEvent(e,t){return fa(this,void 0,void 0,(function*(){return new Promise(n=>{Io().then(()=>{(null==e?void 0:e.text)&&(e.text.content||e.text.regex)?as(window.document.body,null,e.text.content,e.text.regex,0,this.watcher,this.cancellation,t).then(()=>e.negated?null:n()).catch(()=>e.negated?n():null):n()})})}))}waitCommonElementEvent(e,t){return fa(this,void 0,void 0,(function*(){const n=us(t);yield new Promise((t,r)=>{const i=r=>{const o=r.target.closest(n);o&&(this.dispatcher.unsubscribe(e,i),t(o))};this.cancellation.subscribe(()=>{this.dispatcher.unsubscribe(e,i);const t=new Error("Waiting click has been cancelled.");r(t)}),this.dispatcher.subscribe(e,i)})}))}waitChangeEvent(e,t){return fa(this,void 0,void 0,(function*(){const n=us(e);yield new Promise((e,r)=>{const i=r=>{var o;const s=r.target;if(!s.matches(n))return;if(void 0!==s.value&&(null===(o=null==t?void 0:t.ignore_value)||void 0===o?void 0:o.length)){const e=t.ignore_value;if(e.includes(s.value))return;if("SELECT"===s.tagName){const t=s,{text:n}=t.options[t.selectedIndex];if(e.includes(n))return}}this.dispatcher.unsubscribe("change",i),e(!0)};this.cancellation.subscribe(()=>{this.dispatcher.unsubscribe("change",i);const e=new Error("Waiting change has been cancelled.");r(e)}),this.dispatcher.subscribe("change",i)})}))}submitStatus(e){}}class va{constructor(){this.entries=[]}tag(e,t){return(n,r)=>{n=`[${e}] ${n}`,t.call(this,n,r)}}log(e,t){let n=`${Date.now()}: ${e}`;t&&(n+=` ${Oo(t)}.`),this.entries.push(n)}}function ya(e,t,n){return function nbuWrapper(r,i,o){t.call(e,r,i,o);try{n(r,i,o)}catch(e){}}}var ba=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class Ia{static create(e,t,n,r,i=null,o=null){const s=Ia.fetchTest(),a=ds();return Ia.isConfigValid(s,a)?new Ia(e,t,n,r,s,a,i,o):null}constructor(e,t,n,r,i,o,s=null,a=null){this.activeCheckers=new Map,this.test=i,this.pageGroups=o,this.watcher=e,this.dispatcher=t,this.clientConfig=n,this.inputManager=r,this.startCallback=s,this.resultCallback=a}start(){window.setTimeout(()=>{Ia.normalizeTest(this.test),this.patchHistoryApi(),this.startChecks()})}patchHistoryApi(){const e=this.handleNavigationChange.bind(this);!function(e,t){const{history:n}=window;try{Co(n,"pushState",t=>ya(n,t,e)),Co(n,"replaceState",e=>ya(n,e,t))}catch(e){}}(e,e)}startChecks(){for(const e of this.test.checks)this.startCheckIfApplicable(e)}startCheckIfApplicable(e){const t=new va;if(this.startCallback&&this.startCallback(e,t.entries),this.isCheckApplicable(e,t)){const n=this.activeCheckers.get(e);if(n&&!n.cancelled)return;this.startCheck(e,t)}}isCheckApplicable(e,t){const n=t.tag(""+e.id,t.log);n("Start page group validation.");const r=e.page_group_id,i=this.pageGroups[r];if(!i)return n("Page group not found (no matching id)."),!1;if(i.url_regex){if(!gs(i.url_regex))return n("Page group not found (no matching url regexp)."),!1}else if(i.urls){const e=hs();if(!i.urls.some(t=>e.includes(t)))return n("Page group not found (no matching urls)."),!1}if(i.element_selector){const e=us(i.element_selector);if(!window.document.querySelector(e))return n("Page group not found (no matching element selector)."),!1}return n("Found page group."),!0}startCheck(e,t){return ba(this,void 0,void 0,(function*(){let n=null;const r=new ha,i=new ma(this.clientConfig.pageVisitId,e,this.watcher,this.dispatcher,r,this.inputManager,t);this.activeCheckers.set(e,i);try{yield i.start()}catch(e){n=e}if(this.activeCheckers.delete(e),!i.cancelled){const r=null===n;this.submitResult(r,e,n,t),r||this.submitError(n,t)}Ia.isCheckRestartRequired(e)&&window.setTimeout(()=>this.startCheckIfApplicable(e))}))}handleNavigationChange(){for(const[e,t]of this.activeCheckers){this.isCheckApplicable(e,t.logger)||t.cancelled||t.cancel()}this.startChecks()}submitResult(e,t,n,r){const i=r.tag(""+t.id,r.log),o=(null==n?void 0:n.triggerId)||"0",s=(null==n?void 0:n.assertionId)||"0",a=e?"Pass":"Fail",c=this.clientConfig.pageVisitId,l=`PageCheckResult-${a}-${t.id}-${t.version}-${c}-${o}-${s}`;i("Page check result success: "+e),this.resultCallback&&this.resultCallback(l,e,r.entries)}submitError(e,t){const n=t.entries,{checkId:r,version:i,triggerId:o,assertionId:s}=e;$s(Ee,{checkId:r,version:i,triggerId:o,assertionId:s,log:n})}static fetchTest(){return le().page_checks||null}static isConfigValid(e,t){return null!==e&&null!==t}static isCheckRestartRequired(e){const{triggers:t}=e;return t.find(({trigger_type:e})=>{return t=e,da.includes(t);var t})}static normalizeTest(e){const t=e=>null!==e&&"object"==typeof e&&0===Object.keys(e).length;for(const n of e.checks){for(const e of n.triggers)t(e.trigger_value)&&(e.trigger_value=null),t(e.element_selector)&&(e.element_selector=null);for(const e of n.assertions)null===e.assertion_value&&(e.assertion_value={}),"number"!=typeof e.assertion_value.timeout&&(e.assertion_value.timeout=20),t(e.element_selector)&&(e.element_selector=null)}}}var Ca=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class wa{constructor(e,t,n,r,i=null){this.reportedSnippets=new Set,this.reportedErrors=new Set,this.handleMutationCallback=this.handleMutation.bind(this),this.handleIdleCallback=this.handleIdle.bind(this),this.supportIdleRequest="function"==typeof window.requestIdleCallback,this.idleRequestOptions={timeout:3e3},this.watcher=e,this.clientConfig=t,this.pageVisit=n,this.stopWordDictionary=r,this.resultCallback=i}start(){this.watcher.subscribe(this.handleMutationCallback),window.setTimeout(this.handleMutationCallback)}handleMutation(){this.supportIdleRequest?window.requestIdleCallback(this.handleIdleCallback,this.idleRequestOptions):this.search()}handleIdle(){this.search()}search(){let e=null;try{const t=wa.getVisiblePageContent();e=wa.searchMatches(t,this.stopWordDictionary)}catch(e){this.collectError(e)}if(null!==e){let t=null;for(const n of e)this.reportedSnippets.has(n.snippet)||(this.reportedSnippets.add(n.snippet),t=t||[],t.push(n));null!==t&&this.sendEvent(t)}}static searchMatches(e,t){if(!e)return null;let n=null;for(const r of t.values){let t=0,i=0;for(;i<10&&(i+=1,t=e.lower.indexOf(r.value,t),-1!==t);){const i=t;t+=1;if(!wa.isWord(e.lower,i,i+r.value.length-1))continue;n=n||[];const o=wa.searchSnippet(e.original,i,r.value.length);if(wa.validateSnippet(o,r)){const e={stopWord:r.value,snippet:o,start:i,end:i+r.value.length};n.push(e)}}}return n}static searchSnippet(e,t,n){const r=t+n-1,i=wa.searchSnippetIndex(e,t,-1),o=wa.searchSnippetIndex(e,r,1)+1;return e.slice(i,o).trim()}static searchSnippetIndex(e,t,n){let r=0,i=0;for(;i<70;){i+=1;const o=e[t+n];if(void 0===o||wa.snippetSeparators.has(o)){r=0;break}""===o.trim()&&(r=t),t+=n}return 0!==r&&(t=r),t}static validateSnippet(e,t){if(e=e.toLowerCase(),t.exclude)for(const n of t.exclude)if(e.includes(n))return!1;if(!t.include)return!0;for(const n of t.include)if(e.includes(n))return!0;return!1}static isWord(e,t,n){let r,i=!1,o=!1;return t>0&&(r=e[t-1],i=wa.isWordRegExp.test(r)),n<e.length-1&&(r=e[n+1],o=wa.isWordRegExp.test(r)),!i&&!o}sendEvent(e){return Ca(this,void 0,void 0,(function*(){const t={text:{dictionaryVersion:this.stopWordDictionary.version,lang:this.stopWordDictionary.lang,matches:e},performance:null},n={event:t,occurredAt:new Date(ns(Date.now())).toISOString()};this.pageVisit.addPageVisitEvent(n,te),this.resultCallback&&this.resultCallback(t)}))}collectError(e){const t=""+e;this.reportedErrors.has(t)||(this.reportedErrors.add(t),this.clientConfig.postNoibuErrorAndOptionallyDisableClient(t,!1,E))}static getVisiblePageContent(){var e,t;let n=null===(t=null===(e=window.document)||void 0===e?void 0:e.body)||void 0===t?void 0:t.innerText;if(!n)return null;n=wa.removeFragmentsToIgnore(n);const r=n.toLowerCase();return{original:n,lower:r}}static removeFragmentsToIgnore(e){const t=wa.getFragmentsToIgnore();if(null===t)return e;for(const n of t)e=e.replace(n,"");return e}static getFragmentsToIgnore(){const e=document.querySelectorAll(wa.fragmentToIgnoreSelector);if(0===e.length)return null;const t=[];return e.forEach(e=>{const n=null==e?void 0:e.innerText;n&&t.push(n)}),t}}wa.snippetSeparators=new Set([".","!","?","\n"]),wa.isWordRegExp=/\w/,wa.fragmentToIgnoreSelector='[class*="review"], [id*="review"], [class*="footer"], [id*="footer"], nav ';class Sa{constructor(e){this.subscribers=new Map,this.window=e}subscribe(e,t){let n=this.subscribers.get(e);n||(n=this.registerEvent(e)),n.add(t)}unsubscribe(e,t){const n=this.subscribers.get(e);n&&n.delete(t)}registerEvent(e){window.addEventListener(e,t=>this.nofity(e,t),{capture:!0});const t=new Set;return this.subscribers.set(e,t),t}nofity(e,t){const n=this.subscribers.get(e);for(const e of n)try{e(t)}catch(e){}}}class Ea{constructor(e){this.subscribers=new Set,this.observer=null,this.mutated=!1,this.window=e}start(){this.observer=new MutationObserver(this.handleMutation.bind(this)),this.observer.observe(this.window.document,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]})}stop(){this.observer.disconnect(),this.observer=null}subscribe(e){null===this.observer&&this.start(),this.subscribers.add(e)}unsubscribe(e){this.subscribers.delete(e)}handleMutation(){this.mutated||(this.mutated=!0,this.window.setTimeout(()=>{this.mutated=!1,this.nofity()},Ea.notificationTimeThreshold))}nofity(){for(const e of this.subscribers)try{e()}catch(e){}}}function Aa(){const e=new Ea(window),t=new Sa(window),n=os.getInstance(),r=Ys.getInstance(),i=Es.getInstance(),o=Ia.create(e,t,n,r);o&&o.start();const s=ka();new wa(e,n,i,s).start(),function(e,t,n,r){window.addEventListener("noibuPageCheckValidationRequest",i=>{const{pageGroups:o,test:s}=i.detail;new Ia(e,t,n,r,s,o,(e,t)=>{const n=new CustomEvent("noibuPageCheckValidationResponse",{detail:{check:e,logs:t}});window.dispatchEvent(n)}).start()})}(e,t,n,r)}function ka(e){var t,n;const r=(null===(n=null===(t=window.document)||void 0===t?void 0:t.documentElement)||void 0===n?void 0:n.lang)||"en",i=e||function(e){try{return new Intl.Locale(e).language}catch(e){return null}}(r)||"en",o=i in Ta.values?i:"en",s=Ta.values[o];return{version:Ta.version,lang:o,values:s}}Ea.notificationTimeThreshold=1e3;const Ta={version:5,values:{en:[{value:"error",include:["application","validation","login","password","payment","transaction","registration","checkout","shipping","order","network","database","connection","server","configuration","security","format","fulfillment","json","code","unexpected","referenceerror","typeerror","syntaxerror","rangeerror","typeerror","urierror","securityerror","quotaexceedederror","evalerror"],exclude:["design with no error codes","no need to worry"]},{value:"fail",include:["create","update","delete","remove","send","receive","validation","login","password","payment","transaction","registration","checkout","shipping","order","network","database","connection","server"]},{value:"unable",include:["create","update","delete","remove","send","receive","load","save","process","connect","complete","verify","retrieve"]},{value:"unavailable",include:["system","service","resource","page","product","feature","payment","shipping"]},{value:"invalid",include:["credentials","payment","parameters","request","file","data","information","address","email","login","password","field","form","card number"]},{value:"exception",include:["database","payment","inventory","shipping","checkout","configuration","session","unexpected","overflow","memory"]},{value:"timeout",include:["operation","gateway","server","service","network","connection","session","payment","request","transaction","database"]},{value:"expired",include:["session","coupon","payment","offer","token","subscription","license"]},{value:"refused",include:["payment","transaction","connection","access","service","order"]},{value:"denied",include:["access","permission","login","authentication","service","request","order"]},{value:"declined",include:["payment","transaction","access","card","request","authorization"]},{value:"blocked",include:["access","account","payment","transaction","content","service"]},{value:"miss",include:["information","payment","required","credential","parameters"]},{value:"inaccessible",include:["service","server","page","system","resource","content","feature","account"]},{value:"overload",include:["system","service","server","network","database","checkout"]},{value:"disabled",include:["account","feature","payment","checkout","access","user","service"],exclude:["“disabled access”"]},{value:"not permitted",include:["action","access","transaction","modification","upload","download","registration"]},{value:"already exist",include:["user","email","file","account","record","process","entry"]},{value:"server",include:["overload","not found","address"]},{value:"maintenance",include:["server","system","under","down","scheduled"]},{value:"connection",include:["timed out","timedout","refused","lost","reset","denied"]},{value:"crash",exclude:["course","courses","door crasher"]},{value:"not supported",include:["browser","payment","shipping","feature","file","language","currency","version","device","protocol","operation"]},{value:"unsupported",include:["browser","payment","shipping","feature","file","language","currency","version","device","protocol","operation"]},{value:"undefined"},{value:"[object object]"},{value:"addeventlistener"},{value:"400 bad request"},{value:"401 unauthorized"},{value:"403 forbidden"},{value:"404 not found"},{value:"405 method not allowed"},{value:"500 internal server error"},{value:"502 bad gateway"},{value:"503 service unavailable"},{value:"504 gateway timeout"},{value:"went wrong"},{value:"not found"},{value:"check your internet"},{value:"try later"},{value:"try again"},{value:"terminated"},{value:"exceeded",exclude:["my expectation","my expectations"]},{value:"corrupt",exclude:["jeans"]},{value:"disconnected"},{value:"unresponsive"},{value:"violation",exclude:["copyright"]},{value:"execution rights"},{value:"out of memory"},{value:"transaction rollback"},{value:"disk space exhausted"},{value:"protocol version"},{value:"doesn't exist"},{value:"has already been used"},{value:"choose a different delivery address"},{value:"no longer available"},{value:"can't be shipped"},{value:"no payment methods available"},{value:"enter a valid email"},{value:"more than what's in stock"},{value:"fill in the required"},{value:"is incorrect"},{value:"isn't valid"},{value:"is not valid"},{value:"coupon is not valid"},{value:"does not exist"},{value:"not authorized"},{value:"account is suspended"},{value:"no longer valid"},{value:"deactivated"},{value:"already in use"},{value:"sqlstate"},{value:"foreign key constraint"},{value:"is not defined"},{value:"no such entity"},{value:"more permissions"},{value:"duplicate entry"},{value:"account is locked"},{value:"api call"},{value:"module not enabled"},{value:"token has expired"},{value:"php extension"},{value:"security reasons"},{value:"file exceeds"},{value:"technical difficulties"},{value:"not allowed to access"},{value:"ssl certificate"},{value:"csrf token"},{value:"memory limit"},{value:"theme registry"},{value:"Current customer does not have an active cart"},{value:"link you selected is expired"}]}};var _a=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class Ra{static getInstance(){return Ra.instance||(Ra.instance=new Ra),Ra.instance}constructor(){this.incomingErrorBuffer=[],this.confirmedErrorBuffer=[],this.processedUrls=new Set,this.incomingErrorBufferTimeoutId=0,this.processing=!1,this.terminated=!1,"function"==typeof window.fetch?this.nativeFetch=window.fetch.bind(window):this.terminated=!0}monitor(){const e=window;ss(e,"error",t=>this.handleError(t,e),!0)}terminate(){this.terminated=!0,this.incomingErrorBuffer.splice(0,this.incomingErrorBuffer.length),this.confirmedErrorBuffer.splice(0,this.confirmedErrorBuffer.length),this.processedUrls.clear(),window.clearTimeout(this.incomingErrorBufferTimeoutId)}handleError(e,t){if(this.terminated)return;const n=this.createErrorContext(e,t);null!==n&&(this.incomingErrorBuffer.push(n),this.scheduleErrorProcessing())}scheduleErrorProcessing(){window.clearTimeout(this.incomingErrorBufferTimeoutId),this.incomingErrorBufferTimeoutId=window.setTimeout(()=>this.processErrors(),Ra.incomingErrorBufferTimeout)}processErrors(){return _a(this,void 0,void 0,(function*(){if(!this.terminated&&!this.processing){this.processing=!0;try{for(;this.incomingErrorBuffer.length;){if(this.checkIncomingErrorBufferOverflow())return;const e=this.incomingErrorBuffer.shift();(yield this.executeConfirmation(e))&&this.confirmedErrorBuffer.push(e)}for(;this.confirmedErrorBuffer.length;){const e=this.confirmedErrorBuffer.shift();this.submitError(e)}}finally{this.processing=!1}}}))}checkIncomingErrorBufferOverflow(){const e=this.incomingErrorBuffer.length>=Ra.incomingErrorBufferOverflowLimit;return e&&this.terminate(),e}executeConfirmation(e){return _a(this,void 0,void 0,(function*(){const{url:t}=e.request,n=Ra.confirmationRequestTimeout;if(e.originalResponse=yield this.executeRequest(t,null,n),Ra.isErrorConfirmed(e.originalResponse))return!0;if(e.originalResponse.cors){const r=encodeURIComponent(t),i=Ra.proxyUrl+"/?"+r,o=new Headers({"X-Upstream-URL":t});if(e.proxyResponse=yield this.executeRequest(i,o,n),Ra.isErrorConfirmed(e.proxyResponse))return!0}return!1}))}executeRequest(e,t,n){return _a(this,void 0,void 0,(function*(){const r=new AbortController,{signal:i}=r,o={method:"HEAD",headers:t,signal:i},s=window.setTimeout(()=>r.abort(),n),a={ok:!1,status:0,contentType:null,error:null,timeout:!1,cors:!1};try{const t=yield this.nativeFetch(e,o);a.ok=t.ok,a.status=t.status,a.contentType=t.headers.get("content-type")}catch(e){const t="AbortError"===e.name,n=e instanceof TypeError;a.timeout=t,a.cors=n,a.error=""+e}finally{window.clearTimeout(s)}return a}))}submitError(e){const{tagName:t,id:n,alt:r,title:i,width:o,height:s}=e.image,a=e.request.url,{timestamp:c,originalResponse:l,proxyResponse:u}=e;$s("ImageError",{tag_name:t,id:n||null,src:a,detail:Oo({alt:r,title:i,width:o,height:s,originalResponse:l,proxyResponse:u})},void 0,c)}createErrorContext(e,t){const{isTrusted:n,target:r}=e;if(!(n&&r instanceof HTMLImageElement))return null;const i=r,{width:o,height:s,src:a,baseURI:c}=i;if(o<=1||s<=1||!a)return null;let l=a.toLowerCase();if(l.startsWith("//")&&(l=t.location.protocol+l),!l.startsWith("http"))return null;if(Ra.areUrlsEqual(l,c))return null;if(this.processedUrls.has(l))return null;this.processedUrls.add(l);const u={tagName:i.tagName,alt:i.alt,id:i.id,src:i.src,title:i.title,width:i.width,height:i.height},d={url:i.src};return{timestamp:Date.now(),image:u,request:d,originalResponse:null,proxyResponse:null}}static isErrorConfirmed(e){if(e.status>=400)return!0;if(e.contentType){const t=e.contentType.startsWith("image");if(e.ok&&!t)return!0}return!1}static areUrlsEqual(e,t){try{const n=new URL(e.toLowerCase()),r=new URL(t.toLowerCase());return n.origin===r.origin&&n.pathname===r.pathname&&n.search===r.search}catch(e){return!1}}}Ra.proxyUrl="https://resource-proxy.noibu.com",Ra.confirmationRequestTimeout=5e3,Ra.incomingErrorBufferTimeout=3e3,Ra.incomingErrorBufferOverflowLimit=5;class Ma{static getInstance(){return Ma.instance||(Ma.instance=new Ma),Ma.instance}monitor(e){if(e&&e.length>0)return;const t=setInterval(()=>{const e=document.title;e&&e.length>0&&(this.handler(e),clearInterval(t))},100);setTimeout(()=>{this.clear(t)},5e3)}clear(e){clearInterval(e)}handler(e){const t={url:Mo(),page_title:e,page_groups:ms(),ref_url:window.document.referrer?Ao(window.document.referrer):""};qs.getInstance().addEvent(t,ne)}}class Na{static getInstance(...e){return Na.instances.has(this)||Na.instances.set(this,new this(...null!=e?e:[])),Na.instances.get(this)}destroy(){}static resetInstances(){Na.instances.forEach(e=>{e.destroy()}),Na.instances.clear()}}Na.instances=new Map;class xa extends Na{monitor(){this._monitor(window),ss(window,"noibuFrameAttach",e=>{const t=e.detail;this._monitor(t)})}_monitor(e){ss(e,"input",this._handle.bind(this))}getPayload(e){const{target:t}=e,n=t,r=n.placeholder||n.name||n.id,i=Po(n),o=Fo(n);return{[L]:"",[D]:r,[x]:n.tagName?n.tagName.toLowerCase():"",[O]:o,[N]:$,[P]:Vo(i)}}isValid(e){const{target:t}=e,n=t;return("INPUT"===n.tagName||"TEXTAREA"===n.tagName)&&!!(n.placeholder||n.name||n.id)}_handle(e){this.isValid(e)&&qs.getInstance().addEvent(this.getPayload(e),$)}}const La=["\\b(view|add|my)\\b.*\\b(cart|bag|basket|bucket|box)\\b","\\b(buy now)\\b","^backorder$","\\b(acquista ora)\\b","\\b(buy this)\\b","\\b(ajouter|mon)\\b.*\\b(panier)\\b","\\b(aggiungi)\\b.*\\b(cart|borsa|carrello)\\b","^ajouter à la shopping bag$","^aggiungi$","^aggiungi alla shopping bag$","\\b(warenkorb)\\b","(^kaufen$)","^купить$","\\b(agregar)\\b.*\\b(carrito)\\b","\\b(adicionar)\\b.*\\b(carrinho)\\b","^carrinho$","^añadir al carrito de compras$","(^añadir al carrito$)","(add another)","(in winkelmand)","(sepete ekle)","(Lagg I Varukorgen)","(ΠΡΟΣΘΗΚΗ ΣΤΟ ΚΑΛΑΘΙ)","(Lägg i varukorgen)","(Köp)","(カートに追加)","^添加至购物袋$","^购买$","^購入する$","(أضف الى السلة)"],Da=["(paypal)","(checkout|payment|check out)","(l.?achat|règlement|paiement|la commande)","(passer).*(commande)","valider mon panier","(acheter maintenant)","^caisse$","(gå vidare till kassan)","(cassa|acquisto)","^vai alla cassa$","^procedi all.?acquisto$","^procedi al checkout$","^siguiente$","(kasse)","^zur kasse gehen$","^bezahlen$","^weiter zum checkout$","(comprar ahora)","^comprar$","(prosseguir com a compra)","^pasar por la caja$","^afrekenen$","^compre$","(continue to pay)","(naar de kassa)","Перейти к оформлению заказа","^купить сейчас$","^bestellen$","(Alışverişi Tamamla)","^Till kassan$","(チェックアウトに進む)","^去结算$","^付款。$","^お支払い$","(تاكيد الطلب)"],Oa=["(checkout|continue) (with paypal)","^continue to paypal$","^weiter zu paypal$","^continue to afterpay$","^braintree_paypal$","^pay and place order$","^mit paypal bezahlen$","^continue to payment securely$","(continua su paypal)","(apple pay|applepay)","(amazon pay|amazonpay|continue with amazon)","(sezzlepay)","(place order)","(place your order)","(order confirmation)","(complete purchase)","submit.*order","(pay now)","(^pay it now$)","(make payment)","(^make payment$)","(complete order)","^complete your order$","(fazer pedido)","^encomendar$","((realizar) (pedido|pago))","^finalizar compra$","^pagar$","^jetzt kaufen$","^bestellung aufgeben$","^bestellung prüfen$","^auftragsbestätigung$","^bestelling plaatsen$","^passer la commande$","(je confirme et je paye)","(accéder au paiement)","^passer au paiement$","(Valider et continuer)","^valider la commande$","(^passez la commande$)","^invia ordine$","(effettua ordine)","^effettua l.?ordine$","(conferma acquisto)","^conferma l.?acquisto$","^confirmation de commande$","^confirma l.?ordine$","^conferma l.?ordine$","^conferma ordine$","(SİPARİŞİ TAMAMLA)","^Разместить заказ$","(Slutför köp)","(注文する)","(إنشاء الطلب)","(注文を確定)","^お支払いへ進む$","^确认下单$"];function Pa(e){if(!(e instanceof Element))return{target:null,selector:null};let t=e,n=[],r=!1;for(;e&&e.nodeType===Node.ELEMENT_NODE;){const{id:i,tagName:o,classList:s,parentNode:a}=e;if(!r&&Ua(e)&&(t=e,n.splice(0,n.length),r=!0),Wa(i)){const t="#"+i;if(Ba(t,e)){n.push(t);break}}let c=o.toLowerCase();if("html"!==c&&"body"!==c){const t=Array.from(s).filter(Wa);t.length>0&&(c+="."+t.join("."));c+=`:nth-of-type(${Va(e)+1})`}n.push(c),e=a}n=function(e,t){const n=[];for(const r of t){n.push(r);const t=Fa(n);if(Ba(t,e))break}return n}(t,n);return{target:t,selector:Fa(n)}}function Fa(e){return(e=[...e]).length?e.reverse().join(" > "):null}function Va(e){let t=0;for(let n=e.previousElementSibling;null!==n;n=n.previousElementSibling)n.tagName===e.tagName&&(t+=1);return t}function Ua(e){const t=e.tagName.toLowerCase();return!!qa.includes(t)||"button"===e.getAttribute("role")}function Wa(e){if(!e)return!1;if(!Ha.test(e))return!1;if(Ga.some(t=>e.toLowerCase().indexOf(t)>=0))return!1;return!/\d/.test(e)}function Ba(e,t){const n=document.querySelectorAll(e);return 1===n.length&&n[0]===t}const Ha=/^[a-zA-Z_-][a-zA-Z0-9_-]*$/,qa=["svg","li","label"],Ga=["load","active","fixed","visible","focus","show","collaps","animat"];class ja extends Na{constructor(){super(),this.textCapturedWhiteListRegex=new RegExp(La.concat(Da).concat(Oa).join("|"),"i"),this.htmlIDWhiteListRegex=new RegExp("method|finance|sagepay|cart|bag|coupon|affirm|karna|sezzle|button","i"),this.blockedSelector=null,this.blockedSelector=ja.createBlockedSelector()}static createBlockedSelector(){let e;try{e=Bo(),window.document.querySelector(e)}catch(t){e=null;os.getInstance().postNoibuErrorAndOptionallyDisableClient("Failed to parse selector: "+t,!1,E)}return e}monitorClicks(){this._monitor(window),ss(window,"noibuFrameAttach",e=>{const t=e.detail;this._monitor(t)})}_monitor(e){ss(e,"click",this._onClickHandle.bind(this),!0)}_onClickHandle(e){this.isValid(e)&&(vs.getInstance().addPvClick(),Es.getInstance().addPageVisitEvents([{event:this.getPayload(e),occurredAt:new Date(ns(Date.now())).toISOString()}],j))}isValid(e){return!!e.target}getPayload(e){const t=e.target,n=t,r=t.src||"",i=n.tagName?n.tagName.toLowerCase():"",o=Po(n),s=Fo(n),a=this.getElementText(i,t,s),c=function(e){try{const{selector:t}=Pa(e);return t}catch(e){return null}}(n);let l=0,u=0;try{const{documentElement:e}=window.document;l=e.scrollWidth,u=e.scrollHeight}catch(e){}return{[L]:r,[D]:a,[x]:i,[O]:s,[N]:Z,[P]:Vo(o),selector:c,x:Math.trunc(e.pageX||0),y:Math.trunc(e.pageY||0),w:l,h:u}}getElementText(e,t,n){if(null===this.blockedSelector)return"*";let r="";if("img"===e?t.alt&&(r=t.alt):r=this._getContainedText(t,!0),!this.textCapturedWhiteListRegex.test(r)&&!this.htmlIDWhiteListRegex.test(n))if("input"===e){if(!Ge.some(n=>n(e,t)))return"*"}else if("textarea"===e)return"*";return function(e){return e.replace(I,"******").replace(b,"*")}(ja.cutoffText(ja.trimSpaces(r)))}_getContainedText(e,t){let n=this._parseInnerContent(e);if(t){const t=e.tagName?e.tagName.toLowerCase():"";if(""===n)n=this._parseTextFromParentElement(e);else if("select"===t){const t=n;n=this._parseTextFromParentElement(e),n=n.replace(t,"")}}return n}_parseInnerContent(e,t="",n={v:0}){const r=e,i=e;if(t.length>=100||n.v>=100)return t;if(n.v+=1,i&&"function"==typeof i.matches&&i.matches(this.blockedSelector))return t?t+" *":"*";e.nodeType===Node.TEXT_NODE&&(t=this._parseAndAppendText(t,[e.textContent]));let o=!0;if(e.nodeType===Node.ELEMENT_NODE){if(Mo().includes("hannaandersson")){const t=t=>t(i.tagName.toLowerCase(),e);if(!Ge.some(t))return"*"}if(ta((r.type||"").toLowerCase())||ta((r.title||"").toLowerCase()))return this._parseAndAppendText(t,["*"]);0===e.childNodes.length&&(t=this._parseAndAppendText(t,[r.value,r.title])),1===e.childNodes.length&&e.childNodes[0].nodeType===Node.TEXT_NODE&&(o=!1,t=this._parseAndAppendText(t,[e.textContent,r.value,r.title]))}if(o)for(const r of e.childNodes)t=this._parseInnerContent(r,t,n);return t}_parseAndAppendText(e,t){if(e.length>=100)return e;const n=t.filter(e=>Number.isFinite(e)||"string"==typeof e).map(e=>ja.trimSpaces(e)).filter(e=>e.length>0).slice(0,1).join("");return e?`${e} ${n}`:n}static trimSpaces(e){return Go(e).replace(/\s+/g," ")}static cutoffText(e){if(e.length>100){const t=e.lastIndexOf(" ",100-"...".length);return t>0?e.substring(0,t)+"...":"..."}return e}_parseTextFromParentElement(e){let t=e;const n=[];let r=0;for(;t&&!(r>=5)&&t.parentNode;)t=t.parentNode,n.push(t),r+=1;for(let e=0;e<n.length;e+=1){const t=n[e];if(t&&"BUTTON"===t.tagName)return this._getContainedText(t,!1)}return""}}class za{constructor(){this.processedResourceKeys=new Set,this.allowedResourceKeys=new Set(["inline","eval","wasm-eval","trusted-types-policy","trusted-types-sink"])}static getInstance(){return this.instance||(this.instance=new za),this.instance}monitor(){const e=this.handle.bind(this);ss(window,"securitypolicyviolation",e,!0)}handle(e){if("report"===e.disposition)return;const t=this.getResourceKey(e.blockedURI);if(!t||this.processedResourceKeys.has(t))return;this.processedResourceKeys.add(t);const{blockedURI:n,violatedDirective:r}=e;$s("CSPError",{blocked_uri:n,violated_directive:r,original_policy:null})}getResourceKey(e){try{const t=new URL(e),{hostname:n}=t;if(/^\d{1,3}(\.\d{1,3}){3}$/.test(n))return n;const r=n.split(".");return r.length>=3?r.slice(-3).join("."):n}catch(e){}return this.allowedResourceKeys.has(e)?e:null}}class Za{constructor(){this.debouncedCalls=0}static getInstance(){return this.instance||(this.instance=new Za),this.instance}monitor(){const e=this._onPageEventHandle.bind(this),t=()=>{const t=Qi()(e,1e3,{leading:!0,trailing:!0});return(...e)=>(this.debouncedCalls+=1,t(...e))};xe.forEach(t=>ss(window,t,e,!0)),Le.forEach(e=>ss(window,e,t(),!0)),De.forEach(t=>ss(document,t,e,!0))}_onPageEventHandle(e){if(!e||!e.type)return;const t={type:e.type};switch(e.type){case"visibilitychange":t.data="state: "+this.getDocumentState();break;case"readystatechange":t.data="state: "+document.readyState;break;case"pagehide":case"pageshow":case"load":e.persisted&&(t.data="persisted: "+e.persisted);break;case"storage":e.key&&(t.data="key: "+e.key);break;case"message":case"messageerror":e.data&&e.origin&&(t.data=`origin: ${e.origin} size: ${this.getSizeInBytes(e.data)}`);break;case"hashchange":e.newURL&&(t.data="newURL: "+e.newURL)}this.setDocumentSize(t),qs.getInstance().addEvent(t,J)}getDocumentState(){return"hidden"===document.visibilityState?"hidden":document.hasFocus()?"active":"passive"}getSizeInBytes(e){let t=e;return"string"!=typeof e&&(t=Oo(e)),2*t.length}setDocumentSize(e){const{type:t}=e;if("pageshow"===t||"resize"===t)try{const{documentElement:t}=window.document;e.width=t.scrollWidth,e.height=t.scrollHeight}catch(e){}}}class $a{constructor(){this.submittedMetrics=new Set,this.startedMonitoring=!1,this.onLCP=null,this.onFID=null,this.onCLS=null,this.onFCP=null,this.onINP=null,this.onTTFB=null}static getInstance(){return this.instance||(this.instance=new $a),this.instance}sendMetric(e){var t,n,r;if(!e||!e.name)return;const{name:i,value:o,rating:s}=e;if(this.submittedMetrics.has(i)&&"CLS"!==i)return;this.submittedMetrics.add(i);let{attribution:a}=e;switch(a||(a={}),a.njsSessionStartTime=es.scriptInitializeTime,i){case d.CumulativeLayoutShift:{const e=a;$a.setEventRecorded(e.largestShiftTime,a);break}case d.FirstContentfulPaint:{const e=a;$a.setEventRecorded(null===(t=e.fcpEntry)||void 0===t?void 0:t.startTime,a);break}case d.FirstInputDelay:{const e=a;$a.setEventRecorded(e.eventTime,a);break}case d.InteractionToNextPaint:{a.interactionTargetElement=void 0;const e=a;$a.setEventRecorded(e.interactionTime,a);break}case d.LargestContentfulPaint:{const e=a;$a.setEventRecorded(null===(n=e.lcpEntry)||void 0===n?void 0:n.startTime,a);break}case d.TimeToFirstByte:{const e=a;$a.setEventRecorded(null===(r=e.navigationEntry)||void 0===r?void 0:r.startTime,a);break}}const c={name:i,value:o.toString(),rating:s,attribution:Oo(a)};Es.getInstance().addPageVisitEvent({event:c,occurredAt:new Date(ns(Date.now())).toISOString()},z)}static setEventRecorded(e,t){let n=!1;e&&es.recordingStartTime&&(n=e>es.recordingStartTime,n&&es.recordingStopTime&&(n=e<es.recordingStopTime)),t.rrwebRecorder=n}monitor(){try{if(!$a.isAvailable())return;if(this.startedMonitoring)return;this.startedMonitoring=!0;const e=this.sendMetric.bind(this);this.onLCP(e),this.onFID(e),this.onCLS(e),this.onFCP(e),this.onINP(e),this.onTTFB(e)}catch(e){this.startedMonitoring=!1,os.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in WebVitalMonitor: "+e,!1,E)}}download(){$a.isAvailable()&&(ss(window,"noibuWebVitalsLoaded",e=>{this.setWebVitals(e.detail),this.monitor()}),$o("https://cdn.noibu.com/collect-webvitals.js",null,e=>{os.getInstance().postNoibuErrorAndOptionallyDisableClient("Error loading webvitals script. "+e,!1,E)}))}setWebVitals(e){this.onLCP=e.onLCP,this.onFID=e.onFID,this.onCLS=e.onCLS,this.onFCP=e.onFCP,this.onINP=e.onINP,this.onTTFB=e.onTTFB}static isAvailable(){return"object"==typeof window.performance}}class Ka{static getInstance(){return this.instance||(this.instance=new Ka),this.instance}_safeQueryAll(e,t){let n;try{n=e.querySelectorAll(t)}catch(e){os.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in ElementMonitor: "+e,!1,E)}return n?Array.from(n):[]}_processMatchingElements(e,t){e.forEach(e=>{if(!e)return;const n=e.textContent;n&&Ys.getInstance().addCustomAttribute(t,n)})}_findAndAddMatchingElementsInNodes(e){Object.keys(Ve()).forEach(t=>{const n=Ve()[t];n&&e.forEach(e=>{if(e.nodeType===Node.TEXT_NODE&&e.parentNode&&(e=e.parentNode),e.nodeType!==Node.ELEMENT_NODE)return;let r=[];e.matches(n)&&r.push(e);const i=this._safeQueryAll(e,n);r=r.concat(i),this._processMatchingElements(r,t)})})}_setupMutationObserver(){const e=new MutationObserver(e=>{e.forEach(e=>{if("childList"===e.type&&e.addedNodes.length>0&&this._findAndAddMatchingElementsInNodes(e.addedNodes),"attributes"===e.type){const t=e.target;t.nodeType===Node.ELEMENT_NODE&&this._findAndAddMatchingElementsInNodes([t])}})});e.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),this.observer=e}_findAndAddMatchingElements(){Object.keys(Ve()).forEach(e=>{const t=Ve()[e];if(!t)return;const n=this._safeQueryAll(document,t);this._processMatchingElements(n,e)})}monitor(){var e;0!==Object.keys(Ve()).length&&(this._findAndAddMatchingElements(),"undefined"!=typeof MutationObserver&&MutationObserver&&(null===(e=document.documentElement)||void 0===e?void 0:e.nodeType)===Node.ELEMENT_NODE?this._setupMutationObserver():this.interval=setInterval(()=>{this._findAndAddMatchingElements()},5e3))}_disconnectObserver(){this.observer&&this.observer.disconnect&&"function"==typeof this.observer.disconnect&&this.observer.disconnect(),this.interval&&clearInterval(this.interval)}}class Ya{constructor(){this.initialHeight=null,this.maxOffset=0}static getInstance(){return Ya.instance||(Ya.instance=new Ya),Ya.instance}monitor(){const e=this.handle.bind(this),t=Qi()(e,1e3,{leading:!0,trailing:!0});ss(window,"scroll",t),Io().then(()=>{null!==this.initialHeight||this.report(!0)})}handle(e){e.target===document&&this.report(!1)}report(e){const t=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),n=window.innerHeight,r=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,i=r+n;null===this.initialHeight&&(this.initialHeight=t);let o=!1;r>this.maxOffset&&(this.maxOffset=r,o=!0);const s={initialHeight:this.initialHeight,height:t,viewportHeight:n,scrollTop:r,scrollBottom:i,isMax:e||o,isSynthetic:e},a={type:"scroll",data:JSON.stringify(s)};qs.getInstance().addEvent(a,J)}}let Ja=0;function Qa(e,t){if("function"!=typeof e)return e;if(e===Function.prototype)return e;try{if(e.__noibu__)return e;if(e.__noibu_wrapped__)return e.__noibu_wrapped__}catch(t){return e}const nbuWrapper=function(...n){try{const t=Array.prototype.slice.call(n).map(e=>Qa(e));return e.handleEvent?e.handleEvent.apply(this,t):e.apply(this,t)}catch(e){throw(null==t?void 0:t.getCause)&&(e.cause=t.getCause(n)),$s(Ae,{error:e}),Ja+=1,setTimeout(()=>{Ja-=1}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(nbuWrapper[t]=e[t])}catch(e){}nbuWrapper.prototype=e.prototype||{},Object.defineProperty(e,"__noibu_wrapped__",{enumerable:!1,value:nbuWrapper}),Object.defineProperties(nbuWrapper,{__noibu__:{enumerable:!1,value:!0},__noibu_original__:{enumerable:!1,value:e}});try{Object.getOwnPropertyDescriptor(nbuWrapper,"name").configurable&&Object.defineProperty(nbuWrapper,"name",{get:()=>e.name})}catch(t){return e}return nbuWrapper}function Xa(e){const t=[];e.forEach(e=>{e&&(Array.isArray(e)?t.push(...e):t.push(e))});const{errorLikeObjs:n,rest:r}=t.reduce((e,t)=>(!function(e){if(!e)return!1;const t=e;try{return"string"==typeof t.stack&&"string"==typeof t.message}catch(e){return!1}}(t)?e.rest.push(t):e.errorLikeObjs.push(t),e),{errorLikeObjs:[],rest:[]});n.concat(function(e){const t=e.filter(e=>"string"==typeof e&&!!e);if(!t.length)return[];if(2===t.length)switch(!0){case ko(t[0]):return[{stack:t[0],message:t[1]}];case ko(t[1]):return[{stack:t[1],message:t[0]}];default:return[]}const n=[],r=[];return t.forEach(e=>{if(ko(e)){n.push(e);const t=e.split("\n");ko(t[0],0)?r.push("_"):r.push(t[0])}}),n.map((e,t)=>({stack:e,message:r[t]}))}(r)).forEach(e=>{try{$s(Te,e)}catch(e){}})}function ec(e){e&&Ne.forEach(t=>{e[t]&&Co(e,t,(function(t){return function nbuWrapper(){t.call(e,...arguments),Xa(Array.from(arguments))}}))})}function tc(e){e&&e.constructor&&e.constructor.name&&"undefined"!==e.constructor.name&&!(Ja>0)&&$s(e.constructor.name,e)}function nc(e){if(!e.reason)return;if(!e.reason.message||!e.reason.stack)return;const t=new Error;t.message=e.reason.message,t.stack=e.reason.stack;$s(Ce,{error:t})}function rc(e){!function(e){ss(e,"error",tc,!0),ss(e,"unhandledrejection",nc,!0),k.forEach(t=>{const n=e[t],r=n&&n.prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&(Co(r,"addEventListener",(function(e){return function nbuWrapper(t,n,r){if(!n)return e.call(this,t,n,r);let i;if(n.handleEvent){const e=Qa(n.handleEvent.bind(n));i=n,i.handleEvent=e}else i=Qa(n);return e.call(this,t,i,r)}})),Co(r,"removeEventListener",(function(e){return function nbuWrapper(t,n,r){let i=n;try{i=i&&(i.__noibu_wrapped__||i)}catch(e){}return e.call(this,t,i,r)}})))})}(e),ec(e.console),function(e){var t;const n=e=>t=>{try{return t.filter(e.isValid.bind(e)).map(t=>e.getPayload(t))}catch(e){return os.getInstance().postNoibuErrorAndOptionallyDisableClient({msg:"Can't get cause for an onclick error in wrapHtmlElementEvents: "+e,args:t},!1,E),[]}};try{const r=null===(t=null==e?void 0:e.HTMLElement)||void 0===t?void 0:t.prototype;if(!r)return;So(r,"onclick",e=>Qa(e,{getCause:n(ja.getInstance())})),So(r,"oninput",e=>Qa(e,{getCause:n(xa.getInstance())})),So(r,"onchange",e=>Qa(e,{getCause:n(xa.getInstance())}))}catch(e){os.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in wrapHtmlElementEvents: "+e,!1,E)}}(e),function(e){const t=e.console;let n=0,r=t;const i=()=>{try{const{console:t}=e}catch(e){return}if(n+=1,e.console!==r){r=e.console;const n={};Object.keys(t).forEach(t=>{e.console[t]||(e.console[t]=()=>{n[t]||(n[t]=!0,$s("GlobalReassignError",{error:new Error(`The console object was overridden and the ${t} method does not exist. Backfilling it with an empty function to avoid errors.`)}))})}),ec(e.console)}n<3&&setTimeout(i,500)};setTimeout(i,500)}(e)}function ic(){rc(window),ss(window,"noibuFrameAttach",e=>{rc(e.detail)})}class oc{static async fromFetch(e,t,n,r){try{if(!(zo(r,Response)&&r.ok&&!r.bodyUsed))return null;const i=this._getHeaderFromFetchArguments("content-type",t,n),o=this._getHeaderFromFetchArguments("apollographql-client-name",t,n);if(null!=o||this._shouldHandleRequest(e,i)){const t=await r.json();return this._validate(t,e,[])}}catch(e){this._isRequestAborted(t,n)||this._postError(e)}return null}static async fromXhr(e,t){try{if(!(zo(t,XMLHttpRequest)&&t.status>=200&&t.status<=299))return null;let n=null,r=!1;if(t.noibuRequestHeaders&&(n=t.noibuRequestHeaders.get("content-type"),r=t.noibuRequestHeaders.has("apollographql-client-name")),r||this._shouldHandleRequest(e,n)){let n=null;if("blob"===t.responseType){if(t.response.text){const e=await t.response.text();n=this._parseJsonSafely(e)}}else if("json"===t.responseType)n=t.response;else{const e=t.responseText;n=this._parseJsonSafely(e)}if(n)return this._validate(n,e,[])}}catch(e){this._postError(e)}return null}static _parseJsonSafely(e){try{return JSON.parse(e)}catch(e){return null}}static _getHeaderFromFetchArguments(e,t,n){let r=null;zo(n,Request)?r=n.headers:t&&t.headers&&(r=new Headers(t.headers));let i=null;return r&&(i=r.get(e)),i}static _isRequestAborted(e,t){return zo(t,Request)?t.signal&&t.signal.aborted:!(!e||!zo(e.signal,AbortSignal))&&e.signal.aborted}static _shouldHandleRequest(e,t){Zo(t)&&(t=t.toLowerCase());let n=!1;return e&&(zo(e,URL)&&(e=e.toString()),Zo(e)&&(n=e.toLowerCase().includes("graphql"))),"application/json"===t&&n||"application/graphql"===t}static _validate(e,t,n){let r=null;if(e&&Array.isArray(e.errors)){r=e.errors;for(const e of r){const r=Object.keys(e);for(const t of r)switch(t){case"message":this._validateMessage(e);break;case"locations":this._validateLocations(e,n);break;case"path":this._validatePath(e,n);break;case"extensions":this._validateExtensions(e);break;default:delete e[t],n.push("unexpected error."+t)}e.src=t}n.length>0&&this._postValidationIssues(n)}return r}static _validateMessage(e){e.message=Ao(e.message,1e3)}static _validateExtensions(e){const t=na(Oo(e.extensions));e.extensions=Ao(t,1e3)}static _validateLocations(e,t){const n=e.locations;if(Array.isArray(n))for(const e of n){const n=Object.keys(e);for(const r of n)switch(r){case"line":case"column":if(!Number.isSafeInteger(e[r])){const n=e[r];e[r]=0,t.push(`unexpected ${r} value '${n}'`)}break;default:delete e[r],t.push("unexpected error.location."+r)}}else delete e.locations,t.push("unexpected error.locations")}static _validatePath(e,t){const n=e.path;Array.isArray(n)?e.path=e.path.map(e=>e.toString()):(delete e.path,t.push("unexpected error.path"))}static _postError(e){os.getInstance().postNoibuErrorAndOptionallyDisableClient("GQL parse error: "+e,!1,E)}static _postValidationIssues(e){const t=e.join(",");os.getInstance().postNoibuErrorAndOptionallyDisableClient("GQL error validation warning: "+t,!1,E)}}var sc=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};ka("en");function ac(e,t,n,r,i){const o={mtd:n,code:e,url:r,r_time:i},s=ia.getInstance(),a=s.contentLength(t);return a>0&&s.shouldContinueForURL(r)&&(o.resp_len=a),o}function cc(e){return sc(this,void 0,void 0,(function*(){return e instanceof Response?e.bodyUsed?v:Eo(e.text).call(e):""}))}function lc(e,t,n,r,i,o,s,a){return sc(this,void 0,void 0,(function*(){return ia.getInstance().shouldContinueForURL(r)?ia.getInstance().bundleHTTPData(r,function(e,t){var n;let r=[];return"function"==typeof(null===(n=null==e?void 0:e.headers)||void 0===n?void 0:n.entries)&&(r=e.headers.entries()),Array.from(r).length<1&&((null==t?void 0:t.headers)instanceof Headers?r=t.headers.entries():"object"==typeof(null==t?void 0:t.headers)&&(r=Object.entries(t.headers))),ia.headersMapFromIterable(r)}(e,i),function(e,t){return"string"==typeof e?e:null==t?void 0:t.body}(s,i),function(e){return(null==e?void 0:e.headers)?ia.headersMapFromIterable(e.headers.entries()):new Map}(t),a,n,o):null}))}function uc(e,t,n,r,i){return sc(this,void 0,void 0,(function*(){var o;const s=Date.now()-t,a=yield oc.fromXhr(n,e),c=oa(e.status);let l=[];const u=yield ia.getResponseStringFromXHR(e);const d=ac(e.status,ia.headersMapFromString(e.getAllResponseHeaders()),r,n,s),h=yield function(e,t,n,r){return sc(this,arguments,void 0,(function*(e,t,n,r,i=null,o){if(!ia.getInstance().shouldContinueForURL(n))return null;const s=ia.headersMapFromString(e.getAllResponseHeaders());return ia.getInstance().bundleHTTPData(n,e.noibuRequestHeaders,i,s,o,t,r)}))}(e,r,n,c||!!a||!!l.length,i,u),p=new sa(d,h,a);p.saveHTTPEvent();const g=null===(o=p.httpData)||void 0===o?void 0:o.seq;c&&$s(be,e,g),a&&a.forEach(e=>$s("GQLError",e,g))}))}function dc(e){return e.bodyUsed?e:e.clone()}function hc(e){const t=e;"function"==typeof t.fetch&&(function(e){var t,n,r;return null===(r=null===(n=null===(t=e.toString)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.includes)||void 0===r?void 0:r.call(n,"native code")}(Response.prototype.text)||(Response.prototype.text.__noibu_original__=function(e){try{const t=document.createElement("iframe");document.body.appendChild(t);let n=t.contentWindow;return e.split(".").forEach(e=>{n=n[e]}),t.remove(),n}catch(e){}}("Response.prototype.text")||Response.prototype.text),Co(t,"fetch",(function(e){return function nbuWrapper(t,n){let r;const{url:i,method:o}=function(e,t){const n={method:"GET",url:""};try{return e?e instanceof Request&&e.method?{method:e.method,url:e.url||""}:{method:(null==t?void 0:t.method)||"GET",url:"function"==typeof e.toString?e.toString():""}:n}catch(e){os.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in fetch() wrapper: "+e,!1,E)}return n}(t,n);t instanceof Request&&(r=t.clone());const s=Date.now(),a=e.call(this,t,n);return a.then(function(e,t,n,r,i){return o=>sc(this,void 0,void 0,(function*(){var s,a,c;try{if(!o)return os.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in custom fetch() callback: no response received",!1,E);const l=dc(o),u=dc(l),d=dc(l),h=Date.now()-e;let p=[];const g=l.status,f=l.headers,m=yield oc.fromFetch(t,r,i,u),v=oa(g),[y,b]=yield Ms([Promise.resolve(null===(a=null===(s=Eo(null==i?void 0:i.text))||void 0===s?void 0:s.call)||void 0===a?void 0:a.call(s,i)),cc(d)]);0;const I=ac(g,f,n,t,h),C=yield lc(i,d,n,t,r,v||!!m||!!p.length,y,b),w=new sa(I,C,m);w.saveHTTPEvent();const S=null===(c=w.httpData)||void 0===c?void 0:c.seq;v&&$s(Se,l,S),p.length,m&&m.forEach(e=>$s("GQLError",e,S))}catch(e){if("AbortError"===e.name)return;const t=Lo(e);os.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in custom fetch() callback: ${e}${t}`,!1,E)}}))}(s,i,o,n,r)).catch(e=>{!function(e,t){if(!e||"object"!=typeof e)return;const n=e;if(!(null==n?void 0:n.message)||!(null==n?void 0:n.stack))return;const r=new Error;r.stack=n.stack;const i=Go(t),o=i?" on url "+i:"";r.message=`${n.message}${o}`,$s(ke,{error:r})}(e,i)}),a}})))}function pc(e){const t=e.XMLHttpRequest,n=t&&t.prototype;!function(e,t){Co(e,"open",(function(e){return function nbuWrapper(n,r,i=!0,o=null,s=null){try{try{this.noibuHttpMethod=n,this.noibuHttpUrl=r}catch(e){os.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to set custom properties on XHR object: "+e,!1,A)}if(t){const e=Date.now();ss(this,"loadend",()=>uc(this,e,r,n,null))}}catch(e){const t=Lo(e);os.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in XHR.open() wrapper: ${e}${t}`,!1,E)}return e.call(this,n,r,i,o,s)}}))}(n,!function(e){return Co(e,"send",(function(e){return function nbuWrapper(t){try{const e=function(e,t){return e.noibuHttpMethod?e.noibuHttpMethod:t?"POST":"GET"}(this,t),n=Date.now();ss(this,"loadend",()=>uc(this,n,this.noibuHttpUrl||this.responseURL,e,t))}catch(e){const t=Lo(e);os.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in XHR.send() wrapper: ${e}${t}`,!1,E)}return e.call(this,t)}}))}(n)),function(e){Co(e,"setRequestHeader",(function(e){return function nbuWrapper(t,n){try{this.noibuRequestHeaders instanceof Map||(this.noibuRequestHeaders=new Map);const e="string"==typeof n?n:String(n);"string"==typeof t&&this.noibuRequestHeaders.set(t.toLowerCase(),e)}catch(e){os.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in XHR.setRequestHeader() wrapper: "+e,!1,E)}return e.call(this,t,n)}}))}(n)}function gc(e){pc(e),hc(e)}var fc=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};let mc=!1;let vc=!1;function yc(){Ys.getInstance().addNoibuInternalCustomAttribute("qualtrics_survey_completed","true")}function bc(){ss(window,"message",e=>{if("string"==typeof e.data){if(e.data.startsWith("QualtricsEOS"))try{const t=e.data.split("|"),n=t[1],r=t[2];yc(),Ys.getInstance().addNoibuInternalCustomAttribute("qualtrics_survey_id",n),Ys.getInstance().addNoibuInternalCustomAttribute("qualtrics_session_id",r)}catch(e){}if("endOfSurvey"===e.data)try{yc()}catch(e){}}})}function Ic(){window.QSI&&window.QSI.API&&bc()}let Cc=!1;function wc(){Cc||(Cc=!0,ss(window,"MDigital_Submit_Feedback",e=>{const t=e.detail.Form_ID,n=e.detail.Feedback_UUID;Ys.getInstance().addNoibuInternalCustomAttribute("medallia_form_id",t),Ys.getInstance().addNoibuInternalCustomAttribute("medallia_feedback_uuid",n)}))}var Sc=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};let Ec=!1;function Ac(e){if(e)try{const{id:t,response_id:n}=e;t&&Ys.getInstance().addNoibuInternalCustomAttribute("hotjar_feedback_id",""+t),n&&Ys.getInstance().addNoibuInternalCustomAttribute("hotjar_feedback_response_id",""+n)}catch(e){}}function kc(){return Sc(this,void 0,void 0,(function*(){Ec||(Ec=!0,yield function(){return Sc(this,void 0,void 0,(function*(){yield Io(),window.hj&&"function"==typeof window.hj&&window.hj.event&&(window.hj.event.listen("feedback.sentiment",e=>{Ac(e)}),window.hj.event.listen("poll.send",e=>{Ac(e)}))}))}())}))}let Tc=!1;let _c=!1;function Rc(e){var t,n;(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.campaignId)&&(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.variationId)&&Ys.getInstance().addNoibuInternalCustomAttribute("abtasty-campaign-"+e.detail.campaignId,"variation-"+e.detail.variationId)}!function(t){if(function(){try{const{search:e}=window.location;return new URLSearchParams(e).has("noibu-check-recording")}catch(e){}return!1}())return void $o("https://cdn.noibu.com/collect-pagecheck.js",null,null);if(qo())return;if(function(e){for(let t=0;t<m.length;t+=1){if(!e[m[t]])return!0}return!1}(t))return;if(!Mo().startsWith("http"))return;if(function(){const e=void 0!==self.noibuJSLoaded;return self.noibuJSLoaded=!0,e}())return;const n=`${t.metroplexHTTPBase}/${he}`;os.configureInstance(n);try{const t=Ze()();if(os.getInstance().isDisabled)return;Ks.configure(!1);const n=Ss.getInstance(t);Ps.configureInstance(),Es.configureInstance(),Is.getInstance();const r=za.getInstance(),i=Ra.getInstance(),o=Ma.getInstance(),s=xa.getInstance(),a=ja.getInstance(),c=Za.getInstance(),l=$a.getInstance(),u=Ka.getInstance(),d=Ya.getInstance(),h=Js.getInstance(),p=Qs.getInstance(),g=Hs.getInstance();ia.getInstance(),r.monitor(),o.monitor(n.initialPageTitle),ic(),gc(window),ss(window,"noibuFrameAttach",e=>{gc(e.detail)}),a.monitorClicks(),function(){let e=Mo();e&&setInterval((function(){if(e!==Mo()){const t=e;e=Mo();const n={url:Mo(),page_title:window.document.title,page_groups:ms(),ref_url:window.document.referrer?Ao(window.document.referrer):t};qs.getInstance().addEvent(n,K)}}),1e3)}(),function(){fc(this,void 0,void 0,(function*(){const e=ms();yield Io();const t=ms();if(!(e.length===t.length&&e.every((e,n)=>e===t[n]))){const e={page_groups:t};qs.getInstance().addEvent(e,re)}}))}(),d.monitor(),s.monitor(),c.monitor(),u.monitor(),h.monitor(),p.monitor(),function(t=!1){if(!mc||t){if(mc=!0,!window.navigator||!window.navigator.connection||!window.navigator.connection.downlink)return;const{connection:{downlink:t,rtt:n,effectiveType:r,saveData:i}}=window.navigator;qs.getInstance().addEvent({downlink:Number(t),effective_type:r===e.TwoG||r===e.ThreeG||r===e.FourG||r===e.Slow2g?r:e.FourG,rtt:Number(n),save_data:!!i},Q)}}(),vc||(vc=!0,window.QSI&&window.QSI.API?bc():ss(window,"qsi_js_loaded",Ic,!1)),wc(),_c||(_c=!0,ss(window,"abtasty_executedCampaign",Rc,!1)),ua(),Aa(),i.monitor();const m=Ps.getInstance();n.connectionPromise.then(()=>{Ys.getInstance().exposeFunctions(),Ks.getInstance().checkInitialRequest(),function(){if(!Tc){Tc=!0;try{const e=new URLSearchParams(window.location.search),t=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],n=Ys.getInstance();t.forEach(t=>{const r=e.get(t);r&&n.addNoibuInternalCustomAttribute(t,r)})}catch(e){}}}()}),Ms([Io(),n.connectionPromise]).then(()=>{m.setRRWeb({record:Yn,addCustomEvent:Jn,pack:Lr}),m.recordUserSession(),l.setWebVitals(f),l.monitor(),g.monitor(),kc()}).catch(e=>{const t=Lo(e);os.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error during recordUserSession: ${e}${t}`,!1,E)})}catch(e){const t=Lo(e);os.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error during globalInit: ${e}${t}`,!0,E)}}({metroplexSocketBase:Ue(),metroplexHTTPBase:We()})})()})();