"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[805],{77398:function(e,n,t){t.d(n,{k:function(){return capitalize}});function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}},39812:function(e,n,t){t.d(n,{k:function(){return getCampusName}});var r=t(34817);function getCampusName(e){return"18/F, Tower 535, 535 Jaffe Road, Causeway Bay, HK"===e?r.ag._("Causeway Bay"):"2/F, Kerry Hotel, 38 Hung Luen Rd, Hung Hom, HK"===e?r.ag._("Hung Hom"):e}},3801:function(e,n,t){t.d(n,{G:function(){return getDisplayedHappeningType},t:function(){return getDisplayedHappeningTypeShortForm}});var r=t(34817);function getDisplayedHappeningTypeShortForm(e){switch(e){case"bootcamp_class":return r.ag._("BC");case"one_to_one":return r.ag._("1:1");default:return r.ag._("Others")}}function getDisplayedHappeningType(e){switch(e){case"bootcamp_class":return r.ag._("BC");case"one_to_one":return r.ag._("1:1");case"business_to_business":return r.ag._("Corp");case"nomad_training":return r.ag._("Training");case"internal_event":return r.ag._("Event");case"school_event":return r.ag._("Sch");case"tech_bite_production":return r.ag._("TechBites");default:return r.ag._("Others")}}},5377:function(e,n,t){t.d(n,{Z:function(){return timezoneConvert}});var r=t(44286);function timezoneConvert(e){var n=e.date,t=e.timezone;return t?(0,r.z)(n,t):n}},36674:function(e,n,t){t.d(n,{H:function(){return LoadingIcon}});var r=t(59499),a=t(87247),i=t(85893);function ownKeys(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function _objectSpread(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ownKeys(Object(t),!0).forEach(function(n){(0,r.Z)(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var LoadingIcon=function(e){return(0,i.jsx)(a.l,_objectSpread(_objectSpread({height:"16",width:"17"},e),{},{children:(0,i.jsx)("path",{d:"M14.5 8C14.5 4.68629 11.8137 2 8.5 2C5.18629 2 2.5 4.68629 2.5 8C2.5 11.3137 5.18629 14 8.5 14",strokeWidth:"2"})}))}},55496:function(e,n,t){t.d(n,{Z:function(){return MyCoursesRows}});var r=t(34817),a=t(87558),i=t(4730),s=t(67294),l=t(41664),o=t.n(l),c=t(72509),d=t(53089),u=t(63607),p=t(29630),m=t(30120),x=t(16385),h=t(34202),f=t(12277),g=t(8519),v=t(85893);function RadioButton(e){var n=e.value,t=e.selected,r=e.styles,a=e.disabled,i=e.onChange;return(0,v.jsx)(g.Z,{checked:t,disabled:a,sx:r,value:n,onChange:i})}var b=t(19211),_=t(59499),j=t(50029),y=t(87794),w=t.n(y),C=t(73875),N=t(35378),k=["id"];function ownKeys(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function _objectSpread(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ownKeys(Object(t),!0).forEach(function(n){(0,_.Z)(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var S=t(28957),H=t(51445),Z=t(85945),P=t(48228),R=["id"];function cancelParticipants(e){var n=e.id,t=(0,i.Z)(e,R);return(0,N.v_)("api/v2/students/".concat(n,"/cancel_participants"),t)}var O=t(64276),D=t(81896);function CancelHappening(e){var n,t,l,o,u,g,_,y,R,T=e.enrolledHappening,B=e.stuId,E=e.allEnrolledHappenings,z=e.onHappeningCancelled,L=(0,c.z)(),I=(0,s.useState)(1),M=I[0],W=I[1],A=(0,s.useState)("sick leave"),K=A[0],U=A[1],X=null==T?void 0:null===(R=T.series)||void 0===R?void 0:R.id,q=(0,x.E)(X),G=q.data,J=q.isLoading,Q=(n=null==G?void 0:G.happenings,t=[],null==n||n.forEach(function(e){(null==e?void 0:e.state)==="upcoming"&&t.push(null==e?void 0:e.id)}),t),V=(l=null==G?void 0:G.happenings,o=[],null==l||l.forEach(function(e){if((null==e?void 0:e.state)==="upcoming"){var n,t=null===(n=E.find(function(n){return(null==n?void 0:n.id)===(null==e?void 0:e.id)}))||void 0===n?void 0:n.participants,i=null==t?void 0:t.filter(function(e){return(null==e?void 0:e.role)==="teacher"}),s=null!=e&&e.started_at?(0,a.W)(new Date(e.started_at),"HH:mm"):null,l=null!=e&&e.ended_at?(0,a.W)(new Date(e.ended_at),"HH:mm"):null,c=r.ag._("{startTime}-{endTime}",{startTime:s,endTime:l});o.push({date:null==e?void 0:e.started_at,timeslot:c,nomad:i})}}),o),Y=(0,s.useCallback)(function(e){null==e||e.focus()},[]),$="sick leave"!==K,ee=(g=(u={id:B,happening_ids:1===M?[null==T?void 0:T.id]:Q}).id,_=(0,i.Z)(u,k),(0,C.a)(["students",g,"previewHappeningCancelPolicies",_],(0,j.Z)(w().mark(function _callee(){return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(e){var n=e.id,t=e.happening_ids;return(0,N.U2)("api/v2/students/".concat(n,"/preview_happening_cancel_policies"),{happening_ids:t})}(_objectSpread({id:g},_));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},_callee)})),_objectSpread({enabled:!!g,retry:!1},void 0))),en=ee.data,et=ee.isLoading,er=!!X&&J,ea=(null==T?void 0:T.format)==="online"?null==en?void 0:en.return_online_person_credit_total:null==en?void 0:en.return_in_person_credit_total,ei=[{title:r.ag._("More than 48 hours"),content:r.ag._("Free change, return all involved credits")},{title:r.ag._("More than 24 hours"),content:r.ag._("Return only half of the credits")},{title:r.ag._("Less than 24 hours"),content:r.ag._("Full charged for the class, no credits returned")}],es=null==en?void 0:en.return_credit_details.some(function(e){return"full_return"!==e.return_type}),el=(y=(0,Z.NL)(),(0,P.D)(cancelParticipants,{onSuccess:function(){y.invalidateQueries(["enrolledHappenings"]),y.invalidateQueries(["series"])}})),eo=(0,O.l)(),ec=eo.notifySuccess,ed=eo.notifyError,handleCancelledHappeningNumberChange=function(e){W(Number(e.target.value))};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("h1",{className:"text-2xl font-bold mb-4",children:r.ag._("Cancel class")}),(0,v.jsxs)(h.N,{height:84,isLoading:er,width:200,children:[(0,v.jsxs)(b.Z,{alignItems:"center",direction:"row",justifyContent:"flex-start",children:[(0,v.jsx)(RadioButton,{selected:1===M,styles:{pl:0},value:1,onChange:handleCancelledHappeningNumberChange}),(0,v.jsx)(p.Z,{children:r.ag._("Cancel this class")})]}),(0,v.jsxs)(b.Z,{alignItems:"center",direction:"row",justifyContent:"flex-start",children:[(0,v.jsx)(RadioButton,{disabled:Q.length<2,selected:M===Q.length,styles:{pl:0},value:Q.length,onChange:handleCancelledHappeningNumberChange}),(0,v.jsx)(p.Z,{children:r.ag._("Cancel remaining classes ({0})",{0:null==Q?void 0:Q.length})})]})]}),M>1?(0,v.jsxs)("table",{className:"min-w-full border-b-1 border-solid border-gray-300",children:[(0,v.jsx)("thead",{children:(0,v.jsxs)("tr",{children:[(0,v.jsx)("th",{className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-0",scope:"col",children:r.ag._("Nomad")}),(0,v.jsx)("th",{className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900",scope:"col",children:r.ag._("Date")}),(0,v.jsx)("th",{className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900",scope:"col",children:r.ag._("Timeslots")})]})}),(0,v.jsx)("tbody",{className:"border-b-1 border-solid border-gray-200",children:null==V?void 0:V.map(function(e,n){return(0,v.jsxs)("tr",{className:"border-b-1 border-solid border-gray-200",children:[(0,v.jsx)("td",{className:"whitespace-nowrap px-3 py-4 text-sm text-gray-500",children:function(e){if(!e||e.length<1)return"TBC Teacher";if(Array.isArray(e)){var n=[];return e.forEach(function(e){n.push((0,D.t)(null==e?void 0:e.first_name,null==e?void 0:e.last_name,null==e?void 0:e.username))}),n.join(", ")}return(0,D.t)(null==e?void 0:e.first_name,null==e?void 0:e.last_name,null)}(null==e?void 0:e.nomad)}),(0,v.jsx)("td",{className:"whitespace-nowrap px-3 py-4 text-sm text-gray-500",children:"".concat(null!=e&&e.date?(0,a.W)(new Date(e.date),"MM/dd ccc"):"")}),(0,v.jsx)("td",{className:"whitespace-nowrap px-3 py-4 text-sm text-gray-500",children:null!=e&&e.timeslot?e.timeslot:r.ag._("TBC")})]},n)})})]}):null,es?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(m.Z,{sx:F.sectionSeparator}),(0,v.jsx)(p.Z,{fontWeight:700,variant:"h6",children:r.ag._("Would you mind telling us why you cancel the class?")}),(0,v.jsx)(m.Z,{sx:F.titleSeparator}),(0,v.jsxs)(b.Z,{alignItems:"center",direction:"row",justifyContent:"flex-start",children:[(0,v.jsx)(RadioButton,{selected:"sick leave"===K,styles:{pl:0,pb:0},value:"sick leave",onChange:function(){return U("sick leave")}}),(0,v.jsx)(p.Z,{children:r.ag._("Sick leave")})]}),(0,v.jsx)(m.Z,{sx:{ml:"33px"},children:(0,v.jsx)(p.Z,{variant:"caption",children:r.ag._("Credits will be refunded in 1-2 weeks after a valid medical certificate is submitted through WhatsApp.")})}),(0,v.jsxs)(b.Z,{alignItems:"center",direction:"row",justifyContent:"flex-start",children:[(0,v.jsx)(RadioButton,{selected:$,styles:{pl:0},value:"",onChange:function(){return U("")}}),(0,v.jsx)(p.Z,{children:r.ag._("Others")})]}),$?(0,v.jsx)(m.Z,{children:(0,v.jsx)(f.n,{inputRef:Y,label:r.ag._("Others"),value:K,onChange:function(e){return U(e)}})}):null]}):null,(0,v.jsx)(m.Z,{sx:F.sectionSeparator}),(0,v.jsx)(p.Z,{fontWeight:700,variant:"h6",children:r.ag._("Refund credit")}),(0,v.jsx)(m.Z,{sx:F.titleSeparator}),(0,v.jsxs)(b.Z,{alignItems:"center",direction:"row",justifyContent:"flex-start",spacing:1,children:[(0,v.jsx)(h.N,{height:24,isLoading:et,width:18,children:(0,v.jsx)(p.Z,{fontSize:20,fontWeight:300,variant:"h6",children:ea})}),(0,v.jsx)(p.Z,{fontSize:12,fontWeight:400,variant:"caption",children:r.ag._("credit(s)")})]}),(0,v.jsx)(m.Z,{sx:F.sectionSeparator}),(0,v.jsxs)(m.Z,{sx:{backgroundColor:S.O.DARK_TRANSPARENT_5,padding:"12px",borderRadius:"8px"},children:[(0,v.jsx)(p.Z,{fontWeight:700,variant:"subtitle",children:r.ag._("Cancellation policy")}),(0,v.jsx)(m.Z,{sx:F.titleSeparator}),ei.map(function(e){return(0,v.jsxs)(m.Z,{sx:{marginBottom:"12px","&: last-child":{marginBottom:0}},children:[(0,v.jsx)(p.Z,{fontWeight:700,variant:"body1",children:e.title}),(0,v.jsx)(p.Z,{variant:"body1",children:e.content})]},e.title)})]}),(0,v.jsx)("div",{className:"mt-8",children:(0,v.jsx)(H.zx,{color:H.tY.danger,disabled:er||et||el.isLoading,fullWidth:!1,height:H.FZ.medium,label:r.ag._("Confirm to cancel"),variant:H.JB.contained,onClick:function(){el.mutate({id:B,happening_ids:1===M?[null==T?void 0:T.id]:Q,reason:es?K:null,preview_total_credit_consumed:Number(ea)},{onSuccess:function(){ec(r.ag._("Class(es) cancelled")),z()},onError:function(e){ed(e.message)}}),L.track(d.PX.enrolledHappeningsCancelClicked,{data:{enrolledHappening:T}})}})})]})}var F={sectionSeparator:{height:15},titleSeparator:{height:12}},T=t(3801),B=t(39812),E=t(75871),z=t(85719),L=t(80153),I=t(12183),M=t(77398),W=t(34117),A=t(5377);function acceptHappening(e){var n=e.id,t=e.userId;return(0,N.r$)("api/v2/happenings/".concat(n,"/accept"),{user_id:t})}function rejectHappening(e){var n=e.id,t=e.userId;return(0,N.r$)("api/v2/happenings/".concat(n,"/reject"),{user_id:t})}var K=["error"],U=["error"];function SingleRow(e){var n,t,a,l,p,m,x,h,f=e.happening,g=e.index,b=e.data,_=e.groupHappeningsLength,j=(0,c.z)(),y=(0,s.useState)(!1),w=y[0],C=y[1],N=(0,L.G)(),k=(0,O.l)().notifySuccess,S=(0,z.L)(),H=S.data,R=S.isLoading,D=(n=(0,Z.NL)(),(0,P.D)(acceptHappening,{onSuccess:function(){n.invalidateQueries(["enrolledHappenings"])}})),F=(D.error,(0,i.Z)(D,K)),X=(0,P.D)(rejectHappening,{onSuccess:function(){}}),q=(X.error,(0,i.Z)(X,U)),G=(0,E.l)({featureFlag:"client_customer_portal_student_review"}),J=(0,I.U)(),Q=(J.isLoading,J.data),V=(0,s.useMemo)(function(){if(!Q)return new Set;var e=new Set([Q.id]);return Q.managed_accounts.forEach(function(n){e.add(n.id)}),e},[Q]),isReviewable=function(e,n){if("locked"!==n.acceptance_state)return!1;var t=n.user_id;if(t===N)return H.my_reviewable_happenings.find(function(n){return n.id===e});var r=H.managed_accounts.find(function(e){return e.id===t});return null==r?void 0:r.reviewable_happenings.find(function(n){return n.id===e})},findParticipantsByRole=function(e,n){return e.filter(function(e){return e.role===n})},renderParticipantNames=function(e,n){var t=findParticipantsByRole(e,n);return t.length>0?t.map(function(e){return(0,v.jsxs)("div",{className:"mb-1",children:["".concat(e.first_name," ").concat(e.last_name),"locked"===e.acceptance_state?(0,v.jsx)("span",{className:"ml-1 inline-flex items-center rounded-full bg-yellow-50 px-1.5 py-0.5 text-xs font-medium text-yellow-800 ring-1 ring-inset ring-yellow-600/20",children:"Locked"}):null]},e.user_id)}):"".concat("TBC ".concat((0,M.k)(n)))},Y=(0,s.useMemo)(function(){return findParticipantsByRole(null==f?void 0:f.participants,"student").filter(function(e){return V.has(e.user_id)&&"cancelled"!==e.attendance_state})},[null==f?void 0:f.participants,V]),$=(0,A.Z)({date:null==f?void 0:f.started_at,timezone:null==f?void 0:null===(t=f.country)||void 0===t?void 0:t.timezone}),ee=(0,A.Z)({date:null==f?void 0:f.ended_at,timezone:null==f?void 0:null===(a=f.country)||void 0===a?void 0:a.timezone});return(0,A.Z)({date:new Date,timezone:null==f?void 0:null===(l=f.country)||void 0===l?void 0:l.timezone}),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("div",{className:"border-t ".concat(g===_-1&&"border-b"," mx-2 flex flex-wrap border-0 border-solid border-[#E6E7E8] py-5 md:mx-0"),children:[(0,v.jsxs)("div",{className:"mr-5 flex-shrink-0 flex-grow-0 basis-2/12 text-right text-ink-50 md:basis-1/12",children:[(0,v.jsx)("p",{className:"text-lg font-bold leading-7",children:(0,W.W)($,"d MMM")}),(0,v.jsx)("p",{className:"text-sm leading-6",children:(0,W.W)($,"iii")})]}),(0,v.jsxs)("div",{className:"flex-shrink-0 flex-grow-0 basis-5/12 md:basis-3/12",children:[(0,v.jsxs)("div",{className:"mb-1 text-ink-90",children:[(0,v.jsx)("p",{className:"font-bold",children:r.ag._("{0} - {1} ({2})",{0:(0,W.W)($,"p"),1:(0,W.W)(ee,"p"),2:null!=f&&null!==(p=f.country)&&void 0!==p&&p.timezone&&(null==f?void 0:null===(m=f.country)||void 0===m?void 0:m.timezone)!=="Asia/Hong_Kong"?null==f?void 0:null===(x=f.country)||void 0===x?void 0:x.timezone:"HKT"})}),(0,v.jsx)("p",{className:"".concat(f.campus?"my-3":""),children:f.campus?f.campus.address:(0,B.k)(f.location)})]}),(0,v.jsx)("div",{className:"text-[14px] text-ink-70",children:renderParticipantNames(f.participants,"teacher")}),(0,v.jsx)("div",{className:"text-[10px] font-semibold text-ink-70",children:renderParticipantNames(f.participants,"student")})]}),(0,v.jsx)("div",{className:"ml-4 flex basis-3/12 items-start justify-end md:basis-1/12",children:(0,v.jsx)("div",{className:"w-min rounded-md bg-[rgba(35,143,179,0.15)] px-2 py-[0.2rem] text-center text-sm font-bold text-brand-blue-70",children:(0,T.G)(f.type)})}),(0,v.jsxs)("div",{className:"flex flex-col justify-stretch md:ml-4 md:basis-5/12",children:[(0,v.jsx)("p",{className:"font-medium leading-5 text-ink-90 max-md:mb-5 max-md:ml-5 max-md:mt-5 md:mb-2 md:ml-0",children:f.course.title}),f.full?(0,v.jsx)("span",{className:"inline-flex items-center rounded-full bg-red-50 px-2 py-1 text-xs font-medium text-red-700 ring-1 ring-inset ring-red-600/10",children:r.ag._("Full")}):null,findParticipantsByRole(f.participants,"student").map(function(e){var n,t="upcoming"===f.state&&"bootcamp_class"===f.type&&"locked"!==e.acceptance_state;return(0,v.jsxs)("div",{className:"mt-auto flex items-center text-brand-blue-70 max-md:ml-5 md:ml-0",children:[findParticipantsByRole(f.participants,"student").length>1&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("p",{className:"text-sm font-bold text-black hover:text-brand-blue-70",children:"".concat(e.first_name)}),(0,v.jsx)("p",{className:"mx-2",children:"\xb7"})]}),"internal_event"===f.type&&"accepted"===e.acceptance_state&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("span",{className:"rounded-lg bg-green-500 px-3 py-1 text-sm font-bold uppercase tracking-wide text-white",children:r.ag._("Accepted")}),(0,v.jsx)("p",{className:"mx-2",children:"\xb7"})]}),"upcoming"===f.state&&(0,v.jsxs)(v.Fragment,{children:[t&&(0,v.jsx)(o(),{className:"text-sm font-bold text-brand-blue-70 hover:text-brand-blue-70 max-md:hidden",href:"/reschedule-bootcamp/".concat(f.id,"?studentId=").concat(e.user_id),rel:"noreferrer",onClick:function(){j.track(d.PX.myCoursesRowRescheduleBootcampClicked,{data:{user_id:N}})},children:r.ag._("Reschedule")}),"one_to_one"===f.type&&(null==Q?void 0:null===(n=Q.customer_portal_access_rights)||void 0===n?void 0:n.cancel_one_to_one)&&(0,v.jsx)("button",{className:"cursor-pointer border-none bg-transparent pl-0 text-sm font-bold text-[#F14668] hover:text-red-700",type:"button",onClick:function(){C(!0),j.track(d.PX.myCoursesRowCancelClicked)},children:r.ag._("Cancel")}),"internal_event"===f.type&&"accepted"!==e.acceptance_state&&!f.full&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("button",{className:"cursor-pointer border-none bg-transparent pl-0 text-sm font-bold text-brand-blue-70 hover:text-brand-blue-70",disabled:F.isLoading||q.isLoading,type:"button",onClick:function(n){n.preventDefault(),F.mutate({id:f.id,userId:e.user_id},{onSuccess:function(){k(r.ag._("Successfully signed up for event."))}}),j.track(d.PX.myCoursesRowAcceptClicked)},children:r.ag._("Accept")}),(0,v.jsx)("p",{className:"mx-2",children:"\xb7"})]}),"internal_event"===f.type&&"rejected"!=e.acceptance_state&&!f.full&&(0,v.jsx)(v.Fragment,{children:(0,v.jsx)("button",{className:"cursor-pointer border-none bg-transparent pl-0 text-sm font-bold text-brand-blue-70 hover:text-brand-blue-70",disabled:F.isLoading||q.isLoading,type:"button",onClick:function(){j.track(d.PX.myCoursesRowAcceptClicked),window.confirm(r.ag._("Reminder: This response cannot be modified later. For inquiries or changes, please contact nomad-awards@preface.ai."))&&q.mutate({id:f.id,userId:e.user_id},{onSuccess:function(){k(r.ag._("Your response has been recorded."))}})},children:r.ag._("Reject")})})]}),"completed"===f.state&&"locked"!==e.acceptance_state&&(0,v.jsxs)("div",{className:"flex items-center",children:[(0,v.jsx)(o(),{className:"text-sm font-bold text-brand-blue-70 hover:text-brand-blue-70",href:"/notes?subject=".concat(f.course.subject.id,"&user_id=").concat(e.user_id,"#").concat(f.id),onClick:function(){j.track(d.PX.myCoursesRowNotesClicked,{data:{user_id:N}})},children:r.ag._("Notes")}),(0,v.jsx)("p",{className:"mx-2",children:"\xb7"}),(0,v.jsx)(o(),{className:"text-sm font-bold text-brand-blue-70 hover:text-brand-blue-70",href:"/notes",onClick:function(){return j.track(d.PX.myCoursesRowProjectsClicked,{data:{user_id:N}})},children:r.ag._("Projects")}),G&&!R&&isReviewable(f.id,e)&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("p",{className:"mx-2",children:"\xb7"}),(0,v.jsx)(o(),{className:"text-sm font-bold text-[#D97C26]",href:"/review/form/".concat(f.id,"?student_id=").concat(e.user_id),onClick:function(){j.track(d.PX.myCoursesRowReviewClicked,{data:{user_id:N}})},children:r.ag._("Review")})]})]})]},"participant_".concat(e.id))})]})]}),(0,v.jsx)(u.Z,{open:w,onClose:function(){return C(!1)},children:(0,v.jsx)(CancelHappening,{allEnrolledHappenings:b,enrolledHappening:f,stuId:null===(h=Y[0])||void 0===h?void 0:h.user_id,onHappeningCancelled:function(){return C(!1)}})})]})}function MyCoursesRows(e){var n,t=e.data,i=(n={},null==t||t.forEach(function(e){var t=(0,a.W)(new Date(e.started_at),"MMMM yyyy");n[t]?n[t].push(e):n[t]=[e]}),n),s=Object.keys(i);return 0===s.length?(0,v.jsx)("div",{className:"mt-5",children:(0,v.jsx)("p",{children:r.ag._("No courses found.")})}):(0,v.jsx)("div",{className:"",children:s.map(function(e){return(0,v.jsxs)("div",{children:[(0,v.jsx)("p",{className:"my-7 text-ink-50",children:e}),i[e].map(function(n,r){return(0,v.jsx)(SingleRow,{data:t,groupHappeningsLength:i[e].length,happening:n,index:r},n.id)})]},e)})})}},63607:function(e,n,t){t.d(n,{Z:function(){return Modal}});var r=t(34817),a=t(67294),i=t(44080),s=t(42545),l=t(95537),o=t(85893);function Modal(e){var n=e.open,t=e.onClose,c=void 0===t?function(){}:t,d=e.grayPanel,u=e.styles,p=e.modalStyles,m=void 0===p?"bg-white":p,x=e.buttonStyles,h=e.fullScreen,f=void 0!==h&&h,g=e.hasCloseButton,v=e.hasFixedButtonPanel,b=void 0!==v&&v,_=e.buttonInPanel,j=e.disableScroll,y=e.children;return(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(i.u.Root,{as:a.Fragment,className:"p-0",show:n,children:(0,o.jsxs)(s.V,{as:"div",className:"relative z-10",onClose:c,children:[(0,o.jsx)(i.u.Child,{as:a.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,o.jsx)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})}),(0,o.jsx)("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:(0,o.jsx)("div",{className:"flex ".concat(f?"h-screen":"min-h-full"," items-center justify-center p-[0rem] text-center md:p-[2rem]"),children:(0,o.jsx)(i.u.Child,{as:a.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,o.jsx)(s.V.Panel,{className:"relative transform overflow-hidden rounded-[2rem] text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-[60%] ".concat(void 0!==j&&j?"h-auto":""," ").concat(f?"h-screen w-full":""," ").concat(m),children:(0,o.jsx)("div",{className:"relative h-full w-full overflow-hidden px-[1.25rem] pb-4 pt-[1.5rem]",children:(0,o.jsx)("div",{className:"".concat(f?"h-screen w-full overflow-scroll":""," "),children:(0,o.jsxs)("div",{className:b?"mb-[10rem]":"mb-0",children:[(void 0===g||g)&&(0,o.jsx)("div",{className:void 0===u?"px-4 sm:px-[1.88rem]":u,children:(0,o.jsx)("div",{className:"absolute right-0 top-0 z-50 pr-4 pt-4 sm:block",children:(0,o.jsxs)("button",{className:"".concat(void 0===x?"bg-white text-gray-400 hover:text-gray-500":x," cursor-pointer rounded-md border-transparent focus:outline-none focus:ring-2 focus:ring-transparent focus:ring-offset-0"),type:"button",onClick:c,children:[(0,o.jsx)("span",{className:"sr-only",children:"Close"}),(0,o.jsx)(l.Z,{})]})})}),(0,o.jsx)("div",{className:"relative",children:y}),d&&(0,o.jsx)("div",{className:"bg-[#E6E7E8] p-[1.88rem] pb-[2.37rem]",children:d}),b&&(0,o.jsxs)("div",{className:"fixed bottom-0 left-0 flex w-full items-center gap-2 bg-white px-[1.25rem] pb-[1.5rem] pt-4",children:[_,(0,o.jsx)("button",{className:"cursor-pointer rounded-lg border-transparent bg-white px-6 py-3 text-gray-400 hover:bg-gray-100 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-transparent focus:ring-offset-0 md:max-w-[10rem]",type:"button",onClick:c,children:(0,o.jsx)("p",{className:"text-center text-base font-semibold leading-4 text-[#444A54]",children:r.ag._("Cancel")})})]})]})})})})})})})]})})})}},66881:function(e,n,t){t.d(n,{Z:function(){return TabBar}});var r=t(72509),a=t(53089),i=t(85893);function TabBar(e){var n=e.tabs,t=e.selectedTab,s=e.handleClick,l=e.selectedTabStyle,o=void 0===l?"mr-3 py-[0.2rem] px-3 rounded-2xl cursor-pointer text-base text-[#006080] font-semibold bg-[#238FB3] bg-opacity-[0.15]":l,c=e.unselectedTabStyle,d=void 0===c?"mr-3 py-[0.2rem] px-3 rounded-2xl cursor-pointer text-base bg-transparent text-[#8E96A4] font-semibold":c,u=(0,r.z)();return(0,i.jsx)("ul",{className:"flex flex-wrap text-center text-sm font-medium text-gray-500",children:n.map(function(e){return(0,i.jsxs)("li",{className:"".concat(t===e.value?o:d," relative hover:bg-gray-300"),onClick:function(){s(e.value),u.track(a.oJ.tabBartabsClicked,{data:{tab_value:e.name}})},children:[(0,i.jsx)("span",{children:e.name}),e.badgeContent&&(0,i.jsx)("span",{className:"z-1 absolute right-[-0.3rem] top-0 flex h-4 w-4 items-center justify-center rounded-full bg-[#DC3545] text-white",children:(0,i.jsx)("span",{className:"text-[9px] text-white",children:e.badgeContent})})]},e.value)})})}},31437:function(e,n,t){t.d(n,{m:function(){return useEnrolledHappenings}});var r=t(50029),a=t(87794),i=t.n(a),s=t(73875),l=t(35378);function useEnrolledHappenings(e){var n=e.startDate,t=e.endDate,a=e.userId;return(0,s.a)(["enrolledHappenings",n,t,a],(0,r.Z)(i().mark(function _callee(){return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(e){var n=e.startDate,t=e.endDate,r=e.userId;return(0,l.U2)("api/v2/happenings/enrolled",{start_date_begin:n,start_date_end:t,user_id:r})}({startDate:n,endDate:t,userId:a});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},_callee)})),{retry:0})}},85719:function(e,n,t){t.d(n,{L:function(){return useReviewableHappenings}});var r=t(73875),a=t(35378);function useReviewableHappenings(){return(0,r.a)({queryKey:["reviewable_happenings"],queryFn:function(){return(0,a.U2)("api/v2/happenings/reviewable")}})}},16385:function(e,n,t){t.d(n,{E:function(){return useUpcomingHappeningSeries}});var r=t(50029),a=t(87794),i=t.n(a),s=t(73875),l=t(35378);function useUpcomingHappeningSeries(e){return(0,s.a)(["series",e],(0,r.Z)(i().mark(function _callee(){return i().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,l.U2)("api/v2/series/".concat(e));case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}},_callee)})),{enabled:!!e})}}}]);