@botfabrik/engine-webclient 4.111.0 → 4.111.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/client/assets/{index-C8v2FYqX.js → index-2NlIygAz.js} +3 -3
- package/dist/client/assets/{index-C8v2FYqX.js.map → index-2NlIygAz.js.map} +1 -1
- package/dist/client/assets/index-BOx6CegN.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/embed/bundle.js +1 -1
- package/package.json +5 -5
- package/dist/client/assets/index-Cl8fPqJ_.css +0 -1
package/README.md
CHANGED
|
@@ -395,9 +395,9 @@ Favicons können z.B. mittels https://realfavicongenerator.net/ generiert werden
|
|
|
395
395
|
--window-right: 1em;
|
|
396
396
|
--window-bottom: 1em;
|
|
397
397
|
--window-left: auto;
|
|
398
|
-
--window-height:
|
|
398
|
+
--window-height: 50em;
|
|
399
399
|
--window-max-height: calc(100vh - 2em);
|
|
400
|
-
--window-width:
|
|
400
|
+
--window-width: 30em;
|
|
401
401
|
--window-border-radius: 8px;
|
|
402
402
|
--header-height: 4em;
|
|
403
403
|
--header-background-color: var(--brand-primary-color);
|
|
@@ -58,10 +58,10 @@ ${fe.current.stack}
|
|
|
58
58
|
`||y[A-1]==="\r");)A--;y=y.slice(0,A),y=`${y.replace(EE,"")}
|
|
59
59
|
|
|
60
60
|
`}if(r.optimizeForStreaming){let A=y.lastIndexOf("<");A!==-1&&y.slice(A).indexOf(">")===-1&&(y=y.slice(0,A))}let b=rm(h?m:y,{inline:h,refs:d},p);return wE(b,{...p,forceInline:h})}let d={};return f(n)}var RE=({children:n,options:l,...r})=>{if(!(typeof q.useContext<"u")){let d={...l,overrides:{...l?.overrides},wrapperProps:{...l?.wrapperProps,...r}};return _h(n??"",d)}let o=q.useContext(TE),c=q.useMemo(()=>({...o,...l,overrides:{...o?.overrides,...l?.overrides},wrapperProps:{...o?.wrapperProps,...l?.wrapperProps,...r}}),[o,l,r]),f=n??"";return q.useMemo(()=>_h(f,c),[f,c])},NE=RE,xl=NE;const ME="_generalConditionsContainer_55hjg_1",DE="_generalConditions_55hjg_1",LE="_generalConditionsHeader_55hjg_15",zE="_generalConditionsBody_55hjg_26",kE="_generalConditionsAccept_55hjg_35",Mo={generalConditionsContainer:ME,generalConditions:DE,generalConditionsHeader:LE,generalConditionsBody:zE,generalConditionsAccept:kE},BE=()=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"})}),jE=()=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"})}),UE="general-conditions.header",HE="general-conditions.body",tv="general-conditions.accept-conditions-note",qE=()=>{const n=Rt(),[l,r]=q.useState(!1),o=()=>r(!l),c=m=>{m.key==="ArrowDown"||m.key==="ArrowRight"?r(!0):m.key==="ArrowUp"||m.key==="ArrowLeft"||m.key==="Escape"?r(!1):(m.key==="Enter"||m.key==="Space"||m.key===" ")&&o()},f=n(UE),d=n(tv);return v.jsxs("div",{className:se(Mo.generalConditionsContainer,"chat__generalConditions"),children:[!!f?.length&&v.jsxs("div",{className:Mo.generalConditions,children:[v.jsxs("div",{role:"button",onClick:o,onKeyDown:c,tabIndex:0,className:se(Mo.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":l?"true":"false","aria-pressed":l?"true":"false",children:[v.jsx(xl,{children:f}),l?v.jsx(jE,{}):v.jsx(BE,{})]}),v.jsx("div",{className:se(Mo.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:l&&v.jsx(xl,{children:n(HE)||""})})]}),!!d?.length&&v.jsx("div",{className:se(Mo.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:v.jsx(xl,{children:n(tv)||""})})]})},IE="_messageContainer_1rxi5_1",GE="_message_1rxi5_1",VE="_messageBot_1rxi5_14",YE="_messageBotLast_1rxi5_45",XE="_avatar_1rxi5_45",FE="_messageBotFirst_1rxi5_54",KE="_messageBotAnimated_1rxi5_67",JE="_messageGuest_1rxi5_78",ZE="_messageGuestFirst_1rxi5_84",WE="_messageGuestLast_1rxi5_90",PE="_botAvatar_1rxi5_104",QE="_agentAvatar_1rxi5_108",$E="_bubble_1rxi5_112",e6="_bubbleContent_1rxi5_118",t6="_bubbleLeft_1rxi5_132",n6="_leftText_1rxi5_143",a6="_bubbleRight_1rxi5_150",l6="_rightText_1rxi5_160",r6="_sourceInfoReference_1rxi5_192",i6="_sourceInfoReferenceActive_1rxi5_204",Ne={messageContainer:IE,message:GE,messageBot:VE,messageBotLast:YE,avatar:XE,messageBotFirst:FE,messageBotAnimated:KE,messageGuest:JE,messageGuestFirst:ZE,messageGuestLast:WE,botAvatar:PE,agentAvatar:QE,bubble:$E,bubbleContent:e6,bubbleLeft:t6,leftText:n6,bubbleRight:a6,rightText:l6,sourceInfoReference:r6,sourceInfoReferenceActive:i6},im=(n,l)=>{q.useEffect(()=>{const r=o=>{n.current&&!n.current.contains(o.target)&&l()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[n,l])};function o6(n,l){let r=null,o=null;const c=(...f)=>{o=f,r&&clearTimeout(r),r=setTimeout(()=>{n(...o),r=null,o=null},l)};return c.flush=()=>{r&&o&&(clearTimeout(r),n(...o),r=null,o=null)},c}function s6(n,l){let r=0,o=null;return((...c)=>{const f=Date.now(),d=f-r;d>=l?(r=f,n(...c)):(o&&clearTimeout(o),o=setTimeout(()=>{r=Date.now(),n(...c)},l-d))})}const c6="_container_131ib_1",u6="_categoryContainer_131ib_13",f6="_categoryButton_131ib_20",d6="_active_131ib_35",h6="_commentTextarea_131ib_44",Do={container:c6,categoryContainer:u6,categoryButton:f6,active:d6,commentTextarea:h6},m6=(n,l,r)=>{q.useEffect(()=>{if(n){const o=()=>{const f=["button:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"a[href]","input:not([disabled])","select:not([disabled])"].join(","),d=l.current?Array.from(l.current.querySelectorAll(f)):[],m=r.current?Array.from(r.current.querySelectorAll(f)):[];return[...d,...m]},c=f=>{if(f.key==="Tab"){const d=o();if(d.length>0){const m=d[0],h=d[d.length-1],p=document.activeElement;!f.shiftKey&&p===h?(f.preventDefault(),m.focus()):f.shiftKey&&p===m&&(f.preventDefault(),h.focus())}}};return document.addEventListener("keydown",c,!0),()=>{document.removeEventListener("keydown",c,!0)}}},[n,l,r])},p6=({open:n,actionsRef:l,reaction:r,onReaction:o})=>{const c=Rt(),f=q.useRef(null),d=o6(p=>{o({...r,comment:p})},300);q.useEffect(()=>()=>d.flush(),[d]),m6(n,l,f);const m=p=>{o({...r,category:r.category===p?void 0:p})},h=p=>d(p.target.value);return n?v.jsxs("div",{ref:f,className:Do.container,role:"dialog","aria-modal":"true","aria-labelledby":"bad-reaction-title",children:[v.jsx("h2",{id:"bad-reaction-title",children:c("bot-bubble.reaction.say-more")}),v.jsx("div",{className:Do.categoryContainer,role:"radiogroup",children:["WRONG_INFORMATION","MISSING_INFORMATION","OLD_INFORMATION","UNCLEAR","OFF_TOPIC"].map(p=>v.jsx("button",{className:se(Do.categoryButton,r?.category===p&&Do.active),onClick:()=>m(p),"aria-pressed":r?.category===p,"aria-label":c(`bot-bubble.reaction.category.${p}`),tabIndex:0,role:"radio",children:c(`bot-bubble.reaction.category.${p}`)},p))}),v.jsx("textarea",{id:"comment",name:"comment",placeholder:c("bot-bubble.reaction.comment"),defaultValue:r?.comment,onChange:h,className:Do.commentTextarea,rows:3,"aria-label":c("bot-bubble.reaction.comment")})]}):null},g6="_botMessageActionContainer_g6hpe_1",v6="_alwaysVisible_g6hpe_15",y6="_active_g6hpe_19",b6="_botMessageActionInnerContainer_g6hpe_27",_6="_header_g6hpe_52",A6="_botMessageActions_g6hpe_57",C6="_reported_g6hpe_68",S6="_action_g6hpe_72",E6="_anyReport_g6hpe_120",T6="_closeButton_g6hpe_136",dn={botMessageActionContainer:g6,alwaysVisible:v6,active:y6,botMessageActionInnerContainer:b6,header:_6,botMessageActions:A6,reported:C6,action:S6,anyReport:E6,closeButton:T6},x6=({isSubmitting:n,onClick:l})=>{const r=Rt();return v.jsx("button",{className:se(dn.action,dn.closeButton,"tooltip--bottom-left"),"aria-label":r("bot-bubble.reaction.close"),"data-title":r("bot-bubble.reaction.close"),tabIndex:0,onClick:l,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:n?v.jsx("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}):v.jsx("path",{d:"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"})})})},O6=({alwaysVisible:n,senderType:l,reaction:r,botMessageRef:o,message:c,onReaction:f})=>{const d=Rt(),[m,h]=q.useState(!1),[p,y]=q.useState(!1),[b,A]=q.useState(!1),S=q.useRef(null),O=q.useRef(null);im(S,()=>{A(!1)});const C=H=>{H.key==="Escape"&&A(!1)};q.useEffect(()=>(document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C)}),[]),q.useEffect(()=>{b&&S.current?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[b]);const E=H=>{O.current&&clearTimeout(O.current),y(!0),f(H),O.current=setTimeout(()=>{y(!1)},1e3)},x=q.useCallback(async()=>{if(o.current)try{h(!0);const H=o.current.innerHTML,B=o.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([H],{type:"text/html"}),"text/plain":new Blob([B],{type:"text/plain"})})]),await new Promise(X=>setTimeout(X,1500))}finally{h(!1)}},[o]),M=()=>{A(!1),f(r?.type==="GOOD"?null:{type:"GOOD"})},L=()=>{f({...c.reaction,type:"BAD"}),A(!b)},z=H=>B=>{(B.key==="Enter"||B.key===" ")&&H()};return v.jsx("div",{ref:S,className:se(dn.botMessageActionContainer,n&&dn.alwaysVisible,b&&dn.active),"aria-hidden":"true",children:v.jsxs("div",{className:se(dn.botMessageActionInnerContainer,n&&dn.alwaysVisible,b&&dn.active,r&&dn.reported),role:"group","aria-label":d("bot-bubble.actions.label"),children:[v.jsxs("div",{className:dn.header,children:[v.jsxs("div",{className:se(dn.botMessageActions,r&&dn.reported),children:[l===Fo.BOT&&v.jsx("button",{className:se(dn.action,r?.type&&dn.anyReport,r?.type==="GOOD"&&dn.reported,"tooltip--top-right"),tabIndex:0,"aria-label":d(r?.type==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),"aria-pressed":r?.type==="GOOD","data-title":d(r?.type==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),onPointerDown:M,onKeyDown:z(M),children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:r?.type==="GOOD"?v.jsx("path",{d:"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32Z"}):v.jsx("path",{d:"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32ZM223.94,97l-12,96a8,8,0,0,1-7.94,7H88V105.89l36.71-73.43A24,24,0,0,1,144,56V80a8,8,0,0,0,8,8h64a8,8,0,0,1,7.94,9Z"})})}),l===Fo.BOT&&v.jsx("button",{className:se(dn.action,r?.type&&dn.anyReport,r?.type==="BAD"&&dn.reported,"tooltip--top-right"),tabIndex:0,"aria-label":d("bot-bubble.reaction.bad"),"aria-pressed":r?.type==="BAD","data-title":d("bot-bubble.reaction.bad"),onPointerDown:L,onKeyDown:z(L),children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:r?.type==="BAD"?v.jsx("path",{d:"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Z"}):v.jsx("path",{d:"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Zm150,21.29a7.88,7.88,0,0,1-6,2.71H152a8,8,0,0,0-8,8v24a24,24,0,0,1-19.29,23.54L88,150.11V56H204a8,8,0,0,1,7.94,7l12,96A7.87,7.87,0,0,1,222,165.29Z"})})}),v.jsx("button",{className:se(dn.action,"tooltip--top-right"),style:{visibility:b?"hidden":"visible"},tabIndex:0,"aria-label":d("bot-bubble.copy"),"data-title":d("bot-bubble.copy"),onClick:x,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:m?v.jsx("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}):v.jsx("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"})})})]}),b&&v.jsx(x6,{isSubmitting:p,onClick:()=>A(!1)})]}),c.reaction&&v.jsx(p6,{open:b,actionsRef:S,reaction:c.reaction,onReaction:E})]})})},jy=q.forwardRef(({message:n,isAnimated:l,isLastMessage:r,isFirstMessageBySender:o,isLastMessageBySender:c,children:f,onReaction:d},m)=>{const h=Rt(),p=q.useRef(null),y=n.sender.type===Rl.BOT;return v.jsxs("li",{ref:m,className:se(Ne.message,Ne.messageBot,r&&Ne.lastMessage,o&&Ne.messageBotFirst,c&&Ne.messageBotLast,"chat__bubbleContainer",l&&Ne.messageBotAnimated,l&&"chat__bubbleContainer--animated",y?"chat__botBubbleContainer":"chat__agentBubbleContainer",o&&"chat__bubbleContainer--first",c&&"chat__bubbleContainer--last"),role:"article",children:[v.jsx("img",{className:se(Ne.avatar,y?Ne.botAvatar:Ne.agentAvatar,"chat__avatar",y?"chat__botAvatar":"chat__agentAvatar"),src:`${n.sender.avatar}`,alt:y?"Bot":"Agent",referrerPolicy:"no-referrer","aria-hidden":"true"}),v.jsxs("div",{className:Ne.messageContainer,children:[v.jsx("div",{ref:p,className:se(Ne.bubble,Ne.bubbleLeft,"chat__bubble",y?"chat__botBubble":"chat__agentBubble"),tabIndex:0,role:"group","aria-label":h(y?"bot-bubble.label":"agent-bubble.label"),children:v.jsx("div",{className:se(Ne.leftText),children:f})}),d&&v.jsx(O6,{alwaysVisible:r&&c,senderType:n.sender.type,reaction:n.reaction,message:n,botMessageRef:p,onReaction:d})]})]})}),w6="_sourceList_1sc0q_1",R6="_source_1sc0q_1",N6="_label_1sc0q_39",Xd={sourceList:w6,source:R6,label:N6},Uy=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),Hy=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z"})}),qy=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M222,152a6,6,0,0,1-6,6H190v20h18a6,6,0,0,1,0,12H190v18a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6h32A6,6,0,0,1,222,152ZM90,172a26,26,0,0,1-26,26H54v10a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6H64A26,26,0,0,1,90,172Zm-12,0a14,14,0,0,0-14-14H54v28H64A14,14,0,0,0,78,172Zm84,8a34,34,0,0,1-34,34H112a6,6,0,0,1-6-6V152a6,6,0,0,1,6-6h16A34,34,0,0,1,162,180Zm-12,0a22,22,0,0,0-22-22H118v44h10A22,22,0,0,0,150,180ZM42,112V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88v24a6,6,0,0,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,0,1-12,0ZM158,82h35.52L158,46.48Z"})}),Iy=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"})}),M6=({type:n,...l})=>{switch(n){case"WEBSITE":return v.jsx(Iy,{...l});case"PDF":return v.jsx(qy,{...l});case"DOCX":return v.jsx(Uy,{...l});default:return v.jsx(Hy,{...l})}},om=({sources:n,onLinkClick:l})=>{const r=Rt(),o=f=>()=>{l(f.url)},c=f=>d=>{(d.key==="Enter"||d.key===" ")&&l(f.url)};return n.length?v.jsx("ul",{className:Xd.sourceList,"aria-label":r("bot-bubble.sources"),children:n.map(f=>v.jsx("li",{className:Xd.source,children:v.jsxs("a",{role:"button",tabIndex:0,"aria-label":`${r("bot-bubble.source.open")}: ${f.label}`,onClick:o(f),onKeyDown:c(f),children:[v.jsx(M6,{type:f.type,"aria-hidden":"true"}),v.jsx("div",{className:Xd.label,children:f.label})]})},f.url))}):null},D6="_button_3ui4g_1",L6="_buttonDefault_3ui4g_13",z6="_buttonPrimary_3ui4g_28",Jo={button:D6,buttonDefault:L6,buttonPrimary:z6},yu=({className:n,children:l,...r})=>v.jsx("button",{className:se(Jo.button,n),type:"button",role:"button",...r,children:l}),k6="_title_137pi_1",B6="_buttons_137pi_6",j6="_button_137pi_6",U6="_imageContainer_137pi_29",H6="_image_137pi_29",q6="_video_container_137pi_44",I6="_video_137pi_44",G6="_only_137pi_58",ma={title:k6,buttons:B6,button:j6,imageContainer:U6,image:H6,video_container:q6,video:I6,only:G6},V6=({buttons:n,onButtonClick:l})=>v.jsx("div",{className:se(ma.buttons,"chat__bubbleButtons"),children:n.map((r,o)=>v.jsx(yu,{className:se(ma.button,"chat__bubbleButton"),onClick:()=>l(r),children:r.title},o))}),nv="newtab#",Gy=({markdown:n,markdownOptions:l={},onLinkClick:r})=>{const o=f=>d=>(d.preventDefault(),f&&r(f),!1),c=({title:f,href:d,children:m})=>d.indexOf(nv)===0?v.jsx("a",{href:d.slice(nv.length),title:f,target:"_blank",rel:"noopener noreferrer",children:m}):v.jsx("a",{onClick:o(d),title:f,href:d,children:m});return v.jsx(xl,{options:{...l,overrides:{a:c}},children:n})},Y6=({text:n,onLinkClick:l})=>n?v.jsx("div",{children:v.jsx(Gy,{markdown:n,onLinkClick:l})}):null,X6=({title:n})=>n?v.jsx("h1",{className:ma.title,children:n}):null,F6=({title:n,text:l,buttons:r,onButtonClick:o,onLinkClick:c})=>n?.length||l?.length||r?.length?v.jsxs("div",{className:se(Ne.bubbleContent),children:[v.jsx(X6,{title:n}),v.jsx(Y6,{text:l,onLinkClick:c}),v.jsx(V6,{buttons:r,onButtonClick:o})]}):null,K6=({alt:n,imageUrl:l,itemUrl:r,hasBody:o})=>l?r?r.indexOf("youtube.com")>-1?v.jsx("div",{className:ma.video_container,children:v.jsx("iframe",{className:se(ma.video,{[ma.only]:!o}),title:"Youtube",width:"100%",src:r+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):v.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:v.jsx("div",{className:ma.imageContainer,children:v.jsx("img",{className:se(ma.image,{[ma.only]:!o}),src:l,alt:n})})}):v.jsx("div",{className:ma.imageContainer,children:v.jsx("img",{className:se(ma.image,{[ma.only]:!o}),src:l,alt:n})}):null,J6=({title:n,text:l,imageUrl:r,itemUrl:o,buttons:c,sources:f,onButtonClick:d,onLinkClick:m})=>{const h=!!n?.length||!!l?.length||!!c?.length;return v.jsxs("div",{className:se(ma.detailMessage),children:[v.jsx(K6,{hasBody:h,imageUrl:r,itemUrl:o,alt:n||""}),h&&v.jsx(F6,{title:n,text:l,buttons:c,onLinkClick:m,onButtonClick:d}),v.jsx(om,{sources:f,onLinkClick:m})]})},Z6=q.forwardRef(({isFirstMessageBySender:n,isLastMessageBySender:l,children:r},o)=>{const c=Rt();return v.jsx("li",{ref:o,className:se(Ne.message,Ne.messageGuest,n&&Ne.messageGuestFirst,l&&Ne.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",n&&"chat__bubbleContainer--first",l&&"chat__bubbleContainer--last"),role:"article",children:v.jsx("div",{className:se(Ne.bubble,Ne.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,role:"group","aria-label":c("guest-bubble.label"),children:v.jsx("div",{className:se(Ne.rightText),children:r})})})}),sm=()=>q.useMemo(()=>au(),[]),W6="_markdown_nw7vg_1",Vy={markdown:W6},yc="source-info-reference",P6=({actionId:n,markdown:l,sources:r,onLinkClick:o})=>{const c=sm(),f=Dl(),d=Q6(),m=Bt(y=>{const b=y.chat.sourceInfos;if(b?.type==="loaded"||b?.type==="loading")return b.chunkId}),h=y=>b=>{const A=b.key;(A==="ArrowDown"||A==="ArrowRight"||A==="Enter"||A===" "||A==="Space")&&(b.stopPropagation(),f(M1(c,n,y)))},p=y=>()=>{f(M1(c,n,y))};return q.useLayoutEffect(()=>{document.querySelectorAll(`.${yc}`).forEach(y=>{const b=y.previousSibling;b&&b.nodeType===Node.TEXT_NODE&&b.textContent?.endsWith(" ")&&b.textContent?.trim().length&&y.classList.add(`${yc}--before-space`);const A=y.nextSibling;A&&A.nodeType===Node.TEXT_NODE&&A.textContent?.startsWith(" ")&&A.textContent?.trim().length&&y.classList.add(`${yc}--after-space`)})},[l]),v.jsxs("div",{className:Ne.bubbleContent,children:[v.jsx("div",{className:Vy.markdown,children:v.jsx(Gy,{markdown:l,onLinkClick:o,markdownOptions:{renderRule(y,b,A,S){if(b.type===Q.footnoteReference){const O=b.text===m;return v.jsx("span",{className:se(Ne.sourceInfoReference,O&&Ne.sourceInfoReferenceActive,yc),children:v.jsx("a",{type:"button",tabIndex:0,onClick:p(b.text),onKeyDown:h(b.text),children:d(b.text)})},S.key)}return y()}}})}),v.jsx(om,{sources:r,onLinkClick:o})]})},Q6=()=>{const n=[];return r=>{const o=n.indexOf(r);return o>-1?o+1:(n.push(r),n.length)}},$6="_text_gp0s0_1",eT="_command_gp0s0_5",av={text:$6,command:eT},tT=({text:n,commands:l=[]})=>{const r=l.find(c=>n.startsWith(`/${c}`)),o=r?n.slice(r.length+1):n;return v.jsxs("div",{children:[r&&v.jsxs("code",{className:av.command,children:["/",r]}),o.split(`
|
|
61
|
-
`).map((c,f)=>v.jsxs("span",{className:av.text,children:[c,v.jsx("br",{})]},f))]})},nT=({text:n,commands:l,sources:r,onLinkClick:o})=>v.jsxs("div",{className:Ne.bubbleContent,children:[v.jsx(tT,{text:n,commands:l}),v.jsx(om,{sources:r,onLinkClick:o})]}),aT=q.forwardRef(({message:n,commands:l,isLastMessage:r,isFirstMessageBySender:o,isLastMessageBySender:c,onReaction:f,onButtonClick:d,onLinkClick:m},h)=>{const p=lT(n._id,n,l,d,m),y=b=>{f(n._id,b)};return n.sender.type===Rl.GUEST?v.jsx(Z6,{ref:h,isFirstMessageBySender:o,isLastMessageBySender:c,children:p}):v.jsx(jy,{ref:h,message:n,isAnimated:!1,isLastMessage:r,isFirstMessageBySender:o,isLastMessageBySender:c,onReaction:y,children:p})}),lT=(n,l,r,o,c)=>{switch(l.type){case Mi.TEXT:{const f=l;return v.jsx(nT,{text:f.text,commands:r,sources:l.sources||[],onLinkClick:c})}case Mi.DETAIL:{const f=l;return v.jsx(J6,{title:f.title,text:f.text,imageUrl:f.imageUrl,itemUrl:f.itemUrl,buttons:f.buttons,sources:l.sources||[],onButtonClick:o,onLinkClick:c})}case Mi.MARKDOWN:{const f=l;return v.jsx(P6,{actionId:n,markdown:f.markdown,sources:f.sources||[],onLinkClick:c})}}},rT=(n,l)=>n.message._id===l.message._id&&n.message.reaction===l.message.reaction&&n.isLastMessage===l.isLastMessage&&n.isFirstMessageBySender===l.isFirstMessageBySender&&n.isLastMessageBySender===l.isLastMessageBySender,iT=Mv.memo(aT,rT),oT="_ticontainer_xg0dn_1",sT="_tiblock_xg0dn_5",cT="_tidot_xg0dn_12",Lo={ticontainer:oT,tiblock:sT,tidot:cT},uT=({isTyping:n=!1})=>v.jsx("div",{className:Lo.ticontainer,children:v.jsx("div",{className:Lo.tiblock,children:n?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:se(Lo.tidot,"chat__typingIndicator"),"aria-hidden":"true"}),v.jsx("div",{className:se(Lo.tidot,"chat__typingIndicator"),"aria-hidden":"true"}),v.jsx("div",{className:se(Lo.tidot,"chat__typingIndicator"),"aria-hidden":"true"})]}):null})}),fT=Object.assign({_id:"typing-indicator"},new nu("",new WA)),dT=({messages:n,isBotTyping:l,commands:r,onTranscriptItemReaction:o,onButtonClick:c,onLinkClick:f})=>{const d=Rt(),m=q.useRef(0),h=q.useRef(!0),p=q.useRef(null),y=q.useRef(null),b=q.useRef(null),A=Bt(C=>C.settings.enableGeneralConditions);q.useLayoutEffect(()=>{if(n.length&&p.current&&(m.current<n.length||l)){if(y.current){const C=y.current.offsetTop;p.current.scrollTop=C}else if(b.current){const C=b.current.offsetTop;p.current.scrollTop=C}h.current&&(h.current=!1),m.current=n.length}},[n,h,l]);let S;const O=n.length;return v.jsxs("div",{ref:p,className:se(L1.messageContainer,"chat__messageContainer"),style:{scrollBehavior:n.length&&h.current?"auto":"smooth"},id:"MessageContainer","aria-label":d("conversation.label"),children:[A&&v.jsx(qE,{}),v.jsxs("ul",{className:L1.messages,role:"list",children:[n.map((C,E)=>{const x=hT(C,S),M=mT(C,E,n,l);S=C.sender.type;const L=E+1===O,z=C._id||`added-${E}`;return v.jsx(iT,{ref:L?b:null,message:C,commands:r,isLastMessage:L,isFirstMessageBySender:x,isLastMessageBySender:M,onButtonClick:c,onLinkClick:f,onReaction:o},z)}),l&&v.jsx(jy,{ref:y,message:fT,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:S!==Rl.BOT,isLastMessageBySender:!0,children:v.jsx(uT,{isTyping:!0})},"last")]})]})},hT=(n,l)=>!l||l!==n.sender.type,mT=(n,l,r,o)=>{const c=n.sender.type,f=r.length;return l+1===f?!(c===Rl.BOT&&o):c!==r.at(l+1)?.sender.type},pT="_bottomSheet_jp8dl_1",gT="_bottomSheetOpen_jp8dl_15",vT="_bottomSheetClose_jp8dl_20",Ol={bottomSheet:pT,bottomSheetOpen:gT,bottomSheetClose:vT},yT="_container_xc2nx_1",lv={container:yT},bT=({contentUrl:n})=>{const l=Bt(f=>f.connection.sessionId),[r,o]=q.useState(!1);q.useEffect(()=>{o(f=>f||!!n)},[n]);const c=q.useMemo(()=>{if(n&&l){const f=new URL(n,document.baseURI);return f.searchParams.set("sessionId",l),f.toString()}else return},[n,l]);return v.jsx("div",{className:se(lv.container,Ol.bottomSheet,{[Ol.bottomSheetOpen]:!!n,[Ol.bottomSheetClose]:r&&!n}),children:c&&v.jsx("iframe",{title:"Drawer",id:"form-drawer",src:c,className:lv.iframe})})},_T="
|
|
61
|
+
`).map((c,f)=>v.jsxs("span",{className:av.text,children:[c,v.jsx("br",{})]},f))]})},nT=({text:n,commands:l,sources:r,onLinkClick:o})=>v.jsxs("div",{className:Ne.bubbleContent,children:[v.jsx(tT,{text:n,commands:l}),v.jsx(om,{sources:r,onLinkClick:o})]}),aT=q.forwardRef(({message:n,commands:l,isLastMessage:r,isFirstMessageBySender:o,isLastMessageBySender:c,onReaction:f,onButtonClick:d,onLinkClick:m},h)=>{const p=lT(n._id,n,l,d,m),y=b=>{f(n._id,b)};return n.sender.type===Rl.GUEST?v.jsx(Z6,{ref:h,isFirstMessageBySender:o,isLastMessageBySender:c,children:p}):v.jsx(jy,{ref:h,message:n,isAnimated:!1,isLastMessage:r,isFirstMessageBySender:o,isLastMessageBySender:c,onReaction:y,children:p})}),lT=(n,l,r,o,c)=>{switch(l.type){case Mi.TEXT:{const f=l;return v.jsx(nT,{text:f.text,commands:r,sources:l.sources||[],onLinkClick:c})}case Mi.DETAIL:{const f=l;return v.jsx(J6,{title:f.title,text:f.text,imageUrl:f.imageUrl,itemUrl:f.itemUrl,buttons:f.buttons,sources:l.sources||[],onButtonClick:o,onLinkClick:c})}case Mi.MARKDOWN:{const f=l;return v.jsx(P6,{actionId:n,markdown:f.markdown,sources:f.sources||[],onLinkClick:c})}}},rT=(n,l)=>n.message._id===l.message._id&&n.message.reaction===l.message.reaction&&n.isLastMessage===l.isLastMessage&&n.isFirstMessageBySender===l.isFirstMessageBySender&&n.isLastMessageBySender===l.isLastMessageBySender,iT=Mv.memo(aT,rT),oT="_ticontainer_xg0dn_1",sT="_tiblock_xg0dn_5",cT="_tidot_xg0dn_12",Lo={ticontainer:oT,tiblock:sT,tidot:cT},uT=({isTyping:n=!1})=>v.jsx("div",{className:Lo.ticontainer,children:v.jsx("div",{className:Lo.tiblock,children:n?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:se(Lo.tidot,"chat__typingIndicator"),"aria-hidden":"true"}),v.jsx("div",{className:se(Lo.tidot,"chat__typingIndicator"),"aria-hidden":"true"}),v.jsx("div",{className:se(Lo.tidot,"chat__typingIndicator"),"aria-hidden":"true"})]}):null})}),fT=Object.assign({_id:"typing-indicator"},new nu("",new WA)),dT=({messages:n,isBotTyping:l,commands:r,onTranscriptItemReaction:o,onButtonClick:c,onLinkClick:f})=>{const d=Rt(),m=q.useRef(0),h=q.useRef(!0),p=q.useRef(null),y=q.useRef(null),b=q.useRef(null),A=Bt(C=>C.settings.enableGeneralConditions);q.useLayoutEffect(()=>{if(n.length&&p.current&&(m.current<n.length||l)){if(y.current){const C=y.current.offsetTop;p.current.scrollTop=C}else if(b.current){const C=b.current.offsetTop;p.current.scrollTop=C}h.current&&(h.current=!1),m.current=n.length}},[n,h,l]);let S;const O=n.length;return v.jsxs("div",{ref:p,className:se(L1.messageContainer,"chat__messageContainer"),style:{scrollBehavior:n.length&&h.current?"auto":"smooth"},id:"MessageContainer","aria-label":d("conversation.label"),children:[A&&v.jsx(qE,{}),v.jsxs("ul",{className:L1.messages,role:"list",children:[n.map((C,E)=>{const x=hT(C,S),M=mT(C,E,n,l);S=C.sender.type;const L=E+1===O,z=C._id||`added-${E}`;return v.jsx(iT,{ref:L?b:null,message:C,commands:r,isLastMessage:L,isFirstMessageBySender:x,isLastMessageBySender:M,onButtonClick:c,onLinkClick:f,onReaction:o},z)}),l&&v.jsx(jy,{ref:y,message:fT,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:S!==Rl.BOT,isLastMessageBySender:!0,children:v.jsx(uT,{isTyping:!0})},"last")]})]})},hT=(n,l)=>!l||l!==n.sender.type,mT=(n,l,r,o)=>{const c=n.sender.type,f=r.length;return l+1===f?!(c===Rl.BOT&&o):c!==r.at(l+1)?.sender.type},pT="_bottomSheet_jp8dl_1",gT="_bottomSheetOpen_jp8dl_15",vT="_bottomSheetClose_jp8dl_20",Ol={bottomSheet:pT,bottomSheetOpen:gT,bottomSheetClose:vT},yT="_container_xc2nx_1",lv={container:yT},bT=({contentUrl:n})=>{const l=Bt(f=>f.connection.sessionId),[r,o]=q.useState(!1);q.useEffect(()=>{o(f=>f||!!n)},[n]);const c=q.useMemo(()=>{if(n&&l){const f=new URL(n,document.baseURI);return f.searchParams.set("sessionId",l),f.toString()}else return},[n,l]);return v.jsx("div",{className:se(lv.container,Ol.bottomSheet,{[Ol.bottomSheetOpen]:!!n,[Ol.bottomSheetClose]:r&&!n}),children:c&&v.jsx("iframe",{title:"Drawer",id:"form-drawer",src:c,className:lv.iframe})})},_T="_container_1634s_1",AT={container:_T},CT=({title:n,href:l,children:r})=>v.jsx("a",{href:l,title:n,target:"_blank",rel:"noopener noreferrer",children:r}),ST=()=>{const l=Rt()("powered-by");return l&&l.length?v.jsx("div",{className:se(AT.container,"chat__poweredBy"),children:v.jsx(xl,{options:{overrides:{a:CT}},children:l})}):null},ET=(n,l)=>{const r=new Map;let o=0;return n.replace(/^#{1,6}\s+/gm,"").replace(/(\*\*|__)(.*?)\1/g,"$2").replace(/(\*|_)(.*?)\1/g,"$2").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\[\^([^\]]+)\]/g,(c,f)=>(r.has(f)||r.set(f,++o),`(${l} ${r.get(f)})`)).replace(/`([^`]+)`/g,"$1").replace(/```[\s\S]*?```/g,"").replace(/^>\s+/gm,"").replace(/^(-{3,}|_{3,}|\*{3,})$/gm,"").replace(/^[\s]*[-*+]\s+/gm,"").replace(/^[\s]*\d+\.\s+/gm,"").replace(/\n{3,}/g,`
|
|
62
62
|
|
|
63
63
|
`).trim()},TT=({messages:n,isBotTyping:l})=>{const r=q.useRef(""),o=Rt(),c=o("bot-bubble.footnote"),f=h=>{switch(h.type){case"TEXT":return h.text||"";case"MARKDOWN":{const p=h.markdown||"";return ET(p,c)}case"DETAIL":return h.text||h.title||"";default:return""}},m=(()=>{if(l)return o("chatbot.typing")??"Chatbot is typing";const h=[...n].reverse().find(p=>p.sender.type===Fo.BOT);return h?f(h):""})();return q.useEffect(()=>{m!==r.current&&(r.current=m)},[m]),v.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:m})},Yy=({className:n,children:l,...r})=>v.jsx(yu,{className:se(Jo.buttonDefault,n),type:"button",...r,children:l}),$c=({className:n,children:l,...r})=>v.jsx(yu,{className:se(Jo.buttonPrimary,n),...r,children:l}),xT="_container_h23mk_1",OT="_formContainer_h23mk_17",wT="_emailInput_h23mk_22",RT="_description_h23mk_52",NT="_actions_h23mk_57",MT="_validationError_h23mk_67",DT="_submitted_h23mk_74",qr={container:xT,formContainer:OT,emailInput:wT,description:RT,actions:NT,validationError:MT,submitted:DT},LT=({visible:n,onEmailExport:l,onClose:r})=>{const o=Rt(),[c,f]=q.useState(void 0),[d,m]=q.useState(!1),[h,p]=q.useState(void 0),y=q.useRef(null);q.useEffect(()=>{n?(y.current?.focus(),m(!1),f(n)):c===!0&&f(!1)},[n,c]);const b=S=>{S.preventDefault(),h&&h.length>0&&(l(h),m(!0),setTimeout(r,3*1e3))},A=S=>{const O=S.target.value.trim(),C=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(O);p(C?O:"")};return v.jsxs("div",{className:se(qr.container,Ol.bottomSheet,{[Ol.bottomSheetOpen]:c===!0,[Ol.bottomSheetClose]:c===!1}),children:[v.jsx("h2",{children:o("export-transcript.email.title")}),v.jsx(xl,{className:qr.description,children:o("export-transcript.email.description")||""}),v.jsxs("form",{onSubmit:b,className:qr.formContainer,children:[v.jsxs("div",{children:[v.jsx("input",{disabled:d,ref:y,type:"email",placeholder:o("export-transcript.email.placeholder"),className:qr.emailInput,onChange:A}),h?.length===0?v.jsx("div",{className:qr.validationError,children:o("export-transcript.email.invalid")}):null]}),v.jsxs("div",{className:qr.actions,children:[v.jsx(Yy,{onClick:r,children:o("export-transcript.email.cancel")}),v.jsx($c,{type:"submit",disabled:d||h===void 0||h.length===0,children:o("export-transcript.email.send")})]})]}),d&&v.jsx("div",{className:qr.submitted,children:o("export-transcript.email.success")})]})},zT="_inputContainer_fi5ao_1",kT={inputContainer:zT},BT="_blockUserInput_pot9c_1",jT={blockUserInput:BT},UT=({visible:n})=>{const l=Rt();return n?v.jsx("div",{className:se(jT.blockUserInput,"chat__blockUserInput"),children:l("block-user-input.title")}):null},HT="_commandsDropdown_fmklx_1",qT="_commands_fmklx_1",IT="_command_fmklx_1",GT="_commandActive_fmklx_49",bc={commandsDropdown:HT,commands:qT,command:IT,commandActive:GT},VT=(n,l,r,o,c)=>{q.useEffect(()=>{const f=d=>{if(n.length)switch(d.key){case"Enter":r(n[l]);break;case"ArrowUp":o(m=>m>0?m-1:n.length-1);break;case"ArrowDown":o(m=>m<n.length-1?m+1:0);break;case"Escape":c([]);break}};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[n,l,r,o,c])},YT=({text:n,commands:l,onSelectCommand:r,onVisibilityChange:o})=>{const c=q.useRef(null),f=Rt(),[d,m]=q.useState([]),[h,p]=q.useState(rv(l)),[y,b]=q.useState(0),A=S=>r(`/${S}`);return im(c,()=>m([])),VT(d,y,A,b,m),q.useEffect(()=>{p(rv(l))},[l]),q.useEffect(()=>{const S=n.length||0;S===0||S>h||!n.startsWith("/")?m([]):m(l.filter(XT(n))),b(0)},[l,n,h]),q.useEffect(()=>{o(!!d.length)},[d,o]),d.length?v.jsx("div",{ref:c,className:bc.commandsDropdown,children:v.jsx("ul",{id:"command-list",className:bc.commands,role:"listbox",children:d.map((S,O)=>v.jsxs("li",{className:se([bc.command,y===O&&bc.commandActive]),role:"option",onClick:()=>A(S),onMouseOver:()=>b(O),children:[v.jsxs("h1",{children:["/",S]}),v.jsx("p",{children:f(`commands.${S}`)})]},S))})}):null},rv=n=>Math.max(...n.map(l=>l.length+1)),XT=n=>l=>{const r=`/${l}`;return r.startsWith(n)&&r.length>=n.length},FT="_callToActionContainer_d8izj_1",KT="_callToActionTitle_d8izj_23",JT="_rateOverlay_d8izj_30",ZT="_body_d8izj_52",WT="_footer_d8izj_60",PT="_actions_d8izj_75",QT="_bubbles_d8izj_89",$T="_stars_d8izj_191",e3="_starsSmall_d8izj_205",t3="_starsLarge_d8izj_211",n3="_star_d8izj_191",a3="_starReadonly_d8izj_225",l3="_starIcon_d8izj_235",r3="_starsDescriptionContainer_d8izj_253",i3="_starsDescription_d8izj_253",kn={callToActionContainer:FT,callToActionTitle:KT,rateOverlay:JT,body:ZT,footer:WT,actions:PT,bubbles:QT,stars:$T,starsSmall:e3,starsLarge:t3,star:n3,starReadonly:a3,starIcon:l3,starsDescriptionContainer:r3,starsDescription:i3},o3=({value:n,index:l,count:r,readonly:o,onHover:c,onClick:f})=>{const d=m=>{f&&m.key==="Enter"&&f()};return v.jsx("li",{className:se(kn.star,{[kn.starReadonly]:o},"chat__conversationRating__star"),children:v.jsx("div",{role:"radio","aria-checked":n>l?"true":"false","aria-posinset":l+1,"aria-setsize":r,tabIndex:0,onMouseOver:c,onKeyDown:d,onClick:f,children:v.jsx("span",{role:"img","aria-label":"Star",className:se(kn.starIcon),children:v.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:v.jsx("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"})})})})})},iv=5,Xy=({value:n,size:l,readonly:r=!1,onChange:o})=>{const[c,f]=q.useState(void 0),d=()=>{f(void 0)},m=p=>()=>{if(!r){const y=p+1;f(y)}},h=p=>()=>{o&&!r&&(o(p===0&&n===1?0:p+1),f(void 0))};return v.jsx("ul",{tabIndex:0,role:"radiogroup",className:se(kn.stars,{[kn.starsSmall]:l==="small",[kn.starsLarge]:l==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:l==="small",chat__conversationRating__stars__large:l==="large"}),onMouseOut:d,children:Array(iv).fill(0).map((p,y)=>v.jsx(o3,{value:c===void 0?n:c,index:y,count:iv,readonly:r,onHover:m(y),onClick:h(y)},y))})},s3=({visible:n,onRate:l})=>{const r=Rt();return n?v.jsxs("div",{className:se(kn.callToActionContainer,"chat__conversationRating__callToAction"),children:[v.jsx("div",{className:se(kn.callToActionTitle,"chat__conversationRating__callToAction__title"),children:r("conversation-rating.call-to-action.title")}),v.jsx(Xy,{value:0,size:"small",onChange:l})]}):null},Fd=({isFirstMessageBySender:n,isLastMessageBySender:l,children:r})=>v.jsxs("div",{className:se(Ne.message,Ne.messageBot,n&&Ne.messageBotFirst,l&&Ne.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",n&&"chat__bubbleContainer--first",l&&"chat__bubbleContainer--last"),children:[v.jsx("img",{className:se(Ne.avatar,Ne.botAvatar),src:"bot.svg",alt:"Bot"}),v.jsx("div",{className:se(Ne.bubble,Ne.bubbleLeft,"chat__bubble","chat__botBubble"),children:v.jsx("div",{className:se(Ne.leftText,Ne.bubbleContent),children:r})})]}),c3=({children:n})=>v.jsx("div",{className:se(Ne.message,Ne.messageGuest,Ne.messageGuestFirst,Ne.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:v.jsx("div",{className:se(Ne.bubble,Ne.bubbleRight,"chat__bubble","chat__guestBubble"),children:v.jsx("div",{className:se(Ne.rightText,Ne.bubbleContent),children:n})})}),u3=()=>{const n=Rt(),l=Dl(),r=Bt(E=>E.chat.conversationRating),[o,c]=q.useState(r.rating?.value||0),[f,d]=q.useState(void 0),[m,h]=q.useState(void 0),[p,y]=q.useState({submitted:!1,feedback:""}),b=q.useRef(null),[A,S]=q.useState(!1);q.useEffect(()=>{r.opener?(y({submitted:!1,feedback:""}),h(!0)):m===!0&&h(!1)},[r.opener,m]),q.useEffect(()=>{c(r.rating?.value||0)},[r.rating?.value,r.opener]),q.useEffect(()=>{b.current&&(b.current.value=r.rating?.feedback||"")},[r.rating?.feedback]),q.useEffect(()=>{const E=o>0?n(`conversation-rating.overlay.bot-message.rate-feedback.value-${o}`):void 0;d(E?.length?E:void 0)},[o,n]),q.useEffect(()=>{p.submitted?setTimeout(()=>S(!0),p.feedback.length?500:0):S(!1)},[p]);const O=E=>{E.preventDefault();const x=b.current?.value?.trim()||"";l(sC(o,x)),y({submitted:!0,feedback:x})},C=()=>{r.opener==="CLOSE_CHAT"?l(Ay()):r.opener==="RESTART_CHAT"?l(Wo()):l(dS())};return v.jsx("div",{className:se(kn.rateOverlay,Ol.bottomSheet,"chat__conversationRating__overlay",{[Ol.bottomSheetOpen]:m===!0,[Ol.bottomSheetClose]:m===!1}),children:v.jsxs("form",{onSubmit:O,children:[v.jsxs("div",{className:se(kn.body,"chat__conversationRating__overlay__body"),children:[v.jsx("div",{}),v.jsx("div",{className:se(kn.bubbles),children:r.opener&&v.jsxs(v.Fragment,{children:[v.jsxs(Fd,{isFirstMessageBySender:!0,isLastMessageBySender:!f,children:[v.jsx("h2",{children:n("conversation-rating.overlay.title")}),v.jsxs("div",{className:se(kn.starsDescriptionContainer),children:[v.jsx(Xy,{value:o,size:"large",readonly:p.submitted,onChange:c}),v.jsxs("div",{className:se(kn.starsDescription),children:[v.jsx("div",{children:n("conversation-rating.overlay.star.very-bad")}),v.jsx("div",{children:n("conversation-rating.overlay.star.very-good")})]})]})]}),f&&v.jsx(Fd,{isFirstMessageBySender:!1,isLastMessageBySender:!A||!!p.feedback.length,children:v.jsx("div",{children:f})}),!!p.feedback.length&&v.jsx(c3,{children:p.feedback}),A&&v.jsx(Fd,{isFirstMessageBySender:!!p.feedback.length,isLastMessageBySender:!0,children:v.jsx("div",{children:n("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),v.jsxs("div",{className:se(kn.footer,"chat__conversationRating__overlay__footer"),children:[!p.submitted&&v.jsx("input",{ref:b,defaultValue:r.rating?.feedback||"",placeholder:n("conversation-rating.overlay.guest-feedback.input-placeholder")}),v.jsxs("div",{className:se(kn.actions,"chat__conversationRating__overlay__footer__actions"),children:[p.submitted?v.jsx($c,{type:"button",disabled:!o,onClick:C,children:r.opener==="CLOSE_CHAT"?n("conversation-rating.overlay.action.close-chat"):r.opener==="RESTART_CHAT"?n("conversation-rating.overlay.action.restart-chat"):n("conversation-rating.overlay.action.back-to-chat")},"close-button"):v.jsx($c,{type:"submit",disabled:!o,children:n("conversation-rating.overlay.action.submit")},"submit-button"),r.opener!=="CHAT"&&!p.submitted&&v.jsx(Yy,{onClick:C,children:r.opener==="CLOSE_CHAT"?n("conversation-rating.overlay.action.close-chat"):r.opener==="RESTART_CHAT"?n("conversation-rating.overlay.action.restart-chat"):n("conversation-rating.overlay.action.cancel")})]})]})]})})},f3=({numberOfMessagesFromGuest:n})=>{const l=Dl(),r=Bt(f=>f.chat.conversationRating),o=f=>{l(Xc("CHAT",f))},c=!r.rating?.value&&n>=1;return r.enabled?v.jsxs(v.Fragment,{children:[v.jsx(s3,{visible:c,onRate:o}),v.jsx(u3,{})]}):null},d3=q.memo(f3),h3="_inputWrapper_18j9q_1",m3="_withOpenCommands_18j9q_13",p3="_actions_18j9q_18",g3="_messageInputWrapper_18j9q_53",v3="_messageInput_18j9q_53",y3="_buttons_18j9q_78",b3="_button_18j9q_78",Ir={inputWrapper:h3,withOpenCommands:m3,actions:p3,messageInputWrapper:g3,messageInput:v3,buttons:y3,button:b3},_3="_audioRecorder_g845f_1",A3="_audioButton_g845f_6",C3="_recorderIcon_g845f_37",S3="_spinning_g845f_60",Gr={audioRecorder:_3,audioButton:A3,recorderIcon:C3,spinning:S3},ov=2048,eu=16e3;class E3 extends Mv.Component{audioInput=null;volume=null;leftchannel=[];recorder=null;recordingLength=0;sampleRate=null;mediaStream=null;constructor(l){super(l),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(l){this.mediaStream=l,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(l)}initRecording(l){const r=window.AudioContext||window.webkitAudioContext,o=new r;this.sampleRate=o.sampleRate,this.volume=o.createGain(),this.audioInput=o.createMediaStreamSource(l),this.audioInput.connect(this.volume),this.recorder=o.createScriptProcessor(ov,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(o.destination)}processRecordingInput(l){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const r=l.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(r)),this.recordingLength+=ov}}handleClickSubmitAudio(){const l=x3(this.leftchannel,this.recordingLength),r=O3(l,this.sampleRate||0),o=T3(r);this.props.onAudioRecorded(o),this.handleClickStopAudio()}handleClickStopAudio(){this.setState({recordingState:"none"}),this.audioInput?.disconnect(),this.volume?.disconnect(),this.recorder?.disconnect(),this.mediaStream&&this.mediaStream?.getAudioTracks().forEach(l=>{l.stop()})}render(){return v.jsxs("div",{className:Gr.audioRecorder,children:[this.state.recordingState==="none"&&v.jsx("button",{className:se(Gr.audioButton,"chat__button"),type:"submit","aria-label":this.props.translate("message-input.actions.start-audio-recording.label"),"data-title":this.props.translate("message-input.actions.start-audio-recording.label"),tabIndex:0,onClick:this.triggerAudioRecording,children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z"}),v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&v.jsxs("svg",{className:Gr.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&v.jsxs("div",{className:Gr.audioRecorder,children:[v.jsx("button",{className:se(Gr.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),v.jsx("div",{className:Gr.recorderIcon}),v.jsx("button",{className:se(Gr.audioButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),v.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const T3=n=>{const l=new ArrayBuffer(44+n.length*2),r=new DataView(l);_c(r,0,"RIFF"),r.setUint32(4,44+n.length*2,!0),_c(r,8,"WAVE"),_c(r,12,"fmt "),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,eu,!0),r.setUint32(28,eu*4,!0),r.setUint16(32,4,!0),r.setUint16(34,16,!0),_c(r,36,"data"),r.setUint32(40,n.length*2,!0);const o=n.length;let c=44;const f=1;for(let d=0;d<o;d++)r.setInt16(c,n[d]*(32767*f),!0),c+=2;return new Blob([r],{type:"audio/wav"})},_c=(n,l,r)=>{for(let o=0;o<r.length;o++)n.setUint8(l+o,r.charCodeAt(o))},x3=(n,l)=>{const r=new Float32Array(l);let o=0;const c=n.length;for(let f=0;f<c;f++){const d=n[f];r.set(d,o),o+=d.length}return r},O3=(n,l)=>{if(eu===l)return n;const r=l/eu,o=Math.round(n.length/r),c=new Float32Array(o);let f=0,d=0;for(;f<c.length;){const m=Math.round((f+1)*r);let h=0,p=0;for(let y=d;y<m&&y<n.length;y++)h+=n[y],p++;c[f]=h/p,f++,d=m}return c},w3=({onClick:n})=>{const l=Rt();return v.jsxs("button",{onClick:n,type:"button","aria-label":l("message-input.actions.command.label"),children:[v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"#000000",viewBox:"0 0 256 256",children:[v.jsx("rect",{x:"32",y:"32",width:"192",height:"192",rx:"16",ry:"16",fill:"none",stroke:"currentColor","stroke-width":"16"}),v.jsx("line",{x1:"80",y1:"176",x2:"176",y2:"80",stroke:"currentColor","stroke-width":"16","stroke-linecap":"round"})]}),v.jsx("span",{children:l("message-input.actions.command.label")})]})},R3=({disabled:n,textInput:l,commandsVisible:r,hasCommands:o,onTextInput:c,onTextInputSubmit:f,onAudioRecorded:d})=>{const m=Rt(),h=q.useRef(null),p=q.useRef(0),{enableSpeechSupport:y}=Bt(x=>x.settings),b=x=>{x.style.height="";const{scrollHeight:M}=x,L=Math.max(p.current,Math.min(M,150));x.style.height=`${L}px`,x.style.overflowY=M>150?"auto":"hidden"};q.useEffect(()=>{const x=h.current;x&&(p.current===0&&(p.current=x.scrollHeight),b(x),x.focus())},[l]);const A=()=>{const x=h.current;x&&l.trim().length>=1&&f(l.trim())&&(x.value="",x.style.height="",x.focus())},S=x=>{x.preventDefault(),A()},O=x=>{const M=x.target.value;c(M),b(x.target)},C=x=>{x.code==="Enter"&&!x.shiftKey?(x.repeat||A(),x.preventDefault()):r&&(x.code==="ArrowUp"||x.code==="ArrowDown")&&x.preventDefault()},E=()=>{l.startsWith("/")?c(""):c("/")};return v.jsxs("form",{className:se(Ir.inputWrapper,r&&Ir.withOpenCommands,"chat__textInput"),onSubmit:S,children:[v.jsxs("div",{className:Ir.messageInputWrapper,children:[v.jsx("textarea",{id:"user_input",ref:h,className:Ir.messageInput,tabIndex:0,placeholder:m("message-input-placeholder"),value:l,onChange:O,onKeyDown:C,"aria-label":m("message-input-label"),"aria-controls":o?"command-list":void 0,"aria-haspopup":o?"listbox":void 0}),o&&v.jsx("div",{className:Ir.actions,children:v.jsx(w3,{onClick:E})})]}),v.jsx("div",{className:se(Ir.buttons,"chat__buttons"),children:l.length||!y||navigator.mediaDevices===void 0?v.jsx("button",{className:se(Ir.button,"chat__button"),type:"submit","aria-label":m("message-input.actions.submit.label"),"data-title":m("message-input.actions.submit.label"),tabIndex:0,disabled:n,children:v.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:v.jsx("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})})}):y&&navigator.mediaDevices!==void 0&&v.jsx(E3,{translate:m,onAudioRecorded:d})})]})},N3="_quickReplies_83npe_1",M3="_quickReply_83npe_9",sv={quickReplies:N3,quickReply:M3},D3=({quickReplies:n,onQuickReplyClick:l})=>n.length?v.jsx("div",{className:se(sv.quickReplies,"chat__quickReplies"),children:n.map(r=>v.jsx(yu,{tabIndex:0,className:se(sv.quickReply,"chat__button","chat__quickReply"),onClick:()=>l(r),children:r.label},r.label))}):null,cv=5e3,L3=1e3,z3=({isBotTyping:n,quickReplies:l,numberOfMessagesFromGuest:r,commands:o,onTextInput:c,onQuickReplyClick:f,onAudioRecorded:d})=>{const[m,h]=q.useState(""),[p,y]=q.useState(!1),[b,A]=q.useState(!1),S=q.useRef(0),O=q.useRef(0);q.useEffect(()=>{if(p&&!n){const x=S.current?Date.now()-S.current:0;x>cv?y(!1):setTimeout(()=>{y(!1)},cv-x)}},[p,n]),q.useEffect(()=>{p&&(S.current=Date.now())},[p]);const C=x=>{const M=Date.now()-O.current<L3;return b?!1:n||M?(y(!0),!1):(c(x),h(""),O.current=Date.now(),!0)},E=x=>{h(x+" ")};return v.jsxs("div",{className:se(kT.inputContainer),children:[v.jsx(D3,{quickReplies:l,onQuickReplyClick:f}),v.jsx(UT,{visible:p}),!p&&v.jsx(d3,{numberOfMessagesFromGuest:r}),!!o?.length&&v.jsx(YT,{text:m,commands:o,onSelectCommand:E,onVisibilityChange:A}),v.jsx(R3,{textInput:m,disabled:p,commandsVisible:b,hasCommands:!!o?.length,onTextInput:h,onTextInputSubmit:C,onAudioRecorded:d})]})},k3=({clientName:n,messages:l,quickReplies:r,isBotTyping:o,drawerContentUrl:c,onMessageFromUser:f,onQuickReplyClick:d,onButtonClick:m,onLinkClick:h,onAudioRecorded:p,onTranscriptExport:y,onTranscriptItemReaction:b})=>{const A=Dl(),S=Bt(z=>z.connection.connectionState),{enableTranscriptExportEmail:O,commands:C}=Bt(z=>z.settings),{showTranscriptMailOverlay:E,conversationRating:x}=Bt(z=>z.chat),M=l.filter(z=>z.sender.type===Fo.GUEST).length;q.useEffect(()=>{S===Xr.CONNECTED&&A(Sy(n))},[n,S,A]);const L=()=>{A(Cy())};return v.jsxs("div",{className:Vd.container,children:[v.jsx(TT,{messages:l,isBotTyping:o}),v.jsxs("div",{className:se([Vd.chatcontent,(E||x?.opener)&&Vd.accessabilityHidden]),children:[v.jsx(dT,{messages:l,isBotTyping:o,commands:C,onButtonClick:m,onLinkClick:h,onTranscriptItemReaction:b}),v.jsx(z3,{isBotTyping:o,quickReplies:o?[]:r,numberOfMessagesFromGuest:M,commands:C,onQuickReplyClick:d,onTextInput:f,onAudioRecorded:p}),v.jsx(ST,{})]}),O&&v.jsx(LT,{visible:!!E,onEmailExport:y,onClose:L}),v.jsx(bT,{contentUrl:c})]})},B3=n=>{const{messages:l,quickReplies:r,isBotTyping:o,drawerContentUrl:c}=n.chat;return{messages:l,quickReplies:r,isBotTyping:o,drawerContentUrl:c}},j3=n=>({onRestartChat:()=>n(Wo()),onMessageFromUser:l=>n(Kv(l)),onAudioRecorded:l=>n(aC(l)),onActionFromUser:l=>n(l),onQuickReplyClick:l=>n(Fv(l)),onNluEvent:l=>n(Qv(l)),onButtonClick:l=>n(uC(l)),onLinkClick:l=>n($v(l)),onTranscriptExport:l=>n(rC(l)),onTranscriptItemReaction:(l,r)=>{n(eC(l,r?.type||null,r?.category,r?.comment))}}),U3=DA(B3,j3)(k3),Fy=()=>q.useMemo(()=>{try{return window.self!==window.top}catch{return!0}},[]),H3=n=>l=>{const r=l.key;(r==="ArrowDown"||r==="ArrowRight"||r==="Enter"||r===" "||r==="Space")&&(l.stopPropagation(),n())},q3=({onClick:n})=>{const l=Rt();return Fy()?v.jsx("button",{className:"tooltip--bottom-left","aria-label":l("header.close-chat"),"data-title":l("header.close-chat"),tabIndex:0,onClick:n,onKeyDown:H3(n),children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"})})}):null},I3="_header_3gvbz_1",G3="_logoContainer_3gvbz_14",V3="_logo_3gvbz_14",Y3="_actions_3gvbz_28",X3="_active_3gvbz_43",F3="_menuContainer_3gvbz_56",K3="_menu_3gvbz_56",J3="_divider_3gvbz_86",sr={header:I3,logoContainer:G3,logo:V3,actions:Y3,active:X3,menuContainer:F3,menu:K3,divider:J3},Z3=({icon:n})=>{switch(n){case"arrow-counter-clockwise":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"})});case"download":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"})});case"expand":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"})});case"mail":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"})});case"phone":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M144.27,45.93a8,8,0,0,1,9.8-5.66,86.22,86.22,0,0,1,61.66,61.66,8,8,0,0,1-5.66,9.8A8.23,8.23,0,0,1,208,112a8,8,0,0,1-7.73-5.94,70.35,70.35,0,0,0-50.33-50.33A8,8,0,0,1,144.27,45.93Zm-2.33,41.8c13.79,3.68,22.65,12.54,26.33,26.33A8,8,0,0,0,176,120a8.23,8.23,0,0,0,2.07-.27,8,8,0,0,0,5.66-9.8c-5.12-19.16-18.5-32.54-37.66-37.66a8,8,0,1,0-4.13,15.46Zm81.94,95.35A56.26,56.26,0,0,1,168,232C88.6,232,24,167.4,24,88A56.26,56.26,0,0,1,72.92,32.12a16,16,0,0,1,16.62,9.52l21.12,47.15,0,.12A16,16,0,0,1,109.39,104c-.18.27-.37.52-.57.77L88,129.45c7.49,15.22,23.41,31,38.83,38.51l24.34-20.71a8.12,8.12,0,0,1,.75-.56,16,16,0,0,1,15.17-1.4l.13.06,47.11,21.11A16,16,0,0,1,223.88,183.08Zm-15.88-2s-.07,0-.11,0h0l-47-21.05-24.35,20.71a8.44,8.44,0,0,1-.74.56,16,16,0,0,1-15.75,1.14c-18.73-9.05-37.4-27.58-46.46-46.11a16,16,0,0,1,1-15.7,6.13,6.13,0,0,1,.57-.77L96,95.15l-21-47a.61.61,0,0,1,0-.12A40.2,40.2,0,0,0,40,88,128.14,128.14,0,0,0,168,216,40.21,40.21,0,0,0,208,181.07Z"})});case"scroll":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M96,104a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H104A8,8,0,0,1,96,104Zm8,40h64a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16Zm128,48a32,32,0,0,1-32,32H88a32,32,0,0,1-32-32V64a16,16,0,0,0-32,0c0,5.74,4.83,9.62,4.88,9.66h0A8,8,0,0,1,24,88a7.89,7.89,0,0,1-4.79-1.61h0C18.05,85.54,8,77.61,8,64A32,32,0,0,1,40,32H176a32,32,0,0,1,32,32V168h8a8,8,0,0,1,4.8,1.6C222,170.46,232,178.39,232,192ZM96.26,173.48A8.07,8.07,0,0,1,104,168h88V64a16,16,0,0,0-16-16H67.69A31.71,31.71,0,0,1,72,64V192a16,16,0,0,0,32,0c0-5.74-4.83-9.62-4.88-9.66A7.82,7.82,0,0,1,96.26,173.48ZM216,192a12.58,12.58,0,0,0-3.23-8h-94a26.92,26.92,0,0,1,1.21,8,31.82,31.82,0,0,1-4.29,16H200A16,16,0,0,0,216,192Z"})});case"star":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"})});case"link":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"})});default:return v.jsx("div",{})}},W3=q.forwardRef(({selected:n,item:l,onClick:r},o)=>{const c=Rt(),f=d=>{d.preventDefault(),r()};return v.jsx("li",{"aria-selected":n,role:"option",className:l.withDivider?sr.divider:void 0,children:v.jsxs("a",{ref:o,type:"button",role:"button",tabIndex:-1,onClick:f,children:[v.jsx(Z3,{icon:l.icon}),v.jsx("span",{children:c(`header.menu.${l.id}`)})]})})}),P3=(n,l)=>{const r=Fy(),{menuItems:o,enableStandaloneView:c,enableTranscriptExportPdf:f,enableTranscriptExportEmail:d}=Bt(p=>p.settings),m=Bt(p=>p.chat.conversationRating.enabled);return q.useMemo(()=>{const p=[],y=o.filter(({visibility:b})=>n?b==="always"||b==="chat-only":b==="always"||b==="start-screen-only");if(n&&(p.push({id:"restart-chat",type:"restart-chat",icon:"arrow-counter-clockwise",visibility:"chat-only"}),r&&c&&p.push({id:"expand-chat-window",type:"expand-chat-window",icon:"expand",visibility:"always"}),l&&f&&p.push({id:"download-transcript",type:"download-transcript",icon:"download",visibility:"chat-only"}),l&&d&&p.push({id:"send-transcript",type:"send-transcript",icon:"mail",visibility:"chat-only"}),l&&m&&p.push({id:"rate-conversation",type:"rate-conversation",icon:"star",visibility:"chat-only"}),p.length>0&&y.length)){const b=p.pop();b&&o.length&&p.push({...b,withDivider:!0})}return p.push(...y),p},[n,l,f,d,c,m,r,o])},Q3=({chatStarted:n,hasGuestMessages:l})=>{const r=Dl(),o=Rt(),{enabled:c,opener:f}=Bt(M=>M.chat.conversationRating),[d,m]=q.useState(!1),[h,p]=q.useState(-1),y=q.useRef(null),b=q.useRef(null),A=q.useRef([]),S=P3(n,l);q.useEffect(()=>{A.current[h]?.focus()},[h]);const O=q.useCallback(()=>{r(l&&c&&!f?Xc("RESTART_CHAT"):Wo()),m(!1),p(0)},[l,c,f,r]),C=q.useCallback(M=>{switch(M.type){case"restart-chat":{O();break}case"expand-chat-window":{const L=new URL(window.location.origin);L.pathname=window.location.pathname,L.search=window.location.search,L.hash=window.location.hash,window.open(L.href,"_blank");break}case"download-transcript":{r(iC());break}case"send-transcript":{r(Cy());break}case"rate-conversation":{r(Xc("MENU"));break}case"link":{r($v(M.url));break}case"action":{r(JSON.parse(JSON.stringify(M.action)));break}}m(!1)},[r,O,m]);q.useEffect(()=>{const M=L=>{if(d)switch(L.key){case"Enter":L.preventDefault(),C(S[h]);break;case"ArrowUp":p(z=>z>0?z-1:S.length-1);break;case"ArrowDown":p(z=>z<S.length-1?z+1:0);break;case"Escape":m(!1);break;case"Tab":h>-1&&m(!1);break}};return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[d,h,S,p,m,C]),q.useEffect(()=>{d||p(-1)},[d,h]),im(b,()=>m(!1));const E=()=>{m(M=>!M)},x=()=>{setTimeout(()=>{const M=document.activeElement;b.current&&!b.current.contains(M)&&m(!1)},0)};return S.length?v.jsxs("div",{className:se(sr.menuContainer),ref:b,children:[v.jsx("button",{ref:y,className:se(d&&sr.active,d?"tooltip-hidden":"tooltip--bottom-left"),"aria-label":o("header.menu.title"),"data-title":o("header.menu.title"),onClick:E,onBlur:x,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"})})}),d&&v.jsx("nav",{className:sr.menu,"aria-label":o("header.menu.title"),children:v.jsx("ul",{tabIndex:0,children:S.map((M,L)=>v.jsx(W3,{ref:z=>{A.current[L]=z},selected:h===L,item:M,onClick:()=>C(M)},M.id))})})]}):null},uv=({className:n,chatStarted:l,...r})=>{const o=Dl(),c=Bt(m=>m.chat.conversationRating),f=Bt(m=>m.chat.messages.some(h=>h.sender.type===Rl.GUEST)),d=()=>{c.enabled&&!c.opener&&f?o(Xc("CLOSE_CHAT")):o(Ay())};return v.jsxs("div",{className:se(sr.header,n),...r,children:[v.jsx("div",{className:sr.logoContainer,children:v.jsx("div",{className:sr.logo})}),v.jsxs("div",{className:sr.actions,children:[v.jsx(Q3,{chatStarted:l,hasGuestMessages:f}),v.jsx(q3,{onClick:d})]})]})},$3="_chatwindow_rkbir_1",e8="_chatwindowWithAside_rkbir_21",fv={chatwindow:$3,chatwindowWithAside:e8},Ky=()=>{const[n,l]=q.useState(!1);return q.useEffect(()=>{const r=window.matchMedia("(max-width: 1023px)"),o=()=>l(r.matches);return o(),r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),n},t8="_sourceInfos_vei0l_1",n8="_waitForLoading_vei0l_24",a8="_loadingContent_vei0l_28",l8="_sourceHeader_vei0l_37",r8="_sourceHeaderIcon_vei0l_57",i8="_sourceContent_vei0l_61",o8="_openSourceButton_vei0l_69",s8="_sourceButtonLabel_vei0l_79",c8="_closeSourceInfosButton_vei0l_101",u8="_loadingSourceInfos_vei0l_125",f8="_loading_vei0l_28",d8="_loadingError_vei0l_139",h8="_highlightLoadingInfo_vei0l_155",m8="_highlightLoadingInfoInnerContainer_vei0l_169",p8="_highlightLoadingInfoContent_vei0l_178",g8="_highlightLoadingInfoCloseIcon_vei0l_198",v8="_highlightLoader_vei0l_203",y8="_highlightLoaderLoading_vei0l_210",yn={sourceInfos:t8,waitForLoading:n8,loadingContent:a8,sourceHeader:l8,sourceHeaderIcon:r8,sourceContent:i8,openSourceButton:o8,sourceButtonLabel:s8,closeSourceInfosButton:c8,loadingSourceInfos:u8,loading:f8,loadingError:d8,highlightLoadingInfo:h8,highlightLoadingInfoInnerContainer:m8,highlightLoadingInfoContent:p8,highlightLoadingInfoCloseIcon:g8,highlightLoader:v8,highlightLoaderLoading:y8},b8=({onClick:n})=>{const l=Rt();return v.jsx("button",{className:se(yn.closeSourceInfosButton,"tooltip--bottom-left"),"aria-label":l("source-infos.close"),"data-title":l("source-infos.close"),tabIndex:0,onClick:n,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})})},_8=q.forwardRef(({sourceInfos:n,onClose:l,...r},o)=>v.jsxs("div",{className:yn.sourceHeader,...r,ref:o,children:[v.jsx("div",{children:n?v.jsx("p",{id:"source-info-title",children:n.title}):v.jsx("p",{children:" "})}),v.jsx(b8,{onClick:l})]})),A8=({loading:n})=>v.jsx("div",{className:yn.highlightLoader,children:n&&v.jsx("div",{className:yn.highlightLoaderLoading})});const{entries:Jy,setPrototypeOf:dv,isFrozen:C8,getPrototypeOf:S8,getOwnPropertyDescriptor:E8}=Object;let{freeze:In,seal:La,create:wc}=Object,{apply:Ah,construct:Ch}=typeof Reflect<"u"&&Reflect;In||(In=function(l){return l});La||(La=function(l){return l});Ah||(Ah=function(l,r){for(var o=arguments.length,c=new Array(o>2?o-2:0),f=2;f<o;f++)c[f-2]=arguments[f];return l.apply(r,c)});Ch||(Ch=function(l){for(var r=arguments.length,o=new Array(r>1?r-1:0),c=1;c<r;c++)o[c-1]=arguments[c];return new l(...o)});const Ac=Gn(Array.prototype.forEach),T8=Gn(Array.prototype.lastIndexOf),hv=Gn(Array.prototype.pop),zo=Gn(Array.prototype.push),x8=Gn(Array.prototype.splice),Rc=Gn(String.prototype.toLowerCase),Kd=Gn(String.prototype.toString),Jd=Gn(String.prototype.match),ko=Gn(String.prototype.replace),O8=Gn(String.prototype.indexOf),w8=Gn(String.prototype.trim),ha=Gn(Object.prototype.hasOwnProperty),zn=Gn(RegExp.prototype.test),Bo=R8(TypeError);function Gn(n){return function(l){l instanceof RegExp&&(l.lastIndex=0);for(var r=arguments.length,o=new Array(r>1?r-1:0),c=1;c<r;c++)o[c-1]=arguments[c];return Ah(n,l,o)}}function R8(n){return function(){for(var l=arguments.length,r=new Array(l),o=0;o<l;o++)r[o]=arguments[o];return Ch(n,r)}}function Ie(n,l){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Rc;dv&&dv(n,null);let o=l.length;for(;o--;){let c=l[o];if(typeof c=="string"){const f=r(c);f!==c&&(C8(l)||(l[o]=f),c=f)}n[c]=!0}return n}function N8(n){for(let l=0;l<n.length;l++)ha(n,l)||(n[l]=null);return n}function Wa(n){const l=wc(null);for(const[r,o]of Jy(n))ha(n,r)&&(Array.isArray(o)?l[r]=N8(o):o&&typeof o=="object"&&o.constructor===Object?l[r]=Wa(o):l[r]=o);return l}function jo(n,l){for(;n!==null;){const o=E8(n,l);if(o){if(o.get)return Gn(o.get);if(typeof o.value=="function")return Gn(o.value)}n=S8(n)}function r(){return null}return r}const mv=In(["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","search","section","select","shadow","slot","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"]),Zd=In(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Wd=In(["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"]),M8=In(["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"]),Pd=In(["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"]),D8=In(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pv=In(["#text"]),gv=In(["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","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Qd=In(["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","mask-type","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"]),vv=In(["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"]),Cc=In(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),L8=La(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z8=La(/<%[\w\W]*|[\w\W]*%>/gm),k8=La(/\$\{[\w\W]*/gm),B8=La(/^data-[\-\w.\u00B7-\uFFFF]+$/),j8=La(/^aria-[\-\w]+$/),Zy=La(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),U8=La(/^(?:\w+script|data):/i),H8=La(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Wy=La(/^html$/i),q8=La(/^[a-z][.\w]*(-[.\w]+)+$/i);var yv=Object.freeze({__proto__:null,ARIA_ATTR:j8,ATTR_WHITESPACE:H8,CUSTOM_ELEMENT:q8,DATA_ATTR:B8,DOCTYPE_NAME:Wy,ERB_EXPR:z8,IS_ALLOWED_URI:Zy,IS_SCRIPT_OR_DATA:U8,MUSTACHE_EXPR:L8,TMPLIT_EXPR:k8});const Uo={element:1,text:3,progressingInstruction:7,comment:8,document:9},I8=function(){return typeof window>"u"?null:window},G8=function(l,r){if(typeof l!="object"||typeof l.createPolicy!="function")return null;let o=null;const c="data-tt-policy-suffix";r&&r.hasAttribute(c)&&(o=r.getAttribute(c));const f="dompurify"+(o?"#"+o:"");try{return l.createPolicy(f,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}},bv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Py(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I8();const l=be=>Py(be);if(l.version="3.3.3",l.removed=[],!n||!n.document||n.document.nodeType!==Uo.document||!n.Element)return l.isSupported=!1,l;let{document:r}=n;const o=r,c=o.currentScript,{DocumentFragment:f,HTMLTemplateElement:d,Node:m,Element:h,NodeFilter:p,NamedNodeMap:y=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:b,DOMParser:A,trustedTypes:S}=n,O=h.prototype,C=jo(O,"cloneNode"),E=jo(O,"remove"),x=jo(O,"nextSibling"),M=jo(O,"childNodes"),L=jo(O,"parentNode");if(typeof d=="function"){const be=r.createElement("template");be.content&&be.content.ownerDocument&&(r=be.content.ownerDocument)}let z,H="";const{implementation:B,createNodeIterator:X,createDocumentFragment:Z,getElementsByTagName:re}=r,{importNode:$}=o;let ne=bv();l.isSupported=typeof Jy=="function"&&typeof L=="function"&&B&&B.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ie,ERB_EXPR:he,TMPLIT_EXPR:pe,DATA_ATTR:ce,ARIA_ATTR:R,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:le,CUSTOM_ELEMENT:ae}=yv;let{IS_ALLOWED_URI:_e}=yv,T=null;const V=Ie({},[...mv,...Zd,...Wd,...Pd,...pv]);let Y=null;const oe=Ie({},[...gv,...Qd,...vv,...Cc]);let K=Object.seal(wc(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}})),fe=null,Se=null;const Ee=Object.seal(wc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let De=!0,Be=!0,ut=!1,de=!0,ee=!1,ve=!0,Ye=!1,Tt=!1,ht=!1,qe=!1,_t=!1,At=!1,Oe=!0,je=!1;const zt="user-content-";let Ct=!0,hn=!1,Nn={},xt=null;const Kt=Ie({},["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 ta=null;const xn=Ie({},["audio","video","img","source","image","track"]);let mn=null;const Mn=Ie({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),on="http://www.w3.org/1998/Math/MathML",mt="http://www.w3.org/2000/svg",Xe="http://www.w3.org/1999/xhtml";let Ot=Xe,na=!1,wt=null;const Vn=Ie({},[on,mt,Xe],Kd);let sn=Ie({},["mi","mo","mn","ms","mtext"]),Dn=Ie({},["annotation-xml"]);const Yn=Ie({},["title","style","font","a","script"]);let pn=null;const va=["application/xhtml+xml","text/html"],tl="text/html";let jt=null,ya=null;const gr=r.createElement("form"),za=function(N){return N instanceof RegExp||N instanceof Function},nl=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ya&&ya===N)){if((!N||typeof N!="object")&&(N={}),N=Wa(N),pn=va.indexOf(N.PARSER_MEDIA_TYPE)===-1?tl:N.PARSER_MEDIA_TYPE,jt=pn==="application/xhtml+xml"?Kd:Rc,T=ha(N,"ALLOWED_TAGS")?Ie({},N.ALLOWED_TAGS,jt):V,Y=ha(N,"ALLOWED_ATTR")?Ie({},N.ALLOWED_ATTR,jt):oe,wt=ha(N,"ALLOWED_NAMESPACES")?Ie({},N.ALLOWED_NAMESPACES,Kd):Vn,mn=ha(N,"ADD_URI_SAFE_ATTR")?Ie(Wa(Mn),N.ADD_URI_SAFE_ATTR,jt):Mn,ta=ha(N,"ADD_DATA_URI_TAGS")?Ie(Wa(xn),N.ADD_DATA_URI_TAGS,jt):xn,xt=ha(N,"FORBID_CONTENTS")?Ie({},N.FORBID_CONTENTS,jt):Kt,fe=ha(N,"FORBID_TAGS")?Ie({},N.FORBID_TAGS,jt):Wa({}),Se=ha(N,"FORBID_ATTR")?Ie({},N.FORBID_ATTR,jt):Wa({}),Nn=ha(N,"USE_PROFILES")?N.USE_PROFILES:!1,De=N.ALLOW_ARIA_ATTR!==!1,Be=N.ALLOW_DATA_ATTR!==!1,ut=N.ALLOW_UNKNOWN_PROTOCOLS||!1,de=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ee=N.SAFE_FOR_TEMPLATES||!1,ve=N.SAFE_FOR_XML!==!1,Ye=N.WHOLE_DOCUMENT||!1,qe=N.RETURN_DOM||!1,_t=N.RETURN_DOM_FRAGMENT||!1,At=N.RETURN_TRUSTED_TYPE||!1,ht=N.FORCE_BODY||!1,Oe=N.SANITIZE_DOM!==!1,je=N.SANITIZE_NAMED_PROPS||!1,Ct=N.KEEP_CONTENT!==!1,hn=N.IN_PLACE||!1,_e=N.ALLOWED_URI_REGEXP||Zy,Ot=N.NAMESPACE||Xe,sn=N.MATHML_TEXT_INTEGRATION_POINTS||sn,Dn=N.HTML_INTEGRATION_POINTS||Dn,K=N.CUSTOM_ELEMENT_HANDLING||{},N.CUSTOM_ELEMENT_HANDLING&&za(N.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=N.CUSTOM_ELEMENT_HANDLING.tagNameCheck),N.CUSTOM_ELEMENT_HANDLING&&za(N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ee&&(Be=!1),_t&&(qe=!0),Nn&&(T=Ie({},pv),Y=wc(null),Nn.html===!0&&(Ie(T,mv),Ie(Y,gv)),Nn.svg===!0&&(Ie(T,Zd),Ie(Y,Qd),Ie(Y,Cc)),Nn.svgFilters===!0&&(Ie(T,Wd),Ie(Y,Qd),Ie(Y,Cc)),Nn.mathMl===!0&&(Ie(T,Pd),Ie(Y,vv),Ie(Y,Cc))),ha(N,"ADD_TAGS")||(Ee.tagCheck=null),ha(N,"ADD_ATTR")||(Ee.attributeCheck=null),N.ADD_TAGS&&(typeof N.ADD_TAGS=="function"?Ee.tagCheck=N.ADD_TAGS:(T===V&&(T=Wa(T)),Ie(T,N.ADD_TAGS,jt))),N.ADD_ATTR&&(typeof N.ADD_ATTR=="function"?Ee.attributeCheck=N.ADD_ATTR:(Y===oe&&(Y=Wa(Y)),Ie(Y,N.ADD_ATTR,jt))),N.ADD_URI_SAFE_ATTR&&Ie(mn,N.ADD_URI_SAFE_ATTR,jt),N.FORBID_CONTENTS&&(xt===Kt&&(xt=Wa(xt)),Ie(xt,N.FORBID_CONTENTS,jt)),N.ADD_FORBID_CONTENTS&&(xt===Kt&&(xt=Wa(xt)),Ie(xt,N.ADD_FORBID_CONTENTS,jt)),Ct&&(T["#text"]=!0),Ye&&Ie(T,["html","head","body"]),T.table&&(Ie(T,["tbody"]),delete fe.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw Bo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Bo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');z=N.TRUSTED_TYPES_POLICY,H=z.createHTML("")}else z===void 0&&(z=G8(S,c)),z!==null&&typeof H=="string"&&(H=z.createHTML(""));In&&In(N),ya=N}},vr=Ie({},[...Zd,...Wd,...M8]),yr=Ie({},[...Pd,...D8]),Jr=function(N){let te=L(N);(!te||!te.tagName)&&(te={namespaceURI:Ot,tagName:"template"});const ge=Rc(N.tagName),lt=Rc(te.tagName);return wt[N.namespaceURI]?N.namespaceURI===mt?te.namespaceURI===Xe?ge==="svg":te.namespaceURI===on?ge==="svg"&&(lt==="annotation-xml"||sn[lt]):!!vr[ge]:N.namespaceURI===on?te.namespaceURI===Xe?ge==="math":te.namespaceURI===mt?ge==="math"&&Dn[lt]:!!yr[ge]:N.namespaceURI===Xe?te.namespaceURI===mt&&!Dn[lt]||te.namespaceURI===on&&!sn[lt]?!1:!yr[ge]&&(Yn[ge]||!vr[ge]):!!(pn==="application/xhtml+xml"&&wt[N.namespaceURI]):!1},pt=function(N){zo(l.removed,{element:N});try{L(N).removeChild(N)}catch{E(N)}},Xn=function(N,te){try{zo(l.removed,{attribute:te.getAttributeNode(N),from:te})}catch{zo(l.removed,{attribute:null,from:te})}if(te.removeAttribute(N),N==="is")if(qe||_t)try{pt(te)}catch{}else try{te.setAttribute(N,"")}catch{}},Xa=function(N){let te=null,ge=null;if(ht)N="<remove></remove>"+N;else{const we=Jd(N,/^[\r\n\t ]+/);ge=we&&we[0]}pn==="application/xhtml+xml"&&Ot===Xe&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");const lt=z?z.createHTML(N):N;if(Ot===Xe)try{te=new A().parseFromString(lt,pn)}catch{}if(!te||!te.documentElement){te=B.createDocument(Ot,"template",null);try{te.documentElement.innerHTML=na?H:lt}catch{}}const gt=te.body||te.documentElement;return N&&ge&>.insertBefore(r.createTextNode(ge),gt.childNodes[0]||null),Ot===Xe?re.call(te,Ye?"html":"body")[0]:Ye?te.documentElement:gt},al=function(N){return X.call(N.ownerDocument||N,N,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},bn=function(N){return N instanceof b&&(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")},Gt=function(N){return typeof m=="function"&&N instanceof m};function St(be,N,te){Ac(be,ge=>{ge.call(l,N,te,ya)})}const aa=function(N){let te=null;if(St(ne.beforeSanitizeElements,N,null),bn(N))return pt(N),!0;const ge=jt(N.nodeName);if(St(ne.uponSanitizeElement,N,{tagName:ge,allowedTags:T}),ve&&N.hasChildNodes()&&!Gt(N.firstElementChild)&&zn(/<[/\w!]/g,N.innerHTML)&&zn(/<[/\w!]/g,N.textContent)||N.nodeType===Uo.progressingInstruction||ve&&N.nodeType===Uo.comment&&zn(/<[/\w]/g,N.data))return pt(N),!0;if(!(Ee.tagCheck instanceof Function&&Ee.tagCheck(ge))&&(!T[ge]||fe[ge])){if(!fe[ge]&&Vt(ge)&&(K.tagNameCheck instanceof RegExp&&zn(K.tagNameCheck,ge)||K.tagNameCheck instanceof Function&&K.tagNameCheck(ge)))return!1;if(Ct&&!xt[ge]){const lt=L(N)||N.parentNode,gt=M(N)||N.childNodes;if(gt&<){const we=gt.length;for(let cn=we-1;cn>=0;--cn){const Fn=C(gt[cn],!0);Fn.__removalCount=(N.__removalCount||0)+1,lt.insertBefore(Fn,x(N))}}}return pt(N),!0}return N instanceof h&&!Jr(N)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&zn(/<\/no(script|embed|frames)/i,N.innerHTML)?(pt(N),!0):(ee&&N.nodeType===Uo.text&&(te=N.textContent,Ac([ie,he,pe],lt=>{te=ko(te,lt," ")}),N.textContent!==te&&(zo(l.removed,{element:N.cloneNode()}),N.textContent=te)),St(ne.afterSanitizeElements,N,null),!1)},ll=function(N,te,ge){if(Se[te]||Oe&&(te==="id"||te==="name")&&(ge in r||ge in gr))return!1;if(!(Be&&!Se[te]&&zn(ce,te))){if(!(De&&zn(R,te))){if(!(Ee.attributeCheck instanceof Function&&Ee.attributeCheck(te,N))){if(!Y[te]||Se[te]){if(!(Vt(N)&&(K.tagNameCheck instanceof RegExp&&zn(K.tagNameCheck,N)||K.tagNameCheck instanceof Function&&K.tagNameCheck(N))&&(K.attributeNameCheck instanceof RegExp&&zn(K.attributeNameCheck,te)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(te,N))||te==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&zn(K.tagNameCheck,ge)||K.tagNameCheck instanceof Function&&K.tagNameCheck(ge))))return!1}else if(!mn[te]){if(!zn(_e,ko(ge,le,""))){if(!((te==="src"||te==="xlink:href"||te==="href")&&N!=="script"&&O8(ge,"data:")===0&&ta[N])){if(!(ut&&!zn(W,ko(ge,le,"")))){if(ge)return!1}}}}}}}return!0},Vt=function(N){return N!=="annotation-xml"&&Jd(N,ae)},la=function(N){St(ne.beforeSanitizeAttributes,N,null);const{attributes:te}=N;if(!te||bn(N))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let lt=te.length;for(;lt--;){const gt=te[lt],{name:we,namespaceURI:cn,value:Fn}=gt,On=jt(we),ba=Fn;let Jt=we==="value"?ba:w8(ba);if(ge.attrName=On,ge.attrValue=Jt,ge.keepAttr=!0,ge.forceKeepAttr=void 0,St(ne.uponSanitizeAttribute,N,ge),Jt=ge.attrValue,je&&(On==="id"||On==="name")&&(Xn(we,N),Jt=zt+Jt),ve&&zn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Jt)){Xn(we,N);continue}if(On==="attributename"&&Jd(Jt,"href")){Xn(we,N);continue}if(ge.forceKeepAttr)continue;if(!ge.keepAttr){Xn(we,N);continue}if(!de&&zn(/\/>/i,Jt)){Xn(we,N);continue}ee&&Ac([ie,he,pe],_r=>{Jt=ko(Jt,_r," ")});const br=jt(N.nodeName);if(!ll(br,On,Jt)){Xn(we,N);continue}if(z&&typeof S=="object"&&typeof S.getAttributeType=="function"&&!cn)switch(S.getAttributeType(br,On)){case"TrustedHTML":{Jt=z.createHTML(Jt);break}case"TrustedScriptURL":{Jt=z.createScriptURL(Jt);break}}if(Jt!==ba)try{cn?N.setAttributeNS(cn,we,Jt):N.setAttribute(we,Jt),bn(N)?pt(N):hv(l.removed)}catch{Xn(we,N)}}St(ne.afterSanitizeAttributes,N,null)},Ll=function be(N){let te=null;const ge=al(N);for(St(ne.beforeSanitizeShadowDOM,N,null);te=ge.nextNode();)St(ne.uponSanitizeShadowNode,te,null),aa(te),la(te),te.content instanceof f&&be(te.content);St(ne.afterSanitizeShadowDOM,N,null)};return l.sanitize=function(be){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},te=null,ge=null,lt=null,gt=null;if(na=!be,na&&(be="<!-->"),typeof be!="string"&&!Gt(be))if(typeof be.toString=="function"){if(be=be.toString(),typeof be!="string")throw Bo("dirty is not a string, aborting")}else throw Bo("toString is not a function");if(!l.isSupported)return be;if(Tt||nl(N),l.removed=[],typeof be=="string"&&(hn=!1),hn){if(be.nodeName){const Fn=jt(be.nodeName);if(!T[Fn]||fe[Fn])throw Bo("root node is forbidden and cannot be sanitized in-place")}}else if(be instanceof m)te=Xa("<!---->"),ge=te.ownerDocument.importNode(be,!0),ge.nodeType===Uo.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?te=ge:te.appendChild(ge);else{if(!qe&&!ee&&!Ye&&be.indexOf("<")===-1)return z&&At?z.createHTML(be):be;if(te=Xa(be),!te)return qe?null:At?H:""}te&&ht&&pt(te.firstChild);const we=al(hn?be:te);for(;lt=we.nextNode();)aa(lt),la(lt),lt.content instanceof f&&Ll(lt.content);if(hn)return be;if(qe){if(_t)for(gt=Z.call(te.ownerDocument);te.firstChild;)gt.appendChild(te.firstChild);else gt=te;return(Y.shadowroot||Y.shadowrootmode)&&(gt=$.call(o,gt,!0)),gt}let cn=Ye?te.outerHTML:te.innerHTML;return Ye&&T["!doctype"]&&te.ownerDocument&&te.ownerDocument.doctype&&te.ownerDocument.doctype.name&&zn(Wy,te.ownerDocument.doctype.name)&&(cn="<!DOCTYPE "+te.ownerDocument.doctype.name+`>
|
|
64
|
-
`+cn),ee&&Ac([ie,he,pe],Fn=>{cn=ko(cn,Fn," ")}),z&&At?z.createHTML(cn):cn},l.setConfig=function(){let be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};nl(be),Tt=!0},l.clearConfig=function(){ya=null,Tt=!1},l.isValidAttribute=function(be,N,te){ya||nl({});const ge=jt(be),lt=jt(N);return ll(ge,lt,te)},l.addHook=function(be,N){typeof N=="function"&&zo(ne[be],N)},l.removeHook=function(be,N){if(N!==void 0){const te=T8(ne[be],N);return te===-1?void 0:x8(ne[be],te,1)[0]}return hv(ne[be])},l.removeHooks=function(be){ne[be]=[]},l.removeAllHooks=function(){ne=bv()},l}var V8=Py();const Y8=({onClose:n})=>{const l=Rt();return v.jsxs("div",{className:yn.highlightLoadingInfo,onClick:n,children:[v.jsx("div",{className:yn.highlightLoadingInfoCloseIcon,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})}),v.jsxs("div",{className:yn.highlightLoadingInfoInnerContainer,children:[v.jsxs("div",{className:yn.highlightLoadingInfoContent,children:[v.jsx("h3",{children:l("source-infos.highlight-loading.title")}),v.jsx("p",{children:l("source-infos.highlight-loading.description")})]}),v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#000000",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M253.66,106.34a8,8,0,0,0-11.32,0L192,156.69,107.31,72l50.35-50.34a8,8,0,1,0-11.32-11.32L96,60.69A16,16,0,0,0,93.18,79.5L72,100.69a16,16,0,0,0,0,22.62L76.69,128,18.34,186.34a8,8,0,0,0,3.13,13.25l72,24A7.88,7.88,0,0,0,96,224a8,8,0,0,0,5.66-2.34L136,187.31l4.69,4.69a16,16,0,0,0,22.62,0l21.19-21.18A16,16,0,0,0,203.31,168l50.35-50.34A8,8,0,0,0,253.66,106.34ZM93.84,206.85l-55-18.35L88,139.31,124.69,176ZM152,180.69,83.31,112,104,91.31,172.69,160Z"})})]})]})},X8=({title:n,href:l,children:r})=>v.jsx("a",{href:l,title:n,target:"_blank",rel:"noopener noreferrer",children:r}),F8=({className:n,children:l,...r})=>v.jsx("a",{className:se(Jo.button,Jo.buttonDefault,n),type:"button",role:"button",...r,children:l}),K8=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),J8=({type:n,...l})=>{switch(n){case"WEBSITE":return v.jsx(Iy,{...l});case"PDF":return v.jsx(qy,{...l});case"DOCX":return v.jsx(Uy,{...l});case"TEXT":return v.jsx(K8,{...l});default:return v.jsx(Hy,{...l})}},Z8=({url:n,knowledgeBaseType:l})=>{const r=Rt();return v.jsx(F8,{className:yn.openSourceButton,href:n,target:"_blank",children:v.jsxs("div",{className:yn.sourceButtonLabel,children:[v.jsx("div",{className:yn.sourceHeaderIcon,children:v.jsx(J8,{type:l})}),v.jsx("p",{children:r("source-infos.open-source")})]})})},W8=({sourceInfos:{content:n,url:l,knowledgeBaseType:r,highlighted:o}})=>{const[c,f]=q.useState(!o);q.useEffect(()=>{o&&f(!1)},[o]);const d=V8.sanitize(n,{USE_PROFILES:{html:!0}});return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:se(yn.sourceContent,Vy.markdown),children:[v.jsx(xl,{options:{overrides:{a:X8}},children:d}),c&&v.jsx(Y8,{onClose:()=>f(!1)})]}),v.jsx(Z8,{url:l,knowledgeBaseType:r})]})},P8=""+new URL("undraw_fixing-bugs-D_eYxJc6.svg",import.meta.url).href,Q8=()=>{const n=Rt();return v.jsxs("div",{className:yn.loadingError,children:[v.jsx("h1",{children:n("source-infos.error.title")}),v.jsx("img",{src:P8,title:n("source-infos.error.title")}),v.jsx("p",{children:n("source-infos.error.info")})]})},$8=()=>v.jsx("div",{className:yn.loadingSourceInfos,children:v.jsx("svg",{className:yn.loading,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"})})});function ex({sourceInfos:n,onClose:l,threshold:r=100}){const o=q.useRef(null),[c,f]=q.useState(0),[d,m]=q.useState(!1),h=q.useRef(null),p=q.useRef(null),y=q.useCallback(O=>{h.current=O,m(!0)},[]),b=q.useCallback(O=>{if(h.current!==null&&d){const C=O-h.current;C>0&&f(C)}},[d]),A=q.useCallback(()=>{m(!1),c>r&&l(),f(0),h.current=null},[c,r,l]),S=q.useCallback(O=>{const C=H=>y(H.touches[0].clientY),E=H=>b(H.touches[0].clientY),x=()=>A(),M=H=>{H.preventDefault(),y(H.clientY),window.addEventListener("mousemove",L),window.addEventListener("mouseup",z)},L=H=>b(H.clientY),z=()=>{A(),window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",z)};O.addEventListener("touchstart",C),O.addEventListener("touchmove",E),O.addEventListener("touchend",x),O.addEventListener("mousedown",M),p.current=()=>{O.removeEventListener("touchstart",C),O.removeEventListener("touchmove",E),O.removeEventListener("touchend",x),O.removeEventListener("mousedown",M),window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",z)}},[y,b,A]);return q.useEffect(()=>{let O;return o.current?(p.current?.(),S(o.current)):(O=new MutationObserver(()=>{o.current&&(p.current?.(),S(o.current),O?.disconnect())}),O.observe(document.body,{childList:!0,subtree:!0})),()=>{O?.disconnect(),p.current?.()}},[S,n]),{ref:o,dragOffsetY:c,isDragging:d}}const tx=n=>{const[l,r]=q.useState(!0);return q.useEffect(()=>{let o=null;return n?.type==="loading"?(r(!0),o=setTimeout(()=>{r(!1)},300)):r(!n),()=>{o&&clearTimeout(o)}},[n]),l},nx=()=>{const n=Dl(),l=Bt(h=>h.chat.sourceInfos),r=Ky(),o=q.useRef(null),c=tx(l);q.useEffect(()=>{o.current&&l?.type==="loading"&&(r?o.current.showModal():(o.current.setAttribute("open","true"),o.current?.focus()))},[l,r]);const f=q.useCallback(()=>{o.current&&(r?o.current.close():o.current.removeAttribute("open"),n(hS()))},[n,r]),{ref:d,dragOffsetY:m}=ex({onClose:f,sourceInfos:l});return l?v.jsx("dialog",{ref:o,className:se(yn.sourceInfos,c?yn.waitForLoading:l.type==="loading"?yn.loadingContent:""),style:r&&m?{transform:`translateY(${m}px)`}:{},onClose:f,autoFocus:!0,role:"dialog","aria-labelledby":"source-info-title",children:c?null:v.jsxs(v.Fragment,{children:[v.jsx(_8,{ref:d,tabIndex:-1,sourceInfos:l.type==="loaded"?l:void 0,onClose:f}),l.type==="loading"?v.jsx($8,{}):l.type==="loading-error"?v.jsx(Q8,{}):v.jsxs(v.Fragment,{children:[v.jsx(A8,{loading:!l.highlighted}),v.jsx(W8,{sourceInfos:l})]})]})}):null},ax="_container_1hnv6_1",lx="_body_1hnv6_7",rx="_intro_1hnv6_14",ix="_footer_1hnv6_48",ox="_footnote_1hnv6_52",sx="_containerWithFootnote_1hnv6_67",cx="_startChatButton_1hnv6_82",ux="_spinner_1hnv6_97",fx="_formFields_1hnv6_101",dx="_formField_1hnv6_101",hx="_radio_1hnv6_113",mx="_checkbox_1hnv6_120",px="_input_1hnv6_128",gx="_inputLabel_1hnv6_162",vx="_selectWrapper_1hnv6_166",yx="_select_1hnv6_166",bx="_selectLabel_1hnv6_212",vn={container:ax,body:lx,intro:rx,footer:ix,footnote:ox,containerWithFootnote:sx,startChatButton:cx,spinner:ux,formFields:fx,formField:dx,radio:hx,checkbox:mx,input:px,inputLabel:gx,selectWrapper:vx,select:yx,selectLabel:bx},_x=({name:n,label:l,defaultValue:r,required:o,onChange:c})=>{const f=d=>{c(d.currentTarget.checked?"true":"false")};return v.jsxs("label",{className:se(vn.checkbox,"chat__startScreen__checkbox"),htmlFor:n,children:[v.jsx("input",{type:"checkbox",id:n,name:n,defaultChecked:r==="true",required:o,onChange:f}),v.jsx("div",{children:l})]})},Ax=({type:n,name:l,label:r,defaultValue:o,placeholder:c,required:f,multiple:d,min:m,max:h,pattern:p,onChange:y})=>{const b=A=>{y(A.target.value)};return v.jsxs("label",{className:se(vn.input,"chat__startScreen__input"),htmlFor:l,children:[v.jsx("div",{className:se(vn.inputLabel),children:r}),v.jsx("input",{type:n,id:l,name:l,defaultValue:o,placeholder:c,required:f,multiple:d,min:m,max:h,pattern:p,onChange:b})]})},Cx=({name:n,value:l,label:r,defaultChecked:o,required:c,onChange:f})=>{const d=`${n}-${l}`,m=h=>{f(h.target.value)};return v.jsxs("label",{className:se(vn.radio,"chat__startScreen__radio"),htmlFor:d,children:[v.jsx("input",{id:d,type:"radio",name:n,value:l,defaultChecked:o,required:c,onChange:m}),v.jsx("span",{className:se(vn.label),children:r})]})},Sx=({name:n,label:l,defaultValue:r,required:o,multiple:c,options:f,onChange:d})=>{const m=h=>{d(h.target.value)};return v.jsxs("label",{className:se(vn.select,"chat__startScreen__select"),htmlFor:n,children:[v.jsx("div",{className:se(vn.selectLabel),children:l}),v.jsx("div",{className:se(vn.selectWrapper),children:v.jsx("select",{id:n,name:n,defaultValue:r,required:o,multiple:c,onChange:m,children:Object.entries(f||{}).map(([h,p])=>v.jsx("option",{value:h,selected:p===r,children:p}))})})]})},Ex="start-screen.intro",Tx="start-screen.start-chat",xx="start-screen.waiting-for-login",Ox="start-screen.footnote",qa="start-screen.form",_v=`${qa}.fields`,wx=()=>{const n=Rt(),l=Dl(),r=sm(),o=Bt(O=>O.startScreen.loginRequestToken),c=Bt(O=>O.settings.requiresUserAuthentication);q.useEffect(()=>{let O;if(o){const x=window.screenX+(window.outerWidth-600)/2,M=window.screenY+(window.outerHeight-700)/2,L=encodeURIComponent(r),z=new URL(window.location.origin);z.pathname=`/${L}/auth/login`,z.searchParams.set("loginRequestToken",o);const H=window.open(z.href,"Login",`width=600,height=700,left=${x},top=${M},resizable=yes,scrollbars=yes`);O=setInterval(()=>{H?.closed&&(l(cS()),clearInterval(O))},500)}return()=>{O&&clearInterval(O)}},[r,o,l]);const[f,d]=q.useState({}),m=()=>{const O=Object.entries(f).reduce((C,[E,x])=>({...C,[E]:x.value}),{});l(c?sS({loginRequestToken:Bc(),formValues:O}):rS({formValues:O}))},h=n(Ex),p=n(o?xx:Tx),y=n(Ox),b=q.useMemo(()=>n(_v)?.split(";").map(O=>O.trim())??[],[n(_v)]);q.useEffect(()=>{b.length&&Object.keys(f).length===0&&d(b.reduce((O,C)=>({...O,[C]:Rx(C,n)}),{}))},[n,b,f]);const A=O=>{O.preventDefault(),m()},S=O=>C=>{d(E=>({...E,[O]:{...E[O],value:C}}))};return v.jsxs("form",{onSubmit:A,className:se(vn.container,y&&vn.containerWithFootnote,"chat__startScreen"),children:[v.jsxs("div",{className:se(vn.body,"chat__startScreen__body"),children:[h&&v.jsx("div",{className:se(vn.intro,"chat__startScreen__intro"),children:v.jsx(xl,{options:{overrides:{a:Av}},children:h})}),v.jsx("div",{className:se(vn.formFields,"chat__startScreen__fields"),children:Object.values(f).map(({type:O,name:C,label:E,placeholder:x,defaultValue:M,options:L,required:z,multiple:H,min:B,max:X,pattern:Z})=>v.jsx("div",{className:se(vn.formField,"chat__startScreen__field"),children:(()=>{switch(O){case"radio":return v.jsxs(v.Fragment,{children:[v.jsx("div",{children:E}),Object.entries(L||{}).map(([re,$])=>v.jsx(Cx,{name:C,value:re,label:$,defaultChecked:re===M,required:z,onChange:S(C)},re))]});case"checkbox":return v.jsx(_x,{name:C,label:E,defaultValue:M,required:z,onChange:S(C)});case"select":return v.jsx(Sx,{name:C,label:E,defaultValue:M,required:z,multiple:H,options:L,onChange:S(C)});default:return v.jsx(Ax,{type:O,name:C,label:E,placeholder:x,defaultValue:M,required:z,multiple:H,min:B,max:X,pattern:Z,onChange:S(C)})}})()},C))})]}),v.jsxs("div",{className:se(vn.footer,"chat__startScreen__footer"),children:[v.jsxs($c,{type:"submit",className:vn.startChatButton,disabled:!!o,children:[!!o&&v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",className:vn.spinner,children:v.jsx("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm88,88H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"})}),v.jsx("div",{children:p})]}),y&&v.jsx("div",{className:vn.footnote,children:v.jsx(xl,{options:{overrides:{a:Av}},children:y})})]})]})},Av=({title:n,href:l,children:r})=>v.jsx("a",{href:l,title:n,target:"_blank",rel:"noopener noreferrer",children:r}),Rx=(n,l)=>{const r=l(`${qa}.${n}.type`)||"text",o=l(`${qa}.${n}.required`)==="true",c=l(`${qa}.${n}.multiple`)==="true",f=l(`${qa}.${n}.placeholder`),d=l(`${qa}.${n}.label`)||"",m=l(`${qa}.${n}.defaultValue`),h=l(`${qa}.${n}.min`),p=l(`${qa}.${n}.max`),y=l(`${qa}.${n}.pattern`),b=Mx(l(`${qa}.${n}.options`));return{name:n,label:d,placeholder:f,value:Nx(r,m,b)||"",defaultValue:m,options:b,type:r,required:o,multiple:c,min:h,max:p,pattern:y}},Nx=(n,l,r)=>l||n==="select"&&Object.keys(r)[0]||"",Mx=(n="")=>n.split(";").map(l=>l.trim()).reduce((l,r)=>{const[o,c]=r.split(":").map(f=>f.trim());return{...l,[o]:c}},{}),Dx=()=>{const n=Bt(l=>l.intl.locale);q.useEffect(()=>{window.document.documentElement.lang=n},[n])},Vr={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"},Lx=({clientName:n})=>{Dx();const l=Dl(),r=Bt(b=>b.intl.messages),o=Rt(),c=Bt(b=>b.settings.enableStartScreen),f=Bt(b=>b.startScreen.startScreenStatus),d=Bt(b=>b.connection.queryString),m=Bt(b=>b.settings.allowedEmbedOrigins),h=q.useMemo(()=>new URLSearchParams(d||"?").get("cssClassName"),[d]);q.useEffect(()=>{const b=new URLSearchParams(d||""),A=Object.fromEntries(b.entries());l(pS(n,A))},[n,d,l]),q.useEffect(()=>{const b=A=>{if(!A.data?.type||!Object.values(Vr).includes(A.data.type))return;const S=A.origin===window.location.origin,O=A.source===window.parent,C=m===void 0||m.includes(A.origin);if(!(S||O&&C)){console.warn("Rejected postMessage from untrusted origin:",A.origin);return}switch(A.data.type){case Vr.TRIGGER_ACTION:l(A.data.action);break;case Vr.TRIGGER_STORY:l(Qv(A.data.story));break;case Vr.ON_CHAT_WINDOW_OPEN:l({type:"webclient.chatwindow.opened"});break;case Vr.ON_CHAT_WINDOW_CLOSE:l({type:"webclient.chatwindow.closed"});break;case Vr.CHAT_MESSAGE_FROM_GUEST:l(Kv(A.data.text));break;case Vr.RESTART_CHAT:l(Wo());break}};return window.addEventListener("message",b,!1),()=>window.removeEventListener("message",b)},[m,l]),q.useEffect(()=>{const b=o("page.title");b&&document&&(document.title=b)},[r,o]);const p=c===void 0,y=c===!1||f==="HIDDEN";return v.jsx("div",{className:se(fv.chatwindow,y&&fv.chatwindowWithAside,"chat__chatwindow",h),children:p?null:y?v.jsxs(v.Fragment,{children:[v.jsx("header",{children:v.jsx(uv,{chatStarted:!0})}),v.jsx("main",{children:v.jsx(U3,{clientName:n})}),v.jsx("aside",{children:v.jsx(nx,{})})]}):v.jsxs(v.Fragment,{children:[v.jsx("header",{children:v.jsx(uv,{chatStarted:!1})}),v.jsx("main",{children:v.jsx(wx,{})})]})})},zx=()=>{const n=sm(),l=Ky();return v.jsx("div",{className:se([GA.app,l?"chat__small":"chat__large"]),children:v.jsx(Lx,{clientName:n})})},Qy={"page.title":"Bubble Chat Chatbot","message-input-label":"Benutzereingabe","message-input-placeholder":"Nachricht eingeben","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","message-input.actions.command.label":"Aktion ausführen","guest-bubble.label":"Ihre Nachricht","bot-bubble.label":"Nachricht des Chatbots","bot-bubble.actions.label":"Nachricht-Aktionen","bot-bubble.reaction.good":"Gefällt mir","bot-bubble.reaction.bad":"Gefällt mir nicht","bot-bubble.reaction.remove":"Markierung entfernen","bot-bubble.reaction.say-more":"Erzähle mir bitte mehr","bot-bubble.reaction.category.WRONG_INFORMATION":"Falsch","bot-bubble.reaction.category.MISSING_INFORMATION":"Unvollständig","bot-bubble.reaction.category.OLD_INFORMATION":"Veraltet","bot-bubble.reaction.category.UNCLEAR":"Unklar","bot-bubble.reaction.category.OFF_TOPIC":"Nicht zur Frage passend","bot-bubble.reaction.comment":"Gedanken mit mir teilen...","bot-bubble.reaction.close":"Schliessen","bot-bubble.copy":"Kopieren","bot-bubble.sources":"Quellenliste","bot-bubble.source.open":"Quelle öffnen","bot-bubble.footnote":"Fussnote","agent-bubble.label":"Nachricht des Live-Agenten","conversation.label":"Chat Verlauf","chatbot.typing":"Chatbot schreibt","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:
|
|
64
|
+
`+cn),ee&&Ac([ie,he,pe],Fn=>{cn=ko(cn,Fn," ")}),z&&At?z.createHTML(cn):cn},l.setConfig=function(){let be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};nl(be),Tt=!0},l.clearConfig=function(){ya=null,Tt=!1},l.isValidAttribute=function(be,N,te){ya||nl({});const ge=jt(be),lt=jt(N);return ll(ge,lt,te)},l.addHook=function(be,N){typeof N=="function"&&zo(ne[be],N)},l.removeHook=function(be,N){if(N!==void 0){const te=T8(ne[be],N);return te===-1?void 0:x8(ne[be],te,1)[0]}return hv(ne[be])},l.removeHooks=function(be){ne[be]=[]},l.removeAllHooks=function(){ne=bv()},l}var V8=Py();const Y8=({onClose:n})=>{const l=Rt();return v.jsxs("div",{className:yn.highlightLoadingInfo,onClick:n,children:[v.jsx("div",{className:yn.highlightLoadingInfoCloseIcon,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})}),v.jsxs("div",{className:yn.highlightLoadingInfoInnerContainer,children:[v.jsxs("div",{className:yn.highlightLoadingInfoContent,children:[v.jsx("h3",{children:l("source-infos.highlight-loading.title")}),v.jsx("p",{children:l("source-infos.highlight-loading.description")})]}),v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#000000",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M253.66,106.34a8,8,0,0,0-11.32,0L192,156.69,107.31,72l50.35-50.34a8,8,0,1,0-11.32-11.32L96,60.69A16,16,0,0,0,93.18,79.5L72,100.69a16,16,0,0,0,0,22.62L76.69,128,18.34,186.34a8,8,0,0,0,3.13,13.25l72,24A7.88,7.88,0,0,0,96,224a8,8,0,0,0,5.66-2.34L136,187.31l4.69,4.69a16,16,0,0,0,22.62,0l21.19-21.18A16,16,0,0,0,203.31,168l50.35-50.34A8,8,0,0,0,253.66,106.34ZM93.84,206.85l-55-18.35L88,139.31,124.69,176ZM152,180.69,83.31,112,104,91.31,172.69,160Z"})})]})]})},X8=({title:n,href:l,children:r})=>v.jsx("a",{href:l,title:n,target:"_blank",rel:"noopener noreferrer",children:r}),F8=({className:n,children:l,...r})=>v.jsx("a",{className:se(Jo.button,Jo.buttonDefault,n),type:"button",role:"button",...r,children:l}),K8=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),J8=({type:n,...l})=>{switch(n){case"WEBSITE":return v.jsx(Iy,{...l});case"PDF":return v.jsx(qy,{...l});case"DOCX":return v.jsx(Uy,{...l});case"TEXT":return v.jsx(K8,{...l});default:return v.jsx(Hy,{...l})}},Z8=({url:n,knowledgeBaseType:l})=>{const r=Rt();return v.jsx(F8,{className:yn.openSourceButton,href:n,target:"_blank",children:v.jsxs("div",{className:yn.sourceButtonLabel,children:[v.jsx("div",{className:yn.sourceHeaderIcon,children:v.jsx(J8,{type:l})}),v.jsx("p",{children:r("source-infos.open-source")})]})})},W8=({sourceInfos:{content:n,url:l,knowledgeBaseType:r,highlighted:o}})=>{const[c,f]=q.useState(!o);q.useEffect(()=>{o&&f(!1)},[o]);const d=V8.sanitize(n,{USE_PROFILES:{html:!0}});return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:se(yn.sourceContent,Vy.markdown),children:[v.jsx(xl,{options:{overrides:{a:X8}},children:d}),c&&v.jsx(Y8,{onClose:()=>f(!1)})]}),v.jsx(Z8,{url:l,knowledgeBaseType:r})]})},P8=""+new URL("undraw_fixing-bugs-D_eYxJc6.svg",import.meta.url).href,Q8=()=>{const n=Rt();return v.jsxs("div",{className:yn.loadingError,children:[v.jsx("h1",{children:n("source-infos.error.title")}),v.jsx("img",{src:P8,title:n("source-infos.error.title")}),v.jsx("p",{children:n("source-infos.error.info")})]})},$8=()=>v.jsx("div",{className:yn.loadingSourceInfos,children:v.jsx("svg",{className:yn.loading,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"})})});function ex({sourceInfos:n,onClose:l,threshold:r=100}){const o=q.useRef(null),[c,f]=q.useState(0),[d,m]=q.useState(!1),h=q.useRef(null),p=q.useRef(null),y=q.useCallback(O=>{h.current=O,m(!0)},[]),b=q.useCallback(O=>{if(h.current!==null&&d){const C=O-h.current;C>0&&f(C)}},[d]),A=q.useCallback(()=>{m(!1),c>r&&l(),f(0),h.current=null},[c,r,l]),S=q.useCallback(O=>{const C=H=>y(H.touches[0].clientY),E=H=>b(H.touches[0].clientY),x=()=>A(),M=H=>{H.preventDefault(),y(H.clientY),window.addEventListener("mousemove",L),window.addEventListener("mouseup",z)},L=H=>b(H.clientY),z=()=>{A(),window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",z)};O.addEventListener("touchstart",C),O.addEventListener("touchmove",E),O.addEventListener("touchend",x),O.addEventListener("mousedown",M),p.current=()=>{O.removeEventListener("touchstart",C),O.removeEventListener("touchmove",E),O.removeEventListener("touchend",x),O.removeEventListener("mousedown",M),window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",z)}},[y,b,A]);return q.useEffect(()=>{let O;return o.current?(p.current?.(),S(o.current)):(O=new MutationObserver(()=>{o.current&&(p.current?.(),S(o.current),O?.disconnect())}),O.observe(document.body,{childList:!0,subtree:!0})),()=>{O?.disconnect(),p.current?.()}},[S,n]),{ref:o,dragOffsetY:c,isDragging:d}}const tx=n=>{const[l,r]=q.useState(!0);return q.useEffect(()=>{let o=null;return n?.type==="loading"?(r(!0),o=setTimeout(()=>{r(!1)},300)):r(!n),()=>{o&&clearTimeout(o)}},[n]),l},nx=()=>{const n=Dl(),l=Bt(h=>h.chat.sourceInfos),r=Ky(),o=q.useRef(null),c=tx(l);q.useEffect(()=>{o.current&&l?.type==="loading"&&(r?o.current.showModal():(o.current.setAttribute("open","true"),o.current?.focus()))},[l,r]);const f=q.useCallback(()=>{o.current&&(r?o.current.close():o.current.removeAttribute("open"),n(hS()))},[n,r]),{ref:d,dragOffsetY:m}=ex({onClose:f,sourceInfos:l});return l?v.jsx("dialog",{ref:o,className:se(yn.sourceInfos,c?yn.waitForLoading:l.type==="loading"?yn.loadingContent:""),style:r&&m?{transform:`translateY(${m}px)`}:{},onClose:f,autoFocus:!0,role:"dialog","aria-labelledby":"source-info-title",children:c?null:v.jsxs(v.Fragment,{children:[v.jsx(_8,{ref:d,tabIndex:-1,sourceInfos:l.type==="loaded"?l:void 0,onClose:f}),l.type==="loading"?v.jsx($8,{}):l.type==="loading-error"?v.jsx(Q8,{}):v.jsxs(v.Fragment,{children:[v.jsx(A8,{loading:!l.highlighted}),v.jsx(W8,{sourceInfos:l})]})]})}):null},ax="_container_5axup_1",lx="_body_5axup_7",rx="_intro_5axup_14",ix="_footer_5axup_48",ox="_footnote_5axup_52",sx="_containerWithFootnote_5axup_72",cx="_startChatButton_5axup_87",ux="_spinner_5axup_102",fx="_formFields_5axup_106",dx="_formField_5axup_106",hx="_radio_5axup_118",mx="_checkbox_5axup_125",px="_input_5axup_133",gx="_inputLabel_5axup_167",vx="_selectWrapper_5axup_171",yx="_select_5axup_171",bx="_selectLabel_5axup_217",vn={container:ax,body:lx,intro:rx,footer:ix,footnote:ox,containerWithFootnote:sx,startChatButton:cx,spinner:ux,formFields:fx,formField:dx,radio:hx,checkbox:mx,input:px,inputLabel:gx,selectWrapper:vx,select:yx,selectLabel:bx},_x=({name:n,label:l,defaultValue:r,required:o,onChange:c})=>{const f=d=>{c(d.currentTarget.checked?"true":"false")};return v.jsxs("label",{className:se(vn.checkbox,"chat__startScreen__checkbox"),htmlFor:n,children:[v.jsx("input",{type:"checkbox",id:n,name:n,defaultChecked:r==="true",required:o,onChange:f}),v.jsx("div",{children:l})]})},Ax=({type:n,name:l,label:r,defaultValue:o,placeholder:c,required:f,multiple:d,min:m,max:h,pattern:p,onChange:y})=>{const b=A=>{y(A.target.value)};return v.jsxs("label",{className:se(vn.input,"chat__startScreen__input"),htmlFor:l,children:[v.jsx("div",{className:se(vn.inputLabel),children:r}),v.jsx("input",{type:n,id:l,name:l,defaultValue:o,placeholder:c,required:f,multiple:d,min:m,max:h,pattern:p,onChange:b})]})},Cx=({name:n,value:l,label:r,defaultChecked:o,required:c,onChange:f})=>{const d=`${n}-${l}`,m=h=>{f(h.target.value)};return v.jsxs("label",{className:se(vn.radio,"chat__startScreen__radio"),htmlFor:d,children:[v.jsx("input",{id:d,type:"radio",name:n,value:l,defaultChecked:o,required:c,onChange:m}),v.jsx("span",{className:se(vn.label),children:r})]})},Sx=({name:n,label:l,defaultValue:r,required:o,multiple:c,options:f,onChange:d})=>{const m=h=>{d(h.target.value)};return v.jsxs("label",{className:se(vn.select,"chat__startScreen__select"),htmlFor:n,children:[v.jsx("div",{className:se(vn.selectLabel),children:l}),v.jsx("div",{className:se(vn.selectWrapper),children:v.jsx("select",{id:n,name:n,defaultValue:r,required:o,multiple:c,onChange:m,children:Object.entries(f||{}).map(([h,p])=>v.jsx("option",{value:h,selected:p===r,children:p}))})})]})},Ex="start-screen.intro",Tx="start-screen.start-chat",xx="start-screen.waiting-for-login",Ox="start-screen.footnote",qa="start-screen.form",_v=`${qa}.fields`,wx=()=>{const n=Rt(),l=Dl(),r=sm(),o=Bt(O=>O.startScreen.loginRequestToken),c=Bt(O=>O.settings.requiresUserAuthentication);q.useEffect(()=>{let O;if(o){const x=window.screenX+(window.outerWidth-600)/2,M=window.screenY+(window.outerHeight-700)/2,L=encodeURIComponent(r),z=new URL(window.location.origin);z.pathname=`/${L}/auth/login`,z.searchParams.set("loginRequestToken",o);const H=window.open(z.href,"Login",`width=600,height=700,left=${x},top=${M},resizable=yes,scrollbars=yes`);O=setInterval(()=>{H?.closed&&(l(cS()),clearInterval(O))},500)}return()=>{O&&clearInterval(O)}},[r,o,l]);const[f,d]=q.useState({}),m=()=>{const O=Object.entries(f).reduce((C,[E,x])=>({...C,[E]:x.value}),{});l(c?sS({loginRequestToken:Bc(),formValues:O}):rS({formValues:O}))},h=n(Ex),p=n(o?xx:Tx),y=n(Ox),b=q.useMemo(()=>n(_v)?.split(";").map(O=>O.trim())??[],[n(_v)]);q.useEffect(()=>{b.length&&Object.keys(f).length===0&&d(b.reduce((O,C)=>({...O,[C]:Rx(C,n)}),{}))},[n,b,f]);const A=O=>{O.preventDefault(),m()},S=O=>C=>{d(E=>({...E,[O]:{...E[O],value:C}}))};return v.jsxs("form",{onSubmit:A,className:se(vn.container,y&&vn.containerWithFootnote,"chat__startScreen"),children:[v.jsxs("div",{className:se(vn.body,"chat__startScreen__body"),children:[h&&v.jsx("div",{className:se(vn.intro,"chat__startScreen__intro"),children:v.jsx(xl,{options:{overrides:{a:Av}},children:h})}),v.jsx("div",{className:se(vn.formFields,"chat__startScreen__fields"),children:Object.values(f).map(({type:O,name:C,label:E,placeholder:x,defaultValue:M,options:L,required:z,multiple:H,min:B,max:X,pattern:Z})=>v.jsx("div",{className:se(vn.formField,"chat__startScreen__field"),children:(()=>{switch(O){case"radio":return v.jsxs(v.Fragment,{children:[v.jsx("div",{children:E}),Object.entries(L||{}).map(([re,$])=>v.jsx(Cx,{name:C,value:re,label:$,defaultChecked:re===M,required:z,onChange:S(C)},re))]});case"checkbox":return v.jsx(_x,{name:C,label:E,defaultValue:M,required:z,onChange:S(C)});case"select":return v.jsx(Sx,{name:C,label:E,defaultValue:M,required:z,multiple:H,options:L,onChange:S(C)});default:return v.jsx(Ax,{type:O,name:C,label:E,placeholder:x,defaultValue:M,required:z,multiple:H,min:B,max:X,pattern:Z,onChange:S(C)})}})()},C))})]}),v.jsxs("div",{className:se(vn.footer,"chat__startScreen__footer"),children:[v.jsxs($c,{type:"submit",className:vn.startChatButton,disabled:!!o,children:[!!o&&v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",className:vn.spinner,children:v.jsx("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm88,88H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"})}),v.jsx("div",{children:p})]}),y&&v.jsx("div",{className:vn.footnote,children:v.jsx(xl,{options:{overrides:{a:Av}},children:y})})]})]})},Av=({title:n,href:l,children:r})=>v.jsx("a",{href:l,title:n,target:"_blank",rel:"noopener noreferrer",children:r}),Rx=(n,l)=>{const r=l(`${qa}.${n}.type`)||"text",o=l(`${qa}.${n}.required`)==="true",c=l(`${qa}.${n}.multiple`)==="true",f=l(`${qa}.${n}.placeholder`),d=l(`${qa}.${n}.label`)||"",m=l(`${qa}.${n}.defaultValue`),h=l(`${qa}.${n}.min`),p=l(`${qa}.${n}.max`),y=l(`${qa}.${n}.pattern`),b=Mx(l(`${qa}.${n}.options`));return{name:n,label:d,placeholder:f,value:Nx(r,m,b)||"",defaultValue:m,options:b,type:r,required:o,multiple:c,min:h,max:p,pattern:y}},Nx=(n,l,r)=>l||n==="select"&&Object.keys(r)[0]||"",Mx=(n="")=>n.split(";").map(l=>l.trim()).reduce((l,r)=>{const[o,c]=r.split(":").map(f=>f.trim());return{...l,[o]:c}},{}),Dx=()=>{const n=Bt(l=>l.intl.locale);q.useEffect(()=>{window.document.documentElement.lang=n},[n])},Vr={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"},Lx=({clientName:n})=>{Dx();const l=Dl(),r=Bt(b=>b.intl.messages),o=Rt(),c=Bt(b=>b.settings.enableStartScreen),f=Bt(b=>b.startScreen.startScreenStatus),d=Bt(b=>b.connection.queryString),m=Bt(b=>b.settings.allowedEmbedOrigins),h=q.useMemo(()=>new URLSearchParams(d||"?").get("cssClassName"),[d]);q.useEffect(()=>{const b=new URLSearchParams(d||""),A=Object.fromEntries(b.entries());l(pS(n,A))},[n,d,l]),q.useEffect(()=>{const b=A=>{if(!A.data?.type||!Object.values(Vr).includes(A.data.type))return;const S=A.origin===window.location.origin,O=A.source===window.parent,C=m===void 0||m.includes(A.origin);if(!(S||O&&C)){console.warn("Rejected postMessage from untrusted origin:",A.origin);return}switch(A.data.type){case Vr.TRIGGER_ACTION:l(A.data.action);break;case Vr.TRIGGER_STORY:l(Qv(A.data.story));break;case Vr.ON_CHAT_WINDOW_OPEN:l({type:"webclient.chatwindow.opened"});break;case Vr.ON_CHAT_WINDOW_CLOSE:l({type:"webclient.chatwindow.closed"});break;case Vr.CHAT_MESSAGE_FROM_GUEST:l(Kv(A.data.text));break;case Vr.RESTART_CHAT:l(Wo());break}};return window.addEventListener("message",b,!1),()=>window.removeEventListener("message",b)},[m,l]),q.useEffect(()=>{const b=o("page.title");b&&document&&(document.title=b)},[r,o]);const p=c===void 0,y=c===!1||f==="HIDDEN";return v.jsx("div",{className:se(fv.chatwindow,y&&fv.chatwindowWithAside,"chat__chatwindow",h),children:p?null:y?v.jsxs(v.Fragment,{children:[v.jsx("header",{children:v.jsx(uv,{chatStarted:!0})}),v.jsx("main",{children:v.jsx(U3,{clientName:n})}),v.jsx("aside",{children:v.jsx(nx,{})})]}):v.jsxs(v.Fragment,{children:[v.jsx("header",{children:v.jsx(uv,{chatStarted:!1})}),v.jsx("main",{children:v.jsx(wx,{})})]})})},zx=()=>{const n=sm(),l=Ky();return v.jsx("div",{className:se([GA.app,l?"chat__small":"chat__large"]),children:v.jsx(Lx,{clientName:n})})},Qy={"page.title":"Bubble Chat Chatbot","message-input-label":"Benutzereingabe","message-input-placeholder":"Nachricht eingeben","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","message-input.actions.command.label":"Aktion ausführen","guest-bubble.label":"Ihre Nachricht","bot-bubble.label":"Nachricht des Chatbots","bot-bubble.actions.label":"Nachricht-Aktionen","bot-bubble.reaction.good":"Gefällt mir","bot-bubble.reaction.bad":"Gefällt mir nicht","bot-bubble.reaction.remove":"Markierung entfernen","bot-bubble.reaction.say-more":"Erzähle mir bitte mehr","bot-bubble.reaction.category.WRONG_INFORMATION":"Falsch","bot-bubble.reaction.category.MISSING_INFORMATION":"Unvollständig","bot-bubble.reaction.category.OLD_INFORMATION":"Veraltet","bot-bubble.reaction.category.UNCLEAR":"Unklar","bot-bubble.reaction.category.OFF_TOPIC":"Nicht zur Frage passend","bot-bubble.reaction.comment":"Gedanken mit mir teilen...","bot-bubble.reaction.close":"Schliessen","bot-bubble.copy":"Kopieren","bot-bubble.sources":"Quellenliste","bot-bubble.source.open":"Quelle öffnen","bot-bubble.footnote":"Fussnote","agent-bubble.label":"Nachricht des Live-Agenten","conversation.label":"Chat Verlauf","chatbot.typing":"Chatbot schreibt","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:
|
|
65
65
|
|
|
66
66
|
- Der Chatverlauf wird im EU-Raum gespeichert und kann nur von autorisierten Personen eingesehen werden.
|
|
67
67
|
- Geben Sie im Chatfenster keine persönlichen Daten ein (Passwörter, Geburtsdatum usw.).`,"general-conditions.accept-conditions-note":"Mit der Verwendung des Chats erklären Sie sich mit den Nutzungsbedingungen einverstanden.","block-user-input.title":"Bitte auf die Antwort des Chatbots warten.","conversation-rating.call-to-action.title":"Bewerten Sie diesen Chat","conversation-rating.overlay.title":"Wie zufrieden sind Sie mit diesem Chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Feedback bitte hier eingeben (optional)","conversation-rating.overlay.star.very-bad":"Sehr schlecht","conversation-rating.overlay.star.very-good":"Sehr gut","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"Durchschnitt ist nicht mein Ziel, was kann ich noch verbessern?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Knapp daneben ist auch vorbei. Was kann ich noch verbessern, um das nächste Mal alle Sterne zu erreichen?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfekt! Dann hoffe ich, dass ich Sie wieder einmal so gut beraten kann.","conversation-rating.overlay.bot-message.submit-feedback":"Vielen Dank für die Rückmeldung. Ich bin bestrebt, mich ständig zu verbessern.","conversation-rating.overlay.action.submit":"Bewertung senden","conversation-rating.overlay.action.back-to-chat":"Zurück zum Chat","conversation-rating.overlay.action.close-chat":"Chat minimieren","conversation-rating.overlay.action.restart-chat":"Chat neu starten","conversation-rating.overlay.action.cancel":"Abbrechen","start-screen.intro":"","start-screen.start-chat":"Chat starten","start-screen.waiting-for-login":"Warte auf Login ...","header.close-chat":"Chat minimieren","header.menu.title":"Menü","header.menu.restart-chat":"Chat neu starten","header.menu.expand-chat-window":"Fenster maximieren","header.menu.download-transcript":"Chatverlauf herunterladen","header.menu.send-transcript":"Chatverlauf versenden","header.menu.export-transcript":"Chatverlauf exportieren","header.menu.rate-conversation":"Chat bewerten","source-infos.close":"Schliessen","source-infos.open-source":"Quelle öffnen","source-infos.error.title":"Fehler","source-infos.error.info":"Oops! Etwas ist schiefgelaufen. Bitte versuche es erneut oder kontaktiere den Support, falls das Problem weiterhin besteht.","source-infos.highlight-loading.title":"Relevante Inhalte werden markiert...","source-infos.highlight-loading.description":"Einen Moment – die Quelle wird analysiert.","commands.show-more.action":"Weitere ...","commands.show-more.tooltip":"Weitere Befehle anzeigen","commands.show-less.action":"Weniger ...","commands.show-less.tooltip":"Weniger Befehle anzeigen"},kx={"page.title":"Bubble Chat Chatbot","message-input-label":"User input","message-input-placeholder":"Enter a message","message-input.actions.submit.label":"Send message","message-input.actions.start-audio-recording.label":"Start voice input","message-input.actions.stop-audio-recording.label":"Stop voice input","message-input.actions.submit-audio-recording.label":"Transmit voice input","guest-bubble.label":"Your message","message-input.actions.command.label":"Perform action","bot-bubble.label":"Message from the chatbot","bot-bubble.actions.label":"Message actions","bot-bubble.reaction.good":"I like","bot-bubble.reaction.bad":"I don't like it","bot-bubble.reaction.remove":"Remove marker","bot-bubble.reaction.say-more":"Please tell us more","bot-bubble.reaction.category.WRONG_INFORMATION":"Wrong","bot-bubble.reaction.category.MISSING_INFORMATION":"Incomplete","bot-bubble.reaction.category.OLD_INFORMATION":"Outdated","bot-bubble.reaction.category.UNCLEAR":"Unclear","bot-bubble.reaction.category.OFF_TOPIC":"Not relevant to the question","bot-bubble.reaction.comment":"Share your thoughts with us...","bot-bubble.reaction.close":"Close","bot-bubble.copy":"Copy","bot-bubble.sources":"Source list","bot-bubble.source.open":"Open source","bot-bubble.footnote":"Footnote","agent-bubble.label":"Message from the live agent","conversation.label":"Chat history","chatbot.typing":"Chatbot is typing","export-transcript.email.title":"Receive chat history","export-transcript.email.description":"Please enter the e-mail address to which the chat history should be sent.","export-transcript.email.cancel":"Cancel","export-transcript.email.send":"Send","export-transcript.email.placeholder":"E-mail address","export-transcript.email.invalid":"Please enter a valid e-mail address.","export-transcript.email.success":"The chat history was sent to the e-mail address provided.","general-conditions.header":"**Terms of use**","general-conditions.body":`Please consider the following points:
|
|
@@ -74,4 +74,4 @@ ${fe.current.stack}
|
|
|
74
74
|
|
|
75
75
|
- La cronologia delle chat è memorizzata nell'area UE e può essere visualizzata solo da persone autorizzate.
|
|
76
76
|
- Non inserire dati personali nella finestra di chat (password, data di nascita, ecc.).`,"general-conditions.accept-conditions-note":"Utilizzando la chat si accettano le condizioni d'uso.","block-user-input.title":"Attendere la risposta del chatbot.","conversation-rating.call-to-action.title":"Valuta questa chat","conversation-rating.overlay.title":"Quanto sei soddisfatto di questa chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Inserisci qui il tuo feedback (opzionale)","conversation-rating.overlay.star.very-bad":"Molto male","conversation-rating.overlay.star.very-good":"Molto buono","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"La media non è il mio obiettivo, cosa posso ancora migliorare?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Anche l'assenza è finita. Cosa posso migliorare per ottenere tutte le stelle la prossima volta?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfetto! Allora spero di potervi consigliare ancora una volta bene.","conversation-rating.overlay.bot-message.submit-feedback":"Grazie mille per il feedback. Mi impegno costantemente per migliorare.","conversation-rating.overlay.action.submit":"Invia","conversation-rating.overlay.action.back-to-chat":"Chiudere","conversation-rating.overlay.action.close-chat":"Minimizzare la chat","conversation-rating.overlay.action.restart-chat":"Riavviare la chat","conversation-rating.overlay.action.cancel":"Annulla","start-screen.intro":"","start-screen.start-chat":"Avviare la chat","start-screen.waiting-for-login":"In attesa di login ...","header.close-chat":"Minimizzare la chat","header.menu.title":"Menu","header.menu.restart-chat":"Riavviare la chat","header.menu.expand-chat-window":"Espandere la finestra","header.menu.download-transcript":"Scaricare la trascrizione","header.menu.send-transcript":"Inviare la trascrizione","header.menu.export-transcript":"Esportare la trascrizione","header.menu.rate-conversation":"Valutare la conversazione","source-infos.close":"Chiudere","source-infos.open-source":"Fonte aperta","source-infos.error.title":"Errore","source-infos.error.info":"Ops! Qualcosa è andato storto. Riprovare o contattare l'assistenza se il problema persiste.","source-infos.highlight-loading.title":"Il contenuto rilevante è evidenziato...","source-infos.highlight-loading.description":"Un momento - la fonte è in fase di analisi","commands.show-more.action":"Di più","commands.show-more.tooltip":"Mostra più comandi","commands.show-less.action":"Meno","commands.show-less.tooltip":"Mostra meno comandi"},Ux=["de","en","fr","it"],eb={locale:"de",messages:Qy},Hx=(n,l)=>{if(Ux.includes(n)){const r=qx(n),o=$y(l);return{...r,...o}}return l},qx=n=>{switch(n.toString()){case"en":return kx;case"fr":return Bx;case"it":return jx;default:return Qy}},Ix=(n=Gx,l)=>{switch(l.type){case Wh:return Object.assign({},n,{connectionState:Xr.CONNECTING});case Ph:return Object.assign({},n,{connectionState:Xr.CONNECTED});case Qh:return Object.assign({},n,{connectionState:Xr.DISCONNECTED});case $h:return Object.assign({},n,{connectionState:Xr.RECONNECTED});case em:return Object.assign({},n,{sessionId:l.sessionId});case fu:return Object.assign({},n,{sessionId:l.payload.sessionId,userId:l.payload.userId});case du:return Object.assign({},n,{sessionId:void 0});default:return n}},Gx={connectionState:Xr.DISCONNECTED,sessionId:void 0,userId:void 0,queryString:window.location.search},Vx=(n=Sv,l)=>{switch(l.type){case vy:return Sv;case fu:return Yr({type:"webclient.chat.started"}),n;case du:return Yr({type:"webclient.chat.ended"}),n;case Hv:return Object.assign({},n,{isBotTyping:!0});case qv:return Object.assign({},n,{isBotTyping:!1});case Lh:case Iv:return Cv(n,l.message);case Gv:{Yr(l);const r=Object.assign({},l.message,{_id:l.meta.actionId}),o=n.messages.filter(c=>c._id===l.meta.actionId).length>0;return Object.assign({},n,{isBotTyping:!1,messages:o?n.messages:n.messages.concat([r]),quickReplies:r.quickReplies?r.quickReplies:[]})}case jh:{const r=l.messages,o=r.length?r[r.length-1]:void 0;return Object.assign({},n,{isBotTyping:!1,messages:r,quickReplies:o?.quickReplies||[]})}case Bh:return Yr(l.message),n;case Vv:return Yr(l.event),n;case FA:return Object.assign({},n,{drawerContentUrl:l.payload.parameters.contentUrl});case KA:return Object.assign({},n,{drawerContentUrl:void 0});case JA:return Object.assign({},n,{locale:l.payload.locale});case Zv:return Yr(l),n;case Wv:return Yr(l),{...n,conversationRating:{...n.conversationRating,opener:void 0}};case Hh:{const r=new nu(l.transcription,new kh),o=Object.assign({},r,{_id:Bc()});return Cv(n,o)}case Yv:{const r=n.messages.map(o=>o._id===l.payload.actionId?Object.assign({},o,l.payload.reaction?{reaction:{type:l.payload.reaction,category:l.payload.category,comment:l.payload.comment}}:{reaction:void 0}):o);return Object.assign({},n,{messages:r})}case qh:{const r={enabled:!0,rating:l.payload.rating};return Object.assign({},n,{conversationRating:r})}case zh:{const r={...n.conversationRating,rating:l.payload};return Object.assign({},n,{conversationRating:r})}case by:{const r={...n.conversationRating,opener:l.payload.opener,...l.payload.defaultRating?{rating:{value:l.payload.defaultRating,feedback:n.conversationRating.rating?.feedback||""}}:{}};return Object.assign({},n,{conversationRating:r})}case _y:{const r={...n.conversationRating,opener:void 0};return Object.assign({},n,{conversationRating:r})}case Gh:return{...n,sourceInfos:{type:"loading",chunkId:l.payload.chunkId}};case Ih:{const{highlighted:r}=l.payload;return n.sourceInfos?.type==="loaded"&&r?{...n,sourceInfos:{...n.sourceInfos,highlighted:!0}}:{...n,sourceInfos:{type:"loading-error"}}}case Jv:{const r=n.sourceInfos?.type,{chunkId:o,knowledgeBaseType:c,title:f,content:d,highlighted:m,url:h}=l.payload,p=n.sourceInfos?.type==="loading"||n.sourceInfos?.type==="loaded"?n.sourceInfos?.chunkId:void 0;return p&&p!==o?n:r==="loading"||r==="loaded"&&m?{...n,sourceInfos:{type:"loaded",chunkId:o,knowledgeBaseType:c,title:f,content:d,highlighted:m,url:h}}:n}case Vh:return{...n,sourceInfos:void 0};case yy:return{...n,showTranscriptMailOverlay:!n.showTranscriptMailOverlay,conversationRating:{...n.conversationRating,opener:void 0}};default:return n}},Cv=(n,l)=>{const r=n.messages[n.messages.length-1],o=r?.text===l.text;return r&&r.sender.type===l.sender.type&&o?n:Object.assign({},n,{messages:n.messages.concat([l]),quickReplies:[]})},Yr=n=>{if(Xx()){const l=Yx();window.top?.postMessage(n,l)}else n.type==="webclient.change.url"&&window.open(n.url)},Yx=()=>{try{return document.referrer?new URL(document.referrer).origin:"*"}catch{return"*"}},Xx=()=>typeof window<"u"&&window.self!==window.top,Sv={messages:[],quickReplies:[],isBotTyping:!1,showTranscriptMailOverlay:!1,conversationRating:{enabled:!1}},tb=Jh({name:"intl",initialState:eb,reducers:{updateIntl:(n,l)=>{n.locale=l.payload.language,n.messages=l.payload.messages}}}),{updateIntl:Fx}=tb.actions,Kx=tb.reducer,Jx={version:void 0,requiresUserAuthentication:!1,enableStartScreen:void 0,enableStandaloneView:!1,enableTranscriptExportEmail:!1,enableTranscriptExportPdf:!1,enableGeneralConditions:!1,enableSpeechSupport:!1,commands:[],menuItems:[],allowedEmbedOrigins:void 0},nb=Jh({name:"settings",initialState:Jx,reducers:{setSettings(n,l){n.version&&n.version!==l.payload.version?(console.log("version changed, reloading chat window"),window.location.reload()):(n.version=l.payload.version,n.requiresUserAuthentication=l.payload.requiresUserAuthentication,n.enableStartScreen=l.payload.enableStartScreen,n.enableStandaloneView=l.payload.enableStandaloneView,n.enableTranscriptExportEmail=l.payload.enableTranscriptExportEmail,n.enableTranscriptExportPdf=l.payload.enableTranscriptExportPdf,n.enableGeneralConditions=l.payload.enableGeneralConditions,n.enableSpeechSupport=l.payload.enableSpeechSupport,n.commands=l.payload.commands,n.menuItems=l.payload.menuItems||[],n.allowedEmbedOrigins=l.payload.allowedEmbedOrigins)}}}),{setSettings:Zx}=nb.actions,Wx=nb.reducer,Px=ny({settings:Wx,chat:Vx,startScreen:uS,connection:Ix,intl:Kx}),Qx="bubble-chat",ab="state-last-saved-at",lb="state",$x=n=>{try{if(!n4())return;const l=Ev(n,ab);if(t4(l))return;{const r=Ev(n,lb);if(r===null)return;const o=JSON.parse(r),c=o.connection?.queryString;if(c!==void 0&&!a4(c,window.location.search)){console.log("Ignoring persisted state due to different query string");return}else return o}}catch(l){console.error(l);return}},e4=(n,l)=>{try{const r=JSON.stringify(l);Tv(n,lb,r);const o=new Date().toISOString();Tv(n,ab,o)}catch(r){console.error(r)}},t4=n=>{if(n===null)return!1;const l=new Date(n);return l.setHours(l.getHours()+12),new Date>l},n4=()=>typeof localStorage<"u",Ev=(n,l)=>{const r=rb(n,l);return localStorage.getItem(r)},Tv=(n,l,r)=>{const o=rb(n,l);return localStorage.setItem(o,r)},rb=(n,l)=>`${Qx}-${n}-${l}`,a4=(n,l)=>{const r=new URLSearchParams(n),o=new URLSearchParams(l);r.delete("referrer"),o.delete("referrer");const c=Array.from(r.entries()).sort(),f=Array.from(o.entries()).sort();return c.length!==f.length?!1:c.every(([d,m],h)=>{const[p,y]=f[h];return d===p&&m===y})},el=Object.create(null);el.open="0";el.close="1";el.ping="2";el.pong="3";el.message="4";el.upgrade="5";el.noop="6";const Nc=Object.create(null);Object.keys(el).forEach(n=>{Nc[el[n]]=n});const Sh={type:"error",data:"parser error"},ib=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ob=typeof ArrayBuffer=="function",sb=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,cm=({type:n,data:l},r,o)=>ib&&l instanceof Blob?r?o(l):xv(l,o):ob&&(l instanceof ArrayBuffer||sb(l))?r?o(l):xv(new Blob([l]),o):o(el[n]+(l||"")),xv=(n,l)=>{const r=new FileReader;return r.onload=function(){const o=r.result.split(",")[1];l("b"+(o||""))},r.readAsDataURL(n)};function Ov(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let $d;function l4(n,l){if(ib&&n.data instanceof Blob)return n.data.arrayBuffer().then(Ov).then(l);if(ob&&(n.data instanceof ArrayBuffer||sb(n.data)))return l(Ov(n.data));cm(n,!1,r=>{$d||($d=new TextEncoder),l($d.encode(r))})}const wv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Go=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<wv.length;n++)Go[wv.charCodeAt(n)]=n;const r4=n=>{let l=n.length*.75,r=n.length,o,c=0,f,d,m,h;n[n.length-1]==="="&&(l--,n[n.length-2]==="="&&l--);const p=new ArrayBuffer(l),y=new Uint8Array(p);for(o=0;o<r;o+=4)f=Go[n.charCodeAt(o)],d=Go[n.charCodeAt(o+1)],m=Go[n.charCodeAt(o+2)],h=Go[n.charCodeAt(o+3)],y[c++]=f<<2|d>>4,y[c++]=(d&15)<<4|m>>2,y[c++]=(m&3)<<6|h&63;return p},i4=typeof ArrayBuffer=="function",um=(n,l)=>{if(typeof n!="string")return{type:"message",data:cb(n,l)};const r=n.charAt(0);return r==="b"?{type:"message",data:o4(n.substring(1),l)}:Nc[r]?n.length>1?{type:Nc[r],data:n.substring(1)}:{type:Nc[r]}:Sh},o4=(n,l)=>{if(i4){const r=r4(n);return cb(r,l)}else return{base64:!0,data:n}},cb=(n,l)=>l==="blob"?n instanceof Blob?n:new Blob([n]):n instanceof ArrayBuffer?n:n.buffer,ub="",s4=(n,l)=>{const r=n.length,o=new Array(r);let c=0;n.forEach((f,d)=>{cm(f,!1,m=>{o[d]=m,++c===r&&l(o.join(ub))})})},c4=(n,l)=>{const r=n.split(ub),o=[];for(let c=0;c<r.length;c++){const f=um(r[c],l);if(o.push(f),f.type==="error")break}return o};function u4(){return new TransformStream({transform(n,l){l4(n,r=>{const o=r.length;let c;if(o<126)c=new Uint8Array(1),new DataView(c.buffer).setUint8(0,o);else if(o<65536){c=new Uint8Array(3);const f=new DataView(c.buffer);f.setUint8(0,126),f.setUint16(1,o)}else{c=new Uint8Array(9);const f=new DataView(c.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(o))}n.data&&typeof n.data!="string"&&(c[0]|=128),l.enqueue(c),l.enqueue(r)})}})}let eh;function Sc(n){return n.reduce((l,r)=>l+r.length,0)}function Ec(n,l){if(n[0].length===l)return n.shift();const r=new Uint8Array(l);let o=0;for(let c=0;c<l;c++)r[c]=n[0][o++],o===n[0].length&&(n.shift(),o=0);return n.length&&o<n[0].length&&(n[0]=n[0].slice(o)),r}function f4(n,l){eh||(eh=new TextDecoder);const r=[];let o=0,c=-1,f=!1;return new TransformStream({transform(d,m){for(r.push(d);;){if(o===0){if(Sc(r)<1)break;const h=Ec(r,1);f=(h[0]&128)===128,c=h[0]&127,c<126?o=3:c===126?o=1:o=2}else if(o===1){if(Sc(r)<2)break;const h=Ec(r,2);c=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),o=3}else if(o===2){if(Sc(r)<8)break;const h=Ec(r,8),p=new DataView(h.buffer,h.byteOffset,h.length),y=p.getUint32(0);if(y>Math.pow(2,21)-1){m.enqueue(Sh);break}c=y*Math.pow(2,32)+p.getUint32(4),o=3}else{if(Sc(r)<c)break;const h=Ec(r,c);m.enqueue(um(f?h:eh.decode(h),l)),o=0}if(c===0||c>n){m.enqueue(Sh);break}}}})}const fb=4;function rn(n){if(n)return d4(n)}function d4(n){for(var l in rn.prototype)n[l]=rn.prototype[l];return n}rn.prototype.on=rn.prototype.addEventListener=function(n,l){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(l),this};rn.prototype.once=function(n,l){function r(){this.off(n,r),l.apply(this,arguments)}return r.fn=l,this.on(n,r),this};rn.prototype.off=rn.prototype.removeListener=rn.prototype.removeAllListeners=rn.prototype.removeEventListener=function(n,l){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+n];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var o,c=0;c<r.length;c++)if(o=r[c],o===l||o.fn===l){r.splice(c,1);break}return r.length===0&&delete this._callbacks["$"+n],this};rn.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var l=new Array(arguments.length-1),r=this._callbacks["$"+n],o=1;o<arguments.length;o++)l[o-1]=arguments[o];if(r){r=r.slice(0);for(var o=0,c=r.length;o<c;++o)r[o].apply(this,l)}return this};rn.prototype.emitReserved=rn.prototype.emit;rn.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};rn.prototype.hasListeners=function(n){return!!this.listeners(n).length};const bu=typeof Promise=="function"&&typeof Promise.resolve=="function"?l=>Promise.resolve().then(l):(l,r)=>r(l,0),Ra=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),h4="arraybuffer";function db(n,...l){return l.reduce((r,o)=>(n.hasOwnProperty(o)&&(r[o]=n[o]),r),{})}const m4=Ra.setTimeout,p4=Ra.clearTimeout;function _u(n,l){l.useNativeTimers?(n.setTimeoutFn=m4.bind(Ra),n.clearTimeoutFn=p4.bind(Ra)):(n.setTimeoutFn=Ra.setTimeout.bind(Ra),n.clearTimeoutFn=Ra.clearTimeout.bind(Ra))}const g4=1.33;function v4(n){return typeof n=="string"?y4(n):Math.ceil((n.byteLength||n.size)*g4)}function y4(n){let l=0,r=0;for(let o=0,c=n.length;o<c;o++)l=n.charCodeAt(o),l<128?r+=1:l<2048?r+=2:l<55296||l>=57344?r+=3:(o++,r+=4);return r}function hb(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function b4(n){let l="";for(let r in n)n.hasOwnProperty(r)&&(l.length&&(l+="&"),l+=encodeURIComponent(r)+"="+encodeURIComponent(n[r]));return l}function _4(n){let l={},r=n.split("&");for(let o=0,c=r.length;o<c;o++){let f=r[o].split("=");l[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return l}class A4 extends Error{constructor(l,r,o){super(l),this.description=r,this.context=o,this.type="TransportError"}}class fm extends rn{constructor(l){super(),this.writable=!1,_u(this,l),this.opts=l,this.query=l.query,this.socket=l.socket,this.supportsBinary=!l.forceBase64}onError(l,r,o){return super.emitReserved("error",new A4(l,r,o)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(l){this.readyState==="open"&&this.write(l)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(l){const r=um(l,this.socket.binaryType);this.onPacket(r)}onPacket(l){super.emitReserved("packet",l)}onClose(l){this.readyState="closed",super.emitReserved("close",l)}pause(l){}createUri(l,r={}){return l+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const l=this.opts.hostname;return l.indexOf(":")===-1?l:"["+l+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(l){const r=b4(l);return r.length?"?"+r:""}}class C4 extends fm{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(l){this.readyState="pausing";const r=()=>{this.readyState="paused",l()};if(this._polling||!this.writable){let o=0;this._polling&&(o++,this.once("pollComplete",function(){--o||r()})),this.writable||(o++,this.once("drain",function(){--o||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(l){const r=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};c4(l,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const l=()=>{this.write([{type:"close"}])};this.readyState==="open"?l():this.once("open",l)}write(l){this.writable=!1,s4(l,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const l=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=hb()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(l,r)}}let mb=!1;try{mb=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const S4=mb;function E4(){}class T4 extends C4{constructor(l){if(super(l),typeof location<"u"){const r=location.protocol==="https:";let o=location.port;o||(o=r?"443":"80"),this.xd=typeof location<"u"&&l.hostname!==location.hostname||o!==l.port}}doWrite(l,r){const o=this.request({method:"POST",data:l});o.on("success",r),o.on("error",(c,f)=>{this.onError("xhr post error",c,f)})}doPoll(){const l=this.request();l.on("data",this.onData.bind(this)),l.on("error",(r,o)=>{this.onError("xhr poll error",r,o)}),this.pollXhr=l}}class Qa extends rn{constructor(l,r,o){super(),this.createRequest=l,_u(this,o),this._opts=o,this._method=o.method||"GET",this._uri=r,this._data=o.data!==void 0?o.data:null,this._create()}_create(){var l;const r=db(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(r);try{o.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let c in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(c)&&o.setRequestHeader(c,this._opts.extraHeaders[c])}}catch{}if(this._method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(l=this._opts.cookieJar)===null||l===void 0||l.addCookies(o),"withCredentials"in o&&(o.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(o.timeout=this._opts.requestTimeout),o.onreadystatechange=()=>{var c;o.readyState===3&&((c=this._opts.cookieJar)===null||c===void 0||c.parseCookies(o.getResponseHeader("set-cookie"))),o.readyState===4&&(o.status===200||o.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof o.status=="number"?o.status:0)},0))},o.send(this._data)}catch(c){this.setTimeoutFn(()=>{this._onError(c)},0);return}typeof document<"u"&&(this._index=Qa.requestsCount++,Qa.requests[this._index]=this)}_onError(l){this.emitReserved("error",l,this._xhr),this._cleanup(!0)}_cleanup(l){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=E4,l)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Qa.requests[this._index],this._xhr=null}}_onLoad(){const l=this._xhr.responseText;l!==null&&(this.emitReserved("data",l),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Qa.requestsCount=0;Qa.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Rv);else if(typeof addEventListener=="function"){const n="onpagehide"in Ra?"pagehide":"unload";addEventListener(n,Rv,!1)}}function Rv(){for(let n in Qa.requests)Qa.requests.hasOwnProperty(n)&&Qa.requests[n].abort()}const x4=(function(){const n=pb({xdomain:!1});return n&&n.responseType!==null})();class O4 extends T4{constructor(l){super(l);const r=l&&l.forceBase64;this.supportsBinary=x4&&!r}request(l={}){return Object.assign(l,{xd:this.xd},this.opts),new Qa(pb,this.uri(),l)}}function pb(n){const l=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!l||S4))return new XMLHttpRequest}catch{}if(!l)try{return new Ra[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const gb=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class w4 extends fm{get name(){return"websocket"}doOpen(){const l=this.uri(),r=this.opts.protocols,o=gb?{}:db(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(l,r,o)}catch(c){return this.emitReserved("error",c)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=l=>this.onClose({description:"websocket connection closed",context:l}),this.ws.onmessage=l=>this.onData(l.data),this.ws.onerror=l=>this.onError("websocket error",l)}write(l){this.writable=!1;for(let r=0;r<l.length;r++){const o=l[r],c=r===l.length-1;cm(o,this.supportsBinary,f=>{try{this.doWrite(o,f)}catch{}c&&bu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const l=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=hb()),this.supportsBinary||(r.b64=1),this.createUri(l,r)}}const th=Ra.WebSocket||Ra.MozWebSocket;class R4 extends w4{createSocket(l,r,o){return gb?new th(l,r,o):r?new th(l,r):new th(l)}doWrite(l,r){this.ws.send(r)}}class N4 extends fm{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(l){return this.emitReserved("error",l)}this._transport.closed.then(()=>{this.onClose()}).catch(l=>{this.onError("webtransport error",l)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(l=>{const r=f4(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=l.readable.pipeThrough(r).getReader(),c=u4();c.readable.pipeTo(l.writable),this._writer=c.writable.getWriter();const f=()=>{o.read().then(({done:m,value:h})=>{m||(this.onPacket(h),f())}).catch(m=>{})};f();const d={type:"open"};this.query.sid&&(d.data=`{"sid":"${this.query.sid}"}`),this._writer.write(d).then(()=>this.onOpen())})})}write(l){this.writable=!1;for(let r=0;r<l.length;r++){const o=l[r],c=r===l.length-1;this._writer.write(o).then(()=>{c&&bu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var l;(l=this._transport)===null||l===void 0||l.close()}}const M4={websocket:R4,webtransport:N4,polling:O4},D4=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,L4=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Eh(n){if(n.length>8e3)throw"URI too long";const l=n,r=n.indexOf("["),o=n.indexOf("]");r!=-1&&o!=-1&&(n=n.substring(0,r)+n.substring(r,o).replace(/:/g,";")+n.substring(o,n.length));let c=D4.exec(n||""),f={},d=14;for(;d--;)f[L4[d]]=c[d]||"";return r!=-1&&o!=-1&&(f.source=l,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=z4(f,f.path),f.queryKey=k4(f,f.query),f}function z4(n,l){const r=/\/{2,9}/g,o=l.replace(r,"/").split("/");return(l.slice(0,1)=="/"||l.length===0)&&o.splice(0,1),l.slice(-1)=="/"&&o.splice(o.length-1,1),o}function k4(n,l){const r={};return l.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,c,f){c&&(r[c]=f)}),r}const Th=typeof addEventListener=="function"&&typeof removeEventListener=="function",Mc=[];Th&&addEventListener("offline",()=>{Mc.forEach(n=>n())},!1);class fr extends rn{constructor(l,r){if(super(),this.binaryType=h4,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,l&&typeof l=="object"&&(r=l,l=null),l){const o=Eh(l);r.hostname=o.host,r.secure=o.protocol==="https"||o.protocol==="wss",r.port=o.port,o.query&&(r.query=o.query)}else r.host&&(r.hostname=Eh(r.host).host);_u(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(o=>{const c=o.prototype.name;this.transports.push(c),this._transportsByName[c]=o}),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},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=_4(this.opts.query)),Th&&(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"})},Mc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(l){const r=Object.assign({},this.opts.query);r.EIO=fb,r.transport=l,this.id&&(r.sid=this.id);const o=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[l]);return new this._transportsByName[l](o)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const l=this.opts.rememberUpgrade&&fr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(l);r.open(),this.setTransport(r)}setTransport(l){this.transport&&this.transport.removeAllListeners(),this.transport=l,l.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",fr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(l){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",l),this.emitReserved("heartbeat"),l.type){case"open":this.onHandshake(JSON.parse(l.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=l.data,this._onError(r);break;case"message":this.emitReserved("data",l.data),this.emitReserved("message",l.data);break}}onHandshake(l){this.emitReserved("handshake",l),this.id=l.sid,this.transport.query.sid=l.sid,this._pingInterval=l.pingInterval,this._pingTimeout=l.pingTimeout,this._maxPayload=l.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const l=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+l,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},l),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 l=this._getWritablePackets();this.transport.send(l),this._prevBufferLen=l.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let o=0;o<this.writeBuffer.length;o++){const c=this.writeBuffer[o].data;if(c&&(r+=v4(c)),o>0&&r>this._maxPayload)return this.writeBuffer.slice(0,o);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const l=Date.now()>this._pingTimeoutTime;return l&&(this._pingTimeoutTime=0,bu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),l}write(l,r,o){return this._sendPacket("message",l,r,o),this}send(l,r,o){return this._sendPacket("message",l,r,o),this}_sendPacket(l,r,o,c){if(typeof r=="function"&&(c=r,r=void 0),typeof o=="function"&&(c=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const f={type:l,data:r,options:o};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),c&&this.once("flush",c),this.flush()}close(){const l=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),l()},o=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():l()}):this.upgrading?o():l()),this}_onError(l){if(fr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",l),this._onClose("transport error",l)}_onClose(l,r){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(),Th&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=Mc.indexOf(this._offlineEventListener);o!==-1&&Mc.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",l,r),this.writeBuffer=[],this._prevBufferLen=0}}}fr.protocol=fb;class B4 extends fr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let l=0;l<this._upgrades.length;l++)this._probe(this._upgrades[l])}_probe(l){let r=this.createTransport(l),o=!1;fr.priorWebsocketSuccess=!1;const c=()=>{o||(r.send([{type:"ping",data:"probe"}]),r.once("packet",b=>{if(!o)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;fr.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(y(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const A=new Error("probe error");A.transport=r.name,this.emitReserved("upgradeError",A)}}))};function f(){o||(o=!0,y(),r.close(),r=null)}const d=b=>{const A=new Error("probe error: "+b);A.transport=r.name,f(),this.emitReserved("upgradeError",A)};function m(){d("transport closed")}function h(){d("socket closed")}function p(b){r&&b.name!==r.name&&f()}const y=()=>{r.removeListener("open",c),r.removeListener("error",d),r.removeListener("close",m),this.off("close",h),this.off("upgrading",p)};r.once("open",c),r.once("error",d),r.once("close",m),this.once("close",h),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&l!=="webtransport"?this.setTimeoutFn(()=>{o||r.open()},200):r.open()}onHandshake(l){this._upgrades=this._filterUpgrades(l.upgrades),super.onHandshake(l)}_filterUpgrades(l){const r=[];for(let o=0;o<l.length;o++)~this.transports.indexOf(l[o])&&r.push(l[o]);return r}}let j4=class extends B4{constructor(l,r={}){const o=typeof l=="object"?l:r;(!o.transports||o.transports&&typeof o.transports[0]=="string")&&(o.transports=(o.transports||["polling","websocket","webtransport"]).map(c=>M4[c]).filter(c=>!!c)),super(l,o)}};function U4(n,l="",r){let o=n;r=r||typeof location<"u"&&location,n==null&&(n=r.protocol+"//"+r.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=r.protocol+n:n=r.host+n),/^(https?|wss?):\/\//.test(n)||(typeof r<"u"?n=r.protocol+"//"+n:n="https://"+n),o=Eh(n)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const f=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+f+":"+o.port+l,o.href=o.protocol+"://"+f+(r&&r.port===o.port?"":":"+o.port),o}const H4=typeof ArrayBuffer=="function",q4=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,vb=Object.prototype.toString,I4=typeof Blob=="function"||typeof Blob<"u"&&vb.call(Blob)==="[object BlobConstructor]",G4=typeof File=="function"||typeof File<"u"&&vb.call(File)==="[object FileConstructor]";function dm(n){return H4&&(n instanceof ArrayBuffer||q4(n))||I4&&n instanceof Blob||G4&&n instanceof File}function Dc(n,l){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let r=0,o=n.length;r<o;r++)if(Dc(n[r]))return!0;return!1}if(dm(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return Dc(n.toJSON(),!0);for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&Dc(n[r]))return!0;return!1}function V4(n){const l=[],r=n.data,o=n;return o.data=xh(r,l),o.attachments=l.length,{packet:o,buffers:l}}function xh(n,l){if(!n)return n;if(dm(n)){const r={_placeholder:!0,num:l.length};return l.push(n),r}else if(Array.isArray(n)){const r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=xh(n[o],l);return r}else if(typeof n=="object"&&!(n instanceof Date)){const r={};for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=xh(n[o],l));return r}return n}function Y4(n,l){return n.data=Oh(n.data,l),delete n.attachments,n}function Oh(n,l){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<l.length)return l[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let r=0;r<n.length;r++)n[r]=Oh(n[r],l);else if(typeof n=="object")for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=Oh(n[r],l));return n}const X4=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var We;(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"})(We||(We={}));class F4{constructor(l){this.replacer=l}encode(l){return(l.type===We.EVENT||l.type===We.ACK)&&Dc(l)?this.encodeAsBinary({type:l.type===We.EVENT?We.BINARY_EVENT:We.BINARY_ACK,nsp:l.nsp,data:l.data,id:l.id}):[this.encodeAsString(l)]}encodeAsString(l){let r=""+l.type;return(l.type===We.BINARY_EVENT||l.type===We.BINARY_ACK)&&(r+=l.attachments+"-"),l.nsp&&l.nsp!=="/"&&(r+=l.nsp+","),l.id!=null&&(r+=l.id),l.data!=null&&(r+=JSON.stringify(l.data,this.replacer)),r}encodeAsBinary(l){const r=V4(l),o=this.encodeAsString(r.packet),c=r.buffers;return c.unshift(o),c}}class hm extends rn{constructor(l){super(),this.reviver=l}add(l){let r;if(typeof l=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(l);const o=r.type===We.BINARY_EVENT;o||r.type===We.BINARY_ACK?(r.type=o?We.EVENT:We.ACK,this.reconstructor=new K4(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(dm(l)||l.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(l),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+l)}decodeString(l){let r=0;const o={type:Number(l.charAt(0))};if(We[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===We.BINARY_EVENT||o.type===We.BINARY_ACK){const f=r+1;for(;l.charAt(++r)!=="-"&&r!=l.length;);const d=l.substring(f,r);if(d!=Number(d)||l.charAt(r)!=="-")throw new Error("Illegal attachments");o.attachments=Number(d)}if(l.charAt(r+1)==="/"){const f=r+1;for(;++r&&!(l.charAt(r)===","||r===l.length););o.nsp=l.substring(f,r)}else o.nsp="/";const c=l.charAt(r+1);if(c!==""&&Number(c)==c){const f=r+1;for(;++r;){const d=l.charAt(r);if(d==null||Number(d)!=d){--r;break}if(r===l.length)break}o.id=Number(l.substring(f,r+1))}if(l.charAt(++r)){const f=this.tryParse(l.substr(r));if(hm.isPayloadValid(o.type,f))o.data=f;else throw new Error("invalid payload")}return o}tryParse(l){try{return JSON.parse(l,this.reviver)}catch{return!1}}static isPayloadValid(l,r){switch(l){case We.CONNECT:return Nv(r);case We.DISCONNECT:return r===void 0;case We.CONNECT_ERROR:return typeof r=="string"||Nv(r);case We.EVENT:case We.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&X4.indexOf(r[0])===-1);case We.ACK:case We.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class K4{constructor(l){this.packet=l,this.buffers=[],this.reconPack=l}takeBinaryData(l){if(this.buffers.push(l),this.buffers.length===this.reconPack.attachments){const r=Y4(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Nv(n){return Object.prototype.toString.call(n)==="[object Object]"}const J4=Object.freeze(Object.defineProperty({__proto__:null,Decoder:hm,Encoder:F4,get PacketType(){return We}},Symbol.toStringTag,{value:"Module"}));function Ia(n,l,r){return n.on(l,r),function(){n.off(l,r)}}const Z4=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class yb extends rn{constructor(l,r,o){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=l,this.nsp=r,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const l=this.io;this.subs=[Ia(l,"open",this.onopen.bind(this)),Ia(l,"packet",this.onpacket.bind(this)),Ia(l,"error",this.onerror.bind(this)),Ia(l,"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(...l){return l.unshift("message"),this.emit.apply(this,l),this}emit(l,...r){var o,c,f;if(Z4.hasOwnProperty(l))throw new Error('"'+l.toString()+'" is a reserved event name');if(r.unshift(l),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const d={type:We.EVENT,data:r};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const y=this.ids++,b=r.pop();this._registerAckCallback(y,b),d.id=y}const m=(c=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||c===void 0?void 0:c.writable,h=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!m||(h?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d)),this.flags={},this}_registerAckCallback(l,r){var o;const c=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(c===void 0){this.acks[l]=r;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[l];for(let m=0;m<this.sendBuffer.length;m++)this.sendBuffer[m].id===l&&this.sendBuffer.splice(m,1);r.call(this,new Error("operation has timed out"))},c),d=(...m)=>{this.io.clearTimeoutFn(f),r.apply(this,m)};d.withError=!0,this.acks[l]=d}emitWithAck(l,...r){return new Promise((o,c)=>{const f=(d,m)=>d?c(d):o(m);f.withError=!0,r.push(f),this.emit(l,...r)})}_addToQueue(l){let r;typeof l[l.length-1]=="function"&&(r=l.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:l,flags:Object.assign({fromQueue:!0},this.flags)};l.push((c,...f)=>(this._queue[0],c!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(c)):(this._queue.shift(),r&&r(null,...f)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(l=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!l||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(l){l.nsp=this.nsp,this.io._packet(l)}onopen(){typeof this.auth=="function"?this.auth(l=>{this._sendConnectPacket(l)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(l){this.packet({type:We.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},l):l})}onerror(l){this.connected||this.emitReserved("connect_error",l)}onclose(l,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",l,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(l=>{if(!this.sendBuffer.some(o=>String(o.id)===l)){const o=this.acks[l];delete this.acks[l],o.withError&&o.call(this,new Error("socket has been disconnected"))}})}onpacket(l){if(l.nsp===this.nsp)switch(l.type){case We.CONNECT:l.data&&l.data.sid?this.onconnect(l.data.sid,l.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 We.EVENT:case We.BINARY_EVENT:this.onevent(l);break;case We.ACK:case We.BINARY_ACK:this.onack(l);break;case We.DISCONNECT:this.ondisconnect();break;case We.CONNECT_ERROR:this.destroy();const o=new Error(l.data.message);o.data=l.data.data,this.emitReserved("connect_error",o);break}}onevent(l){const r=l.data||[];l.id!=null&&r.push(this.ack(l.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(l){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const o of r)o.apply(this,l)}super.emit.apply(this,l),this._pid&&l.length&&typeof l[l.length-1]=="string"&&(this._lastOffset=l[l.length-1])}ack(l){const r=this;let o=!1;return function(...c){o||(o=!0,r.packet({type:We.ACK,id:l,data:c}))}}onack(l){const r=this.acks[l.id];typeof r=="function"&&(delete this.acks[l.id],r.withError&&l.data.unshift(null),r.apply(this,l.data))}onconnect(l,r){this.id=l,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(l=>this.emitEvent(l)),this.receiveBuffer=[],this.sendBuffer.forEach(l=>{this.notifyOutgoingListeners(l),this.packet(l)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(l=>l()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:We.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(l){return this.flags.compress=l,this}get volatile(){return this.flags.volatile=!0,this}timeout(l){return this.flags.timeout=l,this}onAny(l){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(l),this}prependAny(l){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(l),this}offAny(l){if(!this._anyListeners)return this;if(l){const r=this._anyListeners;for(let o=0;o<r.length;o++)if(l===r[o])return r.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(l){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(l),this}prependAnyOutgoing(l){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(l),this}offAnyOutgoing(l){if(!this._anyOutgoingListeners)return this;if(l){const r=this._anyOutgoingListeners;for(let o=0;o<r.length;o++)if(l===r[o])return r.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(l){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const o of r)o.apply(this,l.data)}}}function ji(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}ji.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var l=Math.random(),r=Math.floor(l*this.jitter*n);n=(Math.floor(l*10)&1)==0?n-r:n+r}return Math.min(n,this.max)|0};ji.prototype.reset=function(){this.attempts=0};ji.prototype.setMin=function(n){this.ms=n};ji.prototype.setMax=function(n){this.max=n};ji.prototype.setJitter=function(n){this.jitter=n};class wh extends rn{constructor(l,r){var o;super(),this.nsps={},this.subs=[],l&&typeof l=="object"&&(r=l,l=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,_u(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((o=r.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new ji({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=l;const c=r.parser||J4;this.encoder=new c.Encoder,this.decoder=new c.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(l){return arguments.length?(this._reconnection=!!l,l||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(l){return l===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=l,this)}reconnectionDelay(l){var r;return l===void 0?this._reconnectionDelay:(this._reconnectionDelay=l,(r=this.backoff)===null||r===void 0||r.setMin(l),this)}randomizationFactor(l){var r;return l===void 0?this._randomizationFactor:(this._randomizationFactor=l,(r=this.backoff)===null||r===void 0||r.setJitter(l),this)}reconnectionDelayMax(l){var r;return l===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=l,(r=this.backoff)===null||r===void 0||r.setMax(l),this)}timeout(l){return arguments.length?(this._timeout=l,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(l){if(~this._readyState.indexOf("open"))return this;this.engine=new j4(this.uri,this.opts);const r=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const c=Ia(r,"open",function(){o.onopen(),l&&l()}),f=m=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",m),l?l(m):this.maybeReconnectOnOpen()},d=Ia(r,"error",f);if(this._timeout!==!1){const m=this._timeout,h=this.setTimeoutFn(()=>{c(),f(new Error("timeout")),r.close()},m);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(c),this.subs.push(d),this}connect(l){return this.open(l)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const l=this.engine;this.subs.push(Ia(l,"ping",this.onping.bind(this)),Ia(l,"data",this.ondata.bind(this)),Ia(l,"error",this.onerror.bind(this)),Ia(l,"close",this.onclose.bind(this)),Ia(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(l){try{this.decoder.add(l)}catch(r){this.onclose("parse error",r)}}ondecoded(l){bu(()=>{this.emitReserved("packet",l)},this.setTimeoutFn)}onerror(l){this.emitReserved("error",l)}socket(l,r){let o=this.nsps[l];return o?this._autoConnect&&!o.active&&o.connect():(o=new yb(this,l,r),this.nsps[l]=o),o}_destroy(l){const r=Object.keys(this.nsps);for(const o of r)if(this.nsps[o].active)return;this._close()}_packet(l){const r=this.encoder.encode(l);for(let o=0;o<r.length;o++)this.engine.write(r[o],l.options)}cleanup(){this.subs.forEach(l=>l()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(l,r){var o;this.cleanup(),(o=this.engine)===null||o===void 0||o.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",l,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const l=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{l.skipReconnect||(this.emitReserved("reconnect_attempt",l.backoff.attempts),!l.skipReconnect&&l.open(c=>{c?(l._reconnecting=!1,l.reconnect(),this.emitReserved("reconnect_error",c)):l.onreconnect()}))},r);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const l=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",l)}}const Ho={};function Lc(n,l){typeof n=="object"&&(l=n,n=void 0),l=l||{};const r=U4(n,l.path||"/socket.io"),o=r.source,c=r.id,f=r.path,d=Ho[c]&&f in Ho[c].nsps,m=l.forceNew||l["force new connection"]||l.multiplex===!1||d;let h;return m?h=new wh(o,l):(Ho[c]||(Ho[c]=new wh(o,l)),h=Ho[c]),r.query&&!l.query&&(l.query=r.queryKey),h.socket(r.path,l)}Object.assign(Lc,{Manager:wh,Socket:yb,io:Lc,connect:Lc});const W4=[Gv,Vv,Hv,qv,YA,...mS,...nC,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],P4=({dispatch:n,getState:l})=>r=>{let o=null;return c=>{const f=r(c);if(c.type===Zh){o?.disconnect(),n(vS());const m={path:`/website-messenger/${c.clientName}/socket.io`,query:c.querystrings};o=Lc(m),o.on("action",n),o.on("connect",()=>n(yS())),o.on("disconnect",()=>n(bS())),o.on("reconnect",()=>n(_S())),o.on("set-translations",(h,p)=>{n(Fx({language:h,messages:Hx(h,p)}))}),o.on("set-settings",h=>{n(Zx(h))}),o.on("enable-conversation-rating",h=>n(oC(h))),o.on("speech-transcription",h=>n(lC(h))),o.on("restore-client-state",h=>{n(gS(h.sessionId)),n(cC(h.messages))}),o.on("expand-window",({devices:h,initial:p=!1})=>{n({type:Zv,devices:h,initial:p})}),o.on("restart-chat",()=>{n(Wo())}),o.on("login-success",h=>{n(iS({loginToken:h.loginToken}))})}else if(c.type==="start-screen/requestLogin")o?.emit("login-requested",c.payload);else if(c.type===fu)o?.emit("start-chat",c.payload);else if(c.type===du)o?.emit("terminate-session",c.payload);else if(c.type===tC)o?.emit("get-started",JSON.stringify(c));else if(c.type===Uh)o?.emit("audio-message",c.buffer);else if(c.type===zh)o?.emit("conversation-rating",c.payload);else if(c.type===Pv){const{connection:{sessionId:d}}=l();if(d){const m=au(),h=new URL(`/${encodeURIComponent(m)}/transcript-pdf/${encodeURIComponent(d)}`,window.location.origin);window.location.href=h.toString()}}else W4.indexOf(c.type)===-1&&c.meta===void 0&&o&&o.emit("action",JSON.stringify(c));return f}},bb=au(),Q4={...$x(bb),intl:eb},Rh=FC({middleware:n=>n().concat(P4),reducer:Px,preloadedState:Q4});Rh.subscribe(s6(()=>{const n=Rh.getState();e4(bb,{connection:n.connection,startScreen:n.startScreen})},1e3));const $4=document.getElementById("root"),eO=k2.createRoot($4);eO.render(v.jsx(zA,{store:Rh,children:v.jsx(zx,{})}));
|
|
77
|
-
//# sourceMappingURL=index-
|
|
77
|
+
//# sourceMappingURL=index-2NlIygAz.js.map
|