import"./BE2ewAd6.js";var e=new Set([`event`,`task`,`project`,`deal`,`deliverable`,`publication`]);function t(t){return e.has(t)}function n(e,t){let n=[{key:`updated_at`,label:`Updated`,system:!0},{key:`created_at`,label:`Created`,system:!0}],r=t??new Set;return r.has(`date`)&&n.push({key:`date`,label:`Date`}),r.has(`start_date`)&&n.push({key:`start_date`,label:`Start date`}),n}function r(e,t){let n;if(n=t===`created_at`?e.createdAt:t===`updated_at`?e.updatedAt:e.fields[t],!n)return null;let r=String(n);return/^\d{4}-\d{2}-\d{2}/.test(r)?r.slice(0,10):null}function i(e,t,n,i){let a=new Date,o=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,`0`)}-${String(a.getDate()).padStart(2,`0`)}`,s=new Date(e,t-1,1).getDay(),c=new Date(e,t-1,1-s),l=new Map;for(let e of n){let t=r(e,i);t&&(l.has(t)||l.set(t,[]),l.get(t).push(e))}let u=[];for(let n=0;n<42;n++){let r=new Date(c);r.setDate(r.getDate()+n);let i=r.getFullYear(),a=r.getMonth()+1,s=r.getDate(),d=`${i}-${String(a).padStart(2,`0`)}-${String(s).padStart(2,`0`)}`;u.push({dateStr:d,day:s,isCurrentMonth:a===t&&i===e,isToday:d===o,entities:l.get(d)??[]})}return u}function a(e,t,n,i,a){let o=new Date,s=`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,`0`)}-${String(o.getDate()).padStart(2,`0`)}`,c=new Date(e,t-1,n),l=c.getDay(),u=new Date(c);u.setDate(c.getDate()-l);let d=new Map;for(let e of i){let t=r(e,a);t&&(d.has(t)||d.set(t,[]),d.get(t).push(e))}let f=[];for(let n=0;n<7;n++){let r=new Date(u);r.setDate(r.getDate()+n);let i=r.getFullYear(),a=r.getMonth()+1,o=r.getDate(),c=`${i}-${String(a).padStart(2,`0`)}-${String(o).padStart(2,`0`)}`;f.push({dateStr:c,day:o,isCurrentMonth:a===t&&i===e,isToday:c===s,entities:d.get(c)??[]})}return f}function o(e){if(e.length===0)return``;let t=new Date(e[0].dateStr+`T00:00:00`),n=new Date(e[e.length-1].dateStr+`T00:00:00`),r=t.getMonth()===n.getMonth()&&t.getFullYear()===n.getFullYear(),i=t.getFullYear()===n.getFullYear(),a=e=>e.toLocaleDateString(`en-US`,{month:`short`});return r?`${a(t)} ${t.getDate()} – ${n.getDate()}, ${n.getFullYear()}`:i?`${a(t)} ${t.getDate()} – ${a(n)} ${n.getDate()}, ${n.getFullYear()}`:`${a(t)} ${t.getDate()}, ${t.getFullYear()} – ${a(n)} ${n.getDate()}, ${n.getFullYear()}`}var s=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],c=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];export{o as a,a as i,s as n,n as o,i as r,t as s,c as t};