@botfabrik/engine-webclient 4.76.10 → 4.76.12

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.
@@ -94,7 +94,7 @@ For more details see https://formatjs.io/docs/getting-started/message-distributi
94
94
  `,{inline:_}));for(;typeof v[v.length-1]=="string"&&!v[v.length-1].trim();)v.pop();if(n.wrapper===null)return v;const k=n.wrapper||(_?"span":"div");let x;if(v.length>1||n.forceWrapper)x=v;else{if(v.length===1)return x=v[0],typeof x=="string"?i("span",{key:"outer"},x):x;x=null}return n.createElement(k,{key:"outer"},x)}function l(m,_){const v=_.match(Bw);return v?v.reduce(function(k,x,N){const O=x.indexOf("=");if(O!==-1){const S=function(H){return H.indexOf("-")!==-1&&H.match(ex)===null&&(H=H.replace(ox,function(W,se){return se.toUpperCase()})),H}(x.slice(0,O)).trim(),T=function(H){const W=H[0];return(W==='"'||W==="'")&&H.length>=2&&H[H.length-1]===W?H.slice(1,-1):H}(x.slice(O+1).trim()),C=Um[S]||S;if(C==="ref")return k;const L=k[C]=function(H,W,se,te){return W==="style"?se.split(/;\s?/).reduce(function(fe,de){const ae=de.slice(0,de.indexOf(":"));return fe[ae.trim().replace(/(-[a-z])/g,Fe=>Fe[1].toUpperCase())]=de.slice(ae.length+1).trim(),fe},{}):W==="href"||W==="src"?te(se,H,W):(se.match(tx)&&(se=se.slice(1,se.length-1)),se==="true"||se!=="false"&&se)}(m,S,T,n.sanitizer);typeof L=="string"&&(Oc.test(L)||Nc.test(L))&&(k[C]=s(L.trim()))}else x!=="style"&&(k[Um[x]||x]=!0);return k},{}):null}n.overrides=n.overrides||{},n.sanitizer=n.sanitizer||Px,n.slugify=n.slugify||qi,n.namedCodesToUnicode=n.namedCodesToUnicode?yn({},Hm,n.namedCodesToUnicode):Hm,n.createElement=n.createElement||U.createElement;const u=[],d={},h={[re.blockQuote]:{match:Er(tv),order:1,parse(m,_,v){const[,k,x]=m[0].replace(Uw,"").match(Hw);return{alert:k,children:_(x,v)}},render(m,_,v){const k={key:v.key};return m.alert&&(k.className="markdown-alert-"+n.slugify(m.alert.toLowerCase(),qi),m.children.unshift({attrs:{},children:[{type:re.text,text:m.alert}],noInnerParse:!0,type:re.htmlBlock,tag:"header"})),i("blockquote",k,_(m.children,v))}},[re.breakLine]:{match:Vi(Gw),order:1,parse:Pu,render:(m,_,v)=>i("br",{key:v.key})},[re.breakThematic]:{match:Er($w),order:1,parse:Pu,render:(m,_,v)=>i("hr",{key:v.key})},[re.codeBlock]:{match:Er(nv),order:0,parse:m=>({lang:void 0,text:m[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}),render:(m,_,v)=>i("pre",{key:v.key},i("code",yn({},m.attrs,{className:m.lang?`lang-${m.lang}`:""}),m.text))},[re.codeFenced]:{match:Er(rv),order:0,parse:m=>({attrs:l("code",m[3]||""),lang:m[2]||void 0,text:m[4],type:re.codeBlock})},[re.codeInline]:{match:Xr(qw),order:3,parse:m=>({text:m[2]}),render:(m,_,v)=>i("code",{key:v.key},m.text)},[re.footnote]:{match:Er(Xw),order:0,parse:m=>(u.push({footnote:m[2],identifier:m[1]}),{}),render:Du},[re.footnoteReference]:{match:Wr(Qw),order:1,parse:m=>({target:`#${n.slugify(m[1],qi)}`,text:m[1]}),render:(m,_,v)=>i("a",{key:v.key,href:n.sanitizer(m.target,"a","href")},i("sup",{key:v.key},m.text))},[re.gfmTask]:{match:Wr(Zw),order:1,parse:m=>({completed:m[1].toLowerCase()==="x"}),render:(m,_,v)=>i("input",{checked:m.completed,key:v.key,readOnly:!0,type:"checkbox"})},[re.heading]:{match:Er(n.enforceAtxHeadings?ov:iv),order:1,parse:(m,_,v)=>({children:zs(_,m[2],v),id:n.slugify(m[2],qi),level:m[1].length}),render:(m,_,v)=>i(`h${m.level}`,{id:m.id,key:v.key},_(m.children,v))},[re.headingSetext]:{match:Er(sv),order:0,parse:(m,_,v)=>({children:zs(_,m[1],v),level:m[2]==="="?1:2,type:re.heading})},[re.htmlBlock]:{match:Vi(Oc),order:1,parse(m,_,v){const[,k]=m[3].match(bx),x=new RegExp(`^${k}`,"gm"),N=m[3].replace(x,""),O=(S=N,Ox.some(W=>W.test(S))?Mx:zs);var S;const T=m[1].toLowerCase(),C=Lw.indexOf(T)!==-1,L=(C?T:m[1]).trim(),H={attrs:l(L,m[2]),noInnerParse:C,tag:L};return v.inAnchor=v.inAnchor||T==="a",C?H.text=m[3]:H.children=O(_,N,v),v.inAnchor=!1,H},render:(m,_,v)=>i(m.tag,yn({key:v.key},m.attrs),m.text||(m.children?_(m.children,v):""))},[re.htmlSelfClosing]:{match:Vi(Nc),order:1,parse(m){const _=m[1].trim();return{attrs:l(_,m[2]||""),tag:_}},render:(m,_,v)=>i(m.tag,yn({},m.attrs,{key:v.key}))},[re.htmlComment]:{match:Vi(av),order:1,parse:()=>({}),render:Du},[re.image]:{match:Xr(Rx),order:1,parse:m=>({alt:m[1],target:Wm(m[2]),title:m[3]}),render:(m,_,v)=>i("img",{key:v.key,alt:m.alt||void 0,title:m.title||void 0,src:n.sanitizer(m.target,"img","src")})},[re.link]:{match:Wr(kx),order:3,parse:(m,_,v)=>({children:Dx(_,m[1],v),target:Wm(m[2]),title:m[3]}),render:(m,_,v)=>i("a",{key:v.key,href:n.sanitizer(m.target,"a","href"),title:m.title},_(m.children,v))},[re.linkAngleBraceStyleDetector]:{match:Wr(ix),order:0,parse:m=>({children:[{text:m[1],type:re.text}],target:m[1],type:re.link})},[re.linkBareUrlDetector]:{match:(m,_)=>_.inAnchor||n.disableAutoLink?null:Wr(rx)(m,_),order:0,parse:m=>({children:[{text:m[1],type:re.text}],target:m[1],title:void 0,type:re.link})},[re.linkMailtoDetector]:{match:Wr(nx),order:0,parse(m){let _=m[1],v=m[1];return jw.test(v)||(v="mailto:"+v),{children:[{text:_.replace("mailto:",""),type:re.text}],target:v,type:re.link}}},[re.orderedList]:$m(i,1),[re.unorderedList]:$m(i,2),[re.newlineCoalescer]:{match:Er(Vw),order:3,parse:Pu,render:()=>`
95
95
  `},[re.paragraph]:{match:Ix,order:3,parse:Iu,render:(m,_,v)=>i("p",{key:v.key},_(m.children,v))},[re.ref]:{match:Wr(sx),order:0,parse:m=>(d[m[1]]={target:m[2],title:m[4]},{}),render:Du},[re.refImage]:{match:Xr(ax),order:0,parse:m=>({alt:m[1]||void 0,ref:m[2]}),render:(m,_,v)=>d[m.ref]?i("img",{key:v.key,alt:m.alt,src:n.sanitizer(d[m.ref].target,"img","src"),title:d[m.ref].title}):null},[re.refLink]:{match:Wr(lx),order:0,parse:(m,_,v)=>({children:_(m[1],v),fallbackChildren:m[0],ref:m[2]}),render:(m,_,v)=>d[m.ref]?i("a",{key:v.key,href:n.sanitizer(d[m.ref].target,"a","href"),title:d[m.ref].title},_(m.children,v)):i("span",{key:v.key},m.fallbackChildren)},[re.table]:{match:Er(lv),order:1,parse:Ax,render(m,_,v){const k=m;return i("table",{key:v.key},i("thead",null,i("tr",null,k.header.map(function(x,N){return i("th",{key:N,style:Vm(k,N)},_(x,v))}))),i("tbody",null,k.cells.map(function(x,N){return i("tr",{key:N},x.map(function(O,S){return i("td",{key:S,style:Vm(k,S)},_(O,v))}))})))}},[re.text]:{match:Vi(Ex),order:4,parse:m=>({text:m[0].replace(Jw,(_,v)=>n.namedCodesToUnicode[v]?n.namedCodesToUnicode[v]:_)}),render:m=>m.text},[re.textBolded]:{match:Xr(mx),order:2,parse:(m,_,v)=>({children:_(m[2],v)}),render:(m,_,v)=>i("strong",{key:v.key},_(m.children,v))},[re.textEmphasized]:{match:Xr(gx),order:3,parse:(m,_,v)=>({children:_(m[2],v)}),render:(m,_,v)=>i("em",{key:v.key},_(m.children,v))},[re.textEscaped]:{match:Xr(_x),order:1,parse:m=>({text:m[1],type:re.text})},[re.textMarked]:{match:Xr(yx),order:3,parse:Iu,render:(m,_,v)=>i("mark",{key:v.key},_(m.children,v))},[re.textStrikethroughed]:{match:Xr(vx),order:3,parse:Iu,render:(m,_,v)=>i("del",{key:v.key},_(m.children,v))}};n.disableParsingRawHTML===!0&&(delete h[re.htmlBlock],delete h[re.htmlSelfClosing]);const p=function(m){let _=Object.keys(m);function v(k,x){let N=[];for(x.prevCapture=x.prevCapture||"";k;){let O=0;for(;O<_.length;){const S=_[O],T=m[S],C=T.match(k,x);if(C){const L=C[0];x.prevCapture+=L,k=k.substring(L.length);const H=T.parse(C,v,x);H.type==null&&(H.type=S),N.push(H);break}O++}}return x.prevCapture="",N}return _.sort(function(k,x){let N=m[k].order,O=m[x].order;return N!==O?N-O:k<x?-1:1}),function(k,x){return v(function(N){return N.replace(Ww,`
96
96
  `).replace(Kw,"").replace(cx," ")}(k),x)}}(h),E=(y=function(m,_){return function(v,k,x){const N=m[v.type].render;return _?_(()=>N(v,k,x),v,k,x):N(v,k,x)}}(h,n.renderRule),function m(_,v={}){if(Array.isArray(_)){const k=v.key,x=[];let N=!1;for(let O=0;O<_.length;O++){v.key=O;const S=m(_[O],v),T=typeof S=="string";T&&N?x[x.length-1]+=S:S!==null&&x.push(S),N=T}return v.key=k,x}return y(_,m,v)});var y;const w=s(e);return u.length?i("div",null,w,i("footer",{key:"footer"},u.map(function(m){return i("div",{id:n.slugify(m.identifier,qi),key:m.identifier},m.identifier,E(p(m.footnote,{inline:!0})))}))):w}const Kr=e=>{let{children:n="",options:i}=e,s=function(l,u){if(l==null)return{};var d,h,p={},E=Object.keys(l);for(h=0;h<E.length;h++)u.indexOf(d=E[h])>=0||(p[d]=l[d]);return p}(e,Fw);return U.cloneElement(Lx(n,i),s)};var Ev={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Xm=wr.createContext&&wr.createContext(Ev),Bx=["attr","size","title"];function jx(e,n){if(e==null)return{};var i=zx(e,n),s,l;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(l=0;l<u.length;l++)s=u[l],!(n.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(i[s]=e[s])}return i}function zx(e,n){if(e==null)return{};var i={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(n.indexOf(s)>=0)continue;i[s]=e[s]}return i}function Ks(){return Ks=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},Ks.apply(this,arguments)}function Qm(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);n&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),i.push.apply(i,s)}return i}function Ys(e){for(var n=1;n<arguments.length;n++){var i=arguments[n]!=null?arguments[n]:{};n%2?Qm(Object(i),!0).forEach(function(s){Ux(e,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Qm(Object(i)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))})}return e}function Ux(e,n,i){return n=Hx(n),n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,e}function Hx(e){var n=Gx(e,"string");return typeof n=="symbol"?n:n+""}function Gx(e,n){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var s=i.call(e,n||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Sv(e){return e&&e.map((n,i)=>wr.createElement(n.tag,Ys({key:i},n.attr),Sv(n.child)))}function bv(e){return n=>wr.createElement($x,Ks({attr:Ys({},e.attr)},n),Sv(e.child))}function $x(e){var n=i=>{var{attr:s,size:l,title:u}=e,d=jx(e,Bx),h=l||i.size||"1em",p;return i.className&&(p=i.className),e.className&&(p=(p?p+" ":"")+e.className),wr.createElement("svg",Ks({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},i.attr,s,d,{className:p,style:Ys(Ys({color:e.color||i.color},i.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),u&&wr.createElement("title",null,u),e.children)};return Xm!==void 0?wr.createElement(Xm.Consumer,null,i=>n(i)):n(Ev)}function qx(e){return bv({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"},child:[]}]})(e)}function Vx(e){return bv({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z"},child:[]}]})(e)}const Wx="_generalConditionsContainer_1ijeb_1",Xx="_generalConditions_1ijeb_1",Qx="_generalConditionsHeader_1ijeb_15",Kx="_generalConditionsBody_1ijeb_25",Yx="_generalConditionsAccept_1ijeb_33",Wi={generalConditionsContainer:Wx,generalConditions:Xx,generalConditionsHeader:Qx,generalConditionsBody:Kx,generalConditionsAccept:Yx},Zx="general-conditions.header",Jx="general-conditions.body",Km="general-conditions.accept-conditions-note",eT=()=>{const e=$t(),[n,i]=U.useState(!1),s=()=>i(!n),l=h=>{h.key==="ArrowDown"||h.key==="ArrowRight"?i(!0):h.key==="ArrowUp"||h.key==="ArrowLeft"||h.key==="Escape"?i(!1):(h.key==="Enter"||h.key==="Space"||h.key===" ")&&s()},u=e(Zx),d=e(Km);return R.jsxs("div",{className:q(Wi.generalConditionsContainer,"chat__generalConditions"),children:[!!(u!=null&&u.length)&&R.jsxs("div",{className:Wi.generalConditions,children:[R.jsxs("div",{role:"button",onClick:s,onKeyDown:l,tabIndex:0,className:q(Wi.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":n?"true":"false","aria-pressed":n?"true":"false",children:[R.jsx(Kr,{children:u}),n?R.jsx(Vx,{}):R.jsx(qx,{})]}),R.jsx("div",{className:q(Wi.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:n&&R.jsx(Kr,{children:e(Jx)||""})})]}),!!(d!=null&&d.length)&&R.jsx("div",{className:q(Wi.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:R.jsx(Kr,{children:e(Km)||""})})]})},tT="_message_iyv51_5",rT="_messageBot_iyv51_12",nT="_messageBotLast_iyv51_20",iT="_avatar_iyv51_20",oT="_messageBotFirst_iyv51_24",sT="_messageBotAnimated_iyv51_37",aT="_fadeInLeft_iyv51_1",lT="_messageGuest_iyv51_48",uT="_messageGuestFirst_iyv51_54",cT="_messageGuestLast_iyv51_60",fT="_botAvatar_iyv51_74",dT="_agentAvatar_iyv51_78",hT="_bubble_iyv51_82",pT="_bubbleContent_iyv51_88",mT="_bubbleLeft_iyv51_191",gT="_leftText_iyv51_200",yT="_bubbleRight_iyv51_207",vT="_rightText_iyv51_215",pe={message:tT,messageBot:rT,messageBotLast:nT,avatar:iT,messageBotFirst:oT,messageBotAnimated:sT,fadeInLeft:aT,messageGuest:lT,messageGuestFirst:uT,messageGuestLast:cT,botAvatar:fT,agentAvatar:dT,bubble:hT,bubbleContent:pT,bubbleLeft:mT,leftText:gT,bubbleRight:yT,rightText:vT},_T="_botMessageActions_4blu2_1",ET="_alwaysVisible_4blu2_20",ST="_reported_4blu2_27",bT="_action_4blu2_31",Qr={botMessageActions:_T,alwaysVisible:ET,reported:ST,action:bT},wT=({alwaysVisible:e,reaction:n,botMessageRef:i,onReaction:s})=>{const l=$t(),[u,d]=U.useState(!1),h=E=>()=>s(E),p=U.useCallback(async()=>{if(i.current)try{d(!0);const E=i.current.innerHTML,y=i.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([E],{type:"text/html"}),"text/plain":new Blob([y],{type:"text/plain"})})]),await new Promise(w=>setTimeout(w,1500))}finally{d(!1)}},[i]);return R.jsxs("div",{className:q(Qr.botMessageActions,e&&Qr.alwaysVisible,n&&Qr.reported),children:[R.jsx("button",{className:q(Qr.action,n==="GOOD"&&Qr.reported,"tooltip--right"),tabIndex:0,"aria-label":l(n==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),"data-title":l(n==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),onClick:h(n==="GOOD"?null:"GOOD"),children:R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:n==="GOOD"?R.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"}):R.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.jsx("button",{className:q(Qr.action,n==="BAD"&&Qr.reported,"tooltip--right"),tabIndex:0,"aria-label":l(n==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),"data-title":l(n==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),onClick:h(n==="BAD"?null:"BAD"),children:R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:n==="BAD"?R.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"}):R.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"})})}),R.jsx("button",{className:q(Qr.action,"tooltip--right"),tabIndex:0,"aria-label":l("bot-bubble.copy"),"data-title":l("bot-bubble.copy"),onClick:p,children:R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:u?R.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"}):R.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"})})})]})},wv=U.forwardRef(({message:e,isAnimated:n,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:l,children:u,onReaction:d},h)=>{const p=$t(),E=U.useRef(null),y=e.sender.type===ge.UserType.BOT;return R.jsxs("li",{ref:h,className:q(pe.message,pe.messageBot,i&&pe.lastMessage,s&&pe.messageBotFirst,l&&pe.messageBotLast,"chat__bubbleContainer",n&&pe.messageBotAnimated,n&&"chat__bubbleContainer--animated",y?"chat__botBubbleContainer":"chat__agentBubbleContainer",s&&"chat__bubbleContainer--first",l&&"chat__bubbleContainer--last"),children:[R.jsx("img",{className:q(pe.avatar,y?pe.botAvatar:pe.agentAvatar,"chat__avatar",y?"chat__botAvatar":"chat__agentAvatar"),src:`${e.sender.avatar}`,alt:y?"Bot":"Agent",referrerPolicy:"no-referrer"}),R.jsx("div",{ref:E,className:q(pe.bubble,pe.bubbleLeft,"chat__bubble",y?"chat__botBubble":"chat__agentBubble"),tabIndex:0,"aria-label":p(y?"bot-bubble.label":"agent-bubble.label"),children:R.jsx("div",{className:q(pe.leftText),children:u})}),d&&R.jsx(wT,{alwaysVisible:i&&l,reaction:e.reaction,botMessageRef:E,onReaction:d})]})}),xT="_title_1mhh2_1",TT="_subtitle_1mhh2_6",CT="_buttons_1mhh2_11",kT="_button_1mhh2_11",RT="_imageContainer_1mhh2_33",OT="_image_1mhh2_33",NT="_video_container_1mhh2_44",AT="_video_1mhh2_44",IT="_only_1mhh2_54",xt={title:xT,subtitle:TT,buttons:CT,button:kT,imageContainer:RT,image:OT,video_container:NT,video:AT,only:IT},PT=({buttons:e,onButtonClick:n})=>R.jsx("div",{className:q(xt.buttons,"chat__bubbleButtons"),children:e.map((i,s)=>R.jsx("button",{className:q(xt.button,it.button,"chat__bubbleButton"),onClick:()=>n(i),children:i.title},s))});var Ns={},As={},Is={},Ym;function DT(){if(Ym)return Is;Ym=1,Object.defineProperty(Is,"__esModule",{value:!0});var e=ei(),n=i(e);function i(s){if(s&&s.__esModule)return s;var l={};if(s!=null)for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(l[u]=s[u]);return l.default=s,l}return Is.default=function(s,l,u){return n.createElement("a",{href:s,key:u},l)},Is}var Ps={},Zm;function MT(){return Zm||(Zm=1,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.default=function(e){return e}),Ps}var Ds={},Fu,Jm;function FT(){return Jm||(Jm=1,Fu=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),Fu}var Lu,eg;function LT(){return eg||(eg=1,Lu=/[\0-\x1F\x7F-\x9F]/),Lu}var Bu,tg;function BT(){return tg||(tg=1,Bu=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),Bu}var ju,rg;function jT(){return rg||(rg=1,ju=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/),ju}var zu,ng;function zT(){return ng||(ng=1,zu=function(e){var n={};n.src_Any=FT().source,n.src_Cc=LT().source,n.src_Z=BT().source,n.src_P=jT().source,n.src_ZPCc=[n.src_Z,n.src_P,n.src_Cc].join("|"),n.src_ZCc=[n.src_Z,n.src_Cc].join("|");var i="[><|]";return n.src_pseudo_letter="(?:(?!"+i+"|"+n.src_ZPCc+")"+n.src_Any+")",n.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]?)",n.src_auth="(?:(?:(?!"+n.src_ZCc+"|[@/\\[\\]()]).)+@)?",n.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",n.src_host_terminator="(?=$|"+i+"|"+n.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+n.src_ZPCc+"))",n.src_path="(?:[/?#](?:(?!"+n.src_ZCc+"|"+i+`|[()[\\]{}.,"'?!\\-]).|\\[(?:(?!`+n.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+n.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+n.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+n.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+n.src_ZCc+"|[']).)+\\'|\\'(?="+n.src_pseudo_letter+"|[-]).|\\.{2,4}[a-zA-Z0-9%/]|\\.(?!"+n.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+n.src_ZCc+").|\\!(?!"+n.src_ZCc+"|[!]).|\\?(?!"+n.src_ZCc+"|[?]).)+|\\/)?",n.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',n.src_xn="xn--[a-z0-9\\-]{1,59}",n.src_domain_root="(?:"+n.src_xn+"|"+n.src_pseudo_letter+"{1,63})",n.src_domain="(?:"+n.src_xn+"|(?:"+n.src_pseudo_letter+")|(?:"+n.src_pseudo_letter+"(?:-|"+n.src_pseudo_letter+"){0,61}"+n.src_pseudo_letter+"))",n.src_host="(?:(?:(?:(?:"+n.src_domain+")\\.)*"+n.src_domain+"))",n.tpl_host_fuzzy="(?:"+n.src_ip4+"|(?:(?:(?:"+n.src_domain+")\\.)+(?:%TLDS%)))",n.tpl_host_no_ip_fuzzy="(?:(?:(?:"+n.src_domain+")\\.)+(?:%TLDS%))",n.src_host_strict=n.src_host+n.src_host_terminator,n.tpl_host_fuzzy_strict=n.tpl_host_fuzzy+n.src_host_terminator,n.src_host_port_strict=n.src_host+n.src_port+n.src_host_terminator,n.tpl_host_port_fuzzy_strict=n.tpl_host_fuzzy+n.src_port+n.src_host_terminator,n.tpl_host_port_no_ip_fuzzy_strict=n.tpl_host_no_ip_fuzzy+n.src_port+n.src_host_terminator,n.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+n.src_ZPCc+"|>|$))",n.tpl_email_fuzzy="(^|"+i+'|"|\\(|'+n.src_ZCc+")("+n.src_email_name+"@"+n.tpl_host_fuzzy_strict+")",n.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+n.src_ZPCc+"))((?![$+<=>^`||])"+n.tpl_host_port_fuzzy_strict+n.src_path+")",n.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+n.src_ZPCc+"))((?![$+<=>^`||])"+n.tpl_host_port_no_ip_fuzzy_strict+n.src_path+")",n}),zu}var Uu,ig;function UT(){if(ig)return Uu;ig=1;function e(S){var T=Array.prototype.slice.call(arguments,1);return T.forEach(function(C){C&&Object.keys(C).forEach(function(L){S[L]=C[L]})}),S}function n(S){return Object.prototype.toString.call(S)}function i(S){return n(S)==="[object String]"}function s(S){return n(S)==="[object Object]"}function l(S){return n(S)==="[object RegExp]"}function u(S){return n(S)==="[object Function]"}function d(S){return S.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var h={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function p(S){return Object.keys(S||{}).reduce(function(T,C){return T||h.hasOwnProperty(C)},!1)}var E={"http:":{validate:function(S,T,C){var L=S.slice(T);return C.re.http||(C.re.http=new RegExp("^\\/\\/"+C.re.src_auth+C.re.src_host_port_strict+C.re.src_path,"i")),C.re.http.test(L)?L.match(C.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(S,T,C){var L=S.slice(T);return C.re.no_http||(C.re.no_http=new RegExp("^"+C.re.src_auth+"(?:localhost|(?:(?:"+C.re.src_domain+")\\.)+"+C.re.src_domain_root+")"+C.re.src_port+C.re.src_host_terminator+C.re.src_path,"i")),C.re.no_http.test(L)?T>=3&&S[T-3]===":"||T>=3&&S[T-3]==="/"?0:L.match(C.re.no_http)[0].length:0}},"mailto:":{validate:function(S,T,C){var L=S.slice(T);return C.re.mailto||(C.re.mailto=new RegExp("^"+C.re.src_email_name+"@"+C.re.src_host_strict,"i")),C.re.mailto.test(L)?L.match(C.re.mailto)[0].length:0}}},y="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]",w="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function m(S){S.__index__=-1,S.__text_cache__=""}function _(S){return function(T,C){var L=T.slice(C);return S.test(L)?L.match(S)[0].length:0}}function v(){return function(S,T){T.normalize(S)}}function k(S){var T=S.re=zT()(S.__opts__),C=S.__tlds__.slice();S.onCompile(),S.__tlds_replaced__||C.push(y),C.push(T.src_xn),T.src_tlds=C.join("|");function L(te){return te.replace("%TLDS%",T.src_tlds)}T.email_fuzzy=RegExp(L(T.tpl_email_fuzzy),"i"),T.link_fuzzy=RegExp(L(T.tpl_link_fuzzy),"i"),T.link_no_ip_fuzzy=RegExp(L(T.tpl_link_no_ip_fuzzy),"i"),T.host_fuzzy_test=RegExp(L(T.tpl_host_fuzzy_test),"i");var H=[];S.__compiled__={};function W(te,fe){throw new Error('(LinkifyIt) Invalid schema "'+te+'": '+fe)}Object.keys(S.__schemas__).forEach(function(te){var fe=S.__schemas__[te];if(fe!==null){var de={validate:null,link:null};if(S.__compiled__[te]=de,s(fe)){l(fe.validate)?de.validate=_(fe.validate):u(fe.validate)?de.validate=fe.validate:W(te,fe),u(fe.normalize)?de.normalize=fe.normalize:fe.normalize?W(te,fe):de.normalize=v();return}if(i(fe)){H.push(te);return}W(te,fe)}}),H.forEach(function(te){S.__compiled__[S.__schemas__[te]]&&(S.__compiled__[te].validate=S.__compiled__[S.__schemas__[te]].validate,S.__compiled__[te].normalize=S.__compiled__[S.__schemas__[te]].normalize)}),S.__compiled__[""]={validate:null,normalize:v()};var se=Object.keys(S.__compiled__).filter(function(te){return te.length>0&&S.__compiled__[te]}).map(d).join("|");S.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+T.src_ZPCc+"))("+se+")","i"),S.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+T.src_ZPCc+"))("+se+")","ig"),S.re.pretest=RegExp("("+S.re.schema_test.source+")|("+S.re.host_fuzzy_test.source+")|@","i"),m(S)}function x(S,T){var C=S.__index__,L=S.__last_index__,H=S.__text_cache__.slice(C,L);this.schema=S.__schema__.toLowerCase(),this.index=C+T,this.lastIndex=L+T,this.raw=H,this.text=H,this.url=H}function N(S,T){var C=new x(S,T);return S.__compiled__[C.schema].normalize(C,S),C}function O(S,T){if(!(this instanceof O))return new O(S,T);T||p(S)&&(T=S,S={}),this.__opts__=e({},h,T),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=e({},E,S),this.__compiled__={},this.__tlds__=w,this.__tlds_replaced__=!1,this.re={},k(this)}return O.prototype.add=function(T,C){return this.__schemas__[T]=C,k(this),this},O.prototype.set=function(T){return this.__opts__=e(this.__opts__,T),this},O.prototype.test=function(T){if(this.__text_cache__=T,this.__index__=-1,!T.length)return!1;var C,L,H,W,se,te,fe,de,ae;if(this.re.schema_test.test(T)){for(fe=this.re.schema_search,fe.lastIndex=0;(C=fe.exec(T))!==null;)if(W=this.testSchemaAt(T,C[2],fe.lastIndex),W){this.__schema__=C[2],this.__index__=C.index+C[1].length,this.__last_index__=C.index+C[0].length+W;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(de=T.search(this.re.host_fuzzy_test),de>=0&&(this.__index__<0||de<this.__index__)&&(L=T.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(se=L.index+L[1].length,(this.__index__<0||se<this.__index__)&&(this.__schema__="",this.__index__=se,this.__last_index__=L.index+L[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(ae=T.indexOf("@"),ae>=0&&(H=T.match(this.re.email_fuzzy))!==null&&(se=H.index+H[1].length,te=H.index+H[0].length,(this.__index__<0||se<this.__index__||se===this.__index__&&te>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=se,this.__last_index__=te))),this.__index__>=0},O.prototype.pretest=function(T){return this.re.pretest.test(T)},O.prototype.testSchemaAt=function(T,C,L){return this.__compiled__[C.toLowerCase()]?this.__compiled__[C.toLowerCase()].validate(T,L,this):0},O.prototype.match=function(T){var C=0,L=[];this.__index__>=0&&this.__text_cache__===T&&(L.push(N(this,C)),C=this.__last_index__);for(var H=C?T.slice(C):T;this.test(H);)L.push(N(this,C)),H=H.slice(this.__last_index__),C+=this.__last_index__;return L.length?L:null},O.prototype.tlds=function(T,C){return T=Array.isArray(T)?T:[T],C?(this.__tlds__=this.__tlds__.concat(T).sort().filter(function(L,H,W){return L!==W[H-1]}).reverse(),k(this),this):(this.__tlds__=T.slice(),this.__tlds_replaced__=!0,k(this),this)},O.prototype.normalize=function(T){T.schema||(T.url="http://"+T.url),T.schema==="mailto:"&&!/^mailto:/i.test(T.url)&&(T.url="mailto:"+T.url)},O.prototype.onCompile=function(){},Uu=O,Uu}const HT=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","avianca","aw","aws","ax","axa","az","azure","ba","baby","baidu","banamex","bananarepublic","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","cbs","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","cityeats","ck","cl","claims","cleaning","click","clinic","clinique","clothing","cloud","club","clubmed","cm","cn","co","coach","codes","coffee","college","cologne","com","comcast","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","dabur","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","etisalat","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","frontdoor","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","guardian","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","kerrylogistics","kerryproperties","kfh","kg","kh","ki","kia","kids","kim","kinder","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","lipsy","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","natura","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","oldnavy","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","rocher","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","sca","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","shaw","shell","shia","shiksha","shoes","shop","shopping","shouji","show","showtime","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","volkswagen","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","xfinity","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 og;function GT(){if(og)return Ds;og=1,Object.defineProperty(Ds,"__esModule",{value:!0});var e=UT(),n=l(e),i=HT,s=l(i);function l(d){return d&&d.__esModule?d:{default:d}}var u=new n.default;return u.tlds(s.default),Ds.default=function(d){return u.match(d)},Ds}var Ms={},sg;function $T(){return sg||(sg=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.default=function(e){return e}),Ms}var ag;function qT(){if(ag)return As;ag=1,Object.defineProperty(As,"__esModule",{value:!0});var e=function(){function N(O,S){for(var T=0;T<S.length;T++){var C=S[T];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(O,C.key,C)}}return function(O,S,T){return S&&N(O.prototype,S),T&&N(O,T),O}}(),n=ei(),i=m(n),s=DT(),l=w(s),u=MT(),d=w(u),h=GT(),p=w(h),E=$T(),y=w(E);function w(N){return N&&N.__esModule?N:{default:N}}function m(N){if(N&&N.__esModule)return N;var O={};if(N!=null)for(var S in N)Object.prototype.hasOwnProperty.call(N,S)&&(O[S]=N[S]);return O.default=N,O}function _(N,O){if(!(N instanceof O))throw new TypeError("Cannot call a class as a function")}function v(N,O){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:N}function k(N,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);N.prototype=Object.create(O&&O.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(N,O):N.__proto__=O)}var x=function(N){k(O,N);function O(){return _(this,O),v(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return e(O,[{key:"parseString",value:function(T){var C=this;if(T==="")return T;var L=this.props.matchDecorator(T);if(!L)return T;var H=[],W=0;return L.forEach(function(se,te){se.index>W&&H.push(T.substring(W,se.index));var fe=C.props.hrefDecorator(se.url),de=C.props.textDecorator(se.text),ae=C.props.componentDecorator(fe,de,te);H.push(ae),W=se.lastIndex}),T.length>W&&H.push(T.substring(W)),H.length===1?H[0]:H}},{key:"parse",value:function(T){var C=this,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof T=="string"?this.parseString(T):i.isValidElement(T)&&T.type!=="a"&&T.type!=="button"?i.cloneElement(T,{key:L},this.parse(T.props.children)):Array.isArray(T)?T.map(function(H,W){return C.parse(H,W)}):T}},{key:"render",value:function(){return i.createElement(i.Fragment,null,this.parse(this.props.children))}}]),O}(i.Component);return x.defaultProps={componentDecorator:l.default,hrefDecorator:d.default,matchDecorator:p.default,textDecorator:y.default},As.default=x,As}var lg;function VT(){if(lg)return Ns;lg=1,Object.defineProperty(Ns,"__esModule",{value:!0});var e=qT(),n=i(e);function i(s){return s&&s.__esModule?s:{default:s}}return Ns.default=n.default,Ns}var WT=VT();const XT=Js(WT),QT="_text_1k7aq_1",KT={text:QT},xv=({text:e,onLinkClick:n})=>{const i=l=>u=>(u.preventDefault(),l&&n(l),!1),s=(l,u,d)=>R.jsx("a",{onClick:i(l),role:"button",children:u},d);return R.jsx("div",{children:e.split(`
97
- `).map((l,u)=>R.jsxs("span",{className:KT.text,children:[R.jsx(XT,{componentDecorator:s,children:l}),R.jsx("br",{})]},u))})},YT=({subtitle:e,onLinkClick:n})=>e?R.jsx("div",{className:xt.subtitle,children:R.jsx(xv,{text:e,onLinkClick:n})}):null,ug="newtab#",Tv=({markdown:e,onLinkClick:n})=>{const i=l=>u=>(u.preventDefault(),l&&n(l),!1),s=({title:l,href:u,children:d})=>u.indexOf(ug)===0?R.jsx("a",{href:u.slice(ug.length),title:l,target:"_blank",rel:"noopener noreferrer",children:d}):R.jsx("a",{onClick:i(u),title:l,href:u,children:d});return R.jsx(Kr,{options:{overrides:{a:s}},children:e})},ZT=({text:e,onLinkClick:n})=>e?R.jsx("div",{children:R.jsx(Tv,{markdown:e,onLinkClick:n})}):null,JT=({title:e})=>e?R.jsx("h1",{className:xt.title,children:e}):null,eC=({title:e,text:n,subtitle:i,buttons:s,onButtonClick:l,onLinkClick:u})=>(e==null?void 0:e.length)||(n==null?void 0:n.length)||(i==null?void 0:i.length)||(s==null?void 0:s.length)?R.jsxs("div",{className:q(pe.bubbleContent),children:[R.jsx(JT,{title:e}),R.jsx(ZT,{text:n,onLinkClick:u}),R.jsx(YT,{subtitle:i,onLinkClick:u}),R.jsx(PT,{buttons:s,onButtonClick:l})]}):null,tC=({alt:e,imageUrl:n,itemUrl:i,hasBody:s})=>n?i?i.indexOf("youtube.com")>-1?R.jsx("div",{className:xt.video_container,children:R.jsx("iframe",{className:q(xt.video,{[xt.only]:!s}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):R.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:R.jsx("div",{className:xt.imageContainer,children:R.jsx("img",{className:q(xt.image,{[xt.only]:!s}),src:n,alt:e})})}):R.jsx("div",{className:xt.imageContainer,children:R.jsx("img",{className:q(xt.image,{[xt.only]:!s}),src:n,alt:e})}):null,rC=({title:e,text:n,subtitle:i,imageUrl:s,itemUrl:l,buttons:u,onButtonClick:d,onLinkClick:h})=>{const p=!!(e!=null&&e.length)||!!(n!=null&&n.length)||!!(i!=null&&i.length)||!!(u!=null&&u.length);return R.jsxs("div",{className:q(xt.detailMessage),children:[R.jsx(tC,{hasBody:p,imageUrl:s,itemUrl:l,alt:e||i}),p&&R.jsx(eC,{title:e,text:n,subtitle:i,buttons:u,onLinkClick:h,onButtonClick:d})]})},nC=U.forwardRef(({isFirstMessageBySender:e,isLastMessageBySender:n,children:i},s)=>{const l=$t();return R.jsx("li",{ref:s,className:q(pe.message,pe.messageGuest,e&&pe.messageGuestFirst,n&&pe.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",e&&"chat__bubbleContainer--first",n&&"chat__bubbleContainer--last"),children:R.jsx("div",{className:q(pe.bubble,pe.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":l("guest-bubble.label"),children:R.jsx("div",{className:q(pe.rightText),children:i})})})}),iC=({markdown:e,className:n,onLinkClick:i})=>R.jsx("div",{className:q(pe.bubbleContent,n),children:R.jsx(Tv,{markdown:e,onLinkClick:i})}),oC=({text:e,onLinkClick:n})=>R.jsx("div",{className:pe.bubbleContent,children:R.jsx(xv,{text:e,onLinkClick:n})}),sC=U.forwardRef(({message:e,isLastMessage:n,isFirstMessageBySender:i,isLastMessageBySender:s,onReaction:l,onButtonClick:u,onLinkClick:d},h)=>{const p=aC(e,u,d);switch(e.sender.type){case ge.UserType.GUEST:return R.jsx(nC,{ref:h,isFirstMessageBySender:i,isLastMessageBySender:s,children:p});default:{const E=y=>l(e._id,y);return R.jsx(wv,{ref:h,message:e,isAnimated:!1,isLastMessage:n,isFirstMessageBySender:i,isLastMessageBySender:s,onReaction:E,children:p})}}}),aC=(e,n,i)=>{switch(e.type){case ge.MessageTypeEnum.TEXT:{const s=e;return R.jsx(oC,{text:s.text,onLinkClick:i})}case ge.MessageTypeEnum.DETAIL:{const s=e;return R.jsx(rC,{title:s.title,text:s.text,subtitle:s.subtitle,imageUrl:s.imageUrl,itemUrl:s.itemUrl,buttons:s.buttons,onButtonClick:n,onLinkClick:i})}case ge.MessageTypeEnum.MARKDOWN:{const s=e;return R.jsx(iC,{markdown:s.markdown,className:s.className,onLinkClick:i})}}},lC=(e,n)=>e.message._id===n.message._id&&e.message.reaction===n.message.reaction&&e.isLastMessage===n.isLastMessage&&e.isFirstMessageBySender===n.isFirstMessageBySender&&e.isLastMessageBySender===n.isLastMessageBySender,uC=wr.memo(sC,lC),cC="_ticontainer_wftg7_1",fC="_tiblock_wftg7_5",dC="_tidot_wftg7_12",hC="_mercuryTypingAnimation_wftg7_1",Xi={ticontainer:cC,tiblock:fC,tidot:dC,mercuryTypingAnimation:hC},pC=({isTyping:e=!1})=>R.jsx("div",{className:Xi.ticontainer,children:R.jsx("div",{className:Xi.tiblock,children:e?R.jsxs(R.Fragment,{children:[R.jsx("div",{className:q(Xi.tidot,"chat__typingIndicator")}),R.jsx("div",{className:q(Xi.tidot,"chat__typingIndicator")}),R.jsx("div",{className:q(Xi.tidot,"chat__typingIndicator")})]}):null})}),mC=Object.assign({_id:"typing-indicator"},new ge.TextMessage("",new ge.BotUser)),gC=({messages:e,isBotTyping:n,showGeneralConditions:i,onTranscriptItemReaction:s,onButtonClick:l,onLinkClick:u})=>{const d=U.useRef(0),h=U.useRef(!0),p=U.useRef(null),E=U.useRef(null),y=U.useRef(null);U.useLayoutEffect(()=>{if(e.length&&p.current&&(d.current<e.length||n)){if(E.current){const _=E.current.offsetTop;p.current.scrollTop=_}else if(y.current){const _=y.current.offsetTop;p.current.scrollTop=_}h.current&&(h.current=!1),d.current=e.length}},[e,h,n]);let w;const m=e.length;return R.jsxs("div",{ref:p,className:q(jm.messageContainer,"chat__messageContainer"),style:{scrollBehavior:e.length&&h.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[i&&R.jsx(eT,{}),R.jsxs("ul",{className:jm.messages,children:[e.map((_,v)=>{const k=yC(_,w),x=vC(_,v,e,n);w=_.sender.type;const N=v+1===m;return R.jsx(uC,{ref:N?y:null,message:_,isLastMessage:N,isFirstMessageBySender:k,isLastMessageBySender:x,onButtonClick:l,onLinkClick:u,onReaction:s},N&&!n?"last":_._id)}),n&&R.jsx(wv,{ref:E,message:mC,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:w!==ge.UserType.BOT,isLastMessageBySender:!0,children:R.jsx(pC,{isTyping:!0})},"last")]})]})},yC=(e,n)=>!n||n!==e.sender.type,vC=(e,n,i,s)=>{var h;const l=e.sender.type,u=i.length;return n+1===u?!(l===ge.UserType.BOT&&s):l!==((h=i.at(n+1))==null?void 0:h.sender.type)},_C="_bottomSheet_8itd6_1",EC="_bottomSheetOpen_8itd6_15",SC="_bottomSheetClose_8itd6_20",Tr={bottomSheet:_C,bottomSheetOpen:EC,"slide-in":"_slide-in_8itd6_1",bottomSheetClose:SC,"slide-out":"_slide-out_8itd6_1"},bC="_container_ooyn8_1",cg={container:bC},wC=({contentUrl:e})=>{const n=_n(u=>u.connection.sessionId),[i,s]=U.useState(!1);U.useEffect(()=>{s(u=>u||!!e)},[e]);const l=U.useMemo(()=>{if(e&&n){const u=new URL(e,document.baseURI);return u.searchParams.set("sessionId",n),u.toString()}else return},[e,n]);return R.jsx("div",{className:q(cg.container,Tr.bottomSheet,{[Tr.bottomSheetOpen]:!!e,[Tr.bottomSheetClose]:i&&!e}),children:l&&R.jsx("iframe",{title:"Drawer",src:l,className:cg.iframe})})},xC="_container_t5oqt_1",TC={container:xC},CC=({title:e,href:n,children:i})=>R.jsx("a",{href:n,title:e,target:"_blank",rel:"noopener noreferrer",children:i}),kC=()=>{const n=$t()("powered-by");return n&&n.length?R.jsx("div",{className:q(TC.container,"chat__poweredBy"),children:R.jsx(Kr,{options:{overrides:{a:CC}},children:n})}):null},RC="_container_rkqaf_1",OC="_formContainer_rkqaf_14",NC="_emailInput_rkqaf_19",AC="_description_rkqaf_48",IC="_actions_rkqaf_53",PC="_validationError_rkqaf_63",DC="_submitted_rkqaf_70",Sr={container:RC,formContainer:OC,emailInput:NC,description:AC,actions:IC,validationError:PC,submitted:DC},MC=({visible:e,methods:n,onEmailExport:i,onPdfExport:s,onClose:l})=>{const u=$t(),[d,h]=U.useState(void 0),[p,E]=U.useState(!1),[y,w]=U.useState(!1),[m,_]=U.useState(void 0),v=U.useRef(null);U.useEffect(()=>{var O;e?((O=v.current)==null||O.focus(),E(!1),w(!1),h(e)):d===!0&&h(!1)},[e,d]);const k=O=>{O.preventDefault(),m&&m.length>0&&(i(m),E(!0),setTimeout(l,3*1e3))},x=O=>{const S=O.target.value.trim(),T=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(S);_(T?S:"")},N=()=>{w(!0),s(),setTimeout(l,3*1e3)};return R.jsxs("div",{className:q(Sr.container,Tr.bottomSheet,{[Tr.bottomSheetOpen]:d===!0,[Tr.bottomSheetClose]:d===!1}),children:[n.pdf&&R.jsxs(R.Fragment,{children:[R.jsx("h2",{children:u("export-transcript.pdf.title")}),R.jsx(Kr,{className:Sr.description,children:u("export-transcript.pdf.description")||""}),R.jsxs("div",{className:Sr.actions,children:[R.jsx("button",{type:"button",className:q(it.button,it.buttonDefault),onClick:l,children:u("export-transcript.pdf.cancel")}),R.jsx("button",{className:q(it.button,it.buttonPrimary),onClick:N,disabled:y,children:u("export-transcript.pdf.download")})]})]}),n.email&&R.jsxs(R.Fragment,{children:[R.jsx("h2",{children:u("export-transcript.email.title")}),R.jsx(Kr,{className:Sr.description,children:u("export-transcript.email.description")||""}),R.jsxs("form",{onSubmit:k,className:Sr.formContainer,children:[R.jsxs("div",{children:[R.jsx("input",{disabled:p,ref:v,type:"email",placeholder:u("export-transcript.email.placeholder"),className:Sr.emailInput,onChange:x}),(m==null?void 0:m.length)===0?R.jsx("div",{className:Sr.validationError,children:u("export-transcript.email.invalid")}):null]}),R.jsxs("div",{className:Sr.actions,children:[R.jsx("button",{type:"button",className:q(it.button,it.buttonDefault),onClick:l,children:u("export-transcript.email.cancel")}),R.jsx("button",{type:"submit",disabled:p||m===void 0||m.length===0,className:q(it.button,it.buttonPrimary),children:u("export-transcript.email.send")})]})]}),p&&R.jsx("div",{className:Sr.submitted,children:u("export-transcript.email.success")})]})]})},FC="_inputContainer_1px77_1",LC={inputContainer:FC},BC="_blockUserInput_rv0dg_1",jC={blockUserInput:BC,"append-animate":"_append-animate_rv0dg_1"},zC=({visible:e})=>{const n=$t();return e?R.jsx("div",{className:q(jC.blockUserInput,"chat__blockUserInput"),children:n("block-user-input.title")}):null},UC="_callToActionContainer_czz0p_1",HC="_callToActionTitle_czz0p_24",GC="_rateOverlay_czz0p_31",$C="_body_czz0p_50",qC="_footer_czz0p_58",VC="_actions_czz0p_73",WC="_bubbles_czz0p_85",XC="_rateFeedbackBotBubble_czz0p_112",QC="_rateFeedbackGuestBubble_czz0p_118",KC="_avatar_czz0p_124",YC="_fadeInLeft_czz0p_1",ZC="_bubble_czz0p_85",JC="_appear_czz0p_1",e2="_botBubble_czz0p_150",t2="_guestBubble_czz0p_160",r2="_rateText_czz0p_176",n2="_stars_czz0p_181",i2="_starsSmall_czz0p_194",o2="_starsLarge_czz0p_198",s2="_star_czz0p_181",a2="_starReadonly_czz0p_215",l2="_starIcon_czz0p_223",u2="_starsDescriptionContainer_czz0p_241",c2="_starsDescription_czz0p_241",mt={callToActionContainer:UC,"append-animate":"_append-animate_czz0p_1",callToActionTitle:HC,rateOverlay:GC,body:$C,footer:qC,actions:VC,bubbles:WC,rateFeedbackBotBubble:XC,rateFeedbackGuestBubble:QC,avatar:KC,fadeInLeft:YC,bubble:ZC,appear:JC,botBubble:e2,guestBubble:t2,rateText:r2,stars:n2,starsSmall:i2,starsLarge:o2,star:s2,starReadonly:a2,starIcon:l2,starsDescriptionContainer:u2,starsDescription:c2},f2=({value:e,index:n,count:i,readonly:s,onHover:l,onClick:u})=>{const d=h=>{u&&h.key==="Enter"&&u()};return R.jsx("li",{className:q(mt.star,{[mt.starReadonly]:s},"chat__conversationRating__star"),children:R.jsx("div",{role:"radio","aria-checked":e>n?"true":"false","aria-posinset":n+1,"aria-setsize":i,tabIndex:0,onMouseOver:l,onKeyDown:d,onClick:u,children:R.jsx("span",{role:"img","aria-label":"Star",className:q(mt.starIcon),children:R.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:R.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"})})})})})},fg=5,Cv=({value:e,size:n,readonly:i=!1,onChange:s})=>{const[l,u]=U.useState(void 0),d=()=>{u(void 0)},h=E=>()=>{if(!i){const y=E+1;u(y)}},p=E=>()=>{s&&!i&&(s(E===0&&e===1?0:E+1),u(void 0))};return R.jsx("ul",{tabIndex:0,role:"radiogroup",className:q(mt.stars,{[mt.starsSmall]:n==="small",[mt.starsLarge]:n==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:n==="small",chat__conversationRating__stars__large:n==="large"}),onMouseOut:d,children:Array(fg).fill(0).map((E,y)=>R.jsx(f2,{value:l===void 0?e:l,index:y,count:fg,readonly:i,onHover:h(y),onClick:p(y)},y))})},d2=({visible:e,onRate:n})=>{const i=$t();return e?R.jsxs("div",{className:q(mt.callToActionContainer,"chat__conversationRating__callToAction"),children:[R.jsx("div",{className:q(mt.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),R.jsx(Cv,{value:0,size:"small",onChange:n})]}):null},dg=({isFirstMessageBySender:e,isLastMessageBySender:n,children:i})=>R.jsxs("div",{className:q(pe.message,pe.messageBot,e&&pe.messageBotFirst,n&&pe.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",e&&"chat__bubbleContainer--first",n&&"chat__bubbleContainer--last"),children:[R.jsx("img",{className:q(pe.avatar,pe.botAvatar),src:"bot.svg",alt:"Bot"}),R.jsx("div",{className:q(pe.bubble,pe.bubbleLeft,"chat__bubble","chat__botBubble"),children:R.jsx("div",{className:q(pe.leftText,pe.bubbleContent),children:i})})]}),h2=({children:e})=>R.jsx("div",{className:q(pe.message,pe.messageGuest,pe.messageGuestFirst,pe.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:R.jsx("div",{className:q(pe.bubble,pe.bubbleRight,"chat__bubble","chat__guestBubble"),children:R.jsx("div",{className:q(pe.rightText,pe.bubbleContent),children:e})})}),p2=({visible:e,rating:n,onRate:i,onClose:s})=>{const l=$t(),[u,d]=U.useState(n),[h,p]=U.useState(void 0),[E,y]=U.useState(void 0),[w,m]=U.useState({submitted:!1,feedback:""}),[_,v]=U.useState(!1),k=U.useRef(null);U.useEffect(()=>{e?(m({submitted:!1,feedback:""}),y(e)):E===!0&&y(!1)},[e,E]),U.useEffect(()=>{d(n)},[n]),U.useEffect(()=>{const N=l(`conversation-rating.overlay.bot-message.rate-feedback.value-${u}`);p(N!=null&&N.length?N:void 0)},[u,l]),U.useEffect(()=>{w.submitted?setTimeout(()=>v(!0),w.feedback.length?500:0):v(!1)},[w]);const x=N=>{var S,T;N.preventDefault();const O=((T=(S=k.current)==null?void 0:S.value)==null?void 0:T.trim())||"";i(u,O),m({submitted:!0,feedback:O})};return R.jsx("div",{className:q(mt.rateOverlay,Tr.bottomSheet,"chat__conversationRating__overlay",{[Tr.bottomSheetOpen]:E===!0,[Tr.bottomSheetClose]:E===!1}),children:R.jsxs("form",{onSubmit:x,children:[R.jsxs("div",{className:q(mt.body,"chat__conversationRating__overlay__body"),children:[R.jsxs("div",{children:[R.jsx("h2",{children:l("conversation-rating.overlay.title")}),R.jsxs("div",{className:q(mt.starsDescriptionContainer),children:[R.jsx(Cv,{value:u,size:"large",readonly:w.submitted,onChange:d}),R.jsxs("div",{className:q(mt.starsDescription),children:[R.jsx("div",{children:l("conversation-rating.overlay.star.very-bad")}),R.jsx("div",{children:l("conversation-rating.overlay.star.very-good")})]})]})]}),R.jsx("div",{className:q(mt.bubbles),children:e&&h&&R.jsxs(R.Fragment,{children:[R.jsx(dg,{isFirstMessageBySender:!0,isLastMessageBySender:!_||!!w.feedback.length,children:R.jsx("div",{children:h})}),!!w.feedback.length&&R.jsx(h2,{children:w.feedback}),_&&R.jsx(dg,{isFirstMessageBySender:!!w.feedback.length,isLastMessageBySender:!0,children:R.jsx("div",{children:l("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),R.jsxs("div",{className:q(mt.footer,"chat__conversationRating__overlay__footer"),children:[!w.submitted&&R.jsx("input",{ref:k,placeholder:l("conversation-rating.overlay.guest-feedback.input-placeholder")}),R.jsx("div",{className:q(mt.actions,"chat__conversationRating__overlay__footer__actions"),children:w.submitted?R.jsx("button",{type:"button",className:q(it.button,it.buttonPrimary),onClick:s,children:l("conversation-rating.overlay.action.close")}):R.jsx("button",{type:"submit",className:q(it.button,it.buttonPrimary),children:l("conversation-rating.overlay.action.submit")})})]})]})})},m2=({conversationRating:{enabled:e,rating:n},numberOfMessagesFromGuest:i,showRatingOverlay:s,setShowRatingOverlay:l,onRate:u})=>{const[d,h]=U.useState(0),p=w=>{h(w),l(!0)},E=()=>l(!1),y=!n&&i>=1;return e?R.jsxs(R.Fragment,{children:[R.jsx(d2,{visible:y,onRate:p}),R.jsx(p2,{visible:s,rating:d,onRate:u,onClose:E})]}):null},g2="_inputWrapper_1o8hf_5",y2="_messageInputWrapper_1o8hf_14",v2="_messageInput_1o8hf_14",_2="_buttons_1o8hf_36",E2="_button_1o8hf_36",Qn={inputWrapper:g2,messageInputWrapper:y2,messageInput:v2,buttons:_2,button:E2},S2="_audioRecorder_xps9k_5",b2="_recordButton_xps9k_10",w2="_submitButton_xps9k_37",x2="_cancelButton_xps9k_64",T2="_recorderIcon_xps9k_91",C2="_pulse_xps9k_1",k2="_spinning_xps9k_113",R2="_spin_xps9k_113",mn={audioRecorder:S2,recordButton:b2,submitButton:w2,cancelButton:x2,recorderIcon:T2,pulse:C2,spinning:k2,spin:R2},hg=2048,Zs=16e3;class O2 extends wr.Component{constructor(i){super(i);we(this,"audioInput",null);we(this,"volume",null);we(this,"leftchannel",[]);we(this,"recorder",null);we(this,"recordingLength",0);we(this,"sampleRate",null);we(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 s=window.AudioContext||window.webkitAudioContext,l=new s;this.sampleRate=l.sampleRate,this.volume=l.createGain(),this.audioInput=l.createMediaStreamSource(i),this.audioInput.connect(this.volume),this.recorder=l.createScriptProcessor(hg,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(l.destination)}processRecordingInput(i){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const s=i.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(s)),this.recordingLength+=hg}}handleClickSubmitAudio(){const i=A2(this.leftchannel,this.recordingLength),s=I2(i,this.sampleRate||0),l=N2(s);this.props.onAudioRecorded(l),this.handleClickStopAudio()}handleClickStopAudio(){var i,s,l,u;this.setState({recordingState:"none"}),(i=this.audioInput)==null||i.disconnect(),(s=this.volume)==null||s.disconnect(),(l=this.recorder)==null||l.disconnect(),this.mediaStream&&((u=this.mediaStream)==null||u.getAudioTracks().forEach(d=>{d.stop()}))}render(){return R.jsxs("div",{className:mn.audioRecorder,children:[this.state.recordingState==="none"&&R.jsx("button",{className:q(mn.recordButton,"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:R.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.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"}),R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&R.jsxs("svg",{className:mn.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.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"}),R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&R.jsxs("div",{className:mn.audioRecorder,children:[R.jsx("button",{className:q(mn.cancelButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:R.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.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"}),R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),R.jsx("div",{className:mn.recorderIcon}),R.jsx("button",{className:q(mn.submitButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:R.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),R.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const N2=e=>{const n=new ArrayBuffer(44+e.length*2),i=new DataView(n);Fs(i,0,"RIFF"),i.setUint32(4,44+e.length*2,!0),Fs(i,8,"WAVE"),Fs(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,Zs,!0),i.setUint32(28,Zs*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),Fs(i,36,"data"),i.setUint32(40,e.length*2,!0);const s=e.length;let l=44;const u=1;for(let d=0;d<s;d++)i.setInt16(l,e[d]*(32767*u),!0),l+=2;return new Blob([i],{type:"audio/wav"})},Fs=(e,n,i)=>{for(let s=0;s<i.length;s++)e.setUint8(n+s,i.charCodeAt(s))},A2=(e,n)=>{const i=new Float32Array(n);let s=0;const l=e.length;for(let u=0;u<l;u++){const d=e[u];i.set(d,s),s+=d.length}return i},I2=(e,n)=>{if(Zs===n)return e;const i=n/Zs,s=Math.round(e.length/i),l=new Float32Array(s);let u=0,d=0;for(;u<l.length;){const h=Math.round((u+1)*i);let p=0,E=0;for(let y=d;y<h&&y<e.length;y++)p+=e[y],E++;l[u]=p/E,u++,d=h}return l},P2=({speechSupport:e,transcriptExportEnabled:n,disabled:i,onTextInput:s,onAudioRecorded:l,onOpenTranscriptExportModal:u})=>{const d=$t(),[h,p]=U.useState(!1),E=U.useRef(null),y=()=>{const v=E.current;v&&v.value.trim().length>=1&&s(v.value.trim())&&(v.value="",v.style.height="",p(!1),v.focus())},w=v=>{v.preventDefault(),y()},m=v=>{const k=v.target.value.trim();p(k.length>0),v.target.style.height="";const{scrollHeight:x}=v.target;v.target.style.height=`${x>150?150:x}px`},_=v=>{v.code==="Enter"&&!v.shiftKey&&(v.repeat||y(),v.preventDefault())};return R.jsxs("form",{className:q(Qn.inputWrapper,"chat__textInput"),onSubmit:w,children:[R.jsx("div",{className:Qn.messageInputWrapper,children:R.jsx("textarea",{id:"user_input",ref:E,className:Qn.messageInput,tabIndex:0,placeholder:d("message-input-placeholder"),onChange:m,onKeyDown:_,"aria-label":d("message-input-label")})}),R.jsxs("div",{className:q(Qn.buttons,"chat__buttons"),children:[!h&&n&&R.jsx("button",{type:"button",className:q(Qn.button,"chat__button"),"aria-label":d("message-input.actions.export-transcript.label"),"data-title":d("message-input.actions.export-transcript.label"),tabIndex:0,onClick:u,children:R.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:R.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"})})}),h||!e||navigator.mediaDevices===void 0?R.jsx("button",{className:q(Qn.button,"chat__button"),type:"submit","aria-label":d("message-input.actions.submit.label"),"data-title":d("message-input.actions.submit.label"),tabIndex:0,disabled:i,children:R.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:R.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&&R.jsx(O2,{translate:d,onAudioRecorded:l})]})]})},D2="_quickReplies_11l22_1",M2="_quickReply_11l22_9",pg={quickReplies:D2,quickReply:M2},F2=({quickReplies:e,onQuickReplyClick:n})=>e.length?R.jsx("div",{className:q(pg.quickReplies,"chat__quickReplies"),children:e.map(i=>R.jsx("button",{tabIndex:0,className:q(pg.quickReply,it.button,"chat__button","chat__quickReply"),onClick:()=>n(i),children:i.label},i.label))}):null,mg=5e3,L2=1e3,B2=({isBotTyping:e,quickReplies:n,speechSupport:i,transcriptExportEnabled:s,conversationRating:l,numberOfMessagesFromGuest:u,showRatingOverlay:d,setShowRatingOverlay:h,onTextInput:p,onRate:E,onQuickReplyClick:y,onAudioRecorded:w,onOpenTranscriptExportModal:m})=>{const[_,v]=U.useState(!1),k=U.useRef(),x=U.useRef(0);U.useEffect(()=>{if(_&&!e){const O=k.current?Date.now()-k.current:0;O>mg?v(!1):setTimeout(()=>{v(!1)},mg-O)}},[_,e]),U.useEffect(()=>{_&&(k.current=Date.now())},[_]);const N=O=>{const S=Date.now()-x.current<L2;return e||S?(v(!0),!1):(p(O),x.current=Date.now(),!0)};return R.jsxs("div",{className:q(LC.inputContainer),children:[R.jsx(F2,{quickReplies:n,onQuickReplyClick:y}),R.jsx(zC,{visible:_}),!_&&R.jsx(m2,{conversationRating:l,numberOfMessagesFromGuest:u,onRate:E,showRatingOverlay:d,setShowRatingOverlay:h}),R.jsx(P2,{onTextInput:N,onAudioRecorded:w,speechSupport:i,onOpenTranscriptExportModal:m,transcriptExportEnabled:s,disabled:_})]})},j2=({clientName:e,messages:n,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:d,conversationRating:h,showGeneralConditions:p,onMessageFromUser:E,onRate:y,onQuickReplyClick:w,onButtonClick:m,onLinkClick:_,onAudioRecorded:v,onTranscriptExport:k,onPdfExport:x,onTranscriptItemReaction:N})=>{const O=qc(),S=_n(te=>te.connection.connectionState),[T,C]=U.useState(!1),[L,H]=U.useState(!1),W=d.email||d.pdf,se=n.filter(te=>te.sender.type===ev.GUEST).length;return U.useEffect(()=>{if(S===vn.CONNECTED){const te=Xc.parse(window.location.search);O(Jy(e,te))}},[e,S,O]),R.jsxs("div",{children:[R.jsxs("div",{className:`${Pw.chatcontent} ${T||L?it.accessabilityHidden:""}`,children:[R.jsx(gC,{messages:n,isBotTyping:s,showGeneralConditions:p,onButtonClick:m,onLinkClick:_,onTranscriptItemReaction:N}),R.jsx(B2,{isBotTyping:s,quickReplies:s?[]:i,numberOfMessagesFromGuest:se,speechSupport:u,transcriptExportEnabled:W,conversationRating:T?{enabled:!1}:h,showRatingOverlay:L,setShowRatingOverlay:H,onRate:y,onQuickReplyClick:w,onTextInput:E,onAudioRecorded:v,onOpenTranscriptExportModal:()=>C(!T)}),R.jsx(kC,{})]}),W&&R.jsx(MC,{methods:d,visible:T,onEmailExport:k,onPdfExport:x,onClose:()=>C(!1)}),R.jsx(wC,{contentUrl:l})]})},z2=e=>{const{messages:n,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:d,conversationRating:h,showGeneralConditions:p}=e.chat;return{messages:n,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:d,conversationRating:h,showGeneralConditions:p}},U2=e=>({onRestartChat:(n,i)=>e(pf(n,i)),onMessageFromUser:n=>e(Py(n)),onRate:(n,i)=>e(Sb(n,i)),onAudioRecorded:n=>e(hb(n)),onActionFromUser:n=>e(n),onQuickReplyClick:n=>e(Iy(n)),onNluEvent:n=>e(Fy(n)),onButtonClick:n=>e(wb(n)),onLinkClick:n=>e(xb(n)),onTranscriptExport:n=>e(yb(n)),onPdfExport:()=>e(_b()),onTranscriptItemReaction:(n,i)=>e(ge.transcriptItemGuestReaction(n,i||null))}),H2=Q1(z2,U2)(j2),G2="_chatwindow_phukm_1",$2="_chatcontent_phukm_13",q2={chatwindow:G2,chatcontent:$2},V2="_container_ophni_2",W2="_body_ophni_8",X2="_intro_ophni_13",Q2="_footer_ophni_34",K2="_startChatButton_ophni_38",Y2="_formFields_ophni_42",Z2="_formField_ophni_42",J2="_radio_ophni_54",ek="_checkbox_ophni_61",tk="_input_ophni_69",rk="_inputLabel_ophni_99",nk="_selectWrapper_ophni_103",ik="_select_ophni_103",ok="_selectLabel_ophni_145",gt={container:V2,body:W2,intro:X2,footer:Q2,startChatButton:K2,formFields:Y2,formField:Z2,radio:J2,checkbox:ek,input:tk,inputLabel:rk,selectWrapper:nk,select:ik,selectLabel:ok},sk=({name:e,label:n,defaultValue:i,required:s,onChange:l})=>{const u=d=>{l(d.currentTarget.checked?"true":"false")};return R.jsxs("label",{className:q(gt.checkbox,"chat__startScreen__checkbox"),htmlFor:e,children:[R.jsx("input",{type:"checkbox",id:e,name:e,defaultChecked:i==="true",required:s,onChange:u}),R.jsx("div",{children:n})]})},ak=({type:e,name:n,label:i,defaultValue:s,placeholder:l,required:u,multiple:d,min:h,max:p,pattern:E,onChange:y})=>{const w=m=>{y(m.target.value)};return R.jsxs("label",{className:q(gt.input,"chat__startScreen__input"),htmlFor:n,children:[R.jsx("div",{className:q(gt.inputLabel),children:i}),R.jsx("input",{type:e,id:n,name:n,defaultValue:s,placeholder:l,required:u,multiple:d,min:h,max:p,pattern:E,onChange:w})]})},lk=({name:e,value:n,label:i,defaultChecked:s,required:l,onChange:u})=>{const d=`${e}-${n}`,h=p=>{u(p.target.value)};return R.jsxs("label",{className:q(gt.radio,"chat__startScreen__radio"),htmlFor:d,children:[R.jsx("input",{id:d,type:"radio",name:e,value:n,defaultChecked:s,required:l,onChange:h}),R.jsx("span",{className:q(gt.label),children:i})]})},uk=({name:e,label:n,defaultValue:i,required:s,multiple:l,options:u,onChange:d})=>{const h=p=>{d(p.target.value)};return R.jsxs("label",{className:q(gt.select,"chat__startScreen__select"),htmlFor:e,children:[R.jsx("div",{className:q(gt.selectLabel),children:n}),R.jsx("div",{className:q(gt.selectWrapper),children:R.jsx("select",{id:e,name:e,defaultValue:i,required:s,multiple:l,onChange:h,children:Object.entries(u||{}).map(([p,E])=>R.jsx("option",{value:p,selected:E===i,children:E}))})})]})},ck="start-screen.intro",fk="start-screen.start-chat",er="start-screen.form",gg=`${er}.fields`,dk=()=>{const e=$t(),n=qc(),[i,s]=U.useState({}),l=()=>{const y=Object.entries(i).reduce((w,[m,_])=>({...w,[m]:_.value}),{});n(fw(y))},u=e(ck),d=e(fk),h=U.useMemo(()=>{var y;return((y=e(gg))==null?void 0:y.split(";").map(w=>w.trim()))??[]},[e(gg)]);U.useEffect(()=>{s(h.reduce((y,w)=>({...y,[w]:pk(w,e)}),{}))},[e,h]);const p=y=>{y.preventDefault(),l()},E=y=>w=>{s(m=>({...m,[y]:{...m[y],value:w}}))};return R.jsxs("form",{onSubmit:p,className:q(gt.container,"chat__startScreen"),children:[R.jsxs("div",{className:q(gt.body,"chat__startScreen__body"),children:[u&&R.jsx("div",{className:q(gt.intro,"chat__startScreen__intro"),children:R.jsx(Kr,{options:{overrides:{a:hk}},children:u})}),R.jsx("div",{className:q(gt.formFields,"chat__startScreen__fields"),children:Object.values(i).map(({type:y,name:w,label:m,placeholder:_,defaultValue:v,options:k,required:x,multiple:N,min:O,max:S,pattern:T})=>R.jsx("div",{className:q(gt.formField,"chat__startScreen__field"),children:(()=>{switch(y){case"radio":return R.jsxs(R.Fragment,{children:[R.jsx("div",{children:m}),Object.entries(k||{}).map(([C,L])=>R.jsx(lk,{name:w,value:C,label:L,defaultChecked:C===v,required:x,onChange:E(w)}))]});case"checkbox":return R.jsx(sk,{name:w,label:m,defaultValue:v,required:x,onChange:E(w)});case"select":return R.jsx(uk,{name:w,label:m,defaultValue:v,required:x,multiple:N,options:k,onChange:E(w)});default:return R.jsx(ak,{type:y,name:w,label:m,placeholder:_,defaultValue:v,required:x,multiple:N,min:O,max:S,pattern:T,onChange:E(w)})}})()},w))})]}),R.jsx("div",{className:q(gt.footer,"chat__startScreen__footer"),children:R.jsx("button",{type:"submit",className:q(it.button,it.buttonPrimary,gt.startChatButton),children:d})})]})},hk=({title:e,href:n,children:i})=>R.jsx("a",{href:n,title:e,target:"_blank",rel:"noopener noreferrer",children:i}),pk=(e,n)=>{const i=n(`${er}.${e}.type`)||"text",s=n(`${er}.${e}.required`)==="true",l=n(`${er}.${e}.multiple`)==="true",u=n(`${er}.${e}.placeholder`),d=n(`${er}.${e}.label`)||"",h=n(`${er}.${e}.defaultValue`),p=n(`${er}.${e}.min`),E=n(`${er}.${e}.max`),y=n(`${er}.${e}.pattern`),w=gk(n(`${er}.${e}.options`));return{name:e,label:d,placeholder:u,value:mk(i,h,w)||"",defaultValue:h,options:w,type:i,required:s,multiple:l,min:p,max:E,pattern:y}},mk=(e,n,i)=>n||e==="select"&&Object.keys(i)[0]||"",gk=(e="")=>e.split(";").map(n=>n.trim()).reduce((n,i)=>{const[s,l]=i.split(":").map(u=>u.trim());return{...n,[s]:l}},{}),yk=()=>{const e=ra();U.useEffect(()=>{window.document.documentElement.lang=e.locale},[e.locale])},Kn={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"},vk=({clientName:e})=>{yk();const n=qc(),i=_n(y=>y.intl.messages),s=$t(),l=_n(y=>y.startScreen.useStartScreen),u=_n(y=>y.startScreen.startScreenStatus),[d,h]=U.useState(void 0);U.useEffect(()=>{const y=Xc.parse(window.location.search);y.cssClassName&&h(y.cssClassName);const w=m=>{switch(m.data.type){case Kn.TRIGGER_ACTION:n(m.data.action);break;case Kn.TRIGGER_STORY:n(Fy(m.data.story));break;case Kn.ON_CHAT_WINDOW_OPEN:n({type:"webclient.chatwindow.opened"});break;case Kn.ON_CHAT_WINDOW_CLOSE:n({type:"webclient.chatwindow.closed"});break;case Kn.CHAT_MESSAGE_FROM_GUEST:n(Py(m.data.text));break;case Kn.RESTART_CHAT:n(pf(e,y));break}};return n(Ew(e,y)),window.addEventListener("message",m=>w(m),!1),()=>window.removeEventListener("message",w)},[e,n]),U.useEffect(()=>{const y=s("header.restart-chat"),w=s("header.close-chat");n(Tb({header:{restartChat:y,closeChat:w}}))},[i,n,s]);const p=l===void 0,E=l===!1||u==="HIDDEN";return R.jsx("div",{className:q(q2.chatwindow,"chat__chatwindow",d),children:p?null:E?R.jsx(H2,{clientName:e}):R.jsx(dk,{})})},_k=()=>{const e=by(),n=_n(s=>s.intl.locale),i=_n(s=>s.intl.messages);return R.jsx(kS,{locale:n,messages:i,children:R.jsx("div",{className:OS.app,children:R.jsx(vk,{clientName:e})})})};var Hu,yg;function yf(){if(yg)return Hu;yg=1;function e(n){var i=typeof n;return n!=null&&(i=="object"||i=="function")}return Hu=e,Hu}var Gu,vg;function Ek(){if(vg)return Gu;vg=1;var e=typeof ds=="object"&&ds&&ds.Object===Object&&ds;return Gu=e,Gu}var $u,_g;function kv(){if(_g)return $u;_g=1;var e=Ek(),n=typeof self=="object"&&self&&self.Object===Object&&self,i=e||n||Function("return this")();return $u=i,$u}var qu,Eg;function Sk(){if(Eg)return qu;Eg=1;var e=kv(),n=function(){return e.Date.now()};return qu=n,qu}var Vu,Sg;function bk(){if(Sg)return Vu;Sg=1;var e=/\s/;function n(i){for(var s=i.length;s--&&e.test(i.charAt(s)););return s}return Vu=n,Vu}var Wu,bg;function wk(){if(bg)return Wu;bg=1;var e=bk(),n=/^\s+/;function i(s){return s&&s.slice(0,e(s)+1).replace(n,"")}return Wu=i,Wu}var Xu,wg;function Rv(){if(wg)return Xu;wg=1;var e=kv(),n=e.Symbol;return Xu=n,Xu}var Qu,xg;function xk(){if(xg)return Qu;xg=1;var e=Rv(),n=Object.prototype,i=n.hasOwnProperty,s=n.toString,l=e?e.toStringTag:void 0;function u(d){var h=i.call(d,l),p=d[l];try{d[l]=void 0;var E=!0}catch{}var y=s.call(d);return E&&(h?d[l]=p:delete d[l]),y}return Qu=u,Qu}var Ku,Tg;function Tk(){if(Tg)return Ku;Tg=1;var e=Object.prototype,n=e.toString;function i(s){return n.call(s)}return Ku=i,Ku}var Yu,Cg;function Ck(){if(Cg)return Yu;Cg=1;var e=Rv(),n=xk(),i=Tk(),s="[object Null]",l="[object Undefined]",u=e?e.toStringTag:void 0;function d(h){return h==null?h===void 0?l:s:u&&u in Object(h)?n(h):i(h)}return Yu=d,Yu}var Zu,kg;function kk(){if(kg)return Zu;kg=1;function e(n){return n!=null&&typeof n=="object"}return Zu=e,Zu}var Ju,Rg;function Rk(){if(Rg)return Ju;Rg=1;var e=Ck(),n=kk(),i="[object Symbol]";function s(l){return typeof l=="symbol"||n(l)&&e(l)==i}return Ju=s,Ju}var ec,Og;function Ok(){if(Og)return ec;Og=1;var e=wk(),n=yf(),i=Rk(),s=NaN,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,d=/^0o[0-7]+$/i,h=parseInt;function p(E){if(typeof E=="number")return E;if(i(E))return s;if(n(E)){var y=typeof E.valueOf=="function"?E.valueOf():E;E=n(y)?y+"":y}if(typeof E!="string")return E===0?E:+E;E=e(E);var w=u.test(E);return w||d.test(E)?h(E.slice(2),w?2:8):l.test(E)?s:+E}return ec=p,ec}var tc,Ng;function Nk(){if(Ng)return tc;Ng=1;var e=yf(),n=Sk(),i=Ok(),s="Expected a function",l=Math.max,u=Math.min;function d(h,p,E){var y,w,m,_,v,k,x=0,N=!1,O=!1,S=!0;if(typeof h!="function")throw new TypeError(s);p=i(p)||0,e(E)&&(N=!!E.leading,O="maxWait"in E,m=O?l(i(E.maxWait)||0,p):m,S="trailing"in E?!!E.trailing:S);function T(ae){var Fe=y,Ie=w;return y=w=void 0,x=ae,_=h.apply(Ie,Fe),_}function C(ae){return x=ae,v=setTimeout(W,p),N?T(ae):_}function L(ae){var Fe=ae-k,Ie=ae-x,$e=p-Fe;return O?u($e,m-Ie):$e}function H(ae){var Fe=ae-k,Ie=ae-x;return k===void 0||Fe>=p||Fe<0||O&&Ie>=m}function W(){var ae=n();if(H(ae))return se(ae);v=setTimeout(W,L(ae))}function se(ae){return v=void 0,S&&y?T(ae):(y=w=void 0,_)}function te(){v!==void 0&&clearTimeout(v),x=0,y=k=w=v=void 0}function fe(){return v===void 0?_:se(n())}function de(){var ae=n(),Fe=H(ae);if(y=arguments,w=this,k=ae,Fe){if(v===void 0)return C(k);if(O)return clearTimeout(v),v=setTimeout(W,p),T(k)}return v===void 0&&(v=setTimeout(W,p)),_}return de.cancel=te,de.flush=fe,de}return tc=d,tc}var rc,Ag;function Ak(){if(Ag)return rc;Ag=1;var e=Nk(),n=yf(),i="Expected a function";function s(l,u,d){var h=!0,p=!0;if(typeof l!="function")throw new TypeError(i);return n(d)&&(h="leading"in d?!!d.leading:h,p="trailing"in d?!!d.trailing:p),e(l,u,{leading:h,maxWait:u,trailing:p})}return rc=s,rc}var Ik=Ak();const Pk=Js(Ik);var nc,Ig;function Dk(){if(Ig)return nc;Ig=1;function e(_,v){var k,x;if(typeof v=="function")x=v(_),x!==void 0&&(_=x);else if(Array.isArray(v))for(k=0;k<v.length;k++)x=v[k](_),x!==void 0&&(_=x);return _}function n(_,v){return _[0]==="-"&&Array.isArray(v)&&/^-\d+$/.test(_)?v.length+parseInt(_,10):_}function i(_){return/^\d+$/.test(_)}function s(_){return Object.prototype.toString.call(_)==="[object Object]"}function l(_){return Object(_)===_}function u(_){return Object.keys(_).length===0}var d=["__proto__","prototype","constructor"],h=function(_){return d.indexOf(_)===-1};function p(_,v){_.indexOf("[")>=0&&(_=_.replace(/\[/g,v).replace(/]/g,""));var k=_.split(v),x=k.filter(h);if(x.length!==k.length)throw Error("Refusing to update blacklisted property "+_);return k}var E=Object.prototype.hasOwnProperty;function y(_,v,k,x){if(!(this instanceof y))return new y(_,v,k,x);typeof v>"u"&&(v=!1),typeof k>"u"&&(k=!0),typeof x>"u"&&(x=!0),this.separator=_||".",this.override=v,this.useArray=k,this.useBrackets=x,this.keepArray=!1,this.cleanup=[]}var w=new y(".",!1,!0,!0);function m(_){return function(){return w[_].apply(w,arguments)}}return y.prototype._fill=function(_,v,k,x){var N=_.shift();if(_.length>0){if(v[N]=v[N]||(this.useArray&&i(_[0])?[]:{}),!l(v[N]))if(this.override)v[N]={};else{if(!(l(k)&&u(k)))throw new Error("Trying to redefine `"+N+"` which is a "+typeof v[N]);return}this._fill(_,v[N],k,x)}else{if(!this.override&&l(v[N])&&!u(v[N])){if(!(l(k)&&u(k)))throw new Error("Trying to redefine non-empty obj['"+N+"']");return}v[N]=e(k,x)}},y.prototype.object=function(_,v){var k=this;return Object.keys(_).forEach(function(x){var N=v===void 0?null:v[x],O=p(x,k.separator).join(k.separator);O.indexOf(k.separator)!==-1?(k._fill(O.split(k.separator),_,_[x],N),delete _[x]):_[x]=e(_[x],N)}),_},y.prototype.str=function(_,v,k,x){var N=p(_,this.separator).join(this.separator);return _.indexOf(this.separator)!==-1?this._fill(N.split(this.separator),k,v,x):k[_]=e(v,x),k},y.prototype.pick=function(_,v,k,x){var N,O,S,T,C;for(O=p(_,this.separator),N=0;N<O.length;N++)if(T=n(O[N],v),v&&typeof v=="object"&&T in v){if(N===O.length-1)return k?(S=v[T],x&&Array.isArray(v)?v.splice(T,1):delete v[T],Array.isArray(v)&&(C=O.slice(0,-1).join("."),this.cleanup.indexOf(C)===-1&&this.cleanup.push(C)),S):v[T];v=v[T]}else return;return k&&Array.isArray(v)&&(v=v.filter(function(L){return L!==void 0})),v},y.prototype.delete=function(_,v){return this.remove(_,v,!0)},y.prototype.remove=function(_,v,k){var x;if(this.cleanup=[],Array.isArray(_)){for(x=0;x<_.length;x++)this.pick(_[x],v,!0,k);return k||this._cleanup(v),v}else return this.pick(_,v,!0,k)},y.prototype._cleanup=function(_){var v,k,x,N;if(this.cleanup.length){for(k=0;k<this.cleanup.length;k++)x=this.cleanup[k].split("."),N=x.splice(0,-1).join("."),v=N?this.pick(N,_):_,v=v[x[0]].filter(function(O){return O!==void 0}),this.set(this.cleanup[k],v,_);this.cleanup=[]}},y.prototype.del=y.prototype.remove,y.prototype.move=function(_,v,k,x,N){return typeof x=="function"||Array.isArray(x)?this.set(v,e(this.pick(_,k,!0),x),k,N):(N=x,this.set(v,this.pick(_,k,!0),k,N)),k},y.prototype.transfer=function(_,v,k,x,N,O){return typeof N=="function"||Array.isArray(N)?this.set(v,e(this.pick(_,k,!0),N),x,O):(O=N,this.set(v,this.pick(_,k,!0),x,O)),x},y.prototype.copy=function(_,v,k,x,N,O){return typeof N=="function"||Array.isArray(N)?this.set(v,e(JSON.parse(JSON.stringify(this.pick(_,k,!1))),N),x,O):(O=N,this.set(v,this.pick(_,k,!1),x,O)),x},y.prototype.set=function(_,v,k,x){var N,O,S,T;if(typeof v>"u")return k;for(S=p(_,this.separator),N=0;N<S.length;N++){if(T=S[N],N===S.length-1)if(x&&s(v)&&s(k[T]))for(O in v)E.call(v,O)&&(k[T][O]=v[O]);else if(x&&Array.isArray(k[T])&&Array.isArray(v))for(var C=0;C<v.length;C++)k[S[N]].push(v[C]);else k[T]=v;else(!E.call(k,T)||!s(k[T])&&!Array.isArray(k[T]))&&(/^\d+$/.test(S[N+1])?k[T]=[]:k[T]={});k=k[T]}return k},y.prototype.transform=function(_,v,k){return v=v||{},k=k||{},Object.keys(_).forEach((function(x){this.set(_[x],this.pick(x,v),k)}).bind(this)),k},y.prototype.dot=function(_,v,k){v=v||{},k=k||[];var x=Array.isArray(_);return Object.keys(_).forEach((function(N){var O=x&&this.useBrackets?"["+N+"]":N;if(l(_[N])&&(s(_[N])&&!u(_[N])||Array.isArray(_[N])&&!this.keepArray&&_[N].length!==0))if(x&&this.useBrackets){var S=k[k.length-1]||"";return this.dot(_[N],v,k.slice(0,-1).concat(S+O))}else return this.dot(_[N],v,k.concat(O));else x&&this.useBrackets?v[k.join(this.separator).concat("["+N+"]")]=_[N]:v[k.concat(O).join(this.separator)]=_[N]}).bind(this)),v},y.pick=m("pick"),y.move=m("move"),y.transfer=m("transfer"),y.transform=m("transform"),y.copy=m("copy"),y.object=m("object"),y.str=m("str"),y.set=m("set"),y.delete=m("delete"),y.del=y.remove=m("remove"),y.dot=m("dot"),["override","overwrite"].forEach(function(_){Object.defineProperty(y,_,{get:function(){return w.override},set:function(v){w.override=!!v}})}),["useArray","keepArray","useBrackets"].forEach(function(_){Object.defineProperty(y,_,{get:function(){return w[_]},set:function(v){w[_]=v}})}),y._process=e,nc=y,nc}var Mk=Dk();const Ov={"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","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:
97
+ `).map((l,u)=>R.jsxs("span",{className:KT.text,children:[R.jsx(XT,{componentDecorator:s,children:l}),R.jsx("br",{})]},u))})},YT=({subtitle:e,onLinkClick:n})=>e?R.jsx("div",{className:xt.subtitle,children:R.jsx(xv,{text:e,onLinkClick:n})}):null,ug="newtab#",Tv=({markdown:e,onLinkClick:n})=>{const i=l=>u=>(u.preventDefault(),l&&n(l),!1),s=({title:l,href:u,children:d})=>u.indexOf(ug)===0?R.jsx("a",{href:u.slice(ug.length),title:l,target:"_blank",rel:"noopener noreferrer",children:d}):R.jsx("a",{onClick:i(u),title:l,href:u,children:d});return R.jsx(Kr,{options:{overrides:{a:s}},children:e})},ZT=({text:e,onLinkClick:n})=>e?R.jsx("div",{children:R.jsx(Tv,{markdown:e,onLinkClick:n})}):null,JT=({title:e})=>e?R.jsx("h1",{className:xt.title,children:e}):null,eC=({title:e,text:n,subtitle:i,buttons:s,onButtonClick:l,onLinkClick:u})=>(e==null?void 0:e.length)||(n==null?void 0:n.length)||(i==null?void 0:i.length)||(s==null?void 0:s.length)?R.jsxs("div",{className:q(pe.bubbleContent),children:[R.jsx(JT,{title:e}),R.jsx(ZT,{text:n,onLinkClick:u}),R.jsx(YT,{subtitle:i,onLinkClick:u}),R.jsx(PT,{buttons:s,onButtonClick:l})]}):null,tC=({alt:e,imageUrl:n,itemUrl:i,hasBody:s})=>n?i?i.indexOf("youtube.com")>-1?R.jsx("div",{className:xt.video_container,children:R.jsx("iframe",{className:q(xt.video,{[xt.only]:!s}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):R.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:R.jsx("div",{className:xt.imageContainer,children:R.jsx("img",{className:q(xt.image,{[xt.only]:!s}),src:n,alt:e})})}):R.jsx("div",{className:xt.imageContainer,children:R.jsx("img",{className:q(xt.image,{[xt.only]:!s}),src:n,alt:e})}):null,rC=({title:e,text:n,subtitle:i,imageUrl:s,itemUrl:l,buttons:u,onButtonClick:d,onLinkClick:h})=>{const p=!!(e!=null&&e.length)||!!(n!=null&&n.length)||!!(i!=null&&i.length)||!!(u!=null&&u.length);return R.jsxs("div",{className:q(xt.detailMessage),children:[R.jsx(tC,{hasBody:p,imageUrl:s,itemUrl:l,alt:e||i}),p&&R.jsx(eC,{title:e,text:n,subtitle:i,buttons:u,onLinkClick:h,onButtonClick:d})]})},nC=U.forwardRef(({isFirstMessageBySender:e,isLastMessageBySender:n,children:i},s)=>{const l=$t();return R.jsx("li",{ref:s,className:q(pe.message,pe.messageGuest,e&&pe.messageGuestFirst,n&&pe.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",e&&"chat__bubbleContainer--first",n&&"chat__bubbleContainer--last"),children:R.jsx("div",{className:q(pe.bubble,pe.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":l("guest-bubble.label"),children:R.jsx("div",{className:q(pe.rightText),children:i})})})}),iC=({markdown:e,className:n,onLinkClick:i})=>R.jsx("div",{className:q(pe.bubbleContent,n),children:R.jsx(Tv,{markdown:e,onLinkClick:i})}),oC=({text:e,onLinkClick:n})=>R.jsx("div",{className:pe.bubbleContent,children:R.jsx(xv,{text:e,onLinkClick:n})}),sC=U.forwardRef(({message:e,isLastMessage:n,isFirstMessageBySender:i,isLastMessageBySender:s,onReaction:l,onButtonClick:u,onLinkClick:d},h)=>{const p=aC(e,u,d);switch(e.sender.type){case ge.UserType.GUEST:return R.jsx(nC,{ref:h,isFirstMessageBySender:i,isLastMessageBySender:s,children:p});default:{const E=y=>l(e._id,y);return R.jsx(wv,{ref:h,message:e,isAnimated:!1,isLastMessage:n,isFirstMessageBySender:i,isLastMessageBySender:s,onReaction:E,children:p})}}}),aC=(e,n,i)=>{switch(e.type){case ge.MessageTypeEnum.TEXT:{const s=e;return R.jsx(oC,{text:s.text,onLinkClick:i})}case ge.MessageTypeEnum.DETAIL:{const s=e;return R.jsx(rC,{title:s.title,text:s.text,subtitle:s.subtitle,imageUrl:s.imageUrl,itemUrl:s.itemUrl,buttons:s.buttons,onButtonClick:n,onLinkClick:i})}case ge.MessageTypeEnum.MARKDOWN:{const s=e;return R.jsx(iC,{markdown:s.markdown,className:s.className,onLinkClick:i})}}},lC=(e,n)=>e.message._id===n.message._id&&e.message.reaction===n.message.reaction&&e.isLastMessage===n.isLastMessage&&e.isFirstMessageBySender===n.isFirstMessageBySender&&e.isLastMessageBySender===n.isLastMessageBySender,uC=wr.memo(sC,lC),cC="_ticontainer_wftg7_1",fC="_tiblock_wftg7_5",dC="_tidot_wftg7_12",hC="_mercuryTypingAnimation_wftg7_1",Xi={ticontainer:cC,tiblock:fC,tidot:dC,mercuryTypingAnimation:hC},pC=({isTyping:e=!1})=>R.jsx("div",{className:Xi.ticontainer,children:R.jsx("div",{className:Xi.tiblock,children:e?R.jsxs(R.Fragment,{children:[R.jsx("div",{className:q(Xi.tidot,"chat__typingIndicator")}),R.jsx("div",{className:q(Xi.tidot,"chat__typingIndicator")}),R.jsx("div",{className:q(Xi.tidot,"chat__typingIndicator")})]}):null})}),mC=Object.assign({_id:"typing-indicator"},new ge.TextMessage("",new ge.BotUser)),gC=({messages:e,isBotTyping:n,showGeneralConditions:i,onTranscriptItemReaction:s,onButtonClick:l,onLinkClick:u})=>{const d=U.useRef(0),h=U.useRef(!0),p=U.useRef(null),E=U.useRef(null),y=U.useRef(null);U.useLayoutEffect(()=>{if(e.length&&p.current&&(d.current<e.length||n)){if(E.current){const _=E.current.offsetTop;p.current.scrollTop=_}else if(y.current){const _=y.current.offsetTop;p.current.scrollTop=_}h.current&&(h.current=!1),d.current=e.length}},[e,h,n]);let w;const m=e.length;return R.jsxs("div",{ref:p,className:q(jm.messageContainer,"chat__messageContainer"),style:{scrollBehavior:e.length&&h.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[i&&R.jsx(eT,{}),R.jsxs("ul",{className:jm.messages,children:[e.map((_,v)=>{const k=yC(_,w),x=vC(_,v,e,n);w=_.sender.type;const N=v+1===m;return R.jsx(uC,{ref:N?y:null,message:_,isLastMessage:N,isFirstMessageBySender:k,isLastMessageBySender:x,onButtonClick:l,onLinkClick:u,onReaction:s},N&&!n?"last":_._id)}),n&&R.jsx(wv,{ref:E,message:mC,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:w!==ge.UserType.BOT,isLastMessageBySender:!0,children:R.jsx(pC,{isTyping:!0})},"last")]})]})},yC=(e,n)=>!n||n!==e.sender.type,vC=(e,n,i,s)=>{var h;const l=e.sender.type,u=i.length;return n+1===u?!(l===ge.UserType.BOT&&s):l!==((h=i.at(n+1))==null?void 0:h.sender.type)},_C="_bottomSheet_8itd6_1",EC="_bottomSheetOpen_8itd6_15",SC="_bottomSheetClose_8itd6_20",Tr={bottomSheet:_C,bottomSheetOpen:EC,"slide-in":"_slide-in_8itd6_1",bottomSheetClose:SC,"slide-out":"_slide-out_8itd6_1"},bC="_container_ooyn8_1",cg={container:bC},wC=({contentUrl:e})=>{const n=_n(u=>u.connection.sessionId),[i,s]=U.useState(!1);U.useEffect(()=>{s(u=>u||!!e)},[e]);const l=U.useMemo(()=>{if(e&&n){const u=new URL(e,document.baseURI);return u.searchParams.set("sessionId",n),u.toString()}else return},[e,n]);return R.jsx("div",{className:q(cg.container,Tr.bottomSheet,{[Tr.bottomSheetOpen]:!!e,[Tr.bottomSheetClose]:i&&!e}),children:l&&R.jsx("iframe",{title:"Drawer",src:l,className:cg.iframe})})},xC="_container_t5oqt_1",TC={container:xC},CC=({title:e,href:n,children:i})=>R.jsx("a",{href:n,title:e,target:"_blank",rel:"noopener noreferrer",children:i}),kC=()=>{const n=$t()("powered-by");return n&&n.length?R.jsx("div",{className:q(TC.container,"chat__poweredBy"),children:R.jsx(Kr,{options:{overrides:{a:CC}},children:n})}):null},RC="_container_rkqaf_1",OC="_formContainer_rkqaf_14",NC="_emailInput_rkqaf_19",AC="_description_rkqaf_48",IC="_actions_rkqaf_53",PC="_validationError_rkqaf_63",DC="_submitted_rkqaf_70",Sr={container:RC,formContainer:OC,emailInput:NC,description:AC,actions:IC,validationError:PC,submitted:DC},MC=({visible:e,methods:n,onEmailExport:i,onPdfExport:s,onClose:l})=>{const u=$t(),[d,h]=U.useState(void 0),[p,E]=U.useState(!1),[y,w]=U.useState(!1),[m,_]=U.useState(void 0),v=U.useRef(null);U.useEffect(()=>{var O;e?((O=v.current)==null||O.focus(),E(!1),w(!1),h(e)):d===!0&&h(!1)},[e,d]);const k=O=>{O.preventDefault(),m&&m.length>0&&(i(m),E(!0),setTimeout(l,3*1e3))},x=O=>{const S=O.target.value.trim(),T=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(S);_(T?S:"")},N=()=>{w(!0),s(),setTimeout(l,3*1e3)};return R.jsxs("div",{className:q(Sr.container,Tr.bottomSheet,{[Tr.bottomSheetOpen]:d===!0,[Tr.bottomSheetClose]:d===!1}),children:[n.pdf&&R.jsxs(R.Fragment,{children:[R.jsx("h2",{children:u("export-transcript.pdf.title")}),R.jsx(Kr,{className:Sr.description,children:u("export-transcript.pdf.description")||""}),R.jsxs("div",{className:Sr.actions,children:[R.jsx("button",{type:"button",className:q(it.button,it.buttonDefault),onClick:l,children:u("export-transcript.pdf.cancel")}),R.jsx("button",{className:q(it.button,it.buttonPrimary),onClick:N,disabled:y,children:u("export-transcript.pdf.download")})]})]}),n.email&&R.jsxs(R.Fragment,{children:[R.jsx("h2",{children:u("export-transcript.email.title")}),R.jsx(Kr,{className:Sr.description,children:u("export-transcript.email.description")||""}),R.jsxs("form",{onSubmit:k,className:Sr.formContainer,children:[R.jsxs("div",{children:[R.jsx("input",{disabled:p,ref:v,type:"email",placeholder:u("export-transcript.email.placeholder"),className:Sr.emailInput,onChange:x}),(m==null?void 0:m.length)===0?R.jsx("div",{className:Sr.validationError,children:u("export-transcript.email.invalid")}):null]}),R.jsxs("div",{className:Sr.actions,children:[R.jsx("button",{type:"button",className:q(it.button,it.buttonDefault),onClick:l,children:u("export-transcript.email.cancel")}),R.jsx("button",{type:"submit",disabled:p||m===void 0||m.length===0,className:q(it.button,it.buttonPrimary),children:u("export-transcript.email.send")})]})]}),p&&R.jsx("div",{className:Sr.submitted,children:u("export-transcript.email.success")})]})]})},FC="_inputContainer_1px77_1",LC={inputContainer:FC},BC="_blockUserInput_rv0dg_1",jC={blockUserInput:BC,"append-animate":"_append-animate_rv0dg_1"},zC=({visible:e})=>{const n=$t();return e?R.jsx("div",{className:q(jC.blockUserInput,"chat__blockUserInput"),children:n("block-user-input.title")}):null},UC="_callToActionContainer_czz0p_1",HC="_callToActionTitle_czz0p_24",GC="_rateOverlay_czz0p_31",$C="_body_czz0p_50",qC="_footer_czz0p_58",VC="_actions_czz0p_73",WC="_bubbles_czz0p_85",XC="_rateFeedbackBotBubble_czz0p_112",QC="_rateFeedbackGuestBubble_czz0p_118",KC="_avatar_czz0p_124",YC="_fadeInLeft_czz0p_1",ZC="_bubble_czz0p_85",JC="_appear_czz0p_1",e2="_botBubble_czz0p_150",t2="_guestBubble_czz0p_160",r2="_rateText_czz0p_176",n2="_stars_czz0p_181",i2="_starsSmall_czz0p_194",o2="_starsLarge_czz0p_198",s2="_star_czz0p_181",a2="_starReadonly_czz0p_215",l2="_starIcon_czz0p_223",u2="_starsDescriptionContainer_czz0p_241",c2="_starsDescription_czz0p_241",mt={callToActionContainer:UC,"append-animate":"_append-animate_czz0p_1",callToActionTitle:HC,rateOverlay:GC,body:$C,footer:qC,actions:VC,bubbles:WC,rateFeedbackBotBubble:XC,rateFeedbackGuestBubble:QC,avatar:KC,fadeInLeft:YC,bubble:ZC,appear:JC,botBubble:e2,guestBubble:t2,rateText:r2,stars:n2,starsSmall:i2,starsLarge:o2,star:s2,starReadonly:a2,starIcon:l2,starsDescriptionContainer:u2,starsDescription:c2},f2=({value:e,index:n,count:i,readonly:s,onHover:l,onClick:u})=>{const d=h=>{u&&h.key==="Enter"&&u()};return R.jsx("li",{className:q(mt.star,{[mt.starReadonly]:s},"chat__conversationRating__star"),children:R.jsx("div",{role:"radio","aria-checked":e>n?"true":"false","aria-posinset":n+1,"aria-setsize":i,tabIndex:0,onMouseOver:l,onKeyDown:d,onClick:u,children:R.jsx("span",{role:"img","aria-label":"Star",className:q(mt.starIcon),children:R.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:R.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"})})})})})},fg=5,Cv=({value:e,size:n,readonly:i=!1,onChange:s})=>{const[l,u]=U.useState(void 0),d=()=>{u(void 0)},h=E=>()=>{if(!i){const y=E+1;u(y)}},p=E=>()=>{s&&!i&&(s(E===0&&e===1?0:E+1),u(void 0))};return R.jsx("ul",{tabIndex:0,role:"radiogroup",className:q(mt.stars,{[mt.starsSmall]:n==="small",[mt.starsLarge]:n==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:n==="small",chat__conversationRating__stars__large:n==="large"}),onMouseOut:d,children:Array(fg).fill(0).map((E,y)=>R.jsx(f2,{value:l===void 0?e:l,index:y,count:fg,readonly:i,onHover:h(y),onClick:p(y)},y))})},d2=({visible:e,onRate:n})=>{const i=$t();return e?R.jsxs("div",{className:q(mt.callToActionContainer,"chat__conversationRating__callToAction"),children:[R.jsx("div",{className:q(mt.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),R.jsx(Cv,{value:0,size:"small",onChange:n})]}):null},dg=({isFirstMessageBySender:e,isLastMessageBySender:n,children:i})=>R.jsxs("div",{className:q(pe.message,pe.messageBot,e&&pe.messageBotFirst,n&&pe.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",e&&"chat__bubbleContainer--first",n&&"chat__bubbleContainer--last"),children:[R.jsx("img",{className:q(pe.avatar,pe.botAvatar),src:"bot.svg",alt:"Bot"}),R.jsx("div",{className:q(pe.bubble,pe.bubbleLeft,"chat__bubble","chat__botBubble"),children:R.jsx("div",{className:q(pe.leftText,pe.bubbleContent),children:i})})]}),h2=({children:e})=>R.jsx("div",{className:q(pe.message,pe.messageGuest,pe.messageGuestFirst,pe.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:R.jsx("div",{className:q(pe.bubble,pe.bubbleRight,"chat__bubble","chat__guestBubble"),children:R.jsx("div",{className:q(pe.rightText,pe.bubbleContent),children:e})})}),p2=({visible:e,rating:n,onRate:i,onClose:s})=>{const l=$t(),[u,d]=U.useState(n),[h,p]=U.useState(void 0),[E,y]=U.useState(void 0),[w,m]=U.useState({submitted:!1,feedback:""}),[_,v]=U.useState(!1),k=U.useRef(null);U.useEffect(()=>{e?(m({submitted:!1,feedback:""}),y(e)):E===!0&&y(!1)},[e,E]),U.useEffect(()=>{d(n)},[n]),U.useEffect(()=>{const N=l(`conversation-rating.overlay.bot-message.rate-feedback.value-${u}`);p(N!=null&&N.length?N:void 0)},[u,l]),U.useEffect(()=>{w.submitted?setTimeout(()=>v(!0),w.feedback.length?500:0):v(!1)},[w]);const x=N=>{var S,T;N.preventDefault();const O=((T=(S=k.current)==null?void 0:S.value)==null?void 0:T.trim())||"";i(u,O),m({submitted:!0,feedback:O})};return R.jsx("div",{className:q(mt.rateOverlay,Tr.bottomSheet,"chat__conversationRating__overlay",{[Tr.bottomSheetOpen]:E===!0,[Tr.bottomSheetClose]:E===!1}),children:R.jsxs("form",{onSubmit:x,children:[R.jsxs("div",{className:q(mt.body,"chat__conversationRating__overlay__body"),children:[R.jsxs("div",{children:[R.jsx("h2",{children:l("conversation-rating.overlay.title")}),R.jsxs("div",{className:q(mt.starsDescriptionContainer),children:[R.jsx(Cv,{value:u,size:"large",readonly:w.submitted,onChange:d}),R.jsxs("div",{className:q(mt.starsDescription),children:[R.jsx("div",{children:l("conversation-rating.overlay.star.very-bad")}),R.jsx("div",{children:l("conversation-rating.overlay.star.very-good")})]})]})]}),R.jsx("div",{className:q(mt.bubbles),children:e&&h&&R.jsxs(R.Fragment,{children:[R.jsx(dg,{isFirstMessageBySender:!0,isLastMessageBySender:!_||!!w.feedback.length,children:R.jsx("div",{children:h})}),!!w.feedback.length&&R.jsx(h2,{children:w.feedback}),_&&R.jsx(dg,{isFirstMessageBySender:!!w.feedback.length,isLastMessageBySender:!0,children:R.jsx("div",{children:l("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),R.jsxs("div",{className:q(mt.footer,"chat__conversationRating__overlay__footer"),children:[!w.submitted&&R.jsx("input",{ref:k,placeholder:l("conversation-rating.overlay.guest-feedback.input-placeholder")}),R.jsx("div",{className:q(mt.actions,"chat__conversationRating__overlay__footer__actions"),children:w.submitted?R.jsx("button",{type:"button",className:q(it.button,it.buttonPrimary),onClick:s,children:l("conversation-rating.overlay.action.close")}):R.jsx("button",{type:"submit",className:q(it.button,it.buttonPrimary),children:l("conversation-rating.overlay.action.submit")})})]})]})})},m2=({conversationRating:{enabled:e,rating:n},numberOfMessagesFromGuest:i,showRatingOverlay:s,setShowRatingOverlay:l,onRate:u})=>{const[d,h]=U.useState(0),p=w=>{h(w),l(!0)},E=()=>l(!1),y=!n&&i>=1;return e?R.jsxs(R.Fragment,{children:[R.jsx(d2,{visible:y,onRate:p}),R.jsx(p2,{visible:s,rating:d,onRate:u,onClose:E})]}):null},g2="_inputWrapper_1o8hf_5",y2="_messageInputWrapper_1o8hf_14",v2="_messageInput_1o8hf_14",_2="_buttons_1o8hf_36",E2="_button_1o8hf_36",Qn={inputWrapper:g2,messageInputWrapper:y2,messageInput:v2,buttons:_2,button:E2},S2="_audioRecorder_xps9k_5",b2="_recordButton_xps9k_10",w2="_submitButton_xps9k_37",x2="_cancelButton_xps9k_64",T2="_recorderIcon_xps9k_91",C2="_pulse_xps9k_1",k2="_spinning_xps9k_113",R2="_spin_xps9k_113",mn={audioRecorder:S2,recordButton:b2,submitButton:w2,cancelButton:x2,recorderIcon:T2,pulse:C2,spinning:k2,spin:R2},hg=2048,Zs=16e3;class O2 extends wr.Component{constructor(i){super(i);we(this,"audioInput",null);we(this,"volume",null);we(this,"leftchannel",[]);we(this,"recorder",null);we(this,"recordingLength",0);we(this,"sampleRate",null);we(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 s=window.AudioContext||window.webkitAudioContext,l=new s;this.sampleRate=l.sampleRate,this.volume=l.createGain(),this.audioInput=l.createMediaStreamSource(i),this.audioInput.connect(this.volume),this.recorder=l.createScriptProcessor(hg,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(l.destination)}processRecordingInput(i){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const s=i.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(s)),this.recordingLength+=hg}}handleClickSubmitAudio(){const i=A2(this.leftchannel,this.recordingLength),s=I2(i,this.sampleRate||0),l=N2(s);this.props.onAudioRecorded(l),this.handleClickStopAudio()}handleClickStopAudio(){var i,s,l,u;this.setState({recordingState:"none"}),(i=this.audioInput)==null||i.disconnect(),(s=this.volume)==null||s.disconnect(),(l=this.recorder)==null||l.disconnect(),this.mediaStream&&((u=this.mediaStream)==null||u.getAudioTracks().forEach(d=>{d.stop()}))}render(){return R.jsxs("div",{className:mn.audioRecorder,children:[this.state.recordingState==="none"&&R.jsx("button",{className:q(mn.recordButton,"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:R.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.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"}),R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&R.jsxs("svg",{className:mn.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.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"}),R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&R.jsxs("div",{className:mn.audioRecorder,children:[R.jsx("button",{className:q(mn.cancelButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:R.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.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"}),R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),R.jsx("div",{className:mn.recorderIcon}),R.jsx("button",{className:q(mn.submitButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:R.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),R.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const N2=e=>{const n=new ArrayBuffer(44+e.length*2),i=new DataView(n);Fs(i,0,"RIFF"),i.setUint32(4,44+e.length*2,!0),Fs(i,8,"WAVE"),Fs(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,Zs,!0),i.setUint32(28,Zs*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),Fs(i,36,"data"),i.setUint32(40,e.length*2,!0);const s=e.length;let l=44;const u=1;for(let d=0;d<s;d++)i.setInt16(l,e[d]*(32767*u),!0),l+=2;return new Blob([i],{type:"audio/wav"})},Fs=(e,n,i)=>{for(let s=0;s<i.length;s++)e.setUint8(n+s,i.charCodeAt(s))},A2=(e,n)=>{const i=new Float32Array(n);let s=0;const l=e.length;for(let u=0;u<l;u++){const d=e[u];i.set(d,s),s+=d.length}return i},I2=(e,n)=>{if(Zs===n)return e;const i=n/Zs,s=Math.round(e.length/i),l=new Float32Array(s);let u=0,d=0;for(;u<l.length;){const h=Math.round((u+1)*i);let p=0,E=0;for(let y=d;y<h&&y<e.length;y++)p+=e[y],E++;l[u]=p/E,u++,d=h}return l},P2=({speechSupport:e,transcriptExportEnabled:n,disabled:i,onTextInput:s,onAudioRecorded:l,onOpenTranscriptExportModal:u})=>{const d=$t(),[h,p]=U.useState(!1),E=U.useRef(null),y=()=>{const v=E.current;v&&v.value.trim().length>=1&&s(v.value.trim())&&(v.value="",v.style.height="",p(!1),v.focus())},w=v=>{v.preventDefault(),y()},m=v=>{const k=v.target.value.trim();p(k.length>0),v.target.style.height="";const{scrollHeight:x}=v.target;v.target.style.height=`${x>150?150:x}px`},_=v=>{v.code==="Enter"&&!v.shiftKey&&(v.repeat||y(),v.preventDefault())};return R.jsxs("form",{className:q(Qn.inputWrapper,"chat__textInput"),onSubmit:w,children:[R.jsx("div",{className:Qn.messageInputWrapper,children:R.jsx("textarea",{id:"user_input",ref:E,className:Qn.messageInput,tabIndex:0,placeholder:d("message-input-placeholder"),onChange:m,onKeyDown:_,"aria-label":d("message-input-label")})}),R.jsxs("div",{className:q(Qn.buttons,"chat__buttons"),children:[!h&&n&&R.jsx("button",{type:"button",className:q(Qn.button,"chat__button"),"aria-label":d("message-input.actions.export-transcript.label"),"data-title":d("message-input.actions.export-transcript.label"),tabIndex:0,onClick:u,children:R.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:R.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"})})}),h||!e||navigator.mediaDevices===void 0?R.jsx("button",{className:q(Qn.button,"chat__button"),type:"submit","aria-label":d("message-input.actions.submit.label"),"data-title":d("message-input.actions.submit.label"),tabIndex:0,disabled:i,children:R.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:R.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&&R.jsx(O2,{translate:d,onAudioRecorded:l})]})]})},D2="_quickReplies_11l22_1",M2="_quickReply_11l22_9",pg={quickReplies:D2,quickReply:M2},F2=({quickReplies:e,onQuickReplyClick:n})=>e.length?R.jsx("div",{className:q(pg.quickReplies,"chat__quickReplies"),children:e.map(i=>R.jsx("button",{tabIndex:0,className:q(pg.quickReply,it.button,"chat__button","chat__quickReply"),onClick:()=>n(i),children:i.label},i.label))}):null,mg=5e3,L2=1e3,B2=({isBotTyping:e,quickReplies:n,speechSupport:i,transcriptExportEnabled:s,conversationRating:l,numberOfMessagesFromGuest:u,showRatingOverlay:d,setShowRatingOverlay:h,onTextInput:p,onRate:E,onQuickReplyClick:y,onAudioRecorded:w,onOpenTranscriptExportModal:m})=>{const[_,v]=U.useState(!1),k=U.useRef(),x=U.useRef(0);U.useEffect(()=>{if(_&&!e){const O=k.current?Date.now()-k.current:0;O>mg?v(!1):setTimeout(()=>{v(!1)},mg-O)}},[_,e]),U.useEffect(()=>{_&&(k.current=Date.now())},[_]);const N=O=>{const S=Date.now()-x.current<L2;return e||S?(v(!0),!1):(p(O),x.current=Date.now(),!0)};return R.jsxs("div",{className:q(LC.inputContainer),children:[R.jsx(F2,{quickReplies:n,onQuickReplyClick:y}),R.jsx(zC,{visible:_}),!_&&R.jsx(m2,{conversationRating:l,numberOfMessagesFromGuest:u,onRate:E,showRatingOverlay:d,setShowRatingOverlay:h}),R.jsx(P2,{onTextInput:N,onAudioRecorded:w,speechSupport:i,onOpenTranscriptExportModal:m,transcriptExportEnabled:s,disabled:_})]})},j2=({clientName:e,messages:n,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:d,conversationRating:h,showGeneralConditions:p,onMessageFromUser:E,onRate:y,onQuickReplyClick:w,onButtonClick:m,onLinkClick:_,onAudioRecorded:v,onTranscriptExport:k,onPdfExport:x,onTranscriptItemReaction:N})=>{const O=qc(),S=_n(te=>te.connection.connectionState),[T,C]=U.useState(!1),[L,H]=U.useState(!1),W=d.email||d.pdf,se=n.filter(te=>te.sender.type===ev.GUEST).length;return U.useEffect(()=>{if(S===vn.CONNECTED){const te=Xc.parse(window.location.search);O(Jy(e,te))}},[e,S,O]),R.jsxs("div",{children:[R.jsxs("div",{className:`${Pw.chatcontent} ${T||L?it.accessabilityHidden:""}`,children:[R.jsx(gC,{messages:n,isBotTyping:s,showGeneralConditions:p,onButtonClick:m,onLinkClick:_,onTranscriptItemReaction:N}),R.jsx(B2,{isBotTyping:s,quickReplies:s?[]:i,numberOfMessagesFromGuest:se,speechSupport:u,transcriptExportEnabled:W,conversationRating:T?{enabled:!1}:h,showRatingOverlay:L,setShowRatingOverlay:H,onRate:y,onQuickReplyClick:w,onTextInput:E,onAudioRecorded:v,onOpenTranscriptExportModal:()=>C(!T)}),R.jsx(kC,{})]}),W&&R.jsx(MC,{methods:d,visible:T,onEmailExport:k,onPdfExport:x,onClose:()=>C(!1)}),R.jsx(wC,{contentUrl:l})]})},z2=e=>{const{messages:n,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:d,conversationRating:h,showGeneralConditions:p}=e.chat;return{messages:n,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:d,conversationRating:h,showGeneralConditions:p}},U2=e=>({onRestartChat:(n,i)=>e(pf(n,i)),onMessageFromUser:n=>e(Py(n)),onRate:(n,i)=>e(Sb(n,i)),onAudioRecorded:n=>e(hb(n)),onActionFromUser:n=>e(n),onQuickReplyClick:n=>e(Iy(n)),onNluEvent:n=>e(Fy(n)),onButtonClick:n=>e(wb(n)),onLinkClick:n=>e(xb(n)),onTranscriptExport:n=>e(yb(n)),onPdfExport:()=>e(_b()),onTranscriptItemReaction:(n,i)=>e(ge.transcriptItemGuestReaction(n,i||null))}),H2=Q1(z2,U2)(j2),G2="_chatwindow_phukm_1",$2="_chatcontent_phukm_13",q2={chatwindow:G2,chatcontent:$2},V2="_container_ophni_2",W2="_body_ophni_8",X2="_intro_ophni_13",Q2="_footer_ophni_34",K2="_startChatButton_ophni_38",Y2="_formFields_ophni_42",Z2="_formField_ophni_42",J2="_radio_ophni_54",ek="_checkbox_ophni_61",tk="_input_ophni_69",rk="_inputLabel_ophni_99",nk="_selectWrapper_ophni_103",ik="_select_ophni_103",ok="_selectLabel_ophni_145",gt={container:V2,body:W2,intro:X2,footer:Q2,startChatButton:K2,formFields:Y2,formField:Z2,radio:J2,checkbox:ek,input:tk,inputLabel:rk,selectWrapper:nk,select:ik,selectLabel:ok},sk=({name:e,label:n,defaultValue:i,required:s,onChange:l})=>{const u=d=>{l(d.currentTarget.checked?"true":"false")};return R.jsxs("label",{className:q(gt.checkbox,"chat__startScreen__checkbox"),htmlFor:e,children:[R.jsx("input",{type:"checkbox",id:e,name:e,defaultChecked:i==="true",required:s,onChange:u}),R.jsx("div",{children:n})]})},ak=({type:e,name:n,label:i,defaultValue:s,placeholder:l,required:u,multiple:d,min:h,max:p,pattern:E,onChange:y})=>{const w=m=>{y(m.target.value)};return R.jsxs("label",{className:q(gt.input,"chat__startScreen__input"),htmlFor:n,children:[R.jsx("div",{className:q(gt.inputLabel),children:i}),R.jsx("input",{type:e,id:n,name:n,defaultValue:s,placeholder:l,required:u,multiple:d,min:h,max:p,pattern:E,onChange:w})]})},lk=({name:e,value:n,label:i,defaultChecked:s,required:l,onChange:u})=>{const d=`${e}-${n}`,h=p=>{u(p.target.value)};return R.jsxs("label",{className:q(gt.radio,"chat__startScreen__radio"),htmlFor:d,children:[R.jsx("input",{id:d,type:"radio",name:e,value:n,defaultChecked:s,required:l,onChange:h}),R.jsx("span",{className:q(gt.label),children:i})]})},uk=({name:e,label:n,defaultValue:i,required:s,multiple:l,options:u,onChange:d})=>{const h=p=>{d(p.target.value)};return R.jsxs("label",{className:q(gt.select,"chat__startScreen__select"),htmlFor:e,children:[R.jsx("div",{className:q(gt.selectLabel),children:n}),R.jsx("div",{className:q(gt.selectWrapper),children:R.jsx("select",{id:e,name:e,defaultValue:i,required:s,multiple:l,onChange:h,children:Object.entries(u||{}).map(([p,E])=>R.jsx("option",{value:p,selected:E===i,children:E}))})})]})},ck="start-screen.intro",fk="start-screen.start-chat",er="start-screen.form",gg=`${er}.fields`,dk=()=>{const e=$t(),n=qc(),[i,s]=U.useState({}),l=()=>{const y=Object.entries(i).reduce((w,[m,_])=>({...w,[m]:_.value}),{});n(fw(y))},u=e(ck),d=e(fk),h=U.useMemo(()=>{var y;return((y=e(gg))==null?void 0:y.split(";").map(w=>w.trim()))??[]},[e(gg)]);U.useEffect(()=>{h.length&&Object.keys(i).length===0&&s(h.reduce((y,w)=>({...y,[w]:pk(w,e)}),{}))},[e,h,i]);const p=y=>{y.preventDefault(),l()},E=y=>w=>{s(m=>({...m,[y]:{...m[y],value:w}}))};return R.jsxs("form",{onSubmit:p,className:q(gt.container,"chat__startScreen"),children:[R.jsxs("div",{className:q(gt.body,"chat__startScreen__body"),children:[u&&R.jsx("div",{className:q(gt.intro,"chat__startScreen__intro"),children:R.jsx(Kr,{options:{overrides:{a:hk}},children:u})}),R.jsx("div",{className:q(gt.formFields,"chat__startScreen__fields"),children:Object.values(i).map(({type:y,name:w,label:m,placeholder:_,defaultValue:v,options:k,required:x,multiple:N,min:O,max:S,pattern:T})=>R.jsx("div",{className:q(gt.formField,"chat__startScreen__field"),children:(()=>{switch(y){case"radio":return R.jsxs(R.Fragment,{children:[R.jsx("div",{children:m}),Object.entries(k||{}).map(([C,L])=>R.jsx(lk,{name:w,value:C,label:L,defaultChecked:C===v,required:x,onChange:E(w)}))]});case"checkbox":return R.jsx(sk,{name:w,label:m,defaultValue:v,required:x,onChange:E(w)});case"select":return R.jsx(uk,{name:w,label:m,defaultValue:v,required:x,multiple:N,options:k,onChange:E(w)});default:return R.jsx(ak,{type:y,name:w,label:m,placeholder:_,defaultValue:v,required:x,multiple:N,min:O,max:S,pattern:T,onChange:E(w)})}})()},w))})]}),R.jsx("div",{className:q(gt.footer,"chat__startScreen__footer"),children:R.jsx("button",{type:"submit",className:q(it.button,it.buttonPrimary,gt.startChatButton),children:d})})]})},hk=({title:e,href:n,children:i})=>R.jsx("a",{href:n,title:e,target:"_blank",rel:"noopener noreferrer",children:i}),pk=(e,n)=>{const i=n(`${er}.${e}.type`)||"text",s=n(`${er}.${e}.required`)==="true",l=n(`${er}.${e}.multiple`)==="true",u=n(`${er}.${e}.placeholder`),d=n(`${er}.${e}.label`)||"",h=n(`${er}.${e}.defaultValue`),p=n(`${er}.${e}.min`),E=n(`${er}.${e}.max`),y=n(`${er}.${e}.pattern`),w=gk(n(`${er}.${e}.options`));return{name:e,label:d,placeholder:u,value:mk(i,h,w)||"",defaultValue:h,options:w,type:i,required:s,multiple:l,min:p,max:E,pattern:y}},mk=(e,n,i)=>n||e==="select"&&Object.keys(i)[0]||"",gk=(e="")=>e.split(";").map(n=>n.trim()).reduce((n,i)=>{const[s,l]=i.split(":").map(u=>u.trim());return{...n,[s]:l}},{}),yk=()=>{const e=ra();U.useEffect(()=>{window.document.documentElement.lang=e.locale},[e.locale])},Kn={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"},vk=({clientName:e})=>{yk();const n=qc(),i=_n(y=>y.intl.messages),s=$t(),l=_n(y=>y.startScreen.useStartScreen),u=_n(y=>y.startScreen.startScreenStatus),[d,h]=U.useState(void 0);U.useEffect(()=>{const y=Xc.parse(window.location.search);y.cssClassName&&h(y.cssClassName);const w=m=>{switch(m.data.type){case Kn.TRIGGER_ACTION:n(m.data.action);break;case Kn.TRIGGER_STORY:n(Fy(m.data.story));break;case Kn.ON_CHAT_WINDOW_OPEN:n({type:"webclient.chatwindow.opened"});break;case Kn.ON_CHAT_WINDOW_CLOSE:n({type:"webclient.chatwindow.closed"});break;case Kn.CHAT_MESSAGE_FROM_GUEST:n(Py(m.data.text));break;case Kn.RESTART_CHAT:n(pf(e,y));break}};return n(Ew(e,y)),window.addEventListener("message",m=>w(m),!1),()=>window.removeEventListener("message",w)},[e,n]),U.useEffect(()=>{const y=s("header.restart-chat"),w=s("header.close-chat");n(Tb({header:{restartChat:y,closeChat:w}}))},[i,n,s]);const p=l===void 0,E=l===!1||u==="HIDDEN";return R.jsx("div",{className:q(q2.chatwindow,"chat__chatwindow",d),children:p?null:E?R.jsx(H2,{clientName:e}):R.jsx(dk,{})})},_k=()=>{const e=by(),n=_n(s=>s.intl.locale),i=_n(s=>s.intl.messages);return R.jsx(kS,{locale:n,messages:i,children:R.jsx("div",{className:OS.app,children:R.jsx(vk,{clientName:e})})})};var Hu,yg;function yf(){if(yg)return Hu;yg=1;function e(n){var i=typeof n;return n!=null&&(i=="object"||i=="function")}return Hu=e,Hu}var Gu,vg;function Ek(){if(vg)return Gu;vg=1;var e=typeof ds=="object"&&ds&&ds.Object===Object&&ds;return Gu=e,Gu}var $u,_g;function kv(){if(_g)return $u;_g=1;var e=Ek(),n=typeof self=="object"&&self&&self.Object===Object&&self,i=e||n||Function("return this")();return $u=i,$u}var qu,Eg;function Sk(){if(Eg)return qu;Eg=1;var e=kv(),n=function(){return e.Date.now()};return qu=n,qu}var Vu,Sg;function bk(){if(Sg)return Vu;Sg=1;var e=/\s/;function n(i){for(var s=i.length;s--&&e.test(i.charAt(s)););return s}return Vu=n,Vu}var Wu,bg;function wk(){if(bg)return Wu;bg=1;var e=bk(),n=/^\s+/;function i(s){return s&&s.slice(0,e(s)+1).replace(n,"")}return Wu=i,Wu}var Xu,wg;function Rv(){if(wg)return Xu;wg=1;var e=kv(),n=e.Symbol;return Xu=n,Xu}var Qu,xg;function xk(){if(xg)return Qu;xg=1;var e=Rv(),n=Object.prototype,i=n.hasOwnProperty,s=n.toString,l=e?e.toStringTag:void 0;function u(d){var h=i.call(d,l),p=d[l];try{d[l]=void 0;var E=!0}catch{}var y=s.call(d);return E&&(h?d[l]=p:delete d[l]),y}return Qu=u,Qu}var Ku,Tg;function Tk(){if(Tg)return Ku;Tg=1;var e=Object.prototype,n=e.toString;function i(s){return n.call(s)}return Ku=i,Ku}var Yu,Cg;function Ck(){if(Cg)return Yu;Cg=1;var e=Rv(),n=xk(),i=Tk(),s="[object Null]",l="[object Undefined]",u=e?e.toStringTag:void 0;function d(h){return h==null?h===void 0?l:s:u&&u in Object(h)?n(h):i(h)}return Yu=d,Yu}var Zu,kg;function kk(){if(kg)return Zu;kg=1;function e(n){return n!=null&&typeof n=="object"}return Zu=e,Zu}var Ju,Rg;function Rk(){if(Rg)return Ju;Rg=1;var e=Ck(),n=kk(),i="[object Symbol]";function s(l){return typeof l=="symbol"||n(l)&&e(l)==i}return Ju=s,Ju}var ec,Og;function Ok(){if(Og)return ec;Og=1;var e=wk(),n=yf(),i=Rk(),s=NaN,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,d=/^0o[0-7]+$/i,h=parseInt;function p(E){if(typeof E=="number")return E;if(i(E))return s;if(n(E)){var y=typeof E.valueOf=="function"?E.valueOf():E;E=n(y)?y+"":y}if(typeof E!="string")return E===0?E:+E;E=e(E);var w=u.test(E);return w||d.test(E)?h(E.slice(2),w?2:8):l.test(E)?s:+E}return ec=p,ec}var tc,Ng;function Nk(){if(Ng)return tc;Ng=1;var e=yf(),n=Sk(),i=Ok(),s="Expected a function",l=Math.max,u=Math.min;function d(h,p,E){var y,w,m,_,v,k,x=0,N=!1,O=!1,S=!0;if(typeof h!="function")throw new TypeError(s);p=i(p)||0,e(E)&&(N=!!E.leading,O="maxWait"in E,m=O?l(i(E.maxWait)||0,p):m,S="trailing"in E?!!E.trailing:S);function T(ae){var Fe=y,Ie=w;return y=w=void 0,x=ae,_=h.apply(Ie,Fe),_}function C(ae){return x=ae,v=setTimeout(W,p),N?T(ae):_}function L(ae){var Fe=ae-k,Ie=ae-x,$e=p-Fe;return O?u($e,m-Ie):$e}function H(ae){var Fe=ae-k,Ie=ae-x;return k===void 0||Fe>=p||Fe<0||O&&Ie>=m}function W(){var ae=n();if(H(ae))return se(ae);v=setTimeout(W,L(ae))}function se(ae){return v=void 0,S&&y?T(ae):(y=w=void 0,_)}function te(){v!==void 0&&clearTimeout(v),x=0,y=k=w=v=void 0}function fe(){return v===void 0?_:se(n())}function de(){var ae=n(),Fe=H(ae);if(y=arguments,w=this,k=ae,Fe){if(v===void 0)return C(k);if(O)return clearTimeout(v),v=setTimeout(W,p),T(k)}return v===void 0&&(v=setTimeout(W,p)),_}return de.cancel=te,de.flush=fe,de}return tc=d,tc}var rc,Ag;function Ak(){if(Ag)return rc;Ag=1;var e=Nk(),n=yf(),i="Expected a function";function s(l,u,d){var h=!0,p=!0;if(typeof l!="function")throw new TypeError(i);return n(d)&&(h="leading"in d?!!d.leading:h,p="trailing"in d?!!d.trailing:p),e(l,u,{leading:h,maxWait:u,trailing:p})}return rc=s,rc}var Ik=Ak();const Pk=Js(Ik);var nc,Ig;function Dk(){if(Ig)return nc;Ig=1;function e(_,v){var k,x;if(typeof v=="function")x=v(_),x!==void 0&&(_=x);else if(Array.isArray(v))for(k=0;k<v.length;k++)x=v[k](_),x!==void 0&&(_=x);return _}function n(_,v){return _[0]==="-"&&Array.isArray(v)&&/^-\d+$/.test(_)?v.length+parseInt(_,10):_}function i(_){return/^\d+$/.test(_)}function s(_){return Object.prototype.toString.call(_)==="[object Object]"}function l(_){return Object(_)===_}function u(_){return Object.keys(_).length===0}var d=["__proto__","prototype","constructor"],h=function(_){return d.indexOf(_)===-1};function p(_,v){_.indexOf("[")>=0&&(_=_.replace(/\[/g,v).replace(/]/g,""));var k=_.split(v),x=k.filter(h);if(x.length!==k.length)throw Error("Refusing to update blacklisted property "+_);return k}var E=Object.prototype.hasOwnProperty;function y(_,v,k,x){if(!(this instanceof y))return new y(_,v,k,x);typeof v>"u"&&(v=!1),typeof k>"u"&&(k=!0),typeof x>"u"&&(x=!0),this.separator=_||".",this.override=v,this.useArray=k,this.useBrackets=x,this.keepArray=!1,this.cleanup=[]}var w=new y(".",!1,!0,!0);function m(_){return function(){return w[_].apply(w,arguments)}}return y.prototype._fill=function(_,v,k,x){var N=_.shift();if(_.length>0){if(v[N]=v[N]||(this.useArray&&i(_[0])?[]:{}),!l(v[N]))if(this.override)v[N]={};else{if(!(l(k)&&u(k)))throw new Error("Trying to redefine `"+N+"` which is a "+typeof v[N]);return}this._fill(_,v[N],k,x)}else{if(!this.override&&l(v[N])&&!u(v[N])){if(!(l(k)&&u(k)))throw new Error("Trying to redefine non-empty obj['"+N+"']");return}v[N]=e(k,x)}},y.prototype.object=function(_,v){var k=this;return Object.keys(_).forEach(function(x){var N=v===void 0?null:v[x],O=p(x,k.separator).join(k.separator);O.indexOf(k.separator)!==-1?(k._fill(O.split(k.separator),_,_[x],N),delete _[x]):_[x]=e(_[x],N)}),_},y.prototype.str=function(_,v,k,x){var N=p(_,this.separator).join(this.separator);return _.indexOf(this.separator)!==-1?this._fill(N.split(this.separator),k,v,x):k[_]=e(v,x),k},y.prototype.pick=function(_,v,k,x){var N,O,S,T,C;for(O=p(_,this.separator),N=0;N<O.length;N++)if(T=n(O[N],v),v&&typeof v=="object"&&T in v){if(N===O.length-1)return k?(S=v[T],x&&Array.isArray(v)?v.splice(T,1):delete v[T],Array.isArray(v)&&(C=O.slice(0,-1).join("."),this.cleanup.indexOf(C)===-1&&this.cleanup.push(C)),S):v[T];v=v[T]}else return;return k&&Array.isArray(v)&&(v=v.filter(function(L){return L!==void 0})),v},y.prototype.delete=function(_,v){return this.remove(_,v,!0)},y.prototype.remove=function(_,v,k){var x;if(this.cleanup=[],Array.isArray(_)){for(x=0;x<_.length;x++)this.pick(_[x],v,!0,k);return k||this._cleanup(v),v}else return this.pick(_,v,!0,k)},y.prototype._cleanup=function(_){var v,k,x,N;if(this.cleanup.length){for(k=0;k<this.cleanup.length;k++)x=this.cleanup[k].split("."),N=x.splice(0,-1).join("."),v=N?this.pick(N,_):_,v=v[x[0]].filter(function(O){return O!==void 0}),this.set(this.cleanup[k],v,_);this.cleanup=[]}},y.prototype.del=y.prototype.remove,y.prototype.move=function(_,v,k,x,N){return typeof x=="function"||Array.isArray(x)?this.set(v,e(this.pick(_,k,!0),x),k,N):(N=x,this.set(v,this.pick(_,k,!0),k,N)),k},y.prototype.transfer=function(_,v,k,x,N,O){return typeof N=="function"||Array.isArray(N)?this.set(v,e(this.pick(_,k,!0),N),x,O):(O=N,this.set(v,this.pick(_,k,!0),x,O)),x},y.prototype.copy=function(_,v,k,x,N,O){return typeof N=="function"||Array.isArray(N)?this.set(v,e(JSON.parse(JSON.stringify(this.pick(_,k,!1))),N),x,O):(O=N,this.set(v,this.pick(_,k,!1),x,O)),x},y.prototype.set=function(_,v,k,x){var N,O,S,T;if(typeof v>"u")return k;for(S=p(_,this.separator),N=0;N<S.length;N++){if(T=S[N],N===S.length-1)if(x&&s(v)&&s(k[T]))for(O in v)E.call(v,O)&&(k[T][O]=v[O]);else if(x&&Array.isArray(k[T])&&Array.isArray(v))for(var C=0;C<v.length;C++)k[S[N]].push(v[C]);else k[T]=v;else(!E.call(k,T)||!s(k[T])&&!Array.isArray(k[T]))&&(/^\d+$/.test(S[N+1])?k[T]=[]:k[T]={});k=k[T]}return k},y.prototype.transform=function(_,v,k){return v=v||{},k=k||{},Object.keys(_).forEach((function(x){this.set(_[x],this.pick(x,v),k)}).bind(this)),k},y.prototype.dot=function(_,v,k){v=v||{},k=k||[];var x=Array.isArray(_);return Object.keys(_).forEach((function(N){var O=x&&this.useBrackets?"["+N+"]":N;if(l(_[N])&&(s(_[N])&&!u(_[N])||Array.isArray(_[N])&&!this.keepArray&&_[N].length!==0))if(x&&this.useBrackets){var S=k[k.length-1]||"";return this.dot(_[N],v,k.slice(0,-1).concat(S+O))}else return this.dot(_[N],v,k.concat(O));else x&&this.useBrackets?v[k.join(this.separator).concat("["+N+"]")]=_[N]:v[k.concat(O).join(this.separator)]=_[N]}).bind(this)),v},y.pick=m("pick"),y.move=m("move"),y.transfer=m("transfer"),y.transform=m("transform"),y.copy=m("copy"),y.object=m("object"),y.str=m("str"),y.set=m("set"),y.delete=m("delete"),y.del=y.remove=m("remove"),y.dot=m("dot"),["override","overwrite"].forEach(function(_){Object.defineProperty(y,_,{get:function(){return w.override},set:function(v){w.override=!!v}})}),["useArray","keepArray","useBrackets"].forEach(function(_){Object.defineProperty(y,_,{get:function(){return w[_]},set:function(v){w[_]=v}})}),y._process=e,nc=y,nc}var Mk=Dk();const Ov={"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","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:
98
98
 
99
99
  - Der Chatverlauf wird im EU-Raum gespeichert und kann nur von autorisierten Personen eingesehen werden.
100
100
  - 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.close-chat":"Chat minimieren"},Fk={"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","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:
@@ -107,4 +107,4 @@ For more details see https://formatjs.io/docs/getting-started/message-distributi
107
107
 
108
108
  - La cronologia delle chat è memorizzata nell'area UE e può essere visualizzata solo da persone autorizzate.
109
109
  - 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.close-chat":"Ridurre al minimo la chat"},jk=["de","en","fr","it"],Nv={locale:"de",messages:Ov},zk=(e,n)=>{if(jk.includes(e)){const i=Uk(e),s=Mk.dot(n);return{...i,...s}}return n},Uk=e=>{switch(e.toString()){case"en":return Fk;case"fr":return Lk;case"it":return Bk;default:return Ov}},Hk=(e=Gk,n)=>{switch(n.type){case uf:return Object.assign({},e,{connectionState:vn.CONNECTING});case cf:return Object.assign({},e,{connectionState:vn.CONNECTED});case ff:return Object.assign({},e,{connectionState:vn.DISCONNECTED});case df:return Object.assign({},e,{connectionState:vn.RECONNECTED});case hf:return Object.assign({},e,{sessionId:n.sessionId});case la:return Object.assign({},e,{sessionId:n.payload.sessionId,userId:n.payload.userId});case ua:return Object.assign({},e,{sessionId:void 0});default:return e}},Gk={connectionState:vn.DISCONNECTED,sessionId:void 0,userId:void 0},$k=(e=Dg,n)=>{switch(n.type){case Zy:return Dg;case la:return Yn({type:"webclient.chat.started"}),e;case ua:return Yn({type:"webclient.chat.ended"}),e;case ge.ActionTypes.TYPING_ON:return Object.assign({},e,{isBotTyping:!0});case ge.ActionTypes.TYPING_OFF:return Object.assign({},e,{isBotTyping:!1});case ge.ActionTypes.MESSAGE_FROM_GUEST:case ge.ActionTypes.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return Pg(e,n.message);case ge.ActionTypes.MESSAGE_TO_GUEST:{Yn(n);const i=Object.assign({},n.message,{_id:n.meta.actionId}),s=e.messages.filter(l=>l._id===n.meta.actionId).length>0;return Object.assign({},e,{isBotTyping:!1,messages:s?e.messages:e.messages.concat([i]),quickReplies:i.quickReplies?i.quickReplies:[]})}case Yc:{const i=n.messages,s=i.length?i[i.length-1]:void 0;return Object.assign({},e,{isBotTyping:!1,messages:i,quickReplies:(s==null?void 0:s.quickReplies)||[]})}case na:return Yn(n.message),e;case ge.ActionTypes.EVENT_TO_GUEST:return Yn(n.event),e;case ge.ActionTypes.DRAWER_OPEN:return Object.assign({},e,{drawerContentUrl:n.payload.parameters.contentUrl});case ge.ActionTypes.DRAWER_CLOSE:return Object.assign({},e,{drawerContentUrl:void 0});case ge.ActionTypes.GUEST_LOCALE_CHANGED:return Object.assign({},e,{locale:n.payload.locale});case Dy:return Yn(n),e;case Jc:return Object.assign({},e,{speechSupport:!0});case tf:{const i=new ge.TextMessage(n.transcription,new ge.GuestUser),s=Object.assign({},i,{_id:Rc()});return Pg(e,s)}case ef:return Object.assign({},e,{transcriptExportEnabled:n.methods});case rf:return Object.assign({},e,{showGeneralConditions:!0});case ge.ActionTypes.TRANSCRIPT_ITEM_GUEST_REACTION:{const i=e.messages.map(s=>s._id===n.payload.actionId?Object.assign({},s,{reaction:n.payload.reaction}):s);return Object.assign({},e,{messages:i})}case nf:{const i={enabled:!0,rating:n.payload.rating};return Object.assign({},e,{conversationRating:i})}case ge.ActionTypes.CONVERSATION_RATING_FROM_GUEST:{const i={...e.conversationRating,rating:n.payload};return Object.assign({},e,{conversationRating:i})}default:return e}},Pg=(e,n)=>{const i=e.messages[e.messages.length-1],s=(i==null?void 0:i.text)===n.text;return i&&i.sender.type===n.sender.type&&s?e:Object.assign({},e,{messages:e.messages.concat([n]),quickReplies:[]})},Yn=e=>{var n;qk()?(n=window.top)==null||n.postMessage(e,"*"):e.type==="webclient.change.url"&&window.open(e.url)},qk=()=>typeof window<"u"&&window.self!==window.top,Dg={messages:[],quickReplies:[],isBotTyping:!1,speechSupport:!1,transcriptExportEnabled:{pdf:!1,email:!1},showGeneralConditions:!1,conversationRating:{enabled:!1}},Av=Ky({name:"intl",initialState:Nv,reducers:{updateIntl:(e,n)=>{e.locale=n.payload.language,e.messages=n.payload.messages}}}),{updateIntl:Vk}=Av.actions,Wk=Av.reducer,Xk=jy({chat:$k,startScreen:hw,connection:Hk,intl:Wk}),Iv="bf-webclient-state-last-saved-at",Pv="bf-webclient-state",Qk=e=>{try{if(!Zk())return;const n=Mg(e,Iv);if(Yk(n))return;{const i=Mg(e,Pv);return i===null?void 0:JSON.parse(i)}}catch(n){console.error(n);return}},Kk=(e,n)=>{try{const i=JSON.stringify(n);Fg(e,Pv,i);const s=new Date().toISOString();Fg(e,Iv,s)}catch(i){console.error(i)}},Yk=e=>{if(e===null)return!1;const n=new Date(e);return n.setHours(n.getHours()+12),new Date>n},Zk=()=>typeof localStorage<"u",Mg=(e,n)=>localStorage.getItem(`${e}_${n}`),Fg=(e,n,i)=>localStorage.setItem(`${e}_${n}`,i),fr=Object.create(null);fr.open="0";fr.close="1";fr.ping="2";fr.pong="3";fr.message="4";fr.upgrade="5";fr.noop="6";const Us=Object.create(null);Object.keys(fr).forEach(e=>{Us[fr[e]]=e});const Ac={type:"error",data:"parser error"},Dv=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Mv=typeof ArrayBuffer=="function",Fv=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,vf=({type:e,data:n},i,s)=>Dv&&n instanceof Blob?i?s(n):Lg(n,s):Mv&&(n instanceof ArrayBuffer||Fv(n))?i?s(n):Lg(new Blob([n]),s):s(fr[e]+(n||"")),Lg=(e,n)=>{const i=new FileReader;return i.onload=function(){const s=i.result.split(",")[1];n("b"+(s||""))},i.readAsDataURL(e)};function Bg(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let ic;function Jk(e,n){if(Dv&&e.data instanceof Blob)return e.data.arrayBuffer().then(Bg).then(n);if(Mv&&(e.data instanceof ArrayBuffer||Fv(e.data)))return n(Bg(e.data));vf(e,!1,i=>{ic||(ic=new TextEncoder),n(ic.encode(i))})}const jg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yi=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<jg.length;e++)Yi[jg.charCodeAt(e)]=e;const eR=e=>{let n=e.length*.75,i=e.length,s,l=0,u,d,h,p;e[e.length-1]==="="&&(n--,e[e.length-2]==="="&&n--);const E=new ArrayBuffer(n),y=new Uint8Array(E);for(s=0;s<i;s+=4)u=Yi[e.charCodeAt(s)],d=Yi[e.charCodeAt(s+1)],h=Yi[e.charCodeAt(s+2)],p=Yi[e.charCodeAt(s+3)],y[l++]=u<<2|d>>4,y[l++]=(d&15)<<4|h>>2,y[l++]=(h&3)<<6|p&63;return E},tR=typeof ArrayBuffer=="function",_f=(e,n)=>{if(typeof e!="string")return{type:"message",data:Lv(e,n)};const i=e.charAt(0);return i==="b"?{type:"message",data:rR(e.substring(1),n)}:Us[i]?e.length>1?{type:Us[i],data:e.substring(1)}:{type:Us[i]}:Ac},rR=(e,n)=>{if(tR){const i=eR(e);return Lv(i,n)}else return{base64:!0,data:e}},Lv=(e,n)=>{switch(n){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Bv="",nR=(e,n)=>{const i=e.length,s=new Array(i);let l=0;e.forEach((u,d)=>{vf(u,!1,h=>{s[d]=h,++l===i&&n(s.join(Bv))})})},iR=(e,n)=>{const i=e.split(Bv),s=[];for(let l=0;l<i.length;l++){const u=_f(i[l],n);if(s.push(u),u.type==="error")break}return s};function oR(){return new TransformStream({transform(e,n){Jk(e,i=>{const s=i.length;let l;if(s<126)l=new Uint8Array(1),new DataView(l.buffer).setUint8(0,s);else if(s<65536){l=new Uint8Array(3);const u=new DataView(l.buffer);u.setUint8(0,126),u.setUint16(1,s)}else{l=new Uint8Array(9);const u=new DataView(l.buffer);u.setUint8(0,127),u.setBigUint64(1,BigInt(s))}e.data&&typeof e.data!="string"&&(l[0]|=128),n.enqueue(l),n.enqueue(i)})}})}let oc;function Ls(e){return e.reduce((n,i)=>n+i.length,0)}function Bs(e,n){if(e[0].length===n)return e.shift();const i=new Uint8Array(n);let s=0;for(let l=0;l<n;l++)i[l]=e[0][s++],s===e[0].length&&(e.shift(),s=0);return e.length&&s<e[0].length&&(e[0]=e[0].slice(s)),i}function sR(e,n){oc||(oc=new TextDecoder);const i=[];let s=0,l=-1,u=!1;return new TransformStream({transform(d,h){for(i.push(d);;){if(s===0){if(Ls(i)<1)break;const p=Bs(i,1);u=(p[0]&128)===128,l=p[0]&127,l<126?s=3:l===126?s=1:s=2}else if(s===1){if(Ls(i)<2)break;const p=Bs(i,2);l=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),s=3}else if(s===2){if(Ls(i)<8)break;const p=Bs(i,8),E=new DataView(p.buffer,p.byteOffset,p.length),y=E.getUint32(0);if(y>Math.pow(2,21)-1){h.enqueue(Ac);break}l=y*Math.pow(2,32)+E.getUint32(4),s=3}else{if(Ls(i)<l)break;const p=Bs(i,l);h.enqueue(_f(u?p:oc.decode(p),n)),s=0}if(l===0||l>e){h.enqueue(Ac);break}}}})}const jv=4;function We(e){if(e)return aR(e)}function aR(e){for(var n in We.prototype)e[n]=We.prototype[n];return e}We.prototype.on=We.prototype.addEventListener=function(e,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(n),this};We.prototype.once=function(e,n){function i(){this.off(e,i),n.apply(this,arguments)}return i.fn=n,this.on(e,i),this};We.prototype.off=We.prototype.removeListener=We.prototype.removeAllListeners=We.prototype.removeEventListener=function(e,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+e];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var s,l=0;l<i.length;l++)if(s=i[l],s===n||s.fn===n){i.splice(l,1);break}return i.length===0&&delete this._callbacks["$"+e],this};We.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),i=this._callbacks["$"+e],s=1;s<arguments.length;s++)n[s-1]=arguments[s];if(i){i=i.slice(0);for(var s=0,l=i.length;s<l;++s)i[s].apply(this,n)}return this};We.prototype.emitReserved=We.prototype.emit;We.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};We.prototype.hasListeners=function(e){return!!this.listeners(e).length};const fa=typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,i)=>i(n,0),Ut=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),lR="arraybuffer";function zv(e,...n){return n.reduce((i,s)=>(e.hasOwnProperty(s)&&(i[s]=e[s]),i),{})}const uR=Ut.setTimeout,cR=Ut.clearTimeout;function da(e,n){n.useNativeTimers?(e.setTimeoutFn=uR.bind(Ut),e.clearTimeoutFn=cR.bind(Ut)):(e.setTimeoutFn=Ut.setTimeout.bind(Ut),e.clearTimeoutFn=Ut.clearTimeout.bind(Ut))}const fR=1.33;function dR(e){return typeof e=="string"?hR(e):Math.ceil((e.byteLength||e.size)*fR)}function hR(e){let n=0,i=0;for(let s=0,l=e.length;s<l;s++)n=e.charCodeAt(s),n<128?i+=1:n<2048?i+=2:n<55296||n>=57344?i+=3:(s++,i+=4);return i}function Uv(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function pR(e){let n="";for(let i in e)e.hasOwnProperty(i)&&(n.length&&(n+="&"),n+=encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return n}function mR(e){let n={},i=e.split("&");for(let s=0,l=i.length;s<l;s++){let u=i[s].split("=");n[decodeURIComponent(u[0])]=decodeURIComponent(u[1])}return n}class gR extends Error{constructor(n,i,s){super(n),this.description=i,this.context=s,this.type="TransportError"}}class Ef extends We{constructor(n){super(),this.writable=!1,da(this,n),this.opts=n,this.query=n.query,this.socket=n.socket,this.supportsBinary=!n.forceBase64}onError(n,i,s){return super.emitReserved("error",new gR(n,i,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(n){this.readyState==="open"&&this.write(n)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(n){const i=_f(n,this.socket.binaryType);this.onPacket(i)}onPacket(n){super.emitReserved("packet",n)}onClose(n){this.readyState="closed",super.emitReserved("close",n)}pause(n){}createUri(n,i={}){return n+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const n=this.opts.hostname;return n.indexOf(":")===-1?n:"["+n+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(n){const i=pR(n);return i.length?"?"+i:""}}class yR extends Ef{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(n){this.readyState="pausing";const i=()=>{this.readyState="paused",n()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||i()})),this.writable||(s++,this.once("drain",function(){--s||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(n){const i=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};iR(n,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const n=()=>{this.write([{type:"close"}])};this.readyState==="open"?n():this.once("open",n)}write(n){this.writable=!1,nR(n,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const n=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=Uv()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(n,i)}}let Hv=!1;try{Hv=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const vR=Hv;function _R(){}class ER extends yR{constructor(n){if(super(n),typeof location<"u"){const i=location.protocol==="https:";let s=location.port;s||(s=i?"443":"80"),this.xd=typeof location<"u"&&n.hostname!==location.hostname||s!==n.port}}doWrite(n,i){const s=this.request({method:"POST",data:n});s.on("success",i),s.on("error",(l,u)=>{this.onError("xhr post error",l,u)})}doPoll(){const n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(i,s)=>{this.onError("xhr poll error",i,s)}),this.pollXhr=n}}class ur extends We{constructor(n,i,s){super(),this.createRequest=n,da(this,s),this._opts=s,this._method=s.method||"GET",this._uri=i,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var n;const i=zv(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(i);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let l in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(l)&&s.setRequestHeader(l,this._opts.extraHeaders[l])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(n=this._opts.cookieJar)===null||n===void 0||n.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var l;s.readyState===3&&((l=this._opts.cookieJar)===null||l===void 0||l.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(l){this.setTimeoutFn(()=>{this._onError(l)},0);return}typeof document<"u"&&(this._index=ur.requestsCount++,ur.requests[this._index]=this)}_onError(n){this.emitReserved("error",n,this._xhr),this._cleanup(!0)}_cleanup(n){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=_R,n)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ur.requests[this._index],this._xhr=null}}_onLoad(){const n=this._xhr.responseText;n!==null&&(this.emitReserved("data",n),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}ur.requestsCount=0;ur.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",zg);else if(typeof addEventListener=="function"){const e="onpagehide"in Ut?"pagehide":"unload";addEventListener(e,zg,!1)}}function zg(){for(let e in ur.requests)ur.requests.hasOwnProperty(e)&&ur.requests[e].abort()}const SR=function(){const e=Gv({xdomain:!1});return e&&e.responseType!==null}();class bR extends ER{constructor(n){super(n);const i=n&&n.forceBase64;this.supportsBinary=SR&&!i}request(n={}){return Object.assign(n,{xd:this.xd},this.opts),new ur(Gv,this.uri(),n)}}function Gv(e){const n=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!n||vR))return new XMLHttpRequest}catch{}if(!n)try{return new Ut[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const $v=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class wR extends Ef{get name(){return"websocket"}doOpen(){const n=this.uri(),i=this.opts.protocols,s=$v?{}:zv(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(n,i,s)}catch(l){return this.emitReserved("error",l)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=n=>this.onClose({description:"websocket connection closed",context:n}),this.ws.onmessage=n=>this.onData(n.data),this.ws.onerror=n=>this.onError("websocket error",n)}write(n){this.writable=!1;for(let i=0;i<n.length;i++){const s=n[i],l=i===n.length-1;vf(s,this.supportsBinary,u=>{try{this.doWrite(s,u)}catch{}l&&fa(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const n=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=Uv()),this.supportsBinary||(i.b64=1),this.createUri(n,i)}}const sc=Ut.WebSocket||Ut.MozWebSocket;class xR extends wR{createSocket(n,i,s){return $v?new sc(n,i,s):i?new sc(n,i):new sc(n)}doWrite(n,i){this.ws.send(i)}}class TR extends Ef{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(n){return this.emitReserved("error",n)}this._transport.closed.then(()=>{this.onClose()}).catch(n=>{this.onError("webtransport error",n)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(n=>{const i=sR(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=n.readable.pipeThrough(i).getReader(),l=oR();l.readable.pipeTo(n.writable),this._writer=l.writable.getWriter();const u=()=>{s.read().then(({done:h,value:p})=>{h||(this.onPacket(p),u())}).catch(h=>{})};u();const d={type:"open"};this.query.sid&&(d.data=`{"sid":"${this.query.sid}"}`),this._writer.write(d).then(()=>this.onOpen())})})}write(n){this.writable=!1;for(let i=0;i<n.length;i++){const s=n[i],l=i===n.length-1;this._writer.write(s).then(()=>{l&&fa(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var n;(n=this._transport)===null||n===void 0||n.close()}}const CR={websocket:xR,webtransport:TR,polling:bR},kR=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,RR=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ic(e){if(e.length>8e3)throw"URI too long";const n=e,i=e.indexOf("["),s=e.indexOf("]");i!=-1&&s!=-1&&(e=e.substring(0,i)+e.substring(i,s).replace(/:/g,";")+e.substring(s,e.length));let l=kR.exec(e||""),u={},d=14;for(;d--;)u[RR[d]]=l[d]||"";return i!=-1&&s!=-1&&(u.source=n,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=OR(u,u.path),u.queryKey=NR(u,u.query),u}function OR(e,n){const i=/\/{2,9}/g,s=n.replace(i,"/").split("/");return(n.slice(0,1)=="/"||n.length===0)&&s.splice(0,1),n.slice(-1)=="/"&&s.splice(s.length-1,1),s}function NR(e,n){const i={};return n.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,l,u){l&&(i[l]=u)}),i}const Pc=typeof addEventListener=="function"&&typeof removeEventListener=="function",Hs=[];Pc&&addEventListener("offline",()=>{Hs.forEach(e=>e())},!1);class Yr extends We{constructor(n,i){if(super(),this.binaryType=lR,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,n&&typeof n=="object"&&(i=n,n=null),n){const s=Ic(n);i.hostname=s.host,i.secure=s.protocol==="https"||s.protocol==="wss",i.port=s.port,s.query&&(i.query=s.query)}else i.host&&(i.hostname=Ic(i.host).host);da(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(s=>{const l=s.prototype.name;this.transports.push(l),this._transportsByName[l]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=mR(this.opts.query)),Pc&&(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"})},Hs.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(n){const i=Object.assign({},this.opts.query);i.EIO=jv,i.transport=n,this.id&&(i.sid=this.id);const s=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[n]);return new this._transportsByName[n](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const n=this.opts.rememberUpgrade&&Yr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(n);i.open(),this.setTransport(i)}setTransport(n){this.transport&&this.transport.removeAllListeners(),this.transport=n,n.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",Yr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",n),this.emitReserved("heartbeat"),n.type){case"open":this.onHandshake(JSON.parse(n.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=n.data,this._onError(i);break;case"message":this.emitReserved("data",n.data),this.emitReserved("message",n.data);break}}onHandshake(n){this.emitReserved("handshake",n),this.id=n.sid,this.transport.query.sid=n.sid,this._pingInterval=n.pingInterval,this._pingTimeout=n.pingTimeout,this._maxPayload=n.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const n=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+n,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},n),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 n=this._getWritablePackets();this.transport.send(n),this._prevBufferLen=n.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let s=0;s<this.writeBuffer.length;s++){const l=this.writeBuffer[s].data;if(l&&(i+=dR(l)),s>0&&i>this._maxPayload)return this.writeBuffer.slice(0,s);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const n=Date.now()>this._pingTimeoutTime;return n&&(this._pingTimeoutTime=0,fa(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),n}write(n,i,s){return this._sendPacket("message",n,i,s),this}send(n,i,s){return this._sendPacket("message",n,i,s),this}_sendPacket(n,i,s,l){if(typeof i=="function"&&(l=i,i=void 0),typeof s=="function"&&(l=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const u={type:n,data:i,options:s};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),l&&this.once("flush",l),this.flush()}close(){const n=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),n()},s=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():n()}):this.upgrading?s():n()),this}_onError(n){if(Yr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",n),this._onClose("transport error",n)}_onClose(n,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(),Pc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Hs.indexOf(this._offlineEventListener);s!==-1&&Hs.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",n,i),this.writeBuffer=[],this._prevBufferLen=0}}}Yr.protocol=jv;class AR extends Yr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let n=0;n<this._upgrades.length;n++)this._probe(this._upgrades[n])}_probe(n){let i=this.createTransport(n),s=!1;Yr.priorWebsocketSuccess=!1;const l=()=>{s||(i.send([{type:"ping",data:"probe"}]),i.once("packet",w=>{if(!s)if(w.type==="pong"&&w.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;Yr.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(y(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=i.name,this.emitReserved("upgradeError",m)}}))};function u(){s||(s=!0,y(),i.close(),i=null)}const d=w=>{const m=new Error("probe error: "+w);m.transport=i.name,u(),this.emitReserved("upgradeError",m)};function h(){d("transport closed")}function p(){d("socket closed")}function E(w){i&&w.name!==i.name&&u()}const y=()=>{i.removeListener("open",l),i.removeListener("error",d),i.removeListener("close",h),this.off("close",p),this.off("upgrading",E)};i.once("open",l),i.once("error",d),i.once("close",h),this.once("close",p),this.once("upgrading",E),this._upgrades.indexOf("webtransport")!==-1&&n!=="webtransport"?this.setTimeoutFn(()=>{s||i.open()},200):i.open()}onHandshake(n){this._upgrades=this._filterUpgrades(n.upgrades),super.onHandshake(n)}_filterUpgrades(n){const i=[];for(let s=0;s<n.length;s++)~this.transports.indexOf(n[s])&&i.push(n[s]);return i}}let IR=class extends AR{constructor(n,i={}){const s=typeof n=="object"?n:i;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(l=>CR[l]).filter(l=>!!l)),super(n,s)}};function PR(e,n="",i){let s=e;i=i||typeof location<"u"&&location,e==null&&(e=i.protocol+"//"+i.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=i.protocol+e:e=i.host+e),/^(https?|wss?):\/\//.test(e)||(typeof i<"u"?e=i.protocol+"//"+e:e="https://"+e),s=Ic(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const u=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+u+":"+s.port+n,s.href=s.protocol+"://"+u+(i&&i.port===s.port?"":":"+s.port),s}const DR=typeof ArrayBuffer=="function",MR=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,qv=Object.prototype.toString,FR=typeof Blob=="function"||typeof Blob<"u"&&qv.call(Blob)==="[object BlobConstructor]",LR=typeof File=="function"||typeof File<"u"&&qv.call(File)==="[object FileConstructor]";function Sf(e){return DR&&(e instanceof ArrayBuffer||MR(e))||FR&&e instanceof Blob||LR&&e instanceof File}function Gs(e,n){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let i=0,s=e.length;i<s;i++)if(Gs(e[i]))return!0;return!1}if(Sf(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Gs(e.toJSON(),!0);for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&Gs(e[i]))return!0;return!1}function BR(e){const n=[],i=e.data,s=e;return s.data=Dc(i,n),s.attachments=n.length,{packet:s,buffers:n}}function Dc(e,n){if(!e)return e;if(Sf(e)){const i={_placeholder:!0,num:n.length};return n.push(e),i}else if(Array.isArray(e)){const i=new Array(e.length);for(let s=0;s<e.length;s++)i[s]=Dc(e[s],n);return i}else if(typeof e=="object"&&!(e instanceof Date)){const i={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=Dc(e[s],n));return i}return e}function jR(e,n){return e.data=Mc(e.data,n),delete e.attachments,e}function Mc(e,n){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<n.length)return n[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i]=Mc(e[i],n);else if(typeof e=="object")for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(e[i]=Mc(e[i],n));return e}const zR=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],UR=5;var Ee;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ee||(Ee={}));class HR{constructor(n){this.replacer=n}encode(n){return(n.type===Ee.EVENT||n.type===Ee.ACK)&&Gs(n)?this.encodeAsBinary({type:n.type===Ee.EVENT?Ee.BINARY_EVENT:Ee.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id}):[this.encodeAsString(n)]}encodeAsString(n){let i=""+n.type;return(n.type===Ee.BINARY_EVENT||n.type===Ee.BINARY_ACK)&&(i+=n.attachments+"-"),n.nsp&&n.nsp!=="/"&&(i+=n.nsp+","),n.id!=null&&(i+=n.id),n.data!=null&&(i+=JSON.stringify(n.data,this.replacer)),i}encodeAsBinary(n){const i=BR(n),s=this.encodeAsString(i.packet),l=i.buffers;return l.unshift(s),l}}function Ug(e){return Object.prototype.toString.call(e)==="[object Object]"}class bf extends We{constructor(n){super(),this.reviver=n}add(n){let i;if(typeof n=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(n);const s=i.type===Ee.BINARY_EVENT;s||i.type===Ee.BINARY_ACK?(i.type=s?Ee.EVENT:Ee.ACK,this.reconstructor=new GR(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(Sf(n)||n.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(n),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: "+n)}decodeString(n){let i=0;const s={type:Number(n.charAt(0))};if(Ee[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===Ee.BINARY_EVENT||s.type===Ee.BINARY_ACK){const u=i+1;for(;n.charAt(++i)!=="-"&&i!=n.length;);const d=n.substring(u,i);if(d!=Number(d)||n.charAt(i)!=="-")throw new Error("Illegal attachments");s.attachments=Number(d)}if(n.charAt(i+1)==="/"){const u=i+1;for(;++i&&!(n.charAt(i)===","||i===n.length););s.nsp=n.substring(u,i)}else s.nsp="/";const l=n.charAt(i+1);if(l!==""&&Number(l)==l){const u=i+1;for(;++i;){const d=n.charAt(i);if(d==null||Number(d)!=d){--i;break}if(i===n.length)break}s.id=Number(n.substring(u,i+1))}if(n.charAt(++i)){const u=this.tryParse(n.substr(i));if(bf.isPayloadValid(s.type,u))s.data=u;else throw new Error("invalid payload")}return s}tryParse(n){try{return JSON.parse(n,this.reviver)}catch{return!1}}static isPayloadValid(n,i){switch(n){case Ee.CONNECT:return Ug(i);case Ee.DISCONNECT:return i===void 0;case Ee.CONNECT_ERROR:return typeof i=="string"||Ug(i);case Ee.EVENT:case Ee.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&zR.indexOf(i[0])===-1);case Ee.ACK:case Ee.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class GR{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){const i=jR(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const $R=Object.freeze(Object.defineProperty({__proto__:null,Decoder:bf,Encoder:HR,get PacketType(){return Ee},protocol:UR},Symbol.toStringTag,{value:"Module"}));function tr(e,n,i){return e.on(n,i),function(){e.off(n,i)}}const qR=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Vv extends We{constructor(n,i,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=n,this.nsp=i,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const n=this.io;this.subs=[tr(n,"open",this.onopen.bind(this)),tr(n,"packet",this.onpacket.bind(this)),tr(n,"error",this.onerror.bind(this)),tr(n,"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(...n){return n.unshift("message"),this.emit.apply(this,n),this}emit(n,...i){var s,l,u;if(qR.hasOwnProperty(n))throw new Error('"'+n.toString()+'" is a reserved event name');if(i.unshift(n),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const d={type:Ee.EVENT,data:i};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const y=this.ids++,w=i.pop();this._registerAckCallback(y,w),d.id=y}const h=(l=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||l===void 0?void 0:l.writable,p=this.connected&&!(!((u=this.io.engine)===null||u===void 0)&&u._hasPingExpired());return this.flags.volatile&&!h||(p?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d)),this.flags={},this}_registerAckCallback(n,i){var s;const l=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(l===void 0){this.acks[n]=i;return}const u=this.io.setTimeoutFn(()=>{delete this.acks[n];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===n&&this.sendBuffer.splice(h,1);i.call(this,new Error("operation has timed out"))},l),d=(...h)=>{this.io.clearTimeoutFn(u),i.apply(this,h)};d.withError=!0,this.acks[n]=d}emitWithAck(n,...i){return new Promise((s,l)=>{const u=(d,h)=>d?l(d):s(h);u.withError=!0,i.push(u),this.emit(n,...i)})}_addToQueue(n){let i;typeof n[n.length-1]=="function"&&(i=n.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:n,flags:Object.assign({fromQueue:!0},this.flags)};n.push((l,...u)=>s!==this._queue[0]?void 0:(l!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(l)):(this._queue.shift(),i&&i(null,...u)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(n=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!n||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(n){n.nsp=this.nsp,this.io._packet(n)}onopen(){typeof this.auth=="function"?this.auth(n=>{this._sendConnectPacket(n)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(n){this.packet({type:Ee.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},n):n})}onerror(n){this.connected||this.emitReserved("connect_error",n)}onclose(n,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",n,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(n=>{if(!this.sendBuffer.some(s=>String(s.id)===n)){const s=this.acks[n];delete this.acks[n],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(n){if(n.nsp===this.nsp)switch(n.type){case Ee.CONNECT:n.data&&n.data.sid?this.onconnect(n.data.sid,n.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 Ee.EVENT:case Ee.BINARY_EVENT:this.onevent(n);break;case Ee.ACK:case Ee.BINARY_ACK:this.onack(n);break;case Ee.DISCONNECT:this.ondisconnect();break;case Ee.CONNECT_ERROR:this.destroy();const s=new Error(n.data.message);s.data=n.data.data,this.emitReserved("connect_error",s);break}}onevent(n){const i=n.data||[];n.id!=null&&i.push(this.ack(n.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(n){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const s of i)s.apply(this,n)}super.emit.apply(this,n),this._pid&&n.length&&typeof n[n.length-1]=="string"&&(this._lastOffset=n[n.length-1])}ack(n){const i=this;let s=!1;return function(...l){s||(s=!0,i.packet({type:Ee.ACK,id:n,data:l}))}}onack(n){const i=this.acks[n.id];typeof i=="function"&&(delete this.acks[n.id],i.withError&&n.data.unshift(null),i.apply(this,n.data))}onconnect(n,i){this.id=n,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(n=>this.emitEvent(n)),this.receiveBuffer=[],this.sendBuffer.forEach(n=>{this.notifyOutgoingListeners(n),this.packet(n)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(n=>n()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ee.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}timeout(n){return this.flags.timeout=n,this}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){const i=this._anyListeners;for(let s=0;s<i.length;s++)if(n===i[s])return i.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){const i=this._anyOutgoingListeners;for(let s=0;s<i.length;s++)if(n===i[s])return i.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const s of i)s.apply(this,n.data)}}}function ti(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ti.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),i=Math.floor(n*this.jitter*e);e=Math.floor(n*10)&1?e+i:e-i}return Math.min(e,this.max)|0};ti.prototype.reset=function(){this.attempts=0};ti.prototype.setMin=function(e){this.ms=e};ti.prototype.setMax=function(e){this.max=e};ti.prototype.setJitter=function(e){this.jitter=e};class Fc extends We{constructor(n,i){var s;super(),this.nsps={},this.subs=[],n&&typeof n=="object"&&(i=n,n=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,da(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((s=i.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new ti({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=n;const l=i.parser||$R;this.encoder=new l.Encoder,this.decoder=new l.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(n){return arguments.length?(this._reconnection=!!n,n||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(n){return n===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=n,this)}reconnectionDelay(n){var i;return n===void 0?this._reconnectionDelay:(this._reconnectionDelay=n,(i=this.backoff)===null||i===void 0||i.setMin(n),this)}randomizationFactor(n){var i;return n===void 0?this._randomizationFactor:(this._randomizationFactor=n,(i=this.backoff)===null||i===void 0||i.setJitter(n),this)}reconnectionDelayMax(n){var i;return n===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=n,(i=this.backoff)===null||i===void 0||i.setMax(n),this)}timeout(n){return arguments.length?(this._timeout=n,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(n){if(~this._readyState.indexOf("open"))return this;this.engine=new IR(this.uri,this.opts);const i=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const l=tr(i,"open",function(){s.onopen(),n&&n()}),u=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),n?n(h):this.maybeReconnectOnOpen()},d=tr(i,"error",u);if(this._timeout!==!1){const h=this._timeout,p=this.setTimeoutFn(()=>{l(),u(new Error("timeout")),i.close()},h);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(l),this.subs.push(d),this}connect(n){return this.open(n)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const n=this.engine;this.subs.push(tr(n,"ping",this.onping.bind(this)),tr(n,"data",this.ondata.bind(this)),tr(n,"error",this.onerror.bind(this)),tr(n,"close",this.onclose.bind(this)),tr(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(n){try{this.decoder.add(n)}catch(i){this.onclose("parse error",i)}}ondecoded(n){fa(()=>{this.emitReserved("packet",n)},this.setTimeoutFn)}onerror(n){this.emitReserved("error",n)}socket(n,i){let s=this.nsps[n];return s?this._autoConnect&&!s.active&&s.connect():(s=new Vv(this,n,i),this.nsps[n]=s),s}_destroy(n){const i=Object.keys(this.nsps);for(const s of i)if(this.nsps[s].active)return;this._close()}_packet(n){const i=this.encoder.encode(n);for(let s=0;s<i.length;s++)this.engine.write(i[s],n.options)}cleanup(){this.subs.forEach(n=>n()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(n,i){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",n,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const n=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{n.skipReconnect||(this.emitReserved("reconnect_attempt",n.backoff.attempts),!n.skipReconnect&&n.open(l=>{l?(n._reconnecting=!1,n.reconnect(),this.emitReserved("reconnect_error",l)):n.onreconnect()}))},i);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const n=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",n)}}const Qi={};function $s(e,n){typeof e=="object"&&(n=e,e=void 0),n=n||{};const i=PR(e,n.path||"/socket.io"),s=i.source,l=i.id,u=i.path,d=Qi[l]&&u in Qi[l].nsps,h=n.forceNew||n["force new connection"]||n.multiplex===!1||d;let p;return h?p=new Fc(s,n):(Qi[l]||(Qi[l]=new Fc(s,n)),p=Qi[l]),i.query&&!n.query&&(n.query=i.queryKey),p.socket(i.path,n)}Object.assign($s,{Manager:Fc,Socket:Vv,io:$s,connect:$s});const VR=[ge.ActionTypes.MESSAGE_TO_GUEST,ge.ActionTypes.EVENT_TO_GUEST,ge.ActionTypes.TYPING_ON,ge.ActionTypes.TYPING_OFF,ge.ActionTypes.RESTART_CHAT_REQUEST,..._w,...db,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],WR=({dispatch:e,getState:n})=>i=>{let s=null;return l=>{const u=i(l);if(l.type===lf){s!=null&&s.disconnect(),e(bw());const d=`/chat?${Xc.stringify(l.querystrings)}`;s=$s(`/${l.clientName}${d}`),s.on("action",e),s.on("connect",()=>e(ww())),s.on("disconnect",()=>e(xw())),s.on("reconnect",()=>e(Tw())),s.on("set-use-start-screen",h=>{e(h?uw():cw())}),s.on("set-translations",(h,p)=>{e(Vk({language:h,messages:zk(h,p)}))}),s.on("enable-speech-support",()=>e(pb())),s.on("enable-transcript-export",h=>e(gb(h))),s.on("enable-conversation-rating",h=>e(Eb(h))),s.on("speech-transcription",h=>e(mb(h))),s.on("restore-client-state",h=>{e(Sw(h.sessionId)),e(bb(h.messages))}),s.on("expand-window",({devices:h})=>e({type:Dy,devices:h})),s.on("show-general-conditions",()=>e(vb())),s.on("restart-chat",()=>{e(pf(l.clientName,l.querystrings))})}else if(l.type===la)s==null||s.emit("start-chat",l.payload);else if(l.type===ua)s==null||s.emit("terminate-session",l.payload);else if(l.type===fb)s==null||s.emit("get-started",JSON.stringify(l));else if(l.type===Zc)s==null||s.emit("audio-message",l.buffer);else if(l.type===ge.ActionTypes.CONVERSATION_RATING_FROM_GUEST)s==null||s.emit("conversation-rating",l.payload);else if(l.type===My){const{connection:{sessionId:d}}=n();window.location.href=`/transcript-pdf/${d}`}else VR.indexOf(l.type)===-1&&l.meta===void 0&&s&&s.emit("action",JSON.stringify(l));return u}},Wv=by(),XR={...Qk(Wv),intl:Nv},Lc=Kb({middleware:e=>e().concat(WR),reducer:Xk,preloadedState:XR});Lc.subscribe(Pk(()=>{const e=Lc.getState();Kk(Wv,{connection:e.connection,startScreen:e.startScreen})},1e3));const QR=document.getElementById("root"),KR=e1.createRoot(QR);KR.render(R.jsx(Y1,{store:Lc,children:R.jsx(_k,{})}));
110
- //# sourceMappingURL=index-JobsCiR7.js.map
110
+ //# sourceMappingURL=index-BUGtSugl.js.map