import{r as e,c as t,h as n,H as i}from"./p-1ea36ff3.js";import{S as r}from"./p-16bf9265.js";import{M as a,m as o}from"./p-7fd840fa.js";let s=class{constructor(n){e(this,n),this.action=t(this,"action",7),this.isPending=!0}async componentWillLoad(){this.strings=await this.apiSozluk.getContent(a,o)}render(){const{activePairs:e,isPending:t,meetingGoalConfig:a,menteeType:o,organisationConfig:s,requestedPairs:l,strings:d,userType:c}=this;if(t)return n(i,null,n("b",{class:"pl-3",style:{fontSize:"1.1rem"}},d.myPairs),n("dvn-card",{elevation:1},n("div",{class:"d-flex justify-content-center"},n("dvn-progress",{indefinite:!0,tint:"primary"}))));let g;g="mentee"===c?"mentor":"group"===o?"group":"mentee";const p="showAvailableMentors"===s.subscriptionConfig.mentorVisibilityStatus,u=(null==l?void 0:l.length)>0,v=(null==e?void 0:e.length)>0,h=v||p,y=p&&u,f=v,w=[];v||(w.push(d.notMatchedMessage),w.push("mentee"===c?p?d.pairsEmptyRequestOpenMessage:d.pairsEmptyRequestOffMessage:p?u?d.pairsHasRequestEmptyMessage:d.pairsHasNotRequestEmptyMessage:d.pairsEmptyRequestOffMessage));const b=w.length>0,k="mentor"===c?"go-to-mentees-page":"go-to-mentors-page",x=()=>this.action.emit({name:k}),C=()=>this.action.emit({name:"go-to-mentor-selection"});return n(i,null,n("b",{class:"pl-3",style:{fontSize:"1.1rem"}},d.myPairs),n("dvn-card",{elevation:1},y&&n("dvn-alert",{message:r.build(d.waitingForResponse,{count:l.length})}),f&&n("div",{class:"row"},e.map(m(d,g,a,(e=>{var t;return this.action.emit({name:"go-to-pair-detail-page",params:{uid:e._id,subId:null===(t=e.subscription)||void 0===t?void 0:t._id}})})))),b&&n("div",{class:"col-md-12 text-centered"},w.length>0&&w.join(" ")),h&&n("dvn-card-footer",{slot:"footer",alignRight:!0},v&&n("dvn-button",{leaned:!0,view:"flat",onClick:()=>x()},d.seeAll),p&&n("dvn-button",{leaned:!0,view:"flat",onClick:()=>{"mentee"===c?C():x()}},d.seeRequests))))}};const m=(e,t,i,r)=>(a,o)=>{if(o>=6)return;const{user:s,meetings:m}=a,d=m.length>0;return n("div",{class:"col-lg-6 col-md-12 user-card"},n("div",{class:"header"},n("dvn-image",{slot:"media",src:s.imageUrl,text:"group"===t?s.title[0]:s.firstName[0]+s.lastName[0],leaned:!0,shape:"circle",size:50}),n("b",{class:"clickable pl-2",onClick:()=>r(s)},"group"===t?s.title:s.firstName+" "+s.lastName),n("dvn-linear-progress",{showPercent:d,percent:l(m,d,i),scale:"small"}),n("p",{class:"clickable",onClick:()=>r(s)},d?`${m.length} ${e.meetings}`:e.scheduleMeeting)))},l=(e,t,n)=>{if(!t)return"0";const i=n.meetingGoals.length;let r=0;const a=new Date;return e.forEach((e=>{new Date(1e3*e.endDate)<a&&r++})),Math.floor(r/i*100).toString()};s.style="mentornity-pair-meeting-summary-widget .user-card{margin-bottom:1rem}mentornity-pair-meeting-summary-widget .user-card:nth-last-child(-n+2){margin-bottom:0}mentornity-pair-meeting-summary-widget .header{white-space:nowrap;margin-bottom:calc(3 * var(--spacing-unit))}mentornity-pair-meeting-summary-widget .header dvn-image{float:left}mentornity-pair-meeting-summary-widget .header dvn-linear-progress,mentornity-pair-meeting-summary-widget .header h5,mentornity-pair-meeting-summary-widget .header p,mentornity-pair-meeting-summary-widget .header a{font-size:0.9rem;position:relative;top:var(--spacing-unit);left:calc(2 * var(--spacing-unit))}mentornity-pair-meeting-summary-widget .header p{padding:0;margin:0 0 0 50px;color:var(--color-text-secondary)}mentornity-pair-meeting-summary-widget .header a{margin:0;padding:0;color:#000}mentornity-pair-meeting-summary-widget .clickable:hover{text-decoration:underline;cursor:pointer;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}";export{s as mentornity_pair_meeting_summary_widget}