1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CalendarDateRangeFilter-oz7Dy0YO.js","assets/index-DGo-vssZ.js","assets/vendor-Qgthw7N1.js","assets/index-C2doZrJs.css","assets/differenceInMonths-Cb0HIyJb.js","assets/index-B1ky1Hhc.js","assets/timer-DEA0yRXX.js","assets/RepsClassificationSection-CqSsZHO1.js","assets/circle-x--5-vDMIU.js","assets/calendar-days-COgXMVIl.js"])))=>i.map(i=>d[i]); 2import{a6 as Oe,b8 as Ke,r as se,aM as Qe,a as Ue,j as e,e as m,ae as W,ao as Je,G as re,I as te,J as D,q,b9 as ne,K as ie,C as w,b as $,B as p,ba as Ye,ah as He,c as A,bb as Xe,bc as Ze,bd as ea,aI as aa,i as L,d as C,b0 as le,_,a7 as sa,aq as ra,T as ta,be as na}from"./index-DGo-vssZ.js";import{r as n}from"./vendor-Qgthw7N1.js";import{F as ia,i as la,a as da,b as ca,c as oa}from"./index-COtV6X2D.js";import{C as de}from"./checkbox-i5ygXx_L.js";import{u as ma,a as ha,t as xa,b as pa,c as ga,g as ua,C as fa,d as ce,e as ya,E as ba,f as ja}from"./CalendarDateRangeFilter-oz7Dy0YO.js";import{F as oe}from"./filter-D8zDqrI6.js";import{G as va}from"./grid-3x3-C5a5Y6KW.js";import{C as Na}from"./circle-x--5-vDMIU.js";import"./differenceInMonths-Cb0HIyJb.js";import"./index-B1ky1Hhc.js";import"./timer-DEA0yRXX.js";import"./RepsClassificationSection-CqSsZHO1.js";import"./calendar-days-COgXMVIl.js";function Va(){const g=n.useRef(null),[k,me]=n.useState("dayGridMonth"),[he,xe]=n.useState(""),[pe,O]=n.useState(null),[ge,ue]=n.useState("calendar"),[P,fe]=n.useState("all"),[K,Q]=n.useState({start:Ke(new Date,30),end:Oe(new Date,30)}),[ye,M]=n.useState(!1),[u,be]=n.useState([]),[h,U]=n.useState(!0),{data:R,isLoading:J}=se({queryKey:["calendars"],queryFn:async()=>{const{calendarViewService:a}=await na(async()=>{const{calendarViewService:s}=await import("./CalendarDateRangeFilter-oz7Dy0YO.js").then(r=>r.l);return{calendarViewService:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));return a.getCalendarList()},staleTime:5*60*1e3}),f=(R==null?void 0:R.calendars)||[],je=h?void 0:u,{events:l,isLoading:c,isStreaming:V,error:x,progress:Y,refetch:z}=ma({startDate:K.start,endDate:K.end,skipCache:ye,calendarIds:je}),S=V,T=[],ve=new Date().getFullYear();ha(ve);const Ne=n.useMemo(()=>xa(l),[l]),{monthFilter:we,setMonthFilter:Ce,filterError:ke,validateAndApply:H,handleClear:Se}=pa(),Ee=Qe(),[De,G]=n.useState(!1),[Te,y]=n.useState(!1),[Fe,I]=n.useState(null),[$e,E]=n.useState([]),[X,Ae]=n.useState([]);Ue();const{data:Le=[]}=se({queryKey:["properties"],queryFn:async()=>{const a=await fetch("/api/properties");if(!a.ok)throw new Error("Failed to fetch properties");return a.json()}}),{syncEventMutation:b,updateTimeEntryMutation:j,approveTimeEntryMutation:v}=ga();n.useEffect(()=>{var a;b.isSuccess&&(z(),t("â Event synced to time ledger"),y(!1)),b.isError&&t(`â Sync failed: ${(a=b.error)==null?void 0:a.message}`)},[b.isSuccess,b.isError]),n.useEffect(()=>{var a;j.isSuccess&&(z(),t("â Time entry updated"),y(!1)),j.isError&&t(`â Update failed: ${(a=j.error)==null?void 0:a.message}`)},[j.isSuccess,j.isError]),n.useEffect(()=>{var a;v.isSuccess&&(z(),t("â Time entry approved"),y(!1)),v.isError&&t(`â Approval failed: ${(a=v.error)==null?void 0:a.message}`)},[v.isSuccess,v.isError]);const t=a=>{const r=`[${new Date().toLocaleTimeString()}] ${a}`;Ae(i=>{const d=[...i,r];return d.length>50?d.slice(-50):d})},Pe=()=>{var a;(a=g.current)==null||a.getApi().prev(),t("ð User clicked Previous")},Me=()=>{var a;(a=g.current)==null||a.getApi().next(),t("ð User clicked Next")},Re=()=>{var a;(a=g.current)==null||a.getApi().today(),t("ð User clicked Today")},F=a=>{var s;me(a),(s=g.current)==null||s.getApi().changeView(a),t(`ð Changed view to: ${a}`)},Ve=a=>{xe(a.view.title),Q({start:a.start,end:a.end}),t(`ð Date range changed: ${a.view.title} (${a.start.toISOString().split("T")[0]} â ${a.end.toISOString().split("T")[0]})`),t("ð Fetching events for new date range...")},ze=a=>{const s=a.event,r=s.extendedProps;I({title:s.title||"",description:r.description||"",activityType:r.activityType||"Property Management",propertyId:r.propertyId||null,materialParticipation:r.materialParticipation||!0,category:r.category||"real-estate"}),E(r.evidenceFiles||[]);let i=r.duration||0;!i&&s.start&&s.end&&(i=(s.end.getTime()-s.start.getTime())/(1e3*60*60));const d={...r,id:s.id,title:s.title,start:s.startStr||r.end,end:s.endStr||r.end,duration:i,location:r.location,attendees:r.attendees};O(d),y(!0),t(`ð¯ Event clicked: "${s.title}" - Opening review dialog`)},Ge=()=>{G(!0)},Ie=async()=>{try{t("ð Bypassing cache and fetching fresh data..."),M(!0),await Ee.invalidateQueries({queryKey:ja.all}),await new Promise(a=>setTimeout(a,100)),M(!1),Se(),t("â Fresh data fetched from Google Calendar API"),G(!1)}catch(a){console.error("Sync error:",a),t("â Sync failed - please try again"),M(!1)}},Be=()=>{const a=H();a&&a.isValid&&a.fromDate&&a.toDate&&(Q({start:a.fromDate,end:a.toDate}),t(`ð Filter applied: ${a.fromDate.toLocaleDateString()} â ${a.toDate.toLocaleDateString()}`),g.current&&g.current.getApi().gotoDate(a.fromDate))},We=()=>{U(!h),t(h?"ð Filtering to selected calendars":"ð Showing all calendars")},Z=a=>{be(s=>{var r,i;if(s.includes(a)){const d=s.filter(o=>o!==a);return t(`ð Deselected calendar: ${(r=f.find(o=>o.id===a))==null?void 0:r.name}`),d}else return t(`ð Selected calendar: ${(i=f.find(d=>d.id===a))==null?void 0:i.name}`),[...s,a]}),U(!1)},qe=(a,s)=>{const r={id:Date.now().toString(),name:s,url:a,aiSummary:void 0};E(i=>[...i,r]),t(`ð Evidence file added: ${s}`),fetch("/api/evidence-files/process",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fileUrl:a,fileName:s,source:"calendar"})}).then(i=>i.json()).then(i=>{i.aiSummary&&(E(d=>d.map(o=>o.id===r.id?{...o,aiSummary:i.aiSummary}:o)),t(`ð¤ AI analysis complete for: ${s}`))}).catch(i=>{console.error("Evidence file processing error:",i),t(`â ï¸ AI analysis failed for: ${s}`)})},N=a=>
2{if(!a)return"available";if(a.hasLedgerEntry)return a.approvalStatus==="approved"?"approved":"pending";const s=a.aiConfidence||0,r=a.automationMatch;return s>=90?"approved":s>=50&&s<90?r!=null&&r.matched&&(r!=null&&r.autoApprove)?"approved":"pending":"available"},ee=a=>{const s="h-4 w-4";switch(a){case"approved":return e.jsx(le,{className:`${s} text-green-600`});case"pending":return e.jsx(L,{className:`${s} text-amber-600`});case"available":default:return e.jsx(ce,{className:`${s} text-blue-600`})}},_e=a=>{const s={approved:{label:"Auto-Approved",className:"bg-green-100 text-green-800 border-green-200"},pending:{label:"Pending",className:"bg-amber-100 text-amber-800 border-amber-200"},available:{label:"Available",className:"bg-blue-100 text-blue-800 border-blue-200"}},{label:r,className:i}=s[a];return e.jsxs(m,{variant:"outline",className:i,children:[ee(a),e.jsx("span",{className:"ml-1",children:r})]})},B=n.useMemo(()=>({all:l.length,approved:l.filter(a=>N(a)==="approved").length,pending:l.filter(a=>N(a)==="pending").length}),[l]),ae=n.useMemo(()=>{switch(P){case"approved":return l.filter(a=>N(a)==="approved");case"pending":return l.filter(a=>N(a)==="pending");case"all":default:return l}},[l,P]);return n.useEffect(()=>{if(!c&&l.length>0){const a=ua(l,T);t(`â
Loaded ${l.length} events (${a.monthsCached} months cached, ${a.statusBreakdown.approved} approved, ${a.statusBreakdown.pending} pending, ${a.statusBreakdown.available} other)`)}},[l.length,c]),n.useEffect(()=>{if(!c&&!S&&T.length>0){const a=T.filter(s=>!s.isLoading&&!s.isFetching);a.length>0&&t(`ð¾ [Cache] ${a.length}/${T.length} months loaded from cache`)}},[c,S]),n.useEffect(()=>{x&&t(`â Error: ${x.message||"Unknown error"}`)},[x==null?void 0:x.message]),e.jsx("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 p-6",children:e.jsxs("div",{className:"max-w-7xl mx-auto space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:"Test Calendar"}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:"Fetching real events from unified calendar service (Google + Microsoft)"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[(c||V)&&e.jsxs(m,{variant:"secondary",className:"text-xs flex items-center gap-1",children:[e.jsx(W,{className:"h-3 w-3 animate-spin"}),c?"Loading...":`Streaming... ${Y?`(${Y.processed})`:""}`]}),x&&e.jsxs(m,{variant:"destructive",className:"text-xs flex items-center gap-1",children:[e.jsx(Je,{className:"h-3 w-3"}),"Error"]}),!c&&!V&&!x&&e.jsxs(m,{variant:"secondary",className:"text-xs",children:[l.length," events loaded"]})]})]}),e.jsxs(re,{value:ge,onValueChange:a=>ue(a),children:[e.jsxs(te,{className:"grid w-full max-w-md grid-cols-2",children:[e.jsxs(D,{value:"calendar",className:"gap-2",children:[e.jsx(q,{className:"h-4 w-4"}),"Calendar View"]}),e.jsxs(D,{value:"list",className:"gap-2",children:[e.jsx(ne,{className:"h-4 w-4"}),"List View"]})]}),e.jsx(ie,{value:"calendar",className:"mt-6",children:e.jsxs(w,{className:"border-none shadow-lg",children:[e.jsx($,{className:"border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(p,{variant:"outline",size:"sm",onClick:Re,className:"font-medium",children:"Today"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(p,{variant:"ghost",size:"icon",onClick:Pe,className:"h-8 w-8",children:e.jsx(Ye,{className:"h-4 w-4"})}),e.jsx(p,{variant:"ghost",size:"icon",onClick:Me,className:"h-8 w-8",children:e.jsx(He,{className:"h-4 w-4"})})]}),e.jsx(A,{className:"text-xl font-semibold ml-2",children:he||"November 2025"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Xe,{children:[e.jsx(Ze,{asChild:!0,children:e.jsxs(p,{variant:"outline",size:"sm",className:"flex items-center gap-2 h-9",children:[e.jsx(oe,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm font-medium",children:"Calendars"}),!h&&u.length>0&&e.jsx(m,{variant:"secondary",className:"ml-1 h-5 px-2 text-xs",children:u.length})]})}),e.jsx(ea,{className:"w-96",align:"end",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between pb-3 border-b",children:[e.jsx("h4",{className:"font-semibold text-base",children:"Select Calendars"}),J&&e.jsx(W,{className:"h-4 w-4 animate-spin text-gray-400"})]}),e.jsxs("div",{className:"flex items-center space-x-3 pb-3 border-b",children:[e.jsx(de,{id:"show-all",checked:h,onCheckedChange:We,className:"h-5 w-5"}),e.jsx("label",{htmlFor:"show-all",className:"text-sm font-medium leading-relaxed cursor-pointer flex-1",children:"Show all calendars"})]}),e.jsxs("div",{className:"space-y-1 max-h-80 overflow-y-auto pr-1",children:[f.length===0&&!J&&e.jsx("p",{className:"text-sm text-gray-500 text-center py-8",children:"No calendars found"}),f.map(a=>e.jsxs("div",{className:"flex items-center space-x-3 px-3 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 rounded-lg transition-colors cursor-pointer",onClick:()=>!h&&Z(a.id),children:[e.jsx(de,{id:a.id,checked:h||u.includes(a.id),onCheckedChange:()=>Z(a.id),disabled:h,className:"h-5 w-5"}),e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[a.backgroundColor&&e.jsx("div",{className:"w-4 h-4 rounded-full flex-shrink-0 border border-gray-200 dark:border-gray-700",style:{backgroundColor:a.backgroundColor}}),e.jsxs("label",{htmlFor:a.id,className:"text-sm leading-relaxed cursor-pointer flex-1 truncate",children:[e.jsx("span",{className:"font-medium",children:a.name}),a.isPrimary&&e.jsx(m,{variant:"outline",className:"ml-2 text-xs",children:"Primary"})]})]})]},a.id))]}),!h&&e.jsx("div",{className:"pt-3 border-t text-sm text-gray-600 dark:text-gray-400",children:u.length===0?"N
2o calendars selected":`${u.length} of ${f.length} calendar${f.length!==1?"s":""} selected`})]})})]}),e.jsx(fa,{dateRangeFilter:we,setDateRangeFilter:Ce,filterValidationError:ke,handleRefreshEvents:Be,validateDateRangeFilter:H,calendarRef:g}),e.jsxs(p,{variant:"outline",size:"sm",onClick:Ge,disabled:c||S,className:"flex items-center gap-2 h-8",children:[e.jsx(aa,{className:`h-4 w-4 ${c||S?"animate-spin":""}`}),e.jsx("span",{className:"text-xs font-medium",children:"Sync"})]}),e.jsxs("div",{className:"flex items-center gap-1 border border-gray-200 dark:border-gray-700 rounded-md p-1",children:[e.jsxs(p,{variant:k==="dayGridMonth"?"secondary":"ghost",size:"sm",onClick:()=>F("dayGridMonth"),className:"h-7 px-2",children:[e.jsx(va,{className:"h-3.5 w-3.5 mr-1"}),"Month"]}),e.jsxs(p,{variant:k==="timeGridWeek"?"secondary":"ghost",size:"sm",onClick:()=>F("timeGridWeek"),className:"h-7 px-2",children:[e.jsx(q,{className:"h-3.5 w-3.5 mr-1"}),"Week"]}),e.jsxs(p,{variant:k==="timeGridDay"?"secondary":"ghost",size:"sm",onClick:()=>F("timeGridDay"),className:"h-7 px-2",children:[e.jsx(L,{className:"h-3.5 w-3.5 mr-1"}),"Day"]}),e.jsxs(p,{variant:k==="listWeek"?"secondary":"ghost",size:"sm",onClick:()=>F("listWeek"),className:"h-7 px-2",children:[e.jsx(ne,{className:"h-3.5 w-3.5 mr-1"}),"List"]})]})]})]})}),e.jsx(C,{className:"p-6",children:e.jsxs("div",{className:"calendar-wrapper",children:[e.jsx("style",{children:` 3 .calendar-wrapper .fc { 4 font-family: inherit; 5 } 6 .calendar-wrapper .fc-theme-standard th { 7 border-color: #e5e7eb; 8 } 9 .calendar-wrapper .fc-theme-standard td { 10 border-color: #e5e7eb; 11 } 12 .calendar-wrapper .fc-scrollgrid { 13 border-color: #e5e7eb; 14 } 15 .calendar-wrapper .fc-col-header-cell { 16 background-color: #f9fafb; 17 font-weight: 600; 18 font-size: 0.75rem; 19 text-transform: uppercase; 20 letter-spacing: 0.05em; 21 padding: 12px 8px; 22 } 23 .calendar-wrapper .fc-daygrid-day-number { 24 font-size: 0.875rem; 25 font-weight: 500; 26 padding: 8px; 27 } 28 .calendar-wrapper .fc-event { 29 border-radius: 4px; 30 padding: 2px 6px; 31 font-size: 0.8125rem; 32 font-weight: 500; 33 cursor: pointer; 34 transition: opacity 0.15s ease; 35 } 36 .calendar-wrapper .fc-event:hover { 37 opacity: 0.85; 38 } 39 .calendar-wrapper .fc-daygrid-day.fc-day-today { 40 background-color: #eff6ff !important; 41 } 42 .calendar-wrapper .fc-daygrid-day-number.fc-day-today { 43 background-color: #3b82f6; 44 color: white; 45 border-radius: 50%; 46 width: 28px; 47 height: 28px; 48 display: flex; 49 align-items: center; 50 justify-content: center; 51 margin: 4px; 52 } 53 .calendar-wrapper .fc-toolbar { 54 display: none; 55 } 56 57 /* Dark mode support */ 58 .dark .calendar-wrapper .fc-theme-standard th { 59 border-color: #374151; 60 } 61 .dark .calendar-wrapper .fc-theme-standard td { 62 border-color: #374151; 63 } 64 .dark .calendar-wrapper .fc-scrollgrid { 65 border-color: #374151; 66 } 67 .dark .calendar-wrapper .fc-col-header-cell { 68 background-color: #1f2937; 69 color: #e5e7eb; 70 }
71 .dark .calendar-wrapper .fc-daygrid-day.fc-day-today { 72 background-color: #1e3a5f !important; 73 } 74 .dark .calendar-wrapper .fc-daygrid-day-frame { 75 background-color: #111827; 76 } 77 .dark .calendar-wrapper .fc-daygrid-day-number { 78 color: #e5e7eb; 79 } 80 `}),e.jsx(ia,{ref:g,plugins:[la,da,ca,oa],initialView:k,headerToolbar:!1,events:Ne,eventClick:ze,datesSet:Ve,height:"auto",aspectRatio:1.8,expandRows:!1,fixedWeekCount:!1,showNonCurrentDates:!1,dayMaxEvents:3,moreLinkClick:"popover",eventTimeFormat:{hour:"numeric",minute:"2-digit",meridiem:"short"},slotLabelFormat:{hour:"numeric",minute:"2-digit",meridiem:"short"}})]})})]})}),e.jsx(ie,{value:"list",className:"mt-6",children:e.jsxs(w,{className:"border-none shadow-lg",children:[e.jsx($,{className:"border-b border-gray-200 dark:border-gray-700",children:e.jsx(A,{className:"text-lg font-semibold",children:"Events List"})}),e.jsx(C,{className:"p-6",children:e.jsxs(re,{value:P,onValueChange:a=>fe(a),children:[e.jsxs(te,{className:"grid w-full grid-cols-3 mb-6",children:[e.jsxs(D,{value:"all",className:"gap-2",children:[e.jsx(oe,{className:"h-4 w-4"}),"All Events",e.jsx(m,{variant:"secondary",className:"ml-1",children:B.all})]}),e.jsxs(D,{value:"approved",className:"gap-2",children:[e.jsx(le,{className:"h-4 w-4 text-green-600"}),"Approved",e.jsx(m,{variant:"secondary",className:"ml-1",children:B.approved})]}),e.jsxs(D,{value:"pending",className:"gap-2",children:[e.jsx(L,{className:"h-4 w-4 text-amber-600"}),"Pending Review",e.jsx(m,{variant:"secondary",className:"ml-1",children:B.pending})]})]}),e.jsx("div",{className:"space-y-3 max-h-[600px] overflow-y-auto",children:c?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(W,{className:"h-8 w-8 animate-spin text-gray-400"}),e.jsx("span",{className:"ml-3 text-gray-600",children:"Loading events..."})]}):ae.length===0?e.jsxs("div",{className:"text-center py-12 text-gray-500",children:[e.jsx(Na,{className:"h-12 w-12 mx-auto mb-3 text-gray-400"}),e.jsx("p",{children:"No events found for this filter"})]}):ae.map(a=>{const s=N(a);return e.jsx(w,{className:"hover:shadow-md transition-shadow cursor-pointer",onClick:()=>{I({title:a.title||"",description:a.description||"",activityType:a.suggestedActivityType||"Property Management",propertyId:null,materialParticipation:a.suggestedMaterialParticipation||!0}),E([]);const r=a.start?new Date(a.start):null,i=a.end?new Date(a.end):null;let d=a.duration||0;!d&&r&&i&&(d=(i.getTime()-r.getTime())/(1e3*60*60));const o={...a,id:a.id,title:a.title,start:a.start,end:a.end,duration:d,location:a.location,attendees:a.attendees};O(o),y(!0)},children:e.jsx(C,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-1",children:ee(s)}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h3",{className:"font-semibold text-base",children:a.title||a.summary}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[a.aiConfidence!==void 0&&e.jsxs(m,{variant:"outline",className:`text-xs ${a.aiConfidence>=90?"border-green-500 text-green-700 bg-green-50 dark:bg-green-950":a.aiConfidence>=50?"border-amber-500 text-amber-700 bg-amber-50 dark:bg-amber-950":"border-gray-400 text-gray-600 bg-gray-50 dark:bg-gray-900"}`,children:[e.jsx(_,{className:"h-3 w-3 mr-1"}),a.aiConfidence,"%"]}),_e(s)]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-600 dark:text-gray-400",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(q,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:a.start?sa(new Date(a.start),"MMM dd, yyyy ⢠h:mm a"):"No date"})]}),a.duration&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(L,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:[a.duration," ","hour",a.duration!==1?"s":""]})]})]}),a.description&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 line-clamp-2",children:a.description}),s==="approved"&&a.hasLedgerEntry&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-700 dark:text-green-400",children:[e.jsx(ra,{className:"h-4 w-4"}),e.jsx("span",{children:"Click to view entry"})]}),s==="pending"&&a.hasLedgerEntry&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-amber-700 dark:text-amber-400",children:[e.jsx(ta,{className:"h-4 w-4"}),e.jsx("span",{children:"Click to review entry"})]}),s==="available"&&!a.hasLedgerEntry&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-blue-700 dark:text-blue-400",children:[e.jsx(ce,{className:"h-4 w-4"}),e.jsx("span",{children:"Click to convert to entry"})]}),s==="approved"&&!a.hasLedgerEntry&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-700 dark:text-green-400",children:[e.jsx(_,{className:"h-4 w-4"}),e.jsx("span",{children:"AI auto-approved ⢠Click to convert"})]}),s==="pending"&&!a.hasLedgerEntry&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-amber-700 dark:text-amber-400",children:[e.jsx(_,{className:"h-4 w-4"}),e.jsx("span",{children:"AI pending review ⢠Click to convert"})]})]})]})})},a.id)})})]})})]})})]}),e.jsxs(w,{className:"border-none shadow-lg",children:[e.jsx($,{className:"border-b border-gray-200 dark:border-gray-700",children:e.jsxs(A,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx("span",{className:"h-2 w-2 bg-green-500 rounded-full animate-pulse"}),"Debug Console"]})}),e.jsx(C,{className:"p-4",children:e.jsx("div",{className:"bg-gray-900 rounded-lg p-4 h-64 overflow-y-auto font-mono text-xs",children:X.length===0?e.jsx("p",{className:"text-gray-500",children:"Waiting for user interactions..."}):X.map((a,s)=>e.jsx("div",{className:"text-green-400 mb-1",children:a},s))})})]}),e.jsxs(w,{className:"border-none shadow-lg",children:[e.jsx($,{className:"border-b border-gray-200 dark:border-gray-700",children:e.jsx(A,{className:"text-sm font-semibold",children:"Event Status Legend"})}),e.jsxs(C,{className:"p-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-4 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-sm bg-blue-500"}),e.jsx("span",{children:"Available (Not in Ledger)"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-sm bg-amber-500"}),e.jsx("span",{children:"Pending Approval"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-sm bg-green-500"}),e.jsx("span",{children:"Approved"})]})]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-3",children:"Events are color-coded based on their sync status with the time ledger"})]})]}),e.jsx(w,{className:"border-none shadow-lg bg-blue-50 dark:bg-blue-900/20 border-l-4 border-l-blue-500",children:e.jsxs(C,{className:"p-4",children:[e.jsx("h3",{className:"font-semibold text-sm mb-2 text-blue-900 dark:text-blue-100",children:"Testing Instructions"}),e.jsxs("ul",{className:"text-xs space-y-1 text-blue-800 dark:text-blue-200",children:[e.jsxs("li",{children:["⢠This calendar uses"," ",e.jsx("strong",{children:"React Query"})," for intelligent caching (24-hour staleTime)"]}),e.jsxs("li",{children:["⢠Navigate months: Cached months display"," ",e.jsx("strong",{children:"instantly"}),", new months fetch from API"]}),e.jsx("li",{children:'⢠Click "Today" to return to the current month'}),e.jsx("li",{children:"⢠Switch between Month, Week, Day, and List views"}
80),e.jsx("li",{children:"⢠Click the refresh button to invalidate cache and re-fetch"}),e.jsx("li",{children:"⢠Click on any event to open the review dialog with full sync capabilities"}),e.jsx("li",{children:"⢠Watch the Debug Console for cache hits/misses and API calls"}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"React Query DevTools"})," button in bottom-right corner for cache visualization"]}),e.jsx("li",{children:"⢠Events color-coded: Blue=Available, Amber=Pending, Green=Approved"})]}),x&&e.jsxs("div",{className:"mt-3 p-2 bg-red-100 dark:bg-red-900/30 border border-red-300 dark:border-red-700 rounded text-xs text-red-800 dark:text-red-200",children:[e.jsx("strong",{children:"Error:"})," ",x.message||"Failed to fetch calendar events"]})]})}),e.jsx(ya,{open:De,onOpenChange:G,onConfirm:Ie,isLoading:c||S,calendarProvider:"unified"}),e.jsx(ba,{showEventDialog:Te,setShowEventDialog:y,selectedEvent:pe,reviewFormData:Fe,setReviewFormData:I,evidenceFiles:$e,setEvidenceFiles:E,properties:Le,syncEventMutation:b,approveTimeEntryMutation:v,updateTimeEntryMutation:j,processEvidenceFile:qe,getEventStatus:N})]})})}export{Va as TestCalendar};
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.