import{G as le,j as e,r as f,I as Ce,e as y,J as $e,B as M,o as He,K as Y,N as Qe,O as ve,Q as J,L as U,w as ye,U as Ve,S as We,V as Ze,W as _e,d as Ye,f as Je}from"./index-DLIdDvtv.js";import{a as Ke}from"./image-utils-CeqDNzlH.js";import{B as A}from"./badge-Dse3r8DC.js";import{e as we,a as Xe,b as es,c as ss,d as ts,f as as,g as ns,h as rs,i as is,j as ls,k as cs,l as os,m as ds,n as ms,o as us,p as xs,q as ps,r as hs,s as fs,C as bs,t as gs,u as js,v as Ns,w as vs,Z as ys}from"./exp-santacana-studio-BDIRmhS3.js";import{S as T}from"./skeleton-D1cfBzST.js";import{S as ae}from"./separator-Cq5RdmbQ.js";import{C as _s}from"./calendar-CC4EfbAP.js";import{P as ws,a as ks,b as Ss}from"./popover-DoWpMTtN.js";import{S as Te,a as Fe,b as Ee,c as Be,d as Me}from"./select-0XKWeVb4.js";import{A as Cs}from"./AddToCartButton-DlaB3b-m.js";import{I as $s}from"./info-DvaqhwhX.js";import{M as Ae}from"./minus-egf5GkMY.js";import{P as Ie}from"./plus-qq_bWo5h.js";import{a as Ts,b as Fs,c as Es}from"./use-experiences-D_Kw_ZvP.js";import{u as Bs}from"./use-category-margins-CW9Ojhj6.js";import{s as ie}from"./salsa-experience-BK6D3CDs.js";import{C as Ms}from"./chevron-left-DxhEmV1C.js";import{M as As}from"./map-pin-CJ9vA5Z7.js";import{S as K}from"./star-C_88G8bB.js";import{C as ne}from"./clock-BvxlWn2P.js";import{C as ke}from"./check-56-l036b.js";import{C as Is}from"./circle-alert-WSUO1n4t.js";import{L as re}from"./loader-circle-m1KelLvx.js";import{S as Rs}from"./shield-BoYxMGGQ.js";import{U as Gs}from"./users-Bt6dZUqf.js";import{C as Se}from"./calendar-DwFQA7Pt.js";import"./arrow-left-D8K3UTU2.js";import"./arrow-right--yWPN3sO.js";import"./chevron-right-B-Qpe4sa.js";import"./Combination-B0NUnCBf.js";import"./index-BdQq_4o_.js";import"./index-DAlusLjv.js";import"./index-DLiuCG_Q.js";import"./chevron-up-CexKDmyZ.js";import"./dialog-Cz2djAlK.js";import"./index-DG3iIT5_.js";import"./input-hEr-DKad.js";import"./CustomFieldRenderer-kL_AcfC9.js";import"./customFields-D3GHnLUB.js";import"./textarea-CUBXR3lZ.js";import"./send-BsOECO4t.js";import"./shopping-cart-CV6-c52z.js";import"./product-booking-metadata-Bmib-awn.js";function Re(n){const r=new Map;for(const s of n){const l=s.option||"__default__";r.has(l)||r.set(l,[]),r.get(l).push(s)}return r}function Ge(n){return n.length<2?!1:n.every(r=>r.type==="group_bracket"||/^\d/.test(r.label))}function Le(n){const r=n.match(/(\d+)(?:\s*[-–]\s*(\d+))?/);if(!r)return{min:1,max:999};const s=parseInt(r[1]),l=r[2]?parseInt(r[2]):s;return{min:s,max:l}}function Ls(n,r){const s=n.filter(c=>(c.option||"__default__")===r);if(s.length===0)return null;const l=s.some(c=>c.price===0),p=s.every(c=>c.type==="group_bracket"||/^\d/.test(c.label)),i=s.every(c=>c.type==="group_flat"),o=new Set(s.map(c=>c.price)).size>1;return l?"Infants travel free with this option":p?"Per-person rate decreases with larger groups":i?null:o?"Different rates apply by tier type":null}function Ps({tiers:n,onChange:r,unitLabel:s,minPax:l,maxPax:p,catalogMarginDecimal:i=0}){const o=Math.max(1,Number(l)||1),c=p!=null&&Number.isFinite(Number(p))?Math.max(o,Math.floor(Number(p))):void 0,j=f.useMemo(()=>Ce(s),[s]),u=f.useMemo(()=>le(s).toLowerCase(),[s]),g=f.useMemo(()=>Re(n),[n]),m=f.useMemo(()=>Array.from(g.keys()),[g]),N=m.length>1,[C,_]=f.useState(m[0]||"__default__"),h=f.useMemo(()=>g.get(C)||[],[g,C]),x=f.useMemo(()=>Ge(h),[h]),b=f.useMemo(()=>h.some(E=>E.type==="group_flat"),[h]),w=f.useMemo(()=>h.length>1&&h.every(E=>E.type==="per_session"),[h]),F=f.useMemo(()=>Ls(n,C),[n,C]);return e.jsxs("div",{className:"space-y-4",children:[N&&e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-sans font-medium text-muted-foreground uppercase tracking-wide mb-2 block",children:"Select Option"}),e.jsxs(Te,{value:C,onValueChange:_,children:[e.jsx(Fe,{className:"w-full",children:e.jsx(Ee,{})}),e.jsx(Be,{children:m.map(E=>e.jsx(Me,{value:E,children:E==="__default__"?"Standard":E},E))})]})]}),F&&e.jsxs("div",{className:"flex items-start gap-2 text-xs font-sans text-muted-foreground bg-secondary/40 rounded-sm px-3 py-2",children:[e.jsx($s,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:F})]}),x||b?e.jsx(qs,{tiers:h,onChange:r,unitLabel:s,quantityLabel:j,perUnitShort:u,minPax:o,maxPax:c,catalogMarginDecimal:i}):w?e.jsx(Ds,{tiers:h,onChange:r,minPax:o,maxPax:c,catalogMarginDecimal:i}):h.length===1?e.jsx(Os,{tier:h[0],onChange:r,minPax:o,maxPax:c,catalogMarginDecimal:i}):e.jsx(Us,{tiers:h,onChange:r,maxPax:c,catalogMarginDecimal:i})]})}function Os({tier:n,onChange:r,minPax:s,maxPax:l,catalogMarginDecimal:p}){const[i,o]=f.useState(s);f.useEffect(()=>{o(s),r(s*n.price,[{label:n.label,count:s,price:n.price}])},[n.label,n.price,s]),f.useEffect(()=>{l!=null&&o(j=>{if(j<=l)return j;const u=l;return r(u*n.price,[{label:n.label,count:u,price:n.price}]),u})},[l,n.label,n.price]);const c=j=>{const m=Math.min(l??1/0,Math.max(s,j));o(m),r(m*n.price,[{label:n.label,count:m,price:n.price}])};return e.jsxs("div",{className:"space-y-3",children:[e.jsx(q,{label:n.label,price:n.price,count:i,onUpdate:c,min:s,max:l,catalogMarginDecimal:p}),e.jsx(D,{breakdown:[{label:n.label,count:i,price:n.price}],catalogMarginDecimal:p})]})}function Us({tiers:n,onChange:r,maxPax:s,catalogMarginDecimal:l}){const[p,i]=f.useState(()=>n.map(()=>0));f.useEffect(()=>{i(n.map(()=>0)),r(0,[])},[n.map(u=>u.label+u.price).join(",")]);const o=(u,g)=>{const m=[...p],C=p.reduce((b,w)=>b+w,0)-p[u],_=s!=null?Math.max(0,s-C):1/0;m[u]=s!=null?Math.min(g,_):g,i(m);const h=n.map((b,w)=>({label:b.label,count:m[w],price:b.price})),x=h.reduce((b,w)=>b+w.count*w.price,0);r(x,h.filter(b=>b.count>0))},c=n.map((u,g)=>({label:u.label,count:p[g],price:u.price})).filter(u=>u.count>0),j=c.reduce((u,g)=>u+g.count*g.price,0);return e.jsxs("div",{className:"space-y-3",children:[n.map((u,g)=>e.jsx(q,{label:u.label,price:u.price,count:p[g]??0,onUpdate:m=>o(g,m),min:0,catalogMarginDecimal:l},`${u.label}-${u.price}`)),j>0?e.jsx(D,{breakdown:c,catalogMarginDecimal:l}):e.jsx("p",{className:"text-sm text-center text-muted-foreground font-sans italic pt-2",children:"Select at least 1 to see total"})]})}function qs({tiers:n,onChange:r,unitLabel:s,quantityLabel:l,perUnitShort:p,minPax:i,maxPax:o,catalogMarginDecimal:c}){const j=n.some(x=>x.type==="group_flat"),[u,g]=f.useState(i),m=f.useMemo(()=>n.map(x=>({...x,...Le(x.label)})),[n]),N=x=>m.find(b=>x>=b.min&&x<=b.max)||m[m.length-1],C=x=>{const b=N(x);j?r(b.price,[{label:b.label,count:x,price:b.price}]):r(x*b.price,[{label:l,count:x,price:b.price}])};f.useEffect(()=>{g(i),C(i)},[n.map(x=>x.label+x.price).join(","),i,l]),f.useEffect(()=>{o!=null&&g(x=>x<=o?x:(C(o),o))},[o,n.map(x=>x.label+x.price).join(","),l]);const _=x=>{const F=Math.min(o??1/0,Math.max(i,x));g(F),C(F)},h=N(u);if(j){const x=u===1?"Person":"Persons";return e.jsxs("div",{className:"space-y-3","data-name":"GroupBracketSelector",children:[e.jsx("div",{className:"space-y-0.5",children:m.map(b=>{const w=b.max>=999?`${b.min}+`:`${b.min}–${b.max}`,F=b.label===h.label;return e.jsxs("div",{className:`flex justify-between text-sm font-sans px-2 py-1.5 rounded-sm transition-colors ${F?"bg-accent/10 text-accent font-medium":"text-muted-foreground"}`,children:[e.jsxs("span",{children:["Group ",w," pax"]}),e.jsxs("span",{className:"tabular-nums",children:["$",y(b.price,c).toFixed(2)]})]},b.label)})}),e.jsx(q,{label:x,price:0,count:u,onUpdate:_,min:i,max:o,catalogMarginDecimal:c,hidePrice:!0}),e.jsx(D,{breakdown:[{label:x,count:u,price:h.price}],catalogMarginDecimal:c,flatPrice:h.price})]})}return e.jsxs("div",{className:"space-y-3","data-name":"GroupBracketSelector",children:[e.jsx(q,{label:l,price:h.price,count:u,onUpdate:_,min:i,max:o,catalogMarginDecimal:c}),e.jsx("div",{className:"space-y-1",children:m.map(x=>e.jsxs("div",{className:`flex justify-between text-sm font-sans px-2 py-1 rounded-sm transition-colors ${x.label===h.label?"bg-accent/10 text-accent font-medium":"text-muted-foreground"}`,children:[e.jsx("span",{children:$e(x.min,x.max,s)}),e.jsxs("span",{children:["$",y(x.price,c).toFixed(2)," / ",p]})]},x.label))}),e.jsx(D,{breakdown:[{label:l,count:u,price:h.price}],catalogMarginDecimal:c})]})}function Ds({tiers:n,onChange:r,minPax:s,maxPax:l,catalogMarginDecimal:p}){const[i,o]=f.useState(0),[c,j]=f.useState(s);f.useEffect(()=>{j(s),r(n[0].price*s,[{label:n[0].label,count:s,price:n[0].price}])},[n.map(m=>m.label+m.price).join(","),s]),f.useEffect(()=>{l!=null&&j(m=>{if(m<=l)return m;const N=l;return r(n[i].price*N,[{label:n[i].label,count:N,price:n[i].price}]),N})},[l,i,n.map(m=>m.label+m.price).join(",")]);const u=m=>{o(m);const _=Math.min(l??1/0,Math.max(s,c));j(_),r(n[m].price*_,[{label:n[m].label,count:_,price:n[m].price}])},g=m=>{const _=Math.min(l??1/0,Math.max(s,m));j(_),r(n[i].price*_,[{label:n[i].label,count:_,price:n[i].price}])};return e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"space-y-2",children:n.map((m,N)=>e.jsxs("button",{onClick:()=>u(N),className:`w-full flex justify-between items-center text-sm font-sans px-3 py-2.5 rounded-sm border transition-colors ${N===i?"border-primary bg-primary/5 text-foreground font-medium":"border-border text-muted-foreground hover:border-primary/50"}`,children:[e.jsx("span",{children:m.label}),e.jsxs("span",{className:"font-medium",children:["$",y(m.price,p).toFixed(2)]})]},`${m.label}-${m.price}`))}),e.jsx(q,{label:"Quantity",price:n[i].price,count:c,onUpdate:g,min:s,max:l,catalogMarginDecimal:p}),e.jsx(D,{breakdown:[{label:n[i].label,count:c,price:n[i].price}],catalogMarginDecimal:p})]})}function q({label:n,price:r,count:s,onUpdate:l,min:p,max:i,catalogMarginDecimal:o,hidePrice:c}){const j=i!=null&&s>=i,u=y(r,o);return e.jsxs("div",{className:"flex items-center justify-between","data-name":"QuantityRow",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-base font-sans font-medium text-foreground",children:n}),!c&&e.jsxs("span",{className:"text-sm text-muted-foreground font-sans ml-2",children:["$",u.toFixed(2)," each"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>l(Math.max(p,s-1)),disabled:s<=p,children:e.jsx(Ae,{className:"w-3 h-3"})}),e.jsx("span",{className:"w-8 text-center font-sans font-medium text-foreground",children:s}),e.jsx(M,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>l(i!=null?Math.min(i,s+1):s+1),disabled:j,children:e.jsx(Ie,{className:"w-3 h-3"})})]})]})}function D({breakdown:n,catalogMarginDecimal:r,flatPrice:s}){const l=s??n.reduce((i,o)=>i+o.count*o.price,0);if(n.length===0||l===0)return null;const p=s!=null?y(s,r):n.reduce((i,o)=>i+o.count*y(o.price,r),0);return e.jsxs("div",{className:"pt-3 border-t border-border space-y-1",children:[n.map(i=>{const o=y(i.price,r),c=s!=null?y(s,r):i.count*o;return e.jsxs("div",{className:"flex justify-between text-sm font-sans text-muted-foreground",children:[e.jsxs("span",{children:[i.count," × ",i.label,s==null&&` @ $${o.toFixed(2)}`]}),e.jsxs("span",{children:["$",c.toFixed(2)]})]},`${i.label}-${i.price}`)}),e.jsxs("div",{className:"flex justify-between items-center pt-1",children:[e.jsx("span",{className:"text-base font-sans font-semibold text-foreground",children:"Total"}),e.jsxs("span",{className:"text-xl font-serif font-medium text-foreground",children:["$",p.toFixed(2)]})]})]})}function zs({tiers:n,unitLabel:r,catalogMarginDecimal:s=0}){if(!(n!=null&&n.length))return null;const l=le(r).toLowerCase(),p=Re(n),i=Array.from(p.keys());return e.jsx("div",{className:"space-y-6",children:i.map(o=>{const c=p.get(o)||[],j=o==="__default__"?null:o,u=Ge(c),g=c.some(N=>N.type==="group_flat"),m=c.length>1&&c.every(N=>N.type==="per_session");return e.jsxs("div",{className:"space-y-3",children:[j&&e.jsx("p",{className:"text-xs font-sans font-medium text-muted-foreground uppercase tracking-wide",children:j}),u?e.jsx(Hs,{tiers:c,unitLabel:r,perUnitShort:l,catalogMarginDecimal:s}):g?e.jsx(Qs,{tiers:c,catalogMarginDecimal:s}):m?e.jsx(Vs,{tiers:c,catalogMarginDecimal:s}):c.length===1?e.jsx(Ws,{tier:c[0],perUnitShort:l,catalogMarginDecimal:s}):e.jsx(Zs,{tiers:c,perUnitShort:l,catalogMarginDecimal:s})]},o)})})}const z="font-sans text-foreground",H="font-sans text-foreground tabular-nums";function Hs({tiers:n,unitLabel:r,perUnitShort:s,catalogMarginDecimal:l}){return e.jsx("div",{className:"space-y-2","data-name":"ReadOnlyGroupBracketBlock",children:n.map(p=>{const{min:i,max:o}=Le(p.label),c=y(p.price,l);return e.jsxs("div",{className:"flex justify-between items-baseline gap-4",children:[e.jsx("span",{className:z,children:$e(i,o,r)}),e.jsxs("span",{className:H,children:["$",c.toFixed(2)," ",e.jsxs("span",{className:"text-muted-foreground font-sans",children:["/ ",s]})]})]},p.label)})})}function Qs({tiers:n,catalogMarginDecimal:r}){return e.jsxs("div",{className:"space-y-2",children:[n.map(s=>e.jsxs("div",{className:"flex justify-between items-baseline gap-4",children:[e.jsx("span",{className:z,children:s.label}),e.jsxs("span",{className:H,children:["$",y(s.price,r).toFixed(2)]})]},s.label)),e.jsx("p",{className:"text-xs font-sans text-muted-foreground italic pt-1",children:"Flat rate options — price covers the group size shown in each label."})]})}function Vs({tiers:n,catalogMarginDecimal:r}){return e.jsx("div",{className:"space-y-2",children:n.map(s=>e.jsxs("div",{className:"flex justify-between items-baseline gap-4",children:[e.jsx("span",{className:z,children:s.label}),e.jsxs("span",{className:H,children:["$",y(s.price,r).toFixed(2)]})]},`${s.label}-${s.price}`))})}function Ws({tier:n,perUnitShort:r,catalogMarginDecimal:s}){const l=n.type==="per_person",p=y(n.price,s);return e.jsxs("div",{className:"flex justify-between items-baseline gap-4",children:[e.jsx("span",{className:z,children:n.label}),e.jsxs("span",{className:H,children:["$",p.toFixed(2),l&&e.jsxs(e.Fragment,{children:[" ",e.jsxs("span",{className:"text-muted-foreground font-sans",children:["/ ",r]})]})]})]})}function Zs({tiers:n,perUnitShort:r,catalogMarginDecimal:s}){return e.jsxs("div",{className:"space-y-2",children:[n.map(l=>e.jsxs("div",{className:"flex justify-between items-baseline gap-4",children:[e.jsx("span",{className:z,children:l.label}),e.jsxs("span",{className:H,children:["$",y(l.price,s).toFixed(2),l.type==="per_person"&&e.jsxs(e.Fragment,{children:[" ",e.jsxs("span",{className:"text-muted-foreground font-sans",children:["/ ",r]})]})]})]},`${l.label}-${l.price}`)),e.jsx("p",{className:"text-xs font-sans text-muted-foreground italic pt-1",children:"Combine selections in the booking panel to see your total."})]})}const Ys={"salsa-nights-havana":ie,"old-havana-walking-tour":ye,"trinidad-heritage-cooking":fs,"vinales-tobacco-tour":hs,"cuban-cuisine-masterclass":ie,"classic-car-city-tour":ye,"camaguey-bicitaxi-heritage":ps,"camaguey-bicitaxi-artist-studio":xs,"havana-community-photography":us,"camaguey-stained-glass":ms,"havana-fashion-design":ds,"havana-salsa-latinsalseando":os,"vinales-cultural-immersion":cs,"havana-evening-cultural":ls,"havana-heritage-program":is,"havana-architecture-walk":rs,"las-terrazas-biosphere":ns,"havana-murals-mosaics":as,"havana-artisans-walk":ts,"havana-rum-cigars":ss,"cojimar-hemingway-heritage":es,"havana-cultural-walk-guide":Xe,"santacana-studio-gift":we,"santacana-studio-hospitality":we};function Ot(){var he,fe,be,ge,je,Ne;const{slug:n}=He(),r=(n??"").trim(),{data:s,isPending:l,isError:p,error:i}=Ts(r),{data:o}=Fs((s==null?void 0:s.id)||""),{data:c}=Es(),{data:j,isSuccess:u}=Bs(),g=(j==null?void 0:j.experience)??0,[m,N]=f.useState(0),[C,_]=f.useState([]),[h,x]=f.useState(void 0),[b,w]=f.useState("10:00"),[F,E]=f.useState({}),[ce,X]=f.useState(null),a=f.useMemo(()=>{if(!s)return null;const t=s.booking_products,d=(c==null?void 0:c[s.id])??[];if(t&&t.length>0){const S=ce??s.default_product_id??t[0].id;return t.find($=>$.id===S)??t[0]}return{id:s.default_product_id||s.id,name:s.title,duration_hours:s.duration_hours,min_guests:s.min_guests,max_guests:s.max_guests,max_adults:s.max_adults??null,max_children:s.max_children??null,price_type:s.price_type??null,adult_price:s.adult_price??null,child_price:s.child_price??null,available_days:s.available_days,time_slots:s.time_slots,price_tiers:s.price_tiers,age_requirement:s.age_requirement,activity_level:s.activity_level,languages:s.languages,relational_preview_tiers:d,pax_types:[],preview_price:s.price,inventory_quantity:s.inventory_quantity??null,cutoff_hours:s.cutoff_hours??null}},[s,ce,c]);f.useEffect(()=>{if(!s)return;const t=s.booking_products;if(!(t!=null&&t.length)){X(null);return}X(d=>d&&t.some(S=>S.id===d)?d:s.default_product_id??t[0].id)},[s==null?void 0:s.id,s==null?void 0:s.default_product_id,s==null?void 0:s.booking_products]);const oe=(((he=s==null?void 0:s.booking_products)==null?void 0:he.length)??0)>1,k=!!a&&a.price_type==="per_pax"&&(a.pax_types.length>0||Number(a.adult_price)>0||Number(a.child_price)>0);if(f.useEffect(()=>{a&&(N(0),_([]))},[a==null?void 0:a.id]),f.useEffect(()=>{if(a)if(a.pax_types.length>0){const t={};a.pax_types.forEach(d=>{t[d.id]=d.min_qty||0}),E(t)}else E({})},[a==null?void 0:a.id]),f.useEffect(()=>{var B,v;if(!a)return;const t=(((B=a.time_slots)==null?void 0:B.length)??0)>0,d=(((v=a.available_days)==null?void 0:v.length)??0)>0;if(!t||!d){x(void 0);return}const S=Y(a.time_slots),$=Qe({cutoffHours:a.cutoff_hours,timeSlots:S,availableDays:a.available_days});x(O=>!O||!$||ve(O,{cutoffHours:a.cutoff_hours,timeSlots:S,availableDays:a.available_days})?$:O)},[s==null?void 0:s.id,a==null?void 0:a.id,a==null?void 0:a.cutoff_hours,a==null?void 0:a.time_slots,a==null?void 0:a.available_days]),f.useEffect(()=>{var $,B;if(!s||!a)return;const t=((($=a.time_slots)==null?void 0:$.length)??0)>0,d=(((B=a.available_days)==null?void 0:B.length)??0)>0,S=t?Y(a.time_slots):[];if(!t||!d){w("");return}w(v=>S.includes(v)?v:S[0]||"")},[s==null?void 0:s.id,a==null?void 0:a.id,a==null?void 0:a.time_slots,a==null?void 0:a.available_days]),f.useEffect(()=>{var B,v;if(!a||!h)return;const t=(((B=a.time_slots)==null?void 0:B.length)??0)>0,d=(((v=a.available_days)==null?void 0:v.length)??0)>0;if(!t||!d)return;const S=Y(a.time_slots);if(J(h,b,a.cutoff_hours))return;const $=S.find(O=>J(h,O,a.cutoff_hours));$?w($):S[0]&&w(S[0])},[a==null?void 0:a.id,a==null?void 0:a.cutoff_hours,a==null?void 0:a.time_slots,a==null?void 0:a.available_days,h]),!r)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center px-4",children:[e.jsx("h2",{className:"heading-section mb-4",children:"Experience Not Found"}),e.jsx("p",{className:"text-muted-foreground text-sm font-sans mb-4",children:"Missing experience link."}),e.jsx(M,{asChild:!0,children:e.jsx(U,{to:"/experiences",children:"Browse Experiences"})})]})});if(l)return e.jsxs("div",{className:"min-h-screen",children:[e.jsx(T,{className:"h-[50vh] w-full"}),e.jsxs("div",{className:"container-luxury py-12 space-y-6",children:[e.jsx(T,{className:"h-10 w-2/3"}),e.jsx(T,{className:"h-6 w-1/3"}),e.jsx(T,{className:"h-40 w-full"})]})]});if(p)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center max-w-md px-4",children:[e.jsx("h2",{className:"heading-section mb-4",children:"Unable to load this experience"}),e.jsx("p",{className:"text-muted-foreground text-sm font-sans mb-4 break-words",children:(i==null?void 0:i.message)||"Something went wrong while loading the catalog."}),e.jsx(M,{asChild:!0,children:e.jsx(U,{to:"/experiences",children:"Browse Experiences"})})]})});if(!s)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center px-4",children:[e.jsx("h2",{className:"heading-section mb-4",children:"Experience Not Found"}),e.jsxs("p",{className:"text-muted-foreground text-sm font-sans mb-4",children:["There is no published experience at ",e.jsx("span",{className:"font-mono text-foreground",children:r}),", or it is not visible with your current access."]}),e.jsx(M,{asChild:!0,children:e.jsx(U,{to:"/experiences",children:"Browse Experiences"})})]})});if(!a)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"heading-section mb-4",children:"Experience Not Found"}),e.jsx(M,{asChild:!0,children:e.jsx(U,{to:"/experiences",children:"Browse Experiences"})})]})});const ee=s.image_url||((fe=s.images)==null?void 0:fe[0])||Ys[s.slug]||ie,de=Array.isArray(s.images)?s.images.filter(Boolean):[],I=de.length>0?de:[ee],Pe=s.category,Oe=o?[5,4,3,2,1].map(t=>({star:t,count:o.filter(d=>d.rating===t).length,pct:o.length>0?o.filter(d=>d.rating===t).length/o.length*100:0})):[],R=(((be=a.time_slots)==null?void 0:be.length)??0)>0,se=(((ge=a.available_days)==null?void 0:ge.length)??0)>0,me=R?Y(a.time_slots):[],G=Ve(a.max_guests,a.inventory_quantity)??a.max_guests,L=a.inventory_quantity!=null&&a.inventory_quantity>=0&&a.inventory_quantity===0,ue=!!h&&se&&R&&!!b&&J(h,b,a.cutoff_hours),Ue=le(s.price_unit_label).toLowerCase(),P=k?a.pax_types??[]:[],Q=k?P.filter(t=>(F[t.id]??0)>0).map(t=>({label:t.label,count:F[t.id]??0,price:t.price})):[],xe=k?Q.reduce((t,d)=>t+d.count*d.price,0):0,qe=k?Q.reduce((t,d)=>t+d.count*y(d.price,g),0):0,V=k?Object.values(F).reduce((t,d)=>t+d,0):0,te=Number(a.min_guests)||1,W=G!=null&&Number.isFinite(Number(G))?Number(G):999,Z=P.filter(t=>t.is_primary),pe=Z.length===0||Z.some(t=>(F[t.id]??0)>=1),De=!k||V>=te&&V<=W&&pe,ze=!k&&a.price_type!=="per_item"&&(((je=a.price_tiers)==null?void 0:je.length)??0)>0&&m<=0;return e.jsxs("div",{"data-name":"ExperienceDetailPage",children:[e.jsx(We,{title:`${s.title} — ${s.location_city||"Cuba"} Experience`,description:s.short_description||s.description||"",path:`/experiences/${s.slug}`,image:ee,jsonLd:Ke(s)}),e.jsxs("section",{className:"relative h-[50vh] md:h-[60vh] overflow-hidden",children:[e.jsxs(bs,{className:"absolute inset-0 [&>div]:h-full",opts:{loop:I.length>1},children:[e.jsx(gs,{className:"h-full ml-0",children:I.map((t,d)=>e.jsx(js,{className:"h-full pl-0",children:e.jsx("img",{src:t,alt:`${s.title} — ${s.category||"Cultural exchange"} in ${s.location_city||"Cuba"}${I.length>1?` (${d+1} of ${I.length})`:""}`,className:"w-full h-full object-cover object-center",width:1920,height:1080,fetchPriority:d===0?"high":void 0,loading:d===0?"eager":"lazy"})},`${t}-${d}`))}),I.length>1&&e.jsxs(e.Fragment,{children:[e.jsx(Ns,{className:"left-4 z-30 border-white/30 bg-black/40 text-white hover:bg-black/60 hover:text-white"}),e.jsx(vs,{className:"right-4 z-30 border-white/30 bg-black/40 text-white hover:bg-black/60 hover:text-white"})]})]}),e.jsx("div",{className:"absolute inset-0 overlay-hero pointer-events-none z-10"}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-8 z-20",children:e.jsxs("div",{className:"container-luxury",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsxs(U,{to:"/experiences",className:"inline-flex items-center gap-2 text-sm text-white/80 font-sans hover:text-white transition-colors",children:[e.jsx(Ms,{className:"w-4 h-4"})," All Experiences"]}),e.jsx(A,{className:"bg-accent text-accent-foreground font-sans text-xs",children:Pe})]}),e.jsx("h1",{className:"heading-display text-white mb-3",children:s.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-white/90 font-sans text-sm",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(As,{className:"w-4 h-4"})," ",s.location_city]}),!!s.rating&&!!s.review_count&&e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(K,{className:"w-4 h-4 fill-gold text-gold"})," ",s.rating," (",s.review_count," reviews)"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(ne,{className:"w-4 h-4"})," ",a.duration_hours>=8?"Full day":`${a.duration_hours} hours`]}),s.host&&e.jsxs("span",{children:["Hosted by ",e.jsx("strong",{children:s.host.first_name})]})]})]})})]}),e.jsx("div",{className:"container-luxury py-12 md:py-16",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-12",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-12",children:[e.jsxs("section",{children:[e.jsx("h2",{className:"heading-section mb-4",children:"About This Experience"}),/<[a-z][^>]*/i.test(s.description??"")?e.jsx("div",{className:"text-editorial leading-relaxed [&_p]:mb-3 [&_ul]:list-disc [&_ul]:ml-5 [&_ol]:list-decimal [&_ol]:ml-5",dangerouslySetInnerHTML:{__html:s.description??""}}):e.jsx("p",{className:"text-editorial whitespace-pre-line",children:s.description})]}),s.what_well_do&&s.what_well_do.length>0&&e.jsxs("section",{children:[e.jsx("h2",{className:"heading-section mb-6",children:"What We'll Do"}),e.jsx("div",{className:"space-y-0",children:s.what_well_do.map((t,d)=>e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-accent text-accent-foreground flex items-center justify-center text-sm font-sans font-bold flex-shrink-0",children:d+1}),d<s.what_well_do.length-1&&e.jsx("div",{className:"w-px flex-1 bg-border my-2"})]}),e.jsxs("div",{className:"pb-8",children:[e.jsx("p",{className:"text-xs font-sans font-medium text-ocean uppercase tracking-wide",children:t.time}),e.jsx("h4",{className:"font-serif text-lg font-medium text-foreground mb-1",children:t.title}),e.jsx("p",{className:"text-sm font-sans text-muted-foreground",children:t.description})]})]},d))})]}),s.included&&s.included.length>0&&e.jsxs("section",{children:[e.jsx("h2",{className:"heading-section mb-4",children:"What's Included"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:s.included.map((t,d)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm font-sans",children:[e.jsx(ke,{className:"w-4 h-4 text-ocean flex-shrink-0"}),e.jsx("span",{className:"text-foreground",children:t})]},d))})]}),s.to_bring&&s.to_bring.length>0&&e.jsxs("section",{children:[e.jsx("h2",{className:"heading-section mb-4",children:"What to Bring"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:s.to_bring.map((t,d)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm font-sans",children:[e.jsx(Is,{className:"w-4 h-4 text-accent flex-shrink-0"}),e.jsx("span",{className:"text-foreground",children:t})]},d))})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"heading-section mb-4",children:"Guest Requirements"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-card border border-border rounded-sm p-4",children:[e.jsx("p",{className:"text-xs font-sans font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Age"}),e.jsx("p",{className:"font-sans text-foreground",children:a.age_requirement||"All ages"})]}),e.jsxs("div",{className:"bg-card border border-border rounded-sm p-4",children:[e.jsx("p",{className:"text-xs font-sans font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Activity Level"}),e.jsx("p",{className:"font-sans text-foreground",children:a.activity_level||"Light"})]}),e.jsxs("div",{className:"bg-card border border-border rounded-sm p-4",children:[e.jsx("p",{className:"text-xs font-sans font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Group capacity"}),e.jsxs("p",{className:"font-sans text-foreground",children:[a.min_guests,"–",a.max_guests," ",Ce(s.price_unit_label)]})]})]})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"heading-section mb-4",children:"Price Information"}),k?e.jsx("div",{className:"bg-card border border-border rounded-sm p-4 sm:p-6",children:u?e.jsx("div",{className:"space-y-3",children:P.map(t=>e.jsxs("div",{children:[e.jsx("span",{className:"text-base font-sans font-medium text-foreground",children:t.label}),e.jsxs("span",{className:"text-sm text-muted-foreground font-sans ml-2",children:["$",y(t.price,g).toFixed(2)," each"]})]},t.id))}):e.jsxs("div",{className:"flex items-center gap-2 text-sm font-sans text-muted-foreground",children:[e.jsx(re,{className:"h-4 w-4 animate-spin shrink-0","aria-hidden":!0}),e.jsx("span",{children:"Loading prices…"})]})}):(((Ne=a.price_tiers)==null?void 0:Ne.length)??0)>0?e.jsx("div",{className:"bg-card border border-border rounded-sm p-4 sm:p-6",children:u?e.jsx(zs,{tiers:a.price_tiers,unitLabel:s.price_unit_label,catalogMarginDecimal:g}):e.jsxs("div",{className:"space-y-3","aria-busy":!0,children:[e.jsx(T,{className:"h-5 w-full max-w-md"}),e.jsx(T,{className:"h-5 w-[85%] max-w-md"}),e.jsx(T,{className:"h-5 w-[70%] max-w-sm"})]})}):e.jsx("div",{className:"bg-card border border-border rounded-sm p-4 sm:p-6",children:e.jsx("p",{className:"text-sm font-sans text-muted-foreground",children:"Price is per booking. Add this experience to the cart to confirm the total."})})]}),s.location_address&&e.jsxs("section",{children:[e.jsx("h2",{className:"heading-section mb-4",children:"Address"}),e.jsx("div",{className:"bg-card border border-border rounded-sm p-4",children:e.jsx("p",{className:"font-sans text-foreground",children:s.location_address})})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"heading-section mb-4",children:"Experience Details"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-card border border-border rounded-sm p-4",children:[e.jsx("p",{className:"text-xs font-sans font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Duration"}),e.jsx("p",{className:"font-sans text-foreground",children:a.duration_hours>=8?"Full day experience":`${a.duration_hours} hours`})]}),e.jsxs("div",{className:"bg-card border border-border rounded-sm p-4",children:[e.jsx("p",{className:"text-xs font-sans font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Languages"}),e.jsx("p",{className:"font-sans text-foreground",children:(a.languages||[]).length>0?(a.languages||[]).join(", "):"—"})]}),e.jsxs("div",{className:"bg-card border border-border rounded-sm p-4",children:[e.jsx("p",{className:"text-xs font-sans font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Available Days"}),(()=>{const t=(a.available_days||[]).filter(Boolean);return t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:t.map(d=>e.jsx(A,{variant:"outline",className:"text-sm font-sans",children:d},d))}):e.jsx("p",{className:"font-sans text-sm text-muted-foreground mt-2",children:"No dates configured for booking."})})()]}),e.jsxs("div",{className:"bg-card border border-border rounded-sm p-4",children:[e.jsx("p",{className:"text-xs font-sans font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Time Slots"}),(a.time_slots||[]).length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:(a.time_slots||[]).map(t=>e.jsx(A,{variant:"secondary",className:"text-sm font-sans",children:t},t))}):e.jsx("p",{className:"font-sans text-sm text-muted-foreground mt-2",children:"Contact us for time options."})]})]})]}),s.host&&e.jsxs("section",{children:[e.jsx("h2",{className:"heading-section mb-6",children:"Meet Your Host"}),e.jsx("div",{className:"bg-card border border-border rounded-sm p-6 md:p-8",children:e.jsxs("div",{className:"flex items-start gap-6",children:[e.jsxs("div",{className:"w-20 h-20 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-2xl font-serif font-bold flex-shrink-0",children:[s.host.first_name[0],s.host.last_name[0]]}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsxs("h3",{className:"font-serif text-xl font-medium text-foreground",children:[s.host.first_name," ",s.host.last_name]}),s.host.is_superhost&&e.jsx(A,{className:"bg-gold text-gold-foreground font-sans text-xs",children:"Superhost"})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm font-sans text-muted-foreground mb-4",children:[!!s.host.rating&&!!s.host.review_count&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(K,{className:"w-3.5 h-3.5 fill-gold text-gold"})," ",s.host.rating]}),e.jsxs("span",{children:[s.host.review_count," reviews"]})]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ze,{className:"w-3.5 h-3.5"})," ",s.host.languages.join(", ")]})]}),e.jsx("p",{className:"text-sm font-sans text-muted-foreground leading-relaxed",children:s.host.bio}),e.jsxs("p",{className:"text-xs font-sans text-ocean mt-3",children:[e.jsx(Rs,{className:"w-3 h-3 inline mr-1"})," Response rate: ",s.host.response_rate,"%"]})]})]})})]}),o&&o.length>0&&e.jsxs("section",{children:[e.jsxs("h2",{className:"heading-section mb-6",children:[e.jsx(K,{className:"w-6 h-6 inline fill-gold text-gold mr-2"}),s.rating," · ",o.length," Reviews"]}),e.jsx("div",{className:"grid grid-cols-5 gap-2 mb-8",children:Oe.map(t=>e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-xs font-sans text-muted-foreground mb-1",children:[t.star," star"]}),e.jsx("div",{className:"h-2 bg-secondary rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gold rounded-full",style:{width:`${t.pct}%`}})}),e.jsx("div",{className:"text-xs font-sans text-muted-foreground mt-1",children:t.count})]},t.star))}),e.jsx("div",{className:"space-y-6",children:o.map(t=>e.jsxs("div",{className:"border-b border-border pb-6 last:border-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-secondary text-foreground flex items-center justify-center text-sm font-sans font-bold",children:t.reviewer_name[0]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-sans font-medium text-foreground text-sm",children:t.reviewer_name}),e.jsx("p",{className:"text-xs font-sans text-muted-foreground",children:new Date(t.created_at).toLocaleDateString("en-US",{month:"long",year:"numeric"})})]}),e.jsx("div",{className:"ml-auto flex items-center gap-0.5",children:[...Array(t.rating)].map((d,S)=>e.jsx(K,{className:"w-3.5 h-3.5 fill-gold text-gold"},S))})]}),e.jsx("p",{className:"text-sm font-sans text-muted-foreground",children:t.comment})]},t.id))})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"heading-section mb-4",children:"Cancellation Policy"}),s.cancellation_policies&&s.cancellation_policies.length>0?e.jsx("ul",{className:"list-disc pl-5 space-y-2 text-editorial text-foreground",children:s.cancellation_policies.map((t,d)=>e.jsx("li",{children:t},d))}):e.jsx("p",{className:"text-editorial text-muted-foreground",children:"Cancellation terms for this experience are not listed yet. Contact us for details."})]})]}),e.jsx("div",{className:"lg:col-span-1",children:e.jsxs("div",{className:"sticky top-24 bg-card border border-border rounded-sm p-6 shadow-medium",children:[oe&&s.booking_products&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"font-serif text-lg font-medium text-foreground mb-3",children:"Select your option"}),e.jsx("div",{className:"space-y-2 mb-4",children:s.booking_products.map(t=>e.jsxs("button",{type:"button",onClick:()=>X(t.id),className:Ye("w-full text-left p-3 rounded-sm border transition-all",a.id===t.id?"border-accent bg-accent/5 shadow-soft":"border-border bg-card hover:border-accent/50 hover:shadow-soft"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h4",{className:"font-sans text-sm font-medium text-foreground truncate",children:t.name}),e.jsxs("p",{className:"flex items-center gap-1 text-sm text-muted-foreground font-sans mt-0.5",children:[e.jsx(Gs,{className:"w-3.5 h-3.5 shrink-0"}),_e(t.max_guests,s.price_unit_label)]})]}),e.jsx("div",{className:"text-right shrink-0 whitespace-nowrap",children:u?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"font-serif text-xl font-medium text-foreground tabular-nums",children:["$",Number(t.preview_price||0).toFixed(2)]}),(t.price_type==="per_pax"||t.price_tiers.length>0)&&e.jsxs("span",{className:"text-sm text-muted-foreground font-sans",children:[" ","/ ",Ue]})]}):e.jsxs("span",{className:"inline-flex items-center justify-end gap-1.5 font-serif text-xl text-muted-foreground tabular-nums",children:[e.jsx(re,{className:"h-4 w-4 animate-spin","aria-hidden":!0}),e.jsx("span",{className:"sr-only",children:"Loading price"}),e.jsx("span",{"aria-hidden":!0,children:"—"})]})})]}),e.jsx("div",{className:"mt-2",children:e.jsxs(A,{variant:"secondary",className:"bg-ocean/10 text-ocean text-[9px] font-sans tracking-wider uppercase",children:[e.jsx(ke,{className:"w-3 h-3 mr-0.5"})," Available"]})})]},t.id))})]}),s.is_instant_book&&e.jsxs(A,{className:"bg-ocean/10 text-ocean font-sans text-xs mb-4 w-full justify-center gap-1",children:[e.jsx(ys,{className:"w-3 h-3"})," Instant Confirmation"]}),e.jsx(ae,{className:"mb-4"}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("label",{className:"text-sm font-sans font-medium flex items-center gap-0.5 mb-2",children:["Date ",e.jsx("span",{className:"text-destructive",children:"*"})]}),se?e.jsxs(ws,{children:[e.jsx(ks,{asChild:!0,children:e.jsxs(M,{type:"button",variant:"outline",className:"w-full justify-start text-left font-normal",disabled:!R,children:[e.jsx(Se,{className:"mr-2 h-4 w-4"}),h?Je(h,"PPP"):"Select date"]})}),e.jsx(Ss,{className:"w-auto p-0",align:"start",children:e.jsx(_s,{mode:"single",selected:h,onSelect:x,disabled:t=>ve(t,{cutoffHours:a.cutoff_hours,timeSlots:me,availableDays:a.available_days}),initialFocus:!0})})]}):e.jsxs("div",{className:"flex min-h-10 w-full items-center gap-2 rounded-md border border-input bg-muted/40 px-3 py-2 text-sm text-muted-foreground",role:"status","aria-live":"polite",children:[e.jsx(Se,{className:"h-4 w-4 shrink-0 opacity-60","aria-hidden":!0}),e.jsx("span",{className:"font-sans",children:"No dates available"})]})]}),e.jsxs("div",{className:k||a.price_tiers&&a.price_tiers.length>0?"mb-4":"mb-6",children:[e.jsxs("label",{className:"text-sm font-sans font-medium flex items-center gap-0.5 mb-2",children:["Time ",e.jsx("span",{className:"text-destructive",children:"*"})]}),R?e.jsxs(Te,{value:b,onValueChange:w,children:[e.jsxs(Fe,{className:"w-full",children:[e.jsx(ne,{className:"mr-2 h-4 w-4 shrink-0"}),e.jsx(Ee,{})]}),e.jsx(Be,{children:me.map(t=>e.jsx(Me,{value:t,disabled:!!h&&!J(h,t,a.cutoff_hours),children:t},t))})]}):e.jsxs("div",{className:"flex h-10 w-full items-center gap-2 rounded-md border border-input bg-muted/40 px-3 py-2 text-sm text-muted-foreground",role:"status","aria-live":"polite",children:[e.jsx(ne,{className:"h-4 w-4 shrink-0 opacity-60","aria-hidden":!0}),e.jsx("span",{className:"font-sans",children:"No time slot available"})]})]}),!L&&!k&&a.price_tiers&&a.price_tiers.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"mb-4"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"text-xs font-sans font-medium text-muted-foreground uppercase tracking-wide mb-3",children:"Pricing"}),u?e.jsx(Ps,{tiers:a.price_tiers,unitLabel:s.price_unit_label,minPax:a.min_guests,maxPax:G,catalogMarginDecimal:g,onChange:(t,d)=>{N(t),_(d)}},a.id):e.jsxs("div",{className:"space-y-3 pt-1","aria-busy":!0,children:[e.jsx(T,{className:"h-10 w-full"}),e.jsx(T,{className:"h-10 w-full"}),e.jsx("div",{className:"flex justify-end",children:e.jsx(T,{className:"h-8 w-24"})})]})]})]}),!L&&k&&e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"mb-4"}),e.jsxs("div",{className:"mb-4 space-y-4",children:[e.jsx("p",{className:"text-xs font-sans font-medium text-muted-foreground uppercase tracking-wide",children:"Pricing"}),e.jsx("div",{className:"space-y-3",children:P.map(t=>{const d=F[t.id]??0,S=t.max_qty!=null?Math.min(t.max_qty,W):W,$=d<S&&V<W,B=d>(t.min_qty||0);return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-base font-sans font-medium text-foreground",children:t.label}),t.is_primary&&e.jsx("span",{className:"text-xs text-muted-foreground font-sans ml-1",children:"(required)"}),e.jsx("span",{className:"text-sm text-muted-foreground font-sans ml-2 tabular-nums",children:u?e.jsxs(e.Fragment,{children:["$",y(t.price,g).toFixed(2)," each"]}):e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(re,{className:"h-3.5 w-3.5 animate-spin shrink-0","aria-hidden":!0}),e.jsx("span",{"aria-hidden":!0,children:"—"})]})})]}),e.jsxs("div",{className:"flex items-center gap-3 select-none",children:[e.jsx("button",{type:"button",onClick:()=>E(v=>({...v,[t.id]:Math.max(t.min_qty||0,(v[t.id]??0)-1)})),disabled:!B,className:"w-8 h-8 rounded-sm border border-border flex items-center justify-center hover:bg-secondary transition-colors disabled:opacity-30 disabled:pointer-events-auto",onMouseDown:v=>{B||v.preventDefault()},"aria-label":`Decrease ${t.label}`,children:e.jsx(Ae,{className:"w-4 h-4"})}),e.jsx("span",{className:"font-sans font-medium w-8 text-center select-none",children:d}),e.jsx("button",{type:"button",onClick:()=>E(v=>({...v,[t.id]:$?(v[t.id]??0)+1:v[t.id]??0})),disabled:!$,className:"w-8 h-8 rounded-sm border border-border flex items-center justify-center hover:bg-secondary transition-colors disabled:opacity-30 disabled:pointer-events-auto",onMouseDown:v=>{$||v.preventDefault()},"aria-label":`Increase ${t.label}`,children:e.jsx(Ie,{className:"w-4 h-4"})})]})]},t.id)})}),!pe&&Z.length>0&&e.jsxs("p",{className:"text-xs font-sans text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800 rounded-sm px-3 py-2 text-center",children:["At least 1 ",Z.map(t=>t.label).join(" or ")," is required."]}),e.jsx("div",{className:"pt-3 border-t border-border space-y-1 select-none",children:u?e.jsxs(e.Fragment,{children:[Q.map(t=>e.jsxs("div",{className:"flex justify-between text-sm font-sans text-muted-foreground",children:[e.jsxs("span",{children:[t.count," × ",t.label," @ $",y(t.price,g).toFixed(2)]}),e.jsxs("span",{children:["$",(t.count*y(t.price,g)).toFixed(2)]})]},t.label)),e.jsxs("div",{className:"flex justify-between items-center pt-1",children:[e.jsx("span",{className:"text-base font-sans font-semibold text-foreground",children:"Total"}),e.jsxs("span",{className:"text-xl font-serif font-medium text-foreground",children:["$",qe.toFixed(2)]})]})]}):e.jsxs("div",{className:"space-y-2 pt-1","aria-busy":!0,children:[e.jsx(T,{className:"h-4 w-full"}),e.jsx(T,{className:"h-4 w-[72%]"}),e.jsxs("div",{className:"flex justify-between items-center pt-1",children:[e.jsx(T,{className:"h-5 w-14"}),e.jsx(T,{className:"h-7 w-20"})]})]})})]})]}),!L&&k&&V<te&&e.jsxs("p",{className:"text-xs font-sans text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800 rounded-sm px-3 py-2 mb-3 text-center",children:["Minimum group size: ",_e(te,s.price_unit_label)]}),L&&e.jsx("p",{className:"text-xs font-sans text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800 rounded-sm px-3 py-2 mb-3 text-center",children:"This option is sold out (no remaining quantity)."}),!!h&&!ue&&a.cutoff_hours!=null&&Number(a.cutoff_hours)>0&&e.jsxs("p",{className:"text-xs font-sans text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800 rounded-sm px-3 py-2 mb-3 text-center",children:["Choose a later time — bookings must be at least ",Number(a.cutoff_hours)," hours before the experience starts."]}),e.jsx(Cs,{product:{id:a.id,productGroupId:s.id,title:s.title,subtitle:oe?`${s.location_city} • ${a.name}`:`${s.location_city} • ${a.duration_hours>=8?"Full day":`${a.duration_hours}h`}`,imageUrl:ee,unitPrice:k?xe:m>0?m:a.preview_price,type:"experience",status:s.booking_status,provider:"REZGO",showTime:!0,quantityLabel:s.price_unit_label||"Quantity",priceType:k?"per_pax":a.price_type==="per_item"?"per_item":a.price_tiers&&a.price_tiers.length>0?"tiered":"per_item"},variant:"accent",size:"default",label:"Add to Cart",className:"w-full mb-3",disabled:!se||!R||!De||ze||L||!ue||!u,inventoryQuantity:a.inventory_quantity,timeSlots:a.time_slots,priceTiers:k?P.map(t=>({label:t.label,price:t.price,type:"per_person"})):a.price_tiers,tierTotal:k?xe:m,tierBreakdown:k?Q:C,minPax:a.min_guests,maxPax:G,inlineBooking:{startDate:h,selectedTime:b}}),e.jsx("p",{className:"text-xs text-center text-muted-foreground font-sans",children:s.booking_status==="CONFIRMED"?"Instant confirmation":"Host will confirm within 24h"})]})})]})})]})}export{Ot as default};