@sentientui/core 0.30.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import{a as U}from"./chunk-WKXD7KI3.mjs";import{a as S,d as J,e as b,f as E,g as X}from"./chunk-Z6ILOYBD.mjs";import{I as Y,K as q}from"./chunk-HY23LTUY.mjs";import"./chunk-2NVSFI4V.mjs";import{a as f,b as H}from"./chunk-TMCGHANO.mjs";import{fnv1a as Z}from"@sentientui/policy";var ee="section, header, footer, nav, main > div, [data-sentient-section]",te=2e4;function ne(d){let o=Array.from(d.querySelectorAll(ee)),i=o.filter(a=>o.filter(c=>c!==a&&a.contains(c)).length<2);return i.filter(a=>!i.some(c=>c!==a&&c.contains(a)))}function oe(d,o,i,a){try{fetch(`${o}/v1/section-map`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${d}`},body:JSON.stringify({pageUrl:i,sections:a})}).catch(()=>{})}catch(c){}}var h=()=>{};function re(d,o){var k,x,R,L,N,D,_,F,P,M,$,K,B,j,V;let i=(k=o.doc)!=null?k:typeof document!="undefined"?document:void 0;if(!i||typeof IntersectionObserver=="undefined"||q()||!o.apiKey||!o.apiKey.startsWith("pk_"))return h;let a=((x=o.apiBase)!=null?x:"https://api.sentient-ui.com").replace(/\/+$/,"").replace(/\/v1$/,""),c=ne(i);if(c.length===0)return h;let g=new Map,A=[];for(let e of c){let t=(N=[(L=o.sectionTypes)==null?void 0:L[(R=e.getAttribute("data-sentient-id"))!=null?R:""],e.getAttribute("data-sentient-type")].find(p=>S.includes(p)))!=null?N:null,n=E(e),r=(_=t!=null?t:(D=o.typeOf)==null?void 0:D.call(o,e))!=null?_:b(n).type,l=U(e,i),T=l?`nc-${r}-${Z(JSON.stringify({id:(F=l.id)!=null?F:null,dataAttr:(P=l.dataAttr)!=null?P:null,selector:(M=l.selector)!=null?M:null})).toString(36)}`:`nc-${r}`;g.set(e,T);let z=J.filter(([,p])=>p.test(n.bodyText)).map(([p])=>p);A.push(H(f({componentId:T,semanticType:r,source:t?"markup":"auto"},l?{locator:l}:{}),{observation:f(f({tag:n.tag,idClass:n.idClass.slice(0,200),headingText:n.headingText,textLength:n.textLength,actionCount:n.actionCount},n.ariaRole?{ariaRole:n.ariaRole}:{}),z.length>0?{patternFlags:z}:{})}))}let W=(j=(B=(K=($=i.defaultView)!=null?$:typeof window!="undefined"?window:void 0)==null?void 0:K.location)==null?void 0:B.pathname)!=null?j:"/";oe(o.apiKey,a,W,A);let u=new Map,G=e=>{let t=u.get(e);return t||(t={ms:0,scroll:0,enterAt:null,intersecting:!1},u.set(e,t)),t},v=new IntersectionObserver(e=>{for(let t of e){let n=g.get(t.target);if(!n)continue;let r=G(n);t.isIntersecting?(r.intersecting=!0,r.enterAt=Date.now(),t.intersectionRatio>r.scroll&&(r.scroll=t.intersectionRatio)):(r.intersecting=!1,r.enterAt!=null&&(r.ms+=Date.now()-r.enterAt,r.enterAt=null))}},{threshold:[0,.25,.5,.75,1]});for(let e of g.keys())v.observe(e);let m=()=>{let e=Date.now();for(let[t,n]of u)if(n.enterAt!=null&&(n.ms+=e-n.enterAt,n.enterAt=null),!(n.ms<=0)){try{d.track({projectId:o.apiKey,componentId:t,eventType:"dwell",payload:{dwell_time:Math.round(n.ms),scroll_depth:Number(n.scroll.toFixed(2))}})}catch(r){}n.ms=0}},w=()=>{if(i.hidden)m();else{let e=Date.now();for(let t of u.values())t.intersecting&&(t.enterAt=e)}},y=!1,C=e=>{if(m(),e!=null&&e.persisted){y=!0;return}try{v.disconnect()}catch(t){}},O=e=>{if(!(e!=null&&e.persisted)||!y)return;y=!1;let t=Date.now();for(let n of u.values())n.enterAt=n.intersecting&&!i.hidden?t:null};i.addEventListener("visibilitychange",w);let s=(V=i.defaultView)!=null?V:typeof window!="undefined"?window:void 0;s==null||s.addEventListener("pagehide",C),s==null||s.addEventListener("pageshow",O);let Q=setInterval(()=>{if(i.hidden||y)return;m();let e=Date.now();for(let t of u.values())t.intersecting&&(t.enterAt=e)},te),I=[];return o.microSignals&&[...g.entries()].forEach(([e,t],n)=>{I.push(Y((r,l={})=>{try{d.track({projectId:o.apiKey,componentId:t,eventType:"micro_signal",payload:f({signalType:r},l)})}catch(T){}},e,void 0,{tabLoss:n===0}))}),()=>{m(),clearInterval(Q),i.removeEventListener("visibilitychange",w),s==null||s.removeEventListener("pagehide",C),s==null||s.removeEventListener("pageshow",O);for(let e of I)e();try{v.disconnect()}catch(e){}}}export{S as SEMANTIC_TYPES,b as classifyFeatures,X as classifySection,E as featuresFromElement,re as startEngagementCapture};
1
+ import{a as U}from"./chunk-WKXD7KI3.mjs";import{a as S,d as J,e as b,f as E,g as X}from"./chunk-Z6ILOYBD.mjs";import{K as Y,M as q}from"./chunk-SFNOFZUH.mjs";import"./chunk-2NVSFI4V.mjs";import{a as f,b as H}from"./chunk-TMCGHANO.mjs";import{fnv1a as Z}from"@sentientui/policy";var ee="section, header, footer, nav, main > div, [data-sentient-section]",te=2e4;function ne(d){let o=Array.from(d.querySelectorAll(ee)),i=o.filter(a=>o.filter(c=>c!==a&&a.contains(c)).length<2);return i.filter(a=>!i.some(c=>c!==a&&c.contains(a)))}function oe(d,o,i,a){try{fetch(`${o}/v1/section-map`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${d}`},body:JSON.stringify({pageUrl:i,sections:a})}).catch(()=>{})}catch(c){}}var h=()=>{};function re(d,o){var k,x,R,L,N,D,_,F,P,M,$,K,B,j,V;let i=(k=o.doc)!=null?k:typeof document!="undefined"?document:void 0;if(!i||typeof IntersectionObserver=="undefined"||q()||!o.apiKey||!o.apiKey.startsWith("pk_"))return h;let a=((x=o.apiBase)!=null?x:"https://api.sentient-ui.com").replace(/\/+$/,"").replace(/\/v1$/,""),c=ne(i);if(c.length===0)return h;let g=new Map,A=[];for(let e of c){let t=(N=[(L=o.sectionTypes)==null?void 0:L[(R=e.getAttribute("data-sentient-id"))!=null?R:""],e.getAttribute("data-sentient-type")].find(p=>S.includes(p)))!=null?N:null,n=E(e),r=(_=t!=null?t:(D=o.typeOf)==null?void 0:D.call(o,e))!=null?_:b(n).type,l=U(e,i),T=l?`nc-${r}-${Z(JSON.stringify({id:(F=l.id)!=null?F:null,dataAttr:(P=l.dataAttr)!=null?P:null,selector:(M=l.selector)!=null?M:null})).toString(36)}`:`nc-${r}`;g.set(e,T);let z=J.filter(([,p])=>p.test(n.bodyText)).map(([p])=>p);A.push(H(f({componentId:T,semanticType:r,source:t?"markup":"auto"},l?{locator:l}:{}),{observation:f(f({tag:n.tag,idClass:n.idClass.slice(0,200),headingText:n.headingText,textLength:n.textLength,actionCount:n.actionCount},n.ariaRole?{ariaRole:n.ariaRole}:{}),z.length>0?{patternFlags:z}:{})}))}let W=(j=(B=(K=($=i.defaultView)!=null?$:typeof window!="undefined"?window:void 0)==null?void 0:K.location)==null?void 0:B.pathname)!=null?j:"/";oe(o.apiKey,a,W,A);let u=new Map,G=e=>{let t=u.get(e);return t||(t={ms:0,scroll:0,enterAt:null,intersecting:!1},u.set(e,t)),t},v=new IntersectionObserver(e=>{for(let t of e){let n=g.get(t.target);if(!n)continue;let r=G(n);t.isIntersecting?(r.intersecting=!0,r.enterAt=Date.now(),t.intersectionRatio>r.scroll&&(r.scroll=t.intersectionRatio)):(r.intersecting=!1,r.enterAt!=null&&(r.ms+=Date.now()-r.enterAt,r.enterAt=null))}},{threshold:[0,.25,.5,.75,1]});for(let e of g.keys())v.observe(e);let m=()=>{let e=Date.now();for(let[t,n]of u)if(n.enterAt!=null&&(n.ms+=e-n.enterAt,n.enterAt=null),!(n.ms<=0)){try{d.track({projectId:o.apiKey,componentId:t,eventType:"dwell",payload:{dwell_time:Math.round(n.ms),scroll_depth:Number(n.scroll.toFixed(2))}})}catch(r){}n.ms=0}},w=()=>{if(i.hidden)m();else{let e=Date.now();for(let t of u.values())t.intersecting&&(t.enterAt=e)}},y=!1,C=e=>{if(m(),e!=null&&e.persisted){y=!0;return}try{v.disconnect()}catch(t){}},O=e=>{if(!(e!=null&&e.persisted)||!y)return;y=!1;let t=Date.now();for(let n of u.values())n.enterAt=n.intersecting&&!i.hidden?t:null};i.addEventListener("visibilitychange",w);let s=(V=i.defaultView)!=null?V:typeof window!="undefined"?window:void 0;s==null||s.addEventListener("pagehide",C),s==null||s.addEventListener("pageshow",O);let Q=setInterval(()=>{if(i.hidden||y)return;m();let e=Date.now();for(let t of u.values())t.intersecting&&(t.enterAt=e)},te),I=[];return o.microSignals&&[...g.entries()].forEach(([e,t],n)=>{I.push(Y((r,l={})=>{try{d.track({projectId:o.apiKey,componentId:t,eventType:"micro_signal",payload:f({signalType:r},l)})}catch(T){}},e,void 0,{tabLoss:n===0}))}),()=>{m(),clearInterval(Q),i.removeEventListener("visibilitychange",w),s==null||s.removeEventListener("pagehide",C),s==null||s.removeEventListener("pageshow",O);for(let e of I)e();try{v.disconnect()}catch(e){}}}export{S as SEMANTIC_TYPES,b as classifyFeatures,X as classifySection,E as featuresFromElement,re as startEngagementCapture};
2
2
  //# sourceMappingURL=index-engagement.mjs.map
@@ -1,7 +1,7 @@
1
- import { o as SentientConfig, n as SentientClient } from './index-B0PkJoeB.cjs';
2
- export { A as AssignResult, a as Assignment, b as AssignmentCache, E as EventQueue, e as EventType, g as GraphClient, h as GraphConfig, i as GraphSnapshot, L as LEGACY_SESSION_COOKIE_NAME, M as MicroSignalEmitter, k as MicroSignalType, l as PageNode, Q as QueueConfig, p as SentientEvent, q as SessionConfig, r as SessionManager, s as attachMicroSignalDetectors, t as grantConsent, v as isDoNotTrackEnabled, y as sanitizePageUrl, z as sessionCookieName } from './index-B0PkJoeB.cjs';
3
- import { I as CompoundLocator } from './session-meta-CY_Luh5i.cjs';
4
- export { B as BLOCK_ALIGNS, b as BLOCK_EMPHASES, c as BLOCK_FITS, d as BLOCK_GAPS, e as BLOCK_GRID_COLUMNS, f as BLOCK_HEADING_LEVELS, g as BLOCK_JUSTIFIES, h as BLOCK_MAX_WIDTHS, i as BLOCK_PADS, j as BLOCK_RATIOS, k as BLOCK_SIZES, l as BLOCK_SURFACES, m as BLOCK_TEXT_ALIGNS, n as BLOCK_TONES, o as BLOCK_WEIGHTS, p as BadgeBlock, q as BlockAlign, r as BlockEmphasis, s as BlockFit, t as BlockGap, u as BlockJustify, v as BlockMaxWidth, w as BlockNode, x as BlockPad, y as BlockRatio, z as BlockSize, C as BlockSurface, D as BlockTextAlign, E as BlockTone, F as BlockWeight, G as ButtonBlock, J as DecisionSnapshot, K as DividerBlock, L as FORM_FIELD_KINDS, M as FORM_INPUT_TYPES, N as FormBlock, O as FormField, P as GridBlock, Q as HeadingBlock, R as ImageBlock, S as LinkBlock, T as MAX_BLOCK_ARMS, U as MAX_BLOCK_CHILDREN, V as MAX_BLOCK_DEPTH, W as MAX_BLOCK_NODES, X as MAX_BLOCK_TEXT_LEN, Y as MAX_FORM_FIELDS, Z as MAX_FORM_SELECT_OPTIONS, _ as SNAPSHOT_STORAGE_KEY_PREFIX, a0 as SitePalette, a1 as SlotConfigEntry, a2 as SlotDeclInput, a3 as SlotOps, a4 as SpacerBlock, a5 as StackBlock, a6 as TextBlock, a9 as armOfResult, aa as baselineResultFor, ab as baselineSlots, ae as containsFormBlock, af as deriveSessionSegment, ag as detectDeviceClass, ah as detectTimeOfDay, ai as detectTrafficSource, al as readSnapshot, am as referrerDomainFromReferer, an as renderPrePaintScript, ao as toWireSlot, aq as writeSnapshot } from './session-meta-CY_Luh5i.cjs';
1
+ import { p as SentientConfig, o as SentientClient } from './index-DErBinAw.cjs';
2
+ export { A as AssignResult, a as Assignment, b as AssignmentCache, E as EventQueue, e as EventType, g as GraphClient, h as GraphConfig, i as GraphSnapshot, L as LEGACY_SESSION_COOKIE_NAME, M as MicroSignalEmitter, k as MicroSignalType, m as PageNode, Q as QueueConfig, q as SentientEvent, r as SessionConfig, s as SessionManager, t as attachMicroSignalDetectors, u as grantConsent, w as isDoNotTrackEnabled, B as sanitizePageUrl, F as sessionCookieName } from './index-DErBinAw.cjs';
3
+ import { I as CompoundLocator } from './session-meta-DydKfQiR.cjs';
4
+ export { B as BLOCK_ALIGNS, b as BLOCK_EMPHASES, c as BLOCK_FITS, d as BLOCK_GAPS, e as BLOCK_GRID_COLUMNS, f as BLOCK_HEADING_LEVELS, g as BLOCK_JUSTIFIES, h as BLOCK_MAX_WIDTHS, i as BLOCK_PADS, j as BLOCK_RATIOS, k as BLOCK_SIZES, l as BLOCK_SURFACES, m as BLOCK_TEXT_ALIGNS, n as BLOCK_TONES, o as BLOCK_WEIGHTS, p as BadgeBlock, q as BlockAlign, r as BlockEmphasis, s as BlockFit, t as BlockGap, u as BlockJustify, v as BlockMaxWidth, w as BlockNode, x as BlockPad, y as BlockRatio, z as BlockSize, C as BlockSurface, D as BlockTextAlign, E as BlockTone, F as BlockWeight, G as ButtonBlock, J as DecisionSnapshot, K as DividerBlock, L as FORM_FIELD_KINDS, M as FORM_INPUT_TYPES, N as FormBlock, O as FormField, P as GridBlock, Q as HeadingBlock, R as ImageBlock, S as LinkBlock, T as MAX_BLOCK_ARMS, U as MAX_BLOCK_CHILDREN, V as MAX_BLOCK_DEPTH, W as MAX_BLOCK_NODES, X as MAX_BLOCK_TEXT_LEN, Y as MAX_FORM_FIELDS, Z as MAX_FORM_SELECT_OPTIONS, _ as SNAPSHOT_STORAGE_KEY_PREFIX, a0 as SitePalette, a1 as SlotConfigEntry, a2 as SlotDeclInput, a3 as SlotOps, a4 as SpacerBlock, a5 as StackBlock, a6 as TextBlock, a9 as armOfResult, aa as baselineResultFor, ab as baselineSlots, ae as containsFormBlock, af as deriveSessionSegment, ag as detectDeviceClass, ah as detectTimeOfDay, ai as detectTrafficSource, al as readSnapshot, am as referrerDomainFromReferer, an as renderPrePaintScript, ao as toWireSlot, aq as writeSnapshot } from './session-meta-DydKfQiR.cjs';
5
5
  export { SlotResult } from '@sentientui/policy';
6
6
 
7
7
  /** Reads the rendered DOM to build the page-side context graph. */
@@ -1,7 +1,7 @@
1
- import { o as SentientConfig, n as SentientClient } from './index-BIdUwF-v.js';
2
- export { A as AssignResult, a as Assignment, b as AssignmentCache, E as EventQueue, e as EventType, g as GraphClient, h as GraphConfig, i as GraphSnapshot, L as LEGACY_SESSION_COOKIE_NAME, M as MicroSignalEmitter, k as MicroSignalType, l as PageNode, Q as QueueConfig, p as SentientEvent, q as SessionConfig, r as SessionManager, s as attachMicroSignalDetectors, t as grantConsent, v as isDoNotTrackEnabled, y as sanitizePageUrl, z as sessionCookieName } from './index-BIdUwF-v.js';
3
- import { I as CompoundLocator } from './session-meta-CY_Luh5i.js';
4
- export { B as BLOCK_ALIGNS, b as BLOCK_EMPHASES, c as BLOCK_FITS, d as BLOCK_GAPS, e as BLOCK_GRID_COLUMNS, f as BLOCK_HEADING_LEVELS, g as BLOCK_JUSTIFIES, h as BLOCK_MAX_WIDTHS, i as BLOCK_PADS, j as BLOCK_RATIOS, k as BLOCK_SIZES, l as BLOCK_SURFACES, m as BLOCK_TEXT_ALIGNS, n as BLOCK_TONES, o as BLOCK_WEIGHTS, p as BadgeBlock, q as BlockAlign, r as BlockEmphasis, s as BlockFit, t as BlockGap, u as BlockJustify, v as BlockMaxWidth, w as BlockNode, x as BlockPad, y as BlockRatio, z as BlockSize, C as BlockSurface, D as BlockTextAlign, E as BlockTone, F as BlockWeight, G as ButtonBlock, J as DecisionSnapshot, K as DividerBlock, L as FORM_FIELD_KINDS, M as FORM_INPUT_TYPES, N as FormBlock, O as FormField, P as GridBlock, Q as HeadingBlock, R as ImageBlock, S as LinkBlock, T as MAX_BLOCK_ARMS, U as MAX_BLOCK_CHILDREN, V as MAX_BLOCK_DEPTH, W as MAX_BLOCK_NODES, X as MAX_BLOCK_TEXT_LEN, Y as MAX_FORM_FIELDS, Z as MAX_FORM_SELECT_OPTIONS, _ as SNAPSHOT_STORAGE_KEY_PREFIX, a0 as SitePalette, a1 as SlotConfigEntry, a2 as SlotDeclInput, a3 as SlotOps, a4 as SpacerBlock, a5 as StackBlock, a6 as TextBlock, a9 as armOfResult, aa as baselineResultFor, ab as baselineSlots, ae as containsFormBlock, af as deriveSessionSegment, ag as detectDeviceClass, ah as detectTimeOfDay, ai as detectTrafficSource, al as readSnapshot, am as referrerDomainFromReferer, an as renderPrePaintScript, ao as toWireSlot, aq as writeSnapshot } from './session-meta-CY_Luh5i.js';
1
+ import { p as SentientConfig, o as SentientClient } from './index-DxWcBI5U.js';
2
+ export { A as AssignResult, a as Assignment, b as AssignmentCache, E as EventQueue, e as EventType, g as GraphClient, h as GraphConfig, i as GraphSnapshot, L as LEGACY_SESSION_COOKIE_NAME, M as MicroSignalEmitter, k as MicroSignalType, m as PageNode, Q as QueueConfig, q as SentientEvent, r as SessionConfig, s as SessionManager, t as attachMicroSignalDetectors, u as grantConsent, w as isDoNotTrackEnabled, B as sanitizePageUrl, F as sessionCookieName } from './index-DxWcBI5U.js';
3
+ import { I as CompoundLocator } from './session-meta-DydKfQiR.js';
4
+ export { B as BLOCK_ALIGNS, b as BLOCK_EMPHASES, c as BLOCK_FITS, d as BLOCK_GAPS, e as BLOCK_GRID_COLUMNS, f as BLOCK_HEADING_LEVELS, g as BLOCK_JUSTIFIES, h as BLOCK_MAX_WIDTHS, i as BLOCK_PADS, j as BLOCK_RATIOS, k as BLOCK_SIZES, l as BLOCK_SURFACES, m as BLOCK_TEXT_ALIGNS, n as BLOCK_TONES, o as BLOCK_WEIGHTS, p as BadgeBlock, q as BlockAlign, r as BlockEmphasis, s as BlockFit, t as BlockGap, u as BlockJustify, v as BlockMaxWidth, w as BlockNode, x as BlockPad, y as BlockRatio, z as BlockSize, C as BlockSurface, D as BlockTextAlign, E as BlockTone, F as BlockWeight, G as ButtonBlock, J as DecisionSnapshot, K as DividerBlock, L as FORM_FIELD_KINDS, M as FORM_INPUT_TYPES, N as FormBlock, O as FormField, P as GridBlock, Q as HeadingBlock, R as ImageBlock, S as LinkBlock, T as MAX_BLOCK_ARMS, U as MAX_BLOCK_CHILDREN, V as MAX_BLOCK_DEPTH, W as MAX_BLOCK_NODES, X as MAX_BLOCK_TEXT_LEN, Y as MAX_FORM_FIELDS, Z as MAX_FORM_SELECT_OPTIONS, _ as SNAPSHOT_STORAGE_KEY_PREFIX, a0 as SitePalette, a1 as SlotConfigEntry, a2 as SlotDeclInput, a3 as SlotOps, a4 as SpacerBlock, a5 as StackBlock, a6 as TextBlock, a9 as armOfResult, aa as baselineResultFor, ab as baselineSlots, ae as containsFormBlock, af as deriveSessionSegment, ag as detectDeviceClass, ah as detectTimeOfDay, ai as detectTrafficSource, al as readSnapshot, am as referrerDomainFromReferer, an as renderPrePaintScript, ao as toWireSlot, aq as writeSnapshot } from './session-meta-DydKfQiR.js';
5
5
  export { SlotResult } from '@sentientui/policy';
6
6
 
7
7
  /** Reads the rendered DOM to build the page-side context graph. */
@@ -1,2 +1,2 @@
1
- "use strict";var Jt=Object.create;var be=Object.defineProperty,Qt=Object.defineProperties,Vt=Object.getOwnPropertyDescriptor,Yt=Object.getOwnPropertyDescriptors,Zt=Object.getOwnPropertyNames,ut=Object.getOwnPropertySymbols,en=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty,tn=Object.prototype.propertyIsEnumerable;var pt=(e,t,n)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,x=(e,t)=>{for(var n in t||(t={}))gt.call(t,n)&&pt(e,n,t[n]);if(ut)for(var n of ut(t))tn.call(t,n)&&pt(e,n,t[n]);return e},q=(e,t)=>Qt(e,Yt(t));var nn=(e,t)=>{for(var n in t)be(e,n,{get:t[n],enumerable:!0})},ft=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of Zt(t))!gt.call(e,d)&&d!==n&&be(e,d,{get:()=>t[d],enumerable:!(a=Vt(t,d))||a.enumerable});return e};var rn=(e,t,n)=>(n=e!=null?Jt(en(e)):{},ft(t||!e||!e.__esModule?be(n,"default",{value:e,enumerable:!0}):n,e)),on=e=>ft(be({},"__esModule",{value:!0}),e);var Nr={};nn(Nr,{BLOCK_ALIGNS:()=>Tn,BLOCK_EMPHASES:()=>Pn,BLOCK_FITS:()=>Nn,BLOCK_GAPS:()=>kn,BLOCK_GRID_COLUMNS:()=>Bn,BLOCK_HEADING_LEVELS:()=>Mn,BLOCK_JUSTIFIES:()=>_n,BLOCK_MAX_WIDTHS:()=>$n,BLOCK_PADS:()=>Gn,BLOCK_RATIOS:()=>Ln,BLOCK_SIZES:()=>An,BLOCK_SURFACES:()=>Kn,BLOCK_TEXT_ALIGNS:()=>Dn,BLOCK_TONES:()=>On,BLOCK_WEIGHTS:()=>Rn,FORM_FIELD_KINDS:()=>Un,FORM_INPUT_TYPES:()=>Fn,LEGACY_SESSION_COOKIE_NAME:()=>ve,MAX_BLOCK_ARMS:()=>Xn,MAX_BLOCK_CHILDREN:()=>qn,MAX_BLOCK_DEPTH:()=>Hn,MAX_BLOCK_NODES:()=>zn,MAX_BLOCK_TEXT_LEN:()=>Jn,MAX_FORM_FIELDS:()=>jn,MAX_FORM_SELECT_OPTIONS:()=>Wn,SNAPSHOT_STORAGE_KEY_PREFIX:()=>oe,armOfResult:()=>Le,attachMicroSignalDetectors:()=>Rt,baselineResultFor:()=>ge,baselineSlots:()=>Ct,containsFormBlock:()=>At,deriveSessionSegment:()=>We,detectDeviceClass:()=>ce,detectTimeOfDay:()=>ue,detectTrafficSource:()=>le,grantConsent:()=>Bt,init:()=>Xt,isDoNotTrackEnabled:()=>Ee,locatorFromElement:()=>Ke,readSnapshot:()=>fe,referrerDomainFromReferer:()=>de,renderPrePaintScript:()=>It,sanitizePageUrl:()=>Je,sessionCookieName:()=>ie,toWireSlot:()=>we,writeSnapshot:()=>me});module.exports=on(Nr);function Te(){try{if(typeof crypto!="undefined"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch(e){}try{if(typeof crypto!="undefined"&&typeof crypto.getRandomValues=="function"){let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0"),(n===3||n===5||n===7||n===9)&&(t+="-");return t}}catch(e){}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function re(e){return e?`_${e.slice(0,12)}`:""}var ve="_snt_uid";function ie(e){return`${ve}${re(e)}`}var sn="_snt_uid",an=365,_e="_snt_uid";function cn(){return Te()}function mt(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function ln(e,t,n){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=strict; path=/`}catch(a){}}function $e(e){try{return localStorage.getItem(e)}catch(t){return null}}function yt(e,t){try{return localStorage.setItem(e,t),!0}catch(n){return!1}}function ht(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function dn(e,t){try{return sessionStorage.setItem(e,t),!0}catch(n){return!1}}function un(e){try{sessionStorage.removeItem(e)}catch(t){}}function pn(e){try{return document.cookie=`${e}_probe=1; max-age=1; SameSite=strict; path=/`,document.cookie.indexOf(`${e}_probe=1`)!==-1}catch(t){return!1}}function gn(e){try{localStorage.removeItem(e)}catch(t){}}function fn(e){try{document.cookie=`${e}=; max-age=0; SameSite=strict; path=/`}catch(t){}}var mn={getSessionId:()=>null,isEphemeral:()=>!1,destroy:()=>{}};function Ae(e){var S,y,C,E,A,K,O;if(typeof window=="undefined")return mn;let t=re(e==null?void 0:e.apiKey),n=(S=e==null?void 0:e.cookieName)!=null?S:ie(e==null?void 0:e.apiKey),a=`${_e}${t}`,d=`${_e}_tomb${t}`,c=((y=e==null?void 0:e.cookieTTLDays)!=null?y:an)*24*60*60,i=D=>D&&D.length>0?D:null,u=()=>{var D,P;return t&&!(e!=null&&e.cookieName)&&$e(d)===null?(P=(D=i(mt(sn)))!=null?D:i($e(_e)))!=null?P:i(ht(_e)):null},l=(O=(K=(A=(E=(C=i(mt(n)))!=null?C:i($e(a)))!=null?E:i(ht(a)))!=null?A:u())!=null?K:i(e==null?void 0:e.ssrSessionId))!=null?O:cn();ln(n,l,c);let r=yt(a,l),s=pn(n),f=r?!1:dn(a,l),g=!r&&!s&&!f;return{getSessionId:()=>l,isEphemeral:()=>g,destroy:()=>{l=null,fn(n),gn(a),un(a),t&&!(e!=null&&e.cookieName)&&yt(d,"1")}}}function Y(e){return Math.min(6e4,1e3*2**Math.min(e,6))}function ae(e){if(e.ok===!0)return"delivered";let{status:t}=e;return typeof t!="number"?"retry":t>=200&&t<300?"delivered":t>=400&&t<500&&t!==429?"dropped":"retry"}function Re(e,t){try{let n=localStorage.getItem(e);if(!n)return[];let a=JSON.parse(n);return Array.isArray(a)?(localStorage.removeItem(e),a.slice(-t)):[]}catch(n){return[]}}function Z(e,t,n){try{let a=(()=>{try{let o=localStorage.getItem(n);if(!o)return[];let c=JSON.parse(o);return Array.isArray(c)?c:[]}catch(o){return[]}})(),d=new Map;for(let o of a)d.set(o.id,o);for(let o of e)d.set(o.id,o);localStorage.setItem(n,JSON.stringify([...d.values()].slice(-t)))}catch(a){}}function Oe(e,t){try{let n=localStorage.getItem(t);if(!n)return;let a=JSON.parse(n);if(!Array.isArray(a))return;let d=new Set(e),o=a.filter(c=>!d.has(c.id));if(o.length===a.length)return;o.length===0?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(o))}catch(n){}}var yn=500,hn=56*1024;function Ue(e){return`_snt_retry_${e.slice(0,12)}`}var Sn={push:()=>{},flush:()=>{},destroy:()=>{}};function St(e){var X,ee,ye;if(typeof window=="undefined")return Sn;let t=(X=e.flushIntervalMs)!=null?X:5e3,n=(ee=e.maxBatchSize)!=null?ee:20,a=(ye=e.maxRetrySize)!=null?ye:100,d=e.ingestUrl,o=e.apiKey,c=Ue(o),i=[],u=new Set,l=[],r=v=>{for(let I of v)s.delete(I),!u.has(I)&&(u.add(I),l.push(I));for(;l.length>yn;){let I=l.shift();I&&u.delete(I)}Oe(v,c)},s=new Set,f=()=>{for(;i.length>a;){let v=i.shift();v&&s.delete(v.id)}},g=v=>{u.has(v.id)||s.has(v.id)||(s.add(v.id),i.push(v),f())},S=v=>{for(let I of v)u.has(I.id)||(s.add(I.id),i.push(I));f()},y=Re(c,a);for(let v of y)g(v);let C=0,E=0,A=(v,I=!0)=>{if(v.length===0)return;let J=JSON.stringify(v),G=v.map($=>$.id),z;try{z=fetch(d,{method:"POST",keepalive:!0,body:J,headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}})}catch($){Z(v,a,c),S(v),E++,C=Date.now()+Y(E);return}let Ie=$=>{if(ae($)!=="retry"){if(!$.ok&&I){let te=v.filter(F=>F.eventType!=="pageview");if(te.length>0&&te.length<v.length){r(v.filter(F=>F.eventType==="pageview").map(F=>F.id)),A(te,!1);return}}r(G),E=0,C=0;return}Z(v,a,c),S(v),E++,C=Date.now()+Y(E)};z instanceof Promise?z.then(Ie).catch(()=>{Z(v,a,c),S(v),E++,C=Date.now()+Y(E)}):Ie(z)},K=typeof TextEncoder!="undefined"?new TextEncoder:null,O=v=>K?K.encode(v).length:v.length,D=v=>{let I=[],J=2;for(let G of v){let z=O(JSON.stringify(G))+1;if(I.length>0&&J+z>hn||I.length>=n)break;I.push(G),J+=z}return I},P=()=>{try{if(Date.now()<C)return;for(;i.length>0&&!(Date.now()<C);){let v=i.filter(J=>!u.has(J.id));if(i.length=0,v.length===0)break;let I=D(v);if(I.length===0)break;I.length<v.length&&i.push(...v.slice(I.length)),A(I)}}catch(v){}},h=!0,L=null;L=setInterval(()=>{h&&P()},t);let j=()=>{document.visibilityState==="hidden"&&P()},W=()=>{P()};return document.addEventListener("visibilitychange",j),window.addEventListener("pagehide",W),{push(v){g(v),i.length>=n&&P()},flush:P,destroy(){h=!1,L!==null&&(clearInterval(L),L=null),document.removeEventListener("visibilitychange",j),window.removeEventListener("pagehide",W),P()}}}var bn=200;function Fe(e){return`_snt_goal_retry_${e.slice(0,12)}`}var vn={send:()=>{},flush:()=>{},destroy:()=>{}};function bt(e){var O,D,P;if(typeof window=="undefined")return vn;let t=(O=e.flushIntervalMs)!=null?O:5e3,n=(D=e.maxRetrySize)!=null?D:100,a=(P=e.maxPerFlush)!=null?P:5,d=Fe(e.apiKey),o=[],c=new Set,i=new Set,u=[],l=0,r=0,s=!1,f=h=>{for(c.delete(h.id),i.has(h.id)||(i.add(h.id),u.push(h.id));u.length>bn;){let L=u.shift();L&&i.delete(L)}Oe([h.id],d)},g=h=>{Z([h],n,d),!i.has(h.id)&&!c.has(h.id)&&(c.add(h.id),o.push(h)),Date.now()>=l&&(r++,l=Date.now()+Y(r))},S=h=>{let L;try{L=fetch(e.url,{method:"POST",keepalive:!0,body:h.body,headers:e.headers})}catch(W){g(h);return}let j=W=>{var ee;let X=ae(W);if(X==="retry"){g(h);return}X==="dropped"&&((ee=e.onDrop)==null||ee.call(e,h,W.status)),f(h),r=0,l=0};L instanceof Promise?L.then(j).catch(()=>g(h)):j(L)},y=()=>{try{if(s||Date.now()<l)return;let h=0;for(;o.length>0&&h<a&&!(Date.now()<l);){let L=o.shift();c.delete(L.id),!i.has(L.id)&&(h++,S(L))}}catch(h){}},C=Re(d,n);for(let h of C)c.has(h.id)||(c.add(h.id),o.push(h));C.length>0&&Z(C,n,d);let E=setInterval(y,t),A=()=>{document.visibilityState==="hidden"&&y()},K=()=>y();return document.addEventListener("visibilitychange",A),window.addEventListener("pagehide",K),{send(h){if(!s&&!(i.has(h.id)||c.has(h.id))){if(Date.now()<l){Z([h],n,d),c.add(h.id),o.push(h);return}S(h)}},flush:y,destroy(){clearInterval(E),document.removeEventListener("visibilitychange",A),window.removeEventListener("pagehide",K),y(),s=!0}}}var wn=1800*1e3;function Pe(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function vt(e=wn,t){let n=new Map,a=`_snt_asgn${re(t)}_`,d=(l,r)=>`${a}${encodeURIComponent(l)}:${encodeURIComponent(r)}`,o=l=>{let r=l.slice(a.length),s=r.indexOf(":");if(s<0)return null;try{return{componentId:decodeURIComponent(r.slice(0,s)),segment:decodeURIComponent(r.slice(s+1))}}catch(f){return null}},c=()=>{try{let l=[];for(let r=0;r<localStorage.length;r++){let s=localStorage.key(r);s!=null&&s.startsWith(a)&&l.push(s)}return l}catch(l){return[]}},i=l=>l.assignedAt+(l.ttlMs&&l.ttlMs>0?l.ttlMs:e)<Date.now();return typeof window!="undefined"&&(()=>{for(let l of c())try{let r=localStorage.getItem(l);if(!r)continue;let s=JSON.parse(r);if(i(s)){localStorage.removeItem(l);continue}let f=o(l);if(!f)continue;n.set(Pe(f.componentId,f.segment),s)}catch(r){}})(),{get(l,r){let s=n.get(Pe(l,r));return s?i(s)?(n.delete(Pe(l,r)),null):s:null},set(l,r,s){let f=Pe(l,r);n.set(f,s);try{localStorage.setItem(d(l,r),JSON.stringify(s))}catch(g){}},clear(){n.clear();for(let l of c())try{localStorage.removeItem(l)}catch(r){}}}}var wt=["GPTBot","ChatGPT-User","OAI-SearchBot","ClaudeBot","Claude-User","Claude-SearchBot","PerplexityBot","Perplexity-User","Google-Extended","Applebot-Extended","Meta-ExternalAgent","Bytespider","CCBot","Amazonbot","cohere-ai","Diffbot"];function De(e){return xt(e)!==null}function xt(e){var n;if(!e)return null;let t=e.toLowerCase();return(n=wt.find(a=>t.includes(a.toLowerCase())))!=null?n:null}function ce(e){let t=e.toLowerCase();return/ipad|tablet|playbook|kindle|silk/.test(t)?"tablet":/mobi|iphone|ipod|android.*mobile|phone/.test(t)?"mobile":"desktop"}function le(e,t){if(!e)return"direct";try{let n=new URL(e);if(t)try{if(new URL(t).host===n.host)return"direct"}catch(d){}let a=n.hostname.toLowerCase();return/(^|\.)(google|bing|duckduckgo|yahoo)\./.test(a)?"search":/(^|\.)(twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|t\.co)$/.test(a)?"social":"referral"}catch(n){return"direct"}}function de(e){if(!e)return null;try{return new URL(e).hostname}catch(t){return null}}var Et=["gclid","gbraid","wbraid","fbclid","ttclid","msclkid","twclid","li_fat_id"];function je(e){let t={},n={};try{let a=typeof e=="string"||e instanceof URLSearchParams?new URLSearchParams(e):Object.entries(e).flatMap(([d,o])=>{let c=Array.isArray(o)?o[0]:o;return c===void 0?[]:[[d,c]]});for(let[d,o]of a)d.startsWith("utm_")?d in t||(t[d]=o):Et.includes(d)&&(d in n||(n[d]=o))}catch(a){}return{utmParams:t,clickIds:n}}function ue(e){let t=e.getHours();return t<6?"night":t<12?"morning":t<18?"afternoon":"evening"}function We(e){let t=xn("__segment__",e);return`${t.deviceClass}:${t.trafficSource}`}function xn(e,t){var o,c,i,u,l,r,s,f;let n=(c=(o=t==null?void 0:t.userAgent)==null?void 0:o.trim())!=null?c:"",a=(u=(i=t==null?void 0:t.referer)==null?void 0:i.trim())!=null?u:"",d=(l=t==null?void 0:t.now)!=null?l:new Date;return{sessionId:e,ephemeral:!1,utmParams:(r=t==null?void 0:t.utmParams)!=null?r:{},clickIds:(s=t==null?void 0:t.clickIds)!=null?s:{},deviceClass:n?ce(n):"desktop",trafficSource:a?le(a,t==null?void 0:t.appOrigin):"direct",referrerDomain:de(a),timeOfDay:ue(d),dayOfWeek:(f=["sun","mon","tue","wed","thu","fri","sat"][d.getDay()])!=null?f:"sun",automation:(t==null?void 0:t.webdriver)===!0||De(n)}}var pe=require("@sentientui/policy");function we(e){return x(x(x({id:e.id},e.arms?{arms:[...e.arms]}:{}),e.dims?{dims:Object.fromEntries(Object.entries(e.dims).map(([t,n])=>[t,[...n]]))}:{}),e.baseline!==void 0?{baseline:e.baseline}:{})}function ge(e){let t=we(e);return(0,pe.slotResultFor)(t,(0,pe.slotBaselineArm)(t))}function Ct(e){let t={};for(let n of e)t[n.id]=ge(n);return t}function Le(e){return typeof e=="string"?e:(0,pe.canonicalArm)(e)}var oe="_snt_snap:",En=["low","medium","high"];function fe(e){try{let t=localStorage.getItem(oe+e);if(!t)return null;let n=JSON.parse(t);return!n||typeof n!="object"||n.v!==1||typeof n.persona!="string"||typeof n.band!="string"||!En.includes(n.band)||typeof n.slots!="object"||n.slots===null||Array.isArray(n.slots)||!(n.layoutOrder===null||Array.isArray(n.layoutOrder))||typeof n.savedAt!="number"||!(n.slotConfig===void 0||typeof n.slotConfig=="object"&&n.slotConfig!==null&&!Array.isArray(n.slotConfig))?null:n}catch(t){return null}}function me(e,t){try{localStorage.setItem(oe+e,JSON.stringify(t))}catch(n){}}function It(e){return"(function(){try{var r=localStorage.getItem("+JSON.stringify(oe+e).replace(/</g,"\\u003c")+');if(!r)return;var s=JSON.parse(r);if(!s||s.v!==1||typeof s.persona!=="string"||typeof s.band!=="string")return;var d=document.documentElement;if(d.hasAttribute("data-sentient-persona"))return;d.setAttribute("data-sentient-persona",s.persona);d.setAttribute("data-sentient-confidence",s.band);}catch(e){}})();'}var He=require("@sentientui/policy");var Be=require("@sentientui/policy");var kt="[sentient] No API key configured \u2014 nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY or pass localMode: true for local development.",Cn="[sentient] Local mode \u2014 decisions are simulated on-device and nothing is sent over the network. Add an API key to learn from real traffic.",Tt=!1,Ne=!1;function In(){var e;try{return(e=new URLSearchParams(window.location.search).get("sentient_persona"))!=null?e:void 0}catch(t){return}}function _t(e){var l;let t=Ae({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),n=(l=t.getSessionId())!=null?l:"local",a=In(),d=import("@sentientui/core/local").then(r=>{let s=r;return s.LOCAL_ENGINE_AVAILABLE?(Tt||(Tt=!0,console.info(Cn)),s):(Ne||(Ne=!0,console.error(kt)),null)}).catch(()=>(Ne||(Ne=!0,console.error(kt)),null)),o=null,c={low:.15,medium:.5,high:.85},i=(()=>{var s;if(e.initialPersona)return x({},e.initialPersona);let r=fe(e.apiKey||"local");return r?{persona:r.persona,confidence:(s=c[r.band])!=null?s:.15}:null})();function u(r){let s=document.documentElement;s.dataset.sentientPersona===void 0&&(s.dataset.sentientPersona=r.persona,s.dataset.sentientConfidence=(0,Be.confidenceBand)(r.confidence))}return{isLocal:!0,async decide(r){var g,S,y;let s=await d;if(!s)return null;let f=s.createLocalEngine({sessionId:n,forcedPersona:a}).decide(r);return o=q(x({},f),{layoutOrder:(S=(g=f.layoutOrder)!=null?g:o==null?void 0:o.layoutOrder)!=null?S:null,slots:x(x({},(y=o==null?void 0:o.slots)!=null?y:{}),f.slots)}),me(e.apiKey||"local",{v:1,persona:o.persona,band:(0,Be.confidenceBand)(o.confidence),slots:o.slots,layoutOrder:o.layoutOrder,savedAt:Date.now()}),u(f),f},getSlotResult(r){var s,f,g;return(g=(f=o==null?void 0:o.slots[r])!=null?f:(s=e.initialSlots)==null?void 0:s[r])!=null?g:null},getSlotConfig(r){var s,f;return(f=(s=e.initialSlotConfig)==null?void 0:s[r])!=null?f:null},getSitePalette(){var r;return(r=e.initialPalette)!=null?r:null},reportSlots(){},getPersona(){let r=o!=null?o:i;return r?{persona:r.persona,confidence:r.confidence,band:(0,Be.confidenceBand)(r.confidence)}:null},async assign(r,s){var S;let f=await d;return!f||!s||s.length===0?s!=null&&s[0]?{variantId:s[0],assignmentTtlMs:0}:null:{variantId:(S=f.createLocalEngine({sessionId:n,forcedPersona:a}).decide({components:[{id:r,variantIds:s}]}).assignments[r])!=null?S:s[0],assignmentTtlMs:0}},track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),dispose:()=>{},destroy:()=>t.destroy()}}var kn=["none","sm","md","lg"],Tn=["start","center","end","stretch"],_n=["start","center","end","between"],An=["sm","md","lg"],Rn=["normal","medium","bold"],On=["default","muted","accent"],Pn=["primary","secondary","ghost"],Dn=["left","center","right"],Ln=["auto","square","landscape","wide"],Nn=["cover","contain"],Bn=[2,3,4],Mn=[2,3,4],Kn=["default","raised"],Gn=["none","sm","md","lg"],$n=["measure"],Un=["input","textarea","select"],Fn=["text","email","number","tel"],jn=5,Wn=8,zn=64,Hn=5,qn=12,Xn=4,Jn=500;function At(e){if(e==null||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.type==="form"?!0:Array.isArray(t.children)?t.children.some(At):!1}function Rt(e,t,n,a){let d=[];{let i=!1,u=[],l=()=>{if(i)return;let r=Date.now();for(u.push(r);u.length>0&&r-u[0]>500;)u.shift();u.length>=3&&(i=!0,e("rage_click"))};t.addEventListener("click",l),d.push(()=>t.removeEventListener("click",l))}{let o=!1,c=i=>{if(o||!(i.target instanceof Node)||!t.contains(i.target)&&t!==i.target)return;o=!0;let u=typeof window!="undefined"?window.getSelection():null,l=u?u.toString().length:0;e("text_copy",{selectionLength:l})};document.addEventListener("copy",c),d.push(()=>document.removeEventListener("copy",c))}{let o=!1,c=!1,i=null,u=()=>{i!==null&&(clearTimeout(i),i=null)},l=()=>{o||!c||(u(),i=setTimeout(()=>{!o&&c&&(o=!0,e("scroll_hesitation"))},3e3))},r=()=>{u(),l()},s=g=>{for(let S of g)c=S.intersectionRatio>.3,c?l():u()},f=new IntersectionObserver(s,{threshold:[.3]});f.observe(t),window.addEventListener("scroll",r,{passive:!0}),d.push(()=>{f.disconnect(),window.removeEventListener("scroll",r),u()})}if((a==null?void 0:a.tabLoss)!==!1){let o=!1,c=n!=null?n:Date.now(),i=()=>{if(o||document.visibilityState!=="hidden")return;let u=Date.now()-c;u<15e3&&(o=!0,e("tab_loss",{timeOnPage:u}))};document.addEventListener("visibilitychange",i),d.push(()=>document.removeEventListener("visibilitychange",i))}return()=>{for(let o of d)o()}}function Qn(){var e;return typeof process=="undefined"||((e=process.env)==null?void 0:e.NODE_ENV)!=="production"}var Ot="https://api.sentient-ui.com/v1/events",U=new Map,Pt=null;function Dt(e,t){let n=U.get(e);n&&n.upgrade&&(n.reinit=t)}function Vn(e){return"value"in e||"currency"in e||"externalId"in e||"metadata"in e||"weight"in e||"stepIndex"in e}var Yn=3;function ze(){return Te()}function Me(){var e;if(typeof window!="undefined")return((e=window.location)==null?void 0:e.pathname)||void 0}function Zn(){let e=new WeakMap,t=new Map,n=!1,a=(i,u,l)=>{let r=i.get(u);return l===null?r?!0:(i.set(u,new Set),!1):r?r.has(l)?!0:(r.add(l),!1):(i.set(u,new Set([l])),!1)},d=typeof window!="undefined"&&"event"in window,o=()=>{if(!d)return;let i=window.event;return typeof Event=="function"&&i instanceof Event?i:void 0},c=()=>{if(d){Promise.resolve().then(()=>{n=!1,t.clear()});return}let i=!1,u=()=>{i||(i=!0,n=!1,t.clear())};if(setTimeout(u,0),typeof MessageChannel=="function"){let l=new MessageChannel;l.port1.onmessage=()=>{l.port1.close(),l.port2.close(),u()},l.port2.postMessage(0)}};return{firedBefore(i,u){let l=o();if(l){let s=e.get(l);return s||(s=new Map,e.set(l,s)),a(s,i,u)}let r=a(t,i,u);return!r&&!n&&(n=!0,c()),r}}}var Lt=new Set;function er(e,t,n){let a=typeof window=="undefined"?null:window.history;if(!a)return()=>{};let d=!1,o,c=()=>{if(d)return;let l=Me();!l||l===o||(o=l,e.track({projectId:t,componentId:"__page__",eventType:"pageview",payload:{}}),n(`${t}:${l}`))},i=[];for(let l of["pushState","replaceState"]){let r=a[l],s=function(...f){let g=r.apply(this,f);return c(),g};a[l]=s,i.push([l,r,s])}window.addEventListener("popstate",c);let u=Me();return u&&Lt.has(`${t}:${u}`)?o=u:c(),()=>{if(!d){d=!0,window.removeEventListener("popstate",c);for(let[l,r,s]of i)a[l]===s&&(a[l]=r)}}}var xe={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,assign:()=>Promise.resolve(null),decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),dispose:()=>{},destroy:()=>{}};function tr(){try{return je(window.location.search)}catch(e){return{utmParams:{},clickIds:{}}}}function Nt(e){return e.replace(/\/events\/?$/,"")}function Ee(){return typeof navigator!="undefined"&&navigator.globalPrivacyControl===!0?!0:[typeof navigator!="undefined"?navigator.doNotTrack:void 0,typeof window!="undefined"?window.doNotTrack:void 0,typeof navigator!="undefined"?navigator.msDoNotTrack:void 0].some(t=>t==="1"||t==="yes")}function Bt(e){var u;if(typeof window=="undefined")return;let t=e!=null?e:Pt;if(!t){console.warn("[sentient] grantConsent() called before init()");return}let n=U.get(t);if(!n){console.warn("[sentient] grantConsent() called before init()");return}let{config:a,upgrade:d,reinit:o}=n;if(!d){n.upgradeBlockedReason&&console.warn(n.upgradeBlockedReason);return}if(a.respectDoNotTrack!==!1&&Ee())return;let c=(o!=null?o:Xe)(q(x({},a),{consent:!0}));d(c);let i=(u=U.get(t))==null?void 0:u.dispose;U.set(t,{config:q(x({},a),{consent:!0}),upgrade:null,dispose:i})}function nr(e){var l;let t=e.preConsentBehavior==="statistical_winner",n=Nt((l=e.ingestUrl)!=null?l:Ot),a={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},d=new Map,o=new Map,c={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),assign(r,s,f){if(!t)return Promise.resolve(null);let g=d.get(r);return g?Promise.resolve(g):qe(o,r,async()=>{try{let S=new URLSearchParams({componentId:r});for(let A of s!=null?s:[])S.append("variantIds[]",A);let y=await fetch(`${n}/winner?${S.toString()}`,{headers:a});if(!y.ok)return s!=null&&s[0]?{variantId:s[0],assignmentTtlMs:0}:null;let E={variantId:(await y.json()).variantId,assignmentTtlMs:0};return d.set(r,E),E}catch(S){return s!=null&&s[0]?{variantId:s[0],assignmentTtlMs:0}:null}})},decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,getGraph:()=>({pageNodes:[],capturedAt:0}),dispose:()=>{},destroy:()=>{}},i={track:r=>c.track(r),goal:((r,s,f,g)=>c.goal(r,s,f,g)),componentGoal:(r,s,f)=>c.componentGoal(r,s,f),identify:r=>c.identify(r),getAssignment:(r,s)=>c.getAssignment(r,s),assign:(r,s,f,g)=>c.assign(r,s,f,g),decide:r=>c.decide(r),getSlotResult:r=>c.getSlotResult(r),getSlotConfig:r=>c.getSlotConfig(r),getSitePalette:()=>c.getSitePalette(),reportSlots:(r,s)=>c.reportSlots(r,s),getPersona:()=>c.getPersona(),fetchWeights:()=>c.fetchWeights(),getGraph:()=>c.getGraph(),dispose:()=>c.dispose(),destroy:()=>c.destroy()};function u(r){c=r}return{proxy:i,setInner:u}}function qe(e,t,n){let a=e.get(t);if(a)return a;let d=(async()=>{try{return await n()}finally{e.delete(t)}})();return e.set(t,d),d}function Xe(e){var Ze,et,tt,nt,rt,ot,st,it,at,ct;if(typeof window=="undefined")return xe;Pt=e.apiKey||"local";let t=U.get(e.apiKey||"local");if(t!=null&&t.dispose)try{t.dispose()}catch(p){}let n=e.respectDoNotTrack!==!1&&Ee(),a=e.consent===!1||n,d=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_");if(e.localMode===!0||!d&&e.localMode!==!1)return U.set(e.apiKey||"local",{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): this client is keyless/local \u2014 there is no hosted client to upgrade to. Configure a pk_ API key to enable tracking."}),a?xe:_t(e);if(a){if(!e.apiKey||!e.apiKey.startsWith("pk_"))return e.preConsentBehavior==="statistical_winner"&&console.warn("[sentient] init() called with an invalid apiKey \u2014 expected a pk_ public key. SDK disabled."),U.set(e.apiKey||"local",{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): the client was initialized with an invalid apiKey (expected a pk_ public key) \u2014 consent cannot enable tracking."}),xe;let{proxy:p,setInner:m}=nr(e);return U.set(e.apiKey,{config:e,upgrade:n?null:m}),p}if(!e.apiKey||!e.apiKey.startsWith("pk_"))return console.warn("[sentient] init() called with an invalid apiKey \u2014 expected a pk_ public key. SDK disabled."),xe;if(e.ingestUrl==="")return console.warn("[sentient] init() called with an empty ingestUrl. SDK disabled."),xe;let o=(Ze=e.ingestUrl)!=null?Ze:Ot,c=Date.now(),i=Ae({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),u=vt(void 0,e.apiKey),l=St({ingestUrl:o,apiKey:e.apiKey}),r=Nt(o),s={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},f=new Set,g=bt({url:`${r}/goals`,apiKey:e.apiKey,headers:s,onDrop:(p,m)=>{if(!e.debug){if(f.has(m))return;f.add(m)}console.warn(`[sentient] goal dropped (HTTP ${m}) \u2014 this will not be retried. `+(m===400?"The session was not found: call init() and let the session upsert complete before firing goals.":m===401||m===403?"Check the API key and that this origin is on the project allowlist.":"See the response status for the cause."),p)}}),S=ce((et=navigator.userAgent)!=null?et:""),y=window.location.origin,C=le((tt=document.referrer)!=null?tt:"",y),E=(nt=e.sessionSegment)!=null?nt:`${S}:${C}`,A=new Map,K=new Map,O=new Map,D=new Map,P=null,h=null,L=new Set,j=new Set,W=new Map,X=null,ee=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/,ye=new Set,v=p=>{for(let m of p)O.has(m.id)||O.set(m.id,ge(m))};if(e.initialSlots)for(let[p,m]of Object.entries(e.initialSlots))O.set(p,m);if(e.initialSlotConfig)for(let[p,m]of Object.entries(e.initialSlotConfig))D.set(p,m);e.initialPalette&&(P=e.initialPalette);let I=fe(e.apiKey);if(I){for(let[p,m]of Object.entries(I.slots))O.has(p)||O.set(p,m);for(let[p,m]of Object.entries((rt=I.slotConfig)!=null?rt:{}))D.has(p)||D.set(p,m);!P&&I.palette&&(P=I.palette)}let J={low:.15,medium:.5,high:.85};if(e.initialPersona)h=x({},e.initialPersona);else{let p=document.documentElement.dataset;p.sentientPersona?h={persona:p.sentientPersona,confidence:(st=J[(ot=p.sentientConfidence)!=null?ot:"low"])!=null?st:.15}:I&&(h={persona:I.persona,confidence:(it=J[I.band])!=null?it:.15})}if(e.initialAssignments)for(let[p,m]of Object.entries(e.initialAssignments))u.set(p,E,{variantId:m,assignedAt:Date.now(),segment:E,confidence:1});let G=Promise.resolve(),z=i.getSessionId();if(z){let p=de((at=document.referrer)!=null?at:""),{utmParams:m,clickIds:b}=tr(),k=x(x(x(x({sessionId:z,deviceClass:S,trafficSource:C,referrerDomain:p,utmParams:m,clickIds:b,timeOfDay:ue(new Date),dayOfWeek:["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()],ephemeral:i.isEphemeral(),automation:typeof navigator!="undefined"&&navigator.webdriver===!0||De((ct=navigator.userAgent)!=null?ct:"")},e.userId?{userId:e.userId}:{}),e.persona?{persona:e.persona}:{}),e.country?{country:e.country}:{}),e.sdk?{sdk:e.sdk.name,sdkVersion:e.sdk.version}:{}),R=async()=>{for(let w=0;;w++){try{let _=await fetch(`${r}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(k),headers:s});if(_.status===402){console.warn("[SentientUI] Session limit exceeded for this project. The bandit will stop learning until the limit resets. Upgrade at sentient-ui.com/pricing");return}if(_.ok||ae(_)==="dropped")return}catch(_){}if(w>=Yn){console.warn("[SentientUI] Could not register the session after retries. Conversions in this visit may not be recorded.");return}await new Promise(_=>setTimeout(_,Y(w+1)))}};try{G=R()}catch(w){}}e.debug&&(console.log("[sentient] initialized",{context:e.context}),window.__sentient={client:null,queue:l});let Ie=Zn(),$=null,te=!1,F={goal(p,m={},b=1,k=0){var he,Se,se,T,Q,ke,N;let R=i.getSessionId();if(!R)return;let w=Vn(m)?m:{metadata:m},_=[p,(he=w.externalId)!=null?he:"",(Se=w.stepIndex)!=null?Se:k,(se=w.weight)!=null?se:b].join("\0"),B=w.value!==void 0?`${w.value}\0${(T=w.currency)!=null?T:""}`:null;if(Ie.firedBefore(_,B)){e.debug&&console.log(`[sentient] goal("${p}") already recorded for this action \u2014 not sent twice`);return}let M=ze(),V={sessionId:R,name:p,metadata:(Q=w.metadata)!=null?Q:{},weight:(ke=w.weight)!=null?ke:b,stepIndex:(N=w.stepIndex)!=null?N:k,goalId:M,value:w.value,currency:w.currency,externalId:w.externalId};e.debug&&console.log("[sentient] goal",V);let ne={id:M,body:JSON.stringify(V)};G.then(()=>g.send(ne))},componentGoal(p,m,b){var M,V,ne;let k=i.getSessionId();if(!k)return;let R=u.get(p,E),w=R?null:(M=O.get(p))!=null?M:null;if(!R&&w===null){e.debug&&console.warn(`[sentient] componentGoal("${p}"): no assignment or slot decision yet \u2014 render its <Adaptive>/adaptive hook or call assign()/decide() before recording a goal.`);return}let _=R?R.variantId:Le(w),B={id:ze(),sessionId:k,projectId:e.apiKey,componentId:p,variantId:_,eventType:"goal_achieved",goalType:m,payload:x({reward:(V=b==null?void 0:b.reward)!=null?V:1,goalValue:b==null?void 0:b.value,currency:b==null?void 0:b.currency},(ne=b==null?void 0:b.metadata)!=null?ne:{}),timestamp:Date.now(),timeInSession:Date.now()-c,path:Me()};e.debug&&console.log("[sentient] componentGoal",B),G.then(()=>l.push(B))},identify(p){let m=i.getSessionId();m&&G.then(()=>{fetch(`${r}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify({sessionId:m,userId:p,ephemeral:i.isEphemeral()}),headers:s}).catch(()=>{})})},track(p){let m=i.getSessionId();if(!m)return;let b=q(x({path:Me()},p),{id:ze(),sessionId:m,timestamp:Date.now(),timeInSession:Date.now()-c});e.debug&&console.log("[sentient] track",b),G.then(()=>l.push(b))},getAssignment(p,m){return u.get(p,m)},async assign(p,m,b,k){let R=i.getSessionId();if(!R)return null;let w=u.get(p,E);if(w&&(m!=null&&m.length||w.content!==void 0)){let _=w.ttlMs&&w.ttlMs>0?Math.max(0,w.assignedAt+w.ttlMs-Date.now()):0;return{variantId:w.variantId,assignmentTtlMs:_,content:w.content}}return qe(A,p,async()=>{await G;try{let _={sessionId:R,componentId:p,variantIds:m};k!==void 0?_.agentDataByVariant=k:b!==void 0&&(_.agentData=b);let B=await fetch(`${r}/assign`,{method:"POST",body:JSON.stringify(_),headers:s});if(!B.ok)return null;let M=await B.json();return u.set(p,E,x({variantId:M.variantId,assignedAt:Date.now(),segment:E,confidence:1,content:M.content},M.assignmentTtlMs&&M.assignmentTtlMs>0?{ttlMs:M.assignmentTtlMs}:{})),M}catch(_){return null}})},async decide(p){var w,_;let m=i.getSessionId();if(!m)return null;let b=(w=p.slots)!=null?w:[],k={sessionId:m};p.sections&&p.sections.length>0&&(k.sections=p.sections.map(B=>({id:B}))),k.components=(_=p.components)!=null?_:[],b.length>0&&(k.slots=b.map(we)),p.slotsFrom==="registry"&&(k.slotsFrom="registry"),p.v&&(k.v=p.v),typeof p.pp=="number"&&(k.pp=p.pp),e.persona&&(k.persona=e.persona);let R=JSON.stringify(k);return qe(K,R,async()=>{var B,M,V,ne,he,Se;await G;try{let se=await fetch(`${r}/decide`,{method:"POST",body:R,headers:s});if(!se.ok)return v(b),null;let T=await se.json(),Q={};for(let N of b){let H=(B=T.slots)==null?void 0:B[N.id];if(H!==void 0){Q[N.id]=H,O.set(N.id,H);continue}let lt=O.get(N.id);if(lt!==void 0)Q[N.id]=lt;else{let dt=ge(N);Q[N.id]=dt,O.set(N.id,dt)}}if(T.slots)for(let[N,H]of Object.entries(T.slots))N in Q||(Q[N]=H,O.set(N,H));let ke=h!=null&&h.persona!=="unknown";T.persona&&!(T.persona==="unknown"&&ke)?h={persona:T.persona,confidence:(M=T.confidence)!=null?M:0}:h||(h={persona:"unknown",confidence:0});for(let[N,H]of Object.entries((V=T.assignments)!=null?V:{}))u.set(N,E,{variantId:H,assignedAt:Date.now(),segment:E,confidence:1});if(T.slotConfig)for(let[N,H]of Object.entries(T.slotConfig))D.set(N,H);return T.palette&&(P=T.palette),me(e.apiKey,x(x({v:1,persona:h.persona,band:(0,He.confidenceBand)(h.confidence),slots:Object.fromEntries(O),layoutOrder:(ne=T.layoutOrder)!=null?ne:null,savedAt:Date.now()},D.size>0?{slotConfig:Object.fromEntries(D)}:{}),P?{palette:P}:{})),x(x(x(x({layoutOrder:(he=T.layoutOrder)!=null?he:null,assignments:(Se=T.assignments)!=null?Se:{},slots:Q,persona:h.persona,confidence:h.confidence},T.slotConfig?{slotConfig:T.slotConfig}:{}),T.goals?{goals:T.goals}:{}),T.sectionMap?{sectionMap:T.sectionMap}:{}),T.palette?{palette:T.palette}:{})}catch(se){return v(b),null}})},getSlotResult(p){var m;return(m=O.get(p))!=null?m:null},getSlotConfig(p){var m;return(m=D.get(p))!=null?m:null},reportSlots(p,m){for(let b of p)if(!(typeof b!="string"||b.length===0)){if(!ee.test(b)){Qn()&&!ye.has(b)&&(ye.add(b),console.warn(`[sentient] reportSlots: slot id ${JSON.stringify(b)} will not register \u2014 ids must start with a letter or digit and contain only letters, digits, '_' or '-' (max 128 chars): /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/.`));continue}if(!L.has(b)){L.add(b),j.add(b);let k=m==null?void 0:m[b];if(typeof k=="string"){let R=k.replace(/\s+/g," ").trim().slice(0,400);R!==""&&W.set(b,R)}}}j.size===0||X!=null||(X=setTimeout(()=>{X=null;let b=[...j];j.clear();for(let k=0;k<b.length;k+=20){let R=b.slice(k,k+20),w={};for(let _ of R){let B=W.get(_);B!==void 0&&(w[_]=B,W.delete(_))}fetch(`${r}/slots/observed`,{method:"POST",headers:s,body:JSON.stringify(x({slotIds:R},Object.keys(w).length>0?{baselineTexts:w}:{}))}).catch(()=>{})}},1e3))},getSitePalette(){return P},getPersona(){return h?{persona:h.persona,confidence:h.confidence,band:(0,He.confidenceBand)(h.confidence)}:null},async fetchWeights(){var p;try{let m=await fetch(`${r}/weights`,{headers:s});return m.ok?(p=(await m.json()).components)!=null?p:[]:[]}catch(m){return[]}},getGraph(){return{pageNodes:[],capturedAt:0}},dispose(){var p;$==null||$(),te=!0,l.destroy(),g.destroy(),((p=U.get(e.apiKey))==null?void 0:p.dispose)===F.dispose&&U.delete(e.apiKey),e.debug&&console.log("[sentient] disposed")},destroy(){var p;$==null||$(),te=!0,l.destroy(),g.destroy(),i.destroy(),u.clear(),((p=U.get(e.apiKey))==null?void 0:p.dispose)===F.dispose&&U.delete(e.apiKey);try{localStorage.removeItem(oe+e.apiKey),localStorage.removeItem(Ue(e.apiKey)),localStorage.removeItem(Fe(e.apiKey))}catch(m){}e.debug&&console.log("[sentient] destroyed")}};if(U.set(e.apiKey,{config:e,upgrade:null,dispose:F.dispose}),$=er(F,e.apiKey,p=>{G.then(()=>{te||Lt.add(p)})}),e.debug){let p=window;p.__sentient&&(p.__sentient.client=F)}return F}var Mt="_snt_graph_edges",rr={pricing:["features","faq"],features:["pricing"],faq:["pricing"],social_proof:["cta"],cta:["social_proof","hero","trust"],hero:["cta"],comparison:["pricing"],trust:["cta"]};function or(e){var t;return(t=rr[e])!=null?t:[]}function sr(e,t){try{let n=localStorage.getItem(e);return n?JSON.parse(n):t}catch(n){return t}}function ir(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(n){}}var ar=new Set(["pricing","hero","social_proof","cta","features","faq","comparison","trust","navigation","generic"]);function cr(e){return ar.has(e)?e:"generic"}function Je(e){try{let t=new URL(e);return`${t.origin}${t.pathname}`}catch(t){return"/"}}function lr(e,t,n){let a=`${e}:${t}:${n.join(",")}`,d=5381;for(let o=0;o<a.length;o++)d=(d<<5)+d+a.charCodeAt(o)&4294967295;return(d>>>0).toString(16).padStart(8,"0")}function Kt(e){let t=new Map,n=new Map,a=`_snt_graph_nodes${re(e==null?void 0:e.apiKey)}`,d=()=>{typeof window!="undefined"&&ir(a,[...t.values()])};if(typeof window!="undefined"){let o=sr(a,[]);for(let c of o)t.set(c.componentId,c);try{localStorage.removeItem(Mt)}catch(c){}}return{addPageNode(o){t.set(o.componentId,o),d()},addStructuralEdge(o){let c=`${o.fromComponentId}->${o.toComponentId}`;n.set(c,o)},syncOnce(){var c,i;if(!(e!=null&&e.syncUrl)||typeof window=="undefined")return;let o=[...t.values()];if(o.length!==0)try{let u=new Map;for(let g of o){let S=(c=u.get(g.semanticType))!=null?c:[];S.push(g),u.set(g.semanticType,S)}let l=[],r=new Set;for(let g of o)for(let S of or(g.semanticType)){let y=(i=u.get(S))!=null?i:[];for(let C of y){if(C.componentId===g.componentId)continue;let E=`semantic:${g.componentId}->${C.componentId}`;r.has(E)||(r.add(E),l.push({fromComponentId:g.componentId,toComponentId:C.componentId,type:"semantic",weight:.4,confidence:.9}))}}let s=new Set(o.map(g=>g.componentId));for(let g of n.values()){if(!s.has(g.fromComponentId)||!s.has(g.toComponentId))continue;let S=`structural:${g.fromComponentId}->${g.toComponentId}`;r.has(S)||(r.add(S),l.push({fromComponentId:g.fromComponentId,toComponentId:g.toComponentId,type:"structural",weight:g.weight,confidence:1}))}let f=q(x(x({pageUrl:Je(window.location.href)},e.sessionId?{sessionId:e.sessionId}:{}),e.projectId?{projectId:e.projectId}:{}),{nodes:o.map(g=>{let S=cr(g.semanticType);return{componentId:g.componentId,semanticType:S,answers:g.answers,contentHash:lr(g.componentId,S,g.answers),prominenceScore:g.prominenceScore,depthInPage:g.depth}}),edges:l});fetch(e.syncUrl,{method:"POST",keepalive:!0,headers:x({"Content-Type":"application/json"},e.apiKey?{Authorization:`Bearer ${e.apiKey}`}:{}),body:JSON.stringify(f)}).catch(()=>{})}catch(u){}},snapshot(){return{pageNodes:[...t.values()],capturedAt:Date.now()}},destroy(){if(typeof window!="undefined")try{localStorage.removeItem(a),localStorage.removeItem(Mt)}catch(o){}}}}var dr=["data-sentient-id","data-testid","data-test","data-id","data-name","data-cy"];function Qe(e){var t;return((t=e.textContent)!=null?t:"").replace(/\s+/g," ").trim()}function ur(e){return{tag:e.tagName.toLowerCase(),text:Qe(e).slice(0,40)}}function Gt(e){return e.replace(/["\\\]]/g,"\\$&")}function Ce(e,t){try{return e.querySelectorAll(t).length===1}catch(n){return!1}}function $t(e,t){var c;let n=e.tagName.toLowerCase();if(!n)return null;let a=((c=e.getAttribute("class"))!=null?c:"").split(/\s+/).filter(i=>/^[a-zA-Z][\w-]*$/.test(i)),d=[n,...a.map(i=>`${n}.${i}`)];for(let i of d)if(Ce(t,i))return i;let o=e.parentElement;if(o&&o!==t){let i=$t(o,t);if(i){for(let s of d){let f=`${i} > ${s}`;if(Ce(t,f))return f}let u=Array.from(o.children).filter(s=>s.tagName.toLowerCase()===n),l=u.indexOf(e),r=u.some(s=>s!==e&&Qe(s)!==Qe(e));if(l>=0&&r){let s=`${i} > ${n}:nth-of-type(${l+1})`;if(Ce(t,s))return s}}}return null}function Ke(e,t){let n=ur(e),a=e.getAttribute("id");if(a&&Ce(t,`#${Gt(a)}`))return{v:1,id:a,fingerprint:n};for(let o of dr){let c=e.getAttribute(o);if(c&&Ce(t,`[${o}="${Gt(c)}"]`))return{v:1,dataAttr:{name:o,value:c},fingerprint:n}}let d=$t(e,t);return d?{v:1,selector:d,fingerprint:n}:null}var Ft=["pricing","hero","social_proof","cta","features","faq","comparison","trust","navigation","generic"],pr={banner:"hero",navigation:"navigation",contentinfo:"footer"};function gr(e){let t=e.ariaRole?pr[e.ariaRole.toLowerCase()]:void 0;if(t)return t;if(e.tag==="nav")return"navigation";if(e.tag==="footer")return"footer";if(e.tag==="header")return e.actionCount>=5?"navigation":"hero";let n=`${e.idClass} ${e.headingText}`.toLowerCase();return/\b(navbar|nav-bar|navigation|site-nav|main-nav|topbar|footer)\b/.test(n)?/footer/.test(n)?"footer":"navigation":/\b(hero|masthead|jumbotron)\b/i.test(e.idClass)?"hero":null}function fr(e){return e.actionCount>=1&&e.textLength>0&&e.textLength<200?"cta":"generic"}var mr=[["pricing",/\b(pricing|price list|per month|\/mo|subscriptions?)\b|\bplans?\b(?=[^.]{0,40}(from|start|month|year|[$€£]))/i],["faq",/\bfaq\b|frequently asked|common questions?/i],["comparison",/\b(compare|comparison|versus)\b|\bvs\./i],["social_proof",/\b(reviews?|ratings?|testimonial|brands?|galler(y|ies)|logos)\b|trusted by|loved by|case stud|what our customers say/i],["trust",/\b(insurance|warrant(y|ies)|guarantees?|certifi|accredit|security|privacy|compliance|gdpr|encrypt)\b|why choose|about us|our team/i],["cta",/\b(book|booking|reserve|appointments?|newsletter|subscribe)\b|contact us|get in touch|opening hours/i],["features",/\b(features?|benefits?|capabilit|services?|repairs?|menus?|products?)\b|how it works|our process|what we (do|offer)|what you get/i]],yr=[["pricing",/(?:[$€£]\s?\d[\d,.]*\s*(?:\/|per\s)\s*(?:mo|month|yr|year|seat|user))|(?:\b(?:starter|basic|pro|growth|premium|enterprise)\b[^.]{0,60}[$€£]\s?\d)/i],["social_proof",/(?:★{2,})|(?:\b\d(?:\.\d)?\s*(?:out of|\/)\s*5\b)|(?:\brated\b)|(?:["“][^"”]{20,160}["”]\s*[—–-]\s*[A-Z][a-z]+)/],["trust",/\b(?:money[- ]back guarantee|free returns?|returns? within|refund(?:s)? within|encrypted|soc ?2|iso ?27001|gdpr[- ]compliant|cancel anytime)\b/i],["comparison",/\b(?:vs|versus)\b\.?[^.!?]{0,80}\b(?:compare|comparison|plans?|features?|alternative)\b|\bhow (?:we|it) compares?\b/i]],Ut={navigation:"navigation",footer:"navigation",hero:"hero",cta:"cta",generic:"generic"};function hr(e){var n;let t=e.querySelector("h1, h2, h3");return((n=t==null?void 0:t.textContent)!=null?n:"").slice(0,160)}function Sr(e){var d,o;let t=gr(e);if(t)return{type:(d=Ut[t])!=null?d:"generic",strength:"strong"};let n=`${e.idClass} ${e.headingText}`.toLowerCase();for(let[c,i]of mr)if(i.test(n))return{type:c,strength:"strong"};for(let[c,i]of yr)if(i.test(e.bodyText))return{type:c,strength:"strong"};let a=fr(e);return{type:(o=Ut[a])!=null?o:"generic",strength:"weak"}}function br(e){var a,d;let t=((a=e.textContent)!=null?a:"").replace(/\s+/g," ").trim(),n=e.getAttribute("role");return x({tag:e.tagName.toLowerCase(),idClass:`${e.id} ${String((d=e.className)!=null?d:"")}`,headingText:hr(e),bodyText:t.slice(0,2e3),actionCount:e.querySelectorAll('a, button, [role="button"]').length,textLength:t.length},n?{ariaRole:n}:{})}function jt(e){return Sr(br(e)).type}var vr=new Set(["SECTION","ARTICLE","MAIN","DIV","ASIDE"]),wr="h1, h2, h3",xr="[data-sentient-id], section[aria-label], article[aria-label], main[aria-label], aside[aria-label]",Wt=30,Er=1500,Cr={scan:async()=>({nodes:[],edges:[],scannedAt:0}),observe:()=>{},getProminenceScore:()=>0,destroy:()=>{}};function zt(e,t,n){return n<=t?0:Math.max(0,Math.min(1,(e-t)/(n-t)))}function Ir(e){var t,n,a;try{let d=e;for(let o of Object.keys(d)){if(!o.startsWith("__reactFiber")&&!o.startsWith("__reactInternalInstance"))continue;let c=d[o],i=(a=(t=c==null?void 0:c.type)==null?void 0:t.displayName)!=null?a:(n=c==null?void 0:c.type)==null?void 0:n.name;if(i&&i.length>1)return i}}catch(d){}}function kr(e){let t={};for(let n of Array.from(e.attributes))n.name.startsWith("data-")&&(t[n.name]=n.value);return t}var Ve=new Set(Ft);function Tr(e,t){let n=e.getAttribute("data-sentient-id"),a=n?t==null?void 0:t[n]:void 0;if(a&&Ve.has(a))return a;let d=e.getAttribute("data-sentient-type");if(d&&Ve.has(d))return d;let o=e.getAttribute("role");return o&&Ve.has(o)?o:jt(e)}function _r(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)&4294967295;return(t>>>0).toString(16).padStart(8,"0")}function Ar(e){let t=[],n=e;for(;n;){let a=n.parentElement;if(!a){t.push(n.tagName.toLowerCase());break}let d=Array.prototype.indexOf.call(a.children,n);t.push(`${n.tagName.toLowerCase()}[${d}]`),n=a}return t.reverse().join("/")}function Rr(e){var n;let t=(n=e.getAttribute("data-sentient-id"))!=null?n:e.getAttribute("id");return t||`${e.tagName.toLowerCase()}-${_r(Ar(e))}`}function Or(e){let t=0,n=e.parentElement;for(;n;)t++,n=n.parentElement;return t}function Ye(e,t,n){var d,o,c,i;let a=e.querySelector(wr);return{componentId:Rr(e),semanticType:Tr(e,n),ariaLabel:(d=e.getAttribute("aria-label"))!=null?d:void 0,headingText:(c=(o=a==null?void 0:a.textContent)==null?void 0:o.trim())!=null?c:void 0,isAboveFold:e.getBoundingClientRect().top<window.innerHeight,prominenceScore:t(e),depth:Or(e),reactComponentName:Ir(e),dataAttributes:kr(e),locator:(i=Ke(e,e.ownerDocument))!=null?i:void 0}}function Ht(e){var o;let t=[],n=new Set,a="__root__",d=new Map;for(let[c,i]of e){let u=c.parentElement,l=a;for(;u;){if(e.has(u)){l=e.get(u);let s=e.get(c),f=`${l}->${s}`;!n.has(f)&&l!==s&&(n.add(f),t.push({fromComponentId:l,toComponentId:s,weight:.6}));break}u=u.parentElement}let r=(o=d.get(l))!=null?o:[];r.push(c),d.set(l,r)}for(let c of d.values()){if(c.length<2)continue;let i=c.length>Wt?c.slice(0,Wt):c;for(let u=0;u<i.length;u++)for(let l=u+1;l<i.length;l++){if(t.length>=Er)return t;let r=e.get(i[u]),s=e.get(i[l]);if(r===s)continue;let f=`${r}->${s}::sib`,g=`${s}->${r}::sib`;n.has(f)||(n.add(f),t.push({fromComponentId:r,toComponentId:s,weight:.3})),n.has(g)||(n.add(g),t.push({fromComponentId:s,toComponentId:r,weight:.3}))}}return t}function Pr(e,t){let n=[],a=new Set,d=new Map;return document.querySelectorAll("[data-sentient-id]").forEach(i=>{if(i instanceof Element&&!a.has(i)){a.add(i);let u=Ye(i,e,t);n.push(u),d.set(i,u.componentId)}}),document.querySelectorAll("section, article, main, aside").forEach(i=>{if(!(i instanceof Element)||a.has(i))return;let u=i.hasAttribute("aria-label"),l=i.hasAttribute("data-sentient-id");if(!u&&!l)return;a.add(i);let r=Ye(i,e,t);n.push(r),d.set(i,r.componentId)}),{nodes:n,edges:Ht(d),elementToId:d}}function qt(e={}){let{sectionTypes:t}=e;if(typeof window=="undefined")return Cr;let n=null,a=0,d=null,o=new Map,c=r=>{try{let s=window.getComputedStyle(r),f=parseFloat(s.fontSize)||12,g=parseFloat(s.zIndex)||0,S=r.getBoundingClientRect(),y=Math.max(S.top,0),C=window.innerHeight||1,E=1/(y/C+1),A=zt(f,12,48)*.4+E*.4+zt(g,0,100)*.2;return Math.max(0,Math.min(1,A))}catch(s){return .5}};return{scan:()=>new Promise(r=>{let s=()=>{let{nodes:f,edges:g,elementToId:S}=Pr(c,t);o.clear();for(let[y,C]of S)o.set(y,C);r({nodes:f,edges:g,scannedAt:Date.now()})};try{typeof requestIdleCallback=="function"?a=requestIdleCallback(s,{timeout:100}):s()}catch(f){s()}}),observe:r=>{d=r;try{n=new MutationObserver(s=>{let f=[],g=new Set;for(let y of s)y.type==="childList"&&y.addedNodes.forEach(C=>{if(!(C instanceof Element))return;let E=[];vr.has(C.tagName)&&(C.hasAttribute("data-sentient-id")||C.hasAttribute("aria-label"))&&E.push(C);try{C.querySelectorAll(xr).forEach(A=>E.push(A))}catch(A){}for(let A of E){if(o.has(A))continue;let K=Ye(A,c,t);f.push(K),g.add(K.componentId),o.set(A,K.componentId)}});if(f.length===0||!d)return;for(let y of[...o.keys()])y.isConnected||o.delete(y);let S=Ht(o).filter(y=>g.has(y.fromComponentId)||g.has(y.toComponentId));d({nodes:f,edges:S,addedAt:Date.now()})}),n.observe(document.body,{childList:!0,subtree:!0})}catch(s){}},getProminenceScore:c,destroy:()=>{if(n&&(n.disconnect(),n=null),a&&typeof cancelIdleCallback=="function")try{cancelIdleCallback(a)}catch(r){}a=0,d=null,o.clear()}}}var Dr="https://api.sentient-ui.com/v1/events";function Lr(e){var n;let t=a=>{try{let d=document.cookie.match(new RegExp(`(?:^|; )${a}=([^;]*)`));return d?decodeURIComponent(d[1]):void 0}catch(d){return}};return(n=e?t(ie(e)):void 0)!=null?n:t(ve)}var Ge=new Map;function Xt(e){var g;let t=Xe(e),n=e.respectDoNotTrack!==!1&&Ee(),a=e.consent===!1||n,d=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_"),o=e.localMode===!0||!d;if(!e.graph||o||typeof window=="undefined")return t;if(a)return n||Dt(e.apiKey,S=>Xt(S)),t;let c=Ge.get(e.apiKey);if(c)try{c()}catch(S){}let i=qt({sectionTypes:e.sectionTypes}),u=(g=e.ingestUrl)!=null?g:Dr,l=Kt({syncUrl:u.replace(/\/events\/?$/,"/graph/sync"),apiKey:e.apiKey,projectId:e.apiKey,sessionId:Lr(e.apiKey)});i.scan().then(S=>{for(let y of S.nodes)l.addPageNode({id:y.componentId,componentId:y.componentId,semanticType:y.semanticType,answers:e.captureDomText&&y.headingText?[y.headingText]:[],prominenceScore:y.prominenceScore,depth:y.depth});for(let y of S.edges)l.addStructuralEdge(y);l.syncOnce()});let r=null,s=()=>{r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,l.syncOnce()},500)};i.observe(S=>{for(let y of S.nodes)l.addPageNode({id:y.componentId,componentId:y.componentId,semanticType:y.semanticType,answers:e.captureDomText&&y.headingText?[y.headingText]:[],prominenceScore:y.prominenceScore,depth:y.depth});for(let y of S.edges)l.addStructuralEdge(y);s()});let f=()=>{r!==null&&(clearTimeout(r),r=null),i.destroy(),l.destroy(),Ge.get(e.apiKey)===f&&Ge.delete(e.apiKey)};return Ge.set(e.apiKey,f),q(x({},t),{getGraph:()=>l.snapshot(),dispose:()=>{f(),t.dispose()},destroy:()=>{f(),t.destroy()}})}0&&(module.exports={BLOCK_ALIGNS,BLOCK_EMPHASES,BLOCK_FITS,BLOCK_GAPS,BLOCK_GRID_COLUMNS,BLOCK_HEADING_LEVELS,BLOCK_JUSTIFIES,BLOCK_MAX_WIDTHS,BLOCK_PADS,BLOCK_RATIOS,BLOCK_SIZES,BLOCK_SURFACES,BLOCK_TEXT_ALIGNS,BLOCK_TONES,BLOCK_WEIGHTS,FORM_FIELD_KINDS,FORM_INPUT_TYPES,LEGACY_SESSION_COOKIE_NAME,MAX_BLOCK_ARMS,MAX_BLOCK_CHILDREN,MAX_BLOCK_DEPTH,MAX_BLOCK_NODES,MAX_BLOCK_TEXT_LEN,MAX_FORM_FIELDS,MAX_FORM_SELECT_OPTIONS,SNAPSHOT_STORAGE_KEY_PREFIX,armOfResult,attachMicroSignalDetectors,baselineResultFor,baselineSlots,containsFormBlock,deriveSessionSegment,detectDeviceClass,detectTimeOfDay,detectTrafficSource,grantConsent,init,isDoNotTrackEnabled,locatorFromElement,readSnapshot,referrerDomainFromReferer,renderPrePaintScript,sanitizePageUrl,sessionCookieName,toWireSlot,writeSnapshot});
1
+ "use strict";var dn=Object.create;var ke=Object.defineProperty,un=Object.defineProperties,pn=Object.getOwnPropertyDescriptor,gn=Object.getOwnPropertyDescriptors,fn=Object.getOwnPropertyNames,xt=Object.getOwnPropertySymbols,mn=Object.getPrototypeOf,Ct=Object.prototype.hasOwnProperty,yn=Object.prototype.propertyIsEnumerable;var It=(e,t,n)=>t in e?ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k=(e,t)=>{for(var n in t||(t={}))Ct.call(t,n)&&It(e,n,t[n]);if(xt)for(var n of xt(t))yn.call(t,n)&&It(e,n,t[n]);return e},J=(e,t)=>un(e,gn(t));var Sn=(e,t)=>{for(var n in t)ke(e,n,{get:t[n],enumerable:!0})},kt=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of fn(t))!Ct.call(e,d)&&d!==n&&ke(e,d,{get:()=>t[d],enumerable:!(a=pn(t,d))||a.enumerable});return e};var hn=(e,t,n)=>(n=e!=null?dn(mn(e)):{},kt(t||!e||!e.__esModule?ke(n,"default",{value:e,enumerable:!0}):n,e)),bn=e=>kt(ke({},"__esModule",{value:!0}),e);var Qo={};Sn(Qo,{BLOCK_ALIGNS:()=>Un,BLOCK_EMPHASES:()=>qn,BLOCK_FITS:()=>Jn,BLOCK_GAPS:()=>$n,BLOCK_GRID_COLUMNS:()=>Qn,BLOCK_HEADING_LEVELS:()=>Vn,BLOCK_JUSTIFIES:()=>Fn,BLOCK_MAX_WIDTHS:()=>eo,BLOCK_PADS:()=>Zn,BLOCK_RATIOS:()=>Xn,BLOCK_SIZES:()=>jn,BLOCK_SURFACES:()=>Yn,BLOCK_TEXT_ALIGNS:()=>Hn,BLOCK_TONES:()=>zn,BLOCK_WEIGHTS:()=>Wn,FORM_FIELD_KINDS:()=>to,FORM_INPUT_TYPES:()=>no,LEGACY_SESSION_COOKIE_NAME:()=>Te,MAX_BLOCK_ARMS:()=>co,MAX_BLOCK_CHILDREN:()=>ao,MAX_BLOCK_DEPTH:()=>io,MAX_BLOCK_NODES:()=>so,MAX_BLOCK_TEXT_LEN:()=>lo,MAX_FORM_FIELDS:()=>oo,MAX_FORM_SELECT_OPTIONS:()=>ro,SNAPSHOT_STORAGE_KEY_PREFIX:()=>de,armOfResult:()=>Ge,attachMicroSignalDetectors:()=>Ft,baselineResultFor:()=>be,baselineSlots:()=>Bt,containsFormBlock:()=>Ut,deriveSessionSegment:()=>Ve,detectDeviceClass:()=>fe,detectTimeOfDay:()=>Se,detectTrafficSource:()=>me,grantConsent:()=>Xt,init:()=>an,isDoNotTrackEnabled:()=>Re,locatorFromElement:()=>je,readSnapshot:()=>ve,referrerDomainFromReferer:()=>ye,renderPrePaintScript:()=>Mt,sanitizePageUrl:()=>nt,sessionCookieName:()=>pe,toWireSlot:()=>_e,writeSnapshot:()=>we});module.exports=bn(Qo);function Pe(){try{if(typeof crypto!="undefined"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch(e){}try{if(typeof crypto!="undefined"&&typeof crypto.getRandomValues=="function"){let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0"),(n===3||n===5||n===7||n===9)&&(t+="-");return t}}catch(e){}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function le(e){return e?`_${e.slice(0,12)}`:""}var Te="_snt_uid";function pe(e){return`${Te}${le(e)}`}var vn="_snt_uid",wn=365,De="_snt_uid";function En(){return Pe()}function Tt(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function xn(e,t,n){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=strict; path=/`}catch(a){}}function He(e){try{return localStorage.getItem(e)}catch(t){return null}}function _t(e,t){try{return localStorage.setItem(e,t),!0}catch(n){return!1}}function At(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function In(e,t){try{return sessionStorage.setItem(e,t),!0}catch(n){return!1}}function Cn(e){try{sessionStorage.removeItem(e)}catch(t){}}function kn(e){try{return document.cookie=`${e}_probe=1; max-age=1; SameSite=strict; path=/`,document.cookie.indexOf(`${e}_probe=1`)!==-1}catch(t){return!1}}function Tn(e){try{localStorage.removeItem(e)}catch(t){}}function _n(e){try{document.cookie=`${e}=; max-age=0; SameSite=strict; path=/`}catch(t){}}var An={getSessionId:()=>null,isEphemeral:()=>!1,destroy:()=>{}};function Le(e){var p,f,b,w,R,K,D;if(typeof window=="undefined")return An;let t=le(e==null?void 0:e.apiKey),n=(p=e==null?void 0:e.cookieName)!=null?p:pe(e==null?void 0:e.apiKey),a=`${De}${t}`,d=`${De}_tomb${t}`,r=((f=e==null?void 0:e.cookieTTLDays)!=null?f:wn)*24*60*60,s=B=>B&&B.length>0?B:null,g=()=>{var B,L;return t&&!(e!=null&&e.cookieName)&&He(d)===null?(L=(B=s(Tt(vn)))!=null?B:s(He(De)))!=null?L:s(At(De)):null},c=(D=(K=(R=(w=(b=s(Tt(n)))!=null?b:s(He(a)))!=null?w:s(At(a)))!=null?R:g())!=null?K:s(e==null?void 0:e.ssrSessionId))!=null?D:En();xn(n,c,r);let i=_t(a,c),l=kn(n),S=i?!1:In(a,c),y=!i&&!l&&!S;return{getSessionId:()=>c,isEphemeral:()=>y,destroy:()=>{c=null,_n(n),Tn(a),Cn(a),t&&!(e!=null&&e.cookieName)&&_t(d,"1")}}}function Z(e){return Math.min(6e4,1e3*2**Math.min(e,6))}function ge(e){if(e.ok===!0)return"delivered";let{status:t}=e;return typeof t!="number"?"retry":t>=200&&t<300?"delivered":t>=400&&t<500&&t!==429?"dropped":"retry"}function Ne(e,t){try{let n=localStorage.getItem(e);if(!n)return[];let a=JSON.parse(n);return Array.isArray(a)?(localStorage.removeItem(e),a.slice(-t)):[]}catch(n){return[]}}function re(e,t,n){try{let a=(()=>{try{let o=localStorage.getItem(n);if(!o)return[];let r=JSON.parse(o);return Array.isArray(r)?r:[]}catch(o){return[]}})(),d=new Map;for(let o of a)d.set(o.id,o);for(let o of e)d.set(o.id,o);localStorage.setItem(n,JSON.stringify([...d.values()].slice(-t)))}catch(a){}}function Be(e,t){try{let n=localStorage.getItem(t);if(!n)return;let a=JSON.parse(n);if(!Array.isArray(a))return;let d=new Set(e),o=a.filter(r=>!d.has(r.id));if(o.length===a.length)return;o.length===0?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(o))}catch(n){}}var Rn=500,On=56*1024;function Xe(e){return`_snt_retry_${e.slice(0,12)}`}var Pn={push:()=>{},flush:()=>{},destroy:()=>{}};function Rt(e){var Q,V,Ee;if(typeof window=="undefined")return Pn;let t=(Q=e.flushIntervalMs)!=null?Q:5e3,n=(V=e.maxBatchSize)!=null?V:20,a=(Ee=e.maxRetrySize)!=null?Ee:100,d=e.ingestUrl,o=e.apiKey,r=Xe(o),s=[],g=new Set,c=[],i=x=>{for(let O of x)l.delete(O),!g.has(O)&&(g.add(O),c.push(O));for(;c.length>Rn;){let O=c.shift();O&&g.delete(O)}Be(x,r)},l=new Set,S=()=>{for(;s.length>a;){let x=s.shift();x&&l.delete(x.id)}},y=x=>{g.has(x.id)||l.has(x.id)||(l.add(x.id),s.push(x),S())},p=x=>{for(let O of x)g.has(O.id)||(l.add(O.id),s.push(O));S()},f=Ne(r,a);for(let x of f)y(x);let b=0,w=0,R=(x,O=!0)=>{if(x.length===0)return;let W=JSON.stringify(x),H=x.map(q=>q.id),z;try{z=fetch(d,{method:"POST",keepalive:!0,body:W,headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}})}catch(q){re(x,a,r),p(x),w++,b=Date.now()+Z(w);return}let se=q=>{if(ge(q)!=="retry"){if(!q.ok&&O){let ie=x.filter(ae=>ae.eventType!=="pageview");if(ie.length>0&&ie.length<x.length){i(x.filter(ae=>ae.eventType==="pageview").map(ae=>ae.id)),R(ie,!1);return}}i(H),w=0,b=0;return}re(x,a,r),p(x),w++,b=Date.now()+Z(w)};z instanceof Promise?z.then(se).catch(()=>{re(x,a,r),p(x),w++,b=Date.now()+Z(w)}):se(z)},K=typeof TextEncoder!="undefined"?new TextEncoder:null,D=x=>K?K.encode(x).length:x.length,B=x=>{let O=[],W=2;for(let H of x){let z=D(JSON.stringify(H))+1;if(O.length>0&&W+z>On||O.length>=n)break;O.push(H),W+=z}return O},L=()=>{try{if(Date.now()<b)return;for(;s.length>0&&!(Date.now()<b);){let x=s.filter(W=>!g.has(W.id));if(s.length=0,x.length===0)break;let O=B(x);if(O.length===0)break;O.length<x.length&&s.push(...x.slice(O.length)),R(O)}}catch(x){}},E=!0,T=null;T=setInterval(()=>{E&&L()},t);let ee=()=>{document.visibilityState==="hidden"&&L()},j=()=>{L()};return document.addEventListener("visibilitychange",ee),window.addEventListener("pagehide",j),{push(x){y(x),s.length>=n&&L()},flush:L,destroy(){E=!1,T!==null&&(clearInterval(T),T=null),document.removeEventListener("visibilitychange",ee),window.removeEventListener("pagehide",j),L()}}}var Dn=200;function Je(e){return`_snt_goal_retry_${e.slice(0,12)}`}var Ln={send:()=>{},flush:()=>{},destroy:()=>{}};function Ot(e){var D,B,L;if(typeof window=="undefined")return Ln;let t=(D=e.flushIntervalMs)!=null?D:5e3,n=(B=e.maxRetrySize)!=null?B:100,a=(L=e.maxPerFlush)!=null?L:5,d=Je(e.apiKey),o=[],r=new Set,s=new Set,g=[],c=0,i=0,l=!1,S=E=>{for(r.delete(E.id),s.has(E.id)||(s.add(E.id),g.push(E.id));g.length>Dn;){let T=g.shift();T&&s.delete(T)}Be([E.id],d)},y=E=>{re([E],n,d),!s.has(E.id)&&!r.has(E.id)&&(r.add(E.id),o.push(E)),Date.now()>=c&&(i++,c=Date.now()+Z(i))},p=E=>{let T;try{T=fetch(e.url,{method:"POST",keepalive:!0,body:E.body,headers:e.headers})}catch(j){y(E);return}let ee=j=>{var V;let Q=ge(j);if(Q==="retry"){y(E);return}Q==="dropped"&&((V=e.onDrop)==null||V.call(e,E,j.status)),S(E),i=0,c=0};T instanceof Promise?T.then(ee).catch(()=>y(E)):ee(T)},f=()=>{try{if(l||Date.now()<c)return;let E=0;for(;o.length>0&&E<a&&!(Date.now()<c);){let T=o.shift();r.delete(T.id),!s.has(T.id)&&(E++,p(T))}}catch(E){}},b=Ne(d,n);for(let E of b)r.has(E.id)||(r.add(E.id),o.push(E));b.length>0&&re(b,n,d);let w=setInterval(f,t),R=()=>{document.visibilityState==="hidden"&&f()},K=()=>f();return document.addEventListener("visibilitychange",R),window.addEventListener("pagehide",K),{send(E){if(!l&&!(s.has(E.id)||r.has(E.id))){if(Date.now()<c){re([E],n,d),r.add(E.id),o.push(E);return}p(E)}},flush:f,destroy(){clearInterval(w),document.removeEventListener("visibilitychange",R),window.removeEventListener("pagehide",K),f(),l=!0}}}var Nn=1800*1e3;function Me(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function Pt(e=Nn,t){let n=new Map,a=`_snt_asgn${le(t)}_`,d=(c,i)=>`${a}${encodeURIComponent(c)}:${encodeURIComponent(i)}`,o=c=>{let i=c.slice(a.length),l=i.indexOf(":");if(l<0)return null;try{return{componentId:decodeURIComponent(i.slice(0,l)),segment:decodeURIComponent(i.slice(l+1))}}catch(S){return null}},r=()=>{try{let c=[];for(let i=0;i<localStorage.length;i++){let l=localStorage.key(i);l!=null&&l.startsWith(a)&&c.push(l)}return c}catch(c){return[]}},s=c=>c.assignedAt+(c.ttlMs&&c.ttlMs>0?c.ttlMs:e)<Date.now();return typeof window!="undefined"&&(()=>{for(let c of r())try{let i=localStorage.getItem(c);if(!i)continue;let l=JSON.parse(i);if(s(l)){localStorage.removeItem(c);continue}let S=o(c);if(!S)continue;n.set(Me(S.componentId,S.segment),l)}catch(i){}})(),{get(c,i){let l=n.get(Me(c,i));return l?s(l)?(n.delete(Me(c,i)),null):l:null},set(c,i,l){let S=Me(c,i);n.set(S,l);try{localStorage.setItem(d(c,i),JSON.stringify(l))}catch(y){}},clear(){n.clear();for(let c of r())try{localStorage.removeItem(c)}catch(i){}}}}var Dt=["GPTBot","ChatGPT-User","OAI-SearchBot","ClaudeBot","Claude-User","Claude-SearchBot","PerplexityBot","Perplexity-User","Google-Extended","Applebot-Extended","Meta-ExternalAgent","Bytespider","CCBot","Amazonbot","cohere-ai","Diffbot"];function Ke(e){return Lt(e)!==null}function Lt(e){var n;if(!e)return null;let t=e.toLowerCase();return(n=Dt.find(a=>t.includes(a.toLowerCase())))!=null?n:null}function fe(e){let t=e.toLowerCase();return/ipad|tablet|playbook|kindle|silk/.test(t)?"tablet":/mobi|iphone|ipod|android.*mobile|phone/.test(t)?"mobile":"desktop"}function me(e,t){if(!e)return"direct";try{let n=new URL(e);if(t)try{if(new URL(t).host===n.host)return"direct"}catch(d){}let a=n.hostname.toLowerCase();return/(^|\.)(google|bing|duckduckgo|yahoo)\./.test(a)?"search":/(^|\.)(twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|t\.co)$/.test(a)?"social":"referral"}catch(n){return"direct"}}function ye(e){if(!e)return null;try{return new URL(e).hostname}catch(t){return null}}var Nt=["gclid","gbraid","wbraid","fbclid","ttclid","msclkid","twclid","li_fat_id"];function Qe(e){let t={},n={};try{let a=typeof e=="string"||e instanceof URLSearchParams?new URLSearchParams(e):Object.entries(e).flatMap(([d,o])=>{let r=Array.isArray(o)?o[0]:o;return r===void 0?[]:[[d,r]]});for(let[d,o]of a)d.startsWith("utm_")?d in t||(t[d]=o):Nt.includes(d)&&(d in n||(n[d]=o))}catch(a){}return{utmParams:t,clickIds:n}}function Se(e){let t=e.getHours();return t<6?"night":t<12?"morning":t<18?"afternoon":"evening"}function Ve(e){let t=Bn("__segment__",e);return`${t.deviceClass}:${t.trafficSource}`}function Bn(e,t){var o,r,s,g,c,i,l,S;let n=(r=(o=t==null?void 0:t.userAgent)==null?void 0:o.trim())!=null?r:"",a=(g=(s=t==null?void 0:t.referer)==null?void 0:s.trim())!=null?g:"",d=(c=t==null?void 0:t.now)!=null?c:new Date;return{sessionId:e,ephemeral:!1,utmParams:(i=t==null?void 0:t.utmParams)!=null?i:{},clickIds:(l=t==null?void 0:t.clickIds)!=null?l:{},deviceClass:n?fe(n):"desktop",trafficSource:a?me(a,t==null?void 0:t.appOrigin):"direct",referrerDomain:ye(a),timeOfDay:Se(d),dayOfWeek:(S=["sun","mon","tue","wed","thu","fri","sat"][d.getDay()])!=null?S:"sun",automation:(t==null?void 0:t.webdriver)===!0||Ke(n)}}var he=require("@sentientui/policy");function _e(e){return k(k(k({id:e.id},e.arms?{arms:[...e.arms]}:{}),e.dims?{dims:Object.fromEntries(Object.entries(e.dims).map(([t,n])=>[t,[...n]]))}:{}),e.baseline!==void 0?{baseline:e.baseline}:{})}function be(e){let t=_e(e);return(0,he.slotResultFor)(t,(0,he.slotBaselineArm)(t))}function Bt(e){let t={};for(let n of e)t[n.id]=be(n);return t}function Ge(e){return typeof e=="string"?e:(0,he.canonicalArm)(e)}var de="_snt_snap:",Mn=["low","medium","high"];function ve(e){try{let t=localStorage.getItem(de+e);if(!t)return null;let n=JSON.parse(t);return!n||typeof n!="object"||n.v!==1||typeof n.persona!="string"||typeof n.band!="string"||!Mn.includes(n.band)||typeof n.slots!="object"||n.slots===null||Array.isArray(n.slots)||!(n.layoutOrder===null||Array.isArray(n.layoutOrder))||typeof n.savedAt!="number"||!(n.slotConfig===void 0||typeof n.slotConfig=="object"&&n.slotConfig!==null&&!Array.isArray(n.slotConfig))?null:n}catch(t){return null}}function we(e,t){try{localStorage.setItem(de+e,JSON.stringify(t))}catch(n){}}function Mt(e){return"(function(){try{var r=localStorage.getItem("+JSON.stringify(de+e).replace(/</g,"\\u003c")+');if(!r)return;var s=JSON.parse(r);if(!s||s.v!==1||typeof s.persona!=="string"||typeof s.band!=="string")return;var d=document.documentElement;if(d.hasAttribute("data-sentient-persona"))return;d.setAttribute("data-sentient-persona",s.persona);d.setAttribute("data-sentient-confidence",s.band);}catch(e){}})();'}var Ze=require("@sentientui/policy");var Ue=require("@sentientui/policy");var Kt="[sentient] No API key configured \u2014 nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY or pass localMode: true for local development.",Kn="[sentient] Local mode \u2014 decisions are simulated on-device and nothing is sent over the network. Add an API key to learn from real traffic.",Gt=!1,$e=!1;function Gn(){var e;try{return(e=new URLSearchParams(window.location.search).get("sentient_persona"))!=null?e:void 0}catch(t){return}}function $t(e){var c;let t=Le({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),n=(c=t.getSessionId())!=null?c:"local",a=Gn(),d=import("@sentientui/core/local").then(i=>{let l=i;return l.LOCAL_ENGINE_AVAILABLE?(Gt||(Gt=!0,console.info(Kn)),l):($e||($e=!0,console.error(Kt)),null)}).catch(()=>($e||($e=!0,console.error(Kt)),null)),o=null,r={low:.15,medium:.5,high:.85},s=(()=>{var l;if(e.initialPersona)return k({},e.initialPersona);let i=ve(e.apiKey||"local");return i?{persona:i.persona,confidence:(l=r[i.band])!=null?l:.15}:null})();function g(i){let l=document.documentElement;l.dataset.sentientPersona===void 0&&(l.dataset.sentientPersona=i.persona,l.dataset.sentientConfidence=(0,Ue.confidenceBand)(i.confidence))}return{isLocal:!0,async decide(i){var y,p,f;let l=await d;if(!l)return null;let S=l.createLocalEngine({sessionId:n,forcedPersona:a}).decide(i);return o=J(k({},S),{layoutOrder:(p=(y=S.layoutOrder)!=null?y:o==null?void 0:o.layoutOrder)!=null?p:null,slots:k(k({},(f=o==null?void 0:o.slots)!=null?f:{}),S.slots)}),we(e.apiKey||"local",{v:1,persona:o.persona,band:(0,Ue.confidenceBand)(o.confidence),slots:o.slots,layoutOrder:o.layoutOrder,savedAt:Date.now()}),g(S),S},getSlotResult(i){var l,S,y;return(y=(S=o==null?void 0:o.slots[i])!=null?S:(l=e.initialSlots)==null?void 0:l[i])!=null?y:null},getSlotConfig(i){var l,S;return(S=(l=e.initialSlotConfig)==null?void 0:l[i])!=null?S:null},getSitePalette(){var i;return(i=e.initialPalette)!=null?i:null},reportSlots(){},getPersona(){let i=o!=null?o:s;return i?{persona:i.persona,confidence:i.confidence,band:(0,Ue.confidenceBand)(i.confidence)}:null},async assign(i,l){var p;let S=await d;return!S||!l||l.length===0?l!=null&&l[0]?{variantId:l[0],assignmentTtlMs:0}:null:{variantId:(p=S.createLocalEngine({sessionId:n,forcedPersona:a}).decide({components:[{id:i,variantIds:l}]}).assignments[i])!=null?p:l[0],assignmentTtlMs:0}},track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),dispose:()=>{},destroy:()=>t.destroy()}}var $n=["none","sm","md","lg"],Un=["start","center","end","stretch"],Fn=["start","center","end","between"],jn=["sm","md","lg"],Wn=["normal","medium","bold"],zn=["default","muted","accent"],qn=["primary","secondary","ghost"],Hn=["left","center","right"],Xn=["auto","square","landscape","wide"],Jn=["cover","contain"],Qn=[2,3,4],Vn=[2,3,4],Yn=["default","raised"],Zn=["none","sm","md","lg"],eo=["measure"],to=["input","textarea","select"],no=["text","email","number","tel"],oo=5,ro=8,so=64,io=5,ao=12,co=4,lo=500;function Ut(e){if(e==null||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.type==="form"?!0:Array.isArray(t.children)?t.children.some(Ut):!1}function Ft(e,t,n,a){let d=[];{let s=!1,g=[],c=()=>{if(s)return;let i=Date.now();for(g.push(i);g.length>0&&i-g[0]>500;)g.shift();g.length>=3&&(s=!0,e("rage_click"))};t.addEventListener("click",c),d.push(()=>t.removeEventListener("click",c))}{let o=!1,r=s=>{if(o||!(s.target instanceof Node)||!t.contains(s.target)&&t!==s.target)return;o=!0;let g=typeof window!="undefined"?window.getSelection():null,c=g?g.toString().length:0;e("text_copy",{selectionLength:c})};document.addEventListener("copy",r),d.push(()=>document.removeEventListener("copy",r))}{let o=!1,r=!1,s=null,g=()=>{s!==null&&(clearTimeout(s),s=null)},c=()=>{o||!r||(g(),s=setTimeout(()=>{!o&&r&&(o=!0,e("scroll_hesitation"))},3e3))},i=()=>{g(),c()},l=y=>{for(let p of y)r=p.intersectionRatio>.3,r?c():g()},S=new IntersectionObserver(l,{threshold:[.3]});S.observe(t),window.addEventListener("scroll",i,{passive:!0}),d.push(()=>{S.disconnect(),window.removeEventListener("scroll",i),g()})}if((a==null?void 0:a.tabLoss)!==!1){let o=!1,r=n!=null?n:Date.now(),s=()=>{if(o||document.visibilityState!=="hidden")return;let g=Date.now()-r;g<15e3&&(o=!0,e("tab_loss",{timeOnPage:g}))};document.addEventListener("visibilitychange",s),d.push(()=>document.removeEventListener("visibilitychange",s))}return()=>{for(let o of d)o()}}function uo(){var e;return typeof process=="undefined"||((e=process.env)==null?void 0:e.NODE_ENV)!=="production"}var jt="https://api.sentient-ui.com/v1/events",F=new Map,Wt=null;function zt(e,t){let n=F.get(e);n&&n.upgrade&&(n.reinit=t)}function po(e){return"value"in e||"currency"in e||"externalId"in e||"metadata"in e||"weight"in e||"stepIndex"in e}var go=3;function Ye(){return Pe()}function Fe(){var e;if(typeof window!="undefined")return((e=window.location)==null?void 0:e.pathname)||void 0}function fo(){let e=new WeakMap,t=new Map,n=!1,a=(s,g,c)=>{let i=s.get(g);return c===null?i?!0:(s.set(g,new Set),!1):i?i.has(c)?!0:(i.add(c),!1):(s.set(g,new Set([c])),!1)},d=typeof window!="undefined"&&"event"in window,o=()=>{if(!d)return;let s=window.event;return typeof Event=="function"&&s instanceof Event?s:void 0},r=()=>{if(d){Promise.resolve().then(()=>{n=!1,t.clear()});return}let s=!1,g=()=>{s||(s=!0,n=!1,t.clear())};if(setTimeout(g,0),typeof MessageChannel=="function"){let c=new MessageChannel;c.port1.onmessage=()=>{c.port1.close(),c.port2.close(),g()},c.port2.postMessage(0)}};return{firedBefore(s,g){let c=o();if(c){let l=e.get(c);return l||(l=new Map,e.set(c,l)),a(l,s,g)}let i=a(t,s,g);return!i&&!n&&(n=!0,r()),i}}}var qt=new Set;function mo(e,t,n){let a=typeof window=="undefined"?null:window.history;if(!a)return()=>{};let d=!1,o,r=()=>{if(d)return;let c=Fe();!c||c===o||(o=c,e.track({projectId:t,componentId:"__page__",eventType:"pageview",payload:{}}),n(`${t}:${c}`))},s=[];for(let c of["pushState","replaceState"]){let i=a[c],l=function(...S){let y=i.apply(this,S);return r(),y};a[c]=l,s.push([c,i,l])}window.addEventListener("popstate",r);let g=Fe();return g&&qt.has(`${t}:${g}`)?o=g:r(),()=>{if(!d){d=!0,window.removeEventListener("popstate",r);for(let[c,i,l]of s)a[c]===l&&(a[c]=i)}}}var Ae={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,assign:()=>Promise.resolve(null),decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),dispose:()=>{},destroy:()=>{}};function yo(){try{return Qe(window.location.search)}catch(e){return{utmParams:{},clickIds:{}}}}function Ht(e){return e.replace(/\/events\/?$/,"")}function Re(){return typeof navigator!="undefined"&&navigator.globalPrivacyControl===!0?!0:[typeof navigator!="undefined"?navigator.doNotTrack:void 0,typeof window!="undefined"?window.doNotTrack:void 0,typeof navigator!="undefined"?navigator.msDoNotTrack:void 0].some(t=>t==="1"||t==="yes")}function Xt(e){var g;if(typeof window=="undefined")return;let t=e!=null?e:Wt;if(!t){console.warn("[sentient] grantConsent() called before init()");return}let n=F.get(t);if(!n){console.warn("[sentient] grantConsent() called before init()");return}let{config:a,upgrade:d,reinit:o}=n;if(!d){n.upgradeBlockedReason&&console.warn(n.upgradeBlockedReason);return}if(a.respectDoNotTrack!==!1&&Re())return;let r=(o!=null?o:tt)(J(k({},a),{consent:!0}));d(r);let s=(g=F.get(t))==null?void 0:g.dispose;F.set(t,{config:J(k({},a),{consent:!0}),upgrade:null,dispose:s})}function So(e){var y;let t=e.preConsentBehavior==="statistical_winner",n=Ht((y=e.ingestUrl)!=null?y:jt),a={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},d=new Map,o=new Map,r={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),assign(p,f,b){if(!t)return Promise.resolve(null);let w=d.get(p);return w?Promise.resolve(w):et(o,p,async()=>{try{let R=new URLSearchParams({componentId:p});for(let L of f!=null?f:[])R.append("variantIds[]",L);let K=await fetch(`${n}/winner?${R.toString()}`,{headers:a});if(!K.ok)return f!=null&&f[0]?{variantId:f[0],assignmentTtlMs:0}:null;let B={variantId:(await K.json()).variantId,assignmentTtlMs:0};return d.set(p,B),B}catch(R){return f!=null&&f[0]?{variantId:f[0],assignmentTtlMs:0}:null}})},decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,getGraph:()=>({pageNodes:[],capturedAt:0}),dispose:()=>{},destroy:()=>{}},s=!1,g=new Set,c=[],i=[],l={track:p=>r.track(p),goal:((p,f,b,w)=>r.goal(p,f,b,w)),componentGoal:(p,f,b)=>r.componentGoal(p,f,b),identify:p=>r.identify(p),getAssignment:(p,f)=>r.getAssignment(p,f),assign:(p,f,b,w)=>r.assign(p,f,b,w),decide:p=>r.decide(p),getSlotResult:p=>r.getSlotResult(p),isSlotDecided:p=>{var f,b;return(b=(f=r.isSlotDecided)==null?void 0:f.call(r,p))!=null?b:!0},getSlotConfig:p=>r.getSlotConfig(p),getSitePalette:()=>r.getSitePalette(),reportSlots:(p,f)=>r.reportSlots(p,f),requestSlots:(p,f)=>{var b;return s?(b=r.requestSlots)==null?void 0:b.call(r,p,f):c.push([p,f])},decideSlots:p=>{var f;return s?(f=r.decideSlots)==null?void 0:f.call(r,p):i.push(...p)},cancelSlots:p=>{var b;if(s)return(b=r.cancelSlots)==null?void 0:b.call(r,p);let f=new Set(p);for(let w of c)w[0]=w[0].filter(R=>!f.has(R));i=i.filter(w=>!f.has(w.id))},onSlotsChanged:p=>(g.add(p),()=>{g.delete(p)}),getPersona:()=>r.getPersona(),fetchWeights:()=>r.fetchWeights(),getGraph:()=>r.getGraph(),dispose:()=>r.dispose(),destroy:()=>r.destroy()};function S(p){var f,b,w;r=p,s=!0,(f=p.onSlotsChanged)==null||f.call(p,()=>g.forEach(R=>R()));for(let[R,K]of c.splice(0))R.length>0&&((b=p.requestSlots)==null||b.call(p,R,K));i.length>0&&((w=p.decideSlots)==null||w.call(p,i.splice(0)))}return{proxy:l,setInner:S}}function et(e,t,n){let a=e.get(t);if(a)return a;let d=(async()=>{try{return await n()}finally{e.delete(t)}})();return e.set(t,d),d}function tt(e){var ut,pt,gt,ft,mt,yt,St,ht,bt,vt;if(typeof window=="undefined")return Ae;Wt=e.apiKey||"local";let t=F.get(e.apiKey||"local");if(t!=null&&t.dispose)try{t.dispose()}catch(u){}let n=e.respectDoNotTrack!==!1&&Re(),a=e.consent===!1||n,d=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_");if(e.localMode===!0||!d&&e.localMode!==!1)return F.set(e.apiKey||"local",{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): this client is keyless/local \u2014 there is no hosted client to upgrade to. Configure a pk_ API key to enable tracking."}),a?Ae:$t(e);if(a){if(!e.apiKey||!e.apiKey.startsWith("pk_"))return e.preConsentBehavior==="statistical_winner"&&console.warn("[sentient] init() called with an invalid apiKey \u2014 expected a pk_ public key. SDK disabled."),F.set(e.apiKey||"local",{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): the client was initialized with an invalid apiKey (expected a pk_ public key) \u2014 consent cannot enable tracking."}),Ae;let{proxy:u,setInner:m}=So(e);return F.set(e.apiKey,{config:e,upgrade:n?null:m}),u}if(!e.apiKey||!e.apiKey.startsWith("pk_"))return console.warn("[sentient] init() called with an invalid apiKey \u2014 expected a pk_ public key. SDK disabled."),Ae;if(e.ingestUrl==="")return console.warn("[sentient] init() called with an empty ingestUrl. SDK disabled."),Ae;let o=(ut=e.ingestUrl)!=null?ut:jt,r=Date.now(),s=Le({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),g=Pt(void 0,e.apiKey),c=Rt({ingestUrl:o,apiKey:e.apiKey}),i=Ht(o),l={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},S=new Set,y=Ot({url:`${i}/goals`,apiKey:e.apiKey,headers:l,onDrop:(u,m)=>{if(!e.debug){if(S.has(m))return;S.add(m)}console.warn(`[sentient] goal dropped (HTTP ${m}) \u2014 this will not be retried. `+(m===400?"The session was not found: call init() and let the session upsert complete before firing goals.":m===401||m===403?"Check the API key and that this origin is on the project allowlist.":"See the response status for the cause."),u)}}),p=fe((pt=navigator.userAgent)!=null?pt:""),f=window.location.origin,b=me((gt=document.referrer)!=null?gt:"",f),w=(ft=e.sessionSegment)!=null?ft:`${p}:${b}`,R=new Map,K=new Map,D=new Map,B=new Set,L=new Map,E=null,T=null,ee=new Set,j=new Set,Q=new Map,V=null,Ee=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/,x=new Set,O=new Set,W=new Set,H=new Map,z=null,se=new Set,q=new Map,ie=null,ae=2,it=new Map,ze=!1,at=(u,m,h)=>{var v;let I=new Set,_=1;for(let C of u){m.delete(C);let A=((v=it.get(C))!=null?v:0)+1;it.set(C,A),A<=ae&&(I.add(C),A>_&&(_=A))}I.size>0&&setTimeout(()=>{ze||h(I)},Z(_))},ct=u=>{for(let m of u)D.has(m.id)||D.set(m.id,be(m))};if(e.initialSlots)for(let[u,m]of Object.entries(e.initialSlots))D.set(u,m),B.add(u);if(e.initialSlotConfig)for(let[u,m]of Object.entries(e.initialSlotConfig))L.set(u,m);e.initialPalette&&(E=e.initialPalette);let te=ve(e.apiKey);if(te){for(let[u,m]of Object.entries(te.slots))D.has(u)||D.set(u,m);for(let[u,m]of Object.entries((mt=te.slotConfig)!=null?mt:{}))L.has(u)||L.set(u,m);!E&&te.palette&&(E=te.palette)}let lt={low:.15,medium:.5,high:.85};if(e.initialPersona)T=k({},e.initialPersona);else{let u=document.documentElement.dataset;u.sentientPersona?T={persona:u.sentientPersona,confidence:(St=lt[(yt=u.sentientConfidence)!=null?yt:"low"])!=null?St:.15}:te&&(T={persona:te.persona,confidence:(ht=lt[te.band])!=null?ht:.15})}if(e.initialAssignments)for(let[u,m]of Object.entries(e.initialAssignments))g.set(u,w,{variantId:m,assignedAt:Date.now(),segment:w,confidence:1});let ne=Promise.resolve(),dt=s.getSessionId();if(dt){let u=ye((bt=document.referrer)!=null?bt:""),{utmParams:m,clickIds:h}=yo(),I=k(k(k(k({sessionId:dt,deviceClass:p,trafficSource:b,referrerDomain:u,utmParams:m,clickIds:h,timeOfDay:Se(new Date),dayOfWeek:["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()],ephemeral:s.isEphemeral(),automation:typeof navigator!="undefined"&&navigator.webdriver===!0||Ke((vt=navigator.userAgent)!=null?vt:"")},e.userId?{userId:e.userId}:{}),e.persona?{persona:e.persona}:{}),e.country?{country:e.country}:{}),e.sdk?{sdk:e.sdk.name,sdkVersion:e.sdk.version}:{}),_=async()=>{for(let v=0;;v++){try{let C=await fetch(`${i}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(I),headers:l});if(C.status===402){console.warn("[SentientUI] Session limit exceeded for this project. The bandit will stop learning until the limit resets. Upgrade at sentient-ui.com/pricing");return}if(C.ok||ge(C)==="dropped")return}catch(C){}if(v>=go){console.warn("[SentientUI] Could not register the session after retries. Conversions in this visit may not be recorded.");return}await new Promise(C=>setTimeout(C,Z(v+1)))}};try{ne=_()}catch(v){}}e.debug&&(console.log("[sentient] initialized",{context:e.context}),window.__sentient={client:null,queue:c});let cn=fo(),ce=null,qe=!1,G={goal(u,m={},h=1,I=0){var oe,xe,Ie,Ce,ue,P,Y;let _=s.getSessionId();if(!_)return;let v=po(m)?m:{metadata:m},C=[u,(oe=v.externalId)!=null?oe:"",(xe=v.stepIndex)!=null?xe:I,(Ie=v.weight)!=null?Ie:h].join("\0"),A=v.value!==void 0?`${v.value}\0${(Ce=v.currency)!=null?Ce:""}`:null;if(cn.firedBefore(C,A)){e.debug&&console.log(`[sentient] goal("${u}") already recorded for this action \u2014 not sent twice`);return}let M=Ye(),$={sessionId:_,name:u,metadata:(ue=v.metadata)!=null?ue:{},weight:(P=v.weight)!=null?P:h,stepIndex:(Y=v.stepIndex)!=null?Y:I,goalId:M,value:v.value,currency:v.currency,externalId:v.externalId};e.debug&&console.log("[sentient] goal",$);let U={id:M,body:JSON.stringify($)};ne.then(()=>y.send(U))},componentGoal(u,m,h){var M,$,U;let I=s.getSessionId();if(!I)return;let _=g.get(u,w),v=_?null:(M=D.get(u))!=null?M:null;if(!_&&v===null){e.debug&&console.warn(`[sentient] componentGoal("${u}"): no assignment or slot decision yet \u2014 render its <Adaptive>/adaptive hook or call assign()/decide() before recording a goal.`);return}if(!_&&!B.has(u)){e.debug&&console.warn(`[sentient] componentGoal("${u}"): slot not decided this session \u2014 not attributed`);return}let C=_?_.variantId:Ge(v),A={id:Ye(),sessionId:I,projectId:e.apiKey,componentId:u,variantId:C,eventType:"goal_achieved",goalType:m,payload:k({reward:($=h==null?void 0:h.reward)!=null?$:1,goalValue:h==null?void 0:h.value,currency:h==null?void 0:h.currency},(U=h==null?void 0:h.metadata)!=null?U:{}),timestamp:Date.now(),timeInSession:Date.now()-r,path:Fe()};e.debug&&console.log("[sentient] componentGoal",A),ne.then(()=>c.push(A))},identify(u){let m=s.getSessionId();m&&ne.then(()=>{fetch(`${i}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify({sessionId:m,userId:u,ephemeral:s.isEphemeral()}),headers:l}).catch(()=>{})})},track(u){let m=s.getSessionId();if(!m||u.eventType==="variant_assigned"&&D.get(u.componentId)!==void 0&&!B.has(u.componentId)&&!g.get(u.componentId,w))return;let h=J(k({path:Fe()},u),{id:Ye(),sessionId:m,timestamp:Date.now(),timeInSession:Date.now()-r});e.debug&&console.log("[sentient] track",h),ne.then(()=>c.push(h))},getAssignment(u,m){return g.get(u,m)},async assign(u,m,h,I){let _=s.getSessionId();if(!_)return null;let v=g.get(u,w);if(v&&(m!=null&&m.length||v.content!==void 0)){let C=v.ttlMs&&v.ttlMs>0?Math.max(0,v.assignedAt+v.ttlMs-Date.now()):0;return{variantId:v.variantId,assignmentTtlMs:C,content:v.content}}return et(R,u,async()=>{await ne;try{let C={sessionId:_,componentId:u,variantIds:m};I!==void 0?C.agentDataByVariant=I:h!==void 0&&(C.agentData=h);let A=await fetch(`${i}/assign`,{method:"POST",body:JSON.stringify(C),headers:l});if(!A.ok)return null;let M=await A.json();return g.set(u,w,k({variantId:M.variantId,assignedAt:Date.now(),segment:w,confidence:1,content:M.content},M.assignmentTtlMs&&M.assignmentTtlMs>0?{ttlMs:M.assignmentTtlMs}:{})),M}catch(C){return null}})},async decide(u){var v,C;let m=s.getSessionId();if(!m)return null;let h=(v=u.slots)!=null?v:[],I={sessionId:m};u.sections&&u.sections.length>0&&(I.sections=u.sections.map(A=>({id:A}))),I.components=(C=u.components)!=null?C:[],h.length>0&&(I.slots=h.map(_e)),u.slotsFrom==="registry"&&(I.slotsFrom="registry",u.registrySlotIds&&(I.registrySlotIds=u.registrySlotIds),u.bootstrap===!1&&(I.bootstrap=!1)),u.v&&(I.v=u.v),typeof u.pp=="number"&&(I.pp=u.pp),e.persona&&(I.persona=e.persona);let _=JSON.stringify(I);return et(K,_,async()=>{var A,M,$,U,oe,xe,Ie,Ce;await ne;try{let ue=await fetch(`${i}/decide`,{method:"POST",body:_,headers:l});if(!ue.ok)return ct(h),null;let P=await ue.json(),Y={};for(let N of h){let X=(A=P.slots)==null?void 0:A[N.id];if(X!==void 0){Y[N.id]=X,D.set(N.id,X),B.add(N.id);continue}let wt=D.get(N.id);if(wt!==void 0)Y[N.id]=wt;else{let Et=be(N);Y[N.id]=Et,D.set(N.id,Et)}}if(P.slots)for(let[N,X]of Object.entries(P.slots))N in Y||(Y[N]=X,D.set(N,X),B.add(N));let ln=T!=null&&T.persona!=="unknown";P.persona&&!(P.persona==="unknown"&&ln)?T={persona:P.persona,confidence:(M=P.confidence)!=null?M:0}:T||(T={persona:"unknown",confidence:0});for(let[N,X]of Object.entries(($=P.assignments)!=null?$:{}))g.set(N,w,{variantId:X,assignedAt:Date.now(),segment:w,confidence:1});if(P.slotConfig)for(let[N,X]of Object.entries(P.slotConfig))L.set(N,X);P.palette&&(E=P.palette);for(let N of(U=u.registrySlotIds)!=null?U:[])(oe=P.slotConfig)!=null&&oe[N]||(L.delete(N),D.delete(N),B.delete(N));return we(e.apiKey,k(k({v:1,persona:T.persona,band:(0,Ze.confidenceBand)(T.confidence),slots:Object.fromEntries(D),layoutOrder:(xe=P.layoutOrder)!=null?xe:null,savedAt:Date.now()},L.size>0?{slotConfig:Object.fromEntries(L)}:{}),E?{palette:E}:{})),k(k(k(k({layoutOrder:(Ie=P.layoutOrder)!=null?Ie:null,assignments:(Ce=P.assignments)!=null?Ce:{},slots:Y,persona:T.persona,confidence:T.confidence},P.slotConfig?{slotConfig:P.slotConfig}:{}),P.goals?{goals:P.goals}:{}),P.sectionMap?{sectionMap:P.sectionMap}:{}),P.palette?{palette:P.palette}:{})}catch(ue){return ct(h),null}})},getSlotResult(u){var m;return(m=D.get(u))!=null?m:null},isSlotDecided(u){return B.has(u)},getSlotConfig(u){var m;return(m=L.get(u))!=null?m:null},reportSlots(u,m){for(let h of u)if(!(typeof h!="string"||h.length===0)){if(!Ee.test(h)){uo()&&!x.has(h)&&(x.add(h),console.warn(`[sentient] reportSlots: slot id ${JSON.stringify(h)} will not register \u2014 ids must start with a letter or digit and contain only letters, digits, '_' or '-' (max 128 chars): /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/.`));continue}if(!ee.has(h)){ee.add(h),j.add(h);let I=m==null?void 0:m[h];if(typeof I=="string"){let _=I.replace(/\s+/g," ").trim().slice(0,400);_!==""&&Q.set(h,_)}}}j.size===0||V!=null||(V=setTimeout(()=>{V=null;let h=[...j];j.clear();for(let I=0;I<h.length;I+=20){let _=h.slice(I,I+20),v={};for(let C of _){let A=Q.get(C);A!==void 0&&(v[C]=A,Q.delete(C))}fetch(`${i}/slots/observed`,{method:"POST",headers:l,body:JSON.stringify(k({slotIds:_},Object.keys(v).length>0?{baselineTexts:v}:{}))}).catch(()=>{})}},1e3))},requestSlots(u,m){for(let h of u)W.has(h)||(W.add(h),Ee.test(h)?H.set(h,m==null?void 0:m[h]):G.reportSlots([h]));H.size===0||z!=null||(z=setTimeout(()=>{z=null;let h=[...H];H.clear();for(let I=0;I<h.length;I+=50){let _=h.slice(I,I+50);G.decide({slotsFrom:"registry",registrySlotIds:_.map(([v])=>v),bootstrap:!1}).then(v=>{var C;if(v){let A={},M=[];for(let[$,U]of _)(C=v.slotConfig)!=null&&C[$]||(M.push($),U&&(A[$]=U));M.length>0&&G.reportSlots(M,A)}else at(_.map(([A])=>A),W,A=>{var $;let M={};for(let[U,oe]of _)A.has(U)&&oe&&(M[U]=oe);($=G.requestSlots)==null||$.call(G,[...A],M)});O.forEach(A=>A())})}},0))},decideSlots(u){for(let m of u)se.has(m.id)||(se.add(m.id),q.set(m.id,m));q.size===0||ie!=null||(ie=setTimeout(()=>{ie=null;let m=[...q.values()];q.clear();for(let h=0;h<m.length;h+=30){let I=m.slice(h,h+30);G.decide({slots:I}).then(_=>{_||at(I.map(v=>v.id),se,v=>{var C;return(C=G.decideSlots)==null?void 0:C.call(G,I.filter(A=>v.has(A.id)))}),O.forEach(v=>v())})}},0))},cancelSlots(u){for(let m of u)H.delete(m)&&W.delete(m),q.delete(m)&&se.delete(m)},onSlotsChanged(u){return O.add(u),()=>{O.delete(u)}},getSitePalette(){return E},getPersona(){return T?{persona:T.persona,confidence:T.confidence,band:(0,Ze.confidenceBand)(T.confidence)}:null},async fetchWeights(){var u;try{let m=await fetch(`${i}/weights`,{headers:l});return m.ok?(u=(await m.json()).components)!=null?u:[]:[]}catch(m){return[]}},getGraph(){return{pageNodes:[],capturedAt:0}},dispose(){var u;ce==null||ce(),qe=!0,ze=!0,c.destroy(),y.destroy(),((u=F.get(e.apiKey))==null?void 0:u.dispose)===G.dispose&&F.delete(e.apiKey),e.debug&&console.log("[sentient] disposed")},destroy(){var u;ce==null||ce(),qe=!0,ze=!0,c.destroy(),y.destroy(),s.destroy(),g.clear(),((u=F.get(e.apiKey))==null?void 0:u.dispose)===G.dispose&&F.delete(e.apiKey);try{localStorage.removeItem(de+e.apiKey),localStorage.removeItem(Xe(e.apiKey)),localStorage.removeItem(Je(e.apiKey))}catch(m){}e.debug&&console.log("[sentient] destroyed")}};if(F.set(e.apiKey,{config:e,upgrade:null,dispose:G.dispose}),ce=mo(G,e.apiKey,u=>{ne.then(()=>{qe||qt.add(u)})}),e.debug){let u=window;u.__sentient&&(u.__sentient.client=G)}return G}var Jt="_snt_graph_edges",ho={pricing:["features","faq"],features:["pricing"],faq:["pricing"],social_proof:["cta"],cta:["social_proof","hero","trust"],hero:["cta"],comparison:["pricing"],trust:["cta"]};function bo(e){var t;return(t=ho[e])!=null?t:[]}function vo(e,t){try{let n=localStorage.getItem(e);return n?JSON.parse(n):t}catch(n){return t}}function wo(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(n){}}var Eo=new Set(["pricing","hero","social_proof","cta","features","faq","comparison","trust","navigation","generic"]);function xo(e){return Eo.has(e)?e:"generic"}function nt(e){try{let t=new URL(e);return`${t.origin}${t.pathname}`}catch(t){return"/"}}function Io(e,t,n){let a=`${e}:${t}:${n.join(",")}`,d=5381;for(let o=0;o<a.length;o++)d=(d<<5)+d+a.charCodeAt(o)&4294967295;return(d>>>0).toString(16).padStart(8,"0")}function Qt(e){let t=new Map,n=new Map,a=`_snt_graph_nodes${le(e==null?void 0:e.apiKey)}`,d=()=>{typeof window!="undefined"&&wo(a,[...t.values()])};if(typeof window!="undefined"){let o=vo(a,[]);for(let r of o)t.set(r.componentId,r);try{localStorage.removeItem(Jt)}catch(r){}}return{addPageNode(o){t.set(o.componentId,o),d()},addStructuralEdge(o){let r=`${o.fromComponentId}->${o.toComponentId}`;n.set(r,o)},syncOnce(){var r,s;if(!(e!=null&&e.syncUrl)||typeof window=="undefined")return;let o=[...t.values()];if(o.length!==0)try{let g=new Map;for(let y of o){let p=(r=g.get(y.semanticType))!=null?r:[];p.push(y),g.set(y.semanticType,p)}let c=[],i=new Set;for(let y of o)for(let p of bo(y.semanticType)){let f=(s=g.get(p))!=null?s:[];for(let b of f){if(b.componentId===y.componentId)continue;let w=`semantic:${y.componentId}->${b.componentId}`;i.has(w)||(i.add(w),c.push({fromComponentId:y.componentId,toComponentId:b.componentId,type:"semantic",weight:.4,confidence:.9}))}}let l=new Set(o.map(y=>y.componentId));for(let y of n.values()){if(!l.has(y.fromComponentId)||!l.has(y.toComponentId))continue;let p=`structural:${y.fromComponentId}->${y.toComponentId}`;i.has(p)||(i.add(p),c.push({fromComponentId:y.fromComponentId,toComponentId:y.toComponentId,type:"structural",weight:y.weight,confidence:1}))}let S=J(k(k({pageUrl:nt(window.location.href)},e.sessionId?{sessionId:e.sessionId}:{}),e.projectId?{projectId:e.projectId}:{}),{nodes:o.map(y=>{let p=xo(y.semanticType);return{componentId:y.componentId,semanticType:p,answers:y.answers,contentHash:Io(y.componentId,p,y.answers),prominenceScore:y.prominenceScore,depthInPage:y.depth}}),edges:c});fetch(e.syncUrl,{method:"POST",keepalive:!0,headers:k({"Content-Type":"application/json"},e.apiKey?{Authorization:`Bearer ${e.apiKey}`}:{}),body:JSON.stringify(S)}).catch(()=>{})}catch(g){}},snapshot(){return{pageNodes:[...t.values()],capturedAt:Date.now()}},destroy(){if(typeof window!="undefined")try{localStorage.removeItem(a),localStorage.removeItem(Jt)}catch(o){}}}}var Co=["data-sentient-id","data-testid","data-test","data-id","data-name","data-cy"];function ot(e){var t;return((t=e.textContent)!=null?t:"").replace(/\s+/g," ").trim()}function ko(e){return{tag:e.tagName.toLowerCase(),text:ot(e).slice(0,40)}}function Vt(e){return e.replace(/["\\\]]/g,"\\$&")}function Oe(e,t){try{return e.querySelectorAll(t).length===1}catch(n){return!1}}function Yt(e,t){var r;let n=e.tagName.toLowerCase();if(!n)return null;let a=((r=e.getAttribute("class"))!=null?r:"").split(/\s+/).filter(s=>/^[a-zA-Z][\w-]*$/.test(s)),d=[n,...a.map(s=>`${n}.${s}`)];for(let s of d)if(Oe(t,s))return s;let o=e.parentElement;if(o&&o!==t){let s=Yt(o,t);if(s){for(let l of d){let S=`${s} > ${l}`;if(Oe(t,S))return S}let g=Array.from(o.children).filter(l=>l.tagName.toLowerCase()===n),c=g.indexOf(e),i=g.some(l=>l!==e&&ot(l)!==ot(e));if(c>=0&&i){let l=`${s} > ${n}:nth-of-type(${c+1})`;if(Oe(t,l))return l}}}return null}function je(e,t){let n=ko(e),a=e.getAttribute("id");if(a&&Oe(t,`#${Vt(a)}`))return{v:1,id:a,fingerprint:n};for(let o of Co){let r=e.getAttribute(o);if(r&&Oe(t,`[${o}="${Vt(r)}"]`))return{v:1,dataAttr:{name:o,value:r},fingerprint:n}}let d=Yt(e,t);return d?{v:1,selector:d,fingerprint:n}:null}var en=["pricing","hero","social_proof","cta","features","faq","comparison","trust","navigation","generic"],To={banner:"hero",navigation:"navigation",contentinfo:"footer"};function _o(e){let t=e.ariaRole?To[e.ariaRole.toLowerCase()]:void 0;if(t)return t;if(e.tag==="nav")return"navigation";if(e.tag==="footer")return"footer";if(e.tag==="header")return e.actionCount>=5?"navigation":"hero";let n=`${e.idClass} ${e.headingText}`.toLowerCase();return/\b(navbar|nav-bar|navigation|site-nav|main-nav|topbar|footer)\b/.test(n)?/footer/.test(n)?"footer":"navigation":/\b(hero|masthead|jumbotron)\b/i.test(e.idClass)?"hero":null}function Ao(e){return e.actionCount>=1&&e.textLength>0&&e.textLength<200?"cta":"generic"}var Ro=[["pricing",/\b(pricing|price list|per month|\/mo|subscriptions?)\b|\bplans?\b(?=[^.]{0,40}(from|start|month|year|[$€£]))/i],["faq",/\bfaq\b|frequently asked|common questions?/i],["comparison",/\b(compare|comparison|versus)\b|\bvs\./i],["social_proof",/\b(reviews?|ratings?|testimonial|brands?|galler(y|ies)|logos)\b|trusted by|loved by|case stud|what our customers say/i],["trust",/\b(insurance|warrant(y|ies)|guarantees?|certifi|accredit|security|privacy|compliance|gdpr|encrypt)\b|why choose|about us|our team/i],["cta",/\b(book|booking|reserve|appointments?|newsletter|subscribe)\b|contact us|get in touch|opening hours/i],["features",/\b(features?|benefits?|capabilit|services?|repairs?|menus?|products?)\b|how it works|our process|what we (do|offer)|what you get/i]],Oo=[["pricing",/(?:[$€£]\s?\d[\d,.]*\s*(?:\/|per\s)\s*(?:mo|month|yr|year|seat|user))|(?:\b(?:starter|basic|pro|growth|premium|enterprise)\b[^.]{0,60}[$€£]\s?\d)/i],["social_proof",/(?:★{2,})|(?:\b\d(?:\.\d)?\s*(?:out of|\/)\s*5\b)|(?:\brated\b)|(?:["“][^"”]{20,160}["”]\s*[—–-]\s*[A-Z][a-z]+)/],["trust",/\b(?:money[- ]back guarantee|free returns?|returns? within|refund(?:s)? within|encrypted|soc ?2|iso ?27001|gdpr[- ]compliant|cancel anytime)\b/i],["comparison",/\b(?:vs|versus)\b\.?[^.!?]{0,80}\b(?:compare|comparison|plans?|features?|alternative)\b|\bhow (?:we|it) compares?\b/i]],Zt={navigation:"navigation",footer:"navigation",hero:"hero",cta:"cta",generic:"generic"};function Po(e){var n;let t=e.querySelector("h1, h2, h3");return((n=t==null?void 0:t.textContent)!=null?n:"").slice(0,160)}function Do(e){var d,o;let t=_o(e);if(t)return{type:(d=Zt[t])!=null?d:"generic",strength:"strong"};let n=`${e.idClass} ${e.headingText}`.toLowerCase();for(let[r,s]of Ro)if(s.test(n))return{type:r,strength:"strong"};for(let[r,s]of Oo)if(s.test(e.bodyText))return{type:r,strength:"strong"};let a=Ao(e);return{type:(o=Zt[a])!=null?o:"generic",strength:"weak"}}function Lo(e){var a,d;let t=((a=e.textContent)!=null?a:"").replace(/\s+/g," ").trim(),n=e.getAttribute("role");return k({tag:e.tagName.toLowerCase(),idClass:`${e.id} ${String((d=e.className)!=null?d:"")}`,headingText:Po(e),bodyText:t.slice(0,2e3),actionCount:e.querySelectorAll('a, button, [role="button"]').length,textLength:t.length},n?{ariaRole:n}:{})}function tn(e){return Do(Lo(e)).type}var No=new Set(["SECTION","ARTICLE","MAIN","DIV","ASIDE"]),Bo="h1, h2, h3",Mo="[data-sentient-id], section[aria-label], article[aria-label], main[aria-label], aside[aria-label]",nn=30,Ko=1500,Go={scan:async()=>({nodes:[],edges:[],scannedAt:0}),observe:()=>{},getProminenceScore:()=>0,destroy:()=>{}};function on(e,t,n){return n<=t?0:Math.max(0,Math.min(1,(e-t)/(n-t)))}function $o(e){var t,n,a;try{let d=e;for(let o of Object.keys(d)){if(!o.startsWith("__reactFiber")&&!o.startsWith("__reactInternalInstance"))continue;let r=d[o],s=(a=(t=r==null?void 0:r.type)==null?void 0:t.displayName)!=null?a:(n=r==null?void 0:r.type)==null?void 0:n.name;if(s&&s.length>1)return s}}catch(d){}}function Uo(e){let t={};for(let n of Array.from(e.attributes))n.name.startsWith("data-")&&(t[n.name]=n.value);return t}var rt=new Set(en);function Fo(e,t){let n=e.getAttribute("data-sentient-id"),a=n?t==null?void 0:t[n]:void 0;if(a&&rt.has(a))return a;let d=e.getAttribute("data-sentient-type");if(d&&rt.has(d))return d;let o=e.getAttribute("role");return o&&rt.has(o)?o:tn(e)}function jo(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)&4294967295;return(t>>>0).toString(16).padStart(8,"0")}function Wo(e){let t=[],n=e;for(;n;){let a=n.parentElement;if(!a){t.push(n.tagName.toLowerCase());break}let d=Array.prototype.indexOf.call(a.children,n);t.push(`${n.tagName.toLowerCase()}[${d}]`),n=a}return t.reverse().join("/")}function zo(e){var n;let t=(n=e.getAttribute("data-sentient-id"))!=null?n:e.getAttribute("id");return t||`${e.tagName.toLowerCase()}-${jo(Wo(e))}`}function qo(e){let t=0,n=e.parentElement;for(;n;)t++,n=n.parentElement;return t}function st(e,t,n){var d,o,r,s;let a=e.querySelector(Bo);return{componentId:zo(e),semanticType:Fo(e,n),ariaLabel:(d=e.getAttribute("aria-label"))!=null?d:void 0,headingText:(r=(o=a==null?void 0:a.textContent)==null?void 0:o.trim())!=null?r:void 0,isAboveFold:e.getBoundingClientRect().top<window.innerHeight,prominenceScore:t(e),depth:qo(e),reactComponentName:$o(e),dataAttributes:Uo(e),locator:(s=je(e,e.ownerDocument))!=null?s:void 0}}function rn(e){var o;let t=[],n=new Set,a="__root__",d=new Map;for(let[r,s]of e){let g=r.parentElement,c=a;for(;g;){if(e.has(g)){c=e.get(g);let l=e.get(r),S=`${c}->${l}`;!n.has(S)&&c!==l&&(n.add(S),t.push({fromComponentId:c,toComponentId:l,weight:.6}));break}g=g.parentElement}let i=(o=d.get(c))!=null?o:[];i.push(r),d.set(c,i)}for(let r of d.values()){if(r.length<2)continue;let s=r.length>nn?r.slice(0,nn):r;for(let g=0;g<s.length;g++)for(let c=g+1;c<s.length;c++){if(t.length>=Ko)return t;let i=e.get(s[g]),l=e.get(s[c]);if(i===l)continue;let S=`${i}->${l}::sib`,y=`${l}->${i}::sib`;n.has(S)||(n.add(S),t.push({fromComponentId:i,toComponentId:l,weight:.3})),n.has(y)||(n.add(y),t.push({fromComponentId:l,toComponentId:i,weight:.3}))}}return t}function Ho(e,t){let n=[],a=new Set,d=new Map;return document.querySelectorAll("[data-sentient-id]").forEach(s=>{if(s instanceof Element&&!a.has(s)){a.add(s);let g=st(s,e,t);n.push(g),d.set(s,g.componentId)}}),document.querySelectorAll("section, article, main, aside").forEach(s=>{if(!(s instanceof Element)||a.has(s))return;let g=s.hasAttribute("aria-label"),c=s.hasAttribute("data-sentient-id");if(!g&&!c)return;a.add(s);let i=st(s,e,t);n.push(i),d.set(s,i.componentId)}),{nodes:n,edges:rn(d),elementToId:d}}function sn(e={}){let{sectionTypes:t}=e;if(typeof window=="undefined")return Go;let n=null,a=0,d=null,o=new Map,r=i=>{try{let l=window.getComputedStyle(i),S=parseFloat(l.fontSize)||12,y=parseFloat(l.zIndex)||0,p=i.getBoundingClientRect(),f=Math.max(p.top,0),b=window.innerHeight||1,w=1/(f/b+1),R=on(S,12,48)*.4+w*.4+on(y,0,100)*.2;return Math.max(0,Math.min(1,R))}catch(l){return .5}};return{scan:()=>new Promise(i=>{let l=()=>{let{nodes:S,edges:y,elementToId:p}=Ho(r,t);o.clear();for(let[f,b]of p)o.set(f,b);i({nodes:S,edges:y,scannedAt:Date.now()})};try{typeof requestIdleCallback=="function"?a=requestIdleCallback(l,{timeout:100}):l()}catch(S){l()}}),observe:i=>{d=i;try{n=new MutationObserver(l=>{let S=[],y=new Set;for(let f of l)f.type==="childList"&&f.addedNodes.forEach(b=>{if(!(b instanceof Element))return;let w=[];No.has(b.tagName)&&(b.hasAttribute("data-sentient-id")||b.hasAttribute("aria-label"))&&w.push(b);try{b.querySelectorAll(Mo).forEach(R=>w.push(R))}catch(R){}for(let R of w){if(o.has(R))continue;let K=st(R,r,t);S.push(K),y.add(K.componentId),o.set(R,K.componentId)}});if(S.length===0||!d)return;for(let f of[...o.keys()])f.isConnected||o.delete(f);let p=rn(o).filter(f=>y.has(f.fromComponentId)||y.has(f.toComponentId));d({nodes:S,edges:p,addedAt:Date.now()})}),n.observe(document.body,{childList:!0,subtree:!0})}catch(l){}},getProminenceScore:r,destroy:()=>{if(n&&(n.disconnect(),n=null),a&&typeof cancelIdleCallback=="function")try{cancelIdleCallback(a)}catch(i){}a=0,d=null,o.clear()}}}var Xo="https://api.sentient-ui.com/v1/events";function Jo(e){var n;let t=a=>{try{let d=document.cookie.match(new RegExp(`(?:^|; )${a}=([^;]*)`));return d?decodeURIComponent(d[1]):void 0}catch(d){return}};return(n=e?t(pe(e)):void 0)!=null?n:t(Te)}var We=new Map;function an(e){var y;let t=tt(e),n=e.respectDoNotTrack!==!1&&Re(),a=e.consent===!1||n,d=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_"),o=e.localMode===!0||!d;if(!e.graph||o||typeof window=="undefined")return t;if(a)return n||zt(e.apiKey,p=>an(p)),t;let r=We.get(e.apiKey);if(r)try{r()}catch(p){}let s=sn({sectionTypes:e.sectionTypes}),g=(y=e.ingestUrl)!=null?y:Xo,c=Qt({syncUrl:g.replace(/\/events\/?$/,"/graph/sync"),apiKey:e.apiKey,projectId:e.apiKey,sessionId:Jo(e.apiKey)});s.scan().then(p=>{for(let f of p.nodes)c.addPageNode({id:f.componentId,componentId:f.componentId,semanticType:f.semanticType,answers:e.captureDomText&&f.headingText?[f.headingText]:[],prominenceScore:f.prominenceScore,depth:f.depth});for(let f of p.edges)c.addStructuralEdge(f);c.syncOnce()});let i=null,l=()=>{i!==null&&clearTimeout(i),i=setTimeout(()=>{i=null,c.syncOnce()},500)};s.observe(p=>{for(let f of p.nodes)c.addPageNode({id:f.componentId,componentId:f.componentId,semanticType:f.semanticType,answers:e.captureDomText&&f.headingText?[f.headingText]:[],prominenceScore:f.prominenceScore,depth:f.depth});for(let f of p.edges)c.addStructuralEdge(f);l()});let S=()=>{i!==null&&(clearTimeout(i),i=null),s.destroy(),c.destroy(),We.get(e.apiKey)===S&&We.delete(e.apiKey)};return We.set(e.apiKey,S),J(k({},t),{getGraph:()=>c.snapshot(),dispose:()=>{S(),t.dispose()},destroy:()=>{S(),t.destroy()}})}0&&(module.exports={BLOCK_ALIGNS,BLOCK_EMPHASES,BLOCK_FITS,BLOCK_GAPS,BLOCK_GRID_COLUMNS,BLOCK_HEADING_LEVELS,BLOCK_JUSTIFIES,BLOCK_MAX_WIDTHS,BLOCK_PADS,BLOCK_RATIOS,BLOCK_SIZES,BLOCK_SURFACES,BLOCK_TEXT_ALIGNS,BLOCK_TONES,BLOCK_WEIGHTS,FORM_FIELD_KINDS,FORM_INPUT_TYPES,LEGACY_SESSION_COOKIE_NAME,MAX_BLOCK_ARMS,MAX_BLOCK_CHILDREN,MAX_BLOCK_DEPTH,MAX_BLOCK_NODES,MAX_BLOCK_TEXT_LEN,MAX_FORM_FIELDS,MAX_FORM_SELECT_OPTIONS,SNAPSHOT_STORAGE_KEY_PREFIX,armOfResult,attachMicroSignalDetectors,baselineResultFor,baselineSlots,containsFormBlock,deriveSessionSegment,detectDeviceClass,detectTimeOfDay,detectTrafficSource,grantConsent,init,isDoNotTrackEnabled,locatorFromElement,readSnapshot,referrerDomainFromReferer,renderPrePaintScript,sanitizePageUrl,sessionCookieName,toWireSlot,writeSnapshot});
2
2
  //# sourceMappingURL=index-graph.js.map