window.NOIBUJS_CONFIG={"scriptID":"1.193.1","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,f=function(){return u.Date.now()};function g(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(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(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(w,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 w(){var e=f();if(I(e))return C(e);a=setTimeout(w,function(e){var n=t-(e-c);return d?p(n,o-(e-l)):n}(e))}function C(e){return a=void 0,v&&r?y(e):(r=i=void 0,s)}function S(){var e=f(),n=I(e);if(r=arguments,i=this,c=e,n){if(void 0===a)return b(c);if(d)return a=setTimeout(w,t),y(c)}return void 0===a&&(a=setTimeout(w,t)),s}return t=m(t)||0,g(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:C(f())},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,f,g={};n.r(g),n.d(g,{CLSThresholds:()=>Di,FCPThresholds:()=>Li,FIDThresholds:()=>_o,INPThresholds:()=>Yi,LCPThresholds:()=>fo,TTFBThresholds:()=>vo,onCLS:()=>Pi,onFCP:()=>Vi,onFID:()=>Ao,onINP:()=>po,onLCP:()=>mo,onTTFB:()=>bo}),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"}(f||(f={}));const m=!1,v=!1,y=!1,b=!1,I=!1,w=!1,C=!1,S="",k=0,E=!1;function _(e,t){return"boolean"==typeof e?e:t}function A(e,t){return"string"==typeof e?e:t}function T(e,t){return"number"==typeof e&&Number.isFinite(e)?e:t}function R(e){return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}function M(){const e=R(R(ke().njs_config).featureFlags);return{allowsBots:_(e.allowsBots,w),excludeXhrMonitoring:_(e.excludeXhrMonitoring,C),replaceLocalhostInStr:A(e.replaceLocalhostInStr,S),restrictsBundleSize:T(e.restrictsBundleSize,k),metroplexSocketBase:A(e.metroplexSocketBase,Je()?"wss://input.b.noibu.com":"wss://input.noibu.com"),metroplexHTTPBase:A(e.metroplexHTTPBase,et()),metroplexPostURL:A(e.metroplexPostURL,tt()),logSuspectedBots:_(e.logSuspectedBots,E)}}const x=["metroplexSocketBase","metroplexHTTPBase"],N="Response data unavailable due to an improperly wrapped fetch call",L=["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"],O=/[0-9]+/g,D=/\b[a-z0-9!#$%&'*+/=?^_‘{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_‘{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)*[a-z0-9-]*[a-z]\w*\b/gi,P=[/\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,D,/\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],V=/^www\d{0,2}$/,F=/(getElementById\(')([^']*)('\)\.value = )('[^']*')/g,U=a.ERROR,B=a.WARN,H=(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"]),q=u.PageVisitPart,W=u.PageVisitVideoFile,j=u.PageVisitMeta,G=u.PageVisitHttp,$="type",z="tag",Z="src",K="txt",Y="hid",J="class",X=p.HelpCode,Q=u.WorkRequest,ee=(o.StorageFull,o.StorageUnavailable,o.StorageUnavailableSecurityError,t.Http),te=r.Http,ne=t.JS,re=t.Gql,ie=t.Csp,oe=t.Resource,se=r.UserStep,ae=r.WebVital,ce=c.Click,le=c.Keyboard,ue=(c.Navigation,r.Loc),de=r.Error,he=r.Page,pe=r.NetworkStats,fe=r.ECommerce,ge=(r.Sample,t.PageCheck),me=r.VisualError,ve=r.Title,ye=r.PageGroups,be=u.PageVisitPart,Ie=u.PageVisitVideoFile,we=u.PageVisitMeta,Ce=u.PageVisitHttp,Se=l.RRWeb;function ke(){return self.NOIBUJS_CONFIG||{}}const Ee=["i.noibu","i.staging.noibu","input.staging.noibu","input.b.noibu","input.noibu","vf.staging.noibu","vf.noibu"],_e=f.PageVisitPart,Ae=f.CollectError,Te=(f.Metrics,f.PageVisit),Re=i.VideoBlock,Me=i.PageVisitBlock,xe=i.FullBlock,Ne=i.CloseConnection,Le=i.OK,Oe=s.XMLHttpRequest,De=s.ErrorEvent,Pe=s.UnhandledRejectionError,Ve=s.Event,Fe=s.Response,Ue=s.PageCheckError,Be=s.WrappedException,He=s.FetchException,qe=s.ErrorLogEvent,We=s.CustomError,je=s.ReactError,Ge=s.VueError,$e=["error","warn","log"],ze=["pagehide","pageshow","popstate","online","offline","messageerror","languagechange","hashchange","beforeprint","afterprint","load","resize"],Ze=["blur","focus"],Ke=["visibilitychange","resume","freeze","readystatechange","cut","copy","paste"],Ye=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 Je(){return"beta"===ke().njs_version}function Xe(){return Je()?"1.193.1-beta":"1.193.1"}function Qe(){return ke().att_sel||{}}function et(){return Je()?"https://input.b.noibu.com":"https://input.noibu.com"}function tt(){return`${et()}/${Te}`}const nt=[e=>/AppMeasurement Debug/i.test(e)],rt=new Set(["button","radio","checkbox","reset","submit"]),it=[e=>"button"===e,(e,t)=>"input"===e&&rt.has(t.type),e=>"a"===e,e=>"select"===e,e=>"option"===e];var ot,st=n(550),at=n.n(st);function ct(e){return e.nodeType===e.ELEMENT_NODE}function lt(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function ut(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}!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"}(ot||(ot={}));var dt={"animation-duration: ;":"animation-duration: 0.6s;","animation-timing-function: ;":"animation-timing-function: cubic-bezier(0, 0, 0.3, 1);","animation-iteration-count: ;":"animation-iteration-count: 1;","animation-direction: ;":"animation-direction: normal;","animation-fill-mode: ;":"animation-fill-mode: forwards;","animation-play-state: ;":"animation-play-state: running;","animation-name: ;":"animation-name: slideIn;","animation-timeline: ;":"animation-timeline: auto;","animation-range-start: ;":"animation-range-start: normal;","animation-range-end: ;":"animation-range-end: normal;","animation-delay: ;":"animation-delay: 0s;"};function ht(e){try{var t=e.rules||e.cssRules;return t?function(e){e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;"));var t=Object.keys(dt);return t.some((function(t){return e.includes(t)}))&&t.forEach((function(t){var n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(n,"g");e=e.replace(r,dt[t])})),e}(Array.from(t).map(pt).join("")):null}catch(e){return null}}function pt(e){var t;if(function(e){return"styleSheet"in e}(e))try{t=ht(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)}var ft=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 gt(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.value,s=e.maskInputFn,a=o||"",c=i&&mt(i);return(n[r.toLowerCase()]||c&&n[c])&&(a=s?s(a,t):"*".repeat(a.length)),a}function mt(e){return e.toLowerCase()}function vt(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?mt(t):null}var yt=/var\(\s*(--[A-Za-z0-9_-]+)/g,bt=null,It="",wt=null;function Ct(e,t,n){var r;if(-1!==e.indexOf("var("))for(yt.lastIndex=0;null!==(r=yt.exec(e));){var i=r[1],o=n.usedBy.get(i);o||(o=new Set,n.usedBy.set(i,o)),o.add(t)}}function St(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=r;if(i.selectorText&&i.style)for(var o=i.style,s=i.selectorText,a=0;a<o.length;a++){var c=o[a];45===c.charCodeAt(0)&&45===c.charCodeAt(1)&&t.declared.add(c),Ct(o.getPropertyValue(c),s,t)}var l=r;l.cssRules&&l.cssRules.length&&St(l.cssRules,t)}}function kt(e){var t=function(e){for(var t=e.styleSheets,n="".concat(t.length),r=0;r<t.length;r++){var i=-1;try{i=t[r].cssRules?t[r].cssRules.length:0}catch(e){}n+=":".concat(i)}return n}(e);if(bt===e&&It===t&&wt)return wt;var n=function(e){for(var t={declared:new Set,usedBy:new Map},n=e.styleSheets,r=0;r<n.length;r++){var i=null;try{i=n[r].cssRules}catch(e){continue}i&&St(i,t)}return t}(e);return bt=e,It=t,wt=n,n}function Et(e){var t=new Map,n=e.defaultView;if(!n||"function"!=typeof n.getComputedStyle)return t;var r=kt(e),i=r.declared,o=r.usedBy,s=[];if(o.forEach((function(e,t){i.has(t)||s.push([t,e])})),0===s.length)return t;for(var a=new Map,c=function(r,i){i.forEach((function(i){for(var o=0,s=function(t){var n=a.get(t);if(n)return n;try{n=Array.from(e.querySelectorAll(t))}catch(e){n=[]}return a.set(t,n),n}(i);o<s.length;o++){var c=s[o],l=n.getComputedStyle(c).getPropertyValue(r).trim();if(l){var u=t.get(c);u||(u={},t.set(c,u)),u[r]=l}}}))},l=0,u=s;l<u.length;l++){var d=u[l];c(d[0],d[1])}return t}var _t,At,Tt=1,Rt=new RegExp("[^a-z0-9-_:]");function Mt(){return Tt++}var xt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Nt=/^(?:[a-z+]+:)?\/\//i,Lt=/^www\..*/i,Ot=/^(data:)([^,]*),(.*)/i;function Dt(e,t){return(e||"").replace(xt,(function(e,n,r,i,o,s){var a,c=r||o||s,l=n||i||"";if(!c)return e;if(Nt.test(c)||Lt.test(c))return"url(".concat(l).concat(c).concat(l,")");if(Ot.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 f=p[h];"."!==f&&(".."===f?u.pop():u.push(f))}return"url(".concat(l).concat(u.join("/")).concat(l,")")}))}var Pt=/^[^ \t\n\r\u000c]+/,Vt=/^[, \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 Ut(){var e=document.createElement("a");return e.href="",e.href}function Bt(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(Vt),!(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?Dt(r,Ut()):"object"===t&&"data"===n?Ft(e,r):r:Ft(e,r):r}function Ht(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function qt(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&qt(e.parentNode,t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&qt(e.parentNode,t,n)}function Wt(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(qt(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}}catch(e){}return!1}function jt(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,f=void 0===p?{}:p,g=t.inlineImages,m=t.recordCanvas,v=t.keepIframeSrcFn,y=t.newlyAddedElement,b=void 0!==y&&y,I=t.maskCurrentNode,w=t.cssVariableOverrides,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:ot.Document,childNodes:[],compatMode:e.compatMode}:{type:ot.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ot.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,f=t.newlyAddedElement,g=void 0!==f&&f,m=t.rootId,v=t.cssVariableOverrides,y=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),b=function(e){if(e instanceof HTMLFormElement)return"form";var t=mt(e.tagName);return Rt.test(t)?"div":t}(e),I={},w=e.attributes.length,C=0;C<w;C++){var S=e.attributes[C];Ht(b,S.name,S.value)||(I[S.name]=Bt(n,b,mt(S.name),S.value))}if(v){var k=v.get(e);if(k){var E=function(e,t){var n=[];for(var r in t)e&&-1!==e.indexOf(r)||n.push("".concat(r,":").concat(t[r]));if(0===n.length)return e||"";var i=n.join(";");return e?e.trim().replace(/;\s*$/,"")+";"+i:i}("string"==typeof I.style?I.style:void 0,k);E&&(I.style=E)}}if("link"===b&&o){var _=Array.from(n.styleSheets).find((function(t){return t.href===e.href})),A=null;_&&(A=ht(_)),A&&(delete I.rel,delete I.href,I._cssText=Dt(A,_.href))}if("style"===b&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(A=ht(e.sheet))&&(I._cssText=Dt(A,Ut()))}if("input"===b||"textarea"===b||"select"===b){var T=e.value,R=e.checked;if("radio"!==I.type&&"checkbox"!==I.type&&"submit"!==I.type&&"button"!==I.type){var M=T||I.value||"";if(M){var x=vt(e);I.value=gt({element:e,type:x,tagName:b,value:M,maskInputOptions:a,maskInputFn:c})}}else R&&(I.checked=R)}"option"===b&&(e.selected?I.selected=!0:delete I.selected);"dialog"===b&&e.open&&(I.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===b&&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)||(I.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var N=e.toDataURL(u.type,u.quality),L=document.createElement("canvas");L.width=e.width,L.height=e.height;var O=L.toDataURL(u.type,u.quality);N!==O&&(I.rr_dataURL=N)}if("img"===b&&d){_t||(_t=n.createElement("canvas"),At=_t.getContext("2d"));var D=e,P=D.crossOrigin;D.crossOrigin="anonymous";var V=function(){D.removeEventListener("load",V);try{_t.width=D.naturalWidth,_t.height=D.naturalHeight,At.drawImage(D,0,0),I.rr_dataURL=_t.toDataURL(u.type,u.quality)}catch(e){}P?I.crossOrigin=P:D.removeAttribute("crossorigin")};D.complete&&0!==D.naturalWidth?V():D.addEventListener("load",V)}"audio"!==b&&"video"!==b||(I.rr_mediaState=e.paused?"paused":"played",I.rr_mediaCurrentTime=e.currentTime);g||(e.scrollLeft&&(I.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(I.rr_scrollTop=e.scrollTop));if(y){var F=e.getBoundingClientRect(),U=F.width,B=F.height;I={class:I.class,rr_width:"".concat(U,"px"),rr_height:"".concat(B,"px")}}"iframe"!==b||p(I.src)||(e.contentDocument||(I.rr_src=I.src),delete I.src);return{type:ot.Element,tagName:b,attributes:I,childNodes:[],isSVG:(H=e,Boolean("svg"===H.tagName||H.ownerSVGElement)||void 0),needBlock:y,rootId:m};var H}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:c,maskInputOptions:u,maskInputFn:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:v,newlyAddedElement:b,rootId:C,cssVariableOverrides:w});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=ht(e.parentNode.sheet))}catch(e){}l=Dt(l,Ut())}d&&(l="SCRIPT_PLACEHOLDER");if(!u&&!d&&l){(void 0===a?Wt(e,r,i):a)&&(l=o?o(l):l.replace(/[\S]/g,"*"))}return{type:ot.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:ot.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:ot.Comment,textContent:e.textContent||"",rootId:C};default:return!1}}function Gt(e){return null==e?"":e.toLowerCase()}function $t(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,f=t.maskTextFn,g=t.maskInputFn,m=t.slimDOMOptions,v=t.dataURLOptions,y=void 0===v?{}:v,b=t.inlineImages,I=void 0!==b&&b,w=t.recordCanvas,C=void 0!==w&&w,S=t.onSerialize,k=t.onIframeLoad,E=t.iframeLoadTimeout,_=void 0===E?5e3:E,A=t.onStylesheetLoad,T=t.stylesheetLoadTimeout,R=void 0===T?5e3:T,M=t.keepIframeSrcFn,x=void 0===M?function(){return!1}:M,N=t.newlyAddedElement,L=void 0!==N&&N,O=t.maskedElements,D=void 0===O?[]:O,P=t.cssVariableOverrides,V=t.preserveWhiteSpace,F=void 0===V||V,U=t.maskCurrentNode;!1===U&&(U=D.includes(e));var B,H=jt(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,inlineStylesheet:d,maskInputOptions:p,maskTextFn:f,maskInputFn:g,dataURLOptions:y,inlineImages:I,recordCanvas:C,keepIframeSrcFn:x,newlyAddedElement:L,maskCurrentNode:U,cssVariableOverrides:P});if(!H)return null;B=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===ot.Comment)return!0;if(e.type===ot.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&&(Gt(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Gt(e.attributes.name)||"icon"===Gt(e.attributes.rel)||"apple-touch-icon"===Gt(e.attributes.rel)||"shortcut icon"===Gt(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Gt(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Gt(e.attributes.property).match(/^(og|twitter|fb):/)||Gt(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Gt(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Gt(e.attributes.name)||"googlebot"===Gt(e.attributes.name)||"bingbot"===Gt(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Gt(e.attributes.name)||"generator"===Gt(e.attributes.name)||"framework"===Gt(e.attributes.name)||"publisher"===Gt(e.attributes.name)||"progid"===Gt(e.attributes.name)||Gt(e.attributes.property).match(/^article:/)||Gt(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Gt(e.attributes.name)||"yandex-verification"===Gt(e.attributes.name)||"csrf-token"===Gt(e.attributes.name)||"p:domain_verify"===Gt(e.attributes.name)||"verify-v1"===Gt(e.attributes.name)||"verification"===Gt(e.attributes.name)||"shopify-checkout-api-token"===Gt(e.attributes.name)))return!0}}return!1}(H,m)&&(F||H.type!==ot.Text||H.isStyle||H.textContent.replace(/^\s+|\s+$/gm,"").length)?Mt():-2;var q=Object.assign(H,{id:B});if(r.add(e,q),-2===B)return null;S&&S(e);var W=!l;if(q.type===ot.Element){W=W&&!q.needBlock,delete q.needBlock;var j=e.shadowRoot;j&&ut(j)&&(q.isShadowHost=!0)}if((q.type===ot.Document||q.type===ot.Element)&&W){m.headWhitespace&&q.type===ot.Element&&"head"===q.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:f,maskInputFn:g,slimDOMOptions:m,dataURLOptions:y,inlineImages:I,recordCanvas:C,preserveWhiteSpace:F,onSerialize:S,onIframeLoad:k,iframeLoadTimeout:_,onStylesheetLoad:A,stylesheetLoadTimeout:R,keepIframeSrcFn:x,maskCurrentNode:U,maskedElements:D,cssVariableOverrides:P},$=0,z=Array.from(e.childNodes);$<z.length;$++){(Y=$t(z[$],G))&&q.childNodes.push(Y)}if(ct(e)&&e.shadowRoot)for(var Z=0,K=Array.from(e.shadowRoot.childNodes);Z<K.length;Z++){var Y;(Y=$t(K[Z],G))&&(ut(e.shadowRoot)&&(Y.isShadow=!0),q.childNodes.push(Y))}}return e.parentNode&&lt(e.parentNode)&&ut(e.parentNode)&&(q.isShadow=!0),q.type===ot.Element&&"iframe"===q.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&&k){var n=$t(t,{doc:t,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:f,maskInputFn:g,slimDOMOptions:m,dataURLOptions:y,inlineImages:I,recordCanvas:C,preserveWhiteSpace:F,onSerialize:S,onIframeLoad:k,iframeLoadTimeout:_,onStylesheetLoad:A,stylesheetLoadTimeout:R,keepIframeSrcFn:x,maskCurrentNode:U,maskedElements:D});n&&k(e,n)}}),_),q.type===ot.Element&&"link"===q.tagName&&"stylesheet"===q.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(A){var t=$t(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:f,maskInputFn:g,slimDOMOptions:m,dataURLOptions:y,inlineImages:I,recordCanvas:C,preserveWhiteSpace:F,onSerialize:S,onIframeLoad:k,iframeLoadTimeout:_,onStylesheetLoad:A,stylesheetLoadTimeout:R,keepIframeSrcFn:x,maskCurrentNode:U,maskedElements:D});t&&A(e,t)}}),R),q}function zt(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>{try{n.removeEventListener(e,t,r)}catch(e){}}}let Zt={map:{},getId:()=>-1,getNode:()=>null,removeNodeFromMap(){},has:()=>!1,reset(){}};function Kt(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 Yt(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)}}),()=>Yt(e,t,o||{},!0)}function Jt(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&&(Zt=new Proxy(Zt,{get:(e,t,n)=>Reflect.get(e,t,n)}));let Xt=Date.now;function Qt(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 en(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function tn(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function nn(e,t){let n=e;for(;n;){const e=n.closest(t);if(e)return e;const r=n.getRootNode();if(!(r instanceof ShadowRoot))return null;n=r.host}return null}function rn(e,t,n,r){if(!e)return!1;let i;if(i=e.nodeType===e.ELEMENT_NODE?e:lt(e)?e.host:e.parentElement,!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==nn(i,"."+t))return!0}else if(qt(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==nn(i,n))return!0}return!1}function on(e,t){return-2===t.getId(e)}function sn(e){return Boolean(e.changedTouches)}function an(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function cn(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ln(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Xt=()=>(new Date).getTime());class un{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 dn(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 hn(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=dn(n);)n=t;return n}(e);return t.contains(n)}function pn(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||hn(e))}var fn=(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))(fn||{}),gn=(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))(gn||{}),mn=(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))(mn||{}),vn=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(vn||{}),yn=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(yn||{});function bn(e){return"__ln"in e}class In{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&&bn(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&&bn(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 wn=(e,t)=>`${e}@${t}`;class Cn{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 In,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||!pn(i))return;const o=lt(i.parentNode)?this.mirror.getId(dn(i)):this.mirror.getId(i.parentNode),s=r(i);if(-1===o||-1===s)return n.addNode(i);const a=$t(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=>{an(e,this.mirror)&&this.iframeManager.addIframe(e),cn(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ln(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),this.stylesheetManager.handleStylesheetFonts(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)kn(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||i(e);for(const e of this.addedSet)En(this.droppedSet,e)||kn(this.removes,e,this.mirror)?En(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(Cn.shouldSkipMutation(e))return}catch(e){}if(on(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;rn(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Wt(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=vt(n);i=gt({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:i,maskInputFn:this.maskInputFn})}if(rn(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"),!Ht(n.tagName,r))if(o.attributes[r]=Bt(this.doc,mt(n.tagName),mt(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)}else"open"===r&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":if(rn(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=lt(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);rn(e.target,this.blockClass,this.blockSelector,!1)||on(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Sn(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||function e(t,n){if(lt(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[wn(n,r)]?Sn(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!lt(e.target)||!ut(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)){try{const t=e.getRootNode();if(t instanceof ShadowRoot&&"closed"===t.mode)return}catch(e){}if(this.mirror.hasNode(e)){if(on(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[wn(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);rn(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach(e=>this.genAdds(e)),ln(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 Sn(e,t){e.delete(t),t.childNodes.forEach(t=>Sn(e,t))}function kn(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 En(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 _n;function An(e){_n=e}function Tn(){_n=void 0}const Rn=e=>{if(!_n)return e;return(...t)=>{try{return e(...t)}catch(e){if(_n&&!0===_n(e))return;throw e}}},Mn=[];function xn(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 Nn(e,t){var n,r;const i=new Cn;Mn.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(Rn(i.processMutations.bind(i)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Ln({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(mn).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(o=>{let s=mt(o);const l=(t=>o=>{const s=xn(o);if(rn(s,r,i,!0))return;let a=null,l=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=vn.Mouse;break;case"touch":a=vn.Touch;break;case"pen":a=vn.Pen}a===vn.Touch?mn[t]===mn.MouseDown?l="TouchStart":mn[t]===mn.MouseUp&&(l="TouchEnd"):vn.Pen}else sn(o)&&(a=vn.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===vn.Touch||l.startsWith("Mouse")&&a===vn.Mouse)&&(a=null)):mn[t]===mn.Click&&(a=c,c=null);const u=sn(o)?o.changedTouches[0]:o;if(!u)return;const d=n.getId(s),{clientX:h,clientY:p}=u;Rn(e)(Object.assign({type:mn[l],id:d,x:h,y:p},null!==a&&{pointerType:a}))})(o);if(window.PointerEvent)switch(mn[o]){case mn.MouseDown:case mn.MouseUp:s=s.replace("mouse","pointer");break;case mn.TouchStart:case mn.TouchEnd:return}a.push(zt(s,l,t))}),Rn(()=>{a.forEach(e=>e())})}function On({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){return zt("scroll",Rn(Kt(Rn(o=>{const s=xn(o);if(!s||rn(s,r,i,!0))return;const a=n.getId(s);if(s===t&&t.defaultView){const n=Qt(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 Dn(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const Pn=["INPUT","TEXTAREA","SELECT"],Vn=new WeakMap;function Fn(e){return function(e,t){if(Wn("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Wn("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Wn("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Wn("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 Un(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function Bn({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}}),Rn(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})):()=>{}}function Hn({mutationCb:e,mirror:t,recoverCSSVariables:n},{win:r}){var i;const o=null===(i=r.Element)||void 0===i?void 0:i.prototype;if(!n||!o||"function"!=typeof o.animate)return()=>{};const s=o.animate;return o.animate=new Proxy(s,{apply:Rn((n,r,i)=>{const o=n.apply(r,i),s=function(e){if(!e||"object"!=typeof e)return null;const t={};let n=!1;const r=(e,r)=>{if(45!==e.charCodeAt(0)||45!==e.charCodeAt(1))return;const i=Array.isArray(r)?r[r.length-1]:r;null!=i&&""!==i&&(t[e]=String(i),n=!0)};if(Array.isArray(e)){for(const t of e)if(t&&"object"==typeof t)for(const e in t)r(e,t[e])}else for(const t in e)r(t,e[t]);return n?t:null}(i[0]);if(s){const n=t.getId(r);-1!==n&&e({texts:[],attributes:[{id:n,attributes:{style:s}}],removes:[],adds:[]})}return o})}),Rn(()=>{try{o.animate=s}catch(e){}})}function qn(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=Nn(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=Kt(Rn(t=>{const n=Date.now()-s;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],s=null}),o),l=Rn(Kt(Rn(e=>{const t=xn(e),{clientX:n,clientY:i}=sn(e)?e.changedTouches[0]:e;s||(s=Xt()),a.push({x:n,y:i,id:r.getId(t),timeOffset:Xt()-s}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?gn.Drag:e instanceof MouseEvent?gn.MouseMove:gn.TouchMove)}),i,{trailing:!1})),u=[zt("mousemove",l,n),zt("touchmove",l,n),zt("drag",l,n)];return Rn(()=>{u.forEach(e=>e())})}(e),o=Ln(e),s=On(e),a=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return zt("resize",Rn(Kt(Rn(()=>{const t=en(),i=tn();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=xn(e);const l=e.isTrusted,d=n&&n.tagName;if(n&&"OPTION"===d&&(n=n.parentElement),!n||!d||Pn.indexOf(d)<0||rn(n,r,i,!0))return;if(n.classList.contains(o)||s&&n.matches(s))return;let p=n.value,f=!1;const g=vt(n)||"";"radio"===g||"checkbox"===g?f=n.checked:(a[d.toLowerCase()]||a[g])&&(p=gt({element:n,maskInputOptions:a,tagName:d,type:g,value:p,maskInputFn:c})),h(n,Rn(Dn)({text:p,isChecked:f,userTriggered:l},u));const m=n.name;"radio"===g&&m&&f&&t.querySelectorAll(`input[type="radio"][name="${CSS.escape(m)}"]`).forEach(e=>{e!==n&&h(e,Rn(Dn)({text:e.value,isChecked:!f,userTriggered:!1},u))})}function h(t,r){const i=Vn.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){Vn.set(t,r);const i=n.getId(t);Rn(e)(Object.assign(Object.assign({},r),{id:i}))}}const p=("last"===l.input?["change"]:["input","change"]).map(e=>zt(e,Rn(d),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];try{f.document.querySelectorAll('input[type="checkbox"]').forEach(e=>{f.Object.getOwnPropertyDescriptor(e,"checked")&&m.push([e,"checked"])})}catch(e){}return g&&g.set&&p.push(...m.map(e=>Yt(e[0],e[1],{set(){Rn(d)({target:this,isTrusted:!1})}},!1,f))),Rn(()=>{p.forEach(e=>e())})}(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){const s=Rn(o=>Kt(Rn(i=>{const s=xn(i);if(!s||rn(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=[zt("play",s(0),o),zt("pause",s(1),o),zt("seeked",s(2),o),zt("volumechange",s(3),o),zt("ratechange",s(4),o)];return Rn(()=>{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:Rn((r,i,o)=>{const[s,a]=o,{id:c,styleId:l}=Un(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:Rn((r,i,o)=>{const[s]=o,{id:a,styleId:c}=Un(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:Rn((r,i,o)=>{const[s]=o,{id:a,styleId:c}=Un(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:Rn((r,i,o)=>{const[s]=o,{id:a,styleId:c}=Un(i,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replaceSync:s}),r.apply(i,o)})}));const c={};jn("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(jn("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),jn("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),jn("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:Rn((r,i,o)=>{const[s,a]=o,{id:c,styleId:l}=Un(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:Rn((r,i,o)=>{const[s]=o,{id:a,styleId:c}=Un(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)})})}),Rn(()=>{try{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})}catch(e){}})}(e,{win:n}),d=Bn(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:Rn((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}=Un(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:Rn((i,o,a)=>{var c;const[l]=a;if(n.has(l))return s.apply(o,[l]);const{id:u,styleId:d}=Un(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)})}),Rn(()=>{try{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s}catch(e){}})}(e,{win:n}),p=Hn(e,{win:n}),f=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=Jt(t.fonts,"add",(function(t){return function(n){return setTimeout(Rn(()=>{const t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}}));return r.push(()=>{try{n.FontFace=o}catch(e){}}),r.push(s),Rn(()=>{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=Rn(()=>{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;rn(s,r,i,!0)||rn(l,r,i,!0)||a.push({start:n.getId(s),startOffset:c,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),zt("selectionchange",a)}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,n,t.options));return Rn(()=>{Mn.forEach(e=>e.reset()),r.disconnect(),i(),o(),s(),a(),c(),l(),u(),d(),h(),p(),f(),g(),m.forEach(e=>e())})}function Wn(e){return void 0!==window[e]}function jn(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Gn{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 $n{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Gn(Mt),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 Gn(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 fn.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:fn.IncrementalSnapshot,data:{source:gn.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case fn.Meta:case fn.Load:case fn.DomContentLoaded:return!1;case fn.Plugin:return t;case fn.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case fn.IncrementalSnapshot:switch(t.data.source){case gn.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 gn.Drag:case gn.TouchMove:case gn.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case gn.ViewportResize:return!1;case gn.MediaInteraction:case gn.MouseInteraction:case gn.Scroll:case gn.CanvasMutation:case gn.Input:return this.replaceIds(t.data,e,["id"]),t;case gn.StyleSheetRule:case gn.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case gn.Font:return t;case gn.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case gn.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===ot.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class zn{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(!ut(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=Nn(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(On(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(Bn({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;Jt(e.prototype,"attachShadow",(function(e){return function(r){const i=e.call(this,r);return this.shadowRoot&&pn(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 Zn(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"==typeof SuppressedError&&SuppressedError;for(var Kn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Jn=0;Jn<Kn.length;Jn++)Yn[Kn.charCodeAt(Jn)]=Jn;const Xn=new Map;const Qn=(e,t,n)=>{if(!e||!nr(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Xn.get(e);return n||(n=new Map,Xn.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 er(e,t,n){if(e instanceof Array)return e.map(e=>er(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+=Kn[n[t]>>2],i+=Kn[(3&n[t])<<4|n[t+1]>>4],i+=Kn[(15&n[t+1])<<2|n[t+2]>>6],i+=Kn[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:[er(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:[er(e.data,t,n),e.width,e.height]}}if(nr(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Qn(e,t,n)}}return e}const tr=(e,t,n)=>[...e].map(e=>er(e,t,n)),nr=(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 rr(e,t,n,r){const i=[];try{const o=Jt(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i,...o){if(!rn(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 ir(e,t,n,r,i,o,s){const a=[],c=Object.getOwnPropertyNames(e);for(const o of c)if(!["constructor","isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(o))try{if("function"!=typeof e[o])continue;const c=Jt(e,o,(function(e){return function(...a){const c=e.apply(this,a);if(Qn(c,s,this),"tagName"in this.canvas&&!rn(this.canvas,r,i,!0)){const e=tr([...a],s,this),r={type:t,property:o,args:e};n(this.canvas,r)}return c}}));a.push(c)}catch(r){const i=Yt(e,o,{set(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});a.push(i)}return a}function or(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 sr,ar,cr,lr,ur=(sr="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLgoKICBQZXJtaXNzaW9uIHRvIHVzZSwgY29weSwgbW9kaWZ5LCBhbmQvb3IgZGlzdHJpYnV0ZSB0aGlzIHNvZnR3YXJlIGZvciBhbnkKICBwdXJwb3NlIHdpdGggb3Igd2l0aG91dCBmZWUgaXMgaGVyZWJ5IGdyYW50ZWQuCgogIFRIRSBTT0ZUV0FSRSBJUyBQUk9WSURFRCAiQVMgSVMiIEFORCBUSEUgQVVUSE9SIERJU0NMQUlNUyBBTEwgV0FSUkFOVElFUyBXSVRICiAgUkVHQVJEIFRPIFRISVMgU09GVFdBUkUgSU5DTFVESU5HIEFMTCBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZCiAgQU5EIEZJVE5FU1MuIElOIE5PIEVWRU5UIFNIQUxMIFRIRSBBVVRIT1IgQkUgTElBQkxFIEZPUiBBTlkgU1BFQ0lBTCwgRElSRUNULAogIElORElSRUNULCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVMgT1IgQU5ZIERBTUFHRVMgV0hBVFNPRVZFUiBSRVNVTFRJTkcgRlJPTQogIExPU1MgT0YgVVNFLCBEQVRBIE9SIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SCiAgT1RIRVIgVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgogIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KCiAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgewogICAgZnVuY3Rpb24gYWRvcHQodmFsdWUpIHsgcmV0dXJuIHZhbHVlIGluc3RhbmNlb2YgUCA/IHZhbHVlIDogbmV3IFAoZnVuY3Rpb24gKHJlc29sdmUpIHsgcmVzb2x2ZSh2YWx1ZSk7IH0pOyB9CiAgICByZXR1cm4gbmV3IChQIHx8IChQID0gUHJvbWlzZSkpKGZ1bmN0aW9uIChyZXNvbHZlLCByZWplY3QpIHsKICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9CiAgICAgICAgZnVuY3Rpb24gcmVqZWN0ZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3JbInRocm93Il0odmFsdWUpKTsgfSBjYXRjaCAoZSkgeyByZWplY3QoZSk7IH0gfQogICAgICAgIGZ1bmN0aW9uIHN0ZXAocmVzdWx0KSB7IHJlc3VsdC5kb25lID8gcmVzb2x2ZShyZXN1bHQudmFsdWUpIDogYWRvcHQocmVzdWx0LnZhbHVlKS50aGVuKGZ1bGZpbGxlZCwgcmVqZWN0ZWQpOyB9CiAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOwogICAgfSk7CiAgfQoKICB0eXBlb2YgU3VwcHJlc3NlZEVycm9yID09PSAiZnVuY3Rpb24iID8gU3VwcHJlc3NlZEVycm9yIDogZnVuY3Rpb24gKGVycm9yLCBzdXBwcmVzc2VkLCBtZXNzYWdlKSB7CiAgICB2YXIgZSA9IG5ldyBFcnJvcihtZXNzYWdlKTsKICAgIHJldHVybiBlLm5hbWUgPSAiU3VwcHJlc3NlZEVycm9yIiwgZS5lcnJvciA9IGVycm9yLCBlLnN1cHByZXNzZWQgPSBzdXBwcmVzc2VkLCBlOwogIH07CgogIC8qCiAgICogYmFzZTY0LWFycmF5YnVmZmVyIDEuMC4xIDxodHRwczovL2dpdGh1Yi5jb20vbmlrbGFzdmgvYmFzZTY0LWFycmF5YnVmZmVyPgogICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICogUmVsZWFzZWQgdW5kZXIgTUlUIExpY2Vuc2UKICAgKi8KICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgLy8gVXNlIGEgbG9va3VwIHRhYmxlIHRvIGZpbmQgdGhlIGluZGV4LgogIHZhciBsb29rdXAgPSB0eXBlb2YgVWludDhBcnJheSA9PT0gJ3VuZGVmaW5lZCcgPyBbXSA6IG5ldyBVaW50OEFycmF5KDI1Nik7CiAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaSwgbGVuID0gYnl0ZXMubGVuZ3RoLCBiYXNlNjQgPSAnJzsKICAgICAgZm9yIChpID0gMDsgaSA8IGxlbjsgaSArPSAzKSB7CiAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbKChieXRlc1tpXSAmIDMpIDw8IDQpIHwgKGJ5dGVzW2kgKyAxXSA+PiA0KV07CiAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbKChieXRlc1tpICsgMV0gJiAxNSkgPDwgMikgfCAoYnl0ZXNbaSArIDJdID4+IDYpXTsKICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgIH0KICAgICAgaWYgKGxlbiAlIDMgPT09IDIpIHsKICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICB9CiAgICAgIGVsc2UgaWYgKGxlbiAlIDMgPT09IDEpIHsKICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgfQogICAgICByZXR1cm4gYmFzZTY0OwogIH07CgogIGNvbnN0IGxhc3RCbG9iTWFwID0gbmV3IE1hcCgpOw0KICBjb25zdCB0cmFuc3BhcmVudEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICBjb25zdCBpZCA9IGAke3dpZHRofS0ke2hlaWdodH1gOw0KICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgIGlmICh0cmFuc3BhcmVudEJsb2JNYXAuaGFzKGlkKSkNCiAgICAgICAgICAgICAgICAgIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsNCiAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoJzJkJyk7DQogICAgICAgICAgICAgIGNvbnN0IGJsb2IgPSB5aWVsZCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7DQogICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOw0KICAgICAgICAgICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOw0KICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgIH0NCiAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgIH0NCiAgICAgIH0pOw0KICB9DQogIGNvbnN0IHdvcmtlciA9IHNlbGY7DQogIHdvcmtlci5vbm1lc3NhZ2UgPSBmdW5jdGlvbiAoZSkgew0KICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICBpZiAoJ09mZnNjcmVlbkNhbnZhcycgaW4gZ2xvYmFsVGhpcykgew0KICAgICAgICAgICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7DQogICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgY29uc3QgY3R4ID0gb2Zmc2NyZWVuLmdldENvbnRleHQoJzJkJyk7DQogICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgYml0bWFwLmNsb3NlKCk7DQogICAgICAgICAgICAgIGNvbnN0IGJsb2IgPSB5aWVsZCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7DQogICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOw0KICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgaWYgKGxhc3RCbG9iTWFwLmdldChpZCkgPT09IGJhc2U2NCkNCiAgICAgICAgICAgICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsNCiAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgIGlkLA0KICAgICAgICAgICAgICAgICAgdHlwZSwNCiAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgIHdpZHRoLA0KICAgICAgICAgICAgICAgICAgaGVpZ2h0LA0KICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOw0KICAgICAgICAgIH0NCiAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkOiBlLmRhdGEuaWQgfSk7DQogICAgICAgICAgfQ0KICAgICAgfSk7DQogIH07Cgp9KSgpOwoK",ar=null,cr=!1,function(e){return lr=lr||or(sr,ar,cr),new Worker(lr,e)});class dr{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=rr(t,n,r,!0),s=new Map,a=new ur;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:yn["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=>{rn(t,n,r,!0)||e.push(t)}),e})().forEach(e=>Zn(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=rr(e,t,n,!1),i=function(e,t,n,r){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)if("constructor"!==s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=Jt(t.CanvasRenderingContext2D.prototype,s,(function(i){return function(...o){return rn(this.canvas,n,r,!0)||setTimeout(()=>{const n=tr([...o],t,this);e(this.canvas,{type:yn["2D"],property:s,args:n})},0),i.apply(this,o)}}));i.push(o)}catch(n){const r=Yt(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:yn["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(...ir(t.WebGLRenderingContext.prototype,yn.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&o.push(...ir(t.WebGL2RenderingContext.prototype,yn.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)}}function hr(e){return e.replace(/^["']|["']$/g,"")}const pr={"font-style":"style","font-weight":"weight","font-stretch":"stretch","font-display":"display","font-variant":"variant","font-feature-settings":"featureSettings","unicode-range":"unicodeRange"};function fr(e){const t={};for(const n of Object.keys(pr)){const r=e.match(new RegExp(`(?:^|[;{\\s])${n}\\s*:\\s*([^;}]+)`,"i"));if(r){t[pr[n]]=r[1].trim()}}return Object.keys(t).length?t:void 0}function gr(e){if("undefined"==typeof document||!document.fonts)return!0;const t=hr(e);for(const e of document.fonts)if(hr(e.family)===t&&"loaded"===e.status)return!0;return!1}function mr(e){if(e.type!==ot.Element)return!1;if("link"!==e.tagName)return!1;const t=e.attributes.rel;return!("string"!=typeof t||!/(^|\s)stylesheet(\s|$)/i.test(t))&&"string"==typeof e.attributes.href}function vr(e,t){return Zn(this,void 0,void 0,(function*(){try{const n=/@font-face\s*{([^}]*)}/gi;let r;for(;null!==(r=n.exec(e));){const e=r[1],n=e.match(/font-family\s*:\s*([^;{]+)/i),i=e.match(/src\s*:\s*((?:url\([^)]+\)|[^;{])+)[\s;}]/i);if(!n||!i)continue;const o=n[1].trim();if(!gr(o))continue;const s=i[1].trim(),a=Array.from(s.matchAll(/url\(["']?(.*?)["']?\)/gi)).map(e=>e[1]);if(0===a.length)continue;const c=fr(e);for(const e of a)if(!e.startsWith("data:"))try{const n=yield fetch(e);if(!n.ok)continue;const r=yield n.arrayBuffer(),i=JSON.stringify(Array.from(new Uint8Array(r)));t({family:hr(o),fontSource:i,buffer:!0,descriptors:c});break}catch(e){}}}catch(e){}}))}class yr{constructor(e){this.trackedLinkElements=new WeakSet,this.linkStylesheetFetchCache=new Map,this.styleMirror=new un,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb,this.fontCb=e.fontCb,this.inlineStylesheetFonts=e.inlineStylesheetFonts}attachLinkElement(e,t){"_cssText"in t.attributes&&this.emitAttributeMutations([{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:pt(e),index:t}))})}n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.linkStylesheetFetchCache=new Map}handleStylesheetFonts(e){this.inlineStylesheetFonts&&e.type===ot.Element&&e.attributes&&("string"==typeof e.attributes._cssText?vr(e.attributes._cssText,this.fontCb):mr(e)&&this.inlineLinkAndExtractFonts(e.id,e.attributes.href))}emitFontsFromSnapshot(e){return Zn(this,void 0,void 0,(function*(){if(!this.inlineStylesheetFonts)return;const t=[],n=new Map;!function e(r){if(r.type===ot.Element){if(r.attributes&&"string"==typeof r.attributes._cssText)t.push(r.attributes._cssText);else if(mr(r)){const e=r.attributes.href,t=n.get(e)||[];t.push(r.id),n.set(e,t)}}else r.type===ot.Text&&r.isStyle&&t.push(r.textContent);"childNodes"in r&&r.childNodes.forEach(e)}(e);const r=[];for(const e of t)r.push(vr(e,this.fontCb));for(const[e,t]of n)r.push(this.inlineLinkAndExtractFonts(t,e));yield Promise.all(r)}))}inlineLinkAndExtractFonts(e,t){return Zn(this,void 0,void 0,(function*(){const n=yield this.inlineByFetch(t);if(!n)return;const r=Array.isArray(e)?e:[e];this.emitAttributeMutations(r.map(e=>({id:e,attributes:{_cssText:n,rel:null,href:null}}))),yield vr(n,this.fontCb)}))}emitAttributeMutations(e){this.mutationCb({adds:[],removes:[],texts:[],attributes:e})}inlineByFetch(e){const t=this.linkStylesheetFetchCache.get(e);if(t)return t;const n=(()=>Zn(this,void 0,void 0,(function*(){try{const t=yield fetch(e);if(!t.ok)return null;return Dt(yield t.text(),e)}catch(e){return null}})))();return this.linkStylesheetFetchCache.set(e,n),n}trackStylesheetInLinkElement(e){}}class br{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 Ir(e){return Object.assign(Object.assign({},e),{timestamp:Xt()})}let wr,Cr,Sr,kr=!1;const Er=new ft;function _r(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,inlineStylesheetFonts:h=!1,maskAllInputs:p,maskInputOptions:f,slimDOMOptions:g,maskInputFn:m,maskTextFn:v,hooks:y,packFn:b,sampling:I={},dataURLOptions:w={},mousemoveWait:C,recordCanvas:S=!1,recordCrossOriginIframes:k=!1,recordAfter:E=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:_=!1,collectFonts:A=!1,inlineImages:T=!1,plugins:R,keepIframeSrcFn:M=(()=>!1),ignoreCSSAttributes:x=new Set([]),errorHandler:N,ignoreIframes:L=!1,recoverCSSVariables:O=!1}=e;An(N);const D=!k||window.parent===window;let P=!1;if(!D)try{window.parent.document&&(P=!1)}catch(e){P=!0}if(D&&!t)throw new Error("emit function is required");void 0!==C&&void 0===I.mousemove&&(I.mousemove=C),Er.reset();const V=!0===p?{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!==f?f:{password:!0},F=!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 U;!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 B=0;const H=e=>{for(const t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return b&&!P&&(e=b(e)),e};wr=(e,i)=>{var o;if(!(null===(o=Mn[0])||void 0===o?void 0:o.isFrozen())||e.type===fn.FullSnapshot||e.type===fn.IncrementalSnapshot&&e.data.source===gn.Mutation||Mn.forEach(e=>e.unfreeze()),D)null==t||t(H(e),i);else if(P){const t={type:"rrweb",event:H(e),origin:window.location.origin,isCheckout:i};window.parent.postMessage(t,"*")}if(e.type===fn.FullSnapshot)U=e,B=0;else if(e.type===fn.IncrementalSnapshot){if(e.data.source===gn.Mutation&&e.data.isAttachIframe)return;B++;const t=r&&B>=r,i=n&&e.timestamp-U.timestamp>n;(t||i)&&Cr(!0)}};const q=e=>{wr(Ir({type:fn.IncrementalSnapshot,data:Object.assign({source:gn.Mutation},e)}))},W=e=>wr(Ir({type:fn.IncrementalSnapshot,data:Object.assign({source:gn.Scroll},e)})),j=e=>wr(Ir({type:fn.IncrementalSnapshot,data:Object.assign({source:gn.CanvasMutation},e)})),G=new yr({mutationCb:q,adoptedStyleSheetCb:e=>wr(Ir({type:fn.IncrementalSnapshot,data:Object.assign({source:gn.AdoptedStyleSheet},e)})),fontCb:e=>wr(Ir({type:fn.IncrementalSnapshot,data:Object.assign({source:gn.Font},e)})),inlineStylesheetFonts:h}),$=new $n({mirror:Er,mutationCb:q,stylesheetManager:G,recordCrossOriginIframes:k,wrappedEmit:wr,ignoreIframes:L});for(const e of R||[])e.getMirror&&e.getMirror({nodeMirror:Er,crossOriginIframeMirror:$.crossOriginIframeMirror,crossOriginIframeStyleMirror:$.crossOriginIframeStyleMirror});const z=new br;Sr=new dr({recordCanvas:S,mutationCb:j,win:window,blockClass:o,blockSelector:s,mirror:Er,sampling:I.canvas,dataURLOptions:w});const Z=new zn({mutationCb:q,scrollCb:W,bypassOptions:{blockClass:o,blockSelector:s,deferProcessMutations:i,maskTextClass:l,maskTextSelector:u,inlineStylesheet:d,maskInputOptions:V,dataURLOptions:w,maskTextFn:v,maskInputFn:m,recordCanvas:S,inlineImages:T,sampling:I,slimDOMOptions:F,iframeManager:$,stylesheetManager:G,canvasManager:Sr,keepIframeSrcFn:M,processedNodeManager:z},mirror:Er});Cr=(e=!1)=>{wr(Ir({type:fn.Meta,data:{href:window.location.href,width:tn(),height:en()}}),e),G.reset(),Z.init(),Mn.forEach(e=>e.lock());const t=function(e,t){var n,r,i=t||{},o=i.mirror,s=void 0===o?new ft: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,f=void 0===p?null:p,g=i.inlineStylesheet,m=void 0===g||g,v=i.inlineImages,y=void 0!==v&&v,b=i.recordCanvas,I=void 0!==b&&b,w=i.maskAllInputs,C=void 0!==w&&w,S=i.maskTextFn,k=i.maskInputFn,E=i.slimDOM,_=void 0!==E&&E,A=i.dataURLOptions,T=i.preserveWhiteSpace,R=i.onSerialize,M=i.onIframeLoad,x=i.iframeLoadTimeout,N=i.onStylesheetLoad,L=i.stylesheetLoadTimeout,O=i.keepIframeSrcFn,D=void 0===O?function(){return!1}:O,P=i.recoverCSSVariables,V=void 0!==P&&P,F=!0===C?{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===C?{password:!0}:C,U=!0===_||"all"===_?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===_,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===_?{}:_;if("string"==typeof h){var B=e.querySelectorAll("."+h);if(n=!1,r=Array.from(B),f){var H=e.querySelectorAll(f);r=r.concat(Array.from(H))}}return $t(e,{doc:e,mirror:s,blockClass:c,blockSelector:u,maskTextClass:h,maskTextSelector:f,skipChild:!1,inlineStylesheet:m,maskInputOptions:F,maskTextFn:S,maskInputFn:k,slimDOMOptions:U,dataURLOptions:A,inlineImages:y,recordCanvas:I,preserveWhiteSpace:T,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:x,onStylesheetLoad:N,stylesheetLoadTimeout:L,keepIframeSrcFn:D,newlyAddedElement:!1,maskCurrentNode:n,maskedElements:r,cssVariableOverrides:V?Et(e):void 0})}(document,{mirror:Er,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:u,inlineStylesheet:d,maskAllInputs:V,maskTextFn:v,maskInputFn:m,slimDOM:F,dataURLOptions:w,recordCanvas:S,inlineImages:T,recoverCSSVariables:O,onSerialize:e=>{an(e,Er)&&$.addIframe(e),cn(e,Er)&&G.trackLinkElement(e),ln(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{$.attachIframe(e,t),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{G.attachLinkElement(e,t),G.handleStylesheetFonts(t)},keepIframeSrcFn:M});t&&(wr(Ir({type:fn.FullSnapshot,data:{node:t,initialOffset:Qt(window)}}),e),setTimeout(()=>{G.emitFontsFromSnapshot(t)},0),Mn.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&G.adoptStyleSheets(document.adoptedStyleSheets,Er.getId(document)))};try{const e=[],t=e=>{var t;return Rn(qn)({mutationCb:q,mousemoveCb:(e,t)=>wr(Ir({type:fn.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>wr(Ir({type:fn.IncrementalSnapshot,data:Object.assign({source:gn.MouseInteraction},e)})),scrollCb:W,viewportResizeCb:e=>wr(Ir({type:fn.IncrementalSnapshot,data:Object.assign({source:gn.ViewportResize},e)})),inputCb:e=>wr(Ir({type:fn.IncrementalSnapshot,data:Object.assign({source:gn.Input},e)})),mediaInteractionCb:e=>wr(Ir({type:fn.IncrementalSnapshot,data:Object.assign({source:gn.MediaInteraction},e)})),styleSheetRuleCb:e=>wr(Ir({type:fn.IncrementalSnapshot,data:Object.assign({source:gn.StyleSheetRule},e)})),styleDeclarationCb:e=>wr(Ir({type:fn.IncrementalSnapshot,data:Object.assign({source:gn.StyleDeclaration},e)})),canvasMutationCb:j,fontCb:e=>wr(Ir({type:fn.IncrementalSnapshot,data:Object.assign({source:gn.Font},e)})),selectionCb:e=>{wr(Ir({type:fn.IncrementalSnapshot,data:Object.assign({source:gn.Selection},e)}))},blockClass:o,deferProcessMutations:i,ignoreClass:a,ignoreSelector:c,maskTextClass:l,maskTextSelector:u,maskInputOptions:V,inlineStylesheet:d,sampling:I,recordCanvas:S,inlineImages:T,userTriggeredOnInput:_,collectFonts:A,doc:e,maskInputFn:m,maskTextFn:v,keepIframeSrcFn:M,blockSelector:s,slimDOMOptions:F,dataURLOptions:w,mirror:Er,iframeManager:$,stylesheetManager:G,shadowDomManager:Z,processedNodeManager:z,canvasManager:Sr,ignoreCSSAttributes:x,recoverCSSVariables:O,plugins:(null===(t=null==R?void 0:R.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>wr(Ir({type:fn.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},y)};$.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){}});const n=()=>{Cr(),e.push(t(document)),kr=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(zt("DOMContentLoaded",()=>{wr(Ir({type:fn.DomContentLoaded,data:{}})),"DOMContentLoaded"===E&&n()})),e.push(zt("load",()=>{wr(Ir({type:fn.Load,data:{}})),"load"===E&&n()},window))),()=>{e.forEach(e=>e()),z.destroy(),kr=!1,Tn()}}catch(e){}}_r.addCustomEvent=(e,t)=>{if(!kr)throw new Error("please add custom event after start recording");wr(Ir({type:fn.Custom,data:{tag:e,payload:t}}))},_r.freezePage=()=>{Mn.forEach(e=>e.freeze())},_r.takeFullSnapshot=e=>{if(!kr)throw new Error("please take full snapshot after start recording");Cr(e)},_r.mirror=Er;const{addCustomEvent:Ar}=_r,{freezePage:Tr}=_r;var Rr=Uint8Array,Mr=Uint16Array,xr=Uint32Array,Nr=new Rr([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]),Lr=new Rr([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]),Or=new Rr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Dr=function(e,t){for(var n=new Mr(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new xr(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]},Pr=Dr(Nr,2),Vr=Pr[0],Fr=Pr[1];Vr[28]=258,Fr[258]=28;for(var Ur=Dr(Lr,0),Br=(Ur[0],Ur[1]),Hr=new Mr(32768),qr=0;qr<32768;++qr){var Wr=(43690&qr)>>>1|(21845&qr)<<1;Wr=(61680&(Wr=(52428&Wr)>>>2|(13107&Wr)<<2))>>>4|(3855&Wr)<<4,Hr[qr]=((65280&Wr)>>>8|(255&Wr)<<8)>>>1}var jr=function(e,t,n){for(var r=e.length,i=0,o=new Mr(t);i<r;++i)++o[e[i]-1];var s,a=new Mr(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new Mr(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[Hr[d]>>>c]=l}else for(s=new Mr(r),i=0;i<r;++i)s[i]=Hr[a[e[i]-1]++]>>>15-e[i];return s},Gr=new Rr(288);for(qr=0;qr<144;++qr)Gr[qr]=8;for(qr=144;qr<256;++qr)Gr[qr]=9;for(qr=256;qr<280;++qr)Gr[qr]=7;for(qr=280;qr<288;++qr)Gr[qr]=8;var $r=new Rr(32);for(qr=0;qr<32;++qr)$r[qr]=5;var zr=jr(Gr,9,0),Zr=jr($r,5,0),Kr=function(e){return(e/8>>0)+(7&e&&1)},Yr=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Mr?Mr:e instanceof xr?xr:Rr)(n-t);return r.set(e.subarray(t,n)),r},Jr=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Xr=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},Qr=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 Rr(0),0];if(1==i){var s=new Rr(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 Mr(h+1),f=ei(n[u-1],p,0);if(f>t){r=0;var g=0,m=f-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;g+=v-(1<<f-p[y]),p[y]=t}for(g>>>=m;g>0;){var b=o[r].s;p[b]<t?g-=1<<t-p[b]++-1:++r}for(;r>=0&&g;--r){var I=o[r].s;p[I]==t&&(--p[I],++g)}f=t}return[new Rr(p),f]},ei=function(e,t,n){return-1==e.s?Math.max(ei(e.l,t,n+1),ei(e.r,t,n+1)):t[e.s]=n},ti=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Mr(++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]},ni=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},ri=function(e,t,n){var r=n.length,i=Kr(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)},ii=function(e,t,n,r,i,o,s,a,c,l,u){Jr(t,u++,n),++i[256];for(var d=Qr(i,15),h=d[0],p=d[1],f=Qr(o,15),g=f[0],m=f[1],v=ti(h),y=v[0],b=v[1],I=ti(g),w=I[0],C=I[1],S=new Mr(19),k=0;k<y.length;++k)S[31&y[k]]++;for(k=0;k<w.length;++k)S[31&w[k]]++;for(var E=Qr(S,7),_=E[0],A=E[1],T=19;T>4&&!_[Or[T-1]];--T);var R,M,x,N,L=l+5<<3,O=ni(i,Gr)+ni(o,$r)+s,D=ni(i,h)+ni(o,g)+s+14+3*T+ni(S,_)+(2*S[16]+3*S[17]+7*S[18]);if(L<=O&&L<=D)return ri(t,u,e.subarray(c,c+l));if(Jr(t,u,1+(D<O)),u+=2,D<O){R=jr(h,p,0),M=h,x=jr(g,m,0),N=g;var P=jr(_,A,0);Jr(t,u,b-257),Jr(t,u+5,C-1),Jr(t,u+10,T-4),u+=14;for(k=0;k<T;++k)Jr(t,u+3*k,_[Or[k]]);u+=3*T;for(var V=[y,w],F=0;F<2;++F){var U=V[F];for(k=0;k<U.length;++k){var B=31&U[k];Jr(t,u,P[B]),u+=_[B],B>15&&(Jr(t,u,U[k]>>>5&127),u+=U[k]>>>12)}}}else R=zr,M=Gr,x=Zr,N=$r;for(k=0;k<a;++k)if(r[k]>255){B=r[k]>>>18&31;Xr(t,u,R[B+257]),u+=M[B+257],B>7&&(Jr(t,u,r[k]>>>23&31),u+=Nr[B]);var H=31&r[k];Xr(t,u,x[H]),u+=N[H],H>3&&(Xr(t,u,r[k]>>>5&8191),u+=Lr[H])}else Xr(t,u,R[r[k]]),u+=M[r[k]];return Xr(t,u,R[256]),u+M[256]},oi=new xr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),si=new Rr(0),ai=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new Rr(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=ri(c,l,e.subarray(u,d)):(c[u]=o,l=ri(c,l,e.subarray(u,s)))}else{for(var h=oi[t-1],p=h>>>13,f=8191&h,g=(1<<n)-1,m=new Mr(32768),v=new Mr(g+1),y=Math.ceil(n/3),b=2*y,I=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&g},w=new xr(25e3),C=new Mr(288),S=new Mr(32),k=0,E=0,_=(u=0,0),A=0,T=0;u<s;++u){var R=I(u),M=32767&u,x=v[R];if(m[M]=x,v[R]=M,A<=u){var N=s-u;if((k>7e3||_>24576)&&N>423){l=ii(e,c,0,w,C,S,E,_,T,u-T,l),_=k=E=0,T=u;for(var L=0;L<286;++L)C[L]=0;for(L=0;L<30;++L)S[L]=0}var O=2,D=0,P=f,V=M-x&32767;if(N>2&&R==I(u-V))for(var F=Math.min(p,N)-1,U=Math.min(32767,u),B=Math.min(258,N);V<=U&&--P&&M!=x;){if(e[u+O]==e[u+O-V]){for(var H=0;H<B&&e[u+H]==e[u+H-V];++H);if(H>O){if(O=H,D=V,H>F)break;var q=Math.min(V,H-2),W=0;for(L=0;L<q;++L){var j=u-V+L+32768&32767,G=j-m[j]+32768&32767;G>W&&(W=G,x=j)}}}V+=(M=x)-(x=m[M])+32768&32767}if(D){w[_++]=268435456|Fr[O]<<18|Br[D];var $=31&Fr[O],z=31&Br[D];E+=Nr[$]+Lr[z],++C[257+$],++S[z],A=u+O,++k}else w[_++]=e[u],++C[e[u]]}}l=ii(e,c,o,w,C,S,E,_,T,u-T,l),o||(l=ri(c,l,si))}return Yr(a,0,r+Kr(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 ci(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=ai(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 li=(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}(ci(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Rr(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 Rr(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 Yr(r,0,i)}(JSON.stringify(n)),t),!0)};var ui,di,hi=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},pi=function(e){if("loading"===document.readyState)return"loading";var t=hi();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"},fi=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},gi=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:fi(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},mi=-1,vi=function(){return mi},yi=function(e){addEventListener("pageshow",(function(t){t.persisted&&(mi=t.timeStamp,e(t))}),!0)},bi=function(){var e=hi();return e&&e.activationStart||0},Ii=function(e,t){var n=hi(),r="navigate";return vi()>=0?r="back-forward-cache":n&&(document.prerendering||bi()>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}},wi=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){}},Ci=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))}},Si=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},ki=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Ei=function(e){var t=!1;return function(){t||(e(),t=!0)}},_i=-1,Ai=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Ti=function(e){"hidden"===document.visibilityState&&_i>-1&&(_i="visibilitychange"===e.type?e.timeStamp:0,Mi())},Ri=function(){addEventListener("visibilitychange",Ti,!0),addEventListener("prerenderingchange",Ti,!0)},Mi=function(){removeEventListener("visibilitychange",Ti,!0),removeEventListener("prerenderingchange",Ti,!0)},xi=function(){return _i<0&&(_i=Ai(),Ri(),yi((function(){setTimeout((function(){_i=Ai(),Ri()}),0)}))),{get firstHiddenTime(){return _i}}},Ni=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Li=[1800,3e3],Oi=function(e,t){t=t||{},Ni((function(){var n,r=xi(),i=Ii("FCP"),o=wi("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-bi(),0),i.entries.push(e),n(!0)))}))}));o&&(n=Ci(e,i,Li,t.reportAllChanges),yi((function(r){i=Ii("FCP"),n=Ci(e,i,Li,t.reportAllChanges),Si((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},Di=[.1,.25],Pi=function(e,t){!function(e,t){t=t||{},Oi(Ei((function(){var n,r=Ii("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=wi("layout-shift",s);a&&(n=Ci(e,r,Di,t.reportAllChanges),ki((function(){s(a.takeRecords()),n(!0)})),yi((function(){i=0,r=Ii("CLS",0),n=Ci(e,r,Di,t.reportAllChanges),Si((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:gi(i.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:i,largestShiftEntry:r,loadState:pi(r.startTime)})}}return Object.assign(e,{attribution:n})}(t);e(n)}),t)},Vi=function(e,t){Oi((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:pi(vi())};if(e.entries.length){var n=hi(),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:pi(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)},Fi=0,Ui=1/0,Bi=0,Hi=function(e){e.forEach((function(e){e.interactionId&&(Ui=Math.min(Ui,e.interactionId),Bi=Math.max(Bi,e.interactionId),Fi=Bi?(Bi-Ui)/7+1:0)}))},qi=function(){return ui?Fi:performance.interactionCount||0},Wi=function(){"interactionCount"in performance||ui||(ui=wi("event",Hi,{type:"event",buffered:!0,durationThreshold:0}))},ji=[],Gi=new Map,$i=0,zi=[],Zi=function(e){if(zi.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=ji[ji.length-1],n=Gi.get(e.interactionId);if(n||ji.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]};Gi.set(r.id,r),ji.push(r)}ji.sort((function(e,t){return t.latency-e.latency})),ji.length>10&&ji.splice(10).forEach((function(e){return Gi.delete(e.id)}))}}},Ki=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Ei(e),"hidden"===document.visibilityState?e():(n=t(e),ki(e)),n},Yi=[200,500],Ji=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},Ni((function(){var n;Wi();var r,i=Ii("INP"),o=function(e){Ki((function(){e.forEach(Zi);var t=function(){var e=Math.min(ji.length-1,Math.floor((qi()-$i)/50));return ji[e]}();t&&t.latency!==i.value&&(i.value=t.latency,i.entries=t.entries,r())}))},s=wi("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=Ci(e,i,Yi,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),ki((function(){o(s.takeRecords()),r(!0)})),yi((function(){$i=qi(),ji.length=0,Gi.clear(),i=Ii("INP"),r=Ci(e,i,Yi,t.reportAllChanges)})))})))},Xi=[],Qi=[],eo=0,to=new WeakMap,no=new Map,ro=-1,io=function(e){Xi=Xi.concat(e),oo()},oo=function(){ro<0&&(ro=Ki(so))},so=function(){no.size>10&&no.forEach((function(e,t){Gi.has(t)||no.delete(t)}));var e=ji.map((function(e){return to.get(e.entries[0])})),t=Qi.length-50;Qi=Qi.filter((function(n,r){return r>=t||e.includes(n)}));for(var n=new Set,r=0;r<Qi.length;r++){var i=Qi[r];ho(i.startTime,i.processingEnd).forEach((function(e){n.add(e)}))}var o=Xi.length-1-50;Xi=Xi.filter((function(e,t){return e.startTime>eo&&t>o||n.has(e)})),ro=-1};zi.push((function(e){e.interactionId&&e.target&&!no.has(e.interactionId)&&no.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;eo=Math.max(eo,e.processingEnd);for(var r=Qi.length-1;r>=0;r--){var i=Qi[r];if(Math.abs(n-i.renderTime)<=8){(t=i).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},Qi.push(t)),(e.interactionId||"first-input"===e.entryType)&&to.set(e,t),oo()}));var ao,co,lo,uo,ho=function(e,t){for(var n,r=[],i=0;n=Xi[i];i++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r},po=function(e,t){di||(di=wi("long-animation-frame",io)),Ji((function(t){var n=function(e){var t=e.entries[0],n=to.get(t),r=t.processingStart,i=n.processingEnd,o=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=ho(t.startTime,i),a=e.entries.find((function(e){return e.target})),c=a&&a.target||no.get(t.interactionId),l=[t.startTime+t.duration,i].concat(s.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,l),d={interactionTarget:gi(c),interactionTargetElement:c,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:r-t.startTime,processingDuration:i-r,presentationDelay:Math.max(u-i,0),loadState:pi(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)},fo=[2500,4e3],go={},mo=function(e,t){!function(e,t){t=t||{},Ni((function(){var n,r=xi(),i=Ii("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-bi(),0),i.entries=[e],n())}))},s=wi("largest-contentful-paint",o);if(s){n=Ci(e,i,fo,t.reportAllChanges);var a=Ei((function(){go[i.id]||(o(s.takeRecords()),s.disconnect(),go[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Ki(a)}),{once:!0,capture:!0})})),ki(a),yi((function(r){i=Ii("LCP"),n=Ci(e,i,fo,t.reportAllChanges),Si((function(){i.value=performance.now()-r.timeStamp,go[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=hi();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:gi(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)},vo=[800,1800],yo=function(e,t){t=t||{};var n=Ii("TTFB"),r=Ci(e,n,vo,t.reportAllChanges);!function e(t){document.prerendering?Ni((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)}((function(){var i=hi();i&&(n.value=Math.max(i.responseStart-bi(),0),n.entries=[i],r(!0),yi((function(){n=Ii("TTFB",0),(r=Ci(e,n,vo,t.reportAllChanges))(!0)})))}))},bo=function(e,t){yo((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)},Io={passive:!0,capture:!0},wo=new Date,Co=function(e,t){ao||(ao=t,co=e,lo=new Date,Eo(removeEventListener),So())},So=function(){if(co>=0&&co<lo-wo){var e={entryType:"first-input",name:ao.type,target:ao.target,cancelable:ao.cancelable,startTime:ao.timeStamp,processingStart:ao.timeStamp+co};uo.forEach((function(t){t(e)})),uo=[]}},ko=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(){Co(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,Io),removeEventListener("pointercancel",r,Io)};addEventListener("pointerup",n,Io),addEventListener("pointercancel",r,Io)}(t,e):Co(t,e)}},Eo=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,ko,Io)}))},_o=[100,300],Ao=function(e,t){!function(e,t){t=t||{},Ni((function(){var n,r=xi(),i=Ii("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=wi("first-input",s);n=Ci(e,i,_o,t.reportAllChanges),a&&(ki(Ei((function(){s(a.takeRecords()),a.disconnect()}))),yi((function(){var r;i=Ii("FID"),n=Ci(e,i,_o,t.reportAllChanges),uo=[],co=-1,ao=null,Eo(addEventListener),r=o,uo.push(r),So()})))}))}((function(t){var n=function(e){var t=e.entries[0],n={eventTarget:gi(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:pi(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)}),t)},To=n(181),Ro=n.n(To);const Mo=(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 xo(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 No=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Lo=/\((\S*)(?::(\d+))(?::(\d+))\)/,Oo=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Do=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Po=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Vo=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,Fo=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i;function Uo(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=Vo.exec(e);return t?xo(t[2],t[3]||"<unknown>",+t[1]):void 0})(n)||(e=>{const t=Fo.exec(e);return t?xo(t[5],t[3]||t[4]||"<unknown>",+t[1],+t[2]):void 0})(n)||(e=>{const t=No.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=Lo.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=Mo(t[1]||"<unknown>",t[2]);return xo(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}})(n)||(e=>{const t=Po.exec(e);return t?xo(t[2],t[1]||"<unknown>",+t[3],t[4]?+t[4]:void 0):void 0})(n)||(e=>{const t=Oo.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Do.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]=Mo(n,e),xo(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 Bo,Ho,qo=null,Wo=null,jo=!1;function Go(){$o(),Wo&&(window.clearTimeout(Wo),Wo=null),jo&&(jo=!1,document.removeEventListener("readystatechange",Ko))}function $o(){qo&&(window.clearTimeout(qo),qo=null)}function zo(){Go(),Ho(!1)}function Zo(){Go(),Ho(!0)}function Ko(){switch(document.readyState){case"complete":Go(),Ho(!0);break;case"interactive":$o(),Wo=window.setTimeout(Zo,0);break;case"loading":qo=window.setTimeout(zo,5e3);break;default:Go(),Ho(!1)}}function Yo(){return"undefined"==typeof window?Promise.resolve(!0):(!Bo&&window.NOIBUJS_DOCUMENT_READY_PROMISE instanceof Promise&&(Bo=window.NOIBUJS_DOCUMENT_READY_PROMISE),Bo||(Bo=new Promise(e=>{Ho=e,"complete"!==document.readyState&&(jo=!0,document.addEventListener("readystatechange",Ko)),Ko()}),window.NOIBUJS_DOCUMENT_READY_PROMISE=Bo,Bo))}const Jo=(e,t,n)=>{if(!("object"==typeof e&&null!==e))return!1;if(!(t in e))return!1;const r=e[t];if(r&&r.__noibu_wrapped__)return!0;const i=Object.getOwnPropertyDescriptor(e,t);if(i&&!1===i.writable)return!1;const o=n(r);if("function"==typeof o)try{o.prototype=o.prototype||{},Object.defineProperties(o,{__noibu__:{enumerable:!1,value:!0},__noibu_original__:{enumerable:!1,value:r},__noibu_wrapped__:{enumerable:!1,value:o}})}catch(e){}return e[t]=o,!0};const Xo=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 Qo(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(e,t,{set(e){r.set.call(this,n(e))}})}function es(e){return e&&e.__noibu_original__||e}const ts=["password","address","credit","postal","token","phone","mobile","expir","account","email","cardnumber","lastname"],ns=["firstname","lastname","street","fullname","creditcard","postcode","zipcode","city","town","county","cc","cardtype","cardnumber","email","nameoncard","code","state","id","key","dob"];function rs(e){return ns.some(t=>e===t)||ts.some(t=>e.indexOf(t)>=0)}const is=["sin","ssn"],os=["passport","license","licence","nationalid","idcard","healthcard"];function ss(e,t){if("value"!==t||!e)return!1;const n=function(e){const t=Object.keys(e).find(e=>"type"===e.toLowerCase());return t?e[t]:void 0}(e);if("string"!=typeof n)return!1;const r=n.toLowerCase().replace(/[\s_-]/g,"");return is.includes(r)||os.some(e=>r.indexOf(e)>=0)}function as(e){return"string"!=typeof e?null:e.length?e=function(e){return P.forEach(t=>{e=e.replace(t,"******")}),e=function(e){return e.replace(/(?<!\d)(?<!:\s*)(\+1\s?)?(\(?\d{3}\)?)[\s.-]?(\d{3})[\s.-]?(\d{4})\b/g,e=>{const t=e.replace(/\D/g,"");return e.includes("+1")&&11===t.length||!e.includes("+1")&&10===t.length?"******":e})}(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;const r=t.toLowerCase();return rs(r)||ss(e,r)?(n=!0,"******"):void 0}),n?Cs(t):e}catch(t){return e}}(e)):e}function cs(e){try{const t=e.indexOf("?");if(-1===t)return e;const n=e.indexOf("#",t),r=e.slice(0,t),i=-1===n?e.length:n,o=e.slice(t+1,i),s=-1===n?"":e.slice(n);if(!o)return e;return`${r}?${o.split("&").map(e=>{if(!e)return e;const t=e.indexOf("=");if(-1===t)return e;const n=e.slice(0,t),r=e.slice(t+1);let i,o;try{i=decodeURIComponent(n).toLowerCase()}catch(e){i=n.toLowerCase()}if(rs(i))return n+"=******";try{o=decodeURIComponent(r.replace(/\+/g," "))}catch(t){return e}const s=as(o);return s===o?e:`${n}=${encodeURIComponent(s)}`}).join("&")}${s}`}catch(t){return e}}function ls(){var e,t;const n=new URLSearchParams(window.location.search),[r]=null!==(t=null===(e=performance.getEntriesByType)||void 0===e?void 0:e.call(performance,"navigation"))&&void 0!==t?t:[];let i="";try{i=r?new URL(r.name).search:""}catch(e){i=""}return new URLSearchParams(i).forEach((e,t)=>n.set(t,e)),n}function us(e){return"click-picker"===e?"click-picker":"snapshot-picker"}function ds(){return null!==function(){var e;try{const t=ls(),n=null!==(e=t.get("noibu-agent"))&&void 0!==e?e:t.get("noibuagent");if(null!==n){const e=us(n);try{sessionStorage.setItem("noibu-agent-mode",e)}catch(e){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("[Agent] Error setting agent mode to sessionStorage: "+e,!1,a.ERROR)}return e}const r=sessionStorage.getItem("noibu-agent-mode");return r?us(r):null}catch(e){return null}}()}function hs(e,t=1024){return"string"!=typeof e?"":e.length<t?e:e.substring(0,t)}function ps(e,t=1){try{return Uo(e).length>t}catch(e){return!1}}function fs(e){if(!e)return"";return function(e){if(ps(e)){const t=Uo(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}(hs(e)).replace(F,"$1$2$3'*'").replace(D,"******")}function gs(e){return Ms(e)?new URL(e).host:""}function ms(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 vs(){var e,t,n,r,i;if("undefined"!=typeof noibuShopifyProxy){const{api:e}=noibuShopifyProxy;return cs(e.init.context.window.location.href)}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),hs(cs(o))):""}function ys(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 bs(e,t=!0){let n=[{line:"_",mname:"_",file:"_"}];if("object"!=typeof e||!e)return{frames:n,msg:""};const r=e;if(r.stack)n=ys(Uo(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:fs(r.message)};var o;return e.cause&&(i.cause=function(e){if(!Array.isArray(e))return[];const t=e.filter(e=>[K,Y,Z,z,$,J].every(t=>"string"==typeof e[t]));return t.length?t:[]}(e.cause)),t&&i.cause&&delete i.cause,i}function Is(e){let t="";try{e&&e.stack&&(t=`(stack: ${e.stack})`)}catch(e){}return t}function ws(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 Cs(e){if(Array.prototype.toJSON){const t=Array.prototype.toJSON;delete Array.prototype.toJSON;const n=ws(e);return Array.prototype.toJSON=t,n}return ws(e)}function Ss(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 ks(e){return"string"==typeof e.id?e.id:""}function Es(e){return e?"object"==typeof e?Cs(e):String(e):""}function _s(e,t,n,r=!1,i=0){const o=es(self.fetch);if(!o)return Promise.resolve();const s={method:"POST",headers:n,body:Es(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 As(){const e=ke();return function(){const e=ke();return e.http_re&&Array.isArray(e.http_re)}()?e.http_re:[]}function Ts(){const e=ke(),t=[".noibu-blocked",".creditCard"];return function(){const e=ke();return e.sel&&Array.isArray(e.sel)}()&&t.push(...e.sel),""+t.join(",")}function Rs(){const e=ke();let t=null;return e.block&&(t=e.block.filter(e=>{return"string"==typeof e&&(t=e,Fs(()=>(document.querySelectorAll(t),!0),!1));var t}),0===t.length)?null:t?""+t.join(","):null}function Ms(e=""){if("function"==typeof URL.canParse)return URL.canParse(e);try{return new URL(e),!0}catch(e){return!1}}function xs(){return function(e){var t;let n=e;return n||(n=null===(t=null===self||void 0===self?void 0:self.navigator)||void 0===t?void 0:t.userAgent),"string"==typeof n&&(!M().allowsBots&&(n=n.toLowerCase(),new RegExp("(bot|crawl(er)?|sp(i|y)der|Palo\\.Alto\\.Networks|search|worm|fetch|headless|synthetic|qaautomation|morningscore|wappalyzer|foregenix|SpeedCurve|Outlook-iOS|bitdiscovery|testing|webflow|rigor)","i").test(n)))}(null)}function Ns(e){return"string"!=typeof e?"":e.trim()}function Ls(e,t=!1){let n=vs();if(t&&!Ms(e))n=ms(n,{pathname:e});else{const t=Ns(e);t&&"undefined"!==t&&(n=e)}return hs(cs(n))}function Os(e,t){try{return"function"==typeof t&&e instanceof t}catch(e){return!1}}function Ds(e){return"string"==typeof e||e instanceof String}function Ps(e,t,n){Yo().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(()=>{var e;document.body.appendChild(r),(null===(e=r.outerHTML)||void 0===e?void 0:e.includes("blocked"))&&ds()&&zs.getInstance().postNoibuErrorAndOptionallyDisableClient("[Agent] Blocked script found in the agent mode",!1,a.ERROR)})}catch(e){n(e)}})}function Vs(){return"object"==typeof window}function Fs(e,t=null){try{return e()}catch(e){return"function"==typeof t?t(e):t}}class Us{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,Cs(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 Bs extends Us{constructor(){super(window.localStorage)}static isAvailable(){return Us.isAvailable(()=>window.localStorage)}}class Hs extends Us{constructor(){super(window.sessionStorage)}static isAvailable(){return Us.isAvailable(()=>window.sessionStorage)}}class qs{constructor(){const e=Bs.isAvailable(),t=Hs.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 Bs,this._type="LocalStorage"):this._isSessionStorageAvailable&&(this._provider=new Hs,this._type="SessionStorage")}static getInstance(){return this._instance||(this._instance=new qs),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 Ws{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())}static resetScriptTimeline(){this._scriptInitializeTime=null,this._recordingStartTime=null,this._recordingStopTime=null}}function js(e){if(!("number"==typeof e||"now"in Date&&"number"==typeof Date.now()&&"toISOString"in new Date&&"string"==typeof(new Date).toISOString())){if(Date.prototype.hasOwnProperty("valueOf")&&"function"==typeof e.valueOf&&"number"==typeof e.valueOf())return e.valueOf();zs.getInstance().postNoibuErrorAndOptionallyDisableClient("The date object has been overwritten and can't be processed properly.\nClient has been disabled.",!0,U,!0)}return e}function Gs(e){return!(e instanceof Date)||isNaN(e.getTime())}Ws._scriptInitializeTime=null,Ws._recordingStartTime=null,Ws._recordingStopTime=null;class $s{constructor(){this.eventListeners=[]}trackEventListener(e,t,n){this.eventListeners.push(Zs(e,t,n))}cleanupAllEventListeners(){this.eventListeners.forEach(({element:e,event:t,handler:n})=>{try{e.removeEventListener(t,n)}catch(e){}}),this.eventListeners=[]}}class zs{static configureInstance(e){this.instance||(Ws.setScriptInitializeTime(),this.instance=new zs(e))}static reinitializeInstance(){if(this.instance){this.instance.eventListenerManager.cleanupAllEventListeners();const e=this.instance.collectErrorUrl;Ws.resetScriptTimeline(),Ws.setScriptInitializeTime(),this.instance=new zs(e)}}static getInstance(){if(!this.instance)throw new Error("ClientConfig was not configured.");return this.instance}constructor(e){this.inactiveThresholdTime=174e4,this.pvCountOveruseLockTime=27e5,this.pvCountLimit=300,this.collectErrorLimit=50,this.storage=qs.getInstance(),this.pvId=at()(),this.isBeta=Je(),this.scriptId=Xe(),this.deviceEnvironment="browser",this.config=null,this.isStorageAvailable=!0,this.collectErrorCount=0,this.initialPageVisitSequence=0,this.eventListenerManager=new $s,this.collectErrorUrl=e;try{this.initialize()}catch(e){const t="ClientConfig initialization failed. "+e;this.collectError(t,a.ERROR,!1)}Vs()&&this.eventListenerManager.trackEventListener(window.document,"visibilitychange",()=>{"visible"===window.document.visibilityState&&this.initialize()})}initialize(){const e=null===this.config;this.restoreConfig(e);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)this.isInactive&&(t.CurrentPageVisitCount=0),t.CurrentPageVisitCount+=1,this.initialPageVisitSequence=t.CurrentPageVisitCount-1;else if(this.isInactive)return t.LastActive=new Date,t.CurrentPageVisitCount=0,void this.lockClientUntilNextPage("Session reset, locking until next page");t.LastActive=new Date}this.saveConfig(),this.lockClientIfPageVisitCountOverused()}else t.DisabledStatus=!0}restoreConfig(e){let t=null;try{this.storage.load("n_config_reset")&&e?this.storage.remove("n_config_reset"):t=this.storage.load("n_browser_data")}catch(e){this.isStorageAvailable=!1}let n={};if(null!==t)try{n=JSON.parse(t)}catch(e){}"string"!=typeof n.BrowserId&&(n.BrowserId=at()()),"number"!=typeof n.CurrentPageVisitCount&&(n.CurrentPageVisitCount=0),"boolean"!=typeof n.DisabledStatus&&(n.DisabledStatus=!1),"string"==typeof n.LastActive&&(n.LastActive=new Date(n.LastActive)),Gs(n.LastActive)&&(n.LastActive=new Date),null!==n.ClientUnlockTime&&("string"==typeof n.ClientUnlockTime&&(n.ClientUnlockTime=new Date(n.ClientUnlockTime)),Gs(n.ClientUnlockTime)&&(n.ClientUnlockTime=null)),this.config=n}saveConfig(){if(this.isStorageAvailable)try{const e=Cs(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 function(e,t){const n=Date.now()-t;return e<new Date(n)}(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()}scheduleResetClientConfig(){this.isStorageAvailable&&this.storage.save("n_config_reset",!0)}setSessionToken(e,t){try{this.storage.saveWithExpiry("n_session_id",e,t)}catch(e){}}get sessionToken(){return this.storage.loadWithExpiry("n_session_id")}get sessionId(){const e=this.sessionToken;if("string"!=typeof e)return null;const t=e.split(":");return t.length<4?null:t[0]||null}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,U,!1)}lockClientUntilNextPage(e){if(this.config.DisabledStatus)return;this.config.DisabledStatus=!0,this.saveConfig();const t=this.isBeta?U:B;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,i;if(t!==U)return;const o={browserId:(null===(r=this.config)||void 0===r?void 0:r.BrowserId)||at()(),pageVisitId:this.pvId,scriptId:this.scriptId,deviceEnv:this.deviceEnvironment,ua:(null===(i=null===self||void 0===self?void 0:self.navigator)||void 0===i?void 0:i.userAgent)||"",error:e},s={url:vs(),err_msg:o,sev:t},{collectErrorUrl:a}=this;_s(a,s,{"content-type":"application/json"},n,2e3).catch(()=>{})}}function Zs(e,t,n,r){if(!e||!t||!n)return null;const i=e=>{try{n(e)}catch(e){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("addEventListener callback error: "+e.message,!1,U)}},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 zs.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in addSafeEventListener: '${e.addEventListener}' is supposed to be a function. ${n}`,!1,U)}zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in addSafeEventListener: "+n,!1,U)};try{return e.addEventListener(t,i,r),{element:e,event:t,handler:i}}catch(e){return o(e),null}}function Ks(e,t,n,r,i,o,s,a){a(`Wait for element. Timeout: ${i}s. Selector: "${t}".`);const c=Js(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=Js(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 Ys(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 Js(e,t,n,r,i){const o=Ys(e,t,n,r,i);return 0===o.length?void 0:o[0]}function Xs(e){let t="";if(e.tag&&(t+=e.tag),e.id&&(t+="#"+e.id),e.class&&(t+=Ns(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=`${Xs(e.parentSelector)} ${t}`}if(""===t)throw new Error("Incorrect element selector.");return t}function Qs(){return ke().page_groups||null}function ea(e=null){let t="";if(e){const n=new URL(e);t=n.hostname+n.pathname}else t=window.location.hostname+window.location.pathname;return t+=t.endsWith("/")?"":"/",t.startsWith("www.")&&(t=t.slice(4)),t}const ta=new Map;function na(e,t=null){let n=ta.get(e);if(void 0===n||0===n.length){n=e.replace(/https?:\\\/\\\/|www\\\./g,""),n.startsWith("^")||(n="^"+n);n.endsWith(")")&&(n.endsWith("/",n.length-1)||n.endsWith("*",n.length-1)||(n+="/")),n.endsWith("$")||(n+="$"),ta.set(e,n)}return new RegExp(n).test(ea(t))}function ra(e=null,t=!0){const n=Qs();if(!n)return[];return Object.values(n).filter(e=>!(t&&"PageCheck"===e.group_type)).filter(t=>function(e,t=null){try{if(e.url_regex){if(na(e.url_regex,t))return!0}else if(e.urls){const n=ea(t);if(e.urls.includes(n))return!0}if(e.element_selector){const t=Xs(e.element_selector);if(window.document.querySelector(t))return!0}}catch(e){}return!1}(t,e)).map(e=>e.name).filter(Ns)}class ia{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.eventListenerManager=new $s}static getInstance(){return this.instance||(this.instance=new ia),this.instance}static reinitializeInstance(){this.instance&&(this.instance.eventListenerManager.cleanupAllEventListeners(),this.instance=new ia)}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}}var oa=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 sa{constructor(){try{qs.getInstance().isAvailable()&&this.postPreviousPageVisit()}catch(e){}}static getInstance(){return this.instance||(this.instance=new sa),this.instance}storeRetryQueue(e,t){const n=qs.getInstance();try{n.remove("n_stored_page_visit")}catch(e){return}const r=e.filter(({type:e})=>e===q).map(({payload:e})=>e[be]);if(0===r.length)return;const i=Cs({pageVisitFrags:r,pageVisitInfo:t,timestamp:new Date});let o=!1;try{n.save("n_stored_page_visit",i)}catch(e){o=!0}if(o)try{n.remove("n_stored_page_visit")}catch(e){return}}getPostData(){const e=qs.getInstance(),t=e.load("n_stored_page_visit");if(!t)return null;let n;try{n=JSON.parse(t)}catch(t){return e.remove("n_stored_page_visit"),null}if(n.timestamp){const e=new Date;if(e.setSeconds(e.getSeconds()-1740),e.getTime()>=Date.parse(n.timestamp))return null}const r={pvi:n.pageVisitInfo,[be]:n.pageVisitFrags,[Ie]:[]};return r.pvi.last=!0,r}postPreviousPageVisit(){return oa(this,void 0,void 0,(function*(){const e=this.getPostData();if(e){const t={"content-type":"text/plain;charset=UTF-8"};try{yield _s(M().metroplexPostURL,e,t,!1,6e4)}catch(e){}}this.updateStorageFlushed()}))}updateStorageFlushed(){const e=qs.getInstance();try{e.remove("n_stored_page_visit")}catch(e){return}}}var aa,ca,la=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 ua{static getInstance(){return this.instance||(this.instance=new ua)}static reinitializeInstance(e){this.instance&&this.instance.initialize(e)}constructor(){this.broadcastContext=null;try{let e=sessionStorage.getItem(aa.TabId);null===e&&(e=at()(),sessionStorage.setItem(aa.TabId,e)),this.tabId=e}catch(e){return}if(!this.isShopifyCheckout)try{const e=this.receiveBroadcastMessage.bind(this),t=new BroadcastChannel("noibu_referrer");Zs(t,"message",e),this.broadcastChannel=t}catch(e){}}get isDisabled(){return!this.tabId}get isShopifyCheckout(){return"object"==typeof noibuShopifyProxy}get currentUrl(){return this.isShopifyCheckout?noibuShopifyProxy.api.init.context.window.location.href:window.location.href}get referrerUrl(){return this.isDisabled?"":cs(sessionStorage.getItem(aa.ReferrerUrl)||"")}get referrerPageGroups(){if(this.isDisabled)return[];const e=sessionStorage.getItem(aa.ReferrerPageGroups);return e?JSON.parse(e):[]}get storedPageGroups(){if(this.isDisabled)return[];const e=sessionStorage.getItem(aa.PageGroups);return e?JSON.parse(e):[]}storePageGroups(e){if(this.isDisabled)return;const t=JSON.stringify(e);sessionStorage.setItem(aa.PageGroups,t)}initialize(){return la(this,arguments,void 0,(function*(e=null){if(!this.isDisabled)try{yield this.initializeUnsafe(e)}catch(e){}}))}initializeUnsafe(){return la(this,arguments,void 0,(function*(e=null){if(null===e){switch(function(){try{const e=performance.getEntriesByType("navigation");return e[0].type}catch(e){return null}}()){case"reload":break;case"back_forward":{const e=sessionStorage.getItem(aa.Url),t=sessionStorage.getItem(aa.PageGroups);sessionStorage.setItem(aa.Url,this.currentUrl),sessionStorage.setItem(aa.ReferrerUrl,e||""),sessionStorage.setItem(aa.ReferrerPageGroups,t||"[]");break}default:{let e=sessionStorage.getItem(aa.Url),t=sessionStorage.getItem(aa.PageGroups);if(null==e&&(e=document.referrer||null),null!=e&&null==t&&this.broadcastChannel){const n=yield this.sendBroadcastMessage(e);t=JSON.stringify(n)}sessionStorage.setItem(aa.Url,this.currentUrl),sessionStorage.setItem(aa.ReferrerUrl,e||""),sessionStorage.setItem(aa.ReferrerPageGroups,t||"[]")}}}else{const{url:t,referrerUrl:n,referrerPageGroups:r}=e,i=JSON.stringify(r);sessionStorage.setItem(aa.Url,t),sessionStorage.setItem(aa.ReferrerUrl,n),sessionStorage.setItem(aa.ReferrerPageGroups,i)}}))}sendBroadcastMessage(e){const t={timeout:null,promise:null,resolve:null};t.promise=new Promise(e=>t.resolve=e),t.timeout=window.setTimeout(()=>t.resolve([]),5),this.broadcastContext=t;const n={type:"request",tabId:this.tabId,referrer:e};return this.broadcastChannel.postMessage(n),t.promise}receiveBroadcastMessage({data:e}){switch(e.type){case"request":this.handleRequestMessage(e);break;case"response":this.handleResponseMessage(e)}}handleRequestMessage({tabId:e,referrer:t}){if(t!==window.location.href)return;const n=sessionStorage.getItem(aa.PageGroups);if(null===n)return;const r={type:"response",tabId:e,pageGroups:JSON.parse(n)};this.broadcastChannel.postMessage(r)}handleResponseMessage({tabId:e,pageGroups:t}){if(e!==this.tabId)return;const n=this.broadcastContext;this.broadcastContext=null,window.clearTimeout(n.timeout),n.resolve(t)}}function da(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]})}ua.instance=null,function(e){e.TabId="noibu_tab_id",e.Url="noibu_url",e.PageGroups="noibu_page_groups",e.ReferrerUrl="noibu_referrer_url",e.ReferrerPageGroups="noibu_referrer_page_groups"}(aa||(aa={}));class ha{constructor(e,t){this.retryMessageQueue=da(500),this.inactivityTimeout=0;const n=M().metroplexSocketBase;this.forceClosed=!1,this.trafficHeld=!1,this.socket=null,this.socketInstanceId=null,this.currentConnectionAttempts=0,this.connectionCount=0,this.sessionStartTime=performance.now(),this.connectionPromise=new Promise(e=>{this.connectionPromiseResolver=e}),this.pageVisitInfoSent=!1,this.replyReceived=!1,this.connectionURL=`${n}/${_e}`,this.postURL=M().metroplexPostURL,this.messageSequenceNum=0,this.latestReceivedSeqNumber=-1,this.isRetryLoopDisabled=!1,this.metroplexTypeLock={};const{referrerUrl:r}=ua.getInstance();this.initialReferingURL=hs(r),(null==t?void 0:t.url)?this.initialURL=t.url:this.initialURL=vs(),(null==t?void 0:t.pageTitle)?this.initialPageTitle=t.pageTitle:Vs()&&window.document.title?this.initialPageTitle=window.document.title:this.initialPageTitle="",this.sessionTimestamp=new Date,this.latestReceivedSeqNumStoredTime=new Date,this.instanceId=at()(),this.scriptInstanceId=e,this.sessionLength=0,this.ackedOnce=!1,this.metroRetryFrequencyMS=3e4,this.debouncedInactivityHandler=Ro()(()=>{this._socketTimeout()},5e3),this.eventListenerManager=new $s}static getInstance(e){return this.instance||(this.instance=new ha(e),this.instance.start()),this.instance}static reinitializeInstance(e,t,n){if(this.instance)return this.instance.eventListenerManager.cleanupAllEventListeners(),clearInterval(this.instance.retryMetroplexInterval),clearTimeout(this.instance.inactivityTimeout),this.instance=new ha(e,t),n||this.instance.start(),this.instance}start(){this.forceClosed||this.connectSocket()}updatePageTitle(e){e&&(this.initialPageTitle=e)}_addSeqNumToPayload(e,t){switch(e){case u.PageVisitPart:this._setSeqNumInPayloadAndIncrementSeqNum(be,t);break;case u.PageVisitVideoFile:this._setSeqNumInPayloadAndIncrementSeqNum(Ie,t);break;case u.PageVisitHttp:this._setSeqNumInPayloadAndIncrementSeqNum(Ce,t);break;case u.PageVisitMeta:this._setSeqNumInPayloadAndIncrementSeqNum(we,t)}}_setSeqNumInPayloadAndIncrementSeqNum(e,t){t[e].seq_num=this.messageSequenceNum,this.messageSequenceNum+=1}sendMessage(e,t){if(e in this.metroplexTypeLock||zs.getInstance().isDisabled)return!1;if(this.trafficHeld)return!1;const n=t;if(e!==Q&&(this._addSeqNumToPayload(e,n),this.retryMessageQueue.push({payload:n,type:e}),sa.getInstance().storeRetryQueue(this.retryMessageQueue,this.getPageInformation())),this.isConnected()&&this.pageVisitInfoSent&&this.replyReceived&&this._sendSocketMessage(n),e===q&&t[be]){const e=t[be].events?t[be].events:[];this._updateLatestPvTimestamp(e)}return!0}_updateLatestPvTimestamp(e){this._filterUserEvents(e).length>0&&(zs.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[$]===se)}isConnected(){return null!==this.socket&&1===this.socket.readyState}isConnecting(){return null!==this.socket&&0===this.socket.readyState}holdTraffic(){this.trafficHeld=!0}releaseTraffic(){this.trafficHeld=!1}clearPendingMessages(){this.retryMessageQueue=da(500,[]),sa.getInstance().storeRetryQueue(this.retryMessageQueue,this.getPageInformation())}close(){this.forceClosed=!0,(this.isConnected()||this.isConnecting())&&this.socket.close(1e3)}handleConnect(e,t){if(!t&&(this.isConnected()||this.isConnecting()))return;this.currentConnectionAttempts+=1;const n=new WebSocket(this.connectionURL);this.socket=n,this.socketInstanceId=at()(),n.onerror=()=>{this.socket},n.onclose=()=>{this.socket===n&&(this.socket=null,this.pageVisitInfoSent=!1,clearInterval(this.retryMetroplexInterval),this.forceClosed||this.isConnecting()||(this.currentConnectionAttempts>=20?zs.getInstance().lockClientUntilNextPage("Too many reconnection attempts, locking until next page"):this.connectionCount>=100?zs.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.replyReceived=!1;const r=()=>{this.socket===n&&(this.replyReceived||(this.replyReceived=!0,this._sendUnconfirmedMessages(!1),this.setupRetryMechanism()))};n.onmessage=t=>{this.socket===n&&this._onSocketMessage(t,e,r)},n.onopen=()=>{this.socket===n&&this._onSocketOpen()}}connectSocket(){if(this.isConnected()||this.isConnecting())return this.connectionPromise;const e=this.connectionPromiseResolver;if(!Vs())return this.handleConnect(e,!1),this.connectionPromise;return"visible"===window.document.visibilityState&&!window.document.hidden&&this.handleConnect(e,!1),this.connectionPromise}handleShow(){if(zs.getInstance().isDisabled)return;if(this.trafficHeld)return;this.forceClosed=!1,this._closeForVisibilityChange();const e=this.connectionPromiseResolver||(()=>{});this.handleConnect(e,!0)}_closeForVisibilityChange(){(this.isConnected()||this.isConnecting())&&(this.socket.onclose=()=>{},this.socket.close(1e3))}addEndTimeToPayload(e,t){const n=performance.now(),r=Math.ceil(n-this.sessionStartTime);t&&(this.sessionLength=r);const i=new Date(this.sessionTimestamp.getTime()+r).toISOString();e.end_at=i}_onSocketOpen(){this.isConnected()&&!zs.getInstance().isDisabled&&(this._sendSocketMessage(this.getPageInformation()),this.pageVisitInfoSent=!0,this.connectionCount+=1)}_onSocketMessage(e,t,n){switch(e.data){case Re:this.metroplexTypeLock[W]=!0,ia.getInstance().setDidCutVideo();break;case Me:this.metroplexTypeLock[q]=!0,ia.getInstance().setDidCutPv();break;case xe:zs.getInstance().lockClient(1440,"Metroplex blocked script"),this.close();break;case Ne:this.close();break;case Le:break;default:if(e.data.includes("seq_num")){const r=e.data.split("seq_num:");if(r.length<2){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Invalid message received from metroplex while clearing retry queue "+e.data,!1,U);break}"function"==typeof n&&n();const i=parseInt(r[1],10);if(-1===i)break;i<=this.latestReceivedSeqNumber?this.isRetryLoopDisabled=!0:(this.isRetryLoopDisabled=!1,this.latestReceivedSeqNumber=i,this.currentConnectionAttempts=0,this._clearRetryQueue(i)),!this.ackedOnce&&t&&(this.ackedOnce=!0,t())}if(this._tryProcessHelpCodeResponse(e.data))break;if(this._tryProcessSessionIdResponse(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,be,e)||this._messagePayloadHasLargerSeqNum(t,Ie,e));this.retryMessageQueue=da(500,t),sa.getInstance().storeRetryQueue(this.retryMessageQueue,this.getPageInformation())}_sendUnconfirmedMessages(e){if(!this.isConnected()||zs.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=da(500,t),sa.getInstance().storeRetryQueue(this.retryMessageQueue,this.getPageInformation());for(let e=0;e<this.retryMessageQueue.length;e+=1){const{payload:t}=this.retryMessageQueue[e];if(!this._sendSocketMessage(t))break}}setupRetryMechanism(){this.retryMetroplexInterval=setInterval(()=>{this._sendUnconfirmedMessages(!0)},3e4)}handleUnload(e=null){this.close(),zs.getInstance().isDisabled||zs.getInstance().isInactive||0!=this.messageSequenceNum&&this.postFullPageVisit(e)}postFullPageVisit(e=null){if(this.trafficHeld)return;if(0===this.retryMessageQueue.length)return;const t={pvi:e=e||this.getPageInformation(),[be]:[],[Ie]:[],[Ce]:[],vpnum:this.connectionCount};t.pvi.last=!0;let n=!1;this.retryMessageQueue.forEach(e=>{const{type:r,payload:i}=e;switch(r){case W:n=!0;const e=i[Ie];this.latestReceivedSeqNumber=e.seq_num;break;case q:n=!0;const r=i[be];t[be].push(r),this.latestReceivedSeqNumber=r.seq_num;break;case G:n=!0;const o=i[Ce];t[Ce].push(o)}}),n&&this.postMessage(t),this.retryMessageQueue=da(500,[]),sa.getInstance().updateStorageFlushed()}postMessage(e){const t=e;t.vpnum+=1;_s(this.postURL,t,{"content-type":"text/plain;charset=UTF-8"},!0).catch(()=>{})}_sendSocketMessage(e){return!this.closeIfInactive()&&(this.socket.send(Cs(e)),!0)}closeIfInactive(){const e=zs.getInstance().isInactive;return e&&!zs.getInstance().isDisabled&&(zs.getInstance().lockClientUntilNextPage("Session is inactive, locking until next page"),this.close(),this.postFullPageVisit()),e}getPageInformation(){const e=zs.getInstance(),t=ra(this.initialURL),{referrerPageGroups:n}=ua.getInstance(),r={br_id:e.browserId,pv_id:e.pageVisitId,v:5,seq:e.pageVisitSequence,on_url:this.initialURL,page_title:this.initialPageTitle,page_groups:t,ref_url:this.initialReferingURL,ref_page_groups:n,start_at:this.sessionTimestamp.toISOString(),conc:this.connectionCount,cv:2,last:!1,script_id:Xe(),script_inst_id:this.scriptInstanceId,mp_sock_inst_id:this.instanceId,sock_inst_id:this.socketInstanceId,video_recorder:Se},i=function(){const e=self.navigator.userLanguage||self.navigator.language;return"string"==typeof e?e.toLowerCase():null}();i&&(r.lang=i);const{sessionToken:o}=e;return o&&(r.session_token=o),r}_tryProcessHelpCodeResponse(e){const t=X+":";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}_tryProcessSessionIdResponse(e){if("string"!=typeof e||!e.startsWith("session:"))return!1;const t=e.substring("session:".length);if(!t)return!1;const n=t.split(":");if(n.length<4)return!1;const r=parseInt(n[1],10);return!(isNaN(r)||r<=0)&&(zs.getInstance().setSessionToken(t,1e3*r),!0)}}class pa{constructor(){this.partCounter=0,this.pvMap={},this.partCounter=0,this.pvEventLength=0,this.totalPvEventLength=0,this.inDebounceHandle=0,this.isInAcceleratedPvPostMode=!1,this.liveViewEnabled=!1}static configureInstance(){this.instance||(this.instance=new pa)}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){const n={[$]:t,occ_at:e.occurredAt,[t]:e.event};this.pvEventLength>=200&&this._sendPageVisitMessage();const r=at()();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,ha.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 zs.getInstance().lockClientUntilNextPage(`Stop processing parts because we reached. max parts: 10000.variables: total PV event length: ${this.totalPvEventLength}.`);const t=pa.makePageVisitFrag(e,this.partCounter);ia.getInstance().setPvPart(this.partCounter);const n={[be]:t};ha.getInstance().sendMessage(q,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 fa{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 fa.mask(e);if(this.maskedInputCache.has(t))return fa.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),fa.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"}(ca||(ca={}));var ga=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 ma{constructor(e,t){this.status=ca.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!==ca.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=Cs({error:`${e} ${t} ${Is(t)}`,status:this.status,stats:this.stats});this.errorCallback(r)}init(){return ga(this,void 0,void 0,(function*(){try{this.worker=yield ma.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 ga(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===ca.Init&&(this.recordSnapshotResolvers=new Map,this.stats.init=performance.now()-this.statusResolver.timestamp,this.status=ca.Ready,this.statusResolver.resolve(this.status),this.setupRecordSnapshotCleanup())}handleInitError(e){if(this.status===ca.Init){this.status=ca.Fail,this.statusResolver.resolve(this.status);ma.isInitErrorAcknowledged(e)||this.reportError("Init error.",e)}}static isInitErrorAcknowledged(e){if(!e)return!0;const t=(""+e).trim();return 0===t.length||ma.knownInitErrors.some(e=>t.includes(e))}setupInitTimeout(){window.setTimeout(()=>{const e=new Error("Init timeout.");this.handleInitError(e)},5e3)}sendMessage(e){this.status===ca.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&&(ma.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 va,ya;ma.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 ba=(null===(ya=null===(va=null==Promise?void 0:Promise.all)||void 0===va?void 0:va.bind)||void 0===ya?void 0:ya.call(va,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 Ia,wa,Ca,Sa;!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"}(Ia||(Ia={})),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"}(wa||(wa={})),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"}(Ca||(Ca={})),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"}(Sa||(Sa={}));var ka=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 Ea{constructor(e,t,n=null){if(this.isRecordingStopped=!1,this.isMetaEventReceived=!1,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.eventListenerManager=new $s,t)return void(this.didSetupRecorder=!0);const r=function(){const e=ke().unmask;return Array.isArray(e)?e:null}();this.inputMaskManager=new fa(r),this.eventListenerManager.trackEventListener(window,"click",()=>{this.handleFragPost()}),e&&(null!==n?this.workerAgent=n:(this.workerAgent=new ma("https://cdn.noibu.com/collect-worker.js",Ea.postWorkerError),this.workerAgent.start()))}static reinitializeInstance(e=!0,t=!1){if(this.instance){clearTimeout(this.instance.pauseTimeout),this.instance.eventListenerManager.cleanupAllEventListeners();const n={record:this.instance.rrwebRecord,pack:this.instance.rrwebPack,addCustomEvent:this.instance.rrwebAddCustomEvent};this.instance=new Ea(e,!1,this.instance.workerAgent),this.instance.liveViewRecording=t,n.record&&n.pack&&n.addCustomEvent&&this.instance.handleRRWebLoaded(n)}}static configureInstance(e=!0){this.instance||(this.instance=new Ea(e,!1)),addEventListener("hashchange",()=>{const e=this.instance;if(!!e.firstRecordedTimestamp&&e.rrwebAddCustomEvent){const{hash:t}=location;e.rrwebAddCustomEvent("hashchange",{hash:t})}})}static getInstance(){if(!this.instance)throw new Error("SessionRecorder was not configured");return this.instance}static setInstance(e){this.instance=e}static postWorkerError(e){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Worker error: "+e,!1,B)}addCSSURLs(e){this.cssURLs.get(e)||this.cssURLs.set(e,{seq_sent:ha.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}=ha.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}recordUserSession(e={}){if(zs.getInstance().isInactive||ia.getInstance().didCutVideo)return;if(this.didSetupRecorder)return;const{inlineFonts:t,ignoreIframes:n,deferProcessMutations:r,recoverCSSVariables:i,recordCanvas:o}=function(){const e=R(R(ke().njs_config).rrwebConfig);return{inlineFonts:_(e.inlineFonts,m),ignoreIframes:_(e.ignoreIframes,v),deferProcessMutations:_(e.deferProcessMutations,y),recoverCSSVariables:_(e.recoverCSSVariables,b),recordCanvas:_(e.recordCanvas,I)}}(),s=Object.assign({emit:e=>{this.handleNewRRwebEvent(e,2e3)},inlineStylesheet:!0,inlineStylesheetFonts:t,maskAllInputs:!0,maskInputFn:this.inputMaskManager.maskInputSafely.bind(this.inputMaskManager),deferProcessMutations:r,maskTextSelector:Ts(),ignoreCSSAttributes:Ye,ignoreIframes:n,collectFonts:!0,blockSelector:Rs(),recoverCSSVariables:i,recordCanvas:o},e);Ws.setRecordingStartTime(),ia.getInstance().setDidStartVideo(),this.recordStopper=this.rrwebRecord(s),this.didSetupRecorder=!0}handleNewRRwebEvent(e,t){return ka(this,void 0,void 0,(function*(){if(zs.getInstance().isInactive||ia.getInstance().didCutVideo)return void this.stopRecording();if(this.isRecordingStopped)return;if(e.type===Ia.Meta&&(this.isMetaEventReceived=!0),!this.isMetaEventReceived)return;if(e.type===Ia.Custom&&"unfreeze"===e.data.tag)return;if(e.type===Ia.IncrementalSnapshot&&e.data.source===Ca.Mutation||(this.pauseTimeout&&(clearTimeout(this.pauseTimeout),this.pauseTimeout=null,this.freezingEvents=!1),this.pauseTimeout=setTimeout(()=>{this.rrwebRecord.freezePage&&(this.freezingEvents=!0,this.rrwebRecord.freezePage())},t)),e.timestamp=js(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 zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Detected time rewind. Client has been disabled.",!0,U,!0);const n=yield this.packAndParseCss(e);this.handleLiveView(n),this.eventBuffer.push(n),e.type===Ia.IncrementalSnapshot&&(e.data.source!==Ca.MouseInteraction||e.data.type!==Sa.Click&&e.data.type!==Sa.DblClick||ia.getInstance().addVideoClick());let r=!0;if(e.type===Ia.IncrementalSnapshot){const e=Date.now()-this.lastFragPostTimestamp<500,t=this.eventBuffer.length<10;e&&t&&(r=!1)}r&&this.handleFragPost()}))}packAndParseCss(e){return ka(this,void 0,void 0,(function*(){let t=null;if(this.workerAgent){if((yield this.workerAgent.ready())===ca.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(!zs.getInstance().isInactive&&this.didSetupRecorder&&0!==this.eventBuffer.length){try{let e=0;this.firstRecordedTimestamp&&this.lastRecordedTimestamp&&!this.invalidVideoLength&&(e=this.lastRecordedTimestamp-this.firstRecordedTimestamp);const t=Math.pow(2,32)-1;!this.invalidVideoLength&&(e<0||e>=t)&&(this.invalidVideoLength=!0,e=t),this.vfCounter+=1;const n={};n.vid=Cs(this.eventBuffer),n.seq=this.vfCounter,n.len=e,n.css_urls=this.getCSSURLsNotReceived(),ha.getInstance().addEndTimeToPayload(n,!1),ia.getInstance().addVideoFragData(this.vfCounter,e);const r={};r[Ie]=n,ha.getInstance().sendMessage(W,r),this.lastFragPostTimestamp=Date.now()}catch(e){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("video frag socket closed with err: "+e.message,!1,U),this.stopRecording()}this.eventBuffer=[]}}unfreeze(){this.freezingEvents&&this.rrwebAddCustomEvent("unfreeze",{})}downloadIfAllowed(){if(!this.isRecordingAllowed())return this.listenRecordingAllowedEvent(),void this.listenRecordingLoadedEvent();this.download()}download(){this.listenRecordingLoadedEvent(),Ps("https://cdn.noibu.com/collect-recording.js",null,e=>{zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Error loading session recording script. "+e,!0,U)})}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,this.eventListenerManager.trackEventListener(window,"noibuRecordingAllowed",()=>{this.download()}))}listenRecordingLoadedEvent(){this.isRecordingLoadedHandled||(this.isRecordingLoadedHandled=!0,this.eventListenerManager.trackEventListener(window,"noibuRecordingLoaded",e=>{this.handleRRWebLoaded(e.detail)}))}handleRRWebLoaded(e){if(e){if(this.setRRWeb(e)){const e=ha.getInstance();ba([Yo(),e.connectionPromise]).then(()=>{this.recordUserSession()})}}else zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Error loading rrweb script",!0,U)}setRRWeb(e){return e&&e.record&&e.pack&&e.addCustomEvent?(this.rrwebRecord=e.record,this.rrwebPack=e.pack,this.rrwebAddCustomEvent=e.addCustomEvent,!0):(zs.getInstance().postNoibuErrorAndOptionallyDisableClient("RRweb functions not all present",!0,U),!1)}requestLiveView(){this.liveViewRecording=!0,this.rrwebRecord.takeFullSnapshot(!0)}disableLiveView(){this.liveViewRecording=!1}handleLiveView(e){this.liveViewRecording&&xa.getInstance().sendData(e)}stopRecording(){try{this.recordStopper&&(this.isRecordingStopped=!0,this.eventBuffer=[],this.recordStopper(),this.recordStopper=null)}catch(e){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Error while trying to stop recording: "+e,!0,U)}}getFirstRecordedTimestamp(){return this.firstRecordedTimestamp}resetFirstRecordedTimestamp(){this.firstRecordedTimestamp=null}isLiveView(){return this.liveViewRecording}}const _a=0,Aa=1,Ta=2;function Ra(){}class Ma 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=Ra,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 _a:return"object"==typeof e.data;case Aa:return void 0===e.data;case Ta:{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 _a:this._g(e);break;case Aa:this._a=!1,this._l("io server disconnect");break;case Ta: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=Ra,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+=Cs(e.data)),n}(e))}_C(){this._y({type:_a})}emit(...e){const t={type:Ta,data:e};this.connected?this._y(t):this._r.push(t)}disconnect(){this._a=!1,this._l("io client disconnect")}}class xa{constructor(){this.socket=null,this.throttledUpdate=null,this.idleConnectionTimer=null,this.connectionTimeout=12e4}static getInstance(){return xa.instance||(xa.instance=new xa),xa.instance}monitor(){const e=qs.getInstance();if(!e.isAvailable())return;const t=e.loadWithExpiry("noibuHC");t?(e.updateExpiry("noibuHC",12e4),this.connectToSocketIoServer(t)):Zs(window,"noibuHCAlert",e=>this.handleHelpCode(e)),Zs(window,"noibuPageVisitEvent",e=>this.sendPVEvents(e.detail.type,e.detail.eventObjects))}handleHelpCode(e){const{data:t}=e.detail;qs.getInstance().saveWithExpiry("noibuHC",t,12e4),this.connectToSocketIoServer(t)}connectToSocketIoServer(e){const{domain:t}=ke();if(t&&(this.helpcode=e,!this.socket)){try{this.socket=function(e,t){return"string"!=typeof e&&(t=e,e=location.origin),new Ma(e,t)}("https://live.noibu.com",{namespace:t,reconnectionDelay:500})}catch(e){return}try{this.throttledUpdate=Ro()(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&&(Ea.getInstance().requestLiveView(),pa.getInstance().requestLiveView(),qs.getInstance().updateExpiry("noibuHC",12e4),this.cancelConnectionDisconnectTime())})),this.socket.on("stop_sending_data",this.errorHandler(e=>{this.helpcode===e&&(Ea.getInstance().disableLiveView(),pa.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(){qs.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 Na{static getInstance(){return this.instance||(this.instance=new Na)}constructor(){this.contexts=new Map;this.register(ue,0),this.register(ve,0),this.register(ye,0),this.register(he,500),this.register(de,500),this.register(te,500),this.register(pe,500),this.register(le,500,se),this.register(fe,5)}register(e,t,n=e){const r={eventName:n,period:t,timeout:null,events:[]};this.contexts.set(e,r)}addEvent(e,t,n=Date.now()){const r=new Date(n).toISOString(),i=this.contexts.get(t);i.events.push({event:e,occurredAt:r}),i.events.length>=200?this.flush(i):this.debounce(i)}debounce(e){null===e.timeout&&(e.timeout=window.setTimeout(()=>this.flush(e),e.period))}flushAll(){for(const e of this.contexts.values())this.flush(e)}flush(e){window.clearTimeout(e.timeout),e.timeout=null;const t=e.events.splice(0);if(t.length){pa.getInstance().addPageVisitEvents(t,e.eventName)}}}Na.instance=null;const La={product_added_to_cart:"product_added_to_cart",product_removed_from_cart:"product_removed_from_cart",checkout_started:"checkout_started",checkout_address_info_submitted:"checkout_address_info_submitted",checkout_contact_info_submitted:"checkout_contact_info_submitted",checkout_shipping_info_submitted:"checkout_shipping_info_submitted",payment_info_submitted:"payment_info_submitted",checkout_completed:"checkout_completed",search_submitted:"search_submitted",collection_viewed:"collection_viewed",product_viewed:"product_viewed",cart_viewed:"cart_viewed"};function Oa(e,t,n,r,i,o){if(Da(t)&&(t=Pa(t),null==e))return;if("boolean"===t)return void("boolean"!=typeof e&&r.push(`boolean is expected [${n}]`));if("number"===t)return void("number"!=typeof e&&r.push(`number is expected [${n}]`));if("string"===t)return void("string"!=typeof e&&r.push(`string is expected [${n}]`));if("object"!=typeof e)return void r.push(`${t} is expected [${n}]`);if(null===e)return void r.push(`${t} is expected [${n}]`);if(Va(t)){const s=function(e){Da(e)&&(e=Pa(e));return e.replace("[]","")}(t);if(Array.isArray(e))for(let t=0;t<e.length;t++){Oa(e[t],s,[...n,`[${t}]`],r,i,o)}else r.push(`array is expected [${n}]`);return}const s=i.get(t);if(void 0===s)return void r.push(`schema "${t}" not found [${n}]`);const a=s.properties.map(e=>e.key);for(const t of Object.keys(e))a.includes(t)||(o.autoRemoveUnexpectedProperties?delete e[t]:r.push(`property "${t}" is not expected [${n}]`));for(const t of s.properties){if(!(t.key in e)){const i=Da(t.type),s=Va(t.type),a=Fa(t.type),c=o.ignoreMissedNullableProperties,l=o.autoAddMissedNullableProperties,u=o.autoFixMissedNullableProperties;if(i&&c)continue;if(i&&l){e[t.key]=null;continue}if(!i||!u){r.push(`${t.type} is expected [${[...n,t.key]}]`);continue}if(a||s){e[t.key]=null;continue}e[t.key]={}}Oa(e[t.key],t.type,[...n,t.key],r,i,o)}}function Da(e){return e.endsWith("?")}function Pa(e){return e.replace("?","")}function Va(e){return Da(e)&&(e=Pa(e)),e.endsWith("[]")}function Fa(e){return Da(e)&&(e=Pa(e)),"boolean"===e||"number"===e||"string"===e}const Ua=new Map(Object.entries({Money:{properties:[{key:"amount",type:"number?"},{key:"currencyCode",type:"string?"}]},DeliveryOption:{properties:[{key:"cost",type:"Money?"},{key:"costAfterDiscounts",type:"Money?"},{key:"description",type:"string?"},{key:"handle",type:"string?"},{key:"title",type:"string?"},{key:"type",type:"string?"}]},Delivery:{properties:[{key:"selectedDeliveryOptions",type:"DeliveryOption[]?"}]},Product:{properties:[{key:"id",type:"string?"},{key:"title",type:"string?"},{key:"untranslatedTitle",type:"string?"},{key:"type",type:"string?"},{key:"url",type:"string?"},{key:"vendor",type:"string?"}]},ProductVariant:{properties:[{key:"id",type:"string?"},{key:"price",type:"Money?"},{key:"product",type:"Product?"},{key:"sku",type:"string?"},{key:"title",type:"string?"},{key:"untranslatedTitle",type:"string?"}]},DiscountApplication:{properties:[{key:"allocationMethod",type:"string?"},{key:"targetSelection",type:"string?"},{key:"targetType",type:"string?"},{key:"title",type:"string?"},{key:"type",type:"string?"},{key:"value",type:"Money?"}]},DiscountAllocation:{properties:[{key:"amount",type:"Money?"},{key:"discountApplication",type:"DiscountApplication?"}]},SellingPlan:{properties:[{key:"id",type:"string?"},{key:"name",type:"string?"}]},SellingPlanAllocation:{properties:[{key:"sellingPlan",type:"SellingPlan?"}]},OrderCustomer:{properties:[{key:"id",type:"string?"},{key:"isFirstOrder",type:"boolean?"}]},Order:{properties:[{key:"id",type:"string?"},{key:"customer",type:"OrderCustomer?"}]},ShippingRate:{properties:[{key:"price",type:"Money?"}]},TransactionPaymentMethod:{properties:[{key:"name",type:"string?"},{key:"type",type:"string?"}]},Transaction:{properties:[{key:"amount",type:"Money?"},{key:"gateway",type:"string?"},{key:"paymentMethod",type:"TransactionPaymentMethod?"}]},CartLineCost:{properties:[{key:"totalAmount",type:"Money?"}]},CartLine:{properties:[{key:"cost",type:"CartLineCost?"},{key:"merchandise",type:"ProductVariant?"},{key:"quantity",type:"number?"}]},CheckoutLineItem:{properties:[{key:"discountAllocations",type:"DiscountAllocation[]?"},{key:"finalLinePrice",type:"Money?"},{key:"id",type:"string?"},{key:"quantity",type:"number?"},{key:"sellingPlanAllocation",type:"SellingPlanAllocation?"},{key:"title",type:"string?"},{key:"variant",type:"ProductVariant?"}]},Checkout:{properties:[{key:"buyerAcceptsEmailMarketing",type:"boolean?"},{key:"buyerAcceptsSmsMarketing",type:"boolean?"},{key:"currencyCode",type:"string?"},{key:"delivery",type:"Delivery?"},{key:"discountApplications",type:"DiscountApplication[]?"},{key:"discountsAmount",type:"Money?"},{key:"token",type:"string?"},{key:"lineItems",type:"CheckoutLineItem[]?"},{key:"order",type:"Order?"},{key:"shippingLine",type:"ShippingRate?"},{key:"subtotalPrice",type:"Money?"},{key:"totalPrice",type:"Money?"},{key:"totalTax",type:"Money?"},{key:"transactions",type:"Transaction[]?"}]},ProductAddedToCart:{properties:[{key:"cartLine",type:"CartLine?"}]},ProductRemovedFromCart:{properties:[{key:"cartLine",type:"CartLine?"}]},CheckoutStarted:{properties:[{key:"checkout",type:"Checkout?"}]},CheckoutAddressInfoSubmitted:{properties:[{key:"checkout",type:"Checkout?"}]},CheckoutContactInfoSubmitted:{properties:[{key:"checkout",type:"Checkout?"}]},CheckoutShippingInfoSubmitted:{properties:[{key:"checkout",type:"Checkout?"}]},PaymentInfoSubmitted:{properties:[{key:"checkout",type:"Checkout?"}]},CheckoutCompleted:{properties:[{key:"checkout",type:"Checkout?"}]},Collection:{properties:[{key:"id",type:"string?"},{key:"title",type:"string?"},{key:"productVariants",type:"ProductVariant[]?"}]},Cart:{properties:[{key:"id",type:"string?"},{key:"lines",type:"CartLine[]?"},{key:"cost",type:"CartLineCost?"},{key:"totalQuantity",type:"number?"}]},SearchResult:{properties:[{key:"query",type:"string?"},{key:"productVariants",type:"ProductVariant[]?"}]},SearchSubmitted:{properties:[{key:"searchResult",type:"SearchResult?"}]},CollectionViewed:{properties:[{key:"collection",type:"Collection?"}]},ProductViewed:{properties:[{key:"productVariant",type:"ProductVariant?"}]},CartViewed:{properties:[{key:"cart",type:"Cart?"}]}})),Ba={"input.noibu.com":!0,"input.staging.noibu.com":!0,"vf.noibu.com":!0,"vf.staging.noibu.com":!0,"cdn.noibu.com":!0};function Ha(e,t=!0){return{url:Ls(e.filename),[$]:ne,j_err:bs(e.error,t)}}function qa(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 Oe:o=function(e,t){const n={url:Ls(e.responseURL,!0),[$]:ee,h_code:Math.max(e.status,0)};return(t||0===t)&&(n.seq=t),n}(i,n);break;case De:o=Ha(i);break;case Fe:o=function(e,t){const n={url:Ls(e.url,!0),[$]:ee,h_code:Math.max(e.status,0)};return(t||0===t)&&(n.seq=t),n}(i,n);break;case"GQLError":s=Fe,o=function(e,t){const n={url:vs(),[$]:re,gql_err:e};return(t||0===t)&&(n.seq=t),n}(i,n);break;case"CSPError":s=De,a=i,o={url:vs(),[$]:ie,csp_err:a};break;case"ImageError":s=De,o=function(e){return{url:vs(),[$]:oe,res_err:e}}(i);break;case Ue:o=function(e){return{url:vs(),[$]:ge,pagecheck_err:e}}(i);break;case Be:o=Ha(i,!1);break;case He:o=Ha(i);break;case qe:o=function(e){return{url:vs(),[$]:ne,j_err:bs(e)}}(i);break;case Pe:case We:o=Ha(i);break;default:try{o=Ha(i),i instanceof Event&&(!function(e,t,n){let r=null;if(n.detail)try{r=Cs(n.detail)}catch(e){r="non-serializable"}let i=`Fire error event of type ${e}.`;null!=r&&(i+=` Detail: ${r}.`),t.j_err.msg=hs(i)}(s,o,i),s=De)}catch(e){return null}}var a;return o&&(o.err_src=s),o}const Wa=gs(ys(Uo((new Error).stack)).pop().file);let ja=0;function Ga(e,t,n,r){if(e===Ve)return;const i=qa(e,t,n);if(!i||!i.url)return;const o=i.url;if(Ms(o)){const e=new URL(o);if(e.hostname in Ba||!e.protocol.startsWith("http"))return}if(function(e){const t=Cs(e);return nt.some(e=>e(t))}(i))return;(function(e){if(e[$]===ne){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")&&gs(n)===Wa&&!r.includes("nbuwrapper")&&!n.includes("noibu-customer-session-playback"))return zs.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,U),!0}}if(e.msg){const t=e.msg.toLowerCase();if(t.includes("input.noibu")||t.includes("input.b.noibu"))return zs.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,U),!0}}else if(e[$]===ee&&e.url){const t=e.url;if("string"==typeof t)for(let n=0;n<Ee.length;n+=1){const r=Ee[n];if(t.includes(r))return zs.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,U),!0}}return!1})(i)||ja>=500||(ja+=1,ia.getInstance().addError(),Na.getInstance().addEvent(i,de,r))}class $a{static configure(e){return this.allowUntrustedEvents=e,this.initialRequest=!1,this.instance||(this.instance=new $a),this.instance}static getInstance(){if(!this.instance)throw new Error("HelpCode was not configured");return this.instance}constructor(){this.requestContext=null,Vs()&&(Zs(window,"hashchange",e=>this._handleHashChange(e)),Zs(window,"noibuHelpCode",e=>this._receiveHelpCode(e)))}requestHelpCode(e=!0,t=!1){if(null!=this.requestContext)return this.requestContext.promise;if(!ha.getInstance().isConnected())return Promise.reject(new Error("noibu connection is closed"));const n={alertUser:e,enableLiveView:t,resolve:null,reject:null,promise:null,timeout:0};n.promise=new Promise((e,t)=>{n.resolve=e,n.reject=t}),this.requestContext=n;return!1===this._sendRequest()?(this.requestContext=null,Promise.reject(new Error("noibu client is disabled"))):(n.timeout=window.setTimeout(()=>{this.requestContext===n&&(this.requestContext=null,n.reject(new Error("noibu help code request timed out")))},1e4),n.promise)}checkInitialRequest(){vs().toLowerCase().includes("#helpcode")&&!1===$a.initialRequest&&($a.initialRequest=!0,this._sendRequest())}_handleHashChange(e){if(!e.isTrusted&&!$a.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,window.clearTimeout(t.timeout);const{success:n,data:r}=e.detail;!0===t.alertUser?this._presentHelpCode(e):n&&!0===t.enableLiveView&&this._dispatchHelpCodeAlerted(r),n?t.resolve(r):t.reject(new Error(r))}_presentHelpCode(e){const{success:t,data:n}=e.detail;if(t)window.prompt("",n),this._dispatchHelpCodeAlerted(n);else{const e="Noibu help code is not available due to "+n;window.alert(e),zs.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,U)}}_dispatchHelpCodeAlerted(e){const t=new CustomEvent("noibuHCAlert",{detail:{data:e}});window.dispatchEvent(t)}_sendRequest(){return ha.getInstance().sendMessage(Q,{[Q]:X})}}class za{constructor(){this.customIDs={},this.customErrorsCount=0,this.internalCustomIDs={},this._persistCustomAttributesToSessionStorage(),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 za),this.instance}exposeFunctions(){const e=this._getSDKWindowObject();window.NOIBUJS=e,this._installGlobalTrack(),window.dispatchEvent(new CustomEvent("noibuSDKReady"))}_installGlobalTrack(){try{const e=window.noibuTrack;if("function"!=typeof e)return;const t=e.q,n=Array.isArray(t)?t:[];window.noibuTrack=(...e)=>this._track(...e);for(const e of n)try{this._track(...e)}catch{}}catch{}}_track(...e){const t=Ya(...e);return t&&!t.success&&zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Ecommerce track failed: "+t.errors.join(", "),!1,U),t}_getSDKWindowObject(){const e={requestHelpCode:this.requestHelpCode.bind(this),pageVisitId:this.pageVisitId.bind(this),addCustomAttribute:this.addCustomAttribute.bind(this),addError:this.addCustomError.bind(this),addJsSdkError:this._addErrorFromJSSdk.bind(this),noibuBrowserID:this.noibuBrowserID.bind(this),sessionId:this.sessionId.bind(this),resetSession:this.resetSession.bind(this),track:this._track.bind(this)};return document.getElementById("njs-helper-extension-indicator")&&(e.pageGroups=this.getPageGroups.bind(this),e.customAttributes=this.getCustomAttributes.bind(this)),e}_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!==je&&t!==Ge?this.INVALID_ERROR_SOURCE_MSG:(Ga(t,{error:e}),n)}addCustomError(e){const t=this._validateAndSetCustomError(e);return t!==this.SUCCESS_MSG||Ga(We,{error:e}),t}addCustomAttribute(e,t){const n=this.addCustomAttributeInternal(e,t,!1);return n===this.SUCCESS_MSG&&window.dispatchEvent(new CustomEvent("noibuCustomAttributeAdded",{detail:{name:e,value:t}})),n}addNoibuInternalCustomAttribute(e,t){return this.addCustomAttributeInternal(e,t,!0)}addCustomAttributeInternal(e,t,n){let r=this.customIDs;if(n&&(r=this.internalCustomIDs),ia.getInstance().addCustomAttributeTotalCount(),!n&&Object.keys(r).length>=50)return ia.getInstance().addCustomAttributeFailCount(),this.TOO_MANY_IDS_ADDED_MSG;const i=this._validateCustomIDInput(e,t);if(i!==this.SUCCESS_MSG)return ia.getInstance().addCustomAttributeFailCount(),i;if(e in r)return ia.getInstance().addCustomAttributeFailCount(),this.ID_NAME_ALREADY_ADDED_MSG;if(r[e]=t,ha.getInstance().sendMessage(j,{[we]:{id_name:e,id_val:t}}),!n){const e=Object.keys(r).length;ia.getInstance().setCustomAttributeKeyCount(e),this._persistCustomAttributesToSessionStorage()}return this.SUCCESS_MSG}_persistCustomAttributesToSessionStorage(){try{sessionStorage.setItem("n_custom_attributes",JSON.stringify(this.customIDs))}catch{}}_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,t=!1){return $a.getInstance().requestHelpCode(e,t)}noibuBrowserID(){return zs.getInstance().browserId}pageVisitId(){return zs.getInstance().pageVisitId}sessionId(){return zs.getInstance().sessionId}resetSession(){zs.getInstance().scheduleResetClientConfig()}getPageGroups(){return ra()}getCustomAttributes(){return{...this.customIDs,...this.internalCustomIDs}}}function Za(e,t){try{za.getInstance().addNoibuInternalCustomAttribute(e,t)}catch(e){}}function Ka(e,t,n){"string"==typeof n&&n.length>0&&e.push({name:t,value:n})}function Ya(e,t){const n={success:!0,errors:[]};if("string"!=typeof e)return n.success=!1,n.errors.push("Event name must be a string."),n;if(null!==t&&"object"!=typeof t)return n.success=!1,n.errors.push("Event payload must be an object or null."),n;const r=e in La,i=r?"noibu":"custom",o=null!==t;if(o){try{r?function(e,t,n){const r={ignoreMissedNullableProperties:!0,autoFixMissedNullableProperties:!1,autoAddMissedNullableProperties:!1,autoRemoveUnexpectedProperties:!0};switch(e){case La.product_added_to_cart:!function(e,t,n){Oa(e,"ProductAddedToCart",[],n.errors,Ua,t)}(t,r,n);break;case La.product_removed_from_cart:!function(e,t,n){Oa(e,"ProductRemovedFromCart",[],n.errors,Ua,t)}(t,r,n);break;case La.checkout_started:!function(e,t,n){Oa(e,"CheckoutStarted",[],n.errors,Ua,t)}(t,r,n);break;case La.checkout_address_info_submitted:!function(e,t,n){Oa(e,"CheckoutAddressInfoSubmitted",[],n.errors,Ua,t)}(t,r,n);break;case La.checkout_contact_info_submitted:!function(e,t,n){Oa(e,"CheckoutContactInfoSubmitted",[],n.errors,Ua,t)}(t,r,n);break;case La.checkout_shipping_info_submitted:!function(e,t,n){Oa(e,"CheckoutShippingInfoSubmitted",[],n.errors,Ua,t)}(t,r,n);break;case La.payment_info_submitted:!function(e,t,n){Oa(e,"PaymentInfoSubmitted",[],n.errors,Ua,t)}(t,r,n);break;case La.checkout_completed:!function(e,t,n){Oa(e,"CheckoutCompleted",[],n.errors,Ua,t)}(t,r,n);break;case La.search_submitted:!function(e,t,n){Oa(e,"SearchSubmitted",[],n.errors,Ua,t)}(t,r,n);break;case La.collection_viewed:!function(e,t,n){Oa(e,"CollectionViewed",[],n.errors,Ua,t)}(t,r,n);break;case La.product_viewed:!function(e,t,n){Oa(e,"ProductViewed",[],n.errors,Ua,t)}(t,r,n);break;case La.cart_viewed:!function(e,t,n){Oa(e,"CartViewed",[],n.errors,Ua,t)}(t,r,n);break;default:n.errors.push(`Event name "${e}" is not supported.`)}}(e,t,n):function(e,t,n){e.length>500&&n.errors.push("Event name must not exceed 500 characters.");let r=null;try{r=JSON.stringify(t)}catch(e){n.errors.push("Event payload is not JSON-serializable.")}"string"==typeof r&&r.length>1e4&&n.errors.push("Event payload must not exceed 10,000 characters.")}(e,t,n)}catch(e){n.errors.push("Unexpected error: "+e)}if(n.errors.length&&(n.success=!1),!n.success)return n}const s={platform:i,name:e,data:o?Cs(t):null};if(Na.getInstance().addEvent(s,fe),r&&o)try{for(const e of function(e){var t,n,r;const i=[];if(!e||"object"!=typeof e)return i;const{checkout:o}=e;o&&(Ka(i,"orderId",null===(t=o.order)||void 0===t?void 0:t.id),Ka(i,"customerId",null===(r=null===(n=o.order)||void 0===n?void 0:n.customer)||void 0===r?void 0:r.id));const{cart:s}=e;return s&&Ka(i,"cartId",s.id),i}(t))Za(e.name,e.value)}catch(e){}return n}function Ja(e,t,n){const r=n.get(e);if(!r)return{success:!1,errors:["Converter is not implemented."]};let i;try{i=r(t)}catch(e){return{success:!1,errors:["Converter error: "+e]}}const o={success:!0,errors:[]};for(const t of i)try{const n=Ya(e,t);n.success||(o.success=!1,o.errors.push(...n.errors))}catch(e){o.success=!1,o.errors.push("Unexpected error: "+e)}return o}const Xa=e=>[e],Qa=new Map;Qa.set(La.product_added_to_cart,Xa),Qa.set(La.product_removed_from_cart,Xa),Qa.set(La.checkout_started,Xa),Qa.set(La.checkout_address_info_submitted,Xa),Qa.set(La.checkout_contact_info_submitted,Xa),Qa.set(La.checkout_shipping_info_submitted,Xa),Qa.set(La.payment_info_submitted,Xa),Qa.set(La.checkout_completed,Xa),Qa.set(La.search_submitted,Xa),Qa.set(La.collection_viewed,Xa),Qa.set(La.product_viewed,Xa),Qa.set(La.cart_viewed,Xa);class ec{static getInstance(){return this.instance||(this.instance=new ec)}constructor(){this.known=!1;const e=ke(),t=null==e?void 0:e.ecomm_workflow;this.strategy=t||tc.Default}acknowledgePlatform(){!1===this.known&&this.saveKnownFlag(),this.known=!0}isPlatform(){return!!this.known||(this.known="Shopify"in window||"bodlEvents"in window||"magentoStorefrontEvents"in window,this.known?(this.saveKnownFlag(),!0):(this.known=null!==this.loadKnownFlag(),this.known))}shouldIgnoreFunnelStepConfig(){switch(this.strategy){case tc.UsePlatformOnly:case tc.UseCustomOnly:return!0;case tc.UseFunnelConfigOnly:return!1;case tc.Default:default:return this.isPlatform()}}saveKnownFlag(){try{localStorage.setItem("n_platform","1")}catch(e){}}loadKnownFlag(){try{return localStorage.getItem("n_platform")}catch(e){return null}}}var tc;ec.instance=null,function(e){e[e.Default=0]="Default",e[e.UsePlatformOnly=1]="UsePlatformOnly",e[e.UseCustomOnly=2]="UseCustomOnly",e[e.UseFunnelConfigOnly=3]="UseFunnelConfigOnly"}(tc||(tc={}));let nc=!1,rc=null;class ic{constructor(){this.eventDebouncer=Na.getInstance(),this.inputManager=za.getInstance()}static getInstance(){return this.instance||(this.instance=new ic),this.instance}monitor(){!function(){if(!nc){nc=!0;try{const e=localStorage.getItem("NRBA_SESSION");e&&(rc=JSON.parse(e),za.getInstance().addNoibuInternalCustomAttribute("newrelic-session-id",rc.value))}catch(e){}}}(),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){ec.getInstance().acknowledgePlatform();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=function(){var e;return null!==(e=null==rc?void 0:rc.value)&&void 0!==e?e:null}();r&&(n.newRelicSessionId=r);const i={platform:"shopify",name:e.name,data:Cs(n)};this.eventDebouncer.addEvent(i,fe),Ja(e.name,n,Qa)}handleCustomEvent(e){const{customData:t}=e,n={platform:"shopify",name:e.name,data:as(Cs(t))};this.eventDebouncer.addEvent(n,fe)}handleDomEvent(e){const{data:t}=e,n={platform:"shopify",name:e.name,data:Cs(t)};this.eventDebouncer.addEvent(n,fe)}}ic.instance=null;const oc=new Map;function sc(e){const t=[];for(const n of e.line_items){const r={cartLine:{quantity:n.quantity,cost:{totalAmount:{amount:e.product_value,currencyCode:e.currency}},merchandise:cc(n)}};t.push(r)}return t}function ac(e){const t={currencyCode:e.currency,totalPrice:{amount:e.cart_value,currencyCode:e.currency},lineItems:e.line_items.map(e=>({quantity:e.quantity,title:e.product_name,finalLinePrice:{amount:e.purchase_price,currencyCode:e.currency},variant:cc(e)}))},{coupon_codes:n}=e;return Array.isArray(n)&&(t.discountApplications=n.map(e=>({title:e}))),e.order_id&&(t.order={id:""+e.order_id}),{checkout:t}}function cc(e){var t,n;const r=null!==(n=null!==(t=e.base_price)&&void 0!==t?t:e.purchase_price)&&void 0!==n?n:e.sale_price;return{id:""+e.variant_id,sku:e.sku,price:r?{amount:r,currencyCode:e.currency}:void 0,product:{id:""+e.product_id,title:e.product_name}}}oc.set(La.product_added_to_cart,(function(e){return sc(e)})),oc.set(La.product_removed_from_cart,(function(e){return sc(e)})),oc.set(La.checkout_started,(function(e){return[ac(e)]})),oc.set(La.checkout_shipping_info_submitted,(function(e){return[ac(e)]})),oc.set(La.payment_info_submitted,(function(e){return[ac(e)]})),oc.set(La.checkout_completed,(function(e){return[ac(e)]})),oc.set(La.search_submitted,(function(e){if(!e.search_keyword)return[];return[{searchResult:{query:e.search_keyword}}]})),oc.set(La.collection_viewed,(function(e){var t;if(!e.category_id&&!e.category_name&&!e.line_items)return[];return[{collection:{id:""+e.category_id,title:e.category_name,productVariants:null===(t=e.line_items)||void 0===t?void 0:t.map(e=>cc(e))}}]})),oc.set(La.product_viewed,(function(e){if(!e.line_items||0===e.line_items.length)return[];return e.line_items.map(e=>({productVariant:cc(e)}))})),oc.set(La.cart_viewed,(function(e){var t;if(!(e.event_id||e.cart_value||e.line_items&&0!==e.line_items.length))return[];return[{cart:{id:""+e.event_id,cost:e.cart_value?{totalAmount:{amount:e.cart_value,currencyCode:e.currency}}:void 0,lines:null===(t=e.line_items)||void 0===t?void 0:t.map(e=>({quantity:e.quantity,cost:{totalAmount:{amount:e.purchase_price,currencyCode:e.currency}},merchandise:cc(e)}))}}]}));class lc{constructor(){this.eventDebouncer=Na.getInstance()}static getInstance(){return this.instance||(this.instance=new lc)}monitor(){const e=this.subscribeEvents.bind(this);Zs(window,"load",e,!1)}subscribeEvents(){const e=window.bodlEvents;if(!e)return;ec.getInstance().acknowledgePlatform();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:Cs(t)};this.eventDebouncer.addEvent(n,fe),function(e,t){Ja(e,t,oc)}(e,t)}}lc.instance=null;const uc=new Map;function dc(e){const{eventInfo:t}=e,{storefrontInstanceContext:n,changedProductsContext:r}=t,i=r.items,o=n.storeViewCurrencyCode,s=[];for(const e of i){const{product:t}=e,n={cartLine:{quantity:fc(e.quantity),cost:{totalAmount:{amount:e.prices.price.value,currencyCode:o}},merchandise:{id:""+t.productId,title:t.name,sku:t.sku}}};s.push(n)}return s}function hc(e){const{eventInfo:t}=e,{storefrontInstanceContext:n,shoppingCartContext:r}=t,{items:i}=r,o=n.storeViewCurrencyCode,s=[];if(Array.isArray(i))for(const e of i){const t={id:""+e.id,quantity:fc(e.quantity),variant:pc(e,o)};s.push(t)}const a={checkout:{currencyCode:o,lineItems:s}},{orderContext:c}=t;if(c){const e=gc(c.grandTotal);"number"==typeof e&&(a.checkout.totalPrice={amount:e,currencyCode:o}),c.orderId&&(a.checkout.order={id:""+c.orderId})}return a}function pc(e,t){const{product:n}=e,r={id:""+n.productId,sku:n.sku,title:n.name},{pricing:i}=n;if(i){const e=gc(i.regularPrice);"number"==typeof e&&(r.price={amount:e,currencyCode:t})}return r}function fc(e){const t=parseInt(e,10);return Number.isNaN(t)?null:t}function gc(e){const t=parseFloat(e);return Number.isNaN(t)?null:t}uc.set(La.product_added_to_cart,(function(e){return dc(e)})),uc.set(La.product_removed_from_cart,(function(e){return dc(e)})),uc.set(La.checkout_started,(function(e){return[hc(e)]})),uc.set(La.checkout_completed,(function(e){return[hc(e)]})),uc.set(La.search_submitted,(function(e){var t,n,r;const{eventInfo:i}=e,o=null===(r=null===(n=null===(t=null==i?void 0:i.searchInputContext)||void 0===t?void 0:t.units)||void 0===n?void 0:n[0])||void 0===r?void 0:r.phrase;if(!o)return[];return[{searchResult:{query:o}}]})),uc.set(La.product_viewed,(function(e){var t;const{eventInfo:n}=e,{storefrontInstanceContext:r,productContext:i}=n||{};if(!i)return[];const o=null==r?void 0:r.storeViewCurrencyCode;return[{productVariant:{id:""+i.productId,sku:i.sku,price:(null===(t=i.pricing)||void 0===t?void 0:t.regularPrice)?{amount:i.pricing.regularPrice,currencyCode:o}:void 0,product:{id:""+i.productId,title:i.name}}}]})),uc.set(La.cart_viewed,(function(e){var t,n,r,i,o,s,a;const{eventInfo:c}=e,{storefrontInstanceContext:l,shoppingCartContext:u}=c||{},{items:d}=u||{};if(!(u&&(u.cartId||u.id||u.cartValue||(null===(n=null===(t=u.prices)||void 0===t?void 0:t.subtotalIncludingTax)||void 0===n?void 0:n.value)||d&&0!==d.length)))return[];const h=(null==l?void 0:l.storeViewCurrencyCode)||(null===(o=null===(i=null===(r=null==d?void 0:d[0])||void 0===r?void 0:r.prices)||void 0===i?void 0:i.price)||void 0===o?void 0:o.currency),p=(null==u?void 0:u.cartId)||(null==u?void 0:u.id),f=(null==u?void 0:u.cartValue)||(null===(a=null===(s=null==u?void 0:u.prices)||void 0===s?void 0:s.subtotalIncludingTax)||void 0===a?void 0:a.value);return[{cart:{id:p,lines:null==d?void 0:d.map(e=>{var t,n,r,i,o,s;return{quantity:fc(e.quantity),cost:{totalAmount:{amount:null===(n=null===(t=e.prices)||void 0===t?void 0:t.price)||void 0===n?void 0:n.value,currencyCode:(null===(i=null===(r=e.prices)||void 0===r?void 0:r.price)||void 0===i?void 0:i.currency)||h}},merchandise:pc(e,(null===(s=null===(o=e.prices)||void 0===o?void 0:o.price)||void 0===s?void 0:s.currency)||h)}}),cost:f?{totalAmount:{amount:f,currencyCode:h}}:void 0,totalQuantity:null==u?void 0:u.totalQuantity}}]}));class mc{constructor(){this.clientConfig=zs.getInstance(),this.eventDebouncer=Na.getInstance()}static getInstance(){return this.instance||(this.instance=new mc)}monitor(){const e=()=>!!window.magentoStorefrontEvents&&!!window.magentoStorefrontEvents.subscribe;if(e())return void this.subscribeEvents();let t=0;const n=setInterval(()=>{t+=1,t>5&&clearInterval(n),e()&&(clearInterval(n),this.subscribeEvents())},1e3)}subscribeEvents(){ec.getInstance().acknowledgePlatform();try{const{subscribe:e}=window.magentoStorefrontEvents,t=this.handleEvent.bind(this);e.pageView(e=>t("page_viewed",e)),e.addToCart(e=>t("product_added_to_cart",e)),e.removeFromCart(e=>t("product_removed_from_cart",e)),e.initiateCheckout(e=>t("checkout_started",e)),e.placeOrder(e=>t("checkout_completed",e)),e.searchRequestSent(e=>t("search_submitted",e)),e.productPageView(e=>t("product_viewed",e)),e.shoppingCartView(e=>t("cart_viewed",e))}catch(e){const t="MagentoEventMonitor: "+e;this.clientConfig.postNoibuErrorAndOptionallyDisableClient(t,!1,U)}}handleEvent(e,t){const n={name:e,platform:"magento",data:Cs(t)};this.eventDebouncer.addEvent(n,fe),function(e,t){Ja(e,t,uc)}(e,t)}}mc.instance=null;class vc{constructor(e,t){this.step=e,this.pattern=t}}class yc extends vc{constructor(e,t){super(e,t),this.regexp=new RegExp(this.pattern,"i")}match(e){const{url:t}=e;return this.regexp.test(t)}}class bc extends vc{constructor(e,t){super(e,t),this.prefix=null;const n=t[0];(n===Sc||n===kc||n===Ec)&&(this.prefix=n,t=t.substring(1),n===Ec&&(t=t.replace(_c,""))),this.regexp=new RegExp(t,"i")}match(e){const{id:t,className:n,tagName:r,text:i}=e;return"p"!==r&&(this.prefix===Sc?this.regexp.test(t):this.prefix===kc?this.regexp.test(n):this.prefix===Ec?this.regexp.test(r):!(i.length>=Cc)&&this.regexp.test(i))}}class Ic extends vc{constructor(e,t,n){super(e,t),this.regexp=new RegExp(this.pattern,"i"),this.method=n}match(e){return e.method.toUpperCase()===this.method&&this.regexp.test(e.url)}}var wc;!function(e){e[e.AddToCart=1]="AddToCart",e[e.CheckoutStarted=2]="CheckoutStarted",e[e.PlaceOrder=3]="PlaceOrder",e[e.CheckoutSuccess=4]="CheckoutSuccess"}(wc||(wc={}));const Cc=40,Sc="#",kc=".",Ec="<",_c=">";function Ac(e,t,n){const r=t.step;if("number"!=typeof r)return;const i=Dc.get(e);if("string"!=typeof i)return;const o=t[i]||"";if("string"!=typeof o)return;const s=o.split(",").filter(e=>e.length);if(s.includes(Pc))return;if(!s.includes(Vc)){const e=Tc(r,i);e&&s.push(...e)}else for(let e=s.length-1;e>=0;e--)s[e]===Vc&&s.splice(e,1);for(const t of s)try{const i=e(r,t);n.push(i)}catch(e){continue}}function Tc(e,t){const n=Fc[e];if("object"==typeof n){const e=n[t];if(Array.isArray(e))return e}return null}const Rc=(e,t)=>new yc(e,t),Mc=(e,t)=>new bc(e,t),xc=(e,t)=>new Ic(e,t,"GET"),Nc=(e,t)=>new Ic(e,t,"POST"),Lc=(e,t)=>new Ic(e,t,"PATCH"),Oc=(e,t)=>new Ic(e,t,"PUT"),Dc=new Map([[Rc,"on_url"],[Mc,"click"],[xc,"http_get"],[Nc,"http_post"],[Lc,"http_patch"],[Oc,"http_put"]]),Pc="disabled",Vc="no_default",Fc={[wc.AddToCart]:{on_url:["/(cart|basket|bag)(.php|.jsp)?(/)?$",".*[/.](shoppingbag)[./#?].*",".*my_cart_big.*"],click:[".(add-to-cart)",".(tocart)","\\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)","(カートに追加)","^添加至购物袋$","^购买$","^購入する$","(أضف الى السلة)"]},[wc.CheckoutStarted]:{on_url:[".*[/.-](checkout|onepage|checkouts|billing|shipping|check-out|checkoutshow)[#./?-].*",".*/checkout$",".*/billing$",".*onepagecheckout$",".*onestepcheckout/$",".*(avoncartview?).*",".*(paypal/express/review).*",".*/on/demandware.store/.*",".*/firecheckout/$",".*/personaldata/.*"],click:["#^checkout$",".^checkout$",".^standard-checkout$",".(btn-payment ml-4)","(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$","(チェックアウトに進む)","^去结算$","^付款。$","^お支払い$","(تاكيد الطلب)"]},[wc.PlaceOrder]:{click:["#completeOrder","#paypal_express","#^place_order$","#^btnMakeCCPayment$","#^braintree_paypal$",".(paypal-button-text)","(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)","(注文する)","(إنشاء الطلب)","(注文を確定)","^お支払いへ進む$","^确认下单$"]}};class Uc{constructor(e){this.counters=new Map,this.clientConfig=e}isTrackAllowed(e){const{pageVisitId:t}=this.clientConfig;t!==this.pageVisitId&&(this.pageVisitId=t,this.counters.clear());const n=this.counters.get(e)||0;return this.counters.set(e,n+1),this.evaluateByStep(e,n)}evaluateByStep(e,t){return t<1}}class Bc{static getInstance(){if(ec.getInstance().shouldIgnoreFunnelStepConfig())return null;const e=zs.getInstance();return this.instance||(this.instance=new Bc(e))}static reinitializeInstance(){if(ec.getInstance().shouldIgnoreFunnelStepConfig())return;const e=zs.getInstance();this.instance.handleNewPageVisitNavigation(e)}constructor(e){this.matchersByUrl=[],this.matchersByClick=[],this.matchersByHttp=[],this.clientConfig=e,this.trackOverflowGuard=new Uc(e),Fs(()=>this.createMatchers())}handleNewPageVisitNavigation(e){this.clientConfig=e,this.trackOverflowGuard=new Uc(e),Fs(()=>this.matchCurrentUrl())}monitor(){Fs(()=>this.listenEvents())}listenEvents(){this.listenClickEvent(),this.listenHttpEvent(),this.matchCurrentUrl()}createMatchers(){const e=function(e){const t=[];for(const n of e)Ac(Rc,n,t),Ac(Mc,n,t),Ac(xc,n,t),Ac(Nc,n,t),Ac(Lc,n,t),Ac(Oc,n,t);return t}(NOIBUJS_CONFIG.funnel_config_steps||[]);e.sort((e,t)=>t.step-e.step);for(const t of e){let e;switch(!0){case t instanceof yc:e=this.matchersByUrl;break;case t instanceof bc:e=this.matchersByClick;break;case t instanceof Ic:e=this.matchersByHttp}e&&e.push(t)}}listenClickEvent(){const e=this.matchClick.bind(this);Zs(window,"noibuClick",e)}listenHttpEvent(){const e=this.matchRequest.bind(this);Zs(window,"noibuRequest",e)}matchCurrentUrl(){const{pageVisitId:e}=this.clientConfig;if(e===this.pageVisitId)return;this.pageVisitId=e;const t={url:location.href};this.match(this.matchersByUrl,t)}matchClick({detail:e}){this.match(this.matchersByClick,e)}matchRequest({detail:e}){this.match(this.matchersByHttp,e)}match(e,t){if(!ec.getInstance().shouldIgnoreFunnelStepConfig())for(const n of e){if(!Fs(()=>n.match(t),!1))continue;if(this.isNegativeMatch(n))continue;const{step:e}=n;if(this.trackOverflowGuard.isTrackAllowed(e)){const t=qc.get(e);t&&this.track(t)}return}}track(e){Ya(e,null)}isNegativeMatch(e){return!!(e.step===wc.CheckoutStarted&&e instanceof yc&&Hc.test(location.href))}}Bc.instance=null;const Hc=new RegExp(".*[\\/\\.-](checkout\\/cart).*","i"),qc=new Map([[1,"product_added_to_cart"],[2,"checkout_started"],[3,"payment_info_submitted"],[4,"checkout_completed"]]);function Wc(){ha.getInstance().handleShow()}function jc(){Ea.getInstance().handleFragPost(),ha.getInstance().close(),Na.getInstance().flushAll(),ha.getInstance().handleUnload()}function Gc(){try{Jo(window.history,"pushState",(function(e){return function nbuWrapper(t,n,r){e.call(history,t,n,r),$c()}})),Zs(window,"popstate",$c),Zs(window,"hashchange",$c)}catch(e){}}function $c(){const e=new CustomEvent("noibuNavigation");window.dispatchEvent(e)}var zc=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 Zc{constructor(){this.contentTypeReadableRegex=new RegExp("text|json|xml|html|graphql|x-www-form-urlencoded|form-data","i");const e=vs();if(this.initialURLPartsReversed=[],this.hostname="",e&&e.length>0)try{this.hostname=new URL(e).hostname,this.initialURLPartsReversed=this.hostname.split("."),V.test(this.initialURLPartsReversed[0])&&this.initialURLPartsReversed.shift(),this.initialURLPartsReversed.reverse()}catch(e){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to determine hostname for initial URL: "+e,!1,B)}this.httpDataCollectionEnabled=!!ke().http_data_collection;const t=As();this.httpDataAllowedAbsoluteRegex=Zc.buildAllowedRegex(t,!0),this.httpDataAllowedRelativeRegex=Zc.buildAllowedRegex(t,!1)}static getInstance(){return this.instance||(this.instance=new Zc),this.instance}static buildAllowedRegex(e,t){if(!e||!Array.isArray(e))return null;const n=e.map(e=>Ns(e).toLowerCase()).filter(e=>{const n=Zc.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 zc(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=Cs(e.response);return"{}"===t?null:t}catch(e){return zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to stringify JSON response: "+e,!1,B),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 zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to determine hostname for request URL: "+e,!1,B),!1}const r=n.split(".");if(r.length<1)return!1;if(V.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),f=this.restrictPayload(h,e,s);return{rqh:Xo(this.removePIIHeaders(t)),rqp:p,rsh:Xo(this.removePIIHeaders(r)),rsp:f}}isValidRequest(e,t){return!!this.httpDataCollectionEnabled&&!(!t||"string"!=typeof t)}shouldContinueForURL(e){return!!this.httpDataCollectionEnabled&&(!(!e||"string"!=typeof e||!this.initialURLPartsReversed)&&!(Zc.isAbsoluteURL(e)&&!this.isURLSameDomain(e)&&!this.shouldCollectPayloadForURL(e)))}static isAbsoluteURL(e){return function(e){return!(!e||"string"!=typeof e)&&(e.indexOf("://")>0||0===e.indexOf("//"))}(e)}shouldCollectPayloadForURL(e){if(!e||"string"!=typeof e)return!1;const t=!!this.httpDataAllowedAbsoluteRegex&&this.httpDataAllowedAbsoluteRegex.test(e.toLowerCase()),n=(!Zc.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 zs.getInstance().postNoibuErrorAndOptionallyDisableClient({msg:"restrictPayload received non string payload",payloadType:typeof e},!1,U),"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;const i=M().restrictsBundleSize;return i&&(r=i),e.length>r?(ia.getInstance().addHttpDataDropByLength(),"Dropped due to length. Payload length: "+e.length):(ia.getInstance().addHttpDataPayloadCount(),as(e))}contentLengthAcceptable(e,t){let n=t?262144:65536;const r=M().restrictsBundleSize;return r&&(n=r),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=Zc.getInstance();return n.contentTypeAcceptable(e)?n.contentLengthAcceptable(e,t)?"":(ia.getInstance().addHttpDataDropByLength(),"Dropped due to length. Payload length: "+n.contentLength(e)):(ia.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(Ds(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 Cs(e)}catch(e){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to stringify request body: "+e,!1,B)}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)=>{L.includes(t.toLowerCase())?n.set(t,"******"):n.set(t,as(e))}),t}}function Kc(e){return"number"!=typeof e||(e>=400||e<=0)}class Yc{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:hs(Es(e.url))},this.httpData=t,this.gqlError=n}saveHTTPEvent(){if(!this.httpEvent||!Ns(this.httpEvent.url))return;ia.getInstance().addHttpEvent();const e=this.httpEvent.code,t=!!this.gqlError;if(this.httpData){const n=ia.getInstance().httpSequenceNumber;if(Yc.isSendAllowed(e,n,t)){this.httpData.seq=n,this.httpEvent.seq=n,ia.getInstance().addHttpData();const e={};e[Ce]=this.httpData,ha.getInstance().sendMessage(G,e)}else ia.getInstance().addHttpDataOverLimit()}Kc(e)?pa.getInstance().addPageVisitEvent({event:this.httpEvent,occurredAt:new Date(js(Date.now())).toISOString()},te):Na.getInstance().addEvent(this.httpEvent,te)}static isSendAllowed(e,t,n=!1){const r=Kc(e)||n;if(!r){if(t<100)return!0;0}return r&&t<120}}var Jc=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 Xc(e){try{const{origin:t}=e,n=new CustomEvent("noibuFrameAttach",{detail:e});window.dispatchEvent(n)}catch(e){}}function Qc(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&&Xc(n)}})})}function el(){return Jc(this,void 0,void 0,(function*(){yield Yo(),function(){try{const e={childList:!0,subtree:!0};new MutationObserver(Qc).observe(document.body,e)}catch(e){}}();try{for(let e=0;e<window.frames.length;e++){Xc(window.frames[e])}}catch(e){}}))}const tl=["Click","Change","Input","Submit"];function nl(e){return tl.includes(e)}class rl{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 il 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 ol,sl=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"}(ol||(ol={}));class al{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 sl(this,void 0,void 0,(function*(){const e=this.logger.tag(this.tag,this.logger.log);try{this.submitStatus(ol.Started),yield this.waitTriggers(e),this.submitStatus(ol.TriggerCompleted),yield this.waitAssertions(e),this.submitStatus(ol.AssertionCompleted)}catch(t){throw e(`Check failed. ${t} Stack: ${t.stack}`),t}}))}cancel(){return sl(this,void 0,void 0,(function*(){this.logger.tag(this.tag,this.logger.log)("Cancel."),this.cancellation.cancel()}))}waitTriggers(e){return sl(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 sl(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 sl(this,void 0,void 0,(function*(){try{yield this.waitTrigger(e,t)}catch(t){throw new il(t,this.check.id,this.check.version,e.id,null)}}))}waitAssertionSafely(e,t){return sl(this,void 0,void 0,(function*(){try{yield this.waitAssertion(e,window.document.body,t)}catch(t){throw new il(t,this.check.id,this.check.version,null,e.id)}}))}waitTrigger(e,t){return sl(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 sl(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 sl(this,void 0,void 0,(function*(){const o=Xs(t);return this.waitElementBySelector(e,o,n,r,i)}))}waitText(e,t,n,r){return sl(this,void 0,void 0,(function*(){return this.waitElementBySelector(e,null,t,n,r)}))}waitElementBySelector(e,t,n,r,i){return sl(this,void 0,void 0,(function*(){return Ks(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 sl(this,void 0,void 0,(function*(){const r=Xs(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 sl(this,void 0,void 0,(function*(){return new Promise(n=>{Yo().then(()=>{(null==e?void 0:e.text)&&(e.text.content||e.text.regex)?Ks(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 sl(this,void 0,void 0,(function*(){const n=Xs(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 sl(this,void 0,void 0,(function*(){const n=Xs(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 cl{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+=` ${Cs(t)}.`),this.entries.push(n)}}var ll=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 ul{static create(e,t,n,r,i=null,o=null){const s=ul.fetchTest(),a=Qs();return ul.isConfigValid(s,a)?new ul(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(()=>{ul.normalizeTest(this.test);const e=this.handleNavigationChange.bind(this);window.addEventListener("noibuNavigation",e),this.startChecks()})}startChecks(){for(const e of this.test.checks)this.startCheckIfApplicable(e)}startCheckIfApplicable(e){const t=new cl;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(!na(i.url_regex))return n("Page group not found (no matching url regexp)."),!1}else if(i.urls){const e=ea();if(!i.urls.some(t=>e.includes(t)))return n("Page group not found (no matching urls)."),!1}if(i.element_selector){const e=Xs(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 ll(this,void 0,void 0,(function*(){let n=null;const r=new rl,i=new al(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)}if(ul.isCheckRestartRequired(e)){if(n)return void t.log("Error: "+n);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;Ga(Ue,{checkId:r,version:i,triggerId:o,assertionId:s,log:n})}static fetchTest(){return ke().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})=>nl(e))}static normalizeTest(e){const t=e=>null!==e&&"object"==typeof e&&0===Object.keys(e).length,n=new Set;for(const r of e.checks){for(const e of r.triggers)t(e.trigger_value)&&(e.trigger_value=null),t(e.element_selector)&&(e.element_selector=null,nl(e.trigger_type)&&n.add(r));for(const e of r.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)}n.size>0&&(e.checks=e.checks.filter(e=>!n.has(e)))}}var dl=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 hl{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=hl.getVisiblePageContent();e=hl.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(!hl.isWord(e.lower,i,i+r.value.length-1))continue;n=n||[];const o=hl.searchSnippet(e.original,i,r.value.length);if(hl.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=hl.searchSnippetIndex(e,t,-1),o=hl.searchSnippetIndex(e,r,1)+1;return e.slice(i,o).trim()}static searchSnippetIndex(e,t,n){let r=0,i=0;for(;i<120;){i+=1;const o=e[t+n];if(void 0===o||hl.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=hl.isWordRegExp.test(r)),n<e.length-1&&(r=e[n+1],o=hl.isWordRegExp.test(r)),!i&&!o}sendEvent(e){return dl(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(js(Date.now())).toISOString()};this.pageVisit.addPageVisitEvent(n,me),this.resultCallback&&this.resultCallback(t)}))}collectError(e){const t=""+e;this.reportedErrors.has(t)||(this.reportedErrors.add(t),this.clientConfig.postNoibuErrorAndOptionallyDisableClient(t,!1,U))}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=hl.removeFragmentsToIgnore(n);const r=n.toLowerCase();return{original:n,lower:r}}static removeFragmentsToIgnore(e){const t=hl.getFragmentsToIgnore();if(null===t)return e;for(const n of t)e=e.replace(n,"");return e}static getFragmentsToIgnore(){const e=document.querySelectorAll(hl.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}}hl.snippetSeparators=new Set([".","!","?","\n"]),hl.isWordRegExp=/\w/,hl.fragmentToIgnoreSelector='[class*="review"], [id*="review"], [class*="footer"], [id*="footer"], nav ';class pl{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 fl{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()},fl.notificationTimeThreshold))}nofity(){for(const e of this.subscribers)try{e()}catch(e){}}}function gl(){const e=new fl(window),t=new pl(window),n=zs.getInstance(),r=za.getInstance(),i=pa.getInstance(),o=ul.create(e,t,n,r);o&&o.start();const s=ml();new hl(e,n,i,s).start(),function(e,t,n,r){window.addEventListener("noibuPageCheckValidationRequest",i=>{const{pageGroups:o,test:s}=i.detail;new ul(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 ml(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 vl.values?i:"en",s=vl.values[o];return{version:vl.version,lang:o,values:s}}fl.notificationTimeThreshold=1e3;const vl={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 yl=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 bl{static getInstance(){return bl.instance||(bl.instance=new bl),bl.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;Zs(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(),bl.incomingErrorBufferTimeout)}processErrors(){return yl(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>=bl.incomingErrorBufferOverflowLimit;return e&&this.terminate(),e}executeConfirmation(e){return yl(this,void 0,void 0,(function*(){const{url:t}=e.request,n=bl.confirmationRequestTimeout;if(e.originalResponse=yield this.executeRequest(t,null,n),bl.isErrorConfirmed(e.originalResponse))return!0;if(e.originalResponse.cors){const r=encodeURIComponent(t),i=bl.proxyUrl+"/?"+r,o=new Headers({"X-Upstream-URL":t});if(e.proxyResponse=yield this.executeRequest(i,o,n),bl.isErrorConfirmed(e.proxyResponse))return!0}return!1}))}executeRequest(e,t,n){return yl(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;Ga("ImageError",{tag_name:t,id:n||null,src:a,detail:Cs({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(bl.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}}}bl.proxyUrl="https://resource-proxy.noibu.com",bl.confirmationRequestTimeout=5e3,bl.incomingErrorBufferTimeout=3e3,bl.incomingErrorBufferOverflowLimit=5;class Il{static getInstance(){return Il.instance||(Il.instance=new Il),Il.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=ua.getInstance(),n={url:vs(),page_title:e,page_groups:ra(),ref_url:hs(t.referrerUrl)};Na.getInstance().addEvent(n,ve)}}class wl{static getInstance(...e){return wl.instances.has(this)||wl.instances.set(this,new this(...null!=e?e:[])),wl.instances.get(this)}destroy(){}static resetInstances(){wl.instances.forEach(e=>{e.destroy()}),wl.instances.clear()}}wl.instances=new Map;class Cl extends wl{monitor(){this._monitor(window),Zs(window,"noibuFrameAttach",e=>{const t=e.detail;this._monitor(t)})}_monitor(e){Zs(e,"input",this._handle.bind(this))}getPayload(e){const{target:t}=e,n=t,r=n.placeholder||n.name||n.id,i=Ss(n),o=ks(n);return{[Z]:"",[K]:r,[z]:n.tagName?n.tagName.toLowerCase():"",[Y]:o,[$]:le,[J]:Es(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)&&Na.getInstance().addEvent(this.getPayload(e),le)}}const Sl=["\\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)","(カートに追加)","^添加至购物袋$","^购买$","^購入する$","(أضف الى السلة)"],kl=["(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$","(チェックアウトに進む)","^去结算$","^付款。$","^お支払い$","(تاكيد الطلب)"],El=["(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 _l(e){if(!(e instanceof Element))return{target:null,selector:null};let t=e,n=[],r=!1,i=0;for(;e&&e.nodeType===Node.ELEMENT_NODE&&!(i++>50);){const{id:i,tagName:o,classList:s,parentNode:a}=e;if(!r&&Rl(e)&&(r=!0),!r&&Ml(e)&&(t=e,n.splice(0,n.length),r=!0),xl(i)){const t="#"+i;if(Nl(t,e)){n.push(t);break}}let c=o.toLowerCase();if("html"!==c&&"body"!==c){const t=Array.from(s).filter(xl);t.length>0&&(c+="."+t.join("."));c+=`:nth-of-type(${Tl(e)+1})`}n.push(c),e=a}n=function(e,t){const n=[];for(const r of t){n.push(r);const t=Al(n);if(Nl(t,e))break}return n}(t,n);return{target:t,selector:Al(n)}}function Al(e){return(e=[...e]).length?e.reverse().join(" > "):null}function Tl(e){let t=0;for(let n=e.previousElementSibling;null!==n;n=n.previousElementSibling)n.tagName===e.tagName&&(t+=1);return t}function Rl(e){return e instanceof HTMLHeadingElement||e.querySelector("h1, h2, h3, h4, h5, h6")}function Ml(e){const t=e.tagName.toLowerCase();if(Ol.includes(t))return!0;const n=e.getAttribute("role");if(Dl.includes(n))return!0;for(const t of Pl)if(e.classList.contains(t))return!0;return!1}function xl(e){if(!e)return!1;if(!Ll.test(e))return!1;const t=e.toLowerCase();if(Fl.some(e=>t.indexOf(e)>=0))return!1;if(Vl.some(e=>t.startsWith(e)))return!1;return!/\d/.test(e)}function Nl(e,t){const n=document.querySelectorAll(e);return 1===n.length&&n[0]===t}const Ll=/^[a-zA-Z_-][a-zA-Z0-9_-]*$/,Ol=["svg","label","product-item"],Dl=["button","menuitem"],Pl=["builder-image","nav-item","list-group","l2-title","l3-title","fic-img-wrapper","fic-caption"],Vl=["text-"],Fl=["load","active","fixed","visible","draggable","focus","show","collaps","animat","hover","swiped","highlight","shift","initializ","is-in-view","site-menu-item-open"];class Ul extends wl{constructor(){super(),this.textCapturedWhiteListRegex=new RegExp(Sl.concat(kl).concat(El).join("|"),"i"),this.htmlIDWhiteListRegex=new RegExp("method|finance|sagepay|cart|bag|coupon|affirm|karna|sezzle|button","i"),this.collectTrustedEventsOnly=!0,this.blockedSelector=null,this.blockedSelector=Ul.createBlockedSelector()}static createBlockedSelector(){let e;try{e=Ts(),window.document.querySelector(e)}catch(t){e=null;zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Failed to parse selector: "+t,!1,U)}return e}monitorClicks(){this._monitor(window),Zs(window,"noibuFrameAttach",e=>{const t=e.detail;this._monitor(t)})}_monitor(e){Zs(e,"click",this._onClickHandle.bind(this),!0)}_onClickHandle(e){if(!this.isValid(e))return;const t=this.getPayload(e);ia.getInstance().addPvClick(),pa.getInstance().addPageVisitEvents([{event:t,occurredAt:new Date(js(Date.now())).toISOString()}],se);const n=t.hid,r=t.class,i=t.tag,o=t.txt,s=new CustomEvent("noibuClick",{detail:{id:n,className:r,tagName:i,text:o}});window.dispatchEvent(s)}isValid(e){return!(this.collectTrustedEventsOnly&&!e.isTrusted)}getPayload(e){const t=e.target,n=t,r=t.src||"",i=n.tagName?n.tagName.toLowerCase():"",o=Ss(n),s=ks(n),a=this.getElementText(i,t,s),c=function(e){try{const{selector:t}=_l(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{[Z]:r,[K]:a,[z]:i,[Y]:s,[$]:ce,[J]:Es(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){const e=t;e.alt&&(r=e.alt)}else{const e=t;if(this.isEnclosedByBlockedElement(e))return"*";r=this._getContainedText(e,!0)}if(!this.textCapturedWhiteListRegex.test(r)&&!this.htmlIDWhiteListRegex.test(n))if("input"===e){if(!it.some(n=>n(e,t)))return"*"}else if("textarea"===e)return"*";return function(e){return e.replace(D,"******").replace(O,"*")}(Ul.cutoffText(Ul.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(vs().includes("hannaandersson")){const t=t=>t(i.tagName.toLowerCase(),e);if(!it.some(t))return"*"}const n=Bl(r.type),s=Bl(r.title),a=Bl(r.name),c=Bl(r.id);if(rs(n)||rs(s)||rs(a)||rs(c))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=>Ul.trimSpaces(e)).filter(e=>e.length>0).slice(0,1).join("");return e?`${e} ${n}`:n}static trimSpaces(e){return Ns(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||"A"===t.tagName&&"button"===t.type))return this._getContainedText(t,!1)}return""}isEnclosedByBlockedElement(e){const t=document.querySelectorAll(this.blockedSelector);for(const n of t)if(n.contains(e))return!0;return!1}}function Bl(e){return"string"==typeof e?e.toLowerCase():""}class Hl{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 Hl),this.instance}monitor(){const e=this.handle.bind(this);Zs(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;Ga("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 ql{constructor(){this.debouncedCalls=0}static getInstance(){return this.instance||(this.instance=new ql),this.instance}monitor(){const e=this._onPageEventHandle.bind(this),t=()=>{const t=Ro()(e,1e3,{leading:!0,trailing:!0});return(...e)=>(this.debouncedCalls+=1,t(...e))};ze.forEach(t=>Zs(window,t,e,!0)),Ze.forEach(e=>Zs(window,e,t(),!0)),Ke.forEach(t=>Zs(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),Na.getInstance().addEvent(t,he)}getDocumentState(){return"hidden"===document.visibilityState?"hidden":document.hasFocus()?"active":"passive"}getSizeInBytes(e){let t=e;return"string"!=typeof e&&(t=Cs(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 Wl{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 Wl),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=Ws.scriptInitializeTime,i){case d.CumulativeLayoutShift:{const e=a;Wl.setEventRecorded(e.largestShiftTime,a);break}case d.FirstContentfulPaint:{const e=a;Wl.setEventRecorded(null===(t=e.fcpEntry)||void 0===t?void 0:t.startTime,a);break}case d.FirstInputDelay:{const e=a;Wl.setEventRecorded(e.eventTime,a);break}case d.InteractionToNextPaint:{a.interactionTargetElement=void 0;const e=a;Wl.setEventRecorded(e.interactionTime,a);break}case d.LargestContentfulPaint:{const e=a;Wl.setEventRecorded(null===(n=e.lcpEntry)||void 0===n?void 0:n.startTime,a);break}case d.TimeToFirstByte:{const e=a;Wl.setEventRecorded(null===(r=e.navigationEntry)||void 0===r?void 0:r.startTime,a);break}}const c={name:i,value:o.toString(),rating:s,attribution:Cs(a)};pa.getInstance().addPageVisitEvent({event:c,occurredAt:new Date(js(Date.now())).toISOString()},ae)}static setEventRecorded(e,t){let n=!1;e&&Ws.recordingStartTime&&(n=e>Ws.recordingStartTime,n&&Ws.recordingStopTime&&(n=e<Ws.recordingStopTime)),t.rrwebRecorder=n}monitor(){try{if(!Wl.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,zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in WebVitalMonitor: "+e,!1,U)}}download(){Wl.isAvailable()&&(Zs(window,"noibuWebVitalsLoaded",e=>{this.setWebVitals(e.detail),this.monitor()}),Ps("https://cdn.noibu.com/collect-webvitals.js",null,e=>{zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Error loading webvitals script. "+e,!1,U)}))}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 jl{static getInstance(){return this.instance||(this.instance=new jl),this.instance}_safeQueryAll(e,t){let n;try{n=e.querySelectorAll(t)}catch(e){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in ElementMonitor: "+e,!1,U)}return n?Array.from(n):[]}_processMatchingElements(e,t){e.forEach(e=>{if(!e)return;const n=e.textContent;n&&za.getInstance().addCustomAttribute(t,n)})}_findAndAddMatchingElementsInNodes(e){Object.keys(Qe()).forEach(t=>{const n=Qe()[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(Qe()).forEach(e=>{const t=Qe()[e];if(!t)return;const n=this._safeQueryAll(document,t);this._processMatchingElements(n,e)})}monitor(){var e;0!==Object.keys(Qe()).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 Gl{constructor(){this.enabled=!0,this.initialHeight=null,this.maxOffset=0}static getInstance(){return Gl.instance||(Gl.instance=new Gl),Gl.instance}monitor(){const e=this.handle.bind(this),t=Ro()(e,1e3,{leading:!0,trailing:!0});Zs(window,"scroll",t),Zs(window,"noibuNavigation",()=>{this.enabled=!1,setTimeout(()=>{this.reset(),this.report(!0)},1e3)}),Yo().then(()=>{null!==this.initialHeight||this.report(!0)})}reset(){this.enabled=!0,this.initialHeight=null,this.maxOffset=0}handle(e){e.target===document&&this.report(!1)}report(e){if(!this.enabled)return;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.innerWidth,i=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,o=i+n;let s=!1;null===this.initialHeight&&(this.initialHeight=t,s=!0),i>this.maxOffset&&(this.maxOffset=i,s=!0);const a={initialHeight:this.initialHeight,height:t,viewportHeight:n,viewportWidth:r,scrollTop:i,scrollBottom:o,isMax:e||s,isSynthetic:e},c={type:"scroll",data:JSON.stringify(a)};Na.getInstance().addEvent(c,he)}}const $l=(e,t)=>(t?e/t:0).toFixed(2);class zl{constructor(){this.reported=!1,this.clicks=0,this.untrusted=0,this.origin=0,this.moves=0,this.targets=new Set,this.firstTs=0,this.lastTs=0,this.cellCounts={},this.topCell=0,this.gaps=0,this.fastGaps=0,this.firstMoveSeen=!1,this.firstMoveX=0,this.firstMoveY=0}static getInstance(){return zl.instance||(zl.instance=new zl),zl.instance}monitor(){Zs(window,"click",e=>this.onClick(e),!0),Zs(window,"pointermove",e=>{if(this.moves+=1,!this.firstMoveSeen){this.firstMoveSeen=!0;const t=e;this.firstMoveX=t.clientX||0,this.firstMoveY=t.clientY||0}}),Zs(window,"noibuNavigation",()=>{this.report(),this.reset()}),Zs(window,"pagehide",()=>this.report())}onClick(e){const t=Date.now();this.clicks?t-this.lastTs>=30&&(this.gaps+=1,t-this.lastTs<500&&(this.fastGaps+=1),this.lastTs=t):(this.firstTs=t,this.lastTs=t),this.clicks+=1,e.isTrusted||(this.untrusted+=1),this.targets.add(function(e){const t=e;if(!t||!t.tagName)return"";const n=t.id?"#"+t.id:"",r="string"==typeof t.className&&t.className?"."+t.className.trim().replace(/\s+/g,"."):"";return`${t.tagName}${n}${r}`}(e.target));const n=e.clientX||0,r=e.clientY||0;0===n&&0===r&&(this.origin+=1);const i=`${Math.floor(n/16)},${Math.floor(r/16)}`;this.cellCounts[i]=(this.cellCounts[i]||0)+1,this.cellCounts[i]>this.topCell&&(this.topCell=this.cellCounts[i])}hasUntrustedClicks(){return this.untrusted/this.clicks>=.8}hasOriginClicks(){return this.origin/this.clicks>=.9}isHammering(){const e=(this.lastTs-this.firstTs)/1e3,t=this.topCell/this.clicks,n=this.gaps?this.fastGaps/this.gaps:0;return this.clicks>=50&&e>=60&&t>=.2&&n>=.4}startsAtOrigin(){return this.firstMoveSeen&&0===this.firstMoveX&&0===this.firstMoveY}detect(){if(this.clicks>=5){if(this.hasUntrustedClicks()||this.hasOriginClicks())return"synthetic";if(this.isHammering())return"hammer"}return this.startsAtOrigin()?"origin-start":null}report(){if(this.reported)return;const e=this.detect();if(!e)return;this.reported=!0;const t=`bot-suspect session=${zs.getInstance().sessionId} clicks=${this.clicks}`;let n;if("synthetic"===e)n=t+" case=1 type=synthetic untrustedRatio="+$l(this.untrusted,this.clicks)+" originRatio="+$l(this.origin,this.clicks)+" distinctTargets="+this.targets.size;else if("origin-start"===e)n=`${t} case=3 type=origin-start moves=${this.moves}`;else{const e=Math.round((this.lastTs-this.firstTs)/1e3);n=t+" case=2 type=hammer durationSec="+e+" topShare="+$l(this.topCell,this.clicks)+" fastRatio="+$l(this.fastGaps,this.gaps)+" clicksPerSec="+$l(this.clicks,e)}zs.getInstance().postNoibuErrorAndOptionallyDisableClient(n,!1,U,!0)}reset(){this.clicks=0,this.untrusted=0,this.origin=0,this.moves=0,this.targets=new Set,this.firstTs=0,this.lastTs=0,this.cellCounts={},this.topCell=0,this.gaps=0,this.fastGaps=0,this.firstMoveSeen=!1,this.firstMoveX=0,this.firstMoveY=0,this.reported=!1}}class Zl{constructor(){this.pageVisit=pa.getInstance(),this.eventTimestamps=new Map}static getInstance(){return this.instance||(this.instance=new Zl)}monitor(){try{this.monitorDataLayer()}catch(e){}}monitorDataLayer(){window.dataLayer=window.dataLayer||[];const e=this.handleDataLayerItems.bind(this);Jo(window.dataLayer,"push",(function(t){return function nbuWrapper(...n){return e(n),t.apply(window.dataLayer,n)}})),e(window.dataLayer)}handleDataLayerItems(e){const t=[];try{e.forEach(e=>this.extractFromDataLayer(e,t)),t.filter(Kl).filter(e=>this.debounce(e.name)).forEach(e=>{this.toStandardName(e),this.sendEvent(e)})}catch(e){}}extractFromDataLayer(e,t){const n=Object.prototype.toString.call(e);if("[object Arguments]"===n){for(const n of e)if(Yl.has(n)){const r=e[2];return void t.push({name:n,data:"object"==typeof r?r:null})}return}if("[object Object]"===n)for(const[n,r]of Object.entries(e)){if(("event"===n||"event_name"===n)&&Yl.has(r)){const n=e.ecommerce;return void t.push({name:r,data:"object"==typeof n?n:null})}}else;}debounce(e){const t=this.eventTimestamps.get(e)||0,n=Date.now();return!(n-t<1e3)&&(this.eventTimestamps.set(e,n),!0)}toStandardName(e){const{name:t}=e;e.name=Jl.get(t)||t}sendEvent(e){const t={event:{platform:"ga4",name:e.name,data:Cs(e.data)},occurredAt:new Date(js(Date.now())).toISOString()};this.pageVisit.addPageVisitEvent(t,fe)}}function Kl(e,t,n){return n.findIndex(t=>t.name===e.name)===t}Zl.instance=null;const Yl=new Set(["login","sign_up","share","search","add_to_cart","remove_from_cart","view_cart","begin_checkout","purchase","refund"]),Jl=new Map([["add_to_cart","product_added_to_cart"],["remove_from_cart","product_removed_from_cart"],["view_cart","cart_viewed"],["begin_checkout","checkout_started"],["purchase","checkout_completed"]]);let Xl=0;function Ql(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=>Ql(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)),Ga(Be,{error:e}),Xl+=1,setTimeout(()=>{Xl-=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 eu(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 ps(t[0]):return[{stack:t[0],message:t[1]}];case ps(t[1]):return[{stack:t[1],message:t[0]}];default:return[]}const n=[],r=[];return t.forEach(e=>{if(ps(e)){n.push(e);const t=e.split("\n");ps(t[0],0)?r.push("_"):r.push(t[0])}}),n.map((e,t)=>({stack:e,message:r[t]}))}(r)).forEach(e=>{try{Ga(qe,e)}catch(e){}})}function tu(e){e&&$e.forEach(t=>{e[t]&&Jo(e,t,(function(t){return function nbuWrapper(){t.call(e,...arguments),eu(Array.from(arguments))}}))})}function nu(e){e&&e.constructor&&e.constructor.name&&"undefined"!==e.constructor.name&&!(Xl>0)&&Ga(e.constructor.name,e)}function ru(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;Ga(Pe,{error:t})}function iu(e){!function(e){Zs(e,"error",nu,!0),Zs(e,"unhandledrejection",ru,!0),H.forEach(t=>{var n;if("XMLHttpRequest"===t&&M().excludeXhrMonitoring)return;const r=e[t],i=r&&r.prototype;if(!i||!i.hasOwnProperty||!i.hasOwnProperty("addEventListener"))return;const o=(null===(n=i.removeEventListener)||void 0===n?void 0:n.__noibu_original__)||i.removeEventListener;Jo(i,"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=Ql(n.handleEvent.bind(n));i=n,i.handleEvent=e}else i=Ql(n);try{o.call(this,t,n,r)}catch(e){}return e.call(this,t,i,r)}})),Jo(i,"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),tu(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 zs.getInstance().postNoibuErrorAndOptionallyDisableClient({msg:"Can't get cause for an onclick error in wrapHtmlElementEvents: "+e,args:t},!1,U),[]}};try{const r=null===(t=null==e?void 0:e.HTMLElement)||void 0===t?void 0:t.prototype;if(!r)return;Qo(r,"onclick",e=>Ql(e,{getCause:n(Ul.getInstance())})),Qo(r,"oninput",e=>Ql(e,{getCause:n(Cl.getInstance())})),Qo(r,"onchange",e=>Ql(e,{getCause:n(Cl.getInstance())}))}catch(e){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in wrapHtmlElementEvents: "+e,!1,U)}}(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,Ga("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.`)}))})}),tu(e.console)}n<3&&setTimeout(i,500)};setTimeout(i,500)}(e)}function ou(){iu(window),Zs(window,"noibuFrameAttach",e=>{iu(e.detail)})}class su{static async fromFetch(e,t,n,r){try{if(!(Os(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(!(Os(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;Os(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 Os(t,Request)?t.signal&&t.signal.aborted:!(!e||!Os(e.signal,AbortSignal))&&e.signal.aborted}static _shouldHandleRequest(e,t){Ds(t)&&(t=t.toLowerCase());let n=!1;return e&&(Os(e,URL)&&(e=e.toString()),Ds(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=hs(e.message,1e3)}static _validateExtensions(e){const t=as(Cs(e.extensions));e.extensions=hs(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){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("GQL parse error: "+e,!1,U)}static _postValidationIssues(e){const t=e.join(",");zs.getInstance().postNoibuErrorAndOptionallyDisableClient("GQL error validation warning: "+t,!1,U)}}var au=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())}))};ml("en");function cu(e,t,n,r,i){const o={mtd:n,code:e,url:cs(r),r_time:i},s=Zc.getInstance(),a=s.contentLength(t);return a>0&&s.shouldContinueForURL(r)&&(o.resp_len=a),o}function lu(e){return au(this,void 0,void 0,(function*(){return e instanceof Response?e.bodyUsed?N:es(e.text).call(e):""}))}function uu(e,t,n,r,i,o,s,a){return au(this,void 0,void 0,(function*(){return Zc.getInstance().shouldContinueForURL(r)?Zc.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))),Zc.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)?Zc.headersMapFromIterable(e.headers.entries()):new Map}(t),a,n,o):null}))}function du(e,t,n,r,i){return au(this,void 0,void 0,(function*(){var o;const s=Date.now()-t,a=yield su.fromXhr(n,e),c=Kc(e.status);let l=[];const u=yield Zc.getResponseStringFromXHR(e);const d=cu(e.status,Zc.headersMapFromString(e.getAllResponseHeaders()),r,n,s),h=yield function(e,t,n,r){return au(this,arguments,void 0,(function*(e,t,n,r,i=null,o){if(!Zc.getInstance().shouldContinueForURL(n))return null;const s=Zc.headersMapFromString(e.getAllResponseHeaders());return Zc.getInstance().bundleHTTPData(n,e.noibuRequestHeaders,i,s,o,t,r)}))}(e,r,n,c||!!a||!!l.length,i,u),p=new Yc(d,h,a);p.saveHTTPEvent();const f=null===(o=p.httpData)||void 0===o?void 0:o.seq;c&&Ga(Oe,e,f),a&&a.forEach(e=>Ga("GQLError",e,f))}))}function hu(e){return e.bodyUsed?e:e.clone()}function pu(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),Jo(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){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in fetch() wrapper: "+e,!1,U)}return n}(t,n);fu(i,o,null==n?void 0:n.body),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=>au(this,void 0,void 0,(function*(){var s,a,c;try{if(!o)return zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in custom fetch() callback: no response received",!1,U);const l=hu(o),u=hu(l),d=hu(l),h=Date.now()-e;let p=[];const f=l.status,g=l.headers,m=yield su.fromFetch(t,r,i,u),v=Kc(f),[y,b]=yield ba([Promise.resolve(null===(a=null===(s=es(null==i?void 0:i.text))||void 0===s?void 0:s.call)||void 0===a?void 0:a.call(s,i)),lu(d)]);0;const I=cu(f,g,n,t,h),w=yield uu(i,d,n,t,r,v||!!m||!!p.length,y,b),C=new Yc(I,w,m);C.saveHTTPEvent();const S=null===(c=C.httpData)||void 0===c?void 0:c.seq;v&&Ga(Fe,{status:l.status,url:l.url||I.url},S),p.length,m&&m.forEach(e=>Ga("GQLError",e,S))}catch(e){if("AbortError"===e.name)return;const t=Is(e);zs.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in custom fetch() callback: ${e}${t}`,!1,U)}}))}(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=Ns(t),o=i?" on url "+i:"";r.message=`${n.message}${o}`,Ga(He,{error:r})}(e,i)}),a}})))}function fu(e,t,n){try{const r=new CustomEvent("noibuRequest",{detail:{url:e,method:t,body:n}});dispatchEvent(r)}catch(e){}}function gu(e){const t=e.XMLHttpRequest,n=t&&t.prototype;!function(e,t){Jo(e,"open",(function(e){return function nbuWrapper(n,r,i=!0,o=null,s=null){try{fu(r,n,null);try{this.noibuHttpMethod=n,this.noibuHttpUrl=r}catch(e){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to set custom properties on XHR object: "+e,!1,B)}if(t){const e=Date.now();Zs(this,"loadend",()=>du(this,e,r,n,null))}}catch(e){const t=Is(e);zs.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in XHR.open() wrapper: ${e}${t}`,!1,U)}return e.call(this,n,r,i,o,s)}}))}(n,!function(e){return Jo(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();Zs(this,"loadend",()=>du(this,n,this.noibuHttpUrl||this.responseURL,e,t))}catch(e){const t=Is(e);zs.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in XHR.send() wrapper: ${e}${t}`,!1,U)}return e.call(this,t)}}))}(n)),function(e){Jo(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){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in XHR.setRequestHeader() wrapper: "+e,!1,U)}return e.call(this,t,n)}}))}(n)}function mu(e){gu(e),pu(e)}var vu=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 yu(){return vu(this,arguments,void 0,(function*(e=null){const t=ua.getInstance(),n=ra(e);t.storePageGroups(n),yield Yo();const r=ra(e);if(n.length===r.length&&n.every((e,t)=>e===r[t]))return;t.storePageGroups(r);const i={page_groups:r};Na.getInstance().addEvent(i,ye)}))}function bu(){const e={event:{type:"page_visit_start"},occurredAt:(new Date).toISOString()};pa.getInstance().addPageVisitEvent(e,he)}const Iu=["carrot-top.com"];function wu(){let e=vs(),t=null;e&&Zs(window,"noibuNavigation",()=>{const n=vs();if(!n||e===n)return;const r=e;if(e=n,i=n,o=r,Fs(()=>{const e=new URL(i),t=new URL(o);return e.host===t.host&&e.pathname.replace(/\/+$/,"")===t.pathname.replace(/\/+$/,"")},!1)&&!Iu.some(e=>n.includes(e)))return void function(e,t){const n={url:e,page_title:window.document.title,page_groups:ra(),ref_url:t};Na.getInstance().addEvent(n,ue)}(n,r);var i,o;const s=ua.getInstance().storedPageGroups,a=ha.getInstance().getPageInformation();a.page_groups=s;const c=Ea.getInstance().isLiveView();t&&(t(),t=null),Ea.getInstance().stopRecording(),Na.getInstance().flushAll(),ha.getInstance().handleUnload(a);const l=window.document.title,u={url:e,pageTitle:l,referrerUrl:r,referrerPageGroups:s};Fs(()=>{zs.reinitializeInstance(),ua.reinitializeInstance(u),ia.reinitializeInstance(),ja=0;const e=ha.reinitializeInstance(at()(),u,!0);t=function(e,t){const n=Date.now()+250;let r;const i=()=>{const o=window.document.title;o!==e||Date.now()>=n?t(o):r=window.setTimeout(i,10)};return r=window.setTimeout(i,10),()=>window.clearTimeout(r)}(l,n=>{t=null,Fs(()=>{e.updatePageTitle(n),e.start()})}),Ea.reinitializeInstance(!0,c),bu(),yu(),Bc.reinitializeInstance()})})}let Cu=!1;let Su=!1;function ku(){za.getInstance().addNoibuInternalCustomAttribute("qualtrics_survey_completed","true")}function Eu(){Zs(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];ku(),za.getInstance().addNoibuInternalCustomAttribute("qualtrics_survey_id",n),za.getInstance().addNoibuInternalCustomAttribute("qualtrics_session_id",r)}catch(e){}if("endOfSurvey"===e.data)try{ku()}catch(e){}}})}function _u(){window.QSI&&window.QSI.API&&(Eu(),Au())}function Au(){Zs(document,"mousedown",e=>{var t;const n=null===(t=(r=e.target)instanceof Element?r:r instanceof Node?r.parentElement:null)||void 0===t?void 0:t.closest("a");var r;if(!(null==n?void 0:n.href))return;const i=function(e){let t;try{t=new URL(e)}catch(e){return null}return t.hostname.toLowerCase().endsWith(".qualtrics.com")&&t.pathname.startsWith("/jfe/form")?t:null}(n.href);if(!i)return;const o=zs.getInstance().sessionId;if(o)try{i.searchParams.set("NOIBU_SESSION_ID",o),n.href=i.toString()}catch(e){}},!1)}let Tu=!1;function Ru(){Tu||(Tu=!0,Zs(window,"MDigital_Submit_Feedback",e=>{const t=e.detail.Form_ID,n=e.detail.Feedback_UUID;za.getInstance().addNoibuInternalCustomAttribute("medallia_form_id",t),za.getInstance().addNoibuInternalCustomAttribute("medallia_feedback_uuid",n)}))}let Mu=!1;const xu=new Set;function Nu(e){if(e)try{const{id:t,response_id:n}=e;if(!t&&!n)return;const r=`${t}:${n}`;if(xu.has(r))return;xu.add(r),t&&za.getInstance().addNoibuInternalCustomAttribute("hotjar_feedback_id",""+t),n&&za.getInstance().addNoibuInternalCustomAttribute("hotjar_feedback_response_id",""+n)}catch(e){}}function Lu(){Mu||(Mu=!0,Zs(window,"hotjar-survey-event",e=>{const t=e&&e.detail;t&&"surveySubmitted"===t.event&&Nu({id:t.surveyId,response_id:t.responseId})}),function e(t=0){window.hj&&"function"==typeof window.hj&&window.hj.event?window.hj.event.listen("poll.send",e=>{Nu(e)}):t<60&&window.setTimeout(()=>e(t+1),1e3)}())}let Ou=!1;let Du=!1;function Pu(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)&&za.getInstance().addNoibuInternalCustomAttribute("abtasty-campaign-"+e.detail.campaignId,"variation-"+e.detail.variationId)}let Vu=!1;const Fu=new Set(["VISUAL_AB","VISUAL","SPLIT_URL"]);function Uu(e,t,n){e&&t&&n&&Fu.has(n)&&za.getInstance().addNoibuInternalCustomAttribute("vwo-campaign-"+e,"variation-"+t)}function Bu(e){var t,n;try{if(!e)return;if(Array.isArray(e)){const r=e[1],i=e[2],o=null===(t=window._vwo_exp)||void 0===t?void 0:t[r];return void Uu(r&&(null==o?void 0:o.name)||r,i&&(null===(n=null==o?void 0:o.comb_n)||void 0===n?void 0:n[i])||i,null==o?void 0:o.type)}if("object"==typeof e){const{campId:t,varId:n,campType:r,campName:i,varName:o}=e;Uu(t&&i||t,n&&o||n,r)}}catch(e){}}function Hu(e){try{window[e]=window[e]||[],"function"==typeof window[e].push&&window[e].push(["onVariationApplied",Bu])}catch(e){}}let qu=!1;function Wu(e,t){e&&t&&za.getInstance().addNoibuInternalCustomAttribute("optimizely-campaign-"+e,"variation-"+t)}function ju(e){var t;if("function"!=typeof(null===(t=window.optimizely)||void 0===t?void 0:t.get))return;const n=window.optimizely.get("state");return"function"==typeof(null==n?void 0:n.getCampaignStates)?n.getCampaignStates(e):void 0}function Gu(e,t){var n,r,i,o,s;Wu((null===(n=e.experiment)||void 0===n?void 0:n.name)||e.campaignName||(null===(r=e.campaign)||void 0===r?void 0:r.name)||(null===(i=e.experiment)||void 0===i?void 0:i.id)||t,(null===(o=e.variation)||void 0===o?void 0:o.name)||(null===(s=e.variation)||void 0===s?void 0:s.id))}function $u(e){var t,n;try{const r=null==e?void 0:e.data;if(!(null==r?void 0:r.decision))return;const i=function(e){var t;return null===(t=ju())||void 0===t?void 0:t[e]}(r.decision.campaignId);if(i)return void Gu(i,r.decision.campaignId);Wu((null===(t=r.experiment)||void 0===t?void 0:t.name)||(null===(n=r.campaign)||void 0===n?void 0:n.name)||r.decision.experimentId||r.decision.campaignId,r.decision.variationId)}catch(e){}}function zu(){if(!qu){qu=!0;try{window.optimizely=window.optimizely||[],"function"==typeof window.optimizely.push&&window.optimizely.push({type:"addListener",filter:{type:"lifecycle",name:"campaignDecided"},handler:$u})}catch(e){}!function(){try{const e=ju({isActive:!0})||{};Object.entries(e).forEach(([e,t])=>Gu(t,e))}catch(e){}}()}}let Zu=!1;const Ku=new Set;function Yu(e){return"string"==typeof e&&e?e:"number"==typeof e&&Number.isFinite(e)?""+e:void 0}let Ju,Xu=!1,Qu=0;function ed(){var e;try{if(!Xu){if(!window.monetate)return Qu+=1,void(Qu>=12&&void 0!==Ju&&clearInterval(Ju));Xu=!0}const t=null===(e=window.monetate)||void 0===e?void 0:e.campaigns;if(!Array.isArray(t))return;t.forEach(e=>{e&&"object"==typeof e&&function(e){var t,n;const r=null!==(t=Yu(e.key))&&void 0!==t?t:Yu(e.id),i=null!==(n=Yu(e.split))&&void 0!==n?n:Yu(e.variant_id);if(!r||!i)return;const o=JSON.stringify([r,i]);Ku.has(o)||Ku.size>=100||(Ku.add(o),za.getInstance().addNoibuInternalCustomAttribute("monetate-campaign-"+r,"variation-"+i))}(e)})}catch(e){}}const td={scriptUrl:"https://cdn.jsdelivr.net/npm/axe-core@4.13.0/axe.min.js",scriptIntegrity:"sha384-jzJDdyy7z7+/I7TeoAg0Gc8k9hD8b1xRN0W18hMptWJ0cdoiebywhPpCyP9eBOgn",version:"4.13.0",rules:["image-alt","input-image-alt","role-img-alt","svg-img-alt","object-alt","area-alt","link-name","button-name","select-name","label","input-button-name","form-field-multiple-labels","summary-name","html-has-lang","html-lang-valid","html-xml-lang-mismatch","valid-lang","document-title","meta-viewport","meta-refresh","autocomplete-valid","avoid-inline-spacing","frame-title","frame-title-unique","td-headers-attr","th-has-data-cells","aria-hidden-focus","aria-hidden-body","duplicate-id-aria","aria-allowed-attr","aria-conditional-attr","aria-deprecated-role","aria-prohibited-attr","aria-required-attr","aria-required-children","aria-required-parent","aria-roles","aria-valid-attr","aria-valid-attr-value","aria-command-name","aria-input-field-name","aria-meter-name","aria-progressbar-name","aria-tab-name","aria-toggle-field-name","aria-tooltip-name","aria-braille-equivalent","nested-interactive","scrollable-region-focusable","color-contrast"],scheduleDelay:100,loadDelay:1e3,maxDuration:3e3,backoffKey:"n_ada_backoff",backoffPeriod:864e5,sampleDomains:["console.noibu.com"],sampleRate:100,sampleKey:"n_ada_sampled"};let nd=!1,rd=!1,id=!1,od=!1,sd=0,ad=0;function cd(){if(!nd&&(nd=!0,function(){const e=window.location.hostname;return td.sampleDomains.some(t=>e===t)}()&&function(){try{const e=qs.getInstance();let t=parseInt(e.load(td.sampleKey),10);return(!isFinite(t)||t<0||t>99)&&(t=Math.floor(100*Math.random()),e.save(td.sampleKey,String(t))),t<td.sampleRate}catch(e){return!1}}()&&!gd()))try{!function(){const e=()=>setTimeout(yd,td.loadDelay);"complete"===document.readyState?e():Zs(window,"load",e)}(),Zs(document,"visibilitychange",ld),Zs(window,"pagehide",ud),Zs(window,"pageshow",dd),Zs(window,"noibuNavigation",hd)}catch(e){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("ADA audit setup failed: "+e,!1,U)}}function ld(){if("hidden"===document.visibilityState){if(id||rd||gd())return;const e=()=>{sd=0,function(){const e=vd();if(!e||e.version!==td.version||rd||od)return;rd=!0,od=!0;const t=ad,n={runOnly:{type:"rule",values:td.rules},resultTypes:["violations"],iframes:!1,preload:!1,elementRef:!1},r=performance.now(),i=()=>{const e=performance.now();return Math.round(e-r)},o=(e,n)=>{od=!1,t===ad&&fd(e,n,i())};try{e.run(document,n,o)}catch(e){od=!1,fd(e,null,i())}}()};sd=window.setTimeout(e,td.scheduleDelay)}else pd()}function ud(){id=!0,pd()}function dd(){id=!1}function hd(){rd=!1,ad+=1,pd()}function pd(){sd&&(window.clearTimeout(sd),sd=0)}function fd(e,t,n){try{!e&&t?function(e,t){md({v:1,status:"success",duration:t,findings:e.violations.map(Id)})}(t,n):function(e,t){md({v:1,status:"fail",duration:t,error:String(e).slice(0,200)})}(e||new Error("No results"),n)}catch(e){}}function gd(){try{return null!==qs.getInstance().loadWithExpiry(td.backoffKey)}catch(e){return!0}}function md(e){!function(e){if(e<=td.maxDuration)return;const{backoffKey:t,backoffPeriod:n}=td;try{qs.getInstance().saveWithExpiry(t,"1",n)}catch(e){}}(e.duration),Ya("ada_audit",e),Na.getInstance().flushAll(),ha.getInstance().handleUnload()}function vd(){return window.axe}function yd(){if(vd())return;const e=document.createElement("script");e.src=td.scriptUrl,e.integrity=td.scriptIntegrity,e.crossOrigin="anonymous",e.async=!0,e.onload=bd,document.head.appendChild(e)}function bd(){document.prerendering||"hidden"===document.visibilityState&&ld()}function Id(e){return{rule:e.id,impact:e.impact||"unknown",selectors:e.nodes.map(e=>e.target.join(" "))}}var wd=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 Cd(e){try{return!0===e()}catch(e){return!1}}function Sd(){return wd(this,void 0,void 0,(function*(){return yield new Promise(e=>{try{const t=window.Shopify;if(!t||t.customerPrivacy)return void e();if("function"!=typeof t.loadFeatures)return void e();t.loadFeatures([{name:"consent-tracking-api",version:"0.1"}],()=>{e()})}catch(t){e()}}),function(){try{const e="undefined"!=typeof window?window.Shopify:null;return!(!e||!e.customerPrivacy)&&e.customerPrivacy.analyticsProcessingAllowed()}catch(e){return!1}}()?"granted":"blocked"}))}function kd(e){try{const t=function(){const e={analyticsAllowed:!1,marketingAllowed:!1,preferencesAllowed:!1,saleOfDataAllowed:!1};try{const t="undefined"!=typeof window?window.Shopify:null,n=t&&t.customerPrivacy;return n?{analyticsAllowed:Cd(()=>{var e;return null===(e=n.analyticsProcessingAllowed)||void 0===e?void 0:e.call(n)}),marketingAllowed:Cd(()=>{var e;return null===(e=n.marketingAllowed)||void 0===e?void 0:e.call(n)}),preferencesAllowed:Cd(()=>{var e;return null===(e=n.preferencesProcessingAllowed)||void 0===e?void 0:e.call(n)}),saleOfDataAllowed:Cd(()=>{var e;return null===(e=n.saleOfDataAllowed)||void 0===e?void 0:e.call(n)})}:e}catch(t){return e}}(),n={platform:"shopify",name:"consent_state",data:Cs(Object.assign({reason:e},t))};pa.getInstance().addPageVisitEvent({event:n,occurredAt:(new Date).toISOString()},fe)}catch(e){}}function Ed(e){return wd(this,void 0,void 0,(function*(){try{if(!function(){try{return"undefined"!=typeof window&&!!window.Shopify}catch(e){return!1}}())return;const t=yield Sd();if(kd(t),"granted"===t)return;let n=!1;e.holdTraffic(),e.connectionPromise.then(()=>{n||(e.close(),e.clearPendingMessages())}),function(e){try{const t=n=>{const r=n.detail;r&&!0===r.analyticsAllowed&&(document.removeEventListener("visitorConsentCollected",t),e())};document.addEventListener("visitorConsentCollected",t)}catch(e){}}(()=>{try{n=!0,e.releaseTraffic(),e.clearPendingMessages(),e.handleShow(),kd("granted")}catch(e){zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Error resuming after consent: "+e,!0,U)}})}catch(t){e.releaseTraffic(),zs.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in applyShopifyConsentGate: "+t,!1,U)}}))}let _d=!1;function Ad(e){var t,n;(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.key)&&(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.variation)&&za.getInstance().addNoibuInternalCustomAttribute(e.detail.key,e.detail.variation)}async function Td(t){if(xs())return;if(function(e){for(let t=0;t<x.length;t+=1){if(!e[x[t]])return!0}return!1}(t))return;if(!vs().startsWith("http"))return;if(function(){const e=void 0!==self.noibuJSLoaded;return self.noibuJSLoaded=!0,e}())return;const n=`${t.metroplexHTTPBase}/${Ae}`;zs.configureInstance(n);try{const t=at()();if(zs.getInstance().isDisabled)return;await ua.getInstance().initialize(),Gc(),$a.configure(!1);const n=ha.getInstance(t);Ea.configureInstance(),pa.configureInstance(),sa.getInstance(),bu(),await Ed(n),Zs(document,"visibilitychange",()=>{("visible"===document.visibilityState?Wc:jc)()}),Zs(window,"noibuSnapshotComplete",jc);const r=ql.getInstance(),i=Hl.getInstance(),o=bl.getInstance(),s=Il.getInstance(),a=Cl.getInstance(),c=Ul.getInstance(),l=Wl.getInstance(),u=jl.getInstance(),d=Gl.getInstance(),h=Zl.getInstance(),p=ic.getInstance(),f=lc.getInstance(),m=mc.getInstance(),v=Bc.getInstance(),y=xa.getInstance();if(Zc.getInstance(),r.monitor(),i.monitor(),s.monitor(n.initialPageTitle),ou(),mu(window),Zs(window,"noibuFrameAttach",e=>{mu(e.detail)}),c.monitorClicks(),wu(),yu(),d.monitor(),a.monitor(),u.monitor(),p.monitor(),f.monitor(),m.monitor(),v&&v.monitor(),h.monitor(),function(t=!1){if(!Cu||t){if(Cu=!0,!window.navigator||!window.navigator.connection||!window.navigator.connection.downlink)return;const{connection:{downlink:t,rtt:n,effectiveType:r,saveData:i}}=window.navigator;Na.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},pe)}}(),M().logSuspectedBots){zl.getInstance().monitor()}Su||(Su=!0,window.QSI&&window.QSI.API?(Eu(),Au()):Zs(window,"qsi_js_loaded",_u,!1)),Ru(),Lu(),Du||(Du=!0,Zs(window,"abtasty_executedCampaign",Pu,!1)),Vu||(Vu=!0,Hu("VWO"),Hu("Wingify")),zu(),Zu||(Zu=!0,Ju=setInterval(ed,5e3),ed()),_d||(_d=!0,Zs(window,"noibu_feature_flag_evaluated",Ad,!1)),el(),gl(),o.monitor();const b=Ea.getInstance();n.connectionPromise.then(()=>{za.getInstance().exposeFunctions(),$a.getInstance().checkInitialRequest(),function(){if(!Ou){Ou=!0;try{const e=new URLSearchParams(window.location.search),t=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],n=za.getInstance();t.forEach(t=>{const r=e.get(t);r&&n.addNoibuInternalCustomAttribute(t,r)})}catch(e){}}}()}),ba([Yo(),n.connectionPromise]).then(()=>{b.setRRWeb({record:_r,addCustomEvent:Ar,pack:li}),b.recordUserSession(),l.setWebVitals(g),l.monitor(),y.monitor()}).catch(e=>{const t=Is(e);zs.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error during recordUserSession: ${e}${t}`,!1,U)}),ds()&&function(e){const t=new URL("https://cdn.noibu.com/collect-agent.js");t.searchParams.set("pv",e),Ps(t,null,null)}(zs.getInstance().pageVisitId),ls().has("ada-audit")&&Ps(new URL("https://cdn.noibu.com/collect-ada.js"),null,null),cd(),ke().feature_flag_key&&Ps(new URL("https://cdn.noibu.com/collect-ff.js"),null,null)}catch(e){const t=Is(e);zs.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error during globalInit: ${e}${t}`,!0,U)}}const Rd={metroplexSocketBase:M().metroplexSocketBase,metroplexHTTPBase:M().metroplexHTTPBase};(async()=>{await Td(Rd)})()})()})();