@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.
Files changed (85) hide show
  1. package/README.md +45 -0
  2. package/dist/autocapture.d.ts +1 -1
  3. package/dist/autocapture.js +1 -1
  4. package/dist/{banner-2TSKJ4WK.js → banner-7LEREYUH.js} +1 -1
  5. package/dist/{static/v0.1.3/chunk-32K5P5GN.js → chunk-536QABLP.js} +1 -1
  6. package/dist/{static/v0.1.3/chunk-O4W7SZ2X.js → chunk-EFNCQJI3.js} +1 -1
  7. package/dist/chunk-UPPUYIIH.js +1 -0
  8. package/dist/{client-DkIhkh91.d.ts → client-DZX6o-eI.d.ts} +2 -2
  9. package/dist/consent.d.ts +9 -3
  10. package/dist/consent.js +1 -1
  11. package/dist/core.d.ts +3 -3
  12. package/dist/core.js +3 -3
  13. package/dist/correlate.d.ts +1 -1
  14. package/dist/early-access.d.ts +1 -1
  15. package/dist/experiments.d.ts +1 -1
  16. package/dist/flags.d.ts +1 -1
  17. package/dist/forms.d.ts +1 -1
  18. package/dist/guides.d.ts +2 -1116
  19. package/dist/heatmaps.d.ts +1 -1
  20. package/dist/host-headers.d.ts +1 -1
  21. package/dist/index.d.ts +8 -4
  22. package/dist/index.js +2 -2
  23. package/dist/inspector.d.ts +1 -1
  24. package/dist/lucida.js +2 -2
  25. package/dist/recommendations.d.ts +1 -1
  26. package/dist/{recorder-P2QJ4AKY.js → recorder-4WIMQCLR.js} +1 -1
  27. package/dist/replay.d.ts +2 -2
  28. package/dist/replay.js +1 -1
  29. package/dist/static/v0/autocapture.js +1 -1
  30. package/dist/static/v0/{banner-2TSKJ4WK.js → banner-7LEREYUH.js} +1 -1
  31. package/dist/static/v0/{chunk-32K5P5GN.js → chunk-536QABLP.js} +1 -1
  32. package/dist/static/v0/{chunk-O4W7SZ2X.js → chunk-EFNCQJI3.js} +1 -1
  33. package/dist/static/v0/chunk-UPPUYIIH.js +1 -0
  34. package/dist/static/v0/consent.js +1 -1
  35. package/dist/static/v0/core.js +3 -3
  36. package/dist/static/v0/index.js +2 -2
  37. package/dist/static/v0/lucida.js +2 -2
  38. package/dist/static/v0/manifest.json +28 -0
  39. package/dist/static/{v0.1.3/recorder-P2QJ4AKY.js → v0/recorder-4WIMQCLR.js} +1 -1
  40. package/dist/static/v0/replay.js +1 -1
  41. package/dist/static/{v0.1.3 → v0.1.5}/autocapture.js +1 -1
  42. package/dist/static/{v0.1.3/banner-2TSKJ4WK.js → v0.1.5/banner-7LEREYUH.js} +1 -1
  43. package/dist/{chunk-32K5P5GN.js → static/v0.1.5/chunk-536QABLP.js} +1 -1
  44. package/dist/{chunk-O4W7SZ2X.js → static/v0.1.5/chunk-EFNCQJI3.js} +1 -1
  45. package/dist/static/v0.1.5/chunk-UPPUYIIH.js +1 -0
  46. package/dist/static/v0.1.5/consent.js +1 -0
  47. package/dist/static/v0.1.5/core.js +3 -0
  48. package/dist/static/v0.1.5/index.js +3 -0
  49. package/dist/static/v0.1.5/lucida.js +3 -0
  50. package/dist/static/v0.1.5/manifest.json +28 -0
  51. package/dist/static/{v0/recorder-P2QJ4AKY.js → v0.1.5/recorder-4WIMQCLR.js} +1 -1
  52. package/dist/static/v0.1.5/replay.js +1 -0
  53. package/dist/toolbar.d.ts +1 -1
  54. package/dist/{types-XbAgeGjz.d.ts → types-Dng5ldZO.d.ts} +52 -4
  55. package/dist/webmcp.d.ts +1 -1
  56. package/lucida-global.d.ts +24 -0
  57. package/package.json +7 -5
  58. package/storage.json +75 -0
  59. package/dist/chunk-UH2MVDMX.js +0 -1
  60. package/dist/static/v0/chunk-UH2MVDMX.js +0 -1
  61. package/dist/static/v0.1.3/chunk-UH2MVDMX.js +0 -1
  62. package/dist/static/v0.1.3/consent.js +0 -1
  63. package/dist/static/v0.1.3/core.js +0 -3
  64. package/dist/static/v0.1.3/index.js +0 -3
  65. package/dist/static/v0.1.3/integrity.json +0 -30
  66. package/dist/static/v0.1.3/lucida.js +0 -3
  67. package/dist/static/v0.1.3/replay.js +0 -1
  68. package/dist/types-Bgl5v0MP.d.ts +0 -972
  69. /package/dist/static/{v0.1.3 → v0.1.5}/chunk-AWIQCFGN.js +0 -0
  70. /package/dist/static/{v0.1.3 → v0.1.5}/chunk-FUE3SDQU.js +0 -0
  71. /package/dist/static/{v0.1.3 → v0.1.5}/correlate.js +0 -0
  72. /package/dist/static/{v0.1.3 → v0.1.5}/early-access.js +0 -0
  73. /package/dist/static/{v0.1.3 → v0.1.5}/experiments.js +0 -0
  74. /package/dist/static/{v0.1.3 → v0.1.5}/flags.js +0 -0
  75. /package/dist/static/{v0.1.3 → v0.1.5}/forms.js +0 -0
  76. /package/dist/static/{v0.1.3 → v0.1.5}/guides.js +0 -0
  77. /package/dist/static/{v0.1.3 → v0.1.5}/heatmaps.js +0 -0
  78. /package/dist/static/{v0.1.3 → v0.1.5}/host-headers.js +0 -0
  79. /package/dist/static/{v0.1.3 → v0.1.5}/inspector.js +0 -0
  80. /package/dist/static/{v0.1.3 → v0.1.5}/modules-FANMZRDJ.js +0 -0
  81. /package/dist/static/{v0.1.3 → v0.1.5}/persistent-SLVINN5A.js +0 -0
  82. /package/dist/static/{v0.1.3 → v0.1.5}/recommendations.js +0 -0
  83. /package/dist/static/{v0.1.3 → v0.1.5}/toolbar.js +0 -0
  84. /package/dist/static/{v0.1.3 → v0.1.5}/validation-HGJXZ553.js +0 -0
  85. /package/dist/static/{v0.1.3 → v0.1.5}/webmcp.js +0 -0
@@ -1,3 +0,0 @@
1
- var P=(t,e)=>()=>(t&&(e=t(t=0)),e);var $e,st,ge,te,ot=P(()=>{"use strict";$e="lc_consent",st=["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||$e;let r=e.storage.get(this.key);if(r)try{let s=JSON.parse(r);for(let o of st)typeof s[o]=="boolean"&&(this.state[o]=s[o]);this.decided=st.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 st)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 fn(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 J(t=Date.now()){if(t>Oe){Oe=t;let o=fn(2);ae=((o[0]??0)<<8|(o[1]??0))&1023}else ae++,ae>4095&&(Oe++,ae=0);let e=fn(8),n=new Uint8Array(16),r=Oe;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|ae>>8,n[7]=ae&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 Oe,ae,Ae=P(()=>{"use strict";Oe=0,ae=0});var gn,Ie,mn=P(()=>{"use strict";Ae();gn="lc_identity",Ie=class{constructor(e,n,r=!1,s=!1){this.storage=e;this.cookieless=r;let o=e.get(gn),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??J();this.s={distinct_id:a,anon_id:a,identified:s&&!!n},this.save()}}storage;cookieless;s;save(){this.storage.set(gn,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||J();this.s={distinct_id:n,anon_id:n,identified:!1},this.save()}}});function ie(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 hn(t){return t===0||t===408||t===429||t>=500}var Me=P(()=>{"use strict"});var Te,yn=P(()=>{"use strict";Me();Te=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(!hn(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(ie(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 vn(t,e,n){return typeof t=="number"&&Number.isInteger(t)&&t>=e&&t<=n?t*6e4:void 0}function $s(t,e){let n=Ps.exec(t);if(!n)return!0;let r=parseInt(n[1]+n[2],16);return r-e<=6e4&&e-r<=Cs}var it,Es,Rs,Cs,Ps,je,bn=P(()=>{"use strict";Ae();it="lc_session";Es=6e4,Rs=10*36e5,Cs=24*36e5,Ps=/^([0-9a-f]{8})-?([0-9a-f]{4})-7[0-9a-f]{3}-/i;je=class{constructor(e,n={}){this.storage=e;this.o=n;this.idleMs=Math.min(Rs,Math.max(Es,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=J();idleMs;maxMs;newOn;clock;bootstrapId;configure(e){this.o.idleMs===void 0&&(this.idleMs=vn(e.session_idle_minutes,1,600)??this.idleMs),this.o.maxMs===void 0&&(this.maxMs=vn(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(it);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&&$s(this.bootstrapId,r)?this.bootstrapId:J(r),start:r,last:r}),this.bootstrapId=void 0,s.last=r,e&&(s.campaign=e),this.storage.set(it,JSON.stringify(s)),{sessionId:s.id,windowId:this.windowId,isNew:a}}startedAt(){return this.read()?.start}reset(){this.storage.remove(it)}}});function _n(t,e){let n=t.get(e);if(n)try{return JSON.parse(n)}catch{return}}var Fe,Le,xn=P(()=>{"use strict";Fe=class{constructor(e,n="lc_props",r){this.storage=e;this.key=n;this.persist=r;this.p=_n(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)}},Le=class{constructor(e){this.storage=e;this.g=_n(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 Os(t,e){let n=new Date(t??e);return(Number.isNaN(n.getTime())?new Date(e):n).toISOString()}var me,kn=P(()=>{"use strict";ot();mn();yn();bn();xn();Ae();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 Ie(this.gated,e.bootstrapDistinctId,e.cookieless,e.bootstrapIdentified),this.session=new je(this.gated,{clock:this.clock,...e.session}),this.props=new Fe(this.gated,void 0,e.persistProperty),this.groupState=new Le(this.gated),this.queue=new Te({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")||J(),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",d=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,_={uuid:J(this.clock.now()),event:e,...g?{distinct_id:g}:{},timestamp:Os(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(d).length?{$set:d}:{},...Object.keys(p).length?{$set_once:p}:{},...!o&&r.$unset?.length?{$unset:r.$unset}:{},...h?{$groups:h}:{}},y=this.filter?this.filter(_):_;if(!y){this.c.log?.("dropped (policy)",e);return}this.c.log?.("capture",e,y),this.c.onCapture?.(y);for(let w of this.captureListeners)w(y);return s||o?this.queue.enqueue(y):this.pre.length<(this.c.queue?.maxQueueSize??1e3)&&this.pre.push(y),y}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);let n=e.consent_default;this.resolveConsent(n==="opt_in"||n==="opt_out"||n==="cookieless"?n:void 0)}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 at(t,e){return{event:wn,props:{$feature_flag:t,$enrolled:e},extra:{$set:{[De(t)]:e}}}}var wn,De,Sn=P(()=>{"use strict";wn="$early_access_opt_in",De=t=>`$feature_enrollment/${t}`});function ct(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(":"),[d,p]=l<0?[c,""]:[c.slice(0,l),c.slice(l+1).replace(/^ /,"")];d==="event"?o=p??"":d==="data"?a.push(p??""):d==="id"&&(i=p)}a.length&&t(i===void 0?{event:o,data:a.join(`
2
- `)}:{event:o,data:a.join(`
3
- `),id:i})}}}var Ne,lt=P(()=>{"use strict";Me();Ne=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=ie(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=ct(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 ut(t){let e=!1,n,r=new Ne({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 En=P(()=>{"use strict";lt()});function dt(t,e){let n=new Set,{whenConsented:r,disabled:s,...o}=e,i=new He({...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 He,Rn=P(()=>{"use strict";lt();Me();He=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=ie(n++,this.o.backoff))}catch(s){this.live(e)&&this.o.log?.("intervention stream error",s),r=ie(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=ct(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 pt(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[]}},d=g=>{let _=g.reduce((y,w)=>y+w.body.length,0);for(;g.length>s||_>o&&g.length>1;)_-=g.shift().body.length;g.length?e.set(r,JSON.stringify(g)):e.remove(r)},p=g=>{d([...l(),...g]),a??=setTimeout(()=>{a=void 0,h.drain()},n.retryMs??3e4)},h={async send(g,_,y){if(!i())return p([{url:g,body:_}]),{status:200};let w=await t.send(g,_,y);return w.status!==0?w:(p([{url:g,body:_}]),{status:200})},drain(){return c??=(async()=>{let g=l();if(!g.length||!i())return;e.remove(r);let _=[];for(let[y,w]of g.entries())if((await t.send(w.url,w.body)).status===0){_.push(...g.slice(y));break}_.length&&p(_)})().finally(()=>{c=void 0}),c}};return h}var Cn=P(()=>{"use strict"});function Pn(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 d=i[l-15],p=i[l-2],h=X(d,7)^X(d,18)^d>>>3,g=X(p,17)^X(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[d,p,h,,g,_,y,w]=c,E=w+(X(g,6)^X(g,11)^X(g,25))+(g&_^~g&y)+As[l]+i[l]|0,R=(X(d,2)^X(d,13)^X(d,22))+(d&p^d&h^p&h)|0;c.pop(),c.unshift(E+R|0),c[4]=c[4]+E|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 As,X,$n=P(()=>{"use strict";As=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]),X=(t,e)=>t>>>e|t<<32-e});function On(t){let e=t.split(".");if(e.length!==4)return;let n=[];for(let r of e){if(!Is.test(r)||Number(r)>255)return;n.push(Number(r))}return n}function js(t){if(t.includes("%"))return;let e=t,n=t.lastIndexOf(":"),r=t.slice(n+1);if(r.includes(".")){let d=On(r);if(!d)return;e=`${t.slice(0,n+1)}${(d[0]<<8|d[1]).toString(16)}:${(d[2]<<8|d[3]).toString(16)}`}let s=e.split("::");if(s.length>2)return;let o=d=>{if(d==="")return[];let p=[];for(let h of d.split(":")){if(!Ms.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(d=>[d>>8,d&255])}function An(t){return t.includes(":")?js(t):On(t)}function In(t){if(typeof t!="string")return;let e=An(t.trim());return e&&Fs(e)?e.slice(12):e}function Ls(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=In(s);c&&n.push({bytes:c,bits:c.length*8});continue}let i=An(s.slice(0,o)),a=s.slice(o+1);!i||!Ts.test(a)||Number(a)>i.length*8||n.push({bytes:i,bits:Number(a)})}return n}function Ds(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 Mn(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=In(e),o=Ls(n);return!s||!o.length?!1:o.some(i=>Ds(i,s))===(t==="ip_in_cidr")}}return!1}var Is,Ms,Ts,Fs,Tn=P(()=>{"use strict";Is=/^(0|[1-9]\d{0,2})$/,Ms=/^[0-9a-fA-F]{1,4}$/,Ts=/^(0|[1-9]\d*)$/;Fs=t=>t.length===16&&t.slice(0,10).every(e=>e===0)&&t[10]===255&&t[11]===255});function Us(t){let e=Hs.exec(t.trim());return e?Number(e[1])*qs[e[2]]:void 0}function Fn(t,e,n){if(typeof t=="number")return t*1e3;if(typeof t!="string")return;let r=t.trim();if(n){let o=Us(r);if(o!==void 0)return e-o*1e3}if(!Ns.test(r)&&!jn.test(r))return;let s=Date.parse(jn.test(r)?`${r}T00:00:00Z`:r);return Number.isNaN(s)?void 0:s}function Ln(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 Bs(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 d=n.parseVersion(r.slice(0,-1).join("."));if(!d)return;let p=[...d];return p[p.length-1]=p[p.length-1]+1,[d,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 Dn(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=Fn(e,r,!1),i=Fn(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=Bs(t,n,s);return!!o&&!!i&&Ln(o,i[0])>=0&&Ln(o,i[1])<0}}return!1}var Ns,jn,Hs,qs,Nn=P(()=>{"use strict";Ns=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/,jn=/^\d{4}-\d{2}-\d{2}$/,Hs=/^-?(\d{1,6})([hdwmy])$/,qs={h:3600,d:86400,w:604800,m:2592e3,y:31536e3}});function ft(t){if(typeof t=="number")return t;if(typeof t=="string"&&Ws.test(t.trim()))return Number(t.trim())}function gt(t,e){let n=typeof t=="number",r=typeof e=="number";return n||r?n&&r&&t===e:t===e}function ht(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 mt(t,e){let n=ht(t),r=ht(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=mt(e,r);if(c===void 0)return!1;a=c===0}else a=gt(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=mt(e,r);else{let c=ft(e),l=ft(r);a=c===void 0||l===void 0?void 0:Vs(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=>gt(e,a))===(t==="in"):!1}return t.startsWith("array_")||t.startsWith("ip_")?Mn(t,e,r,gt):Dn(t,e,r,o,{toFloat:ft,parseVersion:ht,cmpVersion:mt})}var Ws,Vs,yt=P(()=>{"use strict";Tn();Nn();Ws=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;Vs=(t,e)=>t<e?-1:t>e?1:0});function bt(t){return t.properties?.length?`${t.key}|${JSON.stringify(t.properties.map(e=>[e.key,e.op,e.value??null]))}`:t.key}function Hn(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 _t(t,e){let n=e[t.scope??"session"]?.[bt(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 Un(t,e,n){for(let o of t.runtime??[])if(o.filters.every(a=>{if(a.type!=="flag")return _t(a,e);let c=n(a.key);return!!c&&ne(a.op,c.value,!0,a.value,!1)}))return Un(o.result,e,n);if(!t.runtime)return t;let{runtime:r,...s}=t;return s}function xt(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=Un(i,e,s);return n[o]=a,r.set(o,2),a};for(let o of Object.keys(t))s(o);return n}function qe(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 Ue(t,e){if(!vt(e))return e;let n=vt(t)?{...t}:{};for(let[r,s]of Object.entries(e))s===null?delete n[r]:n[r]=Ue(n[r],s);return n}var qn,vt,he,kt=P(()=>{"use strict";yt();qn=t=>(t??[]).filter(e=>e.type==="event");vt=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);he=class{session={};page={};sid="";constructor(e){if(e&&typeof e.sid=="string"&&vt(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&&Hn(i,r)&&o.add(bt(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 Bn(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(Pn(s).slice(0,13),16)/Gs}function zs(t,e){return typeof e=="boolean"?typeof t=="boolean"?t===e:e:t===e}function Xs(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(!Ks.includes(t.context_kind??""))return!1;o=Bn(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 Ys(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 Wn(t,e){return Vn(t.aggregation,e)}function Vn(t,e){return t.kind==="group"?e.groups?.[t.group_type??""]:t.kind==="device"?e.device_id:t.kind==="context"?Bn(e,t.context_kind)?.key:e.bucketing_key||e.distinct_id}function Js(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,We(o,i.payload,e)):void 0}if(s===!0)return We(o,t.type==="json"?t.payload:void 0,e)}function We(t,e,n){let r=n.payload_patch===void 0||n.payload_patch===null?e:Ue(e,n.payload_patch);return r!==void 0&&(t.payload=r),t}function Zs(t,e){return!t.app_contexts?.length||!e.app_contexts?.length?!0:t.app_contexts.some(n=>e.app_contexts?.includes(n))}function Kn(t,e,n={}){if(!Zs(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"||!zs(l.value,c.value))return q("prerequisite_failed")}if(r)return q("requires_server");let s=Wn(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 d=l.aggregation?Vn(l.aggregation,e):s;if(!d){i++;continue}let p=!1,h=!0,g=!1;for(let y of l.filters??[]){if(y.type==="event"){if(e.runtime_events===void 0)g=!0;else if(!_t(y,e.runtime_events)){h=!1;break}continue}let w=y.type==="cohort"?e.cohorts?.[y.key]:void 0;if(w!==void 0){if(w===(y.op==="not_in"||y.op==="neq")){h=!1;break}}else if(y.type==="cohort"||y.type==="flag"&&n[y.key]?.reason==="requires_server")p=!0;else if(!Xs(y,e,n)){h=!1;break}}if(!h)continue;if(p)return wt(q("requires_server",c),a);let _=Qs(t,l,c,e,d);if(_)if(g)a.push({filters:qn(l.filters),result:_});else return wt(_,a)}return wt(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:Js(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=Ys(t,e,s);return i.value=i.variant=a.key,We(i,a.payload,e)}return We(i,t.type==="json"?t.payload:void 0,e)}function Gn(t){return[...(t.prerequisites??[]).map(e=>e.flag),...t.conditions.flatMap(e=>(e.filters??[]).filter(n=>n.type==="flag").map(n=>n.key))]}function St(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 Gn(a))o(l),(s.get(l)===1||r[l]?.reason==="prerequisite_cycle")&&(c=!0);r[i]=c?q("prerequisite_cycle"):eo(a,e,r),s.set(i,2)};for(let i of t)o(i.key);return r}function eo(t,e,n){return Be(t,e,n,[],new Set)}function Be(t,e,n,r,s){let[o,...i]=r;if(o===void 0){let _=new Set,y=new Proxy(n,{get:(R,T)=>(_.add(String(T)),R[T])}),w=Kn(t,e,y),E=[];for(let R of Gn(t))_.has(R)&&!s.has(R)&&!E.includes(R)&&n[R]?.runtime?.length&&E.push(R);return E.length?Be(t,e,n,E,new Set([...s,...E])):w}let a=Be(t,e,n,i,s),c=n[o],l=new Set([c.value]),d=[];for(let _ of zn(c)){if(l.has(_.value))continue;l.add(_.value);let y=Be(t,e,{...n,[o]:_},i,s);Xn(y,a)||d.push({filters:[{type:"flag",key:o,op:"eq",value:_.value}],result:y})}let p=[...d,...a.runtime??[]],{runtime:h,...g}=a;return p.length?{...g,runtime:p}:g}function zn(t){return(t.runtime??[]).flatMap(e=>{let{runtime:n,...r}=e.result;return[r,...zn(e.result)]})}function Xn(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(!Xn(n[o],r[o]))return!1;return!0}var Ks,Gs,q,wt,Et,Rt,Yn=P(()=>{"use strict";yt();kt();$n();Ks=["user","device","org"],Gs=16**13;q=(t,e=-1)=>({value:!1,reason:t,condition_index:e});wt=(t,e)=>e.length?{...t,runtime:e}:t;Et=t=>t.reason==="requires_server",Rt=t=>t.reason!=="app_context_excluded"});function Ct(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 Jn=P(()=>{"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,Zn=P(()=>{"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 co(t){let e=so;for(let n of ao.encode(t))e=(e^BigInt(n))*oo&io;return e}function nr(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=co(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 rr(t){let n=` ${t.toLowerCase().replace(/’/g,"'").replace(/[.,!?;:]/g," ").replace(/\s+/g," ").trim()} `,r=0;for(let o of er)n.includes(` ${o} `)&&(r++,n=n.split(` ${o} `).join(" "));let s=tr.filter(o=>n.includes(` ${o} `)).length;return r>s?-1:s>r?1:0}function lo(t){let e=sr(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 po(t){let e=sr(t).length;return e>=10&&e<=15}function Ot(t){let e=t;for(let[n,r]of uo)e=e.replace(n,s=>r(s)?fo(s):s);return e===t?void 0:e}function or(t){if(typeof t!="string")return;let e=t.toLowerCase();return/^[0-9a-f]{32}$/.test(e)?e:void 0}function go(t,e,n){let r=$t(e,n),s=Ot(r);return s===void 0?{[t]:r}:{[t]:s,$ai_text_redacted:!0}}function ar(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=nr(e);o!==void 0&&(s.$ai_text_hash=o),s.$ai_sentiment=rr(e)}return r?{...s,...go("$ai_text",e,no)}:s}function cr(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=$t(t.comment,ro);r.$ai_feedback_comment=Ot(s)??s}return t.messageIndex!==void 0&&(r.$ai_message_index=t.messageIndex),r}function Pt(t,e){let n=ir(t),r=_e(e,64);return{...n?{$ai_outcome:n}:{},...r?{$ai_resolution:r}:{}}}function mo(){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 lr(t={}){let e={$ai_conversation_id:t.conversationId||mo()},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",or(t.traceId)),e}var ce,to,no,ro,er,tr,ke,$t,so,oo,io,ao,sr,Qn,uo,fo,ir,_e,xe,ur=P(()=>{"use strict";ce={started:"$ai_conversation_started",message:"$ai_message",feedback:"$ai_feedback",ended:"$ai_conversation_ended",outcome:"$ai_outcome"},to=["resolved","unresolved","escalated","abandoned","error"],no=4e3,ro=2e3,er=["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"],tr=["thanks","thank you","great","perfect","awesome","helpful","that worked","works now","solved","exactly"],ke=t=>Array.from(t),$t=(t,e)=>ke(t).slice(0,e).join(""),so=0xcbf29ce484222325n,oo=0x100000001b3n,io=0xffffffffffffffffn,ao=new TextEncoder;sr=t=>ke(t).filter(e=>e>="0"&&e<="9").map(Number);Qn=String.raw`[\p{Alphabetic}\p{M}\p{Nd}\p{Pc}\p{Join_Control}]`,uo=[[new RegExp(String.raw`(?<!${Qn})\p{Nd}(?:[ -]?\p{Nd}){12,18}(?!${Qn})`,"gu"),lo],[/[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,po]];fo=t=>ke(t).map(e=>/\s/u.test(e)?e:"*").join("");ir=t=>typeof t=="string"&&to.includes(t)?t:void 0,_e=(t,e)=>typeof t=="string"&&t?$t(t,e):void 0;xe=class{next=0;common;emit;captureText;constructor(e,n={},r=!1){this.emit=e,this.captureText=r,this.common=lr(n)}get id(){return this.common.$ai_conversation_id}send(e,n){this.emit(e,{...this.common,...n})}start(){return this.send(ce.started,{}),this}message(e,n,r={}){let s=r.index??this.next,o=ar(e,n,s,this.captureText);return o?(this.next=s+1,this.send(ce.message,o),!0):!1}feedback(e){let n=cr(e,this.captureText);return n?(this.send(ce.feedback,n),!0):!1}end(e,n){this.send(ce.ended,Pt(e,n))}outcome(e,n){let r=Pt(e,n);return r.$ai_outcome?(this.send(ce.outcome,r),!0):!1}}});var we=P(()=>{"use strict";kn();ot();Sn();En();Rn();Cn();Yn();kt();Jn();Zn();ur()});function fr(t,e=90,n=Date.now){let r,s=()=>{try{return JSON.parse(t.get(pr)??"{}")}catch{return{}}};return()=>{let o=s();if(location.search!==r){r=location.search;let a=new URLSearchParams(r),c=!1;for(let l of Y){let d=a.get(l);d&&(o[l]={v:d.slice(0,512),t:n()},c=!0)}c&&t.set(pr,JSON.stringify(o))}let i={};for(let a of Y){let c=o[a];c&&n()-c.t<e*864e5&&(i[a]=c.v)}return i}}var Y,pr,Se=P(()=>{"use strict";Y=["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"],pr="lc_click_ids"});function Eo(t){let e={},n=new URLSearchParams(location.search);for(let r of[...re,...Y,...t]){let s=n.get(r);s&&(e[`$${r}`]=s)}return e}function xr(){let t=new URLSearchParams(location.search),e=re.map(n=>t.get(n)??"");return e.some(Boolean)?e.join("|"):void 0}function Ro(t){try{return t?new URL(t).hostname:""}catch{return""}}function Po(){let t=location.hash;return t.length>1?location.pathname+t.split("?")[0]:location.pathname}function kr(t,e,n=[],r=!1){let s={$current_url:Co(),$host:location.host,$pathname:r?Po():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=Eo(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:Ro(a)||"$direct",$initial_current_url:i};for(let[l,d]of Object.entries(o))c[`$initial_${l.slice(1)}`]=d;return{properties:s,$set_once:c}}var re,Co,Ve=P(()=>{"use strict";Se();re=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];Co=()=>location.href.replace(/([?&])__lc_toolbar=[^&#]*&?/,"$1").replace(/[?&]$/,"")});function Er(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 Rr=P(()=>{"use strict"});function Pr(t,e){let n=t,r=[...Ao,...e.maskParams??[],...e.maskCampaignParams?[...re,...Y]:[]];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(Cr).join("|")})=[^&]*`,"gi"),`$1$2=${jt}`)+i}return e.stripHash&&(n=n.replace(/#.*$/,"")),n}function Ft(t){let e=new RegExp(`^\\$(initial_|last_)?(${[...re,...Y].map(Cr).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]=jt:o==="$click_ids"&&i&&typeof i=="object"&&((s??={...r})[o]=Object.fromEntries(Object.keys(i).map(a=>[a,jt])));for(let o of Io){let i=(s??r)[o];if(typeof i!="string")continue;let a=Pr(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 jt,Ao,Io,Cr,Lt=P(()=>{"use strict";Se();Ve();jt="<masked>",Ao=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","api_key","apikey","key","auth","authorization","code","otp","email","ssn"],Io=["$current_url","$referrer","$initial_referrer","$initial_current_url","$last_current_url"],Cr=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});function _i(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(_i(n),"i").test(e)}catch{return!1}})}var ts=P(()=>{"use strict"});we();var ho=["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 dr(t,e=[]){let n=t.toLowerCase();return e.some(r=>r&&n.includes(r.toLowerCase()))?!0:ho.some(r=>n.includes(r))&&!/\bcubot\b/.test(n)}Se();function yo(t,e){let n=document.createElement("style");return e&&n.setAttribute("nonce",e),n.textContent=t,n}function vo(){return Array.from(document.querySelectorAll("meta[http-equiv]")).filter(t=>t.getAttribute("http-equiv")?.toLowerCase()==="content-security-policy").map(t=>t.getAttribute("content")??"")}function mr(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 hr(t,e){if(typeof document>"u")return()=>{};!e&&vo().some(mr)&&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 bo=(t,e)=>t.slice(0,e);function gr(t){try{let e=new URL(t);return e.protocol==="data:"||e.protocol==="blob:"?e.protocol:e.origin+e.pathname}catch{return bo(t,64)}}function At(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:gr(i.blockedURI??""),$csp_source_file:i.sourceFile?gr(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 _o=["chrome-extension:","moz-extension:","safari-web-extension:","ms-browser-extension:"],It=()=>typeof location<"u"&&_o.includes(location.protocol),yr=(t,e,n)=>`${t.replace(/\/+$/,"")}/static/v${e}/${n}`,xo={replay:"replay",heatmaps:"heatmaps",forms:"forms",toolbar:"toolbar",guides:"guides",inspector:"inspector",experiments:"visualChanges","early-access":"earlyAccess",consent:"consentBanner"},ko=t=>import(t);async function wo(t,e,n,r=ko){return(await Promise.all(t.map(async o=>{let i=xo[o];if(!i)return n("unknown module",o);try{let a=(await r(yr(e.assetHost,e.version,`${o}.js`)))[i];return typeof a=="function"?a:n("module has no export",o,i)}catch(a){return n("module failed to load",o,a)}}))).filter(o=>!!o)}function vr(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 br(t,e,n,r){if(!r)return{transport:t,fetch:e};let s=o=>vr(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 So="__LUCIDA_DEVTOOLS_HOOK__";function _r(t,e,n){let r=globalThis[So];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 Mt="_lcid";var wr=(t,e)=>e.some(n=>{let r=n.replace(/^\./,"").toLowerCase();return t.toLowerCase()===r||t.toLowerCase().endsWith(`.${r}`)}),$o=(t,e=Date.now(),n)=>`${t}.${e.toString(36)}${n?`_${n}`:""}`;function Oo(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 Sr(t){if(!t?.length)return;let e=new URL(location.href),n=e.searchParams.get(Mt);if(n!==null){e.searchParams.delete(Mt),history.replaceState(history.state,"",e.toString());try{if(document.referrer&&!wr(new URL(document.referrer).hostname,t))return}catch{return}return Oo(n)}}var Tt=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||!wr(o.hostname,e))return;let i=new URL(o.href);i.searchParams.set(Mt,$o(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)}};Rr();Lt();function Mo(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 Ar(t,e=Math.random){return n=>t>=1?n:t<=0||e()>=t?null:{...n,properties:{...n.properties,$sample_rate:t}}}function Ir(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 Dt="lc_person_identified",Ke="lc_pending_set_once",$r=new Set(["$identify","$create_alias","$groupidentify"]),Or="$$client_ingestion_warning",To=6e4,Nt=class{constructor(e,n){this.mode=e;this.storage=n;this.identified=n.get(Dt)==="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(Dt,"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(Dt),this.storage.remove(Ke)}};function jo(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?Mo(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 Fo(t){let e=t.beforeSend?Array.isArray(t.beforeSend)?t.beforeSend:[t.beforeSend]:[];return[Ft(t.urlPrivacy??{}),...t.propertyDenylist?.length?[Ir(t.propertyDenylist)]:[],...t.sampleRate!==void 0?[Ar(t.sampleRate)]:[],...e]}function Mr(t,e,n,r=Date.now){let s=new Nt(e.personProfiles??"always",t.storage),o,i,a=0,c=-1/0,l=()=>{a+=1,!(r()-c<To)&&(c=r(),queueMicrotask(()=>{let d=a;a=0,t.capture(Or,{$$client_ingestion_warning_message:`client rate limit dropped ${d} event(s)`,$dropped_count:d})}))};return t.setFilter(d=>(e.rateLimit!==o&&(o=e.rateLimit,i=o?Er(o):void 0),jo({hooks:Fo(e),person:s,limit:d.event===Or?void 0:i,log:n,onLimited:l},d))),s}var Ht=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)}},Lo=365,Do=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(" ")),No=new Set("co com net org edu gov gob go ac or ne ltd plc sch mil nom".split(" "));function Ho(t){let e=t.toLowerCase().split(".");for(let n=1;n<e.length-1;n++)if(Do.has(e.slice(n).join("."))||n===e.length-2&&e[n+1].length===2&&No.has(e[n]))return e.slice(n-1).join(".")}function qo(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 Ho(t)}var Ge=class{constructor(e={}){this.o=e}o;domain=null;attr(){if(this.domain===null)try{this.domain=this.o.domain??(this.o.crossSubdomain?qo():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??Lo)*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{}}},le=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{}}},qt=class extends le{constructor(){super("localStorage")}},Uo=["lc_identity","lc_session","lc_device_id","lc_consent","lc_person_identified"],Ut=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)}},ze=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()}},Bt=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 Ht;let r=Xe(e),s=t==="cookie"?new Ge(n):t==="localStorage+cookie"?new Ut(new Ge(n),new qt,o=>Uo.some(i=>o===i+r)):new le(t);return new Bt(s,r)}function Tr(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 Bo(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 jr(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 Bo(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 Wt={send:async()=>({status:200})};var Wo="lucida-browser",Fr="0.1.3",Vt="lc_internal",Vo=3e3,Gt="https://capture.lucidace.com",Kt=t=>!!t&&typeof t=="object"&&Object.getPrototypeOf(t)===Object.prototype;function zt(t,e={},n=[]){let r=!!e.debug||typeof location<"u"&&/[?&]__(lc|lucida)_debug=(1|true)/.test(location.search),s=(...u)=>{r&&console.debug("[lucida]",...u)},o=(e.apiHost??Gt).replace(/\/+$/,""),i=Object.fromEntries(Object.entries(e).map(([u,m])=>[u,Kt(m)?{...m}:m]));i.apiHost=o;let a=e.extension??It(),c=u=>a&&(u==="cookie"||u==="localStorage+cookie")?e.extensionPersistence??"localStorage":u,l=c(e.cookieless==="always"?"none":e.persistence??"cookie"),d=[o,...e.flagsApiHost?[e.flagsApiHost.replace(/\/+$/,"")]:[]],p=e.fetch??((...u)=>fetch(...u)),h=u=>br(u,p,d,e.rewritePath),g=h(Wt).fetch,_=e.consent?.respectDnt,y=navigator.globalPrivacyControl===!0,w=(e.respectDnt??_)===!0&&navigator.doNotTrack==="1"||(e.respectGpc??_)===!0&&y,E=e.blockBots!==!1&&typeof navigator<"u"&&dr(navigator.userAgent??"",e.blockedUserAgents),R=!!e.disabled||E;E&&s("bot user agent: capture disabled");let T,W=h(e.transport??jr(p,{headers:i.requestHeaders,onError:e.onRequestError,disableBeacon:e.disableBeacon})).transport;if(!e.transport&&e.offlineQueue!==!1&&l!=="memory"&&l!=="none"){let u=new te(new le(l==="sessionStorage"?"sessionStorage":"localStorage"),()=>v.hasConsent("analytics"));W=T=pt(W,u,{key:`lc_offline${Xe(t)}`,isOnline:()=>navigator.onLine!==!1})}let I=R?void 0:Sr(e.crossDomains),S=Ye(R?"memory":l,t,e.cookie),M=(e.storageWriteDelayMs??0)>0?new ze(S,e.storageWriteDelayMs):void 0,O=I?.sessionId??e.bootstrap?.sessionId,U,j=!1,H,L=[],v=new me({apiKey:t,apiHost:o,transport:R?Wt:W,storage:M??S,...e.consentPersistence&&!R?{consentStorage:Ye(c(e.consentPersistence),t,e.cookie)}:{},persistProperty:u=>!i.persistedProperties||i.persistedProperties.includes(u),...l==="none"?{cookieless:!0}:{},library:{name:Wo,version:Fr},consent:{...e.cookieless==="on_reject"?{cookielessOnReject:!0}:{},...e.consent,...e.consent?.geo&&!R?{awaitRemote:!0}:{},respectDnt:!0,dnt:w},queue:{...e.flushAt?{flushAt:e.flushAt}:{},...e.flushIntervalMs?{flushIntervalMs:e.flushIntervalMs}:{}},...I||e.bootstrap?.distinctId?{bootstrapDistinctId:I?.distinctId??e.bootstrap?.distinctId}:{},...e.bootstrap?.isIdentified&&!I?{bootstrapIdentified:!0}:{},session:{...e.session,...O?{bootstrapId:O}:{}},enrich:(u,m)=>{let b=kr(u,m,i.customCampaignParams,e.capturePageview==="hash");if(o!==Gt&&(b.properties={...b.properties,$lib_custom_api_host:o}),L.length){let f=v.sessionId;for(let x of L)b.properties={...b.properties,...x(f)}}let A=H?.()??{},V=Object.keys(A);return V.length&&(b.properties={...b.properties,$click_ids:A},u==="$pageview"&&(b.$set_once={...Object.fromEntries(V.map(f=>[`$initial_${f}`,A[f]])),...b.$set_once},b.$set=Object.fromEntries(V.map(f=>[`$last_${f}`,A[f]])))),i.sendFeatureFlags!==!1&&u!=="$snapshot"&&U&&(b.properties={...Ct(U.all()),...b.properties}),j?{...b,properties:{...b.properties,$internal:!0}}:b},campaignKey:xr,log:s});j=v.storage.get(Vt)==="1",e.clickIds!==!1&&(H=fr(v.storage,e.clickIds?.expiryDays));let D=Mr(v,i,s);e.bootstrap?.isIdentified&&D.markIdentified();let Q=u=>D.blocksPersonWrites?(s(`personProfiles=never: ${u} ignored`),!0):!1;R||v.onChange(u=>{u!=="consent"||v.hasConsent("analytics")||v.consentStatus()!=="denied"||(M?.flush(),Tr(S,t,e.consent?.storageKey||$e))});let ue=[],B=[hr(s,e.nonce)],de=v.storage;if(e.flagPersistence&&!R){let u=new te(Ye(c(e.flagPersistence),t,e.cookie),()=>v.hasConsent("analytics"));v.onChange(m=>{m==="consent"&&(v.hasConsent("analytics")?u.flushBuffered():u.discardBuffered())}),de=u}let se=u=>{if(R)return;if(v.hasConsent("analytics"))return u();let m=!1;v.onChange(b=>{!m&&b==="consent"&&v.hasConsent("analytics")&&(m=!0,u())})},pe,k={core:v,client:void 0,config:i,flagStorage:de,apiKey:t,log:s,fetch:g,onUnload:u=>{ue.push(u)},whenConsented:se,onCapture:u=>v.onCaptured(u),eventExtras:L,clickExtras:[],flagPersonProps:[],loadConfig:()=>pe??=new Promise(u=>se(()=>{g(`${o}/v1/config?api_key=${encodeURIComponent(t)}`).then(m=>m.ok?m.json():null).then(m=>(m&&v.applyRemote(m),m)).then(u,()=>u(null))}))};if(v.consent.resolving){let u=g(`${o}/v1/config?api_key=${encodeURIComponent(t)}`,{credentials:"omit"}).then(b=>b.ok?b.json():null).catch(()=>null);pe=u;let m=setTimeout(()=>v.applyRemote({}),Vo);u.then(b=>{clearTimeout(m),v.applyRemote(b??{})})}let fe=dt(v,{apiHost:o,apiKey:t,fetch:g,whenConsented:se,log:s,disabled:R});B.push(()=>fe.stop());let oe={get distinctId(){return v.distinctId},capture:(u,m,b)=>{v.capture(u,m,b?.timestamp!==void 0?{timestamp:b.timestamp}:{})&&(b?.sendInstantly||b?.transport)&&v.flush(b.transport==="beacon"?{beacon:!0}:{})},identify:(u,m,b)=>{Q("identify")||(D.markIdentified(),v.identify(u,m,b))},alias:(u,m)=>{Q("alias")||(D.markIdentified(),v.alias(u,m))},reset:u=>{v.reset({resetDeviceId:!!u,reuseAnonymousId:!!e.reuseAnonymousId}),D.reset()},createPersonProfile:()=>{Q("createPersonProfile")||D.isProfile||(D.markIdentified(),v.capture("$set",{}))},setConfig:u=>{let m=i;for(let[b,A]of Object.entries(u)){let V=m[b];Kt(V)&&Kt(A)?Object.assign(V,A):m[b]=A}"debug"in u&&(r=!!u.debug)},setPersonProperties:(u,m)=>{!u&&!m||Q("setPersonProperties")||(D.markIdentified(),v.capture("$set",{},{...u?{$set:u}:{},...m?{$set_once:m}:{}}))},unsetPersonProperties:u=>{!u.length||Q("unsetPersonProperties")||(D.markIdentified(),v.capture("$set",{},{$unset:u}))},getSessionId:()=>v.sessionId,onSessionId:u=>v.onSessionId(m=>u(m)),getProperty:u=>v.getProperty(u),hasOptedOut:()=>!v.hasConsent("analytics"),getReplayUrl:u=>{let b=`${(e.uiHost??o).replace(/\/+$/,"")}/replays/${encodeURIComponent(v.sessionId)}`,A=v.sessionStart;return!u?.withTimestamp||A===void 0?b:`${b}?t=${Math.max(0,Math.round((Date.now()-A)/1e3-(u.timestampLookBackSeconds??10)))}`},debug:(u=!0)=>{r=u},featureView:(u,m)=>{v.capture("$feature_view",{...m,$feature_flag:u},{$set:{[`$feature_view/${u}`]:!0}})},featureInteraction:(u,m)=>{v.capture("$feature_interaction",{...m,$feature_flag:u},{$set:{[`$feature_interaction/${u}`]:!0}})},updateFlags:(u,m,b)=>k.flags?.update(u,m,b?.merge??!0),register:u=>v.register(u),registerOnce:u=>v.registerOnce(u),unregister:u=>v.unregister(u),group:(u,m,b)=>{D.markIdentified(),v.group(u,m,b)},optIn:()=>v.optIn(),optOut:()=>v.optOut(),optOutInternal:(u=!0)=>{j=u,u?v.storage.set(Vt,"1"):v.storage.remove(Vt)},get isInternal(){return j},setConsent:u=>v.setConsent(u),getConsent:()=>v.getConsent(),getConsentStatus:u=>v.getConsentStatus(u),consentStatus:()=>v.consentStatus(),getFlag:u=>k.flags?.get(u),getFlagPayload:u=>k.flags?.payload(u),getFlagResult:(u,m)=>k.flags?.result(u,m)??be(u,void 0,void 0,"not_found"),getLayerParam:(u,m,b)=>k.flags?.layerParam(u,m)??b,isFeatureEnabled:u=>{let m=k.flags?.get(u);return m!==void 0&&m!==!1},onFlags:u=>k.flags?.onChange(u)??(()=>{}),onIntervention:u=>fe.on(u),reloadFlags:()=>k.flags?.reload()??Promise.resolve(),getAllFlags:()=>k.flags?.all()??{},overrideFlags:(u,m)=>k.flags?.override(u,m),setPersonPropertiesForFlags:(u,m)=>k.flags?.setPersonProperties(u,m),resetPersonPropertiesForFlags:()=>k.flags?.resetPersonProperties(),setGroupPropertiesForFlags:(u,m)=>k.flags?.setGroupProperties(u,m),resetGroupPropertiesForFlags:()=>k.flags?.resetGroupProperties(),setContext:(u,m,b)=>k.flags?.setContext(u,m,b),clearContext:u=>k.flags?.clearContext(u),guides:{showChangelog:()=>k.guides?.showChangelog()??0,show:u=>k.guides?.show(u)??!1,reset:u=>k.guides?.reset(u)},ai:{startConversation:u=>new xe((m,b)=>oe.capture(m,b),u,i.ai?.captureText===!0).start()},earlyAccess:{list:()=>k.earlyAccess?.list()??Promise.resolve([]),optIn:u=>k.earlyAccess?.optIn(u),optOut:u=>k.earlyAccess?.optOut(u)},replay:{start:u=>k.replay?.start(u)??Promise.resolve(),stop:()=>k.replay?.stop(),pause:()=>k.replay?.pause(),resume:()=>k.replay?.resume(),tag:u=>k.replay?.tag(u),isRecording:()=>k.replay?.isRecording()??!1},consent:{showBanner:u=>k.consentUi?.showBanner(u)??Promise.resolve(null),hideBanner:()=>k.consentUi?.hideBanner()},loadToolbar:u=>k.toolbar?.load(typeof u=="string"?u:u.token)??Promise.resolve(!1),activateExperiment:u=>k.experiments?.activate(u),recommendations:(u,m)=>k.recs?.get(u,m)??Promise.resolve({placement:u,strategy:"",items:[],shown(){},clicked(){}}),flush:()=>v.flush(),shutdown:async()=>{for(let u of B)u();M?.flush(),await v.shutdown()}};if(k.client=oe,!R){let u=()=>{for(let b of ue)b();M?.flush(),v.flush({beacon:!0})};window.addEventListener("pagehide",u);let m=()=>{document.visibilityState==="hidden"&&v.flush({beacon:!0})};if(document.addEventListener("visibilitychange",m),B.push(()=>{window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",m)}),T){let b=()=>{T.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(At((A,V)=>{v.capture(A,V)},b))}for(let b of n){let A=b(k);A&&B.push(A)}U=k.flags,n.length||k.loadConfig(),_r(k,oe,o)}return s("initialised",{apiHost:o,consent:v.getConsent()}),oe}var Ko='[data-lc-region="article"]';function Lr(t,e,n){if(e.articles===!1)return()=>{};let r;t.loadConfig().then(y=>{typeof y?.article_selector=="string"&&(r=y.article_selector)});let s=()=>{for(let y of[e.articleSelector,r,Ko])if(y)try{let w=document.querySelector(y);if(w)return w}catch{}return null},o=location.href,i=location.pathname,a=null,c=0,l=!1,d=()=>{if(a??=s(),!a)return;let y=a.getBoundingClientRect();if(y.height<=0)return;let w=Math.round(Math.min(100,Math.max(0,(window.innerHeight-y.top)/y.height*100)));c=Math.max(c,w);let E=a.querySelector("h1,h2");E&&E.getBoundingClientRect().bottom<0&&(l=!0)},p=()=>{!a||!n()||(d(),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():d(),_=new MutationObserver(g);return _.observe(document.documentElement,{childList:!0,subtree:!0}),window.addEventListener("scroll",g,{passive:!0}),t.onUnload(p),d(),()=>{_.disconnect(),window.removeEventListener("scroll",g)}}var Je="data-lc-content",Go="data-lc-content-piece",zo="data-lc-content-target";var Xt=(t,e)=>(t.getAttribute(e)??"").trim().slice(0,200);function Dr(t,e,n){if(e.contentBlocks===!1||typeof IntersectionObserver>"u")return()=>{};let r=new WeakSet,s=d=>{let p={$content_name:Xt(d,Je)},h=Xt(d,Go),g=Xt(d,zo);return h&&(p.$content_piece=h),g&&(p.$content_target=g),p},o=location.href,i=new IntersectionObserver(d=>{for(let p of d)!p.isIntersecting||r.has(p.target)||!n()||(r.add(p.target),t.client.capture("$content_impression",s(p.target)))},{threshold:.5}),a=d=>d.querySelectorAll(`[${Je}]`).forEach(p=>i.observe(p));a(document);let c=new MutationObserver(()=>{location.href!==o&&(o=location.href,i.disconnect(),document.querySelectorAll(`[${Je}]`).forEach(d=>r.delete(d))),a(document)});c.observe(document.documentElement,{childList:!0,subtree:!0});let l=d=>{let p=d.target?.closest?.(`[${Je}]`);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 Xo=new Set(["input","textarea","select","option"]),Yo=["name","type","role","aria-label","title","alt","placeholder"],Jo=/(?:\d[ -]?){9,}/;function Zo(t){if(Xo.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||Jo.test(e)))return e.slice(0,255)}function Nr(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 Qo="***";function Qe(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 ei(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(d=>d.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 d of Array.from(t.attributes))(d.name.startsWith("data-lc-")||Yo.includes(d.name))&&!n(d.name)&&(l[d.name]=r(d.name,d.value.slice(0,255)));if(Object.keys(l).length&&(i.attrs=l),e){let d=Zo(t);d&&(i.text=d)}return i}function et(t,e,n,r,s={}){let o=[],i=Nr(r),a=Nr(s.allow),c=s.maskAll?(d,p)=>a(d)?p:Qo:(d,p)=>p,l=e;for(let d=t;d&&o.length<10;d=d.parentElement)o.push(ei(d,l,i,c)),(d===n||!n)&&(l=!1);return o}var Ze=t=>t.replace(/(["\\])/g,"\\$1");function tt(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 Z=[],ti=/^[+\-−–‹›<>«»←→↑↓▲▼▶◀^ˇ˄˅]$/,ni=/\b(increase|decrease|increment|decrement|plus|minus|add one|remove one|next|prev|previous|scroll (left|right))\b/i,ri=/(^|[-_\s])(stepper|spinner|quantity|qty|increment|decrement|inc|dec|plus|minus|carousel|slider|swiper|slick|glide|splide|arrow|next|prev)([-_\s]|$)/i,si="button,[role=button],a,input[type=button],input[type=submit],[role=spinbutton]";function oi(t,e=[]){if(e.length&&t.closest(e.join(","))||t.closest("input[type=number],[role=spinbutton],[role=slider]"))return!0;let n=t.closest(si)??t,r=`${n.getAttribute("aria-label")??""} ${n.getAttribute("title")??""}`;if(ti.test((n.textContent??"").trim())||ni.test(r))return!0;for(let s=n,o=0;s&&o<3;s=s.parentElement,o++)if(ri.test(s.getAttribute("class")??""))return!0;return!1}var ii=()=>typeof getSelection=="function"?(getSelection()?.toString()??"")!=="":!1;function Hr(t,e=Date.now(),n={},r){if(r&&n.ignoreSelectors?.length&&r.closest(n.ignoreSelectors.join(",")))return{};if(r&&n.suppressSteppers!==!1&&oi(r,n.stepperSelectors))return{};if(n.ignoreTextSelection!==!1&&ii())return{};let s=n.windowMs??1e3,o=n.radiusPx??30;for(Z.length&&e<Z[Z.length-1].t&&(Z.length=0),Z.push({t:e,x:t.clientX,y:t.clientY});Z.length&&e-Z[0].t>s;)Z.shift();let i=Z.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 qr(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 Ur=/^[A-Za-z_][\w-]*$/,ai=5;function ci(t){let e=[];for(let n=t;n&&e.length<ai;n=n.parentElement){let r=n.tagName.toLowerCase();if(n.id&&Ur.test(n.id)){e.unshift(`${r}#${n.id}`);break}let s=(n.getAttribute("class")??"").split(/\s+/).filter(o=>Ur.test(o)).slice(0,2);e.unshift(r+s.map(o=>`.${o}`).join(""))}return e.join(" ")}function Br(t,e,n,r,s={}){let o={$selector:ci(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,Hr(e,Date.now(),s.rageClicks||{},n));let i=s.deadClicks;!r&&e.isTrusted&&i!==!1&&!(i?.ignoreSelectors?.length&&n.closest(i.ignoreSelectors.join(",")))&&qr(t,o.$selector,i?.waitMs);for(let a of t.clickExtras)Object.assign(o,a(e,n));return o}var li="a,button,input,select,textarea,label,summary,[role=button],[role=link],[data-lc-capture]",ui="[data-lc-ignore]",Yt=t=>t.some(e=>typeof e=="string"?location.href.includes(e):e.test(location.href)),di=t=>!t?.length||Yt(t),Jt=t=>({maskAll:t.maskAllAttributes,allow:t.attributeAllowlist}),Ee=(t,e)=>!!t.closest(ui)||!!(e.denySelectors?.length&&t.closest(e.denySelectors.join(",")));function Wr(t,e,n){let r=e.events??["click","change","submit"],s=0,o=c=>{let l=c.target;!n()||c.isComposing||!(l instanceof Element)||Ee(l,e)||l instanceof HTMLInputElement&&l.type==="password"||(s+=1)},i=c=>l=>{if(!n())return;let d=l.target;if(!(d instanceof Element)||Ee(d,e)||e.allowSelectors?.length&&!d.closest(e.allowSelectors.join(","))||e.elementAllowlist?.length&&!d.closest(e.elementAllowlist.join(","))||!di(e.urlAllowlist)||c==="change"&&!/^(input|select|textarea)$/i.test(d.tagName)||d instanceof HTMLInputElement&&d.type==="password")return;let p=d.closest(li);if(c==="click"&&!p&&!e.allowSelectors?.length)return;let h=et(d,e.captureText??!0,p??void 0,e.attributeIgnore,Jt(e)),g=h.find(y=>y.text)?.text,_=s;s=0,t.client.capture("$autocapture",{...Qe(d),$event_type:c,..._>0?{$keystroke_count:_}:{},$elements:h,$elements_chain:tt(h),...g?{$el_text:g}:{},...c==="click"?Br(t,l,d,!!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 pi='[contenteditable]:not([contenteditable="false"])',Vr="input,textarea,select",fi=255;function gi(t){return t.replace(/\d(?:[ -]?\d){5,}/g,"***").replace(/[^\s@]+@[^\s@]+\.[^\s@]+/g,"***").replace(/\s+/g," ").trim().slice(0,fi)}var mi=t=>t?t instanceof Element?t:t.parentElement:null;function Kr(t,e,n){let r=e.events??["click","change","submit"],s=e.contentEditable!==!1&&r.includes("change"),o=new WeakSet,i=p=>{let h=et(p,!1,p,e.attributeIgnore,Jt(e));return{...Qe(p),$elements:h,$elements_chain:tt(h)}},a=p=>{let h=p instanceof Element?p.closest(pi):null;return h&&!Ee(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)}))},d=p=>{if(!n()||!e.copyCut)return;let h=typeof getSelection=="function"?getSelection():null,g=p.target instanceof Element?p.target:null,_=mi(h?.anchorNode)??g;if(!_||Ee(_,e)||_.closest(Vr)||g?.closest(Vr))return;let y=e.captureCopiedText?gi(h?.toString()??""):"";t.client.capture("$copy_autocapture",{$copy_type:p.type,...i(_),...y?{$selected_content:y}:{}})};return s&&(document.addEventListener("input",c,!0),document.addEventListener("focusout",l,!0)),document.addEventListener("copy",d,!0),document.addEventListener("cut",d,!0),()=>{document.removeEventListener("input",c,!0),document.removeEventListener("focusout",l,!0),document.removeEventListener("copy",d,!0),document.removeEventListener("cut",d,!0)}}var hi="[data-lc-ignore]",zr=["pdf","zip","gz","tar","rar","7z","doc","docx","xls","xlsx","ppt","pptx","csv","epub","dmg","exe","msi","pkg","apk","iso","mp3","mp4","mov"],Xr=["q","s","search","query"],Gr=t=>t.origin+t.pathname;function Yr(t,e,n){let r=Array.isArray(e.fileDownloads)?e.fileDownloads.map(o=>o.toLowerCase()):zr,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(hi))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()??""),d=l.includes(".")?l.split(".").pop().toLowerCase():"";e.fileDownloads!==!1&&(a.hasAttribute("download")||r.includes(d))?t.client.capture("$file_download",{$url:Gr(c),$file_name:l,$file_extension:d}):e.outboundLinks!==!1&&c.host!==location.host&&t.client.capture("$outbound_click",{$url:Gr(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:Xr,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 d=c.get(l)?.trim();if(d)return void t.client.capture("$site_search",{$search_term:d.slice(0,200),$search_param:l})}})}return()=>s.forEach(o=>o())}function Jr(t,e={}){t.capture("$page_not_found",{$status:404,...e})}var yi=[25,50,75],vi="data-lc-media-title";function Zr(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 bi=t=>(t.getAttribute(vi)??t.getAttribute("title")??t.getAttribute("aria-label")??"").trim().slice(0,200);function Qr(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:Zr(c)},d=bi(c);return d&&(l.$media_title=d),Number.isFinite(c.duration)&&(l.$media_duration=Math.round(c.duration)),l},o=c=>{let l=Zr(c);if(!l)return null;let d=r.get(c);return(!d||d.src!==l)&&r.set(c,d={src:l,played:!1,reached:new Set,done:!1}),d},i=c=>{let l=c.target;if(!(l instanceof HTMLMediaElement)||!n())return;let d=o(l);if(d)if(c.type==="play"){if(d.done&&Object.assign(d,{played:!1,reached:new Set,done:!1}),d.played)return;d.played=!0,t.client.capture("$media_play",s(l))}else if(c.type==="timeupdate"){if(!d.played||d.done||!Number.isFinite(l.duration)||l.duration<=0)return;let p=l.currentTime/l.duration*100;for(let h of yi)p>=h&&!d.reached.has(h)&&(d.reached.add(h),t.client.capture("$media_progress",{...s(l),$media_progress:h}))}else c.type==="ended"&&d.played&&!d.done&&(d.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 es(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)}}ts();var ns=255,xi=new Set(["input","textarea","select","option"]),ki="[data-lc-mask],.lc-mask,[data-lc-no-capture],.lc-no-capture,[data-lc-block]",wi=new Set(["value","password","autocomplete"]),Si=/(?:\d[ -]?){9,}/,Re=new WeakMap,Qt=new WeakMap;function rs(t,e){let n=Qt.get(t);if(n)return new Promise(r=>{let s=setTimeout(r,e);n.then(()=>(clearTimeout(s),r()))})}function Ei(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 Ri(t){if(!t||xi.has(t.tagName.toLowerCase())||t.isContentEditable)return!1;try{return!t.closest(ki)}catch{return!1}}function Ci(t,e){if(t.source==="attribute"){let r=(t.attribute??"").toLowerCase();if(!r||wi.has(r)||r.startsWith("on"))return;let s=e.getAttribute(r);return s===null?void 0:s.slice(0,ns)}let n=(e.textContent??"").replace(/\s+/g," ").trim();if(!(!n||Si.test(n)))return n.slice(0,ns)}function ss(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(!Ri(i))continue;let a=Ci(o,i);a!==void 0&&(s[o.name]=a)}return s}function os(t){let e=!0,n=t.loadConfig().then(r=>{e&&Re.set(t,Ei(r?.snapshot_properties)),Qt.delete(t)});return Qt.set(t,n),t.clickExtras.push((r,s)=>e?ss(Re.get(t)??[],"click",s):{}),()=>{e=!1,Re.delete(t)}}function is(t){let e=Re.get(t);return e?.length?ss(e,"pageview"):{}}function as(t){return!!Re.get(t)?.some(e=>e.events.includes("pageview"))}var Pi=t=>{try{return new URL(t).pathname}catch{return t}};function $i(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 cs(t){let e=0,n=0,r=()=>{let s=$i(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 Oi=800,Ai=t=>t.core.hasConsent("analytics");function Ii(t){return t==="history"?{path:!0,search:!0}:t==="hash"?{path:!0,search:!0,hash:!0}:typeof t=="object"?t:void 0}function Mi(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 nt(t,e,n={}){let r=n.views??!0,s=n.leave??!0,o=Ii(e),i=t.config.scrollRoot,a=location.href,c=a,l=Date.now(),d=cs(i),p=es(),h,g=()=>{if(!s||h===a)return;h=a;let{pct:O,px:U}=d.read();t.client.capture("$pageleave",{$current_url:a,$scroll_depth:O,$scroll_depth_px:U,$engagement_time_ms:p.read()})},_=!1,y=(O,U={})=>{if(!r)return;let{core:j}=t;if(!j.hasConsent("analytics")&&!j.anonymousOnReject&&!(j.consent.pending&&j.consent.queueBeforeConsent)){if(!_){_=!0;let H=()=>{_&&(_=!1,y())};t.whenConsented(H),j.onChange(L=>{L==="consent"&&j.anonymousOnReject&&H()})}return}t.client.capture("$pageview",{...is(t),...O===void 0?{}:{$referrer:O},...U})},w,E=()=>{let O=w;w=void 0,O?.()},R=O=>{if(location.href===c)return;let U=c;if(c=location.href,!o||!Mi(U,c,o))return;let j=a;g(),d.stop();let H=new Date(l);a=location.href,l=Date.now(),d=cs(i),p.reset();let L={$navigation_type:O,$prev_pageview_pathname:Pi(j),$prev_pageview_duration:Math.round((l-H.getTime())/100)/10};as(t)?setTimeout(()=>y(j,L),0):(E(),w=()=>y(j,L),queueMicrotask(E))};t.onUnload(g);let T=Ai(t)?rs(t,Oi):void 0;if(T?(w=()=>y(),t.onUnload(E),T.then(E)):y(),!o)return()=>(d.stop(),p.stop());let{pushState:W,replaceState:I}=history;history.pushState=function(...O){E(),W.apply(this,O),R("pushState")},history.replaceState=function(...O){E(),I.apply(this,O),R("replaceState")};let S=()=>R("popstate"),M=()=>R("hashchange");return window.addEventListener("popstate",S),o.hash&&window.addEventListener("hashchange",M),()=>{window.removeEventListener("hashchange",M),history.pushState=W,history.replaceState=I,window.removeEventListener("popstate",S),d.stop(),p.stop()}}var en=t=>{let e=[],n=t.config.autocapture,r=!1;if(n!==!1){let i=typeof n=="object"?n:{},a=()=>!r&&!(i.urlIgnorelist?.length&&Yt(i.urlIgnorelist));e.push(Wr(t,i,a),Kr(t,i,a),Yr(t,i,a),Dr(t,i,a),Lr(t,i,a),Qr(t,i,a),os(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(nt(t,s)):s!==!1?e.push(nt(t,s,{leave:!1})):o===!0&&e.push(nt(t,"history",{views:!1})),()=>e.forEach(i=>i())};we();var Ti="lc_preview",tn="lc_preview";function ji(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 ls(t){let e=new URL(t).searchParams.get(Ti),n=null;try{n=sessionStorage.getItem(tn)}catch{}return{forced:ji(e==="off"?null:e??n),persist(){try{e==="off"?sessionStorage.removeItem(tn):e&&sessionStorage.setItem(tn,e)}catch{}}}}Se();Ve();var nn="lc_flag_initial";function Fi(t){try{return t?new URL(t).hostname:""}catch{return""}}function Li(){let t=new URLSearchParams(location.search),e={$initial_referrer:document.referrer||"$direct",$initial_referring_domain:Fi(document.referrer)||"$direct",$initial_current_url:location.href.split("#")[0]};for(let n of[...re,...Y]){let r=t.get(n);r&&(e[`$initial_${n}`]=r)}return e}function ds(t,e){if(typeof location>"u")return{};let n=t.get(nn);if(n)try{return JSON.parse(n)}catch{}let r=Li();return e(()=>{t.get(nn)||t.set(nn,JSON.stringify(r))}),r}function Di(){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 ps(){if(typeof location>"u"||typeof navigator>"u")return{};let t={},e=new URLSearchParams(location.search);for(let s of[...re,...Y]){let o=e.get(s);o&&(t[`$${s}`]=o)}let{browser:n,os:r}=Di();return t.$browser=n,t.$os=r,t.$device_type=String(sn().$device_type??"Desktop"),t}function sn(){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:Ni(t)}}function Ni(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 Hi=/^[A-Za-z0-9_.-]{1,100}$/,qi=/^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*){0,5}$/,Ui=new Set(["__proto__","prototype","constructor"]),Bi=50,fs=200;function us(t,e){if(!qi.test(e))return;let n=t;for(let r of e.split(".")){if(Ui.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,fs);if(typeof n=="number"&&Number.isFinite(n)||typeof n=="boolean")return n}function Wi(){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,fs))}return t}function rn(t){let e={};if(!t||typeof window>"u")return e;let n=o=>Array.isArray(o)?o.filter(i=>typeof i=="string").slice(0,Bi):[],r=n(t.cookies).filter(o=>Hi.test(o));if(r.length){let o=Wi();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=us(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=us(s[i],o);if(a!==void 0){e[`$datalayer/${o}`]=a;break}}return e}var on=t=>{if(t.config.flagOptions?.disableRemote&&!t.config.localFlags?.length)return;let e;t.flagPersonProps.push(()=>e&&t.core.hasConsent("analytics")?rn(e):{}),t.loadConfig().then(n=>{let r=n?.flag_targeting_sources;!r||typeof r!="object"||(e=r,Object.keys(rn(r)).length&&t.flags?.reload())})};we();function an(t){return typeof t=="object"?t.value??t.variant??!!t.enabled:t}function cn(t){let e={value:an(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:cn(n.result)}))),e}var gs="lc_rt_events",ms=t=>!!t?.some(e=>e.conditions.some(n=>n.filters?.some(r=>r.type==="event")));function hs(t,e){let n;try{let i=t.flagStorage.get(gs);i&&(n=JSON.parse(i))}catch{}let r=new he(n),s={},o=qe(e,s);return{counts:()=>r.counts(t.core.sessionId),setServer(i){s=i,o=qe(e,s)},server:()=>s,drop(i){for(let a of i)delete s[a]},resolved(){return xt(s,r.counts(t.core.sessionId))},record(i,a,c){r.record(i,t.core.sessionId,a,o),c&&t.whenConsented(()=>t.flagStorage.set(gs,JSON.stringify(r.saved())))}}}var ln="lc_flags",un="lc_flag_overrides_api";function ys(t){try{let e=localStorage.getItem("lc_flag_overrides");return e?JSON.parse(e)[t]:void 0}catch{return}}var dn=t=>{let{core:e,config:n}=t,r={},s={},o={},i,a,c=!1,l=0,d=new Set,p=new Set,h="",g={},_=()=>Object.keys(g).length>0,y={},w={},E={},R=new Set,T=typeof location>"u"?{forced:{},persist(){}}:ls(location.href),W=Object.keys(T.forced).length>0,I=()=>({...r,...E}),S=t.config.flagOptions??{},M=new ve(S.cacheTtlMs),O=(t.config.flagsApiHost??t.config.apiHost).replace(/\/+$/,""),U=S.keys?.length?new Set(S.keys):void 0,j=f=>U?Object.fromEntries(Object.entries(f).filter(([x])=>U.has(x))):f,H=(f,x,C=!0)=>{if(r=j(f),s=j(x),c=!0,C)for(let $ of R)$(I())},L=hs(t,n.localFlags),v=!1,D=()=>{v||(v=!0,queueMicrotask(()=>{v=!1,u()}))},Q=t.flagStorage.get(ln);if(Q)try{let f=JSON.parse(Q);r=f.values,s=f.payloads,o=Object.fromEntries(Object.keys(r).map(x=>[x,"cached"])),f.rt&&L.setServer(f.rt),M.restore(f),c=Object.keys(r).length>0}catch{}let ue=t.flagStorage.get(un);if(ue)try{E=JSON.parse(ue)}catch{}let B=n.bootstrap;if(B?.flags||B?.payloads){let f={...B.flags};for(let x of Object.keys(B.payloads??{}))f[x]??=!0;H({...r,...f},{...s,...B.payloads});for(let x of Object.keys(f))o[x]="bootstrap"}let de={},se=()=>({...S.autoProperties===!1?{}:ps(),...ds(e.storage,t.whenConsented),...Object.assign({},...t.flagPersonProps.map(f=>f())),...y}),pe=S.evaluationContexts?.length?{app_contexts:S.evaluationContexts}:{},k=(f=!0)=>{let x=n.localFlags;if(!x?.length)return!0;let C=n.localFlagsContext,$=St(x,{runtime_events:L.counts(),distinct_id:e.distinctId,...e.groups?{groups:e.groups}:{},...e.deviceId?{device_id:e.deviceId}:{},..._()?{contexts:g}:{},...pe,...C,person_properties:{...se(),...C?.person_properties},group_properties:{...C?.group_properties,...w}}),N={},F={},K=!1;for(let[ee,G]of Object.entries($))Et(G)?K=!0:Rt(G)&&(N[ee]=G.value,o[ee]=G.reason,G.payload!==void 0&&(F[ee]=G.payload));return de=N,H({...r,...N},{...s,...F},f),K},fe=f=>{let x={...r},C={...s};for(let[$,N]of Object.entries(L.resolved()))x[$]=N.value,o[$]=N.reason,N.payload!==void 0?C[$]=N.payload:delete C[$];H(x,C,f)},oe=ms(n.localFlags);t.onCapture(f=>{let x=oe||Object.keys(L.server()).length>0;if(L.record(f.event,f.properties,x),!x)return;let C=JSON.stringify([I(),s]);if(oe&&k(!1),fe(!1),JSON.stringify([I(),s])!==C)for(let $ of R)$(I())});let u=(f=!0)=>{let x=++l;return!k()||S.disableRemote||!f&&M.fresh(e.distinctId)?Promise.resolve():new Promise(C=>{t.whenConsented(()=>{if(x!==l)return C();T.persist();let $=new AbortController,N=setTimeout(()=>$.abort(),S.timeoutMs??1e4);t.fetch(`${O}/v1/flags`,{method:"POST",headers:{"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",signal:$.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:sn(),...e.deviceId?{device_id:e.deviceId}:{},..._()?{contexts:g}:{},...pe,...W?{preview:T.forced}:{},...S.keys?.length?{flag_keys:S.keys}:{}})}).then(F=>F.ok?F.json():Promise.reject(new Error(`status ${F.status}`))).then(F=>{if(x!==l)return;if(F.quota_limited)return a="quota_limited",t.log("flags quota limited; keeping cached values");a=F.errors_while_computing_flags?"errors_while_computing_flags":void 0;let K={},ee={},G={};for(let[Pe,z]of Object.entries(F.flags??{}))K[Pe]=an(z),typeof z=="object"&&z.payload!==void 0&&(ee[Pe]=z.payload),o[Pe]=typeof z=="object"&&typeof z.reason=="string"?z.reason:"remote",typeof z=="object"&&z.runtime?.length&&(G[Pe]=cn(z));i=F.request_id,L.setServer(G);let Ce=F.errors_while_computing_flags;H({...de,...Ce?r:{},...K},Ce?{...s,...ee}:ee,!1),fe(!0),t.flagStorage.set(ln,JSON.stringify({values:{...Ce?r:{},...K},payloads:{...Ce?s:{},...ee},rt:G,...M.mark(e.distinctId)})),t.log("flags loaded",K)}).catch(F=>{let K=/^status (\d+)/.exec(String(F?.message))?.[1];x===l&&(a=$.signal.aborted?"timeout":K?`api_error_${K}`:"connection_error"),t.log("flags fetch failed",F)}).finally(()=>{clearTimeout(N),C()})})})},m=f=>E[f]??ys(f)??r[f];t.flags={get(f){let x=m(f);if(x===void 0)return;if(f in T.forced||f in E)return x;let C=e.sessionId;C!==h&&(d.clear(),p.clear(),h=C),p.has(f)||(p.add(f),e.capture("$exposure",{$feature_flag:f,$feature_flag_response:x,...typeof x=="string"?{$feature_flag_variant:x}:{},...i?{$feature_flag_request_id:i}:{}}));let $=`${f}:${String(x)}`;return d.has($)||(d.add($),e.capture("$feature_flag_called",{$feature_flag:f,$feature_flag_response:x,...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}:{}})),x},all:()=>c||Object.keys(r).length||Object.keys(E).length?I():{},payload:f=>s[f],result(f,x){let C=x?.sendExposure===!1?m(f):this.get(f),$=f in E||ys(f)!==void 0?"override":f in T.forced?"preview":o[f]??"remote";return be(f,C,s[f],$)},layerParam(f,x){for(let[C,$]of Object.entries(s)){let N=$;if(N?.lc_layer!==f||!N.lc_params||!(x in N.lc_params))continue;let F=this.get(C);if(F!==void 0&&F!==!1)return N.lc_params[x]}},onChange(f){return R.add(f),c&&f(I()),()=>{R.delete(f)}},reload:u,update(f,x,C=!0){for(let $ of Object.keys(f))o[$]="pushed";L.drop(Object.keys(f)),H(C?{...r,...f}:{...f},C?{...s,...x}:{...x})},override(f,x){E=f?{...f}:{},f?x?.persist&&t.whenConsented(()=>t.flagStorage.set(un,JSON.stringify(E))):t.flagStorage.remove(un);for(let C of R)C(I())},setPersonProperties(f,x=!0){M.clear(),y={...y,...f},x&&D()},resetPersonProperties(){y={}},setGroupProperties(f,x=!0){M.clear();for(let[C,$]of Object.entries(f))w[C]={...w[C],...$};x&&D()},resetGroupProperties(){w={}},setContext(f,x,C){M.clear(),g={...g,[f]:{key:x,properties:C??{}}},D()},clearContext(f){M.clear();let{[f]:x,...C}=g;g=C,D()}},e.onChange(f=>{if(f==="reset"){g={},y={},w={},d.clear(),p.clear(),r={},s={},o={},i=void 0,a=void 0,L.setServer({}),M.clear(),t.flagStorage.remove(ln),k(!1);for(let x of R)x(I())}(f==="identify"||f==="reset"||f==="group")&&D()}),n.disableFlagsOnFirstLoad?k():u(!1);let b=n.flagStream,A;b&&!S.disableRemote&&t.whenConsented(()=>{A=ut({apiHost:O,apiKey:t.apiKey,fetch:t.fetch,reload:()=>{u()},visibility:{hidden:()=>document.visibilityState==="hidden",subscribe:f=>(document.addEventListener("visibilitychange",f),()=>document.removeEventListener("visibilitychange",f))},...typeof b=="object"&&b.pollMs!==void 0?{pollMs:b.pollMs}:{},log:t.log})});let V=S.refreshMs&&S.refreshMs>0&&!S.disableRemote?setInterval(()=>document.visibilityState!=="hidden"&&void u(!1),S.refreshMs):void 0;return()=>{A?.(),V&&clearInterval(V)}};function rt(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)),d=[...l.entries()].join("|");return t(c,l),[...l.entries()].join("|")===d?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,d)=>this.setRequestHeader(d,l))}return s.call(this,i)},()=>{window.fetch=e,n.open=r,n.send=s}}var vs="lucida.session_id";function Vi(t,e){return[...(t??"").split(",").map(r=>r.trim()).filter(r=>r&&!r.startsWith(`${vs}=`)),`${vs}=${encodeURIComponent(e)}`].join(",")}function Ki(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 bs=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)&&Ki(o,e.origins);return rt((o,i)=>{s(o)&&i.set("baggage",Vi(i.get("baggage"),r))})};var Gi="X-Lucida-Distinct-Id",zi="X-Lucida-Session-Id";function Xi(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 _s=t=>/^[\x20-\x7e]*$/.test(t)?t:encodeURIComponent(t),pn=t=>{let e=t.config.tracingHeaders;if(!e?.length)return;let{core:n}=t;return rt((r,s)=>{!n.hasConsent("analytics")||r.startsWith(t.config.apiHost)||!Xi(r,e)||(n.distinctId&&s.set(Gi,_s(n.distinctId)),s.set(zi,_s(n.sessionId)))})};Lt();we();var xs="lc_early_access",Yi=t=>{let{core:e}=t,n=()=>{try{return JSON.parse(e.storage.get(xs)??"{}")}catch{return{}}},r=(s,o)=>{e.storage.set(xs,JSON.stringify({...n(),[s]:o}));let i=at(s,o);e.capture(i.event,i.props,i.extra),t.flags?.reload()};t.flagPersonProps.push(()=>Object.fromEntries(Object.entries(n()).map(([s,o])=>[De(s),o]))),t.earlyAccess={list:()=>new Promise(s=>t.whenConsented(()=>{t.fetch(`${t.config.apiHost}/v1/early-access?api_key=${encodeURIComponent(t.apiKey)}`,{credentials:"omit"}).then(o=>o.ok?o.json():Promise.reject(new Error(`status ${o.status}`))).then(o=>{let i=n();s((o.features??[]).map(a=>({...a,enrolled:i[a.flag_key]===!0})))}).catch(o=>{t.log("early access fetch failed",o),s([])})})),optIn:s=>r(s,!0),optOut:s=>r(s,!1)}};var ws="lc_recs",ks="lc_recs_recent";function Ss(t,e,n,r){for(let s of r?[r]:n){let o=e(s)?.[ws];if(o&&typeof o=="object"&&(o.placement===t||r!==void 0&&o.placement===void 0))return{flag:s,cfg:o}}}var Ji=t=>{let{core:e}=t,n=t.config.recommendations??{},r=n.viewEvent??"$product_viewed",s=n.itemIdProperty??"item_id",o=[];try{let c=JSON.parse(e.storage.get(ks)??"[]");Array.isArray(c)&&(o=c.filter(l=>typeof l=="string").slice(0,20))}catch{}let i=()=>e.hasConsent("analytics"),a=c=>{c&&(o=[c,...o.filter(l=>l!==c)].slice(0,20),i()&&e.storage.set(ks,JSON.stringify(o)))};t.onCapture(c=>{let l=c.properties?.[s];c.event===r&&(typeof l=="string"||typeof l=="number")&&a(String(l))}),t.recs={viewed:a,async get(c,l={}){let d=Object.keys(t.flags?.all()??{}),p=Ss(c,S=>t.flags?.payload(S),d,l.flag),h=p?t.flags?.get(p.flag):void 0,g=new URLSearchParams({api_key:t.apiKey,placement:c});l.itemId&&g.set("item_id",l.itemId),i()&&o.length&&g.set("recent",o.filter(S=>S!==l.itemId).slice(0,10).join(","));let _=p?.cfg.strategy;typeof _=="string"&&g.set("strategy",_);let y=l.limit??p?.cfg.limit;typeof y=="number"&&y>0&&g.set("limit",String(Math.min(50,Math.floor(y)))),l.exclude?.length&&g.set("exclude",l.exclude.slice(0,50).join(","));let w={};try{let S=await t.fetch(`${t.config.apiHost}/v1/recommendations?${g}`,{credentials:"omit"});S.ok?w=await S.json():t.log("recommendations failed",S.status)}catch(S){t.log("recommendations failed",S)}let E=Array.isArray(w.items)?w.items:[],R=w.strategy??_??"",T={$recommendation_placement:c,$recommendation_strategy:R,...p?{$recommendation_flag:p.flag}:{},...h!==void 0?{$recommendation_variant:String(h)}:{}},W=!1,I={placement:c,strategy:R,items:E,...p?{flag:p.flag}:{},...h!==void 0?{variant:h}:{},shown(){W||!E.length||(W=!0,e.capture("$recommendation_shown",{...T,$recommendation_items:E.map(S=>S.item_id)}))},clicked(S){let M=E.findIndex(O=>O.item_id===S);e.capture("$recommendation_clicked",{...T,$recommendation_item:S,...M>=0?{$recommendation_position:M+1}:{}})}};return l.autoShown!==!1&&I.shown(),I}}};function Hl(t,e={},n=[]){return zt(t,e,[en,dn,on,bs,pn,Tt,...n])}export{Gt as DEFAULT_HOST,Fr as LIB_VERSION,ws as RECS_PAYLOAD_KEY,yr as assetUrl,en as autocapture,mr as blocksInlineStyle,At as captureCspViolations,zt as createClient,Tt as crossDomain,Ir as denylistHook,Yi as earlyAccess,rn as flagSourceProps,on as flagSources,dn as flags,pn as hostHeaders,Hl as init,It as isExtensionPage,wo as loadModules,Ss as placementFlag,Pr as privatizeUrl,Ji as recommendations,vr as rewriteUrl,Ar as sampleHook,yo as styleTag,Jr as tag404,Ft as urlPrivacyHook};
@@ -1,30 +0,0 @@
1
- {
2
- "autocapture.js": "sha384-yqIw/8143xRbmu8HiELoVnpJnj8TWt+EQ9SUSHRD0JtxFfR4XhjkArVULnrx//kJ",
3
- "banner-2TSKJ4WK.js": "sha384-w1orpJiH5Wow/JsCEcxnCi23hxGlf5nZY8WA7/BwPvg3B2ZQZFNozGHCKJ3HGHYq",
4
- "chunk-32K5P5GN.js": "sha384-lT5K2VSGKZUqDj09nuTtBPxRt/j3Lbs3SRVebsgvdPy/2SQUUnFiR+F/jkKefwEZ",
5
- "chunk-AWIQCFGN.js": "sha384-A61RArZKUbe7ZarfZgncIUGHewyOuFOpNwLNnphAYoY3H2yntooGO1kd+C52TUdv",
6
- "chunk-FUE3SDQU.js": "sha384-NTnWZnCMYuxeyByjHULooIO0xpvYR/REyH5DQ7oT+AuXBa/jQ4SpT219FV1tB9qX",
7
- "chunk-O4W7SZ2X.js": "sha384-35yhmBHXXwmWUBeCryV6uSFUsCIS62IAjdxIbY8LOEh+SaTvR1P3PEkaaEDytyKF",
8
- "chunk-UH2MVDMX.js": "sha384-90rfLT4vAFL+38cjKixSxPc0WJEmQqjLkiioZ+d1qgUXLpQgNdd5GyePk0TiWY5H",
9
- "consent.js": "sha384-5NMdCAqaUeTYWQ3S2e8ZWlWTSk6CqJ4oR6SD/SlRUOXXAe/mzsLWkSZbxTcc7ZVE",
10
- "core.js": "sha384-/kPfyY9WEMGTzh9H7BtHUJa2o3bUrGU/Kdqm+mAoMocbqvSsGKp+3Vq13dVpw6d1",
11
- "correlate.js": "sha384-GBRoLCX2uGUNdY119jf/Kdaw7pbXJOQ6gthHVo/p9T2WN/czR6uAk39QrCdPOOsV",
12
- "early-access.js": "sha384-5JZ6DWRYgfoeu7QgSPi8kvVlys4CZ6H2wWuvEEggc83iau5z0sJ8RQD1AXtLCjGQ",
13
- "experiments.js": "sha384-5smoFlAcR2T1XmBgazy5HGun22PvX5Pa7IKIKtONtN/CpNy6U9SDWb7W7Di9d5fR",
14
- "flags.js": "sha384-leEfAfEPD56SEaTBA0frnZvRvDk8p/tOilnGeNDqoRLUuR4e0uoVSY2z96lInBHN",
15
- "forms.js": "sha384-G61YPp3pr3ZeyhVNhHSjYIexf3/bmgQjZEUJrPrY5qP0ykMnXfk5PAgDK2ErLqF+",
16
- "guides.js": "sha384-ojyyhBUHcWeLxnIuFqEe/K8+CgHJCFT0Q85LsBpZtG+p+8k7jsGzDjPJon2SZQg1",
17
- "heatmaps.js": "sha384-drg7hBMqgcVNdV3zVr2Df+LJ+CMsf9lbeWugFixjEpyMBvEgEci5A1hWEjLZX5Vn",
18
- "host-headers.js": "sha384-8OsSDIVDEo3Lsk3G+L5xNJ4pkAYXDEAz+ggBK7sG1cj7tOITAXDKaM2EFtQCHGiF",
19
- "index.js": "sha384-rZEQ6VY+CtJXH3f30XBNqwRpI1zcV5Th5oHT51fMQe8rWiHUeqmbwKCFkVZoPZ+m",
20
- "inspector.js": "sha384-wCjcdzjbZ1mAYS3w19Io8NOJQfrnlmfDkinoan/0LUTqCw6M7OSR9QDwxDp6M5+T",
21
- "lucida.js": "sha384-Wbg0Y69c9Gqkc4cxzbmUXpnczR2dKutyOLklaVOZmqaaij9AxtP3gSSU3xuaC7/v",
22
- "modules-FANMZRDJ.js": "sha384-UjLSth+cPZTIxwMGFgoUEocqFSHXnM7IgYpICNSRRU7NTlFkfCg3WUNUbu8u04EP",
23
- "persistent-SLVINN5A.js": "sha384-DUvReNmdZNyY7aEE/oFQW7ZOS4J1CyyqE6eheXPBOv/zXqCViscg3GE74E9OSdRQ",
24
- "recommendations.js": "sha384-6XyPo/sQd1LNvQ87+vlgOLYe/ecapP9mmDeKlkTRx15d9gTAmDRwCPrX+n6zy2lx",
25
- "recorder-P2QJ4AKY.js": "sha384-kysxAMC/gOvNd/dtXV+dF2G6dTXnnrfGcXbnECAhkTVnIrQZ0nMsSSUJnd5EM8xf",
26
- "replay.js": "sha384-DmZ4TgYs/ekJ1Xe5wVhLaTyhVXA0KUoIRP9im71jvfMlgmmD99tWtP0eRYV68lUe",
27
- "toolbar.js": "sha384-5RaMXlQzkpgbv3L9JX67X8YdRd9s5/Kt5usUm4uqC0afaZkXTYbBkdInD2b0ORP3",
28
- "validation-HGJXZ553.js": "sha384-NmKcVVwg5IWD+ctqpalFATPXleIm4PFPkcQgQ3d/iUILxmjIC8tENjXFPibdEVTX",
29
- "webmcp.js": "sha384-Vs+fImvLlnbEZtId9H/pA4VXB1bVaxEjOYY+DcAUTN5pXXuNNFOYQfltuj2giALZ"
30
- }
@@ -1,3 +0,0 @@
1
- "use strict";(()=>{var C=(t,e)=>()=>(t&&(e=t(t=0)),e);var Pe,ot,ge,te,it=C(()=>{"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 nn(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=nn(2);ae=((o[0]??0)<<8|(o[1]??0))&1023}else ae++,ae>4095&&($e++,ae=0);let e=nn(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|ae>>8,n[7]=ae&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,ae,Oe=C(()=>{"use strict";$e=0,ae=0});var rn,Ae,sn=C(()=>{"use strict";Oe();rn="lc_identity",Ae=class{constructor(e,n,r=!1,s=!1){this.storage=e;this.cookieless=r;let o=e.get(rn),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(rn,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 ie(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 on(t){return t===0||t===408||t===429||t>=500}var Ie=C(()=>{"use strict"});var Me,an=C(()=>{"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(!on(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(ie(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 cn(t,e,n){return typeof t=="number"&&Number.isInteger(t)&&t>=e&&t<=n?t*6e4:void 0}function ms(t,e){let n=gs.exec(t);if(!n)return!0;let r=parseInt(n[1]+n[2],16);return r-e<=6e4&&e-r<=fs}var at,ds,ps,fs,gs,Te,ln=C(()=>{"use strict";Oe();at="lc_session";ds=6e4,ps=10*36e5,fs=24*36e5,gs=/^([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(ps,Math.max(ds,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=cn(e.session_idle_minutes,1,600)??this.idleMs),this.o.maxMs===void 0&&(this.maxMs=cn(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(at);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&&ms(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(at,JSON.stringify(s)),{sessionId:s.id,windowId:this.windowId,isNew:a}}startedAt(){return this.read()?.start}reset(){this.storage.remove(at)}}});function un(t,e){let n=t.get(e);if(n)try{return JSON.parse(n)}catch{return}}var Fe,je,dn=C(()=>{"use strict";Fe=class{constructor(e,n="lc_props",r){this.storage=e;this.key=n;this.persist=r;this.p=un(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)}},je=class{constructor(e){this.storage=e;this.g=un(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 hs(t,e){let n=new Date(t??e);return(Number.isNaN(n.getTime())?new Date(e):n).toISOString()}var me,pn=C(()=>{"use strict";it();sn();an();ln();dn();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 Fe(this.gated,void 0,e.persistProperty),this.groupState=new je(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:hs(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}:{}},y=this.filter?this.filter(x):x;if(!y){this.c.log?.("dropped (policy)",e);return}this.c.log?.("capture",e,y),this.c.onCapture?.(y);for(let w of this.captureListeners)w(y);return s||o?this.queue.enqueue(y):this.pre.length<(this.c.queue?.maxQueueSize??1e3)&&this.pre.push(y),y}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);let n=e.consent_default;this.resolveConsent(n==="opt_in"||n==="opt_out"||n==="cookieless"?n:void 0)}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 ct(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,lt=C(()=>{"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=ie(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=ct(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 ut(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 fn=C(()=>{"use strict";lt()});function dt(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,gn=C(()=>{"use strict";lt();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=ie(n++,this.o.backoff))}catch(s){this.live(e)&&this.o.log?.("intervention stream error",s),r=ie(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=ct(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 pt(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((y,w)=>y+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,y){if(!i())return p([{url:g,body:x}]),{status:200};let w=await t.send(g,x,y);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[y,w]of g.entries())if((await t.send(w.url,w.body)).status===0){x.push(...g.slice(y));break}x.length&&p(x)})().finally(()=>{c=void 0}),c}};return h}var mn=C(()=>{"use strict"});function hn(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,y,w]=c,E=w+(G(g,6)^G(g,11)^G(g,25))+(g&x^~g&y)+ys[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(E+R|0),c[4]=c[4]+E|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 ys,G,yn=C(()=>{"use strict";ys=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 vn(t){let e=t.split(".");if(e.length!==4)return;let n=[];for(let r of e){if(!vs.test(r)||Number(r)>255)return;n.push(Number(r))}return n}function xs(t){if(t.includes("%"))return;let e=t,n=t.lastIndexOf(":"),r=t.slice(n+1);if(r.includes(".")){let u=vn(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(!bs.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 bn(t){return t.includes(":")?xs(t):vn(t)}function _n(t){if(typeof t!="string")return;let e=bn(t.trim());return e&&ks(e)?e.slice(12):e}function ws(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=_n(s);c&&n.push({bytes:c,bits:c.length*8});continue}let i=bn(s.slice(0,o)),a=s.slice(o+1);!i||!_s.test(a)||Number(a)>i.length*8||n.push({bytes:i,bits:Number(a)})}return n}function Ss(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 xn(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=_n(e),o=ws(n);return!s||!o.length?!1:o.some(i=>Ss(i,s))===(t==="ip_in_cidr")}}return!1}var vs,bs,_s,ks,kn=C(()=>{"use strict";vs=/^(0|[1-9]\d{0,2})$/,bs=/^[0-9a-fA-F]{1,4}$/,_s=/^(0|[1-9]\d*)$/;ks=t=>t.length===16&&t.slice(0,10).every(e=>e===0)&&t[10]===255&&t[11]===255});function Ps(t){let e=Es.exec(t.trim());return e?Number(e[1])*Cs[e[2]]:void 0}function Sn(t,e,n){if(typeof t=="number")return t*1e3;if(typeof t!="string")return;let r=t.trim();if(n){let o=Ps(r);if(o!==void 0)return e-o*1e3}if(!Rs.test(r)&&!wn.test(r))return;let s=Date.parse(wn.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 $s(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=Sn(e,r,!1),i=Sn(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=$s(t,n,s);return!!o&&!!i&&Rn(o,i[0])>=0&&Rn(o,i[1])<0}}return!1}var Rs,wn,Es,Cs,Cn=C(()=>{"use strict";Rs=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/,wn=/^\d{4}-\d{2}-\d{2}$/,Es=/^-?(\d{1,6})([hdwmy])$/,Cs={h:3600,d:86400,w:604800,m:2592e3,y:31536e3}});function ft(t){if(typeof t=="number")return t;if(typeof t=="string"&&Os.test(t.trim()))return Number(t.trim())}function gt(t,e){let n=typeof t=="number",r=typeof e=="number";return n||r?n&&r&&t===e:t===e}function ht(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 mt(t,e){let n=ht(t),r=ht(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=mt(e,r);if(c===void 0)return!1;a=c===0}else a=gt(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=mt(e,r);else{let c=ft(e),l=ft(r);a=c===void 0||l===void 0?void 0:As(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=>gt(e,a))===(t==="in"):!1}return t.startsWith("array_")||t.startsWith("ip_")?xn(t,e,r,gt):En(t,e,r,o,{toFloat:ft,parseVersion:ht,cmpVersion:mt})}var Os,As,yt=C(()=>{"use strict";kn();Cn();Os=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;As=(t,e)=>t<e?-1:t>e?1:0});function bt(t){return t.properties?.length?`${t.key}|${JSON.stringify(t.properties.map(e=>[e.key,e.op,e.value??null]))}`:t.key}function Pn(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 _t(t,e){let n=e[t.scope??"session"]?.[bt(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 On(t,e,n){for(let o of t.runtime??[])if(o.filters.every(a=>{if(a.type!=="flag")return _t(a,e);let c=n(a.key);return!!c&&ne(a.op,c.value,!0,a.value,!1)}))return On(o.result,e,n);if(!t.runtime)return t;let{runtime:r,...s}=t;return s}function xt(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=On(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(!vt(e))return e;let n=vt(t)?{...t}:{};for(let[r,s]of Object.entries(e))s===null?delete n[r]:n[r]=Ne(n[r],s);return n}var $n,vt,he,kt=C(()=>{"use strict";yt();$n=t=>(t??[]).filter(e=>e.type==="event");vt=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);he=class{session={};page={};sid="";constructor(e){if(e&&typeof e.sid=="string"&&vt(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&&Pn(i,r)&&o.add(bt(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 An(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(hn(s).slice(0,13),16)/Ms}function Ts(t,e){return typeof e=="boolean"?typeof t=="boolean"?t===e:e:t===e}function Fs(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(!Is.includes(t.context_kind??""))return!1;o=An(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 js(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 In(t,e){return Mn(t.aggregation,e)}function Mn(t,e){return t.kind==="group"?e.groups?.[t.group_type??""]:t.kind==="device"?e.device_id:t.kind==="context"?An(e,t.context_kind)?.key:e.bucketing_key||e.distinct_id}function Ls(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 Ds(t,e){return!t.app_contexts?.length||!e.app_contexts?.length?!0:t.app_contexts.some(n=>e.app_contexts?.includes(n))}function Tn(t,e,n={}){if(!Ds(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"||!Ts(l.value,c.value))return q("prerequisite_failed")}if(r)return q("requires_server");let s=In(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?Mn(l.aggregation,e):s;if(!u){i++;continue}let p=!1,h=!0,g=!1;for(let y of l.filters??[]){if(y.type==="event"){if(e.runtime_events===void 0)g=!0;else if(!_t(y,e.runtime_events)){h=!1;break}continue}let w=y.type==="cohort"?e.cohorts?.[y.key]:void 0;if(w!==void 0){if(w===(y.op==="not_in"||y.op==="neq")){h=!1;break}}else if(y.type==="cohort"||y.type==="flag"&&n[y.key]?.reason==="requires_server")p=!0;else if(!Fs(y,e,n)){h=!1;break}}if(!h)continue;if(p)return wt(q("requires_server",c),a);let x=Hs(t,l,c,e,u);if(x)if(g)a.push({filters:$n(l.filters),result:x});else return wt(x,a)}return wt(q(i>0&&i===t.conditions.length?"no_bucketing_key":"no_condition_match"),a)}function Hs(t,e,n,r,s){let o=e.aggregation?void 0:Ls(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=js(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 St(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"):Ns(a,e,r),s.set(i,2)};for(let i of t)o(i.key);return r}function Ns(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,y=new Proxy(n,{get:(R,D)=>(x.add(String(D)),R[D])}),w=Tn(t,e,y),E=[];for(let R of Fn(t))x.has(R)&&!s.has(R)&&!E.includes(R)&&n[R]?.runtime?.length&&E.push(R);return E.length?qe(t,e,n,E,new Set([...s,...E])):w}let a=qe(t,e,n,i,s),c=n[o],l=new Set([c.value]),u=[];for(let x of jn(c)){if(l.has(x.value))continue;l.add(x.value);let y=qe(t,e,{...n,[o]:x},i,s);Ln(y,a)||u.push({filters:[{type:"flag",key:o,op:"eq",value:x.value}],result:y})}let p=[...u,...a.runtime??[]],{runtime:h,...g}=a;return p.length?{...g,runtime:p}:g}function jn(t){return(t.runtime??[]).flatMap(e=>{let{runtime:n,...r}=e.result;return[r,...jn(e.result)]})}function Ln(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(!Ln(n[o],r[o]))return!1;return!0}var Is,Ms,q,wt,Rt,Et,Dn=C(()=>{"use strict";yt();kt();yn();Is=["user","device","org"],Ms=16**13;q=(t,e=-1)=>({value:!1,reason:t,condition_index:e});wt=(t,e)=>e.length?{...t,runtime:e}:t;Rt=t=>t.reason==="requires_server",Et=t=>t.reason!=="app_context_excluded"});function Ct(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 Hn=C(()=>{"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,Nn=C(()=>{"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 Gs(t){let e=Ws;for(let n of zs.encode(t))e=(e^BigInt(n))*Vs&Ks;return e}function Wn(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=Gs(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 Vn(t){let n=` ${t.toLowerCase().replace(/’/g,"'").replace(/[.,!?;:]/g," ").replace(/\s+/g," ").trim()} `,r=0;for(let o of Un)n.includes(` ${o} `)&&(r++,n=n.split(` ${o} `).join(" "));let s=Bn.filter(o=>n.includes(` ${o} `)).length;return r>s?-1:s>r?1:0}function Xs(t){let e=Kn(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 Js(t){let e=Kn(t).length;return e>=10&&e<=15}function Ot(t){let e=t;for(let[n,r]of Ys)e=e.replace(n,s=>r(s)?Qs(s):s);return e===t?void 0:e}function zn(t){if(typeof t!="string")return;let e=t.toLowerCase();return/^[0-9a-f]{32}$/.test(e)?e:void 0}function Zs(t,e,n){let r=$t(e,n),s=Ot(r);return s===void 0?{[t]:r}:{[t]:s,$ai_text_redacted:!0}}function Xn(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=Wn(e);o!==void 0&&(s.$ai_text_hash=o),s.$ai_sentiment=Vn(e)}return r?{...s,...Zs("$ai_text",e,Us)}:s}function Yn(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=$t(t.comment,Bs);r.$ai_feedback_comment=Ot(s)??s}return t.messageIndex!==void 0&&(r.$ai_message_index=t.messageIndex),r}function Pt(t,e){let n=Gn(t),r=_e(e,64);return{...n?{$ai_outcome:n}:{},...r?{$ai_resolution:r}:{}}}function eo(){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 Jn(t={}){let e={$ai_conversation_id:t.conversationId||eo()},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",zn(t.traceId)),e}var ce,qs,Us,Bs,Un,Bn,ke,$t,Ws,Vs,Ks,zs,Kn,qn,Ys,Qs,Gn,_e,xe,Qn=C(()=>{"use strict";ce={started:"$ai_conversation_started",message:"$ai_message",feedback:"$ai_feedback",ended:"$ai_conversation_ended",outcome:"$ai_outcome"},qs=["resolved","unresolved","escalated","abandoned","error"],Us=4e3,Bs=2e3,Un=["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"],Bn=["thanks","thank you","great","perfect","awesome","helpful","that worked","works now","solved","exactly"],ke=t=>Array.from(t),$t=(t,e)=>ke(t).slice(0,e).join(""),Ws=0xcbf29ce484222325n,Vs=0x100000001b3n,Ks=0xffffffffffffffffn,zs=new TextEncoder;Kn=t=>ke(t).filter(e=>e>="0"&&e<="9").map(Number);qn=String.raw`[\p{Alphabetic}\p{M}\p{Nd}\p{Pc}\p{Join_Control}]`,Ys=[[new RegExp(String.raw`(?<!${qn})\p{Nd}(?:[ -]?\p{Nd}){12,18}(?!${qn})`,"gu"),Xs],[/[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,Js]];Qs=t=>ke(t).map(e=>/\s/u.test(e)?e:"*").join("");Gn=t=>typeof t=="string"&&qs.includes(t)?t:void 0,_e=(t,e)=>typeof t=="string"&&t?$t(t,e):void 0;xe=class{next=0;common;emit;captureText;constructor(e,n={},r=!1){this.emit=e,this.captureText=r,this.common=Jn(n)}get id(){return this.common.$ai_conversation_id}send(e,n){this.emit(e,{...this.common,...n})}start(){return this.send(ce.started,{}),this}message(e,n,r={}){let s=r.index??this.next,o=Xn(e,n,s,this.captureText);return o?(this.next=s+1,this.send(ce.message,o),!0):!1}feedback(e){let n=Yn(e,this.captureText);return n?(this.send(ce.feedback,n),!0):!1}end(e,n){this.send(ce.ended,Pt(e,n))}outcome(e,n){let r=Pt(e,n);return r.$ai_outcome?(this.send(ce.outcome,r),!0):!1}}});var Be=C(()=>{"use strict";pn();it();fn();gn();mn();Dn();kt();Hn();Nn();Qn()});function tr(t,e=90,n=Date.now){let r,s=()=>{try{return JSON.parse(t.get(er)??"{}")}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(er,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,er,we=C(()=>{"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"],er="lc_click_ids"});function po(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 cr(){let t=new URLSearchParams(location.search),e=re.map(n=>t.get(n)??"");return e.some(Boolean)?e.join("|"):void 0}function fo(t){try{return t?new URL(t).hostname:""}catch{return""}}function mo(){let t=location.hash;return t.length>1?location.pathname+t.split("?")[0]:location.pathname}function lr(t,e,n=[],r=!1){let s={$current_url:go(),$host:location.host,$pathname:r?mo():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=po(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:fo(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,go,Ve=C(()=>{"use strict";we();re=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];go=()=>location.href.replace(/([?&])__lc_toolbar=[^&#]*&?/,"$1").replace(/[?&]$/,"")});function fr(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 gr=C(()=>{"use strict"});function _o(t,e){let n=t,r=[...vo,...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(mr).join("|")})=[^&]*`,"gi"),`$1$2=${It}`)+i}return e.stripHash&&(n=n.replace(/#.*$/,"")),n}function hr(t){let e=new RegExp(`^\\$(initial_|last_)?(${[...re,...X].map(mr).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]=It:o==="$click_ids"&&i&&typeof i=="object"&&((s??={...r})[o]=Object.fromEntries(Object.keys(i).map(a=>[a,It])));for(let o of bo){let i=(s??r)[o];if(typeof i!="string")continue;let a=_o(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 It,vo,bo,mr,yr=C(()=>{"use strict";we();Ve();It="<masked>",vo=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","api_key","apikey","key","auth","authorization","code","otp","email","ssn"],bo=["$current_url","$referrer","$initial_referrer","$initial_current_url","$last_current_url"],mr=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});function pi(t){return t.startsWith("re:")?t.slice(3):t.split("*").map(e=>e.replace(/[.+?^${}()|[\]\\]/g,"\\$&")).join(".*")}function Kt(t,e){return!!t?.some(n=>{try{return new RegExp(pi(n),"i").test(e)}catch{return!1}})}var Hr=C(()=>{"use strict"});Be();var to=["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 Zn(t,e=[]){let n=t.toLowerCase();return e.some(r=>r&&n.includes(r.toLowerCase()))?!0:to.some(r=>n.includes(r))&&!/\bcubot\b/.test(n)}we();function no(){return Array.from(document.querySelectorAll("meta[http-equiv]")).filter(t=>t.getAttribute("http-equiv")?.toLowerCase()==="content-security-policy").map(t=>t.getAttribute("content")??"")}function ro(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 rr(t,e){if(typeof document>"u")return()=>{};!e&&no().some(ro)&&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 so=(t,e)=>t.slice(0,e);function nr(t){try{let e=new URL(t);return e.protocol==="data:"||e.protocol==="blob:"?e.protocol:e.origin+e.pathname}catch{return so(t,64)}}function sr(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:nr(i.blockedURI??""),$csp_source_file:i.sourceFile?nr(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 oo=["chrome-extension:","moz-extension:","safari-web-extension:","ms-browser-extension:"],We=()=>typeof location<"u"&&oo.includes(location.protocol),io=(t,e,n)=>`${t.replace(/\/+$/,"")}/static/v${e}/${n}`,ao={replay:"replay",heatmaps:"heatmaps",forms:"forms",toolbar:"toolbar",guides:"guides",inspector:"inspector",experiments:"visualChanges","early-access":"earlyAccess",consent:"consentBanner"},co=t=>import(t);async function or(t,e,n,r=co){return(await Promise.all(t.map(async o=>{let i=ao[o];if(!i)return n("unknown module",o);try{let a=(await r(io(e.assetHost,e.version,`${o}.js`)))[i];return typeof a=="function"?a:n("module has no export",o,i)}catch(a){return n("module failed to load",o,a)}}))).filter(o=>!!o)}function lo(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 ir(t,e,n,r){if(!r)return{transport:t,fetch:e};let s=o=>lo(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 uo="__LUCIDA_DEVTOOLS_HOOK__";function ar(t,e,n){let r=globalThis[uo];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 At="_lcid";var ur=(t,e)=>e.some(n=>{let r=n.replace(/^\./,"").toLowerCase();return t.toLowerCase()===r||t.toLowerCase().endsWith(`.${r}`)}),ho=(t,e=Date.now(),n)=>`${t}.${e.toString(36)}${n?`_${n}`:""}`;function yo(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 dr(t){if(!t?.length)return;let e=new URL(location.href),n=e.searchParams.get(At);if(n!==null){e.searchParams.delete(At),history.replaceState(history.state,"",e.toString());try{if(document.referrer&&!ur(new URL(document.referrer).hostname,t))return}catch{return}return yo(n)}}var pr=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||!ur(o.hostname,e))return;let i=new URL(o.href);i.searchParams.set(At,ho(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)}};gr();yr();function xo(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 ko(t,e=Math.random){return n=>t>=1?n:t<=0||e()>=t?null:{...n,properties:{...n.properties,$sample_rate:t}}}function wo(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 Mt="lc_person_identified",Ke="lc_pending_set_once",vr=new Set(["$identify","$create_alias","$groupidentify"]),br="$$client_ingestion_warning",So=6e4,Tt=class{constructor(e,n){this.mode=e;this.storage=n;this.identified=n.get(Mt)==="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(Mt,"1"))}personless(e){return this.mode==="always"?!1:(this.mode==="never"||!this.identified)&&!vr.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(Mt),this.storage.remove(Ke)}};function Ro(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?xo(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 Eo(t){let e=t.beforeSend?Array.isArray(t.beforeSend)?t.beforeSend:[t.beforeSend]:[];return[hr(t.urlPrivacy??{}),...t.propertyDenylist?.length?[wo(t.propertyDenylist)]:[],...t.sampleRate!==void 0?[ko(t.sampleRate)]:[],...e]}function _r(t,e,n,r=Date.now){let s=new Tt(e.personProfiles??"always",t.storage),o,i,a=0,c=-1/0,l=()=>{a+=1,!(r()-c<So)&&(c=r(),queueMicrotask(()=>{let u=a;a=0,t.capture(br,{$$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?fr(o):void 0),Ro({hooks:Eo(e),person:s,limit:u.event===br?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)}},Co=365,Po=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(" ")),$o=new Set("co com net org edu gov gob go ac or ne ltd plc sch mil nom".split(" "));function Oo(t){let e=t.toLowerCase().split(".");for(let n=1;n<e.length-1;n++)if(Po.has(e.slice(n).join("."))||n===e.length-2&&e[n+1].length===2&&$o.has(e[n]))return e.slice(n-1).join(".")}function Ao(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 Oo(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?Ao():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??Co)*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{}}},le=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{}}},jt=class extends le{constructor(){super("localStorage")}},Io=["lc_identity","lc_session","lc_device_id","lc_consent","lc_person_identified"],Lt=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()}},Dt=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 Lt(new ze(n),new jt,o=>Io.some(i=>o===i+r)):new le(t);return new Dt(s,r)}function xr(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 Mo(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 kr(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 Mo(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 Ht={send:async()=>({status:200})};var To="lucida-browser",Ut="0.1.3",Nt="lc_internal",Fo=3e3,Je="https://capture.lucidace.com",qt=t=>!!t&&typeof t=="object"&&Object.getPrototypeOf(t)===Object.prototype;function wr(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,qt(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=>ir(d,p,u,e.rewritePath),g=h(Ht).fetch,x=e.consent?.respectDnt,y=navigator.globalPrivacyControl===!0,w=(e.respectDnt??x)===!0&&navigator.doNotTrack==="1"||(e.respectGpc??x)===!0&&y,E=e.blockBots!==!1&&typeof navigator<"u"&&Zn(navigator.userAgent??"",e.blockedUserAgents),R=!!e.disabled||E;E&&s("bot user agent: capture disabled");let D,Q=h(e.transport??kr(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 le(l==="sessionStorage"?"sessionStorage":"localStorage"),()=>v.hasConsent("analytics"));Q=D=pt(Q,d,{key:`lc_offline${Xe(t)}`,isOnline:()=>navigator.onLine!==!1})}let F=R?void 0:dr(e.crossDomains),$=Ye(R?"memory":l,t,e.cookie),j=(e.storageWriteDelayMs??0)>0?new Ge($,e.storageWriteDelayMs):void 0,A=F?.sessionId??e.bootstrap?.sessionId,U,I=!1,N,T=[],v=new me({apiKey:t,apiHost:o,transport:R?Ht:Q,storage:j??$,...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:To,version:Ut},consent:{...e.cookieless==="on_reject"?{cookielessOnReject:!0}:{},...e.consent,...e.consent?.geo&&!R?{awaitRemote:!0}:{},respectDnt:!0,dnt:w},queue:{...e.flushAt?{flushAt:e.flushAt}:{},...e.flushIntervalMs?{flushIntervalMs:e.flushIntervalMs}:{}},...F||e.bootstrap?.distinctId?{bootstrapDistinctId:F?.distinctId??e.bootstrap?.distinctId}:{},...e.bootstrap?.isIdentified&&!F?{bootstrapIdentified:!0}:{},session:{...e.session,...A?{bootstrapId:A}:{}},enrich:(d,m)=>{let b=lr(d,m,i.customCampaignParams,e.capturePageview==="hash");if(o!==Je&&(b.properties={...b.properties,$lib_custom_api_host:o}),T.length){let f=v.sessionId;for(let _ of T)b.properties={...b.properties,..._(f)}}let O=N?.()??{},W=Object.keys(O);return W.length&&(b.properties={...b.properties,$click_ids:O},d==="$pageview"&&(b.$set_once={...Object.fromEntries(W.map(f=>[`$initial_${f}`,O[f]])),...b.$set_once},b.$set=Object.fromEntries(W.map(f=>[`$last_${f}`,O[f]])))),i.sendFeatureFlags!==!1&&d!=="$snapshot"&&U&&(b.properties={...Ct(U.all()),...b.properties}),I?{...b,properties:{...b.properties,$internal:!0}}:b},campaignKey:cr,log:s});I=v.storage.get(Nt)==="1",e.clickIds!==!1&&(N=tr(v.storage,e.clickIds?.expiryDays));let L=_r(v,i,s);e.bootstrap?.isIdentified&&L.markIdentified();let Z=d=>L.blocksPersonWrites?(s(`personProfiles=never: ${d} ignored`),!0):!1;R||v.onChange(d=>{d!=="consent"||v.hasConsent("analytics")||v.consentStatus()!=="denied"||(j?.flush(),xr($,t,e.consent?.storageKey||Pe))});let ue=[],B=[rr(s,e.nonce)],de=v.storage;if(e.flagPersistence&&!R){let d=new te(Ye(c(e.flagPersistence),t,e.cookie),()=>v.hasConsent("analytics"));v.onChange(m=>{m==="consent"&&(v.hasConsent("analytics")?d.flushBuffered():d.discardBuffered())}),de=d}let se=d=>{if(R)return;if(v.hasConsent("analytics"))return d();let m=!1;v.onChange(b=>{!m&&b==="consent"&&v.hasConsent("analytics")&&(m=!0,d())})},pe,k={core:v,client:void 0,config:i,flagStorage:de,apiKey:t,log:s,fetch:g,onUnload:d=>{ue.push(d)},whenConsented:se,onCapture:d=>v.onCaptured(d),eventExtras:T,clickExtras:[],flagPersonProps:[],loadConfig:()=>pe??=new Promise(d=>se(()=>{g(`${o}/v1/config?api_key=${encodeURIComponent(t)}`).then(m=>m.ok?m.json():null).then(m=>(m&&v.applyRemote(m),m)).then(d,()=>d(null))}))};if(v.consent.resolving){let d=g(`${o}/v1/config?api_key=${encodeURIComponent(t)}`,{credentials:"omit"}).then(b=>b.ok?b.json():null).catch(()=>null);pe=d;let m=setTimeout(()=>v.applyRemote({}),Fo);d.then(b=>{clearTimeout(m),v.applyRemote(b??{})})}let fe=dt(v,{apiHost:o,apiKey:t,fetch:g,whenConsented:se,log:s,disabled:R});B.push(()=>fe.stop());let oe={get distinctId(){return v.distinctId},capture:(d,m,b)=>{v.capture(d,m,b?.timestamp!==void 0?{timestamp:b.timestamp}:{})&&(b?.sendInstantly||b?.transport)&&v.flush(b.transport==="beacon"?{beacon:!0}:{})},identify:(d,m,b)=>{Z("identify")||(L.markIdentified(),v.identify(d,m,b))},alias:(d,m)=>{Z("alias")||(L.markIdentified(),v.alias(d,m))},reset:d=>{v.reset({resetDeviceId:!!d,reuseAnonymousId:!!e.reuseAnonymousId}),L.reset()},createPersonProfile:()=>{Z("createPersonProfile")||L.isProfile||(L.markIdentified(),v.capture("$set",{}))},setConfig:d=>{let m=i;for(let[b,O]of Object.entries(d)){let W=m[b];qt(W)&&qt(O)?Object.assign(W,O):m[b]=O}"debug"in d&&(r=!!d.debug)},setPersonProperties:(d,m)=>{!d&&!m||Z("setPersonProperties")||(L.markIdentified(),v.capture("$set",{},{...d?{$set:d}:{},...m?{$set_once:m}:{}}))},unsetPersonProperties:d=>{!d.length||Z("unsetPersonProperties")||(L.markIdentified(),v.capture("$set",{},{$unset:d}))},getSessionId:()=>v.sessionId,onSessionId:d=>v.onSessionId(m=>d(m)),getProperty:d=>v.getProperty(d),hasOptedOut:()=>!v.hasConsent("analytics"),getReplayUrl:d=>{let b=`${(e.uiHost??o).replace(/\/+$/,"")}/replays/${encodeURIComponent(v.sessionId)}`,O=v.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)=>{v.capture("$feature_view",{...m,$feature_flag:d},{$set:{[`$feature_view/${d}`]:!0}})},featureInteraction:(d,m)=>{v.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=>v.register(d),registerOnce:d=>v.registerOnce(d),unregister:d=>v.unregister(d),group:(d,m,b)=>{L.markIdentified(),v.group(d,m,b)},optIn:()=>v.optIn(),optOut:()=>v.optOut(),optOutInternal:(d=!0)=>{I=d,d?v.storage.set(Nt,"1"):v.storage.remove(Nt)},get isInternal(){return I},setConsent:d=>v.setConsent(d),getConsent:()=>v.getConsent(),getConsentStatus:d=>v.getConsentStatus(d),consentStatus:()=>v.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)=>oe.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:()=>v.flush(),shutdown:async()=>{for(let d of B)d();j?.flush(),await v.shutdown()}};if(k.client=oe,!R){let d=()=>{for(let b of ue)b();j?.flush(),v.flush({beacon:!0})};window.addEventListener("pagehide",d);let m=()=>{document.visibilityState==="hidden"&&v.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(sr((O,W)=>{v.capture(O,W)},b))}for(let b of n){let O=b(k);O&&B.push(O)}U=k.flags,n.length||k.loadConfig(),ar(k,oe,o)}return s("initialised",{apiHost:o,consent:v.getConsent()}),oe}var jo='[data-lc-region="article"]';function Sr(t,e,n){if(e.articles===!1)return()=>{};let r;t.loadConfig().then(y=>{typeof y?.article_selector=="string"&&(r=y.article_selector)});let s=()=>{for(let y of[e.articleSelector,r,jo])if(y)try{let w=document.querySelector(y);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 y=a.getBoundingClientRect();if(y.height<=0)return;let w=Math.round(Math.min(100,Math.max(0,(window.innerHeight-y.top)/y.height*100)));c=Math.max(c,w);let E=a.querySelector("h1,h2");E&&E.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",Lo="data-lc-content-piece",Do="data-lc-content-target";var Bt=(t,e)=>(t.getAttribute(e)??"").trim().slice(0,200);function Rr(t,e,n){if(e.contentBlocks===!1||typeof IntersectionObserver>"u")return()=>{};let r=new WeakSet,s=u=>{let p={$content_name:Bt(u,Qe)},h=Bt(u,Lo),g=Bt(u,Do);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 Ho=new Set(["input","textarea","select","option"]),No=["name","type","role","aria-label","title","alt","placeholder"],qo=/(?:\d[ -]?){9,}/;function Uo(t){if(Ho.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||qo.test(e)))return e.slice(0,255)}function Er(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 Bo="***";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 Wo(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-")||No.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=Uo(t);u&&(i.text=u)}return i}function tt(t,e,n,r,s={}){let o=[],i=Er(r),a=Er(s.allow),c=s.maskAll?(u,p)=>a(u)?p:Bo:(u,p)=>p,l=e;for(let u=t;u&&o.length<10;u=u.parentElement)o.push(Wo(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=[],Vo=/^[+\-−–‹›<>«»←→↑↓▲▼▶◀^ˇ˄˅]$/,Ko=/\b(increase|decrease|increment|decrement|plus|minus|add one|remove one|next|prev|previous|scroll (left|right))\b/i,zo=/(^|[-_\s])(stepper|spinner|quantity|qty|increment|decrement|inc|dec|plus|minus|carousel|slider|swiper|slick|glide|splide|arrow|next|prev)([-_\s]|$)/i,Go="button,[role=button],a,input[type=button],input[type=submit],[role=spinbutton]";function Xo(t,e=[]){if(e.length&&t.closest(e.join(","))||t.closest("input[type=number],[role=spinbutton],[role=slider]"))return!0;let n=t.closest(Go)??t,r=`${n.getAttribute("aria-label")??""} ${n.getAttribute("title")??""}`;if(Vo.test((n.textContent??"").trim())||Ko.test(r))return!0;for(let s=n,o=0;s&&o<3;s=s.parentElement,o++)if(zo.test(s.getAttribute("class")??""))return!0;return!1}var Yo=()=>typeof getSelection=="function"?(getSelection()?.toString()??"")!=="":!1;function Cr(t,e=Date.now(),n={},r){if(r&&n.ignoreSelectors?.length&&r.closest(n.ignoreSelectors.join(",")))return{};if(r&&n.suppressSteppers!==!1&&Xo(r,n.stepperSelectors))return{};if(n.ignoreTextSelection!==!1&&Yo())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 Pr(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 $r=/^[A-Za-z_][\w-]*$/,Jo=5;function Qo(t){let e=[];for(let n=t;n&&e.length<Jo;n=n.parentElement){let r=n.tagName.toLowerCase();if(n.id&&$r.test(n.id)){e.unshift(`${r}#${n.id}`);break}let s=(n.getAttribute("class")??"").split(/\s+/).filter(o=>$r.test(o)).slice(0,2);e.unshift(r+s.map(o=>`.${o}`).join(""))}return e.join(" ")}function Or(t,e,n,r,s={}){let o={$selector:Qo(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,Cr(e,Date.now(),s.rageClicks||{},n));let i=s.deadClicks;!r&&e.isTrusted&&i!==!1&&!(i?.ignoreSelectors?.length&&n.closest(i.ignoreSelectors.join(",")))&&Pr(t,o.$selector,i?.waitMs);for(let a of t.clickExtras)Object.assign(o,a(e,n));return o}var Zo="a,button,input,select,textarea,label,summary,[role=button],[role=link],[data-lc-capture]",ei="[data-lc-ignore]",Wt=t=>t.some(e=>typeof e=="string"?location.href.includes(e):e.test(location.href)),ti=t=>!t?.length||Wt(t),Vt=t=>({maskAll:t.maskAllAttributes,allow:t.attributeAllowlist}),Se=(t,e)=>!!t.closest(ei)||!!(e.denySelectors?.length&&t.closest(e.denySelectors.join(",")));function Ar(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(","))||!ti(e.urlAllowlist)||c==="change"&&!/^(input|select|textarea)$/i.test(u.tagName)||u instanceof HTMLInputElement&&u.type==="password")return;let p=u.closest(Zo);if(c==="click"&&!p&&!e.allowSelectors?.length)return;let h=tt(u,e.captureText??!0,p??void 0,e.attributeIgnore,Vt(e)),g=h.find(y=>y.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"?Or(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 ni='[contenteditable]:not([contenteditable="false"])',Ir="input,textarea,select",ri=255;function si(t){return t.replace(/\d(?:[ -]?\d){5,}/g,"***").replace(/[^\s@]+@[^\s@]+\.[^\s@]+/g,"***").replace(/\s+/g," ").trim().slice(0,ri)}var oi=t=>t?t instanceof Element?t:t.parentElement:null;function Mr(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,Vt(e));return{...et(p),$elements:h,$elements_chain:nt(h)}},a=p=>{let h=p instanceof Element?p.closest(ni):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=oi(h?.anchorNode)??g;if(!x||Se(x,e)||x.closest(Ir)||g?.closest(Ir))return;let y=e.captureCopiedText?si(h?.toString()??""):"";t.client.capture("$copy_autocapture",{$copy_type:p.type,...i(x),...y?{$selected_content:y}:{}})};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 ii="[data-lc-ignore]",ai=["pdf","zip","gz","tar","rar","7z","doc","docx","xls","xlsx","ppt","pptx","csv","epub","dmg","exe","msi","pkg","apk","iso","mp3","mp4","mov"],ci=["q","s","search","query"],Tr=t=>t.origin+t.pathname;function Fr(t,e,n){let r=Array.isArray(e.fileDownloads)?e.fileDownloads.map(o=>o.toLowerCase()):ai,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(ii))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:Tr(c),$file_name:l,$file_extension:u}):e.outboundLinks!==!1&&c.host!==location.host&&t.client.capture("$outbound_click",{$url:Tr(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:ci,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 li=[25,50,75],ui="data-lc-media-title";function jr(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 di=t=>(t.getAttribute(ui)??t.getAttribute("title")??t.getAttribute("aria-label")??"").trim().slice(0,200);function Lr(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:jr(c)},u=di(c);return u&&(l.$media_title=u),Number.isFinite(c.duration)&&(l.$media_duration=Math.round(c.duration)),l},o=c=>{let l=jr(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 li)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 Dr(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)}}Hr();var Nr=255,fi=new Set(["input","textarea","select","option"]),gi="[data-lc-mask],.lc-mask,[data-lc-no-capture],.lc-no-capture,[data-lc-block]",mi=new Set(["value","password","autocomplete"]),hi=/(?:\d[ -]?){9,}/,Re=new WeakMap,zt=new WeakMap;function qr(t,e){let n=zt.get(t);if(n)return new Promise(r=>{let s=setTimeout(r,e);n.then(()=>(clearTimeout(s),r()))})}function yi(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 vi(t){if(!t||fi.has(t.tagName.toLowerCase())||t.isContentEditable)return!1;try{return!t.closest(gi)}catch{return!1}}function bi(t,e){if(t.source==="attribute"){let r=(t.attribute??"").toLowerCase();if(!r||mi.has(r)||r.startsWith("on"))return;let s=e.getAttribute(r);return s===null?void 0:s.slice(0,Nr)}let n=(e.textContent??"").replace(/\s+/g," ").trim();if(!(!n||hi.test(n)))return n.slice(0,Nr)}function Ur(t,e,n,r=location.href){let s={};for(let o of t){if(!o.events.includes(e)||o.url&&!Kt([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(!vi(i))continue;let a=bi(o,i);a!==void 0&&(s[o.name]=a)}return s}function Br(t){let e=!0,n=t.loadConfig().then(r=>{e&&Re.set(t,yi(r?.snapshot_properties)),zt.delete(t)});return zt.set(t,n),t.clickExtras.push((r,s)=>e?Ur(Re.get(t)??[],"click",s):{}),()=>{e=!1,Re.delete(t)}}function Wr(t){let e=Re.get(t);return e?.length?Ur(e,"pageview"):{}}function Vr(t){return!!Re.get(t)?.some(e=>e.events.includes("pageview"))}var _i=t=>{try{return new URL(t).pathname}catch{return t}};function xi(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 Kr(t){let e=0,n=0,r=()=>{let s=xi(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 ki=800,wi=t=>t.core.hasConsent("analytics");function Si(t){return t==="history"?{path:!0,search:!0}:t==="hash"?{path:!0,search:!0,hash:!0}:typeof t=="object"?t:void 0}function Ri(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=Si(e),i=t.config.scrollRoot,a=location.href,c=a,l=Date.now(),u=Kr(i),p=Dr(),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,y=(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,y())};t.whenConsented(N),I.onChange(T=>{T==="consent"&&I.anonymousOnReject&&N()})}return}t.client.capture("$pageview",{...Wr(t),...A===void 0?{}:{$referrer:A},...U})},w,E=()=>{let A=w;w=void 0,A?.()},R=A=>{if(location.href===c)return;let U=c;if(c=location.href,!o||!Ri(U,c,o))return;let I=a;g(),u.stop();let N=new Date(l);a=location.href,l=Date.now(),u=Kr(i),p.reset();let T={$navigation_type:A,$prev_pageview_pathname:_i(I),$prev_pageview_duration:Math.round((l-N.getTime())/100)/10};Vr(t)?setTimeout(()=>y(I,T),0):(E(),w=()=>y(I,T),queueMicrotask(E))};t.onUnload(g);let D=wi(t)?qr(t,ki):void 0;if(D?(w=()=>y(),t.onUnload(E),D.then(E)):y(),!o)return()=>(u.stop(),p.stop());let{pushState:Q,replaceState:F}=history;history.pushState=function(...A){E(),Q.apply(this,A),R("pushState")},history.replaceState=function(...A){E(),F.apply(this,A),R("replaceState")};let $=()=>R("popstate"),j=()=>R("hashchange");return window.addEventListener("popstate",$),o.hash&&window.addEventListener("hashchange",j),()=>{window.removeEventListener("hashchange",j),history.pushState=Q,history.replaceState=F,window.removeEventListener("popstate",$),u.stop(),p.stop()}}var zr=t=>{let e=[],n=t.config.autocapture,r=!1;if(n!==!1){let i=typeof n=="object"?n:{},a=()=>!r&&!(i.urlIgnorelist?.length&&Wt(i.urlIgnorelist));e.push(Ar(t,i,a),Mr(t,i,a),Fr(t,i,a),Rr(t,i,a),Sr(t,i,a),Lr(t,i,a),Br(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 Ei="lc_preview",Gt="lc_preview";function Ci(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 Gr(t){let e=new URL(t).searchParams.get(Ei),n=null;try{n=sessionStorage.getItem(Gt)}catch{}return{forced:Ci(e==="off"?null:e??n),persist(){try{e==="off"?sessionStorage.removeItem(Gt):e&&sessionStorage.setItem(Gt,e)}catch{}}}}we();Ve();var Xt="lc_flag_initial";function Pi(t){try{return t?new URL(t).hostname:""}catch{return""}}function $i(){let t=new URLSearchParams(location.search),e={$initial_referrer:document.referrer||"$direct",$initial_referring_domain:Pi(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 Jr(t,e){if(typeof location>"u")return{};let n=t.get(Xt);if(n)try{return JSON.parse(n)}catch{}let r=$i();return e(()=>{t.get(Xt)||t.set(Xt,JSON.stringify(r))}),r}function Oi(){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 Qr(){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}=Oi();return t.$browser=n,t.$os=r,t.$device_type=String(Yt().$device_type??"Desktop"),t}function Yt(){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:Ai(t)}}function Ai(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 Ii=/^[A-Za-z0-9_.-]{1,100}$/,Mi=/^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*){0,5}$/,Ti=new Set(["__proto__","prototype","constructor"]),Fi=50,Zr=200;function Xr(t,e){if(!Mi.test(e))return;let n=t;for(let r of e.split(".")){if(Ti.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,Zr);if(typeof n=="number"&&Number.isFinite(n)||typeof n=="boolean")return n}function ji(){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,Zr))}return t}function Yr(t){let e={};if(!t||typeof window>"u")return e;let n=o=>Array.isArray(o)?o.filter(i=>typeof i=="string").slice(0,Fi):[],r=n(t.cookies).filter(o=>Ii.test(o));if(r.length){let o=ji();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=Xr(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=Xr(s[i],o);if(a!==void 0){e[`$datalayer/${o}`]=a;break}}return e}var es=t=>{if(t.config.flagOptions?.disableRemote&&!t.config.localFlags?.length)return;let e;t.flagPersonProps.push(()=>e&&t.core.hasConsent("analytics")?Yr(e):{}),t.loadConfig().then(n=>{let r=n?.flag_targeting_sources;!r||typeof r!="object"||(e=r,Object.keys(Yr(r)).length&&t.flags?.reload())})};Be();function Jt(t){return typeof t=="object"?t.value??t.variant??!!t.enabled:t}function Qt(t){let e={value:Jt(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:Qt(n.result)}))),e}var ts="lc_rt_events",ns=t=>!!t?.some(e=>e.conditions.some(n=>n.filters?.some(r=>r.type==="event")));function rs(t,e){let n;try{let i=t.flagStorage.get(ts);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 xt(s,r.counts(t.core.sessionId))},record(i,a,c){r.record(i,t.core.sessionId,a,o),c&&t.whenConsented(()=>t.flagStorage.set(ts,JSON.stringify(r.saved())))}}}var Zt="lc_flags",en="lc_flag_overrides_api";function ss(t){try{let e=localStorage.getItem("lc_flag_overrides");return e?JSON.parse(e)[t]:void 0}catch{return}}var os=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,y={},w={},E={},R=new Set,D=typeof location>"u"?{forced:{},persist(){}}:Gr(location.href),Q=Object.keys(D.forced).length>0,F=()=>({...r,...E}),$=t.config.flagOptions??{},j=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(F())},T=rs(t,n.localFlags),v=!1,L=()=>{v||(v=!0,queueMicrotask(()=>{v=!1,d()}))},Z=t.flagStorage.get(Zt);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),j.restore(f),c=Object.keys(r).length>0}catch{}let ue=t.flagStorage.get(en);if(ue)try{E=JSON.parse(ue)}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 de={},se=()=>({...$.autoProperties===!1?{}:Qr(),...Jr(e.storage,t.whenConsented),...Object.assign({},...t.flagPersonProps.map(f=>f())),...y}),pe=$.evaluationContexts?.length?{app_contexts:$.evaluationContexts}:{},k=(f=!0)=>{let _=n.localFlags;if(!_?.length)return!0;let S=n.localFlagsContext,P=St(_,{runtime_events:T.counts(),distinct_id:e.distinctId,...e.groups?{groups:e.groups}:{},...e.deviceId?{device_id:e.deviceId}:{},...x()?{contexts:g}:{},...pe,...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 de=H,N({...r,...H},{...s,...M},f),V},fe=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)},oe=ns(n.localFlags);t.onCapture(f=>{let _=oe||Object.keys(T.server()).length>0;if(T.record(f.event,f.properties,_),!_)return;let S=JSON.stringify([F(),s]);if(oe&&k(!1),fe(!1),JSON.stringify([F(),s])!==S)for(let P of R)P(F())});let d=(f=!0)=>{let _=++l;return!k()||$.disableRemote||!f&&j.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:Yt(),...e.deviceId?{device_id:e.deviceId}:{},...x()?{contexts:g}:{},...pe,...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[Ce,z]of Object.entries(M.flags??{}))V[Ce]=Jt(z),typeof z=="object"&&z.payload!==void 0&&(ee[Ce]=z.payload),o[Ce]=typeof z=="object"&&typeof z.reason=="string"?z.reason:"remote",typeof z=="object"&&z.runtime?.length&&(K[Ce]=Qt(z));i=M.request_id,T.setServer(K);let Ee=M.errors_while_computing_flags;N({...de,...Ee?r:{},...V},Ee?{...s,...ee}:ee,!1),fe(!0),t.flagStorage.set(Zt,JSON.stringify({values:{...Ee?r:{},...V},payloads:{...Ee?s:{},...ee},rt:K,...j.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()})})})},m=f=>E[f]??ss(f)??r[f];t.flags={get(f){let _=m(f);if(_===void 0)return;if(f in D.forced||f in E)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(E).length?F():{},payload:f=>s[f],result(f,_){let S=_?.sendExposure===!1?m(f):this.get(f),P=f in E||ss(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(F()),()=>{R.delete(f)}},reload:d,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,_){E=f?{...f}:{},f?_?.persist&&t.whenConsented(()=>t.flagStorage.set(en,JSON.stringify(E))):t.flagStorage.remove(en);for(let S of R)S(F())},setPersonProperties(f,_=!0){j.clear(),y={...y,...f},_&&L()},resetPersonProperties(){y={}},setGroupProperties(f,_=!0){j.clear();for(let[S,P]of Object.entries(f))w[S]={...w[S],...P};_&&L()},resetGroupProperties(){w={}},setContext(f,_,S){j.clear(),g={...g,[f]:{key:_,properties:S??{}}},L()},clearContext(f){j.clear();let{[f]:_,...S}=g;g=S,L()}},e.onChange(f=>{if(f==="reset"){g={},y={},w={},u.clear(),p.clear(),r={},s={},o={},i=void 0,a=void 0,T.setServer({}),j.clear(),t.flagStorage.remove(Zt),k(!1);for(let _ of R)_(F())}(f==="identify"||f==="reset"||f==="group")&&L()}),n.disableFlagsOnFirstLoad?k():d(!1);let b=n.flagStream,O;b&&!$.disableRemote&&t.whenConsented(()=>{O=ut({apiHost:A,apiKey:t.apiKey,fetch:t.fetch,reload:()=>{d()},visibility:{hidden:()=>document.visibilityState==="hidden",subscribe:f=>(document.addEventListener("visibilitychange",f),()=>document.removeEventListener("visibilitychange",f))},...typeof b=="object"&&b.pollMs!==void 0?{pollMs:b.pollMs}:{},log:t.log})});let W=$.refreshMs&&$.refreshMs>0&&!$.disableRemote?setInterval(()=>document.visibilityState!=="hidden"&&void d(!1),$.refreshMs):void 0;return()=>{O?.(),W&&clearInterval(W)}};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 is="lucida.session_id";function Li(t,e){return[...(t??"").split(",").map(r=>r.trim()).filter(r=>r&&!r.startsWith(`${is}=`)),`${is}=${encodeURIComponent(e)}`].join(",")}function Di(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 as=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)&&Di(o,e.origins);return st((o,i)=>{s(o)&&i.set("baggage",Li(i.get("baggage"),r))})};var Hi="X-Lucida-Distinct-Id",Ni="X-Lucida-Session-Id";function qi(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 cs=t=>/^[\x20-\x7e]*$/.test(t)?t:encodeURIComponent(t),ls=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)||!qi(r,e)||(n.distinctId&&s.set(Hi,cs(n.distinctId)),s.set(Ni,cs(n.sessionId)))})};function us(t,e={},n=[]){return wr(t,e,[zr,os,es,as,ls,pr,...n])}var tn=(()=>{try{let t=typeof document>"u"?void 0:document.currentScript?.src;return t?new URL(t).origin:void 0}catch{return}})();function Ui(t,e){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 n=t.assetHost??tn??t.apiHost??Je;return or(t.modules,{assetHost:n,version:Ut},(...r)=>console.warn("[lucida]",...r),e)}function Bi(t,e){let n=t.lucidaQueue??[],r=[],s=Promise.resolve(),o=!1,i=c=>{let[l,...u]=c;if(l==="init"){if(t.lucida||o)return;o=!0;let h=u[1]??{},g=x=>{let y=!h.uiHost&&!h.assetHost&&tn?{uiHost:tn}:{};t.lucida=us(String(u[0]),{...y,...h},x);let w=r;r=[],w.forEach(i)};h.modules?.length?s=Ui(h,e).then(g):g([]);return}if(!t.lucida){r.push(c);return}let p=t.lucida[l];typeof p=="function"&&p.apply(t.lucida,u)},a=n.splice(0);return n.push=(...c)=>(c.forEach(i),n.length),t.lucidaQueue=n,a.forEach(i),s}typeof window<"u"&&Bi(window);})();
@@ -1 +0,0 @@
1
- import{a as g,c as y,d as I,e as v,f as P,g as b,i as O,j as D}from"./chunk-UH2MVDMX.js";import"./chunk-O4W7SZ2X.js";var S="lc_replay_ack",U=()=>{try{let e=sessionStorage.getItem(S);return e?[e]:[]}catch{return[]}};function x(){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(S,t)}catch{}}},props(t){let o=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),o&&(r.$replay_url_trigger_status=o.url,r.$replay_event_trigger_status=o.event,r.$replay_linked_flag_trigger_status=o.flag);let l=e.matchedGroups?.();l?.length&&(r.$replay_trigger_groups_matched=l),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 n=e.bufferBytes?.();n&&(r.$replay_buffer_size=n);let a=e.throttled?.();return a&&(r.$replay_throttled_mutations=a),r}})}var $="lucida_replay_url";function k(e,t,o,r=2e3){let l={},n=()=>{if(!o())return;let i=globalThis,d=t();try{e.intercom&&typeof i.Intercom=="function"&&l.intercom!==d&&(i.Intercom("update",{[$]:d}),l.intercom=d),e.crisp&&typeof i.$crisp?.push=="function"&&l.crisp!==d&&(i.$crisp.push(["set","session:data",[[[$,d]]]]),l.crisp=d)}catch{}};n();let a=setInterval(n,r);return()=>clearInterval(a)}var L=e=>{let t=x();e.eventExtras.push(s=>t.props(s));let o=e.config.replay??{},r=s=>{t.status="disabled",t.disabledReason=s};if(o.enabled===!1)return r("disabled_locally");if(!v(e.config.replayOwner??o.owner))return r("owner_watchtower");if(navigator.connection?.saveData)return r("data_saver");let n="idle",a,i=0,d=!1,j=location.href,R=()=>e.core.hasConsent("analytics")&&e.core.hasConsent("replay"),m=async s=>{if(n!=="idle")return;if(!R())return r("no_consent");n="starting",t.status="awaiting_config";let u=++i,p=await e.loadConfig(),f=g(p?.replay_never_record,j)||!!s&&g(p?.replay_never_record,location.href),c=f?null:y(o,p);if(u!==i)return void(n="idle");if(!c)return r(f?"never_record_page":"remote_disabled"),void(n="idle");let E=e.core.sessionId,w=c.trigger_groups.length>0,M=!!s?.sampling||w||b(E,"",c.sample_rate);if(t.sampleRate=w?void 0:c.sample_rate,t.minDurationMs=c.min_duration_ms,!M)return t.status="sampled",void(n="idle");t.status="lazy_loading",t.disabledReason=void 0;let{startRecorder:T}=await import("./recorder-P2QJ4AKY.js");if(u!==i)return void(n="idle");a=T(e,c,t,s),n="on"},h=()=>{i++,a?.stop(),a=void 0,n="idle"};e.replay={start:async s=>{d=!1;let u=s===!0,p=f=>u||typeof s=="object"&&!!s[f];await m({sampling:s===void 0||p("sampling"),url_trigger:p("url_trigger"),event_trigger:p("event_trigger"),linked_flag:p("linked_flag")})},stop:()=>{d=!0,h(),r("stopped_manually")},pause:()=>a?.pause(),resume:()=>a?.resume(),tag:s=>e.client.capture("$replay_tag",{name:s,session_id:e.core.sessionId}),isRecording:()=>n==="on"&&!a?.paused()},e.core.onChange(s=>{s==="consent"&&(R()?d||m():(h(),r("no_consent")))}),m();let _=o.supportWidgets,C=_?.intercom||_?.crisp?k(_,()=>e.client.getReplayUrl(),()=>n==="on"&&!a?.paused()):void 0;return()=>{i++,a?.stop(),C?.()}};export{P as fnv1a32,v as lucidaRecords,D as pagePrivacy,g as policyMatches,L as replay,y as resolveReplay,b as sampled,I as urlAllowed,O as urlRules};