PageSourceSearch

https://cbnamazonia.com/assets/FeatureDiscoveryToast-lktjUkH1.js

js cbnamazonia.com collected 2026-10-03 20:29:18 UTC 3,238 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-editor-BX0sR0z-.js";import{u as N,f as T,r as o}from"./vendor-react-BPk9u-w4.js";import{u as A}from"./useModalSystem-2xu77H5c.js";import{d as R,m as n,h as D,l as C}from"./index-s_BTi5XF.js";import{A as M}from"./index-T0bE9RkD.js";import{A as S,X as I}from"./vendor-icons-XRoHuOlC.js";import"./vendor-charts-Cf-ruFca.js";import"./vendor-ui-utils-Bbg69IUi.js";import"./localStorageKeys-qVm_sJes.js";import"./vendor-graph-Df3mHyA7.js";import"./vendor-supabase-UBwEW4nm.js";import"./vendor-sonner-DPZ7yCFm.js";import"./vendor-helmet-C74EPpLp.js";const J=()=>{const l=N(),y=T(),{shouldShow:b,markAsSeen:u,trackCTA:v,trackDismiss:g,isReady:d}=A(),{currentPortal:_}=R(),w=_.id,[t,m]=o.useState(null),[j,c]=o.useState(!1),a=o.useRef(null),f=o.useRef(!1),p=async h=>{const r=h||(t==null?void 0:t.id);r&&(a.current&&clearTimeout(a.current),g(r,0),c(!1),setTimeout(()=>m(null),300),await u(r))};o.useEffect(()=>!d||f.current?void 0:(f.current=!0,(async()=>{var r;try{const{data:i}=await D.from("platform_modals").select("id, title, cta_label, cta_url, target_routes").or(`portal_id.is.null,portal_id.eq.${w}`).eq("modal_type","feature_discovery").eq("is_active",!0).order("priority");if(!i||i.length===0)return;for(const s of i)if(((r=s.target_routes)==null?void 0:r.some(x=>l.pathname===x||l.pathname.startsWith(x+"/")))&&b(s.id,l.pathname)){m({id:s.id,title:s.title,cta_label:s.cta_label,cta_url:s.cta_url}),setTimeout(()=>c(!0),2e3),a.current=setTimeout(()=>{p(s.id)},1e4);break}}catch(i){C.warn("[FeatureDiscovery] Failed to load:",i)}})(),()=>{a.current&&clearTimeout(a.current)}),[d,l.pathname]);const k=async()=>{t&&(a.current&&clearTimeout(a.current),v(t.id,"primary",{destination:t.cta_url}),c(!1),await u(t.id),t.cta_url&&y(t.cta_url))};return t?e.jsx(M,{children:j&&e.jsx(n.div,{initial:{y:-60,opacity:0},animate:{y:0,opacity:1},exit:{y:-60,opacity:0},transition:{type:"spring",damping:25,stiffness:300},className:"fixed top-4 left-1/2 -translate-x-1/2 z-[999998] w-[94%] max-w-md",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl border border-slate-200 px-5 py-3.5 flex items-center gap-3",children:[e.jsx("div",{className:"relative shrink-0",children:e.jsx(n.div,{className:"w-2 h-2 rounded-full bg-violet-500",animate:{scale:[1,1.4,1],opacity:[1,.6,1]},transition:{duration:2,repeat:1/0,ease:"easeInOut"}})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("p",{className:"text-sm font-medium text-slate-800 truncate",children:t.title})}),t.cta_label&&e.jsxs("button",{onClick:k,className:"shrink-0 flex items-center gap-1 px-3 py-1.5 bg-slate-900 text-white text-xs font-semibold rounded-full hover:bg-black transition-colors",children:[t.cta_label,e.jsx(S,{size:12})]}),e.jsx("button",{onClick:()=>p(),className:"shrink-0 w-6 h-6 flex items-center justify-center rounded-full text-slate-400 hover:text-slate-700 hover:bg-slate-100 transition-colors",children:e.jsx(I,{size:14})}),e.jsx(n.div,{className:"absolute bottom-0 left-4 right-4 h-0.5 bg-violet-500/20 rounded-full overflow-hidden",children:e.jsx(n.div,{className:"h-full bg-violet-500 rounded-full",initial:{width:"100%"},animate:{width:"0%"},transition:{duration:10,ease:"linear"}})})]})})}):null};export{J as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.