!function(){"use strict";var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t,r=Array.prototype.forEach,n=null==e?void 0:e.navigator,i=null==e?void 0:e.document;null==e||e.location,null==e||e.fetch,null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest&&e.XMLHttpRequest,null==e||e.AbortController,null==n||n.userAgent;var o=null!=t?t:{};function s(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){s(o,n,i,a,u,"next",t)}function u(t){s(o,n,i,a,u,"throw",t)}a(void 0)}))}}function u(){return u=Object.assign?Object.assign.bind():function(t){for(var e=1;e(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(l||{}),d=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(d||{});var c=function(t){return t.trim()},h=Array.isArray,v=Object.prototype,f=v.hasOwnProperty,m=v.toString,p=h||function(t){return"[object Array]"===m.call(t)},g=t=>"function"==typeof t,I=t=>t===Object(t)&&!p(t),y=t=>void 0===t,b=t=>"[object String]"==m.call(t),C=t=>null===t,w=t=>y(t)||C(t),S=t=>"[object Number]"==m.call(t),A=t=>"[object Boolean]"===m.call(t),k=t=>t instanceof FormData;function N(t,e,r,n,i){return e>r&&(n.warn("min cannot be greater than max."),e=r),S(t)?t>r?(n.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t{Object.keys(this.i).forEach((t=>{var e=this.u(t)+this.h;e>=this.m?delete this.i[t]:this.I(t,e)}))},this.u=t=>this.i[String(t)],this.I=(t,e)=>{this.i[String(t)]=e},this.consumeRateLimit=t=>{var e,r,n=null!==(e=this.u(t))&&void 0!==e?e:this.m;if(0===(n=Math.max(n-1,0)))return!0;this.I(t,n);var i=0===n;return i&&(null==(r=this.C)||r.call(this,t)),i},this.C=this.t.C,this.m=N(this.t.bucketSize,0,100,this.t.S),this.h=N(this.t.refillRate,0,this.m,this.t.S),this.A=N(this.t.refillInterval,0,864e5,this.t.S),this.k=setInterval((()=>{this.o()}),this.A)}stop(){this.k&&(clearInterval(this.k),this.k=void 0)}}var T={LIB_VERSION:"1.275.2"},M=e=>{var r={N:function(r){if(t&&o.POSTHOG_DEBUG&&!y(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[r]?t.console[r].__rrweb_original__:t.console[r]),i=arguments.length,s=new Array(i>1?i-1:0),a=1;a{r.error("You must initialize PostHog before calling "+t)},createLogger:t=>M(e+" "+t)};return r},F=M("[PostHog.js]"),_=F.createLogger,B={};function O(t,e,n){if(!w(t)){if(p(t))return function(t,e,n){if(p(t))if(r&&t.forEach===r)t.forEach(e,n);else if("length"in t&&t.length===+t.length)for(var i=0,o=t.length;i{var e=null==i?void 0:i.createElement("a");return y(e)?null:(e.href=t,e)},E=function(t,e){var r,n;void 0===e&&(e="&");var i=[];return O(t,(function(t,e){y(t)||y(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),n=encodeURIComponent(e),i[i.length]=n+"="+r)})),i.join(e)},G="$session_is_sampled",L="$session_recording_url_trigger_activated_session",W="$session_recording_event_trigger_activated_session",D=new RegExp("(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})"),V=new RegExp("(\\d{3}-?\\d{2}-?\\d{4})");var X="[SessionRecording]",z="redacted",J={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},K=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],H=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],j=["/s/","/e/","/i/"];function U(t,e,r,n){if(w(t))return t;var i=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return b(i)&&(i=parseInt(i)),i>r?X+" "+n+" body too large to record ("+i+" bytes)":t}function P(t,e){if(w(t))return t;var r=t;return function(t,e){if(w(t))return!1;if(b(t)){if(t=c(t),D.test((t||"").replace(/[- ]/g,"")))return!1;if(V.test(t))return!1}return!0}(r)||(r=X+" "+e+" body "+z),O(H,(t=>{var n,i;null!=(n=r)&&n.length&&-1!==(null==(i=r)?void 0:i.indexOf(t))&&(r=X+" "+e+" body "+z+" as might contain: "+t)})),r}var q=(t,e)=>{var r,n,i,o={payloadSizeLimitBytes:J.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...J.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...J.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,l=!1!==t.capture_performance&&e.recordPerformance,d=(r=o,i=Math.min(1e6,null!==(n=r.payloadSizeLimitBytes)&&void 0!==n?n:1e6),t=>(null!=t&&t.requestBody&&(t.requestBody=U(t.requestBody,t.requestHeaders,i,"Request")),null!=t&&t.responseBody&&(t.responseBody=U(t.responseBody,t.responseHeaders,i,"Response")),t)),c=e=>{return d(((t,e)=>{var r,n=Y(t.name),i=0===e.indexOf("http")?null==(r=Y(e))?void 0:r.pathname:e;"/"===i&&(i="");var o=null==n?void 0:n.pathname.replace(i||"","");if(!(n&&o&&j.some((t=>0===o.indexOf(t)))))return t})((n=(r=e).requestHeaders,w(n)||O(Object.keys(null!=n?n:{}),(t=>{K.includes(t.toLowerCase())&&(n[t]=z)})),r),t.api_host));var r,n},h=g(t.session_recording.maskNetworkRequestFn);return h&&g(t.session_recording.maskCapturedNetworkRequestFn)&&F.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var r=t.session_recording.maskNetworkRequestFn({url:e.name});return u({},e,{name:null==r?void 0:r.url})}),o.maskRequestFn=g(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r,n=c(e);return n&&null!==(r=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(n))&&void 0!==r?r:void 0}:t=>function(t){if(!y(t))return t.requestBody=P(t.requestBody,"Request"),t.responseBody=P(t.responseBody,"Response"),t}(c(t)),u({},J,o,{recordHeaders:s,recordBody:a,recordPerformance:l,recordInitialRequests:l})},Q="disabled",tt="sampled",et="active",rt="buffering",nt="paused",it="trigger",ot=it+"_activated",st=it+"_pending",at=it+"_"+Q;function ut(t,e){return e.some((e=>"regex"===e.matching&&new RegExp(e.url).test(t)))}class lt{constructor(t){this.R=t}triggerStatus(t){var e=this.R.map((e=>e.triggerStatus(t)));return e.includes(ot)?ot:e.includes(st)?st:at}stop(){this.R.forEach((t=>t.stop()))}}class dt{constructor(t){this.R=t}triggerStatus(t){var e=new Set;for(var r of this.R)e.add(r.triggerStatus(t));switch(e.delete(at),e.size){case 0:return at;case 1:return Array.from(e)[0];default:return st}}stop(){this.R.forEach((t=>t.stop()))}}class ct{triggerStatus(){return st}stop(){}}var ht=t=>"sessionRecording"in t;class vt{constructor(t){this.T=[],this.M=[],this.urlBlocked=!1,this._instance=t}onConfig(t){var e,r;this.T=(ht(t)?I(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.M=(ht(t)?I(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[]}onRemoteConfig(t){this.onConfig(t)}F(t){var e;return 0===this.T.length?at:(null==(e=this._instance)?void 0:e.get_property(L))===t?ot:st}triggerStatus(t){var e=this.F(t),r=e===ot?ot:e===st?st:at;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlTriggerConditions(e,r,n){if(void 0!==t&&t.location.href){var i=t.location.href,o=this.urlBlocked,s=ut(i,this.M);o&&s||(s&&!o?e():!s&&o&&r(),ut(i,this.T)&&n("url"))}}stop(){}}class ft{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.B=()=>{},this._instance=t}triggerStatus(){var t=st;return w(this.linkedFlag)&&(t=at),this.linkedFlagSeen&&(t=ot),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}onConfig(t,e){var r;if(this.linkedFlag=(ht(t)?I(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!w(this.linkedFlag)&&!this.linkedFlagSeen){var n=b(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,i=b(this.linkedFlag)?null:this.linkedFlag.variant;this.B=this._instance.onFeatureFlags(((t,r)=>{var o=!1;if(I(r)&&n in r){var s=r[n];o=A(s)?!0===s:i?s===i:!!s}this.linkedFlagSeen=o,o&&e(n,i)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.B()}}class mt{constructor(t){this.O=[],this._instance=t}onConfig(t){var e;this.O=(ht(t)?I(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}Z(t){var e;return 0===this.O.length?at:(null==(e=this._instance)?void 0:e.get_property(W))===t?ot:st}triggerStatus(t){var e=this.Z(t),r=e===ot?ot:e===st?st:at;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}stop(){}}function pt(t){return t.isRecordingEnabled?rt:Q}function gt(t){if(!t.receivedFlags)return rt;if(!t.isRecordingEnabled)return Q;if(t.urlTriggerMatching.urlBlocked)return nt;var e=!0===t.isSampled,r=new lt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?tt:r===ot?et:r===st?rt:!1===t.isSampled?Q:et}function It(t){if(!t.receivedFlags)return rt;if(!t.isRecordingEnabled)return Q;if(t.urlTriggerMatching.urlBlocked)return nt;var e=new dt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==at,n=A(t.isSampled);return r&&e===st?rt:r&&e===at||n&&!t.isSampled?Q:!0===t.isSampled?tt:et}function yt(t){var e,r;return(null==(e=JSON.stringify(t,(r=[],function(t,e){if(I(e)){for(;r.length>0&&r[r.length-1]!==this;)r.pop();return r.includes(e)?"[Circular]":(r.push(e),e)}return e})))?void 0:e.length)||0}var bt=Uint8Array,Ct=Uint16Array,wt=Uint32Array,St=new bt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),At=new bt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),kt=new bt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nt=function(t,e){for(var r=new Ct(31),n=0;n<31;++n)r[n]=e+=1<>>1|(21845&Bt)<<1;Ot=(61680&(Ot=(52428&Ot)>>>2|(13107&Ot)<<2))>>>4|(3855&Ot)<<4,_t[Bt]=((65280&Ot)>>>8|(255&Ot)<<8)>>>1}var xt=function(t,e,r){for(var n=t.length,i=0,o=new Ct(e);i>>u]=l}else for(s=new Ct(n),i=0;i>>15-t[i];return s},Zt=new bt(288);for(Bt=0;Bt<144;++Bt)Zt[Bt]=8;for(Bt=144;Bt<256;++Bt)Zt[Bt]=9;for(Bt=256;Bt<280;++Bt)Zt[Bt]=7;for(Bt=280;Bt<288;++Bt)Zt[Bt]=8;var Yt=new bt(32);for(Bt=0;Bt<32;++Bt)Yt[Bt]=5;var Et=xt(Zt,9,0),Gt=xt(Yt,5,0),Lt=function(t){return(t/8>>0)+(7&t&&1)},Wt=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var n=new(t instanceof Ct?Ct:t instanceof wt?wt:bt)(r-e);return n.set(t.subarray(e,r)),n},Dt=function(t,e,r){r<<=7&e;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8},Vt=function(t,e,r){r<<=7&e;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8,t[n+2]|=r>>>16},Xt=function(t,e){for(var r=[],n=0;nh&&(h=o[n].s);var v=new Ct(h+1),f=zt(r[d-1],v,0);if(f>e){n=0;var m=0,p=f-e,g=1<e))break;m+=g-(1<>>=p;m>0;){var y=o[n].s;v[y]=0&&m;--n){var b=o[n].s;v[b]==e&&(--v[b],++m)}f=e}return[new bt(v),f]},zt=function(t,e,r){return-1==t.s?Math.max(zt(t.l,e,r+1),zt(t.r,e,r+1)):e[t.s]=r},Jt=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Ct(++e),n=0,i=t[0],o=1,s=function(t){r[n++]=t},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[r.subarray(0,n),e]},Kt=function(t,e){for(var r=0,n=0;n>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var o=0;o4&&!N[kt[T-1]];--T);var M,F,_,B,O=l+5<<3,x=Kt(i,Zt)+Kt(o,Yt)+s,Z=Kt(i,h)+Kt(o,m)+s+14+3*T+Kt(S,N)+(2*S[16]+3*S[17]+7*S[18]);if(O<=x&&O<=Z)return Ht(e,d,t.subarray(u,u+l));if(Dt(e,d,1+(Z15&&(Dt(e,d,L[A]>>>5&127),d+=L[A]>>>12)}}}else M=Et,F=Zt,_=Gt,B=Yt;for(A=0;A255){W=n[A]>>>18&31;Vt(e,d,M[W+257]),d+=F[W+257],W>7&&(Dt(e,d,n[A]>>>23&31),d+=St[W]);var D=31&n[A];Vt(e,d,_[D]),d+=B[D],D>3&&(Vt(e,d,n[A]>>>5&8191),d+=At[D])}else Vt(e,d,M[n[A]]),d+=F[n[A]];return Vt(e,d,M[256]),d+F[256]},Ut=new wt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pt=function(){for(var t=new wt(256),e=0;e<256;++e){for(var r=e,n=9;--n;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),qt=function(){var t=4294967295;return{p:function(e){for(var r=t,n=0;n>>8;t=r},d:function(){return 4294967295^t}}},Qt=function(t,e,r,n,i){return function(t,e,r,n,i,o){var s=t.length,a=new bt(n+s+5*(1+Math.floor(s/7e3))+i),u=a.subarray(n,a.length-i),l=0;if(!e||s<8)for(var d=0;d<=s;d+=65535){var c=d+65535;c>>13,f=8191&h,m=(1<7e3||N>24576)&&B>423){l=jt(t,u,0,C,w,S,k,N,T,d-T,l),N=A=k=0,T=d;for(var O=0;O<286;++O)w[O]=0;for(O=0;O<30;++O)S[O]=0}var x=2,Z=0,Y=f,E=F-_&32767;if(B>2&&M==b(d-E))for(var G=Math.min(v,B)-1,L=Math.min(32767,d),W=Math.min(258,B);E<=L&&--Y&&F!=_;){if(t[d+x]==t[d+x-E]){for(var D=0;Dx){if(x=D,Z=E,D>G)break;var V=Math.min(E,D-2),X=0;for(O=0;OX&&(X=J,_=z)}}}E+=(F=_)-(_=p[F])+32768&32767}if(Z){C[N++]=268435456|Mt[x]<<18|Ft[Z];var K=31&Mt[x],H=31&Ft[Z];k+=St[K]+At[H],++w[257+K],++S[H],R=d+x,++A}else C[N++]=t[d],++w[t[d]]}}l=jt(t,u,o,C,w,S,k,N,T,d-T,l)}return Wt(a,0,n+Lt(l)+i)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,n,!0)},$t=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},te=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&$t(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var n=0;n<=r.length;++n)t[n+10]=r.charCodeAt(n)}},ee=function(t){return 10+(t.filename&&t.filename.length+1||0)};class re{constructor(t,e){var r,n;void 0===e&&(e={}),this.Y={},this.G=t=>{if(!this.Y[t]){var e,r;this.Y[t]=!0;var n=this.L(t);null==(e=(r=this.t).onBlockedNode)||e.call(r,t,n)}},this.W=t=>{var e=this.L(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var r=e.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[t,e]},this.L=t=>this._rrweb.mirror.getNode(t),this.D=t=>{var e,r,n,i,o,s,a,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(n=null==(i=t.attributes)?void 0:i.length)&&void 0!==n?n:0)+(null!==(o=null==(s=t.texts)?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null==(u=t.adds)?void 0:u.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this.D(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var[e]=this.W(t.id);return!this.V.consumeRateLimit(e)&&t})));var n=this.D(e);return 0!==n||r===n?t:void 0},this._rrweb=t,this.t=e,this.V=new R({bucketSize:null!==(r=this.t.bucketSize)&&void 0!==r?r:100,refillRate:null!==(n=this.t.refillRate)&&void 0!==n?n:10,refillInterval:1e3,C:this.G,S:F})}reset(){this.Y={}}stop(){this.V.stop(),this.reset()}}function ne(t,e){return function(t){for(var e=0,r=0;r({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function le(){var t;return null==o||null==(t=o.__PosthogExtensions__)||null==(t=t.rrweb)?void 0:t.record}function de(t){return function(t,e){for(var r="",n=0;n>>1)),i=0,o=function(t){n[i++]=t},s=0;sn.length){var a=new bt(i+8+(r-s<<1));a.set(n),n=a}var u=t.charCodeAt(s);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++s))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return Wt(n,0,i)}(JSON.stringify(t))))}function ce(t){return t.type===l.Custom&&"sessionIdle"===t.data.tag}function he(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),n=t.data.slice(0,r),i=t.data.slice(r);return[he({size:yt(n),data:n,sessionId:t.sessionId,windowId:t.windowId}),he({size:yt(i),data:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}class ve{get sessionId(){return this.X}get J(){if(!this._instance.sessionManager)throw new Error(oe+" must be started with a valid sessionManager.");return this._instance.sessionManager}get K(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get H(){var t=this._instance.get_property(G);return A(t)?t:b(t)?t===this.sessionId:null}get j(){var t,e=null==(t=this.U)?void 0:t.sampleRate;return S(e)?e:null}get P(){var t,e=null==(t=this.U)?void 0:t.minimumDurationMilliseconds;return S(e)?e:null}constructor(t){this.q="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.$=void 0,this.tt=Date.now(),this.et=[],this.rt="unknown",this.nt=new ct,this.it=void 0,this.ot=void 0,this.st=pt,this.ut=void 0,this.lt=void 0,this.dt=void 0,this.ct=void 0,this.ht=(t,e,r)=>{r&&(this.vt("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.ft(),this.$||this.start("session_id_changed"),S(this.j)&&w(this.dt)&&this.gt(t))},this.It=()=>{this.yt()},this.bt=()=>{this.vt("browser offline",{})},this.Ct=()=>{this.vt("browser online",{})},this.wt=()=>{if(null!=i&&i.visibilityState){var t="window "+i.visibilityState;this.vt(t,{})}},this._instance=t;var{sessionId:e,windowId:r}=this.J.checkAndGetSessionAndWindowId();this.X=e,this.St=r,this.At=new ft(this._instance),this.kt=new vt(this._instance),this.Nt=new mt(this._instance),this.Rt=this.Tt(),this.K>=this.J.sessionTimeoutMs&&se.warn("session_idle_threshold_ms ("+this.K+") is greater than the session timeout ("+this.J.sessionTimeoutMs+"). Session will never be detected as idle")}get Mt(){var t,e,r,n,i,o,s,a=null==(t=this.U)?void 0:t.masking,u={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(n=this._instance.config.session_recording)?void 0:n.blockSelector},l=null!==(i=null==u?void 0:u.maskAllInputs)&&void 0!==i?i:null==a?void 0:a.maskAllInputs,d=null!==(o=null==u?void 0:u.maskTextSelector)&&void 0!==o?o:null==a?void 0:a.maskTextSelector,c=null!==(s=null==u?void 0:u.blockSelector)&&void 0!==s?s:null==a?void 0:a.blockSelector;return y(l)&&y(d)&&y(c)?void 0:{maskAllInputs:null==l||l,maskTextSelector:d,blockSelector:c}}get Ft(){var t,e,r,n,i,o,s,a=this._instance.config.session_recording.captureCanvas,u=null==(t=this.U)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==a?void 0:a.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,d=null!==(n=null!==(i=null==a?void 0:a.canvasFps)&&void 0!==i?i:null==u?void 0:u.fps)&&void 0!==n?n:4,c=null!==(o=null!==(s=null==a?void 0:a.canvasQuality)&&void 0!==s?s:null==u?void 0:u.quality)&&void 0!==o?o:.4;if("string"==typeof c){var h=parseFloat(c);c=isNaN(h)?.4:h}return{enabled:l,fps:N(d,0,12,_("canvas recording fps"),4),quality:N(c,0,1,_("canvas recording quality"),.4)}}get _t(){var t,e=!(null==(t=this.U)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Bt(){var t,e,r,n=null==(t=this.U)?void 0:t.networkPayloadCapture,i={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},o=(null==i?void 0:i.recordHeaders)||(null==n?void 0:n.recordHeaders),s=(null==i?void 0:i.recordBody)||(null==n?void 0:n.recordBody),a=I(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,u=!!(A(a)?a:null==n?void 0:n.capturePerformance);return o||s||u?{recordHeaders:o,recordBody:s,recordPerformance:u}:void 0}Ot(){var t,e,r=[],n=null==(t=o.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this._t&&r.push(n());var i=null==(e=o.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;this.Bt&&g(i)&&(!Z.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(i(q(this._instance.config,this.Bt))):se.info("NetworkCapture not started because we are on localhost."));return r}xt(t){var e=this._instance.config.session_recording;if(e.maskNetworkRequestFn){var r,n={url:t};return null==(r=n=e.maskNetworkRequestFn(n))?void 0:r.url}return t}Zt(t){try{return t.rrwebMethod(),!0}catch(e){return this.et.length<10?this.et.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):se.warn("could not emit queued rrweb event.",e,t),!1}}vt(t,e){return this.Zt(ue((()=>le().addCustomEvent(t,e))))}Yt(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),r=e.origin+e.pathname+e.search,n=this.xt(r);this.Et!==n&&(this.Et=n,this.vt("$url_changed",{href:n}))}catch(t){}}Gt(){if(this.et.length){var t=[...this.et];this.et=[],t.forEach((t=>{Date.now()-t.enqueuedAt<=2e3&&this.Zt(t)}))}}Lt(){return this.Zt(ue((()=>le().takeFullSnapshot())))}get Wt(){var t,e;return this.nt.triggerStatus(this.sessionId)!==st||["sampled","active"].includes(this.status)?null!==(t=null==(e=this._instance.config.session_recording)?void 0:e.full_snapshot_interval_millis)&&void 0!==t?t:ie:6e4}Dt(){if(this.Vt&&clearInterval(this.Vt),!0!==this.rt){var t=this.Wt;t&&(this.Vt=setInterval((()=>{this.Lt()}),t))}}Xt(){this.kt.urlBlocked||(this.kt.urlBlocked=!0,clearInterval(this.Vt),se.info("recording paused due to URL blocker"),this.vt("recording paused",{reason:"url blocker"}))}zt(){this.kt.urlBlocked&&(this.kt.urlBlocked=!1,this.Lt(),this.Dt(),this.vt("recording resumed",{reason:"left blocked url"}),se.info("recording resumed"))}Jt(t){var e;this.nt.triggerStatus(this.sessionId)===st&&(null==(e=this._instance)||null==(e=e.persistence)||e.register({["url"===t?L:W]:this.X}),this.yt(),this.Kt(t+"_trigger_matched"))}get isStarted(){return!!this.$}get U(){var t=this._instance.get_property("$session_recording_remote_config");if(t)return I(t)?t:JSON.parse(t)}start(e){var r,n=this.U;n?(this.J.checkAndGetSessionAndWindowId(),null!=n&&n.endpoint&&(this.q=null==n?void 0:n.endpoint),"any"===(null==n?void 0:n.triggerMatchType)?(this.st=gt,this.nt=new lt([this.Nt,this.kt])):(this.st=It,this.nt=new dt([this.Nt,this.kt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==n?void 0:n.triggerMatchType}),this.kt.onConfig(n),this.Nt.onConfig(n),null==(r=this.ot)||r.call(this),this.Ht(),this.At.onConfig(n,((t,e)=>{this.Kt("linked_flag_matched",{flag:t,variant:e})})),this.gt(this.sessionId),this.jt(),x(t,"beforeunload",this.It),x(t,"offline",this.bt),x(t,"online",this.Ct),x(t,"visibilitychange",this.wt),this.ut||(this.ut=this.J.onSessionId(this.ht)),this.lt||(this.lt=this.J.on("forcedIdleReset",(()=>{this.ft(),this.rt="unknown",this.stop(),this.ct=this.J.onSessionId(((t,e,r)=>{var n;null==(n=this.ct)||n.call(this),this.ct=void 0,this.ht(t,e,r)}))}))),w(this.it)&&(this.it=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.xt(null==t?void 0:t.properties.$current_url):"";if(!e)return;this.vt("$pageview",{href:e})}}catch(t){se.error("Could not add $pageview to rrweb session",t)}}))),this.status===et&&this.Kt(e||"recording_initialized")):se.info("remote config must be stored in persistence before recording can start")}stop(){var e,r,n,i,o,s,a,u;null==t||t.removeEventListener("beforeunload",this.It),null==t||t.removeEventListener("offline",this.bt),null==t||t.removeEventListener("online",this.Ct),null==t||t.removeEventListener("visibilitychange",this.wt),this.Tt(),clearInterval(this.Vt),this.Ut(),null==(e=this.it)||e.call(this),this.it=void 0,null==(r=this.ot)||r.call(this),this.ot=void 0,null==(n=this.ut)||n.call(this),this.ut=void 0,null==(i=this.lt)||i.call(this),this.lt=void 0,null==(o=this.dt)||o.call(this),this.dt=void 0,null==(s=this.ct)||s.call(this),this.ct=void 0,this.Nt.stop(),this.kt.stop(),this.At.stop(),null==(a=this.Pt)||a.stop(),this.et=[],null==(u=this.$)||u.call(this),this.$=void 0,se.info("stopped")}onRRwebEmit(t){var e;if(this.Gt(),t&&I(t)){if(t.type===l.Meta){var r=this.xt(t.data.href);if(this.Et=r,!r)return;t.data.href=r}else this.Yt();if(this.kt.checkUrlTriggerConditions((()=>this.Xt()),(()=>this.zt()),(t=>this.Jt(t))),!this.kt.urlBlocked||(n=t).type===l.Custom&&"recording paused"===n.data.tag){var n,i;if(t.type===l.FullSnapshot)this.Dt(),null==(i=this.Pt)||i.reset();t.type===l.FullSnapshot&&this.nt.triggerStatus(this.sessionId)===st&&this.qt();var o=this.Pt?this.Pt.throttleMutations(t):t;if(o){var s=function(t){var e=t;if(e&&I(e)&&6===e.type&&I(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var r=[],n=0;n2e3?r.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):r.push(e.data.payload.payload[n]);return e.data.payload.payload=r,t}return t}(o);if(this.Qt(s),!0!==this.rt||ce(s)){if(ce(s)){var a=s.data.payload;if(a){var c=a.lastActivityTimestamp,h=a.threshold;s.timestamp=c+h}}var v=null===(e=this._instance.config.session_recording.compress_events)||void 0===e||e?function(t){try{if(t.type===l.FullSnapshot)return u({},t,{data:de(t.data),cv:"2024-10"});if(t.type===l.IncrementalSnapshot&&t.data.source===d.Mutation)return u({},t,{cv:"2024-10",data:u({},t.data,{texts:de(t.data.texts),attributes:de(t.data.attributes),removes:de(t.data.removes),adds:de(t.data.adds)})});if(t.type===l.IncrementalSnapshot&&t.data.source===d.StyleSheetRule)return u({},t,{cv:"2024-10",data:u({},t.data,{adds:t.data.adds?de(t.data.adds):void 0,removes:t.data.removes?de(t.data.removes):void 0})})}catch(t){se.error("could not compress event - will use uncompressed event",t)}return t}(s):s,f={$snapshot_bytes:yt(v),$snapshot_data:v,$session_id:this.X,$window_id:this.St};this.status!==Q?this.$t(f):this.Tt()}}}}}get status(){return this.st({receivedFlags:!0,isRecordingEnabled:!0,isSampled:this.H,urlTriggerMatching:this.kt,eventTriggerMatching:this.Nt,linkedFlagMatching:this.At,sessionId:this.sessionId})}log(t,e){var r;void 0===e&&(e="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.At.linkedFlagSeen=!0,this.Lt(),this.Kt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[G]:this.sessionId}),this.Lt(),this.Kt("sampling_overridden")}overrideTrigger(t){this.Jt(t)}Ut(){this.te&&(clearTimeout(this.te),this.te=void 0)}yt(){this.Ut();var t=this.P,e=this.ee,r=S(e)&&e>=0,n=S(t)&&r&&e{this.yt()}),2e3),this.Rt;this.Rt.data.length>0&&he(this.Rt).forEach((t=>{this.re({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:"web",$lib_version:T.LIB_VERSION})}));return this.Tt()}$t(t){var e,r=2+((null==(e=this.Rt)?void 0:e.data.length)||0);!this.rt&&(this.Rt.size+t.$snapshot_bytes+r>943718.4||this.Rt.sessionId!==this.X)&&(this.Rt=this.yt()),this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.te||this.rt||(this.te=setTimeout((()=>{this.yt()}),2e3))}re(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.q),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get ee(){var t,e,r=null==(t=this.Rt)?void 0:t.data[(null==(e=this.Rt)?void 0:e.data.length)-1],{sessionStartTimestamp:n}=this.J.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-n:null}qt(){if(!this.Rt||0===this.Rt.data.length)return this.Tt();for(var t=-1,e=this.Rt.data.length-1;e>=0;e--)if(this.Rt.data[e].type===l.Meta){t=e;break}return t>=0?(this.Rt.data=this.Rt.data.slice(t),this.Rt.size=this.Rt.data.reduce(((t,e)=>t+yt(e)),0),this.Rt):this.Tt()}Tt(){return this.Rt={size:0,data:[],sessionId:this.X,windowId:this.St},this.Rt}Kt(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),se.info(t.replace("_"," "),e),-1===["recording_initialized","session_id_changed"].indexOf(t)&&this.vt(t,e)}ne(t){var e;return 3===t.type&&-1!==ae.indexOf(null==(e=t.data)?void 0:e.source)}Qt(t){var e=this.ne(t);e||this.rt||t.timestamp-this.tt>this.K&&(this.rt=!0,clearInterval(this.Vt),this.vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.tt,threshold:this.K,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size}),this.yt());var r=!1;if(e&&(this.tt=t.timestamp,this.rt)){var n="unknown"===this.rt;this.rt=!1,n||(this.vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.rt){var{windowId:i,sessionId:o}=this.J.checkAndGetSessionAndWindowId(!e,t.timestamp),s=this.X!==o,a=this.St!==i;this.St=i,this.X=o,s||a?(this.stop(),this.start("session_id_changed")):r&&this.Dt()}}ft(){var t,e,r;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(W),null==(e=this._instance)||null==(e=e.persistence)||e.unregister(L),null==(r=this._instance)||null==(r=r.persistence)||r.unregister(G)}gt(t){var e,r=this.X!==t,n=this.j;if(S(n)){var i=this.H,o=r||!A(i),s=o?ne(t,n):i;o&&(s?this.Kt(tt):se.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server."),this.vt("samplingDecisionMade",{sampleRate:n,isSampled:s})),null==(e=this._instance.persistence)||e.register({[G]:!!s&&t})}else{var a;null==(a=this._instance.persistence)||a.unregister(G)}}Ht(){0!==this.Nt.O.length&&w(this.ot)&&(this.ot=this._instance.on("eventCaptured",(t=>{try{this.Nt.O.includes(t.event)&&this.Jt("event")}catch(t){se.error("Could not activate event trigger",t)}})))}get sdkDebugProperties(){var{sessionStartTimestamp:t}=this.J.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_current_session_duration:this.ee,$sdk_debug_session_start:t}}jt(){var t;if(!this.$){var e,r,n,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},o=this._instance.config.session_recording;for(var[s,a]of Object.entries(o||{}))s in i&&("maskInputOptions"===s?i.maskInputOptions=u({password:!0},a):i[s]=a);if(this.Ft&&this.Ft.enabled&&(i.recordCanvas=!0,i.sampling={canvas:this.Ft.fps},i.dataURLOptions={type:"image/webp",quality:this.Ft.quality}),this.Mt)i.maskAllInputs=null===(e=this.Mt.maskAllInputs)||void 0===e||e,i.maskTextSelector=null!==(r=this.Mt.maskTextSelector)&&void 0!==r?r:void 0,i.blockSelector=null!==(n=this.Mt.blockSelector)&&void 0!==n?n:void 0;var l=le();if(l){this.Pt=null!==(t=this.Pt)&&void 0!==t?t:new re(l,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var r="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";se.info(r,{node:e}),this.log(oe+" "+r,"warn")}});var d=this.Ot();this.$=l(u({emit:t=>{this.onRRwebEmit(t)},plugins:d},i)),this.tt=Date.now(),this.rt=A(this.rt)?this.rt:"unknown",this.tryAddCustomEvent("$remote_config_received",this.U),this.vt("$session_options",{sessionRecordingOptions:i,activePlugins:d.map((t=>null==t?void 0:t.name))}),this.vt("$posthog_config",{config:this._instance.config})}else se.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.vt(t,e)}}var fe,me=["type"],pe=Object.defineProperty,ge=(t,e,r)=>((t,e,r)=>e in t?pe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ie=Object.defineProperty,ye=(t,e,r)=>((t,e,r)=>e in t?Ie(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),be=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(be||{}),Ce={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},we={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var Se={};function Ae(t){if(Se[t])return Se[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,n=t in Ce?Ce[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in we?we[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(i&&s)return Se[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?Se[t]=l:e.prototype}catch(t){return e.prototype}}var ke={};function Ne(t,e,r){var n,i=t+"."+String(r);if(ke[i])return ke[i].call(e);var o=Ae(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(ke[i]=s,s.call(e)):e[r]}var Re={};function Te(t,e,r){var n=t+"."+String(r);if(Re[n])return Re[n].bind(e);var i=Ae(t)[r];return"function"!=typeof i?e[r]:(Re[n]=i,i.bind(e))}var Me={childNodes:function(t){return Ne("Node",t,"childNodes")},parentNode:function(t){return Ne("Node",t,"parentNode")},parentElement:function(t){return Ne("Node",t,"parentElement")},textContent:function(t){return Ne("Node",t,"textContent")},contains:function(t,e){return Te("Node",t,"contains")(e)},getRootNode:function(t){return Te("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ne("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ne("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ne("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ne("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Ae("MutationObserver").constructor}};function Fe(t){return t.nodeType===t.ELEMENT_NODE}function _e(t){var e=t&&"host"in t&&"mode"in t&&Me.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Me.shadowRoot(e)===t)}function Be(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function Oe(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>xe(e,t.href))).join("");return(n=r).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}catch(t){return null}var n}function xe(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=Oe(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?Ke(r,t.styleSheet.href):r}var n,i=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(n,"$1\\$2")),e?Ke(i,e):i}function Ze(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let Ye=class{constructor(){ye(this,"idNodeMap",new Map),ye(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(e,n)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ee(t){var{element:e,maskInputOptions:r,tagName:n,type:i,value:o,maskInputFn:s}=t,a=o||"",u=i&&Ge(i);return(r[n.toLowerCase()]||u&&r[u])&&(a=s?s(a,e):"*".repeat(a.length)),a}function Ge(t){return t.toLowerCase()}var Le="__rrweb_original__";function We(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Ge(e):null}function De(t,e){var r,n;try{n=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}var Ve=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Xe=/^(?:[a-z+]+:)?\/\//i,ze=/^www\..*/i,Je=/^(data:)([^,]*),(.*)/i;function Ke(t,e){return(t||"").replace(Ve,((t,r,n,i,o,s)=>{var a,u=n||o||s,l=r||i||"";if(!u)return t;if(Xe.test(u)||ze.test(u))return"url("+l+u+l+")";if(Je.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var d=e.split("/"),c=u.split("/");for(var h of(d.pop(),c))"."!==h&&(".."===h?d.pop():d.push(h));return"url("+l+d.join("/")+l+")"}))}var He,je,Ue=1,Pe=new RegExp("[^a-z0-9-_:]"),qe=-2;function Qe(){return Ue++}var $e=/^[^ \t\n\r\u000c]+/,tr=/^[, \t\n\r\u000c]+/;var er=new WeakMap;function rr(t,e){return e&&""!==e.trim()?ir(t,e):e}function nr(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function ir(t,e){var r=er.get(t);if(r||(r=t.createElement("a"),er.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function or(t,e,r,n){return n?"src"===r||"href"===r&&("use"!==e||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?rr(t,n):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function n(t){var n,i=t.exec(e.substring(r));return i?(n=i[0],r+=n.length,n):""}for(var i=[];n(tr),!(r>=e.length);){var o=n($e);if(","===o.slice(-1))o=rr(t,o.substring(0,o.length-1)),i.push(o);else{var s="";o=rr(t,o);for(var a=!1;;){var u=e.charAt(r);if(""===u){i.push((o+s).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,i.push((o+s).trim());break}"("===u&&(a=!0)}s+=u,r+=1}}}return i.join(", ")}(t,n):"style"===r?Ke(n,ir(t)):"object"===e&&"data"===r?rr(t,n):n:rr(t,n):n}function sr(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function ar(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&ar(Me.parentNode(t),e,r);for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}return!!r&&ar(Me.parentNode(t),e,r)}function ur(t,e,r,n){var i;if(Fe(t)){if(i=t,!Me.childNodes(i).length)return!1}else{if(null===Me.parentElement(t))return!1;i=Me.parentElement(t)}try{if("string"==typeof e){if(n){if(i.closest("."+e))return!0}else if(i.classList.contains(e))return!0}else if(ar(i,e,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(t){}return!1}function lr(t,e){var{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:u={},maskTextFn:l,maskInputFn:d,dataURLOptions:c={},inlineImages:h,recordCanvas:v,keepIframeSrcFn:f,newlyAddedElement:m=!1}=e,p=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,n);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:be.Document,childNodes:[],compatMode:t.compatMode}:{type:be.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:be.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:p};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:u,dataURLOptions:l={},inlineImages:d,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:v=!1,rootId:f}=e,m=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,i,o),p=function(t){if(t instanceof HTMLFormElement)return"form";var e=Ge(t.tagName);return Pe.test(e)?"div":e}(t),g={},I=t.attributes.length,y=0;y0!==t)))return!1}return!0})(t)||(g.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){var R=t.toDataURL(l.type,l.quality),T=n.createElement("canvas");T.width=t.width,T.height=t.height,R!==T.toDataURL(l.type,l.quality)&&(g.rr_dataURL=R)}if("img"===p&&d){He||(He=n.createElement("canvas"),je=He.getContext("2d"));var M=t,F=M.currentSrc||M.getAttribute("src")||"",_=M.crossOrigin,B=()=>{M.removeEventListener("load",B);try{He.width=M.naturalWidth,He.height=M.naturalHeight,je.drawImage(M,0,0),g.rr_dataURL=He.toDataURL(l.type,l.quality)}catch(t){if("anonymous"!==M.crossOrigin)return M.crossOrigin="anonymous",void(M.complete&&0!==M.naturalWidth?B():M.addEventListener("load",B));console.warn("Cannot inline img src="+F+"! Error: "+t)}"anonymous"===M.crossOrigin&&(_?g.crossOrigin=_:M.removeAttribute("crossorigin"))};M.complete&&0!==M.naturalWidth?B():M.addEventListener("load",B)}if("audio"===p||"video"===p){var O=g;O.rr_mediaState=t.paused?"paused":"played",O.rr_mediaCurrentTime=t.currentTime,O.rr_mediaPlaybackRate=t.playbackRate,O.rr_mediaMuted=t.muted,O.rr_mediaLoop=t.loop,O.rr_mediaVolume=t.volume}v||(t.scrollLeft&&(g.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(g.rr_scrollTop=t.scrollTop));if(m){var{width:x,height:Z}=t.getBoundingClientRect();g={class:g.class,rr_width:x+"px",rr_height:Z+"px"}}"iframe"!==p||h(g.src)||(t.contentDocument||(g.rr_src=g.src),delete g.src);try{customElements.get(p)&&(r=!0)}catch(t){}return{type:be.Element,tagName:p,attributes:g,childNodes:[],isSVG:nr(t)||void 0,needBlock:m,rootId:f,isCustom:r}}(t,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:u,maskInputFn:d,dataURLOptions:c,inlineImages:h,recordCanvas:v,keepIframeSrcFn:f,newlyAddedElement:m,rootId:p});case t.TEXT_NODE:return function(t,e){var r,{needsMask:n,maskTextFn:i,rootId:o}=e,s=Me.parentNode(t),a=s&&s.tagName,u=Me.textContent(t),l="STYLE"===a||void 0,d="SCRIPT"===a||void 0;if(l&&u){try{t.nextSibling||t.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(u=Oe(s.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=Ke(u,ir(e.doc))}d&&(u="SCRIPT_PLACEHOLDER");!l&&!d&&u&&n&&(u=i?i(u,Me.parentElement(t)):u.replace(/[\S]/g,"*"));return{type:be.Text,textContent:u||"",isStyle:l,rootId:o}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:p});case t.CDATA_SECTION_NODE:return{type:be.CDATA,textContent:"",rootId:p};case t.COMMENT_NODE:return{type:be.Comment,textContent:Me.textContent(t)||"",rootId:p};default:return!1}}function dr(t){return null==t?"":t.toLowerCase()}function cr(t,e){var{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:d={},maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:p=!1,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:w=(()=>!1),newlyAddedElement:S=!1}=e,{needsMask:A}=e,{preserveWhiteSpace:k=!0}=e;A||(A=ur(t,s,a,void 0===A));var N,R=lr(t,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:A,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,dataURLOptions:f,inlineImages:m,recordCanvas:p,keepIframeSrcFn:w,newlyAddedElement:S});if(!R)return console.warn(t,"not serialized"),null;N=n.hasNode(t)?n.getId(t):!function(t,e){if(e.comment&&t.type===be.Comment)return!0;if(t.type===be.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===De(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(dr(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===dr(t.attributes.name)||"icon"===dr(t.attributes.rel)||"apple-touch-icon"===dr(t.attributes.rel)||"shortcut icon"===dr(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&dr(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(dr(t.attributes.property).match(/^(og|twitter|fb):/)||dr(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===dr(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===dr(t.attributes.name)||"googlebot"===dr(t.attributes.name)||"bingbot"===dr(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===dr(t.attributes.name)||"generator"===dr(t.attributes.name)||"framework"===dr(t.attributes.name)||"publisher"===dr(t.attributes.name)||"progid"===dr(t.attributes.name)||dr(t.attributes.property).match(/^article:/)||dr(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===dr(t.attributes.name)||"yandex-verification"===dr(t.attributes.name)||"csrf-token"===dr(t.attributes.name)||"p:domain_verify"===dr(t.attributes.name)||"verify-v1"===dr(t.attributes.name)||"verification"===dr(t.attributes.name)||"shopify-checkout-api-token"===dr(t.attributes.name)))return!0}}return!1}(R,v)&&(k||R.type!==be.Text||R.isStyle||R.textContent.replace(/^\s+|\s+$/gm,"").length)?Qe():qe;var T=Object.assign(R,{id:N});if(n.add(t,T),N===qe)return null;g&&g(t);var M=!u;if(T.type===be.Element){M=M&&!T.needBlock,delete T.needBlock;var F=Me.shadowRoot(t);F&&Be(F)&&(T.isShadowHost=!0)}if((T.type===be.Document||T.type===be.Element)&&M){v.headWhitespace&&T.type===be.Element&&"head"===T.tagName&&(k=!1);var _={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:A,maskTextClass:s,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:k,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w};if(T.type===be.Element&&"textarea"===T.tagName&&void 0!==T.attributes.value);else for(var B of Array.from(Me.childNodes(t))){var O=cr(B,_);O&&T.childNodes.push(O)}var x=null;if(Fe(t)&&(x=Me.shadowRoot(t)))for(var Z of Array.from(Me.childNodes(x))){var Y=cr(Z,_);Y&&(Be(x)&&(Y.isShadow=!0),T.childNodes.push(Y))}}var E=Me.parentNode(t);return E&&_e(E)&&Be(E)&&(T.isShadow=!0),T.type===be.Element&&"iframe"===T.tagName&&function(t,e,r){var n=t.contentWindow;if(n){var i,o=!1;try{i=n.document.readyState}catch(t){return}if("complete"===i){var s="about:blank";if(n.location.href!==s||t.src===s||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{o||(e(),o=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),o=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=cr(e,{doc:e,mirror:n,blockClass:i,blockSelector:o,needsMask:A,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:k,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w});r&&I(t,r)}}),y),T.type===be.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===De(T.attributes.href))&&function(t,e,r){var n,i=!1;try{n=t.sheet}catch(t){return}if(!n){var o=setTimeout((()=>{i||(e(),i=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),i=!0,e()}))}}(t,(()=>{if(b){var e=cr(t,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:A,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:k,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w});e&&b(t,e)}}),C),T}let hr=class t{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var vr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},fr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var mr={};function pr(t){if(mr[t])return mr[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,n=t in vr?vr[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in fr?fr[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(i&&s)return mr[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?mr[t]=l:r}catch(t){return r}}var gr={};function Ir(t,e,r){var n,i=t+"."+String(r);if(gr[i])return gr[i].call(e);var o=pr(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(gr[i]=s,s.call(e)):e[r]}var yr={};function br(t,e,r){var n=t+"."+String(r);if(yr[n])return yr[n].bind(e);var i=pr(t)[r];return"function"!=typeof i?e[r]:(yr[n]=i,i.bind(e))}function Cr(){return pr("MutationObserver").constructor}var wr={childNodes:function(t){return Ir("Node",t,"childNodes")},parentNode:function(t){return Ir("Node",t,"parentNode")},parentElement:function(t){return Ir("Node",t,"parentElement")},textContent:function(t){return Ir("Node",t,"textContent")},contains:function(t,e){return br("Node",t,"contains")(e)},getRootNode:function(t){return br("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ir("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ir("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ir("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ir("Element",t,"querySelectorAll")(e)},mutationObserver:Cr};function Sr(t,e,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}var Ar="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",kr={map:{},getId:()=>(console.error(Ar),-1),getNode:()=>(console.error(Ar),null),removeNodeFromMap(){console.error(Ar)},has:()=>(console.error(Ar),!1),reset(){console.error(Ar)}};function Nr(t,e,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;ae?(n&&(clearTimeout(n),n=null),i=u,t.apply(d,s)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,t.apply(d,s)}),l))}}function Rr(t,e,r,n,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,n?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>Rr(t,e,o||{},!0)}function Tr(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),t[e]=i,()=>{t[e]=n}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(kr=new Proxy(kr,{get:(t,e,r)=>("map"===e&&console.error(Ar),Reflect.get(t,e,r))}));var Mr=Date.now;function Fr(t){var e,r,n,i,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=wr.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=wr.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function _r(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Br(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Or(t){return t?t.nodeType===t.ELEMENT_NODE?t:wr.parentElement(t):null}function xr(t,e,r,n){if(!t)return!1;var i=Or(t);if(!i)return!1;try{if("string"==typeof e){if(i.classList.contains(e))return!0;if(n&&null!==i.closest("."+e))return!0}else if(ar(i,e,n))return!0}catch(t){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function Zr(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===qe}function Yr(t,e){if(_e(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var n=wr.parentNode(t);return(!n||n.nodeType!==t.DOCUMENT_NODE)&&(!n||Yr(n,e))}function Er(t){return Boolean(t.changedTouches)}function Gr(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Lr(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Wr(t){return!!t&&(t instanceof hr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(wr.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Mr=()=>(new Date).getTime());let Dr=class{constructor(){ge(this,"id",1),ge(this,"styleIDMap",new WeakMap),ge(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Vr(t){var e,r=null;return"getRootNode"in t&&(null==(e=wr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&wr.host(wr.getRootNode(t))&&(r=wr.host(wr.getRootNode(t))),r}function Xr(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Vr(r);)r=e;return r}(t);return wr.contains(e,r)}function zr(t){var e=t.ownerDocument;return!!e&&(wr.contains(e,t)||Xr(t))}var Jr=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Jr||{}),Kr=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Kr||{}),Hr=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Hr||{}),jr=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(jr||{}),Ur=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Ur||{}),Pr=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(Pr||{});function qr(t){return"__ln"in t}class Qr{constructor(){ge(this,"length",0),ge(this,"head",null),ge(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;rt+"@"+e;class en{constructor(){ge(this,"frozen",!1),ge(this,"locked",!1),ge(this,"texts",[]),ge(this,"attributes",[]),ge(this,"attributeMap",new WeakMap),ge(this,"removes",[]),ge(this,"mapRemoves",[]),ge(this,"movedMap",{}),ge(this,"addedSet",new Set),ge(this,"movedSet",new Set),ge(this,"droppedSet",new Set),ge(this,"mutationCb"),ge(this,"blockClass"),ge(this,"blockSelector"),ge(this,"maskTextClass"),ge(this,"maskTextSelector"),ge(this,"inlineStylesheet"),ge(this,"maskInputOptions"),ge(this,"maskTextFn"),ge(this,"maskInputFn"),ge(this,"keepIframeSrcFn"),ge(this,"recordCanvas"),ge(this,"inlineImages"),ge(this,"slimDOMOptions"),ge(this,"dataURLOptions"),ge(this,"doc"),ge(this,"mirror"),ge(this,"iframeManager"),ge(this,"stylesheetManager"),ge(this,"shadowDomManager"),ge(this,"canvasManager"),ge(this,"processedNodeManager"),ge(this,"unattachedDoc"),ge(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),ge(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Qr,n=t=>{for(var e=t,r=qe;r===qe;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},i=i=>{var o=wr.parentNode(i);if(o&&zr(i)&&"TEXTAREA"!==o.tagName){var s=_e(o)?this.mirror.getId(Vr(i)):this.mirror.getId(o),a=n(i);if(-1===s||-1===a)return r.addNode(i);var u=cr(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{Gr(t,this.mirror)&&this.iframeManager.addIframe(t),Lr(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Wr(i)&&this.shadowDomManager.addShadowRoot(wr.shadowRoot(i),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:s,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)nn(this.removes,o,this.mirror)&&!this.movedSet.has(wr.parentNode(o))||i(o);for(var s of this.addedSet)on(this.droppedSet,s)||nn(this.removes,s,this.mirror)?on(this.movedSet,s)?i(s):this.droppedSet.add(s):i(s);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(wr.parentNode(a.value)),d=n(a.value);-1!==l&&-1!==d&&(u=a)}if(!u)for(var c=r.tail;c;){var h=c;if(c=c.previous,h){var v=this.mirror.getId(wr.parentNode(h.value));if(-1===n(h.value))continue;if(-1!==v){u=h;break}var f=h.value,m=wr.parentNode(f);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=wr.host(m);if(-1!==this.mirror.getId(p)){u=h;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),i(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=wr.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),n=JSON.stringify(t._unchangedStyles);r.length!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(g))}})),ge(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(wr.childNodes(t),(t=>wr.textContent(t)||"")).join("")})),ge(this,"processMutation",(t=>{if(!Zr(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=wr.textContent(t.target);xr(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:ur(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Or(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,n=t.attributeName,i=t.target.getAttribute(n);if("value"===n){var o=We(r);i=Ee({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(xr(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;var s=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(r.contentDocument)return;n="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),"type"===n&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!sr(r.tagName,n))if(s.attributes[n]=or(this.doc,Ge(r.tagName),Ge(n),i),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),d=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||d!==a.style.getPropertyPriority(u)?s.styleDiff[u]=""===d?l:[l,d]:s._unchangedStyles[u]=[l,d]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(s.styleDiff[c]=!1)}else"open"===n&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(xr(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),n=_e(t.target)?this.mirror.getId(wr.host(t.target)):this.mirror.getId(t.target);xr(t.target,this.blockClass,this.blockSelector,!1)||Zr(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(rn(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Yr(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[tn(r,n)]?rn(this.movedSet,e):this.removes.push({parentId:n,id:r,isShadow:!(!_e(t.target)||!Be(t.target))||void 0})),this.mapRemoves.push(e))}))}})),ge(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Zr(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[tn(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);xr(t,this.blockClass,this.blockSelector,!1)||(wr.childNodes(t).forEach((t=>this.genAdds(t))),Wr(t)&&wr.childNodes(wr.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}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 rn(t,e){t.delete(e),wr.childNodes(e).forEach((e=>rn(t,e)))}function nn(t,e,r){return 0!==t.length&&function(t,e,r){var n,i=wr.parentNode(e),o=function(){var e=r.getId(i);if(t.some((t=>t.id===e)))return{v:!0};i=wr.parentNode(i)};for(;i;)if(n=o())return n.v;return!1}(t,e,r)}function on(t,e){return 0!==t.size&&sn(t,e)}function sn(t,e){var r=wr.parentNode(e);return!!r&&(!!t.has(r)||sn(t,r))}var an=t=>{if(!$r)return t;return function(){try{return t(...arguments)}catch(t){if($r&&!0===$r(t))return;throw t}}},un=[];function ln(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function dn(t,e){var r=new en;un.push(r),r.init(t);var n=new(Cr())(an(r.processMutations.bind(r)));return n.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function cn(t){var{mouseInteractionCb:e,doc:r,mirror:n,blockClass:i,blockSelector:o,sampling:s}=t;if(!1===s.mouseInteraction)return()=>{};var a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[],d=null;return Object.keys(Hr).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t])).forEach((t=>{var s=Ge(t),a=(t=>r=>{var s=ln(r);if(!xr(s,i,o,!0)){var a=null,l=t;if("pointerType"in r){switch(r.pointerType){case"mouse":a=jr.Mouse;break;case"touch":a=jr.Touch;break;case"pen":a=jr.Pen}a===jr.Touch?Hr[t]===Hr.MouseDown?l="TouchStart":Hr[t]===Hr.MouseUp&&(l="TouchEnd"):jr.Pen}else Er(r)&&(a=jr.Touch);null!==a?(d=a,(l.startsWith("Touch")&&a===jr.Touch||l.startsWith("Mouse")&&a===jr.Mouse)&&(a=null)):Hr[t]===Hr.Click&&(a=d,d=null);var c=Er(r)?r.changedTouches[0]:r;if(c){var h=n.getId(s),{clientX:v,clientY:f}=c;an(e)(u({type:Hr[l],id:h,x:v,y:f},null!==a&&{pointerType:a}))}}})(t);if(window.PointerEvent)switch(Hr[t]){case Hr.MouseDown:case Hr.MouseUp:s=s.replace("mouse","pointer");break;case Hr.TouchStart:case Hr.TouchEnd:return}l.push(Sr(s,a,r))})),an((()=>{l.forEach((t=>t()))}))}function hn(t){var{scrollCb:e,doc:r,mirror:n,blockClass:i,blockSelector:o,sampling:s}=t;return Sr("scroll",an(Nr(an((t=>{var s=ln(t);if(s&&!xr(s,i,o,!0)){var a=n.getId(s);if(s===r&&r.defaultView){var u=Fr(r.defaultView);e({id:a,x:u.left,y:u.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var vn=["INPUT","TEXTAREA","SELECT"],fn=new WeakMap;function mn(t){return function(t,e){if(yn("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||yn("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||yn("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||yn("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(n)}return e}(t,[])}function pn(t,e,r){var n,i;return t?(t.ownerNode?n=e.getId(t.ownerNode):i=r.getId(t),{styleId:i,id:n}):{}}function gn(t,e){var r,n,i,{mirror:o,stylesheetManager:s}=t,a=null;a="#document"===e.nodeName?o.getId(e):o.getId(wr.host(e));var u="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(i=null==(n=e.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{s.adoptStyleSheets(t,a)}catch(t){}return r}}),an((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function In(t,e){void 0===e&&(e={});var r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:d,canvasMutationCb:c,fontCb:h,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),n(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),i(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),o(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),s(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),d(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),h(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(r=dn(t,t.doc));var i=function(t){var{mousemoveCb:e,sampling:r,doc:n,mirror:i}=t;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=Nr(an((t=>{var r=Date.now()-o;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],o=null})),a),d=an(Nr(an((t=>{var e=ln(t),{clientX:r,clientY:n}=Er(t)?t.changedTouches[0]:t;o||(o=Mr()),u.push({x:r,y:n,id:i.getId(e),timeOffset:Mr()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Kr.Drag:t instanceof MouseEvent?Kr.MouseMove:Kr.TouchMove)})),s,{trailing:!1})),c=[Sr("mousemove",d,n),Sr("touchmove",d,n),Sr("drag",d,n)];return an((()=>{c.forEach((t=>t()))}))}(t),o=cn(t),s=hn(t),a=function(t,e){var{viewportResizeCb:r}=t,{win:n}=e,i=-1,o=-1;return Sr("resize",an(Nr(an((()=>{var t=_r(),e=Br();i===t&&o===e||(r({width:Number(e),height:Number(t)}),i=t,o=e)})),200)),n)}(t,{win:n}),l=function(t){var{inputCb:e,doc:r,mirror:n,blockClass:i,blockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:d,sampling:c,userTriggeredOnInput:h}=t;function v(t){var e=ln(t),n=t.isTrusted,u=e&&e.tagName;if(e&&"OPTION"===u&&(e=wr.parentElement(e)),e&&u&&!(vn.indexOf(u)<0)&&!xr(e,i,o,!0)&&!(e.classList.contains(s)||a&&e.matches(a))){var c=e.value,v=!1,m=We(e)||"";"radio"===m||"checkbox"===m?v=e.checked:(l[u.toLowerCase()]||l[m])&&(c=Ee({element:e,maskInputOptions:l,tagName:u,type:m,value:c,maskInputFn:d})),f(e,h?{text:c,isChecked:v,userTriggered:n}:{text:c,isChecked:v});var p=e.name;"radio"===m&&p&&v&&r.querySelectorAll('input[type="radio"][name="'+p+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,h?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,r){var i=fn.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){fn.set(t,r);var o=n.getId(t);an(e)(u({},r,{id:o}))}}var m=("last"===c.input?["change"]:["input","change"]).map((t=>Sr(t,an(v),r))),p=r.defaultView;if(!p)return()=>{m.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),I=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...I.map((t=>Rr(t[0],t[1],{set(){an(v)({target:this,isTrusted:!1})}},!1,p)))),an((()=>{m.forEach((t=>t()))}))}(t),d=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:n,mirror:i,sampling:o,doc:s}=t,a=an((t=>Nr(an((o=>{var s=ln(o);if(s&&!xr(s,r,n,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:d,loop:c}=s;e({type:t,id:i.getId(s),currentTime:a,volume:u,muted:l,playbackRate:d,loop:c})}})),o.media||500))),u=[Sr("play",a(Pr.Play),s),Sr("pause",a(Pr.Pause),s),Sr("seeked",a(Pr.Seeked),s),Sr("volumechange",a(Pr.VolumeChange),s),Sr("ratechange",a(Pr.RateChange),s)];return an((()=>{u.forEach((t=>t()))}))}(t),c=()=>{},h=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:n,stylesheetManager:i}=t,{win:o}=e;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:an(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=pn(e,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:a}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var n=t+" { "+e+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};var a,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:an(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=pn(e,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:s}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(t){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:an(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=pn(e,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replace:s}),t.apply(e,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:an(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=pn(e,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:s}),t.apply(e,o)}))}));var d={};bn("CSSGroupingRule")?d.CSSGroupingRule=o.CSSGroupingRule:(bn("CSSMediaRule")&&(d.CSSMediaRule=o.CSSMediaRule),bn("CSSConditionRule")&&(d.CSSConditionRule=o.CSSConditionRule),bn("CSSSupportsRule")&&(d.CSSSupportsRule=o.CSSSupportsRule));var c={};return Object.entries(d).forEach((t=>{var[e,o]=t;c[e]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[e].insertRule,{apply:an(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=pn(e.parentStyleSheet,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:[...mn(e),a||0]}]}),t.apply(e,o)}))}),o.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:an(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=pn(e.parentStyleSheet,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...mn(e),s]}]}),t.apply(e,o)}))})})),an((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=l,a&&(o.CSSStyleSheet.prototype.replace=a),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n}),h=gn(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:n,ignoreCSSAttributes:i,stylesheetManager:o}=t,{win:s}=e,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:an(((t,e,s)=>{var u,[l,d,c]=s;if(i.has(l))return a.apply(e,[l,d,c]);var{id:h,styleId:v}=pn(null==(u=e.parentRule)?void 0:u.parentStyleSheet,n,o.styleMirror);return(h&&-1!==h||v&&-1!==v)&&r({id:h,styleId:v,set:{property:l,value:d,priority:c},index:mn(e.parentRule)}),t.apply(e,s)}))});var u=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:an(((t,e,s)=>{var a,[l]=s;if(i.has(l))return u.apply(e,[l]);var{id:d,styleId:c}=pn(null==(a=e.parentRule)?void 0:a.parentStyleSheet,n,o.styleMirror);return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:l},index:mn(e.parentRule)}),t.apply(e,s)}))}),an((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,n=r.defaultView;if(!n)return()=>{};var i=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(t,e,r){var n=new s(t,e,r);return o.set(n,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),n};var a=Tr(r.fonts,"add",(function(t){return function(r){return setTimeout(an((()=>{var t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return i.push((()=>{n.FontFace=s})),i.push(a),an((()=>{i.forEach((t=>t()))}))}(t)));var m=function(t){var{doc:e,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=t,s=!0,a=an((()=>{var t=e.getSelection();if(!(!t||s&&(null==t?void 0:t.isCollapsed))){s=t.isCollapsed||!1;for(var a=[],u=t.rangeCount||0,l=0;l{}}(t),g=[];for(var I of t.plugins)g.push(I.observer(I.callback,n,I.options));return an((()=>{un.forEach((t=>t.reset())),null==r||r.disconnect(),i(),o(),s(),a(),l(),d(),c(),h(),v(),f(),m(),p(),g.forEach((t=>t()))}))}function yn(t){return void 0!==window[t]}function bn(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Cn{constructor(t){ge(this,"iframeIdToRemoteIdMap",new WeakMap),ge(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,n){var i=r||this.getIdToRemoteIdMap(t),o=n||this.getRemoteIdToIdMap(t),s=i.get(e);return s||(s=this.generateIdFn(),i.set(e,s),o.set(s,e)),s}getIds(t,e){var r=this.getIdToRemoteIdMap(t),n=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,n)))}getRemoteId(t,e,r){var n=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var i=n.get(e);return i||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class wn{constructor(t){ge(this,"iframes",new WeakMap),ge(this,"crossOriginIframeMap",new WeakMap),ge(this,"crossOriginIframeMirror",new Cn(Qe)),ge(this,"crossOriginIframeStyleMirror"),ge(this,"crossOriginIframeRootIdMap",new WeakMap),ge(this,"mirror"),ge(this,"mutationCb"),ge(this,"wrappedEmit"),ge(this,"loadListener"),ge(this,"stylesheetManager"),ge(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Cn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var n=this.transformCrossOriginEvent(r,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case Jr.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),{timestamp:e.timestamp,type:Jr.IncrementalSnapshot,data:{source:Kr.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Jr.Meta:case Jr.Load:case Jr.DomContentLoaded:return!1;case Jr.Plugin:return e;case Jr.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Jr.IncrementalSnapshot:switch(e.data.source){case Kr.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Kr.Drag:case Kr.TouchMove:case Kr.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Kr.ViewportResize:return!1;case Kr.MediaInteraction:case Kr.MouseInteraction:case Kr.Scroll:case Kr.CanvasMutation:case Kr.Input:return this.replaceIds(e.data,t,["id"]),e;case Kr.StyleSheetRule:case Kr.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Kr.Font:return e;case Kr.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Kr.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,n){for(var i of n)(Array.isArray(e[i])||"number"==typeof e[i])&&(Array.isArray(e[i])?e[i]=t.getIds(r,e[i]):e[i]=t.getId(r,e[i]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===be.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class Sn{constructor(t){ge(this,"shadowDoms",new WeakSet),ge(this,"mutationCb"),ge(this,"scrollCb"),ge(this,"bypassOptions"),ge(this,"mirror"),ge(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(Be(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var r=dn(u({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(hn(u({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(wr.host(t))),this.restoreHandlers.push(gn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push(Tr(t.prototype,"attachShadow",(function(t){return function(n){var i=t.call(this,n),o=wr.shadowRoot(this);return o&&zr(this)&&r.addShadowRoot(o,e),i}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var An="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Nn=0;Nn<64;Nn++)kn[An.charCodeAt(Nn)]=Nn;var Rn=new Map;var Tn=(t,e,r)=>{if(t&&(_n(t,e)||"object"==typeof t)){var n=function(t,e){var r=Rn.get(t);return r||(r=new Map,Rn.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),i=n.indexOf(t);return-1===i&&(i=n.length,n.push(t)),i}};function Mn(t,e,r){if(t instanceof Array)return t.map((t=>Mn(t,e,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,r=new Uint8Array(t),n=r.length,i="";for(e=0;e>2],i+=An[(3&r[e])<<4|r[e+1]>>4],i+=An[(15&r[e+1])<<2|r[e+2]>>6],i+=An[63&r[e+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Mn(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var n=t.constructor.name,{src:i}=t;return{rr_type:n,src:i}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[Mn(t.data,e,r),t.width,t.height]}:_n(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Tn(t,e,r)}:t}var Fn=(t,e,r)=>t.map((t=>Mn(t,e,r))),_n=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Bn(t,e,r,n){var i=[];try{var o=Tr(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a{i.forEach((t=>t()))}}function On(t,e,r,n,i,o){var s=[],a=Object.getOwnPropertyNames(t),u=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var u=Tr(t,a,(function(t){return function(){for(var s=arguments.length,u=new Array(s),l=0;lt.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Wn(t){var e;try{if(!(e=Ln&&(window.URL||window.webkitURL).createObjectURL(Ln)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+Gn,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Dn{constructor(t){ge(this,"pendingCanvasMutations",new Map),ge(this,"rafStamps",{latestId:0,invokeId:null}),ge(this,"mirror"),ge(this,"mutationCb"),ge(this,"resetObservers"),ge(this,"frozen",!1),ge(this,"locked",!1),ge(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win:r,blockClass:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,n,i,{dataURLOptions:s})}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(t,e,r,n,i){var o=this,s=Bn(e,r,n,!0),u=new Map,l=new Wn;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:n,width:i,height:o}=t.data;this.mutationCb({id:e,type:Ur["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})}};var d,c=1e3/t,h=0,v=t=>{var s,f;h&&t-h{t.querySelectorAll("canvas").forEach((t=>{xr(t,r,n,!0)||s.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(e.document),s).forEach(function(){var t=a((function*(t){var e,r=o.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){if(u.set(r,!0),["webgl","webgl2"].includes(t.__context)){var n=t.getContext(t.__context);!1===(null==(e=null==n?void 0:n.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var s=t.clientWidth||t.width,a=t.clientHeight||t.height,d=yield createImageBitmap(t,{resizeWidth:s,resizeHeight:a});l.postMessage({id:r,bitmap:d,width:s,height:a,dataURLOptions:i.dataURLOptions},[d])}}));return function(e){return t.apply(this,arguments)}}()),d=requestAnimationFrame(v))};d=requestAnimationFrame(v),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Bn(t,e,r,!1),i=function(t,e,r,n){var i=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=Tr(e.CanvasRenderingContext2D.prototype,o,(function(i){return function(){for(var s=arguments.length,a=new Array(s),u=0;u{var r=Fn(a,e,this);t(this.canvas,{type:Ur["2D"],property:o,args:r})}),0),i.apply(this,a)}}));i.push(s)}catch(r){var a=Rr(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:Ur["2D"],property:o,args:[e],setter:!0})}});i.push(a)}};for(var a of o)s(a);return()=>{i.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),o=function(t,e,r,n){var i=[];return i.push(...On(e.WebGLRenderingContext.prototype,Ur.WebGL,t,r,n,e)),void 0!==e.WebGL2RenderingContext&&i.push(...On(e.WebGL2RenderingContext.prototype,Ur.WebGL2,t,r,n,e)),()=>{i.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{n(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>{var e=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,me);return e})),{type:i}=r[0];this.mutationCb({id:e,type:i,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Vn{constructor(t){ge(this,"trackedLinkElements",new WeakSet),ge(this,"mutationCb"),ge(this,"adoptedStyleSheetCb"),ge(this,"styleMirror",new Dr),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var n={id:e,styleIds:[]},i=[],o=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),i.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:xe(e,t.href),index:r})))})),n.styleIds.push(e)};for(var s of t)o(s);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Xn{constructor(){ge(this,"nodeMap",new WeakMap),ge(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var zn=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Jn=document.createElement("iframe");document.body.appendChild(Jn),Array.from=(null==(fe=Jn.contentWindow)?void 0:fe.Array.from)||Array.from,document.body.removeChild(Jn)}}catch(t){console.debug("Unable to override Array.from",t)}var Kn,Hn,jn=new Ye;function Un(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:d=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:v,slimDOMOptions:f,maskInputFn:m,maskTextFn:p,hooks:g,packFn:I,sampling:y={},dataURLOptions:b={},mousemoveWait:C,recordDOM:w=!0,recordCanvas:S=!1,recordCrossOriginIframes:A=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:N=!1,collectFonts:R=!1,inlineImages:T=!1,plugins:M,keepIframeSrcFn:F=(()=>!1),ignoreCSSAttributes:_=new Set([]),errorHandler:B}=t;$r=B;var O=!A||window.parent===window,x=!1;if(!O)try{window.parent.document&&(x=!1)}catch(t){x=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!x)return()=>{};void 0!==C&&void 0===y.mousemove&&(y.mousemove=C),jn.reset();var Z,Y=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==v?v:{password:!0},E=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var G=0,L=t=>{for(var e of M||[])e.eventProcessor&&(t=e.eventProcessor(t));return I&&!x&&(t=I(t)),t};Zn=(t,i)=>{var o,s=t;if(s.timestamp=Mr(),!(null==(o=un[0])?void 0:o.isFrozen())||s.type===Jr.FullSnapshot||s.type===Jr.IncrementalSnapshot&&s.data.source===Kr.Mutation||un.forEach((t=>t.unfreeze())),O)null==e||e(L(s),i);else if(x){var a={type:"rrweb",event:L(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(s.type===Jr.FullSnapshot)Z=s,G=0;else if(s.type===Jr.IncrementalSnapshot){if(s.data.source===Kr.Mutation&&s.data.isAttachIframe)return;G++;var u=n&&G>=n,l=r&&s.timestamp-Z.timestamp>r;(u||l)&&Yn(!0)}};var W=t=>{Zn({type:Jr.IncrementalSnapshot,data:u({source:Kr.Mutation},t)})},D=t=>Zn({type:Jr.IncrementalSnapshot,data:u({source:Kr.Scroll},t)}),V=t=>Zn({type:Jr.IncrementalSnapshot,data:u({source:Kr.CanvasMutation},t)}),X=new Vn({mutationCb:W,adoptedStyleSheetCb:t=>Zn({type:Jr.IncrementalSnapshot,data:u({source:Kr.AdoptedStyleSheet},t)})}),z=new wn({mirror:jn,mutationCb:W,stylesheetManager:X,recordCrossOriginIframes:A,wrappedEmit:Zn});for(var J of M||[])J.getMirror&&J.getMirror({nodeMirror:jn,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});var K=new Xn;En=new Dn({recordCanvas:S,mutationCb:V,win:window,blockClass:i,blockSelector:o,mirror:jn,sampling:y.canvas,dataURLOptions:b});var H=new Sn({mutationCb:W,scrollCb:D,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:d,inlineStylesheet:c,maskInputOptions:Y,dataURLOptions:b,maskTextFn:p,maskInputFn:m,recordCanvas:S,inlineImages:T,sampling:y,slimDOMOptions:E,iframeManager:z,stylesheetManager:X,canvasManager:En,keepIframeSrcFn:F,processedNodeManager:K},mirror:jn});Yn=function(t){if(void 0===t&&(t=!1),w){Zn({type:Jr.Meta,data:{href:window.location.href,width:Br(),height:_r()}},t),X.reset(),H.init(),un.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new Ye,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:d=!1,maskTextFn:c,maskInputFn:h,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:p,onIframeLoad:g,iframeLoadTimeout:I,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:C=(()=>!1)}=e||{};return cr(t,{doc:t,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===d?{password:!0}:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:u,recordCanvas:l,preserveWhiteSpace:m,onSerialize:p,onIframeLoad:g,iframeLoadTimeout:I,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:C,newlyAddedElement:!1})}(document,{mirror:jn,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:d,inlineStylesheet:c,maskAllInputs:Y,maskTextFn:p,maskInputFn:m,slimDOM:E,dataURLOptions:b,recordCanvas:S,inlineImages:T,onSerialize:t=>{Gr(t,jn)&&z.addIframe(t),Lr(t,jn)&&X.trackLinkElement(t),Wr(t)&&H.addShadowRoot(wr.shadowRoot(t),document)},onIframeLoad:(t,e)=>{z.attachIframe(t,e),H.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{X.attachLinkElement(t,e)},keepIframeSrcFn:F});if(!e)return console.warn("Failed to snapshot the document");Zn({type:Jr.FullSnapshot,data:{node:e,initialOffset:Fr(window)}},t),un.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,jn.getId(document))}};try{var j=[],U=t=>{var e;return an(In)({mutationCb:W,mousemoveCb:(t,e)=>Zn({type:Jr.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Zn({type:Jr.IncrementalSnapshot,data:u({source:Kr.MouseInteraction},t)}),scrollCb:D,viewportResizeCb:t=>Zn({type:Jr.IncrementalSnapshot,data:u({source:Kr.ViewportResize},t)}),inputCb:t=>Zn({type:Jr.IncrementalSnapshot,data:u({source:Kr.Input},t)}),mediaInteractionCb:t=>Zn({type:Jr.IncrementalSnapshot,data:u({source:Kr.MediaInteraction},t)}),styleSheetRuleCb:t=>Zn({type:Jr.IncrementalSnapshot,data:u({source:Kr.StyleSheetRule},t)}),styleDeclarationCb:t=>Zn({type:Jr.IncrementalSnapshot,data:u({source:Kr.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>Zn({type:Jr.IncrementalSnapshot,data:u({source:Kr.Font},t)}),selectionCb:t=>{Zn({type:Jr.IncrementalSnapshot,data:u({source:Kr.Selection},t)})},customElementCb:t=>{Zn({type:Jr.IncrementalSnapshot,data:u({source:Kr.CustomElement},t)})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:d,maskInputOptions:Y,inlineStylesheet:c,sampling:y,recordDOM:w,recordCanvas:S,inlineImages:T,userTriggeredOnInput:N,collectFonts:R,doc:t,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:F,blockSelector:o,slimDOMOptions:E,dataURLOptions:b,mirror:jn,iframeManager:z,stylesheetManager:X,shadowDomManager:H,processedNodeManager:K,canvasManager:En,ignoreCSSAttributes:_,plugins:(null==(e=null==M?void 0:M.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>Zn({type:Jr.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},g)};z.addLoadListener((t=>{try{j.push(U(t.contentDocument))}catch(t){console.warn(t)}}));var P=()=>{Yn(),j.push(U(document)),zn=!0};return"interactive"===document.readyState||"complete"===document.readyState?P():(j.push(Sr("DOMContentLoaded",(()=>{Zn({type:Jr.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&P()}))),j.push(Sr("load",(()=>{Zn({type:Jr.Load,data:{}}),"load"===k&&P()}),window))),()=>{j.forEach((t=>t())),K.destroy(),zn=!1,$r=void 0}}catch(t){console.warn(t)}}Un.addCustomEvent=(t,e)=>{if(!zn)throw new Error("please add custom event after start recording");Zn({type:Jr.Custom,data:{tag:t,payload:e}})},Un.freezePage=()=>{un.forEach((t=>t.freeze()))},Un.takeFullSnapshot=t=>{if(!zn)throw new Error("please take full snapshot after start recording");Yn(t)},Un.mirror=jn,(Hn=Kn||(Kn={}))[Hn.NotStarted=0]="NotStarted",Hn[Hn.Running=1]="Running",Hn[Hn.Stopped=2]="Stopped";var Pn,qn=Object.defineProperty,Qn=(t,e,r)=>((t,e,r)=>e in t?qn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),$n=Object.defineProperty,ti=(t,e,r)=>((t,e,r)=>e in t?$n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ei=Object.defineProperty,ri=(t,e,r)=>((t,e,r)=>e in t?ei(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ni={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ii={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},oi={};function si(t){if(oi[t])return oi[t];var e=globalThis[t],r=e.prototype,n=t in ni?ni[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in ii?ii[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(i&&s)return oi[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?oi[t]=l:r}catch(t){return r}}var ai={};function ui(t,e,r){var n,i=t+"."+String(r);if(ai[i])return ai[i].call(e);var o=si(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(ai[i]=s,s.call(e)):e[r]}var li={};function di(t,e,r){var n=t+"."+String(r);if(li[n])return li[n].bind(e);var i=si(t)[r];return"function"!=typeof i?e[r]:(li[n]=i,i.bind(e))}var ci={childNodes:function(t){return ui("Node",t,"childNodes")},parentNode:function(t){return ui("Node",t,"parentNode")},parentElement:function(t){return ui("Node",t,"parentElement")},textContent:function(t){return ui("Node",t,"textContent")},contains:function(t,e){return di("Node",t,"contains")(e)},getRootNode:function(t){return di("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?ui("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?ui("Element",t,"shadowRoot"):null},querySelector:function(t,e){return ui("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return ui("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return si("MutationObserver").constructor}};class hi{constructor(){ri(this,"idNodeMap",new Map),ri(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(e,n)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function vi(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&vi(ci.parentNode(t),e,r);for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}return!!r&&vi(ci.parentNode(t),e,r)}class fi{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof fi))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var mi={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},pi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},gi={};function Ii(t){if(gi[t])return gi[t];var e=globalThis[t],r=e.prototype,n=t in mi?mi[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in pi?pi[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(i&&s)return gi[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?gi[t]=l:r}catch(t){return r}}var yi={};function bi(t,e,r){var n,i=t+"."+String(r);if(yi[i])return yi[i].call(e);var o=Ii(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(yi[i]=s,s.call(e)):e[r]}var Ci={};function wi(t,e,r){var n=t+"."+String(r);if(Ci[n])return Ci[n].bind(e);var i=Ii(t)[r];return"function"!=typeof i?e[r]:(Ci[n]=i,i.bind(e))}var Si={childNodes:function(t){return bi("Node",t,"childNodes")},parentNode:function(t){return bi("Node",t,"parentNode")},parentElement:function(t){return bi("Node",t,"parentElement")},textContent:function(t){return bi("Node",t,"textContent")},contains:function(t,e){return wi("Node",t,"contains")(e)},getRootNode:function(t){return wi("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?bi("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?bi("Element",t,"shadowRoot"):null},querySelector:function(t,e){return bi("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return bi("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Ii("MutationObserver").constructor}};var Ai="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",ki={map:{},getId:()=>(console.error(Ai),-1),getNode:()=>(console.error(Ai),null),removeNodeFromMap(){console.error(Ai)},has:()=>(console.error(Ai),!1),reset(){console.error(Ai)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ki=new Proxy(ki,{get:(t,e,r)=>("map"===e&&console.error(Ai),Reflect.get(t,e,r))}));var Ni=Date.now;function Ri(t){return t?t.nodeType===t.ELEMENT_NODE?t:Si.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ni=()=>(new Date).getTime());function Ti(t){var e,r=null;return"getRootNode"in t&&(null==(e=Si.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Si.host(Si.getRootNode(t))&&(r=Si.host(Si.getRootNode(t))),r}function Mi(t){for(var e,r=t;e=Ti(r);)r=e;return r}function Fi(t){var e=t.ownerDocument;if(!e)return!1;var r=Mi(t);return Si.contains(e,r)}for(var _i=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){ti(this,"id",1),ti(this,"styleIDMap",new WeakMap),ti(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return ki},closestElementOfNode:Ri,getBaseDimension:function t(e,r){var n,i,o=null==(i=null==(n=e.ownerDocument)?void 0:n.defaultView)?void 0:i.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=t(o,r),u=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}},getNestedRule:function t(e,r){var n=e[r[0]];return 1===r.length?n:t(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:Mi,getShadowHost:Ti,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,n,i,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=Si.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=Si.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof fi&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Si.shadowRoot(t)))},hookSetter:function t(e,r,n,i,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(e,r);return o.Object.defineProperty(e,r,i?n:{set(t){setTimeout((()=>{n.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>t(e,r,s||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(Si.contains(e,t)||Fi(t))},isAncestorRemoved:function t(e,r){if(i=(n=e)&&"host"in n&&"mode"in n&&ci.host(n)||null,Boolean(i&&"shadowRoot"in i&&ci.shadowRoot(i)===n))return!1;var n,i,o=r.getId(e);if(!r.has(o))return!0;var s=Si.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||t(s,r))},isBlocked:function(t,e,r,n){if(!t)return!1;var i=Ri(t);if(!i)return!1;try{if("string"==typeof e){if(i.classList.contains(e))return!0;if(n&&null!==i.closest("."+e))return!0}else if(vi(i,e,n))return!0}catch(t){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,r){r(e.value);for(var n=e.children.length-1;n>=0;n--)t(e.children[n],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return Ni},on:function(t,e,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),t[e]=i,()=>{t[e]=n}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var n={value:t,parent:r,children:[]};return e[t.node.id]=n,n},n=[];for(var i of t){var{nextId:o,parentId:s}=i;if(o&&o in e){var a=e[o];if(a.parent){var u=a.parent.children.indexOf(a);a.parent.children.splice(u,0,r(i,a.parent))}else{var l=n.indexOf(a);n.splice(l,0,r(i,null))}}else if(s in e){var d=e[s];d.children.push(r(i,d))}else n.push(r(i,null))}return n},shadowHostInDom:Fi,throttle:function(t,e,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;ae?(n&&(clearTimeout(n),n=null),i=u,t.apply(d,s)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,t.apply(d,s)}),l))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],n=t.length;n--;){var i=t[n];e.has(i.id)||(r.push(i),e.add(i.id))}return r}},Symbol.toStringTag,{value:"Module"})),Bi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Oi="undefined"==typeof Uint8Array?[]:new Uint8Array(256),xi=0;xi<64;xi++)Oi[Bi.charCodeAt(xi)]=xi;var Zi;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var Yi=document.createElement("iframe");document.body.appendChild(Yi),Array.from=(null==(Pn=Yi.contentWindow)?void 0:Pn.Array.from)||Array.from,document.body.removeChild(Yi)}}catch(t){console.debug("Unable to override Array.from",t)}new hi,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(Zi||(Zi={}));class Ei{constructor(t){Qn(this,"fileName"),Qn(this,"functionName"),Qn(this,"lineNumber"),Qn(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Gi=/(^|@)\S+:\d+/,Li=/^\s*at .*(\S+:\d+|\(native\))/m,Wi=/^(eval@)?(\[native code])?$/,Di={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Li)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Li)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,s=["eval",""].indexOf(i[0])>-1?void 0:i[0];return new Ei({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Wi)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ei({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(t.replace(e,""));return new Ei({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),n=[],i=2,o=r.length;i/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ei({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Vi(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var n=t.parentElement,i=[];if(n.children&&n.children.length>0)for(var o=0;o1&&(r+=":eq("+i.indexOf(t)+")"),e=r+(e?">"+e:""),t=n}return e}function Xi(t){return"[object Object]"===Object.prototype.toString.call(t)}function zi(t,e){if(0===e)return!0;var r=Object.keys(t);for(var n of r)if(Xi(t[n])&&zi(t[n],e-1))return!0;return!1}function Ji(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var n=[],i=[];return JSON.stringify(t,(function(t,e){if(n.length>0){var o=n.indexOf(this);~o?n.splice(o+1):n.push(this),~o?i.splice(o,1/0,t):i.push(t),~n.indexOf(e)&&(e=n[0]===e?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(e)).join(".")+"]")}else n.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Xi(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Xi(t)&&zi(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var a in e){var u=e[a];Array.isArray(u)?s[a]=Vi(u.length?u[0]:null):s[a]=u}return s}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Ki={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Hi(t,e,r){var n,i=r?Object.assign({},Ki,r):Ki,o=i.logger;if(!o)return()=>{};n="string"==typeof o?e[o]:o;var s=0,a=!1,u=[];if(i.level.includes("error")){var l=e=>{var r=e.message,n=e.error,o=Di.parse(n).map((t=>t.toString())),s=[Ji(r,i.stringifyOptions)];t({level:"error",trace:o,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var d=e=>{var r,n;e.reason instanceof Error?n=[Ji("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[Ji("Uncaught (in promise)",i.stringifyOptions),Ji(e.reason,i.stringifyOptions)]);var o=Di.parse(r).map((t=>t.toString()));t({level:"error",trace:o,payload:n})};e.addEventListener("unhandledrejection",d),u.push((()=>{e.removeEventListener("unhandledrejection",d)}))}for(var c of i.level)u.push(h(n,c));return()=>{u.forEach((t=>t()))};function h(e,r){var n=this;return e[r]?_i.patch(e,r,(e=>function(){for(var o=arguments.length,u=new Array(o),l=0;lt.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>Ji(t,i.stringifyOptions)));++s{}}}var ji=t=>({name:"rrweb/console@1",observer:Hi,options:t}),Ui=t=>t instanceof Document;function Pi(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return g(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=n}}catch(t){return()=>{}}}function qi(t,e){var r,n=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),i={hostname:n,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var o of e.payloadHostDenyList)if(n.endsWith(o))return{hostname:n,isHostDenied:!0};return i}var Qi=_("[Recorder]"),$i=t=>"navigation"===t.entryType,to=t=>"resource"===t.entryType;function eo(t,e,r){if(r.recordInitialRequests){var n=e.performance.getEntries().filter((t=>$i(t)||to(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:n.flatMap((t=>uo({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new e.PerformanceObserver((e=>{var n=e.getEntries().filter((t=>$i(t)||to(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:n.flatMap((t=>uo({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return i.observe({entryTypes:o}),()=>{i.disconnect()}}function ro(t,e){return!!e&&(A(e)||e[t])}function no(t){var{type:e,recordBody:r,headers:n,url:i}=t;function o(t){var e=Object.keys(n).find((t=>"content-type"===t.toLowerCase())),r=e&&n[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(i))return!1;if(A(r))return!0;if(p(r))return o(r);var s=r[e];return A(s)?s:o(s)}function io(t,e,r,n,i,o){return oo.apply(this,arguments)}function oo(){return oo=a((function*(t,e,r,n,i,o){if(void 0===o&&(o=0),o>10)return Qi.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var s=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>to(t)&&t.initiatorType===e&&(y(n)||t.startTime>=n)&&(y(i)||t.startTime<=i)));return s||(yield new Promise((t=>setTimeout(t,50*o))),io(t,e,r,n,i,o+1))})),oo.apply(this,arguments)}function so(t){var{body:e,options:r,url:n}=t;if(w(e))return null;var{hostname:i,isHostDenied:o}=qi(n,r);if(o)return i+" is in deny list";if(b(e))return e;if(Ui(e))return e.textContent;if(k(e))return E(e);if(I(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var ao=t=>!C(t)&&("navigation"===t.entryType||"resource"===t.entryType);function uo(t){var{entry:e,method:r,status:n,networkRequest:i,isInitial:o,start:s,end:a,url:l,initiatorType:d}=t;s=e?e.startTime:s,a=e?e.responseEnd:a;var c=Math.floor(Date.now()-performance.now()),h=Math.floor(c+(s||0)),v=[u({},e?e.toJSON():{name:l},{startTime:y(s)?void 0:Math.round(s),endTime:y(a)?void 0:Math.round(a),timeOrigin:c,timestamp:h,method:r,initiatorType:d||(e?e.initiatorType:void 0),status:n,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:o})];if(ao(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:h,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var lo=["video/","audio/"];function co(t){return new Promise(((e,r)=>{var n=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(n)))}catch(t){clearTimeout(n),e("[SessionReplay] Failed to read body")}}))}function ho(){return(ho=a((function*(t){var{r:e,options:r,url:n}=t,{hostname:i,isHostDenied:o}=qi(n,r);return o?Promise.resolve(i+" is in deny list"):co(e)}))).apply(this,arguments)}function vo(){return(vo=a((function*(t){var{r:e,options:r,url:n}=t,i=function(t){var e,{r:r,options:n,url:i}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),s=lo.some((t=>null==o?void 0:o.startsWith(t)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:u}=qi(i,n);return u?a+" is in deny list":null}({r:e,options:r,url:n});return C(i)?co(e):Promise.resolve(i)}))).apply(this,arguments)}function fo(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var n=ro("request",r.recordHeaders),i=ro("response",r.recordHeaders),o=Pi(e,"fetch",(o=>function(){var s=a((function*(s,a){var u,l,d,c=new Request(s,a),h={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(h.requestHeaders=v),no({type:"request",headers:v,url:s,recordBody:r.recordBody})&&(h.requestBody=yield function(t){return ho.apply(this,arguments)}({r:c,options:r,url:s})),l=e.performance.now(),u=yield o(c),d=e.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),i&&(h.responseHeaders=f),no({type:"response",headers:f,url:s,recordBody:r.recordBody})&&(h.responseBody=yield function(t){return vo.apply(this,arguments)}({r:u,options:r,url:s})),u}finally{io(e,"fetch",c.url,l,d).then((e=>{var r,n=uo({entry:e,method:c.method,status:null==(r=u)?void 0:r.status,networkRequest:h,start:l,end:d,url:c.url,initiatorType:"fetch"});t({requests:n})})).catch((()=>{}))}}));return function(t,e){return s.apply(this,arguments)}}()));return()=>{o()}}var mo=null;function po(t,e,r){if(!("performance"in e))return()=>{};if(mo)return Qi.warn("Network observer already initialised, doing nothing"),()=>{};var n=r?Object.assign({},J,r):J,i=e=>{var r=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&r.push(e)})),r.length>0&&t(u({},e,{requests:r}))},o=eo(i,e,n),s=()=>{},a=()=>{};return(n.recordHeaders||n.recordBody)&&(s=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=ro("request",r.recordHeaders),i=ro("response",r.recordHeaders),o=Pi(e.XMLHttpRequest.prototype,"open",(o=>function(s,a,u,l,d){void 0===u&&(u=!0);var c,h,v=this,f=new Request(a),m={},p={},g=v.setRequestHeader.bind(v);v.setRequestHeader=(t,e)=>(p[t]=e,g(t,e)),n&&(m.requestHeaders=p);var I=v.send.bind(v);v.send=t=>(no({type:"request",headers:p,url:a,recordBody:r.recordBody})&&(m.requestBody=so({body:t,options:r,url:a})),c=e.performance.now(),I(t));var y=()=>{if(v.readyState===v.DONE){v.removeEventListener("readystatechange",y),h=e.performance.now();var n={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),i=e.join(": ");r&&(n[r]=i)})),i&&(m.responseHeaders=n),no({type:"response",headers:n,url:a,recordBody:r.recordBody})&&(m.responseBody=so({body:v.response,options:r,url:a})),io(e,"xmlhttprequest",f.url,c,h).then((e=>{var r=uo({entry:e,method:s,status:null==v?void 0:v.status,networkRequest:m,start:c,end:h,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",y),o.call(v,s,a,u,l,d)}));return()=>{o()}}(i,e,n),a=fo(i,e,n)),mo=()=>{o(),s(),a()}}var go=t=>({name:"rrweb/network@1",observer:po,options:t});o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:ji,getRecordNetworkPlugin:go},o.__PosthogExtensions__.rrweb={record:Un,version:"v2"},o.rrweb={record:Un,version:"v2"},o.rrwebConsoleRecord={getRecordConsolePlugin:ji},o.getRecordNetworkPlugin=go,o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initSessionRecording=t=>new ve(t)}(); //# sourceMappingURL=lazy-recorder.js.map