1import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n}from"./framework-DJH1pfSr.js";import{c as r}from"./client-CmOHgZho.js";import{t as i}from"./navigation-DK41M7fL.js";import{t as a}from"./utils-DXalBF5w.js";import{t as o}from"./check-CX-FwU1S.js";import{t as s}from"./loader-circle-Cxy4jRlv.js";import{a as c,i as l}from"./track-BUg7VPxk.js";import{n as u}from"./auth-modal-provider-DuyXTIp9.js";import{t as d}from"./pricing-Bj9eNs_o.js";var f=e(t(),1),p=n(),m=[{name:`Visa`,logo:`https://cdn.simpleicons.org/visa/1434CB`},{name:`Mastercard`,logo:`https://cdn.simpleicons.org/mastercard/EB001B`},{name:`American Express`,logo:`https://cdn.simpleicons.org/americanexpress/2E77BC`},{name:`UnionPay`,logo:`/imgs/payment-methods/unionpay.svg`},{name:`JCB`,logo:`https://cdn.simpleicons.org/jcb/0B4EA2`},{name:`Apple Pay`,logo:`https://cdn.simpleicons.org/applepay/000000`},{name:`Google Pay`,logo:`https://cdn.simpleicons.org/googlepay/4285F4`},{name:`Link`,logo:`/imgs/payment-methods/link.svg`},{name:`Bancontact`,logo:`/imgs/payment-methods/bancontact.svg`},{name:`iDEAL`,logo:`/imgs/payment-methods/ideal.svg`}],h=[0,1];function g(e){return/^(https?:|mailto:|tel:)/.test(e)}function _({title:e,subtitle:t,modes:n,defaultMode:r,plans:i,creditsTitle:o,supportEmail:s,payment:l,className:u}){let d=r===`annual`?`annual`:`monthly`,[g,_]=(0,f.useState)(d),[y,b]=(0,f.useState)(r===`credits`?`credits`:d);(0,f.useEffect)(()=>{c(`pricing_view`,{source:`pricing_page`})},[]);let x=i[g]??[],S=i.credits??[],C=e=>{if(b(e),e===`annual`||e===`monthly`){_(e);return}requestAnimationFrame(()=>{document.getElementById(`credit-packs`)?.scrollIntoView({behavior:`smooth`,block:`start`})})};return(0,p.jsxs)(`section`,{id:`pricing`,className:a(`relative flex flex-col px-5 py-16 md:px-6 md:py-20`,u),children:[(0,p.jsxs)(`div`,{className:`mx-auto mb-10 flex max-w-[800px] flex-col items-center gap-3 text-center`,children:[(0,p.jsx)(`h2`,{className:`amt-section-banner text-[24px] md:text-[32px]`,children:(0,p.jsx)(`span`,{children:e})}),(0,p.jsx)(`p`,{className:`text-[15px] text-[var(--amt-text-muted)]`,children:t})]}),(0,p.jsx)(`div`,{role:`tablist`,"aria-label":e,className:`mx-auto mb-10 flex w-full max-w-[1200px] flex-wrap items-center justify-center gap-2`,children:n.map(e=>{let t=e.id===y;return(0,p.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t,onClick:()=>C(e.id),className:a(`amt-label cursor-pointer border-[3px] border-[var(--amt-ink)] px-5 py-2.5 text-[13px] transition-all`,t?`bg-[var(--amt-accent)] text-white shadow-[4px_4px_0_0_var(--amt-ink)]`:`bg-[var(--amt-paper)] text-[var(--amt-ink)] hover:-translate-y-0.5`),children:e.label},e.id)})}),(0,p.jsx)(`div`,{className:`mx-auto grid w-full max-w-[1200px] grid-cols-3 gap-5 max-[1068px]:grid-cols-2 max-[734px]:grid-cols-1`,children:x.map(e=>(0,p.jsx)(v,{plan:e},`${g}-${e.name}`))}),(0,p.jsxs)(`div`,{id:`credit-packs`,className:`mx-auto mt-14 w-full max-w-[1200px] scroll-mt-[calc(var(--amt-header-h)+16px)]`,children:[(0,p.jsx)(`div`,{className:`mb-8 flex justify-center`,children:(0,p.jsx)(`h3`,{className:`amt-section-banner text-[20px] md:text-[26px]`,children:(0,p.jsx)(`span`,{children:o})})}),(0,p.jsx)(`div`,{className:`grid grid-cols-3 gap-5 max-[1068px]:grid-cols-2 max-[734px]:grid-cols-1`,children:S.map(e=>(0,p.jsx)(v,{plan:e},`credits-${e.name}`))})]}),(0,p.jsxs)(`div`,{className:`mx-auto mt-14 w-full max-w-[1200px] border-t border-[var(--amt-ink)]/15 pt-8 text-center`,children:[(0,p.jsx)(`p`,{className:`amt-label text-[12px] tracking-wide text-[var(--amt-text-muted)]`,children:l.title}),(0,p.jsx)(`div`,{className:`amt-payment-marquee mx-auto mt-5 max-w-5xl`,children:(0,p.jsx)(`div`,{className:`amt-payment-track flex w-max`,children:h.map(e=>(0,p.jsx)(`div`,{"aria-hidden":e===1,className:`flex shrink-0 gap-3 pr-3`,children:m.map(t=>(0,p.jsx)(`span`,{className:`flex h-11 min-w-32 shrink-0 items-center justify-center border border-[var(--amt-ink)]/12 bg-[var(--amt-paper)]/80 px-4`,children:(0,p.jsx)(`img`,{src:t.logo,alt:t.name,className:`h-5 max-w-20 object-contain opacity-80`})},`${e}-${t.name}`))},e))})}),(0,p.jsx)(`p`,{className:`mt-4 text-[13px] text-[var(--amt-text-muted)]`,children:l.note}),(0,p.jsxs)(`p`,{className:`mt-3 text-[14px] text-[var(--amt-text-muted)]`,children:[l.billingSupport,` `,(0,p.jsx)(`a`,{href:`mailto:${s}`,className:`font-semibold text-[var(--amt-accent)] underline-offset-2 hover:underline`,children:s})]})]})]})}function v({plan:e}){let{data:t}=r(),{openAuth:n}=u(),[m,h]=(0,f.useState)(!1),[_,v]=(0,f.useState)(null);
1async function y(){if(v(null),e.productId){if(c(`plan_select`,{plan:e.productId,source:`pricing_page`}),!t?.user){c(`feature_gate_hit`,{feature:`checkout`,source:`pricing`}),n({mode:`sign-in`,callbackUrl:`/#pricing`,source:`pricing`});return}h(!0);try{let t=d(e.productId),n=typeof t?.priceInCents==`number`?t.priceInCents/100:void 0,r=(t?.currency||`usd`).toUpperCase(),i=await(await fetch(`/api/payment/checkout`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({product_id:e.productId,payment_provider:`stripe`,redirect:`/?success=1#pricing`})})).json();if(i.code===0&&i.data?.checkout_url){l({plan:e.productId,payment_provider:`stripe`,source:`pricing_page`,revenue:n,currency:r}),c(`begin_checkout`,{plan:e.productId,payment_provider:`stripe`,source:`pricing_page`,...typeof n==`number`?{revenue:n,currency:r}:{}}),window.location.href=i.data.checkout_url;return}v(i.message||`Checkout failed`)}catch(e){v(e?.message||`Checkout failed`)}finally{h(!1)}}}let b=(0,p.jsxs)(`span`,{className:`amt-btn-primary mt-auto inline-flex w-full items-center justify-center gap-2 text-[13px]`,children:[m?(0,p.jsx)(s,{className:`size-3.5 animate-spin`}):null,e.cta.label]});return(0,p.jsxs)(`div`,{className:a(`relative flex flex-col border-[4px] border-[var(--amt-ink)] bg-[var(--amt-paper)] px-7 py-7`,`shadow-[6px_6px_0_0_rgba(28,28,24,0.15)] transition-all hover:-translate-y-1 hover:shadow-[8px_8px_0_0_var(--amt-ink)]`,e.highlighted&&`ring-4 ring-[var(--amt-accent)] ring-offset-2`),children:[e.savePercent?(0,p.jsx)(`span`,{className:`absolute -top-3 left-4 inline-flex border-2 border-[var(--amt-ink)] bg-[var(--amt-accent)] px-2.5 py-0.5 text-[10px] font-black tracking-wide text-white uppercase shadow-[2px_2px_0_0_var(--amt-ink)]`,children:e.savePercent}):null,(0,p.jsx)(`h3`,{className:`amt-heading text-[20px] text-[var(--amt-ink)] uppercase`,children:e.name}),(0,p.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-baseline gap-x-2`,children:[e.originalPrice?(0,p.jsx)(`span`,{className:`text-[16px] font-semibold text-[var(--amt-text-muted)] line-through`,children:e.originalPrice}):null,(0,p.jsx)(`span`,{className:`amt-heading text-[40px] leading-[1.1] text-[var(--amt-ink)]`,children:e.price}),e.period?(0,p.jsx)(`span`,{className:`text-[14px] text-[var(--amt-text-muted)]`,children:e.period}):null]}),e.billingNote?(0,p.jsx)(`p`,{className:`mt-1 text-[12px] font-medium text-[var(--amt-text-muted)]`,children:e.billingNote}):null,e.unitPrice?(0,p.jsx)(`p`,{className:`mt-2 text-[13px] font-semibold text-[var(--amt-accent)]`,children:e.unitPrice}):null,(0,p.jsx)(`p`,{className:`mt-4 text-[14px] leading-[18.2px] font-normal text-[var(--mt-text)]`,children:e.translations}),e.bonusTranslations?(0,p.jsx)(`p`,{className:`mt-1 text-[14px] leading-[18.2px] font-normal text-[var(--mt-accent)]`,children:e.bonusTranslations}):null,(0,p.jsx)(`div`,{"aria-hidden":`true`,className:`my-3 h-px w-full bg-[var(--mt-border)]`}),(0,p.jsx)(`ul`,{className:`mt-2 mb-6 flex flex-col gap-2`,children:e.features.map(e=>(0,p.jsxs)(`li`,{className:`relative pl-6 text-[14px] leading-[18.2px] font-normal text-[var(--mt-text-secondary)]`,children:[(0,p.jsx)(o,{size:14,"aria-hidden":`true`,className:`absolute top-[2px] left-0 text-[var(--mt-accent)]`}),e]},e))}),e.productId?(0,p.jsx)(`button`,{type:`button`,onClick:()=>void y(),disabled:m,className:`mt-auto flex w-full disabled:opacity-70`,children:b}):g(e.cta.href)?(0,p.jsx)(`a`,{href:e.cta.href,className:`mt-auto flex w-full`,rel:`noopener noreferrer`,children:b}):(0,p.jsx)(i,{href:e.cta.href,className:`mt-auto flex w-full`,children:b}),_?(0,p.jsx)(`p`,{className:`mt-2 text-[12px] text-[var(--mt-danger)]`,children:_}):null]})}export{_ as PricingTabs};
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.