PageSourceSearch

https://getvsble.com/assets/NewPricingBlocker-CMlK3SBq.js

js getvsble.com collected 2026-10-09 04:52:42 UTC 8,167 bytes, 1 lines download raw bytes

1import{u as I,a as O,r as i,s as j,j as e,B as b,W as m,A as p,y as S,z as _}from"./index-ByYYWl6V.js";const T=["/auth","/share","/book","/privacy","/terms"],B=["All templates and website features","Canvas Pages","Blog","Unlimited uploads and bandwidth","Everything previously included in VSBLE MAX"],$=["File Sharing & Backup","Calendar","Invoice & Estimate Creator","AI Brand Monitor"];function W(l){if(!l)return"the end of your current billing period";const o=new Date(`${l.slice(0,10)}T12:00:00`);return Number.isNaN(o.getTime())?"the end of your current billing period":new Intl.DateTimeFormat("en",{day:"numeric",month:"long",year:"numeric"}).format(o)}function L(){const{user:l}=I(),{pathname:o}=O(),[r,f]=i.useState(null),[h,N]=i.useState({website:"yearly",allInOne:"yearly"}),[a,c]=i.useState(null),[E,x]=i.useState(null),[g,A]=i.useState(null);if(i.useEffect(()=>{if(!l){f(null);return}let n=!1;return j.functions.invoke("pricing-banner",{body:{action:"status"}}).then(({data:t})=>{n||(f(t??{show:!1}),(t==null?void 0:t.billing)==="monthly"&&N({website:"monthly",allInOne:"monthly"}))}),()=>{n=!0}},[l==null?void 0:l.id]),!(r!=null&&r.show)||o==="/"||T.some(n=>o.startsWith(n)))return null;const v=async n=>{c("accept"),x(null);const t=h[n],u=n==="website"?S.eur[t]:_.eur[t],{data:s,error:w}=await j.functions.invoke("create-checkout",{body:{priceId:u,currency:"eur",skipTrial:!0,migrationEndDate:(r==null?void 0:r.renews_on)??null}});if(s!=null&&s.url){window.location.href=s.url;return}x((s==null?void 0:s.error)||(w==null?void 0:w.message)||"Checkout could not be opened. Please try again."),c(null)},k=async()=>{if(!window.confirm("Your subscription will end at the end of the current period and your website will go offline then. Continue?"))return;c("decline"),x(null);const{data:n}=await j.functions.invoke("pricing-banner",{body:{action:"decline"}});if(n!=null&&n.ok){A(n.ends_on??""),c(null);return}x((n==null?void 0:n.message)||"Could not process your choice. Please try again."),c(null)};if(g!==null)return e.jsx("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center bg-background/95 p-6",children:e.jsxs("div",{className:"max-w-md w-full rounded-xl border border-border bg-card p-8 space-y-4 text-center",children:[e.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Subscription cancelled"}),e.jsxs("p",{className:"text-muted-foreground",children:["Your website stays online",g?` until ${g}`:" until the end of your paid period",". You can resubscribe anytime."]}),e.jsx(b,{className:"w-full",onClick:()=>f({show:!1}),children:"Continue"})]})});const d=W(r.renews_on),C=(n,t)=>{N(u=>({...u,[n]:t}))},y=({plan:n,cycle:t,label:u})=>{const s=h[n]===t;return e.jsxs("label",{className:`flex min-h-11 cursor-pointer items-center gap-3 rounded-md border px-3 py-2 text-sm transition-colors ${s?"border-primary bg-secondary/60":"border-border bg-card"}`,children:[e.jsx("input",{type:"radio",name:`${n}-billing`,value:t,checked:s,onChange:()=>C(n,t),className:"h-4 w-4 accent-primary"}),e.jsx("span",{className:"font-semibold text-foreground",children:u})]})};return e.jsx("div",{className:"pricing-migration-screen fixed inset-0 z-[1000] overflow-y-auto bg-background text-foreground",children:e.jsxs("main",{className:"mx-auto flex min-h-full w-full max-w-[960px] flex-col justify-center px-5 py-10 sm:px-8 sm:py-14",children:[e.jsxs("header",{className:"mx-auto mb-8 max-w-2xl text-center",children:[e.jsx("h1",{className:"text-2xl font-bold uppercase sm:text-3xl",children:"Choose how you want to continue"}),e.jsxs("p",{className:"mt-5 text-sm leading-6 text-muted-foreground",children:["We’re retiring our legacy subscriptions. We hereby terminate your current subscription, in accordance with its notice period, effective ",d,"."]}),e.jsxs("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:["Until then, you keep full access at your current price. To keep your website online after ",d,", choose one of our new plans below."]})]}),e.jsxs("section",{className:"grid gap-5 md:grid-cols-2",children:[e.jsxs("article",{className:"flex flex-col rounded-lg border border-border bg-card p-6",children:[e.jsx("h2",{className:"text-sm font-bold uppercase",children:"Website"}),e.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"Everything you need to create and publish your complete website:"}),e.jsx("ul",{className:"mt-4 space-y-2 text-sm",children:B.map(n=>e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{"aria-hidden":"true",children:"✓"}),e.jsx("span",{children:n})]},n))}),e.jsxs("div",{className:"mt-auto space-y-2 pt-6",children:[e.jsx(y,{plan:"website",cycle:"monthly",label:`€${m.monthly}/month — billed monthly`}),e.jsx(y,{plan:"website",cycle:"yearly",label:`€${m.yearly/12}/month — €${m.yearly} billed yearly`}),e.jsx(b,{className:"mt-2 w-full uppercase",onClick:()=>v("website"),disabled:!!a,children:a==="accept"?"Opening checkout…":h.website==="yearly"?`Choose Website — €${m.yearly}/year`:`Choose Website — €${m.monthly}/month`})]})]}),e.jsxs("article",{className:"flex flex-col rounded-lg border-2 border-primary bg-card p-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsx("h2",{className:"text-sm font-bold uppercase",children:"All-in-One"}),e.jsx("span",{className:"rounded-full bg-primary px-3 py-1 text-[10px] font-bold uppercase tracking-widest text-primary-foreground",children:"Best value"})]}),e.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"Everything in Website, plus:"}),e.jsx("ul",{className:"mt-4 space-y-2 text-sm",children:$.map(n=>e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{"aria-hidden":"true",children:"✓"}),e.jsx("span",{children:n})]},n))}),e.jsxs("div",{className:"mt-auto space-y-2 pt-6",children:[e.jsx(y,{plan:"allInOne",cycle:"monthly",label:`€${p.monthly}/month — billed monthly`}),e.jsx(y,{plan:"allInOne",cycle:"yearly",label:`€${p.yearly/12}/month — €${p.yearly} billed yearly`}),e.jsx(b,{className:"mt-2 w-full uppercase",onClick:()=>v("allInOne"),disabled:!!a,children:a==="accept"?"Opening checkout…":h.allInOne==="yearly"?`Choose All-in-One — €${p.yearly}/year`:`Choose All-in-One — €${p.monthly}/month`})]})]})]}),e.jsxs("section",{className:"mt-5 rounded-lg bg-secondary p-6",children:[e.jsx("h2",{className:"text-xs font-bold uppercase",children:"Need only one additional app?"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Each All-in-One app can also be added separately to the Website plan for €10/month per app."}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"However, All-in-One costs less than combining Website with even one individual app—and gives you the complete suite."})]}),e.jsxs("section",{className:"mt-5 rounded-lg border border-border bg-card p-6",children:[e.jsx("h2",{className:"text-xs font-bold uppercase",children:"Don’t want to switch?"}),e.jsxs("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:["You can continue using your current plan at its existing price until ",d,". Your subscription will then end automatically, your website will go offline, and n
1o further payments will be taken."]}),e.jsx(b,{variant:"outline",className:"mt-4 w-full uppercase",onClick:k,disabled:!!a,children:a==="decline"?"Processing…":`Use current plan until ${d}, then end`})]}),E&&e.jsx("p",{role:"alert",className:"mt-5 text-sm font-medium text-destructive",children:E}),e.jsxs("footer",{className:"mt-7 space-y-2 text-xs leading-5 text-muted-foreground",children:[e.jsx("p",{children:"All prices exclude VAT. VAT is added at checkout where applicable. Businesses with a valid EU VAT ID can deduct VAT."}),e.jsx("p",{children:"Annual plans are paid in advance and renew yearly. Monthly plans renew monthly. Both can be cancelled at any time, effective at the end of the current billing period."}),e.jsxs("p",{children:["By selecting a plan, you enter into a paid subscription beginning on ",d,". The selected billing amount will be charged on that date."]})]})]})})}export{L as NewPricingBlocker};

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.