PageSourceSearch

https://vizibly.io/assets/NewsletterSignup-BS6pVYoQ.js

js vizibly.io collected 2026-10-09 22:04:15 UTC 9,443 bytes, 1 lines download raw bytes

1import{n as e,o as t,t as n}from"./jsx-runtime-CfuWmoMz.js";import{u as r}from"./esm-DQtYtCHN.js";import{Bt as i,Q as a,Vt as o,_ as s,_t as c,bt as l,f as u,g as d,lt as f,o as p,s as m}from"./index-mpxfLKKR.js";import{t as h}from"./vizibly-logo-Cm3e8l-_.js";import{t as g}from"./input-WdA__HBr.js";var _=n(),v=()=>(0,_.jsx)(`header`,{className:`sticky top-0 z-50 w-full border-b border-border/40 bg-background/95 backdrop-blur`,children:(0,_.jsxs)(`div`,{className:`container flex h-20 items-center justify-between`,children:[(0,_.jsxs)(r,{to:`/blog`,className:`flex items-center gap-3`,children:[(0,_.jsx)(`img`,{src:h,alt:`Vizibly`,className:`h-7 w-auto`}),(0,_.jsx)(`span`,{className:`hidden text-sm text-muted-foreground sm:inline`,children:`/ The Final Final Draft`})]}),(0,_.jsxs)(`nav`,{className:`flex items-center gap-6`,children:[(0,_.jsx)(r,{to:`/blog`,className:`text-sm text-foreground/90 transition-colors hover:text-secondary`,children:`All Posts`}),(0,_.jsx)(r,{to:`/`,className:`rounded-full bg-secondary px-5 py-2 text-sm font-medium text-secondary-foreground transition-opacity hover:opacity-90`,children:`Visit Vizibly`})]})]})}),y=()=>(0,_.jsx)(`footer`,{className:`border-t border-border/40 bg-background py-12`,children:(0,_.jsxs)(`div`,{className:`container flex flex-col items-center justify-between gap-6 md:flex-row`,children:[(0,_.jsx)(r,{to:`/`,className:`flex items-center gap-3`,children:(0,_.jsx)(`img`,{src:h,alt:`Vizibly`,className:`h-7 w-auto`})}),(0,_.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The Final FINAL Draft, the stories behind the numbers.`}),(0,_.jsxs)(`div`,{className:`flex items-center gap-6 text-sm text-muted-foreground`,children:[(0,_.jsx)(r,{to:`/blog`,className:`transition-colors hover:text-secondary`,children:`All Posts`}),(0,_.jsx)(r,{to:`/`,className:`transition-colors hover:text-secondary`,children:`Vizibly`}),(0,_.jsx)(r,{to:`/privacy-policy`,className:`transition-colors hover:text-secondary`,children:`Privacy`})]})]})});function b(e){return new Date(`${e}T00:00:00`).toLocaleDateString(`en-US`,{year:`numeric`,month:`long`,day:`numeric`})}var x=({post:e,featured:t=!1})=>t?(0,_.jsx)(r,{to:`/blog/$slug`,params:{slug:e.slug},className:`group block rounded-2xl bg-card p-8 shadow-lg transition-transform hover:-translate-y-1 md:p-10`,children:(0,_.jsxs)(`div`,{className:`flex flex-col gap-8 md:flex-row md:items-center`,children:[(0,_.jsxs)(`div`,{className:`flex-1`,children:[(0,_.jsx)(`span`,{className:`inline-block rounded-full bg-secondary px-3 py-1 text-xs font-semibold text-secondary-foreground`,children:`Featured`}),(0,_.jsx)(`h3`,{className:`mt-5 text-2xl font-bold leading-tight text-card-foreground md:text-3xl`,children:e.title}),(0,_.jsx)(`p`,{className:`mt-4 text-base leading-relaxed text-muted-foreground`,children:e.excerpt}),(0,_.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center gap-6 text-sm text-muted-foreground`,children:[(0,_.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(c,{className:`h-4 w-4`}),` `,b(e.published_date)]}),(0,_.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(f,{className:`h-4 w-4`}),` `,e.read_time]})]}),(0,_.jsxs)(`span`,{className:`mt-6 inline-flex items-center gap-2 text-sm font-medium text-secondary`,children:[`Read article`,(0,_.jsx)(l,{className:`h-4 w-4 transition-transform group-hover:translate-x-1`})]})]}),e.thumbnail&&(0,_.jsx)(`div`,{className:`w-full overflow-hidden rounded-xl md:w-56`,children:(0,_.jsx)(`img`,{src:e.thumbnail,alt:e.title,loading:`lazy`,className:`h-44 w-full object-cover transition-transform duration-500 group-hover:scale-105`})})]})}):(0,_.jsxs)(r,{to:`/blog/$slug`,params:{slug:e.slug},className:`group flex h-full flex-col overflow-hidden rounded-2xl bg-card shadow-lg transition-transform hover:-translate-y-1`,children:[e.thumbnail&&(0,_.jsx)(`div`,{className:`aspect-video overflow-hidden`,children:(0,_.jsx)(`img`,{src:e.thumbnail,alt:e.title,loading:`lazy`,className:`h-full w-full object-cover transition-transform duration-500 group-hover:scale-105`})}),(0,_.jsxs)(`div`,{className:`flex flex-1 flex-col p-6`,children:[(0,_.jsx)(`span`,{className:`inline-block w-fit roun
1ded-full border border-border px-3 py-1 text-xs font-medium text-muted-foreground`,children:e.category}),(0,_.jsx)(`h3`,{className:`mt-4 text-xl font-bold leading-snug text-card-foreground`,children:e.title}),(0,_.jsx)(`p`,{className:`mt-3 line-clamp-3 text-sm leading-relaxed text-muted-foreground`,children:e.excerpt}),(0,_.jsxs)(`div`,{className:`mt-auto flex items-center justify-between border-t border-border/60 pt-4 text-xs text-muted-foreground`,children:[(0,_.jsx)(`span`,{children:b(e.published_date)}),(0,_.jsx)(`span`,{children:e.read_time})]})]})]}),S=t(e(),1),C=()=>{let[e,t]=(0,S.useState)(!1),[n,r]=(0,S.useState)(null),{toast:a}=i();return{submitLead:async e=>{t(!0),r(null);try{let t=m(),n={first_name:e.firstName.trim(),last_name:e.lastName.trim(),email:e.email.trim().toLowerCase(),form_name:e.formName,page_path:window.location.pathname,page_title:document.title,utm_source:t.utm_source||null,utm_medium:t.utm_medium||null,utm_campaign:t.utm_campaign||null,utm_term:t.utm_term||null,utm_content:t.utm_content||null,referrer:document.referrer||null,user_agent:navigator.userAgent||null,additional_data:e.additionalData||{}},{error:i}=await o.from(`leads`).insert([n]);return i?(console.error(`Error saving lead:`,i),r(`Failed to submit. Please try again.`),a({title:`Submission failed`,description:`Please try again later.`,variant:`destructive`}),!1):(a({title:`Success!`,description:`Thank you for subscribing.`}),!0)}catch(e){return console.error(`Error in lead capture:`,e),r(`An unexpected error occurred.`),a({title:`Error`,description:`Something went wrong. Please try again.`,variant:`destructive`}),!1}finally{t(!1)}},isSubmitting:e,error:n}},w=({formName:e,totalFields:t,trackAbandonment:n=!0})=>{let r=(0,S.useRef)(!1),i=(0,S.useRef)(new Set),a=(0,S.useRef)(!1),o=(0,S.useCallback)(()=>{r.current||(r.current=!0,u(`form_start`,{formName:e}))},[e]),s=(0,S.useCallback)(n=>{o(),i.current.add(n),u(`form_field_focus`,{formName:e,fieldName:n,fieldsCompleted:i.current.size,totalFields:t})},[e,t,o]),c=(0,S.useCallback)(()=>{a.current=!0,u(`form_submit`,{formName:e,fieldsCompleted:i.current.size,totalFields:t})},[e,t]),l=(0,S.useCallback)((t,n)=>{u(`form_error`,{formName:e,fieldName:n,errorMessage:t})},[e]);return(0,S.useEffect)(()=>()=>{n&&r.current&&!a.current&&i.current.size>0&&u(`form_abandon`,{formName:e,fieldsCompleted:i.current.size,totalFields:t})},[e,t,n]),{trackStart:o,trackFieldFocus:s,trackSubmit:c,trackError:l,getFieldProps:(0,S.useCallback)(e=>({onFocus:()=>s(e)}),[s]),fieldsCompleted:i.current.size}},T=()=>{let[e,t]=(0,S.useState)({firstName:``,lastName:``,email:``}),[n,r]=(0,S.useState)(!1),{submitLead:i,isSubmitting:o}=C(),{trackSubmit:c,getFieldProps:u}=w({formName:`newsletter_signup`,totalFields:3});return n?(0,_.jsx)(`div`,{className:`w-full max-w-2xl mx-auto`,children:(0,_.jsxs)(`div`,{className:`border border-primary/30 rounded-xl p-8 bg-background text-center`,children:[(0,_.jsx)(`h3`,{className:`text-xl font-semibold text-foreground mb-2`,children:`You're on the list! 🎉`}),(0,_.jsx)(`p`,{className:`text-muted-foreground`,children:`Thanks for subscribing. We'll be in touch soon.`})]})}):(0,_.jsxs)(`div`,{className:`w-full max-w-2xl mx-auto`,children:[(0,_.jsx)(`form`,{onSubmit:async n=>{n.preventDefault(),!(!e.firstName||!e.lastName||!e.email)&&await i({firstName:e.firstName,lastName:e.lastName,email:e.email,formName:`newsletter_signup`})&&(typeof window<`u`&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:`form_submission`,first_name:e.firstName,last_name:e.lastName,full_name:`${e.firstName} ${e.lastName}`.trim(),email_address:e.email})),d(e.email,{source:`form_submit`,firstName:e.firstName,lastName:e.lastName,type:`Form Submission`}),s(`form_submission`),c(),r(!0),t({firstName:``,lastName:``,email:``}))},children:(0,_.jsxs)(`div`,{className:`border border-primary/30 rounded-xl p-6 bg-background`,children:[(0,_.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4`,children:[(0,_.jsx)(g,{type:`text`,placeholder:`First name`,value:e.firstName,onChange:e=>t(t=>({...t,firstName:e.target.value})),className:`h-14 text-base bg-background border-border`,required:!0,...u(`firstName`)}),(0,_.jsx)(g,{type:`text`,placeholder:`Last name`,value:e.lastName,onChange:e=>t(t=>({...t,lastName:e.target.value})),className:`h-14 text-base bg-background border-border`,required:!0,...u(`lastName`)})]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-[1fr_auto] gap-4`,children:[(0,_.jsx)(g,{type:`email`,placeholder:`Enter your email`,value:e.email,onChange:e=>t(t=>({...t,email:e.target.value})),className:`h-14 text-base bg-background border-border`,required:!0,...u(`email`)}),(0,_.jsx)(p,{type:`submit`,size:`lg`,className:`h-14 px-8 bg-secondary hover:bg-secondary text-secondary-foreground font-semibold`,disabled:o,children:o?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(a,{className:`mr-2 h-4 w-4 animate-spin`}),`Submitting...`]}):(0,_.jsxs)(_.Fragment,{children:[`Subscribe `,(0,_.jsx)(l,{className:`ml-2 h-4 w-4`})]})})]})]})}),(0,_.jsx)(`p`,{className:`text-center text-muted-foreground mt-4 text-sm`,children:`Join our newsletter — no spam, unsubscribe anytime.`})]})};export{v as i,x as n,y as r,T as t};

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.