1var e=Object.defineProperty,s=Object.defineProperties,a=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable,l=(s,a,r)=>a in s?e(s,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[a]=r,i=(e,s)=>{for(var a in s||(s={}))n.call(s,a)&&l(e,a,s[a]);if(r)for(var a of r(s))t.call(s,a)&&l(e,a,s[a]);return e},c=(e,r)=>s(e,a(r)),o=(e,s)=>{var a={};for(var l in e)n.call(e,l)&&s.indexOf(l)<0&&(a[l]=e[l]);if(null!=e&&r)for(var l of r(e))s.indexOf(l)<0&&t.call(e,l)&&(a[l]=e[l]);return a};import{j as d}from"./unknown-B8sTZm28.js";import{r as m}from"./unknown-D4Lh-9cT.js";import{C as x,a as h,b as u,c as p}from"./unknown-DCd15dOK.js";import{bj as j,aB as f,bk as b,J as y,bl as g,aa as v,bm as N,bn as w,bo as k,bp as S,bq as C,br as P,bs as M,v as O,bt as q,bu as R,bv as D,bw as F,w as _,D as I,Y as T}from"./index-Cjf4_mTK.js";import{L as V}from"./unknown-fzpodmot.js";import{R as $,a as z}from"./unknown-CzEwS9Je.js";import{T as E}from"./unknown-DjBZ0ot8.js";import{G as W}from"./unknown-KbpUVgWa.js";import{C as A}from"./unknown-uWbn1ETU.js";import"./unknown-DfefiCyb.js";import"./unknown-Bs4EVO4p.js";import"./unknown-dPNSFJGi.js";import"./unknown-6nyZxgq7.js";import"./unknown-D4SpSuiU.js";const B=D,H=F,Y=m.forwardRef((e,s)=>{var a=e,{className:r,children:n}=a,t=o(a,["className","children"]);return d.jsxs(j,c(i({ref:s,className:f("flex h-10 w-full items-center justify-between rounded-md border border-gray-300 bg-white text-gray-900 px-3 py-2 text-sm placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",r)},t),{children:[n,d.jsx(b,{asChild:!0,children:d.jsx(y,{className:"h-4 w-4 opacity-50"})})]}))});Y.displayName=j.displayName;const L=m.forwardRef((e,s)=>{var a=e,{className:r}=a,n=o(a,["className"]);return d.jsx(g,c(i({ref:s,className:f("flex cursor-default items-center justify-center py-1",r)},n),{children:d.jsx(v,{className:"h-4 w-4"})}))});L.displayName=g.displayName;const G=m.forwardRef((e,s)=>{var a=e,{className:r}=a,n=o(a,["className"]);return d.jsx(N,c(i({ref:s,className:f("flex cursor-default items-center justify-center py-1",r)},n),{children:d.jsx(y,{className:"h-4 w-4"})}))});G.displayName=N.displayName;const J=m.forwardRef((e,s)=>{var a=e,{className:r,children:n,position:t="popper"}=a,l=o(a,["className","children","position"]);return d.jsx(w,{children:d.jsxs(k,c(i({ref:s,className:f("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-white text-gray-900 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===t&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:t},l),{children:[d.jsx(L,{}),d.jsx(S,{className:f("p-1","popper"===t&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),d.jsx(G,{})]}))})});J.displayName=k.displayName;m.forwardRef((e,s)=>{var a=e,{className:r}=a,n=o(a,["className"]);return d.jsx(C,i({ref:s,className:f("py-1.5 pl-8 pr-2 text-sm font-semibold text-gray-900",r)},n))}).displayName=C.displayName;const Z=m.forwardRef((e,s)=>{var a=e,{className:r,children:n}=a,t=o(a,["className","children"]);return d.jsxs(P,c(i({ref:s,className:f("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm text-gray-900 outline-none focus:bg-blue-50 focus:text-blue-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r)},t),{children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(M,{children:d.jsx(O,{className:"h-4 w-4"})})}),d.jsx(q,{children:n})]}))});Z.displayName=P.displayName;m.forwardRef((e,s)=>{var a=e,{className:r}=a,n=o(a,["className"]);return d.jsx(R,i({ref:s,className:f("-mx-1 my-1 h-px bg-gray-200",r)},n))}).displayName=R.displayName;const K=({businessId:e,selectedService:s,onSubscriptionPackageSelect:a})=>{const[r,n]=m.useState("onetime"),[t,l]=m.useState({packageId:null,frequency:"monthly",sessionsPerMonth:1,preferredDay:"",preferredTime:"",startDate:"",duration:"ongoing",specialRequests:""}),o=e=>{n(e),"onetime"===e?null==a||a(null):null==a||a(i({type:"recurring"},t))},j=(e,s)=>{const n=c(i({},t),{[e]:s});l(n),"recurring"===r&&(null==a||a(i({type:"recurring"},n)))},f=e=>`$${e.toFixed(2)}`;return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[d.jsx(x,{className:"border-2 transition-all cursor-pointer "+("onetime"===r?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-blue-300"),onClick:()=>o("onetime"),children:d.jsxs(h,{className:"p-4",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[d.jsx(_,{className:"h-6 w-6 text-blue-600"}),d.jsx("h3",{className:"font-semibold text-black",children:"One-time Booking"}),"onetime"===r&&d.jsx(I,{variant:"secondary",className:"bg-blue-500 text-white",children:"Selected"})]}),d.jsx("p",{className:"text-sm text-black mb-3",children:"Book a single appointment at the selected date and time."}),d.jsx("div",{className:"text-lg font-bold text-black",children:f((null==s?void 0:s.base_price)||0)})]})}),d.jsx(x,{className:"border-2 transition-all cursor-pointer "+("recurring"===r?"border-green-500 bg-green-50":"border-gray-200 hover:border-green-300"),onClick:()=>o("recurring"),children:d.jsxs(h,{className:"p-4",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[d.jsx(T,{className:"h-6 w-6 text-green-600"}),d.jsx("h3",{className:"font-semibold text-black",children:"Recurring Service"}),d.jsxs(I,{className:"bg-green-500 text-white",children:[d.jsx(W,{className:"h-3 w-3 mr-1"}),"Save up to 20%"]}),"recurring"===r&&d.jsx(I,{variant:"secondary",className:"bg-green-500 text-white",children:"Selected"})]}),d.jsx("p",{className:"text-sm text-black mb-3",children:"Set up regular service appointments and save money with subscription pricing."}),d.jsx("div",{className:"text-sm text-gray-600",children:"Customize frequency and details in the next step"})]})})]}),"recurring"===r&&d.jsxs(x,{className:"border-2 border-green-500",children:[d.jsxs(u,{children:[d.jsxs(p,{className:"text-lg text-green-700 flex items-center gap-2",children:[d.jsx(A,{className:"h-5 w-5"}),"Subscription Details"]}
1),d.jsx("p",{className:"text-sm text-gray-600",children:"Let us know when and how often you'd like your service"})]}),d.jsxs(h,{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx(V,{className:"text-base font-medium text-black",children:"How often would you like this service?"}),d.jsxs($,{value:t.frequency,onValueChange:e=>j("frequency",e),className:"mt-3",children:[d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx(z,{value:"weekly",id:"weekly"}),d.jsx(V,{htmlFor:"weekly",className:"text-black",children:"Every week"})]}),d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx(z,{value:"biweekly",id:"biweekly"}),d.jsx(V,{htmlFor:"biweekly",className:"text-black",children:"Every 2 weeks"})]}),d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx(z,{value:"monthly",id:"monthly"}),d.jsx(V,{htmlFor:"monthly",className:"text-black",children:"Once a month"})]})]})]}),"monthly"===t.frequency&&d.jsxs("div",{children:[d.jsx(V,{className:"text-base font-medium text-black",children:"How many sessions per month?"}),d.jsxs(B,{value:t.sessionsPerMonth.toString(),onValueChange:e=>j("sessionsPerMonth",parseInt(e)),children:[d.jsx(Y,{className:"mt-2",children:d.jsx(H,{placeholder:"Select sessions per month"})}),d.jsxs(J,{children:[d.jsx(Z,{value:"1",children:"1 session per month"}),d.jsx(Z,{value:"2",children:"2 sessions per month"}),d.jsx(Z,{value:"3",children:"3 sessions per month"}),d.jsx(Z,{value:"4",children:"4 sessions per month"})]})]})]}),d.jsxs("div",{children:[d.jsx(V,{className:"text-base font-medium text-black",children:"What day of the week works best?"}),d.jsxs(B,{value:t.preferredDay,onValueChange:e=>j("preferredDay",e),children:[d.jsx(Y,{className:"mt-2",children:d.jsx(H,{placeholder:"Choose your preferred day"})}),d.jsxs(J,{children:[d.jsx(Z,{value:"monday",children:"Monday"}),d.jsx(Z,{value:"tuesday",children:"Tuesday"}),d.jsx(Z,{value:"wednesday",children:"Wednesday"}),d.jsx(Z,{value:"thursday",children:"Thursday"}),d.jsx(Z,{value:"friday",children:"Friday"}),d.jsx(Z,{value:"saturday",children:"Saturday"}),d.jsx(Z,{value:"sunday",children:"Sunday"}),d.jsx(Z,{value:"flexible",children:"I'm flexible"})]})]})]}),d.jsxs("div",{children:[d.jsx(V,{className:"text-base font-medium text-black",children:"What time of day works best?"}),d.jsxs(B,{value:t.preferredTime,onValueChange:e=>j("preferredTime",e),children:[d.jsx(Y,{className:"mt-2",children:d.jsx(H,{placeholder:"Choose your preferred time"})}),d.jsxs(J,{children:[d.jsx(Z,{value:"morning",children:"Morning (8 AM - 12 PM)"}),d.jsx(Z,{value:"afternoon",children:"Afternoon (12 PM - 5 PM)"}),d.jsx(Z,{value:"evening",children:"Evening (5 PM - 8 PM)"}),d.jsx(Z,{value:"flexible",children:"I'm flexible"})]})]})]}),d.jsxs("div",{children:[d.jsx(V,{className:"text-base font-medium text-black",children:"When would you like to start?"}),d.jsx("input",{type:"date",value:t.startDate,onChange:e=>j("startDate",e.target.value),min:(()=>{const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`})(),className:"mt-2 w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"})]}),d.jsxs("div",{children:[d.jsx(V,{className:"text-base font-medium text-black",children:"How long would you like this subscription?"}),d.jsxs(B,{value:t.duration,onValueChange:e=>j("duration",e),children:[d.jsx(Y,{className:"mt-2",children:d.jsx(H,{placeholder:"Choose duration"})}),d.jsxs(J,{children:[d.jsx(Z,{value:"3_months",children:"3 months"}),d.jsx(Z,{value:"6_months",children:"6 months"}),d.jsx(Z,{value:"12_months",children:"12 months"}),d.jsx(Z,{value:"ongoing",children:"Ongoing (cancel anytime)"})]})]})]}),d.jsxs("div",{children:[d.jsx(V,{className:"text-base font-medium text-black",children:"Special requests or notes"}),d.jsx(E,{value:t.specialRequests,onChange:e=>j("specialRequests",e.target.value),placeholder:"Any special instructions or preferences...",className:"mt-2",rows:3})]}),d.jsxs("div",{className:"bg-green-50 p-4 rounded-lg border border-green-200",children:[d.jsx("h4",{className:"font-semibold text-green-700 mb-2",children:"Subscription Summary"}),d.jsxs("div",{className:"space-y-1 text-sm",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-gray-600",children:"Service:"}),d.jsx("span",{className:"text-black font-medium",children:null==s?void 0:s.name})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-gray-600",children:"Frequency:"}),d.jsx("span",{className:"text-black font-medium",children:"monthly"===t.frequency&&t.sessionsPerMonth>1?`${t.sessionsPerMonth}x monthly`:t.frequency})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-gray-600",children:"Regular price per service:"}),d.jsx("span",{className:"text-gray-500 line-through",children:f((null==s?void 0:s.base_price)||0)})]}),d.jsxs("div",{className:"flex justify-between font-semibold text-green-600",children:[d.jsx("span",{children:"Subscription price per service:"}),d.jsx("span",{children:f(.85*((null==s?void 0:s.base_price)||0))})]}),d.jsxs("div",{className:"flex justify-between text-green-600 font-medium",children:[d.jsx("span",{children:"You save:"}),d.jsxs("span",{children:[f(.15*((null==s?void 0:s.base_price)||0))," per service"]})]})]})]})]})]})]})};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.