1import{m as ne,A as r,e as ke,k as m,x as H,g as ye,L as we,S as xe,o as v,c as f,P as C,E as s,Q as g,a as t,d as c,t as u,U as W,a7 as M,a8 as T,ao as Ce,a6 as ae,av as A,V as Se,bR as $e,a1 as Ee,b7 as Ge,C as Y}from"./BiF1DOvY.js";import{G as Me,u as Ae,h as Be}from"./BwmnJg-W.js";import{_ as De}from"./DlAUqK2U.js";import"./BNpnu5Ph.js";import"./QHSOpUT-.js";import"./CMQnkfbD.js";const z={429:"Youâve sent a few already â weâll reply to those.",other:"Couldnât send â try again or email [email protected]"};function je(S={}){const{$plausible:h}=ne(),$=(l,k)=>{S.quiet?.()||h?.(l,k)},i=r(!1),n=r(""),d=r("");async function b(l){if(i.value)return!1;i.value=!0,n.value="",$("Gate Contact",{props:{variant:l.variant}});try{const k=await $fetch.raw("/api/stufio-lead",{method:"POST",body:{...l,locale:(navigator.language||"").slice(0,12)},ignoreResponseError:!0,timeout:12e3}),p=k._data;if(k.ok&&p?.ok&&p.redirect){try{localStorage.setItem(Me,"submitted")}catch{}return $("Gate Lead",{props:{variant:l.variant,project_type:l.project_type}}),d.value=p.redirect,!0}const w=p?.status||k.status;return $("Gate Lead Error",{props:{status:w>=500?"5xx":String(w)}}),n.value=w===422&&p?.detail?p.detail:w===429?z[429]:z.other,!1}catch{return $("Gate Lead Error",{props:{status:"network"}}),n.value=z.other,!1}finally{i.value=!1}}function E(){d.value&&window.location.assign(d.value)}return{submit:b,go:E,sending:i,error:n,redirect:d}}const Pe={key:0,class:"sg"},Te={class:"sg-pill-text"},Ne={class:"sg-accent"},Ve=["aria-modal"],_e={class:"sg-head"},Le={class:"sg-line"},Oe={class:"sg-chip-off"},Ue={id:"sg-title",class:"sg-h1"},qe={class:"sg-u"},Ie={class:"sg-ta-wrap"},Re=["placeholder","onKeydown"],Fe={class:"sg-chips"},Ke=["onClick"],He={class:"sg-foot"},We=["href"],Ye={class:"sg-offer"},ze={class:"sg-offer-t"},Xe={class:"sg-offer-s"},Qe={class:"sg-echo"},Je={class:"sg-echo-t"},Ze={class:"sg-consent"},et=["disabled"],tt={class:"sg-foot"},st=["href"],ot={id:"sg-title",class:"sg-h2",role:"status"},at={class:"sg-bar","aria-hidden":"true"},nt=["href"],lt=ke({__name:"StufioGate",props:{domain:{},ideas:{},triggerSeconds:{}},setup(S){const h=S,{$plausible:$}=ne(),i=r(null),n=r("idle"),d=r("idea"),b=r(!0),E=m(()=>b.value?"modal_desktop":"sheet_mobile"),l=r(""),k=r(null),p=r(""),w=r(""),B=r(""),x=r(!1),N=r(""),G=r(!1);let O=0;const{start:le,fired:U,arm:ie}=Ae({triggerSeconds:h.triggerSeconds}),D=(o,e)=>{U.value!=="dev"&&$?.(o,e)},y=je({quiet:()=>U.value==="dev"}),q=m(()=>Math.max(i.value?.domainPct??0,i.value?.devPct??10)),re=m(()=>{const o=i.value;return o?o.domainPct>0&&o.domainPct===o.devPct?`${o.devPct}% off ${h.domain} + its development`:o.domainPct>0?`${o.domainPct}% off ${h.domain} + ${o.devPct}% off its development`:`${o.devPct}% off development`:""}),ue=m(()=>new Date(Date.now()+(i.value?.offerDays??30)*864e5).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})),de=m(()=>p.value.trim().split(/\s+/)[0]||"there"),X=m(()=>i.value?.moreUrl||"https://stufio.com/?utm_source=nameniac&utm_medium=domain_gate&utm_content=more"),Q=m(()=>{const o=h.domain.split(".")[0].replace(/^./,a=>a.toUpperCase()),e=(h.ideas||[]).map(a=>(a||"").trim()).filter(a=>a.length>8).map(a=>a.length>110?`${a.slice(0,107).trimEnd()}â¦`:a);return e.length?e.slice(0,3):[`${o} â a SaaS for small teams, with sign-up and billing`,`An online shop on ${h.domain} with a small catalogue`,`A landing page and waitlist for my startup on ${h.domain}`]}),ce=[{label:"An online store",type:"shop"},{label:"A SaaS dashboard",type:"saas"},{label:"An AI assistant for my site",type:"assistant"}],I=r(0);let R=0;const F=m(()=>Q.value[Math.floor(I.value/110)%Q.value.length]),pe=m(()=>F.value.slice(0,Math.min(F.value.length,I.value%110)));function J(){l.value=F.value,k.value=null}function me(o){l.value=`${o.label} for ${h.domain}`,k.value=o.type}const V=m(()=>/^[^\s@,;<>()]+@[^\s@,;<>()]+\.[^\s@,;<>()]{2,}$/.test(B.value.trim())),_=m(()=>!!p.value.trim()&&V.value&&x.value),ve=m(()=>y.error.value?y.error.value:G.value&&!_.value?p.value.trim()?V.value?"Please tick the consent box.":"Check the email address.":"Add your name.":"No spam. One reply from a person."),ge=m(()=>!!y.error.value||G.value&&!_.value),j=r(null);let Z=null;function ee(o){O||(O=Date.now()),Z=document.activeElement,n.value=b.value?"modal":"sheet",D("Gate Open",{props:{variant:E.value,trigger:o}}),Y(()=>{const e=j.value;(e?.querySelector("textarea")||e?.querySelector('input:not([tabindex="-1"])')||e?.querySelector("button"))?.focu
1s()})}function L(o){d.value!=="done"&&(D("Gate Dismiss",{props:{how:o}}),n.value=b.value?"pill":"teaser",Y(()=>Z?.focus?.()))}function fe(){D("Gate Dismiss",{props:{how:"pill_close"}}),Be(),n.value="idle"}function te(){l.value.trim().length<3||(D("Gate Idea",{props:{variant:E.value,chip:k.value||"none"}}),d.value="contact",Y(()=>j.value?.querySelector('input[autocomplete="name"]')?.focus()))}const K=r(0);async function he(){if(G.value=!0,y.error.value="",!_.value||!await y.submit({idea:l.value.trim(),project_type:k.value||"other",name:p.value.trim(),email:B.value.trim(),company:b.value?w.value.trim():"",consent:x.value,website:N.value,opened_at:O,variant:E.value}))return;d.value="done";const e=performance.now(),a=P=>{K.value=Math.min(1,(P-e)/2400),K.value<1?requestAnimationFrame(a):y.go()};requestAnimationFrame(a)}function se(){D("Gate More Click",{props:{variant:E.value}})}function oe(o){if(n.value!=="modal"&&n.value!=="sheet")return;if(o.key==="Escape"){o.preventDefault(),L("escape");return}if(o.key!=="Tab"||!j.value)return;if(d.value==="idea"&&!l.value&&document.activeElement?.tagName==="TEXTAREA"&&!o.shiftKey){o.preventDefault(),J();return}if(n.value!=="modal")return;const e=[...j.value.querySelectorAll('a[href], button, textarea, input:not([tabindex="-1"])')].filter(be=>!be.hasAttribute("disabled"));if(!e.length)return;const a=e[0],P=e[e.length-1];o.shiftKey&&document.activeElement===a?(o.preventDefault(),P.focus()):!o.shiftKey&&document.activeElement===P&&(o.preventDefault(),a.focus())}return H(n,o=>{document.documentElement.style.overflow=o==="modal"?"hidden":""}),H(U,o=>{!o||ie.value!=="gate"||!i.value?.enabled||(b.value=window.matchMedia("(min-width: 1024px)").matches,b.value?ee(o==="dev"?"engaged":o):n.value="teaser")}),H(n,o=>{window.clearInterval(R),(o==="modal"||o==="sheet")&&(R=window.setInterval(()=>{I.value++},70))}),ye(async()=>{try{i.value=await $fetch("/api/stufio-gate/config")}catch{i.value=null}i.value?.enabled&&(window.addEventListener("keydown",oe),le())}),we(()=>{window.removeEventListener("keydown",oe),window.clearInterval(R),document.documentElement.style.overflow=""}),(o,e)=>(v(),xe(Ge,{to:"body"},[s(i)?.enabled&&s(n)!=="idle"?(v(),f("div",Pe,[s(n)==="modal"?(v(),f("div",{key:0,class:"sg-backdrop sg-fade","data-stufio-gate":"",onClick:e[0]||(e[0]=a=>L("backdrop"))})):C("",!0),s(n)==="pill"||s(n)==="teaser"?(v(),f("div",{key:1,class:g(["sg-pill sg-rise",{"sg-pill--mobile":s(n)==="teaser"}]),role:"region","aria-label":"stufio offer"},[e[15]||(e[15]=t("span",{class:"sg-mark sg-mark--28","aria-hidden":"true"},[t("span")],-1)),t("span",Te,[c("Want "+u(S.domain)+" live",1),e[11]||(e[11]=t("br",null,null,-1)),e[12]||(e[12]=c("in 4 weeks? ",-1)),t("span",Ne,u(s(q))+"% off",1)]),t("button",{type:"button",class:"sg-btn sg-pill-cta",onClick:e[1]||(e[1]=a=>ee("pill"))},[...e[13]||(e[13]=[c(" Get a plan ",-1),t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.6","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M5 12h14m-6-6 6 6-6 6"})],-1)])]),t("button",{type:"button",class:"sg-btn sg-pill-x","aria-label":"Hide this offer for 14 days",onClick:fe},[...e[14]||(e[14]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M18 6 6 18M6 6l12 12"})],-1)])])],2)):C("",!0),s(n)==="modal"||s(n)==="sheet"?(v(),f("div",{key:2,class:g(["sg-wrap",s(n)==="modal"?"sg-wrap--modal":"sg-wrap--sheet"])},[t("div",{ref_key:"dialog",ref:j,class:g(["sg-card sg-in",s(n)==="sheet"?"sg-card--sheet":"sg-card--modal"]),role:"dialog","aria-modal":s(n)==="modal"?"true":void 0,"aria-labelledby":"sg-title","data-stufio-gate":""},[t("div",_e,[e[17]||(e[17]=t("span",{class:"sg-mark sg-mark--22","aria-hidden":"true"},[t("span")],-1)),t("span",{class:g(s(d)==="idea"?"sg-label-main":"sg-label")},u(s(d)==="idea"?"Need help getting your project live?":s(d)==="contact"?"Step 2 of 2 · contact":"Request sent"),3),s(d)!=="done"?(v(),f("button",{key:0,type:"button",class:"sg-btn sg-x","aria-label":"Close",onClick:e[2]||(e[2]=a=>L("x"))},[...e[16]||(e[16]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M18 6 6 18M6 6l12 12"})],-1)])])):C("",!0)]),s(d)==="idea"?(v(),f(W,{key:0},[t("span",Le,[e[18]||(e[18]=c("Our studio can get your project live within a month",-1)),t("span",Oe,u(s(q))+"% off",1)]),t("span",Ue,[e[19]||(e[19]=c("Got a product in mind for ",-1)),t("span",qe,u(S.domain),1),e[20]||(e[20]=c("?",-1))]),e[27]||
1(e[27]=t("span",{class:"sg-sub"},"Describe it in a line â weâll do the rest.",-1)),t("div",Ie,[M(t("textarea",{"onUpdate:modelValue":e[3]||(e[3]=a=>A(l)?l.value=a:null),rows:"3",class:g(["sg-input sg-ta",{"sg-ring-on":s(l).trim()}]),placeholder:s(pe),"aria-label":"Your idea",maxlength:"1000",onKeydown:Ce(ae(te,["exact","prevent"]),["enter"])},null,42,Re),[[T,s(l)]]),t("button",{type:"button",class:g(["sg-btn sg-next",{"sg-next--on":s(l).trim().length>2}]),"aria-label":"Next",onClick:te},[...e[21]||(e[21]=[t("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"#0B0B0C","stroke-width":"2.6","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M5 12h14m-6-6 6 6-6 6"})],-1)])],2)]),s(l).trim()?C("",!0):(v(),f("button",{key:0,type:"button",class:"sg-btn sg-use",onClick:J},[c(" Idea for "+u(S.domain)+": ",1),e[22]||(e[22]=t("span",{class:"sg-link"},"use this",-1)),e[23]||(e[23]=c()),e[24]||(e[24]=t("kbd",null,"Tab",-1))])),t("div",Fe,[(v(),f(W,null,Se(ce,a=>t("button",{key:a.type,type:"button",class:"sg-btn sg-chip",onClick:P=>me(a)},u(a.label),9,Ke)),64))]),t("div",He,[t("button",{type:"button",class:"sg-btn sg-foot-btn",onClick:e[4]||(e[4]=a=>L("keep_browsing"))},[...e[25]||(e[25]=[c("Here for the domain? ",-1),t("span",{class:"sg-link"},"Keep browsing",-1)])]),t("a",{href:s(X),target:"_blank",rel:"noopener",class:"sg-more",onClick:se},[...e[26]||(e[26]=[c("What is stufio? ",-1),t("span",{class:"sg-u2"},"stufio.com",-1),t("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})],-1)])],8,We)])],64)):s(d)==="contact"?(v(),f("form",{key:1,class:"sg-form",novalidate:"",onSubmit:ae(he,["prevent"])},[e[32]||(e[32]=t("span",{id:"sg-title",class:"sg-h2"},"Where should we send your offer?",-1)),t("div",Ye,[t("span",ze,u(s(re)),1),t("span",Xe,[c("Reserved for you for "+u(s(i).offerDays)+" days â until "+u(s(ue))+" · code ",1),t("b",null,u(s(i).code),1)])]),t("span",Qe,[t("span",Je,"â"+u(s(l))+"â",1),t("button",{type:"button",class:"sg-btn sg-edit",onClick:e[5]||(e[5]=a=>d.value="idea")},"edit")]),t("div",{class:g(s(b)?"sg-grid":"sg-col")},[M(t("input",{"onUpdate:modelValue":e[6]||(e[6]=a=>A(p)?p.value=a:null),class:g(["sg-input",{"sg-ring-bad":s(G)&&!s(p).trim()}]),placeholder:"Name",autocomplete:"name",maxlength:"200","aria-label":"Name"},null,2),[[T,s(p)]]),s(b)?M((v(),f("input",{key:0,"onUpdate:modelValue":e[7]||(e[7]=a=>A(w)?w.value=a:null),class:"sg-input",placeholder:"Company (optional)",autocomplete:"organization",maxlength:"200","aria-label":"Company (optional)"},null,512)),[[T,s(w)]]):C("",!0)],2),M(t("input",{"onUpdate:modelValue":e[8]||(e[8]=a=>A(B)?B.value=a:null),type:"email",class:g(["sg-input",{"sg-ring-bad":s(G)&&!s(V),"sg-ring-on":s(V)}]),placeholder:"[email protected]",autocomplete:"email",maxlength:"254","aria-label":"Email"},null,2),[[T,s(B)]]),M(t("input",{"onUpdate:modelValue":e[9]||(e[9]=a=>A(N)?N.value=a:null),class:"sg-hp",name:"website",tabindex:"-1",autocomplete:"off","aria-hidden":"true"},null,512),[[T,s(N)]]),t("label",Ze,[M(t("input",{"onUpdate:modelValue":e[10]||(e[10]=a=>A(x)?x.value=a:null),type:"checkbox",class:"sg-check-input"},null,512),[[$e,s(x)]]),t("span",{class:g(["sg-check",{"sg-check--on":s(x),"sg-check--bad":s(G)&&!s(x)}]),"aria-hidden":"true"},u(s(x)?"â":""),3),e[28]||(e[28]=t("span",null,[c("stufio may contact me about this project. "),t("a",{href:"https://stufio.com/privacy",target:"_blank",rel:"noopener",class:"sg-link"},"Privacy")],-1))]),t("button",{type:"submit",class:g(["sg-btn sg-submit",{"sg-submit--off":!s(_)||s(y).sending.value}]),disabled:s(y).sending.value},[c(u(s(y).sending.value?"Sendingâ¦":`Get my ${s(q)}% offer`)+" ",1),e[29]||(e[29]=t("span",{class:"sg-submit-dot"},[t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#FF4D1F","stroke-width":"2.6","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M5 12h14m-6-6 6 6-6 6"})])],-1))],10,et),t("span",{class:g(["sg-hint",{"sg-hint--bad":s(ge)}]),role:"status"},u(s(ve)),3),t("div",tt,[t("span",null,[e[30]||(e[30]=c("Free plan · code ",-1)),t("b",null,u(s(i).code),1)]),t("a",{href:s(X),target:"_blank",rel:"noopener",class:"sg-more",onClick:se},[...e[31]||(e[31]=[c("What is stufio? ",-1),t("span",{class:"sg-u2"},"stufio.com",-1),t("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})],-1)])],8,st)])],32)):(v(),f(W,{key:2},[e[34]||(e[34]=t("span",{class:"sg-ok","aria-hidden":"true"},[t("svg",{width:"25",height:"25",viewBox:"0 0 24 24",fill:"none",stroke:"#0B0B0C","stroke-width":"2.8","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"m5 12 5 5L20 7"})])],-1)),t("span",ot,"Got it, "+u(s(de))+". Taking you to stufio.comâ¦",1),t("div",at,[t("span",{style:Ee({transform:`scaleX(${s(K)})`})},null,4)]),t("a",{href:s(y).redirect.value,class:"sg-fallback"},[...e[33]||(e[33]=[c("Not redirected? ",-1),t("span",{class:"sg-link"},"Open stufio.com",-1)])],8,nt)],64))],10,Ve)],2)):C("",!0)])):C("",!0)]))}}),mt=Object.assign(De(lt,[["__scopeId","data-v-57492617"]]),{__name:"StufioGate"});export{mt 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.