@statsig/js-client 3.21.0 → 3.22.0-beta.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Statsig=e():t.Statsig=e()}(this,()=>(()=>{"use strict";var i={1845:(t,i,e)=>{var n;$Q2(i,"__esModule",{value:!0}),i.t=i.i=i.l=void 0;const s=e(7512);i.l=()=>{try{return"undefined"!=typeof __STATSIG__?__STATSIG__:l}catch(t){return l}},i.i=t=>(0,i.l)()[t];i.t=t=>{var e=(0,i.l)();return t?e.instances&&e.instances[t]:(e.instances&&1<Object.keys(e.instances).length&&s.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),e.firstInstance)};var r="__STATSIG__",o="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},a="undefined"!=typeof globalThis?globalThis:{};const l=null!=(n=null!=(n=null!=(n=o[r])?n:e[r])?n:a[r])?n:{instance:i.t};o[r]=l,e[r]=l,a[r]=l},2137:(t,e,i)=>{$Q(e),e.o=e.u=void 0;const s=i(1406);function n(t,e,i){if(i)return i(t,e);const n=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(i=null==e?void 0:e.userID)?i:""),"cids:"+Object.keys(n).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+n[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.u=n,e.o=function(t,e,i){return e?n(t,e,i):(0,s.h)("k:"+t)}},6427:(t,e)=>{$Q(e)},694:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e),e.Wn=e.DataAdapterCore=void 0;const l=i(7512),u=i(9122),r=i(8578),o=i(4534),c=i(3401);function h(t,e,i,n){return{source:t,data:e,receivedAt:Date.now(),stableID:i,fullUserHash:(0,r.v)(n)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.p=e,this.m=null,this.O=null,this.j="statsig.last_modified_time."+e,this.S=new n}attach(t,e,i){this.O=t,this.m=e}getDataSync(t){var t=t&&(0,r.T)(t,this.m),e=this.k(t),i=this.S.get(e,t);return i&&this.Li(i)?i:(i=this.I(e))&&this.Li(i)?(this.S.add(e,i),this.S.get(e,t)):null}setData(t,e){var e=e&&(0,r.T)(e,this.m),i=this.k(e);this.S.add(i,h("Bootstrap",t,null,e))}Li(t){return null==t.stableID||t.stableID===u.StableID.get(this.C())}D(e,i,n){return s(this,void 0,void 0,function*(){o.Storage.isReady()||(yield o.Storage.isReadyResolver());var t=null!=e?e:this.getDataSync(i),t=[this.M(t,i,n)];return null!=n&&n.timeoutMs&&t.push(new Promise(t=>setTimeout(t,n.timeoutMs)).then(()=>(l.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}A(i,n){return s(this,void 0,void 0,function*(){var t=i&&(0,r.T)(i,this.m),e=this.k(t),t=yield this.D(null,t,n);t&&this.S.add(e,$P($P({},t),{source:"Prefetch"}))})}M(r,o,a){return s(this,void 0,void 0,function*(){var t=null!=(t=null==r?void 0:r.data)?t:null,e=null!=r&&this.N(r,o),e=yield this.R(t,o,a,e);if(!e)return l.Log.debug("No response returned for latest value"),null;var i=(0,c.P)(e,"has_updates","Response"),n=this.C(),n=u.StableID.get(n);let s=null;if(!0===(null==i?void 0:i.has_updates))s=h("Network",e,n,o);else{if(!t||!1!==(null==i?void 0:i.has_updates))return null;s=h("NetworkNotModified",t,n,o)}e=this.k(o);return this.S.add(e,s),this.U(e,s),s})}C(){return null!=this.O?this.O:(l.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=o.Storage.getItem)?void 0:e.call(o.Storage,t);return null!=e&&(t=(0,c.P)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}U(t,e){o.Storage.setItem(t,JSON.stringify(e)),this.F(t)}F(t){var e=null!=(e=(0,o.G)(this.j))?e:{},t=(e[t]=Date.now(),a(e,10));t&&(delete e[t],o.Storage.removeItem(t)),(0,o.L)(this.j,e)}},e.Wn=h;class n{constructor(){this.K={}}get(t,e){var t=this.K[t],i=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&i&&e!==i?(l.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var i=a(this.K,9);i&&delete this.K[i],this.K[t]=e}merge(t){this.K=$P($P({},this.K),t)}}function a(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var i=s[t],n=s[e];return"object"==typeof i&&"object"==typeof n?n.receivedAt<i.receivedAt?e:t:n<i?e:t})}},8962:(t,o)=>{$Q2(o,"__esModule",{value:!0}),o.Diagnostics=void 0;const n=new Map,i="start";function s(t,e,i,n){return $P({key:i,action:e,step:n,timestamp:Date.now()},t)}function r(t,e){var i=null!=(i=n.get(t))?i:[];i.push(e),n.set(t,i)}function e(t,e){if(e in t)return t[e]}o.Diagnostics={q:t=>n.get(t),B:t=>{r(t,s({},i,"overall"))},V:(t,e,i)=>{r(t,s({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:i},"end","overall"))},J:(t,e)=>{r(t,s(e,i,"initialize","network_request"))},$:(t,e)=>{r(t,s(e,"end","initialize","network_request"))},W:t=>{r(t,s({},i,"initialize","process"))},H:(t,e)=>{r(t,s(e,"end","initialize","process"))},Y:t=>{n.delete(t)},X(t){if(t&&"object"==typeof t)return{code:e(t,"code"),name:e(t,"name"),message:e(t,"message")}},Z(t,e,i,n){return{success:!0===(null==t?void 0:t.ok),statusCode:null==t?void 0:t.status,sdkRegion:null==(t=null==t?void 0:t.headers)?void 0:t.get("x-statsig-region"),isDelta:!0===i.includes('"is_delta":true')||void 0,attempt:e,error:o.Diagnostics.X(n)}},tt(t,e,i,n){var s,r=o.Diagnostics.q(i);return null==r||r.length<=0?-1:(s=r[r.length-1].timestamp-r[0].timestamp,o.Diagnostics.Y(i),i=function(t,e){t={eventName:"statsig::diagnostics",user:t,value:null,metadata:e,time:Date.now()};return t}(t,{context:"initialize",markers:r.slice(),statsigOptions:n}),e.enqueue(i),s)}}},8809:function(t,e){var i=this&&this.__awaiter||$A();$Q(e),e.et=void 0;const s=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),r="https://cloudflare-dns.com/dns-query",o=["i","e","d"],a=200;e.et=function(e){return i(this,void 0,void 0,function*(){var i=yield e(r,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:s});if(i.ok){var t,i=yield i.arrayBuffer(),i=new Uint8Array(i);{var n=i,i=n.findIndex((t,e)=>e<a&&"="===String.fromCharCode(t)&&o.includes(String.fromCharCode(n[e-1])));if(-1===i)throw(t=new Error("Failed to parse TXT records from DNS")).name="DnsTxtParseError",t;let e="";for(let t=i-1;t<n.length;t++)e+=String.fromCharCode(n[t]);return e.split(",")}}throw(t=new Error("Failed to fetch TXT records from DNS")).name="DnsTxtFetchError",t})}},3539:(t,e)=>{$Q(e)},5542:function(t,a,e){var i=this&&this.__awaiter||$A();$Q2(a,"__esModule",{value:!0}),a.ErrorBoundary=a.EXCEPTION_ENDPOINT=void 0;const n=e(7512),l=e(5902),u=e(8e3),c=(a.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");function h(t){return t instanceof Error?t:"string"==typeof t?new Error(t):new Error("An unknown error occurred.")}a.ErrorBoundary=class{constructor(t,e,i,n){this.O=t,this.m=e,this.nt=i,this.qn=n,this.it=new Set}wrap(n){try{const t=n;!function(t){const e=new Set;let i=Object.getPrototypeOf(t);for(;i&&i!==Object.prototype;)Object.getOwnPropertyNames(i).filter(t=>"function"==typeof(null===i||void 0===i?void 0:i[t])).forEach(t=>e.add(t)),i=Object.getPrototypeOf(i);return Array.from(e)}(t).forEach(e=>{const i=t[e];"$EB"in i||(t[e]=(...t)=>this.rt(e,()=>i.apply(n,t)),t[e].$EB=!0)})}catch(t){this.st("eb:wrap",t)}}logError(t,e){this.st(t,e)}getLastSeenErrorAndReset(){var t=this.qn;return this.qn=void 0,null!=t?t:null}attachErrorIfNoneExists(t){this.qn||(this.qn=h(t))}rt(e,t){try{var i=t();return i&&i instanceof Promise?i.catch(t=>this.st(e,t)):i}catch(t){return this.st(e,t),null}}st(r,o){try{n.Log.warn("Caught error in "+r,{error:o});i(this,void 0,void 0,function*(){var t,e=o||Error(c),i=e instanceof Error,n=i?e.name:"No Name",s=h(e);this.qn=s,this.it.has(n)||(this.it.add(n),null!=(s=null==(s=this.m)?void 0:s.networkConfig)&&s.preventAllNetworkTraffic?null!=(s=this.nt)&&s.call(this,{name:"error",error:o,tag:r}):(s=l.SDKType.lt(this.O),t=u.StatsigMetadataProvider.get(),i=i?e.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(e),e=$P({tag:r,exception:n,info:i,statsigOptions:function(t){if(!t)return{};const i={};return Object.entries(t).forEach(([t,e])=>{switch(typeof e){case"number":case"bigint":case"boolean":i[String(t)]=e;break;case"string":e.length<50?i[String(t)]=e:i[String(t)]="set";break;case"object":"environment"===t?i.environment=e:"networkConfig"===t?i.networkConfig=e:i[String(t)]=null!=e?"set":"unset"}}),i}(this.m)},$P($P({},t),{sdkType:s})),yield(null!=(n=null==(i=null==(n=this.m)?void 0:n.networkConfig)?void 0:i.networkOverrideFunc)?n:fetch)(a.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.O,"STATSIG-SDK-TYPE":String(s),"STATSIG-SDK-VERSION":String(t.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(e)}),null!=(i=this.nt)&&i.call(this,{name:"error",error:o,tag:r})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},2922:(t,e)=>{$Q(e)},2417:(t,e)=>{$Q(e)},7770:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=i(2137),r=i(1406),o=i(7512),a=i(7410),l=i(6830),u=i(1637),c=i(586),h=i(4534),d=i(1881),v=i(2397),f={},m={Startup:"startup",GainedFocus:"gained_focus"};class p{static ot(t){null!=(t=f[t])&&t.flush().catch(()=>{})}static ut(t){null!=(t=f[t])&&t.ct(m.GainedFocus)}constructor(t,e,i,n){this.O=t,this.nt=e,this.ht=i,this.m=n,this.dt=[],this.vt={},this.ft={},this._t=!1,this.gt=Date.now(),this.Yn=null!=(t=null==n?void 0:n.loggingEnabled)?t:!0===(null==n?void 0:n.disableLogging)?c.LoggingEnabledOption.disabled:c.LoggingEnabledOption.browserOnly,null!=n&&n.loggingEnabled&&void 0!==n.disableLogging&&o.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this.yt=null!=(e=null==n?void 0:n.loggingBufferMaxSize)?e:100;i=null==n?void 0:n.networkConfig;this.Ot=new d.UrlConfiguration(a.Endpoint.jt,null==i?void 0:i.logEventUrl,null==i?void 0:i.api,null==i?void 0:i.logEventFallbackUrls)}setLogEventCompressionMode(t){this.ht.setLogEventCompressionMode(t)}setLoggingEnabled(t){this.Yn=t}enqueue(t){this.St(t)&&(this.wt(t),this.Tt(),this.dt.length>this.yt)&&p.ot(this.O)}incrementNonExposureCount(t){var e=null!=(e=this.ft[t])?e:0;this.ft[t]=e+1}reset(){this.flush().catch(()=>{}),this.vt={}}start(){var t,e=(0,l.kt)();e&&"always"!==(null==(t=this.m)?void 0:t.loggingEnabled)||(f[this.O]=this,e||(0,v.It)(t=>{"background"===t?p.ot(this.O):"foreground"===t&&p.ut(this.O)}),this.ct(m.Startup),this.Dt())}stop(){return n(this,void 0,void 0,function*(){this.Et&&(clearInterval(this.Et),this.Et=null),delete f[this.O],yield this.flush()})}flush(){return n(this,void 0,void 0,function*(){var t;this.Mt(),0!==this.dt.length&&(t=this.dt,this.dt=[],yield this.At(t))})}Tt(){this._t||(this._t=!0,200<Date.now()-this.gt)||setTimeout(()=>p.ot(this.O),200)}St(t){if("always"!==(null==(e=this.m)?void 0:e.loggingEnabled)&&(0,l.kt)())return!1;if((0,u.xt)(t)){var e=t.user||{statsigEnvironment:void 0},e=(0,s.u)(this.O,e),i=t.metadata||{},t=[t.eventName,e,i.gate,i.config,i.ruleID,i.allocatedExperiment,i.parameterName,String(i.isExplicitParameter),i.reason].join("|"),e=this.vt[t],i=Date.now();if(e&&i-e<6e5)return!1;1e3<Object.keys(this.vt).length&&(this.vt={}),this.vt[t]=i}return!0}At(s){return n(this,void 0,void 0,function*(){var t,e;if("disabled"===this.Yn)return this.Nt(s),!1;try{var i=(0,v.Rt)()&&this.ht.isBeaconSupported()&&null==(null==(e=null==(t=this.m)?void 0:t.networkConfig)?void 0:e.networkOverrideFunc),n=(this.nt({name:"pre_logs_flushed",events:s}),i?this.Pt(s):yield this.Ct(s));return n.success?(this.nt({name:"logs_flushed",events:s}),!0):(o.Log.warn("Failed to flush events."),this.Nt(s),!1)}catch(t){return o.Log.warn("Failed to flush events."),!1}})}Ct(e){return n(this,void 0,void 0,function*(){var t=yield this.ht.post(this.Ut(e)),t=null!=(t=null==t?void 0:t.code)?t:-1;return{success:200<=t&&t<300}})}Pt(t){return{success:this.ht.beacon(this.Ut(t))}}Ut(t){return{sdkKey:this.O,data:{events:t},urlConfig:this.Ot,retries:3,isCompressable:!0,params:{[a.NetworkParam.EventCount]:String(t.length)},credentials:"same-origin"}}Nt(t){for(;500<t.length;)t.shift();var e=this.o();try{(0,h.L)(e,t)}catch(t){o.Log.warn("Unable to save failed logs to storage")}}ct(e){const i=this.o();n(this,void 0,void 0,function*(){h.Storage.isReady()||(yield h.Storage.isReadyResolver());var t=(0,h.G)(i);t&&(e===m.Startup&&h.Storage.removeItem(i),yield this.At(t))&&e===m.GainedFocus&&h.Storage.removeItem(i)}).catch(()=>{o.Log.warn("Failed to flush stored logs")})}o(){return"statsig.failed_logs."+(0,r.h)(this.O)}wt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},i=this.Ft(),i=(i&&(e.statsigMetadata={currentPage:i}),$P($P({},t),e));o.Log.debug("Enqueued Event:",i),this.dt.push(i)}Mt(){0!==Object.keys(this.ft).length&&(this.wt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.ft)}}),this.ft={})}Ft(){var t;if(!1!==(null==(t=this.m)?void 0:t.includeCurrentPageUrlWithEvents))return(0,l.Gt)()}Dt(){var t=null!=(t=null==(t=this.m)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{var t=f[this.O];t&&t.Et===e?p.ot(this.O):clearInterval(e)},t);this.Et=e}}e.EventLogger=p},1406:(t,r,e)=>{$Q2(r,"__esModule",{value:!0}),r.Lt=r.Kt=r.h=void 0;const o=e(6634);r.h=e=>{let i=0;for(let t=0;t<e.length;t++){var n=e.charCodeAt(t);i=(i<<5)-i+n,i&=i}return String(i>>>0)},r.Kt=(t,e)=>(0,r.h)(JSON.stringify((0,r.Lt)(t,e)));r.Lt=(i,n)=>{if(null==i)return null;var t=Object.keys(i).sort();const s={};return t.forEach(t=>{var e=i[t];0===n||"object"!==(0,o.zt)(e)?s[t]=e:s[t]=(0,r.Lt)(e,null!=n?n-1:n)}),s}},1333:(t,e)=>{$Q(e)},7512:(t,e)=>{$Q(e),e.Log=e.LogLevel=void 0;function i(t){return t.unshift("[Statsig]"),t}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class n{static info(...t){n.level>=e.LogLevel.Info&&console.info(" INFO ",...i(t))}static debug(...t){n.level>=e.LogLevel.Debug&&console.debug(" DEBUG ",...i(t))}static warn(...t){n.level>=e.LogLevel.Warn&&console.warn(" WARN ",...i(t))}static error(...t){n.level>=e.LogLevel.Error&&console.error(" ERROR ",...i(t))}}(e.Log=n).level=e.LogLevel.Warn},7787:(t,e)=>{$Q(e),e.createMemoKey=e.MemoPrefix=void 0,e.MemoPrefix={Kn:"g",Ln:"c",Vn:"e",Ts:"cl",$n:"l",Bn:"p"};const r=new Set([]),o=new Set(["userPersistedValues"]);e.createMemoKey=function(t,e,i){let n=t+"|"+e;if(i)for(const s of Object.keys(i)){if(o.has(s))return;r.has(s)?n+=`|${s}=true`:n+=`|${s}=`+i[s]}return n}},7410:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=e.Endpoint=void 0,e.Endpoint={qt:"initialize",jt:"rgstr",Bt:"download_config_specs"},e.NetworkDefault={[e.Endpoint.jt]:"https://prodregistryv2.org/v1",[e.Endpoint.qt]:"https://featureassets.org/v1",[e.Endpoint.Bt]:"https://api.statsigcdn.com/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},7023:function(t,e,i){var I=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,i(1845);const v=i(1845),C=i(8962),S=i(7512),w=i(7410),n=i(308),f=i(3091),o=i(5902),s=i(6830),a=i(4143),l=i(9122),k=i(2636),u=i(8e3),m=i(586),_=i(2397),O=500,A=3e4;const M=new Set([408,500,502,503,504,522,524,599]);e.NetworkCore=class{constructor(t,e){this.nt=e,this.$t=null,this.Vt=1e4,this.Jt={},this.m={},this.Oi={},this.Jn=null,t&&(this.m=t),this.m.networkConfig&&(this.Jt=this.m.networkConfig),this.Jt.networkTimeoutMs&&(this.Vt=this.Jt.networkTimeoutMs),this.Wt=new n.NetworkFallbackResolver(this.m),this.setLogEventCompressionMode(this.Qn(t))}setLogEventCompressionMode(t){this.m.logEventCompressionMode=t}setErrorBoundary(t){this.$t=t,this.$t.wrap(this),this.$t.wrap(this.Wt),this.Wt.setErrorBoundary(t)}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}getLastUsedInitUrlAndReset(){var t=this.Jn;return this.Jn=null,t}beacon(t){var e,i;return!!j(t)&&(t=this.Ht("POST",t),e=this.Xt(t),(i=navigator).sendBeacon.bind(i)(e,t.body))}post(e){return I(this,void 0,void 0,function*(){var t=this.Ht("POST",e);return this.Pi(t),yield this.Ci(t),this.Zt(t)})}get(t){t=this.Ht("GET",t);return this.Zt(t)}Zt(b){return I(this,void 0,void 0,function*(){var e;if(!j(b))return null;if(this.Jt.preventAllNetworkTraffic)return null;var{method:i,body:n,retries:s,attempt:r}=b,o=b.urlConfig.endpoint;if(this.Si(o))return S.Log.warn(`Request to ${o} was blocked because you are making requests too frequently.`),null;r=null!=r?r:1;const a="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>{null!==a&&void 0!==a&&a.abort(`Timeout of ${this.Vt}ms expired.`)},this.Vt),l=this.Xt(b);let u=null;var c,h=(0,_.Rt)();try{var d,v,f,m={method:i,body:n,headers:$P({},b.headers),signal:null===a||void 0===a?void 0:a.signal,priority:b.priority,keepalive:h},p=(c=r,(y=b).urlConfig.endpoint===w.Endpoint.qt&&C.Diagnostics.J(y.sdkKey,{attempt:c}),this.Oi[o]),g=(p&&(p.lastRequestTime=Date.now(),this.Oi[o]=p),null!=(e=this.Jt.networkOverrideFunc)?e:fetch);if(u=yield g(l,m),clearTimeout(t),u.ok)return f=yield u.text(),T(b,u,r,f),this.Wt.tryBumpExpiryTime(b.sdkKey,b.urlConfig),{body:f,code:u.status};throw d=yield u.text().catch(()=>"No Text"),(v=new Error(`NetworkError: ${l} `+d)).name="NetworkError",v}catch(t){var n=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(a,t),h=function(t){t=(null==t?void 0:t.signal.aborted)&&"string"==typeof t.signal.reason&&t.signal.reason.includes("Timeout");return t||!1}(a),y=(T(b,u,r,"",t),yield this.Wt.tryFetchUpdatedFallbackInfo(b.sdkKey,b.urlConfig,n,h));return(y&&(b.fallbackUrl=this.Wt.getActiveFallbackUrl(b.sdkKey,b.urlConfig)),!s||s<r||!M.has(null!=(c=null===u||void 0===u?void 0:u.status)?c:500))?(null!=(o=this.nt)&&o.call(this,{name:"error",error:t,tag:k.ErrorTag.NetworkError,requestArgs:b}),p=`A networking error occurred during ${i} request to ${l}.`,S.Log.error(p,n,t),null!=(e=this.$t)&&e.attachErrorIfNoneExists(p),null):(yield function(e){return I(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(O*(e*e),A)))})}(r),this.Zt($P($P({},b),{retries:s,attempt:r+1})))}})}Qn(t){let e=null==t?void 0:t.logEventCompressionMode;return e=(e=e||!0!==(null==t?void 0:t.disableCompression)?e:m.LogEventCompressionMode.Disabled)||m.LogEventCompressionMode.Enabled}Si(t){var e=Date.now(),i=null!=(i=this.Oi[t])?i:{count:0,lastRequestTime:e},n=e-i.lastRequestTime,n=Math.floor(.05*n);return i.count=Math.max(0,i.count-n),50<=i.count||(i.count+=1,i.lastRequestTime=e,this.Oi[t]=i,!1)}Xt(t){var e=null!=(e=t.fallbackUrl)?e:t.urlConfig.getUrl();t.urlConfig.endpoint!==w.Endpoint.qt&&t.urlConfig.endpoint!==w.Endpoint.Bt||(this.Jn=e);const i=$P({[w.NetworkParam.SdkKey]:t.sdkKey,[w.NetworkParam.SdkType]:o.SDKType.lt(t.sdkKey),[w.NetworkParam.SdkVersion]:u.SDK_VERSION,[w.NetworkParam.Time]:String(Date.now()),[w.NetworkParam.SessionID]:a.SessionID.get(t.sdkKey)},t.params);t=Object.keys(i).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(i[t])).join("&");return e+(t?"?"+t:"")}Pi(e){var t,i=(0,s.te)(),n=e.body;if(e.isStatsigEncodable&&!this.m.disableStatsigEncoding&&"string"==typeof n&&null==(0,v.i)("no-encode")&&null!=i&&i.btoa)try{e.body=i.btoa(n).split("").reverse().join(""),e.params=$P($P({},null!=(t=e.params)?t:{}),{[w.NetworkParam.StatsigEncoded]:"1"})}catch(t){S.Log.warn("Request encoding failed for "+e.urlConfig.getUrl(),t)}}Ci(d){return I(this,void 0,void 0,function*(){var e,i=d.body;if("string"==typeof i&&function(t,e){if(!t.isCompressable)return;if(null!=(0,v.i)("no-compress")||"undefined"==typeof CompressionStream||"undefined"==typeof TextEncoder)return;var i=null!=t.urlConfig.customUrl||null!=t.urlConfig.fallbackUrls,n=!0===f.SDKFlags.get(t.sdkKey,"enable_log_event_compression");switch(e.logEventCompressionMode){case m.LogEventCompressionMode.Disabled:return;case m.LogEventCompressionMode.Enabled:return i&&!n?void 0:1;case m.LogEventCompressionMode.Forced:return 1;default:return}}(d,this.m))try{for(var n,s=(new TextEncoder).encode(i),r=new CompressionStream("gzip"),o=r.writable.getWriter(),a=(o.write(s).catch(S.Log.error),o.close().catch(S.Log.error),r.readable.getReader()),l=[];!(n=yield a.read()).done;)l.push(n.value);var u=l.reduce((t,e)=>t+e.length,0),c=new Uint8Array(u);let t=0;for(const h of l)c.set(h,t),t+=h.length;d.body=c,d.params=$P($P({},null!=(e=d.params)?e:{}),{[w.NetworkParam.IsGzipped]:"1"})}catch(t){S.Log.warn("Request compression failed for "+d.urlConfig.getUrl(),t)}})}Ht(t,e){var i=this.Wt.getActiveFallbackUrl(e.sdkKey,e.urlConfig),t=$P($P({},e),{method:t,fallbackUrl:i});return"data"in e&&r(t,e.data),t}};const j=t=>!!t.sdkKey||(S.Log.warn("Unable to make request without an SDK key"),!1),r=(t,e)=>{var{sdkKey:i,fallbackUrl:n}=t,s=l.StableID.get(i),r=a.SessionID.get(i),i=o.SDKType.lt(i);t.body=JSON.stringify($P($P({},e),{statsigMetadata:$P($P({},u.StatsigMetadataProvider.get()),{stableID:s,sessionID:r,sdkType:i,fallbackUrl:n})}))};function T(t,e,i,n,s){t.urlConfig.endpoint===w.Endpoint.qt&&C.Diagnostics.$(t.sdkKey,C.Diagnostics.Z(e,i,n,s))}},308:function(t,e,i){var a=this&&this.__awaiter||$A();$Q(e),e.ee=e.NetworkFallbackResolver=void 0;const o=i(8809),n=i(1406),r=i(7512),l=i(4534);function u(t,e){t=null!=(t=null==t?void 0:t.toLowerCase())?t:"";return e||t.includes("uncaught exception")||t.includes("failed to fetch")||t.includes("networkerror when attempting to fetch resource")}function c(t){return"statsig.network_fallback."+(0,n.h)(t)}function h(t,e){t=c(t);e&&0!==Object.keys(e).length?l.Storage.setItem(t,JSON.stringify(e)):l.Storage.removeItem(t)}e.NetworkFallbackResolver=class{constructor(t){this.ne=null,this.$t=null,this.ie={},this.re=null==(t=t.networkConfig)?void 0:t.networkOverrideFunc}setErrorBoundary(t){this.$t=t}tryBumpExpiryTime(t,e){var i=null==(i=this.ne)?void 0:i[e.endpoint];i&&(i.expiryTime=Date.now()+6048e5,h(t,$P($P({},this.ne),{[e.endpoint]:i})))}getActiveFallbackUrl(t,e){var i;if(null!=e.customUrl&&null!=e.fallbackUrls)return null;let n=this.ne;null==n&&(n=null!=(s=function(t){t=c(t),t=l.Storage.getItem(t);if(!t)return null;try{return JSON.parse(t)}catch(t){return r.Log.error("Failed to parse FallbackInfo"),null}}(t))?s:{},this.ne=n);var s=n[e.endpoint];return!s||Date.now()>(null!=(i=s.expiryTime)?i:0)||e.getChecksum()!==s.urlConfigChecksum?(delete n[e.endpoint],this.ne=n,h(t,this.ne),null):s.url||null}tryFetchUpdatedFallbackInfo(n,s,r,o){return a(this,void 0,void 0,function*(){var e,t,i;try{return u(r,o)?(t=null==s.customUrl&&null==s.fallbackUrls?yield this.se(s):s.fallbackUrls,!!(i=this.le(null==(e=this.ne)?void 0:e[s.endpoint],t))&&(this.oe(n,s,i),!0)):!1}catch(t){return null!=(e=this.$t)&&e.logError("tryFetchUpdatedFallbackInfo",t),!1}})}oe(t,e,i){var i={urlConfigChecksum:e.getChecksum(),url:i,expiryTime:Date.now()+6048e5,previous:[]},e=e.endpoint,n=null==(n=this.ne)?void 0:n[e],n=(n&&i.previous.push(...n.previous),10<i.previous.length&&(i.previous=[]),null==(n=null==(n=this.ne)?void 0:n[e])?void 0:n.url);null!=n&&i.previous.push(n),this.ne=$P($P({},this.ne),{[e]:i}),h(t,this.ne)}se(r){return a(this,void 0,void 0,function*(){var t=this.ie[r.endpoint];if(t&&Date.now()<t)return null;this.ie[r.endpoint]=Date.now()+144e5;var e=[],t=yield(0,o.et)(null!=(t=this.re)?t:fetch),i=function(t){try{return new URL(t).pathname}catch(t){return null}}(r.defaultUrl);for(const s of t)if(s.startsWith(r.endpointDnsKey+"=")){var n=s.split("=");if(1<n.length){let t=n[1];t.endsWith("/")&&(t=t.slice(0,-1)),e.push("https://"+t+i)}}return e})}le(t,e){var i;if(null==e)return null;var n=new Set(null!=(i=null==t?void 0:t.previous)?i:[]),s=null==t?void 0:t.url;let r=null;for(const a of e){var o=a.endsWith("/")?a.slice(0,-1):a;if(!n.has(a)&&o!==s){r=o;break}}return r}},e.ee=u},1405:(t,e)=>{$Q(e)},1361:(t,e)=>{$Q(e)},3091:(t,e)=>{$Q(e),e.SDKFlags=void 0;const i={};e.SDKFlags={setFlags:(t,e)=>{i[t]=e},get:(t,e)=>{return null!=(t=null==(t=i[t])?void 0:t[e])&&t}}},5902:(t,e)=>{$Q(e),e.SDKType=void 0;const i={};let n;e.SDKType={lt:t=>{return(null!=(t=i[t])?t:"js-mono")+(null!==n&&void 0!==n?n:"")},ue(t,e){i[t]=e},ae(t){n&&"-react"!==n||(n="-"+t)}}},6830:(t,n)=>{$Q2(n,"__esModule",{value:!0}),n.Hn=n.Gt=n.ce=n.he=n.kt=n.de=n.te=void 0;n.te=()=>"undefined"!=typeof window?window:null,n.de=()=>{var t=(0,n.te)();return null!=(t=null==t?void 0:t.document)?t:null},n.kt=()=>{var t;return null===(0,n.de)()&&(t="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||t)},n.he=(t,e)=>{var i=(0,n.te)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.ce=(t,e)=>{var i=(0,n.de)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.Gt=()=>{var t;try{return null==(t=(0,n.te)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}};n.Hn=()=>{var t=(0,n.te)();return t&&"onpagehide"in t?"pagehide":"beforeunload"}},4143:(t,e,i)=>{$Q(e),e.StatsigSession=e.SessionID=void 0;const n=i(1845),s=i(2137),a=i(7512),l=i(4534),u=i(8023),c=18e5,h=144e5,d={};function v(e,t){return setTimeout(()=>{var t=null==(t=(0,n.l)())?void 0:t.instance(e);t&&t.$emt({name:"session_expired"})},t)}function f(t){return"statsig.session_id."+(0,s.o)(t)}e.SessionID={get:t=>e.StatsigSession.get(t).data.sessionID},e.StatsigSession={get:t=>{null==d[t]&&(d[t]=function(t){let e=function(t){t=f(t);return(0,l.G)(t)}(t);var i=Date.now();e=e||{sessionID:(0,u.getUUID)(),startTime:i,lastUpdate:i};return{data:e,sdkKey:t}}(t));var t=d[t],e=Date.now(),i=t.data,n=t.sdkKey,s=((function({lastUpdate:t}){return Date.now()-t>c}(i)||function({startTime:t}){return Date.now()-t>h}(i))&&(i.sessionID=(0,u.getUUID)(),i.startTime=e,o=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(n))&&o.$emt({name:"session_expired"}),i.lastUpdate=e,i),r=t.sdkKey;r=f(r);try{(0,l.L)(r,s)}catch(t){a.Log.warn("Failed to save SessionID")}clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID);var o=e-i.startTime;return t.idleTimeoutID=v(n,c),t.ageTimeoutID=v(n,h-o),t},overrideInitialSessionID:(t,e)=>{var i;d[e]=(t=t,e=e,i=Date.now(),{data:{sessionID:t,startTime:i,lastUpdate:i},sdkKey:e})}}},2176:(t,a)=>{$Q2(a,"__esModule",{value:!0}),a.hi=void 0;a.hi=(e,i)=>{let n=0;var s=Object.keys(e);for(let t=0;t<s.length;t++){var r=s[t],o=e[r];if((n=(n+=r.length)+("object"==typeof o&&null!==o?(0,a.hi)(o,i)+2:String(o).length+1))>=i)return n}return n}},9122:(t,e,i)=>{$Q(e),e.StableID=void 0;const n=i(2137),s=i(7512),r=i(6830),o=i(4534),a=i(8023),l={},u={},c={};function h(t){return"statsig.stable_id."+(0,n.o)(t)}function d(t,e){e=h(e);try{(0,o.L)(e,t)}catch(t){s.Log.warn("Failed to save StableID to storage")}}function v(t,e){var i;u[e]&&document&&((i=new Date).setFullYear(i.getFullYear()+1),document.cookie=`${f(e)}=${encodeURIComponent(t)}; expires=${i.toUTCString()}; path=/`)}function f(t){return"statsig.stable_id."+(0,n.o)(t)}e.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:t=>{if(c[t])return null;if(null!=l[t])return l[t];let e=null;return null!=(e=function(t){if(u[t]&&null!=(0,r.de)())for(const n of document.cookie.split(";")){var[e,i]=n.trim().split("=");if(e===f(t))return decodeURIComponent(i)}return null}(t))?d(l[t]=e,t):(d(e=null==(e=function(t){t=h(t);return(0,o.G)(t)}(t))?(0,a.getUUID)():e,t),v(e,t),l[t]=e),e},setOverride:(t,e)=>{d(l[e]=t,e),v(t,e)},Xn:(t,e)=>{u[t]=e},_e:(t,e)=>{c[t]=e}}},1375:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,i(1845);const o=i(1845),a=i(5542),l=i(7770),u=i(7512),r=i(7787),c=i(6830),h=i(4143),d=i(9122),s=i(586),v=i(4534);e.StatsigClientBase=class{constructor(t,e,i,n){this.loadingStatus="Uninitialized",this.ve=null,this.fe={};var s,r=this.$emt.bind(this);null!=(null==n?void 0:n.logLevel)&&(u.Log.level=n.logLevel),null!=n&&n.disableStorage&&v.Storage._e(!0),null!=n&&n.initialSessionID&&h.StatsigSession.overrideInitialSessionID(n.initialSessionID,t),null!=n&&n.storageProvider&&v.Storage.ge(n.storageProvider),null!=n&&n.enableCookies&&d.StableID.Xn(t,n.enableCookies),null!=n&&n.disableStableID&&d.StableID._e(t,!0),this.O=t,this.m=null!=n?n:{},this.ji={},this.overrideAdapter=null!=(s=null==n?void 0:n.overrideAdapter)?s:null,this.pe=new l.EventLogger(t,r,i,n),this.$t=new a.ErrorBoundary(t,n,r),this.$t.wrap(this),this.$t.wrap(e),this.$t.wrap(this.pe),i.setErrorBoundary(this.$t),this.dataAdapter=e,this.dataAdapter.attach(t,n,i),this.storageProvider=v.Storage,null!=(e=null==(r=null==(s=this.overrideAdapter)?void 0:s.loadFromStorage)?void 0:r.call(s))&&e.catch(t=>this.$t.logError("OA::loadFromStorage",t)),this.be(),n=t,i=this,(0,c.kt)()||(r=(0,o.l)(),s=null!=(s=r.instances)?s:{},i=i,null!=s[n]&&u.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),s[n]=i,r.firstInstance||(r.firstInstance=i),r.instances=s,__STATSIG__=r)}updateRuntimeOptions(t){t.loggingEnabled?(this.m.loggingEnabled=t.loggingEnabled,this.pe.setLoggingEnabled(t.loggingEnabled)):null!=t.disableLogging&&(this.m.disableLogging=t.disableLogging,this.pe.setLoggingEnabled(t.disableLogging?"disabled":"browser-only")),null!=t.disableStorage&&(this.m.disableStorage=t.disableStorage,v.Storage._e(t.disableStorage)),null!=t.enableCookies&&(this.m.enableCookies=t.enableCookies,d.StableID.Xn(this.O,t.enableCookies)),t.logEventCompressionMode?this.pe.setLogEventCompressionMode(t.logEventCompressionMode):t.disableCompression&&this.pe.setLogEventCompressionMode(s.LogEventCompressionMode.Disabled)}flush(){return this.pe.flush()}shutdown(){return n(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this.me("Uninitialized",null),this.ve=null,yield this.pe.stop()})}on(t,e){this.fe[t]||(this.fe[t]=[]),this.fe[t].push(e)}off(t,e){this.fe[t]&&-1!==(e=this.fe[t].indexOf(e))&&this.fe[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(i){var t;const e=e=>{try{e(i)}catch(t){!0===e.__isInternal?this.$t.logError("__emit:"+i.name,t):u.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",i)}};this.fe[i.name]&&this.fe[i.name].forEach(t=>e(t)),null!=(t=this.fe["*"])&&t.forEach(e)}me(t,e){this.loadingStatus=t,this.ji={},this.$emt({name:"values_updated",status:t,values:e})}ye(t,e,i){!0===(null==i?void 0:i.disableExposureLog)?this.pe.incrementNonExposureCount(t):this.pe.enqueue(e)}wi(n,s){return(t,e)=>{var i;return!this.m.disableEvaluationMemoization&&(i=(0,r.createMemoKey)(n,t,e))?(i in this.ji||(3e3<=Object.keys(this.ji).length&&(this.ji={}),this.ji[i]=s(t,e)),this.ji[i]):s(t,e)}}}},2636:(t,e)=>{$Q(e),e.ErrorTag=void 0,e.ErrorTag={NetworkError:"NetworkError"}},3206:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},1637:(t,e)=>{$Q(e),e.Oe=e.je=e.Ui=e.Se=e.xt=void 0;const r="statsig::config_exposure",o="statsig::gate_exposure",u="statsig::layer_exposure",c=(t,e,i,n,s)=>(i.bootstrapMetadata&&(n.bootstrapMetadata=i.bootstrapMetadata),{eventName:t,user:e,value:null,metadata:a(i,n),secondaryExposures:s,time:Date.now()});e.xt=({eventName:t})=>t===o||t===r||t===u;function h(t,e){return t.map(t=>"string"==typeof t?(null!=e?e:{})[t]:t).filter(t=>null!=t)}e.Se=(t,e,i)=>{var n,s={gate:e.name,gateValue:String(e.value),ruleID:e.ruleID};return null!=(null==(n=e.__evaluation)?void 0:n.version)&&(s.configVersion=e.__evaluation.version),c(o,t,e.details,s,h(null!=(t=null==(n=e.__evaluation)?void 0:n.secondary_exposures)?t:[],i))},e.Ui=h;e.je=(t,e,i)=>{var n,s={config:e.name,ruleID:e.ruleID};return null!=(null==(n=e.__evaluation)?void 0:n.version)&&(s.configVersion=e.__evaluation.version),null!=(null==(n=e.__evaluation)?void 0:n.passed)&&(s.rulePassed=String(e.__evaluation.passed)),c(r,t,e.details,s,h(null!=(t=null==(n=e.__evaluation)?void 0:n.secondary_exposures)?t:[],i))};e.Oe=(t,e,i,n)=>{var s=e.__evaluation,r=!0===(null==(r=null==s?void 0:s.explicit_parameters)?void 0:r.includes(i));let o="",a=null!=(l=null==s?void 0:s.undelegated_secondary_exposures)?l:[];r&&(o=null!=(l=s.allocated_experiment_name)?l:"",a=null!=(l=s.secondary_exposures)?l:[]);var l=null==(s=e.__evaluation)?void 0:s.parameter_rule_ids,l={config:e.name,parameterName:i,ruleID:null!=(s=null==l?void 0:l[i])?s:e.ruleID,allocatedExperiment:o,isExplicitParameter:String(r)};return null!=(null==(i=e.__evaluation)?void 0:i.version)&&(l.configVersion=e.__evaluation.version),c(u,t,e.details,l,h(a,n))};const a=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},8e3:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.21.0";let i={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>i,add:t=>{i=$P($P({},i),t)}}},586:(t,e)=>{$Q(e),e.LoggingEnabledOption=e.LogEventCompressionMode=void 0,e.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},e.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}},1098:(t,e)=>{$Q(e)},2059:(t,e,i)=>{$Q(e),e.we=e.Te=e.ke=e.Ie=e.De=e.Ee=void 0;const o=i(7512),a=i(6634);function s(t,e,i,n){return{name:t,details:e,ruleID:null!=(t=null==i?void 0:i.rule_id)?t:"",__evaluation:i,value:n}}function n(t,e,i){var n=null!=(n=null==i?void 0:i.value)?n:{};return $P($P({},s(t,e,i,n)),{get:r(t,null==i?void 0:i.value)})}function r(n,s,r){return(t,e)=>{var i=null!=(i=null==s?void 0:s[t])?i:null;return null==i?null!=e?e:null:null==e||(0,a.Me)(i,e)?(null!=r&&r(t),i):(o.Log.warn(`Parameter type mismatch. '${n}.${t}' was found to be type '${typeof i}' but fallback/return type is '${typeof e}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=e?e:null)}}e.Ee=function(t,e,i){return $P($P({},s(t,e,i,!0===(null==i?void 0:i.value))),{idType:null!=(t=null==i?void 0:i.id_type)?t:null})},e.De=n,e.Ie=function(t,e,i){return t=n(t,e,i),$P($P({},t),{groupName:null!=(e=null==i?void 0:i.group_name)?e:null})},e.ke=function(t,e,i,n){return $P($P({},s(t,e,i,void 0)),{get:r(t,null==i?void 0:i.value,n),groupName:null!=(e=null==i?void 0:i.group_name)?e:null,__value:null!=(t=null==i?void 0:i.value)?t:{}})},e.Te=function(t,e,i,n){return $P($P($P({},t),e),{get:r(t.name,i,n)})},e.we=r},1812:(t,e)=>{$Q(e)},3932:(t,e)=>{$Q(e),e.UPDATE_DETAIL_ERROR_MESSAGES=e.createUpdateDetails=void 0;e.createUpdateDetails=(t,e,i,n,s,r)=>({duration:i,source:e,success:t,error:n,sourceUrl:s,warnings:r}),e.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."}},8578:(t,e,i)=>{$Q(e),e.v=e.T=void 0;const n=i(1406),s=i(7512);e.T=function(t,e,i){try{var n=JSON.parse(JSON.stringify(t));return null!=e&&null!=e.environment?n.statsigEnvironment=e.environment:null!=i&&(n.statsigEnvironment={tier:i}),n}catch(t){return s.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},e.v=function(t){return t?(0,n.Kt)(t):null}},4534:(t,i,e)=>{$Q2(i,"__esModule",{value:!0}),i.L=i.G=i.Storage=void 0;var n=e(7512),e=e(6830);const s={},r={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:t=>s[t]||null,setItem:(t,e)=>{s[t]=e},removeItem:t=>{delete s[t]},getAllKeys:()=>Object.keys(s)};let o=null;try{const c=(0,e.te)();c&&c.localStorage&&"function"==typeof c.localStorage.getItem&&(o={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>c.localStorage.getItem(t),setItem:(t,e)=>c.localStorage.setItem(t,e),removeItem:t=>c.localStorage.removeItem(t),getAllKeys:()=>Object.keys(c.localStorage)})}catch(t){n.Log.warn("Failed to setup localStorageProvider.")}let a=null!==o&&void 0!==o?o:r,l=a;function u(e){try{return e()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return i.Storage.ge(r),null;throw t instanceof Error&&"QuotaExceededError"===t.name&&(e=i.Storage.getAllKeys().filter(t=>t.startsWith("statsig.")),t.message=t.message+". Statsig Keys: "+e.length),t}}i.Storage={isReady:()=>l.isReady(),isReadyResolver:()=>l.isReadyResolver(),getProviderName:()=>l.getProviderName(),getItem:t=>u(()=>l.getItem(t)),setItem:(t,e)=>u(()=>l.setItem(t,e)),removeItem:t=>l.removeItem(t),getAllKeys:()=>l.getAllKeys(),ge:t=>{a=t,l=t},_e:t=>{l=t?r:a}},i.G=function(t){return t=i.Storage.getItem(t),JSON.parse(null!=t?t:"null")},i.L=function(t,e){i.Storage.setItem(t,JSON.stringify(e))}},3401:(t,e,i)=>{$Q(e),e.P=void 0;const s=i(7512);e.P=function(t,e,i){try{var n=JSON.parse(t);if(n&&"object"==typeof n&&e in n)return n}catch(t){}return s.Log.error("Failed to parse "+i),null}},6634:(t,e)=>{$Q(e),e.Me=e.zt=void 0,e.zt=function(t){return Array.isArray(t)?"array":typeof t},e.Me=function(t,e){var i=t=>Array.isArray(t)?"array":null===t?"null":typeof t;return i(t)===i(e)}},8023:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let i=(new Date).getTime(),n="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0<i?(e=(i+e)%16|0,i=Math.floor(i/16)):(e=(n+e)%16|0,n=Math.floor(n/16)),("x"===t?e:7&e|8).toString(16)})}},1881:(t,e,i)=>{$Q(e),e.UrlConfiguration=void 0;const n=i(1406),s=i(7410),r={[s.Endpoint.qt]:"i",[s.Endpoint.jt]:"e",[s.Endpoint.Bt]:"d"};e.UrlConfiguration=class{constructor(t,e,i,n){this.customUrl=null,this.fallbackUrls=null,this.endpoint=t,this.endpointDnsKey=r[t],e&&(this.customUrl=e),!e&&i&&(this.customUrl=i.endsWith("/")?""+i+t:i+"/"+t),n&&(this.fallbackUrls=n);e=s.NetworkDefault[t];this.defaultUrl=e+"/"+t}getUrl(){var t;return null!=(t=this.customUrl)?t:this.defaultUrl}getChecksum(){var t=(null!=(t=this.fallbackUrls)?t:[]).sort().join(",");return(0,n.h)(this.customUrl+t)}}},2397:(t,e,i)=>{$Q(e),e.Ae=e.It=e.Rt=e.xe=void 0;i=i(6830);const n="foreground",s="background",r=[];let o=n,a=!1;e.xe=()=>o===n,e.Rt=()=>a,e.It=t=>{r.unshift(t)};e.Ae=e=>{e!==o&&(o=e,r.forEach(t=>t(e)))},(0,i.he)("focus",()=>{(a=!1,e.Ae)(n)}),(0,i.he)("blur",()=>(0,e.Ae)(s)),(0,i.ce)("visibilitychange",()=>{(0,e.Ae)("visible"===document.visibilityState?n:s)}),(0,i.he)((0,i.Hn)(),()=>{a=!0,(0,e.Ae)(s)})},6914:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)},r=($Q(e),e.Storage=e.Log=e.EventLogger=e.Diagnostics=void 0,i(1845),i(1845));const o=i(8962),a=($Q2(e,"Diagnostics",{enumerable:!0,get:function(){return o.Diagnostics}}),i(7770)),l=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return a.EventLogger}}),i(7512));$Q2(e,"Log",{enumerable:!0,get:function(){return l.Log}});var u=i(8e3);const c=i(4534);$Q2(e,"Storage",{enumerable:!0,get:function(){return c.Storage}}),s(i(1845),e),s(i(2137),e),s(i(6427),e),s(i(694),e),s(i(8962),e),s(i(3539),e),s(i(5542),e),s(i(2922),e),s(i(2417),e),s(i(1406),e),s(i(1333),e),s(i(7512),e),s(i(7787),e),s(i(7410),e),s(i(7023),e),s(i(1405),e),s(i(1361),e),s(i(6830),e),s(i(5902),e),s(i(4143),e),s(i(2176),e),s(i(9122),e),s(i(1375),e),s(i(2636),e),s(i(3206),e),s(i(1637),e),s(i(8e3),e),s(i(586),e),s(i(1098),e),s(i(2059),e),s(i(1812),e),s(i(8578),e),s(i(4534),e),s(i(3401),e),s(i(6634),e),s(i(1881),e),s(i(8023),e),s(i(2397),e),s(i(3932),e),s(i(3091),e),$P((0,r.l)(),{Log:l.Log,SDK_VERSION:u.SDK_VERSION})},2016:(t,e,i)=>{$Q(e),e.AutoInit=void 0;const y=i(6914),b=i(2018);function I(t,e){var i;return null!=(i=e.get(t))?i:e.get(t.toLowerCase())}e.AutoInit=class{static attempt(e){var t,i,n,s,r;try{var o=(0,y.te)(),a=(0,y.de)();if(o&&a&&a.currentScript){var l=a.currentScript.getAttribute("src"),u=null==(t=o.location)?void 0:t.href;if(l&&u){var c=new URL(l,u).searchParams,h=null!=(i=I("sdkKey",c))?i:I("apiKey",c);if(h){var d={},v=I("proxy",c),f=(v&&(d.networkConfig={api:v}),null==(s=null==(n=(0,y.l)())?void 0:n.instances)?void 0:s[h]);let t=null;if(t=f instanceof b.StatsigClient?f:t)e({sdkKey:h,client:t});else{var m=a.currentScript.dataset;const p=function(t,e){if(t)if(t in e&&"function"==typeof e[t])return e[t];return null}(null!=(r=m.onstatsiginit)?r:m.onStatsigInit,o),g=new b.StatsigClient(h,function(){var t=(0,y.te)();if(!t)return{};let e=t.statsigUser||{};var i=(e="object"!=typeof e?{}:e).custom||{},n=e.customIDs||{};return $P($P({},e),{customIDs:$P({},n),custom:$P($P({},i),{useragent:t.navigator.userAgent,page_url:(0,y.Gt)()||"",language:null==(n=t.navigator)?void 0:n.language})})}(),d);g.initializeAsync().then(()=>{p&&p(g)}).catch(t=>{y.Log.error(t)}),e({sdkKey:h,client:g})}}}}}catch(t){y.Log.error("AutoInit failed",t)}}}},2043:function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=($Q(e),n(i(2018)));const s=i(3447);i=i(2016);e.default=n.default,i.AutoInit.attempt(({client:t})=>{new s.SessionReplay(t)})},7262:(t,e,i)=>{$Q(e),e.Ne=void 0;const n=i(6914);function s(t,e){null!=t&&t.forEach(t=>{delete e[t]})}e.Ne=function(t,e){var i;return(e=(0,n.P)(e,"checksum","DeltasEvaluationResponse"))?(t=t,i=e,t=$P($P($P({},t),i),{feature_gates:$P($P({},t.feature_gates),i.feature_gates),layer_configs:$P($P({},t.layer_configs),i.layer_configs),dynamic_configs:$P($P({},t.dynamic_configs),i.dynamic_configs)}),s((t=i=t).deleted_gates,t.feature_gates),delete t.deleted_gates,s(i.deleted_configs,t.dynamic_configs),delete t.deleted_configs,s(i.deleted_layers,t.layer_configs),delete t.deleted_layers,i=t,(t=(0,n.Kt)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs},2))===e.checksumV2?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:t,badMergedConfigs:i,badFullResponse:e.deltas_full_response}):{hadBadDeltaChecksum:!0}}},4845:(t,e,i)=>{$Q(e);const s=i(6914);e.default=class{constructor(t){this.O=t,this.Re=null,this.Pe=null,this.Ce="Uninitialized",this.Ue=0,this.Fe=0,this.Ge=null,this.Le=new Set}reset(){this.Pe=null,this.Re=null,this.Ce="Loading",this.Ue=0,this.Fe=0,this.Ge=null,this.Le.clear()}finalize(){this.Pe||(this.Ce="NoValues")}getValues(){return this.Re?(0,s.P)(this.Re,"has_updates","EvaluationStoreValues"):null}setValues(t,e){var i;return!!t&&null!=(i=(0,s.P)(t.data,"has_updates","EvaluationResponse"))&&(this.Ce=t.source,!0===(null==i?void 0:i.has_updates)&&(this.Re=t.data,this.Ue=i.time,this.Fe=t.receivedAt,this.Pe=i,this.Ge=this.Ke(t.source,i),t.source&&i.user&&this.ze(e,i),s.SDKFlags.setFlags(this.O,null!=(t=i.sdk_flags)?t:{})),!0)}getWarnings(){if(0!==this.Le.size)return Array.from(this.Le)}getGate(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.feature_gates,t)}getConfig(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.dynamic_configs,t)}getConfigList(){var t;return null!=(t=this.Pe)&&t.dynamic_configs?Object.values(this.Pe.dynamic_configs).map(t=>t.name):[]}getLayer(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.layer_configs,t)}getParamStore(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.param_stores,t)}getSource(){return this.Ce}getExposureMapping(){var t;return null==(t=this.Pe)?void 0:t.exposures}Ke(t,e){return"Bootstrap"!==t?null:(t={},e.user&&(t.user=e.user),e.sdkInfo&&(t.generatorSDKInfo=e.sdkInfo),t.lcut=e.time,t)}qe(t,e){let i=null;return{result:i=t?t[e]||t[(0,s.h)(e)]:i,details:this.Be(null==i)}}ze(t,e){var i,n=s.StableID.get(this.O);(null==(i=t.customIDs)?void 0:i.stableID)!==n&&(null!=(i=t.customIDs)&&i.stableID||n)?this.Le.add("StableIDMismatch"):"user"in e&&(i=e.user,n=$P($P({},t),{analyticsOnlyMetadata:void 0,privateAttributes:void 0}),(0,s.v)(n)!==(0,s.v)(i))&&this.Le.add("PartialUserMatch")}getCurrentSourceDetails(){var t;return"Uninitialized"===this.Ce||"NoValues"===this.Ce?{reason:this.Ce}:(t={reason:this.Ce,lcut:this.Ue,receivedAt:this.Fe},0<this.Le.size&&(t.warnings=Array.from(this.Le)),t)}Be(t){var e=this.getCurrentSourceDetails();let i=e.reason;var n=null!=(n=e.warnings)?n:[],t=("Bootstrap"===this.Ce&&0<n.length&&(i+=n[0]),"Uninitialized"!==i&&"NoValues"!==i&&(i=i+":"+(t?"Unrecognized":"Recognized")),"Bootstrap"===this.Ce&&null!=(n=this.Ge)?n:void 0);return t&&(e.bootstrapMetadata=t),$P($P({},e),{reason:i})}}},8448:function(t,e,i){var l=this&&this.__awaiter||$A();$Q(e);const u=i(6914),o=i(7262);class n extends u.NetworkCore{constructor(t,e){super(t,e);e=null==t?void 0:t.networkConfig;this.Fi=t,this.Ve=new u.UrlConfiguration(u.Endpoint.qt,null==e?void 0:e.initializeUrl,null==e?void 0:e.api,null==e?void 0:e.initializeFallbackUrls)}fetchEvaluations(n,s,r,o,a){return l(this,void 0,void 0,function*(){var t,e=s?(0,u.P)(s,"has_updates","InitializeResponse"):null;let i={user:o,hash:null!=(t=null==(t=null==(t=this.Fi)?void 0:t.networkConfig)?void 0:t.initializeHashAlgorithm)?t:"djb2",deltasResponseRequested:!1,full_checksum:null};return null!=e&&e.has_updates&&(t=(null==e?void 0:e.hash_used)!==(null!=(t=null==(t=null==(t=this.Fi)?void 0:t.networkConfig)?void 0:t.initializeHashAlgorithm)?t:"djb2"),i=$P($P({},i),{sinceTime:a&&!t?e.time:0,previousDerivedFields:"derived_fields"in e&&a?e.derived_fields:{},deltasResponseRequested:!0,full_checksum:e.full_checksum,partialUserMatchSinceTime:t?0:e.time})),this.Je(n,e,i,r)})}Je(i,n,s,r){return l(this,void 0,void 0,function*(){var t,e=yield this.post({sdkKey:i,urlConfig:this.Ve,data:s,retries:2,isStatsigEncodable:!0,priority:r});return 204===(null==e?void 0:e.code)?'{"has_updates": false}':200!==(null==e?void 0:e.code)?null!=(t=null==e?void 0:e.body)?t:null:!0!==(null==n?void 0:n.has_updates)||!0!==(null==(t=e.body)?void 0:t.includes('"is_delta":true'))||!0!==s.deltasResponseRequested?e.body:"string"==typeof(t=(0,o.Ne)(n,e.body))?t:this.Je(i,n,$P($P($P({},s),t),{deltasResponseRequested:!1}),r)})}}e.default=n},3583:(t,e,i)=>{$Q(e),e.$e=void 0;const d=i(6914),v={disableExposureLog:!0};function f(t){return null==t||!1===t.disableExposureLog}function m(t,e){return null!=e&&!(0,d.Me)(t,e)}e.$e=function(u,c,h){return(t,e)=>{if(null==c)return e;var i,n,s,r,o,a,l=c[t];if(null==l||null!=e&&(0,d.zt)(e)!==l.param_type)return e;switch(l.ref_type){case"static":return l.value;case"gate":return a=l,u.getFeatureGate(a.gate_name,f(h)?void 0:v).value?a.pass_value:a.fail_value;case"dynamic_config":return a=l,o=e,m(r=(r=u).getDynamicConfig(a.config_name,f(h)?void 0:v).get(a.param_name),o)?o:r;case"experiment":return o=l,r=e,m(s=(s=u).getExperiment(o.experiment_name,f(h)?void 0:v).get(o.param_name),r)?r:s;case"layer":return s=l,n=e,m(i=(i=u).getLayer(s.layer_name,f(h)?void 0:v).get(s.param_name),n)?n:i;default:return e}}}},8198:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e);const o=i(6914),a=i(4845),l=i(8448),s=i(3583),u=i(4131);class n extends o.StatsigClientBase{static instance(t){var e=(0,o.l)().instance(t);return e instanceof n?e:(o.Log.warn((0,o.kt)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new n(null!=t?t:"",{}))}constructor(t,e,i=null){o.SDKType.ue(t,"javascript-client");var n,s=new l.default(i,t=>{this.$emt(t)}),t=(super(t,null!=(n=null==i?void 0:i.dataAdapter)?n:new u.StatsigEvaluationsDataAdapter,s,i),this.ar={},this.getFeatureGate=this.wi(o.MemoPrefix.Kn,this.Ti.bind(this)),this.getDynamicConfig=this.wi(o.MemoPrefix.Ln,this.Ii.bind(this)),this.getExperiment=this.wi(o.MemoPrefix.Vn,this.ki.bind(this)),this.getConfigList=this.wi(o.MemoPrefix.Ts,this.xs.bind(this)),this.getLayer=this.wi(o.MemoPrefix.$n,this.Di.bind(this)),this.getParameterStore=this.wi(o.MemoPrefix.Bn,this.Ri.bind(this)),this.We=new a.default(t),this.ht=s,this.He=this.xi(e,i),this.js=(0,o.getUUID)(),null!=(n=null==i?void 0:i.plugins)?n:[]);for(const r of t)r.bind(this)}initializeSync(t){var e;return"Uninitialized"!==this.loadingStatus?(0,o.createUpdateDetails)(!0,this.We.getSource(),-1,null,null,["MultipleInitializations",...null!=(e=this.We.getWarnings())?e:[]]):(this.pe.start(),this.updateUserSync(this.He,t))}initializeAsync(t){return r(this,void 0,void 0,function*(){return this.ve||(this.ve=this.Ye(t)),this.ve})}updateUserSync(e,t){var i=performance.now();try{return this.zi(e,t,i)}catch(t){e=t instanceof Error?t:new Error(String(t));return this.Ki(e,i)}}zi(t,e,i){var n=[...null!=(n=this.We.getWarnings())?n:[]],t=(this.Xe(t),this.dataAdapter.getDataSync(this.He)),e=(null==t&&n.push("NoCachedValues"),this.We.setValues(t,this.He),this.Qe(t),null==e?void 0:e.disableBackgroundCacheRefresh);return!0===e||null==e&&"Bootstrap"===(null==t?void 0:t.source)||this.Ze(null!=t?t:null,this.He),(0,o.createUpdateDetails)(!0,this.We.getSource(),performance.now()-i,this.$t.getLastSeenErrorAndReset(),this.ht.getLastUsedInitUrlAndReset(),n)}updateUserAsync(t,n){return r(this,void 0,void 0,function*(){var e=performance.now();try{return yield this.qi(t,n)}catch(t){var i=t instanceof Error?t:new Error(String(t));return this.Ki(i,e)}})}qi(n,s){return r(this,void 0,void 0,function*(){this.Xe(n);var t=this.He,e=(o.Diagnostics.B(this.O),this.dataAdapter.getDataSync(t));if(this.We.setValues(e,this.He),this.me("Loading",e),e=yield this.dataAdapter.getDataAsync(e,t,s),t!==this.He)return(0,o.createUpdateDetails)(!1,this.We.getSource(),-1,new Error("User changed during update"),this.ht.getLastUsedInitUrlAndReset());let i=!1;null!=e&&(o.Diagnostics.W(this.O),i=this.We.setValues(e,this.He),o.Diagnostics.H(this.O,{success:i})),this.Qe(e),i||(this.$t.attachErrorIfNoneExists(o.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),o.Diagnostics.V(this.O,i,this.We.getCurrentSourceDetails());t=o.Diagnostics.tt(this.He,this.pe,this.O,this.m);return(0,o.createUpdateDetails)(i,this.We.getSource(),t,this.$t.getLastSeenErrorAndReset(),this.ht.getLastUsedInitUrlAndReset(),this.We.getWarnings())})}getContext(){return{sdkKey:this.O,options:this.m,values:this.We.getValues(),user:JSON.parse(JSON.stringify(this.He)),errorBoundary:this.$t,session:o.StatsigSession.get(this.O),stableID:o.StableID.get(this.O),sdkInstanceID:this.js}}checkGate(t,e){return this.getFeatureGate(t,e).value}logEvent(t,e,i){e="string"==typeof t?{eventName:t,value:e,metadata:i}:t;this.$emt({name:"log_event_called",event:e}),this.pe.enqueue($P($P({},e),{user:this.He,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(t){this.He=this.xi($P($P({},this.He),{analyticsOnlyMetadata:t}),this.m)}be(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Qe(null)})}Ye(t){return r(this,void 0,void 0,function*(){return o.Storage.isReady()||(yield o.Storage.isReadyResolver()),this.pe.start(),this.updateUserAsync(this.He,t)})}Ki(t,e){return(0,o.createUpdateDetails)(!1,this.We.getSource(),performance.now()-e,t,null,[...null!=(e=this.We.getWarnings())?e:[]])}Qe(t){this.We.finalize(),this.me("Ready",t)}Ze(t,e){this.dataAdapter.getDataAsync(t,e,{priority:"low"}).catch(t=>{o.Log.error("An error occurred after update.",t)})}Xe(t){this.pe.reset(),this.We.reset(),this.He=this.xi(t,this.m)}xi(t,e){t=(0,o.T)(t,e),e=null==(e=t.customIDs)?void 0:e.stableID;return e&&o.StableID.setOverride(e,this.O),t.analyticsOnlyMetadata=$P($P({},t.analyticsOnlyMetadata),this.ar),t}Ti(t,e){var{result:i,details:n}=this.We.getGate(t),n=(0,o.Ee)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getGateOverride)?void 0:s.call(i,n,this.He,e),i=null!=s?s:n;return this.ye(t,(0,o.Se)(this.He,i,this.We.getExposureMapping()),e),this.$emt({name:"gate_evaluation",gate:i}),i}Ii(t,e){var{result:i,details:n}=this.We.getConfig(t),n=(0,o.De)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,n,this.He,e),i=null!=s?s:n;return this.ye(t,(0,o.je)(this.He,i,this.We.getExposureMapping()),e),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}ki(t,e){var{result:i,details:n}=this.We.getConfig(t),n=(0,o.Ie)(t,n,i),s=(null!=n.__evaluation&&(n.__evaluation.secondary_exposures=(0,o.Ui)(null!=(i=null==(i=n.__evaluation)?void 0:i.secondary_exposures)?i:[],this.We.getExposureMapping())),null==(s=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:s.call(i,n,this.He,e)),i=null!=s?s:n;return this.ye(t,(0,o.je)(this.He,i,this.We.getExposureMapping()),e),this.$emt({name:"experiment_evaluation",experiment:i}),i}xs(){return this.We.getConfigList()}Di(e,i){var{result:t,details:n}=this.We.getLayer(e),n=(0,o.ke)(e,n,t),s=null==(s=null==(t=this.overrideAdapter)?void 0:t.getLayerOverride)?void 0:s.call(t,n,this.He,i);null!=i&&i.disableExposureLog&&this.pe.incrementNonExposureCount(e);const r=(0,o.Te)(n,s,null!=(t=null==s?void 0:s.__value)?t:n.__value,t=>{null!=i&&i.disableExposureLog||this.ye(e,(0,o.Oe)(this.He,r,t,this.We.getExposureMapping()),i)});return this.$emt({name:"layer_evaluation",layer:r}),r}Ri(t,e){var{result:i,details:n}=this.We.getParamStore(t),t=(this.pe.incrementNonExposureCount(t),{name:t,details:n,__configuration:i,get:(0,s.$e)(this,i,e)}),i=null==(i=null==(n=this.overrideAdapter)?void 0:n.getParamStoreOverride)?void 0:i.call(n,t,e);return null!=i&&(t.__configuration=i.config,t.details=i.details,t.get=(0,s.$e)(this,i.config,e)),t}}e.default=n},4131:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigEvaluationsDataAdapter=void 0;const n=i(6914),s=i(8448);class o extends n.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this.ht=null,this.m=null}attach(t,e,i){super.attach(t,e,i),null!==i&&i instanceof s.default?this.ht=i:this.ht=new s.default(null!=e?e:{})}getDataAsync(t,e,i){return this.D(t,(0,n.T)(e,this.m),i)}prefetchData(t,e){return this.A(t,e)}setData(t){var e=(0,n.P)(t,"has_updates","data");e&&"user"in e?super.setData(t,e.user):n.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(t,e){super.setData(t,e)}R(e,i,n,s){return r(this,void 0,void 0,function*(){var t=yield null==(t=this.ht)?void 0:t.fetchEvaluations(this.C(),e,null==n?void 0:n.priority,i,s);return null!=t?t:null})}k(t){t=(0,n.o)(this.C(),t,null==(t=this.m)?void 0:t.customUserCacheKeyFunc);return`${n.DataAdapterCachePrefix}.${this.p}.`+t}N(t,e){return null!=t.fullUserHash&&t.fullUserHash===(0,n.v)(e)}}e.StatsigEvaluationsDataAdapter=o},2018:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)},r=($Q(e),e.StatsigClient=void 0,i(6914)),o=i(8198),s=(e.StatsigClient=o.default,s(i(6914),e),$P((0,r.l)(),{StatsigClient:o.default}));e.default=s},8788:(t,e,i)=>{$Q(e),e.SessionReplay=e.runStatsigSessionReplay=e.StatsigSessionReplayPlugin=void 0;const n=i(6914);var s=i(4069);const r=i(5967);function o(t,e){new a(t,e)}e.StatsigSessionReplayPlugin=class{constructor(t){this.options=t,this.__plugin="session-replay"}bind(t){o(t,this.options)}},e.runStatsigSessionReplay=o;class a extends s.SessionReplayBase{constructor(t,e){super(t,e),this.tn.$on("values_updated",()=>{var t;this.ts||this.li(null==(t=this.m)?void 0:t.forceRecording)}),this.li(null==(t=this.m)?void 0:t.forceRecording)}ri(t){super.es(t)}li(t=!1){var e;this.ns>=r.MAX_LOGS||(!0===(null==(e=this.tn.getContext().values)?void 0:e.recording_blocked)||!t&&!0!==(null==e?void 0:e.can_record_session)||!1===(null==e?void 0:e.passes_session_recording_targeting)?this.ri():this.si.isRecording()||(this.ts=!1,n.StatsigMetadataProvider.add({isRecordingSession:"true"}),this.si.record((t,e)=>this.ci(t,e),null!=(e=null==(t=this.m)?void 0:t.rrwebConfig)?e:{},()=>{this.ri()})))}}e.SessionReplay=a},4069:(t,e,i)=>{$Q(e),e.SessionReplayBase=e.forceStartRecording=e.startRecording=e.stopRecording=void 0;const u=i(6914),n=i(759),c=i(5967);function s(t){var e=null==t?(0,u.l)().firstSRInstance:null==(e=null==(e=(0,u.l)())?void 0:e.srInstances)?void 0:e[t];return e instanceof r?e:null}e.stopRecording=function(t){null!=(t=s(t))&&t.stopRecording()},e.startRecording=function(t){null!=(t=s(t))&&t.startRecording()},e.forceStartRecording=function(t){null!=(t=s(t))&&t.forceStartRecording()};class r{constructor(t,e){this.ti={startTime:-1,endTime:0,clickCount:0},this.ei=[],this.ts=!1,this.ss=0,this.ns=0,this.tn=t,this.m=e;var{sdkKey:t,errorBoundary:e}=this.tn.getContext();this.$t=e,this.$t.wrap(this),this.si=new n.SessionReplayClient,this.tn.$on("pre_shutdown",()=>this.ri()),this.tn.on("session_expired",()=>{this.ri("session_expired")}),(0,u.kt)()||((e=(0,u.l)()).srInstances=$P($P({},e.srInstances),{[t]:this}),e.firstSRInstance)||(e.firstSRInstance=this),this.ii=this.ni(),this.ui()}forceStartRecording(){this.ts=!1,this.li(!0)}stopRecording(){this.ts=!0,this.ri()}startRecording(){var t;this.ts=!1,this.li(null==(t=this.m)?void 0:t.forceRecording)}isRecording(){return this.si.isRecording()}oi(t){0!==this.ei.length&&(t=(0,u.Rt)()?"is_leaving_page":t,this.vi(this.ii,t))}ai(t){"background"===t&&(this.oi(),this.tn.flush().catch(t=>{this.$t.logError("SR::visibility",t)}))}ui(){const i=this.tn.getContext()["sdkKey"];(0,u.It)(t=>{var e=null==(e=null==(e=(0,u.l)())?void 0:e.srInstances)?void 0:e[i];e instanceof r&&e.ai(t)})}vi(e,i){var n=this.ti;if(0!==this.ei.length){var s=JSON.stringify(this.ei),r=(0,c.rs)(s),o=1<r.length?(0,u.getUUID)():null;for(let t=0;t<r.length;t++){var a=r[t],l=(0,c.ls)(a,s,e,n,this.tn.getContext().sdkInstanceID);null!=o&&(0,c.os)(l.metadata,o,t,r.length,a.length),i&&(l.metadata[i]="true"),this.ns++,this.tn.logEvent(l),null!=o&&this.tn.flush().catch(t=>{u.Log.error(t)})}this.ei=[],this.ns>c.MAX_LOGS&&this.ri()}}di(){this.ni(),this.oi()}ni(){return this.tn.getContext().session.data.sessionID}es(t){this.si.isRecording()&&(this.si.stop(),u.StatsigMetadataProvider.add({isRecordingSession:"false"})),0!==this.ei.length&&this.oi(t),"session_expired"===t&&(this.ss=0,this.ti=this.us())}us(){return{startTime:-1,endTime:0,clickCount:0}}ci(t,e){var i;this.ii!==this.ni()?this.ri("session_expired"):this.ns>=c.MAX_LOGS?this.ri():(t.eventIndex=this.ss++,this.ti.clickCount+=e.clickCount,this.ti.startTime=-1===this.ti.startTime?e.startTime:Math.min(this.ti.startTime,e.startTime),this.ti.endTime=Math.max(this.ti.endTime,e.endTime),(e=(0,u.hi)(t,c.MAX_INDIVIDUAL_EVENT_BYTES))>c.MAX_INDIVIDUAL_EVENT_BYTES?u.Log.warn(`SessionReplay event is too large (~${e} bytes) and will not be logged`,t):(i=(0,u.hi)(this.ei,c.REPLAY_ENQUEUE_TRIGGER_BYTES),this.ei.push(t),i+e<c.REPLAY_ENQUEUE_TRIGGER_BYTES||((0,u.xe)()?this.di():this.oi())))}}e.SessionReplayBase=r},759:(t,e,i)=>{$Q(e),e.SessionReplayClient=void 0;const n=i(670),o=i(6914);e.SessionReplayClient=class{constructor(){this.fi=null,this._i=null}record(s,t,e,r=!1){null==(0,o.de)()||(this.fi=null,this._i=null,this.bi=e,this.pi)||(this.pi=(e=(t,e)=>{var i;r?this.fi=!e&&null!=(i=this.fi)?i:t.timestamp:null==this.fi&&(this.fi=t.timestamp),this._i=t.timestamp;let n=0;3!==(i=t).type||2!==i.data.source||2!==i.data.type&&4!==i.data.type||n++,s($P($P({},t),{eventIndex:0}),{startTime:this.fi,endTime:this._i,clickCount:n},null!=e&&e),144e5<this._i-this.fi&&(null!=(t=this.pi)&&t.call(this),this.bi)&&this.bi()},t=t,r?(0,n.record)($P($P({},t),{emit:e,checkoutEveryNms:3e4})):(0,n.record)($P($P({},t),{emit:e}))))}stop(){this.pi&&(this.pi(),this.pi=void 0)}isRecording(){return null!=this.pi}}},5967:(t,e,i)=>{$Q(e),e.os=e.rs=e.ls=e.MAX_LOGS=e.MAX_INDIVIDUAL_EVENT_BYTES=e.REPLAY_ENQUEUE_TRIGGER_BYTES=void 0;const r=i(6914);e.REPLAY_ENQUEUE_TRIGGER_BYTES=10240,e.MAX_INDIVIDUAL_EVENT_BYTES=10485760,e.MAX_LOGS=1e4,e.ls=function(t,e,i,n,s){return{eventName:"statsig::session_recording",value:i,metadata:{session_start_ts:String(n.startTime),session_end_ts:String(n.endTime),clicks_captured_cumulative:String(n.clickCount),rrweb_events:t,rrweb_payload_size:String(e.length),session_replay_sdk_version:r.SDK_VERSION,sdk_instance_id:s}}},e.rs=function(e){var i=[];for(let t=0;t<e.length;t+=1048576)i.push(e.slice(t,t+1048576));return i},e.os=function(t,e,i,n,s){t.sliced_id=e,t.slice_index=String(i),t.slice_count=String(n),t.slice_byte_size=String(s)}},3691:(t,e,i)=>{$Q(e),e.TriggeredSessionReplay=e.runStatsigTriggeredSessionReplay=e.StatsigTriggeredSessionReplayPlugin=void 0;const s=i(6914);var n=i(4069);const r=i(5967);function o(t,e){new a(t,e)}e.StatsigTriggeredSessionReplayPlugin=class{constructor(t){this.options=t,this.__plugin="triggered-session-replay"}bind(t){o(t,this.options)}},e.runStatsigTriggeredSessionReplay=o;class a extends n.SessionReplayBase{constructor(t,e){super(t,e),this.cs=[],this.hs=!1,this.ds(e),null!=e&&e.autoStartRecording?this.li(null==(t=this.m)?void 0:t.forceRecording):null!=e&&e.keepRollingWindow&&this.vs()}ds(t){this.fs(t),this.gs(),this._s(),this.ps()}fs(e){this.tn.$on("values_updated",()=>{var t;this.ts||(null!=e&&e.autoStartRecording?this.li(null==(t=this.m)?void 0:t.forceRecording):null!=e&&e.keepRollingWindow&&this.vs())})}gs(){this.tn.$on("log_event_called",t=>{var e;this.ts||!1===(null==(e=this.tn.getContext().values)?void 0:e.passes_session_recording_targeting)||null==(null==e?void 0:e.session_recording_event_triggers)||null==(e=e.session_recording_event_triggers[t.event.eventName])||!1===e.passes_sampling||null!=(e=e.values)&&!e.includes(String(null!=(e=t.event.value)?e:""))||this.li(!0)})}_s(){this.tn.$on("gate_evaluation",t=>{this.bs(t.gate.name,String(t.gate.value))})}ps(){this.tn.$on("experiment_evaluation",t=>{this.bs(t.experiment.name,null!=(t=t.experiment.groupName)?t:"")})}bs(t,e){var i,n;this.ts||!1===(null==(n=this.tn.getContext().values)?void 0:n.passes_session_recording_targeting)||null==(null==n?void 0:n.session_recording_exposure_triggers)||null==(i=null!=(i=n.session_recording_exposure_triggers[t])?i:n.session_recording_exposure_triggers[(0,s.h)(t)])||!1===i.passes_sampling||null!=(n=i.values)&&!n.includes(e)||this.li(!0)}forceStartRecording(){super.forceStartRecording()}stopRecording(){this.hs=!1,this.cs=[],super.stopRecording()}ys(){if(this.hs=!0,0!==this.cs.length){var e=this.cs.map(t=>t.events).flat();for(let t=0;t<e.length;t++)e[t].event.eventIndex=t,this.ti.clickCount+=e[t].data.clickCount,this.ti.startTime=-1===this.ti.startTime?e[t].data.startTime:Math.min(this.ti.startTime,e[t].data.startTime),this.ti.endTime=Math.max(this.ti.endTime,e[t].data.endTime);this.ei=e.map(t=>t.event),this.ss=e.length,(0,s.xe)()?this.di():this.oi(),this.si.stop()}}ri(t){this.hs=!1,this.cs=[],super.es(t)}ci(t,e,i){if(!this.hs)return this.ii!==this.ni()?void this.ri("session_expired"):void(i&&4===t.type||0===this.cs.length?(1<this.cs.length&&this.cs.shift(),this.cs.push({events:[{event:t,data:e}]})):this.cs[this.cs.length-1].events.push({event:t,data:e}));super.ci(t,e)}vs(){var t=this.tn.getContext().values;!1===(null==t?void 0:t.passes_session_recording_targeting)?this.ri():this.si.isRecording()||this.si.record((t,e,i)=>this.ci(t,e,i),null!=(t=null==(t=this.m)?void 0:t.rrwebConfig)?t:{},()=>{this.ri()},!0)}li(t=!1){var e;this.ns>=r.MAX_LOGS||(!0===(null==(e=this.tn.getContext().values)?void 0:e.recording_blocked)||!t&&!0!==(null==e?void 0:e.can_record_session)||!1===(null==e?void 0:e.passes_session_recording_targeting)?this.ri():(this.ys(),this.ts=!1,s.StatsigMetadataProvider.add({isRecordingSession:"true"}),this.si.isRecording()||this.si.record((t,e,i)=>this.ci(t,e,i),null!=(e=null==(t=this.m)?void 0:t.rrwebConfig)?e:{},()=>{this.ri()})))}}e.TriggeredSessionReplay=a},3447:(t,e,i)=>{$Q(e),e.forceStartRecording=e.stopRecording=e.startRecording=e.StatsigTriggeredSessionReplayPlugin=e.StatsigSessionReplayPlugin=e.runStatsigTriggeredSessionReplay=e.runStatsigSessionReplay=e.SessionReplay=e.SessionReplayClient=void 0;var n=i(6914);const s=i(8788),r=($Q2(e,"SessionReplay",{enumerable:!0,get:function(){return s.SessionReplay}}),$Q2(e,"StatsigSessionReplayPlugin",{enumerable:!0,get:function(){return s.StatsigSessionReplayPlugin}}),$Q2(e,"runStatsigSessionReplay",{enumerable:!0,get:function(){return s.runStatsigSessionReplay}}),i(4069)),o=($Q2(e,"forceStartRecording",{enumerable:!0,get:function(){return r.forceStartRecording}}),$Q2(e,"startRecording",{enumerable:!0,get:function(){return r.startRecording}}),$Q2(e,"stopRecording",{enumerable:!0,get:function(){return r.stopRecording}}),i(759)),a=($Q2(e,"SessionReplayClient",{enumerable:!0,get:function(){return o.SessionReplayClient}}),i(3691));$Q2(e,"StatsigTriggeredSessionReplayPlugin",{enumerable:!0,get:function(){return a.StatsigTriggeredSessionReplayPlugin}}),$Q2(e,"runStatsigTriggeredSessionReplay",{enumerable:!0,get:function(){return a.runStatsigTriggeredSessionReplay}}),$P((0,n.l)(),{SessionReplayClient:o.SessionReplayClient,SessionReplay:s.SessionReplay,runStatsigSessionReplay:s.runStatsigSessionReplay,runStatsigTriggeredSessionReplay:a.runStatsigTriggeredSessionReplay,StatsigSessionReplayPlugin:s.StatsigSessionReplayPlugin,StatsigTriggeredSessionReplayPlugin:a.StatsigTriggeredSessionReplayPlugin,startRecording:r.startRecording,stopRecording:r.stopRecording,forceStartRecording:r.forceStartRecording})},670:(e,i)=>{$Q2(i,Symbol.toStringTag,{value:"Module"});var s,u=Object.defineProperty,a=(t,e,i)=>{var n;return n=i,(e="symbol"!=typeof e?e+"":e)in(t=t)?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,i},c=Object.defineProperty,f=(t,e,i)=>{var n;return n=i,(e="symbol"!=typeof e?e+"":e)in(t=t)?c(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,i},J=(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))(J||{});function D(t){var e=null==t?void 0:t.host;return Boolean((null==e?void 0:e.shadowRoot)===t)}function N(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function X(t){try{var e=t.rules||t.cssRules;return e?i=(i=Array.from(e,m).join("")).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")?i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;"):i:null}catch(t){return null}var i}function m(t){let e;if("styleSheet"in t)try{e=X(t.styleSheet)||((n=(i=t).cssText).split('"').length<3?n:(n=["@import",`url(${JSON.stringify(i.href)})`],""===i.layerName?n.push("layer"):i.layerName&&n.push(`layer(${i.layerName})`),i.supportsText&&n.push(`supports(${i.supportsText})`),i.media.length&&n.push(i.media.mediaText),n.join(" ")+";"))}catch(t){}else if("selectorText"in t&&t.selectorText.includes(":"))return t.cssText.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2");var i,n;return e||t.cssText}class ct{constructor(){f(this,"idNodeMap",new Map),f(this,"nodeMetaMap",new WeakMap)}getId(t){return t?(null==(t=this.getMeta(t))?void 0:t.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var i=e.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);i&&(i=this.nodeMetaMap.get(i))&&this.nodeMetaMap.set(e,i),this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ht({element:t,maskInputOptions:e,tagName:i,type:n,value:s,maskInputFn:r}){let o=s||"";s=n&&H(n);return o=e[i.toLowerCase()]||s&&e[s]?r?r(o,t):"*".repeat(o.length):o}function H(t){return t.toLowerCase()}const dt="__rrweb_original__";function vt(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?H(e):null}function V(t,e){let i;try{i=new URL(t,e??window.location.href)}catch(t){return null}t=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==t?void 0:t[1])??null}let K=1;const ft=new RegExp("[^a-z0-9-_:]"),E=-2;function p(){return K++}let Q,mt;const g=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,y=/^(?:[a-z+]+:)?\/\//i,b=/^www\..*/i,I=/^(data:)([^,]*),(.*)/i;function $(t,l){return(t||"").replace(g,(t,e,i,n,s,r)=>{i=i||s||r,s=e||n||"";if(!i)return t;if(y.test(i)||b.test(i))return`url(${s}${i}${s})`;if(I.test(i))return`url(${s}${i}${s})`;if("/"===i[0])return`url(${s}${function(t){let e="";return e=(e=-1<t.indexOf("//")?t.split("/").slice(0,3).join("/"):t.split("/")[0]).split("?")[0]}(l)+i}${s})`;var o=l.split("/"),r=i.split("/");o.pop();for(const a of r)"."!==a&&(".."===a?o.pop():o.push(a));return`url(${s}${o.join("/")}${s})`})}const C=/^[^ \t\n\r\u000c]+/,S=/^[, \t\n\r\u000c]+/;function w(n,s){if(""===s.trim())return s;let r=0;function t(t){var t=t.exec(s.substring(r));return t?(t=t[0],r+=t.length,t):""}for(var o=[];t(S),!(r>=s.length);){let i=t(C);if(","===i.slice(-1))i=l(n,i.substring(0,i.length-1)),o.push(i);else{let t="",e=(i=l(n,i),!1);for(;;){var a=s.charAt(r);if(""===a){o.push((i+t).trim());break}if(e)")"===a&&(e=!1);else{if(","===a){r+=1,o.push((i+t).trim());break}"("===a&&(e=!0)}t+=a,r+=1}}}return o.join(", ")}const k=new WeakMap;function l(t,e){return e&&""!==e.trim()?q(t,e):e}function q(t,e){let i=k.get(t);if(i||(i=t.createElement("a"),k.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function pt(t,e,i,n){return n&&("src"!==i&&("href"!==i||"use"===e&&"#"===n[0])&&("xlink:href"!==i||"#"===n[0])&&("background"!==i||"table"!==e&&"td"!==e&&"th"!==e)?"srcset"===i?w(t,n):"style"===i?$(n,q(t)):"object"===e&&"data"===i?l(t,n):n:l(t,n))}function gt(t,e){return("video"===t||"audio"===t)&&"autoplay"===e}function r(e,i,t){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!t&&r(e.parentNode,i,t);for(let t=e.classList.length;t--;){var n=e.classList[t];if(i.test(n))return!0}return!!t&&r(e.parentNode,i,t)}function P(t,e,i,n){try{var s=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(null===s)return!1;if("string"==typeof e){if(n){if(s.closest("."+e))return!0}else if(s.classList.contains(e))return!0}else if(r(s,e,n))return!0;if(i)if(n){if(s.closest(i))return!0}else if(s.matches(i))return!0}catch(t){}return!1}function yt(i,t){var e,n,s,r,{doc:o,mirror:t,blockClass:a,blockSelector:l,needsMask:u,inlineStylesheet:E,maskInputOptions:L={},maskTextFn:G,maskInputFn:U,dataURLOptions:W={},inlineImages:B,recordCanvas:Y,keepIframeSrcFn:z,newlyAddedElement:Z=!1}=t,c=(e=o,!(t=t).hasNode(e)||1===(t=t.getId(e))?void 0:t);switch(i.nodeType){case i.DOCUMENT_NODE:return"CSS1Compat"!==i.compatMode?{type:J.Document,childNodes:[],compatMode:i.compatMode}:{type:J.Document,childNodes:[]};case i.DOCUMENT_TYPE_NODE:return{type:J.DocumentType,name:i.name,publicId:i.publicId,systemId:i.systemId,rootId:c};case i.ELEMENT_NODE:{var h=i;var d={doc:o,blockClass:a,blockSelector:l,inlineStylesheet:E,maskInputOptions:L,maskInputFn:U,dataURLOptions:W,inlineImages:B,recordCanvas:Y,keepIframeSrcFn:z,newlyAddedElement:Z,rootId:c};const{doc:y,blockClass:b,blockSelector:I,inlineStylesheet:C,maskInputOptions:S={},maskInputFn:w,dataURLOptions:k={},inlineImages:_,recordCanvas:O,keepIframeSrcFn:A,newlyAddedElement:M=!1,rootId:j}=d,T=function(e,i,t){try{if("string"==typeof i){if(e.classList.contains(i))return!0}else for(let t=e.classList.length;t--;){var n=e.classList[t];if(i.test(n))return!0}if(t)return e.matches(t)}catch(t){}return!1}(h,b,I),x=function(t){return t instanceof HTMLFormElement?"form":(t=H(t.tagName),ft.test(t)?"div":t)}(h);let e={};var V=h.attributes.length;for(let t=0;t<V;t++){var v=h.attributes[t];gt(x,v.name,v.value)||(e[v.name]=pt(y,x,H(v.name),v.value))}if("link"===x&&C){d=Array.from(y.styleSheets).find(t=>t.href===h.href);let t=null;(t=d?X(d):t)&&(delete e.rel,delete e.href,e.ws=$(t,d.href))}"style"===x&&h.sheet&&!(h.innerText||h.textContent||"").trim().length&&(d=X(h.sheet))&&(e.ws=$(d,q(y)));"input"!==x&&"textarea"!==x&&"select"!==x||(d=h.value,n=h.checked,"radio"!==e.type&&"checkbox"!==e.type&&"submit"!==e.type&&"button"!==e.type&&d?e.value=ht({element:h,type:vt(h),tagName:x,value:d,maskInputOptions:S,maskInputFn:w}):n&&(e.checked=n));"option"===x&&(h.selected&&!S.select?e.selected=!0:delete e.selected);"canvas"===x&&O&&("2d"===h.__context?function(i){var n=i.getContext("2d");if(n)for(let e=0;e<i.width;e+=50)for(let t=0;t<i.height;t+=50){var s=n.getImageData,s=dt in s?s[dt]:s;if(new Uint32Array(s.call(n,e,t,Math.min(50,i.width-e),Math.min(50,i.height-t)).data.buffer).some(t=>0!==t))return}return 1}(h)||(e.rr_dataURL=h.toDataURL(k.type,k.quality)):"__context"in h||(d=h.toDataURL(k.type,k.quality),(n=y.createElement("canvas")).width=h.width,n.height=h.height,s=n.toDataURL(k.type,k.quality),d!==s&&(e.rr_dataURL=d)));if("img"===x&&_){Q||(Q=y.createElement("canvas"),mt=Q.getContext("2d"));const R=h,F=R.currentSrc||R.getAttribute("src")||"<unknown-src>",D=R.crossOrigin,N=()=>{R.removeEventListener("load",N);try{Q.width=R.naturalWidth,Q.height=R.naturalHeight,mt.drawImage(R,0,0),e.rr_dataURL=Q.toDataURL(k.type,k.quality)}catch(t){if("anonymous"!==R.crossOrigin)return R.crossOrigin="anonymous",void(R.complete&&0!==R.naturalWidth?N():R.addEventListener("load",N));console.warn(`Cannot inline img src=${F}! Error: `+t)}"anonymous"===R.crossOrigin&&(D?e.crossOrigin=D:R.removeAttribute("crossorigin"))};R.complete&&0!==R.naturalWidth?N():R.addEventListener("load",N)}"audio"!==x&&"video"!==x||((s=e).rr_mediaState=h.paused?"paused":"played",s.rr_mediaCurrentTime=h.currentTime,s.rr_mediaPlaybackRate=h.playbackRate,s.rr_mediaMuted=h.muted,s.rr_mediaLoop=h.loop,s.rr_mediaVolume=h.volume);M||(h.scrollLeft&&(e.rr_scrollLeft=h.scrollLeft),h.scrollTop&&(e.rr_scrollTop=h.scrollTop));T&&({width:d,height:f}=h.getBoundingClientRect(),e={class:e.class,rr_width:d+"px",rr_height:f+"px"});"iframe"!==x||A(e.src)||(h.contentDocument||(e.rr_src=e.src),delete e.src);let t;try{customElements.get(x)&&(t=!0)}catch(t){}return{type:J.Element,tagName:x,attributes:e,childNodes:[],isSVG:function(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}(h)||void 0,needBlock:T,rootId:j,isCustom:t};return}case i.TEXT_NODE:{d=i;var f={doc:o,needsMask:u,maskTextFn:G,rootId:c};var{needsMask:K,maskTextFn:m,rootId:P}=f,p=d.parentNode&&d.parentNode.tagName;let t=d.textContent;var g="STYLE"===p||void 0,p="SCRIPT"===p||void 0;if(g&&t){try{d.nextSibling||d.previousSibling||null!=(r=d.parentNode.sheet)&&r.cssRules&&(t=X(d.parentNode.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,d)}t=$(t,q(f.doc))}p&&(t="SCRIPT_PLACEHOLDER");!g&&!p&&t&&K&&(t=m?m(t,d.parentElement):t.replace(/[\S]/g,"*"));return{type:J.Text,textContent:t||"",isStyle:g,rootId:P};return}case i.CDATA_SECTION_NODE:return{type:J.CDATA,textContent:"",rootId:c};case i.COMMENT_NODE:return{type:J.Comment,textContent:i.textContent||"",rootId:c};default:return!1}}function L(t){return null==t?"":t.toLowerCase()}function tt(e,t){const{doc:i,mirror:n,blockClass:s,blockSelector:r,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:d,slimDOMOptions:v,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:p=!1,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:I,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:S=()=>!1,newlyAddedElement:w=!1}=t;let k=t["needsMask"],{preserveWhiteSpace:_=!0}=t;!k&&e.childNodes&&(t=void 0===k,k=P(e,o,a,t));t=yt(e,{doc:i,mirror:n,blockClass:s,blockSelector:r,needsMask:k,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:m,recordCanvas:p,keepIframeSrcFn:S,newlyAddedElement:w});if(!t)return console.warn(e,"not serialized"),null;let O;O=n.hasNode(e)?n.getId(e):!function(t,e){if(e.comment&&t.type===J.Comment)return 1;if(t.type===J.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===V(t.attributes.href)))return 1;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(L(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===L(t.attributes.name)||"icon"===L(t.attributes.rel)||"apple-touch-icon"===L(t.attributes.rel)||"shortcut icon"===L(t.attributes.rel))))return 1;if("meta"===t.tagName){if(e.headMetaDescKeywords&&L(t.attributes.name).match(/^description|keywords$/))return 1;if(e.headMetaSocial&&(L(t.attributes.property).match(/^(og|twitter|fb):/)||L(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===L(t.attributes.name)))return 1;if(e.headMetaRobots&&("robots"===L(t.attributes.name)||"googlebot"===L(t.attributes.name)||"bingbot"===L(t.attributes.name)))return 1;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return 1;if(e.headMetaAuthorship&&("author"===L(t.attributes.name)||"generator"===L(t.attributes.name)||"framework"===L(t.attributes.name)||"publisher"===L(t.attributes.name)||"progid"===L(t.attributes.name)||L(t.attributes.property).match(/^article:/)||L(t.attributes.property).match(/^product:/)))return 1;if(e.headMetaVerification&&("google-site-verification"===L(t.attributes.name)||"yandex-verification"===L(t.attributes.name)||"csrf-token"===L(t.attributes.name)||"p:domain_verify"===L(t.attributes.name)||"verify-v1"===L(t.attributes.name)||"verification"===L(t.attributes.name)||"shopify-checkout-api-token"===L(t.attributes.name)))return 1}}}(t,v)&&(_||t.type!==J.Text||t.isStyle||t.textContent.replace(/^\s+|\s+$/gm,"").length)?K++:E;var A=$P(t,{id:O});if(n.add(e,A),O===E)return null;g&&g(e);let M=!l;if(A.type===J.Element&&(M=M&&!A.needBlock,delete A.needBlock,t=e.shadowRoot)&&N(t)&&(A.isShadowHost=!0),(A.type===J.Document||A.type===J.Element)&&M){v.headWhitespace&&A.type===J.Element&&"head"===A.tagName&&(_=!1);var j={doc:i,mirror:n,blockClass:s,blockSelector:r,needsMask:k,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:_,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:I,stylesheetLoadTimeout:C,keepIframeSrcFn:S};if(A.type!==J.Element||"textarea"!==A.tagName||void 0===A.attributes.value)for(const R of Array.from(e.childNodes)){var T=tt(R,j);T&&A.childNodes.push(T)}if(e.nodeType===e.ELEMENT_NODE&&e.shadowRoot)for(const F of Array.from(e.shadowRoot.childNodes)){var x=tt(F,j);x&&(N(e.shadowRoot)&&(x.isShadow=!0),A.childNodes.push(x))}}return e.parentNode&&D(e.parentNode)&&N(e.parentNode)&&(A.isShadow=!0),A.type===J.Element&&"iframe"===A.tagName&&function(i,n,s){var r=i.contentWindow;if(r){let t=!1,e;try{e=r.document.readyState}catch(t){return}if("complete"!==e){const o=setTimeout(()=>{t||(n(),t=!0)},s);void i.addEventListener("load",()=>{clearTimeout(o),t=!0,n()})}else{s="about:blank";if(r.location.href!==s||i.src===s||""===i.src)return setTimeout(n,0),i.addEventListener("load",n);i.addEventListener("load",n)}}}(e,()=>{var t=e.contentDocument;t&&y&&(t=tt(t,{doc:t,mirror:n,blockClass:s,blockSelector:r,needsMask:k,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:_,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:I,stylesheetLoadTimeout:C,keepIframeSrcFn:S}))&&y(e,t)},b),A.type===J.Element&&"link"===A.tagName&&"string"==typeof A.attributes.rel&&("stylesheet"===A.attributes.rel||"preload"===A.attributes.rel&&"string"==typeof A.attributes.href&&"css"===V(A.attributes.href))&&function(t,e,i){let n=!1,s;try{s=t.sheet}catch(t){return}if(!s){const r=setTimeout(()=>{n||(e(),n=!0)},i);t.addEventListener("load",()=>{clearTimeout(r),n=!0,e()})}}(e,()=>{var t;I&&(t=tt(e,{doc:i,mirror:n,blockClass:s,blockSelector:r,needsMask:k,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:_,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:I,stylesheetLoadTimeout:C,keepIframeSrcFn:S}))&&I(e,t)},C),A}function et(t,e,i=document){const n={capture:!0,passive:!0};return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}const n="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.";var _={map:{},getId(){return console.error(n),-1},getNode(){return console.error(n),null},removeNodeFromMap(){console.error(n)},has(){return console.error(n),!1},reset(){console.error(n)}};function G(s,r,o={}){let a=null,l=0;return function(...t){var e=Date.now(),i=(l||!1!==o.leading||(l=e),r-(e-l));const n=this;i<=0||r<i?(a&&(clearTimeout(a),a=null),l=e,s.apply(n,t)):a||!1===o.trailing||(a=setTimeout(()=>{l=!1===o.leading?0:Date.now(),a=null,s.apply(n,t)},i))}}function U(t,e,i,n,s=window){const r=s.Object.getOwnPropertyDescriptor(t,e);return s.$Q2(t,e,n?i:{set(t){setTimeout(()=>{i.set.call(this,t)},0),r&&r.set&&r.set.call(this,t)}}),()=>U(t,e,r||{},!0)}function W(t,e,i){try{if(!(e in t))return()=>{};const s=t[e];var n=i(s);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:s}})),t[e]=n,()=>{t[e]=s}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&new Proxy(_,{get(t,e,i){return"map"===e&&console.error(n),Reflect.get(t,e,i)}});let it=Date.now;function bt(t){var e,i=t.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:(null==i?void 0:i.documentElement.scrollLeft)||(null==(e=null==(e=null==i?void 0:i.body)?void 0:e.parentElement)?void 0:e.scrollLeft)||(null==(e=null==i?void 0:i.body)?void 0:e.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==(t=null==(e=null==i?void 0:i.body)?void 0:e.parentElement)?void 0:t.scrollTop)||(null==(e=null==i?void 0:i.body)?void 0:e.scrollTop)||0}}function It(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ct(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function O(t){return t?t.nodeType===t.ELEMENT_NODE?t:t.parentElement:null}function B(t,e,i,n){if(t){t=O(t);if(t){try{if("string"==typeof e){if(t.classList.contains(e))return!0;if(n&&null!==t.closest("."+e))return!0}else if(r(t,e,n))return!0}catch(t){}if(i){if(t.matches(i))return!0;if(n&&null!==t.closest(i))return!0}}}return!1}function A(t,e,i){return"TITLE"===t.tagName&&i.headTitleMutations||e.getId(t)===E}function St(t){return Boolean(t.changedTouches)}function wt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function kt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function _t(t){return Boolean(null==t?void 0:t.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(it=()=>(new Date).getTime());class M{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let i;return i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i}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 j(t){var e;let i=null;return i=(null==(e=null==(e=t.getRootNode)?void 0:e.call(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host?t.getRootNode().host:i}function T(t){var e=t.ownerDocument;return!!e&&(t=function(t){let e=t;for(var i;i=j(e);)e=i;return e}(t),e.contains(t))}function x(t){var e=t.ownerDocument;return e&&(e.contains(t)||T(t))}var nt=(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))({}),st=(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))(st||{}),h=(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))(h||{}),d=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(d||{}),v=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))({}),Y=(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))(Y||{});function R(t){return"__ln"in t}class F{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let i=this.head;for(let t=0;t<e;t++)i=(null==i?void 0:i.next)||null;return i}addNode(t){var e,i={value:t,previous:null,next:null};t.__ln=i,t.previousSibling&&R(t.previousSibling)?(e=t.previousSibling.__ln.next,i.next=e,i.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=i,e&&(e.previous=i)):t.nextSibling&&R(t.nextSibling)&&t.nextSibling.__ln.previous?(e=t.nextSibling.__ln.previous,i.previous=e,i.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=i,e&&(e.next=i)):(this.head&&(this.head.previous=i),i.next=this.head,this.head=i),null===i.next&&(this.tail=i),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--)}}class Ot{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),a(this,"emit",()=>{if(!this.frozen&&!this.locked){const l=[],u=new Set,c=new F,h=t=>{let e=t,i=E;for(;i===E;)e=e&&e.nextSibling,i=e&&this.mirror.getId(e);return i};for(var i,n,s=e=>{var t,i,n;if(e.parentNode&&x(e)&&"TEXTAREA"!==e.parentNode.tagName)return t=D(e.parentNode)?this.mirror.getId(j(e)):this.mirror.getId(e.parentNode),i=h(e),-1===t||-1===i?c.addNode(e):void((n=tt(e,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{wt(t,this.mirror)&&this.iframeManager.addIframe(t),kt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),_t(e)&&this.shadowDomManager.addShadowRoot(e.shadowRoot,this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}}))&&(l.push({parentId:t,nextId:i,node:n}),u.add(n.id)))};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const d of this.movedSet)Mt(this.removes,d,this.mirror)&&!this.movedSet.has(d.parentNode)||s(d);for(const v of this.addedSet)!jt(this.droppedSet,v)&&!Mt(this.removes,v,this.mirror)||jt(this.movedSet,v)?s(v):this.droppedSet.add(v);let t=null;for(;c.length;){let e=null;if(!(e=t&&(i=this.mirror.getId(t.value.parentNode),n=h(t.value),-1!==i)&&-1!==n?t:e)){let t=c.tail;for(;t;){var r=t;if(t=t.previous,r){var o=this.mirror.getId(r.value.parentNode),a=h(r.value);if(-1!==a){if(-1!==o){e=r;break}a=r.value;if(a.parentNode&&a.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){o=a.parentNode.host;if(-1!==this.mirror.getId(o)){e=r;break}}}}}}if(!e){for(;c.head;)c.removeNode(c.head.value);break}t=e.previous,c.removeNode(e.value),s(e.value)}var e={texts:this.texts.map(t=>{var e=t.node;return e.parentNode&&"TEXTAREA"===e.parentNode.tagName&&this.genTextAreaValueMutation(e.parentNode),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!u.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.map(t=>{var e,i,n=t["attributes"];return"string"==typeof n.style&&(e=JSON.stringify(t.styleDiff),i=JSON.stringify(t.Es),e.length<n.style.length)&&(e+i).split("var(").length===n.style.split("var(").length&&(n.style=t.styleDiff),{id:this.mirror.getId(t.node),attributes:n}}).filter(t=>!u.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:l};(e.texts.length||e.attributes.length||e.removes.length||e.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(e))}}),a(this,"genTextAreaValueMutation",t=>{let e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},Es:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(t.childNodes,t=>t.textContent||"").join("")}),a(this,"processMutation",n=>{if(!A(n.target,this.mirror,this.slimDOMOptions))switch(n.type){case"characterData":var s=n.target.textContent;B(n.target,this.blockClass,this.blockSelector,!1)||s===n.oldValue||this.texts.push({value:P(n.target,this.maskTextClass,this.maskTextSelector,!0)&&s?this.maskTextFn?this.maskTextFn(s,O(n.target)):s.replace(/[\S]/g,"*"):s,node:n.target});break;case"attributes":{var r=n.target;let t=n.attributeName,e=n.target.getAttribute(t);if("value"===t&&(s=vt(r),e=ht({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:e,maskInputFn:this.maskInputFn})),B(n.target,this.blockClass,this.blockSelector,!1)||e===n.oldValue)return;let i=this.attributeMap.get(n.target);if("IFRAME"===r.tagName&&"src"===t&&!this.keepIframeSrcFn(e)){if(r.contentDocument)return;t="rr_src"}if(i||(i={node:n.target,attributes:{},styleDiff:{},Es:{}},this.attributes.push(i),this.attributeMap.set(n.target,i)),"type"===t&&"INPUT"===r.tagName&&"password"===(n.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!gt(r.tagName,t)&&(i.attributes[t]=pt(this.doc,H(r.tagName),H(t),e),"style"===t)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var o=this.unattachedDoc.createElement("span");n.oldValue&&o.setAttribute("style",n.oldValue);for(const u of Array.from(r.style)){var a=r.style.getPropertyValue(u),l=r.style.getPropertyPriority(u);a!==o.style.getPropertyValue(u)||l!==o.style.getPropertyPriority(u)?i.styleDiff[u]=""===l?a:[a,l]:i.Es[u]=[a,l]}for(const c of Array.from(o.style))""===r.style.getPropertyValue(c)&&(i.styleDiff[c]=!1)}break}case"childList":B(n.target,this.blockClass,this.blockSelector,!0)||("TEXTAREA"!==n.target.tagName?(n.addedNodes.forEach(t=>this.genAdds(t,n.target)),n.removedNodes.forEach(t=>{var e=this.mirror.getId(t),i=D(n.target)?this.mirror.getId(n.target.host):this.mirror.getId(n.target);B(n.target,this.blockClass,this.blockSelector,!1)||A(t,this.mirror,this.slimDOMOptions)||-1===this.mirror.getId(t)||(this.addedSet.has(t)?(At(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(n.target)&&-1===e||function t(e,i){var n;return!D(e)&&(n=i.getId(e),!i.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||t(e.parentNode,i)))}(n.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[e+"@"+i]?At(this.movedSet,t):this.removes.push({parentId:i,id:e,isShadow:!(!D(n.target)||!N(n.target))||void 0})),this.mapRemoves.push(t))})):this.genTextAreaValueMutation(n.target))}}),a(this,"genAdds",(e,i)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(A(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let t=null;(t=i&&this.mirror.hasNode(i)?this.mirror.getId(i):t)&&-1!==t&&(this.movedMap[this.mirror.getId(e)+"@"+t]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);B(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach(t=>this.genAdds(t)),_t(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function At(e,t){e.delete(t),t.childNodes.forEach(t=>At(e,t))}function Mt(e,i,n){if(0!==e.length){var s=e;e=i;var r=n;let t=e.parentNode;for(;t;){const o=r.getId(t);if(s.some(t=>t.id===o))return 1;t=t.parentNode}}}function jt(t,e){return 0!==t.size&&function t(e,i){const n=i["parentNode"];if(!n)return!1;if(e.has(n))return!0;return t(e,n)}(t,e)}let rt;const ot=e=>{return rt?(...t)=>{try{return e(...t)}catch(t){if(!rt||!0!==rt(t))throw t}}:e},at=[];function z(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{}return t&&t.target}function Tt(t,e){var i=new Ot;at.push(i),i.init(t);let n=window.MutationObserver||window.__rrMutationObserver;var s=null==(s=null==(t=null==window?void 0:window.Zone)?void 0:t.__symbol__)?void 0:s.call(t,"MutationObserver"),t=new(n=s&&window[s]?window[s]:n)(ot(i.processMutations.bind(i)));return t.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function xt({mouseInteractionCb:o,doc:n,mirror:a,blockClass:l,blockSelector:u,sampling:t}){if(!1===t.mouseInteraction)return()=>{};const e=!0===t.mouseInteraction||void 0===t.mouseInteraction?{}:t.mouseInteraction,s=[];let c=null;return Object.keys(h).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==e[t]).forEach(t=>{let e=H(t);r=t;var r,i=i=>{var n=z(i);if(!B(n,l,u,!0)){let t=null,e=r;if("pointerType"in i){switch(i.pointerType){case"mouse":t=d.Mouse;break;case"touch":t=d.Touch;break;case"pen":t=d.Pen}t===d.Touch?h[r]===h.MouseDown?e="TouchStart":h[r]===h.MouseUp&&(e="TouchEnd"):(t,d.Pen)}else St(i)&&(t=d.Touch);null!==t?(c=t,(e.startsWith("Touch")&&t===d.Touch||e.startsWith("Mouse")&&t===d.Mouse)&&(t=null)):h[r]===h.Click&&(t=c,c=null);var s,i=St(i)?i.changedTouches[0]:i;i&&(n=a.getId(n),{clientX:i,clientY:s}=i,ot(o)({type:h[e],id:n,x:i,y:s,...null!==t&&{pointerType:t}}))}};if(window.PointerEvent)switch(h[t]){case h.MouseDown:case h.MouseUp:e=e.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}s.push(et(e,i,n))}),ot(()=>{s.forEach(t=>t())})}function Rt({scrollCb:n,doc:s,mirror:r,blockClass:o,blockSelector:a,sampling:t}){return et("scroll",ot(G(ot(t=>{var e,i,t=z(t);t&&!B(t,o,a,!0)&&(e=r.getId(t),t===s&&s.defaultView?(i=bt(s.defaultView),n({id:e,x:i.left,y:i.top})):n({id:e,x:t.scrollLeft,y:t.scrollTop}))}),t.scroll||100)),s)}const Ft=["INPUT","TEXTAREA","SELECT"],Dt=new WeakMap;function Nt(t){var e,i;return t=t,e=[],Gt("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Gt("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Gt("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Gt("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule?(i=Array.from(t.parentRule.cssRules).indexOf(t),e.unshift(i)):t.parentStyleSheet&&(i=Array.from(t.parentStyleSheet.cssRules).indexOf(t),e.unshift(i)),e}function Z(t,e,i){let n,s;return t?(t.ownerNode?n=e.getId(t.ownerNode):s=i.getId(t),{styleId:s,id:n}):{}}function Et({mirror:t,stylesheetManager:i},e){let n=null;n="#document"===e.nodeName?t.getId(e):t.getId(e.host);t="#document"===e.nodeName?null==(t=e.defaultView)?void 0:t.Document:null==(t=null==(t=e.ownerDocument)?void 0:t.defaultView)?void 0:t.ShadowRoot;const s=null!=t&&t.prototype?Object.getOwnPropertyDescriptor(null==t?void 0:t.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&t&&s?($Q2(e,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var t;return null==(t=s.get)?void 0:t.call(this)},set(t){var e=null==(e=s.set)?void 0:e.call(this,t);if(null!==n&&-1!==n)try{i.adoptStyleSheets(t,n)}catch(t){}return e}}),ot(()=>{$Q2(e,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})})):()=>{}}function Lt(t,e={}){var s,i=t.doc.defaultView;if(!i)return()=>{};{var n=t,r=e;const{mutationCb:I,mousemoveCb:C,mouseInteractionCb:S,scrollCb:w,viewportResizeCb:k,inputCb:_,mediaInteractionCb:O,styleSheetRuleCb:A,styleDeclarationCb:M,canvasMutationCb:j,fontCb:T,selectionCb:x,customElementCb:R}=n;n.mutationCb=(...t)=>{r.mutation&&r.mutation(...t),I(...t)},n.mousemoveCb=(...t)=>{r.mousemove&&r.mousemove(...t),C(...t)},n.mouseInteractionCb=(...t)=>{r.mouseInteraction&&r.mouseInteraction(...t),S(...t)},n.scrollCb=(...t)=>{r.scroll&&r.scroll(...t),w(...t)},n.viewportResizeCb=(...t)=>{r.viewportResize&&r.viewportResize(...t),k(...t)},n.inputCb=(...t)=>{r.input&&r.input(...t),_(...t)},n.mediaInteractionCb=(...t)=>{r.mediaInteaction&&r.mediaInteaction(...t),O(...t)},n.styleSheetRuleCb=(...t)=>{r.styleSheetRule&&r.styleSheetRule(...t),A(...t)},n.styleDeclarationCb=(...t)=>{r.styleDeclaration&&r.styleDeclaration(...t),M(...t)},n.canvasMutationCb=(...t)=>{r.canvasMutation&&r.canvasMutation(...t),j(...t)},n.fontCb=(...t)=>{r.font&&r.font(...t),T(...t)},n.selectionCb=(...t)=>{r.selection&&r.selection(...t),x(...t)},n.customElementCb=(...t)=>{r.customElement&&r.customElement(...t),R(...t)}}let o;t.recordDOM&&(o=Tt(t,t.doc));const a=function({mousemoveCb:i,sampling:t,doc:e,mirror:s}){if(!1===t.mousemove)return()=>{};var n="number"==typeof t.mousemove?t.mousemove:50,t="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let r=[],o;const a=G(ot(t=>{const e=Date.now()-o;i(r.map(t=>(t.timeOffset-=e,t)),t),r=[],o=null}),t),l=[et("mousemove",t=ot(G(ot(t=>{var e=z(t),{clientX:i,clientY:n}=St(t)?t.changedTouches[0]:t;o=o||it(),r.push({x:i,y:n,id:s.getId(e),timeOffset:it()-o}),a("undefined"!=typeof DragEvent&&t instanceof DragEvent?st.Drag:t instanceof MouseEvent?st.MouseMove:st.TouchMove)}),n,{trailing:!1})),e),et("touchmove",t,e),et("drag",t,e)];return ot(()=>{l.forEach(t=>t())})}(t),l=xt(t),u=Rt(t),c=function({viewportResizeCb:i},{win:t}){let n=-1,s=-1;return et("resize",ot(G(ot(()=>{var t=It(),e=Ct();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)}),200)),t)}(t,{win:i}),h=function({inputCb:n,doc:o,mirror:s,blockClass:t,blockSelector:i,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:c,sampling:e,userTriggeredOnInput:h}){function r(e){let n=z(e);var e=e.isTrusted,s=n&&n.tagName;if((n=n&&"OPTION"===s?n.parentElement:n)&&s&&!(Ft.indexOf(s)<0)&&!B(n,t,i,!0)&&!(n.classList.contains(a)||l&&n.matches(l))){let t=n.value,i=!1;var r=vt(n)||"",s=("radio"===r||"checkbox"===r?i=n.checked:(u[s.toLowerCase()]||u[r])&&(t=ht({element:n,maskInputOptions:u,tagName:s,type:r,value:t,maskInputFn:c})),d(n,h?{text:t,isChecked:i,userTriggered:e}:{text:t,isChecked:i}),n.name);"radio"===r&&s&&i&&o.querySelectorAll(`input[type="radio"][name="${s}"]`).forEach(t=>{var e;t!==n&&(e=t.value,d(t,h?{text:e,isChecked:!i,userTriggered:!1}:{text:e,isChecked:!i}))})}}function d(t,e){var i=Dt.get(t);i&&i.text===e.text&&i.isChecked===e.isChecked||(Dt.set(t,e),i=s.getId(t),ot(n)({...e,id:i}))}var v;const f=("last"===e.input?["change"]:["input","change"]).map(t=>et(t,ot(r),o)),m=o.defaultView;return m?(e=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),v=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]],e&&e.set&&f.push(...v.map(t=>U(t[0],t[1],{set(){ot(r)({target:this,isTrusted:!1})}},!1,m))),ot(()=>{f.forEach(t=>t())})):()=>{f.forEach(t=>t())}}(t),d=function({mediaInteractionCb:a,blockClass:l,blockSelector:u,mirror:c,sampling:t,doc:e}){var i=ot(o=>G(ot(t=>{var e,i,n,s,r,t=z(t);t&&!B(t,l,u,!0)&&({currentTime:e,volume:i,muted:n,playbackRate:s,loop:r}=t,a({type:o,id:c.getId(t),currentTime:e,volume:i,muted:n,playbackRate:s,loop:r}))}),t.media||500));const n=[et("play",i(Y.Play),e),et("pause",i(Y.Pause),e),et("seeked",i(Y.Seeked),e),et("volumechange",i(Y.VolumeChange),e),et("ratechange",i(Y.RateChange),e)];return ot(()=>{n.forEach(t=>t())})}(t);let v=()=>{},f=()=>{},m=()=>{},p=()=>{};t.recordDOM&&(v=function({styleSheetRuleCb:a,mirror:l,stylesheetManager:u},{win:t}){if(!t.CSSStyleSheet||!t.CSSStyleSheet.prototype)return()=>{};const e=t.CSSStyleSheet.prototype.insertRule,i=(t.CSSStyleSheet.prototype.insertRule=new Proxy(e,{apply:ot((t,e,i)=>{var[n,s]=i,{id:r,styleId:o}=Z(e,l,u.styleMirror);return(r&&-1!==r||o&&-1!==o)&&a({id:r,styleId:o,adds:[{rule:n,index:s}]}),t.apply(e,i)})}),t.CSSStyleSheet.prototype.deleteRule);t.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:ot((t,e,i)=>{var[n]=i,{id:s,styleId:r}=Z(e,l,u.styleMirror);return(s&&-1!==s||r&&-1!==r)&&a({id:s,styleId:r,removes:[{index:n}]}),t.apply(e,i)})});let n;t.CSSStyleSheet.prototype.replace&&(n=t.CSSStyleSheet.prototype.replace,t.CSSStyleSheet.prototype.replace=new Proxy(n,{apply:ot((t,e,i)=>{var[n]=i,{id:s,styleId:r}=Z(e,l,u.styleMirror);return(s&&-1!==s||r&&-1!==r)&&a({id:s,styleId:r,replace:n}),t.apply(e,i)})}));let s;t.CSSStyleSheet.prototype.replaceSync&&(s=t.CSSStyleSheet.prototype.replaceSync,t.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:ot((t,e,i)=>{var[n]=i,{id:s,styleId:r}=Z(e,l,u.styleMirror);return(s&&-1!==s||r&&-1!==r)&&a({id:s,styleId:r,replaceSync:n}),t.apply(e,i)})}));const r={},o=(Ut("CSSGroupingRule")?r.CSSGroupingRule=t.CSSGroupingRule:(Ut("CSSMediaRule")&&(r.CSSMediaRule=t.CSSMediaRule),Ut("CSSConditionRule")&&(r.CSSConditionRule=t.CSSConditionRule),Ut("CSSSupportsRule")&&(r.CSSSupportsRule=t.CSSSupportsRule)),{});return Object.entries(r).forEach(([t,e])=>{o[t]={insertRule:e.prototype.insertRule,deleteRule:e.prototype.deleteRule},e.prototype.insertRule=new Proxy(o[t].insertRule,{apply:ot((t,e,i)=>{var[n,s]=i,{id:r,styleId:o}=Z(e.parentStyleSheet,l,u.styleMirror);return(r&&-1!==r||o&&-1!==o)&&a({id:r,styleId:o,adds:[{rule:n,index:[...Nt(e),s||0]}]}),t.apply(e,i)})}),e.prototype.deleteRule=new Proxy(o[t].deleteRule,{apply:ot((t,e,i)=>{var[n]=i,{id:s,styleId:r}=Z(e.parentStyleSheet,l,u.styleMirror);return(s&&-1!==s||r&&-1!==r)&&a({id:s,styleId:r,removes:[{index:[...Nt(e),n]}]}),t.apply(e,i)})})}),ot(()=>{t.CSSStyleSheet.prototype.insertRule=e,t.CSSStyleSheet.prototype.deleteRule=i,n&&(t.CSSStyleSheet.prototype.replace=n),s&&(t.CSSStyleSheet.prototype.replaceSync=s),Object.entries(r).forEach(([t,e])=>{e.prototype.insertRule=o[t].insertRule,e.prototype.deleteRule=o[t].deleteRule})})}(t,{win:i}),f=Et(t,t.doc),m=function({styleDeclarationCb:l,mirror:u,ignoreCSSAttributes:c,stylesheetManager:h},{win:t}){const d=t.CSSStyleDeclaration.prototype.setProperty,o=(t.CSSStyleDeclaration.prototype.setProperty=new Proxy(d,{apply:ot((t,e,i)=>{var n,s,[r,o,a]=i;return c.has(r)?d.apply(e,[r,o,a]):({id:n,styleId:s}=Z(null==(n=e.parentRule)?void 0:n.parentStyleSheet,u,h.styleMirror),(n&&-1!==n||s&&-1!==s)&&l({id:n,styleId:s,set:{property:r,value:o,priority:a},index:Nt(e.parentRule)}),t.apply(e,i))})}),t.CSSStyleDeclaration.prototype.removeProperty);return t.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:ot((t,e,i)=>{var n,s,[r]=i;return c.has(r)?o.apply(e,[r]):({id:n,styleId:s}=Z(null==(n=e.parentRule)?void 0:n.parentStyleSheet,u,h.styleMirror),(n&&-1!==n||s&&-1!==s)&&l({id:n,styleId:s,remove:{property:r},index:Nt(e.parentRule)}),t.apply(e,i))})}),ot(()=>{t.CSSStyleDeclaration.prototype.setProperty=d,t.CSSStyleDeclaration.prototype.removeProperty=o})}(t,{win:i}),t.collectFonts)&&(p=function({fontCb:i,doc:t}){const e=t.defaultView;if(!e)return()=>{};const n=[],s=new WeakMap,r=e.FontFace;return e.FontFace=function(t,e,i){var n=new r(t,e,i);return s.set(n,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),n},t=W(t.fonts,"add",function(t){return function(e){return setTimeout(ot(()=>{var t=s.get(e);t&&(i(t),s.delete(e))}),0),t.apply(this,[e])}}),n.push(()=>{e.FontFace=r}),n.push(t),ot(()=>{n.forEach(t=>t())})}(t));const g=function(t){const{doc:l,mirror:u,blockClass:c,blockSelector:h,selectionCb:d}=t;let v=!0;return(t=ot(()=>{var e=l.getSelection();if(!(!e||v&&null!=e&&e.isCollapsed)){v=e.isCollapsed||!1;var i=[],n=e.rangeCount||0;for(let t=0;t<n;t++){var{startContainer:s,startOffset:r,endContainer:o,endOffset:a}=e.getRangeAt(t);B(s,c,h,!0)||B(o,c,h,!0)||i.push({start:u.getId(s),startOffset:r,end:u.getId(o),endOffset:a})}d({ranges:i})}}))(),et("selectionchange",t)}(t),y=({doc:e,customElementCb:s}=[t][0],(e=e.defaultView)&&e.customElements?W(e.customElements,"define",function(n){return function(e,t,i){try{s({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return n.apply(this,[e,t,i])}}):()=>{}),b=[];for(const F of t.plugins)b.push(F.observer(F.callback,i,F.options));return ot(()=>{at.forEach(t=>t.reset()),null!=o&&o.disconnect(),a(),l(),u(),c(),h(),d(),v(),f(),m(),p(),g(),y(),b.forEach(t=>t())})}function Gt(t){return void 0!==window[t]}function Ut(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Wt{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,n){i=i||this.getIdToRemoteIdMap(t),n=n||this.getRemoteIdToIdMap(t);let s=i.get(e);return s||(s=this.generateIdFn(),i.set(e,s),n.set(s,e)),s}getIds(e,t){const i=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,i,n))}getRemoteId(t,e,i){i=i||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:i.get(e)||-1}getRemoteIds(e,t){const i=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,i))}reset(t){t?(this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)):(this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap)}getIdToRemoteIdMap(t){let e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){let e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class Bt{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new Wt(p)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Wt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&null!=(e=t.contentWindow)&&e.addEventListener("message",this.handleMessage.bind(this)),null!=(e=this.loadListener)&&e.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&0<t.contentDocument.adoptedStyleSheets.length&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;"rrweb"===e.data.type&&e.origin===e.data.origin&&t.source&&(t=(t=this.crossOriginIframeMap.get(t.source))&&this.transformCrossOriginEvent(t,e.data.event))&&this.wrappedEmit(t,e.data.isCheckout)}transformCrossOriginEvent(i,t){var e;switch(t.type){case nt.FullSnapshot:this.crossOriginIframeMirror.reset(i),this.crossOriginIframeStyleMirror.reset(i),this.replaceIdOnNode(t.data.node,i);var n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(i,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:nt.IncrementalSnapshot,data:{source:st.Mutation,adds:[{parentId:this.mirror.getId(i),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case nt.Meta:case nt.Load:case nt.DomContentLoaded:return!1;case nt.Plugin:return t;case nt.Custom:return this.replaceIds(t.data.payload,i,["id","parentId","previousId","nextId"]),t;case nt.IncrementalSnapshot:switch(t.data.source){case st.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,i,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,i);var e=this.crossOriginIframeRootIdMap.get(i);e&&this.patchRootIdOnNode(t.node,e)}),t.data.removes.forEach(t=>{this.replaceIds(t,i,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,i,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,i,["id"])}),t;case st.Drag:case st.TouchMove:case st.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,i,["id"])}),t;case st.ViewportResize:return!1;case st.MediaInteraction:case st.MouseInteraction:case st.Scroll:case st.CanvasMutation:case st.Input:return this.replaceIds(t.data,i,["id"]),t;case st.StyleSheetRule:case st.StyleDeclaration:return this.replaceIds(t.data,i,["id"]),this.replaceStyleIds(t.data,i,["styleId"]),t;case st.Font:return t;case st.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,i,["start","end"])}),t;case st.AdoptedStyleSheet:return this.replaceIds(t.data,i,["id"]),this.replaceStyleIds(t.data,i,["styleIds"]),null!=(e=t.data.styles)&&e.forEach(t=>{this.replaceStyleIds(t,i,["styleId"])}),t}}return!1}replace(t,e,i,n){for(const s of n)!Array.isArray(e[s])&&"number"!=typeof e[s]||(Array.isArray(e[s])?e[s]=t.getIds(i,e[s]):e[s]=t.getId(i,e[s]));return e}replaceIds(t,e,i){return this.replace(this.crossOriginIframeMirror,t,e,i)}replaceStyleIds(t,e,i){return this.replace(this.crossOriginIframeStyleMirror,t,e,i)}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===J.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}}class Yt{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(N(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);const i=Tt({...this.bypassOptions,doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>i.disconnect()),this.restoreHandlers.push(Rt({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&0<t.adoptedStyleSheets.length&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Et({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,i){const n=this;this.restoreHandlers.push(W(t.prototype,"attachShadow",function(e){return function(t){t=e.call(this,t);return this.shadowRoot&&x(this)&&n.addShadowRoot(this.shadowRoot,i),t}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Zt=0;Zt<o.length;Zt++)zt[o.charCodeAt(Zt)]=Zt;function Vt(t){for(var e=new Uint8Array(t),i=e.length,n="",s=0;s<i;s+=3)n=(n=(n=(n+=o[e[s]>>2])+o[(3&e[s])<<4|e[s+1]>>4])+o[(15&e[s+1])<<2|e[s+2]>>6])+o[63&e[s+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}const Kt=new Map;const Pt=(e,i,n)=>{if(e&&(Xt(e,i)||"object"==typeof e)){i=function(t,e){let i=Kt.get(t);return i||(i=new Map,Kt.set(t,i)),i.has(e)||i.set(e,[]),i.get(e)}(n,e.constructor.name);let t=i.indexOf(e);return-1===t&&(t=i.length,i.push(e)),t}};const Jt=(t,e,i)=>t.map(t=>function e(t,i,n){var s;return t instanceof Array?t.map(t=>e(t,i,n)):null===t?t: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?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:Vt(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[e(t.buffer,i,n),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?(s=t.src,{rr_type:t.constructor.name,src:s}):t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL()}:t instanceof ImageData?{rr_type:t.constructor.name,args:[e(t.data,i,n),t.width,t.height]}:Xt(t,i)||"object"==typeof t?{rr_type:t.constructor.name,index:Pt(t,i,n)}:t}(t,e,i)),Xt=(e,i)=>{var t=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof i[t]);return Boolean(t.find(t=>e instanceof i[t]))};function Ht(t,s,r,o){const e=[];try{var i=W(t.HTMLCanvasElement.prototype,"getContext",function(n){return function(t,...e){var i;return B(this,s,r,!0)||(i="experimental-webgl"===(i=t)?"webgl":i,"__context"in this||(this.__context=i),o&&["webgl","webgl2"].includes(i)&&(e[0]&&"object"==typeof e[0]?(i=e[0]).preserveDrawingBuffer||(i.preserveDrawingBuffer=!0):e.splice(0,1,{preserveDrawingBuffer:!0}))),n.apply(this,[t,...e])}});e.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{e.forEach(t=>t())}}function Qt(t,n,s,r,o,e,a){var i,l=[];for(const c of Object.getOwnPropertyNames(t))if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{"function"==typeof t[c]&&(i=W(t,c,function(i){return function(...t){var e=i.apply(this,t);return Pt(e,a,this),"tagName"in this.canvas&&!B(this.canvas,r,o,!0)&&(t=Jt(t,a,this),t={type:n,property:c,args:t},s(this.canvas,t)),e}}),l.push(i))}catch{var u=U(t,c,{set(t){s(this.canvas,{type:n,property:c,args:[t],setter:!0})}});l.push(u)}return l}const $t="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpCiAgICAgICAgcmV0dXJuIHRyYW5zcGFyZW50QmxvYk1hcC5nZXQoaWQpOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIHRyYW5zcGFyZW50QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICAgIHJldHVybiBiYXNlNjQ7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gIiI7CiAgICB9CiAgfQogIGNvbnN0IHdvcmtlciA9IHNlbGY7CiAgd29ya2VyLm9ubWVzc2FnZSA9IGFzeW5jIGZ1bmN0aW9uKGUpIHsKICAgIGlmICgiT2Zmc2NyZWVuQ2FudmFzIiBpbiBnbG9iYWxUaGlzKSB7CiAgICAgIGNvbnN0IHsgaWQsIGJpdG1hcCwgd2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMgfSA9IGUuZGF0YTsKICAgICAgY29uc3QgdHJhbnNwYXJlbnRCYXNlNjQgPSBnZXRUcmFuc3BhcmVudEJsb2JGb3IoCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0LAogICAgICAgIGRhdGFVUkxPcHRpb25zCiAgICAgICk7CiAgICAgIGNvbnN0IG9mZnNjcmVlbiA9IG5ldyBPZmZzY3JlZW5DYW52YXMod2lkdGgsIGhlaWdodCk7CiAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCIyZCIpOwogICAgICBjdHguZHJhd0ltYWdlKGJpdG1hcCwgMCwgMCk7CiAgICAgIGJpdG1hcC5jbG9zZSgpOwogICAgICBjb25zdCBibG9iID0gYXdhaXQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOwogICAgICBjb25zdCB0eXBlID0gYmxvYi50eXBlOwogICAgICBjb25zdCBhcnJheUJ1ZmZlciA9IGF3YWl0IGJsb2IuYXJyYXlCdWZmZXIoKTsKICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsKICAgICAgaWYgKCFsYXN0QmxvYk1hcC5oYXMoaWQpICYmIGF3YWl0IHRyYW5zcGFyZW50QmFzZTY0ID09PSBiYXNlNjQpIHsKICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOwogICAgICB9CiAgICAgIGlmIChsYXN0QmxvYk1hcC5nZXQoaWQpID09PSBiYXNlNjQpCiAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOwogICAgICB3b3JrZXIucG9zdE1lc3NhZ2UoewogICAgICAgIGlkLAogICAgICAgIHR5cGUsCiAgICAgICAgYmFzZTY0LAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodAogICAgICB9KTsKICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkOiBlLmRhdGEuaWQgfSk7CiAgICB9CiAgfTsKfSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW1hZ2UtYml0bWFwLWRhdGEtdXJsLXdvcmtlci1CWjFyN1JKRC5qcy5tYXAK";var qt;const te="undefined"!=typeof window&&window.Blob&&new Blob([(_=$t,Uint8Array.from(atob(_),t=>t.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});function ee(e){let t;try{var i;if(t=te&&(window.URL||window.webkitURL).createObjectURL(te))return(i=new Worker(t,{name:null==e?void 0:e.name})).addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),i;throw""}catch(t){return new Worker("data:text/javascript;base64,"+$t,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class ie{constructor(t){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});var{sampling:e="all",win:i,blockClass:n,blockSelector:s,recordCanvas:r,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,r&&"all"===e&&this.initCanvasMutationObserver(i,n,s),r&&"number"==typeof e&&this.initCanvasFPSObserver(e,i,n,s,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,i,n,s,r){const e=Ht(i,n,s,!0),o=new Map,a=new ee,l=(a.onmessage=t=>{var e,i,n,s=t.data["id"];o.set(s,!1),"base64"in t.data&&({base64:t,type:e,width:i,height:n}=t.data,this.mutationCb({id:s,type:v["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:t}],type:e}]},0,0]}]}))},1e3/t);let u=0,c;const h=()=>{const e=[];return i.document.querySelectorAll("canvas").forEach(t=>{B(t,n,s,!0)||e.push(t)}),e},d=t=>{c=(u&&t-u<l||(u=t,h().forEach(async t=>{var e,i,n=this.mirror.getId(t);o.get(n)||0!==t.width&&0!==t.height&&(o.set(n,!0),["webgl","webgl2"].includes(t.__context)&&!1===(null==(i=null==(e=t.getContext(t.__context))?void 0:e.getContextAttributes())?void 0:i.preserveDrawingBuffer)&&e.clear(e.COLOR_BUFFER_BIT),i=await createImageBitmap(t),a.postMessage({id:n,bitmap:i,width:t.width,height:t.height,dataURLOptions:r.dataURLOptions},[i]))})),requestAnimationFrame(d))};c=requestAnimationFrame(d),this.resetObservers=()=>{e(),cancelAnimationFrame(c)}}initCanvasMutationObserver(t,e,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Ht(t,e,i,!1),s=function(i,n,s,r){const t=[];var e;for(const a of Object.getOwnPropertyNames(n.CanvasRenderingContext2D.prototype))try{"function"==typeof n.CanvasRenderingContext2D.prototype[a]&&(e=W(n.CanvasRenderingContext2D.prototype,a,function(t){return function(...e){return B(this.canvas,s,r,!0)||setTimeout(()=>{var t=Jt(e,n,this);i(this.canvas,{type:v["2D"],property:a,args:t})},0),t.apply(this,e)}}),t.push(e))}catch{var o=U(n.CanvasRenderingContext2D.prototype,a,{set(t){i(this.canvas,{type:v["2D"],property:a,args:[t],setter:!0})}});t.push(o)}return()=>{t.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i),r=function(t,e,i,n){const s=[];return s.push(...Qt(e.WebGLRenderingContext.prototype,v.WebGL,t,i,n,0,e)),void 0!==e.WebGL2RenderingContext&&s.push(...Qt(e.WebGL2RenderingContext.prototype,v.WebGL2,t,i,n,0,e)),()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,this.mirror);this.resetObservers=()=>{n(),s(),r()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,e){var i,n;this.frozen||this.locked||(n=this.pendingCanvasMutations.get(t))&&-1!==e&&(i=n.map(t=>{const{type:e,...i}=t;return i}),n=n[0]["type"],this.mutationCb({id:e,type:n,commands:i}),this.pendingCanvasMutations.delete(t))}}class ne{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new M),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"ws"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0!==t.length){var i={id:e,styleIds:[]},n=[];for(const s of t){let t;this.styleMirror.has(s)?t=this.styleMirror.getId(s):(t=this.styleMirror.add(s),n.push({styleId:t,rules:Array.from(s.rules||CSSRule,(t,e)=>({rule:m(t),index:e}))})),i.styleIds.push(t)}0<n.length&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class se{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){t=this.nodeMap.get(t);return t&&Array.from(t).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(){}}let lt,re,oe,ae=!1;try{2!==Array.from([1],t=>2*t)[0]&&(qt=document.createElement("iframe"),document.body.appendChild(qt),Array.from=(null==(s=qt.contentWindow)?void 0:s.Array.from)||Array.from,document.body.removeChild(qt))}catch(t){console.debug("Unable to override Array.from",t)}const ut=new ct;function t(t={}){const{emit:n,checkoutEveryNms:s,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:E="rr-ignore",ignoreSelector:L=null,maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:G,maskInputOptions:e,slimDOMOptions:c,maskInputFn:h,maskTextFn:d,hooks:U,packFn:v,sampling:f={},dataURLOptions:m={},mousemoveWait:p,recordDOM:g=!0,recordCanvas:y=!1,recordCrossOriginIframes:W=!1,recordAfter:B="DOMContentLoaded"===t.recordAfter?t.recordAfter:"load",userTriggeredOnInput:Y=!1,collectFonts:z=!1,inlineImages:b=!1,plugins:I,keepIframeSrcFn:C=()=>!1,ignoreCSSAttributes:Z=new Set([]),errorHandler:V}=t;t=V,rt=t;const S=!W||window.parent===window;let w=!1;if(!S)try{window.parent.document&&(w=!1)}catch(t){w=!0}if(S&&!n)throw new Error("emit function is required");if(!S&&!w)return()=>{};void 0!==p&&void 0===f.mousemove&&(f.mousemove=p),ut.reset();const k=!0===G?{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!==e?e:{password:!0},_=!0===c||"all"===c?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===c,headMetaDescKeywords:"all"===c,headTitleMutations:"all"===c}:c||{};!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let e=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();let K,O=0;const P=t=>{for(const e of I||[])e.eventProcessor&&(t=e.eventProcessor(t));return t=v&&!w?v(t):t},A=(lt=(t,e)=>{var i;t.timestamp=it(),null==(i=at[0])||!i.isFrozen()||t.type===nt.FullSnapshot||t.type===nt.IncrementalSnapshot&&t.data.source===st.Mutation||at.forEach(t=>t.unfreeze()),S?null!=n&&n(P(t),e):w&&(i={type:"rrweb",event:P(t),origin:window.location.origin,isCheckout:e},window.parent.postMessage(i,"*")),t.type===nt.FullSnapshot?(K=t,O=0):t.type!==nt.IncrementalSnapshot||t.data.source===st.Mutation&&t.data.isAttachIframe||(O++,e=r&&O>=r,i=s&&t.timestamp-K.timestamp>s,(e||i)&&re(!0))},t=>{lt({type:nt.IncrementalSnapshot,data:{source:st.Mutation,...t}})}),J=t=>lt({type:nt.IncrementalSnapshot,data:{source:st.Scroll,...t}}),X=t=>lt({type:nt.IncrementalSnapshot,data:{source:st.CanvasMutation,...t}});const M=new ne({mutationCb:A,adoptedStyleSheetCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.AdoptedStyleSheet,...t}})}),j=new Bt({mirror:ut,mutationCb:A,stylesheetManager:M,recordCrossOriginIframes:W,wrappedEmit:lt});for(const R of I||[])R.getMirror&&R.getMirror({nodeMirror:ut,crossOriginIframeMirror:j.crossOriginIframeMirror,crossOriginIframeStyleMirror:j.crossOriginIframeStyleMirror});const T=new se,x=(oe=new ie({recordCanvas:y,mutationCb:X,win:window,blockClass:i,blockSelector:o,mirror:ut,sampling:f.canvas,dataURLOptions:m}),new Yt({mutationCb:A,scrollCb:J,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:k,dataURLOptions:m,maskTextFn:d,maskInputFn:h,recordCanvas:y,inlineImages:b,sampling:f,slimDOMOptions:_,iframeManager:j,stylesheetManager:M,canvasManager:oe,keepIframeSrcFn:C,processedNodeManager:T},mirror:ut}));re=(t=!1)=>{if(g){lt({type:nt.Meta,data:{href:window.location.href,width:Ct(),height:It()}},t),M.reset(),x.init(),at.forEach(t=>t.lock());var e=function(t,e){var{mirror:e=new ct,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:r=null,inlineStylesheet:o=!0,inlineImages:a=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:c,maskInputFn:h,slimDOM:d=!1,dataURLOptions:v,preserveWhiteSpace:f,onSerialize:m,onIframeLoad:p,iframeLoadTimeout:g,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:I=()=>!1}=e||{};return tt(t,{doc:t,mirror:e,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:r,skipChild:!1,inlineStylesheet:o,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:c,maskInputFn:h,slimDOMOptions:!0===d||"all"===d?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===d,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===d?{}:d,dataURLOptions:v,inlineImages:a,recordCanvas:l,preserveWhiteSpace:f,onSerialize:m,onIframeLoad:p,iframeLoadTimeout:g,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:I,newlyAddedElement:!1})}(document,{mirror:ut,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:k,maskTextFn:d,slimDOM:_,dataURLOptions:m,recordCanvas:y,inlineImages:b,onSerialize:t=>{wt(t,ut)&&j.addIframe(t),kt(t,ut)&&M.trackLinkElement(t),_t(t)&&x.addShadowRoot(t.shadowRoot,document)},onIframeLoad:(t,e)=>{j.attachIframe(t,e),x.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{M.attachLinkElement(t,e)},keepIframeSrcFn:C});if(!e)return console.warn("Failed to snapshot the document");lt({type:nt.FullSnapshot,data:{node:e,initialOffset:bt(window)}},t),at.forEach(t=>t.unlock()),document.adoptedStyleSheets&&0<document.adoptedStyleSheets.length&&M.adoptStyleSheets(document.adoptedStyleSheets,ut.getId(document))}};try{const F=[],D=t=>{return ot(Lt)({mutationCb:A,mousemoveCb:(t,e)=>lt({type:nt.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.MouseInteraction,...t}}),scrollCb:J,viewportResizeCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.ViewportResize,...t}}),inputCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.Input,...t}}),mediaInteractionCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.MediaInteraction,...t}}),styleSheetRuleCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.StyleSheetRule,...t}}),styleDeclarationCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.StyleDeclaration,...t}}),canvasMutationCb:X,fontCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.Font,...t}}),selectionCb:t=>{lt({type:nt.IncrementalSnapshot,data:{source:st.Selection,...t}})},customElementCb:t=>{lt({type:nt.IncrementalSnapshot,data:{source:st.CustomElement,...t}})},blockClass:i,ignoreClass:E,ignoreSelector:L,maskTextClass:a,maskTextSelector:l,maskInputOptions:k,inlineStylesheet:u,sampling:f,recordDOM:g,recordCanvas:y,inlineImages:b,userTriggeredOnInput:Y,collectFonts:z,doc:t,maskInputFn:h,maskTextFn:d,keepIframeSrcFn:C,blockSelector:o,slimDOMOptions:_,dataURLOptions:m,mirror:ut,iframeManager:j,stylesheetManager:M,shadowDomManager:x,processedNodeManager:T,canvasManager:oe,ignoreCSSAttributes:Z,plugins:(null==(t=null==I?void 0:I.filter(t=>t.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>lt({type:nt.Plugin,data:{plugin:e.name,payload:t}})})))||[]},U)},N=(j.addLoadListener(t=>{try{F.push(D(t.contentDocument))}catch(t){console.warn(t)}}),()=>{re(),F.push(D(document)),ae=!0});return"interactive"===document.readyState||"complete"===document.readyState?N():(F.push(et("DOMContentLoaded",()=>{lt({type:nt.DomContentLoaded,data:{}}),"DOMContentLoaded"===B&&N()})),F.push(et("load",()=>{lt({type:nt.Load,data:{}}),"load"===B&&N()},window))),()=>{F.forEach(t=>t()),T.destroy(),ae=!1,rt=void 0}}catch(t){console.warn(t)}}t.addCustomEvent=(t,e)=>{if(!ae)throw new Error("please add custom event after start recording");lt({type:nt.Custom,data:{tag:t,payload:e}})},t.freezePage=()=>{at.forEach(t=>t.freeze())},t.takeFullSnapshot=t=>{if(!ae)throw new Error("please take full snapshot after start recording");re(t)},t.mirror=ut,i.record=t}},n={};function s(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[t].call(e.exports,e,e.exports,s)),e.exports}return s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s(2043).default})());
|
|
1
|
+
var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Statsig=e():t.Statsig=e()}(this,()=>(()=>{"use strict";var i={1845:(t,i,e)=>{var n;$Q2(i,"__esModule",{value:!0}),i.t=i.i=i.l=void 0;const s=e(7512);i.l=()=>{try{return"undefined"!=typeof __STATSIG__?__STATSIG__:l}catch(t){return l}},i.i=t=>(0,i.l)()[t];i.t=t=>{var e=(0,i.l)();return t?e.instances&&e.instances[t]:(e.instances&&1<Object.keys(e.instances).length&&s.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),e.firstInstance)};var r="__STATSIG__",o="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},a="undefined"!=typeof globalThis?globalThis:{};const l=null!=(n=null!=(n=null!=(n=o[r])?n:e[r])?n:a[r])?n:{instance:i.t};o[r]=l,e[r]=l,a[r]=l},2137:(t,e,i)=>{$Q(e),e.o=e.u=void 0;const s=i(1406);function n(t,e,i){if(i)return i(t,e);const n=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(i=null==e?void 0:e.userID)?i:""),"cids:"+Object.keys(n).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+n[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.u=n,e.o=function(t,e,i){return e?n(t,e,i):(0,s.h)("k:"+t)}},6427:(t,e)=>{$Q(e)},694:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e),e.Wn=e.DataAdapterCore=void 0;const l=i(7512),u=i(9122),r=i(8578),o=i(4534),c=i(3401);function h(t,e,i,n){return{source:t,data:e,receivedAt:Date.now(),stableID:i,fullUserHash:(0,r.v)(n)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.p=e,this.m=null,this.O=null,this.j="statsig.last_modified_time."+e,this.S=new n}attach(t,e,i){this.O=t,this.m=e}getDataSync(t){var t=t&&(0,r.T)(t,this.m),e=this.k(t),i=this.S.get(e,t);return i&&this.Li(i)?i:(i=this.I(e))&&this.Li(i)?(this.S.add(e,i),this.S.get(e,t)):null}setData(t,e){var e=e&&(0,r.T)(e,this.m),i=this.k(e);this.S.add(i,h("Bootstrap",t,null,e))}Li(t){return null==t.stableID||t.stableID===u.StableID.get(this.C())}D(e,i,n){return s(this,void 0,void 0,function*(){o.Storage.isReady()||(yield o.Storage.isReadyResolver());var t=null!=e?e:this.getDataSync(i),t=[this.M(t,i,n)];return null!=n&&n.timeoutMs&&t.push(new Promise(t=>setTimeout(t,n.timeoutMs)).then(()=>(l.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}A(i,n){return s(this,void 0,void 0,function*(){var t=i&&(0,r.T)(i,this.m),e=this.k(t),t=yield this.D(null,t,n);t&&this.S.add(e,$P($P({},t),{source:"Prefetch"}))})}M(r,o,a){return s(this,void 0,void 0,function*(){var t=null!=(t=null==r?void 0:r.data)?t:null,e=null!=r&&this.N(r,o),e=yield this.R(t,o,a,e);if(!e)return l.Log.debug("No response returned for latest value"),null;var i=(0,c.P)(e,"has_updates","Response"),n=this.C(),n=u.StableID.get(n);let s=null;if(!0===(null==i?void 0:i.has_updates))s=h("Network",e,n,o);else{if(!t||!1!==(null==i?void 0:i.has_updates))return null;s=h("NetworkNotModified",t,n,o)}e=this.k(o);return this.S.add(e,s),this.U(e,s),s})}C(){return null!=this.O?this.O:(l.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=o.Storage.getItem)?void 0:e.call(o.Storage,t);return null!=e&&(t=(0,c.P)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}U(t,e){o.Storage.setItem(t,JSON.stringify(e)),this.F(t)}F(t){var e=null!=(e=(0,o.G)(this.j))?e:{},t=(e[t]=Date.now(),a(e,10));t&&(delete e[t],o.Storage.removeItem(t)),(0,o.L)(this.j,e)}},e.Wn=h;class n{constructor(){this.K={}}get(t,e){var t=this.K[t],i=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&i&&e!==i?(l.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var i=a(this.K,9);i&&delete this.K[i],this.K[t]=e}merge(t){this.K=$P($P({},this.K),t)}}function a(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var i=s[t],n=s[e];return"object"==typeof i&&"object"==typeof n?n.receivedAt<i.receivedAt?e:t:n<i?e:t})}},8962:(t,o)=>{$Q2(o,"__esModule",{value:!0}),o.Diagnostics=void 0;const n=new Map,i="start";function s(t,e,i,n){return $P({key:i,action:e,step:n,timestamp:Date.now()},t)}function r(t,e){var i=null!=(i=n.get(t))?i:[];i.push(e),n.set(t,i)}function e(t,e){if(e in t)return t[e]}o.Diagnostics={q:t=>n.get(t),B:t=>{r(t,s({},i,"overall"))},V:(t,e,i)=>{r(t,s({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:i},"end","overall"))},J:(t,e)=>{r(t,s(e,i,"initialize","network_request"))},$:(t,e)=>{r(t,s(e,"end","initialize","network_request"))},W:t=>{r(t,s({},i,"initialize","process"))},H:(t,e)=>{r(t,s(e,"end","initialize","process"))},Y:t=>{n.delete(t)},X(t){if(t&&"object"==typeof t)return{code:e(t,"code"),name:e(t,"name"),message:e(t,"message")}},Z(t,e,i,n){return{success:!0===(null==t?void 0:t.ok),statusCode:null==t?void 0:t.status,sdkRegion:null==(t=null==t?void 0:t.headers)?void 0:t.get("x-statsig-region"),isDelta:!0===i.includes('"is_delta":true')||void 0,attempt:e,error:o.Diagnostics.X(n)}},tt(t,e,i,n){var s,r=o.Diagnostics.q(i);return null==r||r.length<=0?-1:(s=r[r.length-1].timestamp-r[0].timestamp,o.Diagnostics.Y(i),i=function(t,e){t={eventName:"statsig::diagnostics",user:t,value:null,metadata:e,time:Date.now()};return t}(t,{context:"initialize",markers:r.slice(),statsigOptions:n}),e.enqueue(i),s)}}},8809:function(t,e){var i=this&&this.__awaiter||$A();$Q(e),e.et=void 0;const s=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),r="https://cloudflare-dns.com/dns-query",o=["i","e","d"],a=200;e.et=function(e){return i(this,void 0,void 0,function*(){var i=yield e(r,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:s});if(i.ok){var t,i=yield i.arrayBuffer(),i=new Uint8Array(i);{var n=i,i=n.findIndex((t,e)=>e<a&&"="===String.fromCharCode(t)&&o.includes(String.fromCharCode(n[e-1])));if(-1===i)throw(t=new Error("Failed to parse TXT records from DNS")).name="DnsTxtParseError",t;let e="";for(let t=i-1;t<n.length;t++)e+=String.fromCharCode(n[t]);return e.split(",")}}throw(t=new Error("Failed to fetch TXT records from DNS")).name="DnsTxtFetchError",t})}},3539:(t,e)=>{$Q(e)},5542:function(t,a,e){var i=this&&this.__awaiter||$A();$Q2(a,"__esModule",{value:!0}),a.ErrorBoundary=a.EXCEPTION_ENDPOINT=void 0;const n=e(7512),l=e(5902),u=e(8e3),c=(a.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");function h(t){return t instanceof Error?t:"string"==typeof t?new Error(t):new Error("An unknown error occurred.")}a.ErrorBoundary=class{constructor(t,e,i,n){this.O=t,this.m=e,this.nt=i,this.qn=n,this.it=new Set}wrap(n){try{const t=n;!function(t){const e=new Set;let i=Object.getPrototypeOf(t);for(;i&&i!==Object.prototype;)Object.getOwnPropertyNames(i).filter(t=>"function"==typeof(null===i||void 0===i?void 0:i[t])).forEach(t=>e.add(t)),i=Object.getPrototypeOf(i);return Array.from(e)}(t).forEach(e=>{const i=t[e];"$EB"in i||(t[e]=(...t)=>this.rt(e,()=>i.apply(n,t)),t[e].$EB=!0)})}catch(t){this.st("eb:wrap",t)}}logError(t,e){this.st(t,e)}getLastSeenErrorAndReset(){var t=this.qn;return this.qn=void 0,null!=t?t:null}attachErrorIfNoneExists(t){this.qn||(this.qn=h(t))}rt(e,t){try{var i=t();return i&&i instanceof Promise?i.catch(t=>this.st(e,t)):i}catch(t){return this.st(e,t),null}}st(r,o){try{n.Log.warn("Caught error in "+r,{error:o});i(this,void 0,void 0,function*(){var t,e=o||Error(c),i=e instanceof Error,n=i?e.name:"No Name",s=h(e);this.qn=s,this.it.has(n)||(this.it.add(n),null!=(s=null==(s=this.m)?void 0:s.networkConfig)&&s.preventAllNetworkTraffic?null!=(s=this.nt)&&s.call(this,{name:"error",error:o,tag:r}):(s=l.SDKType.lt(this.O),t=u.StatsigMetadataProvider.get(),i=i?e.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(e),e=$P({tag:r,exception:n,info:i,statsigOptions:function(t){if(!t)return{};const i={};return Object.entries(t).forEach(([t,e])=>{switch(typeof e){case"number":case"bigint":case"boolean":i[String(t)]=e;break;case"string":e.length<50?i[String(t)]=e:i[String(t)]="set";break;case"object":"environment"===t?i.environment=e:"networkConfig"===t?i.networkConfig=e:i[String(t)]=null!=e?"set":"unset"}}),i}(this.m)},$P($P({},t),{sdkType:s})),yield(null!=(n=null==(i=null==(n=this.m)?void 0:n.networkConfig)?void 0:i.networkOverrideFunc)?n:fetch)(a.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.O,"STATSIG-SDK-TYPE":String(s),"STATSIG-SDK-VERSION":String(t.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(e)}),null!=(i=this.nt)&&i.call(this,{name:"error",error:o,tag:r})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},2922:(t,e)=>{$Q(e)},2417:(t,e)=>{$Q(e)},7770:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=i(2137),r=i(1406),o=i(7512),a=i(7410),l=i(6830),u=i(1637),c=i(586),h=i(4534),d=i(1881),v=i(2397),f={},m={Startup:"startup",GainedFocus:"gained_focus"};class p{static ot(t){null!=(t=f[t])&&t.flush().catch(()=>{})}static ut(t){null!=(t=f[t])&&t.ct(m.GainedFocus)}constructor(t,e,i,n){this.O=t,this.nt=e,this.ht=i,this.m=n,this.dt=[],this.vt={},this.ft={},this._t=!1,this.gt=Date.now(),this.Yn=null!=(t=null==n?void 0:n.loggingEnabled)?t:!0===(null==n?void 0:n.disableLogging)?c.LoggingEnabledOption.disabled:c.LoggingEnabledOption.browserOnly,null!=n&&n.loggingEnabled&&void 0!==n.disableLogging&&o.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this.yt=null!=(e=null==n?void 0:n.loggingBufferMaxSize)?e:100;i=null==n?void 0:n.networkConfig;this.Ot=new d.UrlConfiguration(a.Endpoint.jt,null==i?void 0:i.logEventUrl,null==i?void 0:i.api,null==i?void 0:i.logEventFallbackUrls)}setLogEventCompressionMode(t){this.ht.setLogEventCompressionMode(t)}setLoggingEnabled(t){this.Yn=t}enqueue(t){this.St(t)&&(this.wt(t),this.Tt(),this.dt.length>this.yt)&&p.ot(this.O)}incrementNonExposureCount(t){var e=null!=(e=this.ft[t])?e:0;this.ft[t]=e+1}reset(){this.flush().catch(()=>{}),this.vt={}}start(){var t,e=(0,l.kt)();e&&"always"!==(null==(t=this.m)?void 0:t.loggingEnabled)||(f[this.O]=this,e||(0,v.It)(t=>{"background"===t?p.ot(this.O):"foreground"===t&&p.ut(this.O)}),this.ct(m.Startup),this.Dt())}stop(){return n(this,void 0,void 0,function*(){this.Et&&(clearInterval(this.Et),this.Et=null),delete f[this.O],yield this.flush()})}flush(){return n(this,void 0,void 0,function*(){var t;this.Mt(),0!==this.dt.length&&(t=this.dt,this.dt=[],yield this.At(t))})}Tt(){this._t||(this._t=!0,200<Date.now()-this.gt)||setTimeout(()=>p.ot(this.O),200)}St(t){if("always"!==(null==(e=this.m)?void 0:e.loggingEnabled)&&(0,l.kt)())return!1;if((0,u.xt)(t)){var e=t.user||{statsigEnvironment:void 0},e=(0,s.u)(this.O,e),i=t.metadata||{},t=[t.eventName,e,i.gate,i.config,i.ruleID,i.allocatedExperiment,i.parameterName,String(i.isExplicitParameter),i.reason].join("|"),e=this.vt[t],i=Date.now();if(e&&i-e<6e5)return!1;1e3<Object.keys(this.vt).length&&(this.vt={}),this.vt[t]=i}return!0}At(s){return n(this,void 0,void 0,function*(){var t,e;if("disabled"===this.Yn)return this.Nt(s),!1;try{var i=(0,v.Rt)()&&this.ht.isBeaconSupported()&&null==(null==(e=null==(t=this.m)?void 0:t.networkConfig)?void 0:e.networkOverrideFunc),n=(this.nt({name:"pre_logs_flushed",events:s}),i?this.Pt(s):yield this.Ct(s));return n.success?(this.nt({name:"logs_flushed",events:s}),!0):(o.Log.warn("Failed to flush events."),this.Nt(s),!1)}catch(t){return o.Log.warn("Failed to flush events."),!1}})}Ct(e){return n(this,void 0,void 0,function*(){var t=yield this.ht.post(this.Ut(e)),t=null!=(t=null==t?void 0:t.code)?t:-1;return{success:200<=t&&t<300}})}Pt(t){return{success:this.ht.beacon(this.Ut(t))}}Ut(t){return{sdkKey:this.O,data:{events:t},urlConfig:this.Ot,retries:3,isCompressable:!0,params:{[a.NetworkParam.EventCount]:String(t.length)},credentials:"same-origin"}}Nt(t){for(;500<t.length;)t.shift();var e=this.o();try{(0,h.L)(e,t)}catch(t){o.Log.warn("Unable to save failed logs to storage")}}ct(e){const i=this.o();n(this,void 0,void 0,function*(){h.Storage.isReady()||(yield h.Storage.isReadyResolver());var t=(0,h.G)(i);t&&(e===m.Startup&&h.Storage.removeItem(i),yield this.At(t))&&e===m.GainedFocus&&h.Storage.removeItem(i)}).catch(()=>{o.Log.warn("Failed to flush stored logs")})}o(){return"statsig.failed_logs."+(0,r.h)(this.O)}wt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},i=this.Ft(),i=(i&&(e.statsigMetadata={currentPage:i}),$P($P({},t),e));o.Log.debug("Enqueued Event:",i),this.dt.push(i)}Mt(){0!==Object.keys(this.ft).length&&(this.wt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.ft)}}),this.ft={})}Ft(){var t;if(!1!==(null==(t=this.m)?void 0:t.includeCurrentPageUrlWithEvents))return(0,l.Gt)()}Dt(){var t=null!=(t=null==(t=this.m)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{var t=f[this.O];t&&t.Et===e?p.ot(this.O):clearInterval(e)},t);this.Et=e}}e.EventLogger=p},1406:(t,r,e)=>{$Q2(r,"__esModule",{value:!0}),r.Lt=r.Kt=r.h=void 0;const o=e(6634);r.h=e=>{let i=0;for(let t=0;t<e.length;t++){var n=e.charCodeAt(t);i=(i<<5)-i+n,i&=i}return String(i>>>0)},r.Kt=(t,e)=>(0,r.h)(JSON.stringify((0,r.Lt)(t,e)));r.Lt=(i,n)=>{if(null==i)return null;var t=Object.keys(i).sort();const s={};return t.forEach(t=>{var e=i[t];0===n||"object"!==(0,o.zt)(e)?s[t]=e:s[t]=(0,r.Lt)(e,null!=n?n-1:n)}),s}},1333:(t,e)=>{$Q(e)},7512:(t,e)=>{$Q(e),e.Log=e.LogLevel=void 0;function i(t){return t.unshift("[Statsig]"),t}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class n{static info(...t){n.level>=e.LogLevel.Info&&console.info(" INFO ",...i(t))}static debug(...t){n.level>=e.LogLevel.Debug&&console.debug(" DEBUG ",...i(t))}static warn(...t){n.level>=e.LogLevel.Warn&&console.warn(" WARN ",...i(t))}static error(...t){n.level>=e.LogLevel.Error&&console.error(" ERROR ",...i(t))}}(e.Log=n).level=e.LogLevel.Warn},7787:(t,e)=>{$Q(e),e.createMemoKey=e.MemoPrefix=void 0,e.MemoPrefix={Kn:"g",Ln:"c",Vn:"e",Ts:"cl",$n:"l",Bn:"p"};const r=new Set([]),o=new Set(["userPersistedValues"]);e.createMemoKey=function(t,e,i){let n=t+"|"+e;if(i)for(const s of Object.keys(i)){if(o.has(s))return;r.has(s)?n+=`|${s}=true`:n+=`|${s}=`+i[s]}return n}},7410:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=e.Endpoint=void 0,e.Endpoint={qt:"initialize",jt:"rgstr",Bt:"download_config_specs"},e.NetworkDefault={[e.Endpoint.jt]:"https://prodregistryv2.org/v1",[e.Endpoint.qt]:"https://featureassets.org/v1",[e.Endpoint.Bt]:"https://api.statsigcdn.com/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},7023:function(t,e,i){var I=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,i(1845);const v=i(1845),C=i(8962),S=i(7512),w=i(7410),n=i(308),f=i(3091),o=i(5902),s=i(6830),a=i(4143),l=i(9122),k=i(2636),u=i(8e3),m=i(586),_=i(2397),O=500,A=3e4;const M=new Set([408,500,502,503,504,522,524,599]);e.NetworkCore=class{constructor(t,e){this.nt=e,this.$t=null,this.Vt=1e4,this.Jt={},this.m={},this.Oi={},this.Jn=null,t&&(this.m=t),this.m.networkConfig&&(this.Jt=this.m.networkConfig),this.Jt.networkTimeoutMs&&(this.Vt=this.Jt.networkTimeoutMs),this.Wt=new n.NetworkFallbackResolver(this.m),this.setLogEventCompressionMode(this.Qn(t))}setLogEventCompressionMode(t){this.m.logEventCompressionMode=t}setErrorBoundary(t){this.$t=t,this.$t.wrap(this),this.$t.wrap(this.Wt),this.Wt.setErrorBoundary(t)}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}getLastUsedInitUrlAndReset(){var t=this.Jn;return this.Jn=null,t}beacon(t){var e,i;return!!j(t)&&(t=this.Ht("POST",t),e=this.Xt(t),(i=navigator).sendBeacon.bind(i)(e,t.body))}post(e){return I(this,void 0,void 0,function*(){var t=this.Ht("POST",e);return this.Pi(t),yield this.Ci(t),this.Zt(t)})}get(t){t=this.Ht("GET",t);return this.Zt(t)}Zt(b){return I(this,void 0,void 0,function*(){var e;if(!j(b))return null;if(this.Jt.preventAllNetworkTraffic)return null;var{method:i,body:n,retries:s,attempt:r}=b,o=b.urlConfig.endpoint;if(this.Si(o))return S.Log.warn(`Request to ${o} was blocked because you are making requests too frequently.`),null;r=null!=r?r:1;const a="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>{null!==a&&void 0!==a&&a.abort(`Timeout of ${this.Vt}ms expired.`)},this.Vt),l=this.Xt(b);let u=null;var c,h=(0,_.Rt)();try{var d,v,f,m={method:i,body:n,headers:$P({},b.headers),signal:null===a||void 0===a?void 0:a.signal,priority:b.priority,keepalive:h},p=(c=r,(y=b).urlConfig.endpoint===w.Endpoint.qt&&C.Diagnostics.J(y.sdkKey,{attempt:c}),this.Oi[o]),g=(p&&(p.lastRequestTime=Date.now(),this.Oi[o]=p),null!=(e=this.Jt.networkOverrideFunc)?e:fetch);if(u=yield g(l,m),clearTimeout(t),u.ok)return f=yield u.text(),T(b,u,r,f),this.Wt.tryBumpExpiryTime(b.sdkKey,b.urlConfig),{body:f,code:u.status};throw d=yield u.text().catch(()=>"No Text"),(v=new Error(`NetworkError: ${l} `+d)).name="NetworkError",v}catch(t){var n=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(a,t),h=function(t){t=(null==t?void 0:t.signal.aborted)&&"string"==typeof t.signal.reason&&t.signal.reason.includes("Timeout");return t||!1}(a),y=(T(b,u,r,"",t),yield this.Wt.tryFetchUpdatedFallbackInfo(b.sdkKey,b.urlConfig,n,h));return(y&&(b.fallbackUrl=this.Wt.getActiveFallbackUrl(b.sdkKey,b.urlConfig)),!s||s<r||!M.has(null!=(c=null===u||void 0===u?void 0:u.status)?c:500))?(null!=(o=this.nt)&&o.call(this,{name:"error",error:t,tag:k.ErrorTag.NetworkError,requestArgs:b}),p=`A networking error occurred during ${i} request to ${l}.`,S.Log.error(p,n,t),null!=(e=this.$t)&&e.attachErrorIfNoneExists(p),null):(yield function(e){return I(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(O*(e*e),A)))})}(r),this.Zt($P($P({},b),{retries:s,attempt:r+1})))}})}Qn(t){let e=null==t?void 0:t.logEventCompressionMode;return e=(e=e||!0!==(null==t?void 0:t.disableCompression)?e:m.LogEventCompressionMode.Disabled)||m.LogEventCompressionMode.Enabled}Si(t){var e=Date.now(),i=null!=(i=this.Oi[t])?i:{count:0,lastRequestTime:e},n=e-i.lastRequestTime,n=Math.floor(.05*n);return i.count=Math.max(0,i.count-n),50<=i.count||(i.count+=1,i.lastRequestTime=e,this.Oi[t]=i,!1)}Xt(t){var e=null!=(e=t.fallbackUrl)?e:t.urlConfig.getUrl();t.urlConfig.endpoint!==w.Endpoint.qt&&t.urlConfig.endpoint!==w.Endpoint.Bt||(this.Jn=e);const i=$P({[w.NetworkParam.SdkKey]:t.sdkKey,[w.NetworkParam.SdkType]:o.SDKType.lt(t.sdkKey),[w.NetworkParam.SdkVersion]:u.SDK_VERSION,[w.NetworkParam.Time]:String(Date.now()),[w.NetworkParam.SessionID]:a.SessionID.get(t.sdkKey)},t.params);t=Object.keys(i).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(i[t])).join("&");return e+(t?"?"+t:"")}Pi(e){var t,i=(0,s.te)(),n=e.body;if(e.isStatsigEncodable&&!this.m.disableStatsigEncoding&&"string"==typeof n&&null==(0,v.i)("no-encode")&&null!=i&&i.btoa)try{e.body=i.btoa(n).split("").reverse().join(""),e.params=$P($P({},null!=(t=e.params)?t:{}),{[w.NetworkParam.StatsigEncoded]:"1"})}catch(t){S.Log.warn("Request encoding failed for "+e.urlConfig.getUrl(),t)}}Ci(d){return I(this,void 0,void 0,function*(){var e,i=d.body;if("string"==typeof i&&function(t,e){if(!t.isCompressable)return;if(null!=(0,v.i)("no-compress")||"undefined"==typeof CompressionStream||"undefined"==typeof TextEncoder)return;var i=null!=t.urlConfig.customUrl||null!=t.urlConfig.fallbackUrls,n=!0===f.SDKFlags.get(t.sdkKey,"enable_log_event_compression");switch(e.logEventCompressionMode){case m.LogEventCompressionMode.Disabled:return;case m.LogEventCompressionMode.Enabled:return i&&!n?void 0:1;case m.LogEventCompressionMode.Forced:return 1;default:return}}(d,this.m))try{for(var n,s=(new TextEncoder).encode(i),r=new CompressionStream("gzip"),o=r.writable.getWriter(),a=(o.write(s).catch(S.Log.error),o.close().catch(S.Log.error),r.readable.getReader()),l=[];!(n=yield a.read()).done;)l.push(n.value);var u=l.reduce((t,e)=>t+e.length,0),c=new Uint8Array(u);let t=0;for(const h of l)c.set(h,t),t+=h.length;d.body=c,d.params=$P($P({},null!=(e=d.params)?e:{}),{[w.NetworkParam.IsGzipped]:"1"})}catch(t){S.Log.warn("Request compression failed for "+d.urlConfig.getUrl(),t)}})}Ht(t,e){var i=this.Wt.getActiveFallbackUrl(e.sdkKey,e.urlConfig),t=$P($P({},e),{method:t,fallbackUrl:i});return"data"in e&&r(t,e.data),t}};const j=t=>!!t.sdkKey||(S.Log.warn("Unable to make request without an SDK key"),!1),r=(t,e)=>{var{sdkKey:i,fallbackUrl:n}=t,s=l.StableID.get(i),r=a.SessionID.get(i),i=o.SDKType.lt(i);t.body=JSON.stringify($P($P({},e),{statsigMetadata:$P($P({},u.StatsigMetadataProvider.get()),{stableID:s,sessionID:r,sdkType:i,fallbackUrl:n})}))};function T(t,e,i,n,s){t.urlConfig.endpoint===w.Endpoint.qt&&C.Diagnostics.$(t.sdkKey,C.Diagnostics.Z(e,i,n,s))}},308:function(t,e,i){var a=this&&this.__awaiter||$A();$Q(e),e.ee=e.NetworkFallbackResolver=void 0;const o=i(8809),n=i(1406),r=i(7512),l=i(4534);function u(t,e){t=null!=(t=null==t?void 0:t.toLowerCase())?t:"";return e||t.includes("uncaught exception")||t.includes("failed to fetch")||t.includes("networkerror when attempting to fetch resource")}function c(t){return"statsig.network_fallback."+(0,n.h)(t)}function h(t,e){t=c(t);e&&0!==Object.keys(e).length?l.Storage.setItem(t,JSON.stringify(e)):l.Storage.removeItem(t)}e.NetworkFallbackResolver=class{constructor(t){this.ne=null,this.$t=null,this.ie={},this.re=null==(t=t.networkConfig)?void 0:t.networkOverrideFunc}setErrorBoundary(t){this.$t=t}tryBumpExpiryTime(t,e){var i=null==(i=this.ne)?void 0:i[e.endpoint];i&&(i.expiryTime=Date.now()+6048e5,h(t,$P($P({},this.ne),{[e.endpoint]:i})))}getActiveFallbackUrl(t,e){var i;if(null!=e.customUrl&&null!=e.fallbackUrls)return null;let n=this.ne;null==n&&(n=null!=(s=function(t){t=c(t),t=l.Storage.getItem(t);if(!t)return null;try{return JSON.parse(t)}catch(t){return r.Log.error("Failed to parse FallbackInfo"),null}}(t))?s:{},this.ne=n);var s=n[e.endpoint];return!s||Date.now()>(null!=(i=s.expiryTime)?i:0)||e.getChecksum()!==s.urlConfigChecksum?(delete n[e.endpoint],this.ne=n,h(t,this.ne),null):s.url||null}tryFetchUpdatedFallbackInfo(n,s,r,o){return a(this,void 0,void 0,function*(){var e,t,i;try{return u(r,o)?(t=null==s.customUrl&&null==s.fallbackUrls?yield this.se(s):s.fallbackUrls,!!(i=this.le(null==(e=this.ne)?void 0:e[s.endpoint],t))&&(this.oe(n,s,i),!0)):!1}catch(t){return null!=(e=this.$t)&&e.logError("tryFetchUpdatedFallbackInfo",t),!1}})}oe(t,e,i){var i={urlConfigChecksum:e.getChecksum(),url:i,expiryTime:Date.now()+6048e5,previous:[]},e=e.endpoint,n=null==(n=this.ne)?void 0:n[e],n=(n&&i.previous.push(...n.previous),10<i.previous.length&&(i.previous=[]),null==(n=null==(n=this.ne)?void 0:n[e])?void 0:n.url);null!=n&&i.previous.push(n),this.ne=$P($P({},this.ne),{[e]:i}),h(t,this.ne)}se(r){return a(this,void 0,void 0,function*(){var t=this.ie[r.endpoint];if(t&&Date.now()<t)return null;this.ie[r.endpoint]=Date.now()+144e5;var e=[],t=yield(0,o.et)(null!=(t=this.re)?t:fetch),i=function(t){try{return new URL(t).pathname}catch(t){return null}}(r.defaultUrl);for(const s of t)if(s.startsWith(r.endpointDnsKey+"=")){var n=s.split("=");if(1<n.length){let t=n[1];t.endsWith("/")&&(t=t.slice(0,-1)),e.push("https://"+t+i)}}return e})}le(t,e){var i;if(null==e)return null;var n=new Set(null!=(i=null==t?void 0:t.previous)?i:[]),s=null==t?void 0:t.url;let r=null;for(const a of e){var o=a.endsWith("/")?a.slice(0,-1):a;if(!n.has(a)&&o!==s){r=o;break}}return r}},e.ee=u},1405:(t,e)=>{$Q(e)},1361:(t,e)=>{$Q(e)},3091:(t,e)=>{$Q(e),e.SDKFlags=void 0;const i={};e.SDKFlags={setFlags:(t,e)=>{i[t]=e},get:(t,e)=>{return null!=(t=null==(t=i[t])?void 0:t[e])&&t}}},5902:(t,e)=>{$Q(e),e.SDKType=void 0;const i={};let n;e.SDKType={lt:t=>{return(null!=(t=i[t])?t:"js-mono")+(null!==n&&void 0!==n?n:"")},ue(t,e){i[t]=e},ae(t){n&&"-react"!==n||(n="-"+t)}}},6830:(t,n)=>{$Q2(n,"__esModule",{value:!0}),n.Hn=n.Gt=n.ce=n.he=n.kt=n.de=n.te=void 0;n.te=()=>"undefined"!=typeof window?window:null,n.de=()=>{var t=(0,n.te)();return null!=(t=null==t?void 0:t.document)?t:null},n.kt=()=>{var t;return null===(0,n.de)()&&(t="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||t)},n.he=(t,e)=>{var i=(0,n.te)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.ce=(t,e)=>{var i=(0,n.de)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.Gt=()=>{var t;try{return null==(t=(0,n.te)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}};n.Hn=()=>{var t=(0,n.te)();return t&&"onpagehide"in t?"pagehide":"beforeunload"}},4143:(t,e,i)=>{$Q(e),e.StatsigSession=e.SessionID=void 0;const n=i(1845),s=i(2137),a=i(7512),l=i(4534),u=i(8023),c=18e5,h=144e5,d={};function v(e,t){return setTimeout(()=>{var t=null==(t=(0,n.l)())?void 0:t.instance(e);t&&t.$emt({name:"session_expired"})},t)}function f(t){return"statsig.session_id."+(0,s.o)(t)}e.SessionID={get:t=>e.StatsigSession.get(t).data.sessionID},e.StatsigSession={get:t=>{null==d[t]&&(d[t]=function(t){let e=function(t){t=f(t);return(0,l.G)(t)}(t);var i=Date.now();e=e||{sessionID:(0,u.getUUID)(),startTime:i,lastUpdate:i};return{data:e,sdkKey:t}}(t));var t=d[t],e=Date.now(),i=t.data,n=t.sdkKey,s=((function({lastUpdate:t}){return Date.now()-t>c}(i)||function({startTime:t}){return Date.now()-t>h}(i))&&(i.sessionID=(0,u.getUUID)(),i.startTime=e,o=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(n))&&o.$emt({name:"session_expired"}),i.lastUpdate=e,i),r=t.sdkKey;r=f(r);try{(0,l.L)(r,s)}catch(t){a.Log.warn("Failed to save SessionID")}clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID);var o=e-i.startTime;return t.idleTimeoutID=v(n,c),t.ageTimeoutID=v(n,h-o),t},overrideInitialSessionID:(t,e)=>{var i;d[e]=(t=t,e=e,i=Date.now(),{data:{sessionID:t,startTime:i,lastUpdate:i},sdkKey:e})}}},2176:(t,a)=>{$Q2(a,"__esModule",{value:!0}),a.hi=void 0;a.hi=(e,i)=>{let n=0;var s=Object.keys(e);for(let t=0;t<s.length;t++){var r=s[t],o=e[r];if((n=(n+=r.length)+("object"==typeof o&&null!==o?(0,a.hi)(o,i)+2:String(o).length+1))>=i)return n}return n}},9122:(t,e,i)=>{$Q(e),e.StableID=void 0;const n=i(2137),s=i(7512),r=i(6830),o=i(4534),a=i(8023),l={},u={},c={};function h(t){return"statsig.stable_id."+(0,n.o)(t)}function d(t,e){e=h(e);try{(0,o.L)(e,t)}catch(t){s.Log.warn("Failed to save StableID to storage")}}function v(t,e){var i;u[e]&&document&&((i=new Date).setFullYear(i.getFullYear()+1),document.cookie=`${f(e)}=${encodeURIComponent(t)}; expires=${i.toUTCString()}; path=/`)}function f(t){return"statsig.stable_id."+(0,n.o)(t)}e.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:t=>{if(c[t])return null;if(null!=l[t])return l[t];let e=null;return null!=(e=function(t){if(u[t]&&null!=(0,r.de)())for(const n of document.cookie.split(";")){var[e,i]=n.trim().split("=");if(e===f(t))return decodeURIComponent(i)}return null}(t))?d(l[t]=e,t):(d(e=null==(e=function(t){t=h(t);return(0,o.G)(t)}(t))?(0,a.getUUID)():e,t),v(e,t),l[t]=e),e},setOverride:(t,e)=>{d(l[e]=t,e),v(t,e)},Xn:(t,e)=>{u[t]=e},_e:(t,e)=>{c[t]=e}}},1375:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,i(1845);const o=i(1845),a=i(5542),l=i(7770),u=i(7512),r=i(7787),c=i(6830),h=i(4143),d=i(9122),s=i(586),v=i(4534);e.StatsigClientBase=class{constructor(t,e,i,n){this.loadingStatus="Uninitialized",this.ve=null,this.fe={};var s,r=this.$emt.bind(this);null!=(null==n?void 0:n.logLevel)&&(u.Log.level=n.logLevel),null!=n&&n.disableStorage&&v.Storage._e(!0),null!=n&&n.initialSessionID&&h.StatsigSession.overrideInitialSessionID(n.initialSessionID,t),null!=n&&n.storageProvider&&v.Storage.ge(n.storageProvider),null!=n&&n.enableCookies&&d.StableID.Xn(t,n.enableCookies),null!=n&&n.disableStableID&&d.StableID._e(t,!0),this.O=t,this.m=null!=n?n:{},this.ji={},this.overrideAdapter=null!=(s=null==n?void 0:n.overrideAdapter)?s:null,this.pe=new l.EventLogger(t,r,i,n),this.$t=new a.ErrorBoundary(t,n,r),this.$t.wrap(this),this.$t.wrap(e),this.$t.wrap(this.pe),i.setErrorBoundary(this.$t),this.dataAdapter=e,this.dataAdapter.attach(t,n,i),this.storageProvider=v.Storage,null!=(e=null==(r=null==(s=this.overrideAdapter)?void 0:s.loadFromStorage)?void 0:r.call(s))&&e.catch(t=>this.$t.logError("OA::loadFromStorage",t)),this.be(),n=t,i=this,(0,c.kt)()||(r=(0,o.l)(),s=null!=(s=r.instances)?s:{},i=i,null!=s[n]&&u.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),s[n]=i,r.firstInstance||(r.firstInstance=i),r.instances=s,__STATSIG__=r)}updateRuntimeOptions(t){t.loggingEnabled?(this.m.loggingEnabled=t.loggingEnabled,this.pe.setLoggingEnabled(t.loggingEnabled)):null!=t.disableLogging&&(this.m.disableLogging=t.disableLogging,this.pe.setLoggingEnabled(t.disableLogging?"disabled":"browser-only")),null!=t.disableStorage&&(this.m.disableStorage=t.disableStorage,v.Storage._e(t.disableStorage)),null!=t.enableCookies&&(this.m.enableCookies=t.enableCookies,d.StableID.Xn(this.O,t.enableCookies)),t.logEventCompressionMode?this.pe.setLogEventCompressionMode(t.logEventCompressionMode):t.disableCompression&&this.pe.setLogEventCompressionMode(s.LogEventCompressionMode.Disabled)}flush(){return this.pe.flush()}shutdown(){return n(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this.me("Uninitialized",null),this.ve=null,yield this.pe.stop()})}on(t,e){this.fe[t]||(this.fe[t]=[]),this.fe[t].push(e)}off(t,e){this.fe[t]&&-1!==(e=this.fe[t].indexOf(e))&&this.fe[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(i){var t;const e=e=>{try{e(i)}catch(t){!0===e.__isInternal?this.$t.logError("__emit:"+i.name,t):u.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",i)}};this.fe[i.name]&&this.fe[i.name].forEach(t=>e(t)),null!=(t=this.fe["*"])&&t.forEach(e)}me(t,e){this.loadingStatus=t,this.ji={},this.$emt({name:"values_updated",status:t,values:e})}ye(t,e,i){!0===(null==i?void 0:i.disableExposureLog)?this.pe.incrementNonExposureCount(t):this.pe.enqueue(e)}wi(n,s){return(t,e)=>{var i;return!this.m.disableEvaluationMemoization&&(i=(0,r.createMemoKey)(n,t,e))?(i in this.ji||(3e3<=Object.keys(this.ji).length&&(this.ji={}),this.ji[i]=s(t,e)),this.ji[i]):s(t,e)}}}},2636:(t,e)=>{$Q(e),e.ErrorTag=void 0,e.ErrorTag={NetworkError:"NetworkError"}},3206:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},1637:(t,e)=>{$Q(e),e.Oe=e.je=e.Ui=e.Se=e.xt=void 0;const r="statsig::config_exposure",o="statsig::gate_exposure",u="statsig::layer_exposure",c=(t,e,i,n,s)=>(i.bootstrapMetadata&&(n.bootstrapMetadata=i.bootstrapMetadata),{eventName:t,user:e,value:null,metadata:a(i,n),secondaryExposures:s,time:Date.now()});e.xt=({eventName:t})=>t===o||t===r||t===u;function h(t,e){return t.map(t=>"string"==typeof t?(null!=e?e:{})[t]:t).filter(t=>null!=t)}e.Se=(t,e,i)=>{var n,s={gate:e.name,gateValue:String(e.value),ruleID:e.ruleID};return null!=(null==(n=e.__evaluation)?void 0:n.version)&&(s.configVersion=e.__evaluation.version),c(o,t,e.details,s,h(null!=(t=null==(n=e.__evaluation)?void 0:n.secondary_exposures)?t:[],i))},e.Ui=h;e.je=(t,e,i)=>{var n,s={config:e.name,ruleID:e.ruleID};return null!=(null==(n=e.__evaluation)?void 0:n.version)&&(s.configVersion=e.__evaluation.version),null!=(null==(n=e.__evaluation)?void 0:n.passed)&&(s.rulePassed=String(e.__evaluation.passed)),c(r,t,e.details,s,h(null!=(t=null==(n=e.__evaluation)?void 0:n.secondary_exposures)?t:[],i))};e.Oe=(t,e,i,n)=>{var s=e.__evaluation,r=!0===(null==(r=null==s?void 0:s.explicit_parameters)?void 0:r.includes(i));let o="",a=null!=(l=null==s?void 0:s.undelegated_secondary_exposures)?l:[];r&&(o=null!=(l=s.allocated_experiment_name)?l:"",a=null!=(l=s.secondary_exposures)?l:[]);var l=null==(s=e.__evaluation)?void 0:s.parameter_rule_ids,l={config:e.name,parameterName:i,ruleID:null!=(s=null==l?void 0:l[i])?s:e.ruleID,allocatedExperiment:o,isExplicitParameter:String(r)};return null!=(null==(i=e.__evaluation)?void 0:i.version)&&(l.configVersion=e.__evaluation.version),c(u,t,e.details,l,h(a,n))};const a=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},8e3:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.22.0-beta.1";let i={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>i,add:t=>{i=$P($P({},i),t)}}},586:(t,e)=>{$Q(e),e.LoggingEnabledOption=e.LogEventCompressionMode=void 0,e.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},e.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}},1098:(t,e)=>{$Q(e)},2059:(t,e,i)=>{$Q(e),e.we=e.Te=e.ke=e.Ie=e.De=e.Ee=void 0;const o=i(7512),a=i(6634);function s(t,e,i,n){return{name:t,details:e,ruleID:null!=(t=null==i?void 0:i.rule_id)?t:"",__evaluation:i,value:n}}function n(t,e,i){var n=null!=(n=null==i?void 0:i.value)?n:{};return $P($P({},s(t,e,i,n)),{get:r(t,null==i?void 0:i.value)})}function r(n,s,r){return(t,e)=>{var i=null!=(i=null==s?void 0:s[t])?i:null;return null==i?null!=e?e:null:null==e||(0,a.Me)(i,e)?(null!=r&&r(t),i):(o.Log.warn(`Parameter type mismatch. '${n}.${t}' was found to be type '${typeof i}' but fallback/return type is '${typeof e}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=e?e:null)}}e.Ee=function(t,e,i){return $P($P({},s(t,e,i,!0===(null==i?void 0:i.value))),{idType:null!=(t=null==i?void 0:i.id_type)?t:null})},e.De=n,e.Ie=function(t,e,i){return t=n(t,e,i),$P($P({},t),{groupName:null!=(e=null==i?void 0:i.group_name)?e:null})},e.ke=function(t,e,i,n){return $P($P({},s(t,e,i,void 0)),{get:r(t,null==i?void 0:i.value,n),groupName:null!=(e=null==i?void 0:i.group_name)?e:null,__value:null!=(t=null==i?void 0:i.value)?t:{}})},e.Te=function(t,e,i,n){return $P($P($P({},t),e),{get:r(t.name,i,n)})},e.we=r},1812:(t,e)=>{$Q(e)},3932:(t,e)=>{$Q(e),e.UPDATE_DETAIL_ERROR_MESSAGES=e.createUpdateDetails=void 0;e.createUpdateDetails=(t,e,i,n,s,r)=>({duration:i,source:e,success:t,error:n,sourceUrl:s,warnings:r}),e.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."}},8578:(t,e,i)=>{$Q(e),e.v=e.T=void 0;const n=i(1406),s=i(7512);e.T=function(t,e,i){try{var n=JSON.parse(JSON.stringify(t));return null!=e&&null!=e.environment?n.statsigEnvironment=e.environment:null!=i&&(n.statsigEnvironment={tier:i}),n}catch(t){return s.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},e.v=function(t){return t?(0,n.Kt)(t):null}},4534:(t,i,e)=>{$Q2(i,"__esModule",{value:!0}),i.L=i.G=i.Storage=void 0;var n=e(7512),e=e(6830);const s={},r={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:t=>s[t]||null,setItem:(t,e)=>{s[t]=e},removeItem:t=>{delete s[t]},getAllKeys:()=>Object.keys(s)};let o=null;try{const c=(0,e.te)();c&&c.localStorage&&"function"==typeof c.localStorage.getItem&&(o={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>c.localStorage.getItem(t),setItem:(t,e)=>c.localStorage.setItem(t,e),removeItem:t=>c.localStorage.removeItem(t),getAllKeys:()=>Object.keys(c.localStorage)})}catch(t){n.Log.warn("Failed to setup localStorageProvider.")}let a=null!==o&&void 0!==o?o:r,l=a;function u(e){try{return e()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return i.Storage.ge(r),null;throw t instanceof Error&&"QuotaExceededError"===t.name&&(e=i.Storage.getAllKeys().filter(t=>t.startsWith("statsig.")),t.message=t.message+". Statsig Keys: "+e.length),t}}i.Storage={isReady:()=>l.isReady(),isReadyResolver:()=>l.isReadyResolver(),getProviderName:()=>l.getProviderName(),getItem:t=>u(()=>l.getItem(t)),setItem:(t,e)=>u(()=>l.setItem(t,e)),removeItem:t=>l.removeItem(t),getAllKeys:()=>l.getAllKeys(),ge:t=>{a=t,l=t},_e:t=>{l=t?r:a}},i.G=function(t){return t=i.Storage.getItem(t),JSON.parse(null!=t?t:"null")},i.L=function(t,e){i.Storage.setItem(t,JSON.stringify(e))}},3401:(t,e,i)=>{$Q(e),e.P=void 0;const s=i(7512);e.P=function(t,e,i){try{var n=JSON.parse(t);if(n&&"object"==typeof n&&e in n)return n}catch(t){}return s.Log.error("Failed to parse "+i),null}},6634:(t,e)=>{$Q(e),e.Me=e.zt=void 0,e.zt=function(t){return Array.isArray(t)?"array":typeof t},e.Me=function(t,e){var i=t=>Array.isArray(t)?"array":null===t?"null":typeof t;return i(t)===i(e)}},8023:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let i=(new Date).getTime(),n="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0<i?(e=(i+e)%16|0,i=Math.floor(i/16)):(e=(n+e)%16|0,n=Math.floor(n/16)),("x"===t?e:7&e|8).toString(16)})}},1881:(t,e,i)=>{$Q(e),e.UrlConfiguration=void 0;const n=i(1406),s=i(7410),r={[s.Endpoint.qt]:"i",[s.Endpoint.jt]:"e",[s.Endpoint.Bt]:"d"};e.UrlConfiguration=class{constructor(t,e,i,n){this.customUrl=null,this.fallbackUrls=null,this.endpoint=t,this.endpointDnsKey=r[t],e&&(this.customUrl=e),!e&&i&&(this.customUrl=i.endsWith("/")?""+i+t:i+"/"+t),n&&(this.fallbackUrls=n);e=s.NetworkDefault[t];this.defaultUrl=e+"/"+t}getUrl(){var t;return null!=(t=this.customUrl)?t:this.defaultUrl}getChecksum(){var t=(null!=(t=this.fallbackUrls)?t:[]).sort().join(",");return(0,n.h)(this.customUrl+t)}}},2397:(t,e,i)=>{$Q(e),e.Ae=e.It=e.Rt=e.xe=void 0;i=i(6830);const n="foreground",s="background",r=[];let o=n,a=!1;e.xe=()=>o===n,e.Rt=()=>a,e.It=t=>{r.unshift(t)};e.Ae=e=>{e!==o&&(o=e,r.forEach(t=>t(e)))},(0,i.he)("focus",()=>{(a=!1,e.Ae)(n)}),(0,i.he)("blur",()=>(0,e.Ae)(s)),(0,i.ce)("visibilitychange",()=>{(0,e.Ae)("visible"===document.visibilityState?n:s)}),(0,i.he)((0,i.Hn)(),()=>{a=!0,(0,e.Ae)(s)})},6914:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)},r=($Q(e),e.Storage=e.Log=e.EventLogger=e.Diagnostics=void 0,i(1845),i(1845));const o=i(8962),a=($Q2(e,"Diagnostics",{enumerable:!0,get:function(){return o.Diagnostics}}),i(7770)),l=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return a.EventLogger}}),i(7512));$Q2(e,"Log",{enumerable:!0,get:function(){return l.Log}});var u=i(8e3);const c=i(4534);$Q2(e,"Storage",{enumerable:!0,get:function(){return c.Storage}}),s(i(1845),e),s(i(2137),e),s(i(6427),e),s(i(694),e),s(i(8962),e),s(i(3539),e),s(i(5542),e),s(i(2922),e),s(i(2417),e),s(i(1406),e),s(i(1333),e),s(i(7512),e),s(i(7787),e),s(i(7410),e),s(i(7023),e),s(i(1405),e),s(i(1361),e),s(i(6830),e),s(i(5902),e),s(i(4143),e),s(i(2176),e),s(i(9122),e),s(i(1375),e),s(i(2636),e),s(i(3206),e),s(i(1637),e),s(i(8e3),e),s(i(586),e),s(i(1098),e),s(i(2059),e),s(i(1812),e),s(i(8578),e),s(i(4534),e),s(i(3401),e),s(i(6634),e),s(i(1881),e),s(i(8023),e),s(i(2397),e),s(i(3932),e),s(i(3091),e),$P((0,r.l)(),{Log:l.Log,SDK_VERSION:u.SDK_VERSION})},2016:(t,e,i)=>{$Q(e),e.AutoInit=void 0;const y=i(6914),b=i(2018);function I(t,e){var i;return null!=(i=e.get(t))?i:e.get(t.toLowerCase())}e.AutoInit=class{static attempt(e){var t,i,n,s,r;try{var o=(0,y.te)(),a=(0,y.de)();if(o&&a&&a.currentScript){var l=a.currentScript.getAttribute("src"),u=null==(t=o.location)?void 0:t.href;if(l&&u){var c=new URL(l,u).searchParams,h=null!=(i=I("sdkKey",c))?i:I("apiKey",c);if(h){var d={},v=I("proxy",c),f=(v&&(d.networkConfig={api:v}),null==(s=null==(n=(0,y.l)())?void 0:n.instances)?void 0:s[h]);let t=null;if(t=f instanceof b.StatsigClient?f:t)e({sdkKey:h,client:t});else{var m=a.currentScript.dataset;const p=function(t,e){if(t)if(t in e&&"function"==typeof e[t])return e[t];return null}(null!=(r=m.onstatsiginit)?r:m.onStatsigInit,o),g=new b.StatsigClient(h,function(){var t=(0,y.te)();if(!t)return{};let e=t.statsigUser||{};var i=(e="object"!=typeof e?{}:e).custom||{},n=e.customIDs||{};return $P($P({},e),{customIDs:$P({},n),custom:$P($P({},i),{useragent:t.navigator.userAgent,page_url:(0,y.Gt)()||"",language:null==(n=t.navigator)?void 0:n.language})})}(),d);g.initializeAsync().then(()=>{p&&p(g)}).catch(t=>{y.Log.error(t)}),e({sdkKey:h,client:g})}}}}}catch(t){y.Log.error("AutoInit failed",t)}}}},2043:function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=($Q(e),n(i(2018)));const s=i(3447);i=i(2016);e.default=n.default,i.AutoInit.attempt(({client:t})=>{new s.SessionReplay(t)})},7262:(t,e,i)=>{$Q(e),e.Ne=void 0;const n=i(6914);function s(t,e){null!=t&&t.forEach(t=>{delete e[t]})}e.Ne=function(t,e){var i;return(e=(0,n.P)(e,"checksum","DeltasEvaluationResponse"))?(t=t,i=e,t=$P($P($P({},t),i),{feature_gates:$P($P({},t.feature_gates),i.feature_gates),layer_configs:$P($P({},t.layer_configs),i.layer_configs),dynamic_configs:$P($P({},t.dynamic_configs),i.dynamic_configs)}),s((t=i=t).deleted_gates,t.feature_gates),delete t.deleted_gates,s(i.deleted_configs,t.dynamic_configs),delete t.deleted_configs,s(i.deleted_layers,t.layer_configs),delete t.deleted_layers,i=t,(t=(0,n.Kt)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs},2))===e.checksumV2?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:t,badMergedConfigs:i,badFullResponse:e.deltas_full_response}):{hadBadDeltaChecksum:!0}}},4845:(t,e,i)=>{$Q(e);const s=i(6914);e.default=class{constructor(t){this.O=t,this.Re=null,this.Pe=null,this.Ce="Uninitialized",this.Ue=0,this.Fe=0,this.Ge=null,this.Le=new Set}reset(){this.Pe=null,this.Re=null,this.Ce="Loading",this.Ue=0,this.Fe=0,this.Ge=null,this.Le.clear()}finalize(){this.Pe||(this.Ce="NoValues")}getValues(){return this.Re?(0,s.P)(this.Re,"has_updates","EvaluationStoreValues"):null}setValues(t,e){var i;return!!t&&null!=(i=(0,s.P)(t.data,"has_updates","EvaluationResponse"))&&(this.Ce=t.source,!0===(null==i?void 0:i.has_updates)&&(this.Re=t.data,this.Ue=i.time,this.Fe=t.receivedAt,this.Pe=i,this.Ge=this.Ke(t.source,i),t.source&&i.user&&this.ze(e,i),s.SDKFlags.setFlags(this.O,null!=(t=i.sdk_flags)?t:{})),!0)}getWarnings(){if(0!==this.Le.size)return Array.from(this.Le)}getGate(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.feature_gates,t)}getConfig(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.dynamic_configs,t)}getConfigList(){var t;return null!=(t=this.Pe)&&t.dynamic_configs?Object.values(this.Pe.dynamic_configs).map(t=>t.name):[]}getLayer(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.layer_configs,t)}getParamStore(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.param_stores,t)}getSource(){return this.Ce}getExposureMapping(){var t;return null==(t=this.Pe)?void 0:t.exposures}Ke(t,e){return"Bootstrap"!==t?null:(t={},e.user&&(t.user=e.user),e.sdkInfo&&(t.generatorSDKInfo=e.sdkInfo),t.lcut=e.time,t)}qe(t,e){let i=null;return{result:i=t?t[e]||t[(0,s.h)(e)]:i,details:this.Be(null==i)}}ze(t,e){var i,n=s.StableID.get(this.O);(null==(i=t.customIDs)?void 0:i.stableID)!==n&&(null!=(i=t.customIDs)&&i.stableID||n)?this.Le.add("StableIDMismatch"):"user"in e&&(i=e.user,n=$P($P({},t),{analyticsOnlyMetadata:void 0,privateAttributes:void 0}),(0,s.v)(n)!==(0,s.v)(i))&&this.Le.add("PartialUserMatch")}getCurrentSourceDetails(){var t;return"Uninitialized"===this.Ce||"NoValues"===this.Ce?{reason:this.Ce}:(t={reason:this.Ce,lcut:this.Ue,receivedAt:this.Fe},0<this.Le.size&&(t.warnings=Array.from(this.Le)),t)}Be(t){var e=this.getCurrentSourceDetails();let i=e.reason;var n=null!=(n=e.warnings)?n:[],t=("Bootstrap"===this.Ce&&0<n.length&&(i+=n[0]),"Uninitialized"!==i&&"NoValues"!==i&&(i=i+":"+(t?"Unrecognized":"Recognized")),"Bootstrap"===this.Ce&&null!=(n=this.Ge)?n:void 0);return t&&(e.bootstrapMetadata=t),$P($P({},e),{reason:i})}}},8448:function(t,e,i){var l=this&&this.__awaiter||$A();$Q(e);const u=i(6914),o=i(7262);class n extends u.NetworkCore{constructor(t,e){super(t,e);e=null==t?void 0:t.networkConfig;this.Fi=t,this.Ve=new u.UrlConfiguration(u.Endpoint.qt,null==e?void 0:e.initializeUrl,null==e?void 0:e.api,null==e?void 0:e.initializeFallbackUrls)}fetchEvaluations(n,s,r,o,a){return l(this,void 0,void 0,function*(){var t,e=s?(0,u.P)(s,"has_updates","InitializeResponse"):null;let i={user:o,hash:null!=(t=null==(t=null==(t=this.Fi)?void 0:t.networkConfig)?void 0:t.initializeHashAlgorithm)?t:"djb2",deltasResponseRequested:!1,full_checksum:null};return null!=e&&e.has_updates&&(t=(null==e?void 0:e.hash_used)!==(null!=(t=null==(t=null==(t=this.Fi)?void 0:t.networkConfig)?void 0:t.initializeHashAlgorithm)?t:"djb2"),i=$P($P({},i),{sinceTime:a&&!t?e.time:0,previousDerivedFields:"derived_fields"in e&&a?e.derived_fields:{},deltasResponseRequested:!0,full_checksum:e.full_checksum,partialUserMatchSinceTime:t?0:e.time})),this.Je(n,e,i,r)})}Je(i,n,s,r){return l(this,void 0,void 0,function*(){var t,e=yield this.post({sdkKey:i,urlConfig:this.Ve,data:s,retries:2,isStatsigEncodable:!0,priority:r});return 204===(null==e?void 0:e.code)?'{"has_updates": false}':200!==(null==e?void 0:e.code)?null!=(t=null==e?void 0:e.body)?t:null:!0!==(null==n?void 0:n.has_updates)||!0!==(null==(t=e.body)?void 0:t.includes('"is_delta":true'))||!0!==s.deltasResponseRequested?e.body:"string"==typeof(t=(0,o.Ne)(n,e.body))?t:this.Je(i,n,$P($P($P({},s),t),{deltasResponseRequested:!1}),r)})}}e.default=n},3583:(t,e,i)=>{$Q(e),e.$e=void 0;const d=i(6914),v={disableExposureLog:!0};function f(t){return null==t||!1===t.disableExposureLog}function m(t,e){return null!=e&&!(0,d.Me)(t,e)}e.$e=function(u,c,h){return(t,e)=>{if(null==c)return e;var i,n,s,r,o,a,l=c[t];if(null==l||null!=e&&(0,d.zt)(e)!==l.param_type)return e;switch(l.ref_type){case"static":return l.value;case"gate":return a=l,u.getFeatureGate(a.gate_name,f(h)?void 0:v).value?a.pass_value:a.fail_value;case"dynamic_config":return a=l,o=e,m(r=(r=u).getDynamicConfig(a.config_name,f(h)?void 0:v).get(a.param_name),o)?o:r;case"experiment":return o=l,r=e,m(s=(s=u).getExperiment(o.experiment_name,f(h)?void 0:v).get(o.param_name),r)?r:s;case"layer":return s=l,n=e,m(i=(i=u).getLayer(s.layer_name,f(h)?void 0:v).get(s.param_name),n)?n:i;default:return e}}}},8198:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e);const o=i(6914),a=i(4845),l=i(8448),s=i(3583),u=i(4131);class n extends o.StatsigClientBase{static instance(t){var e=(0,o.l)().instance(t);return e instanceof n?e:(o.Log.warn((0,o.kt)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new n(null!=t?t:"",{}))}constructor(t,e,i=null){o.SDKType.ue(t,"javascript-client");var n,s=new l.default(i,t=>{this.$emt(t)}),t=(super(t,null!=(n=null==i?void 0:i.dataAdapter)?n:new u.StatsigEvaluationsDataAdapter,s,i),this.ar={},this.getFeatureGate=this.wi(o.MemoPrefix.Kn,this.Ti.bind(this)),this.getDynamicConfig=this.wi(o.MemoPrefix.Ln,this.Ii.bind(this)),this.getExperiment=this.wi(o.MemoPrefix.Vn,this.ki.bind(this)),this.getConfigList=this.wi(o.MemoPrefix.Ts,this.Ds.bind(this)),this.getLayer=this.wi(o.MemoPrefix.$n,this.Di.bind(this)),this.getParameterStore=this.wi(o.MemoPrefix.Bn,this.Ri.bind(this)),this.We=new a.default(t),this.ht=s,this.He=this.xi(e,i),this.js=(0,o.getUUID)(),null!=(n=null==i?void 0:i.plugins)?n:[]);for(const r of t)r.bind(this)}initializeSync(t){var e;return"Uninitialized"!==this.loadingStatus?(0,o.createUpdateDetails)(!0,this.We.getSource(),-1,null,null,["MultipleInitializations",...null!=(e=this.We.getWarnings())?e:[]]):(this.pe.start(),this.updateUserSync(this.He,t))}initializeAsync(t){return r(this,void 0,void 0,function*(){return this.ve||(this.ve=this.Ye(t)),this.ve})}updateUserSync(e,t){var i=performance.now();try{return this.zi(e,t,i)}catch(t){e=t instanceof Error?t:new Error(String(t));return this.Ki(e,i)}}zi(t,e,i){var n=[...null!=(n=this.We.getWarnings())?n:[]],t=(this.Xe(t),this.dataAdapter.getDataSync(this.He)),e=(null==t&&n.push("NoCachedValues"),this.We.setValues(t,this.He),this.Qe(t),null==e?void 0:e.disableBackgroundCacheRefresh);return!0===e||null==e&&"Bootstrap"===(null==t?void 0:t.source)||this.Ze(null!=t?t:null,this.He),(0,o.createUpdateDetails)(!0,this.We.getSource(),performance.now()-i,this.$t.getLastSeenErrorAndReset(),this.ht.getLastUsedInitUrlAndReset(),n)}updateUserAsync(t,n){return r(this,void 0,void 0,function*(){var e=performance.now();try{return yield this.qi(t,n)}catch(t){var i=t instanceof Error?t:new Error(String(t));return this.Ki(i,e)}})}qi(n,s){return r(this,void 0,void 0,function*(){this.Xe(n);var t=this.He,e=(o.Diagnostics.B(this.O),this.dataAdapter.getDataSync(t));if(this.We.setValues(e,this.He),this.me("Loading",e),e=yield this.dataAdapter.getDataAsync(e,t,s),t!==this.He)return(0,o.createUpdateDetails)(!1,this.We.getSource(),-1,new Error("User changed during update"),this.ht.getLastUsedInitUrlAndReset());let i=!1;null!=e&&(o.Diagnostics.W(this.O),i=this.We.setValues(e,this.He),o.Diagnostics.H(this.O,{success:i})),this.Qe(e),i||(this.$t.attachErrorIfNoneExists(o.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),o.Diagnostics.V(this.O,i,this.We.getCurrentSourceDetails());t=o.Diagnostics.tt(this.He,this.pe,this.O,this.m);return(0,o.createUpdateDetails)(i,this.We.getSource(),t,this.$t.getLastSeenErrorAndReset(),this.ht.getLastUsedInitUrlAndReset(),this.We.getWarnings())})}getContext(){return{sdkKey:this.O,options:this.m,values:this.We.getValues(),user:JSON.parse(JSON.stringify(this.He)),errorBoundary:this.$t,session:o.StatsigSession.get(this.O),stableID:o.StableID.get(this.O),sdkInstanceID:this.js}}checkGate(t,e){return this.getFeatureGate(t,e).value}logEvent(t,e,i){e="string"==typeof t?{eventName:t,value:e,metadata:i}:t;this.$emt({name:"log_event_called",event:e}),this.pe.enqueue($P($P({},e),{user:this.He,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(t){this.He=this.xi($P($P({},this.He),{analyticsOnlyMetadata:t}),this.m)}be(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Qe(null)})}Ye(t){return r(this,void 0,void 0,function*(){return o.Storage.isReady()||(yield o.Storage.isReadyResolver()),this.pe.start(),this.updateUserAsync(this.He,t)})}Ki(t,e){return(0,o.createUpdateDetails)(!1,this.We.getSource(),performance.now()-e,t,null,[...null!=(e=this.We.getWarnings())?e:[]])}Qe(t){this.We.finalize(),this.me("Ready",t)}Ze(t,e){this.dataAdapter.getDataAsync(t,e,{priority:"low"}).catch(t=>{o.Log.error("An error occurred after update.",t)})}Xe(t){this.pe.reset(),this.We.reset(),this.He=this.xi(t,this.m)}xi(t,e){t=(0,o.T)(t,e),e=null==(e=t.customIDs)?void 0:e.stableID;return e&&o.StableID.setOverride(e,this.O),0<Object.keys(this.ar).length&&(t.analyticsOnlyMetadata=$P($P({},t.analyticsOnlyMetadata),this.ar)),t}Ti(t,e){var{result:i,details:n}=this.We.getGate(t),n=(0,o.Ee)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getGateOverride)?void 0:s.call(i,n,this.He,e),i=null!=s?s:n;return this.ye(t,(0,o.Se)(this.He,i,this.We.getExposureMapping()),e),this.$emt({name:"gate_evaluation",gate:i}),i}Ii(t,e){var{result:i,details:n}=this.We.getConfig(t),n=(0,o.De)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,n,this.He,e),i=null!=s?s:n;return this.ye(t,(0,o.je)(this.He,i,this.We.getExposureMapping()),e),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}ki(t,e){var{result:i,details:n}=this.We.getConfig(t),n=(0,o.Ie)(t,n,i),s=(null!=n.__evaluation&&(n.__evaluation.secondary_exposures=(0,o.Ui)(null!=(i=null==(i=n.__evaluation)?void 0:i.secondary_exposures)?i:[],this.We.getExposureMapping())),null==(s=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:s.call(i,n,this.He,e)),i=null!=s?s:n;return this.ye(t,(0,o.je)(this.He,i,this.We.getExposureMapping()),e),this.$emt({name:"experiment_evaluation",experiment:i}),i}Ds(){return this.We.getConfigList()}Di(e,i){var{result:t,details:n}=this.We.getLayer(e),n=(0,o.ke)(e,n,t),s=null==(s=null==(t=this.overrideAdapter)?void 0:t.getLayerOverride)?void 0:s.call(t,n,this.He,i);null!=i&&i.disableExposureLog&&this.pe.incrementNonExposureCount(e);const r=(0,o.Te)(n,s,null!=(t=null==s?void 0:s.__value)?t:n.__value,t=>{null!=i&&i.disableExposureLog||this.ye(e,(0,o.Oe)(this.He,r,t,this.We.getExposureMapping()),i)});return this.$emt({name:"layer_evaluation",layer:r}),r}Ri(t,e){var{result:i,details:n}=this.We.getParamStore(t),t=(this.pe.incrementNonExposureCount(t),{name:t,details:n,__configuration:i,get:(0,s.$e)(this,i,e)}),i=null==(i=null==(n=this.overrideAdapter)?void 0:n.getParamStoreOverride)?void 0:i.call(n,t,e);return null!=i&&(t.__configuration=i.config,t.details=i.details,t.get=(0,s.$e)(this,i.config,e)),t}}e.default=n},4131:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigEvaluationsDataAdapter=void 0;const n=i(6914),s=i(8448);class o extends n.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this.ht=null,this.m=null}attach(t,e,i){super.attach(t,e,i),null!==i&&i instanceof s.default?this.ht=i:this.ht=new s.default(null!=e?e:{})}getDataAsync(t,e,i){return this.D(t,(0,n.T)(e,this.m),i)}prefetchData(t,e){return this.A(t,e)}setData(t){var e=(0,n.P)(t,"has_updates","data");e&&"user"in e?super.setData(t,e.user):n.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(t,e){super.setData(t,e)}R(e,i,n,s){return r(this,void 0,void 0,function*(){var t=yield null==(t=this.ht)?void 0:t.fetchEvaluations(this.C(),e,null==n?void 0:n.priority,i,s);return null!=t?t:null})}k(t){t=(0,n.o)(this.C(),t,null==(t=this.m)?void 0:t.customUserCacheKeyFunc);return`${n.DataAdapterCachePrefix}.${this.p}.`+t}N(t,e){return null!=t.fullUserHash&&t.fullUserHash===(0,n.v)(e)}}e.StatsigEvaluationsDataAdapter=o},2018:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)},r=($Q(e),e.StatsigClient=void 0,i(6914)),o=i(8198),s=(e.StatsigClient=o.default,s(i(6914),e),$P((0,r.l)(),{StatsigClient:o.default}));e.default=s},8788:(t,e,i)=>{$Q(e),e.SessionReplay=e.runStatsigSessionReplay=e.StatsigSessionReplayPlugin=void 0;const n=i(6914);var s=i(4069);const r=i(5967);function o(t,e){new a(t,e)}e.StatsigSessionReplayPlugin=class{constructor(t){this.options=t,this.__plugin="session-replay"}bind(t){o(t,this.options)}},e.runStatsigSessionReplay=o;class a extends s.SessionReplayBase{constructor(t,e){super(t,e),this.tn.$on("values_updated",()=>{var t;this.ts||this.li(null==(t=this.m)?void 0:t.forceRecording)}),this.li(null==(t=this.m)?void 0:t.forceRecording)}ri(t){super.es(t)}li(t=!1){var e;this.ns>=r.MAX_LOGS||(!0===(null==(e=this.tn.getContext().values)?void 0:e.recording_blocked)||!t&&!0!==(null==e?void 0:e.can_record_session)||!1===(null==e?void 0:e.passes_session_recording_targeting)?this.ri():this.si.isRecording()||(this.ts=!1,n.StatsigMetadataProvider.add({isRecordingSession:"true"}),this.si.record((t,e)=>this.ci(t,e),null!=(e=null==(t=this.m)?void 0:t.rrwebConfig)?e:{},()=>{this.ri()})))}}e.SessionReplay=a},4069:(t,e,i)=>{$Q(e),e.SessionReplayBase=e.forceStartRecording=e.startRecording=e.stopRecording=void 0;const u=i(6914),n=i(759),c=i(5967);function s(t){var e=null==t?(0,u.l)().firstSRInstance:null==(e=null==(e=(0,u.l)())?void 0:e.srInstances)?void 0:e[t];return e instanceof r?e:null}e.stopRecording=function(t){null!=(t=s(t))&&t.stopRecording()},e.startRecording=function(t){null!=(t=s(t))&&t.startRecording()},e.forceStartRecording=function(t){null!=(t=s(t))&&t.forceStartRecording()};class r{constructor(t,e){this.ti={startTime:-1,endTime:0,clickCount:0},this.ei=[],this.ts=!1,this.ss=0,this.ns=0,this.tn=t,this.m=e;var{sdkKey:t,errorBoundary:e}=this.tn.getContext();this.$t=e,this.$t.wrap(this),this.si=new n.SessionReplayClient,this.tn.$on("pre_shutdown",()=>this.ri()),this.tn.on("session_expired",()=>{this.ri("session_expired")}),(0,u.kt)()||((e=(0,u.l)()).srInstances=$P($P({},e.srInstances),{[t]:this}),e.firstSRInstance)||(e.firstSRInstance=this),this.ii=this.ni(),this.ui()}forceStartRecording(){this.ts=!1,this.li(!0)}stopRecording(){this.ts=!0,this.ri()}startRecording(){var t;this.ts=!1,this.li(null==(t=this.m)?void 0:t.forceRecording)}isRecording(){return this.si.isRecording()}oi(t){0!==this.ei.length&&(t=(0,u.Rt)()?"is_leaving_page":t,this.vi(this.ii,t))}ai(t){"background"===t&&(this.oi(),this.tn.flush().catch(t=>{this.$t.logError("SR::visibility",t)}))}ui(){const i=this.tn.getContext()["sdkKey"];(0,u.It)(t=>{var e=null==(e=null==(e=(0,u.l)())?void 0:e.srInstances)?void 0:e[i];e instanceof r&&e.ai(t)})}vi(e,i){var n=this.ti;if(0!==this.ei.length){var s=JSON.stringify(this.ei),r=(0,c.rs)(s),o=1<r.length?(0,u.getUUID)():null;for(let t=0;t<r.length;t++){var a=r[t],l=(0,c.ls)(a,s,e,n,this.tn.getContext().sdkInstanceID);null!=o&&(0,c.os)(l.metadata,o,t,r.length,a.length),i&&(l.metadata[i]="true"),this.ns++,this.tn.logEvent(l),null!=o&&this.tn.flush().catch(t=>{u.Log.error(t)})}this.ei=[],this.ns>c.MAX_LOGS&&this.ri()}}di(){this.ni(),this.oi()}ni(){return this.tn.getContext().session.data.sessionID}es(t){this.si.isRecording()&&(this.si.stop(),u.StatsigMetadataProvider.add({isRecordingSession:"false"})),0!==this.ei.length&&this.oi(t),"session_expired"===t&&(this.ss=0,this.ti=this.us())}us(){return{startTime:-1,endTime:0,clickCount:0}}ci(t,e){var i;this.ii!==this.ni()?this.ri("session_expired"):this.ns>=c.MAX_LOGS?this.ri():(t.eventIndex=this.ss++,this.ti.clickCount+=e.clickCount,this.ti.startTime=-1===this.ti.startTime?e.startTime:Math.min(this.ti.startTime,e.startTime),this.ti.endTime=Math.max(this.ti.endTime,e.endTime),(e=(0,u.hi)(t,c.MAX_INDIVIDUAL_EVENT_BYTES))>c.MAX_INDIVIDUAL_EVENT_BYTES?u.Log.warn(`SessionReplay event is too large (~${e} bytes) and will not be logged`,t):(i=(0,u.hi)(this.ei,c.REPLAY_ENQUEUE_TRIGGER_BYTES),this.ei.push(t),i+e<c.REPLAY_ENQUEUE_TRIGGER_BYTES||((0,u.xe)()?this.di():this.oi())))}}e.SessionReplayBase=r},759:(t,e,i)=>{$Q(e),e.SessionReplayClient=void 0;const n=i(670),o=i(6914);e.SessionReplayClient=class{constructor(){this.fi=null,this._i=null}record(s,t,e,r=!1){null==(0,o.de)()||(this.fi=null,this._i=null,this.bi=e,this.pi)||(this.pi=(e=(t,e)=>{var i;r?this.fi=!e&&null!=(i=this.fi)?i:t.timestamp:null==this.fi&&(this.fi=t.timestamp),this._i=t.timestamp;let n=0;3!==(i=t).type||2!==i.data.source||2!==i.data.type&&4!==i.data.type||n++,s($P($P({},t),{eventIndex:0}),{startTime:this.fi,endTime:this._i,clickCount:n},null!=e&&e),144e5<this._i-this.fi&&(null!=(t=this.pi)&&t.call(this),this.bi)&&this.bi()},t=t,r?(0,n.record)($P($P({},t),{emit:e,checkoutEveryNms:3e4})):(0,n.record)($P($P({},t),{emit:e}))))}stop(){this.pi&&(this.pi(),this.pi=void 0)}isRecording(){return null!=this.pi}}},5967:(t,e,i)=>{$Q(e),e.os=e.rs=e.ls=e.MAX_LOGS=e.MAX_INDIVIDUAL_EVENT_BYTES=e.REPLAY_ENQUEUE_TRIGGER_BYTES=void 0;const r=i(6914);e.REPLAY_ENQUEUE_TRIGGER_BYTES=10240,e.MAX_INDIVIDUAL_EVENT_BYTES=10485760,e.MAX_LOGS=1e4,e.ls=function(t,e,i,n,s){return{eventName:"statsig::session_recording",value:i,metadata:{session_start_ts:String(n.startTime),session_end_ts:String(n.endTime),clicks_captured_cumulative:String(n.clickCount),rrweb_events:t,rrweb_payload_size:String(e.length),session_replay_sdk_version:r.SDK_VERSION,sdk_instance_id:s}}},e.rs=function(e){var i=[];for(let t=0;t<e.length;t+=1048576)i.push(e.slice(t,t+1048576));return i},e.os=function(t,e,i,n,s){t.sliced_id=e,t.slice_index=String(i),t.slice_count=String(n),t.slice_byte_size=String(s)}},3691:(t,e,i)=>{$Q(e),e.TriggeredSessionReplay=e.runStatsigTriggeredSessionReplay=e.StatsigTriggeredSessionReplayPlugin=void 0;const s=i(6914);var n=i(4069);const r=i(5967);function o(t,e){new a(t,e)}e.StatsigTriggeredSessionReplayPlugin=class{constructor(t){this.options=t,this.__plugin="triggered-session-replay"}bind(t){o(t,this.options)}},e.runStatsigTriggeredSessionReplay=o;class a extends n.SessionReplayBase{constructor(t,e){super(t,e),this.cs=[],this.hs=!1,this.ds(e),null!=e&&e.autoStartRecording?this.li(null==(t=this.m)?void 0:t.forceRecording):null!=e&&e.keepRollingWindow&&this.vs()}ds(t){this.fs(t),this.gs(),this._s(),this.ps()}fs(e){this.tn.$on("values_updated",()=>{var t;this.ts||(null!=e&&e.autoStartRecording?this.li(null==(t=this.m)?void 0:t.forceRecording):null!=e&&e.keepRollingWindow&&this.vs())})}gs(){this.tn.$on("log_event_called",t=>{var e;this.ts||!1===(null==(e=this.tn.getContext().values)?void 0:e.passes_session_recording_targeting)||null==(null==e?void 0:e.session_recording_event_triggers)||null==(e=e.session_recording_event_triggers[t.event.eventName])||!1===e.passes_sampling||null!=(e=e.values)&&!e.includes(String(null!=(e=t.event.value)?e:""))||this.li(!0)})}_s(){this.tn.$on("gate_evaluation",t=>{this.bs(t.gate.name,String(t.gate.value))})}ps(){this.tn.$on("experiment_evaluation",t=>{this.bs(t.experiment.name,null!=(t=t.experiment.groupName)?t:"")})}bs(t,e){var i,n;this.ts||!1===(null==(n=this.tn.getContext().values)?void 0:n.passes_session_recording_targeting)||null==(null==n?void 0:n.session_recording_exposure_triggers)||null==(i=null!=(i=n.session_recording_exposure_triggers[t])?i:n.session_recording_exposure_triggers[(0,s.h)(t)])||!1===i.passes_sampling||null!=(n=i.values)&&!n.includes(e)||this.li(!0)}forceStartRecording(){super.forceStartRecording()}stopRecording(){this.hs=!1,this.cs=[],super.stopRecording()}ys(){if(this.hs=!0,0!==this.cs.length){var e=this.cs.map(t=>t.events).flat();for(let t=0;t<e.length;t++)e[t].event.eventIndex=t,this.ti.clickCount+=e[t].data.clickCount,this.ti.startTime=-1===this.ti.startTime?e[t].data.startTime:Math.min(this.ti.startTime,e[t].data.startTime),this.ti.endTime=Math.max(this.ti.endTime,e[t].data.endTime);this.ei=e.map(t=>t.event),this.ss=e.length,(0,s.xe)()?this.di():this.oi(),this.si.stop()}}ri(t){this.hs=!1,this.cs=[],super.es(t)}ci(t,e,i){if(!this.hs)return this.ii!==this.ni()?void this.ri("session_expired"):void(i&&4===t.type||0===this.cs.length?(1<this.cs.length&&this.cs.shift(),this.cs.push({events:[{event:t,data:e}]})):this.cs[this.cs.length-1].events.push({event:t,data:e}));super.ci(t,e)}vs(){var t=this.tn.getContext().values;!1===(null==t?void 0:t.passes_session_recording_targeting)?this.ri():this.si.isRecording()||this.si.record((t,e,i)=>this.ci(t,e,i),null!=(t=null==(t=this.m)?void 0:t.rrwebConfig)?t:{},()=>{this.ri()},!0)}li(t=!1){var e;this.ns>=r.MAX_LOGS||(!0===(null==(e=this.tn.getContext().values)?void 0:e.recording_blocked)||!t&&!0!==(null==e?void 0:e.can_record_session)||!1===(null==e?void 0:e.passes_session_recording_targeting)?this.ri():(this.ys(),this.ts=!1,s.StatsigMetadataProvider.add({isRecordingSession:"true"}),this.si.isRecording()||this.si.record((t,e,i)=>this.ci(t,e,i),null!=(e=null==(t=this.m)?void 0:t.rrwebConfig)?e:{},()=>{this.ri()})))}}e.TriggeredSessionReplay=a},3447:(t,e,i)=>{$Q(e),e.forceStartRecording=e.stopRecording=e.startRecording=e.StatsigTriggeredSessionReplayPlugin=e.StatsigSessionReplayPlugin=e.runStatsigTriggeredSessionReplay=e.runStatsigSessionReplay=e.SessionReplay=e.SessionReplayClient=void 0;var n=i(6914);const s=i(8788),r=($Q2(e,"SessionReplay",{enumerable:!0,get:function(){return s.SessionReplay}}),$Q2(e,"StatsigSessionReplayPlugin",{enumerable:!0,get:function(){return s.StatsigSessionReplayPlugin}}),$Q2(e,"runStatsigSessionReplay",{enumerable:!0,get:function(){return s.runStatsigSessionReplay}}),i(4069)),o=($Q2(e,"forceStartRecording",{enumerable:!0,get:function(){return r.forceStartRecording}}),$Q2(e,"startRecording",{enumerable:!0,get:function(){return r.startRecording}}),$Q2(e,"stopRecording",{enumerable:!0,get:function(){return r.stopRecording}}),i(759)),a=($Q2(e,"SessionReplayClient",{enumerable:!0,get:function(){return o.SessionReplayClient}}),i(3691));$Q2(e,"StatsigTriggeredSessionReplayPlugin",{enumerable:!0,get:function(){return a.StatsigTriggeredSessionReplayPlugin}}),$Q2(e,"runStatsigTriggeredSessionReplay",{enumerable:!0,get:function(){return a.runStatsigTriggeredSessionReplay}}),$P((0,n.l)(),{SessionReplayClient:o.SessionReplayClient,SessionReplay:s.SessionReplay,runStatsigSessionReplay:s.runStatsigSessionReplay,runStatsigTriggeredSessionReplay:a.runStatsigTriggeredSessionReplay,StatsigSessionReplayPlugin:s.StatsigSessionReplayPlugin,StatsigTriggeredSessionReplayPlugin:a.StatsigTriggeredSessionReplayPlugin,startRecording:r.startRecording,stopRecording:r.stopRecording,forceStartRecording:r.forceStartRecording})},670:(e,i)=>{$Q2(i,Symbol.toStringTag,{value:"Module"});var s,u=Object.defineProperty,a=(t,e,i)=>{var n;return n=i,(e="symbol"!=typeof e?e+"":e)in(t=t)?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,i},c=Object.defineProperty,f=(t,e,i)=>{var n;return n=i,(e="symbol"!=typeof e?e+"":e)in(t=t)?c(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,i},J=(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))(J||{});function D(t){var e=null==t?void 0:t.host;return Boolean((null==e?void 0:e.shadowRoot)===t)}function N(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function X(t){try{var e=t.rules||t.cssRules;return e?i=(i=Array.from(e,m).join("")).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")?i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;"):i:null}catch(t){return null}var i}function m(t){let e;if("styleSheet"in t)try{e=X(t.styleSheet)||((n=(i=t).cssText).split('"').length<3?n:(n=["@import",`url(${JSON.stringify(i.href)})`],""===i.layerName?n.push("layer"):i.layerName&&n.push(`layer(${i.layerName})`),i.supportsText&&n.push(`supports(${i.supportsText})`),i.media.length&&n.push(i.media.mediaText),n.join(" ")+";"))}catch(t){}else if("selectorText"in t&&t.selectorText.includes(":"))return t.cssText.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2");var i,n;return e||t.cssText}class ct{constructor(){f(this,"idNodeMap",new Map),f(this,"nodeMetaMap",new WeakMap)}getId(t){return t?(null==(t=this.getMeta(t))?void 0:t.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var i=e.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);i&&(i=this.nodeMetaMap.get(i))&&this.nodeMetaMap.set(e,i),this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ht({element:t,maskInputOptions:e,tagName:i,type:n,value:s,maskInputFn:r}){let o=s||"";s=n&&H(n);return o=e[i.toLowerCase()]||s&&e[s]?r?r(o,t):"*".repeat(o.length):o}function H(t){return t.toLowerCase()}const dt="__rrweb_original__";function vt(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?H(e):null}function V(t,e){let i;try{i=new URL(t,e??window.location.href)}catch(t){return null}t=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==t?void 0:t[1])??null}let K=1;const ft=new RegExp("[^a-z0-9-_:]"),E=-2;function p(){return K++}let Q,mt;const g=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,y=/^(?:[a-z+]+:)?\/\//i,b=/^www\..*/i,I=/^(data:)([^,]*),(.*)/i;function $(t,l){return(t||"").replace(g,(t,e,i,n,s,r)=>{i=i||s||r,s=e||n||"";if(!i)return t;if(y.test(i)||b.test(i))return`url(${s}${i}${s})`;if(I.test(i))return`url(${s}${i}${s})`;if("/"===i[0])return`url(${s}${function(t){let e="";return e=(e=-1<t.indexOf("//")?t.split("/").slice(0,3).join("/"):t.split("/")[0]).split("?")[0]}(l)+i}${s})`;var o=l.split("/"),r=i.split("/");o.pop();for(const a of r)"."!==a&&(".."===a?o.pop():o.push(a));return`url(${s}${o.join("/")}${s})`})}const C=/^[^ \t\n\r\u000c]+/,S=/^[, \t\n\r\u000c]+/;function w(n,s){if(""===s.trim())return s;let r=0;function t(t){var t=t.exec(s.substring(r));return t?(t=t[0],r+=t.length,t):""}for(var o=[];t(S),!(r>=s.length);){let i=t(C);if(","===i.slice(-1))i=l(n,i.substring(0,i.length-1)),o.push(i);else{let t="",e=(i=l(n,i),!1);for(;;){var a=s.charAt(r);if(""===a){o.push((i+t).trim());break}if(e)")"===a&&(e=!1);else{if(","===a){r+=1,o.push((i+t).trim());break}"("===a&&(e=!0)}t+=a,r+=1}}}return o.join(", ")}const k=new WeakMap;function l(t,e){return e&&""!==e.trim()?q(t,e):e}function q(t,e){let i=k.get(t);if(i||(i=t.createElement("a"),k.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function pt(t,e,i,n){return n&&("src"!==i&&("href"!==i||"use"===e&&"#"===n[0])&&("xlink:href"!==i||"#"===n[0])&&("background"!==i||"table"!==e&&"td"!==e&&"th"!==e)?"srcset"===i?w(t,n):"style"===i?$(n,q(t)):"object"===e&&"data"===i?l(t,n):n:l(t,n))}function gt(t,e){return("video"===t||"audio"===t)&&"autoplay"===e}function r(e,i,t){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!t&&r(e.parentNode,i,t);for(let t=e.classList.length;t--;){var n=e.classList[t];if(i.test(n))return!0}return!!t&&r(e.parentNode,i,t)}function P(t,e,i,n){try{var s=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(null===s)return!1;if("string"==typeof e){if(n){if(s.closest("."+e))return!0}else if(s.classList.contains(e))return!0}else if(r(s,e,n))return!0;if(i)if(n){if(s.closest(i))return!0}else if(s.matches(i))return!0}catch(t){}return!1}function yt(i,t){var e,n,s,r,{doc:o,mirror:t,blockClass:a,blockSelector:l,needsMask:u,inlineStylesheet:E,maskInputOptions:L={},maskTextFn:G,maskInputFn:U,dataURLOptions:W={},inlineImages:B,recordCanvas:Y,keepIframeSrcFn:z,newlyAddedElement:Z=!1}=t,c=(e=o,!(t=t).hasNode(e)||1===(t=t.getId(e))?void 0:t);switch(i.nodeType){case i.DOCUMENT_NODE:return"CSS1Compat"!==i.compatMode?{type:J.Document,childNodes:[],compatMode:i.compatMode}:{type:J.Document,childNodes:[]};case i.DOCUMENT_TYPE_NODE:return{type:J.DocumentType,name:i.name,publicId:i.publicId,systemId:i.systemId,rootId:c};case i.ELEMENT_NODE:{var h=i;var d={doc:o,blockClass:a,blockSelector:l,inlineStylesheet:E,maskInputOptions:L,maskInputFn:U,dataURLOptions:W,inlineImages:B,recordCanvas:Y,keepIframeSrcFn:z,newlyAddedElement:Z,rootId:c};const{doc:y,blockClass:b,blockSelector:I,inlineStylesheet:C,maskInputOptions:S={},maskInputFn:w,dataURLOptions:k={},inlineImages:_,recordCanvas:O,keepIframeSrcFn:A,newlyAddedElement:M=!1,rootId:j}=d,T=function(e,i,t){try{if("string"==typeof i){if(e.classList.contains(i))return!0}else for(let t=e.classList.length;t--;){var n=e.classList[t];if(i.test(n))return!0}if(t)return e.matches(t)}catch(t){}return!1}(h,b,I),x=function(t){return t instanceof HTMLFormElement?"form":(t=H(t.tagName),ft.test(t)?"div":t)}(h);let e={};var V=h.attributes.length;for(let t=0;t<V;t++){var v=h.attributes[t];gt(x,v.name,v.value)||(e[v.name]=pt(y,x,H(v.name),v.value))}if("link"===x&&C){d=Array.from(y.styleSheets).find(t=>t.href===h.href);let t=null;(t=d?X(d):t)&&(delete e.rel,delete e.href,e.ws=$(t,d.href))}"style"===x&&h.sheet&&!(h.innerText||h.textContent||"").trim().length&&(d=X(h.sheet))&&(e.ws=$(d,q(y)));"input"!==x&&"textarea"!==x&&"select"!==x||(d=h.value,n=h.checked,"radio"!==e.type&&"checkbox"!==e.type&&"submit"!==e.type&&"button"!==e.type&&d?e.value=ht({element:h,type:vt(h),tagName:x,value:d,maskInputOptions:S,maskInputFn:w}):n&&(e.checked=n));"option"===x&&(h.selected&&!S.select?e.selected=!0:delete e.selected);"canvas"===x&&O&&("2d"===h.__context?function(i){var n=i.getContext("2d");if(n)for(let e=0;e<i.width;e+=50)for(let t=0;t<i.height;t+=50){var s=n.getImageData,s=dt in s?s[dt]:s;if(new Uint32Array(s.call(n,e,t,Math.min(50,i.width-e),Math.min(50,i.height-t)).data.buffer).some(t=>0!==t))return}return 1}(h)||(e.rr_dataURL=h.toDataURL(k.type,k.quality)):"__context"in h||(d=h.toDataURL(k.type,k.quality),(n=y.createElement("canvas")).width=h.width,n.height=h.height,s=n.toDataURL(k.type,k.quality),d!==s&&(e.rr_dataURL=d)));if("img"===x&&_){Q||(Q=y.createElement("canvas"),mt=Q.getContext("2d"));const R=h,F=R.currentSrc||R.getAttribute("src")||"<unknown-src>",D=R.crossOrigin,N=()=>{R.removeEventListener("load",N);try{Q.width=R.naturalWidth,Q.height=R.naturalHeight,mt.drawImage(R,0,0),e.rr_dataURL=Q.toDataURL(k.type,k.quality)}catch(t){if("anonymous"!==R.crossOrigin)return R.crossOrigin="anonymous",void(R.complete&&0!==R.naturalWidth?N():R.addEventListener("load",N));console.warn(`Cannot inline img src=${F}! Error: `+t)}"anonymous"===R.crossOrigin&&(D?e.crossOrigin=D:R.removeAttribute("crossorigin"))};R.complete&&0!==R.naturalWidth?N():R.addEventListener("load",N)}"audio"!==x&&"video"!==x||((s=e).rr_mediaState=h.paused?"paused":"played",s.rr_mediaCurrentTime=h.currentTime,s.rr_mediaPlaybackRate=h.playbackRate,s.rr_mediaMuted=h.muted,s.rr_mediaLoop=h.loop,s.rr_mediaVolume=h.volume);M||(h.scrollLeft&&(e.rr_scrollLeft=h.scrollLeft),h.scrollTop&&(e.rr_scrollTop=h.scrollTop));T&&({width:d,height:f}=h.getBoundingClientRect(),e={class:e.class,rr_width:d+"px",rr_height:f+"px"});"iframe"!==x||A(e.src)||(h.contentDocument||(e.rr_src=e.src),delete e.src);let t;try{customElements.get(x)&&(t=!0)}catch(t){}return{type:J.Element,tagName:x,attributes:e,childNodes:[],isSVG:function(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}(h)||void 0,needBlock:T,rootId:j,isCustom:t};return}case i.TEXT_NODE:{d=i;var f={doc:o,needsMask:u,maskTextFn:G,rootId:c};var{needsMask:K,maskTextFn:m,rootId:P}=f,p=d.parentNode&&d.parentNode.tagName;let t=d.textContent;var g="STYLE"===p||void 0,p="SCRIPT"===p||void 0;if(g&&t){try{d.nextSibling||d.previousSibling||null!=(r=d.parentNode.sheet)&&r.cssRules&&(t=X(d.parentNode.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,d)}t=$(t,q(f.doc))}p&&(t="SCRIPT_PLACEHOLDER");!g&&!p&&t&&K&&(t=m?m(t,d.parentElement):t.replace(/[\S]/g,"*"));return{type:J.Text,textContent:t||"",isStyle:g,rootId:P};return}case i.CDATA_SECTION_NODE:return{type:J.CDATA,textContent:"",rootId:c};case i.COMMENT_NODE:return{type:J.Comment,textContent:i.textContent||"",rootId:c};default:return!1}}function L(t){return null==t?"":t.toLowerCase()}function tt(e,t){const{doc:i,mirror:n,blockClass:s,blockSelector:r,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:d,slimDOMOptions:v,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:p=!1,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:I,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:S=()=>!1,newlyAddedElement:w=!1}=t;let k=t["needsMask"],{preserveWhiteSpace:_=!0}=t;!k&&e.childNodes&&(t=void 0===k,k=P(e,o,a,t));t=yt(e,{doc:i,mirror:n,blockClass:s,blockSelector:r,needsMask:k,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:m,recordCanvas:p,keepIframeSrcFn:S,newlyAddedElement:w});if(!t)return console.warn(e,"not serialized"),null;let O;O=n.hasNode(e)?n.getId(e):!function(t,e){if(e.comment&&t.type===J.Comment)return 1;if(t.type===J.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===V(t.attributes.href)))return 1;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(L(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===L(t.attributes.name)||"icon"===L(t.attributes.rel)||"apple-touch-icon"===L(t.attributes.rel)||"shortcut icon"===L(t.attributes.rel))))return 1;if("meta"===t.tagName){if(e.headMetaDescKeywords&&L(t.attributes.name).match(/^description|keywords$/))return 1;if(e.headMetaSocial&&(L(t.attributes.property).match(/^(og|twitter|fb):/)||L(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===L(t.attributes.name)))return 1;if(e.headMetaRobots&&("robots"===L(t.attributes.name)||"googlebot"===L(t.attributes.name)||"bingbot"===L(t.attributes.name)))return 1;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return 1;if(e.headMetaAuthorship&&("author"===L(t.attributes.name)||"generator"===L(t.attributes.name)||"framework"===L(t.attributes.name)||"publisher"===L(t.attributes.name)||"progid"===L(t.attributes.name)||L(t.attributes.property).match(/^article:/)||L(t.attributes.property).match(/^product:/)))return 1;if(e.headMetaVerification&&("google-site-verification"===L(t.attributes.name)||"yandex-verification"===L(t.attributes.name)||"csrf-token"===L(t.attributes.name)||"p:domain_verify"===L(t.attributes.name)||"verify-v1"===L(t.attributes.name)||"verification"===L(t.attributes.name)||"shopify-checkout-api-token"===L(t.attributes.name)))return 1}}}(t,v)&&(_||t.type!==J.Text||t.isStyle||t.textContent.replace(/^\s+|\s+$/gm,"").length)?K++:E;var A=$P(t,{id:O});if(n.add(e,A),O===E)return null;g&&g(e);let M=!l;if(A.type===J.Element&&(M=M&&!A.needBlock,delete A.needBlock,t=e.shadowRoot)&&N(t)&&(A.isShadowHost=!0),(A.type===J.Document||A.type===J.Element)&&M){v.headWhitespace&&A.type===J.Element&&"head"===A.tagName&&(_=!1);var j={doc:i,mirror:n,blockClass:s,blockSelector:r,needsMask:k,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:_,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:I,stylesheetLoadTimeout:C,keepIframeSrcFn:S};if(A.type!==J.Element||"textarea"!==A.tagName||void 0===A.attributes.value)for(const R of Array.from(e.childNodes)){var T=tt(R,j);T&&A.childNodes.push(T)}if(e.nodeType===e.ELEMENT_NODE&&e.shadowRoot)for(const F of Array.from(e.shadowRoot.childNodes)){var x=tt(F,j);x&&(N(e.shadowRoot)&&(x.isShadow=!0),A.childNodes.push(x))}}return e.parentNode&&D(e.parentNode)&&N(e.parentNode)&&(A.isShadow=!0),A.type===J.Element&&"iframe"===A.tagName&&function(i,n,s){var r=i.contentWindow;if(r){let t=!1,e;try{e=r.document.readyState}catch(t){return}if("complete"!==e){const o=setTimeout(()=>{t||(n(),t=!0)},s);void i.addEventListener("load",()=>{clearTimeout(o),t=!0,n()})}else{s="about:blank";if(r.location.href!==s||i.src===s||""===i.src)return setTimeout(n,0),i.addEventListener("load",n);i.addEventListener("load",n)}}}(e,()=>{var t=e.contentDocument;t&&y&&(t=tt(t,{doc:t,mirror:n,blockClass:s,blockSelector:r,needsMask:k,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:_,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:I,stylesheetLoadTimeout:C,keepIframeSrcFn:S}))&&y(e,t)},b),A.type===J.Element&&"link"===A.tagName&&"string"==typeof A.attributes.rel&&("stylesheet"===A.attributes.rel||"preload"===A.attributes.rel&&"string"==typeof A.attributes.href&&"css"===V(A.attributes.href))&&function(t,e,i){let n=!1,s;try{s=t.sheet}catch(t){return}if(!s){const r=setTimeout(()=>{n||(e(),n=!0)},i);t.addEventListener("load",()=>{clearTimeout(r),n=!0,e()})}}(e,()=>{var t;I&&(t=tt(e,{doc:i,mirror:n,blockClass:s,blockSelector:r,needsMask:k,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:_,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:I,stylesheetLoadTimeout:C,keepIframeSrcFn:S}))&&I(e,t)},C),A}function et(t,e,i=document){const n={capture:!0,passive:!0};return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}const n="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.";var _={map:{},getId(){return console.error(n),-1},getNode(){return console.error(n),null},removeNodeFromMap(){console.error(n)},has(){return console.error(n),!1},reset(){console.error(n)}};function G(s,r,o={}){let a=null,l=0;return function(...t){var e=Date.now(),i=(l||!1!==o.leading||(l=e),r-(e-l));const n=this;i<=0||r<i?(a&&(clearTimeout(a),a=null),l=e,s.apply(n,t)):a||!1===o.trailing||(a=setTimeout(()=>{l=!1===o.leading?0:Date.now(),a=null,s.apply(n,t)},i))}}function U(t,e,i,n,s=window){const r=s.Object.getOwnPropertyDescriptor(t,e);return s.$Q2(t,e,n?i:{set(t){setTimeout(()=>{i.set.call(this,t)},0),r&&r.set&&r.set.call(this,t)}}),()=>U(t,e,r||{},!0)}function W(t,e,i){try{if(!(e in t))return()=>{};const s=t[e];var n=i(s);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:s}})),t[e]=n,()=>{t[e]=s}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&new Proxy(_,{get(t,e,i){return"map"===e&&console.error(n),Reflect.get(t,e,i)}});let it=Date.now;function bt(t){var e,i=t.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:(null==i?void 0:i.documentElement.scrollLeft)||(null==(e=null==(e=null==i?void 0:i.body)?void 0:e.parentElement)?void 0:e.scrollLeft)||(null==(e=null==i?void 0:i.body)?void 0:e.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==(t=null==(e=null==i?void 0:i.body)?void 0:e.parentElement)?void 0:t.scrollTop)||(null==(e=null==i?void 0:i.body)?void 0:e.scrollTop)||0}}function It(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ct(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function O(t){return t?t.nodeType===t.ELEMENT_NODE?t:t.parentElement:null}function B(t,e,i,n){if(t){t=O(t);if(t){try{if("string"==typeof e){if(t.classList.contains(e))return!0;if(n&&null!==t.closest("."+e))return!0}else if(r(t,e,n))return!0}catch(t){}if(i){if(t.matches(i))return!0;if(n&&null!==t.closest(i))return!0}}}return!1}function A(t,e,i){return"TITLE"===t.tagName&&i.headTitleMutations||e.getId(t)===E}function St(t){return Boolean(t.changedTouches)}function wt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function kt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function _t(t){return Boolean(null==t?void 0:t.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(it=()=>(new Date).getTime());class M{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let i;return i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i}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 j(t){var e;let i=null;return i=(null==(e=null==(e=t.getRootNode)?void 0:e.call(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host?t.getRootNode().host:i}function T(t){var e=t.ownerDocument;return!!e&&(t=function(t){let e=t;for(var i;i=j(e);)e=i;return e}(t),e.contains(t))}function x(t){var e=t.ownerDocument;return e&&(e.contains(t)||T(t))}var nt=(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))({}),st=(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))(st||{}),h=(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))(h||{}),d=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(d||{}),v=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))({}),Y=(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))(Y||{});function R(t){return"__ln"in t}class F{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let i=this.head;for(let t=0;t<e;t++)i=(null==i?void 0:i.next)||null;return i}addNode(t){var e,i={value:t,previous:null,next:null};t.__ln=i,t.previousSibling&&R(t.previousSibling)?(e=t.previousSibling.__ln.next,i.next=e,i.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=i,e&&(e.previous=i)):t.nextSibling&&R(t.nextSibling)&&t.nextSibling.__ln.previous?(e=t.nextSibling.__ln.previous,i.previous=e,i.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=i,e&&(e.next=i)):(this.head&&(this.head.previous=i),i.next=this.head,this.head=i),null===i.next&&(this.tail=i),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--)}}class Ot{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),a(this,"emit",()=>{if(!this.frozen&&!this.locked){const l=[],u=new Set,c=new F,h=t=>{let e=t,i=E;for(;i===E;)e=e&&e.nextSibling,i=e&&this.mirror.getId(e);return i};for(var i,n,s=e=>{var t,i,n;if(e.parentNode&&x(e)&&"TEXTAREA"!==e.parentNode.tagName)return t=D(e.parentNode)?this.mirror.getId(j(e)):this.mirror.getId(e.parentNode),i=h(e),-1===t||-1===i?c.addNode(e):void((n=tt(e,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{wt(t,this.mirror)&&this.iframeManager.addIframe(t),kt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),_t(e)&&this.shadowDomManager.addShadowRoot(e.shadowRoot,this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}}))&&(l.push({parentId:t,nextId:i,node:n}),u.add(n.id)))};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const d of this.movedSet)Mt(this.removes,d,this.mirror)&&!this.movedSet.has(d.parentNode)||s(d);for(const v of this.addedSet)!jt(this.droppedSet,v)&&!Mt(this.removes,v,this.mirror)||jt(this.movedSet,v)?s(v):this.droppedSet.add(v);let t=null;for(;c.length;){let e=null;if(!(e=t&&(i=this.mirror.getId(t.value.parentNode),n=h(t.value),-1!==i)&&-1!==n?t:e)){let t=c.tail;for(;t;){var r=t;if(t=t.previous,r){var o=this.mirror.getId(r.value.parentNode),a=h(r.value);if(-1!==a){if(-1!==o){e=r;break}a=r.value;if(a.parentNode&&a.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){o=a.parentNode.host;if(-1!==this.mirror.getId(o)){e=r;break}}}}}}if(!e){for(;c.head;)c.removeNode(c.head.value);break}t=e.previous,c.removeNode(e.value),s(e.value)}var e={texts:this.texts.map(t=>{var e=t.node;return e.parentNode&&"TEXTAREA"===e.parentNode.tagName&&this.genTextAreaValueMutation(e.parentNode),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!u.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.map(t=>{var e,i,n=t["attributes"];return"string"==typeof n.style&&(e=JSON.stringify(t.styleDiff),i=JSON.stringify(t.Es),e.length<n.style.length)&&(e+i).split("var(").length===n.style.split("var(").length&&(n.style=t.styleDiff),{id:this.mirror.getId(t.node),attributes:n}}).filter(t=>!u.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:l};(e.texts.length||e.attributes.length||e.removes.length||e.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(e))}}),a(this,"genTextAreaValueMutation",t=>{let e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},Es:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(t.childNodes,t=>t.textContent||"").join("")}),a(this,"processMutation",n=>{if(!A(n.target,this.mirror,this.slimDOMOptions))switch(n.type){case"characterData":var s=n.target.textContent;B(n.target,this.blockClass,this.blockSelector,!1)||s===n.oldValue||this.texts.push({value:P(n.target,this.maskTextClass,this.maskTextSelector,!0)&&s?this.maskTextFn?this.maskTextFn(s,O(n.target)):s.replace(/[\S]/g,"*"):s,node:n.target});break;case"attributes":{var r=n.target;let t=n.attributeName,e=n.target.getAttribute(t);if("value"===t&&(s=vt(r),e=ht({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:e,maskInputFn:this.maskInputFn})),B(n.target,this.blockClass,this.blockSelector,!1)||e===n.oldValue)return;let i=this.attributeMap.get(n.target);if("IFRAME"===r.tagName&&"src"===t&&!this.keepIframeSrcFn(e)){if(r.contentDocument)return;t="rr_src"}if(i||(i={node:n.target,attributes:{},styleDiff:{},Es:{}},this.attributes.push(i),this.attributeMap.set(n.target,i)),"type"===t&&"INPUT"===r.tagName&&"password"===(n.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!gt(r.tagName,t)&&(i.attributes[t]=pt(this.doc,H(r.tagName),H(t),e),"style"===t)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var o=this.unattachedDoc.createElement("span");n.oldValue&&o.setAttribute("style",n.oldValue);for(const u of Array.from(r.style)){var a=r.style.getPropertyValue(u),l=r.style.getPropertyPriority(u);a!==o.style.getPropertyValue(u)||l!==o.style.getPropertyPriority(u)?i.styleDiff[u]=""===l?a:[a,l]:i.Es[u]=[a,l]}for(const c of Array.from(o.style))""===r.style.getPropertyValue(c)&&(i.styleDiff[c]=!1)}break}case"childList":B(n.target,this.blockClass,this.blockSelector,!0)||("TEXTAREA"!==n.target.tagName?(n.addedNodes.forEach(t=>this.genAdds(t,n.target)),n.removedNodes.forEach(t=>{var e=this.mirror.getId(t),i=D(n.target)?this.mirror.getId(n.target.host):this.mirror.getId(n.target);B(n.target,this.blockClass,this.blockSelector,!1)||A(t,this.mirror,this.slimDOMOptions)||-1===this.mirror.getId(t)||(this.addedSet.has(t)?(At(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(n.target)&&-1===e||function t(e,i){var n;return!D(e)&&(n=i.getId(e),!i.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||t(e.parentNode,i)))}(n.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[e+"@"+i]?At(this.movedSet,t):this.removes.push({parentId:i,id:e,isShadow:!(!D(n.target)||!N(n.target))||void 0})),this.mapRemoves.push(t))})):this.genTextAreaValueMutation(n.target))}}),a(this,"genAdds",(e,i)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(A(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let t=null;(t=i&&this.mirror.hasNode(i)?this.mirror.getId(i):t)&&-1!==t&&(this.movedMap[this.mirror.getId(e)+"@"+t]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);B(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach(t=>this.genAdds(t)),_t(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function At(e,t){e.delete(t),t.childNodes.forEach(t=>At(e,t))}function Mt(e,i,n){if(0!==e.length){var s=e;e=i;var r=n;let t=e.parentNode;for(;t;){const o=r.getId(t);if(s.some(t=>t.id===o))return 1;t=t.parentNode}}}function jt(t,e){return 0!==t.size&&function t(e,i){const n=i["parentNode"];if(!n)return!1;if(e.has(n))return!0;return t(e,n)}(t,e)}let rt;const ot=e=>{return rt?(...t)=>{try{return e(...t)}catch(t){if(!rt||!0!==rt(t))throw t}}:e},at=[];function z(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{}return t&&t.target}function Tt(t,e){var i=new Ot;at.push(i),i.init(t);let n=window.MutationObserver||window.__rrMutationObserver;var s=null==(s=null==(t=null==window?void 0:window.Zone)?void 0:t.__symbol__)?void 0:s.call(t,"MutationObserver"),t=new(n=s&&window[s]?window[s]:n)(ot(i.processMutations.bind(i)));return t.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function xt({mouseInteractionCb:o,doc:n,mirror:a,blockClass:l,blockSelector:u,sampling:t}){if(!1===t.mouseInteraction)return()=>{};const e=!0===t.mouseInteraction||void 0===t.mouseInteraction?{}:t.mouseInteraction,s=[];let c=null;return Object.keys(h).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==e[t]).forEach(t=>{let e=H(t);r=t;var r,i=i=>{var n=z(i);if(!B(n,l,u,!0)){let t=null,e=r;if("pointerType"in i){switch(i.pointerType){case"mouse":t=d.Mouse;break;case"touch":t=d.Touch;break;case"pen":t=d.Pen}t===d.Touch?h[r]===h.MouseDown?e="TouchStart":h[r]===h.MouseUp&&(e="TouchEnd"):(t,d.Pen)}else St(i)&&(t=d.Touch);null!==t?(c=t,(e.startsWith("Touch")&&t===d.Touch||e.startsWith("Mouse")&&t===d.Mouse)&&(t=null)):h[r]===h.Click&&(t=c,c=null);var s,i=St(i)?i.changedTouches[0]:i;i&&(n=a.getId(n),{clientX:i,clientY:s}=i,ot(o)({type:h[e],id:n,x:i,y:s,...null!==t&&{pointerType:t}}))}};if(window.PointerEvent)switch(h[t]){case h.MouseDown:case h.MouseUp:e=e.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}s.push(et(e,i,n))}),ot(()=>{s.forEach(t=>t())})}function Rt({scrollCb:n,doc:s,mirror:r,blockClass:o,blockSelector:a,sampling:t}){return et("scroll",ot(G(ot(t=>{var e,i,t=z(t);t&&!B(t,o,a,!0)&&(e=r.getId(t),t===s&&s.defaultView?(i=bt(s.defaultView),n({id:e,x:i.left,y:i.top})):n({id:e,x:t.scrollLeft,y:t.scrollTop}))}),t.scroll||100)),s)}const Ft=["INPUT","TEXTAREA","SELECT"],Dt=new WeakMap;function Nt(t){var e,i;return t=t,e=[],Gt("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Gt("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Gt("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Gt("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule?(i=Array.from(t.parentRule.cssRules).indexOf(t),e.unshift(i)):t.parentStyleSheet&&(i=Array.from(t.parentStyleSheet.cssRules).indexOf(t),e.unshift(i)),e}function Z(t,e,i){let n,s;return t?(t.ownerNode?n=e.getId(t.ownerNode):s=i.getId(t),{styleId:s,id:n}):{}}function Et({mirror:t,stylesheetManager:i},e){let n=null;n="#document"===e.nodeName?t.getId(e):t.getId(e.host);t="#document"===e.nodeName?null==(t=e.defaultView)?void 0:t.Document:null==(t=null==(t=e.ownerDocument)?void 0:t.defaultView)?void 0:t.ShadowRoot;const s=null!=t&&t.prototype?Object.getOwnPropertyDescriptor(null==t?void 0:t.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&t&&s?($Q2(e,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var t;return null==(t=s.get)?void 0:t.call(this)},set(t){var e=null==(e=s.set)?void 0:e.call(this,t);if(null!==n&&-1!==n)try{i.adoptStyleSheets(t,n)}catch(t){}return e}}),ot(()=>{$Q2(e,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})})):()=>{}}function Lt(t,e={}){var s,i=t.doc.defaultView;if(!i)return()=>{};{var n=t,r=e;const{mutationCb:I,mousemoveCb:C,mouseInteractionCb:S,scrollCb:w,viewportResizeCb:k,inputCb:_,mediaInteractionCb:O,styleSheetRuleCb:A,styleDeclarationCb:M,canvasMutationCb:j,fontCb:T,selectionCb:x,customElementCb:R}=n;n.mutationCb=(...t)=>{r.mutation&&r.mutation(...t),I(...t)},n.mousemoveCb=(...t)=>{r.mousemove&&r.mousemove(...t),C(...t)},n.mouseInteractionCb=(...t)=>{r.mouseInteraction&&r.mouseInteraction(...t),S(...t)},n.scrollCb=(...t)=>{r.scroll&&r.scroll(...t),w(...t)},n.viewportResizeCb=(...t)=>{r.viewportResize&&r.viewportResize(...t),k(...t)},n.inputCb=(...t)=>{r.input&&r.input(...t),_(...t)},n.mediaInteractionCb=(...t)=>{r.mediaInteaction&&r.mediaInteaction(...t),O(...t)},n.styleSheetRuleCb=(...t)=>{r.styleSheetRule&&r.styleSheetRule(...t),A(...t)},n.styleDeclarationCb=(...t)=>{r.styleDeclaration&&r.styleDeclaration(...t),M(...t)},n.canvasMutationCb=(...t)=>{r.canvasMutation&&r.canvasMutation(...t),j(...t)},n.fontCb=(...t)=>{r.font&&r.font(...t),T(...t)},n.selectionCb=(...t)=>{r.selection&&r.selection(...t),x(...t)},n.customElementCb=(...t)=>{r.customElement&&r.customElement(...t),R(...t)}}let o;t.recordDOM&&(o=Tt(t,t.doc));const a=function({mousemoveCb:i,sampling:t,doc:e,mirror:s}){if(!1===t.mousemove)return()=>{};var n="number"==typeof t.mousemove?t.mousemove:50,t="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let r=[],o;const a=G(ot(t=>{const e=Date.now()-o;i(r.map(t=>(t.timeOffset-=e,t)),t),r=[],o=null}),t),l=[et("mousemove",t=ot(G(ot(t=>{var e=z(t),{clientX:i,clientY:n}=St(t)?t.changedTouches[0]:t;o=o||it(),r.push({x:i,y:n,id:s.getId(e),timeOffset:it()-o}),a("undefined"!=typeof DragEvent&&t instanceof DragEvent?st.Drag:t instanceof MouseEvent?st.MouseMove:st.TouchMove)}),n,{trailing:!1})),e),et("touchmove",t,e),et("drag",t,e)];return ot(()=>{l.forEach(t=>t())})}(t),l=xt(t),u=Rt(t),c=function({viewportResizeCb:i},{win:t}){let n=-1,s=-1;return et("resize",ot(G(ot(()=>{var t=It(),e=Ct();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)}),200)),t)}(t,{win:i}),h=function({inputCb:n,doc:o,mirror:s,blockClass:t,blockSelector:i,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:c,sampling:e,userTriggeredOnInput:h}){function r(e){let n=z(e);var e=e.isTrusted,s=n&&n.tagName;if((n=n&&"OPTION"===s?n.parentElement:n)&&s&&!(Ft.indexOf(s)<0)&&!B(n,t,i,!0)&&!(n.classList.contains(a)||l&&n.matches(l))){let t=n.value,i=!1;var r=vt(n)||"",s=("radio"===r||"checkbox"===r?i=n.checked:(u[s.toLowerCase()]||u[r])&&(t=ht({element:n,maskInputOptions:u,tagName:s,type:r,value:t,maskInputFn:c})),d(n,h?{text:t,isChecked:i,userTriggered:e}:{text:t,isChecked:i}),n.name);"radio"===r&&s&&i&&o.querySelectorAll(`input[type="radio"][name="${s}"]`).forEach(t=>{var e;t!==n&&(e=t.value,d(t,h?{text:e,isChecked:!i,userTriggered:!1}:{text:e,isChecked:!i}))})}}function d(t,e){var i=Dt.get(t);i&&i.text===e.text&&i.isChecked===e.isChecked||(Dt.set(t,e),i=s.getId(t),ot(n)({...e,id:i}))}var v;const f=("last"===e.input?["change"]:["input","change"]).map(t=>et(t,ot(r),o)),m=o.defaultView;return m?(e=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),v=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]],e&&e.set&&f.push(...v.map(t=>U(t[0],t[1],{set(){ot(r)({target:this,isTrusted:!1})}},!1,m))),ot(()=>{f.forEach(t=>t())})):()=>{f.forEach(t=>t())}}(t),d=function({mediaInteractionCb:a,blockClass:l,blockSelector:u,mirror:c,sampling:t,doc:e}){var i=ot(o=>G(ot(t=>{var e,i,n,s,r,t=z(t);t&&!B(t,l,u,!0)&&({currentTime:e,volume:i,muted:n,playbackRate:s,loop:r}=t,a({type:o,id:c.getId(t),currentTime:e,volume:i,muted:n,playbackRate:s,loop:r}))}),t.media||500));const n=[et("play",i(Y.Play),e),et("pause",i(Y.Pause),e),et("seeked",i(Y.Seeked),e),et("volumechange",i(Y.VolumeChange),e),et("ratechange",i(Y.RateChange),e)];return ot(()=>{n.forEach(t=>t())})}(t);let v=()=>{},f=()=>{},m=()=>{},p=()=>{};t.recordDOM&&(v=function({styleSheetRuleCb:a,mirror:l,stylesheetManager:u},{win:t}){if(!t.CSSStyleSheet||!t.CSSStyleSheet.prototype)return()=>{};const e=t.CSSStyleSheet.prototype.insertRule,i=(t.CSSStyleSheet.prototype.insertRule=new Proxy(e,{apply:ot((t,e,i)=>{var[n,s]=i,{id:r,styleId:o}=Z(e,l,u.styleMirror);return(r&&-1!==r||o&&-1!==o)&&a({id:r,styleId:o,adds:[{rule:n,index:s}]}),t.apply(e,i)})}),t.CSSStyleSheet.prototype.deleteRule);t.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:ot((t,e,i)=>{var[n]=i,{id:s,styleId:r}=Z(e,l,u.styleMirror);return(s&&-1!==s||r&&-1!==r)&&a({id:s,styleId:r,removes:[{index:n}]}),t.apply(e,i)})});let n;t.CSSStyleSheet.prototype.replace&&(n=t.CSSStyleSheet.prototype.replace,t.CSSStyleSheet.prototype.replace=new Proxy(n,{apply:ot((t,e,i)=>{var[n]=i,{id:s,styleId:r}=Z(e,l,u.styleMirror);return(s&&-1!==s||r&&-1!==r)&&a({id:s,styleId:r,replace:n}),t.apply(e,i)})}));let s;t.CSSStyleSheet.prototype.replaceSync&&(s=t.CSSStyleSheet.prototype.replaceSync,t.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:ot((t,e,i)=>{var[n]=i,{id:s,styleId:r}=Z(e,l,u.styleMirror);return(s&&-1!==s||r&&-1!==r)&&a({id:s,styleId:r,replaceSync:n}),t.apply(e,i)})}));const r={},o=(Ut("CSSGroupingRule")?r.CSSGroupingRule=t.CSSGroupingRule:(Ut("CSSMediaRule")&&(r.CSSMediaRule=t.CSSMediaRule),Ut("CSSConditionRule")&&(r.CSSConditionRule=t.CSSConditionRule),Ut("CSSSupportsRule")&&(r.CSSSupportsRule=t.CSSSupportsRule)),{});return Object.entries(r).forEach(([t,e])=>{o[t]={insertRule:e.prototype.insertRule,deleteRule:e.prototype.deleteRule},e.prototype.insertRule=new Proxy(o[t].insertRule,{apply:ot((t,e,i)=>{var[n,s]=i,{id:r,styleId:o}=Z(e.parentStyleSheet,l,u.styleMirror);return(r&&-1!==r||o&&-1!==o)&&a({id:r,styleId:o,adds:[{rule:n,index:[...Nt(e),s||0]}]}),t.apply(e,i)})}),e.prototype.deleteRule=new Proxy(o[t].deleteRule,{apply:ot((t,e,i)=>{var[n]=i,{id:s,styleId:r}=Z(e.parentStyleSheet,l,u.styleMirror);return(s&&-1!==s||r&&-1!==r)&&a({id:s,styleId:r,removes:[{index:[...Nt(e),n]}]}),t.apply(e,i)})})}),ot(()=>{t.CSSStyleSheet.prototype.insertRule=e,t.CSSStyleSheet.prototype.deleteRule=i,n&&(t.CSSStyleSheet.prototype.replace=n),s&&(t.CSSStyleSheet.prototype.replaceSync=s),Object.entries(r).forEach(([t,e])=>{e.prototype.insertRule=o[t].insertRule,e.prototype.deleteRule=o[t].deleteRule})})}(t,{win:i}),f=Et(t,t.doc),m=function({styleDeclarationCb:l,mirror:u,ignoreCSSAttributes:c,stylesheetManager:h},{win:t}){const d=t.CSSStyleDeclaration.prototype.setProperty,o=(t.CSSStyleDeclaration.prototype.setProperty=new Proxy(d,{apply:ot((t,e,i)=>{var n,s,[r,o,a]=i;return c.has(r)?d.apply(e,[r,o,a]):({id:n,styleId:s}=Z(null==(n=e.parentRule)?void 0:n.parentStyleSheet,u,h.styleMirror),(n&&-1!==n||s&&-1!==s)&&l({id:n,styleId:s,set:{property:r,value:o,priority:a},index:Nt(e.parentRule)}),t.apply(e,i))})}),t.CSSStyleDeclaration.prototype.removeProperty);return t.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:ot((t,e,i)=>{var n,s,[r]=i;return c.has(r)?o.apply(e,[r]):({id:n,styleId:s}=Z(null==(n=e.parentRule)?void 0:n.parentStyleSheet,u,h.styleMirror),(n&&-1!==n||s&&-1!==s)&&l({id:n,styleId:s,remove:{property:r},index:Nt(e.parentRule)}),t.apply(e,i))})}),ot(()=>{t.CSSStyleDeclaration.prototype.setProperty=d,t.CSSStyleDeclaration.prototype.removeProperty=o})}(t,{win:i}),t.collectFonts)&&(p=function({fontCb:i,doc:t}){const e=t.defaultView;if(!e)return()=>{};const n=[],s=new WeakMap,r=e.FontFace;return e.FontFace=function(t,e,i){var n=new r(t,e,i);return s.set(n,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),n},t=W(t.fonts,"add",function(t){return function(e){return setTimeout(ot(()=>{var t=s.get(e);t&&(i(t),s.delete(e))}),0),t.apply(this,[e])}}),n.push(()=>{e.FontFace=r}),n.push(t),ot(()=>{n.forEach(t=>t())})}(t));const g=function(t){const{doc:l,mirror:u,blockClass:c,blockSelector:h,selectionCb:d}=t;let v=!0;return(t=ot(()=>{var e=l.getSelection();if(!(!e||v&&null!=e&&e.isCollapsed)){v=e.isCollapsed||!1;var i=[],n=e.rangeCount||0;for(let t=0;t<n;t++){var{startContainer:s,startOffset:r,endContainer:o,endOffset:a}=e.getRangeAt(t);B(s,c,h,!0)||B(o,c,h,!0)||i.push({start:u.getId(s),startOffset:r,end:u.getId(o),endOffset:a})}d({ranges:i})}}))(),et("selectionchange",t)}(t),y=({doc:e,customElementCb:s}=[t][0],(e=e.defaultView)&&e.customElements?W(e.customElements,"define",function(n){return function(e,t,i){try{s({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return n.apply(this,[e,t,i])}}):()=>{}),b=[];for(const F of t.plugins)b.push(F.observer(F.callback,i,F.options));return ot(()=>{at.forEach(t=>t.reset()),null!=o&&o.disconnect(),a(),l(),u(),c(),h(),d(),v(),f(),m(),p(),g(),y(),b.forEach(t=>t())})}function Gt(t){return void 0!==window[t]}function Ut(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Wt{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,n){i=i||this.getIdToRemoteIdMap(t),n=n||this.getRemoteIdToIdMap(t);let s=i.get(e);return s||(s=this.generateIdFn(),i.set(e,s),n.set(s,e)),s}getIds(e,t){const i=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,i,n))}getRemoteId(t,e,i){i=i||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:i.get(e)||-1}getRemoteIds(e,t){const i=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,i))}reset(t){t?(this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)):(this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap)}getIdToRemoteIdMap(t){let e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){let e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class Bt{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new Wt(p)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Wt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&null!=(e=t.contentWindow)&&e.addEventListener("message",this.handleMessage.bind(this)),null!=(e=this.loadListener)&&e.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&0<t.contentDocument.adoptedStyleSheets.length&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;"rrweb"===e.data.type&&e.origin===e.data.origin&&t.source&&(t=(t=this.crossOriginIframeMap.get(t.source))&&this.transformCrossOriginEvent(t,e.data.event))&&this.wrappedEmit(t,e.data.isCheckout)}transformCrossOriginEvent(i,t){var e;switch(t.type){case nt.FullSnapshot:this.crossOriginIframeMirror.reset(i),this.crossOriginIframeStyleMirror.reset(i),this.replaceIdOnNode(t.data.node,i);var n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(i,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:nt.IncrementalSnapshot,data:{source:st.Mutation,adds:[{parentId:this.mirror.getId(i),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case nt.Meta:case nt.Load:case nt.DomContentLoaded:return!1;case nt.Plugin:return t;case nt.Custom:return this.replaceIds(t.data.payload,i,["id","parentId","previousId","nextId"]),t;case nt.IncrementalSnapshot:switch(t.data.source){case st.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,i,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,i);var e=this.crossOriginIframeRootIdMap.get(i);e&&this.patchRootIdOnNode(t.node,e)}),t.data.removes.forEach(t=>{this.replaceIds(t,i,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,i,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,i,["id"])}),t;case st.Drag:case st.TouchMove:case st.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,i,["id"])}),t;case st.ViewportResize:return!1;case st.MediaInteraction:case st.MouseInteraction:case st.Scroll:case st.CanvasMutation:case st.Input:return this.replaceIds(t.data,i,["id"]),t;case st.StyleSheetRule:case st.StyleDeclaration:return this.replaceIds(t.data,i,["id"]),this.replaceStyleIds(t.data,i,["styleId"]),t;case st.Font:return t;case st.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,i,["start","end"])}),t;case st.AdoptedStyleSheet:return this.replaceIds(t.data,i,["id"]),this.replaceStyleIds(t.data,i,["styleIds"]),null!=(e=t.data.styles)&&e.forEach(t=>{this.replaceStyleIds(t,i,["styleId"])}),t}}return!1}replace(t,e,i,n){for(const s of n)!Array.isArray(e[s])&&"number"!=typeof e[s]||(Array.isArray(e[s])?e[s]=t.getIds(i,e[s]):e[s]=t.getId(i,e[s]));return e}replaceIds(t,e,i){return this.replace(this.crossOriginIframeMirror,t,e,i)}replaceStyleIds(t,e,i){return this.replace(this.crossOriginIframeStyleMirror,t,e,i)}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===J.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}}class Yt{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(N(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);const i=Tt({...this.bypassOptions,doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>i.disconnect()),this.restoreHandlers.push(Rt({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&0<t.adoptedStyleSheets.length&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Et({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,i){const n=this;this.restoreHandlers.push(W(t.prototype,"attachShadow",function(e){return function(t){t=e.call(this,t);return this.shadowRoot&&x(this)&&n.addShadowRoot(this.shadowRoot,i),t}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Zt=0;Zt<o.length;Zt++)zt[o.charCodeAt(Zt)]=Zt;function Vt(t){for(var e=new Uint8Array(t),i=e.length,n="",s=0;s<i;s+=3)n=(n=(n=(n+=o[e[s]>>2])+o[(3&e[s])<<4|e[s+1]>>4])+o[(15&e[s+1])<<2|e[s+2]>>6])+o[63&e[s+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}const Kt=new Map;const Pt=(e,i,n)=>{if(e&&(Xt(e,i)||"object"==typeof e)){i=function(t,e){let i=Kt.get(t);return i||(i=new Map,Kt.set(t,i)),i.has(e)||i.set(e,[]),i.get(e)}(n,e.constructor.name);let t=i.indexOf(e);return-1===t&&(t=i.length,i.push(e)),t}};const Jt=(t,e,i)=>t.map(t=>function e(t,i,n){var s;return t instanceof Array?t.map(t=>e(t,i,n)):null===t?t: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?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:Vt(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[e(t.buffer,i,n),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?(s=t.src,{rr_type:t.constructor.name,src:s}):t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL()}:t instanceof ImageData?{rr_type:t.constructor.name,args:[e(t.data,i,n),t.width,t.height]}:Xt(t,i)||"object"==typeof t?{rr_type:t.constructor.name,index:Pt(t,i,n)}:t}(t,e,i)),Xt=(e,i)=>{var t=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof i[t]);return Boolean(t.find(t=>e instanceof i[t]))};function Ht(t,s,r,o){const e=[];try{var i=W(t.HTMLCanvasElement.prototype,"getContext",function(n){return function(t,...e){var i;return B(this,s,r,!0)||(i="experimental-webgl"===(i=t)?"webgl":i,"__context"in this||(this.__context=i),o&&["webgl","webgl2"].includes(i)&&(e[0]&&"object"==typeof e[0]?(i=e[0]).preserveDrawingBuffer||(i.preserveDrawingBuffer=!0):e.splice(0,1,{preserveDrawingBuffer:!0}))),n.apply(this,[t,...e])}});e.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{e.forEach(t=>t())}}function Qt(t,n,s,r,o,e,a){var i,l=[];for(const c of Object.getOwnPropertyNames(t))if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{"function"==typeof t[c]&&(i=W(t,c,function(i){return function(...t){var e=i.apply(this,t);return Pt(e,a,this),"tagName"in this.canvas&&!B(this.canvas,r,o,!0)&&(t=Jt(t,a,this),t={type:n,property:c,args:t},s(this.canvas,t)),e}}),l.push(i))}catch{var u=U(t,c,{set(t){s(this.canvas,{type:n,property:c,args:[t],setter:!0})}});l.push(u)}return l}const $t="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpCiAgICAgICAgcmV0dXJuIHRyYW5zcGFyZW50QmxvYk1hcC5nZXQoaWQpOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIHRyYW5zcGFyZW50QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICAgIHJldHVybiBiYXNlNjQ7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gIiI7CiAgICB9CiAgfQogIGNvbnN0IHdvcmtlciA9IHNlbGY7CiAgd29ya2VyLm9ubWVzc2FnZSA9IGFzeW5jIGZ1bmN0aW9uKGUpIHsKICAgIGlmICgiT2Zmc2NyZWVuQ2FudmFzIiBpbiBnbG9iYWxUaGlzKSB7CiAgICAgIGNvbnN0IHsgaWQsIGJpdG1hcCwgd2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMgfSA9IGUuZGF0YTsKICAgICAgY29uc3QgdHJhbnNwYXJlbnRCYXNlNjQgPSBnZXRUcmFuc3BhcmVudEJsb2JGb3IoCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0LAogICAgICAgIGRhdGFVUkxPcHRpb25zCiAgICAgICk7CiAgICAgIGNvbnN0IG9mZnNjcmVlbiA9IG5ldyBPZmZzY3JlZW5DYW52YXMod2lkdGgsIGhlaWdodCk7CiAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCIyZCIpOwogICAgICBjdHguZHJhd0ltYWdlKGJpdG1hcCwgMCwgMCk7CiAgICAgIGJpdG1hcC5jbG9zZSgpOwogICAgICBjb25zdCBibG9iID0gYXdhaXQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOwogICAgICBjb25zdCB0eXBlID0gYmxvYi50eXBlOwogICAgICBjb25zdCBhcnJheUJ1ZmZlciA9IGF3YWl0IGJsb2IuYXJyYXlCdWZmZXIoKTsKICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsKICAgICAgaWYgKCFsYXN0QmxvYk1hcC5oYXMoaWQpICYmIGF3YWl0IHRyYW5zcGFyZW50QmFzZTY0ID09PSBiYXNlNjQpIHsKICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOwogICAgICB9CiAgICAgIGlmIChsYXN0QmxvYk1hcC5nZXQoaWQpID09PSBiYXNlNjQpCiAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOwogICAgICB3b3JrZXIucG9zdE1lc3NhZ2UoewogICAgICAgIGlkLAogICAgICAgIHR5cGUsCiAgICAgICAgYmFzZTY0LAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodAogICAgICB9KTsKICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkOiBlLmRhdGEuaWQgfSk7CiAgICB9CiAgfTsKfSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW1hZ2UtYml0bWFwLWRhdGEtdXJsLXdvcmtlci1CWjFyN1JKRC5qcy5tYXAK";var qt;const te="undefined"!=typeof window&&window.Blob&&new Blob([(_=$t,Uint8Array.from(atob(_),t=>t.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});function ee(e){let t;try{var i;if(t=te&&(window.URL||window.webkitURL).createObjectURL(te))return(i=new Worker(t,{name:null==e?void 0:e.name})).addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),i;throw""}catch(t){return new Worker("data:text/javascript;base64,"+$t,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class ie{constructor(t){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});var{sampling:e="all",win:i,blockClass:n,blockSelector:s,recordCanvas:r,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,r&&"all"===e&&this.initCanvasMutationObserver(i,n,s),r&&"number"==typeof e&&this.initCanvasFPSObserver(e,i,n,s,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,i,n,s,r){const e=Ht(i,n,s,!0),o=new Map,a=new ee,l=(a.onmessage=t=>{var e,i,n,s=t.data["id"];o.set(s,!1),"base64"in t.data&&({base64:t,type:e,width:i,height:n}=t.data,this.mutationCb({id:s,type:v["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:t}],type:e}]},0,0]}]}))},1e3/t);let u=0,c;const h=()=>{const e=[];return i.document.querySelectorAll("canvas").forEach(t=>{B(t,n,s,!0)||e.push(t)}),e},d=t=>{c=(u&&t-u<l||(u=t,h().forEach(async t=>{var e,i,n=this.mirror.getId(t);o.get(n)||0!==t.width&&0!==t.height&&(o.set(n,!0),["webgl","webgl2"].includes(t.__context)&&!1===(null==(i=null==(e=t.getContext(t.__context))?void 0:e.getContextAttributes())?void 0:i.preserveDrawingBuffer)&&e.clear(e.COLOR_BUFFER_BIT),i=await createImageBitmap(t),a.postMessage({id:n,bitmap:i,width:t.width,height:t.height,dataURLOptions:r.dataURLOptions},[i]))})),requestAnimationFrame(d))};c=requestAnimationFrame(d),this.resetObservers=()=>{e(),cancelAnimationFrame(c)}}initCanvasMutationObserver(t,e,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Ht(t,e,i,!1),s=function(i,n,s,r){const t=[];var e;for(const a of Object.getOwnPropertyNames(n.CanvasRenderingContext2D.prototype))try{"function"==typeof n.CanvasRenderingContext2D.prototype[a]&&(e=W(n.CanvasRenderingContext2D.prototype,a,function(t){return function(...e){return B(this.canvas,s,r,!0)||setTimeout(()=>{var t=Jt(e,n,this);i(this.canvas,{type:v["2D"],property:a,args:t})},0),t.apply(this,e)}}),t.push(e))}catch{var o=U(n.CanvasRenderingContext2D.prototype,a,{set(t){i(this.canvas,{type:v["2D"],property:a,args:[t],setter:!0})}});t.push(o)}return()=>{t.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i),r=function(t,e,i,n){const s=[];return s.push(...Qt(e.WebGLRenderingContext.prototype,v.WebGL,t,i,n,0,e)),void 0!==e.WebGL2RenderingContext&&s.push(...Qt(e.WebGL2RenderingContext.prototype,v.WebGL2,t,i,n,0,e)),()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,this.mirror);this.resetObservers=()=>{n(),s(),r()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,e){var i,n;this.frozen||this.locked||(n=this.pendingCanvasMutations.get(t))&&-1!==e&&(i=n.map(t=>{const{type:e,...i}=t;return i}),n=n[0]["type"],this.mutationCb({id:e,type:n,commands:i}),this.pendingCanvasMutations.delete(t))}}class ne{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new M),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"ws"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0!==t.length){var i={id:e,styleIds:[]},n=[];for(const s of t){let t;this.styleMirror.has(s)?t=this.styleMirror.getId(s):(t=this.styleMirror.add(s),n.push({styleId:t,rules:Array.from(s.rules||CSSRule,(t,e)=>({rule:m(t),index:e}))})),i.styleIds.push(t)}0<n.length&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class se{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){t=this.nodeMap.get(t);return t&&Array.from(t).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(){}}let lt,re,oe,ae=!1;try{2!==Array.from([1],t=>2*t)[0]&&(qt=document.createElement("iframe"),document.body.appendChild(qt),Array.from=(null==(s=qt.contentWindow)?void 0:s.Array.from)||Array.from,document.body.removeChild(qt))}catch(t){console.debug("Unable to override Array.from",t)}const ut=new ct;function t(t={}){const{emit:n,checkoutEveryNms:s,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:E="rr-ignore",ignoreSelector:L=null,maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:G,maskInputOptions:e,slimDOMOptions:c,maskInputFn:h,maskTextFn:d,hooks:U,packFn:v,sampling:f={},dataURLOptions:m={},mousemoveWait:p,recordDOM:g=!0,recordCanvas:y=!1,recordCrossOriginIframes:W=!1,recordAfter:B="DOMContentLoaded"===t.recordAfter?t.recordAfter:"load",userTriggeredOnInput:Y=!1,collectFonts:z=!1,inlineImages:b=!1,plugins:I,keepIframeSrcFn:C=()=>!1,ignoreCSSAttributes:Z=new Set([]),errorHandler:V}=t;t=V,rt=t;const S=!W||window.parent===window;let w=!1;if(!S)try{window.parent.document&&(w=!1)}catch(t){w=!0}if(S&&!n)throw new Error("emit function is required");if(!S&&!w)return()=>{};void 0!==p&&void 0===f.mousemove&&(f.mousemove=p),ut.reset();const k=!0===G?{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!==e?e:{password:!0},_=!0===c||"all"===c?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===c,headMetaDescKeywords:"all"===c,headTitleMutations:"all"===c}:c||{};!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let e=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();let K,O=0;const P=t=>{for(const e of I||[])e.eventProcessor&&(t=e.eventProcessor(t));return t=v&&!w?v(t):t},A=(lt=(t,e)=>{var i;t.timestamp=it(),null==(i=at[0])||!i.isFrozen()||t.type===nt.FullSnapshot||t.type===nt.IncrementalSnapshot&&t.data.source===st.Mutation||at.forEach(t=>t.unfreeze()),S?null!=n&&n(P(t),e):w&&(i={type:"rrweb",event:P(t),origin:window.location.origin,isCheckout:e},window.parent.postMessage(i,"*")),t.type===nt.FullSnapshot?(K=t,O=0):t.type!==nt.IncrementalSnapshot||t.data.source===st.Mutation&&t.data.isAttachIframe||(O++,e=r&&O>=r,i=s&&t.timestamp-K.timestamp>s,(e||i)&&re(!0))},t=>{lt({type:nt.IncrementalSnapshot,data:{source:st.Mutation,...t}})}),J=t=>lt({type:nt.IncrementalSnapshot,data:{source:st.Scroll,...t}}),X=t=>lt({type:nt.IncrementalSnapshot,data:{source:st.CanvasMutation,...t}});const M=new ne({mutationCb:A,adoptedStyleSheetCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.AdoptedStyleSheet,...t}})}),j=new Bt({mirror:ut,mutationCb:A,stylesheetManager:M,recordCrossOriginIframes:W,wrappedEmit:lt});for(const R of I||[])R.getMirror&&R.getMirror({nodeMirror:ut,crossOriginIframeMirror:j.crossOriginIframeMirror,crossOriginIframeStyleMirror:j.crossOriginIframeStyleMirror});const T=new se,x=(oe=new ie({recordCanvas:y,mutationCb:X,win:window,blockClass:i,blockSelector:o,mirror:ut,sampling:f.canvas,dataURLOptions:m}),new Yt({mutationCb:A,scrollCb:J,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:k,dataURLOptions:m,maskTextFn:d,maskInputFn:h,recordCanvas:y,inlineImages:b,sampling:f,slimDOMOptions:_,iframeManager:j,stylesheetManager:M,canvasManager:oe,keepIframeSrcFn:C,processedNodeManager:T},mirror:ut}));re=(t=!1)=>{if(g){lt({type:nt.Meta,data:{href:window.location.href,width:Ct(),height:It()}},t),M.reset(),x.init(),at.forEach(t=>t.lock());var e=function(t,e){var{mirror:e=new ct,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:r=null,inlineStylesheet:o=!0,inlineImages:a=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:c,maskInputFn:h,slimDOM:d=!1,dataURLOptions:v,preserveWhiteSpace:f,onSerialize:m,onIframeLoad:p,iframeLoadTimeout:g,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:I=()=>!1}=e||{};return tt(t,{doc:t,mirror:e,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:r,skipChild:!1,inlineStylesheet:o,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:c,maskInputFn:h,slimDOMOptions:!0===d||"all"===d?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===d,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===d?{}:d,dataURLOptions:v,inlineImages:a,recordCanvas:l,preserveWhiteSpace:f,onSerialize:m,onIframeLoad:p,iframeLoadTimeout:g,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:I,newlyAddedElement:!1})}(document,{mirror:ut,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:k,maskTextFn:d,slimDOM:_,dataURLOptions:m,recordCanvas:y,inlineImages:b,onSerialize:t=>{wt(t,ut)&&j.addIframe(t),kt(t,ut)&&M.trackLinkElement(t),_t(t)&&x.addShadowRoot(t.shadowRoot,document)},onIframeLoad:(t,e)=>{j.attachIframe(t,e),x.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{M.attachLinkElement(t,e)},keepIframeSrcFn:C});if(!e)return console.warn("Failed to snapshot the document");lt({type:nt.FullSnapshot,data:{node:e,initialOffset:bt(window)}},t),at.forEach(t=>t.unlock()),document.adoptedStyleSheets&&0<document.adoptedStyleSheets.length&&M.adoptStyleSheets(document.adoptedStyleSheets,ut.getId(document))}};try{const F=[],D=t=>{return ot(Lt)({mutationCb:A,mousemoveCb:(t,e)=>lt({type:nt.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.MouseInteraction,...t}}),scrollCb:J,viewportResizeCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.ViewportResize,...t}}),inputCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.Input,...t}}),mediaInteractionCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.MediaInteraction,...t}}),styleSheetRuleCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.StyleSheetRule,...t}}),styleDeclarationCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.StyleDeclaration,...t}}),canvasMutationCb:X,fontCb:t=>lt({type:nt.IncrementalSnapshot,data:{source:st.Font,...t}}),selectionCb:t=>{lt({type:nt.IncrementalSnapshot,data:{source:st.Selection,...t}})},customElementCb:t=>{lt({type:nt.IncrementalSnapshot,data:{source:st.CustomElement,...t}})},blockClass:i,ignoreClass:E,ignoreSelector:L,maskTextClass:a,maskTextSelector:l,maskInputOptions:k,inlineStylesheet:u,sampling:f,recordDOM:g,recordCanvas:y,inlineImages:b,userTriggeredOnInput:Y,collectFonts:z,doc:t,maskInputFn:h,maskTextFn:d,keepIframeSrcFn:C,blockSelector:o,slimDOMOptions:_,dataURLOptions:m,mirror:ut,iframeManager:j,stylesheetManager:M,shadowDomManager:x,processedNodeManager:T,canvasManager:oe,ignoreCSSAttributes:Z,plugins:(null==(t=null==I?void 0:I.filter(t=>t.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>lt({type:nt.Plugin,data:{plugin:e.name,payload:t}})})))||[]},U)},N=(j.addLoadListener(t=>{try{F.push(D(t.contentDocument))}catch(t){console.warn(t)}}),()=>{re(),F.push(D(document)),ae=!0});return"interactive"===document.readyState||"complete"===document.readyState?N():(F.push(et("DOMContentLoaded",()=>{lt({type:nt.DomContentLoaded,data:{}}),"DOMContentLoaded"===B&&N()})),F.push(et("load",()=>{lt({type:nt.Load,data:{}}),"load"===B&&N()},window))),()=>{F.forEach(t=>t()),T.destroy(),ae=!1,rt=void 0}}catch(t){console.warn(t)}}t.addCustomEvent=(t,e)=>{if(!ae)throw new Error("please add custom event after start recording");lt({type:nt.Custom,data:{tag:t,payload:e}})},t.freezePage=()=>{at.forEach(t=>t.freeze())},t.takeFullSnapshot=t=>{if(!ae)throw new Error("please take full snapshot after start recording");re(t)},t.mirror=ut,i.record=t}},n={};function s(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[t].call(e.exports,e,e.exports,s)),e.exports}return s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s(2043).default})());
|