@botfabrik/engine-webclient 4.96.22-alpha.0 → 4.97.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -107,7 +107,7 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
107
107
  `).every(x=>(x+=`
108
108
  `,!c.some(Z=>Z.test(x))&&(S+=x,!!x.trim())));const I=Ks(S);return I===""?null:[S,,I]}),i:3,u:fd,l:(_,C,S)=>h("p",{key:S.key},C(_.children,S))},22:{t:["["],o:ra(fR),i:0,u:_=>(E[_[1]]={target:_[2],title:_[4]},{}),l:hd},23:{t:["!["],o:aa(dR),i:0,u:_=>({alt:_[1]?Zn(_[1]):void 0,ref:_[2]}),l:(_,C,S)=>E[_.ref]?h("img",{key:S.key,alt:_.alt,src:s(E[_.ref].target,"img","src"),title:E[_.ref].title}):null},24:{t:_=>_[0]==="["&&_.indexOf("](")===-1,o:ra(hR),i:0,u:(_,C,S)=>({children:C(_[1],S),fallbackChildren:_[0],ref:_[2]}),l:(_,C,S)=>E[_.ref]?h("a",{key:S.key,href:s(E[_.ref].target,"a","href"),title:E[_.ref].title},C(_.children,S)):h("span",{key:S.key},_.fallbackChildren)},25:{t:["|"],o:Er(Ev),i:1,u:zR,l(_,C,S){const I=_;return h("table",{key:S.key},h("thead",null,h("tr",null,I.header.map(function(x,Z){return h("th",{key:Z,style:Av(I,Z)},C(x,S))}))),h("tbody",null,I.cells.map(function(x,Z){return h("tr",{key:Z},x.map(function(W,ae){return h("td",{key:ae,style:Av(I,ae)},C(W,S))}))})))}},27:{o:Ci(function(_,C){let S;return Fo(_,":")&&(S=AR.exec(_)),S||RR.exec(_)}),i:4,u(_){const C=_[0];return{text:C.indexOf("&")===-1?C:C.replace(rR,(S,I)=>r.namedCodesToUnicode[I]||S)}},l:_=>_.text},28:{t:["**","__"],o:aa(_R),i:2,u:(_,C,S)=>({children:C(_[2],S)}),l:(_,C,S)=>h("strong",{key:S.key},C(_.children,S))},29:{t:_=>{const C=_[0];return(C==="*"||C==="_")&&_[1]!==C},o:aa(ER),i:3,u:(_,C,S)=>({children:C(_[2],S)}),l:(_,C,S)=>h("em",{key:S.key},C(_.children,S))},30:{t:["\\"],o:aa(xR),i:1,u:_=>({text:_[1],type:"27"})},31:{t:["=="],o:aa(SR),i:3,u:fd,l:(_,C,S)=>h("mark",{key:S.key},C(_.children,S))},32:{t:["~~"],o:aa(TR),i:3,u:fd,l:(_,C,S)=>h("del",{key:S.key},C(_.children,S))}};r.disableParsingRawHTML===!0&&(delete A[11],delete A[13]);const U=function(_){var C=Object.keys(_);function S(I,x){var Z=[];if(x.prevCapture=x.prevCapture||"",I.trim())for(;I;)for(var W=0;W<C.length;){var ae=C[W],ge=_[ae];if(!ge.t||jR(I,x,ge.t)){var Ee=ge.o(I,x);if(Ee&&Ee[0]){I=I.substring(Ee[0].length);var se=ge.u(Ee,S,x);x.prevCapture+=Ee[0],se.type||(se.type=ae),Z.push(se);break}W++}else W++}return x.prevCapture="",Z}return C.sort(function(I,x){return _[I].i-_[x].i||(I<x?-1:1)}),function(I,x){return S(function(Z){return Z.replace($O,`
109
109
  `).replace(eR,"").replace(pR," ")}(I),x)}}(A),R=(F=function(_,C){return function(S,I,x){const Z=_[S.type].l;return C?C(()=>Z(S,I,x),S,I,x):Z(S,I,x)}}(A,r.renderRule),function _(C,S={}){if(Array.isArray(C)){const I=S.key,x=[];let Z=!1;for(let W=0;W<C.length;W++){S.key=W;const ae=_(C[W],S),ge=typeof ae=="string";ge&&Z?x[x.length-1]+=ae:ae!==null&&x.push(ae),Z=ge}return S.key=I,x}return F(C,_,S)});var F;const G=m(t);return y.length?h("div",null,G,h("footer",{key:"footer"},y.map(function(_){return h("div",{id:i(_.identifier,Is),key:_.identifier},_.identifier,R(U(_.footnote,{inline:!0})))}))):G}const xr=t=>{let{children:r="",options:i}=t,s=function(u,c){if(u==null)return{};var d,h,m={},p=Object.keys(u);for(h=0;h<p.length;h++)c.indexOf(d=p[h])>=0||(m[d]=u[d]);return m}(t,IO);return H.cloneElement(PR(r,i),s)},YR="_generalConditionsContainer_55hjg_1",XR="_generalConditions_55hjg_1",ZR="_generalConditionsHeader_55hjg_15",QR="_generalConditionsBody_55hjg_26",KR="_generalConditionsAccept_55hjg_35",zs={generalConditionsContainer:YR,generalConditions:XR,generalConditionsHeader:ZR,generalConditionsBody:QR,generalConditionsAccept:KR},$R=()=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"})}),WR=()=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"})}),JR="general-conditions.header",ew="general-conditions.body",xv="general-conditions.accept-conditions-note",tw=()=>{const t=tt(),[r,i]=H.useState(!1),s=()=>i(!r),u=h=>{h.key==="ArrowDown"||h.key==="ArrowRight"?i(!0):h.key==="ArrowUp"||h.key==="ArrowLeft"||h.key==="Escape"?i(!1):(h.key==="Enter"||h.key==="Space"||h.key===" ")&&s()},c=t(JR),d=t(xv);return v.jsxs("div",{className:Q(zs.generalConditionsContainer,"chat__generalConditions"),children:[!!c?.length&&v.jsxs("div",{className:zs.generalConditions,children:[v.jsxs("div",{role:"button",onClick:s,onKeyDown:u,tabIndex:0,className:Q(zs.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":r?"true":"false","aria-pressed":r?"true":"false",children:[v.jsx(xr,{children:c}),r?v.jsx(WR,{}):v.jsx($R,{})]}),v.jsx("div",{className:Q(zs.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:r&&v.jsx(xr,{children:t(ew)||""})})]}),!!d?.length&&v.jsx("div",{className:Q(zs.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:v.jsx(xr,{children:t(xv)||""})})]})},nw="_message_1sw52_1",rw="_messageBot_1sw52_9",aw="_messageBotLast_1sw52_19",iw="_avatar_1sw52_19",sw="_messageBotFirst_1sw52_28",lw="_messageBotAnimated_1sw52_41",ow="_messageGuest_1sw52_52",uw="_messageGuestFirst_1sw52_58",cw="_messageGuestLast_1sw52_64",fw="_botAvatar_1sw52_78",dw="_agentAvatar_1sw52_82",hw="_bubble_1sw52_86",mw="_bubbleContent_1sw52_92",pw="_bubbleLeft_1sw52_106",gw="_leftText_1sw52_117",yw="_bubbleRight_1sw52_124",vw="_rightText_1sw52_134",bw="_sourceInfoReference_1sw52_166",_w="_sourceInfoReferenceActive_1sw52_178",ye={message:nw,messageBot:rw,messageBotLast:aw,avatar:iw,messageBotFirst:sw,messageBotAnimated:lw,messageGuest:ow,messageGuestFirst:uw,messageGuestLast:cw,botAvatar:fw,agentAvatar:dw,bubble:hw,bubbleContent:mw,bubbleLeft:pw,leftText:gw,bubbleRight:yw,rightText:vw,sourceInfoReference:bw,sourceInfoReferenceActive:_w},Ew="_botMessageActions_m0f8n_1",Sw="_alwaysVisible_m0f8n_27",Tw="_reported_m0f8n_34",Aw="_action_m0f8n_38",ia={botMessageActions:Ew,alwaysVisible:Sw,reported:Tw,action:Aw},xw=({alwaysVisible:t,senderType:r,reaction:i,botMessageRef:s,onReaction:u})=>{const c=tt(),[d,h]=H.useState(!1),m=y=>()=>u(y),p=H.useCallback(async()=>{if(s.current)try{h(!0);const y=s.current.innerHTML,E=s.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([y],{type:"text/html"}),"text/plain":new Blob([E],{type:"text/plain"})})]),await new Promise(A=>setTimeout(A,1500))}finally{h(!1)}},[s]);return v.jsxs("div",{className:Q(ia.botMessageActions,t&&ia.alwaysVisible,i&&ia.reported),children:[r===ru.BOT&&v.jsx("button",{className:Q(ia.action,i==="GOOD"&&ia.reported,"tooltip--top-right"),tabIndex:0,"aria-label":c(i==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),"data-title":c(i==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),onClick:m(i==="GOOD"?null:"GOOD"),children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:i==="GOOD"?v.jsx("path",{d:"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32Z"}):v.jsx("path",{d:"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32ZM223.94,97l-12,96a8,8,0,0,1-7.94,7H88V105.89l36.71-73.43A24,24,0,0,1,144,56V80a8,8,0,0,0,8,8h64a8,8,0,0,1,7.94,9Z"})})}),r===ru.BOT&&v.jsx("button",{className:Q(ia.action,i==="BAD"&&ia.reported,"tooltip--top-right"),tabIndex:0,"aria-label":c(i==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),"data-title":c(i==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),onClick:m(i==="BAD"?null:"BAD"),children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:i==="BAD"?v.jsx("path",{d:"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Z"}):v.jsx("path",{d:"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Zm150,21.29a7.88,7.88,0,0,1-6,2.71H152a8,8,0,0,0-8,8v24a24,24,0,0,1-19.29,23.54L88,150.11V56H204a8,8,0,0,1,7.94,7l12,96A7.87,7.87,0,0,1,222,165.29Z"})})}),v.jsx("button",{className:Q(ia.action,"tooltip--top-right"),tabIndex:0,"aria-label":c("bot-bubble.copy"),"data-title":c("bot-bubble.copy"),onClick:p,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:d?v.jsx("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}):v.jsx("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"})})})]})},Fb=H.forwardRef(({message:t,isAnimated:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:u,children:c,onReaction:d},h)=>{const m=tt(),p=H.useRef(null),y=t.sender.type===Te.UserType.BOT;return v.jsxs("li",{ref:h,className:Q(ye.message,ye.messageBot,i&&ye.lastMessage,s&&ye.messageBotFirst,u&&ye.messageBotLast,"chat__bubbleContainer",r&&ye.messageBotAnimated,r&&"chat__bubbleContainer--animated",y?"chat__botBubbleContainer":"chat__agentBubbleContainer",s&&"chat__bubbleContainer--first",u&&"chat__bubbleContainer--last"),children:[v.jsx("img",{className:Q(ye.avatar,y?ye.botAvatar:ye.agentAvatar,"chat__avatar",y?"chat__botAvatar":"chat__agentAvatar"),src:`${t.sender.avatar}`,alt:y?"Bot":"Agent",referrerPolicy:"no-referrer"}),v.jsxs("div",{ref:p,className:Q(ye.bubble,ye.bubbleLeft,"chat__bubble",y?"chat__botBubble":"chat__agentBubble"),tabIndex:0,"aria-label":m(y?"bot-bubble.label":"agent-bubble.label"),children:[v.jsx("div",{className:Q(ye.leftText),children:c}),d&&v.jsx(xw,{alwaysVisible:i&&u,senderType:t.sender.type,reaction:t.reaction,botMessageRef:p,onReaction:d})]})]})}),Ow="_sourceList_1n31h_1",Rw="_source_1n31h_1",ww="_label_1n31h_37",pd={sourceList:Ow,source:Rw,label:ww},Vb=t=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:v.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),Pb=t=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:v.jsx("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z"})}),Yb=t=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:v.jsx("path",{d:"M222,152a6,6,0,0,1-6,6H190v20h18a6,6,0,0,1,0,12H190v18a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6h32A6,6,0,0,1,222,152ZM90,172a26,26,0,0,1-26,26H54v10a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6H64A26,26,0,0,1,90,172Zm-12,0a14,14,0,0,0-14-14H54v28H64A14,14,0,0,0,78,172Zm84,8a34,34,0,0,1-34,34H112a6,6,0,0,1-6-6V152a6,6,0,0,1,6-6h16A34,34,0,0,1,162,180Zm-12,0a22,22,0,0,0-22-22H118v44h10A22,22,0,0,0,150,180ZM42,112V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88v24a6,6,0,0,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,0,1-12,0ZM158,82h35.52L158,46.48Z"})}),Xb=t=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:v.jsx("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"})}),Cw=({type:t,...r})=>{switch(t){case"WEBSITE":return v.jsx(Xb,{...r});case"PDF":return v.jsx(Yb,{...r});case"DOCX":return v.jsx(Vb,{...r});default:return v.jsx(Pb,{...r})}},Xh=({sources:t,onLinkClick:r})=>{const i=tt(),s=c=>()=>{r(c.url)},u=c=>d=>{(d.key==="Enter"||d.key===" ")&&r(c.url)};return t.length?v.jsx("ul",{className:pd.sourceList,"aria-label":i("bot-bubble.sources"),children:t.map(c=>v.jsx("li",{className:pd.source,children:v.jsxs("a",{role:"button",tabIndex:0,"aria-label":`${i("bot-bubble.source.open")}: ${c.label}`,onClick:s(c),onKeyDown:u(c),children:[v.jsx(Cw,{type:c.type,"aria-hidden":"true"}),v.jsx("div",{className:pd.label,children:c.label})]})},c.url))}):null},Nw="_button_3ui4g_1",Mw="_buttonDefault_3ui4g_13",Dw="_buttonPrimary_3ui4g_28",Js={button:Nw,buttonDefault:Mw,buttonPrimary:Dw},bu=({className:t,children:r,...i})=>v.jsx("button",{className:Q(Js.button,t),type:"button",role:"button",...i,children:r}),Lw="_title_137pi_1",Bw="_buttons_137pi_6",Uw="_button_137pi_6",Hw="_imageContainer_137pi_29",jw="_image_137pi_29",Iw="_video_container_137pi_44",zw="_video_137pi_44",Gw="_only_137pi_58",ln={title:Lw,buttons:Bw,button:Uw,imageContainer:Hw,image:jw,video_container:Iw,video:zw,only:Gw},kw=({buttons:t,onButtonClick:r})=>v.jsx("div",{className:Q(ln.buttons,"chat__bubbleButtons"),children:t.map((i,s)=>v.jsx(bu,{className:Q(ln.button,"chat__bubbleButton"),onClick:()=>r(i),children:i.title},s))}),Ov="newtab#",Zb=({markdown:t,markdownOptions:r={},onLinkClick:i})=>{const s=c=>d=>(d.preventDefault(),c&&i(c),!1),u=({title:c,href:d,children:h})=>d.indexOf(Ov)===0?v.jsx("a",{href:d.slice(Ov.length),title:c,target:"_blank",rel:"noopener noreferrer",children:h}):v.jsx("a",{onClick:s(d),title:c,href:d,children:h});return v.jsx(xr,{options:{...r,overrides:{a:u}},children:t})},qw=({text:t,onLinkClick:r})=>t?v.jsx("div",{children:v.jsx(Zb,{markdown:t,onLinkClick:r})}):null,Fw=({title:t})=>t?v.jsx("h1",{className:ln.title,children:t}):null,Vw=({title:t,text:r,buttons:i,onButtonClick:s,onLinkClick:u})=>t?.length||r?.length||i?.length?v.jsxs("div",{className:Q(ye.bubbleContent),children:[v.jsx(Fw,{title:t}),v.jsx(qw,{text:r,onLinkClick:u}),v.jsx(kw,{buttons:i,onButtonClick:s})]}):null,Pw=({alt:t,imageUrl:r,itemUrl:i,hasBody:s})=>r?i?i.indexOf("youtube.com")>-1?v.jsx("div",{className:ln.video_container,children:v.jsx("iframe",{className:Q(ln.video,{[ln.only]:!s}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):v.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:v.jsx("div",{className:ln.imageContainer,children:v.jsx("img",{className:Q(ln.image,{[ln.only]:!s}),src:r,alt:t})})}):v.jsx("div",{className:ln.imageContainer,children:v.jsx("img",{className:Q(ln.image,{[ln.only]:!s}),src:r,alt:t})}):null,Yw=({title:t,text:r,imageUrl:i,itemUrl:s,buttons:u,sources:c,onButtonClick:d,onLinkClick:h})=>{const m=!!t?.length||!!r?.length||!!u?.length;return v.jsxs("div",{className:Q(ln.detailMessage),children:[v.jsx(Pw,{hasBody:m,imageUrl:i,itemUrl:s,alt:t||""}),m&&v.jsx(Vw,{title:t,text:r,buttons:u,onLinkClick:h,onButtonClick:d}),v.jsx(Xh,{sources:c,onLinkClick:h})]})},Xw=H.forwardRef(({isFirstMessageBySender:t,isLastMessageBySender:r,children:i},s)=>{const u=tt();return v.jsx("li",{ref:s,className:Q(ye.message,ye.messageGuest,t&&ye.messageGuestFirst,r&&ye.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",t&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:v.jsx("div",{className:Q(ye.bubble,ye.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":u("guest-bubble.label"),children:v.jsx("div",{className:Q(ye.rightText),children:i})})})}),Zw="_markdown_nw7vg_1",Qb={markdown:Zw},Kb=()=>Qw(window.location.pathname),Qw=t=>{const r=t.split("/"),i=t.endsWith("/");return r[r.length-(i?2:1)]},_u=()=>H.useMemo(()=>Kb(),[]),Ho="source-info-reference",Kw=({actionId:t,markdown:r,sources:i,onLinkClick:s})=>{const u=_u(),c=Cr(),d=$w(),h=it(y=>{const E=y.chat.sourceInfos;if(E?.type==="loaded"||E?.type==="loading")return E.chunkId}),m=y=>E=>{const A=E.key;(A==="ArrowDown"||A==="ArrowRight"||A==="Enter"||A===" "||A==="Space")&&(E.stopPropagation(),c(uv(u,t,y)))},p=y=>()=>{c(uv(u,t,y))};return H.useLayoutEffect(()=>{document.querySelectorAll(`.${Ho}`).forEach(y=>{const E=y.previousSibling;E&&E.nodeType===Node.TEXT_NODE&&E.textContent?.endsWith(" ")&&E.textContent?.trim().length&&y.classList.add(`${Ho}--before-space`);const A=y.nextSibling;A&&A.nodeType===Node.TEXT_NODE&&A.textContent?.startsWith(" ")&&A.textContent?.trim().length&&y.classList.add(`${Ho}--after-space`)})},[r]),v.jsxs("div",{className:ye.bubbleContent,children:[v.jsx("div",{className:Qb.markdown,children:v.jsx(Zb,{markdown:r,onLinkClick:s,markdownOptions:{renderRule(y,E,A,U){if(E.type===zO.footnoteReference){const R=E.text===h;return v.jsx("span",{className:Q(ye.sourceInfoReference,R&&ye.sourceInfoReferenceActive,Ho),children:v.jsx("a",{type:"button",tabIndex:0,onClick:p(E.text),onKeyDown:m(E.text),children:d(E.text)})},U.key)}return y()}}})}),v.jsx(Xh,{sources:i,onLinkClick:s})]})},$w=()=>{const t=[];return i=>{const s=t.indexOf(i);return s>-1?s+1:(t.push(i),t.length)}},Ww="_text_gp0s0_1",Jw="_command_gp0s0_5",Rv={text:Ww,command:Jw},e6=({text:t,commands:r=[]})=>{const i=r.find(u=>t.startsWith(`/${u}`)),s=i?t.slice(i.length+1):t;return v.jsxs("div",{children:[i&&v.jsxs("code",{className:Rv.command,children:["/",i]}),s.split(`
110
- `).map((u,c)=>v.jsxs("span",{className:Rv.text,children:[u,v.jsx("br",{})]},c))]})},t6=({text:t,commands:r,sources:i,onLinkClick:s})=>v.jsxs("div",{className:ye.bubbleContent,children:[v.jsx(e6,{text:t,commands:r}),v.jsx(Xh,{sources:i,onLinkClick:s})]}),n6=H.forwardRef(({message:t,commands:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:u,onReaction:c,onButtonClick:d,onLinkClick:h},m)=>{const p=r6(t._id,t,r,d,h);switch(t.sender.type){case Te.UserType.GUEST:return v.jsx(Xw,{ref:m,isFirstMessageBySender:s,isLastMessageBySender:u,children:p});default:{const y=E=>c(t._id,E);return v.jsx(Fb,{ref:m,message:t,isAnimated:!1,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:u,onReaction:y,children:p})}}}),r6=(t,r,i,s,u)=>{switch(r.type){case Te.MessageTypeEnum.TEXT:{const c=r;return v.jsx(t6,{text:c.text,commands:i,sources:r.sources||[],onLinkClick:u})}case Te.MessageTypeEnum.DETAIL:{const c=r;return v.jsx(Yw,{title:c.title,text:c.text,imageUrl:c.imageUrl,itemUrl:c.itemUrl,buttons:c.buttons,sources:r.sources||[],onButtonClick:s,onLinkClick:u})}case Te.MessageTypeEnum.MARKDOWN:{const c=r;return v.jsx(Kw,{actionId:t,markdown:c.markdown,sources:c.sources||[],onLinkClick:u})}}},a6=(t,r)=>t.message._id===r.message._id&&t.message.reaction===r.message.reaction&&t.isLastMessage===r.isLastMessage&&t.isFirstMessageBySender===r.isFirstMessageBySender&&t.isLastMessageBySender===r.isLastMessageBySender,i6=v1.memo(n6,a6),s6="_ticontainer_xg0dn_1",l6="_tiblock_xg0dn_5",o6="_tidot_xg0dn_12",Gs={ticontainer:s6,tiblock:l6,tidot:o6},u6=({isTyping:t=!1})=>v.jsx("div",{className:Gs.ticontainer,children:v.jsx("div",{className:Gs.tiblock,children:t?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:Q(Gs.tidot,"chat__typingIndicator")}),v.jsx("div",{className:Q(Gs.tidot,"chat__typingIndicator")}),v.jsx("div",{className:Q(Gs.tidot,"chat__typingIndicator")})]}):null})}),c6=Object.assign({_id:"typing-indicator"},new Te.TextMessage("",new Te.BotUser)),f6=({messages:t,isBotTyping:r,commands:i,onTranscriptItemReaction:s,onButtonClick:u,onLinkClick:c})=>{const d=H.useRef(0),h=H.useRef(!0),m=H.useRef(null),p=H.useRef(null),y=H.useRef(null),E=it(R=>R.settings.enableGeneralConditions);H.useLayoutEffect(()=>{if(t.length&&m.current&&(d.current<t.length||r)){if(p.current){const R=p.current.offsetTop;m.current.scrollTop=R}else if(y.current){const R=y.current.offsetTop;m.current.scrollTop=R}h.current&&(h.current=!1),d.current=t.length}},[t,h,r]);let A;const U=t.length;return v.jsxs("div",{ref:m,className:Q(fv.messageContainer,"chat__messageContainer"),style:{scrollBehavior:t.length&&h.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[E&&v.jsx(tw,{}),v.jsxs("ul",{className:fv.messages,children:[t.map((R,F)=>{const G=d6(R,A),_=h6(R,F,t,r);A=R.sender.type;const C=F+1===U,S=R._id||`added-${F}`;return v.jsx(i6,{ref:C?y:null,message:R,commands:i,isLastMessage:C,isFirstMessageBySender:G,isLastMessageBySender:_,onButtonClick:u,onLinkClick:c,onReaction:s},C&&!r?"last":S)}),r&&v.jsx(Fb,{ref:p,message:c6,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:A!==Te.UserType.BOT,isLastMessageBySender:!0,children:v.jsx(u6,{isTyping:!0})},"last")]})]})},d6=(t,r)=>!r||r!==t.sender.type,h6=(t,r,i,s)=>{const u=t.sender.type,c=i.length;return r+1===c?!(u===Te.UserType.BOT&&s):u!==i.at(r+1)?.sender.type},m6="_bottomSheet_jp8dl_1",p6="_bottomSheetOpen_jp8dl_15",g6="_bottomSheetClose_jp8dl_20",Or={bottomSheet:m6,bottomSheetOpen:p6,bottomSheetClose:g6},y6="_container_xc2nx_1",wv={container:y6},v6=({contentUrl:t})=>{const r=it(c=>c.connection.sessionId),[i,s]=H.useState(!1);H.useEffect(()=>{s(c=>c||!!t)},[t]);const u=H.useMemo(()=>{if(t&&r){const c=new URL(t,document.baseURI);return c.searchParams.set("sessionId",r),c.toString()}else return},[t,r]);return v.jsx("div",{className:Q(wv.container,Or.bottomSheet,{[Or.bottomSheetOpen]:!!t,[Or.bottomSheetClose]:i&&!t}),children:u&&v.jsx("iframe",{title:"Drawer",src:u,className:wv.iframe})})},b6="_container_z787n_1",_6={container:b6},E6=({title:t,href:r,children:i})=>v.jsx("a",{href:r,title:t,target:"_blank",rel:"noopener noreferrer",children:i}),S6=()=>{const r=tt()("powered-by");return r&&r.length?v.jsx("div",{className:Q(_6.container,"chat__poweredBy"),children:v.jsx(xr,{options:{overrides:{a:E6}},children:r})}):null},$b=({className:t,children:r,...i})=>v.jsx(bu,{className:Q(Js.buttonDefault,t),type:"button",...i,children:r}),au=({className:t,children:r,...i})=>v.jsx(bu,{className:Q(Js.buttonPrimary,t),...i,children:r}),T6="_container_h23mk_1",A6="_formContainer_h23mk_17",x6="_emailInput_h23mk_22",O6="_description_h23mk_52",R6="_actions_h23mk_57",w6="_validationError_h23mk_67",C6="_submitted_h23mk_74",La={container:T6,formContainer:A6,emailInput:x6,description:O6,actions:R6,validationError:w6,submitted:C6},N6=({visible:t,onEmailExport:r,onClose:i})=>{const s=tt(),[u,c]=H.useState(void 0),[d,h]=H.useState(!1),[m,p]=H.useState(void 0),y=H.useRef(null);H.useEffect(()=>{t?(y.current?.focus(),h(!1),c(t)):u===!0&&c(!1)},[t,u]);const E=U=>{U.preventDefault(),m&&m.length>0&&(r(m),h(!0),setTimeout(i,3*1e3))},A=U=>{const R=U.target.value.trim(),F=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(R);p(F?R:"")};return v.jsxs("div",{className:Q(La.container,Or.bottomSheet,{[Or.bottomSheetOpen]:u===!0,[Or.bottomSheetClose]:u===!1}),children:[v.jsx("h2",{children:s("export-transcript.email.title")}),v.jsx(xr,{className:La.description,children:s("export-transcript.email.description")||""}),v.jsxs("form",{onSubmit:E,className:La.formContainer,children:[v.jsxs("div",{children:[v.jsx("input",{disabled:d,ref:y,type:"email",placeholder:s("export-transcript.email.placeholder"),className:La.emailInput,onChange:A}),m?.length===0?v.jsx("div",{className:La.validationError,children:s("export-transcript.email.invalid")}):null]}),v.jsxs("div",{className:La.actions,children:[v.jsx($b,{onClick:i,children:s("export-transcript.email.cancel")}),v.jsx(au,{type:"submit",disabled:d||m===void 0||m.length===0,children:s("export-transcript.email.send")})]})]}),d&&v.jsx("div",{className:La.submitted,children:s("export-transcript.email.success")})]})},M6="_inputContainer_fi5ao_1",D6={inputContainer:M6},L6="_blockUserInput_pot9c_1",B6={blockUserInput:L6},U6=({visible:t})=>{const r=tt();return t?v.jsx("div",{className:Q(B6.blockUserInput,"chat__blockUserInput"),children:r("block-user-input.title")}):null},H6="_commandsDropdown_5ytuv_1",j6="_commands_5ytuv_1",I6="_command_5ytuv_1",z6="_commandActive_5ytuv_46",G6="_commandsSelections_5ytuv_55",Zs={commandsDropdown:H6,commands:j6,command:I6,commandActive:z6,commandsSelections:G6},Wb=(t,r)=>{H.useEffect(()=>{const i=s=>{t.current&&!t.current.contains(s.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[t,r])},k6=(t,r,i,s,u)=>{H.useEffect(()=>{const c=d=>{if(t.length)switch(d.key){case"Enter":i(t[r]);break;case"ArrowUp":s(h=>h>0?h-1:t.length-1);break;case"ArrowDown":s(h=>h<t.length-1?h+1:0);break;case"Escape":u([]);break}};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[t,r,i,s,u])},q6=({text:t,commands:r,onSelectCommand:i,onVisibilityChange:s})=>{const u=H.useRef(null),c=tt(),[d,h]=H.useState([]),[m,p]=H.useState(Cv(r)),[y,E]=H.useState(0),A=U=>i(`/${U}`);return Wb(u,()=>h([])),k6(d,y,A,E,h),H.useEffect(()=>{p(Cv(r))},[r]),H.useEffect(()=>{const U=t.length||0;U===0||U>m||!t.startsWith("/")?h([]):h(r.filter(F6(t))),E(0)},[r,t,m]),H.useEffect(()=>{s(!!d.length)},[d,s]),d.length?v.jsx("div",{ref:u,className:Zs.commandsDropdown,children:v.jsx("ul",{id:"command-list",className:Zs.commands,role:"listbox",children:d.map((U,R)=>v.jsxs("li",{className:Q([Zs.command,y===R&&Zs.commandActive]),role:"option",onClick:()=>A(U),onMouseOver:()=>E(R),children:[v.jsxs("h1",{children:["/",U]}),v.jsx("p",{children:c(`commands.${U}`)})]},U))})}):null},Cv=t=>Math.max(...t.map(r=>r.length+1)),F6=t=>r=>{const i=`/${r}`;return i.startsWith(t)&&i.length>=t.length},Nv=3,V6=({commands:t,onSelectCommand:r})=>{const i=tt(),[s,u]=H.useState(!1),c=p=>()=>{r(`/${p}`),u(!1)},d=()=>{u(!0)},h=()=>{u(!1)},m=s?t:t.slice(0,Nv);return v.jsxs("div",{className:Zs.commandsSelections,children:[m.map(p=>v.jsxs("button",{className:"tooltip--top-center","aria-label":i(`commands.${p}`),"data-title":i(`commands.${p}`),tabIndex:0,onClick:c(p),children:["/",p]},p)),m.length<t.length?v.jsx("button",{"aria-label":i("commands.show-more.tooltip"),"data-title":i("commands.show-more.tooltip"),tabIndex:0,onClick:d,children:i("commands.show-more.action")},"show-more"):m.length>Nv?v.jsx("button",{"aria-label":i("commands.show-less.tooltip"),"data-title":i("commands.show-less.tooltip"),tabIndex:0,onClick:h,children:i("commands.show-less.action")},"show-less"):null]})},P6="_callToActionContainer_d8izj_1",Y6="_callToActionTitle_d8izj_23",X6="_rateOverlay_d8izj_30",Z6="_body_d8izj_52",Q6="_footer_d8izj_60",K6="_actions_d8izj_75",$6="_bubbles_d8izj_89",W6="_stars_d8izj_191",J6="_starsSmall_d8izj_205",eC="_starsLarge_d8izj_211",tC="_star_d8izj_191",nC="_starReadonly_d8izj_225",rC="_starIcon_d8izj_235",aC="_starsDescriptionContainer_d8izj_253",iC="_starsDescription_d8izj_253",It={callToActionContainer:P6,callToActionTitle:Y6,rateOverlay:X6,body:Z6,footer:Q6,actions:K6,bubbles:$6,stars:W6,starsSmall:J6,starsLarge:eC,star:tC,starReadonly:nC,starIcon:rC,starsDescriptionContainer:aC,starsDescription:iC},sC=({value:t,index:r,count:i,readonly:s,onHover:u,onClick:c})=>{const d=h=>{c&&h.key==="Enter"&&c()};return v.jsx("li",{className:Q(It.star,{[It.starReadonly]:s},"chat__conversationRating__star"),children:v.jsx("div",{role:"radio","aria-checked":t>r?"true":"false","aria-posinset":r+1,"aria-setsize":i,tabIndex:0,onMouseOver:u,onKeyDown:d,onClick:c,children:v.jsx("span",{role:"img","aria-label":"Star",className:Q(It.starIcon),children:v.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:v.jsx("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"})})})})})},Mv=5,Jb=({value:t,size:r,readonly:i=!1,onChange:s})=>{const[u,c]=H.useState(void 0),d=()=>{c(void 0)},h=p=>()=>{if(!i){const y=p+1;c(y)}},m=p=>()=>{s&&!i&&(s(p===0&&t===1?0:p+1),c(void 0))};return v.jsx("ul",{tabIndex:0,role:"radiogroup",className:Q(It.stars,{[It.starsSmall]:r==="small",[It.starsLarge]:r==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:r==="small",chat__conversationRating__stars__large:r==="large"}),onMouseOut:d,children:Array(Mv).fill(0).map((p,y)=>v.jsx(sC,{value:u===void 0?t:u,index:y,count:Mv,readonly:i,onHover:h(y),onClick:m(y)},y))})},lC=({visible:t,onRate:r})=>{const i=tt();return t?v.jsxs("div",{className:Q(It.callToActionContainer,"chat__conversationRating__callToAction"),children:[v.jsx("div",{className:Q(It.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),v.jsx(Jb,{value:0,size:"small",onChange:r})]}):null},gd=({isFirstMessageBySender:t,isLastMessageBySender:r,children:i})=>v.jsxs("div",{className:Q(ye.message,ye.messageBot,t&&ye.messageBotFirst,r&&ye.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",t&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:[v.jsx("img",{className:Q(ye.avatar,ye.botAvatar),src:"bot.svg",alt:"Bot"}),v.jsx("div",{className:Q(ye.bubble,ye.bubbleLeft,"chat__bubble","chat__botBubble"),children:v.jsx("div",{className:Q(ye.leftText,ye.bubbleContent),children:i})})]}),oC=({children:t})=>v.jsx("div",{className:Q(ye.message,ye.messageGuest,ye.messageGuestFirst,ye.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:v.jsx("div",{className:Q(ye.bubble,ye.bubbleRight,"chat__bubble","chat__guestBubble"),children:v.jsx("div",{className:Q(ye.rightText,ye.bubbleContent),children:t})})}),uC=()=>{const t=tt(),r=Cr(),i=it(G=>G.chat.conversationRating),[s,u]=H.useState(i.rating?.value||0),[c,d]=H.useState(void 0),[h,m]=H.useState(void 0),[p,y]=H.useState({submitted:!1,feedback:""}),[E,A]=H.useState(!1),U=H.useRef(null);H.useEffect(()=>{i.opener?(y({submitted:!1,feedback:""}),m(!0)):h===!0&&m(!1)},[i.opener,h]),H.useEffect(()=>{u(i.rating?.value||0)},[i.rating?.value,i.opener]),H.useEffect(()=>{U.current&&(U.current.value=i.rating?.feedback||"")},[i.rating?.feedback]),H.useEffect(()=>{const G=s>0?t(`conversation-rating.overlay.bot-message.rate-feedback.value-${s}`):void 0;d(G?.length?G:void 0)},[s,t]),H.useEffect(()=>{p.submitted?setTimeout(()=>A(!0),p.feedback.length?500:0):A(!1)},[p]);const R=G=>{G.preventDefault();const _=U.current?.value?.trim()||"";r(Ox(s,_)),y({submitted:!0,feedback:_})},F=()=>{i.opener==="CLOSE_CHAT"?r(Db()):r(TO())};return v.jsx("div",{className:Q(It.rateOverlay,Or.bottomSheet,"chat__conversationRating__overlay",{[Or.bottomSheetOpen]:h===!0,[Or.bottomSheetClose]:h===!1}),children:v.jsxs("form",{onSubmit:R,children:[v.jsxs("div",{className:Q(It.body,"chat__conversationRating__overlay__body"),children:[v.jsx("div",{}),v.jsx("div",{className:Q(It.bubbles),children:i.opener&&v.jsxs(v.Fragment,{children:[v.jsxs(gd,{isFirstMessageBySender:!0,isLastMessageBySender:!c,children:[v.jsx("h2",{children:t("conversation-rating.overlay.title")}),v.jsxs("div",{className:Q(It.starsDescriptionContainer),children:[v.jsx(Jb,{value:s,size:"large",readonly:p.submitted,onChange:u}),v.jsxs("div",{className:Q(It.starsDescription),children:[v.jsx("div",{children:t("conversation-rating.overlay.star.very-bad")}),v.jsx("div",{children:t("conversation-rating.overlay.star.very-good")})]})]})]}),c&&v.jsx(gd,{isFirstMessageBySender:!1,isLastMessageBySender:!E||!!p.feedback.length,children:v.jsx("div",{children:c})}),!!p.feedback.length&&v.jsx(oC,{children:p.feedback}),E&&v.jsx(gd,{isFirstMessageBySender:!!p.feedback.length,isLastMessageBySender:!0,children:v.jsx("div",{children:t("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),v.jsxs("div",{className:Q(It.footer,"chat__conversationRating__overlay__footer"),children:[!p.submitted&&v.jsx("input",{ref:U,defaultValue:i.rating?.feedback||"",placeholder:t("conversation-rating.overlay.guest-feedback.input-placeholder")}),v.jsxs("div",{className:Q(It.actions,"chat__conversationRating__overlay__footer__actions"),children:[p.submitted?v.jsx(au,{type:"button",disabled:!s,onClick:F,children:i.opener==="CLOSE_CHAT"?t("conversation-rating.overlay.action.close-chat"):t("conversation-rating.overlay.action.back-to-chat")},"close-button"):v.jsx(au,{type:"submit",disabled:!s,children:t("conversation-rating.overlay.action.submit")},"submit-button"),i.opener!=="CHAT"&&!p.submitted&&v.jsx($b,{onClick:F,children:i.opener==="CLOSE_CHAT"?t("conversation-rating.overlay.action.close-chat"):t("conversation-rating.overlay.action.cancel")})]})]})]})})},cC=({numberOfMessagesFromGuest:t})=>{const r=Cr(),i=it(c=>c.chat.conversationRating),s=c=>{r(Ih("CHAT",c))},u=!i.rating?.value&&t>=1;return i.enabled?v.jsxs(v.Fragment,{children:[v.jsx(lC,{visible:u,onRate:s}),v.jsx(uC,{})]}):null},fC=H.memo(cC),dC="_inputWrapper_e3h44_1",hC="_withOpenCommands_e3h44_14",mC="_messageInputWrapper_e3h44_20",pC="_messageInput_e3h44_20",gC="_buttons_e3h44_44",yC="_button_e3h44_44",xi={inputWrapper:dC,withOpenCommands:hC,messageInputWrapper:mC,messageInput:pC,buttons:gC,button:yC},vC="_audioRecorder_g845f_1",bC="_audioButton_g845f_6",_C="_recorderIcon_g845f_37",EC="_spinning_g845f_60",Ba={audioRecorder:vC,audioButton:bC,recorderIcon:_C,spinning:EC},Dv=2048,iu=16e3;class SC extends v1.Component{audioInput=null;volume=null;leftchannel=[];recorder=null;recordingLength=0;sampleRate=null;mediaStream=null;constructor(r){super(r),this.state={recordingState:"none"},this.triggerAudioRecording=this.triggerAudioRecording.bind(this),this.triggerAudioRecordingSuccess=this.triggerAudioRecordingSuccess.bind(this),this.initRecording=this.initRecording.bind(this),this.processRecordingInput=this.processRecordingInput.bind(this),this.handleClickSubmitAudio=this.handleClickSubmitAudio.bind(this),this.handleClickStopAudio=this.handleClickStopAudio.bind(this)}triggerAudioRecording(){this.setState({recordingState:"connecting"}),navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(this.triggerAudioRecordingSuccess)}triggerAudioRecordingSuccess(r){this.mediaStream=r,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(r)}initRecording(r){const i=window.AudioContext||window.webkitAudioContext,s=new i;this.sampleRate=s.sampleRate,this.volume=s.createGain(),this.audioInput=s.createMediaStreamSource(r),this.audioInput.connect(this.volume),this.recorder=s.createScriptProcessor(Dv,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(s.destination)}processRecordingInput(r){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const i=r.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(i)),this.recordingLength+=Dv}}handleClickSubmitAudio(){const r=AC(this.leftchannel,this.recordingLength),i=xC(r,this.sampleRate||0),s=TC(i);this.props.onAudioRecorded(s),this.handleClickStopAudio()}handleClickStopAudio(){this.setState({recordingState:"none"}),this.audioInput?.disconnect(),this.volume?.disconnect(),this.recorder?.disconnect(),this.mediaStream&&this.mediaStream?.getAudioTracks().forEach(r=>{r.stop()})}render(){return v.jsxs("div",{className:Ba.audioRecorder,children:[this.state.recordingState==="none"&&v.jsx("button",{className:Q(Ba.audioButton,"chat__button"),type:"submit","aria-label":this.props.translate("message-input.actions.start-audio-recording.label"),"data-title":this.props.translate("message-input.actions.start-audio-recording.label"),tabIndex:0,onClick:this.triggerAudioRecording,children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z"}),v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&v.jsxs("svg",{className:Ba.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&v.jsxs("div",{className:Ba.audioRecorder,children:[v.jsx("button",{className:Q(Ba.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),v.jsx("div",{className:Ba.recorderIcon}),v.jsx("button",{className:Q(Ba.audioButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),v.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const TC=t=>{const r=new ArrayBuffer(44+t.length*2),i=new DataView(r);jo(i,0,"RIFF"),i.setUint32(4,44+t.length*2,!0),jo(i,8,"WAVE"),jo(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,iu,!0),i.setUint32(28,iu*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),jo(i,36,"data"),i.setUint32(40,t.length*2,!0);const s=t.length;let u=44;const c=1;for(let d=0;d<s;d++)i.setInt16(u,t[d]*(32767*c),!0),u+=2;return new Blob([i],{type:"audio/wav"})},jo=(t,r,i)=>{for(let s=0;s<i.length;s++)t.setUint8(r+s,i.charCodeAt(s))},AC=(t,r)=>{const i=new Float32Array(r);let s=0;const u=t.length;for(let c=0;c<u;c++){const d=t[c];i.set(d,s),s+=d.length}return i},xC=(t,r)=>{if(iu===r)return t;const i=r/iu,s=Math.round(t.length/i),u=new Float32Array(s);let c=0,d=0;for(;c<u.length;){const h=Math.round((c+1)*i);let m=0,p=0;for(let y=d;y<h&&y<t.length;y++)m+=t[y],p++;u[c]=m/p,c++,d=h}return u},OC=({disabled:t,textInput:r,commandsVisible:i,hasCommands:s,onTextInput:u,onTextInputSubmit:c,onAudioRecorded:d})=>{const h=tt(),m=H.useRef(null),{enableSpeechSupport:p}=it(R=>R.settings);H.useEffect(()=>{m.current?.focus()},[r]);const y=()=>{const R=m.current;R&&r.trim().length>=1&&c(r.trim())&&(R.value="",R.style.height="",R.focus())},E=R=>{R.preventDefault(),y()},A=R=>{const F=R.target.value;u(F),R.target.style.height="";const{scrollHeight:G}=R.target;R.target.style.height=`${G>150?150:G}px`},U=R=>{R.code==="Enter"&&!R.shiftKey?(R.repeat||y(),R.preventDefault()):i&&(R.code==="ArrowUp"||R.code==="ArrowDown")&&R.preventDefault()};return v.jsxs("form",{className:Q(xi.inputWrapper,i&&xi.withOpenCommands,"chat__textInput"),onSubmit:E,children:[v.jsx("div",{className:xi.messageInputWrapper,children:v.jsx("textarea",{id:"user_input",ref:m,className:xi.messageInput,tabIndex:0,placeholder:h("message-input-placeholder"),value:r,onChange:A,onKeyDown:U,"aria-label":h("message-input-label"),"aria-controls":s?"command-list":void 0,"aria-haspopup":s?"listbox":void 0})}),v.jsx("div",{className:Q(xi.buttons,"chat__buttons"),children:r.length||!p||navigator.mediaDevices===void 0?v.jsx("button",{className:Q(xi.button,"chat__button"),type:"submit","aria-label":h("message-input.actions.submit.label"),"data-title":h("message-input.actions.submit.label"),tabIndex:0,disabled:t,children:v.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:v.jsx("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})})}):p&&navigator.mediaDevices!==void 0&&v.jsx(SC,{translate:h,onAudioRecorded:d})})]})},RC="_quickReplies_83npe_1",wC="_quickReply_83npe_9",Lv={quickReplies:RC,quickReply:wC},CC=({quickReplies:t,onQuickReplyClick:r})=>t.length?v.jsx("div",{className:Q(Lv.quickReplies,"chat__quickReplies"),children:t.map(i=>v.jsx(bu,{tabIndex:0,className:Q(Lv.quickReply,"chat__button","chat__quickReply"),onClick:()=>r(i),children:i.label},i.label))}):null,Bv=5e3,NC=1e3,MC=({isBotTyping:t,quickReplies:r,numberOfMessagesFromGuest:i,commands:s,onTextInput:u,onQuickReplyClick:c,onAudioRecorded:d})=>{const[h,m]=H.useState(""),[p,y]=H.useState(!1),[E,A]=H.useState(!1),U=H.useRef(0),R=H.useRef(0);H.useEffect(()=>{if(p&&!t){const _=U.current?Date.now()-U.current:0;_>Bv?y(!1):setTimeout(()=>{y(!1)},Bv-_)}},[p,t]),H.useEffect(()=>{p&&(U.current=Date.now())},[p]);const F=_=>{const C=Date.now()-R.current<NC;return E?!1:t||C?(y(!0),!1):(u(_),m(""),R.current=Date.now(),!0)},G=_=>{m(_+" ")};return v.jsxs("div",{className:Q(D6.inputContainer),children:[v.jsx(CC,{quickReplies:r,onQuickReplyClick:c}),v.jsx(U6,{visible:p}),!p&&v.jsx(fC,{numberOfMessagesFromGuest:i}),!!s?.length&&v.jsx(q6,{text:h,commands:s,onSelectCommand:G,onVisibilityChange:A}),v.jsx(OC,{textInput:h,disabled:p,commandsVisible:E,hasCommands:!!s?.length,onTextInput:m,onTextInputSubmit:F,onAudioRecorded:d}),!!s?.length&&v.jsx(V6,{commands:s,onSelectCommand:m})]})},DC=({clientName:t,messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u,onMessageFromUser:c,onQuickReplyClick:d,onButtonClick:h,onLinkClick:m,onAudioRecorded:p,onTranscriptExport:y,onTranscriptItemReaction:E})=>{const A=Cr(),U=it(I=>I.connection.connectionState),{enableTranscriptExportEmail:R,commands:F}=it(I=>I.settings),{showTranscriptMailOverlay:G,conversationRating:_}=it(I=>I.chat),C=r.filter(I=>I.sender.type===ru.GUEST).length;H.useEffect(()=>{if(U===Ia.CONNECTED){const I=uu.parse(window.location.search);A(Bb(t,I))}},[t,U,A]);const S=()=>{A(Lb())};return v.jsxs("div",{className:od.container,children:[v.jsxs("div",{className:Q([od.chatcontent,(G||_?.opener)&&od.accessabilityHidden]),children:[v.jsx(f6,{messages:r,isBotTyping:s,commands:F,onButtonClick:h,onLinkClick:m,onTranscriptItemReaction:E}),v.jsx(MC,{isBotTyping:s,quickReplies:s?[]:i,numberOfMessagesFromGuest:C,commands:F,onQuickReplyClick:d,onTextInput:c,onAudioRecorded:p}),v.jsx(S6,{})]}),R&&v.jsx(N6,{visible:!!G,onEmailExport:y,onClose:S}),v.jsx(v6,{contentUrl:u})]})},LC=t=>{const{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u}=t.chat;return{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u}},BC=t=>({onRestartChat:(r,i)=>t(gu(r,i)),onMessageFromUser:r=>t(lb(r)),onAudioRecorded:r=>t(Ex(r)),onActionFromUser:r=>t(r),onQuickReplyClick:r=>t(sb(r)),onNluEvent:r=>t(db(r)),onButtonClick:r=>t(wx(r)),onLinkClick:r=>t(hb(r)),onTranscriptExport:r=>t(Tx(r)),onTranscriptItemReaction:(r,i)=>t(Te.Actions.transcriptItemGuestReaction(r,i||null))}),UC=qS(LC,BC)(DC),e_=()=>{const[t,r]=H.useState(!1);return H.useEffect(()=>{r((()=>{try{return window.self!==window.top}catch{return!0}})())},[]),t},HC=t=>r=>{const i=r.key;(i==="ArrowDown"||i==="ArrowRight"||i==="Enter"||i===" "||i==="Space")&&(r.stopPropagation(),t())},jC=({onClick:t})=>{const r=tt();return e_()?v.jsx("button",{className:"tooltip--bottom-left","aria-label":r("header.close-chat"),"data-title":r("header.close-chat"),tabIndex:0,onClick:t,onKeyDown:HC(t),children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"})})}):null},IC="_header_3gvbz_1",zC="_logoContainer_3gvbz_14",GC="_logo_3gvbz_14",kC="_actions_3gvbz_28",qC="_active_3gvbz_43",FC="_menuContainer_3gvbz_56",VC="_menu_3gvbz_56",PC="_divider_3gvbz_86",sa={header:IC,logoContainer:zC,logo:GC,actions:kC,active:qC,menuContainer:FC,menu:VC,divider:PC},YC=({icon:t})=>{switch(t){case"arrow-counter-clockwise":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"})});case"download":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"})});case"expand":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"})});case"mail":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"})});case"phone":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M144.27,45.93a8,8,0,0,1,9.8-5.66,86.22,86.22,0,0,1,61.66,61.66,8,8,0,0,1-5.66,9.8A8.23,8.23,0,0,1,208,112a8,8,0,0,1-7.73-5.94,70.35,70.35,0,0,0-50.33-50.33A8,8,0,0,1,144.27,45.93Zm-2.33,41.8c13.79,3.68,22.65,12.54,26.33,26.33A8,8,0,0,0,176,120a8.23,8.23,0,0,0,2.07-.27,8,8,0,0,0,5.66-9.8c-5.12-19.16-18.5-32.54-37.66-37.66a8,8,0,1,0-4.13,15.46Zm81.94,95.35A56.26,56.26,0,0,1,168,232C88.6,232,24,167.4,24,88A56.26,56.26,0,0,1,72.92,32.12a16,16,0,0,1,16.62,9.52l21.12,47.15,0,.12A16,16,0,0,1,109.39,104c-.18.27-.37.52-.57.77L88,129.45c7.49,15.22,23.41,31,38.83,38.51l24.34-20.71a8.12,8.12,0,0,1,.75-.56,16,16,0,0,1,15.17-1.4l.13.06,47.11,21.11A16,16,0,0,1,223.88,183.08Zm-15.88-2s-.07,0-.11,0h0l-47-21.05-24.35,20.71a8.44,8.44,0,0,1-.74.56,16,16,0,0,1-15.75,1.14c-18.73-9.05-37.4-27.58-46.46-46.11a16,16,0,0,1,1-15.7,6.13,6.13,0,0,1,.57-.77L96,95.15l-21-47a.61.61,0,0,1,0-.12A40.2,40.2,0,0,0,40,88,128.14,128.14,0,0,0,168,216,40.21,40.21,0,0,0,208,181.07Z"})});case"scroll":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M96,104a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H104A8,8,0,0,1,96,104Zm8,40h64a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16Zm128,48a32,32,0,0,1-32,32H88a32,32,0,0,1-32-32V64a16,16,0,0,0-32,0c0,5.74,4.83,9.62,4.88,9.66h0A8,8,0,0,1,24,88a7.89,7.89,0,0,1-4.79-1.61h0C18.05,85.54,8,77.61,8,64A32,32,0,0,1,40,32H176a32,32,0,0,1,32,32V168h8a8,8,0,0,1,4.8,1.6C222,170.46,232,178.39,232,192ZM96.26,173.48A8.07,8.07,0,0,1,104,168h88V64a16,16,0,0,0-16-16H67.69A31.71,31.71,0,0,1,72,64V192a16,16,0,0,0,32,0c0-5.74-4.83-9.62-4.88-9.66A7.82,7.82,0,0,1,96.26,173.48ZM216,192a12.58,12.58,0,0,0-3.23-8h-94a26.92,26.92,0,0,1,1.21,8,31.82,31.82,0,0,1-4.29,16H200A16,16,0,0,0,216,192Z"})});case"star":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"})});case"link":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"})});default:return v.jsx("div",{})}},XC=H.forwardRef(({selected:t,item:r,onClick:i},s)=>{const u=tt(),c=d=>{d.preventDefault(),i()};return v.jsx("li",{"aria-selected":t,role:"option",className:r.withDivider?sa.divider:void 0,children:v.jsxs("a",{ref:s,type:"button",role:"button",tabIndex:-1,onClick:c,children:[v.jsx(YC,{icon:r.icon}),v.jsx("span",{children:u(`header.menu.${r.id}`)})]})})}),ZC=(t,r)=>{const i=e_(),{menuItems:s,enableStandaloneView:u,enableTranscriptExportPdf:c,enableTranscriptExportEmail:d}=it(p=>p.settings),h=it(p=>p.chat.conversationRating.enabled);return H.useMemo(()=>{const p=[],y=s.filter(({visibility:E})=>t?E==="always"||E==="chat-only":E==="always"||E==="start-screen-only");if(t&&(p.push({id:"restart-chat",type:"restart-chat",icon:"arrow-counter-clockwise",visibility:"chat-only"}),i&&u&&p.push({id:"expand-chat-window",type:"expand-chat-window",icon:"expand",visibility:"always"}),r&&c&&p.push({id:"download-transcript",type:"download-transcript",icon:"download",visibility:"chat-only"}),r&&d&&p.push({id:"send-transcript",type:"send-transcript",icon:"mail",visibility:"chat-only"}),r&&h&&p.push({id:"rate-conversation",type:"rate-conversation",icon:"star",visibility:"chat-only"}),p.length>0&&y.length)){const E=p.pop();E&&s.length&&p.push({...E,withDivider:!0})}return p.push(...y),p},[t,r,c,d,u,h,i,s])},QC=({chatStarted:t,hasGuestMessages:r})=>{const i=Cr(),s=_u(),u=tt(),[c,d]=H.useState(!1),[h,m]=H.useState(-1),p=H.useRef(null),y=H.useRef(null),E=H.useRef([]),A=ZC(t,r);H.useEffect(()=>{E.current[h]?.focus()},[h]);const U=H.useCallback(()=>{const _=uu.parse(window.location.search);i(gu(s,_)),d(!1),m(0)},[i,s]),R=H.useCallback(_=>{switch(_.type){case"restart-chat":U();break;case"expand-chat-window":window.open(window.location.href,"_blank");break;case"download-transcript":i(Ax());break;case"send-transcript":i(Lb());break;case"rate-conversation":i(Ih("MENU"));break;case"link":i(hb(_.url));break;case"action":i(JSON.parse(JSON.stringify(_.action)));break}d(!1)},[i,U,d]);H.useEffect(()=>{const _=C=>{if(c)switch(C.key){case"Enter":C.preventDefault(),R(A[h]);break;case"ArrowUp":m(S=>S>0?S-1:A.length-1);break;case"ArrowDown":m(S=>S<A.length-1?S+1:0);break;case"Escape":d(!1);break;case"Tab":h>-1&&d(!1);break}};return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[c,h,A,m,d,R]),H.useEffect(()=>{c||m(-1)},[c,h]),Wb(y,()=>d(!1));const F=()=>{d(_=>!_)},G=()=>{setTimeout(()=>{const _=document.activeElement;y.current&&!y.current.contains(_)&&d(!1)},0)};return A.length?v.jsxs("div",{className:Q(sa.menuContainer),ref:y,children:[v.jsx("button",{ref:p,className:Q(c&&sa.active,c?"tooltip-hidden":"tooltip--bottom-left"),"aria-label":u("header.menu.title"),"data-title":u("header.menu.title"),onClick:F,onBlur:G,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"})})}),c&&v.jsx("nav",{className:sa.menu,"aria-label":u("header.menu.title"),children:v.jsx("ul",{tabIndex:0,children:A.map((_,C)=>v.jsx(XC,{ref:S=>{E.current[C]=S},selected:h===C,item:_,onClick:()=>R(_)},_.id))})})]}):null},Uv=({className:t,chatStarted:r,...i})=>{const s=Cr(),u=it(h=>h.chat.conversationRating.enabled),c=it(h=>h.chat.messages.some(m=>m.sender.type===Te.UserType.GUEST)),d=()=>{s(u&&c?Ih("CLOSE_CHAT"):Db())};return v.jsxs("div",{className:Q([sa.header,t]),...i,children:[v.jsx("div",{className:sa.logoContainer,children:v.jsx("div",{className:sa.logo})}),v.jsxs("div",{className:sa.actions,children:[v.jsx(QC,{chatStarted:r,hasGuestMessages:c}),v.jsx(jC,{onClick:d})]})]})},KC="_chatwindow_rkbir_1",$C="_chatwindowWithAside_rkbir_21",Hv={chatwindow:KC,chatwindowWithAside:$C},t_=()=>{const[t,r]=H.useState(!1);return H.useEffect(()=>{const i=window.matchMedia("(max-width: 1023px)"),s=()=>r(i.matches);return s(),i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[]),t},WC="_sourceInfos_vei0l_1",JC="_waitForLoading_vei0l_24",e3="_loadingContent_vei0l_28",t3="_sourceHeader_vei0l_37",n3="_sourceHeaderIcon_vei0l_57",r3="_sourceContent_vei0l_61",a3="_openSourceButton_vei0l_69",i3="_sourceButtonLabel_vei0l_79",s3="_closeSourceInfosButton_vei0l_101",l3="_loadingSourceInfos_vei0l_125",o3="_loading_vei0l_28",u3="_loadingError_vei0l_139",c3="_highlightLoadingInfo_vei0l_155",f3="_highlightLoadingInfoInnerContainer_vei0l_169",d3="_highlightLoadingInfoContent_vei0l_178",h3="_highlightLoadingInfoCloseIcon_vei0l_198",m3="_highlightLoader_vei0l_203",p3="_highlightLoaderLoading_vei0l_210",_t={sourceInfos:WC,waitForLoading:JC,loadingContent:e3,sourceHeader:t3,sourceHeaderIcon:n3,sourceContent:r3,openSourceButton:a3,sourceButtonLabel:i3,closeSourceInfosButton:s3,loadingSourceInfos:l3,loading:o3,loadingError:u3,highlightLoadingInfo:c3,highlightLoadingInfoInnerContainer:f3,highlightLoadingInfoContent:d3,highlightLoadingInfoCloseIcon:h3,highlightLoader:m3,highlightLoaderLoading:p3},g3=({onClick:t})=>{const r=tt();return v.jsx("button",{className:Q(_t.closeSourceInfosButton,"tooltip--bottom-left"),"aria-label":r("source-infos.close"),"data-title":r("source-infos.close"),tabIndex:0,onClick:t,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})})},y3=H.forwardRef(({sourceInfos:t,onClose:r,...i},s)=>v.jsxs("div",{className:_t.sourceHeader,...i,ref:s,children:[v.jsx("div",{children:t?v.jsx("p",{id:"source-info-title",children:t.title}):v.jsx("p",{children:" "})}),v.jsx(g3,{onClick:r})]})),v3=({loading:t})=>v.jsx("div",{className:_t.highlightLoader,children:t&&v.jsx("div",{className:_t.highlightLoaderLoading})});/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:n_,setPrototypeOf:jv,isFrozen:b3,getPrototypeOf:_3,getOwnPropertyDescriptor:E3}=Object;let{freeze:zt,seal:Sn,create:r_}=Object,{apply:lh,construct:oh}=typeof Reflect<"u"&&Reflect;zt||(zt=function(r){return r});Sn||(Sn=function(r){return r});lh||(lh=function(r,i,s){return r.apply(i,s)});oh||(oh=function(r,i){return new r(...i)});const Io=Gt(Array.prototype.forEach),S3=Gt(Array.prototype.lastIndexOf),Iv=Gt(Array.prototype.pop),ks=Gt(Array.prototype.push),T3=Gt(Array.prototype.splice),Po=Gt(String.prototype.toLowerCase),yd=Gt(String.prototype.toString),zv=Gt(String.prototype.match),qs=Gt(String.prototype.replace),A3=Gt(String.prototype.indexOf),x3=Gt(String.prototype.trim),Hn=Gt(Object.prototype.hasOwnProperty),Ht=Gt(RegExp.prototype.test),Fs=O3(TypeError);function Gt(t){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var i=arguments.length,s=new Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];return lh(t,r,s)}}function O3(t){return function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return oh(t,i)}}function Re(t,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Po;jv&&jv(t,null);let s=r.length;for(;s--;){let u=r[s];if(typeof u=="string"){const c=i(u);c!==u&&(b3(r)||(r[s]=c),u=c)}t[u]=!0}return t}function R3(t){for(let r=0;r<t.length;r++)Hn(t,r)||(t[r]=null);return t}function Sr(t){const r=r_(null);for(const[i,s]of n_(t))Hn(t,i)&&(Array.isArray(s)?r[i]=R3(s):s&&typeof s=="object"&&s.constructor===Object?r[i]=Sr(s):r[i]=s);return r}function Vs(t,r){for(;t!==null;){const s=E3(t,r);if(s){if(s.get)return Gt(s.get);if(typeof s.value=="function")return Gt(s.value)}t=_3(t)}function i(){return null}return i}const Gv=zt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),vd=zt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),bd=zt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),w3=zt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),_d=zt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),C3=zt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kv=zt(["#text"]),qv=zt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ed=zt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Fv=zt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),zo=zt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),N3=Sn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),M3=Sn(/<%[\w\W]*|[\w\W]*%>/gm),D3=Sn(/\$\{[\w\W]*/gm),L3=Sn(/^data-[\-\w.\u00B7-\uFFFF]+$/),B3=Sn(/^aria-[\-\w]+$/),a_=Sn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),U3=Sn(/^(?:\w+script|data):/i),H3=Sn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),i_=Sn(/^html$/i),j3=Sn(/^[a-z][.\w]*(-[.\w]+)+$/i);var Vv=Object.freeze({__proto__:null,ARIA_ATTR:B3,ATTR_WHITESPACE:H3,CUSTOM_ELEMENT:j3,DATA_ATTR:L3,DOCTYPE_NAME:i_,ERB_EXPR:M3,IS_ALLOWED_URI:a_,IS_SCRIPT_OR_DATA:U3,MUSTACHE_EXPR:N3,TMPLIT_EXPR:D3});const Ps={element:1,text:3,progressingInstruction:7,comment:8,document:9},I3=function(){return typeof window>"u"?null:window},z3=function(r,i){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let s=null;const u="data-tt-policy-suffix";i&&i.hasAttribute(u)&&(s=i.getAttribute(u));const c="dompurify"+(s?"#"+s:"");try{return r.createPolicy(c,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Pv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function s_(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I3();const r=le=>s_(le);if(r.version="3.2.6",r.removed=[],!t||!t.document||t.document.nodeType!==Ps.document||!t.Element)return r.isSupported=!1,r;let{document:i}=t;const s=i,u=s.currentScript,{DocumentFragment:c,HTMLTemplateElement:d,Node:h,Element:m,NodeFilter:p,NamedNodeMap:y=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:E,DOMParser:A,trustedTypes:U}=t,R=m.prototype,F=Vs(R,"cloneNode"),G=Vs(R,"remove"),_=Vs(R,"nextSibling"),C=Vs(R,"childNodes"),S=Vs(R,"parentNode");if(typeof d=="function"){const le=i.createElement("template");le.content&&le.content.ownerDocument&&(i=le.content.ownerDocument)}let I,x="";const{implementation:Z,createNodeIterator:W,createDocumentFragment:ae,getElementsByTagName:ge}=i,{importNode:Ee}=s;let se=Pv();r.isSupported=typeof n_=="function"&&typeof S=="function"&&Z&&Z.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:me,ERB_EXPR:ce,TMPLIT_EXPR:Pe,DATA_ATTR:be,ARIA_ATTR:z,IS_SCRIPT_OR_DATA:K,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:Ae}=Vv;let{IS_ALLOWED_URI:O}=Vv,k=null;const $=Re({},[...Gv,...vd,...bd,..._d,...kv]);let Y=null;const te=Re({},[...qv,...Ed,...Fv,...zo]);let re=Object.seal(r_(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ue=null,$e=null,Ue=!0,Et=!0,zn=!1,Nr=!0,Ze=!1,kt=!0,xn=!1,Di=!1,Li=!1,St=!1,qa=!1,ua=!1,Bi=!0,ca=!1;const Tu="user-content-";let Fa=!0,fa=!1,Mr={},fn=null;const Ct=Re({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let On=null;const Nt=Re({},["audio","video","img","source","image","track"]);let Ui=null;const rl=Re({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Va="http://www.w3.org/1998/Math/MathML",tr="http://www.w3.org/2000/svg",qt="http://www.w3.org/1999/xhtml";let Ft=qt,Dr=!1,nr=null;const Au=Re({},[Va,tr,qt],yd);let da=Re({},["mi","mo","mn","ms","mtext"]),ha=Re({},["annotation-xml"]);const Hi=Re({},["title","style","font","a","script"]);let Rn=null;const xu=["application/xhtml+xml","text/html"],al="text/html";let nt=null,Gn=null;const ji=i.createElement("form"),Ii=function(N){return N instanceof RegExp||N instanceof Function},zi=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Gn&&Gn===N)){if((!N||typeof N!="object")&&(N={}),N=Sr(N),Rn=xu.indexOf(N.PARSER_MEDIA_TYPE)===-1?al:N.PARSER_MEDIA_TYPE,nt=Rn==="application/xhtml+xml"?yd:Po,k=Hn(N,"ALLOWED_TAGS")?Re({},N.ALLOWED_TAGS,nt):$,Y=Hn(N,"ALLOWED_ATTR")?Re({},N.ALLOWED_ATTR,nt):te,nr=Hn(N,"ALLOWED_NAMESPACES")?Re({},N.ALLOWED_NAMESPACES,yd):Au,Ui=Hn(N,"ADD_URI_SAFE_ATTR")?Re(Sr(rl),N.ADD_URI_SAFE_ATTR,nt):rl,On=Hn(N,"ADD_DATA_URI_TAGS")?Re(Sr(Nt),N.ADD_DATA_URI_TAGS,nt):Nt,fn=Hn(N,"FORBID_CONTENTS")?Re({},N.FORBID_CONTENTS,nt):Ct,ue=Hn(N,"FORBID_TAGS")?Re({},N.FORBID_TAGS,nt):Sr({}),$e=Hn(N,"FORBID_ATTR")?Re({},N.FORBID_ATTR,nt):Sr({}),Mr=Hn(N,"USE_PROFILES")?N.USE_PROFILES:!1,Ue=N.ALLOW_ARIA_ATTR!==!1,Et=N.ALLOW_DATA_ATTR!==!1,zn=N.ALLOW_UNKNOWN_PROTOCOLS||!1,Nr=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ze=N.SAFE_FOR_TEMPLATES||!1,kt=N.SAFE_FOR_XML!==!1,xn=N.WHOLE_DOCUMENT||!1,St=N.RETURN_DOM||!1,qa=N.RETURN_DOM_FRAGMENT||!1,ua=N.RETURN_TRUSTED_TYPE||!1,Li=N.FORCE_BODY||!1,Bi=N.SANITIZE_DOM!==!1,ca=N.SANITIZE_NAMED_PROPS||!1,Fa=N.KEEP_CONTENT!==!1,fa=N.IN_PLACE||!1,O=N.ALLOWED_URI_REGEXP||a_,Ft=N.NAMESPACE||qt,da=N.MATHML_TEXT_INTEGRATION_POINTS||da,ha=N.HTML_INTEGRATION_POINTS||ha,re=N.CUSTOM_ELEMENT_HANDLING||{},N.CUSTOM_ELEMENT_HANDLING&&Ii(N.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(re.tagNameCheck=N.CUSTOM_ELEMENT_HANDLING.tagNameCheck),N.CUSTOM_ELEMENT_HANDLING&&Ii(N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(re.attributeNameCheck=N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(re.allowCustomizedBuiltInElements=N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ze&&(Et=!1),qa&&(St=!0),Mr&&(k=Re({},kv),Y=[],Mr.html===!0&&(Re(k,Gv),Re(Y,qv)),Mr.svg===!0&&(Re(k,vd),Re(Y,Ed),Re(Y,zo)),Mr.svgFilters===!0&&(Re(k,bd),Re(Y,Ed),Re(Y,zo)),Mr.mathMl===!0&&(Re(k,_d),Re(Y,Fv),Re(Y,zo))),N.ADD_TAGS&&(k===$&&(k=Sr(k)),Re(k,N.ADD_TAGS,nt)),N.ADD_ATTR&&(Y===te&&(Y=Sr(Y)),Re(Y,N.ADD_ATTR,nt)),N.ADD_URI_SAFE_ATTR&&Re(Ui,N.ADD_URI_SAFE_ATTR,nt),N.FORBID_CONTENTS&&(fn===Ct&&(fn=Sr(fn)),Re(fn,N.FORBID_CONTENTS,nt)),Fa&&(k["#text"]=!0),xn&&Re(k,["html","head","body"]),k.table&&(Re(k,["tbody"]),delete ue.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw Fs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Fs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');I=N.TRUSTED_TYPES_POLICY,x=I.createHTML("")}else I===void 0&&(I=z3(U,u)),I!==null&&typeof x=="string"&&(x=I.createHTML(""));zt&&zt(N),Gn=N}},wn=Re({},[...vd,...bd,...w3]),dt=Re({},[..._d,...C3]),Mt=function(N){let X=S(N);(!X||!X.tagName)&&(X={namespaceURI:Ft,tagName:"template"});const J=Po(N.tagName),Fe=Po(X.tagName);return nr[N.namespaceURI]?N.namespaceURI===tr?X.namespaceURI===qt?J==="svg":X.namespaceURI===Va?J==="svg"&&(Fe==="annotation-xml"||da[Fe]):!!wn[J]:N.namespaceURI===Va?X.namespaceURI===qt?J==="math":X.namespaceURI===tr?J==="math"&&ha[Fe]:!!dt[J]:N.namespaceURI===qt?X.namespaceURI===tr&&!ha[Fe]||X.namespaceURI===Va&&!da[Fe]?!1:!dt[J]&&(Hi[J]||!wn[J]):!!(Rn==="application/xhtml+xml"&&nr[N.namespaceURI]):!1},Tt=function(N){ks(r.removed,{element:N});try{S(N).removeChild(N)}catch{G(N)}},kn=function(N,X){try{ks(r.removed,{attribute:X.getAttributeNode(N),from:X})}catch{ks(r.removed,{attribute:null,from:X})}if(X.removeAttribute(N),N==="is")if(St||qa)try{Tt(X)}catch{}else try{X.setAttribute(N,"")}catch{}},il=function(N){let X=null,J=null;if(Li)N="<remove></remove>"+N;else{const We=zv(N,/^[\r\n\t ]+/);J=We&&We[0]}Rn==="application/xhtml+xml"&&Ft===qt&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");const Fe=I?I.createHTML(N):N;if(Ft===qt)try{X=new A().parseFromString(Fe,Rn)}catch{}if(!X||!X.documentElement){X=Z.createDocument(Ft,"template",null);try{X.documentElement.innerHTML=Dr?x:Fe}catch{}}const ht=X.body||X.documentElement;return N&&J&&ht.insertBefore(i.createTextNode(J),ht.childNodes[0]||null),Ft===qt?ge.call(X,xn?"html":"body")[0]:xn?X.documentElement:ht},sl=function(N){return W.call(N.ownerDocument||N,N,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Pa=function(N){return N instanceof E&&(typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||!(N.attributes instanceof y)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function")},Lr=function(N){return typeof h=="function"&&N instanceof h};function Qt(le,N,X){Io(le,J=>{J.call(r,N,X,Gn)})}const rr=function(N){let X=null;if(Qt(se.beforeSanitizeElements,N,null),Pa(N))return Tt(N),!0;const J=nt(N.nodeName);if(Qt(se.uponSanitizeElement,N,{tagName:J,allowedTags:k}),kt&&N.hasChildNodes()&&!Lr(N.firstElementChild)&&Ht(/<[/\w!]/g,N.innerHTML)&&Ht(/<[/\w!]/g,N.textContent)||N.nodeType===Ps.progressingInstruction||kt&&N.nodeType===Ps.comment&&Ht(/<[/\w]/g,N.data))return Tt(N),!0;if(!k[J]||ue[J]){if(!ue[J]&&Br(J)&&(re.tagNameCheck instanceof RegExp&&Ht(re.tagNameCheck,J)||re.tagNameCheck instanceof Function&&re.tagNameCheck(J)))return!1;if(Fa&&!fn[J]){const Fe=S(N)||N.parentNode,ht=C(N)||N.childNodes;if(ht&&Fe){const We=ht.length;for(let Dt=We-1;Dt>=0;--Dt){const Vt=F(ht[Dt],!0);Vt.__removalCount=(N.__removalCount||0)+1,Fe.insertBefore(Vt,_(N))}}}return Tt(N),!0}return N instanceof m&&!Mt(N)||(J==="noscript"||J==="noembed"||J==="noframes")&&Ht(/<\/no(script|embed|frames)/i,N.innerHTML)?(Tt(N),!0):(Ze&&N.nodeType===Ps.text&&(X=N.textContent,Io([me,ce,Pe],Fe=>{X=qs(X,Fe," ")}),N.textContent!==X&&(ks(r.removed,{element:N.cloneNode()}),N.textContent=X)),Qt(se.afterSanitizeElements,N,null),!1)},ar=function(N,X,J){if(Bi&&(X==="id"||X==="name")&&(J in i||J in ji))return!1;if(!(Et&&!$e[X]&&Ht(be,X))){if(!(Ue&&Ht(z,X))){if(!Y[X]||$e[X]){if(!(Br(N)&&(re.tagNameCheck instanceof RegExp&&Ht(re.tagNameCheck,N)||re.tagNameCheck instanceof Function&&re.tagNameCheck(N))&&(re.attributeNameCheck instanceof RegExp&&Ht(re.attributeNameCheck,X)||re.attributeNameCheck instanceof Function&&re.attributeNameCheck(X))||X==="is"&&re.allowCustomizedBuiltInElements&&(re.tagNameCheck instanceof RegExp&&Ht(re.tagNameCheck,J)||re.tagNameCheck instanceof Function&&re.tagNameCheck(J))))return!1}else if(!Ui[X]){if(!Ht(O,qs(J,ee,""))){if(!((X==="src"||X==="xlink:href"||X==="href")&&N!=="script"&&A3(J,"data:")===0&&On[N])){if(!(zn&&!Ht(K,qs(J,ee,"")))){if(J)return!1}}}}}}return!0},Br=function(N){return N!=="annotation-xml"&&zv(N,Ae)},ir=function(N){Qt(se.beforeSanitizeAttributes,N,null);const{attributes:X}=N;if(!X||Pa(N))return;const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let Fe=X.length;for(;Fe--;){const ht=X[Fe],{name:We,namespaceURI:Dt,value:Vt}=ht,qn=nt(We),Kt=Vt;let lt=We==="value"?Kt:x3(Kt);if(J.attrName=qn,J.attrValue=lt,J.keepAttr=!0,J.forceKeepAttr=void 0,Qt(se.uponSanitizeAttribute,N,J),lt=J.attrValue,ca&&(qn==="id"||qn==="name")&&(kn(We,N),lt=Tu+lt),kt&&Ht(/((--!?|])>)|<\/(style|title)/i,lt)){kn(We,N);continue}if(J.forceKeepAttr)continue;if(!J.keepAttr){kn(We,N);continue}if(!Nr&&Ht(/\/>/i,lt)){kn(We,N);continue}Ze&&Io([me,ce,Pe],sr=>{lt=qs(lt,sr," ")});const Gi=nt(N.nodeName);if(!ar(Gi,qn,lt)){kn(We,N);continue}if(I&&typeof U=="object"&&typeof U.getAttributeType=="function"&&!Dt)switch(U.getAttributeType(Gi,qn)){case"TrustedHTML":{lt=I.createHTML(lt);break}case"TrustedScriptURL":{lt=I.createScriptURL(lt);break}}if(lt!==Kt)try{Dt?N.setAttributeNS(Dt,We,lt):N.setAttribute(We,lt),Pa(N)?Tt(N):Iv(r.removed)}catch{kn(We,N)}}Qt(se.afterSanitizeAttributes,N,null)},st=function le(N){let X=null;const J=sl(N);for(Qt(se.beforeSanitizeShadowDOM,N,null);X=J.nextNode();)Qt(se.uponSanitizeShadowNode,X,null),rr(X),ir(X),X.content instanceof c&&le(X.content);Qt(se.afterSanitizeShadowDOM,N,null)};return r.sanitize=function(le){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=null,J=null,Fe=null,ht=null;if(Dr=!le,Dr&&(le="<!-->"),typeof le!="string"&&!Lr(le))if(typeof le.toString=="function"){if(le=le.toString(),typeof le!="string")throw Fs("dirty is not a string, aborting")}else throw Fs("toString is not a function");if(!r.isSupported)return le;if(Di||zi(N),r.removed=[],typeof le=="string"&&(fa=!1),fa){if(le.nodeName){const Vt=nt(le.nodeName);if(!k[Vt]||ue[Vt])throw Fs("root node is forbidden and cannot be sanitized in-place")}}else if(le instanceof h)X=il("<!---->"),J=X.ownerDocument.importNode(le,!0),J.nodeType===Ps.element&&J.nodeName==="BODY"||J.nodeName==="HTML"?X=J:X.appendChild(J);else{if(!St&&!Ze&&!xn&&le.indexOf("<")===-1)return I&&ua?I.createHTML(le):le;if(X=il(le),!X)return St?null:ua?x:""}X&&Li&&Tt(X.firstChild);const We=sl(fa?le:X);for(;Fe=We.nextNode();)rr(Fe),ir(Fe),Fe.content instanceof c&&st(Fe.content);if(fa)return le;if(St){if(qa)for(ht=ae.call(X.ownerDocument);X.firstChild;)ht.appendChild(X.firstChild);else ht=X;return(Y.shadowroot||Y.shadowrootmode)&&(ht=Ee.call(s,ht,!0)),ht}let Dt=xn?X.outerHTML:X.innerHTML;return xn&&k["!doctype"]&&X.ownerDocument&&X.ownerDocument.doctype&&X.ownerDocument.doctype.name&&Ht(i_,X.ownerDocument.doctype.name)&&(Dt="<!DOCTYPE "+X.ownerDocument.doctype.name+`>
110
+ `).map((u,c)=>v.jsxs("span",{className:Rv.text,children:[u,v.jsx("br",{})]},c))]})},t6=({text:t,commands:r,sources:i,onLinkClick:s})=>v.jsxs("div",{className:ye.bubbleContent,children:[v.jsx(e6,{text:t,commands:r}),v.jsx(Xh,{sources:i,onLinkClick:s})]}),n6=H.forwardRef(({message:t,commands:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:u,onReaction:c,onButtonClick:d,onLinkClick:h},m)=>{const p=r6(t._id,t,r,d,h);switch(t.sender.type){case Te.UserType.GUEST:return v.jsx(Xw,{ref:m,isFirstMessageBySender:s,isLastMessageBySender:u,children:p});default:{const y=E=>c(t._id,E);return v.jsx(Fb,{ref:m,message:t,isAnimated:!1,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:u,onReaction:y,children:p})}}}),r6=(t,r,i,s,u)=>{switch(r.type){case Te.MessageTypeEnum.TEXT:{const c=r;return v.jsx(t6,{text:c.text,commands:i,sources:r.sources||[],onLinkClick:u})}case Te.MessageTypeEnum.DETAIL:{const c=r;return v.jsx(Yw,{title:c.title,text:c.text,imageUrl:c.imageUrl,itemUrl:c.itemUrl,buttons:c.buttons,sources:r.sources||[],onButtonClick:s,onLinkClick:u})}case Te.MessageTypeEnum.MARKDOWN:{const c=r;return v.jsx(Kw,{actionId:t,markdown:c.markdown,sources:c.sources||[],onLinkClick:u})}}},a6=(t,r)=>t.message._id===r.message._id&&t.message.reaction===r.message.reaction&&t.isLastMessage===r.isLastMessage&&t.isFirstMessageBySender===r.isFirstMessageBySender&&t.isLastMessageBySender===r.isLastMessageBySender,i6=v1.memo(n6,a6),s6="_ticontainer_xg0dn_1",l6="_tiblock_xg0dn_5",o6="_tidot_xg0dn_12",Gs={ticontainer:s6,tiblock:l6,tidot:o6},u6=({isTyping:t=!1})=>v.jsx("div",{className:Gs.ticontainer,children:v.jsx("div",{className:Gs.tiblock,children:t?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:Q(Gs.tidot,"chat__typingIndicator")}),v.jsx("div",{className:Q(Gs.tidot,"chat__typingIndicator")}),v.jsx("div",{className:Q(Gs.tidot,"chat__typingIndicator")})]}):null})}),c6=Object.assign({_id:"typing-indicator"},new Te.TextMessage("",new Te.BotUser)),f6=({messages:t,isBotTyping:r,commands:i,onTranscriptItemReaction:s,onButtonClick:u,onLinkClick:c})=>{const d=H.useRef(0),h=H.useRef(!0),m=H.useRef(null),p=H.useRef(null),y=H.useRef(null),E=it(R=>R.settings.enableGeneralConditions);H.useLayoutEffect(()=>{if(t.length&&m.current&&(d.current<t.length||r)){if(p.current){const R=p.current.offsetTop;m.current.scrollTop=R}else if(y.current){const R=y.current.offsetTop;m.current.scrollTop=R}h.current&&(h.current=!1),d.current=t.length}},[t,h,r]);let A;const U=t.length;return v.jsxs("div",{ref:m,className:Q(fv.messageContainer,"chat__messageContainer"),style:{scrollBehavior:t.length&&h.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[E&&v.jsx(tw,{}),v.jsxs("ul",{className:fv.messages,children:[t.map((R,F)=>{const G=d6(R,A),_=h6(R,F,t,r);A=R.sender.type;const C=F+1===U,S=R._id||`added-${F}`;return v.jsx(i6,{ref:C?y:null,message:R,commands:i,isLastMessage:C,isFirstMessageBySender:G,isLastMessageBySender:_,onButtonClick:u,onLinkClick:c,onReaction:s},C&&!r?"last":S)}),r&&v.jsx(Fb,{ref:p,message:c6,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:A!==Te.UserType.BOT,isLastMessageBySender:!0,children:v.jsx(u6,{isTyping:!0})},"last")]})]})},d6=(t,r)=>!r||r!==t.sender.type,h6=(t,r,i,s)=>{const u=t.sender.type,c=i.length;return r+1===c?!(u===Te.UserType.BOT&&s):u!==i.at(r+1)?.sender.type},m6="_bottomSheet_jp8dl_1",p6="_bottomSheetOpen_jp8dl_15",g6="_bottomSheetClose_jp8dl_20",Or={bottomSheet:m6,bottomSheetOpen:p6,bottomSheetClose:g6},y6="_container_xc2nx_1",wv={container:y6},v6=({contentUrl:t})=>{const r=it(c=>c.connection.sessionId),[i,s]=H.useState(!1);H.useEffect(()=>{s(c=>c||!!t)},[t]);const u=H.useMemo(()=>{if(t&&r){const c=new URL(t,document.baseURI);return c.searchParams.set("sessionId",r),c.toString()}else return},[t,r]);return v.jsx("div",{className:Q(wv.container,Or.bottomSheet,{[Or.bottomSheetOpen]:!!t,[Or.bottomSheetClose]:i&&!t}),children:u&&v.jsx("iframe",{title:"Drawer",src:u,className:wv.iframe})})},b6="_container_z787n_1",_6={container:b6},E6=({title:t,href:r,children:i})=>v.jsx("a",{href:r,title:t,target:"_blank",rel:"noopener noreferrer",children:i}),S6=()=>{const r=tt()("powered-by");return r&&r.length?v.jsx("div",{className:Q(_6.container,"chat__poweredBy"),children:v.jsx(xr,{options:{overrides:{a:E6}},children:r})}):null},$b=({className:t,children:r,...i})=>v.jsx(bu,{className:Q(Js.buttonDefault,t),type:"button",...i,children:r}),au=({className:t,children:r,...i})=>v.jsx(bu,{className:Q(Js.buttonPrimary,t),...i,children:r}),T6="_container_h23mk_1",A6="_formContainer_h23mk_17",x6="_emailInput_h23mk_22",O6="_description_h23mk_52",R6="_actions_h23mk_57",w6="_validationError_h23mk_67",C6="_submitted_h23mk_74",La={container:T6,formContainer:A6,emailInput:x6,description:O6,actions:R6,validationError:w6,submitted:C6},N6=({visible:t,onEmailExport:r,onClose:i})=>{const s=tt(),[u,c]=H.useState(void 0),[d,h]=H.useState(!1),[m,p]=H.useState(void 0),y=H.useRef(null);H.useEffect(()=>{t?(y.current?.focus(),h(!1),c(t)):u===!0&&c(!1)},[t,u]);const E=U=>{U.preventDefault(),m&&m.length>0&&(r(m),h(!0),setTimeout(i,3*1e3))},A=U=>{const R=U.target.value.trim(),F=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(R);p(F?R:"")};return v.jsxs("div",{className:Q(La.container,Or.bottomSheet,{[Or.bottomSheetOpen]:u===!0,[Or.bottomSheetClose]:u===!1}),children:[v.jsx("h2",{children:s("export-transcript.email.title")}),v.jsx(xr,{className:La.description,children:s("export-transcript.email.description")||""}),v.jsxs("form",{onSubmit:E,className:La.formContainer,children:[v.jsxs("div",{children:[v.jsx("input",{disabled:d,ref:y,type:"email",placeholder:s("export-transcript.email.placeholder"),className:La.emailInput,onChange:A}),m?.length===0?v.jsx("div",{className:La.validationError,children:s("export-transcript.email.invalid")}):null]}),v.jsxs("div",{className:La.actions,children:[v.jsx($b,{onClick:i,children:s("export-transcript.email.cancel")}),v.jsx(au,{type:"submit",disabled:d||m===void 0||m.length===0,children:s("export-transcript.email.send")})]})]}),d&&v.jsx("div",{className:La.submitted,children:s("export-transcript.email.success")})]})},M6="_inputContainer_fi5ao_1",D6={inputContainer:M6},L6="_blockUserInput_pot9c_1",B6={blockUserInput:L6},U6=({visible:t})=>{const r=tt();return t?v.jsx("div",{className:Q(B6.blockUserInput,"chat__blockUserInput"),children:r("block-user-input.title")}):null},H6="_commandsDropdown_5ytuv_1",j6="_commands_5ytuv_1",I6="_command_5ytuv_1",z6="_commandActive_5ytuv_46",G6="_commandsSelections_5ytuv_55",Zs={commandsDropdown:H6,commands:j6,command:I6,commandActive:z6,commandsSelections:G6},Wb=(t,r)=>{H.useEffect(()=>{const i=s=>{t.current&&!t.current.contains(s.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[t,r])},k6=(t,r,i,s,u)=>{H.useEffect(()=>{const c=d=>{if(t.length)switch(d.key){case"Enter":i(t[r]);break;case"ArrowUp":s(h=>h>0?h-1:t.length-1);break;case"ArrowDown":s(h=>h<t.length-1?h+1:0);break;case"Escape":u([]);break}};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[t,r,i,s,u])},q6=({text:t,commands:r,onSelectCommand:i,onVisibilityChange:s})=>{const u=H.useRef(null),c=tt(),[d,h]=H.useState([]),[m,p]=H.useState(Cv(r)),[y,E]=H.useState(0),A=U=>i(`/${U}`);return Wb(u,()=>h([])),k6(d,y,A,E,h),H.useEffect(()=>{p(Cv(r))},[r]),H.useEffect(()=>{const U=t.length||0;U===0||U>m||!t.startsWith("/")?h([]):h(r.filter(F6(t))),E(0)},[r,t,m]),H.useEffect(()=>{s(!!d.length)},[d,s]),d.length?v.jsx("div",{ref:u,className:Zs.commandsDropdown,children:v.jsx("ul",{id:"command-list",className:Zs.commands,role:"listbox",children:d.map((U,R)=>v.jsxs("li",{className:Q([Zs.command,y===R&&Zs.commandActive]),role:"option",onClick:()=>A(U),onMouseOver:()=>E(R),children:[v.jsxs("h1",{children:["/",U]}),v.jsx("p",{children:c(`commands.${U}`)})]},U))})}):null},Cv=t=>Math.max(...t.map(r=>r.length+1)),F6=t=>r=>{const i=`/${r}`;return i.startsWith(t)&&i.length>=t.length},Nv=3,V6=({commands:t,onSelectCommand:r})=>{const i=tt(),[s,u]=H.useState(!1),c=p=>()=>{r(`/${p}`),u(!1)},d=()=>{u(!0)},h=()=>{u(!1)},m=s?t:t.slice(0,Nv);return v.jsxs("div",{className:Zs.commandsSelections,children:[m.map(p=>v.jsxs("button",{className:"tooltip--top-center","aria-label":i(`commands.${p}`),"data-title":i(`commands.${p}`),tabIndex:0,onClick:c(p),children:["/",p]},p)),m.length<t.length?v.jsx("button",{"aria-label":i("commands.show-more.tooltip"),"data-title":i("commands.show-more.tooltip"),tabIndex:0,onClick:d,children:i("commands.show-more.action")},"show-more"):m.length>Nv?v.jsx("button",{"aria-label":i("commands.show-less.tooltip"),"data-title":i("commands.show-less.tooltip"),tabIndex:0,onClick:h,children:i("commands.show-less.action")},"show-less"):null]})},P6="_callToActionContainer_d8izj_1",Y6="_callToActionTitle_d8izj_23",X6="_rateOverlay_d8izj_30",Z6="_body_d8izj_52",Q6="_footer_d8izj_60",K6="_actions_d8izj_75",$6="_bubbles_d8izj_89",W6="_stars_d8izj_191",J6="_starsSmall_d8izj_205",eC="_starsLarge_d8izj_211",tC="_star_d8izj_191",nC="_starReadonly_d8izj_225",rC="_starIcon_d8izj_235",aC="_starsDescriptionContainer_d8izj_253",iC="_starsDescription_d8izj_253",It={callToActionContainer:P6,callToActionTitle:Y6,rateOverlay:X6,body:Z6,footer:Q6,actions:K6,bubbles:$6,stars:W6,starsSmall:J6,starsLarge:eC,star:tC,starReadonly:nC,starIcon:rC,starsDescriptionContainer:aC,starsDescription:iC},sC=({value:t,index:r,count:i,readonly:s,onHover:u,onClick:c})=>{const d=h=>{c&&h.key==="Enter"&&c()};return v.jsx("li",{className:Q(It.star,{[It.starReadonly]:s},"chat__conversationRating__star"),children:v.jsx("div",{role:"radio","aria-checked":t>r?"true":"false","aria-posinset":r+1,"aria-setsize":i,tabIndex:0,onMouseOver:u,onKeyDown:d,onClick:c,children:v.jsx("span",{role:"img","aria-label":"Star",className:Q(It.starIcon),children:v.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:v.jsx("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"})})})})})},Mv=5,Jb=({value:t,size:r,readonly:i=!1,onChange:s})=>{const[u,c]=H.useState(void 0),d=()=>{c(void 0)},h=p=>()=>{if(!i){const y=p+1;c(y)}},m=p=>()=>{s&&!i&&(s(p===0&&t===1?0:p+1),c(void 0))};return v.jsx("ul",{tabIndex:0,role:"radiogroup",className:Q(It.stars,{[It.starsSmall]:r==="small",[It.starsLarge]:r==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:r==="small",chat__conversationRating__stars__large:r==="large"}),onMouseOut:d,children:Array(Mv).fill(0).map((p,y)=>v.jsx(sC,{value:u===void 0?t:u,index:y,count:Mv,readonly:i,onHover:h(y),onClick:m(y)},y))})},lC=({visible:t,onRate:r})=>{const i=tt();return t?v.jsxs("div",{className:Q(It.callToActionContainer,"chat__conversationRating__callToAction"),children:[v.jsx("div",{className:Q(It.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),v.jsx(Jb,{value:0,size:"small",onChange:r})]}):null},gd=({isFirstMessageBySender:t,isLastMessageBySender:r,children:i})=>v.jsxs("div",{className:Q(ye.message,ye.messageBot,t&&ye.messageBotFirst,r&&ye.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",t&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:[v.jsx("img",{className:Q(ye.avatar,ye.botAvatar),src:"bot.svg",alt:"Bot"}),v.jsx("div",{className:Q(ye.bubble,ye.bubbleLeft,"chat__bubble","chat__botBubble"),children:v.jsx("div",{className:Q(ye.leftText,ye.bubbleContent),children:i})})]}),oC=({children:t})=>v.jsx("div",{className:Q(ye.message,ye.messageGuest,ye.messageGuestFirst,ye.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:v.jsx("div",{className:Q(ye.bubble,ye.bubbleRight,"chat__bubble","chat__guestBubble"),children:v.jsx("div",{className:Q(ye.rightText,ye.bubbleContent),children:t})})}),uC=()=>{const t=tt(),r=Cr(),i=it(G=>G.chat.conversationRating),[s,u]=H.useState(i.rating?.value||0),[c,d]=H.useState(void 0),[h,m]=H.useState(void 0),[p,y]=H.useState({submitted:!1,feedback:""}),[E,A]=H.useState(!1),U=H.useRef(null);H.useEffect(()=>{i.opener?(y({submitted:!1,feedback:""}),m(!0)):h===!0&&m(!1)},[i.opener,h]),H.useEffect(()=>{u(i.rating?.value||0)},[i.rating?.value,i.opener]),H.useEffect(()=>{U.current&&(U.current.value=i.rating?.feedback||"")},[i.rating?.feedback]),H.useEffect(()=>{const G=s>0?t(`conversation-rating.overlay.bot-message.rate-feedback.value-${s}`):void 0;d(G?.length?G:void 0)},[s,t]),H.useEffect(()=>{p.submitted?setTimeout(()=>A(!0),p.feedback.length?500:0):A(!1)},[p]);const R=G=>{G.preventDefault();const _=U.current?.value?.trim()||"";r(Ox(s,_)),y({submitted:!0,feedback:_})},F=()=>{i.opener==="CLOSE_CHAT"?r(Db()):r(TO())};return v.jsx("div",{className:Q(It.rateOverlay,Or.bottomSheet,"chat__conversationRating__overlay",{[Or.bottomSheetOpen]:h===!0,[Or.bottomSheetClose]:h===!1}),children:v.jsxs("form",{onSubmit:R,children:[v.jsxs("div",{className:Q(It.body,"chat__conversationRating__overlay__body"),children:[v.jsx("div",{}),v.jsx("div",{className:Q(It.bubbles),children:i.opener&&v.jsxs(v.Fragment,{children:[v.jsxs(gd,{isFirstMessageBySender:!0,isLastMessageBySender:!c,children:[v.jsx("h2",{children:t("conversation-rating.overlay.title")}),v.jsxs("div",{className:Q(It.starsDescriptionContainer),children:[v.jsx(Jb,{value:s,size:"large",readonly:p.submitted,onChange:u}),v.jsxs("div",{className:Q(It.starsDescription),children:[v.jsx("div",{children:t("conversation-rating.overlay.star.very-bad")}),v.jsx("div",{children:t("conversation-rating.overlay.star.very-good")})]})]})]}),c&&v.jsx(gd,{isFirstMessageBySender:!1,isLastMessageBySender:!E||!!p.feedback.length,children:v.jsx("div",{children:c})}),!!p.feedback.length&&v.jsx(oC,{children:p.feedback}),E&&v.jsx(gd,{isFirstMessageBySender:!!p.feedback.length,isLastMessageBySender:!0,children:v.jsx("div",{children:t("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),v.jsxs("div",{className:Q(It.footer,"chat__conversationRating__overlay__footer"),children:[!p.submitted&&v.jsx("input",{ref:U,defaultValue:i.rating?.feedback||"",placeholder:t("conversation-rating.overlay.guest-feedback.input-placeholder")}),v.jsxs("div",{className:Q(It.actions,"chat__conversationRating__overlay__footer__actions"),children:[p.submitted?v.jsx(au,{type:"button",disabled:!s,onClick:F,children:i.opener==="CLOSE_CHAT"?t("conversation-rating.overlay.action.close-chat"):t("conversation-rating.overlay.action.back-to-chat")},"close-button"):v.jsx(au,{type:"submit",disabled:!s,children:t("conversation-rating.overlay.action.submit")},"submit-button"),i.opener!=="CHAT"&&!p.submitted&&v.jsx($b,{onClick:F,children:i.opener==="CLOSE_CHAT"?t("conversation-rating.overlay.action.close-chat"):t("conversation-rating.overlay.action.cancel")})]})]})]})})},cC=({numberOfMessagesFromGuest:t})=>{const r=Cr(),i=it(c=>c.chat.conversationRating),s=c=>{r(Ih("CHAT",c))},u=!i.rating?.value&&t>=1;return i.enabled?v.jsxs(v.Fragment,{children:[v.jsx(lC,{visible:u,onRate:s}),v.jsx(uC,{})]}):null},fC=H.memo(cC),dC="_inputWrapper_e3h44_1",hC="_withOpenCommands_e3h44_14",mC="_messageInputWrapper_e3h44_20",pC="_messageInput_e3h44_20",gC="_buttons_e3h44_44",yC="_button_e3h44_44",xi={inputWrapper:dC,withOpenCommands:hC,messageInputWrapper:mC,messageInput:pC,buttons:gC,button:yC},vC="_audioRecorder_g845f_1",bC="_audioButton_g845f_6",_C="_recorderIcon_g845f_37",EC="_spinning_g845f_60",Ba={audioRecorder:vC,audioButton:bC,recorderIcon:_C,spinning:EC},Dv=2048,iu=16e3;class SC extends v1.Component{audioInput=null;volume=null;leftchannel=[];recorder=null;recordingLength=0;sampleRate=null;mediaStream=null;constructor(r){super(r),this.state={recordingState:"none"},this.triggerAudioRecording=this.triggerAudioRecording.bind(this),this.triggerAudioRecordingSuccess=this.triggerAudioRecordingSuccess.bind(this),this.initRecording=this.initRecording.bind(this),this.processRecordingInput=this.processRecordingInput.bind(this),this.handleClickSubmitAudio=this.handleClickSubmitAudio.bind(this),this.handleClickStopAudio=this.handleClickStopAudio.bind(this)}triggerAudioRecording(){this.setState({recordingState:"connecting"}),navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(this.triggerAudioRecordingSuccess)}triggerAudioRecordingSuccess(r){this.mediaStream=r,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(r)}initRecording(r){const i=window.AudioContext||window.webkitAudioContext,s=new i;this.sampleRate=s.sampleRate,this.volume=s.createGain(),this.audioInput=s.createMediaStreamSource(r),this.audioInput.connect(this.volume),this.recorder=s.createScriptProcessor(Dv,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(s.destination)}processRecordingInput(r){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const i=r.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(i)),this.recordingLength+=Dv}}handleClickSubmitAudio(){const r=AC(this.leftchannel,this.recordingLength),i=xC(r,this.sampleRate||0),s=TC(i);this.props.onAudioRecorded(s),this.handleClickStopAudio()}handleClickStopAudio(){this.setState({recordingState:"none"}),this.audioInput?.disconnect(),this.volume?.disconnect(),this.recorder?.disconnect(),this.mediaStream&&this.mediaStream?.getAudioTracks().forEach(r=>{r.stop()})}render(){return v.jsxs("div",{className:Ba.audioRecorder,children:[this.state.recordingState==="none"&&v.jsx("button",{className:Q(Ba.audioButton,"chat__button"),type:"submit","aria-label":this.props.translate("message-input.actions.start-audio-recording.label"),"data-title":this.props.translate("message-input.actions.start-audio-recording.label"),tabIndex:0,onClick:this.triggerAudioRecording,children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z"}),v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&v.jsxs("svg",{className:Ba.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&v.jsxs("div",{className:Ba.audioRecorder,children:[v.jsx("button",{className:Q(Ba.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),v.jsx("div",{className:Ba.recorderIcon}),v.jsx("button",{className:Q(Ba.audioButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),v.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const TC=t=>{const r=new ArrayBuffer(44+t.length*2),i=new DataView(r);jo(i,0,"RIFF"),i.setUint32(4,44+t.length*2,!0),jo(i,8,"WAVE"),jo(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,iu,!0),i.setUint32(28,iu*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),jo(i,36,"data"),i.setUint32(40,t.length*2,!0);const s=t.length;let u=44;const c=1;for(let d=0;d<s;d++)i.setInt16(u,t[d]*(32767*c),!0),u+=2;return new Blob([i],{type:"audio/wav"})},jo=(t,r,i)=>{for(let s=0;s<i.length;s++)t.setUint8(r+s,i.charCodeAt(s))},AC=(t,r)=>{const i=new Float32Array(r);let s=0;const u=t.length;for(let c=0;c<u;c++){const d=t[c];i.set(d,s),s+=d.length}return i},xC=(t,r)=>{if(iu===r)return t;const i=r/iu,s=Math.round(t.length/i),u=new Float32Array(s);let c=0,d=0;for(;c<u.length;){const h=Math.round((c+1)*i);let m=0,p=0;for(let y=d;y<h&&y<t.length;y++)m+=t[y],p++;u[c]=m/p,c++,d=h}return u},OC=({disabled:t,textInput:r,commandsVisible:i,hasCommands:s,onTextInput:u,onTextInputSubmit:c,onAudioRecorded:d})=>{const h=tt(),m=H.useRef(null),{enableSpeechSupport:p}=it(R=>R.settings);H.useEffect(()=>{m.current?.focus()},[r]);const y=()=>{const R=m.current;R&&r.trim().length>=1&&c(r.trim())&&(R.value="",R.style.height="",R.focus())},E=R=>{R.preventDefault(),y()},A=R=>{const F=R.target.value;u(F),R.target.style.height="";const{scrollHeight:G}=R.target;R.target.style.height=`${G>150?150:G}px`},U=R=>{R.code==="Enter"&&!R.shiftKey?(R.repeat||y(),R.preventDefault()):i&&(R.code==="ArrowUp"||R.code==="ArrowDown")&&R.preventDefault()};return v.jsxs("form",{className:Q(xi.inputWrapper,i&&xi.withOpenCommands,"chat__textInput"),onSubmit:E,children:[v.jsx("div",{className:xi.messageInputWrapper,children:v.jsx("textarea",{id:"user_input",ref:m,className:xi.messageInput,tabIndex:0,placeholder:h("message-input-placeholder"),value:r,onChange:A,onKeyDown:U,"aria-label":h("message-input-label"),"aria-controls":s?"command-list":void 0,"aria-haspopup":s?"listbox":void 0})}),v.jsx("div",{className:Q(xi.buttons,"chat__buttons"),children:r.length||!p||navigator.mediaDevices===void 0?v.jsx("button",{className:Q(xi.button,"chat__button"),type:"submit","aria-label":h("message-input.actions.submit.label"),"data-title":h("message-input.actions.submit.label"),tabIndex:0,disabled:t,children:v.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:v.jsx("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})})}):p&&navigator.mediaDevices!==void 0&&v.jsx(SC,{translate:h,onAudioRecorded:d})})]})},RC="_quickReplies_83npe_1",wC="_quickReply_83npe_9",Lv={quickReplies:RC,quickReply:wC},CC=({quickReplies:t,onQuickReplyClick:r})=>t.length?v.jsx("div",{className:Q(Lv.quickReplies,"chat__quickReplies"),children:t.map(i=>v.jsx(bu,{tabIndex:0,className:Q(Lv.quickReply,"chat__button","chat__quickReply"),onClick:()=>r(i),children:i.label},i.label))}):null,Bv=5e3,NC=1e3,MC=({isBotTyping:t,quickReplies:r,numberOfMessagesFromGuest:i,commands:s,onTextInput:u,onQuickReplyClick:c,onAudioRecorded:d})=>{const[h,m]=H.useState(""),[p,y]=H.useState(!1),[E,A]=H.useState(!1),U=H.useRef(0),R=H.useRef(0);H.useEffect(()=>{if(p&&!t){const _=U.current?Date.now()-U.current:0;_>Bv?y(!1):setTimeout(()=>{y(!1)},Bv-_)}},[p,t]),H.useEffect(()=>{p&&(U.current=Date.now())},[p]);const F=_=>{const C=Date.now()-R.current<NC;return E?!1:t||C?(y(!0),!1):(u(_),m(""),R.current=Date.now(),!0)},G=_=>{m(_+" ")};return v.jsxs("div",{className:Q(D6.inputContainer),children:[v.jsx(CC,{quickReplies:r,onQuickReplyClick:c}),v.jsx(U6,{visible:p}),!p&&v.jsx(fC,{numberOfMessagesFromGuest:i}),!!s?.length&&v.jsx(q6,{text:h,commands:s,onSelectCommand:G,onVisibilityChange:A}),v.jsx(OC,{textInput:h,disabled:p,commandsVisible:E,hasCommands:!!s?.length,onTextInput:m,onTextInputSubmit:F,onAudioRecorded:d}),!!s?.length&&v.jsx(V6,{commands:s,onSelectCommand:m})]})},DC=({clientName:t,messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u,onMessageFromUser:c,onQuickReplyClick:d,onButtonClick:h,onLinkClick:m,onAudioRecorded:p,onTranscriptExport:y,onTranscriptItemReaction:E})=>{const A=Cr(),U=it(I=>I.connection.connectionState),{enableTranscriptExportEmail:R,commands:F}=it(I=>I.settings),{showTranscriptMailOverlay:G,conversationRating:_}=it(I=>I.chat),C=r.filter(I=>I.sender.type===ru.GUEST).length;H.useEffect(()=>{if(U===Ia.CONNECTED){const I=uu.parse(window.location.search);A(Bb(t,I))}},[t,U,A]);const S=()=>{A(Lb())};return v.jsxs("div",{className:od.container,children:[v.jsxs("div",{className:Q([od.chatcontent,(G||_?.opener)&&od.accessabilityHidden]),children:[v.jsx(f6,{messages:r,isBotTyping:s,commands:F,onButtonClick:h,onLinkClick:m,onTranscriptItemReaction:E}),v.jsx(MC,{isBotTyping:s,quickReplies:s?[]:i,numberOfMessagesFromGuest:C,commands:F,onQuickReplyClick:d,onTextInput:c,onAudioRecorded:p}),v.jsx(S6,{})]}),R&&v.jsx(N6,{visible:!!G,onEmailExport:y,onClose:S}),v.jsx(v6,{contentUrl:u})]})},LC=t=>{const{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u}=t.chat;return{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u}},BC=t=>({onRestartChat:(r,i)=>t(gu(r,i)),onMessageFromUser:r=>t(lb(r)),onAudioRecorded:r=>t(Ex(r)),onActionFromUser:r=>t(r),onQuickReplyClick:r=>t(sb(r)),onNluEvent:r=>t(db(r)),onButtonClick:r=>t(wx(r)),onLinkClick:r=>t(hb(r)),onTranscriptExport:r=>t(Tx(r)),onTranscriptItemReaction:(r,i)=>t(Te.Actions.transcriptItemGuestReaction(r,i||null))}),UC=qS(LC,BC)(DC),e_=()=>{const[t,r]=H.useState(!1);return H.useEffect(()=>{r((()=>{try{return window.self!==window.top}catch{return!0}})())},[]),t},HC=t=>r=>{const i=r.key;(i==="ArrowDown"||i==="ArrowRight"||i==="Enter"||i===" "||i==="Space")&&(r.stopPropagation(),t())},jC=({onClick:t})=>{const r=tt();return e_()?v.jsx("button",{className:"tooltip--bottom-left","aria-label":r("header.close-chat"),"data-title":r("header.close-chat"),tabIndex:0,onClick:t,onKeyDown:HC(t),children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"})})}):null},IC="_header_3gvbz_1",zC="_logoContainer_3gvbz_14",GC="_logo_3gvbz_14",kC="_actions_3gvbz_28",qC="_active_3gvbz_43",FC="_menuContainer_3gvbz_56",VC="_menu_3gvbz_56",PC="_divider_3gvbz_86",sa={header:IC,logoContainer:zC,logo:GC,actions:kC,active:qC,menuContainer:FC,menu:VC,divider:PC},YC=({icon:t})=>{switch(t){case"arrow-counter-clockwise":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"})});case"download":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"})});case"expand":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"})});case"mail":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"})});case"phone":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M144.27,45.93a8,8,0,0,1,9.8-5.66,86.22,86.22,0,0,1,61.66,61.66,8,8,0,0,1-5.66,9.8A8.23,8.23,0,0,1,208,112a8,8,0,0,1-7.73-5.94,70.35,70.35,0,0,0-50.33-50.33A8,8,0,0,1,144.27,45.93Zm-2.33,41.8c13.79,3.68,22.65,12.54,26.33,26.33A8,8,0,0,0,176,120a8.23,8.23,0,0,0,2.07-.27,8,8,0,0,0,5.66-9.8c-5.12-19.16-18.5-32.54-37.66-37.66a8,8,0,1,0-4.13,15.46Zm81.94,95.35A56.26,56.26,0,0,1,168,232C88.6,232,24,167.4,24,88A56.26,56.26,0,0,1,72.92,32.12a16,16,0,0,1,16.62,9.52l21.12,47.15,0,.12A16,16,0,0,1,109.39,104c-.18.27-.37.52-.57.77L88,129.45c7.49,15.22,23.41,31,38.83,38.51l24.34-20.71a8.12,8.12,0,0,1,.75-.56,16,16,0,0,1,15.17-1.4l.13.06,47.11,21.11A16,16,0,0,1,223.88,183.08Zm-15.88-2s-.07,0-.11,0h0l-47-21.05-24.35,20.71a8.44,8.44,0,0,1-.74.56,16,16,0,0,1-15.75,1.14c-18.73-9.05-37.4-27.58-46.46-46.11a16,16,0,0,1,1-15.7,6.13,6.13,0,0,1,.57-.77L96,95.15l-21-47a.61.61,0,0,1,0-.12A40.2,40.2,0,0,0,40,88,128.14,128.14,0,0,0,168,216,40.21,40.21,0,0,0,208,181.07Z"})});case"scroll":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M96,104a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H104A8,8,0,0,1,96,104Zm8,40h64a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16Zm128,48a32,32,0,0,1-32,32H88a32,32,0,0,1-32-32V64a16,16,0,0,0-32,0c0,5.74,4.83,9.62,4.88,9.66h0A8,8,0,0,1,24,88a7.89,7.89,0,0,1-4.79-1.61h0C18.05,85.54,8,77.61,8,64A32,32,0,0,1,40,32H176a32,32,0,0,1,32,32V168h8a8,8,0,0,1,4.8,1.6C222,170.46,232,178.39,232,192ZM96.26,173.48A8.07,8.07,0,0,1,104,168h88V64a16,16,0,0,0-16-16H67.69A31.71,31.71,0,0,1,72,64V192a16,16,0,0,0,32,0c0-5.74-4.83-9.62-4.88-9.66A7.82,7.82,0,0,1,96.26,173.48ZM216,192a12.58,12.58,0,0,0-3.23-8h-94a26.92,26.92,0,0,1,1.21,8,31.82,31.82,0,0,1-4.29,16H200A16,16,0,0,0,216,192Z"})});case"star":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"})});case"link":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"})});default:return v.jsx("div",{})}},XC=H.forwardRef(({selected:t,item:r,onClick:i},s)=>{const u=tt(),c=d=>{d.preventDefault(),i()};return v.jsx("li",{"aria-selected":t,role:"option",className:r.withDivider?sa.divider:void 0,children:v.jsxs("a",{ref:s,type:"button",role:"button",tabIndex:-1,onClick:c,children:[v.jsx(YC,{icon:r.icon}),v.jsx("span",{children:u(`header.menu.${r.id}`)})]})})}),ZC=(t,r)=>{const i=e_(),{menuItems:s,enableStandaloneView:u,enableTranscriptExportPdf:c,enableTranscriptExportEmail:d}=it(p=>p.settings),h=it(p=>p.chat.conversationRating.enabled);return H.useMemo(()=>{const p=[],y=s.filter(({visibility:E})=>t?E==="always"||E==="chat-only":E==="always"||E==="start-screen-only");if(t&&(p.push({id:"restart-chat",type:"restart-chat",icon:"arrow-counter-clockwise",visibility:"chat-only"}),i&&u&&p.push({id:"expand-chat-window",type:"expand-chat-window",icon:"expand",visibility:"always"}),r&&c&&p.push({id:"download-transcript",type:"download-transcript",icon:"download",visibility:"chat-only"}),r&&d&&p.push({id:"send-transcript",type:"send-transcript",icon:"mail",visibility:"chat-only"}),r&&h&&p.push({id:"rate-conversation",type:"rate-conversation",icon:"star",visibility:"chat-only"}),p.length>0&&y.length)){const E=p.pop();E&&s.length&&p.push({...E,withDivider:!0})}return p.push(...y),p},[t,r,c,d,u,h,i,s])},QC=({chatStarted:t,hasGuestMessages:r})=>{const i=Cr(),s=_u(),u=tt(),[c,d]=H.useState(!1),[h,m]=H.useState(-1),p=H.useRef(null),y=H.useRef(null),E=H.useRef([]),A=ZC(t,r);H.useEffect(()=>{E.current[h]?.focus()},[h]);const U=H.useCallback(()=>{const _=uu.parse(window.location.search);i(gu(s,_)),d(!1),m(0)},[i,s]),R=H.useCallback(_=>{switch(_.type){case"restart-chat":U();break;case"expand-chat-window":window.open(window.location.href,"_blank");break;case"download-transcript":i(Ax());break;case"send-transcript":i(Lb());break;case"rate-conversation":i(Ih("MENU"));break;case"link":i(hb(_.url));break;case"action":i(JSON.parse(JSON.stringify(_.action)));break}d(!1)},[i,U,d]);H.useEffect(()=>{const _=C=>{if(c)switch(C.key){case"Enter":C.preventDefault(),R(A[h]);break;case"ArrowUp":m(S=>S>0?S-1:A.length-1);break;case"ArrowDown":m(S=>S<A.length-1?S+1:0);break;case"Escape":d(!1);break;case"Tab":h>-1&&d(!1);break}};return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[c,h,A,m,d,R]),H.useEffect(()=>{c||m(-1)},[c,h]),Wb(y,()=>d(!1));const F=()=>{d(_=>!_)},G=()=>{setTimeout(()=>{const _=document.activeElement;y.current&&!y.current.contains(_)&&d(!1)},0)};return A.length?v.jsxs("div",{className:Q(sa.menuContainer),ref:y,children:[v.jsx("button",{ref:p,className:Q(c&&sa.active,c?"tooltip-hidden":"tooltip--bottom-left"),"aria-label":u("header.menu.title"),"data-title":u("header.menu.title"),onClick:F,onBlur:G,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"})})}),c&&v.jsx("nav",{className:sa.menu,"aria-label":u("header.menu.title"),children:v.jsx("ul",{tabIndex:0,children:A.map((_,C)=>v.jsx(XC,{ref:S=>{E.current[C]=S},selected:h===C,item:_,onClick:()=>R(_)},_.id))})})]}):null},Uv=({className:t,chatStarted:r,...i})=>{const s=Cr(),u=it(h=>h.chat.conversationRating),c=it(h=>h.chat.messages.some(m=>m.sender.type===Te.UserType.GUEST)),d=()=>{u.enabled&&!u.opener&&c?s(Ih("CLOSE_CHAT")):s(Db())};return v.jsxs("div",{className:Q([sa.header,t]),...i,children:[v.jsx("div",{className:sa.logoContainer,children:v.jsx("div",{className:sa.logo})}),v.jsxs("div",{className:sa.actions,children:[v.jsx(QC,{chatStarted:r,hasGuestMessages:c}),v.jsx(jC,{onClick:d})]})]})},KC="_chatwindow_rkbir_1",$C="_chatwindowWithAside_rkbir_21",Hv={chatwindow:KC,chatwindowWithAside:$C},t_=()=>{const[t,r]=H.useState(!1);return H.useEffect(()=>{const i=window.matchMedia("(max-width: 1023px)"),s=()=>r(i.matches);return s(),i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[]),t},WC="_sourceInfos_vei0l_1",JC="_waitForLoading_vei0l_24",e3="_loadingContent_vei0l_28",t3="_sourceHeader_vei0l_37",n3="_sourceHeaderIcon_vei0l_57",r3="_sourceContent_vei0l_61",a3="_openSourceButton_vei0l_69",i3="_sourceButtonLabel_vei0l_79",s3="_closeSourceInfosButton_vei0l_101",l3="_loadingSourceInfos_vei0l_125",o3="_loading_vei0l_28",u3="_loadingError_vei0l_139",c3="_highlightLoadingInfo_vei0l_155",f3="_highlightLoadingInfoInnerContainer_vei0l_169",d3="_highlightLoadingInfoContent_vei0l_178",h3="_highlightLoadingInfoCloseIcon_vei0l_198",m3="_highlightLoader_vei0l_203",p3="_highlightLoaderLoading_vei0l_210",_t={sourceInfos:WC,waitForLoading:JC,loadingContent:e3,sourceHeader:t3,sourceHeaderIcon:n3,sourceContent:r3,openSourceButton:a3,sourceButtonLabel:i3,closeSourceInfosButton:s3,loadingSourceInfos:l3,loading:o3,loadingError:u3,highlightLoadingInfo:c3,highlightLoadingInfoInnerContainer:f3,highlightLoadingInfoContent:d3,highlightLoadingInfoCloseIcon:h3,highlightLoader:m3,highlightLoaderLoading:p3},g3=({onClick:t})=>{const r=tt();return v.jsx("button",{className:Q(_t.closeSourceInfosButton,"tooltip--bottom-left"),"aria-label":r("source-infos.close"),"data-title":r("source-infos.close"),tabIndex:0,onClick:t,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})})},y3=H.forwardRef(({sourceInfos:t,onClose:r,...i},s)=>v.jsxs("div",{className:_t.sourceHeader,...i,ref:s,children:[v.jsx("div",{children:t?v.jsx("p",{id:"source-info-title",children:t.title}):v.jsx("p",{children:" "})}),v.jsx(g3,{onClick:r})]})),v3=({loading:t})=>v.jsx("div",{className:_t.highlightLoader,children:t&&v.jsx("div",{className:_t.highlightLoaderLoading})});/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:n_,setPrototypeOf:jv,isFrozen:b3,getPrototypeOf:_3,getOwnPropertyDescriptor:E3}=Object;let{freeze:zt,seal:Sn,create:r_}=Object,{apply:lh,construct:oh}=typeof Reflect<"u"&&Reflect;zt||(zt=function(r){return r});Sn||(Sn=function(r){return r});lh||(lh=function(r,i,s){return r.apply(i,s)});oh||(oh=function(r,i){return new r(...i)});const Io=Gt(Array.prototype.forEach),S3=Gt(Array.prototype.lastIndexOf),Iv=Gt(Array.prototype.pop),ks=Gt(Array.prototype.push),T3=Gt(Array.prototype.splice),Po=Gt(String.prototype.toLowerCase),yd=Gt(String.prototype.toString),zv=Gt(String.prototype.match),qs=Gt(String.prototype.replace),A3=Gt(String.prototype.indexOf),x3=Gt(String.prototype.trim),Hn=Gt(Object.prototype.hasOwnProperty),Ht=Gt(RegExp.prototype.test),Fs=O3(TypeError);function Gt(t){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var i=arguments.length,s=new Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];return lh(t,r,s)}}function O3(t){return function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return oh(t,i)}}function Re(t,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Po;jv&&jv(t,null);let s=r.length;for(;s--;){let u=r[s];if(typeof u=="string"){const c=i(u);c!==u&&(b3(r)||(r[s]=c),u=c)}t[u]=!0}return t}function R3(t){for(let r=0;r<t.length;r++)Hn(t,r)||(t[r]=null);return t}function Sr(t){const r=r_(null);for(const[i,s]of n_(t))Hn(t,i)&&(Array.isArray(s)?r[i]=R3(s):s&&typeof s=="object"&&s.constructor===Object?r[i]=Sr(s):r[i]=s);return r}function Vs(t,r){for(;t!==null;){const s=E3(t,r);if(s){if(s.get)return Gt(s.get);if(typeof s.value=="function")return Gt(s.value)}t=_3(t)}function i(){return null}return i}const Gv=zt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),vd=zt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),bd=zt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),w3=zt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),_d=zt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),C3=zt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kv=zt(["#text"]),qv=zt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ed=zt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Fv=zt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),zo=zt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),N3=Sn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),M3=Sn(/<%[\w\W]*|[\w\W]*%>/gm),D3=Sn(/\$\{[\w\W]*/gm),L3=Sn(/^data-[\-\w.\u00B7-\uFFFF]+$/),B3=Sn(/^aria-[\-\w]+$/),a_=Sn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),U3=Sn(/^(?:\w+script|data):/i),H3=Sn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),i_=Sn(/^html$/i),j3=Sn(/^[a-z][.\w]*(-[.\w]+)+$/i);var Vv=Object.freeze({__proto__:null,ARIA_ATTR:B3,ATTR_WHITESPACE:H3,CUSTOM_ELEMENT:j3,DATA_ATTR:L3,DOCTYPE_NAME:i_,ERB_EXPR:M3,IS_ALLOWED_URI:a_,IS_SCRIPT_OR_DATA:U3,MUSTACHE_EXPR:N3,TMPLIT_EXPR:D3});const Ps={element:1,text:3,progressingInstruction:7,comment:8,document:9},I3=function(){return typeof window>"u"?null:window},z3=function(r,i){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let s=null;const u="data-tt-policy-suffix";i&&i.hasAttribute(u)&&(s=i.getAttribute(u));const c="dompurify"+(s?"#"+s:"");try{return r.createPolicy(c,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Pv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function s_(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I3();const r=le=>s_(le);if(r.version="3.2.6",r.removed=[],!t||!t.document||t.document.nodeType!==Ps.document||!t.Element)return r.isSupported=!1,r;let{document:i}=t;const s=i,u=s.currentScript,{DocumentFragment:c,HTMLTemplateElement:d,Node:h,Element:m,NodeFilter:p,NamedNodeMap:y=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:E,DOMParser:A,trustedTypes:U}=t,R=m.prototype,F=Vs(R,"cloneNode"),G=Vs(R,"remove"),_=Vs(R,"nextSibling"),C=Vs(R,"childNodes"),S=Vs(R,"parentNode");if(typeof d=="function"){const le=i.createElement("template");le.content&&le.content.ownerDocument&&(i=le.content.ownerDocument)}let I,x="";const{implementation:Z,createNodeIterator:W,createDocumentFragment:ae,getElementsByTagName:ge}=i,{importNode:Ee}=s;let se=Pv();r.isSupported=typeof n_=="function"&&typeof S=="function"&&Z&&Z.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:me,ERB_EXPR:ce,TMPLIT_EXPR:Pe,DATA_ATTR:be,ARIA_ATTR:z,IS_SCRIPT_OR_DATA:K,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:Ae}=Vv;let{IS_ALLOWED_URI:O}=Vv,k=null;const $=Re({},[...Gv,...vd,...bd,..._d,...kv]);let Y=null;const te=Re({},[...qv,...Ed,...Fv,...zo]);let re=Object.seal(r_(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ue=null,$e=null,Ue=!0,Et=!0,zn=!1,Nr=!0,Ze=!1,kt=!0,xn=!1,Di=!1,Li=!1,St=!1,qa=!1,ua=!1,Bi=!0,ca=!1;const Tu="user-content-";let Fa=!0,fa=!1,Mr={},fn=null;const Ct=Re({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let On=null;const Nt=Re({},["audio","video","img","source","image","track"]);let Ui=null;const rl=Re({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Va="http://www.w3.org/1998/Math/MathML",tr="http://www.w3.org/2000/svg",qt="http://www.w3.org/1999/xhtml";let Ft=qt,Dr=!1,nr=null;const Au=Re({},[Va,tr,qt],yd);let da=Re({},["mi","mo","mn","ms","mtext"]),ha=Re({},["annotation-xml"]);const Hi=Re({},["title","style","font","a","script"]);let Rn=null;const xu=["application/xhtml+xml","text/html"],al="text/html";let nt=null,Gn=null;const ji=i.createElement("form"),Ii=function(N){return N instanceof RegExp||N instanceof Function},zi=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Gn&&Gn===N)){if((!N||typeof N!="object")&&(N={}),N=Sr(N),Rn=xu.indexOf(N.PARSER_MEDIA_TYPE)===-1?al:N.PARSER_MEDIA_TYPE,nt=Rn==="application/xhtml+xml"?yd:Po,k=Hn(N,"ALLOWED_TAGS")?Re({},N.ALLOWED_TAGS,nt):$,Y=Hn(N,"ALLOWED_ATTR")?Re({},N.ALLOWED_ATTR,nt):te,nr=Hn(N,"ALLOWED_NAMESPACES")?Re({},N.ALLOWED_NAMESPACES,yd):Au,Ui=Hn(N,"ADD_URI_SAFE_ATTR")?Re(Sr(rl),N.ADD_URI_SAFE_ATTR,nt):rl,On=Hn(N,"ADD_DATA_URI_TAGS")?Re(Sr(Nt),N.ADD_DATA_URI_TAGS,nt):Nt,fn=Hn(N,"FORBID_CONTENTS")?Re({},N.FORBID_CONTENTS,nt):Ct,ue=Hn(N,"FORBID_TAGS")?Re({},N.FORBID_TAGS,nt):Sr({}),$e=Hn(N,"FORBID_ATTR")?Re({},N.FORBID_ATTR,nt):Sr({}),Mr=Hn(N,"USE_PROFILES")?N.USE_PROFILES:!1,Ue=N.ALLOW_ARIA_ATTR!==!1,Et=N.ALLOW_DATA_ATTR!==!1,zn=N.ALLOW_UNKNOWN_PROTOCOLS||!1,Nr=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ze=N.SAFE_FOR_TEMPLATES||!1,kt=N.SAFE_FOR_XML!==!1,xn=N.WHOLE_DOCUMENT||!1,St=N.RETURN_DOM||!1,qa=N.RETURN_DOM_FRAGMENT||!1,ua=N.RETURN_TRUSTED_TYPE||!1,Li=N.FORCE_BODY||!1,Bi=N.SANITIZE_DOM!==!1,ca=N.SANITIZE_NAMED_PROPS||!1,Fa=N.KEEP_CONTENT!==!1,fa=N.IN_PLACE||!1,O=N.ALLOWED_URI_REGEXP||a_,Ft=N.NAMESPACE||qt,da=N.MATHML_TEXT_INTEGRATION_POINTS||da,ha=N.HTML_INTEGRATION_POINTS||ha,re=N.CUSTOM_ELEMENT_HANDLING||{},N.CUSTOM_ELEMENT_HANDLING&&Ii(N.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(re.tagNameCheck=N.CUSTOM_ELEMENT_HANDLING.tagNameCheck),N.CUSTOM_ELEMENT_HANDLING&&Ii(N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(re.attributeNameCheck=N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(re.allowCustomizedBuiltInElements=N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ze&&(Et=!1),qa&&(St=!0),Mr&&(k=Re({},kv),Y=[],Mr.html===!0&&(Re(k,Gv),Re(Y,qv)),Mr.svg===!0&&(Re(k,vd),Re(Y,Ed),Re(Y,zo)),Mr.svgFilters===!0&&(Re(k,bd),Re(Y,Ed),Re(Y,zo)),Mr.mathMl===!0&&(Re(k,_d),Re(Y,Fv),Re(Y,zo))),N.ADD_TAGS&&(k===$&&(k=Sr(k)),Re(k,N.ADD_TAGS,nt)),N.ADD_ATTR&&(Y===te&&(Y=Sr(Y)),Re(Y,N.ADD_ATTR,nt)),N.ADD_URI_SAFE_ATTR&&Re(Ui,N.ADD_URI_SAFE_ATTR,nt),N.FORBID_CONTENTS&&(fn===Ct&&(fn=Sr(fn)),Re(fn,N.FORBID_CONTENTS,nt)),Fa&&(k["#text"]=!0),xn&&Re(k,["html","head","body"]),k.table&&(Re(k,["tbody"]),delete ue.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw Fs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Fs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');I=N.TRUSTED_TYPES_POLICY,x=I.createHTML("")}else I===void 0&&(I=z3(U,u)),I!==null&&typeof x=="string"&&(x=I.createHTML(""));zt&&zt(N),Gn=N}},wn=Re({},[...vd,...bd,...w3]),dt=Re({},[..._d,...C3]),Mt=function(N){let X=S(N);(!X||!X.tagName)&&(X={namespaceURI:Ft,tagName:"template"});const J=Po(N.tagName),Fe=Po(X.tagName);return nr[N.namespaceURI]?N.namespaceURI===tr?X.namespaceURI===qt?J==="svg":X.namespaceURI===Va?J==="svg"&&(Fe==="annotation-xml"||da[Fe]):!!wn[J]:N.namespaceURI===Va?X.namespaceURI===qt?J==="math":X.namespaceURI===tr?J==="math"&&ha[Fe]:!!dt[J]:N.namespaceURI===qt?X.namespaceURI===tr&&!ha[Fe]||X.namespaceURI===Va&&!da[Fe]?!1:!dt[J]&&(Hi[J]||!wn[J]):!!(Rn==="application/xhtml+xml"&&nr[N.namespaceURI]):!1},Tt=function(N){ks(r.removed,{element:N});try{S(N).removeChild(N)}catch{G(N)}},kn=function(N,X){try{ks(r.removed,{attribute:X.getAttributeNode(N),from:X})}catch{ks(r.removed,{attribute:null,from:X})}if(X.removeAttribute(N),N==="is")if(St||qa)try{Tt(X)}catch{}else try{X.setAttribute(N,"")}catch{}},il=function(N){let X=null,J=null;if(Li)N="<remove></remove>"+N;else{const We=zv(N,/^[\r\n\t ]+/);J=We&&We[0]}Rn==="application/xhtml+xml"&&Ft===qt&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");const Fe=I?I.createHTML(N):N;if(Ft===qt)try{X=new A().parseFromString(Fe,Rn)}catch{}if(!X||!X.documentElement){X=Z.createDocument(Ft,"template",null);try{X.documentElement.innerHTML=Dr?x:Fe}catch{}}const ht=X.body||X.documentElement;return N&&J&&ht.insertBefore(i.createTextNode(J),ht.childNodes[0]||null),Ft===qt?ge.call(X,xn?"html":"body")[0]:xn?X.documentElement:ht},sl=function(N){return W.call(N.ownerDocument||N,N,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Pa=function(N){return N instanceof E&&(typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||!(N.attributes instanceof y)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function")},Lr=function(N){return typeof h=="function"&&N instanceof h};function Qt(le,N,X){Io(le,J=>{J.call(r,N,X,Gn)})}const rr=function(N){let X=null;if(Qt(se.beforeSanitizeElements,N,null),Pa(N))return Tt(N),!0;const J=nt(N.nodeName);if(Qt(se.uponSanitizeElement,N,{tagName:J,allowedTags:k}),kt&&N.hasChildNodes()&&!Lr(N.firstElementChild)&&Ht(/<[/\w!]/g,N.innerHTML)&&Ht(/<[/\w!]/g,N.textContent)||N.nodeType===Ps.progressingInstruction||kt&&N.nodeType===Ps.comment&&Ht(/<[/\w]/g,N.data))return Tt(N),!0;if(!k[J]||ue[J]){if(!ue[J]&&Br(J)&&(re.tagNameCheck instanceof RegExp&&Ht(re.tagNameCheck,J)||re.tagNameCheck instanceof Function&&re.tagNameCheck(J)))return!1;if(Fa&&!fn[J]){const Fe=S(N)||N.parentNode,ht=C(N)||N.childNodes;if(ht&&Fe){const We=ht.length;for(let Dt=We-1;Dt>=0;--Dt){const Vt=F(ht[Dt],!0);Vt.__removalCount=(N.__removalCount||0)+1,Fe.insertBefore(Vt,_(N))}}}return Tt(N),!0}return N instanceof m&&!Mt(N)||(J==="noscript"||J==="noembed"||J==="noframes")&&Ht(/<\/no(script|embed|frames)/i,N.innerHTML)?(Tt(N),!0):(Ze&&N.nodeType===Ps.text&&(X=N.textContent,Io([me,ce,Pe],Fe=>{X=qs(X,Fe," ")}),N.textContent!==X&&(ks(r.removed,{element:N.cloneNode()}),N.textContent=X)),Qt(se.afterSanitizeElements,N,null),!1)},ar=function(N,X,J){if(Bi&&(X==="id"||X==="name")&&(J in i||J in ji))return!1;if(!(Et&&!$e[X]&&Ht(be,X))){if(!(Ue&&Ht(z,X))){if(!Y[X]||$e[X]){if(!(Br(N)&&(re.tagNameCheck instanceof RegExp&&Ht(re.tagNameCheck,N)||re.tagNameCheck instanceof Function&&re.tagNameCheck(N))&&(re.attributeNameCheck instanceof RegExp&&Ht(re.attributeNameCheck,X)||re.attributeNameCheck instanceof Function&&re.attributeNameCheck(X))||X==="is"&&re.allowCustomizedBuiltInElements&&(re.tagNameCheck instanceof RegExp&&Ht(re.tagNameCheck,J)||re.tagNameCheck instanceof Function&&re.tagNameCheck(J))))return!1}else if(!Ui[X]){if(!Ht(O,qs(J,ee,""))){if(!((X==="src"||X==="xlink:href"||X==="href")&&N!=="script"&&A3(J,"data:")===0&&On[N])){if(!(zn&&!Ht(K,qs(J,ee,"")))){if(J)return!1}}}}}}return!0},Br=function(N){return N!=="annotation-xml"&&zv(N,Ae)},ir=function(N){Qt(se.beforeSanitizeAttributes,N,null);const{attributes:X}=N;if(!X||Pa(N))return;const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let Fe=X.length;for(;Fe--;){const ht=X[Fe],{name:We,namespaceURI:Dt,value:Vt}=ht,qn=nt(We),Kt=Vt;let lt=We==="value"?Kt:x3(Kt);if(J.attrName=qn,J.attrValue=lt,J.keepAttr=!0,J.forceKeepAttr=void 0,Qt(se.uponSanitizeAttribute,N,J),lt=J.attrValue,ca&&(qn==="id"||qn==="name")&&(kn(We,N),lt=Tu+lt),kt&&Ht(/((--!?|])>)|<\/(style|title)/i,lt)){kn(We,N);continue}if(J.forceKeepAttr)continue;if(!J.keepAttr){kn(We,N);continue}if(!Nr&&Ht(/\/>/i,lt)){kn(We,N);continue}Ze&&Io([me,ce,Pe],sr=>{lt=qs(lt,sr," ")});const Gi=nt(N.nodeName);if(!ar(Gi,qn,lt)){kn(We,N);continue}if(I&&typeof U=="object"&&typeof U.getAttributeType=="function"&&!Dt)switch(U.getAttributeType(Gi,qn)){case"TrustedHTML":{lt=I.createHTML(lt);break}case"TrustedScriptURL":{lt=I.createScriptURL(lt);break}}if(lt!==Kt)try{Dt?N.setAttributeNS(Dt,We,lt):N.setAttribute(We,lt),Pa(N)?Tt(N):Iv(r.removed)}catch{kn(We,N)}}Qt(se.afterSanitizeAttributes,N,null)},st=function le(N){let X=null;const J=sl(N);for(Qt(se.beforeSanitizeShadowDOM,N,null);X=J.nextNode();)Qt(se.uponSanitizeShadowNode,X,null),rr(X),ir(X),X.content instanceof c&&le(X.content);Qt(se.afterSanitizeShadowDOM,N,null)};return r.sanitize=function(le){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=null,J=null,Fe=null,ht=null;if(Dr=!le,Dr&&(le="<!-->"),typeof le!="string"&&!Lr(le))if(typeof le.toString=="function"){if(le=le.toString(),typeof le!="string")throw Fs("dirty is not a string, aborting")}else throw Fs("toString is not a function");if(!r.isSupported)return le;if(Di||zi(N),r.removed=[],typeof le=="string"&&(fa=!1),fa){if(le.nodeName){const Vt=nt(le.nodeName);if(!k[Vt]||ue[Vt])throw Fs("root node is forbidden and cannot be sanitized in-place")}}else if(le instanceof h)X=il("<!---->"),J=X.ownerDocument.importNode(le,!0),J.nodeType===Ps.element&&J.nodeName==="BODY"||J.nodeName==="HTML"?X=J:X.appendChild(J);else{if(!St&&!Ze&&!xn&&le.indexOf("<")===-1)return I&&ua?I.createHTML(le):le;if(X=il(le),!X)return St?null:ua?x:""}X&&Li&&Tt(X.firstChild);const We=sl(fa?le:X);for(;Fe=We.nextNode();)rr(Fe),ir(Fe),Fe.content instanceof c&&st(Fe.content);if(fa)return le;if(St){if(qa)for(ht=ae.call(X.ownerDocument);X.firstChild;)ht.appendChild(X.firstChild);else ht=X;return(Y.shadowroot||Y.shadowrootmode)&&(ht=Ee.call(s,ht,!0)),ht}let Dt=xn?X.outerHTML:X.innerHTML;return xn&&k["!doctype"]&&X.ownerDocument&&X.ownerDocument.doctype&&X.ownerDocument.doctype.name&&Ht(i_,X.ownerDocument.doctype.name)&&(Dt="<!DOCTYPE "+X.ownerDocument.doctype.name+`>
111
111
  `+Dt),Ze&&Io([me,ce,Pe],Vt=>{Dt=qs(Dt,Vt," ")}),I&&ua?I.createHTML(Dt):Dt},r.setConfig=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};zi(le),Di=!0},r.clearConfig=function(){Gn=null,Di=!1},r.isValidAttribute=function(le,N,X){Gn||zi({});const J=nt(le),Fe=nt(N);return ar(J,Fe,X)},r.addHook=function(le,N){typeof N=="function"&&ks(se[le],N)},r.removeHook=function(le,N){if(N!==void 0){const X=S3(se[le],N);return X===-1?void 0:T3(se[le],X,1)[0]}return Iv(se[le])},r.removeHooks=function(le){se[le]=[]},r.removeAllHooks=function(){se=Pv()},r}var G3=s_();const k3=({onClose:t})=>{const r=tt();return v.jsxs("div",{className:_t.highlightLoadingInfo,onClick:t,children:[v.jsx("div",{className:_t.highlightLoadingInfoCloseIcon,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})}),v.jsxs("div",{className:_t.highlightLoadingInfoInnerContainer,children:[v.jsxs("div",{className:_t.highlightLoadingInfoContent,children:[v.jsx("h3",{children:r("source-infos.highlight-loading.title")}),v.jsx("p",{children:r("source-infos.highlight-loading.description")})]}),v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#000000",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M253.66,106.34a8,8,0,0,0-11.32,0L192,156.69,107.31,72l50.35-50.34a8,8,0,1,0-11.32-11.32L96,60.69A16,16,0,0,0,93.18,79.5L72,100.69a16,16,0,0,0,0,22.62L76.69,128,18.34,186.34a8,8,0,0,0,3.13,13.25l72,24A7.88,7.88,0,0,0,96,224a8,8,0,0,0,5.66-2.34L136,187.31l4.69,4.69a16,16,0,0,0,22.62,0l21.19-21.18A16,16,0,0,0,203.31,168l50.35-50.34A8,8,0,0,0,253.66,106.34ZM93.84,206.85l-55-18.35L88,139.31,124.69,176ZM152,180.69,83.31,112,104,91.31,172.69,160Z"})})]})]})},q3=({title:t,href:r,children:i})=>v.jsx("a",{href:r,title:t,target:"_blank",rel:"noopener noreferrer",children:i}),F3=({className:t,children:r,...i})=>v.jsx("a",{className:Q(Js.button,Js.buttonDefault,t),type:"button",role:"button",...i,children:r}),V3=t=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:v.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),P3=({type:t,...r})=>{switch(t){case"WEBSITE":return v.jsx(Xb,{...r});case"PDF":return v.jsx(Yb,{...r});case"DOCX":return v.jsx(Vb,{...r});case"TEXT":return v.jsx(V3,{...r});default:return v.jsx(Pb,{...r})}},Y3=({url:t,knowledgeBaseType:r})=>{const i=tt();return v.jsx(F3,{className:_t.openSourceButton,href:t,target:"_blank",children:v.jsxs("div",{className:_t.sourceButtonLabel,children:[v.jsx("div",{className:_t.sourceHeaderIcon,children:v.jsx(P3,{type:r})}),v.jsx("p",{children:i("source-infos.open-source")})]})})},X3=({sourceInfos:{content:t,url:r,knowledgeBaseType:i,highlighted:s}})=>{const[u,c]=H.useState(!s);H.useEffect(()=>{s&&c(!1)},[s]);const d=G3.sanitize(t,{USE_PROFILES:{html:!0}});return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Q(_t.sourceContent,Qb.markdown),children:[v.jsx(xr,{options:{overrides:{a:q3}},children:d}),u&&v.jsx(k3,{onClose:()=>c(!1)})]}),v.jsx(Y3,{url:r,knowledgeBaseType:i})]})},Z3=""+new URL("undraw_fixing-bugs-D_eYxJc6.svg",import.meta.url).href,Q3=()=>{const t=tt();return v.jsxs("div",{className:_t.loadingError,children:[v.jsx("h1",{children:t("source-infos.error.title")}),v.jsx("img",{src:Z3,title:t("source-infos.error.title")}),v.jsx("p",{children:t("source-infos.error.info")})]})},K3=()=>v.jsx("div",{className:_t.loadingSourceInfos,children:v.jsx("svg",{className:_t.loading,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"})})});function $3({sourceInfos:t,onClose:r,threshold:i=100}){const s=H.useRef(null),[u,c]=H.useState(0),[d,h]=H.useState(!1),m=H.useRef(null),p=H.useRef(null),y=H.useCallback(R=>{m.current=R,h(!0)},[]),E=H.useCallback(R=>{if(m.current!==null&&d){const F=R-m.current;F>0&&c(F)}},[d]),A=H.useCallback(()=>{h(!1),u>i&&r(),c(0),m.current=null},[u,i,r]),U=H.useCallback(R=>{const F=x=>y(x.touches[0].clientY),G=x=>E(x.touches[0].clientY),_=()=>A(),C=x=>{x.preventDefault(),y(x.clientY),window.addEventListener("mousemove",S),window.addEventListener("mouseup",I)},S=x=>E(x.clientY),I=()=>{A(),window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",I)};R.addEventListener("touchstart",F),R.addEventListener("touchmove",G),R.addEventListener("touchend",_),R.addEventListener("mousedown",C),p.current=()=>{R.removeEventListener("touchstart",F),R.removeEventListener("touchmove",G),R.removeEventListener("touchend",_),R.removeEventListener("mousedown",C),window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",I)}},[y,E,A]);return H.useEffect(()=>{let R;return(()=>{s.current?(p.current?.(),U(s.current)):(R=new MutationObserver(()=>{s.current&&(p.current?.(),U(s.current),R?.disconnect())}),R.observe(document.body,{childList:!0,subtree:!0}))})(),()=>{R?.disconnect(),p.current?.()}},[U,t]),{ref:s,dragOffsetY:u,isDragging:d}}const W3=t=>{const[r,i]=H.useState(!0);return H.useEffect(()=>{let s=null;return t?.type==="loading"?(i(!0),s=setTimeout(()=>{i(!1)},300)):i(!t),()=>{s&&clearTimeout(s)}},[t]),r},J3=()=>{const t=Cr(),r=it(m=>m.chat.sourceInfos),i=t_(),s=H.useRef(null),u=W3(r);H.useEffect(()=>{s.current&&r?.type==="loading"&&(i?s.current.showModal():(s.current.setAttribute("open","true"),s.current?.focus()))},[r,i]);const c=H.useCallback(()=>{s.current&&(i?s.current.close():s.current.removeAttribute("open"),t(AO()))},[t,i]),{ref:d,dragOffsetY:h}=$3({onClose:c,sourceInfos:r});return r?v.jsx("dialog",{ref:s,className:Q(_t.sourceInfos,u?_t.waitForLoading:r.type==="loading"?_t.loadingContent:""),style:i&&h?{transform:`translateY(${h}px)`}:{},onClose:c,autoFocus:!0,role:"dialog","aria-labelledby":"source-info-title",children:u?null:v.jsxs(v.Fragment,{children:[v.jsx(y3,{ref:d,tabIndex:-1,sourceInfos:r.type==="loaded"?r:void 0,onClose:c}),r.type==="loading"?v.jsx(K3,{}):r.type==="loading-error"?v.jsx(Q3,{}):v.jsxs(v.Fragment,{children:[v.jsx(v3,{loading:!r.highlighted}),v.jsx(X3,{sourceInfos:r})]})]})}):null},eN="_container_1aof3_1",tN="_body_1aof3_7",nN="_intro_1aof3_14",rN="_footer_1aof3_39",aN="_footnote_1aof3_43",iN="_containerWithFootnote_1aof3_58",sN="_startChatButton_1aof3_73",lN="_spinner_1aof3_88",oN="_formFields_1aof3_92",uN="_formField_1aof3_92",cN="_radio_1aof3_104",fN="_checkbox_1aof3_111",dN="_input_1aof3_119",hN="_inputLabel_1aof3_153",mN="_selectWrapper_1aof3_157",pN="_select_1aof3_157",gN="_selectLabel_1aof3_203",bt={container:eN,body:tN,intro:nN,footer:rN,footnote:aN,containerWithFootnote:iN,startChatButton:sN,spinner:lN,formFields:oN,formField:uN,radio:cN,checkbox:fN,input:dN,inputLabel:hN,selectWrapper:mN,select:pN,selectLabel:gN},yN=({name:t,label:r,defaultValue:i,required:s,onChange:u})=>{const c=d=>{u(d.currentTarget.checked?"true":"false")};return v.jsxs("label",{className:Q(bt.checkbox,"chat__startScreen__checkbox"),htmlFor:t,children:[v.jsx("input",{type:"checkbox",id:t,name:t,defaultChecked:i==="true",required:s,onChange:c}),v.jsx("div",{children:r})]})},vN=({type:t,name:r,label:i,defaultValue:s,placeholder:u,required:c,multiple:d,min:h,max:m,pattern:p,onChange:y})=>{const E=A=>{y(A.target.value)};return v.jsxs("label",{className:Q(bt.input,"chat__startScreen__input"),htmlFor:r,children:[v.jsx("div",{className:Q(bt.inputLabel),children:i}),v.jsx("input",{type:t,id:r,name:r,defaultValue:s,placeholder:u,required:c,multiple:d,min:h,max:m,pattern:p,onChange:E})]})},bN=({name:t,value:r,label:i,defaultChecked:s,required:u,onChange:c})=>{const d=`${t}-${r}`,h=m=>{c(m.target.value)};return v.jsxs("label",{className:Q(bt.radio,"chat__startScreen__radio"),htmlFor:d,children:[v.jsx("input",{id:d,type:"radio",name:t,value:r,defaultChecked:s,required:u,onChange:h}),v.jsx("span",{className:Q(bt.label),children:i})]})},_N=({name:t,label:r,defaultValue:i,required:s,multiple:u,options:c,onChange:d})=>{const h=m=>{d(m.target.value)};return v.jsxs("label",{className:Q(bt.select,"chat__startScreen__select"),htmlFor:t,children:[v.jsx("div",{className:Q(bt.selectLabel),children:r}),v.jsx("div",{className:Q(bt.selectWrapper),children:v.jsx("select",{id:t,name:t,defaultValue:i,required:s,multiple:u,onChange:h,children:Object.entries(c||{}).map(([m,p])=>v.jsx("option",{value:m,selected:p===i,children:p}))})})]})},EN="start-screen.intro",SN="start-screen.start-chat",TN="start-screen.waiting-for-login",AN="start-screen.footnote",Un="start-screen.form",Yv=`${Un}.fields`,xN=()=>{const t=tt(),r=Cr(),i=_u(),s=it(R=>R.startScreen.loginRequestToken),u=it(R=>R.settings.requiresUserAuthentication);H.useEffect(()=>{let R;if(s){const _=window.screenX+(window.outerWidth-600)/2,C=window.screenY+(window.outerHeight-700)/2,S=window.open(`/${i}/auth/login?loginRequestToken=${s}`,"Login",`width=600,height=700,left=${_},top=${C},resizable=yes,scrollbars=yes`);R=setInterval(()=>{S?.closed&&(r(_O()),clearInterval(R))},500)}return()=>{R&&clearInterval(R)}},[i,s,r]);const[c,d]=H.useState({}),h=()=>{const R=Object.entries(c).reduce((F,[G,_])=>({...F,[G]:_.value}),{});r(u?bO({loginRequestToken:$o(),formValues:R}):gO({formValues:R}))},m=t(EN),p=t(s?TN:SN),y=t(AN),E=H.useMemo(()=>t(Yv)?.split(";").map(R=>R.trim())??[],[t(Yv)]);H.useEffect(()=>{E.length&&Object.keys(c).length===0&&d(E.reduce((R,F)=>({...R,[F]:ON(F,t)}),{}))},[t,E,c]);const A=R=>{R.preventDefault(),h()},U=R=>F=>{d(G=>({...G,[R]:{...G[R],value:F}}))};return v.jsxs("form",{onSubmit:A,className:Q(bt.container,y&&bt.containerWithFootnote,"chat__startScreen"),children:[v.jsxs("div",{className:Q(bt.body,"chat__startScreen__body"),children:[m&&v.jsx("div",{className:Q(bt.intro,"chat__startScreen__intro"),children:v.jsx(xr,{options:{overrides:{a:Xv}},children:m})}),v.jsx("div",{className:Q(bt.formFields,"chat__startScreen__fields"),children:Object.values(c).map(({type:R,name:F,label:G,placeholder:_,defaultValue:C,options:S,required:I,multiple:x,min:Z,max:W,pattern:ae})=>v.jsx("div",{className:Q(bt.formField,"chat__startScreen__field"),children:(()=>{switch(R){case"radio":return v.jsxs(v.Fragment,{children:[v.jsx("div",{children:G}),Object.entries(S||{}).map(([ge,Ee])=>v.jsx(bN,{name:F,value:ge,label:Ee,defaultChecked:ge===C,required:I,onChange:U(F)},ge))]});case"checkbox":return v.jsx(yN,{name:F,label:G,defaultValue:C,required:I,onChange:U(F)});case"select":return v.jsx(_N,{name:F,label:G,defaultValue:C,required:I,multiple:x,options:S,onChange:U(F)});default:return v.jsx(vN,{type:R,name:F,label:G,placeholder:_,defaultValue:C,required:I,multiple:x,min:Z,max:W,pattern:ae,onChange:U(F)})}})()},F))})]}),v.jsxs("div",{className:Q(bt.footer,"chat__startScreen__footer"),children:[v.jsxs(au,{type:"submit",className:bt.startChatButton,disabled:!!s,children:[!!s&&v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",className:bt.spinner,children:v.jsx("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm88,88H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"})}),v.jsx("div",{children:p})]}),y&&v.jsx("div",{className:bt.footnote,children:v.jsx(xr,{options:{overrides:{a:Xv}},children:y})})]})]})},Xv=({title:t,href:r,children:i})=>v.jsx("a",{href:r,title:t,target:"_blank",rel:"noopener noreferrer",children:i}),ON=(t,r)=>{const i=r(`${Un}.${t}.type`)||"text",s=r(`${Un}.${t}.required`)==="true",u=r(`${Un}.${t}.multiple`)==="true",c=r(`${Un}.${t}.placeholder`),d=r(`${Un}.${t}.label`)||"",h=r(`${Un}.${t}.defaultValue`),m=r(`${Un}.${t}.min`),p=r(`${Un}.${t}.max`),y=r(`${Un}.${t}.pattern`),E=wN(r(`${Un}.${t}.options`));return{name:t,label:d,placeholder:c,value:RN(i,h,E)||"",defaultValue:h,options:E,type:i,required:s,multiple:u,min:m,max:p,pattern:y}},RN=(t,r,i)=>r||t==="select"&&Object.keys(i)[0]||"",wN=(t="")=>t.split(";").map(r=>r.trim()).reduce((r,i)=>{const[s,u]=i.split(":").map(c=>c.trim());return{...r,[s]:u}},{}),CN=()=>{const t=ou();H.useEffect(()=>{window.document.documentElement.lang=t.locale},[t.locale])},Oi={TRIGGER_ACTION:"TRIGGER_ACTION",TRIGGER_STORY:"TRIGGER_STORY",CHAT_MESSAGE_FROM_GUEST:"CHAT_MESSAGE_FROM_GUEST",ON_CHAT_WINDOW_OPEN:"ON_CHAT_WINDOW_OPEN",ON_CHAT_WINDOW_CLOSE:"ON_CHAT_WINDOW_CLOSE",RESTART_CHAT:"RESTART_CHAT"},NN=({clientName:t})=>{CN();const r=Cr(),i=it(y=>y.intl.messages),s=tt(),u=it(y=>y.settings.enableStartScreen),c=it(y=>y.startScreen.startScreenStatus),[d,h]=H.useState(void 0);H.useEffect(()=>{const y=uu.parse(window.location.search);y.cssClassName&&h(y.cssClassName);const E=A=>{switch(A.data.type){case Oi.TRIGGER_ACTION:r(A.data.action);break;case Oi.TRIGGER_STORY:r(db(A.data.story));break;case Oi.ON_CHAT_WINDOW_OPEN:r({type:"webclient.chatwindow.opened"});break;case Oi.ON_CHAT_WINDOW_CLOSE:r({type:"webclient.chatwindow.closed"});break;case Oi.CHAT_MESSAGE_FROM_GUEST:r(lb(A.data.text));break;case Oi.RESTART_CHAT:r(gu(t,y));break}};return r(OO(t,y)),window.addEventListener("message",A=>E(A),!1),()=>window.removeEventListener("message",E)},[t,r]),H.useEffect(()=>{const y=s("page.title");y&&document&&(document.title=y)},[i,s]);const m=u===void 0,p=u===!1||c==="HIDDEN";return v.jsx("div",{className:Q(Hv.chatwindow,p&&Hv.chatwindowWithAside,"chat__chatwindow",d),children:m?null:p?v.jsxs(v.Fragment,{children:[v.jsx("header",{children:v.jsx(Uv,{chatStarted:!0})}),v.jsx("main",{children:v.jsx(UC,{clientName:t})}),v.jsx("aside",{children:v.jsx(J3,{})})]}):v.jsxs(v.Fragment,{children:[v.jsx("header",{children:v.jsx(Uv,{chatStarted:!1})}),v.jsx("main",{children:v.jsx(xN,{})})]})})},MN=()=>{const t=_u(),r=t_(),i=it(u=>u.intl.locale),s=it(u=>u.intl.messages);return v.jsx(CA,{locale:i,messages:s,onError:()=>{},children:v.jsx("div",{className:Q([MA.app,r?"chat__small":"chat__large"]),children:v.jsx(NN,{clientName:t})})})};var Sd,Zv;function Zh(){if(Zv)return Sd;Zv=1;function t(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}return Sd=t,Sd}var Td,Qv;function DN(){if(Qv)return Td;Qv=1;var t=typeof go=="object"&&go&&go.Object===Object&&go;return Td=t,Td}var Ad,Kv;function l_(){if(Kv)return Ad;Kv=1;var t=DN(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=t||r||Function("return this")();return Ad=i,Ad}var xd,$v;function LN(){if($v)return xd;$v=1;var t=l_(),r=function(){return t.Date.now()};return xd=r,xd}var Od,Wv;function BN(){if(Wv)return Od;Wv=1;var t=/\s/;function r(i){for(var s=i.length;s--&&t.test(i.charAt(s)););return s}return Od=r,Od}var Rd,Jv;function UN(){if(Jv)return Rd;Jv=1;var t=BN(),r=/^\s+/;function i(s){return s&&s.slice(0,t(s)+1).replace(r,"")}return Rd=i,Rd}var wd,e1;function o_(){if(e1)return wd;e1=1;var t=l_(),r=t.Symbol;return wd=r,wd}var Cd,t1;function HN(){if(t1)return Cd;t1=1;var t=o_(),r=Object.prototype,i=r.hasOwnProperty,s=r.toString,u=t?t.toStringTag:void 0;function c(d){var h=i.call(d,u),m=d[u];try{d[u]=void 0;var p=!0}catch{}var y=s.call(d);return p&&(h?d[u]=m:delete d[u]),y}return Cd=c,Cd}var Nd,n1;function jN(){if(n1)return Nd;n1=1;var t=Object.prototype,r=t.toString;function i(s){return r.call(s)}return Nd=i,Nd}var Md,r1;function IN(){if(r1)return Md;r1=1;var t=o_(),r=HN(),i=jN(),s="[object Null]",u="[object Undefined]",c=t?t.toStringTag:void 0;function d(h){return h==null?h===void 0?u:s:c&&c in Object(h)?r(h):i(h)}return Md=d,Md}var Dd,a1;function zN(){if(a1)return Dd;a1=1;function t(r){return r!=null&&typeof r=="object"}return Dd=t,Dd}var Ld,i1;function GN(){if(i1)return Ld;i1=1;var t=IN(),r=zN(),i="[object Symbol]";function s(u){return typeof u=="symbol"||r(u)&&t(u)==i}return Ld=s,Ld}var Bd,s1;function kN(){if(s1)return Bd;s1=1;var t=UN(),r=Zh(),i=GN(),s=NaN,u=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,d=/^0o[0-7]+$/i,h=parseInt;function m(p){if(typeof p=="number")return p;if(i(p))return s;if(r(p)){var y=typeof p.valueOf=="function"?p.valueOf():p;p=r(y)?y+"":y}if(typeof p!="string")return p===0?p:+p;p=t(p);var E=c.test(p);return E||d.test(p)?h(p.slice(2),E?2:8):u.test(p)?s:+p}return Bd=m,Bd}var Ud,l1;function qN(){if(l1)return Ud;l1=1;var t=Zh(),r=LN(),i=kN(),s="Expected a function",u=Math.max,c=Math.min;function d(h,m,p){var y,E,A,U,R,F,G=0,_=!1,C=!1,S=!0;if(typeof h!="function")throw new TypeError(s);m=i(m)||0,t(p)&&(_=!!p.leading,C="maxWait"in p,A=C?u(i(p.maxWait)||0,m):A,S="trailing"in p?!!p.trailing:S);function I(ce){var Pe=y,be=E;return y=E=void 0,G=ce,U=h.apply(be,Pe),U}function x(ce){return G=ce,R=setTimeout(ae,m),_?I(ce):U}function Z(ce){var Pe=ce-F,be=ce-G,z=m-Pe;return C?c(z,A-be):z}function W(ce){var Pe=ce-F,be=ce-G;return F===void 0||Pe>=m||Pe<0||C&&be>=A}function ae(){var ce=r();if(W(ce))return ge(ce);R=setTimeout(ae,Z(ce))}function ge(ce){return R=void 0,S&&y?I(ce):(y=E=void 0,U)}function Ee(){R!==void 0&&clearTimeout(R),G=0,y=F=E=R=void 0}function se(){return R===void 0?U:ge(r())}function me(){var ce=r(),Pe=W(ce);if(y=arguments,E=this,F=ce,Pe){if(R===void 0)return x(F);if(C)return clearTimeout(R),R=setTimeout(ae,m),I(F)}return R===void 0&&(R=setTimeout(ae,m)),U}return me.cancel=Ee,me.flush=se,me}return Ud=d,Ud}var Hd,o1;function FN(){if(o1)return Hd;o1=1;var t=qN(),r=Zh(),i="Expected a function";function s(u,c,d){var h=!0,m=!0;if(typeof u!="function")throw new TypeError(i);return r(d)&&(h="leading"in d?!!d.leading:h,m="trailing"in d?!!d.trailing:m),t(u,c,{leading:h,maxWait:c,trailing:m})}return Hd=s,Hd}var VN=FN();const PN=gh(VN);function YN(t){return t&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function XN(t){return t}function ZN(t,r){r=r||{};const i=r.delimiter||".",s=r.maxDepth,u=r.transformKey||XN,c={};function d(h,m,p){p=p||1,Object.keys(h).forEach(function(y){const E=h[y],A=r.safe&&Array.isArray(E),U=Object.prototype.toString.call(E),R=YN(E),F=U==="[object Object]"||U==="[object Array]",G=m?m+i+u(y):u(y);if(!A&&!R&&F&&Object.keys(E).length&&(!r.maxDepth||p<s))return d(E,G,p+1);c[G]=E})}return d(t),c}const u_={"page.title":"Bubble Chat Chatbot","message-input-label":"Benutzereingabe","message-input-placeholder":"Nachricht","message-input.actions.submit.label":"Nachricht senden","message-input.actions.start-audio-recording.label":"Spracheingabe starten","message-input.actions.stop-audio-recording.label":"Spracheingabe stoppen","message-input.actions.submit-audio-recording.label":"Spracheingabe übermitteln","guest-bubble.label":"Ihre Nachricht","bot-bubble.label":"Nachricht des Chatbots","bot-bubble.reaction.good":"Gefällt mir","bot-bubble.reaction.bad":"Gefällt mir nicht","bot-bubble.reaction.remove":"Markierung entfernen","bot-bubble.copy":"Kopieren","bot-bubble.sources":"Quellenliste","bot-bubble.source.open":"Quelle öffnen","agent-bubble.label":"Nachricht des Live-Agenten","export-transcript.email.title":"Chatverlauf per E-Mail versenden","export-transcript.email.description":"Bitte E-Mail-Adresse angeben, an die der Chatverlauf gesendet werden soll.","export-transcript.email.cancel":"Abbrechen","export-transcript.email.send":"Senden","export-transcript.email.placeholder":"E-Mail-Adresse","export-transcript.email.invalid":"Bitte gültige E-Mail-Adresse eingeben.","export-transcript.email.success":"Der Chatverlauf wurde an die hinterlegte E-Mail-Adresse übermittelt.","general-conditions.header":"**Nutzungsbedingungen**","general-conditions.body":`Bitte berücksichtigen Sie die folgenden Punkte:
112
112
 
113
113
  - Der Chatverlauf wird im EU-Raum gespeichert und kann nur von autorisierten Personen eingesehen werden.
@@ -120,5 +120,5 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
120
120
  - Ne saisissez aucune information personnelle dans la fenêtre de chat (mots de passe, date de naissance, etc.).`,"general-conditions.accept-conditions-note":"En utilisant le chat, vous acceptez les conditions d'utilisation.","block-user-input.title":"Veuillez attendre la réponse du chatbot.","conversation-rating.call-to-action.title":"Notez ce chat","conversation-rating.overlay.title":"Dans quelle mesure êtes-vous satisfait de ce chat ?","conversation-rating.overlay.guest-feedback.input-placeholder":"Veuillez saisir vos commentaires ici (facultatif)","conversation-rating.overlay.star.very-bad":"Très mauvais","conversation-rating.overlay.star.very-good":"Très bien","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, ça ne sonne pas bien. Merci de me donner un feedback pour que je puisse en apprendre davantage.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, ça ne sonne pas bien. Merci de me donner un feedback pour que je puisse en apprendre davantage.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"La moyenne n'est pas mon objectif, que puis-je encore améliorer ?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Le rater de peu, c'est le rater aussi. Que puis-je encore améliorer pour obtenir toutes les étoiles la prochaine fois ?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Parfait ! Alors j'espère pouvoir vous conseiller aussi bien une fois de plus.","conversation-rating.overlay.bot-message.submit-feedback":"Merci beaucoup pour votre feed-back. Je m'efforce de m'améliorer en permanence.","conversation-rating.overlay.action.submit":"Envoyer","conversation-rating.overlay.action.back-to-chat":"Fermer","conversation-rating.overlay.action.close-chat":"Minimiser le chat","conversation-rating.overlay.action.cancel":"Annuler","start-screen.intro":"","start-screen.start-chat":"Démarrer le chat","start-screen.waiting-for-login":"En attente de connexion ...","header.close-chat":"Minimiser le chat","header.menu.title":"Menu","header.menu.restart-chat":"Redémarrer le chat","header.menu.expand-chat-window":"Agrandir la fenêtre","header.menu.download-transcript":"Télécharger l'historique du chat","header.menu.send-transcript":"Envoyer l'historique du chat","header.menu.export-transcript":"Exporter l'historique du chat","header.menu.rate-conversation":"Évaluer le chat","source-infos.close":"Fermer","source-infos.open-source":"Ouvrir source","source-infos.error.title":"Erreur","source-infos.error.info":"Oups ! Quelque chose s'est mal passé. Merci de réessayer ou de contacter le support si le problème persiste.","source-infos.highlight-loading.title":"Contenus pertinents en surbrillance...","source-infos.highlight-loading.description":"Un instant - la source est analysée","commands.show-more.action":"Plus","commands.show-more.tooltip":"Afficher plus de commandes","commands.show-less.action":"Moins","commands.show-less.tooltip":"Afficher moins de commandes"},$N={"page.title":"Bubble Chat Chatbot","message-input-label":"Input dell'utente","message-input-placeholder":"Messaggio","message-input.actions.submit.label":"Invia messaggio","message-input.actions.start-audio-recording.label":"Avviare l'input vocale","message-input.actions.stop-audio-recording.label":"Interrompere l'input vocale","message-input.actions.submit-audio-recording.label":"Trasmettere l'input vocale","guest-bubble.label":"Il tuo messaggio","bot-bubble.label":"Messaggio del chatbot","bot-bubble.reaction.good":"Mi piace","bot-bubble.reaction.bad":"Non mi piace","bot-bubble.reaction.remove":"Rimuovere il marcatore","bot-bubble.copy":"Copia","bot-bubble.sources":"Elenco delle fonti","bot-bubble.source.open":"Fonte aperta","agent-bubble.label":"Messaggio dell'agente dal vivo","export-transcript.email.title":"Ricevere la cronologia della chat","export-transcript.email.description":"Inserire l'indirizzo e-mail a cui inviare la cronologia della chat.","export-transcript.email.cancel":"Annulla","export-transcript.email.send":"Invia","export-transcript.email.placeholder":"E-mail","export-transcript.email.invalid":"Inserire un indirizzo e-mail valido.","export-transcript.email.success":"La cronologia della chat è stata inviata all'indirizzo e-mail fornito.","general-conditions.header":"**Condizioni di utilizzo**","general-conditions.body":`Si prega di considerare i seguenti punti:
121
121
 
122
122
  - La cronologia delle chat è memorizzata nell'area UE e può essere visualizzata solo da persone autorizzate.
123
- - Non inserire dati personali nella finestra di chat (password, data di nascita, ecc.).`,"general-conditions.accept-conditions-note":"Utilizzando la chat si accettano le condizioni d'uso.","block-user-input.title":"Attendere la risposta del chatbot.","conversation-rating.call-to-action.title":"Valuta questa chat","conversation-rating.overlay.title":"Quanto sei soddisfatto di questa chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Inserisci qui il tuo feedback (opzionale)","conversation-rating.overlay.star.very-bad":"Molto male","conversation-rating.overlay.star.very-good":"Molto buono","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"La media non è il mio obiettivo, cosa posso ancora migliorare?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Anche l'assenza è finita. Cosa posso migliorare per ottenere tutte le stelle la prossima volta?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfetto! Allora spero di potervi consigliare ancora una volta bene.","conversation-rating.overlay.bot-message.submit-feedback":"Grazie mille per il feedback. Mi impegno costantemente per migliorare.","conversation-rating.overlay.action.submit":"Invia","conversation-rating.overlay.action.back-to-chat":"Chiudere","conversation-rating.overlay.action.close-chat":"Minimizzare la chat","conversation-rating.overlay.action.cancel":"Annulla","start-screen.intro":"","start-screen.start-chat":"Avviare la chat","start-screen.waiting-for-login":"In attesa di login ...","header.close-chat":"Minimizzare la chat","header.menu.title":"Menu","header.menu.restart-chat":"Riavviare la chat","header.menu.expand-chat-window":"Espandere la finestra","header.menu.download-transcript":"Scaricare la trascrizione","header.menu.send-transcript":"Inviare la trascrizione","header.menu.export-transcript":"Esportare la trascrizione","header.menu.rate-conversation":"Valutare la conversazione","source-infos.close":"Chiudere","source-infos.open-source":"Fonte aperta","source-infos.error.title":"Errore","source-infos.error.info":"Ops! Qualcosa è andato storto. Riprovare o contattare l'assistenza se il problema persiste.","source-infos.highlight-loading.title":"Il contenuto rilevante è evidenziato...","source-infos.highlight-loading.description":"Un momento - la fonte è in fase di analisi","commands.show-more.action":"Di più","commands.show-more.tooltip":"Mostra più comandi","commands.show-less.action":"Meno","commands.show-less.tooltip":"Mostra meno comandi"},WN=["de","en","fr","it"],c_={locale:"de",messages:u_},JN=(t,r)=>{if(WN.includes(t)){const i=e8(t),s=ZN(r);return{...i,...s}}return r},e8=t=>{switch(t.toString()){case"en":return QN;case"fr":return KN;case"it":return $N;default:return u_}},t8=(t=n8,r)=>{switch(r.type){case Gh:return Object.assign({},t,{connectionState:Ia.CONNECTING});case kh:return Object.assign({},t,{connectionState:Ia.CONNECTED});case qh:return Object.assign({},t,{connectionState:Ia.DISCONNECTED});case Fh:return Object.assign({},t,{connectionState:Ia.RECONNECTED});case Vh:return Object.assign({},t,{sessionId:r.sessionId});case mu:return Object.assign({},t,{sessionId:r.payload.sessionId,userId:r.payload.userId});case pu:return Object.assign({},t,{sessionId:void 0});default:return t}},n8={connectionState:Ia.DISCONNECTED,sessionId:void 0,userId:void 0},r8=(t=c1,r)=>{switch(r.type){case wb:return c1;case mu:return Ua({type:"webclient.chat.started"}),t;case pu:return Ua({type:"webclient.chat.ended"}),t;case Te.ActionTypes.TYPING_ON:return Object.assign({},t,{isBotTyping:!0});case Te.ActionTypes.TYPING_OFF:return Object.assign({},t,{isBotTyping:!1});case Te.ActionTypes.MESSAGE_FROM_GUEST:case Te.ActionTypes.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return u1(t,r.message);case Te.ActionTypes.MESSAGE_TO_GUEST:{Ua(r);const i=Object.assign({},r.message,{_id:r.meta.actionId}),s=t.messages.filter(u=>u._id===r.meta.actionId).length>0;return Object.assign({},t,{isBotTyping:!1,messages:s?t.messages:t.messages.concat([i]),quickReplies:i.quickReplies?i.quickReplies:[]})}case Rh:{const i=r.messages,s=i.length?i[i.length-1]:void 0;return Object.assign({},t,{isBotTyping:!1,messages:i,quickReplies:s?.quickReplies||[]})}case Oh:return Ua(r.message),t;case Te.ActionTypes.EVENT_TO_GUEST:return Ua(r.event),t;case Te.ActionTypes.DRAWER_OPEN:return Object.assign({},t,{drawerContentUrl:r.payload.parameters.contentUrl});case Te.ActionTypes.DRAWER_CLOSE:return Object.assign({},t,{drawerContentUrl:void 0});case Te.ActionTypes.GUEST_LOCALE_CHANGED:return Object.assign({},t,{locale:r.payload.locale});case ub:return Ua(r),t;case cb:return Ua(r),t;case Ch:{const i=new Te.TextMessage(r.transcription,new Te.GuestUser),s=Object.assign({},i,{_id:$o()});return u1(t,s)}case Te.ActionTypes.TRANSCRIPT_ITEM_GUEST_REACTION:{const i=t.messages.map(s=>s._id===r.payload.actionId?Object.assign({},s,{reaction:r.payload.reaction}):s);return Object.assign({},t,{messages:i})}case Nh:{const i={enabled:!0,rating:r.payload.rating};return Object.assign({},t,{conversationRating:i})}case Te.ActionTypes.CONVERSATION_RATING_FROM_GUEST:{const i={...t.conversationRating,rating:r.payload};return Object.assign({},t,{conversationRating:i})}case Nb:{const i={...t.conversationRating,opener:r.payload.opener,...r.payload.defaultRating?{rating:{value:r.payload.defaultRating,feedback:t.conversationRating.rating?.feedback||""}}:{}};return Object.assign({},t,{conversationRating:i})}case Mb:{const i={...t.conversationRating,opener:void 0};return Object.assign({},t,{conversationRating:i})}case Dh:return{...t,sourceInfos:{type:"loading",chunkId:r.payload.chunkId}};case Mh:{const{highlighted:i}=r.payload;return t.sourceInfos?.type==="loaded"&&i?{...t,sourceInfos:{...t.sourceInfos,highlighted:!0}}:{...t,sourceInfos:{type:"loading-error"}}}case ob:{const i=t.sourceInfos?.type,{chunkId:s,knowledgeBaseType:u,title:c,content:d,highlighted:h,url:m}=r.payload,p=t.sourceInfos?.type==="loading"||t.sourceInfos?.type==="loaded"?t.sourceInfos?.chunkId:void 0;return p&&p!==s?t:i==="loading"||i==="loaded"&&h?{...t,sourceInfos:{type:"loaded",chunkId:s,knowledgeBaseType:u,title:c,content:d,highlighted:h,url:m}}:t}case Lh:return{...t,sourceInfos:void 0};case Cb:return{...t,showTranscriptMailOverlay:!t.showTranscriptMailOverlay};default:return t}},u1=(t,r)=>{const i=t.messages[t.messages.length-1],s=i?.text===r.text;return i&&i.sender.type===r.sender.type&&s?t:Object.assign({},t,{messages:t.messages.concat([r]),quickReplies:[]})},Ua=t=>{a8()?window.top?.postMessage(t,"*"):t.type==="webclient.change.url"&&window.open(t.url)},a8=()=>typeof window<"u"&&window.self!==window.top,c1={messages:[],quickReplies:[],isBotTyping:!1,showTranscriptMailOverlay:!1,conversationRating:{enabled:!1}},f_=jh({name:"intl",initialState:c_,reducers:{updateIntl:(t,r)=>{t.locale=r.payload.language,t.messages=r.payload.messages}}}),{updateIntl:i8}=f_.actions,s8=f_.reducer,l8={version:void 0,requiresUserAuthentication:!1,enableStartScreen:void 0,enableStandaloneView:!1,enableTranscriptExportEmail:!1,enableTranscriptExportPdf:!1,enableGeneralConditions:!1,enableSpeechSupport:!1,commands:[],menuItems:[]},d_=jh({name:"settings",initialState:l8,reducers:{setSettings(t,r){t.version&&t.version!==r.payload.version?(console.log("version changed, reloading chat window"),window.location.reload()):(t.version=r.payload.version,t.requiresUserAuthentication=r.payload.requiresUserAuthentication,t.enableStartScreen=r.payload.enableStartScreen,t.enableStandaloneView=r.payload.enableStandaloneView,t.enableTranscriptExportEmail=r.payload.enableTranscriptExportEmail,t.enableTranscriptExportPdf=r.payload.enableTranscriptExportPdf,t.enableGeneralConditions=r.payload.enableGeneralConditions,t.enableSpeechSupport=r.payload.enableSpeechSupport,t.commands=r.payload.commands,t.menuItems=r.payload.menuItems||[])}}}),{setSettings:o8}=d_.actions,u8=d_.reducer,c8=gb({settings:u8,chat:r8,startScreen:EO,connection:t8,intl:s8}),f8="bubble-chat",h_="state-last-saved-at",m_="state",d8=t=>{try{if(!p8())return;const r=f1(t,h_);if(m8(r))return;{const i=f1(t,m_);return i===null?void 0:JSON.parse(i)}}catch(r){console.error(r);return}},h8=(t,r)=>{try{const i=JSON.stringify(r);d1(t,m_,i);const s=new Date().toISOString();d1(t,h_,s)}catch(i){console.error(i)}},m8=t=>{if(t===null)return!1;const r=new Date(t);return r.setHours(r.getHours()+12),new Date>r},p8=()=>typeof localStorage<"u",f1=(t,r)=>{const i=p_(t,r);return localStorage.getItem(i)},d1=(t,r,i)=>{const s=p_(t,r);return localStorage.setItem(s,i)},p_=(t,r)=>`${f8}-${t}-${r}`,er=Object.create(null);er.open="0";er.close="1";er.ping="2";er.pong="3";er.message="4";er.upgrade="5";er.noop="6";const Yo=Object.create(null);Object.keys(er).forEach(t=>{Yo[er[t]]=t});const uh={type:"error",data:"parser error"},g_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",y_=typeof ArrayBuffer=="function",v_=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Qh=({type:t,data:r},i,s)=>g_&&r instanceof Blob?i?s(r):h1(r,s):y_&&(r instanceof ArrayBuffer||v_(r))?i?s(r):h1(new Blob([r]),s):s(er[t]+(r||"")),h1=(t,r)=>{const i=new FileReader;return i.onload=function(){const s=i.result.split(",")[1];r("b"+(s||""))},i.readAsDataURL(t)};function m1(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let jd;function g8(t,r){if(g_&&t.data instanceof Blob)return t.data.arrayBuffer().then(m1).then(r);if(y_&&(t.data instanceof ArrayBuffer||v_(t.data)))return r(m1(t.data));Qh(t,!1,i=>{jd||(jd=new TextEncoder),r(jd.encode(i))})}const p1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qs=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<p1.length;t++)Qs[p1.charCodeAt(t)]=t;const y8=t=>{let r=t.length*.75,i=t.length,s,u=0,c,d,h,m;t[t.length-1]==="="&&(r--,t[t.length-2]==="="&&r--);const p=new ArrayBuffer(r),y=new Uint8Array(p);for(s=0;s<i;s+=4)c=Qs[t.charCodeAt(s)],d=Qs[t.charCodeAt(s+1)],h=Qs[t.charCodeAt(s+2)],m=Qs[t.charCodeAt(s+3)],y[u++]=c<<2|d>>4,y[u++]=(d&15)<<4|h>>2,y[u++]=(h&3)<<6|m&63;return p},v8=typeof ArrayBuffer=="function",Kh=(t,r)=>{if(typeof t!="string")return{type:"message",data:b_(t,r)};const i=t.charAt(0);return i==="b"?{type:"message",data:b8(t.substring(1),r)}:Yo[i]?t.length>1?{type:Yo[i],data:t.substring(1)}:{type:Yo[i]}:uh},b8=(t,r)=>{if(v8){const i=y8(t);return b_(i,r)}else return{base64:!0,data:t}},b_=(t,r)=>{switch(r){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},__="",_8=(t,r)=>{const i=t.length,s=new Array(i);let u=0;t.forEach((c,d)=>{Qh(c,!1,h=>{s[d]=h,++u===i&&r(s.join(__))})})},E8=(t,r)=>{const i=t.split(__),s=[];for(let u=0;u<i.length;u++){const c=Kh(i[u],r);if(s.push(c),c.type==="error")break}return s};function S8(){return new TransformStream({transform(t,r){g8(t,i=>{const s=i.length;let u;if(s<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,s);else if(s<65536){u=new Uint8Array(3);const c=new DataView(u.buffer);c.setUint8(0,126),c.setUint16(1,s)}else{u=new Uint8Array(9);const c=new DataView(u.buffer);c.setUint8(0,127),c.setBigUint64(1,BigInt(s))}t.data&&typeof t.data!="string"&&(u[0]|=128),r.enqueue(u),r.enqueue(i)})}})}let Id;function Go(t){return t.reduce((r,i)=>r+i.length,0)}function ko(t,r){if(t[0].length===r)return t.shift();const i=new Uint8Array(r);let s=0;for(let u=0;u<r;u++)i[u]=t[0][s++],s===t[0].length&&(t.shift(),s=0);return t.length&&s<t[0].length&&(t[0]=t[0].slice(s)),i}function T8(t,r){Id||(Id=new TextDecoder);const i=[];let s=0,u=-1,c=!1;return new TransformStream({transform(d,h){for(i.push(d);;){if(s===0){if(Go(i)<1)break;const m=ko(i,1);c=(m[0]&128)===128,u=m[0]&127,u<126?s=3:u===126?s=1:s=2}else if(s===1){if(Go(i)<2)break;const m=ko(i,2);u=new DataView(m.buffer,m.byteOffset,m.length).getUint16(0),s=3}else if(s===2){if(Go(i)<8)break;const m=ko(i,8),p=new DataView(m.buffer,m.byteOffset,m.length),y=p.getUint32(0);if(y>Math.pow(2,21)-1){h.enqueue(uh);break}u=y*Math.pow(2,32)+p.getUint32(4),s=3}else{if(Go(i)<u)break;const m=ko(i,u);h.enqueue(Kh(c?m:Id.decode(m),r)),s=0}if(u===0||u>t){h.enqueue(uh);break}}}})}const E_=4;function ft(t){if(t)return A8(t)}function A8(t){for(var r in ft.prototype)t[r]=ft.prototype[r];return t}ft.prototype.on=ft.prototype.addEventListener=function(t,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(r),this};ft.prototype.once=function(t,r){function i(){this.off(t,i),r.apply(this,arguments)}return i.fn=r,this.on(t,i),this};ft.prototype.off=ft.prototype.removeListener=ft.prototype.removeAllListeners=ft.prototype.removeEventListener=function(t,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+t];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var s,u=0;u<i.length;u++)if(s=i[u],s===r||s.fn===r){i.splice(u,1);break}return i.length===0&&delete this._callbacks["$"+t],this};ft.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),i=this._callbacks["$"+t],s=1;s<arguments.length;s++)r[s-1]=arguments[s];if(i){i=i.slice(0);for(var s=0,u=i.length;s<u;++s)i[s].apply(this,r)}return this};ft.prototype.emitReserved=ft.prototype.emit;ft.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};ft.prototype.hasListeners=function(t){return!!this.listeners(t).length};const Eu=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,i)=>i(r,0),En=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),x8="arraybuffer";function S_(t,...r){return r.reduce((i,s)=>(t.hasOwnProperty(s)&&(i[s]=t[s]),i),{})}const O8=En.setTimeout,R8=En.clearTimeout;function Su(t,r){r.useNativeTimers?(t.setTimeoutFn=O8.bind(En),t.clearTimeoutFn=R8.bind(En)):(t.setTimeoutFn=En.setTimeout.bind(En),t.clearTimeoutFn=En.clearTimeout.bind(En))}const w8=1.33;function C8(t){return typeof t=="string"?N8(t):Math.ceil((t.byteLength||t.size)*w8)}function N8(t){let r=0,i=0;for(let s=0,u=t.length;s<u;s++)r=t.charCodeAt(s),r<128?i+=1:r<2048?i+=2:r<55296||r>=57344?i+=3:(s++,i+=4);return i}function T_(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function M8(t){let r="";for(let i in t)t.hasOwnProperty(i)&&(r.length&&(r+="&"),r+=encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return r}function D8(t){let r={},i=t.split("&");for(let s=0,u=i.length;s<u;s++){let c=i[s].split("=");r[decodeURIComponent(c[0])]=decodeURIComponent(c[1])}return r}class L8 extends Error{constructor(r,i,s){super(r),this.description=i,this.context=s,this.type="TransportError"}}class $h extends ft{constructor(r){super(),this.writable=!1,Su(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,i,s){return super.emitReserved("error",new L8(r,i,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(r){this.readyState==="open"&&this.write(r)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(r){const i=Kh(r,this.socket.binaryType);this.onPacket(i)}onPacket(r){super.emitReserved("packet",r)}onClose(r){this.readyState="closed",super.emitReserved("close",r)}pause(r){}createUri(r,i={}){return r+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const r=this.opts.hostname;return r.indexOf(":")===-1?r:"["+r+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(r){const i=M8(r);return i.length?"?"+i:""}}class B8 extends $h{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(r){this.readyState="pausing";const i=()=>{this.readyState="paused",r()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||i()})),this.writable||(s++,this.once("drain",function(){--s||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const i=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};E8(r,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const r=()=>{this.write([{type:"close"}])};this.readyState==="open"?r():this.once("open",r)}write(r){this.writable=!1,_8(r,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=T_()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(r,i)}}let A_=!1;try{A_=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const U8=A_;function H8(){}class j8 extends B8{constructor(r){if(super(r),typeof location<"u"){const i=location.protocol==="https:";let s=location.port;s||(s=i?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||s!==r.port}}doWrite(r,i){const s=this.request({method:"POST",data:r});s.on("success",i),s.on("error",(u,c)=>{this.onError("xhr post error",u,c)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(i,s)=>{this.onError("xhr poll error",i,s)}),this.pollXhr=r}}class Wn extends ft{constructor(r,i,s){super(),this.createRequest=r,Su(this,s),this._opts=s,this._method=s.method||"GET",this._uri=i,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var r;const i=S_(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(i);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let u in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(u)&&s.setRequestHeader(u,this._opts.extraHeaders[u])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var u;s.readyState===3&&((u=this._opts.cookieJar)===null||u===void 0||u.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(u){this.setTimeoutFn(()=>{this._onError(u)},0);return}typeof document<"u"&&(this._index=Wn.requestsCount++,Wn.requests[this._index]=this)}_onError(r){this.emitReserved("error",r,this._xhr),this._cleanup(!0)}_cleanup(r){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=H8,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Wn.requests[this._index],this._xhr=null}}_onLoad(){const r=this._xhr.responseText;r!==null&&(this.emitReserved("data",r),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Wn.requestsCount=0;Wn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",g1);else if(typeof addEventListener=="function"){const t="onpagehide"in En?"pagehide":"unload";addEventListener(t,g1,!1)}}function g1(){for(let t in Wn.requests)Wn.requests.hasOwnProperty(t)&&Wn.requests[t].abort()}const I8=function(){const t=x_({xdomain:!1});return t&&t.responseType!==null}();class z8 extends j8{constructor(r){super(r);const i=r&&r.forceBase64;this.supportsBinary=I8&&!i}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new Wn(x_,this.uri(),r)}}function x_(t){const r=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||U8))return new XMLHttpRequest}catch{}if(!r)try{return new En[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const O_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class G8 extends $h{get name(){return"websocket"}doOpen(){const r=this.uri(),i=this.opts.protocols,s=O_?{}:S_(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(r,i,s)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=r=>this.onClose({description:"websocket connection closed",context:r}),this.ws.onmessage=r=>this.onData(r.data),this.ws.onerror=r=>this.onError("websocket error",r)}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const s=r[i],u=i===r.length-1;Qh(s,this.supportsBinary,c=>{try{this.doWrite(s,c)}catch{}u&&Eu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const r=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=T_()),this.supportsBinary||(i.b64=1),this.createUri(r,i)}}const zd=En.WebSocket||En.MozWebSocket;class k8 extends G8{createSocket(r,i,s){return O_?new zd(r,i,s):i?new zd(r,i):new zd(r)}doWrite(r,i){this.ws.send(i)}}class q8 extends $h{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(r){return this.emitReserved("error",r)}this._transport.closed.then(()=>{this.onClose()}).catch(r=>{this.onError("webtransport error",r)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(r=>{const i=T8(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=r.readable.pipeThrough(i).getReader(),u=S8();u.readable.pipeTo(r.writable),this._writer=u.writable.getWriter();const c=()=>{s.read().then(({done:h,value:m})=>{h||(this.onPacket(m),c())}).catch(h=>{})};c();const d={type:"open"};this.query.sid&&(d.data=`{"sid":"${this.query.sid}"}`),this._writer.write(d).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const s=r[i],u=i===r.length-1;this._writer.write(s).then(()=>{u&&Eu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const F8={websocket:k8,webtransport:q8,polling:z8},V8=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,P8=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ch(t){if(t.length>8e3)throw"URI too long";const r=t,i=t.indexOf("["),s=t.indexOf("]");i!=-1&&s!=-1&&(t=t.substring(0,i)+t.substring(i,s).replace(/:/g,";")+t.substring(s,t.length));let u=V8.exec(t||""),c={},d=14;for(;d--;)c[P8[d]]=u[d]||"";return i!=-1&&s!=-1&&(c.source=r,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=Y8(c,c.path),c.queryKey=X8(c,c.query),c}function Y8(t,r){const i=/\/{2,9}/g,s=r.replace(i,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&s.splice(0,1),r.slice(-1)=="/"&&s.splice(s.length-1,1),s}function X8(t,r){const i={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,u,c){u&&(i[u]=c)}),i}const fh=typeof addEventListener=="function"&&typeof removeEventListener=="function",Xo=[];fh&&addEventListener("offline",()=>{Xo.forEach(t=>t())},!1);class la extends ft{constructor(r,i){if(super(),this.binaryType=x8,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,r&&typeof r=="object"&&(i=r,r=null),r){const s=ch(r);i.hostname=s.host,i.secure=s.protocol==="https"||s.protocol==="wss",i.port=s.port,s.query&&(i.query=s.query)}else i.host&&(i.hostname=ch(i.host).host);Su(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(s=>{const u=s.prototype.name;this.transports.push(u),this._transportsByName[u]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=D8(this.opts.query)),fh&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Xo.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const i=Object.assign({},this.opts.query);i.EIO=E_,i.transport=r,this.id&&(i.sid=this.id);const s=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[r]);return new this._transportsByName[r](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&la.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(r);i.open(),this.setTransport(i)}setTransport(r){this.transport&&this.transport.removeAllListeners(),this.transport=r,r.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",la.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",r),this.emitReserved("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=r.data,this._onError(i);break;case"message":this.emitReserved("data",r.data),this.emitReserved("message",r.data);break}}onHandshake(r){this.emitReserved("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this._pingInterval=r.pingInterval,this._pingTimeout=r.pingTimeout,this._maxPayload=r.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const r=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+r,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},r),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const r=this._getWritablePackets();this.transport.send(r),this._prevBufferLen=r.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let s=0;s<this.writeBuffer.length;s++){const u=this.writeBuffer[s].data;if(u&&(i+=C8(u)),s>0&&i>this._maxPayload)return this.writeBuffer.slice(0,s);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,Eu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,i,s){return this._sendPacket("message",r,i,s),this}send(r,i,s){return this._sendPacket("message",r,i,s),this}_sendPacket(r,i,s,u){if(typeof i=="function"&&(u=i,i=void 0),typeof s=="function"&&(u=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const c={type:r,data:i,options:s};this.emitReserved("packetCreate",c),this.writeBuffer.push(c),u&&this.once("flush",u),this.flush()}close(){const r=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),r()},s=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():r()}):this.upgrading?s():r()),this}_onError(r){if(la.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",r),this._onClose("transport error",r)}_onClose(r,i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),fh&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Xo.indexOf(this._offlineEventListener);s!==-1&&Xo.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,i),this.writeBuffer=[],this._prevBufferLen=0}}}la.protocol=E_;class Z8 extends la{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let r=0;r<this._upgrades.length;r++)this._probe(this._upgrades[r])}_probe(r){let i=this.createTransport(r),s=!1;la.priorWebsocketSuccess=!1;const u=()=>{s||(i.send([{type:"ping",data:"probe"}]),i.once("packet",E=>{if(!s)if(E.type==="pong"&&E.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;la.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(y(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const A=new Error("probe error");A.transport=i.name,this.emitReserved("upgradeError",A)}}))};function c(){s||(s=!0,y(),i.close(),i=null)}const d=E=>{const A=new Error("probe error: "+E);A.transport=i.name,c(),this.emitReserved("upgradeError",A)};function h(){d("transport closed")}function m(){d("socket closed")}function p(E){i&&E.name!==i.name&&c()}const y=()=>{i.removeListener("open",u),i.removeListener("error",d),i.removeListener("close",h),this.off("close",m),this.off("upgrading",p)};i.once("open",u),i.once("error",d),i.once("close",h),this.once("close",m),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{s||i.open()},200):i.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const i=[];for(let s=0;s<r.length;s++)~this.transports.indexOf(r[s])&&i.push(r[s]);return i}}let Q8=class extends Z8{constructor(r,i={}){const s=typeof r=="object"?r:i;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(u=>F8[u]).filter(u=>!!u)),super(r,s)}};function K8(t,r="",i){let s=t;i=i||typeof location<"u"&&location,t==null&&(t=i.protocol+"//"+i.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=i.protocol+t:t=i.host+t),/^(https?|wss?):\/\//.test(t)||(typeof i<"u"?t=i.protocol+"//"+t:t="https://"+t),s=ch(t)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const c=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+c+":"+s.port+r,s.href=s.protocol+"://"+c+(i&&i.port===s.port?"":":"+s.port),s}const $8=typeof ArrayBuffer=="function",W8=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,R_=Object.prototype.toString,J8=typeof Blob=="function"||typeof Blob<"u"&&R_.call(Blob)==="[object BlobConstructor]",eM=typeof File=="function"||typeof File<"u"&&R_.call(File)==="[object FileConstructor]";function Wh(t){return $8&&(t instanceof ArrayBuffer||W8(t))||J8&&t instanceof Blob||eM&&t instanceof File}function Zo(t,r){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let i=0,s=t.length;i<s;i++)if(Zo(t[i]))return!0;return!1}if(Wh(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Zo(t.toJSON(),!0);for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&Zo(t[i]))return!0;return!1}function tM(t){const r=[],i=t.data,s=t;return s.data=dh(i,r),s.attachments=r.length,{packet:s,buffers:r}}function dh(t,r){if(!t)return t;if(Wh(t)){const i={_placeholder:!0,num:r.length};return r.push(t),i}else if(Array.isArray(t)){const i=new Array(t.length);for(let s=0;s<t.length;s++)i[s]=dh(t[s],r);return i}else if(typeof t=="object"&&!(t instanceof Date)){const i={};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=dh(t[s],r));return i}return t}function nM(t,r){return t.data=hh(t.data,r),delete t.attachments,t}function hh(t,r){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<r.length)return r[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let i=0;i<t.length;i++)t[i]=hh(t[i],r);else if(typeof t=="object")for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(t[i]=hh(t[i],r));return t}const rM=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],aM=5;var Ce;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(Ce||(Ce={}));class iM{constructor(r){this.replacer=r}encode(r){return(r.type===Ce.EVENT||r.type===Ce.ACK)&&Zo(r)?this.encodeAsBinary({type:r.type===Ce.EVENT?Ce.BINARY_EVENT:Ce.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let i=""+r.type;return(r.type===Ce.BINARY_EVENT||r.type===Ce.BINARY_ACK)&&(i+=r.attachments+"-"),r.nsp&&r.nsp!=="/"&&(i+=r.nsp+","),r.id!=null&&(i+=r.id),r.data!=null&&(i+=JSON.stringify(r.data,this.replacer)),i}encodeAsBinary(r){const i=tM(r),s=this.encodeAsString(i.packet),u=i.buffers;return u.unshift(s),u}}function y1(t){return Object.prototype.toString.call(t)==="[object Object]"}class Jh extends ft{constructor(r){super(),this.reviver=r}add(r){let i;if(typeof r=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(r);const s=i.type===Ce.BINARY_EVENT;s||i.type===Ce.BINARY_ACK?(i.type=s?Ce.EVENT:Ce.ACK,this.reconstructor=new sM(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(Wh(r)||r.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(r),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+r)}decodeString(r){let i=0;const s={type:Number(r.charAt(0))};if(Ce[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===Ce.BINARY_EVENT||s.type===Ce.BINARY_ACK){const c=i+1;for(;r.charAt(++i)!=="-"&&i!=r.length;);const d=r.substring(c,i);if(d!=Number(d)||r.charAt(i)!=="-")throw new Error("Illegal attachments");s.attachments=Number(d)}if(r.charAt(i+1)==="/"){const c=i+1;for(;++i&&!(r.charAt(i)===","||i===r.length););s.nsp=r.substring(c,i)}else s.nsp="/";const u=r.charAt(i+1);if(u!==""&&Number(u)==u){const c=i+1;for(;++i;){const d=r.charAt(i);if(d==null||Number(d)!=d){--i;break}if(i===r.length)break}s.id=Number(r.substring(c,i+1))}if(r.charAt(++i)){const c=this.tryParse(r.substr(i));if(Jh.isPayloadValid(s.type,c))s.data=c;else throw new Error("invalid payload")}return s}tryParse(r){try{return JSON.parse(r,this.reviver)}catch{return!1}}static isPayloadValid(r,i){switch(r){case Ce.CONNECT:return y1(i);case Ce.DISCONNECT:return i===void 0;case Ce.CONNECT_ERROR:return typeof i=="string"||y1(i);case Ce.EVENT:case Ce.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&rM.indexOf(i[0])===-1);case Ce.ACK:case Ce.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class sM{constructor(r){this.packet=r,this.buffers=[],this.reconPack=r}takeBinaryData(r){if(this.buffers.push(r),this.buffers.length===this.reconPack.attachments){const i=nM(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const lM=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Jh,Encoder:iM,get PacketType(){return Ce},protocol:aM},Symbol.toStringTag,{value:"Module"}));function jn(t,r,i){return t.on(r,i),function(){t.off(r,i)}}const oM=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class w_ extends ft{constructor(r,i,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=r,this.nsp=i,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const r=this.io;this.subs=[jn(r,"open",this.onopen.bind(this)),jn(r,"packet",this.onpacket.bind(this)),jn(r,"error",this.onerror.bind(this)),jn(r,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...r){return r.unshift("message"),this.emit.apply(this,r),this}emit(r,...i){var s,u,c;if(oM.hasOwnProperty(r))throw new Error('"'+r.toString()+'" is a reserved event name');if(i.unshift(r),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const d={type:Ce.EVENT,data:i};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const y=this.ids++,E=i.pop();this._registerAckCallback(y,E),d.id=y}const h=(u=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||u===void 0?void 0:u.writable,m=this.connected&&!(!((c=this.io.engine)===null||c===void 0)&&c._hasPingExpired());return this.flags.volatile&&!h||(m?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d)),this.flags={},this}_registerAckCallback(r,i){var s;const u=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(u===void 0){this.acks[r]=i;return}const c=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===r&&this.sendBuffer.splice(h,1);i.call(this,new Error("operation has timed out"))},u),d=(...h)=>{this.io.clearTimeoutFn(c),i.apply(this,h)};d.withError=!0,this.acks[r]=d}emitWithAck(r,...i){return new Promise((s,u)=>{const c=(d,h)=>d?u(d):s(h);c.withError=!0,i.push(c),this.emit(r,...i)})}_addToQueue(r){let i;typeof r[r.length-1]=="function"&&(i=r.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((u,...c)=>s!==this._queue[0]?void 0:(u!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(u)):(this._queue.shift(),i&&i(null,...c)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(r=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!r||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(r){r.nsp=this.nsp,this.io._packet(r)}onopen(){typeof this.auth=="function"?this.auth(r=>{this._sendConnectPacket(r)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(r){this.packet({type:Ce.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},r):r})}onerror(r){this.connected||this.emitReserved("connect_error",r)}onclose(r,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",r,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(r=>{if(!this.sendBuffer.some(s=>String(s.id)===r)){const s=this.acks[r];delete this.acks[r],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case Ce.CONNECT:r.data&&r.data.sid?this.onconnect(r.data.sid,r.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ce.EVENT:case Ce.BINARY_EVENT:this.onevent(r);break;case Ce.ACK:case Ce.BINARY_ACK:this.onack(r);break;case Ce.DISCONNECT:this.ondisconnect();break;case Ce.CONNECT_ERROR:this.destroy();const s=new Error(r.data.message);s.data=r.data.data,this.emitReserved("connect_error",s);break}}onevent(r){const i=r.data||[];r.id!=null&&i.push(this.ack(r.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(r){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const s of i)s.apply(this,r)}super.emit.apply(this,r),this._pid&&r.length&&typeof r[r.length-1]=="string"&&(this._lastOffset=r[r.length-1])}ack(r){const i=this;let s=!1;return function(...u){s||(s=!0,i.packet({type:Ce.ACK,id:r,data:u}))}}onack(r){const i=this.acks[r.id];typeof i=="function"&&(delete this.acks[r.id],i.withError&&r.data.unshift(null),i.apply(this,r.data))}onconnect(r,i){this.id=r,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(r=>this.emitEvent(r)),this.receiveBuffer=[],this.sendBuffer.forEach(r=>{this.notifyOutgoingListeners(r),this.packet(r)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(r=>r()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ce.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(r){return this.flags.compress=r,this}get volatile(){return this.flags.volatile=!0,this}timeout(r){return this.flags.timeout=r,this}onAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(r),this}prependAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(r),this}offAny(r){if(!this._anyListeners)return this;if(r){const i=this._anyListeners;for(let s=0;s<i.length;s++)if(r===i[s])return i.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(r),this}prependAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(r),this}offAnyOutgoing(r){if(!this._anyOutgoingListeners)return this;if(r){const i=this._anyOutgoingListeners;for(let s=0;s<i.length;s++)if(r===i[s])return i.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(r){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const s of i)s.apply(this,r.data)}}}function Mi(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Mi.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),i=Math.floor(r*this.jitter*t);t=(Math.floor(r*10)&1)==0?t-i:t+i}return Math.min(t,this.max)|0};Mi.prototype.reset=function(){this.attempts=0};Mi.prototype.setMin=function(t){this.ms=t};Mi.prototype.setMax=function(t){this.max=t};Mi.prototype.setJitter=function(t){this.jitter=t};class mh extends ft{constructor(r,i){var s;super(),this.nsps={},this.subs=[],r&&typeof r=="object"&&(i=r,r=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Su(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((s=i.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Mi({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=r;const u=i.parser||lM;this.encoder=new u.Encoder,this.decoder=new u.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(r){return arguments.length?(this._reconnection=!!r,r||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(r){return r===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=r,this)}reconnectionDelay(r){var i;return r===void 0?this._reconnectionDelay:(this._reconnectionDelay=r,(i=this.backoff)===null||i===void 0||i.setMin(r),this)}randomizationFactor(r){var i;return r===void 0?this._randomizationFactor:(this._randomizationFactor=r,(i=this.backoff)===null||i===void 0||i.setJitter(r),this)}reconnectionDelayMax(r){var i;return r===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=r,(i=this.backoff)===null||i===void 0||i.setMax(r),this)}timeout(r){return arguments.length?(this._timeout=r,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(r){if(~this._readyState.indexOf("open"))return this;this.engine=new Q8(this.uri,this.opts);const i=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const u=jn(i,"open",function(){s.onopen(),r&&r()}),c=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),r?r(h):this.maybeReconnectOnOpen()},d=jn(i,"error",c);if(this._timeout!==!1){const h=this._timeout,m=this.setTimeoutFn(()=>{u(),c(new Error("timeout")),i.close()},h);this.opts.autoUnref&&m.unref(),this.subs.push(()=>{this.clearTimeoutFn(m)})}return this.subs.push(u),this.subs.push(d),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(jn(r,"ping",this.onping.bind(this)),jn(r,"data",this.ondata.bind(this)),jn(r,"error",this.onerror.bind(this)),jn(r,"close",this.onclose.bind(this)),jn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(r){try{this.decoder.add(r)}catch(i){this.onclose("parse error",i)}}ondecoded(r){Eu(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,i){let s=this.nsps[r];return s?this._autoConnect&&!s.active&&s.connect():(s=new w_(this,r,i),this.nsps[r]=s),s}_destroy(r){const i=Object.keys(this.nsps);for(const s of i)if(this.nsps[s].active)return;this._close()}_packet(r){const i=this.encoder.encode(r);for(let s=0;s<i.length;s++)this.engine.write(i[s],r.options)}cleanup(){this.subs.forEach(r=>r()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(r,i){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",r,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const r=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{r.skipReconnect||(this.emitReserved("reconnect_attempt",r.backoff.attempts),!r.skipReconnect&&r.open(u=>{u?(r._reconnecting=!1,r.reconnect(),this.emitReserved("reconnect_error",u)):r.onreconnect()}))},i);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const Ys={};function Qo(t,r){typeof t=="object"&&(r=t,t=void 0),r=r||{};const i=K8(t,r.path||"/socket.io"),s=i.source,u=i.id,c=i.path,d=Ys[u]&&c in Ys[u].nsps,h=r.forceNew||r["force new connection"]||r.multiplex===!1||d;let m;return h?m=new mh(s,r):(Ys[u]||(Ys[u]=new mh(s,r)),m=Ys[u]),i.query&&!r.query&&(r.query=i.queryKey),m.socket(i.path,r)}Object.assign(Qo,{Manager:mh,Socket:w_,io:Qo,connect:Qo});const uM=[Te.ActionTypes.MESSAGE_TO_GUEST,Te.ActionTypes.EVENT_TO_GUEST,Te.ActionTypes.TYPING_ON,Te.ActionTypes.TYPING_OFF,Te.ActionTypes.RESTART_CHAT_REQUEST,...xO,..._x,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],cM=({dispatch:t,getState:r})=>i=>{let s=null;return u=>{const c=i(u);if(u.type===zh){s?.disconnect(),t(wO());const d=`/chat?${uu.stringify(u.querystrings)}`;s=Qo(`/${u.clientName}${d}`),s.on("action",t),s.on("connect",()=>t(CO())),s.on("disconnect",()=>t(NO())),s.on("reconnect",()=>t(MO())),s.on("set-translations",(h,m)=>{t(i8({language:h,messages:JN(h,m)}))}),s.on("set-settings",h=>{t(o8(h))}),s.on("enable-conversation-rating",h=>t(xx(h))),s.on("speech-transcription",h=>t(Sx(h))),s.on("restore-client-state",h=>{t(RO(h.sessionId)),t(Rx(h.messages))}),s.on("expand-window",({devices:h,initial:m=!1})=>{t({type:ub,devices:h,initial:m})}),s.on("restart-chat",()=>{t(gu(u.clientName,u.querystrings))}),s.on("login-success",h=>{t(yO({loginToken:h.loginToken}))})}else if(u.type==="start-screen/requestLogin")s?.emit("login-requested",u.payload);else if(u.type===mu)s?.emit("start-chat",u.payload);else if(u.type===pu)s?.emit("terminate-session",u.payload);else if(u.type===bx)s?.emit("get-started",JSON.stringify(u));else if(u.type===wh)s?.emit("audio-message",u.buffer);else if(u.type===Te.ActionTypes.CONVERSATION_RATING_FROM_GUEST)s?.emit("conversation-rating",u.payload);else if(u.type===fb){const{connection:{sessionId:d}}=r();window.location.href=`/transcript-pdf/${d}`}else uM.indexOf(u.type)===-1&&u.meta===void 0&&s&&s.emit("action",JSON.stringify(u));return c}},C_=Kb(),fM={...d8(C_),intl:c_},ph=rO({middleware:t=>t().concat(cM),reducer:c8,preloadedState:fM});ph.subscribe(PN(()=>{const t=ph.getState();h8(C_,{connection:t.connection,startScreen:t.startScreen})},1e3));const dM=document.getElementById("root"),hM=P2.createRoot(dM);hM.render(v.jsx(VS,{store:ph,children:v.jsx(MN,{})}));
124
- //# sourceMappingURL=index-Bjs8GtaP.js.map
123
+ - Non inserire dati personali nella finestra di chat (password, data di nascita, ecc.).`,"general-conditions.accept-conditions-note":"Utilizzando la chat si accettano le condizioni d'uso.","block-user-input.title":"Attendere la risposta del chatbot.","conversation-rating.call-to-action.title":"Valuta questa chat","conversation-rating.overlay.title":"Quanto sei soddisfatto di questa chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Inserisci qui il tuo feedback (opzionale)","conversation-rating.overlay.star.very-bad":"Molto male","conversation-rating.overlay.star.very-good":"Molto buono","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"La media non è il mio obiettivo, cosa posso ancora migliorare?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Anche l'assenza è finita. Cosa posso migliorare per ottenere tutte le stelle la prossima volta?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfetto! Allora spero di potervi consigliare ancora una volta bene.","conversation-rating.overlay.bot-message.submit-feedback":"Grazie mille per il feedback. Mi impegno costantemente per migliorare.","conversation-rating.overlay.action.submit":"Invia","conversation-rating.overlay.action.back-to-chat":"Chiudere","conversation-rating.overlay.action.close-chat":"Minimizzare la chat","conversation-rating.overlay.action.cancel":"Annulla","start-screen.intro":"","start-screen.start-chat":"Avviare la chat","start-screen.waiting-for-login":"In attesa di login ...","header.close-chat":"Minimizzare la chat","header.menu.title":"Menu","header.menu.restart-chat":"Riavviare la chat","header.menu.expand-chat-window":"Espandere la finestra","header.menu.download-transcript":"Scaricare la trascrizione","header.menu.send-transcript":"Inviare la trascrizione","header.menu.export-transcript":"Esportare la trascrizione","header.menu.rate-conversation":"Valutare la conversazione","source-infos.close":"Chiudere","source-infos.open-source":"Fonte aperta","source-infos.error.title":"Errore","source-infos.error.info":"Ops! Qualcosa è andato storto. Riprovare o contattare l'assistenza se il problema persiste.","source-infos.highlight-loading.title":"Il contenuto rilevante è evidenziato...","source-infos.highlight-loading.description":"Un momento - la fonte è in fase di analisi","commands.show-more.action":"Di più","commands.show-more.tooltip":"Mostra più comandi","commands.show-less.action":"Meno","commands.show-less.tooltip":"Mostra meno comandi"},WN=["de","en","fr","it"],c_={locale:"de",messages:u_},JN=(t,r)=>{if(WN.includes(t)){const i=e8(t),s=ZN(r);return{...i,...s}}return r},e8=t=>{switch(t.toString()){case"en":return QN;case"fr":return KN;case"it":return $N;default:return u_}},t8=(t=n8,r)=>{switch(r.type){case Gh:return Object.assign({},t,{connectionState:Ia.CONNECTING});case kh:return Object.assign({},t,{connectionState:Ia.CONNECTED});case qh:return Object.assign({},t,{connectionState:Ia.DISCONNECTED});case Fh:return Object.assign({},t,{connectionState:Ia.RECONNECTED});case Vh:return Object.assign({},t,{sessionId:r.sessionId});case mu:return Object.assign({},t,{sessionId:r.payload.sessionId,userId:r.payload.userId});case pu:return Object.assign({},t,{sessionId:void 0});default:return t}},n8={connectionState:Ia.DISCONNECTED,sessionId:void 0,userId:void 0},r8=(t=c1,r)=>{switch(r.type){case wb:return c1;case mu:return Ua({type:"webclient.chat.started"}),t;case pu:return Ua({type:"webclient.chat.ended"}),t;case Te.ActionTypes.TYPING_ON:return Object.assign({},t,{isBotTyping:!0});case Te.ActionTypes.TYPING_OFF:return Object.assign({},t,{isBotTyping:!1});case Te.ActionTypes.MESSAGE_FROM_GUEST:case Te.ActionTypes.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return u1(t,r.message);case Te.ActionTypes.MESSAGE_TO_GUEST:{Ua(r);const i=Object.assign({},r.message,{_id:r.meta.actionId}),s=t.messages.filter(u=>u._id===r.meta.actionId).length>0;return Object.assign({},t,{isBotTyping:!1,messages:s?t.messages:t.messages.concat([i]),quickReplies:i.quickReplies?i.quickReplies:[]})}case Rh:{const i=r.messages,s=i.length?i[i.length-1]:void 0;return Object.assign({},t,{isBotTyping:!1,messages:i,quickReplies:s?.quickReplies||[]})}case Oh:return Ua(r.message),t;case Te.ActionTypes.EVENT_TO_GUEST:return Ua(r.event),t;case Te.ActionTypes.DRAWER_OPEN:return Object.assign({},t,{drawerContentUrl:r.payload.parameters.contentUrl});case Te.ActionTypes.DRAWER_CLOSE:return Object.assign({},t,{drawerContentUrl:void 0});case Te.ActionTypes.GUEST_LOCALE_CHANGED:return Object.assign({},t,{locale:r.payload.locale});case ub:return Ua(r),t;case cb:return Ua(r),{...t,conversationRating:{...t.conversationRating,opener:void 0}};case Ch:{const i=new Te.TextMessage(r.transcription,new Te.GuestUser),s=Object.assign({},i,{_id:$o()});return u1(t,s)}case Te.ActionTypes.TRANSCRIPT_ITEM_GUEST_REACTION:{const i=t.messages.map(s=>s._id===r.payload.actionId?Object.assign({},s,{reaction:r.payload.reaction}):s);return Object.assign({},t,{messages:i})}case Nh:{const i={enabled:!0,rating:r.payload.rating};return Object.assign({},t,{conversationRating:i})}case Te.ActionTypes.CONVERSATION_RATING_FROM_GUEST:{const i={...t.conversationRating,rating:r.payload};return Object.assign({},t,{conversationRating:i})}case Nb:{const i={...t.conversationRating,opener:r.payload.opener,...r.payload.defaultRating?{rating:{value:r.payload.defaultRating,feedback:t.conversationRating.rating?.feedback||""}}:{}};return Object.assign({},t,{conversationRating:i})}case Mb:{const i={...t.conversationRating,opener:void 0};return Object.assign({},t,{conversationRating:i})}case Dh:return{...t,sourceInfos:{type:"loading",chunkId:r.payload.chunkId}};case Mh:{const{highlighted:i}=r.payload;return t.sourceInfos?.type==="loaded"&&i?{...t,sourceInfos:{...t.sourceInfos,highlighted:!0}}:{...t,sourceInfos:{type:"loading-error"}}}case ob:{const i=t.sourceInfos?.type,{chunkId:s,knowledgeBaseType:u,title:c,content:d,highlighted:h,url:m}=r.payload,p=t.sourceInfos?.type==="loading"||t.sourceInfos?.type==="loaded"?t.sourceInfos?.chunkId:void 0;return p&&p!==s?t:i==="loading"||i==="loaded"&&h?{...t,sourceInfos:{type:"loaded",chunkId:s,knowledgeBaseType:u,title:c,content:d,highlighted:h,url:m}}:t}case Lh:return{...t,sourceInfos:void 0};case Cb:return{...t,showTranscriptMailOverlay:!t.showTranscriptMailOverlay};default:return t}},u1=(t,r)=>{const i=t.messages[t.messages.length-1],s=i?.text===r.text;return i&&i.sender.type===r.sender.type&&s?t:Object.assign({},t,{messages:t.messages.concat([r]),quickReplies:[]})},Ua=t=>{a8()?window.top?.postMessage(t,"*"):t.type==="webclient.change.url"&&window.open(t.url)},a8=()=>typeof window<"u"&&window.self!==window.top,c1={messages:[],quickReplies:[],isBotTyping:!1,showTranscriptMailOverlay:!1,conversationRating:{enabled:!1}},f_=jh({name:"intl",initialState:c_,reducers:{updateIntl:(t,r)=>{t.locale=r.payload.language,t.messages=r.payload.messages}}}),{updateIntl:i8}=f_.actions,s8=f_.reducer,l8={version:void 0,requiresUserAuthentication:!1,enableStartScreen:void 0,enableStandaloneView:!1,enableTranscriptExportEmail:!1,enableTranscriptExportPdf:!1,enableGeneralConditions:!1,enableSpeechSupport:!1,commands:[],menuItems:[]},d_=jh({name:"settings",initialState:l8,reducers:{setSettings(t,r){t.version&&t.version!==r.payload.version?(console.log("version changed, reloading chat window"),window.location.reload()):(t.version=r.payload.version,t.requiresUserAuthentication=r.payload.requiresUserAuthentication,t.enableStartScreen=r.payload.enableStartScreen,t.enableStandaloneView=r.payload.enableStandaloneView,t.enableTranscriptExportEmail=r.payload.enableTranscriptExportEmail,t.enableTranscriptExportPdf=r.payload.enableTranscriptExportPdf,t.enableGeneralConditions=r.payload.enableGeneralConditions,t.enableSpeechSupport=r.payload.enableSpeechSupport,t.commands=r.payload.commands,t.menuItems=r.payload.menuItems||[])}}}),{setSettings:o8}=d_.actions,u8=d_.reducer,c8=gb({settings:u8,chat:r8,startScreen:EO,connection:t8,intl:s8}),f8="bubble-chat",h_="state-last-saved-at",m_="state",d8=t=>{try{if(!p8())return;const r=f1(t,h_);if(m8(r))return;{const i=f1(t,m_);return i===null?void 0:JSON.parse(i)}}catch(r){console.error(r);return}},h8=(t,r)=>{try{const i=JSON.stringify(r);d1(t,m_,i);const s=new Date().toISOString();d1(t,h_,s)}catch(i){console.error(i)}},m8=t=>{if(t===null)return!1;const r=new Date(t);return r.setHours(r.getHours()+12),new Date>r},p8=()=>typeof localStorage<"u",f1=(t,r)=>{const i=p_(t,r);return localStorage.getItem(i)},d1=(t,r,i)=>{const s=p_(t,r);return localStorage.setItem(s,i)},p_=(t,r)=>`${f8}-${t}-${r}`,er=Object.create(null);er.open="0";er.close="1";er.ping="2";er.pong="3";er.message="4";er.upgrade="5";er.noop="6";const Yo=Object.create(null);Object.keys(er).forEach(t=>{Yo[er[t]]=t});const uh={type:"error",data:"parser error"},g_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",y_=typeof ArrayBuffer=="function",v_=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Qh=({type:t,data:r},i,s)=>g_&&r instanceof Blob?i?s(r):h1(r,s):y_&&(r instanceof ArrayBuffer||v_(r))?i?s(r):h1(new Blob([r]),s):s(er[t]+(r||"")),h1=(t,r)=>{const i=new FileReader;return i.onload=function(){const s=i.result.split(",")[1];r("b"+(s||""))},i.readAsDataURL(t)};function m1(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let jd;function g8(t,r){if(g_&&t.data instanceof Blob)return t.data.arrayBuffer().then(m1).then(r);if(y_&&(t.data instanceof ArrayBuffer||v_(t.data)))return r(m1(t.data));Qh(t,!1,i=>{jd||(jd=new TextEncoder),r(jd.encode(i))})}const p1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qs=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<p1.length;t++)Qs[p1.charCodeAt(t)]=t;const y8=t=>{let r=t.length*.75,i=t.length,s,u=0,c,d,h,m;t[t.length-1]==="="&&(r--,t[t.length-2]==="="&&r--);const p=new ArrayBuffer(r),y=new Uint8Array(p);for(s=0;s<i;s+=4)c=Qs[t.charCodeAt(s)],d=Qs[t.charCodeAt(s+1)],h=Qs[t.charCodeAt(s+2)],m=Qs[t.charCodeAt(s+3)],y[u++]=c<<2|d>>4,y[u++]=(d&15)<<4|h>>2,y[u++]=(h&3)<<6|m&63;return p},v8=typeof ArrayBuffer=="function",Kh=(t,r)=>{if(typeof t!="string")return{type:"message",data:b_(t,r)};const i=t.charAt(0);return i==="b"?{type:"message",data:b8(t.substring(1),r)}:Yo[i]?t.length>1?{type:Yo[i],data:t.substring(1)}:{type:Yo[i]}:uh},b8=(t,r)=>{if(v8){const i=y8(t);return b_(i,r)}else return{base64:!0,data:t}},b_=(t,r)=>{switch(r){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},__="",_8=(t,r)=>{const i=t.length,s=new Array(i);let u=0;t.forEach((c,d)=>{Qh(c,!1,h=>{s[d]=h,++u===i&&r(s.join(__))})})},E8=(t,r)=>{const i=t.split(__),s=[];for(let u=0;u<i.length;u++){const c=Kh(i[u],r);if(s.push(c),c.type==="error")break}return s};function S8(){return new TransformStream({transform(t,r){g8(t,i=>{const s=i.length;let u;if(s<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,s);else if(s<65536){u=new Uint8Array(3);const c=new DataView(u.buffer);c.setUint8(0,126),c.setUint16(1,s)}else{u=new Uint8Array(9);const c=new DataView(u.buffer);c.setUint8(0,127),c.setBigUint64(1,BigInt(s))}t.data&&typeof t.data!="string"&&(u[0]|=128),r.enqueue(u),r.enqueue(i)})}})}let Id;function Go(t){return t.reduce((r,i)=>r+i.length,0)}function ko(t,r){if(t[0].length===r)return t.shift();const i=new Uint8Array(r);let s=0;for(let u=0;u<r;u++)i[u]=t[0][s++],s===t[0].length&&(t.shift(),s=0);return t.length&&s<t[0].length&&(t[0]=t[0].slice(s)),i}function T8(t,r){Id||(Id=new TextDecoder);const i=[];let s=0,u=-1,c=!1;return new TransformStream({transform(d,h){for(i.push(d);;){if(s===0){if(Go(i)<1)break;const m=ko(i,1);c=(m[0]&128)===128,u=m[0]&127,u<126?s=3:u===126?s=1:s=2}else if(s===1){if(Go(i)<2)break;const m=ko(i,2);u=new DataView(m.buffer,m.byteOffset,m.length).getUint16(0),s=3}else if(s===2){if(Go(i)<8)break;const m=ko(i,8),p=new DataView(m.buffer,m.byteOffset,m.length),y=p.getUint32(0);if(y>Math.pow(2,21)-1){h.enqueue(uh);break}u=y*Math.pow(2,32)+p.getUint32(4),s=3}else{if(Go(i)<u)break;const m=ko(i,u);h.enqueue(Kh(c?m:Id.decode(m),r)),s=0}if(u===0||u>t){h.enqueue(uh);break}}}})}const E_=4;function ft(t){if(t)return A8(t)}function A8(t){for(var r in ft.prototype)t[r]=ft.prototype[r];return t}ft.prototype.on=ft.prototype.addEventListener=function(t,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(r),this};ft.prototype.once=function(t,r){function i(){this.off(t,i),r.apply(this,arguments)}return i.fn=r,this.on(t,i),this};ft.prototype.off=ft.prototype.removeListener=ft.prototype.removeAllListeners=ft.prototype.removeEventListener=function(t,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+t];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var s,u=0;u<i.length;u++)if(s=i[u],s===r||s.fn===r){i.splice(u,1);break}return i.length===0&&delete this._callbacks["$"+t],this};ft.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),i=this._callbacks["$"+t],s=1;s<arguments.length;s++)r[s-1]=arguments[s];if(i){i=i.slice(0);for(var s=0,u=i.length;s<u;++s)i[s].apply(this,r)}return this};ft.prototype.emitReserved=ft.prototype.emit;ft.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};ft.prototype.hasListeners=function(t){return!!this.listeners(t).length};const Eu=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,i)=>i(r,0),En=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),x8="arraybuffer";function S_(t,...r){return r.reduce((i,s)=>(t.hasOwnProperty(s)&&(i[s]=t[s]),i),{})}const O8=En.setTimeout,R8=En.clearTimeout;function Su(t,r){r.useNativeTimers?(t.setTimeoutFn=O8.bind(En),t.clearTimeoutFn=R8.bind(En)):(t.setTimeoutFn=En.setTimeout.bind(En),t.clearTimeoutFn=En.clearTimeout.bind(En))}const w8=1.33;function C8(t){return typeof t=="string"?N8(t):Math.ceil((t.byteLength||t.size)*w8)}function N8(t){let r=0,i=0;for(let s=0,u=t.length;s<u;s++)r=t.charCodeAt(s),r<128?i+=1:r<2048?i+=2:r<55296||r>=57344?i+=3:(s++,i+=4);return i}function T_(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function M8(t){let r="";for(let i in t)t.hasOwnProperty(i)&&(r.length&&(r+="&"),r+=encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return r}function D8(t){let r={},i=t.split("&");for(let s=0,u=i.length;s<u;s++){let c=i[s].split("=");r[decodeURIComponent(c[0])]=decodeURIComponent(c[1])}return r}class L8 extends Error{constructor(r,i,s){super(r),this.description=i,this.context=s,this.type="TransportError"}}class $h extends ft{constructor(r){super(),this.writable=!1,Su(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,i,s){return super.emitReserved("error",new L8(r,i,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(r){this.readyState==="open"&&this.write(r)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(r){const i=Kh(r,this.socket.binaryType);this.onPacket(i)}onPacket(r){super.emitReserved("packet",r)}onClose(r){this.readyState="closed",super.emitReserved("close",r)}pause(r){}createUri(r,i={}){return r+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const r=this.opts.hostname;return r.indexOf(":")===-1?r:"["+r+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(r){const i=M8(r);return i.length?"?"+i:""}}class B8 extends $h{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(r){this.readyState="pausing";const i=()=>{this.readyState="paused",r()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||i()})),this.writable||(s++,this.once("drain",function(){--s||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const i=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};E8(r,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const r=()=>{this.write([{type:"close"}])};this.readyState==="open"?r():this.once("open",r)}write(r){this.writable=!1,_8(r,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=T_()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(r,i)}}let A_=!1;try{A_=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const U8=A_;function H8(){}class j8 extends B8{constructor(r){if(super(r),typeof location<"u"){const i=location.protocol==="https:";let s=location.port;s||(s=i?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||s!==r.port}}doWrite(r,i){const s=this.request({method:"POST",data:r});s.on("success",i),s.on("error",(u,c)=>{this.onError("xhr post error",u,c)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(i,s)=>{this.onError("xhr poll error",i,s)}),this.pollXhr=r}}class Wn extends ft{constructor(r,i,s){super(),this.createRequest=r,Su(this,s),this._opts=s,this._method=s.method||"GET",this._uri=i,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var r;const i=S_(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(i);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let u in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(u)&&s.setRequestHeader(u,this._opts.extraHeaders[u])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var u;s.readyState===3&&((u=this._opts.cookieJar)===null||u===void 0||u.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(u){this.setTimeoutFn(()=>{this._onError(u)},0);return}typeof document<"u"&&(this._index=Wn.requestsCount++,Wn.requests[this._index]=this)}_onError(r){this.emitReserved("error",r,this._xhr),this._cleanup(!0)}_cleanup(r){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=H8,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Wn.requests[this._index],this._xhr=null}}_onLoad(){const r=this._xhr.responseText;r!==null&&(this.emitReserved("data",r),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Wn.requestsCount=0;Wn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",g1);else if(typeof addEventListener=="function"){const t="onpagehide"in En?"pagehide":"unload";addEventListener(t,g1,!1)}}function g1(){for(let t in Wn.requests)Wn.requests.hasOwnProperty(t)&&Wn.requests[t].abort()}const I8=function(){const t=x_({xdomain:!1});return t&&t.responseType!==null}();class z8 extends j8{constructor(r){super(r);const i=r&&r.forceBase64;this.supportsBinary=I8&&!i}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new Wn(x_,this.uri(),r)}}function x_(t){const r=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||U8))return new XMLHttpRequest}catch{}if(!r)try{return new En[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const O_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class G8 extends $h{get name(){return"websocket"}doOpen(){const r=this.uri(),i=this.opts.protocols,s=O_?{}:S_(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(r,i,s)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=r=>this.onClose({description:"websocket connection closed",context:r}),this.ws.onmessage=r=>this.onData(r.data),this.ws.onerror=r=>this.onError("websocket error",r)}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const s=r[i],u=i===r.length-1;Qh(s,this.supportsBinary,c=>{try{this.doWrite(s,c)}catch{}u&&Eu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const r=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=T_()),this.supportsBinary||(i.b64=1),this.createUri(r,i)}}const zd=En.WebSocket||En.MozWebSocket;class k8 extends G8{createSocket(r,i,s){return O_?new zd(r,i,s):i?new zd(r,i):new zd(r)}doWrite(r,i){this.ws.send(i)}}class q8 extends $h{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(r){return this.emitReserved("error",r)}this._transport.closed.then(()=>{this.onClose()}).catch(r=>{this.onError("webtransport error",r)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(r=>{const i=T8(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=r.readable.pipeThrough(i).getReader(),u=S8();u.readable.pipeTo(r.writable),this._writer=u.writable.getWriter();const c=()=>{s.read().then(({done:h,value:m})=>{h||(this.onPacket(m),c())}).catch(h=>{})};c();const d={type:"open"};this.query.sid&&(d.data=`{"sid":"${this.query.sid}"}`),this._writer.write(d).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const s=r[i],u=i===r.length-1;this._writer.write(s).then(()=>{u&&Eu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const F8={websocket:k8,webtransport:q8,polling:z8},V8=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,P8=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ch(t){if(t.length>8e3)throw"URI too long";const r=t,i=t.indexOf("["),s=t.indexOf("]");i!=-1&&s!=-1&&(t=t.substring(0,i)+t.substring(i,s).replace(/:/g,";")+t.substring(s,t.length));let u=V8.exec(t||""),c={},d=14;for(;d--;)c[P8[d]]=u[d]||"";return i!=-1&&s!=-1&&(c.source=r,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=Y8(c,c.path),c.queryKey=X8(c,c.query),c}function Y8(t,r){const i=/\/{2,9}/g,s=r.replace(i,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&s.splice(0,1),r.slice(-1)=="/"&&s.splice(s.length-1,1),s}function X8(t,r){const i={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,u,c){u&&(i[u]=c)}),i}const fh=typeof addEventListener=="function"&&typeof removeEventListener=="function",Xo=[];fh&&addEventListener("offline",()=>{Xo.forEach(t=>t())},!1);class la extends ft{constructor(r,i){if(super(),this.binaryType=x8,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,r&&typeof r=="object"&&(i=r,r=null),r){const s=ch(r);i.hostname=s.host,i.secure=s.protocol==="https"||s.protocol==="wss",i.port=s.port,s.query&&(i.query=s.query)}else i.host&&(i.hostname=ch(i.host).host);Su(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(s=>{const u=s.prototype.name;this.transports.push(u),this._transportsByName[u]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=D8(this.opts.query)),fh&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Xo.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const i=Object.assign({},this.opts.query);i.EIO=E_,i.transport=r,this.id&&(i.sid=this.id);const s=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[r]);return new this._transportsByName[r](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&la.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(r);i.open(),this.setTransport(i)}setTransport(r){this.transport&&this.transport.removeAllListeners(),this.transport=r,r.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",la.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",r),this.emitReserved("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=r.data,this._onError(i);break;case"message":this.emitReserved("data",r.data),this.emitReserved("message",r.data);break}}onHandshake(r){this.emitReserved("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this._pingInterval=r.pingInterval,this._pingTimeout=r.pingTimeout,this._maxPayload=r.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const r=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+r,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},r),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const r=this._getWritablePackets();this.transport.send(r),this._prevBufferLen=r.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let s=0;s<this.writeBuffer.length;s++){const u=this.writeBuffer[s].data;if(u&&(i+=C8(u)),s>0&&i>this._maxPayload)return this.writeBuffer.slice(0,s);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,Eu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,i,s){return this._sendPacket("message",r,i,s),this}send(r,i,s){return this._sendPacket("message",r,i,s),this}_sendPacket(r,i,s,u){if(typeof i=="function"&&(u=i,i=void 0),typeof s=="function"&&(u=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const c={type:r,data:i,options:s};this.emitReserved("packetCreate",c),this.writeBuffer.push(c),u&&this.once("flush",u),this.flush()}close(){const r=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),r()},s=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():r()}):this.upgrading?s():r()),this}_onError(r){if(la.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",r),this._onClose("transport error",r)}_onClose(r,i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),fh&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Xo.indexOf(this._offlineEventListener);s!==-1&&Xo.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,i),this.writeBuffer=[],this._prevBufferLen=0}}}la.protocol=E_;class Z8 extends la{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let r=0;r<this._upgrades.length;r++)this._probe(this._upgrades[r])}_probe(r){let i=this.createTransport(r),s=!1;la.priorWebsocketSuccess=!1;const u=()=>{s||(i.send([{type:"ping",data:"probe"}]),i.once("packet",E=>{if(!s)if(E.type==="pong"&&E.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;la.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(y(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const A=new Error("probe error");A.transport=i.name,this.emitReserved("upgradeError",A)}}))};function c(){s||(s=!0,y(),i.close(),i=null)}const d=E=>{const A=new Error("probe error: "+E);A.transport=i.name,c(),this.emitReserved("upgradeError",A)};function h(){d("transport closed")}function m(){d("socket closed")}function p(E){i&&E.name!==i.name&&c()}const y=()=>{i.removeListener("open",u),i.removeListener("error",d),i.removeListener("close",h),this.off("close",m),this.off("upgrading",p)};i.once("open",u),i.once("error",d),i.once("close",h),this.once("close",m),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{s||i.open()},200):i.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const i=[];for(let s=0;s<r.length;s++)~this.transports.indexOf(r[s])&&i.push(r[s]);return i}}let Q8=class extends Z8{constructor(r,i={}){const s=typeof r=="object"?r:i;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(u=>F8[u]).filter(u=>!!u)),super(r,s)}};function K8(t,r="",i){let s=t;i=i||typeof location<"u"&&location,t==null&&(t=i.protocol+"//"+i.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=i.protocol+t:t=i.host+t),/^(https?|wss?):\/\//.test(t)||(typeof i<"u"?t=i.protocol+"//"+t:t="https://"+t),s=ch(t)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const c=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+c+":"+s.port+r,s.href=s.protocol+"://"+c+(i&&i.port===s.port?"":":"+s.port),s}const $8=typeof ArrayBuffer=="function",W8=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,R_=Object.prototype.toString,J8=typeof Blob=="function"||typeof Blob<"u"&&R_.call(Blob)==="[object BlobConstructor]",eM=typeof File=="function"||typeof File<"u"&&R_.call(File)==="[object FileConstructor]";function Wh(t){return $8&&(t instanceof ArrayBuffer||W8(t))||J8&&t instanceof Blob||eM&&t instanceof File}function Zo(t,r){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let i=0,s=t.length;i<s;i++)if(Zo(t[i]))return!0;return!1}if(Wh(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Zo(t.toJSON(),!0);for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&Zo(t[i]))return!0;return!1}function tM(t){const r=[],i=t.data,s=t;return s.data=dh(i,r),s.attachments=r.length,{packet:s,buffers:r}}function dh(t,r){if(!t)return t;if(Wh(t)){const i={_placeholder:!0,num:r.length};return r.push(t),i}else if(Array.isArray(t)){const i=new Array(t.length);for(let s=0;s<t.length;s++)i[s]=dh(t[s],r);return i}else if(typeof t=="object"&&!(t instanceof Date)){const i={};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=dh(t[s],r));return i}return t}function nM(t,r){return t.data=hh(t.data,r),delete t.attachments,t}function hh(t,r){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<r.length)return r[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let i=0;i<t.length;i++)t[i]=hh(t[i],r);else if(typeof t=="object")for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(t[i]=hh(t[i],r));return t}const rM=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],aM=5;var Ce;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(Ce||(Ce={}));class iM{constructor(r){this.replacer=r}encode(r){return(r.type===Ce.EVENT||r.type===Ce.ACK)&&Zo(r)?this.encodeAsBinary({type:r.type===Ce.EVENT?Ce.BINARY_EVENT:Ce.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let i=""+r.type;return(r.type===Ce.BINARY_EVENT||r.type===Ce.BINARY_ACK)&&(i+=r.attachments+"-"),r.nsp&&r.nsp!=="/"&&(i+=r.nsp+","),r.id!=null&&(i+=r.id),r.data!=null&&(i+=JSON.stringify(r.data,this.replacer)),i}encodeAsBinary(r){const i=tM(r),s=this.encodeAsString(i.packet),u=i.buffers;return u.unshift(s),u}}function y1(t){return Object.prototype.toString.call(t)==="[object Object]"}class Jh extends ft{constructor(r){super(),this.reviver=r}add(r){let i;if(typeof r=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(r);const s=i.type===Ce.BINARY_EVENT;s||i.type===Ce.BINARY_ACK?(i.type=s?Ce.EVENT:Ce.ACK,this.reconstructor=new sM(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(Wh(r)||r.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(r),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+r)}decodeString(r){let i=0;const s={type:Number(r.charAt(0))};if(Ce[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===Ce.BINARY_EVENT||s.type===Ce.BINARY_ACK){const c=i+1;for(;r.charAt(++i)!=="-"&&i!=r.length;);const d=r.substring(c,i);if(d!=Number(d)||r.charAt(i)!=="-")throw new Error("Illegal attachments");s.attachments=Number(d)}if(r.charAt(i+1)==="/"){const c=i+1;for(;++i&&!(r.charAt(i)===","||i===r.length););s.nsp=r.substring(c,i)}else s.nsp="/";const u=r.charAt(i+1);if(u!==""&&Number(u)==u){const c=i+1;for(;++i;){const d=r.charAt(i);if(d==null||Number(d)!=d){--i;break}if(i===r.length)break}s.id=Number(r.substring(c,i+1))}if(r.charAt(++i)){const c=this.tryParse(r.substr(i));if(Jh.isPayloadValid(s.type,c))s.data=c;else throw new Error("invalid payload")}return s}tryParse(r){try{return JSON.parse(r,this.reviver)}catch{return!1}}static isPayloadValid(r,i){switch(r){case Ce.CONNECT:return y1(i);case Ce.DISCONNECT:return i===void 0;case Ce.CONNECT_ERROR:return typeof i=="string"||y1(i);case Ce.EVENT:case Ce.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&rM.indexOf(i[0])===-1);case Ce.ACK:case Ce.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class sM{constructor(r){this.packet=r,this.buffers=[],this.reconPack=r}takeBinaryData(r){if(this.buffers.push(r),this.buffers.length===this.reconPack.attachments){const i=nM(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const lM=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Jh,Encoder:iM,get PacketType(){return Ce},protocol:aM},Symbol.toStringTag,{value:"Module"}));function jn(t,r,i){return t.on(r,i),function(){t.off(r,i)}}const oM=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class w_ extends ft{constructor(r,i,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=r,this.nsp=i,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const r=this.io;this.subs=[jn(r,"open",this.onopen.bind(this)),jn(r,"packet",this.onpacket.bind(this)),jn(r,"error",this.onerror.bind(this)),jn(r,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...r){return r.unshift("message"),this.emit.apply(this,r),this}emit(r,...i){var s,u,c;if(oM.hasOwnProperty(r))throw new Error('"'+r.toString()+'" is a reserved event name');if(i.unshift(r),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const d={type:Ce.EVENT,data:i};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const y=this.ids++,E=i.pop();this._registerAckCallback(y,E),d.id=y}const h=(u=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||u===void 0?void 0:u.writable,m=this.connected&&!(!((c=this.io.engine)===null||c===void 0)&&c._hasPingExpired());return this.flags.volatile&&!h||(m?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d)),this.flags={},this}_registerAckCallback(r,i){var s;const u=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(u===void 0){this.acks[r]=i;return}const c=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===r&&this.sendBuffer.splice(h,1);i.call(this,new Error("operation has timed out"))},u),d=(...h)=>{this.io.clearTimeoutFn(c),i.apply(this,h)};d.withError=!0,this.acks[r]=d}emitWithAck(r,...i){return new Promise((s,u)=>{const c=(d,h)=>d?u(d):s(h);c.withError=!0,i.push(c),this.emit(r,...i)})}_addToQueue(r){let i;typeof r[r.length-1]=="function"&&(i=r.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((u,...c)=>s!==this._queue[0]?void 0:(u!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(u)):(this._queue.shift(),i&&i(null,...c)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(r=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!r||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(r){r.nsp=this.nsp,this.io._packet(r)}onopen(){typeof this.auth=="function"?this.auth(r=>{this._sendConnectPacket(r)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(r){this.packet({type:Ce.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},r):r})}onerror(r){this.connected||this.emitReserved("connect_error",r)}onclose(r,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",r,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(r=>{if(!this.sendBuffer.some(s=>String(s.id)===r)){const s=this.acks[r];delete this.acks[r],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case Ce.CONNECT:r.data&&r.data.sid?this.onconnect(r.data.sid,r.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ce.EVENT:case Ce.BINARY_EVENT:this.onevent(r);break;case Ce.ACK:case Ce.BINARY_ACK:this.onack(r);break;case Ce.DISCONNECT:this.ondisconnect();break;case Ce.CONNECT_ERROR:this.destroy();const s=new Error(r.data.message);s.data=r.data.data,this.emitReserved("connect_error",s);break}}onevent(r){const i=r.data||[];r.id!=null&&i.push(this.ack(r.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(r){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const s of i)s.apply(this,r)}super.emit.apply(this,r),this._pid&&r.length&&typeof r[r.length-1]=="string"&&(this._lastOffset=r[r.length-1])}ack(r){const i=this;let s=!1;return function(...u){s||(s=!0,i.packet({type:Ce.ACK,id:r,data:u}))}}onack(r){const i=this.acks[r.id];typeof i=="function"&&(delete this.acks[r.id],i.withError&&r.data.unshift(null),i.apply(this,r.data))}onconnect(r,i){this.id=r,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(r=>this.emitEvent(r)),this.receiveBuffer=[],this.sendBuffer.forEach(r=>{this.notifyOutgoingListeners(r),this.packet(r)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(r=>r()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ce.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(r){return this.flags.compress=r,this}get volatile(){return this.flags.volatile=!0,this}timeout(r){return this.flags.timeout=r,this}onAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(r),this}prependAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(r),this}offAny(r){if(!this._anyListeners)return this;if(r){const i=this._anyListeners;for(let s=0;s<i.length;s++)if(r===i[s])return i.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(r),this}prependAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(r),this}offAnyOutgoing(r){if(!this._anyOutgoingListeners)return this;if(r){const i=this._anyOutgoingListeners;for(let s=0;s<i.length;s++)if(r===i[s])return i.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(r){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const s of i)s.apply(this,r.data)}}}function Mi(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Mi.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),i=Math.floor(r*this.jitter*t);t=(Math.floor(r*10)&1)==0?t-i:t+i}return Math.min(t,this.max)|0};Mi.prototype.reset=function(){this.attempts=0};Mi.prototype.setMin=function(t){this.ms=t};Mi.prototype.setMax=function(t){this.max=t};Mi.prototype.setJitter=function(t){this.jitter=t};class mh extends ft{constructor(r,i){var s;super(),this.nsps={},this.subs=[],r&&typeof r=="object"&&(i=r,r=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Su(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((s=i.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Mi({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=r;const u=i.parser||lM;this.encoder=new u.Encoder,this.decoder=new u.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(r){return arguments.length?(this._reconnection=!!r,r||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(r){return r===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=r,this)}reconnectionDelay(r){var i;return r===void 0?this._reconnectionDelay:(this._reconnectionDelay=r,(i=this.backoff)===null||i===void 0||i.setMin(r),this)}randomizationFactor(r){var i;return r===void 0?this._randomizationFactor:(this._randomizationFactor=r,(i=this.backoff)===null||i===void 0||i.setJitter(r),this)}reconnectionDelayMax(r){var i;return r===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=r,(i=this.backoff)===null||i===void 0||i.setMax(r),this)}timeout(r){return arguments.length?(this._timeout=r,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(r){if(~this._readyState.indexOf("open"))return this;this.engine=new Q8(this.uri,this.opts);const i=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const u=jn(i,"open",function(){s.onopen(),r&&r()}),c=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),r?r(h):this.maybeReconnectOnOpen()},d=jn(i,"error",c);if(this._timeout!==!1){const h=this._timeout,m=this.setTimeoutFn(()=>{u(),c(new Error("timeout")),i.close()},h);this.opts.autoUnref&&m.unref(),this.subs.push(()=>{this.clearTimeoutFn(m)})}return this.subs.push(u),this.subs.push(d),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(jn(r,"ping",this.onping.bind(this)),jn(r,"data",this.ondata.bind(this)),jn(r,"error",this.onerror.bind(this)),jn(r,"close",this.onclose.bind(this)),jn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(r){try{this.decoder.add(r)}catch(i){this.onclose("parse error",i)}}ondecoded(r){Eu(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,i){let s=this.nsps[r];return s?this._autoConnect&&!s.active&&s.connect():(s=new w_(this,r,i),this.nsps[r]=s),s}_destroy(r){const i=Object.keys(this.nsps);for(const s of i)if(this.nsps[s].active)return;this._close()}_packet(r){const i=this.encoder.encode(r);for(let s=0;s<i.length;s++)this.engine.write(i[s],r.options)}cleanup(){this.subs.forEach(r=>r()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(r,i){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",r,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const r=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{r.skipReconnect||(this.emitReserved("reconnect_attempt",r.backoff.attempts),!r.skipReconnect&&r.open(u=>{u?(r._reconnecting=!1,r.reconnect(),this.emitReserved("reconnect_error",u)):r.onreconnect()}))},i);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const Ys={};function Qo(t,r){typeof t=="object"&&(r=t,t=void 0),r=r||{};const i=K8(t,r.path||"/socket.io"),s=i.source,u=i.id,c=i.path,d=Ys[u]&&c in Ys[u].nsps,h=r.forceNew||r["force new connection"]||r.multiplex===!1||d;let m;return h?m=new mh(s,r):(Ys[u]||(Ys[u]=new mh(s,r)),m=Ys[u]),i.query&&!r.query&&(r.query=i.queryKey),m.socket(i.path,r)}Object.assign(Qo,{Manager:mh,Socket:w_,io:Qo,connect:Qo});const uM=[Te.ActionTypes.MESSAGE_TO_GUEST,Te.ActionTypes.EVENT_TO_GUEST,Te.ActionTypes.TYPING_ON,Te.ActionTypes.TYPING_OFF,Te.ActionTypes.RESTART_CHAT_REQUEST,...xO,..._x,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],cM=({dispatch:t,getState:r})=>i=>{let s=null;return u=>{const c=i(u);if(u.type===zh){s?.disconnect(),t(wO());const d=`/chat?${uu.stringify(u.querystrings)}`;s=Qo(`/${u.clientName}${d}`),s.on("action",t),s.on("connect",()=>t(CO())),s.on("disconnect",()=>t(NO())),s.on("reconnect",()=>t(MO())),s.on("set-translations",(h,m)=>{t(i8({language:h,messages:JN(h,m)}))}),s.on("set-settings",h=>{t(o8(h))}),s.on("enable-conversation-rating",h=>t(xx(h))),s.on("speech-transcription",h=>t(Sx(h))),s.on("restore-client-state",h=>{t(RO(h.sessionId)),t(Rx(h.messages))}),s.on("expand-window",({devices:h,initial:m=!1})=>{t({type:ub,devices:h,initial:m})}),s.on("restart-chat",()=>{t(gu(u.clientName,u.querystrings))}),s.on("login-success",h=>{t(yO({loginToken:h.loginToken}))})}else if(u.type==="start-screen/requestLogin")s?.emit("login-requested",u.payload);else if(u.type===mu)s?.emit("start-chat",u.payload);else if(u.type===pu)s?.emit("terminate-session",u.payload);else if(u.type===bx)s?.emit("get-started",JSON.stringify(u));else if(u.type===wh)s?.emit("audio-message",u.buffer);else if(u.type===Te.ActionTypes.CONVERSATION_RATING_FROM_GUEST)s?.emit("conversation-rating",u.payload);else if(u.type===fb){const{connection:{sessionId:d}}=r();window.location.href=`/transcript-pdf/${d}`}else uM.indexOf(u.type)===-1&&u.meta===void 0&&s&&s.emit("action",JSON.stringify(u));return c}},C_=Kb(),fM={...d8(C_),intl:c_},ph=rO({middleware:t=>t().concat(cM),reducer:c8,preloadedState:fM});ph.subscribe(PN(()=>{const t=ph.getState();h8(C_,{connection:t.connection,startScreen:t.startScreen})},1e3));const dM=document.getElementById("root"),hM=P2.createRoot(dM);hM.render(v.jsx(VS,{store:ph,children:v.jsx(MN,{})}));
124
+ //# sourceMappingURL=index-DZUwfXcY.js.map