@quasar/quasar-ui-qcalendar
Version:
QCalendar - Day/Month/Week Calendars, Popups, Date Pickers, Schedules, Agendas, Planners and Tasks for your Vue Apps
6 lines • 38.1 kB
JavaScript
/*!
* @quasar/quasar-ui-qcalendar v4.1.2
* (c) 2025 Jeff Galbraith <jeff@quasar.dev>
* Released under the MIT License.
*/
(function(e,t){"object"===typeof exports&&"undefined"!==typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define(["vue"],t):(e="undefined"!==typeof globalThis?globalThis:e||self,e.QCalendarTask=t(e.Vue))})(this,function(Ee){const u=/^(\d{4})-(\d{1,2})(-(\d{1,2}))?([^\d]+(\d{1,2}))?(:(\d{1,2}))?(:(\d{1,2}))?(.(\d{1,3}))?$/,b=/^(\d{4})-(\d{1,2})(-(\d{1,2}))?/,q=/(\d\d?)(:(\d\d?)|)(:(\d\d?)|)/,E=[0,31,28,31,30,31,30,31,31,30,31,30,31],F=[0,31,29,31,30,31,30,31,31,30,31,30,31],d={MILLISECONDS_IN:{SECOND:1e3,MINUTE:6e4,HOUR:36e5,DAY:864e5,WEEK:6048e5},SECONDS_IN:{MINUTE:60,HOUR:3600,DAY:86400,WEEK:604800},MINUTES_IN:{MINUTE:1,HOUR:60,DAY:1440,WEEK:10080},HOURS_IN:{DAY:24,WEEK:168},DAYS_IN:{WEEK:7}},M=28,W=31,x=12,O=1,U=1,H=0;function t(e){return"string"===typeof e&&u.test(e)}function Fe(e){if("string"!==typeof e)return null;const t=u.exec(e);if(!t||!t[1]||!t[2])return null;const a=parseInt(t[1],10),n=parseInt(t[2],10),r=parseInt(t[4]||"1",10),o=parseInt(t[6]||"0",10),d=parseInt(t[8]||"0",10);return{date:e,time:o.toString().padStart(2,"0")+":"+d.toString().padStart(2,"0"),year:a,month:n,day:r,hour:o,minute:d,hasDay:!!t[4],hasTime:!0,past:!1,current:!1,future:!1,disabled:!1,weekday:0,doy:0,workweek:0}}function R(e,t=!1){if(!(e instanceof Date))return null;const a=t?"UTC":"";return g({date:r(e[`get${a}FullYear`](),4)+"-"+r(e[`get${a}Month`]()+1,2)+"-"+r(e[`get${a}Date`](),2),time:r(e[`get${a}Hours`]()||0,2)+":"+r(e[`get${a}Minutes`]()||0,2),year:e[`get${a}FullYear`](),month:e[`get${a}Month`]()+1,day:e[`get${a}Date`](),hour:e[`get${a}Hours`](),minute:e[`get${a}Minutes`](),weekday:0,doy:0,workweek:0,hasDay:!0,hasTime:!0,past:!1,current:!1,future:!1,disabled:!1})}function r(e,t){let a=String(e);while(a.length<t)a="0"+a;return a}function V(e){return e%4===0&&e%100!==0||e%400===0}function i(e,t){return(V(e)?F:E)[t]}function h(e){const t=new Date(e.year,e.month-1,e.day+1);return g(ue({...e,year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}))}function p(e){const t=new Date(e.year,e.month-1,e.day-1);return g(ue({...e,year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}))}function Me(){const e=new Date,t=e.getMonth()+1,a=e.getDate(),n=e.getFullYear();return[n,r(t,2),r(a,2)].join("-")}function B(e){return e===Me()}function T(e,t,a){let n=I(e);if(t){if(1===n.day||0===n.weekday)while(!t.includes(Number(n.weekday)))n=h(n);n=v(n,t[0],p),n=g(n),a&&(n=k(n,a,n.hasTime))}return n}function N(e,t,a){let n=I(e);if(t&&Array.isArray(t)){const r=i(n.year,n.month);if(r===n.day||n.weekday===t[t.length-1])while(!t.includes(Number(n.weekday)))n=p(n);n=v(n,t[t.length-1],h),n=g(n),a&&(n=k(n,a,n.hasTime))}return n}function S(e){let t=I(e);return t.day=U,t=g(t),t}function A(e){let t=I(e);return t.day=i(t.year,t.month),t=g(t),t}function L(e){const t=Object.prototype.toString.call(e);switch(t){case"[object Number]":return e;case"[object String]":{const a=q.exec(e);return a?60*parseInt(a[1],10)+parseInt(a[3]||"0",10):!1}case"[object Object]":return"object"!==typeof e||"number"!==typeof e.hour||"number"!==typeof e.minute?!1:"object"===typeof e&&"hour"in e&&"minute"in e&&60*e.hour+e.minute}return!1}function Y(e,t){return!(!e||!t)&&e.year===t.year&&e.month===t.month&&e.day===t.day&&e.hour===t.hour&&e.minute===t.minute}function $(e,t){return c(e)===c(t)}function K(e,t){return y(e)===y(t)}function Z(e,t){return f(e)===f(t)}function We(e,t=null){let a=Fe(e);return a?(a=g(a),t&&(a=k(a,t,a.hasTime)),a):null}function xe(e){return 1e8*(e.year??0)+1e6*(e.month??0)+1e4*(e.day??0)}function l(e){return 100*(e.hour??0)+(e.minute??0)}function n(e){return xe(e)+l(e)}function j(e,t,a=!1){const n=Date.UTC(e.year??0,(e.month??1)-1,e.day??1,e.hour??0,e.minute??0),r=Date.UTC(t.year??0,(t.month??1)-1,t.day??1,t.hour??0,t.minute??0);return!0===a&&r<n?0:r-n}function k(e,t,a=!1){let n=I(e),r=xe(t),o=xe(n),d=r===o;return n.hasTime&&a&&d&&(r=l(t),o=l(n),d=r===o),n.past=o<r,n.current=d,n.future=o>r,n.currentWeekday=n.weekday===t.weekday,n}function P(e,t,a=null){let n=I(e);return n.hasTime=!0,n.hour=Math.floor(t/d.MINUTES_IN.HOUR),n.minute=t%d.MINUTES_IN.HOUR,n.time=y(n),a&&(n=k(n,a,!0)),n}function w(e){let t=I(e);return t.weekday=s(t),t}function z(e){let t=I(e);return t.doy=a(t)||0,t}function Q(e){let t=I(e);return t.workweek=o(t),t}function X(e,t,a,n,r){let o=I(e);const d=xe(o);if(void 0!==t){const s=Fe(t);if(s){const c=xe(s);d<=c&&(o.disabled=!0)}}if(!0!==o.disabled&&void 0!==a){const y=Fe(a);if(y){const f=xe(y);d>=f&&(o.disabled=!0)}}if(!0!==o.disabled&&Array.isArray(n)&&n.length>0)for(var u in n)if(n[u]===o.weekday){o.disabled=!0;break}if(!0!==o.disabled&&Array.isArray(r)&&r.length>0)for(var i in r)if(Array.isArray(r[i])&&2===r[i].length&&r[i][0]&&r[i][1]){const v=Fe(r[i][0]),m=Fe(r[i][1]);if(v&&m&&oe(o,v,m)){o.disabled=!0;break}}else{const h=r[i];if(Array.isArray(h))for(var l of h){const p=We(l);if(p){const k=xe(p);if(k===d){o.disabled=!0;break}}}else if(h){const w=We(h);if(w){const g=xe(w);g===d&&(o.disabled=!0)}}}return o}function g(e){let t=I(e);return t.hasTime=!0,t.time=y(t),t.date=c(t),t.weekday=s(t),t.doy=a(t)||0,t.workweek=o(t),t}function a(e){if(0!==e.year)return(Date.UTC(e.year,e.month-1,e.day)-Date.UTC(e.year,0,0))/24/60/60/1e3}function o(e){let t=I(e);if(0===t.year){const r=We(Me());r&&(t=r)}const a=new Date(Date.UTC(t.year,t.month-1,t.day)),n=4;a.setUTCDate(a.getUTCDate()-(a.getUTCDay()+6)%7+n),a.setUTCDate(a.getUTCDate()+n-(a.getUTCDay()||7));e=new Date(Date.UTC(a.getUTCFullYear(),0,1)),e=Math.ceil(((a.valueOf()-e.valueOf())/864e5+1)/7);return e}function s(e){let t=e.weekday;if(e.hasDay){const a=Math.floor,n=e.day,r=(e.month+9)%x+1,o=a(e.year/100),d=e.year%100-(e.month<=2?1:0);t=((n+a(2.6*r-.2)-2*o+d+a(d/4)+a(o/4))%7+7)%7}return t??0}function I(e){return{...e}}function c(e){let t=r(e.year,4)+"-"+r(e.month,2);return e.hasDay&&(t+="-"+r(e.day,2)),t}function y(e){return e.hasTime?r(e.hour,2)+":"+r(e.minute,2):""}function f(e){return c(e)+" "+(e.hasTime?y(e):"00:00")}function G(e,t=h,a=1,n=[0,1,2,3,4,5,6]){const r=I(e);return _(r,t,a,n)}function _(e,t=h,a=1,n=[0,1,2,3,4,5,6]){let r=I(e);n.includes(Number(r.weekday))||0!==r.weekday||t!==h||++a;while(--a>=0)r=t(r),n.length<7&&!n.includes(Number(r.weekday))&&++a;return r}function v(e,t,a=h,n=6){let r=I(e);while(r.weekday!==t&&--n>=0)r=a(r);return r}function J(e,t,a,n=[0,1,2,3,4,5,6],r=void 0,o=void 0,d=[],u=[],i=42,l=0){const s=xe(e),c=xe(t),y=[];let f=I(e),v=0,m=v===c;if(!(c<s))while((!m||y.length<l)&&y.length<i){if(v=xe(f),m=m||v>c&&y.length>=l,m)break;if(n.includes(Number(f.weekday))){let e=I(f);e=g(e),e=k(e,a),e=X(e,r,o,d,u),y.push(e)}f=_(f,h)}return y}function ee(t,a,n,r,o){const d=[];for(let e=0;e<r;++e){const u=(a+e)*n,i=I(t);d.push(P(i,u,o))}return d}function m(n,r){const e=()=>"";return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?e:(t,e)=>{try{const a=new Intl.DateTimeFormat(n||void 0,r(t,e));return a.format(ae(t))}catch(e){return console.error(`Intl.DateTimeFormat: ${e.message} -> `+f(t)),""}}}function te(e,t=!0){return t?new Date(Date.UTC(e.year,e.month-1,e.day,0,0)):new Date(e.year,e.month-1,e.day,0,0)}function ae(e,t=!0){return t?new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute)):new Date(e.year,e.month-1,e.day,e.hour,e.minute)}function D(e){return isFinite(Number(e))}function ne(e,t=!1){const a=!0===t?n:xe;return e.reduce((e,t)=>{return Math.max(a(e),a(t))===a(e)?e:t})}function re(e,t=!1){const a=!0===t?n:xe;return e.reduce((e,t)=>{return Math.min(a(e),a(t))===a(e)?e:t})}function oe(e,t,a,n=!1){const r=xe(e)+(!0===n?l(e):0),o=xe(t)+(!0===n?l(t):0),d=xe(a)+(!0===n?l(a):0);return r>=o&&r<=d}function de(e,t,a,n){const r=xe(e),o=xe(t),d=xe(a),u=xe(n);return r>=d&&r<=u||o>=d&&o<=u||d>=r&&o>=u}function C(e,t){const a=I(e);return t.year&&(a.year+=t.year),t.month&&(a.month+=t.month),t.day&&(a.day+=t.day),t.hour&&(a.hour+=t.hour),t.minute&&(a.minute+=t.minute),g(ue(a))}function ue(e){const t=new Date(e.year,e.month-1,e.day,e.hour,e.minute);return{...e,year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes()}}function ie(e,t){const a=j(e,t,!0);return Math.floor(a/d.MILLISECONDS_IN.DAY)}function le(e,t){let a=I(e),n=I(t);return a=v(a,0),n=v(n,6),Math.ceil(ie(a,n)/d.DAYS_IN.WEEK)}const se={Sun:new Date("2020-01-05T00:00:00.000Z"),Mon:new Date("2020-01-06T00:00:00.000Z"),Tue:new Date("2020-01-07T00:00:00.000Z"),Wed:new Date("2020-01-08T00:00:00.000Z"),Thu:new Date("2020-01-09T00:00:00.000Z"),Fri:new Date("2020-01-10T00:00:00.000Z"),Sat:new Date("2020-01-11T00:00:00.000Z")};function ce(){const e=()=>"",r={long:{timeZone:"UTC",weekday:"long"},short:{timeZone:"UTC",weekday:"short"},narrow:{timeZone:"UTC",weekday:"narrow"}};return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?e:t;function t(t,e,a){try{const n=new Intl.DateTimeFormat(a||void 0,r[e]||r["long"]);return n.format(se[t])}catch(e){return e instanceof Error&&console.error(`Intl.DateTimeFormat: ${e.message} -> day of week: `+t),""}}}function ye(t,a){const e=Object.keys(se),n=ce();return e.map(e=>String(n(e,t,a)))}function fe(){const e=()=>"",o={long:{timeZone:"UTC",month:"long"},short:{timeZone:"UTC",month:"short"},narrow:{timeZone:"UTC",month:"narrow"}};return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?e:t;function t(t,e,a){try{const n=new Intl.DateTimeFormat(a||void 0,o[e]||o["long"]),r=new Date;return r.setDate(1),r.setMonth(t),n.format(r)}catch(e){return e instanceof Error&&console.error(`Intl.DateTimeFormat: ${e.message} -> month: `+t),""}}}function ve(t,a){const n=fe();return[...Array(12).keys()].map(e=>n(e,t,a))}var e={PARSE_DATETIME:u,PARSE_DATE:b,PARSE_TIME:q,DAYS_IN_MONTH:E,DAYS_IN_MONTH_LEAP:F,DAYS_IN_MONTH_MIN:M,DAYS_IN_MONTH_MAX:W,MONTH_MAX:x,MONTH_MIN:O,DAY_MIN:U,TIME_CONSTANTS:d,FIRST_HOUR:H,today:Me,getStartOfWeek:T,getEndOfWeek:N,getStartOfMonth:S,getEndOfMonth:A,parseTime:L,validateTimestamp:t,parsed:Fe,parseTimestamp:We,parseDate:R,getDayIdentifier:xe,getTimeIdentifier:l,getDayTimeIdentifier:n,diffTimestamp:j,updateRelative:k,updateMinutes:P,updateWeekday:w,updateDayOfYear:z,updateWorkWeek:Q,updateDisabled:X,updateFormatted:g,getDayOfYear:a,getWorkWeek:o,getWeekday:s,isLeapYear:V,daysInMonth:i,copyTimestamp:I,padNumber:r,getDate:c,getTime:y,getDateTime:f,nextDay:h,prevDay:p,relativeDays:_,findWeekday:v,createDayList:J,createIntervalList:ee,createNativeLocaleFormatter:m,makeDate:te,makeDateTime:ae,validateNumber:D,isBetweenDates:oe,isOverlappingDates:de,daysBetween:ie,weeksBetween:le,addToDate:C,compareTimestamps:Y,compareDate:$,compareTime:K,compareDateTime:Z,getWeekdayFormatter:ce,getWeekdayNames:ye,getMonthFormatter:fe,getMonthNames:ve},e=Object.freeze({__proto__:null,DAYS_IN_MONTH:E,DAYS_IN_MONTH_LEAP:F,DAYS_IN_MONTH_MAX:W,DAYS_IN_MONTH_MIN:M,DAY_MIN:U,FIRST_HOUR:H,MONTH_MAX:x,MONTH_MIN:O,PARSE_DATE:b,PARSE_DATETIME:u,PARSE_TIME:q,TIME_CONSTANTS:d,addToDate:C,compareDate:$,compareDateTime:Z,compareTime:K,compareTimestamps:Y,copyTimestamp:I,createDayList:J,createIntervalList:ee,createNativeLocaleFormatter:m,daysBetween:ie,daysInMonth:i,default:e,diffTimestamp:j,findWeekday:v,getDate:c,getDateTime:f,getDayIdentifier:xe,getDayOfYear:a,getDayTimeIdentifier:n,getEndOfMonth:A,getEndOfWeek:N,getMonthFormatter:fe,getMonthNames:ve,getStartOfMonth:S,getStartOfWeek:T,getTime:y,getTimeIdentifier:l,getWeekday:s,getWeekdayFormatter:ce,getWeekdayNames:ye,getWorkWeek:o,isBetweenDates:oe,isLeapYear:V,isOverlappingDates:de,isToday:B,makeDate:te,makeDateTime:ae,maxTimestamp:ne,minTimestamp:re,moveRelativeDays:G,nextDay:h,padNumber:r,parseDate:R,parseTime:L,parseTimestamp:We,parsed:Fe,prevDay:p,relativeDays:_,today:Me,updateDayOfYear:z,updateDisabled:X,updateFormatted:g,updateMinutes:P,updateRelative:k,updateWeekday:w,updateWorkWeek:Q,validateNumber:D,validateTimestamp:t,weeksBetween:le});function Oe(e,t="px"){if(e)return isNaN(e)?String(e):"auto"===e?e:""+Number(e)+t}function me(t,a){for(let e=0;e<t.length;e++)if(!0===a(t[e],e))return e;return-1}function He(e,t){return 0===t?e:e.slice(0,t)}var he={convertToUnit:Oe,indexOf:me,minCharWidth:He},he=Object.freeze({__proto__:null,convertToUnit:Oe,default:he,indexOf:me,minCharWidth:He});const pe=e=>e.replace(/(-\w)/g,e=>e[1].toUpperCase());function ke(t,e,a,n){const r={};for(const o in a){const d=a[o],u=pe("on-"+o);if(!e.value)return console.warn("$listeners has not been set up"),{};if(void 0!==e.value[u]){const i="on"+d.event.charAt(0).toUpperCase()+d.event.slice(1),l=e=>{return(void 0===d.button||"buttons"in e&&e.buttons>0&&e.button===d.button)&&(d.prevent&&e.preventDefault(),d.stop&&e.stopPropagation(),t(o,n(e,o))),d.result};i in r?Array.isArray(r[i])?r[i].push(l):r[i]=[r[i],l]:r[i]=l}}return r}function we(e,t,a,n){return ke(e,t,ge(a),n)}function ge(e){return{["click"+e]:{event:"click"},["contextmenu"+e]:{event:"contextmenu",prevent:!0,result:!1},["mousedown"+e]:{event:"mousedown"},["mousemove"+e]:{event:"mousemove"},["mouseup"+e]:{event:"mouseup"},["mouseenter"+e]:{event:"mouseenter"},["mouseleave"+e]:{event:"mouseleave"},["touchstart"+e]:{event:"touchstart"},["touchmove"+e]:{event:"touchmove"},["touchend"+e]:{event:"touchend"}}}function _e(e){return Object.keys(ge(e))}function Re(a,n){return{getMouseEventHandlers:(e,t)=>ke(a,n,e,t),getDefaultMouseEventHandlers:(e,t)=>we(a,n,e,t),getMouseEventName:ge,getRawMouseEvents:_e}}const Ve={mounted(e,t){if("function"===typeof t.value){const a=t.value,n={callback:a,size:{width:0,height:0},observer:new ResizeObserver(e=>{const t=e[0].contentRect;t.width===n.size.width&&t.height===n.size.height||(n.size.width=t.width,n.size.height=t.height,n.debounceTimeout&&clearTimeout(n.debounceTimeout),n.debounceTimeout=setTimeout(()=>{n.callback(n.size),n.debounceTimeout=void 0},100))})};n.observer.observe(e),e.__onResizeObserver=n}},beforeUnmount(e){if(e.__onResizeObserver){const{observer:t,debounceTimeout:a}=e.__onResizeObserver;a&&clearTimeout(a),t.unobserve(e),delete e.__onResizeObserver}}};function Be(t,a,{scrollArea:e,pane:n}){if(!a){const s="[error: renderCalendar] no renderFunc has been supplied to useCalendar";throw console.error(s),new Error(s)}const r=Ee.reactive({width:0,height:0}),o=Ee.ref(null);function d({width:e,height:t}){r.width=e,r.height=t}const u=Ee.computed(()=>{return!0!==t.noScroll&&e.value&&n.value&&r.height?e.value.offsetWidth-n.value.offsetWidth:0});function i(){}function l(){const e={ref:o,role:"complementary",lang:t.locale,class:`q-calendar ${t.dark?"q-calendar--dark":""} `+(t.bordered?"q-calendar__bordered":"")};return Ee.withDirectives(Ee.h("div",{...e},[a()]),[[Ve,d]])}return{rootRef:o,scrollWidth:u,__initCalendar:i,__renderCalendar:l}}const De=e=>e.every(e=>["day","date","weekday","interval","time","resource","task"].includes(e)),be={modelValue:{type:String,default:Me(),validator:e=>""===e||t(e)},weekdays:{type:Array,default:()=>[0,1,2,3,4,5,6]},dateType:{type:String,default:"round",validator:e=>["round","rounded","square"].includes(e)},weekdayAlign:{type:String,default:"center",validator:e=>["left","center","right"].includes(e)},dateAlign:{type:String,default:"center",validator:e=>["left","center","right"].includes(e)},bordered:Boolean,dark:Boolean,noAria:Boolean,noActiveDate:Boolean,noHeader:Boolean,noScroll:Boolean,shortWeekdayLabel:Boolean,noDefaultHeaderText:Boolean,noDefaultHeaderBtn:Boolean,minWeekdayLabel:{type:[Number,String],default:1},weekdayBreakpoints:{type:Array,default:()=>[75,35],validator:e=>2===e.length},locale:{type:String,default:"en-US"},animated:Boolean,transitionPrev:{type:String,default:"slide-right"},transitionNext:{type:String,default:"slide-left"},disabledDays:Array,disabledBefore:String,disabledAfter:String,disabledWeekdays:{type:Array,default:()=>[]},dragEnterFunc:Function,dragOverFunc:Function,dragLeaveFunc:Function,dropFunc:Function,selectedDates:{type:[Array,Set],default:()=>[]},selectedStartEndDates:{type:Array,default:()=>[]},hoverable:Boolean,focusable:Boolean,focusType:{type:Array,default:()=>["date"],validator:De}};function Le(t,{startDate:e,endDate:a,times:n}){const r=Ee.computed(()=>We(e.value)),o=Ee.computed(()=>{return"0000-00-00"===a.value?N(r.value,t.weekdays,n.today):We(a.value)||r.value}),d=Ee.computed(()=>m(t.locale,()=>({timeZone:"UTC",day:"numeric"}))),u=Ee.computed(()=>m(t.locale,(e,t)=>({timeZone:"UTC",weekday:t?"short":"long"}))),i=Ee.computed(()=>m(t.locale,()=>({timeZone:"UTC",dateStyle:"full"})));function l(e,t){return e&&e.length>0&&e.includes(t.date)}function s(e,t){const a={firstDay:!1,betweenDays:!1,lastDay:!1};if(2===e.length){const n=xe(t),r=xe(Fe(e[0])),o=xe(Fe(e[1]));a.firstDay=r===n,a.lastDay=o===n,a.betweenDays=r<n&&o>n}return a}function c(e,t=!1,a=[],n=[],r=!1){const o=l(a,e),{firstDay:d,lastDay:u,betweenDays:i}=s(n,e);return{"q-past-day":!d&&!i&&!u&&!o&&!t&&!!e.past,"q-future-day":!d&&!i&&!u&&!o&&!t&&!!e.future,"q-outside":t,"q-current-day":!!e.current,"q-selected":o,"q-range-first":d,"q-range":i,"q-range-last":u,"q-range-hover":r&&(d||u||i),"q-disabled-day disabled":!0===e.disabled}}function y(e){return T(e,t.weekdays,n.today)}function f(e){return N(e,t.weekdays,n.today)}function v(){return{}}return{parsedStart:r,parsedEnd:o,dayFormatter:d,weekdayFormatter:u,ariaDateFormatter:i,arrayHasDate:l,checkDays:s,getRelativeClasses:c,startOfWeek:y,endOfWeek:f,dayStyleDefault:v}}const Te={modelValue:{type:String,default:Me(),validator:e=>""===e||t(e)},modelTasks:{type:Array,default:()=>[]},modelTitle:{type:Array,default:()=>[]},modelFooter:{type:Array,default:()=>[]},taskKey:{type:[String,Number],default:"id"},weekdays:{type:Array,default:()=>[0,1,2,3,4,5,6]},dateType:{type:String,default:"round",validator:e=>["round","rounded","square"].includes(e)},dateHeader:{type:String,default:"stacked",validator:e=>["stacked","inline","inverted"].includes(e)},weekdayAlign:{type:String,default:"center",validator:e=>["left","center","right"].includes(e)},dateAlign:{type:String,default:"center",validator:e=>["left","center","right"].includes(e)},dayHeight:{type:[Number,String],default:0,validator:D},dayMinHeight:{type:[Number,String],default:40,validator:D},weekdayStyle:{type:Function,default:null},weekdayClass:{type:Function,default:null},dayStyle:{type:Function,default:null},dayClass:{type:Function,default:null},footerDayClass:{type:Function,default:null},view:{type:String,validator:e=>["day","week","month"].includes(e)},viewCount:{type:Number,default:1,validator:e=>D(e)&&e>0},taskWidth:{type:Number,default:200,validator:e=>D(e)&&e>0}};function Ye(t,e,{times:a}){const n=Ee.computed(()=>{if(!t.modelValue)throw new Error("QCalendarTask: no modelValue provided");if("day"===t.view)return We(t.modelValue);if("week"===t.view)return T(We(t.modelValue),t.weekdays,a.today);if("month"===t.view)return S(We(t.modelValue));throw new Error(`QCalendarTask: unknown 'view' type (${t.view})`)}),r=Ee.computed(()=>{if(!t.modelValue)throw new Error("QCalendarTask: no modelValue provided");if("day"===t.view){if(1===t.viewCount)return n.value;let e=I(n.value);return e=C(e,{day:t.viewCount-1}),e}if("week"===t.view){if(1===t.viewCount)return N(We(t.modelValue),t.weekdays,a.today);{let e=I(n.value);return e=C(e,{day:(t.viewCount-1)*d.DAYS_IN.WEEK}),N(e,t.weekdays,a.today)}}if("month"!==t.view)throw new Error(`QCalendarTask: unknown 'view' type (${t.view})`);if(1===t.viewCount)return A(We(t.modelValue));{let e=I(n.value);return e=C(e,{month:t.viewCount}),A(e)}}),o=Ee.computed(()=>{return J(n.value,r.value,a.today,t.weekdays,t.disabledBefore,t.disabledAfter,t.disabledWeekdays||[],t.disabledDays||[],Number.MAX_SAFE_INTEGER)});return{days:o,parsedStartDate:n,parsedEndDate:r}}const Ne={now:{type:String,validator:e=>""===e||t(e),default:""}};function $e(e){const t=Ee.reactive({now:We("0000-00-00 00:00"),today:We("0000-00-00")}),a=Ee.computed(()=>e.now?We(e.now):o());function n(){t.now&&t.today&&(t.now.current=t.today.current=!0,t.now.past=t.today.past=!1,t.now.future=t.today.future=!1)}function r(){const e=a.value||o();d(e,t.now),u(e,t.now),d(e,t.today)}function o(){return R(new Date)}function d(e,t){e.date!==t.date&&(t.year=e.year,t.month=e.month,t.day=e.day,t.weekday=e.weekday,t.date=e.date)}function u(e,t){e.time!==t.time&&(t.hour=e.hour,t.minute=e.minute,t.time=e.time)}return Ee.watch(a,()=>r()),{times:t,parsedNow:a,setCurrent:n,updateCurrent:r,getNow:o,updateDay:d,updateTime:u}}function Ke(r,{parsedView:o,parsedValue:d,times:u}){const e=Ee.computed(()=>{const e=d.value;let t=r.maxDays,a=e,n=e;switch(o.value){case"month":a=S(e),n=A(e),t=i(a.year,a.month);break;case"week":case"week-agenda":case"week-scheduler":a=T(e,r.weekdays,u.today),n=N(a,r.weekdays,u.today),t=r.weekdays.length;break;case"day":case"scheduler":case"agenda":n=G(I(n),h,t>1?t-1:t,r.weekdays),n=g(n);break;case"month-interval":case"month-scheduler":case"month-agenda":a=S(e),n=A(e),n=g(n),t=i(a.year,a.month);break;case"resource":t=1,n=G(I(n),h,t,r.weekdays),n=g(n);break}return{start:a,end:n,maxDays:t}});return{renderValues:e}}const Se=["moved"];function Ze(i,{parsedView:l,parsedValue:s,direction:c,maxDays:y,times:f,emittedValue:v,emit:m}){function e(a=1){if(0===a)v.value=Me();else{let e=I(s.value);const n=A(e),r=a>0,o=r?h:p,d=r?n.day:1;let t=r?a:-a;c.value=r?"next":"prev";const u=i.weekdays.length;while(--t>=0)switch(l.value){case"month":e.day=d,e=o(e),e=w(e);while(!i.weekdays.includes(Number(e.weekday)))e=C(e,{day:r?1:-1});break;case"week":case"week-agenda":case"week-scheduler":e=_(e,o,u,i.weekdays);break;case"day":case"scheduler":case"agenda":e=_(e,o,y.value,i.weekdays);break;case"month-interval":case"month-agenda":case"month-scheduler":e.day=d,e=o(e);break;case"resource":e=_(e,o,y.value,i.weekdays);break}e=w(e),e=g(e),e=z(e),e=k(e,f.now),v.value=e.date,m("moved",e)}}return{move:e}}const Ae=/^on[A-Z]/;function je(e=Ee.getCurrentInstance()){return{emitListeners:Ee.computed(()=>{const t={};return e?.vnode?.props&&Object.keys(e.vnode.props).forEach(e=>{Ae.test(e)&&(t[e]=!0)}),t})}}function Ue(){const e={"aria-hidden":"true",class:"q-calendar__focus-helper"};return[Ee.h("span",e)]}function Ie(){function e({focusable:e,focusType:t},a,n){const r=e&&t.includes("date");return Ee.h("button",{...a,tabindex:r?0:-1},[n,r&&Ue()])}return{renderButton:e}}const Ce=["change"];function Pe(n,{days:r,lastStart:o,lastEnd:d}){function e(){const e=r.value;if(0===e.length)return!1;const t=e[0].date,a=e[e.length-1].date;return(!o.value||!d.value||t!==o.value||a!==d.value)&&(o.value=t,d.value=a,n("change",{start:t,end:a,days:e}),!0)}return{checkChange:e}}function ze(){function e(e,t){return(Array.isArray(t)?t:[t]).includes(e.keyCode)}return{isKeyCode:e}}const qe=ze().isKeyCode,Qe={useNavigation:Boolean};function Xe(t,{rootRef:a,focusRef:n,focusValue:r,datesRef:o,parsedView:d,emittedValue:u,direction:i,times:l}){let e=!1;function s(){e||document&&(e=!0,document.addEventListener("keyup",m),document.addEventListener("keydown",v))}function c(){document&&(document.removeEventListener("keyup",m),document.removeEventListener("keydown",v),e=!1)}function y(e){if(e&&document){const t=document.activeElement;if(t!==document.body&&a.value?.contains(t))return!0}return!1}function f(){let t=0;const a=window.setInterval(()=>{const e=o.value[n.value];e&&(e.focus(),50!==++t)&&document.activeElement!==e||window.clearInterval(a)},250)}function v(e){y(e)&&qe(e,[33,34,35,36,37,38,39,40])&&(e.stopPropagation(),e.preventDefault())}function m(e){if(y(e)&&qe(e,[33,34,35,36,37,38,39,40])){const t={33:g,34:_,35:b,36:D,37:k,38:h,39:w,40:p};t[e.keyCode]?.()}}function h(){let e=I(r.value);if("month"===d.value){if(e=C(e,{day:-7}),r.value.month!==e.month)return i.value="prev",void(u.value=e.date)}else e=C(e,{minute:Number(t.intervalMinutes)});i.value="prev",n.value=e.date}function p(){let e=I(r.value);if("month"===d.value){if(e=C(e,{day:7}),r.value.month!==e.month)return i.value="next",void(u.value=e.date)}else e=C(e,{minute:Number(t.intervalMinutes)});i.value="next",n.value=e.date}function k(){let e=I(r.value);i.value="prev";do{e=C(e,{day:-1})}while(!t.weekdays.includes(Number(e.weekday)));n.value=e.date}function w(){let e=I(r.value);i.value="next";do{e=C(e,{day:1})}while(!t.weekdays.includes(Number(e.weekday)));n.value=e.date}function g(){let e=I(r.value);e="month"===d.value?C(e,{month:-1}):C(e,{day:-7}),i.value="prev",n.value=e.date}function _(){let e=I(r.value);e="month"===d.value?C(e,{month:1}):C(e,{day:7}),i.value="next",n.value=e.date}function D(){let e=I(r.value);e="month"===d.value?S(e):T(e,t.weekdays||[],l.today);while(!t.weekdays.includes(Number(e.weekday)))e=C(e,{day:-1});n.value=e.date}function b(){let e=I(r.value);e="month"===d.value?A(e):N(e,t.weekdays||[],l.today);while(!t.weekdays.includes(Number(e.weekday)))e=C(e,{day:-1});n.value=e.date}return Ee.onBeforeUnmount(()=>{c()}),Ee.watch(()=>t.useNavigation,e=>{(!0===e?s:c)()}),!0===t.useNavigation&&s(),{startNavigation:s,endNavigation:c,tryFocus:f}}const Ge={cellWidth:[Number,String]},Je=Ie().renderButton;var et=Ee.defineComponent({name:"QCalendarTask",directives:{ResizeObserver:Ve},props:{...Ne,...Qe,...Ge,...be,...Te},emits:["update:model-value","update:model-tasks","update:model-title","update:model-footer","task-expanded",...Ce,...Se,..._e("-date"),..._e("-day"),..._e("-head-day")],setup(c,{slots:y,emit:l,expose:O}){const e=Ee.ref(null),U=Ee.ref(null),o=Ee.ref("next"),d=Ee.ref(c.modelValue||Me()),u=Ee.ref("0000-00-00"),t=Ee.ref(0),f=Ee.ref(c.modelValue),v=Ee.ref(c.modelValue||Me()),a=Ee.ref(Fe(c.modelValue||Me())),m=Ee.ref({}),i=Ee.reactive({width:0,height:0}),h=Ee.ref(""),p=Ee.ref(""),H=Ee.ref(null),R=Ee.ref(null),n=(Ee.watch(()=>c.view,()=>{t.value=0}),Ee.computed(()=>{return"month"===c.view?"month-interval":c.view})),r=Ee.getCurrentInstance();if(null===r)throw new Error("current instance is null");const s=je(r).emitListeners,{times:k,setCurrent:V,updateCurrent:w}=$e(c),{parsedStart:B,dayFormatter:L,weekdayFormatter:Y,ariaDateFormatter:$,dayStyleDefault:g,getRelativeClasses:_}=(w(),V(),Le(c,{startDate:d,endDate:u,times:k})),D=Ee.computed(()=>{return We(c.modelValue,k.now)||B.value||k.today}),K=(a.value=D.value,v.value=D.value.date,Ke(c,{parsedView:n,times:k,parsedValue:D})).renderValues,{rootRef:Z,__renderCalendar:j}=Be(c,qe,{scrollArea:e,pane:U}),{days:b,parsedStartDate:T,parsedEndDate:N}=Ye(c,l,{times:k}),S=Ze(c,{parsedView:n,parsedValue:D,direction:o,maxDays:t,times:k,emittedValue:f,emit:l}).move,A=Re(l,s).getDefaultMouseEventHandlers,P=Pe(l,{days:b,lastStart:H,lastEnd:R}).checkChange,I=ze().isKeyCode,z=Xe(c,{rootRef:Z,focusRef:v,focusValue:a,datesRef:m,parsedView:n,emittedValue:f,direction:o,times:k}).tryFocus,C=Ee.ref(!0),q=Ee.computed(()=>{return void 0!==c.cellWidth?parseInt(String(c.cellWidth),10):150}),E=Ee.computed(()=>{return!0===c.focusable&&c.focusType.includes("day")}),Q=Ee.computed(()=>{return!0===c.focusable&&c.focusType.includes("date")&&!0!==E.value}),F=Ee.computed(()=>{return!0===c.focusable&&c.focusType.includes("weekday")}),X=Ee.computed(()=>{return parseInt(String(c.dayHeight),10)}),G=Ee.computed(()=>{return parseInt(String(c.dayMinHeight),10)});function J(){f.value=Me()}function ee(e=1){S(e)}function te(e=1){S(-e)}function ae({width:e,height:t}){i.width=e,i.height=t}function M(e){return e.date===f.value}function ne(e,t,a){const n=y.day,r=c.dayStyle||g,o=!0!==c.noActiveDate&&D.value.date===e.date,d=t[c.taskKey],u={timestamp:e,task:t,taskIndex:a,activeDate:o,droppable:p.value===d},i=Oe(q.value),l={width:i,minWidth:i,maxWidth:i,...r({scope:u})},s="function"===typeof c.dayClass?c.dayClass({scope:u}):{};return Ee.h("div",{tabindex:!0===E.value?0:-1,class:{"q-calendar-task__task--day":!0,...s,..._(e),"q-active-date":!0===o,"q-calendar__hoverable":!0===c.hoverable,"q-calendar__focusable":!0===E.value},style:l,onFocus:()=>{E.value},...A("-day",e=>{return{scope:u,event:e}}),onDragenter:e=>{void 0!==c.dragEnterFunc&&"function"===typeof c.dragEnterFunc&&(!0===c.dragEnterFunc(e,"day",{scope:u})?p.value=d:p.value="")},onDragover:e=>{void 0!==c.dragOverFunc&&"function"===typeof c.dragOverFunc&&(!0===c.dragOverFunc(e,"day",{scope:u})?p.value=d:p.value="")},onDragleave:e=>{void 0!==c.dragLeaveFunc&&"function"===typeof c.dragLeaveFunc&&(!0===c.dragLeaveFunc(e,"day",{scope:u})?p.value=d:p.value="")},onDrop:e=>{void 0!==c.dropFunc&&"function"===typeof c.dropFunc&&(!0===c.dropFunc(e,"day",{scope:u})?p.value=d:p.value="")}},[n&&n({scope:u}),Ue()])}function re(t,a){return b.value.map(e=>ne(e,t,a))}function oe(e,t){const a=y.days,n={timestamps:b.value,days:b.value,task:e,taskIndex:t,cellWidth:q.value};return Ee.h("div",{class:"q-calendar-task__task--days-row"},[re(e,t),a&&a({scope:n})])}function de(t,e,a=0,n=!0){const r=0===a?y.task:y.subtask,o={start:T.value,end:N.value,task:t,taskIndex:e,expanded:n},d=Oe(c.taskWidth),u={width:d,minWidth:d,maxWidth:d},i=!0===c.focusable&&c.focusType.includes("task");return Ee.h("div",{class:{"q-calendar-task__task--item":!0,"q-calendar__sticky":!0===C.value,"q-calendar__hoverable":!0===c.hoverable,"q-calendar__focusable":!0===i},style:u},[Ee.h("div",{style:{flexDirection:"column",justifyContent:"center",alignItems:"center",width:10+10*a+"px"}},[Ee.h("div",{class:{"q-calendar__parent":void 0!==t.children,"q-calendar__parent--expanded":void 0!==t.children&&!0===t.expanded,"q-calendar__parent--collapsed":void 0!==t.children&&!0!==t.expanded},onClick:e=>{e.stopPropagation(),t.expanded=!t.expanded,l("task-expanded",{expanded:t.expanded,scope:o})}})]),r&&r({scope:o}),Ue()])}function ue(e,t,a=0,n=!0){const r=void 0!==e.height?Oe(parseInt(e.height,10)):X.value>0?Oe(X.value):"auto",o=G.value>0?Oe(G.value):void 0,d={height:r},u=(void 0!==o&&(d.minHeight=o),Ee.h("div",{key:e[c.taskKey]+"-"+t,class:{"q-calendar-task__task":0===a,"q-calendar-task__task--section":0!==a},style:d},[de(e,t,a,n),oe(e,t)]));return void 0!==e.children?[u,Ee.h("div",{class:{"q-calendar__child":!0,"q-calendar__child--expanded":!0===n,"q-calendar__child--collapsed":!0!==n}},[ie(e.children,a+1,!1===n?n:e.expanded)])]:[u]}function ie(e=void 0,a=0,n=!0){return void 0===e&&(e=c.modelTasks),e.map((e,t)=>{return ue(e,t,a,void 0!==e.children?e.expanded:n)}).flat()}function le(){return Ee.h("div",{class:{"q-calendar-task__task--container":!0,"q-calendar__sticky":!0===C.value}},[ie()])}function se(e,t){const a=y["footer-task"],n={start:T.value,end:N.value,footer:e,index:t},r=Oe(c.taskWidth),o={width:r,minWidth:r,maxWidth:r};return Ee.h("div",{class:{"q-calendar-task__footer--task":!0,"q-calendar__sticky":!0===C.value},style:o},[a&&a({scope:n})])}function ce(e,t,a){const n=y["footer-day"],r={timestamp:e,footer:t,index:a},o=Oe(q.value),d={width:o,minWidth:o,maxWidth:o},u="function"===typeof c.footerDayClass?c.footerDayClass({scope:r}):{};return Ee.h("div",{class:{"q-calendar-task__footer--day":!0,...u,..._(e),"q-calendar__hoverable":!0===c.hoverable,"q-calendar__focusable":!0===E.value},style:d},[n&&n({scope:r})])}function ye(t,a){return Ee.h("div",{class:"q-calendar-task__footer--day-wrapper"},[b.value.map(e=>ce(e,t,a))])}function fe(){const a=!0===c.focusable&&c.focusType.includes("task");return c.modelFooter.map((e,t)=>{return Ee.h("div",{class:{"q-calendar-task__footer--wrapper":!0,"q-calendar__hoverable":!0===c.hoverable,"q-calendar__focusable":!0===a}},{default:()=>[se(e,t),ye(e,t)]})})}function ve(){return Ee.h("div",{class:{"q-calendar-task__footer":!0,"q-calendar__sticky":!0===C.value}},fe())}function me(){return Ee.h("div",{class:{"q-calendar-task__container":!0}},[!0!==c.noHeader&&Ae(),le(),ve()])}function he(){const e=y["head-tasks"],t={start:T.value,end:N.value},a=Oe(parseInt(String(c.taskWidth),10)),n={width:a,minWidth:a,maxWidth:a};return Ee.h("div",{class:{"q-calendar-task__head--tasks":!0,"q-calendar__sticky":!0===C.value},style:n},[e&&e({scope:t})])}function pe(e,t){const a=y["title-task"],n=Oe(parseInt(String(c.taskWidth),10)),r={width:n,minWidth:n,maxWidth:n},o={start:T.value,end:N.value,cellWidth:n,title:e,index:t};return Ee.h("div",{class:{"q-calendar-task__title--task":!0,"q-calendar__sticky":!0===C.value},style:r},[a&&a({scope:o})])}function W(e){const t=y["head-weekday-label"],a=!0!==c.noActiveDate&&M(e),n={activeDate:a,timestamp:e,disabled:!!c.disabledWeekdays&&c.disabledWeekdays.includes(Number(e.weekday))},r={class:{"q-calendar-task__head--weekday":!0,["q-calendar__"+c.weekdayAlign]:!0,"q-calendar__ellipsis":!0}};return Ee.h("div",r,t&&t({scope:n})||ke(e,c.shortWeekdayLabel))}function ke(e,t){const a=Y.value(e,t||c.weekdayBreakpoints[0]>0&&q.value<=c.weekdayBreakpoints[0]);return Ee.h("span",{class:"q-calendar__ellipsis"},c.weekdayBreakpoints[1]>0&&q.value<=c.weekdayBreakpoints[1]?He(a,Number(c.minWeekdayLabel)):a)}function x(e){const t={class:{"q-calendar-task__head--date":!0,["q-calendar__"+c.dateAlign]:!0}};return Ee.h("div",t,we(e))}function we(a){const e=!0!==c.noActiveDate&&M(a),t=L.value(a,!1),n=y["head-day-label"],r=y["head-day-button"],o={dayLabel:t,timestamp:a,activeDate:e},d=a.date,u={key:d,tabindex:!0===Q.value?0:-1,class:{"q-calendar-task__head--day__label":!0,"q-calendar__button":!0,"q-calendar__button--round":"round"===c.dateType,"q-calendar__button--rounded":"rounded"===c.dateType,"q-calendar__button--bordered":!0===a.current,"q-calendar__hoverable":!0===c.hoverable,"q-calendar__focusable":!0===Q.value},disabled:a.disabled,onKeydown:e=>{!0!==a.disabled&&I(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{!0!==a.disabled&&I(e,[13,32])&&(f.value=a.date,void 0!==s.value.onClickDate)&&l("click-date",{scope:o})},...A("-date",(e,t)=>{return"click-date"!==t&&"contextmenu-date"!==t||(f.value=a.date,"click-date"===t&&e.preventDefault()),{scope:o,event:e}})};return!0!==c.noAria&&(u.ariaLabel=$.value(a,!1)),r?r({scope:o}):Je(c,u,n?n({scope:o}):t)}function ge(e){return"stacked"===c.dateHeader?[!0!==c.noDefaultHeaderText&&W(e),!0!==c.noDefaultHeaderBtn&&x(e)].filter(e=>!1!==e):"inline"===c.dateHeader?("left"===c.weekdayAlign&&"right"===c.dateAlign||"right"===c.weekdayAlign&&c.dateAlign,Ee.h("div",{class:"q-calendar__header--inline"},[!0!==c.noDefaultHeaderText&&W(e),!0!==c.noDefaultHeaderBtn&&x(e)])):"inverted"===c.dateHeader?("left"===c.weekdayAlign&&"right"===c.dateAlign||"right"===c.weekdayAlign&&c.dateAlign,Ee.h("div",{class:"q-calendar__header--inline"},[!0!==c.noDefaultHeaderBtn&&x(e),!0!==c.noDefaultHeaderText&&W(e)])):void 0}function _e(e,t,a){const n=y["title-day"],r=Oe(q.value),o={width:r,minWidth:r,maxWidth:r},d={timestamp:e,title:t,index:a,cellWidth:q.value},u="function"===typeof c.dayClass?c.dayClass({scope:d}):{},i=!0===c.focusable&&c.focusType.includes("day");return Ee.h("div",{class:{"q-calendar-task__title--day":!0,...u,..._(e),"q-calendar__hoverable":!0===c.hoverable,"q-calendar__focusable":!0===i},style:o},[n&&n({scope:d}),Ue()])}function De(t){const e=y["head-day"],a=y["head-date"],n=!0!==c.noActiveDate&&M(t),r={timestamp:t,activeDate:n,droppable:h.value=t.date,disabled:!!c.disabledWeekdays&&c.disabledWeekdays.includes(Number(t.weekday))},o=c.weekdayStyle||g,d="function"===typeof c.weekdayClass?c.weekdayClass({scope:r}):{},u=Oe(q.value),i={width:u,minWidth:u,maxWidth:u,...o({scope:r})},l=t.date,s={key:l,ref:e=>{m.value[l]=e},tabindex:!0===F.value?0:-1,class:{"q-calendar-task__head--day":!0,...d,..._(t),"q-active-date":n,"q-calendar__hoverable":!0===c.hoverable,"q-calendar__focusable":!0===F.value},style:i,onFocus:()=>{!0===F.value&&(v.value=l)},onKeydown:e=>{!0!==t.disabled&&I(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{!0!==t.disabled&&I(e,[13,32])&&(f.value=t.date)},...A("-head-day",e=>{return{scope:r,event:e}}),onDragenter:e=>{void 0!==c.dragEnterFunc&&"function"===typeof c.dragEnterFunc&&(!0===c.dragEnterFunc(e,"head-day",{scope:r})?h.value=t.date:h.value="")},onDragover:e=>{void 0!==c.dragOverFunc&&"function"===typeof c.dragOverFunc&&(!0===c.dragOverFunc(e,"head-day",{scope:r})?h.value=t.date:h.value="")},onDragleave:e=>{void 0!==c.dragLeaveFunc&&"function"===typeof c.dragLeaveFunc&&(!0===c.dragLeaveFunc(e,"head-day",{scope:r})?h.value=t.date:h.value="")},onDrop:e=>{void 0!==c.dropFunc&&"function"===typeof c.dropFunc&&(!0===c.dropFunc(e,"head-day",{scope:r})?h.value=t.date:h.value="")}};return Ee.h("div",s,[void 0!==e&&e({scope:r}),void 0===e&&ge(t),void 0===e&&a&&a({scope:r}),Ue()])}function be(){return b.value.map(e=>De(e))}function Te(t,a){return b.value.map(e=>_e(e,t,a))}function Ne(){return Ee.h("div",{class:{"q-calendar-task__head--days":!0}},[...be()])}function Se(e,t){return Ee.h("div",{class:{"q-calendar-task__title--days":!0}},[...Te(e,t)])}function Ae(){return Ee.h("div",{roll:"presentation",class:{"q-calendar-task__head":!0,"q-calendar__sticky":!0===C.value},style:{}},[Ee.h("div",{style:{position:"relative",display:"flex"}},[he(),Ne()]),c.modelTitle.map((e,t)=>Ee.h("div",{class:"q-calendar-task__title",style:{position:"relative",display:"flex"}},[pe(e,t),Se(e,t)]))])}function Ie(){return Ee.h("div",{class:"q-calendar-task__body"},[Ce()])}function Ce(){return Ee.h("div",{ref:e,class:{"q-calendar-task__scroll-area":!0,"q-calendar__scroll":!0}},[me()])}function qe(){const{start:e,end:t}=K.value,a=(d.value=e.date,u.value=t.date,i.width>0),n=Ee.withDirectives(Ee.h("div",{key:d.value,class:"q-calendar-task"},[!0===a&&Ie()]),[[Ve,ae]]);if(!0!==c.animated)return n;{const r="q-calendar--"+("prev"===o.value?c.transitionPrev:c.transitionNext);return Ee.h(Ee.Transition,{name:r,appear:!0},()=>n)}}return Ee.watch([b],P,{deep:!0,immediate:!0}),Ee.watch(()=>c.modelValue,(e,t)=>{if(f.value!==e){if(!0===c.animated){const a=xe(Fe(e)),n=xe(Fe(t));o.value=a>=n?"next":"prev"}f.value=e}v.value=e}),Ee.watch(f,(e,t)=>{if(f.value!==c.modelValue){if(!0===c.animated){const a=xe(Fe(e)),n=xe(Fe(t));o.value=a>=n?"next":"prev"}l("update:model-value",e)}}),Ee.watch(v,e=>{e&&(a.value=We(e))}),Ee.watch(a,()=>{m.value[v.value]?m.value[v.value].focus():z()}),Ee.onBeforeUpdate(()=>{m.value={}}),Ee.onMounted(()=>{}),O({prev:te,next:ee,move:S,moveToToday:J,updateCurrent:w}),()=>j()}});const tt="4.1.2";e={version:tt,QCalendarTask:et,...e,...he,install(e){e.component(String(et.name),et)}};return e});