PageSourceSearch

https://impactmakersparty.com/assets/Checkout-vh9Wf5xr.js

js impactmakersparty.com collected 2026-10-09 22:40:55 UTC 13,578 bytes, 1 lines download raw bytes

1import{r as c,t as k,j as e,B as f,i as w}from"./index-C0tl93hk.js";function v(){const[d,C]=c.useState(""),[a,p]=c.useState(""),[r,b]=c.useState(1),[l,i]=c.useState(!1),[n,u]=c.useState(!1),[h,y]=c.useState(null),x=c.useRef(null),{data:m}=k.fanbasis.getProducts.useQuery(),P=k.fanbasis.createCheckoutSession.useMutation();c.useEffect(()=>{const s=new URLSearchParams(window.location.search).get("product");s&&(y(s),p(s))},[]),c.useEffect(()=>{m?.products&&!a&&!h&&p(m.products[0].id)},[m,a,h]),c.useEffect(()=>{const t=s=>{if(!s||!s.data)return;const o=s.data;(o.type==="payment.success"||o.event==="checkout.success")&&(console.log("[Fanbasis] Payment successful"),window.location.href="/purchase/success"),(o.type==="payment.failed"||o.event==="checkout.failed")&&(console.log("[Fanbasis] Payment failed"),window.location.href="/purchase/failed")};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},[]),c.useEffect(()=>{if(n&&x.current){const t=setTimeout(()=>{j(x.current)},100);return()=>clearTimeout(t)}},[n]);const F=async()=>{if(!d||!a){alert("Please enter your email and select a product");return}i(!0);try{const t=await P.mutateAsync({email:d,productId:a,quantity:r});if(t.success&&t.config)x.current=t.config,u(!0);else throw new Error("Invalid checkout configuration")}catch(t){console.error("Checkout creation failed:",t),alert("Failed to create checkout. Please try again."),i(!1)}},j=t=>{if(typeof window.PaymentCheckout<"u"){N(t);return}const s=document.createElement("script");s.src="https://cdn.embedded.fanbasis.io/embed/index.js",s.async=!0,s.onload=()=>{N(t)},s.onerror=()=>{console.error("[Fanbasis] Failed to load SDK"),alert("Failed to load Fanbasis SDK. Please try again."),u(!1),i(!1)},document.head.appendChild(s)},N=t=>{const s=document.getElementById("fanbasis-checkout-container");if(!s){console.error("[Fanbasis] Checkout container not found in DOM"),alert("Failed to initialize checkout. Please try again."),u(!1),i(!1);return}if(typeof window.PaymentCheckout>"u"){console.error("[Fanbasis] SDK not loaded"),alert("Failed to load Fanbasis SDK. Please try again."),u(!1),i(!1);return}console.log("[Fanbasis] Initializing checkout with config:",t);try{const o=window.PaymentCheckout.create(t);console.log("[Fanbasis] Checkout created successfully"),o.attachToElement(s),o.init(),console.log("[Fanbasis] Checkout initialized and attached"),i(!1)}catch(o){console.error("[Fanbasis] Checkout init failed",o),alert("Failed to initialize checkout. Please try again."),u(!1),i(!1)}},g=m?.products.find(t=>t.id===a);return e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:173",className:"min-h-screen bg-black py-12 px-4",children:e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:174",className:"w-full space-y-8",children:[e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:176",className:"text-center space-y-2 max-w-2xl mx-auto",children:[e.jsxDEV("h1",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:177",className:"text-4xl font-bold text-white",children:"Get Your Tickets"},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:177,columnNumber:11},this),e.jsxDEV("p",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:178",className:"text-gray-400",children:"Secure your spot at Impact Makers Party"},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:178,columnNumber:11},this)]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:176,columnNumber:9},this),e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:182",className:"space-y-8 max-w-2xl mx-auto lg:max-w-full",children:[!n&&e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:185",className:"bg-gray-900 border-2 border-yellow-500 rounded-lg p-6 space-y-4 max-w-2xl mx-auto",children:[e.jsxDEV("label",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:186",className:"text-sm font-bold text-yellow-500 uppercase tracking-wide",children:"Email Address"},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:186,columnNumber:15},this),e.jsxDEV("input",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:189",type:"email",placeholder:"[email protected]",value:d,onChange:t=>C(t.target.value),disabled:l,style:{color:"black",backgroundColor:"white"},className:"w-full border-2 border-yellow-500 px-4 py-3 rounded-md focus:outline-none focus:border-yellow-400 focus:ring-2 focus:ring-yellow-500"},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:189,columnNumber:15},this)]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:185,columnNumber:13},this),!n&&!h&&e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:203",className:"bg-gray-900 border-2 border-yellow-500 rounded-lg p-6 space-y-4 max-w-2xl mx-auto",children:[e.jsxDEV("label",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:204",className:"text-sm font-bold text-yellow-500 uppercase tracking-wide",children:"Select Ticket Type"},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:204,columnNumber:15},this),e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:207",className:"grid grid-cols-1 gap-3",children:m?.products.map(t=>e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:209",className:`p-4 border-2 rounded-lg cursor-pointer transition ${a===t.id?"border-yellow-500 bg-yellow-500 text-white":"border-gray-600 bg-gray-800 text-white hover:border-yellow-500"}`,onClick:()=>p(t.id),children:e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:218",className:"flex justify-between items-center",children:[e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:219",children:[e.jsxDEV("p",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:220",className:"font-bold text-sm",children:t.name},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:220,columnNumber:25},this),e.jsxDEV("p",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:221",className:`text-xs ${a===t.id?"text-yellow-100":"text-gray-400"}`,children:t.type==="subscription"?"Recurring monthly":"One-time purchase"},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:221,columnNumber:25},this)]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:219,columnNumber:23},this),e.jsxDEV("p",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:231",className:"text-sm font-bold",children:["$",(t.price/100).toFixed(2),t.type==="subscription"?"/mo":""]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:231,columnNumber:23},this)]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:218,columnNumber:21},this)},t.id,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:209,columnNumber:19},this))},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:207,columnNumber:15},this)]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:203,columnNumber:13},this),!n&&a&&e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:244",className:"bg-gray-900 border-2 border-yellow-500 rounded-lg p-6 space-y-4 max-w-2xl mx-auto",children:[e.jsxDEV("label",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:245",className:"text-sm font-bold text-yellow-500 uppercase tracking-wide",children:"Quantity"},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:245,columnNumber:15},this),e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:248",className:"flex items-center gap-2",children:[e.jsxDEV(f,{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:249",variant:"outline",size:"sm",onClick:()=>b(Math.max(1,r-1)),disabled:l||r<=1,className:"border-yellow-500 text-yellow-500 hover:bg-yellow-500 hover:text-black",children:"−"},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:249,columnNumber:17},this),e.jsxDEV("input",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:258",type:"number",min:"1",value:r,onChange:t=>b(Math.max(1,parseInt(t.target.value)||1)),className:"w-16 text-center border-2 border-yellow-500 rounded px-3 py-2 bg-gray-800 text-white",disabled:l},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:258,columnNumber:17},this),e.jsxDEV(f,{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:268",variant:"outline",size:"sm",onClick:()=>b(r+1),disabled:l,className:"border-yellow-500 text-yellow-500 hover:bg-yellow-500 hover:text-black",children:"+"},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:268,columnNumber:17},this)]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:248,columnNumber:15},this)]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:244,columnNumber:13},this),!n&&g&&e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:283",className:"bg-gray-900 border-2 border-yellow-500 rounded-lg p-6 space-y-3 max-w-2xl mx-auto",children:[e.jsxDEV("p",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:284",className:"text-sm text-gray-400 uppercase tracking-wide font-bold",children:"Order Summary"},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:284,columnNumber:15},this),e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:285",className:"flex justify-between items-center",children:[e.jsxDEV("span",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:286",className:"text-gray-300",children:[g.name," × ",r]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:286,columnNumber:17},this),e.jsxDEV("span",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:289",className:"text-2xl font-bold text-yellow-500",children:["$",(g.price*r/100).toFixed(2)]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:289,columnNumber:17},this)]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:285,columnNumber:15},this)]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:283,columnNumber:13},this),!n&&e.jsxDEV(f,{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:298",onClick:F,disabled:l||!d||!a,className:"w-full max-w-2xl mx-auto block bg-yellow-500 hover:bg-yellow-600 text-black font-bold py-4 text-lg rounded-lg",children:l?e.jsxDEV(e.Fragment,{children:[e.jsxDEV(w,{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:305",className:"mr-2 h-4 w-4 animate-spin"},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:305,columnNumber:19},this),"Creating Checkout..."]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:304,columnNumber:17},this):"Proceed to Checkout"},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:298,columnNumber:13},this),n&&e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:316",className:"w-full bg-gray-900 border-2 border-yellow-500 rounded-lg p-6 space-y-4",children:[e.jsxDEV("p",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:317",className:"text-sm text-yellow-500 uppercase tracking-wide font-bold",children:"Payment Information"},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:317,columnNumber:15},this),e.jsxDEV("div",{"data-loc":"client/src/components/FanbasisCheckoutPage.tsx:320",id:"fanbasis-checkout-container",className:"w-full bg-white rounded-lg overflow-auto",style:{minHeight:"600px"}},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:320,columnNumber:15},this)]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:316,columnNumber:13},this)]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:182,columnNumber:9},this)]},void 0,!0,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:174,columnNumber:7},this)},void 0,!1,{fileName:"/opt/render/project/src/client/src/components/FanbasisCheckoutPage.tsx",lineNumber:173,columnNumber:5},this)}function D(){return e.jsxDEV(v,{"data-loc":"client/src/pages/Checkout.tsx:4"},void 0,!1,{fileName:"/opt/render/project/src/client/src/pages/Checkout.tsx",lineNumber:4,columnNumber:10},this)}export{D 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.