@sentientui/core 0.35.0 → 0.36.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.
- package/README.md +51 -12
- package/dist/chunk-735EJYJX.mjs +2 -0
- package/dist/chunk-735EJYJX.mjs.map +1 -0
- package/dist/chunk-DU3AXQHR.mjs +2 -0
- package/dist/chunk-DU3AXQHR.mjs.map +1 -0
- package/dist/chunk-GVKKOUWE.mjs +2 -0
- package/dist/chunk-GVKKOUWE.mjs.map +1 -0
- package/dist/chunk-J5EL7HKC.mjs +2 -0
- package/dist/chunk-J5EL7HKC.mjs.map +1 -0
- package/dist/{index-Dg2gkw_l.d.cts → index-BYOMZ3t-.d.cts} +37 -2
- package/dist/{index-DjbSOAEF.d.ts → index-DEwRTvxc.d.ts} +37 -2
- package/dist/index-consent.d.cts +74 -13
- package/dist/index-consent.d.ts +74 -13
- package/dist/index-consent.js +1 -1
- package/dist/index-consent.js.map +1 -1
- package/dist/index-consent.mjs +1 -1
- package/dist/index-consent.mjs.map +1 -1
- package/dist/index-engagement.js +1 -1
- package/dist/index-engagement.js.map +1 -1
- package/dist/index-engagement.mjs +1 -1
- package/dist/index-engagement.mjs.map +1 -1
- package/dist/index-graph.d.cts +2 -2
- package/dist/index-graph.d.ts +2 -2
- package/dist/index-graph.js +1 -1
- package/dist/index-graph.js.map +1 -1
- package/dist/index-graph.mjs +1 -1
- package/dist/index-graph.mjs.map +1 -1
- package/dist/index-local.d.cts +1 -1
- package/dist/index-local.d.ts +1 -1
- package/dist/index-server.d.cts +10 -0
- package/dist/index-server.d.ts +10 -0
- package/dist/index-server.js +1 -1
- package/dist/index-server.js.map +1 -1
- package/dist/index-server.mjs +1 -1
- package/dist/index-server.mjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/llms.txt +2 -2
- package/package.json +5 -2
- package/dist/chunk-2NVSFI4V.mjs +0 -2
- package/dist/chunk-2NVSFI4V.mjs.map +0 -1
- package/dist/chunk-EUD4PUKP.mjs +0 -2
- package/dist/chunk-EUD4PUKP.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var an=Object.create;var we=Object.defineProperty,ln=Object.defineProperties,cn=Object.getOwnPropertyDescriptor,dn=Object.getOwnPropertyDescriptors,un=Object.getOwnPropertyNames,Ot=Object.getOwnPropertySymbols,pn=Object.getPrototypeOf,Pt=Object.prototype.hasOwnProperty,gn=Object.prototype.propertyIsEnumerable;var Tt=(e,t,n)=>t in e?we(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C=(e,t)=>{for(var n in t||(t={}))Pt.call(t,n)&&Tt(e,n,t[n]);if(Ot)for(var n of Ot(t))gn.call(t,n)&&Tt(e,n,t[n]);return e},pe=(e,t)=>ln(e,dn(t));var fn=(e,t)=>{for(var n in t)we(e,n,{get:t[n],enumerable:!0})},Dt=(e,t,n,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let g of un(t))!Pt.call(e,g)&&g!==n&&we(e,g,{get:()=>t[g],enumerable:!(l=cn(t,g))||l.enumerable});return e};var mn=(e,t,n)=>(n=e!=null?an(pn(e)):{},Dt(t||!e||!e.__esModule?we(n,"default",{value:e,enumerable:!0}):n,e)),yn=e=>Dt(we({},"__esModule",{value:!0}),e);var So={};fn(So,{AGENT_INTENTS:()=>Fe,BLOCK_ALIGNS:()=>Nn,BLOCK_EMPHASES:()=>$n,BLOCK_FITS:()=>Vn,BLOCK_GAPS:()=>Mn,BLOCK_GRID_COLUMNS:()=>zn,BLOCK_HEADING_LEVELS:()=>Hn,BLOCK_JUSTIFIES:()=>Kn,BLOCK_MAX_WIDTHS:()=>Qn,BLOCK_PADS:()=>Xn,BLOCK_RATIOS:()=>Wn,BLOCK_SIZES:()=>Gn,BLOCK_SURFACES:()=>Jn,BLOCK_TEXT_ALIGNS:()=>jn,BLOCK_TONES:()=>Fn,BLOCK_WEIGHTS:()=>Un,CLICK_ID_KEYS:()=>rt,FORM_FIELD_KINDS:()=>qn,FORM_INPUT_TYPES:()=>Yn,LEGACY_SESSION_COOKIE_NAME:()=>Ze,LOCAL_MODE_BANNER:()=>st,MAX_BLOCK_ARMS:()=>ro,MAX_BLOCK_CHILDREN:()=>oo,MAX_BLOCK_DEPTH:()=>no,MAX_BLOCK_NODES:()=>to,MAX_BLOCK_TEXT_LEN:()=>so,MAX_FORM_FIELDS:()=>Zn,MAX_FORM_SELECT_OPTIONS:()=>eo,MAX_SKELETON_LEAVES:()=>$o,MAX_SKELETON_NODES:()=>Fo,MAX_SKELETON_TEXT:()=>jo,PAGE_SCOPE_RE:()=>at,PROD_KEYLESS_ERROR:()=>ze,REVEAL_MS:()=>Xt,SNAPSHOT_STORAGE_KEY_PREFIX:()=>ge,_registerConsentUpgradeInit:()=>lo,agentIntent:()=>Ut,agentUaList:()=>Ie,armOfResult:()=>je,attachMicroSignalDetectors:()=>Yt,baselineResultFor:()=>Se,baselineSlots:()=>jt,classifiedAgents:()=>Ft,containsFormBlock:()=>Jt,deriveSessionSegment:()=>$t,detectDeviceClass:()=>_e,detectTimeOfDay:()=>Oe,detectTrafficSource:()=>Ce,extractTrackedParams:()=>$e,grantConsent:()=>mo,init:()=>on,isDoNotTrackEnabled:()=>pt,matchedAgentToken:()=>ot,pageScopeMatches:()=>Ht,readSnapshot:()=>he,referrerDomainFromReferer:()=>Ae,renderPrePaintScript:()=>Wt,resetRevealStyles:()=>Qt,reveal:()=>qt,sessionCookieName:()=>Le,toWireSlot:()=>Te,uaTokenMatch:()=>Re,writeSnapshot:()=>ve});module.exports=yn(So);function Be(){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 Ee(e){return e?`_${e.slice(0,12)}`:""}var Ze="_snt_uid";function Le(e){return`${Ze}${Ee(e)}`}var Sn="_snt_uid",hn=365,Me="_snt_uid";function vn(){return Be()}function Bt(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function bn(e,t,n){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=strict; path=/`}catch(l){}}function et(e){try{return localStorage.getItem(e)}catch(t){return null}}function Lt(e,t){try{return localStorage.setItem(e,t),!0}catch(n){return!1}}function Mt(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function kn(e,t){try{return sessionStorage.setItem(e,t),!0}catch(n){return!1}}function xn(e){try{sessionStorage.removeItem(e)}catch(t){}}function wn(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 En(e){try{localStorage.removeItem(e)}catch(t){}}function In(e){try{document.cookie=`${e}=; max-age=0; SameSite=strict; path=/`}catch(t){}}var Rn={getSessionId:()=>null,isEphemeral:()=>!1,destroy:()=>{}};function Ne(e){var p,m,x,v,B,V,P;if(typeof window=="undefined")return Rn;let t=Ee(e==null?void 0:e.apiKey),n=(p=e==null?void 0:e.cookieName)!=null?p:Le(e==null?void 0:e.apiKey),l=`${Me}${t}`,g=`${Me}_tomb${t}`,s=((m=e==null?void 0:e.cookieTTLDays)!=null?m:hn)*24*60*60,d=K=>K&&K.length>0?K:null,f=()=>{var K,M;return t&&!(e!=null&&e.cookieName)&&et(g)===null?(M=(K=d(Bt(Sn)))!=null?K:d(et(Me)))!=null?M:d(Mt(Me)):null},i=(P=(V=(B=(v=(x=d(Bt(n)))!=null?x:d(et(l)))!=null?v:d(Mt(l)))!=null?B:f())!=null?V:d(e==null?void 0:e.ssrSessionId))!=null?P:vn();bn(n,i,s);let r=Lt(l,i),a=wn(n),w=r?!1:kn(l,i),A=!r&&!a&&!w;return{getSessionId:()=>i,isEphemeral:()=>A,destroy:()=>{i=null,In(n),En(l),xn(l),t&&!(e!=null&&e.cookieName)&&Lt(g,"1")}}}function se(e){return Math.min(6e4,1e3*2**Math.min(e,6))}function me(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 Ke(e,t){try{let n=localStorage.getItem(e);if(!n)return[];let l=JSON.parse(n);return Array.isArray(l)?(localStorage.removeItem(e),l.slice(-t)):[]}catch(n){return[]}}function de(e,t,n){try{let l=(()=>{try{let u=localStorage.getItem(n);if(!u)return[];let s=JSON.parse(u);return Array.isArray(s)?s:[]}catch(u){return[]}})(),g=new Map;for(let u of l)g.set(u.id,u);for(let u of e)g.set(u.id,u);localStorage.setItem(n,JSON.stringify([...g.values()].slice(-t)))}catch(l){}}function Ge(e,t){try{let n=localStorage.getItem(t);if(!n)return;let l=JSON.parse(n);if(!Array.isArray(l))return;let g=new Set(e),u=l.filter(s=>!g.has(s.id));if(u.length===l.length)return;u.length===0?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(u))}catch(n){}}var _n=500,Cn=56*1024;function tt(e){return`_snt_retry_${e.slice(0,12)}`}var An={push:()=>{},flush:()=>{},destroy:()=>{}};function Nt(e){var Y,oe,fe;if(typeof window=="undefined")return An;let t=(Y=e.flushIntervalMs)!=null?Y:5e3,n=(oe=e.maxBatchSize)!=null?oe:20,l=(fe=e.maxRetrySize)!=null?fe:100,g=e.ingestUrl,u=e.apiKey,s=tt(u),d=[],f=new Set,i=[],r=k=>{for(let T of k)a.delete(T),!f.has(T)&&(f.add(T),i.push(T));for(;i.length>_n;){let T=i.shift();T&&f.delete(T)}Ge(k,s)},a=new Set,w=()=>{for(;d.length>l;){let k=d.shift();k&&a.delete(k.id)}},A=k=>{f.has(k.id)||a.has(k.id)||(a.add(k.id),d.push(k),w())},p=k=>{for(let T of k)f.has(T.id)||(a.add(T.id),d.push(T));w()},m=Ke(s,l);for(let k of m)A(k);let x=0,v=0,B=(k,T=!0)=>{if(k.length===0)return;let re=JSON.stringify(k),ie=k.map(Z=>Z.id),X;try{X=fetch(g,{method:"POST",keepalive:!0,body:re,headers:{"Content-Type":"application/json",Authorization:`Bearer ${u}`}})}catch(Z){de(k,l,s),p(k),v++,x=Date.now()+se(v);return}let ke=Z=>{if(me(Z)!=="retry"){if(!Z.ok&&T){let ae=k.filter(q=>q.eventType!=="pageview");if(ae.length>0&&ae.length<k.length){r(k.filter(q=>q.eventType==="pageview").map(q=>q.id)),B(ae,!1);return}}r(ie),v=0,x=0;return}de(k,l,s),p(k),v++,x=Date.now()+se(v)};X instanceof Promise?X.then(ke).catch(()=>{de(k,l,s),p(k),v++,x=Date.now()+se(v)}):ke(X)},V=typeof TextEncoder!="undefined"?new TextEncoder:null,P=k=>V?V.encode(k).length:k.length,K=k=>{let T=[],re=2;for(let ie of k){let X=P(JSON.stringify(ie))+1;if(T.length>0&&re+X>Cn||T.length>=n)break;T.push(ie),re+=X}return T},M=()=>{try{if(Date.now()<x)return;for(;d.length>0&&!(Date.now()<x);){let k=d.filter(re=>!f.has(re.id));if(d.length=0,k.length===0)break;let T=K(k);if(T.length===0)break;T.length<k.length&&d.push(...k.slice(T.length)),B(T)}}catch(k){}},b=!0,L=null;L=setInterval(()=>{b&&M()},t);let G=()=>{document.visibilityState==="hidden"&&M()},ne=()=>{M()};return document.addEventListener("visibilitychange",G),window.addEventListener("pagehide",ne),{push(k){A(k),d.length>=n&&M()},flush:M,destroy(){b=!1,L!==null&&(clearInterval(L),L=null),document.removeEventListener("visibilitychange",G),window.removeEventListener("pagehide",ne),M()}}}var On=200;function nt(e){return`_snt_goal_retry_${e.slice(0,12)}`}var Tn={send:()=>{},flush:()=>{},destroy:()=>{}};function Kt(e){var P,K,M;if(typeof window=="undefined")return Tn;let t=(P=e.flushIntervalMs)!=null?P:5e3,n=(K=e.maxRetrySize)!=null?K:100,l=(M=e.maxPerFlush)!=null?M:5,g=nt(e.apiKey),u=[],s=new Set,d=new Set,f=[],i=0,r=0,a=!1,w=b=>{for(s.delete(b.id),d.has(b.id)||(d.add(b.id),f.push(b.id));f.length>On;){let L=f.shift();L&&d.delete(L)}Ge([b.id],g)},A=b=>{de([b],n,g),!d.has(b.id)&&!s.has(b.id)&&(s.add(b.id),u.push(b)),Date.now()>=i&&(r++,i=Date.now()+se(r))},p=b=>{let L;try{L=fetch(e.url,{method:"POST",keepalive:!0,body:b.body,headers:e.headers})}catch(ne){A(b);return}let G=ne=>{var oe;let Y=me(ne);if(Y==="retry"){A(b);return}Y==="dropped"&&((oe=e.onDrop)==null||oe.call(e,b,ne.status)),w(b),r=0,i=0};L instanceof Promise?L.then(G).catch(()=>A(b)):G(L)},m=()=>{try{if(a||Date.now()<i)return;let b=0;for(;u.length>0&&b<l&&!(Date.now()<i);){let L=u.shift();s.delete(L.id),!d.has(L.id)&&(b++,p(L))}}catch(b){}},x=Ke(g,n);for(let b of x)s.has(b.id)||(s.add(b.id),u.push(b));x.length>0&&de(x,n,g);let v=setInterval(m,t),B=()=>{document.visibilityState==="hidden"&&m()},V=()=>m();return document.addEventListener("visibilitychange",B),window.addEventListener("pagehide",V),{send(b){if(!a&&!(d.has(b.id)||s.has(b.id))){if(Date.now()<i){de([b],n,g),s.add(b.id),u.push(b);return}p(b)}},flush:m,destroy(){clearInterval(v),document.removeEventListener("visibilitychange",B),window.removeEventListener("pagehide",V),m(),a=!0}}}var Pn=1800*1e3;function Ue(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function Gt(e=Pn,t){let n=new Map,l=`_snt_asgn${Ee(t)}_`,g=(i,r)=>`${l}${encodeURIComponent(i)}:${encodeURIComponent(r)}`,u=i=>{let r=i.slice(l.length),a=r.indexOf(":");if(a<0)return null;try{return{componentId:decodeURIComponent(r.slice(0,a)),segment:decodeURIComponent(r.slice(a+1))}}catch(w){return null}},s=()=>{try{let i=[];for(let r=0;r<localStorage.length;r++){let a=localStorage.key(r);a!=null&&a.startsWith(l)&&i.push(a)}return i}catch(i){return[]}},d=i=>i.assignedAt+(i.ttlMs&&i.ttlMs>0?i.ttlMs:e)<Date.now();return typeof window!="undefined"&&(()=>{for(let i of s())try{let r=localStorage.getItem(i);if(!r)continue;let a=JSON.parse(r);if(d(a)){localStorage.removeItem(i);continue}let w=u(i);if(!w)continue;n.set(Ue(w.componentId,w.segment),a)}catch(r){}})(),{get(i,r){let a=n.get(Ue(i,r));return a?d(a)?(n.delete(Ue(i,r)),null):a:null},set(i,r,a){let w=Ue(i,r);n.set(w,a);try{localStorage.setItem(g(i,r),JSON.stringify(a))}catch(A){}},clear(){n.clear();for(let i of s())try{localStorage.removeItem(i)}catch(r){}}}}var Ie=["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 Re(e){return ot(e)!==null}function ot(e){var n;if(!e)return null;let t=e.toLowerCase();return(n=Ie.find(l=>t.includes(l.toLowerCase())))!=null?n:null}var Fe={GPTBot:"training","ChatGPT-User":"user","OAI-SearchBot":"search",ClaudeBot:"training","Claude-User":"user","Claude-SearchBot":"search",PerplexityBot:"search","Perplexity-User":"user","Google-Extended":"training","Applebot-Extended":"training","Meta-ExternalAgent":"training",Bytespider:"training",CCBot:"training",Amazonbot:"other","cohere-ai":"training",Diffbot:"other"};function Ut(e){if(!e)return"other";let t=Ie.find(n=>n.toLowerCase()===e.toLowerCase());return t&&Fe[t]||"other"}function Ft(){var t;let e={user:[],search:[],training:[],other:[]};for(let n of Ie)e[(t=Fe[n])!=null?t:"other"].push(n);return e}function _e(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 Ce(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(g){}let l=n.hostname.toLowerCase();return/(^|\.)(google|bing|duckduckgo|yahoo)\./.test(l)?"search":/(^|\.)(twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|t\.co)$/.test(l)?"social":"referral"}catch(n){return"direct"}}function Ae(e){if(!e)return null;try{return new URL(e).hostname}catch(t){return null}}var rt=["gclid","gbraid","wbraid","fbclid","ttclid","msclkid","twclid","li_fat_id"];function $e(e){let t={},n={};try{let l=typeof e=="string"||e instanceof URLSearchParams?new URLSearchParams(e):Object.entries(e).flatMap(([g,u])=>{let s=Array.isArray(u)?u[0]:u;return s===void 0?[]:[[g,s]]});for(let[g,u]of l)g.startsWith("utm_")?g in t||(t[g]=u):rt.includes(g)&&(g in n||(n[g]=u))}catch(l){}return{utmParams:t,clickIds:n}}function Oe(e){let t=e.getHours();return t<6?"night":t<12?"morning":t<18?"afternoon":"evening"}function $t(e){let t=Dn("__segment__",e);return`${t.deviceClass}:${t.trafficSource}`}function Dn(e,t){var u,s,d,f,i,r,a,w;let n=(s=(u=t==null?void 0:t.userAgent)==null?void 0:u.trim())!=null?s:"",l=(f=(d=t==null?void 0:t.referer)==null?void 0:d.trim())!=null?f:"",g=(i=t==null?void 0:t.now)!=null?i:new Date;return{sessionId:e,ephemeral:!1,utmParams:(r=t==null?void 0:t.utmParams)!=null?r:{},clickIds:(a=t==null?void 0:t.clickIds)!=null?a:{},deviceClass:n?_e(n):"desktop",trafficSource:l?Ce(l,t==null?void 0:t.appOrigin):"direct",referrerDomain:Ae(l),timeOfDay:Oe(g),dayOfWeek:(w=["sun","mon","tue","wed","thu","fri","sat"][g.getDay()])!=null?w:"sun",automation:(t==null?void 0:t.webdriver)===!0||Re(n)}}var ye=require("@sentientui/policy");function Te(e){return C(C(C({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 Se(e){let t=Te(e);return(0,ye.slotResultFor)(t,(0,ye.slotBaselineArm)(t))}function jt(e){let t={};for(let n of e)t[n.id]=Se(n);return t}function je(e){return typeof e=="string"?e:(0,ye.canonicalArm)(e)}var ge="_snt_snap:",Bn=["low","medium","high"];function he(e){try{let t=localStorage.getItem(ge+e);if(!t)return null;let n=JSON.parse(t);if(!n||typeof n!="object"||n.v!==1||typeof n.persona!="string"||typeof n.band!="string"||!Bn.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)))return null;let l=n.vocabulary;return l!==void 0&&(typeof l!="object"||l===null||!Array.isArray(l.entries)||!Array.isArray(l.images))&&delete n.vocabulary,n}catch(t){return null}}function ve(e,t){try{localStorage.setItem(ge+e,JSON.stringify(t))}catch(n){}}function Wt(e){return"(function(){try{var r=localStorage.getItem("+JSON.stringify(ge+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 dt=require("@sentientui/policy");var Ve=require("@sentientui/policy");var ze="[sentient] No API key configured \u2014 nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY or pass localMode: true for local development.",st="[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.",Vt=!1,We=!1;function Ln(){var e;try{return(e=new URLSearchParams(window.location.search).get("sentient_persona"))!=null?e:void 0}catch(t){return}}function zt(e){var i;let t=Ne({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),n=(i=t.getSessionId())!=null?i:"local",l=Ln(),g=import("@sentientui/core/local").then(r=>{let a=r;return a.LOCAL_ENGINE_AVAILABLE?(Vt||(Vt=!0,console.info(st)),a):(We||(We=!0,console.error(ze)),null)}).catch(()=>(We||(We=!0,console.error(ze)),null)),u=null,s={low:.15,medium:.5,high:.85},d=(()=>{var a;if(e.initialPersona)return C({},e.initialPersona);let r=he(e.apiKey||"local");return r?{persona:r.persona,confidence:(a=s[r.band])!=null?a:.15}:null})();function f(r){let a=document.documentElement;a.dataset.sentientPersona===void 0&&(a.dataset.sentientPersona=r.persona,a.dataset.sentientConfidence=(0,Ve.confidenceBand)(r.confidence))}return{isLocal:!0,async decide(r){var A,p,m;let a=await g;if(!a)return null;let w=a.createLocalEngine({sessionId:n,forcedPersona:l}).decide(r);return u=pe(C({},w),{layoutOrder:(p=(A=w.layoutOrder)!=null?A:u==null?void 0:u.layoutOrder)!=null?p:null,slots:C(C({},(m=u==null?void 0:u.slots)!=null?m:{}),w.slots)}),ve(e.apiKey||"local",{v:1,persona:u.persona,band:(0,Ve.confidenceBand)(u.confidence),slots:u.slots,layoutOrder:u.layoutOrder,savedAt:Date.now()}),f(w),w},getSlotResult(r){var a,w,A;return(A=(w=u==null?void 0:u.slots[r])!=null?w:(a=e.initialSlots)==null?void 0:a[r])!=null?A:null},getSlotConfig(r){var a,w;return(w=(a=e.initialSlotConfig)==null?void 0:a[r])!=null?w:null},getSitePalette(){var r;return(r=e.initialPalette)!=null?r:null},reportSlots(){},getPersona(){let r=u!=null?u:d;return r?{persona:r.persona,confidence:r.confidence,band:(0,Ve.confidenceBand)(r.confidence)}:null},async assign(r,a){var p;let w=await g;return!w||!a||a.length===0?a!=null&&a[0]?{variantId:a[0],assignmentTtlMs:0}:null:{variantId:(p=w.createLocalEngine({sessionId:n,forcedPersona:l}).decide({components:[{id:r,variantIds:a}]}).assignments[r])!=null?p:a[0],assignmentTtlMs:0}},track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>t.destroy()}}var at=/^(\*|\/[^\s?#*]*(\/\*)?)$/;function it(e){let t=e.split(/[?#]/)[0]||"/";return t.length>1?t.replace(/\/+$/,"")||"/":t}function Ht(e,t){if(e===void 0||!at.test(e))return!1;if(e==="*")return!0;let n=it(t);if(e.endsWith("/*")){let l=it(e.slice(0,-2));return n.startsWith(l==="/"?"/":`${l}/`)&&n!==l}return n===it(e)}var Mn=["none","sm","md","lg"],Nn=["start","center","end","stretch"],Kn=["start","center","end","between"],Gn=["sm","md","lg"],Un=["normal","medium","bold"],Fn=["default","muted","accent"],$n=["primary","secondary","ghost"],jn=["left","center","right"],Wn=["auto","square","landscape","wide"],Vn=["cover","contain"],zn=[2,3,4],Hn=[1,2,3,4],Jn=["default","raised"],Xn=["none","sm","md","lg"],Qn=["measure"],qn=["input","textarea","select"],Yn=["text","email","number","tel"],Zn=5,eo=8,to=64,no=5,oo=12,ro=4,so=500;function Jt(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(Jt):!1}var Fo=40,$o=120,jo=300;var lt="sentient-reveal",be="sentient-revealed",Xt=240,He=!1;function Qt(){var e;He=!1,typeof document!="undefined"&&((e=document.getElementById(lt))==null||e.remove())}function io(e){if(He||e.getElementById(lt)){He=!0;return}let t=e.createElement("style");t.id=lt,t.textContent=`@media (prefers-reduced-motion: no-preference){@keyframes ${be}{from{opacity:.55;transform:translateY(2px)}to{opacity:1;transform:none}}.${be}{animation:${be} 240ms cubic-bezier(.2,.6,.2,1) both}}`,e.head.appendChild(t),He=!0}function qt(e,t={}){var g;let n=(g=t.doc)!=null?g:typeof document!="undefined"?document:void 0;if(!n||!(e instanceof Element)||(t.arm!==void 0&&e.setAttribute("data-sentient-arm",t.arm),t.persona!==void 0&&e.setAttribute("data-sentient-persona",t.persona),t.previous!==void 0&&t.previous===e.textContent))return!1;io(n),e.classList.remove(be),e.offsetWidth,e.classList.add(be);let l=()=>{e.classList.remove(be),e.removeEventListener("animationend",l)};return e.addEventListener("animationend",l),!0}function Yt(e,t,n,l){let g=[];{let d=!1,f=[],i=()=>{if(d)return;let r=Date.now();for(f.push(r);f.length>0&&r-f[0]>500;)f.shift();f.length>=3&&(d=!0,e("rage_click"))};t.addEventListener("click",i),g.push(()=>t.removeEventListener("click",i))}{let u=!1,s=d=>{if(u||!(d.target instanceof Node)||!t.contains(d.target)&&t!==d.target)return;u=!0;let f=typeof window!="undefined"?window.getSelection():null,i=f?f.toString().length:0;e("text_copy",{selectionLength:i})};document.addEventListener("copy",s),g.push(()=>document.removeEventListener("copy",s))}{let u=!1,s=!1,d=null,f=()=>{d!==null&&(clearTimeout(d),d=null)},i=()=>{u||!s||(f(),d=setTimeout(()=>{!u&&s&&(u=!0,e("scroll_hesitation"))},3e3))},r=()=>{f(),i()},a=A=>{for(let p of A)s=p.intersectionRatio>.3,s?i():f()},w=new IntersectionObserver(a,{threshold:[.3]});w.observe(t),window.addEventListener("scroll",r,{passive:!0}),g.push(()=>{w.disconnect(),window.removeEventListener("scroll",r),f()})}if((l==null?void 0:l.tabLoss)!==!1){let u=!1,s=n!=null?n:Date.now(),d=()=>{if(u||document.visibilityState!=="hidden")return;let f=Date.now()-s;f<15e3&&(u=!0,e("tab_loss",{timeOnPage:f}))};document.addEventListener("visibilitychange",d),g.push(()=>document.removeEventListener("visibilitychange",d))}return()=>{for(let u of g)u()}}function ao(){var e;return typeof process=="undefined"||((e=process.env)==null?void 0:e.NODE_ENV)!=="production"}var Zt="https://api.sentient-ui.com/v1/events",J=new Map,en=null;function lo(e,t){let n=J.get(e);n&&n.upgrade&&(n.reinit=t)}function co(e){return"value"in e||"currency"in e||"externalId"in e||"metadata"in e||"weight"in e||"stepIndex"in e}var uo=3;function ct(){return Be()}function Je(){var e;if(typeof window!="undefined")return((e=window.location)==null?void 0:e.pathname)||void 0}function po(){let e=new WeakMap,t=new Map,n=!1,l=(d,f,i)=>{let r=d.get(f);return i===null?r?!0:(d.set(f,new Set),!1):r?r.has(i)?!0:(r.add(i),!1):(d.set(f,new Set([i])),!1)},g=typeof window!="undefined"&&"event"in window,u=()=>{if(!g)return;let d=window.event;return typeof Event=="function"&&d instanceof Event?d:void 0},s=()=>{if(g){Promise.resolve().then(()=>{n=!1,t.clear()});return}let d=!1,f=()=>{d||(d=!0,n=!1,t.clear())};if(setTimeout(f,0),typeof MessageChannel=="function"){let i=new MessageChannel;i.port1.onmessage=()=>{i.port1.close(),i.port2.close(),f()},i.port2.postMessage(0)}};return{firedBefore(d,f){let i=u();if(i){let a=e.get(i);return a||(a=new Map,e.set(i,a)),l(a,d,f)}let r=l(t,d,f);return!r&&!n&&(n=!0,s()),r}}}var tn=new Set;function go(e,t,n){let l=typeof window=="undefined"?null:window.history;if(!l)return()=>{};let g=!1,u,s=()=>{if(g)return;let i=Je();!i||i===u||(u=i,e.track({projectId:t,componentId:"__page__",eventType:"pageview",payload:{}}),n(`${t}:${i}`))},d=[];for(let i of["pushState","replaceState"]){let r=l[i],a=function(...w){let A=r.apply(this,w);return s(),A};l[i]=a,d.push([i,r,a])}window.addEventListener("popstate",s);let f=Je();return f&&tn.has(`${t}:${f}`)?u=f:s(),()=>{if(!g){g=!0,window.removeEventListener("popstate",s);for(let[i,r,a]of d)l[i]===a&&(l[i]=r)}}}var Pe={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}),flush:()=>{},dispose:()=>{},destroy:()=>{}};function fo(){try{return $e(window.location.search)}catch(e){return{utmParams:{},clickIds:{}}}}function nn(e){return e.replace(/\/events\/?$/,"")}function pt(){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 mo(e){var f;if(typeof window=="undefined")return;let t=e!=null?e:en;if(!t){console.warn("[sentient] grantConsent() called before init()");return}let n=J.get(t);if(!n){console.warn("[sentient] grantConsent() called before init()");return}let{config:l,upgrade:g,reinit:u}=n;if(!g){n.upgradeBlockedReason&&console.warn(n.upgradeBlockedReason);return}if(l.respectDoNotTrack!==!1&&pt())return;let s=(u!=null?u:on)(pe(C({},l),{consent:!0}));g(s);let d=(f=J.get(t))==null?void 0:f.dispose;J.set(t,{config:pe(C({},l),{consent:!0}),upgrade:null,dispose:d})}function yo(e){var A;let t=e.preConsentBehavior==="statistical_winner",n=nn((A=e.ingestUrl)!=null?A:Zt),l={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},g=new Map,u=new Map,s={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),assign(p,m,x){if(!t)return Promise.resolve(null);let v=g.get(p);return v?Promise.resolve(v):ut(u,p,async()=>{try{let B=new URLSearchParams({componentId:p});for(let M of m!=null?m:[])B.append("variantIds[]",M);let V=await fetch(`${n}/winner?${B.toString()}`,{headers:l});if(!V.ok)return m!=null&&m[0]?{variantId:m[0],assignmentTtlMs:0}:null;let K={variantId:(await V.json()).variantId,assignmentTtlMs:0};return g.set(p,K),K}catch(B){return m!=null&&m[0]?{variantId:m[0],assignmentTtlMs:0}:null}})},decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>{}},d=!1,f=new Set,i=[],r=[],a={track:p=>s.track(p),goal:((p,m,x,v)=>s.goal(p,m,x,v)),componentGoal:(p,m,x)=>s.componentGoal(p,m,x),identify:p=>s.identify(p),getAssignment:(p,m)=>s.getAssignment(p,m),assign:(p,m,x,v)=>s.assign(p,m,x,v),decide:p=>s.decide(p),getSlotResult:p=>s.getSlotResult(p),isSlotDecided:p=>{var m,x;return(x=(m=s.isSlotDecided)==null?void 0:m.call(s,p))!=null?x:!0},getSlotConfig:p=>s.getSlotConfig(p),getSitePalette:()=>s.getSitePalette(),getStyleVocabulary:()=>{var p,m;return(m=(p=s.getStyleVocabulary)==null?void 0:p.call(s))!=null?m:null},reportSlots:(p,m,x,v)=>s.reportSlots(p,m,x,v),reportSkeleton:(p,m)=>{var x;return(x=s.reportSkeleton)==null?void 0:x.call(s,p,m)},reportDrift:(p,m,x,v)=>{var B;return(B=s.reportDrift)==null?void 0:B.call(s,p,m,x,v)},requestSlots:(p,m,x)=>{var v;return d?(v=s.requestSlots)==null?void 0:v.call(s,p,m,x):i.push([p,m,x])},decideSlots:p=>{var m;return d?(m=s.decideSlots)==null?void 0:m.call(s,p):r.push(...p)},cancelSlots:p=>{var x;if(d)return(x=s.cancelSlots)==null?void 0:x.call(s,p);let m=new Set(p);for(let v of i)v[0]=v[0].filter(B=>!m.has(B));r=r.filter(v=>!m.has(v.id))},onSlotsChanged:p=>(f.add(p),()=>{f.delete(p)}),getPersona:()=>s.getPersona(),fetchWeights:()=>s.fetchWeights(),getGraph:()=>s.getGraph(),flush:()=>s.flush(),dispose:()=>s.dispose(),destroy:()=>s.destroy()};function w(p){var m,x,v;s=p,d=!0,(m=p.onSlotsChanged)==null||m.call(p,()=>f.forEach(B=>B()));for(let[B,V,P]of i.splice(0))B.length>0&&((x=p.requestSlots)==null||x.call(p,B,V,P));r.length>0&&((v=p.decideSlots)==null||v.call(p,r.splice(0)))}return{proxy:a,setInner:w}}function ut(e,t,n){let l=e.get(t);if(l)return l;let g=(async()=>{try{return await n()}finally{e.delete(t)}})();return e.set(t,g),g}function on(e){var ht,vt,bt,kt,xt,wt,Et,It,Rt,_t;if(typeof window=="undefined")return Pe;en=e.apiKey||"local";let t=J.get(e.apiKey||"local");if(t!=null&&t.dispose)try{t.dispose()}catch(o){}let n=e.respectDoNotTrack!==!1&&pt(),l=e.consent===!1||n,g=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_");if(e.localMode===!0||!g&&e.localMode!==!1)return J.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."}),l?Pe:zt(e);if(l){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."),J.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."}),Pe;let{proxy:o,setInner:c}=yo(e);return J.set(e.apiKey,{config:e,upgrade:n?null:c}),o}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."),Pe;if(e.ingestUrl==="")return console.warn("[sentient] init() called with an empty ingestUrl. SDK disabled."),Pe;let u=(ht=e.ingestUrl)!=null?ht:Zt,s=Date.now(),d=Ne({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),f=Gt(void 0,e.apiKey),i=Nt({ingestUrl:u,apiKey:e.apiKey}),r=nn(u),a={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},w=new Set,A=Kt({url:`${r}/goals`,apiKey:e.apiKey,headers:a,onDrop:(o,c)=>{if(!e.debug){if(w.has(c))return;w.add(c)}console.warn(`[sentient] goal dropped (HTTP ${c}) \u2014 this will not be retried. `+(c===400?"The session was not found: call init() and let the session upsert complete before firing goals.":c===401||c===403?"Check the API key and that this origin is on the project allowlist.":"See the response status for the cause."),o)}}),p=_e((vt=navigator.userAgent)!=null?vt:""),m=window.location.origin,x=Ce((bt=document.referrer)!=null?bt:"",m),v=(kt=e.sessionSegment)!=null?kt:`${p}:${x}`,B=new Map,V=new Map,P=new Map,K=new Set,M=new Map,b=null,L=null,G=null,ne=new Set,Y=new Set,oe=new Map,fe=new Map,k=new Set,T=new Set,re=new Set,ie=null,X=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/,ke=new Set,Z=new Set,ae=new Set,q=new Map,Xe=null,De=new Set,xe=new Map,Qe=null,rn=2,gt=new Map,qe=!1,ft=(o,c,h)=>{var y;let I=new Set,R=1;for(let S of o){c.delete(S);let _=((y=gt.get(S))!=null?y:0)+1;gt.set(S,_),_<=rn&&(I.add(S),_>R&&(R=_))}I.size>0&&setTimeout(()=>{qe||h(I)},se(R))},mt=o=>{for(let c of o)P.has(c.id)||P.set(c.id,Se(c))};if(e.initialSlots)for(let[o,c]of Object.entries(e.initialSlots))P.set(o,c),K.add(o);if(e.initialSlotConfig)for(let[o,c]of Object.entries(e.initialSlotConfig))M.set(o,c);e.initialPalette&&(b=e.initialPalette),e.initialVocabulary&&(L=e.initialVocabulary);let ee=he(e.apiKey);if(ee){for(let[o,c]of Object.entries(ee.slots))P.has(o)||P.set(o,c);for(let[o,c]of Object.entries((xt=ee.slotConfig)!=null?xt:{}))M.has(o)||M.set(o,c);!b&&ee.palette&&(b=ee.palette),!L&&ee.vocabulary&&(L=ee.vocabulary)}let yt={low:.15,medium:.5,high:.85};if(e.initialPersona)G=C({},e.initialPersona);else{let o=document.documentElement.dataset;o.sentientPersona?G={persona:o.sentientPersona,confidence:(Et=yt[(wt=o.sentientConfidence)!=null?wt:"low"])!=null?Et:.15}:ee&&(G={persona:ee.persona,confidence:(It=yt[ee.band])!=null?It:.15})}if(e.initialAssignments)for(let[o,c]of Object.entries(e.initialAssignments))f.set(o,v,{variantId:c,assignedAt:Date.now(),segment:v,confidence:1});let le=Promise.resolve(),St=d.getSessionId();if(St){let o=Ae((Rt=document.referrer)!=null?Rt:""),{utmParams:c,clickIds:h}=fo(),I=C(C(C(C({sessionId:St,deviceClass:p,trafficSource:x,referrerDomain:o,utmParams:c,clickIds:h,timeOfDay:Oe(new Date),dayOfWeek:["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()],ephemeral:d.isEphemeral(),automation:typeof navigator!="undefined"&&navigator.webdriver===!0||Re((_t=navigator.userAgent)!=null?_t:"")},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 y=0;;y++){try{let S=await fetch(`${r}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(I),headers:a});if(S.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(S.ok||me(S)==="dropped")return}catch(S){}if(y>=uo){console.warn("[SentientUI] Could not register the session after retries. Conversions in this visit may not be recorded.");return}await new Promise(S=>setTimeout(S,se(y+1)))}};try{le=R()}catch(y){}}e.debug&&(console.log("[sentient] initialized",{context:e.context}),window.__sentient={client:null,queue:i});let sn=po(),ue=null,Ye=!1,U={goal(o,c={},h=1,I=0){var j,F,H,Q,z,E,W;let R=d.getSessionId();if(!R)return;let y=co(c)?c:{metadata:c},S=[o,(j=y.externalId)!=null?j:"",(F=y.stepIndex)!=null?F:I,(H=y.weight)!=null?H:h].join("\0"),_=y.value!==void 0?`${y.value}\0${(Q=y.currency)!=null?Q:""}`:null;if(sn.firedBefore(S,_)){e.debug&&console.log(`[sentient] goal("${o}") already recorded for this action \u2014 not sent twice`);return}let O=ct(),D={sessionId:R,name:o,metadata:(z=y.metadata)!=null?z:{},weight:(E=y.weight)!=null?E:h,stepIndex:(W=y.stepIndex)!=null?W:I,goalId:O,value:y.value,currency:y.currency,externalId:y.externalId};e.debug&&console.log("[sentient] goal",D);let $={id:O,body:JSON.stringify(D)};le.then(()=>A.send($))},componentGoal(o,c,h){var O,D,$;let I=d.getSessionId();if(!I)return;let R=f.get(o,v),y=R?null:(O=P.get(o))!=null?O:null;if(!R&&y===null){e.debug&&console.warn(`[sentient] componentGoal("${o}"): no assignment or slot decision yet \u2014 render its <Adaptive>/adaptive hook or call assign()/decide() before recording a goal.`);return}if(!R&&!K.has(o)){e.debug&&console.warn(`[sentient] componentGoal("${o}"): slot not decided this session \u2014 not attributed`);return}let S=R?R.variantId:je(y),_={id:ct(),sessionId:I,projectId:e.apiKey,componentId:o,variantId:S,eventType:"goal_achieved",goalType:c,payload:C({reward:(D=h==null?void 0:h.reward)!=null?D:1,goalValue:h==null?void 0:h.value,currency:h==null?void 0:h.currency},($=h==null?void 0:h.metadata)!=null?$:{}),timestamp:Date.now(),timeInSession:Date.now()-s,path:Je()};e.debug&&console.log("[sentient] componentGoal",_),le.then(()=>i.push(_))},identify(o){let c=d.getSessionId();c&&le.then(()=>{fetch(`${r}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify({sessionId:c,userId:o,ephemeral:d.isEphemeral()}),headers:a}).catch(()=>{})})},track(o){let c=d.getSessionId();if(!c||o.eventType==="variant_assigned"&&P.get(o.componentId)!==void 0&&!K.has(o.componentId)&&!f.get(o.componentId,v))return;let h=pe(C({path:Je()},o),{id:ct(),sessionId:c,timestamp:Date.now(),timeInSession:Date.now()-s});e.debug&&console.log("[sentient] track",h),le.then(()=>i.push(h))},getAssignment(o,c){return f.get(o,c)},async assign(o,c,h,I){let R=d.getSessionId();if(!R)return null;let y=f.get(o,v);if(y&&(c!=null&&c.length||y.content!==void 0)){let S=y.ttlMs&&y.ttlMs>0?Math.max(0,y.assignedAt+y.ttlMs-Date.now()):0;return{variantId:y.variantId,assignmentTtlMs:S,content:y.content}}return ut(B,o,async()=>{await le;try{let S={sessionId:R,componentId:o,variantIds:c};I!==void 0?S.agentDataByVariant=I:h!==void 0&&(S.agentData=h);let _=await fetch(`${r}/assign`,{method:"POST",body:JSON.stringify(S),headers:a});if(!_.ok)return null;let O=await _.json();return f.set(o,v,C({variantId:O.variantId,assignedAt:Date.now(),segment:v,confidence:1,content:O.content},O.assignmentTtlMs&&O.assignmentTtlMs>0?{ttlMs:O.assignmentTtlMs}:{})),O}catch(S){return null}})},async decide(o){var y,S;let c=d.getSessionId();if(!c)return null;let h=(y=o.slots)!=null?y:[],I={sessionId:c};o.sections&&o.sections.length>0&&(I.sections=o.sections.map(_=>({id:_}))),I.components=(S=o.components)!=null?S:[],h.length>0&&(I.slots=h.map(Te)),o.slotsFrom==="registry"&&(I.slotsFrom="registry",o.registrySlotIds&&(I.registrySlotIds=o.registrySlotIds),o.bootstrap===!1&&(I.bootstrap=!1),o.render&&Object.keys(o.render).length>0&&(I.render=o.render)),o.v&&(I.v=o.v),typeof o.pp=="number"&&(I.pp=o.pp),e.persona&&(I.persona=e.persona);let R=JSON.stringify(I);return ut(V,R,async()=>{var _,O,D,$,j,F,H,Q;await le;try{let z=await fetch(`${r}/decide`,{method:"POST",body:R,headers:a});if(!z.ok)return mt(h),null;let E=await z.json(),W={};for(let N of h){let te=(_=E.slots)==null?void 0:_[N.id];if(te!==void 0){W[N.id]=te,P.set(N.id,te),K.add(N.id);continue}let Ct=P.get(N.id);if(Ct!==void 0)W[N.id]=Ct;else{let At=Se(N);W[N.id]=At,P.set(N.id,At)}}if(E.slots)for(let[N,te]of Object.entries(E.slots))N in W||(W[N]=te,P.set(N,te),K.add(N));let ce=G!=null&&G.persona!=="unknown";E.persona&&!(E.persona==="unknown"&&ce)?G={persona:E.persona,confidence:(O=E.confidence)!=null?O:0}:G||(G={persona:"unknown",confidence:0});for(let[N,te]of Object.entries((D=E.assignments)!=null?D:{}))f.set(N,v,{variantId:te,assignedAt:Date.now(),segment:v,confidence:1});if(E.slotConfig)for(let[N,te]of Object.entries(E.slotConfig))M.set(N,te);E.palette&&(b=E.palette),E.vocabulary&&(L=E.vocabulary);for(let N of($=o.registrySlotIds)!=null?$:[])(j=E.slotConfig)!=null&&j[N]||(M.delete(N),P.delete(N),K.delete(N));return ve(e.apiKey,C(C(C({v:1,persona:G.persona,band:(0,dt.confidenceBand)(G.confidence),slots:Object.fromEntries(P),layoutOrder:(F=E.layoutOrder)!=null?F:null,savedAt:Date.now()},M.size>0?{slotConfig:Object.fromEntries(M)}:{}),b?{palette:b}:{}),L?{vocabulary:L}:{})),C(C(C(C(C({layoutOrder:(H=E.layoutOrder)!=null?H:null,assignments:(Q=E.assignments)!=null?Q:{},slots:W,persona:G.persona,confidence:G.confidence},E.slotConfig?{slotConfig:E.slotConfig}:{}),E.goals?{goals:E.goals}:{}),E.sectionMap?{sectionMap:E.sectionMap}:{}),E.palette?{palette:E.palette}:{}),E.vocabulary?{vocabulary:E.vocabulary}:{})}catch(z){return mt(h),null}})},getSlotResult(o){var c;return(c=P.get(o))!=null?c:null},isSlotDecided(o){return K.has(o)},getSlotConfig(o){var c;return(c=M.get(o))!=null?c:null},reportSlots(o,c,h,I){var y;let R={};for(let[S,_]of Object.entries(I!=null?I:{}))for(let O of _){let D=`${S}|${O.key}`;!X.test(S)||re.has(D)||(re.add(D),((y=R[S])!=null?y:R[S]=[]).push(O))}Object.keys(R).length>0&&fetch(`${r}/slots/observed`,{method:"POST",headers:a,body:JSON.stringify({slotIds:Object.keys(R),authoredArms:R})}).catch(()=>{});for(let S of o)if(!(typeof S!="string"||S.length===0)){if(!X.test(S)){ao()&&!ke.has(S)&&(ke.add(S),console.warn(`[sentient] reportSlots: slot id ${JSON.stringify(S)} 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(!ne.has(S)){ne.add(S),Y.add(S);let _=c==null?void 0:c[S];if(typeof _=="string"){let D=_.replace(/\s+/g," ").trim().slice(0,400);D!==""&&oe.set(S,D)}let O=h==null?void 0:h[S];O!==void 0&&fe.set(S,O)}}Y.size===0||ie!=null||(ie=setTimeout(()=>{ie=null;let S=[...Y];Y.clear();for(let _=0;_<S.length;_+=20){let O=S.slice(_,_+20),D={},$={};for(let j of O){let F=oe.get(j);F!==void 0&&(D[j]=F,oe.delete(j));let H=fe.get(j);H!==void 0&&($[j]=H,fe.delete(j))}fetch(`${r}/slots/observed`,{method:"POST",headers:a,body:JSON.stringify(pe(C(C({slotIds:O},Object.keys(D).length>0?{baselineTexts:D}:{}),Object.keys($).length>0?{baselineSkeletons:$}:{}),{pagePaths:Object.fromEntries(O.map(j=>[j,location.pathname]))}))}).catch(()=>{})}},1e3))},reportSkeleton(o,c){!X.test(o)||k.has(o)||(k.add(o),fetch(`${r}/slots/observed`,{method:"POST",headers:a,body:JSON.stringify({slotIds:[o],baselineSkeletons:{[o]:c}})}).catch(()=>{}))},reportDrift(o,c,h,I){let R=`${o}|${c}`,y=d.getSessionId();!y||T.has(R)||(T.add(R),fetch(`${r}/slots/drift`,{method:"POST",headers:a,body:JSON.stringify({sessionId:y,reports:[{slotId:o,expectedFp:c,observedFp:h,reason:I}]})}).catch(()=>{}))},requestSlots(o,c,h){var I,R;for(let y of o)ae.has(y)||(ae.add(y),X.test(y)?q.set(y,{text:c==null?void 0:c[y],render:(I=h==null?void 0:h.render)==null?void 0:I[y],skeleton:(R=h==null?void 0:h.skeletons)==null?void 0:R[y]}):U.reportSlots([y]));q.size===0||Xe!=null||(Xe=setTimeout(()=>{Xe=null;let y=[...q];q.clear();for(let S=0;S<y.length;S+=50){let _=y.slice(S,S+50),O={};for(let[D,$]of _)$.render&&(O[D]=$.render);U.decide({slotsFrom:"registry",registrySlotIds:_.map(([D])=>D),bootstrap:!1,render:O}).then(D=>{var $,j;if(D){let F={},H={},Q=[];for(let[z,E]of _){let W=($=D.slotConfig)==null?void 0:$[z];if(W){W.needsSkeleton&&E.skeleton&&((j=U.reportSkeleton)==null||j.call(U,z,E.skeleton));continue}Q.push(z),E.text&&(F[z]=E.text),E.skeleton&&(H[z]=E.skeleton)}Q.length>0&&U.reportSlots(Q,F,H)}else ft(_.map(([F])=>F),ae,F=>{var E;let H={},Q={},z={};for(let[W,ce]of _)F.has(W)&&(ce.text&&(H[W]=ce.text),ce.render&&(Q[W]=ce.render),ce.skeleton&&(z[W]=ce.skeleton));(E=U.requestSlots)==null||E.call(U,[...F],H,{render:Q,skeletons:z})});Z.forEach(F=>F())})}},0))},decideSlots(o){for(let c of o)De.has(c.id)||(De.add(c.id),xe.set(c.id,c));xe.size===0||Qe!=null||(Qe=setTimeout(()=>{Qe=null;let c=[...xe.values()];xe.clear();for(let h=0;h<c.length;h+=30){let I=c.slice(h,h+30);U.decide({slots:I}).then(R=>{R||ft(I.map(y=>y.id),De,y=>{var S;return(S=U.decideSlots)==null?void 0:S.call(U,I.filter(_=>y.has(_.id)))}),Z.forEach(y=>y())})}},0))},cancelSlots(o){for(let c of o)q.delete(c)&&ae.delete(c),xe.delete(c)&&De.delete(c)},onSlotsChanged(o){return Z.add(o),()=>{Z.delete(o)}},getStyleVocabulary(){return L},getSitePalette(){return b},getPersona(){return G?{persona:G.persona,confidence:G.confidence,band:(0,dt.confidenceBand)(G.confidence)}:null},async fetchWeights(){var o;try{let c=await fetch(`${r}/weights`,{headers:a});return c.ok?(o=(await c.json()).components)!=null?o:[]:[]}catch(c){return[]}},getGraph(){return{pageNodes:[],capturedAt:0}},flush(){i.flush(),A.flush()},dispose(){var o;ue==null||ue(),Ye=!0,qe=!0,i.destroy(),A.destroy(),((o=J.get(e.apiKey))==null?void 0:o.dispose)===U.dispose&&J.delete(e.apiKey),e.debug&&console.log("[sentient] disposed")},destroy(){var o;ue==null||ue(),Ye=!0,qe=!0,i.destroy(),A.destroy(),d.destroy(),f.clear(),((o=J.get(e.apiKey))==null?void 0:o.dispose)===U.dispose&&J.delete(e.apiKey);try{localStorage.removeItem(ge+e.apiKey),localStorage.removeItem(tt(e.apiKey)),localStorage.removeItem(nt(e.apiKey))}catch(c){}e.debug&&console.log("[sentient] destroyed")}};if(J.set(e.apiKey,{config:e,upgrade:null,dispose:U.dispose}),ue=go(U,e.apiKey,o=>{le.then(()=>{Ye||tn.add(o)})}),e.debug){let o=window;o.__sentient&&(o.__sentient.client=U)}return U}0&&(module.exports={AGENT_INTENTS,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,CLICK_ID_KEYS,FORM_FIELD_KINDS,FORM_INPUT_TYPES,LEGACY_SESSION_COOKIE_NAME,LOCAL_MODE_BANNER,MAX_BLOCK_ARMS,MAX_BLOCK_CHILDREN,MAX_BLOCK_DEPTH,MAX_BLOCK_NODES,MAX_BLOCK_TEXT_LEN,MAX_FORM_FIELDS,MAX_FORM_SELECT_OPTIONS,MAX_SKELETON_LEAVES,MAX_SKELETON_NODES,MAX_SKELETON_TEXT,PAGE_SCOPE_RE,PROD_KEYLESS_ERROR,REVEAL_MS,SNAPSHOT_STORAGE_KEY_PREFIX,_registerConsentUpgradeInit,agentIntent,agentUaList,armOfResult,attachMicroSignalDetectors,baselineResultFor,baselineSlots,classifiedAgents,containsFormBlock,deriveSessionSegment,detectDeviceClass,detectTimeOfDay,detectTrafficSource,extractTrackedParams,grantConsent,init,isDoNotTrackEnabled,matchedAgentToken,pageScopeMatches,readSnapshot,referrerDomainFromReferer,renderPrePaintScript,resetRevealStyles,reveal,sessionCookieName,toWireSlot,uaTokenMatch,writeSnapshot});
|
|
1
|
+
"use strict";var An=Object.create;var De=Object.defineProperty,Tn=Object.defineProperties,On=Object.getOwnPropertyDescriptor,Pn=Object.getOwnPropertyDescriptors,Dn=Object.getOwnPropertyNames,Jt=Object.getOwnPropertySymbols,Bn=Object.getPrototypeOf,Zt=Object.prototype.hasOwnProperty,Ln=Object.prototype.propertyIsEnumerable;var Yt=(e,t,n)=>t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))Zt.call(t,n)&&Yt(e,n,t[n]);if(Jt)for(var n of Jt(t))Ln.call(t,n)&&Yt(e,n,t[n]);return e},ve=(e,t)=>Tn(e,Pn(t));var Mn=(e,t)=>{for(var n in t)De(e,n,{get:t[n],enumerable:!0})},en=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of Dn(t))!Zt.call(e,p)&&p!==n&&De(e,p,{get:()=>t[p],enumerable:!(i=On(t,p))||i.enumerable});return e};var Nn=(e,t,n)=>(n=e!=null?An(Bn(e)):{},en(t||!e||!e.__esModule?De(n,"default",{value:e,enumerable:!0}):n,e)),Kn=e=>en(De({},"__esModule",{value:!0}),e);var Go={};Mn(Go,{AGENT_INTENTS:()=>ot,BLOCK_ALIGNS:()=>so,BLOCK_EMPHASES:()=>uo,BLOCK_FITS:()=>fo,BLOCK_GAPS:()=>ro,BLOCK_GRID_COLUMNS:()=>mo,BLOCK_HEADING_LEVELS:()=>yo,BLOCK_JUSTIFIES:()=>io,BLOCK_MAX_WIDTHS:()=>vo,BLOCK_PADS:()=>ho,BLOCK_RATIOS:()=>go,BLOCK_SIZES:()=>ao,BLOCK_SURFACES:()=>So,BLOCK_TEXT_ALIGNS:()=>po,BLOCK_TONES:()=>co,BLOCK_WEIGHTS:()=>lo,CLICK_ID_KEYS:()=>wt,FORM_FIELD_KINDS:()=>bo,FORM_INPUT_TYPES:()=>ko,LEGACY_SESSION_COOKIE_NAME:()=>be,LOCAL_MODE_BANNER:()=>Et,MAX_BLOCK_ARMS:()=>Ro,MAX_BLOCK_CHILDREN:()=>Io,MAX_BLOCK_DEPTH:()=>_o,MAX_BLOCK_NODES:()=>Eo,MAX_BLOCK_TEXT_LEN:()=>Co,MAX_FORM_FIELDS:()=>xo,MAX_FORM_SELECT_OPTIONS:()=>wo,MAX_SKELETON_LEAVES:()=>kr,MAX_SKELETON_NODES:()=>br,MAX_SKELETON_TEXT:()=>xr,PAGE_SCOPE_RE:()=>It,PROD_KEYLESS_ERROR:()=>lt,REVEAL_MS:()=>Ct,SNAPSHOT_STORAGE_KEY_PREFIX:()=>fe,_registerConsentUpgradeInit:()=>Oo,agentIntent:()=>ln,agentUaList:()=>Ne,applyNonce:()=>ze,armOfResult:()=>st,attachMicroSignalDetectors:()=>hn,baselineResultFor:()=>Ae,baselineSlots:()=>un,classifiedAgents:()=>cn,containsFormBlock:()=>mn,cspNonce:()=>St,deriveSessionSegment:()=>dn,detectDeviceClass:()=>Ge,detectTimeOfDay:()=>Fe,detectTrafficSource:()=>Ue,extractTrackedParams:()=>rt,forgetGeneration:()=>ie,forgetVisitor:()=>Ye,grantConsent:()=>No,init:()=>_n,isDoNotTrackEnabled:()=>Bt,matchedAgentToken:()=>xt,pageScopeMatches:()=>fn,readSnapshot:()=>Ee,referrerDomainFromReferer:()=>$e,renderPrePaintScript:()=>tn,resetRevealStyles:()=>yn,reveal:()=>Sn,routeKey:()=>Pt,sessionCookieName:()=>we,setCspNonce:()=>He,toWireSlot:()=>je,uaTokenMatch:()=>Ke,writeSnapshot:()=>_e});module.exports=Kn(Go);function de(e){if(typeof AbortController!="function")return{clear:()=>{}};let t=new AbortController,n=setTimeout(()=>t.abort(),e);return{signal:t.signal,clear:()=>clearTimeout(n)}}function mt(e,t){return new Promise(n=>{let i=setTimeout(()=>n(!1),t),p=()=>{clearTimeout(i),n(!0)};e.then(p,p)})}var yt;function He(e){yt=typeof e=="string"&&e!==""?e:void 0}function St(e=document){if(yt)return yt;try{let t=e.querySelector("script[nonce]");return(t==null?void 0:t.nonce)||(t==null?void 0:t.getAttribute("nonce"))||void 0}catch(t){return}}function ze(e,t=document){let n=St(t);return n&&e.setAttribute("nonce",n),e}function ge(e){return e?`_${e.slice(0,12)}`:""}var be="_snt_uid";function we(e){return`${be}${ge(e)}`}var Qe="__sntForgetGen",Gn=()=>{try{return window[Qe]}catch(e){return}};function Xe(e){var t,n;try{let i=window,p=(t=i[Qe])!=null?t:i[Qe]={};p[e]=((n=p[e])!=null?n:0)+1}catch(i){}}function ie(e){var t,n;return(n=(t=Gn())==null?void 0:t[e])!=null?n:0}var fe="_snt_snap:";var Un=["low","medium","high"];function Ee(e){try{let t=localStorage.getItem(fe+e);if(!t)return null;let n=JSON.parse(t);if(!n||typeof n!="object"||n.v!==1||typeof n.persona!="string"||typeof n.band!="string"||!Un.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"||!(Date.now()-n.savedAt<2592e6)||!(n.slotConfig===void 0||typeof n.slotConfig=="object"&&n.slotConfig!==null&&!Array.isArray(n.slotConfig)))return null;let i=n.vocabulary;return i!==void 0&&(typeof i!="object"||i===null||!Array.isArray(i.entries)||!Array.isArray(i.images))&&delete n.vocabulary,n}catch(t){return null}}function _e(e,t){try{localStorage.setItem(fe+e,JSON.stringify(t))}catch(n){}}function tn(e){return'(function(){try{var N=navigator,W=window;if(N.doNotTrack=="1"||N.doNotTrack=="yes"||W.doNotTrack=="1"||N.msDoNotTrack=="1"||N.globalPrivacyControl)return;var r=localStorage.getItem('+JSON.stringify(fe+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;if(!('+2592e6+'>Date.now()-s.savedAt))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){}})();'}function me(e){return Math.min(6e4,1e3*2**Math.min(e,6))}function Ie(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 qe(e,t){try{let n=localStorage.getItem(e);if(!n)return[];let i=JSON.parse(n);return Array.isArray(i)?(localStorage.removeItem(e),i.slice(-t)):[]}catch(n){return[]}}function Be(e,t,n){try{let i=(()=>{try{let d=localStorage.getItem(n);if(!d)return[];let S=JSON.parse(d);return Array.isArray(S)?S:[]}catch(d){return[]}})(),p=new Map;for(let d of i)p.set(d.id,d);for(let d of e)p.set(d.id,d);localStorage.setItem(n,JSON.stringify([...p.values()].slice(-t)))}catch(i){}}function Je(e,t){try{let n=localStorage.getItem(t);if(!n)return;let i=JSON.parse(n);if(!Array.isArray(i))return;let p=new Set(e),d=i.filter(S=>!p.has(S.id));if(d.length===i.length)return;d.length===0?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(d))}catch(n){}}var $n=500,Fn=56*1024;function Le(e){return`_snt_retry_${e.slice(0,12)}`}var jn={push:()=>{},flush:()=>{},destroy:()=>{}};function nn(e){var $,q,ue;if(typeof window=="undefined")return jn;let t=($=e.flushIntervalMs)!=null?$:5e3,n=(q=e.maxBatchSize)!=null?q:20,i=(ue=e.maxRetrySize)!=null?ue:100,p=e.ingestUrl,d=e.apiKey,S=Le(d),o=!1,f=ie(d),a=(...b)=>{!o&&ie(d)===f&&Be(...b)},s=[],l=new Set,h=[],O=b=>{for(let B of b)R.delete(B),!l.has(B)&&(l.add(B),h.push(B));for(;h.length>$n;){let B=h.shift();B&&l.delete(B)}Je(b,S)},R=new Set,D=()=>{for(;s.length>i;){let b=s.shift();b&&R.delete(b.id)}},X=b=>{l.has(b.id)||R.has(b.id)||(R.add(b.id),s.push(b),D())},G=b=>{for(let B of b)l.has(B.id)||(R.add(B.id),s.push(B));D()},z=qe(S,i);for(let b of z)X(b);let j=0,W=0,L=(b,B=!0)=>{if(b.length===0)return;let pe=JSON.stringify(b),ke=b.map(ae=>ae.id),te,ye=de(15e3);try{te=fetch(p,{method:"POST",keepalive:!0,signal:ye.signal,body:pe,headers:{"Content-Type":"application/json",Authorization:`Bearer ${d}`}})}catch(ae){a(b,i,S),G(b),W++,j=Date.now()+me(W);return}Promise.resolve(te).then(ye.clear,ye.clear);let Oe=ae=>{if(Ie(ae)!=="retry"){if(!ae.ok&&B){let Se=b.filter(re=>re.eventType!=="pageview");if(Se.length>0&&Se.length<b.length){O(b.filter(re=>re.eventType==="pageview").map(re=>re.id)),L(Se,!1);return}}O(ke),W=0,j=0;return}a(b,i,S),G(b),W++,j=Date.now()+me(W)};te&&typeof te.then=="function"?te.then(Oe).catch(()=>{a(b,i,S),G(b),W++,j=Date.now()+me(W)}):Oe(te)},ee=typeof TextEncoder!="undefined"?new TextEncoder:null,u=b=>ee?ee.encode(b).length:b.length,m=b=>{let B=[],pe=2;for(let ke of b){let te=u(JSON.stringify(ke))+1;if(B.length>0&&pe+te>Fn||B.length>=n)break;B.push(ke),pe+=te}return B},w=()=>{try{if(Date.now()<j)return;for(;s.length>0&&!(Date.now()<j);){let b=s.filter(pe=>!l.has(pe.id));if(s.length=0,b.length===0)break;let B=m(b);if(B.length===0)break;B.length<b.length&&s.push(...b.slice(B.length)),L(B)}}catch(b){}},g=!0,E=null;E=setInterval(()=>{g&&w()},t);let M=()=>{document.visibilityState==="hidden"&&w()},P=()=>{w()};return document.addEventListener("visibilitychange",M),window.addEventListener("pagehide",P),{push(b){X(b),s.length>=n&&w()},flush:w,destroy(b){b!=null&&b.forget&&(o=!0),g=!1,E!==null&&(clearInterval(E),E=null),document.removeEventListener("visibilitychange",M),window.removeEventListener("pagehide",P),w()}}}var Wn=200;function Me(e){return`_snt_goal_retry_${e.slice(0,12)}`}var Vn={send:()=>{},flush:()=>{},destroy:()=>{}};function on(e){var u,m,w;if(typeof window=="undefined")return Vn;let t=(u=e.flushIntervalMs)!=null?u:5e3,n=(m=e.maxRetrySize)!=null?m:100,i=(w=e.maxPerFlush)!=null?w:5,p=Me(e.apiKey),d=!1,S=ie(e.apiKey),o=(...g)=>{!d&&ie(e.apiKey)===S&&Be(...g)},f=[],a=new Set,s=new Set,l=[],h=0,O=0,R=!1,D=g=>{for(a.delete(g.id),s.has(g.id)||(s.add(g.id),l.push(g.id));l.length>Wn;){let E=l.shift();E&&s.delete(E)}Je([g.id],p)},X=g=>{o([g],n,p),!s.has(g.id)&&!a.has(g.id)&&(a.add(g.id),f.push(g)),Date.now()>=h&&(O++,h=Date.now()+me(O))},G=g=>{let E,M=de(15e3);try{E=fetch(e.url,{method:"POST",keepalive:!0,signal:M.signal,body:g.body,headers:e.headers})}catch($){X(g);return}let P=$=>{var ue;let q=Ie($);if(q==="retry"){X(g);return}q==="dropped"&&((ue=e.onDrop)==null||ue.call(e,g,$.status)),D(g),O=0,h=0};Promise.resolve(E).then(M.clear,M.clear),E&&typeof E.then=="function"?E.then(P).catch(()=>X(g)):P(E)},z=()=>{try{if(R||Date.now()<h)return;let g=0;for(;f.length>0&&g<i&&!(Date.now()<h);){let E=f.shift();a.delete(E.id),!s.has(E.id)&&(g++,G(E))}}catch(g){}},j=qe(p,n);for(let g of j)a.has(g.id)||(a.add(g.id),f.push(g));j.length>0&&Be(j,n,p);let W=setInterval(z,t),L=()=>{document.visibilityState==="hidden"&&z()},ee=()=>z();return document.addEventListener("visibilitychange",L),window.addEventListener("pagehide",ee),{send(g){if(R){s.has(g.id)||o([g],n,p);return}if(!(s.has(g.id)||a.has(g.id))){if(Date.now()<h){o([g],n,p),a.add(g.id),f.push(g);return}G(g)}},flush:z,destroy(g){g!=null&&g.forget&&(d=!0),clearInterval(W),document.removeEventListener("visibilitychange",L),window.removeEventListener("pagehide",ee),z(),R=!0}}}function Ye(e){if(typeof window=="undefined"||!e)return!1;Xe(e);let t=!1,n=we(e);try{if(new RegExp(`(?:^|; )${n}=`).test(document.cookie)){let S=location.protocol==="https:"?"; Secure":"";document.cookie=`${n}=; max-age=0; SameSite=lax; path=/${S}`,t=!0}}catch(S){}let i=ge(e),p=[n,"_snt_graph_edges",fe+e,Le(e),Me(e),`_snt_graph_nodes${i}`],d=[`_snt_asgn${i}_`];for(let S of["localStorage","sessionStorage"])try{let o=window[S];for(let f of p)o.getItem(f)!==null&&(o.removeItem(f),t=!0);for(let f=o.length-1;f>=0;f--){let a=o.key(f);a&&d.some(s=>a.startsWith(s))&&(o.removeItem(a),t=!0)}}catch(o){}try{(new RegExp(`(?:^|; )${be}=[^;]`).test(document.cookie)||localStorage.getItem(be)!==null||sessionStorage.getItem(be)!==null)&&localStorage.setItem(`${be}_tomb${i}`,"1")}catch(S){}return t}function Ze(){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)})}var rn="_snt_uid",Hn=365,Re="_snt_uid";function zn(){return Ze()}function vt(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function kt(){try{return location.protocol==="https:"?"; Secure":""}catch(e){return""}}function Qn(e,t,n){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=lax; path=/${kt()}`}catch(i){}}function et(e){try{return localStorage.getItem(e)}catch(t){return null}}function sn(e,t){try{return localStorage.setItem(e,t),!0}catch(n){return!1}}function bt(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function Xn(e,t){try{return sessionStorage.setItem(e,t),!0}catch(n){return!1}}function qn(e){try{sessionStorage.removeItem(e)}catch(t){}}function Jn(e){try{return document.cookie=`${e}_probe=1; max-age=1; SameSite=lax; path=/${kt()}`,document.cookie.indexOf(`${e}_probe=1`)!==-1}catch(t){return!1}}function Yn(e){try{localStorage.removeItem(e)}catch(t){}}function Zn(e){try{document.cookie=`${e}=; max-age=0; SameSite=lax; path=/${kt()}`}catch(t){}}var eo={getSessionId:()=>null,isEphemeral:()=>!1,destroy:()=>{}};function tt(e){var R,D,X,G,z,j,W;if(typeof window=="undefined")return eo;let t=ge(e==null?void 0:e.apiKey),n=(R=e==null?void 0:e.cookieName)!=null?R:we(e==null?void 0:e.apiKey),i=`${Re}${t}`,p=`${Re}_tomb${t}`,S=((D=e==null?void 0:e.cookieTTLDays)!=null?D:Hn)*24*60*60,o=L=>L&&L.length>0?L:null,f=()=>{var L,ee;return t&&!(e!=null&&e.cookieName)&&et(p)===null?(ee=(L=o(vt(rn)))!=null?L:o(et(Re)))!=null?ee:o(bt(Re)):null},a=(W=(j=(z=(G=(X=o(vt(n)))!=null?X:o(et(i)))!=null?G:o(bt(i)))!=null?z:f())!=null?j:o(e==null?void 0:e.ssrSessionId))!=null?W:zn();Qn(n,a,S);let s=sn(i,a),l=Jn(n),h=s?!1:Xn(i,a),O=!s&&!l&&!h;return{getSessionId:()=>a,isEphemeral:()=>O,destroy:()=>{a=null,Zn(n),Yn(i),qn(i),t&&!(e!=null&&e.cookieName)&&(vt(rn)!==null||et(Re)!==null||bt(Re)!==null)&&sn(p,"1")}}}var to=1800*1e3;function nt(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function an(e=to,t){let n=new Map,i=`_snt_asgn${ge(t)}_`,p=(a,s)=>`${i}${encodeURIComponent(a)}:${encodeURIComponent(s)}`,d=a=>{let s=a.slice(i.length),l=s.indexOf(":");if(l<0)return null;try{return{componentId:decodeURIComponent(s.slice(0,l)),segment:decodeURIComponent(s.slice(l+1))}}catch(h){return null}},S=()=>{try{let a=[];for(let s=0;s<localStorage.length;s++){let l=localStorage.key(s);l!=null&&l.startsWith(i)&&a.push(l)}return a}catch(a){return[]}},o=a=>a.assignedAt+(a.ttlMs&&a.ttlMs>0?a.ttlMs:e)<Date.now();return typeof window!="undefined"&&(()=>{for(let a of S())try{let s=localStorage.getItem(a);if(!s)continue;let l=JSON.parse(s);if(o(l)){localStorage.removeItem(a);continue}let h=d(a);if(!h)continue;n.set(nt(h.componentId,h.segment),l)}catch(s){}})(),{get(a,s){let l=n.get(nt(a,s));return l?o(l)?(n.delete(nt(a,s)),null):l:null},set(a,s,l){let h=nt(a,s);n.set(h,l);try{localStorage.setItem(p(a,s),JSON.stringify(l))}catch(O){}},clear(){n.clear();for(let a of S())try{localStorage.removeItem(a)}catch(s){}}}}var Ne=["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 xt(e)!==null}function xt(e){var n;if(!e)return null;let t=e.toLowerCase();return(n=Ne.find(i=>t.includes(i.toLowerCase())))!=null?n:null}var ot={GPTBot:"training","ChatGPT-User":"user","OAI-SearchBot":"search",ClaudeBot:"training","Claude-User":"user","Claude-SearchBot":"search",PerplexityBot:"search","Perplexity-User":"user","Google-Extended":"training","Applebot-Extended":"training","Meta-ExternalAgent":"training",Bytespider:"training",CCBot:"training",Amazonbot:"other","cohere-ai":"training",Diffbot:"other"};function ln(e){if(!e)return"other";let t=Ne.find(n=>n.toLowerCase()===e.toLowerCase());return t&&ot[t]||"other"}function cn(){var t;let e={user:[],search:[],training:[],other:[]};for(let n of Ne)e[(t=ot[n])!=null?t:"other"].push(n);return e}function Ge(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 Ue(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(p){}let i=n.hostname.toLowerCase();return/(^|\.)(google|bing|duckduckgo|yahoo)\./.test(i)?"search":/(^|\.)(twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|t\.co)$/.test(i)?"social":"referral"}catch(n){return"direct"}}function $e(e){if(!e)return null;try{return new URL(e).hostname}catch(t){return null}}var wt=["gclid","gbraid","wbraid","fbclid","ttclid","msclkid","twclid","li_fat_id"];function rt(e){let t={},n={};try{let i=typeof e=="string"||e instanceof URLSearchParams?new URLSearchParams(e):Object.entries(e).flatMap(([p,d])=>{let S=Array.isArray(d)?d[0]:d;return S===void 0?[]:[[p,S]]});for(let[p,d]of i)p.startsWith("utm_")?p in t||(t[p]=d):wt.includes(p)&&(p in n||(n[p]=d))}catch(i){}return{utmParams:t,clickIds:n}}function Fe(e){let t=e.getHours();return t<6?"night":t<12?"morning":t<18?"afternoon":"evening"}function dn(e){let t=no("__segment__",e);return`${t.deviceClass}:${t.trafficSource}`}function no(e,t){var d,S,o,f,a,s,l,h;let n=(S=(d=t==null?void 0:t.userAgent)==null?void 0:d.trim())!=null?S:"",i=(f=(o=t==null?void 0:t.referer)==null?void 0:o.trim())!=null?f:"",p=(a=t==null?void 0:t.now)!=null?a:new Date;return{sessionId:e,ephemeral:!1,utmParams:(s=t==null?void 0:t.utmParams)!=null?s:{},clickIds:(l=t==null?void 0:t.clickIds)!=null?l:{},deviceClass:n?Ge(n):"desktop",trafficSource:i?Ue(i,t==null?void 0:t.appOrigin):"direct",referrerDomain:$e(i),timeOfDay:Fe(p),dayOfWeek:(h=["sun","mon","tue","wed","thu","fri","sat"][p.getDay()])!=null?h:"sun",automation:(t==null?void 0:t.webdriver)===!0||Ke(n)}}var Ce=require("@sentientui/policy");function je(e){return T(T(T({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 Ae(e){let t=je(e);return(0,Ce.slotResultFor)(t,(0,Ce.slotBaselineArm)(t))}function un(e){let t={};for(let n of e)t[n.id]=Ae(n);return t}function st(e){return typeof e=="string"?e:(0,Ce.canonicalArm)(e)}var Ot=require("@sentientui/policy");var at=require("@sentientui/policy");var lt="[sentient] No API key configured \u2014 nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY or pass localMode: true for local development.",Et="[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.",pn=!1,it=!1;function oo(){var e;try{return(e=new URLSearchParams(window.location.search).get("sentient_persona"))!=null?e:void 0}catch(t){return}}function gn(e){var a;let t=tt({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),n=(a=t.getSessionId())!=null?a:"local",i=oo(),p=import("@sentientui/core/local").then(s=>{let l=s;return l.LOCAL_ENGINE_AVAILABLE?(pn||(pn=!0,console.info(Et)),l):(it||(it=!0,console.error(lt)),null)}).catch(()=>(it||(it=!0,console.error(lt)),null)),d=null,S={low:.15,medium:.5,high:.85},o=(()=>{var l;if(e.initialPersona)return T({},e.initialPersona);let s=Ee(e.apiKey||"local");return s?{persona:s.persona,confidence:(l=S[s.band])!=null?l:.15}:null})();function f(s){let l=document.documentElement;l.dataset.sentientPersona===void 0&&(l.dataset.sentientPersona=s.persona,l.dataset.sentientConfidence=(0,at.confidenceBand)(s.confidence))}return{isLocal:!0,async decide(s){var O,R,D;let l=await p;if(!l)return null;let h=l.createLocalEngine({sessionId:n,forcedPersona:i}).decide(s);return d=ve(T({},h),{layoutOrder:(R=(O=h.layoutOrder)!=null?O:d==null?void 0:d.layoutOrder)!=null?R:null,slots:T(T({},(D=d==null?void 0:d.slots)!=null?D:{}),h.slots)}),_e(e.apiKey||"local",{v:1,persona:d.persona,band:(0,at.confidenceBand)(d.confidence),slots:d.slots,layoutOrder:d.layoutOrder,savedAt:Date.now()}),f(h),h},getSlotResult(s){var l,h,O;return(O=(h=d==null?void 0:d.slots[s])!=null?h:(l=e.initialSlots)==null?void 0:l[s])!=null?O:null},getSlotConfig(s){var l,h;return(h=(l=e.initialSlotConfig)==null?void 0:l[s])!=null?h:null},getSitePalette(){var s;return(s=e.initialPalette)!=null?s:null},reportSlots(){},getPersona(){let s=d!=null?d:o;return s?{persona:s.persona,confidence:s.confidence,band:(0,at.confidenceBand)(s.confidence)}:null},async assign(s,l){var R;let h=await p;return!h||!l||l.length===0?l!=null&&l[0]?{variantId:l[0],assignmentTtlMs:0}:null:{variantId:(R=h.createLocalEngine({sessionId:n,forcedPersona:i}).decide({components:[{id:s,variantIds:l}]}).assignments[s])!=null?R:l[0],assignmentTtlMs:0}},track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>t.destroy()}}var It=/^(\*|\/[^\s?#*]*(\/\*)?)$/;function _t(e){let t=e.split(/[?#]/)[0]||"/";return t.length>1?t.replace(/\/+$/,"")||"/":t}function fn(e,t){if(e===void 0||!It.test(e))return!1;if(e==="*")return!0;let n=_t(t);if(e.endsWith("/*")){let i=_t(e.slice(0,-2));return n.startsWith(i==="/"?"/":`${i}/`)&&n!==i}return n===_t(e)}var ro=["none","sm","md","lg"],so=["start","center","end","stretch"],io=["start","center","end","between"],ao=["sm","md","lg"],lo=["normal","medium","bold"],co=["default","muted","accent"],uo=["primary","secondary","ghost"],po=["left","center","right"],go=["auto","square","landscape","wide"],fo=["cover","contain"],mo=[2,3,4],yo=[1,2,3,4],So=["default","raised"],ho=["none","sm","md","lg"],vo=["measure"],bo=["input","textarea","select"],ko=["text","email","number","tel"],xo=5,wo=8,Eo=64,_o=5,Io=12,Ro=4,Co=500;function mn(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(mn):!1}var br=40,kr=120,xr=300;var Rt="sentient-reveal",Te="sentient-revealed",Ct=240,ct=!1;function yn(){var e;ct=!1,typeof document!="undefined"&&((e=document.getElementById(Rt))==null||e.remove())}function Ao(e){if(ct||e.getElementById(Rt)){ct=!0;return}let t=ze(e.createElement("style"),e);t.id=Rt,t.textContent=`@media (prefers-reduced-motion: no-preference){@keyframes ${Te}{from{opacity:.55;transform:translateY(2px)}to{opacity:1;transform:none}}.${Te}{animation:${Te} ${Ct}ms cubic-bezier(.2,.6,.2,1) both}}`,e.head.appendChild(t),ct=!0}function Sn(e,t={}){var p;let n=(p=t.doc)!=null?p:typeof document!="undefined"?document:void 0;if(!n||!(e instanceof Element)||(t.arm!==void 0&&e.setAttribute("data-sentient-arm",t.arm),t.persona!==void 0&&e.setAttribute("data-sentient-persona",t.persona),t.previous!==void 0&&t.previous===e.textContent))return!1;Ao(n),e.classList.remove(Te),e.offsetWidth,e.classList.add(Te);let i=()=>{e.classList.remove(Te),e.removeEventListener("animationend",i)};return e.addEventListener("animationend",i),!0}function hn(e,t,n,i){let p=[];{let o=!1,f=[],a=()=>{if(o)return;let s=Date.now();for(f.push(s);f.length>0&&s-f[0]>500;)f.shift();f.length>=3&&(o=!0,e("rage_click"))};t.addEventListener("click",a),p.push(()=>t.removeEventListener("click",a))}{let d=!1,S=o=>{if(d||!(o.target instanceof Node)||!t.contains(o.target)&&t!==o.target)return;d=!0;let f=typeof window!="undefined"?window.getSelection():null,a=f?f.toString().length:0;e("text_copy",{selectionLength:a})};document.addEventListener("copy",S),p.push(()=>document.removeEventListener("copy",S))}{let d=!1,S=!1,o=null,f=()=>{o!==null&&(clearTimeout(o),o=null)},a=()=>{d||!S||(f(),o=setTimeout(()=>{!d&&S&&(d=!0,e("scroll_hesitation"))},3e3))},s=()=>{f(),a()},l=O=>{for(let R of O)S=R.intersectionRatio>.3,S?a():f()},h=new IntersectionObserver(l,{threshold:[.3]});h.observe(t),window.addEventListener("scroll",s,{passive:!0}),p.push(()=>{h.disconnect(),window.removeEventListener("scroll",s),f()})}if((i==null?void 0:i.tabLoss)!==!1){let d=!1,S=n!=null?n:Date.now(),o=()=>{if(d||document.visibilityState!=="hidden")return;let f=Date.now()-S;f<15e3&&(d=!0,e("tab_loss",{timeOnPage:f}))};document.addEventListener("visibilitychange",o),p.push(()=>document.removeEventListener("visibilitychange",o))}return()=>{for(let d of p)d()}}function To(){var e;return typeof process=="undefined"||((e=process.env)==null?void 0:e.NODE_ENV)!=="production"}var kn="https://api.sentient-ui.com/v1/events",J=new Map,xn=null;function Oo(e,t){let n=J.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 Do=3;function At(){return Ze()}function dt(){var e;if(typeof window!="undefined")return((e=window.location)==null?void 0:e.pathname)||void 0}function Bo(){let e=new WeakMap,t=new Map,n=!1,i=(o,f,a)=>{let s=o.get(f);return a===null?s?!0:(o.set(f,new Set),!1):s?s.has(a)?!0:(s.add(a),!1):(o.set(f,new Set([a])),!1)},p=typeof window!="undefined"&&"event"in window,d=()=>{if(!p)return;let o=window.event;return typeof Event=="function"&&o instanceof Event?o:void 0},S=()=>{if(p){Promise.resolve().then(()=>{n=!1,t.clear()});return}let o=!1,f=()=>{o||(o=!0,n=!1,t.clear())};if(setTimeout(f,0),typeof MessageChannel=="function"){let a=new MessageChannel;a.port1.onmessage=()=>{a.port1.close(),a.port2.close(),f()},a.port2.postMessage(0)}};return{firedBefore(o,f){let a=d();if(a){let l=e.get(a);return l||(l=new Map,e.set(a,l)),i(l,o,f)}let s=i(t,o,f);return!s&&!n&&(n=!0,S()),s}}}var wn=new Set;function Lo(e,t,n){let i=typeof window=="undefined"?null:window.history;if(!i)return()=>{};let p=!1,d,S=()=>{if(p)return;let a=dt();!a||a===d||(d=a,e.track({projectId:t,componentId:"__page__",eventType:"pageview",payload:{}}),n(`${t}:${a}`))},o=[];for(let a of["pushState","replaceState"]){let s=i[a],l=function(...h){let O=s.apply(this,h);return S(),O};i[a]=l,o.push([a,s,l])}window.addEventListener("popstate",S);let f=dt();return f&&wn.has(`${t}:${f}`)?d=f:S(),()=>{if(!p){p=!0,window.removeEventListener("popstate",S);for(let[a,s,l]of o)i[a]===l&&(i[a]=s)}}}var We={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}),flush:()=>{},dispose:()=>{},destroy:()=>{}};function Mo(){try{return rt(window.location.search)}catch(e){return{utmParams:{},clickIds:{}}}}function En(e){return e.replace(/\/events\/?$/,"")}function Bt(){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 No(e){var f;if(typeof window=="undefined")return;let t=e!=null?e:xn;if(!t){console.warn("[sentient] grantConsent() called before init()");return}let n=J.get(t);if(!n){console.warn("[sentient] grantConsent() called before init()");return}let{config:i,upgrade:p,reinit:d}=n;if(!p){n.upgradeBlockedReason&&console.warn(n.upgradeBlockedReason);return}if(i.respectDoNotTrack!==!1&&Bt())return;let S=(d!=null?d:_n)(ve(T({},i),{consent:!0}));p(S);let o=(f=J.get(t))==null?void 0:f.dispose;J.set(t,{config:ve(T({},i),{consent:!0}),upgrade:null,dispose:o})}function Ko(e,t){var ee;let n=e.preConsentBehavior==="statistical_winner",i=En((ee=e.ingestUrl)!=null?ee:kn),p={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},d=new Map,S=new Map,o={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),assign(u,m,w){if(!n)return Promise.resolve(null);let g=d.get(u);return g?Promise.resolve(g):Dt(S,u,async()=>{try{let E=new URLSearchParams({componentId:u});for(let q of m!=null?m:[])E.append("variantIds[]",q);let M=de(5e3),P;try{let q=await fetch(`${i}/winner?${E.toString()}`,{headers:p,signal:M.signal});if(!q.ok)return m!=null&&m[0]?{variantId:m[0],assignmentTtlMs:0}:null;P=await q.json()}finally{M.clear()}let $={variantId:P.variantId,assignmentTtlMs:0};return d.set(u,$),$}catch(E){return m!=null&&m[0]?{variantId:m[0],assignmentTtlMs:0}:null}})},decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>{}},f=!1,a=new Set,s=[],l=[],h=[],O=()=>{for(let[,,u]of h.splice(0))u(null);R.length=0},R=[],D=!1,X=()=>{if(f)return;D=!0;let u=J.get(e.apiKey);(u==null?void 0:u.upgrade)===L&&J.set(e.apiKey,{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): client released before consent; call init() again"})},G=[],z=()=>{setTimeout(()=>{var u;try{(u=G.shift())==null||u(o)}catch(m){}G.length&&z()})},j=u=>{f?G.length?G.push(u):u(o):!t&&!D&&R.length<100?R.push(u):D&&e.debug&&console.warn("[sentient] goal dropped: client released")},W={get gated(){return!f&&!t},get released(){return D&&!f},takeHeld:()=>R.splice(0),track:u=>o.track(u),goal:((u,m,w,g)=>j(E=>E.goal(u,m,w,g))),componentGoal:(u,m,w)=>o.componentGoal(u,m,w),identify:u=>o.identify(u),getAssignment:(u,m)=>o.getAssignment(u,m),assign:(u,m,w,g)=>o.assign(u,m,w,g),decide:u=>f?o.decide(u):D||t?Promise.resolve(null):new Promise(m=>h.push([u,Pt(),m])),getSlotResult:u=>o.getSlotResult(u),isSlotDecided:u=>{var m,w;return(w=(m=o.isSlotDecided)==null?void 0:m.call(o,u))!=null?w:!0},getSlotConfig:u=>o.getSlotConfig(u),getSitePalette:()=>o.getSitePalette(),getStyleVocabulary:()=>{var u,m;return(m=(u=o.getStyleVocabulary)==null?void 0:u.call(o))!=null?m:null},reportSlots:(u,m,w,g)=>o.reportSlots(u,m,w,g),reportSkeleton:(u,m)=>{var w;return(w=o.reportSkeleton)==null?void 0:w.call(o,u,m)},reportDrift:(u,m,w,g)=>{var E;return(E=o.reportDrift)==null?void 0:E.call(o,u,m,w,g)},requestSlots:(u,m,w)=>{var g;return f?(g=o.requestSlots)==null?void 0:g.call(o,u,m,w):s.push([u,m,w])},decideSlots:u=>{var m;return f?(m=o.decideSlots)==null?void 0:m.call(o,u):l.push(...u)},cancelSlots:u=>{var w;if(f)return(w=o.cancelSlots)==null?void 0:w.call(o,u);let m=new Set(u);for(let g of s)g[0]=g[0].filter(E=>!m.has(E));l=l.filter(g=>!m.has(g.id))},onSlotsChanged:u=>(a.add(u),()=>{a.delete(u)}),getPersona:()=>o.getPersona(),fetchWeights:()=>o.fetchWeights(),getGraph:()=>o.getGraph(),flush:()=>o.flush(),dispose:()=>(X(),O(),o.dispose()),destroy:()=>(X(),O(),f?o.destroy():Ye(e.apiKey))};function L(u){var w,g,E;o=u,f=!0,R.length&&(G.push(...R.splice(0)),z());let m=Pt();for(let[M,P,$]of h.splice(0))P!==m?$(null):u.decide(M).then($,()=>$(null));(w=u.onSlotsChanged)==null||w.call(u,()=>a.forEach(M=>M()));for(let[M,P,$]of s.splice(0))M.length>0&&((g=u.requestSlots)==null||g.call(u,M,P,$));l.length>0&&((E=u.decideSlots)==null||E.call(u,l.splice(0)))}return{proxy:W,setInner:L}}function Pt(){return typeof location=="undefined"?"":location.pathname+(/^#!?\//.test(location.hash)?location.hash:"")}function Dt(e,t,n){let i=e.get(t);if(i)return i;let p=(async()=>{try{return await n()}finally{e.delete(t)}})();return e.set(t,p),p}function _n(e){var Gt,Ut,$t,Ft,jt,Wt,Vt,Ht,zt,Qt;if(typeof window=="undefined")return We;e.nonce&&He(e.nonce),xn=e.apiKey||"local";let t=J.get(e.apiKey||"local");if(t!=null&&t.dispose)try{t.dispose()}catch(r){}let n=e.respectDoNotTrack!==!1&&Bt(),i=e.consent===!1||n,p=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_");if(e.localMode===!0||!p&&e.localMode!==!1)return J.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."}),i?We:gn(e);if(i){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."),J.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."}),We;let{proxy:r,setInner:c}=Ko(e,n);return J.set(e.apiKey,{config:e,upgrade:n?null:c}),r}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."),We;if(e.ingestUrl==="")return console.warn("[sentient] init() called with an empty ingestUrl. SDK disabled."),We;let d=(Gt=e.ingestUrl)!=null?Gt:kn,S=Date.now(),o=tt({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),f=an(void 0,e.apiKey),a=!1,s=ie(e.apiKey),l=()=>!a&&ie(e.apiKey)===s,h=ve(T({},f),{set:(...r)=>{l()&&f.set(...r)}}),O=nn({ingestUrl:d,apiKey:e.apiKey}),R=En(d),D={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},X=new Set,G=on({url:`${R}/goals`,apiKey:e.apiKey,headers:D,onDrop:(r,c)=>{if(!e.debug){if(X.has(c))return;X.add(c)}console.warn(`[sentient] goal dropped (HTTP ${c}) \u2014 this will not be retried. `+(c===400?"The session was not found: call init() and let the session upsert complete before firing goals.":c===401||c===403?"Check the API key and that this origin is on the project allowlist.":"See the response status for the cause."),r)}}),z=Ge((Ut=navigator.userAgent)!=null?Ut:""),j=window.location.origin,W=Ue(($t=document.referrer)!=null?$t:"",j),L=(Ft=e.sessionSegment)!=null?Ft:`${z}:${W}`,ee=new Map,u=new Map,m=new Map,w=new Set,g=new Map,E=null,M=null,P=null,$=new Set,q=new Set,ue=new Map,b=new Map,B=new Set,pe=new Set,ke=new Set,te=null,ye=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/,Oe=new Set,ae=new Set,Se=new Set,re=new Map,ut=null,Ve=new Set,Pe=new Map,pt=null,In=2,Lt=new Map,se=!1,Mt=(r,c,v)=>{var y;let _=new Set,C=1;for(let k of r){c.delete(k);let x=((y=Lt.get(k))!=null?y:0)+1;Lt.set(k,x),x<=In&&(_.add(k),x>C&&(C=x))}_.size>0&&setTimeout(()=>{se||v(_)},me(C))},gt=r=>{for(let c of r)m.has(c.id)||m.set(c.id,Ae(c))};if(e.initialSlots)for(let[r,c]of Object.entries(e.initialSlots))m.set(r,c),w.add(r);if(e.initialSlotConfig)for(let[r,c]of Object.entries(e.initialSlotConfig))g.set(r,c);e.initialPalette&&(E=e.initialPalette),e.initialVocabulary&&(M=e.initialVocabulary);let le=Ee(e.apiKey);if(le){for(let[r,c]of Object.entries(le.slots))m.has(r)||m.set(r,c);for(let[r,c]of Object.entries((jt=le.slotConfig)!=null?jt:{}))g.has(r)||g.set(r,c);!E&&le.palette&&(E=le.palette),!M&&le.vocabulary&&(M=le.vocabulary)}let Nt={low:.15,medium:.5,high:.85};if(e.initialPersona)P=T({},e.initialPersona);else{let r=document.documentElement.dataset;r.sentientPersona?P={persona:r.sentientPersona,confidence:(Vt=Nt[(Wt=r.sentientConfidence)!=null?Wt:"low"])!=null?Vt:.15}:le&&(P={persona:le.persona,confidence:(Ht=Nt[le.band])!=null?Ht:.15})}if(e.initialAssignments)for(let[r,c]of Object.entries(e.initialAssignments))h.set(r,L,{variantId:c,assignedAt:Date.now(),segment:L,confidence:1});let he=Promise.resolve(),Kt=o.getSessionId();if(Kt){let r=$e((zt=document.referrer)!=null?zt:""),{utmParams:c,clickIds:v}=Mo(),_=T(T(T(T({sessionId:Kt,deviceClass:z,trafficSource:W,referrerDomain:r,utmParams:c,clickIds:v,timeOfDay:Fe(new Date),dayOfWeek:["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()],ephemeral:o.isEphemeral(),automation:typeof navigator!="undefined"&&navigator.webdriver===!0||Ke((Qt=navigator.userAgent)!=null?Qt:"")},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}:{}),C=async()=>{for(let y=0;;y++){if(se||!l())return;let k=de(5e3);try{let x=await fetch(`${R}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(_),headers:D,signal:k.signal});if(x.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(x.ok||Ie(x)==="dropped")return}catch(x){}finally{k.clear()}if(y>=Do){console.warn("[SentientUI] Could not register the session after retries. Conversions in this visit may not be recorded.");return}await new Promise(x=>setTimeout(x,me(y+1)))}};try{he=C()}catch(y){}}e.debug&&(console.log("[sentient] initialized",{context:e.context}),window.__sentient={client:null,queue:O});let Rn=Bo(),xe=null,ft=!1,U={goal(r,c={},v=1,_=0){var H,F,Y,oe,Z,Q,I;let C=o.getSessionId();if(!C||se||!l())return;let y=Po(c)?c:{metadata:c},k=[r,(H=y.externalId)!=null?H:"",(F=y.stepIndex)!=null?F:_,(Y=y.weight)!=null?Y:v].join("\0"),x=y.value!==void 0?`${y.value}\0${(oe=y.currency)!=null?oe:""}`:null;if(Rn.firedBefore(k,x)){e.debug&&console.log(`[sentient] goal("${r}") already recorded for this action \u2014 not sent twice`);return}let N=At(),A={sessionId:C,name:r,metadata:(Z=y.metadata)!=null?Z:{},weight:(Q=y.weight)!=null?Q:v,stepIndex:(I=y.stepIndex)!=null?I:_,goalId:N,value:y.value,currency:y.currency,externalId:y.externalId};e.debug&&console.log("[sentient] goal",A);let V={id:N,body:JSON.stringify(A)};he.then(()=>G.send(V))},componentGoal(r,c,v){var N,A,V;let _=o.getSessionId();if(!_||se||!l())return;let C=h.get(r,L),y=C?null:(N=m.get(r))!=null?N:null;if(!C&&y===null){e.debug&&console.warn(`[sentient] componentGoal("${r}"): no assignment or slot decision yet \u2014 render its <Adaptive>/adaptive hook or call assign()/decide() before recording a goal.`);return}if(!C&&!w.has(r)){e.debug&&console.warn(`[sentient] componentGoal("${r}"): slot not decided this session \u2014 not attributed`);return}let k=C?C.variantId:st(y),x={id:At(),sessionId:_,projectId:e.apiKey,componentId:r,variantId:k,eventType:"goal_achieved",goalType:c,payload:T({reward:(A=v==null?void 0:v.reward)!=null?A:1,goalValue:v==null?void 0:v.value,currency:v==null?void 0:v.currency},(V=v==null?void 0:v.metadata)!=null?V:{}),timestamp:Date.now(),timeInSession:Date.now()-S,path:dt()};e.debug&&console.log("[sentient] componentGoal",x),he.then(()=>{!se&&l()&&O.push(x)})},identify(r){let c=o.getSessionId();!c||se||!l()||he.then(()=>{fetch(`${R}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify({sessionId:c,userId:r,ephemeral:o.isEphemeral()}),headers:D}).catch(()=>{})})},track(r){let c=o.getSessionId();if(!c||se||!l()||r.eventType==="variant_assigned"&&m.get(r.componentId)!==void 0&&!w.has(r.componentId)&&!h.get(r.componentId,L))return;let v=ve(T({path:dt()},r),{id:At(),sessionId:c,timestamp:Date.now(),timeInSession:Date.now()-S});e.debug&&console.log("[sentient] track",v),he.then(()=>O.push(v))},getAssignment(r,c){return h.get(r,c)},async assign(r,c,v,_){let C=o.getSessionId();if(!C)return null;let y=h.get(r,L);if(y&&(c!=null&&c.length||y.content!==void 0)){let k=y.ttlMs&&y.ttlMs>0?Math.max(0,y.assignedAt+y.ttlMs-Date.now()):0;return{variantId:y.variantId,assignmentTtlMs:k,content:y.content}}return Dt(ee,r,async()=>{if(!await mt(he,2500)||se||!l())return null;let k=de(3e4);try{let x={sessionId:C,componentId:r,variantIds:c};_!==void 0?x.agentDataByVariant=_:v!==void 0&&(x.agentData=v);let N=await fetch(`${R}/assign`,{method:"POST",body:JSON.stringify(x),headers:D,signal:k.signal});if(!N.ok)return null;let A=await N.json();return h.set(r,L,T({variantId:A.variantId,assignedAt:Date.now(),segment:L,confidence:1,content:A.content},A.assignmentTtlMs&&A.assignmentTtlMs>0?{ttlMs:A.assignmentTtlMs}:{})),A}catch(x){return null}finally{k.clear()}})},async decide(r){var y,k;let c=o.getSessionId();if(!c)return null;let v=(y=r.slots)!=null?y:[],_={sessionId:c};r.sections&&r.sections.length>0&&(_.sections=r.sections.map(x=>({id:x}))),_.components=(k=r.components)!=null?k:[],v.length>0&&(_.slots=v.map(je)),r.slotsFrom==="registry"&&(_.slotsFrom="registry",r.registrySlotIds&&(_.registrySlotIds=r.registrySlotIds),r.bootstrap===!1&&(_.bootstrap=!1),r.render&&Object.keys(r.render).length>0&&(_.render=r.render)),r.v&&(_.v=r.v),typeof r.pp=="number"&&(_.pp=r.pp),e.persona&&(_.persona=e.persona);let C=JSON.stringify(_);return Dt(u,C,async()=>{var N,A,V,H,F,Y,oe,Z;if(!await mt(he,2500)||se||!l())return gt(v),null;let x=de(3e4);try{let Q=await fetch(`${R}/decide`,{method:"POST",body:C,headers:D,signal:x.signal});if(!Q.ok)return gt(v),null;let I=await Q.json(),ne={};for(let K of v){let ce=(N=I.slots)==null?void 0:N[K.id];if(ce!==void 0){ne[K.id]=ce,m.set(K.id,ce),w.add(K.id);continue}let Xt=m.get(K.id);if(Xt!==void 0)ne[K.id]=Xt;else{let qt=Ae(K);ne[K.id]=qt,m.set(K.id,qt)}}if(I.slots)for(let[K,ce]of Object.entries(I.slots))K in ne||(ne[K]=ce,m.set(K,ce),w.add(K));let Cn=P!=null&&P.persona!=="unknown";I.persona&&!(I.persona==="unknown"&&Cn)?P={persona:I.persona,confidence:(A=I.confidence)!=null?A:0}:P||(P={persona:"unknown",confidence:0});for(let[K,ce]of Object.entries((V=I.assignments)!=null?V:{}))h.set(K,L,{variantId:ce,assignedAt:Date.now(),segment:L,confidence:1});if(I.slotConfig)for(let[K,ce]of Object.entries(I.slotConfig))g.set(K,ce);I.palette&&(E=I.palette),I.vocabulary&&(M=I.vocabulary);for(let K of(H=r.registrySlotIds)!=null?H:[])(F=I.slotConfig)!=null&&F[K]||(g.delete(K),m.delete(K),w.delete(K));return l()&&_e(e.apiKey,T(T(T({v:1,persona:P.persona,band:(0,Ot.confidenceBand)(P.confidence),slots:Object.fromEntries(m),layoutOrder:(Y=I.layoutOrder)!=null?Y:null,savedAt:Date.now()},g.size>0?{slotConfig:Object.fromEntries(g)}:{}),E?{palette:E}:{}),M?{vocabulary:M}:{})),T(T(T(T(T({layoutOrder:(oe=I.layoutOrder)!=null?oe:null,assignments:(Z=I.assignments)!=null?Z:{},slots:ne,persona:P.persona,confidence:P.confidence},I.slotConfig?{slotConfig:I.slotConfig}:{}),I.goals?{goals:I.goals}:{}),I.sectionMap?{sectionMap:I.sectionMap}:{}),I.palette?{palette:I.palette}:{}),I.vocabulary?{vocabulary:I.vocabulary}:{})}catch(Q){return gt(v),null}finally{x.clear()}})},getSlotResult(r){var c;return(c=m.get(r))!=null?c:null},isSlotDecided(r){return w.has(r)},getSlotConfig(r){var c;return(c=g.get(r))!=null?c:null},reportSlots(r,c,v,_){var y;let C={};for(let[k,x]of Object.entries(_!=null?_:{}))for(let N of x){let A=`${k}|${N.key}`;!ye.test(k)||ke.has(A)||(ke.add(A),((y=C[k])!=null?y:C[k]=[]).push(N))}Object.keys(C).length>0&&fetch(`${R}/slots/observed`,{method:"POST",headers:D,body:JSON.stringify({slotIds:Object.keys(C),authoredArms:C})}).catch(()=>{});for(let k of r)if(!(typeof k!="string"||k.length===0)){if(!ye.test(k)){To()&&!Oe.has(k)&&(Oe.add(k),console.warn(`[sentient] reportSlots: slot id ${JSON.stringify(k)} 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(!$.has(k)){$.add(k),q.add(k);let x=c==null?void 0:c[k];if(typeof x=="string"){let A=x.replace(/\s+/g," ").trim().slice(0,400);A!==""&&ue.set(k,A)}let N=v==null?void 0:v[k];N!==void 0&&b.set(k,N)}}q.size===0||te!=null||(te=setTimeout(()=>{te=null;let k=[...q];q.clear();for(let x=0;x<k.length;x+=20){let N=k.slice(x,x+20),A={},V={};for(let H of N){let F=ue.get(H);F!==void 0&&(A[H]=F,ue.delete(H));let Y=b.get(H);Y!==void 0&&(V[H]=Y,b.delete(H))}fetch(`${R}/slots/observed`,{method:"POST",headers:D,body:JSON.stringify(T(ve(T(T({slotIds:N},Object.keys(A).length>0?{baselineTexts:A}:{}),Object.keys(V).length>0?{baselineSkeletons:V}:{}),{pagePaths:Object.fromEntries(N.map(H=>[H,location.pathname]))}),Object.keys(A).length>0&&o.getSessionId()?{sessionId:o.getSessionId()}:{}))}).catch(()=>{})}},1e3))},reportSkeleton(r,c){!ye.test(r)||B.has(r)||(B.add(r),fetch(`${R}/slots/observed`,{method:"POST",headers:D,body:JSON.stringify({slotIds:[r],baselineSkeletons:{[r]:c}})}).catch(()=>{}))},reportDrift(r,c,v,_){let C=`${r}|${c}`,y=o.getSessionId();!y||pe.has(C)||(pe.add(C),fetch(`${R}/slots/drift`,{method:"POST",headers:D,body:JSON.stringify({sessionId:y,reports:[{slotId:r,expectedFp:c,observedFp:v,reason:_}]})}).catch(()=>{}))},requestSlots(r,c,v){var _,C;for(let y of r)Se.has(y)||(Se.add(y),ye.test(y)?re.set(y,{text:c==null?void 0:c[y],render:(_=v==null?void 0:v.render)==null?void 0:_[y],skeleton:(C=v==null?void 0:v.skeletons)==null?void 0:C[y]}):U.reportSlots([y]));re.size===0||ut!=null||(ut=setTimeout(()=>{ut=null;let y=[...re];re.clear();for(let k=0;k<y.length;k+=50){let x=y.slice(k,k+50),N={};for(let[A,V]of x)V.render&&(N[A]=V.render);U.decide({slotsFrom:"registry",registrySlotIds:x.map(([A])=>A),bootstrap:!1,render:N}).then(A=>{var V,H;if(A){let F={},Y={},oe=[];for(let[Z,Q]of x){let I=(V=A.slotConfig)==null?void 0:V[Z];if(I){I.needsSkeleton&&Q.skeleton&&((H=U.reportSkeleton)==null||H.call(U,Z,Q.skeleton));continue}oe.push(Z),Q.text&&(F[Z]=Q.text),Q.skeleton&&(Y[Z]=Q.skeleton)}oe.length>0&&U.reportSlots(oe,F,Y)}else Mt(x.map(([F])=>F),Se,F=>{var Q;let Y={},oe={},Z={};for(let[I,ne]of x)F.has(I)&&(ne.text&&(Y[I]=ne.text),ne.render&&(oe[I]=ne.render),ne.skeleton&&(Z[I]=ne.skeleton));(Q=U.requestSlots)==null||Q.call(U,[...F],Y,{render:oe,skeletons:Z})});ae.forEach(F=>F())})}},0))},decideSlots(r){for(let c of r)Ve.has(c.id)||(Ve.add(c.id),Pe.set(c.id,c));Pe.size===0||pt!=null||(pt=setTimeout(()=>{pt=null;let c=[...Pe.values()];Pe.clear();for(let v=0;v<c.length;v+=30){let _=c.slice(v,v+30);U.decide({slots:_}).then(C=>{C||Mt(_.map(y=>y.id),Ve,y=>{var k;return(k=U.decideSlots)==null?void 0:k.call(U,_.filter(x=>y.has(x.id)))}),ae.forEach(y=>y())})}},0))},cancelSlots(r){for(let c of r)re.delete(c)&&Se.delete(c),Pe.delete(c)&&Ve.delete(c)},onSlotsChanged(r){return ae.add(r),()=>{ae.delete(r)}},getStyleVocabulary(){return M},getSitePalette(){return E},getPersona(){return P?{persona:P.persona,confidence:P.confidence,band:(0,Ot.confidenceBand)(P.confidence)}:null},async fetchWeights(){var c;let r=de(5e3);try{let v=await fetch(`${R}/weights`,{headers:D,signal:r.signal});return v.ok?(c=(await v.json()).components)!=null?c:[]:[]}catch(v){return[]}finally{r.clear()}},getGraph(){return{pageNodes:[],capturedAt:0}},flush(){O.flush(),G.flush()},dispose(){var r;xe==null||xe(),ft=!0,se=!0,O.destroy(),G.destroy(),((r=J.get(e.apiKey))==null?void 0:r.dispose)===U.dispose&&J.delete(e.apiKey),e.debug&&console.log("[sentient] disposed")},destroy(){var r;xe==null||xe(),ft=!0,se=!0,a=!0,Xe(e.apiKey),O.destroy({forget:!0}),G.destroy({forget:!0}),o.destroy(),h.clear(),((r=J.get(e.apiKey))==null?void 0:r.dispose)===U.dispose&&J.delete(e.apiKey);try{localStorage.removeItem(fe+e.apiKey),localStorage.removeItem(Le(e.apiKey)),localStorage.removeItem(Me(e.apiKey)),localStorage.removeItem(`_snt_graph_nodes${ge(e.apiKey)}`),localStorage.removeItem("_snt_graph_edges")}catch(c){}e.debug&&console.log("[sentient] destroyed")}};if(J.set(e.apiKey,{config:e,upgrade:null,dispose:U.dispose}),xe=Lo(U,e.apiKey,r=>{he.then(()=>{ft||wn.add(r)})}),e.debug){let r=window;r.__sentient&&(r.__sentient.client=U)}return U}0&&(module.exports={AGENT_INTENTS,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,CLICK_ID_KEYS,FORM_FIELD_KINDS,FORM_INPUT_TYPES,LEGACY_SESSION_COOKIE_NAME,LOCAL_MODE_BANNER,MAX_BLOCK_ARMS,MAX_BLOCK_CHILDREN,MAX_BLOCK_DEPTH,MAX_BLOCK_NODES,MAX_BLOCK_TEXT_LEN,MAX_FORM_FIELDS,MAX_FORM_SELECT_OPTIONS,MAX_SKELETON_LEAVES,MAX_SKELETON_NODES,MAX_SKELETON_TEXT,PAGE_SCOPE_RE,PROD_KEYLESS_ERROR,REVEAL_MS,SNAPSHOT_STORAGE_KEY_PREFIX,_registerConsentUpgradeInit,agentIntent,agentUaList,applyNonce,armOfResult,attachMicroSignalDetectors,baselineResultFor,baselineSlots,classifiedAgents,containsFormBlock,cspNonce,deriveSessionSegment,detectDeviceClass,detectTimeOfDay,detectTrafficSource,extractTrackedParams,forgetGeneration,forgetVisitor,grantConsent,init,isDoNotTrackEnabled,matchedAgentToken,pageScopeMatches,readSnapshot,referrerDomainFromReferer,renderPrePaintScript,resetRevealStyles,reveal,routeKey,sessionCookieName,setCspNonce,toWireSlot,uaTokenMatch,writeSnapshot});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|