behnoo-calendar 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +185 -187
- package/dist/style.css +1 -1
- package/package.json +11 -10
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("vue");var t=()=>{let t=(0,e.ref)(typeof window<`u`?window.innerWidth:1024),n=(0,e.ref)(typeof window<`u`?window.innerHeight:768),r=()=>{t.value=window.innerWidth,n.value=window.innerHeight};return(0,e.onMounted)(()=>window.addEventListener(`resize`,r)),(0,e.onUnmounted)(()=>window.removeEventListener(`resize`,r)),{width:t,height:n}},n=e=>(typeof e==`object`&&e&&`value`in e?String(e.value):String(e||`fa-IR`)).replace(/[^a-zA-Z-]/g,`-`).split(`-`)[0]||`fa`,r=()=>{let t=(0,e.inject)(`calendarConfig`,(0,e.ref)({locale:`en`,calendar:`gregory`,startOfWeek:`sunday`,showHolidays:!1}));return{t:(e,n)=>{let r=t.value.locale.startsWith(`fa`);return{"calendar.dayTimes.morning":r?`صبح`:`Morning`,"calendar.dayTimes.noon":r?`ظهر`:`Noon`,"calendar.dayTimes.afternoon":r?`عصر`:`Afternoon`,"calendar.dayTimes.night":r?`شب`:`Night`,"calendar.moreItems":r?`${n?.count} مورد دیگر`:`${n?.count} More Items`,"calendar.noEvents":r?`رویدادی وجود ندارد`:`No events`,"calendar.allDay":r?`تمام روز`:`All day`,"calendar.agenda":r?`برنامه`:`Agenda`}[e]||e},config:t}},i=t=>{let r=(0,e.inject)(`calendarConfig`,(0,e.ref)({locale:`fa-IR`,calendar:`jalaali`,startOfWeek:`saturday`,showHolidays:!0})),i=t||r,a=(0,e.inject)(`calendarHolidays`,(0,e.ref)({})),o=(0,e.computed)(()=>{let e=i.value.calendar;return e===`jalaali`?`persian`:e===`islamic`?`islamic-uma`:`gregory`}),s=e=>({sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6})[e.toLowerCase()]??0,c=e=>{let t=new Date(e);t.setHours(12,0,0,0);let n=o.value;n===`islamic-uma`&&(n=`islamic-civil`,t.setDate(t.getDate()-1));let r=new Intl.DateTimeFormat(`en-u-ca-${n}`,{year:`numeric`,month:`numeric`,day:`numeric`}).formatToParts(t),i=e=>parseInt(r.find(t=>t.type===e)?.value||`0`);return{year:i(`year`),month:i(`month`),day:i(`day`)}},l=(0,e.computed)(()=>i.value.calendar===`gregory`?1:6),u=e=>String(e),d=e=>{let t=[`۰`,`۱`,`۲`,`۳`,`۴`,`۵`,`۶`,`۷`,`۸`,`۹`];return String(e).replace(/\d/g,e=>t[parseInt(e)]??e)},f=e=>{let t=n(i.value.locale),r=new Date(e);r.setDate(r.getDate()+-1);let s=(t,n=e)=>{let r=new Intl.DateTimeFormat(`en-u-ca-${t}`,{year:`numeric`,month:`numeric`,day:`numeric`}).formatToParts(n);return parseInt(r.find(e=>e.type===`day`)?.value||`0`)},c=s(`gregory`),l=s(`persian`),f=s(`islamic-civil`,r),p=t===`fa`||t===`ar`,m=u(c),h=p?d(l):u(l),g=p?d(f):u(f),_=i.value.calendar,v,y,b;_===`jalaali`?(v=h,y=m,b=g):_===`islamic`?(v=g,y=h,b=m):(v=m,y=h,b=g);let x=new Date,S=e.getDate()===x.getDate()&&e.getMonth()===x.getMonth()&&e.getFullYear()===x.getFullYear(),C=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,w=a.value[C],T=w?.isHoliday||!1,E=w?.titles?.join(` - `)||null,D=e.getDay(),O=i.value.showHolidays?_===`jalaali`||_===`islamic`?D===5:D===0:!1,k=i.value.showHolidays?O||T:!1,A=o.value,j=new Intl.DateTimeFormat(`${t}-u-ca-${A}`,{weekday:`long`}).format(e),M=new Intl.DateTimeFormat(`${t}-u-ca-${A}`,{weekday:`short`}).format(e);return{date:new Date(e),primary:v,secondary:y,tertiary:b,jalaali:l,gregorian:c,ghamari:f,isToday:S,isWeekend:O,isHoliday:k,holidayTitle:E,name:j,shortName:M,dayOfWeek:D}},p=(e,t)=>{if(!e)return[];let n=[];if(t===`monthly`){let t=new Date(e.start);t.setHours(12,0,0,0);let r=c(t),a=r.month,o=r.year,l=new Date(t);for(;c(l).day!==1;)l.setDate(l.getDate()-1);let u=new Date(l);for(;;){u.setDate(u.getDate()+1);let e=c(u);if(e.month!==a||e.year!==o){u.setDate(u.getDate()-1);break}}let d=s(i.value.calendar===`gregory`?`monday`:`saturday`),p=l.getDay()-d;p<0&&(p+=7);let m=new Date(l);m.setDate(m.getDate()-p);let h=((d+6)%7-u.getDay()+7)%7,g=new Date(u);g.setDate(g.getDate()+h);let _=new Date(m);for(;_<=g;){let e=f(new Date(_)),t=c(_);n.push({...e,otherMonth:t.month!==a||t.year!==o}),_.setDate(_.getDate()+1)}}else if(t===`agenda`){let t=new Date(e.start);t.setHours(12,0,0,0);let r=c(t),i=r.month,a=r.year,o=new Date(t);for(;c(o).day!==1;)o.setDate(o.getDate()-1);let s=new Date(o);for(;;){s.setDate(s.getDate()+1);let e=c(s);if(e.month!==i||e.year!==a){s.setDate(s.getDate()-1);break}}let l=new Date(o);for(;l<=s;){let e=f(new Date(l));n.push({...e,otherMonth:!1}),l.setDate(l.getDate()+1)}}else if(t===`weekly`){let t=s(i.value.calendar===`gregory`?`monday`:`saturday`),r=new Date(e.start),a=r.getDay()-t;a<0&&(a+=7),r.setDate(r.getDate()-a);for(let e=0;e<7;e++){let t=new Date(r);t.setDate(r.getDate()+e),n.push({...f(t),otherMonth:!1})}}else if(t===`3days`)for(let t=0;t<3;t++){let r=new Date(e.start);r.setDate(r.getDate()+t),n.push({...f(r),otherMonth:!1})}else n.push({...f(new Date(e.start)),otherMonth:!1});return n},m=(0,e.computed)(()=>{let e=n(i.value.locale),t=o.value,r=l.value,a=new Date(2025,0,12+r),s=new Intl.DateTimeFormat(`${e}-u-ca-${t}`,{weekday:`narrow`}),c=new Intl.DateTimeFormat(`${e}-u-ca-${t}`,{weekday:`long`});return Array.from({length:7},(e,t)=>{let n=new Date(a);return n.setDate(a.getDate()+t),{dayOfWeek:n.getDay(),label:s.format(n),fullName:c.format(n)}})}),h=e=>{let t=n(i.value.locale),r=o.value;return{sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6}[new Intl.DateTimeFormat(`${t}-u-ca-${r}`,{weekday:`long`}).format(e).toLowerCase()]??0},g=()=>{let e=new Date,t=c(e),n=new Date(e);for(n.setHours(0,0,0,0);c(n).day!==t.day||c(n).month!==t.month||c(n).year!==t.year;)n.setDate(n.getDate()-1);return n},_=e=>{let t=new Date(e);t.setHours(12,0,0,0);let n=c(t),r=n.month,i=n.year;for(;n.day!==1;)t.setDate(t.getDate()-1),n=c(t);let a=new Date(t);for(;;){a.setDate(a.getDate()+1);let e=c(a);if(e.month!==r||e.year!==i){a.setDate(a.getDate()-1);break}}return a.setHours(23,59,59,999),{start:t,end:a}},v=e=>{let t=new Date(e);return t.setHours(0,0,0,0),t.setMilliseconds(0),t},y=()=>i.value.calendar===`gregory`?1:6,b=e=>{let t=g();if(e===`daily`||e===`3days`)return v(t);if(e===`weekly`){let e=y(),n=t.getDay()-e;n<0&&(n+=7);let r=new Date(t);return r.setDate(r.getDate()-n),v(r)}c(t);let n=v(t);for(n.setHours(12,0,0,0);c(n).day!==1;)n.setDate(n.getDate()-1);return v(n)},x=(e,t)=>{let r=n(e),i=t===`jalaali`?`persian`:t===`islamic`?`islamic-civil`:`gregory`,a=c(new Date).year,o=C(1,a),s=[];for(let e=1;e<=12;e++){let t=C(e,a,o);o=new Date(t);let n=new Intl.DateTimeFormat(`${r}-u-ca-${i}`,{month:`long`}).format(t);s.push({value:e,label:n,shortLabel:n})}return s},S=(e=new Date)=>{let t=c(e);return{month:t.month,year:t.year}},C=(e,t,n)=>{let r=n?new Date(n):new Date;r.setHours(12,0,0,0);let i=c(r),a=1e3,o=0;for(;(i.year!==t||i.month!==e)&&o<a;)i.year<t||i.year===t&&i.month<e?r.setDate(r.getDate()+1):r.setDate(r.getDate()-1),i=c(r),o++;for(;i.day!==1&&o<a;)r.setDate(r.getDate()-1),i=c(r),o++;return r.setHours(0,0,0,0),r};return{getCalendarHeaders:p,getDayDetails:f,offsetPeriod:(e,t,n)=>{let r=new Date(e);if(t===`daily`)r.setDate(r.getDate()+n);else if(t===`3days`)r.setDate(r.getDate()+n*3);else if(t===`weekly`)r.setDate(r.getDate()+n*7);else{let e=c(r),t=e.month+n,i=e.year;return t<1&&(t+=12,i--),t>12&&(t-=12,i++),v(C(t,i))}return v(r)},getMonthBounds:_,getWeekDayNames:m,getParts:c,resetToToday:b,getTodayInActiveCalendar:g,getCurrentPeriodStart:e=>b(e),getCurrentMonthYear:S,getDayOfWeekIndex:h,getMonthNames:x,getFirstDayOfMonthInActiveCalendar:C}},a=(0,e.defineComponent)({name:`CalendarDayBadge`,props:{day:{type:Object,required:!0}},setup(t){return{getDayItemColor:(0,e.computed)(()=>{let e=t.day,n=`border-outline-variant bg-surface`,r=`text-on-surface/50`;return e.isToday&&(n=`bg-today border-outline-variant/0`,r=`text-surface`),(e.isWeekend||e.isHoliday)&&(r=`text-error`),{fill:n,text:r}}),getFont:(e,t)=>{if(String(t.gregorian)===t[e])return`font-latin`}}}}),o=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},s={class:`flex flex-col items-center`};function c(t,n,r,i,a,o){return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,s,[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`w-7 h-7 sm:w-8 sm:h-8 md:w-9 md:h-9 select-none border flex flex-col justify-center items-center rounded-full`,[t.getDayItemColor.fill,t.getDayItemColor.text]])},[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([[t.getFont(`tertiary`,t.day)],`leading-none opacity-70 text-[6px] sm:text-[7px] md:text-[8px]`])},(0,e.toDisplayString)(t.day.tertiary),3),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([[t.getFont(`primary`,t.day)],`leading-tight text-[11px] sm:text-xs md:text-label-md font-medium`])},(0,e.toDisplayString)(t.day.primary),3),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([[t.getFont(`secondary`,t.day)],`leading-none opacity-70 text-[6px] sm:text-[7px] md:text-[8px]`])},(0,e.toDisplayString)(t.day.secondary),3)],2)])}var l=o(a,[[`render`,c]]),u=(0,e.defineComponent)({name:`CalendarHeaderItem`,components:{CalendarDayBadge:l},props:{days:{type:Array,default:()=>[]},mode:{type:String,default:`monthly`},todayColumnIndex:{type:Number,default:-1}},setup(t){return{itemWidths:(0,e.computed)(()=>`${100/(t.days.length+(t.mode===`monthly`?0:1))}%`)}}}),d={class:`w-full items-stretch flex justify-between`},f={key:0,class:`border shrink-0 w-8 sm:w-9 md:w-25 min-w-8 sm:min-w-9 md:min-w-25 max-w-8 sm:max-w-9 md:max-w-25 border-outline-variant`},p={class:`select-none text-on-surface/50 text-[9px] sm:text-[10px] md:text-label-md truncate max-w-full text-center px-0.5`},m={class:`sm:hidden`},h={class:`hidden sm:inline`};function g(t,n,r,i,a,o){let s=(0,e.resolveComponent)(`CalendarDayBadge`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,d,[t.mode===`monthly`?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,f)),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.days,(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`border-y rtl:border-l ltr:border-r border-outline-variant py-1.5 sm:py-2 md:py-4 flex-col flex-1 min-w-0 gap-y-1 sm:gap-y-1.5 md:gap-y-2.5 flex items-center justify-center transition-colors`,{"bg-today-column":r===t.todayColumnIndex}]),key:n.name+r},[t.mode===`monthly`?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createBlock)(s,{key:0,day:n},null,8,[`day`])),(0,e.createElementVNode)(`div`,p,[(0,e.createElementVNode)(`span`,m,(0,e.toDisplayString)(n.shortName||n.name),1),(0,e.createElementVNode)(`span`,h,(0,e.toDisplayString)(n.name),1)])],2))),128))])}var _=o(u,[[`render`,g],[`__scopeId`,`data-v-683574e2`]]),v=(0,e.defineComponent)({name:`CalendarSideItem`,props:{range:{type:Object,required:!0}},setup(n){let{t:i,config:a}=r(),{width:o}=t(),s=(0,e.computed)(()=>o.value<768),c=(0,e.computed)(()=>new Intl.NumberFormat(a.value.locale.startsWith(`fa`)?`fa-IR`:`en-US`)),l=(0,e.computed)(()=>`${100/u.value.length}%`),u=(0,e.computed)(()=>{let e=[],{start:t,end:r}=n.range;for(let n=t;n<r;n++)if(s.value)e.push({raw:n,label:c.value.format(n)});else{let t=``;t=n>=1&&n<=11?`morning`:n===12?`noon`:n>=13&&n<19?`afternoon`:`night`;let r=n;n>12&&(r=n-12),n===0&&(r=12),e.push({raw:n,label:`${c.value.format(r)} ${i(`calendar.dayTimes.${t}`)}`})}return e});return{hoursList:u,itemHeights:l}}}),y={class:`w-8 sm:w-9 md:w-25 min-h-full flex flex-col ltr:border-r ltr:border-r-outline-variant rtl:border-l border-l-outline-variant`};function b(t,n,r,i,a,o){return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,y,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.hoursList,n=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:n.raw,style:(0,e.normalizeStyle)({height:t.itemHeights}),class:`flex items-center text-center justify-center text-[10px] sm:text-xs md:text-label-md text-on-surface/50 border-b min-h-20 border-b-outline-variant select-none`},(0,e.toDisplayString)(n.label),5))),128))])}var x=o(v,[[`render`,b]]),S=(0,e.defineComponent)({name:`CalendarPattern`,setup(){return{getX:e=>-50+(e-1)*25}}}),C={width:`100%`,height:`120%`,viewBox:`0 0 440 221`,preserveAspectRatio:`xMidYMid slice`,class:`text-surface-variant`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},w=[`x`,`transform`];function T(t,n,r,i,a,o){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,C,[((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(25,n=>(0,e.createElementVNode)(`rect`,{key:n,x:t.getX(n),y:`220.895`,width:`300`,height:`12`,transform:`rotate(-115 ${t.getX(n)} 220.895)`,fill:`currentColor`},null,8,w)),64))])}var E=o(S,[[`render`,T]]),D={"--cal-primary":{light:{r:26,g:157,b:144},dark:{r:64,g:184,b:172}},"--color-primary":{light:{r:26,g:157,b:144},dark:{r:64,g:184,b:172}},"--cal-surface":{light:{r:255,g:255,b:255},dark:{r:21,g:24,b:35}},"--color-surface":{light:{r:255,g:255,b:255},dark:{r:21,g:24,b:35}},"--cal-on-surface":{light:{r:44,g:44,b:46},dark:{r:255,g:255,b:255}},"--color-on-surface":{light:{r:44,g:44,b:46},dark:{r:255,g:255,b:255}},"--cal-error":{light:{r:229,g:43,b:22},dark:{r:234,g:85,b:69}},"--color-error":{light:{r:229,g:43,b:22},dark:{r:234,g:85,b:69}}};function O(e){if(!e||typeof e!=`string`)return null;let t=e.trim().toLowerCase();if(t.startsWith(`var(`)){let e=t.match(/var\(\s*([^,\s)]+)/),n=e?e[1]:``;if(typeof document<`u`&&n)try{let e=getComputedStyle(document.documentElement).getPropertyValue(n).trim();if(e){let t=O(e);if(t)return t}}catch{}let r=t.match(/var\([^,]+,\s*([^)]+)\)/);if(r&&r[1]){let e=O(r[1].trim());if(e)return e}return n&&D[n]?typeof document<`u`&&document.documentElement.classList.contains(`dark`)?D[n].dark:D[n].light:{r:26,g:157,b:144}}if(t.startsWith(`#`)){let e=t.slice(1);if(e.length===3||e.length===4){let t=e[0]||`0`,n=e[1]||`0`,r=e[2]||`0`,i=parseInt(t+t,16),a=parseInt(n+n,16),o=parseInt(r+r,16);if(!Number.isNaN(i)&&!Number.isNaN(a)&&!Number.isNaN(o))return{r:i,g:a,b:o}}else if(e.length===6||e.length===8){let t=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),r=parseInt(e.slice(4,6),16);if(!Number.isNaN(t)&&!Number.isNaN(n)&&!Number.isNaN(r))return{r:t,g:n,b:r}}return null}if(t.startsWith(`rgb`)){let e=t.match(/\(([^)]+)\)/);if(e&&e[1]){let t=e[1].split(/[\s,/]+/).filter(Boolean),n=t[0],r=t[1],i=t[2];if(n!==void 0&&r!==void 0&&i!==void 0){let e=n.endsWith(`%`)?parseFloat(n)/100*255:parseFloat(n),t=r.endsWith(`%`)?parseFloat(r)/100*255:parseFloat(r),a=i.endsWith(`%`)?parseFloat(i)/100*255:parseFloat(i);if(!Number.isNaN(e)&&!Number.isNaN(t)&&!Number.isNaN(a))return{r:Math.min(255,Math.max(0,Math.round(e))),g:Math.min(255,Math.max(0,Math.round(t))),b:Math.min(255,Math.max(0,Math.round(a)))}}}return null}if(t.startsWith(`hsl`)){let e=t.match(/\(([^)]+)\)/);if(e&&e[1]){let t=e[1].split(/[\s,/]+/).filter(Boolean),n=t[0],r=t[1],i=t[2];if(n!==void 0&&r!==void 0&&i!==void 0){let e=parseFloat(n),t=parseFloat(r)/100,a=parseFloat(i)/100;if(!Number.isNaN(e)&&!Number.isNaN(t)&&!Number.isNaN(a))return k(e,t,a)}}return null}let n={white:{r:255,g:255,b:255},black:{r:0,g:0,b:0},transparent:{r:255,g:255,b:255},red:{r:255,g:0,b:0},green:{r:0,g:128,b:0},blue:{r:0,g:0,b:255},yellow:{r:255,g:255,b:0},orange:{r:255,g:165,b:0},purple:{r:128,g:0,b:128},teal:{r:0,g:128,b:128},gray:{r:128,g:128,b:128},grey:{r:128,g:128,b:128}};return n[t]?n[t]:null}function k(e,t,n){let r=(e%360+360)%360,i=(1-Math.abs(2*n-1))*t,a=i*(1-Math.abs(r/60%2-1)),o=n-i/2,s=0,c=0,l=0;return r>=0&&r<60?(s=i,c=a):r>=60&&r<120?(s=a,c=i):r>=120&&r<180?(c=i,l=a):r>=180&&r<240?(c=a,l=i):r>=240&&r<300?(s=a,l=i):(s=i,l=a),{r:Math.round((s+o)*255),g:Math.round((c+o)*255),b:Math.round((l+o)*255)}}function A(e,t,n){let r=e=>{let t=Math.max(0,Math.min(255,e))/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},i=r(e),a=r(t),o=r(n);return .2126*i+.7152*a+.0722*o}function j(e,t){let n=typeof e==`string`?O(e)??{r:0,g:0,b:0}:e,r=typeof t==`string`?O(t)??{r:255,g:255,b:255}:t,i=A(n.r,n.g,n.b),a=A(r.r,r.g,r.b),o=Math.max(i,a),s=Math.min(i,a);return(o+.05)/(s+.05)}function M(e,t){let n=t?.darkColor??`#0f172a`,r=t?.lightColor??`#ffffff`;if(!e)return r;let i=O(e)??{r:26,g:157,b:144},a=O(n)??{r:15,g:23,b:42},o=O(r)??{r:255,g:255,b:255},s=A(i.r,i.g,i.b),c=A(a.r,a.g,a.b),l=A(o.r,o.g,o.b),u=(Math.max(s,c)+.05)/(Math.min(s,c)+.05);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)>=u?r:n}var N=(0,e.defineComponent)({__name:`CalendarItemDisplay`,props:{event:{},mode:{},headers:{},hours:{},position:{},isMobile:{type:Boolean},overlapIndex:{},overlapCount:{}},emits:[`event-click`],setup(t){let n=t,r=(0,e.computed)(()=>n.event.color||`var(--cal-primary)`),i=(0,e.computed)(()=>M(r.value)),a=(0,e.computed)(()=>{if(n.mode===`monthly`)return{zIndex:10,position:`relative`};if(n.position===`static`)return{width:`100%`,height:`36px`,position:`relative`};if(!n.headers?.length||!n.hours)return{display:`none`};let e=new Date(n.event.date).toLocaleDateString(`en-CA`),t=n.headers.findIndex(t=>new Date(t.date).toLocaleDateString(`en-CA`)===e);if(t===-1||n.hours.end-n.hours.start<=0)return{display:`none`};let r=n.event.time.split(`:`).map(Number),i=(r[0]??0)+(r[1]??0)/60,a=(i-n.hours.start)*80,o=100/n.headers.length,s=n.overlapCount??1,c=n.overlapIndex??0,l=o/s,u,d;if(n.event.duration&&n.event.duration>0){let e=Math.min(i+n.event.duration/60,n.hours.end);u=`${Math.max(0,e-i)*80}px`,d=`20px`}else u=n.isMobile&&n.mode===`weekly`?`16px`:`36px`;return{top:`${a}px`,insetInlineStart:`${t*o+c*l}%`,width:`${l}%`,height:u,minHeight:d,zIndex:10,boxSizing:`border-box`}}),o=(0,e.computed)(()=>({backgroundColor:r.value,color:i.value})),s=(0,e.computed)(()=>{let e=r.value,t=i.value;return n.mode===`monthly`?{backgroundColor:e,color:t,opacity:.9,borderLeft:`4px solid ${e}`}:{backgroundColor:e,color:t}});return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{id:`event-display`,style:(0,e.normalizeStyle)(a.value),class:(0,e.normalizeClass)([t.position===`static`?``:`absolute`,t.mode===`monthly`?``:t.isMobile&&t.mode===`weekly`?`px-0.5`:`px-1 sm:px-2`]),onClick:r[0]||=(0,e.withModifiers)(e=>n.$emit(`event-click`,t.event,e),[`stop`])},[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`flex whitespace-normal items-center rounded cursor-pointer transition-transform text-[10px] sm:text-[11px] leading-tight overflow-hidden`,t.mode===`monthly`?`px-2 relative mb-1 h-6 shrink-0 whitespace-nowrap text-ellipsis w-[calc(100%-16px)]`:t.isMobile&&t.mode===`weekly`?`absolute px-1 h-full w-[calc(100%-4px)] text-[9px] leading-none`:`absolute px-2 sm:px-4 h-full w-[calc(100%-8px)] sm:w-[calc(100%-16px)] sm:rounded-md`]),style:(0,e.normalizeStyle)(s.value)},[(0,e.renderSlot)(n.$slots,`event`,{event:t.event,mode:t.mode},()=>[(0,e.createElementVNode)(`div`,{style:(0,e.normalizeStyle)(o.value),class:`w-full h-full relative z-10 flex items-center gap-x-1 truncate font-medium`},(0,e.toDisplayString)(t.event.title),5)])],6)],6))}}),ee=(0,e.defineComponent)({name:`CalendarDayHolder`,props:{day:{type:Object,required:!0},otherMonth:{type:Boolean,default:!1},events:{type:Array,default:()=>[]}},components:{CalendarDayBadge:l,CalendarPattern:E,CalendarItemDisplay:N},emits:[`open-day`,`event-click`],setup(t,{emit:n}){let{t:i}=r();return{t:i,displayedEvents:(0,e.computed)(()=>t.events.slice(0,2)),openDay:()=>{n(`open-day`,t.day)},remainingCount:(0,e.computed)(()=>t.events.length-2)}}}),te={class:`relative top-0 left-0 w-full h-full p-4 flex flex-col`},ne={key:0,class:`shrink-0`},P={id:`holder`,class:`w-full flex-1 relative flex flex-col gap-y-1.5 mt-2`},F={class:`w-full h-full pointer-events-none absolute top-0 left-0`};function I(t,n,r,i,a,o){let s=(0,e.resolveComponent)(`CalendarDayBadge`),c=(0,e.resolveComponent)(`CalendarItemDisplay`),l=(0,e.resolveComponent)(`CalendarPattern`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`border border-outline-variant/50 w-full relative h-full transition-colors`,[t.otherMonth?`overflow-hidden`:`overflow-visible`,t.day.isToday&&!t.otherMonth?`bg-today-column`:``]])},[(0,e.createElementVNode)(`div`,te,[t.otherMonth?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,ne,[(0,e.createVNode)(s,{day:t.day},null,8,[`day`])])),(0,e.createElementVNode)(`div`,P,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.displayedEvents,r=>((0,e.openBlock)(),(0,e.createBlock)(c,{key:r.id,position:`static`,event:r,onEventClick:n[0]||=e=>t.$emit(`event-click`,e)},{event:(0,e.withCtx)(n=>[(0,e.renderSlot)(t.$slots,`event`,(0,e.mergeProps)({ref_for:!0},n))]),_:3},8,[`event`]))),128)),t.remainingCount>0?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,onClick:n[1]||=(...e)=>t.openDay&&t.openDay(...e),class:`w-full relative z-0 h-9 px-2 flex cursor-pointer items-center rounded-lg bg-surface-variant text-label-sm text-on-surface select-none`},(0,e.toDisplayString)(t.t(`calendar.moreItems`,{count:t.remainingCount})),1)):(0,e.createCommentVNode)(``,!0)])]),(0,e.createElementVNode)(`div`,F,[t.otherMonth?((0,e.openBlock)(),(0,e.createBlock)(l,{key:0,class:`absolute inset-0 z-0 pointer-events-none`})):(0,e.createCommentVNode)(``,!0)])],2)}var L=o(ee,[[`render`,I]]),R=(0,e.defineComponent)({name:`CalendarPointer`,props:{mode:{type:String,required:!0},hours:{type:Object,required:!0},headers:{type:Array,required:!0}},setup(t){let n=(0,e.ref)(new Date),r;(0,e.onMounted)(()=>{r=setInterval(()=>{n.value=new Date},6e4)}),(0,e.onUnmounted)(()=>{r&&clearInterval(r)});let i=(0,e.computed)(()=>{if(!t.headers||t.headers.length===0)return{display:`none`};let e=t.headers.findIndex(e=>e.isToday);if(e===-1)return{display:`none`};let r=n.value,i=r.getHours()+r.getMinutes()/60;if(t.mode===`monthly`){let n=Math.ceil(t.headers.length/7),r=Math.floor(e/7),a=e%7,o=100/n,s=i/24*o;return{width:`${100/7}%`,top:`${r*o+s}%`,insetInlineStart:`${a/7*100}%`,transition:``}}if(i<t.hours.start||i>t.hours.end)return{display:`none`};let a=t.headers.length,o=t.hours.end-t.hours.start;return{width:`${100/a}%`,top:`${(i-t.hours.start)/o*100}%`,insetInlineStart:`${e/a*100}%`,transition:``}});return{pointerStyle:i,isVisible:(0,e.computed)(()=>i.value.display!==`none`)}}});function z(t,n,r,i,a,o){return(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`absolute z-20 pointer-events-none -translate-y-1/2 flex items-center`,style:(0,e.normalizeStyle)(t.pointerStyle)},[...n[0]||=[(0,e.createElementVNode)(`div`,{class:`w-2.5 aspect-square rounded-full bg-error shrink-0`},null,-1),(0,e.createElementVNode)(`div`,{class:`h-0.5 flex-1 bg-error`},null,-1)]],4)),[[e.vShow,t.isVisible]])}var B=o(R,[[`render`,z]]),V=(0,e.defineComponent)({name:`MobileDayHolder`,props:{day:{type:Object,required:!0},isSelected:{type:Boolean,default:!1},events:{type:Array,default:()=>[]},expandProgress:{type:Number,default:0},isDragging:{type:Boolean,default:!1}},emits:[`select`],setup(t,{emit:n}){return{canSelect:(0,e.computed)(()=>t.events.length>0),displayedEvents:(0,e.computed)(()=>t.events.slice(0,4)),selectDay:()=>{n(`select`,t.day)},styles:(0,e.computed)(()=>t.isSelected?{border:`border-transparent`,bg:`opacity-100`,text:`text-surface`}:t.day.isToday?{border:`border-primary`,bg:`opacity-0`,text:`text-primary`}:{border:`border-transparent`,bg:`opacity-0`,text:`text-on-surface/50`})}}}),H={class:`w-full h-full absolute inset-0 left-0 top-0 flex items-center justify-center`},U={class:`w-full flex-1 relative flex justify-center`};function W(t,n,r,i,a,o){return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,{onClick:n[0]||=(...e)=>t.selectDay&&t.selectDay(...e),class:(0,e.normalizeClass)([`flex flex-col items-center justify-start gap-y-0.5 w-full overflow-hidden hw-accel-height`,[t.canSelect?`cursor-pointer`:`cursor-default`,t.isDragging?``:`transition-all duration-300 ease-out`]]),style:(0,e.normalizeStyle)({height:`${40+t.expandProgress*16}px`})},[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`relative w-8 h-8 shrink-0 rounded-full transition-all duration-200 ease-in-out aspect-square border`,t.styles.border])},[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`rounded-full w-full h-full transition-all duration-200 ease-in-out bg-on-surface`,t.styles.bg])},null,2),(0,e.createElementVNode)(`div`,H,[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`select-none text-label-md transition-all duration-200 ease-in-out`,t.styles.text])},(0,e.toDisplayString)(t.day.primary),3)])],2),(0,e.createElementVNode)(`div`,U,[t.canSelect?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:(0,e.normalizeClass)([`rounded-full aspect-square w-1.5 bg-error absolute hw-accel`,[t.isDragging?``:`transition-all duration-300 ease-out`]]),style:(0,e.normalizeStyle)({opacity:Math.max(0,1-t.expandProgress*2),transform:`scale(${Math.max(0,1-t.expandProgress*2)})`})},null,6)):(0,e.createCommentVNode)(``,!0),t.canSelect?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:1,class:(0,e.normalizeClass)([`w-full flex flex-col gap-y-px absolute top-0 px-0.5 hw-accel`,[t.isDragging?``:`transition-all duration-300 ease-out`]]),style:(0,e.normalizeStyle)({opacity:t.expandProgress,transform:`translateY(${(1-t.expandProgress)*6}px)`})},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.displayedEvents,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t.id,class:`w-full rounded-full shrink-0 min-h-1`,style:(0,e.normalizeStyle)({backgroundColor:t.color||`var(--cal-primary)`})},null,4))),128))],6)):(0,e.createCommentVNode)(``,!0)])],6)}var G=o(V,[[`render`,W],[`__scopeId`,`data-v-d90e616f`]]),K={class:`flex flex-col gap-y-1 p-3 flex-1`},q={class:`text-label-md font-semibold text-on-surface`},J={class:`text-body-sm text-on-surface/60`},Y=(0,e.defineComponent)({__name:`MobileEventListItem`,props:{event:{}},emits:[`event-click`],setup(t){return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`bg-surface-variant flex flex-col rounded-lg border cursor-pointer`,onClick:r[0]||=(0,e.withModifiers)(e=>n.$emit(`event-click`,t.event,e),[`stop`])},[(0,e.createElementVNode)(`div`,K,[(0,e.renderSlot)(n.$slots,`event`,{event:t.event},()=>[(0,e.createElementVNode)(`div`,q,(0,e.toDisplayString)(t.event.title),1),(0,e.createElementVNode)(`div`,J,(0,e.toDisplayString)(t.event.time),1)])]),(0,e.createElementVNode)(`div`,{class:`w-full h-1 shrink-0 rounded-b-full rounded-t-none`,style:(0,e.normalizeStyle)({backgroundColor:t.event.color||`#3b82f6`})},null,4)]))}}),X=(0,e.defineComponent)({name:`MobileCalendarGrid`,components:{MobileDayHolder:G,MobileEventListItem:Y},props:{days:{type:Array,default:()=>[]},eventsByDay:{type:Object,required:!0},loading:{type:Boolean,default:!1}},emits:[`event-click`],setup(t){let{getWeekDayNames:n}=i(),r=(0,e.computed)(()=>n.value),a=(0,e.ref)(!1),o=(0,e.ref)([]),s=(0,e.ref)(``),c=e=>{let n=new Date(e.date).toDateString();s.value=n;let r=t.eventsByDay.get(n);r&&r.length>0?(o.value=[...r],a.value=!0):a.value=!1};(0,e.onMounted)(()=>{let e=new Date().toDateString();s.value=e;let n=t.eventsByDay.get(e);n&&n.length>0&&(o.value=[...n],a.value=!0)});let l=e=>s.value===new Date(e.date).toDateString(),u=(0,e.ref)(0),d=(0,e.ref)(!1),f=0,p=0,m=!1;function h(e){f=e,p=u.value,d.value=!0}function g(e){if(!d.value)return;let t=e-f;m||=(requestAnimationFrame(()=>{let e=p+t/120;u.value=Math.max(0,Math.min(1,e)),m=!1}),!0)}function _(){d.value=!1,u.value>.25&&p===0?u.value=1:u.value<.75&&p===1?u.value=0:u.value=p}let v=e=>{h(e.touches[0]?.clientY??0)},y=e=>{let t=e.touches[0];t&&g(t.clientY)},b=()=>{_()},x=e=>{h(e.clientY),document.addEventListener(`mousemove`,S),document.addEventListener(`mouseup`,C)},S=e=>{g(e.clientY)},C=()=>{_(),document.removeEventListener(`mousemove`,S),document.removeEventListener(`mouseup`,C)};return{isDaySelected:l,weekDays:r,selectDay:c,handleMouseDown:x,handleMouseLeave:()=>{d.value&&(_(),document.removeEventListener(`mousemove`,S),document.removeEventListener(`mouseup`,C))},selectedDate:s,showEventsList:a,progress:u,isDragging:d,handleTouchStart:v,handleTouchMove:y,handleTouchEnd:b,eventsList:o}}}),Z={class:`w-full pt-6 px-4 relative flex flex-col flex-1 overflow-y-auto`},re={class:`select-none text-[10px] text-on-surface/50 w-full flex items-center justify-between`},ie={class:`font-medium`},ae={class:`w-full mt-4 grid grid-cols-7 gap-x-5 gap-y-4`},oe={key:0,class:`transition-all duration-200 ease-in-out overflow-hidden w-full mt-4 flex-1 overflow-y-auto`},se={class:`py-2 text-on-surface text-title-sm font-bold select-none border-b border-outline-variant mb-2`},ce={class:`w-full flex flex-col gap-y-2`};function le(t,n,r,i,a,o){let s=(0,e.resolveComponent)(`MobileDayHolder`),c=(0,e.resolveComponent)(`MobileEventListItem`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,Z,[n[6]||=(0,e.createElementVNode)(`div`,{class:`w-full fixed right-0 -translate-y-6 pointer-events-none z-50 h-6 bg-gradient-to-b from-surface to-transparent`},null,-1),(0,e.createElementVNode)(`div`,{id:`mobile-grid`,class:`w-full shrink-0 select-none`,style:{"touch-action":`pan-x`,"user-select":`none`},onTouchstart:n[0]||=(0,e.withModifiers)((...e)=>t.handleTouchStart&&t.handleTouchStart(...e),[`prevent`]),onTouchmove:n[1]||=(0,e.withModifiers)((...e)=>t.handleTouchMove&&t.handleTouchMove(...e),[`prevent`]),onTouchend:n[2]||=(...e)=>t.handleTouchEnd&&t.handleTouchEnd(...e),onMousedown:n[3]||=(0,e.withModifiers)((...e)=>t.handleMouseDown&&t.handleMouseDown(...e),[`prevent`]),onMouseleave:n[4]||=(...e)=>t.handleMouseLeave&&t.handleMouseLeave(...e)},[(0,e.createElementVNode)(`div`,re,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.weekDays,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`aspect-square w-8 shrink-0 flex items-center justify-center`,key:t.dayOfWeek},[(0,e.createElementVNode)(`div`,ie,(0,e.toDisplayString)(t.label),1)]))),128))]),(0,e.createElementVNode)(`div`,ae,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.days,(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:r,class:(0,e.normalizeClass)([`transition-all duration-200 rounded-lg`,n.otherMonth?`opacity-0 pointer-events-none`:`opacity-100`,n.isToday&&!n.otherMonth?`bg-today-column`:``])},[(0,e.createVNode)(s,{"is-selected":t.isDaySelected(n),"expand-progress":t.progress,"is-dragging":t.isDragging,onSelect:t.selectDay,day:n,events:t.eventsByDay.get(new Date(n.date).toDateString())||[]},null,8,[`is-selected`,`expand-progress`,`is-dragging`,`onSelect`,`day`,`events`])],2))),128))])],32),t.showEventsList?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,oe,[(0,e.createElementVNode)(`div`,se,(0,e.toDisplayString)(t.selectedDate),1),(0,e.createElementVNode)(`div`,ce,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.eventsList,r=>((0,e.openBlock)(),(0,e.createBlock)(c,{key:r.id,event:r,onEventClick:n[5]||=(e,n)=>t.$emit(`event-click`,e,n)},{event:(0,e.withCtx)(({event:n})=>[(0,e.renderSlot)(t.$slots,`event-mobile`,{event:n})]),_:2},1032,[`event`]))),128))])])):(0,e.createCommentVNode)(``,!0)])}var ue=o(X,[[`render`,le]]),de={class:`detail-wrapper-stub`},fe=(0,e.defineComponent)({__name:`CalendarEventDetailWrapper`,emits:[`lock-scroll`],setup(t){return(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,de))}}),pe=(0,e.defineComponent)({components:{MobileCalendarGrid:ue,CalendarHeaderItem:_,CalendarSideItem:x,CalendarDayHolder:L,CalendarPointer:B,CalendarItemDisplay:N,CalendarEventDetailWrapper:fe},props:{range:{type:Object,required:!0},mode:{type:String,default:`monthly`},hours:{type:Object,default:()=>({start:0,end:24})},events:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},dir:{type:String,default:``}},emits:[`update:mode`,`update:range`,`event-click`],setup(n,{emit:r}){let a=(0,e.computed)(()=>n.loading),{width:o}=t(),s=(0,e.computed)(()=>o.value<768),{getCalendarHeaders:c}=i(),l=(0,e.useTemplateRef)(`scrollContainer`),u=(0,e.computed)(()=>c(n.range,n.mode)),d=(0,e.computed)(()=>u.value),f=(0,e.computed)(()=>n.mode===`monthly`?d.value.slice(0,7):d.value),p=(0,e.computed)(()=>n.mode===`daily`||n.mode===`monthly`?-1:d.value.findIndex(e=>e.isToday)),m=(0,e.computed)(()=>{let e=new Map;return n.events.forEach(t=>{let n=new Date(t.date).toDateString();e.has(n)||e.set(n,[]),e.get(n)?.push(t)}),e}),h=(0,e.computed)(()=>{let e=new Map,t=u.value.filter(e=>!e.otherMonth),r=new Set(t.map(e=>new Date(e.date).toDateString()));return n.events.forEach(t=>{let n=new Date(t.date).toDateString();r.has(n)&&(e.has(n)||e.set(n,[]),e.get(n)?.push(t))}),e});function g(e){if(!e.duration||e.duration<=0)return[e];let t=e.time.split(`:`).map(Number),n=(t[0]??0)+(t[1]??0)/60;if(n+e.duration/60<=24)return[e];let r=[],i=new Date(e.date),a=0,o=n,s=e.duration;for(;s>0;){let t=Math.min(s,(24-o)*60),n=Math.floor(o),c=Math.round((o-n)*60);r.push({...e,id:`${e.id}_d${a}`,date:new Date(i.getTime()+a*864e5),time:`${String(n).padStart(2,`0`)}:${String(c).padStart(2,`0`)}`,duration:Math.round(t)}),s-=t,o=0,a++}return r}let _=(0,e.computed)(()=>{if(n.mode===`monthly`)return[];let e=new Set(d.value.map(e=>new Date(e.date).toLocaleDateString(`en-CA`)));return n.events.flatMap(g).filter(t=>{let n=new Date(t.date).toLocaleDateString(`en-CA`);return e.has(n)})}),v=(0,e.computed)(()=>{let e=[],t=[],r=new Map;for(let e of d.value)r.set(new Date(e.date).toLocaleDateString(`en-CA`),[]);for(let e of _.value)r.get(new Date(e.date).toLocaleDateString(`en-CA`))?.push(e);for(let[i,a]of r.entries()){if(!a.length)continue;let r=d.value.findIndex(e=>new Date(e.date).toLocaleDateString(`en-CA`)===i),o=a.map(e=>{let t=e.time.split(`:`).map(Number),n=(t[0]??0)+(t[1]??0)/60;return{event:e,start:n,end:e.duration?n+e.duration/60:n+.5,col:0}}).sort((e,t)=>e.start-t.start||t.end-e.end),s=[];for(let e of o){let t=s.findIndex(t=>t<=e.start);e.col=t===-1?s.length:t,s[e.col]=e.end}if(n.mode===`daily`)for(let t of o){let n=t.col;for(let e of o)e!==t&&e.start<t.end&&e.end>t.start&&(n=Math.max(n,e.col));e.push({event:t.event,overlapIndex:t.col,overlapCount:n+1})}else{for(let t of o){if(t.col>=2)continue;let n=t.col;for(let e of o)e!==t&&e.col<2&&e.start<t.end&&e.end>t.start&&(n=Math.max(n,e.col));e.push({event:t.event,overlapIndex:t.col,overlapCount:n+1})}let n=o.filter(e=>e.col>=2).sort((e,t)=>e.start-t.start),i=[];for(let e of n){let t=i[i.length-1];!t||e.start>=t.end?i.push({start:e.start,end:e.end,count:1}):(t.end=Math.max(t.end,e.end),t.count++)}for(let e of i){let n=o.filter(t=>t.col<2&&t.start<e.end&&t.end>e.start).reduce((e,t)=>Math.max(e,t.end),e.start);t.push({dayIndex:r,endDecimal:n,count:e.count})}}}return{events:e,overflows:t}}),y=(0,e.computed)(()=>v.value.events),b=(0,e.computed)(()=>v.value.overflows),x=(0,e.computed)(()=>{if(n.mode===`monthly`||_.value.length===0)return n.hours;let e=n.hours.start,t=n.hours.end;for(let n of _.value){let r=n.time.split(`:`).map(Number),i=(r[0]??0)+(r[1]??0)/60,a=n.duration?i+n.duration/60:i;e=Math.min(e,Math.floor(i)),t=Math.max(t,Math.ceil(a))}return{start:Math.max(0,e),end:Math.min(24,t)}}),S=(0,e.ref)(!1),C=e=>{S.value=e},w=e=>{let t=new Date(e.date);r(`update:range`,{start:new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0),end:new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59,999)}),r(`update:mode`,`daily`,t)},T=(0,e.ref)(!0);(0,e.watch)([s,()=>n.mode],()=>{T.value=s.value?n.mode!==`monthly`:!0},{immediate:!0});let E=(0,e.computed)(()=>{let e=[];for(let t=x.value.start;t<x.value.end;t++)e.push({raw:t});return e});return(0,e.watch)(()=>n.events,async()=>{if(n.mode===`monthly`||!l.value)return;await(0,e.nextTick)();let t=l.value,r=_.value.map(e=>parseInt(e.time.split(`:`)[0],10));if(r.length===0)return;r.sort((e,t)=>e-t);let i=((r[Math.floor(r.length/2)]??x.value.start)-x.value.start)*80-t.clientHeight/2+80/2;t.scrollTo({top:Math.max(0,i),behavior:`smooth`})},{deep:!0}),{isLoading:a,hoursList:E,effectiveHours:x,scrollContainer:l,headers:d,allHeaders:u,isMobile:s,displayedHeader:f,todayColumnIndex:p,monthlyEventsByDay:h,eventsByDay:m,gridEvents:y,overflowIndicators:b,scrollLocked:S,showMonthly:T,setLockScroll:C,openSpecificDay:w}}}),me=[`dir`],he={ref:`scrollContainer`,class:`flex-1 w-full flex overflow-y-auto cal-scrollbar`},ge={class:`flex-1 relative`},_e={class:`absolute inset-0 w-full flex flex-col pointer-events-none`},ve={class:`absolute inset-0 w-full flex pointer-events-none`},ye={class:`relative min-h-full w-full`},be=[`onClick`],xe={key:2,class:`w-full`};function Se(t,n,r,i,a,o){let s=(0,e.resolveComponent)(`CalendarEventDetailWrapper`),c=(0,e.resolveComponent)(`CalendarHeaderItem`),l=(0,e.resolveComponent)(`CalendarSideItem`),u=(0,e.resolveComponent)(`CalendarPointer`),d=(0,e.resolveComponent)(`CalendarItemDisplay`),f=(0,e.resolveComponent)(`CalendarDayHolder`),p=(0,e.resolveComponent)(`MobileCalendarGrid`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`w-full h-full flex flex-col bg-surface whitespace-normal`,dir:t.dir},[(0,e.createVNode)(s,{onLockScroll:t.setLockScroll},null,8,[`onLockScroll`]),t.showMonthly?((0,e.openBlock)(),(0,e.createBlock)(c,{key:0,class:`shrink-0 border-b border-surface-variant`,mode:t.mode,days:t.displayedHeader,"today-column-index":t.todayColumnIndex},null,8,[`mode`,`days`,`today-column-index`])):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`div`,he,[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`shrink-0 transition-all duration-300`,[t.mode===`monthly`?`w-0 opacity-0 overflow-hidden`:`w-8 sm:w-9 md:w-25 opacity-100 h-full`]])},[(0,e.createVNode)(l,{class:`w-8 sm:w-9 md:w-25 min-h-full`,range:t.effectiveHours},null,8,[`range`])],2),(0,e.createElementVNode)(`div`,ge,[(0,e.createVNode)(e.Transition,{name:`calendar-view`,mode:`out-in`},{default:(0,e.withCtx)(()=>[t.mode===`monthly`?t.isMobile?t.mode===`monthly`&&t.isMobile?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,xe,[(0,e.createVNode)(p,{loading:t.isLoading,days:t.headers,mode:t.mode,"events-by-day":t.monthlyEventsByDay,"is-other-month-func":e=>t.headers.find(t=>new Date(t.date).toDateString()===new Date(e).toDateString())?.otherMonth||!1,onEventClick:n[2]||=e=>t.$emit(`event-click`,e)},(0,e.createSlots)({_:2},[t.$slots[`event-mobile`]?{name:`event-mobile`,fn:(0,e.withCtx)(({event:n})=>[(0,e.renderSlot)(t.$slots,`event-mobile`,{event:n,mode:`monthly-mobile`},void 0,!0)]),key:`0`}:void 0]),1032,[`loading`,`days`,`mode`,`events-by-day`,`is-other-month-func`])])):(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:`month-${t.range?.start?.getTime()}`,class:`w-full grid grid-cols-7 auto-rows-[186px] overflow-hidden`},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.allHeaders,(r,i)=>((0,e.openBlock)(),(0,e.createBlock)(f,{key:i,day:r,"other-month":!!r.otherMonth,events:t.monthlyEventsByDay.get(new Date(r.date).toDateString())||[],onOpenDay:e=>t.openSpecificDay(r),onEventClick:n[1]||=e=>t.$emit(`event-click`,e)},(0,e.createSlots)({_:2},[t.$slots.event?{name:`event`,fn:(0,e.withCtx)(n=>[(0,e.renderSlot)(t.$slots,`event`,(0,e.mergeProps)({ref_for:!0},n),void 0,!0)]),key:`0`}:void 0]),1032,[`day`,`other-month`,`events`,`onOpenDay`]))),128))])):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:`time-${t.mode}-${t.range?.start?.getTime()}`,class:`w-full relative`,style:(0,e.normalizeStyle)({height:`${t.hoursList.length*80}px`})},[(0,e.createVNode)(u,{mode:t.mode,hours:t.effectiveHours,headers:t.headers},null,8,[`mode`,`hours`,`headers`]),(0,e.createElementVNode)(`div`,_e,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.effectiveHours.end-t.effectiveHours.start,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t,class:`w-full border-b border-surface-variant box-border h-20`}))),128))]),(0,e.createElementVNode)(`div`,ve,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.headers,(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`h-full border-r border-surface-variant flex-1 transition-colors`,{"bg-today-column":r===t.todayColumnIndex}]),key:`v`+r},null,2))),128))]),(0,e.createElementVNode)(`div`,ye,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.gridEvents,r=>((0,e.openBlock)(),(0,e.createBlock)(d,{key:r.event.id,event:r.event,mode:t.mode,headers:t.headers,hours:t.effectiveHours,isMobile:t.isMobile,"overlap-index":r.overlapIndex,"overlap-count":r.overlapCount,onEventClick:n[0]||=e=>t.$emit(`event-click`,e)},(0,e.createSlots)({_:2},[t.$slots.event?{name:`event`,fn:(0,e.withCtx)(n=>[(0,e.renderSlot)(t.$slots,`event`,(0,e.mergeProps)({ref_for:!0},n),void 0,!0)]),key:`0`}:void 0]),1032,[`event`,`mode`,`headers`,`hours`,`isMobile`,`overlap-index`,`overlap-count`]))),128)),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.overflowIndicators,(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:`of-${r}`,class:`absolute px-0.5 sm:px-1 z-20 pointer-events-auto`,style:(0,e.normalizeStyle)({top:`${(Math.min(n.endDecimal,t.effectiveHours.end)-t.effectiveHours.start)*80}px`,insetInlineStart:`${n.dayIndex*(100/t.headers.length)}%`,width:`${100/t.headers.length}%`})},[(0,e.createElementVNode)(`button`,{class:`w-full text-[8px] sm:text-[10px] leading-none rounded bg-surface-variant hover:bg-surface-variant/80 text-on-surface/70 px-1 sm:px-2 py-0.5 sm:py-1 truncate transition-colors`,onClick:e=>t.openSpecificDay(t.headers[n.dayIndex])},` +`+(0,e.toDisplayString)(n.count)+` more `,9,be)],4))),128))])],4))]),_:3})])],512)],8,me)}var Ce=o(pe,[[`render`,Se],[`__scopeId`,`data-v-66575d8b`]]),we=[`dir`],Te={ref:`scrollContainer`,class:`flex-1 w-full overflow-y-auto cal-scrollbar px-2 sm:px-4 md:px-6 py-3 sm:py-5`},Ee={class:`max-w-4xl mx-auto flex flex-col gap-6`},De={class:`agenda-section-header sticky top-0 z-10 py-1.5 flex items-center gap-3 bg-surface/95 backdrop-blur-xs`},Oe={class:`rounded-full bg-surface-variant px-3 py-0.5 text-xs font-semibold text-on-surface/70 border border-outline-variant shadow-xs select-none`},ke={class:`flex flex-col gap-3`},Ae={class:`agenda-date-col shrink-0 flex flex-col items-start w-24 sm:w-32 md:w-36 pt-0.5 select-none`},je={class:`sm:hidden`},Me={class:`hidden sm:inline`},Ne={class:`mt-1 flex items-center gap-1.5 sm:gap-2`},Pe={class:`flex flex-col text-[10px] sm:text-xs leading-none text-on-surface/50 gap-0.5`},Fe={key:0,class:`opacity-70`},Q={key:0,class:`mt-1 text-[10px] font-medium text-error truncate max-w-full`},Ie={class:`agenda-events-col flex-1 min-w-0 flex flex-col gap-2`},Le=[`onClick`],Re={class:`min-w-0 flex-1 font-semibold text-xs sm:text-sm md:text-base leading-snug truncate`},ze={key:0,class:`shrink-0 text-[11px] sm:text-xs md:text-sm font-medium opacity-90 flex items-center gap-1.5 whitespace-nowrap`},Be={key:1,class:`agenda-no-events flex items-center text-xs text-on-surface/40 italic py-2 px-3 rounded-lg border border-dashed border-outline-variant select-none`},$=o((0,e.defineComponent)({__name:`CalendarAgenda`,props:{range:{},events:{default:()=>[]},dir:{default:``}},emits:[`event-click`],setup(t){let n=t,a=(0,e.inject)(`calendarConfig`,(0,e.ref)({locale:`fa-IR`,calendar:`jalaali`,startOfWeek:`saturday`,showHolidays:!1})),{t:o}=r(),{getCalendarHeaders:s}=i(),c=(0,e.computed)(()=>{let e=String(a.value.locale||``).toLowerCase();return e.startsWith(`fa`)||e.startsWith(`ar`)}),l=(0,e.computed)(()=>n.dir?n.dir:c.value?`rtl`:`ltr`);function u(e){if(!e||typeof e!=`string`)return 0;let t=e.split(`:`).map(Number),n=t[0]??0,r=t[1]??0;return Number.isNaN(n)||Number.isNaN(r)?0:n*60+r}let d=[`۰`,`۱`,`۲`,`۳`,`۴`,`۵`,`۶`,`۷`,`۸`,`۹`];function f(e){return c.value?e.replace(/\d/g,e=>d[parseInt(e,10)]??e):e}function p(e){if(e.isFullDay)return o(`calendar.allDay`)||(c.value?`تمام روز`:`All day`);if(!e.time)return``;if(!e.duration||e.duration<=0)return f(e.time);let t=u(e.time)+e.duration,n=Math.floor(t%1440/60),r=t%60,i=`${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`,a=f(e.time),s=f(i);return c.value?`${a} تا ${s}`:`${a} – ${s}`}function m(e){let t=e.color||`var(--cal-primary, #1a9d90)`;return{backgroundColor:t,color:M(t)}}let h=(0,e.computed)(()=>s(n.range,`agenda`));function g(e,t){if(!e.date)return!1;let n=new Date(t.date),r=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0).getTime(),i=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59,999).getTime(),a=new Date(e.date),o=u(e.time),s=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0).getTime()+o*60*1e3,c=s;return e.duration&&e.duration>0?c=s+e.duration*60*1e3:e.isFullDay&&(c=new Date(a.getFullYear(),a.getMonth(),a.getDate(),23,59,59,999).getTime()),s<=i&&c>=r}function _(e){return n.events.filter(t=>g(t,e)).sort((e,t)=>{if(e.isFullDay&&!t.isFullDay)return-1;if(!e.isFullDay&&t.isFullDay)return 1;let n=u(e.time),r=u(t.time);return n===r?String(e.title||``).localeCompare(String(t.title||``)):n-r})}function v(e,t){let n=c.value,r=n?`fa-IR`:`en-US`,i=a.value.calendar===`jalaali`?`persian`:a.value.calendar===`islamic`?`islamic-civil`:`gregory`,o=new Intl.DateTimeFormat(`${r}-u-ca-${i}`,{day:`numeric`,month:`short`,year:`numeric`}).formatToParts(e),s=new Intl.DateTimeFormat(`${r}-u-ca-${i}`,{day:`numeric`,month:`short`,year:`numeric`}).formatToParts(t),l=o.find(e=>e.type===`day`)?.value||``,u=o.find(e=>e.type===`month`)?.value||``,d=o.find(e=>e.type===`year`)?.value||``,f=s.find(e=>e.type===`day`)?.value||``,p=s.find(e=>e.type===`month`)?.value||``,m=s.find(e=>e.type===`year`)?.value||``;return d===m&&u===p?n?`${l} – ${f} ${u}`:`${u} ${l} – ${f}`:d===m?n?`${l} ${u} – ${f} ${p}`:`${u} ${l} – ${p} ${f}`:n?`${l} ${u} ${d} – ${f} ${p} ${m}`:`${u} ${l}, ${d} – ${p} ${f}, ${d}`}let y=(0,e.computed)(()=>{let e=h.value;if(!e.length)return[];let t=[];for(let n=0;n<e.length;n+=7){let r=e.slice(n,n+7),i=r[0]?.date||new Date,a=r[r.length-1]?.date||i;t.push({id:`section-${i.getTime()}-${a.getTime()}`,rangeLabel:v(i,a),days:r.map(e=>({day:e,events:_(e)}))})}return t});return(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`calendar-agenda w-full h-full flex flex-col bg-surface overflow-hidden`,dir:l.value},[(0,e.createElementVNode)(`div`,Te,[(0,e.createElementVNode)(`div`,Ee,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(y.value,r=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:r.id,class:`agenda-section flex flex-col gap-3`},[(0,e.createElementVNode)(`div`,De,[n[0]||=(0,e.createElementVNode)(`div`,{class:`h-px flex-1 bg-outline-variant`},null,-1),(0,e.createElementVNode)(`span`,Oe,(0,e.toDisplayString)(r.rangeLabel),1),n[1]||=(0,e.createElementVNode)(`div`,{class:`h-px flex-1 bg-outline-variant`},null,-1)]),(0,e.createElementVNode)(`div`,ke,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(r.days,r=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:r.day.name+r.day.date.getTime(),class:(0,e.normalizeClass)([`agenda-day-row flex flex-row items-start gap-3 sm:gap-5 p-2.5 sm:p-3.5 rounded-xl border border-outline-variant/60 transition-colors`,{"bg-today-column ring-1 ring-primary/30 border-primary/40":r.day.isToday,"bg-surface":!r.day.isToday}])},[(0,e.createElementVNode)(`div`,Ae,[(0,e.createElementVNode)(`span`,{class:(0,e.normalizeClass)([`text-xs sm:text-sm font-semibold truncate max-w-full`,r.day.isToday?`text-primary font-bold`:`text-on-surface/80`])},[(0,e.createElementVNode)(`span`,je,(0,e.toDisplayString)(r.day.shortName||r.day.name),1),(0,e.createElementVNode)(`span`,Me,(0,e.toDisplayString)(r.day.name),1)],2),(0,e.createElementVNode)(`div`,Ne,[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`flex size-7 sm:size-8 items-center justify-center rounded-full text-xs sm:text-sm font-bold shadow-xs shrink-0`,[r.day.isToday?`bg-primary text-surface font-extrabold ring-2 ring-primary/30`:r.day.isWeekend||r.day.isHoliday?`bg-surface-variant text-error border border-outline-variant`:`bg-surface-variant text-on-surface border border-outline-variant`]])},(0,e.toDisplayString)(r.day.primary),3),(0,e.createElementVNode)(`div`,Pe,[(0,e.createElementVNode)(`span`,{class:(0,e.normalizeClass)({"text-error":r.day.isWeekend||r.day.isHoliday})},(0,e.toDisplayString)(r.day.secondary),3),r.day.tertiary?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,Fe,(0,e.toDisplayString)(r.day.tertiary),1)):(0,e.createCommentVNode)(``,!0)])]),r.day.holidayTitle?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,Q,(0,e.toDisplayString)(r.day.holidayTitle),1)):(0,e.createCommentVNode)(``,!0)]),(0,e.createElementVNode)(`div`,Ie,[r.events.length>0?((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,{key:0},(0,e.renderList)(r.events,r=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:r.id,class:`agenda-event-card group flex items-center justify-between gap-3 rounded-lg sm:rounded-xl p-2.5 sm:px-4 sm:py-3 shadow-xs cursor-pointer transition-all hover:scale-[1.006] hover:shadow-md active:scale-[0.995]`,style:(0,e.normalizeStyle)(m(r)),onClick:e=>t.$emit(`event-click`,r)},[(0,e.renderSlot)(t.$slots,`event`,{event:r,mode:`agenda`},()=>[(0,e.createElementVNode)(`div`,Re,(0,e.toDisplayString)(r.title),1),r.time||r.isFullDay?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,ze,[n[2]||=(0,e.createElementVNode)(`svg`,{class:`size-3 sm:size-3.5 opacity-80`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,e.createElementVNode)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.createElementVNode)(`polyline`,{points:`12 6 12 12 16 14`})],-1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(p(r)),1)])):(0,e.createCommentVNode)(``,!0)],!0)],12,Le))),128)):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Be,(0,e.toDisplayString)((0,e.unref)(o)(`calendar.noEvents`)||`No events`),1))])],2))),128))])]))),128))])],512)],8,we))}}),[[`__scopeId`,`data-v-d9fbe1f4`]]),Ve={key:0,class:`w-full h-full flex flex-col font-sans`,style:{color:`var(--cal-on-surface)`,background:`var(--cal-surface)`}},He={class:`w-full flex-1 overflow-hidden relative`},Ue=(0,e.defineComponent)({__name:`VueCalendar`,props:{events:{default:()=>[]},mode:{default:`monthly`},locale:{default:`en-US`},calendarType:{default:`gregory`},startOfWeek:{},hours:{default:()=>({start:0,end:24})},initialDate:{default:()=>new Date}},emits:[`update:mode`,`range-change`,`event-click`],setup(t,{expose:n,emit:r}){let a=t,o=r,s=(0,e.ref)(!1),c=(0,e.ref)(new Date(a.initialDate)),l={gregory:`gregory`,persian:`jalaali`,"islamic-uma":`islamic`},u=[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`],d=(0,e.computed)(()=>a.startOfWeek!==void 0&&a.startOfWeek>=0&&a.startOfWeek<=6?a.startOfWeek:a.calendarType===`gregory`?1:6),f=(0,e.computed)(()=>({locale:a.locale,calendar:l[a.calendarType],startOfWeek:u[d.value]??`sunday`,showHolidays:!1}));(0,e.provide)(`calendarConfig`,f),(0,e.provide)(`calendarHolidays`,(0,e.ref)({}));let{getMonthBounds:p,offsetPeriod:m}=i(f),h=(0,e.computed)(()=>{let e=new Date(c.value),t=new Date(c.value);if(a.mode===`daily`)return e.setHours(0,0,0,0),t.setHours(23,59,59,999),{start:e,end:t};if(a.mode===`3days`)return e.setHours(0,0,0,0),t.setTime(e.getTime()),t.setDate(e.getDate()+2),t.setHours(23,59,59,999),{start:e,end:t};if(a.mode===`weekly`){let n=d.value,r=e.getDay(),i=(r<n?7:0)+r-n;return e.setDate(e.getDate()-i),e.setHours(0,0,0,0),t.setTime(e.getTime()),t.setDate(e.getDate()+6),t.setHours(23,59,59,999),{start:e,end:t}}else return p(c.value)}),g=()=>{c.value=m(c.value,a.mode,1),o(`range-change`,h.value)},_=()=>{c.value=m(c.value,a.mode,-1),o(`range-change`,h.value)},v=(e,t)=>{t&&(c.value=new Date(t)),o(`update:mode`,e,t)},y=(e,t)=>{t&&(c.value=new Date(t)),o(`update:mode`,e,t)};return(0,e.watch)(()=>a.initialDate,e=>{e&&(c.value=new Date(e),o(`range-change`,h.value))}),(0,e.watch)(h,e=>{s.value&&o(`range-change`,e)}),(0,e.onMounted)(()=>{s.value=!0,o(`range-change`,h.value)}),n({goNext:g,goPrev:_,setMode:y,currentRange:h,handleModeUpdate:v}),(n,r)=>s.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Ve,[(0,e.renderSlot)(n.$slots,`header`,{mode:t.mode,range:h.value,next:g,prev:_,setMode:y}),(0,e.createElementVNode)(`div`,He,[t.mode===`agenda`?((0,e.openBlock)(),(0,e.createBlock)($,{key:0,range:h.value,events:t.events,onEventClick:r[0]||=e=>n.$emit(`event-click`,e)},(0,e.createSlots)({_:2},[n.$slots.event?{name:`event`,fn:(0,e.withCtx)(t=>[(0,e.renderSlot)(n.$slots,`event`,(0,e.normalizeProps)((0,e.guardReactiveProps)(t)))]),key:`0`}:void 0]),1032,[`range`,`events`])):((0,e.openBlock)(),(0,e.createBlock)(Ce,{key:1,range:h.value,mode:t.mode,events:t.events,hours:t.hours,"onUpdate:mode":r[1]||=(e,t)=>v(e,t),onEventClick:r[2]||=e=>n.$emit(`event-click`,e),"onUpdate:range":r[3]||=e=>n.$emit(`range-change`,e)},(0,e.createSlots)({_:2},[n.$slots.event?{name:`event`,fn:(0,e.withCtx)(t=>[(0,e.renderSlot)(n.$slots,`event`,(0,e.normalizeProps)((0,e.guardReactiveProps)(t)))]),key:`0`}:void 0,n.$slots[`event-mobile`]?{name:`event-mobile`,fn:(0,e.withCtx)(t=>[(0,e.renderSlot)(n.$slots,`event-mobile`,(0,e.normalizeProps)((0,e.guardReactiveProps)(t)))]),key:`1`}:void 0]),1032,[`range`,`mode`,`events`,`hours`]))])])):(0,e.createCommentVNode)(``,!0)}});exports.CalendarAgenda=$,exports.VueCalendar=Ue,exports.getAccessibleTextColor=M,exports.getContrastRatio=j,exports.getRelativeLuminance=A,exports.parseColorToRgb=O;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("vue");var t=()=>{let t=(0,e.ref)(typeof window<`u`?window.innerWidth:1024),n=(0,e.ref)(typeof window<`u`?window.innerHeight:768),r=()=>{t.value=window.innerWidth,n.value=window.innerHeight};return(0,e.onMounted)(()=>window.addEventListener(`resize`,r)),(0,e.onUnmounted)(()=>window.removeEventListener(`resize`,r)),{width:t,height:n}},n=e=>(typeof e==`object`&&e&&`value`in e?String(e.value):String(e||`fa-IR`)).replace(/[^a-zA-Z-]/g,`-`).split(`-`)[0]||`fa`,r=()=>{let t=(0,e.inject)(`calendarConfig`,(0,e.ref)({locale:`en`,calendar:`gregory`,startOfWeek:`sunday`,showHolidays:!1}));return{t:(e,n)=>{let r=t.value.locale.startsWith(`fa`);return{"calendar.dayTimes.morning":r?`صبح`:`Morning`,"calendar.dayTimes.noon":r?`ظهر`:`Noon`,"calendar.dayTimes.afternoon":r?`عصر`:`Afternoon`,"calendar.dayTimes.night":r?`شب`:`Night`,"calendar.moreItems":r?`${n?.count} مورد دیگر`:`${n?.count} More Items`,"calendar.noEvents":r?`رویدادی وجود ندارد`:`No events`,"calendar.allDay":r?`تمام روز`:`All day`,"calendar.agenda":r?`برنامه`:`Agenda`}[e]||e},config:t}},i=t=>{let r=(0,e.inject)(`calendarConfig`,(0,e.ref)({locale:`fa-IR`,calendar:`jalaali`,startOfWeek:`saturday`,showHolidays:!0})),i=t||r,a=(0,e.inject)(`calendarHolidays`,(0,e.ref)({})),o=(0,e.computed)(()=>{let e=i.value.calendar;return e===`jalaali`?`persian`:e===`islamic`?`islamic-uma`:`gregory`}),s=e=>({sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6})[e.toLowerCase()]??0,c=e=>{let t=new Date(e);t.setHours(12,0,0,0);let n=o.value;n===`islamic-uma`&&(n=`islamic-civil`,t.setDate(t.getDate()-1));let r=new Intl.DateTimeFormat(`en-u-ca-${n}`,{year:`numeric`,month:`numeric`,day:`numeric`}).formatToParts(t),i=e=>parseInt(r.find(t=>t.type===e)?.value||`0`);return{year:i(`year`),month:i(`month`),day:i(`day`)}},l=(0,e.computed)(()=>i.value.calendar===`gregory`?1:6),u=e=>String(e),d=e=>{let t=[`۰`,`۱`,`۲`,`۳`,`۴`,`۵`,`۶`,`۷`,`۸`,`۹`];return String(e).replace(/\d/g,e=>t[parseInt(e)]??e)},f=e=>{let t=n(i.value.locale),r=new Date(e);r.setDate(r.getDate()+-1);let s=(t,n=e)=>{let r=new Intl.DateTimeFormat(`en-u-ca-${t}`,{year:`numeric`,month:`numeric`,day:`numeric`}).formatToParts(n);return parseInt(r.find(e=>e.type===`day`)?.value||`0`)},c=s(`gregory`),l=s(`persian`),f=s(`islamic-civil`,r),p=t===`fa`||t===`ar`,m=u(c),h=p?d(l):u(l),g=p?d(f):u(f),_=i.value.calendar,v,y,b;_===`jalaali`?(v=h,y=m,b=g):_===`islamic`?(v=g,y=h,b=m):(v=m,y=h,b=g);let x=new Date,S=e.getDate()===x.getDate()&&e.getMonth()===x.getMonth()&&e.getFullYear()===x.getFullYear(),C=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,w=a.value[C],T=w?.isHoliday||!1,E=w?.titles?.join(` - `)||null,D=e.getDay(),O=i.value.showHolidays?_===`jalaali`||_===`islamic`?D===5:D===0:!1,k=i.value.showHolidays?O||T:!1,A=o.value,j=new Intl.DateTimeFormat(`${t}-u-ca-${A}`,{weekday:`long`}).format(e),M=new Intl.DateTimeFormat(`${t}-u-ca-${A}`,{weekday:`short`}).format(e);return{date:new Date(e),primary:v,secondary:y,tertiary:b,jalaali:l,gregorian:c,ghamari:f,isToday:S,isWeekend:O,isHoliday:k,holidayTitle:E,name:j,shortName:M,dayOfWeek:D}},p=(e,t)=>{if(!e)return[];let n=[];if(t===`monthly`){let t=new Date(e.start);t.setHours(12,0,0,0);let r=c(t),a=r.month,o=r.year,l=new Date(t);for(;c(l).day!==1;)l.setDate(l.getDate()-1);let u=new Date(l);for(;;){u.setDate(u.getDate()+1);let e=c(u);if(e.month!==a||e.year!==o){u.setDate(u.getDate()-1);break}}let d=s(i.value.calendar===`gregory`?`monday`:`saturday`),p=l.getDay()-d;p<0&&(p+=7);let m=new Date(l);m.setDate(m.getDate()-p);let h=((d+6)%7-u.getDay()+7)%7,g=new Date(u);g.setDate(g.getDate()+h);let _=new Date(m);for(;_<=g;){let e=f(new Date(_)),t=c(_);n.push({...e,otherMonth:t.month!==a||t.year!==o}),_.setDate(_.getDate()+1)}}else if(t===`agenda`){let t=new Date(e.start);t.setHours(12,0,0,0);let r=c(t),i=r.month,a=r.year,o=new Date(t);for(;c(o).day!==1;)o.setDate(o.getDate()-1);let s=new Date(o);for(;;){s.setDate(s.getDate()+1);let e=c(s);if(e.month!==i||e.year!==a){s.setDate(s.getDate()-1);break}}let l=new Date(o);for(;l<=s;){let e=f(new Date(l));n.push({...e,otherMonth:!1}),l.setDate(l.getDate()+1)}}else if(t===`weekly`){let t=s(i.value.calendar===`gregory`?`monday`:`saturday`),r=new Date(e.start),a=r.getDay()-t;a<0&&(a+=7),r.setDate(r.getDate()-a);for(let e=0;e<7;e++){let t=new Date(r);t.setDate(r.getDate()+e),n.push({...f(t),otherMonth:!1})}}else if(t===`3days`)for(let t=0;t<3;t++){let r=new Date(e.start);r.setDate(r.getDate()+t),n.push({...f(r),otherMonth:!1})}else n.push({...f(new Date(e.start)),otherMonth:!1});return n},m=(0,e.computed)(()=>{let e=n(i.value.locale),t=o.value,r=l.value,a=new Date(2025,0,12+r),s=new Intl.DateTimeFormat(`${e}-u-ca-${t}`,{weekday:`narrow`}),c=new Intl.DateTimeFormat(`${e}-u-ca-${t}`,{weekday:`long`});return Array.from({length:7},(e,t)=>{let n=new Date(a);return n.setDate(a.getDate()+t),{dayOfWeek:n.getDay(),label:s.format(n),fullName:c.format(n)}})}),h=e=>{let t=n(i.value.locale),r=o.value;return{sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6}[new Intl.DateTimeFormat(`${t}-u-ca-${r}`,{weekday:`long`}).format(e).toLowerCase()]??0},g=()=>{let e=new Date,t=c(e),n=new Date(e);for(n.setHours(0,0,0,0);c(n).day!==t.day||c(n).month!==t.month||c(n).year!==t.year;)n.setDate(n.getDate()-1);return n},_=e=>{let t=new Date(e);t.setHours(12,0,0,0);let n=c(t),r=n.month,i=n.year;for(;n.day!==1;)t.setDate(t.getDate()-1),n=c(t);let a=new Date(t);for(;;){a.setDate(a.getDate()+1);let e=c(a);if(e.month!==r||e.year!==i){a.setDate(a.getDate()-1);break}}return a.setHours(23,59,59,999),{start:t,end:a}},v=e=>{let t=new Date(e);return t.setHours(0,0,0,0),t.setMilliseconds(0),t},y=()=>i.value.calendar===`gregory`?1:6,b=e=>{let t=g();if(e===`daily`||e===`3days`)return v(t);if(e===`weekly`){let e=y(),n=t.getDay()-e;n<0&&(n+=7);let r=new Date(t);return r.setDate(r.getDate()-n),v(r)}c(t);let n=v(t);for(n.setHours(12,0,0,0);c(n).day!==1;)n.setDate(n.getDate()-1);return v(n)},x=(e,t)=>{let r=n(e),i=t===`jalaali`?`persian`:t===`islamic`?`islamic-civil`:`gregory`,a=c(new Date).year,o=C(1,a),s=[];for(let e=1;e<=12;e++){let t=C(e,a,o);o=new Date(t);let n=new Intl.DateTimeFormat(`${r}-u-ca-${i}`,{month:`long`}).format(t);s.push({value:e,label:n,shortLabel:n})}return s},S=(e=new Date)=>{let t=c(e);return{month:t.month,year:t.year}},C=(e,t,n)=>{let r=n?new Date(n):new Date;r.setHours(12,0,0,0);let i=c(r),a=1e3,o=0;for(;(i.year!==t||i.month!==e)&&o<a;)i.year<t||i.year===t&&i.month<e?r.setDate(r.getDate()+1):r.setDate(r.getDate()-1),i=c(r),o++;for(;i.day!==1&&o<a;)r.setDate(r.getDate()-1),i=c(r),o++;return r.setHours(0,0,0,0),r};return{getCalendarHeaders:p,getDayDetails:f,offsetPeriod:(e,t,n)=>{let r=new Date(e);if(t===`daily`)r.setDate(r.getDate()+n);else if(t===`3days`)r.setDate(r.getDate()+n*3);else if(t===`weekly`)r.setDate(r.getDate()+n*7);else{let e=c(r),t=e.month+n,i=e.year;return t<1&&(t+=12,i--),t>12&&(t-=12,i++),v(C(t,i))}return v(r)},getMonthBounds:_,getWeekDayNames:m,getParts:c,resetToToday:b,getTodayInActiveCalendar:g,getCurrentPeriodStart:e=>b(e),getCurrentMonthYear:S,getDayOfWeekIndex:h,getMonthNames:x,getFirstDayOfMonthInActiveCalendar:C}},a=(0,e.defineComponent)({name:`CalendarDayBadge`,props:{day:{type:Object,required:!0}},setup(t){return{getDayItemColor:(0,e.computed)(()=>{let e=t.day,n=`border-outline-variant bg-surface`,r=`text-on-surface/50`;return e.isToday&&(n=`bg-today border-outline-variant/0`,r=`text-surface`),(e.isWeekend||e.isHoliday)&&(r=`text-error`),{fill:n,text:r}}),getFont:(e,t)=>{if(String(t.gregorian)===t[e])return`font-latin`}}}}),o=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},s={class:`flex flex-col items-center`};function c(t,n,r,i,a,o){return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,s,[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`w-7 h-7 sm:w-8 sm:h-8 md:w-9 md:h-9 select-none border flex flex-col justify-center items-center rounded-full`,[t.getDayItemColor.fill,t.getDayItemColor.text]])},[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([[t.getFont(`tertiary`,t.day)],`leading-none opacity-70 text-[6px] sm:text-[7px] md:text-[8px]`])},(0,e.toDisplayString)(t.day.tertiary),3),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([[t.getFont(`primary`,t.day)],`leading-tight text-[11px] sm:text-xs md:text-label-md font-medium`])},(0,e.toDisplayString)(t.day.primary),3),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([[t.getFont(`secondary`,t.day)],`leading-none opacity-70 text-[6px] sm:text-[7px] md:text-[8px]`])},(0,e.toDisplayString)(t.day.secondary),3)],2)])}var l=o(a,[[`render`,c]]),u=(0,e.defineComponent)({name:`CalendarHeaderItem`,components:{CalendarDayBadge:l},props:{days:{type:Array,default:()=>[]},mode:{type:String,default:`monthly`},todayColumnIndex:{type:Number,default:-1}},setup(t){return{itemWidths:(0,e.computed)(()=>`${100/(t.days.length+(t.mode===`monthly`?0:1))}%`)}}}),d={key:0,class:`border shrink-0 w-8 sm:w-9 md:w-25 min-w-8 sm:min-w-9 md:min-w-25 max-w-8 sm:max-w-9 md:max-w-25 border-outline-variant`},f={class:`select-none text-on-surface/50 text-[9px] sm:text-[10px] md:text-label-md truncate max-w-full text-center px-0.5`},p={class:`sm:hidden`},m={class:`hidden sm:inline`};function h(t,n,r,i,a,o){let s=(0,e.resolveComponent)(`CalendarDayBadge`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`cal-header-row w-full items-stretch flex justify-between`,{"ltr:border-l rtl:border-r border-outline-variant":t.mode===`monthly`}])},[t.mode===`monthly`?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,d)),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.days,(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`border-y rtl:border-l ltr:border-r border-outline-variant py-1.5 sm:py-2 md:py-4 flex-col flex-1 min-w-0 gap-y-1 sm:gap-y-1.5 md:gap-y-2.5 flex items-center justify-center transition-colors`,{"bg-today-column":r===t.todayColumnIndex}]),key:n.name+r},[t.mode===`monthly`?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createBlock)(s,{key:0,day:n},null,8,[`day`])),(0,e.createElementVNode)(`div`,f,[(0,e.createElementVNode)(`span`,p,(0,e.toDisplayString)(n.shortName||n.name),1),(0,e.createElementVNode)(`span`,m,(0,e.toDisplayString)(n.name),1)])],2))),128))],2)}var g=o(u,[[`render`,h],[`__scopeId`,`data-v-ef2978fb`]]),_=(0,e.defineComponent)({name:`CalendarSideItem`,props:{range:{type:Object,required:!0}},setup(n){let{t:i,config:a}=r(),{width:o}=t(),s=(0,e.computed)(()=>o.value<768),c=(0,e.computed)(()=>new Intl.NumberFormat(a.value.locale.startsWith(`fa`)?`fa-IR`:`en-US`)),l=(0,e.computed)(()=>`${100/u.value.length}%`),u=(0,e.computed)(()=>{let e=[],{start:t,end:r}=n.range;for(let n=t;n<r;n++)if(s.value)e.push({raw:n,label:c.value.format(n)});else{let t=``;t=n>=1&&n<=11?`morning`:n===12?`noon`:n>=13&&n<19?`afternoon`:`night`;let r=n;n>12&&(r=n-12),n===0&&(r=12),e.push({raw:n,label:`${c.value.format(r)} ${i(`calendar.dayTimes.${t}`)}`})}return e});return{hoursList:u,itemHeights:l}}}),v={class:`w-8 sm:w-9 md:w-25 min-h-full flex flex-col ltr:border-r ltr:border-r-outline-variant rtl:border-l border-l-outline-variant`};function y(t,n,r,i,a,o){return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,v,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.hoursList,n=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:n.raw,style:(0,e.normalizeStyle)({height:t.itemHeights}),class:`flex items-center text-center justify-center text-[10px] sm:text-xs md:text-label-md text-on-surface/50 border-b min-h-20 border-b-outline-variant select-none`},(0,e.toDisplayString)(n.label),5))),128))])}var b=o(_,[[`render`,y]]),x=(0,e.defineComponent)({name:`CalendarPattern`,setup(){return{getX:e=>-50+(e-1)*25}}}),S={width:`100%`,height:`120%`,viewBox:`0 0 440 221`,preserveAspectRatio:`xMidYMid slice`,class:`text-surface-variant`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},C=[`x`,`transform`];function w(t,n,r,i,a,o){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,S,[((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(25,n=>(0,e.createElementVNode)(`rect`,{key:n,x:t.getX(n),y:`220.895`,width:`300`,height:`12`,transform:`rotate(-115 ${t.getX(n)} 220.895)`,fill:`currentColor`},null,8,C)),64))])}var T=o(x,[[`render`,w]]),E={"--cal-primary":{light:{r:26,g:157,b:144},dark:{r:64,g:184,b:172}},"--color-primary":{light:{r:26,g:157,b:144},dark:{r:64,g:184,b:172}},"--cal-surface":{light:{r:255,g:255,b:255},dark:{r:21,g:24,b:35}},"--color-surface":{light:{r:255,g:255,b:255},dark:{r:21,g:24,b:35}},"--cal-on-surface":{light:{r:44,g:44,b:46},dark:{r:255,g:255,b:255}},"--color-on-surface":{light:{r:44,g:44,b:46},dark:{r:255,g:255,b:255}},"--cal-error":{light:{r:229,g:43,b:22},dark:{r:234,g:85,b:69}},"--color-error":{light:{r:229,g:43,b:22},dark:{r:234,g:85,b:69}}};function D(e){if(!e||typeof e!=`string`)return null;let t=e.trim().toLowerCase();if(t.startsWith(`var(`)){let e=t.match(/var\(\s*([^,\s)]+)/),n=e?e[1]:``;if(typeof document<`u`&&n)try{let e=getComputedStyle(document.documentElement).getPropertyValue(n).trim();if(e){let t=D(e);if(t)return t}}catch{}let r=t.match(/var\([^,]+,\s*([^)]+)\)/);if(r&&r[1]){let e=D(r[1].trim());if(e)return e}return n&&E[n]?typeof document<`u`&&document.documentElement.classList.contains(`dark`)?E[n].dark:E[n].light:{r:26,g:157,b:144}}if(t.startsWith(`#`)){let e=t.slice(1);if(e.length===3||e.length===4){let t=e[0]||`0`,n=e[1]||`0`,r=e[2]||`0`,i=parseInt(t+t,16),a=parseInt(n+n,16),o=parseInt(r+r,16);if(!Number.isNaN(i)&&!Number.isNaN(a)&&!Number.isNaN(o))return{r:i,g:a,b:o}}else if(e.length===6||e.length===8){let t=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),r=parseInt(e.slice(4,6),16);if(!Number.isNaN(t)&&!Number.isNaN(n)&&!Number.isNaN(r))return{r:t,g:n,b:r}}return null}if(t.startsWith(`rgb`)){let e=t.match(/\(([^)]+)\)/);if(e&&e[1]){let t=e[1].split(/[\s,/]+/).filter(Boolean),n=t[0],r=t[1],i=t[2];if(n!==void 0&&r!==void 0&&i!==void 0){let e=n.endsWith(`%`)?parseFloat(n)/100*255:parseFloat(n),t=r.endsWith(`%`)?parseFloat(r)/100*255:parseFloat(r),a=i.endsWith(`%`)?parseFloat(i)/100*255:parseFloat(i);if(!Number.isNaN(e)&&!Number.isNaN(t)&&!Number.isNaN(a))return{r:Math.min(255,Math.max(0,Math.round(e))),g:Math.min(255,Math.max(0,Math.round(t))),b:Math.min(255,Math.max(0,Math.round(a)))}}}return null}if(t.startsWith(`hsl`)){let e=t.match(/\(([^)]+)\)/);if(e&&e[1]){let t=e[1].split(/[\s,/]+/).filter(Boolean),n=t[0],r=t[1],i=t[2];if(n!==void 0&&r!==void 0&&i!==void 0){let e=parseFloat(n),t=parseFloat(r)/100,a=parseFloat(i)/100;if(!Number.isNaN(e)&&!Number.isNaN(t)&&!Number.isNaN(a))return O(e,t,a)}}return null}let n={white:{r:255,g:255,b:255},black:{r:0,g:0,b:0},transparent:{r:255,g:255,b:255},red:{r:255,g:0,b:0},green:{r:0,g:128,b:0},blue:{r:0,g:0,b:255},yellow:{r:255,g:255,b:0},orange:{r:255,g:165,b:0},purple:{r:128,g:0,b:128},teal:{r:0,g:128,b:128},gray:{r:128,g:128,b:128},grey:{r:128,g:128,b:128}};return n[t]?n[t]:null}function O(e,t,n){let r=(e%360+360)%360,i=(1-Math.abs(2*n-1))*t,a=i*(1-Math.abs(r/60%2-1)),o=n-i/2,s=0,c=0,l=0;return r>=0&&r<60?(s=i,c=a):r>=60&&r<120?(s=a,c=i):r>=120&&r<180?(c=i,l=a):r>=180&&r<240?(c=a,l=i):r>=240&&r<300?(s=a,l=i):(s=i,l=a),{r:Math.round((s+o)*255),g:Math.round((c+o)*255),b:Math.round((l+o)*255)}}function k(e,t,n){let r=e=>{let t=Math.max(0,Math.min(255,e))/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},i=r(e),a=r(t),o=r(n);return .2126*i+.7152*a+.0722*o}function A(e,t){let n=typeof e==`string`?D(e)??{r:0,g:0,b:0}:e,r=typeof t==`string`?D(t)??{r:255,g:255,b:255}:t,i=k(n.r,n.g,n.b),a=k(r.r,r.g,r.b),o=Math.max(i,a),s=Math.min(i,a);return(o+.05)/(s+.05)}function j(e,t){let n=t?.darkColor??`#0f172a`,r=t?.lightColor??`#ffffff`;if(!e)return r;let i=D(e)??{r:26,g:157,b:144},a=D(n)??{r:15,g:23,b:42},o=D(r)??{r:255,g:255,b:255},s=k(i.r,i.g,i.b),c=k(a.r,a.g,a.b),l=k(o.r,o.g,o.b),u=(Math.max(s,c)+.05)/(Math.min(s,c)+.05);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)>=u?r:n}var M=(0,e.defineComponent)({__name:`CalendarItemDisplay`,props:{event:{},mode:{},headers:{},hours:{},position:{},isMobile:{type:Boolean},overlapIndex:{},overlapCount:{}},emits:[`event-click`],setup(t){let n=t,r=(0,e.computed)(()=>n.event.color||`var(--cal-primary)`),i=(0,e.computed)(()=>j(r.value)),a=(0,e.computed)(()=>{if(n.mode===`monthly`)return{zIndex:10,position:`relative`};if(n.position===`static`)return{width:`100%`,height:`36px`,position:`relative`};if(!n.headers?.length||!n.hours)return{display:`none`};let e=new Date(n.event.date).toLocaleDateString(`en-CA`),t=n.headers.findIndex(t=>new Date(t.date).toLocaleDateString(`en-CA`)===e);if(t===-1||n.hours.end-n.hours.start<=0)return{display:`none`};let r=n.event.time.split(`:`).map(Number),i=(r[0]??0)+(r[1]??0)/60,a=(i-n.hours.start)*80,o=100/n.headers.length,s=n.overlapCount??1,c=n.overlapIndex??0,l=o/s,u,d;if(n.event.duration&&n.event.duration>0){let e=Math.min(i+n.event.duration/60,n.hours.end);u=`${Math.max(0,e-i)*80}px`,d=`20px`}else u=n.isMobile&&n.mode===`weekly`?`16px`:`36px`;return{top:`${a}px`,insetInlineStart:`${t*o+c*l}%`,width:`${l}%`,height:u,minHeight:d,zIndex:10,boxSizing:`border-box`}}),o=(0,e.computed)(()=>({backgroundColor:r.value,color:i.value})),s=(0,e.computed)(()=>{let e=r.value,t=i.value;return n.mode===`monthly`?{backgroundColor:e,color:t,opacity:.9,borderLeft:`4px solid ${e}`}:{backgroundColor:e,color:t}});return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{id:`event-display`,style:(0,e.normalizeStyle)(a.value),class:(0,e.normalizeClass)([t.position===`static`?``:`absolute`,t.mode===`monthly`?``:t.isMobile&&t.mode===`weekly`?`px-0.5`:`px-1 sm:px-2`]),onClick:r[0]||=(0,e.withModifiers)(e=>n.$emit(`event-click`,t.event,e),[`stop`])},[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`flex whitespace-normal items-center rounded cursor-pointer transition-transform text-[10px] sm:text-[11px] leading-tight overflow-hidden`,t.mode===`monthly`?`px-2 relative mb-1 h-6 shrink-0 whitespace-nowrap text-ellipsis w-[calc(100%-16px)]`:t.isMobile&&t.mode===`weekly`?`absolute px-1 h-full w-[calc(100%-4px)] text-[9px] leading-none`:`absolute px-2 sm:px-4 h-full w-[calc(100%-8px)] sm:w-[calc(100%-16px)] sm:rounded-md`]),style:(0,e.normalizeStyle)(s.value)},[(0,e.renderSlot)(n.$slots,`event`,{event:t.event,mode:t.mode},()=>[(0,e.createElementVNode)(`div`,{style:(0,e.normalizeStyle)(o.value),class:`w-full h-full relative z-10 flex items-center gap-x-1 truncate font-medium`},(0,e.toDisplayString)(t.event.title),5)])],6)],6))}}),ee=(0,e.defineComponent)({name:`CalendarDayHolder`,props:{day:{type:Object,required:!0},otherMonth:{type:Boolean,default:!1},events:{type:Array,default:()=>[]}},components:{CalendarDayBadge:l,CalendarPattern:T,CalendarItemDisplay:M},emits:[`open-day`,`event-click`],setup(t,{emit:n}){let{t:i}=r();return{t:i,displayedEvents:(0,e.computed)(()=>t.events.slice(0,2)),openDay:()=>{n(`open-day`,t.day)},remainingCount:(0,e.computed)(()=>t.events.length-2)}}}),te={class:`relative top-0 left-0 w-full h-full p-4 flex flex-col`},ne={key:0,class:`shrink-0`},N={id:`holder`,class:`w-full flex-1 relative flex flex-col gap-y-1.5 mt-2`},P={class:`w-full h-full pointer-events-none absolute top-0 left-0`};function F(t,n,r,i,a,o){let s=(0,e.resolveComponent)(`CalendarDayBadge`),c=(0,e.resolveComponent)(`CalendarItemDisplay`),l=(0,e.resolveComponent)(`CalendarPattern`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`border border-outline-variant/50 w-full relative h-full transition-colors`,[t.otherMonth?`overflow-hidden`:`overflow-visible`,t.day.isToday&&!t.otherMonth?`bg-today-column`:``]])},[(0,e.createElementVNode)(`div`,te,[t.otherMonth?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,ne,[(0,e.createVNode)(s,{day:t.day},null,8,[`day`])])),(0,e.createElementVNode)(`div`,N,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.displayedEvents,r=>((0,e.openBlock)(),(0,e.createBlock)(c,{key:r.id,position:`static`,event:r,onEventClick:n[0]||=e=>t.$emit(`event-click`,e)},{event:(0,e.withCtx)(n=>[(0,e.renderSlot)(t.$slots,`event`,(0,e.mergeProps)({ref_for:!0},n))]),_:3},8,[`event`]))),128)),t.remainingCount>0?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,onClick:n[1]||=(...e)=>t.openDay&&t.openDay(...e),class:`w-full relative z-0 h-9 px-2 flex cursor-pointer items-center rounded-lg bg-surface-variant text-label-sm text-on-surface select-none`},(0,e.toDisplayString)(t.t(`calendar.moreItems`,{count:t.remainingCount})),1)):(0,e.createCommentVNode)(``,!0)])]),(0,e.createElementVNode)(`div`,P,[t.otherMonth?((0,e.openBlock)(),(0,e.createBlock)(l,{key:0,class:`absolute inset-0 z-0 pointer-events-none`})):(0,e.createCommentVNode)(``,!0)])],2)}var I=o(ee,[[`render`,F]]),L=(0,e.defineComponent)({name:`CalendarPointer`,props:{mode:{type:String,required:!0},hours:{type:Object,required:!0},headers:{type:Array,required:!0}},setup(t){let n=(0,e.ref)(new Date),r;(0,e.onMounted)(()=>{r=setInterval(()=>{n.value=new Date},6e4)}),(0,e.onUnmounted)(()=>{r&&clearInterval(r)});let i=(0,e.computed)(()=>{if(!t.headers||t.headers.length===0)return{display:`none`};let e=t.headers.findIndex(e=>e.isToday);if(e===-1)return{display:`none`};let r=n.value,i=r.getHours()+r.getMinutes()/60;if(t.mode===`monthly`){let n=Math.ceil(t.headers.length/7),r=Math.floor(e/7),a=e%7,o=100/n,s=i/24*o;return{width:`${100/7}%`,top:`${r*o+s}%`,insetInlineStart:`${a/7*100}%`,transition:``}}if(i<t.hours.start||i>t.hours.end)return{display:`none`};let a=t.headers.length,o=t.hours.end-t.hours.start;return{width:`${100/a}%`,top:`${(i-t.hours.start)/o*100}%`,insetInlineStart:`${e/a*100}%`,transition:``}});return{pointerStyle:i,isVisible:(0,e.computed)(()=>i.value.display!==`none`)}}});function R(t,n,r,i,a,o){return(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`absolute z-20 pointer-events-none -translate-y-1/2 flex items-center`,style:(0,e.normalizeStyle)(t.pointerStyle)},[...n[0]||=[(0,e.createElementVNode)(`div`,{class:`w-2.5 aspect-square rounded-full bg-error shrink-0`},null,-1),(0,e.createElementVNode)(`div`,{class:`h-0.5 flex-1 bg-error`},null,-1)]],4)),[[e.vShow,t.isVisible]])}var z=o(L,[[`render`,R]]),B=(0,e.defineComponent)({name:`MobileDayHolder`,props:{day:{type:Object,required:!0},isSelected:{type:Boolean,default:!1},events:{type:Array,default:()=>[]},expandProgress:{type:Number,default:0},isDragging:{type:Boolean,default:!1}},emits:[`select`],setup(t,{emit:n}){return{canSelect:(0,e.computed)(()=>t.events.length>0),displayedEvents:(0,e.computed)(()=>t.events.slice(0,4)),selectDay:()=>{n(`select`,t.day)},styles:(0,e.computed)(()=>t.isSelected?{border:`border-transparent`,bg:`opacity-100`,text:`text-surface`}:t.day.isToday?{border:`border-primary`,bg:`opacity-0`,text:`text-primary`}:{border:`border-transparent`,bg:`opacity-0`,text:`text-on-surface/50`})}}}),V={class:`w-full h-full absolute inset-0 left-0 top-0 flex items-center justify-center`},H={class:`w-full flex-1 relative flex justify-center`};function U(t,n,r,i,a,o){return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,{onClick:n[0]||=(...e)=>t.selectDay&&t.selectDay(...e),class:(0,e.normalizeClass)([`flex flex-col items-center justify-start gap-y-0.5 w-full overflow-hidden hw-accel-height`,[t.canSelect?`cursor-pointer`:`cursor-default`,t.isDragging?``:`transition-all duration-300 ease-out`]]),style:(0,e.normalizeStyle)({height:`${40+t.expandProgress*16}px`})},[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`relative w-8 h-8 shrink-0 rounded-full transition-all duration-200 ease-in-out aspect-square border`,t.styles.border])},[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`rounded-full w-full h-full transition-all duration-200 ease-in-out bg-on-surface`,t.styles.bg])},null,2),(0,e.createElementVNode)(`div`,V,[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`select-none text-label-md transition-all duration-200 ease-in-out`,t.styles.text])},(0,e.toDisplayString)(t.day.primary),3)])],2),(0,e.createElementVNode)(`div`,H,[t.canSelect?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:(0,e.normalizeClass)([`rounded-full aspect-square w-1.5 bg-error absolute hw-accel`,[t.isDragging?``:`transition-all duration-300 ease-out`]]),style:(0,e.normalizeStyle)({opacity:Math.max(0,1-t.expandProgress*2),transform:`scale(${Math.max(0,1-t.expandProgress*2)})`})},null,6)):(0,e.createCommentVNode)(``,!0),t.canSelect?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:1,class:(0,e.normalizeClass)([`w-full flex flex-col gap-y-px absolute top-0 px-0.5 hw-accel`,[t.isDragging?``:`transition-all duration-300 ease-out`]]),style:(0,e.normalizeStyle)({opacity:t.expandProgress,transform:`translateY(${(1-t.expandProgress)*6}px)`})},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.displayedEvents,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t.id,class:`w-full rounded-full shrink-0 min-h-1`,style:(0,e.normalizeStyle)({backgroundColor:t.color||`var(--cal-primary)`})},null,4))),128))],6)):(0,e.createCommentVNode)(``,!0)])],6)}var W=o(B,[[`render`,U],[`__scopeId`,`data-v-d90e616f`]]),G={class:`flex flex-col gap-y-1 p-3 flex-1`},K={class:`text-label-md font-semibold text-on-surface`},q={class:`text-body-sm text-on-surface/60`},J=(0,e.defineComponent)({__name:`MobileEventListItem`,props:{event:{}},emits:[`event-click`],setup(t){return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`bg-surface-variant flex flex-col rounded-lg border cursor-pointer`,onClick:r[0]||=(0,e.withModifiers)(e=>n.$emit(`event-click`,t.event,e),[`stop`])},[(0,e.createElementVNode)(`div`,G,[(0,e.renderSlot)(n.$slots,`event`,{event:t.event},()=>[(0,e.createElementVNode)(`div`,K,(0,e.toDisplayString)(t.event.title),1),(0,e.createElementVNode)(`div`,q,(0,e.toDisplayString)(t.event.time),1)])]),(0,e.createElementVNode)(`div`,{class:`w-full h-1 shrink-0 rounded-b-full rounded-t-none`,style:(0,e.normalizeStyle)({backgroundColor:t.event.color||`#3b82f6`})},null,4)]))}}),Y=(0,e.defineComponent)({name:`MobileCalendarGrid`,components:{MobileDayHolder:W,MobileEventListItem:J},props:{days:{type:Array,default:()=>[]},eventsByDay:{type:Object,required:!0},loading:{type:Boolean,default:!1}},emits:[`event-click`],setup(t){let{getWeekDayNames:n}=i(),r=(0,e.computed)(()=>n.value),a=(0,e.ref)(!1),o=(0,e.ref)([]),s=(0,e.ref)(``),c=e=>{let n=new Date(e.date).toDateString();s.value=n;let r=t.eventsByDay.get(n);r&&r.length>0?(o.value=[...r],a.value=!0):a.value=!1};(0,e.onMounted)(()=>{let e=new Date().toDateString();s.value=e;let n=t.eventsByDay.get(e);n&&n.length>0&&(o.value=[...n],a.value=!0)});let l=e=>s.value===new Date(e.date).toDateString(),u=(0,e.ref)(0),d=(0,e.ref)(!1),f=0,p=0,m=!1;function h(e){f=e,p=u.value,d.value=!0}function g(e){if(!d.value)return;let t=e-f;m||=(requestAnimationFrame(()=>{let e=p+t/120;u.value=Math.max(0,Math.min(1,e)),m=!1}),!0)}function _(){d.value=!1,u.value>.25&&p===0?u.value=1:u.value<.75&&p===1?u.value=0:u.value=p}let v=e=>{h(e.touches[0]?.clientY??0)},y=e=>{let t=e.touches[0];t&&g(t.clientY)},b=()=>{_()},x=e=>{h(e.clientY),document.addEventListener(`mousemove`,S),document.addEventListener(`mouseup`,C)},S=e=>{g(e.clientY)},C=()=>{_(),document.removeEventListener(`mousemove`,S),document.removeEventListener(`mouseup`,C)};return{isDaySelected:l,weekDays:r,selectDay:c,handleMouseDown:x,handleMouseLeave:()=>{d.value&&(_(),document.removeEventListener(`mousemove`,S),document.removeEventListener(`mouseup`,C))},selectedDate:s,showEventsList:a,progress:u,isDragging:d,handleTouchStart:v,handleTouchMove:y,handleTouchEnd:b,eventsList:o}}}),X={class:`w-full pt-6 px-4 relative flex flex-col flex-1 overflow-y-auto`},Z={class:`select-none text-[10px] text-on-surface/50 w-full flex items-center justify-between`},re={class:`font-medium`},ie={class:`w-full mt-4 grid grid-cols-7 gap-x-5 gap-y-4`},ae={key:0,class:`transition-all duration-200 ease-in-out overflow-hidden w-full mt-4 flex-1 overflow-y-auto`},oe={class:`py-2 text-on-surface text-title-sm font-bold select-none border-b border-outline-variant mb-2`},se={class:`w-full flex flex-col gap-y-2`};function ce(t,n,r,i,a,o){let s=(0,e.resolveComponent)(`MobileDayHolder`),c=(0,e.resolveComponent)(`MobileEventListItem`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,X,[n[6]||=(0,e.createElementVNode)(`div`,{class:`w-full fixed right-0 -translate-y-6 pointer-events-none z-50 h-6 bg-gradient-to-b from-surface to-transparent`},null,-1),(0,e.createElementVNode)(`div`,{id:`mobile-grid`,class:`w-full shrink-0 select-none`,style:{"touch-action":`pan-x`,"user-select":`none`},onTouchstart:n[0]||=(0,e.withModifiers)((...e)=>t.handleTouchStart&&t.handleTouchStart(...e),[`prevent`]),onTouchmove:n[1]||=(0,e.withModifiers)((...e)=>t.handleTouchMove&&t.handleTouchMove(...e),[`prevent`]),onTouchend:n[2]||=(...e)=>t.handleTouchEnd&&t.handleTouchEnd(...e),onMousedown:n[3]||=(0,e.withModifiers)((...e)=>t.handleMouseDown&&t.handleMouseDown(...e),[`prevent`]),onMouseleave:n[4]||=(...e)=>t.handleMouseLeave&&t.handleMouseLeave(...e)},[(0,e.createElementVNode)(`div`,Z,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.weekDays,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`aspect-square w-8 shrink-0 flex items-center justify-center`,key:t.dayOfWeek},[(0,e.createElementVNode)(`div`,re,(0,e.toDisplayString)(t.label),1)]))),128))]),(0,e.createElementVNode)(`div`,ie,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.days,(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:r,class:(0,e.normalizeClass)([`transition-all duration-200 rounded-lg`,n.otherMonth?`opacity-0 pointer-events-none`:`opacity-100`,n.isToday&&!n.otherMonth?`bg-today-column`:``])},[(0,e.createVNode)(s,{"is-selected":t.isDaySelected(n),"expand-progress":t.progress,"is-dragging":t.isDragging,onSelect:t.selectDay,day:n,events:t.eventsByDay.get(new Date(n.date).toDateString())||[]},null,8,[`is-selected`,`expand-progress`,`is-dragging`,`onSelect`,`day`,`events`])],2))),128))])],32),t.showEventsList?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,ae,[(0,e.createElementVNode)(`div`,oe,(0,e.toDisplayString)(t.selectedDate),1),(0,e.createElementVNode)(`div`,se,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.eventsList,r=>((0,e.openBlock)(),(0,e.createBlock)(c,{key:r.id,event:r,onEventClick:n[5]||=(e,n)=>t.$emit(`event-click`,e,n)},{event:(0,e.withCtx)(({event:n})=>[(0,e.renderSlot)(t.$slots,`event-mobile`,{event:n})]),_:2},1032,[`event`]))),128))])])):(0,e.createCommentVNode)(``,!0)])}var le=o(Y,[[`render`,ce]]),ue={class:`detail-wrapper-stub`},de=(0,e.defineComponent)({__name:`CalendarEventDetailWrapper`,emits:[`lock-scroll`],setup(t){return(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,ue))}}),fe=(0,e.defineComponent)({components:{MobileCalendarGrid:le,CalendarHeaderItem:g,CalendarSideItem:b,CalendarDayHolder:I,CalendarPointer:z,CalendarItemDisplay:M,CalendarEventDetailWrapper:de},props:{range:{type:Object,required:!0},mode:{type:String,default:`monthly`},hours:{type:Object,default:()=>({start:0,end:24})},events:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},dir:{type:String,default:``}},emits:[`update:mode`,`update:range`,`event-click`],setup(n,{emit:r}){let a=(0,e.computed)(()=>n.loading),{width:o}=t(),s=(0,e.computed)(()=>o.value<768),{getCalendarHeaders:c}=i(),l=(0,e.useTemplateRef)(`scrollContainer`),u=(0,e.computed)(()=>c(n.range,n.mode)),d=(0,e.computed)(()=>u.value),f=(0,e.computed)(()=>n.mode===`monthly`?d.value.slice(0,7):d.value),p=(0,e.computed)(()=>n.mode===`daily`||n.mode===`monthly`?-1:d.value.findIndex(e=>e.isToday)),m=(0,e.computed)(()=>{let e=new Map;return n.events.forEach(t=>{let n=new Date(t.date).toDateString();e.has(n)||e.set(n,[]),e.get(n)?.push(t)}),e}),h=(0,e.computed)(()=>{let e=new Map,t=u.value.filter(e=>!e.otherMonth),r=new Set(t.map(e=>new Date(e.date).toDateString()));return n.events.forEach(t=>{let n=new Date(t.date).toDateString();r.has(n)&&(e.has(n)||e.set(n,[]),e.get(n)?.push(t))}),e});function g(e){if(!e.duration||e.duration<=0)return[e];let t=e.time.split(`:`).map(Number),n=(t[0]??0)+(t[1]??0)/60;if(n+e.duration/60<=24)return[e];let r=[],i=new Date(e.date),a=0,o=n,s=e.duration;for(;s>0;){let t=Math.min(s,(24-o)*60),n=Math.floor(o),c=Math.round((o-n)*60);r.push({...e,id:`${e.id}_d${a}`,date:new Date(i.getTime()+a*864e5),time:`${String(n).padStart(2,`0`)}:${String(c).padStart(2,`0`)}`,duration:Math.round(t)}),s-=t,o=0,a++}return r}let _=(0,e.computed)(()=>{if(n.mode===`monthly`)return[];let e=new Set(d.value.map(e=>new Date(e.date).toLocaleDateString(`en-CA`)));return n.events.flatMap(g).filter(t=>{let n=new Date(t.date).toLocaleDateString(`en-CA`);return e.has(n)})}),v=(0,e.computed)(()=>{let e=[],t=[],r=new Map;for(let e of d.value)r.set(new Date(e.date).toLocaleDateString(`en-CA`),[]);for(let e of _.value)r.get(new Date(e.date).toLocaleDateString(`en-CA`))?.push(e);for(let[i,a]of r.entries()){if(!a.length)continue;let r=d.value.findIndex(e=>new Date(e.date).toLocaleDateString(`en-CA`)===i),o=a.map(e=>{let t=e.time.split(`:`).map(Number),n=(t[0]??0)+(t[1]??0)/60;return{event:e,start:n,end:e.duration?n+e.duration/60:n+.5,col:0}}).sort((e,t)=>e.start-t.start||t.end-e.end),s=[];for(let e of o){let t=s.findIndex(t=>t<=e.start);e.col=t===-1?s.length:t,s[e.col]=e.end}if(n.mode===`daily`)for(let t of o){let n=t.col;for(let e of o)e!==t&&e.start<t.end&&e.end>t.start&&(n=Math.max(n,e.col));e.push({event:t.event,overlapIndex:t.col,overlapCount:n+1})}else{for(let t of o){if(t.col>=2)continue;let n=t.col;for(let e of o)e!==t&&e.col<2&&e.start<t.end&&e.end>t.start&&(n=Math.max(n,e.col));e.push({event:t.event,overlapIndex:t.col,overlapCount:n+1})}let n=o.filter(e=>e.col>=2).sort((e,t)=>e.start-t.start),i=[];for(let e of n){let t=i[i.length-1];!t||e.start>=t.end?i.push({start:e.start,end:e.end,count:1}):(t.end=Math.max(t.end,e.end),t.count++)}for(let e of i){let n=o.filter(t=>t.col<2&&t.start<e.end&&t.end>e.start).reduce((e,t)=>Math.max(e,t.end),e.start);t.push({dayIndex:r,endDecimal:n,count:e.count})}}}return{events:e,overflows:t}}),y=(0,e.computed)(()=>v.value.events),b=(0,e.computed)(()=>v.value.overflows),x=(0,e.computed)(()=>{if(n.mode===`monthly`||_.value.length===0)return n.hours;let e=n.hours.start,t=n.hours.end;for(let n of _.value){let r=n.time.split(`:`).map(Number),i=(r[0]??0)+(r[1]??0)/60,a=n.duration?i+n.duration/60:i;e=Math.min(e,Math.floor(i)),t=Math.max(t,Math.ceil(a))}return{start:Math.max(0,e),end:Math.min(24,t)}}),S=(0,e.ref)(!1),C=e=>{S.value=e},w=e=>{let t=new Date(e.date);r(`update:range`,{start:new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0),end:new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59,999)}),r(`update:mode`,`daily`,t)},T=(0,e.ref)(!0);(0,e.watch)([s,()=>n.mode],()=>{T.value=s.value?n.mode!==`monthly`:!0},{immediate:!0});let E=(0,e.computed)(()=>{let e=[];for(let t=x.value.start;t<x.value.end;t++)e.push({raw:t});return e});return(0,e.watch)(()=>n.events,async()=>{if(n.mode===`monthly`||!l.value)return;await(0,e.nextTick)();let t=l.value,r=_.value.map(e=>parseInt(e.time.split(`:`)[0],10));if(r.length===0)return;r.sort((e,t)=>e-t);let i=((r[Math.floor(r.length/2)]??x.value.start)-x.value.start)*80-t.clientHeight/2+80/2;t.scrollTo({top:Math.max(0,i),behavior:`smooth`})},{deep:!0}),{isLoading:a,hoursList:E,effectiveHours:x,scrollContainer:l,headers:d,allHeaders:u,isMobile:s,displayedHeader:f,todayColumnIndex:p,monthlyEventsByDay:h,eventsByDay:m,gridEvents:y,overflowIndicators:b,scrollLocked:S,showMonthly:T,setLockScroll:C,openSpecificDay:w}}}),pe=[`dir`],me={ref:`scrollContainer`,class:`flex-1 w-full flex flex-col overflow-y-auto cal-scrollbar relative`},he={key:0,class:`sticky top-0 z-30 bg-surface shrink-0`},ge={class:`flex-1 w-full flex min-h-0`},_e={class:`flex-1 relative`},ve={class:`absolute inset-0 w-full flex flex-col pointer-events-none`},ye={class:`absolute inset-0 w-full flex pointer-events-none`},be={class:`relative min-h-full w-full`},xe=[`onClick`],Se={key:2,class:`w-full`};function Ce(t,n,r,i,a,o){let s=(0,e.resolveComponent)(`CalendarEventDetailWrapper`),c=(0,e.resolveComponent)(`CalendarHeaderItem`),l=(0,e.resolveComponent)(`CalendarSideItem`),u=(0,e.resolveComponent)(`CalendarPointer`),d=(0,e.resolveComponent)(`CalendarItemDisplay`),f=(0,e.resolveComponent)(`CalendarDayHolder`),p=(0,e.resolveComponent)(`MobileCalendarGrid`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`w-full h-full flex flex-col bg-surface whitespace-normal`,dir:t.dir},[(0,e.createVNode)(s,{onLockScroll:t.setLockScroll},null,8,[`onLockScroll`]),(0,e.createElementVNode)(`div`,me,[t.showMonthly?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,he,[(0,e.createVNode)(c,{class:`cal-header-row w-full border-b border-surface-variant`,mode:t.mode,days:t.displayedHeader,"today-column-index":t.todayColumnIndex},null,8,[`mode`,`days`,`today-column-index`])])):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`div`,ge,[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`shrink-0 transition-all duration-300`,[t.mode===`monthly`?`w-0 opacity-0 overflow-hidden`:`w-8 sm:w-9 md:w-25 opacity-100 h-full`]])},[(0,e.createVNode)(l,{class:`w-8 sm:w-9 md:w-25 min-h-full`,range:t.effectiveHours},null,8,[`range`])],2),(0,e.createElementVNode)(`div`,_e,[(0,e.createVNode)(e.Transition,{name:`calendar-view`,mode:`out-in`},{default:(0,e.withCtx)(()=>[t.mode===`monthly`?t.isMobile?t.mode===`monthly`&&t.isMobile?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Se,[(0,e.createVNode)(p,{loading:t.isLoading,days:t.headers,mode:t.mode,"events-by-day":t.monthlyEventsByDay,"is-other-month-func":e=>t.headers.find(t=>new Date(t.date).toDateString()===new Date(e).toDateString())?.otherMonth||!1,onEventClick:n[2]||=e=>t.$emit(`event-click`,e)},(0,e.createSlots)({_:2},[t.$slots[`event-mobile`]?{name:`event-mobile`,fn:(0,e.withCtx)(({event:n})=>[(0,e.renderSlot)(t.$slots,`event-mobile`,{event:n,mode:`monthly-mobile`},void 0,!0)]),key:`0`}:void 0]),1032,[`loading`,`days`,`mode`,`events-by-day`,`is-other-month-func`])])):(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:`month-${t.range?.start?.getTime()}`,class:`w-full grid grid-cols-7 auto-rows-[186px] overflow-hidden`},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.allHeaders,(r,i)=>((0,e.openBlock)(),(0,e.createBlock)(f,{key:i,day:r,"other-month":!!r.otherMonth,events:t.monthlyEventsByDay.get(new Date(r.date).toDateString())||[],onOpenDay:e=>t.openSpecificDay(r),onEventClick:n[1]||=e=>t.$emit(`event-click`,e)},(0,e.createSlots)({_:2},[t.$slots.event?{name:`event`,fn:(0,e.withCtx)(n=>[(0,e.renderSlot)(t.$slots,`event`,(0,e.mergeProps)({ref_for:!0},n),void 0,!0)]),key:`0`}:void 0]),1032,[`day`,`other-month`,`events`,`onOpenDay`]))),128))])):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:`time-${t.mode}-${t.range?.start?.getTime()}`,class:`w-full relative`,style:(0,e.normalizeStyle)({height:`${t.hoursList.length*80}px`})},[(0,e.createVNode)(u,{mode:t.mode,hours:t.effectiveHours,headers:t.headers},null,8,[`mode`,`hours`,`headers`]),(0,e.createElementVNode)(`div`,ve,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.effectiveHours.end-t.effectiveHours.start,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t,class:`w-full border-b border-surface-variant box-border h-20`}))),128))]),(0,e.createElementVNode)(`div`,ye,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.headers,(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`h-full ltr:border-r rtl:border-l border-outline-variant flex-1 transition-colors`,{"bg-today-column":r===t.todayColumnIndex}]),key:`v`+r},null,2))),128))]),(0,e.createElementVNode)(`div`,be,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.gridEvents,r=>((0,e.openBlock)(),(0,e.createBlock)(d,{key:r.event.id,event:r.event,mode:t.mode,headers:t.headers,hours:t.effectiveHours,isMobile:t.isMobile,"overlap-index":r.overlapIndex,"overlap-count":r.overlapCount,onEventClick:n[0]||=e=>t.$emit(`event-click`,e)},(0,e.createSlots)({_:2},[t.$slots.event?{name:`event`,fn:(0,e.withCtx)(n=>[(0,e.renderSlot)(t.$slots,`event`,(0,e.mergeProps)({ref_for:!0},n),void 0,!0)]),key:`0`}:void 0]),1032,[`event`,`mode`,`headers`,`hours`,`isMobile`,`overlap-index`,`overlap-count`]))),128)),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.overflowIndicators,(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:`of-${r}`,class:`absolute px-0.5 sm:px-1 z-20 pointer-events-auto`,style:(0,e.normalizeStyle)({top:`${(Math.min(n.endDecimal,t.effectiveHours.end)-t.effectiveHours.start)*80}px`,insetInlineStart:`${n.dayIndex*(100/t.headers.length)}%`,width:`${100/t.headers.length}%`})},[(0,e.createElementVNode)(`button`,{class:`w-full text-[8px] sm:text-[10px] leading-none rounded bg-surface-variant hover:bg-surface-variant/80 text-on-surface/70 px-1 sm:px-2 py-0.5 sm:py-1 truncate transition-colors`,onClick:e=>t.openSpecificDay(t.headers[n.dayIndex])},` +`+(0,e.toDisplayString)(n.count)+` more `,9,xe)],4))),128))])],4))]),_:3})])])],512)],8,pe)}var we=o(fe,[[`render`,Ce],[`__scopeId`,`data-v-6e2c33b4`]]),Te=[`dir`],Ee={ref:`scrollContainer`,class:`flex-1 w-full overflow-y-auto cal-scrollbar px-2 sm:px-4 md:px-6 py-3 sm:py-5`},De={class:`max-w-4xl mx-auto flex flex-col gap-6`},Oe={class:`agenda-section-header sticky top-0 z-10 py-1.5 flex items-center gap-3 bg-surface/95 backdrop-blur-xs`},ke={class:`rounded-full bg-surface-variant px-3 py-0.5 text-xs font-semibold text-on-surface/70 border border-outline-variant shadow-xs select-none`},Ae={class:`flex flex-col gap-3`},je={class:`agenda-date-col shrink-0 flex flex-col items-start w-24 sm:w-32 md:w-36 pt-0.5 select-none`},Me={class:`sm:hidden`},Ne={class:`hidden sm:inline`},Pe={class:`mt-1 flex items-center gap-1.5 sm:gap-2`},Fe={class:`flex flex-col text-[10px] sm:text-xs leading-none text-on-surface/50 gap-0.5`},Q={key:0,class:`opacity-70`},Ie={key:0,class:`mt-1 text-[10px] font-medium text-error truncate max-w-full`},Le={class:`agenda-events-col flex-1 min-w-0 flex flex-col gap-2`},Re=[`onClick`],ze={class:`min-w-0 flex-1 font-semibold text-xs sm:text-sm md:text-base leading-snug truncate`},Be={key:0,class:`shrink-0 text-[11px] sm:text-xs md:text-sm font-medium opacity-90 flex items-center gap-1.5 whitespace-nowrap`},Ve={key:1,class:`agenda-no-events flex items-center text-xs text-on-surface/40 italic py-2 px-3 rounded-lg border border-dashed border-outline-variant select-none`},$=o((0,e.defineComponent)({__name:`CalendarAgenda`,props:{range:{},events:{default:()=>[]},dir:{default:``}},emits:[`event-click`],setup(t){let n=t,a=(0,e.inject)(`calendarConfig`,(0,e.ref)({locale:`fa-IR`,calendar:`jalaali`,startOfWeek:`saturday`,showHolidays:!1})),{t:o}=r(),{getCalendarHeaders:s}=i(),c=(0,e.computed)(()=>{let e=String(a.value.locale||``).toLowerCase();return e.startsWith(`fa`)||e.startsWith(`ar`)}),l=(0,e.computed)(()=>n.dir?n.dir:c.value?`rtl`:`ltr`);function u(e){if(!e||typeof e!=`string`)return 0;let t=e.split(`:`).map(Number),n=t[0]??0,r=t[1]??0;return Number.isNaN(n)||Number.isNaN(r)?0:n*60+r}let d=[`۰`,`۱`,`۲`,`۳`,`۴`,`۵`,`۶`,`۷`,`۸`,`۹`];function f(e){return c.value?e.replace(/\d/g,e=>d[parseInt(e,10)]??e):e}function p(e){if(e.isFullDay)return o(`calendar.allDay`)||(c.value?`تمام روز`:`All day`);if(!e.time)return``;if(!e.duration||e.duration<=0)return f(e.time);let t=u(e.time)+e.duration,n=Math.floor(t%1440/60),r=t%60,i=`${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`,a=f(e.time),s=f(i);return c.value?`${a} تا ${s}`:`${a} – ${s}`}function m(e){let t=e.color||`var(--cal-primary, #1a9d90)`;return{backgroundColor:t,color:j(t)}}let h=(0,e.computed)(()=>s(n.range,`agenda`));function g(e,t){if(!e.date)return!1;let n=new Date(t.date),r=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0).getTime(),i=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59,999).getTime(),a=new Date(e.date),o=u(e.time),s=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0).getTime()+o*60*1e3,c=s;return e.duration&&e.duration>0?c=s+e.duration*60*1e3:e.isFullDay&&(c=new Date(a.getFullYear(),a.getMonth(),a.getDate(),23,59,59,999).getTime()),s<=i&&c>=r}function _(e){return n.events.filter(t=>g(t,e)).sort((e,t)=>{if(e.isFullDay&&!t.isFullDay)return-1;if(!e.isFullDay&&t.isFullDay)return 1;let n=u(e.time),r=u(t.time);return n===r?String(e.title||``).localeCompare(String(t.title||``)):n-r})}function v(e,t){let n=c.value,r=n?`fa-IR`:`en-US`,i=a.value.calendar===`jalaali`?`persian`:a.value.calendar===`islamic`?`islamic-civil`:`gregory`,o=new Intl.DateTimeFormat(`${r}-u-ca-${i}`,{day:`numeric`,month:`short`,year:`numeric`}).formatToParts(e),s=new Intl.DateTimeFormat(`${r}-u-ca-${i}`,{day:`numeric`,month:`short`,year:`numeric`}).formatToParts(t),l=o.find(e=>e.type===`day`)?.value||``,u=o.find(e=>e.type===`month`)?.value||``,d=o.find(e=>e.type===`year`)?.value||``,f=s.find(e=>e.type===`day`)?.value||``,p=s.find(e=>e.type===`month`)?.value||``,m=s.find(e=>e.type===`year`)?.value||``;return d===m&&u===p?n?`${l} – ${f} ${u}`:`${u} ${l} – ${f}`:d===m?n?`${l} ${u} – ${f} ${p}`:`${u} ${l} – ${p} ${f}`:n?`${l} ${u} ${d} – ${f} ${p} ${m}`:`${u} ${l}, ${d} – ${p} ${f}, ${d}`}let y=(0,e.computed)(()=>{let e=h.value;if(!e.length)return[];let t=[];for(let n=0;n<e.length;n+=7){let r=e.slice(n,n+7),i=r[0]?.date||new Date,a=r[r.length-1]?.date||i;t.push({id:`section-${i.getTime()}-${a.getTime()}`,rangeLabel:v(i,a),days:r.map(e=>({day:e,events:_(e)}))})}return t});return(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`calendar-agenda w-full h-full flex flex-col bg-surface overflow-hidden`,dir:l.value},[(0,e.createElementVNode)(`div`,Ee,[(0,e.createElementVNode)(`div`,De,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(y.value,r=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:r.id,class:`agenda-section flex flex-col gap-3`},[(0,e.createElementVNode)(`div`,Oe,[n[0]||=(0,e.createElementVNode)(`div`,{class:`h-px flex-1 bg-outline-variant`},null,-1),(0,e.createElementVNode)(`span`,ke,(0,e.toDisplayString)(r.rangeLabel),1),n[1]||=(0,e.createElementVNode)(`div`,{class:`h-px flex-1 bg-outline-variant`},null,-1)]),(0,e.createElementVNode)(`div`,Ae,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(r.days,r=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:r.day.name+r.day.date.getTime(),class:(0,e.normalizeClass)([`agenda-day-row flex flex-row items-start gap-3 sm:gap-5 p-2.5 sm:p-3.5 rounded-xl border border-outline-variant/60 transition-colors`,{"bg-today-column ring-1 ring-primary/30 border-primary/40":r.day.isToday,"bg-surface":!r.day.isToday}])},[(0,e.createElementVNode)(`div`,je,[(0,e.createElementVNode)(`span`,{class:(0,e.normalizeClass)([`text-xs sm:text-sm font-semibold truncate max-w-full`,r.day.isToday?`text-primary font-bold`:`text-on-surface/80`])},[(0,e.createElementVNode)(`span`,Me,(0,e.toDisplayString)(r.day.shortName||r.day.name),1),(0,e.createElementVNode)(`span`,Ne,(0,e.toDisplayString)(r.day.name),1)],2),(0,e.createElementVNode)(`div`,Pe,[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`flex size-7 sm:size-8 items-center justify-center rounded-full text-xs sm:text-sm font-bold shadow-xs shrink-0`,[r.day.isToday?`bg-primary text-surface font-extrabold ring-2 ring-primary/30`:r.day.isWeekend||r.day.isHoliday?`bg-surface-variant text-error border border-outline-variant`:`bg-surface-variant text-on-surface border border-outline-variant`]])},(0,e.toDisplayString)(r.day.primary),3),(0,e.createElementVNode)(`div`,Fe,[(0,e.createElementVNode)(`span`,{class:(0,e.normalizeClass)({"text-error":r.day.isWeekend||r.day.isHoliday})},(0,e.toDisplayString)(r.day.secondary),3),r.day.tertiary?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,Q,(0,e.toDisplayString)(r.day.tertiary),1)):(0,e.createCommentVNode)(``,!0)])]),r.day.holidayTitle?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,Ie,(0,e.toDisplayString)(r.day.holidayTitle),1)):(0,e.createCommentVNode)(``,!0)]),(0,e.createElementVNode)(`div`,Le,[r.events.length>0?((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,{key:0},(0,e.renderList)(r.events,r=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:r.id,class:`agenda-event-card group flex items-center justify-between gap-3 rounded-lg sm:rounded-xl p-2.5 sm:px-4 sm:py-3 border border-black/10 dark:border-white/20 shadow-xs cursor-pointer transition-all hover:scale-[1.006] hover:shadow-md active:scale-[0.995]`,style:(0,e.normalizeStyle)(m(r)),onClick:e=>t.$emit(`event-click`,r)},[(0,e.renderSlot)(t.$slots,`event`,{event:r,mode:`agenda`},()=>[(0,e.createElementVNode)(`div`,ze,(0,e.toDisplayString)(r.title),1),r.time||r.isFullDay?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Be,[n[2]||=(0,e.createElementVNode)(`svg`,{class:`size-3 sm:size-3.5 opacity-80`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,e.createElementVNode)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.createElementVNode)(`polyline`,{points:`12 6 12 12 16 14`})],-1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(p(r)),1)])):(0,e.createCommentVNode)(``,!0)],!0)],12,Re))),128)):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Ve,(0,e.toDisplayString)((0,e.unref)(o)(`calendar.noEvents`)||`No events`),1))])],2))),128))])]))),128))])],512)],8,Te))}}),[[`__scopeId`,`data-v-71fb8cbf`]]),He={key:0,class:`w-full h-full flex flex-col font-sans`,style:{color:`var(--cal-on-surface)`,background:`var(--cal-surface)`}},Ue={class:`w-full flex-1 overflow-hidden relative`},We=(0,e.defineComponent)({__name:`VueCalendar`,props:{events:{default:()=>[]},mode:{default:`monthly`},locale:{default:`en-US`},calendarType:{default:`gregory`},startOfWeek:{},hours:{default:()=>({start:0,end:24})},initialDate:{default:()=>new Date}},emits:[`update:mode`,`range-change`,`event-click`],setup(t,{expose:n,emit:r}){let a=t,o=r,s=(0,e.ref)(!1),c=(0,e.ref)(new Date(a.initialDate)),l={gregory:`gregory`,persian:`jalaali`,"islamic-uma":`islamic`},u=[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`],d=(0,e.computed)(()=>a.startOfWeek!==void 0&&a.startOfWeek>=0&&a.startOfWeek<=6?a.startOfWeek:a.calendarType===`gregory`?1:6),f=(0,e.computed)(()=>({locale:a.locale,calendar:l[a.calendarType],startOfWeek:u[d.value]??`sunday`,showHolidays:!1}));(0,e.provide)(`calendarConfig`,f),(0,e.provide)(`calendarHolidays`,(0,e.ref)({}));let{getMonthBounds:p,offsetPeriod:m}=i(f),h=(0,e.computed)(()=>{let e=new Date(c.value),t=new Date(c.value);if(a.mode===`daily`)return e.setHours(0,0,0,0),t.setHours(23,59,59,999),{start:e,end:t};if(a.mode===`3days`)return e.setHours(0,0,0,0),t.setTime(e.getTime()),t.setDate(e.getDate()+2),t.setHours(23,59,59,999),{start:e,end:t};if(a.mode===`weekly`){let n=d.value,r=e.getDay(),i=(r<n?7:0)+r-n;return e.setDate(e.getDate()-i),e.setHours(0,0,0,0),t.setTime(e.getTime()),t.setDate(e.getDate()+6),t.setHours(23,59,59,999),{start:e,end:t}}else return p(c.value)}),g=()=>{c.value=m(c.value,a.mode,1),o(`range-change`,h.value)},_=()=>{c.value=m(c.value,a.mode,-1),o(`range-change`,h.value)},v=(e,t)=>{t&&(c.value=new Date(t)),o(`update:mode`,e,t)},y=(e,t)=>{t&&(c.value=new Date(t)),o(`update:mode`,e,t)};return(0,e.watch)(()=>a.initialDate,e=>{e&&(c.value=new Date(e),o(`range-change`,h.value))}),(0,e.watch)(h,e=>{s.value&&o(`range-change`,e)}),(0,e.onMounted)(()=>{s.value=!0,o(`range-change`,h.value)}),n({goNext:g,goPrev:_,setMode:y,currentRange:h,handleModeUpdate:v}),(n,r)=>s.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,He,[(0,e.renderSlot)(n.$slots,`header`,{mode:t.mode,range:h.value,next:g,prev:_,setMode:y}),(0,e.createElementVNode)(`div`,Ue,[t.mode===`agenda`?((0,e.openBlock)(),(0,e.createBlock)($,{key:0,range:h.value,events:t.events,onEventClick:r[0]||=e=>n.$emit(`event-click`,e)},(0,e.createSlots)({_:2},[n.$slots.event?{name:`event`,fn:(0,e.withCtx)(t=>[(0,e.renderSlot)(n.$slots,`event`,(0,e.normalizeProps)((0,e.guardReactiveProps)(t)))]),key:`0`}:void 0]),1032,[`range`,`events`])):((0,e.openBlock)(),(0,e.createBlock)(we,{key:1,range:h.value,mode:t.mode,events:t.events,hours:t.hours,"onUpdate:mode":r[1]||=(e,t)=>v(e,t),onEventClick:r[2]||=e=>n.$emit(`event-click`,e),"onUpdate:range":r[3]||=e=>n.$emit(`range-change`,e)},(0,e.createSlots)({_:2},[n.$slots.event?{name:`event`,fn:(0,e.withCtx)(t=>[(0,e.renderSlot)(n.$slots,`event`,(0,e.normalizeProps)((0,e.guardReactiveProps)(t)))]),key:`0`}:void 0,n.$slots[`event-mobile`]?{name:`event-mobile`,fn:(0,e.withCtx)(t=>[(0,e.renderSlot)(n.$slots,`event-mobile`,(0,e.normalizeProps)((0,e.guardReactiveProps)(t)))]),key:`1`}:void 0]),1032,[`range`,`mode`,`events`,`hours`]))])])):(0,e.createCommentVNode)(``,!0)}});exports.CalendarAgenda=$,exports.VueCalendar=We,exports.getAccessibleTextColor=j,exports.getContrastRatio=A,exports.getRelativeLuminance=k,exports.parseColorToRgb=D;
|
package/dist/index.js
CHANGED
|
@@ -344,21 +344,21 @@ var R = /* @__PURE__ */ L(ee, [["render", ne]]), re = l({
|
|
|
344
344
|
setup(e) {
|
|
345
345
|
return { itemWidths: n(() => `${100 / (e.days.length + (e.mode === "monthly" ? 0 : 1))}%`) };
|
|
346
346
|
}
|
|
347
|
-
}), ie = {
|
|
347
|
+
}), ie = {
|
|
348
348
|
key: 0,
|
|
349
349
|
class: "border shrink-0 w-8 sm:w-9 md:w-25 min-w-8 sm:min-w-9 md:min-w-25 max-w-8 sm:max-w-9 md:max-w-25 border-outline-variant"
|
|
350
|
-
},
|
|
351
|
-
function
|
|
350
|
+
}, ae = { class: "select-none text-on-surface/50 text-[9px] sm:text-[10px] md:text-label-md truncate max-w-full text-center px-0.5" }, oe = { class: "sm:hidden" }, se = { class: "hidden sm:inline" };
|
|
351
|
+
function z(t, n, s, c, l, u) {
|
|
352
352
|
let d = w("CalendarDayBadge");
|
|
353
|
-
return y(), a("div",
|
|
353
|
+
return y(), a("div", { class: m(["cal-header-row w-full items-stretch flex justify-between", { "ltr:border-l rtl:border-r border-outline-variant": t.mode === "monthly" }]) }, [t.mode === "monthly" ? i("", !0) : (y(), a("div", ie)), (y(!0), a(e, null, S(t.days, (e, n) => (y(), a("div", {
|
|
354
354
|
class: m(["border-y rtl:border-l ltr:border-r border-outline-variant py-1.5 sm:py-2 md:py-4 flex-col flex-1 min-w-0 gap-y-1 sm:gap-y-1.5 md:gap-y-2.5 flex items-center justify-center transition-colors", { "bg-today-column": n === t.todayColumnIndex }]),
|
|
355
355
|
key: e.name + n
|
|
356
356
|
}, [t.mode === "monthly" ? i("", !0) : (y(), r(d, {
|
|
357
357
|
key: 0,
|
|
358
358
|
day: e
|
|
359
|
-
}, null, 8, ["day"])), o("div",
|
|
359
|
+
}, null, 8, ["day"])), o("div", ae, [o("span", oe, T(e.shortName || e.name), 1), o("span", se, T(e.name), 1)])], 2))), 128))], 2);
|
|
360
360
|
}
|
|
361
|
-
var
|
|
361
|
+
var B = /* @__PURE__ */ L(re, [["render", z], ["__scopeId", "data-v-ef2978fb"]]), V = l({
|
|
362
362
|
name: "CalendarSideItem",
|
|
363
363
|
props: { range: {
|
|
364
364
|
type: Object,
|
|
@@ -387,20 +387,20 @@ var V = /* @__PURE__ */ L(re, [["render", B], ["__scopeId", "data-v-683574e2"]])
|
|
|
387
387
|
itemHeights: s
|
|
388
388
|
};
|
|
389
389
|
}
|
|
390
|
-
}),
|
|
391
|
-
function
|
|
392
|
-
return y(), a("div",
|
|
390
|
+
}), H = { class: "w-8 sm:w-9 md:w-25 min-h-full flex flex-col ltr:border-r ltr:border-r-outline-variant rtl:border-l border-l-outline-variant" };
|
|
391
|
+
function U(t, n, r, i, o, s) {
|
|
392
|
+
return y(), a("div", H, [(y(!0), a(e, null, S(t.hoursList, (e) => (y(), a("div", {
|
|
393
393
|
key: e.raw,
|
|
394
394
|
style: g({ height: t.itemHeights }),
|
|
395
395
|
class: "flex items-center text-center justify-center text-[10px] sm:text-xs md:text-label-md text-on-surface/50 border-b min-h-20 border-b-outline-variant select-none"
|
|
396
396
|
}, T(e.label), 5))), 128))]);
|
|
397
397
|
}
|
|
398
|
-
var
|
|
398
|
+
var W = /* @__PURE__ */ L(V, [["render", U]]), G = l({
|
|
399
399
|
name: "CalendarPattern",
|
|
400
400
|
setup() {
|
|
401
401
|
return { getX: (e) => -50 + (e - 1) * 25 };
|
|
402
402
|
}
|
|
403
|
-
}),
|
|
403
|
+
}), K = {
|
|
404
404
|
width: "100%",
|
|
405
405
|
height: "120%",
|
|
406
406
|
viewBox: "0 0 440 221",
|
|
@@ -408,9 +408,9 @@ var G = /* @__PURE__ */ L(H, [["render", W]]), K = l({
|
|
|
408
408
|
class: "text-surface-variant",
|
|
409
409
|
fill: "none",
|
|
410
410
|
xmlns: "http://www.w3.org/2000/svg"
|
|
411
|
-
},
|
|
412
|
-
function
|
|
413
|
-
return y(), a("svg",
|
|
411
|
+
}, ce = ["x", "transform"];
|
|
412
|
+
function le(t, n, r, i, s, c) {
|
|
413
|
+
return y(), a("svg", K, [(y(), a(e, null, S(25, (e) => o("rect", {
|
|
414
414
|
key: e,
|
|
415
415
|
x: t.getX(e),
|
|
416
416
|
y: "220.895",
|
|
@@ -418,9 +418,9 @@ function ue(t, n, r, i, s, c) {
|
|
|
418
418
|
height: "12",
|
|
419
419
|
transform: `rotate(-115 ${t.getX(e)} 220.895)`,
|
|
420
420
|
fill: "currentColor"
|
|
421
|
-
}, null, 8,
|
|
421
|
+
}, null, 8, ce)), 64))]);
|
|
422
422
|
}
|
|
423
|
-
var
|
|
423
|
+
var ue = /* @__PURE__ */ L(G, [["render", le]]), q = {
|
|
424
424
|
"--cal-primary": {
|
|
425
425
|
light: {
|
|
426
426
|
r: 26,
|
|
@@ -581,7 +581,7 @@ function J(e) {
|
|
|
581
581
|
let t = e[1].split(/[\s,/]+/).filter(Boolean), n = t[0], r = t[1], i = t[2];
|
|
582
582
|
if (n !== void 0 && r !== void 0 && i !== void 0) {
|
|
583
583
|
let e = parseFloat(n), t = parseFloat(r) / 100, a = parseFloat(i) / 100;
|
|
584
|
-
if (!Number.isNaN(e) && !Number.isNaN(t) && !Number.isNaN(a)) return
|
|
584
|
+
if (!Number.isNaN(e) && !Number.isNaN(t) && !Number.isNaN(a)) return de(e, t, a);
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
return null;
|
|
@@ -650,7 +650,7 @@ function J(e) {
|
|
|
650
650
|
};
|
|
651
651
|
return n[t] ? n[t] : null;
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function de(e, t, n) {
|
|
654
654
|
let r = (e % 360 + 360) % 360, i = (1 - Math.abs(2 * n - 1)) * t, a = i * (1 - Math.abs(r / 60 % 2 - 1)), o = n - i / 2, s = 0, c = 0, l = 0;
|
|
655
655
|
return r >= 0 && r < 60 ? (s = i, c = a) : r >= 60 && r < 120 ? (s = a, c = i) : r >= 120 && r < 180 ? (c = i, l = a) : r >= 180 && r < 240 ? (c = a, l = i) : r >= 240 && r < 300 ? (s = a, l = i) : (s = i, l = a), {
|
|
656
656
|
r: Math.round((s + o) * 255),
|
|
@@ -665,7 +665,7 @@ function Y(e, t, n) {
|
|
|
665
665
|
}, i = r(e), a = r(t), o = r(n);
|
|
666
666
|
return .2126 * i + .7152 * a + .0722 * o;
|
|
667
667
|
}
|
|
668
|
-
function
|
|
668
|
+
function fe(e, t) {
|
|
669
669
|
let n = typeof e == "string" ? J(e) ?? {
|
|
670
670
|
r: 0,
|
|
671
671
|
g: 0,
|
|
@@ -769,7 +769,7 @@ var Z = /* @__PURE__ */ l({
|
|
|
769
769
|
class: "w-full h-full relative z-10 flex items-center gap-x-1 truncate font-medium"
|
|
770
770
|
}, T(e.event.title), 5)])], 6)], 6));
|
|
771
771
|
}
|
|
772
|
-
}),
|
|
772
|
+
}), pe = l({
|
|
773
773
|
name: "CalendarDayHolder",
|
|
774
774
|
props: {
|
|
775
775
|
day: {
|
|
@@ -787,7 +787,7 @@ var Z = /* @__PURE__ */ l({
|
|
|
787
787
|
},
|
|
788
788
|
components: {
|
|
789
789
|
CalendarDayBadge: R,
|
|
790
|
-
CalendarPattern:
|
|
790
|
+
CalendarPattern: ue,
|
|
791
791
|
CalendarItemDisplay: Z
|
|
792
792
|
},
|
|
793
793
|
emits: ["open-day", "event-click"],
|
|
@@ -802,16 +802,16 @@ var Z = /* @__PURE__ */ l({
|
|
|
802
802
|
remainingCount: n(() => e.events.length - 2)
|
|
803
803
|
};
|
|
804
804
|
}
|
|
805
|
-
}),
|
|
805
|
+
}), me = { class: "relative top-0 left-0 w-full h-full p-4 flex flex-col" }, he = {
|
|
806
806
|
key: 0,
|
|
807
807
|
class: "shrink-0"
|
|
808
|
-
},
|
|
808
|
+
}, ge = {
|
|
809
809
|
id: "holder",
|
|
810
810
|
class: "w-full flex-1 relative flex flex-col gap-y-1.5 mt-2"
|
|
811
|
-
},
|
|
812
|
-
function
|
|
811
|
+
}, _e = { class: "w-full h-full pointer-events-none absolute top-0 left-0" };
|
|
812
|
+
function ve(t, n, s, l, u, d) {
|
|
813
813
|
let p = w("CalendarDayBadge"), h = w("CalendarItemDisplay"), g = w("CalendarPattern");
|
|
814
|
-
return y(), a("div", { class: m(["border border-outline-variant/50 w-full relative h-full transition-colors", [t.otherMonth ? "overflow-hidden" : "overflow-visible", t.day.isToday && !t.otherMonth ? "bg-today-column" : ""]]) }, [o("div",
|
|
814
|
+
return y(), a("div", { class: m(["border border-outline-variant/50 w-full relative h-full transition-colors", [t.otherMonth ? "overflow-hidden" : "overflow-visible", t.day.isToday && !t.otherMonth ? "bg-today-column" : ""]]) }, [o("div", me, [t.otherMonth ? i("", !0) : (y(), a("div", he, [c(p, { day: t.day }, null, 8, ["day"])])), o("div", ge, [(y(!0), a(e, null, S(t.displayedEvents, (e) => (y(), r(h, {
|
|
815
815
|
key: e.id,
|
|
816
816
|
position: "static",
|
|
817
817
|
event: e,
|
|
@@ -823,12 +823,12 @@ function ye(t, n, s, l, u, d) {
|
|
|
823
823
|
key: 0,
|
|
824
824
|
onClick: n[1] ||= (...e) => t.openDay && t.openDay(...e),
|
|
825
825
|
class: "w-full relative z-0 h-9 px-2 flex cursor-pointer items-center rounded-lg bg-surface-variant text-label-sm text-on-surface select-none"
|
|
826
|
-
}, T(t.t("calendar.moreItems", { count: t.remainingCount })), 1)) : i("", !0)])]), o("div",
|
|
826
|
+
}, T(t.t("calendar.moreItems", { count: t.remainingCount })), 1)) : i("", !0)])]), o("div", _e, [t.otherMonth ? (y(), r(g, {
|
|
827
827
|
key: 0,
|
|
828
828
|
class: "absolute inset-0 z-0 pointer-events-none"
|
|
829
829
|
})) : i("", !0)])], 2);
|
|
830
830
|
}
|
|
831
|
-
var
|
|
831
|
+
var ye = /* @__PURE__ */ L(pe, [["render", ve]]), be = l({
|
|
832
832
|
name: "CalendarPointer",
|
|
833
833
|
props: {
|
|
834
834
|
mode: {
|
|
@@ -884,13 +884,13 @@ var be = /* @__PURE__ */ L(me, [["render", ye]]), xe = l({
|
|
|
884
884
|
});
|
|
885
885
|
//#endregion
|
|
886
886
|
//#region src/components/CalendarPointer.vue
|
|
887
|
-
function
|
|
887
|
+
function xe(e, t, n, r, i, s) {
|
|
888
888
|
return j((y(), a("div", {
|
|
889
889
|
class: "absolute z-20 pointer-events-none -translate-y-1/2 flex items-center",
|
|
890
890
|
style: g(e.pointerStyle)
|
|
891
891
|
}, [...t[0] ||= [o("div", { class: "w-2.5 aspect-square rounded-full bg-error shrink-0" }, null, -1), o("div", { class: "h-0.5 flex-1 bg-error" }, null, -1)]], 4)), [[O, e.isVisible]]);
|
|
892
892
|
}
|
|
893
|
-
var
|
|
893
|
+
var Se = /* @__PURE__ */ L(be, [["render", xe]]), Ce = l({
|
|
894
894
|
name: "MobileDayHolder",
|
|
895
895
|
props: {
|
|
896
896
|
day: {
|
|
@@ -937,13 +937,13 @@ var Ce = /* @__PURE__ */ L(xe, [["render", Se]]), we = l({
|
|
|
937
937
|
})
|
|
938
938
|
};
|
|
939
939
|
}
|
|
940
|
-
}),
|
|
941
|
-
function
|
|
940
|
+
}), we = { class: "w-full h-full absolute inset-0 left-0 top-0 flex items-center justify-center" }, Te = { class: "w-full flex-1 relative flex justify-center" };
|
|
941
|
+
function Ee(t, n, r, s, c, l) {
|
|
942
942
|
return y(), a("div", {
|
|
943
943
|
onClick: n[0] ||= (...e) => t.selectDay && t.selectDay(...e),
|
|
944
944
|
class: m(["flex flex-col items-center justify-start gap-y-0.5 w-full overflow-hidden hw-accel-height", [t.canSelect ? "cursor-pointer" : "cursor-default", t.isDragging ? "" : "transition-all duration-300 ease-out"]]),
|
|
945
945
|
style: g({ height: `${40 + t.expandProgress * 16}px` })
|
|
946
|
-
}, [o("div", { class: m(["relative w-8 h-8 shrink-0 rounded-full transition-all duration-200 ease-in-out aspect-square border", t.styles.border]) }, [o("div", { class: m(["rounded-full w-full h-full transition-all duration-200 ease-in-out bg-on-surface", t.styles.bg]) }, null, 2), o("div",
|
|
946
|
+
}, [o("div", { class: m(["relative w-8 h-8 shrink-0 rounded-full transition-all duration-200 ease-in-out aspect-square border", t.styles.border]) }, [o("div", { class: m(["rounded-full w-full h-full transition-all duration-200 ease-in-out bg-on-surface", t.styles.bg]) }, null, 2), o("div", we, [o("div", { class: m(["select-none text-label-md transition-all duration-200 ease-in-out", t.styles.text]) }, T(t.day.primary), 3)])], 2), o("div", Te, [t.canSelect ? (y(), a("div", {
|
|
947
947
|
key: 0,
|
|
948
948
|
class: m(["rounded-full aspect-square w-1.5 bg-error absolute hw-accel", [t.isDragging ? "" : "transition-all duration-300 ease-out"]]),
|
|
949
949
|
style: g({
|
|
@@ -963,10 +963,10 @@ function De(t, n, r, s, c, l) {
|
|
|
963
963
|
style: g({ backgroundColor: e.color || "var(--cal-primary)" })
|
|
964
964
|
}, null, 4))), 128))], 6)) : i("", !0)])], 6);
|
|
965
965
|
}
|
|
966
|
-
var
|
|
966
|
+
var De = /* @__PURE__ */ L(Ce, [["render", Ee], ["__scopeId", "data-v-d90e616f"]]), Oe = { class: "flex flex-col gap-y-1 p-3 flex-1" }, ke = { class: "text-label-md font-semibold text-on-surface" }, Ae = { class: "text-body-sm text-on-surface/60" }, je = l({
|
|
967
967
|
name: "MobileCalendarGrid",
|
|
968
968
|
components: {
|
|
969
|
-
MobileDayHolder:
|
|
969
|
+
MobileDayHolder: De,
|
|
970
970
|
MobileEventListItem: /* @__PURE__ */ l({
|
|
971
971
|
__name: "MobileEventListItem",
|
|
972
972
|
props: { event: {} },
|
|
@@ -975,7 +975,7 @@ var Oe = /* @__PURE__ */ L(we, [["render", De], ["__scopeId", "data-v-d90e616f"]
|
|
|
975
975
|
return (t, n) => (y(), a("div", {
|
|
976
976
|
class: "bg-surface-variant flex flex-col rounded-lg border cursor-pointer",
|
|
977
977
|
onClick: n[0] ||= M((n) => t.$emit("event-click", e.event, n), ["stop"])
|
|
978
|
-
}, [o("div",
|
|
978
|
+
}, [o("div", Oe, [C(t.$slots, "event", { event: e.event }, () => [o("div", ke, T(e.event.title), 1), o("div", Ae, T(e.event.time), 1)])]), o("div", {
|
|
979
979
|
class: "w-full h-1 shrink-0 rounded-b-full rounded-t-none",
|
|
980
980
|
style: g({ backgroundColor: e.event.color || "#3b82f6" })
|
|
981
981
|
}, null, 4)]));
|
|
@@ -1057,13 +1057,13 @@ var Oe = /* @__PURE__ */ L(we, [["render", De], ["__scopeId", "data-v-d90e616f"]
|
|
|
1057
1057
|
eventsList: a
|
|
1058
1058
|
};
|
|
1059
1059
|
}
|
|
1060
|
-
}),
|
|
1060
|
+
}), Me = { class: "w-full pt-6 px-4 relative flex flex-col flex-1 overflow-y-auto" }, Ne = { class: "select-none text-[10px] text-on-surface/50 w-full flex items-center justify-between" }, Pe = { class: "font-medium" }, Fe = { class: "w-full mt-4 grid grid-cols-7 gap-x-5 gap-y-4" }, Ie = {
|
|
1061
1061
|
key: 0,
|
|
1062
1062
|
class: "transition-all duration-200 ease-in-out overflow-hidden w-full mt-4 flex-1 overflow-y-auto"
|
|
1063
|
-
},
|
|
1064
|
-
function
|
|
1063
|
+
}, Le = { class: "py-2 text-on-surface text-title-sm font-bold select-none border-b border-outline-variant mb-2" }, Re = { class: "w-full flex flex-col gap-y-2" };
|
|
1064
|
+
function ze(t, n, s, l, u, d) {
|
|
1065
1065
|
let f = w("MobileDayHolder"), p = w("MobileEventListItem");
|
|
1066
|
-
return y(), a("div",
|
|
1066
|
+
return y(), a("div", Me, [
|
|
1067
1067
|
n[6] ||= o("div", { class: "w-full fixed right-0 -translate-y-6 pointer-events-none z-50 h-6 bg-gradient-to-b from-surface to-transparent" }, null, -1),
|
|
1068
1068
|
o("div", {
|
|
1069
1069
|
id: "mobile-grid",
|
|
@@ -1077,10 +1077,10 @@ function Be(t, n, s, l, u, d) {
|
|
|
1077
1077
|
onTouchend: n[2] ||= (...e) => t.handleTouchEnd && t.handleTouchEnd(...e),
|
|
1078
1078
|
onMousedown: n[3] ||= M((...e) => t.handleMouseDown && t.handleMouseDown(...e), ["prevent"]),
|
|
1079
1079
|
onMouseleave: n[4] ||= (...e) => t.handleMouseLeave && t.handleMouseLeave(...e)
|
|
1080
|
-
}, [o("div",
|
|
1080
|
+
}, [o("div", Ne, [(y(!0), a(e, null, S(t.weekDays, (e) => (y(), a("div", {
|
|
1081
1081
|
class: "aspect-square w-8 shrink-0 flex items-center justify-center",
|
|
1082
1082
|
key: e.dayOfWeek
|
|
1083
|
-
}, [o("div",
|
|
1083
|
+
}, [o("div", Pe, T(e.label), 1)]))), 128))]), o("div", Fe, [(y(!0), a(e, null, S(t.days, (e, n) => (y(), a("div", {
|
|
1084
1084
|
key: n,
|
|
1085
1085
|
class: m([
|
|
1086
1086
|
"transition-all duration-200 rounded-lg",
|
|
@@ -1102,7 +1102,7 @@ function Be(t, n, s, l, u, d) {
|
|
|
1102
1102
|
"day",
|
|
1103
1103
|
"events"
|
|
1104
1104
|
])], 2))), 128))])], 32),
|
|
1105
|
-
t.showEventsList ? (y(), a("div",
|
|
1105
|
+
t.showEventsList ? (y(), a("div", Ie, [o("div", Le, T(t.selectedDate), 1), o("div", Re, [(y(!0), a(e, null, S(t.eventsList, (e) => (y(), r(p, {
|
|
1106
1106
|
key: e.id,
|
|
1107
1107
|
event: e,
|
|
1108
1108
|
onEventClick: n[5] ||= (e, n) => t.$emit("event-click", e, n)
|
|
@@ -1112,19 +1112,19 @@ function Be(t, n, s, l, u, d) {
|
|
|
1112
1112
|
}, 1032, ["event"]))), 128))])])) : i("", !0)
|
|
1113
1113
|
]);
|
|
1114
1114
|
}
|
|
1115
|
-
var
|
|
1115
|
+
var Be = /* @__PURE__ */ L(je, [["render", ze]]), Ve = { class: "detail-wrapper-stub" }, He = l({
|
|
1116
1116
|
components: {
|
|
1117
|
-
MobileCalendarGrid:
|
|
1118
|
-
CalendarHeaderItem:
|
|
1119
|
-
CalendarSideItem:
|
|
1120
|
-
CalendarDayHolder:
|
|
1121
|
-
CalendarPointer:
|
|
1117
|
+
MobileCalendarGrid: Be,
|
|
1118
|
+
CalendarHeaderItem: B,
|
|
1119
|
+
CalendarSideItem: W,
|
|
1120
|
+
CalendarDayHolder: ye,
|
|
1121
|
+
CalendarPointer: Se,
|
|
1122
1122
|
CalendarItemDisplay: Z,
|
|
1123
1123
|
CalendarEventDetailWrapper: /* @__PURE__ */ l({
|
|
1124
1124
|
__name: "CalendarEventDetailWrapper",
|
|
1125
1125
|
emits: ["lock-scroll"],
|
|
1126
1126
|
setup(e) {
|
|
1127
|
-
return (e, t) => (y(), a("div",
|
|
1127
|
+
return (e, t) => (y(), a("div", Ve));
|
|
1128
1128
|
}
|
|
1129
1129
|
})
|
|
1130
1130
|
},
|
|
@@ -1321,151 +1321,149 @@ var Ve = /* @__PURE__ */ L(Me, [["render", Be]]), He = { class: "detail-wrapper-
|
|
|
1321
1321
|
openSpecificDay: w
|
|
1322
1322
|
};
|
|
1323
1323
|
}
|
|
1324
|
-
}),
|
|
1324
|
+
}), Ue = ["dir"], We = {
|
|
1325
1325
|
ref: "scrollContainer",
|
|
1326
|
-
class: "flex-1 w-full flex overflow-y-auto cal-scrollbar"
|
|
1327
|
-
},
|
|
1326
|
+
class: "flex-1 w-full flex flex-col overflow-y-auto cal-scrollbar relative"
|
|
1327
|
+
}, Ge = {
|
|
1328
|
+
key: 0,
|
|
1329
|
+
class: "sticky top-0 z-30 bg-surface shrink-0"
|
|
1330
|
+
}, Ke = { class: "flex-1 w-full flex min-h-0" }, qe = { class: "flex-1 relative" }, Je = { class: "absolute inset-0 w-full flex flex-col pointer-events-none" }, Ye = { class: "absolute inset-0 w-full flex pointer-events-none" }, Xe = { class: "relative min-h-full w-full" }, Ze = ["onClick"], Qe = {
|
|
1328
1331
|
key: 2,
|
|
1329
1332
|
class: "w-full"
|
|
1330
1333
|
};
|
|
1331
|
-
function
|
|
1334
|
+
function $e(n, l, u, d, p, h) {
|
|
1332
1335
|
let _ = w("CalendarEventDetailWrapper"), v = w("CalendarHeaderItem"), b = w("CalendarSideItem"), x = w("CalendarPointer"), E = w("CalendarItemDisplay"), D = w("CalendarDayHolder"), O = w("MobileCalendarGrid");
|
|
1333
1336
|
return y(), a("div", {
|
|
1334
1337
|
class: "w-full h-full flex flex-col bg-surface whitespace-normal",
|
|
1335
1338
|
dir: n.dir
|
|
1336
|
-
}, [
|
|
1337
|
-
|
|
1338
|
-
n.
|
|
1339
|
-
|
|
1340
|
-
|
|
1339
|
+
}, [c(_, { onLockScroll: n.setLockScroll }, null, 8, ["onLockScroll"]), o("div", We, [n.showMonthly ? (y(), a("div", Ge, [c(v, {
|
|
1340
|
+
class: "cal-header-row w-full border-b border-surface-variant",
|
|
1341
|
+
mode: n.mode,
|
|
1342
|
+
days: n.displayedHeader,
|
|
1343
|
+
"today-column-index": n.todayColumnIndex
|
|
1344
|
+
}, null, 8, [
|
|
1345
|
+
"mode",
|
|
1346
|
+
"days",
|
|
1347
|
+
"today-column-index"
|
|
1348
|
+
])])) : i("", !0), o("div", Ke, [o("div", { class: m(["shrink-0 transition-all duration-300", [n.mode === "monthly" ? "w-0 opacity-0 overflow-hidden" : "w-8 sm:w-9 md:w-25 opacity-100 h-full"]]) }, [c(b, {
|
|
1349
|
+
class: "w-8 sm:w-9 md:w-25 min-h-full",
|
|
1350
|
+
range: n.effectiveHours
|
|
1351
|
+
}, null, 8, ["range"])], 2), o("div", qe, [c(t, {
|
|
1352
|
+
name: "calendar-view",
|
|
1353
|
+
mode: "out-in"
|
|
1354
|
+
}, {
|
|
1355
|
+
default: A(() => [n.mode === "monthly" ? n.isMobile ? n.mode === "monthly" && n.isMobile ? (y(), a("div", Qe, [c(O, {
|
|
1356
|
+
loading: n.isLoading,
|
|
1357
|
+
days: n.headers,
|
|
1341
1358
|
mode: n.mode,
|
|
1342
|
-
|
|
1343
|
-
"
|
|
1344
|
-
|
|
1345
|
-
|
|
1359
|
+
"events-by-day": n.monthlyEventsByDay,
|
|
1360
|
+
"is-other-month-func": (e) => n.headers.find((t) => new Date(t.date).toDateString() === new Date(e).toDateString())?.otherMonth || !1,
|
|
1361
|
+
onEventClick: l[2] ||= (e) => n.$emit("event-click", e)
|
|
1362
|
+
}, s({ _: 2 }, [n.$slots["event-mobile"] ? {
|
|
1363
|
+
name: "event-mobile",
|
|
1364
|
+
fn: A(({ event: e }) => [C(n.$slots, "event-mobile", {
|
|
1365
|
+
event: e,
|
|
1366
|
+
mode: "monthly-mobile"
|
|
1367
|
+
}, void 0, !0)]),
|
|
1368
|
+
key: "0"
|
|
1369
|
+
} : void 0]), 1032, [
|
|
1370
|
+
"loading",
|
|
1346
1371
|
"days",
|
|
1347
|
-
"
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1372
|
+
"mode",
|
|
1373
|
+
"events-by-day",
|
|
1374
|
+
"is-other-month-func"
|
|
1375
|
+
])])) : i("", !0) : (y(), a("div", {
|
|
1376
|
+
key: `month-${n.range?.start?.getTime()}`,
|
|
1377
|
+
class: "w-full grid grid-cols-7 auto-rows-[186px] overflow-hidden"
|
|
1378
|
+
}, [(y(!0), a(e, null, S(n.allHeaders, (e, t) => (y(), r(D, {
|
|
1379
|
+
key: t,
|
|
1380
|
+
day: e,
|
|
1381
|
+
"other-month": !!e.otherMonth,
|
|
1382
|
+
events: n.monthlyEventsByDay.get(new Date(e.date).toDateString()) || [],
|
|
1383
|
+
onOpenDay: (t) => n.openSpecificDay(e),
|
|
1384
|
+
onEventClick: l[1] ||= (e) => n.$emit("event-click", e)
|
|
1385
|
+
}, s({ _: 2 }, [n.$slots.event ? {
|
|
1386
|
+
name: "event",
|
|
1387
|
+
fn: A((e) => [C(n.$slots, "event", f({ ref_for: !0 }, e), void 0, !0)]),
|
|
1388
|
+
key: "0"
|
|
1389
|
+
} : void 0]), 1032, [
|
|
1390
|
+
"day",
|
|
1391
|
+
"other-month",
|
|
1392
|
+
"events",
|
|
1393
|
+
"onOpenDay"
|
|
1394
|
+
]))), 128))])) : (y(), a("div", {
|
|
1395
|
+
key: `time-${n.mode}-${n.range?.start?.getTime()}`,
|
|
1396
|
+
class: "w-full relative",
|
|
1397
|
+
style: g({ height: `${n.hoursList.length * 80}px` })
|
|
1398
|
+
}, [
|
|
1399
|
+
c(x, {
|
|
1359
1400
|
mode: n.mode,
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
}, s({ _: 2 }, [n.$slots["event-mobile"] ? {
|
|
1364
|
-
name: "event-mobile",
|
|
1365
|
-
fn: A(({ event: e }) => [C(n.$slots, "event-mobile", {
|
|
1366
|
-
event: e,
|
|
1367
|
-
mode: "monthly-mobile"
|
|
1368
|
-
}, void 0, !0)]),
|
|
1369
|
-
key: "0"
|
|
1370
|
-
} : void 0]), 1032, [
|
|
1371
|
-
"loading",
|
|
1372
|
-
"days",
|
|
1401
|
+
hours: n.effectiveHours,
|
|
1402
|
+
headers: n.headers
|
|
1403
|
+
}, null, 8, [
|
|
1373
1404
|
"mode",
|
|
1374
|
-
"
|
|
1375
|
-
"
|
|
1376
|
-
])
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
"
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1405
|
+
"hours",
|
|
1406
|
+
"headers"
|
|
1407
|
+
]),
|
|
1408
|
+
o("div", Je, [(y(!0), a(e, null, S(n.effectiveHours.end - n.effectiveHours.start, (e) => (y(), a("div", {
|
|
1409
|
+
key: e,
|
|
1410
|
+
class: "w-full border-b border-surface-variant box-border h-20"
|
|
1411
|
+
}))), 128))]),
|
|
1412
|
+
o("div", Ye, [(y(!0), a(e, null, S(n.headers, (e, t) => (y(), a("div", {
|
|
1413
|
+
class: m(["h-full ltr:border-r rtl:border-l border-outline-variant flex-1 transition-colors", { "bg-today-column": t === n.todayColumnIndex }]),
|
|
1414
|
+
key: "v" + t
|
|
1415
|
+
}, null, 2))), 128))]),
|
|
1416
|
+
o("div", Xe, [(y(!0), a(e, null, S(n.gridEvents, (e) => (y(), r(E, {
|
|
1417
|
+
key: e.event.id,
|
|
1418
|
+
event: e.event,
|
|
1419
|
+
mode: n.mode,
|
|
1420
|
+
headers: n.headers,
|
|
1421
|
+
hours: n.effectiveHours,
|
|
1422
|
+
isMobile: n.isMobile,
|
|
1423
|
+
"overlap-index": e.overlapIndex,
|
|
1424
|
+
"overlap-count": e.overlapCount,
|
|
1425
|
+
onEventClick: l[0] ||= (e) => n.$emit("event-click", e)
|
|
1386
1426
|
}, s({ _: 2 }, [n.$slots.event ? {
|
|
1387
1427
|
name: "event",
|
|
1388
1428
|
fn: A((e) => [C(n.$slots, "event", f({ ref_for: !0 }, e), void 0, !0)]),
|
|
1389
1429
|
key: "0"
|
|
1390
1430
|
} : void 0]), 1032, [
|
|
1391
|
-
"
|
|
1392
|
-
"
|
|
1393
|
-
"
|
|
1394
|
-
"
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
])
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
o("div", Je, [(y(!0), a(e, null, S(n.headers, (e, t) => (y(), a("div", {
|
|
1414
|
-
class: m(["h-full border-r border-surface-variant flex-1 transition-colors", { "bg-today-column": t === n.todayColumnIndex }]),
|
|
1415
|
-
key: "v" + t
|
|
1416
|
-
}, null, 2))), 128))]),
|
|
1417
|
-
o("div", Ye, [(y(!0), a(e, null, S(n.gridEvents, (e) => (y(), r(E, {
|
|
1418
|
-
key: e.event.id,
|
|
1419
|
-
event: e.event,
|
|
1420
|
-
mode: n.mode,
|
|
1421
|
-
headers: n.headers,
|
|
1422
|
-
hours: n.effectiveHours,
|
|
1423
|
-
isMobile: n.isMobile,
|
|
1424
|
-
"overlap-index": e.overlapIndex,
|
|
1425
|
-
"overlap-count": e.overlapCount,
|
|
1426
|
-
onEventClick: l[0] ||= (e) => n.$emit("event-click", e)
|
|
1427
|
-
}, s({ _: 2 }, [n.$slots.event ? {
|
|
1428
|
-
name: "event",
|
|
1429
|
-
fn: A((e) => [C(n.$slots, "event", f({ ref_for: !0 }, e), void 0, !0)]),
|
|
1430
|
-
key: "0"
|
|
1431
|
-
} : void 0]), 1032, [
|
|
1432
|
-
"event",
|
|
1433
|
-
"mode",
|
|
1434
|
-
"headers",
|
|
1435
|
-
"hours",
|
|
1436
|
-
"isMobile",
|
|
1437
|
-
"overlap-index",
|
|
1438
|
-
"overlap-count"
|
|
1439
|
-
]))), 128)), (y(!0), a(e, null, S(n.overflowIndicators, (e, t) => (y(), a("div", {
|
|
1440
|
-
key: `of-${t}`,
|
|
1441
|
-
class: "absolute px-0.5 sm:px-1 z-20 pointer-events-auto",
|
|
1442
|
-
style: g({
|
|
1443
|
-
top: `${(Math.min(e.endDecimal, n.effectiveHours.end) - n.effectiveHours.start) * 80}px`,
|
|
1444
|
-
insetInlineStart: `${e.dayIndex * (100 / n.headers.length)}%`,
|
|
1445
|
-
width: `${100 / n.headers.length}%`
|
|
1446
|
-
})
|
|
1447
|
-
}, [o("button", {
|
|
1448
|
-
class: "w-full text-[8px] sm:text-[10px] leading-none rounded bg-surface-variant hover:bg-surface-variant/80 text-on-surface/70 px-1 sm:px-2 py-0.5 sm:py-1 truncate transition-colors",
|
|
1449
|
-
onClick: (t) => n.openSpecificDay(n.headers[e.dayIndex])
|
|
1450
|
-
}, " +" + T(e.count) + " more ", 9, Xe)], 4))), 128))])
|
|
1451
|
-
], 4))]),
|
|
1452
|
-
_: 3
|
|
1453
|
-
})])], 512)
|
|
1454
|
-
], 8, We);
|
|
1431
|
+
"event",
|
|
1432
|
+
"mode",
|
|
1433
|
+
"headers",
|
|
1434
|
+
"hours",
|
|
1435
|
+
"isMobile",
|
|
1436
|
+
"overlap-index",
|
|
1437
|
+
"overlap-count"
|
|
1438
|
+
]))), 128)), (y(!0), a(e, null, S(n.overflowIndicators, (e, t) => (y(), a("div", {
|
|
1439
|
+
key: `of-${t}`,
|
|
1440
|
+
class: "absolute px-0.5 sm:px-1 z-20 pointer-events-auto",
|
|
1441
|
+
style: g({
|
|
1442
|
+
top: `${(Math.min(e.endDecimal, n.effectiveHours.end) - n.effectiveHours.start) * 80}px`,
|
|
1443
|
+
insetInlineStart: `${e.dayIndex * (100 / n.headers.length)}%`,
|
|
1444
|
+
width: `${100 / n.headers.length}%`
|
|
1445
|
+
})
|
|
1446
|
+
}, [o("button", {
|
|
1447
|
+
class: "w-full text-[8px] sm:text-[10px] leading-none rounded bg-surface-variant hover:bg-surface-variant/80 text-on-surface/70 px-1 sm:px-2 py-0.5 sm:py-1 truncate transition-colors",
|
|
1448
|
+
onClick: (t) => n.openSpecificDay(n.headers[e.dayIndex])
|
|
1449
|
+
}, " +" + T(e.count) + " more ", 9, Ze)], 4))), 128))])
|
|
1450
|
+
], 4))]),
|
|
1451
|
+
_: 3
|
|
1452
|
+
})])])], 512)], 8, Ue);
|
|
1455
1453
|
}
|
|
1456
|
-
var
|
|
1454
|
+
var et = /* @__PURE__ */ L(He, [["render", $e], ["__scopeId", "data-v-6e2c33b4"]]), tt = ["dir"], nt = {
|
|
1457
1455
|
ref: "scrollContainer",
|
|
1458
1456
|
class: "flex-1 w-full overflow-y-auto cal-scrollbar px-2 sm:px-4 md:px-6 py-3 sm:py-5"
|
|
1459
|
-
},
|
|
1457
|
+
}, rt = { class: "max-w-4xl mx-auto flex flex-col gap-6" }, it = { class: "agenda-section-header sticky top-0 z-10 py-1.5 flex items-center gap-3 bg-surface/95 backdrop-blur-xs" }, at = { class: "rounded-full bg-surface-variant px-3 py-0.5 text-xs font-semibold text-on-surface/70 border border-outline-variant shadow-xs select-none" }, ot = { class: "flex flex-col gap-3" }, st = { class: "agenda-date-col shrink-0 flex flex-col items-start w-24 sm:w-32 md:w-36 pt-0.5 select-none" }, ct = { class: "sm:hidden" }, lt = { class: "hidden sm:inline" }, ut = { class: "mt-1 flex items-center gap-1.5 sm:gap-2" }, dt = { class: "flex flex-col text-[10px] sm:text-xs leading-none text-on-surface/50 gap-0.5" }, ft = {
|
|
1460
1458
|
key: 0,
|
|
1461
1459
|
class: "opacity-70"
|
|
1462
|
-
},
|
|
1460
|
+
}, pt = {
|
|
1463
1461
|
key: 0,
|
|
1464
1462
|
class: "mt-1 text-[10px] font-medium text-error truncate max-w-full"
|
|
1465
|
-
},
|
|
1463
|
+
}, Q = { class: "agenda-events-col flex-1 min-w-0 flex flex-col gap-2" }, mt = ["onClick"], ht = { class: "min-w-0 flex-1 font-semibold text-xs sm:text-sm md:text-base leading-snug truncate" }, gt = {
|
|
1466
1464
|
key: 0,
|
|
1467
1465
|
class: "shrink-0 text-[11px] sm:text-xs md:text-sm font-medium opacity-90 flex items-center gap-1.5 whitespace-nowrap"
|
|
1468
|
-
},
|
|
1466
|
+
}, _t = {
|
|
1469
1467
|
key: 1,
|
|
1470
1468
|
class: "agenda-no-events flex items-center text-xs text-on-surface/40 italic py-2 px-3 rounded-lg border border-dashed border-outline-variant select-none"
|
|
1471
1469
|
}, $ = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
@@ -1566,32 +1564,32 @@ var $e = /* @__PURE__ */ L(Ue, [["render", Qe], ["__scopeId", "data-v-66575d8b"]
|
|
|
1566
1564
|
return (t, n) => (y(), a("div", {
|
|
1567
1565
|
class: "calendar-agenda w-full h-full flex flex-col bg-surface overflow-hidden",
|
|
1568
1566
|
dir: f.value
|
|
1569
|
-
}, [o("div",
|
|
1567
|
+
}, [o("div", nt, [o("div", rt, [(y(!0), a(e, null, S(A.value, (r) => (y(), a("div", {
|
|
1570
1568
|
key: r.id,
|
|
1571
1569
|
class: "agenda-section flex flex-col gap-3"
|
|
1572
|
-
}, [o("div",
|
|
1570
|
+
}, [o("div", it, [
|
|
1573
1571
|
n[0] ||= o("div", { class: "h-px flex-1 bg-outline-variant" }, null, -1),
|
|
1574
|
-
o("span",
|
|
1572
|
+
o("span", at, T(r.rangeLabel), 1),
|
|
1575
1573
|
n[1] ||= o("div", { class: "h-px flex-1 bg-outline-variant" }, null, -1)
|
|
1576
|
-
]), o("div",
|
|
1574
|
+
]), o("div", ot, [(y(!0), a(e, null, S(r.days, (r) => (y(), a("div", {
|
|
1577
1575
|
key: r.day.name + r.day.date.getTime(),
|
|
1578
1576
|
class: m(["agenda-day-row flex flex-row items-start gap-3 sm:gap-5 p-2.5 sm:p-3.5 rounded-xl border border-outline-variant/60 transition-colors", {
|
|
1579
1577
|
"bg-today-column ring-1 ring-primary/30 border-primary/40": r.day.isToday,
|
|
1580
1578
|
"bg-surface": !r.day.isToday
|
|
1581
1579
|
}])
|
|
1582
|
-
}, [o("div",
|
|
1583
|
-
o("span", { class: m(["text-xs sm:text-sm font-semibold truncate max-w-full", r.day.isToday ? "text-primary font-bold" : "text-on-surface/80"]) }, [o("span",
|
|
1584
|
-
o("div",
|
|
1585
|
-
r.day.holidayTitle ? (y(), a("span",
|
|
1586
|
-
]), o("div",
|
|
1580
|
+
}, [o("div", st, [
|
|
1581
|
+
o("span", { class: m(["text-xs sm:text-sm font-semibold truncate max-w-full", r.day.isToday ? "text-primary font-bold" : "text-on-surface/80"]) }, [o("span", ct, T(r.day.shortName || r.day.name), 1), o("span", lt, T(r.day.name), 1)], 2),
|
|
1582
|
+
o("div", ut, [o("div", { class: m(["flex size-7 sm:size-8 items-center justify-center rounded-full text-xs sm:text-sm font-bold shadow-xs shrink-0", [r.day.isToday ? "bg-primary text-surface font-extrabold ring-2 ring-primary/30" : r.day.isWeekend || r.day.isHoliday ? "bg-surface-variant text-error border border-outline-variant" : "bg-surface-variant text-on-surface border border-outline-variant"]]) }, T(r.day.primary), 3), o("div", dt, [o("span", { class: m({ "text-error": r.day.isWeekend || r.day.isHoliday }) }, T(r.day.secondary), 3), r.day.tertiary ? (y(), a("span", ft, T(r.day.tertiary), 1)) : i("", !0)])]),
|
|
1583
|
+
r.day.holidayTitle ? (y(), a("span", pt, T(r.day.holidayTitle), 1)) : i("", !0)
|
|
1584
|
+
]), o("div", Q, [r.events.length > 0 ? (y(!0), a(e, { key: 0 }, S(r.events, (e) => (y(), a("div", {
|
|
1587
1585
|
key: e.id,
|
|
1588
|
-
class: "agenda-event-card group flex items-center justify-between gap-3 rounded-lg sm:rounded-xl p-2.5 sm:px-4 sm:py-3 shadow-xs cursor-pointer transition-all hover:scale-[1.006] hover:shadow-md active:scale-[0.995]",
|
|
1586
|
+
class: "agenda-event-card group flex items-center justify-between gap-3 rounded-lg sm:rounded-xl p-2.5 sm:px-4 sm:py-3 border border-black/10 dark:border-white/20 shadow-xs cursor-pointer transition-all hover:scale-[1.006] hover:shadow-md active:scale-[0.995]",
|
|
1589
1587
|
style: g(b(e)),
|
|
1590
1588
|
onClick: (n) => t.$emit("event-click", e)
|
|
1591
1589
|
}, [C(t.$slots, "event", {
|
|
1592
1590
|
event: e,
|
|
1593
1591
|
mode: "agenda"
|
|
1594
|
-
}, () => [o("div",
|
|
1592
|
+
}, () => [o("div", ht, T(e.title), 1), e.time || e.isFullDay ? (y(), a("div", gt, [n[2] ||= o("svg", {
|
|
1595
1593
|
class: "size-3 sm:size-3.5 opacity-80",
|
|
1596
1594
|
viewBox: "0 0 24 24",
|
|
1597
1595
|
fill: "none",
|
|
@@ -1601,16 +1599,16 @@ var $e = /* @__PURE__ */ L(Ue, [["render", Qe], ["__scopeId", "data-v-66575d8b"]
|
|
|
1601
1599
|
cx: "12",
|
|
1602
1600
|
cy: "12",
|
|
1603
1601
|
r: "10"
|
|
1604
|
-
}), o("polyline", { points: "12 6 12 12 16 14" })], -1), o("span", null, T(v(e)), 1)])) : i("", !0)], !0)], 12,
|
|
1602
|
+
}), o("polyline", { points: "12 6 12 12 16 14" })], -1), o("span", null, T(v(e)), 1)])) : i("", !0)], !0)], 12, mt))), 128)) : (y(), a("div", _t, T(E(c)("calendar.noEvents") || "No events"), 1))])], 2))), 128))])]))), 128))])], 512)], 8, tt));
|
|
1605
1603
|
}
|
|
1606
|
-
}), [["__scopeId", "data-v-
|
|
1604
|
+
}), [["__scopeId", "data-v-71fb8cbf"]]), vt = {
|
|
1607
1605
|
key: 0,
|
|
1608
1606
|
class: "w-full h-full flex flex-col font-sans",
|
|
1609
1607
|
style: {
|
|
1610
1608
|
color: "var(--cal-on-surface)",
|
|
1611
1609
|
background: "var(--cal-surface)"
|
|
1612
1610
|
}
|
|
1613
|
-
},
|
|
1611
|
+
}, yt = { class: "w-full flex-1 overflow-hidden relative" }, bt = /* @__PURE__ */ l({
|
|
1614
1612
|
__name: "VueCalendar",
|
|
1615
1613
|
props: {
|
|
1616
1614
|
events: { default: () => [] },
|
|
@@ -1687,13 +1685,13 @@ var $e = /* @__PURE__ */ L(Ue, [["render", Qe], ["__scopeId", "data-v-66575d8b"]
|
|
|
1687
1685
|
setMode: M,
|
|
1688
1686
|
currentRange: E,
|
|
1689
1687
|
handleModeUpdate: j
|
|
1690
|
-
}), (t, n) => f.value ? (y(), a("div",
|
|
1688
|
+
}), (t, n) => f.value ? (y(), a("div", vt, [C(t.$slots, "header", {
|
|
1691
1689
|
mode: e.mode,
|
|
1692
1690
|
range: E.value,
|
|
1693
1691
|
next: D,
|
|
1694
1692
|
prev: O,
|
|
1695
1693
|
setMode: M
|
|
1696
|
-
}), o("div",
|
|
1694
|
+
}), o("div", yt, [e.mode === "agenda" ? (y(), r($, {
|
|
1697
1695
|
key: 0,
|
|
1698
1696
|
range: E.value,
|
|
1699
1697
|
events: e.events,
|
|
@@ -1702,7 +1700,7 @@ var $e = /* @__PURE__ */ L(Ue, [["render", Qe], ["__scopeId", "data-v-66575d8b"]
|
|
|
1702
1700
|
name: "event",
|
|
1703
1701
|
fn: A((e) => [C(t.$slots, "event", h(u(e)))]),
|
|
1704
1702
|
key: "0"
|
|
1705
|
-
} : void 0]), 1032, ["range", "events"])) : (y(), r(
|
|
1703
|
+
} : void 0]), 1032, ["range", "events"])) : (y(), r(et, {
|
|
1706
1704
|
key: 1,
|
|
1707
1705
|
range: E.value,
|
|
1708
1706
|
mode: e.mode,
|
|
@@ -1728,4 +1726,4 @@ var $e = /* @__PURE__ */ L(Ue, [["render", Qe], ["__scopeId", "data-v-66575d8b"]
|
|
|
1728
1726
|
}
|
|
1729
1727
|
});
|
|
1730
1728
|
//#endregion
|
|
1731
|
-
export { $ as CalendarAgenda,
|
|
1729
|
+
export { $ as CalendarAgenda, bt as VueCalendar, X as getAccessibleTextColor, fe as getContrastRatio, Y as getRelativeLuminance, J as parseColorToRgb };
|
package/dist/style.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:root{--color-surface:#fff;--color-surface-variant:#f8f8fa;--color-on-surface:#2c2c2e;--color-primary:#1a9d90;--color-error:#e52b16;--color-outline:#d1d0d2;--color-outline-variant:#f0f0f0;--cal-surface:#fff;--cal-surface-variant:#f8f8fa;--cal-on-surface:#2c2c2e;--cal-primary:#1a9d90;--cal-error:#e52b16;--cal-outline:#d1d0d2;--cal-outline-variant:#f0f0f0;--text-label-md:14px;--text-label-md--line-height:28px;--text-label-md--font-weight:500;--text-label-sm:12px;--text-label-sm--line-height:24px;--text-label-sm--font-weight:500;--text-body-sm:12px;--text-body-sm--line-height:24px;--text-body-sm--font-weight:400;--text-title-sm:14px;--text-title-sm--line-height:28px;--text-title-sm--font-weight:700;--cal-today-bg-light:radial-gradient(circle at 70% 0%, #10121b, #393e4d);--cal-today-bg-dark:radial-gradient(circle at 70% 0%, #d1d0d2, #9b9a9d);--cal-today-bg:var(--cal-today-bg-light);--cal-today-column-bg-light:#1a9d900d;--cal-today-column-bg-dark:#40b8ac14;--cal-today-column-bg:var(--cal-today-column-bg-light)}.dark{--color-surface:#151823;--color-surface-variant:#242836;--color-on-surface:#fff;--color-primary:#40b8ac;--color-error:#ea5545;--color-outline:#605f63;--color-outline-variant:#3a393c;--cal-surface:#151823;--cal-surface-variant:#242836;--cal-on-surface:#fff;--cal-primary:#40b8ac;--cal-error:#ea5545;--cal-outline:#605f63;--cal-outline-variant:#3a393c;--cal-today-bg:var(--cal-today-bg-dark);--cal-today-column-bg:var(--cal-today-column-bg-dark)}.bg-today{background-image:var(--cal-today-bg)}.bg-today-column{background-color:var(--cal-today-column-bg)}.cal-scrollbar{scrollbar-width:thin;scrollbar-color:var(--color-primary) var(--color-surface-variant)}.cal-scrollbar::-webkit-scrollbar{width:2px;height:2px}.cal-scrollbar::-webkit-scrollbar-track{background:var(--color-surface-variant)}.cal-scrollbar::-webkit-scrollbar-thumb{background:var(--color-primary);border-radius:10px}.english-num[data-v-
|
|
1
|
+
:root{--color-surface:#fff;--color-surface-variant:#f8f8fa;--color-on-surface:#2c2c2e;--color-primary:#1a9d90;--color-error:#e52b16;--color-outline:#d1d0d2;--color-outline-variant:#f0f0f0;--cal-surface:#fff;--cal-surface-variant:#f8f8fa;--cal-on-surface:#2c2c2e;--cal-primary:#1a9d90;--cal-error:#e52b16;--cal-outline:#d1d0d2;--cal-outline-variant:#f0f0f0;--text-label-md:14px;--text-label-md--line-height:28px;--text-label-md--font-weight:500;--text-label-sm:12px;--text-label-sm--line-height:24px;--text-label-sm--font-weight:500;--text-body-sm:12px;--text-body-sm--line-height:24px;--text-body-sm--font-weight:400;--text-title-sm:14px;--text-title-sm--line-height:28px;--text-title-sm--font-weight:700;--cal-today-bg-light:radial-gradient(circle at 70% 0%, #10121b, #393e4d);--cal-today-bg-dark:radial-gradient(circle at 70% 0%, #d1d0d2, #9b9a9d);--cal-today-bg:var(--cal-today-bg-light);--cal-today-column-bg-light:#1a9d900d;--cal-today-column-bg-dark:#40b8ac14;--cal-today-column-bg:var(--cal-today-column-bg-light)}.dark{--color-surface:#151823;--color-surface-variant:#242836;--color-on-surface:#fff;--color-primary:#40b8ac;--color-error:#ea5545;--color-outline:#605f63;--color-outline-variant:#3a393c;--cal-surface:#151823;--cal-surface-variant:#242836;--cal-on-surface:#fff;--cal-primary:#40b8ac;--cal-error:#ea5545;--cal-outline:#605f63;--cal-outline-variant:#3a393c;--cal-today-bg:var(--cal-today-bg-dark);--cal-today-column-bg:var(--cal-today-column-bg-dark)}.bg-today{background-image:var(--cal-today-bg)}.bg-today-column{background-color:var(--cal-today-column-bg)}.cal-scrollbar{scrollbar-width:thin;scrollbar-color:var(--color-primary) var(--color-surface-variant)}.cal-scrollbar::-webkit-scrollbar{width:2px;height:2px}.cal-scrollbar::-webkit-scrollbar-track{background:var(--color-surface-variant)}.cal-scrollbar::-webkit-scrollbar-thumb{background:var(--color-primary);border-radius:10px}.english-num[data-v-ef2978fb]{font-family:"IranYekan" sans-serif!important}.hw-accel-height[data-v-d90e616f]{will-change:height}.hw-accel[data-v-d90e616f]{will-change:transform, opacity}.calendar-view-enter-active[data-v-6e2c33b4],.calendar-view-leave-active[data-v-6e2c33b4]{width:100%;transition:all .2s ease-out;top:0;left:0;position:absolute!important}.calendar-view-enter-from[data-v-6e2c33b4]{opacity:0;transform:scale(1.02)}.calendar-view-leave-to[data-v-6e2c33b4]{opacity:0;transform:scale(.98)}.fade-overlay-enter-active[data-v-6e2c33b4],.fade-overlay-leave-active[data-v-6e2c33b4]{transition:opacity .2s ease-out}.fade-overlay-enter-from[data-v-6e2c33b4],.fade-overlay-leave-to[data-v-6e2c33b4]{opacity:0}.calendar-agenda[data-v-71fb8cbf]{font-family:inherit}.agenda-day-row[data-v-71fb8cbf]{transition:all .15s ease-in-out}.agenda-event-card[data-v-71fb8cbf]{-webkit-user-select:none;user-select:none;border:1px solid #0000001a}.dark{border-color:#fff3}
|
|
2
2
|
/*$vite$:1*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "behnoo-calendar",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Multi-calendar Vue 3 component — Gregorian, Jalaali (Persian), and Islamic calendar systems",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -44,6 +44,15 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"dev": "vite",
|
|
49
|
+
"build": "run-p type-check \"build-only {@}\" --",
|
|
50
|
+
"build:lib": "vite build --config vite.lib.config.ts",
|
|
51
|
+
"prepublishOnly": "npm run build:lib",
|
|
52
|
+
"preview": "vite preview",
|
|
53
|
+
"build-only": "vite build",
|
|
54
|
+
"type-check": "vue-tsc --build"
|
|
55
|
+
},
|
|
47
56
|
"peerDependencies": {
|
|
48
57
|
"vue": "^3.5.0"
|
|
49
58
|
},
|
|
@@ -63,13 +72,5 @@
|
|
|
63
72
|
},
|
|
64
73
|
"engines": {
|
|
65
74
|
"node": ">=18.0.0"
|
|
66
|
-
},
|
|
67
|
-
"scripts": {
|
|
68
|
-
"dev": "vite",
|
|
69
|
-
"build": "run-p type-check \"build-only {@}\" --",
|
|
70
|
-
"build:lib": "vite build --config vite.lib.config.ts",
|
|
71
|
-
"preview": "vite preview",
|
|
72
|
-
"build-only": "vite build",
|
|
73
|
-
"type-check": "vue-tsc --build"
|
|
74
75
|
}
|
|
75
|
-
}
|
|
76
|
+
}
|