import{j as C,k as I,l as m,aK as k,p as l,a2 as c,B as p,s as g,c4 as _,t as f,aq as $,aV as B,bO as N,w as O,H as q,C as h,F as E,q as Y,P as V,bC as T,bD as F}from"./dashboard-practitioner-b373edf1.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e5c262fb-28ff-4ec6-bb6d-3a4caa2f4ac0",e._sentryDebugIdIdentifier="sentry-dbid-e5c262fb-28ff-4ec6-bb6d-3a4caa2f4ac0")}catch{}})();const H=C({name:"meetingsDisplay",props:{meetingSlot:{type:Object,required:!0},meetingSlotSelected:{type:[Array,Object,null],required:!0},meetingButtonClass:{type:String,default:""},meetingEmptyClass:{type:String,default:""}},emits:["meeting-slot-click"],setup(e,t){const a=m(()=>{const n=new Date(e.meetingSlot.date),i=n.getHours()<10?`0${n.getHours()}`:n.getHours(),o=n.getMinutes()<10?`0${n.getMinutes()}`:n.getMinutes();return`${i}:${o}`}),s=m(()=>{if(Array.isArray(e.meetingSlotSelected)){const n=new Date(e.meetingSlot.date).getTime();for(const i of e.meetingSlotSelected)if(new Date(i.date).getTime()===n)return!0;return!1}if(e.meetingSlotSelected&&e.meetingSlotSelected.date){const n=new Date(e.meetingSlotSelected.date),i=new Date(e.meetingSlot.date);return n.getTime()===i.getTime()}return!1});return{meetingClass:m(()=>({[e.meetingButtonClass]:!0,"meeting__button--selected":s.value})),time:a,meetingSlotClick:()=>{t.emit("meeting-slot-click",e.meetingSlot)}}}}),S=(e,t)=>{const a=e.__vccOpts||e;for(const[s,n]of t)a[s]=n;return a},J={class:"meeting"},U=["disabled"];function z(e,t,a,s,n,i){return l(),c("div",J,[e.meetingSlot.date?(l(),c("button",{key:0,type:"button",class:g(["meeting__button",e.meetingClass]),disabled:!e.meetingSlot.date,onClick:t[0]||(t[0]=(...o)=>e.meetingSlotClick&&e.meetingSlotClick(...o))},h(e.time),11,U)):(l(),c("div",{key:1,class:g(["meeting__empty",e.meetingEmptyClass])}," — ",2))])}const G=S(H,[["render",z],["__scopeId","data-v-99e55f0d"]]),K=C({name:"MeetingsList",components:{MeetingDisplay:G},props:{meetingsDay:{type:Object,default:null},meetingSlotSelected:{type:[Array,Object,null],required:!0},meetingClass:{type:String,default:""},meetingButtonClass:{type:String,default:""},meetingEmptyClass:{type:String,default:""}},emits:["meeting-slot-click"],setup(e,t){return{meetingSlotClick:a=>{t.emit("meeting-slot-click",a)}}}}),W={class:"meetings"};function Q(e,t,a,s,n,i){const o=k("meeting-display");return l(),c("div",W,[e.$slots.meeting?(l(!0),c($,{key:0},B(e.meetingsDay.slots,(u,b)=>(l(),c("div",{key:b},[_(e.$slots,"meeting",{meeting:u},void 0,!0)]))),128)):(l(!0),c($,{key:1},B(e.meetingsDay.slots,(u,b)=>(l(),Y(o,{class:g(e.meetingClass),"meeting-button-class":e.meetingButtonClass,"meeting-empty-class":e.meetingEmptyClass,"meeting-slot":u,"meeting-slot-selected":e.meetingSlotSelected,onMeetingSlotClick:e.meetingSlotClick,key:b},null,8,["class","meeting-button-class","meeting-empty-class","meeting-slot","meeting-slot-selected","onMeetingSlotClick"]))),128))])}const R=S(K,[["render",Q],["__scopeId","data-v-59393793"]]),X=C({name:"DayDisplay",props:{meetingsDay:{type:Object,required:!0},daysLabel:{type:Array,required:!0},monthsLabel:{type:Array,required:!0}},setup(e){const t=m(()=>{const s=new Date(e.meetingsDay.date);return e.daysLabel[s.getDay()]}),a=m(()=>{const s=new Date(e.meetingsDay.date);return`${s.getDate()} ${e.monthsLabel[s.getMonth()]}`});return{title:t,subtitle:a}}}),Z={class:"day"},ee={class:"day__title"},te={class:"day__subtitle"};function ae(e,t,a,s,n,i){return l(),c("div",Z,[p("div",ee,h(e.title),1),p("div",te,h(e.subtitle),1)])}const se=S(X,[["render",ae],["__scopeId","data-v-11f9b4ca"]]),ne=C({name:"ArrowIcon",props:{direction:{type:String,default:"right"}},setup(e){return{iconDirectionClass:m(()=>`vms-icon-${e.direction}`)}}});function ie(e,t,a,s,n,i){return l(),c("i",{class:g(["vms-icon",e.iconDirectionClass])},null,2)}const oe=S(ne,[["render",ie],["__scopeId","data-v-6ce31d85"]]),le=C({name:"SpinLoader"}),de={class:"vms-icon-loader"};function ge(e,t,a,s,n,i){return l(),c("i",de)}const ce=S(le,[["render",ge],["__scopeId","data-v-a175ea8d"]]),re=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],me=["jan.","feb.","mar.","apr.","may.","jun.","jul.","aug.","sep.","oct.","nov.","dec."],P=e=>{const t=e.getMonth()+1<10?`0${e.getMonth()+1}`:e.getMonth()+1,a=e.getDate()<10?`0${e.getDate()}`:e.getDate();return parseInt(`${e.getFullYear()}${t}${a}`,10)},ue=e=>{const t=new Date(e),a=new Date;return P(t)<=P(a)},pe={daysLabel:re,monthsLabel:me,limit:4,spacing:4,loadingLabel:"Loading ...",disabledDate:ue},ye={tabClass:"",tabPaginationPrevious:"",tabPaginationPreviousButton:"",tabPaginationNext:"",tabPaginationNextButton:"",tabPaginationUpButton:"",tabPaginationDownButton:"",tabDays:"",tabDayDisplay:"",tabMeetings:"",tabMeeting:"",tabMeetingButton:"",tabMeetingEmpty:"",tabLoading:""},be=C({name:"meetingSelector",components:{Meetings:R,DayDisplay:se,ArrowIcon:oe,Loader:ce},props:{modelValue:{type:[Array,Object,null],required:!0},date:{type:Date,required:!0},meetingsDays:{type:Array,required:!0},calendarOptions:{type:Object,default:()=>({})},classNames:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},multi:{type:Boolean,default:!1}},emits:["previous-date","next-date","meeting-slot-selected","change","meeting-slot-unselected","update:modelValue"],setup(e,t){const a=I(0),s=m(()=>({...pe,...e.calendarOptions})),n=m(()=>({...ye,...e.classNames})),i=m(()=>e.meetingsDays&&e.meetingsDays.length?Math.max(...e.meetingsDays.map(r=>r.slots.length)):0),o=m(()=>{const r=Math.ceil(i.value/s.value.limit)*s.value.limit;return e.meetingsDays?e.meetingsDays.map(y=>{const v=new Array(r).fill({date:""});return v.splice(0,y.slots.length,...y.slots),{...y,slots:v.slice(a.value,a.value+s.value.limit)}}):[]}),u=m(()=>{const{daysLabel:r}=s.value;return e.meetingsDays?e.meetingsDays.map(y=>{const v=new Date(y.date);return r[v.getDay()]}):[]}),b=()=>{a.value+=s.value.spacing},M=()=>{a.value-=s.value.spacing},d=()=>{t.emit("previous-date")},w=()=>{t.emit("next-date")},x=r=>r+1===o.value.length?`tab__days--last ${n.value.tabMeetings}`:n.value.tabMeetings||"",L=r=>{if(e.multi&&Array.isArray(e.modelValue)){const y=new Date(r.date).getTime(),v=e.modelValue.findIndex(A=>new Date(A.date).getTime()===y),D=[...e.modelValue];v!==-1?(D.splice(v,1),t.emit("change",D),t.emit("meeting-slot-selected",D),t.emit("update:modelValue",D)):(D.push(r),t.emit("change",D),t.emit("meeting-slot-selected",D),t.emit("update:modelValue",D));return}if(e.modelValue){const y=new Date(r.date);if(new Date(e.modelValue.date).getTime()===y.getTime()){t.emit("change",void 0),t.emit("meeting-slot-unselected"),t.emit("update:modelValue");return}}t.emit("change",r),t.emit("meeting-slot-selected",r),t.emit("update:modelValue",r)};return t.expose({nextMeetings:b,previousMeetings:M,previousDate:d,nextDate:w,meetingSlotClick:L}),{skip:a,options:s,cssClass:n,tabDaysClass:x,maxNbMeetings:i,meetingsByDays:o,days:u,nextMeetings:b,previousMeetings:M,previousDate:d,nextDate:w,meetingSlotClick:L}}}),De={class:"meeting-selector"},_e=["disabled"],ve={class:"tab__days"},fe={key:1,class:"tab__loading__text"},Ce=["disabled"],Se=["disabled"],ke=["disabled"];function Me(e,t,a,s,n,i){const o=k("arrow-icon"),u=k("day-display"),b=k("meetings"),M=k("loader");return l(),c("div",De,[p("div",{class:g([e.cssClass.tabClass,"tab"])},[p("div",{class:g(["tab__pagination",e.cssClass.tabPaginationPrevious])},[_(e.$slots,"button-previous",{},()=>[p("button",{type:"button",disabled:e.options.disabledDate(e.date)||e.loading,class:g(["tab__pagination__button",e.cssClass.tabPaginationPreviousButton]),onClick:t[0]||(t[0]=(...d)=>e.previousDate&&e.previousDate(...d))},[f(o,{direction:"left"})],10,_e)],!0)],2),p("div",ve,[(l(!0),c($,null,B(e.meetingsByDays,(d,w)=>(l(),c("div",{class:g(["tab__day",e.tabDaysClass(w)]),key:String(d.date)},[_(e.$slots,"header",{meetings:d},()=>[f(u,{class:g(["tab__days__day-display",e.cssClass.tabDayDisplay]),"meetings-day":d,"months-label":e.options.monthsLabel,"days-label":e.options.daysLabel},null,8,["class","meetings-day","months-label","days-label"])],!0),f(b,{class:g(["tab__days__meetings",e.cssClass.tabMeetings]),"meeting-class":e.cssClass.tabMeeting,"meeting-button-class":e.cssClass.tabMeetingButton,"meeting-empty-class":e.cssClass.tabMeetingEmpty,"meetings-day":d,"meeting-slot-selected":e.modelValue,onMeetingSlotClick:e.meetingSlotClick},N({_:2},[e.$slots.meeting?{name:"meeting",fn:O(({meeting:x})=>[_(e.$slots,"meeting",{meeting:x},void 0,!0)]),key:"0"}:void 0]),1032,["class","meeting-class","meeting-button-class","meeting-empty-class","meetings-day","meeting-slot-selected","onMeetingSlotClick"])],2))),128)),e.loading?(l(),c("div",{key:0,class:g(["tab__loading",e.cssClass.tabLoading])},[e.$slots.loading?_(e.$slots,"loading",{key:0},void 0,!0):(l(),c("div",fe,[f(M),q(" "+h(e.options.loadingLabel),1)]))],2)):E("",!0)]),p("div",{class:g(["tab__pagination",e.cssClass.tabPaginationNext])},[_(e.$slots,"button-next",{},()=>[p("button",{type:"button",class:g(["tab__pagination__button tab__pagination__button--right",e.cssClass.tabPaginationNextButton]),disabled:e.loading,onClick:t[1]||(t[1]=(...d)=>e.nextDate&&e.nextDate(...d))},[f(o,{direction:"right"})],10,Ce)],!0),_(e.$slots,"button-up",{isDisabled:e.skip===0||e.loading},()=>[p("button",{type:"button",class:g([e.cssClass.tabPaginationUpButton,"tab__pagination__button tab__pagination__button--up"]),disabled:e.skip===0||e.loading,onClick:t[2]||(t[2]=(...d)=>e.previousMeetings&&e.previousMeetings(...d))},[f(o,{direction:"up"})],10,Se)],!0),_(e.$slots,"button-down",{isDisabled:e.skip+e.options.spacing>=e.maxNbMeetings||e.loading},()=>[p("button",{type:"button",class:g([e.cssClass.tabPaginationDownButton,"tab__pagination__button tab__pagination__button--down"]),disabled:e.skip+e.options.spacing>=e.maxNbMeetings||e.loading,onClick:t[3]||(t[3]=(...d)=>e.nextMeetings&&e.nextMeetings(...d))},[f(o,{direction:"down"})],10,ke)],!0)],2)],2)])}const xe=S(be,[["render",Me],["__scopeId","data-v-adda00da"]]);const $e=e=>({daysLabel:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],monthsLabel:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Aoû","Sep","Oct","Nov","Déc"],limit:5,spacing:e,loadingLabel:"Chargement...",disabledDate:t=>{const a=V(new Date).format("YYYY-MM-DD");return V(t).format("YYYY-MM-DD")<=a}});var j={exports:{}};(function(e,t){(function(a,s){e.exports=s()})(T,function(){return function(a,s){s.prototype.weekday=function(n){var i=this.$locale().weekStart||0,o=this.$W,u=(o<i?o+7:o)-i;return this.$utils().u(n)?u:this.subtract(u,"day").add(n,"day")}}})})(j);var we=j.exports;const Be=F(we);export{xe as S,$e as m,Be as w}; //# sourceMappingURL=weekday-e5224c6e.js.map