1import{r as p,j as e,o as _,m as c,at as z,s as O}from"./index-C6ghbvAw.js";import{S as T}from"./SEOMetadata-oGnP-5Az.js";import{u as I}from"./useSEO-BxZ-huKq.js";import{u as D,a as E}from"./zod-D9ZET7fj.js";import{B as M}from"./button-BbS7p2-k.js";import{C as k,b as B,a as $}from"./card-DcpNRYUu.js";import{I as d}from"./input-Cbwh2FhS.js";import{T as H}from"./textarea-8GBgRy3q.js";import{S as h,a as j,b as u,c as y,d as r}from"./select-BFGQXtCb.js";import{F as V,a as t,b as n,c as i,d as o,e as a}from"./form-CKEV6D41.js";import{t as f}from"./use-toast-C3nhwJwR.js";import R from"./Footer-D8VzQGBK.js";import{H as U}from"./Header-Ds9I6hWI.js";import W from"./FloatingWhatsApp-CdSytqGl.js";import{u as L,P as K}from"./PaymentTestModeBanner-v21_WOpX.js";import{d as Y,c as q,D as G,a as J}from"./dialog-CPKHOkbx.js";import{S as Q}from"./sun-b-7CMHGl.js";import"./useQuery-vdPRfJTf.js";import"./index-C2P2Lrb-.js";import"./index-C0pbmnxW.js";import"./index-BHqJpBG2.js";import"./index-DHsQl3TH.js";import"./index-C-eifxmw.js";import"./chevron-down-lfBaL0Tq.js";import"./createLucideIcon-Dy-MC8t5.js";import"./check-Rn0oPDsL.js";import"./label-tIvJrmCc.js";import"./badge-check-Csojkx9G.js";import"./linkedin-BEoJGbsh.js";import"./index-BrhRmS2u.js";import"./search-tVy8geSf.js";import"./arrow-right-bSGT2rVi.js";import"./clock-C4VYBqaB.js";import"./sparkles-aNfXL2wy.js";import"./wrench-CXoXdtfi.js";import"./phone-CUUs3bXf.js";import"./x-Bp_ez2j9.js";import"./message-circle-CgS41cO6.js";import"./index-BvIpehNu.js";const X=_({fullName:c().trim().min(2).max(100),email:c().trim().email().max(255),phone:c().trim().min(10).max(20),serviceAddress:c().trim().min(5).max(200),systemSize:z.number().min(1).max(100),roofType:c().min(1),electricalPanelSize:c().min(1),averageMonthlyBill:c().max(50).optional(),propertyOwnership:c().min(1),projectDetails:c().max(1e3).optional()}),Z=()=>{const{businessName:b}=I(),[g,x]=p.useState(!1),[w,v]=p.useState(null),{openCheckout:N,closeCheckout:C,isOpen:A,checkoutElement:F}=L();p.useEffect(()=>{if(typeof window>"u")return;const m=new URLSearchParams(window.location.search).get("payment");m==="success"?(v("success"),f({title:"Payment Successful!",description:"Our solar team will c
1ontact you within 24 hours."})):m==="cancelled"&&(v("cancelled"),f({title:"Payment Cancelled",description:"You can resubmit your order at any time.",variant:"destructive"}))},[]);const l=D({resolver:E(X),defaultValues:{fullName:"",email:"",phone:"",serviceAddress:"",systemSize:7,roofType:"",electricalPanelSize:"",averageMonthlyBill:"",propertyOwnership:"",projectDetails:""}}),P=async s=>{x(!0);try{const{data:m,error:S}=await O.from("solar_installation_orders").insert({full_name:s.fullName,email:s.email,phone:s.phone,service_address:s.serviceAddress,system_size:s.systemSize,roof_type:s.roofType,electrical_panel_size:s.electricalPanelSize,average_monthly_bill:s.averageMonthlyBill||null,property_ownership:s.propertyOwnership,project_details:s.projectDetails||null}).select().single();if(S)throw S;N({priceId:"solar_installation_500_cad",customerEmail:s.email,orderId:m?.id,orderTable:"solar_installation_orders",orderDescription:`Solar installation deposit (${s.systemSize} kW)`,returnUrl:`${window.location.origin}/solar-installation-order?payment=success&session_id={CHECKOUT_SESSION_ID}`}),x(!1)}catch(m){console.error(m),f({title:"Submission Failed",description:"Please try again or call (587) 557-5494.",variant:"destructive"}),x(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(T,{title:"Order Solar Installation | Crescent Electric Fort McMurray",description:"Book your residential solar installation in Fort McMurray. $500 design & site-assessment deposit, credited toward final install.",siteUrl:"/solar-installation-order",siteName:b}),e.jsx(U,{}),e.jsxs("main",{className:"min-h-screen",children:[e.jsx(K,{}),e.jsx(Y,{open:A,onOpenChange:s=>{s||C()},children:e.jsxs(q,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsx(G,{children:e.jsx(J,{children:"Complete your payment"})}),F]})}),e.jsx("section",{className:"bg-gradient-to-b from-primary/10 to-background py-20",children:e.jsxs("div",{className:"container mx-auto px-4 max-w-3xl text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-6",children:e.jsx(Q,{className:"w-8 h-8 text-primary"})}),e.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:"Solar Installation"}),e.jsx("p",{className:"text-xl text-muted-foreground mb-6",children:"Reserve your spot on our solar install schedule. The $500 deposit covers design, load calculation and on-site assessment, and is credited toward your final invoice."}),e.jsxs("div",{className:"inline-flex items-center gap-2 px-6 py-3 bg-primary/10 rounded-full",children:[e.jsx("span",{className:"text-2xl font-bold text-primary",children:"$500 CAD"}),e.jsx("span",{className:"text-muted-foreground",children:"design deposit"})]})]})}),w==="success"&&e.jsx("section",{className:"py-8 bg-green-50 dark:bg-green-950",children:e.jsxs("div",{className:"container mx-auto px-4 max-w-3xl text-center",children:[e.jsx("h2",{className:"text-2xl font-bold text-green-900 dark:text-green-100 mb-2",children:"Payment Successful"}),e.jsx("p",{className:"text-green-700 dark:text-green-300",children:"Our solar team will reach out within 24 hours to begin your design."})]})}),e.jsx("section",{className:"py-16",children:e.jsx("div",{className:"container mx-auto px-4 max-w-2xl",children:e.jsxs(k,{children:[e.jsx(B,{children:e.jsx("h2",{className:"text-2xl font-bold",children:"Project details"})}),e.jsx($,{children:e.jsx(V,{...l,children:e.jsxs("form",{onSubmit:l.handleSubmit(P),className:"space-y-6",children:[e.jsx(t,{control:l.control,name:"fullName",render:({field:s})=>e.jsxs(n,{children:[e.jsx(i,{children:"Full name"}),e.jsx(o,{children:e.jsx(d,{...s})}),e.jsx(a,{})]})}),e.jsx(t,{control:l.control,name:"email",render:({field:s})=>e.jsxs(n,{children:[e.jsx(i,{children:"Email"}),e.jsx(o,{children:e.jsx(d,{type:"email",...s})}),e.jsx(a,{})]})}),e.jsx(t,{control:l.control,name:"phone",render:({field:s})=>e.jsxs(n,{children:[e.jsx(i,{children:"Phone"}),e.jsx(o,{children:e.jsx(d,{type:"tel",...s})}),e.jsx(a,{})]})}),e.jsx(t,{control:l.control,name:"serviceAddress",render:({field:s})=>e.jsxs(n,{children:[e.jsx(i,{children:"Property address"}),e.jsx(o,{children:e.jsx(d,{...s})}),e.jsx(a,{})]})}),e.jsx(t,{control:l.control,name:"systemSize",render:({field:s})=>e.jsxs(n,{children:[e.jsx(i,{children:"Desired system size (kW)"}),e.jsx(o,{children:e.jsx(d,{type:"number",step:"0.5",...s})}),e.jsx(a,{})]})}),e.jsx(t,{control:l.control,name:"roofType",render:({field:s})=>e.jsxs(n,{children:[e.jsx(i,{children:"Roof type"}),e.jsxs(h,{onValueChange:s.onChange,value:s.value,children:[e.jsx(o,{children:e.jsx(j,{children:e.jsx(u,{placeholder:"Select roof type"})})}),e.jsxs(y,{children:[e.jsx(r,{value:"asphalt-shingle",children:"Asphalt shingle"}),e.jsx(r,{value:"metal",children:"Metal"}),e.jsx(r,{value:"flat",children:"Flat / membrane"}),e.jsx(r,{value:"tile",children:"Tile"}),e.jsx(r,{value:"other",children:"Other"})]})]}),e.jsx(a,{})]})}),e.jsx(t,{control:l.control,name:"electricalPanelSize",render:({field:s})=>e.jsxs(n,{children:[e.jsx(i,{children:"Current electrical panel size"}),e.jsxs(h,{onValueChange:s.onChange,value:s.value,children:[e.jsx(o,{children:e.jsx(j,{children:e.jsx(u,{placeholder:"Select panel size"})})}),e.jsxs(y,{children:[e.jsx(r,{value:"100A",children:"100A"}),e.jsx(r,{value:"150A",children:"150A"}),e.jsx(r,{value:"200A",children:"200A"}),e.jsx(r,{value:"400A",children:"400A"}),e.jsx(r,{value:"unsure",children:"Not sure"})]})]}),e.jsx(a,{})]})}),e.jsx(t,{control:l.control,name:"averageMonthlyBill",render:({field:s})=>e.jsxs(n,{children:[e.jsx(i,{children:"Average monthly electric bill (optional)"}),e.jsx(o,{children:e.jsx(d,{placeholder:"$250",...s})}),e.jsx(a,{})]})}),e.jsx(t,{control:l.control,name:"propertyOwnership",render:({field:s})=>e.jsxs(n,{children:[e.jsx(i,{children:"Property ownership"}),e.jsxs(h,{onValueChange:s.onChange,value:s.value,children:[e.jsx(o,{children:e.jsx(j,{children:e.jsx(u,{placeholder:"Select ownership"})})}),e.jsxs(y,{children:[e.jsx(r,{value:"owner",children:"I own this property"}),e.jsx(r,{value:"renter",children:"I rent (with owner approval)"}),e.jsx(r,{value:"business",children:"Commercial / business"})]})]}),e.jsx(a,{})]})}),e.jsx(t,{control:l.control,name:"projectDetails",render:({field:s})=>e.jsxs(n,{children:[e.jsx(i,{children:"Additional details (optional)"}),e.jsx(o,{children:e.jsx(H,{rows:4,...s})}),e.jsx(a,{})]})}
1),e.jsx(M,{type:"submit",size:"lg",className:"w-full",disabled:g,children:g?"Submittingâ¦":"Pay $500 deposit & reserve"})]})})})]})})})]}),e.jsx(R,{}),e.jsx(W,{})]})},$e=Z;export{$e as component};
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.