1"use strict";(globalThis.webpackChunkfrontend||=[]).push([[5334],{2175(e,t,n){n.d(t,{replayIntegration:()=>Ys,setTag:()=>r.NA,setUser:()=>r.gV});var r=n(87698),s=n(51296),o=n(33974),i=n(50359),a=n(73468),c=n(55898),l=n(15507),u=n(20389),d=n(30068),h=n(1983),p=n(12241),m=n(99271),f=n(19668),g=n(97629),y=n(24210);function S(e,t){const n=t?.getDsn(),r=t?.getOptions().tunnel;return function(e,t){const n=(0,y.kg)(e);if(!n||(0,y.nt)(n))return!1;if(!t)return!1;return r=n.hostname,s=t.host,(r===s||s.length>0&&r.endsWith(`.${s}`))&&/(^|&|\?)sentry_key=/.test(n.search);var r,s}(e,n)||function(e,t){if(!t)return!1;return k(e)===k(t)}(e,r)}function k(e){return"/"===e[e.length-1]?e.slice(0,-1):e}var v=n(89370);var b=n(58443),w=n(25883),_=n(53178),I=n(29228),C=n(83898),E=n(92012),T=n(16132),M=n(61693),x=n(70486),R=n(58290),A=n(61794),O=n(14649);const D=(e,t,n,r)=>{let s,o;return i=>{t.value>=0&&(i||r)&&(o=t.value-(s??0),(o||void 0===s)&&(s=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}},L=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=O.j.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},N=()=>{const e=L();return e?.activationStart??0};var F=n(14617);let P=-1;const B=new Set,U=e=>{if(function(e){return"pagehide"===e.type||"hidden"===O.j.document?.visibilityState}(e)&&P>-1){if("visibilitychange"===e.type||"pagehide"===e.type)for(const e of B)e();isFinite(P)||(P="visibilitychange"===e.type?e.timeStamp:0,(0,F.Q)("prerenderingchange",U,!0))}},z=()=>{if(O.j.document&&P<0){const e=N(),t=O.j.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;P=t??("hidden"!==O.j.document?.visibilityState||O.j.document?.prerendering?1/0:0),(0,F.d)("visibilitychange",U,!0),(0,F.d)("pagehide",U,!0),(0,F.d)("prerenderingchange",U,!0)}return{get firstHiddenTime(){return P},onHidden(e){B.add(e)}}};const W=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;const n=L();let r="navigate";n&&(O.j.document?.prerendering||N()>0?r="prerender":O.j.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-")));return{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},j=new WeakMap;function H(e,t){try{return j.get(e)||j.set(e,new t),j.get(e)}catch(n){return new t}}class ${constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(e){if(e.hadRecentInput)return;const t=this._sessionEntries[0],n=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),this._onAfterProcessingUnexpectedShift?.(e)}}const q=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}};var K=n(72945);const V=e=>{O.j.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},J=[1800,3e3],Y=[.1,.25],G=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};V(()=>{const n=z(),r=W("FCP");let s;const o=q("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-N(),0),r.entries.push(t),s(!0)))});o&&(s=D(e,r,J,t.reportAllChanges))})}((0,K.J)(()=>{const n=W("CLS",0);let r;const s=z(),o=H(t,$),i=e=>{for(const t of e)o._processEntry(t);o._sessionValue>n.value&&(n.value=o._sessionValue,n.entries=o._sessionEntries,r())},a=q("layout-shift",i);a&&(r=D(e,n,Y,t.reportAllChanges),s.onHidden(()=>{i(a.takeRecords()),r(!0)}),O.j?.setTimeout?.(r))}))};let X=0,Q=1/0,Z=0;const ee=e=>
1{e.forEach(e=>{e.interactionId&&(Q=Math.min(Q,e.interactionId),Z=Math.max(Z,e.interactionId),X=Z?(Z-Q)/7+1:0)})};let te;const ne=()=>te?X:performance.interactionCount||0,re=()=>{"interactionCount"in performance||te||(te=q("event",ee,{type:"event",buffered:!0,durationThreshold:0}))};let se=0;class oe{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){se=ne(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const e=Math.min(this._longestInteractionList.length-1,Math.floor((ne()-se)/50));return this._longestInteractionList[e]}_processEntry(e){if(this._onBeforeProcessingEntry?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this._longestInteractionList.at(-1);let n=this._longestInteractionMap.get(e.interactionId);if(n||this._longestInteractionList.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):(n={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(n.id,n),this._longestInteractionList.push(n)),this._longestInteractionList.sort((e,t)=>t._latency-e._latency),this._longestInteractionList.length>10){const e=this._longestInteractionList.splice(10);for(const t of e)this._longestInteractionMap.delete(t.id)}this._onAfterProcessingINPCandidate?.(n)}}}var ie=n(10638);const ae=[200,500];class ce{_processEntry(e){this._onBeforeProcessingEntry?.(e)}}const le=[2500,4e3];const ue={},de={};let he,pe,me;function fe(e,t){return be(e,t),de[e]||(!function(e){const t={};"event"===e&&(t.durationThreshold=0);q(e,t=>{ge(e,{entries:t})},t)}(e),de[e]=!0),we(e,t)}function ge(e,t){const n=ue[e];if(n?.length)for(const s of n)try{s(t)}catch(r){A.T&&u.Yz.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${(0,R.qQ)(s)}\nError:`,r)}}function ye(){return G(e=>{ge("cls",{metric:e}),he=e},{reportAllChanges:!0})}function Se(){return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};V(()=>{const n=z(),r=W("LCP");let s;const o=H(t,ce),i=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)t&&(o._processEntry(t),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-N(),0),r.entries=[t],s()))},a=q("largest-contentful-paint",i);if(a){s=D(e,r,le,t.reportAllChanges);const n=(0,K.J)(()=>{i(a.takeRecords()),a.disconnect(),s(!0)}),o=e=>{e.isTrusted&&((0,ie.k)(n),(0,F.Q)(e.type,o,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])(0,F.d)(e,o,{capture:!0})}})}(e=>{ge("lcp",{metric:e}),pe=e},{reportAllChanges:!0})}function ke(){return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=z();V(()=>{re();const r=W("INP");let s;const o=H(t,oe),i=e=>{(0,ie.k)(()=>{for(const n of e)o._processEntry(n);const t=o._estimateP98LongestInteraction();t&&t._latency!==r.value&&(r.value=t._latency,r.entries=t.entries,s())})},a=q("event",i,{durationThreshold:t.durationThreshold??40});s=D(e,r,ae,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{i(a.takeRecords()),s(!0)}))})}(e=>{ge("inp",{metric:e}),me=e})}function ve(e,t,n,r){let s,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return be(e,t),de[e]||(s=n(),de[e]=!0),r&&t({metric:r}),we(e,t,o?s:void 0)}function be(e,t){ue[e]=ue[e]||[],ue[e].push(t)}function we(e,t,n){return()=>{n&&n();const r=ue[e];if(!r)return;const s=r.indexOf(t);-1!==s&&r.splice(s,1)}}const _e=Symbol.for("sentry__originalRequestBody");function Ie(e){return new URLSearchParams(e).toString()}function Ce(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.Yz;try{if("string"===typeof e)return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[Ie(e)];if(!e)return[void 0]}catch(n){return A.T&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return A.T&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Ee(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(e.length>=2&&e[1]&&"object"===typeof e[1]&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){const t=e[0][_e];return void 0!==t?t:void 0}}var Te=n(97618),Me=n(26756),xe=n(82704);const Re=s.O,Ae="sentryReplaySession",Oe="Unable to send Replay",De=5e3,Le=5500,Ne=15e4,Fe=5e3,Pe=2e7,Be=4999,Ue=36e5;
1var ze=Object.defineProperty,We=(e,t,n)=>((e,t,n)=>t in e?ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!==typeof t?t+"":t,n),je=(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",e))(je||{});function He(e){const t=e?.host;return Boolean(t?.shadowRoot===e)}function $e(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function qe(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,Ke).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch(n){return null}var t}function Ke(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=qe(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){}else if(function(e){return"selectorText"in e}(e)){let t=e.cssText;const n=e.selectorText.includes(":"),r="string"===typeof e.style.all&&e.style.all;if(r&&(t=function(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,s=r[n],o=r.getPropertyPriority(s);t+=`${s}:${r.getPropertyValue(s)}${o?" !important":""};`}return`${e.selectorText} { ${t} }`}(e)),n&&(t=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(t)),n||r)return t}return t||e.cssText}class Ve{constructor(){We(this,"idNodeMap",new Map),We(this,"nodeMetaMap",new WeakMap)}getId(e){if(!e)return-1;const t=this.getMeta(e)?.id;return t??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Je(e){let{maskInputOptions:t,tagName:n,type:r}=e;return"OPTION"===n&&(n="SELECT"),Boolean(t[n.toLowerCase()]||r&&t[r]||"password"===r||"INPUT"===n&&!r&&t.text)}function Ye(e){let{isMasked:t,element:n,value:r,maskInputFn:s}=e,o=r||"";return t?(s&&(o=s(o,n)),"*".repeat(o.length)):o}function Ge(e){return e.toLowerCase()}function Xe(e){return e.toUpperCase()}const Qe="__rrweb_original__";function Ze(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ge(t):null}function et(e,t,n){return"INPUT"!==t||"radio"!==n&&"checkbox"!==n?e.value:e.getAttribute("value")||""}function tt(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(s){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return r?.[1]??null}const nt={};function rt(e){const t=nt[e];if(t)return t;const n=window.document;let r=window[e];if(n&&"function"===typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const s=t.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(t)}catch(s){}return nt[e]=r.bind(window)}function st(){return rt("setTimeout")(...arguments)}function ot(){return rt("clearTimeout")(...arguments)}function it(e){try{return e.contentDocument}catch{}}let at=1;const ct=new RegExp("[^a-z0-9-_:]");function lt(){return at++}let ut,dt;const ht=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,pt=/^(?:[a-z+]+:)?\/\//i,mt=/^www\..*/i,ft=/^(data:)([^,]*),(.*)/i;function gt(e,t){return(e||"").replace(ht,(e,n,r,s,o,i)=>{const a=r||o||i,c=n||s||"";if(!a)return e;if(pt.test(a)||mt.test(a))return`url(${c}${a}${c})`;if(ft.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const l=t.split("/"),u=a.split("/");l.pop();for(const t of u)"."!==t&&(".."===t?l.pop():l.push(t));return`url(${c}${l.join("/")}${c})`})}const yt=/^[^ \t\n\r\u000c]+/,St=/^[, \t\n\r\u000c]+/;const kt=new WeakMap;function vt(e,t){return t&&""!==t.trim()?wt(e,t):t}function bt(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function wt(e,t){let n=kt.get(e);if(n||(n=e.createElement("a"),kt.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function _t(e,t,n,r,s,o,i){if(!r)return r;if("src"===n||"href"===n&&("use"!==t||"#"!==r[0]))return vt(e,r);if("xlink:href"===n&&"#"!==r[0])return vt(e,r);if("background"===n&&("table"===t||"td"===t||"th"===t))return vt(e,r);if("srcset"===n)return function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const s=e.exec(t.substring(n));return s?(r=s[0],n+=r.length,r):""}const s=[];for(;r(St),!(n>=t.length);
1){let o=r(yt);if(","===o.slice(-1))o=vt(e,o.substring(0,o.length-1)),s.push(o);else{let r="";o=vt(e,o);let i=!1;for(;;){const e=t.charAt(n);if(""===e){s.push((o+r).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){n+=1,s.push((o+r).trim());break}"("===e&&(i=!0)}r+=e,n+=1}}}return s.join(", ")}(e,r);if("style"===n){let t=gt(r,wt(e));return i&&i.size>0&&(t=function(e,t){if(!e||0===t.size)return e;try{const n=e.split(";"),r=[];for(let e of n){if(e=e.trim(),!e)continue;const n=e.indexOf(":");if(-1===n){r.push(e);continue}const s=e.slice(0,n).trim();t.has(s)||r.push(e)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}(t,i)),t}return"object"===t&&"data"===n?vt(e,r):"function"===typeof o?o(n,r,s):r}function It(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function Ct(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return e?e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Ct(e.parentNode,t,n,r+1):-1}function Et(e,t){return n=>{const r=n;if(null===r)return!1;try{if(e)if("string"===typeof e){if(r.matches(`.${e}`))return!0}else if(function(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}(r,e))return!0;return!(!t||!r.matches(t))}catch{return!1}}}function Tt(e,t,n,r,s,o){try{const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===i)return!1;if("INPUT"===i.tagName){const e=i.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(e))return!0}let a=-1,c=-1;if(o){if(c=Ct(i,Et(r,s)),c<0)return!0;a=Ct(i,Et(t,n),c>=0?c:1/0)}else{if(a=Ct(i,Et(t,n)),a<0)return!1;c=Ct(i,Et(r,s),a>=0?a:1/0)}return a>=0?!(c>=0)||a<=c:!(c>=0)&&!!o}catch(i){}return!!o}function Mt(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:o,unblockSelector:i,maskAllText:a,maskAttributeFn:c,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h,inlineStylesheet:p,maskInputOptions:m={},maskTextFn:f,maskInputFn:g,dataURLOptions:y={},inlineImages:S,recordCanvas:k,keepIframeSrcFn:v,newlyAddedElement:b=!1,ignoreCSSAttributes:w}=t,_=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:je.Document,childNodes:[],compatMode:e.compatMode}:{type:je.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:je.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:o,inlineStylesheet:i,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:f,maskTextClass:g,unmaskTextClass:y,maskTextSelector:S,unmaskTextSelector:k,ignoreCSSAttributes:v}=t,b=function(e,t,n,r){try{if(r&&e.matches(r))return!1;if("string"===typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(s){}return!1}(e,r,s,o),w=function(e){if(e instanceof HTMLFormElement)return"form";const t=Ge(e.tagName);return ct.test(t)?"div":t}(e);let _={};const I=e.attributes.length;for(let T=0;T<I;T++){const t=e.attributes[T];t.name&&!It(w,t.name,t.value)&&(_[t.name]=_t(n,w,Ge(t.name),t.value,e,c,v))}if("link"===w&&i){const t=Array.from(n.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=qe(t)),r&&(_.rel=null,_.href=null,_.crossorigin=null,_._cssText=gt(r,t.href))}if("style"===w&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=qe(e.sheet);t&&(_._cssText=gt(t,wt(n)))}if("input"===w||"textarea"===w||"select"===w||"option"===w){const t=e,n=Ze(t),r=et(t,Xe(w),n),s=t.checked;if("submit"!==n&&"button"!==n&&r){const e=Tt(t,g,S,y,k,Je({type:n,tagName:Xe(w),maskInputOptions:a}));_.value=Ye({isMasked:e,element:t,value:r,maskInputFn:l})}s&&(_.checked=s)}"option"===w&&(e.selected&&!a.select?_.selected=!0:delete _.selected);if("canvas"===w&&h)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const s=t.getImageData,o=Qe in s?s[Qe]:s;
1if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(_.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){const t=e.toDataURL(u.type,u.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(u.type,u.quality)&&(_.rr_dataURL=t)}if("img"===w&&d){ut||(ut=n.createElement("canvas"),dt=ut.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{ut.width=t.naturalWidth,ut.height=t.naturalHeight,dt.drawImage(t,0,0),_.rr_dataURL=ut.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(s?_.crossOrigin=s:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}"audio"!==w&&"video"!==w||(_.rr_mediaState=e.paused?"paused":"played",_.rr_mediaCurrentTime=e.currentTime);m||(e.scrollLeft&&(_.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(_.rr_scrollTop=e.scrollTop));if(b){const{width:t,height:n}=e.getBoundingClientRect();_={class:_.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==w||p(_.src)||(b||it(e)||(_.rr_src=_.src),delete _.src);let C;try{customElements.get(w)&&(C=!0)}catch(E){}return{type:je.Element,tagName:w,attributes:_,childNodes:[],isSVG:bt(e)||void 0,needBlock:b,rootId:f,isCustom:C}}(e,{doc:n,blockClass:s,blockSelector:o,unblockSelector:i,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:m,maskInputFn:g,dataURLOptions:y,inlineImages:S,recordCanvas:k,keepIframeSrcFn:v,newlyAddedElement:b,rootId:_,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h,ignoreCSSAttributes:w});case e.TEXT_NODE:return function(e,t){const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:o,unmaskTextSelector:i,maskTextFn:a,maskInputOptions:c,maskInputFn:l,rootId:u}=t,d=e.parentNode&&e.parentNode.tagName;let h=e.textContent;const p="STYLE"===d||void 0,m="SCRIPT"===d||void 0,f="TEXTAREA"===d||void 0;if(p&&h){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(h=qe(e.parentNode.sheet))}catch(y){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${y}`,e)}h=gt(h,wt(t.doc))}m&&(h="SCRIPT_PLACEHOLDER");const g=Tt(e,r,o,s,i,n);p||m||f||!h||!g||(h=a?a(h,e.parentElement):h.replace(/[\S]/g,"*"));f&&h&&(c.textarea||g)&&(h=l?l(h,e.parentNode):h.replace(/[\S]/g,"*"));if("OPTION"===d&&h){h=Ye({isMasked:Tt(e,r,o,s,i,Je({type:null,tagName:d,maskInputOptions:c})),element:e,value:h,maskInputFn:l})}return{type:je.Text,textContent:h||"",isStyle:p,rootId:u}}(e,{doc:n,maskAllText:a,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h,maskTextFn:f,maskInputOptions:m,maskInputFn:g,rootId:_});case e.CDATA_SECTION_NODE:return{type:je.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:je.Comment,textContent:e.textContent||"",rootId:_};default:return!1}}function xt(e){return void 0===e||null===e?"":e.toLowerCase()}function Rt(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:o,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:h=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:S,dataURLOptions:k={},inlineImages:v=!1,recordCanvas:b=!1,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:I=5e3,onBlockedImageLoad:C,onStylesheetLoad:E,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:M=()=>!1,newlyAddedElement:x=!1,ignoreCSSAttributes:R}=t;let{preserveWhiteSpace:A=!0}=t;const O=Mt(e,{doc:n,mirror:r,blockClass:s,blockSelector:o,maskAllText:a,unblockSelector:i,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,dataURLOptions:k,inlineImages:v,recordCanvas:b,keepIframeSrcFn:M,newlyAddedElement:x,ignoreCSSAttributes:R});if(!O)return console.warn(e,"not serialized"),null;let D;D=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===je.Comment)return!0;
1if(e.type===je.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"===typeof e.attributes.href&&"js"===tt(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(xt(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===xt(e.attributes.name)||"icon"===xt(e.attributes.rel)||"apple-touch-icon"===xt(e.attributes.rel)||"shortcut icon"===xt(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&xt(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(xt(e.attributes.property).match(/^(og|twitter|fb):/)||xt(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===xt(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===xt(e.attributes.name)||"googlebot"===xt(e.attributes.name)||"bingbot"===xt(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===xt(e.attributes.name)||"generator"===xt(e.attributes.name)||"framework"===xt(e.attributes.name)||"publisher"===xt(e.attributes.name)||"progid"===xt(e.attributes.name)||xt(e.attributes.property).match(/^article:/)||xt(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===xt(e.attributes.name)||"yandex-verification"===xt(e.attributes.name)||"csrf-token"===xt(e.attributes.name)||"p:domain_verify"===xt(e.attributes.name)||"verify-v1"===xt(e.attributes.name)||"verification"===xt(e.attributes.name)||"shopify-checkout-api-token"===xt(e.attributes.name)))return!0}}return!1}(O,S)&&(A||O.type!==je.Text||O.isStyle||O.textContent.trim().length)?lt():-2;const L=Object.assign(O,{id:D});if(r.add(e,L),-2===D)return null;w&&w(e);let N=!h;if(L.type===je.Element){N=N&&!L.needBlock;const t=e.shadowRoot;t&&$e(t)&&(L.isShadowHost=!0)}if((L.type===je.Document||L.type===je.Element)&&N){S.headWhitespace&&L.type===je.Element&&"head"===L.tagName&&(A=!1);const t={doc:n,mirror:r,blockClass:s,blockSelector:o,maskAllText:a,unblockSelector:i,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:h,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:S,dataURLOptions:k,inlineImages:v,recordCanvas:b,preserveWhiteSpace:A,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:I,onBlockedImageLoad:C,onStylesheetLoad:E,stylesheetLoadTimeout:T,keepIframeSrcFn:M,ignoreCSSAttributes:R},x=e.childNodes?Array.from(e.childNodes):[];for(const e of x){const n=Rt(e,t);n&&L.childNodes.push(n)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(const n of Array.from(e.shadowRoot.childNodes)){const r=Rt(n,t);r&&($e(e.shadowRoot)&&(r.isShadow=!0),L.childNodes.push(r))}}if(e.parentNode&&He(e.parentNode)&&$e(e.parentNode)&&(L.isShadow=!0),L.type!==je.Element||"iframe"!==L.tagName||L.needBlock||function(e,t,n){const r=function(e){try{return e.contentWindow}catch{}}(e);if(!r)return;let s,o=!1;try{s=r.document.readyState}catch(a){return}if("complete"!==s){const r=st(()=>{o||(t(),o=!0)},n);return void e.addEventListener("load",()=>{ot(r),o=!0,t()})}const i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return st(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=it(e);if(t&&_){const n=Rt(t,{doc:t,mirror:r,blockClass:s,blockSelector:o,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:S,dataURLOptions:k,inlineImages:v,recordCanvas:b,preserveWhiteSpace:A,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:I,onStylesheetLoad:E,stylesheetLoadTimeout:T,keepIframeSrcFn:M,ignoreCSSAttributes:R});n&&_(e,n)}},I),L.type===je.Element&&"img"===L.tagName&&!e.complete&&L.needBlock){const t=e,n=()=>{if(t.isConnected&&!t.complete&&C)try{const e=t.getBoundingClientRect();e.width>0&&e.height>0&&C(t,L,e)}catch(e){}t.removeEventListener("load",n)};t.isConnected&&t.addEventListener("load",n)}return L.type===je.Element&&"link"===L.tagName&&"string"===typeof L.attributes.rel&&("stylesheet"===L.attributes.rel||"preload"===L.attributes.rel&&"string"===typeof L.attributes.href&&"css"===tt(L.attributes.href))&&function(e,t,n){let r,s=!1;try{r=e.sheet}catch(i){r=null}if(r)return;const o=st(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{ot(o),s=!0,t()})}(e,()=>{if(E){const t=Rt(e,{doc:n,mirror:r,blockClass:s,blockSelector:o,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:S,dataURLOptions:k,inlineImages:v,recordCanvas:b,preserveWhiteSpace:A,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:I,onStylesheetLoad:E,stylesheetLoadTimeout:T,keepIframeSrcFn:M,ignoreCSSAttributes:R});t&&E(e,t)}},T),L.type===je.Element&&delete L.needBlock,L}function At(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Ot="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Dt={map:{},getId:()=>(console.error(Ot),-1),getNode:()=>(console.error(Ot),null),removeNodeFromMap(){console.error(Ot)},has:()=>(console.error(Ot),!1),reset(){console.error(Ot)}};function Lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,s=0;return function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];const c=Date.now();s||!1!==n.leading||(s=c);const l=t-(c-s),u=this;l<=0||l>t?(r&&(!function(){en("clearTimeout")(...arguments)}
1(r),r=null),s=c,e.apply(u,i)):r||!1===n.trailing||(r=tn(()=>{s=!1===n.leading?0:Date.now(),r=null,e.apply(u,i)},l))}}function Nt(e,t,n,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(e){tn(()=>{n.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>Nt(e,t,o||{},!0)}function Ft(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return"function"===typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}"undefined"!==typeof window&&window.Proxy&&window.Reflect&&(Dt=new Proxy(Dt,{get:(e,t,n)=>("map"===t&&console.error(Ot),Reflect.get(e,t,n))}));let Pt=Date.now;function Bt(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function Ut(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function zt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Wt(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch(t){return null}}function jt(e,t,n,r,s){if(!e)return!1;const o=Wt(e);if(!o)return!1;const i=Et(t,n);if(!s){const e=r&&o.matches(r);return i(o)&&!e}const a=Ct(o,i);let c=-1;return!(a<0)&&(r&&(c=Ct(o,Et(null,r))),a>-1&&c<0||a<c)}function Ht(e,t){return-2===t.getId(e)}function $t(e,t){if(He(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||$t(e.parentNode,t))}function qt(e){return Boolean(e.changedTouches)}function Kt(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Vt(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Jt(e){return Boolean(e?.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Pt=()=>(new Date).getTime());class Yt{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return this.styleIDMap.get(e)??-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 Gt(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function Xt(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=Gt(n);)n=t;return n}(e);return t.contains(n)}function Qt(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||Xt(e))}const Zt={};function en(e){const t=Zt[e];if(t)return t;const n=window.document;let r=window[e];if(n&&"function"===typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const s=t.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(t)}catch(s){}return Zt[e]=r.bind(window)}function tn(){return en("setTimeout")(...arguments)}var nn=(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))(nn||{}),rn=(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[e.CustomElement=16]="CustomElement",e))(rn||{}),sn=(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))(sn||{}),on=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(on||{}),an=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(an||{});let cn;function ln(e){cn=e}function un(){cn=void 0}const dn=e=>{if(!cn)return e;return function(){try{return e(...arguments)}catch(t){if(cn&&!0===cn(t))return()=>{};throw t}}};for(var hn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/",pn="undefined"===typeof Uint8Array?[]:new Uint8Array(256),mn=0;mn<64;mn++)pn[hn.charCodeAt(mn)]=mn;class fn{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}function gn(e){try{return e.contentDocument}catch(t){}}function yn(e){try{return e.contentWindow}catch(t){}}class Sn{constructor(e){this.doc=e,this.unattachedDoc=null}parse(e){return this.parseWithConstructableStylesheet(e)||this.parseWithDetachedElement(e)}parseWithConstructableStylesheet(e){if("undefined"===typeof CSSStyleSheet||"function"!==typeof CSSStyleSheet.prototype.replaceSync)return null;try{const t=new CSSStyleSheet;t.replaceSync(`x { ${e} }`);const n=t.cssRules[0];return n&&n.type===CSSRule.STYLE_RULE?n.style:null}catch{return null}}parseWithDetachedElement(e){const t=this.getUnattachedDoc().createElement("span");return t.setAttribute("style",e),t.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}}function kn(e){return"__ln"in e}class vn{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=t?.next||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&kn(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&&kn(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 bn=(e,t)=>`${e}@${t}`;class wn{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new vn,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},s=s=>{if(!s.parentNode||!Qt(s))return;const o=He(s.parentNode)?this.mirror.getId(Gt(s)):this.mirror.getId(s.parentNode),i=r(s);if(-1===o||-1===i)return n.addNode(s);const a=Rt(s,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Kt(e,this.mirror)&&!jt(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(e),Vt(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Jt(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{if(jt(e,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(e,t);const n=yn(e);n&&this.canvasManager.addWindow(n),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,n)=>{let{width:r,height:s}=n;this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${r}px`,height:`${s}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});a&&(e.push({parentId:o,nextId:i,node:a}),t.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)In(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||s(a);for(const a of this.addedSet)Cn(this.droppedSet,a)||In(this.removes,a,this.mirror)?Cn(this.movedSet,a)?s(a):this.droppedSet.add(a):s(a);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);
1if(-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),s(e.value)}const i={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};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(i))},this.processMutation=e=>{if(!Ht(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;jt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||t===e.oldValue||this.texts.push({value:Tt(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t,Wt(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const n=Ze(t),s=t.tagName;r=et(t,s,n);const o=Je({maskInputOptions:this.maskInputOptions,tagName:s,type:n});r=Ye({isMasked:Tt(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,o),element:t,value:r,maskInputFn:this.maskInputFn})}if(jt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||r===e.oldValue)return;let s=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(gn(t))return;n="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!It(t.tagName,n)&&(s.attributes[n]=_t(this.doc,Ge(t.tagName),Ge(n),r,t,this.maskAttributeFn),"style"===n)){const n=e.oldValue?this.styleDeclarationParser.parse(e.oldValue):null;for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);r!==(n?.getPropertyValue(e)||"")||o!==(n?.getPropertyPriority(e)||"")?s.styleDiff[e]=""===o?r:[r,o]:s._unchangedStyles[e]=[r,o]}if(n)for(const e of Array.from(n))""===t.style.getPropertyValue(e)&&(s.styleDiff[e]=!1)}break}case"childList":if(jt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=He(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);jt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Ht(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(_n(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||$t(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[bn(n,r)]?_n(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!He(e.target)||!$e(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Ht(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[bn(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);jt(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEac
1h(e=>this.genAdds(e)),Jt(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","ignoreCSSAttributes"].forEach(t=>{this[t]=e[t]}),this.styleDeclarationParser=new Sn(this.doc)}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function _n(e,t){e.delete(t),t.childNodes?.forEach(t=>_n(e,t))}function In(e,t,n){return 0!==e.length&&function(e,t,n){let r=t.parentNode;for(;r;){const t=n.getId(r);if(e.some(e=>e.id===t))return!0;r=r.parentNode}return!1}(e,t,n)}function Cn(e,t){return 0!==e.size&&En(e,t)}function En(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||En(e,n))}const Tn=[];function Mn(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{}return e&&e.target}function xn(e,t){const n=new wn;Tn.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=window?.Zone?.__symbol__?.("MutationObserver");s&&window[s]&&(r=window[s]);const o=new r(dn(t=>{e.onMutation&&!1===e.onMutation(t)||n.processMutations.bind(n)(t)}));return o.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),o}function Rn(e){let{mouseInteractionCb:t,doc:n,mirror:r,blockClass:s,blockSelector:o,unblockSelector:i,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};const c=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[];let u=null;return Object.keys(sn).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==c[e]).forEach(e=>{let a=Ge(e);const c=(e=>n=>{const a=Mn(n);if(jt(a,s,o,i,!0))return;let c=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":c=on.Mouse;break;case"touch":c=on.Touch;break;case"pen":c=on.Pen}c===on.Touch?sn[e]===sn.MouseDown?l="TouchStart":sn[e]===sn.MouseUp&&(l="TouchEnd"):on.Pen}else qt(n)&&(c=on.Touch);null!==c?(u=c,(l.startsWith("Touch")&&c===on.Touch||l.startsWith("Mouse")&&c===on.Mouse)&&(c=null)):sn[e]===sn.Click&&(c=u,u=null);const d=qt(n)?n.changedTouches[0]:n;if(!d)return;const h=r.getId(a),{clientX:p,clientY:m}=d;dn(t)({type:sn[l],id:h,x:p,y:m,...null!==c&&{pointerType:c}})})(e);if(window.PointerEvent)switch(sn[e]){case sn.MouseDown:case sn.MouseUp:a=a.replace("mouse","pointer");break;case sn.TouchStart:case sn.TouchEnd:return}l.push(At(a,c,n))}),dn(()=>{l.forEach(e=>e())})}function An(e){let{scrollCb:t,doc:n,mirror:r,blockClass:s,blockSelector:o,unblockSelector:i,sampling:a}=e;return At("scroll",dn(Lt(dn(e=>{const a=Mn(e);if(!a||jt(a,s,o,i,!0))return;const c=r.getId(a);if(a===n&&n.defaultView){const e=Bt(n.defaultView);t({id:c,x:e.left,y:e.top})}else t({id:c,x:a.scrollLeft,y:a.scrollTop})}),a.scroll||100)),n)}const On=["INPUT","TEXTAREA","SELECT"],Dn=new WeakMap;function Ln(e){let{inputCb:t,doc:n,mirror:r,blockClass:s,blockSelector:o,unblockSelector:i,ignoreClass:a,ignoreSelector:c,maskInputOptions:l,maskInputFn:u,sampling:d,userTriggeredOnInput:h,maskTextClass:p,unmaskTextClass:m,maskTextSelector:f,unmaskTextSelector:g}=e;function y(e){let t=Mn(e);const r=e.isTrusted,d=t&&Xe(t.tagName);if("OPTION"===d&&(t=t.parentElement),!t||!d||On.indexOf(d)<0||jt(t,s,o,i,!0))return;const y=t;if(y.classList.contains(a)||c&&y.matches(c))return;const k=Ze(t);let v=et(y,d,k),b=!1;const w=Je({maskInputOptions:l,tagName:d,type:k}),_=Tt(t,p,f,m,g,w);"radio"!==k&&"checkbox"!==k||(b=t.checked),v=Ye({isMasked:_,element:t,value:v,maskInputFn:u}),S(t,h?{text:v,isChecked:b,userTriggered:r}:{text:v,isChecked:b});const I=t.name;"radio"===k&&I&&b&&n.querySelectorAll(`input[type="radio"][name="${I}
1"]`).forEach(e=>{if(e!==t){const t=Ye({isMasked:_,element:e,value:et(e,d,k),maskInputFn:u});S(e,h?{text:t,isChecked:!b,userTriggered:!1}:{text:t,isChecked:!b})}})}function S(e,n){const s=Dn.get(e);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){Dn.set(e,n);const s=r.getId(e);dn(t)({...n,id:s})}}const k=("last"===d.input?["change"]:["input","change"]).map(e=>At(e,dn(y),n)),v=n.defaultView;if(!v)return()=>{k.forEach(e=>e())};const b=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value"),w=[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]];return b&&b.set&&k.push(...w.map(e=>Nt(e[0],e[1],{set(){dn(y)({target:this,isTrusted:!1})}},!1,v))),dn(()=>{k.forEach(e=>e())})}function Nn(e){return function(e,t){if(Un("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Un("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Un("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Un("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 Fn(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function Pn(e,t){let{mirror:n,stylesheetManager:r}=e,s=null;s="#document"===t.nodeName?n.getId(t):n.getId(t.host);const o="#document"===t.nodeName?t.defaultView?.Document:t.ownerDocument?.defaultView?.ShadowRoot,i=o?.prototype?Object.getOwnPropertyDescriptor(o?.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&i?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return i.get?.call(this)},set(e){const t=i.set?.call(this,e);if(null!==s&&-1!==s)try{r.adoptStyleSheets(e,s)}catch(n){}return t}}),dn(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})})):()=>{}}function Bn(e){const t=e.doc.defaultView;if(!t)return()=>{};let n;e.recordDOM&&(n=xn(e,e.doc));const r=function(e){let{mousemoveCb:t,sampling:n,doc:r,mirror:s}=e;if(!1===n.mousemove)return()=>{};const o="number"===typeof n.mousemove?n.mousemove:50,i="number"===typeof n.mousemoveCallback?n.mousemoveCallback:500;let a,c=[];const l=Lt(dn(e=>{const n=Date.now()-a;t(c.map(e=>(e.timeOffset-=n,e)),e),c=[],a=null}),i),u=dn(Lt(dn(e=>{const t=Mn(e),{clientX:n,clientY:r}=qt(e)?e.changedTouches[0]:e;a||(a=Pt()),c.push({x:n,y:r,id:s.getId(t),timeOffset:Pt()-a}),l("undefined"!==typeof DragEvent&&e instanceof DragEvent?rn.Drag:e instanceof MouseEvent?rn.MouseMove:rn.TouchMove)}),o,{trailing:!1})),d=[At("mousemove",u,r),At("touchmove",u,r),At("drag",u,r)];return dn(()=>{d.forEach(e=>e())})}(e),s=Rn(e),o=An(e),i=function(e,t){let{viewportResizeCb:n}=e,{win:r}=t,s=-1,o=-1;return At("resize",dn(Lt(dn(()=>{const e=Ut(),t=zt();s===e&&o===t||(n({width:Number(t),height:Number(e)}),s=e,o=t)}),200)),r)}(e,{win:t}),a=Ln(e),c=function(e){let{mediaInteractionCb:t,blockClass:n,blockSelector:r,unblockSelector:s,mirror:o,sampling:i,doc:a}=e;const c=dn(e=>Lt(dn(i=>{const a=Mn(i);if(!a||jt(a,n,r,s,!0))return;const{currentTime:c,volume:l,muted:u,playbackRate:d}=a;t({type:e,id:o.getId(a),currentTime:c,volume:l,muted:u,playbackRate:d})}),i.media||500)),l=[At("play",c(an.Play),a),At("pause",c(an.Pause),a),At("seeked",c(an.Seeked),a),At("volumechange",c(an.VolumeChange),a),At("ratechange",c(an.RateChange),a)];return dn(()=>{l.forEach(e=>e())})}(e);let l=()=>{},u=()=>{},d=()=>{},h=()=>{};e.recordDOM&&(l=function(e,t){let{styleSheetRuleCb:n,mirror:r,stylesheetManager:s}=e,{win:o}=t;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};const i=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:dn((e,t,o)=>{const[i,a]=o,{id:c,styleId:l}=Fn(t,r,s.styleMirror);return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,adds:[{rule:i,index:a}]}),e.apply(t,o)})});const a=o.CSSStyleSheet.prototype.deleteRule;
1let c,l;o.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:dn((e,t,o)=>{const[i]=o,{id:a,styleId:c}=Fn(t,r,s.styleMirror);return(a&&-1!==a||c&&-1!==c)&&n({id:a,styleId:c,removes:[{index:i}]}),e.apply(t,o)})}),o.CSSStyleSheet.prototype.replace&&(c=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(c,{apply:dn((e,t,o)=>{const[i]=o,{id:a,styleId:c}=Fn(t,r,s.styleMirror);return(a&&-1!==a||c&&-1!==c)&&n({id:a,styleId:c,replace:i}),e.apply(t,o)})})),o.CSSStyleSheet.prototype.replaceSync&&(l=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:dn((e,t,o)=>{const[i]=o,{id:a,styleId:c}=Fn(t,r,s.styleMirror);return(a&&-1!==a||c&&-1!==c)&&n({id:a,styleId:c,replaceSync:i}),e.apply(t,o)})}));const u={};zn("CSSGroupingRule")?u.CSSGroupingRule=o.CSSGroupingRule:(zn("CSSMediaRule")&&(u.CSSMediaRule=o.CSSMediaRule),zn("CSSConditionRule")&&(u.CSSConditionRule=o.CSSConditionRule),zn("CSSSupportsRule")&&(u.CSSSupportsRule=o.CSSSupportsRule));const d={};return Object.entries(u).forEach(e=>{let[t,o]=e;d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:dn((e,t,o)=>{const[i,a]=o,{id:c,styleId:l}=Fn(t.parentStyleSheet,r,s.styleMirror);return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,adds:[{rule:i,index:[...Nn(t),a||0]}]}),e.apply(t,o)})}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:dn((e,t,o)=>{const[i]=o,{id:a,styleId:c}=Fn(t.parentStyleSheet,r,s.styleMirror);return(a&&-1!==a||c&&-1!==c)&&n({id:a,styleId:c,removes:[{index:[...Nn(t),i]}]}),e.apply(t,o)})})}),dn(()=>{o.CSSStyleSheet.prototype.insertRule=i,o.CSSStyleSheet.prototype.deleteRule=a,c&&(o.CSSStyleSheet.prototype.replace=c),l&&(o.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach(e=>{let[t,n]=e;n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule})})}(e,{win:t}),u=Pn(e,e.doc),d=function(e,t){let{styleDeclarationCb:n,mirror:r,ignoreCSSAttributes:s,stylesheetManager:o}=e,{win:i}=t;const a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:dn((e,t,i)=>{const[c,l,u]=i;if(s.has(c))return a.apply(t,[c,l,u]);const{id:d,styleId:h}=Fn(t.parentRule?.parentStyleSheet,r,o.styleMirror);return(d&&-1!==d||h&&-1!==h)&&n({id:d,styleId:h,set:{property:c,value:l,priority:u},index:Nn(t.parentRule)}),e.apply(t,i)})});const c=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(c,{apply:dn((e,t,i)=>{const[a]=i;if(s.has(a))return c.apply(t,[a]);const{id:l,styleId:u}=Fn(t.parentRule?.parentStyleSheet,r,o.styleMirror);return(l&&-1!==l||u&&-1!==u)&&n({id:l,styleId:u,remove:{property:a},index:Nn(t.parentRule)}),e.apply(t,i)})}),dn(()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=c})}(e,{win:t}),e.collectFonts&&(h=function(e){let{fontCb:t,doc:n}=e;const r=n.defaultView;if(!r)return()=>{};const s=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,n){const r=new i(e,t,n);return o.set(r,{family:e,buffer:"string"!==typeof t,descriptors:n,fontSource:"string"===typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=Ft(n.fonts,"add",function(e){return function(n){return tn(dn(()=>{const e=o.get(n);e&&(t(e),o.delete(n))}),0),e.apply(this,[n])}});return s.push(()=>{r.FontFace=i}),s.push(a),dn(()=>{s.forEach(e=>e())})}(e)));const p=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:o,selectionCb:i}=e;let a=!0;const c=dn(()=>{const e=t.getSelection();if(!e||a&&e?.isCollapsed)return;a=e.isCollapsed||!1;const c=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const i=e.getRangeAt(t),{startContainer:a,startOffset:l,endContainer:u,endOffset:d}=i;jt(a,r,s,o,!0)||jt(u,r,s,o,!0)||c.push({start:n.getId(a),startOffset:l,end:n.getId(u),endOffset:d})}i({ranges:c})});return c(),At("selectionchange",c)}(e),m=function(e){let{doc:t,customElementCb:n}=e;const r=t.defaultView;return r&&r.customElements?Ft(r.customElements,"define",function(e){return function(t,r,s){try{n({define:{name:t}})}catch(o){}return e.apply(this,[t,r,s])}}):()=>{}}(e),f=[];for(const g of e.plugins)f.push(g.observer(g.callback,t,g.options));return dn(()=>
1{Tn.forEach(e=>e.reset()),n?.disconnect(),r(),s(),o(),i(),a(),c(),l(),u(),d(),h(),p(),m(),f.forEach(e=>e())})}function Un(e){return"undefined"!==typeof window[e]}function zn(e){return Boolean("undefined"!==typeof window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Wn{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const s=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e);let i=s.get(t);return i||(i=this.generateIdFn(),s.set(t,i),o.set(i,t)),i}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 s=r.get(t);return s||-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 jn{constructor(){this.crossOriginIframeMirror=new Wn(lt),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class Hn{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Wn(lt),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Wn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0);const t=yn(e);t&&this.crossOriginIframeMap.set(t,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&yn(e)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(e);const n=gn(e);n&&n.adoptedStyleSheets&&n.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(n.adoptedStyleSheets,this.mirror.getId(n))}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){switch(t.type){case nn.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:nn.IncrementalSnapshot,data:{source:rn.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case nn.Meta:case nn.Load:case nn.DomContentLoaded:return!1;case nn.Plugin:return t;case nn.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case nn.IncrementalSnapshot:switch(t.data.source){case rn.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 rn.Drag:case rn.TouchMove:case rn.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case rn.ViewportResize:return!1;case rn.MediaInteraction:case rn.MouseInteraction:case rn.Scroll:case rn.CanvasMutation:case rn.Input:return this.replaceIds(t.data,e,["id"]),t;case rn.StyleSheetRule:case rn.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case rn.Font:return t;
1case rn.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case rn.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),t.data.styles?.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,n,r){for(const s of r)(Array.isArray(t[s])||"number"===typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(n,t[s]):t[s]=e.getId(n,t[s]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===je.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class $n{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class qn{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!$e(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);const n=xn({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(An({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),tn(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(Pn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){const t=gn(e),n=yn(e);t&&n&&this.patchAttachShadow(n.Element,t)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(Ft(e.prototype,"attachShadow",function(e){return function(r){const s=e.call(this,r);return this.shadowRoot&&Qt(this)&&n.addShadowRoot(this.shadowRoot,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}class Kn{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Yt,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const s of e){let e;this.styleMirror.has(s)?e=this.styleMirror.getId(s):(e=this.styleMirror.add(s),r.push({styleId:e,rules:Array.from(s.rules||CSSRule,(e,t)=>({rule:Ke(e),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Vn{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,function(){en("requestAnimationFrame")(...arguments)}(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let Jn,Yn;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(Qs){console.debug("Unable to override Array.from",Qs)}const Gn=new Ve;function Xn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:o=null,unblockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:l=!1,maskTextClass:u="rr-mask",unmaskTextClass:d=null,maskTextSelector:h=null,unmaskTextSelector:p=null,inlineStylesheet:m=!0,maskAllInputs:f,maskInputOptions:g,slimDOMOptions:y,maskAttributeFn:S,maskInputFn:k,maskTextFn:v,maxCanvasSize:b=null,packFn:w,sampling:_={},dataURLOptions:I={},mousemoveWait:C,recordDOM:E=!0,recordCanvas:T=!1,recordCrossOriginIframes:M=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:R=!1,collectFonts:A=!1,inlineImages:O=!1,plugins:D,keepIframeSrcFn:L=()=>!1,ignoreCSSAttributes:N=new Set([]),errorHandler:F,onMutation:P,getCanvasManager:B}=e;ln(F);const U=!M||window.parent===window;let z=!1;if(!U)try{window.parent.document&&(z=!1)}catch(te){z=!0}if(U&&!t)throw new Error("emit function is required");if(!U&&!z)return()=>{};void 0!==C&&void 0===_.mousemove&&(_.mousemove=C),Gn.reset();const W=!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:void 0!==g?g:{},j=!0===y||"all"===y?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===y,headMetaDescKeywords:"all"===y}:y||{};let H;!function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;
1"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let s=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===s)return!0}while(s=s&&s.parentNode);return!1})}();let $=0;const q=e=>{for(const t of D||[])t.eventProcessor&&(e=t.eventProcessor(e));return w&&!z&&(e=w(e)),e};Jn=(e,s)=>{const o=e;if(o.timestamp=Pt(),!Tn[0]?.isFrozen()||o.type===nn.FullSnapshot||o.type===nn.IncrementalSnapshot&&o.data.source===rn.Mutation||Tn.forEach(e=>e.unfreeze()),U)t?.(q(o),s);else if(z){const e={type:"rrweb",event:q(o),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(o.type===nn.FullSnapshot)H=o,$=0;else if(o.type===nn.IncrementalSnapshot){if(o.data.source===rn.Mutation&&o.data.isAttachIframe)return;$++;const e=r&&$>=r,t=n&&H&&o.timestamp-H.timestamp>n;(e||t)&&ee(!0)}};const K=e=>{Jn({type:nn.IncrementalSnapshot,data:{source:rn.Mutation,...e}})},V=e=>Jn({type:nn.IncrementalSnapshot,data:{source:rn.Scroll,...e}}),J=e=>Jn({type:nn.IncrementalSnapshot,data:{source:rn.CanvasMutation,...e}}),Y=new Kn({mutationCb:K,adoptedStyleSheetCb:e=>Jn({type:nn.IncrementalSnapshot,data:{source:rn.AdoptedStyleSheet,...e}})}),G="boolean"===typeof __RRWEB_EXCLUDE_IFRAME__&&__RRWEB_EXCLUDE_IFRAME__?new jn:new Hn({mirror:Gn,mutationCb:K,stylesheetManager:Y,recordCrossOriginIframes:M,wrappedEmit:Jn});for(const re of D||[])re.getMirror&&re.getMirror({nodeMirror:Gn,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const X=new Vn,Q=function(e,t){try{return e?e(t):new fn}catch{return console.warn("Unable to initialize CanvasManager"),new fn}}(B,{mirror:Gn,win:window,mutationCb:e=>Jn({type:nn.IncrementalSnapshot,data:{source:rn.CanvasMutation,...e}}),recordCanvas:T,blockClass:s,blockSelector:o,unblockSelector:i,maxCanvasSize:b,sampling:_.canvas,dataURLOptions:I,errorHandler:F}),Z="boolean"===typeof __RRWEB_EXCLUDE_SHADOW_DOM__&&__RRWEB_EXCLUDE_SHADOW_DOM__?new $n:new qn({mutationCb:K,scrollCb:V,bypassOptions:{onMutation:P,blockClass:s,blockSelector:o,unblockSelector:i,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:p,inlineStylesheet:m,maskInputOptions:W,dataURLOptions:I,maskAttributeFn:S,maskTextFn:v,maskInputFn:k,recordCanvas:T,inlineImages:O,sampling:_,slimDOMOptions:j,iframeManager:G,stylesheetManager:Y,canvasManager:Q,keepIframeSrcFn:L,processedNodeManager:X,ignoreCSSAttributes:N},mirror:Gn}),ee=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!E)return;Jn({type:nn.Meta,data:{href:window.location.href,width:zt(),height:Ut()}},e),Y.reset(),Z.init(),Tn.forEach(e=>e.lock());const t=function(e,t){const{mirror:n=new Ve,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:o=null,maskAllText:i=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inlineImages:h=!1,recordCanvas:p=!1,maskAllInputs:m=!1,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOM:S=!1,dataURLOptions:k,preserveWhiteSpace:v,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:_,onBlockedImageLoad:I,onStylesheetLoad:C,stylesheetLoadTimeout:E,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:M=new Set([])}=t||{};return Rt(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:o,maskAllText:i,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===m?{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}:!1===m?{}:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===S,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}
1:!1===S?{}:S,dataURLOptions:k,inlineImages:h,recordCanvas:p,preserveWhiteSpace:v,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:_,onBlockedImageLoad:I,onStylesheetLoad:C,stylesheetLoadTimeout:E,keepIframeSrcFn:T,newlyAddedElement:!1,ignoreCSSAttributes:M})}(document,{mirror:Gn,blockClass:s,blockSelector:o,unblockSelector:i,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:p,inlineStylesheet:m,maskAllInputs:W,maskAttributeFn:S,maskInputFn:k,maskTextFn:v,slimDOM:j,dataURLOptions:I,recordCanvas:T,inlineImages:O,onSerialize:e=>{Kt(e,Gn)&&G.addIframe(e),Vt(e,Gn)&&Y.trackLinkElement(e),Jt(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t);const n=yn(e);n&&Q.addWindow(n),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Y.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,n)=>{let{width:r,height:s}=n;K({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${r}px`,height:`${s}px`}}}]})},keepIframeSrcFn:L,ignoreCSSAttributes:N});if(!t)return console.warn("Failed to snapshot the document");Jn({type:nn.FullSnapshot,data:{node:t,initialOffset:Bt(window)}}),Tn.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,Gn.getId(document))};Yn=ee;try{const e=[],t=e=>dn(Bn)({onMutation:P,mutationCb:K,mousemoveCb:(e,t)=>Jn({type:nn.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Jn({type:nn.IncrementalSnapshot,data:{source:rn.MouseInteraction,...e}}),scrollCb:V,viewportResizeCb:e=>Jn({type:nn.IncrementalSnapshot,data:{source:rn.ViewportResize,...e}}),inputCb:e=>Jn({type:nn.IncrementalSnapshot,data:{source:rn.Input,...e}}),mediaInteractionCb:e=>Jn({type:nn.IncrementalSnapshot,data:{source:rn.MediaInteraction,...e}}),styleSheetRuleCb:e=>Jn({type:nn.IncrementalSnapshot,data:{source:rn.StyleSheetRule,...e}}),styleDeclarationCb:e=>Jn({type:nn.IncrementalSnapshot,data:{source:rn.StyleDeclaration,...e}}),canvasMutationCb:J,fontCb:e=>Jn({type:nn.IncrementalSnapshot,data:{source:rn.Font,...e}}),selectionCb:e=>{Jn({type:nn.IncrementalSnapshot,data:{source:rn.Selection,...e}})},customElementCb:e=>{Jn({type:nn.IncrementalSnapshot,data:{source:rn.CustomElement,...e}})},blockClass:s,ignoreClass:a,ignoreSelector:c,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:p,maskInputOptions:W,inlineStylesheet:m,sampling:_,recordDOM:E,recordCanvas:T,inlineImages:O,userTriggeredOnInput:R,collectFonts:A,doc:e,maskAttributeFn:S,maskInputFn:k,maskTextFn:v,keepIframeSrcFn:L,blockSelector:o,unblockSelector:i,slimDOMOptions:j,dataURLOptions:I,mirror:Gn,iframeManager:G,stylesheetManager:Y,shadowDomManager:Z,processedNodeManager:X,canvasManager:Q,ignoreCSSAttributes:N,plugins:D?.filter(e=>e.observer)?.map(e=>({observer:e.observer,options:e.options,callback:t=>Jn({type:nn.Plugin,data:{plugin:e.name,payload:t}})}))||[]},{});G.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(r){console.warn(r)}});const n=()=>{ee(),e.push(t(document))};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(At("DOMContentLoaded",()=>{Jn({type:nn.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&n()})),e.push(At("load",()=>{Jn({type:nn.Load,data:{}}),"load"===x&&n()},window))),()=>{e.forEach(e=>e()),X.destroy(),Yn=void 0,un()}}catch(ne){console.warn(ne)}}var Qn,Zn;Xn.mirror=Gn,Xn.takeFullSnapshot=function(e){if(!Yn)throw new Error("please take full snapshot after start recording");Yn(e)},(Zn=Qn||(Qn={}))[Zn.NotStarted=0]="NotStarted",Zn[Zn.Running=1]="Running",Zn[Zn.Stopped=2]="Stopped";function er(e){return e>9999999999?e:1e3*e}function tr(e){return e>9999999999?e/1e3:e}function nr(e,t){"sentry.transaction"!==t.category&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:nn.Custom,timestamp:1e3*(t.timestamp||0),data:{tag:"breadcrumb",payload:(0,o.S8)(t,10,1e3)}}),"console"===t.category)))}function rr(e){return e.closest("button,a")||e}function sr(e){const t=or(e);return t&&t instanceof Element?rr(t):t}function or(e){return function(e){return(0,i.Z4)(e)&&"target"in e}(e)?e.target:e}let ir;function ar(e){return ir||(ir=[],(0,a.GS)(Re,"open",function(e){return function(){if(ir)try{ir.forEach(e
1=>e())}catch{}for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(Re,n)}})),ir.push(e),()=>{const t=ir?ir.indexOf(e):-1;t>-1&&ir.splice(t,1)}}const cr=new Set([rn.Mutation,rn.StyleSheetRule,rn.StyleDeclaration,rn.AdoptedStyleSheet,rn.CanvasMutation,rn.Selection,rn.MediaInteraction]);class lr{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:nr;this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scrollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){const e=ar(()=>{this._lastMutation=dr()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){if(function(e,t){if(!ur.includes(e.tagName))return!0;if("INPUT"===e.tagName&&!["submit","button"].includes(e.getAttribute("type")||""))return!0;if("A"===e.tagName&&(e.hasAttribute("download")||e.hasAttribute("target")&&"_self"!==e.getAttribute("target")))return!0;if(t&&e.matches(t))return!0;return!1}(t,this._ignoreSelector)||!function(e){return!(!e.data||"number"!==typeof e.data.nodeId||!e.timestamp)}(e))return;const n={timestamp:tr(e.timestamp),clickBreadcrumb:e,clickCount:0,node:t};this._clicks.some(e=>e.node===n.node&&Math.abs(e.timestamp-n.timestamp)<1)||(this._clicks.push(n),1===this._clicks.length&&this._scheduleCheckClicks())}registerMutation(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this._lastMutation=tr(e)}registerScroll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this._lastScroll=tr(e)}registerClick(e){const t=rr(e);this._handleMultiClick(t)}_handleMultiClick(e){this._getClicks(e).forEach(e=>{e.clickCount++})}_getClicks(e){return this._clicks.filter(t=>t.node===e)}_checkClicks(){const e=[],t=dr();this._clicks.forEach(n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)});for(const n of e){const e=this._clicks.indexOf(n);e>-1&&(this._generateBreadcrumbs(n),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,s=!n&&!r,{clickCount:o,clickBreadcrumb:i}=e;if(s){const n=1e3*Math.min(e.mutationAfter||this._timeout,this._timeout),r=n<1e3*this._timeout?"mutation":"timeout",s={type:"default",message:i.message,timestamp:i.timestamp,category:"ui.slowClickDetected",data:{...i.data,url:Re.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:o||1}};return void this._addBreadcrumbEvent(t,s)}if(o>1){const e={type:"default",message:i.message,timestamp:i.timestamp,category:"ui.multiClick",data:{...i.data,url:Re.location.href,route:t.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=(0,M.wg)(()=>this._checkClicks(),1e3)}}const ur=["A","BUTTON","INPUT"];function dr(){return Date.now()/1e3}function hr(e,t){try{if(!function(e){return 3===e.type}(t))return;const{source:n}=t.data;if(cr.has(n)&&e.registerMutation(t.timestamp),n===rn.Scroll&&e.registerScroll(t.timestamp),function(e){return e.data.source===rn.MouseInteraction}(t)){const{type:n,id:r}=t.data,s=Xn.mirror.getNode(r);s instanceof HTMLElement&&n===sn.Click&&e.registerClick(s)}}catch{}}function pr(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var mr=(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",e))(mr||{});const fr=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]),gr=new Set([...fr,"data-sentry-element"]);function yr(e){const t={};for(const n in e)if(fr.has(n)){let r=n;"data-testid"!==n&&"data-test-id"!==n||(r="testId"),t[r]=e[n]}return!t["data-sentry-component"]&&e["data-sentry-element"]&&(t["data-sentry-component"]=e["data-sentry-element"]),t}const Sr=e=>t=>{if(!e.isEnabled())return;const n=function(e){const{target:t,message:n}=function(e){const t="click"===e.name;let n,r=null;try{r=t?sr(e.event):or(e.event),n=(0,x.H)(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}(e);return pr({category:`ui.${e.name}`,...kr(t,n)})}(t);if(!n)return;const r="click"===t.name,s=r?t.event:void 0;var o,i,a;!(r&&e.clickDetector&&s?.target)||s.altKey||s.metaKey||s.ctrlKey||s.shiftKey||(o=e.clickDetector,i=n,a=sr(t.event),o.handleClick(i,a)),nr(e,n)};function kr(e,t){const n=Xn.mirror.getId(e),r=n&&Xn.mirror.getNode(n),s=r&&Xn.mirror.getMeta(r),o=s&&function(e){return e.type===mr.Element}(s)?s:null;return{message:t,data:o?{nodeId:n,node:{id:n,tagName:o.tagName,textContent:Array.from(o.childNodes).map(e=>
1e.type===mr.Text&&e.textContent).filter(Boolean).map(e=>e.trim()).join(""),attributes:yr(o.attributes)}}:{}}}function vr(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=function(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:o,target:i}=e;if(!i||function(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable}(i)||!o)return null;const a=t||r||s,c=1===o.length;if(!a&&c)return null;const l=(0,x.H)(i,{maxStringLength:200})||"<unknown>",u=kr(i,l);return pr({category:"ui.keyDown",message:l,data:{...u.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:o}})}(t);n&&nr(e,n)}const br={resource:function(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:o,decodedBodySize:i,encodedBodySize:a,responseStatus:c,transferSize:l}=e;if(["fetch","xmlhttprequest"].includes(n))return null;return{type:`${t}.${n}`,start:Ir(o),end:Ir(s),name:r,data:{size:l,statusCode:c,decodedBodySize:i,encodedBodySize:a}}},paint:function(e){const{duration:t,entryType:n,name:r,startTime:s}=e,o=Ir(s);return{type:n,name:r,start:o,end:o+t,data:void 0}},navigation:function(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:o,encodedBodySize:i,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:l,loadEventStart:u,loadEventEnd:d,redirectCount:h,startTime:p,transferSize:m,type:f}=e;if(0===s)return null;return{type:`${t}.${f}`,start:Ir(p),end:Ir(o),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:i,duration:s,domInteractive:l,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:u,loadEventEnd:d,domComplete:o,redirectCount:h}}}};function wr(e,t){return n=>{let{metric:r}=n;t.replayPerformanceEntries.push(e(r))}}function _r(e){const t=br[e.entryType];return t?t(e):null}function Ir(e){return(((0,c.k3)()||Re.performance.timeOrigin)+e)/1e3}function Cr(e){const t=e.entries[e.entries.length-1];return xr(e,"largest-contentful-paint",t?.element?[t.element]:void 0)}function Er(e){return void 0!==e.sources}function Tr(e){const t=[],n=[];for(const r of e.entries)if(Er(r)){const e=[];for(const t of r.sources)if(t.node){n.push(t.node);const r=Xn.mirror.getId(t.node);r&&e.push(r)}t.push({value:r.value,nodeIds:e.length?e:void 0})}return xr(e,"cumulative-layout-shift",n,t)}function Mr(e){const t=e.entries[e.entries.length-1];return xr(e,"interaction-to-next-paint",t?.target?[t.target]:void 0)}function xr(e,t,n,r){const s=e.value,o=e.rating,i=Ir(s);return{type:"web-vital",name:t,start:i,end:i,data:{value:s,size:s,rating:o,nodeIds:n?n.map(e=>Xn.mirror.getId(e)):void 0,attributions:r}}}function Rr(e){function t(t){e.performanceEntries.includes(t)||e.performanceEntries.push(t)}function n(e){let{entries:n}=e;n.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(e=>{r.push(fe(e,n))}),r.push(function(e){return ve("lcp",e,Se,pe,arguments.length>1&&void 0!==arguments[1]&&arguments[1])}(wr(Cr,e)),function(e){return ve("cls",e,ye,he,arguments.length>1&&void 0!==arguments[1]&&arguments[1])}(wr(Tr,e)),ve("inp",wr(Mr,e),ke,me)),()=>{r.forEach(e=>e())}}const Ar="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;const Or=["log","warn","error"],Dr="[Replay] ";function Lr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";(0,l.Z)({category:"console",data:{logger:"replay"},level:t,message:`${Dr}${e}`},{level:t})}const Nr=function(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:n=>{e=!!n.captureExceptions,t=!!n.traceInternals}};return Ar?(Or.forEach(e=>{n[e]=function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];u.Yz[e](Dr,...r),t&&Lr(r.join(""),(0,d.t)(e))}}),n.exception=function(s){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];i.length&&n.error&&n.error(...i),u.Yz.error(Dr,s),e?(0,r.Cp)(s,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&Lr(s,"error")},n.infoTick=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];u.Yz.log(Dr,...n),t&&setTimeout(()=>Lr(n[0]),0)}):Or.forEach(e=>{n[e]=()=>{}}),n}();class Fr extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}}
1class Pr extends Error{constructor(){super("Worker destroyed")}}class Br{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){const t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>Pe)throw new Fr;this.events.push(e)}finish(){return new Promise(e=>{const t=this.events;this.clear(),e(JSON.stringify(t))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=null;for(const{timestamp:t}of this.events)(null===e||t<e)&&(e=t);return null===e?e:er(e)}}class Ur{constructor(e){this._onMessage=e=>{let{data:t}=e;const n=t;if("number"!==typeof n.id)return;const r=this._pending.get(n.id);if(r&&r.method===n.method){if(this._pending.delete(n.id),!n.success)return Ar&&Nr.error("Error in compression worker: ",n.response),void r.reject(new Error("Error in compression worker"));r.resolve(n.response)}},this._worker=e,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise||(this._ensureReadyPromise=new Promise((e,t)=>{this._worker.addEventListener("message",n=>{let{data:r}=n;r.success?e():(Ar&&Nr.warn("Received worker message with unsuccessful status",r),t(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",e=>{Ar&&Nr.warn("Failed to load Replay compression worker",e),t(new Error(`Failed to load Replay compression worker: ${e instanceof ErrorEvent&&e.message?e.message:"Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load."}`))},{once:!0})})),this._ensureReadyPromise}destroy(){Ar&&Nr.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(e=>e.reject(new Pr)),this._pending.clear(),this._worker.terminate()}postMessage(e,t){const n=this._getAndIncrementId();return new Promise((r,s)=>{this._pending.set(n,{method:e,resolve:r,reject:s});try{this._worker.postMessage({id:n,method:e,arg:t})}catch(o){this._pending.delete(n),s(o)}})}_getAndIncrementId(){return this._id++}}class zr{constructor(e){this._worker=new Ur(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){const t=er(e.timestamp);(!this._earliestTimestamp||t<this._earliestTimestamp)&&(this._earliestTimestamp=t);const n=JSON.stringify(e);return this._totalSize+=n.length,this._totalSize>Pe?Promise.reject(new Fr):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{Ar&&Nr.exception(e,'Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class Wr{constructor(e){this._fallback=new Br,this._compression=new zr(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){return void(Ar&&Nr.exception(e,"Failed to load the compression worker, falling back to simple buffer"))}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:t,waitForCheckout:n}=this._fallback,r=[];for(const o of e)r.push(this._compression.addEvent(o));this._compression.hasCheckout=t,this._compression.waitForCheckout=n,this._used=this._compression;try{await Promise.all(r),this._fallback.clear()}catch(s){if(s instanceof Pr)return;Ar&&Nr.exception(s,"Failed to add events when switching buffers.")}}}function jr(e){let{useCompression:t,workerUrl:n}=e;if(t&&window.Worker){const e=function(e){try{const t=e||function(){if("undefined"===typeof __SENTRY_EXCLUDE_REPLAY_WORKER__||!__SENTRY_EXCLUDE_REPLAY_WORKER__)return function(){const e=new Blob(['
vendor: 10,329 bytes, line 1
1var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([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]),i=new t([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]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});
1'],{type:"text/javascript"});return URL.createObjectURL(e)}();return""}();if(!t)return;Ar&&Nr.log("Using compression worker"+(e?` from ${e}`:""));const n=new Worker(t);return new Wr(n)}catch(t){Ar&&Nr.exception(t,"Failed to create compression worker")}}(n);if(e)return e}return Ar&&Nr.log("Using simple buffer"),new Br}function Hr(){try{return"sessionStorage"in Re&&!!Re.sessionStorage}catch{return!1}}function $r(e){!function(){if(!Hr())return;try{Re.sessionStorage.removeItem(Ae)}catch{}}(),e.session=void 0}function qr(e){return void 0!==e&&Math.random()<e}function Kr(e){if(Hr())try{Re.sessionStorage.setItem(Ae,JSON.stringify(e))}catch{}}function Vr(e){const t=Date.now();return{id:e.id||(0,h.eJ)(),started:e.started||t,lastActivity:e.lastActivity||t,segmentId:e.segmentId||0,sampled:e.sampled,previousSessionId:e.previousSessionId,dirty:e.dirty||!1}}function Jr(e){let{sessionSampleRate:t,allowBuffering:n,stickySession:r=!1}=e,{previousSessionId:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=function(e,t){return qr(e)?"session":!!t&&"buffer"}(t,n),i=Vr({sampled:o,previousSessionId:s});return r&&Kr(i),i}function Yr(e,t){return null===e||void 0===t||t<0||0!==t&&e+t<=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:+new Date)}function Gr(e,t){let{sessionIdleExpire:n,maxReplayDuration:r}=t;return!!function(e,t){let{maxReplayDuration:n,sessionIdleExpire:r,targetTime:s=Date.now()}=t;return Yr(e.started,n,s)||Yr(e.lastActivity,r,s)}(e,{sessionIdleExpire:n,maxReplayDuration:r})&&("buffer"!==e.sampled||0!==e.segmentId)}function Xr(e,t){let{sessionIdleExpire:n,maxReplayDuration:r,previousSessionId:s}=e;const o=t.stickySession&&function(){if(!Hr())return null;try{const e=Re.sessionStorage.getItem(Ae);if(!e)return null;const t=JSON.parse(e);return Ar&&Nr.infoTick("Loading existing session"),Vr(t)}catch{return null}}();return o?Gr(o,{sessionIdleExpire:n,maxReplayDuration:r})?(Ar&&Nr.infoTick("Session in sessionStorage is expired, creating new one..."),Jr(t,{previousSessionId:o.id})):o:(Ar&&Nr.infoTick("Creating new session"),Jr(t,{previousSessionId:s}))}function Qr(e,t,n){return!!es(e,t)&&(Zr(e,t,n),!0)}async function Zr(e,t,n){const{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;const s="buffer"===e.recordingMode;try{n&&s&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const o=function(e,t){try{if("function"===typeof t&&function(e){return e.type===nn.Custom}(e))return t(e)}catch(n){return Ar&&Nr.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}(t,e.getOptions().beforeAddRecordingEvent);if(!o)return;return await r.addEvent(o)}catch(o){if(!e.isEnabled())return e.handleException(o),null;const t=o&&o instanceof Fr,n=t?"eventBufferOverflow":"eventBufferError",i=(0,p.KU)();if(i){const e=t?"buffer_overflow":"internal_sdk_error";i.recordDroppedEvent(e,"replay")}if(t&&s)return r.clear(),r.waitForCheckout=!0,null;e.handleException(o),await e.stop({reason:n})}}function es(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=er(t.timestamp);return!(n+e.timeouts.sessionIdlePause<Date.now())&&(!(n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration)||(Ar&&Nr.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1))}function ts(e,t,n){const r=e.getContext();t&&r.traceIds.size<100&&r.traceIds.add(t),n&&r.segmentNames.size<100&&r.segmentNames.add(n)}function ns(e){return!e.type}function rs(e){return"transaction"===e.type}function ss(e){return"feedback"===e.type}function os(e){return(t,n)=>{if(!e.isEnabled()||!ns(t)&&!rs(t))return;const r=n.statusCode;!r||r<200||r>=300||(rs(t)?function(e,t){ts(e,t.contexts?.trace?.trace_id,t.transaction)}(e,t):function(e,t){const n=e.getContext();t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id);if("buffer"!==e.recordingMode||!t.tags?.replayId)return;const{beforeErrorSampling:r}=e.getOptions();if("function"===typeof r&&!r(t))return;(0,M.wg)(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(Qs){e.handleException(Qs)}})}(e,t))}}function is(e){return t=>{e.isEnabled()&&ns(t)&&function(e,t){const n=t.exception?.values?.[0]?.value;if("string"!==typeof n)return;if(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i)){nr(e,pr({category:"replay.hydrate-error",data:{url:(0,m.$N)()}}))}}(e,t)}}function as(e){const t=(0,p.KU)();t&&t.on("beforeAddBreadcrumb",t=>function(e,t){if(!e.isEnabled()||!cs(t))return;const n=function(e){if(!cs(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui."))return null;if("console"===e.category)return function(e){const t=e.data?.arguments;if(!Array.isArray(t)||0===t.length)return pr(e);let n=!1;const r=t.map(e=>{if(!e)return e;if("string"===typeof e)return e.length>Fe?(n=!0,`${e.slice(0,Fe)}\u2026`):e;if("object"===typeof e)try{const t=(0,o.S8)(e,7);return JSON.stringify(t).length>Fe?(n=!0,`${JSON.stringify(t,null,2).slice(0,Fe)}\u2026`):t}catch{}return e});return pr({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(e);return pr(e)}(t);n&&nr(e,n)}(e,t))}function cs(e){return!!e.category}function ls(){const e=(0,p.o5)().getPropagationContext().dsc;e&&delete e.replay_id;const t=(0,f.Bk)();if(t){delete(0,g.k1)(t).replay_id}}function us(e){const t=(0,p.o5)().getPropagationContext().dsc;t&&(t.replay_id=e);const n=(0,f.Bk)();if(n){(0,g.k1)(n).replay_id=e}}function ds(e){return Object.assign((t,n)=>{if(e.session&&Gr(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire}
1)&&ls(),!e.isEnabled()||e.isPaused())return t;if(function(e){return"replay_event"===e.type}(t))return delete t.breadcrumbs,t;if(!ns(t)&&!rs(t)&&!ss(t))return t;if(!e.checkAndHandleExpiredSession())return ls(),t;if(ss(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),function(e,t){e.triggerUserActivity(),e.addUpdate(()=>!t.timestamp||(e.throttledAddEvent({type:nn.Custom,timestamp:1e3*t.timestamp,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1))}(e,t),t;if(function(e,t){return!(e.type||!e.exception?.values?.length)&&!!t.originalException?.__rrweb__}(t,n)&&!e.getOptions()._experiments.captureExceptions)return Ar&&Nr.log("Ignoring error from rrweb internals",t),null;const r=function(e,t){return"buffer"===e.recordingMode&&t.message!==Oe&&!(!t.exception||t.type)&&qr(e.getOptions().errorSampleRate)}(e,t);if((r||"session"===e.recordingMode)&&(t.tags={...t.tags,replayId:e.getSessionId()}),r&&"buffer"===e.recordingMode&&"buffer"===e.session?.sampled){const t=e.session;t.dirty=!0,e.getOptions().stickySession&&Kr(t)}return t},{id:"Replay"})}function hs(e,t){return t.map(t=>{let{type:n,start:r,end:s,name:o,data:i}=t;const a=e.throttledAddEvent({type:nn.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:o,startTimestamp:r,endTimestamp:s,data:i}}});return"string"===typeof a?Promise.resolve(null):a})}function ps(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}(t);null!==n&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(hs(e,[n]),!1)))}}function ms(e,t){e.isEnabled()&&null!==t&&(function(e,t){return(!Ar||!e.getOptions()._experiments.traceInternals)&&S(t,(0,p.KU)())}(e,t.name)||e.addUpdate(()=>(hs(e,[t]),!0)))}function fs(e){if(!e)return;const t=new TextEncoder;try{if("string"===typeof e)return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const n=Ie(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function gs(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function ys(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function Ss(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:o,statusCode:i,request:a,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:s,data:{method:o,statusCode:i,request:a,response:c}}}function ks(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function vs(e,t,n){if(!t&&0===Object.keys(e).length)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:s,warnings:o}=function(e){if(!e||"string"!==typeof e)return{body:e};const t=e.length>Ne,n=function(e){const t=e[0],n=e[e.length-1];return"["===t&&"]"===n||"{"===t&&"}"===n}(e);if(t){const t=e.slice(0,Ne);return n?{body:t,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${t}\u2026`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}(n);return r.body=s,o?.length&&(r._meta={warnings:o}),r}function bs(e,t){return Object.entries(e).reduce((n,r)=>{let[s,o]=r;const i=s.toLowerCase();return t.includes(i)&&e[s]&&(n[i]=o),n},{})}function ws(e,t){const n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Re.document.baseURI;if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(Re.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;if(!e.endsWith("/")&&r.endsWith("/"))return r.slice(0,-1);return r}(e);return(0,v.Xr)(n,t)}
1async function _s(e,t,n){try{const r=await async function(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:o=r}=t,{url:i,method:a,status_code:c=0,request_body_size:l,response_body_size:u}=e.data,d=ws(i,n.networkDetailAllowUrls)&&!ws(i,n.networkDetailDenyUrls),h=d?function(e,t,n){let{networkCaptureBodies:r,networkRequestHeaders:s}=e;const o=t?function(e,t){if(1===e.length&&"string"!==typeof e[0])return Cs(e[0],t);if(2===e.length)return Cs(e[1],t);return{}}(t,s):{};if(!r)return vs(o,n,void 0);const i=Ee(t),[a,c]=Ce(i,Nr),l=vs(o,n,a);if(c)return ys(l,c);return l}(n,t.input,l):ks(l),p=await async function(e,t,n,r){let{networkCaptureBodies:s,networkResponseHeaders:o}=t;if(!e&&void 0!==r)return ks(r);const i=n?Is(n.headers,o):{};if(!n||!s&&void 0!==r)return vs(i,r,void 0);const[a,c]=await async function(e){const t=function(e){try{return e.clone()}catch(t){Ar&&Nr.exception(t,"Failed to clone response body")}}(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{const e=await function(e){return new Promise((t,n)=>{const r=(0,M.wg)(()=>n(new Error("Timeout while trying to read response body")),500);(async function(e){return await e.text()})(e).then(e=>t(e),e=>n(e)).finally(()=>clearTimeout(r))})}(t);return[e]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(Ar&&Nr.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(Ar&&Nr.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}(n),l=function(e,t){let{networkCaptureBodies:n,responseBodySize:r,captureDetails:s,headers:o}=t;try{const t=e?.length&&void 0===r?fs(e):r;return s?vs(o,t,n?e:void 0):ks(t)}catch(i){return Ar&&Nr.exception(i,"Failed to serialize response body"),vs(o,r,void 0)}}(a,{networkCaptureBodies:s,responseBodySize:r,captureDetails:e,headers:i});if(c)return ys(l,c);return l}(d,n,t.response,u);return{startTimestamp:s,endTimestamp:o,url:i,method:a,statusCode:c,request:h,response:p}}(e,t,n),s=Ss("resource.fetch",r);ms(n.replay,s)}catch(r){Ar&&Nr.exception(r,"Failed to capture fetch breadcrumb")}}function Is(e,t){const n={};return t.forEach(t=>{e.get(t)&&(n[t]=e.get(t))}),n}function Cs(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?Is(n,t):Array.isArray(n)?{}:bs(n,t):{}}async function Es(e,t,n){try{const r=function(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:o=r,input:a,xhr:c}=t,{url:l,method:d,status_code:h=0,request_body_size:p,response_body_size:m}=e.data;if(!l)return null;if(!c||!ws(l,n.networkDetailAllowUrls)||ws(l,n.networkDetailDenyUrls)){return{startTimestamp:s,endTimestamp:o,url:l,method:d,statusCode:h,request:ks(p),response:ks(m)}}const f=c[Te.Er],g=f?bs(f.request_headers,n.networkRequestHeaders):{},y=bs(function(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return A.T&&u.Yz.error(n,"Failed to get xhr response headers",e),{}}return t?t.split("\r\n").reduce((e,t)=>{const[n,r]=t.split(": ");return r&&(e[n.toLowerCase()]=r),e},{}):{}}(c),n.networkResponseHeaders),[S,k]=n.networkCaptureBodies?Ce(a,Nr):[void 0],[v,b]=n.networkCaptureBodies?function(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return function(e,t){try{if("string"===typeof e)return[e];if(e instanceof Document)return[e.body.outerHTML];if("json"===t&&(0,i.Z4)(e))return[JSON.stringify(e)];if(!e)return[void 0]}catch(n){return Ar&&Nr.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Ar&&Nr.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}(e.response,e.responseType)}catch(n){t.push(n)}return Ar&&Nr.warn("Failed to get xhr response body",...t),[void 0]}(c):[void 0],w=vs(g,p,S),_=vs(y,m,v);return{startTimestamp:s,endTimestamp:o,url:l,method:d,statusCode:h,request:k?ys(w,k):w,response:b?ys(_,b):_}}(e,t,n),s=Ss("resource.xhr",r);ms(n.replay,s)}catch(r){Ar&&Nr.exception(r,"Failed to capture xhr breadcrumb")}}function Ts(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=fs(r),o=n.getResponseHeader("content-length")?gs(n.getResponseHeader("content-length")):function(e,t){try{return fs("json"===t&&(0,i.Z4)(e)?JSON.stringify(e):e)}catch{return}}(n.response,n.responseType);void 0!==s&&(e.data.request_body_size=s),void 0!==o&&(e.data.response_body_size=o)}function Ms(e){const t=(0,p.KU)();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:i}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:i};t&&t.on("beforeAddBreadcrumb",(e,t)=>function(e,t,n){if(!t.data)return;try{(function(e){return"xhr"===e.category})(t)&&function(e){return e?.xhr}(n)&&(Ts(t,n),Es(t,n,e)),function(e){return"fetch"===e.category}(t)&&function(e){return void 0!==e?.input}(n)&&(!function(e,t){const{input:n,response:r}=t,s=fs(n?Ee(n):void 0),o=r?gs(r.headers.get("content-length")):void 0;void 0!==s&&(e.data.request_body_size=s),void 0!==o&&(e.data.response_body_size=o)}(t,n),_s(t,n,e))}catch(r){Ar&&Nr.exception(r,"Error when enriching network breadcrumb")}}(a,e,t))}catch{}}function xs(e){const t=(0,p.KU)();
1(0,Me.i)(Sr(e)),(0,xe._)(ps(e)),as(e),Ms(e);const n=ds(e);(0,r.SA)(n),t&&(t.on("beforeSendEvent",is(e)),t.on("afterSendEvent",os(e)),t.on("createDsc",t=>{const n=e.getSessionId();if(n&&e.isEnabled()&&"session"===e.recordingMode){e.checkAndHandleExpiredSession()&&(t.replay_id=n)}}),t.on("processSegmentSpan",function(e){return t=>{e.isEnabled()&&ts(e,t.trace_id,t.name||void 0)}}(e)),t.on("spanStart",t=>{e.lastActiveSpan=t}),t.on("spanEnd",t=>{e.lastActiveSpan=t}),t.on("beforeSendFeedback",async(t,n)=>{const r=e.getSessionId();n?.includeReplay&&e.isEnabled()&&r&&t.contexts?.feedback&&("api"===t.contexts.feedback.source&&await e.sendBufferedReplayOrFlush(),t.contexts.feedback.replay_id=r)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}function Rs(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function As(e,t,n){return function(e,t,n){let r,s,o;const i=n?.maxWait?Math.max(n.maxWait,t):0,a=n?.setTimeoutImpl||setTimeout;function c(){return l(),r=e(),r}function l(){void 0!==s&&clearTimeout(s),void 0!==o&&clearTimeout(o),s=o=void 0}function u(){return s&&clearTimeout(s),s=a(c,t),i&&void 0===o&&(o=a(c,i)),r}return u.cancel=l,u.flush=function(){return void 0!==s||void 0!==o?c():r},u}(e,t,{...n,setTimeoutImpl:M.wg})}const Os=s.O.navigator;function Ds(e){let t=!1;return(n,r)=>{try{if(!e.checkAndHandleExpiredSession())return void(Ar&&Nr.warn("Received replay event after session expired."));const s=r||!t;t=!0,function(e){const t=e.data;if(e.type!==nn.IncrementalSnapshot||!t||"object"!==typeof t||!("source"in t)||t.source!==rn.Mutation||!("attributes"in t)||!Array.isArray(t.attributes))return;for(const n of t.attributes){const e=Xn.mirror.getNode(n.id),t=e&&Xn.mirror.getMeta(e);if(!e||t?.type!==mr.Element)continue;const r={...t.attributes};let s=!1;for(const[o,i]of Object.entries(n.attributes))gr.has(o)&&(null===i?delete r[o]:r[o]=i,s=!0);s&&Xn.mirror.add(e,{...t,attributes:r})}}(n),e.clickDetector&&hr(e.clickDetector,n),e.addUpdate(()=>{if("buffer"===e.recordingMode&&s&&e.setInitialState(),!Qr(e,n,s))return!0;if(!s)return!1;const t=e.session;if(function(e,t){if(!t||0!==e.session?.segmentId)return;Qr(e,function(e){const t=e.getOptions();return{type:nn.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:!!e.eventBuffer&&"worker"===e.eventBuffer.type,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}(e),!1)}(e,s),"buffer"===e.recordingMode&&t&&e.eventBuffer&&!t.dirty){const n=e.eventBuffer.getEarliestTimestamp();n&&(Ar&&Nr.log(`Updating session start time to earliest event in buffer to ${new Date(n)}`),t.started=n,e.getOptions().stickySession&&Kr(t))}return t?.previousSessionId||"session"===e.recordingMode&&e.flush(),!0})}catch(s){e.handleException(s)}}}function Ls(e,t,n,r){return(0,b.h4)((0,b.n2)(e,(0,b.Cj)(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:"string"===typeof t?(new TextEncoder).encode(t).length:t.length},t]])}async function Ns(e){let{recordingData:t,replayId:n,segmentId:r,eventContext:s,timestamp:o,session:i}=e;const a=function(e){let t,{recordingData:n,headers:r}=e;const s=`${JSON.stringify(r)}\n`;if("string"===typeof n)t=`${s}${n}`;else{const e=(new TextEncoder).encode(s);t=new Uint8Array(e.length+n.length),t.set(e),t.set(n,e.length)}return t}({recordingData:t,headers:{segment_id:r}}),{urls:c,errorIds:l,traceIds:u,segmentNames:d,initialTimestamp:h}=s,m=(0,p.KU)(),f=(0,p.o5)(),g=m?.getTransport(),y=m?.getDsn();if(!m||!g||!y||!i.sampled)return Promise.resolve({});const S={type:"replay_event",replay_start_timestamp:h/1e3,timestamp:o/1e3,error_ids:l,trace_ids:u,segment_names:d,urls:c,replay_id:n,segment_id:r,replay_type:i.sampled},k=await async function(e){let{client:t,scope:n,replayId:r,event:s}=e;const o={event_id:r,integrations:"object"!==typeof t._integrations||null===t._integrations||Array.isArray(t._integrations)?void 0:Object.keys(t._integrations)};t.emit("preprocessEvent",s,o);const i=await(0,w.mG)(t.getOptions(),s,o,n,t,(0,p.rm)());if(!i)return null;t.emit("postprocessEvent",i,o),i.platform=i.platform||"javascript";
1const a=t.getSdkMetadata(),{name:c,version:l,settings:u}=a?.sdk||{};return i.sdk={...i.sdk,name:c||"sentry.javascript.unknown",version:l||"0.0.0",settings:u},i}({scope:f,client:m,replayId:n,event:S});if(!k)return m.recordDroppedEvent("event_processor","replay"),Ar&&Nr.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete k.sdkProcessingMetadata;const v=Ls(k,a,y,m.getOptions().tunnel);let b;try{b=await g.send(v)}catch(Qs){const t=new Error(Oe);try{t.cause=Qs}catch{}throw t}const I=(0,_.wq)({},b);if((0,_.Jz)(I,"replay"))throw new Ps(I);if("number"===typeof b.statusCode&&(b.statusCode<200||b.statusCode>=300))throw new Fs(b.statusCode);return b}class Fs extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class Ps extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}class Bs extends Error{constructor(){super("Session is too long, not sending replay")}}async function Us(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{count:0,interval:5e3};const{recordingData:n,onError:s}=e;if(n.length)try{return await Ns(e),!0}catch(Qs){if(Qs instanceof Fs||Qs instanceof Ps)throw Qs;if((0,r.o)("Replays",{_retryCount:t.count}),s&&s(Qs),t.count>=3){const e=new Error(`${Oe} - max retries exceeded`);try{e.cause=Qs}catch{}throw e}return t.interval*=++t.count,new Promise((n,r)=>{(0,M.wg)(async()=>{try{await Us(e,t),n(!0)}catch(s){r(s)}},t.interval)})}}const zs="__THROTTLED";function Ws(e,t,n){const r=new Map;let s=!1;return function(){const o=Math.floor(Date.now()/1e3);if((e=>{const t=e-n;r.forEach((e,n)=>{n<t&&r.delete(n)})})(o),[...r.values()].reduce((e,t)=>e+t,0)>=t){const e=s;return s=!0,e?"__SKIPPED":zs}s=!1;const i=r.get(o)||0;return r.set(o,i+1),e(...arguments)}}class js{constructor(e){let{options:t,recordingOptions:n}=e;this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:3e5,sessionIdleExpire:9e5},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,segmentNames:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=t,this._debouncedFlush=As(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Ws((e,t)=>function(e,t,n){return es(e,t)?Zr(e,t,n):Promise.resolve(null)}(this,e,t),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),o=r?{threshold:Math.min(3e3,r),timeout:r,scrollTimeout:300,ignoreSelector:s?s.join(","):""}:void 0;if(o&&(this.clickDetector=new lr(this,o)),Ar){const e=t._experiments;Nr.setConfig({captureExceptions:!!e.captureExceptions,traceInternals:!!e.traceInternals})}this._handleVisibilityChange=()=>{"visible"===Re.document.visibilityState?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const e=pr({category:"ui.blur"});this._doChangeToBackgroundTasks(e)},this._handleWindowFocus=()=>{const e=pr({category:"ui.focus"});this._doChangeToForegroundTasks(e)},this._handleKeyboardEvent=e=>{vr(this,e)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return Boolean(this._canvas)}getOptions(){return this._options}handleException(e){Ar&&Nr.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){const{errorSampleRate:t,sessionSampleRate:n}=this._options,r=t<=0&&n<=0;this._requiresManualStart=r,r||(this._initializeSessionForSampling(e),this.session?!1!==this.session.sampled&&(this.recordingMode="buffer"===this.session.sampled&&0===this.session.segmentId?"buffer":"session",Ar&&Nr.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording()):Ar&&Nr.exception(new Error("Unable to initialize and create session")))}start(){if(this._isEnabled&&"session"===this.recordingMode)return void(Ar&&Nr.log("Recording is already in progress"));if(this._isEnabled&&"buffer"===this.recordingMode)return void(Ar&&Nr.log("Buffering is in progress, call `flush()` to save the replay"));Ar&&Nr.infoTick("Starting replay in session mode"),this._updateUserActivity();
1const e=Xr({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled)return void(Ar&&Nr.log("Buffering is in progress, call `flush()` to save the replay"));Ar&&Nr.infoTick("Starting replay in buffer mode");const e=Xr({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const e=this._canvas;this._stopRecording=Xn({...this._recordingOptions,..."buffer"===this.recordingMode?{checkoutEveryNms:6e4}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:Ds(this),.../iPhone|iPad|iPod/i.test(Os?.userAgent??"")||/Macintosh/i.test(Os?.userAgent??"")&&Os?.maxTouchPoints&&Os?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{},onMutation:this._onMutationHandler.bind(this),...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(Qs){this.handleException(Qs)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(Qs){return this.handleException(Qs),!1}}async stop(){let{forceFlush:e=!1,reason:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";const n=t??"manual";(0,p.KU)()?.emit("replayEnd",{sessionId:this.session?.id,reason:n});try{Ar&&Nr.log(`Stopping Replay triggered by ${n}`),ls(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,$r(this)}catch(Qs){this.handleException(Qs)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Ar&&Nr.log("Pausing replay"))}resume(){this._isPaused&&this._checkSession()&&(this._isPaused=!1,this.startRecording(),Ar&&Nr.log("Resuming replay"))}async sendBufferedReplayOrFlush(){let{continueRecording:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("session"===this.recordingMode)return this.flushImmediate();const t=Date.now();Ar&&Nr.log("Converting buffer to session"),await this.flushImmediate();const n=this.stopRecording();e&&n&&"session"!==this.recordingMode&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession(),us(this.session.id)),this.startRecording())}addUpdate(e){const t=e();"buffer"!==this.recordingMode&&this._isEnabled&&!0!==t&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),this._stopRecording)this.checkAndHandleExpiredSession(),this._updateSessionActivity();else{if(!this._checkSession())return;this.resume()}}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return"buffer"===this.recordingMode?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(e){if(!e||!1!==this.session?.sampled)return this.session?.id}checkAndHandleExpiredSession(){if(!this._lastActivity||!Yr(this._lastActivity,this.timeouts.sessionIdlePause)||"session"!==this.session?.sampled)return!!this._checkSession();this.pause()}setInitialState(){const e=`${Re.location.pathname}${Re.location.hash}${Re.location.search}`,t=`${Re.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){const n=this._throttledAddEvent(e,t);if(n===zs){const e=pr({category:"replay.throttled"});this.addUpdate(()=>!Qr(this,{type:5,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e,metric:!0}}))}return n}getCurrentRoute(){const e=this.lastActiveSpan||(0,f.Bk)(),t=e&&(0,f.zU)(e),n=(t&&(0,f.et)(t).data||{})[I.i_];if(t&&n&&["route","custom"].includes(n))return(0,f.et)(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=jr({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&(0,p.KU)()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),"session"===this.recordingMode&&this.session&&us(this.session.id)}_initializeSessionForSampling(e){const t=this._options.errorSampleRate>0,n=Xr({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=n}_checkSession(){if(!this.session)return!1;const e=this.session;return!Gr(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(e),!1)}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(e.id))}_addListeners(){try{Re.document.addEventListener("visibilitychange",this._handleVisibilityChange),Re.addEventListener("blur",this._handleWindowBlur),Re.addEventListener("focus",this._handleWindowFocus),Re.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(xs(this),this._hasInitializedCoreListeners=!0)}catch(Qs){this.handleException(Qs)}this._performanceCleanupCallback=Rr(this)}_removeListeners(){try{Re.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Re.removeEventListener("blur",this._handleWindowBlur),Re.removeEventListener("focus",this._handleWindowFocus),Re.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(Qs){this.handleException(Qs)}}
1_doChangeToBackgroundTasks(e){if(!this.session)return;Gr(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})?ls():(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(!this.session)return;this.checkAndHandleExpiredSession()?e&&this._createCustomBreadcrumb(e):Ar&&Nr.log("Document has become active, but session has expired")}_updateUserActivity(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this._lastActivity=e}_updateSessionActivity(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:nn.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){let e=(t=this.performanceEntries,t.map(_r).filter(Boolean)).concat(this.replayPerformanceEntries);var t;if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const t=this._context.initialTimestamp/1e3;e=e.filter(e=>e.start>=t)}return Promise.all(hs(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.segmentNames.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:t}=this;if(!e||!t||this._requiresManualStart)return;if(e.segmentId)return;const n=t.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){const e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),segmentNames:Array.from(this._context.segmentNames),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){const e=this.getSessionId();if(this.session&&this.eventBuffer&&e){if(await this._addPerformanceEntries(),this.eventBuffer?.hasEvents&&(await async function(e){try{return Promise.all(hs(e,[Rs(Re.performance.memory)]))}catch{return[]}}(this),this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Bs;const n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession();const s=await this.eventBuffer.finish();await Us({replayId:e,recordingData:s,segmentId:r,eventContext:n,session:this.session,timestamp:t,onError:e=>this.handleException(e)})}catch(Qs){this.handleException(Qs),this.stop({reason:"sendError"});const t=(0,p.KU)();if(t){let n;n=Qs instanceof Ps?"ratelimit_backoff":Qs instanceof Bs?"invalid":"send_error",t.recordDroppedEvent(n,"replay")}}}else Ar&&Nr.error("No session or eventBuffer found to flush.")}async _flush(){let{force:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession())return void(Ar&&Nr.error("Attempting to finish replay event after session expired."));if(!this.session)return;const t=this.session.started,n=Date.now()-t;this._debouncedFlush.cancel();const r=n<this._options.minReplayDuration,s=n>this._options.maxReplayDuration+5e3;if(r||s)return Ar&&Nr.log(`Session duration (${Math.floor(n/1e3)}s) is too ${r?"short":"long"}, not sending replay.`),void(r&&this._debouncedFlush());const o=this.eventBuffer;o&&0===this.session.segmentId&&!o.hasCheckout&&Ar&&Nr.log("Flushing initial segment without checkout.");const i=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(Qs){this.handleException(Qs)}finally{this._flushLock=void 0,i&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Kr(this.session)}_onMutationHandler(e){const{ignoreMutations:t}=this._options._experiments;if(t?.length&&e.some(e=>{const n=function(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}(e.target),r=t.join(",");return n?.matches(r)}))return!1;const n=e.length,r=this._options.mutationLimit,s=r&&n>r;if(n>this._options.mutationBreadcrumbLimit||s){const e=pr({category:"replay.mutations",data:{count:n,limit:s}});this._createCustomBreadcrumb(e)}return!s||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}}function Hs(e,t){return[...e,...t].join(",")}const $s='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',qs=["content-length","content-type","accept"],Ks=Symbol.for("sentry__originalRequestBody");let Vs=!1,Js=!1;const Ys=e=>new Gs(e);class Gs{constructor(){let{flushMinDelay:e=De,flushMaxDelay:t=Le,minReplayDuration:n=Be,maxReplayDuration:r=Ue,stickySession:s=!0,useCompression:o=!0,workerUrl:i,_experiments:a={},maskAllText:c=!0,maskAllInputs:l=!0,blockAllMedia:u=!0,mutationBreadcrumbLimit:d=750,mutationLimit:h=1e4,slowClickTimeout:p=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:f=[],networkDetailDenyUrls:g=[],networkCaptureBodies:y=!0,networkRequestHeaders:S=[],networkResponseHeaders:k=[],mask:v=[],maskAttributes:b=["title","placeholder","aria-label"],unmask:w=[],block:_=[],unblock:I=[],ignore:E=[],maskFn:T,beforeAddRecordingEvent:M,beforeErrorSampling:x,onError:R,attachRawBodyFromRequest:A=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.name="Replay";const O=function(e){let{mask:t,unmask:n,block:r,unblock:s,ignore:o}=e;return{maskTextSelector:Hs(t,[".sentry-mask","[data-sentry-mask]"]),unmaskTextSelector:Hs(n,[]),blockSelector:Hs(r,[".sentry-block","[data-sentry-block]","base","iframe[srcdoc]:not
1([src])"]),unblockSelector:Hs(s,[]),ignoreSelector:Hs(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}({mask:v,unmask:w,block:_,unblock:I,ignore:E});if(this._recordingOptions={maskAllInputs:l,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:T,maskInputFn:T,maskAttributeFn:(e,t,n)=>function(e){let{el:t,key:n,maskAttributes:r,maskAllText:s,privacyOptions:o,value:i}=e;if(o.unmaskTextSelector&&t.matches(o.unmaskTextSelector))return i;const a=r.includes(n),c=s&&"value"===n&&"INPUT"===t.tagName&&["submit","button"].includes(t.getAttribute("type")||"");return a||c?i.replace(/[\S]/g,"*"):i}({maskAttributes:b,maskAllText:c,privacyOptions:O,key:e,value:t,el:n}),...O,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:e=>{try{e.__rrweb__=!0}catch{}},recordCrossOriginIframes:Boolean(a.recordCrossOriginIframes)},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,5e4),maxReplayDuration:Math.min(r,Ue),stickySession:s,useCompression:o,workerUrl:i,blockAllMedia:u,maskAllInputs:l,maskAllText:c,mutationBreadcrumbLimit:d,mutationLimit:h,slowClickTimeout:p,slowClickIgnoreSelectors:m,networkDetailAllowUrls:f,networkDetailDenyUrls:g,networkCaptureBodies:y,networkRequestHeaders:Xs(S),networkResponseHeaders:Xs(k),beforeAddRecordingEvent:M,beforeErrorSampling:x,onError:R,attachRawBodyFromRequest:A,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${$s}`:$s,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&(0,C.B)())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Vs}set _isInitialized(e){Vs=e}afterAllSetup(e){(0,C.B)()&&!this._replay&&(this._initialOptions.attachRawBodyFromRequest&&function(){if("undefined"===typeof Request||Js)return;const e=Request;try{const t=function(t,n){const r=new e(t,n);return null!=n?.body&&(r[Ks]=n.body),r};t.prototype=e.prototype,s.O.Request=t,Js=!0}catch{}}(),this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(e){return this._replay?this._replay.stop({forceFlush:e?.flush??"session"===this._replay.recordingMode,reason:"manual"}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(e){if(this._replay?.isEnabled())return this._replay.getSessionId(e)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(e){const t=this.getReplayId(!0);t&&((0,E.FD)(e,{"sentry.replay_id":t}),"buffer"===this.getRecordingMode()&&(0,E.FD)(e,{"sentry._internal.replay_is_buffering":!0}))}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){const t=function(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},s=(0,T.i)(n.replaysSessionSampleRate),o=(0,T.i)(n.replaysOnErrorSampleRate);null==s&&null==o&&(0,u.pq)(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")});null!=s&&(r.sessionSampleRate=s);null!=o&&(r.errorSampleRate=o);return r}(this._initialOptions,e);this._replay=new js({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{const t=e.getIntegrationByName("ReplayCanvas");if(!t)return;this._replay._canvas=t.getOptions()}catch{}}}function Xs(e){return[...qs,...e.map(e=>e.toLowerCase())]}}}]); 2//# sourceMappingURL=sentry-replay.d9f6cda6.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.