"use strict";(self.webpackChunkhhgHealthCareV1=self.webpackChunkhhgHealthCareV1||[]).push([[9490],{86711:function(e,n,t){var o,i,r,a,l,s,d,c,u=t(73884);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var n=1;n=0&&v<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=(0,i.A)(e),m=g.getDay(),b=6+(m=0&&v<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=(0,o.A)(e),m=g.getDay(),b=(m",""):o}),g&&(0,r.Y)(p.A,{width:16,height:16,className:d()("text-gray700")})]})]})})}},69973:function(e,n,t){t.d(n,{g:function(){return f}});var o=t(24537),i=t(2445),r=(t(73884),t(27317));function a(){var e=(0,o.A)(["\n fill: none;\n stroke-width: 2px;\n &[color='grey'] {\n stroke: ",";\n }\n &[color='blue'] {\n stroke: ",";\n }\n &[color='green'] {\n stroke: ",";\n }\n &[color='orange'] {\n stroke: ",";\n }\n &[color='orange bold'],\n &[color='blue bold'],\n &[color='green bold'] {\n stroke: ",";\n }\n"]);return a=function(){return e},e}function l(){var e=(0,o.A)(["\n display: inline-block;\n vertical-align: middle;\n\n .checkbox {\n display: inline-block;\n width: 20px;\n height: 20px;\n border-radius: 3px;\n cursor: pointer;\n transition: all 150ms;\n "," {\n visibility: hidden;\n }\n }\n .checkbox[color='grey'] {\n border: 1px solid ",";\n }\n .checkbox[color='blue'] {\n border: 1px solid ",";\n }\n .checkbox[color='green'] {\n border: 1px solid ",";\n }\n .checkbox[color='orange'] {\n border: 1px solid ",";\n }\n .checkbox[color='blue bold'] {\n border: 1px solid ",";\n }\n .checkbox[color='green bold'] {\n border: 1px solid ",";\n }\n .checked {\n "," {\n visibility: visible;\n }\n }\n .checked[color='grey'] {\n border: none;\n background-color: ",";\n }\n .checked[color='blue'] {\n border: none;\n background-color: ",";\n }\n .checked[color='green'] {\n border: none;\n background-color: ",";\n }\n .checked[color='orange'] {\n border: none;\n background-color: ",";\n }\n .checked[color='blue bold'] {\n border: none;\n background-color: ",";\n }\n .checked[color='green bold'] {\n border: none;\n background-color: ",";\n }\n"]);return l=function(){return e},e}function s(){var e=(0,o.A)(["\n position: absolute;\n overflow: hidden;\n width: 1px;\n height: 1px;\n padding: 0;\n border: 0;\n margin: -1px;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n"]);return s=function(){return e},e}function d(){var e=(0,o.A)(["\n font-size: 14px;\n"]);return d=function(){return e},e}var c=r.Ay.svg.withConfig({componentId:"sc-82f3a1b6-0"})(a(),(function(e){return e.theme.colors.gray600}),(function(e){return e.theme.colors.primaryBase}),(function(e){return e.theme.colors.green600}),(function(e){return e.theme.colors.yellow900}),(function(e){return e.theme.colors.white})),u=r.Ay.div.withConfig({componentId:"sc-82f3a1b6-1"})(l(),c,(function(e){return e.theme.colors.gray600}),(function(e){return e.theme.colors.primaryBase}),(function(e){return e.theme.colors.green600}),(function(e){return e.theme.colors.yellow900}),(function(e){return e.theme.colors.primaryBase}),(function(e){return e.theme.colors.green700}),c,(function(e){return e.theme.colors.gray100}),(function(e){return e.theme.colors.blue50}),(function(e){return e.theme.colors.green50}),(function(e){return e.theme.colors.yellow50}),(function(e){return e.theme.colors.primaryBase}),(function(e){return e.theme.colors.green700})),h=r.Ay.input.attrs({type:"checkbox"}).withConfig({componentId:"sc-82f3a1b6-2"})(s()),p=r.Ay.div.withConfig({componentId:"sc-82f3a1b6-3"})(d()),f=function(e){var n=e.label,t=e.name,o=e.id,r=e.checked,a=void 0!==r&&r,l=e.className,s=e.onChange,d=e.color;return(0,i.Y)("div",{style:{marginRight:8},children:(0,i.FD)("label",{htmlFor:o,style:{display:"flex",alignItems:"center"},children:[(0,i.FD)(u,{className:l,children:[(0,i.Y)(h,{checked:a,id:o,name:t,onChange:function(){return s&&s(!!a)}}),(0,i.Y)("div",{className:a?"checkbox checked":"checkbox",color:d,children:(0,i.Y)(c,{viewBox:"0 0 24 24",color:d,children:(0,i.Y)("polyline",{points:"20 6 9 17 4 12"})})})]}),(0,i.Y)(p,{children:n})]})})}},18094:function(e,n,t){t.d(n,{z:function(){return H}});var o=t(53513),i=t(63538),r=t(2445),a=t(73884),l=t(25072),s=t(65886),d=t(21447),c=t(53303),u=t(66298),h=t(38971),p=t(24537),f=t(68021),v=t(35291),g=t(32485),m=t.n(g),b=t(82920),w=t(68089),y=t(12563),x=t(6442),k=t(27317),A=t(82471),M=t(74828),C=t(56466),E=t(36259),P=t(40959),S=t(3182);function D(){var e=(0,p.A)(["\n .event {\n padding: 4px;\n &.compact {\n padding: 2px 4px;\n .upcoming {\n font-size: 12px;\n margin-bottom: 0;\n }\n .time {\n font-size: 10px;\n line-height: 1;\n }\n }\n /* GENERIC-POOL-FIGMA-PARITY (Gap 1, corrected against authoritative\n Figma node 19774-33763): the full-height (non-compact, non-lane) pool\n slat only -- see the poolCard flag in Event.tsx. The Figma slat is a\n 152x47 frame with 2px corner radius, edge-to-edge at full column\n width (no inset -- see the top/height/width values below, which\n were reverted to the original flush values), plus a 3px left-accent\n stripe colored by assignment state (rendered via border-left below,\n inline per-instance since the color depends on booking data). Padding\n stays roomier (6px) for the two-line (name + assigned/unassigned\n status) content. box-sizing: border-box keeps the 3px border from\n growing the slat's overall width/height beyond the time-accurate box.\n .compact (fix_round 9's status-primary single line) and non-pool\n slats never carry this class, so this rule can never apply to them. */\n &.pool-card {\n border-radius: 2px;\n padding: 6px;\n box-sizing: border-box;\n }\n }\n .name {\n font-size: 14px;\n font-weight: 600;\n }\n .time {\n color: ",";\n font-size: 12px;\n line-height: 18px;\n "," {\n display: none;\n }\n }\n .past {\n color: ",";\n }\n .upcoming {\n color: ",";\n }\n /* VP-4470 fix_round 7: clamp the row itself to the cell's content width.\n Without this, the row's natural (unclamped) width exceeds the 155px\n compact slat cell -- because .pool-name-row is itself display:flex, its\n own auto min-width resolves to its (unshrunk) content size when\n unconstrained -- so .pool-name's ellipsis CSS never engages (nothing\n forces it to shrink) and justify-content:space-between pushes the\n chevron past the cell's right edge, where the cell's overflow:hidden\n (stacked/hasLanes case) clips it to invisible. min-width:0 defeats that\n auto min-width so the row can shrink to the column's cross width;\n max-width:100% hard-clamps the row's own box to the parent cell's\n width -- this alone is enough, independent of 'overflow', since\n max-width bounds the box itself rather than relying on clipping.\n Deliberately NOT setting 'overflow' here (tried overflow:hidden in\n an earlier iteration of this fix and it backfired): .pool-name-row\n is also a flex ITEM along the *main* (vertical) axis of its\n column-flex parent .cell.event.compact, and giving a flex item a\n non-'visible' overflow zeroes out its automatic min-height (CSS\n Flexbox section 4.5) instead of the content-based one -- confirmed via\n a real Chromium layout dump: it collapsed the row to 0px height in the\n 20px-tall compact/stacked slats, hiding the name+chevron entirely.\n .pool-name already self-clips via its own overflow:hidden +\n text-overflow:ellipsis, and the chevron is fixed-width, so the row\n doesn't need its own overflow clamp for the fix to work. */\n /* VP-4470 fix_round 8 (BUG B): round 7's max-width:100% only CLAMPS the\n row -- it never STRETCHES it. Without an explicit width, the row's own\n auto-sized (flex) box resolves to its unshrunk content width, which at\n wide viewports (e.g. 1920px, ~223px cell) is narrower than the cell\n (~164px natural vs ~223px available), leaving the chevron ~55px short\n of the cell's right edge. At ~1200px the cell (~120px) is coincidentally\n narrower than the row's natural width, so the pre-existing max-width\n clamp happened to make it flush there, masking the bug at that one\n width. width:100% makes the row fill the cell at EVERY viewport width\n so justify-content:space-between always pins the chevron flush right.\n min-width:0/max-width:100% are now redundant-but-harmless -- kept as-is\n (see fix_round 7 comment above for why they're still safe). */\n /* GENERIC-POOL-FIGMA-PARITY (fix_round 3, BUG 1): Figma node 19774-33763\n shows the pool slat title/status LEFT-aligned, but the base grid\n (.calendar/.calendar_overlay in index.styled.tsx) sets\n text-align: center, which this pool-gated block never overrode --\n measured alignChain on a live slat: DIV.pool-name:center <-\n .pool-name-row:center <- .cell:center. text-align: left here is\n inherited by .pool-name's own text (full-height layout, the only place\n it visibly matters -- .pool-name is a plain block div whose ellipsized\n text is centered/left-aligned directly by this property) and by\n .pool-status/.pool-status-text (compact + full-height status line,\n already effectively left via flex justify-content, but text-align is\n corrected here too for consistency). .pool-name-row only ever renders\n on pool bookings, so non-pool slats (no .pool-name-row in the DOM)\n never receive this rule -- byte-identical (AC6). */\n .pool-name-row {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 4px;\n width: 100%;\n min-width: 0;\n max-width: 100%;\n text-align: left;\n }\n /* VP-4470 fix_round 6: the name div fills the remaining row width on one\n ellipsized line (never wrap-then-clip), which pins the chevron flush\n against the slat's right edge via the row's existing space-between.\n Pool-only -- does NOT touch the shared .past/.upcoming rule below\n (AC6: non-pool rendering byte-identical). */\n .pool-name {\n flex: 1 1 auto;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n /* VP-4470 fix_round 6: keep the chevron trigger a fixed-width, right-\n pinned item so it never shrinks/drifts as the name above grows.\n The explicit width:auto is required alongside flex: 0 0 auto -- the\n app-wide button width:100% reset (styles/_reset.scss) otherwise\n becomes this item's flex-basis (flex-basis:auto resolves to the\n element's width property when one is set), making the trigger claim\n the row's FULL width and squeeze the name to 0 -- reproduced/verified\n via a real Chromium layout dump with that reset rule injected.\n GENERIC-POOL-FIGMA-PARITY (Issue 7): this selector still matches the\n COMPACT single-line layout's chevron ('.pool-name-row--compact' is a\n '.pool-name-row') -- untouched, already vertically centered via the\n 'align-items: center' rule below. The full-height layout's chevron\n moved out of '.pool-name-row' into '.pool-card-content' (see below),\n so it needs the identical fixed-width treatment repeated there. */\n .pool-name-row [data-testid='pool-member-picker-trigger'] {\n flex: 0 0 auto;\n width: auto;\n }\n /* GENERIC-POOL-FIGMA-PARITY (Issue 7): Figma centers the chevron\n vertically against the WHOLE full-height (two-line) pool slat, not\n just the title row it used to share with the patient name --\n live-measured before this fix: chevron center-Y sat ~18px above the\n slat's own center-Y (hugging the title line only). '.pool-name-row'\n only ever spans that one title line, so 'align-items' on it can't\n reach the second ('.pool-status') line below -- centering needs a\n row-flex wrapper around BOTH lines plus the chevron instead. This\n wrapper is the full-height layout's own top-level content node now\n (rendered in place of the old two-sibling Fragment); 'height: 100%'\n stretches it to the card's full (time-accurate, padding-adjusted)\n height so 'align-items: center' centers the chevron against that\n full height, not just its own text column's natural height. Compact\n ('.pool-name-row--compact', a flat single-line row) and every\n non-pool slat never render this wrapper -- untouched. */\n .pool-card-content {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 4px;\n width: 100%;\n height: 100%;\n min-width: 0;\n }\n .pool-card-content > .pool-card-text {\n display: flex;\n flex-direction: column;\n min-width: 0;\n flex: 1 1 auto;\n }\n .pool-card-content [data-testid='pool-member-picker-trigger'] {\n flex: 0 0 auto;\n width: auto;\n }\n /* VP-4470 fix_round 9: a compact stacked-lane pool slat (height <= 20,\n e.g. 3 bookings sharing a 30min slot -> 20px/lane) only has ~16px of\n content box (20px cell - 2*2px .compact padding) -- enough for ONE\n line. The full-height layout's second line (.pool-status, carrying the\n assigned member name or \"tap to assign\") would render entirely below\n that 16px box, where the stacked-lane cell's own overflow:hidden\n (hasLanes, see the inline style below) clips it to 0% visible --\n confirmed root cause of the round-8 QA report (bug_analysis.md\n fix_round 9). Height can't grow to fit two lines: each lane's\n top/height is time-accurate lane math (difference + laneIndex*height),\n so growing one lane's rendered px overlaps the next lane's box.\n Compact composes a SINGLE line instead (status text + chevron only,\n patient name omitted -- still reachable via the full-height layout /\n detail drawer): .pool-status becomes a shrinkable flex item (flex:1 1\n auto; min-width:0) so its already-ellipsizing .pool-status-text\n (existing rule above) can shrink to share the row with the\n fixed-width chevron, and a tighter line-height keeps the glyph box\n inside the compact cell's content height. Scoped to the\n .pool-name-row--compact modifier only -- the full-height two-line\n layout and every non-pool path are untouched. */\n .pool-name-row--compact {\n align-items: center;\n }\n .pool-name-row--compact .pool-status {\n flex: 1 1 auto;\n min-width: 0;\n line-height: 14px;\n }\n .pool-status {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 12px;\n font-weight: 600;\n line-height: 18px;\n }\n /* GENERIC-POOL-FIGMA-PARITY (fix_round 4, re-scoped by Issue 7): the\n FULL-HEIGHT (two-line, non-compact) pool slat renders poolStatusNode\n (.pool-status -> .pool-status-text) as a flex item along the COLUMN\n axis of '.pool-card-text' (Issue 7's text-column wrapper -- see\n above; previously a direct child of '.pool-card' itself before that\n wrapper existed) -- unlike the compact stacked-lane layout, where\n .pool-status is nested inside .pool-name-row--compact (scoped/\n constrained by the rule above) instead. As a flex item along that\n column's CROSS axis, .pool-status's automatic minimum size defaults\n to its min-content (the unshrunk nowrap text width, since the base\n rule above has no width constraint), so it refuses to shrink and the\n long \"Ketik untuk menugaskan\" (unassigned) / assigned-member-name\n text overflows horizontally past the slat's right edge into the next\n day column -- .pool-status-text's existing ellipsis CSS never\n engages because it's never actually squeezed. min-width: 0 defeats\n that flex-item auto-minimum so .pool-status can shrink to the\n column's width; max-width: 100% hard-clamps it (mirrors\n .pool-name-row above), giving .pool-status-text a bounded container\n so its ellipsis engages. The '.pool-card-text >' child combinator\n scopes this to the full-height layout ONLY -- it can never match the\n compact layout's .pool-status (nested one level deeper, inside\n .pool-name-row--compact, never inside .pool-card-text), so the\n fix_round 9 compact/stacked-lane min-height hazard is untouched.\n Deliberately NOT adding overflow: hidden to the base .pool-status\n rule (or here): .pool-status is also a flex item along the *main*\n (column) axis of .pool-card-text, and a non-'visible' overflow on a\n flex item zeroes its automatic min-height (CSS Flexbox section 4.5)\n instead of the content-based one -- the exact hazard the fix_round\n 7/9 comments above warn about for .pool-name-row. min-width/max-width\n bound the box directly without touching overflow, so this fix is\n safe on both axes. */\n .pool-card-text > .pool-status {\n min-width: 0;\n max-width: 100%;\n }\n /* VP-4470 fix_round 6: ellipsize the assigned-member/status text on one\n line instead of hard-clipping; pool-only, not shared with .past/\n .upcoming. */\n .pool-status-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0;\n }\n .past,\n .upcoming {\n font-size: 14px;\n font-weight: bold;\n margin-bottom: 2px;\n /* AS-985 FIX 21: was ellipsis + -webkit-line-clamp:2 (mobile-only media\n query) \u2014 cut long booking names off mid-word with no way to see the\n full text. Let it wrap fully instead of clamping, consistent with the\n FIX-16 day-off label treatment; the parent's overflow is now 'visible'\n (see the inline style below) so a wrapped 2+ line name is never cut\n vertically either. CSS-only, additive. */\n overflow-wrap: break-word;\n word-break: break-word;\n }\n /* z-index: 3; */\n"]);return D=function(){return e},e}var I=k.Ay.div.withConfig({componentId:"sc-b8198b94-0"})(D(),(function(e){return e.theme.colors.gray500}),f.M.mbDown,(function(e){return e.theme.colors.gray500}),(function(e){return e.theme.colors.gray800})),O=function(e){var n,t,l,d,p=e.booking,f=e.onClickDetailBooking,g=e.visible,k=void 0===g||g,D=e.pxPerMin,O=void 0===D?2:D,N=e.draggable,T=void 0!==N&&N,Y=e.onDragStart,F=e.isDragging,_=void 0!==F&&F,L=e.currentDate,z=e.dimmed,R=void 0!==z&&z,B=e.onPoolAssignSuccess,G=e.laneIndex,j=e.laneCount,U=e.poolGeometry,H=e.poolStackIndex,V=e.poolStackCount,W=e.onPoolSlotNavigate,$=e.hidePoolAssignAction,K=void 0!==$&&$,X=(0,x.A)().formatMessage,q=(0,a.useContext)(E.B).state,J=Boolean(j&&j>1),Q=T&&(0,A.Jd)(p),Z=(0,a.useRef)(null),ee=(0,a.useRef)(!1),ne=(0,b.A)(p.started_at||"","yyyy-MM-dd HH:mm:ss",new Date),te=(0,b.A)(p.ended_at||"","yyyy-MM-dd HH:mm:ss",new Date),oe=ne.getFullYear(),ie=ne.getMonth(),re=ne.getDate(),ae=(0,c.A)(ne,new Date(oe,ie,re,0,0,0)),le=(0,c.A)(te,ne),se=J?le/j:le,de=J?G*se:0,ce=J&&!U,ue=U?(0,C.Px)(ae):void 0,he=U&&void 0!==ue?(0,C.wY)(U,ue,null!==H&&void 0!==H?H:0):void 0,pe=U?C.KW:void 0,fe=!U&&se<=20,ve=Boolean(p.isPoolListing)&&!fe&&!ce,ge=p.assignedMember?"rgb(45, 135, 243)":"rgb(252, 116, 25)",me=p.status===P.Ae.UPCOMING&&P.bsk.includes((null===q||void 0===q||null===(n=q.userInfo)||void 0===n?void 0:n.role)||""),be=(0,s.A)(ne),we=function(e){var n="".concat((0,w.A)(e));n="".concat(n).padStart(2,"0");var t="".concat((0,y.A)(e));return t="".concat(t).padStart(2,"0"),"".concat(n,":").concat(t)},ye=(0,a.useMemo)((function(){return(null===p||void 0===p?void 0:p.appointmentType)===P.YYr.VIDEO_CALL}),[p]),xe=Q?{onPointerDown:function(e){Z.current={x:e.clientX,y:e.clientY},ee.current=!1;try{var n,t;null===(t=(n=e.currentTarget).setPointerCapture)||void 0===t||t.call(n,e.pointerId)}catch(o){}},onPointerMove:function(e){if(Z.current&&!ee.current){var n=e.clientX-Z.current.x,t=e.clientY-Z.current.y;Math.sqrt(n*n+t*t)>=4&&(ee.current=!0,null===Y||void 0===Y||Y(p,e))}},onPointerUp:function(e){Z.current=null;try{var n,t;null===(t=(n=e.currentTarget).releasePointerCapture)||void 0===t||t.call(n,e.pointerId)}catch(o){}}}:{},ke=p.assignedMember?(0,r.Y)("div",{className:"pool-status",style:{color:v.w.colors.primaryBase},children:(0,r.Y)("span",{className:"pool-status-text",children:p.assignedMember.name})}):(0,r.FD)("div",{className:"pool-status",style:{color:v.w.colors.yellow800},"aria-label":X({id:"admin.pool.unassigned",defaultMessage:"Unassigned"}),children:[me&&(0,r.Y)(S.A,{width:12,height:12}),(0,r.Y)("span",{className:"pool-status-text",children:X(me?{id:"admin.pool.tapToAssign",defaultMessage:"Tap to assign"}:{id:"admin.pool.unassigned",defaultMessage:"Unassigned"})})]});return(0,r.Y)(I,{children:(0,r.Y)("div",(0,i.A)((0,o.A)({style:(0,i.A)((0,o.A)({opacity:_?.4:k?R?.4:1:0,top:void 0!==he?"".concat(he,"px"):"calc(var(--px-per-min, ".concat(O,") * ").concat(ae+de," * 1px)"),position:"absolute",backgroundColor:be?"#F2F2F2":p.isPoolListing?p.assignedMember?"#E3F2FF":v.w.colors.yellow50:ye?v.w.colors.yellow50:"#E3F2FF",height:void 0!==pe?"".concat(pe,"px"):"calc(var(--px-per-min, ".concat(O,") * ").concat(se," * 1px)"),width:"100%"},p.isPoolListing?ve?{borderLeft:"3px solid ".concat(ge)}:{boxShadow:"inset 3px 0 0 ".concat(ge)}:{}),(d={display:"flex",flexDirection:"column",cursor:"pointer"},(0,h.A)(d,"--max-height",void 0!==pe?"".concat(pe,"px"):"calc(var(--px-per-min, ".concat(O,") * ").concat(se," * 1px)")),(0,h.A)(d,"fontSize",fe?"12px":"inherit"),(0,h.A)(d,"overflow",ce?"hidden":"visible"),d)),id:"js-booking-".concat(p.id),className:m()("cell event",{compact:fe,"pool-card":ve,"pool-geometry-event":Boolean(U)}),onClick:function(){if(ee.current)ee.current=!1;else{if(W&&L){var e=new Date(ne);return e.setMinutes(30*Math.floor((0,y.A)(ne)/30),0,0),void W({started:we(e)},L)}f(p.id)}},"data-draggable":Q||void 0,"data-dragging":_||void 0,"data-day":L?(0,u.A)(L,P.cuM):void 0,"data-started":we(ne),"data-ended":we(te),"data-schedule-id":U?void 0:(null===p||void 0===p||null===(t=p.schedule)||void 0===t||null===(l=t.slot)||void 0===l?void 0:l.schedule_id)||"booking-".concat(p.id),"data-booked":P._5h.BOOKED,"data-dimmed":R||void 0,"data-effective-top-minutes":ae+de,"data-effective-height-minutes":se,"data-lane-index":ce?G:void 0,"data-lane-count":ce?j:void 0,"data-pool-top-px":he,"data-pool-height-px":pe,"data-pool-stack-index":U?null!==H&&void 0!==H?H:0:void 0,"data-pool-stack-count":U?null!==V&&void 0!==V?V:1:void 0},xe),{children:p.isPoolListing?fe?(0,r.FD)("div",{className:"pool-name-row pool-name-row--compact",children:[ke,!K&&me&&(0,r.Y)(M.v,{booking:p,onAssigned:function(){return null===B||void 0===B?void 0:B()}})]}):(0,r.FD)("div",{className:"pool-card-content",children:[(0,r.FD)("div",{className:"pool-card-text",children:[(0,r.Y)("div",{className:"pool-name-row",children:(0,r.Y)("div",{className:m()("pool-name",be?"past":"upcoming"),children:p.name})}),ke]}),!K&&me&&(0,r.Y)(M.v,{booking:p,onAssigned:function(){return null===B||void 0===B?void 0:B()}})]}):(0,r.FD)(r.FK,{children:[(0,r.Y)("div",{className:be?"past":"upcoming",children:p.name}),(0,r.Y)("div",{className:"time",children:"".concat(we(ne)," - ").concat(we(te))})]})}))})},N=t(39765),T=t(36891),Y=t(45105),F=t(8859),_=t(90206),L=function(e){return+e.split(":")[0]},z=function(e){return+e.split(":")[1]},R=function(e){var n,t,o,i,l,s,d,h,p,f=e.schedule,g=e.currentDate,m=e.onClickAdd,b=e.isFirst,w=e.isLast,y=e.isEdit,k=e.onEdit,A=e.type,M=e.disableActionSchedule,C=void 0!==M&&M,E=e.onSetUnavailable,S=e.pxPerMin,D=void 0===S?2:S,I=e.allowCreateOnSlotClick,O=void 0!==I&&I,R=e.dragActive,B=void 0!==R&&R,G=e.isValidTarget,j=void 0!==G&&G,U=e.poolGeometry,H=e.onPoolSlotNavigate,V=e.poolSummaryOnly,W=void 0!==V&&V,$=(0,x.A)().formatMessage,K=Number(f.appointment_type),X=(0,a.useState)(),q=X[0],J=X[1],Q=new Date,Z=Q.getFullYear(),ee=Q.getMonth(),ne=Q.getDate(),te=(0,c.A)(new Date(Z,ee,ne,L(f.started),z(f.started),0),new Date(Z,ee,ne,0,0,0)),oe=(0,c.A)(new Date(Z,ee,ne,L(f.ended),z(f.ended),0),new Date(Z,ee,ne,L(f.started),z(f.started),0)),ie=void 0!==H&&void 0!==f.pool_capacity,re=W&&void 0!==f.pool_capacity&&(null!==(n=f.pool_bookings_count)&&void 0!==n?n:0)>=1,ae=(null!==(t=f.pool_bookings_count)&&void 0!==t?t:0)>=1||!0===f.pool_consumed,le=U?U.minutesToPx(te):void 0,se=U?U.minutesToPx(te+oe)-U.minutesToPx(te):void 0,de=(0,a.useMemo)((function(){return[{value:"appointment",name:$({id:"admin.schedule.create.appointment",defaultMessage:"Appointment"}),action:function(){return m(f,g)}},{value:"unavailable",name:$({id:"admin.schedule.create.setUnavailable",defaultMessage:"Set unavailable"}),action:function(){return null===E||void 0===E?void 0:E(f,g)}}]}),[$]);return(0,a.useEffect)((function(){"schedules"!==A||y||J(void 0)}),[y]),(0,r.FD)(N.tH,{differenceMinutes:te,durationMinutes:oe,pxPerMin:D,topPx:le,heightPx:se,className:"cell schedule ".concat(C?"hide-action-schedule":""),onMouseEnter:function(){ae||("schedules"===A?K===P.foO.TELEMEDICINE?J("set-unavailable"):J("full"):K!==P.foO.TELEMEDICINE&&J("appointment"))},onMouseLeave:function(){J(void 0)},onClick:function(){if(ie)null===H||void 0===H||H(f,g);else if(!C||O)if(C&&O)"schedules"!==A&&K!==P.foO.TELEMEDICINE&&m(f,g);else if("schedules"===A)if(K===P.foO.TELEMEDICINE){if(ae)return;null===E||void 0===E||E(f,g)}else null===k||void 0===k||k(f.schedule_id);else K!==P.foO.TELEMEDICINE&&m(f,g)},"data-appointment-type":K,"data-is-first":b,"data-is-last":w,"data-type":A,"data-schedule-id":f.schedule_id,"data-started":f.started,"data-ended":f.ended,"data-booked":f.booked,"data-day":(0,u.A)(g,P.cuM),"data-drag-active":B||void 0,"data-drag-valid":B?j:void 0,"data-pool-occupied":ae||void 0,"data-pool-bookings-count":void 0!==f.pool_capacity?null!==(o=f.pool_bookings_count)&&void 0!==o?o:0:void 0,"data-pool-capacity":f.pool_capacity,children:[void 0!==f.pool_capacity&&!re&&(0,r.FD)(N.uJ,{"data-testid":"pool-capacity-chip",$attention:(null!==(i=f.pool_unassigned_count)&&void 0!==i?i:0)>0,$clickable:ie,role:ie?"button":void 0,tabIndex:ie?0:void 0,"aria-label":ie?$({id:"admin.pool.chipAriaLabel",defaultMessage:"{n} of {c} booked, open pool schedule"},{n:null!==(l=f.pool_bookings_count)&&void 0!==l?l:0,c:f.pool_capacity}):void 0,onClick:ie?function(e){e.stopPropagation(),null===H||void 0===H||H(f,g)}:void 0,onKeyDown:ie?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),null===H||void 0===H||H(f,g))}:void 0,children:[null!==(s=f.pool_bookings_count)&&void 0!==s?s:0,"/",f.pool_capacity]}),re&&(0,r.FD)(N.Gk,{"data-testid":"pool-summary",$attention:(null!==(d=f.pool_unassigned_count)&&void 0!==d?d:0)>0,role:ie?"button":void 0,tabIndex:ie?0:void 0,"aria-label":ie?$({id:"admin.pool.chipAriaLabel",defaultMessage:"{n} of {c} booked, open pool schedule"},{n:null!==(h=f.pool_bookings_count)&&void 0!==h?h:0,c:f.pool_capacity}):void 0,onClick:ie?function(e){e.stopPropagation(),null===H||void 0===H||H(f,g)}:void 0,onKeyDown:ie?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),null===H||void 0===H||H(f,g))}:void 0,children:[(0,r.FD)(N.t9,{children:[null!==(p=f.pool_bookings_count)&&void 0!==p?p:0,"/",f.pool_capacity]}),(0,r.Y)(N._d,{children:$({id:"admin.pool.summaryLabel",defaultMessage:"bookings"})})]}),!0===f.pool_consumed&&(0,r.Y)(N.aw,{"data-testid":"pool-consumed-label",children:(0,r.Y)(T.T,{size:"n1",type:"semiBold",color:v.w.colors.gray600,children:$({id:"admin.schedule.poolConsumed.label",defaultMessage:"Booked via pool listing \u2014 cannot be removed"})})}),!C&&"full"===q&&(0,r.Y)(N.aw,{children:(0,r.Y)(Y.r,{data:de,button:(0,r.FD)("div",{children:[(0,r.Y)(T.T,{size:"n1",type:"semiBold",color:v.w.colors.primaryBase,children:$({id:"admin.booking.addNew",defaultMessage:"Add new"})}),(0,r.Y)(F.A,{})]})})}),!C&&"set-unavailable"===q&&(0,r.Y)(N.aw,{children:(0,r.Y)(T.T,{size:"n1",type:"semiBold",color:v.w.colors.gray600,children:$({id:"admin.schedule.create.setUnavailable",defaultMessage:"Set unavailable"})})}),(!C||O)&&"appointment"===q&&(0,r.FD)("div",{className:"add-new",children:[(0,r.Y)(_.A,{width:"16px",height:"16px"}),(0,r.Y)(T.T,{size:"n1",type:"semiBold",color:v.w.colors.primaryBase,children:$({id:"admin.booking.addNew",defaultMessage:"Add new"})})]})]})},B=t(66e3),G=t(1032),j=function(e){var n=e.unavailable,t=e.onRemoveUnavailable,o=e.visible,i=void 0===o||o,l=e.pxPerMin,s=void 0===l?2:l,d=e.disableActionSchedule,u=void 0!==d&&d,h=e.poolGeometry,p=(0,x.A)().formatMessage,f="00:00"===n.started&&"24:00"===n.ended,g=(0,b.A)("".concat(n.date," ").concat(n.started)||"","yyyy-MM-dd HH:mm",new Date),m=(0,b.A)("".concat(n.date," ").concat("24:00"===n.ended?"23:59":n.ended)||"","yyyy-MM-dd HH:mm",new Date),w=g.getFullYear(),y=g.getMonth(),k=g.getDate(),A=(0,c.A)(g,new Date(w,y,k,0,0,0)),M=(0,c.A)(m,g),C=h?h.minutesToPx(A):void 0,E=h?h.minutesToPx(A+M)-h.minutesToPx(A):void 0,P=(0,a.useState)(!1),S=P[0],D=P[1];return(0,r.Y)(N.FK,{visible:i?1:0,difference:A,height:M,pxPerMin:s,topPx:C,heightPx:E,id:"js-booking-".concat(n.id),"data-is-day-off":f,onMouseEnter:function(){D(!0)},onMouseLeave:function(){D(!1)},onClick:function(){u||null===t||void 0===t||t(n)},children:S&&(0,r.FD)(N.LX,{style:{alignItems:"flex-start",padding:"14px 6px 0 6px"},children:[(0,r.FD)("div",{className:"dayoff",children:[(0,r.Y)(B.A,{className:"remove"}),(0,r.Y)(T.T,{size:"n1",type:"semiBold",color:v.w.colors.violet600,children:p({id:"admin.schedule.create.remove",defaultMessage:"Unavailable"})})]}),!u&&(0,r.Y)(G.A,{className:"bin off"})]})})},U={availability:!0,past:!0,upcoming:!0,telemed:!0},H=function(e){var n=e.date,t=e.schedules,a=e.bookings,h=e.unavailable,p=e.pxPerMin,f=void 0===p?2:p,v=e.onClickDetailBooking,g=void 0===v?function(){}:v,m=e.onAddAppointment,b=void 0===m?function(){}:m,w=e.onSetUnavailable,y=e.onEdit,x=e.isChoosingAction,k=e.type,A=e.onRemoveUnavailable,M=e.disableActionSchedule,E=void 0!==M&&M,S=e.showOption,D=void 0===S?U:S,I=e.isClientRendered,T=void 0===I||I,Y=e.currentTimeDots,F=void 0===Y?"both":Y,_=e.allowCreateOnSlotClick,L=void 0!==_&&_,z=e.enableDragReschedule,B=void 0!==z&&z,G=e.draggingBookingId,H=e.onDragStart,V=e.isValidDropSlot,W=e.unassignedOnly,$=void 0!==W&&W,K=e.onPoolAssignSuccess,X=e.poolGeometry,q=e.onPoolSlotNavigate,J=e.poolSummaryOnly,Q=void 0!==J&&J,Z=e.hidePoolAssignAction,ee=void 0!==Z&&Z;return(0,r.FD)("div",{className:"day-hours","data-day-column":(0,u.A)(n,P.cuM),children:[D.availability&&function(e,n){var t=(0,l.A)(e);if(void 0!==n&&n.hasOwnProperty(t))return(0,r.Y)("div",{children:n[t].map((function(o,i){var a,l=Boolean((null===(a=n[t][i-1])||void 0===a?void 0:a.appointment_type)&&n[t][i-1].appointment_type!==o.appointment_type),s=Boolean(!n[t][i+1]||n[t][i+1].appointment_type!==o.appointment_type);return(0,r.Y)(R,{isFirst:l,isLast:s,schedule:o,onClickAdd:b,onSetUnavailable:w,currentDate:e,isEdit:x===o.schedule_id,onEdit:y,type:k,disableActionSchedule:E,pxPerMin:f,allowCreateOnSlotClick:L,dragActive:B&&null!=G,isValidTarget:!(!B||null==G)&&Boolean(null===V||void 0===V?void 0:V(o,e)),poolGeometry:X,onPoolSlotNavigate:q,poolSummaryOnly:Q},o.schedule_id)}))})}(n,t),!Q&&function(e,n){var a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],c=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(!a){var u=(0,s.A)(e);if(u)return null}var h=(0,l.A)(e);if(void 0!==n&&n.hasOwnProperty(h)){var p=n[h],v=new Map,m=new Map;p.forEach((function(e){if(e.isPoolListing){var n="".concat(e.started_at,"|").concat(e.ended_at),t=m.get(n)||[];t.push(e),m.set(n,t)}})),m.forEach((function(e){e.length<=1||e.forEach((function(n,t){v.set(n.id,{laneIndex:t,laneCount:e.length})}))}));var b=new Map;if(X){var w=new Map;p.forEach((function(e){if(e.isPoolListing){var n=(0,C.Px)((0,C.O4)(e.started_at)),t=w.get(n)||[];t.push(e),w.set(n,t)}})),w.forEach((function(e){e.forEach((function(n,t){b.set(n.id,{stackIndex:t,stackCount:e.length})}))}))}var y=new Map;if(X){var x=new Map;((null===t||void 0===t?void 0:t[h])||[]).forEach((function(e){e.started&&x.set(e.started,e.schedule_id)})),p.forEach((function(e){var n;if(e.isPoolListing){var t=null===(n=e.started_at)||void 0===n?void 0:n.slice(11,16),o=t?x.get(t):void 0;o&&y.set(e.id,o)}}))}return(0,r.Y)("div",{children:p.map((function(n){var t,a=!0;(d||n.appointmentType!==P.YYr.INPATIENT_HOSPITAL)&&(c||n.appointmentType!==P.YYr.VIDEO_CALL)||(a=!1);var l,s,u=v.get(n.id),h=b.get(n.id),p=y.get(n.id),m=p?(0,i.A)((0,o.A)({},n),{schedule:(0,i.A)((0,o.A)({},null!==(l=n.schedule)&&void 0!==l?l:{id:"",date:"",slot:{schedule_id:"",started:"",ended:""}}),{slot:(0,i.A)((0,o.A)({},null!==(s=null===(t=n.schedule)||void 0===t?void 0:t.slot)&&void 0!==s?s:{schedule_id:"",started:"",ended:""}),{schedule_id:p})})}):n;return(0,r.Y)(O,{booking:m,onClickDetailBooking:g,visible:a,pxPerMin:f,draggable:B,onDragStart:H,isDragging:G===n.id,currentDate:e,dimmed:$&&!!n.assignedMember,onPoolAssignSuccess:K,laneIndex:null===u||void 0===u?void 0:u.laneIndex,laneCount:null===u||void 0===u?void 0:u.laneCount,poolGeometry:X,poolStackIndex:null===h||void 0===h?void 0:h.stackIndex,poolStackCount:null===h||void 0===h?void 0:h.stackCount,onPoolSlotNavigate:q,hidePoolAssignAction:ee},n.id)}))})}}(n,a||{},D.past,D.upcoming,D.telemed),function(e){var n=(0,l.A)(e);if(void 0!==h&&h.hasOwnProperty(n))return(0,r.Y)("div",{children:h[n].map((function(e){return(0,r.Y)(j,{unavailable:e,onRemoveUnavailable:A,pxPerMin:f,disableActionSchedule:E,poolGeometry:X},e.id)}))})}(n),function(e){var n=(0,d.A)(e);if(T&&n){var t=new Date,o=t.getDate(),i=t.getMonth(),a=t.getFullYear(),l=(0,c.A)(t,new Date(a,i,o,0,0,0));return(0,r.Y)(N.oA,{style:{top:X?"".concat(X.minutesToPx(l),"px"):"calc(var(--px-per-min, ".concat(f,") * ").concat(l," * 1px)")},currentTimeDots:F,id:"currentTime"})}return null}(n)]})}},23800:function(e,n,t){t.d(n,{J:function(){return p}});var o=t(24537),i=t(81539),r=t(2445),a=(t(73884),t(35291)),l=t(27317);function s(){var e=(0,o.A)(["\n display: flex;\n flex-direction: column;\n"]);return s=function(){return e},e}function d(){var e=(0,o.A)(["\n height: 60px;\n"]);return d=function(){return e},e}var c=function(e,n){for(var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,o=[],r=e;r<=n;r++)for(var a=0;a<60;a+=t){var l=r<10?"0"+r:r,s=0===a?a+"0":a,d=l+":"+s;o=(0,i.A)(o).concat([d])}return o},u=l.Ay.div.withConfig({componentId:"sc-9844e111-0"})(s()),h=l.Ay.div.withConfig({componentId:"sc-9844e111-1"})(d()),p=function(e){var n,t=e.pxPerMin,o=void 0===t?2:t,i=e.rowHeights,l=30*o;return(0,r.Y)("div",{className:"timeline",children:(0,r.FD)("div",{className:"day-column",children:[(0,r.Y)(h,{className:"empty-title",children:(0,r.FD)("div",{style:{visibility:"hidden"},className:"date",children:[" ","Empty Cell"]})}),(0,r.Y)(u,{className:"day-hours",children:c(0,23).map((function(e,t){return(0,r.Y)("div",{className:"cell",style:{position:"relative",borderLeft:"1px solid #F1F2F4",flex:"0 0 ".concat(null!==(n=null===i||void 0===i?void 0:i[t])&&void 0!==n?n:l,"px")},children:(0,r.Y)("span",{style:{fontSize:"13px",paddingLeft:5},children:t%2!==0?i?(0,r.Y)("span",{"data-testid":"half-hour-label-".concat(t),style:{fontSize:11,color:a.w.colors.gray500,opacity:.45},children:e}):"":e})},"header-".concat(t))}))})]})})}},74828:function(e,n,t){t.d(n,{v:function(){return T}});var o=t(858),i=t(24537),r=t(83776),a=t(2445),l=t(73884),s=t(36891),d=t(35291),c=t(40454),u=t(25175),h=t(48542),p=t(95507),f=t(59850),v=t(84091),g=t(40959),m=t(10486),b=t.n(m),w=t(6442),y=t(91266),x=t(36259),k=t(27317),A=t(38606),M=t(23662),C=t(8859),E=t(8758);function P(){var e=(0,i.A)(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border: none;\n background: transparent;\n padding: 0 2px;\n cursor: pointer;\n line-height: 0;\n /* GENERIC-POOL-FIGMA-PARITY (Issue 9): the top-right-pinned\n StyledPoolCapacityChip (index.styled.tsx) was promoted above every\n booking slat (z-index: 5) so an N>0 chip is never hidden -- but the\n top-most lane of a same-time stacked cluster (and a solo full-height\n card before Issue 7's chevron-centering) shares that exact top-right\n corner with this trigger, since the schedule cell and its first lane\n start at the identical top offset with zero reserved gutter. Without\n its own stacking context this static-positioned button would fall\n back under the chip's new z-index across their whole overlap, making\n the assign/change chevron unclickable wherever the two coincide.\n position: relative (previously unset, purely additive -- keeps the\n button in normal flow) + a higher z-index than the chip's keeps this\n specific control on top of the badge, while the chip still wins\n everywhere else on the slat (the actual AC: elementFromPoint at the\n chip's own center must resolve to the chip, not the slat). */\n position: relative;\n z-index: 6;\n"]);return P=function(){return e},e}function S(){var e=(0,i.A)(["\n padding: 12px;\n min-width: 260px;\n /* VP-4470 fix_round 5 (Issue 2): Mantine's shift/flip middlewares only\n know about the viewport as a boundary, not our in-page sticky calendar\n header -- an unbounded-height dropdown can still get flipped/placed\n such that it overlaps that header when the trigger sits close to it (a\n real gap floating-ui's viewport-only collision detection can't close on\n its own). Capping the dropdown's own height and scrolling the overflow\n internally bounds how far it can ever reach in either direction,\n keeping it clear of the header in practice. */\n max-height: 280px;\n overflow-y: auto;\n\n .pool-picker-title {\n margin-bottom: 8px;\n }\n\n /* VP-4470 fix_round 5 (Issue 6): full-width hairline divider directly\n under the title, matching the Figma popover treatment (state2/state3\n assign/change-doctor popovers). Negative horizontal margin cancels this\n container's own 12px padding so the line spans the full popover width;\n Menu.Divider's own top/bottom spacing already gives the \"standard\n inset\" gap to the title above and the member list below. */\n .pool-picker-divider {\n margin-left: -12px;\n margin-right: -12px;\n }\n\n .pool-picker-row {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 4px;\n\n > div:nth-child(2) {\n flex: 1;\n }\n }\n\n .pool-picker-skeleton-row {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 4px;\n }\n\n .pool-picker-empty {\n padding: 16px 4px;\n text-align: center;\n }\n"]);return S=function(){return e},e}function D(){var e=(0,i.A)(["\n position: fixed;\n inset: 0;\n z-index: 9999;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(255, 255, 255, 0.6);\n"]);return D=function(){return e},e}var I=k.Ay.button.withConfig({componentId:"sc-63693fd5-0"})(P()),O=k.Ay.div.withConfig({componentId:"sc-63693fd5-1"})(S()),N=k.Ay.div.withConfig({componentId:"sc-63693fd5-2"})(D());function T(e){var n=e.booking,t=e.onAssigned,i=e.trigger,m=(0,w.A)().formatMessage,k=(0,l.useContext)(x.B).pushNotifications,P=(0,l.useState)(!1),S=P[0],D=P[1],T=(0,l.useState)(!1),Y=T[0],F=T[1],_=(0,l.useState)([]),L=_[0],z=_[1],R=(0,l.useState)(""),B=R[0],G=R[1],j=(0,l.useState)(!1),U=j[0],H=j[1],V=function(){var e=(0,o.A)((function(){var e,t;return(0,r.__generator)(this,(function(o){switch(o.label){case 0:return F(!0),[4,(0,v.W3)((0,v.er)(f.R.GET_ADMIN_BOOKING_ASSIGNABLE_MEMBERS,{bookingId:n.id}),"GET")];case 1:return e=o.sent(),t=null===e||void 0===e?void 0:e._data,z((Array.isArray(t)?t:null===t||void 0===t?void 0:t.members)||[]),F(!1),[2]}}))}));return function(){return e.apply(this,arguments)}}(),W=function(){var e=(0,o.A)((function(e){var o,i;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:return H(!0),[4,(0,v.W3)((0,v.er)(f.R.POST_ADMIN_BOOKING_ASSIGN_MEMBER,{bookingId:n.id}),"POST",{data:{member_id:e.id}})];case 1:return o=r.sent(),H(!1),o&&1===o._status?(G(""),D(!1),t(),k({message:m({id:"admin.pool.assignSuccess",defaultMessage:"{name} has been assigned"},{name:e.name}),type:"success"}),[2]):(null===o||void 0===o?void 0:o._error_code)===g.wG5?(k({message:m({id:"admin.pool.slotTaken",defaultMessage:"{name} was just assigned to another booking at {time} \u2014 please pick a different doctor."},{name:e.name,time:n.time}),type:"danger"}),V(),[2]):(null===o||void 0===o?void 0:o._error_code)===g.VNW?(G(m({id:"admin.pool.bookingNotUpcoming",defaultMessage:"This booking is no longer upcoming, so its doctor can no longer be changed."})),[2]):(i=m({id:"error.anErrorOccurred",defaultMessage:"An error occurred!"}),k({message:i,type:"danger"}),[2])}}))}));return function(n){return e.apply(this,arguments)}}(),$=n.assignedMember?m({id:"admin.pool.changeDoctor",defaultMessage:"Change Doctor"}):m({id:"admin.pool.assignDoctor",defaultMessage:"Assign a doctor"});return(0,a.FD)(a.FK,{children:[(0,a.FD)(p.W,{opened:S,onChange:function(e){D(e),e&&(G(""),V())},closeOnItemClick:!1,position:"bottom-end",shadow:"md",withinPortal:!0,offset:8,zIndex:998,middlewares:{shift:!0,flip:!0},positionDependencies:[Y,L.length,B],children:[(0,a.Y)(p.W.Target,{children:null!==i&&void 0!==i?i:(0,a.Y)(I,{type:"button","aria-label":$,"data-testid":"pool-member-picker-trigger",onClick:function(e){return e.stopPropagation()},onPointerDown:function(e){return e.stopPropagation()},children:(0,a.Y)(C.A,{width:12,height:12})})}),(0,a.Y)(p.W.Dropdown,{onClick:function(e){return e.stopPropagation()},onPointerDown:function(e){return e.stopPropagation()},children:(0,a.FD)(O,{"aria-busy":Y,"data-testid":"pool-member-picker",children:[(0,a.Y)(s.T,{className:"pool-picker-title",size:"p3",type:"bold",color:d.w.colors.gray800,children:$}),(0,a.Y)(p.W.Divider,{className:"pool-picker-divider"}),B&&(0,a.Y)(c.A,{type:"danger",text:B,contentIcon:(0,a.Y)(M.A,{}),closeIcon:(0,a.Y)(E.A,{}),onClose:function(){return G("")}}),Y?Array.from({length:3}).map((function(e,n){return(0,a.FD)("div",{className:"pool-picker-skeleton-row",children:[(0,a.Y)(y.A,{circle:!0,width:32,height:32}),(0,a.Y)(y.A,{width:"60%",height:16})]},n)})):0===L.length?(0,a.Y)("div",{className:"pool-picker-empty",children:(0,a.Y)(s.T,{size:"p3",color:d.w.colors.gray500,children:m({id:"admin.pool.picker.empty",defaultMessage:"No available doctors at this time"})})}):L.map((function(e){return(0,a.Y)(p.W.Item,{disabled:U,onClick:function(){return W(e)},"data-testid":"pool-member-picker-option-".concat(e.id),children:(0,a.FD)("div",{className:"pool-picker-row",children:[(0,a.Y)(u.A,{type:"rounded",size:"small",avatarUrl:e.avatar||void 0,alt:e.name,firstLetter:e.initials,backgroundColor:(0,A.R9)(e.id)}),(0,a.FD)("div",{children:[(0,a.Y)(s.T,{size:"p3",type:"bold",color:d.w.colors.gray800,children:e.name}),e.specialty&&(0,a.Y)(s.T,{size:"n1",color:d.w.colors.gray500,children:e.specialty})]})]})},e.id)}))]})})]}),U&&b().createPortal((0,a.Y)(N,{"data-testid":"pool-member-picker-overlay",children:(0,a.Y)(h.L,{})}),document.body)]})}},82471:function(e,n,t){t.d(n,{AI:function(){return p},GF:function(){return y},Jd:function(){return v},L7:function(){return g},Y6:function(){return E},ch:function(){return M},ej:function(){return C},hp:function(){return w},sN:function(){return f},vn:function(){return x},y2:function(){return k}});var o=t(40568),i=t(66298),r=t(82920),a=t(79672),l=t(65886),s=t(53303),d=t(25072),c=t(45351),u=t(40959),h="yyyy-MM-dd HH:mm:ss",p=function(e,n){if(!e)return"unavailable";var t;if(void 0!==e.pool_capacity){if((null!==(t=e.pool_bookings_count)&&void 0!==t?t:0)>=e.pool_capacity)return"booked"}else if(e.booked!==u._5h.AVAILABLE)return"booked";return function(e,n){if(!e||!(null===n||void 0===n?void 0:n.started))return!1;var t=(0,i.A)(e,u.cuM),o=(0,r.A)("".concat(t," ").concat(n.started),"".concat(u.cuM," HH:mm"),new Date);return(0,a.A)(o,new Date)}(n,e)?function(e){var n=null===e||void 0===e?void 0:e.appointment_type,t=Number(n);return 1===t||3===t||n===u.YYr.ALL||n===u.YYr.VIDEO_CALL}(e)?"valid":"unavailable":"past"},f=function(e,n){return"valid"===p(e,n)},v=function(e){if(!(null===e||void 0===e?void 0:e.started_at))return!1;var n=(0,r.A)(e.started_at,h,new Date);return e.appointmentType===u.YYr.VIDEO_CALL&&e.status===u.Ae.UPCOMING&&!(0,l.A)(n)},g=function(e){var n=(0,o.A)(e.split(":").map(Number),2);return 60*n[0]+n[1]},m=function(e){var n=(e%1440+1440)%1440,t=Math.floor(n/60),o=n%60;return"".concat(String(t).padStart(2,"0"),":").concat(String(o).padStart(2,"0"))},b=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(n.length){var t=n.find((function(n){var t=g(n.started),o=g(n.ended);return e>=t&&e5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6?arguments[6]:void 0,l=a?a(e-n):A(e,n,t),s=b(l,r[i]);if(s)return{day:o,slot:s}},C=function(e,n,t){return{fromLabel:[(null===e||void 0===e?void 0:e.started_at)?(0,c.o1)((0,r.A)(e.started_at,h,new Date),t):void 0,null===e||void 0===e?void 0:e.time].filter(Boolean).join(" \xb7 "),toLabel:n?[(0,c.o1)(n.day,t),"".concat(n.started," - ").concat(n.ended)].filter(Boolean).join(" \xb7 "):""}},E=function(e,n){return(null===e||void 0===e?void 0:e.message)?e.message:n}},39765:function(e,n,t){t.d(n,{D6:function(){return I},F1:function(){return D},FK:function(){return B},Gk:function(){return H},Hc:function(){return S},LX:function(){return R},TO:function(){return j},_d:function(){return W},aw:function(){return L},cQ:function(){return O},d4:function(){return E},oA:function(){return G},t9:function(){return V},tH:function(){return _},uJ:function(){return U},wE:function(){return z},zO:function(){return P}});var o=t(24537),i=t(68021),r=t(27317),a=t(40959);function l(){var e=(0,o.A)([""]);return l=function(){return e},e}function s(){var e=(0,o.A)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n "," {\n flex-wrap: wrap;\n align-items: stretch;\n flex-direction: column;\n width: 100%;\n }\n\n .dropdown {\n min-width: 160px;\n margin-right: 16px;\n }\n .checkbox {\n margin-right: 8px;\n }\n\n /* VP-4473 polish (fix_round 4, Defect 2): '.skip-buttons' is a flex ITEM\n of the '.d-flex' wrapper above ('.d-flex { display: flex }', default\n align-items: stretch) but was never a flex container itself, so its two\n svgs (block-level) stacked vertically instead of sitting\n side-by-side next to the 'This week' dropdown. 'display: flex;\n align-items: center' makes it a horizontal row, centered against the\n stretched height of the StyledTime dropdown sibling. The old\n 'margin-top: 10px' was compensating for the stacked layout and would\n misalign the row now, so it's removed. */\n .skip-buttons {\n display: flex;\n align-items: center;\n white-space: nowrap;\n > svg {\n overflow: visible;\n cursor: pointer;\n &:first-of-type {\n margin-right: 8px;\n transform: rotate(180deg);\n }\n &[data-is-first-week='true'],\n &[data-is-last-week='true'] {\n opacity: 0.3;\n pointer-events: none;\n }\n }\n }\n & {\n .week_display {\n min-width: 200px;\n margin-right: 6px;\n font-size: 14px;\n }\n }\n\n .edit-btn {\n color: ",";\n margin-right: 10px;\n }\n\n /* GENERIC-POOL-FIGMA-PARITY (fix_round 3, BUG 2): pool listings render an\n extra \"Unassigned only\" ChipButton (index.tsx, isPoolListing-gated) in\n the right-hand '.d-flex.sp-mt-10' group that non-pool pages never\n render. That extra pill's width pushed the row's total content past the\n viewport at 1200px (measured: Create/Cipta dropdown right edge 1257px\n vs innerWidth 1200 -- 57px clipped offscreen) because\n '.d-flex.sp-mt-10' has no wrap, so its content (checkboxes + chip +\n Create) all stays on one line and simply overflows once it no longer\n fits. Scoped entirely under '[data-pool=\"true\"]' (set on this\n component only when isPoolListing is true, see index.tsx) so non-pool\n doctors -- who never render the attribute -- match zero of this CSS\n and stay byte-identical (AC6); '.d-flex'/'.d-flex-center'/'.sp-mt-10'\n themselves (global utility classes) are left untouched, only overridden\n via this compound/scoped selector.\n - flex-wrap: wrap on '.d-flex.sp-mt-10' lets the Create dropdown drop to\n its own second line instead of overflowing the viewport once the\n group no longer fits on one line.\n - white-space: nowrap on the checkbox labels stops \"Yang lepas\" (Past)\n from wrapping to two lines (measured height 34px vs 17px at 1920) now\n that the group has to share width with the chip. */\n &[data-pool='true'] {\n .d-flex.sp-mt-10 {\n flex-wrap: wrap;\n row-gap: 8px;\n }\n .d-flex-center label {\n white-space: nowrap;\n }\n }\n"]);return s=function(){return e},e}function d(){var e=(0,o.A)(["\n position: relative;\n display: table;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n .timeline {\n display: table-cell;\n width: 60px;\n vertical-align: top;\n\n "," {\n width: 45px;\n }\n\n .day-column {\n width: 60px;\n min-width: 0;\n\n "," {\n width: 45px;\n }\n }\n .empty-title {\n height: 60px;\n border-width: 1px 0px 1px 1px;\n "," {\n height: 56px;\n }\n }\n }\n .day-column {\n min-width: 150px;\n flex: 1 1 auto;\n border-collapse: collapse;\n border: 0.1px solid ",";\n\n min-width: 14.28%;\n width: 14.28%;\n &:last-child {\n border-right: 1px solid #f1f2f4;\n }\n .date {\n font-size: 14px;\n line-height: 22px;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n }\n\n .day-hours {\n position: relative;\n display: flex;\n flex-direction: column;\n }\n\n .cell {\n display: flex;\n flex: 1 1 60px;\n align-items: flex-start;\n justify-content: flex-start;\n &:last-child {\n border-bottom: 1px solid #f1f2f4;\n }\n /* GENERIC-POOL-FIGMA-PARITY ROUND 10b (FIX-3): the rule above was\n written for Schedule.tsx's own '.cell.schedule' rows, which really\n ARE siblings under one shared wrapper (renderSchedules maps them all\n into a single wrapper div), so ':last-child' correctly singles out\n only the true last one. Event.tsx's '.cell.event' never shares that\n wrapper -- CalendarColumn's 'renderEvents' wraps EVERY Event in its\n OWN private StyledEvent div, so each '.cell' is trivially both the\n first AND the last (and only) child of ITS OWN parent, making\n ':last-child' match unconditionally on every single Event, not just\n a genuinely-last one. Confirmed live via computed style (round 10b\n QA): every stacked '.pool-card' under the round-9 expanded-row\n geometry reported border-bottom: 1px solid rgb(241,242,244), rendering\n a ~2px seam between flush slats -- item 2 requires zero border\n between them. Gated on 'poolGeometry' (the 'pool-geometry-event'\n modifier, Event.tsx) -- the ONLY place slats stack (a page-level\n 'isPoolListing' flag on) -- so Schedule's own genuine last-child\n behaviour, and every non-pool-geometry Event (including a member's\n single pool-assigned booking with 'poolGeometry' undefined, e.g.\n 13245), are byte-identical (AC6). Same specificity as the rule above\n (class + pseudo-class vs two classes); declared after it in this same\n block, so it wins on cascade order. Sets border-bottom-WIDTH only\n (not the shorthand) so the winning declaration is unambiguous per\n CSS property, and 'border-bottom-width' computed style resolves to a\n plain '0px' rather than relying on a style:none collapse -- the\n regression guard (Event.pool-seam.test.tsx) asserts exactly that. */\n &.pool-geometry-event {\n border-bottom-width: 0px;\n }\n }\n .calendar {\n display: flex;\n /* border: 0.1px solid ","; */\n border-collapse: collapse;\n text-align: center;\n "," {\n &.sticky {\n z-index: 1;\n top: 64px;\n position: sticky;\n background-color: ",";\n }\n }\n }\n .heading {\n min-height: 60px;\n border: 1px solid #f1f2f4;\n border-width: 1px 0px 1px 1px;\n "," {\n min-height: 56px;\n &:last-child {\n border-right-width: 1px;\n }\n }\n .heading-wrap {\n height: 100%;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n padding: 4px 0;\n }\n }\n .calendar_overlay {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n width: 100%;\n height: 100%;\n border-collapse: collapse;\n text-align: center;\n\n /* AS-1026 FIX A (TC-04): scope 'position: relative' to the overlay's\n OWN '.day-column' wrapper only (not the shared '.day-column' rule\n above, used by the background grid / timeline elsewhere in this\n file). The drag ghost ('StyledDragGhost', 'position: absolute; width:\n 100%') is mounted directly inside this overlay day-column -- without\n a positioned ancestor here, its 'width: 100%'/'top' resolved against\n THIS '.calendar_overlay' (itself 'position: absolute; width: 100%',\n spanning all 7 columns) instead of its own one-column box, rendering\n ~7x too wide. Every existing child of this overlay column (Schedule/\n Event/UnavailableLayer, all rendered inside CalendarColumn's own\n '.day-hours', which is already 'position: relative' and NESTED\n inside this) is unaffected -- their absolutely-positioned children\n still resolve against '.day-hours' (the nearer positioned ancestor),\n unchanged. This only newly establishes a positioning context for the\n ghost, the sole element positioned directly against the overlay's\n day-column itself. */\n .day-column {\n position: relative;\n }\n }\n\n "," {\n .sticky {\n position: sticky;\n z-index: 8;\n top: 312px;\n background-color: white;\n }\n\n &[data-is-in-schedule='true'] {\n .sticky {\n top: 136px;\n }\n }\n }\n"]);return d=function(){return e},e}function c(){var e=(0,o.A)(["\n z-index: 10;\n min-width: 186px;\n margin-right: 16px;\n\n "," {\n flex: 1;\n }\n\n .time {\n input {\n height: 40px;\n }\n }\n"]);return c=function(){return e},e}function u(){var e=(0,o.A)(["\n position: relative;\n display: flex;\n justify-content: flex-end;\n & > img {\n position: absolute;\n top: -32px;\n right: 12px;\n cursor: pointer;\n }\n"]);return u=function(){return e},e}function h(){var e=(0,o.A)(["\n margin-top: -16px;\n padding-top: 16px;\n background-color: ",";\n padding-bottom: 16px;\n\n "," {\n position: sticky;\n z-index: 10;\n top: 238px;\n &[data-is-in-schedule='true'] {\n top: 64px;\n }\n }\n\n "," {\n padding-left: 16px;\n padding-right: 16px;\n }\n"]);return h=function(){return e},e}function p(){var e=(0,o.A)(["\n 0% {\n box-shadow: 0 0 0 0 rgba(45, 135, 243, 0.45);\n }\n 70% {\n box-shadow: 0 0 0 6px rgba(45, 135, 243, 0);\n }\n 100% {\n box-shadow: 0 0 0 0 rgba(45, 135, 243, 0);\n }\n"]);return p=function(){return e},e}function f(){var e=(0,o.A)(["\n /* z-index: 1; */\n\n top: ",";\n height: ",";\n position: absolute;\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background-color: ",";\n\n &[data-appointment-type] {\n &::before {\n content: '';\n position: absolute;\n /* VP-4470 fix_round 5 (Issue 1a): was left: 2px, inset 2px from the\n cell's own left edge (which itself sits flush against the day\n column's grid line -- confirmed via live computed-style\n measurement). Flush the bar with that grid line instead. */\n left: 0;\n width: 3px;\n height: ",";\n }\n\n &[data-is-first='true'] {\n &::before {\n margin-top: ",";\n height: calc("," - ",");\n border-top-right-radius: 2px;\n border-top-left-radius: 2px;\n }\n }\n &[data-is-last='true'] {\n &::before {\n height: calc("," - ",");\n border-bottom-right-radius: 2px;\n border-bottom-left-radius: 2px;\n }\n }\n }\n\n &[data-appointment-type='","'] {\n &::before {\n background-color: ",";\n }\n }\n &[data-appointment-type='","'] {\n &::before {\n background-color: ",";\n }\n }\n &[data-appointment-type='","'] {\n &::before {\n background-color: ",";\n }\n }\n\n &:not([data-appointment-type='","']) {\n &:hover {\n cursor: pointer;\n outline: 1px solid ",";\n background-color: white;\n }\n\n &.hide-action-schedule {\n &:hover {\n outline: none;\n background-color: ",";\n pointer-events: none;\n }\n }\n }\n\n &[data-type='schedules'] {\n &:hover {\n cursor: pointer;\n outline: 1px solid ",";\n background-color: white;\n }\n\n &.hide-action-schedule {\n &:hover {\n outline: none;\n background-color: ",";\n pointer-events: none;\n }\n }\n }\n\n /* GENERIC-POOL-FIGMA-PARITY ROUND 14: round 12 gated the JS half of the\n set-unavailable affordance (the label + click handler in Schedule.tsx)\n on poolSlotOccupied but left the pure-CSS :hover rules above ungated\n -- hovering the residual area of an occupied pool slot still painted\n the empty-slot hover treatment (white background, neutral100 outline,\n pointer cursor), i.e. the full \"clickable empty slot\" look minus the\n label. Neutralise it back to the slot's own resting paint (green50,\n no outline, default cursor) -- mirrors the .hide-action-schedule\n idiom above, minus its pointer-events: none: AS-1026's drag-\n reschedule hook resolves its drop target via elementFromPoint reading\n data-schedule-id off whatever element is under the cursor, so\n removing this slot from hit-testing would silently break dragging a\n booking INTO a partially-filled pool slot. The two :not()s are not\n decoration -- at equal specificity, source order alone would let this\n rule eat AS-1026's drag-valid highlight or round 10's focus-highlight\n pulse when the cursor happens to rest on an occupied slot; excluding\n both states explicitly makes this order-independent. data-pool-\n occupied is only ever 'true' for a pool-listing slot with >=1 booking\n (see Schedule.tsx) -- non-pool and empty-pool slots never render the\n attribute at all, so this rule can't match for them (byte-identical,\n AC6).\n Pre-QA scope-leak fix: this rule must NOT reach the availability\n OVERVIEW (availabilityOverview/index.tsx passes disableActionSchedule,\n which becomes the hide-action-schedule class on the slot -- see\n Schedule.tsx). There, an occupied pool slot is genuinely clickable\n (the whole cell short-circuits to onPoolSlotNavigate and navigates to\n the pool schedule), and it already has its own hover treatment via the\n .hide-action-schedule block above. The set-unavailable affordance\n this round is neutralising can only exist when disableActionSchedule\n is false (the 'Set unavailable' label only renders under\n !disableActionSchedule, see Schedule.tsx), so the :not(.hide-action-\n schedule) guard below scopes this rule to exactly where that\n affordance can occur, leaving the overview's occupied pool slots on\n their existing, unmodified hover treatment. */\n &[data-pool-occupied='true']:not(.hide-action-schedule):not([data-drag-active='true']):not([data-focus-highlight='true']) {\n &:hover {\n cursor: default;\n outline: none;\n background-color: ",";\n }\n }\n\n .add-new {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 4px;\n svg {\n width: 16px;\n }\n }\n\n .schedule {\n height: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 6px;\n }\n\n /* AS-1026 AC1: while a drag-reschedule gesture is in progress, valid\n open same-doctor slots highlight; everything else (booked/past/\n telemed-incompatible) is muted and non-interactive for the drag. Both\n attributes default unset (dragActive=false), so this block has zero\n effect on any existing caller. */\n &[data-drag-active='true'] {\n &[data-drag-valid='true'] {\n outline: 2px solid\n ",";\n background-color: ",";\n cursor: pointer;\n }\n &[data-drag-valid='false'] {\n opacity: 0.35;\n pointer-events: none;\n }\n }\n\n /* GENERIC-POOL-FIGMA-PARITY ROUND 10: brief highlight for the slot a\n pool-listing overview chip/click navigated the admin to (WeeklyCalendar's\n 'focusSlot' effect sets this attribute to 'true' for ~2000ms, then --\n ROUND 10b FIX-4 -- to 'done', permanently, instead of removing it; only\n 'true' matches this rule, so the visible behaviour is unchanged, but\n 'done' leaves a queryable, latency-proof marker that the pulse actually\n completed). Reuses the same outline idiom as the drag-valid highlight\n above; the pulse keyframe is a new, additive animation scoped to this\n one attribute\n selector -- every existing caller never sets 'data-focus-highlight', so\n this rule never matches for them (byte-identical, AC6). */\n &[data-focus-highlight='true'] {\n outline: 2px solid ",";\n outline-offset: -2px;\n animation: "," 1s ease-out 2;\n }\n"]);return f=function(){return e},e}function v(){var e=(0,o.A)(["\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n\n .remove-unavailable {\n background-color: white;\n }\n\n svg > path {\n stroke: ",";\n width: 16px;\n height: 16px;\n }\n div {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n }\n ul {\n margin: 1px 0;\n min-width: 100px;\n width: 100%;\n }\n"]);return v=function(){return e},e}function g(){var e=(0,o.A)(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 9px 12px 9px 16px;\n gap: 8px;\n width: max-content;\n height: 42px;\n\n color: ",";\n background-color: ",";\n border-radius: 4px;\n\n font-weight: 700;\n font-size: 14px;\n line-height: 22px;\n svg > path {\n stroke: ",";\n width: 18px;\n height: 18px;\n }\n"]);return g=function(){return e},e}function m(){var e=(0,o.A)(['\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n padding: 2px 6px 0 6px;\n\n /* FIX 16: at narrow column widths (e.g. the overview\'s Compact density,\n 80px columns) "width: fit-content" on .dayoff forced the label onto one\n unbreakable line, which the parent StyledUnavailableLayer\'s\n "overflow: hidden" then clipped mid-word instead of wrapping. Let it\n shrink/wrap within the available row width instead of demanding its\n natural unwrapped width \u2014 same visual treatment at normal/wide widths\n where it already fits on one line. */\n .dayoff {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1 1 auto;\n min-width: 0;\n gap: 4px;\n border-radius: 4px;\n background-color: ',";\n width: fit-content;\n max-width: 100%;\n padding: 0 2px;\n margin-bottom: 4px;\n\n span {\n white-space: normal;\n word-break: break-word;\n }\n }\n svg {\n flex: none;\n width: 16px;\n "," {\n display: none;\n }\n }\n .remove {\n path {\n stroke: ",";\n }\n }\n .bin {\n path {\n stroke: ",";\n }\n }\n .off {\n margin-top: 4px;\n }\n"]);return m=function(){return e},e}function b(){var e=(0,o.A)(["\n position: absolute;\n opacity: ",";\n /* AS-1013: same calc(var(--px-per-min, pxPerMin) * minutes * 1px) scaling\n as StyledSchedule -- see StyledScheduleProps comment above. difference/\n height here are already raw minutes (attrs default 1/15), unchanged by\n this fix; only how the px value is computed changed.\n GENERIC-POOL-FIGMA-PARITY ROUND 9: topPx/heightPx (additive/optional\n -- set by UnavailableLayer.tsx only when its caller's poolGeometry\n prop is present) override the linear calc() with the pre-resolved pool\n geometry px value; every non-pool caller never sets these, so this\n stays byte-identical (AC6). */\n top: ",";\n height: ",";\n max-height: ",";\n font-size: ",';\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n /* AS-985 FIX 21: was "overflow: hidden" \u2014 on a short time-span block\n (e.g. a 30min "Tidak Tersedia" block at normal density, ~60px tall)\n the on-hover StyledDayOff label (FIX 16 already lets ".dayoff span"\n wrap instead of clipping mid-word) still had its WRAPPED lines cut off\n vertically by this parent\'s overflow:hidden once the label needed more\n vertical space than the block\'s own time-accurate height. The label is\n hover-only (StyledDayOff only renders when "showAction" is true, see\n UnavailableLayer.tsx) so letting it spill outside the block\'s box reads\n like a tooltip, not a layout break \u2014 the block\'s own top/height/\n max-height (this layer\'s actual TIME-SPAN position/size) are untouched,\n only whether overflowing hover content is clipped or shown. CSS-only,\n additive; the always-visible striped background rectangle is a\n "background" property on this element itself (not a clipped child), so\n it is unaffected by this change. */\n overflow: visible;\n background: repeating-linear-gradient(\n -45deg,\n ',",\n "," 1px,\n white 0,\n white 3px\n );\n\n &:hover {\n cursor: pointer;\n background: ",";\n }\n .off {\n /* height: 100%; */\n margin-top: 4px;\n }\n"]);return b=function(){return e},e}function w(){var e=(0,o.A)(["\n position: absolute;\n height: 2px;\n background-color: #2d87f3;\n width: 100%;\n z-index: 7;\n display: flex;\n\n ","\n\n ","\n"]);return w=function(){return e},e}function y(){var e=(0,o.A)(["\n position: absolute;\n top: ",";\n height: ",";\n width: 100%;\n pointer-events: none;\n z-index: 6;\n border-radius: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n font-weight: 600;\n border: 2px dashed\n ",";\n background-color: ",";\n color: ",";\n"]);return y=function(){return e},e}function x(){var e=(0,o.A)(["\n cursor: pointer;\n &:hover,\n &:focus-visible {\n outline: 1px solid ",";\n outline-offset: 1px;\n }\n "]);return x=function(){return e},e}function k(){var e=(0,o.A)(["\n position: absolute;\n /* GENERIC-POOL-FIGMA-PARITY ROUND 11: the '$stacked' 'top: -20px' nudge\n from VP-4470 fix_round 6 (see the removed comment this replaces) was\n written for the pool CALENDAR page's old compact/lane layout, back when\n '$stacked' could be true there too. Round 9's expanded-row model\n ('poolGeometry') gave every pool calendar slot its own dedicated chip\n header strip and gated the nudge OFF wherever 'poolGeometry' drives\n geometry ('Schedule.tsx': '$stacked = !poolGeometry && count > 1') --\n but 'poolGeometry' is only ever present on the calendar page, never on\n the availability OVERVIEW, so since round 9 this nudge fired\n exclusively on the overview, lifting the chip 20px above its own slot's\n top edge into the row above -- a live user-reported defect (\"the orange\n chip 3/5 ... bleeds over the time slot to the previous/above slot\",\n Aug-3 10:00 3-booking stack, day view, Biasa density). The chip must\n stay inside its own slot box unconditionally; 'right: 28px' below is\n unaffected (that is chevron clearance, not the vertical bleed) and the\n lane-0 chevron/label overlap this used to dodge is an accepted,\n visually-verified tradeoff (self-smoke, round 11) now that the chip\n sits at the slot's normal top edge instead of floating outside it. */\n top: 4px;\n /* GENERIC-POOL-FIGMA-PARITY ROUND 11 ITEM 1b v2: the '$stacked'-gated\n 'right: 28px' chevron-clearance offset (VP-4470 fix_round 6, Item 4;\n see the removed 'StyledPoolCapacityChipProps' comment for the full\n history) is retired -- the availability overview's pool-listing column\n no longer renders any booking cards in a chip slot ('poolSummaryOnly'\n on CalendarColumn), so there is no chevron left to clear, and the pool\n CALENDAR page always set 'poolGeometry', which forced '$stacked' false\n there unconditionally. 'right: 6px' is therefore unconditional now. */\n right: 6px;\n padding: 1px 6px;\n border-radius: 10px;\n font-size: 11px;\n font-weight: 600;\n line-height: 16px;\n background-color: ",";\n color: ",";\n /* GENERIC-POOL-FIGMA-PARITY (Issue 9): booking Event slats (Schedule.tsx's\n sibling, rendered afterward in CalendarColumn) are also position:absolute\n with an auto z-index, so DOM order alone let the slat paint over this\n chip whenever a booking's box happened to cover the same top-right\n corner (any non-empty schedule slot). Neither this chip's parent\n (StyledSchedule) nor Event's own box sets an explicit z-index, so a\n single explicit value here is enough to promote the chip above every\n slat in the shared .day-hours stacking context, without touching\n Event/Schedule's own z-index (pool- and non-pool-gated alike stay\n exactly as before).\n GENERIC-POOL-FIGMA-PARITY ROUND 10b (FIX-2, REVERTED in round 11 -- see\n below): raised 5 -> 10 while '$stacked' was true, to stop the sticky\n overview header stealing clicks from a chip that round 6's 'top: -20px'\n nudge had lifted OUTSIDE its own slot box and INTO the header's box.\n ROUND 11: that nudge is gone (top is now unconditionally 4px, see\n above), so a '$stacked' chip never leaves its own slot box and never\n needs to \"win\" against the sticky header -- it should occlude under the\n header exactly like every non-'$stacked' chip already correctly does.\n Empirically re-verified (round 11 self-smoke, real CDP scroll +\n elementFromPoint sweep through the header-overlap transition): with the\n elevation still in place, a '$stacked' chip visibly floats ON TOP of\n the overview's sticky '.doctor-column-header' while its row scrolls\n underneath -- the exact \"occluded chip is fine, a FLOATING one is not\"\n distinction the round 11 spec draws, now failing in the wrong\n direction. No click-theft was found at the base z-index in the same\n sweep (a non-'$stacked' chip at z-index 5 already occludes cleanly with\n no theft), so the elevation is not defending against anything real\n anymore. Reverted to an unconditional base value, matching the\n pre-FIX-2 behaviour and the pool CALENDAR page's own chip (which never\n set '$stacked' and always used this same base value). */\n z-index: 5;\n\n /* GENERIC-POOL-FIGMA-PARITY ROUND 10: pointer + keyboard-focus affordance,\n only when the overview wires 'onPoolSlotNavigate' (see 'Schedule.tsx''s\n '$clickable' usage). Every other caller ('$clickable' unset) keeps this\n chip purely decorative/non-interactive, exactly as before. */\n ","\n"]);return k=function(){return e},e}function A(){var e=(0,o.A)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n max-width: 100%;\n padding: 2px 6px;\n border-radius: 4px;\n background-color: ",";\n color: ",";\n\n /* Always rendered only when 'onPoolSlotNavigate' is wired (see\n 'Schedule.tsx''s 'canNavigatePool' gate) -- same clickable affordance\n 'StyledPoolCapacityChip''s '$clickable' uses. */\n cursor: pointer;\n &:hover,\n &:focus-visible {\n outline: 1px solid ",";\n outline-offset: 1px;\n }\n"]);return A=function(){return e},e}function M(){var e=(0,o.A)(["\n font-size: 14px;\n font-weight: 700;\n line-height: 18px;\n white-space: nowrap;\n"]);return M=function(){return e},e}function C(){var e=(0,o.A)(["\n font-size: 10px;\n font-weight: 600;\n line-height: 12px;\n white-space: nowrap;\n"]);return C=function(){return e},e}var E=r.Ay.div.withConfig({componentId:"sc-23fc7859-0"})(l()),P=r.Ay.div.withConfig({componentId:"sc-23fc7859-1"})(s(),i.M.mbDown,(function(e){return e.theme.colors.primaryBase})),S=r.Ay.div.withConfig({componentId:"sc-23fc7859-2"})(d(),i.M.tdDown,i.M.tdDown,i.M.mbDown,(function(e){return e.theme.colors.neutral100}),(function(e){return e.theme.colors.neutral100}),i.M.mbDown,(function(e){return e.theme.colors.white}),i.M.mbDown,i.M.tdUp),D=r.Ay.div.withConfig({componentId:"sc-23fc7859-3"})(c(),i.M.mbDown),I=r.Ay.div.withConfig({componentId:"sc-23fc7859-4"})(u()),O=r.Ay.header.withConfig({componentId:"sc-23fc7859-5"})(h(),(function(e){return e.theme.colors.white}),i.M.tdUp,i.M.mbDown),N=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return"calc(var(--px-per-min, ".concat(e.pxPerMin,") * ").concat(n," * 1px").concat(t?" - ".concat(t,"px"):"",")")},T=function(e){return void 0!==e.heightPx?"".concat(e.heightPx,"px"):N(e,e.durationMinutes)},Y=function(e){return void 0!==e.heightPx?"".concat(Math.min(4,e.heightPx/2),"px"):"min(4px, calc(".concat(N(e,e.durationMinutes)," / 2))")},F=(0,r.i7)(p()),_=r.Ay.div.withConfig({componentId:"sc-23fc7859-6"})(f(),(function(e){return void 0!==e.topPx?"".concat(e.topPx,"px"):N(e,e.differenceMinutes)}),T,(function(e){return e.theme.colors.green50}),T,Y,T,Y,T,Y,a.foO.BOTH,(function(e){return e.theme.colors.green700}),a.foO.OUTPATIENT,(function(e){return e.theme.colors.primaryBase}),a.foO.TELEMEDICINE,(function(e){return e.theme.colors.yellow900}),a.foO.TELEMEDICINE,(function(e){return e.theme.colors.neutral100}),(function(e){return e.theme.colors.green50}),(function(e){return e.theme.colors.neutral100}),(function(e){return e.theme.colors.green50}),(function(e){return e.theme.colors.green50}),(function(e){return e.theme.colors.primaryBase}),(function(e){return e.theme.colors.blue50}),(function(e){return e.theme.colors.primaryBase}),F),L=r.Ay.div.withConfig({componentId:"sc-23fc7859-7"})(v(),(function(e){return e.theme.colors.primaryBase})),z=r.Ay.div.withConfig({componentId:"sc-23fc7859-8"})(g(),(function(e){return e.theme.colors.white}),(function(e){return e.theme.colors.primaryBase}),(function(e){return e.theme.colors.white})),R=r.Ay.div.withConfig({componentId:"sc-23fc7859-9"})(m(),(function(e){return e.theme.colors.violet50}),i.M.mbDown,(function(e){return e.theme.colors.violet600}),(function(e){return e.theme.colors.gray600})),B=r.Ay.div.attrs((function(e){return{difference:e.difference||1,height:e.height||15,visible:e.visible||1,pxPerMin:e.pxPerMin||2}})).withConfig({componentId:"sc-23fc7859-10"})(b(),(function(e){return e.visible}),(function(e){return void 0!==e.topPx?"".concat(e.topPx,"px"):"calc(var(--px-per-min, ".concat(e.pxPerMin,") * ").concat(e.difference," * 1px)")}),(function(e){return void 0!==e.heightPx?"".concat(e.heightPx,"px"):"calc(var(--px-per-min, ".concat(e.pxPerMin,") * ").concat(e.height," * 1px)")}),(function(e){return void 0!==e.heightPx?"".concat(e.heightPx,"px"):"calc(var(--px-per-min, ".concat(e.pxPerMin,") * ").concat(e.height," * 1px)")}),(function(e){return e.height<=20?"12px":"inherit"}),(function(e){return e.theme.colors.violet50}),(function(e){return e.theme.colors.violet50}),(function(e){return e.theme.colors.violet50})),G=r.Ay.div.withConfig({componentId:"sc-23fc7859-11"})(w(),(function(e){return"right"!==e.currentTimeDots&&"none"!==e.currentTimeDots&&"\n &::before {\n position: absolute;\n top: -5px;\n left: -5px;\n display: inline-block;\n width: 12px;\n height: 12px;\n background-color: #2d87f3;\n border-radius: 50%;\n content: '';\n }\n "}),(function(e){return"left"!==e.currentTimeDots&&"none"!==e.currentTimeDots&&"\n &::after {\n position: absolute;\n top: -5px;\n right: -5px;\n display: inline-block;\n width: 12px;\n height: 12px;\n background-color: #2d87f3;\n border-radius: 50%;\n content: '';\n }\n "})),j=r.Ay.div.withConfig({componentId:"sc-23fc7859-12"})(y(),(function(e){return void 0!==e.topPx?"".concat(e.topPx,"px"):"calc(var(--px-per-min, ".concat(e.pxPerMin,") * ").concat(e.differenceMinutes," * 1px)")}),(function(e){return void 0!==e.heightPx?"".concat(e.heightPx,"px"):"calc(var(--px-per-min, ".concat(e.pxPerMin,") * ").concat(e.durationMinutes," * 1px)")}),(function(e){return e.valid?e.theme.colors.primaryBase:e.theme.colors.red600}),(function(e){return e.valid?e.theme.colors.blue50:"#FDEBEB"}),(function(e){return e.valid?e.theme.colors.primaryBase:e.theme.colors.red600})),U=r.Ay.div.withConfig({componentId:"sc-23fc7859-13"})(k(),(function(e){return e.$attention?e.theme.colors.yellow50:e.theme.colors.neutral50}),(function(e){return e.$attention?e.theme.colors.yellow800:e.theme.colors.gray600}),(function(e){return e.$clickable&&(0,r.AH)(x(),(function(e){return e.theme.colors.primaryBase}))})),H=r.Ay.div.withConfig({componentId:"sc-23fc7859-14"})(A(),(function(e){return e.$attention?e.theme.colors.yellow50:e.theme.colors.neutral50}),(function(e){return e.$attention?e.theme.colors.yellow800:e.theme.colors.gray600}),(function(e){return e.theme.colors.primaryBase})),V=r.Ay.span.withConfig({componentId:"sc-23fc7859-15"})(M()),W=r.Ay.span.withConfig({componentId:"sc-23fc7859-16"})(C())},71507:function(e,n,t){t.d(n,{qi:function(){return ie},EJ:function(){return oe},DP:function(){return ne}});var o=t(858),i=t(53513),r=t(63538),a=t(40568),l=t(81539),s=t(83776),d=t(2445),c=t(73884),u=t(35291),h=t(7648),p=t(36533),f=t(64582),v=t(36891),g=t(1784),m=t(32485),b=t.n(m),w=t(99922),y=t(69973),x=t(27827),k=t(25072),A=t(92998),M=t(81810),C=t(36462),E=t(66298),P=t(979),S=t(40063),D=t(88491),I=t(83545),O=t(67188),N=t.n(O),T=t(10297),Y=t.n(T),F=t(31017),_=t(6442),L=t(36259),z=t(45105),R=t(18094),B=t(23800),G=t(82471),j=t(39765),U=function(e){return e.rowTops.map((function(n,t){return{top:t+1>=e.rowTops.length?e.totalHeight:e.rowTops[t+1],isHour:(t+1)%2===0}}))},H=t(56466),V=t(38057),W=t(40959),$=t(66e3),K=t(8859),X=t(64889),q=t(1032),J=N()((function(){return t.e(8240).then(t.bind(t,98240)).then((function(e){return e.RescheduleConfirmPopup}))}),{loadableGenerated:{webpack:function(){return[98240]}},ssr:!1}),Q=function(e){return(0,d.Y)(g.A,(0,i.A)({color:u.w.colors.primaryBase},e))},Z=function(e){var n=e.geometry;return n?(0,d.Y)("div",{className:"pool-gridlines",style:{position:"absolute",top:0,left:0,width:"100%",height:n.totalHeight,zIndex:2,pointerEvents:"none"},children:U(n).map((function(e,n){return(0,d.Y)("div",{"data-testid":"pool-gridline-".concat(n),"data-hour":e.isHour,style:{position:"absolute",top:e.top-1,left:0,width:"100%",height:1,borderTop:e.isHour?"1px solid ".concat(u.w.colors.neutral200):"1px dashed #E6E7EC"}},"pool-gridline-".concat(n))}))}):null},ee={Mon:"day.Mon",Tue:"day.Tue",Wed:"day.Wed",Thu:"day.Thu",Fri:"day.Fri",Sat:"day.Sat",Sun:"day.Sun"};function ne(e){return e.getBoundingClientRect().top+(window.scrollY||document.documentElement.scrollTop)}function te(e,n){var t=document.querySelector(e),o=window.outerHeight||document.documentElement.clientHeight||document.body.clientHeight;t&&(n?window.scrollTo({top:ne(t)-o/2,left:0,behavior:"smooth"}):t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"}))}var oe=function(e,n){for(var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,o=[],i=e;i<=n;i++)for(var r=0;r<60;r+=t){var a=i<10?"0"+i:i,s=0===r?r+"0":r,d=a+":"+s;o=(0,l.A)(o).concat([d])}return o},ie=function(e){return(0,I.B)(re,e)},re=function(e){var n,t,g=e.eventObject,m=e.scheduleObject,I=e.onClickDetailBooking,O=e.onAddAppointment,N=e.addNewAppointment,U=e.scrollCalendarId,ie=e.initDisplayDate,re=void 0===ie?new Date:ie,ae=e.isInSchedule,le=void 0!==ae&&ae,se=e.type,de=e.isChoosingAction,ce=e.setIsChoosingAction,ue=e.addUnavailable,he=e.addUnavailableOnSchedule,pe=e.onRemoveUnavailable,fe=e.fetchEventObject,ve=e.unavailableSchedules,ge=e.disableActionSchedule,me=void 0!==ge&&ge,be=e.enableDragReschedule,we=void 0!==be&&be,ye=e.onRescheduleByDrag,xe=e.onDragToast,ke=e.isPoolListing,Ae=void 0!==ke&&ke,Me=e.onPoolAssignSuccess,Ce=e.focusSlot,Ee=e.hidePoolAssignAction,Pe=void 0!==Ee&&Ee,Se=(0,c.useContext)(L.B).state,De=Se.userInfo,Ie=Se.language,Oe=(0,_.A)().formatMessage,Ne=(0,T.useRouter)().locale,Te=(0,D.d)().isMobileOrTablet,Ye=new Date,Fe=(0,c.useState)(!1),_e=Fe[0],Le=Fe[1],ze=(0,c.useState)(re),Re=ze[0],Be=ze[1],Ge=(0,c.useState)(!1),je=Ge[0],Ue=Ge[1],He=(0,c.useRef)(!1),Ve=(0,c.useRef)(!1),We=(0,c.useRef)(null),$e=(0,c.useRef)(null),Ke=(0,x.A)(Re,{weekStartsOn:1}),Xe=(0,c.useMemo)((function(){return(0,l.A)(Array(7)).map((function(e,n){return(0,k.A)((0,A.A)(Ke,n))}))}),[Ke]),qe=(0,c.useMemo)((function(){return Ae?(0,H.pR)(g,Xe):void 0}),[Ae,g,Xe]),Je=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.onInvalidDrop,t=e.scheduleObject,o=e.pxToMinutes,i=(0,c.useState)(),r=i[0],a=i[1],l=(0,c.useState)(),s=l[0],d=l[1],u=(0,c.useState)(),h=u[0],p=u[1],f=(0,c.useRef)(),v=(0,c.useRef)(),g=(0,c.useRef)(t);g.current=t;var m=(0,c.useRef)(o);m.current=o;var b=(0,c.useCallback)((function(e){f.current=e,v.current=void 0,a(e),d(void 0)}),[]),w=(0,c.useCallback)((function(){f.current=void 0,v.current=void 0,a(void 0),d(void 0)}),[]),y=(0,c.useCallback)((function(){p(void 0)}),[]),x=(0,c.useCallback)((function(){p(void 0)}),[]),A=(0,c.useCallback)((function(){w(),p(void 0)}),[w]);return(0,c.useEffect)((function(){if(r){var e=function(e){var n=f.current;if(n){var t="function"===typeof document.elementsFromPoint?document.elementsFromPoint(e.clientX,e.clientY):[],o=(0,G.GF)(t);if(!o){var i=(0,G.y2)(t);if(i){var r=0,a=2;try{var l,s,c,u=null===(s=(l=i.el).getBoundingClientRect)||void 0===s?void 0:s.call(l);r=null!==(c=null===u||void 0===u?void 0:u.top)&&void 0!==c?c:0;var h=parseFloat(window.getComputedStyle(i.el).getPropertyValue("--px-per-min"));Number.isFinite(h)&&h>0&&(a=h)}catch(w){}o=(0,G.ch)(e.clientY,r,a,i.day,i.dayKey,g.current,m.current)}}if(!o)return v.current=void 0,void d(void 0);var p=(0,G.vn)(n,o.slot),b={day:o.day,dayKey:(0,k.A)(o.day),slot:o.slot,started:(null===p||void 0===p?void 0:p.started)||o.slot.started,ended:(null===p||void 0===p?void 0:p.ended)||o.slot.ended,valid:(0,G.sN)(o.slot,o.day)};v.current=b,d(b)}},t=function(){var e,t,o=f.current,i=v.current;if(w(),o){var r,a=String(null!==(r=null===(e=o.schedule)||void 0===e||null===(t=e.slot)||void 0===t?void 0:t.schedule_id)&&void 0!==r?r:"")||"booking-".concat(o.id);if(!i||String(i.slot.schedule_id)!==a)if(null===i||void 0===i?void 0:i.valid)p({booking:o,day:i.day,slot:i.slot,started:i.started,ended:i.ended});else{var l=i?(0,G.AI)(i.slot,i.day):"unavailable";null===n||void 0===n||n(l)}}};return document.addEventListener("pointermove",e),document.addEventListener("pointerup",t),function(){document.removeEventListener("pointermove",e),document.removeEventListener("pointerup",t)}}}),[r,w,n]),(0,c.useEffect)((function(){if(r||h){var e=function(e){"Escape"===e.key&&(f.current&&w(),p(void 0))};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}}),[r,h,w]),{draggingBooking:r,ghost:s,confirmTarget:h,beginDrag:b,cancelConfirm:y,finishConfirm:x,resetDragState:A}}({onInvalidDrop:function(e){return null===xe||void 0===xe?void 0:xe(function(e){return"booked"===e?{type:"danger",content:"".concat(Oe({id:"admin.booking.reschedule.toastBookedTitle",defaultMessage:"That slot is already booked"})," \u2014 ").concat(Oe({id:"admin.booking.reschedule.toastBookedBody",defaultMessage:"Pick another open slot."}))}:"past"===e?{type:"danger",content:"".concat(Oe({id:"admin.booking.reschedule.toastPastTitle",defaultMessage:"Can't move a booking to a past time"})," \u2014 ").concat(Oe({id:"admin.booking.reschedule.toastPastBody",defaultMessage:"Pick a slot in the future."}))}:{type:"danger",content:Oe({id:"admin.booking.reschedule.toastUnavailable",defaultMessage:"Slot unavailable"})}}(e))},scheduleObject:m,pxToMinutes:null===qe||void 0===qe?void 0:qe.pxToMinutes}),Qe=Je.draggingBooking,Ze=Je.ghost,en=Je.confirmTarget,nn=Je.beginDrag,tn=Je.cancelConfirm,on=Je.finishConfirm,rn=Je.resetDragState;(0,V.I)(!!en);var an=we?function(e){rn(),I(e)}:I,ln=function(){var e=(0,o.A)((function(){var e;return(0,s.__generator)(this,(function(n){switch(n.label){case 0:return en&&ye?(Ue(!0),[4,ye(en.booking,Number(en.slot.schedule_id))]):[2];case 1:return e=n.sent(),Ue(!1),(null===e||void 0===e?void 0:e.success)||null===xe||void 0===xe||xe({type:"danger",content:(0,G.Y6)(e,Oe({id:"error.anErrorOccurred",defaultMessage:"An error occurred!"}))}),on(),[2]}}))}));return function(){return e.apply(this,arguments)}}(),sn=(0,c.useState)({availability:!0,past:!0,upcoming:!0,telemed:!0}),dn=sn[0],cn=sn[1],un=(0,c.useState)(!1),hn=un[0],pn=un[1];(0,c.useEffect)((function(){return Le(!0)}),[]);var fn=function(e){var n,t=(0,k.A)(e);return!!(ve&&(null===(n=ve[t])||void 0===n?void 0:n.every((function(e){return"00:00"===e.started&&"24:00"===e.ended}))))},vn=function(){setTimeout((function(){te('[id*="js-booking-"]',Te)}),100)},gn=(0,c.useMemo)((function(){return[{value:"appointment",name:Oe({id:"admin.schedule.create.appointment",defaultMessage:"Appointment"}),action:N},{value:"unavailable",name:Oe({id:"admin.schedule.create.setUnavailable",defaultMessage:"Set unavailable"}),action:ue}]}),[Oe]),mn=function(e){var n=Oe({id:ee[(0,E.A)((0,A.A)(Ke,e),"ccc")],defaultMessage:"Day"});return"vi-VN"===Ne?Te?n.split(" ").map((function(e){return e[0].toUpperCase()})).join(""):n:Te?n[0]:n};(0,c.useEffect)((function(){var e,n;if(Ce&&qe&&!Ve.current){var t,o,i=(0,a.A)(Ce.split("T"),1)[0],r=i?document.querySelector('[data-day-column="'.concat(i,'"]')):null,s=r?ne(r):void 0,d=null!==(t=null===(e=We.current)||void 0===e?void 0:e.getBoundingClientRect().bottom)&&void 0!==t?t:0,c=null!==(o=null===(n=$e.current)||void 0===n?void 0:n.getBoundingClientRect().bottom)&&void 0!==o?o:0,u=(0,l.A)(Array(7)).map((function(e,n){return(0,E.A)((0,A.A)(Ke,n),W.cuM)})),h=(0,H.Ig)(Ce,qe,u,s,d,c);if(h){Ve.current=!0,He.current=!0,window.scrollTo({top:h.scrollTop,behavior:"smooth"});var p=document.querySelector('[data-day="'.concat(h.datePart,'"][data-started="').concat(h.timePart,'"]'));p&&(p.setAttribute("data-focus-highlight","true"),setTimeout((function(){return p.setAttribute("data-focus-highlight","done")}),2e3))}}}),[Ce,qe,Ke]),(0,c.useEffect)((function(){if(U||!He.current){var e=setTimeout((function(){te("#"+(U?"js-booking-".concat(U):"currentTime"),Te),U||(He.current=!0)}),100);return function(){return clearTimeout(e)}}}),[U,Te]);var bn=Ie||Ne,wn=(0,G.ej)(null===en||void 0===en?void 0:en.booking,en,bn);return(0,d.FD)(j.d4,{children:[(0,d.Y)(j.cQ,{ref:We,"data-is-in-schedule":le,children:(0,d.FD)(j.zO,{"data-pool":Ae||void 0,children:[(0,d.FD)("div",{className:"d-flex",children:[(0,d.FD)(j.F1,{children:[(0,d.Y)(h.I,{autoComplete:"off",name:"date",placeholder:"",type:"text",size:"sm",value:function(e){if((0,M.A)(e,(0,x.A)(new Date,{weekStartsOn:1})))return Oe({id:"admin.schedule.thisWeek",defaultMessage:"This week"});var n=(0,C.A)(e,{weekStartsOn:1});return"".concat((0,E.A)(e,"MMM dd")," - ").concat((0,E.A)(n,"MMM dd yyyy"))}(Ke),className:"time"}),(0,d.Y)(p.D,{pickedDate:function(e){for(var n=(0,C.A)(Ke,{weekStartsOn:1}),t=[],o=e;o<=n;)t.push(new Date(o)),o=(0,A.A)(o,1);return t}(Ke),customInput:function(e){return(0,d.Y)(j.D6,{onClick:e.onClick,children:(0,d.Y)("img",{src:"".concat(W.JpE,"/images/chevron-down.svg")})})},className:"Selectable",onChange:function(e){Be(e),vn(),fe&&fe(e)},locale:Ne})]}),(0,d.FD)("div",{className:"skip-buttons",children:[(0,d.Y)(F.A,{onClick:function(){Be((0,P.A)(Re,7)),vn(),fe&&fe((0,P.A)(Re,7))},role:"button"}),(0,d.Y)(F.A,{onClick:function(){Be((0,A.A)(Re,7)),vn(),fe&&fe((0,A.A)(Re,7))},role:"button"})]})]}),(0,d.FD)("div",{className:"d-flex sp-mt-10",children:[(0,d.FD)("div",{className:"d-flex-center",children:[(0,d.Y)(y.g,{label:"Telemedicine",name:"telemed",id:"telemed",color:"orange",checked:dn.telemed,onChange:function(){return cn((0,r.A)((0,i.A)({},dn),{telemed:!dn.telemed}))}}),(0,d.Y)(y.g,{label:"Outpatient",name:"upcoming",id:"upcoming",color:"blue",checked:dn.upcoming,onChange:function(){return cn((0,r.A)((0,i.A)({},dn),{upcoming:!dn.upcoming}))}}),(0,d.Y)(y.g,{label:Oe({id:"admin.booking.availability",defaultMessage:"Availability"}),name:"checkbox",id:"availability",color:"green",checked:dn.availability,onChange:function(){return cn((0,r.A)((0,i.A)({},dn),{availability:!dn.availability}))}}),(0,d.Y)(y.g,{label:Oe({id:"admin.booking.past",defaultMessage:"Past"}),name:"checkbox",id:"past",color:"grey",checked:dn.past,onChange:function(){return cn((0,r.A)((0,i.A)({},dn),{past:!dn.past}))}}),Ae&&(0,d.Y)(w.z,{label:Oe({id:"admin.pool.unassignedOnly",defaultMessage:"Unassigned only"}),Icon:hn?Q:void 0,isActive:hn?1:0,variantActive:"outline",onClick:function(){return pn((function(e){return!e}))},className:b()("ml-2 mr-3",{"!border !border-gray300":!hn})})]}),"doctor"===(null===De||void 0===De?void 0:De.role)&&(0,d.Y)(f.B,{onClick:function(){return Y().push("/admin/schedule/edit")},color:"transparent",size:"md",icon:(0,d.Y)(X.A,{}),className:"edit-btn",children:Oe({id:"admin.doctors.editSchedule",defaultMessage:"Edit Schedule"})}),!me&&!Te&&(0,d.Y)(d.FK,{children:"schedules"===se?(0,d.Y)(z.r,{data:gn,button:(0,d.FD)(j.wE,{children:[Oe({id:"admin.schedule.create.title",defaultMessage:"Create"})," ",(0,d.Y)(K.A,{})]})}):(0,d.FD)(f.B,{color:"primary",size:"md",onClick:N,children:["+"," ",Oe({id:"admin.booking.addAnAppointment",defaultMessage:"Add an appointment"})]})})]})]})}),(0,d.FD)(j.Hc,{"data-is-in-schedule":le,children:[(0,d.Y)(B.J,{rowHeights:null===qe||void 0===qe?void 0:qe.rowHeights}),(0,d.Y)("div",{className:"calendar sticky",ref:$e,children:(0,l.A)(Array(7)).map((function(e,n){return(0,d.Y)("div",{className:"day-column heading",style:{backgroundColor:(0,k.A)(Ye)===(0,k.A)((0,A.A)(Ke,n))?"#E3F2FF":""},children:(0,d.FD)("div",{className:"heading-wrap",children:[(0,d.Y)("div",{className:"w-full font-bold date",children:mn(n)}),fn((0,A.A)(Ke,n))?(0,d.Y)(j.LX,{onClick:function(){var e=(0,k.A)((0,A.A)(Ke,n)),t=ve&&ve[e];t&&(null===pe||void 0===pe||pe(t[0]))},style:{justifyContent:"center",alignItems:"flex-start"},children:(0,d.FD)("div",{className:"dayoff",children:[(0,d.Y)($.A,{className:"remove"}),(0,d.Y)(v.T,{size:"n1",color:u.w.colors.violet600,children:(0,E.A)((0,A.A)(Ke,n),Te?"dd/MM":"dd/MM/yyyy")}),(0,d.Y)(q.A,{className:"bin"})]})}):(0,d.Y)("div",{style:{color:"#737373"},className:"w-full date",children:(0,E.A)((0,A.A)(Ke,n),Te?"dd/MM":"dd/MM/yyyy")})]})},"day-title-".concat(n+1))}))}),(0,d.FD)("div",{style:{position:"relative"},children:[(0,d.Y)("div",{className:"calendar",children:(0,l.A)(Array(7)).map((function(e,n){return(0,d.Y)("div",{className:"day-column",style:{borderLeft:"1px solid #F1F2F4"},children:(0,d.Y)("div",{className:"day-hours",children:oe(0,23,30).map((function(e,n){return(0,d.Y)("div",{id:"empty-cell-".concat(n),className:"cell",style:(0,i.A)({borderBottom:n%2===0?"1px dashed #E6E7EC":"1px solid #E6E7EC"},qe?{flex:"0 0 ".concat(qe.rowHeights[n],"px"),borderBottom:"none"}:{})},"empty-cell-".concat(n))}))})},"day-".concat(n+1))}))}),(0,d.Y)("div",{className:"calendar_overlay",children:(0,l.A)(Array(7)).map((function(e,n){var t=(0,A.A)(Ke,n),o=we&&!!Ze&&0===(0,S.A)(Ze.day,t);return(0,d.FD)("div",{className:"day-column",children:[(0,d.Y)(R.z,{date:t,schedules:m,bookings:g,unavailable:ve,onClickDetailBooking:an,onAddAppointment:O,onSetUnavailable:he,onEdit:ce,isChoosingAction:de,type:se,onRemoveUnavailable:pe,disableActionSchedule:me,showOption:dn,isClientRendered:_e,enableDragReschedule:we,draggingBookingId:null===Qe||void 0===Qe?void 0:Qe.id,onDragStart:nn,isValidDropSlot:G.sN,unassignedOnly:Ae&&hn,onPoolAssignSuccess:Me,poolGeometry:qe,hidePoolAssignAction:Pe}),o&&Ze&&(0,d.FD)(j.TO,{differenceMinutes:(0,G.L7)(Ze.started),durationMinutes:Math.max((0,G.L7)(Ze.ended)-(0,G.L7)(Ze.started),0),pxPerMin:2,valid:Ze.valid,topPx:qe?qe.minutesToPx((0,G.L7)(Ze.started)):void 0,heightPx:qe?qe.minutesToPx((0,G.L7)(Ze.ended))-qe.minutesToPx((0,G.L7)(Ze.started)):void 0,children:[Ze.started," - ",Ze.ended]})]},"day-event-".concat(n+1))}))}),(0,d.Y)(Z,{geometry:qe})]})]}),we&&(0,d.Y)(J,{isShowing:!!en,booking:null===en||void 0===en?void 0:en.booking,doctorName:null===en||void 0===en||null===(n=en.booking)||void 0===n||null===(t=n.doctor)||void 0===t?void 0:t.name,fromLabel:wn.fromLabel,toLabel:wn.toLabel,isLoading:je,onCancel:tn,onConfirm:ln})]})}},38606:function(e,n,t){t.d(n,{Cu:function(){return s},Om:function(){return l},R9:function(){return a}});var o=t(81539),i=t(35291),r=[i.w.colors.primaryBase,i.w.colors.teal600,i.w.colors.violet600,i.w.colors.green600,i.w.colors.brown500],a=function(e){var n="number"===typeof e?e:Number(e)||0;return r[Math.abs(n)%r.length]},l=function(e){if(!e)return"";var n=e.replace(/^dr\.?\s+/i,"").trim().split(/\s+/).filter(Boolean);return 0===n.length?"":1===n.length?n[0][0].toUpperCase():"".concat(n[0][0]).concat(n[n.length-1][0]).toUpperCase()},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,t=(0,o.A)(e).sort((function(e,n){return e.name.localeCompare(n.name)}));return{visible:t.slice(0,n),remainingCount:Math.max(t.length-n,0)}}},56466:function(e,n,t){t.d(n,{Ig:function(){return u},KW:function(){return a},O4:function(){return l},Px:function(){return s},pR:function(){return d},wY:function(){return c}});var o=t(40568),i=30,r=48,a=42,l=function(e){if(!e)return 0;var n=e.split(" ")[1];if(!n)return 0;var t=(0,o.A)(n.split(":").map(Number),2),i=t[0],r=t[1];return Number.isFinite(i)&&Number.isFinite(r)?60*i+r:0},s=function(e){return Math.max(0,Math.min(47,Math.floor(e/i)))},d=function(e,n){var t=new Array(r).fill(76);n.forEach((function(n){var o=e[n]||[],i=new Array(r).fill(0);o.forEach((function(e){var n=s(l(e.started_at));i[n]+=1}));for(var a=0;at[a]&&(t[a]=d)}}));for(var o=new Array(r).fill(0),a=0,d=0;d=c)return 1440;for(var n=47,a=0;a0?l/t[n]:0;return n*i+s*i}}},c=function(e,n,t){return e.rowTops[n]+26+42*t},u=function(e,n,t,i,r,a){if(!e||!n||void 0===i)return null;var l=(0,o.A)(e.split("T"),2),d=l[0],c=l[1];if(!d||!c)return null;if(!t.includes(d))return null;var u=(0,o.A)(c.split(":"),2),h=u[0],p=u[1],f=Number(h),v=Number(p);if(!Number.isFinite(f)||!Number.isFinite(v))return null;var g=s(60*f+v);return{scrollTop:i+n.rowTops[g]-(Math.max(r,a)+12),datePart:d,timePart:c}}},38057:function(e,n,t){t.d(n,{I:function(){return i}});var o=t(73884);function i(e){(0,o.useLayoutEffect)((function(){if(e&&"undefined"!==typeof document){var n=document.body,t=function(){n.classList.contains("hhc-disabled-scroll")&&n.classList.remove("hhc-disabled-scroll"),"hidden"===n.style.overflow&&(n.style.overflow=""),n.style.paddingRight&&n.style.removeProperty("padding-right")};t();var o=new MutationObserver(t);return o.observe(n,{attributes:!0,attributeFilter:["class","style"]}),function(){o.disconnect()}}}),[e])}},83545:function(e,n,t){t.d(n,{B:function(){return a}});var o=t(53513),i=t(2445),r=t(73884);function a(e,n){var t=(0,r.useState)(!1),a=t[0],l=t[1];return(0,r.useEffect)((function(){return l(!0)}),[]),a?(0,i.Y)(e,(0,o.A)({},n)):null}}}]);