@botfabrik/engine-webclient 4.69.2 → 4.69.4
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.
|
@@ -95,17 +95,17 @@ For more details see https://formatjs.io/docs/getting-started/message-distributi
|
|
|
95
95
|
`,{inline:v}));for(;typeof m[m.length-1]=="string"&&!m[m.length-1].trim();)m.pop();if(t.wrapper===null)return m;const S=t.wrapper||(v?"span":"div");let h;if(m.length>1||t.forceWrapper)h=m;else{if(m.length===1)return h=m[0],typeof h=="string"?r("span",{key:"outer"},h):h;h=null}return R.createElement(S,{key:"outer"},h)}function o(f){const v=f.match(jx);return v?v.reduce(function(m,S,h){const d=S.indexOf("=");if(d!==-1){const g=function(x){return x.indexOf("-")!==-1&&x.match(eT)===null&&(x=x.replace(oT,function(T,F){return F.toUpperCase()})),x}(S.slice(0,d)).trim(),E=function(x){const T=x[0];return(T==='"'||T==="'")&&x.length>=2&&x[x.length-1]===T?x.slice(1,-1):x}(S.slice(d+1).trim()),w=bh[g]||g,b=m[w]=function(x,T){return x==="style"?T.split(/;\s?/).reduce(function(F,P){const se=P.slice(0,P.indexOf(":"));return F[se.trim().replace(/(-[a-z])/g,ve=>ve[1].toUpperCase())]=P.slice(se.length+1).trim(),F},{}):x==="href"||x==="src"?nr(T):(T.match(tT)&&(T=T.slice(1,T.length-1)),T==="true"||T!=="false"&&T)}(g,E);typeof b=="string"&&(vu.test(b)||_u.test(b))&&(m[w]=R.cloneElement(i(b.trim()),{key:h}))}else S!=="style"&&(m[bh[S]||S]=!0);return m},{}):null}const s=[],a={},l={0:{match:zt(nv),order:1,parse:(f,v,m)=>({children:v(f[0].replace($x,""),m)}),render:(f,v,m)=>r("blockquote",{key:m.key},v(f.children,m))},1:{match:Xr(Hx),order:1,parse:Wa,render:(f,v,m)=>r("br",{key:m.key})},2:{match:zt(Gx),order:1,parse:Wa,render:(f,v,m)=>r("hr",{key:m.key})},3:{match:zt(iv),order:0,parse:f=>({lang:void 0,text:f[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}),render:(f,v,m)=>r("pre",{key:m.key},r("code",Fn({},f.attrs,{className:f.lang?`lang-${f.lang}`:""}),f.text))},4:{match:zt(rv),order:0,parse:f=>({attrs:o(f[3]||""),lang:f[2]||void 0,text:f[4],type:"3"})},5:{match:rn(Vx),order:3,parse:f=>({text:f[2]}),render:(f,v,m)=>r("code",{key:m.key},f.text)},6:{match:zt(Xx),order:0,parse:f=>(s.push({footnote:f[2],identifier:f[1]}),{}),render:qa},7:{match:nn(Qx),order:1,parse:f=>({target:`#${t.slugify(f[1])}`,text:f[1]}),render:(f,v,m)=>r("a",{key:m.key,href:nr(f.target)},r("sup",{key:m.key},f.text))},8:{match:nn(Zx),order:1,parse:f=>({completed:f[1].toLowerCase()==="x"}),render:(f,v,m)=>r("input",{checked:f.completed,key:m.key,readOnly:!0,type:"checkbox"})},9:{match:zt(t.enforceAtxHeadings?sv:ov),order:1,parse:(f,v,m)=>({children:Mo(v,f[2],m),id:t.slugify(f[2]),level:f[1].length}),render:(f,v,m)=>r(`h${f.level}`,{id:f.id,key:m.key},v(f.children,m))},10:{match:zt(av),order:0,parse:(f,v,m)=>({children:Mo(v,f[1],m),level:f[2]==="="?1:2,type:"9"})},11:{match:Xr(vu),order:1,parse(f,v,m){const[,S]=f[3].match(bT),h=new RegExp(`^${S}`,"gm"),d=f[3].replace(h,""),g=(E=d,RT.some(T=>T.test(E))?MT:Mo);var E;const w=f[1].toLowerCase(),b=Lx.indexOf(w)!==-1,x={attrs:o(f[2]),noInnerParse:b,tag:(b?w:f[1]).trim()};return m.inAnchor=m.inAnchor||w==="a",b?x.text=f[3]:x.children=g(v,d,m),m.inAnchor=!1,x},render:(f,v,m)=>r(f.tag,Fn({key:m.key},f.attrs),f.text||v(f.children,m))},13:{match:Xr(_u),order:1,parse:f=>({attrs:o(f[2]||""),tag:f[1].trim()}),render:(f,v,m)=>r(f.tag,Fn({},f.attrs,{key:m.key}))},12:{match:Xr(lv),order:1,parse:()=>({}),render:qa},14:{match:rn(NT),order:1,parse:f=>({alt:f[1],target:Nh(f[2]),title:f[3]}),render:(f,v,m)=>r("img",{key:m.key,alt:f.alt||void 0,title:f.title||void 0,src:nr(f.target)})},15:{match:nn(OT),order:3,parse:(f,v,m)=>({children:FT(v,f[1],m),target:Nh(f[2]),title:f[3]}),render:(f,v,m)=>r("a",{key:m.key,href:nr(f.target),title:f.title},v(f.children,m))},16:{match:nn(iT),order:0,parse:f=>({children:[{text:f[1],type:"27"}],target:f[1],type:"15"})},17:{match:(f,v)=>v.inAnchor?null:nn(nT)(f,v),order:0,parse:f=>({children:[{text:f[1],type:"27"}],target:f[1],title:void 0,type:"15"})},18:{match:nn(rT),order:0,parse(f){let v=f[1],m=f[1];return Ux.test(m)||(m="mailto:"+m),{children:[{text:v.replace("mailto:",""),type:"27"}],target:m,type:"15"}}},20:Ch(r,1),33:Ch(r,2),19:{match:zt(Wx),order:3,parse:Wa,render:()=>`
|
|
96
96
|
`},21:{match:DT,order:3,parse:Va,render:(f,v,m)=>r("p",{key:m.key},v(f.children,m))},22:{match:nn(sT),order:0,parse:f=>(a[f[1]]={target:f[2],title:f[4]},{}),render:qa},23:{match:rn(aT),order:0,parse:f=>({alt:f[1]||void 0,ref:f[2]}),render:(f,v,m)=>a[f.ref]?r("img",{key:m.key,alt:f.alt,src:nr(a[f.ref].target),title:a[f.ref].title}):null},24:{match:nn(lT),order:0,parse:(f,v,m)=>({children:v(f[1],m),fallbackChildren:v(f[0].replace(uT,"\\$1"),m),ref:f[2]}),render:(f,v,m)=>a[f.ref]?r("a",{key:m.key,href:nr(a[f.ref].target),title:a[f.ref].title},v(f.children,m)):r("span",{key:m.key},v(f.fallbackChildren,m))},25:{match:zt(uv),order:1,parse:IT,render(f,v,m){const S=f;return r("table",{key:m.key},r("thead",null,r("tr",null,S.header.map(function(h,d){return r("th",{key:d,style:Oh(S,d)},v(h,m))}))),r("tbody",null,S.cells.map(function(h,d){return r("tr",{key:d},h.map(function(g,E){return r("td",{key:E,style:Oh(S,E)},v(g,m))}))})))}},27:{match:Xr(ST),order:4,parse:f=>({text:f[0].replace(Jx,(v,m)=>t.namedCodesToUnicode[m]?t.namedCodesToUnicode[m]:v)}),render:f=>f.text},28:{match:rn(gT),order:2,parse:(f,v,m)=>({children:v(f[2],m)}),render:(f,v,m)=>r("strong",{key:m.key},v(f.children,m))},29:{match:rn(yT),order:3,parse:(f,v,m)=>({children:v(f[2],m)}),render:(f,v,m)=>r("em",{key:m.key},v(f.children,m))},30:{match:rn(ET),order:1,parse:f=>({text:f[1],type:"27"})},31:{match:rn(vT),order:3,parse:Va,render:(f,v,m)=>r("mark",{key:m.key},v(f.children,m))},32:{match:rn(_T),order:3,parse:Va,render:(f,v,m)=>r("del",{key:m.key},v(f.children,m))}};t.disableParsingRawHTML===!0&&(delete l[11],delete l[13]);const u=function(f){let v=Object.keys(f);function m(S,h){let d=[],g="";for(;S;){let E=0;for(;E<v.length;){const w=v[E],b=f[w],x=b.match(S,h,g);if(x){const T=x[0];S=S.substring(T.length);const F=b.parse(x,m,h);F.type==null&&(F.type=w),d.push(F),g=T;break}E++}}return d}return v.sort(function(S,h){let d=f[S].order,g=f[h].order;return d!==g?d-g:S<h?-1:1}),function(S,h){return m(function(d){return d.replace(qx,`
|
|
97
97
|
`).replace(Kx,"").replace(fT," ")}(S),h)}}(l),c=(p=function(f,v){return function(m,S,h){const d=f[m.type].render;return v?v(()=>d(m,S,h),m,S,h):d(m,S,h)}}(l,t.renderRule),function f(v,m={}){if(Array.isArray(v)){const S=m.key,h=[];let d=!1;for(let g=0;g<v.length;g++){m.key=g;const E=f(v[g],m),w=typeof E=="string";w&&d?h[h.length-1]+=E:E!==null&&h.push(E),d=w}return m.key=S,h}return p(v,f,m)});var p;const y=i(e);return s.length?r("div",null,y,r("footer",{key:"footer"},s.map(function(f){return r("div",{id:t.slugify(f.identifier),key:f.identifier},f.identifier,c(u(f.footnote,{inline:!0})))}))):y}const _n=e=>{let{children:t="",options:n}=e,r=function(i,o){if(i==null)return{};var s,a,l={},u=Object.keys(i);for(a=0;a<u.length;a++)o.indexOf(s=u[a])>=0||(l[s]=i[s]);return l}(e,Bx);return R.cloneElement(LT(t,n),r)};var Sv={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Rh=_t.createContext&&_t.createContext(Sv),jT=["attr","size","title"];function UT(e,t){if(e==null)return{};var n=zT(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zT(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function vs(){return vs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vs.apply(this,arguments)}function Ah(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _s(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ah(Object(n),!0).forEach(function(r){$T(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ah(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $T(e,t,n){return t=HT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HT(e){var t=GT(e,"string");return typeof t=="symbol"?t:t+""}function GT(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wv(e){return e&&e.map((t,n)=>_t.createElement(t.tag,_s({key:n},t.attr),wv(t.child)))}function bv(e){return t=>_t.createElement(VT,vs({attr:_s({},e.attr)},t),wv(e.child))}function VT(e){var t=n=>{var{attr:r,size:i,title:o}=e,s=UT(e,jT),a=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),_t.createElement("svg",vs({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:_s(_s({color:e.color||n.color},n.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&_t.createElement("title",null,o),e.children)};return Rh!==void 0?_t.createElement(Rh.Consumer,null,n=>t(n)):t(Sv)}function WT(e){return bv({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"},child:[]}]})(e)}function qT(e){return bv({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z"},child:[]}]})(e)}const xt=()=>{const e=Ks();return n=>{const r=e.formatMessage({id:n});return r===n?void 0:r}},XT="_generalConditionsContainer_1ijeb_1",QT="_generalConditions_1ijeb_1",KT="_generalConditionsHeader_1ijeb_15",YT="_generalConditionsBody_1ijeb_25",ZT="_generalConditionsAccept_1ijeb_33",Qr={generalConditionsContainer:XT,generalConditions:QT,generalConditionsHeader:KT,generalConditionsBody:YT,generalConditionsAccept:ZT},JT="general-conditions.header",eC="general-conditions.body",Ph="general-conditions.accept-conditions-note",tC=()=>{const e=xt(),[t,n]=R.useState(!1),r=()=>n(!t),i=a=>{a.key==="ArrowDown"||a.key==="ArrowRight"?n(!0):a.key==="ArrowUp"||a.key==="ArrowLeft"||a.key==="Escape"?n(!1):(a.key==="Enter"||a.key==="Space"||a.key===" ")&&r()},o=e(JT),s=e(Ph);return _.jsxs("div",{className:k(Qr.generalConditionsContainer,"chat__generalConditions"),children:[!!(o!=null&&o.length)&&_.jsxs("div",{className:Qr.generalConditions,children:[_.jsxs("div",{role:"button",onClick:r,onKeyDown:i,tabIndex:0,className:k(Qr.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":t?"true":"false","aria-pressed":t?"true":"false",children:[_.jsx(_n,{children:o}),t?_.jsx(qT,{}):_.jsx(WT,{})]}),_.jsx("div",{className:k(Qr.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:t&&_.jsx(_n,{children:e(eC)||""})})]}),!!(s!=null&&s.length)&&_.jsx("div",{className:k(Qr.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:_.jsx(_n,{children:e(Ph)||""})})]})},nC="_message_1exlf_5",rC="_messageBot_1exlf_11",iC="_messageBotLast_1exlf_15",oC="_avatar_1exlf_15",sC="_messageBotFirst_1exlf_19",aC="_messageBotAnimated_1exlf_32",lC="_fadeInLeft_1exlf_1",uC="_messageGuest_1exlf_43",cC="_messageGuestFirst_1exlf_49",fC="_messageGuestLast_1exlf_55",dC="_botAvatar_1exlf_69",hC="_agentAvatar_1exlf_73",pC="_bubble_1exlf_77",mC="_bubbleContent_1exlf_83",gC="_bubbleLeft_1exlf_174",yC="_leftText_1exlf_183",vC="_bubbleRight_1exlf_190",_C="_rightText_1exlf_198",B={message:nC,messageBot:rC,messageBotLast:iC,avatar:oC,messageBotFirst:sC,messageBotAnimated:aC,fadeInLeft:lC,messageGuest:uC,messageGuestFirst:cC,messageGuestLast:fC,botAvatar:dC,agentAvatar:hC,bubble:pC,bubbleContent:mC,bubbleLeft:gC,leftText:yC,bubbleRight:vC,rightText:_C},EC="_problemReport_j3gru_1",SC="_problemReportIcon_j3gru_7",wC="_problemReportIconActive_j3gru_13",bC="_problemReportIconInactive_j3gru_21",Kr={problemReport:EC,problemReportIcon:SC,problemReportIconActive:wC,problemReportIconInactive:bC},xC=({reported:e,onReport:t})=>{const n=xt(),r=o=>()=>t(o),i=o=>s=>{s.key==="Enter"&&t(o)};return _.jsx("div",{className:Kr.problemReport,children:e?_.jsx("div",{role:"button",onClick:r(null),onKeyDown:i(null),tabIndex:0,className:k(Kr.problemReportIcon,"chat__problemReportIcon","chat_problemReportIcon",Kr.problemReportIconActive,"chat__problemReportIcon-active","chat_problemReportIcon-active"),children:_.jsx("img",{src:"problem-report-active.svg",title:n("problem-report.action.unmark"),alt:"Report"})}):_.jsx("div",{role:"button",onClick:r("unspecified"),onKeyDown:i("unspecified"),tabIndex:0,className:k(Kr.problemReportIcon,"chat_problemReportIcon",Kr.problemReportIconInactive,"chat_problemReportIcon-inactive"),children:_.jsx("img",{src:"problem-report-inactive.svg",title:n("problem-report.action.mark"),alt:"Report"})})})},xv=R.forwardRef(({message:e,problemReportingEnabled:t,isAnimated:n,isFirstMessageBySender:r,isLastMessageBySender:i,children:o,onProblemReport:s},a)=>{var c;const l=xt(),u=e.sender.type===z.UserType.BOT;return _.jsxs("li",{ref:a,className:k(B.message,B.messageBot,r&&B.messageBotFirst,i&&B.messageBotLast,"chat__bubbleContainer",n&&B.messageBotAnimated,n&&"chat__bubbleContainer--animated",u?"chat__botBubbleContainer":"chat__agentBubbleContainer",r&&"chat__bubbleContainer--first",i&&"chat__bubbleContainer--last"),children:[_.jsx("img",{className:k(B.avatar,u?B.botAvatar:B.agentAvatar,"chat__avatar",u?"chat__botAvatar":"chat__agentAvatar"),src:`${e.sender.avatar}`,alt:u?"Bot":"Agent",referrerPolicy:"no-referrer"}),_.jsx("div",{className:k(B.bubble,B.bubbleLeft,"chat__bubble",u?"chat__botBubble":"chat__agentBubble"),tabIndex:0,"aria-label":l(u?"bot-bubble.label":"agent-bubble.label"),children:_.jsx("div",{className:k(B.leftText),children:o})}),t&&s&&_.jsx(xC,{reported:!!((c=e.problemReport)!=null&&c.length),onReport:s})]})}),TC="_title_1mhh2_1",CC="_subtitle_1mhh2_6",kC="_buttons_1mhh2_11",OC="_button_1mhh2_11",NC="_imageContainer_1mhh2_33",RC="_image_1mhh2_33",AC="_video_container_1mhh2_44",PC="_video_1mhh2_44",IC="_only_1mhh2_54",Me={title:TC,subtitle:CC,buttons:kC,button:OC,imageContainer:NC,image:RC,video_container:AC,video:PC,only:IC},DC=({buttons:e,onButtonClick:t})=>_.jsx("div",{className:k(Me.buttons,"chat__bubbleButtons"),children:e.map((n,r)=>_.jsx("button",{className:k(Me.button,we.button,"chat__bubbleButton"),onClick:()=>t(n),children:n.title},r))});var Tv={},yf={},vf={};Object.defineProperty(vf,"__esModule",{value:!0});var FC=R,MC=BC(FC);function BC(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}vf.default=function(e,t,n){return MC.createElement("a",{href:e,key:n},t)};var _f={};Object.defineProperty(_f,"__esModule",{value:!0});_f.default=function(e){return e};var Ef={},Qa,Ih;function LC(){return Ih||(Ih=1,Qa=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),Qa}var Ka,Dh;function jC(){return Dh||(Dh=1,Ka=/[\0-\x1F\x7F-\x9F]/),Ka}var Ya,Fh;function UC(){return Fh||(Fh=1,Ya=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),Ya}var Za,Mh;function zC(){return Mh||(Mh=1,Za=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/),Za}var Ja,Bh;function $C(){return Bh||(Bh=1,Ja=function(e){var t={};t.src_Any=LC().source,t.src_Cc=jC().source,t.src_Z=UC().source,t.src_P=zC().source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");var n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-]).|\\.{2,4}[a-zA-Z0-9%/]|\\.(?!"+t.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+t.src_ZCc+").|\\!(?!"+t.src_ZCc+"|[!]).|\\?(?!"+t.src_ZCc+"|[?]).)+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}),Ja}function Eu(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(n){n&&Object.keys(n).forEach(function(r){e[r]=n[r]})}),e}function oa(e){return Object.prototype.toString.call(e)}function HC(e){return oa(e)==="[object String]"}function GC(e){return oa(e)==="[object Object]"}function VC(e){return oa(e)==="[object RegExp]"}function Lh(e){return oa(e)==="[object Function]"}function WC(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var Cv={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function qC(e){return Object.keys(e||{}).reduce(function(t,n){return t||Cv.hasOwnProperty(n)},!1)}var XC={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},QC="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",KC="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function YC(e){e.__index__=-1,e.__text_cache__=""}function ZC(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function jh(){return function(e,t){t.normalize(e)}}function Es(e){var t=e.re=$C()(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(QC),n.push(t.src_xn),t.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");var i=[];e.__compiled__={};function o(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(e.__schemas__).forEach(function(a){var l=e.__schemas__[a];if(l!==null){var u={validate:null,link:null};if(e.__compiled__[a]=u,GC(l)){VC(l.validate)?u.validate=ZC(l.validate):Lh(l.validate)?u.validate=l.validate:o(a,l),Lh(l.normalize)?u.normalize=l.normalize:l.normalize?o(a,l):u.normalize=jh();return}if(HC(l)){i.push(a);return}o(a,l)}}),i.forEach(function(a){e.__compiled__[e.__schemas__[a]]&&(e.__compiled__[a].validate=e.__compiled__[e.__schemas__[a]].validate,e.__compiled__[a].normalize=e.__compiled__[e.__schemas__[a]].normalize)}),e.__compiled__[""]={validate:null,normalize:jh()};var s=Object.keys(e.__compiled__).filter(function(a){return a.length>0&&e.__compiled__[a]}).map(WC).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),YC(e)}function JC(e,t){var n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function Uh(e,t){var n=new JC(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function st(e,t){if(!(this instanceof st))return new st(e,t);t||qC(e)&&(t=e,e={}),this.__opts__=Eu({},Cv,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Eu({},XC,e),this.__compiled__={},this.__tlds__=KC,this.__tlds_replaced__=!1,this.re={},Es(this)}st.prototype.add=function(t,n){return this.__schemas__[t]=n,Es(this),this};st.prototype.set=function(t){return this.__opts__=Eu(this.__opts__,t),this};st.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;var n,r,i,o,s,a,l,u,c;if(this.re.schema_test.test(t)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(t))!==null;)if(o=this.testSchemaAt(t,n[2],l.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=t.search(this.re.host_fuzzy_test),u>=0&&(this.__index__<0||u<this.__index__)&&(r=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(s=r.index+r[1].length,(this.__index__<0||s<this.__index__)&&(this.__schema__="",this.__index__=s,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=t.indexOf("@"),c>=0&&(i=t.match(this.re.email_fuzzy))!==null&&(s=i.index+i[1].length,a=i.index+i[0].length,(this.__index__<0||s<this.__index__||s===this.__index__&&a>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=a))),this.__index__>=0};st.prototype.pretest=function(t){return this.re.pretest.test(t)};st.prototype.testSchemaAt=function(t,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,r,this):0};st.prototype.match=function(t){var n=0,r=[];this.__index__>=0&&this.__text_cache__===t&&(r.push(Uh(this,n)),n=this.__last_index__);for(var i=n?t.slice(n):t;this.test(i);)r.push(Uh(this,n)),i=i.slice(this.__last_index__),n+=this.__last_index__;return r.length?r:null};st.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),Es(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Es(this),this)};st.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};st.prototype.onCompile=function(){};var e2=st;const t2=["aaa","aarp","abb","abbott","abbvie","abc","able","abogado","abudhabi","ac","academy","accenture","accountant","accountants","aco","actor","ad","ads","adult","ae","aeg","aero","aetna","af","afl","africa","ag","agakhan","agency","ai","aig","airbus","airforce","airtel","akdn","al","alibaba","alipay","allfinanz","allstate","ally","alsace","alstom","am","amazon","americanexpress","americanfamily","amex","amfam","amica","amsterdam","analytics","android","anquan","anz","ao","aol","apartments","app","apple","aq","aquarelle","ar","arab","aramco","archi","army","arpa","art","arte","as","asda","asia","associates","at","athleta","attorney","au","auction","audi","audible","audio","auspost","author","auto","autos","avianca","aw","aws","ax","axa","az","azure","ba","baby","baidu","banamex","bananarepublic","band","bank","bar","barcelona","barclaycard","barclays","barefoot","bargains","baseball","basketball","bauhaus","bayern","bb","bbc","bbt","bbva","bcg","bcn","bd","be","beats","beauty","beer","bentley","berlin","best","bestbuy","bet","bf","bg","bh","bharti","bi","bible","bid","bike","bing","bingo","bio","biz","bj","black","blackfriday","blockbuster","blog","bloomberg","blue","bm","bms","bmw","bn","bnpparibas","bo","boats","boehringer","bofa","bom","bond","boo","book","booking","bosch","bostik","boston","bot","boutique","box","br","bradesco","bridgestone","broadway","broker","brother","brussels","bs","bt","build","builders","business","buy","buzz","bv","bw","by","bz","bzh","ca","cab","cafe","cal","call","calvinklein","cam","camera","camp","canon","capetown","capital","capitalone","car","caravan","cards","care","career","careers","cars","casa","case","cash","casino","cat","catering","catholic","cba","cbn","cbre","cbs","cc","cd","center","ceo","cern","cf","cfa","cfd","cg","ch","chanel","channel","charity","chase","chat","cheap","chintai","christmas","chrome","church","ci","cipriani","circle","cisco","citadel","citi","citic","city","cityeats","ck","cl","claims","cleaning","click","clinic","clinique","clothing","cloud","club","clubmed","cm","cn","co","coach","codes","coffee","college","cologne","com","comcast","commbank","community","company","compare","computer","comsec","condos","construction","consulting","contact","contractors","cooking","cool","coop","corsica","country","coupon","coupons","courses","cpa","cr","credit","creditcard","creditunion","cricket","crown","crs","cruise","cruises","cu","cuisinella","cv","cw","cx","cy","cymru","cyou","cz","dabur","dad","dance","data","date","dating","datsun","day","dclk","dds","de","deal","dealer","deals","degree","delivery","dell","deloitte","delta","democrat","dental","dentist","desi","design","dev","dhl","diamonds","diet","digital","direct","directory","discount","discover","dish","diy","dj","dk","dm","dnp","do","docs","doctor","dog","domains","dot","download","drive","dtv","dubai","dunlop","dupont","durban","dvag","dvr","dz","earth","eat","ec","eco","edeka","edu","education","ee","eg","email","emerck","energy","engineer","engineering","enterprises","epson","equipment","er","ericsson","erni","es","esq","estate","et","etisalat","eu","eurovision","eus","events","exchange","expert","exposed","express","extraspace","fage","fail","fairwinds","faith","family","fan","fans","farm","farmers","fashion","fast","fedex","feedback","ferrari","ferrero","fi","fidelity","fido","film","final","finance","financial","fire","firestone","firmdale","fish","fishing","fit","fitness","fj","fk","flickr","flights","flir","florist","flowers","fly","fm","fo","foo","food","football","ford","forex","forsale","forum","foundation","fox","fr","free","fresenius","frl","frogans","frontdoor","frontier","ftr","fujitsu","fun","fund","furniture","futbol","fyi","ga","gal","gallery","gallo","gallup","game","games","gap","garden","gay","gb","gbiz","gd","gdn","ge","gea","gent","genting","george","gf","gg","ggee","gh","gi","gift","gifts","gives","giving","gl","glass","gle","global","globo","gm","gmail","gmbh","gmo","gmx","gn","godaddy","gold","goldpoint","golf","goo","goodyear","goog","google","gop","got","gov","gp","gq","gr","grainger","graphics","gratis","green","gripe","grocery","group","gs","gt","gu","guardian","gucci","guge","guide","guitars","guru","gw","gy","hair","hamburg","hangout","haus","hbo","hdfc","hdfcbank","health","healthcare","help","helsinki","here","hermes","hiphop","hisamitsu","hitachi","hiv","hk","hkt","hm","hn","hockey","holdings","holiday","homedepot","homegoods","homes","homesense","honda","horse","hospital","host","hosting","hot","hotels","hotmail","house","how","hr","hsbc","ht","hu","hughes","hyatt","hyundai","ibm","icbc","ice","icu","id","ie","ieee","ifm","ikano","il","im","imamat","imdb","immo","immobilien","in","inc","industries","infiniti","info","ing","ink","institute","insurance","insure","int","international","intuit","investments","io","ipiranga","iq","ir","irish","is","ismaili","ist","istanbul","it","itau","itv","jaguar","java","jcb","je","jeep","jetzt","jewelry","jio","jll","jm","jmp","jnj","jo","jobs","joburg","jot","joy","jp","jpmorgan","jprs","juegos","juniper","kaufen","kddi","ke","kerryhotels","kerrylogistics","kerryproperties","kfh","kg","kh","ki","kia","kids","kim","kinder","kindle","kitchen","kiwi","km","kn","koeln","komatsu","kosher","kp","kpmg","kpn","kr","krd","kred","kuokgroup","kw","ky","kyoto","kz","la","lacaixa","lamborghini","lamer","lancaster","land","landrover","lanxess","lasalle","lat","latino","latrobe","law","lawyer","lb","lc","lds","lease","leclerc","lefrak","legal","lego","lexus","lgbt","li","lidl","life","lifeinsurance","lifestyle","lighting","like","lilly","limited","limo","lincoln","link","lipsy","live","living","lk","llc","llp","loan","loans","locker","locus","lol","london","lotte","lotto","love","lpl","lplfinancial","lr","ls","lt","ltd","ltda","lu","lundbeck","luxe","luxury","lv","ly","ma","madrid","maif","maison","makeup","man","management","mango","map","market","marketing","markets","marriott","marshalls","mattel","mba","mc","mckinsey","md","me","med","media","meet","melbourne","meme","memorial","men","menu","merckmsd","mg","mh","miami","microsoft","mil","mini","mint","mit","mitsubishi","mk","ml","mlb","mls","mm","mma","mn","mo","mobi","mobile","moda","moe","moi","mom","monash","money","monster","mormon","mortgage","moscow","moto","motorcycles","mov","movie","mp","mq","mr","ms","msd","mt","mtn","mtr","mu","museum","music","mv","mw","mx","my","mz","na","nab","nagoya","name","natura","navy","nba","nc","ne","nec","net","netbank","netflix","network","neustar","new","news","next","nextdirect","nexus","nf","nfl","ng","ngo","nhk","ni","nico","nike","nikon","ninja","nissan","nissay","nl","no","nokia","norton","now","nowruz","nowtv","np","nr","nra","nrw","ntt","nu","nyc","nz","obi","observer","office","okinawa","olayan","olayangroup","oldnavy","ollo","om","omega","one","ong","onl","online","ooo","open","oracle","orange","org","organic","origins","osaka","otsuka","ott","ovh","pa","page","panasonic","paris","pars","partners","parts","party","pay","pccw","pe","pet","pf","pfizer","pg","ph","pharmacy","phd","philips","phone","photo","photography","photos","physio","pics","pictet","pictures","pid","pin","ping","pink","pioneer","pizza","pk","pl","place","play","playstation","plumbing","plus","pm","pn","pnc","pohl","poker","politie","porn","post","pr","pramerica","praxi","press","prime","pro","prod","productions","prof","progressive","promo","properties","property","protection","pru","prudential","ps","pt","pub","pw","pwc","py","qa","qpon","quebec","quest","racing","radio","re","read","realestate","realtor","realty","recipes","red","redstone","redumbrella","rehab","reise","reisen","reit","reliance","ren","rent","rentals","repair","report","republican","rest","restaurant","review","reviews","rexroth","rich","richardli","ricoh","ril","rio","rip","ro","rocher","rocks","rodeo","rogers","room","rs","rsvp","ru","rugby","ruhr","run","rw","rwe","ryukyu","sa","saarland","safe","safety","sakura","sale","salon","samsclub","samsung","sandvik","sandvikcoromant","sanofi","sap","sarl","sas","save","saxo","sb","sbi","sbs","sc","sca","scb","schaeffler","schmidt","scholarships","school","schule","schwarz","science","scot","sd","se","search","seat","secure","security","seek","select","sener","services","seven","sew","sex","sexy","sfr","sg","sh","shangrila","sharp","shaw","shell","shia","shiksha","shoes","shop","shopping","shouji","show","showtime","si","silk","sina","singles","site","sj","sk","ski","skin","sky","skype","sl","sling","sm","smart","smile","sn","sncf","so","soccer","social","softbank","software","sohu","solar","solutions","song","sony","soy","spa","space","sport","spot","sr","srl","ss","st","stada","staples","star","statebank","statefarm","stc","stcgroup","stockholm","storage","store","stream","studio","study","style","su","sucks","supplies","supply","support","surf","surgery","suzuki","sv","swatch","swiss","sx","sy","sydney","systems","sz","tab","taipei","talk","taobao","target","tatamotors","tatar","tattoo","tax","taxi","tc","tci","td","tdk","team","tech","technology","tel","temasek","tennis","teva","tf","tg","th","thd","theater","theatre","tiaa","tickets","tienda","tips","tires","tirol","tj","tjmaxx","tjx","tk","tkmaxx","tl","tm","tmall","tn","to","today","tokyo","tools","top","toray","toshiba","total","tours","town","toyota","toys","tr","trade","trading","training","travel","travelers","travelersinsurance","trust","trv","tt","tube","tui","tunes","tushu","tv","tvs","tw","tz","ua","ubank","ubs","ug","uk","unicom","university","uno","uol","ups","us","uy","uz","va","vacations","vana","vanguard","vc","ve","vegas","ventures","verisign","vermögensberater","vermögensberatung","versicherung","vet","vg","vi","viajes","video","vig","viking","villas","vin","vip","virgin","visa","vision","viva","vivo","vlaanderen","vn","vodka","volkswagen","volvo","vote","voting","voto","voyage","vu","wales","walmart","walter","wang","wanggou","watch","watches","weather","weatherchannel","webcam","weber","website","wed","wedding","weibo","weir","wf","whoswho","wien","wiki","williamhill","win","windows","wine","winners","wme","wolterskluwer","woodside","work","works","world","wow","ws","wtc","wtf","xbox","xerox","xfinity","xihuan","xin","xxx","xyz","yachts","yahoo","yamaxun","yandex","ye","yodobashi","yoga","yokohama","you","youtube","yt","yun","za","zappos","zara","zero","zip","zm","zone","zuerich","zw","ελ","ευ","бг","бел","дети","ею","католик","ком","мкд","мон","москва","онлайн","орг","рус","рф","сайт","срб","укр","қаз","հայ","ישראל","קום","ابوظبي","اتصالات","ارامكو","الاردن","البحرين","الجزائر","السعودية","العليان","المغرب","امارات","ایران","بارت","بازار","بيتك","بھارت","تونس","سودان","سورية","شبكة","عراق","عرب","عمان","فلسطين","قطر","كاثوليك","كوم","مصر","مليسيا","موريتانيا","موقع","همراه","پاکستان","ڀارت","कॉम","नेट","भारत","भारतम्","भारोत","संगठन","বাংলা","ভারত","ভাৰত","ਭਾਰਤ","ભારત","ଭାରତ","இந்தியா","இலங்கை","சிங்கப்பூர்","భారత్","ಭಾರತ","ഭാരതം","ලංකා","คอม","ไทย","ລາວ","გე","みんな","アマゾン","クラウド","グーグル","コム","ストア","セール","ファッション","ポイント","世界","中信","中国","中國","中文网","亚马逊","企业","佛山","信息","健康","八卦","公司","公益","台湾","台灣","商城","商店","商标","嘉里","嘉里大酒店","在线","大拿","天主教","娱乐","家電","广东","微博","慈善","我爱你","手机","招聘","政务","政府","新加坡","新闻","时尚","書籍","机构","淡马锡","游戏","澳門","点看","移动","组织机构","网址","网店","网站","网络","联通","谷歌","购物","通販","集团","電訊盈科","飞利浦","食品","餐厅","香格里拉","香港","닷넷","닷컴","삼성","한국"];Object.defineProperty(Ef,"__esModule",{value:!0});var n2=e2,r2=kv(n2),i2=t2,o2=kv(i2);function kv(e){return e&&e.__esModule?e:{default:e}}var Ov=new r2.default;Ov.tlds(o2.default);Ef.default=function(e){return Ov.match(e)};var Sf={};Object.defineProperty(Sf,"__esModule",{value:!0});Sf.default=function(e){return e};Object.defineProperty(yf,"__esModule",{value:!0});var s2=function(){function e(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a2=R,Yr=g2(a2),l2=vf,u2=sa(l2),c2=_f,f2=sa(c2),d2=Ef,h2=sa(d2),p2=Sf,m2=sa(p2);function sa(e){return e&&e.__esModule?e:{default:e}}function g2(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function y2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v2(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function _2(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Nv=function(e){_2(t,e);function t(){return y2(this,t),v2(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s2(t,[{key:"parseString",value:function(r){var i=this;if(r==="")return r;var o=this.props.matchDecorator(r);if(!o)return r;var s=[],a=0;return o.forEach(function(l,u){l.index>a&&s.push(r.substring(a,l.index));var c=i.props.hrefDecorator(l.url),p=i.props.textDecorator(l.text),y=i.props.componentDecorator(c,p,u);s.push(y),a=l.lastIndex}),r.length>a&&s.push(r.substring(a)),s.length===1?s[0]:s}},{key:"parse",value:function(r){var i=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof r=="string"?this.parseString(r):Yr.isValidElement(r)&&r.type!=="a"&&r.type!=="button"?Yr.cloneElement(r,{key:o},this.parse(r.props.children)):Array.isArray(r)?r.map(function(s,a){return i.parse(s,a)}):r}},{key:"render",value:function(){return Yr.createElement(Yr.Fragment,null,this.parse(this.props.children))}}]),t}(Yr.Component);Nv.defaultProps={componentDecorator:u2.default,hrefDecorator:f2.default,matchDecorator:h2.default,textDecorator:m2.default};yf.default=Nv;Object.defineProperty(Tv,"__esModule",{value:!0});var E2=yf,S2=w2(E2);function w2(e){return e&&e.__esModule?e:{default:e}}var b2=Tv.default=S2.default;const x2="_text_1k7aq_1",T2={text:x2},Rv=({text:e,onLinkClick:t})=>{const n=i=>o=>(o.preventDefault(),i&&t(i),!1),r=(i,o,s)=>_.jsx("a",{onClick:n(i),role:"button",children:o},s);return _.jsx("div",{children:e.split(`
|
|
98
|
-
`).map((i,o)=>_.jsxs("span",{className:T2.text,children:[_.jsx(b2,{componentDecorator:r,children:i}),_.jsx("br",{})]},o))})},C2=({subtitle:e,onLinkClick:t})=>e?_.jsx("div",{className:Me.subtitle,children:_.jsx(Rv,{text:e,onLinkClick:t})}):null,zh="newtab#",Av=({markdown:e,onLinkClick:t})=>{const n=i=>o=>(o.preventDefault(),i&&t(i),!1),r=({title:i,href:o,children:s})=>o.indexOf(zh)===0?_.jsx("a",{href:o.slice(zh.length),title:i,target:"_blank",rel:"noopener noreferrer",children:s}):_.jsx("a",{onClick:n(o),title:i,children:s});return _.jsx(_n,{options:{overrides:{a:r}},children:e})},k2=({text:e,onLinkClick:t})=>e?_.jsx("div",{children:_.jsx(Av,{markdown:e,onLinkClick:t})}):null,O2=({title:e})=>e?_.jsx("h1",{className:Me.title,children:e}):null,N2=({title:e,text:t,subtitle:n,buttons:r,onButtonClick:i,onLinkClick:o})=>(e==null?void 0:e.length)||(t==null?void 0:t.length)||(n==null?void 0:n.length)||(r==null?void 0:r.length)?_.jsxs("div",{className:k(B.bubbleContent),children:[_.jsx(O2,{title:e}),_.jsx(k2,{text:t,onLinkClick:o}),_.jsx(C2,{subtitle:n,onLinkClick:o}),_.jsx(DC,{buttons:r,onButtonClick:i})]}):null,R2=({alt:e,imageUrl:t,itemUrl:n,hasBody:r})=>t?n?n.indexOf("youtube.com")>-1?_.jsx("div",{className:Me.video_container,children:_.jsx("iframe",{className:k(Me.video,{[Me.only]:!r}),title:"Youtube",width:"100%",src:n+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):_.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:_.jsx("div",{className:Me.imageContainer,children:_.jsx("img",{className:k(Me.image,{[Me.only]:!r}),src:t,alt:e})})}):_.jsx("div",{className:Me.imageContainer,children:_.jsx("img",{className:k(Me.image,{[Me.only]:!r}),src:t,alt:e})}):null,A2=({title:e,text:t,subtitle:n,imageUrl:r,itemUrl:i,buttons:o,onButtonClick:s,onLinkClick:a})=>{const l=!!(e!=null&&e.length)||!!(t!=null&&t.length)||!!(n!=null&&n.length)||!!(o!=null&&o.length);return _.jsxs("div",{className:k(Me.detailMessage),children:[_.jsx(R2,{hasBody:l,imageUrl:r,itemUrl:i,alt:e||n}),l&&_.jsx(N2,{title:e,text:t,subtitle:n,buttons:o,onLinkClick:a,onButtonClick:s})]})},P2=R.forwardRef(({isFirstMessageBySender:e,isLastMessageBySender:t,children:n},r)=>{const i=xt();return _.jsx("li",{ref:r,className:k(B.message,B.messageGuest,e&&B.messageGuestFirst,t&&B.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",e&&"chat__bubbleContainer--first",t&&"chat__bubbleContainer--last"),children:_.jsx("div",{className:k(B.bubble,B.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":i("guest-bubble.label"),children:_.jsx("div",{className:k(B.rightText),children:n})})})}),I2=({markdown:e,className:t,onLinkClick:n})=>_.jsx("div",{className:k(B.bubbleContent,t),children:_.jsx(Av,{markdown:e,onLinkClick:n})}),D2=({text:e,onLinkClick:t})=>_.jsx("div",{className:B.bubbleContent,children:_.jsx(Rv,{text:e,onLinkClick:t})}),F2=R.forwardRef(({message:e,problemReportingEnabled:t,isFirstMessageBySender:n,isLastMessageBySender:r,onProblemReport:i,onButtonClick:o,onLinkClick:s},a)=>{const l=M2(e,o,s);switch(e.sender.type){case z.UserType.GUEST:return _.jsx(P2,{ref:a,isFirstMessageBySender:n,isLastMessageBySender:r,children:l});default:const u=c=>i(e._id,c);return _.jsx(xv,{ref:a,message:e,problemReportingEnabled:t,isAnimated:!1,isFirstMessageBySender:n,isLastMessageBySender:r,onProblemReport:u,children:l})}}),M2=(e,t,n)=>{switch(e.type){case z.MessageTypeEnum.TEXT:const r=e;return _.jsx(D2,{text:r.text,onLinkClick:n});case z.MessageTypeEnum.DETAIL:const i=e;return _.jsx(A2,{title:i.title,text:i.text,subtitle:i.subtitle,imageUrl:i.imageUrl,itemUrl:i.itemUrl,buttons:i.buttons,onButtonClick:t,onLinkClick:n});case z.MessageTypeEnum.MARKDOWN:const o=e;return _.jsx(I2,{markdown:o.markdown,className:o.className,onLinkClick:n})}},B2=(e,t)=>e.message._id===t.message._id&&e.message.problemReport===t.message.problemReport&&e.problemReportingEnabled===t.problemReportingEnabled&&e.isFirstMessageBySender===t.isFirstMessageBySender&&e.isLastMessageBySender===t.isLastMessageBySender,L2=_t.memo(F2,B2),j2="_ticontainer_wftg7_1",U2="_tiblock_wftg7_5",z2="_tidot_wftg7_12",$2="_mercuryTypingAnimation_wftg7_1",Zr={ticontainer:j2,tiblock:U2,tidot:z2,mercuryTypingAnimation:$2},H2=({isTyping:e=!1})=>_.jsx("div",{className:Zr.ticontainer,children:_.jsx("div",{className:Zr.tiblock,children:e?_.jsxs(_.Fragment,{children:[_.jsx("div",{className:k(Zr.tidot,"chat__typingIndicator")}),_.jsx("div",{className:k(Zr.tidot,"chat__typingIndicator")}),_.jsx("div",{className:k(Zr.tidot,"chat__typingIndicator")})]}):null})}),G2=Object.assign({_id:"typing-indicator"},new z.TextMessage("",new z.BotUser)),V2=({messages:e,isBotTyping:t,showGeneralConditions:n,problemReportingEnabled:r,onProblemReport:i,onButtonClick:o,onLinkClick:s})=>{const a=R.useRef(!0),l=R.useRef(null),u=R.useRef(null),c=R.useRef(null);R.useLayoutEffect(()=>{if(e.length&&l.current){if(u.current){const f=u.current.offsetTop;l.current.scrollTop=f}else if(c.current){const f=c.current.offsetTop;l.current.scrollTop=f}a.current&&(a.current=!1)}},[e,u.current,c.current,a]);let p;const y=e.length;return _.jsxs("div",{ref:l,className:k(Eh.messageContainer,"chat__messageContainer"),style:{scrollBehavior:e.length&&a.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[n&&_.jsx(tC,{}),_.jsxs("ul",{className:Eh.messages,children:[e.map((f,v)=>{const m=W2(f,p),S=q2(f,v,e,t);p=f.sender.type;const h=v+1===y;return _.jsx(L2,{ref:h?c:null,message:f,problemReportingEnabled:r,isFirstMessageBySender:m,isLastMessageBySender:S,onButtonClick:o,onLinkClick:s,onProblemReport:i},h&&!t?"last":f._id)}),t&&_.jsx(xv,{ref:u,message:G2,problemReportingEnabled:!1,isAnimated:!0,isFirstMessageBySender:p!==z.UserType.BOT,isLastMessageBySender:!0,children:_.jsx(H2,{isTyping:!0})},"last")]})]})},W2=(e,t)=>!t||t!==e.sender.type,q2=(e,t,n,r)=>{var a;const i=e.sender.type,o=n.length;return t+1===o?!(i===z.UserType.BOT&&r):i!==((a=n.at(t+1))==null?void 0:a.sender.type)},X2="_container_t5oqt_1",Q2={container:X2},K2=({title:e,href:t,children:n})=>_.jsx("a",{href:t,title:e,target:"_blank",rel:"noopener noreferrer",children:n}),Y2=()=>{const t=xt()("powered-by");return t&&t.length?_.jsx("div",{className:k(Q2.container,"chat__poweredBy"),children:_.jsx(_n,{options:{overrides:{a:K2}},children:t})}):null},Z2="_container_fgqz2_1",J2="_containerOpen_fgqz2_48",ek="_containerClose_fgqz2_52",tk="_formContainer_fgqz2_56",nk="_emailInput_fgqz2_61",rk="_description_fgqz2_90",ik="_actions_fgqz2_95",ok="_validationError_fgqz2_105",sk="_submitted_fgqz2_112",dt={container:Z2,containerOpen:J2,"slide-in":"_slide-in_fgqz2_1",containerClose:ek,"slide-out":"_slide-out_fgqz2_1",formContainer:tk,emailInput:nk,description:rk,actions:ik,validationError:ok,submitted:sk},ak=({visible:e,methods:t,onEmailExport:n,onPdfExport:r,onClose:i})=>{const o=xt(),[s,a]=R.useState(void 0),[l,u]=R.useState(!1),[c,p]=R.useState(!1),[y,f]=R.useState(void 0),v=R.useRef(null);R.useEffect(()=>{var d;e?((d=v.current)==null||d.focus(),u(!1),p(!1),a(e)):s===!0&&a(!1)},[e,s]);const m=d=>{d.preventDefault(),y&&y.length>0&&(n(y),u(!0),setTimeout(i,3*1e3))},S=d=>{const g=d.target.value.trim(),E=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(g);f(E?g:"")},h=()=>{p(!0),r(),setTimeout(i,3*1e3)};return _.jsxs("div",{className:k(dt.container,{[dt.containerOpen]:s===!0,[dt.containerClose]:s===!1}),children:[t.pdf&&_.jsxs(_.Fragment,{children:[_.jsx("h2",{children:o("export-transcript.pdf.title")}),_.jsx(_n,{className:dt.description,children:o("export-transcript.pdf.description")||""}),_.jsxs("div",{className:dt.actions,children:[_.jsx("button",{type:"button",className:k(we.button,we.buttonDefault),onClick:i,children:o("export-transcript.pdf.cancel")}),_.jsx("button",{className:k(we.button,we.buttonPrimary),onClick:h,disabled:c,children:o("export-transcript.pdf.download")})]})]}),t.email&&_.jsxs(_.Fragment,{children:[_.jsx("h2",{children:o("export-transcript.email.title")}),_.jsx(_n,{className:dt.description,children:o("export-transcript.email.description")||""}),_.jsxs("form",{onSubmit:m,className:dt.formContainer,children:[_.jsxs("div",{children:[_.jsx("input",{disabled:l,ref:v,type:"email",placeholder:o("export-transcript.email.placeholder"),className:dt.emailInput,onChange:S}),(y==null?void 0:y.length)===0?_.jsx("div",{className:dt.validationError,children:o("export-transcript.email.invalid")}):null]}),_.jsxs("div",{className:dt.actions,children:[_.jsx("button",{type:"button",className:k(we.button,we.buttonDefault),onClick:i,children:o("export-transcript.email.cancel")}),_.jsx("button",{type:"submit",disabled:l||y===void 0||y.length===0,className:k(we.button,we.buttonPrimary),children:o("export-transcript.email.send")})]})]}),l&&_.jsx("div",{className:dt.submitted,children:o("export-transcript.email.success")})]})]})},lk="_inputContainer_1px77_1",uk={inputContainer:lk},ck="_blockUserInput_rv0dg_1",fk={blockUserInput:ck,"append-animate":"_append-animate_rv0dg_1"},dk=({visible:e})=>{const t=xt();return e?_.jsx("div",{className:k(fk.blockUserInput,"chat__blockUserInput"),children:t("block-user-input.title")}):null},hk="_callToActionContainer_1t611_1",pk="_callToActionTitle_1t611_24",mk="_rateOverlay_1t611_31",gk="_body_1t611_61",yk="_rateOverlayOpen_1t611_92",vk="_rateOverlayClose_1t611_96",_k="_footer_1t611_100",Ek="_actions_1t611_115",Sk="_bubbles_1t611_127",wk="_rateFeedbackBotBubble_1t611_154",bk="_rateFeedbackGuestBubble_1t611_160",xk="_avatar_1t611_166",Tk="_fadeInLeft_1t611_1",Ck="_bubble_1t611_127",kk="_appear_1t611_1",Ok="_botBubble_1t611_192",Nk="_guestBubble_1t611_202",Rk="_rateText_1t611_218",Ak="_stars_1t611_223",Pk="_starsSmall_1t611_236",Ik="_starsLarge_1t611_240",Dk="_star_1t611_223",Fk="_starReadonly_1t611_257",Mk="_starIcon_1t611_265",Bk="_starsDescriptionContainer_1t611_283",Lk="_starsDescription_1t611_283",Se={callToActionContainer:hk,"append-animate":"_append-animate_1t611_1",callToActionTitle:pk,rateOverlay:mk,body:gk,rateOverlayOpen:yk,"slide-in":"_slide-in_1t611_1",rateOverlayClose:vk,"slide-out":"_slide-out_1t611_1",footer:_k,actions:Ek,bubbles:Sk,rateFeedbackBotBubble:wk,rateFeedbackGuestBubble:bk,avatar:xk,fadeInLeft:Tk,bubble:Ck,appear:kk,botBubble:Ok,guestBubble:Nk,rateText:Rk,stars:Ak,starsSmall:Pk,starsLarge:Ik,star:Dk,starReadonly:Fk,starIcon:Mk,starsDescriptionContainer:Bk,starsDescription:Lk},jk=({value:e,index:t,count:n,readonly:r,onHover:i,onClick:o})=>{const s=a=>{o&&a.key==="Enter"&&o()};return _.jsx("li",{className:k(Se.star,{[Se.starReadonly]:r},"chat__conversationRating__star"),children:_.jsx("div",{role:"radio","aria-checked":e>t?"true":"false","aria-posinset":t+1,"aria-setsize":n,tabIndex:0,onMouseOver:i,onKeyDown:s,onClick:o,children:_.jsx("span",{role:"img","aria-label":"Star",className:k(Se.starIcon),children:_.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:_.jsx("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"})})})})})},$h=5,Pv=({value:e,size:t,readonly:n=!1,onChange:r})=>{const[i,o]=R.useState(void 0),s=()=>{o(void 0)},a=u=>()=>{if(!n){const c=u+1;o(c)}},l=u=>()=>{r&&!n&&(r(u===0&&e===1?0:u+1),o(void 0))};return _.jsx("ul",{tabIndex:0,role:"radiogroup",className:k(Se.stars,{[Se.starsSmall]:t==="small",[Se.starsLarge]:t==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:t==="small",chat__conversationRating__stars__large:t==="large"}),onMouseOut:s,children:Array($h).fill(0).map((u,c)=>_.jsx(jk,{value:i===void 0?e:i,index:c,count:$h,readonly:n,onHover:a(c),onClick:l(c)},c))})},Uk=({visible:e,onRate:t})=>{const n=xt();return e?_.jsxs("div",{className:k(Se.callToActionContainer,"chat__conversationRating__callToAction"),children:[_.jsx("div",{className:k(Se.callToActionTitle,"chat__conversationRating__callToAction__title"),children:n("conversation-rating.call-to-action.title")}),_.jsx(Pv,{value:0,size:"small",onChange:t})]}):null},Hh=({isFirstMessageBySender:e,isLastMessageBySender:t,children:n})=>_.jsxs("div",{className:k(B.message,B.messageBot,e&&B.messageBotFirst,t&&B.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",e&&"chat__bubbleContainer--first",t&&"chat__bubbleContainer--last"),children:[_.jsx("img",{className:k(B.avatar,B.botAvatar),src:"bot.svg",alt:"Bot"}),_.jsx("div",{className:k(B.bubble,B.bubbleLeft,"chat__bubble","chat__botBubble"),children:_.jsx("div",{className:k(B.leftText,B.bubbleContent),children:n})})]}),zk=({children:e})=>_.jsx("div",{className:k(B.message,B.messageGuest,B.messageGuestFirst,B.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:_.jsx("div",{className:k(B.bubble,B.bubbleRight,"chat__bubble","chat__guestBubble"),children:_.jsx("div",{className:k(B.rightText,B.bubbleContent),children:e})})}),$k=({visible:e,rating:t,onRate:n,onClose:r})=>{const i=xt(),[o,s]=R.useState(t),[a,l]=R.useState(void 0),[u,c]=R.useState(void 0),[p,y]=R.useState({submitted:!1,feedback:""}),[f,v]=R.useState(!1),m=R.useRef(null);R.useEffect(()=>{e?(y({submitted:!1,feedback:""}),c(e)):u===!0&&c(!1)},[e,u]),R.useEffect(()=>{s(t)},[t]),R.useEffect(()=>{const h=i(`conversation-rating.overlay.bot-message.rate-feedback.value-${o}`);l(h!=null&&h.length?h:void 0)},[o,i]),R.useEffect(()=>{p.submitted?setTimeout(()=>v(!0),p.feedback.length?500:0):v(!1)},[p]);const S=h=>{var g,E;h.preventDefault();const d=((E=(g=m.current)==null?void 0:g.value)==null?void 0:E.trim())||"";n(o,d),y({submitted:!0,feedback:d})};return _.jsx("div",{className:k(Se.rateOverlay,"chat__conversationRating__overlay",{[Se.rateOverlayOpen]:u===!0,[Se.rateOverlayClose]:u===!1}),children:_.jsxs("form",{onSubmit:S,children:[_.jsxs("div",{className:k(Se.body,"chat__conversationRating__overlay__body"),children:[_.jsxs("div",{children:[_.jsx("h2",{children:i("conversation-rating.overlay.title")}),_.jsxs("div",{className:k(Se.starsDescriptionContainer),children:[_.jsx(Pv,{value:o,size:"large",readonly:p.submitted,onChange:s}),_.jsxs("div",{className:k(Se.starsDescription),children:[_.jsx("div",{children:i("conversation-rating.overlay.star.very-bad")}),_.jsx("div",{children:i("conversation-rating.overlay.star.very-good")})]})]})]}),_.jsx("div",{className:k(Se.bubbles),children:e&&a&&_.jsxs(_.Fragment,{children:[_.jsx(Hh,{isFirstMessageBySender:!0,isLastMessageBySender:!f||!!p.feedback.length,children:_.jsx("div",{children:a})}),!!p.feedback.length&&_.jsx(zk,{children:p.feedback}),f&&_.jsx(Hh,{isFirstMessageBySender:!!p.feedback.length,isLastMessageBySender:!0,children:_.jsx("div",{children:i("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),_.jsxs("div",{className:k(Se.footer,"chat__conversationRating__overlay__footer"),children:[!p.submitted&&_.jsx("input",{ref:m,placeholder:i("conversation-rating.overlay.guest-feedback.input-placeholder")}),_.jsx("div",{className:k(Se.actions,"chat__conversationRating__overlay__footer__actions"),children:p.submitted?_.jsx("button",{type:"button",className:k(we.button,we.buttonPrimary),onClick:r,children:i("conversation-rating.overlay.action.close")}):_.jsx("button",{type:"submit",className:k(we.button,we.buttonPrimary),children:i("conversation-rating.overlay.action.submit")})})]})]})})},Hk=({conversationRating:{enabled:e,rating:t},numberOfMessagesFromGuest:n,showRatingOverlay:r,setShowRatingOverlay:i,onRate:o})=>{const[s,a]=R.useState(0),l=p=>{a(p),i(!0)},u=()=>i(!1),c=!t&&n>=1;return e?_.jsxs(_.Fragment,{children:[_.jsx(Uk,{visible:c,onRate:l}),_.jsx($k,{visible:r,rating:s,onRate:o,onClose:u})]}):null},Gk="_inputWrapper_lbrof_5",Vk="_messageInputWrapper_lbrof_14",Wk="_messageInput_lbrof_14",qk="_buttons_lbrof_36",Xk="_button_lbrof_36",rr={inputWrapper:Gk,messageInputWrapper:Vk,messageInput:Wk,buttons:qk,button:Xk},Qk="_audioRecorder_xps9k_5",Kk="_recordButton_xps9k_10",Yk="_submitButton_xps9k_37",Zk="_cancelButton_xps9k_64",Jk="_recorderIcon_xps9k_91",eO="_pulse_xps9k_1",tO="_spinning_xps9k_113",nO="_spin_xps9k_113",An={audioRecorder:Qk,recordButton:Kk,submitButton:Yk,cancelButton:Zk,recorderIcon:Jk,pulse:eO,spinning:tO,spin:nO},Gh=2048,Ss=16e3;class rO extends _t.Component{constructor(n){super(n);V(this,"audioInput",null);V(this,"volume",null);V(this,"leftchannel",[]);V(this,"recorder",null);V(this,"recordingLength",0);V(this,"sampleRate",null);V(this,"mediaStream",null);this.state={recordingState:"none"},this.triggerAudioRecording=this.triggerAudioRecording.bind(this),this.triggerAudioRecordingSuccess=this.triggerAudioRecordingSuccess.bind(this),this.initRecording=this.initRecording.bind(this),this.processRecordingInput=this.processRecordingInput.bind(this),this.handleClickSubmitAudio=this.handleClickSubmitAudio.bind(this),this.handleClickStopAudio=this.handleClickStopAudio.bind(this)}triggerAudioRecording(){this.setState({recordingState:"connecting"}),navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(this.triggerAudioRecordingSuccess)}triggerAudioRecordingSuccess(n){this.mediaStream=n,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(n)}initRecording(n){var r=window.AudioContext||window.webkitAudioContext,i=new r;this.sampleRate=i.sampleRate,this.volume=i.createGain(),this.audioInput=i.createMediaStreamSource(n),this.audioInput.connect(this.volume),this.recorder=i.createScriptProcessor(Gh,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(i.destination)}processRecordingInput(n){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const r=n.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(r)),this.recordingLength+=Gh}}handleClickSubmitAudio(){const n=oO(this.leftchannel,this.recordingLength),r=sO(n,this.sampleRate||0),i=iO(r);this.props.onAudioRecorded(i),this.handleClickStopAudio()}handleClickStopAudio(){var n,r,i,o;this.setState({recordingState:"none"}),(n=this.audioInput)==null||n.disconnect(),(r=this.volume)==null||r.disconnect(),(i=this.recorder)==null||i.disconnect(),this.mediaStream&&((o=this.mediaStream)==null||o.getAudioTracks().forEach(s=>{s.stop()}))}render(){return _.jsxs("div",{className:An.audioRecorder,children:[this.state.recordingState==="none"&&_.jsx("button",{className:k(An.recordButton,"chat__button"),type:"submit","aria-label":this.props.translate("message-input.actions.start-audio-recording.label"),tabIndex:0,onClick:this.triggerAudioRecording,children:_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.jsx("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z"}),_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&_.jsxs("svg",{className:An.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&_.jsxs("div",{className:An.audioRecorder,children:[_.jsx("button",{className:k(An.cancelButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),_.jsx("div",{className:An.recorderIcon}),_.jsx("button",{className:k(An.submitButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),_.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const iO=e=>{const t=new ArrayBuffer(44+e.length*2),n=new DataView(t);yo(n,0,"RIFF"),n.setUint32(4,44+e.length*2,!0),yo(n,8,"WAVE"),yo(n,12,"fmt "),n.setUint32(16,16,!0),n.setUint16(20,1,!0),n.setUint16(22,1,!0),n.setUint32(24,Ss,!0),n.setUint32(28,Ss*4,!0),n.setUint16(32,4,!0),n.setUint16(34,16,!0),yo(n,36,"data"),n.setUint32(40,e.length*2,!0);const r=e.length;let i=44;const o=1;for(var s=0;s<r;s++)n.setInt16(i,e[s]*(32767*o),!0),i+=2;return new Blob([n],{type:"audio/wav"})},yo=(e,t,n)=>{for(var r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))},oO=(e,t)=>{const n=new Float32Array(t);let r=0;const i=e.length;for(var o=0;o<i;o++){const s=e[o];n.set(s,r),r+=s.length}return n},sO=(e,t)=>{if(Ss===t)return e;const n=t/Ss,r=Math.round(e.length/n),i=new Float32Array(r);let o=0,s=0;for(;o<i.length;){let l=Math.round((o+1)*n),u=0,c=0;for(var a=s;a<l&&a<e.length;a++)u+=e[a],c++;i[o]=u/c,o++,s=l}return i},aO=({speechSupport:e,transcriptExportEnabled:t,disabled:n,onTextInput:r,onAudioRecorded:i,onOpenTranscriptExportModal:o})=>{const s=xt(),[a,l]=R.useState(!1),u=R.useRef(null),c=()=>{const v=u.current;v&&v.value.trim().length>=1&&r(v.value.trim())&&(v.value="",v.style.height="",l(!1),v.focus())},p=v=>{v.preventDefault(),c()},y=v=>{const m=v.target.value.trim();l(m.length>0),v.target.style.height="";const{scrollHeight:S}=v.target;v.target.style.height=`${S>150?150:S}px`},f=v=>{v.code==="Enter"&&!v.shiftKey&&(v.repeat||c(),v.preventDefault())};return _.jsxs("form",{className:k(rr.inputWrapper,"chat__textInput"),onSubmit:p,children:[_.jsx("div",{className:rr.messageInputWrapper,children:_.jsx("textarea",{id:"user_input",ref:u,className:rr.messageInput,tabIndex:0,placeholder:s("message-input-placeholder"),onChange:y,onKeyDown:f,"aria-label":s("message-input-label")})}),_.jsxs("div",{className:k(rr.buttons,"chat__buttons"),children:[!a&&t&&_.jsx("button",{type:"button",className:k(rr.button,"chat__button"),"aria-label":s("message-input.actions.export-transcript.label"),tabIndex:0,onClick:o,children:_.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:_.jsx("path",{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"})})}),a||!e||navigator.mediaDevices===void 0?_.jsx("button",{className:k(rr.button,"chat__button"),type:"submit","aria-label":s("message-input.actions.submit.label"),tabIndex:0,disabled:n,children:_.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:_.jsx("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})})}):e&&navigator.mediaDevices!==void 0&&_.jsx(rO,{translate:s,onAudioRecorded:i})]})]})},lO="_quickReplies_11l22_1",uO="_quickReply_11l22_9",Vh={quickReplies:lO,quickReply:uO},cO=({quickReplies:e,onQuickReplyClick:t})=>e.length?_.jsx("div",{className:k(Vh.quickReplies,"chat__quickReplies"),children:e.map(n=>_.jsx("button",{tabIndex:0,className:k(Vh.quickReply,we.button,"chat__button","chat__quickReply"),onClick:()=>t(n),children:n.label},n.label))}):null,Wh=5e3,fO=1e3,dO=({isBotTyping:e,quickReplies:t,speechSupport:n,transcriptExportEnabled:r,conversationRating:i,numberOfMessagesFromGuest:o,showRatingOverlay:s,setShowRatingOverlay:a,onTextInput:l,onRate:u,onQuickReplyClick:c,onAudioRecorded:p,onOpenTranscriptExportModal:y})=>{const[f,v]=R.useState(!1),m=R.useRef(),S=R.useRef(0);R.useEffect(()=>{if(f&&!e){const d=m.current?Date.now()-m.current:0;d>Wh?v(!1):setTimeout(()=>{v(!1)},Wh-d)}},[f,e]),R.useEffect(()=>{f&&(m.current=Date.now())},[f]);const h=d=>{const g=Date.now()-S.current<fO;return e||g?(v(!0),!1):(l(d),S.current=Date.now(),!0)};return _.jsxs("div",{className:k(uk.inputContainer),children:[_.jsx(cO,{quickReplies:t,onQuickReplyClick:c}),_.jsx(dk,{visible:f}),!f&&_.jsx(Hk,{conversationRating:i,numberOfMessagesFromGuest:o,onRate:u,showRatingOverlay:s,setShowRatingOverlay:a}),_.jsx(aO,{onTextInput:h,onAudioRecorded:p,speechSupport:n,onOpenTranscriptExportModal:y,transcriptExportEnabled:r,disabled:f})]})},hO=({clientName:e,messages:t,quickReplies:n,isBotTyping:r,speechSupport:i,problemReportingEnabled:o,transcriptExportEnabled:s,conversationRating:a,showGeneralConditions:l,onMessageFromUser:u,onRate:c,onQuickReplyClick:p,onButtonClick:y,onLinkClick:f,onAudioRecorded:v,onTranscriptExport:m,onPdfExport:S,onProblemReport:h})=>{const d=Ic(),g=Di(P=>P.connection.connectionState),[E,w]=R.useState(!1),[b,x]=R.useState(!1),T=s.email||s.pdf,F=t.filter(P=>P.sender.type===tv.GUEST).length;return R.useEffect(()=>{if(g===jn.CONNECTED){const P=Mc.parse(window.location.search);d(ev(e,P))}},[g,d]),_.jsxs("div",{children:[_.jsxs("div",{className:`${Dx.chatcontent} ${E||b?we.accessabilityHidden:""}`,children:[_.jsx(V2,{messages:t,isBotTyping:r,showGeneralConditions:l,problemReportingEnabled:o,onButtonClick:y,onLinkClick:f,onProblemReport:h}),_.jsx(dO,{isBotTyping:r,quickReplies:r?[]:n,numberOfMessagesFromGuest:F,speechSupport:i,transcriptExportEnabled:T,conversationRating:E?{enabled:!1}:a,showRatingOverlay:b,setShowRatingOverlay:x,onRate:c,onQuickReplyClick:p,onTextInput:u,onAudioRecorded:v,onOpenTranscriptExportModal:()=>w(!E)}),_.jsx(Y2,{})]}),T&&_.jsx(ak,{methods:s,visible:E,onEmailExport:m,onPdfExport:S,onClose:()=>w(!1)})]})},pO=e=>{const{messages:t,quickReplies:n,isBotTyping:r,speechSupport:i,problemReportingEnabled:o,transcriptExportEnabled:s,conversationRating:a,showGeneralConditions:l}=e.chat;return{messages:t,quickReplies:n,isBotTyping:r,speechSupport:i,problemReportingEnabled:o,transcriptExportEnabled:s,conversationRating:a,showGeneralConditions:l}},mO=e=>({onRestartChat:(t,n)=>e(pf(t,n)),onMessageFromUser:t=>e(Iy(t)),onRate:(t,n)=>e(Cb(t,n)),onAudioRecorded:t=>e(yb(t)),onActionFromUser:t=>e(t),onQuickReplyClick:t=>e(Py(t)),onNluEvent:t=>e(My(t)),onButtonClick:t=>e(Ob(t)),onLinkClick:t=>e(Nb(t)),onTranscriptExport:t=>e(wb(t)),onPdfExport:()=>e(xb()),onProblemReport:(t,n)=>e(z.reportProblemFromGuest(t,n))}),gO=IE(pO,mO)(hO),yO="_chatwindow_phukm_1",vO="_chatcontent_phukm_13",_O={chatwindow:yO,chatcontent:vO},EO="_container_c5lw5_2",SO="_body_c5lw5_8",wO="_intro_c5lw5_13",bO="_footer_c5lw5_26",xO="_startChatButton_c5lw5_30",TO="_formFields_c5lw5_34",CO="_formField_c5lw5_34",kO="_radio_c5lw5_46",OO="_checkbox_c5lw5_52",NO="_input_c5lw5_59",RO="_inputLabel_c5lw5_89",AO="_selectWrapper_c5lw5_93",PO="_select_c5lw5_93",IO="_selectLabel_c5lw5_135",Pe={container:EO,body:SO,intro:wO,footer:bO,startChatButton:xO,formFields:TO,formField:CO,radio:kO,checkbox:OO,input:NO,inputLabel:RO,selectWrapper:AO,select:PO,selectLabel:IO},DO=({name:e,label:t,defaultValue:n,required:r,onChange:i})=>{const o=s=>{i(s.currentTarget.checked?"true":"false")};return _.jsxs("label",{className:k(Pe.checkbox,"chat__startScreen__checkbox"),children:[_.jsx("input",{type:"checkbox",id:e,name:e,defaultValue:n,required:r,onChange:o}),_.jsx("div",{children:t})]})},FO=({type:e,name:t,label:n,defaultValue:r,placeholder:i,required:o,multiple:s,min:a,max:l,pattern:u,onChange:c})=>{const p=y=>{c(y.target.value)};return _.jsxs("label",{className:k(Pe.input,"chat__startScreen__input"),children:[_.jsx("div",{className:k(Pe.inputLabel),children:n}),_.jsx("input",{type:e,id:t,name:t,defaultValue:r,placeholder:i,required:o,multiple:s,min:a,max:l,pattern:u,onChange:p})]})},MO=({name:e,value:t,label:n,defaultChecked:r,required:i,onChange:o})=>{const s=a=>{o(a.target.value)};return _.jsxs("label",{className:k(Pe.radio,"chat__startScreen__radio"),children:[_.jsx("input",{type:"radio",name:e,value:t,defaultChecked:r,required:i,onChange:s}),_.jsx("span",{className:k(Pe.label),children:n})]})},BO=({name:e,label:t,defaultValue:n,required:r,multiple:i,options:o,onChange:s})=>{const a=l=>{s(l.target.value)};return _.jsxs("label",{className:k(Pe.select,"chat__startScreen__select"),children:[_.jsx("div",{className:k(Pe.selectLabel),children:t}),_.jsx("div",{className:k(Pe.selectWrapper),children:_.jsx("select",{id:e,name:e,defaultValue:n,required:r,multiple:i,onChange:a,children:Object.entries(o||{}).map(([l,u])=>_.jsx("option",{value:l,selected:u===n,children:u}))})})]})},LO="start-screen.intro",jO="start-screen.start-chat",ht="start-screen.form",qh=`${ht}.fields`,UO=()=>{const e=xt(),t=Ic(),[n,r]=R.useState({}),i=()=>{const c=Object.entries(n).reduce((p,[y,f])=>({...p,[y]:f.value}),{});t(gx(c))},o=e(LO),s=e(jO),a=R.useMemo(()=>{var c;return((c=e(qh))==null?void 0:c.split(";").map(p=>p.trim()))??[]},[e(qh)]);R.useEffect(()=>{r(a.reduce((c,p)=>({...c,[p]:$O(p,e)}),{}))},[a]);const l=c=>{c.preventDefault(),i()},u=c=>p=>{r(y=>({...y,[c]:{...y[c],value:p}}))};return _.jsxs("form",{onSubmit:l,className:k(Pe.container,"chat__startScreen"),children:[_.jsxs("div",{className:k(Pe.body,"chat__startScreen__body"),children:[o&&_.jsx("div",{className:k(Pe.intro,"chat__startScreen__intro"),children:_.jsx(_n,{options:{overrides:{a:zO}},children:o})}),_.jsx("div",{className:k(Pe.formFields,"chat__startScreen__fields"),children:Object.values(n).map(({type:c,name:p,label:y,placeholder:f,defaultValue:v,options:m,required:S,multiple:h,min:d,max:g,pattern:E})=>_.jsx("div",{className:k(Pe.formField,"chat__startScreen__field"),children:(()=>{switch(c){case"radio":return _.jsxs(_.Fragment,{children:[_.jsx("div",{children:y}),Object.entries(m||{}).map(([w,b])=>_.jsx(MO,{name:p,value:w,label:b,defaultChecked:w===v,required:S,onChange:u(p)}))]});case"checkbox":return _.jsx(DO,{name:p,label:y,defaultValue:v,required:S,onChange:u(p)});case"select":return _.jsx(BO,{name:p,label:y,defaultValue:v,required:S,multiple:h,options:m,onChange:u(p)});default:return _.jsx(FO,{type:c,name:p,label:y,placeholder:f,defaultValue:v,required:S,multiple:h,min:d,max:g,pattern:E,onChange:u(p)})}})()},p))})]}),_.jsx("div",{className:k(Pe.footer,"chat__startScreen__footer"),children:_.jsx("button",{type:"submit",className:k(we.button,we.buttonPrimary,Pe.startChatButton),children:s})})]})},zO=({title:e,href:t,children:n})=>_.jsx("a",{href:t,title:e,target:"_blank",rel:"noopener noreferrer",children:n}),$O=(e,t)=>{const n=t(`${ht}.${e}.type`)||"text",r=t(`${ht}.${e}.required`)==="true",i=t(`${ht}.${e}.multiple`)==="true",o=t(`${ht}.${e}.placeholder`),s=t(`${ht}.${e}.label`)||"",a=t(`${ht}.${e}.defaultValue`),l=t(`${ht}.${e}.min`),u=t(`${ht}.${e}.max`),c=t(`${ht}.${e}.pattern`),p=HO(t(`${ht}.${e}.options`));return{name:e,label:s,placeholder:o,value:a||"",defaultValue:a,options:p,type:n,required:r,multiple:i,min:l,max:u,pattern:c}},HO=(e="")=>e.split(";").map(t=>t.trim()).reduce((t,n)=>{const[r,i]=n.split(":").map(o=>o.trim());return{...t,[r]:i}},{}),GO=()=>{const e=Ks();R.useEffect(()=>{window.document.documentElement.lang=e.locale},[e.locale])},ir={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"},VO=({clientName:e})=>{GO();const t=Ic(),n=Di(l=>l.startScreen.useStartScreen),r=Di(l=>l.startScreen.startScreenStatus),[i,o]=R.useState(void 0);R.useEffect(()=>{const l=Mc.parse(window.location.search);l.cssClassName&&o(l.cssClassName);const u=c=>{switch(c.data.type){case ir.TRIGGER_ACTION:t(c.data.action);break;case ir.TRIGGER_STORY:t(My(c.data.story));break;case ir.ON_CHAT_WINDOW_OPEN:t({type:"webclient.chatwindow.opened"});break;case ir.ON_CHAT_WINDOW_CLOSE:t({type:"webclient.chatwindow.closed"});break;case ir.CHAT_MESSAGE_FROM_GUEST:t(Iy(c.data.text));break;case ir.RESTART_CHAT:t(pf(e,l));break}};return t(Sx(e,l)),window.addEventListener("message",c=>u(c),!1),()=>window.removeEventListener("message",u)},[e,t]);const s=n===void 0,a=n===!1||r==="HIDDEN";return _.jsx("div",{className:k(_O.chatwindow,"chat__chatwindow",i),children:s?null:a?_.jsx(gO,{clientName:e}):_.jsx(UO,{})})},WO=()=>{const e=yy(),t=Di(r=>r.intl.locale),n=Di(r=>r.intl.messages);return _.jsx(hw,{locale:t,messages:n,children:_.jsx("div",{className:mw.app,children:_.jsx(VO,{clientName:e})})})};function qO(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var wf=qO,XO=typeof q=="object"&&q&&q.Object===Object&&q,QO=XO,KO=QO,YO=typeof self=="object"&&self&&self.Object===Object&&self,ZO=KO||YO||Function("return this")(),Iv=ZO,JO=Iv,eN=function(){return JO.Date.now()},tN=eN,nN=/\s/;function rN(e){for(var t=e.length;t--&&nN.test(e.charAt(t)););return t}var iN=rN,oN=iN,sN=/^\s+/;function aN(e){return e&&e.slice(0,oN(e)+1).replace(sN,"")}var lN=aN,uN=Iv,cN=uN.Symbol,Dv=cN,Xh=Dv,Fv=Object.prototype,fN=Fv.hasOwnProperty,dN=Fv.toString,Jr=Xh?Xh.toStringTag:void 0;function hN(e){var t=fN.call(e,Jr),n=e[Jr];try{e[Jr]=void 0;var r=!0}catch{}var i=dN.call(e);return r&&(t?e[Jr]=n:delete e[Jr]),i}var pN=hN,mN=Object.prototype,gN=mN.toString;function yN(e){return gN.call(e)}var vN=yN,Qh=Dv,_N=pN,EN=vN,SN="[object Null]",wN="[object Undefined]",Kh=Qh?Qh.toStringTag:void 0;function bN(e){return e==null?e===void 0?wN:SN:Kh&&Kh in Object(e)?_N(e):EN(e)}var xN=bN;function TN(e){return e!=null&&typeof e=="object"}var CN=TN,kN=xN,ON=CN,NN="[object Symbol]";function RN(e){return typeof e=="symbol"||ON(e)&&kN(e)==NN}var AN=RN,PN=lN,Yh=wf,IN=AN,Zh=NaN,DN=/^[-+]0x[0-9a-f]+$/i,FN=/^0b[01]+$/i,MN=/^0o[0-7]+$/i,BN=parseInt;function LN(e){if(typeof e=="number")return e;if(IN(e))return Zh;if(Yh(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Yh(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=PN(e);var n=FN.test(e);return n||MN.test(e)?BN(e.slice(2),n?2:8):DN.test(e)?Zh:+e}var jN=LN,UN=wf,el=tN,Jh=jN,zN="Expected a function",$N=Math.max,HN=Math.min;function GN(e,t,n){var r,i,o,s,a,l,u=0,c=!1,p=!1,y=!0;if(typeof e!="function")throw new TypeError(zN);t=Jh(t)||0,UN(n)&&(c=!!n.leading,p="maxWait"in n,o=p?$N(Jh(n.maxWait)||0,t):o,y="trailing"in n?!!n.trailing:y);function f(b){var x=r,T=i;return r=i=void 0,u=b,s=e.apply(T,x),s}function v(b){return u=b,a=setTimeout(h,t),c?f(b):s}function m(b){var x=b-l,T=b-u,F=t-x;return p?HN(F,o-T):F}function S(b){var x=b-l,T=b-u;return l===void 0||x>=t||x<0||p&&T>=o}function h(){var b=el();if(S(b))return d(b);a=setTimeout(h,m(b))}function d(b){return a=void 0,y&&r?f(b):(r=i=void 0,s)}function g(){a!==void 0&&clearTimeout(a),u=0,r=l=i=a=void 0}function E(){return a===void 0?s:d(el())}function w(){var b=el(),x=S(b);if(r=arguments,i=this,l=b,x){if(a===void 0)return v(l);if(p)return clearTimeout(a),a=setTimeout(h,t),f(l)}return a===void 0&&(a=setTimeout(h,t)),s}return w.cancel=g,w.flush=E,w}var VN=GN,WN=VN,qN=wf,XN="Expected a function";function QN(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(XN);return qN(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),WN(e,t,{leading:r,maxWait:t,trailing:i})}var KN=QN;const YN=Ou(KN);function Jn(e,t){var n,r;if(typeof t=="function")r=t(e),r!==void 0&&(e=r);else if(Array.isArray(t))for(n=0;n<t.length;n++)r=t[n](e),r!==void 0&&(e=r);return e}function ZN(e,t){return e[0]==="-"&&Array.isArray(t)&&/^-\d+$/.test(e)?t.length+parseInt(e,10):e}function JN(e){return/^\d+$/.test(e)}function Bo(e){return Object.prototype.toString.call(e)==="[object Object]"}function si(e){return Object(e)===e}function Lo(e){return Object.keys(e).length===0}var eR=["__proto__","prototype","constructor"],tR=function(e){return eR.indexOf(e)===-1};function aa(e,t){e.indexOf("[")>=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var n=e.split(t),r=n.filter(tR);if(r.length!==n.length)throw Error("Refusing to update blacklisted property "+e);return n}var ep=Object.prototype.hasOwnProperty;function G(e,t,n,r){if(!(this instanceof G))return new G(e,t,n,r);typeof t>"u"&&(t=!1),typeof n>"u"&&(n=!0),typeof r>"u"&&(r=!0),this.separator=e||".",this.override=t,this.useArray=n,this.useBrackets=r,this.keepArray=!1,this.cleanup=[]}var Dr=new G(".",!1,!0,!0);function Tt(e){return function(){return Dr[e].apply(Dr,arguments)}}G.prototype._fill=function(e,t,n,r){var i=e.shift();if(e.length>0){if(t[i]=t[i]||(this.useArray&&JN(e[0])?[]:{}),!si(t[i]))if(this.override)t[i]={};else{if(!(si(n)&&Lo(n)))throw new Error("Trying to redefine `"+i+"` which is a "+typeof t[i]);return}this._fill(e,t[i],n,r)}else{if(!this.override&&si(t[i])&&!Lo(t[i])){if(!(si(n)&&Lo(n)))throw new Error("Trying to redefine non-empty obj['"+i+"']");return}t[i]=Jn(n,r)}};G.prototype.object=function(e,t){var n=this;return Object.keys(e).forEach(function(r){var i=t===void 0?null:t[r],o=aa(r,n.separator).join(n.separator);o.indexOf(n.separator)!==-1?(n._fill(o.split(n.separator),e,e[r],i),delete e[r]):e[r]=Jn(e[r],i)}),e};G.prototype.str=function(e,t,n,r){var i=aa(e,this.separator).join(this.separator);return e.indexOf(this.separator)!==-1?this._fill(i.split(this.separator),n,t,r):n[e]=Jn(t,r),n};G.prototype.pick=function(e,t,n,r){var i,o,s,a,l;for(o=aa(e,this.separator),i=0;i<o.length;i++)if(a=ZN(o[i],t),t&&typeof t=="object"&&a in t){if(i===o.length-1)return n?(s=t[a],r&&Array.isArray(t)?t.splice(a,1):delete t[a],Array.isArray(t)&&(l=o.slice(0,-1).join("."),this.cleanup.indexOf(l)===-1&&this.cleanup.push(l)),s):t[a];t=t[a]}else return;return n&&Array.isArray(t)&&(t=t.filter(function(u){return u!==void 0})),t};G.prototype.delete=function(e,t){return this.remove(e,t,!0)};G.prototype.remove=function(e,t,n){var r;if(this.cleanup=[],Array.isArray(e)){for(r=0;r<e.length;r++)this.pick(e[r],t,!0,n);return n||this._cleanup(t),t}else return this.pick(e,t,!0,n)};G.prototype._cleanup=function(e){var t,n,r,i;if(this.cleanup.length){for(n=0;n<this.cleanup.length;n++)r=this.cleanup[n].split("."),i=r.splice(0,-1).join("."),t=i?this.pick(i,e):e,t=t[r[0]].filter(function(o){return o!==void 0}),this.set(this.cleanup[n],t,e);this.cleanup=[]}};G.prototype.del=G.prototype.remove;G.prototype.move=function(e,t,n,r,i){return typeof r=="function"||Array.isArray(r)?this.set(t,Jn(this.pick(e,n,!0),r),n,i):(i=r,this.set(t,this.pick(e,n,!0),n,i)),n};G.prototype.transfer=function(e,t,n,r,i,o){return typeof i=="function"||Array.isArray(i)?this.set(t,Jn(this.pick(e,n,!0),i),r,o):(o=i,this.set(t,this.pick(e,n,!0),r,o)),r};G.prototype.copy=function(e,t,n,r,i,o){return typeof i=="function"||Array.isArray(i)?this.set(t,Jn(JSON.parse(JSON.stringify(this.pick(e,n,!1))),i),r,o):(o=i,this.set(t,this.pick(e,n,!1),r,o)),r};G.prototype.set=function(e,t,n,r){var i,o,s,a;if(typeof t>"u")return n;for(s=aa(e,this.separator),i=0;i<s.length;i++){if(a=s[i],i===s.length-1)if(r&&Bo(t)&&Bo(n[a]))for(o in t)ep.call(t,o)&&(n[a][o]=t[o]);else if(r&&Array.isArray(n[a])&&Array.isArray(t))for(var l=0;l<t.length;l++)n[s[i]].push(t[l]);else n[a]=t;else(!ep.call(n,a)||!Bo(n[a])&&!Array.isArray(n[a]))&&(/^\d+$/.test(s[i+1])?n[a]=[]:n[a]={});n=n[a]}return n};G.prototype.transform=function(e,t,n){return t=t||{},n=n||{},Object.keys(e).forEach((function(r){this.set(e[r],this.pick(r,t),n)}).bind(this)),n};G.prototype.dot=function(e,t,n){t=t||{},n=n||[];var r=Array.isArray(e);return Object.keys(e).forEach((function(i){var o=r&&this.useBrackets?"["+i+"]":i;if(si(e[i])&&(Bo(e[i])&&!Lo(e[i])||Array.isArray(e[i])&&!this.keepArray&&e[i].length!==0))if(r&&this.useBrackets){var s=n[n.length-1]||"";return this.dot(e[i],t,n.slice(0,-1).concat(s+o))}else return this.dot(e[i],t,n.concat(o));else r&&this.useBrackets?t[n.join(this.separator).concat("["+i+"]")]=e[i]:t[n.concat(o).join(this.separator)]=e[i]}).bind(this)),t};G.pick=Tt("pick");G.move=Tt("move");G.transfer=Tt("transfer");G.transform=Tt("transform");G.copy=Tt("copy");G.object=Tt("object");G.str=Tt("str");G.set=Tt("set");G.delete=Tt("delete");G.del=G.remove=Tt("remove");G.dot=Tt("dot");["override","overwrite"].forEach(function(e){Object.defineProperty(G,e,{get:function(){return Dr.override},set:function(t){Dr.override=!!t}})});["useArray","keepArray","useBrackets"].forEach(function(e){Object.defineProperty(G,e,{get:function(){return Dr[e]},set:function(t){Dr[e]=t}})});G._process=Jn;var nR=G;const Mv={"message-input-label":"Benutzereingabe","message-input-placeholder":"Nachricht","message-input.actions.submit.label":"Nachricht senden","message-input.actions.export-transcript.label":"Konversation per E-Mail erhalten","message-input.actions.start-audio-recording.label":"Spracheingabe starten","message-input.actions.stop-audio-recording.label":"Spracheingabe stoppen","message-input.actions.submit-audio-recording.label":"Spracheingabe übermitteln","guest-bubble.label":"Ihre Nachricht","bot-bubble.label":"Nachricht des Chatbots","agent-bubble.label":"Nachricht des Live-Agenten","export-transcript.email.title":"Konversation per E-Mail versenden","export-transcript.email.description":"Geben Sie Ihre E-Mail-Adresse ein, um den Chatverlauf zu erhalten.","export-transcript.email.cancel":"Abbrechen","export-transcript.email.send":"Senden","export-transcript.email.placeholder":"Ihre E-Mail-Adresse","export-transcript.email.invalid":"Bitte gültige E-Mail-Adresse eingeben.","export-transcript.email.success":"Ich habe den Chatverlauf an Ihre E-Mail-Adresse gesendet.","export-transcript.pdf.title":"Konversation als PDF erhalten","export-transcript.pdf.description":"Laden Sie die Konversation als PDF herunter.","export-transcript.pdf.cancel":"Abbrechen","export-transcript.pdf.download":"Herunterladen","general-conditions.header":"**Nutzungsbedingungen**","general-conditions.body":`Bitte berücksichtigen Sie die folgenden Punkte:
|
|
98
|
+
`).map((i,o)=>_.jsxs("span",{className:T2.text,children:[_.jsx(b2,{componentDecorator:r,children:i}),_.jsx("br",{})]},o))})},C2=({subtitle:e,onLinkClick:t})=>e?_.jsx("div",{className:Me.subtitle,children:_.jsx(Rv,{text:e,onLinkClick:t})}):null,zh="newtab#",Av=({markdown:e,onLinkClick:t})=>{const n=i=>o=>(o.preventDefault(),i&&t(i),!1),r=({title:i,href:o,children:s})=>o.indexOf(zh)===0?_.jsx("a",{href:o.slice(zh.length),title:i,target:"_blank",rel:"noopener noreferrer",children:s}):_.jsx("a",{onClick:n(o),title:i,children:s});return _.jsx(_n,{options:{overrides:{a:r}},children:e})},k2=({text:e,onLinkClick:t})=>e?_.jsx("div",{children:_.jsx(Av,{markdown:e,onLinkClick:t})}):null,O2=({title:e})=>e?_.jsx("h1",{className:Me.title,children:e}):null,N2=({title:e,text:t,subtitle:n,buttons:r,onButtonClick:i,onLinkClick:o})=>(e==null?void 0:e.length)||(t==null?void 0:t.length)||(n==null?void 0:n.length)||(r==null?void 0:r.length)?_.jsxs("div",{className:k(B.bubbleContent),children:[_.jsx(O2,{title:e}),_.jsx(k2,{text:t,onLinkClick:o}),_.jsx(C2,{subtitle:n,onLinkClick:o}),_.jsx(DC,{buttons:r,onButtonClick:i})]}):null,R2=({alt:e,imageUrl:t,itemUrl:n,hasBody:r})=>t?n?n.indexOf("youtube.com")>-1?_.jsx("div",{className:Me.video_container,children:_.jsx("iframe",{className:k(Me.video,{[Me.only]:!r}),title:"Youtube",width:"100%",src:n+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):_.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:_.jsx("div",{className:Me.imageContainer,children:_.jsx("img",{className:k(Me.image,{[Me.only]:!r}),src:t,alt:e})})}):_.jsx("div",{className:Me.imageContainer,children:_.jsx("img",{className:k(Me.image,{[Me.only]:!r}),src:t,alt:e})}):null,A2=({title:e,text:t,subtitle:n,imageUrl:r,itemUrl:i,buttons:o,onButtonClick:s,onLinkClick:a})=>{const l=!!(e!=null&&e.length)||!!(t!=null&&t.length)||!!(n!=null&&n.length)||!!(o!=null&&o.length);return _.jsxs("div",{className:k(Me.detailMessage),children:[_.jsx(R2,{hasBody:l,imageUrl:r,itemUrl:i,alt:e||n}),l&&_.jsx(N2,{title:e,text:t,subtitle:n,buttons:o,onLinkClick:a,onButtonClick:s})]})},P2=R.forwardRef(({isFirstMessageBySender:e,isLastMessageBySender:t,children:n},r)=>{const i=xt();return _.jsx("li",{ref:r,className:k(B.message,B.messageGuest,e&&B.messageGuestFirst,t&&B.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",e&&"chat__bubbleContainer--first",t&&"chat__bubbleContainer--last"),children:_.jsx("div",{className:k(B.bubble,B.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":i("guest-bubble.label"),children:_.jsx("div",{className:k(B.rightText),children:n})})})}),I2=({markdown:e,className:t,onLinkClick:n})=>_.jsx("div",{className:k(B.bubbleContent,t),children:_.jsx(Av,{markdown:e,onLinkClick:n})}),D2=({text:e,onLinkClick:t})=>_.jsx("div",{className:B.bubbleContent,children:_.jsx(Rv,{text:e,onLinkClick:t})}),F2=R.forwardRef(({message:e,problemReportingEnabled:t,isFirstMessageBySender:n,isLastMessageBySender:r,onProblemReport:i,onButtonClick:o,onLinkClick:s},a)=>{const l=M2(e,o,s);switch(e.sender.type){case z.UserType.GUEST:return _.jsx(P2,{ref:a,isFirstMessageBySender:n,isLastMessageBySender:r,children:l});default:const u=c=>i(e._id,c);return _.jsx(xv,{ref:a,message:e,problemReportingEnabled:t,isAnimated:!1,isFirstMessageBySender:n,isLastMessageBySender:r,onProblemReport:u,children:l})}}),M2=(e,t,n)=>{switch(e.type){case z.MessageTypeEnum.TEXT:const r=e;return _.jsx(D2,{text:r.text,onLinkClick:n});case z.MessageTypeEnum.DETAIL:const i=e;return _.jsx(A2,{title:i.title,text:i.text,subtitle:i.subtitle,imageUrl:i.imageUrl,itemUrl:i.itemUrl,buttons:i.buttons,onButtonClick:t,onLinkClick:n});case z.MessageTypeEnum.MARKDOWN:const o=e;return _.jsx(I2,{markdown:o.markdown,className:o.className,onLinkClick:n})}},B2=(e,t)=>e.message._id===t.message._id&&e.message.problemReport===t.message.problemReport&&e.problemReportingEnabled===t.problemReportingEnabled&&e.isFirstMessageBySender===t.isFirstMessageBySender&&e.isLastMessageBySender===t.isLastMessageBySender,L2=_t.memo(F2,B2),j2="_ticontainer_wftg7_1",U2="_tiblock_wftg7_5",z2="_tidot_wftg7_12",$2="_mercuryTypingAnimation_wftg7_1",Zr={ticontainer:j2,tiblock:U2,tidot:z2,mercuryTypingAnimation:$2},H2=({isTyping:e=!1})=>_.jsx("div",{className:Zr.ticontainer,children:_.jsx("div",{className:Zr.tiblock,children:e?_.jsxs(_.Fragment,{children:[_.jsx("div",{className:k(Zr.tidot,"chat__typingIndicator")}),_.jsx("div",{className:k(Zr.tidot,"chat__typingIndicator")}),_.jsx("div",{className:k(Zr.tidot,"chat__typingIndicator")})]}):null})}),G2=Object.assign({_id:"typing-indicator"},new z.TextMessage("",new z.BotUser)),V2=({messages:e,isBotTyping:t,showGeneralConditions:n,problemReportingEnabled:r,onProblemReport:i,onButtonClick:o,onLinkClick:s})=>{const a=R.useRef(!0),l=R.useRef(null),u=R.useRef(null),c=R.useRef(null);R.useLayoutEffect(()=>{if(e.length&&l.current){if(u.current){const f=u.current.offsetTop;l.current.scrollTop=f}else if(c.current){const f=c.current.offsetTop;l.current.scrollTop=f}a.current&&(a.current=!1)}},[e,u.current,c.current,a]);let p;const y=e.length;return _.jsxs("div",{ref:l,className:k(Eh.messageContainer,"chat__messageContainer"),style:{scrollBehavior:e.length&&a.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[n&&_.jsx(tC,{}),_.jsxs("ul",{className:Eh.messages,children:[e.map((f,v)=>{const m=W2(f,p),S=q2(f,v,e,t);p=f.sender.type;const h=v+1===y;return _.jsx(L2,{ref:h?c:null,message:f,problemReportingEnabled:r,isFirstMessageBySender:m,isLastMessageBySender:S,onButtonClick:o,onLinkClick:s,onProblemReport:i},h&&!t?"last":f._id)}),t&&_.jsx(xv,{ref:u,message:G2,problemReportingEnabled:!1,isAnimated:!0,isFirstMessageBySender:p!==z.UserType.BOT,isLastMessageBySender:!0,children:_.jsx(H2,{isTyping:!0})},"last")]})]})},W2=(e,t)=>!t||t!==e.sender.type,q2=(e,t,n,r)=>{var a;const i=e.sender.type,o=n.length;return t+1===o?!(i===z.UserType.BOT&&r):i!==((a=n.at(t+1))==null?void 0:a.sender.type)},X2="_container_t5oqt_1",Q2={container:X2},K2=({title:e,href:t,children:n})=>_.jsx("a",{href:t,title:e,target:"_blank",rel:"noopener noreferrer",children:n}),Y2=()=>{const t=xt()("powered-by");return t&&t.length?_.jsx("div",{className:k(Q2.container,"chat__poweredBy"),children:_.jsx(_n,{options:{overrides:{a:K2}},children:t})}):null},Z2="_container_fgqz2_1",J2="_containerOpen_fgqz2_48",ek="_containerClose_fgqz2_52",tk="_formContainer_fgqz2_56",nk="_emailInput_fgqz2_61",rk="_description_fgqz2_90",ik="_actions_fgqz2_95",ok="_validationError_fgqz2_105",sk="_submitted_fgqz2_112",dt={container:Z2,containerOpen:J2,"slide-in":"_slide-in_fgqz2_1",containerClose:ek,"slide-out":"_slide-out_fgqz2_1",formContainer:tk,emailInput:nk,description:rk,actions:ik,validationError:ok,submitted:sk},ak=({visible:e,methods:t,onEmailExport:n,onPdfExport:r,onClose:i})=>{const o=xt(),[s,a]=R.useState(void 0),[l,u]=R.useState(!1),[c,p]=R.useState(!1),[y,f]=R.useState(void 0),v=R.useRef(null);R.useEffect(()=>{var d;e?((d=v.current)==null||d.focus(),u(!1),p(!1),a(e)):s===!0&&a(!1)},[e,s]);const m=d=>{d.preventDefault(),y&&y.length>0&&(n(y),u(!0),setTimeout(i,3*1e3))},S=d=>{const g=d.target.value.trim(),E=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(g);f(E?g:"")},h=()=>{p(!0),r(),setTimeout(i,3*1e3)};return _.jsxs("div",{className:k(dt.container,{[dt.containerOpen]:s===!0,[dt.containerClose]:s===!1}),children:[t.pdf&&_.jsxs(_.Fragment,{children:[_.jsx("h2",{children:o("export-transcript.pdf.title")}),_.jsx(_n,{className:dt.description,children:o("export-transcript.pdf.description")||""}),_.jsxs("div",{className:dt.actions,children:[_.jsx("button",{type:"button",className:k(we.button,we.buttonDefault),onClick:i,children:o("export-transcript.pdf.cancel")}),_.jsx("button",{className:k(we.button,we.buttonPrimary),onClick:h,disabled:c,children:o("export-transcript.pdf.download")})]})]}),t.email&&_.jsxs(_.Fragment,{children:[_.jsx("h2",{children:o("export-transcript.email.title")}),_.jsx(_n,{className:dt.description,children:o("export-transcript.email.description")||""}),_.jsxs("form",{onSubmit:m,className:dt.formContainer,children:[_.jsxs("div",{children:[_.jsx("input",{disabled:l,ref:v,type:"email",placeholder:o("export-transcript.email.placeholder"),className:dt.emailInput,onChange:S}),(y==null?void 0:y.length)===0?_.jsx("div",{className:dt.validationError,children:o("export-transcript.email.invalid")}):null]}),_.jsxs("div",{className:dt.actions,children:[_.jsx("button",{type:"button",className:k(we.button,we.buttonDefault),onClick:i,children:o("export-transcript.email.cancel")}),_.jsx("button",{type:"submit",disabled:l||y===void 0||y.length===0,className:k(we.button,we.buttonPrimary),children:o("export-transcript.email.send")})]})]}),l&&_.jsx("div",{className:dt.submitted,children:o("export-transcript.email.success")})]})]})},lk="_inputContainer_1px77_1",uk={inputContainer:lk},ck="_blockUserInput_rv0dg_1",fk={blockUserInput:ck,"append-animate":"_append-animate_rv0dg_1"},dk=({visible:e})=>{const t=xt();return e?_.jsx("div",{className:k(fk.blockUserInput,"chat__blockUserInput"),children:t("block-user-input.title")}):null},hk="_callToActionContainer_1t611_1",pk="_callToActionTitle_1t611_24",mk="_rateOverlay_1t611_31",gk="_body_1t611_61",yk="_rateOverlayOpen_1t611_92",vk="_rateOverlayClose_1t611_96",_k="_footer_1t611_100",Ek="_actions_1t611_115",Sk="_bubbles_1t611_127",wk="_rateFeedbackBotBubble_1t611_154",bk="_rateFeedbackGuestBubble_1t611_160",xk="_avatar_1t611_166",Tk="_fadeInLeft_1t611_1",Ck="_bubble_1t611_127",kk="_appear_1t611_1",Ok="_botBubble_1t611_192",Nk="_guestBubble_1t611_202",Rk="_rateText_1t611_218",Ak="_stars_1t611_223",Pk="_starsSmall_1t611_236",Ik="_starsLarge_1t611_240",Dk="_star_1t611_223",Fk="_starReadonly_1t611_257",Mk="_starIcon_1t611_265",Bk="_starsDescriptionContainer_1t611_283",Lk="_starsDescription_1t611_283",Se={callToActionContainer:hk,"append-animate":"_append-animate_1t611_1",callToActionTitle:pk,rateOverlay:mk,body:gk,rateOverlayOpen:yk,"slide-in":"_slide-in_1t611_1",rateOverlayClose:vk,"slide-out":"_slide-out_1t611_1",footer:_k,actions:Ek,bubbles:Sk,rateFeedbackBotBubble:wk,rateFeedbackGuestBubble:bk,avatar:xk,fadeInLeft:Tk,bubble:Ck,appear:kk,botBubble:Ok,guestBubble:Nk,rateText:Rk,stars:Ak,starsSmall:Pk,starsLarge:Ik,star:Dk,starReadonly:Fk,starIcon:Mk,starsDescriptionContainer:Bk,starsDescription:Lk},jk=({value:e,index:t,count:n,readonly:r,onHover:i,onClick:o})=>{const s=a=>{o&&a.key==="Enter"&&o()};return _.jsx("li",{className:k(Se.star,{[Se.starReadonly]:r},"chat__conversationRating__star"),children:_.jsx("div",{role:"radio","aria-checked":e>t?"true":"false","aria-posinset":t+1,"aria-setsize":n,tabIndex:0,onMouseOver:i,onKeyDown:s,onClick:o,children:_.jsx("span",{role:"img","aria-label":"Star",className:k(Se.starIcon),children:_.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:_.jsx("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"})})})})})},$h=5,Pv=({value:e,size:t,readonly:n=!1,onChange:r})=>{const[i,o]=R.useState(void 0),s=()=>{o(void 0)},a=u=>()=>{if(!n){const c=u+1;o(c)}},l=u=>()=>{r&&!n&&(r(u===0&&e===1?0:u+1),o(void 0))};return _.jsx("ul",{tabIndex:0,role:"radiogroup",className:k(Se.stars,{[Se.starsSmall]:t==="small",[Se.starsLarge]:t==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:t==="small",chat__conversationRating__stars__large:t==="large"}),onMouseOut:s,children:Array($h).fill(0).map((u,c)=>_.jsx(jk,{value:i===void 0?e:i,index:c,count:$h,readonly:n,onHover:a(c),onClick:l(c)},c))})},Uk=({visible:e,onRate:t})=>{const n=xt();return e?_.jsxs("div",{className:k(Se.callToActionContainer,"chat__conversationRating__callToAction"),children:[_.jsx("div",{className:k(Se.callToActionTitle,"chat__conversationRating__callToAction__title"),children:n("conversation-rating.call-to-action.title")}),_.jsx(Pv,{value:0,size:"small",onChange:t})]}):null},Hh=({isFirstMessageBySender:e,isLastMessageBySender:t,children:n})=>_.jsxs("div",{className:k(B.message,B.messageBot,e&&B.messageBotFirst,t&&B.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",e&&"chat__bubbleContainer--first",t&&"chat__bubbleContainer--last"),children:[_.jsx("img",{className:k(B.avatar,B.botAvatar),src:"bot.svg",alt:"Bot"}),_.jsx("div",{className:k(B.bubble,B.bubbleLeft,"chat__bubble","chat__botBubble"),children:_.jsx("div",{className:k(B.leftText,B.bubbleContent),children:n})})]}),zk=({children:e})=>_.jsx("div",{className:k(B.message,B.messageGuest,B.messageGuestFirst,B.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:_.jsx("div",{className:k(B.bubble,B.bubbleRight,"chat__bubble","chat__guestBubble"),children:_.jsx("div",{className:k(B.rightText,B.bubbleContent),children:e})})}),$k=({visible:e,rating:t,onRate:n,onClose:r})=>{const i=xt(),[o,s]=R.useState(t),[a,l]=R.useState(void 0),[u,c]=R.useState(void 0),[p,y]=R.useState({submitted:!1,feedback:""}),[f,v]=R.useState(!1),m=R.useRef(null);R.useEffect(()=>{e?(y({submitted:!1,feedback:""}),c(e)):u===!0&&c(!1)},[e,u]),R.useEffect(()=>{s(t)},[t]),R.useEffect(()=>{const h=i(`conversation-rating.overlay.bot-message.rate-feedback.value-${o}`);l(h!=null&&h.length?h:void 0)},[o,i]),R.useEffect(()=>{p.submitted?setTimeout(()=>v(!0),p.feedback.length?500:0):v(!1)},[p]);const S=h=>{var g,E;h.preventDefault();const d=((E=(g=m.current)==null?void 0:g.value)==null?void 0:E.trim())||"";n(o,d),y({submitted:!0,feedback:d})};return _.jsx("div",{className:k(Se.rateOverlay,"chat__conversationRating__overlay",{[Se.rateOverlayOpen]:u===!0,[Se.rateOverlayClose]:u===!1}),children:_.jsxs("form",{onSubmit:S,children:[_.jsxs("div",{className:k(Se.body,"chat__conversationRating__overlay__body"),children:[_.jsxs("div",{children:[_.jsx("h2",{children:i("conversation-rating.overlay.title")}),_.jsxs("div",{className:k(Se.starsDescriptionContainer),children:[_.jsx(Pv,{value:o,size:"large",readonly:p.submitted,onChange:s}),_.jsxs("div",{className:k(Se.starsDescription),children:[_.jsx("div",{children:i("conversation-rating.overlay.star.very-bad")}),_.jsx("div",{children:i("conversation-rating.overlay.star.very-good")})]})]})]}),_.jsx("div",{className:k(Se.bubbles),children:e&&a&&_.jsxs(_.Fragment,{children:[_.jsx(Hh,{isFirstMessageBySender:!0,isLastMessageBySender:!f||!!p.feedback.length,children:_.jsx("div",{children:a})}),!!p.feedback.length&&_.jsx(zk,{children:p.feedback}),f&&_.jsx(Hh,{isFirstMessageBySender:!!p.feedback.length,isLastMessageBySender:!0,children:_.jsx("div",{children:i("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),_.jsxs("div",{className:k(Se.footer,"chat__conversationRating__overlay__footer"),children:[!p.submitted&&_.jsx("input",{ref:m,placeholder:i("conversation-rating.overlay.guest-feedback.input-placeholder")}),_.jsx("div",{className:k(Se.actions,"chat__conversationRating__overlay__footer__actions"),children:p.submitted?_.jsx("button",{type:"button",className:k(we.button,we.buttonPrimary),onClick:r,children:i("conversation-rating.overlay.action.close")}):_.jsx("button",{type:"submit",className:k(we.button,we.buttonPrimary),children:i("conversation-rating.overlay.action.submit")})})]})]})})},Hk=({conversationRating:{enabled:e,rating:t},numberOfMessagesFromGuest:n,showRatingOverlay:r,setShowRatingOverlay:i,onRate:o})=>{const[s,a]=R.useState(0),l=p=>{a(p),i(!0)},u=()=>i(!1),c=!t&&n>=1;return e?_.jsxs(_.Fragment,{children:[_.jsx(Uk,{visible:c,onRate:l}),_.jsx($k,{visible:r,rating:s,onRate:o,onClose:u})]}):null},Gk="_inputWrapper_lbrof_5",Vk="_messageInputWrapper_lbrof_14",Wk="_messageInput_lbrof_14",qk="_buttons_lbrof_36",Xk="_button_lbrof_36",rr={inputWrapper:Gk,messageInputWrapper:Vk,messageInput:Wk,buttons:qk,button:Xk},Qk="_audioRecorder_xps9k_5",Kk="_recordButton_xps9k_10",Yk="_submitButton_xps9k_37",Zk="_cancelButton_xps9k_64",Jk="_recorderIcon_xps9k_91",eO="_pulse_xps9k_1",tO="_spinning_xps9k_113",nO="_spin_xps9k_113",An={audioRecorder:Qk,recordButton:Kk,submitButton:Yk,cancelButton:Zk,recorderIcon:Jk,pulse:eO,spinning:tO,spin:nO},Gh=2048,Ss=16e3;class rO extends _t.Component{constructor(n){super(n);V(this,"audioInput",null);V(this,"volume",null);V(this,"leftchannel",[]);V(this,"recorder",null);V(this,"recordingLength",0);V(this,"sampleRate",null);V(this,"mediaStream",null);this.state={recordingState:"none"},this.triggerAudioRecording=this.triggerAudioRecording.bind(this),this.triggerAudioRecordingSuccess=this.triggerAudioRecordingSuccess.bind(this),this.initRecording=this.initRecording.bind(this),this.processRecordingInput=this.processRecordingInput.bind(this),this.handleClickSubmitAudio=this.handleClickSubmitAudio.bind(this),this.handleClickStopAudio=this.handleClickStopAudio.bind(this)}triggerAudioRecording(){this.setState({recordingState:"connecting"}),navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(this.triggerAudioRecordingSuccess)}triggerAudioRecordingSuccess(n){this.mediaStream=n,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(n)}initRecording(n){var r=window.AudioContext||window.webkitAudioContext,i=new r;this.sampleRate=i.sampleRate,this.volume=i.createGain(),this.audioInput=i.createMediaStreamSource(n),this.audioInput.connect(this.volume),this.recorder=i.createScriptProcessor(Gh,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(i.destination)}processRecordingInput(n){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const r=n.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(r)),this.recordingLength+=Gh}}handleClickSubmitAudio(){const n=oO(this.leftchannel,this.recordingLength),r=sO(n,this.sampleRate||0),i=iO(r);this.props.onAudioRecorded(i),this.handleClickStopAudio()}handleClickStopAudio(){var n,r,i,o;this.setState({recordingState:"none"}),(n=this.audioInput)==null||n.disconnect(),(r=this.volume)==null||r.disconnect(),(i=this.recorder)==null||i.disconnect(),this.mediaStream&&((o=this.mediaStream)==null||o.getAudioTracks().forEach(s=>{s.stop()}))}render(){return _.jsxs("div",{className:An.audioRecorder,children:[this.state.recordingState==="none"&&_.jsx("button",{className:k(An.recordButton,"chat__button"),type:"submit","aria-label":this.props.translate("message-input.actions.start-audio-recording.label"),tabIndex:0,onClick:this.triggerAudioRecording,children:_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.jsx("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z"}),_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&_.jsxs("svg",{className:An.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&_.jsxs("div",{className:An.audioRecorder,children:[_.jsx("button",{className:k(An.cancelButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),_.jsx("div",{className:An.recorderIcon}),_.jsx("button",{className:k(An.submitButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[_.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),_.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const iO=e=>{const t=new ArrayBuffer(44+e.length*2),n=new DataView(t);yo(n,0,"RIFF"),n.setUint32(4,44+e.length*2,!0),yo(n,8,"WAVE"),yo(n,12,"fmt "),n.setUint32(16,16,!0),n.setUint16(20,1,!0),n.setUint16(22,1,!0),n.setUint32(24,Ss,!0),n.setUint32(28,Ss*4,!0),n.setUint16(32,4,!0),n.setUint16(34,16,!0),yo(n,36,"data"),n.setUint32(40,e.length*2,!0);const r=e.length;let i=44;const o=1;for(var s=0;s<r;s++)n.setInt16(i,e[s]*(32767*o),!0),i+=2;return new Blob([n],{type:"audio/wav"})},yo=(e,t,n)=>{for(var r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))},oO=(e,t)=>{const n=new Float32Array(t);let r=0;const i=e.length;for(var o=0;o<i;o++){const s=e[o];n.set(s,r),r+=s.length}return n},sO=(e,t)=>{if(Ss===t)return e;const n=t/Ss,r=Math.round(e.length/n),i=new Float32Array(r);let o=0,s=0;for(;o<i.length;){let l=Math.round((o+1)*n),u=0,c=0;for(var a=s;a<l&&a<e.length;a++)u+=e[a],c++;i[o]=u/c,o++,s=l}return i},aO=({speechSupport:e,transcriptExportEnabled:t,disabled:n,onTextInput:r,onAudioRecorded:i,onOpenTranscriptExportModal:o})=>{const s=xt(),[a,l]=R.useState(!1),u=R.useRef(null),c=()=>{const v=u.current;v&&v.value.trim().length>=1&&r(v.value.trim())&&(v.value="",v.style.height="",l(!1),v.focus())},p=v=>{v.preventDefault(),c()},y=v=>{const m=v.target.value.trim();l(m.length>0),v.target.style.height="";const{scrollHeight:S}=v.target;v.target.style.height=`${S>150?150:S}px`},f=v=>{v.code==="Enter"&&!v.shiftKey&&(v.repeat||c(),v.preventDefault())};return _.jsxs("form",{className:k(rr.inputWrapper,"chat__textInput"),onSubmit:p,children:[_.jsx("div",{className:rr.messageInputWrapper,children:_.jsx("textarea",{id:"user_input",ref:u,className:rr.messageInput,tabIndex:0,placeholder:s("message-input-placeholder"),onChange:y,onKeyDown:f,"aria-label":s("message-input-label")})}),_.jsxs("div",{className:k(rr.buttons,"chat__buttons"),children:[!a&&t&&_.jsx("button",{type:"button",className:k(rr.button,"chat__button"),"aria-label":s("message-input.actions.export-transcript.label"),tabIndex:0,onClick:o,children:_.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:_.jsx("path",{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"})})}),a||!e||navigator.mediaDevices===void 0?_.jsx("button",{className:k(rr.button,"chat__button"),type:"submit","aria-label":s("message-input.actions.submit.label"),tabIndex:0,disabled:n,children:_.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:_.jsx("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})})}):e&&navigator.mediaDevices!==void 0&&_.jsx(rO,{translate:s,onAudioRecorded:i})]})]})},lO="_quickReplies_11l22_1",uO="_quickReply_11l22_9",Vh={quickReplies:lO,quickReply:uO},cO=({quickReplies:e,onQuickReplyClick:t})=>e.length?_.jsx("div",{className:k(Vh.quickReplies,"chat__quickReplies"),children:e.map(n=>_.jsx("button",{tabIndex:0,className:k(Vh.quickReply,we.button,"chat__button","chat__quickReply"),onClick:()=>t(n),children:n.label},n.label))}):null,Wh=5e3,fO=1e3,dO=({isBotTyping:e,quickReplies:t,speechSupport:n,transcriptExportEnabled:r,conversationRating:i,numberOfMessagesFromGuest:o,showRatingOverlay:s,setShowRatingOverlay:a,onTextInput:l,onRate:u,onQuickReplyClick:c,onAudioRecorded:p,onOpenTranscriptExportModal:y})=>{const[f,v]=R.useState(!1),m=R.useRef(),S=R.useRef(0);R.useEffect(()=>{if(f&&!e){const d=m.current?Date.now()-m.current:0;d>Wh?v(!1):setTimeout(()=>{v(!1)},Wh-d)}},[f,e]),R.useEffect(()=>{f&&(m.current=Date.now())},[f]);const h=d=>{const g=Date.now()-S.current<fO;return e||g?(v(!0),!1):(l(d),S.current=Date.now(),!0)};return _.jsxs("div",{className:k(uk.inputContainer),children:[_.jsx(cO,{quickReplies:t,onQuickReplyClick:c}),_.jsx(dk,{visible:f}),!f&&_.jsx(Hk,{conversationRating:i,numberOfMessagesFromGuest:o,onRate:u,showRatingOverlay:s,setShowRatingOverlay:a}),_.jsx(aO,{onTextInput:h,onAudioRecorded:p,speechSupport:n,onOpenTranscriptExportModal:y,transcriptExportEnabled:r,disabled:f})]})},hO=({clientName:e,messages:t,quickReplies:n,isBotTyping:r,speechSupport:i,problemReportingEnabled:o,transcriptExportEnabled:s,conversationRating:a,showGeneralConditions:l,onMessageFromUser:u,onRate:c,onQuickReplyClick:p,onButtonClick:y,onLinkClick:f,onAudioRecorded:v,onTranscriptExport:m,onPdfExport:S,onProblemReport:h})=>{const d=Ic(),g=Di(P=>P.connection.connectionState),[E,w]=R.useState(!1),[b,x]=R.useState(!1),T=s.email||s.pdf,F=t.filter(P=>P.sender.type===tv.GUEST).length;return R.useEffect(()=>{if(g===jn.CONNECTED){const P=Mc.parse(window.location.search);d(ev(e,P))}},[g,d]),_.jsxs("div",{children:[_.jsxs("div",{className:`${Dx.chatcontent} ${E||b?we.accessabilityHidden:""}`,children:[_.jsx(V2,{messages:t,isBotTyping:r,showGeneralConditions:l,problemReportingEnabled:o,onButtonClick:y,onLinkClick:f,onProblemReport:h}),_.jsx(dO,{isBotTyping:r,quickReplies:r?[]:n,numberOfMessagesFromGuest:F,speechSupport:i,transcriptExportEnabled:T,conversationRating:E?{enabled:!1}:a,showRatingOverlay:b,setShowRatingOverlay:x,onRate:c,onQuickReplyClick:p,onTextInput:u,onAudioRecorded:v,onOpenTranscriptExportModal:()=>w(!E)}),_.jsx(Y2,{})]}),T&&_.jsx(ak,{methods:s,visible:E,onEmailExport:m,onPdfExport:S,onClose:()=>w(!1)})]})},pO=e=>{const{messages:t,quickReplies:n,isBotTyping:r,speechSupport:i,problemReportingEnabled:o,transcriptExportEnabled:s,conversationRating:a,showGeneralConditions:l}=e.chat;return{messages:t,quickReplies:n,isBotTyping:r,speechSupport:i,problemReportingEnabled:o,transcriptExportEnabled:s,conversationRating:a,showGeneralConditions:l}},mO=e=>({onRestartChat:(t,n)=>e(pf(t,n)),onMessageFromUser:t=>e(Iy(t)),onRate:(t,n)=>e(Cb(t,n)),onAudioRecorded:t=>e(yb(t)),onActionFromUser:t=>e(t),onQuickReplyClick:t=>e(Py(t)),onNluEvent:t=>e(My(t)),onButtonClick:t=>e(Ob(t)),onLinkClick:t=>e(Nb(t)),onTranscriptExport:t=>e(wb(t)),onPdfExport:()=>e(xb()),onProblemReport:(t,n)=>e(z.reportProblemFromGuest(t,n))}),gO=IE(pO,mO)(hO),yO="_chatwindow_phukm_1",vO="_chatcontent_phukm_13",_O={chatwindow:yO,chatcontent:vO},EO="_container_c5lw5_2",SO="_body_c5lw5_8",wO="_intro_c5lw5_13",bO="_footer_c5lw5_26",xO="_startChatButton_c5lw5_30",TO="_formFields_c5lw5_34",CO="_formField_c5lw5_34",kO="_radio_c5lw5_46",OO="_checkbox_c5lw5_52",NO="_input_c5lw5_59",RO="_inputLabel_c5lw5_89",AO="_selectWrapper_c5lw5_93",PO="_select_c5lw5_93",IO="_selectLabel_c5lw5_135",Pe={container:EO,body:SO,intro:wO,footer:bO,startChatButton:xO,formFields:TO,formField:CO,radio:kO,checkbox:OO,input:NO,inputLabel:RO,selectWrapper:AO,select:PO,selectLabel:IO},DO=({name:e,label:t,defaultValue:n,required:r,onChange:i})=>{const o=s=>{i(s.currentTarget.checked?"true":"false")};return _.jsxs("label",{className:k(Pe.checkbox,"chat__startScreen__checkbox"),htmlFor:e,children:[_.jsx("input",{type:"checkbox",id:e,name:e,defaultChecked:n==="true",required:r,onChange:o}),_.jsx("div",{children:t})]})},FO=({type:e,name:t,label:n,defaultValue:r,placeholder:i,required:o,multiple:s,min:a,max:l,pattern:u,onChange:c})=>{const p=y=>{c(y.target.value)};return _.jsxs("label",{className:k(Pe.input,"chat__startScreen__input"),htmlFor:t,children:[_.jsx("div",{className:k(Pe.inputLabel),children:n}),_.jsx("input",{type:e,id:t,name:t,defaultValue:r,placeholder:i,required:o,multiple:s,min:a,max:l,pattern:u,onChange:p})]})},MO=({name:e,value:t,label:n,defaultChecked:r,required:i,onChange:o})=>{const s=a=>{o(a.target.value)};return _.jsxs("label",{className:k(Pe.radio,"chat__startScreen__radio"),htmlFor:e,children:[_.jsx("input",{type:"radio",name:e,value:t,defaultChecked:r,required:i,onChange:s}),_.jsx("span",{className:k(Pe.label),children:n})]})},BO=({name:e,label:t,defaultValue:n,required:r,multiple:i,options:o,onChange:s})=>{const a=l=>{s(l.target.value)};return _.jsxs("label",{className:k(Pe.select,"chat__startScreen__select"),htmlFor:e,children:[_.jsx("div",{className:k(Pe.selectLabel),children:t}),_.jsx("div",{className:k(Pe.selectWrapper),children:_.jsx("select",{id:e,name:e,defaultValue:n,required:r,multiple:i,onChange:a,children:Object.entries(o||{}).map(([l,u])=>_.jsx("option",{value:l,selected:u===n,children:u}))})})]})},LO="start-screen.intro",jO="start-screen.start-chat",ht="start-screen.form",qh=`${ht}.fields`,UO=()=>{const e=xt(),t=Ic(),[n,r]=R.useState({}),i=()=>{const c=Object.entries(n).reduce((p,[y,f])=>({...p,[y]:f.value}),{});t(gx(c))},o=e(LO),s=e(jO),a=R.useMemo(()=>{var c;return((c=e(qh))==null?void 0:c.split(";").map(p=>p.trim()))??[]},[e(qh)]);R.useEffect(()=>{r(a.reduce((c,p)=>({...c,[p]:$O(p,e)}),{}))},[a]);const l=c=>{c.preventDefault(),i()},u=c=>p=>{r(y=>({...y,[c]:{...y[c],value:p}}))};return _.jsxs("form",{onSubmit:l,className:k(Pe.container,"chat__startScreen"),children:[_.jsxs("div",{className:k(Pe.body,"chat__startScreen__body"),children:[o&&_.jsx("div",{className:k(Pe.intro,"chat__startScreen__intro"),children:_.jsx(_n,{options:{overrides:{a:zO}},children:o})}),_.jsx("div",{className:k(Pe.formFields,"chat__startScreen__fields"),children:Object.values(n).map(({type:c,name:p,label:y,placeholder:f,defaultValue:v,options:m,required:S,multiple:h,min:d,max:g,pattern:E})=>_.jsx("div",{className:k(Pe.formField,"chat__startScreen__field"),children:(()=>{switch(c){case"radio":return _.jsxs(_.Fragment,{children:[_.jsx("div",{children:y}),Object.entries(m||{}).map(([w,b])=>_.jsx(MO,{name:p,value:w,label:b,defaultChecked:w===v,required:S,onChange:u(p)}))]});case"checkbox":return _.jsx(DO,{name:p,label:y,defaultValue:v,required:S,onChange:u(p)});case"select":return _.jsx(BO,{name:p,label:y,defaultValue:v,required:S,multiple:h,options:m,onChange:u(p)});default:return _.jsx(FO,{type:c,name:p,label:y,placeholder:f,defaultValue:v,required:S,multiple:h,min:d,max:g,pattern:E,onChange:u(p)})}})()},p))})]}),_.jsx("div",{className:k(Pe.footer,"chat__startScreen__footer"),children:_.jsx("button",{type:"submit",className:k(we.button,we.buttonPrimary,Pe.startChatButton),children:s})})]})},zO=({title:e,href:t,children:n})=>_.jsx("a",{href:t,title:e,target:"_blank",rel:"noopener noreferrer",children:n}),$O=(e,t)=>{const n=t(`${ht}.${e}.type`)||"text",r=t(`${ht}.${e}.required`)==="true",i=t(`${ht}.${e}.multiple`)==="true",o=t(`${ht}.${e}.placeholder`),s=t(`${ht}.${e}.label`)||"",a=t(`${ht}.${e}.defaultValue`),l=t(`${ht}.${e}.min`),u=t(`${ht}.${e}.max`),c=t(`${ht}.${e}.pattern`),p=GO(t(`${ht}.${e}.options`));return{name:e,label:s,placeholder:o,value:HO(n,a,p)||"",defaultValue:a,options:p,type:n,required:r,multiple:i,min:l,max:u,pattern:c}},HO=(e,t,n)=>t||e==="select"&&Object.keys(n)[0]||"",GO=(e="")=>e.split(";").map(t=>t.trim()).reduce((t,n)=>{const[r,i]=n.split(":").map(o=>o.trim());return{...t,[r]:i}},{}),VO=()=>{const e=Ks();R.useEffect(()=>{window.document.documentElement.lang=e.locale},[e.locale])},ir={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"},WO=({clientName:e})=>{VO();const t=Ic(),n=Di(l=>l.startScreen.useStartScreen),r=Di(l=>l.startScreen.startScreenStatus),[i,o]=R.useState(void 0);R.useEffect(()=>{const l=Mc.parse(window.location.search);l.cssClassName&&o(l.cssClassName);const u=c=>{switch(c.data.type){case ir.TRIGGER_ACTION:t(c.data.action);break;case ir.TRIGGER_STORY:t(My(c.data.story));break;case ir.ON_CHAT_WINDOW_OPEN:t({type:"webclient.chatwindow.opened"});break;case ir.ON_CHAT_WINDOW_CLOSE:t({type:"webclient.chatwindow.closed"});break;case ir.CHAT_MESSAGE_FROM_GUEST:t(Iy(c.data.text));break;case ir.RESTART_CHAT:t(pf(e,l));break}};return t(Sx(e,l)),window.addEventListener("message",c=>u(c),!1),()=>window.removeEventListener("message",u)},[e,t]);const s=n===void 0,a=n===!1||r==="HIDDEN";return _.jsx("div",{className:k(_O.chatwindow,"chat__chatwindow",i),children:s?null:a?_.jsx(gO,{clientName:e}):_.jsx(UO,{})})},qO=()=>{const e=yy(),t=Di(r=>r.intl.locale),n=Di(r=>r.intl.messages);return _.jsx(hw,{locale:t,messages:n,children:_.jsx("div",{className:mw.app,children:_.jsx(WO,{clientName:e})})})};function XO(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var wf=XO,QO=typeof q=="object"&&q&&q.Object===Object&&q,KO=QO,YO=KO,ZO=typeof self=="object"&&self&&self.Object===Object&&self,JO=YO||ZO||Function("return this")(),Iv=JO,eN=Iv,tN=function(){return eN.Date.now()},nN=tN,rN=/\s/;function iN(e){for(var t=e.length;t--&&rN.test(e.charAt(t)););return t}var oN=iN,sN=oN,aN=/^\s+/;function lN(e){return e&&e.slice(0,sN(e)+1).replace(aN,"")}var uN=lN,cN=Iv,fN=cN.Symbol,Dv=fN,Xh=Dv,Fv=Object.prototype,dN=Fv.hasOwnProperty,hN=Fv.toString,Jr=Xh?Xh.toStringTag:void 0;function pN(e){var t=dN.call(e,Jr),n=e[Jr];try{e[Jr]=void 0;var r=!0}catch{}var i=hN.call(e);return r&&(t?e[Jr]=n:delete e[Jr]),i}var mN=pN,gN=Object.prototype,yN=gN.toString;function vN(e){return yN.call(e)}var _N=vN,Qh=Dv,EN=mN,SN=_N,wN="[object Null]",bN="[object Undefined]",Kh=Qh?Qh.toStringTag:void 0;function xN(e){return e==null?e===void 0?bN:wN:Kh&&Kh in Object(e)?EN(e):SN(e)}var TN=xN;function CN(e){return e!=null&&typeof e=="object"}var kN=CN,ON=TN,NN=kN,RN="[object Symbol]";function AN(e){return typeof e=="symbol"||NN(e)&&ON(e)==RN}var PN=AN,IN=uN,Yh=wf,DN=PN,Zh=NaN,FN=/^[-+]0x[0-9a-f]+$/i,MN=/^0b[01]+$/i,BN=/^0o[0-7]+$/i,LN=parseInt;function jN(e){if(typeof e=="number")return e;if(DN(e))return Zh;if(Yh(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Yh(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=IN(e);var n=MN.test(e);return n||BN.test(e)?LN(e.slice(2),n?2:8):FN.test(e)?Zh:+e}var UN=jN,zN=wf,el=nN,Jh=UN,$N="Expected a function",HN=Math.max,GN=Math.min;function VN(e,t,n){var r,i,o,s,a,l,u=0,c=!1,p=!1,y=!0;if(typeof e!="function")throw new TypeError($N);t=Jh(t)||0,zN(n)&&(c=!!n.leading,p="maxWait"in n,o=p?HN(Jh(n.maxWait)||0,t):o,y="trailing"in n?!!n.trailing:y);function f(b){var x=r,T=i;return r=i=void 0,u=b,s=e.apply(T,x),s}function v(b){return u=b,a=setTimeout(h,t),c?f(b):s}function m(b){var x=b-l,T=b-u,F=t-x;return p?GN(F,o-T):F}function S(b){var x=b-l,T=b-u;return l===void 0||x>=t||x<0||p&&T>=o}function h(){var b=el();if(S(b))return d(b);a=setTimeout(h,m(b))}function d(b){return a=void 0,y&&r?f(b):(r=i=void 0,s)}function g(){a!==void 0&&clearTimeout(a),u=0,r=l=i=a=void 0}function E(){return a===void 0?s:d(el())}function w(){var b=el(),x=S(b);if(r=arguments,i=this,l=b,x){if(a===void 0)return v(l);if(p)return clearTimeout(a),a=setTimeout(h,t),f(l)}return a===void 0&&(a=setTimeout(h,t)),s}return w.cancel=g,w.flush=E,w}var WN=VN,qN=WN,XN=wf,QN="Expected a function";function KN(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(QN);return XN(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),qN(e,t,{leading:r,maxWait:t,trailing:i})}var YN=KN;const ZN=Ou(YN);function Jn(e,t){var n,r;if(typeof t=="function")r=t(e),r!==void 0&&(e=r);else if(Array.isArray(t))for(n=0;n<t.length;n++)r=t[n](e),r!==void 0&&(e=r);return e}function JN(e,t){return e[0]==="-"&&Array.isArray(t)&&/^-\d+$/.test(e)?t.length+parseInt(e,10):e}function eR(e){return/^\d+$/.test(e)}function Bo(e){return Object.prototype.toString.call(e)==="[object Object]"}function si(e){return Object(e)===e}function Lo(e){return Object.keys(e).length===0}var tR=["__proto__","prototype","constructor"],nR=function(e){return tR.indexOf(e)===-1};function aa(e,t){e.indexOf("[")>=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var n=e.split(t),r=n.filter(nR);if(r.length!==n.length)throw Error("Refusing to update blacklisted property "+e);return n}var ep=Object.prototype.hasOwnProperty;function G(e,t,n,r){if(!(this instanceof G))return new G(e,t,n,r);typeof t>"u"&&(t=!1),typeof n>"u"&&(n=!0),typeof r>"u"&&(r=!0),this.separator=e||".",this.override=t,this.useArray=n,this.useBrackets=r,this.keepArray=!1,this.cleanup=[]}var Dr=new G(".",!1,!0,!0);function Tt(e){return function(){return Dr[e].apply(Dr,arguments)}}G.prototype._fill=function(e,t,n,r){var i=e.shift();if(e.length>0){if(t[i]=t[i]||(this.useArray&&eR(e[0])?[]:{}),!si(t[i]))if(this.override)t[i]={};else{if(!(si(n)&&Lo(n)))throw new Error("Trying to redefine `"+i+"` which is a "+typeof t[i]);return}this._fill(e,t[i],n,r)}else{if(!this.override&&si(t[i])&&!Lo(t[i])){if(!(si(n)&&Lo(n)))throw new Error("Trying to redefine non-empty obj['"+i+"']");return}t[i]=Jn(n,r)}};G.prototype.object=function(e,t){var n=this;return Object.keys(e).forEach(function(r){var i=t===void 0?null:t[r],o=aa(r,n.separator).join(n.separator);o.indexOf(n.separator)!==-1?(n._fill(o.split(n.separator),e,e[r],i),delete e[r]):e[r]=Jn(e[r],i)}),e};G.prototype.str=function(e,t,n,r){var i=aa(e,this.separator).join(this.separator);return e.indexOf(this.separator)!==-1?this._fill(i.split(this.separator),n,t,r):n[e]=Jn(t,r),n};G.prototype.pick=function(e,t,n,r){var i,o,s,a,l;for(o=aa(e,this.separator),i=0;i<o.length;i++)if(a=JN(o[i],t),t&&typeof t=="object"&&a in t){if(i===o.length-1)return n?(s=t[a],r&&Array.isArray(t)?t.splice(a,1):delete t[a],Array.isArray(t)&&(l=o.slice(0,-1).join("."),this.cleanup.indexOf(l)===-1&&this.cleanup.push(l)),s):t[a];t=t[a]}else return;return n&&Array.isArray(t)&&(t=t.filter(function(u){return u!==void 0})),t};G.prototype.delete=function(e,t){return this.remove(e,t,!0)};G.prototype.remove=function(e,t,n){var r;if(this.cleanup=[],Array.isArray(e)){for(r=0;r<e.length;r++)this.pick(e[r],t,!0,n);return n||this._cleanup(t),t}else return this.pick(e,t,!0,n)};G.prototype._cleanup=function(e){var t,n,r,i;if(this.cleanup.length){for(n=0;n<this.cleanup.length;n++)r=this.cleanup[n].split("."),i=r.splice(0,-1).join("."),t=i?this.pick(i,e):e,t=t[r[0]].filter(function(o){return o!==void 0}),this.set(this.cleanup[n],t,e);this.cleanup=[]}};G.prototype.del=G.prototype.remove;G.prototype.move=function(e,t,n,r,i){return typeof r=="function"||Array.isArray(r)?this.set(t,Jn(this.pick(e,n,!0),r),n,i):(i=r,this.set(t,this.pick(e,n,!0),n,i)),n};G.prototype.transfer=function(e,t,n,r,i,o){return typeof i=="function"||Array.isArray(i)?this.set(t,Jn(this.pick(e,n,!0),i),r,o):(o=i,this.set(t,this.pick(e,n,!0),r,o)),r};G.prototype.copy=function(e,t,n,r,i,o){return typeof i=="function"||Array.isArray(i)?this.set(t,Jn(JSON.parse(JSON.stringify(this.pick(e,n,!1))),i),r,o):(o=i,this.set(t,this.pick(e,n,!1),r,o)),r};G.prototype.set=function(e,t,n,r){var i,o,s,a;if(typeof t>"u")return n;for(s=aa(e,this.separator),i=0;i<s.length;i++){if(a=s[i],i===s.length-1)if(r&&Bo(t)&&Bo(n[a]))for(o in t)ep.call(t,o)&&(n[a][o]=t[o]);else if(r&&Array.isArray(n[a])&&Array.isArray(t))for(var l=0;l<t.length;l++)n[s[i]].push(t[l]);else n[a]=t;else(!ep.call(n,a)||!Bo(n[a])&&!Array.isArray(n[a]))&&(/^\d+$/.test(s[i+1])?n[a]=[]:n[a]={});n=n[a]}return n};G.prototype.transform=function(e,t,n){return t=t||{},n=n||{},Object.keys(e).forEach((function(r){this.set(e[r],this.pick(r,t),n)}).bind(this)),n};G.prototype.dot=function(e,t,n){t=t||{},n=n||[];var r=Array.isArray(e);return Object.keys(e).forEach((function(i){var o=r&&this.useBrackets?"["+i+"]":i;if(si(e[i])&&(Bo(e[i])&&!Lo(e[i])||Array.isArray(e[i])&&!this.keepArray&&e[i].length!==0))if(r&&this.useBrackets){var s=n[n.length-1]||"";return this.dot(e[i],t,n.slice(0,-1).concat(s+o))}else return this.dot(e[i],t,n.concat(o));else r&&this.useBrackets?t[n.join(this.separator).concat("["+i+"]")]=e[i]:t[n.concat(o).join(this.separator)]=e[i]}).bind(this)),t};G.pick=Tt("pick");G.move=Tt("move");G.transfer=Tt("transfer");G.transform=Tt("transform");G.copy=Tt("copy");G.object=Tt("object");G.str=Tt("str");G.set=Tt("set");G.delete=Tt("delete");G.del=G.remove=Tt("remove");G.dot=Tt("dot");["override","overwrite"].forEach(function(e){Object.defineProperty(G,e,{get:function(){return Dr.override},set:function(t){Dr.override=!!t}})});["useArray","keepArray","useBrackets"].forEach(function(e){Object.defineProperty(G,e,{get:function(){return Dr[e]},set:function(t){Dr[e]=t}})});G._process=Jn;var rR=G;const Mv={"message-input-label":"Benutzereingabe","message-input-placeholder":"Nachricht","message-input.actions.submit.label":"Nachricht senden","message-input.actions.export-transcript.label":"Konversation per E-Mail erhalten","message-input.actions.start-audio-recording.label":"Spracheingabe starten","message-input.actions.stop-audio-recording.label":"Spracheingabe stoppen","message-input.actions.submit-audio-recording.label":"Spracheingabe übermitteln","guest-bubble.label":"Ihre Nachricht","bot-bubble.label":"Nachricht des Chatbots","agent-bubble.label":"Nachricht des Live-Agenten","export-transcript.email.title":"Konversation per E-Mail versenden","export-transcript.email.description":"Geben Sie Ihre E-Mail-Adresse ein, um den Chatverlauf zu erhalten.","export-transcript.email.cancel":"Abbrechen","export-transcript.email.send":"Senden","export-transcript.email.placeholder":"Ihre E-Mail-Adresse","export-transcript.email.invalid":"Bitte gültige E-Mail-Adresse eingeben.","export-transcript.email.success":"Ich habe den Chatverlauf an Ihre E-Mail-Adresse gesendet.","export-transcript.pdf.title":"Konversation als PDF erhalten","export-transcript.pdf.description":"Laden Sie die Konversation als PDF herunter.","export-transcript.pdf.cancel":"Abbrechen","export-transcript.pdf.download":"Herunterladen","general-conditions.header":"**Nutzungsbedingungen**","general-conditions.body":`Bitte berücksichtigen Sie die folgenden Punkte:
|
|
99
99
|
|
|
100
100
|
- Der Chatverlauf wird im EU-Raum gespeichert und kann nur von autorisierten Personen eingesehen werden.
|
|
101
|
-
- 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.","problem-report.action.mark":"Als fehlerhaft markieren","problem-report.action.unmark":"Markierung entfernen","block-user-input.title":"Bitte auf die Antwort des Chatbots warten.","conversation-rating.call-to-action.title":"Bewerten Sie diesen Chat","conversation-rating.overlay.title":"Wie zufrieden sind Sie mit diesem Chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Feedback bitte hier eingeben (optional)","conversation-rating.overlay.star.very-bad":"Sehr schlecht","conversation-rating.overlay.star.very-good":"Sehr gut","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"Durchschnitt ist nicht mein Ziel, was kann ich noch verbessern?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Knapp daneben ist auch vorbei. Was kann ich noch verbessern, um das nächste Mal alle Sterne zu erreichen?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfekt! Dann hoffe ich, dass ich Sie wieder einmal so gut beraten kann.","conversation-rating.overlay.bot-message.submit-feedback":"Vielen Dank für die Rückmeldung. Ich bin bestrebt, mich ständig zu verbessern.","conversation-rating.overlay.action.submit":"Bewertung senden","conversation-rating.overlay.action.close":"Zurück zum Chat","start-screen.intro":"","start-screen.start-chat":"Chat starten"},
|
|
101
|
+
- 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.","problem-report.action.mark":"Als fehlerhaft markieren","problem-report.action.unmark":"Markierung entfernen","block-user-input.title":"Bitte auf die Antwort des Chatbots warten.","conversation-rating.call-to-action.title":"Bewerten Sie diesen Chat","conversation-rating.overlay.title":"Wie zufrieden sind Sie mit diesem Chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Feedback bitte hier eingeben (optional)","conversation-rating.overlay.star.very-bad":"Sehr schlecht","conversation-rating.overlay.star.very-good":"Sehr gut","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"Durchschnitt ist nicht mein Ziel, was kann ich noch verbessern?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Knapp daneben ist auch vorbei. Was kann ich noch verbessern, um das nächste Mal alle Sterne zu erreichen?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfekt! Dann hoffe ich, dass ich Sie wieder einmal so gut beraten kann.","conversation-rating.overlay.bot-message.submit-feedback":"Vielen Dank für die Rückmeldung. Ich bin bestrebt, mich ständig zu verbessern.","conversation-rating.overlay.action.submit":"Bewertung senden","conversation-rating.overlay.action.close":"Zurück zum Chat","start-screen.intro":"","start-screen.start-chat":"Chat starten"},iR={"message-input-label":"User input","message-input-placeholder":"Message","message-input.actions.submit.label":"Send message","message-input.actions.export-transcript.label":"Receive conversation by email","message-input.actions.start-audio-recording.label":"Start voice input","message-input.actions.stop-audio-recording.label":"Stop voice input","message-input.actions.submit-audio-recording.label":"Transmit voice input","guest-bubble.label":"Your message","bot-bubble.label":"Message from the chatbot","agent-bubble.label":"Message from the live agent","export-transcript.email.title":"Receive Conversation","export-transcript.email.description":"Enter your email address to receive the chat history.","export-transcript.email.cancel":"Cancel","export-transcript.email.send":"Send","export-transcript.email.placeholder":"Your email address","export-transcript.email.invalid":"Please enter a valid e-mail address.","export-transcript.email.success":"I have sent the chat history to your email address.","export-transcript.pdf.title":"Get conversation as PDF","export-transcript.pdf.description":"Download this conversation as PDF.","export-transcript.pdf.cancel":"Cancel","export-transcript.pdf.download":"Download","general-conditions.header":"**Terms of use**","general-conditions.body":`Please consider the following points:
|
|
102
102
|
|
|
103
103
|
- The chat history is stored in the EU area and can only be viewed by authorized personnel.
|
|
104
|
-
- Do not enter any personal information in the chat window (passwords, date of birth, etc.)`,"general-conditions.accept-conditions-note":"By using the chat you agree to the terms of use.","problem-report.action.mark":"Mark as incorrect","problem-report.action.unmark":"Remove marker","block-user-input.title":"Please wait for the chatbot's response.","conversation-rating.call-to-action.title":"Rate this chat","conversation-rating.overlay.title":"How satisfied are you with this chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Please enter feedback here (optional)","conversation-rating.overlay.star.very-bad":"Very bad","conversation-rating.overlay.star.very-good":"Very good","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, that doesn't sound good. Please give me some feedback so that I can learn more.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, that doesn't sound good. Please give me some feedback so that I can learn more.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"Average is not my goal, what can I still improve?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Just missed is also over. What can I improve to achieve all stars next time?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfect! Then I hope that I can once again advise you so well.","conversation-rating.overlay.bot-message.submit-feedback":"Thank you for the feedback. I am constantly striving to improve.","conversation-rating.overlay.action.submit":"Send rating","conversation-rating.overlay.action.close":"Close","start-screen.intro":"","start-screen.start-chat":"Start chat"},
|
|
104
|
+
- Do not enter any personal information in the chat window (passwords, date of birth, etc.)`,"general-conditions.accept-conditions-note":"By using the chat you agree to the terms of use.","problem-report.action.mark":"Mark as incorrect","problem-report.action.unmark":"Remove marker","block-user-input.title":"Please wait for the chatbot's response.","conversation-rating.call-to-action.title":"Rate this chat","conversation-rating.overlay.title":"How satisfied are you with this chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Please enter feedback here (optional)","conversation-rating.overlay.star.very-bad":"Very bad","conversation-rating.overlay.star.very-good":"Very good","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, that doesn't sound good. Please give me some feedback so that I can learn more.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, that doesn't sound good. Please give me some feedback so that I can learn more.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"Average is not my goal, what can I still improve?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Just missed is also over. What can I improve to achieve all stars next time?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfect! Then I hope that I can once again advise you so well.","conversation-rating.overlay.bot-message.submit-feedback":"Thank you for the feedback. I am constantly striving to improve.","conversation-rating.overlay.action.submit":"Send rating","conversation-rating.overlay.action.close":"Close","start-screen.intro":"","start-screen.start-chat":"Start chat"},oR={"message-input-label":"Input dell'utente","message-input-placeholder":"Entrée utilisateur","message-input.actions.submit.label":"Envoyer un message","message-input.actions.export-transcript.label":"Recevoir la conversation par courrier électronique","message-input.actions.start-audio-recording.label":"Démarrer la saisie vocale","message-input.actions.stop-audio-recording.label":"Arrêt de la saisie vocale","message-input.actions.submit-audio-recording.label":"Transmettre une entrée vocale","guest-bubble.label":"Votre message","bot-bubble.label":"Message du chatbot","agent-bubble.label":"Message de l'agent en direct","export-transcript.email.title":"Recevoir conversation","export-transcript.email.description":"Entrez votre adresse électronique pour recevoir l'historique du chat.","export-transcript.email.cancel":"Annuler","export-transcript.email.send":"Envoyer","export-transcript.email.placeholder":"Votre adresse électronique","export-transcript.email.invalid":"Veuillez entrer une adresse électronique valide.","export-transcript.email.success":"J'ai envoyé l'historique du chat à votre adresse électronique.","export-transcript.pdf.title":"Recevoir la conversation en PDF","export-transcript.pdf.description":"Téléchargez la conversation en format PDF.","export-transcript.pdf.cancel":"Annuler","export-transcript.pdf.download":"Télécharger","general-conditions.header":"**Conditions d'utilisation**","general-conditions.body":`Veuillez considérer les points suivants:
|
|
105
105
|
|
|
106
106
|
- L'historique du chat est stocké dans l'espace UE et ne peut être consulté que par les personnes autorisées.
|
|
107
|
-
- Ne saisissez aucune information personnelle dans la fenêtre de chat (mots de passe, date de naissance, etc.).`,"general-conditions.accept-conditions-note":"En utilisant le chat, vous acceptez les conditions d'utilisation.","problem-report.action.mark":"Marquer comme incorrect","problem-report.action.unmark":"Retirer le marqueur","block-user-input.title":"Veuillez attendre la réponse du chatbot.","conversation-rating.call-to-action.title":"Notez ce chat","conversation-rating.overlay.title":"Dans quelle mesure êtes-vous satisfait de ce chat ?","conversation-rating.overlay.guest-feedback.input-placeholder":"Veuillez saisir vos commentaires ici (facultatif)","conversation-rating.overlay.star.very-bad":"Très mauvais","conversation-rating.overlay.star.very-good":"Très bien","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, ça ne sonne pas bien. Merci de me donner un feedback pour que je puisse en apprendre davantage.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, ça ne sonne pas bien. Merci de me donner un feedback pour que je puisse en apprendre davantage.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"La moyenne n'est pas mon objectif, que puis-je encore améliorer ?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Le rater de peu, c'est le rater aussi. Que puis-je encore améliorer pour obtenir toutes les étoiles la prochaine fois ?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Parfait ! Alors j'espère pouvoir vous conseiller aussi bien une fois de plus.","conversation-rating.overlay.bot-message.submit-feedback":"Merci beaucoup pour votre feed-back. Je m'efforce de m'améliorer en permanence.","conversation-rating.overlay.action.submit":"Envoyer","conversation-rating.overlay.action.close":"Fermer","start-screen.intro":"","start-screen.start-chat":"Démarrer le chat"},
|
|
107
|
+
- Ne saisissez aucune information personnelle dans la fenêtre de chat (mots de passe, date de naissance, etc.).`,"general-conditions.accept-conditions-note":"En utilisant le chat, vous acceptez les conditions d'utilisation.","problem-report.action.mark":"Marquer comme incorrect","problem-report.action.unmark":"Retirer le marqueur","block-user-input.title":"Veuillez attendre la réponse du chatbot.","conversation-rating.call-to-action.title":"Notez ce chat","conversation-rating.overlay.title":"Dans quelle mesure êtes-vous satisfait de ce chat ?","conversation-rating.overlay.guest-feedback.input-placeholder":"Veuillez saisir vos commentaires ici (facultatif)","conversation-rating.overlay.star.very-bad":"Très mauvais","conversation-rating.overlay.star.very-good":"Très bien","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, ça ne sonne pas bien. Merci de me donner un feedback pour que je puisse en apprendre davantage.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, ça ne sonne pas bien. Merci de me donner un feedback pour que je puisse en apprendre davantage.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"La moyenne n'est pas mon objectif, que puis-je encore améliorer ?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Le rater de peu, c'est le rater aussi. Que puis-je encore améliorer pour obtenir toutes les étoiles la prochaine fois ?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Parfait ! Alors j'espère pouvoir vous conseiller aussi bien une fois de plus.","conversation-rating.overlay.bot-message.submit-feedback":"Merci beaucoup pour votre feed-back. Je m'efforce de m'améliorer en permanence.","conversation-rating.overlay.action.submit":"Envoyer","conversation-rating.overlay.action.close":"Fermer","start-screen.intro":"","start-screen.start-chat":"Démarrer le chat"},sR={"message-input-label":"Input dell'utente","message-input-placeholder":"Messaggio","message-input.actions.submit.label":"Invia messaggio","message-input.actions.export-transcript.label":"Ricevere la conversazione via e-mail","message-input.actions.start-audio-recording.label":"Avviare l'input vocale","message-input.actions.stop-audio-recording.label":"Interrompere l'input vocale","message-input.actions.submit-audio-recording.label":"Trasmettere l'input vocale","guest-bubble.label":"Il tuo messaggio","bot-bubble.label":"Messaggio del chatbot","agent-bubble.label":"Messaggio dell'agente dal vivo","export-transcript.email.title":"Ricevere la conversazione","export-transcript.email.description":"Inserisci il tuo indirizzo e-mail per ricevere la cronologia della chat.","export-transcript.email.cancel":"Annulla","export-transcript.email.send":"Invia","export-transcript.email.placeholder":"Il tuo indirizzo e-mail","export-transcript.email.invalid":"Inserire un indirizzo e-mail valido.","export-transcript.email.success":"Ho inviato la cronologia della chat al vostro indirizzo e-mail.","export-transcript.pdf.title":"Ricevi la conversazione come PDF","export-transcript.pdf.description":"Scarica questa conversazione in PDF.","export-transcript.pdf.cancel":"Annulla","export-transcript.pdf.download":"Scaricare","general-conditions.header":"**Condizioni di utilizzo**","general-conditions.body":`Si prega di considerare i seguenti punti:
|
|
108
108
|
|
|
109
109
|
- La cronologia delle chat è memorizzata nell'area UE e può essere visualizzata solo da persone autorizzate.
|
|
110
|
-
- 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.","problem-report.action.mark":"Segna come errato","problem-report.action.unmark":"Rimuovere il marcatore","block-user-input.title":"Attendere la risposta del chatbot.","conversation-rating.call-to-action.title":"Valuta questa chat","conversation-rating.overlay.title":"Quanto sei soddisfatto di questa chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Inserisci qui il tuo feedback (opzionale)","conversation-rating.overlay.star.very-bad":"Molto male","conversation-rating.overlay.star.very-good":"Molto buono","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"La media non è il mio obiettivo, cosa posso ancora migliorare?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Anche l'assenza è finita. Cosa posso migliorare per ottenere tutte le stelle la prossima volta?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfetto! Allora spero di potervi consigliare ancora una volta bene.","conversation-rating.overlay.bot-message.submit-feedback":"Grazie mille per il feedback. Mi impegno costantemente per migliorare.","conversation-rating.overlay.action.submit":"Invia","conversation-rating.overlay.action.close":"Chiudere","start-screen.intro":"","start-screen.start-chat":"Avviare la chat"},sR=["de","en","fr","it"],Bv={locale:"de",messages:Mv},aR=(e,t)=>{if(sR.includes(e)){const n=lR(e),r=nR.dot(t);return{...n,...r}}return t},lR=e=>{switch(e.toString()){case"en":return rR;case"fr":return iR;case"it":return oR;default:return Mv}},uR=(e=cR,t)=>{switch(t.type){case af:return Object.assign({},e,{connectionState:jn.CONNECTING});case lf:return Object.assign({},e,{connectionState:jn.CONNECTED});case uf:return Object.assign({},e,{connectionState:jn.DISCONNECTED});case cf:return Object.assign({},e,{connectionState:jn.RECONNECTED});case ff:return Object.assign({},e,{sessionId:t.sessionId});case df:return Object.assign({},e,{sessionId:t.payload.sessionId,userId:t.payload.userId});case hf:return Object.assign({},e,{sessionId:void 0});default:return e}},cR={connectionState:jn.DISCONNECTED,sessionId:void 0,userId:void 0},fR=(e=np,t)=>{switch(t.type){case Jy:return np;case z.ActionTypes.TYPING_ON:return Object.assign({},e,{isBotTyping:!0});case z.ActionTypes.TYPING_OFF:return Object.assign({},e,{isBotTyping:!1});case z.ActionTypes.MESSAGE_FROM_GUEST:case z.ActionTypes.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return tp(e,t.message);case z.ActionTypes.MESSAGE_TO_GUEST:vo(t);const n=Object.assign({},t.message,{_id:t.meta.actionId}),r=e.messages.filter(l=>l._id===t.meta.actionId).length>0;return Object.assign({},e,{isBotTyping:!1,messages:r?e.messages:e.messages.concat([n]),quickReplies:n.quickReplies?n.quickReplies:[]});case Xc:{const l=t.messages,u=l.length?l[l.length-1]:void 0;return Object.assign({},e,{isBotTyping:!1,messages:l,quickReplies:(u==null?void 0:u.quickReplies)||[]})}case qc:return vo(t.message),e;case z.ActionTypes.EVENT_TO_GUEST:return vo(t.event),e;case Dy:return vo(t),e;case Kc:return Object.assign({},e,{speechSupport:!0});case Yc:return Object.assign({},e,{problemReportingEnabled:!0});case Jc:const i=new z.TextMessage(t.transcription,new z.GuestUser),o=Object.assign({},i,{_id:crypto.randomUUID()});return tp(e,o);case Zc:return Object.assign({},e,{transcriptExportEnabled:t.methods});case ef:return Object.assign({},e,{showGeneralConditions:!0});case z.ActionTypes.PROBLEM_REPORT_FROM_GUEST:const s=e.messages.map(l=>l._id===t.payload.actionId?Object.assign({},l,{problemReport:t.payload.problem}):l);return Object.assign({},e,{messages:s});case tf:const a={enabled:!0,rating:t.payload.rating};return Object.assign({},e,{conversationRating:a});case z.ActionTypes.CONVERSATION_RATING_FROM_GUEST:{const l={...e.conversationRating,rating:t.payload};return Object.assign({},e,{conversationRating:l})}default:return e}},tp=(e,t)=>{const n=e.messages[e.messages.length-1],r=(n==null?void 0:n.text)===t.text;return n&&n.sender.type===t.sender.type&&r?e:Object.assign({},e,{messages:e.messages.concat([t]),quickReplies:[]})},vo=e=>{var t;dR()?(t=window.top)==null||t.postMessage(e,"*"):e.type==="webclient.change.url"&&window.open(e.url)},dR=()=>typeof window<"u"&&window.self!==window.top,np={messages:[],quickReplies:[],isBotTyping:!1,speechSupport:!1,problemReportingEnabled:!1,transcriptExportEnabled:{pdf:!1,email:!1},showGeneralConditions:!1,conversationRating:{enabled:!1}},Lv=Yy({name:"intl",initialState:Bv,reducers:{updateIntl:(e,t)=>{e.locale=t.payload.language,e.messages=t.payload.messages}}}),{updateIntl:hR}=Lv.actions,pR=Lv.reducer,mR=jy({chat:fR,startScreen:vx,connection:uR,intl:pR}),jv="bf-webclient-state-last-saved-at",Uv="bf-webclient-state",gR=e=>{try{if(!_R())return;const t=rp(e,jv);if(vR(t))return;{const n=rp(e,Uv);return n===null?void 0:JSON.parse(n)}}catch(t){console.error(t);return}},yR=(e,t)=>{try{const n=JSON.stringify(t);ip(e,Uv,n);let r=new Date().toISOString();ip(e,jv,r)}catch(n){console.error(n)}},vR=e=>{if(e===null)return!1;let t=new Date(e);return t.setHours(t.getHours()+12),new Date>t},_R=()=>typeof localStorage<"u",rp=(e,t)=>localStorage.getItem(`${e}_${t}`),ip=(e,t,n)=>localStorage.setItem(`${e}_${t}`,n),Ut=Object.create(null);Ut.open="0";Ut.close="1";Ut.ping="2";Ut.pong="3";Ut.message="4";Ut.upgrade="5";Ut.noop="6";const jo=Object.create(null);Object.keys(Ut).forEach(e=>{jo[Ut[e]]=e});const Su={type:"error",data:"parser error"},zv=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",$v=typeof ArrayBuffer=="function",Hv=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,bf=({type:e,data:t},n,r)=>zv&&t instanceof Blob?n?r(t):op(t,r):$v&&(t instanceof ArrayBuffer||Hv(t))?n?r(t):op(new Blob([t]),r):r(Ut[e]+(t||"")),op=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function sp(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let tl;function ER(e,t){if(zv&&e.data instanceof Blob)return e.data.arrayBuffer().then(sp).then(t);if($v&&(e.data instanceof ArrayBuffer||Hv(e.data)))return t(sp(e.data));bf(e,!1,n=>{tl||(tl=new TextEncoder),t(tl.encode(n))})}const ap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ai=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<ap.length;e++)ai[ap.charCodeAt(e)]=e;const SR=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)o=ai[e.charCodeAt(r)],s=ai[e.charCodeAt(r+1)],a=ai[e.charCodeAt(r+2)],l=ai[e.charCodeAt(r+3)],c[i++]=o<<2|s>>4,c[i++]=(s&15)<<4|a>>2,c[i++]=(a&3)<<6|l&63;return u},wR=typeof ArrayBuffer=="function",xf=(e,t)=>{if(typeof e!="string")return{type:"message",data:Gv(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:bR(e.substring(1),t)}:jo[n]?e.length>1?{type:jo[n],data:e.substring(1)}:{type:jo[n]}:Su},bR=(e,t)=>{if(wR){const n=SR(e);return Gv(n,t)}else return{base64:!0,data:e}},Gv=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Vv="",xR=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{bf(o,!1,a=>{r[s]=a,++i===n&&t(r.join(Vv))})})},TR=(e,t)=>{const n=e.split(Vv),r=[];for(let i=0;i<n.length;i++){const o=xf(n[i],t);if(r.push(o),o.type==="error")break}return r};function CR(){return new TransformStream({transform(e,t){ER(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let nl;function _o(e){return e.reduce((t,n)=>t+n.length,0)}function Eo(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function kR(e,t){nl||(nl=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(_o(n)<1)break;const l=Eo(n,1);o=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(_o(n)<2)break;const l=Eo(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(_o(n)<8)break;const l=Eo(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,21)-1){a.enqueue(Su);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(_o(n)<i)break;const l=Eo(n,i);a.enqueue(xf(o?l:nl.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(Su);break}}}})}const Wv=4;function de(e){if(e)return OR(e)}function OR(e){for(var t in de.prototype)e[t]=de.prototype[t];return e}de.prototype.on=de.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};de.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};de.prototype.off=de.prototype.removeListener=de.prototype.removeAllListeners=de.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};de.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};de.prototype.emitReserved=de.prototype.emit;de.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};de.prototype.hasListeners=function(e){return!!this.listeners(e).length};const tt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function qv(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const NR=tt.setTimeout,RR=tt.clearTimeout;function la(e,t){t.useNativeTimers?(e.setTimeoutFn=NR.bind(tt),e.clearTimeoutFn=RR.bind(tt)):(e.setTimeoutFn=tt.setTimeout.bind(tt),e.clearTimeoutFn=tt.clearTimeout.bind(tt))}const AR=1.33;function PR(e){return typeof e=="string"?IR(e):Math.ceil((e.byteLength||e.size)*AR)}function IR(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function DR(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function FR(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class MR extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Tf extends de{constructor(t){super(),this.writable=!1,la(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new MR(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=xf(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=DR(t);return n.length?"?"+n:""}}const Xv="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),wu=64,BR={};let lp=0,So=0,up;function cp(e){let t="";do t=Xv[e%wu]+t,e=Math.floor(e/wu);while(e>0);return t}function Qv(){const e=cp(+new Date);return e!==up?(lp=0,up=e):e+"."+cp(lp++)}for(;So<wu;So++)BR[Xv[So]]=So;let Kv=!1;try{Kv=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const LR=Kv;function Yv(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||LR))return new XMLHttpRequest}catch{}if(!t)try{return new tt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function jR(){}const UR=function(){return new Yv({xdomain:!1}).responseType!=null}();class zR extends Tf{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=UR&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};TR(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,xR(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Qv()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Lt(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Lt extends de{constructor(t,n){super(),la(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=qv(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new Yv(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Lt.requestsCount++,Lt.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=jR,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Lt.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Lt.requestsCount=0;Lt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",fp);else if(typeof addEventListener=="function"){const e="onpagehide"in tt?"pagehide":"unload";addEventListener(e,fp,!1)}}function fp(){for(let e in Lt.requests)Lt.requests.hasOwnProperty(e)&&Lt.requests[e].abort()}const Cf=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),wo=tt.WebSocket||tt.MozWebSocket,dp=!0,$R="arraybuffer",hp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class HR extends Tf{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=hp?{}:qv(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=dp&&!hp?n?new wo(t,n):new wo(t):new wo(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;bf(r,this.supportsBinary,o=>{const s={};try{dp&&this.ws.send(o)}catch{}i&&Cf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Qv()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!wo}}class GR extends Tf{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=kR(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=CR();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),o())}).catch(a=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&Cf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const VR={websocket:HR,webtransport:GR,polling:zR},WR=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,qR=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function bu(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=WR.exec(e||""),o={},s=14;for(;s--;)o[qR[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=XR(o,o.path),o.queryKey=QR(o,o.query),o}function XR(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function QR(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let Zv=class or extends de{constructor(t,n={}){super(),this.binaryType=$R,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=bu(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=bu(n.host).host),la(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,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},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=FR(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(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"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Wv,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new VR[t](r)}open(){let t;if(this.opts.rememberUpgrade&&or.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;or.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;or.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const y=new Error("probe error");y.transport=n.name,this.emitReserved("upgradeError",y)}}))};function o(){r||(r=!0,c(),n.close(),n=null)}const s=p=>{const y=new Error("probe error: "+p);y.transport=n.name,o(),this.emitReserved("upgradeError",y)};function a(){s("transport closed")}function l(){s("socket closed")}function u(p){n&&p.name!==n.name&&o()}const c=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",or.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),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 t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=PR(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){or.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};Zv.protocol=Wv;function KR(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=bu(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const YR=typeof ArrayBuffer=="function",ZR=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Jv=Object.prototype.toString,JR=typeof Blob=="function"||typeof Blob<"u"&&Jv.call(Blob)==="[object BlobConstructor]",eA=typeof File=="function"||typeof File<"u"&&Jv.call(File)==="[object FileConstructor]";function kf(e){return YR&&(e instanceof ArrayBuffer||ZR(e))||JR&&e instanceof Blob||eA&&e instanceof File}function Uo(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Uo(e[n]))return!0;return!1}if(kf(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Uo(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Uo(e[n]))return!0;return!1}function tA(e){const t=[],n=e.data,r=e;return r.data=xu(n,t),r.attachments=t.length,{packet:r,buffers:t}}function xu(e,t){if(!e)return e;if(kf(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=xu(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=xu(e[r],t));return n}return e}function nA(e,t){return e.data=Tu(e.data,t),delete e.attachments,e}function Tu(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Tu(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Tu(e[n],t));return e}const rA=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],iA=5;var U;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(U||(U={}));class oA{constructor(t){this.replacer=t}encode(t){return(t.type===U.EVENT||t.type===U.ACK)&&Uo(t)?this.encodeAsBinary({type:t.type===U.EVENT?U.BINARY_EVENT:U.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===U.BINARY_EVENT||t.type===U.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=tA(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function pp(e){return Object.prototype.toString.call(e)==="[object Object]"}class Of extends de{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===U.BINARY_EVENT;r||n.type===U.BINARY_ACK?(n.type=r?U.EVENT:U.ACK,this.reconstructor=new sA(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(kf(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(U[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===U.BINARY_EVENT||r.type===U.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(o,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Of.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case U.CONNECT:return pp(n);case U.DISCONNECT:return n===void 0;case U.CONNECT_ERROR:return typeof n=="string"||pp(n);case U.EVENT:case U.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&rA.indexOf(n[0])===-1);case U.ACK:case U.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class sA{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=nA(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const aA=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Of,Encoder:oA,get PacketType(){return U},protocol:iA},Symbol.toStringTag,{value:"Module"}));function gt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const lA=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class e0 extends de{constructor(t,n,r){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=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[gt(t,"open",this.onopen.bind(this)),gt(t,"packet",this.onpacket.bind(this)),gt(t,"error",this.onerror.bind(this)),gt(t,"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(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(lA.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:U.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++,a=n.pop();this._registerAckCallback(s,a),r.id=s}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),s=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,i)=>{const o=(s,a)=>s?i(s):r(a);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:U.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case U.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 U.EVENT:case U.BINARY_EVENT:this.onevent(t);break;case U.ACK:case U.BINARY_ACK:this.onack(t);break;case U.DISCONNECT:this.ondisconnect();break;case U.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:U.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:U.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Lr(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Lr.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Lr.prototype.reset=function(){this.attempts=0};Lr.prototype.setMin=function(e){this.ms=e};Lr.prototype.setMax=function(e){this.max=e};Lr.prototype.setJitter=function(e){this.jitter=e};class Cu extends de{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,la(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Lr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||aA;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Zv(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=gt(n,"open",function(){r.onopen(),t&&t()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=gt(n,"error",o);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(gt(t,"ping",this.onping.bind(this)),gt(t,"data",this.ondata.bind(this)),gt(t,"error",this.onerror.bind(this)),gt(t,"close",this.onclose.bind(this)),gt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Cf(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new e0(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const ei={};function zo(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=KR(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=ei[i]&&o in ei[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new Cu(r,t):(ei[i]||(ei[i]=new Cu(r,t)),l=ei[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(zo,{Manager:Cu,Socket:e0,io:zo,connect:zo});const uA=[z.ActionTypes.MESSAGE_TO_GUEST,z.ActionTypes.EVENT_TO_GUEST,z.ActionTypes.TYPING_ON,z.ActionTypes.TYPING_OFF,z.ActionTypes.RESTART_CHAT_REQUEST,...Ex,...gb,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],cA=({dispatch:e,getState:t})=>n=>{let r=null;return i=>{let o=n(i);if(i.type===sf)r!=null&&r.disconnect(),e(bx()),r=zo(`/${i.clientName}/chat?${Mc.stringify(i.querystrings)}`),r.on("action",e),r.on("connect",()=>e(xx())),r.on("disconnect",()=>e(Tx())),r.on("reconnect",()=>e(Cx())),r.on("set-use-start-screen",s=>{e(s?px():mx())}),r.on("set-translations",(s,a)=>{e(hR({language:s,messages:aR(s,a)}))}),r.on("enable-speech-support",()=>e(vb())),r.on("enable-problem-reporting",()=>e(_b())),r.on("enable-transcript-export",s=>e(Sb(s))),r.on("enable-conversation-rating",s=>e(Tb(s))),r.on("speech-transcription",s=>e(Eb(s))),r.on("restore-client-state",s=>{e(wx(s.sessionId)),e(kb(s.messages))}),r.on("expand-window",({devices:s})=>e({type:Dy,devices:s})),r.on("show-general-conditions",()=>e(bb())),r.on("restart-chat",()=>{e(pf(i.clientName,i.querystrings))});else if(i.type===df)r==null||r.emit("start-chat",i.payload);else if(i.type===hf)r==null||r.emit("terminate-session",i.payload);else if(i.type===mb)r==null||r.emit("get-started",JSON.stringify(i));else if(i.type===Qc)r==null||r.emit("audio-message",i.buffer);else if(i.type===z.ActionTypes.CONVERSATION_RATING_FROM_GUEST)r==null||r.emit("conversation-rating",i.payload);else if(i.type===Fy){const{connection:{sessionId:s}}=t();window.location.href=`/transcript-pdf/${s}`}else uA.indexOf(i.type)===-1&&i.meta===void 0&&r&&r.emit("action",JSON.stringify(i));return o}},t0=yy(),fA={...gR(t0),intl:Bv},ku=tx({middleware:e=>e().concat(cA),reducer:mR,preloadedState:fA});ku.subscribe(YN(()=>{const e=ku.getState();yR(t0,{connection:e.connection,startScreen:e.startScreen})},1e3));const dA=document.getElementById("root"),hA=kg(dA);hA.render(_.jsx(FE,{store:ku,children:_.jsx(WO,{})}));
|
|
111
|
-
//# sourceMappingURL=index-
|
|
110
|
+
- 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.","problem-report.action.mark":"Segna come errato","problem-report.action.unmark":"Rimuovere il marcatore","block-user-input.title":"Attendere la risposta del chatbot.","conversation-rating.call-to-action.title":"Valuta questa chat","conversation-rating.overlay.title":"Quanto sei soddisfatto di questa chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Inserisci qui il tuo feedback (opzionale)","conversation-rating.overlay.star.very-bad":"Molto male","conversation-rating.overlay.star.very-good":"Molto buono","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"La media non è il mio obiettivo, cosa posso ancora migliorare?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Anche l'assenza è finita. Cosa posso migliorare per ottenere tutte le stelle la prossima volta?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfetto! Allora spero di potervi consigliare ancora una volta bene.","conversation-rating.overlay.bot-message.submit-feedback":"Grazie mille per il feedback. Mi impegno costantemente per migliorare.","conversation-rating.overlay.action.submit":"Invia","conversation-rating.overlay.action.close":"Chiudere","start-screen.intro":"","start-screen.start-chat":"Avviare la chat"},aR=["de","en","fr","it"],Bv={locale:"de",messages:Mv},lR=(e,t)=>{if(aR.includes(e)){const n=uR(e),r=rR.dot(t);return{...n,...r}}return t},uR=e=>{switch(e.toString()){case"en":return iR;case"fr":return oR;case"it":return sR;default:return Mv}},cR=(e=fR,t)=>{switch(t.type){case af:return Object.assign({},e,{connectionState:jn.CONNECTING});case lf:return Object.assign({},e,{connectionState:jn.CONNECTED});case uf:return Object.assign({},e,{connectionState:jn.DISCONNECTED});case cf:return Object.assign({},e,{connectionState:jn.RECONNECTED});case ff:return Object.assign({},e,{sessionId:t.sessionId});case df:return Object.assign({},e,{sessionId:t.payload.sessionId,userId:t.payload.userId});case hf:return Object.assign({},e,{sessionId:void 0});default:return e}},fR={connectionState:jn.DISCONNECTED,sessionId:void 0,userId:void 0},dR=(e=np,t)=>{switch(t.type){case Jy:return np;case z.ActionTypes.TYPING_ON:return Object.assign({},e,{isBotTyping:!0});case z.ActionTypes.TYPING_OFF:return Object.assign({},e,{isBotTyping:!1});case z.ActionTypes.MESSAGE_FROM_GUEST:case z.ActionTypes.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return tp(e,t.message);case z.ActionTypes.MESSAGE_TO_GUEST:vo(t);const n=Object.assign({},t.message,{_id:t.meta.actionId}),r=e.messages.filter(l=>l._id===t.meta.actionId).length>0;return Object.assign({},e,{isBotTyping:!1,messages:r?e.messages:e.messages.concat([n]),quickReplies:n.quickReplies?n.quickReplies:[]});case Xc:{const l=t.messages,u=l.length?l[l.length-1]:void 0;return Object.assign({},e,{isBotTyping:!1,messages:l,quickReplies:(u==null?void 0:u.quickReplies)||[]})}case qc:return vo(t.message),e;case z.ActionTypes.EVENT_TO_GUEST:return vo(t.event),e;case Dy:return vo(t),e;case Kc:return Object.assign({},e,{speechSupport:!0});case Yc:return Object.assign({},e,{problemReportingEnabled:!0});case Jc:const i=new z.TextMessage(t.transcription,new z.GuestUser),o=Object.assign({},i,{_id:crypto.randomUUID()});return tp(e,o);case Zc:return Object.assign({},e,{transcriptExportEnabled:t.methods});case ef:return Object.assign({},e,{showGeneralConditions:!0});case z.ActionTypes.PROBLEM_REPORT_FROM_GUEST:const s=e.messages.map(l=>l._id===t.payload.actionId?Object.assign({},l,{problemReport:t.payload.problem}):l);return Object.assign({},e,{messages:s});case tf:const a={enabled:!0,rating:t.payload.rating};return Object.assign({},e,{conversationRating:a});case z.ActionTypes.CONVERSATION_RATING_FROM_GUEST:{const l={...e.conversationRating,rating:t.payload};return Object.assign({},e,{conversationRating:l})}default:return e}},tp=(e,t)=>{const n=e.messages[e.messages.length-1],r=(n==null?void 0:n.text)===t.text;return n&&n.sender.type===t.sender.type&&r?e:Object.assign({},e,{messages:e.messages.concat([t]),quickReplies:[]})},vo=e=>{var t;hR()?(t=window.top)==null||t.postMessage(e,"*"):e.type==="webclient.change.url"&&window.open(e.url)},hR=()=>typeof window<"u"&&window.self!==window.top,np={messages:[],quickReplies:[],isBotTyping:!1,speechSupport:!1,problemReportingEnabled:!1,transcriptExportEnabled:{pdf:!1,email:!1},showGeneralConditions:!1,conversationRating:{enabled:!1}},Lv=Yy({name:"intl",initialState:Bv,reducers:{updateIntl:(e,t)=>{e.locale=t.payload.language,e.messages=t.payload.messages}}}),{updateIntl:pR}=Lv.actions,mR=Lv.reducer,gR=jy({chat:dR,startScreen:vx,connection:cR,intl:mR}),jv="bf-webclient-state-last-saved-at",Uv="bf-webclient-state",yR=e=>{try{if(!ER())return;const t=rp(e,jv);if(_R(t))return;{const n=rp(e,Uv);return n===null?void 0:JSON.parse(n)}}catch(t){console.error(t);return}},vR=(e,t)=>{try{const n=JSON.stringify(t);ip(e,Uv,n);let r=new Date().toISOString();ip(e,jv,r)}catch(n){console.error(n)}},_R=e=>{if(e===null)return!1;let t=new Date(e);return t.setHours(t.getHours()+12),new Date>t},ER=()=>typeof localStorage<"u",rp=(e,t)=>localStorage.getItem(`${e}_${t}`),ip=(e,t,n)=>localStorage.setItem(`${e}_${t}`,n),Ut=Object.create(null);Ut.open="0";Ut.close="1";Ut.ping="2";Ut.pong="3";Ut.message="4";Ut.upgrade="5";Ut.noop="6";const jo=Object.create(null);Object.keys(Ut).forEach(e=>{jo[Ut[e]]=e});const Su={type:"error",data:"parser error"},zv=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",$v=typeof ArrayBuffer=="function",Hv=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,bf=({type:e,data:t},n,r)=>zv&&t instanceof Blob?n?r(t):op(t,r):$v&&(t instanceof ArrayBuffer||Hv(t))?n?r(t):op(new Blob([t]),r):r(Ut[e]+(t||"")),op=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function sp(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let tl;function SR(e,t){if(zv&&e.data instanceof Blob)return e.data.arrayBuffer().then(sp).then(t);if($v&&(e.data instanceof ArrayBuffer||Hv(e.data)))return t(sp(e.data));bf(e,!1,n=>{tl||(tl=new TextEncoder),t(tl.encode(n))})}const ap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ai=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<ap.length;e++)ai[ap.charCodeAt(e)]=e;const wR=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)o=ai[e.charCodeAt(r)],s=ai[e.charCodeAt(r+1)],a=ai[e.charCodeAt(r+2)],l=ai[e.charCodeAt(r+3)],c[i++]=o<<2|s>>4,c[i++]=(s&15)<<4|a>>2,c[i++]=(a&3)<<6|l&63;return u},bR=typeof ArrayBuffer=="function",xf=(e,t)=>{if(typeof e!="string")return{type:"message",data:Gv(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:xR(e.substring(1),t)}:jo[n]?e.length>1?{type:jo[n],data:e.substring(1)}:{type:jo[n]}:Su},xR=(e,t)=>{if(bR){const n=wR(e);return Gv(n,t)}else return{base64:!0,data:e}},Gv=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Vv="",TR=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{bf(o,!1,a=>{r[s]=a,++i===n&&t(r.join(Vv))})})},CR=(e,t)=>{const n=e.split(Vv),r=[];for(let i=0;i<n.length;i++){const o=xf(n[i],t);if(r.push(o),o.type==="error")break}return r};function kR(){return new TransformStream({transform(e,t){SR(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let nl;function _o(e){return e.reduce((t,n)=>t+n.length,0)}function Eo(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function OR(e,t){nl||(nl=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(_o(n)<1)break;const l=Eo(n,1);o=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(_o(n)<2)break;const l=Eo(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(_o(n)<8)break;const l=Eo(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,21)-1){a.enqueue(Su);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(_o(n)<i)break;const l=Eo(n,i);a.enqueue(xf(o?l:nl.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(Su);break}}}})}const Wv=4;function de(e){if(e)return NR(e)}function NR(e){for(var t in de.prototype)e[t]=de.prototype[t];return e}de.prototype.on=de.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};de.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};de.prototype.off=de.prototype.removeListener=de.prototype.removeAllListeners=de.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};de.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};de.prototype.emitReserved=de.prototype.emit;de.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};de.prototype.hasListeners=function(e){return!!this.listeners(e).length};const tt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function qv(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const RR=tt.setTimeout,AR=tt.clearTimeout;function la(e,t){t.useNativeTimers?(e.setTimeoutFn=RR.bind(tt),e.clearTimeoutFn=AR.bind(tt)):(e.setTimeoutFn=tt.setTimeout.bind(tt),e.clearTimeoutFn=tt.clearTimeout.bind(tt))}const PR=1.33;function IR(e){return typeof e=="string"?DR(e):Math.ceil((e.byteLength||e.size)*PR)}function DR(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function FR(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function MR(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class BR extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Tf extends de{constructor(t){super(),this.writable=!1,la(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new BR(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=xf(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=FR(t);return n.length?"?"+n:""}}const Xv="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),wu=64,LR={};let lp=0,So=0,up;function cp(e){let t="";do t=Xv[e%wu]+t,e=Math.floor(e/wu);while(e>0);return t}function Qv(){const e=cp(+new Date);return e!==up?(lp=0,up=e):e+"."+cp(lp++)}for(;So<wu;So++)LR[Xv[So]]=So;let Kv=!1;try{Kv=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const jR=Kv;function Yv(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||jR))return new XMLHttpRequest}catch{}if(!t)try{return new tt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function UR(){}const zR=function(){return new Yv({xdomain:!1}).responseType!=null}();class $R extends Tf{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=zR&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};CR(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,TR(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Qv()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Lt(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Lt extends de{constructor(t,n){super(),la(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=qv(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new Yv(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Lt.requestsCount++,Lt.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=UR,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Lt.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Lt.requestsCount=0;Lt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",fp);else if(typeof addEventListener=="function"){const e="onpagehide"in tt?"pagehide":"unload";addEventListener(e,fp,!1)}}function fp(){for(let e in Lt.requests)Lt.requests.hasOwnProperty(e)&&Lt.requests[e].abort()}const Cf=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),wo=tt.WebSocket||tt.MozWebSocket,dp=!0,HR="arraybuffer",hp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class GR extends Tf{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=hp?{}:qv(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=dp&&!hp?n?new wo(t,n):new wo(t):new wo(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;bf(r,this.supportsBinary,o=>{const s={};try{dp&&this.ws.send(o)}catch{}i&&Cf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Qv()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!wo}}class VR extends Tf{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=OR(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=kR();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),o())}).catch(a=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&Cf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const WR={websocket:GR,webtransport:VR,polling:$R},qR=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,XR=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function bu(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=qR.exec(e||""),o={},s=14;for(;s--;)o[XR[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=QR(o,o.path),o.queryKey=KR(o,o.query),o}function QR(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function KR(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let Zv=class or extends de{constructor(t,n={}){super(),this.binaryType=HR,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=bu(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=bu(n.host).host),la(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,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},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=MR(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(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"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Wv,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new WR[t](r)}open(){let t;if(this.opts.rememberUpgrade&&or.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;or.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;or.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const y=new Error("probe error");y.transport=n.name,this.emitReserved("upgradeError",y)}}))};function o(){r||(r=!0,c(),n.close(),n=null)}const s=p=>{const y=new Error("probe error: "+p);y.transport=n.name,o(),this.emitReserved("upgradeError",y)};function a(){s("transport closed")}function l(){s("socket closed")}function u(p){n&&p.name!==n.name&&o()}const c=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",or.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),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 t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=IR(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){or.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};Zv.protocol=Wv;function YR(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=bu(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const ZR=typeof ArrayBuffer=="function",JR=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Jv=Object.prototype.toString,eA=typeof Blob=="function"||typeof Blob<"u"&&Jv.call(Blob)==="[object BlobConstructor]",tA=typeof File=="function"||typeof File<"u"&&Jv.call(File)==="[object FileConstructor]";function kf(e){return ZR&&(e instanceof ArrayBuffer||JR(e))||eA&&e instanceof Blob||tA&&e instanceof File}function Uo(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Uo(e[n]))return!0;return!1}if(kf(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Uo(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Uo(e[n]))return!0;return!1}function nA(e){const t=[],n=e.data,r=e;return r.data=xu(n,t),r.attachments=t.length,{packet:r,buffers:t}}function xu(e,t){if(!e)return e;if(kf(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=xu(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=xu(e[r],t));return n}return e}function rA(e,t){return e.data=Tu(e.data,t),delete e.attachments,e}function Tu(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Tu(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Tu(e[n],t));return e}const iA=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],oA=5;var U;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(U||(U={}));class sA{constructor(t){this.replacer=t}encode(t){return(t.type===U.EVENT||t.type===U.ACK)&&Uo(t)?this.encodeAsBinary({type:t.type===U.EVENT?U.BINARY_EVENT:U.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===U.BINARY_EVENT||t.type===U.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=nA(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function pp(e){return Object.prototype.toString.call(e)==="[object Object]"}class Of extends de{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===U.BINARY_EVENT;r||n.type===U.BINARY_ACK?(n.type=r?U.EVENT:U.ACK,this.reconstructor=new aA(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(kf(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(U[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===U.BINARY_EVENT||r.type===U.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(o,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Of.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case U.CONNECT:return pp(n);case U.DISCONNECT:return n===void 0;case U.CONNECT_ERROR:return typeof n=="string"||pp(n);case U.EVENT:case U.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&iA.indexOf(n[0])===-1);case U.ACK:case U.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class aA{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=rA(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const lA=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Of,Encoder:sA,get PacketType(){return U},protocol:oA},Symbol.toStringTag,{value:"Module"}));function gt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const uA=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class e0 extends de{constructor(t,n,r){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=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[gt(t,"open",this.onopen.bind(this)),gt(t,"packet",this.onpacket.bind(this)),gt(t,"error",this.onerror.bind(this)),gt(t,"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(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(uA.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:U.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++,a=n.pop();this._registerAckCallback(s,a),r.id=s}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),s=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,i)=>{const o=(s,a)=>s?i(s):r(a);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:U.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case U.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 U.EVENT:case U.BINARY_EVENT:this.onevent(t);break;case U.ACK:case U.BINARY_ACK:this.onack(t);break;case U.DISCONNECT:this.ondisconnect();break;case U.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:U.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:U.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Lr(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Lr.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Lr.prototype.reset=function(){this.attempts=0};Lr.prototype.setMin=function(e){this.ms=e};Lr.prototype.setMax=function(e){this.max=e};Lr.prototype.setJitter=function(e){this.jitter=e};class Cu extends de{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,la(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Lr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||lA;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Zv(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=gt(n,"open",function(){r.onopen(),t&&t()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=gt(n,"error",o);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(gt(t,"ping",this.onping.bind(this)),gt(t,"data",this.ondata.bind(this)),gt(t,"error",this.onerror.bind(this)),gt(t,"close",this.onclose.bind(this)),gt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Cf(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new e0(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const ei={};function zo(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=YR(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=ei[i]&&o in ei[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new Cu(r,t):(ei[i]||(ei[i]=new Cu(r,t)),l=ei[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(zo,{Manager:Cu,Socket:e0,io:zo,connect:zo});const cA=[z.ActionTypes.MESSAGE_TO_GUEST,z.ActionTypes.EVENT_TO_GUEST,z.ActionTypes.TYPING_ON,z.ActionTypes.TYPING_OFF,z.ActionTypes.RESTART_CHAT_REQUEST,...Ex,...gb,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],fA=({dispatch:e,getState:t})=>n=>{let r=null;return i=>{let o=n(i);if(i.type===sf)r!=null&&r.disconnect(),e(bx()),r=zo(`/${i.clientName}/chat?${Mc.stringify(i.querystrings)}`),r.on("action",e),r.on("connect",()=>e(xx())),r.on("disconnect",()=>e(Tx())),r.on("reconnect",()=>e(Cx())),r.on("set-use-start-screen",s=>{e(s?px():mx())}),r.on("set-translations",(s,a)=>{e(pR({language:s,messages:lR(s,a)}))}),r.on("enable-speech-support",()=>e(vb())),r.on("enable-problem-reporting",()=>e(_b())),r.on("enable-transcript-export",s=>e(Sb(s))),r.on("enable-conversation-rating",s=>e(Tb(s))),r.on("speech-transcription",s=>e(Eb(s))),r.on("restore-client-state",s=>{e(wx(s.sessionId)),e(kb(s.messages))}),r.on("expand-window",({devices:s})=>e({type:Dy,devices:s})),r.on("show-general-conditions",()=>e(bb())),r.on("restart-chat",()=>{e(pf(i.clientName,i.querystrings))});else if(i.type===df)r==null||r.emit("start-chat",i.payload);else if(i.type===hf)r==null||r.emit("terminate-session",i.payload);else if(i.type===mb)r==null||r.emit("get-started",JSON.stringify(i));else if(i.type===Qc)r==null||r.emit("audio-message",i.buffer);else if(i.type===z.ActionTypes.CONVERSATION_RATING_FROM_GUEST)r==null||r.emit("conversation-rating",i.payload);else if(i.type===Fy){const{connection:{sessionId:s}}=t();window.location.href=`/transcript-pdf/${s}`}else cA.indexOf(i.type)===-1&&i.meta===void 0&&r&&r.emit("action",JSON.stringify(i));return o}},t0=yy(),dA={...yR(t0),intl:Bv},ku=tx({middleware:e=>e().concat(fA),reducer:gR,preloadedState:dA});ku.subscribe(ZN(()=>{const e=ku.getState();vR(t0,{connection:e.connection,startScreen:e.startScreen})},1e3));const hA=document.getElementById("root"),pA=kg(hA);pA.render(_.jsx(FE,{store:ku,children:_.jsx(qO,{})}));
|
|
111
|
+
//# sourceMappingURL=index-1ZFTsuJ8.js.map
|