1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,396661,505014,e=>{"use strict";let t=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();e.s(["mergeClasses",0,t],396661);var r=e.i(271645),n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,r.createContext)({}),s=(0,r.forwardRef)(({color:e,size:s,strokeWidth:i,absoluteStrokeWidth:o,className:l="",children:d,iconNode:c,...u},m)=>{let{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:h=!1,color:x="currentColor",className:g=""}=(0,r.useContext)(a)??{},b=o??h?24*Number(i??p)/Number(s??f):i??p;return(0,r.createElement)("svg",{ref:m,...n,width:s??f??n.width,height:s??f??n.height,stroke:e??x,strokeWidth:b,className:t("lucide",g,l),...!d&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(u)&&{"aria-hidden":"true"},...u},[...c.map(([e,t])=>(0,r.createElement)(e,t)),...Array.isArray(d)?d:[d]])});e.s(["default",0,s],505014)},456420,e=>{"use strict";var t=e.i(271645),r=e.i(396661);let n=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var a=e.i(505014);e.s(["default",0,(e,s)=>{let i=(0,t.forwardRef)(({className:i,...o},l)=>(0,t.createElement)(a.default,{ref:l,iconNode:s,className:(0,r.mergeClasses)(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,i),...o}));return i.displayName=n(e),i}],456420)},975157,e=>{"use strict";var t=e.i(207670),r=e.i(919056);e.s(["cn",0,function(...e){return(0,r.twMerge)((0,t.clsx)(e))}])},225913,e=>{"use strict";var t=e.i(207670);let r=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=t.clsx;e.s(["cva",0,(e,t)=>a=>{var s;if((null==t?void 0:t.variants)==null)return n(e,null==a?void 0:a.class,null==a?void 0:a.className);let{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(e=>{let t=null==a?void 0:a[e],n=null==o?void 0:o[e];if(null===t)return null;let s=r(t)||r(n);return i[e][s]}),d=a&&Object.entries(a).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return n(e,l,null==t||null==(s=t.compoundVariants)?void 0:s.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...o,...d}[t]):({...o,...d})[t]===r})?[...e,r,n]:e},[]),null==a?void 0:a.class,null==a?void 0:a.className)}])},820783,e=>{"use strict";var t=e.i(271645);function r(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function n(...e){return t=>{let n=!1,a=e.map(e=>{let a=r(e,t);return n||"function"!=typeof a||(n=!0),a});if(n)return()=>{for(let t=0;t<a.length;t++){let n=a[t];"function"==typeof n?n():r(e[t],null)}}}}e.s(["composeRefs",0,n,"useComposedRefs",0,function(...e){return t.useCallback(n(...e),e)}])},991918,e=>{"use strict";var t=e.i(271645),r=e.i(820783),n=e.i(843476),a=Symbol.for("react.lazy"),s=t[" use ".trim().toString()];function i(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===a&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}function o(e){var a;let o,l=(a=e,(o=t.forwardRef((e,n)=>{let{children:a,...o}=e;if(i(a)&&"function"==typeof s&&(a=s(a._payload)),t.isValidElement(a)){var l;let e,s,i=(l=a,(s=(e=Object.getOwnPropertyDescriptor(l.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.ref:(s=(e=Object.getOwnPropertyDescriptor(l,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.props.ref:l.props.ref||l.ref),d=function(e,t){let r={...t};for(let n in t){let a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{let t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(o,a.props);return a.type!==t.Fragment&&(d.ref=n?(0,r.composeRefs)(n,i):i),t.cloneElement(a,d)}return t.Children.count(a)>1?t.Children.only(null):null})).displayName=`${a}.SlotClone`,o),d=t.forwardRef((e,r)=>{let{children:a,...o}=e;i(a)&&"function"==typeof s&&(a=s(a._payload));let d=t.Children.toArray(a),u=d.find(c);if(u){let e=u.props.children,a=d.map(r=>r!==u?r:t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null);return(0,n.jsx)(l,{...o,ref:r,children:t.isValidElement(e)?t.cloneElement(e,void 0,a):null})}return(0,n.jsx)(l,{...o,ref:r,children:a})});return d.displayName=`${e}.Slot`,d}var l=o("Slot"),d=Symbol("radix.slottable");function c(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===d}e.s(["Slot",0,l,"createSlot",0,o])},519455,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(991918),a=e.i(225913),s=e.i(975157);let i=(0,a.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-all duration-500 ease-[
1cubic-bezier(0.32,0.72,0,1)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-ocean text-cream hover:bg-ocean/90 rounded-full",outline:"border border-foreground/80 bg-transparent text-foreground hover:bg-foreground hover:text-background rounded-full",ghost:"text-foreground hover:bg-foreground/5 rounded-full",link:"text-foreground underline-offset-4 underline decoration-line hover:decoration-foreground",secondary:"bg-sand text-secondary-foreground hover:bg-sand/80 rounded-full",accent:"bg-accent text-accent-foreground hover:bg-accent/90 rounded-full",soft:"bg-cream-soft text-foreground hover:bg-sand rounded-full",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 rounded-full"},size:{default:"h-11 px-6 py-2.5",sm:"h-9 px-4 text-xs",lg:"h-12 px-7 text-sm",icon:"h-10 w-10","icon-sm":"h-8 w-8 rounded-full",pill:"h-11 pl-6 pr-1.5 py-1.5"}},defaultVariants:{variant:"default",size:"default"}}),o=r.forwardRef(({className:e,variant:r,size:a,asChild:o=!1,...l},d)=>{let c=o?n.Slot:"button";return(0,t.jsx)(c,{className:(0,s.cn)(i({variant:r,size:a,className:e})),ref:d,...l})});o.displayName="Button",e.s(["Button",0,o])},793479,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(975157);let a=r.forwardRef(({className:e,type:r,...a},s)=>(0,t.jsx)("input",{type:r,className:(0,n.cn)("flex h-11 w-full rounded-lg border border-input bg-transparent px-4 py-2 text-sm transition-colors duration-300 placeholder:text-muted-foreground/70 focus-visible:outline-none focus-visible:border-foreground focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...a}));a.displayName="Input",e.s(["Input",0,a])},110204,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.i(174080);var n=e.i(991918),a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,a)=>{let s=(0,n.createSlot)(`Primitive.${a}`),i=r.forwardRef((e,r)=>{let{asChild:n,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(n?s:a,{...i,ref:r})});return i.displayName=`Primitive.${a}`,{...e,[a]:i}},{}),s=r.forwardRef((e,r)=>(0,t.jsx)(a.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));s.displayName="Label";var i=e.i(975157);let o=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(s,{ref:n,className:(0,i.cn)("text-sm text-foreground leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...r}));o.displayName=s.displayName,e.s(["Label",0,o],110204)},471175,e=>{"use strict";function t(e,t){if(e&&"object"==typeof e&&"error"in e){let t=e.error;if("string"==typeof t&&t.length>0)return t}return t}async function r(e){let r=e?`/api/intake?category=${encodeURIComponent(e)}`:"/api/intake",n=await fetch(r,{cache:"no-store"}),a=await n.json();if(!n.ok)throw Error(t(a,"Failed to load intake form"));return a}async function n(e){let r=await fetch("/api/intake",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await r.json();if(!r.ok)throw Error(t(n,"Failed to submit intake form"));return n}async function a(e){let r=await fetch("/api/intake/upload",{method:"POST",body:e}),n=await r.json();if(!r.ok)throw Error(t(n,"Failed to upload intake form"));return n}async function s(){let e=await fetch("/api/admin/intake",{cache:"no-store"}),r=await e.json();if(!e.ok)throw Error(t(r,"Failed to load intake data"));return r}async function i(e){let r=await fetch("/api/admin/intake",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await r.json();if(!r.ok)throw Error(t(n,"Failed to save intake form"));return n}async function o(e){let r=await fetch("/api/admin/intake",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await r.json();if(!r.ok)throw Error(t(n,"Failed to create intake form"));return n}async function l(e){let r=await fetch(`/api/admin/intake?formId=${encodeURIComponent(e)}`,{method:"DELETE"});if(!r.ok){let e=null;try{e=await r.json()}catch{}throw Error(t(e,"Failed to delete form"))}}async function d(e,r){let n=await fetch("/api/admin/intake",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,status:r})}),a=await n.json();if(!n.ok)throw Error(t(a,"Failed to update submission"));return a}
1async function c(e){let r=await fetch(`/api/admin/intake?id=${encodeURIComponent(e)}`,{method:"DELETE"});if(!r.ok){let e=null;try{e=await r.json()}catch{}throw Error(t(e,"Failed to delete submission"))}}e.s(["createIntakeForm",0,o,"deleteIntakeForm",0,l,"deleteIntakeSubmission",0,c,"fetchAdminIntake",0,s,"fetchIntakeForm",0,r,"saveIntakeForm",0,i,"setIntakeSubmissionStatus",0,d,"submitIntake",0,n,"uploadIntake",0,a])},711241,e=>{"use strict";let t=(0,e.i(456420).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],711241)},296626,e=>{"use strict";var t=e.i(271645),r=e.i(820783),n=e.i(934620),a=e=>{var a;let i,o,{present:l,children:d}=e,c=function(e){var r,a;let[i,o]=t.useState(),l=t.useRef(null),d=t.useRef(e),c=t.useRef("none"),[u,m]=(r=e?"mounted":"unmounted",a={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},t.useReducer((e,t)=>a[e][t]??e,r));return t.useEffect(()=>{let e=s(l.current);c.current="mounted"===u?e:"none"},[u]),(0,n.useLayoutEffect)(()=>{let t=l.current,r=d.current;if(r!==e){let n=c.current,a=s(t);e?m("MOUNT"):"none"===a||t?.display==="none"?m("UNMOUNT"):r&&n!==a?m("ANIMATION_OUT"):m("UNMOUNT"),d.current=e}},[e,m]),(0,n.useLayoutEffect)(()=>{if(i){let e,t=i.ownerDocument.defaultView??window,r=r=>{let n=s(l.current).includes(CSS.escape(r.animationName));if(r.target===i&&n&&(m("ANIMATION_END"),!d.current)){let r=i.style.animationFillMode;i.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===i.style.animationFillMode&&(i.style.animationFillMode=r)})}},n=e=>{e.target===i&&(c.current=s(l.current))};return i.addEventListener("animationstart",n),i.addEventListener("animationcancel",r),i.addEventListener("animationend",r),()=>{t.clearTimeout(e),i.removeEventListener("animationstart",n),i.removeEventListener("animationcancel",r),i.removeEventListener("animationend",r)}}m("ANIMATION_END")},[i,m]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:t.useCallback(e=>{l.current=e?getComputedStyle(e):null,o(e)},[])}}(l),u="function"==typeof d?d({present:c.isPresent}):t.Children.only(d),m=(0,r.useComposedRefs)(c.ref,(a=u,(o=(i=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?a.ref:(o=(i=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?a.props.ref:a.props.ref||a.ref));return"function"==typeof d||c.isPresent?t.cloneElement(u,{ref:m}):null};function s(e){return e?.animationName||"none"}a.displayName="Presence",e.s(["Presence",0,a])},694558,762368,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(456420);let a=(0,n.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["Download",0,a],762368);let s=(0,n.default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),i=(0,n.default)("pencil-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),o=(0,n.default)("store",[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]]);var l=e.i(689664),d=e.i(632781),c=e.i(711241),u=e.i(975157),m=e.i(519455),f=e.i(793479),p=e.i(624687),h=e.i(110204),x=e.i(820783),g=e.i(30030),b=e.i(981140),v=e.i(369340),y=e.i(999682),j=e.i(635804),k=e.i(296626),N=e.i(248425),w="Checkbox",[C,S]=(0,g.createContextScope)(w),[E,I]=C(w);function R(e){let{__scopeCheckbox:n,checked:a,children:s,defaultChecked:i,disabled:o,form:l,name:d,onCheckedChange:c,required:u,value:m="on",internal_do_not_use_render:f}=e,[p,h]=(0,v.useControllableState)({prop:a,defaultProp:i??!1,onChange:c,caller:w}),[x,g]=r.useState(null),[b,y]=r.useState(null),j=r.useRef(!1),k=!x||!!l||!!x.closest("form"),N={checked:p,disabled:o,setChecked:h,control:x,setControl:g,name:d,form:l,value:m,hasConsumerStoppedPropagationRef:j,required:u,defaultChecked:!F(i)&&i,isFormControl:k,bubbleInput:b,setBubbleInput:y};return(0,t.jsx)(E,{scope:n,...N,children:"function"==typeof f?f(N):s})}var P="CheckboxTrigger",T=r.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:a,...s},i)=>{let{control:o,value:l,disabled:d,checked:c,required:u,setControl:m,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:g}=I(P,e),v=(0,x.useComposedRefs)(i,m),y=r.useRef(c);return r.useEffect(()=>{let e=o?.form;if(e){let t=()=>f(y.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[o,f]),(0,t.jsx)(N.Primitive.button,{type:"button",role:"checkbox","aria-checked":F(c)?"mixed":c,"aria-required":u,"data-state":_(c),"data-disabled":d?"":void 0,disabled:d,value:l,...s,ref:v,onKeyDown:(0,b.composeEventHandlers)(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,b.composeEventHandlers)(a,e=>{f(e=>!!F(e)||!e),g&&h&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})});T.displayName=P;var O=r.forwardRef((e,r)=>{let{__scopeCheckbox:n,name:a,checked:s,defaultChecked:i,required:o,disabled:l,value:d,onCheckedChange:c,form:u,...m}=e;return(0,t.jsx)(R,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:l,required:o,onCheckedChange:c,name:a,form:u,value:d,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(T,{...m,ref:r,__scopeCheckbox:n}),e&&(0,t.jsx)(D,{__scopeCheckbox:n})]})})});O.displayName=w;var L="CheckboxIndicator",M=r.forwardRef((e,r)=>{let{__scopeCheckbox:n,forceMount:a,...s}=e,i=I(L,n);return(0,t.jsx)(k.Presence,{present:a||F(i.checked)||!0===i.checked,children:(0,t.jsx)(N.Primitive.span,{"data-state":_(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:r,
1style:{pointerEvents:"none",...e.style}})})});M.displayName=L;var A="CheckboxBubbleInput",D=r.forwardRef(({__scopeCheckbox:e,...n},a)=>{let{control:s,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:l,required:d,disabled:c,name:u,value:m,form:f,bubbleInput:p,setBubbleInput:h}=I(A,e),g=(0,x.useComposedRefs)(a,h),b=(0,y.usePrevious)(o),v=(0,j.useSize)(s);r.useEffect(()=>{if(!p)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=!i.current;if(b!==o&&e){let r=new Event("click",{bubbles:t});p.indeterminate=F(o),e.call(p,!F(o)&&o),p.dispatchEvent(r)}},[p,b,o,i]);let k=r.useRef(!F(o)&&o);return(0,t.jsx)(N.Primitive.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??k.current,required:d,disabled:c,name:u,value:m,form:f,...n,tabIndex:-1,ref:g,style:{...n.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function F(e){return"indeterminate"===e}function _(e){return F(e)?"indeterminate":e?"checked":"unchecked"}D.displayName=A;let U=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(O,{ref:n,className:(0,u.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-espresso ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-espresso data-[state=checked]:text-primary-foreground",e),...r,children:(0,t.jsx)(M,{className:(0,u.cn)("flex items-center justify-center text-current"),children:(0,t.jsx)(l.Check,{className:"h-4 w-4"})})}));U.displayName=O.displayName;var $=e.i(967489),W=e.i(471175);let B="/Bella-Oasis-Client-Intake-and-Consent-Form.pdf";function z({icon:e,title:r,body:n,onClick:a}){return(0,t.jsxs)("button",{onClick:a,className:"flex flex-col items-start gap-3 rounded-xl border border-line-soft bg-cream-soft p-5 text-left transition-colors hover:border-foreground
1/30 hover:bg-sand/40",children:[(0,t.jsx)("span",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-moss/10 text-moss",children:e}),(0,t.jsx)("span",{className:"font-medium",children:r}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:n})]})}function V({form:e,bookingRef:n,defaultName:a,defaultEmail:s,onDone:i}){let[o,l]=(0,r.useState)({}),[c,u]=(0,r.useState)(""),[p,x]=(0,r.useState)(!1),[g,b]=(0,r.useState)(null),v=(0,r.useMemo)(()=>q(e,["full_name","name"])??null,[e]),y=(0,r.useMemo)(()=>q(e,["email"])??null,[e]),j=(0,r.useMemo)(()=>q(e,["phone","mobile"])??null,[e]),k=e.consentText.replaceAll("{spa}","Bella Oasis"),N=async()=>{for(let t of(b(null),e.sections))for(let e of t.fields){if(!e.required)continue;let t=o[e.id];if(null==t||""===t||!1===t||Array.isArray(t)&&0===t.length)return void b(`Please complete: ${e.label}`)}let t=v&&String(o[v.id]??"")||a,r=y&&String(o[y.id]??"")||s;if(!t||!r)return void b("Name and email are required.");if(e.requireSignature&&!c.trim())return void b("Please type your signature to agree.");x(!0);try{await (0,W.submitIntake)({method:"online",customerName:t,customerEmail:r,customerPhone:j?String(o[j.id]??""):void 0,answers:o,signatureName:c.trim()||void 0,bookingRef:n}),i()}catch(e){b(e instanceof Error?e.message:"Submission failed")}finally{x(!1)}};return(0,t.jsxs)("div",{className:"space-y-8",children:[e.sections.map(e=>(0,t.jsxs)("fieldset",{className:"space-y-4",children:[(0,t.jsx)("legend",{className:"font-serif text-xl tracking-tight",children:e.title}),e.description&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.description}),(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2",children:e.fields.map(e=>(0,t.jsx)(H,{field:e,value:o[e.id],onChange:t=>{let r;return r=e.id,l(e=>({...e,[r]:t}))}},e.id))})]},e.id)),(0,t.jsxs)("div",{className:"rounded-xl border border-line-soft bg-cream-soft p-5",children:[(0,t.jsx)("h4",{className:"font-medium",children:"Consent"}),(0,t.jsx)("p",{className:"mt-2 whitespace-pre-line text-sm leading-relaxed text-muted-foreground",children:k}),e.requireSignature&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)(h.Label,{className:"mb-1.5 block",children:["Type your full name to sign ",(0,t.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,t.jsx)(f.Input,{value:c,onChange:e=>u(e.target.value),placeholder:"Your full name",className:"font-serif text-lg italic"}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:["Dated ",new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})]})]})]}),g&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:g}),(0,t.jsxs)(m.Button,{onClick:N,disabled:p,size:"lg",children:[p?(0,t.jsx)(d.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Submit intake form"]})]})}function q(e,t){for(let r of e.sections)for(let e of r.fields)if(t.includes(e.id))return e}function H({field:e,value:r,onChange:n}){let a,s="textarea"===e.type||"checklist"===e.type||"radio"===e.type,i=(0,t.jsxs)(h.Label,{className:"mb-1.5 block",children:[e.label,e.required&&(0,t.jsx)("span",{className:"text-destructive",children:" *"})]});switch(e.type){case"textarea":a=(0,t.jsx)(p.Textarea,{value:String(r??""),onChange:e=>n(e.target.value),placeholder:e.placeholder,rows:3});break;case"checkbox":return(0,t.jsx)("div",{className:"sm:col-span-2",children:(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(U,{checked:!!r,onCheckedChange:e=>n(!!e)}),e.label]})});case"select":a=(0,t.jsxs)($.Select,{value:String(r??""),onValueChange:e=>n(e),children:[(0,t.jsx)($.SelectTrigger,{children:(0,t.jsx)($.SelectValue,{placeholder:"Selectâ¦"})}),(0,t.jsx)($.SelectContent,{children:e.options?.map(e=>(0,t.jsx)($.SelectItem,{value:e,children:e},e))})]});break;case"radio":a=(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.options?.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>n(e),className:(0,u.cn)("rounded-full border px-4 py-1.5 text-sm transition-colors",r===e?"border-foreground bg-foreground text-background":"border-input hover:border-foreground
1/40"),children:e},e))});break;case"checklist":{let s=Array.isArray(r)?r:[];a=(0,t.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:e.options?.map(e=>{let r=s.includes(e);return(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(U,{checked:r,onCheckedChange:t=>n(t?[...s,e]:s.filter(t=>t!==e))}),e]},e)})});break}default:a=(0,t.jsx)(f.Input,{type:e.type,value:String(r??""),onChange:e=>n(e.target.value),placeholder:e.placeholder})}return(0,t.jsxs)("div",{className:(0,u.cn)(s&&"sm:col-span-2"),children:[i,a,e.helpText&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e.helpText})]})}function J({name:e,email:r,phone:n,setName:a,setEmail:s,setPhone:i}){return(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)(h.Label,{className:"mb-1.5 block",children:["Full name ",(0,t.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,t.jsx)(f.Input,{value:e,onChange:e=>a(e.target.value)})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)(h.Label,{className:"mb-1.5 block",children:["Email ",(0,t.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,t.jsx)(f.Input,{type:"email",value:r,onChange:e=>s(e.target.value)})]}),(0,t.jsxs)("div",{className:"sm:col-span-2",children:[(0,t.jsx)(h.Label,{className:"mb-1.5 block",children:"Mobile number"}),(0,t.jsx)(f.Input,{type:"tel",value:n,onChange:e=>i(e.target.value)})]})]})}function K({bookingRef:e,defaultName:n,defaultEmail:i,onDone:o}){let[l,c]=(0,r.useState)(n),[u,f]=(0,r.useState)(i),[p,h]=(0,r.useState)(""),[x,g]=(0,r.useState)(null),[b,v]=(0,r.useState)(!1),[y,j]=(0,r.useState)(null),k=async()=>{if(j(null),!l||!u)return j("Name and email are required.");if(!x)return j("Please choose your completed form to upload.");let t=new FormData;t.append("file",x),t.append("customerName",l),t.append("customerEmail",u),t.append("customerPhone",p),e&&t.append("bookingRef",e),v(!0);try{await (0,W.uploadIntake)(t),o()}catch(e){j(e instanceof Error?e.message:"Upload failed")}finally{v(!1)}};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"rounded-xl border border-line-soft bg-cream-soft p-5",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Step 1 â download the form, print or annotate it, then upload it below."}),(0,t.jsx)(m.Button,{asChild:!0,variant:"outline",className:"mt-3",children:(0,t.jsxs)("a",{href:B,download:!0,children:[(0,t.jsx)(a,{className:"mr-2 h-4 w-4"})," Download the form (PDF)"]})})]}),(0,t.jsx)(J,{name:l,email:u,phone:p,setName:c,setEmail:f,setPhone:h}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"mb-1.5 block text-sm font-medium",children:["Completed form ",(0,t.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,t.jsx)("input",{type:"file",accept:"application/pdf,image/png,image/jpeg",onChange:e=>g(e.target.files?.[0]??null),className:"block w-full text-sm file:mr-4 file:rounded-full file:border-0 file:bg-foreground file:px-4 file:py-2 file:text-background"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"PDF or image, up to 10MB."})]}),y&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:y}),(0,t.jsxs)(m.Button,{onClick:k,disabled:b,size:"lg",children:[b?(0,t.jsx)(d.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(s,{className:"mr-2 h-4 w-4"}),"Upload completed form"]})]})}function Z({bookingRef:e,defaultName:n,defaultEmail:a,onDone:s}){let[i,o]=(0,r.useState)(n),[l,c]=(0,r.useState)(a),[u,f]=(0,r.useState)(""),[p,h]=(0,r.useState)(!1),[x,g]=(0,r.useState)(null),b=async()=>{if(g(null),!i||!l)return g("Name and email are required.");h(!0);try{await (0,W.submitIntake)({method:"in-person",customerName:i,customerEmail:l,customerPhone:u||void 0,bookingRef:e}),s()}catch(e){g(e instanceof Error?e.message:"Could not save")}finally{h(!1)}};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No problem â weâll have the form ready for you at the spa. Please arrive 10 minutes before your appointment to complete it. Leave your details so we know to expect you."}),(0,t.jsx)(J,{name:i,email:l,phone:u,setName:o,setEmail:c,setPhone:f}),x&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:x}),(0,t.jsxs)(m.Button,{onClick:b,disabled:p,size:"lg",children:[p?(0,t.jsx)(d.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Iâll complete it in person"]})]})}e.s(["INTAKE_PDF_PATH",0,B,"IntakeFlow",0,function({bookingRef:e,onComplete:n,className:a,defaultName:m="",defaultEmail:f=""}){let[p,h]=(0,r.useState)(null),[x,g]=(0,r.useState)(null),[b,v]=(0,r.useState)(null),[y,j]=(0,r.useState)(null);if((0,r.useEffect)(()=>{let e=!0;return(0,W.fetchIntakeForm)().then(t=>e&&h(t.form)).catch(t=>e&&g(t instanceof Error?t.message:"Failed to load form")),()=>{e=!1}},[]),y)return(0,t.jsxs)("div",{className:(0,u.cn)("rounded-2xl border border-line-soft bg-cream-soft p-8 text-center",a),children:[(0,t.jsx)("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-moss/15",children:(0,t.jsx)(l.Check,{className:"h-6 w-6 text-moss",strokeWidth:1.5})}),(0,t.jsx)("h3",{className:"font-serif text-2xl tracking-tight",children:"Youâre all set"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"in-person"===y?"We've noted that you'll complete your form at the spa. Please arrive 10 minutes early.":"Thank y
1ou â your intake form has been received. We'll have it ready for your visit."})]});if(x)return(0,t.jsxs)("div",{className:(0,u.cn)("rounded-xl border border-destructive/40 bg-destructive/5 p-6 text-sm",a),children:["Couldnât load the intake form: ",x]});if(!p)return(0,t.jsxs)("div",{className:(0,u.cn)("flex items-center gap-2 p-6 text-sm text-muted-foreground",a),children:[(0,t.jsx)(d.Loader2,{className:"h-4 w-4 animate-spin"})," Loading intake formâ¦"]});let k=e=>{j(e),n?.()};return(0,t.jsxs)("div",{className:a,children:[b&&(0,t.jsxs)("button",{onClick:()=>v(null),className:"mb-4 inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[(0,t.jsx)(c.ArrowLeft,{className:"h-4 w-4"})," Back to options"]}),!b&&(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,t.jsx)(z,{icon:(0,t.jsx)(i,{className:"h-5 w-5"}),title:"Fill it out online",body:"Complete the form now â takes about 3 minutes.",onClick:()=>v("online")}),(0,t.jsx)(z,{icon:(0,t.jsx)(s,{className:"h-5 w-5"}),title:"Download & upload",body:"Download the form, fill it in, and upload it back.",onClick:()=>v("uploaded")}),(0,t.jsx)(z,{icon:(0,t.jsx)(o,{className:"h-5 w-5"}),title:"Do it in person",body:"Prefer paper? Complete it when you arrive.",onClick:()=>v("in-person")})]}),"online"===b&&(0,t.jsx)(V,{form:p,bookingRef:e,defaultName:m,defaultEmail:f,onDone:()=>k("online")}),"uploaded"===b&&(0,t.jsx)(K,{bookingRef:e,defaultName:m,defaultEmail:f,onDone:()=>k("uploaded")}),"in-person"===b&&(0,t.jsx)(Z,{bookingRef:e,defaultName:m,defaultEmail:f,onDone:()=>k("in-person")})]})}],694558)}]);
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.