1import{av as B,u as V,r as E,j as e,B as M,aw as W,C as Z,a1 as O,a2 as D,a3 as X,a4 as Y,ab as h,I as d,E as v,F as N,G as y,H as f,J as x,bl as K,am as _,bd as H,bt as T,bu as j,L as b,as as G,K as k,c as z}from"./index-CU4TP-S4.js";import{u as J,F as U,a as l,b as t,c as r,d as o,f as i,e as C,t as Q}from"./form-D-xzwno4.js";import{n as $}from"./nvw-logo-CPz3E6Qk.js";import{S as P}from"./store-Ba9I9XgU.js";import{F as ee}from"./file-text-BgBpfFOt.js";import{o as se,s as n,e as S,b as ae,u as p}from"./types-BmAflJw1.js";const le=se({accountName:n().min(2,"Business name must be at least 2 characters"),customerType:S(["retail_liquor","restaurant","private_club","other"],{required_error:"Please select a business type"}),licenseNumber:n().optional(),taxId:n().optional(),primaryContactName:n().min(2,"Contact name must be at least 2 characters"),primaryContactRole:n().optional(),emailAddress:n().email("Invalid email address"),phoneNumber:n().min(10,"Phone number must be at least 10 digits"),altPhoneNumber:n().optional(),billingAddress:n().min(5,"Street address is required"),billingCity:n().min(2,"City is required"),billingState:n().min(2,"State is required"),billingZipCode:n().min(5,"ZIP code is required"),storeLocationSameAsBusiness:S(["yes","no"],{required_error:"Please answer this question"}),hasMultipleLocations:S(["yes","no"]).optional(),storeName:n().optional(),storeAddress:n().optional(),storeCity:n().optional(),storeState:n().optional(),storeZipCode:n().optional(),storePhone:n().optional(),storeEmail:n().optional(),multipleLocationsNote:n().optional(),notes:n().optional(),acceptsMarketing:ae().default(!1)}).superRefine((c,u)=>{c.storeLocationSameAsBusiness==="no"&&c.hasMultipleLocations==="no"&&((!c.storeName||c.storeName.length<2)&&u.addIssue({code:p.custom,message:"Store name is required",path:["storeName"]}),(!c.storeAddress||c.storeAddress.length<5)&&u.addIssue({code:p.custom,message:"Store address is required",path:["storeAddress"]}),(!c.storeCity||c.storeCity.length<2)&&u.addIssue({code:p.custom,message:"Store city is required",path:["storeCity"]}),(!c.storeState||c.storeState.length<2)&&u.addIssue({code:p.custom,message:"Store state is required",path:["storeState"]}),(!c.storeZipCode||c.storeZipCode.length<5)&&u.addIssue({code:p.custom,message:"Store ZIP code is required",path:["storeZipCode"]}))}),F=[{value:"AL",label:"Alabama"},{value:"AK",label:"Alaska"},{value:"AZ",label:"Arizona"},{value:"AR",label:"Arkansas"},{value:"CA",label:"California"},{value:"CO",label:"Colorado"},{value:"CT",label:"Connecticut"},{value:"DE",label:"Delaware"},{value:"FL",label:"Florida"},{value:"GA",label:"Georgia"},{value:"HI",label:"Hawaii"},{value:"ID",label:"Idaho"},{value:"IL",label:"Illinois"},{value:"IN",label:"Indiana"},{value:"IA",label:"Iowa"},{value:"KS",label:"Kansas"},{value:"KY",label:"Kentucky"},{value:"LA",label:"Louisiana"},{value:"ME",label:"Maine"},{value:"MD",label:"Maryland"},{value:"MA",label:"Massachusetts"},{value:"MI",label:"Michigan"},{value:"MN",label:"Minnesota"},{value:"MS",label:"Mississippi"},{value:"MO",label:"Missouri"},{value:"MT",label:"Montana"},{value:"NE",label:"Nebraska"},{value:"NV",label:"Nevada"},{value:"NH",label:"New Hampshire"},{value:"NJ",label:"New Jersey"},{value:"NM",label:"New Mexico"},{value:"NY",label:"New York"},{value:"NC",label:"North Carolina"},{value:"ND",label:"North Dakota"},{value:"OH",label:"Ohio"},{value:"OK",label:"Oklahoma"},{value:"OR",label:"Oregon"},{value:"PA",label:"Pennsylvania"},{value:"RI",label:"Rhode Island"},{value:"SC",label:"South Carolina"},{value:"SD",label:"South Dakota"},{value:"TN",label:"Tennessee"},{value:"TX",label:"Texas"},{value:"UT",label:"Utah"},{value:"VT",label:"Vermont"},{value:"VA",label:"Virginia"},{value:"WA",label:"Washington"},{value:"WV",label:"West Virginia"},{value:"WI",label:"Wisconsin"},{value:"WY",label:"Wyoming"}];function ce(){const[,c]=B(),{toast:u}=V(),[A,w]=E.useState(!1),a=J({resolver:Q(le),defaultValues:{accountName:"",customerType:void 0,licenseNumber:"",taxId:"",primaryContactName:"",primaryContactRole:"",emailAddress:"",phoneNumber:"",altPhoneNumber:"",billingAddress:"",billingCity:"",b
1illingState:"MA",billingZipCode:"",storeLocationSameAsBusiness:void 0,hasMultipleLocations:void 0,storeName:"",storeAddress:"",storeCity:"",storeState:"MA",storeZipCode:"",storePhone:"",storeEmail:"",multipleLocationsNote:"",notes:"",acceptsMarketing:!1}}),g=a.watch("storeLocationSameAsBusiness"),I=a.watch("hasMultipleLocations"),L=a.watch("customerType"),q=async s=>{w(!0);try{const m=await fetch("/api/b2b/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),R=await m.json();if(!m.ok)throw new Error(R.error||"Registration failed");c("/b2b/application-submitted")}catch(m){u({title:"Submission Failed",description:m.message,variant:"destructive"})}finally{w(!1)}};return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-background to-muted py-8 md:py-12",children:e.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs(M,{variant:"ghost",onClick:()=>c("/b2b"),className:"mb-4","data-testid":"button-back",children:[e.jsx(W,{className:"h-4 w-4 mr-2"}),"Back to Pricing"]}),e.jsxs(Z,{children:[e.jsxs(O,{className:"text-center pb-2",children:[e.jsx("img",{src:$,alt:"Nashoba Valley Winery",className:"h-20 w-auto mx-auto mb-4"}),e.jsx(D,{className:"font-serif text-2xl md:text-3xl",children:"Wholesale Account Application"}),e.jsx(X,{className:"text-base",children:"Complete the form below to apply for a wholesale account with Nashoba Valley Winery"}),e.jsxs("div",{className:"mt-6 p-4 bg-primary/5 rounded-lg border border-primary/10",children:[e.jsxs("p",{className:"text-sm md:text-base text-muted-foreground leading-relaxed",children:[e.jsx("span",{className:"font-semibold text-primary",children:"Thank you for considering joining the Nashoba Valley Winery family!"})," ","We're excited about the opportunity to partner with you. Our team is here to help you build our brand and bring the authentic taste of New England to your customers."]}),e.jsxs("p",{className:"text-sm md:text-base text-muted-foreground leading-relaxed mt-3",children:["As a partner, you'll be among the stores and restaurants truly committed to local flavors, proudly pouring and serving beverages crafted by your neighbors. Your dedication to our farm helps keep our community thriving, one sip at a time. ",e.jsx("span",{className:"font-semibold text-primary",children:"Every dollar your customers spend stays in our local economy."})]})]})]}),e.jsx(Y,{children:e.jsx(U,{...a,children:e.jsxs("form",{onSubmit:a.handleSubmit(q),className:"space-y-8",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-lg font-semibold text-primary",children:[e.jsx(P,{className:"h-5 w-5"}),e.jsx("h3",{children:"Business Information"})]}),e.jsx(h,{}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(l,{control:a.control,name:"accountName",render:({field:s})=>e.jsxs(t,{className:"md:col-span-2",children:[e.jsx(r,{children:"Business Name *"}),e.jsx(o,{children:e.jsx(d,{...s,placeholder:"Your Store or Restaurant Name","data-testid":"input-account-name"})}),e.jsx(i,{})]})}),e.jsx(l,{control:a.control,name:"customerType",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"Business Type *"}),e.jsxs(v,{onValueChange:s.onChange,value:s.value,children:[e.jsx(o,{children:e.jsx(N,{"data-testid":"select-customer-type",children:e.jsx(y,{placeholder:"Select type..."})})}),e.jsxs(f,{children:[e.jsx(x,{value:"retail_liquor",children:"Retail Liquor Store"}),e.jsx(x,{value:"restaurant",children:"Restaurant / Bar"}),e.jsx(x,{value:"private_club",children:"Private Club"}),e.jsx(x,{value:"other",children:"Other"})]})]}),e.jsx(i,{})]})}),e.jsx(l,{control:a.control,name:"licenseNumber",render:({field:s})=>e.jsxs(t,{children:[e.jsxs(r,{children:["Liquor License Number",(L==="retail_liquor"||L==="restaurant")&&" *"]}),e.jsx(o,{children:e.jsx(d,{...s,placeholder:"License #","data-testid":"input-license-number"})}),e.jsx(C,{className:"text-xs",children:"Required for retail liquor stores and restaurants"}),e.jsx(i,{})]})}),e.jsx(l,{control:a.control,name:"taxId",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"Federal Tax ID (EIN)"}),e.jsx(o,{children:e.jsx(d,{...s,placeholder:"XX-XXXXXXX","data-testid":"input-tax-id"})}),e.jsx(i,{})]})})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-lg font-semibold text-primary",children:[e.jsx(K,{className:"h-5 w-5"}),e.jsx("h3",{children:"Contact Information"})]}),e.jsx(h,{}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(l,{control:a.control,name:"primaryContactName",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"Primary Contact Name *"}),e.jsx(o,{children:e.jsx(d,{...s,placeholder:"Full Name","data-testid":"input-contact-name"})}),e.jsx(i,{})]})}),e.jsx(l,{control:a.control,name:"primaryContactRole",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"Role / Title"}),e.jsx(o,{children:e.jsx(d,{...s,placeholder:"e.g., Owner, Manager, Buyer","data-testid":"input-contact-role"})}),e.jsx(i,{})]})}),e.jsx(l,{control:a.control,name:"emailAddress",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"Email Address *"}),e.jsx(o,{children:e.jsx(d,{...s,type:"email",placeholder:"[email protected]","data-testid":"input-email"})}),e.jsx(C,{className:"text-xs",children:"Login credentials will be sent to this address"}),e.jsx(i,{})]})}),e.jsx(l,{control:a.control,name:"phoneNumber",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"Phone Number *"}),e.jsx(o,{children:e.jsx(d,{...s,type:"tel",placeholder:"(555) 123-4567","data-testid":"input-phone"})}),e.jsx(i,{})]})}),e.jsx(l,{control:a.control,name:"altPhoneNumber",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"Alternate Phone"}),e.jsx(o,{children:e.jsx(d,{...s,type:"tel",placeholder:"(555) 987-6543","data-testid":"input-alt-phone"})}),e.jsx(i,{})]})})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-lg font-semibold text-primary",children:[e.jsx(_,{className:"h-5 w-5"}),e.jsx("h3",{children:"Business / Billing Address"})]}),e.jsx(h,{}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(l,{control:a.control,name:"billingAddress",render:({field:s})=>e.jsxs(t,{className:"md:col-span-2",children:[e.jsx(r,{children:"Street Address *"}),e.jsx(o,{children:e.jsx(d,{...s,placeholder:"123 Main Street","data-testid":"input-billing-address"})}),e.jsx(i,{})]})}),e.jsx(l,{control:a.control,name:"billingCity",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"City *"}),e.jsx(o,{children:e.jsx(d,{...s,placeholder:"City","data-testid":"input-billing-city"})}),e.jsx(i,{})]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(l,{control:a.control,name:"billingState",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"State *"}),e.jsxs(v,{onValueChange:s.onChange,value:s.value,children:[e.jsx(o,{children:e.jsx(N,{"data-testid":"select-billing-state",children:e.jsx(y,{placeholder:"State"})})}),e.jsx(f,{children:F.map(m=>e.jsx(x,{value:m.value,children:m.value},m.value))})]}),e.jsx(i,{})]})}),e.jsx(l,{control:a.control,name:"billingZipCode",render:({field:s})=>
1e.jsxs(t,{children:[e.jsx(r,{children:"ZIP Code *"}),e.jsx(o,{children:e.jsx(d,{...s,placeholder:"01234","data-testid":"input-billing-zip"})}),e.jsx(i,{})]})})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-lg font-semibold text-primary",children:[e.jsx(H,{className:"h-5 w-5"}),e.jsx("h3",{children:"Store Location"})]}),e.jsx(h,{}),e.jsx(l,{control:a.control,name:"storeLocationSameAsBusiness",render:({field:s})=>e.jsxs(t,{className:"space-y-3",children:[e.jsx(r,{className:"text-base",children:"Is the location of your store or restaurant the same as the business address above? *"}),e.jsx(o,{children:e.jsxs(T,{onValueChange:s.onChange,value:s.value,className:"flex gap-6",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(j,{value:"yes",id:"location-yes","data-testid":"radio-location-same-yes"}),e.jsx(b,{htmlFor:"location-yes",className:"cursor-pointer",children:"Yes"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(j,{value:"no",id:"location-no","data-testid":"radio-location-same-no"}),e.jsx(b,{htmlFor:"location-no",className:"cursor-pointer",children:"No"})]})]})}),e.jsx(i,{})]})}),g==="no"&&e.jsx(l,{control:a.control,name:"hasMultipleLocations",render:({field:s})=>e.jsxs(t,{className:"space-y-3 pt-2",children:[e.jsx(r,{className:"text-base",children:"Do you have multiple locations that will be offering Nashoba Adult Beverages? *"}),e.jsx(o,{children:e.jsxs(T,{onValueChange:s.onChange,value:s.value,className:"flex gap-6",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(j,{value:"yes",id:"multiple-yes","data-testid":"radio-multiple-locations-yes"}),e.jsx(b,{htmlFor:"multiple-yes",className:"cursor-pointer",children:"Yes"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(j,{value:"no",id:"multiple-no","data-testid":"radio-multiple-locations-no"}),e.jsx(b,{htmlFor:"multiple-no",className:"cursor-pointer",children:"No, just one location"})]})]})}),e.jsx(i,{})]})}),g==="no"&&I==="no"&&e.jsxs("div",{className:"space-y-4 pt-4 p-4 bg-muted/50 rounded-lg border",children:[e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx(P,{className:"h-4 w-4"}),"Please provide your store location details:"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(l,{control:a.control,name:"storeName",render:({field:s})=>e.jsxs(t,{className:"md:col-span-2",children:[e.jsx(r,{children:"Store Name *"}),e.jsx(o,{children:e.jsx(d,{...s,placeholder:"Store or Restaurant Name","data-testid":"input-store-name"})}),e.jsx(i,{})]})}),e.jsx(l,{control:a.control,name:"storeAddress",render:({field:s})=>e.jsxs(t,{className:"md:col-span-2",children:[e.jsx(r,{children:"Street Address *"}),e.jsx(o,{children:e.jsx(d,{...s,placeholder:"456 Store Street","data-testid":"input-store-address"})}),e.jsx(i,{})]})}),e.jsx(l,{control:a.control,name:"storeCity",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"City *"}),e.jsx(o,{children:e.jsx(d,{...s,placeholder:"City","data-testid":"input-store-city"})}),e.jsx(i,{})]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(l,{control:a.control,name:"storeState",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"State *"}),e.jsxs(v,{onValueChange:s.onChange,value:s.value,children:[e.jsx(o,{children:e.jsx(N,{"data-testid":"select-store-state",children:e.jsx(y,{placeholder:"State"})})}),e.jsx(f,{children:F.map(m=>e.jsx(x,{value:m.value,children:m.value},m.value))})]}),e.jsx(i,{})]})}),e.jsx(l,{control:a.control,name:"storeZipCode",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"ZIP Code *"}),e.jsx(o,{children:e.jsx(d,{...s,placeholder:"01234","data-testid":"input-store-zip"})}),e.jsx(i,{})]})})]}),e.jsx(l,{control:a.control,name:"storePhone",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"Store Phone"}),e.jsx(o,{children:e.jsx(d,{...s,type:"tel",placeholder:"(555) 123-4567","data-testid":"input-store-phone"})}),e.jsx(i,{})]})}),e.jsx(l,{control:a.control,name:"storeEmail",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"Store Email"}),e.jsx(o,{children:e.jsx(d,{...s,type:"email",placeholder:"[email protected]","data-testid":"input-store-email"})}),e.jsx(i,{})]})})]})]}),g==="no"&&I==="yes"&&e.jsxs("div",{className:"space-y-4 pt-4 p-4 bg-muted/50 rounded-lg border",children:[e.jsxs("div",{className:"flex items-start gap-2 text-sm text-muted-foreground",children:[e.jsx(G,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),e.jsx("p",{children:"Great! After your account is approved, we'll work with you to add all your store locations. Please provide any details that would be helpful below:"})]}),e.jsx(l,{control:a.control,name:"multipleLocationsNote",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"Location Details (Optional)"}),e.jsx(o,{children:e.jsx(k,{...s,placeholder:"e.g., We have 3 locations in Boston, Cambridge, and Somerville...",rows:3,"data-testid":"input-multiple-locations-note"})}),e.jsx(i,{})]})})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-lg font-semibold text-primary",children:[e.jsx(ee,{className:"h-5 w-5"}),e.jsx("h3",{children:"Additional Information"})]}),e.jsx(h,{}),e.jsx(l,{control:a.control,name:"notes",render:({field:s})=>e.jsxs(t,{children:[e.jsx(r,{children:"Notes or Comments"}),e.jsx(o,{children:e.jsx(k,{...s,placeholder:"Any additional information you'd like us to know...",rows:3,"data-testid":"input-notes"})}),e.jsx(i,{})]})}),e.jsx(l,{control:a.control,name:"acceptsMarketing",render:({field:s})=>e.jsxs(t,{className:"flex flex-row items-start space-x-3 space-y-0 rounded-md border p-4",children:[e.jsx(o,{children:e.jsx(z,{checked:s.value,onCheckedChange:s.onChange,"data-testid":"checkbox-marketing"})}),e.jsxs("div",{className:"space-y-1 leading-none",children:[e.jsx(r,{className:"cursor-pointer",children:"Keep me updated on new products and promotions"}),e.jsx(C,{children:"We'll send occasional emails about new arrivals, seasonal offerings, and special promotions."})]})]})})]}),e.jsxs("div",{className:"pt-4 border-t",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"* Required fields. Your application will be reviewed within 1-2 business days. You'll receive an email with your login credentials once approved."}
1),e.jsx(M,{type:"submit",className:"w-full",size:"lg",disabled:A,"data-testid":"button-submit-registration",children:A?"Submitting Application...":"Submit Application"})]})]})})})]})]})})}export{ce 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.