PageSourceSearch

https://jhasolutions.com/assets/Calendar-BLlccGWc.js

js jhasolutions.com collected 2026-10-02 01:33:41 UTC 23,042 bytes, 1 lines download raw bytes

1import{r as p,j as e}from"./query-vendor-CqOtiPNe.js";import{w as Ce,H as Me,B as I,h as L,m as B,c as w,j as Se,T as Ie,R as Le}from"./index-CgiuONvO.js";import{D as le,z as Be}from"./DashboardLayout-bhpyg6kK.js";import{P as De}from"./PageHeader-CZkE0AwI.js";import{B as $e}from"./badge-CSzvBtO5.js";import{S as Ee,a as Te,b as Fe,c as Ae,d as V}from"./select-DLa9MRfA.js";import{T as ze,a as Oe,b as ee}from"./tabs-DhAXdYsK.js";import{u as We}from"./useListings-DtVnQ-LU.js";import{u as Pe}from"./useBookings-CAiDnDJ3.js";import{u as Re,A as He}from"./AvailabilityBlockDialog-BJMqiNTB.js";import{u as Ue}from"./useICalImports-C8oHEZdA.js";import{u as Ve}from"./useProperties-DAUpZ_Uw.js";import{B as qe}from"./BookingDialog-CuZU8T1h.js";import{s as q,d as ce,f as k}from"./format-Ch7dQtBq.js";import{a as E}from"./addDays-DdzlNAKv.js";import{p as _}from"./parseISO-k3Q1d3Py.js";import{i as z}from"./isSameDay-DKb4pGQS.js";import{S as Ge}from"./square-DpPlSXOl.js";import{P as Je}from"./plus-DhJDBkeB.js";import{C as Ke}from"./calendar-days-BvC5INej.js";import{C as Qe}from"./chevron-left-ChhJq7GD.js";import{C as Xe}from"./chevron-right-Cl4Mx2Wq.js";import{H as Ye}from"./hotel-GOTEiWOT.js";import{L as de}from"./list-ordered-CD-hc5AR.js";import{a as te}from"./isBefore-CgCj7brn.js";import"./react-vendor-Oyj1q24G.js";import"./ui-vendor-C92kXd7i.js";import"./chart-vendor-De-uRwFm.js";import"./use-mobile-Bs-uMLmp.js";import"./input-oPoHA7Fw.js";import"./separator-BBHmpRWz.js";import"./sheet-Dt5T48FQ.js";import"./skeleton-B97PTBMn.js";import"./tooltip-DukMi9Yb.js";import"./Logo-BMQirxBI.js";import"./calendar-njTWr43i.js";import"./house-C9sHcoTX.js";import"./building-2-Dhg-JMoH.js";import"./users-BKG6ZMTq.js";import"./map-pin-C3B4zHzE.js";import"./wrench-BveqLzJ6.js";import"./wifi-off--tLv87Xm.js";import"./message-square-BqIfb2eA.js";import"./file-text-BqBFGr3S.js";import"./credit-card-B4XMcBmh.js";import"./panel-top-C_rCNK16.js";import"./mail-dnbKMUvE.js";import"./log-out-BzS-CLno.js";import"./scroll-area-Cf6pvS46.js";import"./index-BdQq_4o_.js";import"./bell-CJIBHycy.js";import"./check-check-XSobeTl0.js";import"./formatDistanceToNow-DExfhm_y.js";import"./en-US-5rFTtd83.js";import"./LanguageSwitcher-k7A6VFzv.js";import"./dropdown-menu-D-1fS2hr.js";import"./check-EsNBkSFR.js";import"./circle-QNrbGPhh.js";import"./languages-1QBd6nWm.js";import"./message-circle-C3Kdh8KU.js";import"./activity-DmUxG0fV.js";import"./arrow-down-C4HxAdL9.js";import"./arrow-left-Cg5pwYzI.js";import"./arrow-right-left-tf9Dbt9n.js";import"./arrow-right-CcjvJnjH.js";import"./banknote-wg82AAG7.js";import"./bed--FRu_ZOR.js";import"./book-open-check-DeGSCDpn.js";import"./book-open-CkJItcBu.js";import"./brain-QP504LxU.js";import"./building-B1y8ifkf.js";import"./calculator-BuA7e-mZ.js";import"./car-BBeSSily.js";import"./landmark-DVOwzqRj.js";import"./chart-no-axes-column-increasing-DINm0A4J.js";import"./chart-pie-BH1JXQN4.js";import"./chevron-down-C04YKbFY.js";import"./chevron-up-YEko4sQ9.js";import"./circle-check-big-B-nqExcc.js";import"./circle-check-DJQ0aRpE.js";import"./message-square-text-CGi8Ghec.js";import"./circle-help-C7Zpw0pA.js";import"./circle-x-BuyswQ-Z.js";import"./clipboard-check-BqHgjlQp.js";import"./clipboard-list-Csw_7fPS.js";import"./clipboard-BrLc9XKt.js";import"./clock-DZbyb8Zh.js";import"./copy-B3hQhSgM.js";import"./database-BFqeg3FR.js";import"./dollar-sign-BoJmMuTa.js";import"./download-CVkjVrJo.js";import"./zoom-out-CZzr-t9-.js";import"./external-link-DLbL3mEn.js";import"./twitter-DZP3beY2.js";import"./file-chart-column-increasing-B5g6evDe.js";import"./file-check-2P_f7S4-.js";import"./file-spreadsheet-BbKDqPhp.js";import"./filter-DOTkE5Cb.js";import"./folder-open-CQAcdSBr.js";import"./tree-pine-BPQJJftn.js";import"./globe-CnUNDEKq.js";import"./video-CEw6mOAP.js";import"./hammer-wk7AQWqX.js";import"./heart-BnQgcucT.js";import"./image-plus-DfX-_AyQ.js";import"./image-DrO_YHf9.js";import"./infinity-BeOXN0LM.js";import"./key-round-Cl3pyXjD.js";import"./pen-tool-ErvG_pvg.js";import"./keyboard-CzV9enBr.js";import"./layers-BFQ0OLI3.js";import"./lightbulb-IBP3Qpkq.js";import"./list-checks-CsRR_GQp.js";import"./list-Cj3mFARp.js";import"./lock-rMWs3zu_.js";import"./map-pinned-DBhEITMu.js";import"./map-Dml-fuwB.js";import"./maximize-2-BAo6X0VP.js";import"./maximize-DllRQL4I.js";import"./menu-B6QavzjZ.js";import"./minus-BWhsihkF.js";import"./mouse-pointer-click-BX0OFv2U.js";import"./mouse-z7gxK0yj.js";import"./navigation-CE5W2bfp.js";import"./pause-DMf9J0er.js";import"./pencil-s0UamddO.js";import"./ruler-PMZpHEX4.js";import"./phone-CCpZm87m.js";import"./play-jGttOVZX.js";import"./printer-DPItEGKX.js";import"./refresh-ccw-D8-NZbc0.js";import"./rocket-o5dk1x7z.js";import"./rotate-ccw-D5LvpNON.js";import"./rotate-cw-qBQXdDzU.js";import"./route-BHkgA-GC.js";import"./save-CD5NOpBU.js";import"./scale-ChbaOrX5.js";import"./search-CT8fLn3_.js";import"./send-Dev9pED3.js";import"./share-2-CZ8fruyy.js";import"./square-plus-BYoTN96c.js";import"./skip-forward-B2g28Adz.js";import"./smartphone-BVaS8Ogf.js";import"./square-check-big-S7f3xHqK.js";import"./square-pen-Cd8FE6iD.js";import"./star-DgTF5ai2.js";
1import"./trash-2-XdlKjO4t.js";import"./trending-down-BOTbmgUi.js";import"./trending-up-BVHf_RoK.js";import"./upload-B2TjyuSq.js";import"./user-check-DLa2T6BS.js";import"./user-C4n8hF8r.js";import"./volume-2-CyzFl9Wm.js";import"./volume-x-DwUdAb_B.js";import"./wallet-DFZjOwp1.js";import"./workflow-eRF_Iozj.js";import"./zap-CZwSyBya.js";import"./useIsRTL-CvXztNyx.js";import"./useOrganization-BfvJJCCq.js";import"./index.esm-D5lf4VrX.js";import"./types-BjVZakaZ.js";import"./form-CuAyl4xB.js";import"./calendar-DaWx4mTj.js";import"./startOfMonth-CR-gPZr_.js";import"./addMonths-YCl4V_qS.js";import"./isSameMonth-9MImqN3e.js";import"./subDays-CTCG_ujS.js";import"./textarea-CxLaKExY.js";import"./differenceInDays-DGg7-ojw.js";const T={direct:{bg:"bg-emerald-500",ring:"ring-emerald-500/60",label:"Direct"},airbnb:{bg:"bg-rose-500",ring:"ring-rose-500/60",label:"Airbnb"},vrbo:{bg:"bg-sky-500",ring:"ring-sky-500/60",label:"Vrbo"},booking:{bg:"bg-indigo-600",ring:"ring-indigo-600/60",label:"Booking.com"},block:{bg:"bg-zinc-400",ring:"ring-zinc-400/60",label:"Blocked"},other:{bg:"bg-amber-500",ring:"ring-amber-500/60",label:"Other"}},O=44,Ze={manual:"block",unavailable:"block",bookingcom:"booking","booking.com":"booking"},se=n=>{const a=(n||"").trim().toLowerCase().replace(/\s+/g,"");return a?Ze[a]??a:"other"},me=(n,a)=>{const l=se(n);return!!a||!!n&&l!=="block"},et=(n,a)=>n.start<a.end&&a.start<n.end,tt=n=>{var g;const a=[...n].sort((c,m)=>c.start.getTime()-m.start.getTime()||c.end.getTime()-m.end.getTime()),l=[];for(const c of a){const m=l[l.length-1];if(m&&m.kind!=="booking"&&c.kind!=="booking"&&m.source===c.source&&c.start<=m.end){m.end=m.end>c.end?m.end:c.end,m.id=`${m.id}:${c.id}`,m.mergedCount=(m.mergedCount??1)+(c.mergedCount??1),m.label=m.label===c.label?m.label:`${((g=T[m.source])==null?void 0:g.label)??"Channel"} merged`;continue}l.push({...c,mergedCount:c.mergedCount??1})}return l},st=n=>{const a=[...n].sort((g,c)=>g.start.getTime()-c.start.getTime());let l=0;for(let g=0;g<a.length;g+=1)for(let c=g+1;c<a.length&&!(a[c].start>=a[g].end);c+=1)et(a[g],a[c])&&(l+=1);return l},dr=()=>{const{listings:n,isLoading:a}=We(),{bookings:l,isLoading:g}=Pe(),{blocks:c,isLoading:m}=Re(),{imports:P,isLoading:ge}=Ue(),{properties:C,isLoading:ue}=Ve(),xe=a||g||m||ge||ue,[R,ie]=p.useState(()=>q(new Date)),[D,he]=p.useState(30),[v,fe]=p.useState("all_active"),[H,J]=p.useState({open:!1,listingId:null,bookingId:null}),[F,K]=p.useState({open:!1,listingId:null}),x=p.useRef(null),[y,Q]=p.useState(null),$=p.useMemo(()=>Array.from({length:D},(t,s)=>E(R,s)),[R,D]),re=p.useMemo(()=>new Map(C.map(t=>[t.id,t])),[C]),A=p.useMemo(()=>new Map(n.map(t=>[t.id,t])),[n]),be=p.useMemo(()=>C.filter(t=>n.some(s=>s.property_id===t.id)),[C,n]),X=p.useMemo(()=>{const t=new Set(n.map(i=>i.property_id)),s=C.filter(i=>!t.has(i.id)).map(i=>({id:`ghost:${i.id}`,property_id:i.id,title:i.name,description:null,nightly_rate:0,cleaning_fee:0,max_guests:0,is_active:!0,created_by:null,created_at:i.created_at??new Date().toISOString(),updated_at:i.updated_at??new Date().toISOString(),ical_feed_token:null}));return[...n,...s]},[n,C]),h=p.useMemo(()=>{const t=v==="all_with_inactive"?X:X.filter(s=>s.is_active);if(v==="all_active"||v==="all_with_inactive")return t;if(v.startsWith("listing:")){const s=v.replace("listing:","");return t.filter(i=>i.id===s)}return t.filter(s=>s.property_id===v)},[X,v]),M=p.useMemo(()=>new Set(h.map(t=>t.id)),[h]),Y=p.useMemo(()=>{const t=new Map;return n.forEach(s=>t.set(s.id,[])),l.forEach(s=>{var r;if(s.status==="cancelled")return;const i=A.get(s.listing_id);if(!i)return;const o={kind:"booking",id:s.id,listingId:s.listing_id,propertyId:i.property_id,start:_(s.check_in),end:_(s.check_out),label:s.guest_name,source:se(s.booking_source??"direct"),status:s.status};(r=t.get(s.listing_id))==null||r.push(o)}),c.forEach(s=>{var u;const i=A.get(s.listing_id);if(!i)return;const o=me(s.source,s.external_uid),r=o?se(s.source):"block",d=T[r]??T.other,b={kind:o?"ical":"block",id:s.id,listingId:s.listing_id,propertyId:i.property_id,start:_(s.start_date),end:_(s.end_date),label:s.external_summary||s.reason||(o?`${d.label} hold`:s.block_type||"Blocked"),source:r};(u=t.get(s.listing_id))==null||u.push(b)}),t.forEach((s,i)=>{t.set(i,tt(s))}),t},[n,A,l,c]),N=p.useMemo(()=>{const t=q(new Date),s=E(t,30);let i=0,o=0,r=0;const d=30*Math.max(h.length,1);return h.forEach(u=>{const U=Y.get(u.id)||[];
1r+=st(U),U.forEach(j=>{const Ne=j.start<t?t:j.start,_e=j.end>s?s:j.end,we=Math.max(0,ce(_e,Ne));i+=we,j.kind==="booking"&&j.start>=t&&j.start<=s&&(o+=1)})}),{occupancy:Math.round(i/d*100),upcomingCheckins:o,occupiedNights:i,conflictCount:r}},[Y,h]),f=p.useMemo(()=>{const t=P.filter(d=>d.is_active&&M.has(d.listing_id)),s=t.filter(d=>d.last_sync_status==="ok"),i=t.filter(d=>d.last_sync_status==="error"),o=c.filter(d=>M.has(d.listing_id)&&me(d.source,d.external_uid)),r=new Set(t.map(d=>{var b;return(b=A.get(d.listing_id))==null?void 0:b.property_id}).filter(d=>!!d));return{activeFeeds:t.length,healthyFeeds:s.length,errorFeeds:i.length,importedBlocks:o.length,mappedProperties:r.size}},[P,M,c,A]),S=p.useMemo(()=>q(new Date),[]),Z=p.useMemo(()=>{const t=l.filter(o=>o.status!=="cancelled"&&M.has(o.listing_id)&&z(_(o.check_in),S)),s=l.filter(o=>o.status!=="cancelled"&&M.has(o.listing_id)&&z(_(o.check_out),S)),i=l.filter(o=>o.status!=="cancelled"&&M.has(o.listing_id)&&z(_(o.check_in),E(S,1)));return{checkins:t,checkouts:s,tomorrow:i}},[l,S,M]),oe=p.useCallback(t=>ie(s=>E(s,t)),[]),je=(t,s)=>{t.startsWith("ghost:")||(x.current={listingId:t,start:s},Q({listingId:t,end:s}))},ke=(t,s)=>{!x.current||x.current.listingId!==t||t.startsWith("ghost:")||Q({listingId:t,end:s})},ne=()=>{if(!x.current)return;const{listingId:t,start:s}=x.current,i=(y==null?void 0:y.end)||s,[o,r]=te(s,i)?[s,i]:[i,s];x.current=null,Q(null),K({open:!0,listingId:t,defaultStart:o,defaultEnd:E(r,1)})},ve=(t,s,i)=>{i.stopPropagation(),s.kind==="booking"&&J({open:!0,listingId:t,bookingId:s.id})},ye=(t,s)=>{const i=$.findIndex(u=>!te(u,s.start));if(i===-1)return null;const o=$.findIndex(u=>!te(u,s.end)),r=o===-1?$.length:o;if(r<=i)return null;const d=T[s.source]??T.other,b=ce(s.end,s.start);return e.jsxs("button",{onClick:u=>ve(t,s,u),className:w("absolute top-1.5 bottom-1.5 rounded-md px-2 text-left text-xs font-medium","text-white shadow-sm transition-all hover:brightness-110 hover:shadow-md","ring-1 ring-inset ring-white/10",d.bg,s.kind!=="booking"&&"opacity-90"),style:{left:`${i*O+2}px`,width:`${(r-i)*O-4}px`},title:`${s.label} - ${k(s.start,"MMM d")} to ${k(s.end,"MMM d")} (${b}n)`,children:[e.jsx("span",{className:"block truncate",children:s.label}),e.jsxs("span",{className:"block truncate text-[10px] opacity-80",children:[b,"n - ",d.label,s.mergedCount&&s.mergedCount>1?` x${s.mergedCount}`:""]})]},`${s.kind}-${s.id}`)};if(xe)return e.jsx(le,{className:"flex items-center justify-center",children:e.jsx(Ce,{})});const ae=n.length>0||C.length>0;return e.jsxs(le,{children:[e.jsxs(Me,{children:[e.jsx("title",{children:"Calendar - JHA Solutions"}),e.jsx("meta",{name:"description",content:"One calendar for all your short-term rentals. Auto-sync with Airbnb, Vrbo and Booking.com via iCal."})]}),e.jsx(De,{title:"Calendar",subtitle:"Bookings, manual blocks, and every property iCal merged into one operations view.",icon:e.jsx(Ke,{className:"h-5 w-5"}),actions:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{const t=h.find(s=>!s.id.startsWith("ghost:"));K({open:!0,listingId:(t==null?void 0:t.id)??null})},disabled:!h.some(t=>!t.id.startsWith("ghost:")),children:[e.jsx(Ge,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 hidden sm:inline",children:"Block dates"})]}),e.jsxs(I,{size:"sm",onClick:()=>{const t=h.find(s=>!s.id.startsWith("ghost:"));J({open:!0,listingId:(t==null?void 0:t.id)??null,bookingId:null})},disabled:!h.some(t=>!t.id.startsWith("ghost:")),children:[e.jsx(Je,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 hidden sm:inline",children:"New booking"})]})]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-5",children:[e.jsx(W,{label:"Reserved - next 30d",value:`${isFinite(N.occupancy)?N.occupancy:0}%`,accent:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400"}),e.jsx(W,{label:"Upcoming check-ins",value:N.upcomingCheckins.toString(),accent:"bg-sky-500/10 text-sky-600 dark:text-sky-400"}),e.jsx(W,{label:"Blocked nights",value:N.occupiedNights.toString(),accent:"bg-violet-500/10 text-violet-600 dar
1k:text-violet-400"}),e.jsx(W,{label:"iCal feeds",value:`${f.healthyFeeds}/${f.activeFeeds}`,accent:"bg-indigo-500/10 text-indigo-600 dark:text-indigo-400"}),e.jsx(W,{label:"Conflicts",value:N.conflictCount.toString(),accent:"bg-amber-500/10 text-amber-600 dark:text-amber-400"})]}),e.jsx(L,{className:"border-border/60",children:e.jsxs(B,{className:"flex flex-col gap-3 p-3 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(I,{variant:"outline",size:"icon",onClick:()=>oe(-Math.floor(D/2)),children:e.jsx(Qe,{className:"h-4 w-4"})}),e.jsx(I,{variant:"outline",size:"sm",onClick:()=>ie(q(new Date)),className:"font-medium",children:"Today"}),e.jsx(I,{variant:"outline",size:"icon",onClick:()=>oe(Math.floor(D/2)),children:e.jsx(Xe,{className:"h-4 w-4"})}),e.jsxs("div",{className:"ml-2 text-sm font-semibold text-foreground",children:[k(R,"MMM d")," - ",k(E(R,D-1),"MMM d, yyyy")]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(ze,{value:String(D),onValueChange:t=>he(Number(t)),children:e.jsxs(Oe,{className:"h-8",children:[e.jsx(ee,{value:"14",className:"h-7 px-3 text-xs",children:"2 weeks"}),e.jsx(ee,{value:"30",className:"h-7 px-3 text-xs",children:"Month"}),e.jsx(ee,{value:"60",className:"h-7 px-3 text-xs",children:"2 months"})]})}),e.jsxs(Ee,{value:v,onValueChange:fe,children:[e.jsx(Te,{className:"h-8 w-[180px] text-xs",children:e.jsx(Fe,{placeholder:"All active properties"})}),e.jsxs(Ae,{children:[e.jsx(V,{value:"all_active",children:"Active properties"}),e.jsx(V,{value:"all_with_inactive",children:"All properties"}),be.map(t=>e.jsx(V,{value:t.id,children:t.name},t.id)),n.filter(t=>!re.has(t.property_id)).map(t=>e.jsx(V,{value:`listing:${t.id}`,children:t.title},t.id))]})]})]})]})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground",children:[Object.entries(T).map(([t,s])=>e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:w("h-2.5 w-2.5 rounded-sm",s.bg)}),s.label]},t)),e.jsxs("span",{className:"ml-auto hidden items-center gap-1.5 text-[11px] md:flex",children:[e.jsx(Se,{className:"h-3.5 w-3.5 text-violet-500"}
1),"Smart merge active"]})]}),!ae&&e.jsx(L,{className:"border-dashed border-border/60",children:e.jsxs(B,{className:"flex flex-col items-center gap-3 py-12 text-center",children:[e.jsx(Ye,{className:"h-10 w-10 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-base font-medium",children:"No listings yet"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Add your first short-term rental listing to start tracking bookings."})]}),e.jsx(I,{asChild:!0,size:"sm",children:e.jsx("a",{href:"/rentals",children:"Go to Rentals"})})]})}),ae&&e.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-[1fr_320px]",children:[e.jsx(L,{className:"overflow-hidden border-border/60",children:e.jsx(B,{className:"p-0",children:e.jsx("div",{className:"select-none overflow-x-auto",onMouseLeave:()=>{x.current&&ne()},onMouseUp:ne,children:e.jsxs("div",{className:"min-w-fit",style:{minWidth:`${220+$.length*O}px`},children:[e.jsxs("div",{className:"sticky top-0 z-10 flex border-b bg-background/95 backdrop-blur",children:[e.jsx("div",{className:"w-[220px] flex-shrink-0 border-r p-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Property / listing"}),e.jsx("div",{className:"flex",children:$.map((t,s)=>{const i=z(t,S),o=t.getDay()===0||t.getDay()===6,r=t.getDate()===1;return e.jsxs("div",{className:w("flex-shrink-0 border-r px-1 py-2 text-center text-[11px]",o&&"bg-muted/40",i&&"bg-primary/10",r&&"border-l-2 border-l-primary/30"),style:{width:`${O}px`},children:[e.jsx("div",{className:"text-muted-foreground",children:k(t,"EEE").slice(0,2)}),e.jsx("div",{className:w("mt-0.5 text-sm font-semibold",i&&"text-primary"),children:k(t,"d")}),r&&e.jsx("div",{className:"text-[9px] uppercase text-muted-foreground",children:k(t,"MMM")})]},s)})})]}),h.map(t=>{const s=Y.get(t.id)??[],i=re.get(t.property_id),o=P.filter(r=>r.listing_id===t.id&&r.is_active).length;return e.jsxs("div",{className:"group relative flex border-b last:border-b-0 hover:bg-muted/30",children:[e.jsxs("div",{className:"w-[220px] flex-shrink-0 border-r p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:w("h-2 w-2 rounded-full",t.is_active?"bg-emerald-500":"bg-zinc-400")}),e.jsx("span",{className:"truncate text-sm font-medium",children:(i==null?void 0:i.name)??t.title})]}),e.jsx("div",{className:"mt-1 truncate text-[11px] text-muted-foreground",children:i?t.title:`$${Number(t.nightly_rate).toFixed(0)}/night`}),e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-[10px] text-muted-foreground",children:[e.jsx(de,{className:"h-3 w-3"}),o," iCal ",o===1?"feed":"feeds"]})]}),e.jsxs("div",{className:"relative flex",style:{height:60},children:[$.map((r,d)=>{var j;const b=z(r,S),u=r.getDay()===0||r.getDay()===6,U=((j=x.current)==null?void 0:j.listingId)===t.id&&(y==null?void 0:y.listingId)===t.id&&(x.current.start<=r&&r<=y.end||y.end<=r&&r<=x.current.start);return e.jsx("div",{className:w("flex-shrink-0 border-r",u&&"bg-muted/30",b&&"bg-primary/5",U&&"bg-primary/20"),style:{width:`${O}px`},onMouseDown:()=>je(t.id,r),onMouseEnter:()=>ke(t.id,r)},d)}),s.map(r=>ye(t.id,r))]})]},t.id)})]})})})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(L,{className:"border-border/60",children:e.jsxs(B,{className:"p-4",children:[e.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["Today - ",k(S,"EEE MMM d")]}),e.jsx(pe,{emptyLabel:"No activity today",items:[...Z.checkins.map(t=>({key:`in-${t.id}`,icon:"in",title:t.guest_name,meta:"Check-in"})),...Z.checkouts.map(t=>({key:`out-${t.id}`,icon:"out",title:t.guest_name,meta:"Check-out"}))]})]})}),e.jsx(L,{className:"border-border/60",children:e.jsxs(B,{className:"p-4",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Tomorrow"}),e.jsx(pe,{emptyLabel:"No arrivals tomorrow",items:Z.tomorrow.map(t=>({key:`t-${t.id}`,icon:"in",title:t.guest_name,meta:`Check-in - ${k(_(t.check_in),"MMM d")}`}))})]})}),e.jsx(L,{className:"border-border/60 bg-gradient-to-br from-violet-500/5 to-indigo-500/5",children:e.jsx(B,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(de,{className:"mt-0.5 h-4 w-4 text-violet-600"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-semibold",children:"Merged calendar health"}),e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs",children:[e.jsx(G,{label:"Feeds",value:f.activeFeeds}),e.jsx(G,{label:"Synced",value:f.healthyFeeds}),e.jsx(G,{label:"Blocks",value:f.importedBlocks}),e.jsx(G,{label:"Properties",value:f.mappedProperties})]}),f.errorFeeds>0||N.conflictCount>0?e.jsxs("div",{className:"mt-3 rounded-md border border-amber-500/30 bg-amber-500/10 p-2 text-xs text-amber-700 dark:text-amber-300",children:[e.jsx(Ie,{className:"mr-1.5 inline h-3.5 w-3.5"}),f.errorFeeds>0?`${f.errorFeeds} feed ${f.errorFeeds===1?"needs":"need"}
1 attention`:`${N.conflictCount} overlap ${N.conflictCount===1?"needs":"need"} review`]}):null,e.jsx(I,{asChild:!0,size:"sm",variant:"outline",className:"mt-3 h-7 text-xs",children:e.jsxs("a",{href:"/settings",children:[e.jsx(Le,{className:"mr-1.5 h-3 w-3"}),"Manage property iCals"]})})]})]})})})]})]}),H.listingId&&e.jsx(qe,{open:H.open,onOpenChange:t=>J(s=>({...s,open:t,...t?{}:{listingId:null,bookingId:null}})),listingId:H.listingId,bookingId:H.bookingId}),F.listingId&&e.jsx(He,{open:F.open,onOpenChange:t=>K(s=>({...s,open:t,...t?{}:{listingId:null,defaultStart:void 0,defaultEnd:void 0}})),listingId:F.listingId,defaultStart:F.defaultStart,defaultEnd:F.defaultEnd})]})},W=({label:n,value:a,accent:l})=>e.jsx(L,{className:"border-border/60",children:e.jsxs(B,{className:"flex items-center justify-between p-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:n}),e.jsx("p",{className:"mt-1 text-2xl font-semibold tracking-tight",children:a})]}),e.jsx("div",{className:w("rounded-lg p-2",l),children:e.jsx(Be,{className:"h-4 w-4"})})]})}),G=({label:n,value:a})=>e.jsxs("div",{className:"rounded-md border bg-background/60 p-2",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:n}),e.jsx("p",{className:"mt-0.5 text-base font-semibold",children:a})]}),pe=({items:n,emptyLabel:a})=>n.length===0?e.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:a}):e.jsx("ul",{className:"mt-3 space-y-2",children:n.map(l=>e.jsxs("li",{className:"flex items-center gap-3 rounded-lg border bg-card/60 p-2",children:[e.jsx("span",{className:w("flex h-7 w-7 items-center justify-center rounded-md text-xs font-bold text-white",l.icon==="in"?"bg-emerald-500":"bg-rose-500"),children:l.icon==="in"?"In":"Out"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:l.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:l.meta})]}),e.jsx($e,{variant:"outline",className:"text-[10px]",children:(l.icon==="in","Today")})]},l.key))});export{dr 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.