@botfabrik/engine-webclient 4.94.1 → 4.94.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -103,7 +103,7 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
|
|
|
103
103
|
`).every(E=>(E+=`
|
|
104
104
|
`,!c.some(k=>k.test(E))&&(b+=E,!!E.trim())));const A=Ks(b);return A===""?null:[b,,A]}),i:3,u:dh,l:(S,x,b)=>d("p",{key:b.key},x(S.children,b))},22:{t:["["],o:ta(Rw),i:0,u:S=>(T[S[1]]={target:S[2],title:S[4]},{}),l:ph},23:{t:["!["],o:na(Cw),i:0,u:S=>({alt:S[1]||void 0,ref:S[2]}),l:(S,x,b)=>T[S.ref]?d("img",{key:b.key,alt:S.alt,src:s(T[S.ref].target,"img","src"),title:T[S.ref].title}):null},24:{t:["["],o:ta(Nw),i:0,u:(S,x,b)=>({children:x(S[1],b),fallbackChildren:S[0],ref:S[2]}),l:(S,x,b)=>T[S.ref]?d("a",{key:b.key,href:s(T[S.ref].target,"a","href"),title:T[S.ref].title},x(S.children,b)):d("span",{key:b.key},S.fallbackChildren)},25:{t:["|"],o:br(N_),i:1,u:tR,l(S,x,b){const A=S;return d("table",{key:b.key},d("thead",null,d("tr",null,A.header.map(function(E,k){return d("th",{key:k,style:L_(A,k)},x(E,b))}))),d("tbody",null,A.cells.map(function(E,k){return d("tr",{key:k},E.map(function(Z,ee){return d("td",{key:ee,style:L_(A,ee)},x(Z,b))}))})))}},27:{o:zs(qw),i:4,u(S){const x=S[0];return{text:x.indexOf("&")===-1?x:x.replace(bw,(b,A)=>r.namedCodesToUnicode[A]||b)}},l:S=>S.text},28:{t:["**","__"],o:na(Hw),i:2,u:(S,x,b)=>({children:x(S[2],b)}),l:(S,x,b)=>d("strong",{key:b.key},x(S.children,b))},29:{t:S=>{const x=S[0];return(x==="*"||x==="_")&&S[1]!==x},o:na(zw),i:3,u:(S,x,b)=>({children:x(S[2],b)}),l:(S,x,b)=>d("em",{key:b.key},x(S.children,b))},30:{t:["\\"],o:na(Gw),i:1,u:S=>({text:S[1],type:"27"})},31:{t:["=="],o:na(kw),i:3,u:dh,l:(S,x,b)=>d("mark",{key:b.key},x(S.children,b))},32:{t:["~~"],o:na(Iw),i:3,u:dh,l:(S,x,b)=>d("del",{key:b.key},x(S.children,b))}};r.disableParsingRawHTML===!0&&(delete O[11],delete O[13]);const L=function(S){var x=Object.keys(S);function b(A,E){var k=[];if(E.prevCapture=E.prevCapture||"",A.trim())for(;A;)for(var Z=0;Z<x.length;){var ee=x[Z],de=S[ee];if(!de.t||Jw(A,E,de.t)){var ie=de.o(A,E);if(ie&&ie[0]){E.prevCapture+=ie[0],A=A.substring(ie[0].length);var J=de.u(ie,b,E);J.type||(J.type=ee),k.push(J);break}Z++}else Z++}return E.prevCapture="",k}return x.sort(function(A,E){return S[A].i-S[E].i||(A<E?-1:1)}),function(A,E){return b(function(k){return k.replace(mw,`
|
|
105
105
|
`).replace(yw,"").replace(Dw," ")}(A),E)}}(O),M=(V=function(S,x){return function(b,A,E){const k=S[b.type].l;return x?x(()=>k(b,A,E),b,A,E):k(b,A,E)}}(O,r.renderRule),function S(x,b={}){if(Array.isArray(x)){const A=b.key,E=[];let k=!1;for(let Z=0;Z<x.length;Z++){b.key=Z;const ee=S(x[Z],b),de=typeof ee=="string";de&&k?E[E.length-1]+=ee:ee!==null&&E.push(ee),k=de}return b.key=A,E}return V(x,S,b)});var V;const I=m(n);return y.length?d("div",null,I,d("footer",{key:"footer"},y.map(function(S){return d("div",{id:i(S.identifier,Hs),key:S.identifier},S.identifier,M(L(S.footnote,{inline:!0})))}))):I}const Ar=n=>{let{children:r="",options:i}=n,s=function(u,c){if(u==null)return{};var h,d,m={},g=Object.keys(u);for(d=0;d<g.length;d++)c.indexOf(h=g[d])>=0||(m[h]=u[h]);return m}(n,tw);return H.cloneElement(lR(r,i),s)},oR="_generalConditionsContainer_55hjg_1",uR="_generalConditions_55hjg_1",cR="_generalConditionsHeader_55hjg_15",fR="_generalConditionsBody_55hjg_26",hR="_generalConditionsAccept_55hjg_35",ks={generalConditionsContainer:oR,generalConditions:uR,generalConditionsHeader:cR,generalConditionsBody:fR,generalConditionsAccept:hR},dR=()=>_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"})}),mR=()=>_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"})}),pR="general-conditions.header",gR="general-conditions.body",j_="general-conditions.accept-conditions-note",yR=()=>{const n=tt(),[r,i]=H.useState(!1),s=()=>i(!r),u=d=>{d.key==="ArrowDown"||d.key==="ArrowRight"?i(!0):d.key==="ArrowUp"||d.key==="ArrowLeft"||d.key==="Escape"?i(!1):(d.key==="Enter"||d.key==="Space"||d.key===" ")&&s()},c=n(pR),h=n(j_);return _.jsxs("div",{className:K(ks.generalConditionsContainer,"chat__generalConditions"),children:[!!c?.length&&_.jsxs("div",{className:ks.generalConditions,children:[_.jsxs("div",{role:"button",onClick:s,onKeyDown:u,tabIndex:0,className:K(ks.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":r?"true":"false","aria-pressed":r?"true":"false",children:[_.jsx(Ar,{children:c}),r?_.jsx(mR,{}):_.jsx(dR,{})]}),_.jsx("div",{className:K(ks.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:r&&_.jsx(Ar,{children:n(gR)||""})})]}),!!h?.length&&_.jsx("div",{className:K(ks.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:_.jsx(Ar,{children:n(j_)||""})})]})},_R="_message_6i1zm_1",vR="_messageBot_6i1zm_9",bR="_messageBotLast_6i1zm_19",ER="_avatar_6i1zm_19",SR="_messageBotFirst_6i1zm_24",TR="_messageBotAnimated_6i1zm_37",AR="_messageGuest_6i1zm_48",xR="_messageGuestFirst_6i1zm_54",OR="_messageGuestLast_6i1zm_60",wR="_botAvatar_6i1zm_74",RR="_agentAvatar_6i1zm_78",CR="_bubble_6i1zm_82",NR="_bubbleContent_6i1zm_88",MR="_bubbleLeft_6i1zm_102",DR="_leftText_6i1zm_113",BR="_bubbleRight_6i1zm_120",LR="_rightText_6i1zm_130",UR="_sourceInfoReference_6i1zm_162",jR="_sourceInfoReferenceActive_6i1zm_174",_e={message:_R,messageBot:vR,messageBotLast:bR,avatar:ER,messageBotFirst:SR,messageBotAnimated:TR,messageGuest:AR,messageGuestFirst:xR,messageGuestLast:OR,botAvatar:wR,agentAvatar:RR,bubble:CR,bubbleContent:NR,bubbleLeft:MR,leftText:DR,bubbleRight:BR,rightText:LR,sourceInfoReference:UR,sourceInfoReferenceActive:jR},HR="_botMessageActions_1dl7x_1",zR="_alwaysVisible_1dl7x_22",kR="_reported_1dl7x_29",IR="_action_1dl7x_33",ra={botMessageActions:HR,alwaysVisible:zR,reported:kR,action:IR},GR=({alwaysVisible:n,senderType:r,reaction:i,botMessageRef:s,onReaction:u})=>{const c=tt(),[h,d]=H.useState(!1),m=y=>()=>u(y),g=H.useCallback(async()=>{if(s.current)try{d(!0);const y=s.current.innerHTML,T=s.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([y],{type:"text/html"}),"text/plain":new Blob([T],{type:"text/plain"})})]),await new Promise(O=>setTimeout(O,1500))}finally{d(!1)}},[s]);return _.jsxs("div",{className:K(ra.botMessageActions,n&&ra.alwaysVisible,i&&ra.reported),children:[r===lu.BOT&&_.jsx("button",{className:K(ra.action,i==="GOOD"&&ra.reported,"tooltip--top-right"),tabIndex:0,"aria-label":c(i==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),"data-title":c(i==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),onClick:m(i==="GOOD"?null:"GOOD"),children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:i==="GOOD"?_.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"}):_.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===lu.BOT&&_.jsx("button",{className:K(ra.action,i==="BAD"&&ra.reported,"tooltip--top-right"),tabIndex:0,"aria-label":c(i==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),"data-title":c(i==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),onClick:m(i==="BAD"?null:"BAD"),children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:i==="BAD"?_.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"}):_.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"})})}),_.jsx("button",{className:K(ra.action,"tooltip--top-right"),tabIndex:0,"aria-label":c("bot-bubble.copy"),"data-title":c("bot-bubble.copy"),onClick:g,children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:h?_.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"}):_.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"})})})]})},u1=H.forwardRef(({message:n,isAnimated:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:u,children:c,onReaction:h},d)=>{const m=tt(),g=H.useRef(null),y=n.sender.type===we.UserType.BOT;return _.jsxs("li",{ref:d,className:K(_e.message,_e.messageBot,i&&_e.lastMessage,s&&_e.messageBotFirst,u&&_e.messageBotLast,"chat__bubbleContainer",r&&_e.messageBotAnimated,r&&"chat__bubbleContainer--animated",y?"chat__botBubbleContainer":"chat__agentBubbleContainer",s&&"chat__bubbleContainer--first",u&&"chat__bubbleContainer--last"),children:[_.jsx("img",{className:K(_e.avatar,y?_e.botAvatar:_e.agentAvatar,"chat__avatar",y?"chat__botAvatar":"chat__agentAvatar"),src:`${n.sender.avatar}`,alt:y?"Bot":"Agent",referrerPolicy:"no-referrer"}),_.jsx("div",{ref:g,className:K(_e.bubble,_e.bubbleLeft,"chat__bubble",y?"chat__botBubble":"chat__agentBubble"),tabIndex:0,"aria-label":m(y?"bot-bubble.label":"agent-bubble.label"),children:_.jsx("div",{className:K(_e.leftText),children:c})}),h&&_.jsx(GR,{alwaysVisible:i&&u,senderType:n.sender.type,reaction:n.reaction,botMessageRef:g,onReaction:h})]})}),qR="_sourceList_1n31h_1",FR="_source_1n31h_1",PR="_label_1n31h_37",yh={sourceList:qR,source:FR,label:PR},c1=n=>_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:_.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),f1=n=>_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:_.jsx("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z"})}),h1=n=>_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:_.jsx("path",{d:"M222,152a6,6,0,0,1-6,6H190v20h18a6,6,0,0,1,0,12H190v18a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6h32A6,6,0,0,1,222,152ZM90,172a26,26,0,0,1-26,26H54v10a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6H64A26,26,0,0,1,90,172Zm-12,0a14,14,0,0,0-14-14H54v28H64A14,14,0,0,0,78,172Zm84,8a34,34,0,0,1-34,34H112a6,6,0,0,1-6-6V152a6,6,0,0,1,6-6h16A34,34,0,0,1,162,180Zm-12,0a22,22,0,0,0-22-22H118v44h10A22,22,0,0,0,150,180ZM42,112V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88v24a6,6,0,0,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,0,1-12,0ZM158,82h35.52L158,46.48Z"})}),d1=n=>_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:_.jsx("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"})}),VR=({type:n,...r})=>{switch(n){case"WEBSITE":return _.jsx(d1,{...r});case"PDF":return _.jsx(h1,{...r});case"DOCX":return _.jsx(c1,{...r});default:return _.jsx(f1,{...r})}},tm=({sources:n,onLinkClick:r})=>{const i=tt(),s=c=>()=>{r(c.url)},u=c=>h=>{(h.key==="Enter"||h.key===" ")&&r(c.url)};return n.length?_.jsx("ul",{className:yh.sourceList,"aria-label":i("bot-bubble.sources"),children:n.map(c=>_.jsx("li",{className:yh.source,children:_.jsxs("a",{role:"button",tabIndex:0,"aria-label":`${i("bot-bubble.source.open")}: ${c.label}`,onClick:s(c),onKeyDown:u(c),children:[_.jsx(VR,{type:c.type,"aria-hidden":"true"}),_.jsx("div",{className:yh.label,children:c.label})]})},c.url))}):null},YR="_button_3ui4g_1",ZR="_buttonDefault_3ui4g_13",XR="_buttonPrimary_3ui4g_28",Js={button:YR,buttonDefault:ZR,buttonPrimary:XR},Su=({className:n,children:r,...i})=>_.jsx("button",{className:K(Js.button,n),type:"button",role:"button",...i,children:r}),QR="_title_b904h_1",KR="_subtitle_b904h_6",$R="_buttons_b904h_11",WR="_button_b904h_11",JR="_imageContainer_b904h_34",eC="_image_b904h_34",tC="_video_container_b904h_49",nC="_video_b904h_49",rC="_only_b904h_63",Xt={title:QR,subtitle:KR,buttons:$R,button:WR,imageContainer:JR,image:eC,video_container:tC,video:nC,only:rC},aC=({buttons:n,onButtonClick:r})=>_.jsx("div",{className:K(Xt.buttons,"chat__bubbleButtons"),children:n.map((i,s)=>_.jsx(Su,{className:K(Xt.button,"chat__bubbleButton"),onClick:()=>r(i),children:i.title},s))});var jo={},Ho={},zo={},H_;function iC(){if(H_)return zo;H_=1,Object.defineProperty(zo,"__esModule",{value:!0});var n=Ri(),r=i(n);function i(s){if(s&&s.__esModule)return s;var u={};if(s!=null)for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(u[c]=s[c]);return u.default=s,u}return zo.default=function(s,u,c){return r.createElement("a",{href:s,key:c},u)},zo}var ko={},z_;function sC(){return z_||(z_=1,Object.defineProperty(ko,"__esModule",{value:!0}),ko.default=function(n){return n}),ko}var Io={},_h,k_;function lC(){return k_||(k_=1,_h=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),_h}var vh,I_;function oC(){return I_||(I_=1,vh=/[\0-\x1F\x7F-\x9F]/),vh}var bh,G_;function uC(){return G_||(G_=1,bh=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),bh}var Eh,q_;function cC(){return q_||(q_=1,Eh=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/),Eh}var Sh,F_;function fC(){return F_||(F_=1,Sh=function(n){var r={};r.src_Any=lC().source,r.src_Cc=oC().source,r.src_Z=uC().source,r.src_P=cC().source,r.src_ZPCc=[r.src_Z,r.src_P,r.src_Cc].join("|"),r.src_ZCc=[r.src_Z,r.src_Cc].join("|");var i="[><|]";return r.src_pseudo_letter="(?:(?!"+i+"|"+r.src_ZPCc+")"+r.src_Any+")",r.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",r.src_auth="(?:(?:(?!"+r.src_ZCc+"|[@/\\[\\]()]).)+@)?",r.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",r.src_host_terminator="(?=$|"+i+"|"+r.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+r.src_ZPCc+"))",r.src_path="(?:[/?#](?:(?!"+r.src_ZCc+"|"+i+`|[()[\\]{}.,"'?!\\-]).|\\[(?:(?!`+r.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+r.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+r.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+r.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+r.src_ZCc+"|[']).)+\\'|\\'(?="+r.src_pseudo_letter+"|[-]).|\\.{2,4}[a-zA-Z0-9%/]|\\.(?!"+r.src_ZCc+"|[.]).|"+(n&&n["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+r.src_ZCc+").|\\!(?!"+r.src_ZCc+"|[!]).|\\?(?!"+r.src_ZCc+"|[?]).)+|\\/)?",r.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',r.src_xn="xn--[a-z0-9\\-]{1,59}",r.src_domain_root="(?:"+r.src_xn+"|"+r.src_pseudo_letter+"{1,63})",r.src_domain="(?:"+r.src_xn+"|(?:"+r.src_pseudo_letter+")|(?:"+r.src_pseudo_letter+"(?:-|"+r.src_pseudo_letter+"){0,61}"+r.src_pseudo_letter+"))",r.src_host="(?:(?:(?:(?:"+r.src_domain+")\\.)*"+r.src_domain+"))",r.tpl_host_fuzzy="(?:"+r.src_ip4+"|(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%)))",r.tpl_host_no_ip_fuzzy="(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%))",r.src_host_strict=r.src_host+r.src_host_terminator,r.tpl_host_fuzzy_strict=r.tpl_host_fuzzy+r.src_host_terminator,r.src_host_port_strict=r.src_host+r.src_port+r.src_host_terminator,r.tpl_host_port_fuzzy_strict=r.tpl_host_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_port_no_ip_fuzzy_strict=r.tpl_host_no_ip_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+r.src_ZPCc+"|>|$))",r.tpl_email_fuzzy="(^|"+i+'|"|\\(|'+r.src_ZCc+")("+r.src_email_name+"@"+r.tpl_host_fuzzy_strict+")",r.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+r.src_ZPCc+"))((?![$+<=>^`||])"+r.tpl_host_port_fuzzy_strict+r.src_path+")",r.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+r.src_ZPCc+"))((?![$+<=>^`||])"+r.tpl_host_port_no_ip_fuzzy_strict+r.src_path+")",r}),Sh}var Th,P_;function hC(){if(P_)return Th;P_=1;function n(b){var A=Array.prototype.slice.call(arguments,1);return A.forEach(function(E){E&&Object.keys(E).forEach(function(k){b[k]=E[k]})}),b}function r(b){return Object.prototype.toString.call(b)}function i(b){return r(b)==="[object String]"}function s(b){return r(b)==="[object Object]"}function u(b){return r(b)==="[object RegExp]"}function c(b){return r(b)==="[object Function]"}function h(b){return b.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var d={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function m(b){return Object.keys(b||{}).reduce(function(A,E){return A||d.hasOwnProperty(E)},!1)}var g={"http:":{validate:function(b,A,E){var k=b.slice(A);return E.re.http||(E.re.http=new RegExp("^\\/\\/"+E.re.src_auth+E.re.src_host_port_strict+E.re.src_path,"i")),E.re.http.test(k)?k.match(E.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(b,A,E){var k=b.slice(A);return E.re.no_http||(E.re.no_http=new RegExp("^"+E.re.src_auth+"(?:localhost|(?:(?:"+E.re.src_domain+")\\.)+"+E.re.src_domain_root+")"+E.re.src_port+E.re.src_host_terminator+E.re.src_path,"i")),E.re.no_http.test(k)?A>=3&&b[A-3]===":"||A>=3&&b[A-3]==="/"?0:k.match(E.re.no_http)[0].length:0}},"mailto:":{validate:function(b,A,E){var k=b.slice(A);return E.re.mailto||(E.re.mailto=new RegExp("^"+E.re.src_email_name+"@"+E.re.src_host_strict,"i")),E.re.mailto.test(k)?k.match(E.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]",T="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function O(b){b.__index__=-1,b.__text_cache__=""}function L(b){return function(A,E){var k=A.slice(E);return b.test(k)?k.match(b)[0].length:0}}function M(){return function(b,A){A.normalize(b)}}function V(b){var A=b.re=fC()(b.__opts__),E=b.__tlds__.slice();b.onCompile(),b.__tlds_replaced__||E.push(y),E.push(A.src_xn),A.src_tlds=E.join("|");function k(ie){return ie.replace("%TLDS%",A.src_tlds)}A.email_fuzzy=RegExp(k(A.tpl_email_fuzzy),"i"),A.link_fuzzy=RegExp(k(A.tpl_link_fuzzy),"i"),A.link_no_ip_fuzzy=RegExp(k(A.tpl_link_no_ip_fuzzy),"i"),A.host_fuzzy_test=RegExp(k(A.tpl_host_fuzzy_test),"i");var Z=[];b.__compiled__={};function ee(ie,J){throw new Error('(LinkifyIt) Invalid schema "'+ie+'": '+J)}Object.keys(b.__schemas__).forEach(function(ie){var J=b.__schemas__[ie];if(J!==null){var oe={validate:null,link:null};if(b.__compiled__[ie]=oe,s(J)){u(J.validate)?oe.validate=L(J.validate):c(J.validate)?oe.validate=J.validate:ee(ie,J),c(J.normalize)?oe.normalize=J.normalize:J.normalize?ee(ie,J):oe.normalize=M();return}if(i(J)){Z.push(ie);return}ee(ie,J)}}),Z.forEach(function(ie){b.__compiled__[b.__schemas__[ie]]&&(b.__compiled__[ie].validate=b.__compiled__[b.__schemas__[ie]].validate,b.__compiled__[ie].normalize=b.__compiled__[b.__schemas__[ie]].normalize)}),b.__compiled__[""]={validate:null,normalize:M()};var de=Object.keys(b.__compiled__).filter(function(ie){return ie.length>0&&b.__compiled__[ie]}).map(h).join("|");b.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+A.src_ZPCc+"))("+de+")","i"),b.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+A.src_ZPCc+"))("+de+")","ig"),b.re.pretest=RegExp("("+b.re.schema_test.source+")|("+b.re.host_fuzzy_test.source+")|@","i"),O(b)}function I(b,A){var E=b.__index__,k=b.__last_index__,Z=b.__text_cache__.slice(E,k);this.schema=b.__schema__.toLowerCase(),this.index=E+A,this.lastIndex=k+A,this.raw=Z,this.text=Z,this.url=Z}function S(b,A){var E=new I(b,A);return b.__compiled__[E.schema].normalize(E,b),E}function x(b,A){if(!(this instanceof x))return new x(b,A);A||m(b)&&(A=b,b={}),this.__opts__=n({},d,A),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=n({},g,b),this.__compiled__={},this.__tlds__=T,this.__tlds_replaced__=!1,this.re={},V(this)}return x.prototype.add=function(A,E){return this.__schemas__[A]=E,V(this),this},x.prototype.set=function(A){return this.__opts__=n(this.__opts__,A),this},x.prototype.test=function(A){if(this.__text_cache__=A,this.__index__=-1,!A.length)return!1;var E,k,Z,ee,de,ie,J,oe,fe;if(this.re.schema_test.test(A)){for(J=this.re.schema_search,J.lastIndex=0;(E=J.exec(A))!==null;)if(ee=this.testSchemaAt(A,E[2],J.lastIndex),ee){this.__schema__=E[2],this.__index__=E.index+E[1].length,this.__last_index__=E.index+E[0].length+ee;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(oe=A.search(this.re.host_fuzzy_test),oe>=0&&(this.__index__<0||oe<this.__index__)&&(k=A.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(de=k.index+k[1].length,(this.__index__<0||de<this.__index__)&&(this.__schema__="",this.__index__=de,this.__last_index__=k.index+k[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(fe=A.indexOf("@"),fe>=0&&(Z=A.match(this.re.email_fuzzy))!==null&&(de=Z.index+Z[1].length,ie=Z.index+Z[0].length,(this.__index__<0||de<this.__index__||de===this.__index__&&ie>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=de,this.__last_index__=ie))),this.__index__>=0},x.prototype.pretest=function(A){return this.re.pretest.test(A)},x.prototype.testSchemaAt=function(A,E,k){return this.__compiled__[E.toLowerCase()]?this.__compiled__[E.toLowerCase()].validate(A,k,this):0},x.prototype.match=function(A){var E=0,k=[];this.__index__>=0&&this.__text_cache__===A&&(k.push(S(this,E)),E=this.__last_index__);for(var Z=E?A.slice(E):A;this.test(Z);)k.push(S(this,E)),Z=Z.slice(this.__last_index__),E+=this.__last_index__;return k.length?k:null},x.prototype.tlds=function(A,E){return A=Array.isArray(A)?A:[A],E?(this.__tlds__=this.__tlds__.concat(A).sort().filter(function(k,Z,ee){return k!==ee[Z-1]}).reverse(),V(this),this):(this.__tlds__=A.slice(),this.__tlds_replaced__=!0,V(this),this)},x.prototype.normalize=function(A){A.schema||(A.url="http://"+A.url),A.schema==="mailto:"&&!/^mailto:/i.test(A.url)&&(A.url="mailto:"+A.url)},x.prototype.onCompile=function(){},Th=x,Th}const dC=JSON.parse('["aaa","aarp","abb","abbott","abbvie","abc","able","abogado","abudhabi","ac","academy","accenture","accountant","accountants","aco","actor","ad","ads","adult","ae","aeg","aero","aetna","af","afl","africa","ag","agakhan","agency","ai","aig","airbus","airforce","airtel","akdn","al","alibaba","alipay","allfinanz","allstate","ally","alsace","alstom","am","amazon","americanexpress","americanfamily","amex","amfam","amica","amsterdam","analytics","android","anquan","anz","ao","aol","apartments","app","apple","aq","aquarelle","ar","arab","aramco","archi","army","arpa","art","arte","as","asda","asia","associates","at","athleta","attorney","au","auction","audi","audible","audio","auspost","author","auto","autos","aw","aws","ax","axa","az","azure","ba","baby","baidu","banamex","band","bank","bar","barcelona","barclaycard","barclays","barefoot","bargains","baseball","basketball","bauhaus","bayern","bb","bbc","bbt","bbva","bcg","bcn","bd","be","beats","beauty","beer","bentley","berlin","best","bestbuy","bet","bf","bg","bh","bharti","bi","bible","bid","bike","bing","bingo","bio","biz","bj","black","blackfriday","blockbuster","blog","bloomberg","blue","bm","bms","bmw","bn","bnpparibas","bo","boats","boehringer","bofa","bom","bond","boo","book","booking","bosch","bostik","boston","bot","boutique","box","br","bradesco","bridgestone","broadway","broker","brother","brussels","bs","bt","build","builders","business","buy","buzz","bv","bw","by","bz","bzh","ca","cab","cafe","cal","call","calvinklein","cam","camera","camp","canon","capetown","capital","capitalone","car","caravan","cards","care","career","careers","cars","casa","case","cash","casino","cat","catering","catholic","cba","cbn","cbre","cc","cd","center","ceo","cern","cf","cfa","cfd","cg","ch","chanel","channel","charity","chase","chat","cheap","chintai","christmas","chrome","church","ci","cipriani","circle","cisco","citadel","citi","citic","city","ck","cl","claims","cleaning","click","clinic","clinique","clothing","cloud","club","clubmed","cm","cn","co","coach","codes","coffee","college","cologne","com","commbank","community","company","compare","computer","comsec","condos","construction","consulting","contact","contractors","cooking","cool","coop","corsica","country","coupon","coupons","courses","cpa","cr","credit","creditcard","creditunion","cricket","crown","crs","cruise","cruises","cu","cuisinella","cv","cw","cx","cy","cymru","cyou","cz","dad","dance","data","date","dating","datsun","day","dclk","dds","de","deal","dealer","deals","degree","delivery","dell","deloitte","delta","democrat","dental","dentist","desi","design","dev","dhl","diamonds","diet","digital","direct","directory","discount","discover","dish","diy","dj","dk","dm","dnp","do","docs","doctor","dog","domains","dot","download","drive","dtv","dubai","dunlop","dupont","durban","dvag","dvr","dz","earth","eat","ec","eco","edeka","edu","education","ee","eg","email","emerck","energy","engineer","engineering","enterprises","epson","equipment","er","ericsson","erni","es","esq","estate","et","eu","eurovision","eus","events","exchange","expert","exposed","express","extraspace","fage","fail","fairwinds","faith","family","fan","fans","farm","farmers","fashion","fast","fedex","feedback","ferrari","ferrero","fi","fidelity","fido","film","final","finance","financial","fire","firestone","firmdale","fish","fishing","fit","fitness","fj","fk","flickr","flights","flir","florist","flowers","fly","fm","fo","foo","food","football","ford","forex","forsale","forum","foundation","fox","fr","free","fresenius","frl","frogans","frontier","ftr","fujitsu","fun","fund","furniture","futbol","fyi","ga","gal","gallery","gallo","gallup","game","games","gap","garden","gay","gb","gbiz","gd","gdn","ge","gea","gent","genting","george","gf","gg","ggee","gh","gi","gift","gifts","gives","giving","gl","glass","gle","global","globo","gm","gmail","gmbh","gmo","gmx","gn","godaddy","gold","goldpoint","golf","goo","goodyear","goog","google","gop","got","gov","gp","gq","gr","grainger","graphics","gratis","green","gripe","grocery","group","gs","gt","gu","gucci","guge","guide","guitars","guru","gw","gy","hair","hamburg","hangout","haus","hbo","hdfc","hdfcbank","health","healthcare","help","helsinki","here","hermes","hiphop","hisamitsu","hitachi","hiv","hk","hkt","hm","hn","hockey","holdings","holiday","homedepot","homegoods","homes","homesense","honda","horse","hospital","host","hosting","hot","hotels","hotmail","house","how","hr","hsbc","ht","hu","hughes","hyatt","hyundai","ibm","icbc","ice","icu","id","ie","ieee","ifm","ikano","il","im","imamat","imdb","immo","immobilien","in","inc","industries","infiniti","info","ing","ink","institute","insurance","insure","int","international","intuit","investments","io","ipiranga","iq","ir","irish","is","ismaili","ist","istanbul","it","itau","itv","jaguar","java","jcb","je","jeep","jetzt","jewelry","jio","jll","jm","jmp","jnj","jo","jobs","joburg","jot","joy","jp","jpmorgan","jprs","juegos","juniper","kaufen","kddi","ke","kerryhotels","kerryproperties","kfh","kg","kh","ki","kia","kids","kim","kindle","kitchen","kiwi","km","kn","koeln","komatsu","kosher","kp","kpmg","kpn","kr","krd","kred","kuokgroup","kw","ky","kyoto","kz","la","lacaixa","lamborghini","lamer","lancaster","land","landrover","lanxess","lasalle","lat","latino","latrobe","law","lawyer","lb","lc","lds","lease","leclerc","lefrak","legal","lego","lexus","lgbt","li","lidl","life","lifeinsurance","lifestyle","lighting","like","lilly","limited","limo","lincoln","link","live","living","lk","llc","llp","loan","loans","locker","locus","lol","london","lotte","lotto","love","lpl","lplfinancial","lr","ls","lt","ltd","ltda","lu","lundbeck","luxe","luxury","lv","ly","ma","madrid","maif","maison","makeup","man","management","mango","map","market","marketing","markets","marriott","marshalls","mattel","mba","mc","mckinsey","md","me","med","media","meet","melbourne","meme","memorial","men","menu","merckmsd","mg","mh","miami","microsoft","mil","mini","mint","mit","mitsubishi","mk","ml","mlb","mls","mm","mma","mn","mo","mobi","mobile","moda","moe","moi","mom","monash","money","monster","mormon","mortgage","moscow","moto","motorcycles","mov","movie","mp","mq","mr","ms","msd","mt","mtn","mtr","mu","museum","music","mv","mw","mx","my","mz","na","nab","nagoya","name","navy","nba","nc","ne","nec","net","netbank","netflix","network","neustar","new","news","next","nextdirect","nexus","nf","nfl","ng","ngo","nhk","ni","nico","nike","nikon","ninja","nissan","nissay","nl","no","nokia","norton","now","nowruz","nowtv","np","nr","nra","nrw","ntt","nu","nyc","nz","obi","observer","office","okinawa","olayan","olayangroup","ollo","om","omega","one","ong","onl","online","ooo","open","oracle","orange","org","organic","origins","osaka","otsuka","ott","ovh","pa","page","panasonic","paris","pars","partners","parts","party","pay","pccw","pe","pet","pf","pfizer","pg","ph","pharmacy","phd","philips","phone","photo","photography","photos","physio","pics","pictet","pictures","pid","pin","ping","pink","pioneer","pizza","pk","pl","place","play","playstation","plumbing","plus","pm","pn","pnc","pohl","poker","politie","porn","post","pr","pramerica","praxi","press","prime","pro","prod","productions","prof","progressive","promo","properties","property","protection","pru","prudential","ps","pt","pub","pw","pwc","py","qa","qpon","quebec","quest","racing","radio","re","read","realestate","realtor","realty","recipes","red","redstone","redumbrella","rehab","reise","reisen","reit","reliance","ren","rent","rentals","repair","report","republican","rest","restaurant","review","reviews","rexroth","rich","richardli","ricoh","ril","rio","rip","ro","rocks","rodeo","rogers","room","rs","rsvp","ru","rugby","ruhr","run","rw","rwe","ryukyu","sa","saarland","safe","safety","sakura","sale","salon","samsclub","samsung","sandvik","sandvikcoromant","sanofi","sap","sarl","sas","save","saxo","sb","sbi","sbs","sc","scb","schaeffler","schmidt","scholarships","school","schule","schwarz","science","scot","sd","se","search","seat","secure","security","seek","select","sener","services","seven","sew","sex","sexy","sfr","sg","sh","shangrila","sharp","shell","shia","shiksha","shoes","shop","shopping","shouji","show","si","silk","sina","singles","site","sj","sk","ski","skin","sky","skype","sl","sling","sm","smart","smile","sn","sncf","so","soccer","social","softbank","software","sohu","solar","solutions","song","sony","soy","spa","space","sport","spot","sr","srl","ss","st","stada","staples","star","statebank","statefarm","stc","stcgroup","stockholm","storage","store","stream","studio","study","style","su","sucks","supplies","supply","support","surf","surgery","suzuki","sv","swatch","swiss","sx","sy","sydney","systems","sz","tab","taipei","talk","taobao","target","tatamotors","tatar","tattoo","tax","taxi","tc","tci","td","tdk","team","tech","technology","tel","temasek","tennis","teva","tf","tg","th","thd","theater","theatre","tiaa","tickets","tienda","tips","tires","tirol","tj","tjmaxx","tjx","tk","tkmaxx","tl","tm","tmall","tn","to","today","tokyo","tools","top","toray","toshiba","total","tours","town","toyota","toys","tr","trade","trading","training","travel","travelers","travelersinsurance","trust","trv","tt","tube","tui","tunes","tushu","tv","tvs","tw","tz","ua","ubank","ubs","ug","uk","unicom","university","uno","uol","ups","us","uy","uz","va","vacations","vana","vanguard","vc","ve","vegas","ventures","verisign","vermögensberater","vermögensberatung","versicherung","vet","vg","vi","viajes","video","vig","viking","villas","vin","vip","virgin","visa","vision","viva","vivo","vlaanderen","vn","vodka","volvo","vote","voting","voto","voyage","vu","wales","walmart","walter","wang","wanggou","watch","watches","weather","weatherchannel","webcam","weber","website","wed","wedding","weibo","weir","wf","whoswho","wien","wiki","williamhill","win","windows","wine","winners","wme","wolterskluwer","woodside","work","works","world","wow","ws","wtc","wtf","xbox","xerox","xihuan","xin","xxx","xyz","yachts","yahoo","yamaxun","yandex","ye","yodobashi","yoga","yokohama","you","youtube","yt","yun","za","zappos","zara","zero","zip","zm","zone","zuerich","zw","ελ","ευ","бг","бел","дети","ею","католик","ком","мкд","мон","москва","онлайн","орг","рус","рф","сайт","срб","укр","қаз","հայ","ישראל","קום","ابوظبي","ارامكو","الاردن","البحرين","الجزائر","السعودية","العليان","المغرب","امارات","ایران","بارت","بازار","بيتك","بھارت","تونس","سودان","سورية","شبكة","عراق","عرب","عمان","فلسطين","قطر","كاثوليك","كوم","مصر","مليسيا","موريتانيا","موقع","همراه","پاکستان","ڀارت","कॉम","नेट","भारत","भारतम्","भारोत","संगठन","বাংলা","ভারত","ভাৰত","ਭਾਰਤ","ભારત","ଭାରତ","இந்தியா","இலங்கை","சிங்கப்பூர்","భారత్","ಭಾರತ","ഭാരതം","ලංකා","คอม","ไทย","ລາວ","გე","みんな","アマゾン","クラウド","グーグル","コム","ストア","セール","ファッション","ポイント","世界","中信","中国","中國","中文网","亚马逊","企业","佛山","信息","健康","八卦","公司","公益","台湾","台灣","商城","商店","商标","嘉里","嘉里大酒店","在线","大拿","天主教","娱乐","家電","广东","微博","慈善","我爱你","手机","招聘","政务","政府","新加坡","新闻","时尚","書籍","机构","淡马锡","游戏","澳門","点看","移动","组织机构","网址","网店","网站","网络","联通","谷歌","购物","通販","集团","電訊盈科","飞利浦","食品","餐厅","香格里拉","香港","닷넷","닷컴","삼성","한국"]');var V_;function mC(){if(V_)return Io;V_=1,Object.defineProperty(Io,"__esModule",{value:!0});var n=hC(),r=u(n),i=dC,s=u(i);function u(h){return h&&h.__esModule?h:{default:h}}var c=new r.default;return c.tlds(s.default),Io.default=function(h){return c.match(h)},Io}var Go={},Y_;function pC(){return Y_||(Y_=1,Object.defineProperty(Go,"__esModule",{value:!0}),Go.default=function(n){return n}),Go}var Z_;function gC(){if(Z_)return Ho;Z_=1,Object.defineProperty(Ho,"__esModule",{value:!0});var n=function(){function S(x,b){for(var A=0;A<b.length;A++){var E=b[A];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,b,A){return b&&S(x.prototype,b),A&&S(x,A),x}}(),r=Ri(),i=O(r),s=iC(),u=T(s),c=sC(),h=T(c),d=mC(),m=T(d),g=pC(),y=T(g);function T(S){return S&&S.__esModule?S:{default:S}}function O(S){if(S&&S.__esModule)return S;var x={};if(S!=null)for(var b in S)Object.prototype.hasOwnProperty.call(S,b)&&(x[b]=S[b]);return x.default=S,x}function L(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function M(S,x){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:S}function V(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(S,x):S.__proto__=x)}var I=function(S){V(x,S);function x(){return L(this,x),M(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return n(x,[{key:"parseString",value:function(A){var E=this;if(A==="")return A;var k=this.props.matchDecorator(A);if(!k)return A;var Z=[],ee=0;return k.forEach(function(de,ie){de.index>ee&&Z.push(A.substring(ee,de.index));var J=E.props.hrefDecorator(de.url),oe=E.props.textDecorator(de.text),fe=E.props.componentDecorator(J,oe,ie);Z.push(fe),ee=de.lastIndex}),A.length>ee&&Z.push(A.substring(ee)),Z.length===1?Z[0]:Z}},{key:"parse",value:function(A){var E=this,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof A=="string"?this.parseString(A):i.isValidElement(A)&&A.type!=="a"&&A.type!=="button"?i.cloneElement(A,{key:k},this.parse(A.props.children)):Array.isArray(A)?A.map(function(Z,ee){return E.parse(Z,ee)}):A}},{key:"render",value:function(){return i.createElement(i.Fragment,null,this.parse(this.props.children))}}]),x}(i.Component);return I.defaultProps={componentDecorator:u.default,hrefDecorator:h.default,matchDecorator:m.default,textDecorator:y.default},Ho.default=I,Ho}var X_;function yC(){if(X_)return jo;X_=1,Object.defineProperty(jo,"__esModule",{value:!0});var n=gC(),r=i(n);function i(s){return s&&s.__esModule?s:{default:s}}return jo.default=r.default,jo}var _C=yC();const vC=cu(_C),bC="_text_gp0s0_1",EC="_command_gp0s0_5",Q_={text:bC,command:EC},m1=({text:n,commands:r=[],onLinkClick:i})=>{const s=d=>m=>(m.preventDefault(),d&&i(d),!1),u=(d,m,g)=>_.jsx("a",{onClick:s(d),role:"button",children:m},g),c=r.find(d=>n.startsWith(`/${d}`)),h=c?n.slice(c.length+1):n;return _.jsxs("div",{children:[c&&_.jsxs("code",{className:Q_.command,children:["/",c]}),h.split(`
|
|
106
|
-
`).map((d,m)=>_.jsxs("span",{className:Q_.text,children:[_.jsx(vC,{componentDecorator:u,children:d}),_.jsx("br",{})]},m))]})},SC=({subtitle:n,onLinkClick:r})=>n?_.jsx("div",{className:Xt.subtitle,children:_.jsx(m1,{text:n,onLinkClick:r})}):null,K_="newtab#",p1=({markdown:n,markdownOptions:r={},onLinkClick:i})=>{const s=c=>h=>(h.preventDefault(),c&&i(c),!1),u=({title:c,href:h,children:d})=>h.indexOf(K_)===0?_.jsx("a",{href:h.slice(K_.length),title:c,target:"_blank",rel:"noopener noreferrer",children:d}):_.jsx("a",{onClick:s(h),title:c,href:h,children:d});return _.jsx(Ar,{options:{...r,overrides:{a:u}},children:n})},TC=({text:n,onLinkClick:r})=>n?_.jsx("div",{children:_.jsx(p1,{markdown:n,onLinkClick:r})}):null,AC=({title:n})=>n?_.jsx("h1",{className:Xt.title,children:n}):null,xC=({title:n,text:r,subtitle:i,buttons:s,onButtonClick:u,onLinkClick:c})=>n?.length||r?.length||i?.length||s?.length?_.jsxs("div",{className:K(_e.bubbleContent),children:[_.jsx(AC,{title:n}),_.jsx(TC,{text:r,onLinkClick:c}),_.jsx(SC,{subtitle:i,onLinkClick:c}),_.jsx(aC,{buttons:s,onButtonClick:u})]}):null,OC=({alt:n,imageUrl:r,itemUrl:i,hasBody:s})=>r?i?i.indexOf("youtube.com")>-1?_.jsx("div",{className:Xt.video_container,children:_.jsx("iframe",{className:K(Xt.video,{[Xt.only]:!s}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):_.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:_.jsx("div",{className:Xt.imageContainer,children:_.jsx("img",{className:K(Xt.image,{[Xt.only]:!s}),src:r,alt:n})})}):_.jsx("div",{className:Xt.imageContainer,children:_.jsx("img",{className:K(Xt.image,{[Xt.only]:!s}),src:r,alt:n})}):null,wC=({title:n,text:r,subtitle:i,imageUrl:s,itemUrl:u,buttons:c,sources:h,onButtonClick:d,onLinkClick:m})=>{const g=!!n?.length||!!r?.length||!!i?.length||!!c?.length;return _.jsxs("div",{className:K(Xt.detailMessage),children:[_.jsx(OC,{hasBody:g,imageUrl:s,itemUrl:u,alt:n||i}),g&&_.jsx(xC,{title:n,text:r,subtitle:i,buttons:c,onLinkClick:m,onButtonClick:d}),_.jsx(tm,{sources:h,onLinkClick:m})]})},RC=H.forwardRef(({isFirstMessageBySender:n,isLastMessageBySender:r,children:i},s)=>{const u=tt();return _.jsx("li",{ref:s,className:K(_e.message,_e.messageGuest,n&&_e.messageGuestFirst,r&&_e.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:_.jsx("div",{className:K(_e.bubble,_e.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":u("guest-bubble.label"),children:_.jsx("div",{className:K(_e.rightText),children:i})})})}),CC="_markdown_nw7vg_1",g1={markdown:CC},y1=()=>NC(window.location.pathname),NC=n=>{const r=n.split("/"),i=n.endsWith("/");return r[r.length-(i?2:1)]},nm=()=>H.useMemo(()=>y1(),[]),qo="source-info-reference",MC=({actionId:n,markdown:r,sources:i,onLinkClick:s})=>{const u=nm(),c=Ia(),h=DC(),d=Qt(y=>{const T=y.chat.sourceInfos;if(T?.type==="loaded"||T?.type==="loading")return T.chunkId}),m=y=>T=>{const O=T.key;(O==="ArrowDown"||O==="ArrowRight"||O==="Enter"||O===" "||O==="Space")&&(T.stopPropagation(),c(__(u,n,y)))},g=y=>()=>{c(__(u,n,y))};return H.useLayoutEffect(()=>{document.querySelectorAll(`.${qo}`).forEach(y=>{const T=y.previousSibling;T&&T.nodeType===Node.TEXT_NODE&&T.textContent?.endsWith(" ")&&T.textContent?.trim().length&&y.classList.add(`${qo}--before-space`);const O=y.nextSibling;O&&O.nodeType===Node.TEXT_NODE&&O.textContent?.startsWith(" ")&&O.textContent?.trim().length&&y.classList.add(`${qo}--after-space`)})},[r]),_.jsxs("div",{className:_e.bubbleContent,children:[_.jsx("div",{className:g1.markdown,children:_.jsx(p1,{markdown:r,onLinkClick:s,markdownOptions:{renderRule(y,T,O,L){if(T.type===nw.footnoteReference){const M=T.text===d;return _.jsx("span",{className:K(_e.sourceInfoReference,M&&_e.sourceInfoReferenceActive,qo),children:_.jsx("a",{type:"button",tabIndex:0,onClick:g(T.text),onKeyDown:m(T.text),children:h(T.text)})},L.key)}return y()}}})}),_.jsx(tm,{sources:i,onLinkClick:s})]})},DC=()=>{const n=[];return i=>{const s=n.indexOf(i);return s>-1?s+1:(n.push(i),n.length)}},BC=({text:n,commands:r,sources:i,onLinkClick:s})=>_.jsxs("div",{className:_e.bubbleContent,children:[_.jsx(m1,{text:n,commands:r,onLinkClick:s}),_.jsx(tm,{sources:i,onLinkClick:s})]}),LC=H.forwardRef(({message:n,commands:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:u,onReaction:c,onButtonClick:h,onLinkClick:d},m)=>{const g=UC(n._id,n,r,h,d);switch(n.sender.type){case we.UserType.GUEST:return _.jsx(RC,{ref:m,isFirstMessageBySender:s,isLastMessageBySender:u,children:g});default:{const y=T=>c(n._id,T);return _.jsx(u1,{ref:m,message:n,isAnimated:!1,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:u,onReaction:y,children:g})}}}),UC=(n,r,i,s,u)=>{switch(r.type){case we.MessageTypeEnum.TEXT:{const c=r;return _.jsx(BC,{text:c.text,commands:i,sources:r.sources||[],onLinkClick:u})}case we.MessageTypeEnum.DETAIL:{const c=r;return _.jsx(wC,{title:c.title,text:c.text,subtitle:c.subtitle,imageUrl:c.imageUrl,itemUrl:c.itemUrl,buttons:c.buttons,sources:r.sources||[],onButtonClick:s,onLinkClick:u})}case we.MessageTypeEnum.MARKDOWN:{const c=r;return _.jsx(MC,{actionId:n,markdown:c.markdown,sources:c.sources||[],onLinkClick:u})}}},jC=(n,r)=>n.message._id===r.message._id&&n.message.reaction===r.message.reaction&&n.isLastMessage===r.isLastMessage&&n.isFirstMessageBySender===r.isFirstMessageBySender&&n.isLastMessageBySender===r.isLastMessageBySender,HC=Gv.memo(LC,jC),zC="_ticontainer_xg0dn_1",kC="_tiblock_xg0dn_5",IC="_tidot_xg0dn_12",Is={ticontainer:zC,tiblock:kC,tidot:IC},GC=({isTyping:n=!1})=>_.jsx("div",{className:Is.ticontainer,children:_.jsx("div",{className:Is.tiblock,children:n?_.jsxs(_.Fragment,{children:[_.jsx("div",{className:K(Is.tidot,"chat__typingIndicator")}),_.jsx("div",{className:K(Is.tidot,"chat__typingIndicator")}),_.jsx("div",{className:K(Is.tidot,"chat__typingIndicator")})]}):null})}),qC=Object.assign({_id:"typing-indicator"},new we.TextMessage("",new we.BotUser)),FC=({messages:n,isBotTyping:r,commands:i,onTranscriptItemReaction:s,onButtonClick:u,onLinkClick:c})=>{const h=H.useRef(0),d=H.useRef(!0),m=H.useRef(null),g=H.useRef(null),y=H.useRef(null),T=Qt(M=>M.settings.enableGeneralConditions);H.useLayoutEffect(()=>{if(n.length&&m.current&&(h.current<n.length||r)){if(g.current){const M=g.current.offsetTop;m.current.scrollTop=M}else if(y.current){const M=y.current.offsetTop;m.current.scrollTop=M}d.current&&(d.current=!1),h.current=n.length}},[n,d,r]);let O;const L=n.length;return _.jsxs("div",{ref:m,className:K(b_.messageContainer,"chat__messageContainer"),style:{scrollBehavior:n.length&&d.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[T&&_.jsx(yR,{}),_.jsxs("ul",{className:b_.messages,children:[n.map((M,V)=>{const I=PC(M,O),S=VC(M,V,n,r);O=M.sender.type;const x=V+1===L,b=M._id||`added-${V}`;return _.jsx(HC,{ref:x?y:null,message:M,commands:i,isLastMessage:x,isFirstMessageBySender:I,isLastMessageBySender:S,onButtonClick:u,onLinkClick:c,onReaction:s},x&&!r?"last":b)}),r&&_.jsx(u1,{ref:g,message:qC,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:O!==we.UserType.BOT,isLastMessageBySender:!0,children:_.jsx(GC,{isTyping:!0})},"last")]})]})},PC=(n,r)=>!r||r!==n.sender.type,VC=(n,r,i,s)=>{const u=n.sender.type,c=i.length;return r+1===c?!(u===we.UserType.BOT&&s):u!==i.at(r+1)?.sender.type},YC="_bottomSheet_jp8dl_1",ZC="_bottomSheetOpen_jp8dl_15",XC="_bottomSheetClose_jp8dl_20",xr={bottomSheet:YC,bottomSheetOpen:ZC,bottomSheetClose:XC},QC="_container_xc2nx_1",$_={container:QC},KC=({contentUrl:n})=>{const r=Qt(c=>c.connection.sessionId),[i,s]=H.useState(!1);H.useEffect(()=>{s(c=>c||!!n)},[n]);const u=H.useMemo(()=>{if(n&&r){const c=new URL(n,document.baseURI);return c.searchParams.set("sessionId",r),c.toString()}else return},[n,r]);return _.jsx("div",{className:K($_.container,xr.bottomSheet,{[xr.bottomSheetOpen]:!!n,[xr.bottomSheetClose]:i&&!n}),children:u&&_.jsx("iframe",{title:"Drawer",src:u,className:$_.iframe})})},$C="_container_z787n_1",WC={container:$C},JC=({title:n,href:r,children:i})=>_.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),e6=()=>{const r=tt()("powered-by");return r&&r.length?_.jsx("div",{className:K(WC.container,"chat__poweredBy"),children:_.jsx(Ar,{options:{overrides:{a:JC}},children:r})}):null},t6=({className:n,children:r,...i})=>_.jsx(Su,{className:K(Js.buttonDefault,n),type:"button",...i,children:r}),ou=({className:n,children:r,...i})=>_.jsx(Su,{className:K(Js.buttonPrimary,n),...i,children:r}),n6="_container_h23mk_1",r6="_formContainer_h23mk_17",a6="_emailInput_h23mk_22",i6="_description_h23mk_52",s6="_actions_h23mk_57",l6="_validationError_h23mk_67",o6="_submitted_h23mk_74",Ma={container:n6,formContainer:r6,emailInput:a6,description:i6,actions:s6,validationError:l6,submitted:o6},u6=({visible:n,onEmailExport:r,onClose:i})=>{const s=tt(),[u,c]=H.useState(void 0),[h,d]=H.useState(!1),[m,g]=H.useState(void 0),y=H.useRef(null);H.useEffect(()=>{n?(y.current?.focus(),d(!1),c(n)):u===!0&&c(!1)},[n,u]);const T=L=>{L.preventDefault(),m&&m.length>0&&(r(m),d(!0),setTimeout(i,3*1e3))},O=L=>{const M=L.target.value.trim(),V=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(M);g(V?M:"")};return _.jsxs("div",{className:K(Ma.container,xr.bottomSheet,{[xr.bottomSheetOpen]:u===!0,[xr.bottomSheetClose]:u===!1}),children:[_.jsx("h2",{children:s("export-transcript.email.title")}),_.jsx(Ar,{className:Ma.description,children:s("export-transcript.email.description")||""}),_.jsxs("form",{onSubmit:T,className:Ma.formContainer,children:[_.jsxs("div",{children:[_.jsx("input",{disabled:h,ref:y,type:"email",placeholder:s("export-transcript.email.placeholder"),className:Ma.emailInput,onChange:O}),m?.length===0?_.jsx("div",{className:Ma.validationError,children:s("export-transcript.email.invalid")}):null]}),_.jsxs("div",{className:Ma.actions,children:[_.jsx(t6,{onClick:i,children:s("export-transcript.email.cancel")}),_.jsx(ou,{type:"submit",disabled:h||m===void 0||m.length===0,children:s("export-transcript.email.send")})]})]}),h&&_.jsx("div",{className:Ma.submitted,children:s("export-transcript.email.success")})]})},c6="_inputContainer_fi5ao_1",f6={inputContainer:c6},h6="_blockUserInput_pot9c_1",d6={blockUserInput:h6},m6=({visible:n})=>{const r=tt();return n?_.jsx("div",{className:K(d6.blockUserInput,"chat__blockUserInput"),children:r("block-user-input.title")}):null},p6="_commandsDropdown_5ytuv_1",g6="_commands_5ytuv_1",y6="_command_5ytuv_1",_6="_commandActive_5ytuv_46",v6="_commandsSelections_5ytuv_55",Xs={commandsDropdown:p6,commands:g6,command:y6,commandActive:_6,commandsSelections:v6},_1=(n,r)=>{H.useEffect(()=>{const i=s=>{n.current&&!n.current.contains(s.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,r])},b6=(n,r,i,s,u)=>{H.useEffect(()=>{const c=h=>{if(n.length)switch(h.key){case"Enter":i(n[r]);break;case"ArrowUp":s(d=>d>0?d-1:n.length-1);break;case"ArrowDown":s(d=>d<n.length-1?d+1:0);break;case"Escape":u([]);break}};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[n,r,i,s,u])},E6=({text:n,commands:r,onSelectCommand:i,onVisibilityChange:s})=>{const u=H.useRef(null),c=tt(),[h,d]=H.useState([]),[m,g]=H.useState(W_(r)),[y,T]=H.useState(0),O=L=>i(`/${L}`);return _1(u,()=>d([])),b6(h,y,O,T,d),H.useEffect(()=>{g(W_(r))},[r]),H.useEffect(()=>{const L=n.length||0;L===0||L>m||!n.startsWith("/")?d([]):d(r.filter(S6(n))),T(0)},[r,n,m]),H.useEffect(()=>{s(!!h.length)},[h,s]),h.length?_.jsx("div",{ref:u,className:Xs.commandsDropdown,children:_.jsx("ul",{id:"command-list",className:Xs.commands,role:"listbox",children:h.map((L,M)=>_.jsxs("li",{className:K([Xs.command,y===M&&Xs.commandActive]),role:"option",onClick:()=>O(L),onMouseOver:()=>T(M),children:[_.jsxs("h1",{children:["/",L]}),_.jsx("p",{children:c(`commands.${L}`)})]},L))})}):null},W_=n=>Math.max(...n.map(r=>r.length+1)),S6=n=>r=>{const i=`/${r}`;return i.startsWith(n)&&i.length>=n.length},J_=3,T6=({commands:n,onSelectCommand:r})=>{const i=tt(),[s,u]=H.useState(!1),c=g=>()=>{r(`/${g}`),u(!1)},h=()=>{u(!0)},d=()=>{u(!1)},m=s?n:n.slice(0,J_);return _.jsxs("div",{className:Xs.commandsSelections,children:[m.map(g=>_.jsxs("button",{className:"tooltip--top-center","aria-label":i(`commands.${g}`),"data-title":i(`commands.${g}`),tabIndex:0,onClick:c(g),children:["/",g]},g)),m.length<n.length?_.jsx("button",{"aria-label":i("commands.show-more.tooltip"),"data-title":i("commands.show-more.tooltip"),tabIndex:0,onClick:h,children:i("commands.show-more.action")},"show-more"):m.length>J_?_.jsx("button",{"aria-label":i("commands.show-less.tooltip"),"data-title":i("commands.show-less.tooltip"),tabIndex:0,onClick:d,children:i("commands.show-less.action")},"show-less"):null]})},A6="_callToActionContainer_1pojq_1",x6="_callToActionTitle_1pojq_23",O6="_rateOverlay_1pojq_30",w6="_body_1pojq_52",R6="_footer_1pojq_60",C6="_actions_1pojq_73",N6="_bubbles_1pojq_101",M6="_stars_1pojq_203",D6="_starsSmall_1pojq_217",B6="_starsLarge_1pojq_223",L6="_star_1pojq_203",U6="_starReadonly_1pojq_237",j6="_starIcon_1pojq_247",H6="_starsDescriptionContainer_1pojq_265",z6="_starsDescription_1pojq_265",Ht={callToActionContainer:A6,callToActionTitle:x6,rateOverlay:O6,body:w6,footer:R6,actions:C6,bubbles:N6,stars:M6,starsSmall:D6,starsLarge:B6,star:L6,starReadonly:U6,starIcon:j6,starsDescriptionContainer:H6,starsDescription:z6},k6=({value:n,index:r,count:i,readonly:s,onHover:u,onClick:c})=>{const h=d=>{c&&d.key==="Enter"&&c()};return _.jsx("li",{className:K(Ht.star,{[Ht.starReadonly]:s},"chat__conversationRating__star"),children:_.jsx("div",{role:"radio","aria-checked":n>r?"true":"false","aria-posinset":r+1,"aria-setsize":i,tabIndex:0,onMouseOver:u,onKeyDown:h,onClick:c,children:_.jsx("span",{role:"img","aria-label":"Star",className:K(Ht.starIcon),children:_.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:_.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"})})})})})},ev=5,v1=({value:n,size:r,readonly:i=!1,onChange:s})=>{const[u,c]=H.useState(void 0),h=()=>{c(void 0)},d=g=>()=>{if(!i){const y=g+1;c(y)}},m=g=>()=>{s&&!i&&(s(g===0&&n===1?0:g+1),c(void 0))};return _.jsx("ul",{tabIndex:0,role:"radiogroup",className:K(Ht.stars,{[Ht.starsSmall]:r==="small",[Ht.starsLarge]:r==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:r==="small",chat__conversationRating__stars__large:r==="large"}),onMouseOut:h,children:Array(ev).fill(0).map((g,y)=>_.jsx(k6,{value:u===void 0?n:u,index:y,count:ev,readonly:i,onHover:d(y),onClick:m(y)},y))})},I6=({visible:n,onRate:r})=>{const i=tt();return n?_.jsxs("div",{className:K(Ht.callToActionContainer,"chat__conversationRating__callToAction"),children:[_.jsx("div",{className:K(Ht.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),_.jsx(v1,{value:0,size:"small",onChange:r})]}):null},Ah=({isFirstMessageBySender:n,isLastMessageBySender:r,children:i})=>_.jsxs("div",{className:K(_e.message,_e.messageBot,n&&_e.messageBotFirst,r&&_e.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:[_.jsx("img",{className:K(_e.avatar,_e.botAvatar),src:"bot.svg",alt:"Bot"}),_.jsx("div",{className:K(_e.bubble,_e.bubbleLeft,"chat__bubble","chat__botBubble"),children:_.jsx("div",{className:K(_e.leftText,_e.bubbleContent),children:i})})]}),G6=({children:n})=>_.jsx("div",{className:K(_e.message,_e.messageGuest,_e.messageGuestFirst,_e.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:_.jsx("div",{className:K(_e.bubble,_e.bubbleRight,"chat__bubble","chat__guestBubble"),children:_.jsx("div",{className:K(_e.rightText,_e.bubbleContent),children:n})})}),q6=({visible:n,rating:r,onRate:i,onClose:s})=>{const u=tt(),[c,h]=H.useState(r),[d,m]=H.useState(void 0),[g,y]=H.useState(void 0),[T,O]=H.useState({submitted:!1,feedback:""}),[L,M]=H.useState(!1),V=H.useRef(null);H.useEffect(()=>{n?(O({submitted:!1,feedback:""}),y(n)):g===!0&&y(!1)},[n,g]),H.useEffect(()=>{h(r)},[r]),H.useEffect(()=>{const S=c>0?u(`conversation-rating.overlay.bot-message.rate-feedback.value-${c}`):void 0;m(S?.length?S:void 0)},[c,u]),H.useEffect(()=>{T.submitted?setTimeout(()=>M(!0),T.feedback.length?500:0):M(!1)},[T]);const I=S=>{S.preventDefault();const x=V.current?.value?.trim()||"";i(c,x),O({submitted:!0,feedback:x})};return _.jsx("div",{className:K(Ht.rateOverlay,xr.bottomSheet,"chat__conversationRating__overlay",{[xr.bottomSheetOpen]:g===!0,[xr.bottomSheetClose]:g===!1}),children:_.jsxs("form",{onSubmit:I,children:[_.jsxs("div",{className:K(Ht.body,"chat__conversationRating__overlay__body"),children:[_.jsx("div",{}),_.jsx("div",{className:K(Ht.bubbles),children:n&&d&&_.jsxs(_.Fragment,{children:[_.jsxs(Ah,{isFirstMessageBySender:!0,isLastMessageBySender:!1,children:[_.jsx("h2",{children:u("conversation-rating.overlay.title")}),_.jsxs("div",{className:K(Ht.starsDescriptionContainer),children:[_.jsx(v1,{value:c,size:"large",readonly:T.submitted,onChange:h}),_.jsxs("div",{className:K(Ht.starsDescription),children:[_.jsx("div",{children:u("conversation-rating.overlay.star.very-bad")}),_.jsx("div",{children:u("conversation-rating.overlay.star.very-good")})]})]})]}),_.jsx(Ah,{isFirstMessageBySender:!1,isLastMessageBySender:!L||!!T.feedback.length,children:_.jsx("div",{children:d})}),!!T.feedback.length&&_.jsx(G6,{children:T.feedback}),L&&_.jsx(Ah,{isFirstMessageBySender:!!T.feedback.length,isLastMessageBySender:!0,children:_.jsx("div",{children:u("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),_.jsxs("div",{className:K(Ht.footer,"chat__conversationRating__overlay__footer"),children:[!T.submitted&&_.jsx("input",{ref:V,placeholder:u("conversation-rating.overlay.guest-feedback.input-placeholder")}),_.jsx("div",{className:K(Ht.actions,"chat__conversationRating__overlay__footer__actions"),children:T.submitted?_.jsx(ou,{type:"button",onClick:s,children:u("conversation-rating.overlay.action.close")}):_.jsx(ou,{type:"submit",children:u("conversation-rating.overlay.action.submit")})})]})]})})},F6=({conversationRating:{enabled:n,rating:r},numberOfMessagesFromGuest:i,showRatingOverlay:s,setShowRatingOverlay:u,onRate:c})=>{const[h,d]=H.useState(0),m=T=>{d(T),u(!0)},g=()=>u(!1),y=!r&&i>=1;return n?_.jsxs(_.Fragment,{children:[_.jsx(I6,{visible:y,onRate:m}),_.jsx(q6,{visible:s,rating:h,onRate:c,onClose:g})]}):null},P6=H.memo(F6),V6="_inputWrapper_e3h44_1",Y6="_withOpenCommands_e3h44_14",Z6="_messageInputWrapper_e3h44_20",X6="_messageInput_e3h44_20",Q6="_buttons_e3h44_44",K6="_button_e3h44_44",Ai={inputWrapper:V6,withOpenCommands:Y6,messageInputWrapper:Z6,messageInput:X6,buttons:Q6,button:K6},$6="_audioRecorder_g845f_1",W6="_audioButton_g845f_6",J6="_recorderIcon_g845f_37",e3="_spinning_g845f_60",Da={audioRecorder:$6,audioButton:W6,recorderIcon:J6,spinning:e3},tv=2048,uu=16e3;class t3 extends Gv.Component{audioInput=null;volume=null;leftchannel=[];recorder=null;recordingLength=0;sampleRate=null;mediaStream=null;constructor(r){super(r),this.state={recordingState:"none"},this.triggerAudioRecording=this.triggerAudioRecording.bind(this),this.triggerAudioRecordingSuccess=this.triggerAudioRecordingSuccess.bind(this),this.initRecording=this.initRecording.bind(this),this.processRecordingInput=this.processRecordingInput.bind(this),this.handleClickSubmitAudio=this.handleClickSubmitAudio.bind(this),this.handleClickStopAudio=this.handleClickStopAudio.bind(this)}triggerAudioRecording(){this.setState({recordingState:"connecting"}),navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(this.triggerAudioRecordingSuccess)}triggerAudioRecordingSuccess(r){this.mediaStream=r,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(r)}initRecording(r){const i=window.AudioContext||window.webkitAudioContext,s=new i;this.sampleRate=s.sampleRate,this.volume=s.createGain(),this.audioInput=s.createMediaStreamSource(r),this.audioInput.connect(this.volume),this.recorder=s.createScriptProcessor(tv,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(s.destination)}processRecordingInput(r){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const i=r.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(i)),this.recordingLength+=tv}}handleClickSubmitAudio(){const r=r3(this.leftchannel,this.recordingLength),i=a3(r,this.sampleRate||0),s=n3(i);this.props.onAudioRecorded(s),this.handleClickStopAudio()}handleClickStopAudio(){this.setState({recordingState:"none"}),this.audioInput?.disconnect(),this.volume?.disconnect(),this.recorder?.disconnect(),this.mediaStream&&this.mediaStream?.getAudioTracks().forEach(r=>{r.stop()})}render(){return _.jsxs("div",{className:Da.audioRecorder,children:[this.state.recordingState==="none"&&_.jsx("button",{className:K(Da.audioButton,"chat__button"),type:"submit","aria-label":this.props.translate("message-input.actions.start-audio-recording.label"),"data-title":this.props.translate("message-input.actions.start-audio-recording.label"),tabIndex:0,onClick:this.triggerAudioRecording,children:_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.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"}),_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&_.jsxs("svg",{className:Da.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.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"}),_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&_.jsxs("div",{className:Da.audioRecorder,children:[_.jsx("button",{className:K(Da.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.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"}),_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),_.jsx("div",{className:Da.recorderIcon}),_.jsx("button",{className:K(Da.audioButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),_.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const n3=n=>{const r=new ArrayBuffer(44+n.length*2),i=new DataView(r);Fo(i,0,"RIFF"),i.setUint32(4,44+n.length*2,!0),Fo(i,8,"WAVE"),Fo(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,uu,!0),i.setUint32(28,uu*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),Fo(i,36,"data"),i.setUint32(40,n.length*2,!0);const s=n.length;let u=44;const c=1;for(let h=0;h<s;h++)i.setInt16(u,n[h]*(32767*c),!0),u+=2;return new Blob([i],{type:"audio/wav"})},Fo=(n,r,i)=>{for(let s=0;s<i.length;s++)n.setUint8(r+s,i.charCodeAt(s))},r3=(n,r)=>{const i=new Float32Array(r);let s=0;const u=n.length;for(let c=0;c<u;c++){const h=n[c];i.set(h,s),s+=h.length}return i},a3=(n,r)=>{if(uu===r)return n;const i=r/uu,s=Math.round(n.length/i),u=new Float32Array(s);let c=0,h=0;for(;c<u.length;){const d=Math.round((c+1)*i);let m=0,g=0;for(let y=h;y<d&&y<n.length;y++)m+=n[y],g++;u[c]=m/g,c++,h=d}return u},i3=({disabled:n,textInput:r,commandsVisible:i,hasCommands:s,onTextInput:u,onTextInputSubmit:c,onAudioRecorded:h})=>{const d=tt(),m=H.useRef(null),{enableSpeechSupport:g}=Qt(M=>M.settings);H.useEffect(()=>{m.current?.focus()},[r]);const y=()=>{const M=m.current;M&&r.trim().length>=1&&c(r.trim())&&(M.value="",M.style.height="",M.focus())},T=M=>{M.preventDefault(),y()},O=M=>{const V=M.target.value;u(V),M.target.style.height="";const{scrollHeight:I}=M.target;M.target.style.height=`${I>150?150:I}px`},L=M=>{M.code==="Enter"&&!M.shiftKey?(M.repeat||y(),M.preventDefault()):i&&(M.code==="ArrowUp"||M.code==="ArrowDown")&&M.preventDefault()};return _.jsxs("form",{className:K(Ai.inputWrapper,i&&Ai.withOpenCommands,"chat__textInput"),onSubmit:T,children:[_.jsx("div",{className:Ai.messageInputWrapper,children:_.jsx("textarea",{id:"user_input",ref:m,className:Ai.messageInput,tabIndex:0,placeholder:d("message-input-placeholder"),value:r,onChange:O,onKeyDown:L,"aria-label":d("message-input-label"),"aria-controls":s?"command-list":void 0,"aria-haspopup":s?"listbox":void 0})}),_.jsx("div",{className:K(Ai.buttons,"chat__buttons"),children:r.length||!g||navigator.mediaDevices===void 0?_.jsx("button",{className:K(Ai.button,"chat__button"),type:"submit","aria-label":d("message-input.actions.submit.label"),"data-title":d("message-input.actions.submit.label"),tabIndex:0,disabled:n,children:_.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:_.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"})})}):g&&navigator.mediaDevices!==void 0&&_.jsx(t3,{translate:d,onAudioRecorded:h})})]})},s3="_quickReplies_83npe_1",l3="_quickReply_83npe_9",nv={quickReplies:s3,quickReply:l3},o3=({quickReplies:n,onQuickReplyClick:r})=>n.length?_.jsx("div",{className:K(nv.quickReplies,"chat__quickReplies"),children:n.map(i=>_.jsx(Su,{tabIndex:0,className:K(nv.quickReply,"chat__button","chat__quickReply"),onClick:()=>r(i),children:i.label},i.label))}):null,rv=5e3,u3=1e3,c3=({isBotTyping:n,quickReplies:r,conversationRating:i,numberOfMessagesFromGuest:s,showRatingOverlay:u,commands:c,setShowRatingOverlay:h,onTextInput:d,onRate:m,onQuickReplyClick:g,onAudioRecorded:y})=>{const[T,O]=H.useState(""),[L,M]=H.useState(!1),[V,I]=H.useState(!1),S=H.useRef(0),x=H.useRef(0);H.useEffect(()=>{if(L&&!n){const E=S.current?Date.now()-S.current:0;E>rv?M(!1):setTimeout(()=>{M(!1)},rv-E)}},[L,n]),H.useEffect(()=>{L&&(S.current=Date.now())},[L]);const b=E=>{const k=Date.now()-x.current<u3;return V?!1:n||k?(M(!0),!1):(d(E),O(""),x.current=Date.now(),!0)},A=E=>{O(E+" ")};return _.jsxs("div",{className:K(f6.inputContainer),children:[_.jsx(o3,{quickReplies:r,onQuickReplyClick:g}),_.jsx(m6,{visible:L}),!L&&_.jsx(P6,{conversationRating:i,numberOfMessagesFromGuest:s,onRate:m,showRatingOverlay:u,setShowRatingOverlay:h}),!!c?.length&&_.jsx(E6,{text:T,commands:c,onSelectCommand:A,onVisibilityChange:I}),_.jsx(i3,{textInput:T,disabled:L,commandsVisible:V,hasCommands:!!c?.length,onTextInput:O,onTextInputSubmit:b,onAudioRecorded:y}),!!c?.length&&_.jsx(T6,{commands:c,onSelectCommand:O})]})},f3=({clientName:n,messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u,conversationRating:c,onMessageFromUser:h,onRate:d,onQuickReplyClick:m,onButtonClick:g,onLinkClick:y,onAudioRecorded:T,onTranscriptExport:O,onTranscriptItemReaction:L})=>{const M=Ia(),V=Qt(Z=>Z.connection.connectionState),{enableTranscriptExportEmail:I,commands:S}=Qt(Z=>Z.settings),{showTranscriptMailOverlay:x}=Qt(Z=>Z.chat),[b,A]=H.useState(!1),E=r.filter(Z=>Z.sender.type===lu.GUEST).length;H.useEffect(()=>{if(V===ja.CONNECTED){const Z=du.parse(window.location.search);M(e1(n,Z))}},[n,V,M]);const k=()=>{M(Jb())};return _.jsxs("div",{className:ch.container,children:[_.jsxs("div",{className:K([ch.chatcontent,(x||b)&&ch.accessabilityHidden]),children:[_.jsx(FC,{messages:r,isBotTyping:s,commands:S,onButtonClick:g,onLinkClick:y,onTranscriptItemReaction:L}),_.jsx(c3,{isBotTyping:s,quickReplies:s?[]:i,numberOfMessagesFromGuest:E,conversationRating:c,showRatingOverlay:b,setShowRatingOverlay:A,commands:S,onRate:d,onQuickReplyClick:m,onTextInput:h,onAudioRecorded:T}),_.jsx(e6,{})]}),I&&_.jsx(u6,{visible:!!x,onEmailExport:O,onClose:k}),_.jsx(KC,{contentUrl:u})]})},h3=n=>{const{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u,conversationRating:c}=n.chat;return{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u,conversationRating:c}},d3=n=>({onRestartChat:(r,i)=>n(bu(r,i)),onMessageFromUser:r=>n(Nb(r)),onRate:(r,i)=>n(Yx(r,i)),onAudioRecorded:r=>n(Gx(r)),onActionFromUser:r=>n(r),onQuickReplyClick:r=>n(Cb(r)),onNluEvent:r=>n(Ub(r)),onButtonClick:r=>n(Xx(r)),onLinkClick:r=>n(jb(r)),onTranscriptExport:r=>n(Fx(r)),onTranscriptItemReaction:(r,i)=>n(we.Actions.transcriptItemGuestReaction(r,i||null))}),m3=oT(h3,d3)(f3),b1=()=>{const[n,r]=H.useState(!1);return H.useEffect(()=>{r((()=>{try{return window.self!==window.top}catch{return!0}})())},[]),n},p3=n=>r=>{const i=r.key;(i==="ArrowDown"||i==="ArrowRight"||i==="Enter"||i===" "||i==="Space")&&(r.stopPropagation(),n())},g3=({onClick:n})=>{const r=tt();return b1()?_.jsx("button",{className:"tooltip--bottom-left","aria-label":r("header.close-chat"),"data-title":r("header.close-chat"),tabIndex:0,onClick:n,onKeyDown:p3(n),children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"})})}):null},y3="_header_3gvbz_1",_3="_logoContainer_3gvbz_14",v3="_logo_3gvbz_14",b3="_actions_3gvbz_28",E3="_active_3gvbz_43",S3="_menuContainer_3gvbz_56",T3="_menu_3gvbz_56",A3="_divider_3gvbz_86",aa={header:y3,logoContainer:_3,logo:v3,actions:b3,active:E3,menuContainer:S3,menu:T3,divider:A3},x3=({icon:n})=>{switch(n){case"arrow-counter-clockwise":return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"})});case"download":return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"})});case"expand":return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"})});case"mail":return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"})});case"phone":return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M144.27,45.93a8,8,0,0,1,9.8-5.66,86.22,86.22,0,0,1,61.66,61.66,8,8,0,0,1-5.66,9.8A8.23,8.23,0,0,1,208,112a8,8,0,0,1-7.73-5.94,70.35,70.35,0,0,0-50.33-50.33A8,8,0,0,1,144.27,45.93Zm-2.33,41.8c13.79,3.68,22.65,12.54,26.33,26.33A8,8,0,0,0,176,120a8.23,8.23,0,0,0,2.07-.27,8,8,0,0,0,5.66-9.8c-5.12-19.16-18.5-32.54-37.66-37.66a8,8,0,1,0-4.13,15.46Zm81.94,95.35A56.26,56.26,0,0,1,168,232C88.6,232,24,167.4,24,88A56.26,56.26,0,0,1,72.92,32.12a16,16,0,0,1,16.62,9.52l21.12,47.15,0,.12A16,16,0,0,1,109.39,104c-.18.27-.37.52-.57.77L88,129.45c7.49,15.22,23.41,31,38.83,38.51l24.34-20.71a8.12,8.12,0,0,1,.75-.56,16,16,0,0,1,15.17-1.4l.13.06,47.11,21.11A16,16,0,0,1,223.88,183.08Zm-15.88-2s-.07,0-.11,0h0l-47-21.05-24.35,20.71a8.44,8.44,0,0,1-.74.56,16,16,0,0,1-15.75,1.14c-18.73-9.05-37.4-27.58-46.46-46.11a16,16,0,0,1,1-15.7,6.13,6.13,0,0,1,.57-.77L96,95.15l-21-47a.61.61,0,0,1,0-.12A40.2,40.2,0,0,0,40,88,128.14,128.14,0,0,0,168,216,40.21,40.21,0,0,0,208,181.07Z"})});case"scroll":return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M96,104a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H104A8,8,0,0,1,96,104Zm8,40h64a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16Zm128,48a32,32,0,0,1-32,32H88a32,32,0,0,1-32-32V64a16,16,0,0,0-32,0c0,5.74,4.83,9.62,4.88,9.66h0A8,8,0,0,1,24,88a7.89,7.89,0,0,1-4.79-1.61h0C18.05,85.54,8,77.61,8,64A32,32,0,0,1,40,32H176a32,32,0,0,1,32,32V168h8a8,8,0,0,1,4.8,1.6C222,170.46,232,178.39,232,192ZM96.26,173.48A8.07,8.07,0,0,1,104,168h88V64a16,16,0,0,0-16-16H67.69A31.71,31.71,0,0,1,72,64V192a16,16,0,0,0,32,0c0-5.74-4.83-9.62-4.88-9.66A7.82,7.82,0,0,1,96.26,173.48ZM216,192a12.58,12.58,0,0,0-3.23-8h-94a26.92,26.92,0,0,1,1.21,8,31.82,31.82,0,0,1-4.29,16H200A16,16,0,0,0,216,192Z"})});case"link":return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"})});default:return _.jsx("div",{})}},O3=H.forwardRef(({selected:n,item:r,onClick:i},s)=>{const u=tt(),c=h=>{h.preventDefault(),i()};return _.jsx("li",{"aria-selected":n,role:"option",className:r.withDivider?aa.divider:void 0,children:_.jsxs("a",{ref:s,type:"button",role:"button",tabIndex:-1,onClick:c,children:[_.jsx(x3,{icon:r.icon}),_.jsx("span",{children:u(`header.menu.${r.id}`)})]})})}),w3=n=>{const r=b1(),{menuItems:i,enableStandaloneView:s,enableTranscriptExportPdf:u,enableTranscriptExportEmail:c}=Qt(d=>d.settings);return H.useMemo(()=>{const d=[];if(n){d.push({id:"restart-chat",type:"restart-chat",icon:"arrow-counter-clockwise",visibility:"chat-only"}),r&&s&&d.push({id:"expand-chat-window",type:"expand-chat-window",icon:"expand",visibility:"always"}),u&&d.push({id:"download-transcript",type:"download-transcript",icon:"download",visibility:"chat-only"}),c&&d.push({id:"send-transcript",type:"send-transcript",icon:"mail",visibility:"chat-only"});const m=d.pop();m&&i.length&&d.push({...m,withDivider:!0})}return d.push(...i),d.filter(({visibility:m})=>n?m==="always"||m==="chat-only":m==="always"||m==="start-screen-only")},[n,u,c,s,r,i])},R3=({chatStarted:n})=>{const r=Ia(),i=nm(),s=tt(),[u,c]=H.useState(!1),[h,d]=H.useState(-1),m=H.useRef(null),g=H.useRef(null),y=H.useRef([]),T=w3(n);H.useEffect(()=>{y.current[h]?.focus()},[h]);const O=H.useCallback(()=>{const I=du.parse(window.location.search);r(bu(i,I)),c(!1),d(0)},[r,i]),L=H.useCallback(I=>{switch(I.type){case"restart-chat":O();break;case"expand-chat-window":window.open(window.location.href,"_blank");break;case"download-transcript":r(Px());break;case"send-transcript":r(Jb());break;case"link":r(jb(I.url));break;case"action":r(JSON.parse(JSON.stringify(I.action)));break}c(!1)},[r,O,c]);H.useEffect(()=>{const I=S=>{if(u)switch(S.key){case"Enter":S.preventDefault(),L(T[h]);break;case"ArrowUp":d(x=>x>0?x-1:T.length-1);break;case"ArrowDown":d(x=>x<T.length-1?x+1:0);break;case"Escape":c(!1);break;case"Tab":h>-1&&c(!1);break}};return document.addEventListener("keydown",I),()=>{document.removeEventListener("keydown",I)}},[u,h,T,d,c,L]),H.useEffect(()=>{u||d(-1)},[u,h]),_1(g,()=>c(!1));const M=()=>{c(I=>!I)},V=()=>{setTimeout(()=>{const I=document.activeElement;g.current&&!g.current.contains(I)&&c(!1)},0)};return _.jsxs("div",{className:K(aa.menuContainer),ref:g,children:[_.jsx("button",{ref:m,className:K(u&&aa.active,u?"tooltip-hidden":"tooltip--bottom-left"),"aria-label":s("header.menu.title"),"data-title":s("header.menu.title"),onClick:M,onBlur:V,children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"})})}),u&&_.jsx("nav",{className:aa.menu,"aria-label":s("header.menu.title"),children:_.jsx("ul",{tabIndex:0,children:T.map((I,S)=>_.jsx(O3,{ref:x=>{y.current[S]=x},selected:h===S,item:I,onClick:()=>L(I)},I.id))})})]})},av=({className:n,chatStarted:r,...i})=>{const s=Ia(),u=()=>{s(kO())};return _.jsxs("div",{className:K([aa.header,n]),...i,children:[_.jsx("div",{className:aa.logoContainer,children:_.jsx("div",{className:aa.logo})}),_.jsxs("div",{className:aa.actions,children:[_.jsx(R3,{chatStarted:r}),_.jsx(g3,{onClick:u})]})]})},C3="_chatwindow_rkbir_1",N3="_chatwindowWithAside_rkbir_21",iv={chatwindow:C3,chatwindowWithAside:N3},E1=()=>{const[n,r]=H.useState(!1);return H.useEffect(()=>{const i=window.matchMedia("(max-width: 1023px)"),s=()=>r(i.matches);return s(),i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[]),n},M3="_sourceInfos_vei0l_1",D3="_waitForLoading_vei0l_24",B3="_loadingContent_vei0l_28",L3="_sourceHeader_vei0l_37",U3="_sourceHeaderIcon_vei0l_57",j3="_sourceContent_vei0l_61",H3="_openSourceButton_vei0l_69",z3="_sourceButtonLabel_vei0l_79",k3="_closeSourceInfosButton_vei0l_101",I3="_loadingSourceInfos_vei0l_125",G3="_loading_vei0l_28",q3="_loadingError_vei0l_139",F3="_highlightLoadingInfo_vei0l_155",P3="_highlightLoadingInfoInnerContainer_vei0l_169",V3="_highlightLoadingInfoContent_vei0l_178",Y3="_highlightLoadingInfoCloseIcon_vei0l_198",Z3="_highlightLoader_vei0l_203",X3="_highlightLoaderLoading_vei0l_210",_t={sourceInfos:M3,waitForLoading:D3,loadingContent:B3,sourceHeader:L3,sourceHeaderIcon:U3,sourceContent:j3,openSourceButton:H3,sourceButtonLabel:z3,closeSourceInfosButton:k3,loadingSourceInfos:I3,loading:G3,loadingError:q3,highlightLoadingInfo:F3,highlightLoadingInfoInnerContainer:P3,highlightLoadingInfoContent:V3,highlightLoadingInfoCloseIcon:Y3,highlightLoader:Z3,highlightLoaderLoading:X3},Q3=({onClick:n})=>{const r=tt();return _.jsx("button",{className:K(_t.closeSourceInfosButton,"tooltip--bottom-left"),"aria-label":r("source-infos.close"),"data-title":r("source-infos.close"),tabIndex:0,onClick:n,children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})})},K3=H.forwardRef(({sourceInfos:n,onClose:r,...i},s)=>_.jsxs("div",{className:_t.sourceHeader,...i,ref:s,children:[_.jsx("div",{children:n?_.jsx("p",{id:"source-info-title",children:n.title}):_.jsx("p",{children:" "})}),_.jsx(Q3,{onClick:r})]})),$3=({loading:n})=>_.jsx("div",{className:_t.highlightLoader,children:n&&_.jsx("div",{className:_t.highlightLoaderLoading})});/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:S1,setPrototypeOf:sv,isFrozen:W3,getPrototypeOf:J3,getOwnPropertyDescriptor:eN}=Object;let{freeze:zt,seal:Sn,create:T1}=Object,{apply:yd,construct:_d}=typeof Reflect<"u"&&Reflect;zt||(zt=function(r){return r});Sn||(Sn=function(r){return r});yd||(yd=function(r,i,s){return r.apply(i,s)});_d||(_d=function(r,i){return new r(...i)});const Po=kt(Array.prototype.forEach),tN=kt(Array.prototype.lastIndexOf),lv=kt(Array.prototype.pop),Gs=kt(Array.prototype.push),nN=kt(Array.prototype.splice),Ko=kt(String.prototype.toLowerCase),xh=kt(String.prototype.toString),ov=kt(String.prototype.match),qs=kt(String.prototype.replace),rN=kt(String.prototype.indexOf),aN=kt(String.prototype.trim),jn=kt(Object.prototype.hasOwnProperty),Ut=kt(RegExp.prototype.test),Fs=iN(TypeError);function kt(n){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var i=arguments.length,s=new Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];return yd(n,r,s)}}function iN(n){return function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return _d(n,i)}}function Oe(n,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ko;sv&&sv(n,null);let s=r.length;for(;s--;){let u=r[s];if(typeof u=="string"){const c=i(u);c!==u&&(W3(r)||(r[s]=c),u=c)}n[u]=!0}return n}function sN(n){for(let r=0;r<n.length;r++)jn(n,r)||(n[r]=null);return n}function Er(n){const r=T1(null);for(const[i,s]of S1(n))jn(n,i)&&(Array.isArray(s)?r[i]=sN(s):s&&typeof s=="object"&&s.constructor===Object?r[i]=Er(s):r[i]=s);return r}function Ps(n,r){for(;n!==null;){const s=eN(n,r);if(s){if(s.get)return kt(s.get);if(typeof s.value=="function")return kt(s.value)}n=J3(n)}function i(){return null}return i}const uv=zt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Oh=zt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),wh=zt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),lN=zt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Rh=zt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),oN=zt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),cv=zt(["#text"]),fv=zt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ch=zt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),hv=zt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Vo=zt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),uN=Sn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),cN=Sn(/<%[\w\W]*|[\w\W]*%>/gm),fN=Sn(/\$\{[\w\W]*/gm),hN=Sn(/^data-[\-\w.\u00B7-\uFFFF]+$/),dN=Sn(/^aria-[\-\w]+$/),A1=Sn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),mN=Sn(/^(?:\w+script|data):/i),pN=Sn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),x1=Sn(/^html$/i),gN=Sn(/^[a-z][.\w]*(-[.\w]+)+$/i);var dv=Object.freeze({__proto__:null,ARIA_ATTR:dN,ATTR_WHITESPACE:pN,CUSTOM_ELEMENT:gN,DATA_ATTR:hN,DOCTYPE_NAME:x1,ERB_EXPR:cN,IS_ALLOWED_URI:A1,IS_SCRIPT_OR_DATA:mN,MUSTACHE_EXPR:uN,TMPLIT_EXPR:fN});const Vs={element:1,text:3,progressingInstruction:7,comment:8,document:9},yN=function(){return typeof window>"u"?null:window},_N=function(r,i){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let s=null;const u="data-tt-policy-suffix";i&&i.hasAttribute(u)&&(s=i.getAttribute(u));const c="dompurify"+(s?"#"+s:"");try{return r.createPolicy(c,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},mv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function O1(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yN();const r=ue=>O1(ue);if(r.version="3.2.6",r.removed=[],!n||!n.document||n.document.nodeType!==Vs.document||!n.Element)return r.isSupported=!1,r;let{document:i}=n;const s=i,u=s.currentScript,{DocumentFragment:c,HTMLTemplateElement:h,Node:d,Element:m,NodeFilter:g,NamedNodeMap:y=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:T,DOMParser:O,trustedTypes:L}=n,M=m.prototype,V=Ps(M,"cloneNode"),I=Ps(M,"remove"),S=Ps(M,"nextSibling"),x=Ps(M,"childNodes"),b=Ps(M,"parentNode");if(typeof h=="function"){const ue=i.createElement("template");ue.content&&ue.content.ownerDocument&&(i=ue.content.ownerDocument)}let A,E="";const{implementation:k,createNodeIterator:Z,createDocumentFragment:ee,getElementsByTagName:de}=i,{importNode:ie}=s;let J=mv();r.isSupported=typeof S1=="function"&&typeof b=="function"&&k&&k.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:oe,ERB_EXPR:fe,TMPLIT_EXPR:Ve,DATA_ATTR:be,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:ne,CUSTOM_ELEMENT:Te}=dv;let{IS_ALLOWED_URI:R}=dv,q=null;const W=Oe({},[...uv,...Oh,...wh,...Rh,...cv]);let X=null;const re=Oe({},[...fv,...Ch,...hv,...Vo]);let se=Object.seal(T1(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),he=null,$e=null,Ue=!0,vt=!0,kn=!1,Rr=!0,Xe=!1,It=!0,xn=!1,Mi=!1,Di=!1,bt=!1,Ga=!1,la=!1,Bi=!0,oa=!1;const xu="user-content-";let qa=!0,ua=!1,Cr={},fn=null;const Rt=Oe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let On=null;const Ct=Oe({},["audio","video","img","source","image","track"]);let Li=null;const al=Oe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fa="http://www.w3.org/1998/Math/MathML",er="http://www.w3.org/2000/svg",Gt="http://www.w3.org/1999/xhtml";let qt=Gt,Nr=!1,tr=null;const Ou=Oe({},[Fa,er,Gt],xh);let ca=Oe({},["mi","mo","mn","ms","mtext"]),fa=Oe({},["annotation-xml"]);const Ui=Oe({},["title","style","font","a","script"]);let wn=null;const wu=["application/xhtml+xml","text/html"],il="text/html";let nt=null,In=null;const ji=i.createElement("form"),Hi=function(N){return N instanceof RegExp||N instanceof Function},zi=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(In&&In===N)){if((!N||typeof N!="object")&&(N={}),N=Er(N),wn=wu.indexOf(N.PARSER_MEDIA_TYPE)===-1?il:N.PARSER_MEDIA_TYPE,nt=wn==="application/xhtml+xml"?xh:Ko,q=jn(N,"ALLOWED_TAGS")?Oe({},N.ALLOWED_TAGS,nt):W,X=jn(N,"ALLOWED_ATTR")?Oe({},N.ALLOWED_ATTR,nt):re,tr=jn(N,"ALLOWED_NAMESPACES")?Oe({},N.ALLOWED_NAMESPACES,xh):Ou,Li=jn(N,"ADD_URI_SAFE_ATTR")?Oe(Er(al),N.ADD_URI_SAFE_ATTR,nt):al,On=jn(N,"ADD_DATA_URI_TAGS")?Oe(Er(Ct),N.ADD_DATA_URI_TAGS,nt):Ct,fn=jn(N,"FORBID_CONTENTS")?Oe({},N.FORBID_CONTENTS,nt):Rt,he=jn(N,"FORBID_TAGS")?Oe({},N.FORBID_TAGS,nt):Er({}),$e=jn(N,"FORBID_ATTR")?Oe({},N.FORBID_ATTR,nt):Er({}),Cr=jn(N,"USE_PROFILES")?N.USE_PROFILES:!1,Ue=N.ALLOW_ARIA_ATTR!==!1,vt=N.ALLOW_DATA_ATTR!==!1,kn=N.ALLOW_UNKNOWN_PROTOCOLS||!1,Rr=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Xe=N.SAFE_FOR_TEMPLATES||!1,It=N.SAFE_FOR_XML!==!1,xn=N.WHOLE_DOCUMENT||!1,bt=N.RETURN_DOM||!1,Ga=N.RETURN_DOM_FRAGMENT||!1,la=N.RETURN_TRUSTED_TYPE||!1,Di=N.FORCE_BODY||!1,Bi=N.SANITIZE_DOM!==!1,oa=N.SANITIZE_NAMED_PROPS||!1,qa=N.KEEP_CONTENT!==!1,ua=N.IN_PLACE||!1,R=N.ALLOWED_URI_REGEXP||A1,qt=N.NAMESPACE||Gt,ca=N.MATHML_TEXT_INTEGRATION_POINTS||ca,fa=N.HTML_INTEGRATION_POINTS||fa,se=N.CUSTOM_ELEMENT_HANDLING||{},N.CUSTOM_ELEMENT_HANDLING&&Hi(N.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(se.tagNameCheck=N.CUSTOM_ELEMENT_HANDLING.tagNameCheck),N.CUSTOM_ELEMENT_HANDLING&&Hi(N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(se.attributeNameCheck=N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(se.allowCustomizedBuiltInElements=N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Xe&&(vt=!1),Ga&&(bt=!0),Cr&&(q=Oe({},cv),X=[],Cr.html===!0&&(Oe(q,uv),Oe(X,fv)),Cr.svg===!0&&(Oe(q,Oh),Oe(X,Ch),Oe(X,Vo)),Cr.svgFilters===!0&&(Oe(q,wh),Oe(X,Ch),Oe(X,Vo)),Cr.mathMl===!0&&(Oe(q,Rh),Oe(X,hv),Oe(X,Vo))),N.ADD_TAGS&&(q===W&&(q=Er(q)),Oe(q,N.ADD_TAGS,nt)),N.ADD_ATTR&&(X===re&&(X=Er(X)),Oe(X,N.ADD_ATTR,nt)),N.ADD_URI_SAFE_ATTR&&Oe(Li,N.ADD_URI_SAFE_ATTR,nt),N.FORBID_CONTENTS&&(fn===Rt&&(fn=Er(fn)),Oe(fn,N.FORBID_CONTENTS,nt)),qa&&(q["#text"]=!0),xn&&Oe(q,["html","head","body"]),q.table&&(Oe(q,["tbody"]),delete he.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw Fs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Fs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=N.TRUSTED_TYPES_POLICY,E=A.createHTML("")}else A===void 0&&(A=_N(L,u)),A!==null&&typeof E=="string"&&(E=A.createHTML(""));zt&&zt(N),In=N}},Rn=Oe({},[...Oh,...wh,...lN]),ft=Oe({},[...Rh,...oN]),Nt=function(N){let Q=b(N);(!Q||!Q.tagName)&&(Q={namespaceURI:qt,tagName:"template"});const te=Ko(N.tagName),Fe=Ko(Q.tagName);return tr[N.namespaceURI]?N.namespaceURI===er?Q.namespaceURI===Gt?te==="svg":Q.namespaceURI===Fa?te==="svg"&&(Fe==="annotation-xml"||ca[Fe]):!!Rn[te]:N.namespaceURI===Fa?Q.namespaceURI===Gt?te==="math":Q.namespaceURI===er?te==="math"&&fa[Fe]:!!ft[te]:N.namespaceURI===Gt?Q.namespaceURI===er&&!fa[Fe]||Q.namespaceURI===Fa&&!ca[Fe]?!1:!ft[te]&&(Ui[te]||!Rn[te]):!!(wn==="application/xhtml+xml"&&tr[N.namespaceURI]):!1},Et=function(N){Gs(r.removed,{element:N});try{b(N).removeChild(N)}catch{I(N)}},Gn=function(N,Q){try{Gs(r.removed,{attribute:Q.getAttributeNode(N),from:Q})}catch{Gs(r.removed,{attribute:null,from:Q})}if(Q.removeAttribute(N),N==="is")if(bt||Ga)try{Et(Q)}catch{}else try{Q.setAttribute(N,"")}catch{}},sl=function(N){let Q=null,te=null;if(Di)N="<remove></remove>"+N;else{const We=ov(N,/^[\r\n\t ]+/);te=We&&We[0]}wn==="application/xhtml+xml"&&qt===Gt&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");const Fe=A?A.createHTML(N):N;if(qt===Gt)try{Q=new O().parseFromString(Fe,wn)}catch{}if(!Q||!Q.documentElement){Q=k.createDocument(qt,"template",null);try{Q.documentElement.innerHTML=Nr?E:Fe}catch{}}const ht=Q.body||Q.documentElement;return N&&te&&ht.insertBefore(i.createTextNode(te),ht.childNodes[0]||null),qt===Gt?de.call(Q,xn?"html":"body")[0]:xn?Q.documentElement:ht},ll=function(N){return Z.call(N.ownerDocument||N,N,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Pa=function(N){return N instanceof T&&(typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||!(N.attributes instanceof y)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function")},Mr=function(N){return typeof d=="function"&&N instanceof d};function Kt(ue,N,Q){Po(ue,te=>{te.call(r,N,Q,In)})}const nr=function(N){let Q=null;if(Kt(J.beforeSanitizeElements,N,null),Pa(N))return Et(N),!0;const te=nt(N.nodeName);if(Kt(J.uponSanitizeElement,N,{tagName:te,allowedTags:q}),It&&N.hasChildNodes()&&!Mr(N.firstElementChild)&&Ut(/<[/\w!]/g,N.innerHTML)&&Ut(/<[/\w!]/g,N.textContent)||N.nodeType===Vs.progressingInstruction||It&&N.nodeType===Vs.comment&&Ut(/<[/\w]/g,N.data))return Et(N),!0;if(!q[te]||he[te]){if(!he[te]&&Dr(te)&&(se.tagNameCheck instanceof RegExp&&Ut(se.tagNameCheck,te)||se.tagNameCheck instanceof Function&&se.tagNameCheck(te)))return!1;if(qa&&!fn[te]){const Fe=b(N)||N.parentNode,ht=x(N)||N.childNodes;if(ht&&Fe){const We=ht.length;for(let Mt=We-1;Mt>=0;--Mt){const Ft=V(ht[Mt],!0);Ft.__removalCount=(N.__removalCount||0)+1,Fe.insertBefore(Ft,S(N))}}}return Et(N),!0}return N instanceof m&&!Nt(N)||(te==="noscript"||te==="noembed"||te==="noframes")&&Ut(/<\/no(script|embed|frames)/i,N.innerHTML)?(Et(N),!0):(Xe&&N.nodeType===Vs.text&&(Q=N.textContent,Po([oe,fe,Ve],Fe=>{Q=qs(Q,Fe," ")}),N.textContent!==Q&&(Gs(r.removed,{element:N.cloneNode()}),N.textContent=Q)),Kt(J.afterSanitizeElements,N,null),!1)},rr=function(N,Q,te){if(Bi&&(Q==="id"||Q==="name")&&(te in i||te in ji))return!1;if(!(vt&&!$e[Q]&&Ut(be,Q))){if(!(Ue&&Ut(G,Q))){if(!X[Q]||$e[Q]){if(!(Dr(N)&&(se.tagNameCheck instanceof RegExp&&Ut(se.tagNameCheck,N)||se.tagNameCheck instanceof Function&&se.tagNameCheck(N))&&(se.attributeNameCheck instanceof RegExp&&Ut(se.attributeNameCheck,Q)||se.attributeNameCheck instanceof Function&&se.attributeNameCheck(Q))||Q==="is"&&se.allowCustomizedBuiltInElements&&(se.tagNameCheck instanceof RegExp&&Ut(se.tagNameCheck,te)||se.tagNameCheck instanceof Function&&se.tagNameCheck(te))))return!1}else if(!Li[Q]){if(!Ut(R,qs(te,ne,""))){if(!((Q==="src"||Q==="xlink:href"||Q==="href")&&N!=="script"&&rN(te,"data:")===0&&On[N])){if(!(kn&&!Ut($,qs(te,ne,"")))){if(te)return!1}}}}}}return!0},Dr=function(N){return N!=="annotation-xml"&&ov(N,Te)},ar=function(N){Kt(J.beforeSanitizeAttributes,N,null);const{attributes:Q}=N;if(!Q||Pa(N))return;const te={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let Fe=Q.length;for(;Fe--;){const ht=Q[Fe],{name:We,namespaceURI:Mt,value:Ft}=ht,qn=nt(We),$t=Ft;let st=We==="value"?$t:aN($t);if(te.attrName=qn,te.attrValue=st,te.keepAttr=!0,te.forceKeepAttr=void 0,Kt(J.uponSanitizeAttribute,N,te),st=te.attrValue,oa&&(qn==="id"||qn==="name")&&(Gn(We,N),st=xu+st),It&&Ut(/((--!?|])>)|<\/(style|title)/i,st)){Gn(We,N);continue}if(te.forceKeepAttr)continue;if(!te.keepAttr){Gn(We,N);continue}if(!Rr&&Ut(/\/>/i,st)){Gn(We,N);continue}Xe&&Po([oe,fe,Ve],ir=>{st=qs(st,ir," ")});const ki=nt(N.nodeName);if(!rr(ki,qn,st)){Gn(We,N);continue}if(A&&typeof L=="object"&&typeof L.getAttributeType=="function"&&!Mt)switch(L.getAttributeType(ki,qn)){case"TrustedHTML":{st=A.createHTML(st);break}case"TrustedScriptURL":{st=A.createScriptURL(st);break}}if(st!==$t)try{Mt?N.setAttributeNS(Mt,We,st):N.setAttribute(We,st),Pa(N)?Et(N):lv(r.removed)}catch{Gn(We,N)}}Kt(J.afterSanitizeAttributes,N,null)},it=function ue(N){let Q=null;const te=ll(N);for(Kt(J.beforeSanitizeShadowDOM,N,null);Q=te.nextNode();)Kt(J.uponSanitizeShadowNode,Q,null),nr(Q),ar(Q),Q.content instanceof c&&ue(Q.content);Kt(J.afterSanitizeShadowDOM,N,null)};return r.sanitize=function(ue){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Q=null,te=null,Fe=null,ht=null;if(Nr=!ue,Nr&&(ue="<!-->"),typeof ue!="string"&&!Mr(ue))if(typeof ue.toString=="function"){if(ue=ue.toString(),typeof ue!="string")throw Fs("dirty is not a string, aborting")}else throw Fs("toString is not a function");if(!r.isSupported)return ue;if(Mi||zi(N),r.removed=[],typeof ue=="string"&&(ua=!1),ua){if(ue.nodeName){const Ft=nt(ue.nodeName);if(!q[Ft]||he[Ft])throw Fs("root node is forbidden and cannot be sanitized in-place")}}else if(ue instanceof d)Q=sl("<!---->"),te=Q.ownerDocument.importNode(ue,!0),te.nodeType===Vs.element&&te.nodeName==="BODY"||te.nodeName==="HTML"?Q=te:Q.appendChild(te);else{if(!bt&&!Xe&&!xn&&ue.indexOf("<")===-1)return A&&la?A.createHTML(ue):ue;if(Q=sl(ue),!Q)return bt?null:la?E:""}Q&&Di&&Et(Q.firstChild);const We=ll(ua?ue:Q);for(;Fe=We.nextNode();)nr(Fe),ar(Fe),Fe.content instanceof c&&it(Fe.content);if(ua)return ue;if(bt){if(Ga)for(ht=ee.call(Q.ownerDocument);Q.firstChild;)ht.appendChild(Q.firstChild);else ht=Q;return(X.shadowroot||X.shadowrootmode)&&(ht=ie.call(s,ht,!0)),ht}let Mt=xn?Q.outerHTML:Q.innerHTML;return xn&&q["!doctype"]&&Q.ownerDocument&&Q.ownerDocument.doctype&&Q.ownerDocument.doctype.name&&Ut(x1,Q.ownerDocument.doctype.name)&&(Mt="<!DOCTYPE "+Q.ownerDocument.doctype.name+`>
|
|
106
|
+
`).map((d,m)=>_.jsxs("span",{className:Q_.text,children:[_.jsx(vC,{componentDecorator:u,children:d}),_.jsx("br",{})]},m))]})},SC=({subtitle:n,onLinkClick:r})=>n?_.jsx("div",{className:Xt.subtitle,children:_.jsx(m1,{text:n,onLinkClick:r})}):null,K_="newtab#",p1=({markdown:n,markdownOptions:r={},onLinkClick:i})=>{const s=c=>h=>(h.preventDefault(),c&&i(c),!1),u=({title:c,href:h,children:d})=>h.indexOf(K_)===0?_.jsx("a",{href:h.slice(K_.length),title:c,target:"_blank",rel:"noopener noreferrer",children:d}):_.jsx("a",{onClick:s(h),title:c,href:h,children:d});return _.jsx(Ar,{options:{...r,overrides:{a:u}},children:n})},TC=({text:n,onLinkClick:r})=>n?_.jsx("div",{children:_.jsx(p1,{markdown:n,onLinkClick:r})}):null,AC=({title:n})=>n?_.jsx("h1",{className:Xt.title,children:n}):null,xC=({title:n,text:r,subtitle:i,buttons:s,onButtonClick:u,onLinkClick:c})=>n?.length||r?.length||i?.length||s?.length?_.jsxs("div",{className:K(_e.bubbleContent),children:[_.jsx(AC,{title:n}),_.jsx(TC,{text:r,onLinkClick:c}),_.jsx(SC,{subtitle:i,onLinkClick:c}),_.jsx(aC,{buttons:s,onButtonClick:u})]}):null,OC=({alt:n,imageUrl:r,itemUrl:i,hasBody:s})=>r?i?i.indexOf("youtube.com")>-1?_.jsx("div",{className:Xt.video_container,children:_.jsx("iframe",{className:K(Xt.video,{[Xt.only]:!s}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):_.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:_.jsx("div",{className:Xt.imageContainer,children:_.jsx("img",{className:K(Xt.image,{[Xt.only]:!s}),src:r,alt:n})})}):_.jsx("div",{className:Xt.imageContainer,children:_.jsx("img",{className:K(Xt.image,{[Xt.only]:!s}),src:r,alt:n})}):null,wC=({title:n,text:r,subtitle:i,imageUrl:s,itemUrl:u,buttons:c,sources:h,onButtonClick:d,onLinkClick:m})=>{const g=!!n?.length||!!r?.length||!!i?.length||!!c?.length;return _.jsxs("div",{className:K(Xt.detailMessage),children:[_.jsx(OC,{hasBody:g,imageUrl:s,itemUrl:u,alt:n||i}),g&&_.jsx(xC,{title:n,text:r,subtitle:i,buttons:c,onLinkClick:m,onButtonClick:d}),_.jsx(tm,{sources:h,onLinkClick:m})]})},RC=H.forwardRef(({isFirstMessageBySender:n,isLastMessageBySender:r,children:i},s)=>{const u=tt();return _.jsx("li",{ref:s,className:K(_e.message,_e.messageGuest,n&&_e.messageGuestFirst,r&&_e.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:_.jsx("div",{className:K(_e.bubble,_e.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":u("guest-bubble.label"),children:_.jsx("div",{className:K(_e.rightText),children:i})})})}),CC="_markdown_nw7vg_1",g1={markdown:CC},y1=()=>NC(window.location.pathname),NC=n=>{const r=n.split("/"),i=n.endsWith("/");return r[r.length-(i?2:1)]},nm=()=>H.useMemo(()=>y1(),[]),qo="source-info-reference",MC=({actionId:n,markdown:r,sources:i,onLinkClick:s})=>{const u=nm(),c=Ia(),h=DC(),d=Qt(y=>{const T=y.chat.sourceInfos;if(T?.type==="loaded"||T?.type==="loading")return T.chunkId}),m=y=>T=>{const O=T.key;(O==="ArrowDown"||O==="ArrowRight"||O==="Enter"||O===" "||O==="Space")&&(T.stopPropagation(),c(__(u,n,y)))},g=y=>()=>{c(__(u,n,y))};return H.useLayoutEffect(()=>{document.querySelectorAll(`.${qo}`).forEach(y=>{const T=y.previousSibling;T&&T.nodeType===Node.TEXT_NODE&&T.textContent?.endsWith(" ")&&T.textContent?.trim().length&&y.classList.add(`${qo}--before-space`);const O=y.nextSibling;O&&O.nodeType===Node.TEXT_NODE&&O.textContent?.startsWith(" ")&&O.textContent?.trim().length&&y.classList.add(`${qo}--after-space`)})},[r]),_.jsxs("div",{className:_e.bubbleContent,children:[_.jsx("div",{className:g1.markdown,children:_.jsx(p1,{markdown:r,onLinkClick:s,markdownOptions:{renderRule(y,T,O,L){if(T.type===nw.footnoteReference){const M=T.text===d;return _.jsx("span",{className:K(_e.sourceInfoReference,M&&_e.sourceInfoReferenceActive,qo),children:_.jsx("a",{type:"button",tabIndex:0,onClick:g(T.text),onKeyDown:m(T.text),children:h(T.text)})},L.key)}return y()}}})}),_.jsx(tm,{sources:i,onLinkClick:s})]})},DC=()=>{const n=[];return i=>{const s=n.indexOf(i);return s>-1?s+1:(n.push(i),n.length)}},BC=({text:n,commands:r,sources:i,onLinkClick:s})=>_.jsxs("div",{className:_e.bubbleContent,children:[_.jsx(m1,{text:n,commands:r,onLinkClick:s}),_.jsx(tm,{sources:i,onLinkClick:s})]}),LC=H.forwardRef(({message:n,commands:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:u,onReaction:c,onButtonClick:h,onLinkClick:d},m)=>{const g=UC(n._id,n,r,h,d);switch(n.sender.type){case we.UserType.GUEST:return _.jsx(RC,{ref:m,isFirstMessageBySender:s,isLastMessageBySender:u,children:g});default:{const y=T=>c(n._id,T);return _.jsx(u1,{ref:m,message:n,isAnimated:!1,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:u,onReaction:y,children:g})}}}),UC=(n,r,i,s,u)=>{switch(r.type){case we.MessageTypeEnum.TEXT:{const c=r;return _.jsx(BC,{text:c.text,commands:i,sources:r.sources||[],onLinkClick:u})}case we.MessageTypeEnum.DETAIL:{const c=r;return _.jsx(wC,{title:c.title,text:c.text,subtitle:c.subtitle,imageUrl:c.imageUrl,itemUrl:c.itemUrl,buttons:c.buttons,sources:r.sources||[],onButtonClick:s,onLinkClick:u})}case we.MessageTypeEnum.MARKDOWN:{const c=r;return _.jsx(MC,{actionId:n,markdown:c.markdown,sources:c.sources||[],onLinkClick:u})}}},jC=(n,r)=>n.message._id===r.message._id&&n.message.reaction===r.message.reaction&&n.isLastMessage===r.isLastMessage&&n.isFirstMessageBySender===r.isFirstMessageBySender&&n.isLastMessageBySender===r.isLastMessageBySender,HC=Gv.memo(LC,jC),zC="_ticontainer_xg0dn_1",kC="_tiblock_xg0dn_5",IC="_tidot_xg0dn_12",Is={ticontainer:zC,tiblock:kC,tidot:IC},GC=({isTyping:n=!1})=>_.jsx("div",{className:Is.ticontainer,children:_.jsx("div",{className:Is.tiblock,children:n?_.jsxs(_.Fragment,{children:[_.jsx("div",{className:K(Is.tidot,"chat__typingIndicator")}),_.jsx("div",{className:K(Is.tidot,"chat__typingIndicator")}),_.jsx("div",{className:K(Is.tidot,"chat__typingIndicator")})]}):null})}),qC=Object.assign({_id:"typing-indicator"},new we.TextMessage("",new we.BotUser)),FC=({messages:n,isBotTyping:r,commands:i,onTranscriptItemReaction:s,onButtonClick:u,onLinkClick:c})=>{const h=H.useRef(0),d=H.useRef(!0),m=H.useRef(null),g=H.useRef(null),y=H.useRef(null),T=Qt(M=>M.settings.enableGeneralConditions);H.useLayoutEffect(()=>{if(n.length&&m.current&&(h.current<n.length||r)){if(g.current){const M=g.current.offsetTop;m.current.scrollTop=M}else if(y.current){const M=y.current.offsetTop;m.current.scrollTop=M}d.current&&(d.current=!1),h.current=n.length}},[n,d,r]);let O;const L=n.length;return _.jsxs("div",{ref:m,className:K(b_.messageContainer,"chat__messageContainer"),style:{scrollBehavior:n.length&&d.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[T&&_.jsx(yR,{}),_.jsxs("ul",{className:b_.messages,children:[n.map((M,V)=>{const I=PC(M,O),S=VC(M,V,n,r);O=M.sender.type;const x=V+1===L,b=M._id||`added-${V}`;return _.jsx(HC,{ref:x?y:null,message:M,commands:i,isLastMessage:x,isFirstMessageBySender:I,isLastMessageBySender:S,onButtonClick:u,onLinkClick:c,onReaction:s},x&&!r?"last":b)}),r&&_.jsx(u1,{ref:g,message:qC,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:O!==we.UserType.BOT,isLastMessageBySender:!0,children:_.jsx(GC,{isTyping:!0})},"last")]})]})},PC=(n,r)=>!r||r!==n.sender.type,VC=(n,r,i,s)=>{const u=n.sender.type,c=i.length;return r+1===c?!(u===we.UserType.BOT&&s):u!==i.at(r+1)?.sender.type},YC="_bottomSheet_jp8dl_1",ZC="_bottomSheetOpen_jp8dl_15",XC="_bottomSheetClose_jp8dl_20",xr={bottomSheet:YC,bottomSheetOpen:ZC,bottomSheetClose:XC},QC="_container_xc2nx_1",$_={container:QC},KC=({contentUrl:n})=>{const r=Qt(c=>c.connection.sessionId),[i,s]=H.useState(!1);H.useEffect(()=>{s(c=>c||!!n)},[n]);const u=H.useMemo(()=>{if(n&&r){const c=new URL(n,document.baseURI);return c.searchParams.set("sessionId",r),c.toString()}else return},[n,r]);return _.jsx("div",{className:K($_.container,xr.bottomSheet,{[xr.bottomSheetOpen]:!!n,[xr.bottomSheetClose]:i&&!n}),children:u&&_.jsx("iframe",{title:"Drawer",src:u,className:$_.iframe})})},$C="_container_z787n_1",WC={container:$C},JC=({title:n,href:r,children:i})=>_.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),e6=()=>{const r=tt()("powered-by");return r&&r.length?_.jsx("div",{className:K(WC.container,"chat__poweredBy"),children:_.jsx(Ar,{options:{overrides:{a:JC}},children:r})}):null},t6=({className:n,children:r,...i})=>_.jsx(Su,{className:K(Js.buttonDefault,n),type:"button",...i,children:r}),ou=({className:n,children:r,...i})=>_.jsx(Su,{className:K(Js.buttonPrimary,n),...i,children:r}),n6="_container_h23mk_1",r6="_formContainer_h23mk_17",a6="_emailInput_h23mk_22",i6="_description_h23mk_52",s6="_actions_h23mk_57",l6="_validationError_h23mk_67",o6="_submitted_h23mk_74",Ma={container:n6,formContainer:r6,emailInput:a6,description:i6,actions:s6,validationError:l6,submitted:o6},u6=({visible:n,onEmailExport:r,onClose:i})=>{const s=tt(),[u,c]=H.useState(void 0),[h,d]=H.useState(!1),[m,g]=H.useState(void 0),y=H.useRef(null);H.useEffect(()=>{n?(y.current?.focus(),d(!1),c(n)):u===!0&&c(!1)},[n,u]);const T=L=>{L.preventDefault(),m&&m.length>0&&(r(m),d(!0),setTimeout(i,3*1e3))},O=L=>{const M=L.target.value.trim(),V=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(M);g(V?M:"")};return _.jsxs("div",{className:K(Ma.container,xr.bottomSheet,{[xr.bottomSheetOpen]:u===!0,[xr.bottomSheetClose]:u===!1}),children:[_.jsx("h2",{children:s("export-transcript.email.title")}),_.jsx(Ar,{className:Ma.description,children:s("export-transcript.email.description")||""}),_.jsxs("form",{onSubmit:T,className:Ma.formContainer,children:[_.jsxs("div",{children:[_.jsx("input",{disabled:h,ref:y,type:"email",placeholder:s("export-transcript.email.placeholder"),className:Ma.emailInput,onChange:O}),m?.length===0?_.jsx("div",{className:Ma.validationError,children:s("export-transcript.email.invalid")}):null]}),_.jsxs("div",{className:Ma.actions,children:[_.jsx(t6,{onClick:i,children:s("export-transcript.email.cancel")}),_.jsx(ou,{type:"submit",disabled:h||m===void 0||m.length===0,children:s("export-transcript.email.send")})]})]}),h&&_.jsx("div",{className:Ma.submitted,children:s("export-transcript.email.success")})]})},c6="_inputContainer_fi5ao_1",f6={inputContainer:c6},h6="_blockUserInput_pot9c_1",d6={blockUserInput:h6},m6=({visible:n})=>{const r=tt();return n?_.jsx("div",{className:K(d6.blockUserInput,"chat__blockUserInput"),children:r("block-user-input.title")}):null},p6="_commandsDropdown_5ytuv_1",g6="_commands_5ytuv_1",y6="_command_5ytuv_1",_6="_commandActive_5ytuv_46",v6="_commandsSelections_5ytuv_55",Xs={commandsDropdown:p6,commands:g6,command:y6,commandActive:_6,commandsSelections:v6},_1=(n,r)=>{H.useEffect(()=>{const i=s=>{n.current&&!n.current.contains(s.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,r])},b6=(n,r,i,s,u)=>{H.useEffect(()=>{const c=h=>{if(n.length)switch(h.key){case"Enter":i(n[r]);break;case"ArrowUp":s(d=>d>0?d-1:n.length-1);break;case"ArrowDown":s(d=>d<n.length-1?d+1:0);break;case"Escape":u([]);break}};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[n,r,i,s,u])},E6=({text:n,commands:r,onSelectCommand:i,onVisibilityChange:s})=>{const u=H.useRef(null),c=tt(),[h,d]=H.useState([]),[m,g]=H.useState(W_(r)),[y,T]=H.useState(0),O=L=>i(`/${L}`);return _1(u,()=>d([])),b6(h,y,O,T,d),H.useEffect(()=>{g(W_(r))},[r]),H.useEffect(()=>{const L=n.length||0;L===0||L>m||!n.startsWith("/")?d([]):d(r.filter(S6(n))),T(0)},[r,n,m]),H.useEffect(()=>{s(!!h.length)},[h,s]),h.length?_.jsx("div",{ref:u,className:Xs.commandsDropdown,children:_.jsx("ul",{id:"command-list",className:Xs.commands,role:"listbox",children:h.map((L,M)=>_.jsxs("li",{className:K([Xs.command,y===M&&Xs.commandActive]),role:"option",onClick:()=>O(L),onMouseOver:()=>T(M),children:[_.jsxs("h1",{children:["/",L]}),_.jsx("p",{children:c(`commands.${L}`)})]},L))})}):null},W_=n=>Math.max(...n.map(r=>r.length+1)),S6=n=>r=>{const i=`/${r}`;return i.startsWith(n)&&i.length>=n.length},J_=3,T6=({commands:n,onSelectCommand:r})=>{const i=tt(),[s,u]=H.useState(!1),c=g=>()=>{r(`/${g}`),u(!1)},h=()=>{u(!0)},d=()=>{u(!1)},m=s?n:n.slice(0,J_);return _.jsxs("div",{className:Xs.commandsSelections,children:[m.map(g=>_.jsxs("button",{className:"tooltip--top-center","aria-label":i(`commands.${g}`),"data-title":i(`commands.${g}`),tabIndex:0,onClick:c(g),children:["/",g]},g)),m.length<n.length?_.jsx("button",{"aria-label":i("commands.show-more.tooltip"),"data-title":i("commands.show-more.tooltip"),tabIndex:0,onClick:h,children:i("commands.show-more.action")},"show-more"):m.length>J_?_.jsx("button",{"aria-label":i("commands.show-less.tooltip"),"data-title":i("commands.show-less.tooltip"),tabIndex:0,onClick:d,children:i("commands.show-less.action")},"show-less"):null]})},A6="_callToActionContainer_1pojq_1",x6="_callToActionTitle_1pojq_23",O6="_rateOverlay_1pojq_30",w6="_body_1pojq_52",R6="_footer_1pojq_60",C6="_actions_1pojq_73",N6="_bubbles_1pojq_101",M6="_stars_1pojq_203",D6="_starsSmall_1pojq_217",B6="_starsLarge_1pojq_223",L6="_star_1pojq_203",U6="_starReadonly_1pojq_237",j6="_starIcon_1pojq_247",H6="_starsDescriptionContainer_1pojq_265",z6="_starsDescription_1pojq_265",Ht={callToActionContainer:A6,callToActionTitle:x6,rateOverlay:O6,body:w6,footer:R6,actions:C6,bubbles:N6,stars:M6,starsSmall:D6,starsLarge:B6,star:L6,starReadonly:U6,starIcon:j6,starsDescriptionContainer:H6,starsDescription:z6},k6=({value:n,index:r,count:i,readonly:s,onHover:u,onClick:c})=>{const h=d=>{c&&d.key==="Enter"&&c()};return _.jsx("li",{className:K(Ht.star,{[Ht.starReadonly]:s},"chat__conversationRating__star"),children:_.jsx("div",{role:"radio","aria-checked":n>r?"true":"false","aria-posinset":r+1,"aria-setsize":i,tabIndex:0,onMouseOver:u,onKeyDown:h,onClick:c,children:_.jsx("span",{role:"img","aria-label":"Star",className:K(Ht.starIcon),children:_.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:_.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"})})})})})},ev=5,v1=({value:n,size:r,readonly:i=!1,onChange:s})=>{const[u,c]=H.useState(void 0),h=()=>{c(void 0)},d=g=>()=>{if(!i){const y=g+1;c(y)}},m=g=>()=>{s&&!i&&(s(g===0&&n===1?0:g+1),c(void 0))};return _.jsx("ul",{tabIndex:0,role:"radiogroup",className:K(Ht.stars,{[Ht.starsSmall]:r==="small",[Ht.starsLarge]:r==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:r==="small",chat__conversationRating__stars__large:r==="large"}),onMouseOut:h,children:Array(ev).fill(0).map((g,y)=>_.jsx(k6,{value:u===void 0?n:u,index:y,count:ev,readonly:i,onHover:d(y),onClick:m(y)},y))})},I6=({visible:n,onRate:r})=>{const i=tt();return n?_.jsxs("div",{className:K(Ht.callToActionContainer,"chat__conversationRating__callToAction"),children:[_.jsx("div",{className:K(Ht.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),_.jsx(v1,{value:0,size:"small",onChange:r})]}):null},Ah=({isFirstMessageBySender:n,isLastMessageBySender:r,children:i})=>_.jsxs("div",{className:K(_e.message,_e.messageBot,n&&_e.messageBotFirst,r&&_e.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:[_.jsx("img",{className:K(_e.avatar,_e.botAvatar),src:"bot.svg",alt:"Bot"}),_.jsx("div",{className:K(_e.bubble,_e.bubbleLeft,"chat__bubble","chat__botBubble"),children:_.jsx("div",{className:K(_e.leftText,_e.bubbleContent),children:i})})]}),G6=({children:n})=>_.jsx("div",{className:K(_e.message,_e.messageGuest,_e.messageGuestFirst,_e.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:_.jsx("div",{className:K(_e.bubble,_e.bubbleRight,"chat__bubble","chat__guestBubble"),children:_.jsx("div",{className:K(_e.rightText,_e.bubbleContent),children:n})})}),q6=({visible:n,rating:r,onRate:i,onClose:s})=>{const u=tt(),[c,h]=H.useState(r),[d,m]=H.useState(void 0),[g,y]=H.useState(void 0),[T,O]=H.useState({submitted:!1,feedback:""}),[L,M]=H.useState(!1),V=H.useRef(null);H.useEffect(()=>{n?(O({submitted:!1,feedback:""}),y(n)):g===!0&&y(!1)},[n,g]),H.useEffect(()=>{h(r)},[r]),H.useEffect(()=>{const S=c>0?u(`conversation-rating.overlay.bot-message.rate-feedback.value-${c}`):void 0;m(S?.length?S:void 0)},[c,u]),H.useEffect(()=>{T.submitted?setTimeout(()=>M(!0),T.feedback.length?500:0):M(!1)},[T]);const I=S=>{S.preventDefault();const x=V.current?.value?.trim()||"";i(c,x),O({submitted:!0,feedback:x})};return _.jsx("div",{className:K(Ht.rateOverlay,xr.bottomSheet,"chat__conversationRating__overlay",{[xr.bottomSheetOpen]:g===!0,[xr.bottomSheetClose]:g===!1}),children:_.jsxs("form",{onSubmit:I,children:[_.jsxs("div",{className:K(Ht.body,"chat__conversationRating__overlay__body"),children:[_.jsx("div",{}),_.jsx("div",{className:K(Ht.bubbles),children:n&&d&&_.jsxs(_.Fragment,{children:[_.jsxs(Ah,{isFirstMessageBySender:!0,isLastMessageBySender:!1,children:[_.jsx("h2",{children:u("conversation-rating.overlay.title")}),_.jsxs("div",{className:K(Ht.starsDescriptionContainer),children:[_.jsx(v1,{value:c,size:"large",readonly:T.submitted,onChange:h}),_.jsxs("div",{className:K(Ht.starsDescription),children:[_.jsx("div",{children:u("conversation-rating.overlay.star.very-bad")}),_.jsx("div",{children:u("conversation-rating.overlay.star.very-good")})]})]})]}),_.jsx(Ah,{isFirstMessageBySender:!1,isLastMessageBySender:!L||!!T.feedback.length,children:_.jsx("div",{children:d})}),!!T.feedback.length&&_.jsx(G6,{children:T.feedback}),L&&_.jsx(Ah,{isFirstMessageBySender:!!T.feedback.length,isLastMessageBySender:!0,children:_.jsx("div",{children:u("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),_.jsxs("div",{className:K(Ht.footer,"chat__conversationRating__overlay__footer"),children:[!T.submitted&&_.jsx("input",{ref:V,placeholder:u("conversation-rating.overlay.guest-feedback.input-placeholder")}),_.jsx("div",{className:K(Ht.actions,"chat__conversationRating__overlay__footer__actions"),children:T.submitted?_.jsx(ou,{type:"button",onClick:s,children:u("conversation-rating.overlay.action.close")}):_.jsx(ou,{type:"submit",children:u("conversation-rating.overlay.action.submit")})})]})]})})},F6=({conversationRating:{enabled:n,rating:r},numberOfMessagesFromGuest:i,showRatingOverlay:s,setShowRatingOverlay:u,onRate:c})=>{const[h,d]=H.useState(0),m=T=>{d(T),u(!0)},g=()=>u(!1),y=!r&&i>=1;return n?_.jsxs(_.Fragment,{children:[_.jsx(I6,{visible:y,onRate:m}),_.jsx(q6,{visible:s,rating:h,onRate:c,onClose:g})]}):null},P6=H.memo(F6),V6="_inputWrapper_e3h44_1",Y6="_withOpenCommands_e3h44_14",Z6="_messageInputWrapper_e3h44_20",X6="_messageInput_e3h44_20",Q6="_buttons_e3h44_44",K6="_button_e3h44_44",Ai={inputWrapper:V6,withOpenCommands:Y6,messageInputWrapper:Z6,messageInput:X6,buttons:Q6,button:K6},$6="_audioRecorder_g845f_1",W6="_audioButton_g845f_6",J6="_recorderIcon_g845f_37",e3="_spinning_g845f_60",Da={audioRecorder:$6,audioButton:W6,recorderIcon:J6,spinning:e3},tv=2048,uu=16e3;class t3 extends Gv.Component{audioInput=null;volume=null;leftchannel=[];recorder=null;recordingLength=0;sampleRate=null;mediaStream=null;constructor(r){super(r),this.state={recordingState:"none"},this.triggerAudioRecording=this.triggerAudioRecording.bind(this),this.triggerAudioRecordingSuccess=this.triggerAudioRecordingSuccess.bind(this),this.initRecording=this.initRecording.bind(this),this.processRecordingInput=this.processRecordingInput.bind(this),this.handleClickSubmitAudio=this.handleClickSubmitAudio.bind(this),this.handleClickStopAudio=this.handleClickStopAudio.bind(this)}triggerAudioRecording(){this.setState({recordingState:"connecting"}),navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(this.triggerAudioRecordingSuccess)}triggerAudioRecordingSuccess(r){this.mediaStream=r,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(r)}initRecording(r){const i=window.AudioContext||window.webkitAudioContext,s=new i;this.sampleRate=s.sampleRate,this.volume=s.createGain(),this.audioInput=s.createMediaStreamSource(r),this.audioInput.connect(this.volume),this.recorder=s.createScriptProcessor(tv,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(s.destination)}processRecordingInput(r){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const i=r.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(i)),this.recordingLength+=tv}}handleClickSubmitAudio(){const r=r3(this.leftchannel,this.recordingLength),i=a3(r,this.sampleRate||0),s=n3(i);this.props.onAudioRecorded(s),this.handleClickStopAudio()}handleClickStopAudio(){this.setState({recordingState:"none"}),this.audioInput?.disconnect(),this.volume?.disconnect(),this.recorder?.disconnect(),this.mediaStream&&this.mediaStream?.getAudioTracks().forEach(r=>{r.stop()})}render(){return _.jsxs("div",{className:Da.audioRecorder,children:[this.state.recordingState==="none"&&_.jsx("button",{className:K(Da.audioButton,"chat__button"),type:"submit","aria-label":this.props.translate("message-input.actions.start-audio-recording.label"),"data-title":this.props.translate("message-input.actions.start-audio-recording.label"),tabIndex:0,onClick:this.triggerAudioRecording,children:_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.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"}),_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&_.jsxs("svg",{className:Da.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.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"}),_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&_.jsxs("div",{className:Da.audioRecorder,children:[_.jsx("button",{className:K(Da.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.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"}),_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),_.jsx("div",{className:Da.recorderIcon}),_.jsx("button",{className:K(Da.audioButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),_.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const n3=n=>{const r=new ArrayBuffer(44+n.length*2),i=new DataView(r);Fo(i,0,"RIFF"),i.setUint32(4,44+n.length*2,!0),Fo(i,8,"WAVE"),Fo(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,uu,!0),i.setUint32(28,uu*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),Fo(i,36,"data"),i.setUint32(40,n.length*2,!0);const s=n.length;let u=44;const c=1;for(let h=0;h<s;h++)i.setInt16(u,n[h]*(32767*c),!0),u+=2;return new Blob([i],{type:"audio/wav"})},Fo=(n,r,i)=>{for(let s=0;s<i.length;s++)n.setUint8(r+s,i.charCodeAt(s))},r3=(n,r)=>{const i=new Float32Array(r);let s=0;const u=n.length;for(let c=0;c<u;c++){const h=n[c];i.set(h,s),s+=h.length}return i},a3=(n,r)=>{if(uu===r)return n;const i=r/uu,s=Math.round(n.length/i),u=new Float32Array(s);let c=0,h=0;for(;c<u.length;){const d=Math.round((c+1)*i);let m=0,g=0;for(let y=h;y<d&&y<n.length;y++)m+=n[y],g++;u[c]=m/g,c++,h=d}return u},i3=({disabled:n,textInput:r,commandsVisible:i,hasCommands:s,onTextInput:u,onTextInputSubmit:c,onAudioRecorded:h})=>{const d=tt(),m=H.useRef(null),{enableSpeechSupport:g}=Qt(M=>M.settings);H.useEffect(()=>{m.current?.focus()},[r]);const y=()=>{const M=m.current;M&&r.trim().length>=1&&c(r.trim())&&(M.value="",M.style.height="",M.focus())},T=M=>{M.preventDefault(),y()},O=M=>{const V=M.target.value;u(V),M.target.style.height="";const{scrollHeight:I}=M.target;M.target.style.height=`${I>150?150:I}px`},L=M=>{M.code==="Enter"&&!M.shiftKey?(M.repeat||y(),M.preventDefault()):i&&(M.code==="ArrowUp"||M.code==="ArrowDown")&&M.preventDefault()};return _.jsxs("form",{className:K(Ai.inputWrapper,i&&Ai.withOpenCommands,"chat__textInput"),onSubmit:T,children:[_.jsx("div",{className:Ai.messageInputWrapper,children:_.jsx("textarea",{id:"user_input",ref:m,className:Ai.messageInput,tabIndex:0,placeholder:d("message-input-placeholder"),value:r,onChange:O,onKeyDown:L,"aria-label":d("message-input-label"),"aria-controls":s?"command-list":void 0,"aria-haspopup":s?"listbox":void 0})}),_.jsx("div",{className:K(Ai.buttons,"chat__buttons"),children:r.length||!g||navigator.mediaDevices===void 0?_.jsx("button",{className:K(Ai.button,"chat__button"),type:"submit","aria-label":d("message-input.actions.submit.label"),"data-title":d("message-input.actions.submit.label"),tabIndex:0,disabled:n,children:_.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:_.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"})})}):g&&navigator.mediaDevices!==void 0&&_.jsx(t3,{translate:d,onAudioRecorded:h})})]})},s3="_quickReplies_83npe_1",l3="_quickReply_83npe_9",nv={quickReplies:s3,quickReply:l3},o3=({quickReplies:n,onQuickReplyClick:r})=>n.length?_.jsx("div",{className:K(nv.quickReplies,"chat__quickReplies"),children:n.map(i=>_.jsx(Su,{tabIndex:0,className:K(nv.quickReply,"chat__button","chat__quickReply"),onClick:()=>r(i),children:i.label},i.label))}):null,rv=5e3,u3=1e3,c3=({isBotTyping:n,quickReplies:r,conversationRating:i,numberOfMessagesFromGuest:s,showRatingOverlay:u,commands:c,setShowRatingOverlay:h,onTextInput:d,onRate:m,onQuickReplyClick:g,onAudioRecorded:y})=>{const[T,O]=H.useState(""),[L,M]=H.useState(!1),[V,I]=H.useState(!1),S=H.useRef(0),x=H.useRef(0);H.useEffect(()=>{if(L&&!n){const E=S.current?Date.now()-S.current:0;E>rv?M(!1):setTimeout(()=>{M(!1)},rv-E)}},[L,n]),H.useEffect(()=>{L&&(S.current=Date.now())},[L]);const b=E=>{const k=Date.now()-x.current<u3;return V?!1:n||k?(M(!0),!1):(d(E),O(""),x.current=Date.now(),!0)},A=E=>{O(E+" ")};return _.jsxs("div",{className:K(f6.inputContainer),children:[_.jsx(o3,{quickReplies:r,onQuickReplyClick:g}),_.jsx(m6,{visible:L}),!L&&_.jsx(P6,{conversationRating:i,numberOfMessagesFromGuest:s,onRate:m,showRatingOverlay:u,setShowRatingOverlay:h}),!!c?.length&&_.jsx(E6,{text:T,commands:c,onSelectCommand:A,onVisibilityChange:I}),_.jsx(i3,{textInput:T,disabled:L,commandsVisible:V,hasCommands:!!c?.length,onTextInput:O,onTextInputSubmit:b,onAudioRecorded:y}),!!c?.length&&_.jsx(T6,{commands:c,onSelectCommand:O})]})},f3=({clientName:n,messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u,conversationRating:c,onMessageFromUser:h,onRate:d,onQuickReplyClick:m,onButtonClick:g,onLinkClick:y,onAudioRecorded:T,onTranscriptExport:O,onTranscriptItemReaction:L})=>{const M=Ia(),V=Qt(Z=>Z.connection.connectionState),{enableTranscriptExportEmail:I,commands:S}=Qt(Z=>Z.settings),{showTranscriptMailOverlay:x}=Qt(Z=>Z.chat),[b,A]=H.useState(!1),E=r.filter(Z=>Z.sender.type===lu.GUEST).length;H.useEffect(()=>{if(V===ja.CONNECTED){const Z=du.parse(window.location.search);M(e1(n,Z))}},[n,V,M]);const k=()=>{M(Jb())};return _.jsxs("div",{className:ch.container,children:[_.jsxs("div",{className:K([ch.chatcontent,(x||b)&&ch.accessabilityHidden]),children:[_.jsx(FC,{messages:r,isBotTyping:s,commands:S,onButtonClick:g,onLinkClick:y,onTranscriptItemReaction:L}),_.jsx(c3,{isBotTyping:s,quickReplies:s?[]:i,numberOfMessagesFromGuest:E,conversationRating:c,showRatingOverlay:b,setShowRatingOverlay:A,commands:S,onRate:d,onQuickReplyClick:m,onTextInput:h,onAudioRecorded:T}),_.jsx(e6,{})]}),I&&_.jsx(u6,{visible:!!x,onEmailExport:O,onClose:k}),_.jsx(KC,{contentUrl:u})]})},h3=n=>{const{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u,conversationRating:c}=n.chat;return{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u,conversationRating:c}},d3=n=>({onRestartChat:(r,i)=>n(bu(r,i)),onMessageFromUser:r=>n(Nb(r)),onRate:(r,i)=>n(Yx(r,i)),onAudioRecorded:r=>n(Gx(r)),onActionFromUser:r=>n(r),onQuickReplyClick:r=>n(Cb(r)),onNluEvent:r=>n(Ub(r)),onButtonClick:r=>n(Xx(r)),onLinkClick:r=>n(jb(r)),onTranscriptExport:r=>n(Fx(r)),onTranscriptItemReaction:(r,i)=>n(we.Actions.transcriptItemGuestReaction(r,i||null))}),m3=oT(h3,d3)(f3),b1=()=>{const[n,r]=H.useState(!1);return H.useEffect(()=>{r((()=>{try{return window.self!==window.top}catch{return!0}})())},[]),n},p3=n=>r=>{const i=r.key;(i==="ArrowDown"||i==="ArrowRight"||i==="Enter"||i===" "||i==="Space")&&(r.stopPropagation(),n())},g3=({onClick:n})=>{const r=tt();return b1()?_.jsx("button",{className:"tooltip--bottom-left","aria-label":r("header.close-chat"),"data-title":r("header.close-chat"),tabIndex:0,onClick:n,onKeyDown:p3(n),children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"})})}):null},y3="_header_3gvbz_1",_3="_logoContainer_3gvbz_14",v3="_logo_3gvbz_14",b3="_actions_3gvbz_28",E3="_active_3gvbz_43",S3="_menuContainer_3gvbz_56",T3="_menu_3gvbz_56",A3="_divider_3gvbz_86",aa={header:y3,logoContainer:_3,logo:v3,actions:b3,active:E3,menuContainer:S3,menu:T3,divider:A3},x3=({icon:n})=>{switch(n){case"arrow-counter-clockwise":return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"})});case"download":return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"})});case"expand":return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"})});case"mail":return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"})});case"phone":return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M144.27,45.93a8,8,0,0,1,9.8-5.66,86.22,86.22,0,0,1,61.66,61.66,8,8,0,0,1-5.66,9.8A8.23,8.23,0,0,1,208,112a8,8,0,0,1-7.73-5.94,70.35,70.35,0,0,0-50.33-50.33A8,8,0,0,1,144.27,45.93Zm-2.33,41.8c13.79,3.68,22.65,12.54,26.33,26.33A8,8,0,0,0,176,120a8.23,8.23,0,0,0,2.07-.27,8,8,0,0,0,5.66-9.8c-5.12-19.16-18.5-32.54-37.66-37.66a8,8,0,1,0-4.13,15.46Zm81.94,95.35A56.26,56.26,0,0,1,168,232C88.6,232,24,167.4,24,88A56.26,56.26,0,0,1,72.92,32.12a16,16,0,0,1,16.62,9.52l21.12,47.15,0,.12A16,16,0,0,1,109.39,104c-.18.27-.37.52-.57.77L88,129.45c7.49,15.22,23.41,31,38.83,38.51l24.34-20.71a8.12,8.12,0,0,1,.75-.56,16,16,0,0,1,15.17-1.4l.13.06,47.11,21.11A16,16,0,0,1,223.88,183.08Zm-15.88-2s-.07,0-.11,0h0l-47-21.05-24.35,20.71a8.44,8.44,0,0,1-.74.56,16,16,0,0,1-15.75,1.14c-18.73-9.05-37.4-27.58-46.46-46.11a16,16,0,0,1,1-15.7,6.13,6.13,0,0,1,.57-.77L96,95.15l-21-47a.61.61,0,0,1,0-.12A40.2,40.2,0,0,0,40,88,128.14,128.14,0,0,0,168,216,40.21,40.21,0,0,0,208,181.07Z"})});case"scroll":return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M96,104a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H104A8,8,0,0,1,96,104Zm8,40h64a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16Zm128,48a32,32,0,0,1-32,32H88a32,32,0,0,1-32-32V64a16,16,0,0,0-32,0c0,5.74,4.83,9.62,4.88,9.66h0A8,8,0,0,1,24,88a7.89,7.89,0,0,1-4.79-1.61h0C18.05,85.54,8,77.61,8,64A32,32,0,0,1,40,32H176a32,32,0,0,1,32,32V168h8a8,8,0,0,1,4.8,1.6C222,170.46,232,178.39,232,192ZM96.26,173.48A8.07,8.07,0,0,1,104,168h88V64a16,16,0,0,0-16-16H67.69A31.71,31.71,0,0,1,72,64V192a16,16,0,0,0,32,0c0-5.74-4.83-9.62-4.88-9.66A7.82,7.82,0,0,1,96.26,173.48ZM216,192a12.58,12.58,0,0,0-3.23-8h-94a26.92,26.92,0,0,1,1.21,8,31.82,31.82,0,0,1-4.29,16H200A16,16,0,0,0,216,192Z"})});case"link":return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"})});default:return _.jsx("div",{})}},O3=H.forwardRef(({selected:n,item:r,onClick:i},s)=>{const u=tt(),c=h=>{h.preventDefault(),i()};return _.jsx("li",{"aria-selected":n,role:"option",className:r.withDivider?aa.divider:void 0,children:_.jsxs("a",{ref:s,type:"button",role:"button",tabIndex:-1,onClick:c,children:[_.jsx(x3,{icon:r.icon}),_.jsx("span",{children:u(`header.menu.${r.id}`)})]})})}),w3=n=>{const r=b1(),{menuItems:i,enableStandaloneView:s,enableTranscriptExportPdf:u,enableTranscriptExportEmail:c}=Qt(d=>d.settings);return H.useMemo(()=>{const d=[];if(n&&(d.push({id:"restart-chat",type:"restart-chat",icon:"arrow-counter-clockwise",visibility:"chat-only"}),r&&s&&d.push({id:"expand-chat-window",type:"expand-chat-window",icon:"expand",visibility:"always"}),u&&d.push({id:"download-transcript",type:"download-transcript",icon:"download",visibility:"chat-only"}),c&&d.push({id:"send-transcript",type:"send-transcript",icon:"mail",visibility:"chat-only"}),d.length>1)){const m=d.pop();m&&i.length&&d.push({...m,withDivider:!0})}return d.push(...i),d.filter(({visibility:m})=>n?m==="always"||m==="chat-only":m==="always"||m==="start-screen-only")},[n,u,c,s,r,i])},R3=({chatStarted:n})=>{const r=Ia(),i=nm(),s=tt(),[u,c]=H.useState(!1),[h,d]=H.useState(-1),m=H.useRef(null),g=H.useRef(null),y=H.useRef([]),T=w3(n);H.useEffect(()=>{y.current[h]?.focus()},[h]);const O=H.useCallback(()=>{const I=du.parse(window.location.search);r(bu(i,I)),c(!1),d(0)},[r,i]),L=H.useCallback(I=>{switch(I.type){case"restart-chat":O();break;case"expand-chat-window":window.open(window.location.href,"_blank");break;case"download-transcript":r(Px());break;case"send-transcript":r(Jb());break;case"link":r(jb(I.url));break;case"action":r(JSON.parse(JSON.stringify(I.action)));break}c(!1)},[r,O,c]);H.useEffect(()=>{const I=S=>{if(u)switch(S.key){case"Enter":S.preventDefault(),L(T[h]);break;case"ArrowUp":d(x=>x>0?x-1:T.length-1);break;case"ArrowDown":d(x=>x<T.length-1?x+1:0);break;case"Escape":c(!1);break;case"Tab":h>-1&&c(!1);break}};return document.addEventListener("keydown",I),()=>{document.removeEventListener("keydown",I)}},[u,h,T,d,c,L]),H.useEffect(()=>{u||d(-1)},[u,h]),_1(g,()=>c(!1));const M=()=>{c(I=>!I)},V=()=>{setTimeout(()=>{const I=document.activeElement;g.current&&!g.current.contains(I)&&c(!1)},0)};return T.length?_.jsxs("div",{className:K(aa.menuContainer),ref:g,children:[_.jsx("button",{ref:m,className:K(u&&aa.active,u?"tooltip-hidden":"tooltip--bottom-left"),"aria-label":s("header.menu.title"),"data-title":s("header.menu.title"),onClick:M,onBlur:V,children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"})})}),u&&_.jsx("nav",{className:aa.menu,"aria-label":s("header.menu.title"),children:_.jsx("ul",{tabIndex:0,children:T.map((I,S)=>_.jsx(O3,{ref:x=>{y.current[S]=x},selected:h===S,item:I,onClick:()=>L(I)},I.id))})})]}):null},av=({className:n,chatStarted:r,...i})=>{const s=Ia(),u=()=>{s(kO())};return _.jsxs("div",{className:K([aa.header,n]),...i,children:[_.jsx("div",{className:aa.logoContainer,children:_.jsx("div",{className:aa.logo})}),_.jsxs("div",{className:aa.actions,children:[_.jsx(R3,{chatStarted:r}),_.jsx(g3,{onClick:u})]})]})},C3="_chatwindow_rkbir_1",N3="_chatwindowWithAside_rkbir_21",iv={chatwindow:C3,chatwindowWithAside:N3},E1=()=>{const[n,r]=H.useState(!1);return H.useEffect(()=>{const i=window.matchMedia("(max-width: 1023px)"),s=()=>r(i.matches);return s(),i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[]),n},M3="_sourceInfos_vei0l_1",D3="_waitForLoading_vei0l_24",B3="_loadingContent_vei0l_28",L3="_sourceHeader_vei0l_37",U3="_sourceHeaderIcon_vei0l_57",j3="_sourceContent_vei0l_61",H3="_openSourceButton_vei0l_69",z3="_sourceButtonLabel_vei0l_79",k3="_closeSourceInfosButton_vei0l_101",I3="_loadingSourceInfos_vei0l_125",G3="_loading_vei0l_28",q3="_loadingError_vei0l_139",F3="_highlightLoadingInfo_vei0l_155",P3="_highlightLoadingInfoInnerContainer_vei0l_169",V3="_highlightLoadingInfoContent_vei0l_178",Y3="_highlightLoadingInfoCloseIcon_vei0l_198",Z3="_highlightLoader_vei0l_203",X3="_highlightLoaderLoading_vei0l_210",_t={sourceInfos:M3,waitForLoading:D3,loadingContent:B3,sourceHeader:L3,sourceHeaderIcon:U3,sourceContent:j3,openSourceButton:H3,sourceButtonLabel:z3,closeSourceInfosButton:k3,loadingSourceInfos:I3,loading:G3,loadingError:q3,highlightLoadingInfo:F3,highlightLoadingInfoInnerContainer:P3,highlightLoadingInfoContent:V3,highlightLoadingInfoCloseIcon:Y3,highlightLoader:Z3,highlightLoaderLoading:X3},Q3=({onClick:n})=>{const r=tt();return _.jsx("button",{className:K(_t.closeSourceInfosButton,"tooltip--bottom-left"),"aria-label":r("source-infos.close"),"data-title":r("source-infos.close"),tabIndex:0,onClick:n,children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})})},K3=H.forwardRef(({sourceInfos:n,onClose:r,...i},s)=>_.jsxs("div",{className:_t.sourceHeader,...i,ref:s,children:[_.jsx("div",{children:n?_.jsx("p",{id:"source-info-title",children:n.title}):_.jsx("p",{children:" "})}),_.jsx(Q3,{onClick:r})]})),$3=({loading:n})=>_.jsx("div",{className:_t.highlightLoader,children:n&&_.jsx("div",{className:_t.highlightLoaderLoading})});/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:S1,setPrototypeOf:sv,isFrozen:W3,getPrototypeOf:J3,getOwnPropertyDescriptor:eN}=Object;let{freeze:zt,seal:Sn,create:T1}=Object,{apply:yd,construct:_d}=typeof Reflect<"u"&&Reflect;zt||(zt=function(r){return r});Sn||(Sn=function(r){return r});yd||(yd=function(r,i,s){return r.apply(i,s)});_d||(_d=function(r,i){return new r(...i)});const Po=kt(Array.prototype.forEach),tN=kt(Array.prototype.lastIndexOf),lv=kt(Array.prototype.pop),Gs=kt(Array.prototype.push),nN=kt(Array.prototype.splice),Ko=kt(String.prototype.toLowerCase),xh=kt(String.prototype.toString),ov=kt(String.prototype.match),qs=kt(String.prototype.replace),rN=kt(String.prototype.indexOf),aN=kt(String.prototype.trim),jn=kt(Object.prototype.hasOwnProperty),Ut=kt(RegExp.prototype.test),Fs=iN(TypeError);function kt(n){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var i=arguments.length,s=new Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];return yd(n,r,s)}}function iN(n){return function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return _d(n,i)}}function Oe(n,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ko;sv&&sv(n,null);let s=r.length;for(;s--;){let u=r[s];if(typeof u=="string"){const c=i(u);c!==u&&(W3(r)||(r[s]=c),u=c)}n[u]=!0}return n}function sN(n){for(let r=0;r<n.length;r++)jn(n,r)||(n[r]=null);return n}function Er(n){const r=T1(null);for(const[i,s]of S1(n))jn(n,i)&&(Array.isArray(s)?r[i]=sN(s):s&&typeof s=="object"&&s.constructor===Object?r[i]=Er(s):r[i]=s);return r}function Ps(n,r){for(;n!==null;){const s=eN(n,r);if(s){if(s.get)return kt(s.get);if(typeof s.value=="function")return kt(s.value)}n=J3(n)}function i(){return null}return i}const uv=zt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Oh=zt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),wh=zt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),lN=zt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Rh=zt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),oN=zt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),cv=zt(["#text"]),fv=zt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ch=zt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),hv=zt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Vo=zt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),uN=Sn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),cN=Sn(/<%[\w\W]*|[\w\W]*%>/gm),fN=Sn(/\$\{[\w\W]*/gm),hN=Sn(/^data-[\-\w.\u00B7-\uFFFF]+$/),dN=Sn(/^aria-[\-\w]+$/),A1=Sn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),mN=Sn(/^(?:\w+script|data):/i),pN=Sn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),x1=Sn(/^html$/i),gN=Sn(/^[a-z][.\w]*(-[.\w]+)+$/i);var dv=Object.freeze({__proto__:null,ARIA_ATTR:dN,ATTR_WHITESPACE:pN,CUSTOM_ELEMENT:gN,DATA_ATTR:hN,DOCTYPE_NAME:x1,ERB_EXPR:cN,IS_ALLOWED_URI:A1,IS_SCRIPT_OR_DATA:mN,MUSTACHE_EXPR:uN,TMPLIT_EXPR:fN});const Vs={element:1,text:3,progressingInstruction:7,comment:8,document:9},yN=function(){return typeof window>"u"?null:window},_N=function(r,i){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let s=null;const u="data-tt-policy-suffix";i&&i.hasAttribute(u)&&(s=i.getAttribute(u));const c="dompurify"+(s?"#"+s:"");try{return r.createPolicy(c,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},mv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function O1(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yN();const r=ue=>O1(ue);if(r.version="3.2.6",r.removed=[],!n||!n.document||n.document.nodeType!==Vs.document||!n.Element)return r.isSupported=!1,r;let{document:i}=n;const s=i,u=s.currentScript,{DocumentFragment:c,HTMLTemplateElement:h,Node:d,Element:m,NodeFilter:g,NamedNodeMap:y=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:T,DOMParser:O,trustedTypes:L}=n,M=m.prototype,V=Ps(M,"cloneNode"),I=Ps(M,"remove"),S=Ps(M,"nextSibling"),x=Ps(M,"childNodes"),b=Ps(M,"parentNode");if(typeof h=="function"){const ue=i.createElement("template");ue.content&&ue.content.ownerDocument&&(i=ue.content.ownerDocument)}let A,E="";const{implementation:k,createNodeIterator:Z,createDocumentFragment:ee,getElementsByTagName:de}=i,{importNode:ie}=s;let J=mv();r.isSupported=typeof S1=="function"&&typeof b=="function"&&k&&k.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:oe,ERB_EXPR:fe,TMPLIT_EXPR:Ve,DATA_ATTR:be,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:ne,CUSTOM_ELEMENT:Te}=dv;let{IS_ALLOWED_URI:R}=dv,q=null;const W=Oe({},[...uv,...Oh,...wh,...Rh,...cv]);let X=null;const re=Oe({},[...fv,...Ch,...hv,...Vo]);let se=Object.seal(T1(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),he=null,$e=null,Ue=!0,vt=!0,kn=!1,Rr=!0,Xe=!1,It=!0,xn=!1,Mi=!1,Di=!1,bt=!1,Ga=!1,la=!1,Bi=!0,oa=!1;const xu="user-content-";let qa=!0,ua=!1,Cr={},fn=null;const Rt=Oe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let On=null;const Ct=Oe({},["audio","video","img","source","image","track"]);let Li=null;const al=Oe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fa="http://www.w3.org/1998/Math/MathML",er="http://www.w3.org/2000/svg",Gt="http://www.w3.org/1999/xhtml";let qt=Gt,Nr=!1,tr=null;const Ou=Oe({},[Fa,er,Gt],xh);let ca=Oe({},["mi","mo","mn","ms","mtext"]),fa=Oe({},["annotation-xml"]);const Ui=Oe({},["title","style","font","a","script"]);let wn=null;const wu=["application/xhtml+xml","text/html"],il="text/html";let nt=null,In=null;const ji=i.createElement("form"),Hi=function(N){return N instanceof RegExp||N instanceof Function},zi=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(In&&In===N)){if((!N||typeof N!="object")&&(N={}),N=Er(N),wn=wu.indexOf(N.PARSER_MEDIA_TYPE)===-1?il:N.PARSER_MEDIA_TYPE,nt=wn==="application/xhtml+xml"?xh:Ko,q=jn(N,"ALLOWED_TAGS")?Oe({},N.ALLOWED_TAGS,nt):W,X=jn(N,"ALLOWED_ATTR")?Oe({},N.ALLOWED_ATTR,nt):re,tr=jn(N,"ALLOWED_NAMESPACES")?Oe({},N.ALLOWED_NAMESPACES,xh):Ou,Li=jn(N,"ADD_URI_SAFE_ATTR")?Oe(Er(al),N.ADD_URI_SAFE_ATTR,nt):al,On=jn(N,"ADD_DATA_URI_TAGS")?Oe(Er(Ct),N.ADD_DATA_URI_TAGS,nt):Ct,fn=jn(N,"FORBID_CONTENTS")?Oe({},N.FORBID_CONTENTS,nt):Rt,he=jn(N,"FORBID_TAGS")?Oe({},N.FORBID_TAGS,nt):Er({}),$e=jn(N,"FORBID_ATTR")?Oe({},N.FORBID_ATTR,nt):Er({}),Cr=jn(N,"USE_PROFILES")?N.USE_PROFILES:!1,Ue=N.ALLOW_ARIA_ATTR!==!1,vt=N.ALLOW_DATA_ATTR!==!1,kn=N.ALLOW_UNKNOWN_PROTOCOLS||!1,Rr=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Xe=N.SAFE_FOR_TEMPLATES||!1,It=N.SAFE_FOR_XML!==!1,xn=N.WHOLE_DOCUMENT||!1,bt=N.RETURN_DOM||!1,Ga=N.RETURN_DOM_FRAGMENT||!1,la=N.RETURN_TRUSTED_TYPE||!1,Di=N.FORCE_BODY||!1,Bi=N.SANITIZE_DOM!==!1,oa=N.SANITIZE_NAMED_PROPS||!1,qa=N.KEEP_CONTENT!==!1,ua=N.IN_PLACE||!1,R=N.ALLOWED_URI_REGEXP||A1,qt=N.NAMESPACE||Gt,ca=N.MATHML_TEXT_INTEGRATION_POINTS||ca,fa=N.HTML_INTEGRATION_POINTS||fa,se=N.CUSTOM_ELEMENT_HANDLING||{},N.CUSTOM_ELEMENT_HANDLING&&Hi(N.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(se.tagNameCheck=N.CUSTOM_ELEMENT_HANDLING.tagNameCheck),N.CUSTOM_ELEMENT_HANDLING&&Hi(N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(se.attributeNameCheck=N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(se.allowCustomizedBuiltInElements=N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Xe&&(vt=!1),Ga&&(bt=!0),Cr&&(q=Oe({},cv),X=[],Cr.html===!0&&(Oe(q,uv),Oe(X,fv)),Cr.svg===!0&&(Oe(q,Oh),Oe(X,Ch),Oe(X,Vo)),Cr.svgFilters===!0&&(Oe(q,wh),Oe(X,Ch),Oe(X,Vo)),Cr.mathMl===!0&&(Oe(q,Rh),Oe(X,hv),Oe(X,Vo))),N.ADD_TAGS&&(q===W&&(q=Er(q)),Oe(q,N.ADD_TAGS,nt)),N.ADD_ATTR&&(X===re&&(X=Er(X)),Oe(X,N.ADD_ATTR,nt)),N.ADD_URI_SAFE_ATTR&&Oe(Li,N.ADD_URI_SAFE_ATTR,nt),N.FORBID_CONTENTS&&(fn===Rt&&(fn=Er(fn)),Oe(fn,N.FORBID_CONTENTS,nt)),qa&&(q["#text"]=!0),xn&&Oe(q,["html","head","body"]),q.table&&(Oe(q,["tbody"]),delete he.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw Fs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Fs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=N.TRUSTED_TYPES_POLICY,E=A.createHTML("")}else A===void 0&&(A=_N(L,u)),A!==null&&typeof E=="string"&&(E=A.createHTML(""));zt&&zt(N),In=N}},Rn=Oe({},[...Oh,...wh,...lN]),ft=Oe({},[...Rh,...oN]),Nt=function(N){let Q=b(N);(!Q||!Q.tagName)&&(Q={namespaceURI:qt,tagName:"template"});const te=Ko(N.tagName),Fe=Ko(Q.tagName);return tr[N.namespaceURI]?N.namespaceURI===er?Q.namespaceURI===Gt?te==="svg":Q.namespaceURI===Fa?te==="svg"&&(Fe==="annotation-xml"||ca[Fe]):!!Rn[te]:N.namespaceURI===Fa?Q.namespaceURI===Gt?te==="math":Q.namespaceURI===er?te==="math"&&fa[Fe]:!!ft[te]:N.namespaceURI===Gt?Q.namespaceURI===er&&!fa[Fe]||Q.namespaceURI===Fa&&!ca[Fe]?!1:!ft[te]&&(Ui[te]||!Rn[te]):!!(wn==="application/xhtml+xml"&&tr[N.namespaceURI]):!1},Et=function(N){Gs(r.removed,{element:N});try{b(N).removeChild(N)}catch{I(N)}},Gn=function(N,Q){try{Gs(r.removed,{attribute:Q.getAttributeNode(N),from:Q})}catch{Gs(r.removed,{attribute:null,from:Q})}if(Q.removeAttribute(N),N==="is")if(bt||Ga)try{Et(Q)}catch{}else try{Q.setAttribute(N,"")}catch{}},sl=function(N){let Q=null,te=null;if(Di)N="<remove></remove>"+N;else{const We=ov(N,/^[\r\n\t ]+/);te=We&&We[0]}wn==="application/xhtml+xml"&&qt===Gt&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");const Fe=A?A.createHTML(N):N;if(qt===Gt)try{Q=new O().parseFromString(Fe,wn)}catch{}if(!Q||!Q.documentElement){Q=k.createDocument(qt,"template",null);try{Q.documentElement.innerHTML=Nr?E:Fe}catch{}}const ht=Q.body||Q.documentElement;return N&&te&&ht.insertBefore(i.createTextNode(te),ht.childNodes[0]||null),qt===Gt?de.call(Q,xn?"html":"body")[0]:xn?Q.documentElement:ht},ll=function(N){return Z.call(N.ownerDocument||N,N,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Pa=function(N){return N instanceof T&&(typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||!(N.attributes instanceof y)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function")},Mr=function(N){return typeof d=="function"&&N instanceof d};function Kt(ue,N,Q){Po(ue,te=>{te.call(r,N,Q,In)})}const nr=function(N){let Q=null;if(Kt(J.beforeSanitizeElements,N,null),Pa(N))return Et(N),!0;const te=nt(N.nodeName);if(Kt(J.uponSanitizeElement,N,{tagName:te,allowedTags:q}),It&&N.hasChildNodes()&&!Mr(N.firstElementChild)&&Ut(/<[/\w!]/g,N.innerHTML)&&Ut(/<[/\w!]/g,N.textContent)||N.nodeType===Vs.progressingInstruction||It&&N.nodeType===Vs.comment&&Ut(/<[/\w]/g,N.data))return Et(N),!0;if(!q[te]||he[te]){if(!he[te]&&Dr(te)&&(se.tagNameCheck instanceof RegExp&&Ut(se.tagNameCheck,te)||se.tagNameCheck instanceof Function&&se.tagNameCheck(te)))return!1;if(qa&&!fn[te]){const Fe=b(N)||N.parentNode,ht=x(N)||N.childNodes;if(ht&&Fe){const We=ht.length;for(let Mt=We-1;Mt>=0;--Mt){const Ft=V(ht[Mt],!0);Ft.__removalCount=(N.__removalCount||0)+1,Fe.insertBefore(Ft,S(N))}}}return Et(N),!0}return N instanceof m&&!Nt(N)||(te==="noscript"||te==="noembed"||te==="noframes")&&Ut(/<\/no(script|embed|frames)/i,N.innerHTML)?(Et(N),!0):(Xe&&N.nodeType===Vs.text&&(Q=N.textContent,Po([oe,fe,Ve],Fe=>{Q=qs(Q,Fe," ")}),N.textContent!==Q&&(Gs(r.removed,{element:N.cloneNode()}),N.textContent=Q)),Kt(J.afterSanitizeElements,N,null),!1)},rr=function(N,Q,te){if(Bi&&(Q==="id"||Q==="name")&&(te in i||te in ji))return!1;if(!(vt&&!$e[Q]&&Ut(be,Q))){if(!(Ue&&Ut(G,Q))){if(!X[Q]||$e[Q]){if(!(Dr(N)&&(se.tagNameCheck instanceof RegExp&&Ut(se.tagNameCheck,N)||se.tagNameCheck instanceof Function&&se.tagNameCheck(N))&&(se.attributeNameCheck instanceof RegExp&&Ut(se.attributeNameCheck,Q)||se.attributeNameCheck instanceof Function&&se.attributeNameCheck(Q))||Q==="is"&&se.allowCustomizedBuiltInElements&&(se.tagNameCheck instanceof RegExp&&Ut(se.tagNameCheck,te)||se.tagNameCheck instanceof Function&&se.tagNameCheck(te))))return!1}else if(!Li[Q]){if(!Ut(R,qs(te,ne,""))){if(!((Q==="src"||Q==="xlink:href"||Q==="href")&&N!=="script"&&rN(te,"data:")===0&&On[N])){if(!(kn&&!Ut($,qs(te,ne,"")))){if(te)return!1}}}}}}return!0},Dr=function(N){return N!=="annotation-xml"&&ov(N,Te)},ar=function(N){Kt(J.beforeSanitizeAttributes,N,null);const{attributes:Q}=N;if(!Q||Pa(N))return;const te={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let Fe=Q.length;for(;Fe--;){const ht=Q[Fe],{name:We,namespaceURI:Mt,value:Ft}=ht,qn=nt(We),$t=Ft;let st=We==="value"?$t:aN($t);if(te.attrName=qn,te.attrValue=st,te.keepAttr=!0,te.forceKeepAttr=void 0,Kt(J.uponSanitizeAttribute,N,te),st=te.attrValue,oa&&(qn==="id"||qn==="name")&&(Gn(We,N),st=xu+st),It&&Ut(/((--!?|])>)|<\/(style|title)/i,st)){Gn(We,N);continue}if(te.forceKeepAttr)continue;if(!te.keepAttr){Gn(We,N);continue}if(!Rr&&Ut(/\/>/i,st)){Gn(We,N);continue}Xe&&Po([oe,fe,Ve],ir=>{st=qs(st,ir," ")});const ki=nt(N.nodeName);if(!rr(ki,qn,st)){Gn(We,N);continue}if(A&&typeof L=="object"&&typeof L.getAttributeType=="function"&&!Mt)switch(L.getAttributeType(ki,qn)){case"TrustedHTML":{st=A.createHTML(st);break}case"TrustedScriptURL":{st=A.createScriptURL(st);break}}if(st!==$t)try{Mt?N.setAttributeNS(Mt,We,st):N.setAttribute(We,st),Pa(N)?Et(N):lv(r.removed)}catch{Gn(We,N)}}Kt(J.afterSanitizeAttributes,N,null)},it=function ue(N){let Q=null;const te=ll(N);for(Kt(J.beforeSanitizeShadowDOM,N,null);Q=te.nextNode();)Kt(J.uponSanitizeShadowNode,Q,null),nr(Q),ar(Q),Q.content instanceof c&&ue(Q.content);Kt(J.afterSanitizeShadowDOM,N,null)};return r.sanitize=function(ue){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Q=null,te=null,Fe=null,ht=null;if(Nr=!ue,Nr&&(ue="<!-->"),typeof ue!="string"&&!Mr(ue))if(typeof ue.toString=="function"){if(ue=ue.toString(),typeof ue!="string")throw Fs("dirty is not a string, aborting")}else throw Fs("toString is not a function");if(!r.isSupported)return ue;if(Mi||zi(N),r.removed=[],typeof ue=="string"&&(ua=!1),ua){if(ue.nodeName){const Ft=nt(ue.nodeName);if(!q[Ft]||he[Ft])throw Fs("root node is forbidden and cannot be sanitized in-place")}}else if(ue instanceof d)Q=sl("<!---->"),te=Q.ownerDocument.importNode(ue,!0),te.nodeType===Vs.element&&te.nodeName==="BODY"||te.nodeName==="HTML"?Q=te:Q.appendChild(te);else{if(!bt&&!Xe&&!xn&&ue.indexOf("<")===-1)return A&&la?A.createHTML(ue):ue;if(Q=sl(ue),!Q)return bt?null:la?E:""}Q&&Di&&Et(Q.firstChild);const We=ll(ua?ue:Q);for(;Fe=We.nextNode();)nr(Fe),ar(Fe),Fe.content instanceof c&&it(Fe.content);if(ua)return ue;if(bt){if(Ga)for(ht=ee.call(Q.ownerDocument);Q.firstChild;)ht.appendChild(Q.firstChild);else ht=Q;return(X.shadowroot||X.shadowrootmode)&&(ht=ie.call(s,ht,!0)),ht}let Mt=xn?Q.outerHTML:Q.innerHTML;return xn&&q["!doctype"]&&Q.ownerDocument&&Q.ownerDocument.doctype&&Q.ownerDocument.doctype.name&&Ut(x1,Q.ownerDocument.doctype.name)&&(Mt="<!DOCTYPE "+Q.ownerDocument.doctype.name+`>
|
|
107
107
|
`+Mt),Xe&&Po([oe,fe,Ve],Ft=>{Mt=qs(Mt,Ft," ")}),A&&la?A.createHTML(Mt):Mt},r.setConfig=function(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};zi(ue),Mi=!0},r.clearConfig=function(){In=null,Mi=!1},r.isValidAttribute=function(ue,N,Q){In||zi({});const te=nt(ue),Fe=nt(N);return rr(te,Fe,Q)},r.addHook=function(ue,N){typeof N=="function"&&Gs(J[ue],N)},r.removeHook=function(ue,N){if(N!==void 0){const Q=tN(J[ue],N);return Q===-1?void 0:nN(J[ue],Q,1)[0]}return lv(J[ue])},r.removeHooks=function(ue){J[ue]=[]},r.removeAllHooks=function(){J=mv()},r}var vN=O1();const bN=({onClose:n})=>{const r=tt();return _.jsxs("div",{className:_t.highlightLoadingInfo,onClick:n,children:[_.jsx("div",{className:_t.highlightLoadingInfoCloseIcon,children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})}),_.jsxs("div",{className:_t.highlightLoadingInfoInnerContainer,children:[_.jsxs("div",{className:_t.highlightLoadingInfoContent,children:[_.jsx("h3",{children:r("source-infos.highlight-loading.title")}),_.jsx("p",{children:r("source-infos.highlight-loading.description")})]}),_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#000000",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M253.66,106.34a8,8,0,0,0-11.32,0L192,156.69,107.31,72l50.35-50.34a8,8,0,1,0-11.32-11.32L96,60.69A16,16,0,0,0,93.18,79.5L72,100.69a16,16,0,0,0,0,22.62L76.69,128,18.34,186.34a8,8,0,0,0,3.13,13.25l72,24A7.88,7.88,0,0,0,96,224a8,8,0,0,0,5.66-2.34L136,187.31l4.69,4.69a16,16,0,0,0,22.62,0l21.19-21.18A16,16,0,0,0,203.31,168l50.35-50.34A8,8,0,0,0,253.66,106.34ZM93.84,206.85l-55-18.35L88,139.31,124.69,176ZM152,180.69,83.31,112,104,91.31,172.69,160Z"})})]})]})},EN=({title:n,href:r,children:i})=>_.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),SN=({className:n,children:r,...i})=>_.jsx("a",{className:K(Js.button,Js.buttonDefault,n),type:"button",role:"button",...i,children:r}),TN=n=>_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:_.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),AN=({type:n,...r})=>{switch(n){case"WEBSITE":return _.jsx(d1,{...r});case"PDF":return _.jsx(h1,{...r});case"DOCX":return _.jsx(c1,{...r});case"TEXT":return _.jsx(TN,{...r});default:return _.jsx(f1,{...r})}},xN=({url:n,knowledgeBaseType:r})=>{const i=tt();return _.jsx(SN,{className:_t.openSourceButton,href:n,target:"_blank",children:_.jsxs("div",{className:_t.sourceButtonLabel,children:[_.jsx("div",{className:_t.sourceHeaderIcon,children:_.jsx(AN,{type:r})}),_.jsx("p",{children:i("source-infos.open-source")})]})})},ON=({sourceInfos:{content:n,url:r,knowledgeBaseType:i,highlighted:s}})=>{const[u,c]=H.useState(!s);H.useEffect(()=>{s&&c(!1)},[s]);const h=vN.sanitize(n,{USE_PROFILES:{html:!0}});return _.jsxs(_.Fragment,{children:[_.jsxs("div",{className:K(_t.sourceContent,g1.markdown),children:[_.jsx(Ar,{options:{overrides:{a:EN}},children:h}),u&&_.jsx(bN,{onClose:()=>c(!1)})]}),_.jsx(xN,{url:r,knowledgeBaseType:i})]})},wN=""+new URL("undraw_fixing-bugs-D_eYxJc6.svg",import.meta.url).href,RN=()=>{const n=tt();return _.jsxs("div",{className:_t.loadingError,children:[_.jsx("h1",{children:n("source-infos.error.title")}),_.jsx("img",{src:wN,title:n("source-infos.error.title")}),_.jsx("p",{children:n("source-infos.error.info")})]})},CN=()=>_.jsx("div",{className:_t.loadingSourceInfos,children:_.jsx("svg",{className:_t.loading,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:_.jsx("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"})})});function NN({sourceInfos:n,onClose:r,threshold:i=100}){const s=H.useRef(null),[u,c]=H.useState(0),[h,d]=H.useState(!1),m=H.useRef(null),g=H.useRef(null),y=H.useCallback(M=>{m.current=M,d(!0)},[]),T=H.useCallback(M=>{if(m.current!==null&&h){const V=M-m.current;V>0&&c(V)}},[h]),O=H.useCallback(()=>{d(!1),u>i&&r(),c(0),m.current=null},[u,i,r]),L=H.useCallback(M=>{const V=E=>y(E.touches[0].clientY),I=E=>T(E.touches[0].clientY),S=()=>O(),x=E=>{E.preventDefault(),y(E.clientY),window.addEventListener("mousemove",b),window.addEventListener("mouseup",A)},b=E=>T(E.clientY),A=()=>{O(),window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",A)};M.addEventListener("touchstart",V),M.addEventListener("touchmove",I),M.addEventListener("touchend",S),M.addEventListener("mousedown",x),g.current=()=>{M.removeEventListener("touchstart",V),M.removeEventListener("touchmove",I),M.removeEventListener("touchend",S),M.removeEventListener("mousedown",x),window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",A)}},[y,T,O]);return H.useEffect(()=>{let M;return(()=>{s.current?(g.current?.(),L(s.current)):(M=new MutationObserver(()=>{s.current&&(g.current?.(),L(s.current),M?.disconnect())}),M.observe(document.body,{childList:!0,subtree:!0}))})(),()=>{M?.disconnect(),g.current?.()}},[L,n]),{ref:s,dragOffsetY:u,isDragging:h}}const MN=n=>{const[r,i]=H.useState(!0);return H.useEffect(()=>{let s=null;return n?.type==="loading"?(i(!0),s=setTimeout(()=>{i(!1)},300)):i(!n),()=>{s&&clearTimeout(s)}},[n]),r},DN=()=>{const n=Ia(),r=Qt(m=>m.chat.sourceInfos),i=E1(),s=H.useRef(null),u=MN(r);H.useEffect(()=>{s.current&&r?.type==="loading"&&(i?s.current.showModal():(s.current.setAttribute("open","true"),s.current?.focus()))},[r,i]);const c=H.useCallback(()=>{s.current&&(i?s.current.close():s.current.removeAttribute("open"),n(GO()))},[n,i]),{ref:h,dragOffsetY:d}=NN({onClose:c,sourceInfos:r});return r?_.jsx("dialog",{ref:s,className:K(_t.sourceInfos,u?_t.waitForLoading:r.type==="loading"?_t.loadingContent:""),style:i&&d?{transform:`translateY(${d}px)`}:{},onClose:c,autoFocus:!0,role:"dialog","aria-labelledby":"source-info-title",children:u?null:_.jsxs(_.Fragment,{children:[_.jsx(K3,{ref:h,tabIndex:-1,sourceInfos:r.type==="loaded"?r:void 0,onClose:c}),r.type==="loading"?_.jsx(CN,{}):r.type==="loading-error"?_.jsx(RN,{}):_.jsxs(_.Fragment,{children:[_.jsx($3,{loading:!r.highlighted}),_.jsx(ON,{sourceInfos:r})]})]})}):null},BN="_container_114wy_1",LN="_body_114wy_7",UN="_intro_114wy_14",jN="_footer_114wy_39",HN="_footnote_114wy_43",zN="_containerWithFootnote_114wy_58",kN="_startChatButton_114wy_73",IN="_formFields_114wy_77",GN="_formField_114wy_77",qN="_radio_114wy_89",FN="_checkbox_114wy_96",PN="_input_114wy_104",VN="_inputLabel_114wy_138",YN="_selectWrapper_114wy_142",ZN="_select_114wy_142",XN="_selectLabel_114wy_188",wt={container:BN,body:LN,intro:UN,footer:jN,footnote:HN,containerWithFootnote:zN,startChatButton:kN,formFields:IN,formField:GN,radio:qN,checkbox:FN,input:PN,inputLabel:VN,selectWrapper:YN,select:ZN,selectLabel:XN},QN=({name:n,label:r,defaultValue:i,required:s,onChange:u})=>{const c=h=>{u(h.currentTarget.checked?"true":"false")};return _.jsxs("label",{className:K(wt.checkbox,"chat__startScreen__checkbox"),htmlFor:n,children:[_.jsx("input",{type:"checkbox",id:n,name:n,defaultChecked:i==="true",required:s,onChange:c}),_.jsx("div",{children:r})]})},KN=({type:n,name:r,label:i,defaultValue:s,placeholder:u,required:c,multiple:h,min:d,max:m,pattern:g,onChange:y})=>{const T=O=>{y(O.target.value)};return _.jsxs("label",{className:K(wt.input,"chat__startScreen__input"),htmlFor:r,children:[_.jsx("div",{className:K(wt.inputLabel),children:i}),_.jsx("input",{type:n,id:r,name:r,defaultValue:s,placeholder:u,required:c,multiple:h,min:d,max:m,pattern:g,onChange:T})]})},$N=({name:n,value:r,label:i,defaultChecked:s,required:u,onChange:c})=>{const h=`${n}-${r}`,d=m=>{c(m.target.value)};return _.jsxs("label",{className:K(wt.radio,"chat__startScreen__radio"),htmlFor:h,children:[_.jsx("input",{id:h,type:"radio",name:n,value:r,defaultChecked:s,required:u,onChange:d}),_.jsx("span",{className:K(wt.label),children:i})]})},WN=({name:n,label:r,defaultValue:i,required:s,multiple:u,options:c,onChange:h})=>{const d=m=>{h(m.target.value)};return _.jsxs("label",{className:K(wt.select,"chat__startScreen__select"),htmlFor:n,children:[_.jsx("div",{className:K(wt.selectLabel),children:r}),_.jsx("div",{className:K(wt.selectWrapper),children:_.jsx("select",{id:n,name:n,defaultValue:i,required:s,multiple:u,onChange:d,children:Object.entries(c||{}).map(([m,g])=>_.jsx("option",{value:m,selected:g===i,children:g}))})})]})},JN="start-screen.intro",eM="start-screen.start-chat",tM="start-screen.footnote",Un="start-screen.form",pv=`${Un}.fields`,nM=()=>{const n=tt(),r=Ia(),[i,s]=H.useState({}),u=()=>{const T=Object.entries(i).reduce((O,[L,M])=>({...O,[L]:M.value}),{});r(jO(T))},c=n(JN),h=n(eM),d=n(tM),m=H.useMemo(()=>n(pv)?.split(";").map(T=>T.trim())??[],[n(pv)]);H.useEffect(()=>{m.length&&Object.keys(i).length===0&&s(m.reduce((T,O)=>({...T,[O]:rM(O,n)}),{}))},[n,m,i]);const g=T=>{T.preventDefault(),u()},y=T=>O=>{s(L=>({...L,[T]:{...L[T],value:O}}))};return _.jsxs("form",{onSubmit:g,className:K(wt.container,d&&wt.containerWithFootnote,"chat__startScreen"),children:[_.jsxs("div",{className:K(wt.body,"chat__startScreen__body"),children:[c&&_.jsx("div",{className:K(wt.intro,"chat__startScreen__intro"),children:_.jsx(Ar,{options:{overrides:{a:gv}},children:c})}),_.jsx("div",{className:K(wt.formFields,"chat__startScreen__fields"),children:Object.values(i).map(({type:T,name:O,label:L,placeholder:M,defaultValue:V,options:I,required:S,multiple:x,min:b,max:A,pattern:E})=>_.jsx("div",{className:K(wt.formField,"chat__startScreen__field"),children:(()=>{switch(T){case"radio":return _.jsxs(_.Fragment,{children:[_.jsx("div",{children:L}),Object.entries(I||{}).map(([k,Z])=>_.jsx($N,{name:O,value:k,label:Z,defaultChecked:k===V,required:S,onChange:y(O)},k))]});case"checkbox":return _.jsx(QN,{name:O,label:L,defaultValue:V,required:S,onChange:y(O)});case"select":return _.jsx(WN,{name:O,label:L,defaultValue:V,required:S,multiple:x,options:I,onChange:y(O)});default:return _.jsx(KN,{type:T,name:O,label:L,placeholder:M,defaultValue:V,required:S,multiple:x,min:b,max:A,pattern:E,onChange:y(O)})}})()},O))})]}),_.jsxs("div",{className:K(wt.footer,"chat__startScreen__footer"),children:[_.jsx(ou,{type:"submit",className:wt.startChatButton,children:h}),d&&_.jsx("div",{className:wt.footnote,children:_.jsx(Ar,{options:{overrides:{a:gv}},children:d})})]})]})},gv=({title:n,href:r,children:i})=>_.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),rM=(n,r)=>{const i=r(`${Un}.${n}.type`)||"text",s=r(`${Un}.${n}.required`)==="true",u=r(`${Un}.${n}.multiple`)==="true",c=r(`${Un}.${n}.placeholder`),h=r(`${Un}.${n}.label`)||"",d=r(`${Un}.${n}.defaultValue`),m=r(`${Un}.${n}.min`),g=r(`${Un}.${n}.max`),y=r(`${Un}.${n}.pattern`),T=iM(r(`${Un}.${n}.options`));return{name:n,label:h,placeholder:c,value:aM(i,d,T)||"",defaultValue:d,options:T,type:i,required:s,multiple:u,min:m,max:g,pattern:y}},aM=(n,r,i)=>r||n==="select"&&Object.keys(i)[0]||"",iM=(n="")=>n.split(";").map(r=>r.trim()).reduce((r,i)=>{const[s,u]=i.split(":").map(c=>c.trim());return{...r,[s]:u}},{}),sM=()=>{const n=hu();H.useEffect(()=>{window.document.documentElement.lang=n.locale},[n.locale])},xi={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"},lM=({clientName:n})=>{sM();const r=Ia(),i=Qt(y=>y.intl.messages),s=tt(),u=Qt(y=>y.settings.enableStartScreen),c=Qt(y=>y.startScreen.startScreenStatus),[h,d]=H.useState(void 0);H.useEffect(()=>{const y=du.parse(window.location.search);y.cssClassName&&d(y.cssClassName);const T=O=>{switch(O.data.type){case xi.TRIGGER_ACTION:r(O.data.action);break;case xi.TRIGGER_STORY:r(Ub(O.data.story));break;case xi.ON_CHAT_WINDOW_OPEN:r({type:"webclient.chatwindow.opened"});break;case xi.ON_CHAT_WINDOW_CLOSE:r({type:"webclient.chatwindow.closed"});break;case xi.CHAT_MESSAGE_FROM_GUEST:r(Nb(O.data.text));break;case xi.RESTART_CHAT:r(bu(n,y));break}};return r(FO(n,y)),window.addEventListener("message",O=>T(O),!1),()=>window.removeEventListener("message",T)},[n,r]),H.useEffect(()=>{const y=s("page.title");y&&document&&(document.title=y)},[i,s]);const m=u===void 0,g=u===!1||c==="HIDDEN";return _.jsx("div",{className:K(iv.chatwindow,g&&iv.chatwindowWithAside,"chat__chatwindow",h),children:m?null:g?_.jsxs(_.Fragment,{children:[_.jsx("header",{children:_.jsx(av,{chatStarted:!0})}),_.jsx("main",{children:_.jsx(m3,{clientName:n})}),_.jsx("aside",{children:_.jsx(DN,{})})]}):_.jsxs(_.Fragment,{children:[_.jsx("header",{children:_.jsx(av,{chatStarted:!1})}),_.jsx("main",{children:_.jsx(nM,{})})]})})},oM=()=>{const n=nm(),r=E1(),i=Qt(u=>u.intl.locale),s=Qt(u=>u.intl.messages);return _.jsx(QA,{locale:i,messages:s,onError:()=>{},children:_.jsx("div",{className:K([$A.app,r?"chat__small":"chat__large"]),children:_.jsx(lM,{clientName:n})})})};var Nh,yv;function rm(){if(yv)return Nh;yv=1;function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}return Nh=n,Nh}var Mh,_v;function uM(){if(_v)return Mh;_v=1;var n=typeof yo=="object"&&yo&&yo.Object===Object&&yo;return Mh=n,Mh}var Dh,vv;function w1(){if(vv)return Dh;vv=1;var n=uM(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();return Dh=i,Dh}var Bh,bv;function cM(){if(bv)return Bh;bv=1;var n=w1(),r=function(){return n.Date.now()};return Bh=r,Bh}var Lh,Ev;function fM(){if(Ev)return Lh;Ev=1;var n=/\s/;function r(i){for(var s=i.length;s--&&n.test(i.charAt(s)););return s}return Lh=r,Lh}var Uh,Sv;function hM(){if(Sv)return Uh;Sv=1;var n=fM(),r=/^\s+/;function i(s){return s&&s.slice(0,n(s)+1).replace(r,"")}return Uh=i,Uh}var jh,Tv;function R1(){if(Tv)return jh;Tv=1;var n=w1(),r=n.Symbol;return jh=r,jh}var Hh,Av;function dM(){if(Av)return Hh;Av=1;var n=R1(),r=Object.prototype,i=r.hasOwnProperty,s=r.toString,u=n?n.toStringTag:void 0;function c(h){var d=i.call(h,u),m=h[u];try{h[u]=void 0;var g=!0}catch{}var y=s.call(h);return g&&(d?h[u]=m:delete h[u]),y}return Hh=c,Hh}var zh,xv;function mM(){if(xv)return zh;xv=1;var n=Object.prototype,r=n.toString;function i(s){return r.call(s)}return zh=i,zh}var kh,Ov;function pM(){if(Ov)return kh;Ov=1;var n=R1(),r=dM(),i=mM(),s="[object Null]",u="[object Undefined]",c=n?n.toStringTag:void 0;function h(d){return d==null?d===void 0?u:s:c&&c in Object(d)?r(d):i(d)}return kh=h,kh}var Ih,wv;function gM(){if(wv)return Ih;wv=1;function n(r){return r!=null&&typeof r=="object"}return Ih=n,Ih}var Gh,Rv;function yM(){if(Rv)return Gh;Rv=1;var n=pM(),r=gM(),i="[object Symbol]";function s(u){return typeof u=="symbol"||r(u)&&n(u)==i}return Gh=s,Gh}var qh,Cv;function _M(){if(Cv)return qh;Cv=1;var n=hM(),r=rm(),i=yM(),s=NaN,u=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,h=/^0o[0-7]+$/i,d=parseInt;function m(g){if(typeof g=="number")return g;if(i(g))return s;if(r(g)){var y=typeof g.valueOf=="function"?g.valueOf():g;g=r(y)?y+"":y}if(typeof g!="string")return g===0?g:+g;g=n(g);var T=c.test(g);return T||h.test(g)?d(g.slice(2),T?2:8):u.test(g)?s:+g}return qh=m,qh}var Fh,Nv;function vM(){if(Nv)return Fh;Nv=1;var n=rm(),r=cM(),i=_M(),s="Expected a function",u=Math.max,c=Math.min;function h(d,m,g){var y,T,O,L,M,V,I=0,S=!1,x=!1,b=!0;if(typeof d!="function")throw new TypeError(s);m=i(m)||0,n(g)&&(S=!!g.leading,x="maxWait"in g,O=x?u(i(g.maxWait)||0,m):O,b="trailing"in g?!!g.trailing:b);function A(fe){var Ve=y,be=T;return y=T=void 0,I=fe,L=d.apply(be,Ve),L}function E(fe){return I=fe,M=setTimeout(ee,m),S?A(fe):L}function k(fe){var Ve=fe-V,be=fe-I,G=m-Ve;return x?c(G,O-be):G}function Z(fe){var Ve=fe-V,be=fe-I;return V===void 0||Ve>=m||Ve<0||x&&be>=O}function ee(){var fe=r();if(Z(fe))return de(fe);M=setTimeout(ee,k(fe))}function de(fe){return M=void 0,b&&y?A(fe):(y=T=void 0,L)}function ie(){M!==void 0&&clearTimeout(M),I=0,y=V=T=M=void 0}function J(){return M===void 0?L:de(r())}function oe(){var fe=r(),Ve=Z(fe);if(y=arguments,T=this,V=fe,Ve){if(M===void 0)return E(V);if(x)return clearTimeout(M),M=setTimeout(ee,m),A(V)}return M===void 0&&(M=setTimeout(ee,m)),L}return oe.cancel=ie,oe.flush=J,oe}return Fh=h,Fh}var Ph,Mv;function bM(){if(Mv)return Ph;Mv=1;var n=vM(),r=rm(),i="Expected a function";function s(u,c,h){var d=!0,m=!0;if(typeof u!="function")throw new TypeError(i);return r(h)&&(d="leading"in h?!!h.leading:d,m="trailing"in h?!!h.trailing:m),n(u,c,{leading:d,maxWait:c,trailing:m})}return Ph=s,Ph}var EM=bM();const SM=cu(EM);function TM(n){return n&&n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function AM(n){return n}function xM(n,r){r=r||{};const i=r.delimiter||".",s=r.maxDepth,u=r.transformKey||AM,c={};function h(d,m,g){g=g||1,Object.keys(d).forEach(function(y){const T=d[y],O=r.safe&&Array.isArray(T),L=Object.prototype.toString.call(T),M=TM(T),V=L==="[object Object]"||L==="[object Array]",I=m?m+i+u(y):u(y);if(!O&&!M&&V&&Object.keys(T).length&&(!r.maxDepth||g<s))return h(T,I,g+1);c[I]=T})}return h(n),c}const C1={"page.title":"Bubble Chat Chatbot","message-input-label":"Benutzereingabe","message-input-placeholder":"Nachricht","message-input.actions.submit.label":"Nachricht senden","message-input.actions.start-audio-recording.label":"Spracheingabe starten","message-input.actions.stop-audio-recording.label":"Spracheingabe stoppen","message-input.actions.submit-audio-recording.label":"Spracheingabe übermitteln","guest-bubble.label":"Ihre Nachricht","bot-bubble.label":"Nachricht des Chatbots","bot-bubble.reaction.good":"Gefällt mir","bot-bubble.reaction.bad":"Gefällt mir nicht","bot-bubble.reaction.remove":"Markierung entfernen","bot-bubble.copy":"Kopieren","bot-bubble.sources":"Quellenliste","bot-bubble.source.open":"Quelle öffnen","agent-bubble.label":"Nachricht des Live-Agenten","export-transcript.email.title":"Chatverlauf per E-Mail versenden","export-transcript.email.description":"Bitte E-Mail-Adresse angeben, an die der Chatverlauf gesendet werden soll.","export-transcript.email.cancel":"Abbrechen","export-transcript.email.send":"Senden","export-transcript.email.placeholder":"E-Mail-Adresse","export-transcript.email.invalid":"Bitte gültige E-Mail-Adresse eingeben.","export-transcript.email.success":"Der Chatverlauf wurde an die hinterlegte E-Mail-Adresse übermittelt.","general-conditions.header":"**Nutzungsbedingungen**","general-conditions.body":`Bitte berücksichtigen Sie die folgenden Punkte:
|
|
108
108
|
|
|
109
109
|
- Der Chatverlauf wird im EU-Raum gespeichert und kann nur von autorisierten Personen eingesehen werden.
|
|
@@ -117,4 +117,4 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
|
|
|
117
117
|
|
|
118
118
|
- La cronologia delle chat è memorizzata nell'area UE e può essere visualizzata solo da persone autorizzate.
|
|
119
119
|
- 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.close-chat":"Minimizzare la chat","header.menu.title":"Menu","header.menu.restart-chat":"Riavviare la chat","header.menu.expand-chat-window":"Espandere la finestra","header.menu.download-transcript":"Scaricare la trascrizione","header.menu.send-transcript":"Inviare la trascrizione","header.menu.export-transcript":"Esportare la trascrizione","source-infos.close":"Chiudere","source-infos.open-source":"Fonte aperta","source-infos.error.title":"Errore","source-infos.error.info":"Ops! Qualcosa è andato storto. Riprovare o contattare l'assistenza se il problema persiste.","source-infos.highlight-loading.title":"Il contenuto rilevante è evidenziato...","source-infos.highlight-loading.description":"Un momento - la fonte è in fase di analisi","commands.show-more.action":"Di più","commands.show-more.tooltip":"Mostra più comandi","commands.show-less.action":"Meno","commands.show-less.tooltip":"Mostra meno comandi"},CM=["de","en","fr","it"],N1={locale:"de",messages:C1},NM=(n,r)=>{if(CM.includes(n)){const i=MM(n),s=xM(r);return{...i,...s}}return r},MM=n=>{switch(n.toString()){case"en":return OM;case"fr":return wM;case"it":return RM;default:return C1}},DM=(n=BM,r)=>{switch(r.type){case Xd:return Object.assign({},n,{connectionState:ja.CONNECTING});case Qd:return Object.assign({},n,{connectionState:ja.CONNECTED});case Kd:return Object.assign({},n,{connectionState:ja.DISCONNECTED});case $d:return Object.assign({},n,{connectionState:ja.RECONNECTED});case Wd:return Object.assign({},n,{sessionId:r.sessionId});case _u:return Object.assign({},n,{sessionId:r.payload.sessionId,userId:r.payload.userId});case vu:return Object.assign({},n,{sessionId:void 0});default:return n}},BM={connectionState:ja.DISCONNECTED,sessionId:void 0,userId:void 0},LM=(n=Bv,r)=>{switch(r.type){case $b:return Bv;case _u:return Ba({type:"webclient.chat.started"}),n;case vu:return Ba({type:"webclient.chat.ended"}),n;case we.ActionTypes.TYPING_ON:return Object.assign({},n,{isBotTyping:!0});case we.ActionTypes.TYPING_OFF:return Object.assign({},n,{isBotTyping:!1});case we.ActionTypes.MESSAGE_FROM_GUEST:case we.ActionTypes.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return Dv(n,r.message);case we.ActionTypes.MESSAGE_TO_GUEST:{Ba(r);const i=Object.assign({},r.message,{_id:r.meta.actionId}),s=n.messages.filter(u=>u._id===r.meta.actionId).length>0;return Object.assign({},n,{isBotTyping:!1,messages:s?n.messages:n.messages.concat([i]),quickReplies:i.quickReplies?i.quickReplies:[]})}case jd:{const i=r.messages,s=i.length?i[i.length-1]:void 0;return Object.assign({},n,{isBotTyping:!1,messages:i,quickReplies:s?.quickReplies||[]})}case Ud:return Ba(r.message),n;case we.ActionTypes.EVENT_TO_GUEST:return Ba(r.event),n;case we.ActionTypes.DRAWER_OPEN:return Object.assign({},n,{drawerContentUrl:r.payload.parameters.contentUrl});case we.ActionTypes.DRAWER_CLOSE:return Object.assign({},n,{drawerContentUrl:void 0});case we.ActionTypes.GUEST_LOCALE_CHANGED:return Object.assign({},n,{locale:r.payload.locale});case Db:return Ba(r),n;case Bb:return Ba(r),n;case zd:{const i=new we.TextMessage(r.transcription,new we.GuestUser),s=Object.assign({},i,{_id:ud()});return Dv(n,s)}case we.ActionTypes.TRANSCRIPT_ITEM_GUEST_REACTION:{const i=n.messages.map(s=>s._id===r.payload.actionId?Object.assign({},s,{reaction:r.payload.reaction}):s);return Object.assign({},n,{messages:i})}case kd:{const i={enabled:!0,rating:r.payload.rating};return Object.assign({},n,{conversationRating:i})}case we.ActionTypes.CONVERSATION_RATING_FROM_GUEST:{const i={...n.conversationRating,rating:r.payload};return Object.assign({},n,{conversationRating:i})}case Gd:return{...n,sourceInfos:{type:"loading",chunkId:r.payload.chunkId}};case Id:{const{highlighted:i}=r.payload;return n.sourceInfos?.type==="loaded"&&i?{...n,sourceInfos:{...n.sourceInfos,highlighted:!0}}:{...n,sourceInfos:{type:"loading-error"}}}case Mb:{const i=n.sourceInfos?.type,{chunkId:s,knowledgeBaseType:u,title:c,content:h,highlighted:d,url:m}=r.payload,g=n.sourceInfos?.type==="loading"||n.sourceInfos?.type==="loaded"?n.sourceInfos?.chunkId:void 0;return g&&g!==s?n:i==="loading"||i==="loaded"&&d?{...n,sourceInfos:{type:"loaded",chunkId:s,knowledgeBaseType:u,title:c,content:h,highlighted:d,url:m}}:n}case qd:return{...n,sourceInfos:void 0};case Wb:return{...n,showTranscriptMailOverlay:!n.showTranscriptMailOverlay};default:return n}},Dv=(n,r)=>{const i=n.messages[n.messages.length-1],s=i?.text===r.text;return i&&i.sender.type===r.sender.type&&s?n:Object.assign({},n,{messages:n.messages.concat([r]),quickReplies:[]})},Ba=n=>{UM()?window.top?.postMessage(n,"*"):n.type==="webclient.change.url"&&window.open(n.url)},UM=()=>typeof window<"u"&&window.self!==window.top,Bv={messages:[],quickReplies:[],isBotTyping:!1,showTranscriptMailOverlay:!1,conversationRating:{enabled:!1}},M1=Yd({name:"intl",initialState:N1,reducers:{updateIntl:(n,r)=>{n.locale=r.payload.language,n.messages=r.payload.messages}}}),{updateIntl:jM}=M1.actions,HM=M1.reducer,zM={enableStartScreen:void 0,enableStandaloneView:!1,enableTranscriptExportEmail:!1,enableTranscriptExportPdf:!1,enableGeneralConditions:!1,enableSpeechSupport:!1,commands:[],menuItems:[]},D1=Yd({name:"settings",initialState:zM,reducers:{setSettings(n,r){n.enableStartScreen=r.payload.enableStartScreen,n.enableStandaloneView=r.payload.enableStandaloneView,n.enableTranscriptExportEmail=r.payload.enableTranscriptExportEmail,n.enableTranscriptExportPdf=r.payload.enableTranscriptExportPdf,n.enableGeneralConditions=r.payload.enableGeneralConditions,n.enableSpeechSupport=r.payload.enableSpeechSupport,n.commands=r.payload.commands,n.menuItems=r.payload.menuItems||[]}}}),{setSettings:kM}=D1.actions,IM=D1.reducer,GM=kb({settings:IM,chat:LM,startScreen:zO,connection:DM,intl:HM}),qM="bubble-chat",B1="state-last-saved-at",L1="state",FM=n=>{try{if(!YM())return;const r=Lv(n,B1);if(VM(r))return;{const i=Lv(n,L1);return i===null?void 0:JSON.parse(i)}}catch(r){console.error(r);return}},PM=(n,r)=>{try{const i=JSON.stringify(r);Uv(n,L1,i);const s=new Date().toISOString();Uv(n,B1,s)}catch(i){console.error(i)}},VM=n=>{if(n===null)return!1;const r=new Date(n);return r.setHours(r.getHours()+12),new Date>r},YM=()=>typeof localStorage<"u",Lv=(n,r)=>{const i=U1(n,r);return localStorage.getItem(i)},Uv=(n,r,i)=>{const s=U1(n,r);return localStorage.setItem(s,i)},U1=(n,r)=>`${qM}-${n}-${r}`,Jn=Object.create(null);Jn.open="0";Jn.close="1";Jn.ping="2";Jn.pong="3";Jn.message="4";Jn.upgrade="5";Jn.noop="6";const $o=Object.create(null);Object.keys(Jn).forEach(n=>{$o[Jn[n]]=n});const vd={type:"error",data:"parser error"},j1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",H1=typeof ArrayBuffer=="function",z1=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,am=({type:n,data:r},i,s)=>j1&&r instanceof Blob?i?s(r):jv(r,s):H1&&(r instanceof ArrayBuffer||z1(r))?i?s(r):jv(new Blob([r]),s):s(Jn[n]+(r||"")),jv=(n,r)=>{const i=new FileReader;return i.onload=function(){const s=i.result.split(",")[1];r("b"+(s||""))},i.readAsDataURL(n)};function Hv(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Vh;function ZM(n,r){if(j1&&n.data instanceof Blob)return n.data.arrayBuffer().then(Hv).then(r);if(H1&&(n.data instanceof ArrayBuffer||z1(n.data)))return r(Hv(n.data));am(n,!1,i=>{Vh||(Vh=new TextEncoder),r(Vh.encode(i))})}const zv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qs=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<zv.length;n++)Qs[zv.charCodeAt(n)]=n;const XM=n=>{let r=n.length*.75,i=n.length,s,u=0,c,h,d,m;n[n.length-1]==="="&&(r--,n[n.length-2]==="="&&r--);const g=new ArrayBuffer(r),y=new Uint8Array(g);for(s=0;s<i;s+=4)c=Qs[n.charCodeAt(s)],h=Qs[n.charCodeAt(s+1)],d=Qs[n.charCodeAt(s+2)],m=Qs[n.charCodeAt(s+3)],y[u++]=c<<2|h>>4,y[u++]=(h&15)<<4|d>>2,y[u++]=(d&3)<<6|m&63;return g},QM=typeof ArrayBuffer=="function",im=(n,r)=>{if(typeof n!="string")return{type:"message",data:k1(n,r)};const i=n.charAt(0);return i==="b"?{type:"message",data:KM(n.substring(1),r)}:$o[i]?n.length>1?{type:$o[i],data:n.substring(1)}:{type:$o[i]}:vd},KM=(n,r)=>{if(QM){const i=XM(n);return k1(i,r)}else return{base64:!0,data:n}},k1=(n,r)=>{switch(r){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},I1="",$M=(n,r)=>{const i=n.length,s=new Array(i);let u=0;n.forEach((c,h)=>{am(c,!1,d=>{s[h]=d,++u===i&&r(s.join(I1))})})},WM=(n,r)=>{const i=n.split(I1),s=[];for(let u=0;u<i.length;u++){const c=im(i[u],r);if(s.push(c),c.type==="error")break}return s};function JM(){return new TransformStream({transform(n,r){ZM(n,i=>{const s=i.length;let u;if(s<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,s);else if(s<65536){u=new Uint8Array(3);const c=new DataView(u.buffer);c.setUint8(0,126),c.setUint16(1,s)}else{u=new Uint8Array(9);const c=new DataView(u.buffer);c.setUint8(0,127),c.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(u[0]|=128),r.enqueue(u),r.enqueue(i)})}})}let Yh;function Yo(n){return n.reduce((r,i)=>r+i.length,0)}function Zo(n,r){if(n[0].length===r)return n.shift();const i=new Uint8Array(r);let s=0;for(let u=0;u<r;u++)i[u]=n[0][s++],s===n[0].length&&(n.shift(),s=0);return n.length&&s<n[0].length&&(n[0]=n[0].slice(s)),i}function eD(n,r){Yh||(Yh=new TextDecoder);const i=[];let s=0,u=-1,c=!1;return new TransformStream({transform(h,d){for(i.push(h);;){if(s===0){if(Yo(i)<1)break;const m=Zo(i,1);c=(m[0]&128)===128,u=m[0]&127,u<126?s=3:u===126?s=1:s=2}else if(s===1){if(Yo(i)<2)break;const m=Zo(i,2);u=new DataView(m.buffer,m.byteOffset,m.length).getUint16(0),s=3}else if(s===2){if(Yo(i)<8)break;const m=Zo(i,8),g=new DataView(m.buffer,m.byteOffset,m.length),y=g.getUint32(0);if(y>Math.pow(2,21)-1){d.enqueue(vd);break}u=y*Math.pow(2,32)+g.getUint32(4),s=3}else{if(Yo(i)<u)break;const m=Zo(i,u);d.enqueue(im(c?m:Yh.decode(m),r)),s=0}if(u===0||u>n){d.enqueue(vd);break}}}})}const G1=4;function ct(n){if(n)return tD(n)}function tD(n){for(var r in ct.prototype)n[r]=ct.prototype[r];return n}ct.prototype.on=ct.prototype.addEventListener=function(n,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(r),this};ct.prototype.once=function(n,r){function i(){this.off(n,i),r.apply(this,arguments)}return i.fn=r,this.on(n,i),this};ct.prototype.off=ct.prototype.removeListener=ct.prototype.removeAllListeners=ct.prototype.removeEventListener=function(n,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+n];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,u=0;u<i.length;u++)if(s=i[u],s===r||s.fn===r){i.splice(u,1);break}return i.length===0&&delete this._callbacks["$"+n],this};ct.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),i=this._callbacks["$"+n],s=1;s<arguments.length;s++)r[s-1]=arguments[s];if(i){i=i.slice(0);for(var s=0,u=i.length;s<u;++s)i[s].apply(this,r)}return this};ct.prototype.emitReserved=ct.prototype.emit;ct.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};ct.prototype.hasListeners=function(n){return!!this.listeners(n).length};const Tu=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,i)=>i(r,0),En=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),nD="arraybuffer";function q1(n,...r){return r.reduce((i,s)=>(n.hasOwnProperty(s)&&(i[s]=n[s]),i),{})}const rD=En.setTimeout,aD=En.clearTimeout;function Au(n,r){r.useNativeTimers?(n.setTimeoutFn=rD.bind(En),n.clearTimeoutFn=aD.bind(En)):(n.setTimeoutFn=En.setTimeout.bind(En),n.clearTimeoutFn=En.clearTimeout.bind(En))}const iD=1.33;function sD(n){return typeof n=="string"?lD(n):Math.ceil((n.byteLength||n.size)*iD)}function lD(n){let r=0,i=0;for(let s=0,u=n.length;s<u;s++)r=n.charCodeAt(s),r<128?i+=1:r<2048?i+=2:r<55296||r>=57344?i+=3:(s++,i+=4);return i}function F1(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function oD(n){let r="";for(let i in n)n.hasOwnProperty(i)&&(r.length&&(r+="&"),r+=encodeURIComponent(i)+"="+encodeURIComponent(n[i]));return r}function uD(n){let r={},i=n.split("&");for(let s=0,u=i.length;s<u;s++){let c=i[s].split("=");r[decodeURIComponent(c[0])]=decodeURIComponent(c[1])}return r}class cD extends Error{constructor(r,i,s){super(r),this.description=i,this.context=s,this.type="TransportError"}}class sm extends ct{constructor(r){super(),this.writable=!1,Au(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,i,s){return super.emitReserved("error",new cD(r,i,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(r){this.readyState==="open"&&this.write(r)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(r){const i=im(r,this.socket.binaryType);this.onPacket(i)}onPacket(r){super.emitReserved("packet",r)}onClose(r){this.readyState="closed",super.emitReserved("close",r)}pause(r){}createUri(r,i={}){return r+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const r=this.opts.hostname;return r.indexOf(":")===-1?r:"["+r+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(r){const i=oD(r);return i.length?"?"+i:""}}class fD extends sm{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(r){this.readyState="pausing";const i=()=>{this.readyState="paused",r()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||i()})),this.writable||(s++,this.once("drain",function(){--s||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const i=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};WM(r,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const r=()=>{this.write([{type:"close"}])};this.readyState==="open"?r():this.once("open",r)}write(r){this.writable=!1,$M(r,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=F1()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(r,i)}}let P1=!1;try{P1=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hD=P1;function dD(){}class mD extends fD{constructor(r){if(super(r),typeof location<"u"){const i=location.protocol==="https:";let s=location.port;s||(s=i?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||s!==r.port}}doWrite(r,i){const s=this.request({method:"POST",data:r});s.on("success",i),s.on("error",(u,c)=>{this.onError("xhr post error",u,c)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(i,s)=>{this.onError("xhr poll error",i,s)}),this.pollXhr=r}}class $n extends ct{constructor(r,i,s){super(),this.createRequest=r,Au(this,s),this._opts=s,this._method=s.method||"GET",this._uri=i,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var r;const i=q1(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(i);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let u in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(u)&&s.setRequestHeader(u,this._opts.extraHeaders[u])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var u;s.readyState===3&&((u=this._opts.cookieJar)===null||u===void 0||u.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(u){this.setTimeoutFn(()=>{this._onError(u)},0);return}typeof document<"u"&&(this._index=$n.requestsCount++,$n.requests[this._index]=this)}_onError(r){this.emitReserved("error",r,this._xhr),this._cleanup(!0)}_cleanup(r){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=dD,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete $n.requests[this._index],this._xhr=null}}_onLoad(){const r=this._xhr.responseText;r!==null&&(this.emitReserved("data",r),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}$n.requestsCount=0;$n.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",kv);else if(typeof addEventListener=="function"){const n="onpagehide"in En?"pagehide":"unload";addEventListener(n,kv,!1)}}function kv(){for(let n in $n.requests)$n.requests.hasOwnProperty(n)&&$n.requests[n].abort()}const pD=function(){const n=V1({xdomain:!1});return n&&n.responseType!==null}();class gD extends mD{constructor(r){super(r);const i=r&&r.forceBase64;this.supportsBinary=pD&&!i}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new $n(V1,this.uri(),r)}}function V1(n){const r=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||hD))return new XMLHttpRequest}catch{}if(!r)try{return new En[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Y1=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class yD extends sm{get name(){return"websocket"}doOpen(){const r=this.uri(),i=this.opts.protocols,s=Y1?{}:q1(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(r,i,s)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=r=>this.onClose({description:"websocket connection closed",context:r}),this.ws.onmessage=r=>this.onData(r.data),this.ws.onerror=r=>this.onError("websocket error",r)}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const s=r[i],u=i===r.length-1;am(s,this.supportsBinary,c=>{try{this.doWrite(s,c)}catch{}u&&Tu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const r=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=F1()),this.supportsBinary||(i.b64=1),this.createUri(r,i)}}const Zh=En.WebSocket||En.MozWebSocket;class _D extends yD{createSocket(r,i,s){return Y1?new Zh(r,i,s):i?new Zh(r,i):new Zh(r)}doWrite(r,i){this.ws.send(i)}}class vD extends sm{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(r){return this.emitReserved("error",r)}this._transport.closed.then(()=>{this.onClose()}).catch(r=>{this.onError("webtransport error",r)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(r=>{const i=eD(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=r.readable.pipeThrough(i).getReader(),u=JM();u.readable.pipeTo(r.writable),this._writer=u.writable.getWriter();const c=()=>{s.read().then(({done:d,value:m})=>{d||(this.onPacket(m),c())}).catch(d=>{})};c();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const s=r[i],u=i===r.length-1;this._writer.write(s).then(()=>{u&&Tu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const bD={websocket:_D,webtransport:vD,polling:gD},ED=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,SD=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function bd(n){if(n.length>8e3)throw"URI too long";const r=n,i=n.indexOf("["),s=n.indexOf("]");i!=-1&&s!=-1&&(n=n.substring(0,i)+n.substring(i,s).replace(/:/g,";")+n.substring(s,n.length));let u=ED.exec(n||""),c={},h=14;for(;h--;)c[SD[h]]=u[h]||"";return i!=-1&&s!=-1&&(c.source=r,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=TD(c,c.path),c.queryKey=AD(c,c.query),c}function TD(n,r){const i=/\/{2,9}/g,s=r.replace(i,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&s.splice(0,1),r.slice(-1)=="/"&&s.splice(s.length-1,1),s}function AD(n,r){const i={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,u,c){u&&(i[u]=c)}),i}const Ed=typeof addEventListener=="function"&&typeof removeEventListener=="function",Wo=[];Ed&&addEventListener("offline",()=>{Wo.forEach(n=>n())},!1);class ia extends ct{constructor(r,i){if(super(),this.binaryType=nD,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,r&&typeof r=="object"&&(i=r,r=null),r){const s=bd(r);i.hostname=s.host,i.secure=s.protocol==="https"||s.protocol==="wss",i.port=s.port,s.query&&(i.query=s.query)}else i.host&&(i.hostname=bd(i.host).host);Au(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(s=>{const u=s.prototype.name;this.transports.push(u),this._transportsByName[u]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=uD(this.opts.query)),Ed&&(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"})},Wo.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const i=Object.assign({},this.opts.query);i.EIO=G1,i.transport=r,this.id&&(i.sid=this.id);const s=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[r]);return new this._transportsByName[r](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&ia.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(r);i.open(),this.setTransport(i)}setTransport(r){this.transport&&this.transport.removeAllListeners(),this.transport=r,r.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",ia.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",r),this.emitReserved("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=r.data,this._onError(i);break;case"message":this.emitReserved("data",r.data),this.emitReserved("message",r.data);break}}onHandshake(r){this.emitReserved("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this._pingInterval=r.pingInterval,this._pingTimeout=r.pingTimeout,this._maxPayload=r.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const r=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+r,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},r),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const r=this._getWritablePackets();this.transport.send(r),this._prevBufferLen=r.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let s=0;s<this.writeBuffer.length;s++){const u=this.writeBuffer[s].data;if(u&&(i+=sD(u)),s>0&&i>this._maxPayload)return this.writeBuffer.slice(0,s);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,Tu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,i,s){return this._sendPacket("message",r,i,s),this}send(r,i,s){return this._sendPacket("message",r,i,s),this}_sendPacket(r,i,s,u){if(typeof i=="function"&&(u=i,i=void 0),typeof s=="function"&&(u=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const c={type:r,data:i,options:s};this.emitReserved("packetCreate",c),this.writeBuffer.push(c),u&&this.once("flush",u),this.flush()}close(){const r=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),r()},s=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():r()}):this.upgrading?s():r()),this}_onError(r){if(ia.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",r),this._onClose("transport error",r)}_onClose(r,i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Ed&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Wo.indexOf(this._offlineEventListener);s!==-1&&Wo.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,i),this.writeBuffer=[],this._prevBufferLen=0}}}ia.protocol=G1;class xD extends ia{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let r=0;r<this._upgrades.length;r++)this._probe(this._upgrades[r])}_probe(r){let i=this.createTransport(r),s=!1;ia.priorWebsocketSuccess=!1;const u=()=>{s||(i.send([{type:"ping",data:"probe"}]),i.once("packet",T=>{if(!s)if(T.type==="pong"&&T.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;ia.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 O=new Error("probe error");O.transport=i.name,this.emitReserved("upgradeError",O)}}))};function c(){s||(s=!0,y(),i.close(),i=null)}const h=T=>{const O=new Error("probe error: "+T);O.transport=i.name,c(),this.emitReserved("upgradeError",O)};function d(){h("transport closed")}function m(){h("socket closed")}function g(T){i&&T.name!==i.name&&c()}const y=()=>{i.removeListener("open",u),i.removeListener("error",h),i.removeListener("close",d),this.off("close",m),this.off("upgrading",g)};i.once("open",u),i.once("error",h),i.once("close",d),this.once("close",m),this.once("upgrading",g),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{s||i.open()},200):i.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const i=[];for(let s=0;s<r.length;s++)~this.transports.indexOf(r[s])&&i.push(r[s]);return i}}let OD=class extends xD{constructor(r,i={}){const s=typeof r=="object"?r:i;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(u=>bD[u]).filter(u=>!!u)),super(r,s)}};function wD(n,r="",i){let s=n;i=i||typeof location<"u"&&location,n==null&&(n=i.protocol+"//"+i.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=i.protocol+n:n=i.host+n),/^(https?|wss?):\/\//.test(n)||(typeof i<"u"?n=i.protocol+"//"+n:n="https://"+n),s=bd(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const c=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+c+":"+s.port+r,s.href=s.protocol+"://"+c+(i&&i.port===s.port?"":":"+s.port),s}const RD=typeof ArrayBuffer=="function",CD=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,Z1=Object.prototype.toString,ND=typeof Blob=="function"||typeof Blob<"u"&&Z1.call(Blob)==="[object BlobConstructor]",MD=typeof File=="function"||typeof File<"u"&&Z1.call(File)==="[object FileConstructor]";function lm(n){return RD&&(n instanceof ArrayBuffer||CD(n))||ND&&n instanceof Blob||MD&&n instanceof File}function Jo(n,r){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let i=0,s=n.length;i<s;i++)if(Jo(n[i]))return!0;return!1}if(lm(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return Jo(n.toJSON(),!0);for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&Jo(n[i]))return!0;return!1}function DD(n){const r=[],i=n.data,s=n;return s.data=Sd(i,r),s.attachments=r.length,{packet:s,buffers:r}}function Sd(n,r){if(!n)return n;if(lm(n)){const i={_placeholder:!0,num:r.length};return r.push(n),i}else if(Array.isArray(n)){const i=new Array(n.length);for(let s=0;s<n.length;s++)i[s]=Sd(n[s],r);return i}else if(typeof n=="object"&&!(n instanceof Date)){const i={};for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=Sd(n[s],r));return i}return n}function BD(n,r){return n.data=Td(n.data,r),delete n.attachments,n}function Td(n,r){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<r.length)return r[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let i=0;i<n.length;i++)n[i]=Td(n[i],r);else if(typeof n=="object")for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=Td(n[i],r));return n}const LD=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],UD=5;var Ce;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(Ce||(Ce={}));class jD{constructor(r){this.replacer=r}encode(r){return(r.type===Ce.EVENT||r.type===Ce.ACK)&&Jo(r)?this.encodeAsBinary({type:r.type===Ce.EVENT?Ce.BINARY_EVENT:Ce.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let i=""+r.type;return(r.type===Ce.BINARY_EVENT||r.type===Ce.BINARY_ACK)&&(i+=r.attachments+"-"),r.nsp&&r.nsp!=="/"&&(i+=r.nsp+","),r.id!=null&&(i+=r.id),r.data!=null&&(i+=JSON.stringify(r.data,this.replacer)),i}encodeAsBinary(r){const i=DD(r),s=this.encodeAsString(i.packet),u=i.buffers;return u.unshift(s),u}}function Iv(n){return Object.prototype.toString.call(n)==="[object Object]"}class om extends ct{constructor(r){super(),this.reviver=r}add(r){let i;if(typeof r=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(r);const s=i.type===Ce.BINARY_EVENT;s||i.type===Ce.BINARY_ACK?(i.type=s?Ce.EVENT:Ce.ACK,this.reconstructor=new HD(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(lm(r)||r.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(r),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+r)}decodeString(r){let i=0;const s={type:Number(r.charAt(0))};if(Ce[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===Ce.BINARY_EVENT||s.type===Ce.BINARY_ACK){const c=i+1;for(;r.charAt(++i)!=="-"&&i!=r.length;);const h=r.substring(c,i);if(h!=Number(h)||r.charAt(i)!=="-")throw new Error("Illegal attachments");s.attachments=Number(h)}if(r.charAt(i+1)==="/"){const c=i+1;for(;++i&&!(r.charAt(i)===","||i===r.length););s.nsp=r.substring(c,i)}else s.nsp="/";const u=r.charAt(i+1);if(u!==""&&Number(u)==u){const c=i+1;for(;++i;){const h=r.charAt(i);if(h==null||Number(h)!=h){--i;break}if(i===r.length)break}s.id=Number(r.substring(c,i+1))}if(r.charAt(++i)){const c=this.tryParse(r.substr(i));if(om.isPayloadValid(s.type,c))s.data=c;else throw new Error("invalid payload")}return s}tryParse(r){try{return JSON.parse(r,this.reviver)}catch{return!1}}static isPayloadValid(r,i){switch(r){case Ce.CONNECT:return Iv(i);case Ce.DISCONNECT:return i===void 0;case Ce.CONNECT_ERROR:return typeof i=="string"||Iv(i);case Ce.EVENT:case Ce.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&LD.indexOf(i[0])===-1);case Ce.ACK:case Ce.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class HD{constructor(r){this.packet=r,this.buffers=[],this.reconPack=r}takeBinaryData(r){if(this.buffers.push(r),this.buffers.length===this.reconPack.attachments){const i=BD(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const zD=Object.freeze(Object.defineProperty({__proto__:null,Decoder:om,Encoder:jD,get PacketType(){return Ce},protocol:UD},Symbol.toStringTag,{value:"Module"}));function Hn(n,r,i){return n.on(r,i),function(){n.off(r,i)}}const kD=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class X1 extends ct{constructor(r,i,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=r,this.nsp=i,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const r=this.io;this.subs=[Hn(r,"open",this.onopen.bind(this)),Hn(r,"packet",this.onpacket.bind(this)),Hn(r,"error",this.onerror.bind(this)),Hn(r,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...r){return r.unshift("message"),this.emit.apply(this,r),this}emit(r,...i){var s,u,c;if(kD.hasOwnProperty(r))throw new Error('"'+r.toString()+'" is a reserved event name');if(i.unshift(r),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const h={type:Ce.EVENT,data:i};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const y=this.ids++,T=i.pop();this._registerAckCallback(y,T),h.id=y}const d=(u=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||u===void 0?void 0:u.writable,m=this.connected&&!(!((c=this.io.engine)===null||c===void 0)&&c._hasPingExpired());return this.flags.volatile&&!d||(m?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(r,i){var s;const u=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(u===void 0){this.acks[r]=i;return}const c=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let d=0;d<this.sendBuffer.length;d++)this.sendBuffer[d].id===r&&this.sendBuffer.splice(d,1);i.call(this,new Error("operation has timed out"))},u),h=(...d)=>{this.io.clearTimeoutFn(c),i.apply(this,d)};h.withError=!0,this.acks[r]=h}emitWithAck(r,...i){return new Promise((s,u)=>{const c=(h,d)=>h?u(h):s(d);c.withError=!0,i.push(c),this.emit(r,...i)})}_addToQueue(r){let i;typeof r[r.length-1]=="function"&&(i=r.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((u,...c)=>s!==this._queue[0]?void 0:(u!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(u)):(this._queue.shift(),i&&i(null,...c)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(r=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!r||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(r){r.nsp=this.nsp,this.io._packet(r)}onopen(){typeof this.auth=="function"?this.auth(r=>{this._sendConnectPacket(r)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(r){this.packet({type:Ce.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},r):r})}onerror(r){this.connected||this.emitReserved("connect_error",r)}onclose(r,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",r,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(r=>{if(!this.sendBuffer.some(s=>String(s.id)===r)){const s=this.acks[r];delete this.acks[r],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case Ce.CONNECT:r.data&&r.data.sid?this.onconnect(r.data.sid,r.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ce.EVENT:case Ce.BINARY_EVENT:this.onevent(r);break;case Ce.ACK:case Ce.BINARY_ACK:this.onack(r);break;case Ce.DISCONNECT:this.ondisconnect();break;case Ce.CONNECT_ERROR:this.destroy();const s=new Error(r.data.message);s.data=r.data.data,this.emitReserved("connect_error",s);break}}onevent(r){const i=r.data||[];r.id!=null&&i.push(this.ack(r.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(r){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const s of i)s.apply(this,r)}super.emit.apply(this,r),this._pid&&r.length&&typeof r[r.length-1]=="string"&&(this._lastOffset=r[r.length-1])}ack(r){const i=this;let s=!1;return function(...u){s||(s=!0,i.packet({type:Ce.ACK,id:r,data:u}))}}onack(r){const i=this.acks[r.id];typeof i=="function"&&(delete this.acks[r.id],i.withError&&r.data.unshift(null),i.apply(this,r.data))}onconnect(r,i){this.id=r,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(r=>this.emitEvent(r)),this.receiveBuffer=[],this.sendBuffer.forEach(r=>{this.notifyOutgoingListeners(r),this.packet(r)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(r=>r()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ce.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(r){return this.flags.compress=r,this}get volatile(){return this.flags.volatile=!0,this}timeout(r){return this.flags.timeout=r,this}onAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(r),this}prependAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(r),this}offAny(r){if(!this._anyListeners)return this;if(r){const i=this._anyListeners;for(let s=0;s<i.length;s++)if(r===i[s])return i.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(r),this}prependAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(r),this}offAnyOutgoing(r){if(!this._anyOutgoingListeners)return this;if(r){const i=this._anyOutgoingListeners;for(let s=0;s<i.length;s++)if(r===i[s])return i.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(r){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const s of i)s.apply(this,r.data)}}}function Ni(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}Ni.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),i=Math.floor(r*this.jitter*n);n=(Math.floor(r*10)&1)==0?n-i:n+i}return Math.min(n,this.max)|0};Ni.prototype.reset=function(){this.attempts=0};Ni.prototype.setMin=function(n){this.ms=n};Ni.prototype.setMax=function(n){this.max=n};Ni.prototype.setJitter=function(n){this.jitter=n};class Ad extends ct{constructor(r,i){var s;super(),this.nsps={},this.subs=[],r&&typeof r=="object"&&(i=r,r=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Au(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 Ni({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=r;const u=i.parser||zD;this.encoder=new u.Encoder,this.decoder=new u.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(r){return arguments.length?(this._reconnection=!!r,r||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(r){return r===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=r,this)}reconnectionDelay(r){var i;return r===void 0?this._reconnectionDelay:(this._reconnectionDelay=r,(i=this.backoff)===null||i===void 0||i.setMin(r),this)}randomizationFactor(r){var i;return r===void 0?this._randomizationFactor:(this._randomizationFactor=r,(i=this.backoff)===null||i===void 0||i.setJitter(r),this)}reconnectionDelayMax(r){var i;return r===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=r,(i=this.backoff)===null||i===void 0||i.setMax(r),this)}timeout(r){return arguments.length?(this._timeout=r,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(r){if(~this._readyState.indexOf("open"))return this;this.engine=new OD(this.uri,this.opts);const i=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const u=Hn(i,"open",function(){s.onopen(),r&&r()}),c=d=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",d),r?r(d):this.maybeReconnectOnOpen()},h=Hn(i,"error",c);if(this._timeout!==!1){const d=this._timeout,m=this.setTimeoutFn(()=>{u(),c(new Error("timeout")),i.close()},d);this.opts.autoUnref&&m.unref(),this.subs.push(()=>{this.clearTimeoutFn(m)})}return this.subs.push(u),this.subs.push(h),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(Hn(r,"ping",this.onping.bind(this)),Hn(r,"data",this.ondata.bind(this)),Hn(r,"error",this.onerror.bind(this)),Hn(r,"close",this.onclose.bind(this)),Hn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(r){try{this.decoder.add(r)}catch(i){this.onclose("parse error",i)}}ondecoded(r){Tu(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,i){let s=this.nsps[r];return s?this._autoConnect&&!s.active&&s.connect():(s=new X1(this,r,i),this.nsps[r]=s),s}_destroy(r){const i=Object.keys(this.nsps);for(const s of i)if(this.nsps[s].active)return;this._close()}_packet(r){const i=this.encoder.encode(r);for(let s=0;s<i.length;s++)this.engine.write(i[s],r.options)}cleanup(){this.subs.forEach(r=>r()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(r,i){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",r,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const r=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{r.skipReconnect||(this.emitReserved("reconnect_attempt",r.backoff.attempts),!r.skipReconnect&&r.open(u=>{u?(r._reconnecting=!1,r.reconnect(),this.emitReserved("reconnect_error",u)):r.onreconnect()}))},i);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const Ys={};function eu(n,r){typeof n=="object"&&(r=n,n=void 0),r=r||{};const i=wD(n,r.path||"/socket.io"),s=i.source,u=i.id,c=i.path,h=Ys[u]&&c in Ys[u].nsps,d=r.forceNew||r["force new connection"]||r.multiplex===!1||h;let m;return d?m=new Ad(s,r):(Ys[u]||(Ys[u]=new Ad(s,r)),m=Ys[u]),i.query&&!r.query&&(r.query=i.queryKey),m.socket(i.path,r)}Object.assign(eu,{Manager:Ad,Socket:X1,io:eu,connect:eu});const ID=[we.ActionTypes.MESSAGE_TO_GUEST,we.ActionTypes.EVENT_TO_GUEST,we.ActionTypes.TYPING_ON,we.ActionTypes.TYPING_OFF,we.ActionTypes.RESTART_CHAT_REQUEST,...qO,...Ix,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],GD=({dispatch:n,getState:r})=>i=>{let s=null;return u=>{const c=i(u);if(u.type===Zd){s?.disconnect(),n(VO());const h=`/chat?${du.stringify(u.querystrings)}`;s=eu(`/${u.clientName}${h}`),s.on("action",n),s.on("connect",()=>n(YO())),s.on("disconnect",()=>n(ZO())),s.on("reconnect",()=>n(XO())),s.on("set-translations",(d,m)=>{n(jM({language:d,messages:NM(d,m)}))}),s.on("set-settings",d=>{n(kM(d))}),s.on("enable-conversation-rating",d=>n(Vx(d))),s.on("speech-transcription",d=>n(qx(d))),s.on("restore-client-state",d=>{n(PO(d.sessionId)),n(Zx(d.messages))}),s.on("expand-window",({devices:d,initial:m=!1})=>{n({type:Db,devices:d,initial:m})}),s.on("restart-chat",()=>{n(bu(u.clientName,u.querystrings))})}else if(u.type===_u)s?.emit("start-chat",u.payload);else if(u.type===vu)s?.emit("terminate-session",u.payload);else if(u.type===kx)s?.emit("get-started",JSON.stringify(u));else if(u.type===Hd)s?.emit("audio-message",u.buffer);else if(u.type===we.ActionTypes.CONVERSATION_RATING_FROM_GUEST)s?.emit("conversation-rating",u.payload);else if(u.type===Lb){const{connection:{sessionId:h}}=r();window.location.href=`/transcript-pdf/${h}`}else ID.indexOf(u.type)===-1&&u.meta===void 0&&s&&s.emit("action",JSON.stringify(u));return c}},Q1=y1(),qD={...FM(Q1),intl:N1},xd=TO({middleware:n=>n().concat(GD),reducer:GM,preloadedState:qD});xd.subscribe(SM(()=>{const n=xd.getState();PM(Q1,{connection:n.connection,startScreen:n.startScreen})},1e3));const FD=document.getElementById("root"),PD=fS.createRoot(FD);PD.render(_.jsx(cT,{store:xd,children:_.jsx(oM,{})}));
|
|
120
|
-
//# sourceMappingURL=index-
|
|
120
|
+
//# sourceMappingURL=index-D-4bXog2.js.map
|