@abyss-project/monitor-browser 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkLRYKS5XRjs = require('./chunk-LRYKS5XR.js');var _chunkTJIA62OAjs = require('./chunk-TJIA62OA.js');var _chunk2TDEJLQ7js = require('./chunk-2TDEJLQ7.js');var _chunkKD6VO7IKjs = require('./chunk-KD6VO7IK.js');var Se=t=>t===null?null:typeof t=="string"&&t.trim()!==""?t:void 0;var be=50,D=class{constructor(){this.session={};this.pageViewId=null;this.page={}}add(e,s,n){if(s==null)return n(),!1;let r=!1,o=()=>{r=!0,n()},i={[String(e)]:s};return this.session=_chunkTJIA62OAjs.a.call(void 0, this.session,i,o,be),r||(this.page=_chunkTJIA62OAjs.a.call(void 0, this.page,i,o,be)),!r}hasAny(){return Object.keys(this.session).length>0}annotate(e){e.id!==this.pageViewId&&(this.pageViewId!==null&&(this.page={}),this.pageViewId=e.id),Object.keys(this.page).length>0&&(e.featureFlags={...this.page})}};var ze=64,we=(t,e,s,n)=>{if(typeof t!="string"||t.length===0||t.length>ze)return n(),null;let r={id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"action",pageViewId:s,occurredAt:_chunk2TDEJLQ7js.a.call(void 0, Date.now()),name:t};if(e!==void 0){let o=_chunkTJIA62OAjs.a.call(void 0, {},e,n);Object.keys(o).length>0&&(r.attributes=o)}return r};var Je=["id","type","sessionId"],Ze=(t,e)=>t==null?e==null||["string","number","boolean"].includes(typeof e):Array.isArray(t)?Array.isArray(e):e!==null&&typeof e==typeof t,te=(t,e,s)=>{if(!e)return t;let n;try{n=e(JSON.parse(JSON.stringify(t)))}catch (e2){return s(),t}if(n===null)return null;if(!n||typeof n!="object"||Array.isArray(n))return s(),null;let r=t,o=n,i={};for(let a of Object.keys(r))if(Je.includes(a))i[a]=r[a];else if(Ze(r[a],o[a]))o[a]!==void 0&&(i[a]=o[a]);else return s(),null;return i};var et=/^([a-z][a-z0-9+.-]*:)\/\//i,tt=["url","blockedUri","sourceFile"],st=["route","referrerRoute","entryPath"],se=t=>{let{host:e,path:s}=_chunkKD6VO7IKjs.d.call(void 0, t);if(e===null)return s;let n=et.exec(t.trim());return`${n?n[1].toLowerCase():"https:"}//${e}${s}`},x=t=>_chunkKD6VO7IKjs.d.call(void 0, t).path,ne=t=>{let e=t;for(let s of tt)typeof e[s]=="string"&&(e[s]=se(e[s]));for(let s of st)typeof e[s]=="string"&&(e[s]=x(e[s]));return t};var nt=20,rt=256,ke='[data-abyss-privacy="hidden"]',ot=`${ke},[data-testid],[aria-label],button,a,input,select,textarea,summary,[role="button"],[role="link"]`,Ie=(t,e)=>{let s=t.getAttribute(e);return s===null?null:s.slice(0,rt)},re=t=>{var s,n;let e=(n=((s=t.closest(ke))!=null?s:t).closest(ot))!=null?n:t;return{tag:e.tagName.toLowerCase().slice(0,64),testId:Ie(e,"data-testid"),ariaLabel:Ie(e,"aria-label")}},q=class{constructor(){this.items=[];this.lastPageViewId=null}observe(e){e.type==="pageView"&&e.id!==this.lastPageViewId?(this.lastPageViewId=e.id,this.add({kind:"NAVIGATION",route:x(e.route)})):e.type==="request"&&e.kind!=="WEBSOCKET"&&e.kind!=="SSE"&&this.add({kind:"REQUEST",method:e.method,url:se(e.url),status:e.status})}click(e){e instanceof Element&&this.add({kind:"CLICK",element:re(e)})}snapshot(){return this.items.map(e=>({...e}))}add(e){this.items.push({...e,occurredAt:_chunk2TDEJLQ7js.a.call(void 0, Date.now())}),this.items.length>nt&&this.items.shift()}};var it=/^\s*at\s|@\S+:\d+/,at=t=>{var e,s;return(s=(e=(t!=null?t:"").split(`
2
- `).find(n=>it.test(n)))==null?void 0:e.trim())!=null?s:""},W=class{constructor(e){this.release=e;this.held=new Map}add(e){var r;let s=`${(r=e.pageViewId)!=null?r:""}${e.message}${at(e.stack)}`,n=this.held.get(s);if(n){n.event.repeat+=1;return}this.held.set(s,{event:e,timer:setTimeout(()=>this.releaseKey(s),1e4)})}flush(){[...this.held.keys()].forEach(e=>this.releaseKey(e))}clear(){this.held.forEach(e=>clearTimeout(e.timer)),this.held.clear()}releaseKey(e){let s=this.held.get(e);s&&(clearTimeout(s.timer),this.held.delete(e),this.release(s.event))}};var ut=/^ResizeObserver loop/,dt=/^Script error\.?$/,lt=t=>{let e=t;return e&&typeof e=="object"&&typeof e.message=="string"?{name:typeof e.name=="string"&&e.name?e.name:"Error",message:e.message,stack:typeof e.stack=="string"?e.stack:null}:{name:"Error",message:_chunk2TDEJLQ7js.c.call(void 0, t),stack:null}},ct=t=>{if(!t||typeof t!="object")return;let e=Object.entries(t).filter(([,s])=>typeof s=="string");return e.length>0?Object.fromEntries(e):void 0},pt=t=>ut.test(t.message)||dt.test(t.message)&&!t.stack,j=class{constructor(e){this.host=e;this.breadcrumbs=new q;this.pageViewId=null;this.dedup=new W(s=>e.record(s))}capture(e,s){let n=lt(e);if(pt(n)){this.host.drop();return}this.host.captured();let r=ct(s);this.dedup.add({id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"error",pageViewId:this.host.pageViewId(),occurredAt:_chunk2TDEJLQ7js.a.call(void 0, Date.now()),route:this.host.resolveRoute(),...n,breadcrumbs:this.breadcrumbs.snapshot(),repeat:1,...r?{context:r}:{}})}observe(e){this.breadcrumbs.observe(e),e.type==="pageView"&&e.id!==this.pageViewId&&(this.pageViewId!==null&&this.dedup.flush(),this.pageViewId=e.id)}install(){let e=n=>()=>{try{n()}catch (e3){this.host.drop()}},s=[_chunk2TDEJLQ7js.d.call(void 0, window,"error",n=>{n.target instanceof Element||e(()=>{var r;return this.capture((r=n.error)!=null?r:n.message)})()}),_chunk2TDEJLQ7js.d.call(void 0, window,"unhandledrejection",n=>e(()=>this.capture(n.reason))()),_chunk2TDEJLQ7js.d.call(void 0, window,"click",n=>e(()=>this.breadcrumbs.click(n.target))(),!0),_chunk2TDEJLQ7js.d.call(void 0, window,"pagehide",e(()=>this.dedup.flush())),_chunk2TDEJLQ7js.d.call(void 0, document,"visibilitychange",e(()=>{document.visibilityState==="hidden"&&this.dedup.flush()}))];return()=>{s.forEach(n=>n()),this.dedup.clear()}}};var ht=123,ie=(t,e,s)=>{let n=_chunkTJIA62OAjs.c.call(void 0, String(s));if(!n)return null;let r=n.href,o=null;_chunkTJIA62OAjs.e.call(void 0, t,n)&&(o=_chunk2TDEJLQ7js.k.call(void 0, ),n.searchParams.set(_chunkKD6VO7IKjs.g,o),n.searchParams.set(_chunkKD6VO7IKjs.h,t.sessionId()));let i=Date.now(),a=_chunkTJIA62OAjs.h.call(void 0, t,e,"GET",r,i,o);Object.assign(a,{connectMs:null,messagesIn:0,messagesOut:0,bytesIn:0,bytesOut:0,droppedMessages:0});let p={event:a,startedAt:i,opened:!1,dirty:!0,done:!1};return t.trackConnection(p),{connection:p,nativeUrl:o===null?String(s):n.href}},ae=t=>{t.opened||(t.opened=!0,t.event.connectMs=Date.now()-t.startedAt,t.dirty=!0)},K=(t,e,s)=>{var r,o,i,a;let{event:n}=t;e==="in"?(n.messagesIn=((r=n.messagesIn)!=null?r:0)+1,n.bytesIn=((o=n.bytesIn)!=null?o:0)+_chunk2TDEJLQ7js.g.call(void 0, s)):(n.messagesOut=((i=n.messagesOut)!=null?i:0)+1,n.bytesOut=((a=n.bytesOut)!=null?a:0)+_chunk2TDEJLQ7js.g.call(void 0, s)),t.dirty=!0},X=(t,e)=>{t.done||(t.event.durationMs=Date.now()-t.startedAt,t.event.outcome=e,t.done=!0,t.dirty=!0)},Ae=(t,e)=>({direction:t,data:e,at:Date.now(),eventName:null,eventId:null}),ft=(t,e,s,n)=>{if(s)return"ABORTED";if(t&&(e===1e3||e===1001||n&&e===1005))return"SUCCESS";let r=_chunkTJIA62OAjs.f.call(void 0, );return r==="OFFLINE"||!t?r:"HTTP_ERROR"},Te=t=>{let e=window.WebSocket;if(typeof e!="function")return()=>{};let s=e.prototype,n=s.send,r=s.close,o=new WeakMap,i=(u,d)=>{o.set(u,d),u.addEventListener("open",()=>ae(d)),u.addEventListener("message",c=>{K(d,"in",c.data),t.socketMessage(d,Ae("IN",c.data))}),u.addEventListener("close",c=>{let h=o.get(u);d.event.closeCode=c.code,d.event.closeReason=c.reason?_chunk2TDEJLQ7js.f.call(void 0, c.reason,ht):null,X(d,ft(d.opened,c.code,(h==null?void 0:h.abortedByApp)===!0,(h==null?void 0:h.closedByApp)===!0)),t.socketClosed(d)})},a=new Proxy(e,{construct(u,d,c){let h=null;try{h=ie(t,"WEBSOCKET",d[0])}catch (e4){t.drop()}let y=h?[h.nativeUrl,...d.slice(1)]:d,m=Reflect.construct(u,y,c===a?u:c);return h&&i(m,h.connection),m}}),p=function(u){n.call(this,u);let d=o.get(this);d&&(K(d,"out",u),t.socketMessage(d,Ae("OUT",u)))},l=function(u,d){let c=o.get(this);return c&&(c.abortedByApp=this.readyState===e.CONNECTING,c.closedByApp=!0),r.apply(this,arguments)};return window.WebSocket=a,s.send=p,s.close=l,()=>{window.WebSocket===a&&(window.WebSocket=e),s.send===p&&(s.send=n),s.close===l&&(s.close=r)}};var Oe=t=>{let e=window,s=e.EventSource;if(typeof s!="function")return()=>{};let n=s.prototype,r=n.close,o=new WeakMap,i=(l,u)=>{o.set(l,u),u.event.reconnectCount=0,l.addEventListener("open",()=>ae(u)),l.addEventListener("message",d=>{K(u,"in",d.data),t.socketMessage(u,{direction:"IN",data:d.data,at:Date.now(),eventName:d.type,eventId:d.lastEventId||null})}),l.addEventListener("error",()=>{var c;if(l.readyState===s.CONNECTING){u.event.reconnectCount=((c=u.event.reconnectCount)!=null?c:0)+1,u.dirty=!0;return}let d=_chunkTJIA62OAjs.f.call(void 0, );X(u,u.opened&&d!=="OFFLINE"?"HTTP_ERROR":d),t.socketClosed(u)})},a=new Proxy(s,{construct(l,u,d){let c=null;try{c=ie(t,"SSE",u[0])}catch (e5){t.drop()}let h=c?[c.nativeUrl,...u.slice(1)]:u,y=Reflect.construct(l,h,d===a?l:d);return c&&i(y,c.connection),y}}),p=function(){r.call(this);let l=o.get(this);l&&(X(l,l.opened?"SUCCESS":"ABORTED"),t.socketClosed(l))};return e.EventSource=a,n.close=p,()=>{e.EventSource===a&&(e.EventSource=s),n.close===p&&(n.close=r)}};var gt=(t,e,s)=>{var u,d,c;let n=typeof Request!="undefined"&&e instanceof Request?e:null,r=_chunkTJIA62OAjs.c.call(void 0, n?n.url:String(e));if(!r)return null;let o=((d=(u=s==null?void 0:s.method)!=null?u:n==null?void 0:n.method)!=null?d:"GET").toUpperCase(),i=Date.now(),a=null,p=s;if(_chunkTJIA62OAjs.e.call(void 0, t,r)){a=_chunk2TDEJLQ7js.k.call(void 0, );let h=new Headers((c=s==null?void 0:s.headers)!=null?c:n==null?void 0:n.headers);h.set(_chunkKD6VO7IKjs.e,a),h.set(_chunkKD6VO7IKjs.f,t.sessionId()),p={...s,headers:h}}let l=_chunkTJIA62OAjs.h.call(void 0, t,"FETCH",o,r.href,i,a);return t.trackTiming(l.id,r.href,i),{event:l,init:p,startedAt:i}},Rt=(t,e,s)=>{let{event:n}=e;if(n.durationMs=Date.now()-e.startedAt,n.status=s.status,n.outcome=_chunkTJIA62OAjs.g.call(void 0, s.status),n.instrumented||s.status<400){t.record(n);return}s.clone().text().then(r=>{n.responseBodyExcerpt=r.slice(0,_chunkTJIA62OAjs.b),t.record(n)},()=>t.record(n))},Ce=t=>{let e=window.fetch;if(typeof e!="function")return()=>{};let s=(n,r)=>{let o=null;try{o=gt(t,n,r)}catch (e6){t.drop()}let i=e.call(window,n,o?o.init:r);if(o){let a=o;i.then(p=>{try{Rt(t,a,p)}catch (e7){t.drop()}},p=>{a.event.durationMs=Date.now()-a.startedAt,a.event.outcome=_chunkTJIA62OAjs.f.call(void 0, p),t.record(a.event)})}return i};return window.fetch=s,()=>{window.fetch===s&&(window.fetch=e)}};var De=t=>{let e=window.XMLHttpRequest;if(typeof e!="function")return()=>{};let s=e.prototype,n=s.open,r=s.send,o=new WeakMap,i=function(l,u){try{o.set(this,{method:String(l).toUpperCase(),url:String(u)})}catch (e8){t.drop()}return n.apply(this,arguments)},a=(l,u,d)=>{let c=_chunkTJIA62OAjs.c.call(void 0, d);if(!c)return;let h=Date.now(),y=null;_chunkTJIA62OAjs.e.call(void 0, t,c)&&(y=_chunk2TDEJLQ7js.k.call(void 0, ),l.setRequestHeader(_chunkKD6VO7IKjs.e,y),l.setRequestHeader(_chunkKD6VO7IKjs.f,t.sessionId()));let m=_chunkTJIA62OAjs.h.call(void 0, t,"XHR",u,c.href,h,y);t.trackTiming(m.id,c.href,h);let E=null;l.addEventListener("error",()=>E=_chunkTJIA62OAjs.f.call(void 0, )),l.addEventListener("abort",()=>E="ABORTED"),l.addEventListener("timeout",()=>E="TIMEOUT"),l.addEventListener("loadend",()=>{m.durationMs=Date.now()-h,m.status=E===null&&l.status>0?l.status:null,m.outcome=m.status===null?E!=null?E:_chunkTJIA62OAjs.f.call(void 0, ):_chunkTJIA62OAjs.g.call(void 0, m.status),!m.instrumented&&m.status!==null&&m.status>=400&&(l.responseType===""||l.responseType==="text")&&(m.responseBodyExcerpt=l.responseText.slice(0,_chunkTJIA62OAjs.b)),t.record(m)})},p=function(l){let u=o.get(this);if(u)try{a(this,u.method,u.url)}catch (e9){t.drop()}return r.call(this,l)};return s.open=i,s.send=p,()=>{s.open===i&&(s.open=n),s.send===p&&(s.send=r)}};var V=class{constructor(e,s){this.max=e;this.drop=s;this.value=null;this.calls=null;this.failed=!1}get(){return this.value}hold(){!this.value&&!this.calls&&(this.calls=[])}run(e){if(this.value)try{e(this.value)}catch (e10){this.drop()}else this.calls&&this.calls.length<this.max?this.calls.push(e):(this.calls||this.failed)&&this.drop()}resolve(e){var n;let s=(n=this.calls)!=null?n:[];this.calls=null,this.value=e,s.forEach(r=>this.run(r))}fail(){var e;((e=this.calls)!=null?e:[]).forEach(()=>this.drop()),this.calls=null,this.failed=!0}close(){this.value=null,this.calls=null}};var yt={reload:"RELOAD",back_forward:"BACK_FORWARD"},Me=()=>{try{return performance.getEntriesByType("navigation")[0]}catch (e11){return}},Pe=t=>({dnsMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.domainLookupStart,t.domainLookupEnd):null,tcpMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.connectStart,t.connectEnd):null,tlsMs:t&&t.secureConnectionStart>0?_chunk2TDEJLQ7js.b.call(void 0, t.secureConnectionStart,t.connectEnd):null,requestMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.requestStart,t.responseStart):null,responseMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.responseStart,t.responseEnd):null,domProcessingMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.responseEnd,t.domComplete):null,loadMs:t&&t.loadEventEnd>0?Math.round(t.loadEventEnd-t.startTime):null}),xe=t=>{var h,y;let e=null,s=null,n=(m,E=null,Qe)=>{let pe=Date.now();return e={startedAt:pe,path:window.location.pathname,event:{id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"pageView",route:t.resolveRoute(),referrerRoute:E,startedAt:_chunk2TDEJLQ7js.a.call(void 0, pe),durationMs:null,navigationType:m,lcpMs:null,inpMs:null,cls:null,fcpMs:null,ttfbMs:null,dnsMs:null,tcpMs:null,tlsMs:null,requestMs:null,responseMs:null,domProcessingMs:null,loadMs:null,longTaskCount:0,longTaskTotalMs:0,...Qe}},t.record({...e.event}),e.event.id},r=()=>{e&&(e.event.durationMs=Date.now()-e.startedAt,t.record({...e.event}))},o=()=>{try{if(t.onNavigation(),e&&window.location.pathname!==e.path){let m=e.event.route;r(),n("SPA",m)}}catch (e12){t.drop()}},i=()=>{e&&e.event.id===s&&(Object.assign(e.event,Pe(Me())),t.record({...e.event}))},a=Me(),p=document.readyState==="complete",l=(y=yt[(h=a==null?void 0:a.type)!=null?h:""])!=null?y:"NAVIGATE";s=n(l,null,p?Pe(a):void 0);let u=[_chunk2TDEJLQ7js.d.call(void 0, window,"popstate",o)];if(!p){let m;u.push(_chunk2TDEJLQ7js.d.call(void 0, window,"load",()=>{m=setTimeout(i,0)}),()=>clearTimeout(m))}let d=window.history.pushState,c=function(...m){let E=d.apply(this,m);return o(),E};return window.history.pushState=c,u.push(()=>{window.history.pushState===c&&(window.history.pushState=d)}),{currentId:()=>{var m;return(m=e==null?void 0:e.event.id)!=null?m:null},start:m=>{n(m)},end:r,stop:()=>u.forEach(m=>m())}};var _e=t=>t.replace(/\/+$/,""),G=(t,e)=>`${t.proxyUrl?`${_e(t.proxyUrl)}/rum`:`${_e(t.apiUrl)}/api/rum`}/${encodeURIComponent(t.applicationId)}/${e}?token=${encodeURIComponent(t.token)}`;var Fe="abyss-rum-config",Et=600*1e3,Ve=t=>typeof t=="number"&&t>=0&&t<=1?t:0,Ne=t=>{var n,r;let e=t;if(!e||typeof e.enabled!="boolean"||typeof e.sessionSampleRate!="number")return null;let s=(n=e.replay)!=null?n:{};return{enabled:e.enabled,sessionSampleRate:Ve(e.sessionSampleRate),sessionQuotaExhausted:e.sessionQuotaExhausted===!0,country:typeof e.country=="string"?e.country:null,feedbackEnabled:e.feedbackEnabled===!0,replay:{enabled:s.enabled===!0,sampleRate:Ve(s.sampleRate),unmaskSelectors:Array.isArray(s.unmaskSelectors)?s.unmaskSelectors.filter(o=>typeof o=="string"):[],maxSessionBytes:s.maxSessionBytes,defaultPrivacy:s.defaultPrivacy},socketMessages:{enabled:((r=e.socketMessages)==null?void 0:r.enabled)===!0}}},Le=(t,e)=>{let s=_chunk2TDEJLQ7js.h.call(void 0, Fe);if(!s||s.key!==t||typeof s.at!="number")return;let n=e-s.at;return n>=0&&n<Et?Ne(s.config):void 0},He=async(t,e,s,n)=>{let r=null;try{let o=await e(t,{credentials:"omit"});r=o.ok?Ne(await o.json()):null}catch (e13){r=null}return _chunk2TDEJLQ7js.i.call(void 0, Fe,{key:s,at:n,config:r}),r};var St=/iPad|Tablet|PlayBook|Silk|Android(?!.*Mobile)/i,bt=/Mobi|iPhone|iPod|Android|Opera Mini|IEMobile/i,wt=[[/Edg(e|A|iOS)?\//,"Edge"],[/OPR\/|Opera/,"Opera"],[/SamsungBrowser\//,"Samsung Internet"],[/Firefox\/|FxiOS\//,"Firefox"],[/Chrome\/|CriOS\//,"Chrome"],[/Safari\//,"Safari"]],Ue=t=>St.test(t)?"tablet":bt.test(t)?"mobile":"desktop",Be=t=>{var e,s;return(s=(e=wt.find(([n])=>n.test(t)))==null?void 0:e[1])!=null?s:"Other"},qe=(t,e,s,n)=>{if(!t)return s;try{let r=t({...e,attributes:{...e.attributes}});if(typeof(r==null?void 0:r.session)=="boolean"&&typeof r.replay=="boolean")return{session:r.session,replay:r.replay}}catch (e14){}return n(),s};var It=200,kt=(t,e,s)=>({session:t<e,replay:t<e*s}),We=(t,e,s,n)=>{let r=kt(t.random,t.sessionSampleRate,t.replaySampleRate),o=qe(e,t,r,n),i=o.session&&!s;return{session:i,replay:i&&o.replay}},At=t=>t.type==="request"&&(t.kind==="FETCH"||t.kind==="XHR")&&t.outcome==="SUCCESS",$=class{constructor(e){this.onDrop=e;this.held=null;this.released=new Set;this.successes=new Map}accept(e,s){var r,o,i;if(s){if(At(e)){let a=(r=e.pageViewId)!=null?r:"",p=((o=this.successes.get(a))!=null?o:0)+1;if(this.successes.set(a,p),p>It)return this.onDrop(),[]}return[e]}if(e.type==="pageView")return this.released.has(e.id)?[e]:(this.held=e,[]);if(e.type!=="error")return[];let n=[];return e.pageViewId!==null&&!this.released.has(e.pageViewId)&&(this.released.add(e.pageViewId),((i=this.held)==null?void 0:i.id)===e.pageViewId&&(n.push(this.held),this.held=null)),n.push(e),n}reset(){this.held=null,this.released.clear(),this.successes.clear()}};var ue="abyss-rum-session",Tt=1800*1e3,Ot=14400*1e3,de=(t,e)=>e-t.lastActivityAt>=Tt||e-t.startedAt>=Ot,Ct=t=>typeof(t==null?void 0:t.session)=="boolean"&&typeof t.replay=="boolean",Dt=()=>{let t=_chunk2TDEJLQ7js.h.call(void 0, ue);return!t||!_chunkKD6VO7IKjs.c.call(void 0, t.id)||typeof t.startedAt!="number"||typeof t.lastActivityAt!="number"||typeof t.random!="number"?null:{id:t.id,startedAt:t.startedAt,lastActivityAt:t.lastActivityAt,random:t.random,decision:Ct(t.decision)?t.decision:null,entryPath:typeof t.entryPath=="string"?t.entryPath:null,cut:t.cut===!0}},M=t=>_chunk2TDEJLQ7js.i.call(void 0, ue,t),je=()=>_chunk2TDEJLQ7js.j.call(void 0, ue),le=t=>{let e={id:_chunk2TDEJLQ7js.k.call(void 0, ),startedAt:t,lastActivityAt:t,random:Math.random(),decision:null,entryPath:null,cut:!1};return M(e),e},Ke=t=>{let e=Dt();return e&&!de(e,t)?e:le(t)};var Xe=64*1024,Mt=60*1e3;var Y=class{constructor(e,s,n){this.url=e;this.fetchImpl=s;this.handlers=n;this.pausedUntil=0}isPaused(e){return e<this.pausedUntil}send(e,s,n){let r=JSON.stringify({...e,events:[]}).slice(0,-2),o=_chunk2TDEJLQ7js.e.call(void 0, r)+2,i=[],a=[],p=o;for(let l of s){let u=JSON.stringify(l),d=_chunk2TDEJLQ7js.e.call(void 0, u);if(o+d>Xe){this.handlers.onDrop(1);continue}let c=d+(i.length>0?1:0);p+c>Xe&&(this.post(`${r}${i.join(",")}]}`,a,n,e.sessionId),i=[],a=[],p=o),p+=d+(i.length>0?1:0),i.push(u),a.push(l)}i.length>0&&this.post(`${r}${i.join(",")}]}`,a,n,e.sessionId)}post(e,s,n,r){let o=i=>this.handlers.onResult(s,i,r);if(n&&this.beacon(e)){o("OK");return}this.fetchImpl(this.url,{method:"POST",body:e,keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain;charset=UTF-8"}}).then(i=>this.handle(i,o),()=>o("FAIL")).catch(()=>this.handlers.onDrop(1))}beacon(e){try{return typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(this.url,e)}catch (e15){return!1}}async handle(e,s){if(e.status===429){this.pausedUntil=Date.now()+Mt,s("RETRY");return}if(e.status===401||e.status===403||e.status===404){s("CUT");return}if(!e.ok){s("FAIL");return}s("OK");let n=!1;try{n=(await e.json()).liveWatched===!0}catch (e16){}this.handlers.onLiveWatched(n)}};var Pt=5e3,xt=50,Ge=200,_t=50,Vt=100,Ft=200,Q=class{constructor(e,s){this.options=e;this.shared=s;this.config=null;this.ready=!1;this.stopped=!1;this.flushing=!1;this.pending=[];this.queue=[];this.teardowns=[];this.pageViews=null;this.lastPageViewId=null;this.deferred=new V(Vt,()=>this.drop());this.sockets=new V(Ft,()=>this.drop());this.errors=new j({pageViewId:()=>this.pageViewId(),resolveRoute:()=>this.resolveRoute(),record:e=>this.record(e),drop:()=>this.drop(),captured:()=>{var s;let e=Date.now();(s=this.deferred.get())==null||s.frustration.notifyError(),this.sockets.run(n=>n.anomaly(e))}});this.connections=new Set;this.timings=new Map;this.sessionDirty=!0;this.closed=!1;this.liveWatched=!1;this.drop=()=>{this.shared.dropped+=1};this.pageViewId=()=>{var e,s;return(s=(e=this.pageViews)==null?void 0:e.currentId())!=null?s:null};var r;let n=window.fetch;this.nativeFetch=(o,i)=>n.call(window,o,i),this.instrumentedOrigins=((r=e.instrumentedOrigins)!=null?r:[]).map(o=>_chunkTJIA62OAjs.d.call(void 0, String(o))).filter(o=>o!==null),this.filter=new $(this.drop),this.transport=new Y(G(e,"batch"),this.nativeFetch,{onResult:(o,i,a)=>this.guard(()=>this.onResult(o,i,a)),onLiveWatched:o=>{this.liveWatched=o},onDrop:o=>{this.shared.dropped+=o}}),this.session=Ke(Date.now()),this.deferred.hold()}start(){if(this.session.cut){this.stopped=!0;return}let e=Date.now(),s=`${this.options.applicationId}:${this.options.token}`,n=Le(s,e);if(n!==void 0){this.configure(n);return}He(G(this.options,"config"),this.nativeFetch,s,e).then(r=>this.guard(()=>this.configure(r)),this.drop)}stop(){this.shutdown(),je()}captureError(e,s){this.errors.capture(e,s)}addAction(e,s){let n=we(e,s,this.pageViewId(),this.drop);n&&this.record(n)}addTiming(e){let s=Date.now();this.deferred.run(n=>n.perf.timings.addTiming(e,s))}startDuration(e,s){let n=Date.now();this.deferred.run(r=>r.perf.timings.startDuration(e,s,n))}stopDuration(e){let s=Date.now();this.deferred.run(n=>n.perf.timings.stopDuration(e,s))}sendFeedback(e){let s=this.feedbackState();return s!==null?Promise.reject(new (0, _chunkLRYKS5XRjs.b)(s)):this.feedback((n,r)=>n.sendFeedback(r,e))}showReportDialog(e){this.feedbackState()===null&&this.feedback((s,n)=>s.showReportDialog(n,e!=null?e:{})).catch(this.drop)}markDirty(){this.sessionDirty=!0}guard(e){try{e()}catch (e17){this.drop()}}load(e,s){e.catch(()=>{this.drop(),s()})}feedback(e){return Promise.resolve().then(() => _interopRequireWildcard(require("./send-HJMK5WE5.js"))).then(s=>e(s,this.feedbackHost()),()=>{throw new (0, _chunkLRYKS5XRjs.b)("SEND_FAILED")})}feedbackState(){var e;return!this.ready||this.stopped?"NO_SESSION":((e=this.config)==null?void 0:e.feedbackEnabled)===!0?null:"FEEDBACK_DISABLED"}feedbackHost(){return{unavailable:()=>this.feedbackState(),sessionId:()=>this.session.id,sessionStartedAt:()=>this.session.startedAt,pageViewId:this.pageViewId,resolveRoute:()=>this.resolveRoute(),prepare:e=>{let s=te(e,this.options.beforeSend,this.drop);return s&&ne(s)},post:e=>(this.flush(!1),this.nativeFetch(G(this.options,"feedback"),{method:"POST",body:JSON.stringify({...this.header(),events:[e]}),keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain;charset=UTF-8"}}).then(s=>s.status)),sent:e=>this.guard(()=>{var s,n;return(n=(s=this.options).onFeedbackSent)==null?void 0:n.call(s,e)})}}loadDeferred(e){this.load(Promise.resolve().then(() => _interopRequireWildcard(require("./deferred-U3TO724B.js"))).then(({installDeferred:s})=>this.guard(()=>{if(this.stopped)return;let n=s({instrument:e,resolveRoute:()=>this.resolveRoute(),captureConsole:this.options.captureConsole!==!1,describe:re});this.teardowns.push(n.teardown),this.deferred.resolve(n)})),()=>this.deferred.fail())}loadReplay(){var e;!this.replaying&&((e=this.session.decision)!=null&&e.replay)&&this.config.replay.enabled&&(this.replaying=Promise.resolve().then(() => _interopRequireWildcard(require("./replay-43OHXAQG.js"))).then(({recordReplay:s})=>s(this)).catch(this.drop))}loadSocketCapture(e){var n;let s=this.options.captureSocketMessages;!s||!e.socketMessages.enabled||((n=this.session.decision)==null?void 0:n.session)!==!0||(this.sockets.hold(),this.load(Promise.resolve().then(() => _interopRequireWildcard(require("./socket-messages-KEJ2WXMX.js"))).then(({SocketMessageCapture:r})=>this.guard(()=>{this.stopped||this.sockets.resolve(new r(s,{sessionId:()=>this.session.id,record:o=>this.record(o),drop:this.drop}))})),()=>this.sockets.fail()))}onPageView(e){var s,n;this.shared.featureFlags.annotate(e),(s=this.deferred.get())==null||s.perf.annotate(e),this.record(e),e.id!==this.lastPageViewId&&(this.lastPageViewId=e.id,(n=this.deferred.get())==null||n.frustration.notifyActivity()),this.deferred.run(r=>r.perf.pageViewSent(e))}configure(e){if(this.stopped)return;if(!e||!e.enabled){this.shutdown();return}this.config=e,this.session.decision||this.decide(),this.ready=!0,this.install(),this.loadSocketCapture(e),this.loadReplay();let s=this.pending;this.pending=[];let n=this.pageViewId();for(let r of s)(r.type==="error"||r.type==="action")&&r.pageViewId===null&&(r.pageViewId=n),this.record(r)}decide(){let e=this.config,s=navigator.userAgent;this.session.decision=We({route:x(this.resolveRoute()),deviceType:Ue(s),browserFamily:Be(s),country:e.country,attributes:{...this.shared.attributes},random:this.session.random,sessionSampleRate:e.sessionSampleRate,replaySampleRate:e.replay.sampleRate},this.options.sampler,e.sessionQuotaExhausted,this.drop),M(this.session)}install(){let e={instrumentedOrigins:this.instrumentedOrigins,sessionId:()=>this.session.id,pageViewId:this.pageViewId,record:r=>this.record(r),drop:this.drop,trackTiming:(r,o,i)=>{var a;this.timings.set(r,{url:o,startedAt:i}),(a=this.deferred.get())==null||a.frustration.notifyActivity()},trackConnection:r=>this.connections.add(r),socketMessage:(r,o)=>this.sockets.run(i=>i.message(r,o)),socketClosed:r=>{let o=Date.now();this.sockets.run(i=>i.closed(r,o))}};this.pageViews=xe({resolveRoute:()=>this.resolveRoute(),record:r=>this.onPageView(r),onNavigation:()=>this.touch(),drop:this.drop});let s=setInterval(()=>this.guard(()=>this.flush(!1)),Pt),n=()=>this.guard(()=>this.touch());this.teardowns=[this.pageViews.stop,()=>clearInterval(s),Ce(e),De(e),Te(e),Oe(e),_chunk2TDEJLQ7js.d.call(void 0, window,"click",n,!0),_chunk2TDEJLQ7js.d.call(void 0, window,"keydown",n,!0),this.errors.install(),_chunk2TDEJLQ7js.d.call(void 0, window,"pagehide",()=>this.guard(()=>this.onPageHide())),_chunk2TDEJLQ7js.d.call(void 0, window,"pageshow",r=>this.guard(()=>{var o;r.persisted&&(this.closed=!1,this.sessionDirty=!0,(o=this.pageViews)==null||o.start("BACK_FORWARD"))})),_chunk2TDEJLQ7js.d.call(void 0, document,"visibilitychange",()=>this.guard(()=>{var r;document.visibilityState==="hidden"&&((r=this.deferred.get())==null||r.perf.hidden(),this.flush(!0))}))],this.loadDeferred(e)}shutdown(){this.stopped=!0,this.ready=!1;let e=this.teardowns;this.teardowns=[],e.reverse().forEach(s=>this.guard(s)),this.deferred.close(),this.sockets.close(),this.pending=[],this.queue=[],this.connections.clear(),this.timings.clear()}resolveRoute(){let{routeResolver:e}=this.options;if(e)try{return String(e(window.location))}catch (e18){this.drop()}return window.location.pathname}touch(){var s,n;if(!this.ready)return;let e=Date.now();if(!de(this.session,e)){this.session.lastActivityAt=e,M(this.session);return}(s=this.pageViews)==null||s.end(),this.flush(!1),this.shared.dropped+=this.queue.length,this.queue=[],this.session=le(e),this.decide(),this.loadReplay(),this.filter.reset(),this.sessionDirty=!0,this.closed=!1,(n=this.pageViews)==null||n.start("SPA")}onPageHide(){var e;(e=this.pageViews)==null||e.end();for(let s of this.connections)s.done||(s.event.durationMs=Date.now()-s.startedAt,s.done=!0,s.dirty=!0);this.closed=!0,this.sessionDirty=!0,this.flush(!0)}record(e){var s,n;try{if(this.stopped)return;if(this.errors.observe(e),!this.ready){this.pending.length<_t?this.pending.push(e):this.drop();return}(s=this.sockets.get())==null||s.observe(e);let r=((n=this.session.decision)==null?void 0:n.session)===!0;if(!r&&e.type!=="error"&&e.type!=="pageView")return;let o=te(e,this.options.beforeSend,this.drop);if(!o)return;ne(o),o.type==="pageView"&&this.session.entryPath===null&&(this.session.entryPath=o.route,M(this.session));for(let i of this.filter.accept(o,r))this.enqueue(i)}catch (e19){this.drop()}}enqueue(e){if(this.queue.length>=Ge){this.drop();return}this.queue.push(e),this.queue.length>=xt&&!this.flushing&&this.flush(!1)}flush(e){var s,n;if(!(!this.ready||this.flushing||this.transport.isPaused(Date.now()))){this.flushing=!0;try{for(let p of this.connections)p.dirty&&(p.dirty=!1,this.record({...p.event})),p.done&&this.connections.delete(p);let r=this.queue;this.queue=[],this.fillTimings(r);let o=((s=this.session.decision)==null?void 0:s.session)===!0;if(r.length===0&&!(o&&this.sessionDirty))return;let a=this.sessionDirty||this.shared.dropped>0?{id:this.session.id,type:"session",entryPath:(n=this.session.entryPath)!=null?n:"/",sampled:o,closed:this.closed,droppedEvents:this.shared.dropped}:null;this.shared.dropped=0,this.sessionDirty=!1,this.transport.send(this.header(),a?[a,...r]:r,e)}finally{this.flushing=!1}}}header(){let e={sessionId:this.session.id,sessionStartedAt:_chunk2TDEJLQ7js.a.call(void 0, this.session.startedAt)};return this.options.release&&(e.release=this.options.release),this.shared.actor!==void 0&&(e.actor=this.shared.actor),this.shared.attributesSet&&(e.attributes={...this.shared.attributes}),this.shared.featureFlags.hasAny()&&(e.featureFlags={...this.shared.featureFlags.session}),e}fillTimings(e){for(let s of e){let n=this.timings.get(s.id);n&&(this.timings.delete(s.id),Object.assign(s,_chunkTJIA62OAjs.i.call(void 0, n.url,n.startedAt)))}}onResult(e,s,n){if(s==="OK")return;if(s==="CUT"){this.session.cut=!0,M(this.session),this.shutdown();return}let r=e.filter(i=>i.type!=="session"),o=e.find(i=>i.type==="session");if(o&&(this.shared.dropped+=o.droppedEvents,this.sessionDirty=!0),s==="RETRY"&&n===this.session.id){let i=r.slice(0,Math.max(0,Ge-this.queue.length));this.shared.dropped+=r.length-i.length,this.queue=[...i,...this.queue];return}this.shared.dropped+=r.length}},$e=null,f={actor:void 0,attributes:{},attributesSet:!1,dropped:0,featureFlags:new D},v=()=>$e,ce=t=>{$e=t};var Ye=(s=>(s.ALL="ALL",s.ON_ANOMALY="ON_ANOMALY",s))(Ye||{});var S=t=>{try{t()}catch (e20){f.dropped+=1}},En= exports.AbyssRum ={init(t){S(()=>{if(v()||!(t!=null&&t.token)||!t.applicationId||!t.apiUrl&&!t.proxyUrl||typeof window=="undefined"||typeof window.fetch!="function")return;let e=new Q(t,f);ce(e),e.start()})},setActor(t){S(()=>{var s;let e=Se(t);if(e===void 0){f.dropped+=1;return}f.actor=e,(s=v())==null||s.markDirty()})},setAttributes(t){S(()=>{var e;f.attributes=_chunkTJIA62OAjs.a.call(void 0, f.attributes,t,()=>{f.dropped+=1}),f.attributesSet=!0,(e=v())==null||e.markDirty()})},captureError(t,e){S(()=>{var s;return(s=v())==null?void 0:s.captureError(t,e)})},addAction(t,e){S(()=>{var s;return(s=v())==null?void 0:s.addAction(t,e)})},addFeatureFlagEvaluation(t,e){S(()=>{var s;f.featureFlags.add(t,e,()=>f.dropped+=1)&&((s=v())==null||s.markDirty())})},sendFeedback(t){var e,s;return(s=(e=v())==null?void 0:e.sendFeedback(t))!=null?s:Promise.reject(new (0, _chunkLRYKS5XRjs.b)("NO_SESSION"))},showReportDialog(t){S(()=>{var e;return(e=v())==null?void 0:e.showReportDialog(t)})},addTiming(t){S(()=>{var e;return(e=v())==null?void 0:e.addTiming(t)})},startDuration(t,e){S(()=>{var s;return(s=v())==null?void 0:s.startDuration(t,e)})},stopDuration(t){S(()=>{var e;return(e=v())==null?void 0:e.stopDuration(t)})},stop(){S(()=>{var t;(t=v())==null||t.stop(),ce(null),f.actor=void 0,f.attributes={},f.attributesSet=!1,f.dropped=0,f.featureFlags=new D})}};exports.AbyssRum = En; exports.RumFeedbackError = _chunkLRYKS5XRjs.b; exports.RumFeedbackErrorCode = _chunkLRYKS5XRjs.a; exports.RumSocketCaptureMode = Ye;
2
+ `).find(n=>it.test(n)))==null?void 0:e.trim())!=null?s:""},W=class{constructor(e){this.release=e;this.held=new Map}add(e){var r;let s=`${(r=e.pageViewId)!=null?r:""}${e.message}${at(e.stack)}`,n=this.held.get(s);if(n){n.event.repeat+=1;return}this.held.set(s,{event:e,timer:setTimeout(()=>this.releaseKey(s),1e4)})}flush(){[...this.held.keys()].forEach(e=>this.releaseKey(e))}clear(){this.held.forEach(e=>clearTimeout(e.timer)),this.held.clear()}releaseKey(e){let s=this.held.get(e);s&&(clearTimeout(s.timer),this.held.delete(e),this.release(s.event))}};var ut=/^ResizeObserver loop/,dt=/^Script error\.?$/,lt=t=>{let e=t;return e&&typeof e=="object"&&typeof e.message=="string"?{name:typeof e.name=="string"&&e.name?e.name:"Error",message:e.message,stack:typeof e.stack=="string"?e.stack:null}:{name:"Error",message:_chunk2TDEJLQ7js.c.call(void 0, t),stack:null}},ct=t=>{if(!t||typeof t!="object")return;let e=Object.entries(t).filter(([,s])=>typeof s=="string");return e.length>0?Object.fromEntries(e):void 0},pt=t=>ut.test(t.message)||dt.test(t.message)&&!t.stack,j=class{constructor(e){this.host=e;this.breadcrumbs=new q;this.pageViewId=null;this.dedup=new W(s=>e.record(s))}capture(e,s){let n=lt(e);if(pt(n)){this.host.drop();return}this.host.captured();let r=ct(s);this.dedup.add({id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"error",pageViewId:this.host.pageViewId(),occurredAt:_chunk2TDEJLQ7js.a.call(void 0, Date.now()),route:this.host.resolveRoute(),...n,breadcrumbs:this.breadcrumbs.snapshot(),repeat:1,...r?{context:r}:{}})}observe(e){this.breadcrumbs.observe(e),e.type==="pageView"&&e.id!==this.pageViewId&&(this.pageViewId!==null&&this.dedup.flush(),this.pageViewId=e.id)}install(){let e=n=>()=>{try{n()}catch (e3){this.host.drop()}},s=[_chunk2TDEJLQ7js.d.call(void 0, window,"error",n=>{n.target instanceof Element||e(()=>{var r;return this.capture((r=n.error)!=null?r:n.message)})()}),_chunk2TDEJLQ7js.d.call(void 0, window,"unhandledrejection",n=>e(()=>this.capture(n.reason))()),_chunk2TDEJLQ7js.d.call(void 0, window,"click",n=>e(()=>this.breadcrumbs.click(n.target))(),!0),_chunk2TDEJLQ7js.d.call(void 0, window,"pagehide",e(()=>this.dedup.flush())),_chunk2TDEJLQ7js.d.call(void 0, document,"visibilitychange",e(()=>{document.visibilityState==="hidden"&&this.dedup.flush()}))];return()=>{s.forEach(n=>n()),this.dedup.clear()}}};var ht=123,ie=(t,e,s)=>{let n=_chunkTJIA62OAjs.c.call(void 0, String(s));if(!n)return null;let r=n.href,o=null;_chunkTJIA62OAjs.e.call(void 0, t,n)&&(o=_chunk2TDEJLQ7js.k.call(void 0, ),n.searchParams.set(_chunkKD6VO7IKjs.g,o),n.searchParams.set(_chunkKD6VO7IKjs.h,t.sessionId()));let i=Date.now(),a=_chunkTJIA62OAjs.h.call(void 0, t,e,"GET",r,i,o);Object.assign(a,{connectMs:null,messagesIn:0,messagesOut:0,bytesIn:0,bytesOut:0,droppedMessages:0});let p={event:a,startedAt:i,opened:!1,dirty:!0,done:!1};return t.trackConnection(p),{connection:p,nativeUrl:o===null?String(s):n.href}},ae=t=>{t.opened||(t.opened=!0,t.event.connectMs=Date.now()-t.startedAt,t.dirty=!0)},K=(t,e,s)=>{var r,o,i,a;let{event:n}=t;e==="in"?(n.messagesIn=((r=n.messagesIn)!=null?r:0)+1,n.bytesIn=((o=n.bytesIn)!=null?o:0)+_chunk2TDEJLQ7js.g.call(void 0, s)):(n.messagesOut=((i=n.messagesOut)!=null?i:0)+1,n.bytesOut=((a=n.bytesOut)!=null?a:0)+_chunk2TDEJLQ7js.g.call(void 0, s)),t.dirty=!0},X=(t,e)=>{t.done||(t.event.durationMs=Date.now()-t.startedAt,t.event.outcome=e,t.done=!0,t.dirty=!0)},Ae=(t,e)=>({direction:t,data:e,at:Date.now(),eventName:null,eventId:null}),ft=(t,e,s,n)=>{if(s)return"ABORTED";if(t&&(e===1e3||e===1001||n&&e===1005))return"SUCCESS";let r=_chunkTJIA62OAjs.f.call(void 0, );return r==="OFFLINE"||!t?r:"HTTP_ERROR"},Te=t=>{let e=window.WebSocket;if(typeof e!="function")return()=>{};let s=e.prototype,n=s.send,r=s.close,o=new WeakMap,i=(u,d)=>{o.set(u,d),u.addEventListener("open",()=>ae(d)),u.addEventListener("message",c=>{K(d,"in",c.data),t.socketMessage(d,Ae("IN",c.data))}),u.addEventListener("close",c=>{let h=o.get(u);d.event.closeCode=c.code,d.event.closeReason=c.reason?_chunk2TDEJLQ7js.f.call(void 0, c.reason,ht):null,X(d,ft(d.opened,c.code,(h==null?void 0:h.abortedByApp)===!0,(h==null?void 0:h.closedByApp)===!0)),t.socketClosed(d)})},a=new Proxy(e,{construct(u,d,c){let h=null;try{h=ie(t,"WEBSOCKET",d[0])}catch (e4){t.drop()}let y=h?[h.nativeUrl,...d.slice(1)]:d,m=Reflect.construct(u,y,c===a?u:c);return h&&i(m,h.connection),m}}),p=function(u){n.call(this,u);let d=o.get(this);d&&(K(d,"out",u),t.socketMessage(d,Ae("OUT",u)))},l=function(u,d){let c=o.get(this);return c&&(c.abortedByApp=this.readyState===e.CONNECTING,c.closedByApp=!0),r.apply(this,arguments)};return window.WebSocket=a,s.send=p,s.close=l,()=>{window.WebSocket===a&&(window.WebSocket=e),s.send===p&&(s.send=n),s.close===l&&(s.close=r)}};var Oe=t=>{let e=window,s=e.EventSource;if(typeof s!="function")return()=>{};let n=s.prototype,r=n.close,o=new WeakMap,i=(l,u)=>{o.set(l,u),u.event.reconnectCount=0,l.addEventListener("open",()=>ae(u)),l.addEventListener("message",d=>{K(u,"in",d.data),t.socketMessage(u,{direction:"IN",data:d.data,at:Date.now(),eventName:d.type,eventId:d.lastEventId||null})}),l.addEventListener("error",()=>{var c;if(l.readyState===s.CONNECTING){u.event.reconnectCount=((c=u.event.reconnectCount)!=null?c:0)+1,u.dirty=!0;return}let d=_chunkTJIA62OAjs.f.call(void 0, );X(u,u.opened&&d!=="OFFLINE"?"HTTP_ERROR":d),t.socketClosed(u)})},a=new Proxy(s,{construct(l,u,d){let c=null;try{c=ie(t,"SSE",u[0])}catch (e5){t.drop()}let h=c?[c.nativeUrl,...u.slice(1)]:u,y=Reflect.construct(l,h,d===a?l:d);return c&&i(y,c.connection),y}}),p=function(){r.call(this);let l=o.get(this);l&&(X(l,l.opened?"SUCCESS":"ABORTED"),t.socketClosed(l))};return e.EventSource=a,n.close=p,()=>{e.EventSource===a&&(e.EventSource=s),n.close===p&&(n.close=r)}};var gt=(t,e,s)=>{var u,d,c;let n=typeof Request!="undefined"&&e instanceof Request?e:null,r=_chunkTJIA62OAjs.c.call(void 0, n?n.url:String(e));if(!r)return null;let o=((d=(u=s==null?void 0:s.method)!=null?u:n==null?void 0:n.method)!=null?d:"GET").toUpperCase(),i=Date.now(),a=null,p=s;if(_chunkTJIA62OAjs.e.call(void 0, t,r)){a=_chunk2TDEJLQ7js.k.call(void 0, );let h=new Headers((c=s==null?void 0:s.headers)!=null?c:n==null?void 0:n.headers);h.set(_chunkKD6VO7IKjs.e,a),h.set(_chunkKD6VO7IKjs.f,t.sessionId()),p={...s,headers:h}}let l=_chunkTJIA62OAjs.h.call(void 0, t,"FETCH",o,r.href,i,a);return t.trackTiming(l.id,r.href,i),{event:l,init:p,startedAt:i}},Rt=(t,e,s)=>{let{event:n}=e;if(n.durationMs=Date.now()-e.startedAt,n.status=s.status,n.outcome=_chunkTJIA62OAjs.g.call(void 0, s.status),n.instrumented||s.status<400){t.record(n);return}s.clone().text().then(r=>{n.responseBodyExcerpt=r.slice(0,_chunkTJIA62OAjs.b),t.record(n)},()=>t.record(n))},Ce=t=>{let e=window.fetch;if(typeof e!="function")return()=>{};let s=(n,r)=>{let o=null;try{o=gt(t,n,r)}catch (e6){t.drop()}let i=e.call(window,n,o?o.init:r);if(o){let a=o;i.then(p=>{try{Rt(t,a,p)}catch (e7){t.drop()}},p=>{a.event.durationMs=Date.now()-a.startedAt,a.event.outcome=_chunkTJIA62OAjs.f.call(void 0, p),t.record(a.event)})}return i};return window.fetch=s,()=>{window.fetch===s&&(window.fetch=e)}};var De=t=>{let e=window.XMLHttpRequest;if(typeof e!="function")return()=>{};let s=e.prototype,n=s.open,r=s.send,o=new WeakMap,i=function(l,u){try{o.set(this,{method:String(l).toUpperCase(),url:String(u)})}catch (e8){t.drop()}return n.apply(this,arguments)},a=(l,u,d)=>{let c=_chunkTJIA62OAjs.c.call(void 0, d);if(!c)return;let h=Date.now(),y=null;_chunkTJIA62OAjs.e.call(void 0, t,c)&&(y=_chunk2TDEJLQ7js.k.call(void 0, ),l.setRequestHeader(_chunkKD6VO7IKjs.e,y),l.setRequestHeader(_chunkKD6VO7IKjs.f,t.sessionId()));let m=_chunkTJIA62OAjs.h.call(void 0, t,"XHR",u,c.href,h,y);t.trackTiming(m.id,c.href,h);let E=null;l.addEventListener("error",()=>E=_chunkTJIA62OAjs.f.call(void 0, )),l.addEventListener("abort",()=>E="ABORTED"),l.addEventListener("timeout",()=>E="TIMEOUT"),l.addEventListener("loadend",()=>{m.durationMs=Date.now()-h,m.status=E===null&&l.status>0?l.status:null,m.outcome=m.status===null?E!=null?E:_chunkTJIA62OAjs.f.call(void 0, ):_chunkTJIA62OAjs.g.call(void 0, m.status),!m.instrumented&&m.status!==null&&m.status>=400&&(l.responseType===""||l.responseType==="text")&&(m.responseBodyExcerpt=l.responseText.slice(0,_chunkTJIA62OAjs.b)),t.record(m)})},p=function(l){let u=o.get(this);if(u)try{a(this,u.method,u.url)}catch (e9){t.drop()}return r.call(this,l)};return s.open=i,s.send=p,()=>{s.open===i&&(s.open=n),s.send===p&&(s.send=r)}};var V=class{constructor(e,s){this.max=e;this.drop=s;this.value=null;this.calls=null;this.failed=!1}get(){return this.value}hold(){!this.value&&!this.calls&&(this.calls=[])}run(e){if(this.value)try{e(this.value)}catch (e10){this.drop()}else this.calls&&this.calls.length<this.max?this.calls.push(e):(this.calls||this.failed)&&this.drop()}resolve(e){var n;let s=(n=this.calls)!=null?n:[];this.calls=null,this.value=e,s.forEach(r=>this.run(r))}fail(){var e;((e=this.calls)!=null?e:[]).forEach(()=>this.drop()),this.calls=null,this.failed=!0}close(){this.value=null,this.calls=null}};var yt={reload:"RELOAD",back_forward:"BACK_FORWARD"},Me=()=>{try{return performance.getEntriesByType("navigation")[0]}catch (e11){return}},Pe=t=>({dnsMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.domainLookupStart,t.domainLookupEnd):null,tcpMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.connectStart,t.connectEnd):null,tlsMs:t&&t.secureConnectionStart>0?_chunk2TDEJLQ7js.b.call(void 0, t.secureConnectionStart,t.connectEnd):null,requestMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.requestStart,t.responseStart):null,responseMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.responseStart,t.responseEnd):null,domProcessingMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.responseEnd,t.domComplete):null,loadMs:t&&t.loadEventEnd>0?Math.round(t.loadEventEnd-t.startTime):null}),xe=t=>{var h,y;let e=null,s=null,n=(m,E=null,Qe)=>{let pe=Date.now();return e={startedAt:pe,path:window.location.pathname,event:{id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"pageView",route:t.resolveRoute(),referrerRoute:E,startedAt:_chunk2TDEJLQ7js.a.call(void 0, pe),durationMs:null,navigationType:m,lcpMs:null,inpMs:null,cls:null,fcpMs:null,ttfbMs:null,dnsMs:null,tcpMs:null,tlsMs:null,requestMs:null,responseMs:null,domProcessingMs:null,loadMs:null,longTaskCount:0,longTaskTotalMs:0,...Qe}},t.record({...e.event}),e.event.id},r=()=>{e&&(e.event.durationMs=Date.now()-e.startedAt,t.record({...e.event}))},o=()=>{try{if(t.onNavigation(),e&&window.location.pathname!==e.path){let m=e.event.route;r(),n("SPA",m)}}catch (e12){t.drop()}},i=()=>{e&&e.event.id===s&&(Object.assign(e.event,Pe(Me())),t.record({...e.event}))},a=Me(),p=document.readyState==="complete",l=(y=yt[(h=a==null?void 0:a.type)!=null?h:""])!=null?y:"NAVIGATE";s=n(l,null,p?Pe(a):void 0);let u=[_chunk2TDEJLQ7js.d.call(void 0, window,"popstate",o)];if(!p){let m;u.push(_chunk2TDEJLQ7js.d.call(void 0, window,"load",()=>{m=setTimeout(i,0)}),()=>clearTimeout(m))}let d=window.history.pushState,c=function(...m){let E=d.apply(this,m);return o(),E};return window.history.pushState=c,u.push(()=>{window.history.pushState===c&&(window.history.pushState=d)}),{currentId:()=>{var m;return(m=e==null?void 0:e.event.id)!=null?m:null},start:m=>{n(m)},end:r,stop:()=>u.forEach(m=>m())}};var _e=t=>t.replace(/\/+$/,""),G=(t,e)=>`${t.proxyUrl?`${_e(t.proxyUrl)}/rum`:`${_e(t.apiUrl)}/api/rum`}/${encodeURIComponent(t.applicationId)}/${e}?token=${encodeURIComponent(t.token)}`;var Fe="abyss-rum-config",Et=600*1e3,Ve=t=>typeof t=="number"&&t>=0&&t<=1?t:0,Ne=t=>{var n,r;let e=t;if(!e||typeof e.enabled!="boolean"||typeof e.sessionSampleRate!="number")return null;let s=(n=e.replay)!=null?n:{};return{enabled:e.enabled,sessionSampleRate:Ve(e.sessionSampleRate),sessionQuotaExhausted:e.sessionQuotaExhausted===!0,country:typeof e.country=="string"?e.country:null,feedbackEnabled:e.feedbackEnabled===!0,replay:{enabled:s.enabled===!0,sampleRate:Ve(s.sampleRate),unmaskSelectors:Array.isArray(s.unmaskSelectors)?s.unmaskSelectors.filter(o=>typeof o=="string"):[],maxSessionBytes:s.maxSessionBytes,defaultPrivacy:s.defaultPrivacy},socketMessages:{enabled:((r=e.socketMessages)==null?void 0:r.enabled)===!0}}},Le=(t,e)=>{let s=_chunk2TDEJLQ7js.h.call(void 0, Fe);if(!s||s.key!==t||typeof s.at!="number")return;let n=e-s.at;return n>=0&&n<Et?Ne(s.config):void 0},He=async(t,e,s,n)=>{let r=null;try{let o=await e(t,{credentials:"omit"});r=o.ok?Ne(await o.json()):null}catch (e13){r=null}return _chunk2TDEJLQ7js.i.call(void 0, Fe,{key:s,at:n,config:r}),r};var St=/iPad|Tablet|PlayBook|Silk|Android(?!.*Mobile)/i,bt=/Mobi|iPhone|iPod|Android|Opera Mini|IEMobile/i,wt=[[/Edg(e|A|iOS)?\//,"Edge"],[/OPR\/|Opera/,"Opera"],[/SamsungBrowser\//,"Samsung Internet"],[/Firefox\/|FxiOS\//,"Firefox"],[/Chrome\/|CriOS\//,"Chrome"],[/Safari\//,"Safari"]],Ue=t=>St.test(t)?"tablet":bt.test(t)?"mobile":"desktop",Be=t=>{var e,s;return(s=(e=wt.find(([n])=>n.test(t)))==null?void 0:e[1])!=null?s:"Other"},qe=(t,e,s,n)=>{if(!t)return s;try{let r=t({...e,attributes:{...e.attributes}});if(typeof(r==null?void 0:r.session)=="boolean"&&typeof r.replay=="boolean")return{session:r.session,replay:r.replay}}catch (e14){}return n(),s};var It=200,kt=(t,e,s)=>({session:t<e,replay:t<e*s}),We=(t,e,s,n)=>{let r=kt(t.random,t.sessionSampleRate,t.replaySampleRate),o=qe(e,t,r,n),i=o.session&&!s;return{session:i,replay:i&&o.replay}},At=t=>t.type==="request"&&(t.kind==="FETCH"||t.kind==="XHR")&&t.outcome==="SUCCESS",$=class{constructor(e){this.onDrop=e;this.held=null;this.released=new Set;this.successes=new Map}accept(e,s){var r,o,i;if(s){if(At(e)){let a=(r=e.pageViewId)!=null?r:"",p=((o=this.successes.get(a))!=null?o:0)+1;if(this.successes.set(a,p),p>It)return this.onDrop(),[]}return[e]}if(e.type==="pageView")return this.released.has(e.id)?[e]:(this.held=e,[]);if(e.type!=="error")return[];let n=[];return e.pageViewId!==null&&!this.released.has(e.pageViewId)&&(this.released.add(e.pageViewId),((i=this.held)==null?void 0:i.id)===e.pageViewId&&(n.push(this.held),this.held=null)),n.push(e),n}reset(){this.held=null,this.released.clear(),this.successes.clear()}};var ue="abyss-rum-session",Tt=1800*1e3,Ot=14400*1e3,de=(t,e)=>e-t.lastActivityAt>=Tt||e-t.startedAt>=Ot,Ct=t=>typeof(t==null?void 0:t.session)=="boolean"&&typeof t.replay=="boolean",Dt=()=>{let t=_chunk2TDEJLQ7js.h.call(void 0, ue);return!t||!_chunkKD6VO7IKjs.c.call(void 0, t.id)||typeof t.startedAt!="number"||typeof t.lastActivityAt!="number"||typeof t.random!="number"?null:{id:t.id,startedAt:t.startedAt,lastActivityAt:t.lastActivityAt,random:t.random,decision:Ct(t.decision)?t.decision:null,entryPath:typeof t.entryPath=="string"?t.entryPath:null,cut:t.cut===!0}},M=t=>_chunk2TDEJLQ7js.i.call(void 0, ue,t),je=()=>_chunk2TDEJLQ7js.j.call(void 0, ue),le=t=>{let e={id:_chunk2TDEJLQ7js.k.call(void 0, ),startedAt:t,lastActivityAt:t,random:Math.random(),decision:null,entryPath:null,cut:!1};return M(e),e},Ke=t=>{let e=Dt();return e&&!de(e,t)?e:le(t)};var Xe=64*1024,Mt=60*1e3;var Y=class{constructor(e,s,n){this.url=e;this.fetchImpl=s;this.handlers=n;this.pausedUntil=0}isPaused(e){return e<this.pausedUntil}send(e,s,n){let r=JSON.stringify({...e,events:[]}).slice(0,-2),o=_chunk2TDEJLQ7js.e.call(void 0, r)+2,i=[],a=[],p=o;for(let l of s){let u=JSON.stringify(l),d=_chunk2TDEJLQ7js.e.call(void 0, u);if(o+d>Xe){this.handlers.onDrop(1);continue}let c=d+(i.length>0?1:0);p+c>Xe&&(this.post(`${r}${i.join(",")}]}`,a,n,e.sessionId),i=[],a=[],p=o),p+=d+(i.length>0?1:0),i.push(u),a.push(l)}i.length>0&&this.post(`${r}${i.join(",")}]}`,a,n,e.sessionId)}post(e,s,n,r){let o=i=>this.handlers.onResult(s,i,r);if(n&&this.beacon(e)){o("OK");return}this.fetchImpl(this.url,{method:"POST",body:e,keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain;charset=UTF-8"}}).then(i=>this.handle(i,o),()=>o("FAIL")).catch(()=>this.handlers.onDrop(1))}beacon(e){try{return typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(this.url,e)}catch (e15){return!1}}async handle(e,s){if(e.status===429){this.pausedUntil=Date.now()+Mt,s("RETRY");return}if(e.status===401||e.status===403||e.status===404){s("CUT");return}if(!e.ok){s("FAIL");return}s("OK");let n=!1;try{n=(await e.json()).liveWatched===!0}catch (e16){}this.handlers.onLiveWatched(n)}};var Pt=5e3,xt=50,Ge=200,_t=50,Vt=100,Ft=200,Q=class{constructor(e,s){this.options=e;this.shared=s;this.config=null;this.ready=!1;this.stopped=!1;this.flushing=!1;this.pending=[];this.queue=[];this.teardowns=[];this.pageViews=null;this.lastPageViewId=null;this.deferred=new V(Vt,()=>this.drop());this.sockets=new V(Ft,()=>this.drop());this.errors=new j({pageViewId:()=>this.pageViewId(),resolveRoute:()=>this.resolveRoute(),record:e=>this.record(e),drop:()=>this.drop(),captured:()=>{var s;let e=Date.now();(s=this.deferred.get())==null||s.frustration.notifyError(),this.sockets.run(n=>n.anomaly(e))}});this.connections=new Set;this.timings=new Map;this.sessionDirty=!0;this.closed=!1;this.liveWatched=!1;this.drop=()=>{this.shared.dropped+=1};this.pageViewId=()=>{var e,s;return(s=(e=this.pageViews)==null?void 0:e.currentId())!=null?s:null};var r;let n=window.fetch;this.nativeFetch=(o,i)=>n.call(window,o,i),this.instrumentedOrigins=((r=e.instrumentedOrigins)!=null?r:[]).map(o=>_chunkTJIA62OAjs.d.call(void 0, String(o))).filter(o=>o!==null),this.filter=new $(this.drop),this.transport=new Y(G(e,"batch"),this.nativeFetch,{onResult:(o,i,a)=>this.guard(()=>this.onResult(o,i,a)),onLiveWatched:o=>{this.liveWatched=o},onDrop:o=>{this.shared.dropped+=o}}),this.session=Ke(Date.now()),this.deferred.hold()}start(){if(this.session.cut){this.stopped=!0;return}let e=Date.now(),s=`${this.options.applicationId}:${this.options.token}`,n=Le(s,e);if(n!==void 0){this.configure(n);return}He(G(this.options,"config"),this.nativeFetch,s,e).then(r=>this.guard(()=>this.configure(r)),this.drop)}stop(){this.shutdown(),je()}captureError(e,s){this.errors.capture(e,s)}addAction(e,s){let n=we(e,s,this.pageViewId(),this.drop);n&&this.record(n)}addTiming(e){let s=Date.now();this.deferred.run(n=>n.perf.timings.addTiming(e,s))}startDuration(e,s){let n=Date.now();this.deferred.run(r=>r.perf.timings.startDuration(e,s,n))}stopDuration(e){let s=Date.now();this.deferred.run(n=>n.perf.timings.stopDuration(e,s))}sendFeedback(e){let s=this.feedbackState();return s!==null?Promise.reject(new (0, _chunkLRYKS5XRjs.b)(s)):this.feedback((n,r)=>n.sendFeedback(r,e))}showReportDialog(e){this.feedbackState()===null&&this.feedback((s,n)=>s.showReportDialog(n,e!=null?e:{})).catch(this.drop)}markDirty(){this.sessionDirty=!0}guard(e){try{e()}catch (e17){this.drop()}}load(e,s){e.catch(()=>{this.drop(),s()})}feedback(e){return Promise.resolve().then(() => _interopRequireWildcard(require("./send-HJMK5WE5.js"))).then(s=>e(s,this.feedbackHost()),()=>{throw new (0, _chunkLRYKS5XRjs.b)("SEND_FAILED")})}feedbackState(){var e;return!this.ready||this.stopped?"NO_SESSION":((e=this.config)==null?void 0:e.feedbackEnabled)===!0?null:"FEEDBACK_DISABLED"}feedbackHost(){return{unavailable:()=>this.feedbackState(),sessionId:()=>this.session.id,sessionStartedAt:()=>this.session.startedAt,pageViewId:this.pageViewId,resolveRoute:()=>this.resolveRoute(),prepare:e=>{let s=te(e,this.options.beforeSend,this.drop);return s&&ne(s)},post:e=>(this.flush(!1),this.nativeFetch(G(this.options,"feedback"),{method:"POST",body:JSON.stringify({...this.header(),events:[e]}),keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain;charset=UTF-8"}}).then(s=>s.status)),sent:e=>this.guard(()=>{var s,n;return(n=(s=this.options).onFeedbackSent)==null?void 0:n.call(s,e)})}}loadDeferred(e){this.load(Promise.resolve().then(() => _interopRequireWildcard(require("./deferred-U3TO724B.js"))).then(({installDeferred:s})=>this.guard(()=>{if(this.stopped)return;let n=s({instrument:e,resolveRoute:()=>this.resolveRoute(),captureConsole:this.options.captureConsole!==!1,describe:re});this.teardowns.push(n.teardown),this.deferred.resolve(n)})),()=>this.deferred.fail())}loadReplay(){var e;!this.replaying&&((e=this.session.decision)!=null&&e.replay)&&this.config.replay.enabled&&(this.replaying=Promise.resolve().then(() => _interopRequireWildcard(require("./replay-WQGBL5IM.js"))).then(({recordReplay:s})=>s(this)).catch(this.drop))}loadSocketCapture(e){var n;let s=this.options.captureSocketMessages;!s||!e.socketMessages.enabled||((n=this.session.decision)==null?void 0:n.session)!==!0||(this.sockets.hold(),this.load(Promise.resolve().then(() => _interopRequireWildcard(require("./socket-messages-KEJ2WXMX.js"))).then(({SocketMessageCapture:r})=>this.guard(()=>{this.stopped||this.sockets.resolve(new r(s,{sessionId:()=>this.session.id,record:o=>this.record(o),drop:this.drop}))})),()=>this.sockets.fail()))}onPageView(e){var s,n;this.shared.featureFlags.annotate(e),(s=this.deferred.get())==null||s.perf.annotate(e),this.record(e),e.id!==this.lastPageViewId&&(this.lastPageViewId=e.id,(n=this.deferred.get())==null||n.frustration.notifyActivity()),this.deferred.run(r=>r.perf.pageViewSent(e))}configure(e){if(this.stopped)return;if(!e||!e.enabled){this.shutdown();return}this.config=e,this.session.decision||this.decide(),this.ready=!0,this.install(),this.loadSocketCapture(e),this.loadReplay();let s=this.pending;this.pending=[];let n=this.pageViewId();for(let r of s)(r.type==="error"||r.type==="action")&&r.pageViewId===null&&(r.pageViewId=n),this.record(r)}decide(){let e=this.config,s=navigator.userAgent;this.session.decision=We({route:x(this.resolveRoute()),deviceType:Ue(s),browserFamily:Be(s),country:e.country,attributes:{...this.shared.attributes},random:this.session.random,sessionSampleRate:e.sessionSampleRate,replaySampleRate:e.replay.sampleRate},this.options.sampler,e.sessionQuotaExhausted,this.drop),M(this.session)}install(){let e={instrumentedOrigins:this.instrumentedOrigins,sessionId:()=>this.session.id,pageViewId:this.pageViewId,record:r=>this.record(r),drop:this.drop,trackTiming:(r,o,i)=>{var a;this.timings.set(r,{url:o,startedAt:i}),(a=this.deferred.get())==null||a.frustration.notifyActivity()},trackConnection:r=>this.connections.add(r),socketMessage:(r,o)=>this.sockets.run(i=>i.message(r,o)),socketClosed:r=>{let o=Date.now();this.sockets.run(i=>i.closed(r,o))}};this.pageViews=xe({resolveRoute:()=>this.resolveRoute(),record:r=>this.onPageView(r),onNavigation:()=>this.touch(),drop:this.drop});let s=setInterval(()=>this.guard(()=>this.flush(!1)),Pt),n=()=>this.guard(()=>this.touch());this.teardowns=[this.pageViews.stop,()=>clearInterval(s),Ce(e),De(e),Te(e),Oe(e),_chunk2TDEJLQ7js.d.call(void 0, window,"click",n,!0),_chunk2TDEJLQ7js.d.call(void 0, window,"keydown",n,!0),this.errors.install(),_chunk2TDEJLQ7js.d.call(void 0, window,"pagehide",()=>this.guard(()=>this.onPageHide())),_chunk2TDEJLQ7js.d.call(void 0, window,"pageshow",r=>this.guard(()=>{var o;r.persisted&&(this.closed=!1,this.sessionDirty=!0,(o=this.pageViews)==null||o.start("BACK_FORWARD"))})),_chunk2TDEJLQ7js.d.call(void 0, document,"visibilitychange",()=>this.guard(()=>{var r;document.visibilityState==="hidden"&&((r=this.deferred.get())==null||r.perf.hidden(),this.flush(!0))}))],this.loadDeferred(e)}shutdown(){this.stopped=!0,this.ready=!1;let e=this.teardowns;this.teardowns=[],e.reverse().forEach(s=>this.guard(s)),this.deferred.close(),this.sockets.close(),this.pending=[],this.queue=[],this.connections.clear(),this.timings.clear()}resolveRoute(){let{routeResolver:e}=this.options;if(e)try{return String(e(window.location))}catch (e18){this.drop()}return window.location.pathname}touch(){var s,n;if(!this.ready)return;let e=Date.now();if(!de(this.session,e)){this.session.lastActivityAt=e,M(this.session);return}(s=this.pageViews)==null||s.end(),this.flush(!1),this.shared.dropped+=this.queue.length,this.queue=[],this.session=le(e),this.decide(),this.loadReplay(),this.filter.reset(),this.sessionDirty=!0,this.closed=!1,(n=this.pageViews)==null||n.start("SPA")}onPageHide(){var e;(e=this.pageViews)==null||e.end();for(let s of this.connections)s.done||(s.event.durationMs=Date.now()-s.startedAt,s.done=!0,s.dirty=!0);this.closed=!0,this.sessionDirty=!0,this.flush(!0)}record(e){var s,n;try{if(this.stopped)return;if(this.errors.observe(e),!this.ready){this.pending.length<_t?this.pending.push(e):this.drop();return}(s=this.sockets.get())==null||s.observe(e);let r=((n=this.session.decision)==null?void 0:n.session)===!0;if(!r&&e.type!=="error"&&e.type!=="pageView")return;let o=te(e,this.options.beforeSend,this.drop);if(!o)return;ne(o),o.type==="pageView"&&this.session.entryPath===null&&(this.session.entryPath=o.route,M(this.session));for(let i of this.filter.accept(o,r))this.enqueue(i)}catch (e19){this.drop()}}enqueue(e){if(this.queue.length>=Ge){this.drop();return}this.queue.push(e),this.queue.length>=xt&&!this.flushing&&this.flush(!1)}flush(e){var s,n;if(!(!this.ready||this.flushing||this.transport.isPaused(Date.now()))){this.flushing=!0;try{for(let p of this.connections)p.dirty&&(p.dirty=!1,this.record({...p.event})),p.done&&this.connections.delete(p);let r=this.queue;this.queue=[],this.fillTimings(r);let o=((s=this.session.decision)==null?void 0:s.session)===!0;if(r.length===0&&!(o&&this.sessionDirty))return;let a=this.sessionDirty||this.shared.dropped>0?{id:this.session.id,type:"session",entryPath:(n=this.session.entryPath)!=null?n:"/",sampled:o,closed:this.closed,droppedEvents:this.shared.dropped}:null;this.shared.dropped=0,this.sessionDirty=!1,this.transport.send(this.header(),a?[a,...r]:r,e)}finally{this.flushing=!1}}}header(){let e={sessionId:this.session.id,sessionStartedAt:_chunk2TDEJLQ7js.a.call(void 0, this.session.startedAt)};return this.options.release&&(e.release=this.options.release),this.shared.actor!==void 0&&(e.actor=this.shared.actor),this.shared.attributesSet&&(e.attributes={...this.shared.attributes}),this.shared.featureFlags.hasAny()&&(e.featureFlags={...this.shared.featureFlags.session}),e}fillTimings(e){for(let s of e){let n=this.timings.get(s.id);n&&(this.timings.delete(s.id),Object.assign(s,_chunkTJIA62OAjs.i.call(void 0, n.url,n.startedAt)))}}onResult(e,s,n){if(s==="OK")return;if(s==="CUT"){this.session.cut=!0,M(this.session),this.shutdown();return}let r=e.filter(i=>i.type!=="session"),o=e.find(i=>i.type==="session");if(o&&(this.shared.dropped+=o.droppedEvents,this.sessionDirty=!0),s==="RETRY"&&n===this.session.id){let i=r.slice(0,Math.max(0,Ge-this.queue.length));this.shared.dropped+=r.length-i.length,this.queue=[...i,...this.queue];return}this.shared.dropped+=r.length}},$e=null,f={actor:void 0,attributes:{},attributesSet:!1,dropped:0,featureFlags:new D},v=()=>$e,ce=t=>{$e=t};var Ye=(s=>(s.ALL="ALL",s.ON_ANOMALY="ON_ANOMALY",s))(Ye||{});var S=t=>{try{t()}catch (e20){f.dropped+=1}},En= exports.AbyssRum ={init(t){S(()=>{if(v()||!(t!=null&&t.token)||!t.applicationId||!t.apiUrl&&!t.proxyUrl||typeof window=="undefined"||typeof window.fetch!="function")return;let e=new Q(t,f);ce(e),e.start()})},setActor(t){S(()=>{var s;let e=Se(t);if(e===void 0){f.dropped+=1;return}f.actor=e,(s=v())==null||s.markDirty()})},setAttributes(t){S(()=>{var e;f.attributes=_chunkTJIA62OAjs.a.call(void 0, f.attributes,t,()=>{f.dropped+=1}),f.attributesSet=!0,(e=v())==null||e.markDirty()})},captureError(t,e){S(()=>{var s;return(s=v())==null?void 0:s.captureError(t,e)})},addAction(t,e){S(()=>{var s;return(s=v())==null?void 0:s.addAction(t,e)})},addFeatureFlagEvaluation(t,e){S(()=>{var s;f.featureFlags.add(t,e,()=>f.dropped+=1)&&((s=v())==null||s.markDirty())})},sendFeedback(t){var e,s;return(s=(e=v())==null?void 0:e.sendFeedback(t))!=null?s:Promise.reject(new (0, _chunkLRYKS5XRjs.b)("NO_SESSION"))},showReportDialog(t){S(()=>{var e;return(e=v())==null?void 0:e.showReportDialog(t)})},addTiming(t){S(()=>{var e;return(e=v())==null?void 0:e.addTiming(t)})},startDuration(t,e){S(()=>{var s;return(s=v())==null?void 0:s.startDuration(t,e)})},stopDuration(t){S(()=>{var e;return(e=v())==null?void 0:e.stopDuration(t)})},stop(){S(()=>{var t;(t=v())==null||t.stop(),ce(null),f.actor=void 0,f.attributes={},f.attributesSet=!1,f.dropped=0,f.featureFlags=new D})}};exports.AbyssRum = En; exports.RumFeedbackError = _chunkLRYKS5XRjs.b; exports.RumFeedbackErrorCode = _chunkLRYKS5XRjs.a; exports.RumSocketCaptureMode = Ye;
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  import{a as z,b as A}from"./chunk-QEU2JJHJ.mjs";import{a as I,b as U,c as T,d as ye,e as O,f as w,g as B,h as C,i as Ee}from"./chunk-QL6P3CII.mjs";import{a as b,b as k,c as ge,d as g,e as Z,f as Re,g as ee,h as L,i as H,j as ve,k as R}from"./chunk-57O4BMUU.mjs";import{c as me,d as J,e as F,f as N,g as he,h as fe}from"./chunk-5S3SDOLF.mjs";var Se=t=>t===null?null:typeof t=="string"&&t.trim()!==""?t:void 0;var be=50,D=class{constructor(){this.session={};this.pageViewId=null;this.page={}}add(e,s,n){if(s==null)return n(),!1;let r=!1,o=()=>{r=!0,n()},i={[String(e)]:s};return this.session=I(this.session,i,o,be),r||(this.page=I(this.page,i,o,be)),!r}hasAny(){return Object.keys(this.session).length>0}annotate(e){e.id!==this.pageViewId&&(this.pageViewId!==null&&(this.page={}),this.pageViewId=e.id),Object.keys(this.page).length>0&&(e.featureFlags={...this.page})}};var ze=64,we=(t,e,s,n)=>{if(typeof t!="string"||t.length===0||t.length>ze)return n(),null;let r={id:R(),type:"action",pageViewId:s,occurredAt:b(Date.now()),name:t};if(e!==void 0){let o=I({},e,n);Object.keys(o).length>0&&(r.attributes=o)}return r};var Je=["id","type","sessionId"],Ze=(t,e)=>t==null?e==null||["string","number","boolean"].includes(typeof e):Array.isArray(t)?Array.isArray(e):e!==null&&typeof e==typeof t,te=(t,e,s)=>{if(!e)return t;let n;try{n=e(JSON.parse(JSON.stringify(t)))}catch{return s(),t}if(n===null)return null;if(!n||typeof n!="object"||Array.isArray(n))return s(),null;let r=t,o=n,i={};for(let a of Object.keys(r))if(Je.includes(a))i[a]=r[a];else if(Ze(r[a],o[a]))o[a]!==void 0&&(i[a]=o[a]);else return s(),null;return i};var et=/^([a-z][a-z0-9+.-]*:)\/\//i,tt=["url","blockedUri","sourceFile"],st=["route","referrerRoute","entryPath"],se=t=>{let{host:e,path:s}=J(t);if(e===null)return s;let n=et.exec(t.trim());return`${n?n[1].toLowerCase():"https:"}//${e}${s}`},x=t=>J(t).path,ne=t=>{let e=t;for(let s of tt)typeof e[s]=="string"&&(e[s]=se(e[s]));for(let s of st)typeof e[s]=="string"&&(e[s]=x(e[s]));return t};var nt=20,rt=256,ke='[data-abyss-privacy="hidden"]',ot=`${ke},[data-testid],[aria-label],button,a,input,select,textarea,summary,[role="button"],[role="link"]`,Ie=(t,e)=>{let s=t.getAttribute(e);return s===null?null:s.slice(0,rt)},re=t=>{var s,n;let e=(n=((s=t.closest(ke))!=null?s:t).closest(ot))!=null?n:t;return{tag:e.tagName.toLowerCase().slice(0,64),testId:Ie(e,"data-testid"),ariaLabel:Ie(e,"aria-label")}},q=class{constructor(){this.items=[];this.lastPageViewId=null}observe(e){e.type==="pageView"&&e.id!==this.lastPageViewId?(this.lastPageViewId=e.id,this.add({kind:"NAVIGATION",route:x(e.route)})):e.type==="request"&&e.kind!=="WEBSOCKET"&&e.kind!=="SSE"&&this.add({kind:"REQUEST",method:e.method,url:se(e.url),status:e.status})}click(e){e instanceof Element&&this.add({kind:"CLICK",element:re(e)})}snapshot(){return this.items.map(e=>({...e}))}add(e){this.items.push({...e,occurredAt:b(Date.now())}),this.items.length>nt&&this.items.shift()}};var it=/^\s*at\s|@\S+:\d+/,at=t=>{var e,s;return(s=(e=(t!=null?t:"").split(`
2
- `).find(n=>it.test(n)))==null?void 0:e.trim())!=null?s:""},W=class{constructor(e){this.release=e;this.held=new Map}add(e){var r;let s=`${(r=e.pageViewId)!=null?r:""}${e.message}${at(e.stack)}`,n=this.held.get(s);if(n){n.event.repeat+=1;return}this.held.set(s,{event:e,timer:setTimeout(()=>this.releaseKey(s),1e4)})}flush(){[...this.held.keys()].forEach(e=>this.releaseKey(e))}clear(){this.held.forEach(e=>clearTimeout(e.timer)),this.held.clear()}releaseKey(e){let s=this.held.get(e);s&&(clearTimeout(s.timer),this.held.delete(e),this.release(s.event))}};var ut=/^ResizeObserver loop/,dt=/^Script error\.?$/,lt=t=>{let e=t;return e&&typeof e=="object"&&typeof e.message=="string"?{name:typeof e.name=="string"&&e.name?e.name:"Error",message:e.message,stack:typeof e.stack=="string"?e.stack:null}:{name:"Error",message:ge(t),stack:null}},ct=t=>{if(!t||typeof t!="object")return;let e=Object.entries(t).filter(([,s])=>typeof s=="string");return e.length>0?Object.fromEntries(e):void 0},pt=t=>ut.test(t.message)||dt.test(t.message)&&!t.stack,j=class{constructor(e){this.host=e;this.breadcrumbs=new q;this.pageViewId=null;this.dedup=new W(s=>e.record(s))}capture(e,s){let n=lt(e);if(pt(n)){this.host.drop();return}this.host.captured();let r=ct(s);this.dedup.add({id:R(),type:"error",pageViewId:this.host.pageViewId(),occurredAt:b(Date.now()),route:this.host.resolveRoute(),...n,breadcrumbs:this.breadcrumbs.snapshot(),repeat:1,...r?{context:r}:{}})}observe(e){this.breadcrumbs.observe(e),e.type==="pageView"&&e.id!==this.pageViewId&&(this.pageViewId!==null&&this.dedup.flush(),this.pageViewId=e.id)}install(){let e=n=>()=>{try{n()}catch{this.host.drop()}},s=[g(window,"error",n=>{n.target instanceof Element||e(()=>{var r;return this.capture((r=n.error)!=null?r:n.message)})()}),g(window,"unhandledrejection",n=>e(()=>this.capture(n.reason))()),g(window,"click",n=>e(()=>this.breadcrumbs.click(n.target))(),!0),g(window,"pagehide",e(()=>this.dedup.flush())),g(document,"visibilitychange",e(()=>{document.visibilityState==="hidden"&&this.dedup.flush()}))];return()=>{s.forEach(n=>n()),this.dedup.clear()}}};var ht=123,ie=(t,e,s)=>{let n=T(String(s));if(!n)return null;let r=n.href,o=null;O(t,n)&&(o=R(),n.searchParams.set(he,o),n.searchParams.set(fe,t.sessionId()));let i=Date.now(),a=C(t,e,"GET",r,i,o);Object.assign(a,{connectMs:null,messagesIn:0,messagesOut:0,bytesIn:0,bytesOut:0,droppedMessages:0});let p={event:a,startedAt:i,opened:!1,dirty:!0,done:!1};return t.trackConnection(p),{connection:p,nativeUrl:o===null?String(s):n.href}},ae=t=>{t.opened||(t.opened=!0,t.event.connectMs=Date.now()-t.startedAt,t.dirty=!0)},K=(t,e,s)=>{var r,o,i,a;let{event:n}=t;e==="in"?(n.messagesIn=((r=n.messagesIn)!=null?r:0)+1,n.bytesIn=((o=n.bytesIn)!=null?o:0)+ee(s)):(n.messagesOut=((i=n.messagesOut)!=null?i:0)+1,n.bytesOut=((a=n.bytesOut)!=null?a:0)+ee(s)),t.dirty=!0},X=(t,e)=>{t.done||(t.event.durationMs=Date.now()-t.startedAt,t.event.outcome=e,t.done=!0,t.dirty=!0)},Ae=(t,e)=>({direction:t,data:e,at:Date.now(),eventName:null,eventId:null}),ft=(t,e,s,n)=>{if(s)return"ABORTED";if(t&&(e===1e3||e===1001||n&&e===1005))return"SUCCESS";let r=w();return r==="OFFLINE"||!t?r:"HTTP_ERROR"},Te=t=>{let e=window.WebSocket;if(typeof e!="function")return()=>{};let s=e.prototype,n=s.send,r=s.close,o=new WeakMap,i=(u,d)=>{o.set(u,d),u.addEventListener("open",()=>ae(d)),u.addEventListener("message",c=>{K(d,"in",c.data),t.socketMessage(d,Ae("IN",c.data))}),u.addEventListener("close",c=>{let h=o.get(u);d.event.closeCode=c.code,d.event.closeReason=c.reason?Re(c.reason,ht):null,X(d,ft(d.opened,c.code,(h==null?void 0:h.abortedByApp)===!0,(h==null?void 0:h.closedByApp)===!0)),t.socketClosed(d)})},a=new Proxy(e,{construct(u,d,c){let h=null;try{h=ie(t,"WEBSOCKET",d[0])}catch{t.drop()}let y=h?[h.nativeUrl,...d.slice(1)]:d,m=Reflect.construct(u,y,c===a?u:c);return h&&i(m,h.connection),m}}),p=function(u){n.call(this,u);let d=o.get(this);d&&(K(d,"out",u),t.socketMessage(d,Ae("OUT",u)))},l=function(u,d){let c=o.get(this);return c&&(c.abortedByApp=this.readyState===e.CONNECTING,c.closedByApp=!0),r.apply(this,arguments)};return window.WebSocket=a,s.send=p,s.close=l,()=>{window.WebSocket===a&&(window.WebSocket=e),s.send===p&&(s.send=n),s.close===l&&(s.close=r)}};var Oe=t=>{let e=window,s=e.EventSource;if(typeof s!="function")return()=>{};let n=s.prototype,r=n.close,o=new WeakMap,i=(l,u)=>{o.set(l,u),u.event.reconnectCount=0,l.addEventListener("open",()=>ae(u)),l.addEventListener("message",d=>{K(u,"in",d.data),t.socketMessage(u,{direction:"IN",data:d.data,at:Date.now(),eventName:d.type,eventId:d.lastEventId||null})}),l.addEventListener("error",()=>{var c;if(l.readyState===s.CONNECTING){u.event.reconnectCount=((c=u.event.reconnectCount)!=null?c:0)+1,u.dirty=!0;return}let d=w();X(u,u.opened&&d!=="OFFLINE"?"HTTP_ERROR":d),t.socketClosed(u)})},a=new Proxy(s,{construct(l,u,d){let c=null;try{c=ie(t,"SSE",u[0])}catch{t.drop()}let h=c?[c.nativeUrl,...u.slice(1)]:u,y=Reflect.construct(l,h,d===a?l:d);return c&&i(y,c.connection),y}}),p=function(){r.call(this);let l=o.get(this);l&&(X(l,l.opened?"SUCCESS":"ABORTED"),t.socketClosed(l))};return e.EventSource=a,n.close=p,()=>{e.EventSource===a&&(e.EventSource=s),n.close===p&&(n.close=r)}};var gt=(t,e,s)=>{var u,d,c;let n=typeof Request!="undefined"&&e instanceof Request?e:null,r=T(n?n.url:String(e));if(!r)return null;let o=((d=(u=s==null?void 0:s.method)!=null?u:n==null?void 0:n.method)!=null?d:"GET").toUpperCase(),i=Date.now(),a=null,p=s;if(O(t,r)){a=R();let h=new Headers((c=s==null?void 0:s.headers)!=null?c:n==null?void 0:n.headers);h.set(F,a),h.set(N,t.sessionId()),p={...s,headers:h}}let l=C(t,"FETCH",o,r.href,i,a);return t.trackTiming(l.id,r.href,i),{event:l,init:p,startedAt:i}},Rt=(t,e,s)=>{let{event:n}=e;if(n.durationMs=Date.now()-e.startedAt,n.status=s.status,n.outcome=B(s.status),n.instrumented||s.status<400){t.record(n);return}s.clone().text().then(r=>{n.responseBodyExcerpt=r.slice(0,U),t.record(n)},()=>t.record(n))},Ce=t=>{let e=window.fetch;if(typeof e!="function")return()=>{};let s=(n,r)=>{let o=null;try{o=gt(t,n,r)}catch{t.drop()}let i=e.call(window,n,o?o.init:r);if(o){let a=o;i.then(p=>{try{Rt(t,a,p)}catch{t.drop()}},p=>{a.event.durationMs=Date.now()-a.startedAt,a.event.outcome=w(p),t.record(a.event)})}return i};return window.fetch=s,()=>{window.fetch===s&&(window.fetch=e)}};var De=t=>{let e=window.XMLHttpRequest;if(typeof e!="function")return()=>{};let s=e.prototype,n=s.open,r=s.send,o=new WeakMap,i=function(l,u){try{o.set(this,{method:String(l).toUpperCase(),url:String(u)})}catch{t.drop()}return n.apply(this,arguments)},a=(l,u,d)=>{let c=T(d);if(!c)return;let h=Date.now(),y=null;O(t,c)&&(y=R(),l.setRequestHeader(F,y),l.setRequestHeader(N,t.sessionId()));let m=C(t,"XHR",u,c.href,h,y);t.trackTiming(m.id,c.href,h);let E=null;l.addEventListener("error",()=>E=w()),l.addEventListener("abort",()=>E="ABORTED"),l.addEventListener("timeout",()=>E="TIMEOUT"),l.addEventListener("loadend",()=>{m.durationMs=Date.now()-h,m.status=E===null&&l.status>0?l.status:null,m.outcome=m.status===null?E!=null?E:w():B(m.status),!m.instrumented&&m.status!==null&&m.status>=400&&(l.responseType===""||l.responseType==="text")&&(m.responseBodyExcerpt=l.responseText.slice(0,U)),t.record(m)})},p=function(l){let u=o.get(this);if(u)try{a(this,u.method,u.url)}catch{t.drop()}return r.call(this,l)};return s.open=i,s.send=p,()=>{s.open===i&&(s.open=n),s.send===p&&(s.send=r)}};var V=class{constructor(e,s){this.max=e;this.drop=s;this.value=null;this.calls=null;this.failed=!1}get(){return this.value}hold(){!this.value&&!this.calls&&(this.calls=[])}run(e){if(this.value)try{e(this.value)}catch{this.drop()}else this.calls&&this.calls.length<this.max?this.calls.push(e):(this.calls||this.failed)&&this.drop()}resolve(e){var n;let s=(n=this.calls)!=null?n:[];this.calls=null,this.value=e,s.forEach(r=>this.run(r))}fail(){var e;((e=this.calls)!=null?e:[]).forEach(()=>this.drop()),this.calls=null,this.failed=!0}close(){this.value=null,this.calls=null}};var yt={reload:"RELOAD",back_forward:"BACK_FORWARD"},Me=()=>{try{return performance.getEntriesByType("navigation")[0]}catch{return}},Pe=t=>({dnsMs:t?k(t.domainLookupStart,t.domainLookupEnd):null,tcpMs:t?k(t.connectStart,t.connectEnd):null,tlsMs:t&&t.secureConnectionStart>0?k(t.secureConnectionStart,t.connectEnd):null,requestMs:t?k(t.requestStart,t.responseStart):null,responseMs:t?k(t.responseStart,t.responseEnd):null,domProcessingMs:t?k(t.responseEnd,t.domComplete):null,loadMs:t&&t.loadEventEnd>0?Math.round(t.loadEventEnd-t.startTime):null}),xe=t=>{var h,y;let e=null,s=null,n=(m,E=null,Qe)=>{let pe=Date.now();return e={startedAt:pe,path:window.location.pathname,event:{id:R(),type:"pageView",route:t.resolveRoute(),referrerRoute:E,startedAt:b(pe),durationMs:null,navigationType:m,lcpMs:null,inpMs:null,cls:null,fcpMs:null,ttfbMs:null,dnsMs:null,tcpMs:null,tlsMs:null,requestMs:null,responseMs:null,domProcessingMs:null,loadMs:null,longTaskCount:0,longTaskTotalMs:0,...Qe}},t.record({...e.event}),e.event.id},r=()=>{e&&(e.event.durationMs=Date.now()-e.startedAt,t.record({...e.event}))},o=()=>{try{if(t.onNavigation(),e&&window.location.pathname!==e.path){let m=e.event.route;r(),n("SPA",m)}}catch{t.drop()}},i=()=>{e&&e.event.id===s&&(Object.assign(e.event,Pe(Me())),t.record({...e.event}))},a=Me(),p=document.readyState==="complete",l=(y=yt[(h=a==null?void 0:a.type)!=null?h:""])!=null?y:"NAVIGATE";s=n(l,null,p?Pe(a):void 0);let u=[g(window,"popstate",o)];if(!p){let m;u.push(g(window,"load",()=>{m=setTimeout(i,0)}),()=>clearTimeout(m))}let d=window.history.pushState,c=function(...m){let E=d.apply(this,m);return o(),E};return window.history.pushState=c,u.push(()=>{window.history.pushState===c&&(window.history.pushState=d)}),{currentId:()=>{var m;return(m=e==null?void 0:e.event.id)!=null?m:null},start:m=>{n(m)},end:r,stop:()=>u.forEach(m=>m())}};var _e=t=>t.replace(/\/+$/,""),G=(t,e)=>`${t.proxyUrl?`${_e(t.proxyUrl)}/rum`:`${_e(t.apiUrl)}/api/rum`}/${encodeURIComponent(t.applicationId)}/${e}?token=${encodeURIComponent(t.token)}`;var Fe="abyss-rum-config",Et=600*1e3,Ve=t=>typeof t=="number"&&t>=0&&t<=1?t:0,Ne=t=>{var n,r;let e=t;if(!e||typeof e.enabled!="boolean"||typeof e.sessionSampleRate!="number")return null;let s=(n=e.replay)!=null?n:{};return{enabled:e.enabled,sessionSampleRate:Ve(e.sessionSampleRate),sessionQuotaExhausted:e.sessionQuotaExhausted===!0,country:typeof e.country=="string"?e.country:null,feedbackEnabled:e.feedbackEnabled===!0,replay:{enabled:s.enabled===!0,sampleRate:Ve(s.sampleRate),unmaskSelectors:Array.isArray(s.unmaskSelectors)?s.unmaskSelectors.filter(o=>typeof o=="string"):[],maxSessionBytes:s.maxSessionBytes,defaultPrivacy:s.defaultPrivacy},socketMessages:{enabled:((r=e.socketMessages)==null?void 0:r.enabled)===!0}}},Le=(t,e)=>{let s=L(Fe);if(!s||s.key!==t||typeof s.at!="number")return;let n=e-s.at;return n>=0&&n<Et?Ne(s.config):void 0},He=async(t,e,s,n)=>{let r=null;try{let o=await e(t,{credentials:"omit"});r=o.ok?Ne(await o.json()):null}catch{r=null}return H(Fe,{key:s,at:n,config:r}),r};var St=/iPad|Tablet|PlayBook|Silk|Android(?!.*Mobile)/i,bt=/Mobi|iPhone|iPod|Android|Opera Mini|IEMobile/i,wt=[[/Edg(e|A|iOS)?\//,"Edge"],[/OPR\/|Opera/,"Opera"],[/SamsungBrowser\//,"Samsung Internet"],[/Firefox\/|FxiOS\//,"Firefox"],[/Chrome\/|CriOS\//,"Chrome"],[/Safari\//,"Safari"]],Ue=t=>St.test(t)?"tablet":bt.test(t)?"mobile":"desktop",Be=t=>{var e,s;return(s=(e=wt.find(([n])=>n.test(t)))==null?void 0:e[1])!=null?s:"Other"},qe=(t,e,s,n)=>{if(!t)return s;try{let r=t({...e,attributes:{...e.attributes}});if(typeof(r==null?void 0:r.session)=="boolean"&&typeof r.replay=="boolean")return{session:r.session,replay:r.replay}}catch{}return n(),s};var It=200,kt=(t,e,s)=>({session:t<e,replay:t<e*s}),We=(t,e,s,n)=>{let r=kt(t.random,t.sessionSampleRate,t.replaySampleRate),o=qe(e,t,r,n),i=o.session&&!s;return{session:i,replay:i&&o.replay}},At=t=>t.type==="request"&&(t.kind==="FETCH"||t.kind==="XHR")&&t.outcome==="SUCCESS",$=class{constructor(e){this.onDrop=e;this.held=null;this.released=new Set;this.successes=new Map}accept(e,s){var r,o,i;if(s){if(At(e)){let a=(r=e.pageViewId)!=null?r:"",p=((o=this.successes.get(a))!=null?o:0)+1;if(this.successes.set(a,p),p>It)return this.onDrop(),[]}return[e]}if(e.type==="pageView")return this.released.has(e.id)?[e]:(this.held=e,[]);if(e.type!=="error")return[];let n=[];return e.pageViewId!==null&&!this.released.has(e.pageViewId)&&(this.released.add(e.pageViewId),((i=this.held)==null?void 0:i.id)===e.pageViewId&&(n.push(this.held),this.held=null)),n.push(e),n}reset(){this.held=null,this.released.clear(),this.successes.clear()}};var ue="abyss-rum-session",Tt=1800*1e3,Ot=14400*1e3,de=(t,e)=>e-t.lastActivityAt>=Tt||e-t.startedAt>=Ot,Ct=t=>typeof(t==null?void 0:t.session)=="boolean"&&typeof t.replay=="boolean",Dt=()=>{let t=L(ue);return!t||!me(t.id)||typeof t.startedAt!="number"||typeof t.lastActivityAt!="number"||typeof t.random!="number"?null:{id:t.id,startedAt:t.startedAt,lastActivityAt:t.lastActivityAt,random:t.random,decision:Ct(t.decision)?t.decision:null,entryPath:typeof t.entryPath=="string"?t.entryPath:null,cut:t.cut===!0}},M=t=>H(ue,t),je=()=>ve(ue),le=t=>{let e={id:R(),startedAt:t,lastActivityAt:t,random:Math.random(),decision:null,entryPath:null,cut:!1};return M(e),e},Ke=t=>{let e=Dt();return e&&!de(e,t)?e:le(t)};var Xe=64*1024,Mt=60*1e3;var Y=class{constructor(e,s,n){this.url=e;this.fetchImpl=s;this.handlers=n;this.pausedUntil=0}isPaused(e){return e<this.pausedUntil}send(e,s,n){let r=JSON.stringify({...e,events:[]}).slice(0,-2),o=Z(r)+2,i=[],a=[],p=o;for(let l of s){let u=JSON.stringify(l),d=Z(u);if(o+d>Xe){this.handlers.onDrop(1);continue}let c=d+(i.length>0?1:0);p+c>Xe&&(this.post(`${r}${i.join(",")}]}`,a,n,e.sessionId),i=[],a=[],p=o),p+=d+(i.length>0?1:0),i.push(u),a.push(l)}i.length>0&&this.post(`${r}${i.join(",")}]}`,a,n,e.sessionId)}post(e,s,n,r){let o=i=>this.handlers.onResult(s,i,r);if(n&&this.beacon(e)){o("OK");return}this.fetchImpl(this.url,{method:"POST",body:e,keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain;charset=UTF-8"}}).then(i=>this.handle(i,o),()=>o("FAIL")).catch(()=>this.handlers.onDrop(1))}beacon(e){try{return typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(this.url,e)}catch{return!1}}async handle(e,s){if(e.status===429){this.pausedUntil=Date.now()+Mt,s("RETRY");return}if(e.status===401||e.status===403||e.status===404){s("CUT");return}if(!e.ok){s("FAIL");return}s("OK");let n=!1;try{n=(await e.json()).liveWatched===!0}catch{}this.handlers.onLiveWatched(n)}};var Pt=5e3,xt=50,Ge=200,_t=50,Vt=100,Ft=200,Q=class{constructor(e,s){this.options=e;this.shared=s;this.config=null;this.ready=!1;this.stopped=!1;this.flushing=!1;this.pending=[];this.queue=[];this.teardowns=[];this.pageViews=null;this.lastPageViewId=null;this.deferred=new V(Vt,()=>this.drop());this.sockets=new V(Ft,()=>this.drop());this.errors=new j({pageViewId:()=>this.pageViewId(),resolveRoute:()=>this.resolveRoute(),record:e=>this.record(e),drop:()=>this.drop(),captured:()=>{var s;let e=Date.now();(s=this.deferred.get())==null||s.frustration.notifyError(),this.sockets.run(n=>n.anomaly(e))}});this.connections=new Set;this.timings=new Map;this.sessionDirty=!0;this.closed=!1;this.liveWatched=!1;this.drop=()=>{this.shared.dropped+=1};this.pageViewId=()=>{var e,s;return(s=(e=this.pageViews)==null?void 0:e.currentId())!=null?s:null};var r;let n=window.fetch;this.nativeFetch=(o,i)=>n.call(window,o,i),this.instrumentedOrigins=((r=e.instrumentedOrigins)!=null?r:[]).map(o=>ye(String(o))).filter(o=>o!==null),this.filter=new $(this.drop),this.transport=new Y(G(e,"batch"),this.nativeFetch,{onResult:(o,i,a)=>this.guard(()=>this.onResult(o,i,a)),onLiveWatched:o=>{this.liveWatched=o},onDrop:o=>{this.shared.dropped+=o}}),this.session=Ke(Date.now()),this.deferred.hold()}start(){if(this.session.cut){this.stopped=!0;return}let e=Date.now(),s=`${this.options.applicationId}:${this.options.token}`,n=Le(s,e);if(n!==void 0){this.configure(n);return}He(G(this.options,"config"),this.nativeFetch,s,e).then(r=>this.guard(()=>this.configure(r)),this.drop)}stop(){this.shutdown(),je()}captureError(e,s){this.errors.capture(e,s)}addAction(e,s){let n=we(e,s,this.pageViewId(),this.drop);n&&this.record(n)}addTiming(e){let s=Date.now();this.deferred.run(n=>n.perf.timings.addTiming(e,s))}startDuration(e,s){let n=Date.now();this.deferred.run(r=>r.perf.timings.startDuration(e,s,n))}stopDuration(e){let s=Date.now();this.deferred.run(n=>n.perf.timings.stopDuration(e,s))}sendFeedback(e){let s=this.feedbackState();return s!==null?Promise.reject(new A(s)):this.feedback((n,r)=>n.sendFeedback(r,e))}showReportDialog(e){this.feedbackState()===null&&this.feedback((s,n)=>s.showReportDialog(n,e!=null?e:{})).catch(this.drop)}markDirty(){this.sessionDirty=!0}guard(e){try{e()}catch{this.drop()}}load(e,s){e.catch(()=>{this.drop(),s()})}feedback(e){return import("./send-KNP5EOEZ.mjs").then(s=>e(s,this.feedbackHost()),()=>{throw new A("SEND_FAILED")})}feedbackState(){var e;return!this.ready||this.stopped?"NO_SESSION":((e=this.config)==null?void 0:e.feedbackEnabled)===!0?null:"FEEDBACK_DISABLED"}feedbackHost(){return{unavailable:()=>this.feedbackState(),sessionId:()=>this.session.id,sessionStartedAt:()=>this.session.startedAt,pageViewId:this.pageViewId,resolveRoute:()=>this.resolveRoute(),prepare:e=>{let s=te(e,this.options.beforeSend,this.drop);return s&&ne(s)},post:e=>(this.flush(!1),this.nativeFetch(G(this.options,"feedback"),{method:"POST",body:JSON.stringify({...this.header(),events:[e]}),keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain;charset=UTF-8"}}).then(s=>s.status)),sent:e=>this.guard(()=>{var s,n;return(n=(s=this.options).onFeedbackSent)==null?void 0:n.call(s,e)})}}loadDeferred(e){this.load(import("./deferred-P4QMIWWX.mjs").then(({installDeferred:s})=>this.guard(()=>{if(this.stopped)return;let n=s({instrument:e,resolveRoute:()=>this.resolveRoute(),captureConsole:this.options.captureConsole!==!1,describe:re});this.teardowns.push(n.teardown),this.deferred.resolve(n)})),()=>this.deferred.fail())}loadReplay(){var e;!this.replaying&&((e=this.session.decision)!=null&&e.replay)&&this.config.replay.enabled&&(this.replaying=import("./replay-ARIOEM3I.mjs").then(({recordReplay:s})=>s(this)).catch(this.drop))}loadSocketCapture(e){var n;let s=this.options.captureSocketMessages;!s||!e.socketMessages.enabled||((n=this.session.decision)==null?void 0:n.session)!==!0||(this.sockets.hold(),this.load(import("./socket-messages-TSBDPTWJ.mjs").then(({SocketMessageCapture:r})=>this.guard(()=>{this.stopped||this.sockets.resolve(new r(s,{sessionId:()=>this.session.id,record:o=>this.record(o),drop:this.drop}))})),()=>this.sockets.fail()))}onPageView(e){var s,n;this.shared.featureFlags.annotate(e),(s=this.deferred.get())==null||s.perf.annotate(e),this.record(e),e.id!==this.lastPageViewId&&(this.lastPageViewId=e.id,(n=this.deferred.get())==null||n.frustration.notifyActivity()),this.deferred.run(r=>r.perf.pageViewSent(e))}configure(e){if(this.stopped)return;if(!e||!e.enabled){this.shutdown();return}this.config=e,this.session.decision||this.decide(),this.ready=!0,this.install(),this.loadSocketCapture(e),this.loadReplay();let s=this.pending;this.pending=[];let n=this.pageViewId();for(let r of s)(r.type==="error"||r.type==="action")&&r.pageViewId===null&&(r.pageViewId=n),this.record(r)}decide(){let e=this.config,s=navigator.userAgent;this.session.decision=We({route:x(this.resolveRoute()),deviceType:Ue(s),browserFamily:Be(s),country:e.country,attributes:{...this.shared.attributes},random:this.session.random,sessionSampleRate:e.sessionSampleRate,replaySampleRate:e.replay.sampleRate},this.options.sampler,e.sessionQuotaExhausted,this.drop),M(this.session)}install(){let e={instrumentedOrigins:this.instrumentedOrigins,sessionId:()=>this.session.id,pageViewId:this.pageViewId,record:r=>this.record(r),drop:this.drop,trackTiming:(r,o,i)=>{var a;this.timings.set(r,{url:o,startedAt:i}),(a=this.deferred.get())==null||a.frustration.notifyActivity()},trackConnection:r=>this.connections.add(r),socketMessage:(r,o)=>this.sockets.run(i=>i.message(r,o)),socketClosed:r=>{let o=Date.now();this.sockets.run(i=>i.closed(r,o))}};this.pageViews=xe({resolveRoute:()=>this.resolveRoute(),record:r=>this.onPageView(r),onNavigation:()=>this.touch(),drop:this.drop});let s=setInterval(()=>this.guard(()=>this.flush(!1)),Pt),n=()=>this.guard(()=>this.touch());this.teardowns=[this.pageViews.stop,()=>clearInterval(s),Ce(e),De(e),Te(e),Oe(e),g(window,"click",n,!0),g(window,"keydown",n,!0),this.errors.install(),g(window,"pagehide",()=>this.guard(()=>this.onPageHide())),g(window,"pageshow",r=>this.guard(()=>{var o;r.persisted&&(this.closed=!1,this.sessionDirty=!0,(o=this.pageViews)==null||o.start("BACK_FORWARD"))})),g(document,"visibilitychange",()=>this.guard(()=>{var r;document.visibilityState==="hidden"&&((r=this.deferred.get())==null||r.perf.hidden(),this.flush(!0))}))],this.loadDeferred(e)}shutdown(){this.stopped=!0,this.ready=!1;let e=this.teardowns;this.teardowns=[],e.reverse().forEach(s=>this.guard(s)),this.deferred.close(),this.sockets.close(),this.pending=[],this.queue=[],this.connections.clear(),this.timings.clear()}resolveRoute(){let{routeResolver:e}=this.options;if(e)try{return String(e(window.location))}catch{this.drop()}return window.location.pathname}touch(){var s,n;if(!this.ready)return;let e=Date.now();if(!de(this.session,e)){this.session.lastActivityAt=e,M(this.session);return}(s=this.pageViews)==null||s.end(),this.flush(!1),this.shared.dropped+=this.queue.length,this.queue=[],this.session=le(e),this.decide(),this.loadReplay(),this.filter.reset(),this.sessionDirty=!0,this.closed=!1,(n=this.pageViews)==null||n.start("SPA")}onPageHide(){var e;(e=this.pageViews)==null||e.end();for(let s of this.connections)s.done||(s.event.durationMs=Date.now()-s.startedAt,s.done=!0,s.dirty=!0);this.closed=!0,this.sessionDirty=!0,this.flush(!0)}record(e){var s,n;try{if(this.stopped)return;if(this.errors.observe(e),!this.ready){this.pending.length<_t?this.pending.push(e):this.drop();return}(s=this.sockets.get())==null||s.observe(e);let r=((n=this.session.decision)==null?void 0:n.session)===!0;if(!r&&e.type!=="error"&&e.type!=="pageView")return;let o=te(e,this.options.beforeSend,this.drop);if(!o)return;ne(o),o.type==="pageView"&&this.session.entryPath===null&&(this.session.entryPath=o.route,M(this.session));for(let i of this.filter.accept(o,r))this.enqueue(i)}catch{this.drop()}}enqueue(e){if(this.queue.length>=Ge){this.drop();return}this.queue.push(e),this.queue.length>=xt&&!this.flushing&&this.flush(!1)}flush(e){var s,n;if(!(!this.ready||this.flushing||this.transport.isPaused(Date.now()))){this.flushing=!0;try{for(let p of this.connections)p.dirty&&(p.dirty=!1,this.record({...p.event})),p.done&&this.connections.delete(p);let r=this.queue;this.queue=[],this.fillTimings(r);let o=((s=this.session.decision)==null?void 0:s.session)===!0;if(r.length===0&&!(o&&this.sessionDirty))return;let a=this.sessionDirty||this.shared.dropped>0?{id:this.session.id,type:"session",entryPath:(n=this.session.entryPath)!=null?n:"/",sampled:o,closed:this.closed,droppedEvents:this.shared.dropped}:null;this.shared.dropped=0,this.sessionDirty=!1,this.transport.send(this.header(),a?[a,...r]:r,e)}finally{this.flushing=!1}}}header(){let e={sessionId:this.session.id,sessionStartedAt:b(this.session.startedAt)};return this.options.release&&(e.release=this.options.release),this.shared.actor!==void 0&&(e.actor=this.shared.actor),this.shared.attributesSet&&(e.attributes={...this.shared.attributes}),this.shared.featureFlags.hasAny()&&(e.featureFlags={...this.shared.featureFlags.session}),e}fillTimings(e){for(let s of e){let n=this.timings.get(s.id);n&&(this.timings.delete(s.id),Object.assign(s,Ee(n.url,n.startedAt)))}}onResult(e,s,n){if(s==="OK")return;if(s==="CUT"){this.session.cut=!0,M(this.session),this.shutdown();return}let r=e.filter(i=>i.type!=="session"),o=e.find(i=>i.type==="session");if(o&&(this.shared.dropped+=o.droppedEvents,this.sessionDirty=!0),s==="RETRY"&&n===this.session.id){let i=r.slice(0,Math.max(0,Ge-this.queue.length));this.shared.dropped+=r.length-i.length,this.queue=[...i,...this.queue];return}this.shared.dropped+=r.length}},$e=null,f={actor:void 0,attributes:{},attributesSet:!1,dropped:0,featureFlags:new D},v=()=>$e,ce=t=>{$e=t};var Ye=(s=>(s.ALL="ALL",s.ON_ANOMALY="ON_ANOMALY",s))(Ye||{});var S=t=>{try{t()}catch{f.dropped+=1}},En={init(t){S(()=>{if(v()||!(t!=null&&t.token)||!t.applicationId||!t.apiUrl&&!t.proxyUrl||typeof window=="undefined"||typeof window.fetch!="function")return;let e=new Q(t,f);ce(e),e.start()})},setActor(t){S(()=>{var s;let e=Se(t);if(e===void 0){f.dropped+=1;return}f.actor=e,(s=v())==null||s.markDirty()})},setAttributes(t){S(()=>{var e;f.attributes=I(f.attributes,t,()=>{f.dropped+=1}),f.attributesSet=!0,(e=v())==null||e.markDirty()})},captureError(t,e){S(()=>{var s;return(s=v())==null?void 0:s.captureError(t,e)})},addAction(t,e){S(()=>{var s;return(s=v())==null?void 0:s.addAction(t,e)})},addFeatureFlagEvaluation(t,e){S(()=>{var s;f.featureFlags.add(t,e,()=>f.dropped+=1)&&((s=v())==null||s.markDirty())})},sendFeedback(t){var e,s;return(s=(e=v())==null?void 0:e.sendFeedback(t))!=null?s:Promise.reject(new A("NO_SESSION"))},showReportDialog(t){S(()=>{var e;return(e=v())==null?void 0:e.showReportDialog(t)})},addTiming(t){S(()=>{var e;return(e=v())==null?void 0:e.addTiming(t)})},startDuration(t,e){S(()=>{var s;return(s=v())==null?void 0:s.startDuration(t,e)})},stopDuration(t){S(()=>{var e;return(e=v())==null?void 0:e.stopDuration(t)})},stop(){S(()=>{var t;(t=v())==null||t.stop(),ce(null),f.actor=void 0,f.attributes={},f.attributesSet=!1,f.dropped=0,f.featureFlags=new D})}};export{En as AbyssRum,A as RumFeedbackError,z as RumFeedbackErrorCode,Ye as RumSocketCaptureMode};
2
+ `).find(n=>it.test(n)))==null?void 0:e.trim())!=null?s:""},W=class{constructor(e){this.release=e;this.held=new Map}add(e){var r;let s=`${(r=e.pageViewId)!=null?r:""}${e.message}${at(e.stack)}`,n=this.held.get(s);if(n){n.event.repeat+=1;return}this.held.set(s,{event:e,timer:setTimeout(()=>this.releaseKey(s),1e4)})}flush(){[...this.held.keys()].forEach(e=>this.releaseKey(e))}clear(){this.held.forEach(e=>clearTimeout(e.timer)),this.held.clear()}releaseKey(e){let s=this.held.get(e);s&&(clearTimeout(s.timer),this.held.delete(e),this.release(s.event))}};var ut=/^ResizeObserver loop/,dt=/^Script error\.?$/,lt=t=>{let e=t;return e&&typeof e=="object"&&typeof e.message=="string"?{name:typeof e.name=="string"&&e.name?e.name:"Error",message:e.message,stack:typeof e.stack=="string"?e.stack:null}:{name:"Error",message:ge(t),stack:null}},ct=t=>{if(!t||typeof t!="object")return;let e=Object.entries(t).filter(([,s])=>typeof s=="string");return e.length>0?Object.fromEntries(e):void 0},pt=t=>ut.test(t.message)||dt.test(t.message)&&!t.stack,j=class{constructor(e){this.host=e;this.breadcrumbs=new q;this.pageViewId=null;this.dedup=new W(s=>e.record(s))}capture(e,s){let n=lt(e);if(pt(n)){this.host.drop();return}this.host.captured();let r=ct(s);this.dedup.add({id:R(),type:"error",pageViewId:this.host.pageViewId(),occurredAt:b(Date.now()),route:this.host.resolveRoute(),...n,breadcrumbs:this.breadcrumbs.snapshot(),repeat:1,...r?{context:r}:{}})}observe(e){this.breadcrumbs.observe(e),e.type==="pageView"&&e.id!==this.pageViewId&&(this.pageViewId!==null&&this.dedup.flush(),this.pageViewId=e.id)}install(){let e=n=>()=>{try{n()}catch{this.host.drop()}},s=[g(window,"error",n=>{n.target instanceof Element||e(()=>{var r;return this.capture((r=n.error)!=null?r:n.message)})()}),g(window,"unhandledrejection",n=>e(()=>this.capture(n.reason))()),g(window,"click",n=>e(()=>this.breadcrumbs.click(n.target))(),!0),g(window,"pagehide",e(()=>this.dedup.flush())),g(document,"visibilitychange",e(()=>{document.visibilityState==="hidden"&&this.dedup.flush()}))];return()=>{s.forEach(n=>n()),this.dedup.clear()}}};var ht=123,ie=(t,e,s)=>{let n=T(String(s));if(!n)return null;let r=n.href,o=null;O(t,n)&&(o=R(),n.searchParams.set(he,o),n.searchParams.set(fe,t.sessionId()));let i=Date.now(),a=C(t,e,"GET",r,i,o);Object.assign(a,{connectMs:null,messagesIn:0,messagesOut:0,bytesIn:0,bytesOut:0,droppedMessages:0});let p={event:a,startedAt:i,opened:!1,dirty:!0,done:!1};return t.trackConnection(p),{connection:p,nativeUrl:o===null?String(s):n.href}},ae=t=>{t.opened||(t.opened=!0,t.event.connectMs=Date.now()-t.startedAt,t.dirty=!0)},K=(t,e,s)=>{var r,o,i,a;let{event:n}=t;e==="in"?(n.messagesIn=((r=n.messagesIn)!=null?r:0)+1,n.bytesIn=((o=n.bytesIn)!=null?o:0)+ee(s)):(n.messagesOut=((i=n.messagesOut)!=null?i:0)+1,n.bytesOut=((a=n.bytesOut)!=null?a:0)+ee(s)),t.dirty=!0},X=(t,e)=>{t.done||(t.event.durationMs=Date.now()-t.startedAt,t.event.outcome=e,t.done=!0,t.dirty=!0)},Ae=(t,e)=>({direction:t,data:e,at:Date.now(),eventName:null,eventId:null}),ft=(t,e,s,n)=>{if(s)return"ABORTED";if(t&&(e===1e3||e===1001||n&&e===1005))return"SUCCESS";let r=w();return r==="OFFLINE"||!t?r:"HTTP_ERROR"},Te=t=>{let e=window.WebSocket;if(typeof e!="function")return()=>{};let s=e.prototype,n=s.send,r=s.close,o=new WeakMap,i=(u,d)=>{o.set(u,d),u.addEventListener("open",()=>ae(d)),u.addEventListener("message",c=>{K(d,"in",c.data),t.socketMessage(d,Ae("IN",c.data))}),u.addEventListener("close",c=>{let h=o.get(u);d.event.closeCode=c.code,d.event.closeReason=c.reason?Re(c.reason,ht):null,X(d,ft(d.opened,c.code,(h==null?void 0:h.abortedByApp)===!0,(h==null?void 0:h.closedByApp)===!0)),t.socketClosed(d)})},a=new Proxy(e,{construct(u,d,c){let h=null;try{h=ie(t,"WEBSOCKET",d[0])}catch{t.drop()}let y=h?[h.nativeUrl,...d.slice(1)]:d,m=Reflect.construct(u,y,c===a?u:c);return h&&i(m,h.connection),m}}),p=function(u){n.call(this,u);let d=o.get(this);d&&(K(d,"out",u),t.socketMessage(d,Ae("OUT",u)))},l=function(u,d){let c=o.get(this);return c&&(c.abortedByApp=this.readyState===e.CONNECTING,c.closedByApp=!0),r.apply(this,arguments)};return window.WebSocket=a,s.send=p,s.close=l,()=>{window.WebSocket===a&&(window.WebSocket=e),s.send===p&&(s.send=n),s.close===l&&(s.close=r)}};var Oe=t=>{let e=window,s=e.EventSource;if(typeof s!="function")return()=>{};let n=s.prototype,r=n.close,o=new WeakMap,i=(l,u)=>{o.set(l,u),u.event.reconnectCount=0,l.addEventListener("open",()=>ae(u)),l.addEventListener("message",d=>{K(u,"in",d.data),t.socketMessage(u,{direction:"IN",data:d.data,at:Date.now(),eventName:d.type,eventId:d.lastEventId||null})}),l.addEventListener("error",()=>{var c;if(l.readyState===s.CONNECTING){u.event.reconnectCount=((c=u.event.reconnectCount)!=null?c:0)+1,u.dirty=!0;return}let d=w();X(u,u.opened&&d!=="OFFLINE"?"HTTP_ERROR":d),t.socketClosed(u)})},a=new Proxy(s,{construct(l,u,d){let c=null;try{c=ie(t,"SSE",u[0])}catch{t.drop()}let h=c?[c.nativeUrl,...u.slice(1)]:u,y=Reflect.construct(l,h,d===a?l:d);return c&&i(y,c.connection),y}}),p=function(){r.call(this);let l=o.get(this);l&&(X(l,l.opened?"SUCCESS":"ABORTED"),t.socketClosed(l))};return e.EventSource=a,n.close=p,()=>{e.EventSource===a&&(e.EventSource=s),n.close===p&&(n.close=r)}};var gt=(t,e,s)=>{var u,d,c;let n=typeof Request!="undefined"&&e instanceof Request?e:null,r=T(n?n.url:String(e));if(!r)return null;let o=((d=(u=s==null?void 0:s.method)!=null?u:n==null?void 0:n.method)!=null?d:"GET").toUpperCase(),i=Date.now(),a=null,p=s;if(O(t,r)){a=R();let h=new Headers((c=s==null?void 0:s.headers)!=null?c:n==null?void 0:n.headers);h.set(F,a),h.set(N,t.sessionId()),p={...s,headers:h}}let l=C(t,"FETCH",o,r.href,i,a);return t.trackTiming(l.id,r.href,i),{event:l,init:p,startedAt:i}},Rt=(t,e,s)=>{let{event:n}=e;if(n.durationMs=Date.now()-e.startedAt,n.status=s.status,n.outcome=B(s.status),n.instrumented||s.status<400){t.record(n);return}s.clone().text().then(r=>{n.responseBodyExcerpt=r.slice(0,U),t.record(n)},()=>t.record(n))},Ce=t=>{let e=window.fetch;if(typeof e!="function")return()=>{};let s=(n,r)=>{let o=null;try{o=gt(t,n,r)}catch{t.drop()}let i=e.call(window,n,o?o.init:r);if(o){let a=o;i.then(p=>{try{Rt(t,a,p)}catch{t.drop()}},p=>{a.event.durationMs=Date.now()-a.startedAt,a.event.outcome=w(p),t.record(a.event)})}return i};return window.fetch=s,()=>{window.fetch===s&&(window.fetch=e)}};var De=t=>{let e=window.XMLHttpRequest;if(typeof e!="function")return()=>{};let s=e.prototype,n=s.open,r=s.send,o=new WeakMap,i=function(l,u){try{o.set(this,{method:String(l).toUpperCase(),url:String(u)})}catch{t.drop()}return n.apply(this,arguments)},a=(l,u,d)=>{let c=T(d);if(!c)return;let h=Date.now(),y=null;O(t,c)&&(y=R(),l.setRequestHeader(F,y),l.setRequestHeader(N,t.sessionId()));let m=C(t,"XHR",u,c.href,h,y);t.trackTiming(m.id,c.href,h);let E=null;l.addEventListener("error",()=>E=w()),l.addEventListener("abort",()=>E="ABORTED"),l.addEventListener("timeout",()=>E="TIMEOUT"),l.addEventListener("loadend",()=>{m.durationMs=Date.now()-h,m.status=E===null&&l.status>0?l.status:null,m.outcome=m.status===null?E!=null?E:w():B(m.status),!m.instrumented&&m.status!==null&&m.status>=400&&(l.responseType===""||l.responseType==="text")&&(m.responseBodyExcerpt=l.responseText.slice(0,U)),t.record(m)})},p=function(l){let u=o.get(this);if(u)try{a(this,u.method,u.url)}catch{t.drop()}return r.call(this,l)};return s.open=i,s.send=p,()=>{s.open===i&&(s.open=n),s.send===p&&(s.send=r)}};var V=class{constructor(e,s){this.max=e;this.drop=s;this.value=null;this.calls=null;this.failed=!1}get(){return this.value}hold(){!this.value&&!this.calls&&(this.calls=[])}run(e){if(this.value)try{e(this.value)}catch{this.drop()}else this.calls&&this.calls.length<this.max?this.calls.push(e):(this.calls||this.failed)&&this.drop()}resolve(e){var n;let s=(n=this.calls)!=null?n:[];this.calls=null,this.value=e,s.forEach(r=>this.run(r))}fail(){var e;((e=this.calls)!=null?e:[]).forEach(()=>this.drop()),this.calls=null,this.failed=!0}close(){this.value=null,this.calls=null}};var yt={reload:"RELOAD",back_forward:"BACK_FORWARD"},Me=()=>{try{return performance.getEntriesByType("navigation")[0]}catch{return}},Pe=t=>({dnsMs:t?k(t.domainLookupStart,t.domainLookupEnd):null,tcpMs:t?k(t.connectStart,t.connectEnd):null,tlsMs:t&&t.secureConnectionStart>0?k(t.secureConnectionStart,t.connectEnd):null,requestMs:t?k(t.requestStart,t.responseStart):null,responseMs:t?k(t.responseStart,t.responseEnd):null,domProcessingMs:t?k(t.responseEnd,t.domComplete):null,loadMs:t&&t.loadEventEnd>0?Math.round(t.loadEventEnd-t.startTime):null}),xe=t=>{var h,y;let e=null,s=null,n=(m,E=null,Qe)=>{let pe=Date.now();return e={startedAt:pe,path:window.location.pathname,event:{id:R(),type:"pageView",route:t.resolveRoute(),referrerRoute:E,startedAt:b(pe),durationMs:null,navigationType:m,lcpMs:null,inpMs:null,cls:null,fcpMs:null,ttfbMs:null,dnsMs:null,tcpMs:null,tlsMs:null,requestMs:null,responseMs:null,domProcessingMs:null,loadMs:null,longTaskCount:0,longTaskTotalMs:0,...Qe}},t.record({...e.event}),e.event.id},r=()=>{e&&(e.event.durationMs=Date.now()-e.startedAt,t.record({...e.event}))},o=()=>{try{if(t.onNavigation(),e&&window.location.pathname!==e.path){let m=e.event.route;r(),n("SPA",m)}}catch{t.drop()}},i=()=>{e&&e.event.id===s&&(Object.assign(e.event,Pe(Me())),t.record({...e.event}))},a=Me(),p=document.readyState==="complete",l=(y=yt[(h=a==null?void 0:a.type)!=null?h:""])!=null?y:"NAVIGATE";s=n(l,null,p?Pe(a):void 0);let u=[g(window,"popstate",o)];if(!p){let m;u.push(g(window,"load",()=>{m=setTimeout(i,0)}),()=>clearTimeout(m))}let d=window.history.pushState,c=function(...m){let E=d.apply(this,m);return o(),E};return window.history.pushState=c,u.push(()=>{window.history.pushState===c&&(window.history.pushState=d)}),{currentId:()=>{var m;return(m=e==null?void 0:e.event.id)!=null?m:null},start:m=>{n(m)},end:r,stop:()=>u.forEach(m=>m())}};var _e=t=>t.replace(/\/+$/,""),G=(t,e)=>`${t.proxyUrl?`${_e(t.proxyUrl)}/rum`:`${_e(t.apiUrl)}/api/rum`}/${encodeURIComponent(t.applicationId)}/${e}?token=${encodeURIComponent(t.token)}`;var Fe="abyss-rum-config",Et=600*1e3,Ve=t=>typeof t=="number"&&t>=0&&t<=1?t:0,Ne=t=>{var n,r;let e=t;if(!e||typeof e.enabled!="boolean"||typeof e.sessionSampleRate!="number")return null;let s=(n=e.replay)!=null?n:{};return{enabled:e.enabled,sessionSampleRate:Ve(e.sessionSampleRate),sessionQuotaExhausted:e.sessionQuotaExhausted===!0,country:typeof e.country=="string"?e.country:null,feedbackEnabled:e.feedbackEnabled===!0,replay:{enabled:s.enabled===!0,sampleRate:Ve(s.sampleRate),unmaskSelectors:Array.isArray(s.unmaskSelectors)?s.unmaskSelectors.filter(o=>typeof o=="string"):[],maxSessionBytes:s.maxSessionBytes,defaultPrivacy:s.defaultPrivacy},socketMessages:{enabled:((r=e.socketMessages)==null?void 0:r.enabled)===!0}}},Le=(t,e)=>{let s=L(Fe);if(!s||s.key!==t||typeof s.at!="number")return;let n=e-s.at;return n>=0&&n<Et?Ne(s.config):void 0},He=async(t,e,s,n)=>{let r=null;try{let o=await e(t,{credentials:"omit"});r=o.ok?Ne(await o.json()):null}catch{r=null}return H(Fe,{key:s,at:n,config:r}),r};var St=/iPad|Tablet|PlayBook|Silk|Android(?!.*Mobile)/i,bt=/Mobi|iPhone|iPod|Android|Opera Mini|IEMobile/i,wt=[[/Edg(e|A|iOS)?\//,"Edge"],[/OPR\/|Opera/,"Opera"],[/SamsungBrowser\//,"Samsung Internet"],[/Firefox\/|FxiOS\//,"Firefox"],[/Chrome\/|CriOS\//,"Chrome"],[/Safari\//,"Safari"]],Ue=t=>St.test(t)?"tablet":bt.test(t)?"mobile":"desktop",Be=t=>{var e,s;return(s=(e=wt.find(([n])=>n.test(t)))==null?void 0:e[1])!=null?s:"Other"},qe=(t,e,s,n)=>{if(!t)return s;try{let r=t({...e,attributes:{...e.attributes}});if(typeof(r==null?void 0:r.session)=="boolean"&&typeof r.replay=="boolean")return{session:r.session,replay:r.replay}}catch{}return n(),s};var It=200,kt=(t,e,s)=>({session:t<e,replay:t<e*s}),We=(t,e,s,n)=>{let r=kt(t.random,t.sessionSampleRate,t.replaySampleRate),o=qe(e,t,r,n),i=o.session&&!s;return{session:i,replay:i&&o.replay}},At=t=>t.type==="request"&&(t.kind==="FETCH"||t.kind==="XHR")&&t.outcome==="SUCCESS",$=class{constructor(e){this.onDrop=e;this.held=null;this.released=new Set;this.successes=new Map}accept(e,s){var r,o,i;if(s){if(At(e)){let a=(r=e.pageViewId)!=null?r:"",p=((o=this.successes.get(a))!=null?o:0)+1;if(this.successes.set(a,p),p>It)return this.onDrop(),[]}return[e]}if(e.type==="pageView")return this.released.has(e.id)?[e]:(this.held=e,[]);if(e.type!=="error")return[];let n=[];return e.pageViewId!==null&&!this.released.has(e.pageViewId)&&(this.released.add(e.pageViewId),((i=this.held)==null?void 0:i.id)===e.pageViewId&&(n.push(this.held),this.held=null)),n.push(e),n}reset(){this.held=null,this.released.clear(),this.successes.clear()}};var ue="abyss-rum-session",Tt=1800*1e3,Ot=14400*1e3,de=(t,e)=>e-t.lastActivityAt>=Tt||e-t.startedAt>=Ot,Ct=t=>typeof(t==null?void 0:t.session)=="boolean"&&typeof t.replay=="boolean",Dt=()=>{let t=L(ue);return!t||!me(t.id)||typeof t.startedAt!="number"||typeof t.lastActivityAt!="number"||typeof t.random!="number"?null:{id:t.id,startedAt:t.startedAt,lastActivityAt:t.lastActivityAt,random:t.random,decision:Ct(t.decision)?t.decision:null,entryPath:typeof t.entryPath=="string"?t.entryPath:null,cut:t.cut===!0}},M=t=>H(ue,t),je=()=>ve(ue),le=t=>{let e={id:R(),startedAt:t,lastActivityAt:t,random:Math.random(),decision:null,entryPath:null,cut:!1};return M(e),e},Ke=t=>{let e=Dt();return e&&!de(e,t)?e:le(t)};var Xe=64*1024,Mt=60*1e3;var Y=class{constructor(e,s,n){this.url=e;this.fetchImpl=s;this.handlers=n;this.pausedUntil=0}isPaused(e){return e<this.pausedUntil}send(e,s,n){let r=JSON.stringify({...e,events:[]}).slice(0,-2),o=Z(r)+2,i=[],a=[],p=o;for(let l of s){let u=JSON.stringify(l),d=Z(u);if(o+d>Xe){this.handlers.onDrop(1);continue}let c=d+(i.length>0?1:0);p+c>Xe&&(this.post(`${r}${i.join(",")}]}`,a,n,e.sessionId),i=[],a=[],p=o),p+=d+(i.length>0?1:0),i.push(u),a.push(l)}i.length>0&&this.post(`${r}${i.join(",")}]}`,a,n,e.sessionId)}post(e,s,n,r){let o=i=>this.handlers.onResult(s,i,r);if(n&&this.beacon(e)){o("OK");return}this.fetchImpl(this.url,{method:"POST",body:e,keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain;charset=UTF-8"}}).then(i=>this.handle(i,o),()=>o("FAIL")).catch(()=>this.handlers.onDrop(1))}beacon(e){try{return typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(this.url,e)}catch{return!1}}async handle(e,s){if(e.status===429){this.pausedUntil=Date.now()+Mt,s("RETRY");return}if(e.status===401||e.status===403||e.status===404){s("CUT");return}if(!e.ok){s("FAIL");return}s("OK");let n=!1;try{n=(await e.json()).liveWatched===!0}catch{}this.handlers.onLiveWatched(n)}};var Pt=5e3,xt=50,Ge=200,_t=50,Vt=100,Ft=200,Q=class{constructor(e,s){this.options=e;this.shared=s;this.config=null;this.ready=!1;this.stopped=!1;this.flushing=!1;this.pending=[];this.queue=[];this.teardowns=[];this.pageViews=null;this.lastPageViewId=null;this.deferred=new V(Vt,()=>this.drop());this.sockets=new V(Ft,()=>this.drop());this.errors=new j({pageViewId:()=>this.pageViewId(),resolveRoute:()=>this.resolveRoute(),record:e=>this.record(e),drop:()=>this.drop(),captured:()=>{var s;let e=Date.now();(s=this.deferred.get())==null||s.frustration.notifyError(),this.sockets.run(n=>n.anomaly(e))}});this.connections=new Set;this.timings=new Map;this.sessionDirty=!0;this.closed=!1;this.liveWatched=!1;this.drop=()=>{this.shared.dropped+=1};this.pageViewId=()=>{var e,s;return(s=(e=this.pageViews)==null?void 0:e.currentId())!=null?s:null};var r;let n=window.fetch;this.nativeFetch=(o,i)=>n.call(window,o,i),this.instrumentedOrigins=((r=e.instrumentedOrigins)!=null?r:[]).map(o=>ye(String(o))).filter(o=>o!==null),this.filter=new $(this.drop),this.transport=new Y(G(e,"batch"),this.nativeFetch,{onResult:(o,i,a)=>this.guard(()=>this.onResult(o,i,a)),onLiveWatched:o=>{this.liveWatched=o},onDrop:o=>{this.shared.dropped+=o}}),this.session=Ke(Date.now()),this.deferred.hold()}start(){if(this.session.cut){this.stopped=!0;return}let e=Date.now(),s=`${this.options.applicationId}:${this.options.token}`,n=Le(s,e);if(n!==void 0){this.configure(n);return}He(G(this.options,"config"),this.nativeFetch,s,e).then(r=>this.guard(()=>this.configure(r)),this.drop)}stop(){this.shutdown(),je()}captureError(e,s){this.errors.capture(e,s)}addAction(e,s){let n=we(e,s,this.pageViewId(),this.drop);n&&this.record(n)}addTiming(e){let s=Date.now();this.deferred.run(n=>n.perf.timings.addTiming(e,s))}startDuration(e,s){let n=Date.now();this.deferred.run(r=>r.perf.timings.startDuration(e,s,n))}stopDuration(e){let s=Date.now();this.deferred.run(n=>n.perf.timings.stopDuration(e,s))}sendFeedback(e){let s=this.feedbackState();return s!==null?Promise.reject(new A(s)):this.feedback((n,r)=>n.sendFeedback(r,e))}showReportDialog(e){this.feedbackState()===null&&this.feedback((s,n)=>s.showReportDialog(n,e!=null?e:{})).catch(this.drop)}markDirty(){this.sessionDirty=!0}guard(e){try{e()}catch{this.drop()}}load(e,s){e.catch(()=>{this.drop(),s()})}feedback(e){return import("./send-KNP5EOEZ.mjs").then(s=>e(s,this.feedbackHost()),()=>{throw new A("SEND_FAILED")})}feedbackState(){var e;return!this.ready||this.stopped?"NO_SESSION":((e=this.config)==null?void 0:e.feedbackEnabled)===!0?null:"FEEDBACK_DISABLED"}feedbackHost(){return{unavailable:()=>this.feedbackState(),sessionId:()=>this.session.id,sessionStartedAt:()=>this.session.startedAt,pageViewId:this.pageViewId,resolveRoute:()=>this.resolveRoute(),prepare:e=>{let s=te(e,this.options.beforeSend,this.drop);return s&&ne(s)},post:e=>(this.flush(!1),this.nativeFetch(G(this.options,"feedback"),{method:"POST",body:JSON.stringify({...this.header(),events:[e]}),keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain;charset=UTF-8"}}).then(s=>s.status)),sent:e=>this.guard(()=>{var s,n;return(n=(s=this.options).onFeedbackSent)==null?void 0:n.call(s,e)})}}loadDeferred(e){this.load(import("./deferred-P4QMIWWX.mjs").then(({installDeferred:s})=>this.guard(()=>{if(this.stopped)return;let n=s({instrument:e,resolveRoute:()=>this.resolveRoute(),captureConsole:this.options.captureConsole!==!1,describe:re});this.teardowns.push(n.teardown),this.deferred.resolve(n)})),()=>this.deferred.fail())}loadReplay(){var e;!this.replaying&&((e=this.session.decision)!=null&&e.replay)&&this.config.replay.enabled&&(this.replaying=import("./replay-JG4QNJJV.mjs").then(({recordReplay:s})=>s(this)).catch(this.drop))}loadSocketCapture(e){var n;let s=this.options.captureSocketMessages;!s||!e.socketMessages.enabled||((n=this.session.decision)==null?void 0:n.session)!==!0||(this.sockets.hold(),this.load(import("./socket-messages-TSBDPTWJ.mjs").then(({SocketMessageCapture:r})=>this.guard(()=>{this.stopped||this.sockets.resolve(new r(s,{sessionId:()=>this.session.id,record:o=>this.record(o),drop:this.drop}))})),()=>this.sockets.fail()))}onPageView(e){var s,n;this.shared.featureFlags.annotate(e),(s=this.deferred.get())==null||s.perf.annotate(e),this.record(e),e.id!==this.lastPageViewId&&(this.lastPageViewId=e.id,(n=this.deferred.get())==null||n.frustration.notifyActivity()),this.deferred.run(r=>r.perf.pageViewSent(e))}configure(e){if(this.stopped)return;if(!e||!e.enabled){this.shutdown();return}this.config=e,this.session.decision||this.decide(),this.ready=!0,this.install(),this.loadSocketCapture(e),this.loadReplay();let s=this.pending;this.pending=[];let n=this.pageViewId();for(let r of s)(r.type==="error"||r.type==="action")&&r.pageViewId===null&&(r.pageViewId=n),this.record(r)}decide(){let e=this.config,s=navigator.userAgent;this.session.decision=We({route:x(this.resolveRoute()),deviceType:Ue(s),browserFamily:Be(s),country:e.country,attributes:{...this.shared.attributes},random:this.session.random,sessionSampleRate:e.sessionSampleRate,replaySampleRate:e.replay.sampleRate},this.options.sampler,e.sessionQuotaExhausted,this.drop),M(this.session)}install(){let e={instrumentedOrigins:this.instrumentedOrigins,sessionId:()=>this.session.id,pageViewId:this.pageViewId,record:r=>this.record(r),drop:this.drop,trackTiming:(r,o,i)=>{var a;this.timings.set(r,{url:o,startedAt:i}),(a=this.deferred.get())==null||a.frustration.notifyActivity()},trackConnection:r=>this.connections.add(r),socketMessage:(r,o)=>this.sockets.run(i=>i.message(r,o)),socketClosed:r=>{let o=Date.now();this.sockets.run(i=>i.closed(r,o))}};this.pageViews=xe({resolveRoute:()=>this.resolveRoute(),record:r=>this.onPageView(r),onNavigation:()=>this.touch(),drop:this.drop});let s=setInterval(()=>this.guard(()=>this.flush(!1)),Pt),n=()=>this.guard(()=>this.touch());this.teardowns=[this.pageViews.stop,()=>clearInterval(s),Ce(e),De(e),Te(e),Oe(e),g(window,"click",n,!0),g(window,"keydown",n,!0),this.errors.install(),g(window,"pagehide",()=>this.guard(()=>this.onPageHide())),g(window,"pageshow",r=>this.guard(()=>{var o;r.persisted&&(this.closed=!1,this.sessionDirty=!0,(o=this.pageViews)==null||o.start("BACK_FORWARD"))})),g(document,"visibilitychange",()=>this.guard(()=>{var r;document.visibilityState==="hidden"&&((r=this.deferred.get())==null||r.perf.hidden(),this.flush(!0))}))],this.loadDeferred(e)}shutdown(){this.stopped=!0,this.ready=!1;let e=this.teardowns;this.teardowns=[],e.reverse().forEach(s=>this.guard(s)),this.deferred.close(),this.sockets.close(),this.pending=[],this.queue=[],this.connections.clear(),this.timings.clear()}resolveRoute(){let{routeResolver:e}=this.options;if(e)try{return String(e(window.location))}catch{this.drop()}return window.location.pathname}touch(){var s,n;if(!this.ready)return;let e=Date.now();if(!de(this.session,e)){this.session.lastActivityAt=e,M(this.session);return}(s=this.pageViews)==null||s.end(),this.flush(!1),this.shared.dropped+=this.queue.length,this.queue=[],this.session=le(e),this.decide(),this.loadReplay(),this.filter.reset(),this.sessionDirty=!0,this.closed=!1,(n=this.pageViews)==null||n.start("SPA")}onPageHide(){var e;(e=this.pageViews)==null||e.end();for(let s of this.connections)s.done||(s.event.durationMs=Date.now()-s.startedAt,s.done=!0,s.dirty=!0);this.closed=!0,this.sessionDirty=!0,this.flush(!0)}record(e){var s,n;try{if(this.stopped)return;if(this.errors.observe(e),!this.ready){this.pending.length<_t?this.pending.push(e):this.drop();return}(s=this.sockets.get())==null||s.observe(e);let r=((n=this.session.decision)==null?void 0:n.session)===!0;if(!r&&e.type!=="error"&&e.type!=="pageView")return;let o=te(e,this.options.beforeSend,this.drop);if(!o)return;ne(o),o.type==="pageView"&&this.session.entryPath===null&&(this.session.entryPath=o.route,M(this.session));for(let i of this.filter.accept(o,r))this.enqueue(i)}catch{this.drop()}}enqueue(e){if(this.queue.length>=Ge){this.drop();return}this.queue.push(e),this.queue.length>=xt&&!this.flushing&&this.flush(!1)}flush(e){var s,n;if(!(!this.ready||this.flushing||this.transport.isPaused(Date.now()))){this.flushing=!0;try{for(let p of this.connections)p.dirty&&(p.dirty=!1,this.record({...p.event})),p.done&&this.connections.delete(p);let r=this.queue;this.queue=[],this.fillTimings(r);let o=((s=this.session.decision)==null?void 0:s.session)===!0;if(r.length===0&&!(o&&this.sessionDirty))return;let a=this.sessionDirty||this.shared.dropped>0?{id:this.session.id,type:"session",entryPath:(n=this.session.entryPath)!=null?n:"/",sampled:o,closed:this.closed,droppedEvents:this.shared.dropped}:null;this.shared.dropped=0,this.sessionDirty=!1,this.transport.send(this.header(),a?[a,...r]:r,e)}finally{this.flushing=!1}}}header(){let e={sessionId:this.session.id,sessionStartedAt:b(this.session.startedAt)};return this.options.release&&(e.release=this.options.release),this.shared.actor!==void 0&&(e.actor=this.shared.actor),this.shared.attributesSet&&(e.attributes={...this.shared.attributes}),this.shared.featureFlags.hasAny()&&(e.featureFlags={...this.shared.featureFlags.session}),e}fillTimings(e){for(let s of e){let n=this.timings.get(s.id);n&&(this.timings.delete(s.id),Object.assign(s,Ee(n.url,n.startedAt)))}}onResult(e,s,n){if(s==="OK")return;if(s==="CUT"){this.session.cut=!0,M(this.session),this.shutdown();return}let r=e.filter(i=>i.type!=="session"),o=e.find(i=>i.type==="session");if(o&&(this.shared.dropped+=o.droppedEvents,this.sessionDirty=!0),s==="RETRY"&&n===this.session.id){let i=r.slice(0,Math.max(0,Ge-this.queue.length));this.shared.dropped+=r.length-i.length,this.queue=[...i,...this.queue];return}this.shared.dropped+=r.length}},$e=null,f={actor:void 0,attributes:{},attributesSet:!1,dropped:0,featureFlags:new D},v=()=>$e,ce=t=>{$e=t};var Ye=(s=>(s.ALL="ALL",s.ON_ANOMALY="ON_ANOMALY",s))(Ye||{});var S=t=>{try{t()}catch{f.dropped+=1}},En={init(t){S(()=>{if(v()||!(t!=null&&t.token)||!t.applicationId||!t.apiUrl&&!t.proxyUrl||typeof window=="undefined"||typeof window.fetch!="function")return;let e=new Q(t,f);ce(e),e.start()})},setActor(t){S(()=>{var s;let e=Se(t);if(e===void 0){f.dropped+=1;return}f.actor=e,(s=v())==null||s.markDirty()})},setAttributes(t){S(()=>{var e;f.attributes=I(f.attributes,t,()=>{f.dropped+=1}),f.attributesSet=!0,(e=v())==null||e.markDirty()})},captureError(t,e){S(()=>{var s;return(s=v())==null?void 0:s.captureError(t,e)})},addAction(t,e){S(()=>{var s;return(s=v())==null?void 0:s.addAction(t,e)})},addFeatureFlagEvaluation(t,e){S(()=>{var s;f.featureFlags.add(t,e,()=>f.dropped+=1)&&((s=v())==null||s.markDirty())})},sendFeedback(t){var e,s;return(s=(e=v())==null?void 0:e.sendFeedback(t))!=null?s:Promise.reject(new A("NO_SESSION"))},showReportDialog(t){S(()=>{var e;return(e=v())==null?void 0:e.showReportDialog(t)})},addTiming(t){S(()=>{var e;return(e=v())==null?void 0:e.addTiming(t)})},startDuration(t,e){S(()=>{var s;return(s=v())==null?void 0:s.startDuration(t,e)})},stopDuration(t){S(()=>{var e;return(e=v())==null?void 0:e.stopDuration(t)})},stop(){S(()=>{var t;(t=v())==null||t.stop(),ce(null),f.actor=void 0,f.attributes={},f.attributesSet=!1,f.dropped=0,f.featureFlags=new D})}};export{En as AbyssRum,A as RumFeedbackError,z as RumFeedbackErrorCode,Ye as RumSocketCaptureMode};
@@ -50,7 +50,7 @@ https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.p
50
50
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
51
51
  https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new Vs().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return M([i(a)]).process(o,l)},i};M.stringify=Nh;M.parse=_h;M.fromJSON=Mh;M.list=kh;M.comment=s=>new xo(s);M.atRule=s=>new Ro(s);M.decl=s=>new Eo(s);M.rule=s=>new Ao(s);M.root=s=>new No(s);M.document=s=>new Io(s);M.CssSyntaxError=xh;M.Declaration=Eo;M.Container=Ah;M.Processor=Vs;M.Document=Io;M.Comment=xo;M.Warning=Oh;M.AtRule=Ro;M.Result=Dh;M.Input=Th;M.Rule=Ao;M.Root=No;M.Node=Ph;Rh.registerPostcss(M);var Lh=M;M.default=M;var F=Zu(Lh);F.stringify;F.fromJSON;F.plugin;F.parse;F.list;F.document;F.comment;F.atRule;F.rule;F.decl;F.root;F.CssSyntaxError;F.Declaration;F.Container;F.Processor;F.Document;F.Comment;F.Warning;F.AtRule;F.Result;F.Input;F.Rule;F.Root;F.Node;var cs=class s{constructor(...e){ee(this,"parentElement",null),ee(this,"parentNode",null),ee(this,"ownerDocument"),ee(this,"firstChild",null),ee(this,"lastChild",null),ee(this,"previousSibling",null),ee(this,"nextSibling",null),ee(this,"ELEMENT_NODE",1),ee(this,"TEXT_NODE",3),ee(this,"nodeType"),ee(this,"nodeName"),ee(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof s){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var Wi={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},zi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Dt={},$h=()=>!!globalThis.Zone;function Gs(s){if(Dt[s])return Dt[s];let e=globalThis[s],t=e.prototype,r=s in Wi?Wi[s]:void 0,i=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),n=s in zi?zi[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!$h())return Dt[s]=e.prototype,e.prototype;try{let l=document.createElement("iframe");document.body.appendChild(l);let a=l.contentWindow;if(!a)return e.prototype;let u=a[s].prototype;return document.body.removeChild(l),u?Dt[s]=u:t}catch{return t}}var Mr={};function pe(s,e,t){var r;let i=`${s}.${String(t)}`;if(Mr[i])return Mr[i].call(e);let n=Gs(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(Mr[i]=o,o.call(e)):e[t]}var Or={};function Mo(s,e,t){let r=`${s}.${String(t)}`;if(Or[r])return Or[r].bind(e);let n=Gs(s)[t];return typeof n!="function"?e[t]:(Or[r]=n,n.bind(e))}function Fh(s){return pe("Node",s,"ownerDocument")}function Uh(s){return pe("Node",s,"childNodes")}function Bh(s){return pe("Node",s,"parentNode")}function Wh(s){return pe("Node",s,"parentElement")}function zh(s){return pe("Node",s,"textContent")}function Vh(s,e){return Mo("Node",s,"contains")(e)}function Gh(s){return Mo("Node",s,"getRootNode")()}function jh(s){return!s||!("host"in s)?null:pe("ShadowRoot",s,"host")}function Yh(s){return s.styleSheets}function Hh(s){return!s||!("shadowRoot"in s)?null:pe("Element",s,"shadowRoot")}function Zh(s,e){return pe("Element",s,"querySelector")(e)}function Xh(s,e){return pe("Element",s,"querySelectorAll")(e)}function Oo(){return Gs("MutationObserver").constructor}function Ee(s,e,t){try{if(!(e in s))return()=>{};let r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch{return()=>{}}}var C={ownerDocument:Fh,childNodes:Uh,parentNode:Bh,parentElement:Wh,textContent:zh,contains:Vh,getRootNode:Gh,host:jh,styleSheets:Yh,shadowRoot:Hh,querySelector:Zh,querySelectorAll:Xh,mutationObserver:Oo,patch:Ee};function Z(s,e,t=document){let r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}var xe=`Please stop import mirror directly. Instead of that,\r
52
52
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
53
- or you can use record.mirror to access the mirror instance during recording.`,Vi={map:{},getId(){return console.error(xe),-1},getNode(){return console.error(xe),null},removeNodeFromMap(){console.error(xe)},has(){return console.error(xe),!1},reset(){console.error(xe)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Vi=new Proxy(Vi,{get(s,e,t){return e==="map"&&console.error(xe),Reflect.get(s,e,t)}}));function rt(s,e,t={}){let r=null,i=0;return function(...n){let o=Date.now();!i&&t.leading===!1&&(i=o);let l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,n)},l))}}function dr(s,e,t,r,i=window){let n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>dr(s,e,n||{},!0)}var Qt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Qt=()=>new Date().getTime());function Do(s){var e,t,r,i;let n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||(n==null?void 0:n.body)&&((e=C.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n==null?void 0:n.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(n==null?void 0:n.documentElement.scrollTop)||(n==null?void 0:n.body)&&((r=C.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n==null?void 0:n.body)==null?void 0:i.scrollTop)||0}}function To(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _o(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ko(s){return s?s.nodeType===s.ELEMENT_NODE?s:C.parentElement(s):null}function X(s,e,t,r){if(!s)return!1;let i=ko(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(Gt(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Jh(s,e){return e.getId(s)!==-1}function Dr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===He}function Po(s,e){if(Ge(s))return!1;let t=e.getId(s);if(!e.has(t))return!0;let r=C.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Po(r,e):!0}function hs(s){return!!s.changedTouches}function Kh(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Lo(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function $o(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function fs(s){return s?s instanceof cs&&"shadowRoot"in s?!!s.shadowRoot:!!C.shadowRoot(s):!1}var ds=class{constructor(){w(this,"id",1),w(this,"styleIDMap",new WeakMap),w(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}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 Fo(s){var e;let t=null;return"getRootNode"in s&&((e=C.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(s))&&(t=C.host(C.getRootNode(s))),t}function qh(s){let e=s,t;for(;t=Fo(e);)e=t;return e}function Qh(s){let e=C.ownerDocument(s);if(!e)return!1;let t=qh(s);return C.contains(e,t)}function Uo(s){let e=C.ownerDocument(s);return e?C.contains(e,s)||Qh(s):!1}var x=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(x||{}),E=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(E||{}),J=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(J||{}),ce=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(ce||{}),Le=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Le||{}),Re=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Re||{});var Bo=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Bo||{});function Gi(s){return"__ln"in s}var ps=class{constructor(){w(this,"length",0),w(this,"head",null),w(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Gi(e.previousSibling)){let r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Gi(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let 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--)}},ji=(s,e)=>`${s}@${e}`,ms=class{constructor(){w(this,"frozen",!1),w(this,"locked",!1),w(this,"texts",[]),w(this,"attributes",[]),w(this,"attributeMap",new WeakMap),w(this,"removes",[]),w(this,"mapRemoves",[]),w(this,"movedMap",{}),w(this,"addedSet",new Set),w(this,"movedSet",new Set),w(this,"droppedSet",new Set),w(this,"removesSubTreeCache",new Set),w(this,"mutationCb"),w(this,"blockClass"),w(this,"blockSelector"),w(this,"maskTextClass"),w(this,"maskTextSelector"),w(this,"inlineStylesheet"),w(this,"maskInputOptions"),w(this,"maskTextFn"),w(this,"maskInputFn"),w(this,"keepIframeSrcFn"),w(this,"recordCanvas"),w(this,"inlineImages"),w(this,"slimDOMOptions"),w(this,"dataURLOptions"),w(this,"doc"),w(this,"mirror"),w(this,"iframeManager"),w(this,"stylesheetManager"),w(this,"shadowDomManager"),w(this,"canvasManager"),w(this,"processedNodeManager"),w(this,"unattachedDoc"),w(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),w(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new ps,i=a=>{let u=a,c=He;for(;c===He;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},n=a=>{let u=C.parentNode(a);if(!u||!Uo(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){let m=u.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let h=Ge(u)?this.mirror.getId(Fo(a)):this.mirror.getId(u),p=i(a);if(h===-1||p===-1)return r.addNode(a);let g=Ne(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{Lo(m,this.mirror)&&this.iframeManager.addIframe(m),$o(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),fs(a)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(a),this.doc)},onIframeLoad:(m,d)=>{this.iframeManager.attachIframe(m,d),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,d)=>{this.stylesheetManager.attachLinkElement(m,d)},cssCaptured:c});g&&(e.push({parentId:h,nextId:p,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let a of this.movedSet)Yi(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(C.parentNode(a))||n(a);for(let a of this.addedSet)!Hi(this.droppedSet,a)&&!Yi(this.removesSubTreeCache,a,this.mirror)||Hi(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){let u=this.mirror.getId(C.parentNode(o.value)),c=i(o.value);u!==-1&&c!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let h=this.mirror.getId(C.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){a=c;break}else{let g=c.value,m=C.parentNode(g);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let d=C.host(m);if(this.mirror.getId(d)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),n(a.value)}let l={texts:this.texts.map(a=>{let u=a.node,c=C.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{let{attributes:u}=a;if(typeof u.style=="string"){let c=JSON.stringify(a.styleDiff),h=JSON.stringify(a._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(l))}),w(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let r=Array.from(C.childNodes(e),i=>C.textContent(i)||"").join("");t.attributes.value=Wt({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:zt(e),value:r,maskInputFn:this.maskInputFn})}),w(this,"processMutation",e=>{if(!Dr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=C.textContent(e.target);!X(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:ln(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,ko(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){let o=zt(t);i=Wt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(X(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!an(t.tagName,r))if(n.attributes[r]=on(this.doc,Se(t.tagName),Se(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(let l of Array.from(t.style)){let a=t.style.getPropertyValue(l),u=t.style.getPropertyPriority(l);a!==o.style.getPropertyValue(l)||u!==o.style.getPropertyPriority(l)?u===""?n.styleDiff[l]=a:n.styleDiff[l]=[a,u]:n._unchangedStyles[l]=[a,u]}for(let l of Array.from(o.style))t.style.getPropertyValue(l)===""&&(n.styleDiff[l]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(X(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),i=Ge(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);X(e.target,this.blockClass,this.blockSelector,!1)||Dr(t,this.mirror,this.slimDOMOptions)||!Jh(t,this.mirror)||(this.addedSet.has(t)?(gs(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||Po(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ji(r,i)]?gs(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:Ge(e.target)&&je(e.target)?!0:void 0}),ef(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),w(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Dr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[ji(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);X(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach(r=>this.genAdds(r)),fs(e)&&C.childNodes(C.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function gs(s,e){s.delete(e),C.childNodes(e).forEach(t=>gs(s,t))}function ef(s,e){let t=[s];for(;t.length;){let r=t.pop();e.has(r)||(e.add(r),C.childNodes(r).forEach(i=>t.push(i)))}}function Yi(s,e,t){return s.size===0?!1:tf(s,e)}function tf(s,e,t){let r=C.parentNode(e);return r?s.has(r):!1}function Hi(s,e){return s.size===0?!1:Wo(s,e)}function Wo(s,e){let t=C.parentNode(e);return t?s.has(t)?!0:Wo(s,t):!1}var Ye;function rf(s){Ye=s}function sf(){Ye=void 0}var I=s=>Ye?(...t)=>{try{return s(...t)}catch(r){if(Ye&&Ye(r)===!0)return;throw r}}:s,be=[];function at(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function zo(s,e){let t=new ms;be.push(t),t.init(s);let r=new(Oo())(I(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function nf({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,o=[],l,a=rt(I(h=>{let p=Date.now()-l;s(o.map(g=>(g.timeOffset-=p,g)),h),o=[],l=null}),n),u=I(rt(I(h=>{let p=at(h),{clientX:g,clientY:m}=hs(h)?h.changedTouches[0]:h;l||(l=Qt()),o.push({x:g,y:m,id:r.getId(p),timeOffset:Qt()-l}),a(typeof DragEvent!="undefined"&&h instanceof DragEvent?E.Drag:h instanceof MouseEvent?E.MouseMove:E.TouchMove)}),i,{trailing:!1})),c=[Z("mousemove",u,t),Z("touchmove",u,t),Z("drag",u,t)];return I(()=>{c.forEach(h=>h())})}function of({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};let o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[],a=null,u=c=>h=>{let p=at(h);if(X(p,r,i,!0))return;let g=null,m=c;if("pointerType"in h){switch(h.pointerType){case"mouse":g=ce.Mouse;break;case"touch":g=ce.Touch;break;case"pen":g=ce.Pen;break}g===ce.Touch?J[c]===J.MouseDown?m="TouchStart":J[c]===J.MouseUp&&(m="TouchEnd"):ce.Pen}else hs(h)&&(g=ce.Touch);g!==null?(a=g,(m.startsWith("Touch")&&g===ce.Touch||m.startsWith("Mouse")&&g===ce.Mouse)&&(g=null)):J[c]===J.Click&&(g=a,a=null);let d=hs(h)?h.changedTouches[0]:h;if(!d)return;let f=t.getId(p),{clientX:b,clientY:S}=d;I(s)({type:J[m],id:f,x:b,y:S,...g!==null&&{pointerType:g}})};return Object.keys(J).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&o[c]!==!1).forEach(c=>{let h=Se(c),p=u(c);if(window.PointerEvent)switch(J[c]){case J.MouseDown:case J.MouseUp:h=h.replace("mouse","pointer");break;case J.TouchStart:case J.TouchEnd:return}l.push(Z(h,p,e))}),I(()=>{l.forEach(c=>c())})}function Vo({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){let o=I(rt(I(l=>{let a=at(l);if(!a||X(a,r,i,!0))return;let u=t.getId(a);if(a===e&&e.defaultView){let c=Do(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return Z("scroll",o,e)}function af({viewportResizeCb:s},{win:e}){let t=-1,r=-1,i=I(rt(I(()=>{let n=To(),o=_o();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return Z("resize",i,e)}var lf=["INPUT","TEXTAREA","SELECT"],Zi=new WeakMap;function uf({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function h(S){let y=at(S),v=S.isTrusted,O=y&&y.tagName;if(y&&O==="OPTION"&&(y=C.parentElement(y)),!y||!O||lf.indexOf(O)<0||X(y,r,i,!0)||y.classList.contains(n)||o&&y.matches(o))return;let T=y.value,V=!1,L=zt(y)||"";L==="radio"||L==="checkbox"?V=y.checked:(l[O.toLowerCase()]||l[L])&&(T=Wt({element:y,maskInputOptions:l,tagName:O,type:L,value:T,maskInputFn:a})),p(y,c?{text:T,isChecked:V,userTriggered:v}:{text:T,isChecked:V});let z=y.name;L==="radio"&&z&&V&&e.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(Y=>{if(Y!==y){let q=Y.value;p(Y,c?{text:q,isChecked:!V,userTriggered:!1}:{text:q,isChecked:!V})}})}function p(S,y){let v=Zi.get(S);if(!v||v.text!==y.text||v.isChecked!==y.isChecked){Zi.set(S,y);let O=t.getId(S);I(s)({...y,id:O})}}let m=(u.input==="last"?["change"]:["input","change"]).map(S=>Z(S,I(h),e)),d=e.defaultView;if(!d)return()=>{m.forEach(S=>S())};let f=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),b=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&m.push(...b.map(S=>dr(S[0],S[1],{set(){I(h)({target:this,isTrusted:!1})}},!1,d))),I(()=>{m.forEach(S=>S())})}function er(s){let e=[];function t(r,i){if(Tt("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Tt("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Tt("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Tt("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){let o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function me(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function cf({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:I((c,h,p)=>{let[g,m]=p,{id:d,styleId:f}=me(h,e,t.styleMirror);return(d&&d!==-1||f&&f!==-1)&&s({id:d,styleId:f,adds:[{rule:g,index:m}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,p=this.cssRules.length){let g=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,p])};let n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:I((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,removes:[{index:g}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:I((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replace:g}),c.apply(h,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:I((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replaceSync:g}),c.apply(h,p)})}));let a={};_t("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(_t("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),_t("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),_t("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(a).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:I((p,g,m)=>{let[d,f]=m,{id:b,styleId:S}=me(g.parentStyleSheet,e,t.styleMirror);return(b&&b!==-1||S&&S!==-1)&&s({id:b,styleId:S,adds:[{rule:d,index:[...er(g),f||0]}]}),p.apply(g,m)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:I((p,g,m)=>{let[d]=m,{id:f,styleId:b}=me(g.parentStyleSheet,e,t.styleMirror);return(f&&f!==-1||b&&b!==-1)&&s({id:f,styleId:b,removes:[{index:[...er(g),d]}]}),p.apply(g,m)})})}),I(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function Go({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(C.host(t));let l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;let h=(c=a.set)==null?void 0:c.call(this,u);if(o!==null&&o!==-1)try{e.adoptStyleSheets(u,o)}catch{}return h}}),I(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function hf({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){let n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:I((l,a,u)=>{var c;let[h,p,g]=u;if(t.has(h))return n.apply(a,[h,p,g]);let{id:m,styleId:d}=me((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,set:{property:h,value:p,priority:g},index:er(a.parentRule)}),l.apply(a,u)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:I((l,a,u)=>{var c;let[h]=u;if(t.has(h))return o.apply(a,[h]);let{id:p,styleId:g}=me((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,remove:{property:h},index:er(a.parentRule)}),l.apply(a,u)})}),I(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function ff({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){let o=I(a=>rt(I(u=>{let c=at(u);if(!c||X(c,e,t,!0))return;let{currentTime:h,volume:p,muted:g,playbackRate:m,loop:d}=c;s({type:a,id:r.getId(c),currentTime:h,volume:p,muted:g,playbackRate:m,loop:d})}),i.media||500)),l=[Z("play",o(Re.Play),n),Z("pause",o(Re.Pause),n),Z("seeked",o(Re.Seeked),n),Z("volumechange",o(Re.VolumeChange),n),Z("ratechange",o(Re.RateChange),n)];return I(()=>{l.forEach(a=>a())})}function df({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,u,c){let h=new n(a,u,c);return i.set(h,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};let o=Ee(e.fonts,"add",function(l){return function(a){return setTimeout(I(()=>{let u=i.get(a);u&&(s(u),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n}),r.push(o),I(()=>{r.forEach(l=>l())})}function pf(s){let{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s,o=!0,l=I(()=>{let a=e.getSelection();if(!a||o&&(a!=null&&a.isCollapsed))return;o=a.isCollapsed||!1;let u=[],c=a.rangeCount||0;for(let h=0;h<c;h++){let p=a.getRangeAt(h),{startContainer:g,startOffset:m,endContainer:d,endOffset:f}=p;X(g,r,i,!0)||X(d,r,i,!0)||u.push({start:t.getId(g),startOffset:m,end:t.getId(d),endOffset:f})}n({ranges:u})});return l(),Z("selectionchange",l)}function mf({doc:s,customElementCb:e}){let t=s.defaultView;return!t||!t.customElements?()=>{}:Ee(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function gf(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:p,selectionCb:g,customElementCb:m}=s;s.mutationCb=(...d)=>{e.mutation&&e.mutation(...d),t(...d)},s.mousemoveCb=(...d)=>{e.mousemove&&e.mousemove(...d),r(...d)},s.mouseInteractionCb=(...d)=>{e.mouseInteraction&&e.mouseInteraction(...d),i(...d)},s.scrollCb=(...d)=>{e.scroll&&e.scroll(...d),n(...d)},s.viewportResizeCb=(...d)=>{e.viewportResize&&e.viewportResize(...d),o(...d)},s.inputCb=(...d)=>{e.input&&e.input(...d),l(...d)},s.mediaInteractionCb=(...d)=>{e.mediaInteaction&&e.mediaInteaction(...d),a(...d)},s.styleSheetRuleCb=(...d)=>{e.styleSheetRule&&e.styleSheetRule(...d),u(...d)},s.styleDeclarationCb=(...d)=>{e.styleDeclaration&&e.styleDeclaration(...d),c(...d)},s.canvasMutationCb=(...d)=>{e.canvasMutation&&e.canvasMutation(...d),h(...d)},s.fontCb=(...d)=>{e.font&&e.font(...d),p(...d)},s.selectionCb=(...d)=>{e.selection&&e.selection(...d),g(...d)},s.customElementCb=(...d)=>{e.customElement&&e.customElement(...d),m(...d)}}function yf(s,e={}){let t=s.doc.defaultView;if(!t)return()=>{};gf(s,e);let r;s.recordDOM&&(r=zo(s,s.doc));let i=nf(s),n=of(s),o=Vo(s),l=af(s,{win:t}),a=uf(s),u=ff(s),c=()=>{},h=()=>{},p=()=>{},g=()=>{};s.recordDOM&&(c=cf(s,{win:t}),h=Go(s,s.doc),p=hf(s,{win:t}),s.collectFonts&&(g=df(s)));let m=pf(s),d=mf(s),f=[];for(let b of s.plugins)f.push(b.observer(b.callback,t,b.options));return I(()=>{be.forEach(b=>b.reset()),r==null||r.disconnect(),i(),n(),o(),l(),a(),u(),c(),h(),p(),g(),m(),d(),f.forEach(b=>b())})}function Tt(s){return typeof window[s]!="undefined"}function _t(s){return!!(typeof window[s]!="undefined"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var tr=class{constructor(e){w(this,"iframeIdToRemoteIdMap",new WeakMap),w(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){let n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){let r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){let i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let n=i.get(t);return n||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}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}},ys=class{constructor(e){w(this,"iframes",new WeakMap),w(this,"crossOriginIframeMap",new WeakMap),w(this,"crossOriginIframeMirror",new tr(nn)),w(this,"crossOriginIframeStyleMirror"),w(this,"crossOriginIframeRootIdMap",new WeakMap),w(this,"mirror"),w(this,"mutationCb"),w(this,"wrappedEmit"),w(this,"loadListener"),w(this,"stylesheetManager"),w(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new tr(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case x.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:x.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case x.Meta:case x.Load:case x.DomContentLoaded:return!1;case x.Plugin:return t;case x.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case x.IncrementalSnapshot:switch(t.data.source){case E.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.Drag:case E.TouchMove:case E.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.ViewportResize:return!1;case E.MediaInteraction:case E.MouseInteraction:case E.Scroll:case E.CanvasMutation:case E.Input:return this.replaceIds(t.data,e,["id"]),t;case E.StyleSheetRule:case E.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case E.Font:return t;case E.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case E.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(let n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==Bo.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},ws=class{constructor(e){w(this,"shadowDoms",new WeakSet),w(this,"mutationCb"),w(this,"scrollCb"),w(this,"bypassOptions"),w(this,"mirror"),w(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(!je(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=zo({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Vo({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push(Go({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push(Ee(e.prototype,"attachShadow",function(i){return function(n){let o=i.call(this,n),l=C.shadowRoot(this);return l&&Uo(this)&&r.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wf=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(Ve=0;Ve<Me.length;Ve++)wf[Me.charCodeAt(Ve)]=Ve;var Ve,bf=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Me[e[t]>>2],i+=Me[(e[t]&3)<<4|e[t+1]>>4],i+=Me[(e[t+1]&15)<<2|e[t+2]>>6],i+=Me[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var Xi=new Map;function Sf(s,e){let t=Xi.get(s);return t||(t=new Map,Xi.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}var jo=(s,e,t)=>{if(!s||!(Ho(s,e)||typeof s=="object"))return;let r=s.constructor.name,i=Sf(t,r),n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function Ft(s,e,t){if(s instanceof Array)return s.map(r=>Ft(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,i=bf(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[Ft(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[Ft(s.data,e,t),s.width,s.height]};if(Ho(s,e)||typeof s=="object"){let r=s.constructor.name,i=jo(s,e,t);return{rr_type:r,index:i}}}}return s}var Yo=(s,e,t)=>s.map(r=>Ft(r,e,t)),Ho=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function vf(s,e,t,r){let i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;let l=Ee(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...u){return X(this.canvas,t,r,!0)||setTimeout(()=>{let c=Yo(u,e,this);s(this.canvas,{type:Le["2D"],property:o,args:c})},0),a.apply(this,u)}});i.push(l)}catch{let l=dr(e.CanvasRenderingContext2D.prototype,o,{set(a){s(this.canvas,{type:Le["2D"],property:o,args:[a],setter:!0})}});i.push(l)}return()=>{i.forEach(o=>o())}}function Cf(s){return s==="experimental-webgl"?"webgl":s}function Ji(s,e,t,r){let i=[];try{let n=Ee(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!X(this,e,t,!0)){let u=Cf(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){let c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function Ki(s,e,t,r,i,n){let o=[],l=Object.getOwnPropertyNames(s);for(let a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;let u=Ee(s,a,function(c){return function(...h){let p=c.apply(this,h);if(jo(p,n,this),"tagName"in this.canvas&&!X(this.canvas,r,i,!0)){let g=Yo(h,n,this),m={type:e,property:a,args:g};t(this.canvas,m)}return p}});o.push(u)}catch{let u=dr(s,a,{set(c){t(this.canvas,{type:e,property:a,args:[c],setter:!0})}});o.push(u)}return o}function Ef(s,e,t,r){let i=[];return i.push(...Ki(e.WebGLRenderingContext.prototype,Le.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...Ki(e.WebGL2RenderingContext.prototype,Le.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}var Zo="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",If=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),qi=typeof window!="undefined"&&window.Blob&&new Blob([If(Zo)],{type:"text/javascript;charset=utf-8"});function xf(s){let e;try{if(e=qi&&(window.URL||window.webkitURL).createObjectURL(qi),!e)throw"";let t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+Zo,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var bs=class{constructor(e){w(this,"pendingCanvasMutations",new Map),w(this,"rafStamps",{latestId:0,invokeId:null}),w(this,"mirror"),w(this,"mutationCb"),w(this,"resetObservers"),w(this,"frozen",!1),w(this,"locked",!1),w(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});let{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,n){let o=Ji(t,r,i,!0),l=new Map,a=new xf;a.onmessage=m=>{let{id:d}=m.data;if(l.set(d,!1),!("base64"in m.data))return;let{base64:f,type:b,width:S,height:y}=m.data;this.mutationCb({id:d,type:Le["2D"],commands:[{property:"clearRect",args:[0,0,S,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:f}],type:b}]},0,0]}]})};let u=1e3/e,c=0,h,p=()=>{let m=[];return t.document.querySelectorAll("canvas").forEach(d=>{X(d,r,i,!0)||m.push(d)}),m},g=m=>{if(c&&m-c<u){h=requestAnimationFrame(g);return}c=m,p().forEach(async d=>{var f;let b=this.mirror.getId(d);if(l.get(b)||d.width===0||d.height===0)return;if(l.set(b,!0),["webgl","webgl2"].includes(d.__context)){let y=d.getContext(d.__context);((f=y==null?void 0:y.getContextAttributes())==null?void 0:f.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}let S=await createImageBitmap(d);a.postMessage({id:b,bitmap:S,width:d.width,height:d.height,dataURLOptions:n.dataURLOptions},[S])}),h=requestAnimationFrame(g)};h=requestAnimationFrame(g),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Ji(e,t,r,!1),n=vf(this.processMutation.bind(this),e,t,r),o=Ef(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let i=r.map(o=>{let{type:l,...a}=o;return a}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}},Ss=class{constructor(e){w(this,"trackedLinkElements",new WeakSet),w(this,"mutationCb"),w(this,"adoptedStyleSheetCb"),w(this,"styleMirror",new ds),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(e.length===0)return;let r={id:t,styleIds:[]},i=[];for(let n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:rn(l,n.href),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},vs=class{constructor(){w(this,"nodeMap",new WeakMap),w(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},W,Ut,Tr,rr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((ri=s.contentWindow)==null?void 0:ri.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}var re=Da();function ue(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:d,hooks:f,packFn:b,sampling:S={},dataURLOptions:y={},mousemoveWait:v,recordDOM:O=!0,recordCanvas:T=!1,recordCrossOriginIframes:V=!1,recordAfter:L=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:z=!1,collectFonts:Y=!1,inlineImages:q=!1,plugins:ne,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:$e=new Set([]),errorHandler:Fe}=s;rf(Fe);let G=V?window.parent===window:!0,Q=!1;if(!G)try{window.parent.document&&(Q=!1)}catch{Q=!0}if(G&&!e)throw new Error("emit function is required");if(!G&&!Q)return()=>{};v!==void 0&&S.mousemove===void 0&&(S.mousemove=v),re.reset();let ge=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},oe=un(g);Kh();let Ks,mr=0,qs=A=>{for(let te of ne||[])te.eventProcessor&&(A=te.eventProcessor(A));return b&&!Q&&(A=b(A)),A};W=(A,te)=>{var U;let B=A;if(B.timestamp=Qt(),(U=be[0])!=null&&U.isFrozen()&&B.type!==x.FullSnapshot&&!(B.type===x.IncrementalSnapshot&&B.data.source===E.Mutation)&&be.forEach(K=>K.unfreeze()),G)e==null||e(qs(B),te);else if(Q){let K={type:"rrweb",event:qs(B),origin:window.location.origin,isCheckout:te};window.parent.postMessage(K,"*")}if(B.type===x.FullSnapshot)Ks=B,mr=0;else if(B.type===x.IncrementalSnapshot){if(B.data.source===E.Mutation&&B.data.isAttachIframe)return;mr++;let K=r&&mr>=r,D=t&&B.timestamp-Ks.timestamp>t;(K||D)&&Ut(!0)}};let ut=A=>{W({type:x.IncrementalSnapshot,data:{source:E.Mutation,...A}})},Qs=A=>W({type:x.IncrementalSnapshot,data:{source:E.Scroll,...A}}),ei=A=>W({type:x.IncrementalSnapshot,data:{source:E.CanvasMutation,...A}}),oa=A=>W({type:x.IncrementalSnapshot,data:{source:E.AdoptedStyleSheet,...A}}),ye=new Ss({mutationCb:ut,adoptedStyleSheetCb:oa}),we=new ys({mirror:re,mutationCb:ut,stylesheetManager:ye,recordCrossOriginIframes:V,wrappedEmit:W});for(let A of ne||[])A.getMirror&&A.getMirror({nodeMirror:re,crossOriginIframeMirror:we.crossOriginIframeMirror,crossOriginIframeStyleMirror:we.crossOriginIframeStyleMirror});let gr=new vs;Tr=new bs({recordCanvas:T,mutationCb:ei,win:window,blockClass:i,blockSelector:n,mirror:re,sampling:S.canvas,dataURLOptions:y});let ct=new ws({mutationCb:ut,scrollCb:Qs,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:ge,dataURLOptions:y,maskTextFn:d,maskInputFn:m,recordCanvas:T,inlineImages:q,sampling:S,slimDOMOptions:oe,iframeManager:we,stylesheetManager:ye,canvasManager:Tr,keepIframeSrcFn:R,processedNodeManager:gr},mirror:re});Ut=(A=!1)=>{if(!O)return;W({type:x.Meta,data:{href:window.location.href,width:_o(),height:To()}},A),ye.reset(),ct.init(),be.forEach(U=>U.lock());let te=tl(document,{mirror:re,blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:ge,maskTextFn:d,maskInputFn:m,slimDOM:oe,dataURLOptions:y,recordCanvas:T,inlineImages:q,onSerialize:U=>{Lo(U,re)&&we.addIframe(U),$o(U,re)&&ye.trackLinkElement(U),fs(U)&&ct.addShadowRoot(C.shadowRoot(U),document)},onIframeLoad:(U,B)=>{we.attachIframe(U,B),ct.observeAttachShadow(U)},onStylesheetLoad:(U,B)=>{ye.attachLinkElement(U,B)},keepIframeSrcFn:R});if(!te)return console.warn("Failed to snapshot the document");W({type:x.FullSnapshot,data:{node:te,initialOffset:Do(window)}},A),be.forEach(U=>U.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ye.adoptStyleSheets(document.adoptedStyleSheets,re.getId(document))};try{let A=[],te=B=>{var K;return I(yf)({mutationCb:ut,mousemoveCb:(D,yr)=>W({type:x.IncrementalSnapshot,data:{source:yr,positions:D}}),mouseInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.MouseInteraction,...D}}),scrollCb:Qs,viewportResizeCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.ViewportResize,...D}}),inputCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.Input,...D}}),mediaInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.MediaInteraction,...D}}),styleSheetRuleCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.StyleSheetRule,...D}}),styleDeclarationCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.StyleDeclaration,...D}}),canvasMutationCb:ei,fontCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.Font,...D}}),selectionCb:D=>{W({type:x.IncrementalSnapshot,data:{source:E.Selection,...D}})},customElementCb:D=>{W({type:x.IncrementalSnapshot,data:{source:E.CustomElement,...D}})},blockClass:i,ignoreClass:o,ignoreSelector:l,maskTextClass:a,maskTextSelector:u,maskInputOptions:ge,inlineStylesheet:c,sampling:S,recordDOM:O,recordCanvas:T,inlineImages:q,userTriggeredOnInput:z,collectFonts:Y,doc:B,maskInputFn:m,maskTextFn:d,keepIframeSrcFn:R,blockSelector:n,slimDOMOptions:oe,dataURLOptions:y,mirror:re,iframeManager:we,stylesheetManager:ye,shadowDomManager:ct,processedNodeManager:gr,canvasManager:Tr,ignoreCSSAttributes:$e,plugins:((K=ne==null?void 0:ne.filter(D=>D.observer))==null?void 0:K.map(D=>({observer:D.observer,options:D.options,callback:yr=>W({type:x.Plugin,data:{plugin:D.name,payload:yr}})})))||[]},f)};we.addLoadListener(B=>{try{A.push(te(B.contentDocument))}catch(K){console.warn(K)}});let U=()=>{Ut(),A.push(te(document)),rr=!0};return["interactive","complete"].includes(document.readyState)?U():(A.push(Z("DOMContentLoaded",()=>{W({type:x.DomContentLoaded,data:{}}),L==="DOMContentLoaded"&&U()})),A.push(Z("load",()=>{W({type:x.Load,data:{}}),L==="load"&&U()},window))),()=>{A.forEach(B=>{try{B()}catch(K){String(K).toLowerCase().includes("cross-origin")||console.warn(K)}}),gr.destroy(),rr=!1,sf()}}catch(A){console.warn(A)}}ue.addCustomEvent=(s,e)=>{if(!rr)throw new Error("please add custom event after start recording");W({type:x.Custom,data:{tag:s,payload:e}})};ue.freezePage=()=>{be.forEach(s=>s.freeze())};ue.takeFullSnapshot=s=>{if(!rr)throw new Error("please take full snapshot after start recording");Ut(s)};ue.mirror=re;var Qi;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Qi||(Qi={}));var Sd=5*1e3;var{addCustomEvent:vd}=ue,{freezePage:Cd}=ue,{takeFullSnapshot:Ed}=ue;var Jo=()=>typeof CompressionStream=="function"&&typeof Response=="function"&&typeof TextEncoder=="function",Ko=async s=>{let e=new Response(s).body.pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(e).arrayBuffer())};var pr=null,Rf=s=>{if(!pr){pr=new Uint32Array(256);for(let t=0;t<256;t+=1){let r=t;for(let i=0;i<8;i+=1)r=r&1?3988292384^r>>>1:r>>>1;pr[t]=r>>>0}}let e=4294967295;for(let t=0;t<s.length;t+=1)e=pr[(e^s[t])&255]^e>>>8;return(e^4294967295)>>>0},Xo=(s,e,t)=>{s[e]=t&255,s[e+1]=t>>>8&255,s[e+2]=t>>>16&255,s[e+3]=t>>>24&255},js=s=>{let e=new TextEncoder().encode(s),t=Math.max(1,Math.ceil(e.length/65535)),r=new Uint8Array(10+t*5+e.length+8);r.set([31,139,8,0,0,0,0,0,0,255]);let i=10;for(let n=0;n<t;n+=1){let o=e.subarray(n*65535,(n+1)*65535);r[i]=n===t-1?1:0,r[i+1]=o.length&255,r[i+2]=o.length>>>8,r[i+3]=~o.length&255,r[i+4]=~o.length>>>8&255,r.set(o,i+5),i+=5+o.length}return Xo(r,i,Rf(e)),Xo(r,i+4,e.length),r};var qo="data-abyss-privacy";var Af=`img,picture,video,canvas,image,input[type="hidden"],[${qo}="hidden"]`,Nf="input,textarea,select,[contenteditable]",Mf=s=>s.replace(/\S/g,"*"),Of=(s,e,t)=>{if(!s||s.closest(Nf))return!1;for(let r=s;r;r=r.parentElement){let i=r.getAttribute(qo);if(i==="mask"||i==="hidden")return!1;if(i==="allow"||e!==""&&r.matches(e))return!0}return t},Df=(s,e)=>{let t=document.createDocumentFragment();return Array.from(new Set(s)).filter(r=>{try{return t.querySelector(String(r)),!0}catch{return e(),!1}}).join(",")},Qo=(s,e,t)=>{let r=Df([...e,...s.unmaskSelectors],t),i=s.defaultPrivacy==="MASK_INPUTS_ONLY";return{maskAllInputs:!0,maskInputFn:n=>"*".repeat(n.length),maskTextSelector:"*",maskTextFn:(n,o)=>Of(o,r,i)?n:Mf(n),blockSelector:Af}};var ta="abyss-rum-replay",ea=s=>typeof s=="number"&&Number.isInteger(s)&&s>=0,Ys=s=>{var t;let e=null;try{e=JSON.parse((t=sessionStorage.getItem(ta))!=null?t:"null")}catch{e=null}return(e==null?void 0:e.sessionId)===s&&ea(e.seq)&&ea(e.sentBytes)?{sessionId:s,seq:e.seq,sentBytes:e.sentBytes,startedAt:typeof e.startedAt=="number"?e.startedAt:null,stopped:e.stopped===!0}:{sessionId:s,seq:0,sentBytes:0,startedAt:null,stopped:!1}},lt=s=>{try{sessionStorage.setItem(ta,JSON.stringify(s))}catch{}};var ra=64*1024;var Hs=(s,e,t)=>{let r=o=>o.replace(/\/+$/,""),i=s.proxyUrl?r(s.proxyUrl):`${r(s.apiUrl)}/api`,n=ti(encodeURIComponent(s.applicationId),encodeURIComponent(e));return`${i}${n}?token=${encodeURIComponent(s.token)}&${"seq"}=${t}`},_f=s=>s===413||s===507||s===410?"SESSION_STOPPED":s===404?"NOT_FOUND":s===429?"RATE_LIMITED":s>=400&&s<500?"REFUSED":s>=200&&s<300?"STORED":"LOST",Zs=async(s,e,t,r)=>{let i;try{i=await s(e,{method:"POST",body:t,keepalive:r,credentials:"omit",headers:{"Content-Type":wr}})}catch{return{outcome:"LOST",liveWatched:!1}}let n=_f(i.status),o=!1;if(n==="STORED")try{o=(await i.json()).liveWatched===!0}catch{}return{outcome:n,liveWatched:o}},sa=(s,e)=>{try{return typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(s,new Blob([e],{type:wr}))}catch{return!1}};var Pf=2e3,Lf=10*1e3,$f=2*1e3,ia=3600*1e3,Ff=60*1e3,Uf=30*1e3,Bf=32*1024,na=s=>`{"events":[${s.join(",")}]}`,Xs=s=>{var t,r,i,n;let e=!1;try{e=((r=(t=s.options).consent)==null?void 0:r.call(t).analytics)===!0}catch{s.drop()}return{record:s.ready&&((i=s.session.decision)==null?void 0:i.replay)===!0&&((n=s.config)==null?void 0:n.replay.enabled)===!0&&e,liveWatched:s.liveWatched,sessionId:s.session.id}},Js=class{constructor(e,t,r){this.host=e;this.maxSessionBytes=t;this.privacy=r;this.events=[];this.eventsBytes=0;this.recording=!1;this.stopRecord=null;this.lastSentAt=Date.now();this.watched=!1;this.batchWatched=!1;this.pausedUntil=0;this.refused=!1;this.routeHref=null;this.routeExcluded=!1;this.compressing=[];this.outbox=[];this.sending=!1;this.sessionId=e.session.id,this.stored=Ys(this.sessionId)}start(){let e=setInterval(()=>this.guard(()=>this.tick()),Pf),t=()=>this.guard(()=>this.pageHide()),r=()=>this.guard(()=>{document.visibilityState==="hidden"&&this.flush()});return window.addEventListener("pagehide",t),document.addEventListener("visibilitychange",r),this.guard(()=>this.tick()),()=>{clearInterval(e),window.removeEventListener("pagehide",t),document.removeEventListener("visibilitychange",r),this.discard()}}guard(e){try{e()}catch{this.host.drop()}}tick(){let e=Xs(this.host);if(!e.record){this.discard();return}if(e.sessionId!==this.sessionId&&(this.flush(),this.halt(),this.sessionId=e.sessionId,this.stored=Ys(e.sessionId),this.watched=!1),e.liveWatched!==this.batchWatched&&(this.batchWatched=e.liveWatched,this.watched=e.liveWatched),this.drain(),this.stored.stopped||this.refused)return;let t=Date.now();if(this.stored.startedAt!==null&&t-this.stored.startedAt>=ia){this.flush(),this.stopSession();return}if(this.isRouteExcluded()){this.flush(),this.halt();return}this.recording||this.begin();let r=this.watched?$f:Lf;t-this.lastSentAt>=r&&this.flush()}begin(){this.lastSentAt=Date.now(),this.recording=!0;let e=ue({emit:t=>this.guard(()=>this.onEvent(t)),...this.privacy,recordCanvas:!1,recordCrossOriginIframes:!1,collectFonts:!1,inlineImages:!1,slimDOMOptions:"all",sampling:{scroll:150,input:"last"},errorHandler:()=>(this.host.drop(),!0)});e?this.stopRecord=e:(this.recording=!1,this.refused=!0,this.host.drop())}onEvent(e){let t=Xs(this.host);if(!t.record){this.discard();return}if(!this.recording||t.sessionId!==this.sessionId||this.isRouteExcluded())return;let r=Date.now();if(this.stored.startedAt===null&&(this.stored.startedAt=r,lt(this.stored)),r-this.stored.startedAt>=ia){this.flush(),this.stopSession();return}let i=JSON.stringify(e);this.events.push(i),this.eventsBytes+=i.length,this.eventsBytes>=Bf&&this.flush()}pageHide(){Xs(this.host).record?this.unload():this.discard()}takeEvents(){let e=this.events;return this.events=[],this.eventsBytes=0,e}nextSeq(e){let t=e.seq;return e.seq+=1,lt(e),t}flush(){if(this.events.length===0||Date.now()<this.pausedUntil)return;let e=na(this.takeEvents());this.lastSentAt=Date.now();let t=this.stored,r={stored:t,seq:this.nextSeq(t),json:e,body:null};this.compressing.push(r);let i=n=>this.guard(()=>{let o=this.compressing.indexOf(r);o!==-1&&(n?r.body=n:(this.compressing.splice(o,1),this.host.drop()),this.release())});Ko(e).then(i,()=>i(null))}release(){let e=this.compressing[0];for(;e&&e.body;){this.compressing.shift();let{stored:t,seq:r,body:i}=e;this.withinCaps(t,this.outbox,i)&&(this.outbox.push({stored:t,seq:r,body:i,notFoundSince:null}),this.drain()),e=this.compressing[0]}}withinCaps(e,t,r){let i=t.reduce((n,o)=>o.stored===e?n+o.body.length:n,0);return r.length>20971520||e.sentBytes+i+r.length>this.maxSessionBytes?(this.settle(e,"SESSION_STOPPED"),!1):!0}drain(){let e=this.outbox[0];if(!e||this.sending||Date.now()<this.pausedUntil)return;this.sending=!0;let t=Hs(this.host.options,e.stored.sessionId,e.seq);Zs(this.host.nativeFetch,t,e.body,!1).then(r=>{this.sending=!1,this.guard(()=>this.onAnswer(e,r))},()=>{this.sending=!1,this.host.drop()})}unload(){let e=[...this.outbox,...this.compressing.map(({stored:l,seq:a,json:u,body:c})=>({stored:l,seq:a,body:c||js(u),notFoundSince:null}))];this.outbox=[],this.compressing=[];let t=this.takeEvents(),r=ra,i=new Set,n=[];for(let l of e)i.has(l.stored)||l.body.length>r?(i.add(l.stored),this.host.drop()):(r-=l.body.length,n.push(l));let o=this.stored;if(t.length>0&&Date.now()>=this.pausedUntil){let l=js(na(t));i.has(o)||l.length>r?this.host.drop():this.withinCaps(o,n,l)&&n.push({stored:o,seq:this.nextSeq(o),body:l,notFoundSince:null})}for(let l of n){let a=Hs(this.host.options,l.stored.sessionId,l.seq);sa(a,l.body)?(l.stored.sentBytes+=l.body.length,this.save(l.stored)):Zs(this.host.nativeFetch,a,l.body,!0).then(u=>this.guard(()=>this.onAnswer(l,u)),this.host.drop)}}onAnswer(e,t){var o;let r=this.outbox[0]===e,{outcome:i}=t;if(i==="NOT_FOUND"){let l=Date.now();if(e.notFoundSince=(o=e.notFoundSince)!=null?o:l,r&&l-e.notFoundSince<Uf)return;i="REFUSED"}r&&this.outbox.shift();let{stored:n}=e;if(i==="STORED")n.sentBytes+=e.body.length,this.save(n),n===this.stored&&(this.watched=t.liveWatched);else{if(i==="REFUSED"||i==="SESSION_STOPPED"){let l=this.outbox.filter(u=>u.stored!==n),a=this.outbox.length-l.length;for(let u=0;u<a&&i==="REFUSED";u+=1)this.host.drop();this.outbox=l}this.settle(n,i)}this.drain()}settle(e,t){t==="SESSION_STOPPED"?(e.stopped=!0,this.save(e)):this.host.drop(),e===this.stored&&(t==="SESSION_STOPPED"?this.stopSession():t==="REFUSED"?(this.refused=!0,this.halt(),this.takeEvents(),this.compressing=[]):(t==="RATE_LIMITED"&&(this.pausedUntil=Date.now()+Ff),this.recording&&ue.takeFullSnapshot(!0)))}save(e){e===this.stored&&lt(e)}stopSession(){this.stored.stopped=!0,lt(this.stored),this.halt(),this.takeEvents()}halt(){let e=this.stopRecord;this.recording=!1,this.stopRecord=null,e==null||e()}discard(){this.halt(),this.takeEvents(),this.outbox=[],this.compressing=[]}isRouteExcluded(){var t;let e=window.location.href;if(e!==this.routeHref){this.routeHref=e;let r=(t=this.host.options.replayExcludedRoutes)!=null?t:[],i=r.length>0?this.route():"";this.routeExcluded=r.some(n=>n instanceof RegExp?i.search(n)!==-1:i===n)}return this.routeExcluded}route(){let{routeResolver:e}=this.host.options;if(e)try{return String(e(window.location))}catch{this.host.drop()}return window.location.pathname}},$d=s=>{var e,t;try{let r=(e=s.config)==null?void 0:e.replay,i=r==null?void 0:r.maxSessionBytes;if(s.stopped||!r||typeof i!="number"||!(i>0)||!Jo())return;let n=Qo(r,(t=s.options.unmaskSelectors)!=null?t:[],s.drop);s.teardowns.push(new Js(s,i,n).start())}catch{s.drop()}};export{Lf as REPLAY_CHUNK_INTERVAL_MS,Bf as REPLAY_EAGER_FLUSH_BYTES,$f as REPLAY_LIVE_CHUNK_INTERVAL_MS,ia as REPLAY_MAX_DURATION_MS,Uf as REPLAY_NOT_FOUND_RETRY_MS,Ff as REPLAY_RATE_LIMIT_PAUSE_MS,Pf as REPLAY_TICK_MS,$d as recordReplay,Xs as replayState};
53
+ or you can use record.mirror to access the mirror instance during recording.`,Vi={map:{},getId(){return console.error(xe),-1},getNode(){return console.error(xe),null},removeNodeFromMap(){console.error(xe)},has(){return console.error(xe),!1},reset(){console.error(xe)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Vi=new Proxy(Vi,{get(s,e,t){return e==="map"&&console.error(xe),Reflect.get(s,e,t)}}));function rt(s,e,t={}){let r=null,i=0;return function(...n){let o=Date.now();!i&&t.leading===!1&&(i=o);let l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,n)},l))}}function dr(s,e,t,r,i=window){let n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>dr(s,e,n||{},!0)}var Qt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Qt=()=>new Date().getTime());function Do(s){var e,t,r,i;let n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||(n==null?void 0:n.body)&&((e=C.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n==null?void 0:n.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(n==null?void 0:n.documentElement.scrollTop)||(n==null?void 0:n.body)&&((r=C.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n==null?void 0:n.body)==null?void 0:i.scrollTop)||0}}function To(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _o(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ko(s){return s?s.nodeType===s.ELEMENT_NODE?s:C.parentElement(s):null}function X(s,e,t,r){if(!s)return!1;let i=ko(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(Gt(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Jh(s,e){return e.getId(s)!==-1}function Dr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===He}function Po(s,e){if(Ge(s))return!1;let t=e.getId(s);if(!e.has(t))return!0;let r=C.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Po(r,e):!0}function hs(s){return!!s.changedTouches}function Kh(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Lo(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function $o(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function fs(s){return s?s instanceof cs&&"shadowRoot"in s?!!s.shadowRoot:!!C.shadowRoot(s):!1}var ds=class{constructor(){w(this,"id",1),w(this,"styleIDMap",new WeakMap),w(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}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 Fo(s){var e;let t=null;return"getRootNode"in s&&((e=C.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(s))&&(t=C.host(C.getRootNode(s))),t}function qh(s){let e=s,t;for(;t=Fo(e);)e=t;return e}function Qh(s){let e=C.ownerDocument(s);if(!e)return!1;let t=qh(s);return C.contains(e,t)}function Uo(s){let e=C.ownerDocument(s);return e?C.contains(e,s)||Qh(s):!1}var x=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(x||{}),E=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(E||{}),J=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(J||{}),ce=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(ce||{}),Le=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Le||{}),Re=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Re||{});var Bo=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Bo||{});function Gi(s){return"__ln"in s}var ps=class{constructor(){w(this,"length",0),w(this,"head",null),w(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Gi(e.previousSibling)){let r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Gi(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let 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--)}},ji=(s,e)=>`${s}@${e}`,ms=class{constructor(){w(this,"frozen",!1),w(this,"locked",!1),w(this,"texts",[]),w(this,"attributes",[]),w(this,"attributeMap",new WeakMap),w(this,"removes",[]),w(this,"mapRemoves",[]),w(this,"movedMap",{}),w(this,"addedSet",new Set),w(this,"movedSet",new Set),w(this,"droppedSet",new Set),w(this,"removesSubTreeCache",new Set),w(this,"mutationCb"),w(this,"blockClass"),w(this,"blockSelector"),w(this,"maskTextClass"),w(this,"maskTextSelector"),w(this,"inlineStylesheet"),w(this,"maskInputOptions"),w(this,"maskTextFn"),w(this,"maskInputFn"),w(this,"keepIframeSrcFn"),w(this,"recordCanvas"),w(this,"inlineImages"),w(this,"slimDOMOptions"),w(this,"dataURLOptions"),w(this,"doc"),w(this,"mirror"),w(this,"iframeManager"),w(this,"stylesheetManager"),w(this,"shadowDomManager"),w(this,"canvasManager"),w(this,"processedNodeManager"),w(this,"unattachedDoc"),w(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),w(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new ps,i=a=>{let u=a,c=He;for(;c===He;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},n=a=>{let u=C.parentNode(a);if(!u||!Uo(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){let m=u.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let h=Ge(u)?this.mirror.getId(Fo(a)):this.mirror.getId(u),p=i(a);if(h===-1||p===-1)return r.addNode(a);let g=Ne(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{Lo(m,this.mirror)&&this.iframeManager.addIframe(m),$o(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),fs(a)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(a),this.doc)},onIframeLoad:(m,d)=>{this.iframeManager.attachIframe(m,d),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,d)=>{this.stylesheetManager.attachLinkElement(m,d)},cssCaptured:c});g&&(e.push({parentId:h,nextId:p,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let a of this.movedSet)Yi(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(C.parentNode(a))||n(a);for(let a of this.addedSet)!Hi(this.droppedSet,a)&&!Yi(this.removesSubTreeCache,a,this.mirror)||Hi(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){let u=this.mirror.getId(C.parentNode(o.value)),c=i(o.value);u!==-1&&c!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let h=this.mirror.getId(C.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){a=c;break}else{let g=c.value,m=C.parentNode(g);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let d=C.host(m);if(this.mirror.getId(d)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),n(a.value)}let l={texts:this.texts.map(a=>{let u=a.node,c=C.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{let{attributes:u}=a;if(typeof u.style=="string"){let c=JSON.stringify(a.styleDiff),h=JSON.stringify(a._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(l))}),w(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let r=Array.from(C.childNodes(e),i=>C.textContent(i)||"").join("");t.attributes.value=Wt({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:zt(e),value:r,maskInputFn:this.maskInputFn})}),w(this,"processMutation",e=>{if(!Dr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=C.textContent(e.target);!X(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:ln(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,ko(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){let o=zt(t);i=Wt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(X(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!an(t.tagName,r))if(n.attributes[r]=on(this.doc,Se(t.tagName),Se(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(let l of Array.from(t.style)){let a=t.style.getPropertyValue(l),u=t.style.getPropertyPriority(l);a!==o.style.getPropertyValue(l)||u!==o.style.getPropertyPriority(l)?u===""?n.styleDiff[l]=a:n.styleDiff[l]=[a,u]:n._unchangedStyles[l]=[a,u]}for(let l of Array.from(o.style))t.style.getPropertyValue(l)===""&&(n.styleDiff[l]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(X(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),i=Ge(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);X(e.target,this.blockClass,this.blockSelector,!1)||Dr(t,this.mirror,this.slimDOMOptions)||!Jh(t,this.mirror)||(this.addedSet.has(t)?(gs(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||Po(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ji(r,i)]?gs(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:Ge(e.target)&&je(e.target)?!0:void 0}),ef(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),w(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Dr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[ji(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);X(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach(r=>this.genAdds(r)),fs(e)&&C.childNodes(C.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function gs(s,e){s.delete(e),C.childNodes(e).forEach(t=>gs(s,t))}function ef(s,e){let t=[s];for(;t.length;){let r=t.pop();e.has(r)||(e.add(r),C.childNodes(r).forEach(i=>t.push(i)))}}function Yi(s,e,t){return s.size===0?!1:tf(s,e)}function tf(s,e,t){let r=C.parentNode(e);return r?s.has(r):!1}function Hi(s,e){return s.size===0?!1:Wo(s,e)}function Wo(s,e){let t=C.parentNode(e);return t?s.has(t)?!0:Wo(s,t):!1}var Ye;function rf(s){Ye=s}function sf(){Ye=void 0}var I=s=>Ye?(...t)=>{try{return s(...t)}catch(r){if(Ye&&Ye(r)===!0)return;throw r}}:s,be=[];function at(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function zo(s,e){let t=new ms;be.push(t),t.init(s);let r=new(Oo())(I(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function nf({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,o=[],l,a=rt(I(h=>{let p=Date.now()-l;s(o.map(g=>(g.timeOffset-=p,g)),h),o=[],l=null}),n),u=I(rt(I(h=>{let p=at(h),{clientX:g,clientY:m}=hs(h)?h.changedTouches[0]:h;l||(l=Qt()),o.push({x:g,y:m,id:r.getId(p),timeOffset:Qt()-l}),a(typeof DragEvent!="undefined"&&h instanceof DragEvent?E.Drag:h instanceof MouseEvent?E.MouseMove:E.TouchMove)}),i,{trailing:!1})),c=[Z("mousemove",u,t),Z("touchmove",u,t),Z("drag",u,t)];return I(()=>{c.forEach(h=>h())})}function of({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};let o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[],a=null,u=c=>h=>{let p=at(h);if(X(p,r,i,!0))return;let g=null,m=c;if("pointerType"in h){switch(h.pointerType){case"mouse":g=ce.Mouse;break;case"touch":g=ce.Touch;break;case"pen":g=ce.Pen;break}g===ce.Touch?J[c]===J.MouseDown?m="TouchStart":J[c]===J.MouseUp&&(m="TouchEnd"):ce.Pen}else hs(h)&&(g=ce.Touch);g!==null?(a=g,(m.startsWith("Touch")&&g===ce.Touch||m.startsWith("Mouse")&&g===ce.Mouse)&&(g=null)):J[c]===J.Click&&(g=a,a=null);let d=hs(h)?h.changedTouches[0]:h;if(!d)return;let f=t.getId(p),{clientX:b,clientY:S}=d;I(s)({type:J[m],id:f,x:b,y:S,...g!==null&&{pointerType:g}})};return Object.keys(J).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&o[c]!==!1).forEach(c=>{let h=Se(c),p=u(c);if(window.PointerEvent)switch(J[c]){case J.MouseDown:case J.MouseUp:h=h.replace("mouse","pointer");break;case J.TouchStart:case J.TouchEnd:return}l.push(Z(h,p,e))}),I(()=>{l.forEach(c=>c())})}function Vo({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){let o=I(rt(I(l=>{let a=at(l);if(!a||X(a,r,i,!0))return;let u=t.getId(a);if(a===e&&e.defaultView){let c=Do(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return Z("scroll",o,e)}function af({viewportResizeCb:s},{win:e}){let t=-1,r=-1,i=I(rt(I(()=>{let n=To(),o=_o();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return Z("resize",i,e)}var lf=["INPUT","TEXTAREA","SELECT"],Zi=new WeakMap;function uf({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function h(S){let y=at(S),v=S.isTrusted,O=y&&y.tagName;if(y&&O==="OPTION"&&(y=C.parentElement(y)),!y||!O||lf.indexOf(O)<0||X(y,r,i,!0)||y.classList.contains(n)||o&&y.matches(o))return;let T=y.value,V=!1,L=zt(y)||"";L==="radio"||L==="checkbox"?V=y.checked:(l[O.toLowerCase()]||l[L])&&(T=Wt({element:y,maskInputOptions:l,tagName:O,type:L,value:T,maskInputFn:a})),p(y,c?{text:T,isChecked:V,userTriggered:v}:{text:T,isChecked:V});let z=y.name;L==="radio"&&z&&V&&e.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(Y=>{if(Y!==y){let q=Y.value;p(Y,c?{text:q,isChecked:!V,userTriggered:!1}:{text:q,isChecked:!V})}})}function p(S,y){let v=Zi.get(S);if(!v||v.text!==y.text||v.isChecked!==y.isChecked){Zi.set(S,y);let O=t.getId(S);I(s)({...y,id:O})}}let m=(u.input==="last"?["change"]:["input","change"]).map(S=>Z(S,I(h),e)),d=e.defaultView;if(!d)return()=>{m.forEach(S=>S())};let f=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),b=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&m.push(...b.map(S=>dr(S[0],S[1],{set(){I(h)({target:this,isTrusted:!1})}},!1,d))),I(()=>{m.forEach(S=>S())})}function er(s){let e=[];function t(r,i){if(Tt("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Tt("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Tt("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Tt("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){let o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function me(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function cf({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:I((c,h,p)=>{let[g,m]=p,{id:d,styleId:f}=me(h,e,t.styleMirror);return(d&&d!==-1||f&&f!==-1)&&s({id:d,styleId:f,adds:[{rule:g,index:m}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,p=this.cssRules.length){let g=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,p])};let n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:I((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,removes:[{index:g}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:I((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replace:g}),c.apply(h,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:I((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replaceSync:g}),c.apply(h,p)})}));let a={};_t("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(_t("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),_t("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),_t("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(a).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:I((p,g,m)=>{let[d,f]=m,{id:b,styleId:S}=me(g.parentStyleSheet,e,t.styleMirror);return(b&&b!==-1||S&&S!==-1)&&s({id:b,styleId:S,adds:[{rule:d,index:[...er(g),f||0]}]}),p.apply(g,m)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:I((p,g,m)=>{let[d]=m,{id:f,styleId:b}=me(g.parentStyleSheet,e,t.styleMirror);return(f&&f!==-1||b&&b!==-1)&&s({id:f,styleId:b,removes:[{index:[...er(g),d]}]}),p.apply(g,m)})})}),I(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function Go({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(C.host(t));let l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;let h=(c=a.set)==null?void 0:c.call(this,u);if(o!==null&&o!==-1)try{e.adoptStyleSheets(u,o)}catch{}return h}}),I(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function hf({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){let n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:I((l,a,u)=>{var c;let[h,p,g]=u;if(t.has(h))return n.apply(a,[h,p,g]);let{id:m,styleId:d}=me((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,set:{property:h,value:p,priority:g},index:er(a.parentRule)}),l.apply(a,u)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:I((l,a,u)=>{var c;let[h]=u;if(t.has(h))return o.apply(a,[h]);let{id:p,styleId:g}=me((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,remove:{property:h},index:er(a.parentRule)}),l.apply(a,u)})}),I(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function ff({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){let o=I(a=>rt(I(u=>{let c=at(u);if(!c||X(c,e,t,!0))return;let{currentTime:h,volume:p,muted:g,playbackRate:m,loop:d}=c;s({type:a,id:r.getId(c),currentTime:h,volume:p,muted:g,playbackRate:m,loop:d})}),i.media||500)),l=[Z("play",o(Re.Play),n),Z("pause",o(Re.Pause),n),Z("seeked",o(Re.Seeked),n),Z("volumechange",o(Re.VolumeChange),n),Z("ratechange",o(Re.RateChange),n)];return I(()=>{l.forEach(a=>a())})}function df({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,u,c){let h=new n(a,u,c);return i.set(h,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};let o=Ee(e.fonts,"add",function(l){return function(a){return setTimeout(I(()=>{let u=i.get(a);u&&(s(u),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n}),r.push(o),I(()=>{r.forEach(l=>l())})}function pf(s){let{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s,o=!0,l=I(()=>{let a=e.getSelection();if(!a||o&&(a!=null&&a.isCollapsed))return;o=a.isCollapsed||!1;let u=[],c=a.rangeCount||0;for(let h=0;h<c;h++){let p=a.getRangeAt(h),{startContainer:g,startOffset:m,endContainer:d,endOffset:f}=p;X(g,r,i,!0)||X(d,r,i,!0)||u.push({start:t.getId(g),startOffset:m,end:t.getId(d),endOffset:f})}n({ranges:u})});return l(),Z("selectionchange",l)}function mf({doc:s,customElementCb:e}){let t=s.defaultView;return!t||!t.customElements?()=>{}:Ee(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function gf(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:p,selectionCb:g,customElementCb:m}=s;s.mutationCb=(...d)=>{e.mutation&&e.mutation(...d),t(...d)},s.mousemoveCb=(...d)=>{e.mousemove&&e.mousemove(...d),r(...d)},s.mouseInteractionCb=(...d)=>{e.mouseInteraction&&e.mouseInteraction(...d),i(...d)},s.scrollCb=(...d)=>{e.scroll&&e.scroll(...d),n(...d)},s.viewportResizeCb=(...d)=>{e.viewportResize&&e.viewportResize(...d),o(...d)},s.inputCb=(...d)=>{e.input&&e.input(...d),l(...d)},s.mediaInteractionCb=(...d)=>{e.mediaInteaction&&e.mediaInteaction(...d),a(...d)},s.styleSheetRuleCb=(...d)=>{e.styleSheetRule&&e.styleSheetRule(...d),u(...d)},s.styleDeclarationCb=(...d)=>{e.styleDeclaration&&e.styleDeclaration(...d),c(...d)},s.canvasMutationCb=(...d)=>{e.canvasMutation&&e.canvasMutation(...d),h(...d)},s.fontCb=(...d)=>{e.font&&e.font(...d),p(...d)},s.selectionCb=(...d)=>{e.selection&&e.selection(...d),g(...d)},s.customElementCb=(...d)=>{e.customElement&&e.customElement(...d),m(...d)}}function yf(s,e={}){let t=s.doc.defaultView;if(!t)return()=>{};gf(s,e);let r;s.recordDOM&&(r=zo(s,s.doc));let i=nf(s),n=of(s),o=Vo(s),l=af(s,{win:t}),a=uf(s),u=ff(s),c=()=>{},h=()=>{},p=()=>{},g=()=>{};s.recordDOM&&(c=cf(s,{win:t}),h=Go(s,s.doc),p=hf(s,{win:t}),s.collectFonts&&(g=df(s)));let m=pf(s),d=mf(s),f=[];for(let b of s.plugins)f.push(b.observer(b.callback,t,b.options));return I(()=>{be.forEach(b=>b.reset()),r==null||r.disconnect(),i(),n(),o(),l(),a(),u(),c(),h(),p(),g(),m(),d(),f.forEach(b=>b())})}function Tt(s){return typeof window[s]!="undefined"}function _t(s){return!!(typeof window[s]!="undefined"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var tr=class{constructor(e){w(this,"iframeIdToRemoteIdMap",new WeakMap),w(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){let n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){let r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){let i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let n=i.get(t);return n||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}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}},ys=class{constructor(e){w(this,"iframes",new WeakMap),w(this,"crossOriginIframeMap",new WeakMap),w(this,"crossOriginIframeMirror",new tr(nn)),w(this,"crossOriginIframeStyleMirror"),w(this,"crossOriginIframeRootIdMap",new WeakMap),w(this,"mirror"),w(this,"mutationCb"),w(this,"wrappedEmit"),w(this,"loadListener"),w(this,"stylesheetManager"),w(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new tr(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case x.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:x.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case x.Meta:case x.Load:case x.DomContentLoaded:return!1;case x.Plugin:return t;case x.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case x.IncrementalSnapshot:switch(t.data.source){case E.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.Drag:case E.TouchMove:case E.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.ViewportResize:return!1;case E.MediaInteraction:case E.MouseInteraction:case E.Scroll:case E.CanvasMutation:case E.Input:return this.replaceIds(t.data,e,["id"]),t;case E.StyleSheetRule:case E.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case E.Font:return t;case E.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case E.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(let n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==Bo.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},ws=class{constructor(e){w(this,"shadowDoms",new WeakSet),w(this,"mutationCb"),w(this,"scrollCb"),w(this,"bypassOptions"),w(this,"mirror"),w(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(!je(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=zo({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Vo({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push(Go({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push(Ee(e.prototype,"attachShadow",function(i){return function(n){let o=i.call(this,n),l=C.shadowRoot(this);return l&&Uo(this)&&r.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wf=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(Ve=0;Ve<Me.length;Ve++)wf[Me.charCodeAt(Ve)]=Ve;var Ve,bf=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Me[e[t]>>2],i+=Me[(e[t]&3)<<4|e[t+1]>>4],i+=Me[(e[t+1]&15)<<2|e[t+2]>>6],i+=Me[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var Xi=new Map;function Sf(s,e){let t=Xi.get(s);return t||(t=new Map,Xi.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}var jo=(s,e,t)=>{if(!s||!(Ho(s,e)||typeof s=="object"))return;let r=s.constructor.name,i=Sf(t,r),n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function Ft(s,e,t){if(s instanceof Array)return s.map(r=>Ft(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,i=bf(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[Ft(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[Ft(s.data,e,t),s.width,s.height]};if(Ho(s,e)||typeof s=="object"){let r=s.constructor.name,i=jo(s,e,t);return{rr_type:r,index:i}}}}return s}var Yo=(s,e,t)=>s.map(r=>Ft(r,e,t)),Ho=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function vf(s,e,t,r){let i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;let l=Ee(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...u){return X(this.canvas,t,r,!0)||setTimeout(()=>{let c=Yo(u,e,this);s(this.canvas,{type:Le["2D"],property:o,args:c})},0),a.apply(this,u)}});i.push(l)}catch{let l=dr(e.CanvasRenderingContext2D.prototype,o,{set(a){s(this.canvas,{type:Le["2D"],property:o,args:[a],setter:!0})}});i.push(l)}return()=>{i.forEach(o=>o())}}function Cf(s){return s==="experimental-webgl"?"webgl":s}function Ji(s,e,t,r){let i=[];try{let n=Ee(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!X(this,e,t,!0)){let u=Cf(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){let c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function Ki(s,e,t,r,i,n){let o=[],l=Object.getOwnPropertyNames(s);for(let a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;let u=Ee(s,a,function(c){return function(...h){let p=c.apply(this,h);if(jo(p,n,this),"tagName"in this.canvas&&!X(this.canvas,r,i,!0)){let g=Yo(h,n,this),m={type:e,property:a,args:g};t(this.canvas,m)}return p}});o.push(u)}catch{let u=dr(s,a,{set(c){t(this.canvas,{type:e,property:a,args:[c],setter:!0})}});o.push(u)}return o}function Ef(s,e,t,r){let i=[];return i.push(...Ki(e.WebGLRenderingContext.prototype,Le.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...Ki(e.WebGL2RenderingContext.prototype,Le.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}var Zo="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",If=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),qi=typeof window!="undefined"&&window.Blob&&new Blob([If(Zo)],{type:"text/javascript;charset=utf-8"});function xf(s){let e;try{if(e=qi&&(window.URL||window.webkitURL).createObjectURL(qi),!e)throw"";let t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+Zo,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var bs=class{constructor(e){w(this,"pendingCanvasMutations",new Map),w(this,"rafStamps",{latestId:0,invokeId:null}),w(this,"mirror"),w(this,"mutationCb"),w(this,"resetObservers"),w(this,"frozen",!1),w(this,"locked",!1),w(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});let{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,n){let o=Ji(t,r,i,!0),l=new Map,a=new xf;a.onmessage=m=>{let{id:d}=m.data;if(l.set(d,!1),!("base64"in m.data))return;let{base64:f,type:b,width:S,height:y}=m.data;this.mutationCb({id:d,type:Le["2D"],commands:[{property:"clearRect",args:[0,0,S,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:f}],type:b}]},0,0]}]})};let u=1e3/e,c=0,h,p=()=>{let m=[];return t.document.querySelectorAll("canvas").forEach(d=>{X(d,r,i,!0)||m.push(d)}),m},g=m=>{if(c&&m-c<u){h=requestAnimationFrame(g);return}c=m,p().forEach(async d=>{var f;let b=this.mirror.getId(d);if(l.get(b)||d.width===0||d.height===0)return;if(l.set(b,!0),["webgl","webgl2"].includes(d.__context)){let y=d.getContext(d.__context);((f=y==null?void 0:y.getContextAttributes())==null?void 0:f.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}let S=await createImageBitmap(d);a.postMessage({id:b,bitmap:S,width:d.width,height:d.height,dataURLOptions:n.dataURLOptions},[S])}),h=requestAnimationFrame(g)};h=requestAnimationFrame(g),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Ji(e,t,r,!1),n=vf(this.processMutation.bind(this),e,t,r),o=Ef(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let i=r.map(o=>{let{type:l,...a}=o;return a}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}},Ss=class{constructor(e){w(this,"trackedLinkElements",new WeakSet),w(this,"mutationCb"),w(this,"adoptedStyleSheetCb"),w(this,"styleMirror",new ds),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(e.length===0)return;let r={id:t,styleIds:[]},i=[];for(let n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:rn(l,n.href),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},vs=class{constructor(){w(this,"nodeMap",new WeakMap),w(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},W,Ut,Tr,rr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((ri=s.contentWindow)==null?void 0:ri.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}var re=Da();function ue(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:d,hooks:f,packFn:b,sampling:S={},dataURLOptions:y={},mousemoveWait:v,recordDOM:O=!0,recordCanvas:T=!1,recordCrossOriginIframes:V=!1,recordAfter:L=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:z=!1,collectFonts:Y=!1,inlineImages:q=!1,plugins:ne,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:$e=new Set([]),errorHandler:Fe}=s;rf(Fe);let G=V?window.parent===window:!0,Q=!1;if(!G)try{window.parent.document&&(Q=!1)}catch{Q=!0}if(G&&!e)throw new Error("emit function is required");if(!G&&!Q)return()=>{};v!==void 0&&S.mousemove===void 0&&(S.mousemove=v),re.reset();let ge=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},oe=un(g);Kh();let Ks,mr=0,qs=A=>{for(let te of ne||[])te.eventProcessor&&(A=te.eventProcessor(A));return b&&!Q&&(A=b(A)),A};W=(A,te)=>{var U;let B=A;if(B.timestamp=Qt(),(U=be[0])!=null&&U.isFrozen()&&B.type!==x.FullSnapshot&&!(B.type===x.IncrementalSnapshot&&B.data.source===E.Mutation)&&be.forEach(K=>K.unfreeze()),G)e==null||e(qs(B),te);else if(Q){let K={type:"rrweb",event:qs(B),origin:window.location.origin,isCheckout:te};window.parent.postMessage(K,"*")}if(B.type===x.FullSnapshot)Ks=B,mr=0;else if(B.type===x.IncrementalSnapshot){if(B.data.source===E.Mutation&&B.data.isAttachIframe)return;mr++;let K=r&&mr>=r,D=t&&B.timestamp-Ks.timestamp>t;(K||D)&&Ut(!0)}};let ut=A=>{W({type:x.IncrementalSnapshot,data:{source:E.Mutation,...A}})},Qs=A=>W({type:x.IncrementalSnapshot,data:{source:E.Scroll,...A}}),ei=A=>W({type:x.IncrementalSnapshot,data:{source:E.CanvasMutation,...A}}),oa=A=>W({type:x.IncrementalSnapshot,data:{source:E.AdoptedStyleSheet,...A}}),ye=new Ss({mutationCb:ut,adoptedStyleSheetCb:oa}),we=new ys({mirror:re,mutationCb:ut,stylesheetManager:ye,recordCrossOriginIframes:V,wrappedEmit:W});for(let A of ne||[])A.getMirror&&A.getMirror({nodeMirror:re,crossOriginIframeMirror:we.crossOriginIframeMirror,crossOriginIframeStyleMirror:we.crossOriginIframeStyleMirror});let gr=new vs;Tr=new bs({recordCanvas:T,mutationCb:ei,win:window,blockClass:i,blockSelector:n,mirror:re,sampling:S.canvas,dataURLOptions:y});let ct=new ws({mutationCb:ut,scrollCb:Qs,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:ge,dataURLOptions:y,maskTextFn:d,maskInputFn:m,recordCanvas:T,inlineImages:q,sampling:S,slimDOMOptions:oe,iframeManager:we,stylesheetManager:ye,canvasManager:Tr,keepIframeSrcFn:R,processedNodeManager:gr},mirror:re});Ut=(A=!1)=>{if(!O)return;W({type:x.Meta,data:{href:window.location.href,width:_o(),height:To()}},A),ye.reset(),ct.init(),be.forEach(U=>U.lock());let te=tl(document,{mirror:re,blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:ge,maskTextFn:d,maskInputFn:m,slimDOM:oe,dataURLOptions:y,recordCanvas:T,inlineImages:q,onSerialize:U=>{Lo(U,re)&&we.addIframe(U),$o(U,re)&&ye.trackLinkElement(U),fs(U)&&ct.addShadowRoot(C.shadowRoot(U),document)},onIframeLoad:(U,B)=>{we.attachIframe(U,B),ct.observeAttachShadow(U)},onStylesheetLoad:(U,B)=>{ye.attachLinkElement(U,B)},keepIframeSrcFn:R});if(!te)return console.warn("Failed to snapshot the document");W({type:x.FullSnapshot,data:{node:te,initialOffset:Do(window)}},A),be.forEach(U=>U.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ye.adoptStyleSheets(document.adoptedStyleSheets,re.getId(document))};try{let A=[],te=B=>{var K;return I(yf)({mutationCb:ut,mousemoveCb:(D,yr)=>W({type:x.IncrementalSnapshot,data:{source:yr,positions:D}}),mouseInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.MouseInteraction,...D}}),scrollCb:Qs,viewportResizeCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.ViewportResize,...D}}),inputCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.Input,...D}}),mediaInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.MediaInteraction,...D}}),styleSheetRuleCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.StyleSheetRule,...D}}),styleDeclarationCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.StyleDeclaration,...D}}),canvasMutationCb:ei,fontCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.Font,...D}}),selectionCb:D=>{W({type:x.IncrementalSnapshot,data:{source:E.Selection,...D}})},customElementCb:D=>{W({type:x.IncrementalSnapshot,data:{source:E.CustomElement,...D}})},blockClass:i,ignoreClass:o,ignoreSelector:l,maskTextClass:a,maskTextSelector:u,maskInputOptions:ge,inlineStylesheet:c,sampling:S,recordDOM:O,recordCanvas:T,inlineImages:q,userTriggeredOnInput:z,collectFonts:Y,doc:B,maskInputFn:m,maskTextFn:d,keepIframeSrcFn:R,blockSelector:n,slimDOMOptions:oe,dataURLOptions:y,mirror:re,iframeManager:we,stylesheetManager:ye,shadowDomManager:ct,processedNodeManager:gr,canvasManager:Tr,ignoreCSSAttributes:$e,plugins:((K=ne==null?void 0:ne.filter(D=>D.observer))==null?void 0:K.map(D=>({observer:D.observer,options:D.options,callback:yr=>W({type:x.Plugin,data:{plugin:D.name,payload:yr}})})))||[]},f)};we.addLoadListener(B=>{try{A.push(te(B.contentDocument))}catch(K){console.warn(K)}});let U=()=>{Ut(),A.push(te(document)),rr=!0};return["interactive","complete"].includes(document.readyState)?U():(A.push(Z("DOMContentLoaded",()=>{W({type:x.DomContentLoaded,data:{}}),L==="DOMContentLoaded"&&U()})),A.push(Z("load",()=>{W({type:x.Load,data:{}}),L==="load"&&U()},window))),()=>{A.forEach(B=>{try{B()}catch(K){String(K).toLowerCase().includes("cross-origin")||console.warn(K)}}),gr.destroy(),rr=!1,sf()}}catch(A){console.warn(A)}}ue.addCustomEvent=(s,e)=>{if(!rr)throw new Error("please add custom event after start recording");W({type:x.Custom,data:{tag:s,payload:e}})};ue.freezePage=()=>{be.forEach(s=>s.freeze())};ue.takeFullSnapshot=s=>{if(!rr)throw new Error("please take full snapshot after start recording");Ut(s)};ue.mirror=re;var Qi;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Qi||(Qi={}));var Sd=5*1e3;var{addCustomEvent:vd}=ue,{freezePage:Cd}=ue,{takeFullSnapshot:Ed}=ue;var Jo=()=>typeof CompressionStream=="function"&&typeof Response=="function"&&typeof TextEncoder=="function",Ko=async s=>{let e=new Response(s).body.pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(e).arrayBuffer())};var pr=null,Rf=s=>{if(!pr){pr=new Uint32Array(256);for(let t=0;t<256;t+=1){let r=t;for(let i=0;i<8;i+=1)r=r&1?3988292384^r>>>1:r>>>1;pr[t]=r>>>0}}let e=4294967295;for(let t=0;t<s.length;t+=1)e=pr[(e^s[t])&255]^e>>>8;return(e^4294967295)>>>0},Xo=(s,e,t)=>{s[e]=t&255,s[e+1]=t>>>8&255,s[e+2]=t>>>16&255,s[e+3]=t>>>24&255},js=s=>{let e=new TextEncoder().encode(s),t=Math.max(1,Math.ceil(e.length/65535)),r=new Uint8Array(10+t*5+e.length+8);r.set([31,139,8,0,0,0,0,0,0,255]);let i=10;for(let n=0;n<t;n+=1){let o=e.subarray(n*65535,(n+1)*65535);r[i]=n===t-1?1:0,r[i+1]=o.length&255,r[i+2]=o.length>>>8,r[i+3]=~o.length&255,r[i+4]=~o.length>>>8&255,r.set(o,i+5),i+=5+o.length}return Xo(r,i,Rf(e)),Xo(r,i+4,e.length),r};var qo="data-abyss-privacy";var Af=`img,picture,video,canvas,image,input[type="hidden"],[${qo}="hidden"]`,Nf="input,textarea,select,[contenteditable]",Mf=s=>s.replace(/\S/g,"*"),Of=(s,e,t)=>{if(!s||s.closest(Nf))return!1;for(let r=s;r;r=r.parentElement){let i=r.getAttribute(qo);if(i==="mask"||i==="hidden")return!1;if(i==="allow"||e!==""&&r.matches(e))return!0}return t},Df=(s,e)=>{let t=document.createDocumentFragment();return Array.from(new Set(s)).filter(r=>{try{return t.querySelector(String(r)),!0}catch{return e(),!1}}).join(",")},Qo=(s,e,t)=>{let r=Df([...e,...s.unmaskSelectors],t),i=s.defaultPrivacy==="MASK_INPUTS_ONLY";return{maskAllInputs:!0,maskInputFn:n=>"*".repeat(n.length),maskTextSelector:"*",maskTextFn:(n,o)=>Of(o,r,i)?n:Mf(n),blockSelector:Af}};var ta="abyss-rum-replay",ea=s=>typeof s=="number"&&Number.isInteger(s)&&s>=0,Ys=s=>{var t;let e=null;try{e=JSON.parse((t=sessionStorage.getItem(ta))!=null?t:"null")}catch{e=null}return(e==null?void 0:e.sessionId)===s&&ea(e.seq)&&ea(e.sentBytes)?{sessionId:s,seq:e.seq,sentBytes:e.sentBytes,startedAt:typeof e.startedAt=="number"?e.startedAt:null,stopped:e.stopped===!0}:{sessionId:s,seq:0,sentBytes:0,startedAt:null,stopped:!1}},lt=s=>{try{sessionStorage.setItem(ta,JSON.stringify(s))}catch{}};var ra=64*1024;var Hs=(s,e,t)=>{let r=o=>o.replace(/\/+$/,""),i=s.proxyUrl?r(s.proxyUrl):`${r(s.apiUrl)}/api`,n=ti(encodeURIComponent(s.applicationId),encodeURIComponent(e));return`${i}${n}?token=${encodeURIComponent(s.token)}&${"seq"}=${t}`},_f=s=>s===413||s===507||s===410?"SESSION_STOPPED":s===404?"NOT_FOUND":s===429?"RATE_LIMITED":s>=400&&s<500?"REFUSED":s>=200&&s<300?"STORED":"LOST",Zs=async(s,e,t,r)=>{let i;try{i=await s(e,{method:"POST",body:t,keepalive:r,credentials:"omit",headers:{"Content-Type":wr}})}catch{return{outcome:"LOST",liveWatched:!1}}let n=_f(i.status),o=!1;if(n==="STORED")try{o=(await i.json()).liveWatched===!0}catch{}return{outcome:n,liveWatched:o}},sa=(s,e)=>{try{return typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(s,new Blob([e],{type:wr}))}catch{return!1}};var Pf=2e3,Lf=10*1e3,$f=2*1e3,ia=3600*1e3,Ff=60*1e3,Uf=30*1e3,Bf=32*1024,na=s=>`{"events":[${s.join(",")}]}`,Xs=s=>{var t,r,i,n;let e=!1;try{e=((r=(t=s.options).consent)==null?void 0:r.call(t).analytics)===!0}catch{s.drop()}return{record:s.ready&&((i=s.session.decision)==null?void 0:i.replay)===!0&&((n=s.config)==null?void 0:n.replay.enabled)===!0&&e,liveWatched:s.liveWatched,sessionId:s.session.id}},Js=class{constructor(e,t,r){this.host=e;this.maxSessionBytes=t;this.privacy=r;this.events=[];this.eventsBytes=0;this.recording=!1;this.stopRecord=null;this.lastSentAt=Date.now();this.watched=!1;this.batchWatched=!1;this.pausedUntil=0;this.refused=!1;this.routeHref=null;this.routeExcluded=!1;this.compressing=[];this.outbox=[];this.sending=!1;this.sessionId=e.session.id,this.stored=Ys(this.sessionId)}start(){let e=setInterval(()=>this.guard(()=>this.tick()),Pf),t=()=>this.guard(()=>this.pageHide()),r=()=>this.guard(()=>{document.visibilityState==="hidden"&&this.flush()});return window.addEventListener("pagehide",t),document.addEventListener("visibilitychange",r),this.guard(()=>this.tick()),()=>{clearInterval(e),window.removeEventListener("pagehide",t),document.removeEventListener("visibilitychange",r),this.discard()}}guard(e){try{e()}catch{this.host.drop()}}tick(){let e=Xs(this.host);if(!e.record){this.discard();return}if(e.sessionId!==this.sessionId&&(this.flush(),this.halt(),this.sessionId=e.sessionId,this.stored=Ys(e.sessionId),this.watched=!1),e.liveWatched!==this.batchWatched&&(this.batchWatched=e.liveWatched,this.watched=e.liveWatched),this.drain(),this.stored.stopped||this.refused)return;let t=Date.now();if(this.stored.startedAt!==null&&t-this.stored.startedAt>=ia){this.flush(),this.stopSession();return}if(this.isRouteExcluded()){this.flush(),this.halt();return}this.recording||this.begin();let r=this.watched?$f:Lf;(t-this.lastSentAt>=r||this.eventsBytes>=Bf)&&this.flush()}begin(){this.lastSentAt=Date.now(),this.recording=!0;let e=ue({emit:t=>this.guard(()=>this.onEvent(t)),...this.privacy,recordCanvas:!1,recordCrossOriginIframes:!1,collectFonts:!1,inlineImages:!1,slimDOMOptions:"all",sampling:{scroll:150,input:"last"},errorHandler:()=>(this.host.drop(),!0)});e?this.stopRecord=e:(this.recording=!1,this.refused=!0,this.host.drop())}onEvent(e){let t=Xs(this.host);if(!t.record){this.discard();return}if(!this.recording||t.sessionId!==this.sessionId||this.isRouteExcluded())return;let r=Date.now();if(this.stored.startedAt===null&&(this.stored.startedAt=r,lt(this.stored)),r-this.stored.startedAt>=ia){this.flush(),this.stopSession();return}let i=JSON.stringify(e);this.events.push(i),this.eventsBytes+=i.length}pageHide(){Xs(this.host).record?this.unload():this.discard()}takeEvents(){let e=this.events;return this.events=[],this.eventsBytes=0,e}nextSeq(e){let t=e.seq;return e.seq+=1,lt(e),t}flush(){if(this.events.length===0||Date.now()<this.pausedUntil)return;let e=na(this.takeEvents());this.lastSentAt=Date.now();let t=this.stored,r={stored:t,seq:this.nextSeq(t),json:e,body:null};this.compressing.push(r);let i=n=>this.guard(()=>{let o=this.compressing.indexOf(r);o!==-1&&(n?r.body=n:(this.compressing.splice(o,1),this.host.drop()),this.release())});Ko(e).then(i,()=>i(null))}release(){let e=this.compressing[0];for(;e&&e.body;){this.compressing.shift();let{stored:t,seq:r,body:i}=e;this.withinCaps(t,this.outbox,i)&&(this.outbox.push({stored:t,seq:r,body:i,notFoundSince:null}),this.drain()),e=this.compressing[0]}}withinCaps(e,t,r){let i=t.reduce((n,o)=>o.stored===e?n+o.body.length:n,0);return r.length>20971520||e.sentBytes+i+r.length>this.maxSessionBytes?(this.settle(e,"SESSION_STOPPED"),!1):!0}drain(){let e=this.outbox[0];if(!e||this.sending||Date.now()<this.pausedUntil)return;this.sending=!0;let t=Hs(this.host.options,e.stored.sessionId,e.seq);Zs(this.host.nativeFetch,t,e.body,!1).then(r=>{this.sending=!1,this.guard(()=>this.onAnswer(e,r))},()=>{this.sending=!1,this.host.drop()})}unload(){let e=[...this.outbox,...this.compressing.map(({stored:l,seq:a,json:u,body:c})=>({stored:l,seq:a,body:c||js(u),notFoundSince:null}))];this.outbox=[],this.compressing=[];let t=this.takeEvents(),r=ra,i=new Set,n=[];for(let l of e)i.has(l.stored)||l.body.length>r?(i.add(l.stored),this.host.drop()):(r-=l.body.length,n.push(l));let o=this.stored;if(t.length>0&&Date.now()>=this.pausedUntil){let l=js(na(t));i.has(o)||l.length>r?this.host.drop():this.withinCaps(o,n,l)&&n.push({stored:o,seq:this.nextSeq(o),body:l,notFoundSince:null})}for(let l of n){let a=Hs(this.host.options,l.stored.sessionId,l.seq);sa(a,l.body)?(l.stored.sentBytes+=l.body.length,this.save(l.stored)):Zs(this.host.nativeFetch,a,l.body,!0).then(u=>this.guard(()=>this.onAnswer(l,u)),this.host.drop)}}onAnswer(e,t){var o;let r=this.outbox[0]===e,{outcome:i}=t;if(i==="NOT_FOUND"){let l=Date.now();if(e.notFoundSince=(o=e.notFoundSince)!=null?o:l,r&&l-e.notFoundSince<Uf)return;i="REFUSED"}r&&this.outbox.shift();let{stored:n}=e;if(i==="STORED")n.sentBytes+=e.body.length,this.save(n),n===this.stored&&(this.watched=t.liveWatched);else{if(i==="REFUSED"||i==="SESSION_STOPPED"){let l=this.outbox.filter(u=>u.stored!==n),a=this.outbox.length-l.length;for(let u=0;u<a&&i==="REFUSED";u+=1)this.host.drop();this.outbox=l}this.settle(n,i)}this.drain()}settle(e,t){t==="SESSION_STOPPED"?(e.stopped=!0,this.save(e)):this.host.drop(),e===this.stored&&(t==="SESSION_STOPPED"?this.stopSession():t==="REFUSED"?(this.refused=!0,this.halt(),this.takeEvents(),this.compressing=[]):(t==="RATE_LIMITED"&&(this.pausedUntil=Date.now()+Ff),this.recording&&ue.takeFullSnapshot(!0)))}save(e){e===this.stored&&lt(e)}stopSession(){this.stored.stopped=!0,lt(this.stored),this.halt(),this.takeEvents()}halt(){let e=this.stopRecord;this.recording=!1,this.stopRecord=null,e==null||e()}discard(){this.halt(),this.takeEvents(),this.outbox=[],this.compressing=[]}isRouteExcluded(){var t;let e=window.location.href;if(e!==this.routeHref){this.routeHref=e;let r=(t=this.host.options.replayExcludedRoutes)!=null?t:[],i=r.length>0?this.route():"";this.routeExcluded=r.some(n=>n instanceof RegExp?i.search(n)!==-1:i===n)}return this.routeExcluded}route(){let{routeResolver:e}=this.host.options;if(e)try{return String(e(window.location))}catch{this.host.drop()}return window.location.pathname}},$d=s=>{var e,t;try{let r=(e=s.config)==null?void 0:e.replay,i=r==null?void 0:r.maxSessionBytes;if(s.stopped||!r||typeof i!="number"||!(i>0)||!Jo())return;let n=Qo(r,(t=s.options.unmaskSelectors)!=null?t:[],s.drop);s.teardowns.push(new Js(s,i,n).start())}catch{s.drop()}};export{Lf as REPLAY_CHUNK_INTERVAL_MS,Bf as REPLAY_EAGER_FLUSH_BYTES,$f as REPLAY_LIVE_CHUNK_INTERVAL_MS,ia as REPLAY_MAX_DURATION_MS,Uf as REPLAY_NOT_FOUND_RETRY_MS,Ff as REPLAY_RATE_LIMIT_PAUSE_MS,Pf as REPLAY_TICK_MS,$d as recordReplay,Xs as replayState};
54
54
  /*! Bundled license information:
55
55
 
56
56
  rrweb/dist/rrweb.js:
@@ -50,7 +50,7 @@ https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.p
50
50
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
51
51
  https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new Vs().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return M([i(a)]).process(o,l)},i};M.stringify=Nh;M.parse=_h;M.fromJSON=Mh;M.list=kh;M.comment=s=>new xo(s);M.atRule=s=>new Ro(s);M.decl=s=>new Eo(s);M.rule=s=>new Ao(s);M.root=s=>new No(s);M.document=s=>new Io(s);M.CssSyntaxError=xh;M.Declaration=Eo;M.Container=Ah;M.Processor=Vs;M.Document=Io;M.Comment=xo;M.Warning=Oh;M.AtRule=Ro;M.Result=Dh;M.Input=Th;M.Rule=Ao;M.Root=No;M.Node=Ph;Rh.registerPostcss(M);var Lh=M;M.default=M;var F=Zu(Lh);F.stringify;F.fromJSON;F.plugin;F.parse;F.list;F.document;F.comment;F.atRule;F.rule;F.decl;F.root;F.CssSyntaxError;F.Declaration;F.Container;F.Processor;F.Document;F.Comment;F.Warning;F.AtRule;F.Result;F.Input;F.Rule;F.Root;F.Node;var cs=class s{constructor(...e){ee(this,"parentElement",null),ee(this,"parentNode",null),ee(this,"ownerDocument"),ee(this,"firstChild",null),ee(this,"lastChild",null),ee(this,"previousSibling",null),ee(this,"nextSibling",null),ee(this,"ELEMENT_NODE",1),ee(this,"TEXT_NODE",3),ee(this,"nodeType"),ee(this,"nodeName"),ee(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof s){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var Wi={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},zi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Dt={},$h=()=>!!globalThis.Zone;function Gs(s){if(Dt[s])return Dt[s];let e=globalThis[s],t=e.prototype,r=s in Wi?Wi[s]:void 0,i=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),n=s in zi?zi[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!$h())return Dt[s]=e.prototype,e.prototype;try{let l=document.createElement("iframe");document.body.appendChild(l);let a=l.contentWindow;if(!a)return e.prototype;let u=a[s].prototype;return document.body.removeChild(l),u?Dt[s]=u:t}catch (e12){return t}}var Mr={};function pe(s,e,t){var r;let i=`${s}.${String(t)}`;if(Mr[i])return Mr[i].call(e);let n=Gs(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(Mr[i]=o,o.call(e)):e[t]}var Or={};function Mo(s,e,t){let r=`${s}.${String(t)}`;if(Or[r])return Or[r].bind(e);let n=Gs(s)[t];return typeof n!="function"?e[t]:(Or[r]=n,n.bind(e))}function Fh(s){return pe("Node",s,"ownerDocument")}function Uh(s){return pe("Node",s,"childNodes")}function Bh(s){return pe("Node",s,"parentNode")}function Wh(s){return pe("Node",s,"parentElement")}function zh(s){return pe("Node",s,"textContent")}function Vh(s,e){return Mo("Node",s,"contains")(e)}function Gh(s){return Mo("Node",s,"getRootNode")()}function jh(s){return!s||!("host"in s)?null:pe("ShadowRoot",s,"host")}function Yh(s){return s.styleSheets}function Hh(s){return!s||!("shadowRoot"in s)?null:pe("Element",s,"shadowRoot")}function Zh(s,e){return pe("Element",s,"querySelector")(e)}function Xh(s,e){return pe("Element",s,"querySelectorAll")(e)}function Oo(){return Gs("MutationObserver").constructor}function Ee(s,e,t){try{if(!(e in s))return()=>{};let r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch (e13){return()=>{}}}var C={ownerDocument:Fh,childNodes:Uh,parentNode:Bh,parentElement:Wh,textContent:zh,contains:Vh,getRootNode:Gh,host:jh,styleSheets:Yh,shadowRoot:Hh,querySelector:Zh,querySelectorAll:Xh,mutationObserver:Oo,patch:Ee};function Z(s,e,t=document){let r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}var xe=`Please stop import mirror directly. Instead of that,\r
52
52
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
53
- or you can use record.mirror to access the mirror instance during recording.`,Vi={map:{},getId(){return console.error(xe),-1},getNode(){return console.error(xe),null},removeNodeFromMap(){console.error(xe)},has(){return console.error(xe),!1},reset(){console.error(xe)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Vi=new Proxy(Vi,{get(s,e,t){return e==="map"&&console.error(xe),Reflect.get(s,e,t)}}));function rt(s,e,t={}){let r=null,i=0;return function(...n){let o=Date.now();!i&&t.leading===!1&&(i=o);let l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,n)},l))}}function dr(s,e,t,r,i=window){let n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>dr(s,e,n||{},!0)}var Qt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Qt=()=>new Date().getTime());function Do(s){var e,t,r,i;let n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||(n==null?void 0:n.body)&&((e=C.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n==null?void 0:n.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(n==null?void 0:n.documentElement.scrollTop)||(n==null?void 0:n.body)&&((r=C.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n==null?void 0:n.body)==null?void 0:i.scrollTop)||0}}function To(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _o(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ko(s){return s?s.nodeType===s.ELEMENT_NODE?s:C.parentElement(s):null}function X(s,e,t,r){if(!s)return!1;let i=ko(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(Gt(i,e,r))return!0}catch (e14){}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Jh(s,e){return e.getId(s)!==-1}function Dr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===He}function Po(s,e){if(Ge(s))return!1;let t=e.getId(s);if(!e.has(t))return!0;let r=C.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Po(r,e):!0}function hs(s){return!!s.changedTouches}function Kh(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Lo(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function $o(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function fs(s){return s?s instanceof cs&&"shadowRoot"in s?!!s.shadowRoot:!!C.shadowRoot(s):!1}var ds=class{constructor(){w(this,"id",1),w(this,"styleIDMap",new WeakMap),w(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}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 Fo(s){var e;let t=null;return"getRootNode"in s&&((e=C.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(s))&&(t=C.host(C.getRootNode(s))),t}function qh(s){let e=s,t;for(;t=Fo(e);)e=t;return e}function Qh(s){let e=C.ownerDocument(s);if(!e)return!1;let t=qh(s);return C.contains(e,t)}function Uo(s){let e=C.ownerDocument(s);return e?C.contains(e,s)||Qh(s):!1}var x=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(x||{}),E=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(E||{}),J=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(J||{}),ce=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(ce||{}),Le=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Le||{}),Re=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Re||{});var Bo=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Bo||{});function Gi(s){return"__ln"in s}var ps=class{constructor(){w(this,"length",0),w(this,"head",null),w(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Gi(e.previousSibling)){let r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Gi(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let 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--)}},ji=(s,e)=>`${s}@${e}`,ms=class{constructor(){w(this,"frozen",!1),w(this,"locked",!1),w(this,"texts",[]),w(this,"attributes",[]),w(this,"attributeMap",new WeakMap),w(this,"removes",[]),w(this,"mapRemoves",[]),w(this,"movedMap",{}),w(this,"addedSet",new Set),w(this,"movedSet",new Set),w(this,"droppedSet",new Set),w(this,"removesSubTreeCache",new Set),w(this,"mutationCb"),w(this,"blockClass"),w(this,"blockSelector"),w(this,"maskTextClass"),w(this,"maskTextSelector"),w(this,"inlineStylesheet"),w(this,"maskInputOptions"),w(this,"maskTextFn"),w(this,"maskInputFn"),w(this,"keepIframeSrcFn"),w(this,"recordCanvas"),w(this,"inlineImages"),w(this,"slimDOMOptions"),w(this,"dataURLOptions"),w(this,"doc"),w(this,"mirror"),w(this,"iframeManager"),w(this,"stylesheetManager"),w(this,"shadowDomManager"),w(this,"canvasManager"),w(this,"processedNodeManager"),w(this,"unattachedDoc"),w(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),w(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new ps,i=a=>{let u=a,c=He;for(;c===He;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},n=a=>{let u=C.parentNode(a);if(!u||!Uo(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){let m=u.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let h=Ge(u)?this.mirror.getId(Fo(a)):this.mirror.getId(u),p=i(a);if(h===-1||p===-1)return r.addNode(a);let g=Ne(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{Lo(m,this.mirror)&&this.iframeManager.addIframe(m),$o(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),fs(a)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(a),this.doc)},onIframeLoad:(m,d)=>{this.iframeManager.attachIframe(m,d),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,d)=>{this.stylesheetManager.attachLinkElement(m,d)},cssCaptured:c});g&&(e.push({parentId:h,nextId:p,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let a of this.movedSet)Yi(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(C.parentNode(a))||n(a);for(let a of this.addedSet)!Hi(this.droppedSet,a)&&!Yi(this.removesSubTreeCache,a,this.mirror)||Hi(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){let u=this.mirror.getId(C.parentNode(o.value)),c=i(o.value);u!==-1&&c!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let h=this.mirror.getId(C.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){a=c;break}else{let g=c.value,m=C.parentNode(g);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let d=C.host(m);if(this.mirror.getId(d)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),n(a.value)}let l={texts:this.texts.map(a=>{let u=a.node,c=C.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{let{attributes:u}=a;if(typeof u.style=="string"){let c=JSON.stringify(a.styleDiff),h=JSON.stringify(a._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(l))}),w(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let r=Array.from(C.childNodes(e),i=>C.textContent(i)||"").join("");t.attributes.value=Wt({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:zt(e),value:r,maskInputFn:this.maskInputFn})}),w(this,"processMutation",e=>{if(!Dr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=C.textContent(e.target);!X(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:ln(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,ko(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){let o=zt(t);i=Wt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(X(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!an(t.tagName,r))if(n.attributes[r]=on(this.doc,Se(t.tagName),Se(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch (e15){this.unattachedDoc=this.doc}let o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(let l of Array.from(t.style)){let a=t.style.getPropertyValue(l),u=t.style.getPropertyPriority(l);a!==o.style.getPropertyValue(l)||u!==o.style.getPropertyPriority(l)?u===""?n.styleDiff[l]=a:n.styleDiff[l]=[a,u]:n._unchangedStyles[l]=[a,u]}for(let l of Array.from(o.style))t.style.getPropertyValue(l)===""&&(n.styleDiff[l]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(X(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),i=Ge(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);X(e.target,this.blockClass,this.blockSelector,!1)||Dr(t,this.mirror,this.slimDOMOptions)||!Jh(t,this.mirror)||(this.addedSet.has(t)?(gs(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||Po(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ji(r,i)]?gs(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:Ge(e.target)&&je(e.target)?!0:void 0}),ef(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),w(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Dr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[ji(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);X(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach(r=>this.genAdds(r)),fs(e)&&C.childNodes(C.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function gs(s,e){s.delete(e),C.childNodes(e).forEach(t=>gs(s,t))}function ef(s,e){let t=[s];for(;t.length;){let r=t.pop();e.has(r)||(e.add(r),C.childNodes(r).forEach(i=>t.push(i)))}}function Yi(s,e,t){return s.size===0?!1:tf(s,e)}function tf(s,e,t){let r=C.parentNode(e);return r?s.has(r):!1}function Hi(s,e){return s.size===0?!1:Wo(s,e)}function Wo(s,e){let t=C.parentNode(e);return t?s.has(t)?!0:Wo(s,t):!1}var Ye;function rf(s){Ye=s}function sf(){Ye=void 0}var I=s=>Ye?(...t)=>{try{return s(...t)}catch(r){if(Ye&&Ye(r)===!0)return;throw r}}:s,be=[];function at(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch (e16){}return s&&s.target}function zo(s,e){let t=new ms;be.push(t),t.init(s);let r=new(Oo())(I(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function nf({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,o=[],l,a=rt(I(h=>{let p=Date.now()-l;s(o.map(g=>(g.timeOffset-=p,g)),h),o=[],l=null}),n),u=I(rt(I(h=>{let p=at(h),{clientX:g,clientY:m}=hs(h)?h.changedTouches[0]:h;l||(l=Qt()),o.push({x:g,y:m,id:r.getId(p),timeOffset:Qt()-l}),a(typeof DragEvent!="undefined"&&h instanceof DragEvent?E.Drag:h instanceof MouseEvent?E.MouseMove:E.TouchMove)}),i,{trailing:!1})),c=[Z("mousemove",u,t),Z("touchmove",u,t),Z("drag",u,t)];return I(()=>{c.forEach(h=>h())})}function of({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};let o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[],a=null,u=c=>h=>{let p=at(h);if(X(p,r,i,!0))return;let g=null,m=c;if("pointerType"in h){switch(h.pointerType){case"mouse":g=ce.Mouse;break;case"touch":g=ce.Touch;break;case"pen":g=ce.Pen;break}g===ce.Touch?J[c]===J.MouseDown?m="TouchStart":J[c]===J.MouseUp&&(m="TouchEnd"):ce.Pen}else hs(h)&&(g=ce.Touch);g!==null?(a=g,(m.startsWith("Touch")&&g===ce.Touch||m.startsWith("Mouse")&&g===ce.Mouse)&&(g=null)):J[c]===J.Click&&(g=a,a=null);let d=hs(h)?h.changedTouches[0]:h;if(!d)return;let f=t.getId(p),{clientX:b,clientY:S}=d;I(s)({type:J[m],id:f,x:b,y:S,...g!==null&&{pointerType:g}})};return Object.keys(J).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&o[c]!==!1).forEach(c=>{let h=Se(c),p=u(c);if(window.PointerEvent)switch(J[c]){case J.MouseDown:case J.MouseUp:h=h.replace("mouse","pointer");break;case J.TouchStart:case J.TouchEnd:return}l.push(Z(h,p,e))}),I(()=>{l.forEach(c=>c())})}function Vo({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){let o=I(rt(I(l=>{let a=at(l);if(!a||X(a,r,i,!0))return;let u=t.getId(a);if(a===e&&e.defaultView){let c=Do(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return Z("scroll",o,e)}function af({viewportResizeCb:s},{win:e}){let t=-1,r=-1,i=I(rt(I(()=>{let n=To(),o=_o();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return Z("resize",i,e)}var lf=["INPUT","TEXTAREA","SELECT"],Zi=new WeakMap;function uf({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function h(S){let y=at(S),v=S.isTrusted,O=y&&y.tagName;if(y&&O==="OPTION"&&(y=C.parentElement(y)),!y||!O||lf.indexOf(O)<0||X(y,r,i,!0)||y.classList.contains(n)||o&&y.matches(o))return;let T=y.value,V=!1,L=zt(y)||"";L==="radio"||L==="checkbox"?V=y.checked:(l[O.toLowerCase()]||l[L])&&(T=Wt({element:y,maskInputOptions:l,tagName:O,type:L,value:T,maskInputFn:a})),p(y,c?{text:T,isChecked:V,userTriggered:v}:{text:T,isChecked:V});let z=y.name;L==="radio"&&z&&V&&e.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(Y=>{if(Y!==y){let q=Y.value;p(Y,c?{text:q,isChecked:!V,userTriggered:!1}:{text:q,isChecked:!V})}})}function p(S,y){let v=Zi.get(S);if(!v||v.text!==y.text||v.isChecked!==y.isChecked){Zi.set(S,y);let O=t.getId(S);I(s)({...y,id:O})}}let m=(u.input==="last"?["change"]:["input","change"]).map(S=>Z(S,I(h),e)),d=e.defaultView;if(!d)return()=>{m.forEach(S=>S())};let f=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),b=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&m.push(...b.map(S=>dr(S[0],S[1],{set(){I(h)({target:this,isTrusted:!1})}},!1,d))),I(()=>{m.forEach(S=>S())})}function er(s){let e=[];function t(r,i){if(Tt("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Tt("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Tt("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Tt("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){let o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function me(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function cf({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:I((c,h,p)=>{let[g,m]=p,{id:d,styleId:f}=me(h,e,t.styleMirror);return(d&&d!==-1||f&&f!==-1)&&s({id:d,styleId:f,adds:[{rule:g,index:m}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,p=this.cssRules.length){let g=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,p])};let n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:I((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,removes:[{index:g}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:I((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replace:g}),c.apply(h,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:I((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replaceSync:g}),c.apply(h,p)})}));let a={};_t("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(_t("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),_t("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),_t("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(a).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:I((p,g,m)=>{let[d,f]=m,{id:b,styleId:S}=me(g.parentStyleSheet,e,t.styleMirror);return(b&&b!==-1||S&&S!==-1)&&s({id:b,styleId:S,adds:[{rule:d,index:[...er(g),f||0]}]}),p.apply(g,m)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:I((p,g,m)=>{let[d]=m,{id:f,styleId:b}=me(g.parentStyleSheet,e,t.styleMirror);return(f&&f!==-1||b&&b!==-1)&&s({id:f,styleId:b,removes:[{index:[...er(g),d]}]}),p.apply(g,m)})})}),I(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function Go({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(C.host(t));let l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;let h=(c=a.set)==null?void 0:c.call(this,u);if(o!==null&&o!==-1)try{e.adoptStyleSheets(u,o)}catch (e17){}return h}}),I(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function hf({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){let n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:I((l,a,u)=>{var c;let[h,p,g]=u;if(t.has(h))return n.apply(a,[h,p,g]);let{id:m,styleId:d}=me((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,set:{property:h,value:p,priority:g},index:er(a.parentRule)}),l.apply(a,u)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:I((l,a,u)=>{var c;let[h]=u;if(t.has(h))return o.apply(a,[h]);let{id:p,styleId:g}=me((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,remove:{property:h},index:er(a.parentRule)}),l.apply(a,u)})}),I(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function ff({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){let o=I(a=>rt(I(u=>{let c=at(u);if(!c||X(c,e,t,!0))return;let{currentTime:h,volume:p,muted:g,playbackRate:m,loop:d}=c;s({type:a,id:r.getId(c),currentTime:h,volume:p,muted:g,playbackRate:m,loop:d})}),i.media||500)),l=[Z("play",o(Re.Play),n),Z("pause",o(Re.Pause),n),Z("seeked",o(Re.Seeked),n),Z("volumechange",o(Re.VolumeChange),n),Z("ratechange",o(Re.RateChange),n)];return I(()=>{l.forEach(a=>a())})}function df({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,u,c){let h=new n(a,u,c);return i.set(h,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};let o=Ee(e.fonts,"add",function(l){return function(a){return setTimeout(I(()=>{let u=i.get(a);u&&(s(u),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n}),r.push(o),I(()=>{r.forEach(l=>l())})}function pf(s){let{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s,o=!0,l=I(()=>{let a=e.getSelection();if(!a||o&&(a!=null&&a.isCollapsed))return;o=a.isCollapsed||!1;let u=[],c=a.rangeCount||0;for(let h=0;h<c;h++){let p=a.getRangeAt(h),{startContainer:g,startOffset:m,endContainer:d,endOffset:f}=p;X(g,r,i,!0)||X(d,r,i,!0)||u.push({start:t.getId(g),startOffset:m,end:t.getId(d),endOffset:f})}n({ranges:u})});return l(),Z("selectionchange",l)}function mf({doc:s,customElementCb:e}){let t=s.defaultView;return!t||!t.customElements?()=>{}:Ee(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch (e18){console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function gf(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:p,selectionCb:g,customElementCb:m}=s;s.mutationCb=(...d)=>{e.mutation&&e.mutation(...d),t(...d)},s.mousemoveCb=(...d)=>{e.mousemove&&e.mousemove(...d),r(...d)},s.mouseInteractionCb=(...d)=>{e.mouseInteraction&&e.mouseInteraction(...d),i(...d)},s.scrollCb=(...d)=>{e.scroll&&e.scroll(...d),n(...d)},s.viewportResizeCb=(...d)=>{e.viewportResize&&e.viewportResize(...d),o(...d)},s.inputCb=(...d)=>{e.input&&e.input(...d),l(...d)},s.mediaInteractionCb=(...d)=>{e.mediaInteaction&&e.mediaInteaction(...d),a(...d)},s.styleSheetRuleCb=(...d)=>{e.styleSheetRule&&e.styleSheetRule(...d),u(...d)},s.styleDeclarationCb=(...d)=>{e.styleDeclaration&&e.styleDeclaration(...d),c(...d)},s.canvasMutationCb=(...d)=>{e.canvasMutation&&e.canvasMutation(...d),h(...d)},s.fontCb=(...d)=>{e.font&&e.font(...d),p(...d)},s.selectionCb=(...d)=>{e.selection&&e.selection(...d),g(...d)},s.customElementCb=(...d)=>{e.customElement&&e.customElement(...d),m(...d)}}function yf(s,e={}){let t=s.doc.defaultView;if(!t)return()=>{};gf(s,e);let r;s.recordDOM&&(r=zo(s,s.doc));let i=nf(s),n=of(s),o=Vo(s),l=af(s,{win:t}),a=uf(s),u=ff(s),c=()=>{},h=()=>{},p=()=>{},g=()=>{};s.recordDOM&&(c=cf(s,{win:t}),h=Go(s,s.doc),p=hf(s,{win:t}),s.collectFonts&&(g=df(s)));let m=pf(s),d=mf(s),f=[];for(let b of s.plugins)f.push(b.observer(b.callback,t,b.options));return I(()=>{be.forEach(b=>b.reset()),r==null||r.disconnect(),i(),n(),o(),l(),a(),u(),c(),h(),p(),g(),m(),d(),f.forEach(b=>b())})}function Tt(s){return typeof window[s]!="undefined"}function _t(s){return!!(typeof window[s]!="undefined"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var tr=class{constructor(e){w(this,"iframeIdToRemoteIdMap",new WeakMap),w(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){let n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){let r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){let i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let n=i.get(t);return n||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}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}},ys=class{constructor(e){w(this,"iframes",new WeakMap),w(this,"crossOriginIframeMap",new WeakMap),w(this,"crossOriginIframeMirror",new tr(nn)),w(this,"crossOriginIframeStyleMirror"),w(this,"crossOriginIframeRootIdMap",new WeakMap),w(this,"mirror"),w(this,"mutationCb"),w(this,"wrappedEmit"),w(this,"loadListener"),w(this,"stylesheetManager"),w(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new tr(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case x.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:x.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case x.Meta:case x.Load:case x.DomContentLoaded:return!1;case x.Plugin:return t;case x.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case x.IncrementalSnapshot:switch(t.data.source){case E.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.Drag:case E.TouchMove:case E.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.ViewportResize:return!1;case E.MediaInteraction:case E.MouseInteraction:case E.Scroll:case E.CanvasMutation:case E.Input:return this.replaceIds(t.data,e,["id"]),t;case E.StyleSheetRule:case E.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case E.Font:return t;case E.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case E.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(let n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==Bo.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},ws=class{constructor(e){w(this,"shadowDoms",new WeakSet),w(this,"mutationCb"),w(this,"scrollCb"),w(this,"bypassOptions"),w(this,"mirror"),w(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(!je(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=zo({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Vo({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push(Go({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push(Ee(e.prototype,"attachShadow",function(i){return function(n){let o=i.call(this,n),l=C.shadowRoot(this);return l&&Uo(this)&&r.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch (e19){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wf=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(Ve=0;Ve<Me.length;Ve++)wf[Me.charCodeAt(Ve)]=Ve;var Ve,bf=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Me[e[t]>>2],i+=Me[(e[t]&3)<<4|e[t+1]>>4],i+=Me[(e[t+1]&15)<<2|e[t+2]>>6],i+=Me[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var Xi=new Map;function Sf(s,e){let t=Xi.get(s);return t||(t=new Map,Xi.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}var jo=(s,e,t)=>{if(!s||!(Ho(s,e)||typeof s=="object"))return;let r=s.constructor.name,i=Sf(t,r),n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function Ft(s,e,t){if(s instanceof Array)return s.map(r=>Ft(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,i=bf(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[Ft(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[Ft(s.data,e,t),s.width,s.height]};if(Ho(s,e)||typeof s=="object"){let r=s.constructor.name,i=jo(s,e,t);return{rr_type:r,index:i}}}}return s}var Yo=(s,e,t)=>s.map(r=>Ft(r,e,t)),Ho=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function vf(s,e,t,r){let i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;let l=Ee(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...u){return X(this.canvas,t,r,!0)||setTimeout(()=>{let c=Yo(u,e,this);s(this.canvas,{type:Le["2D"],property:o,args:c})},0),a.apply(this,u)}});i.push(l)}catch (e20){let l=dr(e.CanvasRenderingContext2D.prototype,o,{set(a){s(this.canvas,{type:Le["2D"],property:o,args:[a],setter:!0})}});i.push(l)}return()=>{i.forEach(o=>o())}}function Cf(s){return s==="experimental-webgl"?"webgl":s}function Ji(s,e,t,r){let i=[];try{let n=Ee(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!X(this,e,t,!0)){let u=Cf(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){let c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch (e21){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function Ki(s,e,t,r,i,n){let o=[],l=Object.getOwnPropertyNames(s);for(let a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;let u=Ee(s,a,function(c){return function(...h){let p=c.apply(this,h);if(jo(p,n,this),"tagName"in this.canvas&&!X(this.canvas,r,i,!0)){let g=Yo(h,n,this),m={type:e,property:a,args:g};t(this.canvas,m)}return p}});o.push(u)}catch (e22){let u=dr(s,a,{set(c){t(this.canvas,{type:e,property:a,args:[c],setter:!0})}});o.push(u)}return o}function Ef(s,e,t,r){let i=[];return i.push(...Ki(e.WebGLRenderingContext.prototype,Le.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...Ki(e.WebGL2RenderingContext.prototype,Le.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}var Zo="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",If=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),qi=typeof window!="undefined"&&window.Blob&&new Blob([If(Zo)],{type:"text/javascript;charset=utf-8"});function xf(s){let e;try{if(e=qi&&(window.URL||window.webkitURL).createObjectURL(qi),!e)throw"";let t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch (e23){return new Worker("data:text/javascript;base64,"+Zo,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var bs=class{constructor(e){w(this,"pendingCanvasMutations",new Map),w(this,"rafStamps",{latestId:0,invokeId:null}),w(this,"mirror"),w(this,"mutationCb"),w(this,"resetObservers"),w(this,"frozen",!1),w(this,"locked",!1),w(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});let{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,n){let o=Ji(t,r,i,!0),l=new Map,a=new xf;a.onmessage=m=>{let{id:d}=m.data;if(l.set(d,!1),!("base64"in m.data))return;let{base64:f,type:b,width:S,height:y}=m.data;this.mutationCb({id:d,type:Le["2D"],commands:[{property:"clearRect",args:[0,0,S,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:f}],type:b}]},0,0]}]})};let u=1e3/e,c=0,h,p=()=>{let m=[];return t.document.querySelectorAll("canvas").forEach(d=>{X(d,r,i,!0)||m.push(d)}),m},g=m=>{if(c&&m-c<u){h=requestAnimationFrame(g);return}c=m,p().forEach(async d=>{var f;let b=this.mirror.getId(d);if(l.get(b)||d.width===0||d.height===0)return;if(l.set(b,!0),["webgl","webgl2"].includes(d.__context)){let y=d.getContext(d.__context);((f=y==null?void 0:y.getContextAttributes())==null?void 0:f.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}let S=await createImageBitmap(d);a.postMessage({id:b,bitmap:S,width:d.width,height:d.height,dataURLOptions:n.dataURLOptions},[S])}),h=requestAnimationFrame(g)};h=requestAnimationFrame(g),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Ji(e,t,r,!1),n=vf(this.processMutation.bind(this),e,t,r),o=Ef(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let i=r.map(o=>{let{type:l,...a}=o;return a}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}},Ss=class{constructor(e){w(this,"trackedLinkElements",new WeakSet),w(this,"mutationCb"),w(this,"adoptedStyleSheetCb"),w(this,"styleMirror",new ds),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(e.length===0)return;let r={id:t,styleIds:[]},i=[];for(let n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:rn(l,n.href),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},vs=class{constructor(){w(this,"nodeMap",new WeakMap),w(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},W,Ut,Tr,rr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((ri=s.contentWindow)==null?void 0:ri.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}var re=Da();function ue(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:d,hooks:f,packFn:b,sampling:S={},dataURLOptions:y={},mousemoveWait:v,recordDOM:O=!0,recordCanvas:T=!1,recordCrossOriginIframes:V=!1,recordAfter:L=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:z=!1,collectFonts:Y=!1,inlineImages:q=!1,plugins:ne,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:$e=new Set([]),errorHandler:Fe}=s;rf(Fe);let G=V?window.parent===window:!0,Q=!1;if(!G)try{window.parent.document&&(Q=!1)}catch (e24){Q=!0}if(G&&!e)throw new Error("emit function is required");if(!G&&!Q)return()=>{};v!==void 0&&S.mousemove===void 0&&(S.mousemove=v),re.reset();let ge=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},oe=un(g);Kh();let Ks,mr=0,qs=A=>{for(let te of ne||[])te.eventProcessor&&(A=te.eventProcessor(A));return b&&!Q&&(A=b(A)),A};W=(A,te)=>{var U;let B=A;if(B.timestamp=Qt(),(U=be[0])!=null&&U.isFrozen()&&B.type!==x.FullSnapshot&&!(B.type===x.IncrementalSnapshot&&B.data.source===E.Mutation)&&be.forEach(K=>K.unfreeze()),G)e==null||e(qs(B),te);else if(Q){let K={type:"rrweb",event:qs(B),origin:window.location.origin,isCheckout:te};window.parent.postMessage(K,"*")}if(B.type===x.FullSnapshot)Ks=B,mr=0;else if(B.type===x.IncrementalSnapshot){if(B.data.source===E.Mutation&&B.data.isAttachIframe)return;mr++;let K=r&&mr>=r,D=t&&B.timestamp-Ks.timestamp>t;(K||D)&&Ut(!0)}};let ut=A=>{W({type:x.IncrementalSnapshot,data:{source:E.Mutation,...A}})},Qs=A=>W({type:x.IncrementalSnapshot,data:{source:E.Scroll,...A}}),ei=A=>W({type:x.IncrementalSnapshot,data:{source:E.CanvasMutation,...A}}),oa=A=>W({type:x.IncrementalSnapshot,data:{source:E.AdoptedStyleSheet,...A}}),ye=new Ss({mutationCb:ut,adoptedStyleSheetCb:oa}),we=new ys({mirror:re,mutationCb:ut,stylesheetManager:ye,recordCrossOriginIframes:V,wrappedEmit:W});for(let A of ne||[])A.getMirror&&A.getMirror({nodeMirror:re,crossOriginIframeMirror:we.crossOriginIframeMirror,crossOriginIframeStyleMirror:we.crossOriginIframeStyleMirror});let gr=new vs;Tr=new bs({recordCanvas:T,mutationCb:ei,win:window,blockClass:i,blockSelector:n,mirror:re,sampling:S.canvas,dataURLOptions:y});let ct=new ws({mutationCb:ut,scrollCb:Qs,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:ge,dataURLOptions:y,maskTextFn:d,maskInputFn:m,recordCanvas:T,inlineImages:q,sampling:S,slimDOMOptions:oe,iframeManager:we,stylesheetManager:ye,canvasManager:Tr,keepIframeSrcFn:R,processedNodeManager:gr},mirror:re});Ut=(A=!1)=>{if(!O)return;W({type:x.Meta,data:{href:window.location.href,width:_o(),height:To()}},A),ye.reset(),ct.init(),be.forEach(U=>U.lock());let te=tl(document,{mirror:re,blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:ge,maskTextFn:d,maskInputFn:m,slimDOM:oe,dataURLOptions:y,recordCanvas:T,inlineImages:q,onSerialize:U=>{Lo(U,re)&&we.addIframe(U),$o(U,re)&&ye.trackLinkElement(U),fs(U)&&ct.addShadowRoot(C.shadowRoot(U),document)},onIframeLoad:(U,B)=>{we.attachIframe(U,B),ct.observeAttachShadow(U)},onStylesheetLoad:(U,B)=>{ye.attachLinkElement(U,B)},keepIframeSrcFn:R});if(!te)return console.warn("Failed to snapshot the document");W({type:x.FullSnapshot,data:{node:te,initialOffset:Do(window)}},A),be.forEach(U=>U.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ye.adoptStyleSheets(document.adoptedStyleSheets,re.getId(document))};try{let A=[],te=B=>{var K;return I(yf)({mutationCb:ut,mousemoveCb:(D,yr)=>W({type:x.IncrementalSnapshot,data:{source:yr,positions:D}}),mouseInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.MouseInteraction,...D}}),scrollCb:Qs,viewportResizeCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.ViewportResize,...D}}),inputCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.Input,...D}}),mediaInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.MediaInteraction,...D}}),styleSheetRuleCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.StyleSheetRule,...D}}),styleDeclarationCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.StyleDeclaration,...D}}),canvasMutationCb:ei,fontCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.Font,...D}}),selectionCb:D=>{W({type:x.IncrementalSnapshot,data:{source:E.Selection,...D}})},customElementCb:D=>{W({type:x.IncrementalSnapshot,data:{source:E.CustomElement,...D}})},blockClass:i,ignoreClass:o,ignoreSelector:l,maskTextClass:a,maskTextSelector:u,maskInputOptions:ge,inlineStylesheet:c,sampling:S,recordDOM:O,recordCanvas:T,inlineImages:q,userTriggeredOnInput:z,collectFonts:Y,doc:B,maskInputFn:m,maskTextFn:d,keepIframeSrcFn:R,blockSelector:n,slimDOMOptions:oe,dataURLOptions:y,mirror:re,iframeManager:we,stylesheetManager:ye,shadowDomManager:ct,processedNodeManager:gr,canvasManager:Tr,ignoreCSSAttributes:$e,plugins:((K=ne==null?void 0:ne.filter(D=>D.observer))==null?void 0:K.map(D=>({observer:D.observer,options:D.options,callback:yr=>W({type:x.Plugin,data:{plugin:D.name,payload:yr}})})))||[]},f)};we.addLoadListener(B=>{try{A.push(te(B.contentDocument))}catch(K){console.warn(K)}});let U=()=>{Ut(),A.push(te(document)),rr=!0};return["interactive","complete"].includes(document.readyState)?U():(A.push(Z("DOMContentLoaded",()=>{W({type:x.DomContentLoaded,data:{}}),L==="DOMContentLoaded"&&U()})),A.push(Z("load",()=>{W({type:x.Load,data:{}}),L==="load"&&U()},window))),()=>{A.forEach(B=>{try{B()}catch(K){String(K).toLowerCase().includes("cross-origin")||console.warn(K)}}),gr.destroy(),rr=!1,sf()}}catch(A){console.warn(A)}}ue.addCustomEvent=(s,e)=>{if(!rr)throw new Error("please add custom event after start recording");W({type:x.Custom,data:{tag:s,payload:e}})};ue.freezePage=()=>{be.forEach(s=>s.freeze())};ue.takeFullSnapshot=s=>{if(!rr)throw new Error("please take full snapshot after start recording");Ut(s)};ue.mirror=re;var Qi;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Qi||(Qi={}));var Sd=5*1e3;var{addCustomEvent:vd}=ue,{freezePage:Cd}=ue,{takeFullSnapshot:Ed}=ue;var Jo=()=>typeof CompressionStream=="function"&&typeof Response=="function"&&typeof TextEncoder=="function",Ko=async s=>{let e=new Response(s).body.pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(e).arrayBuffer())};var pr=null,Rf=s=>{if(!pr){pr=new Uint32Array(256);for(let t=0;t<256;t+=1){let r=t;for(let i=0;i<8;i+=1)r=r&1?3988292384^r>>>1:r>>>1;pr[t]=r>>>0}}let e=4294967295;for(let t=0;t<s.length;t+=1)e=pr[(e^s[t])&255]^e>>>8;return(e^4294967295)>>>0},Xo=(s,e,t)=>{s[e]=t&255,s[e+1]=t>>>8&255,s[e+2]=t>>>16&255,s[e+3]=t>>>24&255},js=s=>{let e=new TextEncoder().encode(s),t=Math.max(1,Math.ceil(e.length/65535)),r=new Uint8Array(10+t*5+e.length+8);r.set([31,139,8,0,0,0,0,0,0,255]);let i=10;for(let n=0;n<t;n+=1){let o=e.subarray(n*65535,(n+1)*65535);r[i]=n===t-1?1:0,r[i+1]=o.length&255,r[i+2]=o.length>>>8,r[i+3]=~o.length&255,r[i+4]=~o.length>>>8&255,r.set(o,i+5),i+=5+o.length}return Xo(r,i,Rf(e)),Xo(r,i+4,e.length),r};var qo="data-abyss-privacy";var Af=`img,picture,video,canvas,image,input[type="hidden"],[${qo}="hidden"]`,Nf="input,textarea,select,[contenteditable]",Mf=s=>s.replace(/\S/g,"*"),Of=(s,e,t)=>{if(!s||s.closest(Nf))return!1;for(let r=s;r;r=r.parentElement){let i=r.getAttribute(qo);if(i==="mask"||i==="hidden")return!1;if(i==="allow"||e!==""&&r.matches(e))return!0}return t},Df=(s,e)=>{let t=document.createDocumentFragment();return Array.from(new Set(s)).filter(r=>{try{return t.querySelector(String(r)),!0}catch (e25){return e(),!1}}).join(",")},Qo=(s,e,t)=>{let r=Df([...e,...s.unmaskSelectors],t),i=s.defaultPrivacy==="MASK_INPUTS_ONLY";return{maskAllInputs:!0,maskInputFn:n=>"*".repeat(n.length),maskTextSelector:"*",maskTextFn:(n,o)=>Of(o,r,i)?n:Mf(n),blockSelector:Af}};var ta="abyss-rum-replay",ea=s=>typeof s=="number"&&Number.isInteger(s)&&s>=0,Ys=s=>{var t;let e=null;try{e=JSON.parse((t=sessionStorage.getItem(ta))!=null?t:"null")}catch (e26){e=null}return(e==null?void 0:e.sessionId)===s&&ea(e.seq)&&ea(e.sentBytes)?{sessionId:s,seq:e.seq,sentBytes:e.sentBytes,startedAt:typeof e.startedAt=="number"?e.startedAt:null,stopped:e.stopped===!0}:{sessionId:s,seq:0,sentBytes:0,startedAt:null,stopped:!1}},lt=s=>{try{sessionStorage.setItem(ta,JSON.stringify(s))}catch (e27){}};var ra=64*1024;var Hs=(s,e,t)=>{let r=o=>o.replace(/\/+$/,""),i=s.proxyUrl?r(s.proxyUrl):`${r(s.apiUrl)}/api`,n=_chunkKD6VO7IKjs.b.call(void 0, encodeURIComponent(s.applicationId),encodeURIComponent(e));return`${i}${n}?token=${encodeURIComponent(s.token)}&${"seq"}=${t}`},_f=s=>s===413||s===507||s===410?"SESSION_STOPPED":s===404?"NOT_FOUND":s===429?"RATE_LIMITED":s>=400&&s<500?"REFUSED":s>=200&&s<300?"STORED":"LOST",Zs=async(s,e,t,r)=>{let i;try{i=await s(e,{method:"POST",body:t,keepalive:r,credentials:"omit",headers:{"Content-Type":_chunkKD6VO7IKjs.a}})}catch (e28){return{outcome:"LOST",liveWatched:!1}}let n=_f(i.status),o=!1;if(n==="STORED")try{o=(await i.json()).liveWatched===!0}catch (e29){}return{outcome:n,liveWatched:o}},sa=(s,e)=>{try{return typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(s,new Blob([e],{type:_chunkKD6VO7IKjs.a}))}catch (e30){return!1}};var Pf=2e3,Lf= exports.REPLAY_CHUNK_INTERVAL_MS =10*1e3,$f= exports.REPLAY_LIVE_CHUNK_INTERVAL_MS =2*1e3,ia= exports.REPLAY_MAX_DURATION_MS =3600*1e3,Ff= exports.REPLAY_RATE_LIMIT_PAUSE_MS =60*1e3,Uf= exports.REPLAY_NOT_FOUND_RETRY_MS =30*1e3,Bf= exports.REPLAY_EAGER_FLUSH_BYTES =32*1024,na=s=>`{"events":[${s.join(",")}]}`,Xs= exports.replayState =s=>{var t,r,i,n;let e=!1;try{e=((r=(t=s.options).consent)==null?void 0:r.call(t).analytics)===!0}catch (e31){s.drop()}return{record:s.ready&&((i=s.session.decision)==null?void 0:i.replay)===!0&&((n=s.config)==null?void 0:n.replay.enabled)===!0&&e,liveWatched:s.liveWatched,sessionId:s.session.id}},Js=class{constructor(e,t,r){this.host=e;this.maxSessionBytes=t;this.privacy=r;this.events=[];this.eventsBytes=0;this.recording=!1;this.stopRecord=null;this.lastSentAt=Date.now();this.watched=!1;this.batchWatched=!1;this.pausedUntil=0;this.refused=!1;this.routeHref=null;this.routeExcluded=!1;this.compressing=[];this.outbox=[];this.sending=!1;this.sessionId=e.session.id,this.stored=Ys(this.sessionId)}start(){let e=setInterval(()=>this.guard(()=>this.tick()),Pf),t=()=>this.guard(()=>this.pageHide()),r=()=>this.guard(()=>{document.visibilityState==="hidden"&&this.flush()});return window.addEventListener("pagehide",t),document.addEventListener("visibilitychange",r),this.guard(()=>this.tick()),()=>{clearInterval(e),window.removeEventListener("pagehide",t),document.removeEventListener("visibilitychange",r),this.discard()}}guard(e){try{e()}catch (e32){this.host.drop()}}tick(){let e=Xs(this.host);if(!e.record){this.discard();return}if(e.sessionId!==this.sessionId&&(this.flush(),this.halt(),this.sessionId=e.sessionId,this.stored=Ys(e.sessionId),this.watched=!1),e.liveWatched!==this.batchWatched&&(this.batchWatched=e.liveWatched,this.watched=e.liveWatched),this.drain(),this.stored.stopped||this.refused)return;let t=Date.now();if(this.stored.startedAt!==null&&t-this.stored.startedAt>=ia){this.flush(),this.stopSession();return}if(this.isRouteExcluded()){this.flush(),this.halt();return}this.recording||this.begin();let r=this.watched?$f:Lf;t-this.lastSentAt>=r&&this.flush()}begin(){this.lastSentAt=Date.now(),this.recording=!0;let e=ue({emit:t=>this.guard(()=>this.onEvent(t)),...this.privacy,recordCanvas:!1,recordCrossOriginIframes:!1,collectFonts:!1,inlineImages:!1,slimDOMOptions:"all",sampling:{scroll:150,input:"last"},errorHandler:()=>(this.host.drop(),!0)});e?this.stopRecord=e:(this.recording=!1,this.refused=!0,this.host.drop())}onEvent(e){let t=Xs(this.host);if(!t.record){this.discard();return}if(!this.recording||t.sessionId!==this.sessionId||this.isRouteExcluded())return;let r=Date.now();if(this.stored.startedAt===null&&(this.stored.startedAt=r,lt(this.stored)),r-this.stored.startedAt>=ia){this.flush(),this.stopSession();return}let i=JSON.stringify(e);this.events.push(i),this.eventsBytes+=i.length,this.eventsBytes>=Bf&&this.flush()}pageHide(){Xs(this.host).record?this.unload():this.discard()}takeEvents(){let e=this.events;return this.events=[],this.eventsBytes=0,e}nextSeq(e){let t=e.seq;return e.seq+=1,lt(e),t}flush(){if(this.events.length===0||Date.now()<this.pausedUntil)return;let e=na(this.takeEvents());this.lastSentAt=Date.now();let t=this.stored,r={stored:t,seq:this.nextSeq(t),json:e,body:null};this.compressing.push(r);let i=n=>this.guard(()=>{let o=this.compressing.indexOf(r);o!==-1&&(n?r.body=n:(this.compressing.splice(o,1),this.host.drop()),this.release())});Ko(e).then(i,()=>i(null))}release(){let e=this.compressing[0];for(;e&&e.body;){this.compressing.shift();let{stored:t,seq:r,body:i}=e;this.withinCaps(t,this.outbox,i)&&(this.outbox.push({stored:t,seq:r,body:i,notFoundSince:null}),this.drain()),e=this.compressing[0]}}withinCaps(e,t,r){let i=t.reduce((n,o)=>o.stored===e?n+o.body.length:n,0);return r.length>20971520||e.sentBytes+i+r.length>this.maxSessionBytes?(this.settle(e,"SESSION_STOPPED"),!1):!0}drain(){let e=this.outbox[0];if(!e||this.sending||Date.now()<this.pausedUntil)return;this.sending=!0;let t=Hs(this.host.options,e.stored.sessionId,e.seq);Zs(this.host.nativeFetch,t,e.body,!1).then(r=>{this.sending=!1,this.guard(()=>this.onAnswer(e,r))},()=>{this.sending=!1,this.host.drop()})}unload(){let e=[...this.outbox,...this.compressing.map(({stored:l,seq:a,json:u,body:c})=>({stored:l,seq:a,body:c||js(u),notFoundSince:null}))];this.outbox=[],this.compressing=[];let t=this.takeEvents(),r=ra,i=new Set,n=[];for(let l of e)i.has(l.stored)||l.body.length>r?(i.add(l.stored),this.host.drop()):(r-=l.body.length,n.push(l));let o=this.stored;if(t.length>0&&Date.now()>=this.pausedUntil){let l=js(na(t));i.has(o)||l.length>r?this.host.drop():this.withinCaps(o,n,l)&&n.push({stored:o,seq:this.nextSeq(o),body:l,notFoundSince:null})}for(let l of n){let a=Hs(this.host.options,l.stored.sessionId,l.seq);sa(a,l.body)?(l.stored.sentBytes+=l.body.length,this.save(l.stored)):Zs(this.host.nativeFetch,a,l.body,!0).then(u=>this.guard(()=>this.onAnswer(l,u)),this.host.drop)}}onAnswer(e,t){var o;let r=this.outbox[0]===e,{outcome:i}=t;if(i==="NOT_FOUND"){let l=Date.now();if(e.notFoundSince=(o=e.notFoundSince)!=null?o:l,r&&l-e.notFoundSince<Uf)return;i="REFUSED"}r&&this.outbox.shift();let{stored:n}=e;if(i==="STORED")n.sentBytes+=e.body.length,this.save(n),n===this.stored&&(this.watched=t.liveWatched);else{if(i==="REFUSED"||i==="SESSION_STOPPED"){let l=this.outbox.filter(u=>u.stored!==n),a=this.outbox.length-l.length;for(let u=0;u<a&&i==="REFUSED";u+=1)this.host.drop();this.outbox=l}this.settle(n,i)}this.drain()}settle(e,t){t==="SESSION_STOPPED"?(e.stopped=!0,this.save(e)):this.host.drop(),e===this.stored&&(t==="SESSION_STOPPED"?this.stopSession():t==="REFUSED"?(this.refused=!0,this.halt(),this.takeEvents(),this.compressing=[]):(t==="RATE_LIMITED"&&(this.pausedUntil=Date.now()+Ff),this.recording&&ue.takeFullSnapshot(!0)))}save(e){e===this.stored&&lt(e)}stopSession(){this.stored.stopped=!0,lt(this.stored),this.halt(),this.takeEvents()}halt(){let e=this.stopRecord;this.recording=!1,this.stopRecord=null,e==null||e()}discard(){this.halt(),this.takeEvents(),this.outbox=[],this.compressing=[]}isRouteExcluded(){var t;let e=window.location.href;if(e!==this.routeHref){this.routeHref=e;let r=(t=this.host.options.replayExcludedRoutes)!=null?t:[],i=r.length>0?this.route():"";this.routeExcluded=r.some(n=>n instanceof RegExp?i.search(n)!==-1:i===n)}return this.routeExcluded}route(){let{routeResolver:e}=this.host.options;if(e)try{return String(e(window.location))}catch (e33){this.host.drop()}return window.location.pathname}},$d= exports.recordReplay =s=>{var e,t;try{let r=(e=s.config)==null?void 0:e.replay,i=r==null?void 0:r.maxSessionBytes;if(s.stopped||!r||typeof i!="number"||!(i>0)||!Jo())return;let n=Qo(r,(t=s.options.unmaskSelectors)!=null?t:[],s.drop);s.teardowns.push(new Js(s,i,n).start())}catch (e34){s.drop()}};exports.REPLAY_CHUNK_INTERVAL_MS = Lf; exports.REPLAY_EAGER_FLUSH_BYTES = Bf; exports.REPLAY_LIVE_CHUNK_INTERVAL_MS = $f; exports.REPLAY_MAX_DURATION_MS = ia; exports.REPLAY_NOT_FOUND_RETRY_MS = Uf; exports.REPLAY_RATE_LIMIT_PAUSE_MS = Ff; exports.REPLAY_TICK_MS = Pf; exports.recordReplay = $d; exports.replayState = Xs;
53
+ or you can use record.mirror to access the mirror instance during recording.`,Vi={map:{},getId(){return console.error(xe),-1},getNode(){return console.error(xe),null},removeNodeFromMap(){console.error(xe)},has(){return console.error(xe),!1},reset(){console.error(xe)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Vi=new Proxy(Vi,{get(s,e,t){return e==="map"&&console.error(xe),Reflect.get(s,e,t)}}));function rt(s,e,t={}){let r=null,i=0;return function(...n){let o=Date.now();!i&&t.leading===!1&&(i=o);let l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,n)},l))}}function dr(s,e,t,r,i=window){let n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>dr(s,e,n||{},!0)}var Qt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Qt=()=>new Date().getTime());function Do(s){var e,t,r,i;let n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||(n==null?void 0:n.body)&&((e=C.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n==null?void 0:n.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(n==null?void 0:n.documentElement.scrollTop)||(n==null?void 0:n.body)&&((r=C.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n==null?void 0:n.body)==null?void 0:i.scrollTop)||0}}function To(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _o(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ko(s){return s?s.nodeType===s.ELEMENT_NODE?s:C.parentElement(s):null}function X(s,e,t,r){if(!s)return!1;let i=ko(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(Gt(i,e,r))return!0}catch (e14){}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Jh(s,e){return e.getId(s)!==-1}function Dr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===He}function Po(s,e){if(Ge(s))return!1;let t=e.getId(s);if(!e.has(t))return!0;let r=C.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Po(r,e):!0}function hs(s){return!!s.changedTouches}function Kh(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Lo(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function $o(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function fs(s){return s?s instanceof cs&&"shadowRoot"in s?!!s.shadowRoot:!!C.shadowRoot(s):!1}var ds=class{constructor(){w(this,"id",1),w(this,"styleIDMap",new WeakMap),w(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}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 Fo(s){var e;let t=null;return"getRootNode"in s&&((e=C.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(s))&&(t=C.host(C.getRootNode(s))),t}function qh(s){let e=s,t;for(;t=Fo(e);)e=t;return e}function Qh(s){let e=C.ownerDocument(s);if(!e)return!1;let t=qh(s);return C.contains(e,t)}function Uo(s){let e=C.ownerDocument(s);return e?C.contains(e,s)||Qh(s):!1}var x=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(x||{}),E=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(E||{}),J=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(J||{}),ce=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(ce||{}),Le=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Le||{}),Re=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Re||{});var Bo=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Bo||{});function Gi(s){return"__ln"in s}var ps=class{constructor(){w(this,"length",0),w(this,"head",null),w(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Gi(e.previousSibling)){let r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Gi(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let 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--)}},ji=(s,e)=>`${s}@${e}`,ms=class{constructor(){w(this,"frozen",!1),w(this,"locked",!1),w(this,"texts",[]),w(this,"attributes",[]),w(this,"attributeMap",new WeakMap),w(this,"removes",[]),w(this,"mapRemoves",[]),w(this,"movedMap",{}),w(this,"addedSet",new Set),w(this,"movedSet",new Set),w(this,"droppedSet",new Set),w(this,"removesSubTreeCache",new Set),w(this,"mutationCb"),w(this,"blockClass"),w(this,"blockSelector"),w(this,"maskTextClass"),w(this,"maskTextSelector"),w(this,"inlineStylesheet"),w(this,"maskInputOptions"),w(this,"maskTextFn"),w(this,"maskInputFn"),w(this,"keepIframeSrcFn"),w(this,"recordCanvas"),w(this,"inlineImages"),w(this,"slimDOMOptions"),w(this,"dataURLOptions"),w(this,"doc"),w(this,"mirror"),w(this,"iframeManager"),w(this,"stylesheetManager"),w(this,"shadowDomManager"),w(this,"canvasManager"),w(this,"processedNodeManager"),w(this,"unattachedDoc"),w(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),w(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new ps,i=a=>{let u=a,c=He;for(;c===He;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},n=a=>{let u=C.parentNode(a);if(!u||!Uo(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){let m=u.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let h=Ge(u)?this.mirror.getId(Fo(a)):this.mirror.getId(u),p=i(a);if(h===-1||p===-1)return r.addNode(a);let g=Ne(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{Lo(m,this.mirror)&&this.iframeManager.addIframe(m),$o(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),fs(a)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(a),this.doc)},onIframeLoad:(m,d)=>{this.iframeManager.attachIframe(m,d),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,d)=>{this.stylesheetManager.attachLinkElement(m,d)},cssCaptured:c});g&&(e.push({parentId:h,nextId:p,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let a of this.movedSet)Yi(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(C.parentNode(a))||n(a);for(let a of this.addedSet)!Hi(this.droppedSet,a)&&!Yi(this.removesSubTreeCache,a,this.mirror)||Hi(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){let u=this.mirror.getId(C.parentNode(o.value)),c=i(o.value);u!==-1&&c!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let h=this.mirror.getId(C.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){a=c;break}else{let g=c.value,m=C.parentNode(g);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let d=C.host(m);if(this.mirror.getId(d)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),n(a.value)}let l={texts:this.texts.map(a=>{let u=a.node,c=C.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{let{attributes:u}=a;if(typeof u.style=="string"){let c=JSON.stringify(a.styleDiff),h=JSON.stringify(a._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(l))}),w(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let r=Array.from(C.childNodes(e),i=>C.textContent(i)||"").join("");t.attributes.value=Wt({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:zt(e),value:r,maskInputFn:this.maskInputFn})}),w(this,"processMutation",e=>{if(!Dr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=C.textContent(e.target);!X(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:ln(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,ko(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){let o=zt(t);i=Wt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(X(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!an(t.tagName,r))if(n.attributes[r]=on(this.doc,Se(t.tagName),Se(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch (e15){this.unattachedDoc=this.doc}let o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(let l of Array.from(t.style)){let a=t.style.getPropertyValue(l),u=t.style.getPropertyPriority(l);a!==o.style.getPropertyValue(l)||u!==o.style.getPropertyPriority(l)?u===""?n.styleDiff[l]=a:n.styleDiff[l]=[a,u]:n._unchangedStyles[l]=[a,u]}for(let l of Array.from(o.style))t.style.getPropertyValue(l)===""&&(n.styleDiff[l]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(X(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),i=Ge(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);X(e.target,this.blockClass,this.blockSelector,!1)||Dr(t,this.mirror,this.slimDOMOptions)||!Jh(t,this.mirror)||(this.addedSet.has(t)?(gs(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||Po(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ji(r,i)]?gs(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:Ge(e.target)&&je(e.target)?!0:void 0}),ef(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),w(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Dr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[ji(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);X(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach(r=>this.genAdds(r)),fs(e)&&C.childNodes(C.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function gs(s,e){s.delete(e),C.childNodes(e).forEach(t=>gs(s,t))}function ef(s,e){let t=[s];for(;t.length;){let r=t.pop();e.has(r)||(e.add(r),C.childNodes(r).forEach(i=>t.push(i)))}}function Yi(s,e,t){return s.size===0?!1:tf(s,e)}function tf(s,e,t){let r=C.parentNode(e);return r?s.has(r):!1}function Hi(s,e){return s.size===0?!1:Wo(s,e)}function Wo(s,e){let t=C.parentNode(e);return t?s.has(t)?!0:Wo(s,t):!1}var Ye;function rf(s){Ye=s}function sf(){Ye=void 0}var I=s=>Ye?(...t)=>{try{return s(...t)}catch(r){if(Ye&&Ye(r)===!0)return;throw r}}:s,be=[];function at(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch (e16){}return s&&s.target}function zo(s,e){let t=new ms;be.push(t),t.init(s);let r=new(Oo())(I(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function nf({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,o=[],l,a=rt(I(h=>{let p=Date.now()-l;s(o.map(g=>(g.timeOffset-=p,g)),h),o=[],l=null}),n),u=I(rt(I(h=>{let p=at(h),{clientX:g,clientY:m}=hs(h)?h.changedTouches[0]:h;l||(l=Qt()),o.push({x:g,y:m,id:r.getId(p),timeOffset:Qt()-l}),a(typeof DragEvent!="undefined"&&h instanceof DragEvent?E.Drag:h instanceof MouseEvent?E.MouseMove:E.TouchMove)}),i,{trailing:!1})),c=[Z("mousemove",u,t),Z("touchmove",u,t),Z("drag",u,t)];return I(()=>{c.forEach(h=>h())})}function of({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};let o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[],a=null,u=c=>h=>{let p=at(h);if(X(p,r,i,!0))return;let g=null,m=c;if("pointerType"in h){switch(h.pointerType){case"mouse":g=ce.Mouse;break;case"touch":g=ce.Touch;break;case"pen":g=ce.Pen;break}g===ce.Touch?J[c]===J.MouseDown?m="TouchStart":J[c]===J.MouseUp&&(m="TouchEnd"):ce.Pen}else hs(h)&&(g=ce.Touch);g!==null?(a=g,(m.startsWith("Touch")&&g===ce.Touch||m.startsWith("Mouse")&&g===ce.Mouse)&&(g=null)):J[c]===J.Click&&(g=a,a=null);let d=hs(h)?h.changedTouches[0]:h;if(!d)return;let f=t.getId(p),{clientX:b,clientY:S}=d;I(s)({type:J[m],id:f,x:b,y:S,...g!==null&&{pointerType:g}})};return Object.keys(J).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&o[c]!==!1).forEach(c=>{let h=Se(c),p=u(c);if(window.PointerEvent)switch(J[c]){case J.MouseDown:case J.MouseUp:h=h.replace("mouse","pointer");break;case J.TouchStart:case J.TouchEnd:return}l.push(Z(h,p,e))}),I(()=>{l.forEach(c=>c())})}function Vo({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){let o=I(rt(I(l=>{let a=at(l);if(!a||X(a,r,i,!0))return;let u=t.getId(a);if(a===e&&e.defaultView){let c=Do(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return Z("scroll",o,e)}function af({viewportResizeCb:s},{win:e}){let t=-1,r=-1,i=I(rt(I(()=>{let n=To(),o=_o();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return Z("resize",i,e)}var lf=["INPUT","TEXTAREA","SELECT"],Zi=new WeakMap;function uf({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function h(S){let y=at(S),v=S.isTrusted,O=y&&y.tagName;if(y&&O==="OPTION"&&(y=C.parentElement(y)),!y||!O||lf.indexOf(O)<0||X(y,r,i,!0)||y.classList.contains(n)||o&&y.matches(o))return;let T=y.value,V=!1,L=zt(y)||"";L==="radio"||L==="checkbox"?V=y.checked:(l[O.toLowerCase()]||l[L])&&(T=Wt({element:y,maskInputOptions:l,tagName:O,type:L,value:T,maskInputFn:a})),p(y,c?{text:T,isChecked:V,userTriggered:v}:{text:T,isChecked:V});let z=y.name;L==="radio"&&z&&V&&e.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(Y=>{if(Y!==y){let q=Y.value;p(Y,c?{text:q,isChecked:!V,userTriggered:!1}:{text:q,isChecked:!V})}})}function p(S,y){let v=Zi.get(S);if(!v||v.text!==y.text||v.isChecked!==y.isChecked){Zi.set(S,y);let O=t.getId(S);I(s)({...y,id:O})}}let m=(u.input==="last"?["change"]:["input","change"]).map(S=>Z(S,I(h),e)),d=e.defaultView;if(!d)return()=>{m.forEach(S=>S())};let f=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),b=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&m.push(...b.map(S=>dr(S[0],S[1],{set(){I(h)({target:this,isTrusted:!1})}},!1,d))),I(()=>{m.forEach(S=>S())})}function er(s){let e=[];function t(r,i){if(Tt("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Tt("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Tt("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Tt("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){let o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function me(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function cf({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:I((c,h,p)=>{let[g,m]=p,{id:d,styleId:f}=me(h,e,t.styleMirror);return(d&&d!==-1||f&&f!==-1)&&s({id:d,styleId:f,adds:[{rule:g,index:m}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,p=this.cssRules.length){let g=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,p])};let n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:I((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,removes:[{index:g}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:I((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replace:g}),c.apply(h,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:I((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replaceSync:g}),c.apply(h,p)})}));let a={};_t("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(_t("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),_t("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),_t("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(a).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:I((p,g,m)=>{let[d,f]=m,{id:b,styleId:S}=me(g.parentStyleSheet,e,t.styleMirror);return(b&&b!==-1||S&&S!==-1)&&s({id:b,styleId:S,adds:[{rule:d,index:[...er(g),f||0]}]}),p.apply(g,m)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:I((p,g,m)=>{let[d]=m,{id:f,styleId:b}=me(g.parentStyleSheet,e,t.styleMirror);return(f&&f!==-1||b&&b!==-1)&&s({id:f,styleId:b,removes:[{index:[...er(g),d]}]}),p.apply(g,m)})})}),I(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function Go({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(C.host(t));let l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;let h=(c=a.set)==null?void 0:c.call(this,u);if(o!==null&&o!==-1)try{e.adoptStyleSheets(u,o)}catch (e17){}return h}}),I(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function hf({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){let n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:I((l,a,u)=>{var c;let[h,p,g]=u;if(t.has(h))return n.apply(a,[h,p,g]);let{id:m,styleId:d}=me((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,set:{property:h,value:p,priority:g},index:er(a.parentRule)}),l.apply(a,u)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:I((l,a,u)=>{var c;let[h]=u;if(t.has(h))return o.apply(a,[h]);let{id:p,styleId:g}=me((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,remove:{property:h},index:er(a.parentRule)}),l.apply(a,u)})}),I(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function ff({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){let o=I(a=>rt(I(u=>{let c=at(u);if(!c||X(c,e,t,!0))return;let{currentTime:h,volume:p,muted:g,playbackRate:m,loop:d}=c;s({type:a,id:r.getId(c),currentTime:h,volume:p,muted:g,playbackRate:m,loop:d})}),i.media||500)),l=[Z("play",o(Re.Play),n),Z("pause",o(Re.Pause),n),Z("seeked",o(Re.Seeked),n),Z("volumechange",o(Re.VolumeChange),n),Z("ratechange",o(Re.RateChange),n)];return I(()=>{l.forEach(a=>a())})}function df({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,u,c){let h=new n(a,u,c);return i.set(h,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};let o=Ee(e.fonts,"add",function(l){return function(a){return setTimeout(I(()=>{let u=i.get(a);u&&(s(u),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n}),r.push(o),I(()=>{r.forEach(l=>l())})}function pf(s){let{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s,o=!0,l=I(()=>{let a=e.getSelection();if(!a||o&&(a!=null&&a.isCollapsed))return;o=a.isCollapsed||!1;let u=[],c=a.rangeCount||0;for(let h=0;h<c;h++){let p=a.getRangeAt(h),{startContainer:g,startOffset:m,endContainer:d,endOffset:f}=p;X(g,r,i,!0)||X(d,r,i,!0)||u.push({start:t.getId(g),startOffset:m,end:t.getId(d),endOffset:f})}n({ranges:u})});return l(),Z("selectionchange",l)}function mf({doc:s,customElementCb:e}){let t=s.defaultView;return!t||!t.customElements?()=>{}:Ee(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch (e18){console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function gf(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:p,selectionCb:g,customElementCb:m}=s;s.mutationCb=(...d)=>{e.mutation&&e.mutation(...d),t(...d)},s.mousemoveCb=(...d)=>{e.mousemove&&e.mousemove(...d),r(...d)},s.mouseInteractionCb=(...d)=>{e.mouseInteraction&&e.mouseInteraction(...d),i(...d)},s.scrollCb=(...d)=>{e.scroll&&e.scroll(...d),n(...d)},s.viewportResizeCb=(...d)=>{e.viewportResize&&e.viewportResize(...d),o(...d)},s.inputCb=(...d)=>{e.input&&e.input(...d),l(...d)},s.mediaInteractionCb=(...d)=>{e.mediaInteaction&&e.mediaInteaction(...d),a(...d)},s.styleSheetRuleCb=(...d)=>{e.styleSheetRule&&e.styleSheetRule(...d),u(...d)},s.styleDeclarationCb=(...d)=>{e.styleDeclaration&&e.styleDeclaration(...d),c(...d)},s.canvasMutationCb=(...d)=>{e.canvasMutation&&e.canvasMutation(...d),h(...d)},s.fontCb=(...d)=>{e.font&&e.font(...d),p(...d)},s.selectionCb=(...d)=>{e.selection&&e.selection(...d),g(...d)},s.customElementCb=(...d)=>{e.customElement&&e.customElement(...d),m(...d)}}function yf(s,e={}){let t=s.doc.defaultView;if(!t)return()=>{};gf(s,e);let r;s.recordDOM&&(r=zo(s,s.doc));let i=nf(s),n=of(s),o=Vo(s),l=af(s,{win:t}),a=uf(s),u=ff(s),c=()=>{},h=()=>{},p=()=>{},g=()=>{};s.recordDOM&&(c=cf(s,{win:t}),h=Go(s,s.doc),p=hf(s,{win:t}),s.collectFonts&&(g=df(s)));let m=pf(s),d=mf(s),f=[];for(let b of s.plugins)f.push(b.observer(b.callback,t,b.options));return I(()=>{be.forEach(b=>b.reset()),r==null||r.disconnect(),i(),n(),o(),l(),a(),u(),c(),h(),p(),g(),m(),d(),f.forEach(b=>b())})}function Tt(s){return typeof window[s]!="undefined"}function _t(s){return!!(typeof window[s]!="undefined"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var tr=class{constructor(e){w(this,"iframeIdToRemoteIdMap",new WeakMap),w(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){let n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){let r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){let i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let n=i.get(t);return n||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}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}},ys=class{constructor(e){w(this,"iframes",new WeakMap),w(this,"crossOriginIframeMap",new WeakMap),w(this,"crossOriginIframeMirror",new tr(nn)),w(this,"crossOriginIframeStyleMirror"),w(this,"crossOriginIframeRootIdMap",new WeakMap),w(this,"mirror"),w(this,"mutationCb"),w(this,"wrappedEmit"),w(this,"loadListener"),w(this,"stylesheetManager"),w(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new tr(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case x.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:x.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case x.Meta:case x.Load:case x.DomContentLoaded:return!1;case x.Plugin:return t;case x.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case x.IncrementalSnapshot:switch(t.data.source){case E.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.Drag:case E.TouchMove:case E.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.ViewportResize:return!1;case E.MediaInteraction:case E.MouseInteraction:case E.Scroll:case E.CanvasMutation:case E.Input:return this.replaceIds(t.data,e,["id"]),t;case E.StyleSheetRule:case E.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case E.Font:return t;case E.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case E.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(let n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==Bo.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},ws=class{constructor(e){w(this,"shadowDoms",new WeakSet),w(this,"mutationCb"),w(this,"scrollCb"),w(this,"bypassOptions"),w(this,"mirror"),w(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(!je(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=zo({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Vo({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push(Go({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push(Ee(e.prototype,"attachShadow",function(i){return function(n){let o=i.call(this,n),l=C.shadowRoot(this);return l&&Uo(this)&&r.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch (e19){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wf=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(Ve=0;Ve<Me.length;Ve++)wf[Me.charCodeAt(Ve)]=Ve;var Ve,bf=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Me[e[t]>>2],i+=Me[(e[t]&3)<<4|e[t+1]>>4],i+=Me[(e[t+1]&15)<<2|e[t+2]>>6],i+=Me[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var Xi=new Map;function Sf(s,e){let t=Xi.get(s);return t||(t=new Map,Xi.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}var jo=(s,e,t)=>{if(!s||!(Ho(s,e)||typeof s=="object"))return;let r=s.constructor.name,i=Sf(t,r),n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function Ft(s,e,t){if(s instanceof Array)return s.map(r=>Ft(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,i=bf(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[Ft(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[Ft(s.data,e,t),s.width,s.height]};if(Ho(s,e)||typeof s=="object"){let r=s.constructor.name,i=jo(s,e,t);return{rr_type:r,index:i}}}}return s}var Yo=(s,e,t)=>s.map(r=>Ft(r,e,t)),Ho=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function vf(s,e,t,r){let i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;let l=Ee(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...u){return X(this.canvas,t,r,!0)||setTimeout(()=>{let c=Yo(u,e,this);s(this.canvas,{type:Le["2D"],property:o,args:c})},0),a.apply(this,u)}});i.push(l)}catch (e20){let l=dr(e.CanvasRenderingContext2D.prototype,o,{set(a){s(this.canvas,{type:Le["2D"],property:o,args:[a],setter:!0})}});i.push(l)}return()=>{i.forEach(o=>o())}}function Cf(s){return s==="experimental-webgl"?"webgl":s}function Ji(s,e,t,r){let i=[];try{let n=Ee(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!X(this,e,t,!0)){let u=Cf(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){let c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch (e21){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function Ki(s,e,t,r,i,n){let o=[],l=Object.getOwnPropertyNames(s);for(let a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;let u=Ee(s,a,function(c){return function(...h){let p=c.apply(this,h);if(jo(p,n,this),"tagName"in this.canvas&&!X(this.canvas,r,i,!0)){let g=Yo(h,n,this),m={type:e,property:a,args:g};t(this.canvas,m)}return p}});o.push(u)}catch (e22){let u=dr(s,a,{set(c){t(this.canvas,{type:e,property:a,args:[c],setter:!0})}});o.push(u)}return o}function Ef(s,e,t,r){let i=[];return i.push(...Ki(e.WebGLRenderingContext.prototype,Le.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...Ki(e.WebGL2RenderingContext.prototype,Le.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}var Zo="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",If=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),qi=typeof window!="undefined"&&window.Blob&&new Blob([If(Zo)],{type:"text/javascript;charset=utf-8"});function xf(s){let e;try{if(e=qi&&(window.URL||window.webkitURL).createObjectURL(qi),!e)throw"";let t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch (e23){return new Worker("data:text/javascript;base64,"+Zo,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var bs=class{constructor(e){w(this,"pendingCanvasMutations",new Map),w(this,"rafStamps",{latestId:0,invokeId:null}),w(this,"mirror"),w(this,"mutationCb"),w(this,"resetObservers"),w(this,"frozen",!1),w(this,"locked",!1),w(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});let{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,n){let o=Ji(t,r,i,!0),l=new Map,a=new xf;a.onmessage=m=>{let{id:d}=m.data;if(l.set(d,!1),!("base64"in m.data))return;let{base64:f,type:b,width:S,height:y}=m.data;this.mutationCb({id:d,type:Le["2D"],commands:[{property:"clearRect",args:[0,0,S,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:f}],type:b}]},0,0]}]})};let u=1e3/e,c=0,h,p=()=>{let m=[];return t.document.querySelectorAll("canvas").forEach(d=>{X(d,r,i,!0)||m.push(d)}),m},g=m=>{if(c&&m-c<u){h=requestAnimationFrame(g);return}c=m,p().forEach(async d=>{var f;let b=this.mirror.getId(d);if(l.get(b)||d.width===0||d.height===0)return;if(l.set(b,!0),["webgl","webgl2"].includes(d.__context)){let y=d.getContext(d.__context);((f=y==null?void 0:y.getContextAttributes())==null?void 0:f.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}let S=await createImageBitmap(d);a.postMessage({id:b,bitmap:S,width:d.width,height:d.height,dataURLOptions:n.dataURLOptions},[S])}),h=requestAnimationFrame(g)};h=requestAnimationFrame(g),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Ji(e,t,r,!1),n=vf(this.processMutation.bind(this),e,t,r),o=Ef(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let i=r.map(o=>{let{type:l,...a}=o;return a}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}},Ss=class{constructor(e){w(this,"trackedLinkElements",new WeakSet),w(this,"mutationCb"),w(this,"adoptedStyleSheetCb"),w(this,"styleMirror",new ds),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(e.length===0)return;let r={id:t,styleIds:[]},i=[];for(let n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:rn(l,n.href),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},vs=class{constructor(){w(this,"nodeMap",new WeakMap),w(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},W,Ut,Tr,rr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((ri=s.contentWindow)==null?void 0:ri.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}var re=Da();function ue(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:d,hooks:f,packFn:b,sampling:S={},dataURLOptions:y={},mousemoveWait:v,recordDOM:O=!0,recordCanvas:T=!1,recordCrossOriginIframes:V=!1,recordAfter:L=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:z=!1,collectFonts:Y=!1,inlineImages:q=!1,plugins:ne,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:$e=new Set([]),errorHandler:Fe}=s;rf(Fe);let G=V?window.parent===window:!0,Q=!1;if(!G)try{window.parent.document&&(Q=!1)}catch (e24){Q=!0}if(G&&!e)throw new Error("emit function is required");if(!G&&!Q)return()=>{};v!==void 0&&S.mousemove===void 0&&(S.mousemove=v),re.reset();let ge=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},oe=un(g);Kh();let Ks,mr=0,qs=A=>{for(let te of ne||[])te.eventProcessor&&(A=te.eventProcessor(A));return b&&!Q&&(A=b(A)),A};W=(A,te)=>{var U;let B=A;if(B.timestamp=Qt(),(U=be[0])!=null&&U.isFrozen()&&B.type!==x.FullSnapshot&&!(B.type===x.IncrementalSnapshot&&B.data.source===E.Mutation)&&be.forEach(K=>K.unfreeze()),G)e==null||e(qs(B),te);else if(Q){let K={type:"rrweb",event:qs(B),origin:window.location.origin,isCheckout:te};window.parent.postMessage(K,"*")}if(B.type===x.FullSnapshot)Ks=B,mr=0;else if(B.type===x.IncrementalSnapshot){if(B.data.source===E.Mutation&&B.data.isAttachIframe)return;mr++;let K=r&&mr>=r,D=t&&B.timestamp-Ks.timestamp>t;(K||D)&&Ut(!0)}};let ut=A=>{W({type:x.IncrementalSnapshot,data:{source:E.Mutation,...A}})},Qs=A=>W({type:x.IncrementalSnapshot,data:{source:E.Scroll,...A}}),ei=A=>W({type:x.IncrementalSnapshot,data:{source:E.CanvasMutation,...A}}),oa=A=>W({type:x.IncrementalSnapshot,data:{source:E.AdoptedStyleSheet,...A}}),ye=new Ss({mutationCb:ut,adoptedStyleSheetCb:oa}),we=new ys({mirror:re,mutationCb:ut,stylesheetManager:ye,recordCrossOriginIframes:V,wrappedEmit:W});for(let A of ne||[])A.getMirror&&A.getMirror({nodeMirror:re,crossOriginIframeMirror:we.crossOriginIframeMirror,crossOriginIframeStyleMirror:we.crossOriginIframeStyleMirror});let gr=new vs;Tr=new bs({recordCanvas:T,mutationCb:ei,win:window,blockClass:i,blockSelector:n,mirror:re,sampling:S.canvas,dataURLOptions:y});let ct=new ws({mutationCb:ut,scrollCb:Qs,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:ge,dataURLOptions:y,maskTextFn:d,maskInputFn:m,recordCanvas:T,inlineImages:q,sampling:S,slimDOMOptions:oe,iframeManager:we,stylesheetManager:ye,canvasManager:Tr,keepIframeSrcFn:R,processedNodeManager:gr},mirror:re});Ut=(A=!1)=>{if(!O)return;W({type:x.Meta,data:{href:window.location.href,width:_o(),height:To()}},A),ye.reset(),ct.init(),be.forEach(U=>U.lock());let te=tl(document,{mirror:re,blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:ge,maskTextFn:d,maskInputFn:m,slimDOM:oe,dataURLOptions:y,recordCanvas:T,inlineImages:q,onSerialize:U=>{Lo(U,re)&&we.addIframe(U),$o(U,re)&&ye.trackLinkElement(U),fs(U)&&ct.addShadowRoot(C.shadowRoot(U),document)},onIframeLoad:(U,B)=>{we.attachIframe(U,B),ct.observeAttachShadow(U)},onStylesheetLoad:(U,B)=>{ye.attachLinkElement(U,B)},keepIframeSrcFn:R});if(!te)return console.warn("Failed to snapshot the document");W({type:x.FullSnapshot,data:{node:te,initialOffset:Do(window)}},A),be.forEach(U=>U.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ye.adoptStyleSheets(document.adoptedStyleSheets,re.getId(document))};try{let A=[],te=B=>{var K;return I(yf)({mutationCb:ut,mousemoveCb:(D,yr)=>W({type:x.IncrementalSnapshot,data:{source:yr,positions:D}}),mouseInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.MouseInteraction,...D}}),scrollCb:Qs,viewportResizeCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.ViewportResize,...D}}),inputCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.Input,...D}}),mediaInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.MediaInteraction,...D}}),styleSheetRuleCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.StyleSheetRule,...D}}),styleDeclarationCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.StyleDeclaration,...D}}),canvasMutationCb:ei,fontCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.Font,...D}}),selectionCb:D=>{W({type:x.IncrementalSnapshot,data:{source:E.Selection,...D}})},customElementCb:D=>{W({type:x.IncrementalSnapshot,data:{source:E.CustomElement,...D}})},blockClass:i,ignoreClass:o,ignoreSelector:l,maskTextClass:a,maskTextSelector:u,maskInputOptions:ge,inlineStylesheet:c,sampling:S,recordDOM:O,recordCanvas:T,inlineImages:q,userTriggeredOnInput:z,collectFonts:Y,doc:B,maskInputFn:m,maskTextFn:d,keepIframeSrcFn:R,blockSelector:n,slimDOMOptions:oe,dataURLOptions:y,mirror:re,iframeManager:we,stylesheetManager:ye,shadowDomManager:ct,processedNodeManager:gr,canvasManager:Tr,ignoreCSSAttributes:$e,plugins:((K=ne==null?void 0:ne.filter(D=>D.observer))==null?void 0:K.map(D=>({observer:D.observer,options:D.options,callback:yr=>W({type:x.Plugin,data:{plugin:D.name,payload:yr}})})))||[]},f)};we.addLoadListener(B=>{try{A.push(te(B.contentDocument))}catch(K){console.warn(K)}});let U=()=>{Ut(),A.push(te(document)),rr=!0};return["interactive","complete"].includes(document.readyState)?U():(A.push(Z("DOMContentLoaded",()=>{W({type:x.DomContentLoaded,data:{}}),L==="DOMContentLoaded"&&U()})),A.push(Z("load",()=>{W({type:x.Load,data:{}}),L==="load"&&U()},window))),()=>{A.forEach(B=>{try{B()}catch(K){String(K).toLowerCase().includes("cross-origin")||console.warn(K)}}),gr.destroy(),rr=!1,sf()}}catch(A){console.warn(A)}}ue.addCustomEvent=(s,e)=>{if(!rr)throw new Error("please add custom event after start recording");W({type:x.Custom,data:{tag:s,payload:e}})};ue.freezePage=()=>{be.forEach(s=>s.freeze())};ue.takeFullSnapshot=s=>{if(!rr)throw new Error("please take full snapshot after start recording");Ut(s)};ue.mirror=re;var Qi;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Qi||(Qi={}));var Sd=5*1e3;var{addCustomEvent:vd}=ue,{freezePage:Cd}=ue,{takeFullSnapshot:Ed}=ue;var Jo=()=>typeof CompressionStream=="function"&&typeof Response=="function"&&typeof TextEncoder=="function",Ko=async s=>{let e=new Response(s).body.pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(e).arrayBuffer())};var pr=null,Rf=s=>{if(!pr){pr=new Uint32Array(256);for(let t=0;t<256;t+=1){let r=t;for(let i=0;i<8;i+=1)r=r&1?3988292384^r>>>1:r>>>1;pr[t]=r>>>0}}let e=4294967295;for(let t=0;t<s.length;t+=1)e=pr[(e^s[t])&255]^e>>>8;return(e^4294967295)>>>0},Xo=(s,e,t)=>{s[e]=t&255,s[e+1]=t>>>8&255,s[e+2]=t>>>16&255,s[e+3]=t>>>24&255},js=s=>{let e=new TextEncoder().encode(s),t=Math.max(1,Math.ceil(e.length/65535)),r=new Uint8Array(10+t*5+e.length+8);r.set([31,139,8,0,0,0,0,0,0,255]);let i=10;for(let n=0;n<t;n+=1){let o=e.subarray(n*65535,(n+1)*65535);r[i]=n===t-1?1:0,r[i+1]=o.length&255,r[i+2]=o.length>>>8,r[i+3]=~o.length&255,r[i+4]=~o.length>>>8&255,r.set(o,i+5),i+=5+o.length}return Xo(r,i,Rf(e)),Xo(r,i+4,e.length),r};var qo="data-abyss-privacy";var Af=`img,picture,video,canvas,image,input[type="hidden"],[${qo}="hidden"]`,Nf="input,textarea,select,[contenteditable]",Mf=s=>s.replace(/\S/g,"*"),Of=(s,e,t)=>{if(!s||s.closest(Nf))return!1;for(let r=s;r;r=r.parentElement){let i=r.getAttribute(qo);if(i==="mask"||i==="hidden")return!1;if(i==="allow"||e!==""&&r.matches(e))return!0}return t},Df=(s,e)=>{let t=document.createDocumentFragment();return Array.from(new Set(s)).filter(r=>{try{return t.querySelector(String(r)),!0}catch (e25){return e(),!1}}).join(",")},Qo=(s,e,t)=>{let r=Df([...e,...s.unmaskSelectors],t),i=s.defaultPrivacy==="MASK_INPUTS_ONLY";return{maskAllInputs:!0,maskInputFn:n=>"*".repeat(n.length),maskTextSelector:"*",maskTextFn:(n,o)=>Of(o,r,i)?n:Mf(n),blockSelector:Af}};var ta="abyss-rum-replay",ea=s=>typeof s=="number"&&Number.isInteger(s)&&s>=0,Ys=s=>{var t;let e=null;try{e=JSON.parse((t=sessionStorage.getItem(ta))!=null?t:"null")}catch (e26){e=null}return(e==null?void 0:e.sessionId)===s&&ea(e.seq)&&ea(e.sentBytes)?{sessionId:s,seq:e.seq,sentBytes:e.sentBytes,startedAt:typeof e.startedAt=="number"?e.startedAt:null,stopped:e.stopped===!0}:{sessionId:s,seq:0,sentBytes:0,startedAt:null,stopped:!1}},lt=s=>{try{sessionStorage.setItem(ta,JSON.stringify(s))}catch (e27){}};var ra=64*1024;var Hs=(s,e,t)=>{let r=o=>o.replace(/\/+$/,""),i=s.proxyUrl?r(s.proxyUrl):`${r(s.apiUrl)}/api`,n=_chunkKD6VO7IKjs.b.call(void 0, encodeURIComponent(s.applicationId),encodeURIComponent(e));return`${i}${n}?token=${encodeURIComponent(s.token)}&${"seq"}=${t}`},_f=s=>s===413||s===507||s===410?"SESSION_STOPPED":s===404?"NOT_FOUND":s===429?"RATE_LIMITED":s>=400&&s<500?"REFUSED":s>=200&&s<300?"STORED":"LOST",Zs=async(s,e,t,r)=>{let i;try{i=await s(e,{method:"POST",body:t,keepalive:r,credentials:"omit",headers:{"Content-Type":_chunkKD6VO7IKjs.a}})}catch (e28){return{outcome:"LOST",liveWatched:!1}}let n=_f(i.status),o=!1;if(n==="STORED")try{o=(await i.json()).liveWatched===!0}catch (e29){}return{outcome:n,liveWatched:o}},sa=(s,e)=>{try{return typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(s,new Blob([e],{type:_chunkKD6VO7IKjs.a}))}catch (e30){return!1}};var Pf=2e3,Lf= exports.REPLAY_CHUNK_INTERVAL_MS =10*1e3,$f= exports.REPLAY_LIVE_CHUNK_INTERVAL_MS =2*1e3,ia= exports.REPLAY_MAX_DURATION_MS =3600*1e3,Ff= exports.REPLAY_RATE_LIMIT_PAUSE_MS =60*1e3,Uf= exports.REPLAY_NOT_FOUND_RETRY_MS =30*1e3,Bf= exports.REPLAY_EAGER_FLUSH_BYTES =32*1024,na=s=>`{"events":[${s.join(",")}]}`,Xs= exports.replayState =s=>{var t,r,i,n;let e=!1;try{e=((r=(t=s.options).consent)==null?void 0:r.call(t).analytics)===!0}catch (e31){s.drop()}return{record:s.ready&&((i=s.session.decision)==null?void 0:i.replay)===!0&&((n=s.config)==null?void 0:n.replay.enabled)===!0&&e,liveWatched:s.liveWatched,sessionId:s.session.id}},Js=class{constructor(e,t,r){this.host=e;this.maxSessionBytes=t;this.privacy=r;this.events=[];this.eventsBytes=0;this.recording=!1;this.stopRecord=null;this.lastSentAt=Date.now();this.watched=!1;this.batchWatched=!1;this.pausedUntil=0;this.refused=!1;this.routeHref=null;this.routeExcluded=!1;this.compressing=[];this.outbox=[];this.sending=!1;this.sessionId=e.session.id,this.stored=Ys(this.sessionId)}start(){let e=setInterval(()=>this.guard(()=>this.tick()),Pf),t=()=>this.guard(()=>this.pageHide()),r=()=>this.guard(()=>{document.visibilityState==="hidden"&&this.flush()});return window.addEventListener("pagehide",t),document.addEventListener("visibilitychange",r),this.guard(()=>this.tick()),()=>{clearInterval(e),window.removeEventListener("pagehide",t),document.removeEventListener("visibilitychange",r),this.discard()}}guard(e){try{e()}catch (e32){this.host.drop()}}tick(){let e=Xs(this.host);if(!e.record){this.discard();return}if(e.sessionId!==this.sessionId&&(this.flush(),this.halt(),this.sessionId=e.sessionId,this.stored=Ys(e.sessionId),this.watched=!1),e.liveWatched!==this.batchWatched&&(this.batchWatched=e.liveWatched,this.watched=e.liveWatched),this.drain(),this.stored.stopped||this.refused)return;let t=Date.now();if(this.stored.startedAt!==null&&t-this.stored.startedAt>=ia){this.flush(),this.stopSession();return}if(this.isRouteExcluded()){this.flush(),this.halt();return}this.recording||this.begin();let r=this.watched?$f:Lf;(t-this.lastSentAt>=r||this.eventsBytes>=Bf)&&this.flush()}begin(){this.lastSentAt=Date.now(),this.recording=!0;let e=ue({emit:t=>this.guard(()=>this.onEvent(t)),...this.privacy,recordCanvas:!1,recordCrossOriginIframes:!1,collectFonts:!1,inlineImages:!1,slimDOMOptions:"all",sampling:{scroll:150,input:"last"},errorHandler:()=>(this.host.drop(),!0)});e?this.stopRecord=e:(this.recording=!1,this.refused=!0,this.host.drop())}onEvent(e){let t=Xs(this.host);if(!t.record){this.discard();return}if(!this.recording||t.sessionId!==this.sessionId||this.isRouteExcluded())return;let r=Date.now();if(this.stored.startedAt===null&&(this.stored.startedAt=r,lt(this.stored)),r-this.stored.startedAt>=ia){this.flush(),this.stopSession();return}let i=JSON.stringify(e);this.events.push(i),this.eventsBytes+=i.length}pageHide(){Xs(this.host).record?this.unload():this.discard()}takeEvents(){let e=this.events;return this.events=[],this.eventsBytes=0,e}nextSeq(e){let t=e.seq;return e.seq+=1,lt(e),t}flush(){if(this.events.length===0||Date.now()<this.pausedUntil)return;let e=na(this.takeEvents());this.lastSentAt=Date.now();let t=this.stored,r={stored:t,seq:this.nextSeq(t),json:e,body:null};this.compressing.push(r);let i=n=>this.guard(()=>{let o=this.compressing.indexOf(r);o!==-1&&(n?r.body=n:(this.compressing.splice(o,1),this.host.drop()),this.release())});Ko(e).then(i,()=>i(null))}release(){let e=this.compressing[0];for(;e&&e.body;){this.compressing.shift();let{stored:t,seq:r,body:i}=e;this.withinCaps(t,this.outbox,i)&&(this.outbox.push({stored:t,seq:r,body:i,notFoundSince:null}),this.drain()),e=this.compressing[0]}}withinCaps(e,t,r){let i=t.reduce((n,o)=>o.stored===e?n+o.body.length:n,0);return r.length>20971520||e.sentBytes+i+r.length>this.maxSessionBytes?(this.settle(e,"SESSION_STOPPED"),!1):!0}drain(){let e=this.outbox[0];if(!e||this.sending||Date.now()<this.pausedUntil)return;this.sending=!0;let t=Hs(this.host.options,e.stored.sessionId,e.seq);Zs(this.host.nativeFetch,t,e.body,!1).then(r=>{this.sending=!1,this.guard(()=>this.onAnswer(e,r))},()=>{this.sending=!1,this.host.drop()})}unload(){let e=[...this.outbox,...this.compressing.map(({stored:l,seq:a,json:u,body:c})=>({stored:l,seq:a,body:c||js(u),notFoundSince:null}))];this.outbox=[],this.compressing=[];let t=this.takeEvents(),r=ra,i=new Set,n=[];for(let l of e)i.has(l.stored)||l.body.length>r?(i.add(l.stored),this.host.drop()):(r-=l.body.length,n.push(l));let o=this.stored;if(t.length>0&&Date.now()>=this.pausedUntil){let l=js(na(t));i.has(o)||l.length>r?this.host.drop():this.withinCaps(o,n,l)&&n.push({stored:o,seq:this.nextSeq(o),body:l,notFoundSince:null})}for(let l of n){let a=Hs(this.host.options,l.stored.sessionId,l.seq);sa(a,l.body)?(l.stored.sentBytes+=l.body.length,this.save(l.stored)):Zs(this.host.nativeFetch,a,l.body,!0).then(u=>this.guard(()=>this.onAnswer(l,u)),this.host.drop)}}onAnswer(e,t){var o;let r=this.outbox[0]===e,{outcome:i}=t;if(i==="NOT_FOUND"){let l=Date.now();if(e.notFoundSince=(o=e.notFoundSince)!=null?o:l,r&&l-e.notFoundSince<Uf)return;i="REFUSED"}r&&this.outbox.shift();let{stored:n}=e;if(i==="STORED")n.sentBytes+=e.body.length,this.save(n),n===this.stored&&(this.watched=t.liveWatched);else{if(i==="REFUSED"||i==="SESSION_STOPPED"){let l=this.outbox.filter(u=>u.stored!==n),a=this.outbox.length-l.length;for(let u=0;u<a&&i==="REFUSED";u+=1)this.host.drop();this.outbox=l}this.settle(n,i)}this.drain()}settle(e,t){t==="SESSION_STOPPED"?(e.stopped=!0,this.save(e)):this.host.drop(),e===this.stored&&(t==="SESSION_STOPPED"?this.stopSession():t==="REFUSED"?(this.refused=!0,this.halt(),this.takeEvents(),this.compressing=[]):(t==="RATE_LIMITED"&&(this.pausedUntil=Date.now()+Ff),this.recording&&ue.takeFullSnapshot(!0)))}save(e){e===this.stored&&lt(e)}stopSession(){this.stored.stopped=!0,lt(this.stored),this.halt(),this.takeEvents()}halt(){let e=this.stopRecord;this.recording=!1,this.stopRecord=null,e==null||e()}discard(){this.halt(),this.takeEvents(),this.outbox=[],this.compressing=[]}isRouteExcluded(){var t;let e=window.location.href;if(e!==this.routeHref){this.routeHref=e;let r=(t=this.host.options.replayExcludedRoutes)!=null?t:[],i=r.length>0?this.route():"";this.routeExcluded=r.some(n=>n instanceof RegExp?i.search(n)!==-1:i===n)}return this.routeExcluded}route(){let{routeResolver:e}=this.host.options;if(e)try{return String(e(window.location))}catch (e33){this.host.drop()}return window.location.pathname}},$d= exports.recordReplay =s=>{var e,t;try{let r=(e=s.config)==null?void 0:e.replay,i=r==null?void 0:r.maxSessionBytes;if(s.stopped||!r||typeof i!="number"||!(i>0)||!Jo())return;let n=Qo(r,(t=s.options.unmaskSelectors)!=null?t:[],s.drop);s.teardowns.push(new Js(s,i,n).start())}catch (e34){s.drop()}};exports.REPLAY_CHUNK_INTERVAL_MS = Lf; exports.REPLAY_EAGER_FLUSH_BYTES = Bf; exports.REPLAY_LIVE_CHUNK_INTERVAL_MS = $f; exports.REPLAY_MAX_DURATION_MS = ia; exports.REPLAY_NOT_FOUND_RETRY_MS = Uf; exports.REPLAY_RATE_LIMIT_PAUSE_MS = Ff; exports.REPLAY_TICK_MS = Pf; exports.recordReplay = $d; exports.replayState = Xs;
54
54
  /*! Bundled license information:
55
55
 
56
56
  rrweb/dist/rrweb.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/monitor-browser",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Browser SDK of Abyss-Monitor: real user monitoring (sessions, page views, requests, errors)",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",