@botfabrik/engine-webclient 4.92.1 → 4.92.2

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.
@@ -103,7 +103,7 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
103
103
  `,{inline:x}));for(;typeof T[T.length-1]=="string"&&!T[T.length-1].trim();)T.pop();if(r.wrapper===null)return T;const z=r.wrapper||(x?"span":"div");let N;if(T.length>1||r.forceWrapper)N=T;else{if(T.length===1)return N=T[0],typeof N=="string"?i("span",{key:"outer"},N):N;N=null}return r.createElement(z,{key:"outer"},N)}function u(y,x){const T=x.match(pO);return T?T.reduce(function(z,N){const U=N.indexOf("=");if(U!==-1){const M=function(k){return k.indexOf("-")!==-1&&k.match(DO)===null&&(k=k.replace(HO,function(Y,K){return K.toUpperCase()})),k}(N.slice(0,U)).trim(),O=function(k){const Y=k[0];return(Y==='"'||Y==="'")&&k.length>=2&&k[k.length-1]===Y?k.slice(1,-1):k}(N.slice(U+1).trim()),R=By[M]||M;if(R==="ref")return z;const S=z[R]=function(k,Y,K,re){return Y==="style"?function(ee){const le=[];let ie="",de=!1,Ie=!1,Te="";if(!ee)return le;for(let X=0;X<ee.length;X++){const J=ee[X];if(J!=='"'&&J!=="'"||de||(Ie?J===Te&&(Ie=!1,Te=""):(Ie=!0,Te=J)),J==="("&&ie.endsWith("url")?de=!0:J===")"&&de&&(de=!1),J!==";"||Ie||de)ie+=J;else{const _e=ie.trim();if(_e){const w=_e.indexOf(":");if(w>0){const P=_e.slice(0,w).trim(),$=_e.slice(w+1).trim();le.push([P,$])}}ie=""}}const G=ie.trim();if(G){const X=G.indexOf(":");if(X>0){const J=G.slice(0,X).trim(),_e=G.slice(X+1).trim();le.push([J,_e])}}return le}(K).reduce(function(ee,[le,ie]){return ee[le.replace(/(-[a-z])/g,de=>de[1].toUpperCase())]=re(ie,k,le),ee},{}):mO.indexOf(Y)!==-1?re(K,k,Y):(K.match(MO)&&(K=K.slice(1,K.length-1)),K==="true"||K!=="false"&&K)}(y,M,O,r.sanitizer);typeof S=="string"&&(gh.test(S)||yh.test(S))&&(z[R]=l(S.trim()))}else N!=="style"&&(z[By[N]||N]=!0);return z},{}):null}r.overrides=r.overrides||{},r.sanitizer=r.sanitizer||dw,r.slugify=r.slugify||Ki,r.namedCodesToUnicode=r.namedCodesToUnicode?Qr({},jy,r.namedCodesToUnicode):jy,r.createElement=r.createElement||F.createElement;const f=[],h={},d={[ue.blockQuote]:{match:qn(Jb),order:1,parse(y,x,T){const[,z,N]=y[0].replace(_O,"").match(bO);return{alert:z,children:x(N,T)}},render(y,x,T){const z={key:T.key};return y.alert&&(z.className="markdown-alert-"+r.slugify(y.alert.toLowerCase(),Ki),y.children.unshift({attrs:{},children:[{type:ue.text,text:y.alert}],noInnerParse:!0,type:ue.htmlBlock,tag:"header"})),i("blockquote",z,x(y.children,T))}},[ue.breakLine]:{match:$i(vO),order:1,parse:vf,render:(y,x,T)=>i("br",{key:T.key})},[ue.breakThematic]:{match:qn(EO),order:1,parse:vf,render:(y,x,T)=>i("hr",{key:T.key})},[ue.codeBlock]:{match:qn(ev),order:0,parse:y=>({lang:void 0,text:ss(y[0].replace(/^ {4}/gm,"")).replace(Uy,"$1")}),render:(y,x,T)=>i("pre",{key:T.key},i("code",Qr({},y.attrs,{className:y.lang?`lang-${y.lang}`:""}),y.text))},[ue.codeFenced]:{match:qn(Wb),order:0,parse:y=>({attrs:u("code",y[3]||""),lang:y[2]||void 0,text:y[4],type:ue.codeBlock})},[ue.codeInline]:{match:br(SO),order:3,parse:y=>({text:y[2].replace(Uy,"$1")}),render:(y,x,T)=>i("code",{key:T.key},y.text)},[ue.footnote]:{match:qn(AO),order:0,parse:y=>(f.push({footnote:y[2],identifier:y[1]}),{}),render:Ef},[ue.footnoteReference]:{match:_r(OO),order:1,parse:y=>({target:`#${r.slugify(y[1],Ki)}`,text:y[1]}),render:(y,x,T)=>i("a",{key:T.key,href:r.sanitizer(y.target,"a","href")},i("sup",{key:T.key},y.text))},[ue.gfmTask]:{match:_r(CO),order:1,parse:y=>({completed:y[1].toLowerCase()==="x"}),render:(y,x,T)=>i("input",{checked:y.completed,key:T.key,readOnly:!0,type:"checkbox"})},[ue.heading]:{match:qn(r.enforceAtxHeadings?nv:tv),order:1,parse:(y,x,T)=>({children:to(x,y[2],T),id:r.slugify(y[2],Ki),level:y[1].length}),render:(y,x,T)=>i(`h${y.level}`,{id:y.id,key:T.key},x(y.children,T))},[ue.headingSetext]:{match:qn(rv),order:0,parse:(y,x,T)=>({children:to(x,y[1],T),level:y[2]==="="?1:2,type:ue.heading})},[ue.htmlBlock]:{match:$i(gh),order:1,parse(y,x,T){const[,z]=y[3].match(WO),N=new RegExp(`^${z}`,"gm"),U=y[3].replace(N,""),M=(O=U,ow.some(K=>K.test(O))?pw:to);var O;const R=y[1].toLowerCase(),S=dO.indexOf(R)!==-1,k=(S?R:y[1]).trim(),Y={attrs:u(k,y[2]),noInnerParse:S,tag:k};return T.inAnchor=T.inAnchor||R==="a",S?Y.text=y[3]:Y.children=M(x,U,T),T.inAnchor=!1,Y},render:(y,x,T)=>i(y.tag,Qr({key:T.key},y.attrs),y.text||(y.children?x(y.children,T):""))},[ue.htmlSelfClosing]:{match:$i(yh),order:1,parse(y){const x=y[1].trim();return{attrs:u(x,y[2]||""),tag:x}},render:(y,x,T)=>i(y.tag,Qr({},y.attrs,{key:T.key}))},[ue.htmlComment]:{match:$i(av),order:1,parse:()=>({}),render:Ef},[ue.image]:{match:br(lw),order:1,parse:y=>({alt:y[1],target:ky(y[2]),title:y[3]}),render:(y,x,T)=>i("img",{key:T.key,alt:y.alt||void 0,title:y.title||void 0,src:r.sanitizer(y.target,"img","src")})},[ue.link]:{match:_r(sw),order:3,parse:(y,x,T)=>({children:mw(x,y[1],T),target:ky(y[2]),title:y[3]}),render:(y,x,T)=>i("a",{key:T.key,href:r.sanitizer(y.target,"a","href"),title:y.title},x(y.children,T))},[ue.linkAngleBraceStyleDetector]:{match:_r(UO),order:0,parse:y=>({children:[{text:y[1],type:ue.text}],target:y[1],type:ue.link})},[ue.linkBareUrlDetector]:{match:Fa((y,x)=>x.inAnchor||r.disableAutoLink?null:_r(BO)(y,x)),order:0,parse:y=>({children:[{text:y[1],type:ue.text}],target:y[1],title:void 0,type:ue.link})},[ue.linkMailtoDetector]:{match:_r(jO),order:0,parse(y){let x=y[1],T=y[1];return gO.test(T)||(T="mailto:"+T),{children:[{text:x.replace("mailto:",""),type:ue.text}],target:T,type:ue.link}}},[ue.orderedList]:Hy(i,1),[ue.unorderedList]:Hy(i,2),[ue.newlineCoalescer]:{match:qn(TO),order:3,parse:vf,render:()=>`
104
104
  `},[ue.paragraph]:{match:Fa(fw),order:3,parse:bf,render:(y,x,T)=>i("p",{key:T.key},x(y.children,T))},[ue.ref]:{match:_r(LO),order:0,parse:y=>(h[y[1]]={target:y[2],title:y[4]},{}),render:Ef},[ue.refImage]:{match:br(zO),order:0,parse:y=>({alt:y[1]||void 0,ref:y[2]}),render:(y,x,T)=>h[y.ref]?i("img",{key:T.key,alt:y.alt,src:r.sanitizer(h[y.ref].target,"img","src"),title:h[y.ref].title}):null},[ue.refLink]:{match:_r(kO),order:0,parse:(y,x,T)=>({children:x(y[1],T),fallbackChildren:y[0],ref:y[2]}),render:(y,x,T)=>h[y.ref]?i("a",{key:T.key,href:r.sanitizer(h[y.ref].target,"a","href"),title:h[y.ref].title},x(y.children,T)):i("span",{key:T.key},y.fallbackChildren)},[ue.table]:{match:qn(iv),order:1,parse:cw,render(y,x,T){const z=y;return i("table",{key:T.key},i("thead",null,i("tr",null,z.header.map(function(N,U){return i("th",{key:U,style:zy(z,U)},x(N,T))}))),i("tbody",null,z.cells.map(function(N,U){return i("tr",{key:U},N.map(function(M,O){return i("td",{key:O,style:zy(z,O)},x(M,T))}))})))}},[ue.text]:{match:$i($O),order:4,parse:y=>({text:y[0].replace(NO,(x,T)=>r.namedCodesToUnicode[T]?r.namedCodesToUnicode[T]:x)}),render:y=>y.text},[ue.textBolded]:{match:br(YO),order:2,parse:(y,x,T)=>({children:x(y[2],T)}),render:(y,x,T)=>i("strong",{key:T.key},x(y.children,T))},[ue.textEmphasized]:{match:br(ZO),order:3,parse:(y,x,T)=>({children:x(y[2],T)}),render:(y,x,T)=>i("em",{key:T.key},x(y.children,T))},[ue.textEscaped]:{match:br(KO),order:1,parse:y=>({text:y[1],type:ue.text})},[ue.textMarked]:{match:br(XO),order:3,parse:bf,render:(y,x,T)=>i("mark",{key:T.key},x(y.children,T))},[ue.textStrikethroughed]:{match:br(QO),order:3,parse:bf,render:(y,x,T)=>i("del",{key:T.key},x(y.children,T))}};r.disableParsingRawHTML===!0&&(delete d[ue.htmlBlock],delete d[ue.htmlSelfClosing]);const m=function(y){let x=Object.keys(y);function T(z,N){let U,M,O=[],R="",S="";for(N.prevCapture=N.prevCapture||"";z;){let k=0;for(;k<x.length;){if(R=x[k],U=y[R],N.inline&&!U.match.inline){k++;continue}const Y=U.match(z,N);if(Y){S=Y[0],N.prevCapture+=S,z=z.substring(S.length),M=U.parse(Y,T,N),M.type==null&&(M.type=R),O.push(M);break}k++}}return N.prevCapture="",O}return x.sort(function(z,N){let U=y[z].order,M=y[N].order;return U!==M?U-M:z<N?-1:1}),function(z,N){return T(function(U){return U.replace(xO,`
105
105
  `).replace(wO,"").replace(qO," ")}(z),N)}}(d),g=(_=function(y,x){return function(T,z,N){const U=y[T.type].render;return x?x(()=>U(T,z,N),T,z,N):U(T,z,N)}}(d,r.renderRule),function y(x,T={}){if(Array.isArray(x)){const z=T.key,N=[];let U=!1;for(let M=0;M<x.length;M++){T.key=M;const O=y(x[M],T),R=typeof O=="string";R&&U?N[N.length-1]+=O:O!==null&&N.push(O),U=R}return T.key=z,N}return _(x,y,T)});var _;const E=l(n);return f.length?i("div",null,E,i("footer",{key:"footer"},f.map(function(y){return i("div",{id:r.slugify(y.identifier,Ki),key:y.identifier},y.identifier,g(m(y.footnote,{inline:!0})))}))):E}const En=n=>{let{children:r="",options:i}=n,l=function(u,f){if(u==null)return{};var h,d,m={},g=Object.keys(u);for(d=0;d<g.length;d++)f.indexOf(h=g[d])>=0||(m[h]=u[h]);return m}(n,hO);return F.cloneElement(yw(r,i),l)},_w="_generalConditionsContainer_55hjg_1",bw="_generalConditions_55hjg_1",vw="_generalConditionsHeader_55hjg_15",Ew="_generalConditionsBody_55hjg_26",Sw="_generalConditionsAccept_55hjg_35",Ji={generalConditionsContainer:_w,generalConditions:bw,generalConditionsHeader:vw,generalConditionsBody:Ew,generalConditionsAccept:Sw},Tw=()=>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"})}),xw=()=>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"})}),Aw="general-conditions.header",Ow="general-conditions.body",Gy="general-conditions.accept-conditions-note",ww=()=>{const n=Ke(),[r,i]=F.useState(!1),l=()=>i(!r),u=d=>{d.key==="ArrowDown"||d.key==="ArrowRight"?i(!0):d.key==="ArrowUp"||d.key==="ArrowLeft"||d.key==="Escape"?i(!1):(d.key==="Enter"||d.key==="Space"||d.key===" ")&&l()},f=n(Aw),h=n(Gy);return v.jsxs("div",{className:Z(Ji.generalConditionsContainer,"chat__generalConditions"),children:[!!(f!=null&&f.length)&&v.jsxs("div",{className:Ji.generalConditions,children:[v.jsxs("div",{role:"button",onClick:l,onKeyDown:u,tabIndex:0,className:Z(Ji.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":r?"true":"false","aria-pressed":r?"true":"false",children:[v.jsx(En,{children:f}),r?v.jsx(xw,{}):v.jsx(Tw,{})]}),v.jsx("div",{className:Z(Ji.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:r&&v.jsx(En,{children:n(Ow)||""})})]}),!!(h!=null&&h.length)&&v.jsx("div",{className:Z(Ji.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:v.jsx(En,{children:n(Gy)||""})})]})},Rw="_message_6i1zm_1",Cw="_messageBot_6i1zm_9",Nw="_messageBotLast_6i1zm_19",Dw="_avatar_6i1zm_19",Mw="_messageBotFirst_6i1zm_24",Bw="_messageBotAnimated_6i1zm_37",jw="_messageGuest_6i1zm_48",Uw="_messageGuestFirst_6i1zm_54",Hw="_messageGuestLast_6i1zm_60",Lw="_botAvatar_6i1zm_74",zw="_agentAvatar_6i1zm_78",kw="_bubble_6i1zm_82",Gw="_bubbleContent_6i1zm_88",qw="_bubbleLeft_6i1zm_102",Fw="_leftText_6i1zm_113",Iw="_bubbleRight_6i1zm_120",Vw="_rightText_6i1zm_130",Pw="_sourceInfoReference_6i1zm_162",Yw="_sourceInfoReferenceActive_6i1zm_174",me={message:Rw,messageBot:Cw,messageBotLast:Nw,avatar:Dw,messageBotFirst:Mw,messageBotAnimated:Bw,messageGuest:jw,messageGuestFirst:Uw,messageGuestLast:Hw,botAvatar:Lw,agentAvatar:zw,bubble:kw,bubbleContent:Gw,bubbleLeft:qw,leftText:Fw,bubbleRight:Iw,rightText:Vw,sourceInfoReference:Pw,sourceInfoReferenceActive:Yw},Zw="_botMessageActions_1dl7x_1",Xw="_alwaysVisible_1dl7x_22",Qw="_reported_1dl7x_29",Kw="_action_1dl7x_33",vr={botMessageActions:Zw,alwaysVisible:Xw,reported:Qw,action:Kw},$w=({alwaysVisible:n,senderType:r,reaction:i,botMessageRef:l,onReaction:u})=>{const f=Ke(),[h,d]=F.useState(!1),m=_=>()=>u(_),g=F.useCallback(async()=>{if(l.current)try{d(!0);const _=l.current.innerHTML,E=l.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([_],{type:"text/html"}),"text/plain":new Blob([E],{type:"text/plain"})})]),await new Promise(y=>setTimeout(y,1500))}finally{d(!1)}},[l]);return v.jsxs("div",{className:Z(vr.botMessageActions,n&&vr.alwaysVisible,i&&vr.reported),children:[r===ho.BOT&&v.jsx("button",{className:Z(vr.action,i==="GOOD"&&vr.reported,"tooltip--top-right"),tabIndex:0,"aria-label":f(i==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),"data-title":f(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===ho.BOT&&v.jsx("button",{className:Z(vr.action,i==="BAD"&&vr.reported,"tooltip--top-right"),tabIndex:0,"aria-label":f(i==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),"data-title":f(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:Z(vr.action,"tooltip--top-right"),tabIndex:0,"aria-label":f("bot-bubble.copy"),"data-title":f("bot-bubble.copy"),onClick:g,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:h?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"})})})]})},pv=F.forwardRef(({message:n,isAnimated:r,isLastMessage:i,isFirstMessageBySender:l,isLastMessageBySender:u,children:f,onReaction:h},d)=>{const m=Ke(),g=F.useRef(null),_=n.sender.type===Ee.UserType.BOT;return v.jsxs("li",{ref:d,className:Z(me.message,me.messageBot,i&&me.lastMessage,l&&me.messageBotFirst,u&&me.messageBotLast,"chat__bubbleContainer",r&&me.messageBotAnimated,r&&"chat__bubbleContainer--animated",_?"chat__botBubbleContainer":"chat__agentBubbleContainer",l&&"chat__bubbleContainer--first",u&&"chat__bubbleContainer--last"),children:[v.jsx("img",{className:Z(me.avatar,_?me.botAvatar:me.agentAvatar,"chat__avatar",_?"chat__botAvatar":"chat__agentAvatar"),src:`${n.sender.avatar}`,alt:_?"Bot":"Agent",referrerPolicy:"no-referrer"}),v.jsx("div",{ref:g,className:Z(me.bubble,me.bubbleLeft,"chat__bubble",_?"chat__botBubble":"chat__agentBubble"),tabIndex:0,"aria-label":m(_?"bot-bubble.label":"agent-bubble.label"),children:v.jsx("div",{className:Z(me.leftText),children:f})}),h&&v.jsx($w,{alwaysVisible:i&&u,senderType:n.sender.type,reaction:n.reaction,botMessageRef:g,onReaction:h})]})}),Jw="_sourceList_1n31h_1",Ww="_source_1n31h_1",eR="_label_1n31h_37",Tf={sourceList:Jw,source:Ww,label:eR},gv=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,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"})}),yv=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,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"})}),_v=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,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"})}),bv=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,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"})}),tR=({type:n,...r})=>{switch(n){case"WEBSITE":return v.jsx(bv,{...r});case"PDF":return v.jsx(_v,{...r});case"DOCX":return v.jsx(gv,{...r});default:return v.jsx(yv,{...r})}},Wh=({sources:n,onLinkClick:r})=>{const i=Ke(),l=f=>()=>{r(f.url)},u=f=>h=>{(h.key==="Enter"||h.key===" ")&&r(f.url)};return n.length?v.jsx("ul",{className:Tf.sourceList,"aria-label":i("bot-bubble.sources"),children:n.map(f=>v.jsx("li",{className:Tf.source,children:v.jsxs("a",{role:"button",tabIndex:0,"aria-label":`${i("bot-bubble.source.open")}: ${f.label}`,onClick:l(f),onKeyDown:u(f),children:[v.jsx(tR,{type:f.type,"aria-hidden":"true"}),v.jsx("div",{className:Tf.label,children:f.label})]})},f.url))}):null},nR="_button_3ui4g_1",rR="_buttonDefault_3ui4g_13",aR="_buttonPrimary_3ui4g_28",ls={button:nR,buttonDefault:rR,buttonPrimary:aR},Ao=({className:n,children:r,...i})=>v.jsx("button",{className:Z(ls.button,n),type:"button",...i,children:r}),iR="_title_b904h_1",sR="_subtitle_b904h_6",lR="_buttons_b904h_11",oR="_button_b904h_11",uR="_imageContainer_b904h_34",cR="_image_b904h_34",fR="_video_container_b904h_49",hR="_video_b904h_49",dR="_only_b904h_63",Ot={title:iR,subtitle:sR,buttons:lR,button:oR,imageContainer:uR,image:cR,video_container:fR,video:hR,only:dR},mR=({buttons:n,onButtonClick:r})=>v.jsx("div",{className:Z(Ot.buttons,"chat__bubbleButtons"),children:n.map((i,l)=>v.jsx(Ao,{className:Z(Ot.button,"chat__bubbleButton"),onClick:()=>r(i),children:i.title},l))});var Il={},Vl={},Pl={},qy;function pR(){if(qy)return Pl;qy=1,Object.defineProperty(Pl,"__esModule",{value:!0});var n=Ia(),r=i(n);function i(l){if(l&&l.__esModule)return l;var u={};if(l!=null)for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(u[f]=l[f]);return u.default=l,u}return Pl.default=function(l,u,f){return r.createElement("a",{href:l,key:f},u)},Pl}var Yl={},Fy;function gR(){return Fy||(Fy=1,Object.defineProperty(Yl,"__esModule",{value:!0}),Yl.default=function(n){return n}),Yl}var Zl={},xf,Iy;function yR(){return Iy||(Iy=1,xf=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),xf}var Af,Vy;function _R(){return Vy||(Vy=1,Af=/[\0-\x1F\x7F-\x9F]/),Af}var Of,Py;function bR(){return Py||(Py=1,Of=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),Of}var wf,Yy;function vR(){return Yy||(Yy=1,wf=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/),wf}var Rf,Zy;function ER(){return Zy||(Zy=1,Rf=function(n){var r={};r.src_Any=yR().source,r.src_Cc=_R().source,r.src_Z=bR().source,r.src_P=vR().source,r.src_ZPCc=[r.src_Z,r.src_P,r.src_Cc].join("|"),r.src_ZCc=[r.src_Z,r.src_Cc].join("|");var i="[><|]";return r.src_pseudo_letter="(?:(?!"+i+"|"+r.src_ZPCc+")"+r.src_Any+")",r.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",r.src_auth="(?:(?:(?!"+r.src_ZCc+"|[@/\\[\\]()]).)+@)?",r.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",r.src_host_terminator="(?=$|"+i+"|"+r.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+r.src_ZPCc+"))",r.src_path="(?:[/?#](?:(?!"+r.src_ZCc+"|"+i+`|[()[\\]{}.,"'?!\\-]).|\\[(?:(?!`+r.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+r.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+r.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+r.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+r.src_ZCc+"|[']).)+\\'|\\'(?="+r.src_pseudo_letter+"|[-]).|\\.{2,4}[a-zA-Z0-9%/]|\\.(?!"+r.src_ZCc+"|[.]).|"+(n&&n["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+r.src_ZCc+").|\\!(?!"+r.src_ZCc+"|[!]).|\\?(?!"+r.src_ZCc+"|[?]).)+|\\/)?",r.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',r.src_xn="xn--[a-z0-9\\-]{1,59}",r.src_domain_root="(?:"+r.src_xn+"|"+r.src_pseudo_letter+"{1,63})",r.src_domain="(?:"+r.src_xn+"|(?:"+r.src_pseudo_letter+")|(?:"+r.src_pseudo_letter+"(?:-|"+r.src_pseudo_letter+"){0,61}"+r.src_pseudo_letter+"))",r.src_host="(?:(?:(?:(?:"+r.src_domain+")\\.)*"+r.src_domain+"))",r.tpl_host_fuzzy="(?:"+r.src_ip4+"|(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%)))",r.tpl_host_no_ip_fuzzy="(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%))",r.src_host_strict=r.src_host+r.src_host_terminator,r.tpl_host_fuzzy_strict=r.tpl_host_fuzzy+r.src_host_terminator,r.src_host_port_strict=r.src_host+r.src_port+r.src_host_terminator,r.tpl_host_port_fuzzy_strict=r.tpl_host_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_port_no_ip_fuzzy_strict=r.tpl_host_no_ip_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+r.src_ZPCc+"|>|$))",r.tpl_email_fuzzy="(^|"+i+'|"|\\(|'+r.src_ZCc+")("+r.src_email_name+"@"+r.tpl_host_fuzzy_strict+")",r.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+r.src_ZPCc+"))((?![$+<=>^`||])"+r.tpl_host_port_fuzzy_strict+r.src_path+")",r.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+r.src_ZPCc+"))((?![$+<=>^`||])"+r.tpl_host_port_no_ip_fuzzy_strict+r.src_path+")",r}),Rf}var Cf,Xy;function SR(){if(Xy)return Cf;Xy=1;function n(O){var R=Array.prototype.slice.call(arguments,1);return R.forEach(function(S){S&&Object.keys(S).forEach(function(k){O[k]=S[k]})}),O}function r(O){return Object.prototype.toString.call(O)}function i(O){return r(O)==="[object String]"}function l(O){return r(O)==="[object Object]"}function u(O){return r(O)==="[object RegExp]"}function f(O){return r(O)==="[object Function]"}function h(O){return O.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var d={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function m(O){return Object.keys(O||{}).reduce(function(R,S){return R||d.hasOwnProperty(S)},!1)}var g={"http:":{validate:function(O,R,S){var k=O.slice(R);return S.re.http||(S.re.http=new RegExp("^\\/\\/"+S.re.src_auth+S.re.src_host_port_strict+S.re.src_path,"i")),S.re.http.test(k)?k.match(S.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(O,R,S){var k=O.slice(R);return S.re.no_http||(S.re.no_http=new RegExp("^"+S.re.src_auth+"(?:localhost|(?:(?:"+S.re.src_domain+")\\.)+"+S.re.src_domain_root+")"+S.re.src_port+S.re.src_host_terminator+S.re.src_path,"i")),S.re.no_http.test(k)?R>=3&&O[R-3]===":"||R>=3&&O[R-3]==="/"?0:k.match(S.re.no_http)[0].length:0}},"mailto:":{validate:function(O,R,S){var k=O.slice(R);return S.re.mailto||(S.re.mailto=new RegExp("^"+S.re.src_email_name+"@"+S.re.src_host_strict,"i")),S.re.mailto.test(k)?k.match(S.re.mailto)[0].length:0}}},_="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",E="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function y(O){O.__index__=-1,O.__text_cache__=""}function x(O){return function(R,S){var k=R.slice(S);return O.test(k)?k.match(O)[0].length:0}}function T(){return function(O,R){R.normalize(O)}}function z(O){var R=O.re=ER()(O.__opts__),S=O.__tlds__.slice();O.onCompile(),O.__tlds_replaced__||S.push(_),S.push(R.src_xn),R.src_tlds=S.join("|");function k(ee){return ee.replace("%TLDS%",R.src_tlds)}R.email_fuzzy=RegExp(k(R.tpl_email_fuzzy),"i"),R.link_fuzzy=RegExp(k(R.tpl_link_fuzzy),"i"),R.link_no_ip_fuzzy=RegExp(k(R.tpl_link_no_ip_fuzzy),"i"),R.host_fuzzy_test=RegExp(k(R.tpl_host_fuzzy_test),"i");var Y=[];O.__compiled__={};function K(ee,le){throw new Error('(LinkifyIt) Invalid schema "'+ee+'": '+le)}Object.keys(O.__schemas__).forEach(function(ee){var le=O.__schemas__[ee];if(le!==null){var ie={validate:null,link:null};if(O.__compiled__[ee]=ie,l(le)){u(le.validate)?ie.validate=x(le.validate):f(le.validate)?ie.validate=le.validate:K(ee,le),f(le.normalize)?ie.normalize=le.normalize:le.normalize?K(ee,le):ie.normalize=T();return}if(i(le)){Y.push(ee);return}K(ee,le)}}),Y.forEach(function(ee){O.__compiled__[O.__schemas__[ee]]&&(O.__compiled__[ee].validate=O.__compiled__[O.__schemas__[ee]].validate,O.__compiled__[ee].normalize=O.__compiled__[O.__schemas__[ee]].normalize)}),O.__compiled__[""]={validate:null,normalize:T()};var re=Object.keys(O.__compiled__).filter(function(ee){return ee.length>0&&O.__compiled__[ee]}).map(h).join("|");O.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+R.src_ZPCc+"))("+re+")","i"),O.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+R.src_ZPCc+"))("+re+")","ig"),O.re.pretest=RegExp("("+O.re.schema_test.source+")|("+O.re.host_fuzzy_test.source+")|@","i"),y(O)}function N(O,R){var S=O.__index__,k=O.__last_index__,Y=O.__text_cache__.slice(S,k);this.schema=O.__schema__.toLowerCase(),this.index=S+R,this.lastIndex=k+R,this.raw=Y,this.text=Y,this.url=Y}function U(O,R){var S=new N(O,R);return O.__compiled__[S.schema].normalize(S,O),S}function M(O,R){if(!(this instanceof M))return new M(O,R);R||m(O)&&(R=O,O={}),this.__opts__=n({},d,R),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=n({},g,O),this.__compiled__={},this.__tlds__=E,this.__tlds_replaced__=!1,this.re={},z(this)}return M.prototype.add=function(R,S){return this.__schemas__[R]=S,z(this),this},M.prototype.set=function(R){return this.__opts__=n(this.__opts__,R),this},M.prototype.test=function(R){if(this.__text_cache__=R,this.__index__=-1,!R.length)return!1;var S,k,Y,K,re,ee,le,ie,de;if(this.re.schema_test.test(R)){for(le=this.re.schema_search,le.lastIndex=0;(S=le.exec(R))!==null;)if(K=this.testSchemaAt(R,S[2],le.lastIndex),K){this.__schema__=S[2],this.__index__=S.index+S[1].length,this.__last_index__=S.index+S[0].length+K;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(ie=R.search(this.re.host_fuzzy_test),ie>=0&&(this.__index__<0||ie<this.__index__)&&(k=R.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(re=k.index+k[1].length,(this.__index__<0||re<this.__index__)&&(this.__schema__="",this.__index__=re,this.__last_index__=k.index+k[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(de=R.indexOf("@"),de>=0&&(Y=R.match(this.re.email_fuzzy))!==null&&(re=Y.index+Y[1].length,ee=Y.index+Y[0].length,(this.__index__<0||re<this.__index__||re===this.__index__&&ee>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=re,this.__last_index__=ee))),this.__index__>=0},M.prototype.pretest=function(R){return this.re.pretest.test(R)},M.prototype.testSchemaAt=function(R,S,k){return this.__compiled__[S.toLowerCase()]?this.__compiled__[S.toLowerCase()].validate(R,k,this):0},M.prototype.match=function(R){var S=0,k=[];this.__index__>=0&&this.__text_cache__===R&&(k.push(U(this,S)),S=this.__last_index__);for(var Y=S?R.slice(S):R;this.test(Y);)k.push(U(this,S)),Y=Y.slice(this.__last_index__),S+=this.__last_index__;return k.length?k:null},M.prototype.tlds=function(R,S){return R=Array.isArray(R)?R:[R],S?(this.__tlds__=this.__tlds__.concat(R).sort().filter(function(k,Y,K){return k!==K[Y-1]}).reverse(),z(this),this):(this.__tlds__=R.slice(),this.__tlds_replaced__=!0,z(this),this)},M.prototype.normalize=function(R){R.schema||(R.url="http://"+R.url),R.schema==="mailto:"&&!/^mailto:/i.test(R.url)&&(R.url="mailto:"+R.url)},M.prototype.onCompile=function(){},Cf=M,Cf}const TR=JSON.parse('["aaa","aarp","abb","abbott","abbvie","abc","able","abogado","abudhabi","ac","academy","accenture","accountant","accountants","aco","actor","ad","ads","adult","ae","aeg","aero","aetna","af","afl","africa","ag","agakhan","agency","ai","aig","airbus","airforce","airtel","akdn","al","alibaba","alipay","allfinanz","allstate","ally","alsace","alstom","am","amazon","americanexpress","americanfamily","amex","amfam","amica","amsterdam","analytics","android","anquan","anz","ao","aol","apartments","app","apple","aq","aquarelle","ar","arab","aramco","archi","army","arpa","art","arte","as","asda","asia","associates","at","athleta","attorney","au","auction","audi","audible","audio","auspost","author","auto","autos","aw","aws","ax","axa","az","azure","ba","baby","baidu","banamex","band","bank","bar","barcelona","barclaycard","barclays","barefoot","bargains","baseball","basketball","bauhaus","bayern","bb","bbc","bbt","bbva","bcg","bcn","bd","be","beats","beauty","beer","bentley","berlin","best","bestbuy","bet","bf","bg","bh","bharti","bi","bible","bid","bike","bing","bingo","bio","biz","bj","black","blackfriday","blockbuster","blog","bloomberg","blue","bm","bms","bmw","bn","bnpparibas","bo","boats","boehringer","bofa","bom","bond","boo","book","booking","bosch","bostik","boston","bot","boutique","box","br","bradesco","bridgestone","broadway","broker","brother","brussels","bs","bt","build","builders","business","buy","buzz","bv","bw","by","bz","bzh","ca","cab","cafe","cal","call","calvinklein","cam","camera","camp","canon","capetown","capital","capitalone","car","caravan","cards","care","career","careers","cars","casa","case","cash","casino","cat","catering","catholic","cba","cbn","cbre","cc","cd","center","ceo","cern","cf","cfa","cfd","cg","ch","chanel","channel","charity","chase","chat","cheap","chintai","christmas","chrome","church","ci","cipriani","circle","cisco","citadel","citi","citic","city","ck","cl","claims","cleaning","click","clinic","clinique","clothing","cloud","club","clubmed","cm","cn","co","coach","codes","coffee","college","cologne","com","commbank","community","company","compare","computer","comsec","condos","construction","consulting","contact","contractors","cooking","cool","coop","corsica","country","coupon","coupons","courses","cpa","cr","credit","creditcard","creditunion","cricket","crown","crs","cruise","cruises","cu","cuisinella","cv","cw","cx","cy","cymru","cyou","cz","dad","dance","data","date","dating","datsun","day","dclk","dds","de","deal","dealer","deals","degree","delivery","dell","deloitte","delta","democrat","dental","dentist","desi","design","dev","dhl","diamonds","diet","digital","direct","directory","discount","discover","dish","diy","dj","dk","dm","dnp","do","docs","doctor","dog","domains","dot","download","drive","dtv","dubai","dunlop","dupont","durban","dvag","dvr","dz","earth","eat","ec","eco","edeka","edu","education","ee","eg","email","emerck","energy","engineer","engineering","enterprises","epson","equipment","er","ericsson","erni","es","esq","estate","et","eu","eurovision","eus","events","exchange","expert","exposed","express","extraspace","fage","fail","fairwinds","faith","family","fan","fans","farm","farmers","fashion","fast","fedex","feedback","ferrari","ferrero","fi","fidelity","fido","film","final","finance","financial","fire","firestone","firmdale","fish","fishing","fit","fitness","fj","fk","flickr","flights","flir","florist","flowers","fly","fm","fo","foo","food","football","ford","forex","forsale","forum","foundation","fox","fr","free","fresenius","frl","frogans","frontier","ftr","fujitsu","fun","fund","furniture","futbol","fyi","ga","gal","gallery","gallo","gallup","game","games","gap","garden","gay","gb","gbiz","gd","gdn","ge","gea","gent","genting","george","gf","gg","ggee","gh","gi","gift","gifts","gives","giving","gl","glass","gle","global","globo","gm","gmail","gmbh","gmo","gmx","gn","godaddy","gold","goldpoint","golf","goo","goodyear","goog","google","gop","got","gov","gp","gq","gr","grainger","graphics","gratis","green","gripe","grocery","group","gs","gt","gu","gucci","guge","guide","guitars","guru","gw","gy","hair","hamburg","hangout","haus","hbo","hdfc","hdfcbank","health","healthcare","help","helsinki","here","hermes","hiphop","hisamitsu","hitachi","hiv","hk","hkt","hm","hn","hockey","holdings","holiday","homedepot","homegoods","homes","homesense","honda","horse","hospital","host","hosting","hot","hotels","hotmail","house","how","hr","hsbc","ht","hu","hughes","hyatt","hyundai","ibm","icbc","ice","icu","id","ie","ieee","ifm","ikano","il","im","imamat","imdb","immo","immobilien","in","inc","industries","infiniti","info","ing","ink","institute","insurance","insure","int","international","intuit","investments","io","ipiranga","iq","ir","irish","is","ismaili","ist","istanbul","it","itau","itv","jaguar","java","jcb","je","jeep","jetzt","jewelry","jio","jll","jm","jmp","jnj","jo","jobs","joburg","jot","joy","jp","jpmorgan","jprs","juegos","juniper","kaufen","kddi","ke","kerryhotels","kerryproperties","kfh","kg","kh","ki","kia","kids","kim","kindle","kitchen","kiwi","km","kn","koeln","komatsu","kosher","kp","kpmg","kpn","kr","krd","kred","kuokgroup","kw","ky","kyoto","kz","la","lacaixa","lamborghini","lamer","lancaster","land","landrover","lanxess","lasalle","lat","latino","latrobe","law","lawyer","lb","lc","lds","lease","leclerc","lefrak","legal","lego","lexus","lgbt","li","lidl","life","lifeinsurance","lifestyle","lighting","like","lilly","limited","limo","lincoln","link","live","living","lk","llc","llp","loan","loans","locker","locus","lol","london","lotte","lotto","love","lpl","lplfinancial","lr","ls","lt","ltd","ltda","lu","lundbeck","luxe","luxury","lv","ly","ma","madrid","maif","maison","makeup","man","management","mango","map","market","marketing","markets","marriott","marshalls","mattel","mba","mc","mckinsey","md","me","med","media","meet","melbourne","meme","memorial","men","menu","merckmsd","mg","mh","miami","microsoft","mil","mini","mint","mit","mitsubishi","mk","ml","mlb","mls","mm","mma","mn","mo","mobi","mobile","moda","moe","moi","mom","monash","money","monster","mormon","mortgage","moscow","moto","motorcycles","mov","movie","mp","mq","mr","ms","msd","mt","mtn","mtr","mu","museum","music","mv","mw","mx","my","mz","na","nab","nagoya","name","navy","nba","nc","ne","nec","net","netbank","netflix","network","neustar","new","news","next","nextdirect","nexus","nf","nfl","ng","ngo","nhk","ni","nico","nike","nikon","ninja","nissan","nissay","nl","no","nokia","norton","now","nowruz","nowtv","np","nr","nra","nrw","ntt","nu","nyc","nz","obi","observer","office","okinawa","olayan","olayangroup","ollo","om","omega","one","ong","onl","online","ooo","open","oracle","orange","org","organic","origins","osaka","otsuka","ott","ovh","pa","page","panasonic","paris","pars","partners","parts","party","pay","pccw","pe","pet","pf","pfizer","pg","ph","pharmacy","phd","philips","phone","photo","photography","photos","physio","pics","pictet","pictures","pid","pin","ping","pink","pioneer","pizza","pk","pl","place","play","playstation","plumbing","plus","pm","pn","pnc","pohl","poker","politie","porn","post","pr","pramerica","praxi","press","prime","pro","prod","productions","prof","progressive","promo","properties","property","protection","pru","prudential","ps","pt","pub","pw","pwc","py","qa","qpon","quebec","quest","racing","radio","re","read","realestate","realtor","realty","recipes","red","redstone","redumbrella","rehab","reise","reisen","reit","reliance","ren","rent","rentals","repair","report","republican","rest","restaurant","review","reviews","rexroth","rich","richardli","ricoh","ril","rio","rip","ro","rocks","rodeo","rogers","room","rs","rsvp","ru","rugby","ruhr","run","rw","rwe","ryukyu","sa","saarland","safe","safety","sakura","sale","salon","samsclub","samsung","sandvik","sandvikcoromant","sanofi","sap","sarl","sas","save","saxo","sb","sbi","sbs","sc","scb","schaeffler","schmidt","scholarships","school","schule","schwarz","science","scot","sd","se","search","seat","secure","security","seek","select","sener","services","seven","sew","sex","sexy","sfr","sg","sh","shangrila","sharp","shell","shia","shiksha","shoes","shop","shopping","shouji","show","si","silk","sina","singles","site","sj","sk","ski","skin","sky","skype","sl","sling","sm","smart","smile","sn","sncf","so","soccer","social","softbank","software","sohu","solar","solutions","song","sony","soy","spa","space","sport","spot","sr","srl","ss","st","stada","staples","star","statebank","statefarm","stc","stcgroup","stockholm","storage","store","stream","studio","study","style","su","sucks","supplies","supply","support","surf","surgery","suzuki","sv","swatch","swiss","sx","sy","sydney","systems","sz","tab","taipei","talk","taobao","target","tatamotors","tatar","tattoo","tax","taxi","tc","tci","td","tdk","team","tech","technology","tel","temasek","tennis","teva","tf","tg","th","thd","theater","theatre","tiaa","tickets","tienda","tips","tires","tirol","tj","tjmaxx","tjx","tk","tkmaxx","tl","tm","tmall","tn","to","today","tokyo","tools","top","toray","toshiba","total","tours","town","toyota","toys","tr","trade","trading","training","travel","travelers","travelersinsurance","trust","trv","tt","tube","tui","tunes","tushu","tv","tvs","tw","tz","ua","ubank","ubs","ug","uk","unicom","university","uno","uol","ups","us","uy","uz","va","vacations","vana","vanguard","vc","ve","vegas","ventures","verisign","vermögensberater","vermögensberatung","versicherung","vet","vg","vi","viajes","video","vig","viking","villas","vin","vip","virgin","visa","vision","viva","vivo","vlaanderen","vn","vodka","volvo","vote","voting","voto","voyage","vu","wales","walmart","walter","wang","wanggou","watch","watches","weather","weatherchannel","webcam","weber","website","wed","wedding","weibo","weir","wf","whoswho","wien","wiki","williamhill","win","windows","wine","winners","wme","wolterskluwer","woodside","work","works","world","wow","ws","wtc","wtf","xbox","xerox","xihuan","xin","xxx","xyz","yachts","yahoo","yamaxun","yandex","ye","yodobashi","yoga","yokohama","you","youtube","yt","yun","za","zappos","zara","zero","zip","zm","zone","zuerich","zw","ελ","ευ","бг","бел","дети","ею","католик","ком","мкд","мон","москва","онлайн","орг","рус","рф","сайт","срб","укр","қаз","հայ","ישראל","קום","ابوظبي","ارامكو","الاردن","البحرين","الجزائر","السعودية","العليان","المغرب","امارات","ایران","بارت","بازار","بيتك","بھارت","تونس","سودان","سورية","شبكة","عراق","عرب","عمان","فلسطين","قطر","كاثوليك","كوم","مصر","مليسيا","موريتانيا","موقع","همراه","پاکستان","ڀارت","कॉम","नेट","भारत","भारतम्","भारोत","संगठन","বাংলা","ভারত","ভাৰত","ਭਾਰਤ","ભારત","ଭାରତ","இந்தியா","இலங்கை","சிங்கப்பூர்","భారత్","ಭಾರತ","ഭാരതം","ලංකා","คอม","ไทย","ລາວ","გე","みんな","アマゾン","クラウド","グーグル","コム","ストア","セール","ファッション","ポイント","世界","中信","中国","中國","中文网","亚马逊","企业","佛山","信息","健康","八卦","公司","公益","台湾","台灣","商城","商店","商标","嘉里","嘉里大酒店","在线","大拿","天主教","娱乐","家電","广东","微博","慈善","我爱你","手机","招聘","政务","政府","新加坡","新闻","时尚","書籍","机构","淡马锡","游戏","澳門","点看","移动","组织机构","网址","网店","网站","网络","联通","谷歌","购物","通販","集团","電訊盈科","飞利浦","食品","餐厅","香格里拉","香港","닷넷","닷컴","삼성","한국"]');var Qy;function xR(){if(Qy)return Zl;Qy=1,Object.defineProperty(Zl,"__esModule",{value:!0});var n=SR(),r=u(n),i=TR,l=u(i);function u(h){return h&&h.__esModule?h:{default:h}}var f=new r.default;return f.tlds(l.default),Zl.default=function(h){return f.match(h)},Zl}var Xl={},Ky;function AR(){return Ky||(Ky=1,Object.defineProperty(Xl,"__esModule",{value:!0}),Xl.default=function(n){return n}),Xl}var $y;function OR(){if($y)return Vl;$y=1,Object.defineProperty(Vl,"__esModule",{value:!0});var n=function(){function U(M,O){for(var R=0;R<O.length;R++){var S=O[R];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(M,S.key,S)}}return function(M,O,R){return O&&U(M.prototype,O),R&&U(M,R),M}}(),r=Ia(),i=y(r),l=pR(),u=E(l),f=gR(),h=E(f),d=xR(),m=E(d),g=AR(),_=E(g);function E(U){return U&&U.__esModule?U:{default:U}}function y(U){if(U&&U.__esModule)return U;var M={};if(U!=null)for(var O in U)Object.prototype.hasOwnProperty.call(U,O)&&(M[O]=U[O]);return M.default=U,M}function x(U,M){if(!(U instanceof M))throw new TypeError("Cannot call a class as a function")}function T(U,M){if(!U)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:U}function z(U,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);U.prototype=Object.create(M&&M.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(U,M):U.__proto__=M)}var N=function(U){z(M,U);function M(){return x(this,M),T(this,(M.__proto__||Object.getPrototypeOf(M)).apply(this,arguments))}return n(M,[{key:"parseString",value:function(R){var S=this;if(R==="")return R;var k=this.props.matchDecorator(R);if(!k)return R;var Y=[],K=0;return k.forEach(function(re,ee){re.index>K&&Y.push(R.substring(K,re.index));var le=S.props.hrefDecorator(re.url),ie=S.props.textDecorator(re.text),de=S.props.componentDecorator(le,ie,ee);Y.push(de),K=re.lastIndex}),R.length>K&&Y.push(R.substring(K)),Y.length===1?Y[0]:Y}},{key:"parse",value:function(R){var S=this,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof R=="string"?this.parseString(R):i.isValidElement(R)&&R.type!=="a"&&R.type!=="button"?i.cloneElement(R,{key:k},this.parse(R.props.children)):Array.isArray(R)?R.map(function(Y,K){return S.parse(Y,K)}):R}},{key:"render",value:function(){return i.createElement(i.Fragment,null,this.parse(this.props.children))}}]),M}(i.Component);return N.defaultProps={componentDecorator:u.default,hrefDecorator:h.default,matchDecorator:m.default,textDecorator:_.default},Vl.default=N,Vl}var Jy;function wR(){if(Jy)return Il;Jy=1,Object.defineProperty(Il,"__esModule",{value:!0});var n=OR(),r=i(n);function i(l){return l&&l.__esModule?l:{default:l}}return Il.default=r.default,Il}var RR=wR();const CR=po(RR),NR="_text_gp0s0_1",DR="_command_gp0s0_5",Wy={text:NR,command:DR},vv=({text:n,commands:r=[],onLinkClick:i})=>{const l=d=>m=>(m.preventDefault(),d&&i(d),!1),u=(d,m,g)=>v.jsx("a",{onClick:l(d),role:"button",children:m},g),f=r.find(d=>n.startsWith(`/${d}`)),h=f?n.slice(f.length+1):n;return v.jsxs("div",{children:[f&&v.jsxs("code",{className:Wy.command,children:["/",f]}),h.split(`
106
- `).map((d,m)=>v.jsxs("span",{className:Wy.text,children:[v.jsx(CR,{componentDecorator:u,children:d}),v.jsx("br",{})]},m))]})},MR=({subtitle:n,onLinkClick:r})=>n?v.jsx("div",{className:Ot.subtitle,children:v.jsx(vv,{text:n,onLinkClick:r})}):null,e_="newtab#",Ev=({markdown:n,markdownOptions:r={},onLinkClick:i})=>{const l=f=>h=>(h.preventDefault(),f&&i(f),!1),u=({title:f,href:h,children:d})=>h.indexOf(e_)===0?v.jsx("a",{href:h.slice(e_.length),title:f,target:"_blank",rel:"noopener noreferrer",children:d}):v.jsx("a",{onClick:l(h),title:f,href:h,children:d});return v.jsx(En,{options:{...r,overrides:{a:u}},children:n})},BR=({text:n,onLinkClick:r})=>n?v.jsx("div",{children:v.jsx(Ev,{markdown:n,onLinkClick:r})}):null,jR=({title:n})=>n?v.jsx("h1",{className:Ot.title,children:n}):null,UR=({title:n,text:r,subtitle:i,buttons:l,onButtonClick:u,onLinkClick:f})=>(n==null?void 0:n.length)||(r==null?void 0:r.length)||(i==null?void 0:i.length)||(l==null?void 0:l.length)?v.jsxs("div",{className:Z(me.bubbleContent),children:[v.jsx(jR,{title:n}),v.jsx(BR,{text:r,onLinkClick:f}),v.jsx(MR,{subtitle:i,onLinkClick:f}),v.jsx(mR,{buttons:l,onButtonClick:u})]}):null,HR=({alt:n,imageUrl:r,itemUrl:i,hasBody:l})=>r?i?i.indexOf("youtube.com")>-1?v.jsx("div",{className:Ot.video_container,children:v.jsx("iframe",{className:Z(Ot.video,{[Ot.only]:!l}),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:Ot.imageContainer,children:v.jsx("img",{className:Z(Ot.image,{[Ot.only]:!l}),src:r,alt:n})})}):v.jsx("div",{className:Ot.imageContainer,children:v.jsx("img",{className:Z(Ot.image,{[Ot.only]:!l}),src:r,alt:n})}):null,LR=({title:n,text:r,subtitle:i,imageUrl:l,itemUrl:u,buttons:f,sources:h,onButtonClick:d,onLinkClick:m})=>{const g=!!(n!=null&&n.length)||!!(r!=null&&r.length)||!!(i!=null&&i.length)||!!(f!=null&&f.length);return v.jsxs("div",{className:Z(Ot.detailMessage),children:[v.jsx(HR,{hasBody:g,imageUrl:l,itemUrl:u,alt:n||i}),g&&v.jsx(UR,{title:n,text:r,subtitle:i,buttons:f,onLinkClick:m,onButtonClick:d}),v.jsx(Wh,{sources:h,onLinkClick:m})]})},zR=F.forwardRef(({isFirstMessageBySender:n,isLastMessageBySender:r,children:i},l)=>{const u=Ke();return v.jsx("li",{ref:l,className:Z(me.message,me.messageGuest,n&&me.messageGuestFirst,r&&me.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:v.jsx("div",{className:Z(me.bubble,me.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":u("guest-bubble.label"),children:v.jsx("div",{className:Z(me.rightText),children:i})})})}),kR="_markdown_nw7vg_1",Sv={markdown:kR},Ql="source-info-reference",GR=({markdown:n,sources:r,onLinkClick:i})=>{const l=Pa(),u=qR(),f=Jt(m=>{const g=m.chat.sourceInfos;if((g==null?void 0:g.type)==="loaded"||(g==null?void 0:g.type)==="loading")return g.chunkId}),h=m=>g=>{const _=g.key;(_==="ArrowDown"||_==="ArrowRight"||_==="Enter"||_===" "||_==="Space")&&(g.stopPropagation(),l(Ny(m)))},d=m=>()=>{l(Ny(m))};return F.useLayoutEffect(()=>{document.querySelectorAll(`.${Ql}`).forEach(m=>{var E,y,x,T;const g=m.previousSibling;g&&g.nodeType===Node.TEXT_NODE&&((E=g.textContent)!=null&&E.endsWith(" "))&&((y=g.textContent)!=null&&y.trim().length)&&m.classList.add(`${Ql}--before-space`);const _=m.nextSibling;_&&_.nodeType===Node.TEXT_NODE&&((x=_.textContent)!=null&&x.startsWith(" "))&&((T=_.textContent)!=null&&T.trim().length)&&m.classList.add(`${Ql}--after-space`)})},[n]),v.jsxs("div",{className:me.bubbleContent,children:[v.jsx("div",{className:Sv.markdown,children:v.jsx(Ev,{markdown:n,onLinkClick:i,markdownOptions:{renderRule(m,g,_,E){if(g.type===ue.footnoteReference){const y=g.text===f;return v.jsx("span",{className:Z(me.sourceInfoReference,y&&me.sourceInfoReferenceActive,Ql),children:v.jsx("a",{type:"button",tabIndex:0,onClick:d(g.text),onKeyDown:h(g.text),children:u(g.text)})},E.key)}return m()}}})}),v.jsx(Wh,{sources:r,onLinkClick:i})]})},qR=()=>{const n=[];return i=>{const l=n.indexOf(i);return l>-1?l+1:(n.push(i),n.length)}},FR=({text:n,commands:r,sources:i,onLinkClick:l})=>v.jsxs("div",{className:me.bubbleContent,children:[v.jsx(vv,{text:n,commands:r,onLinkClick:l}),v.jsx(Wh,{sources:i,onLinkClick:l})]}),IR=F.forwardRef(({message:n,commands:r,isLastMessage:i,isFirstMessageBySender:l,isLastMessageBySender:u,onReaction:f,onButtonClick:h,onLinkClick:d},m)=>{const g=VR(n,r,h,d);switch(n.sender.type){case Ee.UserType.GUEST:return v.jsx(zR,{ref:m,isFirstMessageBySender:l,isLastMessageBySender:u,children:g});default:{const _=E=>f(n._id,E);return v.jsx(pv,{ref:m,message:n,isAnimated:!1,isLastMessage:i,isFirstMessageBySender:l,isLastMessageBySender:u,onReaction:_,children:g})}}}),VR=(n,r,i,l)=>{switch(n.type){case Ee.MessageTypeEnum.TEXT:{const u=n;return v.jsx(FR,{text:u.text,commands:r,sources:n.sources||[],onLinkClick:l})}case Ee.MessageTypeEnum.DETAIL:{const u=n;return v.jsx(LR,{title:u.title,text:u.text,subtitle:u.subtitle,imageUrl:u.imageUrl,itemUrl:u.itemUrl,buttons:u.buttons,sources:n.sources||[],onButtonClick:i,onLinkClick:l})}case Ee.MessageTypeEnum.MARKDOWN:{const u=n;return v.jsx(GR,{markdown:u.markdown,sources:u.sources||[],onLinkClick:l})}}},PR=(n,r)=>n.message._id===r.message._id&&n.message.reaction===r.message.reaction&&n.isLastMessage===r.isLastMessage&&n.isFirstMessageBySender===r.isFirstMessageBySender&&n.isLastMessageBySender===r.isLastMessageBySender,YR=k_.memo(IR,PR),ZR="_ticontainer_xg0dn_1",XR="_tiblock_xg0dn_5",QR="_tidot_xg0dn_12",Wi={ticontainer:ZR,tiblock:XR,tidot:QR},KR=({isTyping:n=!1})=>v.jsx("div",{className:Wi.ticontainer,children:v.jsx("div",{className:Wi.tiblock,children:n?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:Z(Wi.tidot,"chat__typingIndicator")}),v.jsx("div",{className:Z(Wi.tidot,"chat__typingIndicator")}),v.jsx("div",{className:Z(Wi.tidot,"chat__typingIndicator")})]}):null})}),$R=Object.assign({_id:"typing-indicator"},new Ee.TextMessage("",new Ee.BotUser)),JR=({messages:n,isBotTyping:r,commands:i,onTranscriptItemReaction:l,onButtonClick:u,onLinkClick:f})=>{const h=F.useRef(0),d=F.useRef(!0),m=F.useRef(null),g=F.useRef(null),_=F.useRef(null),E=Jt(T=>T.settings.enableGeneralConditions);F.useLayoutEffect(()=>{if(n.length&&m.current&&(h.current<n.length||r)){if(g.current){const T=g.current.offsetTop;m.current.scrollTop=T}else if(_.current){const T=_.current.offsetTop;m.current.scrollTop=T}d.current&&(d.current=!1),h.current=n.length}},[n,d,r]);let y;const x=n.length;return v.jsxs("div",{ref:m,className:Z(Dy.messageContainer,"chat__messageContainer"),style:{scrollBehavior:n.length&&d.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[E&&v.jsx(ww,{}),v.jsxs("ul",{className:Dy.messages,children:[n.map((T,z)=>{const N=WR(T,y),U=eC(T,z,n,r);y=T.sender.type;const M=z+1===x;return v.jsx(YR,{ref:M?_:null,message:T,commands:i,isLastMessage:M,isFirstMessageBySender:N,isLastMessageBySender:U,onButtonClick:u,onLinkClick:f,onReaction:l},M&&!r?"last":T._id)}),r&&v.jsx(pv,{ref:g,message:$R,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:y!==Ee.UserType.BOT,isLastMessageBySender:!0,children:v.jsx(KR,{isTyping:!0})},"last")]})]})},WR=(n,r)=>!r||r!==n.sender.type,eC=(n,r,i,l)=>{var d;const u=n.sender.type,f=i.length;return r+1===f?!(u===Ee.UserType.BOT&&l):u!==((d=i.at(r+1))==null?void 0:d.sender.type)},Tv=()=>tC(window.location.pathname),tC=n=>{const r=n.split("/"),i=n.endsWith("/");return r[r.length-(i?2:1)]},ed=()=>F.useMemo(()=>Tv(),[]),nC="_bottomSheet_jp8dl_1",rC="_bottomSheetOpen_jp8dl_15",aC="_bottomSheetClose_jp8dl_20",Pn={bottomSheet:nC,bottomSheetOpen:rC,bottomSheetClose:aC},iC="_container_xc2nx_1",t_={container:iC},sC=({contentUrl:n})=>{const r=ed(),[i,l]=F.useState(!1);F.useEffect(()=>{l(f=>f||!!n)},[n]);const u=F.useMemo(()=>{if(n&&n.startsWith("/"))return new URL(`/${r}${n}`,document.baseURI).toString()},[n,r]);return v.jsx("div",{className:Z(t_.container,Pn.bottomSheet,{[Pn.bottomSheetOpen]:!!n,[Pn.bottomSheetClose]:i&&!n}),children:u&&v.jsx("iframe",{title:"Drawer",src:u,className:t_.iframe})})},lC="_container_tr4tn_1",oC={container:lC},uC=({title:n,href:r,children:i})=>v.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),cC=()=>{const r=Ke()("powered-by");return r&&r.length?v.jsx("div",{className:Z(oC.container,"chat__poweredBy"),children:v.jsx(En,{options:{overrides:{a:uC}},children:r})}):null},n_=({className:n,children:r,...i})=>v.jsx(Ao,{className:Z(ls.buttonDefault,n),type:"button",...i,children:r}),os=({className:n,children:r,...i})=>v.jsx(Ao,{className:Z(ls.buttonPrimary,n),...i,children:r}),fC="_container_h23mk_1",hC="_formContainer_h23mk_17",dC="_emailInput_h23mk_22",mC="_description_h23mk_52",pC="_actions_h23mk_57",gC="_validationError_h23mk_67",yC="_submitted_h23mk_74",Fn={container:fC,formContainer:hC,emailInput:dC,description:mC,actions:pC,validationError:gC,submitted:yC},_C=({visible:n,enableTranscriptExportPdf:r,enableTranscriptExportEmail:i,onEmailExport:l,onPdfExport:u,onClose:f})=>{const h=Ke(),[d,m]=F.useState(void 0),[g,_]=F.useState(!1),[E,y]=F.useState(!1),[x,T]=F.useState(void 0),z=F.useRef(null);F.useEffect(()=>{var O;n?((O=z.current)==null||O.focus(),_(!1),y(!1),m(n)):d===!0&&m(!1)},[n,d]);const N=O=>{O.preventDefault(),x&&x.length>0&&(l(x),_(!0),setTimeout(f,3*1e3))},U=O=>{const R=O.target.value.trim(),S=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(R);T(S?R:"")},M=()=>{y(!0),u(),setTimeout(f,3*1e3)};return v.jsxs("div",{className:Z(Fn.container,Pn.bottomSheet,{[Pn.bottomSheetOpen]:d===!0,[Pn.bottomSheetClose]:d===!1}),children:[r&&v.jsxs(v.Fragment,{children:[v.jsx("h2",{children:h("export-transcript.pdf.title")}),v.jsx(En,{className:Fn.description,children:h("export-transcript.pdf.description")||""}),v.jsxs("div",{className:Fn.actions,children:[v.jsx(n_,{onClick:f,children:h("export-transcript.pdf.cancel")}),v.jsx(os,{onClick:M,disabled:E,children:h("export-transcript.pdf.download")})]})]}),i&&v.jsxs(v.Fragment,{children:[v.jsx("h2",{children:h("export-transcript.email.title")}),v.jsx(En,{className:Fn.description,children:h("export-transcript.email.description")||""}),v.jsxs("form",{onSubmit:N,className:Fn.formContainer,children:[v.jsxs("div",{children:[v.jsx("input",{disabled:g,ref:z,type:"email",placeholder:h("export-transcript.email.placeholder"),className:Fn.emailInput,onChange:U}),(x==null?void 0:x.length)===0?v.jsx("div",{className:Fn.validationError,children:h("export-transcript.email.invalid")}):null]}),v.jsxs("div",{className:Fn.actions,children:[v.jsx(n_,{onClick:f,children:h("export-transcript.email.cancel")}),v.jsx(os,{type:"submit",disabled:g||x===void 0||x.length===0,children:h("export-transcript.email.send")})]})]}),g&&v.jsx("div",{className:Fn.submitted,children:h("export-transcript.email.success")})]})]})},bC="_inputContainer_fi5ao_1",vC={inputContainer:bC},EC="_blockUserInput_pot9c_1",SC={blockUserInput:EC},TC=({visible:n})=>{const r=Ke();return n?v.jsx("div",{className:Z(SC.blockUserInput,"chat__blockUserInput"),children:r("block-user-input.title")}):null},xC="_commandsDropdown_5ytuv_1",AC="_commands_5ytuv_1",OC="_command_5ytuv_1",wC="_commandActive_5ytuv_46",RC="_commandsSelections_5ytuv_55",ns={commandsDropdown:xC,commands:AC,command:OC,commandActive:wC,commandsSelections:RC},CC=(n,r)=>{F.useEffect(()=>{const i=l=>{n.current&&!n.current.contains(l.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,r])},NC=(n,r,i,l,u)=>{F.useEffect(()=>{const f=h=>{if(n.length)switch(h.key){case"Enter":i(n[r]);break;case"ArrowUp":l(d=>d>0?d-1:n.length-1);break;case"ArrowDown":l(d=>d<n.length-1?d+1:0);break;case"Escape":u([]);break}};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[n,r,i,l,u])},DC=({text:n,commands:r,onSelectCommand:i,onVisibilityChange:l})=>{const u=F.useRef(null),f=Ke(),[h,d]=F.useState([]),[m,g]=F.useState(r_(r)),[_,E]=F.useState(0),y=x=>i(`/${x}`);return CC(u,()=>d([])),NC(h,_,y,E,d),F.useEffect(()=>{g(r_(r))},[r]),F.useEffect(()=>{const x=n.length||0;x===0||x>m||!n.startsWith("/")?d([]):d(r.filter(MC(n))),E(0)},[r,n,m]),F.useEffect(()=>{l(!!h.length)},[h,l]),h.length?v.jsx("div",{ref:u,className:ns.commandsDropdown,children:v.jsx("ul",{className:ns.commands,role:"listbox",children:h.map((x,T)=>v.jsxs("li",{className:Z([ns.command,_===T&&ns.commandActive]),role:"option",onClick:()=>y(x),onMouseOver:()=>E(T),children:[v.jsxs("h1",{children:["/",x]}),v.jsx("p",{children:f(`commands.${x}`)})]},x))})}):null},r_=n=>Math.max(...n.map(r=>r.length+1)),MC=n=>r=>{const i=`/${r}`;return i.startsWith(n)&&i.length>=n.length},a_=3,BC=({commands:n,onSelectCommand:r})=>{const i=Ke(),[l,u]=F.useState(!1),f=g=>()=>{r(`/${g}`),u(!1)},h=()=>{u(!0)},d=()=>{u(!1)},m=l?n:n.slice(0,a_);return v.jsxs("div",{className:ns.commandsSelections,children:[m.map(g=>v.jsxs("button",{className:"tooltip--top-center","aria-label":i(`commands.${g}`),"data-title":i(`commands.${g}`),tabIndex:0,onClick:f(g),children:["/",g]},g)),m.length<n.length?v.jsx("button",{"aria-label":i("commands.show-more.tooltip"),"data-title":i("commands.show-more.tooltip"),tabIndex:0,onClick:h,children:i("commands.show-more.action")},"show-more"):m.length>a_?v.jsx("button",{"aria-label":i("commands.show-less.tooltip"),"data-title":i("commands.show-less.tooltip"),tabIndex:0,onClick:d,children:i("commands.show-less.action")},"show-less"):null]})},jC="_callToActionContainer_bkfcm_1",UC="_callToActionTitle_bkfcm_23",HC="_rateOverlay_bkfcm_30",LC="_body_bkfcm_52",zC="_footer_bkfcm_60",kC="_actions_bkfcm_73",GC="_bubbles_bkfcm_101",qC="_stars_bkfcm_203",FC="_starsSmall_bkfcm_215",IC="_starsLarge_bkfcm_219",VC="_star_bkfcm_203",PC="_starReadonly_bkfcm_236",YC="_starIcon_bkfcm_246",ZC="_starsDescriptionContainer_bkfcm_264",XC="_starsDescription_bkfcm_264",vt={callToActionContainer:jC,callToActionTitle:UC,rateOverlay:HC,body:LC,footer:zC,actions:kC,bubbles:GC,stars:qC,starsSmall:FC,starsLarge:IC,star:VC,starReadonly:PC,starIcon:YC,starsDescriptionContainer:ZC,starsDescription:XC},QC=({value:n,index:r,count:i,readonly:l,onHover:u,onClick:f})=>{const h=d=>{f&&d.key==="Enter"&&f()};return v.jsx("li",{className:Z(vt.star,{[vt.starReadonly]:l},"chat__conversationRating__star"),children:v.jsx("div",{role:"radio","aria-checked":n>r?"true":"false","aria-posinset":r+1,"aria-setsize":i,tabIndex:0,onMouseOver:u,onKeyDown:h,onClick:f,children:v.jsx("span",{role:"img","aria-label":"Star",className:Z(vt.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"})})})})})},i_=5,xv=({value:n,size:r,readonly:i=!1,onChange:l})=>{const[u,f]=F.useState(void 0),h=()=>{f(void 0)},d=g=>()=>{if(!i){const _=g+1;f(_)}},m=g=>()=>{l&&!i&&(l(g===0&&n===1?0:g+1),f(void 0))};return v.jsx("ul",{tabIndex:0,role:"radiogroup",className:Z(vt.stars,{[vt.starsSmall]:r==="small",[vt.starsLarge]:r==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:r==="small",chat__conversationRating__stars__large:r==="large"}),onMouseOut:h,children:Array(i_).fill(0).map((g,_)=>v.jsx(QC,{value:u===void 0?n:u,index:_,count:i_,readonly:i,onHover:d(_),onClick:m(_)},_))})},KC=({visible:n,onRate:r})=>{const i=Ke();return n?v.jsxs("div",{className:Z(vt.callToActionContainer,"chat__conversationRating__callToAction"),children:[v.jsx("div",{className:Z(vt.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),v.jsx(xv,{value:0,size:"small",onChange:r})]}):null},Nf=({isFirstMessageBySender:n,isLastMessageBySender:r,children:i})=>v.jsxs("div",{className:Z(me.message,me.messageBot,n&&me.messageBotFirst,r&&me.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:[v.jsx("img",{className:Z(me.avatar,me.botAvatar),src:"bot.svg",alt:"Bot"}),v.jsx("div",{className:Z(me.bubble,me.bubbleLeft,"chat__bubble","chat__botBubble"),children:v.jsx("div",{className:Z(me.leftText,me.bubbleContent),children:i})})]}),$C=({children:n})=>v.jsx("div",{className:Z(me.message,me.messageGuest,me.messageGuestFirst,me.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:v.jsx("div",{className:Z(me.bubble,me.bubbleRight,"chat__bubble","chat__guestBubble"),children:v.jsx("div",{className:Z(me.rightText,me.bubbleContent),children:n})})}),JC=({visible:n,rating:r,onRate:i,onClose:l})=>{const u=Ke(),[f,h]=F.useState(r),[d,m]=F.useState(void 0),[g,_]=F.useState(void 0),[E,y]=F.useState({submitted:!1,feedback:""}),[x,T]=F.useState(!1),z=F.useRef(null);F.useEffect(()=>{n?(y({submitted:!1,feedback:""}),_(n)):g===!0&&_(!1)},[n,g]),F.useEffect(()=>{h(r)},[r]),F.useEffect(()=>{const U=u(`conversation-rating.overlay.bot-message.rate-feedback.value-${f}`);m(U!=null&&U.length?U:void 0)},[f,u]),F.useEffect(()=>{E.submitted?setTimeout(()=>T(!0),E.feedback.length?500:0):T(!1)},[E]);const N=U=>{var O,R;U.preventDefault();const M=((R=(O=z.current)==null?void 0:O.value)==null?void 0:R.trim())||"";i(f,M),y({submitted:!0,feedback:M})};return v.jsx("div",{className:Z(vt.rateOverlay,Pn.bottomSheet,"chat__conversationRating__overlay",{[Pn.bottomSheetOpen]:g===!0,[Pn.bottomSheetClose]:g===!1}),children:v.jsxs("form",{onSubmit:N,children:[v.jsxs("div",{className:Z(vt.body,"chat__conversationRating__overlay__body"),children:[v.jsx("div",{}),v.jsx("div",{className:Z(vt.bubbles),children:n&&d&&v.jsxs(v.Fragment,{children:[v.jsxs(Nf,{isFirstMessageBySender:!0,isLastMessageBySender:!1,children:[v.jsx("h2",{children:u("conversation-rating.overlay.title")}),v.jsxs("div",{className:Z(vt.starsDescriptionContainer),children:[v.jsx(xv,{value:f,size:"large",readonly:E.submitted,onChange:h}),v.jsxs("div",{className:Z(vt.starsDescription),children:[v.jsx("div",{children:u("conversation-rating.overlay.star.very-bad")}),v.jsx("div",{children:u("conversation-rating.overlay.star.very-good")})]})]})]}),v.jsx(Nf,{isFirstMessageBySender:!1,isLastMessageBySender:!x||!!E.feedback.length,children:v.jsx("div",{children:d})}),!!E.feedback.length&&v.jsx($C,{children:E.feedback}),x&&v.jsx(Nf,{isFirstMessageBySender:!!E.feedback.length,isLastMessageBySender:!0,children:v.jsx("div",{children:u("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),v.jsxs("div",{className:Z(vt.footer,"chat__conversationRating__overlay__footer"),children:[!E.submitted&&v.jsx("input",{ref:z,placeholder:u("conversation-rating.overlay.guest-feedback.input-placeholder")}),v.jsx("div",{className:Z(vt.actions,"chat__conversationRating__overlay__footer__actions"),children:E.submitted?v.jsx(os,{type:"button",onClick:l,children:u("conversation-rating.overlay.action.close")}):v.jsx(os,{type:"submit",children:u("conversation-rating.overlay.action.submit")})})]})]})})},WC=({conversationRating:{enabled:n,rating:r},numberOfMessagesFromGuest:i,showRatingOverlay:l,setShowRatingOverlay:u,onRate:f})=>{const[h,d]=F.useState(0),m=E=>{d(E),u(!0)},g=()=>u(!1),_=!r&&i>=1;return n?v.jsxs(v.Fragment,{children:[v.jsx(KC,{visible:_,onRate:m}),v.jsx(JC,{visible:l,rating:h,onRate:f,onClose:g})]}):null},e3=F.memo(WC),t3="_inputWrapper_e3h44_1",n3="_withOpenCommands_e3h44_14",r3="_messageInputWrapper_e3h44_20",a3="_messageInput_e3h44_20",i3="_buttons_e3h44_44",s3="_button_e3h44_44",Pr={inputWrapper:t3,withOpenCommands:n3,messageInputWrapper:r3,messageInput:a3,buttons:i3,button:s3},l3="_audioRecorder_g845f_1",o3="_audioButton_g845f_6",u3="_recorderIcon_g845f_37",c3="_spinning_g845f_60",Yr={audioRecorder:l3,audioButton:o3,recorderIcon:u3,spinning:c3},s_=2048,mo=16e3;class f3 extends k_.Component{constructor(i){super(i);Ce(this,"audioInput",null);Ce(this,"volume",null);Ce(this,"leftchannel",[]);Ce(this,"recorder",null);Ce(this,"recordingLength",0);Ce(this,"sampleRate",null);Ce(this,"mediaStream",null);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(i){this.mediaStream=i,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(i)}initRecording(i){const l=window.AudioContext||window.webkitAudioContext,u=new l;this.sampleRate=u.sampleRate,this.volume=u.createGain(),this.audioInput=u.createMediaStreamSource(i),this.audioInput.connect(this.volume),this.recorder=u.createScriptProcessor(s_,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(u.destination)}processRecordingInput(i){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const l=i.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(l)),this.recordingLength+=s_}}handleClickSubmitAudio(){const i=d3(this.leftchannel,this.recordingLength),l=m3(i,this.sampleRate||0),u=h3(l);this.props.onAudioRecorded(u),this.handleClickStopAudio()}handleClickStopAudio(){var i,l,u,f;this.setState({recordingState:"none"}),(i=this.audioInput)==null||i.disconnect(),(l=this.volume)==null||l.disconnect(),(u=this.recorder)==null||u.disconnect(),this.mediaStream&&((f=this.mediaStream)==null||f.getAudioTracks().forEach(h=>{h.stop()}))}render(){return v.jsxs("div",{className:Yr.audioRecorder,children:[this.state.recordingState==="none"&&v.jsx("button",{className:Z(Yr.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:Yr.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:Yr.audioRecorder,children:[v.jsx("button",{className:Z(Yr.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:Yr.recorderIcon}),v.jsx("button",{className:Z(Yr.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 h3=n=>{const r=new ArrayBuffer(44+n.length*2),i=new DataView(r);Kl(i,0,"RIFF"),i.setUint32(4,44+n.length*2,!0),Kl(i,8,"WAVE"),Kl(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,mo,!0),i.setUint32(28,mo*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),Kl(i,36,"data"),i.setUint32(40,n.length*2,!0);const l=n.length;let u=44;const f=1;for(let h=0;h<l;h++)i.setInt16(u,n[h]*(32767*f),!0),u+=2;return new Blob([i],{type:"audio/wav"})},Kl=(n,r,i)=>{for(let l=0;l<i.length;l++)n.setUint8(r+l,i.charCodeAt(l))},d3=(n,r)=>{const i=new Float32Array(r);let l=0;const u=n.length;for(let f=0;f<u;f++){const h=n[f];i.set(h,l),l+=h.length}return i},m3=(n,r)=>{if(mo===r)return n;const i=r/mo,l=Math.round(n.length/i),u=new Float32Array(l);let f=0,h=0;for(;f<u.length;){const d=Math.round((f+1)*i);let m=0,g=0;for(let _=h;_<d&&_<n.length;_++)m+=n[_],g++;u[f]=m/g,f++,h=d}return u},p3=({disabled:n,textInput:r,commandsVisible:i,onTextInput:l,onTextInputSubmit:u,onAudioRecorded:f,onOpenTranscriptExportModal:h})=>{const d=Ke(),m=F.useRef(null),{enableTranscriptExportPdf:g,enableTranscriptExportEmail:_,enableSpeechSupport:E}=Jt(N=>N.settings);F.useEffect(()=>{var N;(N=m.current)==null||N.focus()},[r]);const y=()=>{const N=m.current;N&&r.trim().length>=1&&u(r.trim())&&(N.value="",N.style.height="",N.focus())},x=N=>{N.preventDefault(),y()},T=N=>{const U=N.target.value;l(U),N.target.style.height="";const{scrollHeight:M}=N.target;N.target.style.height=`${M>150?150:M}px`},z=N=>{N.code==="Enter"&&!N.shiftKey?(N.repeat||y(),N.preventDefault()):i&&(N.code==="ArrowUp"||N.code==="ArrowDown")&&N.preventDefault()};return v.jsxs("form",{className:Z(Pr.inputWrapper,i&&Pr.withOpenCommands,"chat__textInput"),onSubmit:x,children:[v.jsx("div",{className:Pr.messageInputWrapper,children:v.jsx("textarea",{id:"user_input",ref:m,className:Pr.messageInput,tabIndex:0,placeholder:d("message-input-placeholder"),value:r,onChange:T,onKeyDown:z,"aria-label":d("message-input-label"),"aria-controls":"command-list","aria-haspopup":"listbox"})}),v.jsxs("div",{className:Z(Pr.buttons,"chat__buttons"),children:[!r.length&&(g||_)&&v.jsx("button",{type:"button",className:Z(Pr.button,"chat__button"),"aria-label":d("message-input.actions.export-transcript.label"),"data-title":d("message-input.actions.export-transcript.label"),tabIndex:0,onClick:h,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:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"})})}),r.length||!E||navigator.mediaDevices===void 0?v.jsx("button",{className:Z(Pr.button,"chat__button"),type:"submit","aria-label":d("message-input.actions.submit.label"),"data-title":d("message-input.actions.submit.label"),tabIndex:0,disabled:n,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"})})}):E&&navigator.mediaDevices!==void 0&&v.jsx(f3,{translate:d,onAudioRecorded:f})]})]})},g3="_quickReplies_83npe_1",y3="_quickReply_83npe_9",l_={quickReplies:g3,quickReply:y3},_3=({quickReplies:n,onQuickReplyClick:r})=>n.length?v.jsx("div",{className:Z(l_.quickReplies,"chat__quickReplies"),children:n.map(i=>v.jsx(Ao,{tabIndex:0,className:Z(l_.quickReply,"chat__button","chat__quickReply"),onClick:()=>r(i),children:i.label},i.label))}):null,o_=5e3,b3=1e3,v3=({isBotTyping:n,quickReplies:r,conversationRating:i,numberOfMessagesFromGuest:l,showRatingOverlay:u,commands:f,setShowRatingOverlay:h,onTextInput:d,onRate:m,onQuickReplyClick:g,onAudioRecorded:_,onOpenTranscriptExportModal:E})=>{const[y,x]=F.useState(""),[T,z]=F.useState(!1),[N,U]=F.useState(!1),M=F.useRef(0),O=F.useRef(0);F.useEffect(()=>{if(T&&!n){const k=M.current?Date.now()-M.current:0;k>o_?z(!1):setTimeout(()=>{z(!1)},o_-k)}},[T,n]),F.useEffect(()=>{T&&(M.current=Date.now())},[T]);const R=k=>{const Y=Date.now()-O.current<b3;return N?!1:n||Y?(z(!0),!1):(d(k),x(""),O.current=Date.now(),!0)},S=k=>{x(k+" ")};return v.jsxs("div",{className:Z(vC.inputContainer),children:[v.jsx(_3,{quickReplies:r,onQuickReplyClick:g}),v.jsx(TC,{visible:T}),!T&&v.jsx(e3,{conversationRating:i,numberOfMessagesFromGuest:l,onRate:m,showRatingOverlay:u,setShowRatingOverlay:h}),!!(f!=null&&f.length)&&v.jsx(DC,{text:y,commands:f,onSelectCommand:S,onVisibilityChange:U}),v.jsx(p3,{textInput:y,disabled:T,commandsVisible:N,onTextInput:x,onTextInputSubmit:R,onOpenTranscriptExportModal:E,onAudioRecorded:_}),!!(f!=null&&f.length)&&v.jsx(BC,{commands:f,onSelectCommand:x})]})},E3=({clientName:n,messages:r,quickReplies:i,isBotTyping:l,drawerContentUrl:u,conversationRating:f,onMessageFromUser:h,onRate:d,onQuickReplyClick:m,onButtonClick:g,onLinkClick:_,onAudioRecorded:E,onTranscriptExport:y,onPdfExport:x,onTranscriptItemReaction:T})=>{const z=Pa(),N=Jt(ee=>ee.connection.connectionState),{enableTranscriptExportPdf:U,enableTranscriptExportEmail:M,commands:O}=Jt(ee=>ee.settings),[R,S]=F.useState(!1),[k,Y]=F.useState(!1),K=U||M,re=r.filter(ee=>ee.sender.type===ho.GUEST).length;return F.useEffect(()=>{if(N===Kr.CONNECTED){const ee=_o.parse(window.location.search);z($b(n,ee))}},[n,N,z]),v.jsxs("div",{className:_f.container,children:[v.jsxs("div",{className:Z([_f.chatcontent,(R||k)&&_f.accessabilityHidden]),children:[v.jsx(JR,{messages:r,isBotTyping:l,commands:O,onButtonClick:g,onLinkClick:_,onTranscriptItemReaction:T}),v.jsx(v3,{isBotTyping:l,quickReplies:l?[]:i,numberOfMessagesFromGuest:re,conversationRating:R?{enabled:!1}:f,showRatingOverlay:k,setShowRatingOverlay:Y,commands:O,onRate:d,onQuickReplyClick:m,onTextInput:h,onAudioRecorded:E,onOpenTranscriptExportModal:()=>S(!R)}),v.jsx(cC,{})]}),K&&v.jsx(_C,{enableTranscriptExportPdf:U,enableTranscriptExportEmail:M,visible:R,onEmailExport:y,onPdfExport:()=>x(n),onClose:()=>S(!1)}),v.jsx(sC,{contentUrl:u})]})},S3=n=>{const{messages:r,quickReplies:i,isBotTyping:l,drawerContentUrl:u,conversationRating:f}=n.chat;return{messages:r,quickReplies:i,isBotTyping:l,drawerContentUrl:u,conversationRating:f}},T3=n=>({onRestartChat:(r,i)=>n(To(r,i)),onMessageFromUser:r=>n(Rb(r)),onRate:(r,i)=>n(oA(r,i)),onAudioRecorded:r=>n(rA(r)),onActionFromUser:r=>n(r),onQuickReplyClick:r=>n(wb(r)),onNluEvent:r=>n(jb(r)),onButtonClick:r=>n(cA(r)),onLinkClick:r=>n(fA(r)),onTranscriptExport:r=>n(iA(r)),onPdfExport:r=>n(sA(r)),onTranscriptItemReaction:(r,i)=>n(Ee.Actions.transcriptItemGuestReaction(r,i||null))}),x3=TS(S3,T3)(E3),Av=()=>{const[n,r]=F.useState(!1);return F.useEffect(()=>{r((()=>{try{return window.self!==window.top}catch{return!0}})())},[]),n},td=n=>r=>{const i=r.key;(i==="ArrowDown"||i==="ArrowRight"||i==="Enter"||i===" "||i==="Space")&&(r.stopPropagation(),n())},A3=({onClick:n})=>{const r=Ke();return Av()?v.jsx("button",{className:"tooltip--bottom-left","aria-label":r("header.close-chat"),"data-title":r("header.close-chat"),tabIndex:0,onClick:n,onKeyDown:td(n),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},O3=()=>{const n=Ke(),r=Av(),i=Jt(u=>u.settings.enableStandaloneView),l=()=>{window.open(window.location.href,"_blank")};return r&&i?v.jsx("button",{className:"tooltip--bottom-left","aria-label":n("header.expand-chat"),"data-title":n("header.expand-chat"),tabIndex:0,onClick:l,onKeyDown:td(l),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:"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"})})}):null},w3="_header_1hky6_1",R3="_logoContainer_1hky6_13",C3="_logo_1hky6_13",N3="_actions_1hky6_27",$l={header:w3,logoContainer:R3,logo:C3,actions:N3},D3=({onClick:n})=>{const r=Ke();return v.jsx("button",{className:"tooltip--bottom-left","aria-label":r("header.restart-chat"),"data-title":r("header.restart-chat"),tabIndex:0,onClick:n,onKeyDown:td(n),children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 32 32",children:[v.jsx("path",{d:"M14.506,23.578l-5.511,0l-3.993,3.501l-0.007,0.006c-0.302,0.261 -0.687,0.405 -1.084,0.405c-0.245,-0.001 -0.488,-0.055 -0.711,-0.161c-0.595,-0.277 -0.978,-0.886 -0.974,-1.551l-0,-19.558c-0,-0.939 0.761,-1.711 1.685,-1.711l21.189,-0c0.924,-0 1.685,0.772 1.685,1.711l0,5.104l-1.444,0l-0,-5.104c-0,-0.134 -0.109,-0.244 -0.241,-0.244l-21.189,-0c-0.132,-0 -0.24,0.11 -0.24,0.244l-0,19.558c0.001,0.133 0.109,0.242 0.24,0.242c0.056,-0 0.109,-0.019 0.152,-0.055l4.192,-3.675c0.131,-0.115 0.299,-0.179 0.472,-0.179l5.779,0l-0,1.467Z"}),v.jsx("path",{d:"M29.869,20.148c0,4.137 -3.373,7.556 -7.509,7.612l-0.102,-0c-1.943,0.004 -3.814,-0.741 -5.223,-2.078c-0.183,-0.172 -0.286,-0.412 -0.286,-0.664c-0,-0.501 0.412,-0.913 0.913,-0.913c0.233,-0 0.458,0.089 0.627,0.249c1.074,1.014 2.495,1.579 3.971,1.579c3.174,-0 5.785,-2.612 5.785,-5.785c-0,-3.173 -2.611,-5.784 -5.785,-5.784c-1.533,-0 -3.006,0.61 -4.09,1.694c-0.01,0.01 -0.019,0.019 -0.03,0.028l-1.447,1.322l1.302,0c0.502,0 0.914,0.413 0.914,0.914c-0,0.501 -0.412,0.913 -0.914,0.913l-3.653,0c-0.501,0 -0.913,-0.412 -0.913,-0.913l-0,-3.654c-0,-0.501 0.412,-0.913 0.913,-0.913c0.501,0 0.913,0.412 0.913,0.913l0,1.577l1.635,-1.496c1.426,-1.418 3.357,-2.215 5.368,-2.215c4.175,0 7.611,3.436 7.611,7.611c-0,0.001 -0,0.002 -0,0.003Z"})]})})},u_=({className:n,withActions:r=!0,...i})=>{const l=Pa(),u=ed(),f=()=>{const d=_o.parse(window.location.search);l(To(u,d))},h=()=>{l($A())};return v.jsxs("div",{className:Z([$l.header,n]),...i,children:[v.jsx("div",{className:$l.logoContainer,children:v.jsx("div",{className:$l.logo})}),v.jsxs("div",{className:$l.actions,children:[r&&v.jsx(D3,{onClick:f}),v.jsx(O3,{}),v.jsx(A3,{onClick:h})]})]})},M3="_chatwindow_rkbir_1",B3="_chatwindowWithAside_rkbir_21",c_={chatwindow:M3,chatwindowWithAside:B3},j3="_sourceInfos_eg9te_12",U3="_loadingContent_eg9te_23",H3="_sourceDetails_eg9te_32",L3="_sourceHeader_eg9te_40",z3="_sourceHeaderIcon_eg9te_57",k3="_sourceContent_eg9te_61",G3="_openSourceButton_eg9te_69",q3="_sourceButtonLabel_eg9te_79",F3="_closeSourceInfosButton_eg9te_101",I3="_loadingSourceInfos_eg9te_125",V3="_loading_eg9te_23",P3="_loadingError_eg9te_139",Wt={sourceInfos:j3,loadingContent:U3,sourceDetails:H3,sourceHeader:L3,sourceHeaderIcon:z3,sourceContent:k3,openSourceButton:G3,sourceButtonLabel:q3,closeSourceInfosButton:F3,loadingSourceInfos:I3,loading:V3,loadingError:P3},Y3=({onClick:n})=>{const r=Ke();return v.jsx("button",{className:Z(Wt.closeSourceInfosButton,"tooltip--bottom-left"),"aria-label":r("source-infos.close"),"data-title":r("source-infos.close"),tabIndex:0,onClick:n,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"})})})},Z3=({sourceInfos:n,onClose:r})=>v.jsxs("div",{className:Wt.sourceHeader,children:[v.jsx("div",{children:n?v.jsx("p",{children:n.title}):v.jsx("p",{children:" "})}),v.jsx(Y3,{onClick:r})]}),X3=({title:n,href:r,children:i})=>v.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),Q3=({className:n,children:r,...i})=>v.jsx("a",{className:Z(ls.button,ls.buttonDefault,n),type:"button",...i,children:r}),K3=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,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"})}),$3=({type:n,...r})=>{switch(n){case"WEBSITE":return v.jsx(bv,{...r});case"PDF":return v.jsx(_v,{...r});case"DOCX":return v.jsx(gv,{...r});case"TEXT":return v.jsx(K3,{...r});default:return v.jsx(yv,{...r})}},J3=({url:n,knowledgeBaseType:r})=>{const i=Ke();return v.jsx(Q3,{className:Wt.openSourceButton,href:n,target:"_blank",children:v.jsxs("div",{className:Wt.sourceButtonLabel,children:[v.jsx("div",{className:Wt.sourceHeaderIcon,children:v.jsx($3,{type:r})}),v.jsx("p",{children:i("source-infos.open-source")})]})})},W3=({sourceInfos:{content:n,url:r,knowledgeBaseType:i}})=>v.jsxs(v.Fragment,{children:[v.jsx("div",{className:Z(Wt.sourceContent,Sv.markdown),children:v.jsx(En,{options:{overrides:{a:X3}},children:n})}),v.jsx(J3,{url:r,knowledgeBaseType:i})]}),e6=""+new URL("undraw_fixing-bugs-D_eYxJc6.svg",import.meta.url).href,t6=()=>{const n=Ke();return v.jsxs("div",{className:Wt.loadingError,children:[v.jsx("h1",{children:n("source-infos.error.title")}),v.jsx("img",{src:e6,title:n("source-infos.error.title")}),v.jsx("p",{children:n("source-infos.error.info")})]})},n6=()=>v.jsx("div",{className:Wt.loadingSourceInfos,children:v.jsx("svg",{className:Wt.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"})})}),r6=()=>{const n=Pa(),r=Jt(l=>l.chat.sourceInfos),i=()=>{n(WA())};return r?v.jsxs("div",{className:Z(Wt.sourceInfos,r.type==="loading"?Wt.loadingContent:""),children:[v.jsx("div",{className:Wt.sourceDetails,children:v.jsx(Z3,{sourceInfos:r.type==="loaded"?r:void 0,onClose:i})}),r.type==="loading"?v.jsx(n6,{}):r.type==="loading-error"?v.jsx(t6,{}):v.jsx(W3,{sourceInfos:r})]}):null},a6="_container_114wy_1",i6="_body_114wy_7",s6="_intro_114wy_14",l6="_footer_114wy_39",o6="_footnote_114wy_43",u6="_containerWithFootnote_114wy_58",c6="_startChatButton_114wy_73",f6="_formFields_114wy_77",h6="_formField_114wy_77",d6="_radio_114wy_89",m6="_checkbox_114wy_96",p6="_input_114wy_104",g6="_inputLabel_114wy_138",y6="_selectWrapper_114wy_142",_6="_select_114wy_142",b6="_selectLabel_114wy_188",ht={container:a6,body:i6,intro:s6,footer:l6,footnote:o6,containerWithFootnote:u6,startChatButton:c6,formFields:f6,formField:h6,radio:d6,checkbox:m6,input:p6,inputLabel:g6,selectWrapper:y6,select:_6,selectLabel:b6},v6=({name:n,label:r,defaultValue:i,required:l,onChange:u})=>{const f=h=>{u(h.currentTarget.checked?"true":"false")};return v.jsxs("label",{className:Z(ht.checkbox,"chat__startScreen__checkbox"),htmlFor:n,children:[v.jsx("input",{type:"checkbox",id:n,name:n,defaultChecked:i==="true",required:l,onChange:f}),v.jsx("div",{children:r})]})},E6=({type:n,name:r,label:i,defaultValue:l,placeholder:u,required:f,multiple:h,min:d,max:m,pattern:g,onChange:_})=>{const E=y=>{_(y.target.value)};return v.jsxs("label",{className:Z(ht.input,"chat__startScreen__input"),htmlFor:r,children:[v.jsx("div",{className:Z(ht.inputLabel),children:i}),v.jsx("input",{type:n,id:r,name:r,defaultValue:l,placeholder:u,required:f,multiple:h,min:d,max:m,pattern:g,onChange:E})]})},S6=({name:n,value:r,label:i,defaultChecked:l,required:u,onChange:f})=>{const h=`${n}-${r}`,d=m=>{f(m.target.value)};return v.jsxs("label",{className:Z(ht.radio,"chat__startScreen__radio"),htmlFor:h,children:[v.jsx("input",{id:h,type:"radio",name:n,value:r,defaultChecked:l,required:u,onChange:d}),v.jsx("span",{className:Z(ht.label),children:i})]})},T6=({name:n,label:r,defaultValue:i,required:l,multiple:u,options:f,onChange:h})=>{const d=m=>{h(m.target.value)};return v.jsxs("label",{className:Z(ht.select,"chat__startScreen__select"),htmlFor:n,children:[v.jsx("div",{className:Z(ht.selectLabel),children:r}),v.jsx("div",{className:Z(ht.selectWrapper),children:v.jsx("select",{id:n,name:n,defaultValue:i,required:l,multiple:u,onChange:d,children:Object.entries(f||{}).map(([m,g])=>v.jsx("option",{value:m,selected:g===i,children:g}))})})]})},x6="start-screen.intro",A6="start-screen.start-chat",O6="start-screen.footnote",un="start-screen.form",f_=`${un}.fields`,w6=()=>{const n=Ke(),r=Pa(),[i,l]=F.useState({}),u=()=>{const E=Object.entries(i).reduce((y,[x,T])=>({...y,[x]:T.value}),{});r(XA(E))},f=n(x6),h=n(A6),d=n(O6),m=F.useMemo(()=>{var E;return((E=n(f_))==null?void 0:E.split(";").map(y=>y.trim()))??[]},[n(f_)]);F.useEffect(()=>{m.length&&Object.keys(i).length===0&&l(m.reduce((E,y)=>({...E,[y]:R6(y,n)}),{}))},[n,m,i]);const g=E=>{E.preventDefault(),u()},_=E=>y=>{l(x=>({...x,[E]:{...x[E],value:y}}))};return v.jsxs("form",{onSubmit:g,className:Z(ht.container,d&&ht.containerWithFootnote,"chat__startScreen"),children:[v.jsxs("div",{className:Z(ht.body,"chat__startScreen__body"),children:[f&&v.jsx("div",{className:Z(ht.intro,"chat__startScreen__intro"),children:v.jsx(En,{options:{overrides:{a:h_}},children:f})}),v.jsx("div",{className:Z(ht.formFields,"chat__startScreen__fields"),children:Object.values(i).map(({type:E,name:y,label:x,placeholder:T,defaultValue:z,options:N,required:U,multiple:M,min:O,max:R,pattern:S})=>v.jsx("div",{className:Z(ht.formField,"chat__startScreen__field"),children:(()=>{switch(E){case"radio":return v.jsxs(v.Fragment,{children:[v.jsx("div",{children:x}),Object.entries(N||{}).map(([k,Y])=>v.jsx(S6,{name:y,value:k,label:Y,defaultChecked:k===z,required:U,onChange:_(y)}))]});case"checkbox":return v.jsx(v6,{name:y,label:x,defaultValue:z,required:U,onChange:_(y)});case"select":return v.jsx(T6,{name:y,label:x,defaultValue:z,required:U,multiple:M,options:N,onChange:_(y)});default:return v.jsx(E6,{type:E,name:y,label:x,placeholder:T,defaultValue:z,required:U,multiple:M,min:O,max:R,pattern:S,onChange:_(y)})}})()},y))})]}),v.jsxs("div",{className:Z(ht.footer,"chat__startScreen__footer"),children:[v.jsx(os,{type:"submit",className:ht.startChatButton,children:h}),d&&v.jsx("div",{className:ht.footnote,children:v.jsx(En,{options:{overrides:{a:h_}},children:d})})]})]})},h_=({title:n,href:r,children:i})=>v.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),R6=(n,r)=>{const i=r(`${un}.${n}.type`)||"text",l=r(`${un}.${n}.required`)==="true",u=r(`${un}.${n}.multiple`)==="true",f=r(`${un}.${n}.placeholder`),h=r(`${un}.${n}.label`)||"",d=r(`${un}.${n}.defaultValue`),m=r(`${un}.${n}.min`),g=r(`${un}.${n}.max`),_=r(`${un}.${n}.pattern`),E=N6(r(`${un}.${n}.options`));return{name:n,label:h,placeholder:f,value:C6(i,d,E)||"",defaultValue:d,options:E,type:i,required:l,multiple:u,min:m,max:g,pattern:_}},C6=(n,r,i)=>r||n==="select"&&Object.keys(i)[0]||"",N6=(n="")=>n.split(";").map(r=>r.trim()).reduce((r,i)=>{const[l,u]=i.split(":").map(f=>f.trim());return{...r,[l]:u}},{}),D6=()=>{const n=yo();F.useEffect(()=>{window.document.documentElement.lang=n.locale},[n.locale])},ka={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"},M6=({clientName:n})=>{D6();const r=Pa(),i=Jt(_=>_.intl.messages),l=Ke(),u=Jt(_=>_.settings.enableStartScreen),f=Jt(_=>_.startScreen.startScreenStatus),[h,d]=F.useState(void 0);F.useEffect(()=>{const _=_o.parse(window.location.search);_.cssClassName&&d(_.cssClassName);const E=y=>{switch(y.data.type){case ka.TRIGGER_ACTION:r(y.data.action);break;case ka.TRIGGER_STORY:r(jb(y.data.story));break;case ka.ON_CHAT_WINDOW_OPEN:r({type:"webclient.chatwindow.opened"});break;case ka.ON_CHAT_WINDOW_CLOSE:r({type:"webclient.chatwindow.closed"});break;case ka.CHAT_MESSAGE_FROM_GUEST:r(Rb(y.data.text));break;case ka.RESTART_CHAT:r(To(n,_));break}};return r(tO(n,_)),window.addEventListener("message",y=>E(y),!1),()=>window.removeEventListener("message",E)},[n,r]),F.useEffect(()=>{const _=l("page.title");_&&document&&(document.title=_)},[i,l]);const m=u===void 0,g=u===!1||f==="HIDDEN";return v.jsx("div",{className:Z(c_.chatwindow,g&&c_.chatwindowWithAside,"chat__chatwindow",h),children:m?null:g?v.jsxs(v.Fragment,{children:[v.jsx("header",{children:v.jsx(u_,{})}),v.jsx("main",{children:v.jsx(x3,{clientName:n})}),v.jsx("aside",{children:v.jsx(r6,{})})]}):v.jsxs(v.Fragment,{children:[v.jsx("header",{children:v.jsx(u_,{withActions:!1})}),v.jsx("main",{children:v.jsx(w6,{})})]})})},B6=1024,j6=()=>{const n=ed(),r=Jt(f=>f.intl.locale),i=Jt(f=>f.intl.messages),[l,u]=F.useState(d_());return F.useEffect(()=>{const f=()=>{u(d_())};return window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]),v.jsx(cx,{locale:r,messages:i,children:v.jsx("div",{className:Z([hx.app,l?"chat__large":"chat__small"]),children:v.jsx(M6,{clientName:n})})})},d_=()=>window.innerWidth>=B6;var Df,m_;function nd(){if(m_)return Df;m_=1;function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}return Df=n,Df}var Mf,p_;function U6(){if(p_)return Mf;p_=1;var n=typeof Ol=="object"&&Ol&&Ol.Object===Object&&Ol;return Mf=n,Mf}var Bf,g_;function Ov(){if(g_)return Bf;g_=1;var n=U6(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();return Bf=i,Bf}var jf,y_;function H6(){if(y_)return jf;y_=1;var n=Ov(),r=function(){return n.Date.now()};return jf=r,jf}var Uf,__;function L6(){if(__)return Uf;__=1;var n=/\s/;function r(i){for(var l=i.length;l--&&n.test(i.charAt(l)););return l}return Uf=r,Uf}var Hf,b_;function z6(){if(b_)return Hf;b_=1;var n=L6(),r=/^\s+/;function i(l){return l&&l.slice(0,n(l)+1).replace(r,"")}return Hf=i,Hf}var Lf,v_;function wv(){if(v_)return Lf;v_=1;var n=Ov(),r=n.Symbol;return Lf=r,Lf}var zf,E_;function k6(){if(E_)return zf;E_=1;var n=wv(),r=Object.prototype,i=r.hasOwnProperty,l=r.toString,u=n?n.toStringTag:void 0;function f(h){var d=i.call(h,u),m=h[u];try{h[u]=void 0;var g=!0}catch{}var _=l.call(h);return g&&(d?h[u]=m:delete h[u]),_}return zf=f,zf}var kf,S_;function G6(){if(S_)return kf;S_=1;var n=Object.prototype,r=n.toString;function i(l){return r.call(l)}return kf=i,kf}var Gf,T_;function q6(){if(T_)return Gf;T_=1;var n=wv(),r=k6(),i=G6(),l="[object Null]",u="[object Undefined]",f=n?n.toStringTag:void 0;function h(d){return d==null?d===void 0?u:l:f&&f in Object(d)?r(d):i(d)}return Gf=h,Gf}var qf,x_;function F6(){if(x_)return qf;x_=1;function n(r){return r!=null&&typeof r=="object"}return qf=n,qf}var Ff,A_;function I6(){if(A_)return Ff;A_=1;var n=q6(),r=F6(),i="[object Symbol]";function l(u){return typeof u=="symbol"||r(u)&&n(u)==i}return Ff=l,Ff}var If,O_;function V6(){if(O_)return If;O_=1;var n=z6(),r=nd(),i=I6(),l=NaN,u=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,h=/^0o[0-7]+$/i,d=parseInt;function m(g){if(typeof g=="number")return g;if(i(g))return l;if(r(g)){var _=typeof g.valueOf=="function"?g.valueOf():g;g=r(_)?_+"":_}if(typeof g!="string")return g===0?g:+g;g=n(g);var E=f.test(g);return E||h.test(g)?d(g.slice(2),E?2:8):u.test(g)?l:+g}return If=m,If}var Vf,w_;function P6(){if(w_)return Vf;w_=1;var n=nd(),r=H6(),i=V6(),l="Expected a function",u=Math.max,f=Math.min;function h(d,m,g){var _,E,y,x,T,z,N=0,U=!1,M=!1,O=!0;if(typeof d!="function")throw new TypeError(l);m=i(m)||0,n(g)&&(U=!!g.leading,M="maxWait"in g,y=M?u(i(g.maxWait)||0,m):y,O="trailing"in g?!!g.trailing:O);function R(de){var Ie=_,Te=E;return _=E=void 0,N=de,x=d.apply(Te,Ie),x}function S(de){return N=de,T=setTimeout(K,m),U?R(de):x}function k(de){var Ie=de-z,Te=de-N,G=m-Ie;return M?f(G,y-Te):G}function Y(de){var Ie=de-z,Te=de-N;return z===void 0||Ie>=m||Ie<0||M&&Te>=y}function K(){var de=r();if(Y(de))return re(de);T=setTimeout(K,k(de))}function re(de){return T=void 0,O&&_?R(de):(_=E=void 0,x)}function ee(){T!==void 0&&clearTimeout(T),N=0,_=z=E=T=void 0}function le(){return T===void 0?x:re(r())}function ie(){var de=r(),Ie=Y(de);if(_=arguments,E=this,z=de,Ie){if(T===void 0)return S(z);if(M)return clearTimeout(T),T=setTimeout(K,m),R(z)}return T===void 0&&(T=setTimeout(K,m)),x}return ie.cancel=ee,ie.flush=le,ie}return Vf=h,Vf}var Pf,R_;function Y6(){if(R_)return Pf;R_=1;var n=P6(),r=nd(),i="Expected a function";function l(u,f,h){var d=!0,m=!0;if(typeof u!="function")throw new TypeError(i);return r(h)&&(d="leading"in h?!!h.leading:d,m="trailing"in h?!!h.trailing:m),n(u,f,{leading:d,maxWait:f,trailing:m})}return Pf=l,Pf}var Z6=Y6();const X6=po(Z6);function Q6(n){return n&&n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function K6(n){return n}function $6(n,r){r=r||{};const i=r.delimiter||".",l=r.maxDepth,u=r.transformKey||K6,f={};function h(d,m,g){g=g||1,Object.keys(d).forEach(function(_){const E=d[_],y=r.safe&&Array.isArray(E),x=Object.prototype.toString.call(E),T=Q6(E),z=x==="[object Object]"||x==="[object Array]",N=m?m+i+u(_):u(_);if(!y&&!T&&z&&Object.keys(E).length&&(!r.maxDepth||g<l))return h(E,N,g+1);f[N]=E})}return h(n),f}const Rv={"page.title":"Bubble Chat Chatbot","message-input-label":"Benutzereingabe","message-input-placeholder":"Nachricht","message-input.actions.submit.label":"Nachricht senden","message-input.actions.export-transcript.label":"Konversation exportieren","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":"Konversation per E-Mail versenden","export-transcript.email.description":"Geben Sie Ihre E-Mail-Adresse ein, um den Chatverlauf zu erhalten.","export-transcript.email.cancel":"Abbrechen","export-transcript.email.send":"Senden","export-transcript.email.placeholder":"Ihre E-Mail-Adresse","export-transcript.email.invalid":"Bitte gültige E-Mail-Adresse eingeben.","export-transcript.email.success":"Ich habe den Chatverlauf an Ihre E-Mail-Adresse gesendet.","export-transcript.pdf.title":"Konversation als PDF erhalten","export-transcript.pdf.description":"Laden Sie die Konversation als PDF herunter.","export-transcript.pdf.cancel":"Abbrechen","export-transcript.pdf.download":"Herunterladen","general-conditions.header":"**Nutzungsbedingungen**","general-conditions.body":`Bitte berücksichtigen Sie die folgenden Punkte:
106
+ `).map((d,m)=>v.jsxs("span",{className:Wy.text,children:[v.jsx(CR,{componentDecorator:u,children:d}),v.jsx("br",{})]},m))]})},MR=({subtitle:n,onLinkClick:r})=>n?v.jsx("div",{className:Ot.subtitle,children:v.jsx(vv,{text:n,onLinkClick:r})}):null,e_="newtab#",Ev=({markdown:n,markdownOptions:r={},onLinkClick:i})=>{const l=f=>h=>(h.preventDefault(),f&&i(f),!1),u=({title:f,href:h,children:d})=>h.indexOf(e_)===0?v.jsx("a",{href:h.slice(e_.length),title:f,target:"_blank",rel:"noopener noreferrer",children:d}):v.jsx("a",{onClick:l(h),title:f,href:h,children:d});return v.jsx(En,{options:{...r,overrides:{a:u}},children:n})},BR=({text:n,onLinkClick:r})=>n?v.jsx("div",{children:v.jsx(Ev,{markdown:n,onLinkClick:r})}):null,jR=({title:n})=>n?v.jsx("h1",{className:Ot.title,children:n}):null,UR=({title:n,text:r,subtitle:i,buttons:l,onButtonClick:u,onLinkClick:f})=>(n==null?void 0:n.length)||(r==null?void 0:r.length)||(i==null?void 0:i.length)||(l==null?void 0:l.length)?v.jsxs("div",{className:Z(me.bubbleContent),children:[v.jsx(jR,{title:n}),v.jsx(BR,{text:r,onLinkClick:f}),v.jsx(MR,{subtitle:i,onLinkClick:f}),v.jsx(mR,{buttons:l,onButtonClick:u})]}):null,HR=({alt:n,imageUrl:r,itemUrl:i,hasBody:l})=>r?i?i.indexOf("youtube.com")>-1?v.jsx("div",{className:Ot.video_container,children:v.jsx("iframe",{className:Z(Ot.video,{[Ot.only]:!l}),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:Ot.imageContainer,children:v.jsx("img",{className:Z(Ot.image,{[Ot.only]:!l}),src:r,alt:n})})}):v.jsx("div",{className:Ot.imageContainer,children:v.jsx("img",{className:Z(Ot.image,{[Ot.only]:!l}),src:r,alt:n})}):null,LR=({title:n,text:r,subtitle:i,imageUrl:l,itemUrl:u,buttons:f,sources:h,onButtonClick:d,onLinkClick:m})=>{const g=!!(n!=null&&n.length)||!!(r!=null&&r.length)||!!(i!=null&&i.length)||!!(f!=null&&f.length);return v.jsxs("div",{className:Z(Ot.detailMessage),children:[v.jsx(HR,{hasBody:g,imageUrl:l,itemUrl:u,alt:n||i}),g&&v.jsx(UR,{title:n,text:r,subtitle:i,buttons:f,onLinkClick:m,onButtonClick:d}),v.jsx(Wh,{sources:h,onLinkClick:m})]})},zR=F.forwardRef(({isFirstMessageBySender:n,isLastMessageBySender:r,children:i},l)=>{const u=Ke();return v.jsx("li",{ref:l,className:Z(me.message,me.messageGuest,n&&me.messageGuestFirst,r&&me.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:v.jsx("div",{className:Z(me.bubble,me.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":u("guest-bubble.label"),children:v.jsx("div",{className:Z(me.rightText),children:i})})})}),kR="_markdown_nw7vg_1",Sv={markdown:kR},Ql="source-info-reference",GR=({markdown:n,sources:r,onLinkClick:i})=>{const l=Pa(),u=qR(),f=Jt(m=>{const g=m.chat.sourceInfos;if((g==null?void 0:g.type)==="loaded"||(g==null?void 0:g.type)==="loading")return g.chunkId}),h=m=>g=>{const _=g.key;(_==="ArrowDown"||_==="ArrowRight"||_==="Enter"||_===" "||_==="Space")&&(g.stopPropagation(),l(Ny(m)))},d=m=>()=>{l(Ny(m))};return F.useLayoutEffect(()=>{document.querySelectorAll(`.${Ql}`).forEach(m=>{var E,y,x,T;const g=m.previousSibling;g&&g.nodeType===Node.TEXT_NODE&&((E=g.textContent)!=null&&E.endsWith(" "))&&((y=g.textContent)!=null&&y.trim().length)&&m.classList.add(`${Ql}--before-space`);const _=m.nextSibling;_&&_.nodeType===Node.TEXT_NODE&&((x=_.textContent)!=null&&x.startsWith(" "))&&((T=_.textContent)!=null&&T.trim().length)&&m.classList.add(`${Ql}--after-space`)})},[n]),v.jsxs("div",{className:me.bubbleContent,children:[v.jsx("div",{className:Sv.markdown,children:v.jsx(Ev,{markdown:n,onLinkClick:i,markdownOptions:{renderRule(m,g,_,E){if(g.type===ue.footnoteReference){const y=g.text===f;return v.jsx("span",{className:Z(me.sourceInfoReference,y&&me.sourceInfoReferenceActive,Ql),children:v.jsx("a",{type:"button",tabIndex:0,onClick:d(g.text),onKeyDown:h(g.text),children:u(g.text)})},E.key)}return m()}}})}),v.jsx(Wh,{sources:r,onLinkClick:i})]})},qR=()=>{const n=[];return i=>{const l=n.indexOf(i);return l>-1?l+1:(n.push(i),n.length)}},FR=({text:n,commands:r,sources:i,onLinkClick:l})=>v.jsxs("div",{className:me.bubbleContent,children:[v.jsx(vv,{text:n,commands:r,onLinkClick:l}),v.jsx(Wh,{sources:i,onLinkClick:l})]}),IR=F.forwardRef(({message:n,commands:r,isLastMessage:i,isFirstMessageBySender:l,isLastMessageBySender:u,onReaction:f,onButtonClick:h,onLinkClick:d},m)=>{const g=VR(n,r,h,d);switch(n.sender.type){case Ee.UserType.GUEST:return v.jsx(zR,{ref:m,isFirstMessageBySender:l,isLastMessageBySender:u,children:g});default:{const _=E=>f(n._id,E);return v.jsx(pv,{ref:m,message:n,isAnimated:!1,isLastMessage:i,isFirstMessageBySender:l,isLastMessageBySender:u,onReaction:_,children:g})}}}),VR=(n,r,i,l)=>{switch(n.type){case Ee.MessageTypeEnum.TEXT:{const u=n;return v.jsx(FR,{text:u.text,commands:r,sources:n.sources||[],onLinkClick:l})}case Ee.MessageTypeEnum.DETAIL:{const u=n;return v.jsx(LR,{title:u.title,text:u.text,subtitle:u.subtitle,imageUrl:u.imageUrl,itemUrl:u.itemUrl,buttons:u.buttons,sources:n.sources||[],onButtonClick:i,onLinkClick:l})}case Ee.MessageTypeEnum.MARKDOWN:{const u=n;return v.jsx(GR,{markdown:u.markdown,sources:u.sources||[],onLinkClick:l})}}},PR=(n,r)=>n.message._id===r.message._id&&n.message.reaction===r.message.reaction&&n.isLastMessage===r.isLastMessage&&n.isFirstMessageBySender===r.isFirstMessageBySender&&n.isLastMessageBySender===r.isLastMessageBySender,YR=k_.memo(IR,PR),ZR="_ticontainer_xg0dn_1",XR="_tiblock_xg0dn_5",QR="_tidot_xg0dn_12",Wi={ticontainer:ZR,tiblock:XR,tidot:QR},KR=({isTyping:n=!1})=>v.jsx("div",{className:Wi.ticontainer,children:v.jsx("div",{className:Wi.tiblock,children:n?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:Z(Wi.tidot,"chat__typingIndicator")}),v.jsx("div",{className:Z(Wi.tidot,"chat__typingIndicator")}),v.jsx("div",{className:Z(Wi.tidot,"chat__typingIndicator")})]}):null})}),$R=Object.assign({_id:"typing-indicator"},new Ee.TextMessage("",new Ee.BotUser)),JR=({messages:n,isBotTyping:r,commands:i,onTranscriptItemReaction:l,onButtonClick:u,onLinkClick:f})=>{const h=F.useRef(0),d=F.useRef(!0),m=F.useRef(null),g=F.useRef(null),_=F.useRef(null),E=Jt(T=>T.settings.enableGeneralConditions);F.useLayoutEffect(()=>{if(n.length&&m.current&&(h.current<n.length||r)){if(g.current){const T=g.current.offsetTop;m.current.scrollTop=T}else if(_.current){const T=_.current.offsetTop;m.current.scrollTop=T}d.current&&(d.current=!1),h.current=n.length}},[n,d,r]);let y;const x=n.length;return v.jsxs("div",{ref:m,className:Z(Dy.messageContainer,"chat__messageContainer"),style:{scrollBehavior:n.length&&d.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[E&&v.jsx(ww,{}),v.jsxs("ul",{className:Dy.messages,children:[n.map((T,z)=>{const N=WR(T,y),U=eC(T,z,n,r);y=T.sender.type;const M=z+1===x;return v.jsx(YR,{ref:M?_:null,message:T,commands:i,isLastMessage:M,isFirstMessageBySender:N,isLastMessageBySender:U,onButtonClick:u,onLinkClick:f,onReaction:l},M&&!r?"last":T._id)}),r&&v.jsx(pv,{ref:g,message:$R,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:y!==Ee.UserType.BOT,isLastMessageBySender:!0,children:v.jsx(KR,{isTyping:!0})},"last")]})]})},WR=(n,r)=>!r||r!==n.sender.type,eC=(n,r,i,l)=>{var d;const u=n.sender.type,f=i.length;return r+1===f?!(u===Ee.UserType.BOT&&l):u!==((d=i.at(r+1))==null?void 0:d.sender.type)},Tv=()=>tC(window.location.pathname),tC=n=>{const r=n.split("/"),i=n.endsWith("/");return r[r.length-(i?2:1)]},ed=()=>F.useMemo(()=>Tv(),[]),nC="_bottomSheet_jp8dl_1",rC="_bottomSheetOpen_jp8dl_15",aC="_bottomSheetClose_jp8dl_20",Pn={bottomSheet:nC,bottomSheetOpen:rC,bottomSheetClose:aC},iC="_container_xc2nx_1",t_={container:iC},sC=({contentUrl:n})=>{const r=ed(),[i,l]=F.useState(!1);F.useEffect(()=>{l(f=>f||!!n)},[n]);const u=F.useMemo(()=>{if(n&&n.startsWith("/"))return new URL(`/${r}${n}`,document.baseURI).toString()},[n,r]);return v.jsx("div",{className:Z(t_.container,Pn.bottomSheet,{[Pn.bottomSheetOpen]:!!n,[Pn.bottomSheetClose]:i&&!n}),children:u&&v.jsx("iframe",{title:"Drawer",src:u,className:t_.iframe})})},lC="_container_z787n_1",oC={container:lC},uC=({title:n,href:r,children:i})=>v.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),cC=()=>{const r=Ke()("powered-by");return r&&r.length?v.jsx("div",{className:Z(oC.container,"chat__poweredBy"),children:v.jsx(En,{options:{overrides:{a:uC}},children:r})}):null},n_=({className:n,children:r,...i})=>v.jsx(Ao,{className:Z(ls.buttonDefault,n),type:"button",...i,children:r}),os=({className:n,children:r,...i})=>v.jsx(Ao,{className:Z(ls.buttonPrimary,n),...i,children:r}),fC="_container_h23mk_1",hC="_formContainer_h23mk_17",dC="_emailInput_h23mk_22",mC="_description_h23mk_52",pC="_actions_h23mk_57",gC="_validationError_h23mk_67",yC="_submitted_h23mk_74",Fn={container:fC,formContainer:hC,emailInput:dC,description:mC,actions:pC,validationError:gC,submitted:yC},_C=({visible:n,enableTranscriptExportPdf:r,enableTranscriptExportEmail:i,onEmailExport:l,onPdfExport:u,onClose:f})=>{const h=Ke(),[d,m]=F.useState(void 0),[g,_]=F.useState(!1),[E,y]=F.useState(!1),[x,T]=F.useState(void 0),z=F.useRef(null);F.useEffect(()=>{var O;n?((O=z.current)==null||O.focus(),_(!1),y(!1),m(n)):d===!0&&m(!1)},[n,d]);const N=O=>{O.preventDefault(),x&&x.length>0&&(l(x),_(!0),setTimeout(f,3*1e3))},U=O=>{const R=O.target.value.trim(),S=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(R);T(S?R:"")},M=()=>{y(!0),u(),setTimeout(f,3*1e3)};return v.jsxs("div",{className:Z(Fn.container,Pn.bottomSheet,{[Pn.bottomSheetOpen]:d===!0,[Pn.bottomSheetClose]:d===!1}),children:[r&&v.jsxs(v.Fragment,{children:[v.jsx("h2",{children:h("export-transcript.pdf.title")}),v.jsx(En,{className:Fn.description,children:h("export-transcript.pdf.description")||""}),v.jsxs("div",{className:Fn.actions,children:[v.jsx(n_,{onClick:f,children:h("export-transcript.pdf.cancel")}),v.jsx(os,{onClick:M,disabled:E,children:h("export-transcript.pdf.download")})]})]}),i&&v.jsxs(v.Fragment,{children:[v.jsx("h2",{children:h("export-transcript.email.title")}),v.jsx(En,{className:Fn.description,children:h("export-transcript.email.description")||""}),v.jsxs("form",{onSubmit:N,className:Fn.formContainer,children:[v.jsxs("div",{children:[v.jsx("input",{disabled:g,ref:z,type:"email",placeholder:h("export-transcript.email.placeholder"),className:Fn.emailInput,onChange:U}),(x==null?void 0:x.length)===0?v.jsx("div",{className:Fn.validationError,children:h("export-transcript.email.invalid")}):null]}),v.jsxs("div",{className:Fn.actions,children:[v.jsx(n_,{onClick:f,children:h("export-transcript.email.cancel")}),v.jsx(os,{type:"submit",disabled:g||x===void 0||x.length===0,children:h("export-transcript.email.send")})]})]}),g&&v.jsx("div",{className:Fn.submitted,children:h("export-transcript.email.success")})]})]})},bC="_inputContainer_fi5ao_1",vC={inputContainer:bC},EC="_blockUserInput_pot9c_1",SC={blockUserInput:EC},TC=({visible:n})=>{const r=Ke();return n?v.jsx("div",{className:Z(SC.blockUserInput,"chat__blockUserInput"),children:r("block-user-input.title")}):null},xC="_commandsDropdown_5ytuv_1",AC="_commands_5ytuv_1",OC="_command_5ytuv_1",wC="_commandActive_5ytuv_46",RC="_commandsSelections_5ytuv_55",ns={commandsDropdown:xC,commands:AC,command:OC,commandActive:wC,commandsSelections:RC},CC=(n,r)=>{F.useEffect(()=>{const i=l=>{n.current&&!n.current.contains(l.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,r])},NC=(n,r,i,l,u)=>{F.useEffect(()=>{const f=h=>{if(n.length)switch(h.key){case"Enter":i(n[r]);break;case"ArrowUp":l(d=>d>0?d-1:n.length-1);break;case"ArrowDown":l(d=>d<n.length-1?d+1:0);break;case"Escape":u([]);break}};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[n,r,i,l,u])},DC=({text:n,commands:r,onSelectCommand:i,onVisibilityChange:l})=>{const u=F.useRef(null),f=Ke(),[h,d]=F.useState([]),[m,g]=F.useState(r_(r)),[_,E]=F.useState(0),y=x=>i(`/${x}`);return CC(u,()=>d([])),NC(h,_,y,E,d),F.useEffect(()=>{g(r_(r))},[r]),F.useEffect(()=>{const x=n.length||0;x===0||x>m||!n.startsWith("/")?d([]):d(r.filter(MC(n))),E(0)},[r,n,m]),F.useEffect(()=>{l(!!h.length)},[h,l]),h.length?v.jsx("div",{ref:u,className:ns.commandsDropdown,children:v.jsx("ul",{className:ns.commands,role:"listbox",children:h.map((x,T)=>v.jsxs("li",{className:Z([ns.command,_===T&&ns.commandActive]),role:"option",onClick:()=>y(x),onMouseOver:()=>E(T),children:[v.jsxs("h1",{children:["/",x]}),v.jsx("p",{children:f(`commands.${x}`)})]},x))})}):null},r_=n=>Math.max(...n.map(r=>r.length+1)),MC=n=>r=>{const i=`/${r}`;return i.startsWith(n)&&i.length>=n.length},a_=3,BC=({commands:n,onSelectCommand:r})=>{const i=Ke(),[l,u]=F.useState(!1),f=g=>()=>{r(`/${g}`),u(!1)},h=()=>{u(!0)},d=()=>{u(!1)},m=l?n:n.slice(0,a_);return v.jsxs("div",{className:ns.commandsSelections,children:[m.map(g=>v.jsxs("button",{className:"tooltip--top-center","aria-label":i(`commands.${g}`),"data-title":i(`commands.${g}`),tabIndex:0,onClick:f(g),children:["/",g]},g)),m.length<n.length?v.jsx("button",{"aria-label":i("commands.show-more.tooltip"),"data-title":i("commands.show-more.tooltip"),tabIndex:0,onClick:h,children:i("commands.show-more.action")},"show-more"):m.length>a_?v.jsx("button",{"aria-label":i("commands.show-less.tooltip"),"data-title":i("commands.show-less.tooltip"),tabIndex:0,onClick:d,children:i("commands.show-less.action")},"show-less"):null]})},jC="_callToActionContainer_bkfcm_1",UC="_callToActionTitle_bkfcm_23",HC="_rateOverlay_bkfcm_30",LC="_body_bkfcm_52",zC="_footer_bkfcm_60",kC="_actions_bkfcm_73",GC="_bubbles_bkfcm_101",qC="_stars_bkfcm_203",FC="_starsSmall_bkfcm_215",IC="_starsLarge_bkfcm_219",VC="_star_bkfcm_203",PC="_starReadonly_bkfcm_236",YC="_starIcon_bkfcm_246",ZC="_starsDescriptionContainer_bkfcm_264",XC="_starsDescription_bkfcm_264",vt={callToActionContainer:jC,callToActionTitle:UC,rateOverlay:HC,body:LC,footer:zC,actions:kC,bubbles:GC,stars:qC,starsSmall:FC,starsLarge:IC,star:VC,starReadonly:PC,starIcon:YC,starsDescriptionContainer:ZC,starsDescription:XC},QC=({value:n,index:r,count:i,readonly:l,onHover:u,onClick:f})=>{const h=d=>{f&&d.key==="Enter"&&f()};return v.jsx("li",{className:Z(vt.star,{[vt.starReadonly]:l},"chat__conversationRating__star"),children:v.jsx("div",{role:"radio","aria-checked":n>r?"true":"false","aria-posinset":r+1,"aria-setsize":i,tabIndex:0,onMouseOver:u,onKeyDown:h,onClick:f,children:v.jsx("span",{role:"img","aria-label":"Star",className:Z(vt.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"})})})})})},i_=5,xv=({value:n,size:r,readonly:i=!1,onChange:l})=>{const[u,f]=F.useState(void 0),h=()=>{f(void 0)},d=g=>()=>{if(!i){const _=g+1;f(_)}},m=g=>()=>{l&&!i&&(l(g===0&&n===1?0:g+1),f(void 0))};return v.jsx("ul",{tabIndex:0,role:"radiogroup",className:Z(vt.stars,{[vt.starsSmall]:r==="small",[vt.starsLarge]:r==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:r==="small",chat__conversationRating__stars__large:r==="large"}),onMouseOut:h,children:Array(i_).fill(0).map((g,_)=>v.jsx(QC,{value:u===void 0?n:u,index:_,count:i_,readonly:i,onHover:d(_),onClick:m(_)},_))})},KC=({visible:n,onRate:r})=>{const i=Ke();return n?v.jsxs("div",{className:Z(vt.callToActionContainer,"chat__conversationRating__callToAction"),children:[v.jsx("div",{className:Z(vt.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),v.jsx(xv,{value:0,size:"small",onChange:r})]}):null},Nf=({isFirstMessageBySender:n,isLastMessageBySender:r,children:i})=>v.jsxs("div",{className:Z(me.message,me.messageBot,n&&me.messageBotFirst,r&&me.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:[v.jsx("img",{className:Z(me.avatar,me.botAvatar),src:"bot.svg",alt:"Bot"}),v.jsx("div",{className:Z(me.bubble,me.bubbleLeft,"chat__bubble","chat__botBubble"),children:v.jsx("div",{className:Z(me.leftText,me.bubbleContent),children:i})})]}),$C=({children:n})=>v.jsx("div",{className:Z(me.message,me.messageGuest,me.messageGuestFirst,me.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:v.jsx("div",{className:Z(me.bubble,me.bubbleRight,"chat__bubble","chat__guestBubble"),children:v.jsx("div",{className:Z(me.rightText,me.bubbleContent),children:n})})}),JC=({visible:n,rating:r,onRate:i,onClose:l})=>{const u=Ke(),[f,h]=F.useState(r),[d,m]=F.useState(void 0),[g,_]=F.useState(void 0),[E,y]=F.useState({submitted:!1,feedback:""}),[x,T]=F.useState(!1),z=F.useRef(null);F.useEffect(()=>{n?(y({submitted:!1,feedback:""}),_(n)):g===!0&&_(!1)},[n,g]),F.useEffect(()=>{h(r)},[r]),F.useEffect(()=>{const U=u(`conversation-rating.overlay.bot-message.rate-feedback.value-${f}`);m(U!=null&&U.length?U:void 0)},[f,u]),F.useEffect(()=>{E.submitted?setTimeout(()=>T(!0),E.feedback.length?500:0):T(!1)},[E]);const N=U=>{var O,R;U.preventDefault();const M=((R=(O=z.current)==null?void 0:O.value)==null?void 0:R.trim())||"";i(f,M),y({submitted:!0,feedback:M})};return v.jsx("div",{className:Z(vt.rateOverlay,Pn.bottomSheet,"chat__conversationRating__overlay",{[Pn.bottomSheetOpen]:g===!0,[Pn.bottomSheetClose]:g===!1}),children:v.jsxs("form",{onSubmit:N,children:[v.jsxs("div",{className:Z(vt.body,"chat__conversationRating__overlay__body"),children:[v.jsx("div",{}),v.jsx("div",{className:Z(vt.bubbles),children:n&&d&&v.jsxs(v.Fragment,{children:[v.jsxs(Nf,{isFirstMessageBySender:!0,isLastMessageBySender:!1,children:[v.jsx("h2",{children:u("conversation-rating.overlay.title")}),v.jsxs("div",{className:Z(vt.starsDescriptionContainer),children:[v.jsx(xv,{value:f,size:"large",readonly:E.submitted,onChange:h}),v.jsxs("div",{className:Z(vt.starsDescription),children:[v.jsx("div",{children:u("conversation-rating.overlay.star.very-bad")}),v.jsx("div",{children:u("conversation-rating.overlay.star.very-good")})]})]})]}),v.jsx(Nf,{isFirstMessageBySender:!1,isLastMessageBySender:!x||!!E.feedback.length,children:v.jsx("div",{children:d})}),!!E.feedback.length&&v.jsx($C,{children:E.feedback}),x&&v.jsx(Nf,{isFirstMessageBySender:!!E.feedback.length,isLastMessageBySender:!0,children:v.jsx("div",{children:u("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),v.jsxs("div",{className:Z(vt.footer,"chat__conversationRating__overlay__footer"),children:[!E.submitted&&v.jsx("input",{ref:z,placeholder:u("conversation-rating.overlay.guest-feedback.input-placeholder")}),v.jsx("div",{className:Z(vt.actions,"chat__conversationRating__overlay__footer__actions"),children:E.submitted?v.jsx(os,{type:"button",onClick:l,children:u("conversation-rating.overlay.action.close")}):v.jsx(os,{type:"submit",children:u("conversation-rating.overlay.action.submit")})})]})]})})},WC=({conversationRating:{enabled:n,rating:r},numberOfMessagesFromGuest:i,showRatingOverlay:l,setShowRatingOverlay:u,onRate:f})=>{const[h,d]=F.useState(0),m=E=>{d(E),u(!0)},g=()=>u(!1),_=!r&&i>=1;return n?v.jsxs(v.Fragment,{children:[v.jsx(KC,{visible:_,onRate:m}),v.jsx(JC,{visible:l,rating:h,onRate:f,onClose:g})]}):null},e3=F.memo(WC),t3="_inputWrapper_e3h44_1",n3="_withOpenCommands_e3h44_14",r3="_messageInputWrapper_e3h44_20",a3="_messageInput_e3h44_20",i3="_buttons_e3h44_44",s3="_button_e3h44_44",Pr={inputWrapper:t3,withOpenCommands:n3,messageInputWrapper:r3,messageInput:a3,buttons:i3,button:s3},l3="_audioRecorder_g845f_1",o3="_audioButton_g845f_6",u3="_recorderIcon_g845f_37",c3="_spinning_g845f_60",Yr={audioRecorder:l3,audioButton:o3,recorderIcon:u3,spinning:c3},s_=2048,mo=16e3;class f3 extends k_.Component{constructor(i){super(i);Ce(this,"audioInput",null);Ce(this,"volume",null);Ce(this,"leftchannel",[]);Ce(this,"recorder",null);Ce(this,"recordingLength",0);Ce(this,"sampleRate",null);Ce(this,"mediaStream",null);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(i){this.mediaStream=i,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(i)}initRecording(i){const l=window.AudioContext||window.webkitAudioContext,u=new l;this.sampleRate=u.sampleRate,this.volume=u.createGain(),this.audioInput=u.createMediaStreamSource(i),this.audioInput.connect(this.volume),this.recorder=u.createScriptProcessor(s_,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(u.destination)}processRecordingInput(i){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const l=i.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(l)),this.recordingLength+=s_}}handleClickSubmitAudio(){const i=d3(this.leftchannel,this.recordingLength),l=m3(i,this.sampleRate||0),u=h3(l);this.props.onAudioRecorded(u),this.handleClickStopAudio()}handleClickStopAudio(){var i,l,u,f;this.setState({recordingState:"none"}),(i=this.audioInput)==null||i.disconnect(),(l=this.volume)==null||l.disconnect(),(u=this.recorder)==null||u.disconnect(),this.mediaStream&&((f=this.mediaStream)==null||f.getAudioTracks().forEach(h=>{h.stop()}))}render(){return v.jsxs("div",{className:Yr.audioRecorder,children:[this.state.recordingState==="none"&&v.jsx("button",{className:Z(Yr.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:Yr.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:Yr.audioRecorder,children:[v.jsx("button",{className:Z(Yr.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:Yr.recorderIcon}),v.jsx("button",{className:Z(Yr.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 h3=n=>{const r=new ArrayBuffer(44+n.length*2),i=new DataView(r);Kl(i,0,"RIFF"),i.setUint32(4,44+n.length*2,!0),Kl(i,8,"WAVE"),Kl(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,mo,!0),i.setUint32(28,mo*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),Kl(i,36,"data"),i.setUint32(40,n.length*2,!0);const l=n.length;let u=44;const f=1;for(let h=0;h<l;h++)i.setInt16(u,n[h]*(32767*f),!0),u+=2;return new Blob([i],{type:"audio/wav"})},Kl=(n,r,i)=>{for(let l=0;l<i.length;l++)n.setUint8(r+l,i.charCodeAt(l))},d3=(n,r)=>{const i=new Float32Array(r);let l=0;const u=n.length;for(let f=0;f<u;f++){const h=n[f];i.set(h,l),l+=h.length}return i},m3=(n,r)=>{if(mo===r)return n;const i=r/mo,l=Math.round(n.length/i),u=new Float32Array(l);let f=0,h=0;for(;f<u.length;){const d=Math.round((f+1)*i);let m=0,g=0;for(let _=h;_<d&&_<n.length;_++)m+=n[_],g++;u[f]=m/g,f++,h=d}return u},p3=({disabled:n,textInput:r,commandsVisible:i,onTextInput:l,onTextInputSubmit:u,onAudioRecorded:f,onOpenTranscriptExportModal:h})=>{const d=Ke(),m=F.useRef(null),{enableTranscriptExportPdf:g,enableTranscriptExportEmail:_,enableSpeechSupport:E}=Jt(N=>N.settings);F.useEffect(()=>{var N;(N=m.current)==null||N.focus()},[r]);const y=()=>{const N=m.current;N&&r.trim().length>=1&&u(r.trim())&&(N.value="",N.style.height="",N.focus())},x=N=>{N.preventDefault(),y()},T=N=>{const U=N.target.value;l(U),N.target.style.height="";const{scrollHeight:M}=N.target;N.target.style.height=`${M>150?150:M}px`},z=N=>{N.code==="Enter"&&!N.shiftKey?(N.repeat||y(),N.preventDefault()):i&&(N.code==="ArrowUp"||N.code==="ArrowDown")&&N.preventDefault()};return v.jsxs("form",{className:Z(Pr.inputWrapper,i&&Pr.withOpenCommands,"chat__textInput"),onSubmit:x,children:[v.jsx("div",{className:Pr.messageInputWrapper,children:v.jsx("textarea",{id:"user_input",ref:m,className:Pr.messageInput,tabIndex:0,placeholder:d("message-input-placeholder"),value:r,onChange:T,onKeyDown:z,"aria-label":d("message-input-label"),"aria-controls":"command-list","aria-haspopup":"listbox"})}),v.jsxs("div",{className:Z(Pr.buttons,"chat__buttons"),children:[!r.length&&(g||_)&&v.jsx("button",{type:"button",className:Z(Pr.button,"chat__button"),"aria-label":d("message-input.actions.export-transcript.label"),"data-title":d("message-input.actions.export-transcript.label"),tabIndex:0,onClick:h,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:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"})})}),r.length||!E||navigator.mediaDevices===void 0?v.jsx("button",{className:Z(Pr.button,"chat__button"),type:"submit","aria-label":d("message-input.actions.submit.label"),"data-title":d("message-input.actions.submit.label"),tabIndex:0,disabled:n,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"})})}):E&&navigator.mediaDevices!==void 0&&v.jsx(f3,{translate:d,onAudioRecorded:f})]})]})},g3="_quickReplies_83npe_1",y3="_quickReply_83npe_9",l_={quickReplies:g3,quickReply:y3},_3=({quickReplies:n,onQuickReplyClick:r})=>n.length?v.jsx("div",{className:Z(l_.quickReplies,"chat__quickReplies"),children:n.map(i=>v.jsx(Ao,{tabIndex:0,className:Z(l_.quickReply,"chat__button","chat__quickReply"),onClick:()=>r(i),children:i.label},i.label))}):null,o_=5e3,b3=1e3,v3=({isBotTyping:n,quickReplies:r,conversationRating:i,numberOfMessagesFromGuest:l,showRatingOverlay:u,commands:f,setShowRatingOverlay:h,onTextInput:d,onRate:m,onQuickReplyClick:g,onAudioRecorded:_,onOpenTranscriptExportModal:E})=>{const[y,x]=F.useState(""),[T,z]=F.useState(!1),[N,U]=F.useState(!1),M=F.useRef(0),O=F.useRef(0);F.useEffect(()=>{if(T&&!n){const k=M.current?Date.now()-M.current:0;k>o_?z(!1):setTimeout(()=>{z(!1)},o_-k)}},[T,n]),F.useEffect(()=>{T&&(M.current=Date.now())},[T]);const R=k=>{const Y=Date.now()-O.current<b3;return N?!1:n||Y?(z(!0),!1):(d(k),x(""),O.current=Date.now(),!0)},S=k=>{x(k+" ")};return v.jsxs("div",{className:Z(vC.inputContainer),children:[v.jsx(_3,{quickReplies:r,onQuickReplyClick:g}),v.jsx(TC,{visible:T}),!T&&v.jsx(e3,{conversationRating:i,numberOfMessagesFromGuest:l,onRate:m,showRatingOverlay:u,setShowRatingOverlay:h}),!!(f!=null&&f.length)&&v.jsx(DC,{text:y,commands:f,onSelectCommand:S,onVisibilityChange:U}),v.jsx(p3,{textInput:y,disabled:T,commandsVisible:N,onTextInput:x,onTextInputSubmit:R,onOpenTranscriptExportModal:E,onAudioRecorded:_}),!!(f!=null&&f.length)&&v.jsx(BC,{commands:f,onSelectCommand:x})]})},E3=({clientName:n,messages:r,quickReplies:i,isBotTyping:l,drawerContentUrl:u,conversationRating:f,onMessageFromUser:h,onRate:d,onQuickReplyClick:m,onButtonClick:g,onLinkClick:_,onAudioRecorded:E,onTranscriptExport:y,onPdfExport:x,onTranscriptItemReaction:T})=>{const z=Pa(),N=Jt(ee=>ee.connection.connectionState),{enableTranscriptExportPdf:U,enableTranscriptExportEmail:M,commands:O}=Jt(ee=>ee.settings),[R,S]=F.useState(!1),[k,Y]=F.useState(!1),K=U||M,re=r.filter(ee=>ee.sender.type===ho.GUEST).length;return F.useEffect(()=>{if(N===Kr.CONNECTED){const ee=_o.parse(window.location.search);z($b(n,ee))}},[n,N,z]),v.jsxs("div",{className:_f.container,children:[v.jsxs("div",{className:Z([_f.chatcontent,(R||k)&&_f.accessabilityHidden]),children:[v.jsx(JR,{messages:r,isBotTyping:l,commands:O,onButtonClick:g,onLinkClick:_,onTranscriptItemReaction:T}),v.jsx(v3,{isBotTyping:l,quickReplies:l?[]:i,numberOfMessagesFromGuest:re,conversationRating:R?{enabled:!1}:f,showRatingOverlay:k,setShowRatingOverlay:Y,commands:O,onRate:d,onQuickReplyClick:m,onTextInput:h,onAudioRecorded:E,onOpenTranscriptExportModal:()=>S(!R)}),v.jsx(cC,{})]}),K&&v.jsx(_C,{enableTranscriptExportPdf:U,enableTranscriptExportEmail:M,visible:R,onEmailExport:y,onPdfExport:()=>x(n),onClose:()=>S(!1)}),v.jsx(sC,{contentUrl:u})]})},S3=n=>{const{messages:r,quickReplies:i,isBotTyping:l,drawerContentUrl:u,conversationRating:f}=n.chat;return{messages:r,quickReplies:i,isBotTyping:l,drawerContentUrl:u,conversationRating:f}},T3=n=>({onRestartChat:(r,i)=>n(To(r,i)),onMessageFromUser:r=>n(Rb(r)),onRate:(r,i)=>n(oA(r,i)),onAudioRecorded:r=>n(rA(r)),onActionFromUser:r=>n(r),onQuickReplyClick:r=>n(wb(r)),onNluEvent:r=>n(jb(r)),onButtonClick:r=>n(cA(r)),onLinkClick:r=>n(fA(r)),onTranscriptExport:r=>n(iA(r)),onPdfExport:r=>n(sA(r)),onTranscriptItemReaction:(r,i)=>n(Ee.Actions.transcriptItemGuestReaction(r,i||null))}),x3=TS(S3,T3)(E3),Av=()=>{const[n,r]=F.useState(!1);return F.useEffect(()=>{r((()=>{try{return window.self!==window.top}catch{return!0}})())},[]),n},td=n=>r=>{const i=r.key;(i==="ArrowDown"||i==="ArrowRight"||i==="Enter"||i===" "||i==="Space")&&(r.stopPropagation(),n())},A3=({onClick:n})=>{const r=Ke();return Av()?v.jsx("button",{className:"tooltip--bottom-left","aria-label":r("header.close-chat"),"data-title":r("header.close-chat"),tabIndex:0,onClick:n,onKeyDown:td(n),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},O3=()=>{const n=Ke(),r=Av(),i=Jt(u=>u.settings.enableStandaloneView),l=()=>{window.open(window.location.href,"_blank")};return r&&i?v.jsx("button",{className:"tooltip--bottom-left","aria-label":n("header.expand-chat"),"data-title":n("header.expand-chat"),tabIndex:0,onClick:l,onKeyDown:td(l),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:"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"})})}):null},w3="_header_1hky6_1",R3="_logoContainer_1hky6_13",C3="_logo_1hky6_13",N3="_actions_1hky6_27",$l={header:w3,logoContainer:R3,logo:C3,actions:N3},D3=({onClick:n})=>{const r=Ke();return v.jsx("button",{className:"tooltip--bottom-left","aria-label":r("header.restart-chat"),"data-title":r("header.restart-chat"),tabIndex:0,onClick:n,onKeyDown:td(n),children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 32 32",children:[v.jsx("path",{d:"M14.506,23.578l-5.511,0l-3.993,3.501l-0.007,0.006c-0.302,0.261 -0.687,0.405 -1.084,0.405c-0.245,-0.001 -0.488,-0.055 -0.711,-0.161c-0.595,-0.277 -0.978,-0.886 -0.974,-1.551l-0,-19.558c-0,-0.939 0.761,-1.711 1.685,-1.711l21.189,-0c0.924,-0 1.685,0.772 1.685,1.711l0,5.104l-1.444,0l-0,-5.104c-0,-0.134 -0.109,-0.244 -0.241,-0.244l-21.189,-0c-0.132,-0 -0.24,0.11 -0.24,0.244l-0,19.558c0.001,0.133 0.109,0.242 0.24,0.242c0.056,-0 0.109,-0.019 0.152,-0.055l4.192,-3.675c0.131,-0.115 0.299,-0.179 0.472,-0.179l5.779,0l-0,1.467Z"}),v.jsx("path",{d:"M29.869,20.148c0,4.137 -3.373,7.556 -7.509,7.612l-0.102,-0c-1.943,0.004 -3.814,-0.741 -5.223,-2.078c-0.183,-0.172 -0.286,-0.412 -0.286,-0.664c-0,-0.501 0.412,-0.913 0.913,-0.913c0.233,-0 0.458,0.089 0.627,0.249c1.074,1.014 2.495,1.579 3.971,1.579c3.174,-0 5.785,-2.612 5.785,-5.785c-0,-3.173 -2.611,-5.784 -5.785,-5.784c-1.533,-0 -3.006,0.61 -4.09,1.694c-0.01,0.01 -0.019,0.019 -0.03,0.028l-1.447,1.322l1.302,0c0.502,0 0.914,0.413 0.914,0.914c-0,0.501 -0.412,0.913 -0.914,0.913l-3.653,0c-0.501,0 -0.913,-0.412 -0.913,-0.913l-0,-3.654c-0,-0.501 0.412,-0.913 0.913,-0.913c0.501,0 0.913,0.412 0.913,0.913l0,1.577l1.635,-1.496c1.426,-1.418 3.357,-2.215 5.368,-2.215c4.175,0 7.611,3.436 7.611,7.611c-0,0.001 -0,0.002 -0,0.003Z"})]})})},u_=({className:n,withActions:r=!0,...i})=>{const l=Pa(),u=ed(),f=()=>{const d=_o.parse(window.location.search);l(To(u,d))},h=()=>{l($A())};return v.jsxs("div",{className:Z([$l.header,n]),...i,children:[v.jsx("div",{className:$l.logoContainer,children:v.jsx("div",{className:$l.logo})}),v.jsxs("div",{className:$l.actions,children:[r&&v.jsx(D3,{onClick:f}),v.jsx(O3,{}),v.jsx(A3,{onClick:h})]})]})},M3="_chatwindow_rkbir_1",B3="_chatwindowWithAside_rkbir_21",c_={chatwindow:M3,chatwindowWithAside:B3},j3="_sourceInfos_eg9te_12",U3="_loadingContent_eg9te_23",H3="_sourceDetails_eg9te_32",L3="_sourceHeader_eg9te_40",z3="_sourceHeaderIcon_eg9te_57",k3="_sourceContent_eg9te_61",G3="_openSourceButton_eg9te_69",q3="_sourceButtonLabel_eg9te_79",F3="_closeSourceInfosButton_eg9te_101",I3="_loadingSourceInfos_eg9te_125",V3="_loading_eg9te_23",P3="_loadingError_eg9te_139",Wt={sourceInfos:j3,loadingContent:U3,sourceDetails:H3,sourceHeader:L3,sourceHeaderIcon:z3,sourceContent:k3,openSourceButton:G3,sourceButtonLabel:q3,closeSourceInfosButton:F3,loadingSourceInfos:I3,loading:V3,loadingError:P3},Y3=({onClick:n})=>{const r=Ke();return v.jsx("button",{className:Z(Wt.closeSourceInfosButton,"tooltip--bottom-left"),"aria-label":r("source-infos.close"),"data-title":r("source-infos.close"),tabIndex:0,onClick:n,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"})})})},Z3=({sourceInfos:n,onClose:r})=>v.jsxs("div",{className:Wt.sourceHeader,children:[v.jsx("div",{children:n?v.jsx("p",{children:n.title}):v.jsx("p",{children:" "})}),v.jsx(Y3,{onClick:r})]}),X3=({title:n,href:r,children:i})=>v.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),Q3=({className:n,children:r,...i})=>v.jsx("a",{className:Z(ls.button,ls.buttonDefault,n),type:"button",...i,children:r}),K3=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,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"})}),$3=({type:n,...r})=>{switch(n){case"WEBSITE":return v.jsx(bv,{...r});case"PDF":return v.jsx(_v,{...r});case"DOCX":return v.jsx(gv,{...r});case"TEXT":return v.jsx(K3,{...r});default:return v.jsx(yv,{...r})}},J3=({url:n,knowledgeBaseType:r})=>{const i=Ke();return v.jsx(Q3,{className:Wt.openSourceButton,href:n,target:"_blank",children:v.jsxs("div",{className:Wt.sourceButtonLabel,children:[v.jsx("div",{className:Wt.sourceHeaderIcon,children:v.jsx($3,{type:r})}),v.jsx("p",{children:i("source-infos.open-source")})]})})},W3=({sourceInfos:{content:n,url:r,knowledgeBaseType:i}})=>v.jsxs(v.Fragment,{children:[v.jsx("div",{className:Z(Wt.sourceContent,Sv.markdown),children:v.jsx(En,{options:{overrides:{a:X3}},children:n})}),v.jsx(J3,{url:r,knowledgeBaseType:i})]}),e6=""+new URL("undraw_fixing-bugs-D_eYxJc6.svg",import.meta.url).href,t6=()=>{const n=Ke();return v.jsxs("div",{className:Wt.loadingError,children:[v.jsx("h1",{children:n("source-infos.error.title")}),v.jsx("img",{src:e6,title:n("source-infos.error.title")}),v.jsx("p",{children:n("source-infos.error.info")})]})},n6=()=>v.jsx("div",{className:Wt.loadingSourceInfos,children:v.jsx("svg",{className:Wt.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"})})}),r6=()=>{const n=Pa(),r=Jt(l=>l.chat.sourceInfos),i=()=>{n(WA())};return r?v.jsxs("div",{className:Z(Wt.sourceInfos,r.type==="loading"?Wt.loadingContent:""),children:[v.jsx("div",{className:Wt.sourceDetails,children:v.jsx(Z3,{sourceInfos:r.type==="loaded"?r:void 0,onClose:i})}),r.type==="loading"?v.jsx(n6,{}):r.type==="loading-error"?v.jsx(t6,{}):v.jsx(W3,{sourceInfos:r})]}):null},a6="_container_114wy_1",i6="_body_114wy_7",s6="_intro_114wy_14",l6="_footer_114wy_39",o6="_footnote_114wy_43",u6="_containerWithFootnote_114wy_58",c6="_startChatButton_114wy_73",f6="_formFields_114wy_77",h6="_formField_114wy_77",d6="_radio_114wy_89",m6="_checkbox_114wy_96",p6="_input_114wy_104",g6="_inputLabel_114wy_138",y6="_selectWrapper_114wy_142",_6="_select_114wy_142",b6="_selectLabel_114wy_188",ht={container:a6,body:i6,intro:s6,footer:l6,footnote:o6,containerWithFootnote:u6,startChatButton:c6,formFields:f6,formField:h6,radio:d6,checkbox:m6,input:p6,inputLabel:g6,selectWrapper:y6,select:_6,selectLabel:b6},v6=({name:n,label:r,defaultValue:i,required:l,onChange:u})=>{const f=h=>{u(h.currentTarget.checked?"true":"false")};return v.jsxs("label",{className:Z(ht.checkbox,"chat__startScreen__checkbox"),htmlFor:n,children:[v.jsx("input",{type:"checkbox",id:n,name:n,defaultChecked:i==="true",required:l,onChange:f}),v.jsx("div",{children:r})]})},E6=({type:n,name:r,label:i,defaultValue:l,placeholder:u,required:f,multiple:h,min:d,max:m,pattern:g,onChange:_})=>{const E=y=>{_(y.target.value)};return v.jsxs("label",{className:Z(ht.input,"chat__startScreen__input"),htmlFor:r,children:[v.jsx("div",{className:Z(ht.inputLabel),children:i}),v.jsx("input",{type:n,id:r,name:r,defaultValue:l,placeholder:u,required:f,multiple:h,min:d,max:m,pattern:g,onChange:E})]})},S6=({name:n,value:r,label:i,defaultChecked:l,required:u,onChange:f})=>{const h=`${n}-${r}`,d=m=>{f(m.target.value)};return v.jsxs("label",{className:Z(ht.radio,"chat__startScreen__radio"),htmlFor:h,children:[v.jsx("input",{id:h,type:"radio",name:n,value:r,defaultChecked:l,required:u,onChange:d}),v.jsx("span",{className:Z(ht.label),children:i})]})},T6=({name:n,label:r,defaultValue:i,required:l,multiple:u,options:f,onChange:h})=>{const d=m=>{h(m.target.value)};return v.jsxs("label",{className:Z(ht.select,"chat__startScreen__select"),htmlFor:n,children:[v.jsx("div",{className:Z(ht.selectLabel),children:r}),v.jsx("div",{className:Z(ht.selectWrapper),children:v.jsx("select",{id:n,name:n,defaultValue:i,required:l,multiple:u,onChange:d,children:Object.entries(f||{}).map(([m,g])=>v.jsx("option",{value:m,selected:g===i,children:g}))})})]})},x6="start-screen.intro",A6="start-screen.start-chat",O6="start-screen.footnote",un="start-screen.form",f_=`${un}.fields`,w6=()=>{const n=Ke(),r=Pa(),[i,l]=F.useState({}),u=()=>{const E=Object.entries(i).reduce((y,[x,T])=>({...y,[x]:T.value}),{});r(XA(E))},f=n(x6),h=n(A6),d=n(O6),m=F.useMemo(()=>{var E;return((E=n(f_))==null?void 0:E.split(";").map(y=>y.trim()))??[]},[n(f_)]);F.useEffect(()=>{m.length&&Object.keys(i).length===0&&l(m.reduce((E,y)=>({...E,[y]:R6(y,n)}),{}))},[n,m,i]);const g=E=>{E.preventDefault(),u()},_=E=>y=>{l(x=>({...x,[E]:{...x[E],value:y}}))};return v.jsxs("form",{onSubmit:g,className:Z(ht.container,d&&ht.containerWithFootnote,"chat__startScreen"),children:[v.jsxs("div",{className:Z(ht.body,"chat__startScreen__body"),children:[f&&v.jsx("div",{className:Z(ht.intro,"chat__startScreen__intro"),children:v.jsx(En,{options:{overrides:{a:h_}},children:f})}),v.jsx("div",{className:Z(ht.formFields,"chat__startScreen__fields"),children:Object.values(i).map(({type:E,name:y,label:x,placeholder:T,defaultValue:z,options:N,required:U,multiple:M,min:O,max:R,pattern:S})=>v.jsx("div",{className:Z(ht.formField,"chat__startScreen__field"),children:(()=>{switch(E){case"radio":return v.jsxs(v.Fragment,{children:[v.jsx("div",{children:x}),Object.entries(N||{}).map(([k,Y])=>v.jsx(S6,{name:y,value:k,label:Y,defaultChecked:k===z,required:U,onChange:_(y)}))]});case"checkbox":return v.jsx(v6,{name:y,label:x,defaultValue:z,required:U,onChange:_(y)});case"select":return v.jsx(T6,{name:y,label:x,defaultValue:z,required:U,multiple:M,options:N,onChange:_(y)});default:return v.jsx(E6,{type:E,name:y,label:x,placeholder:T,defaultValue:z,required:U,multiple:M,min:O,max:R,pattern:S,onChange:_(y)})}})()},y))})]}),v.jsxs("div",{className:Z(ht.footer,"chat__startScreen__footer"),children:[v.jsx(os,{type:"submit",className:ht.startChatButton,children:h}),d&&v.jsx("div",{className:ht.footnote,children:v.jsx(En,{options:{overrides:{a:h_}},children:d})})]})]})},h_=({title:n,href:r,children:i})=>v.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),R6=(n,r)=>{const i=r(`${un}.${n}.type`)||"text",l=r(`${un}.${n}.required`)==="true",u=r(`${un}.${n}.multiple`)==="true",f=r(`${un}.${n}.placeholder`),h=r(`${un}.${n}.label`)||"",d=r(`${un}.${n}.defaultValue`),m=r(`${un}.${n}.min`),g=r(`${un}.${n}.max`),_=r(`${un}.${n}.pattern`),E=N6(r(`${un}.${n}.options`));return{name:n,label:h,placeholder:f,value:C6(i,d,E)||"",defaultValue:d,options:E,type:i,required:l,multiple:u,min:m,max:g,pattern:_}},C6=(n,r,i)=>r||n==="select"&&Object.keys(i)[0]||"",N6=(n="")=>n.split(";").map(r=>r.trim()).reduce((r,i)=>{const[l,u]=i.split(":").map(f=>f.trim());return{...r,[l]:u}},{}),D6=()=>{const n=yo();F.useEffect(()=>{window.document.documentElement.lang=n.locale},[n.locale])},ka={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"},M6=({clientName:n})=>{D6();const r=Pa(),i=Jt(_=>_.intl.messages),l=Ke(),u=Jt(_=>_.settings.enableStartScreen),f=Jt(_=>_.startScreen.startScreenStatus),[h,d]=F.useState(void 0);F.useEffect(()=>{const _=_o.parse(window.location.search);_.cssClassName&&d(_.cssClassName);const E=y=>{switch(y.data.type){case ka.TRIGGER_ACTION:r(y.data.action);break;case ka.TRIGGER_STORY:r(jb(y.data.story));break;case ka.ON_CHAT_WINDOW_OPEN:r({type:"webclient.chatwindow.opened"});break;case ka.ON_CHAT_WINDOW_CLOSE:r({type:"webclient.chatwindow.closed"});break;case ka.CHAT_MESSAGE_FROM_GUEST:r(Rb(y.data.text));break;case ka.RESTART_CHAT:r(To(n,_));break}};return r(tO(n,_)),window.addEventListener("message",y=>E(y),!1),()=>window.removeEventListener("message",E)},[n,r]),F.useEffect(()=>{const _=l("page.title");_&&document&&(document.title=_)},[i,l]);const m=u===void 0,g=u===!1||f==="HIDDEN";return v.jsx("div",{className:Z(c_.chatwindow,g&&c_.chatwindowWithAside,"chat__chatwindow",h),children:m?null:g?v.jsxs(v.Fragment,{children:[v.jsx("header",{children:v.jsx(u_,{})}),v.jsx("main",{children:v.jsx(x3,{clientName:n})}),v.jsx("aside",{children:v.jsx(r6,{})})]}):v.jsxs(v.Fragment,{children:[v.jsx("header",{children:v.jsx(u_,{withActions:!1})}),v.jsx("main",{children:v.jsx(w6,{})})]})})},B6=1024,j6=()=>{const n=ed(),r=Jt(f=>f.intl.locale),i=Jt(f=>f.intl.messages),[l,u]=F.useState(d_());return F.useEffect(()=>{const f=()=>{u(d_())};return window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]),v.jsx(cx,{locale:r,messages:i,children:v.jsx("div",{className:Z([hx.app,l?"chat__large":"chat__small"]),children:v.jsx(M6,{clientName:n})})})},d_=()=>window.innerWidth>=B6;var Df,m_;function nd(){if(m_)return Df;m_=1;function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}return Df=n,Df}var Mf,p_;function U6(){if(p_)return Mf;p_=1;var n=typeof Ol=="object"&&Ol&&Ol.Object===Object&&Ol;return Mf=n,Mf}var Bf,g_;function Ov(){if(g_)return Bf;g_=1;var n=U6(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();return Bf=i,Bf}var jf,y_;function H6(){if(y_)return jf;y_=1;var n=Ov(),r=function(){return n.Date.now()};return jf=r,jf}var Uf,__;function L6(){if(__)return Uf;__=1;var n=/\s/;function r(i){for(var l=i.length;l--&&n.test(i.charAt(l)););return l}return Uf=r,Uf}var Hf,b_;function z6(){if(b_)return Hf;b_=1;var n=L6(),r=/^\s+/;function i(l){return l&&l.slice(0,n(l)+1).replace(r,"")}return Hf=i,Hf}var Lf,v_;function wv(){if(v_)return Lf;v_=1;var n=Ov(),r=n.Symbol;return Lf=r,Lf}var zf,E_;function k6(){if(E_)return zf;E_=1;var n=wv(),r=Object.prototype,i=r.hasOwnProperty,l=r.toString,u=n?n.toStringTag:void 0;function f(h){var d=i.call(h,u),m=h[u];try{h[u]=void 0;var g=!0}catch{}var _=l.call(h);return g&&(d?h[u]=m:delete h[u]),_}return zf=f,zf}var kf,S_;function G6(){if(S_)return kf;S_=1;var n=Object.prototype,r=n.toString;function i(l){return r.call(l)}return kf=i,kf}var Gf,T_;function q6(){if(T_)return Gf;T_=1;var n=wv(),r=k6(),i=G6(),l="[object Null]",u="[object Undefined]",f=n?n.toStringTag:void 0;function h(d){return d==null?d===void 0?u:l:f&&f in Object(d)?r(d):i(d)}return Gf=h,Gf}var qf,x_;function F6(){if(x_)return qf;x_=1;function n(r){return r!=null&&typeof r=="object"}return qf=n,qf}var Ff,A_;function I6(){if(A_)return Ff;A_=1;var n=q6(),r=F6(),i="[object Symbol]";function l(u){return typeof u=="symbol"||r(u)&&n(u)==i}return Ff=l,Ff}var If,O_;function V6(){if(O_)return If;O_=1;var n=z6(),r=nd(),i=I6(),l=NaN,u=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,h=/^0o[0-7]+$/i,d=parseInt;function m(g){if(typeof g=="number")return g;if(i(g))return l;if(r(g)){var _=typeof g.valueOf=="function"?g.valueOf():g;g=r(_)?_+"":_}if(typeof g!="string")return g===0?g:+g;g=n(g);var E=f.test(g);return E||h.test(g)?d(g.slice(2),E?2:8):u.test(g)?l:+g}return If=m,If}var Vf,w_;function P6(){if(w_)return Vf;w_=1;var n=nd(),r=H6(),i=V6(),l="Expected a function",u=Math.max,f=Math.min;function h(d,m,g){var _,E,y,x,T,z,N=0,U=!1,M=!1,O=!0;if(typeof d!="function")throw new TypeError(l);m=i(m)||0,n(g)&&(U=!!g.leading,M="maxWait"in g,y=M?u(i(g.maxWait)||0,m):y,O="trailing"in g?!!g.trailing:O);function R(de){var Ie=_,Te=E;return _=E=void 0,N=de,x=d.apply(Te,Ie),x}function S(de){return N=de,T=setTimeout(K,m),U?R(de):x}function k(de){var Ie=de-z,Te=de-N,G=m-Ie;return M?f(G,y-Te):G}function Y(de){var Ie=de-z,Te=de-N;return z===void 0||Ie>=m||Ie<0||M&&Te>=y}function K(){var de=r();if(Y(de))return re(de);T=setTimeout(K,k(de))}function re(de){return T=void 0,O&&_?R(de):(_=E=void 0,x)}function ee(){T!==void 0&&clearTimeout(T),N=0,_=z=E=T=void 0}function le(){return T===void 0?x:re(r())}function ie(){var de=r(),Ie=Y(de);if(_=arguments,E=this,z=de,Ie){if(T===void 0)return S(z);if(M)return clearTimeout(T),T=setTimeout(K,m),R(z)}return T===void 0&&(T=setTimeout(K,m)),x}return ie.cancel=ee,ie.flush=le,ie}return Vf=h,Vf}var Pf,R_;function Y6(){if(R_)return Pf;R_=1;var n=P6(),r=nd(),i="Expected a function";function l(u,f,h){var d=!0,m=!0;if(typeof u!="function")throw new TypeError(i);return r(h)&&(d="leading"in h?!!h.leading:d,m="trailing"in h?!!h.trailing:m),n(u,f,{leading:d,maxWait:f,trailing:m})}return Pf=l,Pf}var Z6=Y6();const X6=po(Z6);function Q6(n){return n&&n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function K6(n){return n}function $6(n,r){r=r||{};const i=r.delimiter||".",l=r.maxDepth,u=r.transformKey||K6,f={};function h(d,m,g){g=g||1,Object.keys(d).forEach(function(_){const E=d[_],y=r.safe&&Array.isArray(E),x=Object.prototype.toString.call(E),T=Q6(E),z=x==="[object Object]"||x==="[object Array]",N=m?m+i+u(_):u(_);if(!y&&!T&&z&&Object.keys(E).length&&(!r.maxDepth||g<l))return h(E,N,g+1);f[N]=E})}return h(n),f}const Rv={"page.title":"Bubble Chat Chatbot","message-input-label":"Benutzereingabe","message-input-placeholder":"Nachricht","message-input.actions.submit.label":"Nachricht senden","message-input.actions.export-transcript.label":"Konversation exportieren","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":"Konversation per E-Mail versenden","export-transcript.email.description":"Geben Sie Ihre E-Mail-Adresse ein, um den Chatverlauf zu erhalten.","export-transcript.email.cancel":"Abbrechen","export-transcript.email.send":"Senden","export-transcript.email.placeholder":"Ihre E-Mail-Adresse","export-transcript.email.invalid":"Bitte gültige E-Mail-Adresse eingeben.","export-transcript.email.success":"Ich habe den Chatverlauf an Ihre E-Mail-Adresse gesendet.","export-transcript.pdf.title":"Konversation als PDF erhalten","export-transcript.pdf.description":"Laden Sie die Konversation als PDF herunter.","export-transcript.pdf.cancel":"Abbrechen","export-transcript.pdf.download":"Herunterladen","general-conditions.header":"**Nutzungsbedingungen**","general-conditions.body":`Bitte berücksichtigen Sie die folgenden Punkte:
107
107
 
108
108
  - Der Chatverlauf wird im EU-Raum gespeichert und kann nur von autorisierten Personen eingesehen werden.
109
109
  - Geben Sie im Chatfenster keine persönlichen Daten ein (Passwörter, Geburtsdatum usw.).`,"general-conditions.accept-conditions-note":"Mit der Verwendung des Chats erklären Sie sich mit den Nutzungsbedingungen einverstanden.","block-user-input.title":"Bitte auf die Antwort des Chatbots warten.","conversation-rating.call-to-action.title":"Bewerten Sie diesen Chat","conversation-rating.overlay.title":"Wie zufrieden sind Sie mit diesem Chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Feedback bitte hier eingeben (optional)","conversation-rating.overlay.star.very-bad":"Sehr schlecht","conversation-rating.overlay.star.very-good":"Sehr gut","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"Durchschnitt ist nicht mein Ziel, was kann ich noch verbessern?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Knapp daneben ist auch vorbei. Was kann ich noch verbessern, um das nächste Mal alle Sterne zu erreichen?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfekt! Dann hoffe ich, dass ich Sie wieder einmal so gut beraten kann.","conversation-rating.overlay.bot-message.submit-feedback":"Vielen Dank für die Rückmeldung. Ich bin bestrebt, mich ständig zu verbessern.","conversation-rating.overlay.action.submit":"Bewertung senden","conversation-rating.overlay.action.close":"Zurück zum Chat","start-screen.intro":"","start-screen.start-chat":"Chat starten","header.restart-chat":"Chat neu starten","header.expand-chat":"Chat vergrössern","header.close-chat":"Chat minimieren","source-infos.close":"Schliessen","source-infos.open-source":"Quelle öffnen","source-infos.error.title":"Fehler","source-infos.error.info":"Oops! Etwas ist schiefgelaufen. Bitte versuche es erneut oder kontaktiere den Support, falls das Problem weiterhin besteht.","commands.show-more.action":"Weitere ...","commands.show-more.tooltip":"Weitere Befehle anzeigen","commands.show-less.action":"Weniger ...","commands.show-less.tooltip":"Weniger Befehle anzeigen"},J6={"page.title":"Bubble Chat Chatbot","message-input-label":"User input","message-input-placeholder":"Message","message-input.actions.submit.label":"Send message","message-input.actions.export-transcript.label":"Export conversation","message-input.actions.start-audio-recording.label":"Start voice input","message-input.actions.stop-audio-recording.label":"Stop voice input","message-input.actions.submit-audio-recording.label":"Transmit voice input","guest-bubble.label":"Your message","bot-bubble.label":"Message from the chatbot","bot-bubble.reaction.good":"I like","bot-bubble.reaction.bad":"I don't like it","bot-bubble.reaction.remove":"Remove marker","bot-bubble.copy":"Copy","bot-bubble.sources":"Source list","bot-bubble.source.open":"Open source","agent-bubble.label":"Message from the live agent","export-transcript.email.title":"Receive Conversation","export-transcript.email.description":"Enter your email address to receive the chat history.","export-transcript.email.cancel":"Cancel","export-transcript.email.send":"Send","export-transcript.email.placeholder":"Your email address","export-transcript.email.invalid":"Please enter a valid e-mail address.","export-transcript.email.success":"I have sent the chat history to your email address.","export-transcript.pdf.title":"Get conversation as PDF","export-transcript.pdf.description":"Download this conversation as PDF.","export-transcript.pdf.cancel":"Cancel","export-transcript.pdf.download":"Download","general-conditions.header":"**Terms of use**","general-conditions.body":`Please consider the following points:
@@ -116,4 +116,4 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
116
116
 
117
117
  - La cronologia delle chat è memorizzata nell'area UE e può essere visualizzata solo da persone autorizzate.
118
118
  - 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.close":"Chiudere","start-screen.intro":"","start-screen.start-chat":"Avviare la chat","header.restart-chat":"Riavviare la chat","header.expand-chat":"Allarga la chat","header.close-chat":"Ridurre al minimo la chat","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.","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"},tN=["de","en","fr","it"],Cv={locale:"de",messages:Rv},nN=(n,r)=>{if(tN.includes(n)){const i=rN(n),l=$6(r);return{...i,...l}}return r},rN=n=>{switch(n.toString()){case"en":return J6;case"fr":return W6;case"it":return eN;default:return Rv}},aN=(n=iN,r)=>{switch(r.type){case Yh:return Object.assign({},n,{connectionState:Kr.CONNECTING});case Zh:return Object.assign({},n,{connectionState:Kr.CONNECTED});case Xh:return Object.assign({},n,{connectionState:Kr.DISCONNECTED});case Qh:return Object.assign({},n,{connectionState:Kr.RECONNECTED});default:return n}},iN={connectionState:Kr.DISCONNECTED},ct=[];for(let n=0;n<256;++n)ct.push((n+256).toString(16).slice(1));function sN(n,r=0){return(ct[n[r+0]]+ct[n[r+1]]+ct[n[r+2]]+ct[n[r+3]]+"-"+ct[n[r+4]]+ct[n[r+5]]+"-"+ct[n[r+6]]+ct[n[r+7]]+"-"+ct[n[r+8]]+ct[n[r+9]]+"-"+ct[n[r+10]]+ct[n[r+11]]+ct[n[r+12]]+ct[n[r+13]]+ct[n[r+14]]+ct[n[r+15]]).toLowerCase()}let Yf;const lN=new Uint8Array(16);function oN(){if(!Yf){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Yf=crypto.getRandomValues.bind(crypto)}return Yf(lN)}const uN=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),C_={randomUUID:uN};function cN(n,r,i){var u;if(C_.randomUUID&&!n)return C_.randomUUID();n=n||{};const l=n.random??((u=n.rng)==null?void 0:u.call(n))??oN();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,sN(l)}const fN=(n=D_,r)=>{var i;switch(r.type){case Qb:return D_;case Kh:return Zr({type:"webclient.chat.started"}),n;case Kb:return Zr({type:"webclient.chat.ended"}),n;case Ee.ActionTypes.TYPING_ON:return Object.assign({},n,{isBotTyping:!0});case Ee.ActionTypes.TYPING_OFF:return Object.assign({},n,{isBotTyping:!1});case Ee.ActionTypes.MESSAGE_FROM_GUEST:case Ee.ActionTypes.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return N_(n,r.message);case Ee.ActionTypes.MESSAGE_TO_GUEST:{Zr(r);const l=Object.assign({},r.message,{_id:r.meta.actionId}),u=n.messages.filter(f=>f._id===r.meta.actionId).length>0;return Object.assign({},n,{isBotTyping:!1,messages:u?n.messages:n.messages.concat([l]),quickReplies:l.quickReplies?l.quickReplies:[]})}case Uh:{const l=r.messages,u=l.length?l[l.length-1]:void 0;return Object.assign({},n,{isBotTyping:!1,messages:l,quickReplies:(u==null?void 0:u.quickReplies)||[]})}case jh:return Zr(r.message),n;case Ee.ActionTypes.EVENT_TO_GUEST:return Zr(r.event),n;case Ee.ActionTypes.DRAWER_OPEN:return Object.assign({},n,{drawerContentUrl:r.payload.parameters.contentUrl});case Ee.ActionTypes.DRAWER_CLOSE:return Object.assign({},n,{drawerContentUrl:void 0});case Ee.ActionTypes.GUEST_LOCALE_CHANGED:return Object.assign({},n,{locale:r.payload.locale});case Db:return Zr(r),n;case Mb:return Zr(r),n;case Lh:{const l=new Ee.TextMessage(r.transcription,new Ee.GuestUser),u=Object.assign({},l,{_id:cN()});return N_(n,u)}case Ee.ActionTypes.TRANSCRIPT_ITEM_GUEST_REACTION:{const l=n.messages.map(u=>u._id===r.payload.actionId?Object.assign({},u,{reaction:r.payload.reaction}):u);return Object.assign({},n,{messages:l})}case zh:{const l={enabled:!0,rating:r.payload.rating};return Object.assign({},n,{conversationRating:l})}case Ee.ActionTypes.CONVERSATION_RATING_FROM_GUEST:{const l={...n.conversationRating,rating:r.payload};return Object.assign({},n,{conversationRating:l})}case kh:return{...n,sourceInfos:{type:"loading",chunkId:r.payload.chunkId}};case Nb:return{...n,sourceInfos:{type:"loading-error"}};case Cb:return((i=n.sourceInfos)==null?void 0:i.type)==="loading"?{...n,sourceInfos:{type:"loaded",chunkId:r.payload.chunkId,knowledgeBaseType:r.payload.knowledgeBaseType,title:r.payload.title,content:r.payload.content,url:r.payload.url}}:n;case Gh:return{...n,sourceInfos:void 0};default:return n}},N_=(n,r)=>{const i=n.messages[n.messages.length-1],l=(i==null?void 0:i.text)===r.text;return i&&i.sender.type===r.sender.type&&l?n:Object.assign({},n,{messages:n.messages.concat([r]),quickReplies:[]})},Zr=n=>{var r;hN()?(r=window.top)==null||r.postMessage(n,"*"):n.type==="webclient.change.url"&&window.open(n.url)},hN=()=>typeof window<"u"&&window.self!==window.top,D_={messages:[],quickReplies:[],isBotTyping:!1,conversationRating:{enabled:!1}},Nv=Vh({name:"intl",initialState:Cv,reducers:{updateIntl:(n,r)=>{n.locale=r.payload.language,n.messages=r.payload.messages}}}),{updateIntl:dN}=Nv.actions,mN=Nv.reducer,pN={enableStartScreen:void 0,enableStandaloneView:!1,enableTranscriptExportEmail:!1,enableTranscriptExportPdf:!1,enableGeneralConditions:!1,enableSpeechSupport:!1,commands:[]},Dv=Vh({name:"settings",initialState:pN,reducers:{setSettings(n,r){n.enableStartScreen=r.payload.enableStartScreen,n.enableStandaloneView=r.payload.enableStandaloneView,n.enableTranscriptExportEmail=r.payload.enableTranscriptExportEmail,n.enableTranscriptExportPdf=r.payload.enableTranscriptExportPdf,n.enableGeneralConditions=r.payload.enableGeneralConditions,n.enableSpeechSupport=r.payload.enableSpeechSupport,n.commands=r.payload.commands}}}),{setSettings:gN}=Dv.actions,yN=Dv.reducer,_N=Lb({settings:yN,chat:fN,startScreen:KA,connection:aN,intl:mN}),bN="bubble-chat",Mv="state-last-saved-at",Bv="state",vN=n=>{try{if(!TN())return;const r=M_(n,Mv);if(SN(r))return;{const i=M_(n,Bv);return i===null?void 0:JSON.parse(i)}}catch(r){console.error(r);return}},EN=(n,r)=>{try{const i=JSON.stringify(r);B_(n,Bv,i);const l=new Date().toISOString();B_(n,Mv,l)}catch(i){console.error(i)}},SN=n=>{if(n===null)return!1;const r=new Date(n);return r.setHours(r.getHours()+12),new Date>r},TN=()=>typeof localStorage<"u",M_=(n,r)=>{const i=jv(n,r);return localStorage.getItem(i)},B_=(n,r,i)=>{const l=jv(n,r);return localStorage.setItem(l,i)},jv=(n,r)=>`${bN}-${n}-${r}`,xn=Object.create(null);xn.open="0";xn.close="1";xn.ping="2";xn.pong="3";xn.message="4";xn.upgrade="5";xn.noop="6";const no=Object.create(null);Object.keys(xn).forEach(n=>{no[xn[n]]=n});const _h={type:"error",data:"parser error"},Uv=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Hv=typeof ArrayBuffer=="function",Lv=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,rd=({type:n,data:r},i,l)=>Uv&&r instanceof Blob?i?l(r):j_(r,l):Hv&&(r instanceof ArrayBuffer||Lv(r))?i?l(r):j_(new Blob([r]),l):l(xn[n]+(r||"")),j_=(n,r)=>{const i=new FileReader;return i.onload=function(){const l=i.result.split(",")[1];r("b"+(l||""))},i.readAsDataURL(n)};function U_(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Zf;function xN(n,r){if(Uv&&n.data instanceof Blob)return n.data.arrayBuffer().then(U_).then(r);if(Hv&&(n.data instanceof ArrayBuffer||Lv(n.data)))return r(U_(n.data));rd(n,!1,i=>{Zf||(Zf=new TextEncoder),r(Zf.encode(i))})}const H_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rs=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<H_.length;n++)rs[H_.charCodeAt(n)]=n;const AN=n=>{let r=n.length*.75,i=n.length,l,u=0,f,h,d,m;n[n.length-1]==="="&&(r--,n[n.length-2]==="="&&r--);const g=new ArrayBuffer(r),_=new Uint8Array(g);for(l=0;l<i;l+=4)f=rs[n.charCodeAt(l)],h=rs[n.charCodeAt(l+1)],d=rs[n.charCodeAt(l+2)],m=rs[n.charCodeAt(l+3)],_[u++]=f<<2|h>>4,_[u++]=(h&15)<<4|d>>2,_[u++]=(d&3)<<6|m&63;return g},ON=typeof ArrayBuffer=="function",ad=(n,r)=>{if(typeof n!="string")return{type:"message",data:zv(n,r)};const i=n.charAt(0);return i==="b"?{type:"message",data:wN(n.substring(1),r)}:no[i]?n.length>1?{type:no[i],data:n.substring(1)}:{type:no[i]}:_h},wN=(n,r)=>{if(ON){const i=AN(n);return zv(i,r)}else return{base64:!0,data:n}},zv=(n,r)=>{switch(r){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},kv="",RN=(n,r)=>{const i=n.length,l=new Array(i);let u=0;n.forEach((f,h)=>{rd(f,!1,d=>{l[h]=d,++u===i&&r(l.join(kv))})})},CN=(n,r)=>{const i=n.split(kv),l=[];for(let u=0;u<i.length;u++){const f=ad(i[u],r);if(l.push(f),f.type==="error")break}return l};function NN(){return new TransformStream({transform(n,r){xN(n,i=>{const l=i.length;let u;if(l<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,l);else if(l<65536){u=new Uint8Array(3);const f=new DataView(u.buffer);f.setUint8(0,126),f.setUint16(1,l)}else{u=new Uint8Array(9);const f=new DataView(u.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(l))}n.data&&typeof n.data!="string"&&(u[0]|=128),r.enqueue(u),r.enqueue(i)})}})}let Xf;function Jl(n){return n.reduce((r,i)=>r+i.length,0)}function Wl(n,r){if(n[0].length===r)return n.shift();const i=new Uint8Array(r);let l=0;for(let u=0;u<r;u++)i[u]=n[0][l++],l===n[0].length&&(n.shift(),l=0);return n.length&&l<n[0].length&&(n[0]=n[0].slice(l)),i}function DN(n,r){Xf||(Xf=new TextDecoder);const i=[];let l=0,u=-1,f=!1;return new TransformStream({transform(h,d){for(i.push(h);;){if(l===0){if(Jl(i)<1)break;const m=Wl(i,1);f=(m[0]&128)===128,u=m[0]&127,u<126?l=3:u===126?l=1:l=2}else if(l===1){if(Jl(i)<2)break;const m=Wl(i,2);u=new DataView(m.buffer,m.byteOffset,m.length).getUint16(0),l=3}else if(l===2){if(Jl(i)<8)break;const m=Wl(i,8),g=new DataView(m.buffer,m.byteOffset,m.length),_=g.getUint32(0);if(_>Math.pow(2,21)-1){d.enqueue(_h);break}u=_*Math.pow(2,32)+g.getUint32(4),l=3}else{if(Jl(i)<u)break;const m=Wl(i,u);d.enqueue(ad(f?m:Xf.decode(m),r)),l=0}if(u===0||u>n){d.enqueue(_h);break}}}})}const Gv=4;function et(n){if(n)return MN(n)}function MN(n){for(var r in et.prototype)n[r]=et.prototype[r];return n}et.prototype.on=et.prototype.addEventListener=function(n,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(r),this};et.prototype.once=function(n,r){function i(){this.off(n,i),r.apply(this,arguments)}return i.fn=r,this.on(n,i),this};et.prototype.off=et.prototype.removeListener=et.prototype.removeAllListeners=et.prototype.removeEventListener=function(n,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+n];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var l,u=0;u<i.length;u++)if(l=i[u],l===r||l.fn===r){i.splice(u,1);break}return i.length===0&&delete this._callbacks["$"+n],this};et.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),i=this._callbacks["$"+n],l=1;l<arguments.length;l++)r[l-1]=arguments[l];if(i){i=i.slice(0);for(var l=0,u=i.length;l<u;++l)i[l].apply(this,r)}return this};et.prototype.emitReserved=et.prototype.emit;et.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};et.prototype.hasListeners=function(n){return!!this.listeners(n).length};const Oo=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,i)=>i(r,0),$t=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),BN="arraybuffer";function qv(n,...r){return r.reduce((i,l)=>(n.hasOwnProperty(l)&&(i[l]=n[l]),i),{})}const jN=$t.setTimeout,UN=$t.clearTimeout;function wo(n,r){r.useNativeTimers?(n.setTimeoutFn=jN.bind($t),n.clearTimeoutFn=UN.bind($t)):(n.setTimeoutFn=$t.setTimeout.bind($t),n.clearTimeoutFn=$t.clearTimeout.bind($t))}const HN=1.33;function LN(n){return typeof n=="string"?zN(n):Math.ceil((n.byteLength||n.size)*HN)}function zN(n){let r=0,i=0;for(let l=0,u=n.length;l<u;l++)r=n.charCodeAt(l),r<128?i+=1:r<2048?i+=2:r<55296||r>=57344?i+=3:(l++,i+=4);return i}function Fv(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function kN(n){let r="";for(let i in n)n.hasOwnProperty(i)&&(r.length&&(r+="&"),r+=encodeURIComponent(i)+"="+encodeURIComponent(n[i]));return r}function GN(n){let r={},i=n.split("&");for(let l=0,u=i.length;l<u;l++){let f=i[l].split("=");r[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return r}class qN extends Error{constructor(r,i,l){super(r),this.description=i,this.context=l,this.type="TransportError"}}class id extends et{constructor(r){super(),this.writable=!1,wo(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,i,l){return super.emitReserved("error",new qN(r,i,l)),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=ad(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=kN(r);return i.length?"?"+i:""}}class FN extends id{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 l=0;this._polling&&(l++,this.once("pollComplete",function(){--l||i()})),this.writable||(l++,this.once("drain",function(){--l||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const i=l=>{if(this.readyState==="opening"&&l.type==="open"&&this.onOpen(),l.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(l)};CN(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,RN(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]=Fv()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(r,i)}}let Iv=!1;try{Iv=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const IN=Iv;function VN(){}class PN extends FN{constructor(r){if(super(r),typeof location<"u"){const i=location.protocol==="https:";let l=location.port;l||(l=i?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||l!==r.port}}doWrite(r,i){const l=this.request({method:"POST",data:r});l.on("success",i),l.on("error",(u,f)=>{this.onError("xhr post error",u,f)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(i,l)=>{this.onError("xhr poll error",i,l)}),this.pollXhr=r}}class Sn extends et{constructor(r,i,l){super(),this.createRequest=r,wo(this,l),this._opts=l,this._method=l.method||"GET",this._uri=i,this._data=l.data!==void 0?l.data:null,this._create()}_create(){var r;const i=qv(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const l=this._xhr=this.createRequest(i);try{l.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){l.setDisableHeaderCheck&&l.setDisableHeaderCheck(!0);for(let u in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(u)&&l.setRequestHeader(u,this._opts.extraHeaders[u])}}catch{}if(this._method==="POST")try{l.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{l.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(l),"withCredentials"in l&&(l.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(l.timeout=this._opts.requestTimeout),l.onreadystatechange=()=>{var u;l.readyState===3&&((u=this._opts.cookieJar)===null||u===void 0||u.parseCookies(l.getResponseHeader("set-cookie"))),l.readyState===4&&(l.status===200||l.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof l.status=="number"?l.status:0)},0))},l.send(this._data)}catch(u){this.setTimeoutFn(()=>{this._onError(u)},0);return}typeof document<"u"&&(this._index=Sn.requestsCount++,Sn.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=VN,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Sn.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()}}Sn.requestsCount=0;Sn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",L_);else if(typeof addEventListener=="function"){const n="onpagehide"in $t?"pagehide":"unload";addEventListener(n,L_,!1)}}function L_(){for(let n in Sn.requests)Sn.requests.hasOwnProperty(n)&&Sn.requests[n].abort()}const YN=function(){const n=Vv({xdomain:!1});return n&&n.responseType!==null}();class ZN extends PN{constructor(r){super(r);const i=r&&r.forceBase64;this.supportsBinary=YN&&!i}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new Sn(Vv,this.uri(),r)}}function Vv(n){const r=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||IN))return new XMLHttpRequest}catch{}if(!r)try{return new $t[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Pv=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class XN extends id{get name(){return"websocket"}doOpen(){const r=this.uri(),i=this.opts.protocols,l=Pv?{}:qv(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(l.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(r,i,l)}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 l=r[i],u=i===r.length-1;rd(l,this.supportsBinary,f=>{try{this.doWrite(l,f)}catch{}u&&Oo(()=>{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]=Fv()),this.supportsBinary||(i.b64=1),this.createUri(r,i)}}const Qf=$t.WebSocket||$t.MozWebSocket;class QN extends XN{createSocket(r,i,l){return Pv?new Qf(r,i,l):i?new Qf(r,i):new Qf(r)}doWrite(r,i){this.ws.send(i)}}class KN extends id{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=DN(Number.MAX_SAFE_INTEGER,this.socket.binaryType),l=r.readable.pipeThrough(i).getReader(),u=NN();u.readable.pipeTo(r.writable),this._writer=u.writable.getWriter();const f=()=>{l.read().then(({done:d,value:m})=>{d||(this.onPacket(m),f())}).catch(d=>{})};f();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const l=r[i],u=i===r.length-1;this._writer.write(l).then(()=>{u&&Oo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const $N={websocket:QN,webtransport:KN,polling:ZN},JN=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,WN=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function bh(n){if(n.length>8e3)throw"URI too long";const r=n,i=n.indexOf("["),l=n.indexOf("]");i!=-1&&l!=-1&&(n=n.substring(0,i)+n.substring(i,l).replace(/:/g,";")+n.substring(l,n.length));let u=JN.exec(n||""),f={},h=14;for(;h--;)f[WN[h]]=u[h]||"";return i!=-1&&l!=-1&&(f.source=r,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=e4(f,f.path),f.queryKey=t4(f,f.query),f}function e4(n,r){const i=/\/{2,9}/g,l=r.replace(i,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&l.splice(0,1),r.slice(-1)=="/"&&l.splice(l.length-1,1),l}function t4(n,r){const i={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(l,u,f){u&&(i[u]=f)}),i}const vh=typeof addEventListener=="function"&&typeof removeEventListener=="function",ro=[];vh&&addEventListener("offline",()=>{ro.forEach(n=>n())},!1);class Er extends et{constructor(r,i){if(super(),this.binaryType=BN,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 l=bh(r);i.hostname=l.host,i.secure=l.protocol==="https"||l.protocol==="wss",i.port=l.port,l.query&&(i.query=l.query)}else i.host&&(i.hostname=bh(i.host).host);wo(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(l=>{const u=l.prototype.name;this.transports.push(u),this._transportsByName[u]=l}),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=GN(this.opts.query)),vh&&(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"})},ro.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const i=Object.assign({},this.opts.query);i.EIO=Gv,i.transport=r,this.id&&(i.sid=this.id);const l=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](l)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&Er.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",Er.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 l=0;l<this.writeBuffer.length;l++){const u=this.writeBuffer[l].data;if(u&&(i+=LN(u)),l>0&&i>this._maxPayload)return this.writeBuffer.slice(0,l);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,Oo(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,i,l){return this._sendPacket("message",r,i,l),this}send(r,i,l){return this._sendPacket("message",r,i,l),this}_sendPacket(r,i,l,u){if(typeof i=="function"&&(u=i,i=void 0),typeof l=="function"&&(u=l,l=null),this.readyState==="closing"||this.readyState==="closed")return;l=l||{},l.compress=l.compress!==!1;const f={type:r,data:i,options:l};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),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()},l=()=>{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?l():r()}):this.upgrading?l():r()),this}_onError(r){if(Er.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(),vh&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const l=ro.indexOf(this._offlineEventListener);l!==-1&&ro.splice(l,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,i),this.writeBuffer=[],this._prevBufferLen=0}}}Er.protocol=Gv;class n4 extends Er{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),l=!1;Er.priorWebsocketSuccess=!1;const u=()=>{l||(i.send([{type:"ping",data:"probe"}]),i.once("packet",E=>{if(!l)if(E.type==="pong"&&E.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;Er.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{l||this.readyState!=="closed"&&(_(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const y=new Error("probe error");y.transport=i.name,this.emitReserved("upgradeError",y)}}))};function f(){l||(l=!0,_(),i.close(),i=null)}const h=E=>{const y=new Error("probe error: "+E);y.transport=i.name,f(),this.emitReserved("upgradeError",y)};function d(){h("transport closed")}function m(){h("socket closed")}function g(E){i&&E.name!==i.name&&f()}const _=()=>{i.removeListener("open",u),i.removeListener("error",h),i.removeListener("close",d),this.off("close",m),this.off("upgrading",g)};i.once("open",u),i.once("error",h),i.once("close",d),this.once("close",m),this.once("upgrading",g),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{l||i.open()},200):i.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const i=[];for(let l=0;l<r.length;l++)~this.transports.indexOf(r[l])&&i.push(r[l]);return i}}let r4=class extends n4{constructor(r,i={}){const l=typeof r=="object"?r:i;(!l.transports||l.transports&&typeof l.transports[0]=="string")&&(l.transports=(l.transports||["polling","websocket","webtransport"]).map(u=>$N[u]).filter(u=>!!u)),super(r,l)}};function a4(n,r="",i){let l=n;i=i||typeof location<"u"&&location,n==null&&(n=i.protocol+"//"+i.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=i.protocol+n:n=i.host+n),/^(https?|wss?):\/\//.test(n)||(typeof i<"u"?n=i.protocol+"//"+n:n="https://"+n),l=bh(n)),l.port||(/^(http|ws)$/.test(l.protocol)?l.port="80":/^(http|ws)s$/.test(l.protocol)&&(l.port="443")),l.path=l.path||"/";const f=l.host.indexOf(":")!==-1?"["+l.host+"]":l.host;return l.id=l.protocol+"://"+f+":"+l.port+r,l.href=l.protocol+"://"+f+(i&&i.port===l.port?"":":"+l.port),l}const i4=typeof ArrayBuffer=="function",s4=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,Yv=Object.prototype.toString,l4=typeof Blob=="function"||typeof Blob<"u"&&Yv.call(Blob)==="[object BlobConstructor]",o4=typeof File=="function"||typeof File<"u"&&Yv.call(File)==="[object FileConstructor]";function sd(n){return i4&&(n instanceof ArrayBuffer||s4(n))||l4&&n instanceof Blob||o4&&n instanceof File}function ao(n,r){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let i=0,l=n.length;i<l;i++)if(ao(n[i]))return!0;return!1}if(sd(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return ao(n.toJSON(),!0);for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&ao(n[i]))return!0;return!1}function u4(n){const r=[],i=n.data,l=n;return l.data=Eh(i,r),l.attachments=r.length,{packet:l,buffers:r}}function Eh(n,r){if(!n)return n;if(sd(n)){const i={_placeholder:!0,num:r.length};return r.push(n),i}else if(Array.isArray(n)){const i=new Array(n.length);for(let l=0;l<n.length;l++)i[l]=Eh(n[l],r);return i}else if(typeof n=="object"&&!(n instanceof Date)){const i={};for(const l in n)Object.prototype.hasOwnProperty.call(n,l)&&(i[l]=Eh(n[l],r));return i}return n}function c4(n,r){return n.data=Sh(n.data,r),delete n.attachments,n}function Sh(n,r){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<r.length)return r[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let i=0;i<n.length;i++)n[i]=Sh(n[i],r);else if(typeof n=="object")for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=Sh(n[i],r));return n}const f4=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],h4=5;var Ae;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(Ae||(Ae={}));class d4{constructor(r){this.replacer=r}encode(r){return(r.type===Ae.EVENT||r.type===Ae.ACK)&&ao(r)?this.encodeAsBinary({type:r.type===Ae.EVENT?Ae.BINARY_EVENT:Ae.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let i=""+r.type;return(r.type===Ae.BINARY_EVENT||r.type===Ae.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=u4(r),l=this.encodeAsString(i.packet),u=i.buffers;return u.unshift(l),u}}function z_(n){return Object.prototype.toString.call(n)==="[object Object]"}class ld extends et{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 l=i.type===Ae.BINARY_EVENT;l||i.type===Ae.BINARY_ACK?(i.type=l?Ae.EVENT:Ae.ACK,this.reconstructor=new m4(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(sd(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 l={type:Number(r.charAt(0))};if(Ae[l.type]===void 0)throw new Error("unknown packet type "+l.type);if(l.type===Ae.BINARY_EVENT||l.type===Ae.BINARY_ACK){const f=i+1;for(;r.charAt(++i)!=="-"&&i!=r.length;);const h=r.substring(f,i);if(h!=Number(h)||r.charAt(i)!=="-")throw new Error("Illegal attachments");l.attachments=Number(h)}if(r.charAt(i+1)==="/"){const f=i+1;for(;++i&&!(r.charAt(i)===","||i===r.length););l.nsp=r.substring(f,i)}else l.nsp="/";const u=r.charAt(i+1);if(u!==""&&Number(u)==u){const f=i+1;for(;++i;){const h=r.charAt(i);if(h==null||Number(h)!=h){--i;break}if(i===r.length)break}l.id=Number(r.substring(f,i+1))}if(r.charAt(++i)){const f=this.tryParse(r.substr(i));if(ld.isPayloadValid(l.type,f))l.data=f;else throw new Error("invalid payload")}return l}tryParse(r){try{return JSON.parse(r,this.reviver)}catch{return!1}}static isPayloadValid(r,i){switch(r){case Ae.CONNECT:return z_(i);case Ae.DISCONNECT:return i===void 0;case Ae.CONNECT_ERROR:return typeof i=="string"||z_(i);case Ae.EVENT:case Ae.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&f4.indexOf(i[0])===-1);case Ae.ACK:case Ae.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class m4{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=c4(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const p4=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ld,Encoder:d4,get PacketType(){return Ae},protocol:h4},Symbol.toStringTag,{value:"Module"}));function cn(n,r,i){return n.on(r,i),function(){n.off(r,i)}}const g4=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Zv extends et{constructor(r,i,l){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,l&&l.auth&&(this.auth=l.auth),this._opts=Object.assign({},l),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const r=this.io;this.subs=[cn(r,"open",this.onopen.bind(this)),cn(r,"packet",this.onpacket.bind(this)),cn(r,"error",this.onerror.bind(this)),cn(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 l,u,f;if(g4.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 h={type:Ae.EVENT,data:i};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const _=this.ids++,E=i.pop();this._registerAckCallback(_,E),h.id=_}const d=(u=(l=this.io.engine)===null||l===void 0?void 0:l.transport)===null||u===void 0?void 0:u.writable,m=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!d||(m?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(r,i){var l;const u=(l=this.flags.timeout)!==null&&l!==void 0?l:this._opts.ackTimeout;if(u===void 0){this.acks[r]=i;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let d=0;d<this.sendBuffer.length;d++)this.sendBuffer[d].id===r&&this.sendBuffer.splice(d,1);i.call(this,new Error("operation has timed out"))},u),h=(...d)=>{this.io.clearTimeoutFn(f),i.apply(this,d)};h.withError=!0,this.acks[r]=h}emitWithAck(r,...i){return new Promise((l,u)=>{const f=(h,d)=>h?u(h):l(d);f.withError=!0,i.push(f),this.emit(r,...i)})}_addToQueue(r){let i;typeof r[r.length-1]=="function"&&(i=r.pop());const l={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((u,...f)=>l!==this._queue[0]?void 0:(u!==null?l.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(u)):(this._queue.shift(),i&&i(null,...f)),l.pending=!1,this._drainQueue())),this._queue.push(l),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:Ae.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(l=>String(l.id)===r)){const l=this.acks[r];delete this.acks[r],l.withError&&l.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case Ae.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 Ae.EVENT:case Ae.BINARY_EVENT:this.onevent(r);break;case Ae.ACK:case Ae.BINARY_ACK:this.onack(r);break;case Ae.DISCONNECT:this.ondisconnect();break;case Ae.CONNECT_ERROR:this.destroy();const l=new Error(r.data.message);l.data=r.data.data,this.emitReserved("connect_error",l);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 l of i)l.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 l=!1;return function(...u){l||(l=!0,i.packet({type:Ae.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:Ae.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 l=0;l<i.length;l++)if(r===i[l])return i.splice(l,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 l=0;l<i.length;l++)if(r===i[l])return i.splice(l,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 l of i)l.apply(this,r.data)}}}function Ya(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}Ya.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),i=Math.floor(r*this.jitter*n);n=(Math.floor(r*10)&1)==0?n-i:n+i}return Math.min(n,this.max)|0};Ya.prototype.reset=function(){this.attempts=0};Ya.prototype.setMin=function(n){this.ms=n};Ya.prototype.setMax=function(n){this.max=n};Ya.prototype.setJitter=function(n){this.jitter=n};class Th extends et{constructor(r,i){var l;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,wo(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((l=i.randomizationFactor)!==null&&l!==void 0?l:.5),this.backoff=new Ya({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||p4;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 r4(this.uri,this.opts);const i=this.engine,l=this;this._readyState="opening",this.skipReconnect=!1;const u=cn(i,"open",function(){l.onopen(),r&&r()}),f=d=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",d),r?r(d):this.maybeReconnectOnOpen()},h=cn(i,"error",f);if(this._timeout!==!1){const d=this._timeout,m=this.setTimeoutFn(()=>{u(),f(new Error("timeout")),i.close()},d);this.opts.autoUnref&&m.unref(),this.subs.push(()=>{this.clearTimeoutFn(m)})}return this.subs.push(u),this.subs.push(h),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(cn(r,"ping",this.onping.bind(this)),cn(r,"data",this.ondata.bind(this)),cn(r,"error",this.onerror.bind(this)),cn(r,"close",this.onclose.bind(this)),cn(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){Oo(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,i){let l=this.nsps[r];return l?this._autoConnect&&!l.active&&l.connect():(l=new Zv(this,r,i),this.nsps[r]=l),l}_destroy(r){const i=Object.keys(this.nsps);for(const l of i)if(this.nsps[l].active)return;this._close()}_packet(r){const i=this.encoder.encode(r);for(let l=0;l<i.length;l++)this.engine.write(i[l],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 l;this.cleanup(),(l=this.engine)===null||l===void 0||l.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 l=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&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const es={};function io(n,r){typeof n=="object"&&(r=n,n=void 0),r=r||{};const i=a4(n,r.path||"/socket.io"),l=i.source,u=i.id,f=i.path,h=es[u]&&f in es[u].nsps,d=r.forceNew||r["force new connection"]||r.multiplex===!1||h;let m;return d?m=new Th(l,r):(es[u]||(es[u]=new Th(l,r)),m=es[u]),i.query&&!r.query&&(r.query=i.queryKey),m.socket(i.path,r)}Object.assign(io,{Manager:Th,Socket:Zv,io,connect:io});const y4=[Ee.ActionTypes.MESSAGE_TO_GUEST,Ee.ActionTypes.EVENT_TO_GUEST,Ee.ActionTypes.TYPING_ON,Ee.ActionTypes.TYPING_OFF,Ee.ActionTypes.RESTART_CHAT_REQUEST,...eO,...nA,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],_4=({dispatch:n})=>r=>{let i=null;return l=>{const u=r(l);if(l.type===Ph){i!=null&&i.disconnect(),n(nO());const f=`/chat?${_o.stringify(l.querystrings)}`;i=io(`/${l.clientName}${f}`),i.on("action",n),i.on("connect",()=>n(rO())),i.on("disconnect",()=>n(aO())),i.on("reconnect",()=>n(iO())),i.on("set-translations",(h,d)=>{n(dN({language:h,messages:nN(h,d)}))}),i.on("set-settings",h=>{n(gN(h))}),i.on("enable-conversation-rating",h=>n(lA(h))),i.on("speech-transcription",h=>n(aA(h))),i.on("restore-client-state",h=>{n(uA(h.messages))}),i.on("expand-window",({devices:h,initial:d=!1})=>{n({type:Db,devices:h,initial:d})}),i.on("restart-chat",()=>{n(To(l.clientName,l.querystrings))})}else if(l.type===Kh)i==null||i.emit("start-chat",l.payload);else if(l.type===Kb)i==null||i.emit("terminate-session",l.payload);else if(l.type===tA)i==null||i.emit("get-started",JSON.stringify(l));else if(l.type===Hh)i==null||i.emit("audio-message",l.buffer);else if(l.type===Ee.ActionTypes.CONVERSATION_RATING_FROM_GUEST)i==null||i.emit("conversation-rating",l.payload);else if(l.type===Bb){const{clientName:f}=l.payload;window.location.href=`/${f}/transcript-pdf`}else y4.indexOf(l.type)===-1&&l.meta===void 0&&i&&i.emit("action",JSON.stringify(l));return u}},Xv=Tv(),b4={...vN(Xv),intl:Cv},xh=UA({middleware:n=>n().concat(_4),reducer:_N,preloadedState:b4});xh.subscribe(X6(()=>{const n=xh.getState();EN(Xv,{connection:n.connection,startScreen:n.startScreen})},1e3));const v4=document.getElementById("root"),E4=R2.createRoot(v4);E4.render(v.jsx(AS,{store:xh,children:v.jsx(j6,{})}));
119
- //# sourceMappingURL=index-CdIspDH2.js.map
119
+ //# sourceMappingURL=index-RvyNofo4.js.map