posthog-js 1.421.1 → 1.421.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/conversations.js +1 -1
- package/dist/conversations.js.map +1 -1
- package/dist/crisp-chat-integration.js.map +1 -1
- package/dist/customizations.d.ts +23 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.full.js.map +1 -1
- package/dist/customizations.js +1 -1
- package/dist/customizations.js.map +1 -1
- package/dist/dead-clicks-autocapture.js.map +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/default-extensions.js.map +1 -1
- package/dist/exception-autocapture.js.map +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/extension-bundles.js.map +1 -1
- package/dist/external-scripts-loader.js.map +1 -1
- package/dist/intercom-integration.js.map +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/lazy-recorder.js.map +1 -1
- package/dist/logs.js +1 -1
- package/dist/logs.js.map +1 -1
- package/dist/main.d.ts +23 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +23 -1
- package/dist/module.full.d.ts +23 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +23 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +23 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.js.map +1 -1
- package/dist/module.slim.no-external.d.ts +23 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/module.slim.no-external.js.map +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/posthog-recorder.js.map +1 -1
- package/dist/product-tours-preview.js.map +1 -1
- package/dist/product-tours.js +1 -1
- package/dist/product-tours.js.map +1 -1
- package/dist/recorder-v2.js +1 -1
- package/dist/recorder-v2.js.map +1 -1
- package/dist/recorder.js +1 -1
- package/dist/recorder.js.map +1 -1
- package/dist/rrweb-plugin-console-record.js +1 -1
- package/dist/rrweb-plugin-console-record.js.map +1 -1
- package/dist/rrweb.js +1 -1
- package/dist/rrweb.js.map +1 -1
- package/dist/src/constants.d.ts +1 -0
- package/dist/src/logs-types.d.ts +24 -0
- package/dist/src/posthog-logs.d.ts +24 -1
- package/dist/src/utils/console-original.d.ts +6 -0
- package/dist/src/utils/globals.d.ts +2 -0
- package/dist/surveys-preview.js.map +1 -1
- package/dist/surveys.js.map +1 -1
- package/dist/tracing-headers.js +1 -1
- package/dist/tracing-headers.js.map +1 -1
- package/dist/web-vitals-soft-navs.js.map +1 -1
- package/dist/web-vitals-with-attribution-soft-navs.js.map +1 -1
- package/dist/web-vitals-with-attribution.js.map +1 -1
- package/dist/web-vitals.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/src/constants.d.ts +1 -0
- package/lib/src/constants.js +4 -3
- package/lib/src/constants.js.map +1 -1
- package/lib/src/entrypoints/logs.js +47 -18
- package/lib/src/entrypoints/logs.js.map +1 -1
- package/lib/src/extensions/replay/rrweb-plugins/patch.js +16 -5
- package/lib/src/extensions/replay/rrweb-plugins/patch.js.map +1 -1
- package/lib/src/logs-types.d.ts +24 -0
- package/lib/src/logs-types.js +11 -0
- package/lib/src/logs-types.js.map +1 -0
- package/lib/src/persistence-key-policy.js +1 -0
- package/lib/src/persistence-key-policy.js.map +1 -1
- package/lib/src/posthog-core.js +10 -5
- package/lib/src/posthog-core.js.map +1 -1
- package/lib/src/posthog-logs.d.ts +24 -1
- package/lib/src/posthog-logs.js +266 -10
- package/lib/src/posthog-logs.js.map +1 -1
- package/lib/src/request.js +1 -3
- package/lib/src/request.js.map +1 -1
- package/lib/src/utils/console-original.d.ts +6 -0
- package/lib/src/utils/console-original.js +16 -0
- package/lib/src/utils/console-original.js.map +1 -0
- package/lib/src/utils/globals.d.ts +2 -0
- package/lib/src/utils/globals.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -5
package/dist/lazy-recorder.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t,r=null==e?void 0:e.document,i=null==e?void 0:e.location;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;var n="undefined"!=typeof globalThis?globalThis:t;n&&"undefined"==typeof self&&(n.self=n),n&&"undefined"==typeof File&&(n.File=function(){});var s=null!=t?t:{};function a(t,e,r,i,n,s,a){try{var o=t[s](a),u=o.value}catch(t){return void r(t)}o.done?e(u):Promise.resolve(u).then(i,n)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(i,n){var s=t.apply(e,r);function o(t){a(s,i,n,o,u,"next",t)}function u(t){a(s,i,n,o,u,"throw",t)}o(void 0)}))}}function u(){return u=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},u.apply(null,arguments)}var l,h={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},d={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},c="NativeGzipValidationError",v=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=c,e},f=function(){var t=o((function*(t,e){18>t.size&&v("too-short");var r,i=new Uint8Array(yield t.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&v("invalid-header");var n=new DataView(yield t.slice(t.size-8).arrayBuffer());n.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(l)return l;l=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;l[t]=e>>>0}return l})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&v("invalid-crc");var s=e.length>>>0;n.getUint32(4,!0)!==s&&v("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function p(){return p=o((function*(t,e,r){void 0===e&&(e=!0);try{var i=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),s=n.writable.getWriter(),a=s.write(i).then((()=>s.close())).catch(function(){var t=o((function*(t){try{yield s.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),u=new Response(n.readable).blob(),l=(yield Promise.all([u,a]))[0];return yield f(l,i),l}catch(t){if(null!=r&&r.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),p.apply(this,arguments)}var g=function(t){return t.trim()},m=Object.prototype,y=m.hasOwnProperty,w=m.toString,b=Array.isArray||function(t){return"[object Array]"===w.call(t)},k=t=>"function"==typeof t,_=t=>t===Object(t)&&!b(t),S=t=>void 0===t,M=t=>"[object String]"==w.call(t),C=t=>null===t,I=t=>S(t)||C(t),A=t=>"[object Number]"==w.call(t)&&t==t,R=t=>"[object Boolean]"===w.call(t),T=t=>t instanceof FormData;function x(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),A(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),x(n||r,e,r,i))}class E{constructor(t){this.k={},this.S=t.S,this.C=x(t.bucketSize,0,100,t.I),this.R=x(t.refillRate,0,this.C,t.I),this.A=x(t.refillInterval,0,864e5,t.I)}O(t,e){var r=Math.floor((e-t.lastAccess)/this.A);r>0&&(t.tokens=Math.min(t.tokens+r*this.R,this.C),t.lastAccess=t.lastAccess+r*this.A)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.k[i];return n?this.O(n,r):this.k[i]=n={tokens:this.C,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.S)||e.call(this,t)),0===n.tokens)}stop(){this.k={}}}function O(t){return t?t.split("#")[0]:t}var F={DEBUG:!1,LIB_VERSION:"0.6.0",LIB_NAME:"browser-common"},L=function(e,r){var i=(void 0===r?{}:r).debugEnabled,n={P(r){if(t&&(F.DEBUG||t.POSTHOG_DEBUG||i)&&!S(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[r]?t.console[r].__rrweb_original__:t.console[r]),s=arguments.length,a=new Array(s>1?s-1:0),o=1;s>o;o++)a[o-1]=arguments[o];n(e,...a)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.P("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.P("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.P("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.P("error",...e)},critical(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(t){n.error("You must initialize PostHog before calling "+t)},createLogger:(t,r)=>L(e+" "+t,r)};return n},D=L("[PostHog.js]"),N=D.createLogger;function P(t,e){if(!I(t))if(b(t))t.forEach(e);else if(T(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)y.call(t,r)&&e(t[r],r)}function B(t,e,r,i){var n={},s=n.capture,a=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==s&&s,passive:void 0===a||a})}var W=["localhost","127.0.0.1"],z=t=>{var e=null==r?void 0:r.createElement("a");return S(e)?null:(e.href=t,e)},U=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return P(t,(function(t,e){S(t)||S(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)};function j(e){var r,i=null==t||null==(r=t.location)?void 0:r.href;return S(i)?void 0:function(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!k(i))return e;try{var n=i(e);return M(n)&&n?n:e}catch(t){return D.error("Error in get_current_url, falling back to window.location.href",t),e}}(e,i)}var H=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}))$"),q=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,G=[16,15,14,13],V=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Z=/[0-9A-Za-z_]/;function J(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}var Q="[SessionRecording]",X="redacted",K=1e6;function Y(t){var e;return Math.min(K,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:K)}var tt={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:K,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},et=["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"],rt=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],it=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],nt=t=>{I(t)||P(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return et.includes(e)||it.some((t=>e.includes(t)))})(e)&&(t[e]=X)}))},st=["/s/","/e/","/i/"];function at(t,e,r,i){if(I(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return M(n)&&(n=parseInt(n)),n>r?Q+" "+i+" body too large to record ("+n+" bytes)":t}function ot(t,e){if(I(t))return t;var r=t;return function(t,e){if(I(t))return!1;if(M(t)){if(function(t){var e;for(q.lastIndex=0;e=q.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var s of G){var a=n+s;if(i.length>=a){var o=i.slice(n,a);if(H.test(o)&&J(o))return!0}}}return!1}(t=g(t)))return!1;var r=function(t){var e;for(V.lastIndex=0;e=V.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&Z.test(r)&&Z.test(i)))return!0}return!1}(t);if(r)return!1}return!0}(r)||(r=Q+" "+e+" body "+X),P(rt,(t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r=Q+" "+e+" body "+X+" as might contain: "+t)})),r}var ut=new WeakSet,lt="$session_recording_remote_config",ht="$replay_sample_rate",dt="$replay_override_sampling",ct="$replay_override_linked_flag",vt="$replay_override_url_trigger",ft="$replay_override_event_trigger",pt="$session_is_sampled",gt="$session_past_minimum_duration",mt="$session_recording_url_trigger_activated_session",yt="$session_recording_event_trigger_activated_session",wt="$posthog_sr_group_event_trigger_",bt="$posthog_sr_group_url_trigger_",kt="$posthog_sr_group_sampling_",_t="$debug_first_full_snapshot_timestamp",St="$sess_rec_flush_size",Mt="$stored_person_properties",Ct="$sdk_debug_replay_pending_trigger_conditions",It="$sdk_debug_replay_remote_trigger_matching_config",At="disabled",Rt="sampled",Tt="active",xt="buffering",Et="paused",Ot="rrweb_error",Ft="trigger",Lt=Ft+"_activated",Dt=Ft+"_pending",Nt=Ft+"_"+At;function Pt(t,e,r,i,n,s){return 0===e?Nt:(null==t?void 0:t.get_property(r?i+r:n))===s?Lt:Dt}function Bt(t,e,r){return e.some((e=>{var i;return"regex"===e.matching&&(null!==(i=null==r?void 0:r.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)}))}function $t(t){return t.includes(Lt)?Lt:t.includes(Dt)?Dt:Nt}function Wt(t){var e=new Set(t);switch(e.delete(Nt),e.size){case 0:return Nt;case 1:return Array.from(e)[0];default:return Dt}}class zt{constructor(t){this.F=t}triggerStatus(t){return $t(this.F.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return $t(this.F.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.F.forEach((t=>t.stop()))}}class Ut{constructor(t){this.F=t}triggerStatus(t){return Wt(this.F.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return Wt(this.F.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.F.forEach((t=>t.stop()))}}class jt{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return Lt}stop(){}}var Ht=t=>"sessionRecording"in t;class qt{constructor(t,e){this.N=[],this.q=[],this.j=new Map,this.B=new Map,this.H="",this.urlBlocked=!1,this._instance=t,this.U=e}onConfig(t){var e,r;this.N=(Ht(t)?_(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.q=(Ht(t)?_(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.$()}$(){for(var t of(this.j.clear(),this.B.clear(),this.N))if("regex"===t.matching&&!this.j.has(t.url))try{this.j.set(t.url,new RegExp(t.url))}catch(e){D.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.q)if("regex"===e.matching&&!this.B.has(e.url))try{this.B.set(e.url,new RegExp(e.url))}catch(t){D.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}W(t){return Pt(this._instance,this.N.length,this.U,bt,mt,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:e}),e}triggerStatusNoSideEffects(t){return this.W(t)}isCurrentUrlBlocked(){var t=j(this._instance);if(!t)return!1;try{return Bt(t,this.q,this.B)}catch(t){return!0}}checkUrlBlocklist(t,e){var r=j(this._instance);if(r&&r!==this.H){this.H=r;var i=this.urlBlocked,n=Bt(r,this.q,this.B);i&&n||(n&&!i?t():!n&&i&&e())}}checkUrlTriggerConditions(t,e,r,i){var n=j(this._instance);if(n&&n!==this.H){this.H=n;var s=this.urlBlocked,a=Bt(n,this.q,this.B);a&&!s?t():!a&&s&&e();var o=this.W(i)===Lt,u=Bt(n,this.N,this.j);!o&&u&&r("url",n)}}stop(){this.H=""}}class Gt{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.V=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}triggerStatusNoSideEffects(){var t=Dt;return I(this.linkedFlag)&&(t=Nt),this.linkedFlagSeen&&(t=Lt),t}onConfig(t,e){var r;if(this.linkedFlag=(Ht(t)?_(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!I(this.linkedFlag)&&!this.linkedFlagSeen){var i=M(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=M(this.linkedFlag)?null:this.linkedFlag.variant;this.V=this._instance.onFeatureFlags(((t,r)=>{var s=!1;if(_(r)&&i in r){var a=r[i];s=R(a)?!0===a:n?a===n:!!a}var o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(i,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.V()}}class Vt{constructor(t,e){this.Z=[],this._instance=t,this.U=e}onConfig(t){var e;this.Z=(Ht(t)?_(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}G(t){return Pt(this._instance,this.Z.length,this.U,wt,yt,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}checkEventTriggerConditions(t,e,r){if(0!==this.Z.length){var i=this.G(r)===Lt,n=this.Z.includes(t);!i&&n&&e("event",t)}}stop(){}}class Zt{constructor(t,e,r){if(this._instance=t,this.group=e,this.J=new qt(t,e.id),this.Y=new Vt(t,e.id),this.K=new Gt(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var i=(e.conditions.events||[]).map((t=>t.name)),n={urlTriggers:e.conditions.urls||[],eventTriggers:i,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.J.onConfig(n),this.Y.onConfig(n),this.K.onConfig(n,r);var s=[this.Y,this.J,this.K];this.X="any"===e.conditions.matchType?new zt(s):new Ut(s)}else this.X=new jt}triggerStatus(t){return this.X.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.X.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==Dt?[]:[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===Dt)).map((t=>t.label))}checkEventTriggerConditions(t,e,r){this.Y.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.J.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r;null==(r=this._instance.persistence)||r.register({["url"===t?bt+this.group.id:wt+this.group.id]:e})}stop(){this.J.stop(),this.Y.stop(),this.K.stop()}}function Jt(t){if(t.rrwebError)return Ot;if(!t.receivedFlags)return xt;if(!t.isRecordingEnabled)return At;if(t.urlTriggerMatching.urlBlocked)return Et;var e=!0===t.isSampled,r=new zt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Rt:r===Lt?Tt:r===Dt?xt:!1===t.isSampled?At:Tt}function Qt(t){if(t.rrwebError)return Ot;if(!t.receivedFlags)return xt;if(!t.isRecordingEnabled)return At;if(t.urlTriggerMatching.urlBlocked)return Et;var e=new Ut([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==Nt,i=R(t.isSampled);return r&&e===Dt?xt:r&&e===Nt||i&&!t.isSampled?At:!0===t.isSampled?Rt:Tt}function Xt(){var t=[];return function(e,r){if(_(r)||b(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r}}function Kt(t){var e=JSON.stringify(t,Xt());return e?new Blob([e]).size:0}function Yt(t){if(C(t))return 4;if(S(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(b(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=S(i)||C(i)?4:Yt(i)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var u=n[o];S(u)||(a||(s+=1),a=!1,s+=o.length+3+Yt(u))}return s;default:return 0}}function te(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),i=t.sizes.slice(0,r),n=t.sizes.slice(r);return[te({size:i.reduce(((t,e)=>t+e),0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),te({size:n.reduce(((t,e)=>t+e),0),data:t.data.slice(r),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}var ee=Uint8Array,re=Uint16Array,ie=Uint32Array,ne=new ee([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]),se=new ee([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]),ae=new ee([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),oe=function(t,e){for(var r=new re(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new ie(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},ue=oe(ne,2),le=ue[1];ue[0][28]=258,le[258]=28;for(var he=oe(se,0)[1],de=new re(32768),ce=0;32768>ce;++ce){var ve=(43690&ce)>>>1|(21845&ce)<<1;de[ce]=((65280&(ve=(61680&(ve=(52428&ve)>>>2|(13107&ve)<<2))>>>4|(3855&ve)<<4))>>>8|(255&ve)<<8)>>>1}var fe=function(t,e,r){for(var i=t.length,n=0,s=new re(e);i>n;++n)++s[t[n]-1];var a,o=new re(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(r){a=new re(1<<e);var u=15-e;for(n=0;i>n;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],d=o[t[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)a[de[d]>>>u]=l}else for(a=new re(i),n=0;i>n;++n)a[n]=de[o[t[n]-1]++]>>>15-t[n];return a},pe=new ee(288);for(ce=0;144>ce;++ce)pe[ce]=8;for(ce=144;256>ce;++ce)pe[ce]=9;for(ce=256;280>ce;++ce)pe[ce]=7;for(ce=280;288>ce;++ce)pe[ce]=8;var ge=new ee(32);for(ce=0;32>ce;++ce)ge[ce]=5;var me=fe(pe,9,0),ye=fe(ge,5,0),we=function(t){return(t/8>>0)+(7&t&&1)},be=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof re?re:t instanceof ie?ie:ee)(r-e);return i.set(t.subarray(e,r)),i},ke=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},_e=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Se=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new ee(0),0];if(1==n){var a=new ee(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var o=r[0],u=r[1],l=0,h=1,d=2;for(r[0]={s:-1,f:o.f+u.f,l:o,r:u};h!=n-1;)o=r[r[d].f>r[l].f?l++:d++],u=r[l!=h&&r[d].f>r[l].f?l++:d++],r[h++]={s:-1,f:o.f+u.f,l:o,r:u};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new re(c+1),f=Me(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var w=s[i].s;e>v[w]?p-=1<<e-v[w]++-1:++i}for(;i>=0&&p;--i){var b=s[i].s;v[b]==e&&(--v[b],++p)}f=e}return[new ee(v),f]},Me=function(t,e,r){return-1==t.s?Math.max(Me(t.l,e,r+1),Me(t.r,e,r+1)):e[t.s]=r},Ce=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new re(++e),i=0,n=t[0],s=1,a=function(t){r[i++]=t},o=1;e>=o;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[r.subarray(0,i),e]},Ie=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Ae=function(t,e,r){var i=r.length,n=we(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},Re=function(t,e,r,i,n,s,a,o,u,l,h){ke(e,h++,r),++n[256];for(var d=Se(n,15),c=d[0],v=d[1],f=Se(s,15),p=f[0],g=f[1],m=Ce(c),y=m[0],w=m[1],b=Ce(p),k=b[0],_=b[1],S=new re(19),M=0;y.length>M;++M)S[31&y[M]]++;for(M=0;k.length>M;++M)S[31&k[M]]++;for(var C=Se(S,7),I=C[0],A=C[1],R=19;R>4&&!I[ae[R-1]];--R);var T,x,E,O,F=l+5<<3,L=Ie(n,pe)+Ie(s,ge)+a,D=Ie(n,c)+Ie(s,p)+a+14+3*R+Ie(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(L>=F&&D>=F)return Ae(e,h,t.subarray(u,u+l));if(ke(e,h,1+(L>D)),h+=2,L>D){T=fe(c,v,0),x=c,E=fe(p,g,0),O=p;var N=fe(I,A,0);for(ke(e,h,w-257),ke(e,h+5,_-1),ke(e,h+10,R-4),h+=14,M=0;R>M;++M)ke(e,h+3*M,I[ae[M]]);h+=3*R;for(var P=[y,k],B=0;2>B;++B){var W=P[B];for(M=0;W.length>M;++M)ke(e,h,N[z=31&W[M]]),h+=I[z],z>15&&(ke(e,h,W[M]>>>5&127),h+=W[M]>>>12)}}else T=me,x=pe,E=ye,O=ge;for(M=0;o>M;++M)if(i[M]>255){var z;_e(e,h,T[257+(z=i[M]>>>18&31)]),h+=x[z+257],z>7&&(ke(e,h,i[M]>>>23&31),h+=ne[z]);var U=31&i[M];_e(e,h,E[U]),h+=O[U],U>3&&(_e(e,h,i[M]>>>5&8191),h+=se[U])}else _e(e,h,T[i[M]]),h+=x[i[M]];return _e(e,h,T[256]),h+x[256]},Te=new ie([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),xe=function(){for(var t=new ie(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Ee=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=xe[255&r^e[i]]^r>>>8;t=r},d:()=>4294967295^t}},Oe=function(t,e,r,i,n){return function(t,e,r,i,n,s){var a=t.length,o=new ee(i+a+5*(1+Math.floor(a/7e3))+n),u=o.subarray(i,o.length-n),l=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var d=h+65535;a>d?l=Ae(u,l,t.subarray(h,d)):(u[h]=true,l=Ae(u,l,t.subarray(h,a)))}else{for(var c=Te[e-1],v=c>>>13,f=8191&c,p=(1<<r)-1,g=new re(32768),m=new re(p+1),y=Math.ceil(r/3),w=2*y,b=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<w)&p},k=new ie(25e3),_=new re(288),S=new re(32),M=0,C=0,I=(h=0,0),A=0,R=0;a>h;++h){var T=b(h),x=32767&h,E=m[T];if(g[x]=E,m[T]=x,h>=A){var O=a-h;if((M>7e3||I>24576)&&O>423){l=Re(t,u,0,k,_,S,C,I,R,h-R,l),I=M=C=0,R=h;for(var F=0;286>F;++F)_[F]=0;for(F=0;30>F;++F)S[F]=0}var L=2,D=0,N=f,P=x-E&32767;if(O>2&&T==b(h-P))for(var B=Math.min(v,O)-1,W=Math.min(32767,h),z=Math.min(258,O);W>=P&&--N&&x!=E;){if(t[h+L]==t[h+L-P]){for(var U=0;z>U&&t[h+U]==t[h+U-P];++U);if(U>L){if(L=U,D=P,U>B)break;var j=Math.min(P,U-2),H=0;for(F=0;j>F;++F){var q=h-P+F+32768&32767,G=q-g[q]+32768&32767;G>H&&(H=G,E=q)}}}P+=(x=E)-(E=g[x])+32768&32767}if(D){k[I++]=268435456|le[L]<<18|he[D];var V=31&le[L],Z=31&he[D];C+=ne[V]+se[Z],++_[257+V],++S[Z],A=h+L,++M}else k[I++]=t[h],++_[t[h]]}}l=Re(t,u,true,k,_,S,C,I,R,h-R,l)}return be(o,0,i+we(l)+n)}(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,i)},Fe=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},Le=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Fe(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}},De=function(t){return 10+(t.filename&&t.filename.length+1||0)};function Ne(t,e){for(var r="",i=0;t.length>i;){var n=t[i++];r+=String.fromCharCode(n)}return r}class Pe{constructor(t,e){var r,i;void 0===e&&(e={}),this.ee={},this.te=t=>{if(!this.ee[t]){var e,r;this.ee[t]=!0;var i=this.re(t);null==(e=(r=this.ie).onBlockedNode)||e.call(r,t,i)}},this.ne=t=>{var e=this.re(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.re=t=>this._rrweb.mirror.getNode(t),this.ae=t=>{var e,r,i,n,s,a,o,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(i=null==(n=t.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(s=null==(a=t.texts)?void 0:a.length)&&void 0!==s?s:0)+(null!==(o=null==(u=t.adds)?void 0:u.length)&&void 0!==o?o:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this.ae(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var e=this.ne(t.id);return!this.oe.consumeRateLimit(e[0])&&t})));var i=this.ae(e);return 0!==i||r===i?t:void 0},this._rrweb=t,this.ie=e,this.oe=new E({bucketSize:null!==(r=this.ie.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.ie.refillRate)&&void 0!==i?i:10,refillInterval:1e3,S:this.te,I:D})}reset(){this.ee={}}stop(){this.oe.stop(),this.reset()}}F.DEBUG=!1,F.LIB_VERSION="1.421.1",F.LIB_NAME="web";class Be{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.se=t.get_property.bind(t),this.ue=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.ue(St,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,r=this.se(St);return _(e=r)&&M(e.sessionId)&&A(e.size)&&r.sessionId===t?r.size:0}}function $e(t,e){return function(t){for(var e=0,r=0;t.length>r;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<x(100*e,0,100,D)}var We=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},ze=t=>t.toLowerCase(),Ue={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>We(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!We(e,t))))),icontains:(t,e)=>e.map(ze).some((e=>t.map(ze).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(ze).every((e=>t.map(ze).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},je=new Set(["is_not","not_icontains","not_regex"]);function He(t,e,r){return!t||0===t.length||t.every((t=>{var i="person"===t.type?r:e,n=null==i?void 0:i[t.key],s=t.operator||"exact";if(S(n)||C(n))return je.has(s);var a=Ue[s];return!!a&&!S(t.value)&&!C(t.value)&&a(b(t.value)?t.value.map(String):[String(t.value)],b(n)?n.map(String):[String(n)])}))}var qe=N("[SessionRecording]");function Ge(t,e){return e?t:"!"+t}function Ve(t,e){return t===e||t!=="!"+e&&null}class Ze{constructor(t,e,r,i,n,s,a){this.le=null,this.ce=Qt,this._instance=t,this.J=e,this.Y=r,this.K=i,this.he=n,this.de=s,this.ve=a}onRemoteConfig(t){this.le=A(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.fe=new zt([this.Y,this.J]),this.ce=Jt):(this.fe=new Ut([this.Y,this.J]),this.ce=Qt),this._instance.register_for_session({[It]:t.triggerMatchType}),this.J.onConfig(t),this.Y.onConfig(t),this.K.onConfig(t,((t,e)=>{this.he("linked_flag_matched",{flag:t,variant:e}),this.ve()}))}getStatus(t){return this.ce({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e=this._instance.get_property("$session_recording_remote_config"),r=null==e?void 0:e.minimumDurationMilliseconds;return A(r)?r:null}checkUrlTriggers(t,e,r,i){this.J.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.Y.Z.length&&I(this.pe))return this.pe=t((t=>{try{this.Y.checkEventTriggerConditions(t.event,r,e)}catch(t){qe.error("Could not activate event trigger",t)}})),this.pe}makeSamplingDecisions(t){var e,r,i,n=this.le;if(!A(n))return null==(r=this._instance.persistence)||r.unregister(pt),void(null==(i=this._instance.persistence)||i.unregister(ht));var s=this._instance.get_property(pt),a=this._instance.get_property(ht),o=Ve(s,t),u=A(a)&&a!==n,l=S(a)&&s===t,h=u||l||!R(o),d=h?$e(t,n):o;h&&(d?this.he("sampled"):qe.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[pt]:Ge(t,d),[ht]:C(a)&&s===t?null:n})}ensureSamplingDecision(t){if(A(this.le)){var e=this._instance.get_property(pt);R(Ve(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i,n;null==(t=this._instance.persistence)||t.unregister(yt),null==(e=this._instance.persistence)||e.unregister(mt),null==(r=this._instance.persistence)||r.unregister(pt),null==(i=this._instance.persistence)||i.unregister(ht),null==(n=this._instance.persistence)||n.unregister(gt)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.fe)?void 0:e.triggerStatus(t))===Dt}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===Dt)).map((t=>t.label))}stop(){var t;null==(t=this.pe)||t.call(this),this.pe=void 0,this.Y.stop(),this.J.stop(),this.K.stop()}}class Je{constructor(t,e,r,i,n){this.ge=[],this.me=new Map,this.ye=!1,this._instance=t,this.J=e,this.he=r,this.be=i,this.ve=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.we(t.triggerGroups),this._instance.register_for_session({[It]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:t.triggerGroups.length}),this.J.onConfig(t)):qe.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Ot;if(t.urlTriggerMatching.urlBlocked)return Et;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return At;var i=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===Lt){var o=s.group.id,u=r.get(o);S(u)?D.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===u&&(n=!0)}else a===Dt&&(i=!0)}return n?Rt:i?xt:At}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.ge,triggerGroupSamplingResults:this.me,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.ge)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;A(i)&&(C(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.J.checkUrlBlocklist(e,r);var s=function(i){i.checkUrlTriggerConditions(e,r,(e=>{n.ke(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t),n.ve(e))}),t)};for(var a of this.ge)s(a)}setupEventTriggerListeners(t,e,r){var i=this;return this.pe=t((t=>{var r;if(this.ye)return qe.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.pe)||r.call(this),void(this.pe=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,(n=>{if(i.ke(r,t.properties)){var s=(r.group.conditions.events||[]).filter((e=>e.name===t.event)),a=i._instance.get_property(Mt);s.some((e=>!e.properties||0===e.properties.length||He(e.properties,t.properties,a)))&&(r.activateTrigger(n,e),i.updateActiveTriggers(e),i.ve(n))}}),e)};for(var s of this.ge)n(s)}catch(t){qe.error("Could not activate event trigger for trigger groups",t)}})),this.pe}makeSamplingDecisions(t){for(var e of this.ge){var r,i=e.group,n=i.id,s=i.sampleRate,a=kt+n,o=this._instance.get_property(a),u=null,l=!1,h=!1,d=!1;if(_(o)){var c=o.sessionId,v=o.sampleRate,f=o.sampled;l="string"==typeof c&&c!==t,h=A(v)&&v!==s,u=c===t&&A(v)&&v===s&&R(f)?f:null}else u=o===t||null,l="string"==typeof o&&o!==t,d=o===t;var p=l||h||d||!R(u),g=p?$e(t+n,s):u;p&&this.be("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:s,isSampled:g}),this.me.set(n,g),null==(r=this._instance.persistence)||r.register({[a]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.ye=!0}clearConditionalRecordingPersistence(){var t,e,r;for(var i of(null==(t=this._instance.persistence)||t.unregister(pt),null==(e=this._instance.persistence)||e.unregister(ht),null==(r=this._instance.persistence)||r.unregister(gt),this.ge)){var n,s,a,o=i.group.id;null==(n=this._instance.persistence)||n.unregister(wt+o),null==(s=this._instance.persistence)||s.unregister(bt+o),null==(a=this._instance.persistence)||a.unregister(kt+o)}}updateActiveTriggers(t){var e=[];for(var r of this.ge){var i=r.group,n=i.id,s="trigger_activated"===r.triggerStatus(t),a=!0===this.me.get(n);s&&e.push({id:n,name:i.name,matched:!0,sampled:a})}this._instance.register_for_session({$sdk_debug_replay_matched_recording_trigger_groups:e})}hasPendingTriggers(t){for(var e of this.ge)if(e.triggerStatus(t)===Dt)return!0;return!1}getPendingTriggerConditions(t){return this.ge.flatMap((e=>e.triggerStatusNoSideEffects(t)!==Dt?[]:e.getPendingTriggerConditions(t).map((t=>'trigger group "'+e.group.name+'": '+t))))}stop(){var t;null==(t=this.pe)||t.call(this),this.pe=void 0,this.ge.forEach((t=>t.stop())),this.ge=[],this.me.clear(),this.J.stop()}ke(t,e){var r=t.group.conditions.properties;return!r||0===r.length||He(r,e,this._instance.get_property(Mt))}we(t){var e=this;this.ge.forEach((t=>t.stop())),this.ge=[],this.me.clear();var r=function(t){var r=new Zt(e._instance,t,((r,i)=>{e.he("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name}),e.ve()}));e.ge.push(r)};for(var i of t)r(i)}}var Qe=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Xe=1e5,Ke="https://schema.org",Ye=[],tr="actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),er="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),rr="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),ir="Accommodation AdministrativeArea Country Place State".split(" "),nr={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:er,publisher:rr},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Ye},Offer:{seller:rr},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Person:{},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:rr,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:rr,areaServed:ir,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Ye}},sr={},ar=[[er,sr],["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),nr.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),nr.Event],[rr,nr.Organization],[ir,nr.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),nr.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),sr]],or="AlignmentObject BedDetails Certification ContactPoint CreditCard DefinedRegion EducationalOccupationalCredential EntryPoint GeoCoordinates GeoShape InteractionCounter JobPosting LocationFeatureSpecification MathSolver MemberProgram MemberProgramTier MerchantReturnPolicy MerchantReturnPolicySeasonalOverride MonetaryAmount NutritionInformation OccupationalExperienceRequirements OfferShippingDetails OpeningHoursSpecification PeopleAudience PostalAddress PriceSpecification PropertyValue QuantitativeValue ServicePeriod ShippingConditions ShippingDeliveryTime ShippingRateSettings ShippingService SpeakableSpecification Thing UnitPriceSpecification".split(" ");function ur(t,e){return y.call(t,e)?t[e]:void 0}function lr(t){var e=typeof t;return C(t)||"string"===e||"number"===e||"boolean"===e}function hr(t){return lr(t)||b(t)&&t.every(lr)?t:void 0}function dr(t){if(y.call(nr,t))return nr[t];for(var e of ar){var r=e[1];if(e[0].includes(t))return r}return or.includes(t)?sr:void 0}function cr(t,e){if(!_(t))return null;var r=ur(t,"@type"),i=function(t){return("string"==typeof t?[t]:b(t)?t:[]).filter((t=>"string"==typeof t)).map((t=>t.replace(/^https?:\/\/schema\.org\//,""))).filter((t=>!!dr(t)))}(r).filter((t=>!e||!e.length||e.includes(t)));if(!i.length)return null;var n={"@type":"string"==typeof r?i[0]:i},s=hr(ur(t,"@id"));for(var a of(S(s)||(n["@id"]=s),tr)){var o=hr(ur(t,a));S(o)||(n[a]=o)}for(var u of i){var l=dr(u),h=function(){var e=ur(t,d),r=l[d];if(!0===r){var i=hr(e);S(i)||(n[d]=i)}else if(b(e)){var s=e.map((t=>cr(t,r))).filter(_);s.length&&(n[d]=s)}else{var a=cr(e,r);a&&(n[d]=a)}};for(var d of Object.keys(l))h()}return n}function vr(t){if(!_(t))return null;var e=ur(t,"@context");if("string"!=typeof e||!/^https?:\/\/schema\.org\/?$/.test(e))return null;var r=cr(t);if(r)return u({"@context":Ke},r);var i=ur(t,"@graph");if(!b(i))return null;var n=i.map((t=>cr(t))).filter(_);return n.length?{"@context":Ke,"@graph":n}:null}function fr(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function pr(t,e,r){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some((t=>(e.lastIndex=0,e.test(t)))))return!0;try{return!!r&&t.matches(r)}catch(t){return!1}}function gr(t){return fr(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(fr)}function mr(t){return S(t)?void 0:Math.round(t)}function yr(t){return _(t)?t.network_timing:t}var wr,br,kr=943718.4,_r="[SessionRecording]",Sr=N(_r),Mr=[d.MouseMove,d.MouseInteraction,d.Scroll,d.ViewportResize,d.Input,d.TouchMove,d.MediaInteraction,d.Drag],Cr=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Ir(){var t;return null==s||null==(t=s.__PosthogExtensions__)?void 0:t.rrweb}function Ar(){var t;return null==(t=Ir())?void 0:t.record}function Rr(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,Xt())}}function Tr(t){return Ne(function(t,e){void 0===e&&(e={});var r=Ee(),i=t.length;r.p(t);var n=Oe(t,e,De(e),8),s=n.length;return Le(n,e),Fe(n,s-8,r.d()),Fe(n,s-4,i),n}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new ee(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},a=0;r>a;++a){if(n+5>i.length){var o=new ee(n+8+(r-a<<1));o.set(i),i=o}var u=t.charCodeAt(a);128>u?s(u):2048>u?(s(192|u>>>6),s(128|63&u)):u>55295&&57344>u?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++a))>>>18),s(128|u>>>12&63),s(128|u>>>6&63),s(128|63&u)):(s(224|u>>>12),s(128|u>>>6&63),s(128|63&u))}return be(i,0,n)}(Rr(t))))}function xr(t){return Er.apply(this,arguments)}function Er(){return Er=o((function*(t){var e=Rr(t),r=yield function(t,e,r){return p.apply(this,arguments)}(e,F.DEBUG,{rethrow:!0});return Ne(new Uint8Array(yield r.arrayBuffer()))})),Er.apply(this,arguments)}var Or="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Fr=!1;function Lr(t){return b(t)&&0===t.length?wr=null!=wr?wr:Tr([]):Tr(t)}function Dr(t){return Nr.apply(this,arguments)}function Nr(){return(Nr=o((function*(t){return b(t)&&0===t.length?wr||(br=null!=br?br:xr([]).then((t=>(wr=t,t))).catch((t=>{throw wr=void 0,br=void 0,t}))):xr(t)}))).apply(this,arguments)}function Pr(t){return Or&&!Fr&&function(t){return t.type===h.FullSnapshot||t.type===h.IncrementalSnapshot&&(t.data.source===d.Mutation||t.data.source===d.StyleSheetRule)}(t)}function Br(t){return{event:t,size:Yt(t)}}function $r(t,e){return u({},t,{data:e,cv:"2024-10"})}function Wr(t,e){return u({},t,{cv:"2024-10",data:u({},t.data,e)})}function zr(t){try{if(t.type===h.FullSnapshot)return Br($r(t,Tr(t.data)));if(t.type===h.IncrementalSnapshot&&t.data.source===d.Mutation)return Br(Wr(t,{texts:Lr(t.data.texts),attributes:Lr(t.data.attributes),removes:Lr(t.data.removes),adds:Lr(t.data.adds)}));if(t.type===h.IncrementalSnapshot&&t.data.source===d.StyleSheetRule)return Br(Wr(t,{adds:t.data.adds?Tr(t.data.adds):void 0,removes:t.data.removes?Tr(t.data.removes):void 0}))}catch(t){Sr.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Kt(t)}}function Ur(){return(Ur=o((function*(t){try{if(t.type===h.FullSnapshot)return Br($r(t,yield xr(t.data)));if(t.type===h.IncrementalSnapshot&&t.data.source===d.Mutation){var e=yield Promise.all([Dr(t.data.texts),Dr(t.data.attributes),Dr(t.data.removes),Dr(t.data.adds)]);return Br(Wr(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(t.type===h.IncrementalSnapshot&&t.data.source===d.StyleSheetRule){var r=yield Promise.all([t.data.adds?xr(t.data.adds):void 0,t.data.removes?xr(t.data.removes):void 0]);return Br(Wr(t,{adds:r[0],removes:r[1]}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===c})(e)&&(Fr=!0),Sr.error("could not compress event asynchronously - trying synchronous compression",e),zr(t)}return{event:t,size:Kt(t)}}))).apply(this,arguments)}function jr(t,e){return t.type===h.Custom&&t.data.tag===e}function Hr(t){return jr(t,"sessionIdle")}function qr(t){return jr(t,"$session_ending")}function Gr(t){return jr(t,"$session_starting")}class Vr{get sessionId(){return this._e}get Se(){if(!this._instance.sessionManager)throw new Error(_r+" must be started with a valid sessionManager.");return this._instance.sessionManager}get xe(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get Ce(){return Ve(this._instance.get_property(pt),this.sessionId)}get le(){var t,e=null==(t=this.Me)?void 0:t.sampleRate;return A(e)?e:null}get Te(){var t,e;return null!==(t=null==(e=this.Ie)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this.Ee="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Re=void 0,this.Ae=!1,this.Le=Date.now(),this.Oe=!1,this.Pe=[],this.De="unknown",this.Fe=0,this.Ne=!1,this.qe=!1,this.je=!1,this.Be=!1,this.He=!1,this.Ue=!1,this.$e=!1,this.We=!1,this.ze=!1,this.Ve=!1,this.Ze=!1,this.Ge=!1,this.Qe=[],this.Je=void 0,this.Ye=void 0,this.Ke=[],this.Xe=0,this.et=0,this.tt=!1,this.rt=void 0,this.pe=void 0,this.it=void 0,this.nt=void 0,this.ot=void 0,this.st=(t,e,r)=>{var i,n,s;if(r&&(t!==this._e||e!==this.ut)){var a,o=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this._e,l=this.ut;if(o&&this.be("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Le,flushed_size:null==(a=this.ct)?void 0:a.currentTrackedSize(u)}),null==(i=this._instance.persistence)||i.unregister(_t),this.$e=!1,null==(n=Ir())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.be("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.ht(),!(!1===this.De&&this.isStarted||this._e===t&&this.ut===e)){var h=this._e!==t&&!1!==this.De;this.De="unknown",this.dt(h)}o&&this.be("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Le}),null==(s=this.Ie)||s.makeSamplingDecisions(t)}},this.vt=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[gt])===this._e},this.ft=()=>{var t,e;if(0===this.yt.data.length)return null;var r=null==(t=this.yt.data[0])?void 0:t.timestamp,i=null==(e=this.yt.data[this.yt.data.length-1])?void 0:e.timestamp;return A(r)&&A(i)?i-r:null},this.bt=()=>{var t,e,r=this.Te;if(!A(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.wt;return A(i)&&i>=0&&r>i}if(this.vt())return!1;var n,s=this.ft();return!!C(s)||r>s||(null==(n=this._instance.persistence)||n.register({[gt]:this._e}),!1)},this.kt=()=>{this.status!==xt?(this.Ne&&this.qe&&this._t&&!this.je&&(this.Ne=!1),this.St(),this.xt()):this.Ct()},this.Mt=()=>{this.kt()},this.Tt=()=>{this.be("browser offline",{})},this.It=()=>{this.be("browser online",{})},this.Et=()=>{null!=r&&r.visibilityState&&("visible"===r.visibilityState&&(this._t=!0),this.be("window "+r.visibilityState,{}))},this._instance=t,this._t=null==e||e;var i=this.Se.checkAndGetSessionAndWindowId(),n=i.windowId;this._e=i.sessionId,this.ut=n,this.K=new Gt(this._instance),this.J=new qt(this._instance),this.Y=new Vt(this._instance),this.yt=this.Ct(),this.Se.sessionTimeoutMs>this.xe||Sr.warn("session_idle_threshold_ms ("+this.xe+") is greater than the session timeout ("+this.Se.sessionTimeoutMs+"). Session will never be detected as idle"),this.ct=new Be(this._instance)}setDocumentWasEverVisible(t){t&&(this._t=!0)}get Rt(){var t,e,r,i,n,s,a,o,u,l=null==(t=this.Me)?void 0:t.masking,h={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==(i=this._instance.config.session_recording)?void 0:i.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},d=null!==(s=null==h?void 0:h.maskAllInputs)&&void 0!==s?s:null==l?void 0:l.maskAllInputs,c=null!==(a=null==h?void 0:h.maskTextSelector)&&void 0!==a?a:null==l?void 0:l.maskTextSelector,v=null!==(o=null==h?void 0:h.blockSelector)&&void 0!==o?o:null==l?void 0:l.blockSelector,f=null!==(u=null==h?void 0:h.maskAllElementAttributes)&&void 0!==u?u:null==l?void 0:l.maskAllElementAttributes;return S(d)&&S(c)&&S(v)&&S(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:c,blockSelector:v,maskAllElementAttributes:f}}At(){var t;if(!this.ze){var e=null==(t=this.Me)?void 0:t.masking;if(!I(e)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter((t=>{var i=null==r?void 0:r[t],n=e[t];return!S(i)&&i!==n}));0!==i.length&&(this.ze=!0,Sr.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==r?void 0:r.maskAllInputs,maskTextSelector:null==r?void 0:r.maskTextSelector,blockSelector:null==r?void 0:r.blockSelector,maskAllElementAttributes:null==r?void 0:r.maskAllElementAttributes},project:e}))}}}get Lt(){var t;return x(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,N("canvas recording resolution scale"),1)}get Ot(){var t,e,r,i,n,s,a,o=this._instance.config.session_recording.captureCanvas,u=null==(t=this.Me)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==o?void 0:o.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,h=null!==(i=null!==(n=null==o?void 0:o.canvasFps)&&void 0!==n?n:null==u?void 0:u.fps)&&void 0!==i?i:4,d=null!==(s=null!==(a=null==o?void 0:o.canvasQuality)&&void 0!==a?a:null==u?void 0:u.quality)&&void 0!==s?s:.4;if("string"==typeof d){var c=parseFloat(d);d=isNaN(c)?.4:c}return{enabled:l,fps:x(h,0,12,N("canvas recording fps"),4),quality:x(d,0,1,N("canvas recording quality"),.4)}}get Pt(){var t,e=!(null==(t=this.Me)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Dt(){var t,e,r,i=null==(t=this.Me)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),a=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),o=yr(this._instance.config.capture_performance),u=yr(null==i?void 0:i.capturePerformance),l=!!(R(o)?o:u);return s||a||l?{recordHeaders:s,recordBody:a,recordPerformance:l}:void 0}Ft(){var t,e,r=[],n=null==(t=s.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Pt&&r.push(n());var a=null==(e=s.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Dt&&k(a))if(!W.includes(i.hostname)||this._forceAllowLocalhostNetworkCapture){var o=k(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;r.push(a(((t,e,r)=>{var i,n={payloadSizeLimitBytes:tt.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...tt.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...tt.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,o=!1!==t.capture_performance&&e.recordPerformance,l=(i=Y(n),t=>(null!=t&&t.requestBody&&(t.requestBody=at(t.requestBody,t.requestHeaders,i,"Request")),null!=t&&t.responseBody&&(t.responseBody=at(t.responseBody,t.responseHeaders,i,"Response")),t)),h=e=>{return l(((t,e,r)=>{var i;if(null==r||!r(t.name)){var n=z(t.name),s=0===e.indexOf("http")?null==(i=z(e))?void 0:i.pathname:e;"/"===s&&(s="");var a=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&a&&st.some((t=>0===a.indexOf(t)))))return t}})((nt((i=e).requestHeaders),nt(i.responseHeaders),i),t.api_host,r));var i},d=k(t.session_recording.maskNetworkRequestFn);return d&&k(t.session_recording.maskCapturedNetworkRequestFn)&&D.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var r=t.session_recording.maskNetworkRequestFn({url:e.name});return!r&&e.isInitial?r:u({},e,{name:null==r?void 0:r.url})}),n.maskRequestFn=k(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r=h(e);if(r){var i=r.isInitial?{name:"",entryType:r.entryType,startTime:r.startTime,duration:r.duration,endTime:r.endTime,timeOrigin:r.timeOrigin,timestamp:r.timestamp,isInitial:!0}:void 0,n=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(r);return I(n)&&i?(ut.add(i),i):null!=n?n:void 0}}:t=>function(t){if(!S(t))return t.requestBody=ot(t.requestBody,"Request"),t.responseBody=ot(t.responseBody,"Response"),t}(h(t)),u({},tt,n,{recordHeaders:s,recordBody:a,recordPerformance:o,recordInitialRequests:o,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Dt,o)))}else Sr.info("NetworkCapture not started because we are on localhost.");return r}Nt(t){return this._instance.config.disable_capture_url_hashes?O(t):t}qt(t,e){void 0===e&&(e=!1);var r=e?O(t):this.Nt(t),i=this._instance.config.mask_personal_data_properties?[...Qe,...this._instance.config.custom_personal_data_properties||[]]:[];return this.jt(function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],s=(i[0]||"").split("?"),a=s[1],o=s[0],u=(a||"").split("&"),l=[],h=0;u.length>h;h++){var d=u[h].split("=");b(d)&&(e.includes(d[0])?l.push(d[0]+"=<masked>"):l.push(u[h]))}var c=o;return null!=a&&(c+="?"+l.join("&")),null!=n&&(c+="#"+n),c}(r,i))}jt(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var r,i=e.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}Bt(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Pe.length?this.Pe.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Sr.warn("could not emit queued rrweb event.",e,t),!1}}be(t,e){return this.Bt(Cr((()=>Ar().addCustomEvent(t,e))))}Ht(){var t;return this.Ae&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.J.urlBlocked&&!0!==this.De}Ut(t){if(!this.Ht())return!1;try{var e=Ar();return!!e&&(e.addCustomEvent("$json_ld",t),this.Ht())}catch(t){return!1}}$t(t){void 0===t&&(t=!1),Promise.resolve().then((()=>{var e;return null==(e=this.Wt)?void 0:e.scan(t)}))}zt(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),r=this.qt(e.origin+e.pathname+e.search);this.Vt!==r&&(this.Vt=r,this.be("$url_changed",{href:r}))}catch(t){}}Zt(){if(this.Pe.length){var t=[...this.Pe];this.Pe=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.Bt(t)}))}}de(){return this.Bt(Cr((()=>Ar().takeFullSnapshot())))}get Gt(){var t,e,r;if(null!=(t=this.Ie)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var i,n=null==(i=this._instance.config.session_recording)?void 0:i.trigger_pending_buffer_interval_millis;return A(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Qt(){if(this.Jt&&clearInterval(this.Jt),!0!==this.De){var t=this.Gt;t&&(this.Jt=setInterval((()=>{this.de()}),t))}}ve(t){"event"===t&&this.Yt(),!this.J.urlBlocked&&["sampled","active"].includes(this.status)&&this.Qt()}Kt(){var t;this.J.urlBlocked||(this.J.urlBlocked=!0,null==(t=this.Wt)||t.scan(),clearInterval(this.Jt),Sr.info("recording paused due to URL blocker"),this.be("recording paused",{reason:"url blocker"}))}Xt(){var t;this.J.urlBlocked&&(null==(t=this.Wt)||t.scan(),this.J.urlBlocked=!1,this.de(),this.$t(),this.Qt(),this.be("recording resumed",{reason:"left blocked url"}),Sr.info("recording resumed"))}er(t,e){var r;if("event"===t&&this.Yt(),!this.Oe&&null!=(r=this.Ie)&&r.hasPendingTriggers(this.sessionId)){this.Oe=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===t?mt:yt]:this.sessionId}),null==(n=this.Ie)||n.updateActiveTriggers(this.sessionId),this.ve(),this.xt(),this.he(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Oe=!1}}}get isStarted(){return!!this.Re}get Me(){var t=this._instance.get_property(lt);if(t){var e;try{e=_(t)?t:JSON.parse(t)}catch(t){return void Sr.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return Sr.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(i=this._instance.persistence)||i.unregister(lt))}return e}}tr(t,e,r){this._instance.get_property(t)&&(e(),r())}start(e){var i,n,s=this.Me;if(s){this.isStarted||(this.Ne=!1!==this.De&&!this.Be,this.Be=!1,this.qe=this.Ne,this.je=!1),this.tt&&(this.rr(),this.Ct());var a=this.Se.checkAndGetSessionAndWindowId(),o=a.windowId;this._e=a.sessionId,this.ut=o,null==(i=this._instance.persistence)||i.unregister(_t),null!=s&&s.endpoint&&(this.Ee=null==s?void 0:s.endpoint),this.Ie=2===(null==s?void 0:s.version)&&(null==s?void 0:s.triggerGroups)&&s.triggerGroups.length>0?new Je(this._instance,this.J,this.he.bind(this),this.be.bind(this),this.ve.bind(this)):new Ze(this._instance,this.J,this.Y,this.K,this.he.bind(this),this.de.bind(this),this.ve.bind(this)),this.Ie.onRemoteConfig(s),null==(n=this.pe)||n.call(this),this.pe=this.Ie.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.er(t,e))),this.tr(dt,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(dt)})),this.tr(ct,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(ct)})),this.tr(ft,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(ft)})),this.tr(vt,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(vt)})),this.Ie.makeSamplingDecisions(this.sessionId),this.ir(),this.He||(B(t,"beforeunload",this.kt),B(t,"pagehide",this.Mt),B(t,"offline",this.Tt),B(t,"online",this.It),B(r,"visibilitychange",this.Et),!this.it&&k(this.Se.onSessionId)&&(this.it=this.Se.onSessionId(this.st)),!this.nt&&k(this.Se.on)?this.nt=this.Se.on("forcedIdleReset",(()=>{this.ht(),this.De="unknown",this.stop(),this.ot=this.Se.onSessionId(((t,e,r)=>{var i;null==(i=this.ot)||i.call(this),this.ot=void 0,this.st(t,e,r)}))})):k(this.Se.on)||Sr.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),I(this.rt)&&(this.rt=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.qt(t.properties.$current_url):"";if(!e)return;this.be("$pageview",{href:e})}}catch(t){Sr.error("Could not add $pageview to rrweb session",t)}}))),this.status===Tt&&this.he(e||"recording_initialized"))}else Sr.info("remote config must be stored in persistence before recording can start")}nr(){var e,i,n,s,a,o;null==t||t.removeEventListener("beforeunload",this.kt),null==t||t.removeEventListener("pagehide",this.Mt),null==t||t.removeEventListener("offline",this.Tt),null==t||t.removeEventListener("online",this.It),null==r||r.removeEventListener("visibilitychange",this.Et),clearInterval(this.Jt),this.ar(),null==(e=this.rt)||e.call(this),this.rt=void 0,null==(i=this.pe)||i.call(this),this.pe=void 0,null==(n=this.it)||n.call(this),this.it=void 0,null==(s=this.nt)||s.call(this),this.nt=void 0,null==(a=this.ot)||a.call(this),this.ot=void 0,null==(o=this.Ie)||o.stop(),this.sr(),this.rr()}rr(){this.et+=1,this.Ke=[],this.Xe=0,this.ur=void 0,this.tt=!1}sr(){var t,e,r;null==(t=this.lr)||t.stop(),this.Pe=[],null==(e=this.Wt)||e.stop(),this.Wt=void 0,this.Ae=!1,null==(r=this.Re)||r.call(this),this.Re=void 0}cr(){if(!this.ur||0===this.Xe)return!1;if(this.tt)return!0;this.tt=!0;var t=this.et;return this.ar(),this.sr(),this.ur.catch((()=>{})).then((()=>{t===this.et&&(this.tt=!1,this.xt(),this.Ct(),this.nr(),Sr.info("stopped"))})).catch((()=>{this.tt=!1,this.nr(),Sr.info("stopped")})),!0}stop(){this.sr(),this.cr()||(this.xt(),this.Ct(),this.nr(),Sr.info("stopped"))}dt(t){var e;this.stop(),this.hr=void 0,this.dr=void 0,null==(e=Ir())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed"),this.Ne=t,this.qe=!1}Yt(){this.isStarted||(this.Be=!0),this.Ne&&(this.Ne=!1,this.qe=!1,this.je&&(this.je=!1,this.de()),this.vr())}discard(){this.Ct(),this.nr(),Sr.info("discarded")}pr(t,e,r,i,n){var s={$snapshot_bytes:r,$snapshot_data:e,$session_id:i,$window_id:n};this.status!==At?(this.gr(t,i),this.mr(s)):this.Ct()}yr(){try{this.br()}catch(t){this.We||(this.We=!0,Sr.error("could not track full snapshot cost",t))}}br(){var t,e=null==(t=Ir())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.dr&&(this.dr=e,this.hr&&this.hr.durationMs>=e.durationMs||(this.hr=e),500>e.durationMs||Sr.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}gr(t,e){t.type!==h.FullSnapshot?t.type===h.IncrementalSnapshot&&(S(this.Je)||this.Je===e||this.Ye===e||(this.Ye=e,Sr.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.de())):this.Je=e}wr(t){t.counted&&t.generation===this.et&&(this.Xe=Math.max(0,this.Xe-1)),t.counted=!1,this.Ke=this.Ke.filter((e=>e!==t))}kr(t,e,r){t.processed||t.generation!==this.et||(t.processed=!0,this.pr(t.event,e,r,t.targetSessionId,t.targetWindowId))}_r(t){try{var e=t.compressionEnabled?zr(t.event):{event:t.event,size:Kt(t.event)};this.kr(t,e.event,e.size)}finally{this.wr(t)}}St(){[...this.Ke].forEach((t=>{this._r(t)}))}Sr(t,e,r,i){var n=this,s={event:t,compressionEnabled:e,targetSessionId:r,targetWindowId:i,generation:this.et,processed:!1,counted:!0};this.Ke.push(s),this.Xe+=1;var a=function(){var r=o((function*(){try{if(s.processed)return;var r,i;try{var a=e?Pr(t)?yield function(t){return Ur.apply(this,arguments)}(t):zr(t):{event:t,size:Kt(t)};r=a.event,i=a.size}catch(e){Sr.error("could not process queued compression event - will use uncompressed event",e),r=t,i=Kt(t)}n.kr(s,r,i)}finally{n.wr(s)}}));return function(){return r.apply(this,arguments)}}();this.ur=this.ur?this.ur.catch((()=>{})).then(a):a()}onRRwebEmit(t){var e,r,i,n,s,a,o,u,l;if(this._instance.sessionManager&&(this.Zt(),t&&_(t))){if(t.type===h.Meta){var c=this.qt(t.data.href);if(this.Vt=c,!c)return;t.data.href=c}else this.zt();if(null==(e=this.Ie)||e.checkUrlTriggers(this.sessionId,(()=>this.Kt()),(()=>this.Xt()),((t,e)=>this.er(t,e))),!this.J.urlBlocked||(v=t).type===h.Custom&&"recording paused"===v.data.tag){var v,f,p,g;t.type===h.FullSnapshot&&(null!=(f=Ir())&&null!=f.wasMaxDepthReached&&f.wasMaxDepthReached()&&(this.$e=!0),this.yr(),Promise.resolve().then((()=>this.yr())),this.Qt(),null==(p=this.lr)||p.reset(),null==(g=this._instance.persistence)||g.register_once({[_t]:t.timestamp},void 0));var m=t.type===h.FullSnapshot&&(null==(r=this.Ie)?void 0:r.hasPendingTriggers(this.sessionId));m&&this.Cr();var y=this.lr?this.lr.throttleMutations(t):t;if(y){var w=function(t){var e=t;if(e&&_(e)&&6===e.type&&_(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=[],i=0;e.data.payload.payload.length>i;i++)r.push(e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?e.data.payload.payload[i].slice(0,2e3)+"...[truncated]":e.data.payload.payload[i]);return e.data.payload.payload=r,t}return t}(y),b=function(t){return qr(t)?t.data.payload:null}(w),k=function(t){return Gr(t)?t.data.payload:null}(w),S=function(t){return Hr(t)?t.data.payload:null}(w);b||k?null!=b&&b.lastActivityTimestamp&&(w.timestamp=b.lastActivityTimestamp):null!=S&&S.sessionId||this.Mr(w),t.type===h.FullSnapshot&&(this.Qe.push([this._e,t.timestamp]),this.Qe.length>6&&(this.Qe=this.Qe.slice(-6)));var M=null!==(i=null!==(n=null!==(s=null==b?void 0:b.currentSessionId)&&void 0!==s?s:null==k?void 0:k.nextSessionId)&&void 0!==n?n:null==S?void 0:S.sessionId)&&void 0!==i?i:this._e,C=null!==(a=null!==(o=null!==(u=null==b?void 0:b.currentWindowId)&&void 0!==u?u:null==k?void 0:k.nextWindowId)&&void 0!==o?o:null==S?void 0:S.windowId)&&void 0!==a?a:this.ut;if(!0!==this.De||function(t){return Hr(t)||qr(t)||Gr(t)}(w)){w.type===h.FullSnapshot&&(this.Fe=0),S&&(w.timestamp=S.lastActivityTimestamp+S.threshold);var I=this.Ae;this.Ae=!0,m?this.$t(!0):I||this.$t();var A=null===(l=this._instance.config.session_recording.compress_events)||void 0===l||l;if(this.Xe>0||A&&Pr(w))this.Sr(w,A,M,C);else{var R=A?zr(w):{event:w,size:Kt(w)};this.pr(w,R.event,R.size,M,C)}}else(function(t){return t.type===h.FullSnapshot||t.type===h.Meta||t.type===h.IncrementalSnapshot&&t.data.source!==d.CanvasMutation})(w)&&this.Fe++}else!0===this.De&&this.Fe++}}}get status(){return this.Ie?this.Ie.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.Ce,rrwebError:this.He,urlTriggerMatching:this.J,eventTriggerMatching:this.Y,linkedFlagMatching:this.K,remoteConfig:this.Me}):At}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.K.linkedFlagSeen=!0,this.de(),this.Yt(),this.he("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[pt]:this.sessionId,[ht]:null}),this.de(),this.Yt(),this.he("sampling_overridden")}overrideTrigger(t){this.er(t),this.Yt()}Tr(){try{var e,r=null==t||null==(e=t.location)?void 0:e.href;if(!r)return;var i=this.qt(r);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}ar(){this.Ir&&(clearTimeout(this.Ir),this.Ir=void 0)}vr(){this.Ir||(this.Ir=setTimeout((()=>{this.xt()}),2e3))}Er(){return this.Je!==this.yt.sessionId&&0!==this.yt.data.length&&this.yt.data.every((t=>(null==t?void 0:t.type)===h.Custom&&!qr(t)&&!Gr(t)))}Rr(){var t,e;return null!==(t=null==(e=this.Ie)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Ar(t){if(t!==xt)return S(this.Lr)||this._instance.register_for_session({[Ct]:[]}),void(this.Lr=void 0);var e=this.Rr();if(0===e.length)return S(this.Lr)||this._instance.register_for_session({[Ct]:[]}),void(this.Lr=void 0);var r=e.join(", "),i=this.sessionId+":"+r;i!==this.Lr&&(this.Lr=i,this._instance.register_for_session({[Ct]:e}),Sr.info("buffering: "+r))}xt(){var t;if(this.ar(),this.Ne)return this.yt;if(this.Er())return this.yt.size>kr?this.Ct():this.yt;var e=this.yt;null==(t=this.Ie)||t.ensureSamplingDecision(this.sessionId);var r=this.bt(),i=this.status;if(this.Ar(i),i===xt||i===Et||i===At||r)return this.vr(),this.yt;if(this.yt!==e)return this.yt;if(e.data.length>0){var n,s=this.Tr();te(e).forEach((t=>{var e;null==(e=this.ct)||e.trackSize(t.sessionId,t.size),this.Or({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:F.LIB_NAME,$lib_version:F.LIB_VERSION,$snapshot_host:s})})),null==(n=this.Ie)||n.onFlushComplete()}return this.Ct()}mr(t){var e,r=2+((null==(e=this.yt)?void 0:e.data.length)||0),i=t.$session_id,n=this.yt.sessionId!==i;if(n||!0!==this.De&&!this.Ne&&this.yt.size+t.$snapshot_bytes+r>kr){var s=this._e;if(this.yt=this.xt(),this._e!==s)return;n&&this.yt.data.length>0&&(this.yt=this.Ct()),this.yt.sessionId=i,this.yt.windowId=t.$window_id}this.Ne&&(this.je||this.yt.size+t.$snapshot_bytes+r>kr)?this.je||(this.je=!0,this.yt=this.Ct()):(this.yt.size+=t.$snapshot_bytes,this.yt.data.push(t.$snapshot_data),this.yt.sizes.push(t.$snapshot_bytes),!0===this.De||this.Ne||this.vr())}Or(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.Ee),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get wt(){var t,e,r=null==(t=this.yt)?void 0:t.data[(null==(e=this.yt)?void 0:e.data.length)-1],i=this.Se.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i.sessionStartTimestamp:null}Cr(){if(!this.yt||0===this.yt.data.length)return this.Ct();for(var t=-1,e=this.yt.data.length-1;e>=0;e--)if(this.yt.data[e].type===h.Meta){t=e;break}return 0>t?this.Ct():(this.yt.data=this.yt.data.slice(t),this.yt.sizes=this.yt.sizes.slice(t),this.yt.size=this.yt.sizes.reduce(((t,e)=>t+e),0),this.yt)}Ct(){return this.yt={size:0,data:[],sizes:[],sessionId:this._e,windowId:this.ut},this.yt}he(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),Sr.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.be("$recording_started",u({reason:t},e))}Pr(t){var e;return 3===t.type&&-1!==Mr.indexOf(null==(e=t.data)?void 0:e.source)}Mr(t){var e=this.Pr(t);e||!0===this.De||t.timestamp-this.Le>this.xe&&(this.De=!0,clearInterval(this.Jt),this.be("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Le,threshold:this.xe,bufferLength:this.yt.data.length,bufferSize:this.yt.size,sessionId:this._e,windowId:this.ut}),this.xt());var r=!1;if(e&&(this.Le=t.timestamp,this.De)){var i="unknown"===this.De;this.De=!1,i||(this.be("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}var n=this.Se.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,a=n.sessionId,o=this._e!==a,u=this.ut!==s;if(this.ut=s,this._e=a,o||u){var l=o&&!1!==this.De;l&&(this.De="unknown"),this.dt(l)}else if(e&&this.Yt(),r){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.Ie)?void 0:h.hasPendingTriggers(this.sessionId));this.Fe>0&&d&&this.de(),this.$t(),this.Qt()}}ht(){var t;null==(t=this.Ie)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,r,i,n,s,a,o,u,l=this.Se.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=Ir())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.yt.data.length,$sdk_debug_replay_internal_buffer_size:this.yt.size,$sdk_debug_current_session_duration:this.wt,$sdk_debug_session_start:l,$sdk_debug_replay_flushed_size:null==(e=this.ct)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Qe,$snapshot_max_depth_exceeded:this.$e,$sdk_debug_replay_slowest_full_snapshot_ms:mr(null==(r=this.hr)?void 0:r.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:mr(null==(i=this.hr)?void 0:i.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.hr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.hr)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.hr)?void 0:a.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:mr(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:mr(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:mr(null==(o=Ir())||null==o.getMutationCost||null==(o=o.getMutationCost())?void 0:o.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(u=Ir())||null==u.getDiscardedDurationSamples?void 0:u.getDiscardedDurationSamples(),$sdk_debug_replay_rrweb_error:this.He,$sdk_debug_rrweb_attached:!!this.Re,$sdk_debug_rrweb_start_attempted:this.Ue}}ir(){var e;if(!this.Re){this.Ue=!0;var i,n,s,a,o={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,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},l=this._instance.config.session_recording;for(var h of Object.entries(l||{})){var d=h[0],c=h[1];if(d in o)if("maskInputOptions"===d)o.maskInputOptions=u({password:!0},c);else if("sampling"===d){var v=null!=c?c:{},f={};S(v.mousemove)||(f.mousemove=v.mousemove),S(v.mouseInteraction)||(f.mouseInteraction=v.mouseInteraction),o.sampling=f}else o[d]=c}!0===(null==l?void 0:l.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=u({},o.slimDOMOptions,{script:!0})),this.Ot&&this.Ot.enabled&&(o.recordCanvas=!0,o.sampling=u({},o.sampling,{canvas:this.Ot.fps}),o.dataURLOptions={type:"image/webp",quality:this.Ot.quality},o.canvasResolutionScale=this.Lt,o.canvasMasking={configured:()=>{var t;return k(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,r=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(k(r))try{var i;return null!==(i=r(t))&&void 0!==i?i:null}catch(t){return this.Ze||(this.Ze=!0,Sr.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Rt&&(o.maskAllInputs=null===(i=this.Rt.maskAllInputs)||void 0===i||i,o.maskTextSelector=null!==(n=this.Rt.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(s=this.Rt.blockSelector)&&void 0!==s?s:void 0,o.maskAllElementAttributes=null!==(a=this.Rt.maskAllElementAttributes)&&void 0!==a&&a),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.Ve||(this.Ve=!0,Sr.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.At();var p=Ar();if(p){this.lr=null!==(e=this.lr)&&void 0!==e?e:new Pe(p,{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";Sr.info(r,{node:e}),this.log(_r+" "+r,"warn")}});var g=this.Ft();if(this.Re=p(u({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.Ge||(this.Ge=!0,Sr.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.Re)return this.He=!0,void Sr.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.He=!1,!0===(null==l?void 0:l.captureJsonLd)&&r&&null!=t&&t.MutationObserver&&!this.Wt&&(this.Wt=function(t,e,r){var i=new WeakMap,n=r.getCaptureState||(()=>!0),s=Xe,a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){for(var r=t;r;){if(pr(r,e.blockClass,e.blockSelector)||pr(r,e.maskTextClass,e.maskTextSelector))return!0;var i=r.parentNode;r=r.parentElement||(i&&i.nodeType===i.DOCUMENT_FRAGMENT_NODE?i.host:null)}return!1}(e,r))return;var o=function(t){if(!t||t.length>Xe)return null;try{var e=JSON.parse(t),r=b(e)?e.map(vr):vr(e);if(C(r)||b(r)&&(!r.length||r.some(C)))return null;var i=JSON.stringify(r);return i.length>2e4?null:[r,i]}catch(t){return null}}(e.text);if(!o)return void i.delete(e);var u=o[0],l=o[1];if(C(a))return void i.set(e,l);if(i.get(e)!==l){if(l.length>s)return void(s=0);r.emit(u)&&(i.set(e,l),s-=l.length)}}catch(t){return}};try{var o=new e((t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of gr(t))a(e)};for(var r of t)if("childList"===r.type)fr(r.target)&&a(r.target),r.addedNodes.forEach(e);else if("characterData"===r.type){var i=r.target.parentNode;i&&fr(i)&&a(i)}else"attributes"===r.type&&fr(r.target)&&a(r.target)}catch(t){return}}));return o.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&gr(t.documentElement).forEach((t=>{e&&i.delete(t),a(t)}))},stop(){return o.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(r,t.MutationObserver,{blockClass:o.blockClass,blockSelector:o.blockSelector,maskTextClass:o.maskTextClass,maskTextSelector:o.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.J.urlBlocked||this.J.isCurrentUrlBlocked()?null:this.Ht()},emit:t=>this.Ut(t)}),this.J.isCurrentUrlBlocked()&&this.Wt.scan()),this.Le=Date.now(),this.De=R(this.De)?this.De:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Me),this.be("$session_options",{sessionRecordingOptions:o,activePlugins:g.map((t=>null==t?void 0:t.name))}),this.be("$posthog_config",{config:this._instance.config})}else Sr.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.be(t,e)}}var Zr,Jr=["type"],Qr=Object.defineProperty,Xr=(t,e,r)=>((t,e,r)=>e in t?Qr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Kr=(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))(Kr||{}),Yr=(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))(Yr||{}),ti=(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))(ti||{}),ei=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(ei||{}),ri=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(ri||{}),ii=(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))(ii||{}),ni=(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))(ni||{});function si(t,e){return-1!==t.indexOf(e)}var ai={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},oi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},ui={};function li(t){if(ui[t])return ui[t];var e=function(t){var e,r,i=null==(r=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in ai?ai[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in oi?oi[t]:void 0,a=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&a)return ui[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var u,l=!1;try{document.body.appendChild(o);var h=o.contentWindow;if(!h)return e.prototype;var d=h[t].prototype;return d?(si(u=navigator.userAgent,"AppleWebKit")&&!si(u,"Chrome")&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),ui[t]=d):r}catch(t){return r}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var hi={};function di(t,e,r){var i,n=t+"."+String(r);if(hi[n])return hi[n].call(e);var s=li(t),a=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return a?(hi[n]=a,a.call(e)):e[r]}var ci={};function vi(t,e,r){var i=t+"."+String(r);if(ci[i])return ci[i].bind(e);var n=li(t)[r];return"function"!=typeof n?e[r]:(ci[i]=n,n.bind(e))}function fi(){return li("MutationObserver").constructor}function pi(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},s=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var r=t[e];"function"==typeof r&&r.__rrweb_layer__;){var i=r.__rrweb_layer__;if(i.next===s)return void(i.next=n.next);r=i.next}else t[e]=n.next}}catch(t){return()=>{}}}var gi={childNodes:t=>di("Node",t,"childNodes"),parentNode:t=>di("Node",t,"parentNode"),parentElement:t=>di("Node",t,"parentElement"),textContent:t=>di("Node",t,"textContent"),contains:(t,e)=>vi("Node",t,"contains")(e),getRootNode:t=>vi("Node",t,"getRootNode")(),host:t=>t&&"host"in t?di("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?di("Element",t,"shadowRoot"):null,querySelector:(t,e)=>vi("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>vi("Element",t,"querySelectorAll")(e),mutationObserver:fi,patch:pi},mi=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function yi(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var wi=0,bi=6e4;function ki(){wi+=1}function _i(){return wi}function Si(t,e){return e!==wi||t>bi}var Mi=0,Ci=0,Ii=0,Ai=mi(),Ri=null,Ti=null,xi=[],Ei=0,Oi=0,Fi={slowestBatchMs:0},Li={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},Di=t=>t&&t>0?t:null;function Ni(t){(Mi+=1)>1||(Ai=mi(),xi=[],Ei=0,Ti=Di(t),Ci=yi(),Ii=wi)}function Pi(){return 0===Mi?Ri||mi():(Mi-=1)>0?Ai:(Ai.durationMs=yi()-Ci,Ai.deferredStylesheetCount=Ei,Li.deferredCount+=Ei,Ti=null,Si(Ai.durationMs,Ii)?Ai:Ri=Ai)}var Bi=32;function $i(t,e,r){var i=t.length;if(r>=Bi)return i;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)i+=$i(a,e,r+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var u=o.rules||o.cssRules;u&&(i+=$i(u,e,r+1))}}}catch(t){}}return i}function Wi(t){if(0!==Mi){var e=$i(t,null,0);Ai.cssRuleCount+=e,Oi>0&&(Ai.nonDeferrableCssRuleCount+=e)}}function zi(t){Oi+=1;try{return t()}finally{Oi-=1}}function Ui(t){Mi>0&&(Ai.stylesheetMs+=t)}function ji(t){if(0===Mi||null===Ti)return!1;var e=Ai.cssRuleCount-Ai.nonDeferrableCssRuleCount;return e>=Ti||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),$i(e,r,0)}catch(t){return 0}}(t)>Ti}function Hi(){Li.failedCount+=1}function qi(t){t>0&&(Li.abandonedCount+=t)}function Gi(t){return t.nodeType===t.ELEMENT_NODE}function Vi(t){var e=t&&"host"in t&&"mode"in t&&gi.host(t)||null;return Boolean(e&&"shadowRoot"in e&&gi.shadowRoot(e)===t)}function Zi(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Ji(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function Qi(t){var e=t.cssText;if(3>e.split('"').length)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(" ")+";"}var Xi=0;function Ki(t){var e=0===Xi,r=e?yi():0;Xi+=1;try{var i=t.rules||t.cssRules;if(!i)return null;Wi(i);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Ji(Array.from(i,(t=>Yi(t,n))).join(""))}catch(t){return null}finally{Xi-=1,e&&Ui(yi()-r)}}function Yi(t,e){var r;if(en(t)){var i;try{i=Ki(t.styleSheet)||Qi(t)}catch(e){i=t.cssText}try{if(i&&(null==(r=t.styleSheet)?void 0:r.href))return yn(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return rn(t)&&t.selectorText.includes(":")&&(n=tn(n)),e?yn(n,e):n}function tn(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function en(t){return"styleSheet"in t}function rn(t){return"selectorText"in t}var nn=/^-?[A-Za-z_][\w-]*$/,sn=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function an(t){var e=[],r=!1,i=null,n=new Map;function s(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}var o=e[e.length-1];return o.parts.push(t),void(o.index+=1)}if(!n.importRule)return r=!0,void(i=t);a(e[e.length-1],n.importRule,t)}function a(t,e,r){var i;try{var n;try{n=r||Qi(e)}catch(t){n=e.cssText}try{n&&(null==(i=e.styleSheet)?void 0:i.href)&&(n=yn(n,e.styleSheet.href))}catch(t){}n&&t.parts.push(n),t.index+=1}catch(t){s(null)}}function o(t){var r=t.rules[t.index];if("sheet"===t.kind&&en(r)){var i=n.get(r);return null===i?(t.parts.push(r.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:r}):void a(t,r,null)}if(!function(t,r){try{var i=function(t){var e,r=t;if(!r.cssRules||0===r.cssRules.length)return null;if(r.media&&"string"==typeof r.media.mediaText)return"@media "+r.media.mediaText+" {";if(rn(t)){if("number"==typeof r.type&&1!==r.type)return null;var i=r.style?r.style.cssText:"";return t.selectorText+" {"+(i?" "+i:"")}if("containerName"in r)return"string"!=typeof r.containerQuery||r.containerName&&!nn.test(r.containerName)?null:"@container "+(r.containerName?r.containerName+" ":"")+r.containerQuery+" {";if("string"==typeof r.conditionText){var n="";try{n=(null==(e=t.constructor)?void 0:e.name)||""}catch(t){return null}return""===n||"Object"===n||"CSSSupportsRule"===n?"@supports "+r.conditionText+" {":null}return"string"==typeof r.name?"keyText"in r.cssRules[0]?nn.test(r.name)?"@keyframes "+r.name+" {":null:""===r.name?"@layer {":sn.test(r.name)?"@layer "+r.name+" {":null:null}(t);if(null===i)return!1;var n=r.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?yn(i,n):i,fixColons:"sheet"===r.kind&&rn(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(r,t)){var s=r.cssText;"sheet"===t.kind&&rn(r)&&r.selectorText.includes(":")&&(s=tn(s)),t.parts.push(t.sheetHref?yn(s,t.sheetHref):s),t.index+=1}}return function(t){try{var r=t.rules||t.cssRules;if(!r)return!1;Wi(r);var i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);var s=Array.from(r);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){for(var r=[{sheet:e,rules:t,index:0}],i=function(){var t=r[r.length-1];if(t.index>=t.rules.length)return r.pop(),0;var e=t.rules[t.index];if(t.index+=1,!en(e)||n.has(e))return 0;var i=null;try{i=e.styleSheet}catch(t){return n.set(e,null),0}if(!i||r.some((t=>t.sheet===i)))return 0;try{var s=i.rules||i.cssRules;if(!s)return 0;Wi(s);var a=i.href;!a&&i.ownerNode&&(a=i.ownerNode.baseURI);var o=Array.from(s);n.set(e,{sheet:i,rules:o,sheetHref:a}),r.push({sheet:i,rules:o,index:0})}catch(t){}};r.length>0;)i()}(s,t),!0}catch(t){return!1}}(t)||(r=!0),{advance(t){if(r)return!0;var n=yi(),a=t>0?t:1;try{for(;!r&&a>0;){var u=e[e.length-1];if(u.rules.length>u.index){a-=1;try{o(u)}catch(t){s(null)}}else{var l=null;try{if("group"===u.kind){var h=u.prelude+u.parts.join("")+"}";l=u.fixColons?tn(h):h}else l=Ji(u.parts.join(""))}catch(t){}s(l)}}}catch(t){r=!0,i=null}finally{Ui(yi()-n)}return r},text:()=>r?i:null,remainingRules(){if(r)return 0;var t=0;for(var i of e)t+=i.rules.length-i.index;return t}}}class on{constructor(){Xr(this,"idNodeMap",new Map),Xr(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);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),Gi(t)){var r=gi.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function un(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&ln(n);return(r[i.toLowerCase()]||o&&r[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function ln(t){return t.toLowerCase()}var hn=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function dn(t){var e=t.element,r=t.name,i=t.value,n=t.maskAttributeFn,s=t.isGenerated;return i?t.maskAllElementAttributes?void 0!==s&&s&&hn.has(ln(r))?i:"*".repeat(i.length):n?n(r,i,e):i:i}var cn="__rrweb_original__";function vn(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ln(e):null}catch(t){return null}}var fn=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,pn=/^(?:[a-z+]+:)?\/\//i,gn=/^www\..*/i,mn=/^(data:)([^,]*),(.*)/i;function yn(t,e){return(t||"").replace(fn,((t,r,i,n,s,a)=>{var o,u=i||s||a,l=r||n||"";if(!u)return t;if(pn.test(u)||gn.test(u))return"url("+l+u+l+")";if(mn.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((o=e).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),d=u.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+l+h.join("/")+l+")"}))}var wn,bn,kn="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",_n=4096,Sn=1e5,Mn=10,Cn=new Map,In=1,An=new RegExp("[^a-z0-9-_:]"),Rn=-2;function Tn(){return In++}var xn=/^[^ \t\n\r\u000c]+/,En=/^[, \t\n\r\u000c]+/,On=new WeakMap;function Fn(t,e){return e&&""!==e.trim()?Ln(t,e):e}function Ln(t,e){var r=On.get(t);if(r||(r=t.createElement("a"),On.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function Dn(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?kn:t}(t,e.maxBase64ImageLength):t}function Nn(t,e,r,i,n,s){var a;if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var o=null==(a=n.sheet)?void 0:a.href;if(o)return o}var u=Fn(t,i);if(u.startsWith("data:")){if("img"===e&&n){var l=u;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(l=function(t,e,r,i){if(Sn>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>_n||t.naturalHeight>_n)return e;var n=Cn.get(e);if(n&&n.type===r&&n.quality===i)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(r||"image/webp",null!=i?i:.4),u=e.length>o.length?o:e;if(Cn.size>=Mn){var l=Cn.keys().next().value;void 0!==l&&Cn.delete(l)}return Cn.set(e,{type:r,quality:i,result:u}),u}catch(t){return e}}(n,u,s.type,s.quality)),Dn(l,s)}if("image"===e)return Dn(u,s)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=Fn(t,i);return"image"===e&&h.startsWith("data:")?Dn(h,s):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(En),e.length>r;){var s=i(xn);if(","===s.slice(-1))s=Fn(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Fn(t,s);for(var o=!1;;){var u=e.charAt(r);if(""===u){n.push((s+a).trim());break}if(o)")"===u&&(o=!1);else{if(","===u){r+=1,n.push((s+a).trim());break}"("===u&&(o=!0)}a+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?yn(i,Ln(t)):"object"===e&&"data"===r?Fn(t,i):i:Fn(t,i)}function Pn(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function Bn(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&Bn(gi.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&Bn(gi.parentNode(t),e,r)}function $n(t,e,r,i){var n;if(Gi(t)){if(!gi.childNodes(n=t).length)return!1}else{if(null===gi.parentElement(t))return!1;n=gi.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(Bn(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function Wn(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var zn=new Map;function Un(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function jn(t){return null==t?"":t.toLowerCase()}var Hn=50,qn=!1,Gn=!1;function Vn(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,u=e.skipChild,l=void 0!==u&&u,h=e.inlineStylesheet,d=void 0===h||h,c=e.maskInputOptions,v=void 0===c?{}:c,f=e.maskTextFn,p=e.maskInputFn,g=e.maskAllElementAttributes,m=void 0!==g&&g,y=e.maskAttributeFn,w=e.slimDOMOptions,b=e.dataURLOptions,k=void 0===b?{}:b,_=e.inlineImages,S=void 0!==_&&_,M=e.recordCanvas,C=void 0!==M&&M,I=e.canvasMaskingConfigured,A=e.onSerialize,R=e.onIframeLoad,T=e.iframeLoadTimeout,x=void 0===T?5e3:T,E=e.onIframeListenerRegistered,O=e.onStylesheetLoad,F=e.stylesheetLoadTimeout,L=void 0===F?5e3:F,D=e.keepIframeSrcFn,N=void 0===D?()=>!1:D,P=e.newlyAddedElement,B=void 0!==P&&P,W=e.depth,z=void 0===W?0:W,U=e.maxDepth,j=void 0===U?Hn:U,H=e.needsMask,q=e.preserveWhiteSpace,G=void 0===q||q;if(z>=j)return Gn=!0,qn||(qn=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+j+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;H||(H=$n(t,a,o,void 0===H)),Mi>0&&(Ai.nodeCount+=1);var V,Z=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,u=void 0===o?{}:o,l=e.maskTextFn,h=e.maskInputFn,d=e.maskAllElementAttributes,c=void 0!==d&&d,v=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,w=e.keepIframeSrcFn,b=e.newlyAddedElement,k=void 0!==b&&b,_=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:ni.Document,childNodes:[],compatMode:t.compatMode}:{type:ni.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:ni.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:_};case t.ELEMENT_NODE:return function(t,e){for(var r,i,n,s=e.doc,a=e.inlineStylesheet,o=e.maskInputOptions,u=void 0===o?{}:o,l=e.maskInputFn,h=e.maskAllElementAttributes,d=void 0!==h&&h,c=e.maskAttributeFn,v=e.dataURLOptions,f=void 0===v?{}:v,p=e.inlineImages,g=e.recordCanvas,m=e.canvasMaskingConfigured,y=e.keepIframeSrcFn,w=e.newlyAddedElement,b=void 0!==w&&w,k=e.rootId,_=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),S=function(t){if(t instanceof HTMLFormElement)return"form";var e=ln(t.tagName);return An.test(e)?"div":e}(t),M=new Set,C={},I=t.attributes.length,A=0;I>A;A++){var R=t.attributes[A];Pn(S,R.name)||(C[R.name]=Nn(s,S,ln(R.name),R.value,t,f))}if("link"===S&&a&&!_){var T=t.sheet;if(!T){var x=function(t){return t.href}(t);x&&!(T=Un(s,x))&&x.includes(".css")&&(T=Un(s,window.location.origin+"/"+x.replace(window.location.href,"")))}var E=null;T&&(ji(T)?Mi>0&&(xi.push(t),Ei+=1):E=Ki(T)),E&&(delete C.rel,delete C.href,C._cssText=E)}if("style"===S&&t.sheet&&!(t.innerText||gi.textContent(t)||"").trim().length){var O=zi((()=>Ki(t.sheet)));O&&(C._cssText=O)}if("input"===S||"textarea"===S||"select"===S){var F=t.value,L=t.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&F?C.value=un({element:t,type:vn(t),tagName:S,value:F,maskInputOptions:u,maskInputFn:l}):L&&(C.checked=L)}if("option"===S&&(t.selected&&!u.select?C.selected=!0:delete C.selected),"dialog"===S&&t.open){try{C.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){C.rr_open_mode="modal",C.ph_rr_could_not_detect_modal=!0}M.add("rr_open_mode")}if("canvas"===S&&g&&!(null==m?void 0:m()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((cn in n?n[cn]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(C.rr_dataURL=t.toDataURL(f.type,f.quality));else if(!("__context"in t)){var D=t.toDataURL(f.type,f.quality),N=s.createElement("canvas");N.width=t.width,N.height=t.height,D!==N.toDataURL(f.type,f.quality)&&(C.rr_dataURL=D)}var P,B,W=!1;if("img"===S&&p){wn||(wn=s.createElement("canvas"),bn=wn.getContext("2d"));var z=t,U=z.currentSrc||z.getAttribute("src")||"<unknown-src>",j=z.crossOrigin,H=(e,r)=>W?dn({element:t,name:e,value:r,maskAllElementAttributes:d,maskAttributeFn:c}):r,q=()=>{Wn(z,"load",q);try{wn.width=z.naturalWidth,wn.height=z.naturalHeight,bn.drawImage(z,0,0);var t=wn.toDataURL(f.type,f.quality);C.rr_dataURL=H("rr_dataURL",t)}catch(t){if("anonymous"!==z.crossOrigin)return z.crossOrigin="anonymous",void(z.complete&&0!==z.naturalWidth?q():z.addEventListener("load",q));console.warn("Cannot inline img src="+U+"! Error: "+t)}"anonymous"===z.crossOrigin&&(j?C.crossOrigin=H("crossOrigin",j):z.removeAttribute("crossorigin"))};z.complete&&0!==z.naturalWidth?q():z.addEventListener("load",q)}if("audio"===S||"video"===S){var G=C;G.rr_mediaState=t.paused?"paused":"played",M.add("rr_mediaState"),G.rr_mediaCurrentTime=t.currentTime,G.rr_mediaPlaybackRate=t.playbackRate,G.rr_mediaMuted=t.muted,G.rr_mediaLoop=t.loop,G.rr_mediaVolume=t.volume}if(b||(t.scrollLeft&&(C.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(C.rr_scrollTop=t.scrollTop)),_){var V=t.getBoundingClientRect(),Z=V.width,J=V.height,Q=V.left,X=V.top,K=null==(r=s.defaultView)?void 0:r.getComputedStyle(t);C={class:C.class,rr_width:Z+"px",rr_height:J+"px",rr_left:Math.floor(Q+((null==(i=s.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(X+((null==(n=s.defaultView)?void 0:n.scrollY)||0))+"px"},M.add("rr_width"),M.add("rr_height"),M.add("rr_left"),M.add("rr_top"),K&&(C.rr_position=K.position||"static",M.add("rr_position"),K.transform&&"none"!==K.transform&&(C.rr_transform=K.transform,M.add("rr_transform")),K.display&&K.display.startsWith("inline")&&(C.rr_display=K.display,M.add("rr_display")))}if("iframe"!==S||y(C.src)||(t.contentDocument||(C.rr_src=C.src),delete C.src),d||c)for(var Y of Object.entries(C)){var tt=Y[0],et=Y[1];"string"!=typeof et&&null!==et||(C[tt]=dn({element:t,name:tt,value:et,maskAllElementAttributes:d,maskAttributeFn:c,isGenerated:M.has(tt)}))}W=!0;try{customElements.get(S)&&(P=!0)}catch(t){}return{type:ni.Element,tagName:S,attributes:C,childNodes:[],isSVG:(B=t,Boolean("svg"===B.tagName||B.ownerSVGElement)||void 0),needBlock:_,rootId:k,isCustom:P}}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,maskAllElementAttributes:c,maskAttributeFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:w,newlyAddedElement:k,rootId:_});case t.TEXT_NODE:return function(t,e){var r,i=e.needsMask,n=e.maskTextFn,s=e.rootId,a=gi.parentNode(t),o=a&&a.tagName,u=gi.textContent(t),l="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(l&&u){try{if(t.nextSibling||t.previousSibling);else if(ji(a.sheet));else if(null==(r=a.sheet)?void 0:r.cssRules){var d=Ki(a.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(u=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=yn(u,Ln(e.doc))}return h&&(u="SCRIPT_PLACEHOLDER"),!l&&!h&&u&&i&&(u=n?n(u,gi.parentElement(t)):u.replace(/[\S]/g,"*")),{type:ni.Text,textContent:u||"",isStyle:l,rootId:s}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:_});case t.CDATA_SECTION_NODE:return{type:ni.CDATA,textContent:"",rootId:_};case t.COMMENT_NODE:return{type:ni.Comment,textContent:gi.textContent(t)||"",rootId:_};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:H,inlineStylesheet:d,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:I,keepIframeSrcFn:N,newlyAddedElement:B});if(!Z)return console.warn(t,"not serialized"),null;V=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===ni.Comment)return!0;if(t.type===ni.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(jn(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===jn(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(jn(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&jn(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(jn(t.attributes.property).match(/^(og|twitter|fb):/)||jn(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===jn(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(jn(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(jn(t.attributes.name))||jn(t.attributes.property).match(/^article:/)||jn(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(jn(t.attributes.name)))return!0}}return!1}(Z,w)||!G&&Z.type===ni.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?Rn:Tn();var J=Object.assign(Z,{id:V});if(i.add(t,J),V===Rn)return null;A&&A(t);var Q=!l;if(J.type===ni.Element){Q=Q&&!J.needBlock,delete J.needBlock;var X=gi.shadowRoot(t);X&&Zi(X)&&(J.isShadowHost=!0)}if((J.type===ni.Document||J.type===ni.Element)&&Q){w.headWhitespace&&J.type===ni.Element&&"head"===J.tagName&&(G=!1);var K={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:a,maskTextSelector:o,skipChild:l,inlineStylesheet:d,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:w,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:I,preserveWhiteSpace:G,onSerialize:A,onIframeLoad:R,iframeLoadTimeout:x,onIframeListenerRegistered:E,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:N,depth:z+1,maxDepth:j};if(J.type===ni.Element&&"textarea"===J.tagName&&void 0!==J.attributes.value);else for(var Y of Array.from(gi.childNodes(t))){var tt=Vn(Y,K);tt&&J.childNodes.push(tt)}var et=null;if(Gi(t)&&(et=gi.shadowRoot(t)))for(var rt of Array.from(gi.childNodes(et))){var it=Vn(rt,K);it&&(Zi(et)&&(it.isShadow=!0),J.childNodes.push(it))}}var nt=gi.parentNode(t);if(nt&&Vi(nt)&&Zi(nt)&&(J.isShadow=!0),J.type===ni.Element&&"iframe"===J.tagName){var st=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var a=()=>e();if("complete"!==i){var o=!1,u=null,l=()=>{o||(o=!0,null!==u&&(clearTimeout(u),u=null),Wn(t,"load",h),t.addEventListener("load",a),e())},h=()=>l();return u=setTimeout(l,r),t.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),o?Wn(t,"load",a):(o=!0,Wn(t,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(t){return n}if(d!==c||t.src===c||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",a),()=>{clearTimeout(v),Wn(t,"load",a)}}return t.addEventListener("load",a),()=>{Wn(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&R){var r=Vn(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:w,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:I,preserveWhiteSpace:G,onSerialize:A,onIframeLoad:R,iframeLoadTimeout:x,onIframeListenerRegistered:E,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:N,depth:z+1,maxDepth:j});r&&R(t,r)}}),x);null==E||E(t,st)}return J.type===ni.Element&&"link"===J.tagName&&"stylesheet"===J.attributes.rel&&function(e,u,l){if(!zn.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var c=new AbortController,g=!1,b=()=>{if(!g){g=!0;try{(()=>{if(O){var e=Vn(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:w,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:I,preserveWhiteSpace:G,onSerialize:A,onIframeLoad:R,iframeLoadTimeout:x,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:N,depth:z,maxDepth:j});e&&O(t,e)}})()}finally{zn.delete(e),c.abort()}}},_=setTimeout(b,l);c.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),e.addEventListener("load",b,{signal:c.signal,once:!0}),zn.set(e,c)}}}(t,0,L),J}function Zn(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class Jn{constructor(){Xr(this,"parentElement",null),Xr(this,"parentNode",null),Xr(this,"ownerDocument"),Xr(this,"firstChild",null),Xr(this,"lastChild",null),Xr(this,"previousSibling",null),Xr(this,"nextSibling",null),Xr(this,"ELEMENT_NODE",1),Xr(this,"TEXT_NODE",3),Xr(this,"nodeType"),Xr(this,"nodeName"),Xr(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Jn))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"}}function Qn(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>Xn(r,t,e,i)}function Xn(t,e,r,i){Kn((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))}))}function Kn(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var Yn="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.",ts={map:{},getId(){return console.error(Yn),-1},getNode(){return console.error(Yn),null},removeNodeFromMap(){console.error(Yn)},has(){return console.error(Yn),!1},reset(){console.error(Yn)}};function es(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,a=new Array(s),o=0;s>o;o++)a[o]=arguments[o];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;0>=l||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,a)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,a)}),l))}}function rs(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>rs(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ts=new Proxy(ts,{get(t,e,r){return"map"===e&&console.error(Yn),Reflect.get(t,e,r)}}));var is=Date.now;function ns(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=gi.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=gi.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function ss(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function as(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function os(t){return t?t.nodeType===t.ELEMENT_NODE?t:gi.parentElement(t):null}function us(t,e,r,i){if(!t)return!1;var n=os(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(Bn(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function ls(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===Rn}function hs(t,e){if(Vi(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=gi.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||hs(i,e))}function ds(t){return Boolean(t.changedTouches)}function cs(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function vs(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function fs(t){return!!t&&(t instanceof Jn&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(gi.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(is=()=>(new Date).getTime());class ps{constructor(){Xr(this,"id",1),Xr(this,"styleIDMap",new WeakMap),Xr(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 gs(t){var e,r=null;return"getRootNode"in t&&(null==(e=gi.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&gi.host(gi.getRootNode(t))&&(r=gi.host(gi.getRootNode(t))),r}function ms(t){var e=t.ownerDocument;return!!e&&(gi.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=gs(r);)r=e;return r}(t);return gi.contains(e,r)}(t))}function ys(t){return"__ln"in t}class ws{constructor(){Xr(this,"length",0),Xr(this,"head",null),Xr(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&ys(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&ys(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var bs,ks=(t,e)=>t+"@"+e;class _s{constructor(){Xr(this,"frozen",!1),Xr(this,"locked",!1),Xr(this,"texts",[]),Xr(this,"attributes",[]),Xr(this,"attributeMap",new WeakMap),Xr(this,"generatedAttributes",new WeakMap),Xr(this,"removes",[]),Xr(this,"mapRemoves",[]),Xr(this,"movedMap",{}),Xr(this,"addedSet",new Set),Xr(this,"movedSet",new Set),Xr(this,"droppedSet",new Set),Xr(this,"removesSubTreeCache",new Set),Xr(this,"mutationCb"),Xr(this,"blockClass"),Xr(this,"blockSelector"),Xr(this,"maskTextClass"),Xr(this,"maskTextSelector"),Xr(this,"inlineStylesheet"),Xr(this,"maskInputOptions"),Xr(this,"maskTextFn"),Xr(this,"maskInputFn"),Xr(this,"maskAllElementAttributes"),Xr(this,"maskAttributeFn"),Xr(this,"keepIframeSrcFn"),Xr(this,"recordCanvas"),Xr(this,"canvasMaskingConfigured"),Xr(this,"inlineImages"),Xr(this,"slimDOMOptions"),Xr(this,"dataURLOptions"),Xr(this,"doc"),Xr(this,"mirror"),Xr(this,"iframeManager"),Xr(this,"stylesheetManager"),Xr(this,"shadowDomManager"),Xr(this,"canvasManager"),Xr(this,"processedNodeManager"),Xr(this,"unattachedDoc"),Xr(this,"canvasManagerReleased",!1),Xr(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),Xr(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,r=yi(),i=_i();try{this.processBufferedMutations()}finally{t=yi()-r,e=i,Mi>0||Si(t,null!=e?e:wi)||t>Fi.slowestBatchMs&&(Fi.slowestBatchMs=t)}}})),Xr(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,r=new ws,i=t=>{for(var e=t,r=Rn;r===Rn;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=gi.parentNode(n);if(s&&ms(n)&&"TEXTAREA"!==s.tagName){var a=Vi(s)?this.mirror.getId(gs(n)):this.mirror.getId(s),o=i(n);if(-1===a||-1===o)return r.addNode(n);var u=Vn(n,{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,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{cs(t,this.mirror)&&this.iframeManager.addIframe(t),vs(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),fs(t)&&!us(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(gi.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:a,nextId:o,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Ms(this.removesSubTreeCache,s)&&!this.movedSet.has(gi.parentNode(s))||n(s);for(var a of this.addedSet)Cs(this.droppedSet,a)||Ms(this.removesSubTreeCache,a)?Cs(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var o=null;r.length;){var u=null;if(o){var l=this.mirror.getId(gi.parentNode(o.value)),h=i(o.value);-1!==l&&-1!==h&&(u=o)}if(!u)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(gi.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){u=c;break}var f=gi.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=gi.host(f);if(-1!==this.mirror.getId(p)){u=c;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}o=u.previous,r.removeNode(u.value),n(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=gi.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 e,r=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof r.style){var i=JSON.stringify(t.styleDiff),n=JSON.stringify(t._unchangedStyles);r.style.length>i.length&&(i+n).split("var(").length===r.style.split("var(").length&&(r.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var s of Object.entries(r)){var a=s[0],o=s[1];"string"!=typeof o&&null!==o||(r[a]=dn({element:t.node,name:a,value:o,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(e=this.generatedAttributes.get(t.node))?void 0:e.has(a)}))}return{id:this.mirror.getId(t.node),attributes:r}})).filter((t=>!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.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))})),Xr(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),Xr(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(gi.childNodes(t),(t=>gi.textContent(t)||"")).join("");e.attributes.value=un({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:vn(t),value:r,maskInputFn:this.maskInputFn})})),Xr(this,"processMutation",(t=>{var e;if(!ls(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var r=gi.textContent(t.target);us(t.target,this.blockClass,this.blockSelector,!1)||r===t.oldValue||this.texts.push({value:$n(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,os(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break;case"attributes":var i,n=t.target,s=t.attributeName,a=null!==(i=t.attributeNamespace)&&void 0!==i?i:null,o=function(t,e,r){if(!r)return e;var i=t.getAttributeNodeNS(r,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(r);return n?n+":"+e:e}(n,s,a),u=a?n.getAttributeNS(a,s):t.target.getAttribute(s);if("value"===o){var l=n,h=vn(l);u=un({element:l,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:u,maskInputFn:this.maskInputFn})}if(us(t.target,this.blockClass,this.blockSelector,!1)||u===t.oldValue)return;var d=this.attributeMap.get(t.target),c="IFRAME"===n.tagName&&"src"===o;if(c&&!this.keepIframeSrcFn(u)&&n.contentDocument)return;if(d||(this.attributes.push(d={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,d)),"type"===o&&"INPUT"===n.tagName&&"password"===(t.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Pn(n.tagName,o)){var v=Nn(this.doc,ln(n.tagName),ln(o),u,n,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(u)&&(o="rr_src"),d.attributes[o]=v,null==(e=this.generatedAttributes.get(t.target))||e.delete(o),"style"===o){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=n.style;for(var g of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?d.styleDiff[g]=""===y?m:[m,y]:d._unchangedStyles[g]=[m,y]}for(var w of Array.from(f.style))""===p.getPropertyValue(w)&&(d.styleDiff[w]=!1)}else if("open"===o&&"DIALOG"===n.tagName){d.attributes.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal";var b=this.generatedAttributes.get(t.target);b||this.generatedAttributes.set(t.target,b=new Set),b.add("rr_open_mode")}}break;case"childList":if(us(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),i=Vi(t.target)?this.mirror.getId(gi.host(t.target)):this.mirror.getId(t.target);us(t.target,this.blockClass,this.blockSelector,!1)||ls(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Ss(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||hs(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[ks(r,i)]?Ss(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!Vi(t.target)||!Zi(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),gi.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),Xr(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(ls(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[ks(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);us(t,this.blockClass,this.blockSelector,!1)||(gi.childNodes(t).forEach((t=>this.genAdds(t))),fs(t)&&gi.childNodes(gi.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}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.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function Ss(t,e){for(var r=[e];r.length;){var i=r.pop();t.delete(i),gi.childNodes(i).forEach((t=>r.push(t)))}}function Ms(t,e,r){return 0!==t.size&&function(t,e,r){var i=gi.parentNode(e);return!!i&&t.has(i)}(t,e)}function Cs(t,e){if(0===t.size)return!1;for(var r=gi.parentNode(e);r;){if(t.has(r))return!0;r=gi.parentNode(r)}return!1}var Is=function(t,e){return void 0===e&&(e="rrweb"),bs?function(){try{return t(...arguments)}catch(t){if(bs&&!0===bs(t,e))return;throw t}}:t},As=[];function Rs(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 Ts(t,e){var r,i=new _s;i.init(t);try{r=new(fi())(Is(i.processMutations.bind(i)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),r.observe(e,n),As.push(i),{observer:r,buffer:i}}catch(t){try{null==r||r.disconnect(),i.destroy(),i.reset()}catch(t){}throw t}}function xs(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,u=t=>{var a=Rs(t);if(a&&!us(a,n,s,!0)){var u,l,h=i.getId(a);if(a===r&&r.defaultView){var d=ns(r.defaultView);u=d.left,l=d.top}else u=a.scrollLeft,l=a.scrollTop;var c=u+","+l;o.get(h)!==c&&(o.set(h,c),e({id:h,x:u,y:l}))}},l=[Qn("scroll",Is(es(Is((t=>u(t))),a.scroll||100)),r)];return"onscrollend"in r&&l.push(Qn("scrollend",Is(u),r)),()=>l.forEach((t=>t()))}function Es(t,e){for(var r=As.length-1;r>=0;r--){var i=As[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),As.splice(r,1))}}}var Os=["INPUT","TEXTAREA","SELECT"],Fs=new WeakMap;function Ls(t){return function t(e,r){if($s("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||$s("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||$s("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||$s("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function Ds(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}var Ns=5e3;function Ps(t,e){var r,i,n,s,a=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:gi.host(e));var o="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&u?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var t;return null==(t=u.get)?void 0:t.call(this)},set(t){var e,r;try{r=null==(e=u.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return r}}),Is((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function Bs(t,e){void 0===e&&(e={});var r,i,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,a=t.viewportResizeCb,o=t.inputCb,u=t.mediaInteractionCb,l=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,c=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...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),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var s,a,o,l,h,d,c,v,f=[],p=Is((()=>{if(i){i.destroy(),i.reset();var e=As.indexOf(i);-1!==e&&As.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==r||r.disconnect(),f.forEach((t=>t()))}));try{if(t.recordDOM){var g=Ts(t,t.doc);r=g.observer,i=g.buffer}if(f.push(function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.mirror;if(!1===r.mousemove)return()=>{};var s,a="number"==typeof r.mousemove?r.mousemove:50,o="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=es(Is((t=>{var r=Date.now()-s;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],s=null})),o),h=Is(es(Is((t=>{var e=Rs(t),r=ds(t)?t.changedTouches[0]:t,i=r.clientX,a=r.clientY;s||(s=is()),u.push({x:i,y:a,id:n.getId(e),timeOffset:is()-s}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Yr.Drag:t instanceof MouseEvent?Yr.MouseMove:Yr.TouchMove)})),a,{trailing:!1})),d=[Qn("mousemove",h,i),Qn("touchmove",h,i),Qn("drag",h,i)];return Is((()=>{d.forEach((t=>t()))}))}(t)),f.push(function(t){var e=t.mouseInteractionCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var o=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],h=null;return Object.keys(ti).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==o[t])).forEach((t=>{var a=ln(t),o=(t=>r=>{var a=Rs(r);if(!us(a,n,s,!0)){var o=null,l=t;if("pointerType"in r){switch(r.pointerType){case"mouse":o=ei.Mouse;break;case"touch":o=ei.Touch;break;case"pen":o=ei.Pen}o===ei.Touch&&(ti[t]===ti.MouseDown?l="TouchStart":ti[t]===ti.MouseUp&&(l="TouchEnd"))}else ds(r)&&(o=ei.Touch);null!==o?(h=o,(l.startsWith("Touch")&&o===ei.Touch||l.startsWith("Mouse")&&o===ei.Mouse)&&(o=null)):ti[t]===ti.Click&&(o=h,h=null);var d=ds(r)?r.changedTouches[0]:r;if(d){var c=i.getId(a),v=d.clientX,f=d.clientY;Is(e)(u({type:ti[l],id:c,x:v,y:f},null!==o&&{pointerType:o}))}}})(t);if(window.PointerEvent)switch(ti[t]){case ti.MouseDown:case ti.MouseUp:a=a.replace("mouse","pointer");break;case ti.TouchStart:case ti.TouchEnd:return}l.push(Qn(a,o,r))})),Is((()=>{l.forEach((t=>t()))}))}(t)),f.push(xs(t)),f.push(function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,s=-1;return Qn("resize",Is(es(Is((()=>{var t=ss(),e=as();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:n})),f.push(function(t){var e=t.inputCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.ignoreClass,o=t.ignoreSelector,l=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function c(t){var e=Rs(t),i=t.isTrusted,u=r.defaultView;if(!e||!u||e instanceof u.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=gi.parentElement(e)),e&&c&&Os.indexOf(c)>=0&&!us(e,n,s,!0)&&!(e.classList.contains(a)||o&&e.matches(o))){var f=e.value,p=!1,g=vn(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[c.toLowerCase()]||l[g])&&(f=un({element:e,maskInputOptions:l,tagName:c,type:g,value:f,maskInputFn:h})),v(e,d?{text:f,isChecked:p,userTriggered:i}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&r.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(t,r){var n=Fs.get(t);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){Fs.set(t,r);var s=i.getId(t);Is(e)(u({},r,{id:s}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>Qn(t,Is(c),r))),p=r.defaultView;if(!p)return()=>{f.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((t=>rs(t[0],t[1],{set(){Is(c)({target:this,isTrusted:!1})}},!1,p)))),Is((()=>{f.forEach((t=>t()))}))}(t)),f.push(function(t){var e=t.mediaInteractionCb,r=t.blockClass,i=t.blockSelector,n=t.mirror,s=t.sampling,a=t.doc,o=Is((t=>es(Is((s=>{var a=Rs(s);if(a&&!us(a,r,i,!0)){var o=a.currentTime,u=a.volume,l=a.muted,h=a.playbackRate,d=a.loop;e({type:t,id:n.getId(a),currentTime:o,volume:u,muted:l,playbackRate:h,loop:d})}})),s.media||500))),u=[Qn("play",o(ii.Play),a),Qn("pause",o(ii.Pause),a),Qn("seeked",o(ii.Seeked),a),Qn("volumechange",o(ii.VolumeChange),a),Qn("ratechange",o(ii.RateChange),a)];return Is((()=>{u.forEach((t=>t()))}))}(t)),t.recordDOM){var m=function(t){var e=new Map,r=new Set,i=!0,n=t=>{if(i)try{t()}catch(t){}},s=t=>{var r,i=e.get(t);if(i){for(;null==(r=i[0])?void 0:r.ready;){var s=i.shift();(null==s?void 0:s.emit)&&n(s.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,r){if(t){var i=e.get(t);i?(i.push({emit:r,ready:!0}),s(t)):n(r)}else n(r)},queuePendingMutation(a,o,u){if(!i)return()=>{};var l=e.get(a);l||e.set(a,l=[]);var h={emit:o,ready:!1};l.push(h);var d,c=!1,v=!1,f=()=>{c||v||(c=!0,void 0!==d&&r.delete(d),h.ready=!0,h.emit=void 0,s(a))};try{d=t.setTimeout(f,Ns),c||v?t.clearTimeout(d):r.add(d)}catch(t){f()}return e=>{!v&&i&&(v=!0,void 0!==d&&(t.clearTimeout(d),r.delete(d)),c?e&&n(u):(h.ready=!0,e||(h.emit=void 0),s(a)))}},reset(){i=!1,r.forEach((e=>t.clearTimeout(e))),r.clear(),e.clear()}}}(n);f.push(m.reset),f.push(function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,s=e.win,a=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Is(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=Ds(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>r({id:h,styleId:d,adds:[{rule:o,index:u}]}))),u}),"host")}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var u,l,h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:Is(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=Ds(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>r({id:h,styleId:d,removes:[{index:o}]}))),u}),"host")}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(u=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:Is(((t,e,s)=>{var o=s[0],u=t.apply(e,s);try{var l=null==u?void 0:u.then;if(e.ownerNode||!u||"function"!=typeof l)return u;n.onCssomSheetMutation(e);var h=Ds(e,i,n.styleMirror),d=h.id,c=h.styleId;if(!(d&&-1!==d||c&&-1!==c))return u;var v=a.queuePendingMutation(e,(()=>r({id:d,styleId:c,replace:o})),(()=>{var t=Ki(e);null!==t&&r({id:d,styleId:c,replace:t})}));try{l.call(u,(()=>v(!0)),(()=>v(!1)))}catch(t){v(!1)}}catch(t){}return u}),"host")})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Is(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=Ds(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>r({id:h,styleId:d,replaceSync:o}))),u}),"host")}));var d={};Ws("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(Ws("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),Ws("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),Ws("CSSSupportsRule")&&(d.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(d).forEach((t=>{var e=t[0],s=t[1];c[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Is(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var l=Ds(e.parentStyleSheet,i,n.styleMirror),h=l.id,d=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var c=[...Ls(e),u];a.queueMutation(e.parentStyleSheet,(()=>r({id:h,styleId:d,adds:[{rule:o,index:c}]})))}return u}),"host")}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Is(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var l=Ds(e.parentStyleSheet,i,n.styleMirror),h=l.id,d=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var c=[...Ls(e),o];a.queueMutation(e.parentStyleSheet,(()=>r({id:h,styleId:d,removes:[{index:c}]})))}return u}),"host")})})),Is((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=h,u&&(s.CSSStyleSheet.prototype.replace=u),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(d).forEach((t=>{var e=t[0],r=t[1];r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n,mutationQueue:m})),f.push(Ps(t,t.doc)),f.push(function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=e.mutationQueue,u=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:Is(((t,e,a)=>{var u,l=a[0],h=a[1],d=a[2],c=t.apply(e,a);if(n.has(l))return c;var v=null==(u=e.parentRule)?void 0:u.parentStyleSheet;s.onCssomSheetMutation(v);var f=Ds(v,i,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=Ls(e.parentRule);o.queueMutation(v,(()=>r({id:p,styleId:g,set:{property:l,value:h,priority:d},index:m})))}return c}),"host")});var l=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Is(((t,e,a)=>{var u,l=a[0],h=t.apply(e,a);if(n.has(l))return h;var d=null==(u=e.parentRule)?void 0:u.parentStyleSheet;s.onCssomSheetMutation(d);var c=Ds(d,i,s.styleMirror),v=c.id,f=c.styleId;if(v&&-1!==v||f&&-1!==f){var p=Ls(e.parentRule);o.queueMutation(d,(()=>r({id:v,styleId:f,remove:{property:l},index:p})))}return h}),"host")}),Is((()=>{a.CSSStyleDeclaration.prototype.setProperty=u,a.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:n,mutationQueue:m})),t.collectFonts&&f.push(function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,a=i.FontFace;i.FontFace=function(t,e,r){var i=new a(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var o=pi(r.fonts,"add",(function(t){return function(r){return setTimeout(Is((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=a})),n.push(o),Is((()=>{n.forEach((t=>t()))}))}(t))}for(var y of(f.push((a=(s=t).doc,o=s.mirror,l=s.blockClass,h=s.blockSelector,d=s.selectionCb,c=!0,(v=Is((()=>{var t=a.getSelection();if(!(!t||c&&(null==t?void 0:t.isCollapsed))){c=t.isCollapsed||!1;for(var e=[],r=t.rangeCount||0,i=0;r>i;i++){var n=t.getRangeAt(i),s=n.startContainer,u=n.startOffset,v=n.endContainer,f=n.endOffset;us(s,l,h,!0)||us(v,l,h,!0)||e.push({start:o.getId(s),startOffset:u,end:o.getId(v),endOffset:f})}d({ranges:e})}})))(),Qn("selectionchange",v))),f.push(function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?pi(r.customElements,"define",(function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}})):()=>{}}(t)),t.plugins))f.push(y.observer(y.callback,n,y.options))}catch(t){try{p()}catch(t){}throw t}return p}function $s(t){return void 0!==window[t]}function Ws(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class zs{constructor(t){Xr(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Xr(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){if(0>e)return e;var n=r||this.getRemoteIdToLocalIdMap(t),s=i||this.getLocalIdToRemoteIdMap(t),a=n.get(e);return void 0===a&&(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}getIds(t,e){var r=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i;return"number"!=typeof e||0>e?e:null!==(i=(r||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){var r=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}}class Us{constructor(t){Xr(this,"iframes",new WeakMap),Xr(this,"crossOriginIframeMap",new WeakMap),Xr(this,"crossOriginIframeMirror",new zs(Tn)),Xr(this,"crossOriginIframeStyleMirror"),Xr(this,"crossOriginIframeRootIdMap",new WeakMap),Xr(this,"mirror"),Xr(this,"mutationCb"),Xr(this,"wrappedEmit"),Xr(this,"loadListener"),Xr(this,"pageHideListener"),Xr(this,"stylesheetManager"),Xr(this,"recordCrossOriginIframes"),Xr(this,"messageHandler"),Xr(this,"nestedIframeListeners",new Map),Xr(this,"attachedWindows",new WeakMap),Xr(this,"attachedDocuments",new WeakMap),Xr(this,"attachedIframes",new Map),Xr(this,"loadListenerDisposers",new WeakMap),Xr(this,"iframeElementsById",new Map),Xr(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new zs(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null==(i=this.attachedIframes.get(t))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>Kn(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{Xn(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var a=this.handleMessage.bind(this);Kn((()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}Kn((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),null==(r=this.loadListener)||r.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 i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case Kr.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:Kr.IncrementalSnapshot,data:{source:Yr.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Kr.Meta:case Kr.Load:case Kr.DomContentLoaded:return!1;case Kr.Plugin:return e;case Kr.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Kr.IncrementalSnapshot:switch(e.data.source){case Yr.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 Yr.Drag:case Yr.TouchMove:case Yr.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Yr.ViewportResize:return!1;case Yr.MediaInteraction:case Yr.MouseInteraction:case Yr.Scroll:case Yr.CanvasMutation:case Yr.Input:return this.replaceIds(e.data,t,["id"]),e;case Yr.StyleSheetRule:case Yr.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Yr.Font:return e;case Yr.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Yr.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,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));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===ni.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(Xn(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(Xn(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var s=this.attachedDocuments.get(r);s&&(s.forEach((t=>{Kn((()=>this.mirror.removeNodeFromMap(t)))})),Kn((()=>Es(r,s))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&Xn(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{Xn(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class js{constructor(t){Xr(this,"shadowDoms",new WeakSet),Xr(this,"mutationCb"),Xr(this,"scrollCb"),Xr(this,"bypassOptions"),Xr(this,"mirror"),Xr(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){var r,i;if(Zi(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(r=null==(i=gi.host(t))?void 0:i.ownerDocument)&&void 0!==r?r:e,s=Ts(u({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=s.observer,o=s.buffer;this.restoreHandlers.push({doc:n,handler(){a.disconnect(),o.destroy(),o.releaseCanvasManager();var t=As.indexOf(o);-1!==t&&As.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:xs(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(gi.host(t))),this.restoreHandlers.push({doc:n,handler:Ps({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({doc:e,handler:pi(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=gi.shadowRoot(this);return s&&ms(this)&&r.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}}var Hs="skip-frame";function qs(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var Gs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vs="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Zs=0;64>Zs;Zs++)Vs[Gs.charCodeAt(Zs)]=Zs;var Js=new Map,Qs=(t,e,r)=>{if(t&&(Ys(t,e)||"object"==typeof t)){var i=function(t,e){var r=Js.get(t);return r||Js.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function Xs(t,e,r,i){if(t instanceof Array)return t.map((t=>Xs(t,e,r,i)));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){var n=t.constructor.name,s=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=Gs[r[e]>>2],n+=Gs[(3&r[e])<<4|r[e+1]>>4],n+=Gs[(15&r[e+1])<<2|r[e+2]>>6],n+=Gs[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[Xs(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Xs(t.data,e,r,i),t.width,t.height]}:Ys(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Qs(t,e,r)}:t}var Ks=(t,e,r,i)=>t.map((t=>Xs(t,e,r,i))),Ys=(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])))},ta=["webgl","webgl2"];function ea(t){return"nodeType"in t}function ra(t,e,r,i){var n=[];try{if(i){var s=function(t,e,r){var i=t.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return pi(i.prototype,"configure",(function(i){return function(n){var s=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!s||ea(s)&&us(s,e,r,!0))return i.call(this,n);ea(s)&&!("__context"in s)&&(s.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return i.call(this,null!==a&&n?u({},n,{usage:"number"==typeof n.usage?n.usage|a:a}):n)}}))}(t,e,r);s&&n.push(s)}var a=pi(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),a=arguments.length,o=new Array(a>1?a-1:0),u=1;a>u;u++)o[u-1]=arguments[u];if(!us(this,e,r,!0)&&("__context"in this||(this.__context=s),i&&ta.includes(s)))if(o[0]&&"object"==typeof o[0]){var l=o[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...o])}}));n.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function ia(t,e,r,i,n,s,a){var o=[],u=Object.getOwnPropertyNames(t),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof t[u])return 0;var l=pi(t,u,(function(t){return function(){for(var o=arguments.length,l=new Array(o),h=0;o>h;h++)l[h]=arguments[h];var d=t.apply(this,l);if(Qs(d,s,this),this.canvas&&"tagName"in this.canvas&&!us(this.canvas,i,n,!0)){var c=Ks(l,s,this,a);r(this.canvas,{type:e,property:u,args:c})}return d}}));o.push(l)}catch(s){var h=rs(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!us(this.canvas,i,n,!0)&&r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});o.push(h)}};for(var h of u)l(h);return o}var na,sa,aa,oa='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',ua="undefined"!=typeof self&&self.Blob&&new Blob([oa],{type:"text/javascript;charset=utf-8"});function la(t){var e;try{if(!(e=ua&&(self.URL||self.webkitURL).createObjectURL(ua)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(oa),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class ha{constructor(t){Xr(this,"pendingCanvasMutations",new Map),Xr(this,"rafStamps",{latestId:0,invokeId:null}),Xr(this,"mirror"),Xr(this,"mutationCb"),Xr(this,"resetObservers"),Xr(this,"frozen",!1),Xr(this,"locked",!1),Xr(this,"rafIdTimestamp",null),Xr(this,"rafIdFlush",null),Xr(this,"refCount",0),Xr(this,"torndown",!1),Xr(this,"resetFrameDedup",null),Xr(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 e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,s=t.blockSelector,a=t.recordCanvas,o=t.dataURLOptions,u=t.resolutionScale,l=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===r&&this.initCanvasMutationObserver(i,n,s,o),a&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:o,resolutionScale:u,canvasMasking:l})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,e,r,i,n){var s=this;if("OffscreenCanvas"in e){var a,u="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,l=ra(e,r,i,!0),h=new Map;try{a=new la}catch(t){return}var d=!1;a.onerror=()=>{var t;d=!0,cancelAnimationFrame(c),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:ri["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var c,v=1e3/t,f=0,p=t=>{var l,g;d||(f&&v>t-f||(f=t,(l=[],g=t=>{try{t.querySelectorAll("canvas").forEach((t=>{us(t,r,i,!0)||l.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&g(t.shadowRoot)}))}catch(t){}},g(e.document),l).forEach(function(){var t=o((function*(t){var e,r,i=s.mirror.getId(t);if(!h.get(i)&&0!==t.width&&0!==t.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(t.__context)){var o=t.getContext(t.__context);if(null==(e=null==o?void 0:o.isContextLost)?void 0:e.call(o))return void h.set(i,!1);!1===(null==(r=null==o?void 0:o.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&o.clear(o.COLOR_BUFFER_BIT)}var l=t.clientWidth||t.width,d=t.clientHeight||t.height,c=Math.max(1,Math.round(l*u)),v=Math.max(1,Math.round(d*u)),f=function(t,e,r,i,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return Hs}if(void 0!==a){if(!Array.isArray(a)||!a.every(qs))return Hs;var o=r/n,u=i/s;return a.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*o),r=Math.floor(t.y*u);return{x:e,y:r,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*u)-r}}))}}}(n.canvasMasking,t,c,v,l,d);if(f===Hs)return void h.set(i,!1);var p=yield createImageBitmap(t,1>u?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});a.postMessage({id:i,bitmap:p,width:c,height:v,displayWidth:l,displayHeight:d,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(i,!1)}}}));return function(e){return t.apply(this,arguments)}}())),c=requestAnimationFrame(p))};c=requestAnimationFrame(p),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(c),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ra(t,e,r,!1),s=function(t,e,r,i,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var o=pi(e.CanvasRenderingContext2D.prototype,a,(function(s){return function(){for(var o=arguments.length,u=new Array(o),l=0;o>l;l++)u[l]=arguments[l];return us(this.canvas,r,i,!0)||setTimeout((()=>{var r=Ks(u,e,this,n);t(this.canvas,{type:ri["2D"],property:a,args:r})}),0),s.apply(this,u)}}));s.push(o)}catch(n){var u=rs(e.CanvasRenderingContext2D.prototype,a,{set(e){us(this.canvas,r,i,!0)||t(this.canvas,{type:ri["2D"],property:a,args:[e],setter:!0})}});s.push(u)}};for(var u of a)o(u);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),a=function(t,e,r,i,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...ia(e.WebGLRenderingContext.prototype,ri.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...ia(e.WebGL2RenderingContext.prototype,ri.WebGL2,t,r,i,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),s(),a()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var i=r.map((t=>function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}(t,Jr)));this.mutationCb({id:e,type:r[0].type,commands:i}),this.pendingCanvasMutations.delete(t)}}}}class da{constructor(t){var e;Xr(this,"trackedLinkElements",new WeakSet),Xr(this,"pendingDeferredSheets",new Set),Xr(this,"mutationCb"),Xr(this,"adoptedStyleSheetCb"),Xr(this,"maskAllElementAttributes"),Xr(this,"maskAttributeFn"),Xr(this,"styleMirror",new ps),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var r=null,i=null;try{(i=t.sheet)&&(r=an(i))}catch(t){}if(!r||!i)return Hi(),null;var n=r,s=!1,a={sheet:i,invalidate(){s=!0}};this.pendingDeferredSheets.add(a);var o=!1;return{advance:r=>{if(o)return!0;var u,l,h=yi(),d=_i(),c=!0;try{if(s)return o=!0,Hi(),!0;if(!n.advance(r))return c=!1,!1;o=!0;var v=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==i?(Hi(),!0):v?(this.emitCssTextMutation(t,e,v),!0):(Hi(),!0)}finally{c&&this.pendingDeferredSheets.delete(a),Si(u=yi()-h,null!=(l=d)?l:wi)||(Li.totalMs+=u,u>Li.slowestSliceMs&&(Li.slowestSliceMs=u))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(a)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var r;null==(r=this.beginDeferredLinkInlining(t,e))||r.advance(1/0)}emitCssTextMutation(t,e,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:dn({element:t,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;if(r.styleMirror.has(t))e=r.styleMirror.getId(t);else{var s=r.styleMirror.add(t);e=s;var a=yi();try{zi((()=>{try{var e=t.rules||t.cssRules;e&&Wi(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:Yi(e,t.href),index:r})))})}))}finally{Ui(yi()-a)}}i.styleIds.push(e)};for(var a of t)s(a);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),zn.forEach((t=>t.abort())),zn.clear()}trackStylesheetInLinkElement(t){}}class ca{constructor(){Xr(this,"nodeMap",new WeakMap),Xr(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 va=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var fa=document.createElement("iframe");document.body.appendChild(fa),Array.from=(null==(Zr=fa.contentWindow)?void 0:Zr.Array.from)||Array.from,document.body.removeChild(fa)}}catch(t){console.debug("Unable to override Array.from",t)}var pa=new on,ga=new Set([Yr.Mutation,Yr.MediaInteraction,Yr.StyleSheetRule,Yr.CanvasMutation,Yr.Font,Yr.Log,Yr.StyleDeclaration,Yr.AdoptedStyleSheet]);function ma(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null==(t=e.cancelIdleCallback)?void 0:t.call(e,r)}}}var i=setTimeout(t,250);return{cancel:()=>clearTimeout(i)}}function ya(t){var e;void 0===t&&(t={});var r=t,i=r.emit,n=r.checkoutEveryNms,s=r.checkoutEveryNth,a=r.blockClass,o=void 0===a?"rr-block":a,l=r.blockSelector,h=void 0===l?null:l,d=r.ignoreClass,c=void 0===d?"rr-ignore":d,v=r.ignoreSelector,f=void 0===v?null:v,p=r.maskTextClass,g=void 0===p?"rr-mask":p,m=r.maskTextSelector,y=void 0===m?null:m,w=r.inlineStylesheet,b=void 0===w||w,k=r.inlineStylesheetBudgetRules,_=r.maskAllInputs,S=r.maskInputOptions,M=r.slimDOMOptions,C=r.maskInputFn,I=r.maskTextFn,A=r.maskAllElementAttributes,R=void 0!==A&&A,T=r.maskAttributeFn,x=r.hooks,E=r.packFn,O=r.sampling,F=void 0===O?{}:O,L=r.dataURLOptions,D=void 0===L?{}:L,N=r.canvasResolutionScale,P=r.canvasMasking,B=r.mousemoveWait,W=r.recordDOM,z=void 0===W||W,U=r.recordCanvas,j=void 0!==U&&U,H=r.recordCrossOriginIframes,q=void 0!==H&&H,G=r.recordAfter,V=void 0===G?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":G,Z=r.userTriggeredOnInput,J=void 0!==Z&&Z,Q=r.collectFonts,X=void 0!==Q&&Q,K=r.inlineImages,Y=void 0!==K&&K,tt=r.plugins,et=r.keepIframeSrcFn,rt=void 0===et?()=>!1:et,it=r.ignoreCSSAttributes,nt=void 0===it?new Set([]):it,st=r.attributeFilter;bs=r.errorHandler;var at=u({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},D),ot=!q||window.parent===window,ut=!1;if(!ot)try{window.parent.document&&(ut=!1)}catch(t){ut=!0}if(ot&&!i)throw new Error("emit function is required");if(!ot&&!ut)return()=>{};void 0!==B&&void 0===F.mousemove&&(F.mousemove=B),pa.reset();var lt,ht=!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==S?S:{password:!0},dt=Zn(void 0!==M&&M);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var ct,vt,ft=0,pt=new Map,gt=t=>{for(var e of tt||[])e.eventProcessor&&(t=e.eventProcessor(t));return E&&!ut&&(t=E(t)),t};na=(t,e)=>{var r,a=t;if(a.timestamp=is(),!(null==(r=As[0])?void 0:r.isFrozen())||a.type===Kr.FullSnapshot||a.type===Kr.IncrementalSnapshot&&ga.has(a.data.source)||As.forEach((t=>t.unfreeze())),ot)null==i||i(gt(a),e);else if(ut){var o={type:"rrweb",event:gt(a),origin:window.location.origin,isCheckout:e};window.parent.postMessage(o,"*")}if(a.type===Kr.FullSnapshot)lt=a,ft=0;else if(a.type===Kr.IncrementalSnapshot){if(a.data.source===Yr.Mutation&&a.data.isAttachIframe)return;ft++,(s&&ft>=s||n&&a.timestamp-lt.timestamp>n)&&sa(!0)}};var mt=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,r=new Set;if(t.adds.length>0)for(var i of t.adds){var n=pa.getNode(i.node.id);n&&"IFRAME"===n.nodeName&&r.add(n)}t.removes.forEach((t=>{var i=t.id;if(!e||!e.has(i)){var n=kt.getIframeElementById(i);n&&r.has(n)?kt.forgetIframeId(i):(null==ct||ct(i),kt.removeIframeById(i))}})),null==vt||vt(),kt.cleanupDetachedIframes()}na({type:Kr.IncrementalSnapshot,data:u({source:Yr.Mutation},t)})},yt=t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.Scroll},t)}),wt=t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.CanvasMutation},t)}),bt=new da({mutationCb:mt,adoptedStyleSheetCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.AdoptedStyleSheet},t)}),maskAllElementAttributes:R,maskAttributeFn:T}),kt=new Us({mirror:pa,mutationCb:mt,stylesheetManager:bt,recordCrossOriginIframes:q,wrappedEmit:na});for(var _t of tt||[])_t.getMirror&&_t.getMirror({nodeMirror:pa,crossOriginIframeMirror:kt.crossOriginIframeMirror,crossOriginIframeStyleMirror:kt.crossOriginIframeStyleMirror});var St=new ca,Mt=null==P?void 0:P.configured;aa=new ha({recordCanvas:j,mutationCb:wt,win:window,blockClass:o,blockSelector:h,mirror:pa,sampling:F.canvas,dataURLOptions:at,resolutionScale:N,canvasMasking:P});var Ct=new js({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:o,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskInputOptions:ht,dataURLOptions:at,maskTextFn:I,maskInputFn:C,maskAllElementAttributes:R,maskAttributeFn:T,recordCanvas:j,canvasMaskingConfigured:Mt,inlineImages:Y,sampling:F,slimDOMOptions:dt,iframeManager:kt,stylesheetManager:bt,canvasManager:aa,keepIframeSrcFn:rt,processedNodeManager:St,attributeFilter:st},mirror:pa});sa=function(t){if(void 0===t&&(t=!1),z){Ni(k);try{na({type:Kr.Meta,data:{href:window.location.href,width:as(),height:ss()}},t),null==e||e.cancel(),e=void 0,bt.reset(),Ct.init(),As.forEach((t=>t.lock()));var r,i=null;try{i=function(t,e){var r=e||{},i=r.mirror,n=void 0===i?new on:i,s=r.blockClass,a=void 0===s?"rr-block":s,o=r.blockSelector,u=void 0===o?null:o,l=r.maskTextClass,h=void 0===l?"rr-mask":l,d=r.maskTextSelector,c=void 0===d?null:d,v=r.inlineStylesheet,f=void 0===v||v,p=r.inlineImages,g=void 0!==p&&p,m=r.recordCanvas,y=void 0!==m&&m,w=r.canvasMaskingConfigured,b=r.maskAllInputs,k=void 0!==b&&b,_=r.maskTextFn,S=r.maskInputFn,M=r.maskAllElementAttributes,C=void 0!==M&&M,I=r.maskAttributeFn,A=r.slimDOM,R=r.dataURLOptions,T=r.preserveWhiteSpace,x=r.onSerialize,E=r.onIframeLoad,O=r.iframeLoadTimeout,F=r.onIframeListenerRegistered,L=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,N=r.keepIframeSrcFn,P=void 0===N?()=>!1:N,B=r.maxDepth,W=r.inlineStylesheetBudgetRules,z=!0===k?{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===k?{password:!0}:k,U=Zn(void 0!==A&&A);Ni(W);try{return Vn(t,{doc:t,mirror:n,blockClass:a,blockSelector:u,maskTextClass:h,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:z,maskTextFn:_,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:I,slimDOMOptions:U,dataURLOptions:R,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:w,preserveWhiteSpace:T,onSerialize:x,onIframeLoad:E,iframeLoadTimeout:O,onIframeListenerRegistered:F,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:P,newlyAddedElement:!1,maxDepth:B})}finally{Pi()}}(document,{mirror:pa,blockClass:o,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskAllInputs:ht,inlineStylesheetBudgetRules:k,maskTextFn:I,maskInputFn:C,maskAllElementAttributes:R,maskAttributeFn:T,slimDOM:dt,dataURLOptions:at,recordCanvas:j,canvasMaskingConfigured:Mt,inlineImages:Y,onSerialize(t){cs(t,pa)&&kt.addIframe(t),vs(t,pa)&&bt.trackLinkElement(t),fs(t)&&Ct.addShadowRoot(gi.shadowRoot(t),document)},onIframeLoad(t,e){kt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){kt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){bt.attachLinkElement(t,e)},keepIframeSrcFn:rt})}finally{s=xi,xi=[],r=s}if(!i)return console.warn("Failed to snapshot the document");if(na({type:Kr.FullSnapshot,data:{node:i,initialOffset:ns(window)}},t),As.forEach((t=>t.unlock())),aa.onFullSnapshot(),r.length){var n=function(t,e,r){var i=!1,n=null,s=0,a=null,o=()=>null!==a||t.length>s,u=()=>{var r=t[s];t[s]=null,s+=1,r&&Kn((()=>{a=e.beginDeferredLinkInlining(r,pa.getId(r))}))},l=()=>{if(a){var t=a,e=!0;Kn((()=>{e=t.advance(200)})),e&&(a=null)}},h=t=>{if(n=null,!i){var e=0;do{try{a||u(),l()}catch(t){null==a||a.discard(),a=null,qi(1)}e+=1}while(!i&&o()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(o()?n=ma(h):r())}};return n=ma(h),{cancel(){i=!0,null==a||a.discard(),a=null,null==n||n.cancel(),n=null},flush(){if(!i){i=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;o()&&50>e;){a||u();var d=a;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),a=null,h+=1;else{try{l()}catch(t){null==a||a.discard(),a=null,h+=1}e+=1}}if(o()||h>0){for(var c=h+(null!==a?1:0),v=s;t.length>v;v++)null!==t[v]&&(c+=1);qi(c),null==a||a.discard(),a=null}r()}}}}(r,bt,(()=>{e===n&&(e=void 0)}));e=n}q&&kt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&bt.adoptStyleSheets(document.adoptedStyleSheets,pa.getId(document))}finally{Pi()}var s}};try{var It=[];for(var At of(It.push(Qn("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))It.push(Qn(At,ki,document));ct=t=>{var e=pt.get(t);e&&(e.forEach((t=>{Kn(t);var e=It.indexOf(t);-1!==e&&It.splice(e,1)})),pt.delete(t))},vt=()=>{for(var t of pt){var e=t[0],r=pa.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==ct||ct(e)}catch(t){null==ct||ct(e)}else null==ct||ct(e)}};var Rt=t=>{var e;return Is(Bs)({mutationCb:mt,mousemoveCb:(t,e)=>na({type:Kr.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.ViewportResize},t)}),inputCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.Input},t)}),mediaInteractionCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.MediaInteraction},t)}),styleSheetRuleCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.StyleSheetRule},t)}),styleDeclarationCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.StyleDeclaration},t)}),canvasMutationCb:wt,fontCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.Font},t)}),selectionCb(t){na({type:Kr.IncrementalSnapshot,data:u({source:Yr.Selection},t)})},customElementCb(t){na({type:Kr.IncrementalSnapshot,data:u({source:Yr.CustomElement},t)})},blockClass:o,ignoreClass:c,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:b,sampling:F,recordDOM:z,recordCanvas:j,canvasMaskingConfigured:Mt,inlineImages:Y,userTriggeredOnInput:J,collectFonts:X,doc:t,maskInputFn:C,maskTextFn:I,maskAllElementAttributes:R,maskAttributeFn:T,keepIframeSrcFn:rt,blockSelector:h,slimDOMOptions:dt,dataURLOptions:at,mirror:pa,iframeManager:kt,stylesheetManager:bt,shadowDomManager:Ct,processedNodeManager:St,canvasManager:aa,ignoreCSSAttributes:nt,attributeFilter:st,plugins:(null==(e=null==tt?void 0:tt.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>na({type:Kr.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},x)};kt.addLoadListener((t=>{try{var e=pa.getId(t),r=Rt(t.contentDocument);if("function"==typeof r&&(It.push(r),-1!==e)){var i=pt.get(e);i||pt.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),kt.addPageHideListener((t=>{var e=pa.getId(t);null==ct||ct(e),Es(t)}));var Tt=-1,xt=t=>na({type:Kr.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Et=()=>{var t,e,r,i,n=document,s=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,a=s?pa.getId(s):-1;a!==Tt&&(-1!==Tt&&xt({id:Tt,enter:!1}),Tt=a,-1!==a&&xt({id:a,enter:!0}))},Ot=()=>{sa();var t=Rt(document);"function"==typeof t&&It.push(t),It.push(Qn("fullscreenchange",Et)),It.push(Qn("webkitfullscreenchange",Et)),It.push(Qn("mozfullscreenchange",Et)),It.push(Qn("MSFullscreenChange",Et)),va=!0};return["interactive","complete"].includes(document.readyState)?Ot():(It.push(Qn("DOMContentLoaded",(()=>{na({type:Kr.DomContentLoaded,data:{}}),"DOMContentLoaded"===V&&Ot()}))),It.push(Qn("load",(()=>{na({type:Kr.Load,data:{}}),"load"===V&&Ot()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,It.forEach((t=>Kn(t))),St.destroy(),kt.removeLoadListener(),kt.destroy(),pt.clear(),Ct.reset(),pa.reset(),va=!1,bs=void 0}}catch(t){console.warn(t)}}ya.addCustomEvent=(t,e)=>{if(!va)throw new Error("please add custom event after start recording");na({type:Kr.Custom,data:{tag:t,payload:e}})},ya.freezePage=()=>{As.forEach((t=>t.freeze()))},ya.takeFullSnapshot=t=>{if(!va)throw new Error("please take full snapshot after start recording");sa(t)},ya.mirror=pa;var wa=Object.defineProperty,ba=(t,e,r)=>((t,e,r)=>e in t?wa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class ka{constructor(t){ba(this,"fileName"),ba(this,"functionName"),ba(this,"lineNumber"),ba(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 _a=/(^|@)\S+:\d+/,Sa=/^\s*at .*(\S+:\d+|\(native\))/m,Ma=/^(eval@)?(\[native code])?$/,Ca={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Sa)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(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(t){return t.stack.split("\n").filter((function(t){return!!t.match(Sa)}),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+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new ka({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Ma)}),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 ka({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new ka({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(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(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var a=e.exec(r[n]);a&&i.push(new ka({fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var a=e.exec(r[n]);a&&i.push(new ka({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(_a)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new ka({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Ia(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var a=i.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===r&&n.push(a)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Aa(t){return Array.isArray(t)}function Ra(t){return"object"==typeof t&&null!==t&&!Aa(t)}function Ta(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Ra(t[i])&&Ta(t[i],e-1))return!0;return!1}function xa(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Ra(a=e)&&Object.keys(a).length>r.numOfKeysLimit||"function"==typeof a||Ra(a)&&Ta(a,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var u in e){var l=e[u];o[u]=Aa(l)?Ia(l.length?l[0]:null):l}return o}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 Ea={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 Oa(t,e,r){var i,n=r?Object.assign({},Ea,r):Ea,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var a=0,o=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message,i=Ca.parse(e.error).map((t=>t.toString())),s=[xa(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[xa("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[xa("Uncaught (in promise)",n.stringifyOptions),xa(e.reason,n.stringifyOptions)]);var s=Ca.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)u.push(c(i,d));return()=>{u.forEach((t=>t()))};function c(e,r){var i=this;return e[r]?function(e,s,u){try{if(!(s in e))return()=>{};var l=e[s],h={next:l},d=(e=>function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||o)){o=!0;try{var h=Ca.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((t=>xa(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:r,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[xa("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{o=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=e[s];"function"==typeof t&&t.__rrweb_layer__;){var r=t.__rrweb_layer__;if(r.next===d)return void(r.next=h.next);t=r.next}else e[s]=h.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var Fa=t=>({name:"rrweb/console@1",observer:Oa,options:t}),La=t=>"undefined"!=typeof Document&&t instanceof Document,Da=()=>{};function Na(t,e,r){try{if(!(e in t))return Da;var i={next:t[e]},n=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return k(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e];k(r)&&r.__posthog_layer__;){var s=r.__posthog_layer__;if(s.next===n)return void(s.next=i.next);r=s.next}else t[e]=i.next}}catch(t){return Da}}function Pa(t,e){var r,i=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),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}var Ba=N("[Recorder]"),$a=t=>"navigation"===t.entryType,Wa=t=>"resource"===t.entryType;function za(t,e){return!!e&&(R(e)||e[t])}function Ua(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var ja=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Ha(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Ua(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(ja))return!1;if(R(r))return!0;if(b(r))return n(r);var s=r[e];return R(s)?s:n(s)}function qa(t,e,r,i,n,s){return Ga.apply(this,arguments)}function Ga(){return Ga=o((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return Ba.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var a=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(Wa(a=t[s])&&a.initiatorType===e&&(S(i)||a.startTime>=i)&&(S(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(r));return a||(yield new Promise((t=>setTimeout(t,50*s))),qa(t,e,r,i,n,s+1))})),Ga.apply(this,arguments)}function Va(t){var e=t.body,r=t.options,i=t.url;if(I(e))return null;var n=Pa(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(M(e))return e;if(La(e))return e.textContent;if(T(e))return U(e);if(_(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 Za=t=>!C(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Ja(t){var e=t.entry,r=t.method,i=t.status,n=t.networkRequest,s=t.isInitial,a=t.start,o=t.end,l=t.url,h=t.initiatorType;a=e?e.startTime:a,o=e?e.responseEnd:o;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(a||0)),v=[u({},e?e.toJSON():{name:l},{startTime:S(a)?void 0:Math.round(a),endTime:S(o)?void 0:Math.round(o),timeOrigin:d,timestamp:c,method:r,initiatorType:h||(e?e.initiatorType:void 0),status:i,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:s})];if(Za(e))for(var f of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Qa=["video/","audio/"];function Xa(t){return _(t)&&k(t.getReader)&&k(t.tee)}var Ka=500,Ya="[SessionReplay] Timeout while trying to read body",to="[SessionReplay] Failed to read body";function eo(t){return to+": "+t}function ro(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function io(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(Ya)),Ka);try{t.clone().text().then((t=>e(t)),(t=>e(eo(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e(to)}}))}(t);var r=Y(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(ro(r)):function(t,e){return new Promise((r=>{var i,n=!1;function s(){try{var t;null==(t=i)||t.cancel()}catch(t){}}function a(t){n||(n=!0,clearTimeout(u),s(),r(t))}var o,u=setTimeout((()=>a(Ya)),Ka);try{o=t.clone()}catch(t){return void a(to)}var l=o.body;if(Xa(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(t){return void a(to)}var h=[],d=0;!function t(){i.read().then((r=>{var i=r.done,o=r.value;if(n)s();else if(i)a((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(o){if(d+o.byteLength>e)return void a(ro(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(eo(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(eo(t))))}catch(t){a(to)}}))}(t,r)}function no(){return(no=o((function*(t){var e=t.r,r=t.options,i=Pa(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):io(e,r)}))).apply(this,arguments)}function so(){return(so=o((function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),a=Qa.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=Pa(n,i);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return C(i)?io(e,r):Promise.resolve(i)}))).apply(this,arguments)}var ao=null;function oo(t,e,r){if(!("performance"in e))return()=>{};if(ao)return Ba.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},tt,r):tt,n=e=>{var r=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var s=i.maskRequestFn(t);e||(n=!s||(t=>!!t&&ut.has(t))(s)),s&&r.push(s)}})),r.length>0&&t(u({},e,{requests:r}))},s=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>$a(t)||Wa(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>Ja({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>$a(t)||Wa(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>Ja({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(n,e,i),a=()=>{},l=()=>{};return(i.recordHeaders||i.recordBody)&&(a=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=za("request",r.recordHeaders),n=za("response",r.recordHeaders),s=Na(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,u,l,h){void 0===u&&(u=!0);var d=this;try{var c,v,f=new Request(o),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(Ha({type:"request",headers:g,url:o,recordBody:r.recordBody})&&(p.requestBody=Va({body:t,options:r,url:o})),c=e.performance.now(),y(t));var w=()=>{d.removeEventListener("readystatechange",b),d.removeEventListener("error",w),d.removeEventListener("abort",w),d.removeEventListener("timeout",w)},b=()=>{if(d.readyState===d.DONE){w(),v=e.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),Ha({type:"response",headers:i,url:o,recordBody:r.recordBody})&&(p.responseBody=Va({body:d.response,options:r,url:o})),qa(e,"xmlhttprequest",f.url,c,v).then((e=>{var r=Ja({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",b),d.addEventListener("error",w),d.addEventListener("abort",w),d.addEventListener("timeout",w)}catch(t){Ba.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),u,l,h)}));return()=>{s()}}(n,e,i),l=function(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=za("request",r.recordHeaders),n=za("response",r.recordHeaders),s=Na(e,"fetch",(s=>function(){var a=o((function*(a,o){var u,l;try{u=new Request(a,o)}catch(t){return Ba.error("Failed to instrument fetch for network capture",t),s(a,o)}var h,d,c={};try{try{var v={};u.headers.forEach(((t,e)=>{v[e]=t})),i&&(c.requestHeaders=v),!Xa(null==o?void 0:o.body)&&Ha({type:"request",headers:v,url:a,recordBody:r.recordBody})&&(c.requestBody=yield function(t){return no.apply(this,arguments)}({r:u,options:r,url:a}))}catch(t){Ba.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),l=Ua(a)?yield s(u):yield s(a,o),d=e.performance.now();var f={};return l.headers.forEach(((t,e)=>{f[e]=t})),n&&(c.responseHeaders=f),Ha({type:"response",headers:f,url:a,recordBody:r.recordBody})&&(c.responseBody=yield function(t){return so.apply(this,arguments)}({r:l,options:r,url:a})),l}finally{qa(e,"fetch",u.url,h,d).then((e=>{var r,i=Ja({entry:e,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:c,start:h,end:d,url:u.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{s()}}(n,e,i)),ao=()=>{s(),a(),l(),ao=null}}var uo=t=>({name:"rrweb/network@1",observer:oo,options:t});s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Fa,getRecordNetworkPlugin:uo},s.__PosthogExtensions__.rrweb={record:ya,version:"v2",wasMaxDepthReached:()=>Gn,resetMaxDepthState(){Gn=!1,qn=!1},getLastSnapshotCost:()=>Ri,getMutationCost:()=>u({},Fi),resetSnapshotCostState(){Mi=0,Ci=0,Ii=0,wi=0,Ai=mi(),Ri=null,Ti=null,xi=[],Ei=0,Oi=0,Fi={slowestBatchMs:0},Li={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},s.rrweb={record:ya,version:"v2"},s.rrwebConsoleRecord={getRecordConsolePlugin:Fa},s.getRecordNetworkPlugin=uo,s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initSessionRecording=(t,e)=>new Vr(t,e)}();
|
|
1
|
+
!function(){"use strict";var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t,r=null==e?void 0:e.document,i=null==e?void 0:e.location;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;var n="undefined"!=typeof globalThis?globalThis:t;n&&"undefined"==typeof self&&(n.self=n),n&&"undefined"==typeof File&&(n.File=function(){});var s=null!=t?t:{};function a(t,e,r,i,n,s,a){try{var o=t[s](a),u=o.value}catch(t){return void r(t)}o.done?e(u):Promise.resolve(u).then(i,n)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(i,n){var s=t.apply(e,r);function o(t){a(s,i,n,o,u,"next",t)}function u(t){a(s,i,n,o,u,"throw",t)}o(void 0)}))}}function u(){return u=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},u.apply(null,arguments)}var l={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},h={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},d=function(t){return t.trim()},c=Object.prototype,v=c.hasOwnProperty,f=c.toString,p=Array.isArray||function(t){return"[object Array]"===f.call(t)},g=t=>"function"==typeof t,m=t=>t===Object(t)&&!p(t),y=t=>void 0===t,w=t=>"[object String]"==f.call(t),b=t=>null===t,k=t=>y(t)||b(t),_=t=>"[object Number]"==f.call(t)&&t==t,S=t=>"[object Boolean]"===f.call(t),M=t=>t instanceof FormData;function C(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),_(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),C(n||r,e,r,i))}class I{constructor(t){this.k={},this.S=t.S,this.C=C(t.bucketSize,0,100,t.I),this.R=C(t.refillRate,0,this.C,t.I),this.A=C(t.refillInterval,0,864e5,t.I)}O(t,e){var r=Math.floor((e-t.lastAccess)/this.A);r>0&&(t.tokens=Math.min(t.tokens+r*this.R,this.C),t.lastAccess=t.lastAccess+r*this.A)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.k[i];return n?this.O(n,r):this.k[i]=n={tokens:this.C,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.S)||e.call(this,t)),0===n.tokens)}stop(){this.k={}}}function A(t){return t?t.split("#")[0]:t}var R,T="NativeGzipValidationError",x=t=>{throw function(t,e){var r=new Error(e);try{Object.defineProperty(r,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return r}(T,"Native gzip produced invalid output: "+t)},E=function(){var t=o((function*(t,e){18>t.size&&x("too-short");var r,i=new Uint8Array(yield t.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&x("invalid-header");var n=new DataView(yield t.slice(t.size-8).arrayBuffer());n.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(R)return R;R=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;R[t]=e>>>0}return R})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&x("invalid-crc");var s=e.length>>>0;n.getUint32(4,!0)!==s&&x("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function O(){return O=o((function*(t,e,r){void 0===e&&(e=!0);try{var i=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),s=n.writable.getWriter(),a=s.write(i).then((()=>s.close())).catch(function(){var t=o((function*(t){try{yield s.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),u=new Response(n.readable).blob(),l=(yield Promise.all([u,a]))[0];return yield E(l,i),l}catch(t){if(null!=r&&r.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),O.apply(this,arguments)}var F={DEBUG:!1,LIB_VERSION:"0.6.0",LIB_NAME:"browser-common"},L=function(e,r){var i=(void 0===r?{}:r).debugEnabled,n={P(r){if(t&&(F.DEBUG||t.POSTHOG_DEBUG||i)&&!y(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[r]?t.console[r].__rrweb_original__:t.console[r]),s=arguments.length,a=new Array(s>1?s-1:0),o=1;s>o;o++)a[o-1]=arguments[o];n(e,...a)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.P("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.P("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.P("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.P("error",...e)},critical(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(t){n.error("You must initialize PostHog before calling "+t)},createLogger:(t,r)=>L(e+" "+t,r)};return n},D=L("[PostHog.js]"),N=D.createLogger;function P(t,e){if(!k(t))if(p(t))t.forEach(e);else if(M(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)v.call(t,r)&&e(t[r],r)}function B(t,e,r,i){var n={},s=n.capture,a=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==s&&s,passive:void 0===a||a})}var W=["localhost","127.0.0.1"],z=t=>{var e=null==r?void 0:r.createElement("a");return y(e)?null:(e.href=t,e)},j=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return P(t,(function(t,e){y(t)||y(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)};function U(e){var r,i=null==t||null==(r=t.location)?void 0:r.href;return y(i)?void 0:function(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!g(i))return e;try{var n=i(e);return w(n)&&n?n:e}catch(t){return D.error("Error in get_current_url, falling back to window.location.href",t),e}}(e,i)}var H=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}))$"),q=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,G=[16,15,14,13],V=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Z=/[0-9A-Za-z_]/;function J(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}var Q="[SessionRecording]",X="redacted",K=1e6;function Y(t){var e;return Math.min(K,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:K)}var tt={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:K,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},et=["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"],rt=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],it=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],nt=t=>{k(t)||P(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return et.includes(e)||it.some((t=>e.includes(t)))})(e)&&(t[e]=X)}))},st=["/s/","/e/","/i/"];function at(t,e,r,i){if(k(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return w(n)&&(n=parseInt(n)),n>r?Q+" "+i+" body too large to record ("+n+" bytes)":t}function ot(t,e){if(k(t))return t;var r=t;return function(t,e){if(k(t))return!1;if(w(t)){if(function(t){var e;for(q.lastIndex=0;e=q.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var s of G){var a=n+s;if(i.length>=a){var o=i.slice(n,a);if(H.test(o)&&J(o))return!0}}}return!1}(t=d(t)))return!1;var r=function(t){var e;for(V.lastIndex=0;e=V.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&Z.test(r)&&Z.test(i)))return!0}return!1}(t);if(r)return!1}return!0}(r)||(r=Q+" "+e+" body "+X),P(rt,(t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r=Q+" "+e+" body "+X+" as might contain: "+t)})),r}var ut=new WeakSet,lt="$session_recording_remote_config",ht="$replay_sample_rate",dt="$replay_override_sampling",ct="$replay_override_linked_flag",vt="$replay_override_url_trigger",ft="$replay_override_event_trigger",pt="$session_is_sampled",gt="$session_past_minimum_duration",mt="$session_recording_url_trigger_activated_session",yt="$session_recording_event_trigger_activated_session",wt="$posthog_sr_group_event_trigger_",bt="$posthog_sr_group_url_trigger_",kt="$posthog_sr_group_sampling_",_t="$debug_first_full_snapshot_timestamp",St="$sess_rec_flush_size",Mt="$stored_person_properties",Ct="$sdk_debug_replay_pending_trigger_conditions",It="$sdk_debug_replay_remote_trigger_matching_config",At="disabled",Rt="sampled",Tt="active",xt="buffering",Et="paused",Ot="rrweb_error",Ft="trigger",Lt=Ft+"_activated",Dt=Ft+"_pending",Nt=Ft+"_"+At;function Pt(t,e,r,i,n,s){return 0===e?Nt:(null==t?void 0:t.get_property(r?i+r:n))===s?Lt:Dt}function Bt(t,e,r){return e.some((e=>{var i;return"regex"===e.matching&&(null!==(i=null==r?void 0:r.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)}))}function $t(t){return t.includes(Lt)?Lt:t.includes(Dt)?Dt:Nt}function Wt(t){var e=new Set(t);switch(e.delete(Nt),e.size){case 0:return Nt;case 1:return Array.from(e)[0];default:return Dt}}class zt{constructor(t){this.F=t}triggerStatus(t){return $t(this.F.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return $t(this.F.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.F.forEach((t=>t.stop()))}}class jt{constructor(t){this.F=t}triggerStatus(t){return Wt(this.F.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return Wt(this.F.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.F.forEach((t=>t.stop()))}}class Ut{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return Lt}stop(){}}var Ht=t=>"sessionRecording"in t;class qt{constructor(t,e){this.N=[],this.q=[],this.j=new Map,this.B=new Map,this.H="",this.urlBlocked=!1,this._instance=t,this.U=e}onConfig(t){var e,r;this.N=(Ht(t)?m(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.q=(Ht(t)?m(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.$()}$(){for(var t of(this.j.clear(),this.B.clear(),this.N))if("regex"===t.matching&&!this.j.has(t.url))try{this.j.set(t.url,new RegExp(t.url))}catch(e){D.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.q)if("regex"===e.matching&&!this.B.has(e.url))try{this.B.set(e.url,new RegExp(e.url))}catch(t){D.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}W(t){return Pt(this._instance,this.N.length,this.U,bt,mt,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:e}),e}triggerStatusNoSideEffects(t){return this.W(t)}isCurrentUrlBlocked(){var t=U(this._instance);if(!t)return!1;try{return Bt(t,this.q,this.B)}catch(t){return!0}}checkUrlBlocklist(t,e){var r=U(this._instance);if(r&&r!==this.H){this.H=r;var i=this.urlBlocked,n=Bt(r,this.q,this.B);i&&n||(n&&!i?t():!n&&i&&e())}}checkUrlTriggerConditions(t,e,r,i){var n=U(this._instance);if(n&&n!==this.H){this.H=n;var s=this.urlBlocked,a=Bt(n,this.q,this.B);a&&!s?t():!a&&s&&e();var o=this.W(i)===Lt,u=Bt(n,this.N,this.j);!o&&u&&r("url",n)}}stop(){this.H=""}}class Gt{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.V=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}triggerStatusNoSideEffects(){var t=Dt;return k(this.linkedFlag)&&(t=Nt),this.linkedFlagSeen&&(t=Lt),t}onConfig(t,e){var r;if(this.linkedFlag=(Ht(t)?m(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!k(this.linkedFlag)&&!this.linkedFlagSeen){var i=w(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=w(this.linkedFlag)?null:this.linkedFlag.variant;this.V=this._instance.onFeatureFlags(((t,r)=>{var s=!1;if(m(r)&&i in r){var a=r[i];s=S(a)?!0===a:n?a===n:!!a}var o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(i,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.V()}}class Vt{constructor(t,e){this.Z=[],this._instance=t,this.U=e}onConfig(t){var e;this.Z=(Ht(t)?m(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}G(t){return Pt(this._instance,this.Z.length,this.U,wt,yt,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}checkEventTriggerConditions(t,e,r){if(0!==this.Z.length){var i=this.G(r)===Lt,n=this.Z.includes(t);!i&&n&&e("event",t)}}stop(){}}class Zt{constructor(t,e,r){if(this._instance=t,this.group=e,this.J=new qt(t,e.id),this.Y=new Vt(t,e.id),this.K=new Gt(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var i=(e.conditions.events||[]).map((t=>t.name)),n={urlTriggers:e.conditions.urls||[],eventTriggers:i,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.J.onConfig(n),this.Y.onConfig(n),this.K.onConfig(n,r);var s=[this.Y,this.J,this.K];this.X="any"===e.conditions.matchType?new zt(s):new jt(s)}else this.X=new Ut}triggerStatus(t){return this.X.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.X.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==Dt?[]:[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===Dt)).map((t=>t.label))}checkEventTriggerConditions(t,e,r){this.Y.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.J.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r;null==(r=this._instance.persistence)||r.register({["url"===t?bt+this.group.id:wt+this.group.id]:e})}stop(){this.J.stop(),this.Y.stop(),this.K.stop()}}function Jt(t){if(t.rrwebError)return Ot;if(!t.receivedFlags)return xt;if(!t.isRecordingEnabled)return At;if(t.urlTriggerMatching.urlBlocked)return Et;var e=!0===t.isSampled,r=new zt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Rt:r===Lt?Tt:r===Dt?xt:!1===t.isSampled?At:Tt}function Qt(t){if(t.rrwebError)return Ot;if(!t.receivedFlags)return xt;if(!t.isRecordingEnabled)return At;if(t.urlTriggerMatching.urlBlocked)return Et;var e=new jt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==Nt,i=S(t.isSampled);return r&&e===Dt?xt:r&&e===Nt||i&&!t.isSampled?At:!0===t.isSampled?Rt:Tt}function Xt(){var t=[];return function(e,r){if(m(r)||p(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r}}function Kt(t){var e=JSON.stringify(t,Xt());return e?new Blob([e]).size:0}function Yt(t){if(b(t))return 4;if(y(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(p(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=y(i)||b(i)?4:Yt(i)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var u=n[o];y(u)||(a||(s+=1),a=!1,s+=o.length+3+Yt(u))}return s;default:return 0}}function te(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),i=t.sizes.slice(0,r),n=t.sizes.slice(r);return[te({size:i.reduce(((t,e)=>t+e),0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),te({size:n.reduce(((t,e)=>t+e),0),data:t.data.slice(r),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}var ee=Uint8Array,re=Uint16Array,ie=Uint32Array,ne=new ee([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]),se=new ee([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]),ae=new ee([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),oe=function(t,e){for(var r=new re(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new ie(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},ue=oe(ne,2),le=ue[1];ue[0][28]=258,le[258]=28;for(var he=oe(se,0)[1],de=new re(32768),ce=0;32768>ce;++ce){var ve=(43690&ce)>>>1|(21845&ce)<<1;de[ce]=((65280&(ve=(61680&(ve=(52428&ve)>>>2|(13107&ve)<<2))>>>4|(3855&ve)<<4))>>>8|(255&ve)<<8)>>>1}var fe=function(t,e,r){for(var i=t.length,n=0,s=new re(e);i>n;++n)++s[t[n]-1];var a,o=new re(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(r){a=new re(1<<e);var u=15-e;for(n=0;i>n;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],d=o[t[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)a[de[d]>>>u]=l}else for(a=new re(i),n=0;i>n;++n)a[n]=de[o[t[n]-1]++]>>>15-t[n];return a},pe=new ee(288);for(ce=0;144>ce;++ce)pe[ce]=8;for(ce=144;256>ce;++ce)pe[ce]=9;for(ce=256;280>ce;++ce)pe[ce]=7;for(ce=280;288>ce;++ce)pe[ce]=8;var ge=new ee(32);for(ce=0;32>ce;++ce)ge[ce]=5;var me=fe(pe,9,0),ye=fe(ge,5,0),we=function(t){return(t/8>>0)+(7&t&&1)},be=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof re?re:t instanceof ie?ie:ee)(r-e);return i.set(t.subarray(e,r)),i},ke=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},_e=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Se=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new ee(0),0];if(1==n){var a=new ee(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var o=r[0],u=r[1],l=0,h=1,d=2;for(r[0]={s:-1,f:o.f+u.f,l:o,r:u};h!=n-1;)o=r[r[d].f>r[l].f?l++:d++],u=r[l!=h&&r[d].f>r[l].f?l++:d++],r[h++]={s:-1,f:o.f+u.f,l:o,r:u};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new re(c+1),f=Me(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var w=s[i].s;e>v[w]?p-=1<<e-v[w]++-1:++i}for(;i>=0&&p;--i){var b=s[i].s;v[b]==e&&(--v[b],++p)}f=e}return[new ee(v),f]},Me=function(t,e,r){return-1==t.s?Math.max(Me(t.l,e,r+1),Me(t.r,e,r+1)):e[t.s]=r},Ce=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new re(++e),i=0,n=t[0],s=1,a=function(t){r[i++]=t},o=1;e>=o;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[r.subarray(0,i),e]},Ie=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Ae=function(t,e,r){var i=r.length,n=we(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},Re=function(t,e,r,i,n,s,a,o,u,l,h){ke(e,h++,r),++n[256];for(var d=Se(n,15),c=d[0],v=d[1],f=Se(s,15),p=f[0],g=f[1],m=Ce(c),y=m[0],w=m[1],b=Ce(p),k=b[0],_=b[1],S=new re(19),M=0;y.length>M;++M)S[31&y[M]]++;for(M=0;k.length>M;++M)S[31&k[M]]++;for(var C=Se(S,7),I=C[0],A=C[1],R=19;R>4&&!I[ae[R-1]];--R);var T,x,E,O,F=l+5<<3,L=Ie(n,pe)+Ie(s,ge)+a,D=Ie(n,c)+Ie(s,p)+a+14+3*R+Ie(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(L>=F&&D>=F)return Ae(e,h,t.subarray(u,u+l));if(ke(e,h,1+(L>D)),h+=2,L>D){T=fe(c,v,0),x=c,E=fe(p,g,0),O=p;var N=fe(I,A,0);for(ke(e,h,w-257),ke(e,h+5,_-1),ke(e,h+10,R-4),h+=14,M=0;R>M;++M)ke(e,h+3*M,I[ae[M]]);h+=3*R;for(var P=[y,k],B=0;2>B;++B){var W=P[B];for(M=0;W.length>M;++M)ke(e,h,N[z=31&W[M]]),h+=I[z],z>15&&(ke(e,h,W[M]>>>5&127),h+=W[M]>>>12)}}else T=me,x=pe,E=ye,O=ge;for(M=0;o>M;++M)if(i[M]>255){var z;_e(e,h,T[257+(z=i[M]>>>18&31)]),h+=x[z+257],z>7&&(ke(e,h,i[M]>>>23&31),h+=ne[z]);var j=31&i[M];_e(e,h,E[j]),h+=O[j],j>3&&(_e(e,h,i[M]>>>5&8191),h+=se[j])}else _e(e,h,T[i[M]]),h+=x[i[M]];return _e(e,h,T[256]),h+x[256]},Te=new ie([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),xe=function(){for(var t=new ie(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Ee=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=xe[255&r^e[i]]^r>>>8;t=r},d:()=>4294967295^t}},Oe=function(t,e,r,i,n){return function(t,e,r,i,n,s){var a=t.length,o=new ee(i+a+5*(1+Math.floor(a/7e3))+n),u=o.subarray(i,o.length-n),l=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var d=h+65535;a>d?l=Ae(u,l,t.subarray(h,d)):(u[h]=true,l=Ae(u,l,t.subarray(h,a)))}else{for(var c=Te[e-1],v=c>>>13,f=8191&c,p=(1<<r)-1,g=new re(32768),m=new re(p+1),y=Math.ceil(r/3),w=2*y,b=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<w)&p},k=new ie(25e3),_=new re(288),S=new re(32),M=0,C=0,I=(h=0,0),A=0,R=0;a>h;++h){var T=b(h),x=32767&h,E=m[T];if(g[x]=E,m[T]=x,h>=A){var O=a-h;if((M>7e3||I>24576)&&O>423){l=Re(t,u,0,k,_,S,C,I,R,h-R,l),I=M=C=0,R=h;for(var F=0;286>F;++F)_[F]=0;for(F=0;30>F;++F)S[F]=0}var L=2,D=0,N=f,P=x-E&32767;if(O>2&&T==b(h-P))for(var B=Math.min(v,O)-1,W=Math.min(32767,h),z=Math.min(258,O);W>=P&&--N&&x!=E;){if(t[h+L]==t[h+L-P]){for(var j=0;z>j&&t[h+j]==t[h+j-P];++j);if(j>L){if(L=j,D=P,j>B)break;var U=Math.min(P,j-2),H=0;for(F=0;U>F;++F){var q=h-P+F+32768&32767,G=q-g[q]+32768&32767;G>H&&(H=G,E=q)}}}P+=(x=E)-(E=g[x])+32768&32767}if(D){k[I++]=268435456|le[L]<<18|he[D];var V=31&le[L],Z=31&he[D];C+=ne[V]+se[Z],++_[257+V],++S[Z],A=h+L,++M}else k[I++]=t[h],++_[t[h]]}}l=Re(t,u,true,k,_,S,C,I,R,h-R,l)}return be(o,0,i+we(l)+n)}(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,i)},Fe=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},Le=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Fe(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}},De=function(t){return 10+(t.filename&&t.filename.length+1||0)};function Ne(t,e){for(var r="",i=0;t.length>i;){var n=t[i++];r+=String.fromCharCode(n)}return r}class Pe{constructor(t,e){var r,i;void 0===e&&(e={}),this.ee={},this.te=t=>{if(!this.ee[t]){var e,r;this.ee[t]=!0;var i=this.re(t);null==(e=(r=this.ie).onBlockedNode)||e.call(r,t,i)}},this.ne=t=>{var e=this.re(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.re=t=>this._rrweb.mirror.getNode(t),this.ae=t=>{var e,r,i,n,s,a,o,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(i=null==(n=t.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(s=null==(a=t.texts)?void 0:a.length)&&void 0!==s?s:0)+(null!==(o=null==(u=t.adds)?void 0:u.length)&&void 0!==o?o:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this.ae(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var e=this.ne(t.id);return!this.oe.consumeRateLimit(e[0])&&t})));var i=this.ae(e);return 0!==i||r===i?t:void 0},this._rrweb=t,this.ie=e,this.oe=new I({bucketSize:null!==(r=this.ie.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.ie.refillRate)&&void 0!==i?i:10,refillInterval:1e3,S:this.te,I:D})}reset(){this.ee={}}stop(){this.oe.stop(),this.reset()}}F.DEBUG=!1,F.LIB_VERSION="1.421.2",F.LIB_NAME="web";class Be{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.se=t.get_property.bind(t),this.ue=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.ue(St,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,r=this.se(St);return m(e=r)&&w(e.sessionId)&&_(e.size)&&r.sessionId===t?r.size:0}}function $e(t,e){return function(t){for(var e=0,r=0;t.length>r;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<C(100*e,0,100,D)}var We=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},ze=t=>t.toLowerCase(),je={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>We(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!We(e,t))))),icontains:(t,e)=>e.map(ze).some((e=>t.map(ze).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(ze).every((e=>t.map(ze).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},Ue=new Set(["is_not","not_icontains","not_regex"]);function He(t,e,r){return!t||0===t.length||t.every((t=>{var i="person"===t.type?r:e,n=null==i?void 0:i[t.key],s=t.operator||"exact";if(y(n)||b(n))return Ue.has(s);var a=je[s];return!!a&&!y(t.value)&&!b(t.value)&&a(p(t.value)?t.value.map(String):[String(t.value)],p(n)?n.map(String):[String(n)])}))}var qe=N("[SessionRecording]");function Ge(t,e){return e?t:"!"+t}function Ve(t,e){return t===e||t!=="!"+e&&null}class Ze{constructor(t,e,r,i,n,s,a){this.le=null,this.ce=Qt,this._instance=t,this.J=e,this.Y=r,this.K=i,this.he=n,this.de=s,this.ve=a}onRemoteConfig(t){this.le=_(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.fe=new zt([this.Y,this.J]),this.ce=Jt):(this.fe=new jt([this.Y,this.J]),this.ce=Qt),this._instance.register_for_session({[It]:t.triggerMatchType}),this.J.onConfig(t),this.Y.onConfig(t),this.K.onConfig(t,((t,e)=>{this.he("linked_flag_matched",{flag:t,variant:e}),this.ve()}))}getStatus(t){return this.ce({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e=this._instance.get_property("$session_recording_remote_config"),r=null==e?void 0:e.minimumDurationMilliseconds;return _(r)?r:null}checkUrlTriggers(t,e,r,i){this.J.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.Y.Z.length&&k(this.pe))return this.pe=t((t=>{try{this.Y.checkEventTriggerConditions(t.event,r,e)}catch(t){qe.error("Could not activate event trigger",t)}})),this.pe}makeSamplingDecisions(t){var e,r,i,n=this.le;if(!_(n))return null==(r=this._instance.persistence)||r.unregister(pt),void(null==(i=this._instance.persistence)||i.unregister(ht));var s=this._instance.get_property(pt),a=this._instance.get_property(ht),o=Ve(s,t),u=_(a)&&a!==n,l=y(a)&&s===t,h=u||l||!S(o),d=h?$e(t,n):o;h&&(d?this.he("sampled"):qe.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[pt]:Ge(t,d),[ht]:b(a)&&s===t?null:n})}ensureSamplingDecision(t){if(_(this.le)){var e=this._instance.get_property(pt);S(Ve(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i,n;null==(t=this._instance.persistence)||t.unregister(yt),null==(e=this._instance.persistence)||e.unregister(mt),null==(r=this._instance.persistence)||r.unregister(pt),null==(i=this._instance.persistence)||i.unregister(ht),null==(n=this._instance.persistence)||n.unregister(gt)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.fe)?void 0:e.triggerStatus(t))===Dt}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===Dt)).map((t=>t.label))}stop(){var t;null==(t=this.pe)||t.call(this),this.pe=void 0,this.Y.stop(),this.J.stop(),this.K.stop()}}class Je{constructor(t,e,r,i,n){this.ge=[],this.me=new Map,this.ye=!1,this._instance=t,this.J=e,this.he=r,this.be=i,this.ve=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.we(t.triggerGroups),this._instance.register_for_session({[It]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:t.triggerGroups.length}),this.J.onConfig(t)):qe.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Ot;if(t.urlTriggerMatching.urlBlocked)return Et;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return At;var i=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===Lt){var o=s.group.id,u=r.get(o);y(u)?D.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===u&&(n=!0)}else a===Dt&&(i=!0)}return n?Rt:i?xt:At}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.ge,triggerGroupSamplingResults:this.me,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.ge)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;_(i)&&(b(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.J.checkUrlBlocklist(e,r);var s=function(i){i.checkUrlTriggerConditions(e,r,(e=>{n.ke(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t),n.ve(e))}),t)};for(var a of this.ge)s(a)}setupEventTriggerListeners(t,e,r){var i=this;return this.pe=t((t=>{var r;if(this.ye)return qe.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.pe)||r.call(this),void(this.pe=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,(n=>{if(i.ke(r,t.properties)){var s=(r.group.conditions.events||[]).filter((e=>e.name===t.event)),a=i._instance.get_property(Mt);s.some((e=>!e.properties||0===e.properties.length||He(e.properties,t.properties,a)))&&(r.activateTrigger(n,e),i.updateActiveTriggers(e),i.ve(n))}}),e)};for(var s of this.ge)n(s)}catch(t){qe.error("Could not activate event trigger for trigger groups",t)}})),this.pe}makeSamplingDecisions(t){for(var e of this.ge){var r,i=e.group,n=i.id,s=i.sampleRate,a=kt+n,o=this._instance.get_property(a),u=null,l=!1,h=!1,d=!1;if(m(o)){var c=o.sessionId,v=o.sampleRate,f=o.sampled;l="string"==typeof c&&c!==t,h=_(v)&&v!==s,u=c===t&&_(v)&&v===s&&S(f)?f:null}else u=o===t||null,l="string"==typeof o&&o!==t,d=o===t;var p=l||h||d||!S(u),g=p?$e(t+n,s):u;p&&this.be("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:s,isSampled:g}),this.me.set(n,g),null==(r=this._instance.persistence)||r.register({[a]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.ye=!0}clearConditionalRecordingPersistence(){var t,e,r;for(var i of(null==(t=this._instance.persistence)||t.unregister(pt),null==(e=this._instance.persistence)||e.unregister(ht),null==(r=this._instance.persistence)||r.unregister(gt),this.ge)){var n,s,a,o=i.group.id;null==(n=this._instance.persistence)||n.unregister(wt+o),null==(s=this._instance.persistence)||s.unregister(bt+o),null==(a=this._instance.persistence)||a.unregister(kt+o)}}updateActiveTriggers(t){var e=[];for(var r of this.ge){var i=r.group,n=i.id,s="trigger_activated"===r.triggerStatus(t),a=!0===this.me.get(n);s&&e.push({id:n,name:i.name,matched:!0,sampled:a})}this._instance.register_for_session({$sdk_debug_replay_matched_recording_trigger_groups:e})}hasPendingTriggers(t){for(var e of this.ge)if(e.triggerStatus(t)===Dt)return!0;return!1}getPendingTriggerConditions(t){return this.ge.flatMap((e=>e.triggerStatusNoSideEffects(t)!==Dt?[]:e.getPendingTriggerConditions(t).map((t=>'trigger group "'+e.group.name+'": '+t))))}stop(){var t;null==(t=this.pe)||t.call(this),this.pe=void 0,this.ge.forEach((t=>t.stop())),this.ge=[],this.me.clear(),this.J.stop()}ke(t,e){var r=t.group.conditions.properties;return!r||0===r.length||He(r,e,this._instance.get_property(Mt))}we(t){var e=this;this.ge.forEach((t=>t.stop())),this.ge=[],this.me.clear();var r=function(t){var r=new Zt(e._instance,t,((r,i)=>{e.he("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name}),e.ve()}));e.ge.push(r)};for(var i of t)r(i)}}var Qe=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Xe=1e5,Ke="https://schema.org",Ye=[],tr="actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),er="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),rr="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),ir="Accommodation AdministrativeArea Country Place State".split(" "),nr={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:er,publisher:rr},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Ye},Offer:{seller:rr},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Person:{},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:rr,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:rr,areaServed:ir,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Ye}},sr={},ar=[[er,sr],["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),nr.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),nr.Event],[rr,nr.Organization],[ir,nr.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),nr.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),sr]],or="AlignmentObject BedDetails Certification ContactPoint CreditCard DefinedRegion EducationalOccupationalCredential EntryPoint GeoCoordinates GeoShape InteractionCounter JobPosting LocationFeatureSpecification MathSolver MemberProgram MemberProgramTier MerchantReturnPolicy MerchantReturnPolicySeasonalOverride MonetaryAmount NutritionInformation OccupationalExperienceRequirements OfferShippingDetails OpeningHoursSpecification PeopleAudience PostalAddress PriceSpecification PropertyValue QuantitativeValue ServicePeriod ShippingConditions ShippingDeliveryTime ShippingRateSettings ShippingService SpeakableSpecification Thing UnitPriceSpecification".split(" ");function ur(t,e){return v.call(t,e)?t[e]:void 0}function lr(t){var e=typeof t;return b(t)||"string"===e||"number"===e||"boolean"===e}function hr(t){return lr(t)||p(t)&&t.every(lr)?t:void 0}function dr(t){if(v.call(nr,t))return nr[t];for(var e of ar){var r=e[1];if(e[0].includes(t))return r}return or.includes(t)?sr:void 0}function cr(t,e){if(!m(t))return null;var r=ur(t,"@type"),i=function(t){return("string"==typeof t?[t]:p(t)?t:[]).filter((t=>"string"==typeof t)).map((t=>t.replace(/^https?:\/\/schema\.org\//,""))).filter((t=>!!dr(t)))}(r).filter((t=>!e||!e.length||e.includes(t)));if(!i.length)return null;var n={"@type":"string"==typeof r?i[0]:i},s=hr(ur(t,"@id"));for(var a of(y(s)||(n["@id"]=s),tr)){var o=hr(ur(t,a));y(o)||(n[a]=o)}for(var u of i){var l=dr(u),h=function(){var e=ur(t,d),r=l[d];if(!0===r){var i=hr(e);y(i)||(n[d]=i)}else if(p(e)){var s=e.map((t=>cr(t,r))).filter(m);s.length&&(n[d]=s)}else{var a=cr(e,r);a&&(n[d]=a)}};for(var d of Object.keys(l))h()}return n}function vr(t){if(!m(t))return null;var e=ur(t,"@context");if("string"!=typeof e||!/^https?:\/\/schema\.org\/?$/.test(e))return null;var r=cr(t);if(r)return u({"@context":Ke},r);var i=ur(t,"@graph");if(!p(i))return null;var n=i.map((t=>cr(t))).filter(m);return n.length?{"@context":Ke,"@graph":n}:null}function fr(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function pr(t,e,r){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some((t=>(e.lastIndex=0,e.test(t)))))return!0;try{return!!r&&t.matches(r)}catch(t){return!1}}function gr(t){return fr(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(fr)}function mr(t){return y(t)?void 0:Math.round(t)}function yr(t){return m(t)?t.network_timing:t}var wr,br,kr=943718.4,_r="[SessionRecording]",Sr=N(_r),Mr=[h.MouseMove,h.MouseInteraction,h.Scroll,h.ViewportResize,h.Input,h.TouchMove,h.MediaInteraction,h.Drag],Cr=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Ir(){var t;return null==s||null==(t=s.__PosthogExtensions__)?void 0:t.rrweb}function Ar(){var t;return null==(t=Ir())?void 0:t.record}function Rr(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,Xt())}}function Tr(t){return Ne(function(t,e){void 0===e&&(e={});var r=Ee(),i=t.length;r.p(t);var n=Oe(t,e,De(e),8),s=n.length;return Le(n,e),Fe(n,s-8,r.d()),Fe(n,s-4,i),n}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new ee(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},a=0;r>a;++a){if(n+5>i.length){var o=new ee(n+8+(r-a<<1));o.set(i),i=o}var u=t.charCodeAt(a);128>u?s(u):2048>u?(s(192|u>>>6),s(128|63&u)):u>55295&&57344>u?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++a))>>>18),s(128|u>>>12&63),s(128|u>>>6&63),s(128|63&u)):(s(224|u>>>12),s(128|u>>>6&63),s(128|63&u))}return be(i,0,n)}(Rr(t))))}function xr(t){return Er.apply(this,arguments)}function Er(){return Er=o((function*(t){var e=Rr(t),r=yield function(t,e,r){return O.apply(this,arguments)}(e,F.DEBUG,{rethrow:!0});return Ne(new Uint8Array(yield r.arrayBuffer()))})),Er.apply(this,arguments)}var Or="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Fr=!1;function Lr(t){return p(t)&&0===t.length?wr=null!=wr?wr:Tr([]):Tr(t)}function Dr(t){return Nr.apply(this,arguments)}function Nr(){return(Nr=o((function*(t){return p(t)&&0===t.length?wr||(br=null!=br?br:xr([]).then((t=>(wr=t,t))).catch((t=>{throw wr=void 0,br=void 0,t}))):xr(t)}))).apply(this,arguments)}function Pr(t){return Or&&!Fr&&function(t){return t.type===l.FullSnapshot||t.type===l.IncrementalSnapshot&&(t.data.source===h.Mutation||t.data.source===h.StyleSheetRule)}(t)}function Br(t){return{event:t,size:Yt(t)}}function $r(t,e){return u({},t,{data:e,cv:"2024-10"})}function Wr(t,e){return u({},t,{cv:"2024-10",data:u({},t.data,e)})}function zr(t){try{if(t.type===l.FullSnapshot)return Br($r(t,Tr(t.data)));if(t.type===l.IncrementalSnapshot&&t.data.source===h.Mutation)return Br(Wr(t,{texts:Lr(t.data.texts),attributes:Lr(t.data.attributes),removes:Lr(t.data.removes),adds:Lr(t.data.adds)}));if(t.type===l.IncrementalSnapshot&&t.data.source===h.StyleSheetRule)return Br(Wr(t,{adds:t.data.adds?Tr(t.data.adds):void 0,removes:t.data.removes?Tr(t.data.removes):void 0}))}catch(t){Sr.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Kt(t)}}function jr(){return(jr=o((function*(t){try{if(t.type===l.FullSnapshot)return Br($r(t,yield xr(t.data)));if(t.type===l.IncrementalSnapshot&&t.data.source===h.Mutation){var e=yield Promise.all([Dr(t.data.texts),Dr(t.data.attributes),Dr(t.data.removes),Dr(t.data.adds)]);return Br(Wr(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(t.type===l.IncrementalSnapshot&&t.data.source===h.StyleSheetRule){var r=yield Promise.all([t.data.adds?xr(t.data.adds):void 0,t.data.removes?xr(t.data.removes):void 0]);return Br(Wr(t,{adds:r[0],removes:r[1]}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===T})(e)&&(Fr=!0),Sr.error("could not compress event asynchronously - trying synchronous compression",e),zr(t)}return{event:t,size:Kt(t)}}))).apply(this,arguments)}function Ur(t,e){return t.type===l.Custom&&t.data.tag===e}function Hr(t){return Ur(t,"sessionIdle")}function qr(t){return Ur(t,"$session_ending")}function Gr(t){return Ur(t,"$session_starting")}class Vr{get sessionId(){return this._e}get Se(){if(!this._instance.sessionManager)throw new Error(_r+" must be started with a valid sessionManager.");return this._instance.sessionManager}get xe(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get Ce(){return Ve(this._instance.get_property(pt),this.sessionId)}get le(){var t,e=null==(t=this.Me)?void 0:t.sampleRate;return _(e)?e:null}get Te(){var t,e;return null!==(t=null==(e=this.Ie)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this.Ee="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Re=void 0,this.Ae=!1,this.Le=Date.now(),this.Oe=!1,this.Pe=[],this.De="unknown",this.Fe=0,this.Ne=!1,this.qe=!1,this.je=!1,this.Be=!1,this.He=!1,this.Ue=!1,this.$e=!1,this.We=!1,this.ze=!1,this.Ve=!1,this.Ze=!1,this.Ge=!1,this.Qe=[],this.Je=void 0,this.Ye=void 0,this.Ke=[],this.Xe=0,this.et=0,this.tt=!1,this.rt=void 0,this.pe=void 0,this.it=void 0,this.nt=void 0,this.ot=void 0,this.st=(t,e,r)=>{var i,n,s;if(r&&(t!==this._e||e!==this.ut)){var a,o=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this._e,l=this.ut;if(o&&this.be("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Le,flushed_size:null==(a=this.ct)?void 0:a.currentTrackedSize(u)}),null==(i=this._instance.persistence)||i.unregister(_t),this.$e=!1,null==(n=Ir())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.be("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.ht(),!(!1===this.De&&this.isStarted||this._e===t&&this.ut===e)){var h=this._e!==t&&!1!==this.De;this.De="unknown",this.dt(h)}o&&this.be("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Le}),null==(s=this.Ie)||s.makeSamplingDecisions(t)}},this.vt=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[gt])===this._e},this.ft=()=>{var t,e;if(0===this.yt.data.length)return null;var r=null==(t=this.yt.data[0])?void 0:t.timestamp,i=null==(e=this.yt.data[this.yt.data.length-1])?void 0:e.timestamp;return _(r)&&_(i)?i-r:null},this.bt=()=>{var t,e,r=this.Te;if(!_(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.wt;return _(i)&&i>=0&&r>i}if(this.vt())return!1;var n,s=this.ft();return!!b(s)||r>s||(null==(n=this._instance.persistence)||n.register({[gt]:this._e}),!1)},this.kt=()=>{this.status!==xt?(this.Ne&&this.qe&&this._t&&!this.je&&(this.Ne=!1),this.St(),this.xt()):this.Ct()},this.Mt=()=>{this.kt()},this.Tt=()=>{this.be("browser offline",{})},this.It=()=>{this.be("browser online",{})},this.Et=()=>{null!=r&&r.visibilityState&&("visible"===r.visibilityState&&(this._t=!0),this.be("window "+r.visibilityState,{}))},this._instance=t,this._t=null==e||e;var i=this.Se.checkAndGetSessionAndWindowId(),n=i.windowId;this._e=i.sessionId,this.ut=n,this.K=new Gt(this._instance),this.J=new qt(this._instance),this.Y=new Vt(this._instance),this.yt=this.Ct(),this.Se.sessionTimeoutMs>this.xe||Sr.warn("session_idle_threshold_ms ("+this.xe+") is greater than the session timeout ("+this.Se.sessionTimeoutMs+"). Session will never be detected as idle"),this.ct=new Be(this._instance)}setDocumentWasEverVisible(t){t&&(this._t=!0)}get Rt(){var t,e,r,i,n,s,a,o,u,l=null==(t=this.Me)?void 0:t.masking,h={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==(i=this._instance.config.session_recording)?void 0:i.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},d=null!==(s=null==h?void 0:h.maskAllInputs)&&void 0!==s?s:null==l?void 0:l.maskAllInputs,c=null!==(a=null==h?void 0:h.maskTextSelector)&&void 0!==a?a:null==l?void 0:l.maskTextSelector,v=null!==(o=null==h?void 0:h.blockSelector)&&void 0!==o?o:null==l?void 0:l.blockSelector,f=null!==(u=null==h?void 0:h.maskAllElementAttributes)&&void 0!==u?u:null==l?void 0:l.maskAllElementAttributes;return y(d)&&y(c)&&y(v)&&y(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:c,blockSelector:v,maskAllElementAttributes:f}}At(){var t;if(!this.ze){var e=null==(t=this.Me)?void 0:t.masking;if(!k(e)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter((t=>{var i=null==r?void 0:r[t],n=e[t];return!y(i)&&i!==n}));0!==i.length&&(this.ze=!0,Sr.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==r?void 0:r.maskAllInputs,maskTextSelector:null==r?void 0:r.maskTextSelector,blockSelector:null==r?void 0:r.blockSelector,maskAllElementAttributes:null==r?void 0:r.maskAllElementAttributes},project:e}))}}}get Lt(){var t;return C(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,N("canvas recording resolution scale"),1)}get Ot(){var t,e,r,i,n,s,a,o=this._instance.config.session_recording.captureCanvas,u=null==(t=this.Me)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==o?void 0:o.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,h=null!==(i=null!==(n=null==o?void 0:o.canvasFps)&&void 0!==n?n:null==u?void 0:u.fps)&&void 0!==i?i:4,d=null!==(s=null!==(a=null==o?void 0:o.canvasQuality)&&void 0!==a?a:null==u?void 0:u.quality)&&void 0!==s?s:.4;if("string"==typeof d){var c=parseFloat(d);d=isNaN(c)?.4:c}return{enabled:l,fps:C(h,0,12,N("canvas recording fps"),4),quality:C(d,0,1,N("canvas recording quality"),.4)}}get Pt(){var t,e=!(null==(t=this.Me)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Dt(){var t,e,r,i=null==(t=this.Me)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),a=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),o=yr(this._instance.config.capture_performance),u=yr(null==i?void 0:i.capturePerformance),l=!!(S(o)?o:u);return s||a||l?{recordHeaders:s,recordBody:a,recordPerformance:l}:void 0}Ft(){var t,e,r=[],n=null==(t=s.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Pt&&r.push(n());var a=null==(e=s.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Dt&&g(a))if(!W.includes(i.hostname)||this._forceAllowLocalhostNetworkCapture){var o=g(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;r.push(a(((t,e,r)=>{var i,n={payloadSizeLimitBytes:tt.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...tt.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...tt.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,o=!1!==t.capture_performance&&e.recordPerformance,l=(i=Y(n),t=>(null!=t&&t.requestBody&&(t.requestBody=at(t.requestBody,t.requestHeaders,i,"Request")),null!=t&&t.responseBody&&(t.responseBody=at(t.responseBody,t.responseHeaders,i,"Response")),t)),h=e=>{return l(((t,e,r)=>{var i;if(null==r||!r(t.name)){var n=z(t.name),s=0===e.indexOf("http")?null==(i=z(e))?void 0:i.pathname:e;"/"===s&&(s="");var a=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&a&&st.some((t=>0===a.indexOf(t)))))return t}})((nt((i=e).requestHeaders),nt(i.responseHeaders),i),t.api_host,r));var i},d=g(t.session_recording.maskNetworkRequestFn);return d&&g(t.session_recording.maskCapturedNetworkRequestFn)&&D.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var r=t.session_recording.maskNetworkRequestFn({url:e.name});return!r&&e.isInitial?r:u({},e,{name:null==r?void 0:r.url})}),n.maskRequestFn=g(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r=h(e);if(r){var i=r.isInitial?{name:"",entryType:r.entryType,startTime:r.startTime,duration:r.duration,endTime:r.endTime,timeOrigin:r.timeOrigin,timestamp:r.timestamp,isInitial:!0}:void 0,n=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(r);return k(n)&&i?(ut.add(i),i):null!=n?n:void 0}}:t=>function(t){if(!y(t))return t.requestBody=ot(t.requestBody,"Request"),t.responseBody=ot(t.responseBody,"Response"),t}(h(t)),u({},tt,n,{recordHeaders:s,recordBody:a,recordPerformance:o,recordInitialRequests:o,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Dt,o)))}else Sr.info("NetworkCapture not started because we are on localhost.");return r}Nt(t){return this._instance.config.disable_capture_url_hashes?A(t):t}qt(t,e){void 0===e&&(e=!1);var r=e?A(t):this.Nt(t),i=this._instance.config.mask_personal_data_properties?[...Qe,...this._instance.config.custom_personal_data_properties||[]]:[];return this.jt(function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],s=(i[0]||"").split("?"),a=s[1],o=s[0],u=(a||"").split("&"),l=[],h=0;u.length>h;h++){var d=u[h].split("=");p(d)&&(e.includes(d[0])?l.push(d[0]+"=<masked>"):l.push(u[h]))}var c=o;return null!=a&&(c+="?"+l.join("&")),null!=n&&(c+="#"+n),c}(r,i))}jt(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var r,i=e.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}Bt(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Pe.length?this.Pe.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Sr.warn("could not emit queued rrweb event.",e,t),!1}}be(t,e){return this.Bt(Cr((()=>Ar().addCustomEvent(t,e))))}Ht(){var t;return this.Ae&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.J.urlBlocked&&!0!==this.De}Ut(t){if(!this.Ht())return!1;try{var e=Ar();return!!e&&(e.addCustomEvent("$json_ld",t),this.Ht())}catch(t){return!1}}$t(t){void 0===t&&(t=!1),Promise.resolve().then((()=>{var e;return null==(e=this.Wt)?void 0:e.scan(t)}))}zt(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),r=this.qt(e.origin+e.pathname+e.search);this.Vt!==r&&(this.Vt=r,this.be("$url_changed",{href:r}))}catch(t){}}Zt(){if(this.Pe.length){var t=[...this.Pe];this.Pe=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.Bt(t)}))}}de(){return this.Bt(Cr((()=>Ar().takeFullSnapshot())))}get Gt(){var t,e,r;if(null!=(t=this.Ie)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var i,n=null==(i=this._instance.config.session_recording)?void 0:i.trigger_pending_buffer_interval_millis;return _(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Qt(){if(this.Jt&&clearInterval(this.Jt),!0!==this.De){var t=this.Gt;t&&(this.Jt=setInterval((()=>{this.de()}),t))}}ve(t){"event"===t&&this.Yt(),!this.J.urlBlocked&&["sampled","active"].includes(this.status)&&this.Qt()}Kt(){var t;this.J.urlBlocked||(this.J.urlBlocked=!0,null==(t=this.Wt)||t.scan(),clearInterval(this.Jt),Sr.info("recording paused due to URL blocker"),this.be("recording paused",{reason:"url blocker"}))}Xt(){var t;this.J.urlBlocked&&(null==(t=this.Wt)||t.scan(),this.J.urlBlocked=!1,this.de(),this.$t(),this.Qt(),this.be("recording resumed",{reason:"left blocked url"}),Sr.info("recording resumed"))}er(t,e){var r;if("event"===t&&this.Yt(),!this.Oe&&null!=(r=this.Ie)&&r.hasPendingTriggers(this.sessionId)){this.Oe=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===t?mt:yt]:this.sessionId}),null==(n=this.Ie)||n.updateActiveTriggers(this.sessionId),this.ve(),this.xt(),this.he(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Oe=!1}}}get isStarted(){return!!this.Re}get Me(){var t=this._instance.get_property(lt);if(t){var e;try{e=m(t)?t:JSON.parse(t)}catch(t){return void Sr.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return Sr.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(i=this._instance.persistence)||i.unregister(lt))}return e}}tr(t,e,r){this._instance.get_property(t)&&(e(),r())}start(e){var i,n,s=this.Me;if(s){this.isStarted||(this.Ne=!1!==this.De&&!this.Be,this.Be=!1,this.qe=this.Ne,this.je=!1),this.tt&&(this.rr(),this.Ct());var a=this.Se.checkAndGetSessionAndWindowId(),o=a.windowId;this._e=a.sessionId,this.ut=o,null==(i=this._instance.persistence)||i.unregister(_t),null!=s&&s.endpoint&&(this.Ee=null==s?void 0:s.endpoint),this.Ie=2===(null==s?void 0:s.version)&&(null==s?void 0:s.triggerGroups)&&s.triggerGroups.length>0?new Je(this._instance,this.J,this.he.bind(this),this.be.bind(this),this.ve.bind(this)):new Ze(this._instance,this.J,this.Y,this.K,this.he.bind(this),this.de.bind(this),this.ve.bind(this)),this.Ie.onRemoteConfig(s),null==(n=this.pe)||n.call(this),this.pe=this.Ie.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.er(t,e))),this.tr(dt,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(dt)})),this.tr(ct,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(ct)})),this.tr(ft,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(ft)})),this.tr(vt,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(vt)})),this.Ie.makeSamplingDecisions(this.sessionId),this.ir(),this.He||(B(t,"beforeunload",this.kt),B(t,"pagehide",this.Mt),B(t,"offline",this.Tt),B(t,"online",this.It),B(r,"visibilitychange",this.Et),!this.it&&g(this.Se.onSessionId)&&(this.it=this.Se.onSessionId(this.st)),!this.nt&&g(this.Se.on)?this.nt=this.Se.on("forcedIdleReset",(()=>{this.ht(),this.De="unknown",this.stop(),this.ot=this.Se.onSessionId(((t,e,r)=>{var i;null==(i=this.ot)||i.call(this),this.ot=void 0,this.st(t,e,r)}))})):g(this.Se.on)||Sr.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),k(this.rt)&&(this.rt=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.qt(t.properties.$current_url):"";if(!e)return;this.be("$pageview",{href:e})}}catch(t){Sr.error("Could not add $pageview to rrweb session",t)}}))),this.status===Tt&&this.he(e||"recording_initialized"))}else Sr.info("remote config must be stored in persistence before recording can start")}nr(){var e,i,n,s,a,o;null==t||t.removeEventListener("beforeunload",this.kt),null==t||t.removeEventListener("pagehide",this.Mt),null==t||t.removeEventListener("offline",this.Tt),null==t||t.removeEventListener("online",this.It),null==r||r.removeEventListener("visibilitychange",this.Et),clearInterval(this.Jt),this.ar(),null==(e=this.rt)||e.call(this),this.rt=void 0,null==(i=this.pe)||i.call(this),this.pe=void 0,null==(n=this.it)||n.call(this),this.it=void 0,null==(s=this.nt)||s.call(this),this.nt=void 0,null==(a=this.ot)||a.call(this),this.ot=void 0,null==(o=this.Ie)||o.stop(),this.sr(),this.rr()}rr(){this.et+=1,this.Ke=[],this.Xe=0,this.ur=void 0,this.tt=!1}sr(){var t,e,r;null==(t=this.lr)||t.stop(),this.Pe=[],null==(e=this.Wt)||e.stop(),this.Wt=void 0,this.Ae=!1,null==(r=this.Re)||r.call(this),this.Re=void 0}cr(){if(!this.ur||0===this.Xe)return!1;if(this.tt)return!0;this.tt=!0;var t=this.et;return this.ar(),this.sr(),this.ur.catch((()=>{})).then((()=>{t===this.et&&(this.tt=!1,this.xt(),this.Ct(),this.nr(),Sr.info("stopped"))})).catch((()=>{this.tt=!1,this.nr(),Sr.info("stopped")})),!0}stop(){this.sr(),this.cr()||(this.xt(),this.Ct(),this.nr(),Sr.info("stopped"))}dt(t){var e;this.stop(),this.hr=void 0,this.dr=void 0,null==(e=Ir())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed"),this.Ne=t,this.qe=!1}Yt(){this.isStarted||(this.Be=!0),this.Ne&&(this.Ne=!1,this.qe=!1,this.je&&(this.je=!1,this.de()),this.vr())}discard(){this.Ct(),this.nr(),Sr.info("discarded")}pr(t,e,r,i,n){var s={$snapshot_bytes:r,$snapshot_data:e,$session_id:i,$window_id:n};this.status!==At?(this.gr(t,i),this.mr(s)):this.Ct()}yr(){try{this.br()}catch(t){this.We||(this.We=!0,Sr.error("could not track full snapshot cost",t))}}br(){var t,e=null==(t=Ir())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.dr&&(this.dr=e,this.hr&&this.hr.durationMs>=e.durationMs||(this.hr=e),500>e.durationMs||Sr.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}gr(t,e){t.type!==l.FullSnapshot?t.type===l.IncrementalSnapshot&&(y(this.Je)||this.Je===e||this.Ye===e||(this.Ye=e,Sr.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.de())):this.Je=e}wr(t){t.counted&&t.generation===this.et&&(this.Xe=Math.max(0,this.Xe-1)),t.counted=!1,this.Ke=this.Ke.filter((e=>e!==t))}kr(t,e,r){t.processed||t.generation!==this.et||(t.processed=!0,this.pr(t.event,e,r,t.targetSessionId,t.targetWindowId))}_r(t){try{var e=t.compressionEnabled?zr(t.event):{event:t.event,size:Kt(t.event)};this.kr(t,e.event,e.size)}finally{this.wr(t)}}St(){[...this.Ke].forEach((t=>{this._r(t)}))}Sr(t,e,r,i){var n=this,s={event:t,compressionEnabled:e,targetSessionId:r,targetWindowId:i,generation:this.et,processed:!1,counted:!0};this.Ke.push(s),this.Xe+=1;var a=function(){var r=o((function*(){try{if(s.processed)return;var r,i;try{var a=e?Pr(t)?yield function(t){return jr.apply(this,arguments)}(t):zr(t):{event:t,size:Kt(t)};r=a.event,i=a.size}catch(e){Sr.error("could not process queued compression event - will use uncompressed event",e),r=t,i=Kt(t)}n.kr(s,r,i)}finally{n.wr(s)}}));return function(){return r.apply(this,arguments)}}();this.ur=this.ur?this.ur.catch((()=>{})).then(a):a()}onRRwebEmit(t){var e,r,i,n,s,a,o,u,d;if(this._instance.sessionManager&&(this.Zt(),t&&m(t))){if(t.type===l.Meta){var c=this.qt(t.data.href);if(this.Vt=c,!c)return;t.data.href=c}else this.zt();if(null==(e=this.Ie)||e.checkUrlTriggers(this.sessionId,(()=>this.Kt()),(()=>this.Xt()),((t,e)=>this.er(t,e))),!this.J.urlBlocked||(v=t).type===l.Custom&&"recording paused"===v.data.tag){var v,f,p,g;t.type===l.FullSnapshot&&(null!=(f=Ir())&&null!=f.wasMaxDepthReached&&f.wasMaxDepthReached()&&(this.$e=!0),this.yr(),Promise.resolve().then((()=>this.yr())),this.Qt(),null==(p=this.lr)||p.reset(),null==(g=this._instance.persistence)||g.register_once({[_t]:t.timestamp},void 0));var y=t.type===l.FullSnapshot&&(null==(r=this.Ie)?void 0:r.hasPendingTriggers(this.sessionId));y&&this.Cr();var w=this.lr?this.lr.throttleMutations(t):t;if(w){var b=function(t){var e=t;if(e&&m(e)&&6===e.type&&m(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=[],i=0;e.data.payload.payload.length>i;i++)r.push(e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?e.data.payload.payload[i].slice(0,2e3)+"...[truncated]":e.data.payload.payload[i]);return e.data.payload.payload=r,t}return t}(w),k=function(t){return qr(t)?t.data.payload:null}(b),_=function(t){return Gr(t)?t.data.payload:null}(b),S=function(t){return Hr(t)?t.data.payload:null}(b);k||_?null!=k&&k.lastActivityTimestamp&&(b.timestamp=k.lastActivityTimestamp):null!=S&&S.sessionId||this.Mr(b),t.type===l.FullSnapshot&&(this.Qe.push([this._e,t.timestamp]),this.Qe.length>6&&(this.Qe=this.Qe.slice(-6)));var M=null!==(i=null!==(n=null!==(s=null==k?void 0:k.currentSessionId)&&void 0!==s?s:null==_?void 0:_.nextSessionId)&&void 0!==n?n:null==S?void 0:S.sessionId)&&void 0!==i?i:this._e,C=null!==(a=null!==(o=null!==(u=null==k?void 0:k.currentWindowId)&&void 0!==u?u:null==_?void 0:_.nextWindowId)&&void 0!==o?o:null==S?void 0:S.windowId)&&void 0!==a?a:this.ut;if(!0!==this.De||function(t){return Hr(t)||qr(t)||Gr(t)}(b)){b.type===l.FullSnapshot&&(this.Fe=0),S&&(b.timestamp=S.lastActivityTimestamp+S.threshold);var I=this.Ae;this.Ae=!0,y?this.$t(!0):I||this.$t();var A=null===(d=this._instance.config.session_recording.compress_events)||void 0===d||d;if(this.Xe>0||A&&Pr(b))this.Sr(b,A,M,C);else{var R=A?zr(b):{event:b,size:Kt(b)};this.pr(b,R.event,R.size,M,C)}}else(function(t){return t.type===l.FullSnapshot||t.type===l.Meta||t.type===l.IncrementalSnapshot&&t.data.source!==h.CanvasMutation})(b)&&this.Fe++}else!0===this.De&&this.Fe++}}}get status(){return this.Ie?this.Ie.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.Ce,rrwebError:this.He,urlTriggerMatching:this.J,eventTriggerMatching:this.Y,linkedFlagMatching:this.K,remoteConfig:this.Me}):At}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.K.linkedFlagSeen=!0,this.de(),this.Yt(),this.he("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[pt]:this.sessionId,[ht]:null}),this.de(),this.Yt(),this.he("sampling_overridden")}overrideTrigger(t){this.er(t),this.Yt()}Tr(){try{var e,r=null==t||null==(e=t.location)?void 0:e.href;if(!r)return;var i=this.qt(r);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}ar(){this.Ir&&(clearTimeout(this.Ir),this.Ir=void 0)}vr(){this.Ir||(this.Ir=setTimeout((()=>{this.xt()}),2e3))}Er(){return this.Je!==this.yt.sessionId&&0!==this.yt.data.length&&this.yt.data.every((t=>(null==t?void 0:t.type)===l.Custom&&!qr(t)&&!Gr(t)))}Rr(){var t,e;return null!==(t=null==(e=this.Ie)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Ar(t){if(t!==xt)return y(this.Lr)||this._instance.register_for_session({[Ct]:[]}),void(this.Lr=void 0);var e=this.Rr();if(0===e.length)return y(this.Lr)||this._instance.register_for_session({[Ct]:[]}),void(this.Lr=void 0);var r=e.join(", "),i=this.sessionId+":"+r;i!==this.Lr&&(this.Lr=i,this._instance.register_for_session({[Ct]:e}),Sr.info("buffering: "+r))}xt(){var t;if(this.ar(),this.Ne)return this.yt;if(this.Er())return this.yt.size>kr?this.Ct():this.yt;var e=this.yt;null==(t=this.Ie)||t.ensureSamplingDecision(this.sessionId);var r=this.bt(),i=this.status;if(this.Ar(i),i===xt||i===Et||i===At||r)return this.vr(),this.yt;if(this.yt!==e)return this.yt;if(e.data.length>0){var n,s=this.Tr();te(e).forEach((t=>{var e;null==(e=this.ct)||e.trackSize(t.sessionId,t.size),this.Or({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:F.LIB_NAME,$lib_version:F.LIB_VERSION,$snapshot_host:s})})),null==(n=this.Ie)||n.onFlushComplete()}return this.Ct()}mr(t){var e,r=2+((null==(e=this.yt)?void 0:e.data.length)||0),i=t.$session_id,n=this.yt.sessionId!==i;if(n||!0!==this.De&&!this.Ne&&this.yt.size+t.$snapshot_bytes+r>kr){var s=this._e;if(this.yt=this.xt(),this._e!==s)return;n&&this.yt.data.length>0&&(this.yt=this.Ct()),this.yt.sessionId=i,this.yt.windowId=t.$window_id}this.Ne&&(this.je||this.yt.size+t.$snapshot_bytes+r>kr)?this.je||(this.je=!0,this.yt=this.Ct()):(this.yt.size+=t.$snapshot_bytes,this.yt.data.push(t.$snapshot_data),this.yt.sizes.push(t.$snapshot_bytes),!0===this.De||this.Ne||this.vr())}Or(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.Ee),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get wt(){var t,e,r=null==(t=this.yt)?void 0:t.data[(null==(e=this.yt)?void 0:e.data.length)-1],i=this.Se.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i.sessionStartTimestamp:null}Cr(){if(!this.yt||0===this.yt.data.length)return this.Ct();for(var t=-1,e=this.yt.data.length-1;e>=0;e--)if(this.yt.data[e].type===l.Meta){t=e;break}return 0>t?this.Ct():(this.yt.data=this.yt.data.slice(t),this.yt.sizes=this.yt.sizes.slice(t),this.yt.size=this.yt.sizes.reduce(((t,e)=>t+e),0),this.yt)}Ct(){return this.yt={size:0,data:[],sizes:[],sessionId:this._e,windowId:this.ut},this.yt}he(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),Sr.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.be("$recording_started",u({reason:t},e))}Pr(t){var e;return 3===t.type&&-1!==Mr.indexOf(null==(e=t.data)?void 0:e.source)}Mr(t){var e=this.Pr(t);e||!0===this.De||t.timestamp-this.Le>this.xe&&(this.De=!0,clearInterval(this.Jt),this.be("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Le,threshold:this.xe,bufferLength:this.yt.data.length,bufferSize:this.yt.size,sessionId:this._e,windowId:this.ut}),this.xt());var r=!1;if(e&&(this.Le=t.timestamp,this.De)){var i="unknown"===this.De;this.De=!1,i||(this.be("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}var n=this.Se.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,a=n.sessionId,o=this._e!==a,u=this.ut!==s;if(this.ut=s,this._e=a,o||u){var l=o&&!1!==this.De;l&&(this.De="unknown"),this.dt(l)}else if(e&&this.Yt(),r){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.Ie)?void 0:h.hasPendingTriggers(this.sessionId));this.Fe>0&&d&&this.de(),this.$t(),this.Qt()}}ht(){var t;null==(t=this.Ie)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,r,i,n,s,a,o,u,l=this.Se.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=Ir())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.yt.data.length,$sdk_debug_replay_internal_buffer_size:this.yt.size,$sdk_debug_current_session_duration:this.wt,$sdk_debug_session_start:l,$sdk_debug_replay_flushed_size:null==(e=this.ct)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Qe,$snapshot_max_depth_exceeded:this.$e,$sdk_debug_replay_slowest_full_snapshot_ms:mr(null==(r=this.hr)?void 0:r.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:mr(null==(i=this.hr)?void 0:i.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.hr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.hr)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.hr)?void 0:a.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:mr(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:mr(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:mr(null==(o=Ir())||null==o.getMutationCost||null==(o=o.getMutationCost())?void 0:o.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(u=Ir())||null==u.getDiscardedDurationSamples?void 0:u.getDiscardedDurationSamples(),$sdk_debug_replay_rrweb_error:this.He,$sdk_debug_rrweb_attached:!!this.Re,$sdk_debug_rrweb_start_attempted:this.Ue}}ir(){var e;if(!this.Re){this.Ue=!0;var i,n,s,a,o={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,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},l=this._instance.config.session_recording;for(var h of Object.entries(l||{})){var d=h[0],c=h[1];if(d in o)if("maskInputOptions"===d)o.maskInputOptions=u({password:!0},c);else if("sampling"===d){var v=null!=c?c:{},f={};y(v.mousemove)||(f.mousemove=v.mousemove),y(v.mouseInteraction)||(f.mouseInteraction=v.mouseInteraction),o.sampling=f}else o[d]=c}!0===(null==l?void 0:l.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=u({},o.slimDOMOptions,{script:!0})),this.Ot&&this.Ot.enabled&&(o.recordCanvas=!0,o.sampling=u({},o.sampling,{canvas:this.Ot.fps}),o.dataURLOptions={type:"image/webp",quality:this.Ot.quality},o.canvasResolutionScale=this.Lt,o.canvasMasking={configured:()=>{var t;return g(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,r=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(g(r))try{var i;return null!==(i=r(t))&&void 0!==i?i:null}catch(t){return this.Ze||(this.Ze=!0,Sr.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Rt&&(o.maskAllInputs=null===(i=this.Rt.maskAllInputs)||void 0===i||i,o.maskTextSelector=null!==(n=this.Rt.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(s=this.Rt.blockSelector)&&void 0!==s?s:void 0,o.maskAllElementAttributes=null!==(a=this.Rt.maskAllElementAttributes)&&void 0!==a&&a),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.Ve||(this.Ve=!0,Sr.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.At();var m=Ar();if(m){this.lr=null!==(e=this.lr)&&void 0!==e?e:new Pe(m,{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";Sr.info(r,{node:e}),this.log(_r+" "+r,"warn")}});var w=this.Ft();if(this.Re=m(u({emit:t=>{this.onRRwebEmit(t)},plugins:w,errorHandler:(t,e)=>"rrweb"===e&&(this.Ge||(this.Ge=!0,Sr.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.Re)return this.He=!0,void Sr.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.He=!1,!0===(null==l?void 0:l.captureJsonLd)&&r&&null!=t&&t.MutationObserver&&!this.Wt&&(this.Wt=function(t,e,r){var i=new WeakMap,n=r.getCaptureState||(()=>!0),s=Xe,a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){for(var r=t;r;){if(pr(r,e.blockClass,e.blockSelector)||pr(r,e.maskTextClass,e.maskTextSelector))return!0;var i=r.parentNode;r=r.parentElement||(i&&i.nodeType===i.DOCUMENT_FRAGMENT_NODE?i.host:null)}return!1}(e,r))return;var o=function(t){if(!t||t.length>Xe)return null;try{var e=JSON.parse(t),r=p(e)?e.map(vr):vr(e);if(b(r)||p(r)&&(!r.length||r.some(b)))return null;var i=JSON.stringify(r);return i.length>2e4?null:[r,i]}catch(t){return null}}(e.text);if(!o)return void i.delete(e);var u=o[0],l=o[1];if(b(a))return void i.set(e,l);if(i.get(e)!==l){if(l.length>s)return void(s=0);r.emit(u)&&(i.set(e,l),s-=l.length)}}catch(t){return}};try{var o=new e((t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of gr(t))a(e)};for(var r of t)if("childList"===r.type)fr(r.target)&&a(r.target),r.addedNodes.forEach(e);else if("characterData"===r.type){var i=r.target.parentNode;i&&fr(i)&&a(i)}else"attributes"===r.type&&fr(r.target)&&a(r.target)}catch(t){return}}));return o.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&gr(t.documentElement).forEach((t=>{e&&i.delete(t),a(t)}))},stop(){return o.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(r,t.MutationObserver,{blockClass:o.blockClass,blockSelector:o.blockSelector,maskTextClass:o.maskTextClass,maskTextSelector:o.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.J.urlBlocked||this.J.isCurrentUrlBlocked()?null:this.Ht()},emit:t=>this.Ut(t)}),this.J.isCurrentUrlBlocked()&&this.Wt.scan()),this.Le=Date.now(),this.De=S(this.De)?this.De:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Me),this.be("$session_options",{sessionRecordingOptions:o,activePlugins:w.map((t=>null==t?void 0:t.name))}),this.be("$posthog_config",{config:this._instance.config})}else Sr.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.be(t,e)}}var Zr,Jr=["type"],Qr=Object.defineProperty,Xr=(t,e,r)=>((t,e,r)=>e in t?Qr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Kr=(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))(Kr||{}),Yr=(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))(Yr||{}),ti=(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))(ti||{}),ei=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(ei||{}),ri=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(ri||{}),ii=(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))(ii||{}),ni=(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))(ni||{});function si(t,e){return-1!==t.indexOf(e)}var ai={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},oi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},ui={};function li(t){if(ui[t])return ui[t];var e=function(t){var e,r,i=null==(r=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in ai?ai[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in oi?oi[t]:void 0,a=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&a)return ui[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var u,l=!1;try{document.body.appendChild(o);var h=o.contentWindow;if(!h)return e.prototype;var d=h[t].prototype;return d?(si(u=navigator.userAgent,"AppleWebKit")&&!si(u,"Chrome")&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),ui[t]=d):r}catch(t){return r}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var hi={};function di(t,e,r){var i,n=t+"."+String(r);if(hi[n])return hi[n].call(e);var s=li(t),a=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return a?(hi[n]=a,a.call(e)):e[r]}var ci={};function vi(t,e,r){var i=t+"."+String(r);if(ci[i])return ci[i].bind(e);var n=li(t)[r];return"function"!=typeof n?e[r]:(ci[i]=n,n.bind(e))}function fi(){return li("MutationObserver").constructor}function pi(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},s=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var r=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},i=t[e],a=r(i);a;){if(a.next===s)return void(a.next=n.next);a=r(i=a.next)}else t[e]=n.next}}catch(t){return()=>{}}}var gi={childNodes:t=>di("Node",t,"childNodes"),parentNode:t=>di("Node",t,"parentNode"),parentElement:t=>di("Node",t,"parentElement"),textContent:t=>di("Node",t,"textContent"),contains:(t,e)=>vi("Node",t,"contains")(e),getRootNode:t=>vi("Node",t,"getRootNode")(),host:t=>t&&"host"in t?di("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?di("Element",t,"shadowRoot"):null,querySelector:(t,e)=>vi("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>vi("Element",t,"querySelectorAll")(e),mutationObserver:fi,patch:pi},mi=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function yi(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var wi=0,bi=6e4;function ki(){wi+=1}function _i(){return wi}function Si(t,e){return e!==wi||t>bi}var Mi=0,Ci=0,Ii=0,Ai=mi(),Ri=null,Ti=null,xi=[],Ei=0,Oi=0,Fi={slowestBatchMs:0},Li={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},Di=t=>t&&t>0?t:null;function Ni(t){(Mi+=1)>1||(Ai=mi(),xi=[],Ei=0,Ti=Di(t),Ci=yi(),Ii=wi)}function Pi(){return 0===Mi?Ri||mi():(Mi-=1)>0?Ai:(Ai.durationMs=yi()-Ci,Ai.deferredStylesheetCount=Ei,Li.deferredCount+=Ei,Ti=null,Si(Ai.durationMs,Ii)?Ai:Ri=Ai)}var Bi=32;function $i(t,e,r){var i=t.length;if(r>=Bi)return i;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)i+=$i(a,e,r+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var u=o.rules||o.cssRules;u&&(i+=$i(u,e,r+1))}}}catch(t){}}return i}function Wi(t){if(0!==Mi){var e=$i(t,null,0);Ai.cssRuleCount+=e,Oi>0&&(Ai.nonDeferrableCssRuleCount+=e)}}function zi(t){Oi+=1;try{return t()}finally{Oi-=1}}function ji(t){Mi>0&&(Ai.stylesheetMs+=t)}function Ui(t){if(0===Mi||null===Ti)return!1;var e=Ai.cssRuleCount-Ai.nonDeferrableCssRuleCount;return e>=Ti||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),$i(e,r,0)}catch(t){return 0}}(t)>Ti}function Hi(){Li.failedCount+=1}function qi(t){t>0&&(Li.abandonedCount+=t)}function Gi(t){return t.nodeType===t.ELEMENT_NODE}function Vi(t){var e=t&&"host"in t&&"mode"in t&&gi.host(t)||null;return Boolean(e&&"shadowRoot"in e&&gi.shadowRoot(e)===t)}function Zi(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Ji(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function Qi(t){var e=t.cssText;if(3>e.split('"').length)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(" ")+";"}var Xi=0;function Ki(t){var e=0===Xi,r=e?yi():0;Xi+=1;try{var i=t.rules||t.cssRules;if(!i)return null;Wi(i);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Ji(Array.from(i,(t=>Yi(t,n))).join(""))}catch(t){return null}finally{Xi-=1,e&&ji(yi()-r)}}function Yi(t,e){var r;if(en(t)){var i;try{i=Ki(t.styleSheet)||Qi(t)}catch(e){i=t.cssText}try{if(i&&(null==(r=t.styleSheet)?void 0:r.href))return yn(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return rn(t)&&t.selectorText.includes(":")&&(n=tn(n)),e?yn(n,e):n}function tn(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function en(t){return"styleSheet"in t}function rn(t){return"selectorText"in t}var nn=/^-?[A-Za-z_][\w-]*$/,sn=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function an(t){var e=[],r=!1,i=null,n=new Map;function s(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}var o=e[e.length-1];return o.parts.push(t),void(o.index+=1)}if(!n.importRule)return r=!0,void(i=t);a(e[e.length-1],n.importRule,t)}function a(t,e,r){var i;try{var n;try{n=r||Qi(e)}catch(t){n=e.cssText}try{n&&(null==(i=e.styleSheet)?void 0:i.href)&&(n=yn(n,e.styleSheet.href))}catch(t){}n&&t.parts.push(n),t.index+=1}catch(t){s(null)}}function o(t){var r=t.rules[t.index];if("sheet"===t.kind&&en(r)){var i=n.get(r);return null===i?(t.parts.push(r.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:r}):void a(t,r,null)}if(!function(t,r){try{var i=function(t){var e,r=t;if(!r.cssRules||0===r.cssRules.length)return null;if(r.media&&"string"==typeof r.media.mediaText)return"@media "+r.media.mediaText+" {";if(rn(t)){if("number"==typeof r.type&&1!==r.type)return null;var i=r.style?r.style.cssText:"";return t.selectorText+" {"+(i?" "+i:"")}if("containerName"in r)return"string"!=typeof r.containerQuery||r.containerName&&!nn.test(r.containerName)?null:"@container "+(r.containerName?r.containerName+" ":"")+r.containerQuery+" {";if("string"==typeof r.conditionText){var n="";try{n=(null==(e=t.constructor)?void 0:e.name)||""}catch(t){return null}return""===n||"Object"===n||"CSSSupportsRule"===n?"@supports "+r.conditionText+" {":null}return"string"==typeof r.name?"keyText"in r.cssRules[0]?nn.test(r.name)?"@keyframes "+r.name+" {":null:""===r.name?"@layer {":sn.test(r.name)?"@layer "+r.name+" {":null:null}(t);if(null===i)return!1;var n=r.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?yn(i,n):i,fixColons:"sheet"===r.kind&&rn(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(r,t)){var s=r.cssText;"sheet"===t.kind&&rn(r)&&r.selectorText.includes(":")&&(s=tn(s)),t.parts.push(t.sheetHref?yn(s,t.sheetHref):s),t.index+=1}}return function(t){try{var r=t.rules||t.cssRules;if(!r)return!1;Wi(r);var i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);var s=Array.from(r);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){for(var r=[{sheet:e,rules:t,index:0}],i=function(){var t=r[r.length-1];if(t.index>=t.rules.length)return r.pop(),0;var e=t.rules[t.index];if(t.index+=1,!en(e)||n.has(e))return 0;var i=null;try{i=e.styleSheet}catch(t){return n.set(e,null),0}if(!i||r.some((t=>t.sheet===i)))return 0;try{var s=i.rules||i.cssRules;if(!s)return 0;Wi(s);var a=i.href;!a&&i.ownerNode&&(a=i.ownerNode.baseURI);var o=Array.from(s);n.set(e,{sheet:i,rules:o,sheetHref:a}),r.push({sheet:i,rules:o,index:0})}catch(t){}};r.length>0;)i()}(s,t),!0}catch(t){return!1}}(t)||(r=!0),{advance(t){if(r)return!0;var n=yi(),a=t>0?t:1;try{for(;!r&&a>0;){var u=e[e.length-1];if(u.rules.length>u.index){a-=1;try{o(u)}catch(t){s(null)}}else{var l=null;try{if("group"===u.kind){var h=u.prelude+u.parts.join("")+"}";l=u.fixColons?tn(h):h}else l=Ji(u.parts.join(""))}catch(t){}s(l)}}}catch(t){r=!0,i=null}finally{ji(yi()-n)}return r},text:()=>r?i:null,remainingRules(){if(r)return 0;var t=0;for(var i of e)t+=i.rules.length-i.index;return t}}}class on{constructor(){Xr(this,"idNodeMap",new Map),Xr(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);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),Gi(t)){var r=gi.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function un(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&ln(n);return(r[i.toLowerCase()]||o&&r[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function ln(t){return t.toLowerCase()}var hn=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function dn(t){var e=t.element,r=t.name,i=t.value,n=t.maskAttributeFn,s=t.isGenerated;return i?t.maskAllElementAttributes?void 0!==s&&s&&hn.has(ln(r))?i:"*".repeat(i.length):n?n(r,i,e):i:i}var cn="__rrweb_original__";function vn(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ln(e):null}catch(t){return null}}var fn=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,pn=/^(?:[a-z+]+:)?\/\//i,gn=/^www\..*/i,mn=/^(data:)([^,]*),(.*)/i;function yn(t,e){return(t||"").replace(fn,((t,r,i,n,s,a)=>{var o,u=i||s||a,l=r||n||"";if(!u)return t;if(pn.test(u)||gn.test(u))return"url("+l+u+l+")";if(mn.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((o=e).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),d=u.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+l+h.join("/")+l+")"}))}var wn,bn,kn="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",_n=4096,Sn=1e5,Mn=10,Cn=new Map,In=1,An=new RegExp("[^a-z0-9-_:]"),Rn=-2;function Tn(){return In++}var xn=/^[^ \t\n\r\u000c]+/,En=/^[, \t\n\r\u000c]+/,On=new WeakMap;function Fn(t,e){return e&&""!==e.trim()?Ln(t,e):e}function Ln(t,e){var r=On.get(t);if(r||(r=t.createElement("a"),On.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function Dn(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?kn:t}(t,e.maxBase64ImageLength):t}function Nn(t,e,r,i,n,s){var a;if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var o=null==(a=n.sheet)?void 0:a.href;if(o)return o}var u=Fn(t,i);if(u.startsWith("data:")){if("img"===e&&n){var l=u;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(l=function(t,e,r,i){if(Sn>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>_n||t.naturalHeight>_n)return e;var n=Cn.get(e);if(n&&n.type===r&&n.quality===i)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(r||"image/webp",null!=i?i:.4),u=e.length>o.length?o:e;if(Cn.size>=Mn){var l=Cn.keys().next().value;void 0!==l&&Cn.delete(l)}return Cn.set(e,{type:r,quality:i,result:u}),u}catch(t){return e}}(n,u,s.type,s.quality)),Dn(l,s)}if("image"===e)return Dn(u,s)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=Fn(t,i);return"image"===e&&h.startsWith("data:")?Dn(h,s):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(En),e.length>r;){var s=i(xn);if(","===s.slice(-1))s=Fn(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Fn(t,s);for(var o=!1;;){var u=e.charAt(r);if(""===u){n.push((s+a).trim());break}if(o)")"===u&&(o=!1);else{if(","===u){r+=1,n.push((s+a).trim());break}"("===u&&(o=!0)}a+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?yn(i,Ln(t)):"object"===e&&"data"===r?Fn(t,i):i:Fn(t,i)}function Pn(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function Bn(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&Bn(gi.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&Bn(gi.parentNode(t),e,r)}function $n(t,e,r,i){var n;if(Gi(t)){if(!gi.childNodes(n=t).length)return!1}else{if(null===gi.parentElement(t))return!1;n=gi.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(Bn(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function Wn(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var zn=new Map;function jn(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Un(t){return null==t?"":t.toLowerCase()}var Hn=50,qn=!1,Gn=!1;function Vn(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,u=e.skipChild,l=void 0!==u&&u,h=e.inlineStylesheet,d=void 0===h||h,c=e.maskInputOptions,v=void 0===c?{}:c,f=e.maskTextFn,p=e.maskInputFn,g=e.maskAllElementAttributes,m=void 0!==g&&g,y=e.maskAttributeFn,w=e.slimDOMOptions,b=e.dataURLOptions,k=void 0===b?{}:b,_=e.inlineImages,S=void 0!==_&&_,M=e.recordCanvas,C=void 0!==M&&M,I=e.canvasMaskingConfigured,A=e.onSerialize,R=e.onIframeLoad,T=e.iframeLoadTimeout,x=void 0===T?5e3:T,E=e.onIframeListenerRegistered,O=e.onStylesheetLoad,F=e.stylesheetLoadTimeout,L=void 0===F?5e3:F,D=e.keepIframeSrcFn,N=void 0===D?()=>!1:D,P=e.newlyAddedElement,B=void 0!==P&&P,W=e.depth,z=void 0===W?0:W,j=e.maxDepth,U=void 0===j?Hn:j,H=e.needsMask,q=e.preserveWhiteSpace,G=void 0===q||q;if(z>=U)return Gn=!0,qn||(qn=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+U+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;H||(H=$n(t,a,o,void 0===H)),Mi>0&&(Ai.nodeCount+=1);var V,Z=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,u=void 0===o?{}:o,l=e.maskTextFn,h=e.maskInputFn,d=e.maskAllElementAttributes,c=void 0!==d&&d,v=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,w=e.keepIframeSrcFn,b=e.newlyAddedElement,k=void 0!==b&&b,_=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:ni.Document,childNodes:[],compatMode:t.compatMode}:{type:ni.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:ni.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:_};case t.ELEMENT_NODE:return function(t,e){for(var r,i,n,s=e.doc,a=e.inlineStylesheet,o=e.maskInputOptions,u=void 0===o?{}:o,l=e.maskInputFn,h=e.maskAllElementAttributes,d=void 0!==h&&h,c=e.maskAttributeFn,v=e.dataURLOptions,f=void 0===v?{}:v,p=e.inlineImages,g=e.recordCanvas,m=e.canvasMaskingConfigured,y=e.keepIframeSrcFn,w=e.newlyAddedElement,b=void 0!==w&&w,k=e.rootId,_=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),S=function(t){if(t instanceof HTMLFormElement)return"form";var e=ln(t.tagName);return An.test(e)?"div":e}(t),M=new Set,C={},I=t.attributes.length,A=0;I>A;A++){var R=t.attributes[A];Pn(S,R.name)||(C[R.name]=Nn(s,S,ln(R.name),R.value,t,f))}if("link"===S&&a&&!_){var T=t.sheet;if(!T){var x=function(t){return t.href}(t);x&&!(T=jn(s,x))&&x.includes(".css")&&(T=jn(s,window.location.origin+"/"+x.replace(window.location.href,"")))}var E=null;T&&(Ui(T)?Mi>0&&(xi.push(t),Ei+=1):E=Ki(T)),E&&(delete C.rel,delete C.href,C._cssText=E)}if("style"===S&&t.sheet&&!(t.innerText||gi.textContent(t)||"").trim().length){var O=zi((()=>Ki(t.sheet)));O&&(C._cssText=O)}if("input"===S||"textarea"===S||"select"===S){var F=t.value,L=t.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&F?C.value=un({element:t,type:vn(t),tagName:S,value:F,maskInputOptions:u,maskInputFn:l}):L&&(C.checked=L)}if("option"===S&&(t.selected&&!u.select?C.selected=!0:delete C.selected),"dialog"===S&&t.open){try{C.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){C.rr_open_mode="modal",C.ph_rr_could_not_detect_modal=!0}M.add("rr_open_mode")}if("canvas"===S&&g&&!(null==m?void 0:m()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((cn in n?n[cn]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(C.rr_dataURL=t.toDataURL(f.type,f.quality));else if(!("__context"in t)){var D=t.toDataURL(f.type,f.quality),N=s.createElement("canvas");N.width=t.width,N.height=t.height,D!==N.toDataURL(f.type,f.quality)&&(C.rr_dataURL=D)}var P,B,W=!1;if("img"===S&&p){wn||(wn=s.createElement("canvas"),bn=wn.getContext("2d"));var z=t,j=z.currentSrc||z.getAttribute("src")||"<unknown-src>",U=z.crossOrigin,H=(e,r)=>W?dn({element:t,name:e,value:r,maskAllElementAttributes:d,maskAttributeFn:c}):r,q=()=>{Wn(z,"load",q);try{wn.width=z.naturalWidth,wn.height=z.naturalHeight,bn.drawImage(z,0,0);var t=wn.toDataURL(f.type,f.quality);C.rr_dataURL=H("rr_dataURL",t)}catch(t){if("anonymous"!==z.crossOrigin)return z.crossOrigin="anonymous",void(z.complete&&0!==z.naturalWidth?q():z.addEventListener("load",q));console.warn("Cannot inline img src="+j+"! Error: "+t)}"anonymous"===z.crossOrigin&&(U?C.crossOrigin=H("crossOrigin",U):z.removeAttribute("crossorigin"))};z.complete&&0!==z.naturalWidth?q():z.addEventListener("load",q)}if("audio"===S||"video"===S){var G=C;G.rr_mediaState=t.paused?"paused":"played",M.add("rr_mediaState"),G.rr_mediaCurrentTime=t.currentTime,G.rr_mediaPlaybackRate=t.playbackRate,G.rr_mediaMuted=t.muted,G.rr_mediaLoop=t.loop,G.rr_mediaVolume=t.volume}if(b||(t.scrollLeft&&(C.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(C.rr_scrollTop=t.scrollTop)),_){var V=t.getBoundingClientRect(),Z=V.width,J=V.height,Q=V.left,X=V.top,K=null==(r=s.defaultView)?void 0:r.getComputedStyle(t);C={class:C.class,rr_width:Z+"px",rr_height:J+"px",rr_left:Math.floor(Q+((null==(i=s.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(X+((null==(n=s.defaultView)?void 0:n.scrollY)||0))+"px"},M.add("rr_width"),M.add("rr_height"),M.add("rr_left"),M.add("rr_top"),K&&(C.rr_position=K.position||"static",M.add("rr_position"),K.transform&&"none"!==K.transform&&(C.rr_transform=K.transform,M.add("rr_transform")),K.display&&K.display.startsWith("inline")&&(C.rr_display=K.display,M.add("rr_display")))}if("iframe"!==S||y(C.src)||(t.contentDocument||(C.rr_src=C.src),delete C.src),d||c)for(var Y of Object.entries(C)){var tt=Y[0],et=Y[1];"string"!=typeof et&&null!==et||(C[tt]=dn({element:t,name:tt,value:et,maskAllElementAttributes:d,maskAttributeFn:c,isGenerated:M.has(tt)}))}W=!0;try{customElements.get(S)&&(P=!0)}catch(t){}return{type:ni.Element,tagName:S,attributes:C,childNodes:[],isSVG:(B=t,Boolean("svg"===B.tagName||B.ownerSVGElement)||void 0),needBlock:_,rootId:k,isCustom:P}}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,maskAllElementAttributes:c,maskAttributeFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:w,newlyAddedElement:k,rootId:_});case t.TEXT_NODE:return function(t,e){var r,i=e.needsMask,n=e.maskTextFn,s=e.rootId,a=gi.parentNode(t),o=a&&a.tagName,u=gi.textContent(t),l="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(l&&u){try{if(t.nextSibling||t.previousSibling);else if(Ui(a.sheet));else if(null==(r=a.sheet)?void 0:r.cssRules){var d=Ki(a.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(u=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=yn(u,Ln(e.doc))}return h&&(u="SCRIPT_PLACEHOLDER"),!l&&!h&&u&&i&&(u=n?n(u,gi.parentElement(t)):u.replace(/[\S]/g,"*")),{type:ni.Text,textContent:u||"",isStyle:l,rootId:s}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:_});case t.CDATA_SECTION_NODE:return{type:ni.CDATA,textContent:"",rootId:_};case t.COMMENT_NODE:return{type:ni.Comment,textContent:gi.textContent(t)||"",rootId:_};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:H,inlineStylesheet:d,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:I,keepIframeSrcFn:N,newlyAddedElement:B});if(!Z)return console.warn(t,"not serialized"),null;V=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===ni.Comment)return!0;if(t.type===ni.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Un(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Un(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Un(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Un(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Un(t.attributes.property).match(/^(og|twitter|fb):/)||Un(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Un(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Un(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(Un(t.attributes.name))||Un(t.attributes.property).match(/^article:/)||Un(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(Un(t.attributes.name)))return!0}}return!1}(Z,w)||!G&&Z.type===ni.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?Rn:Tn();var J=Object.assign(Z,{id:V});if(i.add(t,J),V===Rn)return null;A&&A(t);var Q=!l;if(J.type===ni.Element){Q=Q&&!J.needBlock,delete J.needBlock;var X=gi.shadowRoot(t);X&&Zi(X)&&(J.isShadowHost=!0)}if((J.type===ni.Document||J.type===ni.Element)&&Q){w.headWhitespace&&J.type===ni.Element&&"head"===J.tagName&&(G=!1);var K={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:a,maskTextSelector:o,skipChild:l,inlineStylesheet:d,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:w,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:I,preserveWhiteSpace:G,onSerialize:A,onIframeLoad:R,iframeLoadTimeout:x,onIframeListenerRegistered:E,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:N,depth:z+1,maxDepth:U};if(J.type===ni.Element&&"textarea"===J.tagName&&void 0!==J.attributes.value);else for(var Y of Array.from(gi.childNodes(t))){var tt=Vn(Y,K);tt&&J.childNodes.push(tt)}var et=null;if(Gi(t)&&(et=gi.shadowRoot(t)))for(var rt of Array.from(gi.childNodes(et))){var it=Vn(rt,K);it&&(Zi(et)&&(it.isShadow=!0),J.childNodes.push(it))}}var nt=gi.parentNode(t);if(nt&&Vi(nt)&&Zi(nt)&&(J.isShadow=!0),J.type===ni.Element&&"iframe"===J.tagName){var st=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var a=()=>e();if("complete"!==i){var o=!1,u=null,l=()=>{o||(o=!0,null!==u&&(clearTimeout(u),u=null),Wn(t,"load",h),t.addEventListener("load",a),e())},h=()=>l();return u=setTimeout(l,r),t.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),o?Wn(t,"load",a):(o=!0,Wn(t,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(t){return n}if(d!==c||t.src===c||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",a),()=>{clearTimeout(v),Wn(t,"load",a)}}return t.addEventListener("load",a),()=>{Wn(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&R){var r=Vn(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:w,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:I,preserveWhiteSpace:G,onSerialize:A,onIframeLoad:R,iframeLoadTimeout:x,onIframeListenerRegistered:E,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:N,depth:z+1,maxDepth:U});r&&R(t,r)}}),x);null==E||E(t,st)}return J.type===ni.Element&&"link"===J.tagName&&"stylesheet"===J.attributes.rel&&function(e,u,l){if(!zn.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var c=new AbortController,g=!1,b=()=>{if(!g){g=!0;try{(()=>{if(O){var e=Vn(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:w,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:I,preserveWhiteSpace:G,onSerialize:A,onIframeLoad:R,iframeLoadTimeout:x,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:N,depth:z,maxDepth:U});e&&O(t,e)}})()}finally{zn.delete(e),c.abort()}}},_=setTimeout(b,l);c.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),e.addEventListener("load",b,{signal:c.signal,once:!0}),zn.set(e,c)}}}(t,0,L),J}function Zn(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class Jn{constructor(){Xr(this,"parentElement",null),Xr(this,"parentNode",null),Xr(this,"ownerDocument"),Xr(this,"firstChild",null),Xr(this,"lastChild",null),Xr(this,"previousSibling",null),Xr(this,"nextSibling",null),Xr(this,"ELEMENT_NODE",1),Xr(this,"TEXT_NODE",3),Xr(this,"nodeType"),Xr(this,"nodeName"),Xr(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Jn))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"}}function Qn(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>Xn(r,t,e,i)}function Xn(t,e,r,i){Kn((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))}))}function Kn(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var Yn="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.",ts={map:{},getId(){return console.error(Yn),-1},getNode(){return console.error(Yn),null},removeNodeFromMap(){console.error(Yn)},has(){return console.error(Yn),!1},reset(){console.error(Yn)}};function es(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,a=new Array(s),o=0;s>o;o++)a[o]=arguments[o];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;0>=l||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,a)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,a)}),l))}}function rs(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>rs(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ts=new Proxy(ts,{get(t,e,r){return"map"===e&&console.error(Yn),Reflect.get(t,e,r)}}));var is=Date.now;function ns(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=gi.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=gi.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function ss(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function as(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function os(t){return t?t.nodeType===t.ELEMENT_NODE?t:gi.parentElement(t):null}function us(t,e,r,i){if(!t)return!1;var n=os(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(Bn(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function ls(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===Rn}function hs(t,e){if(Vi(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=gi.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||hs(i,e))}function ds(t){return Boolean(t.changedTouches)}function cs(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function vs(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function fs(t){return!!t&&(t instanceof Jn&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(gi.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(is=()=>(new Date).getTime());class ps{constructor(){Xr(this,"id",1),Xr(this,"styleIDMap",new WeakMap),Xr(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 gs(t){var e,r=null;return"getRootNode"in t&&(null==(e=gi.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&gi.host(gi.getRootNode(t))&&(r=gi.host(gi.getRootNode(t))),r}function ms(t){var e=t.ownerDocument;return!!e&&(gi.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=gs(r);)r=e;return r}(t);return gi.contains(e,r)}(t))}function ys(t){return"__ln"in t}class ws{constructor(){Xr(this,"length",0),Xr(this,"head",null),Xr(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&ys(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&ys(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var bs,ks=(t,e)=>t+"@"+e;class _s{constructor(){Xr(this,"frozen",!1),Xr(this,"locked",!1),Xr(this,"texts",[]),Xr(this,"attributes",[]),Xr(this,"attributeMap",new WeakMap),Xr(this,"generatedAttributes",new WeakMap),Xr(this,"removes",[]),Xr(this,"mapRemoves",[]),Xr(this,"movedMap",{}),Xr(this,"addedSet",new Set),Xr(this,"movedSet",new Set),Xr(this,"droppedSet",new Set),Xr(this,"removesSubTreeCache",new Set),Xr(this,"mutationCb"),Xr(this,"blockClass"),Xr(this,"blockSelector"),Xr(this,"maskTextClass"),Xr(this,"maskTextSelector"),Xr(this,"inlineStylesheet"),Xr(this,"maskInputOptions"),Xr(this,"maskTextFn"),Xr(this,"maskInputFn"),Xr(this,"maskAllElementAttributes"),Xr(this,"maskAttributeFn"),Xr(this,"keepIframeSrcFn"),Xr(this,"recordCanvas"),Xr(this,"canvasMaskingConfigured"),Xr(this,"inlineImages"),Xr(this,"slimDOMOptions"),Xr(this,"dataURLOptions"),Xr(this,"doc"),Xr(this,"mirror"),Xr(this,"iframeManager"),Xr(this,"stylesheetManager"),Xr(this,"shadowDomManager"),Xr(this,"canvasManager"),Xr(this,"processedNodeManager"),Xr(this,"unattachedDoc"),Xr(this,"canvasManagerReleased",!1),Xr(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),Xr(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,r=yi(),i=_i();try{this.processBufferedMutations()}finally{t=yi()-r,e=i,Mi>0||Si(t,null!=e?e:wi)||t>Fi.slowestBatchMs&&(Fi.slowestBatchMs=t)}}})),Xr(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,r=new ws,i=t=>{for(var e=t,r=Rn;r===Rn;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=gi.parentNode(n);if(s&&ms(n)&&"TEXTAREA"!==s.tagName){var a=Vi(s)?this.mirror.getId(gs(n)):this.mirror.getId(s),o=i(n);if(-1===a||-1===o)return r.addNode(n);var u=Vn(n,{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,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{cs(t,this.mirror)&&this.iframeManager.addIframe(t),vs(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),fs(t)&&!us(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(gi.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:a,nextId:o,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Ms(this.removesSubTreeCache,s)&&!this.movedSet.has(gi.parentNode(s))||n(s);for(var a of this.addedSet)Cs(this.droppedSet,a)||Ms(this.removesSubTreeCache,a)?Cs(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var o=null;r.length;){var u=null;if(o){var l=this.mirror.getId(gi.parentNode(o.value)),h=i(o.value);-1!==l&&-1!==h&&(u=o)}if(!u)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(gi.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){u=c;break}var f=gi.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=gi.host(f);if(-1!==this.mirror.getId(p)){u=c;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}o=u.previous,r.removeNode(u.value),n(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=gi.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 e,r=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof r.style){var i=JSON.stringify(t.styleDiff),n=JSON.stringify(t._unchangedStyles);r.style.length>i.length&&(i+n).split("var(").length===r.style.split("var(").length&&(r.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var s of Object.entries(r)){var a=s[0],o=s[1];"string"!=typeof o&&null!==o||(r[a]=dn({element:t.node,name:a,value:o,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(e=this.generatedAttributes.get(t.node))?void 0:e.has(a)}))}return{id:this.mirror.getId(t.node),attributes:r}})).filter((t=>!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.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))})),Xr(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),Xr(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(gi.childNodes(t),(t=>gi.textContent(t)||"")).join("");e.attributes.value=un({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:vn(t),value:r,maskInputFn:this.maskInputFn})})),Xr(this,"processMutation",(t=>{var e;if(!ls(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var r=gi.textContent(t.target);us(t.target,this.blockClass,this.blockSelector,!1)||r===t.oldValue||this.texts.push({value:$n(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,os(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break;case"attributes":var i,n=t.target,s=t.attributeName,a=null!==(i=t.attributeNamespace)&&void 0!==i?i:null,o=function(t,e,r){if(!r)return e;var i=t.getAttributeNodeNS(r,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(r);return n?n+":"+e:e}(n,s,a),u=a?n.getAttributeNS(a,s):t.target.getAttribute(s);if("value"===o){var l=n,h=vn(l);u=un({element:l,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:u,maskInputFn:this.maskInputFn})}if(us(t.target,this.blockClass,this.blockSelector,!1)||u===t.oldValue)return;var d=this.attributeMap.get(t.target),c="IFRAME"===n.tagName&&"src"===o;if(c&&!this.keepIframeSrcFn(u)&&n.contentDocument)return;if(d||(this.attributes.push(d={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,d)),"type"===o&&"INPUT"===n.tagName&&"password"===(t.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Pn(n.tagName,o)){var v=Nn(this.doc,ln(n.tagName),ln(o),u,n,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(u)&&(o="rr_src"),d.attributes[o]=v,null==(e=this.generatedAttributes.get(t.target))||e.delete(o),"style"===o){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=n.style;for(var g of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?d.styleDiff[g]=""===y?m:[m,y]:d._unchangedStyles[g]=[m,y]}for(var w of Array.from(f.style))""===p.getPropertyValue(w)&&(d.styleDiff[w]=!1)}else if("open"===o&&"DIALOG"===n.tagName){d.attributes.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal";var b=this.generatedAttributes.get(t.target);b||this.generatedAttributes.set(t.target,b=new Set),b.add("rr_open_mode")}}break;case"childList":if(us(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),i=Vi(t.target)?this.mirror.getId(gi.host(t.target)):this.mirror.getId(t.target);us(t.target,this.blockClass,this.blockSelector,!1)||ls(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Ss(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||hs(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[ks(r,i)]?Ss(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!Vi(t.target)||!Zi(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),gi.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),Xr(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(ls(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[ks(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);us(t,this.blockClass,this.blockSelector,!1)||(gi.childNodes(t).forEach((t=>this.genAdds(t))),fs(t)&&gi.childNodes(gi.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}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.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function Ss(t,e){for(var r=[e];r.length;){var i=r.pop();t.delete(i),gi.childNodes(i).forEach((t=>r.push(t)))}}function Ms(t,e,r){return 0!==t.size&&function(t,e,r){var i=gi.parentNode(e);return!!i&&t.has(i)}(t,e)}function Cs(t,e){if(0===t.size)return!1;for(var r=gi.parentNode(e);r;){if(t.has(r))return!0;r=gi.parentNode(r)}return!1}var Is=function(t,e){return void 0===e&&(e="rrweb"),bs?function(){try{return t(...arguments)}catch(t){if(bs&&!0===bs(t,e))return;throw t}}:t},As=[];function Rs(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 Ts(t,e){var r,i=new _s;i.init(t);try{r=new(fi())(Is(i.processMutations.bind(i)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),r.observe(e,n),As.push(i),{observer:r,buffer:i}}catch(t){try{null==r||r.disconnect(),i.destroy(),i.reset()}catch(t){}throw t}}function xs(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,u=t=>{var a=Rs(t);if(a&&!us(a,n,s,!0)){var u,l,h=i.getId(a);if(a===r&&r.defaultView){var d=ns(r.defaultView);u=d.left,l=d.top}else u=a.scrollLeft,l=a.scrollTop;var c=u+","+l;o.get(h)!==c&&(o.set(h,c),e({id:h,x:u,y:l}))}},l=[Qn("scroll",Is(es(Is((t=>u(t))),a.scroll||100)),r)];return"onscrollend"in r&&l.push(Qn("scrollend",Is(u),r)),()=>l.forEach((t=>t()))}function Es(t,e){for(var r=As.length-1;r>=0;r--){var i=As[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),As.splice(r,1))}}}var Os=["INPUT","TEXTAREA","SELECT"],Fs=new WeakMap;function Ls(t){return function t(e,r){if($s("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||$s("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||$s("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||$s("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function Ds(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}var Ns=5e3;function Ps(t,e){var r,i,n,s,a=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:gi.host(e));var o="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&u?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var t;return null==(t=u.get)?void 0:t.call(this)},set(t){var e,r;try{r=null==(e=u.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return r}}),Is((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function Bs(t,e){void 0===e&&(e={});var r,i,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,a=t.viewportResizeCb,o=t.inputCb,u=t.mediaInteractionCb,l=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,c=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...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),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var s,a,o,l,h,d,c,v,f=[],p=Is((()=>{if(i){i.destroy(),i.reset();var e=As.indexOf(i);-1!==e&&As.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==r||r.disconnect(),f.forEach((t=>t()))}));try{if(t.recordDOM){var g=Ts(t,t.doc);r=g.observer,i=g.buffer}if(f.push(function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.mirror;if(!1===r.mousemove)return()=>{};var s,a="number"==typeof r.mousemove?r.mousemove:50,o="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=es(Is((t=>{var r=Date.now()-s;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],s=null})),o),h=Is(es(Is((t=>{var e=Rs(t),r=ds(t)?t.changedTouches[0]:t,i=r.clientX,a=r.clientY;s||(s=is()),u.push({x:i,y:a,id:n.getId(e),timeOffset:is()-s}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Yr.Drag:t instanceof MouseEvent?Yr.MouseMove:Yr.TouchMove)})),a,{trailing:!1})),d=[Qn("mousemove",h,i),Qn("touchmove",h,i),Qn("drag",h,i)];return Is((()=>{d.forEach((t=>t()))}))}(t)),f.push(function(t){var e=t.mouseInteractionCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var o=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],h=null;return Object.keys(ti).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==o[t])).forEach((t=>{var a=ln(t),o=(t=>r=>{var a=Rs(r);if(!us(a,n,s,!0)){var o=null,l=t;if("pointerType"in r){switch(r.pointerType){case"mouse":o=ei.Mouse;break;case"touch":o=ei.Touch;break;case"pen":o=ei.Pen}o===ei.Touch&&(ti[t]===ti.MouseDown?l="TouchStart":ti[t]===ti.MouseUp&&(l="TouchEnd"))}else ds(r)&&(o=ei.Touch);null!==o?(h=o,(l.startsWith("Touch")&&o===ei.Touch||l.startsWith("Mouse")&&o===ei.Mouse)&&(o=null)):ti[t]===ti.Click&&(o=h,h=null);var d=ds(r)?r.changedTouches[0]:r;if(d){var c=i.getId(a),v=d.clientX,f=d.clientY;Is(e)(u({type:ti[l],id:c,x:v,y:f},null!==o&&{pointerType:o}))}}})(t);if(window.PointerEvent)switch(ti[t]){case ti.MouseDown:case ti.MouseUp:a=a.replace("mouse","pointer");break;case ti.TouchStart:case ti.TouchEnd:return}l.push(Qn(a,o,r))})),Is((()=>{l.forEach((t=>t()))}))}(t)),f.push(xs(t)),f.push(function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,s=-1;return Qn("resize",Is(es(Is((()=>{var t=ss(),e=as();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:n})),f.push(function(t){var e=t.inputCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.ignoreClass,o=t.ignoreSelector,l=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function c(t){var e=Rs(t),i=t.isTrusted,u=r.defaultView;if(!e||!u||e instanceof u.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=gi.parentElement(e)),e&&c&&Os.indexOf(c)>=0&&!us(e,n,s,!0)&&!(e.classList.contains(a)||o&&e.matches(o))){var f=e.value,p=!1,g=vn(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[c.toLowerCase()]||l[g])&&(f=un({element:e,maskInputOptions:l,tagName:c,type:g,value:f,maskInputFn:h})),v(e,d?{text:f,isChecked:p,userTriggered:i}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&r.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(t,r){var n=Fs.get(t);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){Fs.set(t,r);var s=i.getId(t);Is(e)(u({},r,{id:s}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>Qn(t,Is(c),r))),p=r.defaultView;if(!p)return()=>{f.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((t=>rs(t[0],t[1],{set(){Is(c)({target:this,isTrusted:!1})}},!1,p)))),Is((()=>{f.forEach((t=>t()))}))}(t)),f.push(function(t){var e=t.mediaInteractionCb,r=t.blockClass,i=t.blockSelector,n=t.mirror,s=t.sampling,a=t.doc,o=Is((t=>es(Is((s=>{var a=Rs(s);if(a&&!us(a,r,i,!0)){var o=a.currentTime,u=a.volume,l=a.muted,h=a.playbackRate,d=a.loop;e({type:t,id:n.getId(a),currentTime:o,volume:u,muted:l,playbackRate:h,loop:d})}})),s.media||500))),u=[Qn("play",o(ii.Play),a),Qn("pause",o(ii.Pause),a),Qn("seeked",o(ii.Seeked),a),Qn("volumechange",o(ii.VolumeChange),a),Qn("ratechange",o(ii.RateChange),a)];return Is((()=>{u.forEach((t=>t()))}))}(t)),t.recordDOM){var m=function(t){var e=new Map,r=new Set,i=!0,n=t=>{if(i)try{t()}catch(t){}},s=t=>{var r,i=e.get(t);if(i){for(;null==(r=i[0])?void 0:r.ready;){var s=i.shift();(null==s?void 0:s.emit)&&n(s.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,r){if(t){var i=e.get(t);i?(i.push({emit:r,ready:!0}),s(t)):n(r)}else n(r)},queuePendingMutation(a,o,u){if(!i)return()=>{};var l=e.get(a);l||e.set(a,l=[]);var h={emit:o,ready:!1};l.push(h);var d,c=!1,v=!1,f=()=>{c||v||(c=!0,void 0!==d&&r.delete(d),h.ready=!0,h.emit=void 0,s(a))};try{d=t.setTimeout(f,Ns),c||v?t.clearTimeout(d):r.add(d)}catch(t){f()}return e=>{!v&&i&&(v=!0,void 0!==d&&(t.clearTimeout(d),r.delete(d)),c?e&&n(u):(h.ready=!0,e||(h.emit=void 0),s(a)))}},reset(){i=!1,r.forEach((e=>t.clearTimeout(e))),r.clear(),e.clear()}}}(n);f.push(m.reset),f.push(function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,s=e.win,a=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Is(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=Ds(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>r({id:h,styleId:d,adds:[{rule:o,index:u}]}))),u}),"host")}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var u,l,h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:Is(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=Ds(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>r({id:h,styleId:d,removes:[{index:o}]}))),u}),"host")}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(u=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:Is(((t,e,s)=>{var o=s[0],u=t.apply(e,s);try{var l=null==u?void 0:u.then;if(e.ownerNode||!u||"function"!=typeof l)return u;n.onCssomSheetMutation(e);var h=Ds(e,i,n.styleMirror),d=h.id,c=h.styleId;if(!(d&&-1!==d||c&&-1!==c))return u;var v=a.queuePendingMutation(e,(()=>r({id:d,styleId:c,replace:o})),(()=>{var t=Ki(e);null!==t&&r({id:d,styleId:c,replace:t})}));try{l.call(u,(()=>v(!0)),(()=>v(!1)))}catch(t){v(!1)}}catch(t){}return u}),"host")})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Is(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=Ds(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>r({id:h,styleId:d,replaceSync:o}))),u}),"host")}));var d={};Ws("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(Ws("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),Ws("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),Ws("CSSSupportsRule")&&(d.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(d).forEach((t=>{var e=t[0],s=t[1];c[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Is(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var l=Ds(e.parentStyleSheet,i,n.styleMirror),h=l.id,d=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var c=[...Ls(e),u];a.queueMutation(e.parentStyleSheet,(()=>r({id:h,styleId:d,adds:[{rule:o,index:c}]})))}return u}),"host")}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Is(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var l=Ds(e.parentStyleSheet,i,n.styleMirror),h=l.id,d=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var c=[...Ls(e),o];a.queueMutation(e.parentStyleSheet,(()=>r({id:h,styleId:d,removes:[{index:c}]})))}return u}),"host")})})),Is((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=h,u&&(s.CSSStyleSheet.prototype.replace=u),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(d).forEach((t=>{var e=t[0],r=t[1];r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n,mutationQueue:m})),f.push(Ps(t,t.doc)),f.push(function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=e.mutationQueue,u=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:Is(((t,e,a)=>{var u,l=a[0],h=a[1],d=a[2],c=t.apply(e,a);if(n.has(l))return c;var v=null==(u=e.parentRule)?void 0:u.parentStyleSheet;s.onCssomSheetMutation(v);var f=Ds(v,i,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=Ls(e.parentRule);o.queueMutation(v,(()=>r({id:p,styleId:g,set:{property:l,value:h,priority:d},index:m})))}return c}),"host")});var l=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Is(((t,e,a)=>{var u,l=a[0],h=t.apply(e,a);if(n.has(l))return h;var d=null==(u=e.parentRule)?void 0:u.parentStyleSheet;s.onCssomSheetMutation(d);var c=Ds(d,i,s.styleMirror),v=c.id,f=c.styleId;if(v&&-1!==v||f&&-1!==f){var p=Ls(e.parentRule);o.queueMutation(d,(()=>r({id:v,styleId:f,remove:{property:l},index:p})))}return h}),"host")}),Is((()=>{a.CSSStyleDeclaration.prototype.setProperty=u,a.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:n,mutationQueue:m})),t.collectFonts&&f.push(function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,a=i.FontFace;i.FontFace=function(t,e,r){var i=new a(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var o=pi(r.fonts,"add",(function(t){return function(r){return setTimeout(Is((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=a})),n.push(o),Is((()=>{n.forEach((t=>t()))}))}(t))}for(var y of(f.push((a=(s=t).doc,o=s.mirror,l=s.blockClass,h=s.blockSelector,d=s.selectionCb,c=!0,(v=Is((()=>{var t=a.getSelection();if(!(!t||c&&(null==t?void 0:t.isCollapsed))){c=t.isCollapsed||!1;for(var e=[],r=t.rangeCount||0,i=0;r>i;i++){var n=t.getRangeAt(i),s=n.startContainer,u=n.startOffset,v=n.endContainer,f=n.endOffset;us(s,l,h,!0)||us(v,l,h,!0)||e.push({start:o.getId(s),startOffset:u,end:o.getId(v),endOffset:f})}d({ranges:e})}})))(),Qn("selectionchange",v))),f.push(function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?pi(r.customElements,"define",(function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}})):()=>{}}(t)),t.plugins))f.push(y.observer(y.callback,n,y.options))}catch(t){try{p()}catch(t){}throw t}return p}function $s(t){return void 0!==window[t]}function Ws(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class zs{constructor(t){Xr(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Xr(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){if(0>e)return e;var n=r||this.getRemoteIdToLocalIdMap(t),s=i||this.getLocalIdToRemoteIdMap(t),a=n.get(e);return void 0===a&&(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}getIds(t,e){var r=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i;return"number"!=typeof e||0>e?e:null!==(i=(r||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){var r=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}}class js{constructor(t){Xr(this,"iframes",new WeakMap),Xr(this,"crossOriginIframeMap",new WeakMap),Xr(this,"crossOriginIframeMirror",new zs(Tn)),Xr(this,"crossOriginIframeStyleMirror"),Xr(this,"crossOriginIframeRootIdMap",new WeakMap),Xr(this,"mirror"),Xr(this,"mutationCb"),Xr(this,"wrappedEmit"),Xr(this,"loadListener"),Xr(this,"pageHideListener"),Xr(this,"stylesheetManager"),Xr(this,"recordCrossOriginIframes"),Xr(this,"messageHandler"),Xr(this,"nestedIframeListeners",new Map),Xr(this,"attachedWindows",new WeakMap),Xr(this,"attachedDocuments",new WeakMap),Xr(this,"attachedIframes",new Map),Xr(this,"loadListenerDisposers",new WeakMap),Xr(this,"iframeElementsById",new Map),Xr(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new zs(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null==(i=this.attachedIframes.get(t))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>Kn(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{Xn(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var a=this.handleMessage.bind(this);Kn((()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}Kn((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),null==(r=this.loadListener)||r.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 i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case Kr.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:Kr.IncrementalSnapshot,data:{source:Yr.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Kr.Meta:case Kr.Load:case Kr.DomContentLoaded:return!1;case Kr.Plugin:return e;case Kr.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Kr.IncrementalSnapshot:switch(e.data.source){case Yr.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 Yr.Drag:case Yr.TouchMove:case Yr.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Yr.ViewportResize:return!1;case Yr.MediaInteraction:case Yr.MouseInteraction:case Yr.Scroll:case Yr.CanvasMutation:case Yr.Input:return this.replaceIds(e.data,t,["id"]),e;case Yr.StyleSheetRule:case Yr.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Yr.Font:return e;case Yr.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Yr.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,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));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===ni.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(Xn(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(Xn(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var s=this.attachedDocuments.get(r);s&&(s.forEach((t=>{Kn((()=>this.mirror.removeNodeFromMap(t)))})),Kn((()=>Es(r,s))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&Xn(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{Xn(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class Us{constructor(t){Xr(this,"shadowDoms",new WeakSet),Xr(this,"mutationCb"),Xr(this,"scrollCb"),Xr(this,"bypassOptions"),Xr(this,"mirror"),Xr(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){var r,i;if(Zi(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(r=null==(i=gi.host(t))?void 0:i.ownerDocument)&&void 0!==r?r:e,s=Ts(u({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=s.observer,o=s.buffer;this.restoreHandlers.push({doc:n,handler(){a.disconnect(),o.destroy(),o.releaseCanvasManager();var t=As.indexOf(o);-1!==t&&As.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:xs(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(gi.host(t))),this.restoreHandlers.push({doc:n,handler:Ps({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({doc:e,handler:pi(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=gi.shadowRoot(this);return s&&ms(this)&&r.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}}var Hs="skip-frame";function qs(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var Gs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vs="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Zs=0;64>Zs;Zs++)Vs[Gs.charCodeAt(Zs)]=Zs;var Js=new Map,Qs=(t,e,r)=>{if(t&&(Ys(t,e)||"object"==typeof t)){var i=function(t,e){var r=Js.get(t);return r||Js.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function Xs(t,e,r,i){if(t instanceof Array)return t.map((t=>Xs(t,e,r,i)));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){var n=t.constructor.name,s=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=Gs[r[e]>>2],n+=Gs[(3&r[e])<<4|r[e+1]>>4],n+=Gs[(15&r[e+1])<<2|r[e+2]>>6],n+=Gs[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[Xs(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Xs(t.data,e,r,i),t.width,t.height]}:Ys(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Qs(t,e,r)}:t}var Ks=(t,e,r,i)=>t.map((t=>Xs(t,e,r,i))),Ys=(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])))},ta=["webgl","webgl2"];function ea(t){return"nodeType"in t}function ra(t,e,r,i){var n=[];try{if(i){var s=function(t,e,r){var i=t.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return pi(i.prototype,"configure",(function(i){return function(n){var s=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!s||ea(s)&&us(s,e,r,!0))return i.call(this,n);ea(s)&&!("__context"in s)&&(s.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return i.call(this,null!==a&&n?u({},n,{usage:"number"==typeof n.usage?n.usage|a:a}):n)}}))}(t,e,r);s&&n.push(s)}var a=pi(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),a=arguments.length,o=new Array(a>1?a-1:0),u=1;a>u;u++)o[u-1]=arguments[u];if(!us(this,e,r,!0)&&("__context"in this||(this.__context=s),i&&ta.includes(s)))if(o[0]&&"object"==typeof o[0]){var l=o[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...o])}}));n.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function ia(t,e,r,i,n,s,a){var o=[],u=Object.getOwnPropertyNames(t),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof t[u])return 0;var l=pi(t,u,(function(t){return function(){for(var o=arguments.length,l=new Array(o),h=0;o>h;h++)l[h]=arguments[h];var d=t.apply(this,l);if(Qs(d,s,this),this.canvas&&"tagName"in this.canvas&&!us(this.canvas,i,n,!0)){var c=Ks(l,s,this,a);r(this.canvas,{type:e,property:u,args:c})}return d}}));o.push(l)}catch(s){var h=rs(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!us(this.canvas,i,n,!0)&&r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});o.push(h)}};for(var h of u)l(h);return o}var na,sa,aa,oa='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',ua="undefined"!=typeof self&&self.Blob&&new Blob([oa],{type:"text/javascript;charset=utf-8"});function la(t){var e;try{if(!(e=ua&&(self.URL||self.webkitURL).createObjectURL(ua)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(oa),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class ha{constructor(t){Xr(this,"pendingCanvasMutations",new Map),Xr(this,"rafStamps",{latestId:0,invokeId:null}),Xr(this,"mirror"),Xr(this,"mutationCb"),Xr(this,"resetObservers"),Xr(this,"frozen",!1),Xr(this,"locked",!1),Xr(this,"rafIdTimestamp",null),Xr(this,"rafIdFlush",null),Xr(this,"refCount",0),Xr(this,"torndown",!1),Xr(this,"resetFrameDedup",null),Xr(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 e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,s=t.blockSelector,a=t.recordCanvas,o=t.dataURLOptions,u=t.resolutionScale,l=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===r&&this.initCanvasMutationObserver(i,n,s,o),a&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:o,resolutionScale:u,canvasMasking:l})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,e,r,i,n){var s=this;if("OffscreenCanvas"in e){var a,u="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,l=ra(e,r,i,!0),h=new Map;try{a=new la}catch(t){return}var d=!1;a.onerror=()=>{var t;d=!0,cancelAnimationFrame(c),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:ri["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var c,v=1e3/t,f=0,p=t=>{var l,g;d||(f&&v>t-f||(f=t,(l=[],g=t=>{try{t.querySelectorAll("canvas").forEach((t=>{us(t,r,i,!0)||l.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&g(t.shadowRoot)}))}catch(t){}},g(e.document),l).forEach(function(){var t=o((function*(t){var e,r,i=s.mirror.getId(t);if(!h.get(i)&&0!==t.width&&0!==t.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(t.__context)){var o=t.getContext(t.__context);if(null==(e=null==o?void 0:o.isContextLost)?void 0:e.call(o))return void h.set(i,!1);!1===(null==(r=null==o?void 0:o.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&o.clear(o.COLOR_BUFFER_BIT)}var l=t.clientWidth||t.width,d=t.clientHeight||t.height,c=Math.max(1,Math.round(l*u)),v=Math.max(1,Math.round(d*u)),f=function(t,e,r,i,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return Hs}if(void 0!==a){if(!Array.isArray(a)||!a.every(qs))return Hs;var o=r/n,u=i/s;return a.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*o),r=Math.floor(t.y*u);return{x:e,y:r,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*u)-r}}))}}}(n.canvasMasking,t,c,v,l,d);if(f===Hs)return void h.set(i,!1);var p=yield createImageBitmap(t,1>u?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});a.postMessage({id:i,bitmap:p,width:c,height:v,displayWidth:l,displayHeight:d,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(i,!1)}}}));return function(e){return t.apply(this,arguments)}}())),c=requestAnimationFrame(p))};c=requestAnimationFrame(p),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(c),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ra(t,e,r,!1),s=function(t,e,r,i,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var o=pi(e.CanvasRenderingContext2D.prototype,a,(function(s){return function(){for(var o=arguments.length,u=new Array(o),l=0;o>l;l++)u[l]=arguments[l];return us(this.canvas,r,i,!0)||setTimeout((()=>{var r=Ks(u,e,this,n);t(this.canvas,{type:ri["2D"],property:a,args:r})}),0),s.apply(this,u)}}));s.push(o)}catch(n){var u=rs(e.CanvasRenderingContext2D.prototype,a,{set(e){us(this.canvas,r,i,!0)||t(this.canvas,{type:ri["2D"],property:a,args:[e],setter:!0})}});s.push(u)}};for(var u of a)o(u);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),a=function(t,e,r,i,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...ia(e.WebGLRenderingContext.prototype,ri.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...ia(e.WebGL2RenderingContext.prototype,ri.WebGL2,t,r,i,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),s(),a()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var i=r.map((t=>function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}(t,Jr)));this.mutationCb({id:e,type:r[0].type,commands:i}),this.pendingCanvasMutations.delete(t)}}}}class da{constructor(t){var e;Xr(this,"trackedLinkElements",new WeakSet),Xr(this,"pendingDeferredSheets",new Set),Xr(this,"mutationCb"),Xr(this,"adoptedStyleSheetCb"),Xr(this,"maskAllElementAttributes"),Xr(this,"maskAttributeFn"),Xr(this,"styleMirror",new ps),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var r=null,i=null;try{(i=t.sheet)&&(r=an(i))}catch(t){}if(!r||!i)return Hi(),null;var n=r,s=!1,a={sheet:i,invalidate(){s=!0}};this.pendingDeferredSheets.add(a);var o=!1;return{advance:r=>{if(o)return!0;var u,l,h=yi(),d=_i(),c=!0;try{if(s)return o=!0,Hi(),!0;if(!n.advance(r))return c=!1,!1;o=!0;var v=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==i?(Hi(),!0):v?(this.emitCssTextMutation(t,e,v),!0):(Hi(),!0)}finally{c&&this.pendingDeferredSheets.delete(a),Si(u=yi()-h,null!=(l=d)?l:wi)||(Li.totalMs+=u,u>Li.slowestSliceMs&&(Li.slowestSliceMs=u))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(a)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var r;null==(r=this.beginDeferredLinkInlining(t,e))||r.advance(1/0)}emitCssTextMutation(t,e,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:dn({element:t,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;if(r.styleMirror.has(t))e=r.styleMirror.getId(t);else{var s=r.styleMirror.add(t);e=s;var a=yi();try{zi((()=>{try{var e=t.rules||t.cssRules;e&&Wi(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:Yi(e,t.href),index:r})))})}))}finally{ji(yi()-a)}}i.styleIds.push(e)};for(var a of t)s(a);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),zn.forEach((t=>t.abort())),zn.clear()}trackStylesheetInLinkElement(t){}}class ca{constructor(){Xr(this,"nodeMap",new WeakMap),Xr(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 va=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var fa=document.createElement("iframe");document.body.appendChild(fa),Array.from=(null==(Zr=fa.contentWindow)?void 0:Zr.Array.from)||Array.from,document.body.removeChild(fa)}}catch(t){console.debug("Unable to override Array.from",t)}var pa=new on,ga=new Set([Yr.Mutation,Yr.MediaInteraction,Yr.StyleSheetRule,Yr.CanvasMutation,Yr.Font,Yr.Log,Yr.StyleDeclaration,Yr.AdoptedStyleSheet]);function ma(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null==(t=e.cancelIdleCallback)?void 0:t.call(e,r)}}}var i=setTimeout(t,250);return{cancel:()=>clearTimeout(i)}}function ya(t){var e;void 0===t&&(t={});var r=t,i=r.emit,n=r.checkoutEveryNms,s=r.checkoutEveryNth,a=r.blockClass,o=void 0===a?"rr-block":a,l=r.blockSelector,h=void 0===l?null:l,d=r.ignoreClass,c=void 0===d?"rr-ignore":d,v=r.ignoreSelector,f=void 0===v?null:v,p=r.maskTextClass,g=void 0===p?"rr-mask":p,m=r.maskTextSelector,y=void 0===m?null:m,w=r.inlineStylesheet,b=void 0===w||w,k=r.inlineStylesheetBudgetRules,_=r.maskAllInputs,S=r.maskInputOptions,M=r.slimDOMOptions,C=r.maskInputFn,I=r.maskTextFn,A=r.maskAllElementAttributes,R=void 0!==A&&A,T=r.maskAttributeFn,x=r.hooks,E=r.packFn,O=r.sampling,F=void 0===O?{}:O,L=r.dataURLOptions,D=void 0===L?{}:L,N=r.canvasResolutionScale,P=r.canvasMasking,B=r.mousemoveWait,W=r.recordDOM,z=void 0===W||W,j=r.recordCanvas,U=void 0!==j&&j,H=r.recordCrossOriginIframes,q=void 0!==H&&H,G=r.recordAfter,V=void 0===G?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":G,Z=r.userTriggeredOnInput,J=void 0!==Z&&Z,Q=r.collectFonts,X=void 0!==Q&&Q,K=r.inlineImages,Y=void 0!==K&&K,tt=r.plugins,et=r.keepIframeSrcFn,rt=void 0===et?()=>!1:et,it=r.ignoreCSSAttributes,nt=void 0===it?new Set([]):it,st=r.attributeFilter;bs=r.errorHandler;var at=u({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},D),ot=!q||window.parent===window,ut=!1;if(!ot)try{window.parent.document&&(ut=!1)}catch(t){ut=!0}if(ot&&!i)throw new Error("emit function is required");if(!ot&&!ut)return()=>{};void 0!==B&&void 0===F.mousemove&&(F.mousemove=B),pa.reset();var lt,ht=!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==S?S:{password:!0},dt=Zn(void 0!==M&&M);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var ct,vt,ft=0,pt=new Map,gt=t=>{for(var e of tt||[])e.eventProcessor&&(t=e.eventProcessor(t));return E&&!ut&&(t=E(t)),t};na=(t,e)=>{var r,a=t;if(a.timestamp=is(),!(null==(r=As[0])?void 0:r.isFrozen())||a.type===Kr.FullSnapshot||a.type===Kr.IncrementalSnapshot&&ga.has(a.data.source)||As.forEach((t=>t.unfreeze())),ot)null==i||i(gt(a),e);else if(ut){var o={type:"rrweb",event:gt(a),origin:window.location.origin,isCheckout:e};window.parent.postMessage(o,"*")}if(a.type===Kr.FullSnapshot)lt=a,ft=0;else if(a.type===Kr.IncrementalSnapshot){if(a.data.source===Yr.Mutation&&a.data.isAttachIframe)return;ft++,(s&&ft>=s||n&&a.timestamp-lt.timestamp>n)&&sa(!0)}};var mt=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,r=new Set;if(t.adds.length>0)for(var i of t.adds){var n=pa.getNode(i.node.id);n&&"IFRAME"===n.nodeName&&r.add(n)}t.removes.forEach((t=>{var i=t.id;if(!e||!e.has(i)){var n=kt.getIframeElementById(i);n&&r.has(n)?kt.forgetIframeId(i):(null==ct||ct(i),kt.removeIframeById(i))}})),null==vt||vt(),kt.cleanupDetachedIframes()}na({type:Kr.IncrementalSnapshot,data:u({source:Yr.Mutation},t)})},yt=t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.Scroll},t)}),wt=t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.CanvasMutation},t)}),bt=new da({mutationCb:mt,adoptedStyleSheetCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.AdoptedStyleSheet},t)}),maskAllElementAttributes:R,maskAttributeFn:T}),kt=new js({mirror:pa,mutationCb:mt,stylesheetManager:bt,recordCrossOriginIframes:q,wrappedEmit:na});for(var _t of tt||[])_t.getMirror&&_t.getMirror({nodeMirror:pa,crossOriginIframeMirror:kt.crossOriginIframeMirror,crossOriginIframeStyleMirror:kt.crossOriginIframeStyleMirror});var St=new ca,Mt=null==P?void 0:P.configured;aa=new ha({recordCanvas:U,mutationCb:wt,win:window,blockClass:o,blockSelector:h,mirror:pa,sampling:F.canvas,dataURLOptions:at,resolutionScale:N,canvasMasking:P});var Ct=new Us({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:o,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskInputOptions:ht,dataURLOptions:at,maskTextFn:I,maskInputFn:C,maskAllElementAttributes:R,maskAttributeFn:T,recordCanvas:U,canvasMaskingConfigured:Mt,inlineImages:Y,sampling:F,slimDOMOptions:dt,iframeManager:kt,stylesheetManager:bt,canvasManager:aa,keepIframeSrcFn:rt,processedNodeManager:St,attributeFilter:st},mirror:pa});sa=function(t){if(void 0===t&&(t=!1),z){Ni(k);try{na({type:Kr.Meta,data:{href:window.location.href,width:as(),height:ss()}},t),null==e||e.cancel(),e=void 0,bt.reset(),Ct.init(),As.forEach((t=>t.lock()));var r,i=null;try{i=function(t,e){var r=e||{},i=r.mirror,n=void 0===i?new on:i,s=r.blockClass,a=void 0===s?"rr-block":s,o=r.blockSelector,u=void 0===o?null:o,l=r.maskTextClass,h=void 0===l?"rr-mask":l,d=r.maskTextSelector,c=void 0===d?null:d,v=r.inlineStylesheet,f=void 0===v||v,p=r.inlineImages,g=void 0!==p&&p,m=r.recordCanvas,y=void 0!==m&&m,w=r.canvasMaskingConfigured,b=r.maskAllInputs,k=void 0!==b&&b,_=r.maskTextFn,S=r.maskInputFn,M=r.maskAllElementAttributes,C=void 0!==M&&M,I=r.maskAttributeFn,A=r.slimDOM,R=r.dataURLOptions,T=r.preserveWhiteSpace,x=r.onSerialize,E=r.onIframeLoad,O=r.iframeLoadTimeout,F=r.onIframeListenerRegistered,L=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,N=r.keepIframeSrcFn,P=void 0===N?()=>!1:N,B=r.maxDepth,W=r.inlineStylesheetBudgetRules,z=!0===k?{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===k?{password:!0}:k,j=Zn(void 0!==A&&A);Ni(W);try{return Vn(t,{doc:t,mirror:n,blockClass:a,blockSelector:u,maskTextClass:h,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:z,maskTextFn:_,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:I,slimDOMOptions:j,dataURLOptions:R,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:w,preserveWhiteSpace:T,onSerialize:x,onIframeLoad:E,iframeLoadTimeout:O,onIframeListenerRegistered:F,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:P,newlyAddedElement:!1,maxDepth:B})}finally{Pi()}}(document,{mirror:pa,blockClass:o,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskAllInputs:ht,inlineStylesheetBudgetRules:k,maskTextFn:I,maskInputFn:C,maskAllElementAttributes:R,maskAttributeFn:T,slimDOM:dt,dataURLOptions:at,recordCanvas:U,canvasMaskingConfigured:Mt,inlineImages:Y,onSerialize(t){cs(t,pa)&&kt.addIframe(t),vs(t,pa)&&bt.trackLinkElement(t),fs(t)&&Ct.addShadowRoot(gi.shadowRoot(t),document)},onIframeLoad(t,e){kt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){kt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){bt.attachLinkElement(t,e)},keepIframeSrcFn:rt})}finally{s=xi,xi=[],r=s}if(!i)return console.warn("Failed to snapshot the document");if(na({type:Kr.FullSnapshot,data:{node:i,initialOffset:ns(window)}},t),As.forEach((t=>t.unlock())),aa.onFullSnapshot(),r.length){var n=function(t,e,r){var i=!1,n=null,s=0,a=null,o=()=>null!==a||t.length>s,u=()=>{var r=t[s];t[s]=null,s+=1,r&&Kn((()=>{a=e.beginDeferredLinkInlining(r,pa.getId(r))}))},l=()=>{if(a){var t=a,e=!0;Kn((()=>{e=t.advance(200)})),e&&(a=null)}},h=t=>{if(n=null,!i){var e=0;do{try{a||u(),l()}catch(t){null==a||a.discard(),a=null,qi(1)}e+=1}while(!i&&o()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(o()?n=ma(h):r())}};return n=ma(h),{cancel(){i=!0,null==a||a.discard(),a=null,null==n||n.cancel(),n=null},flush(){if(!i){i=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;o()&&50>e;){a||u();var d=a;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),a=null,h+=1;else{try{l()}catch(t){null==a||a.discard(),a=null,h+=1}e+=1}}if(o()||h>0){for(var c=h+(null!==a?1:0),v=s;t.length>v;v++)null!==t[v]&&(c+=1);qi(c),null==a||a.discard(),a=null}r()}}}}(r,bt,(()=>{e===n&&(e=void 0)}));e=n}q&&kt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&bt.adoptStyleSheets(document.adoptedStyleSheets,pa.getId(document))}finally{Pi()}var s}};try{var It=[];for(var At of(It.push(Qn("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))It.push(Qn(At,ki,document));ct=t=>{var e=pt.get(t);e&&(e.forEach((t=>{Kn(t);var e=It.indexOf(t);-1!==e&&It.splice(e,1)})),pt.delete(t))},vt=()=>{for(var t of pt){var e=t[0],r=pa.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==ct||ct(e)}catch(t){null==ct||ct(e)}else null==ct||ct(e)}};var Rt=t=>{var e;return Is(Bs)({mutationCb:mt,mousemoveCb:(t,e)=>na({type:Kr.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.ViewportResize},t)}),inputCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.Input},t)}),mediaInteractionCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.MediaInteraction},t)}),styleSheetRuleCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.StyleSheetRule},t)}),styleDeclarationCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.StyleDeclaration},t)}),canvasMutationCb:wt,fontCb:t=>na({type:Kr.IncrementalSnapshot,data:u({source:Yr.Font},t)}),selectionCb(t){na({type:Kr.IncrementalSnapshot,data:u({source:Yr.Selection},t)})},customElementCb(t){na({type:Kr.IncrementalSnapshot,data:u({source:Yr.CustomElement},t)})},blockClass:o,ignoreClass:c,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:b,sampling:F,recordDOM:z,recordCanvas:U,canvasMaskingConfigured:Mt,inlineImages:Y,userTriggeredOnInput:J,collectFonts:X,doc:t,maskInputFn:C,maskTextFn:I,maskAllElementAttributes:R,maskAttributeFn:T,keepIframeSrcFn:rt,blockSelector:h,slimDOMOptions:dt,dataURLOptions:at,mirror:pa,iframeManager:kt,stylesheetManager:bt,shadowDomManager:Ct,processedNodeManager:St,canvasManager:aa,ignoreCSSAttributes:nt,attributeFilter:st,plugins:(null==(e=null==tt?void 0:tt.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>na({type:Kr.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},x)};kt.addLoadListener((t=>{try{var e=pa.getId(t),r=Rt(t.contentDocument);if("function"==typeof r&&(It.push(r),-1!==e)){var i=pt.get(e);i||pt.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),kt.addPageHideListener((t=>{var e=pa.getId(t);null==ct||ct(e),Es(t)}));var Tt=-1,xt=t=>na({type:Kr.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Et=()=>{var t,e,r,i,n=document,s=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,a=s?pa.getId(s):-1;a!==Tt&&(-1!==Tt&&xt({id:Tt,enter:!1}),Tt=a,-1!==a&&xt({id:a,enter:!0}))},Ot=()=>{sa();var t=Rt(document);"function"==typeof t&&It.push(t),It.push(Qn("fullscreenchange",Et)),It.push(Qn("webkitfullscreenchange",Et)),It.push(Qn("mozfullscreenchange",Et)),It.push(Qn("MSFullscreenChange",Et)),va=!0};return["interactive","complete"].includes(document.readyState)?Ot():(It.push(Qn("DOMContentLoaded",(()=>{na({type:Kr.DomContentLoaded,data:{}}),"DOMContentLoaded"===V&&Ot()}))),It.push(Qn("load",(()=>{na({type:Kr.Load,data:{}}),"load"===V&&Ot()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,It.forEach((t=>Kn(t))),St.destroy(),kt.removeLoadListener(),kt.destroy(),pt.clear(),Ct.reset(),pa.reset(),va=!1,bs=void 0}}catch(t){console.warn(t)}}ya.addCustomEvent=(t,e)=>{if(!va)throw new Error("please add custom event after start recording");na({type:Kr.Custom,data:{tag:t,payload:e}})},ya.freezePage=()=>{As.forEach((t=>t.freeze()))},ya.takeFullSnapshot=t=>{if(!va)throw new Error("please take full snapshot after start recording");sa(t)},ya.mirror=pa;var wa=Object.defineProperty,ba=(t,e,r)=>((t,e,r)=>e in t?wa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class ka{constructor(t){ba(this,"fileName"),ba(this,"functionName"),ba(this,"lineNumber"),ba(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 _a=/(^|@)\S+:\d+/,Sa=/^\s*at .*(\S+:\d+|\(native\))/m,Ma=/^(eval@)?(\[native code])?$/,Ca={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Sa)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(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(t){return t.stack.split("\n").filter((function(t){return!!t.match(Sa)}),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+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new ka({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Ma)}),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 ka({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new ka({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(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(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var a=e.exec(r[n]);a&&i.push(new ka({fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var a=e.exec(r[n]);a&&i.push(new ka({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(_a)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new ka({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Ia(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var a=i.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===r&&n.push(a)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Aa(t){return Array.isArray(t)}function Ra(t){return"object"==typeof t&&null!==t&&!Aa(t)}function Ta(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Ra(t[i])&&Ta(t[i],e-1))return!0;return!1}function xa(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Ra(a=e)&&Object.keys(a).length>r.numOfKeysLimit||"function"==typeof a||Ra(a)&&Ta(a,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var u in e){var l=e[u];o[u]=Aa(l)?Ia(l.length?l[0]:null):l}return o}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 Ea={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 Oa(t,e,r){var i,n=r?Object.assign({},Ea,r):Ea,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var a=0,o=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message,i=Ca.parse(e.error).map((t=>t.toString())),s=[xa(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[xa("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[xa("Uncaught (in promise)",n.stringifyOptions),xa(e.reason,n.stringifyOptions)]);var s=Ca.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)u.push(c(i,d));return()=>{u.forEach((t=>t()))};function c(e,r){var i=this;return e[r]?function(e,s,u){try{if(!(s in e))return()=>{};var l=e[s],h={next:l},d=(e=>function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||o)){o=!0;try{var h=Ca.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((t=>xa(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:r,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[xa("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{o=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=e[s],i=t(r);i;){if(i.next===d)return void(i.next=h.next);i=t(r=i.next)}else e[s]=h.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var Fa=t=>({name:"rrweb/console@1",observer:Oa,options:t}),La=t=>"undefined"!=typeof Document&&t instanceof Document,Da=()=>{},Na=t=>{var e;if(g(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Pa(t,e,r){try{if(!(e in t))return Da;var i={next:t[e]},n=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return g(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e],s=Na(r);s;){if(s.next===n)return void(s.next=i.next);s=Na(r=s.next)}else t[e]=i.next}}catch(t){return Da}}function Ba(t,e){var r,i=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),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}var $a=N("[Recorder]"),Wa=t=>"navigation"===t.entryType,za=t=>"resource"===t.entryType;function ja(t,e){return!!e&&(S(e)||e[t])}function Ua(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var Ha=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function qa(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Ua(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(Ha))return!1;if(S(r))return!0;if(p(r))return n(r);var s=r[e];return S(s)?s:n(s)}function Ga(t,e,r,i,n,s){return Va.apply(this,arguments)}function Va(){return Va=o((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return $a.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var a=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(za(a=t[s])&&a.initiatorType===e&&(y(i)||a.startTime>=i)&&(y(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(r));return a||(yield new Promise((t=>setTimeout(t,50*s))),Ga(t,e,r,i,n,s+1))})),Va.apply(this,arguments)}function Za(t){var e=t.body,r=t.options,i=t.url;if(k(e))return null;var n=Ba(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(w(e))return e;if(La(e))return e.textContent;if(M(e))return j(e);if(m(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 Ja=t=>!b(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Qa(t){var e=t.entry,r=t.method,i=t.status,n=t.networkRequest,s=t.isInitial,a=t.start,o=t.end,l=t.url,h=t.initiatorType;a=e?e.startTime:a,o=e?e.responseEnd:o;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(a||0)),v=[u({},e?e.toJSON():{name:l},{startTime:y(a)?void 0:Math.round(a),endTime:y(o)?void 0:Math.round(o),timeOrigin:d,timestamp:c,method:r,initiatorType:h||(e?e.initiatorType:void 0),status:i,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:s})];if(Ja(e))for(var f of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Xa=["video/","audio/"];function Ka(t){return m(t)&&g(t.getReader)&&g(t.tee)}var Ya=500,to="[SessionReplay] Timeout while trying to read body",eo="[SessionReplay] Failed to read body";function ro(t){return eo+": "+t}function io(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function no(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(to)),Ya);try{t.clone().text().then((t=>e(t)),(t=>e(ro(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e(eo)}}))}(t);var r=Y(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(io(r)):function(t,e){return new Promise((r=>{var i,n=!1;function s(){try{var t;null==(t=i)||t.cancel()}catch(t){}}function a(t){n||(n=!0,clearTimeout(u),s(),r(t))}var o,u=setTimeout((()=>a(to)),Ya);try{o=t.clone()}catch(t){return void a(eo)}var l=o.body;if(Ka(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(t){return void a(eo)}var h=[],d=0;!function t(){i.read().then((r=>{var i=r.done,o=r.value;if(n)s();else if(i)a((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(o){if(d+o.byteLength>e)return void a(io(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(ro(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(ro(t))))}catch(t){a(eo)}}))}(t,r)}function so(){return(so=o((function*(t){var e=t.r,r=t.options,i=Ba(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):no(e,r)}))).apply(this,arguments)}function ao(){return(ao=o((function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),a=Xa.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=Ba(n,i);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return b(i)?no(e,r):Promise.resolve(i)}))).apply(this,arguments)}var oo=null;function uo(t,e,r){if(!("performance"in e))return()=>{};if(oo)return $a.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},tt,r):tt,n=e=>{var r=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var s=i.maskRequestFn(t);e||(n=!s||(t=>!!t&&ut.has(t))(s)),s&&r.push(s)}})),r.length>0&&t(u({},e,{requests:r}))},s=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Wa(t)||za(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>Qa({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>Wa(t)||za(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>Qa({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(n,e,i),a=()=>{},l=()=>{};return(i.recordHeaders||i.recordBody)&&(a=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=ja("request",r.recordHeaders),n=ja("response",r.recordHeaders),s=Pa(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,u,l,h){void 0===u&&(u=!0);var d=this;try{var c,v,f=new Request(o),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(qa({type:"request",headers:g,url:o,recordBody:r.recordBody})&&(p.requestBody=Za({body:t,options:r,url:o})),c=e.performance.now(),y(t));var w=()=>{d.removeEventListener("readystatechange",b),d.removeEventListener("error",w),d.removeEventListener("abort",w),d.removeEventListener("timeout",w)},b=()=>{if(d.readyState===d.DONE){w(),v=e.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),qa({type:"response",headers:i,url:o,recordBody:r.recordBody})&&(p.responseBody=Za({body:d.response,options:r,url:o})),Ga(e,"xmlhttprequest",f.url,c,v).then((e=>{var r=Qa({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",b),d.addEventListener("error",w),d.addEventListener("abort",w),d.addEventListener("timeout",w)}catch(t){$a.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),u,l,h)}));return()=>{s()}}(n,e,i),l=function(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=ja("request",r.recordHeaders),n=ja("response",r.recordHeaders),s=Pa(e,"fetch",(s=>function(){var a=o((function*(a,o){var u,l;try{u=new Request(a,o)}catch(t){return $a.error("Failed to instrument fetch for network capture",t),s(a,o)}var h,d,c={};try{try{var v={};u.headers.forEach(((t,e)=>{v[e]=t})),i&&(c.requestHeaders=v),!Ka(null==o?void 0:o.body)&&qa({type:"request",headers:v,url:a,recordBody:r.recordBody})&&(c.requestBody=yield function(t){return so.apply(this,arguments)}({r:u,options:r,url:a}))}catch(t){$a.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),l=Ua(a)?yield s(u):yield s(a,o),d=e.performance.now();var f={};return l.headers.forEach(((t,e)=>{f[e]=t})),n&&(c.responseHeaders=f),qa({type:"response",headers:f,url:a,recordBody:r.recordBody})&&(c.responseBody=yield function(t){return ao.apply(this,arguments)}({r:l,options:r,url:a})),l}finally{Ga(e,"fetch",u.url,h,d).then((e=>{var r,i=Qa({entry:e,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:c,start:h,end:d,url:u.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{s()}}(n,e,i)),oo=()=>{s(),a(),l(),oo=null}}var lo=t=>({name:"rrweb/network@1",observer:uo,options:t});s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Fa,getRecordNetworkPlugin:lo},s.__PosthogExtensions__.rrweb={record:ya,version:"v2",wasMaxDepthReached:()=>Gn,resetMaxDepthState(){Gn=!1,qn=!1},getLastSnapshotCost:()=>Ri,getMutationCost:()=>u({},Fi),resetSnapshotCostState(){Mi=0,Ci=0,Ii=0,wi=0,Ai=mi(),Ri=null,Ti=null,xi=[],Ei=0,Oi=0,Fi={slowestBatchMs:0},Li={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},s.rrweb={record:ya,version:"v2"},s.rrwebConsoleRecord={getRecordConsolePlugin:Fa},s.getRecordNetworkPlugin=lo,s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initSessionRecording=(t,e)=>new Vr(t,e)}();
|
|
2
2
|
//# sourceMappingURL=lazy-recorder.js.map
|