@sentientui/react 0.33.0 → 0.34.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 +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/next/adaptive-root.d.ts +15 -1
- package/dist/next/adaptive-root.js +2 -2
- package/dist/next/adaptive-root.js.map +1 -1
- package/dist/testing/msw.d.cts +1 -1
- package/dist/testing/msw.d.ts +1 -1
- package/dist/testing/msw.js.map +1 -1
- package/dist/testing/msw.mjs.map +1 -1
- package/dist/testing/node.d.cts +1 -1
- package/dist/testing/node.d.ts +1 -1
- package/dist/testing/node.js.map +1 -1
- package/dist/testing/node.mjs.map +1 -1
- package/dist/testing/react.d.cts +1 -1
- package/dist/testing/react.d.ts +1 -1
- package/dist/testing/react.js +1 -1
- package/dist/testing/react.js.map +1 -1
- package/dist/testing/react.mjs +1 -1
- package/dist/testing/react.mjs.map +1 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -220,6 +220,7 @@ Imported from `@sentientui/react/next`.
|
|
|
220
220
|
|------|------|-------------|
|
|
221
221
|
| `components` | `Array<{ id: string; variantIds: string[] }>` *(optional, default `[]`)* | Code-variant components to preload server-side. `id` must match `<Adaptive id="…" variants={…}>`; generated-version `<Adaptive>` regions need no entry. Omit when the tree uses only slots/sections or assigns client-side. |
|
|
222
222
|
| `sections` | `string[]` *(optional)* | Page section IDs in default order. When provided, a single `POST /v1/decide` returns both layout order and assignments; `useLayoutOrder()` becomes available. Give each section's element `data-sentient-id="<sectionId>"` — the only attribute a section needs — so the graph scanner can register it; without it the server types the section `generic` and every persona gets the same order. The provider warns about unresolvable ids in development. |
|
|
223
|
+
| `registrySlotIds` | `string[]` *(optional)* | The generated-mode `<Adaptive id>`s this page renders. Decides their published versions in the same SSR round trip and serializes the served content into the HTML, so first paint shows the version instead of the original children. Scoped to exactly these ids — an unscoped registry decide would record a trial for every published slot on every page. Omit and the regions decide client-side after mount. |
|
|
223
224
|
| `sectionTypes` | `Partial<Record<string, SemanticType>>` *(optional)* | What each section is, keyed by `data-sentient-id`: `{ about: 'trust', contact: 'cta' }`. Sections are classified from their content, so declare only the ones it gets wrong — a band with little signal-bearing copy (an "About us" block, a contact form) reads `generic` and is ordered the same for every persona. Any section with a `data-sentient-id` can appear, reorderable or not. Also accepted by `AdaptiveProvider`. |
|
|
224
225
|
| `apiKey` | `string` | `pk_…` key — used by both the browser SDK and server-side SSR requests. |
|
|
225
226
|
| `appOrigin` | `string` *(default `http://localhost:3001`)* | Your app origin (e.g. `https://yourapp.com`). Must be on the project's allowed-origins list. Always set in production. |
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";var gn=Object.create;var le=Object.defineProperty,mn=Object.defineProperties,pn=Object.getOwnPropertyDescriptor,vn=Object.getOwnPropertyDescriptors,yn=Object.getOwnPropertyNames,de=Object.getOwnPropertySymbols,Sn=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable;var ze=(e,t,n)=>t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,S=(e,t)=>{for(var n in t||(t={}))Oe.call(t,n)&&ze(e,n,t[n]);if(de)for(var n of de(t))qe.call(t,n)&&ze(e,n,t[n]);return e},W=(e,t)=>mn(e,vn(t));var Ze=(e,t)=>{var n={};for(var r in e)Oe.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&de)for(var r of de(e))t.indexOf(r)<0&&qe.call(e,r)&&(n[r]=e[r]);return n};var hn=(e,t)=>{for(var n in t)le(e,n,{get:t[n],enumerable:!0})},Ye=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of yn(t))!Oe.call(e,i)&&i!==n&&le(e,i,{get:()=>t[i],enumerable:!(r=pn(t,i))||r.enumerable});return e};var Qe=(e,t,n)=>(n=e!=null?gn(Sn(e)):{},Ye(t||!e||!e.__esModule?le(n,"default",{value:e,enumerable:!0}):n,e)),bn=e=>Ye(le({},"__esModule",{value:!0}),e);var Mn={};hn(Mn,{Adaptive:()=>Vt,AdaptiveGroup:()=>nn,AdaptiveProvider:()=>bt,AdaptiveSlot:()=>Ce,AdaptiveText:()=>Nt,SentientPersonaScript:()=>Xt,buildAgentFeed:()=>an,defineAgentContent:()=>sn,detectSegment:()=>Ke.deriveSessionSegment,getAgentContent:()=>We,grantConsent:()=>un.grantConsent,renderAgentJsonLd:()=>ln,renderAgentJsonLdBody:()=>Ue,renderAgentMarkdown:()=>cn,renderBlocks:()=>oe,useAdaptive:()=>tn,useAdaptiveApiBaseUrl:()=>kt,useAdaptiveGoal:()=>Re,useAdaptivePersona:()=>qt,useAdaptiveTokens:()=>Qt,useAssignment:()=>be,useInitialAssignments:()=>pe,useLayoutOrder:()=>Ct,usePageGoal:()=>Kt,useSentient:()=>E});module.exports=bn(Mn);var w=require("react"),me=require("@sentientui/core");var et=new Map,fe=new Map;function tt(e,t){let n=fe.get(e);return n||(n=new Set,fe.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&fe.delete(e)}}function nt(e,t){et.set(e,t);let n=fe.get(e);if(n)for(let r of n)try{r(t)}catch(i){}}function Ee(e){var t;return(t=et.get(e))!=null?t:null}var xn={on:!1,listeners:new Set};function rt(){if(typeof window=="undefined")return xn;let e=window;return e.__sentient_preview||(e.__sentient_preview={on:!1,listeners:new Set}),e.__sentient_preview}function Pe(){return rt().on}function it(e){let t=rt().listeners;return t.add(e),()=>{t.delete(e)}}function ot(e){return{isLocal:e.isLocal,track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},fetchWeights:()=>Promise.resolve([]),getAssignment:(t,n)=>e.getAssignment(t,n),assign:(t,n,r,i)=>e.assign(t,n,r,i),decide:()=>Promise.resolve(null),getSlotResult:t=>e.getSlotResult(t),getSlotConfig:t=>e.getSlotConfig(t),getSitePalette:()=>e.getSitePalette(),reportSlots:t=>e.reportSlots(t),getPersona:()=>e.getPersona(),getGraph:()=>e.getGraph(),dispose:()=>e.dispose(),destroy:()=>e.destroy()}}var Te="sentient:overrides-changed";function st(){var e;return typeof window=="undefined"?0:(e=window.__sentient_overrides_version)!=null?e:0}function at(){var t;if(typeof window=="undefined")return;let e=window;e.__sentient_overrides_version=((t=e.__sentient_overrides_version)!=null?t:0)+1,window.dispatchEvent(new Event(Te))}function $(e){return typeof window=="undefined"?()=>{}:(window.addEventListener(Te,e),()=>window.removeEventListener(Te,e))}function lt(e){typeof window!="undefined"&&(window.__sentient_devtools_config=e)}function O(){var e;return typeof process=="undefined"||((e=process.env)==null?void 0:e.NODE_ENV)!=="production"}function V(e){return typeof e=="string"?{type:"click"}:e}function q(e){return typeof e=="string"?e:e.type}function X(e){if(typeof e!="string"&&(e.type==="click"||e.type==="form_submit"||e.type==="scroll_depth"))return e.value}var De=new Set,Le=!1;function ct(e){if(De.has(e))return!0;if(De.add(e),!Le){Le=!0;let t=()=>{Le=!1,De.clear()};if(typeof MessageChannel=="function"){let n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),n.port2.close(),t()},n.port2.postMessage(0)}else setTimeout(t,0)}return!1}function wn(e){if(!(e instanceof Element))return!1;let t=e.tagName.toLowerCase();return t==="a"||t==="button"?!0:e.getAttribute("role")==="button"}function ut(e,t,n){if(n){try{let i=e;for(;i&&i!==t;){if(i.matches(n))return!0;i=i.parentElement}}catch(i){}return!1}let r=e;for(;r&&r!==t;){if(wn(r))return!0;r=r.parentElement}return!1}function H(e,t,n,r){if(t.type==="weighted_composite"){let o=new Set,d=[];return t.steps.forEach(({goal:u,name:g,weight:b},h)=>{let v=(p=!1)=>{o.has(h)||p&&r!==void 0&&ct(`step\0${g}\0${b}\0${h}`)||(o.add(h),n.fireStep(g,b,h))};if(u.type==="click"){let p=a=>{let l=a.target;l instanceof Element&&ut(l,e,u.selector)&&v()};e.addEventListener("click",p),d.push(()=>e.removeEventListener("click",p));return}if(u.type==="form_submit"){let p=a=>{a.target instanceof HTMLFormElement&&e.contains(a.target)&&v()};e.addEventListener("submit",p),d.push(()=>e.removeEventListener("submit",p));return}if(u.type==="scroll_depth"){let p=Math.max(0,Math.min(1,u.threshold)),a=new IntersectionObserver(l=>{for(let y of l)if(y.intersectionRatio>=p){v(!0),a.disconnect();break}},{threshold:[p]});a.observe(e),d.push(()=>a.disconnect())}}),()=>{for(let u of d)u()}}let i=t.type==="composite"?t.all:[t],f=new Set(i.map((o,d)=>d)),c=()=>{r!==void 0&&ct(r)||n.fireGoal()},s=(o,d=!1)=>{f.delete(o),f.size===0&&(d?c():n.fireGoal())},m=[];return i.forEach((o,d)=>{if(o.type==="click"){let u=g=>{let b=g.target;b instanceof Element&&ut(b,e,o.selector)&&(t.type==="composite"?s(d):n.fireGoal())};e.addEventListener("click",u),m.push(()=>e.removeEventListener("click",u));return}if(o.type==="form_submit"){let u=g=>{g.target instanceof HTMLFormElement&&e.contains(g.target)&&(t.type==="composite"?s(d):n.fireGoal())};e.addEventListener("submit",u),m.push(()=>e.removeEventListener("submit",u));return}if(o.type==="scroll_depth"){let u=Math.max(0,Math.min(1,o.threshold)),g=new IntersectionObserver(b=>{for(let h of b)if(h.intersectionRatio>=u){t.type==="composite"?s(d,!0):c(),g.disconnect();break}},{threshold:[u]});g.observe(e),m.push(()=>g.disconnect());return}}),()=>{for(let o of m)o()}}var dt=new Set,ft=new Set;function ne(e,t,n,r,i){let f=`${r}|${n}`;if(ft.has(f))return;ft.add(f);let c=i.type==="weighted_composite"&&!dt.has(r);c&&dt.add(r),e.track({projectId:t,componentId:n,eventType:"funnel_declared",payload:c?{funnelId:r,steps:i.steps.map(s=>({goalId:s.name,weight:s.weight}))}:{funnelId:r}})}function Z(e,t,n,r){e.track({projectId:t,componentId:n,variantId:r,eventType:"variant_assigned",payload:{}})}var Cn={components:new Map,slots:new Map,sections:[],listeners:new Set,version:0};function Q(){if(typeof window=="undefined")return Cn;let e=window;return e.__sentient_registry||(e.__sentient_registry={components:new Map,slots:new Map,sections:[],listeners:new Set,version:0}),e.__sentient_registry}function ce(){Q().version+=1;for(let e of Q().listeners)e()}var gt=()=>{};function mt(e){return O()?(Q().components.set(e.id,e),ce(),()=>{Q().components.delete(e.id),ce()}):gt}function re(e){return O()?(Q().slots.set(e.id,e),ce(),()=>{Q().slots.delete(e.id),ce()}):gt}function Ie(e){O()&&(Q().sections=[...e],ce())}var pt="0.33.0",Fe=pt!=="0.0.0-dev"?{name:"react",version:pt}:void 0;function An(){let e=window;return e.__sentient_slot_config_overrides||(e.__sentient_slot_config_overrides={}),e.__sentient_slot_config_overrides}function Be(e,t){An()[e]=t}function _n(){let e=window;return e.__sentient_slot_overrides||(e.__sentient_slot_overrides={}),e.__sentient_slot_overrides}function Me(e,t){_n()[e]=t}var vt="sentient_editor",yt="sentient_preview_cell",Ve="sentient-cell-preview-bar",$e="__preview__";function St(e){if(typeof window=="undefined"||typeof document=="undefined"||document.getElementById(Ve))return;let t,n;try{let s=new URLSearchParams(window.location.search);t=s.get(vt),n=s.get(yt)}catch(s){return}if(!t||!n)return;let r=n.lastIndexOf("~");if(r<=0)return;let i=n.slice(0,r),f=n.slice(r+1),c=(e!=null?e:"https://api.sentient-ui.com/v1").replace(/\/$/,"");fetch(`${c}/editor/cell-preview?slotId=${encodeURIComponent(i)}&persona=${encodeURIComponent(f)}`,{headers:{authorization:`Bearer ${t}`}}).then(async s=>{if(!s.ok){ge(s.status===401?"This preview link has expired \u2014 reopen it from your dashboard.":"Couldn\u2019t load this preview \u2014 reopen it from your dashboard.");return}let m=await s.json();if(m.blocks!=null)Be(i,{kind:"arms",blocks:{[$e]:m.blocks}}),Me(i,$e);else if(m.content!=null)Be(i,{kind:"arms",content:m.content}),Me(i,$e);else{ge("Nothing to preview in that square yet.");return}at(),ge(`Previewing \u201C${m.slotName}\u201D for ${m.personaDisplay}${m.status==="review"?" \u2014 waiting for your approval":""}. Nothing is being tracked.`),setTimeout(()=>{var o;try{(o=document.querySelector(`[data-sentient-slot="${i}"]`))==null||o.scrollIntoView({block:"center"})}catch(d){}},300)}).catch(()=>ge("Couldn\u2019t load this preview \u2014 check your connection and reopen it from your dashboard."))}function ge(e){var i;if(document.getElementById(Ve))return;let t=document.createElement("div");t.id=Ve,Object.assign(t.style,{position:"fixed",bottom:"16px",left:"50%",transform:"translateX(-50%)",zIndex:"2147483647",display:"flex",alignItems:"center",gap:"10px",padding:"10px 14px",borderRadius:"12px",maxWidth:"90vw",background:"#111827",color:"#fff",font:"13px system-ui, sans-serif",border:"1px solid rgba(139,92,246,0.6)",boxShadow:"0 10px 34px rgba(0,0,0,0.45)"});let n=document.createElement("span");n.textContent=e;let r=document.createElement("button");r.textContent="Exit preview",Object.assign(r.style,{padding:"4px 10px",borderRadius:"999px",border:"1px solid rgba(255,255,255,0.35)",background:"transparent",color:"#fff",font:"12px system-ui, sans-serif",cursor:"pointer"}),r.onclick=()=>{let f=new URL(window.location.href);f.searchParams.delete(vt),f.searchParams.delete(yt),window.location.assign(f.toString())},t.append(n,r),((i=document.body)!=null?i:document.documentElement).append(t)}var Gt=require("react/jsx-runtime");function Rn(){var e,t;if(typeof window=="undefined")return"desktop:direct";try{return(0,me.deriveSessionSegment)({userAgent:(e=navigator.userAgent)!=null?e:"",referer:(t=document.referrer)!=null?t:"",appOrigin:window.location.origin})}catch(n){return"desktop:direct"}}var ht="https://api.sentient-ui.com/v1",M=(0,w.createContext)({client:null,apiKey:"",initialAssignments:{},sessionSegment:"desktop:direct",ssrFallback:"first",onAssignment:void 0,initialLayoutOrder:null,initialSlots:{},initialSlotConfig:{},initialPalette:null,initialPersona:null,apiBaseUrl:ht,debug:!1});function kn(e){let[t,n]=(0,w.useState)(!1),r=(0,w.useRef)(e);r.current=e;let{cookie:i,value:f,event:c}=e!=null?e:{},s=typeof(e==null?void 0:e.check)=="function";return(0,w.useEffect)(()=>{let m=()=>{var g;let d=r.current;if(!d)return!1;if(d.check)return d.check()===!0;if(!d.cookie||typeof document=="undefined")return!1;let u=`${d.cookie}=${(g=d.value)!=null?g:"accepted"}`;return document.cookie.split("; ").some(b=>b.trim()===u)};if(n(m()),!c)return;let o=()=>{n(m())};return window.addEventListener(c,o),()=>window.removeEventListener(c,o)},[i,f,c,s]),t}function bt(e){var h,v;let[t,n]=(0,w.useState)(null),[r]=(0,w.useState)(()=>{var p;return(p=e.sessionSegment)!=null?p:Rn()}),[i,f]=(0,w.useState)(Pe());(0,w.useEffect)(()=>it(()=>f(Pe())),[]),(0,w.useEffect)(()=>{St(e.apiBaseUrl)},[]);let c=kn(e.consentFrom),s=e.consentFrom?e.consent===!0||c:e.consent,m=(0,w.useRef)(null);(0,w.useEffect)(()=>{var C;if(s===!1&&!e.preConsentBehavior){(C=m.current)==null||C.destroy(),m.current=null,n(null);return}let p=S({apiKey:e.apiKey,context:e.context,debug:e.debug,initialAssignments:e.initialAssignments,sessionSegment:r,consent:s,preConsentBehavior:e.preConsentBehavior,respectDoNotTrack:e.respectDoNotTrack,ssrSessionId:e.ssrSessionId,country:e.country,persona:e.persona,localMode:e.localMode,initialSlots:e.initialSlots,initialSlotConfig:e.initialSlotConfig,initialPalette:e.initialPalette,initialPersona:e.initialPersona,ingestUrl:e.apiBaseUrl?`${e.apiBaseUrl.replace(/\/$/,"")}/events`:void 0},Fe?{sdk:Fe}:{}),a=!1,l=null,y=null,x=G=>{e.engagement!==!1&&import("@sentientui/core/engagement").then(({startEngagementCapture:A})=>{a||(y=A(G,{apiKey:e.apiKey,sectionTypes:e.sectionTypes,apiBase:e.apiBaseUrl?e.apiBaseUrl.replace(/\/$/,""):void 0}))})};return e.enableGraph!==!1?import("@sentientui/core/graph").then(({init:G})=>{a||(l=G(W(S({},p),{graph:!0,captureDomText:e.captureDomText===!0,sectionTypes:e.sectionTypes})),m.current=l,n(l),x(l))}):(l=(0,me.init)(p),m.current=l,n(l),x(l)),()=>{a=!0,y==null||y(),l==null||l.dispose()}},[s]),(0,w.useEffect)(()=>{if(!t)return;let p=!1,a=async()=>{if(p)return;let y;try{y=await t.fetchWeights()}catch(x){return}if(!p)for(let x of y){let C={componentId:x.componentId,updatedAt:x.updatedAt,variants:x.variants.map(G=>{var A;return{variantId:G.variantId,pulls:G.pulls,avgReward:(A=G.avgReward)!=null?A:0}})};nt(x.componentId,C)}};a();let l=setInterval(()=>{a()},6e4);return()=>{p=!0,clearInterval(l)}},[t]);let o=(h=e.ssrFallback)!=null?h:"first",d=((v=e.apiBaseUrl)!=null?v:ht).replace(/\/$/,""),u=(0,w.useRef)(null);(0,w.useEffect)(()=>{var l;if(typeof process!="undefined"&&((l=process.env)==null?void 0:l.NODE_ENV)==="production")return;let p={apiKey:e.apiKey,context:e.context,country:e.country,persona:e.persona,apiBaseUrl:d},a=u.current;if(u.current=p,a!==null)for(let y of["apiKey","context","country","persona","apiBaseUrl"])Object.is(a[y],p[y])||console.warn(`[sentient] AdaptiveProvider: \`${y}\` changed after initialisation, but the SDK client is stable for the session and only re-inits on \`consent\` \u2014 the new value is ignored. Remount the provider (e.g. via a changing \`key\` prop) to apply it.`)},[e.apiKey,e.context,e.country,e.persona,d]),(0,w.useEffect)(()=>{var p;typeof process!="undefined"&&((p=process.env)==null?void 0:p.NODE_ENV)==="production"||lt({apiKey:e.apiKey,apiBaseUrl:d,isLocal:(t==null?void 0:t.isLocal)===!0})},[t,e.apiKey,d]),(0,w.useEffect)(()=>{let p=e.initialLayoutOrder;if(p&&p.length>0){Ie(p);return}e.declaredSections&&e.declaredSections.length>0&&Ie(e.declaredSections)},[e.initialLayoutOrder,e.declaredSections]),(0,w.useEffect)(()=>{if(!O())return;let p=e.declaredSections;if(!p||p.length===0||typeof document=="undefined")return;let a=new Set(Array.from(document.querySelectorAll("[data-sentient-id]"),y=>y.getAttribute("data-sentient-id"))),l=p.filter(y=>!a.has(y));l.length>0&&console.warn(`[SentientUI] Declared section${l.length>1?"s":""} ${l.map(y=>`"${y}"`).join(", ")} ${l.length>1?"have":"has"} no matching data-sentient-id element, so the layout engine cannot learn what they are and will serve the same order to every persona. Add data-sentient-id="<sectionId>" to each section's element.`)},[e.declaredSections]);let g=(0,w.useMemo)(()=>t&&i?ot(t):t,[t,i]),b=(0,w.useMemo)(()=>{var p,a,l,y,x,C,G;return{client:g,apiKey:e.apiKey,initialAssignments:(p=e.initialAssignments)!=null?p:{},sessionSegment:r,ssrFallback:o,onAssignment:e.onAssignment,initialLayoutOrder:(a=e.initialLayoutOrder)!=null?a:null,initialSlots:(l=e.initialSlots)!=null?l:{},initialSlotConfig:(y=e.initialSlotConfig)!=null?y:{},initialPalette:(x=e.initialPalette)!=null?x:null,initialPersona:(C=e.initialPersona)!=null?C:null,apiBaseUrl:d,debug:(G=e.debug)!=null?G:!1}},[g,e.apiKey,e.initialAssignments,r,o,e.onAssignment,e.initialLayoutOrder,e.initialSlots,e.initialSlotConfig,e.initialPalette,e.initialPersona,d,e.debug]);return(0,Gt.jsx)(M.Provider,{value:b,children:e.children})}function E(){return(0,w.useContext)(M).client}function z(){return(0,w.useContext)(M).apiKey}function pe(){return(0,w.useContext)(M).initialAssignments}function ve(){return(0,w.useContext)(M).sessionSegment}function xt(){return(0,w.useContext)(M).ssrFallback}function ye(){return(0,w.useContext)(M).onAssignment}function wt(){return(0,w.useContext)(M).debug}function Ct(){let e=(0,w.useContext)(M).initialLayoutOrder,t=(0,w.useSyncExternalStore)($,()=>{var n;return typeof window=="undefined"?null:(n=window.__sentient_layout_override)!=null?n:null},()=>null);return t!=null?t:e}function Se(){return(0,w.useContext)(M).initialSlots}function At(){return(0,w.useContext)(M).initialPersona}function _t(){return(0,w.useContext)(M).initialSlotConfig}function Rt(){return(0,w.useContext)(M).initialPalette}function kt(){return(0,w.useContext)(M).apiBaseUrl}var se=require("react");var D=require("react"),Ot=require("@sentientui/core");var N=require("react"),he=require("@sentientui/policy");function ie(e){var n;if(typeof window=="undefined")return null;let t=(n=window.__sentient_overrides)==null?void 0:n[e];if(t)return t;if(!window.location.search)return null;try{let r=new URLSearchParams(window.location.search);for(let i of r.getAll("sentient_variant")){let f=i.indexOf(":");if(f!==-1&&i.slice(0,f)===e)return i.slice(f+1)}}catch(r){}return null}function be(e,t,n,r){let i=pe(),f=xt(),c=E(),s=ve(),m=ye(),o=wt(),d=(0,N.useRef)(null),u=(0,N.useSyncExternalStore)($,()=>ie(e),()=>null),g=u&&t.includes(u)?u:null,b=(0,N.useRef)(null);(0,N.useEffect)(()=>{o&&g&&b.current!==g&&(b.current=g,console.info(`[sentient] override active: ${e} -> ${g}`))},[o,g,e]);let[h,v]=(0,N.useState)(()=>{var y,x;if(g)return{variantId:g,content:null,isLoading:!1,settled:!0};if(!c){let C=i[e];return C&&t.includes(C)?{variantId:C,content:null,isLoading:!1,settled:!0}:f==="first"&&t.length>0?{variantId:t[0],content:null,isLoading:!1,settled:!1}:{variantId:null,content:null,isLoading:!0,settled:!1}}let a=c.getAssignment(e,s);if(a&&(t.includes(a.variantId)||a.content))return{variantId:a.variantId,content:(y=a.content)!=null?y:null,isLoading:!1,settled:!0};let l=Ee(e);if(l){let C=(0,he.pickFromWeights)(l.variants,t);if(C)return{variantId:C,content:null,isLoading:!1,settled:!0}}return{variantId:(x=t[0])!=null?x:null,content:null,isLoading:!1,settled:!1}}),p=a=>{m&&d.current!==a&&(d.current=a,m(e,a))};return(0,N.useEffect)(()=>{var y;if(g||!c)return;let a=c.getAssignment(e,s);if(a&&(t.includes(a.variantId)||a.content)){v({variantId:a.variantId,content:(y=a.content)!=null?y:null,isLoading:!1,settled:!0}),p(a.variantId);return}let l=Ee(e);if(l&&h.settled&&h.variantId&&h.variantId===(0,he.pickFromWeights)(l.variants,t)){p(h.variantId);return}v(x=>{var C;return x.variantId?x:{variantId:(C=t[0])!=null?C:null,content:null,isLoading:!1,settled:!1}})},[g,c,e,s]),(0,N.useEffect)(()=>{if(g||!c)return;let a=c.getAssignment(e,s);if(a&&t.includes(a.variantId))return;let l=!1;return c.assign(e,t,n,r).then(y=>{var x;l||y&&(!t.includes(y.variantId)&&!y.content||(v({variantId:y.variantId,content:(x=y.content)!=null?x:null,isLoading:!1,settled:!0}),p(y.variantId)))}),()=>{l=!0}},[g,c,e,s]),(0,N.useEffect)(()=>{if(!g&&c)return tt(e,a=>{var x;let l=c.getAssignment(e,s);if(l&&(t.includes(l.variantId)||l.content)){v({variantId:l.variantId,content:(x=l.content)!=null?x:null,isLoading:!1,settled:!0}),p(l.variantId);return}let y=(0,he.pickFromWeights)(a.variants,t);y&&(v({variantId:y,content:null,isLoading:!1,settled:!0}),p(y))})},[g,c,e,s]),g?{variantId:g,content:null,isLoading:!1,settled:!0,isOverride:!0}:h}function xe(e,t,n){let r=E(),i=z(),f=Object.keys(t).join("\0"),c=(0,D.useMemo)(()=>Object.keys(t),[f]),{variantId:s,content:m,isOverride:o=!1,settled:d}=be(e,c,n.agentData,n.agentDataByVariant),[u,g]=(0,D.useState)(null),b=(0,D.useRef)(null),h=(0,D.useCallback)(R=>{b.current=R,g(R)},[]),v=n.goal,p=typeof v=="string"?v:JSON.stringify(v),a=(0,D.useMemo)(()=>v?V(v):null,[p]),l=v?q(v):"";(0,D.useEffect)(()=>mt({id:e,variantIds:c,goal:l}),[e,c,l]);let y=(0,D.useRef)(null);(0,D.useEffect)(()=>{o||d&&(!r||!s||!i||!u||y.current!==s&&(y.current=s,Z(r,i,e,s)))},[r,s,i,e,u,o,d]);let x=(0,D.useRef)(!1),C=(0,D.useRef)(new Set);(0,D.useEffect)(()=>{x.current=!1,C.current=new Set},[s,a]);let G=n.funnel;(0,D.useEffect)(()=>{o||!d||!r||!G||!a||ne(r,i,e,G,a)},[r,i,e,G,a,o,d]);let A=n.cursorSignal===!0;(0,D.useEffect)(()=>{if(!A||o||!d||!r||!s||!u)return;let R=null,T=0,I=()=>{T=Date.now(),R=setTimeout(()=>{r.track({projectId:i,componentId:e,variantId:s,eventType:"cursor_signal",payload:{hoverDuration:Date.now()-T}}),R=null},800)},L=()=>{R!==null&&(clearTimeout(R),R=null)};return u.addEventListener("mouseenter",I),u.addEventListener("mouseleave",L),()=>{u.removeEventListener("mouseenter",I),u.removeEventListener("mouseleave",L),R!==null&&clearTimeout(R)}},[A,r,s,i,e,u,o,d]);let _=(0,D.useRef)(n.microSignalGoals);_.current=n.microSignalGoals;let k=n.microSignalGoals?JSON.stringify(n.microSignalGoals):"";return(0,D.useEffect)(()=>{if(o||!d||!r||!s||!u)return;let R=Date.now();return(0,Ot.attachMicroSignalDetectors)((T,I={})=>{var Je,Xe,He;r.track({projectId:i,componentId:e,variantId:s,eventType:"micro_signal",payload:S({signalType:T},I)});let L=(Je=_.current)==null?void 0:Je[T];if(!L||C.current.has(T))return;C.current.add(T);let te=typeof L=="string"?L:L.name,dn=typeof L=="string"?1:(Xe=L.weight)!=null?Xe:1,fn=typeof L=="string"?0:(He=L.stepIndex)!=null?He:0;r.goal(te,{metadata:S({signalType:T},I),weight:dn,stepIndex:fn})},u,R)},[r,s,i,e,u,k,o,d]),(0,D.useEffect)(()=>{if(o||!d||!r||!s||!u||!a)return;let R=X(a);return H(u,a,{fireGoal:()=>{x.current||(x.current=!0,r.track({projectId:i,componentId:e,variantId:s,eventType:"goal_achieved",goalType:l,payload:S({reward:1},R!==void 0?{goalValue:R}:{})}),r.goal(l,S({metadata:{componentId:e,variantId:s},weight:1,stepIndex:0},R!==void 0?{value:R}:{})))},fireStep:(T,I,L)=>{r.track({projectId:i,componentId:e,variantId:s,eventType:"goal_achieved",goalType:T,payload:{reward:I}}),r.goal(T,{metadata:{},weight:I,stepIndex:L})}},l)},[r,s,i,e,u,a,l,o,d]),{client:r,variantIds:c,variantId:s,content:m,settled:d,isOverride:o,goalLabel:l,ref:h,nodeRef:b}}var K=require("react"),we=require("@sentientui/core");var j=require("react"),Pt=require("@sentientui/core");var Et=new Set;function Tt(e,t){var p;let n=E(),r=(0,j.useRef)(t==null?void 0:t.baselineText);r.current=t==null?void 0:t.baselineText;let i=Se(),f=_t(),c=Rt(),s=(0,j.useSyncExternalStore)($,()=>{var a;return typeof window!="undefined"?(a=window.__sentient_slot_config_overrides)==null?void 0:a[e]:void 0},()=>{}),m=(0,j.useSyncExternalStore)($,()=>{var a;return typeof window!="undefined"?(a=window.__sentient_slot_overrides)==null?void 0:a[e]:void 0},()=>{}),o=a=>a==null?"":(0,Pt.armOfResult)(a),d=(0,j.useCallback)(a=>{var l,y;return(y=(l=n==null?void 0:n.onSlotsChanged)==null?void 0:l.call(n,a))!=null?y:(()=>{})},[n]);(0,j.useSyncExternalStore)(d,()=>{var a;return(a=n==null?void 0:n.getSlotConfig(e))!=null?a:null},()=>null),(0,j.useSyncExternalStore)(d,()=>o(n==null?void 0:n.getSlotResult(e)),()=>"");let u=s===void 0?f[e]:void 0,g=s===void 0&&u===void 0&&n?n.getSlotConfig(e):null,b=(p=c!=null?c:n==null?void 0:n.getSitePalette())!=null?p:null,h=(()=>{var a,l;if(s!==void 0)return{config:s,arm:o(m),palette:b,source:"override"};if(u!==void 0)return{config:u,arm:o((a=i[e])!=null?a:n==null?void 0:n.getSlotResult(e)),palette:b,source:"preloaded"};if(g!==null){let y=n!=null&&n.isSlotDecided?n.isSlotDecided(e):!0;return{config:g,arm:o((l=n==null?void 0:n.getSlotResult(e))!=null?l:i[e]),palette:b,source:y?"client":"seeded"}}return{config:null,arm:"",palette:b,source:"none"}})(),v=h.source==="preloaded"||h.source==="override";return(0,j.useEffect)(()=>{var y,x;if(!n||n.isLocal===!0||v)return;let a=h.source==="none"&&(x=(y=r.current)==null?void 0:y.call(r))!=null?x:null,l=a!=null&&a!==""?[[e],{[e]:a}]:[[e]];return n.requestSlots?n.requestSlots(...l):h.source==="none"&&n.reportSlots(...l),()=>{var C;return(C=n.cancelSlots)==null?void 0:C.call(n,[e])}},[n,v,h.source,e]),(0,j.useEffect)(()=>{!O()||(n==null?void 0:n.isLocal)!==!0||h.source!=="none"||Et.has(e)||(Et.add(e),console.warn(`[sentient] <Adaptive id="${e}"> is rendering its baseline children: in local/keyless mode <Adaptive> serves ONLY what you pass as \`initialSlotConfig\` (there is no registry to decide from). Pass initialSlotConfig/initialSlots to <AdaptiveProvider> to preview arms locally.`))},[n,h.source,e]),h}var je=require("react");var P=require("react/jsx-runtime"),Y={none:"0",sm:"8px",md:"16px",lg:"24px"},Ne={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",between:"space-between"},Ft={sm:"0.875em",md:"1em",lg:"1.25em"},Gn={sm:"1.25em",md:"1.5em",lg:"2em"},Dt={sm:"6px 14px",md:"10px 20px",lg:"14px 28px"},Lt={sm:"8px",md:"16px",lg:"32px"},On={square:"1 / 1",landscape:"4 / 3",wide:"16 / 9"},En={normal:"400",medium:"500",bold:"700"};function It(e,t){return S(S({},e==="muted"?t!=null&&t.muted?{color:t.muted}:{opacity:.7}:{}),e==="accent"?S({fontWeight:600},t!=null&&t.accent?{color:t.accent}:{}):{})}function Bt(e,t,n){var i,f,c,s;let r=t==null?void 0:t.accent;return W(S({display:"inline-block",padding:(i=Dt[n!=null?n:"md"])!=null?i:Dt.md,borderRadius:(f=t==null?void 0:t.radius)!=null?f:"8px",font:"inherit"},n?{fontSize:Ft[n]}:{}),{textDecoration:e==="ghost"?"underline":"none",cursor:"pointer",background:e==="primary"?(c=t==null?void 0:t.primaryBg)!=null?c:"#111827":"transparent",color:e==="primary"?(s=t==null?void 0:t.primaryText)!=null?s:"#ffffff":r!=null?r:"inherit",border:e==="secondary"?`1px solid ${r!=null?r:"currentColor"}`:"none"})}function Pn({node:e,opts:t}){var i,f,c,s,m;let n=(i=e.emphasis)!=null?i:"primary",r={padding:"8px 10px",font:"inherit",border:`1px solid ${(c=(f=t.palette)==null?void 0:f.border)!=null?c:"currentColor"}`,borderRadius:(m=(s=t.palette)==null?void 0:s.radius)!=null?m:"8px"};return(0,P.jsxs)("form",{onSubmit:o=>{var g,b,h;o.preventDefault();let d=new FormData(o.currentTarget),u={};for(let v of e.fields)u[v.name]=String((g=d.get(v.name))!=null?g:"");(b=t.onFormGoal)==null||b.call(t,e.submitGoal);try{(h=t.onFormSubmit)==null||h.call(t,u)}catch(v){}},style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.fields.map(o=>{var d,u;return(0,P.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:"4px",font:"inherit"},children:[o.label,o.kind==="textarea"?(0,P.jsx)("textarea",{name:o.name,required:o.required,placeholder:o.placeholder,rows:3,style:r}):o.kind==="select"?(0,P.jsx)("select",{name:o.name,required:o.required,style:r,children:((d=o.options)!=null?d:[]).map(g=>(0,P.jsx)("option",{value:g,children:g},g))}):(0,P.jsx)("input",{name:o.name,type:(u=o.inputType)!=null?u:"text",required:o.required,placeholder:o.placeholder,style:r})]},o.name)}),(0,P.jsx)("button",{type:"submit",style:Bt(n,t.palette),children:e.submitLabel})]})}function oe(e,t){var n,r,i,f,c,s,m,o,d,u,g,b,h,v,p,a,l,y,x,C,G,A,_;try{switch(e.type){case"stack":{let k=(r=Y[(n=e.gap)!=null?n:"md"])!=null?r:Y.md,R=e.surface==="raised",T=(i=e.pad)!=null?i:R?"md":void 0;return(0,P.jsx)("div",{style:S(S(S(S(S({display:"flex",flexDirection:e.direction,gap:k},e.align?{alignItems:Ne[e.align]}:{}),e.justify?{justifyContent:Ne[e.justify]}:{}),e.wrap?{flexWrap:"wrap"}:{}),T?{padding:(f=Y[T])!=null?f:Y.md}:{}),R?W(S(S({},(c=t.palette)!=null&&c.surface?{background:t.palette.surface}:{}),(s=t.palette)!=null&&s.surface&&((m=t.palette)!=null&&m.surfaceText)?{color:t.palette.surfaceText}:{}),{border:`1px solid ${(d=(o=t.palette)==null?void 0:o.border)!=null?d:"currentColor"}`,borderRadius:(g=(u=t.palette)==null?void 0:u.radius)!=null?g:"8px"}):{}),children:((b=e.children)!=null?b:[]).map((I,L)=>{let te=oe(I,t);return te===null?null:(0,P.jsx)(je.Fragment,{children:te},L)})})}case"grid":{let k=(v=Y[(h=e.gap)!=null?h:"md"])!=null?v:Y.md;return(0,P.jsx)("div",{style:S(S({display:"grid",gridTemplateColumns:`repeat(auto-fit, minmax(max(200px, calc((100% - ${e.columns-1} * ${k}) / ${e.columns})), 1fr))`,gap:k},e.align?{alignItems:Ne[e.align]}:{}),e.pad?{padding:(p=Y[e.pad])!=null?p:Y.md}:{}),children:((a=e.children)!=null?a:[]).map((R,T)=>{let I=oe(R,t);return I===null?null:(0,P.jsx)(je.Fragment,{children:I},T)})})}case"text":return(0,P.jsx)("p",{style:S(S(S(S(S({margin:0},e.size?{fontSize:Ft[e.size]}:{}),e.weight?{fontWeight:En[e.weight]}:{}),e.align?{textAlign:e.align}:{}),e.maxWidth==="measure"?{maxWidth:"65ch"}:{}),It(e.tone,t.palette)),children:e.value});case"heading":{let k=`h${e.level}`;return(0,P.jsx)(k,{style:S(S({margin:0,fontSize:Gn[(l=e.size)!=null?l:"md"]},e.align?{textAlign:e.align}:{}),e.maxWidth==="measure"?{maxWidth:"65ch"}:{}),children:e.value})}case"button":{let k=(y=e.emphasis)!=null?y:"primary";return(0,P.jsx)("a",W(S({href:e.href},e.tag?{"data-sentient-tag":e.tag}:{}),{style:Bt(k,t.palette,e.size),children:e.label}))}case"link":return(0,P.jsx)("a",W(S({href:e.href},e.tag?{"data-sentient-tag":e.tag}:{}),{style:{color:"inherit",textDecoration:"underline"},children:e.label}));case"image":return(0,P.jsx)("img",{src:e.src,alt:e.alt,style:S(S({display:"block",maxWidth:"100%"},e.ratio&&e.ratio!=="auto"?{aspectRatio:On[e.ratio],width:"100%"}:{}),e.fit?{objectFit:e.fit}:{})});case"badge":return(0,P.jsx)("span",{style:S({display:"inline-block",padding:"2px 10px",borderRadius:"999px",fontSize:"0.75em",border:`1px solid ${(C=(x=t.palette)==null?void 0:x.border)!=null?C:"currentColor"}`},It(e.tone,t.palette)),children:e.value});case"spacer":return(0,P.jsx)("div",{style:{height:(G=Lt[e.size])!=null?G:Lt.md}});case"divider":return(0,P.jsx)("hr",{style:{border:"none",borderTop:`1px solid ${(_=(A=t.palette)==null?void 0:A.border)!=null?_:"currentColor"}`,margin:0,width:"100%"}});case"form":return(0,P.jsx)(Pn,{node:e,opts:t});default:return null}}catch(k){return null}}var $t=require("react/jsx-runtime"),Mt=new Set;function Ce({id:e,children:t,onFormSubmit:n,goal:r,className:i,reportBaselineText:f=!0}){var A;let c=E(),s=z(),m=(0,K.useRef)(null),{config:o,arm:d,palette:u,source:g}=Tt(e,{baselineText:f?()=>{var _,k;return(k=(_=m.current)==null?void 0:_.textContent)!=null?k:null}:void 0}),b=d!==""?(A=o==null?void 0:o.blocks)==null?void 0:A[d]:void 0,h=b!==void 0&&(0,we.containsFormBlock)(b)&&!n;(0,K.useEffect)(()=>{!h||!O()||Mt.has(e)||(Mt.add(e),console.warn(`[sentient] AdaptiveSlot "${e}" was served a form arm but has no onFormSubmit handler \u2014 rendering its baseline children instead. Pass onFormSubmit to render generated forms.`))},[h,e]);let v=_=>{!c||g==="override"||(g!=="seeded"&&c.componentGoal(e,_),c.goal(_,{metadata:{componentId:e,arm:d},weight:1,stepIndex:0}))},p=t,a=!1;if(b!==void 0){let _=h?null:oe(b,{palette:u,onFormSubmit:n,onFormGoal:v});_===null?a=!0:p=_}else(o==null?void 0:o.content)!==void 0&&g!=="none"&&(p=o.content);let l=o!=null&&o.blocks?Object.keys(o.blocks).sort().join("|"):"";(0,K.useEffect)(()=>re({id:e,arms:l===""?void 0:l.split("|")}),[e,l]);let y=(0,K.useRef)(null);(0,K.useEffect)(()=>{!c||g==="none"||g==="seeded"||g==="override"||d===""||a||y.current!==d&&(y.current=d,Z(c,s,e,d))},[c,s,e,d,g,a]);let x=r===void 0?null:typeof r=="string"?r:JSON.stringify(r);(0,K.useEffect)(()=>{if(!c||!r||g==="override"||g==="none"||g==="seeded"||a)return;let _=m.current;if(!_)return;let k=q(r),R=X(r),T=!1;return H(_,V(r),{fireGoal:()=>{T||(T=!0,R!==void 0?c.componentGoal(e,k,{value:R}):c.componentGoal(e,k),c.goal(k,S({metadata:{componentId:e,arm:d},weight:1,stepIndex:0},R!==void 0?{value:R}:{})))},fireStep:(I,L,te)=>{c.componentGoal(e,I,{reward:L}),c.goal(I,{metadata:{componentId:e,arm:d},weight:L,stepIndex:te})}},k)},[c,e,x,d,g,a]);let C=(0,K.useRef)(null);(0,K.useEffect)(()=>{let _=m.current;if(_){if(C.current===null){C.current=d;return}C.current!==d&&(C.current=d,(0,we.reveal)(_))}},[d]);let G=(0,K.useMemo)(()=>S({"data-sentient-slot":e},d!==""?{"data-sentient-arm":d}:{}),[e,d]);return(0,$t.jsx)("div",W(S({ref:m,className:i},G),{children:p}))}var Ae=require("react/jsx-runtime");function Tn(e){var o;let{client:t,variantId:n,content:r,ref:i}=xe(e.id,e.variants,{goal:e.goal,funnel:e.funnel,microSignalGoals:e.microSignalGoals,agentData:e.agentData,agentDataByVariant:e.agentDataByVariant,cursorSignal:!0}),[f,c]=(0,se.useState)(!1);if((0,se.useEffect)(()=>{c(!0)},[]),e.clientOnly&&(!f||!t)||!n)return null;let s=(o=e.variants[n])!=null?o:null,m=s===null?r:null;return O()&&s===null&&m===null&&console.warn(`[sentient] <Adaptive id="${e.id}"> was assigned variant "${n}" but no matching key exists in props.variants. If this is a dashboard-managed text variant, use <AdaptiveText id="${e.id}"> instead.`),(0,Ae.jsx)("div",{ref:i,"data-sentient-id":e.id,"data-sentient-variant":n,children:s!=null?s:m})}var Dn=(0,se.memo)(Tn,(e,t)=>{if(e.id!==t.id||e.goal!==t.goal&&JSON.stringify(e.goal)!==JSON.stringify(t.goal)||e.microSignalGoals!==t.microSignalGoals||e.funnel!==t.funnel||e.clientOnly!==t.clientOnly||e.agentData!==t.agentData||e.agentDataByVariant!==t.agentDataByVariant)return!1;if(e.variants===t.variants)return!0;let n=Object.keys(e.variants),r=Object.keys(t.variants);return n.length!==r.length?!1:n.every(i=>i in t.variants&&Object.is(e.variants[i],t.variants[i]))});function Vt(e){return e.variants===void 0?(0,Ae.jsx)(Ce,S({},e)):(O()&&e.children!=null&&console.warn(`[sentient] <Adaptive id="${e.id}"> got both variants and children \u2014 rendering variants; children are ignored.`),(0,Ae.jsx)(Dn,S({},e)))}var F=require("react");var jt=require("react/jsx-runtime");function Nt({id:e,default:t,component:n="span",className:r,goal:i}){var G;let f=E(),c=z(),s=ye(),m=ve(),o=(0,F.useRef)(null),d=(0,F.useRef)(null),u=(0,F.useSyncExternalStore)($,()=>ie(e),()=>null),[g,b]=(0,F.useState)(()=>{var A,_;return(_=(A=f==null?void 0:f.getAssignment(e,m))==null?void 0:A.content)!=null?_:null}),[h,v]=(0,F.useState)(()=>{var A,_;return(_=(A=f==null?void 0:f.getAssignment(e,m))==null?void 0:A.variantId)!=null?_:null});(0,F.useEffect)(()=>{if(u||!f)return;let A=f.getAssignment(e,m);if((A==null?void 0:A.content)!==void 0){v(A.variantId),b(A.content);return}let _=!1;return f.assign(e).then(k=>{if(!_){if(!k){O()&&console.warn(`[sentient] <AdaptiveText id="${e}"> assignment failed \u2014 showing default text.`);return}v(k.variantId),k.content&&b(k.content)}}),()=>{_=!0}},[f,e,m,u]),(0,F.useEffect)(()=>{u||!f||!h||!c||o.current!==h&&(o.current=h,f.track({projectId:c,componentId:e,variantId:h,eventType:"variant_assigned",payload:{}}),s==null||s(e,h))},[f,h,c,e,s,u]);let p=i===void 0?"":typeof i=="string"?i:JSON.stringify(i),a=(0,F.useMemo)(()=>i===void 0?null:V(i),[p]),l=i===void 0?null:typeof i=="string"?i:a.type,y=(0,F.useRef)(!1);(0,F.useEffect)(()=>{y.current=!1},[h,p]),(0,F.useEffect)(()=>{if(u||!f||!h||!c||!a||!l)return;let A=d.current;if(!A)return;let _=X(a);return H(A,a,{fireGoal:()=>{y.current||(y.current=!0,f.track({projectId:c,componentId:e,variantId:h,eventType:"goal_achieved",goalType:l,payload:S({reward:1},_!==void 0?{goalValue:_}:{})}),f.goal(l,S({metadata:{componentId:e,variantId:h},weight:1,stepIndex:0},_!==void 0?{value:_}:{})))},fireStep:(k,R,T)=>{f.track({projectId:c,componentId:e,variantId:h,eventType:"goal_achieved",goalType:k,payload:{reward:R}}),f.goal(k,{metadata:{},weight:R,stepIndex:T})}})},[f,h,c,e,a,l,u]);let x=g!=null?g:t;if(u){let A=f==null?void 0:f.getAssignment(e,m);x=A&&A.variantId===u&&(G=A.content)!=null?G:t}return(0,jt.jsx)(n,{ref:A=>{d.current=A},className:r,children:x})}var _e=require("react");function Re(e){let t=E(),n=(0,_e.useRef)(new Set);return(0,_e.useCallback)((r,i)=>{var f,c;if(!ie(e)){if(i!=null&&i.once){if(n.current.has(r))return;n.current.add(r)}t==null||t.componentGoal(e,r,i),t==null||t.goal(r,S(S(S({metadata:(f=i==null?void 0:i.metadata)!=null?f:{},weight:(c=i==null?void 0:i.reward)!=null?c:1,stepIndex:0},(i==null?void 0:i.value)!==void 0?{value:i.value}:{}),(i==null?void 0:i.currency)!==void 0?{currency:i.currency}:{}),(i==null?void 0:i.externalId)!==void 0?{externalId:i.externalId}:{}))}},[t,e])}var ue=require("react");function Kt(e,t={}){let m=t,{componentId:n}=m,r=Ze(m,["componentId"]),i=E(),f=Re(n!=null?n:""),c=(0,ue.useRef)(!1),s=(0,ue.useRef)(r);s.current=r,(0,ue.useEffect)(()=>{if(!i||c.current)return;c.current=!0;let{metadata:o,reward:d,value:u,currency:g,externalId:b}=s.current;if(n){f(e,s.current);return}i.goal(e,S(S(S({metadata:o!=null?o:{},weight:d!=null?d:1,stepIndex:0},u!==void 0?{value:u}:{}),g!==void 0?{currency:g}:{}),b!==void 0?{externalId:b}:{}))},[i,n,e,f])}var Ut=require("@sentientui/core"),Jt=require("@sentientui/policy"),Ht=require("react/jsx-runtime");function Wt(e){return JSON.stringify(e).replace(/</g,"\\u003c")}function Ln(e){return e.persona?'(function(){try{var d=document.documentElement;if(d.hasAttribute("data-sentient-persona"))return;d.setAttribute("data-sentient-persona",'+Wt(e.persona.persona)+');d.setAttribute("data-sentient-confidence",'+Wt((0,Jt.confidenceBand)(e.persona.confidence))+");}catch(e){}})();":(0,Ut.renderPrePaintScript)(e.apiKey)}function Xt(e){return(0,Ht.jsx)("script",{"data-sentient-persona-script":"",nonce:e.nonce,dangerouslySetInnerHTML:{__html:Ln(e)}})}var J=require("react"),Yt=require("@sentientui/policy");var U=require("react"),ee=require("@sentientui/core"),zt=require("@sentientui/policy");function ke(e,t){let n=E(),r=Se(),[,i]=(0,U.useReducer)(u=>u+1,0),f=(0,U.useSyncExternalStore)($,()=>{var u;return typeof window!="undefined"?(u=window.__sentient_slot_overrides)==null?void 0:u[e]:void 0},()=>{}),c=f===void 0?r[e]:void 0,s=f===void 0&&c===void 0&&n?n.getSlotResult(e):null,m=(n==null?void 0:n.isLocal)===!0&&f===void 0&&c===void 0&&s===null;(0,U.useEffect)(()=>{if(!m||!n)return;let u=!1;return n.decide({slots:[t]}).then(g=>{!u&&g&&i()}),()=>{u=!0}},[n,e,m]);let o=(()=>{if(f!==void 0)return{result:f,arm:(0,ee.armOfResult)(f),source:"override"};if(c!==void 0)return{result:c,arm:(0,ee.armOfResult)(c),source:"preloaded"};if(s!==null){let g=n!=null&&n.isSlotDecided?n.isSlotDecided(e):!0;return{result:s,arm:(0,ee.armOfResult)(s),source:g?"client":"seeded"}}let u=(0,ee.baselineResultFor)(t);return{result:u,arm:(0,ee.armOfResult)(u),source:"baseline"}})(),d=o.source==="preloaded"||o.source==="override";return(0,U.useEffect)(()=>{var g;if(!n||n.isLocal===!0||d||!n.decideSlots)return;let u=(g=n.onSlotsChanged)==null?void 0:g.call(n,i);return n.decideSlots([t]),()=>{var b;(b=n.cancelSlots)==null||b.call(n,[e]),u==null||u()}},[n,e,d]),o}function In(){var t;if(typeof window=="undefined")return null;let e=window.__sentient_persona_override;if(e!=null&&e.persona)return{persona:e.persona,confidence:(t=e.confidence)!=null?t:1};try{let n=new URLSearchParams(window.location.search).get("sentient_persona");if(n)return{persona:n,confidence:1}}catch(n){}return null}function qt(){let e=E(),t=At();(0,U.useSyncExternalStore)($,st,()=>0);let[n,r]=(0,U.useState)(!1);(0,U.useEffect)(()=>r(!0),[]);let i=s=>({persona:s.persona,confidence:s.confidence,band:(0,zt.confidenceBand)(s.confidence)});if(!n)return t?i(t):null;let f=In();if(f)return i(f);if(t)return i(t);let c=e?e.getPersona():null;return c?i(c):null}var Zt=new Set;function Fn(e){return typeof CSS!="undefined"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/[\\"]/g,"\\$&")}function Qt(e,t,n){let r=E(),i=z(),f=JSON.stringify(t),c=(0,J.useMemo)(()=>({id:e,dims:t}),[e,f]),{result:s,arm:m,source:o}=ke(e,c),d=(0,J.useMemo)(()=>typeof s=="string"?{}:s,[m]);if(O()&&!Zt.has(e)){Zt.add(e);let v=(0,Yt.validateSlotDecl)({id:e,dims:Object.fromEntries(Object.entries(t).map(([a,l])=>[a,[...l]]))}),p=Object.values(t).reduce((a,l)=>a*l.length,1);v.ok?p>4&&console.warn(`[sentient] useAdaptiveTokens("${e}") declares ${p} combinations \u2014 more than the recommended 4. Each extra combination needs more traffic to learn; consider fewer dims/values.`):console.warn(`[sentient] useAdaptiveTokens("${e}"): invalid declaration \u2014 ${v.reason}. Serving baseline.`)}let u=(n==null?void 0:n.goal)===void 0?null:typeof n.goal=="string"?n.goal:JSON.stringify(n.goal);(0,J.useEffect)(()=>re({id:e,dims:t}),[e]);let g=(0,J.useRef)(null);(0,J.useEffect)(()=>{!r||o==="baseline"||o==="seeded"||o==="override"||g.current===m||(g.current=m,Z(r,i,e,m))},[r,i,e,m,o]);let b=n==null?void 0:n.funnel;(0,J.useEffect)(()=>{var v;!r||!b||o==="override"||ne(r,i,e,b,V((v=n==null?void 0:n.goal)!=null?v:"click"))},[r,i,e,b,u,o]),(0,J.useEffect)(()=>{if(!r||!(n!=null&&n.goal)||o==="override"||o==="baseline"||o==="seeded")return;let v=document.querySelector(`[data-sentient-slot="${Fn(e)}"]`);if(!v){O()&&console.warn(`[sentient] useAdaptiveTokens("${e}"): a goal is declared but no element carries the returned props \u2014 spread {...props} on the slot's element.`);return}let p=q(n.goal),a=X(n.goal),l=!1;return H(v,V(n.goal),{fireGoal:()=>{l||(l=!0,a!==void 0?r.componentGoal(e,p,{value:a}):r.componentGoal(e,p),r.goal(p,S({metadata:{componentId:e,arm:m},weight:1,stepIndex:0},a!==void 0?{value:a}:{})))},fireStep:(y,x,C)=>{r.componentGoal(e,y,{reward:x}),r.goal(y,{metadata:{componentId:e,arm:m},weight:x,stepIndex:C})}},p)},[r,e,u,m,o]);let h=(0,J.useMemo)(()=>{let v={"data-sentient-slot":e};for(let[p,a]of Object.entries(d))v[`data-${p}`]=a;return v},[e,d]);return{tokens:d,props:h}}var ae=require("react");var en=new Set;function tn(e,t){var b;if(O()&&!t.goal)throw new Error(`[sentient] useAdaptive("${e}"): a goal is required \u2014 without one the optimizer accumulates exposures with no rewards and cannot learn. Pass e.g. goal: 'buy_click'.`);let{client:n,variantIds:r,variantId:i,isOverride:f,goalLabel:c,ref:s,nodeRef:m}=xe(e,t.variants,{goal:t.goal,funnel:t.funnel,microSignalGoals:t.microSignalGoals}),o=(b=i!=null?i:r[0])!=null?b:"",d=t.variants[o];(0,ae.useEffect)(()=>{if(!O()||!n)return;let h=setTimeout(()=>{!m.current&&!en.has(e)&&(en.add(e),console.warn(`[sentient] useAdaptive("${e}"): bind was never attached \u2014 spread {...bind} on the rendered element, otherwise exposure and goal tracking cannot work and the optimizer learns nothing.`))},0);return()=>clearTimeout(h)},[n,e]);let u=(0,ae.useCallback)((h,v)=>{var a,l;if(f)return;let p=h!=null?h:c;p&&(n==null||n.componentGoal(e,p,v),n==null||n.goal(p,S(S(S({metadata:(a=v==null?void 0:v.metadata)!=null?a:{},weight:(l=v==null?void 0:v.reward)!=null?l:1,stepIndex:0},(v==null?void 0:v.value)!==void 0?{value:v.value}:{}),(v==null?void 0:v.currency)!==void 0?{currency:v.currency}:{}),(v==null?void 0:v.externalId)!==void 0?{externalId:v.externalId}:{})))},[n,e,c,f]),g=(0,ae.useMemo)(()=>({ref:s,"data-sentient-id":e,"data-sentient-variant":o}),[s,e,o]);return{variant:o,value:d,bind:g,fireGoal:u}}var B=require("react");var rn=require("react/jsx-runtime"),Ge=new Set;function nn(e){var a;let t=E(),n=z(),r=(0,B.useRef)(null),i=Object.keys(e.arrangements).join(" "),f=(0,B.useMemo)(()=>Object.keys(e.arrangements),[i]),c=(0,B.useMemo)(()=>S({id:e.id,arms:f},e.baseline!==void 0?{baseline:e.baseline}:{}),[e.id,f,e.baseline]),{arm:s,source:m}=ke(e.id,c);O()&&e.baseline!==void 0&&e.baseline!==f[0]&&!Ge.has(e.id+":baseline")&&(Ge.add(e.id+":baseline"),console.warn(`[sentient] <AdaptiveGroup id="${e.id}">: baseline "${e.baseline}" is not the first-declared arrangement ("${f[0]}"). The first arrangement should usually be the page's real incumbent (the holdout sees it).`));let o=B.Children.toArray(e.children).filter(B.isValidElement),d=new Map;for(let l of o)d.set(String((a=l.key)!=null?a:"").replace(/^\.\$/,""),l);let u=e.arrangements[s],g=u!==void 0&&u.length===o.length&&u.every(l=>d.has(l));O()&&u!==void 0&&!g&&!Ge.has(e.id+":keys")&&(Ge.add(e.id+":keys"),console.warn(`[sentient] <AdaptiveGroup id="${e.id}">: arrangement "${s}" [${u.join(", ")}] does not match the children's keys \u2014 rendering declaration order (fail-safe).`));let b=g?u.map(l=>d.get(l)):o;(0,B.useEffect)(()=>re({id:e.id,arms:Object.keys(e.arrangements)}),[e.id]);let h=(0,B.useRef)(null);(0,B.useEffect)(()=>{!t||m==="baseline"||m==="seeded"||m==="override"||h.current===s||(h.current=s,Z(t,n,e.id,s))},[t,n,e.id,s,m]);let v=e.funnel;(0,B.useEffect)(()=>{var l;!t||!v||m==="override"||ne(t,n,e.id,v,V((l=e.goal)!=null?l:"click"))},[t,n,e.id,v,m]);let p=e.goal===void 0?null:typeof e.goal=="string"?e.goal:JSON.stringify(e.goal);return(0,B.useEffect)(()=>{if(!t||e.goal===void 0||m==="override"||m==="baseline"||m==="seeded")return;let l=r.current;if(!l)return;let y=q(e.goal),x=X(e.goal),C=!1;return H(l,V(e.goal),{fireGoal:()=>{C||(C=!0,x!==void 0?t.componentGoal(e.id,y,{value:x}):t.componentGoal(e.id,y),t.goal(y,S({metadata:{componentId:e.id,arm:s},weight:1,stepIndex:0},x!==void 0?{value:x}:{})))},fireStep:(G,A,_)=>{t.componentGoal(e.id,G,{reward:A}),t.goal(G,{metadata:{componentId:e.id,arm:s},weight:A,stepIndex:_})}},y)},[t,e.id,p,s,m]),(0,rn.jsx)("div",{ref:r,"data-sentient-id":e.id,"data-sentient-variant":s,children:b})}var Ke=require("@sentientui/core");var Bn=["page","blocks","layoutOrder"],on=new Map;function sn(e,t){on.set(e,t)}function We(e){return on.get(e)}function an(e){var i,f;let t=(f=(i=e.content)!=null?i:We(e.page))!=null?f:{},n={};for(let[c,s]of Object.entries(t))Bn.includes(c)||(n[c]=s);let r=W(S({},n),{page:e.page,blocks:e.blocks});return e.layoutOrder&&(r.layoutOrder=e.layoutOrder),r}function ln(e){return`<script type="application/ld+json">${Ue(e)}</script>`}function Ue(e){return JSON.stringify(S({"@context":"https://schema.org","@type":"WebPage"},e)).replace(/</g,"\\u003c")}function cn(e){let t=[];e.title&&t.push(`# ${e.title}`,""),e.summary&&t.push(String(e.summary),"");for(let[n,r]of Object.entries(e))["page","title","summary","blocks","layoutOrder"].includes(n)||t.push(`## ${n}`,"","```json",JSON.stringify(r,null,2),"```","");if(e.blocks.length>0){t.push("## blocks","");for(let n of e.blocks)t.push(`- **${n.id}** \u2192 variant \`${n.variant}\``),n.content!==void 0&&t.push(""," ```json",JSON.stringify(n.content,null,2)," ```");t.push("")}return t.join(`
|
|
2
|
+
"use strict";var gn=Object.create;var le=Object.defineProperty,mn=Object.defineProperties,pn=Object.getOwnPropertyDescriptor,vn=Object.getOwnPropertyDescriptors,yn=Object.getOwnPropertyNames,de=Object.getOwnPropertySymbols,Sn=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable;var ze=(e,t,n)=>t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,S=(e,t)=>{for(var n in t||(t={}))Oe.call(t,n)&&ze(e,n,t[n]);if(de)for(var n of de(t))qe.call(t,n)&&ze(e,n,t[n]);return e},W=(e,t)=>mn(e,vn(t));var Ze=(e,t)=>{var n={};for(var r in e)Oe.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&de)for(var r of de(e))t.indexOf(r)<0&&qe.call(e,r)&&(n[r]=e[r]);return n};var hn=(e,t)=>{for(var n in t)le(e,n,{get:t[n],enumerable:!0})},Ye=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of yn(t))!Oe.call(e,i)&&i!==n&&le(e,i,{get:()=>t[i],enumerable:!(r=pn(t,i))||r.enumerable});return e};var Qe=(e,t,n)=>(n=e!=null?gn(Sn(e)):{},Ye(t||!e||!e.__esModule?le(n,"default",{value:e,enumerable:!0}):n,e)),bn=e=>Ye(le({},"__esModule",{value:!0}),e);var Mn={};hn(Mn,{Adaptive:()=>Vt,AdaptiveGroup:()=>nn,AdaptiveProvider:()=>bt,AdaptiveSlot:()=>Ce,AdaptiveText:()=>Nt,SentientPersonaScript:()=>Xt,buildAgentFeed:()=>an,defineAgentContent:()=>sn,detectSegment:()=>Ke.deriveSessionSegment,getAgentContent:()=>We,grantConsent:()=>un.grantConsent,renderAgentJsonLd:()=>ln,renderAgentJsonLdBody:()=>Ue,renderAgentMarkdown:()=>cn,renderBlocks:()=>oe,useAdaptive:()=>tn,useAdaptiveApiBaseUrl:()=>kt,useAdaptiveGoal:()=>Re,useAdaptivePersona:()=>qt,useAdaptiveTokens:()=>Qt,useAssignment:()=>be,useInitialAssignments:()=>pe,useLayoutOrder:()=>Ct,usePageGoal:()=>Kt,useSentient:()=>E});module.exports=bn(Mn);var w=require("react"),me=require("@sentientui/core");var et=new Map,fe=new Map;function tt(e,t){let n=fe.get(e);return n||(n=new Set,fe.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&fe.delete(e)}}function nt(e,t){et.set(e,t);let n=fe.get(e);if(n)for(let r of n)try{r(t)}catch(i){}}function Ee(e){var t;return(t=et.get(e))!=null?t:null}var xn={on:!1,listeners:new Set};function rt(){if(typeof window=="undefined")return xn;let e=window;return e.__sentient_preview||(e.__sentient_preview={on:!1,listeners:new Set}),e.__sentient_preview}function Pe(){return rt().on}function it(e){let t=rt().listeners;return t.add(e),()=>{t.delete(e)}}function ot(e){return{isLocal:e.isLocal,track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},fetchWeights:()=>Promise.resolve([]),getAssignment:(t,n)=>e.getAssignment(t,n),assign:(t,n,r,i)=>e.assign(t,n,r,i),decide:()=>Promise.resolve(null),getSlotResult:t=>e.getSlotResult(t),getSlotConfig:t=>e.getSlotConfig(t),getSitePalette:()=>e.getSitePalette(),reportSlots:t=>e.reportSlots(t),getPersona:()=>e.getPersona(),getGraph:()=>e.getGraph(),dispose:()=>e.dispose(),destroy:()=>e.destroy()}}var Te="sentient:overrides-changed";function st(){var e;return typeof window=="undefined"?0:(e=window.__sentient_overrides_version)!=null?e:0}function at(){var t;if(typeof window=="undefined")return;let e=window;e.__sentient_overrides_version=((t=e.__sentient_overrides_version)!=null?t:0)+1,window.dispatchEvent(new Event(Te))}function $(e){return typeof window=="undefined"?()=>{}:(window.addEventListener(Te,e),()=>window.removeEventListener(Te,e))}function lt(e){typeof window!="undefined"&&(window.__sentient_devtools_config=e)}function O(){var e;return typeof process=="undefined"||((e=process.env)==null?void 0:e.NODE_ENV)!=="production"}function V(e){return typeof e=="string"?{type:"click"}:e}function q(e){return typeof e=="string"?e:e.type}function X(e){if(typeof e!="string"&&(e.type==="click"||e.type==="form_submit"||e.type==="scroll_depth"))return e.value}var De=new Set,Le=!1;function ct(e){if(De.has(e))return!0;if(De.add(e),!Le){Le=!0;let t=()=>{Le=!1,De.clear()};if(typeof MessageChannel=="function"){let n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),n.port2.close(),t()},n.port2.postMessage(0)}else setTimeout(t,0)}return!1}function wn(e){if(!(e instanceof Element))return!1;let t=e.tagName.toLowerCase();return t==="a"||t==="button"?!0:e.getAttribute("role")==="button"}function ut(e,t,n){if(n){try{let i=e;for(;i&&i!==t;){if(i.matches(n))return!0;i=i.parentElement}}catch(i){}return!1}let r=e;for(;r&&r!==t;){if(wn(r))return!0;r=r.parentElement}return!1}function H(e,t,n,r){if(t.type==="weighted_composite"){let o=new Set,d=[];return t.steps.forEach(({goal:u,name:g,weight:b},h)=>{let v=(p=!1)=>{o.has(h)||p&&r!==void 0&&ct(`step\0${g}\0${b}\0${h}`)||(o.add(h),n.fireStep(g,b,h))};if(u.type==="click"){let p=a=>{let l=a.target;l instanceof Element&&ut(l,e,u.selector)&&v()};e.addEventListener("click",p),d.push(()=>e.removeEventListener("click",p));return}if(u.type==="form_submit"){let p=a=>{a.target instanceof HTMLFormElement&&e.contains(a.target)&&v()};e.addEventListener("submit",p),d.push(()=>e.removeEventListener("submit",p));return}if(u.type==="scroll_depth"){let p=Math.max(0,Math.min(1,u.threshold)),a=new IntersectionObserver(l=>{for(let y of l)if(y.intersectionRatio>=p){v(!0),a.disconnect();break}},{threshold:[p]});a.observe(e),d.push(()=>a.disconnect())}}),()=>{for(let u of d)u()}}let i=t.type==="composite"?t.all:[t],f=new Set(i.map((o,d)=>d)),c=()=>{r!==void 0&&ct(r)||n.fireGoal()},s=(o,d=!1)=>{f.delete(o),f.size===0&&(d?c():n.fireGoal())},m=[];return i.forEach((o,d)=>{if(o.type==="click"){let u=g=>{let b=g.target;b instanceof Element&&ut(b,e,o.selector)&&(t.type==="composite"?s(d):n.fireGoal())};e.addEventListener("click",u),m.push(()=>e.removeEventListener("click",u));return}if(o.type==="form_submit"){let u=g=>{g.target instanceof HTMLFormElement&&e.contains(g.target)&&(t.type==="composite"?s(d):n.fireGoal())};e.addEventListener("submit",u),m.push(()=>e.removeEventListener("submit",u));return}if(o.type==="scroll_depth"){let u=Math.max(0,Math.min(1,o.threshold)),g=new IntersectionObserver(b=>{for(let h of b)if(h.intersectionRatio>=u){t.type==="composite"?s(d,!0):c(),g.disconnect();break}},{threshold:[u]});g.observe(e),m.push(()=>g.disconnect());return}}),()=>{for(let o of m)o()}}var dt=new Set,ft=new Set;function ne(e,t,n,r,i){let f=`${r}|${n}`;if(ft.has(f))return;ft.add(f);let c=i.type==="weighted_composite"&&!dt.has(r);c&&dt.add(r),e.track({projectId:t,componentId:n,eventType:"funnel_declared",payload:c?{funnelId:r,steps:i.steps.map(s=>({goalId:s.name,weight:s.weight}))}:{funnelId:r}})}function Z(e,t,n,r){e.track({projectId:t,componentId:n,variantId:r,eventType:"variant_assigned",payload:{}})}var Cn={components:new Map,slots:new Map,sections:[],listeners:new Set,version:0};function Q(){if(typeof window=="undefined")return Cn;let e=window;return e.__sentient_registry||(e.__sentient_registry={components:new Map,slots:new Map,sections:[],listeners:new Set,version:0}),e.__sentient_registry}function ce(){Q().version+=1;for(let e of Q().listeners)e()}var gt=()=>{};function mt(e){return O()?(Q().components.set(e.id,e),ce(),()=>{Q().components.delete(e.id),ce()}):gt}function re(e){return O()?(Q().slots.set(e.id,e),ce(),()=>{Q().slots.delete(e.id),ce()}):gt}function Ie(e){O()&&(Q().sections=[...e],ce())}var pt="0.34.0",Fe=pt!=="0.0.0-dev"?{name:"react",version:pt}:void 0;function An(){let e=window;return e.__sentient_slot_config_overrides||(e.__sentient_slot_config_overrides={}),e.__sentient_slot_config_overrides}function Be(e,t){An()[e]=t}function _n(){let e=window;return e.__sentient_slot_overrides||(e.__sentient_slot_overrides={}),e.__sentient_slot_overrides}function Me(e,t){_n()[e]=t}var vt="sentient_editor",yt="sentient_preview_cell",Ve="sentient-cell-preview-bar",$e="__preview__";function St(e){if(typeof window=="undefined"||typeof document=="undefined"||document.getElementById(Ve))return;let t,n;try{let s=new URLSearchParams(window.location.search);t=s.get(vt),n=s.get(yt)}catch(s){return}if(!t||!n)return;let r=n.lastIndexOf("~");if(r<=0)return;let i=n.slice(0,r),f=n.slice(r+1),c=(e!=null?e:"https://api.sentient-ui.com/v1").replace(/\/$/,"");fetch(`${c}/editor/cell-preview?slotId=${encodeURIComponent(i)}&persona=${encodeURIComponent(f)}`,{headers:{authorization:`Bearer ${t}`}}).then(async s=>{if(!s.ok){ge(s.status===401?"This preview link has expired \u2014 reopen it from your dashboard.":"Couldn\u2019t load this preview \u2014 reopen it from your dashboard.");return}let m=await s.json();if(m.blocks!=null)Be(i,{kind:"arms",blocks:{[$e]:m.blocks}}),Me(i,$e);else if(m.content!=null)Be(i,{kind:"arms",content:m.content}),Me(i,$e);else{ge("Nothing to preview in that square yet.");return}at(),ge(`Previewing \u201C${m.slotName}\u201D for ${m.personaDisplay}${m.status==="review"?" \u2014 waiting for your approval":""}. Nothing is being tracked.`),setTimeout(()=>{var o;try{(o=document.querySelector(`[data-sentient-slot="${i}"]`))==null||o.scrollIntoView({block:"center"})}catch(d){}},300)}).catch(()=>ge("Couldn\u2019t load this preview \u2014 check your connection and reopen it from your dashboard."))}function ge(e){var i;if(document.getElementById(Ve))return;let t=document.createElement("div");t.id=Ve,Object.assign(t.style,{position:"fixed",bottom:"16px",left:"50%",transform:"translateX(-50%)",zIndex:"2147483647",display:"flex",alignItems:"center",gap:"10px",padding:"10px 14px",borderRadius:"12px",maxWidth:"90vw",background:"#111827",color:"#fff",font:"13px system-ui, sans-serif",border:"1px solid rgba(139,92,246,0.6)",boxShadow:"0 10px 34px rgba(0,0,0,0.45)"});let n=document.createElement("span");n.textContent=e;let r=document.createElement("button");r.textContent="Exit preview",Object.assign(r.style,{padding:"4px 10px",borderRadius:"999px",border:"1px solid rgba(255,255,255,0.35)",background:"transparent",color:"#fff",font:"12px system-ui, sans-serif",cursor:"pointer"}),r.onclick=()=>{let f=new URL(window.location.href);f.searchParams.delete(vt),f.searchParams.delete(yt),window.location.assign(f.toString())},t.append(n,r),((i=document.body)!=null?i:document.documentElement).append(t)}var Gt=require("react/jsx-runtime");function Rn(){var e,t;if(typeof window=="undefined")return"desktop:direct";try{return(0,me.deriveSessionSegment)({userAgent:(e=navigator.userAgent)!=null?e:"",referer:(t=document.referrer)!=null?t:"",appOrigin:window.location.origin})}catch(n){return"desktop:direct"}}var ht="https://api.sentient-ui.com/v1",M=(0,w.createContext)({client:null,apiKey:"",initialAssignments:{},sessionSegment:"desktop:direct",ssrFallback:"first",onAssignment:void 0,initialLayoutOrder:null,initialSlots:{},initialSlotConfig:{},initialPalette:null,initialPersona:null,apiBaseUrl:ht,debug:!1});function kn(e){let[t,n]=(0,w.useState)(!1),r=(0,w.useRef)(e);r.current=e;let{cookie:i,value:f,event:c}=e!=null?e:{},s=typeof(e==null?void 0:e.check)=="function";return(0,w.useEffect)(()=>{let m=()=>{var g;let d=r.current;if(!d)return!1;if(d.check)return d.check()===!0;if(!d.cookie||typeof document=="undefined")return!1;let u=`${d.cookie}=${(g=d.value)!=null?g:"accepted"}`;return document.cookie.split("; ").some(b=>b.trim()===u)};if(n(m()),!c)return;let o=()=>{n(m())};return window.addEventListener(c,o),()=>window.removeEventListener(c,o)},[i,f,c,s]),t}function bt(e){var h,v;let[t,n]=(0,w.useState)(null),[r]=(0,w.useState)(()=>{var p;return(p=e.sessionSegment)!=null?p:Rn()}),[i,f]=(0,w.useState)(Pe());(0,w.useEffect)(()=>it(()=>f(Pe())),[]),(0,w.useEffect)(()=>{St(e.apiBaseUrl)},[]);let c=kn(e.consentFrom),s=e.consentFrom?e.consent===!0||c:e.consent,m=(0,w.useRef)(null);(0,w.useEffect)(()=>{var C;if(s===!1&&!e.preConsentBehavior){(C=m.current)==null||C.destroy(),m.current=null,n(null);return}let p=S({apiKey:e.apiKey,context:e.context,debug:e.debug,initialAssignments:e.initialAssignments,sessionSegment:r,consent:s,preConsentBehavior:e.preConsentBehavior,respectDoNotTrack:e.respectDoNotTrack,ssrSessionId:e.ssrSessionId,country:e.country,persona:e.persona,localMode:e.localMode,initialSlots:e.initialSlots,initialSlotConfig:e.initialSlotConfig,initialPalette:e.initialPalette,initialPersona:e.initialPersona,ingestUrl:e.apiBaseUrl?`${e.apiBaseUrl.replace(/\/$/,"")}/events`:void 0},Fe?{sdk:Fe}:{}),a=!1,l=null,y=null,x=G=>{e.engagement!==!1&&import("@sentientui/core/engagement").then(({startEngagementCapture:A})=>{a||(y=A(G,{apiKey:e.apiKey,sectionTypes:e.sectionTypes,apiBase:e.apiBaseUrl?e.apiBaseUrl.replace(/\/$/,""):void 0}))})};return e.enableGraph!==!1?import("@sentientui/core/graph").then(({init:G})=>{a||(l=G(W(S({},p),{graph:!0,captureDomText:e.captureDomText===!0,sectionTypes:e.sectionTypes})),m.current=l,n(l),x(l))}):(l=(0,me.init)(p),m.current=l,n(l),x(l)),()=>{a=!0,y==null||y(),l==null||l.dispose()}},[s]),(0,w.useEffect)(()=>{if(!t)return;let p=!1,a=async()=>{if(p)return;let y;try{y=await t.fetchWeights()}catch(x){return}if(!p)for(let x of y){let C={componentId:x.componentId,updatedAt:x.updatedAt,variants:x.variants.map(G=>{var A;return{variantId:G.variantId,pulls:G.pulls,avgReward:(A=G.avgReward)!=null?A:0}})};nt(x.componentId,C)}};a();let l=setInterval(()=>{a()},6e4);return()=>{p=!0,clearInterval(l)}},[t]);let o=(h=e.ssrFallback)!=null?h:"first",d=((v=e.apiBaseUrl)!=null?v:ht).replace(/\/$/,""),u=(0,w.useRef)(null);(0,w.useEffect)(()=>{var l;if(typeof process!="undefined"&&((l=process.env)==null?void 0:l.NODE_ENV)==="production")return;let p={apiKey:e.apiKey,context:e.context,country:e.country,persona:e.persona,apiBaseUrl:d},a=u.current;if(u.current=p,a!==null)for(let y of["apiKey","context","country","persona","apiBaseUrl"])Object.is(a[y],p[y])||console.warn(`[sentient] AdaptiveProvider: \`${y}\` changed after initialisation, but the SDK client is stable for the session and only re-inits on \`consent\` \u2014 the new value is ignored. Remount the provider (e.g. via a changing \`key\` prop) to apply it.`)},[e.apiKey,e.context,e.country,e.persona,d]),(0,w.useEffect)(()=>{var p;typeof process!="undefined"&&((p=process.env)==null?void 0:p.NODE_ENV)==="production"||lt({apiKey:e.apiKey,apiBaseUrl:d,isLocal:(t==null?void 0:t.isLocal)===!0})},[t,e.apiKey,d]),(0,w.useEffect)(()=>{let p=e.initialLayoutOrder;if(p&&p.length>0){Ie(p);return}e.declaredSections&&e.declaredSections.length>0&&Ie(e.declaredSections)},[e.initialLayoutOrder,e.declaredSections]),(0,w.useEffect)(()=>{if(!O())return;let p=e.declaredSections;if(!p||p.length===0||typeof document=="undefined")return;let a=new Set(Array.from(document.querySelectorAll("[data-sentient-id]"),y=>y.getAttribute("data-sentient-id"))),l=p.filter(y=>!a.has(y));l.length>0&&console.warn(`[SentientUI] Declared section${l.length>1?"s":""} ${l.map(y=>`"${y}"`).join(", ")} ${l.length>1?"have":"has"} no matching data-sentient-id element, so the layout engine cannot learn what they are and will serve the same order to every persona. Add data-sentient-id="<sectionId>" to each section's element.`)},[e.declaredSections]);let g=(0,w.useMemo)(()=>t&&i?ot(t):t,[t,i]),b=(0,w.useMemo)(()=>{var p,a,l,y,x,C,G;return{client:g,apiKey:e.apiKey,initialAssignments:(p=e.initialAssignments)!=null?p:{},sessionSegment:r,ssrFallback:o,onAssignment:e.onAssignment,initialLayoutOrder:(a=e.initialLayoutOrder)!=null?a:null,initialSlots:(l=e.initialSlots)!=null?l:{},initialSlotConfig:(y=e.initialSlotConfig)!=null?y:{},initialPalette:(x=e.initialPalette)!=null?x:null,initialPersona:(C=e.initialPersona)!=null?C:null,apiBaseUrl:d,debug:(G=e.debug)!=null?G:!1}},[g,e.apiKey,e.initialAssignments,r,o,e.onAssignment,e.initialLayoutOrder,e.initialSlots,e.initialSlotConfig,e.initialPalette,e.initialPersona,d,e.debug]);return(0,Gt.jsx)(M.Provider,{value:b,children:e.children})}function E(){return(0,w.useContext)(M).client}function z(){return(0,w.useContext)(M).apiKey}function pe(){return(0,w.useContext)(M).initialAssignments}function ve(){return(0,w.useContext)(M).sessionSegment}function xt(){return(0,w.useContext)(M).ssrFallback}function ye(){return(0,w.useContext)(M).onAssignment}function wt(){return(0,w.useContext)(M).debug}function Ct(){let e=(0,w.useContext)(M).initialLayoutOrder,t=(0,w.useSyncExternalStore)($,()=>{var n;return typeof window=="undefined"?null:(n=window.__sentient_layout_override)!=null?n:null},()=>null);return t!=null?t:e}function Se(){return(0,w.useContext)(M).initialSlots}function At(){return(0,w.useContext)(M).initialPersona}function _t(){return(0,w.useContext)(M).initialSlotConfig}function Rt(){return(0,w.useContext)(M).initialPalette}function kt(){return(0,w.useContext)(M).apiBaseUrl}var se=require("react");var D=require("react"),Ot=require("@sentientui/core");var N=require("react"),he=require("@sentientui/policy");function ie(e){var n;if(typeof window=="undefined")return null;let t=(n=window.__sentient_overrides)==null?void 0:n[e];if(t)return t;if(!window.location.search)return null;try{let r=new URLSearchParams(window.location.search);for(let i of r.getAll("sentient_variant")){let f=i.indexOf(":");if(f!==-1&&i.slice(0,f)===e)return i.slice(f+1)}}catch(r){}return null}function be(e,t,n,r){let i=pe(),f=xt(),c=E(),s=ve(),m=ye(),o=wt(),d=(0,N.useRef)(null),u=(0,N.useSyncExternalStore)($,()=>ie(e),()=>null),g=u&&t.includes(u)?u:null,b=(0,N.useRef)(null);(0,N.useEffect)(()=>{o&&g&&b.current!==g&&(b.current=g,console.info(`[sentient] override active: ${e} -> ${g}`))},[o,g,e]);let[h,v]=(0,N.useState)(()=>{var y,x;if(g)return{variantId:g,content:null,isLoading:!1,settled:!0};if(!c){let C=i[e];return C&&t.includes(C)?{variantId:C,content:null,isLoading:!1,settled:!0}:f==="first"&&t.length>0?{variantId:t[0],content:null,isLoading:!1,settled:!1}:{variantId:null,content:null,isLoading:!0,settled:!1}}let a=c.getAssignment(e,s);if(a&&(t.includes(a.variantId)||a.content))return{variantId:a.variantId,content:(y=a.content)!=null?y:null,isLoading:!1,settled:!0};let l=Ee(e);if(l){let C=(0,he.pickFromWeights)(l.variants,t);if(C)return{variantId:C,content:null,isLoading:!1,settled:!0}}return{variantId:(x=t[0])!=null?x:null,content:null,isLoading:!1,settled:!1}}),p=a=>{m&&d.current!==a&&(d.current=a,m(e,a))};return(0,N.useEffect)(()=>{var y;if(g||!c)return;let a=c.getAssignment(e,s);if(a&&(t.includes(a.variantId)||a.content)){v({variantId:a.variantId,content:(y=a.content)!=null?y:null,isLoading:!1,settled:!0}),p(a.variantId);return}let l=Ee(e);if(l&&h.settled&&h.variantId&&h.variantId===(0,he.pickFromWeights)(l.variants,t)){p(h.variantId);return}v(x=>{var C;return x.variantId?x:{variantId:(C=t[0])!=null?C:null,content:null,isLoading:!1,settled:!1}})},[g,c,e,s]),(0,N.useEffect)(()=>{if(g||!c)return;let a=c.getAssignment(e,s);if(a&&t.includes(a.variantId))return;let l=!1;return c.assign(e,t,n,r).then(y=>{var x;l||y&&(!t.includes(y.variantId)&&!y.content||(v({variantId:y.variantId,content:(x=y.content)!=null?x:null,isLoading:!1,settled:!0}),p(y.variantId)))}),()=>{l=!0}},[g,c,e,s]),(0,N.useEffect)(()=>{if(!g&&c)return tt(e,a=>{var x;let l=c.getAssignment(e,s);if(l&&(t.includes(l.variantId)||l.content)){v({variantId:l.variantId,content:(x=l.content)!=null?x:null,isLoading:!1,settled:!0}),p(l.variantId);return}let y=(0,he.pickFromWeights)(a.variants,t);y&&(v({variantId:y,content:null,isLoading:!1,settled:!0}),p(y))})},[g,c,e,s]),g?{variantId:g,content:null,isLoading:!1,settled:!0,isOverride:!0}:h}function xe(e,t,n){let r=E(),i=z(),f=Object.keys(t).join("\0"),c=(0,D.useMemo)(()=>Object.keys(t),[f]),{variantId:s,content:m,isOverride:o=!1,settled:d}=be(e,c,n.agentData,n.agentDataByVariant),[u,g]=(0,D.useState)(null),b=(0,D.useRef)(null),h=(0,D.useCallback)(R=>{b.current=R,g(R)},[]),v=n.goal,p=typeof v=="string"?v:JSON.stringify(v),a=(0,D.useMemo)(()=>v?V(v):null,[p]),l=v?q(v):"";(0,D.useEffect)(()=>mt({id:e,variantIds:c,goal:l}),[e,c,l]);let y=(0,D.useRef)(null);(0,D.useEffect)(()=>{o||d&&(!r||!s||!i||!u||y.current!==s&&(y.current=s,Z(r,i,e,s)))},[r,s,i,e,u,o,d]);let x=(0,D.useRef)(!1),C=(0,D.useRef)(new Set);(0,D.useEffect)(()=>{x.current=!1,C.current=new Set},[s,a]);let G=n.funnel;(0,D.useEffect)(()=>{o||!d||!r||!G||!a||ne(r,i,e,G,a)},[r,i,e,G,a,o,d]);let A=n.cursorSignal===!0;(0,D.useEffect)(()=>{if(!A||o||!d||!r||!s||!u)return;let R=null,T=0,I=()=>{T=Date.now(),R=setTimeout(()=>{r.track({projectId:i,componentId:e,variantId:s,eventType:"cursor_signal",payload:{hoverDuration:Date.now()-T}}),R=null},800)},L=()=>{R!==null&&(clearTimeout(R),R=null)};return u.addEventListener("mouseenter",I),u.addEventListener("mouseleave",L),()=>{u.removeEventListener("mouseenter",I),u.removeEventListener("mouseleave",L),R!==null&&clearTimeout(R)}},[A,r,s,i,e,u,o,d]);let _=(0,D.useRef)(n.microSignalGoals);_.current=n.microSignalGoals;let k=n.microSignalGoals?JSON.stringify(n.microSignalGoals):"";return(0,D.useEffect)(()=>{if(o||!d||!r||!s||!u)return;let R=Date.now();return(0,Ot.attachMicroSignalDetectors)((T,I={})=>{var Je,Xe,He;r.track({projectId:i,componentId:e,variantId:s,eventType:"micro_signal",payload:S({signalType:T},I)});let L=(Je=_.current)==null?void 0:Je[T];if(!L||C.current.has(T))return;C.current.add(T);let te=typeof L=="string"?L:L.name,dn=typeof L=="string"?1:(Xe=L.weight)!=null?Xe:1,fn=typeof L=="string"?0:(He=L.stepIndex)!=null?He:0;r.goal(te,{metadata:S({signalType:T},I),weight:dn,stepIndex:fn})},u,R)},[r,s,i,e,u,k,o,d]),(0,D.useEffect)(()=>{if(o||!d||!r||!s||!u||!a)return;let R=X(a);return H(u,a,{fireGoal:()=>{x.current||(x.current=!0,r.track({projectId:i,componentId:e,variantId:s,eventType:"goal_achieved",goalType:l,payload:S({reward:1},R!==void 0?{goalValue:R}:{})}),r.goal(l,S({metadata:{componentId:e,variantId:s},weight:1,stepIndex:0},R!==void 0?{value:R}:{})))},fireStep:(T,I,L)=>{r.track({projectId:i,componentId:e,variantId:s,eventType:"goal_achieved",goalType:T,payload:{reward:I}}),r.goal(T,{metadata:{},weight:I,stepIndex:L})}},l)},[r,s,i,e,u,a,l,o,d]),{client:r,variantIds:c,variantId:s,content:m,settled:d,isOverride:o,goalLabel:l,ref:h,nodeRef:b}}var K=require("react"),we=require("@sentientui/core");var j=require("react"),Pt=require("@sentientui/core");var Et=new Set;function Tt(e,t){var p;let n=E(),r=(0,j.useRef)(t==null?void 0:t.baselineText);r.current=t==null?void 0:t.baselineText;let i=Se(),f=_t(),c=Rt(),s=(0,j.useSyncExternalStore)($,()=>{var a;return typeof window!="undefined"?(a=window.__sentient_slot_config_overrides)==null?void 0:a[e]:void 0},()=>{}),m=(0,j.useSyncExternalStore)($,()=>{var a;return typeof window!="undefined"?(a=window.__sentient_slot_overrides)==null?void 0:a[e]:void 0},()=>{}),o=a=>a==null?"":(0,Pt.armOfResult)(a),d=(0,j.useCallback)(a=>{var l,y;return(y=(l=n==null?void 0:n.onSlotsChanged)==null?void 0:l.call(n,a))!=null?y:(()=>{})},[n]);(0,j.useSyncExternalStore)(d,()=>{var a;return(a=n==null?void 0:n.getSlotConfig(e))!=null?a:null},()=>null),(0,j.useSyncExternalStore)(d,()=>o(n==null?void 0:n.getSlotResult(e)),()=>"");let u=s===void 0?f[e]:void 0,g=s===void 0&&u===void 0&&n?n.getSlotConfig(e):null,b=(p=c!=null?c:n==null?void 0:n.getSitePalette())!=null?p:null,h=(()=>{var a,l;if(s!==void 0)return{config:s,arm:o(m),palette:b,source:"override"};if(u!==void 0)return{config:u,arm:o((a=i[e])!=null?a:n==null?void 0:n.getSlotResult(e)),palette:b,source:"preloaded"};if(g!==null){let y=n!=null&&n.isSlotDecided?n.isSlotDecided(e):!0;return{config:g,arm:o((l=n==null?void 0:n.getSlotResult(e))!=null?l:i[e]),palette:b,source:y?"client":"seeded"}}return{config:null,arm:"",palette:b,source:"none"}})(),v=h.source==="preloaded"||h.source==="override";return(0,j.useEffect)(()=>{var y,x;if(!n||n.isLocal===!0||v)return;let a=h.source==="none"&&(x=(y=r.current)==null?void 0:y.call(r))!=null?x:null,l=a!=null&&a!==""?[[e],{[e]:a}]:[[e]];return n.requestSlots?n.requestSlots(...l):h.source==="none"&&n.reportSlots(...l),()=>{var C;return(C=n.cancelSlots)==null?void 0:C.call(n,[e])}},[n,v,h.source,e]),(0,j.useEffect)(()=>{!O()||(n==null?void 0:n.isLocal)!==!0||h.source!=="none"||Et.has(e)||(Et.add(e),console.warn(`[sentient] <Adaptive id="${e}"> is rendering its baseline children: in local/keyless mode <Adaptive> serves ONLY what you pass as \`initialSlotConfig\` (there is no registry to decide from). Pass initialSlotConfig/initialSlots to <AdaptiveProvider> to preview arms locally.`))},[n,h.source,e]),h}var je=require("react");var P=require("react/jsx-runtime"),Y={none:"0",sm:"8px",md:"16px",lg:"24px"},Ne={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",between:"space-between"},Ft={sm:"0.875em",md:"1em",lg:"1.25em"},Gn={sm:"1.25em",md:"1.5em",lg:"2em"},Dt={sm:"6px 14px",md:"10px 20px",lg:"14px 28px"},Lt={sm:"8px",md:"16px",lg:"32px"},On={square:"1 / 1",landscape:"4 / 3",wide:"16 / 9"},En={normal:"400",medium:"500",bold:"700"};function It(e,t){return S(S({},e==="muted"?t!=null&&t.muted?{color:t.muted}:{opacity:.7}:{}),e==="accent"?S({fontWeight:600},t!=null&&t.accent?{color:t.accent}:{}):{})}function Bt(e,t,n){var i,f,c,s;let r=t==null?void 0:t.accent;return W(S({display:"inline-block",padding:(i=Dt[n!=null?n:"md"])!=null?i:Dt.md,borderRadius:(f=t==null?void 0:t.radius)!=null?f:"8px",font:"inherit"},n?{fontSize:Ft[n]}:{}),{textDecoration:e==="ghost"?"underline":"none",cursor:"pointer",background:e==="primary"?(c=t==null?void 0:t.primaryBg)!=null?c:"#111827":"transparent",color:e==="primary"?(s=t==null?void 0:t.primaryText)!=null?s:"#ffffff":r!=null?r:"inherit",border:e==="secondary"?`1px solid ${r!=null?r:"currentColor"}`:"none"})}function Pn({node:e,opts:t}){var i,f,c,s,m;let n=(i=e.emphasis)!=null?i:"primary",r={padding:"8px 10px",font:"inherit",border:`1px solid ${(c=(f=t.palette)==null?void 0:f.border)!=null?c:"currentColor"}`,borderRadius:(m=(s=t.palette)==null?void 0:s.radius)!=null?m:"8px"};return(0,P.jsxs)("form",{onSubmit:o=>{var g,b,h;o.preventDefault();let d=new FormData(o.currentTarget),u={};for(let v of e.fields)u[v.name]=String((g=d.get(v.name))!=null?g:"");(b=t.onFormGoal)==null||b.call(t,e.submitGoal);try{(h=t.onFormSubmit)==null||h.call(t,u)}catch(v){}},style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.fields.map(o=>{var d,u;return(0,P.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:"4px",font:"inherit"},children:[o.label,o.kind==="textarea"?(0,P.jsx)("textarea",{name:o.name,required:o.required,placeholder:o.placeholder,rows:3,style:r}):o.kind==="select"?(0,P.jsx)("select",{name:o.name,required:o.required,style:r,children:((d=o.options)!=null?d:[]).map(g=>(0,P.jsx)("option",{value:g,children:g},g))}):(0,P.jsx)("input",{name:o.name,type:(u=o.inputType)!=null?u:"text",required:o.required,placeholder:o.placeholder,style:r})]},o.name)}),(0,P.jsx)("button",{type:"submit",style:Bt(n,t.palette),children:e.submitLabel})]})}function oe(e,t){var n,r,i,f,c,s,m,o,d,u,g,b,h,v,p,a,l,y,x,C,G,A,_;try{switch(e.type){case"stack":{let k=(r=Y[(n=e.gap)!=null?n:"md"])!=null?r:Y.md,R=e.surface==="raised",T=(i=e.pad)!=null?i:R?"md":void 0;return(0,P.jsx)("div",{style:S(S(S(S(S({display:"flex",flexDirection:e.direction,gap:k},e.align?{alignItems:Ne[e.align]}:{}),e.justify?{justifyContent:Ne[e.justify]}:{}),e.wrap?{flexWrap:"wrap"}:{}),T?{padding:(f=Y[T])!=null?f:Y.md}:{}),R?W(S(S({},(c=t.palette)!=null&&c.surface?{background:t.palette.surface}:{}),(s=t.palette)!=null&&s.surface&&((m=t.palette)!=null&&m.surfaceText)?{color:t.palette.surfaceText}:{}),{border:`1px solid ${(d=(o=t.palette)==null?void 0:o.border)!=null?d:"currentColor"}`,borderRadius:(g=(u=t.palette)==null?void 0:u.radius)!=null?g:"8px"}):{}),children:((b=e.children)!=null?b:[]).map((I,L)=>{let te=oe(I,t);return te===null?null:(0,P.jsx)(je.Fragment,{children:te},L)})})}case"grid":{let k=(v=Y[(h=e.gap)!=null?h:"md"])!=null?v:Y.md;return(0,P.jsx)("div",{style:S(S({display:"grid",gridTemplateColumns:`repeat(auto-fit, minmax(max(200px, calc((100% - ${e.columns-1} * ${k}) / ${e.columns})), 1fr))`,gap:k},e.align?{alignItems:Ne[e.align]}:{}),e.pad?{padding:(p=Y[e.pad])!=null?p:Y.md}:{}),children:((a=e.children)!=null?a:[]).map((R,T)=>{let I=oe(R,t);return I===null?null:(0,P.jsx)(je.Fragment,{children:I},T)})})}case"text":return(0,P.jsx)("p",{style:S(S(S(S(S({margin:0},e.size?{fontSize:Ft[e.size]}:{}),e.weight?{fontWeight:En[e.weight]}:{}),e.align?{textAlign:e.align}:{}),e.maxWidth==="measure"?{maxWidth:"65ch"}:{}),It(e.tone,t.palette)),children:e.value});case"heading":{let k=`h${e.level}`;return(0,P.jsx)(k,{style:S(S({margin:0,fontSize:Gn[(l=e.size)!=null?l:"md"]},e.align?{textAlign:e.align}:{}),e.maxWidth==="measure"?{maxWidth:"65ch"}:{}),children:e.value})}case"button":{let k=(y=e.emphasis)!=null?y:"primary";return(0,P.jsx)("a",W(S({href:e.href},e.tag?{"data-sentient-tag":e.tag}:{}),{style:Bt(k,t.palette,e.size),children:e.label}))}case"link":return(0,P.jsx)("a",W(S({href:e.href},e.tag?{"data-sentient-tag":e.tag}:{}),{style:{color:"inherit",textDecoration:"underline"},children:e.label}));case"image":return(0,P.jsx)("img",{src:e.src,alt:e.alt,style:S(S({display:"block",maxWidth:"100%"},e.ratio&&e.ratio!=="auto"?{aspectRatio:On[e.ratio],width:"100%"}:{}),e.fit?{objectFit:e.fit}:{})});case"badge":return(0,P.jsx)("span",{style:S({display:"inline-block",padding:"2px 10px",borderRadius:"999px",fontSize:"0.75em",border:`1px solid ${(C=(x=t.palette)==null?void 0:x.border)!=null?C:"currentColor"}`},It(e.tone,t.palette)),children:e.value});case"spacer":return(0,P.jsx)("div",{style:{height:(G=Lt[e.size])!=null?G:Lt.md}});case"divider":return(0,P.jsx)("hr",{style:{border:"none",borderTop:`1px solid ${(_=(A=t.palette)==null?void 0:A.border)!=null?_:"currentColor"}`,margin:0,width:"100%"}});case"form":return(0,P.jsx)(Pn,{node:e,opts:t});default:return null}}catch(k){return null}}var $t=require("react/jsx-runtime"),Mt=new Set;function Ce({id:e,children:t,onFormSubmit:n,goal:r,className:i,reportBaselineText:f=!0}){var A;let c=E(),s=z(),m=(0,K.useRef)(null),{config:o,arm:d,palette:u,source:g}=Tt(e,{baselineText:f?()=>{var _,k;return(k=(_=m.current)==null?void 0:_.textContent)!=null?k:null}:void 0}),b=d!==""?(A=o==null?void 0:o.blocks)==null?void 0:A[d]:void 0,h=b!==void 0&&(0,we.containsFormBlock)(b)&&!n;(0,K.useEffect)(()=>{!h||!O()||Mt.has(e)||(Mt.add(e),console.warn(`[sentient] AdaptiveSlot "${e}" was served a form arm but has no onFormSubmit handler \u2014 rendering its baseline children instead. Pass onFormSubmit to render generated forms.`))},[h,e]);let v=_=>{!c||g==="override"||(g!=="seeded"&&c.componentGoal(e,_),c.goal(_,{metadata:{componentId:e,arm:d},weight:1,stepIndex:0}))},p=t,a=!1;if(b!==void 0){let _=h?null:oe(b,{palette:u,onFormSubmit:n,onFormGoal:v});_===null?a=!0:p=_}else(o==null?void 0:o.content)!==void 0&&g!=="none"&&(p=o.content);let l=o!=null&&o.blocks?Object.keys(o.blocks).sort().join("|"):"";(0,K.useEffect)(()=>re({id:e,arms:l===""?void 0:l.split("|")}),[e,l]);let y=(0,K.useRef)(null);(0,K.useEffect)(()=>{!c||g==="none"||g==="seeded"||g==="override"||d===""||a||y.current!==d&&(y.current=d,Z(c,s,e,d))},[c,s,e,d,g,a]);let x=r===void 0?null:typeof r=="string"?r:JSON.stringify(r);(0,K.useEffect)(()=>{if(!c||!r||g==="override"||g==="none"||g==="seeded"||a)return;let _=m.current;if(!_)return;let k=q(r),R=X(r),T=!1;return H(_,V(r),{fireGoal:()=>{T||(T=!0,R!==void 0?c.componentGoal(e,k,{value:R}):c.componentGoal(e,k),c.goal(k,S({metadata:{componentId:e,arm:d},weight:1,stepIndex:0},R!==void 0?{value:R}:{})))},fireStep:(I,L,te)=>{c.componentGoal(e,I,{reward:L}),c.goal(I,{metadata:{componentId:e,arm:d},weight:L,stepIndex:te})}},k)},[c,e,x,d,g,a]);let C=(0,K.useRef)(null);(0,K.useEffect)(()=>{let _=m.current;if(_){if(C.current===null){C.current=d;return}C.current!==d&&(C.current=d,(0,we.reveal)(_))}},[d]);let G=(0,K.useMemo)(()=>S({"data-sentient-slot":e},d!==""?{"data-sentient-arm":d}:{}),[e,d]);return(0,$t.jsx)("div",W(S({ref:m,className:i},G),{children:p}))}var Ae=require("react/jsx-runtime");function Tn(e){var o;let{client:t,variantId:n,content:r,ref:i}=xe(e.id,e.variants,{goal:e.goal,funnel:e.funnel,microSignalGoals:e.microSignalGoals,agentData:e.agentData,agentDataByVariant:e.agentDataByVariant,cursorSignal:!0}),[f,c]=(0,se.useState)(!1);if((0,se.useEffect)(()=>{c(!0)},[]),e.clientOnly&&(!f||!t)||!n)return null;let s=(o=e.variants[n])!=null?o:null,m=s===null?r:null;return O()&&s===null&&m===null&&console.warn(`[sentient] <Adaptive id="${e.id}"> was assigned variant "${n}" but no matching key exists in props.variants. If this is a dashboard-managed text variant, use <AdaptiveText id="${e.id}"> instead.`),(0,Ae.jsx)("div",{ref:i,"data-sentient-id":e.id,"data-sentient-variant":n,children:s!=null?s:m})}var Dn=(0,se.memo)(Tn,(e,t)=>{if(e.id!==t.id||e.goal!==t.goal&&JSON.stringify(e.goal)!==JSON.stringify(t.goal)||e.microSignalGoals!==t.microSignalGoals||e.funnel!==t.funnel||e.clientOnly!==t.clientOnly||e.agentData!==t.agentData||e.agentDataByVariant!==t.agentDataByVariant)return!1;if(e.variants===t.variants)return!0;let n=Object.keys(e.variants),r=Object.keys(t.variants);return n.length!==r.length?!1:n.every(i=>i in t.variants&&Object.is(e.variants[i],t.variants[i]))});function Vt(e){return e.variants===void 0?(0,Ae.jsx)(Ce,S({},e)):(O()&&e.children!=null&&console.warn(`[sentient] <Adaptive id="${e.id}"> got both variants and children \u2014 rendering variants; children are ignored.`),(0,Ae.jsx)(Dn,S({},e)))}var F=require("react");var jt=require("react/jsx-runtime");function Nt({id:e,default:t,component:n="span",className:r,goal:i}){var G;let f=E(),c=z(),s=ye(),m=ve(),o=(0,F.useRef)(null),d=(0,F.useRef)(null),u=(0,F.useSyncExternalStore)($,()=>ie(e),()=>null),[g,b]=(0,F.useState)(()=>{var A,_;return(_=(A=f==null?void 0:f.getAssignment(e,m))==null?void 0:A.content)!=null?_:null}),[h,v]=(0,F.useState)(()=>{var A,_;return(_=(A=f==null?void 0:f.getAssignment(e,m))==null?void 0:A.variantId)!=null?_:null});(0,F.useEffect)(()=>{if(u||!f)return;let A=f.getAssignment(e,m);if((A==null?void 0:A.content)!==void 0){v(A.variantId),b(A.content);return}let _=!1;return f.assign(e).then(k=>{if(!_){if(!k){O()&&console.warn(`[sentient] <AdaptiveText id="${e}"> assignment failed \u2014 showing default text.`);return}v(k.variantId),k.content&&b(k.content)}}),()=>{_=!0}},[f,e,m,u]),(0,F.useEffect)(()=>{u||!f||!h||!c||o.current!==h&&(o.current=h,f.track({projectId:c,componentId:e,variantId:h,eventType:"variant_assigned",payload:{}}),s==null||s(e,h))},[f,h,c,e,s,u]);let p=i===void 0?"":typeof i=="string"?i:JSON.stringify(i),a=(0,F.useMemo)(()=>i===void 0?null:V(i),[p]),l=i===void 0?null:typeof i=="string"?i:a.type,y=(0,F.useRef)(!1);(0,F.useEffect)(()=>{y.current=!1},[h,p]),(0,F.useEffect)(()=>{if(u||!f||!h||!c||!a||!l)return;let A=d.current;if(!A)return;let _=X(a);return H(A,a,{fireGoal:()=>{y.current||(y.current=!0,f.track({projectId:c,componentId:e,variantId:h,eventType:"goal_achieved",goalType:l,payload:S({reward:1},_!==void 0?{goalValue:_}:{})}),f.goal(l,S({metadata:{componentId:e,variantId:h},weight:1,stepIndex:0},_!==void 0?{value:_}:{})))},fireStep:(k,R,T)=>{f.track({projectId:c,componentId:e,variantId:h,eventType:"goal_achieved",goalType:k,payload:{reward:R}}),f.goal(k,{metadata:{},weight:R,stepIndex:T})}})},[f,h,c,e,a,l,u]);let x=g!=null?g:t;if(u){let A=f==null?void 0:f.getAssignment(e,m);x=A&&A.variantId===u&&(G=A.content)!=null?G:t}return(0,jt.jsx)(n,{ref:A=>{d.current=A},className:r,children:x})}var _e=require("react");function Re(e){let t=E(),n=(0,_e.useRef)(new Set);return(0,_e.useCallback)((r,i)=>{var f,c;if(!ie(e)){if(i!=null&&i.once){if(n.current.has(r))return;n.current.add(r)}t==null||t.componentGoal(e,r,i),t==null||t.goal(r,S(S(S({metadata:(f=i==null?void 0:i.metadata)!=null?f:{},weight:(c=i==null?void 0:i.reward)!=null?c:1,stepIndex:0},(i==null?void 0:i.value)!==void 0?{value:i.value}:{}),(i==null?void 0:i.currency)!==void 0?{currency:i.currency}:{}),(i==null?void 0:i.externalId)!==void 0?{externalId:i.externalId}:{}))}},[t,e])}var ue=require("react");function Kt(e,t={}){let m=t,{componentId:n}=m,r=Ze(m,["componentId"]),i=E(),f=Re(n!=null?n:""),c=(0,ue.useRef)(!1),s=(0,ue.useRef)(r);s.current=r,(0,ue.useEffect)(()=>{if(!i||c.current)return;c.current=!0;let{metadata:o,reward:d,value:u,currency:g,externalId:b}=s.current;if(n){f(e,s.current);return}i.goal(e,S(S(S({metadata:o!=null?o:{},weight:d!=null?d:1,stepIndex:0},u!==void 0?{value:u}:{}),g!==void 0?{currency:g}:{}),b!==void 0?{externalId:b}:{}))},[i,n,e,f])}var Ut=require("@sentientui/core"),Jt=require("@sentientui/policy"),Ht=require("react/jsx-runtime");function Wt(e){return JSON.stringify(e).replace(/</g,"\\u003c")}function Ln(e){return e.persona?'(function(){try{var d=document.documentElement;if(d.hasAttribute("data-sentient-persona"))return;d.setAttribute("data-sentient-persona",'+Wt(e.persona.persona)+');d.setAttribute("data-sentient-confidence",'+Wt((0,Jt.confidenceBand)(e.persona.confidence))+");}catch(e){}})();":(0,Ut.renderPrePaintScript)(e.apiKey)}function Xt(e){return(0,Ht.jsx)("script",{"data-sentient-persona-script":"",nonce:e.nonce,dangerouslySetInnerHTML:{__html:Ln(e)}})}var J=require("react"),Yt=require("@sentientui/policy");var U=require("react"),ee=require("@sentientui/core"),zt=require("@sentientui/policy");function ke(e,t){let n=E(),r=Se(),[,i]=(0,U.useReducer)(u=>u+1,0),f=(0,U.useSyncExternalStore)($,()=>{var u;return typeof window!="undefined"?(u=window.__sentient_slot_overrides)==null?void 0:u[e]:void 0},()=>{}),c=f===void 0?r[e]:void 0,s=f===void 0&&c===void 0&&n?n.getSlotResult(e):null,m=(n==null?void 0:n.isLocal)===!0&&f===void 0&&c===void 0&&s===null;(0,U.useEffect)(()=>{if(!m||!n)return;let u=!1;return n.decide({slots:[t]}).then(g=>{!u&&g&&i()}),()=>{u=!0}},[n,e,m]);let o=(()=>{if(f!==void 0)return{result:f,arm:(0,ee.armOfResult)(f),source:"override"};if(c!==void 0)return{result:c,arm:(0,ee.armOfResult)(c),source:"preloaded"};if(s!==null){let g=n!=null&&n.isSlotDecided?n.isSlotDecided(e):!0;return{result:s,arm:(0,ee.armOfResult)(s),source:g?"client":"seeded"}}let u=(0,ee.baselineResultFor)(t);return{result:u,arm:(0,ee.armOfResult)(u),source:"baseline"}})(),d=o.source==="preloaded"||o.source==="override";return(0,U.useEffect)(()=>{var g;if(!n||n.isLocal===!0||d||!n.decideSlots)return;let u=(g=n.onSlotsChanged)==null?void 0:g.call(n,i);return n.decideSlots([t]),()=>{var b;(b=n.cancelSlots)==null||b.call(n,[e]),u==null||u()}},[n,e,d]),o}function In(){var t;if(typeof window=="undefined")return null;let e=window.__sentient_persona_override;if(e!=null&&e.persona)return{persona:e.persona,confidence:(t=e.confidence)!=null?t:1};try{let n=new URLSearchParams(window.location.search).get("sentient_persona");if(n)return{persona:n,confidence:1}}catch(n){}return null}function qt(){let e=E(),t=At();(0,U.useSyncExternalStore)($,st,()=>0);let[n,r]=(0,U.useState)(!1);(0,U.useEffect)(()=>r(!0),[]);let i=s=>({persona:s.persona,confidence:s.confidence,band:(0,zt.confidenceBand)(s.confidence)});if(!n)return t?i(t):null;let f=In();if(f)return i(f);if(t)return i(t);let c=e?e.getPersona():null;return c?i(c):null}var Zt=new Set;function Fn(e){return typeof CSS!="undefined"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/[\\"]/g,"\\$&")}function Qt(e,t,n){let r=E(),i=z(),f=JSON.stringify(t),c=(0,J.useMemo)(()=>({id:e,dims:t}),[e,f]),{result:s,arm:m,source:o}=ke(e,c),d=(0,J.useMemo)(()=>typeof s=="string"?{}:s,[m]);if(O()&&!Zt.has(e)){Zt.add(e);let v=(0,Yt.validateSlotDecl)({id:e,dims:Object.fromEntries(Object.entries(t).map(([a,l])=>[a,[...l]]))}),p=Object.values(t).reduce((a,l)=>a*l.length,1);v.ok?p>4&&console.warn(`[sentient] useAdaptiveTokens("${e}") declares ${p} combinations \u2014 more than the recommended 4. Each extra combination needs more traffic to learn; consider fewer dims/values.`):console.warn(`[sentient] useAdaptiveTokens("${e}"): invalid declaration \u2014 ${v.reason}. Serving baseline.`)}let u=(n==null?void 0:n.goal)===void 0?null:typeof n.goal=="string"?n.goal:JSON.stringify(n.goal);(0,J.useEffect)(()=>re({id:e,dims:t}),[e]);let g=(0,J.useRef)(null);(0,J.useEffect)(()=>{!r||o==="baseline"||o==="seeded"||o==="override"||g.current===m||(g.current=m,Z(r,i,e,m))},[r,i,e,m,o]);let b=n==null?void 0:n.funnel;(0,J.useEffect)(()=>{var v;!r||!b||o==="override"||ne(r,i,e,b,V((v=n==null?void 0:n.goal)!=null?v:"click"))},[r,i,e,b,u,o]),(0,J.useEffect)(()=>{if(!r||!(n!=null&&n.goal)||o==="override"||o==="baseline"||o==="seeded")return;let v=document.querySelector(`[data-sentient-slot="${Fn(e)}"]`);if(!v){O()&&console.warn(`[sentient] useAdaptiveTokens("${e}"): a goal is declared but no element carries the returned props \u2014 spread {...props} on the slot's element.`);return}let p=q(n.goal),a=X(n.goal),l=!1;return H(v,V(n.goal),{fireGoal:()=>{l||(l=!0,a!==void 0?r.componentGoal(e,p,{value:a}):r.componentGoal(e,p),r.goal(p,S({metadata:{componentId:e,arm:m},weight:1,stepIndex:0},a!==void 0?{value:a}:{})))},fireStep:(y,x,C)=>{r.componentGoal(e,y,{reward:x}),r.goal(y,{metadata:{componentId:e,arm:m},weight:x,stepIndex:C})}},p)},[r,e,u,m,o]);let h=(0,J.useMemo)(()=>{let v={"data-sentient-slot":e};for(let[p,a]of Object.entries(d))v[`data-${p}`]=a;return v},[e,d]);return{tokens:d,props:h}}var ae=require("react");var en=new Set;function tn(e,t){var b;if(O()&&!t.goal)throw new Error(`[sentient] useAdaptive("${e}"): a goal is required \u2014 without one the optimizer accumulates exposures with no rewards and cannot learn. Pass e.g. goal: 'buy_click'.`);let{client:n,variantIds:r,variantId:i,isOverride:f,goalLabel:c,ref:s,nodeRef:m}=xe(e,t.variants,{goal:t.goal,funnel:t.funnel,microSignalGoals:t.microSignalGoals}),o=(b=i!=null?i:r[0])!=null?b:"",d=t.variants[o];(0,ae.useEffect)(()=>{if(!O()||!n)return;let h=setTimeout(()=>{!m.current&&!en.has(e)&&(en.add(e),console.warn(`[sentient] useAdaptive("${e}"): bind was never attached \u2014 spread {...bind} on the rendered element, otherwise exposure and goal tracking cannot work and the optimizer learns nothing.`))},0);return()=>clearTimeout(h)},[n,e]);let u=(0,ae.useCallback)((h,v)=>{var a,l;if(f)return;let p=h!=null?h:c;p&&(n==null||n.componentGoal(e,p,v),n==null||n.goal(p,S(S(S({metadata:(a=v==null?void 0:v.metadata)!=null?a:{},weight:(l=v==null?void 0:v.reward)!=null?l:1,stepIndex:0},(v==null?void 0:v.value)!==void 0?{value:v.value}:{}),(v==null?void 0:v.currency)!==void 0?{currency:v.currency}:{}),(v==null?void 0:v.externalId)!==void 0?{externalId:v.externalId}:{})))},[n,e,c,f]),g=(0,ae.useMemo)(()=>({ref:s,"data-sentient-id":e,"data-sentient-variant":o}),[s,e,o]);return{variant:o,value:d,bind:g,fireGoal:u}}var B=require("react");var rn=require("react/jsx-runtime"),Ge=new Set;function nn(e){var a;let t=E(),n=z(),r=(0,B.useRef)(null),i=Object.keys(e.arrangements).join(" "),f=(0,B.useMemo)(()=>Object.keys(e.arrangements),[i]),c=(0,B.useMemo)(()=>S({id:e.id,arms:f},e.baseline!==void 0?{baseline:e.baseline}:{}),[e.id,f,e.baseline]),{arm:s,source:m}=ke(e.id,c);O()&&e.baseline!==void 0&&e.baseline!==f[0]&&!Ge.has(e.id+":baseline")&&(Ge.add(e.id+":baseline"),console.warn(`[sentient] <AdaptiveGroup id="${e.id}">: baseline "${e.baseline}" is not the first-declared arrangement ("${f[0]}"). The first arrangement should usually be the page's real incumbent (the holdout sees it).`));let o=B.Children.toArray(e.children).filter(B.isValidElement),d=new Map;for(let l of o)d.set(String((a=l.key)!=null?a:"").replace(/^\.\$/,""),l);let u=e.arrangements[s],g=u!==void 0&&u.length===o.length&&u.every(l=>d.has(l));O()&&u!==void 0&&!g&&!Ge.has(e.id+":keys")&&(Ge.add(e.id+":keys"),console.warn(`[sentient] <AdaptiveGroup id="${e.id}">: arrangement "${s}" [${u.join(", ")}] does not match the children's keys \u2014 rendering declaration order (fail-safe).`));let b=g?u.map(l=>d.get(l)):o;(0,B.useEffect)(()=>re({id:e.id,arms:Object.keys(e.arrangements)}),[e.id]);let h=(0,B.useRef)(null);(0,B.useEffect)(()=>{!t||m==="baseline"||m==="seeded"||m==="override"||h.current===s||(h.current=s,Z(t,n,e.id,s))},[t,n,e.id,s,m]);let v=e.funnel;(0,B.useEffect)(()=>{var l;!t||!v||m==="override"||ne(t,n,e.id,v,V((l=e.goal)!=null?l:"click"))},[t,n,e.id,v,m]);let p=e.goal===void 0?null:typeof e.goal=="string"?e.goal:JSON.stringify(e.goal);return(0,B.useEffect)(()=>{if(!t||e.goal===void 0||m==="override"||m==="baseline"||m==="seeded")return;let l=r.current;if(!l)return;let y=q(e.goal),x=X(e.goal),C=!1;return H(l,V(e.goal),{fireGoal:()=>{C||(C=!0,x!==void 0?t.componentGoal(e.id,y,{value:x}):t.componentGoal(e.id,y),t.goal(y,S({metadata:{componentId:e.id,arm:s},weight:1,stepIndex:0},x!==void 0?{value:x}:{})))},fireStep:(G,A,_)=>{t.componentGoal(e.id,G,{reward:A}),t.goal(G,{metadata:{componentId:e.id,arm:s},weight:A,stepIndex:_})}},y)},[t,e.id,p,s,m]),(0,rn.jsx)("div",{ref:r,"data-sentient-id":e.id,"data-sentient-variant":s,children:b})}var Ke=require("@sentientui/core");var Bn=["page","blocks","layoutOrder"],on=new Map;function sn(e,t){on.set(e,t)}function We(e){return on.get(e)}function an(e){var i,f;let t=(f=(i=e.content)!=null?i:We(e.page))!=null?f:{},n={};for(let[c,s]of Object.entries(t))Bn.includes(c)||(n[c]=s);let r=W(S({},n),{page:e.page,blocks:e.blocks});return e.layoutOrder&&(r.layoutOrder=e.layoutOrder),r}function ln(e){return`<script type="application/ld+json">${Ue(e)}</script>`}function Ue(e){return JSON.stringify(S({"@context":"https://schema.org","@type":"WebPage"},e)).replace(/</g,"\\u003c")}function cn(e){let t=[];e.title&&t.push(`# ${e.title}`,""),e.summary&&t.push(String(e.summary),"");for(let[n,r]of Object.entries(e))["page","title","summary","blocks","layoutOrder"].includes(n)||t.push(`## ${n}`,"","```json",JSON.stringify(r,null,2),"```","");if(e.blocks.length>0){t.push("## blocks","");for(let n of e.blocks)t.push(`- **${n.id}** \u2192 variant \`${n.variant}\``),n.content!==void 0&&t.push(""," ```json",JSON.stringify(n.content,null,2)," ```");t.push("")}return t.join(`
|
|
3
3
|
`).trimEnd()+`
|
|
4
4
|
`}var un=require("@sentientui/core");0&&(module.exports={Adaptive,AdaptiveGroup,AdaptiveProvider,AdaptiveSlot,AdaptiveText,SentientPersonaScript,buildAgentFeed,defineAgentContent,detectSegment,getAgentContent,grantConsent,renderAgentJsonLd,renderAgentJsonLdBody,renderAgentMarkdown,renderBlocks,useAdaptive,useAdaptiveApiBaseUrl,useAdaptiveGoal,useAdaptivePersona,useAdaptiveTokens,useAssignment,useInitialAssignments,useLayoutOrder,usePageGoal,useSentient});
|
|
5
5
|
//# sourceMappingURL=index.js.map
|