@lucida-analytics/browser 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -0
- package/dist/autocapture.d.ts +1 -1
- package/dist/autocapture.js +1 -1
- package/dist/{banner-2TSKJ4WK.js → banner-7LEREYUH.js} +1 -1
- package/dist/{static/v0.1.3/chunk-32K5P5GN.js → chunk-536QABLP.js} +1 -1
- package/dist/{static/v0.1.3/chunk-O4W7SZ2X.js → chunk-EFNCQJI3.js} +1 -1
- package/dist/chunk-UPPUYIIH.js +1 -0
- package/dist/{client-DkIhkh91.d.ts → client-DZX6o-eI.d.ts} +2 -2
- package/dist/consent.d.ts +9 -3
- package/dist/consent.js +1 -1
- package/dist/core.d.ts +3 -3
- package/dist/core.js +3 -3
- package/dist/correlate.d.ts +1 -1
- package/dist/early-access.d.ts +1 -1
- package/dist/experiments.d.ts +1 -1
- package/dist/flags.d.ts +1 -1
- package/dist/forms.d.ts +1 -1
- package/dist/guides.d.ts +2 -1116
- package/dist/heatmaps.d.ts +1 -1
- package/dist/host-headers.d.ts +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.js +2 -2
- package/dist/inspector.d.ts +1 -1
- package/dist/lucida.js +2 -2
- package/dist/recommendations.d.ts +1 -1
- package/dist/{recorder-P2QJ4AKY.js → recorder-4WIMQCLR.js} +1 -1
- package/dist/replay.d.ts +2 -2
- package/dist/replay.js +1 -1
- package/dist/static/v0/autocapture.js +1 -1
- package/dist/static/v0/{banner-2TSKJ4WK.js → banner-7LEREYUH.js} +1 -1
- package/dist/static/v0/{chunk-32K5P5GN.js → chunk-536QABLP.js} +1 -1
- package/dist/static/v0/{chunk-O4W7SZ2X.js → chunk-EFNCQJI3.js} +1 -1
- package/dist/static/v0/chunk-UPPUYIIH.js +1 -0
- package/dist/static/v0/consent.js +1 -1
- package/dist/static/v0/core.js +3 -3
- package/dist/static/v0/index.js +2 -2
- package/dist/static/v0/lucida.js +2 -2
- package/dist/static/v0/manifest.json +28 -0
- package/dist/static/{v0.1.3/recorder-P2QJ4AKY.js → v0/recorder-4WIMQCLR.js} +1 -1
- package/dist/static/v0/replay.js +1 -1
- package/dist/static/{v0.1.3 → v0.1.5}/autocapture.js +1 -1
- package/dist/static/{v0.1.3/banner-2TSKJ4WK.js → v0.1.5/banner-7LEREYUH.js} +1 -1
- package/dist/{chunk-32K5P5GN.js → static/v0.1.5/chunk-536QABLP.js} +1 -1
- package/dist/{chunk-O4W7SZ2X.js → static/v0.1.5/chunk-EFNCQJI3.js} +1 -1
- package/dist/static/v0.1.5/chunk-UPPUYIIH.js +1 -0
- package/dist/static/v0.1.5/consent.js +1 -0
- package/dist/static/v0.1.5/core.js +3 -0
- package/dist/static/v0.1.5/index.js +3 -0
- package/dist/static/v0.1.5/lucida.js +3 -0
- package/dist/static/v0.1.5/manifest.json +28 -0
- package/dist/static/{v0/recorder-P2QJ4AKY.js → v0.1.5/recorder-4WIMQCLR.js} +1 -1
- package/dist/static/v0.1.5/replay.js +1 -0
- package/dist/toolbar.d.ts +1 -1
- package/dist/{types-XbAgeGjz.d.ts → types-Dng5ldZO.d.ts} +52 -4
- package/dist/webmcp.d.ts +1 -1
- package/lucida-global.d.ts +24 -0
- package/package.json +7 -5
- package/storage.json +75 -0
- package/dist/chunk-UH2MVDMX.js +0 -1
- package/dist/static/v0/chunk-UH2MVDMX.js +0 -1
- package/dist/static/v0.1.3/chunk-UH2MVDMX.js +0 -1
- package/dist/static/v0.1.3/consent.js +0 -1
- package/dist/static/v0.1.3/core.js +0 -3
- package/dist/static/v0.1.3/index.js +0 -3
- package/dist/static/v0.1.3/integrity.json +0 -30
- package/dist/static/v0.1.3/lucida.js +0 -3
- package/dist/static/v0.1.3/replay.js +0 -1
- package/dist/types-Bgl5v0MP.d.ts +0 -972
- /package/dist/static/{v0.1.3 → v0.1.5}/chunk-AWIQCFGN.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/chunk-FUE3SDQU.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/correlate.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/early-access.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/experiments.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/flags.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/forms.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/guides.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/heatmaps.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/host-headers.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/inspector.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/modules-FANMZRDJ.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/persistent-SLVINN5A.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/recommendations.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/toolbar.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/validation-HGJXZ553.js +0 -0
- /package/dist/static/{v0.1.3 → v0.1.5}/webmcp.js +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";(()=>{var E=(t,e)=>()=>(t&&(e=t(t=0)),e);function it(t,e,n){return e==="opt_in"?"opt_in":n==="opt_in"||n==="opt_out"||n==="cookieless"?n:e==="opt_out"?t:void 0}var Pe,ot,ge,te,at=E(()=>{"use strict";Pe="lc_consent";ot=["analytics","replay","marketing"],ge=class{constructor(e){this.o=e;this.modeNow=e.mode??"opt_out",this.queueBeforeConsent=e.queueBeforeConsent??!1;let n=this.opens();this.state={analytics:n,replay:n,marketing:n},this.key=e.storageKey||Pe;let r=e.storage.get(this.key);if(r)try{let s=JSON.parse(r);for(let o of ot)typeof s[o]=="boolean"&&(this.state[o]=s[o]);this.decided=ot.some(o=>typeof s[o]=="boolean")}catch{}this.waiting=!!e.awaitRemote&&!this.decided,this.waiting&&(this.state={analytics:!1,replay:!1,marketing:!1})}o;modeNow;queueBeforeConsent;state;decided=!1;waiting;geoCookieless=!1;key;listeners=[];opens(){return this.modeNow==="opt_out"&&!(this.o.respectDnt&&this.o.dnt)}get mode(){return this.modeNow}get resolving(){return this.waiting}get anonymous(){return this.geoCookieless&&!this.decided}resolve(e){if(!this.waiting)return this.state.analytics;this.waiting=!1,(e==="opt_in"||e==="opt_out")&&(this.modeNow=e),this.geoCookieless=e==="cookieless";let n=!this.geoCookieless&&this.opens();return this.state={analytics:n,replay:n,marketing:n},n}get(){return{...this.state}}has(e){return this.state[e]}status(e="analytics"){return this.decided?this.state[e]?"granted":"denied":"pending"}get pending(){return this.waiting||this.modeNow==="opt_in"&&!this.state.analytics}set(e){let n=this.get();for(let r of ot)e[r]!==void 0&&(this.state[r]=e[r]);this.decided=!0,this.waiting=!1,this.o.storage.set(this.key,JSON.stringify(this.state));for(let r of this.listeners)r(this.get(),n)}onChange(e){this.listeners.push(e)}},te=class{constructor(e,n){this.inner=e;this.allowed=n}inner;allowed;mem=new Map;get(e){return this.mem.has(e)?this.mem.get(e)??null:this.inner.get(e)}set(e,n){this.allowed()?this.inner.set(e,n):this.mem.set(e,n)}remove(e){this.allowed()?this.inner.remove(e):this.mem.set(e,null)}flushBuffered(){for(let[e,n]of this.mem)n===null?this.inner.remove(e):this.inner.set(e,n);this.mem.clear()}discardBuffered(){this.mem.clear()}}});function rn(t){let e=new Uint8Array(t),n=globalThis.crypto;if(n?.getRandomValues)n.getRandomValues(e);else for(let r=0;r<t;r++)e[r]=Math.floor(Math.random()*256);return e}function Y(t=Date.now()){if(t>$e){$e=t;let o=rn(2);ie=((o[0]??0)<<8|(o[1]??0))&1023}else ie++,ie>4095&&($e++,ie=0);let e=rn(8),n=new Uint8Array(16),r=$e;n[0]=Math.floor(r/2**40)&255,n[1]=Math.floor(r/2**32)&255,n[2]=Math.floor(r/2**24)&255,n[3]=Math.floor(r/2**16)&255,n[4]=Math.floor(r/2**8)&255,n[5]=r&255,n[6]=112|ie>>8,n[7]=ie&255,n[8]=128|(e[0]??0)&63;for(let o=1;o<8;o++)n[8+o]=e[o]??0;let s=Array.from(n,o=>o.toString(16).padStart(2,"0")).join("");return`${s.slice(0,8)}-${s.slice(8,12)}-${s.slice(12,16)}-${s.slice(16,20)}-${s.slice(20)}`}var $e,ie,Oe=E(()=>{"use strict";$e=0,ie=0});var sn,Ae,on=E(()=>{"use strict";Oe();sn="lc_identity",Ae=class{constructor(e,n,r=!1,s=!1){this.storage=e;this.cookieless=r;let o=e.get(sn),i;try{i=o?JSON.parse(o):void 0}catch{i=void 0}if(i?.distinct_id)this.s=i;else if(r)this.s={distinct_id:"",anon_id:"",identified:!1};else{let a=n??Y();this.s={distinct_id:a,anon_id:a,identified:s&&!!n},this.save()}}storage;cookieless;s;save(){this.storage.set(sn,JSON.stringify(this.s))}get distinctId(){return this.s.distinct_id}get priorAnonId(){return this.s.identified&&this.s.anon_id&&this.s.anon_id!==this.s.distinct_id?this.s.anon_id:void 0}get isIdentified(){return this.s.identified}identify(e){if(!e||e===this.s.distinct_id)return e&&!this.s.identified&&(this.s.identified=!0,this.save()),{event:null};let n=this.s.distinct_id,r=!this.s.identified;return this.s={...this.s,distinct_id:e,identified:!0},this.save(),r&&n?{event:"$identify",anonDistinctId:n}:{event:"$identify"}}aliasProps(e,n){return{alias:e,distinct_id:n??this.s.distinct_id}}reset(e=!1){if(this.cookieless){this.s={distinct_id:"",anon_id:"",identified:!1};return}let n=e&&this.s.anon_id||Y();this.s={distinct_id:n,anon_id:n,identified:!1},this.save()}}});function oe(t,e={}){let n=Math.min(e.maxMs??3e4,(e.baseMs??1e3)*2**t);return Math.round(n*(.5+.5*(e.random??Math.random)()))}function an(t){return t===0||t===408||t===429||t>=500}var Ie=E(()=>{"use strict"});var Me,cn=E(()=>{"use strict";Ie();Me=class{constructor(e){this.o=e;this.flushAt=e.flushAt??20,this.intervalMs=e.flushIntervalMs??5e3,this.maxSize=e.maxQueueSize??1e3,this.maxRetries=e.maxRetries??5,this.batchMax=Math.max(1,Math.min(e.maxBatchSize??1e3,1e3))}o;items=[];timer;attempt=0;inflight;closed=!1;warned404=!1;flushAt;intervalMs;maxSize;maxRetries;batchMax;get size(){return this.items.length}enqueue(e){this.closed||(this.items.push(e),this.items.length>this.maxSize&&this.o.onDrop?.(this.items.splice(0,this.items.length-this.maxSize),"queue_full"),this.items.length>=this.flushAt?this.flush():this.arm(this.intervalMs))}arm(e){this.timer===void 0&&(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},e))}disarm(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0}flush(e={}){if(this.disarm(),this.inflight)return this.inflight.then(()=>this.items.length?this.flush(e):void 0);if(!this.items.length)return Promise.resolve();let n=this.items.splice(0,this.batchMax),r=(this.o.clock??Date).now(),s=JSON.stringify({api_key:this.o.apiKey,batch:n,sent_at:new Date(r).toISOString()});this.o.log?.("send batch",n.length);let o=this.o.transport.send(this.o.url,s,e.beacon?{beacon:!0}:{}).then(i=>i,()=>({status:0,retryAfterMs:void 0})).then(i=>this.settle(n,i.status,!!e.beacon,i.retryAfterMs)).finally(()=>{this.inflight=void 0});return this.inflight=o,o}settle(e,n,r,s){if(n>=200&&n<300){this.attempt=0,this.items.length>=this.flushAt?this.flush():this.items.length&&this.arm(this.intervalMs);return}if(!an(n)||r||this.attempt>=this.maxRetries){n===404&&!this.warned404&&(this.warned404=!0,console.warn(`[lucida] ${this.o.url} returned 404, so events are being dropped. apiHost is probably wrong: use https://capture.lucidace.com (or your own capture host), not the app host.`)),this.o.onDrop?.(e,`status_${n}`),this.attempt=0;return}this.items.unshift(...e);let o=Math.max(oe(this.attempt++,this.o.backoff),Math.min(s??0,6e4));this.o.log?.("retry in",o,"ms"),this.arm(o)}clear(){this.items=[],this.disarm()}async shutdown(){await this.flush(),this.closed=!0,this.disarm()}}});function ln(t,e,n){return typeof t=="number"&&Number.isInteger(t)&&t>=e&&t<=n?t*6e4:void 0}function ys(t,e){let n=hs.exec(t);if(!n)return!0;let r=parseInt(n[1]+n[2],16);return r-e<=6e4&&e-r<=ms}var ct,fs,gs,ms,hs,Te,un=E(()=>{"use strict";Oe();ct="lc_session";fs=6e4,gs=10*36e5,ms=24*36e5,hs=/^([0-9a-f]{8})-?([0-9a-f]{4})-7[0-9a-f]{3}-/i;Te=class{constructor(e,n={}){this.storage=e;this.o=n;this.idleMs=Math.min(gs,Math.max(fs,n.idleMs??30*6e4)),this.maxMs=n.maxMs??24*36e5,this.newOn=n.newOnEvents??[],this.clock=n.clock??{now:()=>Date.now()},this.bootstrapId=n.bootstrapId}storage;o;windowId=Y();idleMs;maxMs;newOn;clock;bootstrapId;configure(e){this.o.idleMs===void 0&&(this.idleMs=ln(e.session_idle_minutes,1,600)??this.idleMs),this.o.maxMs===void 0&&(this.maxMs=ln(e.session_max_minutes,5,10080)??this.maxMs),this.o.newOnEvents===void 0&&Array.isArray(e.session_new_on_events)&&(this.newOn=e.session_new_on_events.filter(n=>typeof n=="string"&&n!==""))}read(){try{let e=this.storage.get(ct);return e?JSON.parse(e):void 0}catch{return}}touch(e,n){let r=this.clock.now(),s=this.read(),o=!!(s?.campaign&&e&&s.campaign!==e),i=n!==void 0&&this.newOn.includes(n),a=!s||Math.abs(r-s.last)>this.idleMs||Math.abs(r-s.start)>this.maxMs||o||i;return(a||!s)&&(s={id:!s&&this.bootstrapId&&ys(this.bootstrapId,r)?this.bootstrapId:Y(r),start:r,last:r}),this.bootstrapId=void 0,s.last=r,e&&(s.campaign=e),this.storage.set(ct,JSON.stringify(s)),{sessionId:s.id,windowId:this.windowId,isNew:a}}startedAt(){return this.read()?.start}reset(){this.storage.remove(ct)}}});function dn(t,e){let n=t.get(e);if(n)try{return JSON.parse(n)}catch{return}}var je,Fe,pn=E(()=>{"use strict";je=class{constructor(e,n="lc_props",r){this.storage=e;this.key=n;this.persist=r;this.p=dn(e,n)??{}}storage;key;persist;p;save(){let e=this.persist;this.storage.set(this.key,JSON.stringify(e?Object.fromEntries(Object.entries(this.p).filter(([n])=>e(n))):this.p))}register(e){Object.assign(this.p,e),this.save()}registerOnce(e){for(let[n,r]of Object.entries(e))n in this.p||(this.p[n]=r);this.save()}unregister(e){delete this.p[e],this.save()}all(){return{...this.p}}clear(){this.p={},this.storage.remove(this.key)}},Fe=class{constructor(e){this.storage=e;this.g=dn(e,"lc_groups")??{}}storage;g;set(e,n){this.g[e]=n,this.storage.set("lc_groups",JSON.stringify(this.g))}all(){return Object.keys(this.g).length?{...this.g}:void 0}clear(){this.g={},this.storage.remove("lc_groups")}}});function vs(t,e){let n=new Date(t??e);return(Number.isNaN(n.getTime())?new Date(e):n).toISOString()}var me,fn=E(()=>{"use strict";at();on();cn();un();pn();Oe();me=class{constructor(e){this.c=e;this.clock=e.clock??{now:()=>Date.now()},this.consent=new ge({...e.consent,storage:e.consentStorage??e.storage}),this.gated=new te(e.storage,()=>this.consent.has("analytics")),this.storage=this.gated,this.identity=new Ae(this.gated,e.bootstrapDistinctId,e.cookieless,e.bootstrapIdentified),this.session=new Te(this.gated,{clock:this.clock,...e.session}),this.props=new je(this.gated,void 0,e.persistProperty),this.groupState=new Fe(this.gated),this.queue=new Me({transport:e.transport,url:`${e.apiHost.replace(/\/+$/,"")}/v1/batch`,apiKey:e.apiKey,clock:this.clock,...e.log?{log:e.log}:{},...e.onDrop?{onDrop:e.onDrop}:{},...e.queue})}c;consent;identity;session;queue;storage;gated;props;groupState;clock;device;pre=[];listeners=[];captureListeners=[];sessionListeners=[];lastSession="";filter;get anonDistinctId(){return this.identity.priorAnonId}get distinctId(){return this.identity.distinctId}get deviceId(){return this.c.cookieless?"":(this.device||(this.device=this.gated.get("lc_device_id")||Y(),this.gated.set("lc_device_id",this.device)),this.device)}get groups(){return this.groupState.all()}get sessionId(){return this.touchSession().sessionId}touchSession(e){let n=this.session.touch(this.c.campaignKey?.(),e);if(n.sessionId!==this.lastSession){this.lastSession=n.sessionId;for(let r of this.sessionListeners)r(n.sessionId,n.windowId)}return n}onSessionId(e){return this.sessionListeners.push(e),()=>{this.sessionListeners.splice(this.sessionListeners.indexOf(e),1)}}get sessionStart(){return this.session.startedAt()}getProperty(e){return this.props.all()[e]}setFilter(e){this.filter=e}onChange(e){this.listeners.push(e)}onCaptured(e){this.captureListeners.push(e)}emit(e){for(let n of this.listeners)n(e)}consentStatus(){return this.consent.status()}get anonymousOnReject(){return!!this.c.consent?.cookielessOnReject&&this.consent.status()==="denied"}capture(e,n={},r={}){let s=this.consent.has("analytics"),o=!s&&(this.anonymousOnReject||this.consent.anonymous),i=this.consent.pending&&(this.consent.queueBeforeConsent||this.consent.resolving);if(!s&&!o&&!i){this.c.log?.("dropped (no consent)",e);return}if(o&&(e==="$identify"||e==="$create_alias")){this.c.log?.("withheld (declined, anonymous mode)",e);return}let a=this.touchSession(e),c=this.c.enrich?.(e,n),l=this.consent.status()!=="pending",u=o?{}:{...c?.$set,...r.$set,...e==="$consent_updated"&&l?{$consent:this.consent.get()}:{}},p=o?{}:{...c?.$set_once,...r.$set_once},h=this.groupState.all(),g=o?"":this.identity.distinctId,x={uuid:Y(this.clock.now()),event:e,...g?{distinct_id:g}:{},timestamp:vs(r.timestamp,this.clock.now()),properties:{...this.props.all(),...c?.properties,...n,$session_id:a.sessionId,$window_id:a.windowId,$lib:this.c.library.name,$lib_version:this.c.library.version,...l?{$consent:this.consent.get()}:{}},...Object.keys(u).length?{$set:u}:{},...Object.keys(p).length?{$set_once:p}:{},...!o&&r.$unset?.length?{$unset:r.$unset}:{},...h?{$groups:h}:{}},v=this.filter?this.filter(x):x;if(!v){this.c.log?.("dropped (policy)",e);return}this.c.log?.("capture",e,v),this.c.onCapture?.(v);for(let w of this.captureListeners)w(v);return s||o?this.queue.enqueue(v):this.pre.length<(this.c.queue?.maxQueueSize??1e3)&&this.pre.push(v),v}identify(e,n,r){let s=this.identity.identify(e);(s.event||n||r)&&this.capture("$identify",s.anonDistinctId?{$anon_distinct_id:s.anonDistinctId}:{},{...n?{$set:n}:{},...r?{$set_once:r}:{}}),this.emit("identify")}alias(e,n){this.capture("$create_alias",this.identity.aliasProps(e,n))}reset(e={}){this.identity.reset(e.reuseAnonymousId),e.resetDeviceId&&(this.device=void 0,this.gated.remove("lc_device_id")),this.props.clear(),this.groupState.clear(),this.session.reset(),this.lastSession="",this.emit("reset")}register(e){this.props.register(e)}registerOnce(e){this.props.registerOnce(e)}unregister(e){this.props.unregister(e)}group(e,n,r){this.groupState.set(e,n),this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r??{}}),this.emit("group")}getConsent(){return this.consent.get()}getConsentStatus(e="analytics"){return this.consent.status(e)}hasConsent(e){return this.consent.has(e)}setConsent(e){let n=this.consent.has("analytics"),r=e.analytics??n;if(n&&!r&&(this.capture("$opt_out"),this.queue.flush()),!n&&r&&(this.anonymousOnReject||this.consent.anonymous)&&this.queue.flush(),this.consent.set(e),!n&&r){this.gated.flushBuffered();for(let s of this.pre.splice(0))this.queue.enqueue(s);this.capture("$opt_in")}else n&&!r&&this.queue.clear();r||(this.pre.length=0),this.emit("consent")}applyRemote(e){this.session.configure(e),this.resolveConsent(it(this.consent.mode,e.consent_mode,e.consent_default))}resolveConsent(e){if(!this.consent.resolving)return;let n=this.consent.resolve(e),r=this.pre.splice(0);if(n){this.gated.flushBuffered();for(let s of r)this.queue.enqueue(s)}else if(this.consent.anonymous){this.gated.discardBuffered();for(let s of r){if(s.event==="$identify"||s.event==="$create_alias")continue;let o={...s};delete o.distinct_id,delete o.$set,delete o.$set_once,delete o.$unset,this.queue.enqueue(o)}}else this.consent.queueBeforeConsent&&this.pre.push(...r);this.emit("consent")}optIn(){this.setConsent({analytics:!0,replay:!0,marketing:!0})}optOut(){this.setConsent({analytics:!1,replay:!1,marketing:!1})}flush(e){return this.queue.flush(e)}shutdown(){return this.queue.shutdown()}}});function lt(t){let e="";return n=>{for(e+=n;;){let r=/\r?\n\r?\n/.exec(e);if(!r)return;let s=e.slice(0,r.index);e=e.slice(r.index+r[0].length);let o="message",i,a=[];for(let c of s.split(/\r?\n/)){if(c.startsWith(":"))continue;let l=c.indexOf(":"),[u,p]=l<0?[c,""]:[c.slice(0,l),c.slice(l+1).replace(/^ /,"")];u==="event"?o=p??"":u==="data"?a.push(p??""):u==="id"&&(i=p)}a.length&&t(i===void 0?{event:o,data:a.join(`
|
|
2
|
+
`)}:{event:o,data:a.join(`
|
|
3
|
+
`),id:i})}}}var Le,ut=E(()=>{"use strict";Ie();Le=class{constructor(e){this.o=e}o;ctl;stopped=!0;timer;start(){this.stopped&&(this.stopped=!1,this.loop())}stop(){this.stopped=!0,this.ctl?.abort(),this.timer&&clearTimeout(this.timer),this.o.onState?.(!1)}async loop(){let e=0;for(;!this.stopped;){try{await this.connectOnce()&&(e=0)}catch(r){this.stopped||this.o.log?.("flag stream error",r)}if(this.o.onState?.(!1),this.stopped)return;let n=oe(e++,this.o.backoff);await new Promise(r=>{this.timer=setTimeout(r,n),this.timer.unref?.()})}}async connectOnce(){this.ctl=new AbortController;let e=await this.o.fetch(this.o.url,{headers:{Authorization:`Bearer ${this.o.secretKey}`,Accept:"text/event-stream"},signal:this.ctl.signal});if(!e.ok||!e.body)throw new Error(`stream status ${e.status}`);this.o.onState?.(!0);let n=lt(s=>{if(s.event==="definitions")try{this.o.onChange(JSON.parse(s.data).etag)}catch{this.o.onChange(void 0)}}),r=e.body.pipeThrough(new TextDecoderStream).getReader();for(;;){let{done:s,value:o}=await r.read();if(s)return!0;n(o)}}}});function dt(t){let e=!1,n,r=new Le({url:`${t.apiHost}/v1/flags/stream`,secretKey:t.apiKey,fetch:t.fetch,...t.backoff?{backoff:t.backoff}:{},...t.log?{log:t.log}:{},onState:l=>e=l,onChange:l=>{l!==void 0&&l===n||(n=l,t.reload())}}),s=()=>t.visibility?.hidden()??!1,o=t.pollMs??6e4,i=o>0?setInterval(()=>!e&&!s()&&t.reload(),o):void 0,a=()=>{s()?r.stop():(r.start(),t.reload())};s()||r.start();let c=t.visibility?.subscribe(a);return()=>{r.stop(),c?.(),i&&clearInterval(i)}}var gn=E(()=>{"use strict";ut()});function pt(t,e){let n=new Set,{whenConsented:r,disabled:s,...o}=e,i=new De({...o,distinctId:()=>t.distinctId,onIntervention:c=>{for(let l of[...n])l(c)}}),a=!1;return t.onChange(c=>{a&&((c==="identify"||c==="reset")&&i.restart(),c==="consent"&&(t.hasConsent("analytics")?i.start():i.stop()))}),{on(c){return n.add(c),!a&&!s&&(a=!0,r(()=>i.start())),()=>{n.delete(c)}},stop:()=>i.stop()}}var De,mn=E(()=>{"use strict";ut();Ie();De=class{constructor(e){this.o=e}o;ctl;stopped=!0;timer;cursor=0;gen=0;polling=!1;start(){this.stopped&&(this.stopped=!1,this.loop(++this.gen))}stop(){this.stopped=!0,this.gen++,this.ctl?.abort(),this.timer&&clearTimeout(this.timer)}restart(){let e=!this.stopped;this.stop(),this.cursor=0,e&&this.start()}live(e){return!this.stopped&&e===this.gen}deliver(e){if(e.seq>this.cursor){this.cursor=e.seq;try{this.o.onIntervention(e)}catch(n){this.o.log?.("onIntervention threw",n)}}}url(e){let n=`distinct_id=${encodeURIComponent(this.o.distinctId())}${this.cursor?`&cursor=${this.cursor}`:""}`;return`${this.o.apiHost}${e}?${n}`}sleep(e){return new Promise(n=>{this.timer=setTimeout(n,e),this.timer.unref?.()})}async loop(e){let n=0;for(;this.live(e);){let r;try{let s=await this.connectOnce(e);if(s==="gone")return this.stop();s==="poll"?(n=0,r=this.o.pollMs??15e3):(s==="streamed"&&(n=0),r=oe(n++,this.o.backoff))}catch(s){this.live(e)&&this.o.log?.("intervention stream error",s),r=oe(n++,this.o.backoff)}if(!this.live(e))return;await this.sleep(r)}}async connectOnce(e){if(this.polling)return this.pollOnce(e);this.ctl=new AbortController;let n={Authorization:`Bearer ${this.o.apiKey}`,Accept:"text/event-stream"},r=await this.o.fetch(this.url("/v1/interventions/stream"),{headers:n,signal:this.ctl.signal});if(r.status===404)return"gone";if(!r.ok)return"failed";let s=r.body;if(!s||typeof TextDecoderStream>"u")return this.ctl.abort(),this.polling=!0,this.pollOnce(e);let o=lt(a=>{if(!(a.event!=="intervention"||!this.live(e)))try{this.deliver(JSON.parse(a.data))}catch{this.o.log?.("bad intervention payload")}}),i=s.pipeThrough(new TextDecoderStream).getReader();for(;;){let{done:a,value:c}=await i.read();if(a)return"streamed";o(c)}}async pollOnce(e){this.ctl=new AbortController;let n=await this.o.fetch(this.url("/v1/interventions"),{headers:{Authorization:`Bearer ${this.o.apiKey}`},signal:this.ctl.signal});if(n.status===404)return"gone";if(!n.ok)return"failed";let r=await n.json();if(this.live(e))for(let s of r.data??[])this.deliver(s);return"poll"}}});function ft(t,e,n={}){let r=n.key??"lc_offline",s=n.maxBatches??50,o=n.maxBytes??1e6,i=n.isOnline??(()=>!0),a,c,l=()=>{try{let g=JSON.parse(e.get(r)??"[]");return Array.isArray(g)?g:[]}catch{return[]}},u=g=>{let x=g.reduce((v,w)=>v+w.body.length,0);for(;g.length>s||x>o&&g.length>1;)x-=g.shift().body.length;g.length?e.set(r,JSON.stringify(g)):e.remove(r)},p=g=>{u([...l(),...g]),a??=setTimeout(()=>{a=void 0,h.drain()},n.retryMs??3e4)},h={async send(g,x,v){if(!i())return p([{url:g,body:x}]),{status:200};let w=await t.send(g,x,v);return w.status!==0?w:(p([{url:g,body:x}]),{status:200})},drain(){return c??=(async()=>{let g=l();if(!g.length||!i())return;e.remove(r);let x=[];for(let[v,w]of g.entries())if((await t.send(w.url,w.body)).status===0){x.push(...g.slice(v));break}x.length&&p(x)})().finally(()=>{c=void 0}),c}};return h}var hn=E(()=>{"use strict"});function yn(t){let e=new TextEncoder().encode(t),n=e.length+9+63>>6<<6,r=new Uint8Array(n);r.set(e),r[e.length]=128;let s=new DataView(r.buffer);s.setUint32(n-8,Math.floor(e.length*8/2**32)),s.setUint32(n-4,e.length*8>>>0);let o=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],i=new Uint32Array(64);for(let a=0;a<n;a+=64){for(let l=0;l<16;l++)i[l]=s.getUint32(a+l*4);for(let l=16;l<64;l++){let u=i[l-15],p=i[l-2],h=G(u,7)^G(u,18)^u>>>3,g=G(p,17)^G(p,19)^p>>>10;i[l]=i[l-16]+h+i[l-7]+g|0}let c=o.slice();for(let l=0;l<64;l++){let[u,p,h,,g,x,v,w]=c,C=w+(G(g,6)^G(g,11)^G(g,25))+(g&x^~g&v)+bs[l]+i[l]|0,R=(G(u,2)^G(u,13)^G(u,22))+(u&p^u&h^p&h)|0;c.pop(),c.unshift(C+R|0),c[4]=c[4]+C|0}for(let l=0;l<8;l++)o[l]=o[l]+c[l]|0}return o.map(a=>(a>>>0).toString(16).padStart(8,"0")).join("")}var bs,G,vn=E(()=>{"use strict";bs=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),G=(t,e)=>t>>>e|t<<32-e});function bn(t){let e=t.split(".");if(e.length!==4)return;let n=[];for(let r of e){if(!_s.test(r)||Number(r)>255)return;n.push(Number(r))}return n}function ws(t){if(t.includes("%"))return;let e=t,n=t.lastIndexOf(":"),r=t.slice(n+1);if(r.includes(".")){let u=bn(r);if(!u)return;e=`${t.slice(0,n+1)}${(u[0]<<8|u[1]).toString(16)}:${(u[2]<<8|u[3]).toString(16)}`}let s=e.split("::");if(s.length>2)return;let o=u=>{if(u==="")return[];let p=[];for(let h of u.split(":")){if(!xs.test(h))return;p.push(parseInt(h,16))}return p},i=o(s[0]),a=s.length===2?o(s[1]):[];if(!i||!a)return;let c=i.length+a.length;return(s.length===2?c>7:c!==8)?void 0:[...i,...Array(8-c).fill(0),...a].flatMap(u=>[u>>8,u&255])}function _n(t){return t.includes(":")?ws(t):bn(t)}function xn(t){if(typeof t!="string")return;let e=_n(t.trim());return e&&Ss(e)?e.slice(12):e}function Cs(t){let e=typeof t=="string"?[t]:Array.isArray(t)?t:[],n=[];for(let r of e){if(typeof r!="string")continue;let s=r.trim(),o=s.indexOf("/");if(o<0){let c=xn(s);c&&n.push({bytes:c,bits:c.length*8});continue}let i=_n(s.slice(0,o)),a=s.slice(o+1);!i||!ks.test(a)||Number(a)>i.length*8||n.push({bytes:i,bits:Number(a)})}return n}function Rs(t,e){if(t.bytes.length!==e.length)return!1;for(let n=0;n<t.bits;n+=8){let s=255<<8-Math.min(8,t.bits-n)&255,o=n/8;if((t.bytes[o]&s)!==(e[o]&s))return!1}return!0}function kn(t,e,n,r){switch(t){case"array_contains_any":case"array_contains_all":case"array_contains_none":{if(!Array.isArray(e)||!Array.isArray(n))return!1;let s=n.filter(o=>e.some(i=>r(i,o))).length;return t==="array_contains_any"?s>0:t==="array_contains_all"?s===n.length:s===0}case"ip_in_cidr":case"ip_not_in_cidr":{let s=xn(e),o=Cs(n);return!s||!o.length?!1:o.some(i=>Rs(i,s))===(t==="ip_in_cidr")}}return!1}var _s,xs,ks,Ss,wn=E(()=>{"use strict";_s=/^(0|[1-9]\d{0,2})$/,xs=/^[0-9a-fA-F]{1,4}$/,ks=/^(0|[1-9]\d*)$/;Ss=t=>t.length===16&&t.slice(0,10).every(e=>e===0)&&t[10]===255&&t[11]===255});function Os(t){let e=Ps.exec(t.trim());return e?Number(e[1])*$s[e[2]]:void 0}function Cn(t,e,n){if(typeof t=="number")return t*1e3;if(typeof t!="string")return;let r=t.trim();if(n){let o=Os(r);if(o!==void 0)return e-o*1e3}if(!Es.test(r)&&!Sn.test(r))return;let s=Date.parse(Sn.test(r)?`${r}T00:00:00Z`:r);return Number.isNaN(s)?void 0:s}function Rn(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=t[n]??0,s=e[n]??0;if(r!==s)return r<s?-1:1}return 0}function As(t,e,n){if(typeof e!="string")return;let r=e.trim().replace(/^v/,"").split(".");if(t==="semver_wildcard"){let l=r[r.length-1];if(l!=="*"&&l!=="x"&&l!=="X")return;if(r.length===1)return[[0],[2**30]];let u=n.parseVersion(r.slice(0,-1).join("."));if(!u)return;let p=[...u];return p[p.length-1]=p[p.length-1]+1,[u,p]}let s=n.parseVersion(e);if(!s)return;for(;s.length<3;)s.push(0);let[o,i,a]=s,c;return t==="semver_tilde"&&r.length===1?c=[o+1,0,0]:t==="semver_tilde"||o===0&&i>0?c=[o,i+1,0]:o>0?c=[o+1,0,0]:c=[0,0,a+1],[s,c]}function En(t,e,n,r,s){switch(t){case"icontains":case"not_icontains":case"starts_with":case"not_starts_with":case"ends_with":case"not_ends_with":return typeof e!="string"||typeof n!="string"?!1:t.endsWith("icontains")?e.toLowerCase().includes(n.toLowerCase())===(t==="icontains"):t.endsWith("starts_with")?e.startsWith(n)===(t==="starts_with"):e.endsWith(n)===(t==="ends_with");case"between":case"not_between":{let o=s.toFloat(e);if(!Array.isArray(n)||n.length!==2||o===void 0)return!1;let[i,a]=n;return typeof i!="number"||typeof a!="number"?!1:(o>=i&&o<=a)==(t==="between")}case"is_date_before":case"is_date_after":{let o=Cn(e,r,!1),i=Cn(n,r,!0);return o===void 0||i===void 0?!1:t==="is_date_before"?o<i:o>i}case"semver_eq":case"semver_neq":case"semver_gt":case"semver_gte":case"semver_lt":case"semver_lte":{let o=s.cmpVersion(e,n);if(o===void 0)return!1;let i=t.slice(7);return i==="eq"?o===0:i==="neq"?o!==0:i==="gt"?o>0:i==="gte"?o>=0:i==="lt"?o<0:o<=0}case"semver_tilde":case"semver_caret":case"semver_wildcard":{let o=s.parseVersion(e),i=As(t,n,s);return!!o&&!!i&&Rn(o,i[0])>=0&&Rn(o,i[1])<0}}return!1}var Es,Sn,Ps,$s,Pn=E(()=>{"use strict";Es=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/,Sn=/^\d{4}-\d{2}-\d{2}$/,Ps=/^-?(\d{1,6})([hdwmy])$/,$s={h:3600,d:86400,w:604800,m:2592e3,y:31536e3}});function gt(t){if(typeof t=="number")return t;if(typeof t=="string"&&Is.test(t.trim()))return Number(t.trim())}function mt(t,e){let n=typeof t=="number",r=typeof e=="number";return n||r?n&&r&&t===e:t===e}function yt(t){if(typeof t!="string")return;let e=t.trim().replace(/^v/,""),n=e.search(/[-+]/);n>=0&&(e=e.slice(0,n));let r=[];for(let s of e.split(".")){if(!/^[+-]?\d+$/.test(s))return;let o=parseInt(s,10);if(o<0)return;r.push(o)}return r}function ht(t,e){let n=yt(t),r=yt(e);if(!(!n||!r)){for(let s=0;s<Math.max(n.length,r.length);s++){let o=n[s]??0,i=r[s]??0;if(o!==i)return o<i?-1:1}return 0}}function ne(t,e,n,r,s,o=Date.now()){let i=n&&e!==null&&e!==void 0;if(t==="is_set")return i;if(t==="is_not_set")return!i;if(!i)return!1;switch(t){case"eq":case"neq":{let a;if(s){let c=ht(e,r);if(c===void 0)return!1;a=c===0}else a=mt(e,r);return a===(t==="eq")}case"contains":case"ncontains":case"regex":case"nregex":{if(typeof e!="string"||typeof r!="string")return!1;if(t==="contains"||t==="ncontains")return e.includes(r)===(t==="contains");let a;try{a=new RegExp(r)}catch{return!1}return a.test(e)===(t==="regex")}case"gt":case"gte":case"lt":case"lte":{let a;if(s)a=ht(e,r);else{let c=gt(e),l=gt(r);a=c===void 0||l===void 0?void 0:Ms(c,l)}return a===void 0?!1:t==="gt"?a>0:t==="gte"?a>=0:t==="lt"?a<0:a<=0}case"in":case"not_in":return Array.isArray(r)?r.some(a=>mt(e,a))===(t==="in"):!1}return t.startsWith("array_")||t.startsWith("ip_")?kn(t,e,r,mt):En(t,e,r,o,{toFloat:gt,parseVersion:yt,cmpVersion:ht})}var Is,Ms,vt=E(()=>{"use strict";wn();Pn();Is=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;Ms=(t,e)=>t<e?-1:t>e?1:0});function _t(t){return t.properties?.length?`${t.key}|${JSON.stringify(t.properties.map(e=>[e.key,e.op,e.value??null]))}`:t.key}function $n(t,e,n=Date.now()){return(t.properties??[]).every(r=>ne(r.op,e[r.key],Object.hasOwn(e,r.key),r.value,!1,n))}function xt(t,e){let n=e[t.scope??"session"]?.[_t(t)]??0;return t.op==="is_set"?n>0:t.op==="is_not_set"?n===0:ne(t.op,n,!0,t.value,!1)}function An(t,e,n){for(let o of t.runtime??[])if(o.filters.every(a=>{if(a.type!=="flag")return xt(a,e);let c=n(a.key);return!!c&&ne(a.op,c.value,!0,a.value,!1)}))return An(o.result,e,n);if(!t.runtime)return t;let{runtime:r,...s}=t;return s}function kt(t,e){let n={},r=new Map,s=o=>{if(r.get(o)===2)return n[o];let i=t[o];if(!i||r.get(o)===1)return;r.set(o,1);let a=An(i,e,s);return n[o]=a,r.set(o,2),a};for(let o of Object.keys(t))s(o);return n}function He(t,e){let n=[],r=o=>{o.type==="event"&&o.properties?.length&&n.push(o)};for(let o of t??[])for(let i of o.conditions)for(let a of i.filters??[])r(a);let s=o=>{for(let i of o.runtime??[])i.filters.forEach(r),s(i.result)};return Object.values(e).forEach(s),n}function Ne(t,e){if(!bt(e))return e;let n=bt(t)?{...t}:{};for(let[r,s]of Object.entries(e))s===null?delete n[r]:n[r]=Ne(n[r],s);return n}var On,bt,he,wt=E(()=>{"use strict";vt();On=t=>(t??[]).filter(e=>e.type==="event");bt=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);he=class{session={};page={};sid="";constructor(e){if(e&&typeof e.sid=="string"&&bt(e.session)){this.sid=e.sid;for(let[n,r]of Object.entries(e.session))typeof r=="number"&&r>0&&(this.session[n]=r)}}record(e,n,r={},s=[]){n!==this.sid&&(this.sid=n,this.session={},this.page={}),e==="$pageview"&&(this.page={});let o=new Set([e]);for(let i of s)i.type==="event"&&i.key===e&&i.properties?.length&&$n(i,r)&&o.add(_t(i));for(let i of o)this.session[i]=(this.session[i]??0)+1,this.page[i]=(this.page[i]??0)+1}counts(e){return e===this.sid?{session:{...this.session},page:{...this.page}}:{session:{},page:{}}}saved(){return{sid:this.sid,session:{...this.session}}}}});function In(t,e){let n=e?t.contexts?.[e]:void 0;if(n)return n;if(e==="user")return{key:t.bucketing_key||t.distinct_id,properties:t.person_properties};if(e==="device")return{key:t.device_id,properties:t.device_properties}}function ye(t,e,n,r=!1){let s=r?`${t}.${e}.variant.${n}`:`${t}.${e}.${n}`;return parseInt(yn(s).slice(0,13),16)/js}function Fs(t,e){return typeof e=="boolean"?typeof t=="boolean"?t===e:e:t===e}function Ls(t,e,n){let r=e.now?Date.parse(e.now):NaN,s=Number.isNaN(r)?Date.now():r,o;switch(t.type){case"person":o=e.person_properties;break;case"group":o=e.group_properties?.[t.group_type??""];break;case"device":o=e.device_properties;break;case"geo":o=e.geo_properties;break;case"context":if(!Ts.includes(t.context_kind??""))return!1;o=In(e,t.context_kind)?.properties;break;case"app_version":return ne(t.op,e.app_version,!!e.app_version,t.value,!0,s);case"flag":{let i=n[t.key];return!!i&&ne(t.op,i.value,!0,t.value,!1,s)}default:return!1}return ne(t.op,o?.[t.key],!!o&&Object.hasOwn(o,t.key),t.value,!1,s)}function Ds(t,e,n){let r=t.variants;if(e.variant_override){let i=r.find(a=>a.key===e.variant_override);if(i)return i}let s=ye(t.key,t.salt,n,!0)*100,o=0;for(let i of r)if(o+=i.rollout_pct,s<o)return i;return r[r.length-1]}function Mn(t,e){return Tn(t.aggregation,e)}function Tn(t,e){return t.kind==="group"?e.groups?.[t.group_type??""]:t.kind==="device"?e.device_id:t.kind==="context"?In(e,t.context_kind)?.key:e.bucketing_key||e.distinct_id}function Hs(t,e,n,r){let s=t.sticky?r.sticky_assignments?.[t.key]:void 0;if(s===void 0)return;let o={value:!0,reason:"sticky_bucket",condition_index:n};if(t.type==="multivariate"&&t.variants?.length){if(t.variants.some(a=>a.key===e.variant_override))return;let i=t.variants.find(a=>a.key===s);return i?(o.value=o.variant=i.key,Ue(o,i.payload,e)):void 0}if(s===!0)return Ue(o,t.type==="json"?t.payload:void 0,e)}function Ue(t,e,n){let r=n.payload_patch===void 0||n.payload_patch===null?e:Ne(e,n.payload_patch);return r!==void 0&&(t.payload=r),t}function Ns(t,e){return!t.app_contexts?.length||!e.app_contexts?.length?!0:t.app_contexts.some(n=>e.app_contexts?.includes(n))}function jn(t,e,n={}){if(!Ns(t,e))return q("app_context_excluded");if(!t.active)return q("inactive");if(t.kill_switch)return q("kill_switch");let r=!1;for(let c of t.prerequisites??[]){let l=n[c.flag];if(!l)return q("prerequisite_missing");if(l.reason==="requires_server")r=!0;else if(l.reason==="prerequisite_cycle"||!Fs(l.value,c.value))return q("prerequisite_failed")}if(r)return q("requires_server");let s=Mn(t,e),o=t.conditions.some(c=>c.aggregation);if(!s&&(!o||t.holdout||t.namespace))return q("no_bucketing_key");if(t.holdout&&ye("holdout",t.holdout.salt,s??"")*100<t.holdout.percentage)return q("holdout");if(t.namespace&&t.namespace.total>0){let c=Math.floor(ye("namespace",t.namespace.salt,s??"")*t.namespace.total);if(c<t.namespace.start||c>=t.namespace.end)return q("namespace_excluded")}let i=0,a=[];for(let[c,l]of t.conditions.entries()){let u=l.aggregation?Tn(l.aggregation,e):s;if(!u){i++;continue}let p=!1,h=!0,g=!1;for(let v of l.filters??[]){if(v.type==="event"){if(e.runtime_events===void 0)g=!0;else if(!xt(v,e.runtime_events)){h=!1;break}continue}let w=v.type==="cohort"?e.cohorts?.[v.key]:void 0;if(w!==void 0){if(w===(v.op==="not_in"||v.op==="neq")){h=!1;break}}else if(v.type==="cohort"||v.type==="flag"&&n[v.key]?.reason==="requires_server")p=!0;else if(!Ls(v,e,n)){h=!1;break}}if(!h)continue;if(p)return St(q("requires_server",c),a);let x=qs(t,l,c,e,u);if(x)if(g)a.push({filters:On(l.filters),result:x});else return St(x,a)}return St(q(i>0&&i===t.conditions.length?"no_bucketing_key":"no_condition_match"),a)}function qs(t,e,n,r,s){let o=e.aggregation?void 0:Hs(t,e,n,r);if(o)return o;if(ye(t.key,t.salt,s)*100>=e.rollout_pct)return t.early_exit?q("out_of_rollout",n):void 0;let i={value:!0,reason:"condition_match",condition_index:n};if(t.type==="multivariate"&&t.variants?.length){let a=Ds(t,e,s);return i.value=i.variant=a.key,Ue(i,a.payload,e)}return Ue(i,t.type==="json"?t.payload:void 0,e)}function Fn(t){return[...(t.prerequisites??[]).map(e=>e.flag),...t.conditions.flatMap(e=>(e.filters??[]).filter(n=>n.type==="flag").map(n=>n.key))]}function Ct(t,e){let n=new Map(t.map(i=>[i.key,i])),r={},s=new Map,o=i=>{let a=n.get(i);if(!a||s.has(i))return;s.set(i,1);let c=!1;for(let l of Fn(a))o(l),(s.get(l)===1||r[l]?.reason==="prerequisite_cycle")&&(c=!0);r[i]=c?q("prerequisite_cycle"):Us(a,e,r),s.set(i,2)};for(let i of t)o(i.key);return r}function Us(t,e,n){return qe(t,e,n,[],new Set)}function qe(t,e,n,r,s){let[o,...i]=r;if(o===void 0){let x=new Set,v=new Proxy(n,{get:(R,D)=>(x.add(String(D)),R[D])}),w=jn(t,e,v),C=[];for(let R of Fn(t))x.has(R)&&!s.has(R)&&!C.includes(R)&&n[R]?.runtime?.length&&C.push(R);return C.length?qe(t,e,n,C,new Set([...s,...C])):w}let a=qe(t,e,n,i,s),c=n[o],l=new Set([c.value]),u=[];for(let x of Ln(c)){if(l.has(x.value))continue;l.add(x.value);let v=qe(t,e,{...n,[o]:x},i,s);Dn(v,a)||u.push({filters:[{type:"flag",key:o,op:"eq",value:x.value}],result:v})}let p=[...u,...a.runtime??[]],{runtime:h,...g}=a;return p.length?{...g,runtime:p}:g}function Ln(t){return(t.runtime??[]).flatMap(e=>{let{runtime:n,...r}=e.result;return[r,...Ln(e.result)]})}function Dn(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t===null||e===null||Array.isArray(t)!==Array.isArray(e))return!1;let n=t,r=e,s=new Set([...Object.keys(n),...Object.keys(r)]);for(let o of s)if(!Dn(n[o],r[o]))return!1;return!0}var Ts,js,q,St,Rt,Et,Hn=E(()=>{"use strict";vt();wt();vn();Ts=["user","device","org"],js=16**13;q=(t,e=-1)=>({value:!1,reason:t,condition_index:e});St=(t,e)=>e.length?{...t,runtime:e}:t;Rt=t=>t.reason==="requires_server",Et=t=>t.reason!=="app_context_excluded"});function Pt(t){let e=Object.keys(t);if(e.length===0)return{};let n={};for(let r of e)n[`$feature/${r}`]=t[r];return n.$active_feature_flags=e.filter(r=>t[r]!==!1).sort(),n}var Nn=E(()=>{"use strict"});function be(t,e,n,r){return{key:t,value:e,enabled:e!==void 0&&e!==!1,...typeof e=="string"?{variant:e}:{},...n!==void 0?{payload:n}:{},reason:e===void 0?"not_found":r}}var ve,qn=E(()=>{"use strict";ve=class{constructor(e,n=Date.now){this.ttlMs=e;this.now=n}ttlMs;now;stamp;mark(e){return this.stamp={at:this.now(),id:e}}restore(e){typeof e?.at=="number"&&typeof e.id=="string"&&(this.stamp={at:e.at,id:e.id})}fresh(e){return!!this.ttlMs&&this.ttlMs>0&&!!this.stamp&&this.stamp.id===e&&this.now()-this.stamp.at<this.ttlMs}clear(){this.stamp=void 0}}});function Ys(t){let e=Ks;for(let n of Xs.encode(t))e=(e^BigInt(n))*zs&Gs;return e}function Vn(t){let e=(t.toLowerCase().match(/[\p{L}\p{N}]+/gu)??[]).filter(s=>ke(s).length>=2);if(!e.length)return;let n=new Array(64).fill(0);for(let s of e){let o=Ys(s);for(let i=0;i<64;i++)n[i]=(n[i]??0)+((o>>BigInt(i)&1n)===1n?1:-1)}let r=0n;for(let s=0;s<64;s++)(n[s]??0)>0&&(r|=1n<<BigInt(s));return r.toString(16).padStart(16,"0")}function Kn(t){let n=` ${t.toLowerCase().replace(/’/g,"'").replace(/[.,!?;:]/g," ").replace(/\s+/g," ").trim()} `,r=0;for(let o of Bn)n.includes(` ${o} `)&&(r++,n=n.split(` ${o} `).join(" "));let s=Wn.filter(o=>n.includes(` ${o} `)).length;return r>s?-1:s>r?1:0}function Js(t){let e=zn(t);if(e.length<13||e.length>19)return!1;let n=0;return e.reverse().forEach((r,s)=>n+=s%2===1?r>4?r*2-9:r*2:r),n%10===0}function Zs(t){let e=zn(t).length;return e>=10&&e<=15}function At(t){let e=t;for(let[n,r]of Qs)e=e.replace(n,s=>r(s)?eo(s):s);return e===t?void 0:e}function Gn(t){if(typeof t!="string")return;let e=t.toLowerCase();return/^[0-9a-f]{32}$/.test(e)?e:void 0}function to(t,e,n){let r=Ot(e,n),s=At(r);return s===void 0?{[t]:r}:{[t]:s,$ai_text_redacted:!0}}function Yn(t,e,n,r){if(t!=="user"&&t!=="assistant")return;let s={$ai_role:t,$ai_message_index:n,$ai_text_length:ke(e).length};if(t==="user"){let o=Vn(e);o!==void 0&&(s.$ai_text_hash=o),s.$ai_sentiment=Kn(e)}return r?{...s,...to("$ai_text",e,Ws)}:s}function Jn(t,e){let n=t.value;if(t.kind==="thumbs"&&n!==1&&n!==-1||t.kind==="rating"&&!(Number.isInteger(n)&&n>=1&&n<=5)||t.kind!=="thumbs"&&t.kind!=="rating"&&t.kind!=="comment")return;let r={$ai_feedback_kind:t.kind};if(t.kind!=="comment"&&(r.$ai_feedback_value=n),t.comment&&e){let s=Ot(t.comment,Vs);r.$ai_feedback_comment=At(s)??s}return t.messageIndex!==void 0&&(r.$ai_message_index=t.messageIndex),r}function $t(t,e){let n=Xn(t),r=_e(e,64);return{...n?{$ai_outcome:n}:{},...r?{$ai_resolution:r}:{}}}function no(){let t=globalThis.crypto,e=new Uint8Array(16);if(t?.getRandomValues)t.getRandomValues(e);else for(let r=0;r<16;r++)e[r]=Math.floor(Math.random()*256);e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;let n=Array.from(e,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function Qn(t={}){let e={$ai_conversation_id:t.conversationId||no()},n=(r,s)=>{s!==void 0&&(e[r]=s)};return n("$ai_agent_name",_e(t.agentName,128)),n("$ai_agent_version",_e(t.agentVersion,64)),n("$ai_topic",_e(t.topic,128)),n("$ai_use_case",_e(t.useCase,128)),n("$ai_trace_id",Gn(t.traceId)),e}var ae,Bs,Ws,Vs,Bn,Wn,ke,Ot,Ks,zs,Gs,Xs,zn,Un,Qs,eo,Xn,_e,xe,Zn=E(()=>{"use strict";ae={started:"$ai_conversation_started",message:"$ai_message",feedback:"$ai_feedback",ended:"$ai_conversation_ended",outcome:"$ai_outcome"},Bs=["resolved","unresolved","escalated","abandoned","error"],Ws=4e3,Vs=2e3,Bn=["wrong","useless","not helpful","unhelpful","doesn't work","does not work","didn't help","did not help","not what i asked","that's not it","stupid","terrible","awful","frustrating","frustrated","annoying","worst","hate","incorrect","nonsense","confusing","makes no sense","real person","human agent","talk to a human","speak to a human","wtf","ugh"],Wn=["thanks","thank you","great","perfect","awesome","helpful","that worked","works now","solved","exactly"],ke=t=>Array.from(t),Ot=(t,e)=>ke(t).slice(0,e).join(""),Ks=0xcbf29ce484222325n,zs=0x100000001b3n,Gs=0xffffffffffffffffn,Xs=new TextEncoder;zn=t=>ke(t).filter(e=>e>="0"&&e<="9").map(Number);Un=String.raw`[\p{Alphabetic}\p{M}\p{Nd}\p{Pc}\p{Join_Control}]`,Qs=[[new RegExp(String.raw`(?<!${Un})\p{Nd}(?:[ -]?\p{Nd}){12,18}(?!${Un})`,"gu"),Js],[/[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}/g,()=>!0],[/\+?\p{Nd}[\p{Nd}\s().-]{7,}\p{Nd}/gu,Zs]];eo=t=>ke(t).map(e=>/\s/u.test(e)?e:"*").join("");Xn=t=>typeof t=="string"&&Bs.includes(t)?t:void 0,_e=(t,e)=>typeof t=="string"&&t?Ot(t,e):void 0;xe=class{next=0;common;emit;captureText;constructor(e,n={},r=!1){this.emit=e,this.captureText=r,this.common=Qn(n)}get id(){return this.common.$ai_conversation_id}send(e,n){this.emit(e,{...this.common,...n})}start(){return this.send(ae.started,{}),this}message(e,n,r={}){let s=r.index??this.next,o=Yn(e,n,s,this.captureText);return o?(this.next=s+1,this.send(ae.message,o),!0):!1}feedback(e){let n=Jn(e,this.captureText);return n?(this.send(ae.feedback,n),!0):!1}end(e,n){this.send(ae.ended,$t(e,n))}outcome(e,n){let r=$t(e,n);return r.$ai_outcome?(this.send(ae.outcome,r),!0):!1}}});var Be=E(()=>{"use strict";fn();at();gn();mn();hn();Hn();wt();Nn();qn();Zn()});function nr(t,e=90,n=Date.now){let r,s=()=>{try{return JSON.parse(t.get(tr)??"{}")}catch{return{}}};return()=>{let o=s();if(location.search!==r){r=location.search;let a=new URLSearchParams(r),c=!1;for(let l of X){let u=a.get(l);u&&(o[l]={v:u.slice(0,512),t:n()},c=!0)}c&&t.set(tr,JSON.stringify(o))}let i={};for(let a of X){let c=o[a];c&&n()-c.t<e*864e5&&(i[a]=c.v)}return i}}var X,tr,we=E(()=>{"use strict";X=["gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","igshid","msclkid","ttclid","li_fat_id","twclid","mc_cid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],tr="lc_click_ids"});function mo(t){let e={},n=new URLSearchParams(location.search);for(let r of[...re,...X,...t]){let s=n.get(r);s&&(e[`$${r}`]=s)}return e}function ur(){let t=new URLSearchParams(location.search),e=re.map(n=>t.get(n)??"");return e.some(Boolean)?e.join("|"):void 0}function ho(t){try{return t?new URL(t).hostname:""}catch{return""}}function vo(){let t=location.hash;return t.length>1?location.pathname+t.split("?")[0]:location.pathname}function dr(t,e,n=[],r=!1){let s={$current_url:yo(),$host:location.host,$pathname:r?vo():location.pathname,$referrer:document.referrer,$title:document.title,$screen_width:screen.width,$screen_height:screen.height,$viewport_width:window.innerWidth,$viewport_height:window.innerHeight,$browser_language:navigator.language,$timezone:Intl.DateTimeFormat().resolvedOptions().timeZone};if(navigator.maxTouchPoints>1&&(s.$touch_points=navigator.maxTouchPoints),t!=="$pageview")return{properties:s};let o=mo(n);Object.assign(s,o);let i=e.$current_url??location.href,a=e.$referrer??document.referrer,c={$initial_referrer:a||"$direct",$initial_referring_domain:ho(a)||"$direct",$initial_current_url:i};for(let[l,u]of Object.entries(o))c[`$initial_${l.slice(1)}`]=u;return{properties:s,$set_once:c}}var re,yo,Ve=E(()=>{"use strict";we();re=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];yo=()=>location.href.replace(/([?&])__lc_toolbar=[^&#]*&?/,"$1").replace(/[?&]$/,"")});function mr(t,e=Date.now){let n=t.eventsPerSecond??10,r=t.burst??100,s=r,o=e();return()=>{let i=e();return s=Math.min(r,s+(i-o)/1e3*n),o=i,s<1?!1:(s-=1,!0)}}var hr=E(()=>{"use strict"});function wo(t,e){let n=t,r=[...xo,...e.maskParams??[],...e.maskCampaignParams?[...re,...X]:[]];if(r.length){let s=n.indexOf("#"),o=s<0?n:n.slice(0,s),i=s<0?"":n.slice(s);n=o.replace(new RegExp(`([?&])(${r.map(yr).join("|")})=[^&]*`,"gi"),`$1$2=${Mt}`)+i}return e.stripHash&&(n=n.replace(/#.*$/,"")),n}function vr(t){let e=new RegExp(`^\\$(initial_|last_)?(${[...re,...X].map(yr).join("|")})$`),n=r=>{let s;if(t.maskCampaignParams)for(let[o,i]of Object.entries(r))typeof i=="string"&&e.test(o)?(s??={...r})[o]=Mt:o==="$click_ids"&&i&&typeof i=="object"&&((s??={...r})[o]=Object.fromEntries(Object.keys(i).map(a=>[a,Mt])));for(let o of ko){let i=(s??r)[o];if(typeof i!="string")continue;let a=wo(i,t);a!==i&&((s??={...r})[o]=a)}return s??r};return r=>({...r,properties:n(r.properties),...r.$set?{$set:n(r.$set)}:{},...r.$set_once?{$set_once:n(r.$set_once)}:{}})}var Mt,xo,ko,yr,br=E(()=>{"use strict";we();Ve();Mt="<masked>",xo=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","api_key","apikey","key","auth","authorization","code","otp","email","ssn"],ko=["$current_url","$referrer","$initial_referrer","$initial_current_url","$last_current_url"],yr=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});function mi(t){return t.startsWith("re:")?t.slice(3):t.split("*").map(e=>e.replace(/[.+?^${}()|[\]\\]/g,"\\$&")).join(".*")}function zt(t,e){return!!t?.some(n=>{try{return new RegExp(mi(n),"i").test(e)}catch{return!1}})}var qr=E(()=>{"use strict"});Be();var ro=["bot","crawl","spider","slurp","headlesschrome","phantomjs","puppeteer","playwright","lighthouse","pingdom","uptimerobot","facebookexternalhit","preview","scrapy","python-requests","go-http-client","cypress","lightpanda","hubspot","nessus","prerender","deepscan","screaming frog","sitebulb","turnitin","ia_archiver","chatgpt-user","app.hypefactors.com","google favicon","google web preview","-google","googleother","googleweblight","google-read-aloud","google-inspectiontool","google-hoteladsverifier","google-cloudvertexbot"];function er(t,e=[]){let n=t.toLowerCase();return e.some(r=>r&&n.includes(r.toLowerCase()))?!0:ro.some(r=>n.includes(r))&&!/\bcubot\b/.test(n)}we();function so(){return Array.from(document.querySelectorAll("meta[http-equiv]")).filter(t=>t.getAttribute("http-equiv")?.toLowerCase()==="content-security-policy").map(t=>t.getAttribute("content")??"")}function oo(t){let e=new Map;for(let r of t.split(";")){let[s,...o]=r.trim().toLowerCase().split(/\s+/);s&&!e.has(s)&&e.set(s,o)}let n=e.get("style-src-elem")??e.get("style-src")??e.get("default-src");return!!n&&!(n.includes("'unsafe-inline'")&&!n.some(r=>r.startsWith("'nonce-")||r.startsWith("'sha")))}function sr(t,e){if(typeof document>"u")return()=>{};!e&&so().some(oo)&&t("CSP hint: this page's Content-Security-Policy blocks inline <style>; set the `nonce` option so guides and the experiment veil render (docs/guides/csp.md)");let n=r=>{let s=r;/^style-src/.test(s.effectiveDirective??"")&&s.blockedURI==="inline"&&t(`CSP hint: an inline style was blocked by ${s.effectiveDirective}${e?" (check that `nonce` matches the page's nonce)":"; set the `nonce` option"}`)};return document.addEventListener("securitypolicyviolation",n),()=>document.removeEventListener("securitypolicyviolation",n)}var io=(t,e)=>t.slice(0,e);function rr(t){try{let e=new URL(t);return e.protocol==="data:"||e.protocol==="blob:"?e.protocol:e.origin+e.pathname}catch{return io(t,64)}}function or(t,e={}){if(typeof document>"u")return()=>{};let n=e.maxPerPage??20,r=new Set,s=o=>{let i=o,a={$csp_directive:i.effectiveDirective??i.violatedDirective,$csp_blocked_uri:rr(i.blockedURI??""),$csp_source_file:i.sourceFile?rr(i.sourceFile):void 0,$csp_line:i.lineNumber||void 0,$csp_column:i.columnNumber||void 0,$csp_disposition:i.disposition},c=[a.$csp_directive,a.$csp_blocked_uri,a.$csp_source_file,a.$csp_line].join("|");r.has(c)||r.size>=n||(r.add(c),t("$csp_violation",Object.fromEntries(Object.entries(a).filter(([,l])=>l!==void 0))))};return document.addEventListener("securitypolicyviolation",s),()=>document.removeEventListener("securitypolicyviolation",s)}var ao=["chrome-extension:","moz-extension:","safari-web-extension:","ms-browser-extension:"],We=()=>typeof location<"u"&&ao.includes(location.protocol),ir=(t,e,n)=>`${t.replace(/\/+$/,"")}/static/v${e}/${n}`,co={replay:"replay",heatmaps:"heatmaps",forms:"forms",toolbar:"toolbar",guides:"guides",inspector:"inspector",experiments:"visualChanges","early-access":"earlyAccess",consent:"consentModule"},lo=t=>import(t);async function uo(t,e,n=globalThis.fetch){try{let r=await n(ir(t,e,"manifest.json"),{credentials:"omit"});if(!r.ok)return;let s=await r.json();return s&&typeof s.files=="object"&&s.files?s:void 0}catch{return}}async function po(t){let e=new Uint8Array(await crypto.subtle.digest("SHA-384",t));return`sha384-${btoa(String.fromCharCode(...e))}`}async function ar(t,e,n,r=lo,s=globalThis.fetch){let o=t.length?await uo(e.assetHost,e.version,s):void 0;return(await Promise.all(t.map(async a=>{let c=co[a];if(!c)return n("unknown module",a);let l=ir(e.assetHost,e.version,`${a}.js`);try{if(o){let p=o.files[`modules/${a}.js`],h=p?await s(l,{credentials:"omit",cache:"force-cache"}):void 0;if(!h?.ok||await po(await h.arrayBuffer())!==p)return n("module refused, it does not match the manifest",a)}let u=(await r(l))[c];return typeof u=="function"?u:n("module has no export",a,c)}catch(u){return n("module failed to load",a,u)}}))).filter(a=>!!a)}function fo(t,e,n){let r=e.find(i=>t.startsWith(`${i}/`));if(!r)return t;let s=t.slice(r.length),o=s.search(/[?#]/);return r+n(o<0?s:s.slice(0,o))+(o<0?"":s.slice(o))}function cr(t,e,n,r){if(!r)return{transport:t,fetch:e};let s=o=>fo(o,n,r);return{transport:{send:(o,i,a)=>t.send(s(o),i,a)},fetch:((o,i)=>e(typeof o=="string"?s(o):o instanceof URL?s(o.href):o,i))}}var go="__LUCIDA_DEVTOOLS_HOOK__";function lr(t,e,n){let r=globalThis[go];if(!(!r||typeof r.emit!="function"||typeof r.attach!="function")){t.onCapture(s=>{try{r.emit(s)}catch{}});try{r.attach({projectKeyPrefix:t.apiKey.slice(0,8),apiHost:n,distinctId:()=>e.distinctId,loadToolbar:s=>e.loadToolbar(s),startReplay:async()=>t.replay?(await t.replay.start(!0),t.replay.isRecording()):!1,replayUrl:()=>e.getReplayUrl()})}catch{}}}Ve();var It="_lcid";var pr=(t,e)=>e.some(n=>{let r=n.replace(/^\./,"").toLowerCase();return t.toLowerCase()===r||t.toLowerCase().endsWith(`.${r}`)}),bo=(t,e=Date.now(),n)=>`${t}.${e.toString(36)}${n?`_${n}`:""}`;function _o(t,e=Date.now()){let n=t.lastIndexOf("."),[r="",s]=t.slice(n+1).split("_",2),o=/^[0-9a-z]+$/.test(r)?parseInt(r,36):NaN,i=t.slice(0,n);if(n>0&&i.length<=200&&o<=e+5e3&&e-o<=12e4)return s&&/^[\w-]{1,64}$/.test(s)?{distinctId:i,sessionId:s}:{distinctId:i}}function fr(t){if(!t?.length)return;let e=new URL(location.href),n=e.searchParams.get(It);if(n!==null){e.searchParams.delete(It),history.replaceState(history.state,"",e.toString());try{if(document.referrer&&!pr(new URL(document.referrer).hostname,t))return}catch{return}return _o(n)}}var gr=t=>{let e=t.config.crossDomains;if(!e?.length)return;let n=r=>{let s=r.target instanceof Element?r.target.closest("a[href]"):null;if(!s||!t.core.hasConsent("analytics"))return;let o=s;if(!/^https?:$/.test(o.protocol)||o.host===location.host||!pr(o.hostname,e))return;let i=new URL(o.href);i.searchParams.set(It,bo(t.client.distinctId,Date.now(),t.core.sessionId)),o.href=i.toString()};return document.addEventListener("click",n,!0),document.addEventListener("auxclick",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("auxclick",n,!0)}};hr();br();function So(t,e,n){let r=e;for(let s of t)try{let o=s(r);if(o==null)return null;if(typeof o!="object"||typeof o.event!="string")return n("beforeSend hook returned a non-event, dropping:",typeof o),null;r=o}catch(o){return n("beforeSend hook threw, dropping event:",o),null}return r}function Co(t,e=Math.random){return n=>t>=1?n:t<=0||e()>=t?null:{...n,properties:{...n.properties,$sample_rate:t}}}function Ro(t){let e=new Set(t),n=r=>Object.fromEntries(Object.entries(r).filter(([s])=>!e.has(s)));return r=>({...r,properties:n(r.properties),...r.$set?{$set:n(r.$set)}:{},...r.$set_once?{$set_once:n(r.$set_once)}:{}})}var Tt="lc_person_identified",Ke="lc_pending_set_once",_r=new Set(["$identify","$create_alias","$groupidentify"]),xr="$$client_ingestion_warning",Eo=6e4,jt=class{constructor(e,n){this.mode=e;this.storage=n;this.identified=n.get(Tt)==="1";try{this.pending=JSON.parse(n.get(Ke)??"{}")}catch{this.pending={}}}mode;storage;identified;pending;get blocksPersonWrites(){return this.mode==="never"}get isProfile(){return this.mode==="always"||this.mode==="identified_only"&&this.identified}markIdentified(){this.mode!=="identified_only"||this.identified||(this.identified=!0,this.storage.set(Tt,"1"))}personless(e){return this.mode==="always"?!1:(this.mode==="never"||!this.identified)&&!_r.has(e)}stash(e){if(this.mode!=="identified_only"||!e)return;let n=Object.entries(e).filter(([r])=>!(r in this.pending));n.length&&(this.pending={...this.pending,...Object.fromEntries(n)},this.storage.set(Ke,JSON.stringify(this.pending)))}take(){if(!Object.keys(this.pending).length)return;let e=this.pending;return this.pending={},this.storage.remove(Ke),e}reset(){this.identified=!1,this.pending={},this.storage.remove(Tt),this.storage.remove(Ke)}};function Po(t,e){let n=e,r;if(t.person.personless(e.event)){t.person.stash(e.$set_once);let{$set:o,$set_once:i,$unset:a,...c}=e;n={...c,properties:{...e.properties,$process_person_profile:!1}}}else(r=t.person.take())&&(n={...e,$set_once:{...e.$set_once,...r}});let s=t.hooks.length?So(t.hooks,n,t.log):n;return s&&t.limit&&!t.limit()&&(t.log("rate limited, dropped",s.event),t.onLimited?.(),s=null),!s&&r&&t.person.stash(r),s}function $o(t){let e=t.beforeSend?Array.isArray(t.beforeSend)?t.beforeSend:[t.beforeSend]:[];return[vr(t.urlPrivacy??{}),...t.propertyDenylist?.length?[Ro(t.propertyDenylist)]:[],...t.sampleRate!==void 0?[Co(t.sampleRate)]:[],...e]}function kr(t,e,n,r=Date.now){let s=new jt(e.personProfiles??"always",t.storage),o,i,a=0,c=-1/0,l=()=>{a+=1,!(r()-c<Eo)&&(c=r(),queueMicrotask(()=>{let u=a;a=0,t.capture(xr,{$$client_ingestion_warning_message:`client rate limit dropped ${u} event(s)`,$dropped_count:u})}))};return t.setFilter(u=>(e.rateLimit!==o&&(o=e.rateLimit,i=o?mr(o):void 0),Po({hooks:$o(e),person:s,limit:u.event===xr?void 0:i,log:n,onLimited:l},u))),s}var Ft=class{m=new Map;get(e){return this.m.get(e)??null}set(e,n){this.m.set(e,n)}remove(e){this.m.delete(e)}},Oo=365,Ao=new Set("co.uk org.uk ac.uk gov.uk me.uk ltd.uk plc.uk net.uk com.au net.au org.au edu.au gov.au co.nz org.nz net.nz co.jp ne.jp or.jp ac.jp go.jp co.kr or.kr com.cn net.cn org.cn com.hk com.tw com.sg com.my co.in net.in org.in co.id co.th com.ph com.vn com.br net.br org.br com.ar com.mx com.co com.pe com.tr com.ua com.pl co.za co.il com.eg com.sa com.ng co.ke github.io gitlab.io vercel.app netlify.app herokuapp.com pages.dev workers.dev web.app firebaseapp.com azurewebsites.net cloudfront.net appspot.com onrender.com fly.dev glitch.me repl.co blogspot.com wordpress.com myshopify.com vercel.dev netlify.com surge.sh render.com railway.app koyeb.app deno.dev ngrok.io ngrok-free.app trycloudflare.com cloudfunctions.net run.app s3.amazonaws.com elasticbeanstalk.com azurestaticapps.net wixsite.com webflow.io framer.app bubbleapps.io".split(" ")),Io=new Set("co com net org edu gov gob go ac or ne ltd plc sch mil nom".split(" "));function Mo(t){let e=t.toLowerCase().split(".");for(let n=1;n<e.length-1;n++)if(Ao.has(e.slice(n).join("."))||n===e.length-2&&e[n+1].length===2&&Io.has(e[n]))return e.slice(n-1).join(".")}function To(t=location.hostname){if(/^[\d.]+$/.test(t)||t.includes(":"))return;let e=t.split(".");for(let n=e.length-2;n>=0;n--){let r=e.slice(n).join(".");if(document.cookie=`__lc_probe=1; Domain=${r}; Path=/; Max-Age=10; SameSite=Lax`,document.cookie.includes("__lc_probe=1"))return document.cookie=`__lc_probe=; Domain=${r}; Path=/; Max-Age=0`,r}return Mo(t)}var ze=class{constructor(e={}){this.o=e}o;domain=null;attr(){if(this.domain===null)try{this.domain=this.o.domain??(this.o.crossSubdomain?To():void 0)}catch{this.domain=void 0}return this.domain?`; Domain=${this.domain}`:""}held=new Map;read(e){try{for(let n of document.cookie.split("; ")){let r=n.indexOf("=");if(n.slice(0,r)===e)return decodeURIComponent(n.slice(r+1))}}catch{}return null}get(e){return this.read(e)??this.held.get(e)??null}set(e,n){let r=this.o.secure??location.protocol==="https:"?"; Secure":"",s=Math.round((this.o.expiryDays??Oo)*86400);try{document.cookie=`${e}=${encodeURIComponent(n)}; Max-Age=${s}; Path=/${this.attr()}; SameSite=Lax${r}`}catch{}this.read(e)===n?this.held.delete(e):this.held.set(e,n)}remove(e){this.held.delete(e);try{document.cookie=`${e}=; Max-Age=0; Path=/${this.attr()}; SameSite=Lax`}catch{}}},ce=class{constructor(e="localStorage"){this.kind=e}kind;store(){try{return globalThis[this.kind]}catch{return}}get(e){try{return this.store()?.getItem(e)??null}catch{return null}}set(e,n){try{this.store()?.setItem(e,n)}catch{}}remove(e){try{this.store()?.removeItem(e)}catch{}}},Lt=class extends ce{constructor(){super("localStorage")}},jo=["lc_identity","lc_session","lc_device_id","lc_consent","lc_person_identified"],Dt=class{constructor(e,n,r){this.cookie=e;this.local=n;this.cookieKeys=r}cookie;local;cookieKeys;get(e){let[n,r]=this.cookieKeys(e)?[this.cookie,this.local]:[this.local,this.cookie];return n.get(e)??r.get(e)}set(e,n){this.local.set(e,n),this.cookieKeys(e)?this.cookie.set(e,n):this.cookie.remove(e)}remove(e){this.local.remove(e),this.cookie.remove(e)}},Ge=class{constructor(e,n){this.inner=e;this.delayMs=n}inner;delayMs;pending=new Map;timer;get(e){return this.pending.has(e)?this.pending.get(e)??null:this.inner.get(e)}set(e,n){this.queue(e,n)}remove(e){this.queue(e,null)}queue(e,n){this.pending.set(e,n),this.timer??=setTimeout(()=>this.flush(),this.delayMs)}flush(){clearTimeout(this.timer),this.timer=void 0;for(let[e,n]of this.pending)n===null?this.inner.remove(e):this.inner.set(e,n);this.pending.clear()}},Ht=class{constructor(e,n){this.inner=e;this.suffix=n}inner;suffix;get(e){return this.inner.get(e+this.suffix)}set(e,n){this.inner.set(e+this.suffix,n)}remove(e){this.inner.remove(e+this.suffix)}},Xe=t=>`_${t.replace(/\W/g,"").slice(-8)}`;function Ye(t,e,n){if(t==="memory"||t==="none")return new Ft;let r=Xe(e),s=t==="cookie"?new ze(n):t==="localStorage+cookie"?new Dt(new ze(n),new Lt,o=>jo.some(i=>o===i+r)):new ce(t);return new Ht(s,r)}function wr(t,e,n){let r=Xe(e),s=new Set;try{for(let o of document.cookie.split("; "))s.add(o.split("=")[0]);for(let o of[globalThis.localStorage,globalThis.sessionStorage])for(let i=0;i<o.length;i++)s.add(o.key(i))}catch{}for(let o of s)if(!(!o.startsWith("lc_")||!o.endsWith(r)||o===n+r)){t.remove(o.slice(0,-r.length));try{localStorage.removeItem(o),sessionStorage.removeItem(o)}catch{}}}async function Fo(t){if(!(typeof CompressionStream>"u"||typeof Response>"u"))try{let e=new Response(t).body?.pipeThrough(new CompressionStream("gzip"));return e?new Uint8Array(await new Response(e).arrayBuffer()):void 0}catch{return}}function Sr(t,e={}){let n=e.compress??!0,r=(s,o)=>(e.onError?.({url:s,status:o}),{status:o});return{async send(s,o,i){if(i?.beacon&&!e.disableBeacon&&typeof navigator<"u"&&navigator.sendBeacon)return navigator.sendBeacon(s,new Blob([o],{type:"text/plain"}))?{status:200}:r(s,0);try{let a=n&&o.length>=1024?await Fo(o):void 0,c=await t(a?`${s}${s.includes("?")?"&":"?"}compression=gzip`:s,{method:"POST",body:a??o,headers:{...e.headers,"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",keepalive:(a?.length??o.length)<6e4});return c.status>=400?r(s,c.status):{status:c.status}}catch{return r(s,0)}}}}var Nt={send:async()=>({status:200})};var Lo="lucida-browser",Bt="0.1.5",qt="lc_internal",Do=3e3,Je="https://capture.lucidace.com",Ut=t=>!!t&&typeof t=="object"&&Object.getPrototypeOf(t)===Object.prototype;function Cr(t,e={},n=[]){let r=!!e.debug||typeof location<"u"&&/[?&]__(lc|lucida)_debug=(1|true)/.test(location.search),s=(...d)=>{r&&console.debug("[lucida]",...d)},o=(e.apiHost??Je).replace(/\/+$/,""),i=Object.fromEntries(Object.entries(e).map(([d,m])=>[d,Ut(m)?{...m}:m]));i.apiHost=o;let a=e.extension??We(),c=d=>a&&(d==="cookie"||d==="localStorage+cookie")?e.extensionPersistence??"localStorage":d,l=c(e.cookieless==="always"?"none":e.persistence??"cookie"),u=[o,...e.flagsApiHost?[e.flagsApiHost.replace(/\/+$/,"")]:[]],p=e.fetch??((...d)=>fetch(...d)),h=d=>cr(d,p,u,e.rewritePath),g=h(Nt).fetch,x=e.consent?.respectDnt,v=navigator.globalPrivacyControl===!0,w=(e.respectDnt??x)===!0&&navigator.doNotTrack==="1"||(e.respectGpc??x)===!0&&v,C=e.blockBots!==!1&&typeof navigator<"u"&&er(navigator.userAgent??"",e.blockedUserAgents),R=!!e.disabled||C;C&&s("bot user agent: capture disabled");let D,Q=h(e.transport??Sr(p,{headers:i.requestHeaders,onError:e.onRequestError,disableBeacon:e.disableBeacon})).transport;if(!e.transport&&e.offlineQueue!==!1&&l!=="memory"&&l!=="none"){let d=new te(new ce(l==="sessionStorage"?"sessionStorage":"localStorage"),()=>y.hasConsent("analytics"));Q=D=ft(Q,d,{key:`lc_offline${Xe(t)}`,isOnline:()=>navigator.onLine!==!1})}let j=R?void 0:fr(e.crossDomains),$=Ye(R?"memory":l,t,e.cookie),F=(e.storageWriteDelayMs??0)>0?new Ge($,e.storageWriteDelayMs):void 0,A=j?.sessionId??e.bootstrap?.sessionId,U,I=!1,N,T=[],y=new me({apiKey:t,apiHost:o,transport:R?Nt:Q,storage:F??$,...e.consentPersistence&&!R?{consentStorage:Ye(c(e.consentPersistence),t,e.cookie)}:{},persistProperty:d=>!i.persistedProperties||i.persistedProperties.includes(d),...l==="none"?{cookieless:!0}:{},library:{name:Lo,version:Bt},consent:{...e.cookieless==="on_reject"?{cookielessOnReject:!0}:{},...e.consent,...!R&&(e.consent?.geo||e.consent?.mode!=="opt_in")?{awaitRemote:!0}:{},respectDnt:!0,dnt:w},queue:{...e.flushAt?{flushAt:e.flushAt}:{},...e.flushIntervalMs?{flushIntervalMs:e.flushIntervalMs}:{}},...j||e.bootstrap?.distinctId?{bootstrapDistinctId:j?.distinctId??e.bootstrap?.distinctId}:{},...e.bootstrap?.isIdentified&&!j?{bootstrapIdentified:!0}:{},session:{...e.session,...A?{bootstrapId:A}:{}},enrich:(d,m)=>{let b=dr(d,m,i.customCampaignParams,e.capturePageview==="hash");if(o!==Je&&(b.properties={...b.properties,$lib_custom_api_host:o}),T.length){let _=y.sessionId;for(let S of T)b.properties={...b.properties,...S(_)}}let O=N?.()??{},f=Object.keys(O);return f.length&&(b.properties={...b.properties,$click_ids:O},d==="$pageview"&&(b.$set_once={...Object.fromEntries(f.map(_=>[`$initial_${_}`,O[_]])),...b.$set_once},b.$set=Object.fromEntries(f.map(_=>[`$last_${_}`,O[_]])))),i.sendFeatureFlags!==!1&&d!=="$snapshot"&&U&&(b.properties={...Pt(U.all()),...b.properties}),I?{...b,properties:{...b.properties,$internal:!0}}:b},campaignKey:ur,log:s});I=y.storage.get(qt)==="1",e.clickIds!==!1&&(N=nr(y.storage,e.clickIds?.expiryDays));let L=kr(y,i,s);e.bootstrap?.isIdentified&&L.markIdentified();let Z=d=>L.blocksPersonWrites?(s(`personProfiles=never: ${d} ignored`),!0):!1;R||y.onChange(d=>{d!=="consent"||y.hasConsent("analytics")||y.consentStatus()!=="denied"||(F?.flush(),wr($,t,e.consent?.storageKey||Pe))});let le=[],B=[sr(s,e.nonce)],ue=y.storage;if(e.flagPersistence&&!R){let d=new te(Ye(c(e.flagPersistence),t,e.cookie),()=>y.hasConsent("analytics"));y.onChange(m=>{m==="consent"&&(y.hasConsent("analytics")?d.flushBuffered():d.discardBuffered())}),ue=d}let se=d=>{if(R)return;if(y.hasConsent("analytics"))return d();let m=!1;y.onChange(b=>{!m&&b==="consent"&&y.hasConsent("analytics")&&(m=!0,d())})},de,k={core:y,client:void 0,config:i,flagStorage:ue,apiKey:t,log:s,fetch:g,onUnload:d=>{le.push(d)},whenConsented:se,onCapture:d=>y.onCaptured(d),eventExtras:T,clickExtras:[],flagPersonProps:[],loadConfig:()=>de??=new Promise(d=>se(()=>{g(`${o}/v1/config?api_key=${encodeURIComponent(t)}`).then(m=>m.ok?m.json():null).then(m=>(m&&y.applyRemote(m),m)).then(d,()=>d(null))}))},pe=Promise.resolve();if(y.consent.resolving){let d=!1,m=g(`${o}/v1/config?api_key=${encodeURIComponent(t)}`,{credentials:"omit"}).then(b=>(d=b.status>=500,b.ok?b.json():null)).catch(()=>(d=!0,null));de=m,pe=new Promise(b=>{let O=setTimeout(()=>(y.resolveConsent("opt_in"),b()),Do);m.then(f=>{clearTimeout(O),f?y.applyRemote(f):d?y.resolveConsent("opt_in"):y.applyRemote({}),b()})})}let fe=pt(y,{apiHost:o,apiKey:t,fetch:g,whenConsented:se,log:s,disabled:R});B.push(()=>fe.stop());let W={get distinctId(){return y.distinctId},capture:(d,m,b)=>{y.capture(d,m,b?.timestamp!==void 0?{timestamp:b.timestamp}:{})&&(b?.sendInstantly||b?.transport)&&y.flush(b.transport==="beacon"?{beacon:!0}:{})},identify:(d,m,b)=>{Z("identify")||(L.markIdentified(),y.identify(d,m,b))},alias:(d,m)=>{Z("alias")||(L.markIdentified(),y.alias(d,m))},reset:d=>{y.reset({resetDeviceId:!!d,reuseAnonymousId:!!e.reuseAnonymousId}),L.reset()},createPersonProfile:()=>{Z("createPersonProfile")||L.isProfile||(L.markIdentified(),y.capture("$set",{}))},setConfig:d=>{let m=i;for(let[b,O]of Object.entries(d)){let f=m[b];Ut(f)&&Ut(O)?Object.assign(f,O):m[b]=O}"debug"in d&&(r=!!d.debug)},setPersonProperties:(d,m)=>{!d&&!m||Z("setPersonProperties")||(L.markIdentified(),y.capture("$set",{},{...d?{$set:d}:{},...m?{$set_once:m}:{}}))},unsetPersonProperties:d=>{!d.length||Z("unsetPersonProperties")||(L.markIdentified(),y.capture("$set",{},{$unset:d}))},getSessionId:()=>y.sessionId,onSessionId:d=>y.onSessionId(m=>d(m)),getProperty:d=>y.getProperty(d),hasOptedOut:()=>!y.hasConsent("analytics"),getReplayUrl:d=>{let b=`${(e.uiHost??o).replace(/\/+$/,"")}/replays/${encodeURIComponent(y.sessionId)}`,O=y.sessionStart;return!d?.withTimestamp||O===void 0?b:`${b}?t=${Math.max(0,Math.round((Date.now()-O)/1e3-(d.timestampLookBackSeconds??10)))}`},debug:(d=!0)=>{r=d},featureView:(d,m)=>{y.capture("$feature_view",{...m,$feature_flag:d},{$set:{[`$feature_view/${d}`]:!0}})},featureInteraction:(d,m)=>{y.capture("$feature_interaction",{...m,$feature_flag:d},{$set:{[`$feature_interaction/${d}`]:!0}})},updateFlags:(d,m,b)=>k.flags?.update(d,m,b?.merge??!0),register:d=>y.register(d),registerOnce:d=>y.registerOnce(d),unregister:d=>y.unregister(d),group:(d,m,b)=>{L.markIdentified(),y.group(d,m,b)},optIn:(d=["analytics","replay"])=>y.setConsent({analytics:d.includes("analytics"),replay:d.includes("replay"),marketing:d.includes("marketing")}),optOut:()=>y.optOut(),optOutInternal:(d=!0)=>{I=d,d?y.storage.set(qt,"1"):y.storage.remove(qt)},get isInternal(){return I},setConsent:d=>y.setConsent(d),getConsent:()=>y.getConsent(),getConsentStatus:d=>y.getConsentStatus(d),consentStatus:()=>y.consentStatus(),getFlag:d=>k.flags?.get(d),getFlagPayload:d=>k.flags?.payload(d),getFlagResult:(d,m)=>k.flags?.result(d,m)??be(d,void 0,void 0,"not_found"),getLayerParam:(d,m,b)=>k.flags?.layerParam(d,m)??b,isFeatureEnabled:d=>{let m=k.flags?.get(d);return m!==void 0&&m!==!1},onFlags:d=>k.flags?.onChange(d)??(()=>{}),onIntervention:d=>fe.on(d),reloadFlags:()=>k.flags?.reload()??Promise.resolve(),getAllFlags:()=>k.flags?.all()??{},overrideFlags:(d,m)=>k.flags?.override(d,m),setPersonPropertiesForFlags:(d,m)=>k.flags?.setPersonProperties(d,m),resetPersonPropertiesForFlags:()=>k.flags?.resetPersonProperties(),setGroupPropertiesForFlags:(d,m)=>k.flags?.setGroupProperties(d,m),resetGroupPropertiesForFlags:()=>k.flags?.resetGroupProperties(),setContext:(d,m,b)=>k.flags?.setContext(d,m,b),clearContext:d=>k.flags?.clearContext(d),guides:{showChangelog:()=>k.guides?.showChangelog()??0,show:d=>k.guides?.show(d)??!1,reset:d=>k.guides?.reset(d)},ai:{startConversation:d=>new xe((m,b)=>W.capture(m,b),d,i.ai?.captureText===!0).start()},earlyAccess:{list:()=>k.earlyAccess?.list()??Promise.resolve([]),optIn:d=>k.earlyAccess?.optIn(d),optOut:d=>k.earlyAccess?.optOut(d)},replay:{start:d=>k.replay?.start(d)??Promise.resolve(),stop:()=>k.replay?.stop(),pause:()=>k.replay?.pause(),resume:()=>k.replay?.resume(),tag:d=>k.replay?.tag(d),isRecording:()=>k.replay?.isRecording()??!1},consent:{showBanner:d=>k.consentUi?.showBanner(d)??Promise.resolve(null),hideBanner:()=>k.consentUi?.hideBanner()},loadToolbar:d=>k.toolbar?.load(typeof d=="string"?d:d.token)??Promise.resolve(!1),activateExperiment:d=>k.experiments?.activate(d),recommendations:(d,m)=>k.recs?.get(d,m)??Promise.resolve({placement:d,strategy:"",items:[],shown(){},clicked(){}}),flush:()=>pe.then(()=>y.flush()),shutdown:async()=>{for(let d of B)d();F?.flush(),await y.shutdown()}};if(k.client=W,!R){let d=()=>{for(let b of le)b();F?.flush(),y.flush({beacon:!0})};window.addEventListener("pagehide",d);let m=()=>{document.visibilityState==="hidden"&&y.flush({beacon:!0})};if(document.addEventListener("visibilitychange",m),B.push(()=>{window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",m)}),D){let b=()=>{D.drain()};window.addEventListener("online",b),B.push(()=>window.removeEventListener("online",b)),se(b)}if(e.captureCspViolations){let b=typeof e.captureCspViolations=="object"?e.captureCspViolations:{};B.push(or((O,f)=>{y.capture(O,f)},b))}for(let b of n){let O=b(k);O&&B.push(O)}U=k.flags,n.length||k.loadConfig(),lr(k,W,o)}return s("initialised",{apiHost:o,consent:y.getConsent()}),W}var Ho='[data-lc-region="article"]';function Rr(t,e,n){if(e.articles===!1)return()=>{};let r;t.loadConfig().then(v=>{typeof v?.article_selector=="string"&&(r=v.article_selector)});let s=()=>{for(let v of[e.articleSelector,r,Ho])if(v)try{let w=document.querySelector(v);if(w)return w}catch{}return null},o=location.href,i=location.pathname,a=null,c=0,l=!1,u=()=>{if(a??=s(),!a)return;let v=a.getBoundingClientRect();if(v.height<=0)return;let w=Math.round(Math.min(100,Math.max(0,(window.innerHeight-v.top)/v.height*100)));c=Math.max(c,w);let C=a.querySelector("h1,h2");C&&C.getBoundingClientRect().bottom<0&&(l=!0)},p=()=>{!a||!n()||(u(),t.client.capture("$article_read",{$article_id:(a.getAttribute("data-lc-article-id")??"").trim().slice(0,200)||i,$article_depth:c,$article_finished:c>=90,$article_headline_exit:!l&&c<25}),a=null)},h=()=>{p(),a=null,c=0,l=!1,o=location.href,i=location.pathname},g=()=>location.href!==o?h():u(),x=new MutationObserver(g);return x.observe(document.documentElement,{childList:!0,subtree:!0}),window.addEventListener("scroll",g,{passive:!0}),t.onUnload(p),u(),()=>{x.disconnect(),window.removeEventListener("scroll",g)}}var Qe="data-lc-content",No="data-lc-content-piece",qo="data-lc-content-target";var Wt=(t,e)=>(t.getAttribute(e)??"").trim().slice(0,200);function Er(t,e,n){if(e.contentBlocks===!1||typeof IntersectionObserver>"u")return()=>{};let r=new WeakSet,s=u=>{let p={$content_name:Wt(u,Qe)},h=Wt(u,No),g=Wt(u,qo);return h&&(p.$content_piece=h),g&&(p.$content_target=g),p},o=location.href,i=new IntersectionObserver(u=>{for(let p of u)!p.isIntersecting||r.has(p.target)||!n()||(r.add(p.target),t.client.capture("$content_impression",s(p.target)))},{threshold:.5}),a=u=>u.querySelectorAll(`[${Qe}]`).forEach(p=>i.observe(p));a(document);let c=new MutationObserver(()=>{location.href!==o&&(o=location.href,i.disconnect(),document.querySelectorAll(`[${Qe}]`).forEach(u=>r.delete(u))),a(document)});c.observe(document.documentElement,{childList:!0,subtree:!0});let l=u=>{let p=u.target?.closest?.(`[${Qe}]`);p&&n()&&t.client.capture("$content_interaction",{...s(p),$content_interaction_type:"click"})};return document.addEventListener("click",l,!0),()=>{i.disconnect(),c.disconnect(),document.removeEventListener("click",l,!0)}}var Uo=new Set(["input","textarea","select","option"]),Bo=["name","type","role","aria-label","title","alt","placeholder"],Wo=/(?:\d[ -]?){9,}/;function Vo(t){if(Uo.has(t.tagName.toLowerCase())||t.isContentEditable)return;let e="";for(let n of Array.from(t.childNodes))n.nodeType===3&&(e+=n.textContent??"");if(e=e.replace(/\s+/g," ").trim(),!(!e||Wo.test(e)))return e.slice(0,255)}function Pr(t){if(!t?.length)return()=>!1;let e=t.map(n=>n.toLowerCase());return n=>e.some(r=>r.endsWith("*")?n.startsWith(r.slice(0,-1)):n===r)}var Ko="***";function et(t){let e={};for(let n=t,r=0;n&&r<10;n=n.parentElement,r++)for(let s of Array.from(n.attributes)){let o=s.name.startsWith("data-lc-attr-")?s.name.slice(13):"";o&&!(o in e)&&!o.startsWith("$")&&(e[o]=s.value.slice(0,255))}return e}function zo(t,e,n,r){let s=t.parentElement,o=s?Array.from(s.children):[t],i={tag_name:t.tagName.toLowerCase(),nth_child:o.indexOf(t)+1,nth_of_type:o.filter(u=>u.tagName===t.tagName).indexOf(t)+1},a=(t.getAttribute("class")??"").split(/\s+/).filter(Boolean);a.length&&!n("class")&&(i.classes=a),t.id&&!n("id")&&(i.attr__id=r("id",t.id));let c=t.getAttribute("href");c&&!n("href")&&(i.href=r("href",c.slice(0,1024)));let l={};for(let u of Array.from(t.attributes))(u.name.startsWith("data-lc-")||Bo.includes(u.name))&&!n(u.name)&&(l[u.name]=r(u.name,u.value.slice(0,255)));if(Object.keys(l).length&&(i.attrs=l),e){let u=Vo(t);u&&(i.text=u)}return i}function tt(t,e,n,r,s={}){let o=[],i=Pr(r),a=Pr(s.allow),c=s.maskAll?(u,p)=>a(u)?p:Ko:(u,p)=>p,l=e;for(let u=t;u&&o.length<10;u=u.parentElement)o.push(zo(u,l,i,c)),(u===n||!n)&&(l=!1);return o}var Ze=t=>t.replace(/(["\\])/g,"\\$1");function nt(t){return t.map(e=>{let n=e.tag_name+(e.classes?"."+e.classes.join("."):"")+":";e.attr__id&&(n+=`attr__id="${Ze(e.attr__id)}"`),e.href&&(n+=`href="${Ze(e.href)}"`),e.text&&(n+=`text="${Ze(e.text)}"`);for(let[r,s]of Object.entries(e.attrs??{}))n+=`attr__${r}="${Ze(s)}"`;return n+`nth-child="${e.nth_child}"nth-of-type="${e.nth_of_type}"`}).join(";")}var J=[],Go=/^[+\-−–‹›<>«»←→↑↓▲▼▶◀^ˇ˄˅]$/,Xo=/\b(increase|decrease|increment|decrement|plus|minus|add one|remove one|next|prev|previous|scroll (left|right))\b/i,Yo=/(^|[-_\s])(stepper|spinner|quantity|qty|increment|decrement|inc|dec|plus|minus|carousel|slider|swiper|slick|glide|splide|arrow|next|prev)([-_\s]|$)/i,Jo="button,[role=button],a,input[type=button],input[type=submit],[role=spinbutton]";function Qo(t,e=[]){if(e.length&&t.closest(e.join(","))||t.closest("input[type=number],[role=spinbutton],[role=slider]"))return!0;let n=t.closest(Jo)??t,r=`${n.getAttribute("aria-label")??""} ${n.getAttribute("title")??""}`;if(Go.test((n.textContent??"").trim())||Xo.test(r))return!0;for(let s=n,o=0;s&&o<3;s=s.parentElement,o++)if(Yo.test(s.getAttribute("class")??""))return!0;return!1}var Zo=()=>typeof getSelection=="function"?(getSelection()?.toString()??"")!=="":!1;function $r(t,e=Date.now(),n={},r){if(r&&n.ignoreSelectors?.length&&r.closest(n.ignoreSelectors.join(",")))return{};if(r&&n.suppressSteppers!==!1&&Qo(r,n.stepperSelectors))return{};if(n.ignoreTextSelection!==!1&&Zo())return{};let s=n.windowMs??1e3,o=n.radiusPx??30;for(J.length&&e<J[J.length-1].t&&(J.length=0),J.push({t:e,x:t.clientX,y:t.clientY});J.length&&e-J[0].t>s;)J.shift();let i=J.filter(a=>Math.hypot(a.x-t.clientX,a.y-t.clientY)<=o).length;return i>=(n.count??3)?{$rageclick:!0,$rageclick_count:i}:{}}function Or(t,e,n=700){if(typeof MutationObserver>"u")return;let r=!1,s=new MutationObserver(()=>r=!0);s.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0});let o=()=>{r=!0};window.addEventListener("scroll",o,{capture:!0,passive:!0}),document.addEventListener("selectionchange",o);let i=()=>{s.disconnect(),window.removeEventListener("scroll",o,{capture:!0}),document.removeEventListener("selectionchange",o)},a=setTimeout(()=>{i(),!r&&document.visibilityState!=="hidden"&&t.client.capture("$deadclick_hint",{$selector:e,$no_mutation_ms:n})},n);t.onUnload(()=>{clearTimeout(a),i()})}var Ar=/^[A-Za-z_][\w-]*$/,ei=5;function ti(t){let e=[];for(let n=t;n&&e.length<ei;n=n.parentElement){let r=n.tagName.toLowerCase();if(n.id&&Ar.test(n.id)){e.unshift(`${r}#${n.id}`);break}let s=(n.getAttribute("class")??"").split(/\s+/).filter(o=>Ar.test(o)).slice(0,2);e.unshift(r+s.map(o=>`.${o}`).join(""))}return e.join(" ")}function Ir(t,e,n,r,s={}){let o={$selector:ti(n),$el_interactive:r};(e.clientX||e.clientY||e.detail)&&(o.$click_x=Math.round(e.clientX+(window.scrollX||0)),o.$click_y=Math.round(e.clientY+(window.scrollY||0))),s.rageClicks!==!1&&!n.closest(".lc-no-rageclick,[data-lc-no-rageclick]")&&Object.assign(o,$r(e,Date.now(),s.rageClicks||{},n));let i=s.deadClicks;!r&&e.isTrusted&&i!==!1&&!(i?.ignoreSelectors?.length&&n.closest(i.ignoreSelectors.join(",")))&&Or(t,o.$selector,i?.waitMs);for(let a of t.clickExtras)Object.assign(o,a(e,n));return o}var ni="a,button,input,select,textarea,label,summary,[role=button],[role=link],[data-lc-capture]",ri="[data-lc-ignore]",Vt=t=>t.some(e=>typeof e=="string"?location.href.includes(e):e.test(location.href)),si=t=>!t?.length||Vt(t),Kt=t=>({maskAll:t.maskAllAttributes,allow:t.attributeAllowlist}),Se=(t,e)=>!!t.closest(ri)||!!(e.denySelectors?.length&&t.closest(e.denySelectors.join(",")));function Mr(t,e,n){let r=e.events??["click","change","submit"],s=0,o=c=>{let l=c.target;!n()||c.isComposing||!(l instanceof Element)||Se(l,e)||l instanceof HTMLInputElement&&l.type==="password"||(s+=1)},i=c=>l=>{if(!n())return;let u=l.target;if(!(u instanceof Element)||Se(u,e)||e.allowSelectors?.length&&!u.closest(e.allowSelectors.join(","))||e.elementAllowlist?.length&&!u.closest(e.elementAllowlist.join(","))||!si(e.urlAllowlist)||c==="change"&&!/^(input|select|textarea)$/i.test(u.tagName)||u instanceof HTMLInputElement&&u.type==="password")return;let p=u.closest(ni);if(c==="click"&&!p&&!e.allowSelectors?.length)return;let h=tt(u,e.captureText??!0,p??void 0,e.attributeIgnore,Kt(e)),g=h.find(v=>v.text)?.text,x=s;s=0,t.client.capture("$autocapture",{...et(u),$event_type:c,...x>0?{$keystroke_count:x}:{},$elements:h,$elements_chain:nt(h),...g?{$el_text:g}:{},...c==="click"?Ir(t,l,u,!!p,e):{}})};t.autocaptureClicks=r.includes("click");let a=r.map(c=>[c,i(c)]);for(let[c,l]of a)document.addEventListener(c,l,!0);return document.addEventListener("keydown",o,!0),()=>{for(let[c,l]of a)document.removeEventListener(c,l,!0);document.removeEventListener("keydown",o,!0)}}var oi='[contenteditable]:not([contenteditable="false"])',Tr="input,textarea,select",ii=255;function ai(t){return t.replace(/\d(?:[ -]?\d){5,}/g,"***").replace(/[^\s@]+@[^\s@]+\.[^\s@]+/g,"***").replace(/\s+/g," ").trim().slice(0,ii)}var ci=t=>t?t instanceof Element?t:t.parentElement:null;function jr(t,e,n){let r=e.events??["click","change","submit"],s=e.contentEditable!==!1&&r.includes("change"),o=new WeakSet,i=p=>{let h=tt(p,!1,p,e.attributeIgnore,Kt(e));return{...et(p),$elements:h,$elements_chain:nt(h)}},a=p=>{let h=p instanceof Element?p.closest(oi):null;return h&&!Se(h,e)?h:null},c=p=>{let h=n()?a(p.target):null;h&&o.add(h)},l=p=>{let h=a(p.target);!h||!o.has(h)||p.relatedTarget instanceof Node&&h.contains(p.relatedTarget)||(o.delete(h),n()&&t.client.capture("$autocapture",{$event_type:"change",$el_contenteditable:!0,...i(h)}))},u=p=>{if(!n()||!e.copyCut)return;let h=typeof getSelection=="function"?getSelection():null,g=p.target instanceof Element?p.target:null,x=ci(h?.anchorNode)??g;if(!x||Se(x,e)||x.closest(Tr)||g?.closest(Tr))return;let v=e.captureCopiedText?ai(h?.toString()??""):"";t.client.capture("$copy_autocapture",{$copy_type:p.type,...i(x),...v?{$selected_content:v}:{}})};return s&&(document.addEventListener("input",c,!0),document.addEventListener("focusout",l,!0)),document.addEventListener("copy",u,!0),document.addEventListener("cut",u,!0),()=>{document.removeEventListener("input",c,!0),document.removeEventListener("focusout",l,!0),document.removeEventListener("copy",u,!0),document.removeEventListener("cut",u,!0)}}var li="[data-lc-ignore]",ui=["pdf","zip","gz","tar","rar","7z","doc","docx","xls","xlsx","ppt","pptx","csv","epub","dmg","exe","msi","pkg","apk","iso","mp3","mp4","mov"],di=["q","s","search","query"],Fr=t=>t.origin+t.pathname;function Lr(t,e,n){let r=Array.isArray(e.fileDownloads)?e.fileDownloads.map(o=>o.toLowerCase()):ui,s=[];if(e.outboundLinks!==!1||e.fileDownloads!==!1){let o=i=>{let a=i.target instanceof Element?i.target.closest("a[href]"):null;if(!a||!n()||a.closest(li))return;let c;try{c=new URL(a.href,location.href)}catch{return}if(c.protocol!=="http:"&&c.protocol!=="https:")return;let l=decodeURIComponent(c.pathname.split("/").pop()??""),u=l.includes(".")?l.split(".").pop().toLowerCase():"";e.fileDownloads!==!1&&(a.hasAttribute("download")||r.includes(u))?t.client.capture("$file_download",{$url:Fr(c),$file_name:l,$file_extension:u}):e.outboundLinks!==!1&&c.host!==location.host&&t.client.capture("$outbound_click",{$url:Fr(c),$outbound_host:c.host})};document.addEventListener("click",o,!0),s.push(()=>document.removeEventListener("click",o,!0))}if(e.siteSearch!==!1){let o=typeof e.siteSearch=="object"&&e.siteSearch.params?e.siteSearch.params:di,i=!0;s.push(()=>{i=!1}),t.onCapture(a=>{if(!i||a.event!=="$pageview"||!n())return;let c=new URLSearchParams(location.search);for(let l of o){let u=c.get(l)?.trim();if(u)return void t.client.capture("$site_search",{$search_term:u.slice(0,200),$search_param:l})}})}return()=>s.forEach(o=>o())}var pi=[25,50,75],fi="data-lc-media-title";function Dr(t){let e=t.currentSrc||t.src;if(!e||e.startsWith("blob:")||e.startsWith("data:"))return"";try{let n=new URL(e,location.href);return`${n.origin}${n.pathname}`}catch{return""}}var gi=t=>(t.getAttribute(fi)??t.getAttribute("title")??t.getAttribute("aria-label")??"").trim().slice(0,200);function Hr(t,e,n){if(e.media===!1)return()=>{};let r=new WeakMap,s=c=>{let l={$media_type:c instanceof HTMLVideoElement?"video":"audio",$media_src:Dr(c)},u=gi(c);return u&&(l.$media_title=u),Number.isFinite(c.duration)&&(l.$media_duration=Math.round(c.duration)),l},o=c=>{let l=Dr(c);if(!l)return null;let u=r.get(c);return(!u||u.src!==l)&&r.set(c,u={src:l,played:!1,reached:new Set,done:!1}),u},i=c=>{let l=c.target;if(!(l instanceof HTMLMediaElement)||!n())return;let u=o(l);if(u)if(c.type==="play"){if(u.done&&Object.assign(u,{played:!1,reached:new Set,done:!1}),u.played)return;u.played=!0,t.client.capture("$media_play",s(l))}else if(c.type==="timeupdate"){if(!u.played||u.done||!Number.isFinite(l.duration)||l.duration<=0)return;let p=l.currentTime/l.duration*100;for(let h of pi)p>=h&&!u.reached.has(h)&&(u.reached.add(h),t.client.capture("$media_progress",{...s(l),$media_progress:h}))}else c.type==="ended"&&u.played&&!u.done&&(u.done=!0,t.client.capture("$media_complete",s(l)))},a=["play","timeupdate","ended"];return a.forEach(c=>document.addEventListener(c,i,!0)),()=>a.forEach(c=>document.removeEventListener(c,i,!0))}function Nr(t=()=>performance.now()){let e=()=>document.visibilityState!=="hidden",n=0,r=e()?t():null,s=()=>{e()?r===null&&(r=t()):(r!==null&&(n+=t()-r),r=null)};return document.addEventListener("visibilitychange",s),{read:()=>Math.round(n+(r===null?0:t()-r)),reset:()=>{n=0,r=e()?t():null},stop:()=>document.removeEventListener("visibilitychange",s)}}qr();var Ur=255,hi=new Set(["input","textarea","select","option"]),yi="[data-lc-mask],.lc-mask,[data-lc-no-capture],.lc-no-capture,[data-lc-block]",vi=new Set(["value","password","autocomplete"]),bi=/(?:\d[ -]?){9,}/,Ce=new WeakMap,Gt=new WeakMap;function Br(t,e){let n=Gt.get(t);if(n)return new Promise(r=>{let s=setTimeout(r,e);n.then(()=>(clearTimeout(s),r()))})}function _i(t){return Array.isArray(t)?t.filter(e=>{if(!e||typeof e!="object")return!1;let n=e;return typeof n.name=="string"&&n.name!==""&&!n.name.startsWith("$")&&typeof n.selector=="string"&&(n.source==="text"||n.source==="attribute"&&typeof n.attribute=="string")&&Array.isArray(n.events)}):[]}function xi(t){if(!t||hi.has(t.tagName.toLowerCase())||t.isContentEditable)return!1;try{return!t.closest(yi)}catch{return!1}}function ki(t,e){if(t.source==="attribute"){let r=(t.attribute??"").toLowerCase();if(!r||vi.has(r)||r.startsWith("on"))return;let s=e.getAttribute(r);return s===null?void 0:s.slice(0,Ur)}let n=(e.textContent??"").replace(/\s+/g," ").trim();if(!(!n||bi.test(n)))return n.slice(0,Ur)}function Wr(t,e,n,r=location.href){let s={};for(let o of t){if(!o.events.includes(e)||o.url&&!zt([o.url],r))continue;let i=null;try{i=o.scope==="target"?e==="click"&&n?n.closest(o.selector):null:document.querySelector(o.selector)}catch{continue}if(!xi(i))continue;let a=ki(o,i);a!==void 0&&(s[o.name]=a)}return s}function Vr(t){let e=!0,n=t.loadConfig().then(r=>{e&&Ce.set(t,_i(r?.snapshot_properties)),Gt.delete(t)});return Gt.set(t,n),t.clickExtras.push((r,s)=>e?Wr(Ce.get(t)??[],"click",s):{}),()=>{e=!1,Ce.delete(t)}}function Kr(t){let e=Ce.get(t);return e?.length?Wr(e,"pageview"):{}}function zr(t){return!!Ce.get(t)?.some(e=>e.events.includes("pageview"))}var wi=t=>{try{return new URL(t).pathname}catch{return t}};function Si(t){for(let e of t===void 0?[]:Array.isArray(t)?t:[t])try{let n=document.querySelector(e);if(n)return n}catch{}}function Gr(t){let e=0,n=0,r=()=>{let s=Si(t),o=document.documentElement,i=s?s.scrollHeight:Math.max(o.scrollHeight,document.body?.scrollHeight??0),a=s?s.scrollTop:window.scrollY||window.pageYOffset||0,c=Math.min(i,a+(s?s.clientHeight:window.innerHeight));c>e&&(e=c,n=i>0?Math.min(100,Math.round(c/i*100)):0)};return r(),window.addEventListener("scroll",r,{passive:!0,capture:!0}),window.addEventListener("resize",r,{passive:!0}),{read:()=>({pct:n,px:e}),stop:()=>{window.removeEventListener("scroll",r,{capture:!0}),window.removeEventListener("resize",r)}}}var Ci=800,Ri=t=>t.core.hasConsent("analytics")||t.core.consent.resolving;function Ei(t){return t==="history"?{path:!0,search:!0}:t==="hash"?{path:!0,search:!0,hash:!0}:typeof t=="object"?t:void 0}function Pi(t,e,n){try{let r=new URL(t),s=new URL(e);return!!(n.path&&r.pathname!==s.pathname||n.search&&r.search!==s.search||n.hash&&r.hash!==s.hash)}catch{return t!==e}}function rt(t,e,n={}){let r=n.views??!0,s=n.leave??!0,o=Ei(e),i=t.config.scrollRoot,a=location.href,c=a,l=Date.now(),u=Gr(i),p=Nr(),h,g=()=>{if(!s||h===a)return;h=a;let{pct:A,px:U}=u.read();t.client.capture("$pageleave",{$current_url:a,$scroll_depth:A,$scroll_depth_px:U,$engagement_time_ms:p.read()})},x=!1,v=(A,U={})=>{if(!r)return;let{core:I}=t;if(!I.hasConsent("analytics")&&!I.anonymousOnReject&&!(I.consent.pending&&I.consent.queueBeforeConsent)){if(!x){x=!0;let N=()=>{x&&(x=!1,v())};t.whenConsented(N),I.onChange(T=>{T==="consent"&&I.anonymousOnReject&&N()})}return}t.client.capture("$pageview",{...Kr(t),...A===void 0?{}:{$referrer:A},...U})},w,C=()=>{let A=w;w=void 0,A?.()},R=A=>{if(location.href===c)return;let U=c;if(c=location.href,!o||!Pi(U,c,o))return;let I=a;g(),u.stop();let N=new Date(l);a=location.href,l=Date.now(),u=Gr(i),p.reset();let T={$navigation_type:A,$prev_pageview_pathname:wi(I),$prev_pageview_duration:Math.round((l-N.getTime())/100)/10};zr(t)?setTimeout(()=>v(I,T),0):(C(),w=()=>v(I,T),queueMicrotask(C))};t.onUnload(g);let D=Ri(t)?Br(t,Ci):void 0;if(D?(w=()=>v(),t.onUnload(C),D.then(C)):v(),!o)return()=>(u.stop(),p.stop());let{pushState:Q,replaceState:j}=history;history.pushState=function(...A){C(),Q.apply(this,A),R("pushState")},history.replaceState=function(...A){C(),j.apply(this,A),R("replaceState")};let $=()=>R("popstate"),F=()=>R("hashchange");return window.addEventListener("popstate",$),o.hash&&window.addEventListener("hashchange",F),()=>{window.removeEventListener("hashchange",F),history.pushState=Q,history.replaceState=j,window.removeEventListener("popstate",$),u.stop(),p.stop()}}var Xr=t=>{let e=[],n=t.config.autocapture,r=!1;if(n!==!1){let i=typeof n=="object"?n:{},a=()=>!r&&!(i.urlIgnorelist?.length&&Vt(i.urlIgnorelist));e.push(Mr(t,i,a),jr(t,i,a),Lr(t,i,a),Er(t,i,a),Rr(t,i,a),Hr(t,i,a),Vr(t)),n===void 0&&t.loadConfig().then(c=>r=c?.autocapture===!1)}let s=t.config.capturePageview??"history",o=t.config.capturePageleave??"if_capture_pageview";return s!==!1&&o!==!1?e.push(rt(t,s)):s!==!1?e.push(rt(t,s,{leave:!1})):o===!0&&e.push(rt(t,"history",{views:!1})),()=>e.forEach(i=>i())};Be();var $i="lc_preview",Xt="lc_preview";function Oi(t){let e={};for(let n of(t??"").split(",")){let r=n.indexOf(":");r>0&&r<n.length-1&&(e[n.slice(0,r)]=n.slice(r+1))}return e}function Yr(t){let e=new URL(t).searchParams.get($i),n=null;try{n=sessionStorage.getItem(Xt)}catch{}return{forced:Oi(e==="off"?null:e??n),persist(){try{e==="off"?sessionStorage.removeItem(Xt):e&&sessionStorage.setItem(Xt,e)}catch{}}}}we();Ve();var Yt="lc_flag_initial";function Ai(t){try{return t?new URL(t).hostname:""}catch{return""}}function Ii(){let t=new URLSearchParams(location.search),e={$initial_referrer:document.referrer||"$direct",$initial_referring_domain:Ai(document.referrer)||"$direct",$initial_current_url:location.href.split("#")[0]};for(let n of[...re,...X]){let r=t.get(n);r&&(e[`$initial_${n}`]=r)}return e}function Zr(t,e){if(typeof location>"u")return{};let n=t.get(Yt);if(n)try{return JSON.parse(n)}catch{}let r=Ii();return e(()=>{t.get(Yt)||t.set(Yt,JSON.stringify(r))}),r}function Mi(){let t=navigator.userAgent,e=/Edg\//.test(t)?"Edge":/OPR\/|Opera/.test(t)?"Opera":/Firefox\//.test(t)?"Firefox":/Chrome\/|CriOS/.test(t)?"Chrome":/Safari\//.test(t)?"Safari":"Other",n=/Windows/.test(t)?"Windows":/Android/.test(t)?"Android":/iPhone|iPad|iPod/.test(t)?"iOS":/Mac OS X/.test(t)?"Mac OS X":/CrOS/.test(t)?"Chrome OS":/Linux/.test(t)?"Linux":"Other";return{browser:e,os:n}}function es(){if(typeof location>"u"||typeof navigator>"u")return{};let t={},e=new URLSearchParams(location.search);for(let s of[...re,...X]){let o=e.get(s);o&&(t[`$${s}`]=o)}let{browser:n,os:r}=Mi();return t.$browser=n,t.$os=r,t.$device_type=String(Jt().$device_type??"Desktop"),t}function Jt(){if(typeof window>"u")return{};let t=window.innerWidth;return{$viewport_width:t,$viewport_height:window.innerHeight,$screen_width:screen.width,$screen_height:screen.height,$browser_language:navigator.language,$device_type:Ti(t)}}function Ti(t,e=navigator){let n=e.userAgent??"";return/iPad|Tablet|PlayBook|Silk|Kindle/i.test(n)||/Macintosh/.test(n)&&(e.maxTouchPoints??0)>1?"Tablet":/Android/i.test(n)?/Mobile/i.test(n)?"Mobile":"Tablet":/iPhone|iPod|Mobile|Windows Phone|BlackBerry|Opera Mini/i.test(n)||e.userAgentData?.mobile?"Mobile":/Windows|Macintosh|X11|CrOS|Linux/i.test(n)?"Desktop":t<768?"Mobile":t<1024?"Tablet":"Desktop"}var ji=/^[A-Za-z0-9_.-]{1,100}$/,Fi=/^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*){0,5}$/,Li=new Set(["__proto__","prototype","constructor"]),Di=50,ts=200;function Jr(t,e){if(!Fi.test(e))return;let n=t;for(let r of e.split(".")){if(Li.has(r)||n===null||typeof n!="object"||typeof Node<"u"&&n instanceof Node)return;n=n[r]}if(typeof n=="string")return n.slice(0,ts);if(typeof n=="number"&&Number.isFinite(n)||typeof n=="boolean")return n}function Hi(){let t=new Map;for(let e of(typeof document>"u"?"":document.cookie).split(";")){let n=e.indexOf("=");if(n<1)continue;let r=e.slice(0,n).trim(),s=e.slice(n+1).trim();try{s=decodeURIComponent(s)}catch{}t.has(r)||t.set(r,s.slice(0,ts))}return t}function Qr(t){let e={};if(!t||typeof window>"u")return e;let n=o=>Array.isArray(o)?o.filter(i=>typeof i=="string").slice(0,Di):[],r=n(t.cookies).filter(o=>ji.test(o));if(r.length){let o=Hi();for(let i of r){let a=o.get(i);a!==void 0&&(e[`$cookie/${i}`]=a)}}for(let o of n(t.globals)){let i=Jr(window,o);i!==void 0&&(e[`$global/${o}`]=i)}let s=window.dataLayer;if(Array.isArray(s))for(let o of n(t.data_layer))for(let i=s.length-1;i>=0;i--){let a=Jr(s[i],o);if(a!==void 0){e[`$datalayer/${o}`]=a;break}}return e}var ns=t=>{if(t.config.flagOptions?.disableRemote&&!t.config.localFlags?.length)return;let e;t.flagPersonProps.push(()=>e&&t.core.hasConsent("analytics")?Qr(e):{}),t.loadConfig().then(n=>{let r=n?.flag_targeting_sources;!r||typeof r!="object"||(e=r,Object.keys(Qr(r)).length&&t.flags?.reload())})};Be();function Qt(t){return typeof t=="object"?t.value??t.variant??!!t.enabled:t}function Zt(t){let e={value:Qt(t),reason:t.reason??"remote",condition_index:t.condition_index??-1};return t.variant&&(e.variant=t.variant),t.payload!==void 0&&(e.payload=t.payload),t.runtime?.length&&(e.runtime=t.runtime.map(n=>({filters:n.filters,result:Zt(n.result)}))),e}var rs="lc_rt_events",ss=t=>!!t?.some(e=>e.conditions.some(n=>n.filters?.some(r=>r.type==="event")));function os(t,e){let n;try{let i=t.flagStorage.get(rs);i&&(n=JSON.parse(i))}catch{}let r=new he(n),s={},o=He(e,s);return{counts:()=>r.counts(t.core.sessionId),setServer(i){s=i,o=He(e,s)},server:()=>s,drop(i){for(let a of i)delete s[a]},resolved(){return kt(s,r.counts(t.core.sessionId))},record(i,a,c){r.record(i,t.core.sessionId,a,o),c&&t.whenConsented(()=>t.flagStorage.set(rs,JSON.stringify(r.saved())))}}}var en="lc_flags",tn="lc_flag_overrides_api";function is(t){try{let e=localStorage.getItem("lc_flag_overrides");return e?JSON.parse(e)[t]:void 0}catch{return}}var as=t=>{let{core:e,config:n}=t,r={},s={},o={},i,a,c=!1,l=0,u=new Set,p=new Set,h="",g={},x=()=>Object.keys(g).length>0,v={},w={},C={},R=new Set,D=typeof location>"u"?{forced:{},persist(){}}:Yr(location.href),Q=Object.keys(D.forced).length>0,j=()=>({...r,...C}),$=t.config.flagOptions??{},F=new ve($.cacheTtlMs),A=(t.config.flagsApiHost??t.config.apiHost).replace(/\/+$/,""),U=$.keys?.length?new Set($.keys):void 0,I=f=>U?Object.fromEntries(Object.entries(f).filter(([_])=>U.has(_))):f,N=(f,_,S=!0)=>{if(r=I(f),s=I(_),c=!0,S)for(let P of R)P(j())},T=os(t,n.localFlags),y=!1,L=()=>{y||(y=!0,queueMicrotask(()=>{y=!1,W()}))},Z=t.flagStorage.get(en);if(Z)try{let f=JSON.parse(Z);r=f.values,s=f.payloads,o=Object.fromEntries(Object.keys(r).map(_=>[_,"cached"])),f.rt&&T.setServer(f.rt),F.restore(f),c=Object.keys(r).length>0}catch{}let le=t.flagStorage.get(tn);if(le)try{C=JSON.parse(le)}catch{}let B=n.bootstrap;if(B?.flags||B?.payloads){let f={...B.flags};for(let _ of Object.keys(B.payloads??{}))f[_]??=!0;N({...r,...f},{...s,...B.payloads});for(let _ of Object.keys(f))o[_]="bootstrap"}let ue={},se=()=>({...$.autoProperties===!1?{}:es(),...Zr(e.storage,t.whenConsented),...Object.assign({},...t.flagPersonProps.map(f=>f())),...v}),de=$.evaluationContexts?.length?{app_contexts:$.evaluationContexts}:{},k=(f=!0)=>{let _=n.localFlags;if(!_?.length)return!0;let S=n.localFlagsContext,P=Ct(_,{runtime_events:T.counts(),distinct_id:e.distinctId,...e.groups?{groups:e.groups}:{},...e.deviceId?{device_id:e.deviceId}:{},...x()?{contexts:g}:{},...de,...S,person_properties:{...se(),...S?.person_properties},group_properties:{...S?.group_properties,...w}}),H={},M={},V=!1;for(let[ee,K]of Object.entries(P))Rt(K)?V=!0:Et(K)&&(H[ee]=K.value,o[ee]=K.reason,K.payload!==void 0&&(M[ee]=K.payload));return ue=H,N({...r,...H},{...s,...M},f),V},pe=f=>{let _={...r},S={...s};for(let[P,H]of Object.entries(T.resolved()))_[P]=H.value,o[P]=H.reason,H.payload!==void 0?S[P]=H.payload:delete S[P];N(_,S,f)},fe=ss(n.localFlags);t.onCapture(f=>{let _=fe||Object.keys(T.server()).length>0;if(T.record(f.event,f.properties,_),!_)return;let S=JSON.stringify([j(),s]);if(fe&&k(!1),pe(!1),JSON.stringify([j(),s])!==S)for(let P of R)P(j())});let W=(f=!0)=>{let _=++l;return!k()||$.disableRemote||!f&&F.fresh(e.distinctId)?Promise.resolve():new Promise(S=>{t.whenConsented(()=>{if(_!==l)return S();D.persist();let P=new AbortController,H=setTimeout(()=>P.abort(),$.timeoutMs??1e4);t.fetch(`${A}/v1/flags`,{method:"POST",headers:{"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",signal:P.signal,body:JSON.stringify({api_key:t.apiKey,...e.distinctId?{distinct_id:e.distinctId}:{},...e.anonDistinctId?{anon_distinct_id:e.anonDistinctId}:{},groups:e.groups??{},person_properties:se(),...Object.keys(w).length?{group_properties:w}:{},device_properties:Jt(),...e.deviceId?{device_id:e.deviceId}:{},...x()?{contexts:g}:{},...de,...Q?{preview:D.forced}:{},...$.keys?.length?{flag_keys:$.keys}:{}})}).then(M=>M.ok?M.json():Promise.reject(new Error(`status ${M.status}`))).then(M=>{if(_!==l)return;if(M.quota_limited)return a="quota_limited",t.log("flags quota limited; keeping cached values");a=M.errors_while_computing_flags?"errors_while_computing_flags":void 0;let V={},ee={},K={};for(let[Ee,z]of Object.entries(M.flags??{}))V[Ee]=Qt(z),typeof z=="object"&&z.payload!==void 0&&(ee[Ee]=z.payload),o[Ee]=typeof z=="object"&&typeof z.reason=="string"?z.reason:"remote",typeof z=="object"&&z.runtime?.length&&(K[Ee]=Zt(z));i=M.request_id,T.setServer(K);let Re=M.errors_while_computing_flags;N({...ue,...Re?r:{},...V},Re?{...s,...ee}:ee,!1),pe(!0),t.flagStorage.set(en,JSON.stringify({values:{...Re?r:{},...V},payloads:{...Re?s:{},...ee},rt:K,...F.mark(e.distinctId)})),t.log("flags loaded",V)}).catch(M=>{let V=/^status (\d+)/.exec(String(M?.message))?.[1];_===l&&(a=P.signal.aborted?"timeout":V?`api_error_${V}`:"connection_error"),t.log("flags fetch failed",M)}).finally(()=>{clearTimeout(H),S()})})})},d=f=>C[f]??is(f)??r[f];t.flags={get(f){let _=d(f);if(_===void 0)return;if(f in D.forced||f in C)return _;let S=e.sessionId;S!==h&&(u.clear(),p.clear(),h=S),p.has(f)||(p.add(f),e.capture("$exposure",{$feature_flag:f,$feature_flag_response:_,...typeof _=="string"?{$feature_flag_variant:_}:{},...i?{$feature_flag_request_id:i}:{}}));let P=`${f}:${String(_)}`;return u.has(P)||(u.add(P),e.capture("$feature_flag_called",{$feature_flag:f,$feature_flag_response:_,...i?{$feature_flag_request_id:i}:{},...o[f]?{$feature_flag_reason:o[f]}:{},...o[f]==="bootstrap"?{$used_bootstrap_value:!0}:{},...a?{$feature_flag_error:a}:{}})),_},all:()=>c||Object.keys(r).length||Object.keys(C).length?j():{},payload:f=>s[f],result(f,_){let S=_?.sendExposure===!1?d(f):this.get(f),P=f in C||is(f)!==void 0?"override":f in D.forced?"preview":o[f]??"remote";return be(f,S,s[f],P)},layerParam(f,_){for(let[S,P]of Object.entries(s)){let H=P;if(H?.lc_layer!==f||!H.lc_params||!(_ in H.lc_params))continue;let M=this.get(S);if(M!==void 0&&M!==!1)return H.lc_params[_]}},onChange(f){return R.add(f),c&&f(j()),()=>{R.delete(f)}},reload:W,update(f,_,S=!0){for(let P of Object.keys(f))o[P]="pushed";T.drop(Object.keys(f)),N(S?{...r,...f}:{...f},S?{...s,..._}:{..._})},override(f,_){C=f?{...f}:{},f?_?.persist&&t.whenConsented(()=>t.flagStorage.set(tn,JSON.stringify(C))):t.flagStorage.remove(tn);for(let S of R)S(j())},setPersonProperties(f,_=!0){F.clear(),v={...v,...f},_&&L()},resetPersonProperties(){v={}},setGroupProperties(f,_=!0){F.clear();for(let[S,P]of Object.entries(f))w[S]={...w[S],...P};_&&L()},resetGroupProperties(){w={}},setContext(f,_,S){F.clear(),g={...g,[f]:{key:_,properties:S??{}}},L()},clearContext(f){F.clear();let{[f]:_,...S}=g;g=S,L()}},e.onChange(f=>{if(f==="reset"){g={},v={},w={},u.clear(),p.clear(),r={},s={},o={},i=void 0,a=void 0,T.setServer({}),F.clear(),t.flagStorage.remove(en),k(!1);for(let _ of R)_(j())}(f==="identify"||f==="reset"||f==="group")&&L()}),n.disableFlagsOnFirstLoad?k():W(!1);let m=n.flagStream,b;m&&!$.disableRemote&&t.whenConsented(()=>{b=dt({apiHost:A,apiKey:t.apiKey,fetch:t.fetch,reload:()=>{W()},visibility:{hidden:()=>document.visibilityState==="hidden",subscribe:f=>(document.addEventListener("visibilitychange",f),()=>document.removeEventListener("visibilitychange",f))},...typeof m=="object"&&m.pollMs!==void 0?{pollMs:m.pollMs}:{},log:t.log})});let O=$.refreshMs&&$.refreshMs>0&&!$.disableRemote?setInterval(()=>document.visibilityState!=="hidden"&&void W(!1),$.refreshMs):void 0;return()=>{b?.(),O&&clearInterval(O)}};function st(t){let e=window.fetch;window.fetch=function(i,a){let c=i instanceof Request?i.url:String(i),l=new Headers(a?.headers??(i instanceof Request?i.headers:void 0)),u=[...l.entries()].join("|");return t(c,l),[...l.entries()].join("|")===u?e.call(this,i,a):e.call(this,i,{...a,headers:l})};let n=XMLHttpRequest.prototype,{open:r,send:s}=n,o=new WeakMap;return n.open=function(i,a,...c){return o.set(this,String(a)),r.call(this,i,a,...c)},n.send=function(i){let a=o.get(this);if(a){let c=new Headers;t(a,c),c.forEach((l,u)=>this.setRequestHeader(u,l))}return s.call(this,i)},()=>{window.fetch=e,n.open=r,n.send=s}}var cs="lucida.session_id";function Ni(t,e){return[...(t??"").split(",").map(r=>r.trim()).filter(r=>r&&!r.startsWith(`${cs}=`)),`${cs}=${encodeURIComponent(e)}`].join(",")}function qi(t,e=[]){let n;try{n=new URL(t,location.href)}catch{return!1}return n.origin===location.origin||e.some(r=>typeof r=="string"?n.origin===r:r.test(n.href))}var ls=t=>{let e=t.config.watchtower;if(!e?.correlate)return;let{core:n}=t,r=n.sessionId;t.onCapture(o=>r=String(o.properties.$session_id??r));let s=o=>n.hasConsent("analytics")&&!o.startsWith(t.config.apiHost)&&qi(o,e.origins);return st((o,i)=>{s(o)&&i.set("baggage",Ni(i.get("baggage"),r))})};var Ui="X-Lucida-Distinct-Id",Bi="X-Lucida-Session-Id";function Wi(t,e){let n;try{n=new URL(t,location.href).hostname.toLowerCase()}catch{return!1}return e.some(r=>{let s=r.toLowerCase();return s.startsWith(".")?n===s.slice(1)||n.endsWith(s):n===s})}var us=t=>/^[\x20-\x7e]*$/.test(t)?t:encodeURIComponent(t),ds=t=>{let e=t.config.tracingHeaders;if(!e?.length)return;let{core:n}=t;return st((r,s)=>{!n.hasConsent("analytics")||r.startsWith(t.config.apiHost)||!Wi(r,e)||(n.distinctId&&s.set(Ui,us(n.distinctId)),s.set(Bi,us(n.sessionId)))})};function ps(t,e={},n=[]){return Cr(t,e,[Xr,as,ns,ls,ds,gr,...n])}var nn=(()=>{try{let t=typeof document>"u"?void 0:document.currentScript?.src;return t?new URL(t).origin:void 0}catch{return}})();function Vi(t,e,n){if(!t.modules?.length)return Promise.resolve([]);if(t.extension??We())return console.warn("[lucida] extension mode: `modules` are not loaded remotely; bundle them with createClient"),Promise.resolve([]);let r=t.assetHost??nn??t.apiHost??Je;return ar(t.modules,{assetHost:r,version:Bt},(...s)=>console.warn("[lucida]",...s),e,n)}function Ki(t,e,n){let r=t.lucidaQueue??[],s=[],o=Promise.resolve(),i=!1,a=l=>{let[u,...p]=l;if(u==="init"){if(t.lucida||i)return;i=!0;let g=p[1]??{},x=v=>{let w=!g.uiHost&&!g.assetHost&&nn?{uiHost:nn}:{};t.lucida=ps(String(p[0]),{...w,...g},v);let C=s;s=[],C.forEach(a)};g.modules?.length?o=Vi(g,e,n).then(x):x([]);return}if(!t.lucida){s.push(l);return}let h=t.lucida[u];typeof h=="function"&&h.apply(t.lucida,p)},c=r.splice(0);return r.push=(...l)=>(l.forEach(a),r.length),t.lucidaQueue=r,c.forEach(a),o}typeof window<"u"&&Ki(window);})();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.1.5",
|
|
3
|
+
"files": {
|
|
4
|
+
"modules/autocapture.js": "sha384-+5q1xqzlVG0FEFn6fQPyU4CtVoM3C/OU53mp+sRYE90EYonpBbAq1FEOh+zuiOMN",
|
|
5
|
+
"modules/banner-7LEREYUH.js": "sha384-Qp/NqT/ErMxTXljd3BTWMnbB8lmjwU6tHN92KxosOvQ+jODaakgrhiMPGp2HUssl",
|
|
6
|
+
"modules/consent.js": "sha384-gfpx8znG/5LuNJA6KpFlTtTeo7O4W/4Pt7jageTPD4l8mq3MMjDMeZM+BwCj0Gzs",
|
|
7
|
+
"modules/core.js": "sha384-u4L18ofoRzsNfp2sEM1cl2dDLCV/A99PBF8m5j/e+o753K6L1y+wDQMBuLjiXx97",
|
|
8
|
+
"modules/correlate.js": "sha384-GBRoLCX2uGUNdY119jf/Kdaw7pbXJOQ6gthHVo/p9T2WN/czR6uAk39QrCdPOOsV",
|
|
9
|
+
"modules/early-access.js": "sha384-5JZ6DWRYgfoeu7QgSPi8kvVlys4CZ6H2wWuvEEggc83iau5z0sJ8RQD1AXtLCjGQ",
|
|
10
|
+
"modules/experiments.js": "sha384-5smoFlAcR2T1XmBgazy5HGun22PvX5Pa7IKIKtONtN/CpNy6U9SDWb7W7Di9d5fR",
|
|
11
|
+
"modules/flags.js": "sha384-leEfAfEPD56SEaTBA0frnZvRvDk8p/tOilnGeNDqoRLUuR4e0uoVSY2z96lInBHN",
|
|
12
|
+
"modules/forms.js": "sha384-G61YPp3pr3ZeyhVNhHSjYIexf3/bmgQjZEUJrPrY5qP0ykMnXfk5PAgDK2ErLqF+",
|
|
13
|
+
"modules/guides.js": "sha384-ojyyhBUHcWeLxnIuFqEe/K8+CgHJCFT0Q85LsBpZtG+p+8k7jsGzDjPJon2SZQg1",
|
|
14
|
+
"modules/heatmaps.js": "sha384-drg7hBMqgcVNdV3zVr2Df+LJ+CMsf9lbeWugFixjEpyMBvEgEci5A1hWEjLZX5Vn",
|
|
15
|
+
"modules/host-headers.js": "sha384-8OsSDIVDEo3Lsk3G+L5xNJ4pkAYXDEAz+ggBK7sG1cj7tOITAXDKaM2EFtQCHGiF",
|
|
16
|
+
"modules/index.js": "sha384-3YsvZp1lkNbu7czPe6OJ80iyuSZkBmD9Sn1Wuy73GHzt3utmEvCAeHuzD0CvWsqh",
|
|
17
|
+
"modules/inspector.js": "sha384-wCjcdzjbZ1mAYS3w19Io8NOJQfrnlmfDkinoan/0LUTqCw6M7OSR9QDwxDp6M5+T",
|
|
18
|
+
"lucida.js": "sha384-TAeLhDXpW+SSNNw+4Lfak659C3WhewE4DHrFRgyD686cOl8GQsRhOg4trITiHoya",
|
|
19
|
+
"modules/modules-FANMZRDJ.js": "sha384-UjLSth+cPZTIxwMGFgoUEocqFSHXnM7IgYpICNSRRU7NTlFkfCg3WUNUbu8u04EP",
|
|
20
|
+
"modules/persistent-SLVINN5A.js": "sha384-DUvReNmdZNyY7aEE/oFQW7ZOS4J1CyyqE6eheXPBOv/zXqCViscg3GE74E9OSdRQ",
|
|
21
|
+
"modules/recommendations.js": "sha384-6XyPo/sQd1LNvQ87+vlgOLYe/ecapP9mmDeKlkTRx15d9gTAmDRwCPrX+n6zy2lx",
|
|
22
|
+
"modules/recorder-4WIMQCLR.js": "sha384-7OIwHRXGKBAgkMw+adAxAXZ51mTlhVaig1Srek5OkdY2F9nqfRWLvpAg+WJ+4lOf",
|
|
23
|
+
"modules/replay.js": "sha384-UxRymVyZcmoSPDutEK6duQi+F6P9Zpk7Vvb08X8madMU8TWM1rzapRJnEMGBNswv",
|
|
24
|
+
"modules/toolbar.js": "sha384-5RaMXlQzkpgbv3L9JX67X8YdRd9s5/Kt5usUm4uqC0afaZkXTYbBkdInD2b0ORP3",
|
|
25
|
+
"modules/validation-HGJXZ553.js": "sha384-NmKcVVwg5IWD+ctqpalFATPXleIm4PFPkcQgQ3d/iUILxmjIC8tENjXFPibdEVTX",
|
|
26
|
+
"modules/webmcp.js": "sha384-Vs+fImvLlnbEZtId9H/pA4VXB1bVaxEjOYY+DcAUTN5pXXuNNFOYQfltuj2giALZ"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as rr,d as nr,h as sr,i as ar,j as kt}from"./chunk-UH2MVDMX.js";import{b as or,c as ir}from"./chunk-O4W7SZ2X.js";var Bn=Object.defineProperty,Hn=(e,t,r)=>t in e?Bn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t,r)=>Hn(e,typeof t!="symbol"?t+"":t,r),lr,L=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e[e.Annotation=8]="Annotation",e))(L||{}),A=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(A||{}),ce=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(ce||{}),Ce=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ce||{}),Ue=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ue||{}),Ae=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Ae||{}),ee=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(ee||{}),ur={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},cr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ge={},Et={},dr=0,Wn=()=>!!globalThis.Zone;function Ht(e){if(Ge[e])return Ge[e];let t=globalThis[e],r=t.prototype,n=e in ur?ur[e]:void 0,o=!!(n&&n.every(a=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),i=e in cr?cr[e]:void 0,s=!!(i&&i.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(o&&s&&!Wn())return Ge[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let c=l[e].prototype;if(!c)return a.remove(),r;let u=navigator.userAgent;return u.includes("Safari")&&!u.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),Et[e]=()=>a.remove()):a.remove(),Ge[e]=c}catch{return r}}var Mt={};function he(e,t,r){var n,o;let i=(n=Mt[e])==null?void 0:n[r];if(i)return i.call(t);let s=Ht(e),a=(o=Object.getOwnPropertyDescriptor(s,r))==null?void 0:o.get;return a?((Mt[e]||(Mt[e]={}))[r]=a,a.call(t)):t[r]}var xt={};function kr(e,t,r){let n=`${e}.${String(r)}`;if(xt[n])return xt[n].bind(t);let i=Ht(e)[r];return typeof i!="function"?t[r]:(xt[n]=i,i.bind(t))}function Gn(e){return he("Node",e,"ownerDocument")}function jn(e){return he("Node",e,"childNodes")}function qn(e){return he("Node",e,"parentNode")}function Vn(e){return he("Node",e,"parentElement")}function Xn(e){return he("Node",e,"textContent")}function Zn(e){return he("Node",e,"firstChild")}function Kn(e){return he("Node",e,"lastChild")}function Yn(e){return he("Node",e,"nextSibling")}function Jn(e){return he("Node",e,"previousSibling")}function Qn(e,t){return kr("Node",e,"contains")(t)}function eo(e){return kr("Node",e,"getRootNode")()}function to(e){return!e||!("host"in e)?null:he("ShadowRoot",e,"host")}function ro(e){return e.styleSheets}function no(e){return!e||!("shadowRoot"in e)?null:he("Element",e,"shadowRoot")}function oo(e,t){return he("Element",e,"querySelector")(t)}function io(e,t){return he("Element",e,"querySelectorAll")(t)}function Mr(){let e=Ht("MutationObserver");dr++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--dr!==0))return;let r=Et.MutationObserver;if(r)try{r()}finally{delete Ge.MutationObserver,delete Et.MutationObserver}}]}var Xe=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Xe=()=>new Date().getTime());function Te(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}var M={ownerDocument:Gn,childNodes:jn,parentNode:qn,parentElement:Vn,textContent:Xn,firstChild:Zn,lastChild:Kn,nextSibling:Yn,previousSibling:Jn,contains:Qn,getRootNode:eo,host:to,styleSheets:ro,shadowRoot:no,querySelector:oo,querySelectorAll:io,nowTimestamp:Xe,mutationObserverCtor:Mr,patch:Te};function xr(e){return e.nodeType===e.ELEMENT_NODE}function je(e){let t=e&&"host"in e&&"mode"in e&&M.host(e)||null;return!!(t&&"shadowRoot"in t&&M.shadowRoot(t)===e)}function qe(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function so(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function ao(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function Tt(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,o=>Rr(o,r)).join("");return so(n)}catch{return null}}function Rr(e,t){if(uo(e)){let r;try{r=Tt(e.styleSheet)||ao(e)}catch{r=e.cssText}return e.styleSheet.href?pt(r,e.styleSheet.href):r}else{let r=e.cssText;return co(e)&&e.selectorText.includes(":")&&(r=lo(r)),t?pt(r,t):r}}function lo(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function uo(e){return"styleSheet"in e}function co(e){return"selectorText"in e}var dt=class{constructor(){v(this,"idNodeMap",new Map),v(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.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){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(o=>this.removeNodeFromMap(o));let n=M.shadowRoot(t);n&&this.removeNodeFromMap(n)}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(r,o)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function fo(){return new dt}function ft({element:e,maskInputOptions:t,tagName:r,type:n,value:o,maskInputFn:i}){let s=o||"",a=n&&Ee(n);return(t[r.toLowerCase()]||a&&t[a])&&(i?s=i(s,e):s="*".repeat(s.length)),s}function Ee(e){return e.toLowerCase()}var fr="__rrweb_original__";function ho(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let n=0;n<e.width;n+=r)for(let o=0;o<e.height;o+=r){let i=t.getImageData,s=fr in i?i[fr]:i;if(new Uint32Array(s.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function ht(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ee(t):null}function Ir(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let n=/\.([0-9a-z]+)(?:$)/i,o=r.pathname.match(n);return o?.[1]??null}function po(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var mo=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,go=/^(?:[a-z+]+:)?\/\//i,yo=/^www\..*/i,vo=/^(data:)([^,]*),(.*)/i;function pt(e,t){return(e||"").replace(mo,(r,n,o,i,s,a)=>{let l=o||s||a,c=n||i||"";if(!l)return r;if(go.test(l)||yo.test(l))return`url(${c}${l}${c})`;if(vo.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${po(t)+l}${c})`;let u=l.split("#")[0],p=l.substring(u.length),f=t.split("#")[0].split("/"),h=u.split("/");f.pop();for(let m of h)m!=="."&&(m===".."?f.pop():f.push(m));return`url(${c}${f.join("/")}${p}${c})`})}var Er="(?:/\\*[^*]*\\*/)|[\\s;]",bo=new RegExp(`${Er}|\\b(0)px?`,"g"),wo=new RegExp(Er,"g");function st(e,t=!1){return t?e.replace(wo,""):e.replace(bo,"$1")}function So(e,t,r=!1){let n=Array.from(t.childNodes),o=[],i=0;if(n.length>1&&e&&typeof e=="string"){let s=st(e,r),a=s.length/e.length;for(let l=1;l<n.length;l++)if(n[l].textContent&&typeof n[l].textContent=="string"){let c=st(n[l].textContent,r),u=100,p=3;for(;p<c.length&&(c[p].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,p),1)!==-1);p++);for(;p<c.length;p++){let f=c.substring(0,p),h=s.split(f),m=-1;if(h.length===2)m=h[0].length;else if(h.length>2&&h[0]===""&&n[l-1].textContent!=="")m=s.indexOf(f,1);else if(h.length===1){if(f=f.substring(0,f.length-1),h=s.split(f),h.length<=1)return o.push(e),o;p=u+1}else p===c.length-1&&(m=s.indexOf(f));if(h.length>=2&&p>u){let d=n[l-1].textContent;if(d&&typeof d=="string"){let y=st(d).length;m=s.indexOf(f,y)}m===-1&&(m=h[0].length)}if(m!==-1){let d=Math.floor(m/a);for(;d>0&&d<e.length;){if(i+=1,i>50*n.length)return o.push(e),o;let y=st(e.substring(0,d),r);if(y.length===m){o.push(e.substring(0,d)),e=e.substring(d),s=s.substring(m);break}else y.length<m?d+=Math.max(1,Math.floor((m-y.length)/a)):d-=Math.max(1,Math.floor((y.length-m)*a))}break}}}}return o.push(e),o}function Co(e,t){return So(e,t).join("/* rr_split */")}var ko=1,Mo=new RegExp("[^a-z0-9-_:]"),mt=-2;function Tr(){return ko++}function xo(e){if(e instanceof HTMLFormElement)return"form";let t=Ee(e.tagName);return Mo.test(t)?"div":t}var Le,hr,Ro=/^[^ \t\n\r\u000c]+/,Io=/^[, \t\n\r\u000c]+/;function Eo(e,t){if(t.trim()==="")return t;let r=0;function n(i){let s,a=i.exec(t.substring(r));return a?(s=a[0],r+=s.length,s):""}let o=[];for(;n(Io),!(r>=t.length);){let i=n(Ro);if(i.slice(-1)===",")i=_e(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=_e(e,i);let a=!1;for(;;){let l=t.charAt(r);if(l===""){o.push((i+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,o.push((i+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return o.join(", ")}var pr=new WeakMap;function _e(e,t){return!t||t.trim()===""?t:Wt(e,t)}function To(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Wt(e,t){let r=pr.get(e);if(r||(r=e.createElement("a"),pr.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Or(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?_e(e,n):r==="srcset"?Eo(e,n):r==="style"?pt(n,Wt(e)):t==="object"&&r==="data"?_e(e,n):n)}function Nr(e,t,r){return["video","audio"].includes(e)&&Ee(t)==="autoplay"}function Oo(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let o=e.classList[n];if(t.test(o))return!0}if(r)return e.matches(r)}catch{}return!1}function gt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?gt(M.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){let o=e.classList[n];if(t.test(o))return!0}return r?gt(M.parentNode(e),t,r):!1}function Lr(e,t,r,n){let o;if(xr(e)){if(o=e,!M.childNodes(o).length)return!1}else{if(M.parentElement(e)===null)return!1;o=M.parentElement(e)}try{if(typeof t=="string"){if(n){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(gt(o,t,n))return!0;if(r){if(n){if(o.closest(r))return!0}else if(o.matches(r))return!0}}catch{}return!1}function No(e,t,r){let n=e.contentWindow;if(!n)return;let o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){let a=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),o=!0,t()});return}let s="about:blank";if(n.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Lo(e,t,r){let n=!1,o;try{o=e.sheet}catch{return}if(o)return;let i=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),n=!0,t()})}function Ao(e,t){let{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:p={},inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:d=!1,cssCaptured:y=!1}=t,S=Do(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ee.Document,childNodes:[],compatMode:e.compatMode}:{type:ee.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ee.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return Fo(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:p,inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:d,rootId:S});case e.TEXT_NODE:return _o(e,{doc:r,needsMask:s,maskTextFn:c,rootId:S,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:ee.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:ee.Comment,textContent:M.textContent(e)||"",rootId:S};default:return!1}}function Do(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function _o(e,t){let{needsMask:r,maskTextFn:n,rootId:o,cssCaptured:i}=t,s=M.parentNode(e),a=s&&s.tagName,l="",c=a==="STYLE"?!0:void 0,u=a==="SCRIPT"?!0:void 0;return u?l="SCRIPT_PLACEHOLDER":i||(l=M.textContent(e),c&&l&&(l=pt(l,Wt(t.doc)))),!c&&!u&&l&&r&&(l=n?n(l,M.parentElement(e)):l.replace(/[\S]/g,"*")),{type:ee.Text,textContent:l||"",rootId:o}}function Fo(e,t){let{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:i,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:p,newlyAddedElement:f=!1,rootId:h}=t,m=Oo(e,n,o),d=xo(e),y={},S=e.attributes.length;for(let g=0;g<S;g++){let w=e.attributes[g];Nr(d,w.name,w.value)||(y[w.name]=Or(r,d,Ee(w.name),w.value))}if(d==="link"&&i){let g=Array.from(r.styleSheets).find(k=>k.href===e.href),w=null;g&&(w=Tt(g)),w&&(delete y.rel,delete y.href,y._cssText=w)}if(d==="style"&&e.sheet){let g=Tt(e.sheet);g&&(e.childNodes.length>1&&(g=Co(g,e)),y._cssText=g)}if(["input","textarea","select"].includes(d)){let g=e.value,w=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&g?y.value=ft({element:e,type:ht(e),tagName:d,value:g,maskInputOptions:s,maskInputFn:a}):w&&(y.checked=w)}if(d==="option"&&(e.selected&&!s.select?y.selected=!0:delete y.selected),d==="dialog"&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),d==="canvas"&&u){if(e.__context==="2d")ho(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let g=e.toDataURL(l.type,l.quality),w=r.createElement("canvas");w.width=e.width,w.height=e.height;let k=w.toDataURL(l.type,l.quality);g!==k&&(y.rr_dataURL=g)}}if(d==="img"&&c){Le||(Le=r.createElement("canvas"),hr=Le.getContext("2d"));let g=e,w=g.currentSrc||g.getAttribute("src")||"<unknown-src>",k=g.crossOrigin,x=()=>{g.removeEventListener("load",x);try{Le.width=g.naturalWidth,Le.height=g.naturalHeight,hr.drawImage(g,0,0),y.rr_dataURL=Le.toDataURL(l.type,l.quality)}catch(E){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?x():g.addEventListener("load",x);return}else console.warn(`Cannot inline img src=${w}! Error: ${E}`)}g.crossOrigin==="anonymous"&&(k?y.crossOrigin=k:g.removeAttribute("crossorigin"))};g.complete&&g.naturalWidth!==0?x():g.addEventListener("load",x)}if(["audio","video"].includes(d)){let g=y;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume}if(f||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),m){let{width:g,height:w}=e.getBoundingClientRect();y={class:y.class,rr_width:`${g}px`,rr_height:`${w}px`}}d==="iframe"&&!p(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let b;try{customElements.get(d)&&(b=!0)}catch{}return{type:ee.Element,tagName:d,attributes:y,childNodes:[],isSVG:To(e)||void 0,needBlock:m,rootId:h,isCustom:b}}function B(e){return e==null?"":e.toLowerCase()}function Ar(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function zo(e,t){if(t.comment&&e.type===ee.Comment)return!0;if(e.type===ee.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Ir(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(B(e.attributes.name).match(/^msapplication-tile(image|color)$/)||B(e.attributes.name)==="application-name"||B(e.attributes.rel)==="icon"||B(e.attributes.rel)==="apple-touch-icon"||B(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&B(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(B(e.attributes.property).match(/^(og|twitter|fb):/)||B(e.attributes.name).match(/^(og|twitter):/)||B(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(B(e.attributes.name)==="robots"||B(e.attributes.name)==="googlebot"||B(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(B(e.attributes.name)==="author"||B(e.attributes.name)==="generator"||B(e.attributes.name)==="framework"||B(e.attributes.name)==="publisher"||B(e.attributes.name)==="progid"||B(e.attributes.property).match(/^article:/)||B(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(B(e.attributes.name)==="google-site-verification"||B(e.attributes.name)==="yandex-verification"||B(e.attributes.name)==="csrf-token"||B(e.attributes.name)==="p:domain_verify"||B(e.attributes.name)==="verify-v1"||B(e.attributes.name)==="verification"||B(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Fe(e,t){let{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m={},inlineImages:d=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:E=!1,cssCaptured:I=!1}=t,{needsMask:R}=t,{preserveWhiteSpace:P=!0}=t;R||(R=Lr(e,s,a,R===void 0));let H=Ao(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,dataURLOptions:m,inlineImages:d,recordCanvas:y,keepIframeSrcFn:x,newlyAddedElement:E,cssCaptured:I});if(!H)return console.warn(e,"not serialized"),null;let U;n.hasNode(e)?U=n.getId(e):zo(H,h)||!P&&H.type===ee.Text&&!H.textContent.replace(/^\s+|\s+$/gm,"").length?U=mt:U=Tr();let T=Object.assign(H,{id:U});if(n.add(e,T),U===mt)return null;S&&S(e);let X=!l;if(T.type===ee.Element){X=X&&!T.needBlock,delete T.needBlock;let N=M.shadowRoot(e);N&&qe(N)&&(T.isShadowHost=!0)}if((T.type===ee.Document||T.type===ee.Element)&&X){h.headWhitespace&&T.type===ee.Element&&T.tagName==="head"&&(P=!1);let N={doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,cssCaptured:!1};if(!(T.type===ee.Element&&T.tagName==="textarea"&&T.attributes.value!==void 0)){T.type===ee.Element&&T.attributes._cssText!==void 0&&typeof T.attributes._cssText=="string"&&(N.cssCaptured=!0);for(let W of Array.from(M.childNodes(e))){let G=Fe(W,N);G&&T.childNodes.push(G)}}let F=null;if(xr(e)&&(F=M.shadowRoot(e)))for(let W of Array.from(M.childNodes(F))){let G=Fe(W,N);G&&(qe(F)&&(G.isShadow=!0),T.childNodes.push(G))}}let K=M.parentNode(e);return K&&je(K)&&qe(K)&&(T.isShadow=!0),T.type===ee.Element&&T.tagName==="iframe"&&No(e,()=>{let N=e.contentDocument;if(N&&b){let F=Fe(N,{doc:N,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});F&&b(e,F)}},g),T.type===ee.Element&&T.tagName==="link"&&typeof T.attributes.rel=="string"&&(T.attributes.rel==="stylesheet"||T.attributes.rel==="preload"&&typeof T.attributes.href=="string"&&Ir(T.attributes.href)==="css")&&Lo(e,()=>{if(w){let N=Fe(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});N&&w(e,N)}},k),T}function Po(e,t){let{mirror:r=new dt,blockClass:n="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:p,maskInputFn:f,slimDOM:h=!1,dataURLOptions:m,preserveWhiteSpace:d,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:g,stylesheetLoadTimeout:w,keepIframeSrcFn:k=()=>!1}=t,x=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:u===!1?{password:!0}:u,E=Ar(h);return Fe(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:x,maskTextFn:p,maskInputFn:f,slimDOMOptions:E,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:d,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:g,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1})}var Ot=class e{constructor(...t){v(this,"parentElement",null),v(this,"parentNode",null),v(this,"ownerDocument"),v(this,"firstChild",null),v(this,"lastChild",null),v(this,"previousSibling",null),v(this,"nextSibling",null),v(this,"ELEMENT_NODE",1),v(this,"TEXT_NODE",3),v(this,"nodeType"),v(this,"nodeName"),v(this,"RRNodeType")}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function re(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var De=`Please stop import mirror directly. Instead of that,\r
|
|
1
|
+
import{b as rr,d as nr,h as sr,i as ar,j as kt}from"./chunk-UPPUYIIH.js";import{b as or,c as ir}from"./chunk-EFNCQJI3.js";var Bn=Object.defineProperty,Hn=(e,t,r)=>t in e?Bn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t,r)=>Hn(e,typeof t!="symbol"?t+"":t,r),lr,L=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e[e.Annotation=8]="Annotation",e))(L||{}),A=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(A||{}),ce=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(ce||{}),Ce=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ce||{}),Ue=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ue||{}),Ae=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Ae||{}),ee=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(ee||{}),ur={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},cr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ge={},Et={},dr=0,Wn=()=>!!globalThis.Zone;function Ht(e){if(Ge[e])return Ge[e];let t=globalThis[e],r=t.prototype,n=e in ur?ur[e]:void 0,o=!!(n&&n.every(a=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),i=e in cr?cr[e]:void 0,s=!!(i&&i.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(o&&s&&!Wn())return Ge[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let c=l[e].prototype;if(!c)return a.remove(),r;let u=navigator.userAgent;return u.includes("Safari")&&!u.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),Et[e]=()=>a.remove()):a.remove(),Ge[e]=c}catch{return r}}var Mt={};function he(e,t,r){var n,o;let i=(n=Mt[e])==null?void 0:n[r];if(i)return i.call(t);let s=Ht(e),a=(o=Object.getOwnPropertyDescriptor(s,r))==null?void 0:o.get;return a?((Mt[e]||(Mt[e]={}))[r]=a,a.call(t)):t[r]}var xt={};function kr(e,t,r){let n=`${e}.${String(r)}`;if(xt[n])return xt[n].bind(t);let i=Ht(e)[r];return typeof i!="function"?t[r]:(xt[n]=i,i.bind(t))}function Gn(e){return he("Node",e,"ownerDocument")}function jn(e){return he("Node",e,"childNodes")}function qn(e){return he("Node",e,"parentNode")}function Vn(e){return he("Node",e,"parentElement")}function Xn(e){return he("Node",e,"textContent")}function Zn(e){return he("Node",e,"firstChild")}function Kn(e){return he("Node",e,"lastChild")}function Yn(e){return he("Node",e,"nextSibling")}function Jn(e){return he("Node",e,"previousSibling")}function Qn(e,t){return kr("Node",e,"contains")(t)}function eo(e){return kr("Node",e,"getRootNode")()}function to(e){return!e||!("host"in e)?null:he("ShadowRoot",e,"host")}function ro(e){return e.styleSheets}function no(e){return!e||!("shadowRoot"in e)?null:he("Element",e,"shadowRoot")}function oo(e,t){return he("Element",e,"querySelector")(t)}function io(e,t){return he("Element",e,"querySelectorAll")(t)}function Mr(){let e=Ht("MutationObserver");dr++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--dr!==0))return;let r=Et.MutationObserver;if(r)try{r()}finally{delete Ge.MutationObserver,delete Et.MutationObserver}}]}var Xe=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Xe=()=>new Date().getTime());function Te(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}var M={ownerDocument:Gn,childNodes:jn,parentNode:qn,parentElement:Vn,textContent:Xn,firstChild:Zn,lastChild:Kn,nextSibling:Yn,previousSibling:Jn,contains:Qn,getRootNode:eo,host:to,styleSheets:ro,shadowRoot:no,querySelector:oo,querySelectorAll:io,nowTimestamp:Xe,mutationObserverCtor:Mr,patch:Te};function xr(e){return e.nodeType===e.ELEMENT_NODE}function je(e){let t=e&&"host"in e&&"mode"in e&&M.host(e)||null;return!!(t&&"shadowRoot"in t&&M.shadowRoot(t)===e)}function qe(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function so(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function ao(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function Tt(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,o=>Rr(o,r)).join("");return so(n)}catch{return null}}function Rr(e,t){if(uo(e)){let r;try{r=Tt(e.styleSheet)||ao(e)}catch{r=e.cssText}return e.styleSheet.href?pt(r,e.styleSheet.href):r}else{let r=e.cssText;return co(e)&&e.selectorText.includes(":")&&(r=lo(r)),t?pt(r,t):r}}function lo(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function uo(e){return"styleSheet"in e}function co(e){return"selectorText"in e}var dt=class{constructor(){v(this,"idNodeMap",new Map),v(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.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){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(o=>this.removeNodeFromMap(o));let n=M.shadowRoot(t);n&&this.removeNodeFromMap(n)}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(r,o)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function fo(){return new dt}function ft({element:e,maskInputOptions:t,tagName:r,type:n,value:o,maskInputFn:i}){let s=o||"",a=n&&Ee(n);return(t[r.toLowerCase()]||a&&t[a])&&(i?s=i(s,e):s="*".repeat(s.length)),s}function Ee(e){return e.toLowerCase()}var fr="__rrweb_original__";function ho(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let n=0;n<e.width;n+=r)for(let o=0;o<e.height;o+=r){let i=t.getImageData,s=fr in i?i[fr]:i;if(new Uint32Array(s.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function ht(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ee(t):null}function Ir(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let n=/\.([0-9a-z]+)(?:$)/i,o=r.pathname.match(n);return o?.[1]??null}function po(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var mo=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,go=/^(?:[a-z+]+:)?\/\//i,yo=/^www\..*/i,vo=/^(data:)([^,]*),(.*)/i;function pt(e,t){return(e||"").replace(mo,(r,n,o,i,s,a)=>{let l=o||s||a,c=n||i||"";if(!l)return r;if(go.test(l)||yo.test(l))return`url(${c}${l}${c})`;if(vo.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${po(t)+l}${c})`;let u=l.split("#")[0],p=l.substring(u.length),f=t.split("#")[0].split("/"),h=u.split("/");f.pop();for(let m of h)m!=="."&&(m===".."?f.pop():f.push(m));return`url(${c}${f.join("/")}${p}${c})`})}var Er="(?:/\\*[^*]*\\*/)|[\\s;]",bo=new RegExp(`${Er}|\\b(0)px?`,"g"),wo=new RegExp(Er,"g");function st(e,t=!1){return t?e.replace(wo,""):e.replace(bo,"$1")}function So(e,t,r=!1){let n=Array.from(t.childNodes),o=[],i=0;if(n.length>1&&e&&typeof e=="string"){let s=st(e,r),a=s.length/e.length;for(let l=1;l<n.length;l++)if(n[l].textContent&&typeof n[l].textContent=="string"){let c=st(n[l].textContent,r),u=100,p=3;for(;p<c.length&&(c[p].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,p),1)!==-1);p++);for(;p<c.length;p++){let f=c.substring(0,p),h=s.split(f),m=-1;if(h.length===2)m=h[0].length;else if(h.length>2&&h[0]===""&&n[l-1].textContent!=="")m=s.indexOf(f,1);else if(h.length===1){if(f=f.substring(0,f.length-1),h=s.split(f),h.length<=1)return o.push(e),o;p=u+1}else p===c.length-1&&(m=s.indexOf(f));if(h.length>=2&&p>u){let d=n[l-1].textContent;if(d&&typeof d=="string"){let y=st(d).length;m=s.indexOf(f,y)}m===-1&&(m=h[0].length)}if(m!==-1){let d=Math.floor(m/a);for(;d>0&&d<e.length;){if(i+=1,i>50*n.length)return o.push(e),o;let y=st(e.substring(0,d),r);if(y.length===m){o.push(e.substring(0,d)),e=e.substring(d),s=s.substring(m);break}else y.length<m?d+=Math.max(1,Math.floor((m-y.length)/a)):d-=Math.max(1,Math.floor((y.length-m)*a))}break}}}}return o.push(e),o}function Co(e,t){return So(e,t).join("/* rr_split */")}var ko=1,Mo=new RegExp("[^a-z0-9-_:]"),mt=-2;function Tr(){return ko++}function xo(e){if(e instanceof HTMLFormElement)return"form";let t=Ee(e.tagName);return Mo.test(t)?"div":t}var Le,hr,Ro=/^[^ \t\n\r\u000c]+/,Io=/^[, \t\n\r\u000c]+/;function Eo(e,t){if(t.trim()==="")return t;let r=0;function n(i){let s,a=i.exec(t.substring(r));return a?(s=a[0],r+=s.length,s):""}let o=[];for(;n(Io),!(r>=t.length);){let i=n(Ro);if(i.slice(-1)===",")i=_e(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=_e(e,i);let a=!1;for(;;){let l=t.charAt(r);if(l===""){o.push((i+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,o.push((i+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return o.join(", ")}var pr=new WeakMap;function _e(e,t){return!t||t.trim()===""?t:Wt(e,t)}function To(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Wt(e,t){let r=pr.get(e);if(r||(r=e.createElement("a"),pr.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Or(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?_e(e,n):r==="srcset"?Eo(e,n):r==="style"?pt(n,Wt(e)):t==="object"&&r==="data"?_e(e,n):n)}function Nr(e,t,r){return["video","audio"].includes(e)&&Ee(t)==="autoplay"}function Oo(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let o=e.classList[n];if(t.test(o))return!0}if(r)return e.matches(r)}catch{}return!1}function gt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?gt(M.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){let o=e.classList[n];if(t.test(o))return!0}return r?gt(M.parentNode(e),t,r):!1}function Lr(e,t,r,n){let o;if(xr(e)){if(o=e,!M.childNodes(o).length)return!1}else{if(M.parentElement(e)===null)return!1;o=M.parentElement(e)}try{if(typeof t=="string"){if(n){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(gt(o,t,n))return!0;if(r){if(n){if(o.closest(r))return!0}else if(o.matches(r))return!0}}catch{}return!1}function No(e,t,r){let n=e.contentWindow;if(!n)return;let o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){let a=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),o=!0,t()});return}let s="about:blank";if(n.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Lo(e,t,r){let n=!1,o;try{o=e.sheet}catch{return}if(o)return;let i=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),n=!0,t()})}function Ao(e,t){let{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:p={},inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:d=!1,cssCaptured:y=!1}=t,S=Do(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ee.Document,childNodes:[],compatMode:e.compatMode}:{type:ee.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ee.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return Fo(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:p,inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:d,rootId:S});case e.TEXT_NODE:return _o(e,{doc:r,needsMask:s,maskTextFn:c,rootId:S,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:ee.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:ee.Comment,textContent:M.textContent(e)||"",rootId:S};default:return!1}}function Do(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function _o(e,t){let{needsMask:r,maskTextFn:n,rootId:o,cssCaptured:i}=t,s=M.parentNode(e),a=s&&s.tagName,l="",c=a==="STYLE"?!0:void 0,u=a==="SCRIPT"?!0:void 0;return u?l="SCRIPT_PLACEHOLDER":i||(l=M.textContent(e),c&&l&&(l=pt(l,Wt(t.doc)))),!c&&!u&&l&&r&&(l=n?n(l,M.parentElement(e)):l.replace(/[\S]/g,"*")),{type:ee.Text,textContent:l||"",rootId:o}}function Fo(e,t){let{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:i,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:p,newlyAddedElement:f=!1,rootId:h}=t,m=Oo(e,n,o),d=xo(e),y={},S=e.attributes.length;for(let g=0;g<S;g++){let w=e.attributes[g];Nr(d,w.name,w.value)||(y[w.name]=Or(r,d,Ee(w.name),w.value))}if(d==="link"&&i){let g=Array.from(r.styleSheets).find(k=>k.href===e.href),w=null;g&&(w=Tt(g)),w&&(delete y.rel,delete y.href,y._cssText=w)}if(d==="style"&&e.sheet){let g=Tt(e.sheet);g&&(e.childNodes.length>1&&(g=Co(g,e)),y._cssText=g)}if(["input","textarea","select"].includes(d)){let g=e.value,w=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&g?y.value=ft({element:e,type:ht(e),tagName:d,value:g,maskInputOptions:s,maskInputFn:a}):w&&(y.checked=w)}if(d==="option"&&(e.selected&&!s.select?y.selected=!0:delete y.selected),d==="dialog"&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),d==="canvas"&&u){if(e.__context==="2d")ho(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let g=e.toDataURL(l.type,l.quality),w=r.createElement("canvas");w.width=e.width,w.height=e.height;let k=w.toDataURL(l.type,l.quality);g!==k&&(y.rr_dataURL=g)}}if(d==="img"&&c){Le||(Le=r.createElement("canvas"),hr=Le.getContext("2d"));let g=e,w=g.currentSrc||g.getAttribute("src")||"<unknown-src>",k=g.crossOrigin,x=()=>{g.removeEventListener("load",x);try{Le.width=g.naturalWidth,Le.height=g.naturalHeight,hr.drawImage(g,0,0),y.rr_dataURL=Le.toDataURL(l.type,l.quality)}catch(E){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?x():g.addEventListener("load",x);return}else console.warn(`Cannot inline img src=${w}! Error: ${E}`)}g.crossOrigin==="anonymous"&&(k?y.crossOrigin=k:g.removeAttribute("crossorigin"))};g.complete&&g.naturalWidth!==0?x():g.addEventListener("load",x)}if(["audio","video"].includes(d)){let g=y;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume}if(f||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),m){let{width:g,height:w}=e.getBoundingClientRect();y={class:y.class,rr_width:`${g}px`,rr_height:`${w}px`}}d==="iframe"&&!p(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let b;try{customElements.get(d)&&(b=!0)}catch{}return{type:ee.Element,tagName:d,attributes:y,childNodes:[],isSVG:To(e)||void 0,needBlock:m,rootId:h,isCustom:b}}function B(e){return e==null?"":e.toLowerCase()}function Ar(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function zo(e,t){if(t.comment&&e.type===ee.Comment)return!0;if(e.type===ee.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Ir(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(B(e.attributes.name).match(/^msapplication-tile(image|color)$/)||B(e.attributes.name)==="application-name"||B(e.attributes.rel)==="icon"||B(e.attributes.rel)==="apple-touch-icon"||B(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&B(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(B(e.attributes.property).match(/^(og|twitter|fb):/)||B(e.attributes.name).match(/^(og|twitter):/)||B(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(B(e.attributes.name)==="robots"||B(e.attributes.name)==="googlebot"||B(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(B(e.attributes.name)==="author"||B(e.attributes.name)==="generator"||B(e.attributes.name)==="framework"||B(e.attributes.name)==="publisher"||B(e.attributes.name)==="progid"||B(e.attributes.property).match(/^article:/)||B(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(B(e.attributes.name)==="google-site-verification"||B(e.attributes.name)==="yandex-verification"||B(e.attributes.name)==="csrf-token"||B(e.attributes.name)==="p:domain_verify"||B(e.attributes.name)==="verify-v1"||B(e.attributes.name)==="verification"||B(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Fe(e,t){let{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m={},inlineImages:d=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:E=!1,cssCaptured:I=!1}=t,{needsMask:R}=t,{preserveWhiteSpace:P=!0}=t;R||(R=Lr(e,s,a,R===void 0));let H=Ao(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,dataURLOptions:m,inlineImages:d,recordCanvas:y,keepIframeSrcFn:x,newlyAddedElement:E,cssCaptured:I});if(!H)return console.warn(e,"not serialized"),null;let U;n.hasNode(e)?U=n.getId(e):zo(H,h)||!P&&H.type===ee.Text&&!H.textContent.replace(/^\s+|\s+$/gm,"").length?U=mt:U=Tr();let T=Object.assign(H,{id:U});if(n.add(e,T),U===mt)return null;S&&S(e);let X=!l;if(T.type===ee.Element){X=X&&!T.needBlock,delete T.needBlock;let N=M.shadowRoot(e);N&&qe(N)&&(T.isShadowHost=!0)}if((T.type===ee.Document||T.type===ee.Element)&&X){h.headWhitespace&&T.type===ee.Element&&T.tagName==="head"&&(P=!1);let N={doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,cssCaptured:!1};if(!(T.type===ee.Element&&T.tagName==="textarea"&&T.attributes.value!==void 0)){T.type===ee.Element&&T.attributes._cssText!==void 0&&typeof T.attributes._cssText=="string"&&(N.cssCaptured=!0);for(let W of Array.from(M.childNodes(e))){let G=Fe(W,N);G&&T.childNodes.push(G)}}let F=null;if(xr(e)&&(F=M.shadowRoot(e)))for(let W of Array.from(M.childNodes(F))){let G=Fe(W,N);G&&(qe(F)&&(G.isShadow=!0),T.childNodes.push(G))}}let K=M.parentNode(e);return K&&je(K)&&qe(K)&&(T.isShadow=!0),T.type===ee.Element&&T.tagName==="iframe"&&No(e,()=>{let N=e.contentDocument;if(N&&b){let F=Fe(N,{doc:N,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});F&&b(e,F)}},g),T.type===ee.Element&&T.tagName==="link"&&typeof T.attributes.rel=="string"&&(T.attributes.rel==="stylesheet"||T.attributes.rel==="preload"&&typeof T.attributes.href=="string"&&Ir(T.attributes.href)==="css")&&Lo(e,()=>{if(w){let N=Fe(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});N&&w(e,N)}},k),T}function Po(e,t){let{mirror:r=new dt,blockClass:n="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:p,maskInputFn:f,slimDOM:h=!1,dataURLOptions:m,preserveWhiteSpace:d,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:g,stylesheetLoadTimeout:w,keepIframeSrcFn:k=()=>!1}=t,x=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:u===!1?{password:!0}:u,E=Ar(h);return Fe(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:x,maskTextFn:p,maskInputFn:f,slimDOMOptions:E,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:d,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:g,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1})}var Ot=class e{constructor(...t){v(this,"parentElement",null),v(this,"parentNode",null),v(this,"ownerDocument"),v(this,"firstChild",null),v(this,"lastChild",null),v(this,"previousSibling",null),v(this,"nextSibling",null),v(this,"ELEMENT_NODE",1),v(this,"TEXT_NODE",3),v(this,"nodeType"),v(this,"nodeName"),v(this,"RRNodeType")}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function re(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var De=`Please stop import mirror directly. Instead of that,\r
|
|
2
2
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
3
3
|
or you can use record.mirror to access the mirror instance during recording.`,mr={map:{},getId(){return console.error(De),-1},getNode(){return console.error(De),null},removeNodeFromMap(){console.error(De)},has(){return console.error(De),!1},reset(){console.error(De)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(mr=new Proxy(mr,{get(e,t,r){return t==="map"&&console.error(De),Reflect.get(e,t,r)}}));function Ze(e,t,r={}){let n=null,o=0;return function(...i){let s=Date.now();!o&&r.leading===!1&&(o=s);let a=t-(s-o),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),o=s,e.apply(l,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(l,i)},a))}}function bt(e,t,r,n,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(s){setTimeout(()=>{r.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>bt(e,t,i||{},!0)}function Dr(e){var t,r,n,o;let i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:i.documentElement.scrollLeft||i?.body&&((t=M.parentElement(i.body))==null?void 0:t.scrollLeft)||((r=i?.body)==null?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:i?.documentElement.scrollTop||i?.body&&((n=M.parentElement(i.body))==null?void 0:n.scrollTop)||((o=i?.body)==null?void 0:o.scrollTop)||0}}function _r(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Fr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function zr(e){return e?e.nodeType===e.ELEMENT_NODE?e:M.parentElement(e):null}function le(e,t,r,n){if(!e)return!1;let o=zr(e);if(!o)return!1;try{if(typeof t=="string"){if(o.classList.contains(t)||n&&o.closest("."+t)!==null)return!0}else if(gt(o,t,n))return!0}catch{}return!!(r&&(o.matches(r)||n&&o.closest(r)!==null))}function Uo(e,t){return t.getId(e)!==-1}function Rt(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===mt}function Pr(e,t){if(je(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let n=M.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?!1:n?Pr(n,t):!0}function Nt(e){return!!e.changedTouches}function $o(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Ur(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function $r(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Lt(e){return e?e instanceof Ot&&"shadowRoot"in e?!!e.shadowRoot:!!M.shadowRoot(e):!1}var At=class{constructor(){v(this,"id",1),v(this,"styleIDMap",new WeakMap),v(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}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 Br(e){var t;let r=null;return"getRootNode"in e&&((t=M.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&M.host(M.getRootNode(e))&&(r=M.host(M.getRootNode(e))),r}function Bo(e){let t=e,r;for(;r=Br(t);)t=r;return t}function Ho(e){let t=M.ownerDocument(e);if(!t)return!1;let r=Bo(e);return M.contains(t,r)}function Dt(e){let t=M.ownerDocument(e);return t?M.contains(t,e)||Ho(e):!1}var gr=(e,t)=>`${e}@${t}`,_t=class{constructor(){v(this,"frozen",!1),v(this,"locked",!1),v(this,"texts",[]),v(this,"attributes",[]),v(this,"attributeMap",new WeakMap),v(this,"removes",[]),v(this,"mapRemoves",[]),v(this,"movedMap",{}),v(this,"addedSet",new Set),v(this,"movedSet",new Set),v(this,"droppedSet",new Set),v(this,"removesSubTreeCache",new Set),v(this,"mutationCb"),v(this,"blockClass"),v(this,"blockSelector"),v(this,"maskTextClass"),v(this,"maskTextSelector"),v(this,"inlineStylesheet"),v(this,"maskInputOptions"),v(this,"maskTextFn"),v(this,"maskInputFn"),v(this,"keepIframeSrcFn"),v(this,"recordCanvas"),v(this,"inlineImages"),v(this,"slimDOMOptions"),v(this,"dataURLOptions"),v(this,"doc"),v(this,"mirror"),v(this,"iframeManager"),v(this,"stylesheetManager"),v(this,"shadowDomManager"),v(this,"processedNodeManager"),v(this,"unattachedDoc"),v(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),v(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let f of this.movedSet){let h=M.parentNode(f);this.removesSubTreeCache.has(h)&&!this.movedSet.has(h)||this.addedSet.add(f)}let n=null,o=null,i=-1,s=null,a=!1,l=new Set,c=this.addedSet.values(),u=c.next();for(;this.addedSet.size;){if(n!==null&&this.addedSet.has(M.previousSibling(n)))s=n,n=M.previousSibling(n);else{for(this.addedSet.has(u.value)||(u=c.next()),n=u.value;;){if(o=M.parentNode(n),this.addedSet.has(o)){n=o;continue}break}if(l.has(o))o=null;else if(o){if(Dt(o)?(a=yr(this.droppedSet,o)||this.removesSubTreeCache.has(o),a&&yr(this.movedSet,n)&&(a=!1)):a=!0,this.addedSet.has(M.lastChild(o)))n=M.lastChild(o),s=null;else for(;;){if(s=M.nextSibling(n),this.addedSet.has(s)){n=s;continue}break}if(i=je(o)?this.mirror.getId(Br(n)):this.mirror.getId(o),i===-1&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let d=M.host(o);i=this.mirror.getId(d)}}}if(this.addedSet.delete(n),!o||i===-1){l.add(n);continue}else if(a){this.droppedSet.add(n);continue}let f=!1;if(n.nodeType===Node.TEXT_NODE){let d=o.tagName;if(d==="TEXTAREA")continue;d==="STYLE"&&r.has(i)&&(f=!0)}let h=s?this.mirror.getId(s):null;for(;h===mt;)s=s&&M.nextSibling(s),h=s&&this.mirror.getId(s);if(h===-1){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",s),n=null;continue}let m=Fe(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:d=>{Ur(d,this.mirror)&&this.iframeManager.addIframe(d),$r(d,this.mirror)&&this.stylesheetManager.trackLinkElement(d),Lt(n)&&this.shadowDomManager.addShadowRoot(M.shadowRoot(n),this.doc)},onIframeLoad:(d,y)=>{this.iframeManager.attachIframe(d,y),this.shadowDomManager.observeAttachShadow(d)},onStylesheetLoad:(d,y)=>{this.stylesheetManager.attachLinkElement(d,y)},cssCaptured:f});m&&(t.push({parentId:i,nextId:h,node:m}),r.add(m.id))}let p={texts:this.texts.map(f=>{let h=f.node,m=M.parentNode(h);return m&&m.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m),{id:this.mirror.getId(h),value:f.value}}).filter(f=>!r.has(f.id)).filter(f=>this.mirror.has(f.id)),attributes:this.attributes.map(f=>{let{attributes:h}=f;if(typeof h.style=="string"){let m=JSON.stringify(f.styleDiff),d=JSON.stringify(f._unchangedStyles);m.length<h.style.length&&(m+d).split("var(").length===h.style.split("var(").length&&(h.style=f.styleDiff)}return{id:this.mirror.getId(f.node),attributes:h}}).filter(f=>!r.has(f.id)).filter(f=>this.mirror.has(f.id)),removes:this.removes,adds:t};!p.texts.length&&!p.attributes.length&&!p.removes.length&&!p.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(p))}),v(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(M.childNodes(t),o=>M.textContent(o)||"").join("");r.attributes.value=ft({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:ht(t),value:n,maskInputFn:this.maskInputFn})}),v(this,"processMutation",t=>{if(!Rt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let r=M.textContent(t.target);!le(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Lr(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,zr(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=Ee(r.tagName),o=t.attributeName,i=t.target.getAttribute(o);if(o==="value"){let a=ht(r);i=ft({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:this.maskInputFn})}if(le(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let s=this.attributeMap.get(t.target);if(n==="iframe"&&o==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)o="rr_src";else return;if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),o==="type"&&n==="input"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Nr(n,o))if(s.attributes[o]=Or(this.doc,n,Ee(o),i),o==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(let l of Array.from(r.style)){let c=r.style.getPropertyValue(l),u=r.style.getPropertyPriority(l);c!==a.style.getPropertyValue(l)||u!==a.style.getPropertyPriority(l)?u===""?s.styleDiff[l]=c:s.styleDiff[l]=[c,u]:s._unchangedStyles[l]=[c,u]}for(let l of Array.from(a.style))r.style.getPropertyValue(l)===""&&(s.styleDiff[l]=!1)}else o==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break}case"childList":{if(le(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{Dt(r)||this.shadowDomManager.removeShadowRootsIn(r);let n=this.mirror.getId(r),o=je(t.target)?this.mirror.getId(M.host(t.target)):this.mirror.getId(t.target);le(t.target,this.blockClass,this.blockSelector,!1)||Rt(r,this.mirror,this.slimDOMOptions)||!Uo(r,this.mirror)||(this.addedSet.has(r)?(Ft(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Pr(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[gr(n,o)]?Ft(this.movedSet,r):(this.removes.push({parentId:o,id:n,isShadow:je(t.target)&&qe(t.target)?!0:void 0}),Wo(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),v(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Rt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[gr(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);le(t,this.blockClass,this.blockSelector,!1)||(M.childNodes(t).forEach(n=>this.genAdds(n)),Lt(t)&&M.childNodes(M.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1,this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0}unlock(){this.locked=!1,this.emit()}};function Ft(e,t){e.delete(t),M.childNodes(t).forEach(r=>Ft(e,r))}function Wo(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),M.childNodes(n).forEach(o=>r.push(o)))}}function yr(e,t){return e.size===0?!1:Hr(e,t)}function Hr(e,t){if(e.has(t))return!0;let r=M.parentNode(t);return r?Hr(e,r):!1}var Ve;function Go(e){Ve=e}function jo(){Ve=void 0}var _=e=>Ve?(...r)=>{try{return e(...r)}catch(n){if(Ve&&Ve(n)===!0)return;throw n}}:e,Pe=new Set;function Ye(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Wr(e,t){let r=new _t;Pe.add(r),r.init(e);let[n,o]=Mr(),i=new n(_(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),()=>{i.disconnect(),Pe.delete(r),o()}}function qo({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=Ze(_(p=>{let f=Date.now()-a;e(s.map(h=>(h.timeOffset-=f,h)),p),s=[],a=null}),i),c=_(Ze(_(p=>{let f=Ye(p),{clientX:h,clientY:m}=Nt(p)?p.changedTouches[0]:p;a||(a=Xe()),s.push({x:h,y:m,id:n.getId(f),timeOffset:Xe()-a}),l(typeof DragEvent<"u"&&p instanceof DragEvent?A.Drag:p instanceof MouseEvent?A.MouseMove:A.TouchMove)}),o,{trailing:!1})),u=[re("mousemove",c,r),re("touchmove",c,r),re("drag",c,r)];return _(()=>{u.forEach(p=>p())})}function Vo({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){if(i.mouseInteraction===!1)return()=>{};let s=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,a=[],l=null,c=u=>p=>{let f=Ye(p);if(le(f,n,o,!0))return;let h=null,m=u;if("pointerType"in p){switch(p.pointerType){case"mouse":h=Ce.Mouse;break;case"touch":h=Ce.Touch;break;case"pen":h=Ce.Pen;break}h===Ce.Touch?ce[u]===ce.MouseDown?m="TouchStart":ce[u]===ce.MouseUp&&(m="TouchEnd"):Ce.Pen}else Nt(p)&&(h=Ce.Touch);h!==null?(l=h,(m.startsWith("Touch")&&h===Ce.Touch||m.startsWith("Mouse")&&h===Ce.Mouse)&&(h=null)):ce[u]===ce.Click&&(h=l,l=null);let d=Nt(p)?p.changedTouches[0]:p;if(!d)return;let y=r.getId(f),{clientX:S,clientY:b}=d;_(e)({type:ce[m],id:y,x:S,y:b,...h!==null&&{pointerType:h}})};return Object.keys(ce).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&s[u]!==!1).forEach(u=>{let p=Ee(u),f=c(u);if(window.PointerEvent)switch(ce[u]){case ce.MouseDown:case ce.MouseUp:p=p.replace("mouse","pointer");break;case ce.TouchStart:case ce.TouchEnd:return}a.push(re(p,f,t))}),_(()=>{a.forEach(u=>u())})}function Gr({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){let s=_(Ze(_(a=>{let l=Ye(a);if(!l||le(l,n,o,!0))return;let c=r.getId(l);if(l===t&&t.defaultView){let u=Dr(t.defaultView);e({id:c,x:u.left,y:u.top})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})}),i.scroll||100));return re("scroll",s,t)}function Xo({viewportResizeCb:e},{win:t}){let r=-1,n=-1,o=_(Ze(_(()=>{let i=_r(),s=Fr();(r!==i||n!==s)&&(e({width:Number(s),height:Number(i)}),r=i,n=s)}),200));return re("resize",o,t)}var Zo=["INPUT","TEXTAREA","SELECT"],vr=new WeakMap;function Ko({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:i,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function p(b){let g=Ye(b),w=b.isTrusted,k=g&&g.tagName;if(g&&k==="OPTION"&&(g=M.parentElement(g)),!g||!k||Zo.indexOf(k)<0||le(g,n,o,!0)||g.classList.contains(i)||s&&g.matches(s))return;let x=g.value,E=!1,I=ht(g)||"";I==="radio"||I==="checkbox"?E=g.checked:(a[k.toLowerCase()]||a[I])&&(x=ft({element:g,maskInputOptions:a,tagName:k,type:I,value:x,maskInputFn:l})),f(g,u?{text:x,isChecked:E,userTriggered:w}:{text:x,isChecked:E});let R=g.name;I==="radio"&&R&&E&&t.querySelectorAll(`input[type="radio"][name="${R}"]`).forEach(P=>{if(P!==g){let H=P.value;f(P,u?{text:H,isChecked:!E,userTriggered:!1}:{text:H,isChecked:!E})}})}function f(b,g){let w=vr.get(b);if(!w||w.text!==g.text||w.isChecked!==g.isChecked){vr.set(b,g);let k=r.getId(b);_(e)({...g,id:k})}}let m=(c.input==="last"?["change"]:["input","change"]).map(b=>re(b,_(p),t)),d=t.defaultView;if(!d)return()=>{m.forEach(b=>b())};let y=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),S=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&m.push(...S.map(b=>bt(b[0],b[1],{set(){_(p)({target:this,isTrusted:!1})}},!1,d))),_(()=>{m.forEach(b=>b())})}function yt(e){let t=[];function r(n,o){if(at("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||at("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||at("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||at("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let s=Array.from(n.parentRule.cssRules).indexOf(n);return o.unshift(s),r(n.parentRule,o)}else if(n.parentStyleSheet){let s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(s)}return o}return r(e,t)}function Ie(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Yo({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};let o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:_((u,p,f)=>{let[h,m]=f,{id:d,styleId:y}=Ie(p,t,r.styleMirror);return(d&&d!==-1||y&&y!==-1)&&e({id:d,styleId:y,adds:[{rule:h,index:m}]}),u.apply(p,f)})}),n.CSSStyleSheet.prototype.addRule=function(u,p,f=this.cssRules.length){let h=`${u} { ${p} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[h,f])};let i=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:_((u,p,f)=>{let[h]=f,{id:m,styleId:d}=Ie(p,t,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&e({id:m,styleId:d,removes:[{index:h}]}),u.apply(p,f)})}),n.CSSStyleSheet.prototype.removeRule=function(u){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let s;n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:_((u,p,f)=>{let[h]=f,{id:m,styleId:d}=Ie(p,t,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&e({id:m,styleId:d,replace:h}),u.apply(p,f)})}));let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:_((u,p,f)=>{let[h]=f,{id:m,styleId:d}=Ie(p,t,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&e({id:m,styleId:d,replaceSync:h}),u.apply(p,f)})}));let l={};lt("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(lt("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),lt("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),lt("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));let c={};return Object.entries(l).forEach(([u,p])=>{c[u]={insertRule:p.prototype.insertRule,deleteRule:p.prototype.deleteRule},p.prototype.insertRule=new Proxy(c[u].insertRule,{apply:_((f,h,m)=>{let[d,y]=m,{id:S,styleId:b}=Ie(h.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||b&&b!==-1)&&e({id:S,styleId:b,adds:[{rule:d,index:[...yt(h),y||0]}]}),f.apply(h,m)})}),p.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:_((f,h,m)=>{let[d]=m,{id:y,styleId:S}=Ie(h.parentStyleSheet,t,r.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,removes:[{index:[...yt(h),d]}]}),f.apply(h,m)})})}),_(()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=i,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([u,p])=>{p.prototype.insertRule=c[u].insertRule,p.prototype.deleteRule=c[u].deleteRule})})}function jr({mirror:e,stylesheetManager:t},r){var n,o,i;let s=null;r.nodeName==="#document"?s=e.getId(r):s=e.getId(M.host(r));let a=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(i=(o=r.ownerDocument)==null?void 0:o.defaultView)==null?void 0:i.ShadowRoot,l=a?.prototype?Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets"):void 0;return s===null||s===-1||!a||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)==null?void 0:c.call(this)},set(c){var u;let p=(u=l.set)==null?void 0:u.call(this,c);if(s!==null&&s!==-1)try{t.adoptStyleSheets(c,s)}catch{}return p}}),_(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Jo({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:_((a,l,c)=>{var u;let[p,f,h]=c;if(r.has(p))return i.apply(l,[p,f,h]);let{id:m,styleId:d}=Ie((u=l.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return(m&&m!==-1||d&&d!==-1)&&e({id:m,styleId:d,set:{property:p,value:f,priority:h},index:yt(l.parentRule)}),a.apply(l,c)})});let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:_((a,l,c)=>{var u;let[p]=c;if(r.has(p))return s.apply(l,[p]);let{id:f,styleId:h}=Ie((u=l.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return(f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,remove:{property:p},index:yt(l.parentRule)}),a.apply(l,c)})}),_(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}function Qo({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o,doc:i}){let s=_(l=>Ze(_(c=>{let u=Ye(c);if(!u||le(u,t,r,!0))return;let{currentTime:p,volume:f,muted:h,playbackRate:m,loop:d}=u;e({type:l,id:n.getId(u),currentTime:p,volume:f,muted:h,playbackRate:m,loop:d})}),o.media||500)),a=[re("play",s(Ae.Play),i),re("pause",s(Ae.Pause),i),re("seeked",s(Ae.Seeked),i),re("volumechange",s(Ae.VolumeChange),i),re("ratechange",s(Ae.RateChange),i)];return _(()=>{a.forEach(l=>l())})}function ei({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(l,c,u){let p=new i(l,c,u);return o.set(p,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),p};let s=Te(t.fonts,"add",function(a){return function(l){return setTimeout(_(()=>{let c=o.get(l);c&&(e(c),o.delete(l))}),0),a.apply(this,[l])}});return n.push(()=>{r.FontFace=i}),n.push(s),_(()=>{n.forEach(a=>a())})}function ti(e){let{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:i}=e,s=!0,a=_(()=>{let l=t.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;let c=[],u=l.rangeCount||0;for(let p=0;p<u;p++){let f=l.getRangeAt(p),{startContainer:h,startOffset:m,endContainer:d,endOffset:y}=f;le(h,n,o,!0)||le(d,n,o,!0)||c.push({start:r.getId(h),startOffset:m,end:r.getId(d),endOffset:y})}i({ranges:c})});return a(),re("selectionchange",a)}function ri({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:Te(r.customElements,"define",function(o){return function(i,s,a){try{t({define:{name:i}})}catch{console.warn(`Custom element callback failed for ${i}`)}return o.apply(this,[i,s,a])}})}function ni(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:p,fontCb:f,selectionCb:h,customElementCb:m}=e;e.mutationCb=(...d)=>{t.mutation&&t.mutation(...d),r(...d)},e.mousemoveCb=(...d)=>{t.mousemove&&t.mousemove(...d),n(...d)},e.mouseInteractionCb=(...d)=>{t.mouseInteraction&&t.mouseInteraction(...d),o(...d)},e.scrollCb=(...d)=>{t.scroll&&t.scroll(...d),i(...d)},e.viewportResizeCb=(...d)=>{t.viewportResize&&t.viewportResize(...d),s(...d)},e.inputCb=(...d)=>{t.input&&t.input(...d),a(...d)},e.mediaInteractionCb=(...d)=>{t.mediaInteaction&&t.mediaInteaction(...d),l(...d)},e.styleSheetRuleCb=(...d)=>{t.styleSheetRule&&t.styleSheetRule(...d),c(...d)},e.styleDeclarationCb=(...d)=>{t.styleDeclaration&&t.styleDeclaration(...d),u(...d)},e.canvasMutationCb=(...d)=>{t.canvasMutation&&t.canvasMutation(...d),p(...d)},e.fontCb=(...d)=>{t.font&&t.font(...d),f(...d)},e.selectionCb=(...d)=>{t.selection&&t.selection(...d),h(...d)},e.customElementCb=(...d)=>{t.customElement&&t.customElement(...d),m(...d)}}function oi(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};ni(e,t);let n;e.recordDOM&&(n=Wr(e,e.doc));let o=qo(e),i=Vo(e),s=Gr(e),a=Xo(e,{win:r}),l=Ko(e),c=Qo(e),u=()=>{},p=()=>{},f=()=>{},h=()=>{};e.recordDOM&&(u=Yo(e,{win:r}),p=jr(e,e.doc),f=Jo(e,{win:r}),e.collectFonts&&(h=ei(e)));let m=ti(e),d=ri(e),y=[];for(let S of e.plugins)y.push(S.observer(S.callback,r,S.options));return _(()=>{n?.(),o(),i(),s(),a(),l(),c(),u(),p(),f(),h(),m(),d(),y.forEach(S=>S())})}function at(e){return typeof window[e]<"u"}function lt(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var vt=class{constructor(t){v(this,"iframeIdToRemoteIdMap",new WeakMap),v(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,n,o){let i=n||this.getIdToRemoteIdMap(t),s=o||this.getRemoteIdToIdMap(t),a=i.get(r);return a||(a=this.generateIdFn(),i.set(r,a),s.set(a,r)),a}getIds(t,r){let n=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return r.map(i=>this.getId(t,i,n,o))}getRemoteId(t,r,n){let o=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let i=o.get(r);return i||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(o=>this.getRemoteId(t,o,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},zt=class{constructor(t){v(this,"iframes",new WeakMap),v(this,"crossOriginIframeMap",new WeakMap),v(this,"crossOriginIframeMirror",new vt(Tr)),v(this,"crossOriginIframeStyleMirror"),v(this,"crossOriginIframeRootIdMap",new WeakMap),v(this,"mirror"),v(this,"mutationCb"),v(this,"wrappedEmit"),v(this,"loadListener"),v(this,"unloadListener"),v(this,"attachedWindows",new Map),v(this,"messageHandler",r=>this.handleMessage(r)),v(this,"stylesheetManager"),v(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new vt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}addUnloadListener(t){this.unloadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.watchIframeWindow(t),(n=this.loadListener)==null||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}destroy(){window.removeEventListener("message",this.messageHandler),this.attachedWindows.forEach(t=>t())}watchIframeWindow(t){let r=t.contentWindow;if(!r||this.attachedWindows.has(r))return;let n=[],o=()=>{this.attachedWindows.delete(r),n.forEach(i=>{try{i()}catch{}})};this.attachedWindows.set(r,o),this.recordCrossOriginIframes&&n.push(re("message",this.messageHandler,r)),n.push(re("pagehide",i=>{var s;if(i.persisted)return;let a=r.document;o(),(s=this.unloadListener)==null||s.call(this,a)},r))}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let o=this.crossOriginIframeMap.get(t.source);if(!o)return;let i=this.transformCrossOriginEvent(o,r.data.event);i&&this.wrappedEmit(i,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case L.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let o=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,o),this.patchRootIdOnNode(r.data.node,o),{timestamp:r.timestamp,type:L.IncrementalSnapshot,data:{source:A.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case L.Meta:case L.Load:case L.DomContentLoaded:return!1;case L.Annotation:case L.Plugin:return r;case L.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case L.IncrementalSnapshot:switch(r.data.source){case A.Mutation:return r.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t);let i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(o.node,i)}),r.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),r.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),r.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case A.Drag:case A.TouchMove:case A.MouseMove:return r.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case A.ViewportResize:return!1;case A.MediaInteraction:case A.MouseInteraction:case A.Scroll:case A.CanvasMutation:case A.Input:return this.replaceIds(r.data,t,["id"]),r;case A.StyleSheetRule:case A.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case A.Font:return r;case A.Selection:return r.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),r;case A.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),r}}return!1}replace(t,r,n,o){for(let i of o)!Array.isArray(r[i])&&typeof r[i]!="number"||(Array.isArray(r[i])?r[i]=t.getIds(n,r[i]):r[i]=t.getId(n,r[i]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==ee.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}},Pt=class{constructor(t){v(this,"shadowDoms",new Map),v(this,"mutationCb"),v(this,"scrollCb"),v(this,"bypassOptions"),v(this,"mirror"),v(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,r){if(!qe(t)||this.shadowDoms.has(t))return;let n=[];this.shadowDoms.set(t,n);let o=Wr({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);n.push(o),n.push(Gr({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{this.shadowDoms.get(t)===n&&(t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(M.host(t))),n.push(jr({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)))},0)}removeShadowRootsIn(t){if(this.shadowDoms.size===0)return;let r=M.shadowRoot(t);r&&(this.shadowDoms.has(r)&&this.removeShadowRoot(r),this.removeShadowRootsIn(r)),M.childNodes(t).forEach(n=>this.removeShadowRootsIn(n))}removeShadowRoot(t){let r=this.shadowDoms.get(t);this.shadowDoms.delete(t),r?.forEach(It)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(Te(t.prototype,"attachShadow",function(o){return function(i){let s=o.call(this,i),a=M.shadowRoot(this);return a&&Dt(this)&&n.addShadowRoot(a,r),s}}))}reset(){this.restoreHandlers.forEach(It),this.restoreHandlers=[];let t=this.shadowDoms;this.shadowDoms=new Map,t.forEach(r=>r.forEach(It))}};function It(e){try{e()}catch{}}var ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ii=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(We=0;We<ze.length;We++)ii[ze.charCodeAt(We)]=We;var We,si=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=ze[t[r]>>2],o+=ze[(t[r]&3)<<4|t[r+1]>>4],o+=ze[(t[r+1]&15)<<2|t[r+2]>>6],o+=ze[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o},br=new Map;function ai(e,t){let r=br.get(e);return r||(r=new Map,br.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var qr=(e,t,r)=>{if(!e||!(Xr(e,t)||typeof e=="object"))return;let n=e.constructor.name,o=ai(r,n),i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function ut(e,t,r){if(e instanceof Array)return e.map(n=>ut(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,o=si(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ut(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[ut(e.data,t,r),e.width,e.height]};if(Xr(e,t)||typeof e=="object"){let n=e.constructor.name,o=qr(e,t,r);return{rr_type:n,index:o}}}}return e}var Vr=(e,t,r)=>e.map(n=>ut(n,t,r)),Xr=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o]);function li(e,t,r,n){let o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of i)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=Te(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...c){return le(this.canvas,r,n,!0)||setTimeout(()=>{let u=Vr(c,t,this);e(this.canvas,{type:Ue["2D"],property:s,args:u})},0),l.apply(this,c)}});o.push(a)}catch{let a=bt(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:Ue["2D"],property:s,args:[l],setter:!0})}});o.push(a)}return()=>{o.forEach(s=>s())}}function ui(e){return e==="experimental-webgl"?"webgl":e}function wr(e,t,r,n){let o=[];try{let i=Te(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!le(this,t,r,!0)){let c=ui(a);if("__context"in this||(this.__context=c),n&&["webgl","webgl2"].includes(c))if(l[0]&&typeof l[0]=="object"){let u=l[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[a,...l])}});o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(i=>i())}}function Sr(e,t,r,n,o,i){let s=[],a=Object.getOwnPropertyNames(e);for(let l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let c=Te(e,l,function(u){return function(...p){let f=u.apply(this,p);if(qr(f,i,this),"tagName"in this.canvas&&!le(this.canvas,n,o,!0)){let h=Vr(p,i,this),m={type:t,property:l,args:h};r(this.canvas,m)}return f}});s.push(c)}catch{let c=bt(e,l,{set(u){r(this.canvas,{type:t,property:l,args:[u],setter:!0})}});s.push(c)}return s}function ci(e,t,r,n){let o=[];return typeof t.WebGLRenderingContext<"u"&&o.push(...Sr(t.WebGLRenderingContext.prototype,Ue.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Sr(t.WebGL2RenderingContext.prototype,Ue.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}var Zr=`(function() {
|
|
4
4
|
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as g,c as v,d as O,e as b,f as P,g as R,i as W,j as D}from"./chunk-UPPUYIIH.js";import"./chunk-EFNCQJI3.js";var x="lc_replay_ack",U=()=>{try{let e=sessionStorage.getItem(x);return e?[e]:[]}catch{return[]}};function $(){let e={status:"awaiting_config",disabledReason:void 0,startReason:void 0,sampleRate:void 0,minDurationMs:void 0,triggers:void 0,matchedGroups:void 0,bufferLength:void 0,flushedBytes:0,confirmed:new Set(U()),rrwebError:void 0,rrwebErrors:0,bufferBytes:void 0,throttled:void 0};return Object.assign(e,{ack(t){if(!e.confirmed.has(t)){e.confirmed.add(t);try{sessionStorage.setItem(x,t)}catch{}}},props(t){let i=e.triggers?.(),r={$recording_status:e.status,$has_recording:e.confirmed.has(t)};e.disabledReason&&(r.$replay_disabled_reason=e.disabledReason),e.startReason&&(r.$session_recording_start_reason=e.startReason),e.sampleRate!==void 0&&(r.$replay_sample_rate=e.sampleRate),e.minDurationMs!==void 0&&(r.$replay_minimum_duration=e.minDurationMs),i&&(r.$replay_url_trigger_status=i.url,r.$replay_event_trigger_status=i.event,r.$replay_linked_flag_trigger_status=i.flag);let d=e.matchedGroups?.();d?.length&&(r.$replay_trigger_groups_matched=d),e.bufferLength&&(r.$replay_buffer_length=e.bufferLength()),e.flushedBytes&&(r.$replay_flushed_size=e.flushedBytes),e.rrwebError&&(r.$replay_rrweb_error=e.rrwebError),e.rrwebErrors&&(r.$replay_rrweb_error_count=e.rrwebErrors);let p=e.bufferBytes?.();p&&(r.$replay_buffer_size=p);let a=e.throttled?.();return a&&(r.$replay_throttled_mutations=a),r}})}var k="lucida_replay_url";function j(e,t,i,r=2e3){let d={},p=()=>{if(!i())return;let s=globalThis,o=t();try{e.intercom&&typeof s.Intercom=="function"&&d.intercom!==o&&(s.Intercom("update",{[k]:o}),d.intercom=o),e.crisp&&typeof s.$crisp?.push=="function"&&d.crisp!==o&&(s.$crisp.push(["set","session:data",[[[k,o]]]]),d.crisp=o)}catch{}};p();let a=setInterval(p,r);return()=>clearInterval(a)}var N=e=>{let t=$();e.eventExtras.push(n=>t.props(n));let i=e.config.replay??{},r=n=>{t.status="disabled",t.disabledReason=n};if(i.enabled===!1)return r("disabled_locally");let d=e.config.replayOwner??i.owner;if(!b(d))return d||console.warn("[lucida] replay is off: Watchtower is already recording this page. Set replayOwner: 'lucida' (or 'both') to record with Lucida too."),r("owner_watchtower");if(navigator.connection?.saveData)return r("data_saver");let a="idle",s,o=0,m=!1,C=location.href,h=()=>e.core.hasConsent("analytics")&&e.core.hasConsent("replay"),y=async n=>{if(a!=="idle")return;if(!h())return r("no_consent");a="starting",t.status="awaiting_config";let u=++o,l=await e.loadConfig(),f=g(l?.replay_never_record,C)||!!n&&g(l?.replay_never_record,location.href),c=f?null:v(i,l);if(u!==o)return void(a="idle");if(!c)return r(f?"never_record_page":"remote_disabled"),void(a="idle");let M=e.core.sessionId,S=c.trigger_groups.length>0,T=!!n?.sampling||S||R(M,"",c.sample_rate);if(t.sampleRate=S?void 0:c.sample_rate,t.minDurationMs=c.min_duration_ms,!T)return t.status="sampled",void(a="idle");t.status="lazy_loading",t.disabledReason=void 0;let{startRecorder:I}=await import("./recorder-4WIMQCLR.js");if(u!==o)return void(a="idle");s=I(e,c,t,n),a="on"},w=()=>{o++,s?.stop(),s=void 0,a="idle"};e.replay={start:async n=>{m=!1;let u=n===!0,l=f=>u||typeof n=="object"&&!!n[f];await y({sampling:n===void 0||l("sampling"),url_trigger:l("url_trigger"),event_trigger:l("event_trigger"),linked_flag:l("linked_flag")})},stop:()=>{m=!0,w(),r("stopped_manually")},pause:()=>s?.pause(),resume:()=>s?.resume(),tag:n=>e.client.capture("$replay_tag",{name:n,session_id:e.core.sessionId}),isRecording:()=>a==="on"&&!s?.paused()},e.core.onChange(n=>{n==="consent"&&(h()?m||y():(w(),r("no_consent")))}),y();let _=i.supportWidgets,E=_?.intercom||_?.crisp?j(_,()=>e.client.getReplayUrl(),()=>a==="on"&&!s?.paused()):void 0;return()=>{o++,s?.stop(),E?.()}};export{P as fnv1a32,b as lucidaRecords,D as pagePrivacy,g as policyMatches,N as replay,v as resolveReplay,R as sampled,O as urlAllowed,W as urlRules};
|
package/dist/toolbar.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as Guide, G as GuideStep, H as Host, M as Module } from './types-Dng5ldZO.js';
|
|
2
2
|
import '@lucida-analytics/sdk-core';
|
|
3
3
|
|
|
4
4
|
/** Session derived from the POST /v1/toolbar/exchange response (contract: sdks/browser/README.md). */
|