1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[14647],{22647:(e,t,n)=>{n.d(t,{A:()=>r});let r=n(49318).A},26506:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(61296),i=n(52612),s=n(97314),a=n(3774);let o=function(e){let{elementType:t,externalSlotProps:n,ownerState:o,skipResolvingSlotProps:l=!1,...d}=e,x=l?{}:(0,a.A)(n,o),{props:c,internalRef:p}=(0,s.A)({...d,externalSlotProps:x}),u=(0,r.A)(p,x?.ref,e.additionalProps?.ref);return(0,i.A)(t,{...c,ref:u},o)}},32046:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(38213),i=n(6029);let s=(0,r.A)([(0,i.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),(0,i.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"Schedule")},49318:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(55729);function i(e){let{controlled:t,default:n,name:i,state:s="value"}=e,{current:a}=r.useRef(void 0!==t),[o,l]=r.useState(n),d=r.useCallback(e=>{a||l(e)},[]);return[a?t:o,d]}},87271:(e,t,n)=>{n.d(t,{A:()=>h});var r=n(55729),i=n(70366),s=n(49092),a=n(54181),o=n(90931),l=n(68202),d=n(86462),x=n(6029);function c(e){return`scale(${e}, ${e**2})`}let p={entering:{opacity:1,transform:c(1)},entered:{opacity:1,transform:"none"}},u="undefined"!=typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),f=r.forwardRef(function(e,t){let{addEndListener:n,appear:f=!0,children:h,easing:g,in:m,onEnter:y,onEntered:A,onEntering:b,onExit:j,onExited:v,onExiting:z,style:w,timeout:S="auto",TransitionComponent:R=a.Ay,...D}=e,I=(0,i.A)(),E=r.useRef(),M=(0,o.A)(),C=r.useRef(null),L=(0,d.A)(C,(0,s.A)(h),t),k=e=>t=>{if(e){let n=C.current;void 0===t?e(n):e(n,t)}},T=k(b),W=k((e,t)=>{let n;(0,l.q)(e);let{duration:r,delay:i,easing:s}=(0,l.c)({style:w,timeout:S,easing:g},{mode:"enter"});"auto"===S?E.current=n=M.transitions.getAutoHeightDuration(e.clientHeight):n=r,e.style.transition=[M.transitions.create("opacity",{duration:n,delay:i}),M.transitions.create("transform",{duration:u?n:.666*n,delay:i,easing:s})].join(","),y&&y(e,t)}),$=k(A),H=k(z),V=k(e=>{let t,{duration:n,delay:r,easing:i}=(0,l.c)({style:w,timeout:S,easing:g},{mode:"exit"});"auto"===S?E.current=t=M.transitions.getAutoHeightDuration(e.clientHeight):t=n,e.style.transition=[M.transitions.create("opacity",{duration:t,delay:r}),M.transitions.create("transform",{duration:u?t:.666*t,delay:u?r:r||.333*t,easing:i})].join(","),e.style.opacity=0,e.style.transform=c(.75),j&&j(e)}),O=k(v);return(0,x.jsx)(R,{appear:f,in:m,nodeRef:C,onEnter:W,onEntered:$,onEntering:T,onExit:V,onExited:O,onExiting:H,addEndListener:e=>{"auto"===S&&I.start(E.current||0,e),n&&n(C.current,e)},timeout:"auto"===S?null:S,...D,children:(e,t)=>{let{ownerState:n,...i}=t;return r.cloneElement(h,{style:{opacity:0,transform:c(.75),visibility:"exited"!==e||m?void 0:"hidden",...p[e],...w,...h.props.style},ref:L,...i})}})});f&&(f.muiSupportAuto=!0);let h=f},98446:(e,t,n)=>{n.r(t),n.d(t,{default:()=>M});var r=n(6029),i=n(55729),s=n(62512),a=n(90798),o=n(88351),l=n(32273),d=n(73542),x=n(32559),c=n(38213);let p=(0,c.A)((0,r.jsx)("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"}),"AttachFile");var u=n(10485),f=n(32046);let h=(0,c.A)((0,r.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done"),g=(0,c.A)((0,r.jsx)("path",{d:"m18 7-1.41-1.41-6.34 6.34 1.41 1.41zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12zM.41 13.41 6 19l1.41-1.41L1.83 12z"}),"DoneAll"),m=(0,c.A)((0,r.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline");var y=n(61637);function A(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function b(e){let{message:t,businessLastReadAt:n}=e,i={fontSize:12,opacity:.75,verticalAlign:"text-bottom"};if("sending"===t.status)return(0,r.jsx)(f.A,{"data-testid":"status-sending",sx:i});if("failed"===t.status)return(0,r.jsx)(m,{"data-testid":"status-failed",
1sx:{...i,opacity:1}});let s=t.readAt??(n&&t.createdAt<=n?n:null);return s?(0,r.jsx)(d.A,{title:`Read ${A(s)}`,enterTouchDelay:0,children:(0,r.jsx)(g,{"data-testid":"status-read",sx:{...i,opacity:1}})}):(0,r.jsx)(h,{"data-testid":"status-sent",sx:i})}function j(e){let{message:t,businessLastReadAt:n,onRetry:i}=e,o="VISITOR"===t.author,{attachment:l}=t,d="failed"===t.status,c=d&&i?()=>i(t.id):void 0;return(0,r.jsxs)(a.A,{sx:{display:"flex",flexDirection:"column",alignItems:o?"flex-end":"flex-start"},children:[(0,r.jsxs)(a.A,{onClick:c,role:c?"button":void 0,tabIndex:c?0:void 0,onKeyDown:c?e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),c())}:void 0,"aria-label":c?"Message failed to send â retry":void 0,sx:{maxWidth:"80%",px:"13px",py:"10px",bgcolor:o?"secondary.main":y.YU,color:o?"secondary.contrastText":"text.primary",borderRadius:o?"15px 15px 5px 15px":"15px 15px 15px 5px",...d&&{opacity:.75,cursor:c?"pointer":void 0}},children:[t.body&&(0,r.jsx)(x.A,{sx:{fontSize:14,lineHeight:1.45,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:t.body}),l&&(0,r.jsxs)(a.A,{component:l.url?"a":"div",...l.url?{href:l.url,target:"_blank",rel:"noopener noreferrer"}:{},sx:{display:"flex",alignItems:"center",gap:"9px",p:"8px 10px",mt:t.body?"7px":0,maxWidth:"100%",borderRadius:"10px",textDecoration:"none",color:"inherit",bgcolor:o?"rgba(255, 255, 255, 0.18)":y.aM,border:"1px solid",borderColor:o?"rgba(255, 255, 255, 0.28)":y.XE},children:[(0,r.jsx)(a.A,{sx:{width:34,height:34,flex:"none",borderRadius:"7px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:700,color:o?"inherit":"secondary.main",bgcolor:o?"rgba(255, 255, 255, 0.24)":e=>(0,s.X4)(e.palette.secondary.main,.14)},children:l.ext}),(0,r.jsxs)(a.A,{sx:{minWidth:0,textAlign:"left"},children:[(0,r.jsx)(x.A,{noWrap:!0,sx:{fontSize:12.5,fontWeight:600},children:l.name}),l.sizeLabel&&(0,r.jsx)(x.A,{sx:{fontSize:10.5,opacity:.7},children:l.sizeLabel})]})]}),(0,r.jsxs)(x.A,{sx:{fontSize:9.5,lineHeight:1,opacity:.55,mt:"5px",textAlign:"right",display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"3px"},children:[A(t.createdAt),o&&(0,r.jsx)(b,{message:t,businessLastReadAt:n})]})]}),d&&(0,r.jsx)(x.A,{sx:{fontSize:10.5,color:"error.main",mt:"3px",textAlign:"right"},children:"Not sent â tap the message to retry"})]})}var v=n(70961);function z(e){if(Number.isNaN(e))return null;try{let t=new Date(e),n=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),r=Math.round((n(new Date)-n(t))/864e5);if(0===r)return"Today";if(1===r)return"Yesterday";return t.toLocaleDateString([],{month:"short",day:"numeric"})}catch{return null}}let w=["image/png","image/jpeg","image/webp","application/pdf"];function S(e){let{messages:t,onSend:n,onRetry:c,businessLastReadAt:h}=e,[g,m]=(0,i.useState)(""),[A,b]=(0,i.useState)(null),S=(0,i.useRef)(null);(0,i.useEffect)(()=>{S.current?.scrollIntoView({block:"end"})},[t.length]);let R=t.length>0&&"VISITOR"===t[t.length-1].author,D=function(e){let[t,n]=(0,i.useState)(!1),r=e.length?e[e.length-1]:null,s=!!(r&&"VISITOR"===r.author),a=0;if(s){let t=e.length-1;for(;t>0&&"VISITOR"===e[t-1].author;)t-=1;a=e[t].createdAt}return(0,i.useEffect)(()=>{if(!s)return void n(!1);let e=18e4-(Date.now()-a);if(e<=0)return void n(!0);let t=window.setTimeout(()=>n(!0),e);return()=>window.clearTimeout(t)},[s,a]),t}(t),I=()=>{let e=g.trim();if(!e||A?.error)return;let t=A??void 0;n(e,t&&{file:t.file,name:t.name,ext:t.ext,sizeLabel:t.sizeLabel}),m(""),b(null)};return(0,r.jsxs)(a.A,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[(0,r.jsxs)(a.A,{sx:{display:"flex",flexDirection:"column",gap:"10px",px:"16px",py:"16px",flex:1,minHeight:0,overflowY:"auto"},children:[t.length>0&&z(t[0].createdAt)&&(0,r.jsx)(x.A,{sx:{textAlign:"center",fontSize:11,color:"text.secondary",mb:"2px"},children:z(t[0].createdAt)}),t.map(e=>(0,r.jsx)(j,{message:e,businessLastReadAt:h,onRetry:c},e.id)),R&&(0,r.jsx)(a.A,{sx:{display:"flex",justifyContent:"flex-start"},children:(0,r.jsxs)(a.A,{sx:{display:"flex",alignItems:"center",gap:"7px",px:"13px",py:"10px",borderRadius:"15p
1x 15px 15px 5px",bgcolor:y.YU,color:"text.primary",fontSize:13},children:[(0,r.jsx)(f.A,{sx:{fontSize:16,color:"text.secondary"}}),"Awaiting response"]})}),(0,r.jsx)("div",{ref:S})]}),D&&(0,r.jsxs)(a.A,{"data-testid":"mw-away-nudge",sx:{flex:"none",mx:"12px",mb:"10px",p:"12px",display:"flex",gap:"8px",alignItems:"flex-start",bgcolor:y.eM,border:`1px solid ${y.XE}`,borderRadius:`${y.Zz}px`},children:[(0,r.jsx)(a.A,{sx:{width:8,height:8,mt:"5px",flex:"none",borderRadius:"50%",bgcolor:"#d19a2a"}}),(0,r.jsx)(x.A,{sx:{fontSize:13,lineHeight:1.45},children:"Our team is away right now, but we have your details and will reply here as soon as we're back."})]}),(0,r.jsxs)(a.A,{component:"form",onSubmit:e=>{e.preventDefault(),I()},sx:{flex:"none",borderTop:`1px solid ${y.XE}`,px:"12px",pt:"10px",pb:"12px"},children:[A&&(0,r.jsxs)(a.A,{sx:{display:"flex",alignItems:"center",gap:"10px",px:"10px",py:"8px",mb:"9px",bgcolor:y.eM,border:e=>`1px solid ${A.error?e.palette.error.main:y.XE}`,borderRadius:`${y.Zz}px`},children:[(0,r.jsx)(a.A,{sx:{width:32,height:32,borderRadius:"6px",bgcolor:e=>(0,s.X4)(e.palette.secondary.main,.14),color:"secondary.main",display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:700,flex:"none"},children:A.ext}),(0,r.jsxs)(a.A,{sx:{flex:1,minWidth:0},children:[(0,r.jsx)(x.A,{noWrap:!0,sx:{fontSize:12.5},children:A.name}),(0,r.jsx)(x.A,{sx:{fontSize:11,color:A.error?"error.main":"text.secondary"},children:A.error??(g.trim()?`${A.sizeLabel} \xb7 ready to send`:"Add a message to send this attachment")})]}),(0,r.jsx)(o.A,{"aria-label":"Remove attachment",size:"small",onClick:()=>b(null),sx:{flex:"none",color:"text.secondary"},children:(0,r.jsx)(u.A,{sx:{fontSize:16}})})]}),(0,r.jsxs)(a.A,{sx:{display:"flex",alignItems:"flex-end",gap:"8px"},children:[(0,r.jsx)(d.A,{title:A?"One file per message â remove the attached file to pick a different one":"Attach a file (one per message)",enterTouchDelay:0,children:(0,r.jsx)("span",{children:(0,r.jsxs)(o.A,{component:"label","aria-label":"Attach a file (one per message)",disabled:!!A,sx:{width:38,height:38,flex:"none",borderRadius:`${y.Zz}px`,border:`1px solid ${y.XE}`,color:"text.secondary"},children:[(0,r.jsx)(p,{sx:{fontSize:21}}),(0,r.jsx)("input",{type:"file",accept:".png,.jpg,.jpeg,.webp,.pdf",hidden:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value="",t&&b(function(e){let t=(e.name.split(".").pop()||"").toUpperCase().slice(0,4)||"FILE",n=e.size>1048576?`${(e.size/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(e.size/1024))} KB`,r=null;return w.includes(e.type)?e.size>5242880&&(r="File is too large â 5 MB max."):r="Only PNG, JPG, WEBP or PDF files are allowed.",{file:e,name:e.name,ext:t,sizeLabel:n,error:r}}(t))}})]})})}),(0,r.jsx)(l.A,{multiline:!0,minRows:1,maxRows:4,size:"small",color:"secondary",value:g,onChange:e=>m(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),I())},placeholder:"Write a replyâ¦",inputProps:{"aria-label":"Message"},sx:{flex:1,minWidth:0,fontSize:14}}),(0,r.jsx)(v.A,{presentation:"chatInput",type:"submit",disabled:!g.trim()})]})]})]})}var R=n(4473);function D(){return(0,r.jsxs)(a.A,{sx:{flex:1,minHeight:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"14px",px:"18px"},children:[(0,r.jsx)(R.A,{size:26,color:"secondary"}),(0,r.jsx)(x.A,{sx:{fontSize:13.5,color:"text.secondary"},children:"Loading your conversationâ¦"})]})}var I=n(78323),E=n(92843);function M(e){let{open:t,onClose:n,conversation:i,greetingText:s,showFloatingWidget:a=!0}=e,{ready:o,loading:l,inConversation:d,messages:x,businessLastReadAt:c,sessionExpiredMessage:p,clearSessionExpiredMessage:u,appendVisitorMessage:f,sendFollowUp:h,retryMessage:g}=i,m=!l&&o&&d,y=!l&&o&&!d;return(0,r.jsxs)(E.A,{open:t,onClose:n,height:y?"auto":"chat",showFloatingWidget:a,children:[l&&(0,r.jsx)(D,{}),m&&(0,r.jsx)(S,{messages:x,onSend:h,onRetry:g,businessLastReadAt:c}),y&&(0,r.jsx)(I.A,{onSubmitted:f,initialMessage:p,onInitialMessageConsumed:u,greetingText:s})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.