PageSourceSearch

https://giantsquare.co/assets/CheckoutPage-B3Zu0Fnm.js

js giantsquare.co collected 2026-09-25 03:20:07 UTC 5,439 bytes, 1 lines download raw bytes

1import{ar as P,g as I,a as _,u as C,I as E,r as n,as as T,at as R,j as e,L as j,t as S}from"./index-Dd39P2ms.js";import{g as b}from"./paddle-client-CSQCoAd-.js";import{P as A}from"./pricing-B_dXw0A0.js";import{T as $}from"./ThemeToggle-CpBNbFm3.js";import{l as O}from"./index-Chyv4sIy.js";import"./dropdown-menu-CbQhl428.js";import"./check-DoxxhCdK.js";const B={vip:{monthly:"pri_01m19v0rgrwwsx5wc2jm495ax8",annual:"pri_01m19v0rkwnmppmecc27vkffnj"},creator:{monthly:"pri_01m19j20443hc7rs8668x6mvgt",annual:"pri_01m19j207b515crcj98m3g74ve"},pro:{monthly:"pri_01m19j20agmef4wat5zj6e0j44",annual:"pri_01m19j20f35rgh46r9bwnkfmap"},business:{monthly:"pri_01m19j20jfs1m1996q7a3wxj7b",annual:"pri_01m19j20ncwx4nk3jx675kqn2y"}};function D(o,c){return B[o][c]}const F=["vip","creator","pro"],G={vip:{label:"VIP",tagline:"The full photo suite",accent:"#f59e0b",includes:"Every template and layout, full photo editor, watermark-free 2x export, monthly AI photo uses."},creator:{label:"Creator",tagline:"Most creators pick this",accent:"#f97316",includes:"Post planner with auto-publish, AI captions and hashtags, 280 AI credits/month, 10 GB storage — plus the mobile apps."},pro:{label:"Pro",tagline:"Power users",accent:"#3b82f6",includes:"Everything in Creator plus 1,100 AI credits/month, full analytics, best-time insights, 25 GB storage."}};function K(){const{tier:o}=P(),[c]=I(),l=_(),{user:r,loading:m}=C(),{resolvedTheme:u}=E(),t=F.includes(o??"")?o:null,a=c.get("period")==="annual"?"annual":"monthly",[y,k]=n.useState(!1),[p,x]=n.useState(null),h=n.useRef(!1);if(n.useEffect(()=>{!m&&!r&&t&&l(`/auth?tab=signup&plan=${t}&period=${a}`,{replace:!0})},[m,r,t,a,l]),n.useEffect(()=>{!t||!r||h.current||(h.current=!0,(async()=>{const s=D(t,a);if(s.startsWith("pri_TODO_")){x("Checkout isn't configured in this environment. On the live site this works — locally the sandbox price IDs are unset.");return}const g=await b();if(!g){x("The payment form couldn't load. Refresh to try again — if it keeps happening, tell us via the Help page.");return}const f=`/checkout/success?tier=${t}&period=${a}`,w=await T()?await R(f):f;g.Checkout.open({items:[{priceId:s,quantity:1}],customer:{email:r.email??""},customData:{supabase_user_id:r.id,tier:t,period:a},settings:{displayMode:"inline",variant:"one-page",theme:u==="dark"?"dark":"light",frameTarget:"paddle-checkout-frame",frameInitialHeight:520,frameStyle:"width: 100%; background-color: transparent; border: none;",allowLogout:!1,successUrl:`${window.location.origin}${w}`}}),k(!0),S("checkout_opened",{tier:t,period:a})})())},[t,r,a,u]),n.useEffect(()=>()=>{b().then(s=>s==null?void 0:s.Checkout.close()).catch(()=>{})},[]),!t)return l("/pricing",{replace:!0}),null;const i=G[t],d=A[t],v=a==="annual"?d.yearly:d.monthly,N=a==="annual"?`Billed $${d.annual}/year`:"Billed monthly";return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("div",{className:"absolute right-4 top-4 z-10",children:e.jsx($,{})}),e.jsxs("header",{className:"flex items-center justify-between py-3.5 px-6 border-b bg-white border-gray-200 dark:bg-[#0a0a0a] dark:border-white/10",children:[e.jsxs(j,{to:"/",className:"flex items-center gap-2.5",children:[e.jsx("img",{src:O,alt:"Giant Square logo",className:"h-8 w-8 rounded-lg"}),e.jsxs("div",{className:"flex flex-col leading-tight",children:[e.jsx("span",{className:"text-[15px] font-bold tracking-tight text-gray-900 dark:text-white",style:{fontFamily:"'ProximaNova', sans-serif",fontWeight:800},children:"GIANT SQUARE"}),e.jsx("span",{className:"text-[10px] text-gray-500 dark:text-white/65 tracking-wide",style:{fontFamily:"'Open Sans', sans-serif"},children:"Create & Plan Social Content"})]})]}),e.jsx(j,{to:"/pricing",className:"text-[13px] text-muted-foreground underline underline-offset-2 hover:text-foreground pr-12",children:"Change plan"})]}),e.jsx("main",{className:"mx-auto max-w-5xl px-4 py-10",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[minmax(260px,340px)_1fr] gap-8 items-start",children:[e.jsxs("aside",{className:"rounded-2xl border bg-card p-6 md:sticky md:top-8",children:[e.jsx("div",{className:"h-1.5 w-12 rounded-full mb-4",style:{backgroundColor:i.accent}}),e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:i.label}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:i.tagline}),e.jsxs("div",{className:"mt-5 flex items-baseline gap-1",children:[e.jsxs("span",{className:"text-3xl font-bold text-foreground",children:["$",v]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"/mo"})]}),e.jsx("p",{className:"text-[13px] text-muted-foreground mt-1",children:N}),e.jsx("p",{className:"text-[13px] text-muted-foreground leading-relaxed mt-5",children:i.includes}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-6",children:"Taxes are calculated at checkout. Cancel anytime from your account."})]}),e.jsxs("section",{children:[p?e.jsx("div",{className:"rounded-xl border border-destructive/40 bg-destructive/5 p-5 text-sm text-foreground",children:p}):e.jsxs(e.Fragment,{children:[!y&&e.jsx("div",{className:"rounded-xl border bg-card p-8 text-sm text-muted-foreground",children:"Loading secure checkout…"}),e.jsx("div",{className:"paddle-checkout-frame"})]}),e.jsx("p",{className:"mt-3 text-center text-[11px] text-muted-foreground",children:"Secure checkout by Paddle — our merchant of record."})]})]})})]})}export{K 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.