@botfabrik/engine-webclient 4.96.0 → 4.96.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/index-BCf67X3-.css +1 -0
- package/dist/client/assets/{index-CfODWGjx.js → index-Cvt8mpmq.js} +3 -3
- package/dist/client/assets/{index-CfODWGjx.js.map → index-Cvt8mpmq.js.map} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +4 -4
- package/dist/client/assets/index-Df0fzke1.css +0 -1
|
@@ -90,7 +90,7 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
|
|
|
90
90
|
*
|
|
91
91
|
* This source code is licensed under the MIT license found in the
|
|
92
92
|
* LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/var ly;function yA(){if(ly)return Le;ly=1;var n=typeof Symbol=="function"&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,u=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,h=n?Symbol.for("react.provider"):60109,d=n?Symbol.for("react.context"):60110,m=n?Symbol.for("react.async_mode"):60111,g=n?Symbol.for("react.concurrent_mode"):60111,y=n?Symbol.for("react.forward_ref"):60112,_=n?Symbol.for("react.suspense"):60113,T=n?Symbol.for("react.suspense_list"):60120,L=n?Symbol.for("react.memo"):60115,N=n?Symbol.for("react.lazy"):60116,V=n?Symbol.for("react.block"):60121,G=n?Symbol.for("react.fundamental"):60117,E=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function S(x){if(typeof x=="object"&&x!==null){var Z=x.$$typeof;switch(Z){case r:switch(x=x.type,x){case m:case g:case s:case c:case u:case _:return x;default:switch(x=x&&x.$$typeof,x){case d:case y:case N:case L:case h:return x;default:return Z}}case i:return Z}}}function I(x){return S(x)===g}return Le.AsyncMode=m,Le.ConcurrentMode=g,Le.ContextConsumer=d,Le.ContextProvider=h,Le.Element=r,Le.ForwardRef=y,Le.Fragment=s,Le.Lazy=N,Le.Memo=L,Le.Portal=i,Le.Profiler=c,Le.StrictMode=u,Le.Suspense=_,Le.isAsyncMode=function(x){return I(x)||S(x)===m},Le.isConcurrentMode=I,Le.isContextConsumer=function(x){return S(x)===d},Le.isContextProvider=function(x){return S(x)===h},Le.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===r},Le.isForwardRef=function(x){return S(x)===y},Le.isFragment=function(x){return S(x)===s},Le.isLazy=function(x){return S(x)===N},Le.isMemo=function(x){return S(x)===L},Le.isPortal=function(x){return S(x)===i},Le.isProfiler=function(x){return S(x)===c},Le.isStrictMode=function(x){return S(x)===u},Le.isSuspense=function(x){return S(x)===_},Le.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===s||x===g||x===c||x===u||x===_||x===T||typeof x=="object"&&x!==null&&(x.$$typeof===N||x.$$typeof===L||x.$$typeof===h||x.$$typeof===d||x.$$typeof===y||x.$$typeof===G||x.$$typeof===E||x.$$typeof===w||x.$$typeof===V)},Le.typeOf=S,Le}var oy;function vA(){return oy||(oy=1,kf.exports=yA()),kf.exports}var qf,uy;function bA(){if(uy)return qf;uy=1;var n=vA(),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},u={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c={};c[n.ForwardRef]=s,c[n.Memo]=u;function h(N){return n.isMemo(N)?u:c[N.$$typeof]||r}var d=Object.defineProperty,m=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols,y=Object.getOwnPropertyDescriptor,_=Object.getPrototypeOf,T=Object.prototype;function L(N,V,G){if(typeof V!="string"){if(T){var E=_(V);E&&E!==T&&L(N,E,G)}var w=m(V);g&&(w=w.concat(g(V)));for(var S=h(N),I=h(V),x=0;x<w.length;++x){var Z=w[x];if(!i[Z]&&!(G&&G[Z])&&!(I&&I[Z])&&!(S&&S[Z])){var $=y(V,Z);try{d(N,Z,$)}catch{}}}}return N}return qf=L,qf}bA();var bd=typeof window<"u"&&!window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__?window.__REACT_INTL_CONTEXT__||(window.__REACT_INTL_CONTEXT__=H.createContext(null)):H.createContext(null);bd.Consumer;var _A=bd.Provider,EA=_A,SA=bd;function su(){var n=H.useContext(SA);return V1(n),n}var Yh;(function(n){n.formatDate="FormattedDate",n.formatTime="FormattedTime",n.formatNumber="FormattedNumber",n.formatList="FormattedList",n.formatDisplayName="FormattedDisplayName"})(Yh||(Yh={}));var Xh;(function(n){n.formatDate="FormattedDateParts",n.formatTime="FormattedTimeParts",n.formatNumber="FormattedNumberParts",n.formatList="FormattedListParts"})(Xh||(Xh={}));function X1(n){var r=function(i){var s=su(),u=i.value,c=i.children,h=iu(i,["value","children"]),d=typeof u=="string"?new Date(u||0):u,m=n==="formatDate"?s.formatDateToParts(d,h):s.formatTimeToParts(d,h);return c(m)};return r.displayName=Xh[n],r}function nl(n){var r=function(i){var s=su(),u=i.value,c=i.children,h=iu(i,["value","children"]),d=s[n](u,h);if(typeof c=="function")return c(d);var m=s.textComponent||H.Fragment;return H.createElement(m,null,d)};return r.displayName=Yh[n],r}function Z1(n){return n&&Object.keys(n).reduce(function(r,i){var s=n[i];return r[i]=z1(s)?pA(s):s,r},{})}var cy=function(n,r,i,s){for(var u=[],c=4;c<arguments.length;c++)u[c-4]=arguments[c];var h=Z1(s),d=Vh.apply(void 0,$n([n,r,i,h],u,!1));return Array.isArray(d)?mA(d):d},fy=function(n,r){var i=n.defaultRichTextElements,s=iu(n,["defaultRichTextElements"]),u=Z1(i),c=cA(ae(ae(ae({},Y1),s),{defaultRichTextElements:u}),r),h={locale:c.locale,timeZone:c.timeZone,fallbackOnEmptyString:c.fallbackOnEmptyString,formats:c.formats,defaultLocale:c.defaultLocale,defaultFormats:c.defaultFormats,messages:c.messages,onError:c.onError,defaultRichTextElements:u};return ae(ae({},c),{formatMessage:cy.bind(null,h,c.formatters),$t:cy.bind(null,h,c.formatters)})};function Ff(n){return{locale:n.locale,timeZone:n.timeZone,fallbackOnEmptyString:n.fallbackOnEmptyString,formats:n.formats,textComponent:n.textComponent,messages:n.messages,defaultLocale:n.defaultLocale,defaultFormats:n.defaultFormats,onError:n.onError,onWarn:n.onWarn,wrapRichTextChunksInFragment:n.wrapRichTextChunksInFragment,defaultRichTextElements:n.defaultRichTextElements}}var TA=function(n){Tn(r,n);function r(){var i=n!==null&&n.apply(this,arguments)||this;return i.cache=q1(),i.state={cache:i.cache,intl:fy(Ff(i.props),i.cache),prevConfig:Ff(i.props)},i}return r.getDerivedStateFromProps=function(i,s){var u=s.prevConfig,c=s.cache,h=Ff(i);return gA(u,h)?null:{intl:fy(h,c),prevConfig:h}},r.prototype.render=function(){return V1(this.state.intl),H.createElement(EA,{value:this.state.intl},this.props.children)},r.displayName="IntlProvider",r.defaultProps=Y1,r}(H.PureComponent);nl("formatDate");nl("formatTime");nl("formatNumber");nl("formatList");nl("formatDisplayName");X1("formatDate");X1("formatTime");const AA="_app_1rj0t_1",xA={app:AA},ka=k2,Zt=P2,Q1="%[a-f0-9]{2}",hy=new RegExp("("+Q1+")|([^%]+?)","gi"),dy=new RegExp("("+Q1+")+","gi");function Zh(n,r){try{return[decodeURIComponent(n.join(""))]}catch{}if(n.length===1)return n;r=r||1;const i=n.slice(0,r),s=n.slice(r);return Array.prototype.concat.call([],Zh(i),Zh(s))}function OA(n){try{return decodeURIComponent(n)}catch{let r=n.match(hy)||[];for(let i=1;i<r.length;i++)n=Zh(r,i).join(""),r=n.match(hy)||[];return n}}function RA(n){const r={"%FE%FF":"��","%FF%FE":"��"};let i=dy.exec(n);for(;i;){try{r[i[0]]=decodeURIComponent(i[0])}catch{const u=OA(i[0]);u!==i[0]&&(r[i[0]]=u)}i=dy.exec(n)}r["%C2"]="�";const s=Object.keys(r);for(const u of s)n=n.replace(new RegExp(u,"g"),r[u]);return n}function wA(n){if(typeof n!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof n+"`");try{return decodeURIComponent(n)}catch{return RA(n)}}function CA(n,r){const i={};if(Array.isArray(r))for(const s of r){const u=Object.getOwnPropertyDescriptor(n,s);u?.enumerable&&Object.defineProperty(i,s,u)}else for(const s of Reflect.ownKeys(n)){const u=Object.getOwnPropertyDescriptor(n,s);if(u.enumerable){const c=n[s];r(s,c,n)&&Object.defineProperty(i,s,u)}}return i}function K1(n,r){if(!(typeof n=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(n===""||r==="")return[];const i=n.indexOf(r);return i===-1?[]:[n.slice(0,i),n.slice(i+r.length)]}const NA=n=>n==null,MA=n=>encodeURIComponent(n).replaceAll(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),Qh=Symbol("encodeFragmentIdentifier");function DA(n){switch(n.arrayFormat){case"index":return r=>(i,s)=>{const u=i.length;return s===void 0||n.skipNull&&s===null||n.skipEmptyString&&s===""?i:s===null?[...i,[ut(r,n),"[",u,"]"].join("")]:[...i,[ut(r,n),"[",ut(u,n),"]=",ut(s,n)].join("")]};case"bracket":return r=>(i,s)=>s===void 0||n.skipNull&&s===null||n.skipEmptyString&&s===""?i:s===null?[...i,[ut(r,n),"[]"].join("")]:[...i,[ut(r,n),"[]=",ut(s,n)].join("")];case"colon-list-separator":return r=>(i,s)=>s===void 0||n.skipNull&&s===null||n.skipEmptyString&&s===""?i:s===null?[...i,[ut(r,n),":list="].join("")]:[...i,[ut(r,n),":list=",ut(s,n)].join("")];case"comma":case"separator":case"bracket-separator":{const r=n.arrayFormat==="bracket-separator"?"[]=":"=";return i=>(s,u)=>u===void 0||n.skipNull&&u===null||n.skipEmptyString&&u===""?s:(u=u===null?"":u,s.length===0?[[ut(i,n),r,ut(u,n)].join("")]:[[s,ut(u,n)].join(n.arrayFormatSeparator)])}default:return r=>(i,s)=>s===void 0||n.skipNull&&s===null||n.skipEmptyString&&s===""?i:s===null?[...i,ut(r,n)]:[...i,[ut(r,n),"=",ut(s,n)].join("")]}}function BA(n){let r;switch(n.arrayFormat){case"index":return(i,s,u)=>{if(r=/\[(\d*)]$/.exec(i),i=i.replace(/\[\d*]$/,""),!r){u[i]=s;return}u[i]===void 0&&(u[i]={}),u[i][r[1]]=s};case"bracket":return(i,s,u)=>{if(r=/(\[])$/.exec(i),i=i.replace(/\[]$/,""),!r){u[i]=s;return}if(u[i]===void 0){u[i]=[s];return}u[i]=[...u[i],s]};case"colon-list-separator":return(i,s,u)=>{if(r=/(:list)$/.exec(i),i=i.replace(/:list$/,""),!r){u[i]=s;return}if(u[i]===void 0){u[i]=[s];return}u[i]=[...u[i],s]};case"comma":case"separator":return(i,s,u)=>{const c=typeof s=="string"&&s.includes(n.arrayFormatSeparator),h=typeof s=="string"&&!c&&Tr(s,n).includes(n.arrayFormatSeparator);s=h?Tr(s,n):s;const d=c||h?s.split(n.arrayFormatSeparator).map(m=>Tr(m,n)):s===null?s:Tr(s,n);u[i]=d};case"bracket-separator":return(i,s,u)=>{const c=/(\[])$/.test(i);if(i=i.replace(/\[]$/,""),!c){u[i]=s&&Tr(s,n);return}const h=s===null?[]:Tr(s,n).split(n.arrayFormatSeparator);if(u[i]===void 0){u[i]=h;return}u[i]=[...u[i],...h]};default:return(i,s,u)=>{if(u[i]===void 0){u[i]=s;return}u[i]=[...[u[i]].flat(),s]}}}function $1(n){if(typeof n!="string"||n.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function ut(n,r){return r.encode?r.strict?MA(n):encodeURIComponent(n):n}function Tr(n,r){return r.decode?wA(n):n}function W1(n){return Array.isArray(n)?n.sort():typeof n=="object"?W1(Object.keys(n)).sort((r,i)=>Number(r)-Number(i)).map(r=>n[r]):n}function J1(n){const r=n.indexOf("#");return r!==-1&&(n=n.slice(0,r)),n}function LA(n){let r="";const i=n.indexOf("#");return i!==-1&&(r=n.slice(i)),r}function my(n,r,i){return i==="string"&&typeof n=="string"?n:typeof i=="function"&&typeof n=="string"?i(n):i==="boolean"&&n===null?!0:i==="boolean"&&n!==null&&(n.toLowerCase()==="true"||n.toLowerCase()==="false")?n.toLowerCase()==="true":i==="boolean"&&n!==null&&(n.toLowerCase()==="1"||n.toLowerCase()==="0")?n.toLowerCase()==="1":i==="string[]"&&r.arrayFormat!=="none"&&typeof n=="string"?[n]:i==="number[]"&&r.arrayFormat!=="none"&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?[Number(n)]:i==="number"&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?Number(n):r.parseBooleans&&n!==null&&(n.toLowerCase()==="true"||n.toLowerCase()==="false")?n.toLowerCase()==="true":r.parseNumbers&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?Number(n):n}function _d(n){n=J1(n);const r=n.indexOf("?");return r===-1?"":n.slice(r+1)}function Ed(n,r){r={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...r},$1(r.arrayFormatSeparator);const i=BA(r),s=Object.create(null);if(typeof n!="string"||(n=n.trim().replace(/^[?#&]/,""),!n))return s;for(const u of n.split("&")){if(u==="")continue;const c=r.decode?u.replaceAll("+"," "):u;let[h,d]=K1(c,"=");h===void 0&&(h=c),d=d===void 0?null:["comma","separator","bracket-separator"].includes(r.arrayFormat)?d:Tr(d,r),i(Tr(h,r),d,s)}for(const[u,c]of Object.entries(s))if(typeof c=="object"&&c!==null&&r.types[u]!=="string")for(const[h,d]of Object.entries(c)){const m=r.types[u]?r.types[u].replace("[]",""):void 0;c[h]=my(d,r,m)}else typeof c=="object"&&c!==null&&r.types[u]==="string"?s[u]=Object.values(c).join(r.arrayFormatSeparator):s[u]=my(c,r,r.types[u]);return r.sort===!1?s:(r.sort===!0?Object.keys(s).sort():Object.keys(s).sort(r.sort)).reduce((u,c)=>{const h=s[c];return u[c]=h&&typeof h=="object"&&!Array.isArray(h)?W1(h):h,u},Object.create(null))}function eb(n,r){if(!n)return"";r={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...r},$1(r.arrayFormatSeparator);const i=h=>r.skipNull&&NA(n[h])||r.skipEmptyString&&n[h]==="",s=DA(r),u={};for(const[h,d]of Object.entries(n))i(h)||(u[h]=d);const c=Object.keys(u);return r.sort!==!1&&c.sort(r.sort),c.map(h=>{const d=n[h];return d===void 0?"":d===null?ut(h,r):Array.isArray(d)?d.length===0&&r.arrayFormat==="bracket-separator"?ut(h,r)+"[]":d.reduce(s(h),[]).join("&"):ut(h,r)+"="+ut(d,r)}).filter(h=>h.length>0).join("&")}function tb(n,r){r={decode:!0,...r};let[i,s]=K1(n,"#");return i===void 0&&(i=n),{url:i?.split("?")?.[0]??"",query:Ed(_d(n),r),...r&&r.parseFragmentIdentifier&&s?{fragmentIdentifier:Tr(s,r)}:{}}}function nb(n,r){r={encode:!0,strict:!0,[Qh]:!0,...r};const i=J1(n.url).split("?")[0]||"",s=_d(n.url),u={...Ed(s,{sort:!1,...r}),...n.query};let c=eb(u,r);c&&=`?${c}`;let h=LA(n.url);if(typeof n.fragmentIdentifier=="string"){const d=new URL(i);d.hash=n.fragmentIdentifier,h=r[Qh]?d.hash:`#${n.fragmentIdentifier}`}return`${i}${c}${h}`}function rb(n,r,i){i={parseFragmentIdentifier:!0,[Qh]:!1,...i};const{url:s,query:u,fragmentIdentifier:c}=tb(n,i);return nb({url:s,query:CA(u,r),fragmentIdentifier:c},i)}function UA(n,r,i){const s=Array.isArray(r)?u=>!r.includes(u):(u,c)=>!r(u,c);return rb(n,s,i)}const lu=Object.freeze(Object.defineProperty({__proto__:null,exclude:UA,extract:_d,parse:Ed,parseUrl:tb,pick:rb,stringify:eb,stringifyUrl:nb},Symbol.toStringTag,{value:"Module"}));var Dn={},Bn={},Ie={},_o={},pe={},py;function cn(){return py||(py=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.GUEST_LOCALE_CHANGED=pe.DRAWER_CLOSE=pe.DRAWER_OPEN=pe.CONVERSATION_RATING_FROM_GUEST=pe.TRANSCRIPT_ITEM_GUEST_REACTION=pe.TRANSCRIPT_MAIL_REQUEST=pe.INBOX_CONNECT_REQUEST=pe.RESTART_CHAT_REQUEST=pe.EVENT_TO_GUEST=pe.NLU_REQUEST_EVENT=pe.EXPERTS_DISCONNECTED=pe.EXPERTS_DISCONNECT_REQUEST=pe.EXPERTS_CONNECTED=pe.EXPERTS_CONNECT_REQUEST=pe.MESSAGE_TO_GUEST=pe.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST=pe.MESSAGE_FROM_GUEST=pe.GUEST_FEEDBACK_RESPONSE=pe.GUEST_DISCONNECTED=pe.GUEST_CONNECTED=pe.TYPING_OFF=pe.TYPING_ON=void 0,pe.TYPING_ON="core.typing.on",pe.TYPING_OFF="core.typing.off",pe.GUEST_CONNECTED="core.guest.connected",pe.GUEST_DISCONNECTED="core.guest.disconnected",pe.GUEST_FEEDBACK_RESPONSE="core.guest.feedback.response",pe.MESSAGE_FROM_GUEST="core.message.from.guest",pe.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST="core.message.without.analysis.from.guest",pe.MESSAGE_TO_GUEST="core.message.to.guest",pe.EXPERTS_CONNECT_REQUEST="core.experts.connect.request",pe.EXPERTS_CONNECTED="core.experts.connected",pe.EXPERTS_DISCONNECT_REQUEST="core.experts.disconnect.request",pe.EXPERTS_DISCONNECTED="core.experts.disconnected",pe.NLU_REQUEST_EVENT="core.nlu.request.event",pe.EVENT_TO_GUEST="core.event.to.guest",pe.RESTART_CHAT_REQUEST="core.chat.restart.request",pe.INBOX_CONNECT_REQUEST="core.inbox.connect.request",pe.TRANSCRIPT_MAIL_REQUEST="core.transcript.mail.request",pe.TRANSCRIPT_ITEM_GUEST_REACTION="core.transcript.item.guest.reaction",pe.CONVERSATION_RATING_FROM_GUEST="core.conversation.rating.from.guest",pe.DRAWER_OPEN="core.drawer.open",pe.DRAWER_CLOSE="core.drawer.close",pe.GUEST_LOCALE_CHANGED="core.guest.locale.changed"),pe}var gy;function HA(){if(gy)return _o;gy=1,Object.defineProperty(_o,"__esModule",{value:!0});const n=cn(),r=()=>({type:n.DRAWER_CLOSE});return _o.default=r,_o}var Eo={},yy;function jA(){if(yy)return Eo;yy=1,Object.defineProperty(Eo,"__esModule",{value:!0});const n=cn(),r=(i,s)=>({type:n.GUEST_FEEDBACK_RESPONSE,payload:{satisfaction:i,intent:s}});return Eo.default=r,Eo}var So={},vy;function IA(){if(vy)return So;vy=1,Object.defineProperty(So,"__esModule",{value:!0});const n=cn(),r=i=>({type:n.GUEST_CONNECTED,payload:{sessionId:i}});return So.default=r,So}var To={},by;function zA(){if(by)return To;by=1,Object.defineProperty(To,"__esModule",{value:!0});const n=cn(),r=i=>({type:n.GUEST_DISCONNECTED,payload:{sessionId:i}});return To.default=r,To}var Ao={},_y;function GA(){if(_y)return Ao;_y=1,Object.defineProperty(Ao,"__esModule",{value:!0});const n=cn(),r=(i,s)=>({type:n.GUEST_LOCALE_CHANGED,payload:{previousLocale:i,newLocale:s}});return Ao.default=r,Ao}var xo={},Ey;function kA(){if(Ey)return xo;Ey=1,Object.defineProperty(xo,"__esModule",{value:!0});const n=cn(),r=i=>({type:n.DRAWER_OPEN,payload:{parameters:{contentUrl:i}}});return xo.default=r,xo}var Oo={},Ke={},Sy;function Sd(){if(Sy)return Ke;Sy=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.getStringRepresentationFromMessage=Ke.MessageTypeEnum=Ke.AudioMessage=Ke.FileMessage=Ke.ImageMessage=Ke.VideoMessage=Ke.MarkdownMessage=Ke.DetailMessage=Ke.TextMessage=Ke.Message=void 0;class n{type;sender;sources;quickReplies;constructor(_,T,L=[],N=[]){this.type=_,this.sender=T,this.sources=L,this.quickReplies=N}addQuickReply(_,T){this.quickReplies.push({label:_,payload:T})}}Ke.Message=n;class r extends n{text;constructor(_,T,L=[],N=[]){super(m.TEXT,T,L,N),this.text=_}}Ke.TextMessage=r;class i extends n{title;subtitle;text;imageUrl;itemUrl;buttons;constructor(_,T){super(m.DETAIL,T),this.title=_,this.text="",this.subtitle="",this.imageUrl="",this.itemUrl="",this.buttons=[]}setImageUrl(_){this.imageUrl=_}setItemUrl(_){this.itemUrl=_}setSubtitle(_){this.subtitle=_}setText(_){this.text=_}addButton(_){this.buttons.push(_)}}Ke.DetailMessage=i;class s extends n{markdown;constructor(_,T,L=[],N=[]){super(m.MARKDOWN,T,L,N),this.markdown=_}}Ke.MarkdownMessage=s;class u extends n{url;constructor(_,T){super(m.VIDEO,T),this.url=_}}Ke.VideoMessage=u;class c extends n{url;constructor(_,T){super(m.IMAGE,T),this.url=_}}Ke.ImageMessage=c;class h extends n{url;constructor(_,T){super(m.FILE,T),this.url=_}}Ke.FileMessage=h;class d extends n{url;constructor(_,T){super(m.AUDIO,T),this.url=_}}Ke.AudioMessage=d;var m;(function(y){y.TEXT="TEXT",y.DETAIL="DETAIL",y.MARKDOWN="MARKDOWN",y.VIDEO="VIDEO",y.IMAGE="IMAGE",y.FILE="FILE",y.AUDIO="AUDIO"})(m||(Ke.MessageTypeEnum=m={}));const g=y=>{switch(y.type){case m.TEXT:return y.text;case m.DETAIL:{const _=y;return`${_.title} // ${_.subtitle}`}case m.MARKDOWN:return y.markdown;case m.VIDEO:return`Video Url: ${y.url}`;case m.IMAGE:return`Image Url: ${y.url}`;case m.FILE:return`File Url: ${y.url}`;case m.AUDIO:return`Audio Url: ${y.url}`;default:throw new Error("Unknown message type "+y.type)}};return Ke.getStringRepresentationFromMessage=g,Ke}var an={},Ty;function Td(){if(Ty)return an;Ty=1,Object.defineProperty(an,"__esModule",{value:!0}),an.UserType=an.PersonUser=an.GuestUser=an.BotUser=an.User=void 0;class n{type;id;name;avatar;constructor(h,d,m,g){this.type=h,this.id=d,this.name=m,this.avatar=g}}an.User=n;class r extends n{constructor(){super(u.BOT,null,"Chatbot","bot.svg")}}an.BotUser=r;class i extends n{constructor(){super(u.GUEST,null,"Guest","visitor.svg")}}an.GuestUser=i;class s extends n{constructor(h,d,m){super(u.PERSON,h,d,m)}}an.PersonUser=s;var u;return function(c){c.GUEST="GUEST",c.BOT="BOT",c.PERSON="PERSON"}(u||(an.UserType=u={})),an}var Ay;function qA(){if(Ay)return Oo;Ay=1,Object.defineProperty(Oo,"__esModule",{value:!0});const n=Sd(),r=Td(),i=cn(),s=u=>{const c=new n.TextMessage(u,new r.GuestUser);return{type:i.MESSAGE_FROM_GUEST,message:c}};return Oo.default=s,Oo}var Ro={},xy;function FA(){if(xy)return Ro;xy=1,Object.defineProperty(Ro,"__esModule",{value:!0});const n=Sd(),r=Td(),i=cn(),s=(u,c={})=>{const h=new n.TextMessage(u,new r.GuestUser);return{type:i.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST,message:h,payload:c}};return Ro.default=s,Ro}var wo={},Oy;function PA(){if(Oy)return wo;Oy=1,Object.defineProperty(wo,"__esModule",{value:!0});const n=cn(),r=i=>({type:n.NLU_REQUEST_EVENT,event:i});return wo.default=r,wo}var Co={},Ry;function VA(){if(Ry)return Co;Ry=1,Object.defineProperty(Co,"__esModule",{value:!0});const n=cn(),r=()=>({type:n.RESTART_CHAT_REQUEST});return Co.default=r,Co}var No={},wy;function YA(){if(wy)return No;wy=1,Object.defineProperty(No,"__esModule",{value:!0});const n=cn(),r=i=>({type:n.MESSAGE_TO_GUEST,message:i});return No.default=r,No}var Mo={},Cy;function XA(){if(Cy)return Mo;Cy=1,Object.defineProperty(Mo,"__esModule",{value:!0});const n=cn(),r=(i,s)=>({type:n.TRANSCRIPT_ITEM_GUEST_REACTION,payload:{actionId:i,reaction:s}});return Mo.default=r,Mo}var Ny;function ZA(){if(Ny)return Ie;Ny=1;var n=Ie&&Ie.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.transcriptItemGuestReaction=Ie.sendMessageToGuest=Ie.restartChatRequest=Ie.requestNLUEvent=Ie.receiveTextMessageWithoutAnalysisFromGuest=Ie.receiveTextMessageFromGuest=Ie.openDrawer=Ie.guestLocaleChanged=Ie.guestDisconnected=Ie.guestConnected=Ie.feedbackFromGuestResponse=Ie.closeDrawer=void 0;const r=n(HA());Ie.closeDrawer=r.default;const i=n(jA());Ie.feedbackFromGuestResponse=i.default;const s=n(IA());Ie.guestConnected=s.default;const u=n(zA());Ie.guestDisconnected=u.default;const c=n(GA());Ie.guestLocaleChanged=c.default;const h=n(kA());Ie.openDrawer=h.default;const d=n(qA());Ie.receiveTextMessageFromGuest=d.default;const m=n(FA());Ie.receiveTextMessageWithoutAnalysisFromGuest=m.default;const g=n(PA());Ie.requestNLUEvent=g.default;const y=n(VA());Ie.restartChatRequest=y.default;const _=n(YA());Ie.sendMessageToGuest=_.default;const T=n(XA());return Ie.transcriptItemGuestReaction=T.default,Ie}var Pf={},My;function QA(){return My||(My=1,Object.defineProperty(Pf,"__esModule",{value:!0})),Pf}var Dy;function KA(){return Dy||(Dy=1,function(n){var r=Bn&&Bn.__createBinding||(Object.create?function(c,h,d,m){m===void 0&&(m=d);var g=Object.getOwnPropertyDescriptor(h,d);(!g||("get"in g?!h.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return h[d]}}),Object.defineProperty(c,m,g)}:function(c,h,d,m){m===void 0&&(m=d),c[m]=h[d]}),i=Bn&&Bn.__setModuleDefault||(Object.create?function(c,h){Object.defineProperty(c,"default",{enumerable:!0,value:h})}:function(c,h){c.default=h}),s=Bn&&Bn.__importStar||function(){var c=function(h){return c=Object.getOwnPropertyNames||function(d){var m=[];for(var g in d)Object.prototype.hasOwnProperty.call(d,g)&&(m[m.length]=g);return m},c(h)};return function(h){if(h&&h.__esModule)return h;var d={};if(h!=null)for(var m=c(h),g=0;g<m.length;g++)m[g]!=="default"&&r(d,h,m[g]);return i(d,h),d}}(),u=Bn&&Bn.__exportStar||function(c,h){for(var d in c)d!=="default"&&!Object.prototype.hasOwnProperty.call(h,d)&&r(h,c,d)};Object.defineProperty(n,"__esModule",{value:!0}),n.ActionTypes=n.Actions=void 0,n.Actions=s(ZA()),n.ActionTypes=s(cn()),u(QA(),n)}(Bn)),Bn}var sn={},Vf={},By;function $A(){return By||(By=1,Object.defineProperty(Vf,"__esModule",{value:!0})),Vf}var Ls={},Ly;function WA(){if(Ly)return Ls;Ly=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.NullableKnowledgeBaseAdapter=void 0;class n{async createApiKnowledgeBase(i){throw new Error("Method not implemented.")}async updateApiKnowledgeBase(i,s){throw new Error("Method not implemented.")}async deleteApiKnowledgeBase(i){throw new Error("Method not implemented.")}async upsertApiKnowledgeBase(i){throw new Error("Method not implemented.")}async findApiKnowledgeBaseById(i){throw new Error("Method not implemented.")}async findApiKnowledgeBaseByName(i){throw new Error("Method not implemented.")}async findApiKnowledgeBases(){throw new Error("Method not implemented.")}async deleteApiKnowledgeBaseByName(i){throw new Error("Method not implemented.")}async findKnowledgeBaseEntries(i){throw new Error("Method not implemented.")}async createKnowledgeBaseEntry(i,s){throw new Error("Method not implemented.")}async updateKnowledgeBaseEntry(i,s,u){throw new Error("Method not implemented.")}async deleteKnowledgeBaseEntry(i,s){throw new Error("Method not implemented.")}async upsertKnowledgeBaseEntry(i,s){throw new Error("Method not implemented.")}async retrieveKnowledgeBaseEntryConfig(i,s){throw new Error("Method not implemented.")}async findKnowledgeBaseEntryByUriAlias(i,s){throw new Error("Method not implemented.")}async deleteKnowledgeBaseEntriesIndexedBeforeDate(i,s){throw new Error("Method not implemented.")}async findKnowledgeBaseEntryAttachments(i,s){throw new Error("Method not implemented.")}async createKnowledgeBaseEntryAttachment(i,s,u){throw new Error("Method not implemented.")}async updateKnowledgeBaseEntryAttachment(i,s,u,c){throw new Error("Method not implemented.")}async deleteKnowledgeBaseEntryAttachment(i,s,u){throw new Error("Method not implemented.")}async setIndexingStatus(i,s){throw new Error("Method not implemented.")}async subscribeToReindex(i,s){throw new Error("Method not implemented.")}isContentTypeSupported(i){throw new Error("Method not implemented.")}registerTool(i,s){throw new Error("Method not implemented.")}async getTools(i){throw new Error("Method not implemented.")}}return Ls.NullableKnowledgeBaseAdapter=n,Ls}var Uy;function JA(){if(Uy)return sn;Uy=1;var n=sn&&sn.__createBinding||(Object.create?function(u,c,h,d){d===void 0&&(d=h);var m=Object.getOwnPropertyDescriptor(c,h);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[h]}}),Object.defineProperty(u,d,m)}:function(u,c,h,d){d===void 0&&(d=h),u[d]=c[h]}),r=sn&&sn.__setModuleDefault||(Object.create?function(u,c){Object.defineProperty(u,"default",{enumerable:!0,value:c})}:function(u,c){u.default=c}),i=sn&&sn.__importStar||function(){var u=function(c){return u=Object.getOwnPropertyNames||function(h){var d=[];for(var m in h)Object.prototype.hasOwnProperty.call(h,m)&&(d[d.length]=m);return d},u(c)};return function(c){if(c&&c.__esModule)return c;var h={};if(c!=null)for(var d=u(c),m=0;m<d.length;m++)d[m]!=="default"&&n(h,c,d[m]);return r(h,c),h}}();Object.defineProperty(sn,"__esModule",{value:!0}),sn.NullableCmsAdapter=sn.KnowledgeBase=void 0,sn.KnowledgeBase=i($A());const s=WA();return sn.NullableCmsAdapter={knowledgeBase:new s.NullableKnowledgeBaseAdapter},sn}var Na={},Yf={},Hy;function ex(){return Hy||(Hy=1,Object.defineProperty(Yf,"__esModule",{value:!0})),Yf}var Xf={},jy;function tx(){return jy||(jy=1,Object.defineProperty(Xf,"__esModule",{value:!0})),Xf}var Zf={},Iy;function nx(){return Iy||(Iy=1,Object.defineProperty(Zf,"__esModule",{value:!0})),Zf}var Qf={},zy;function rx(){return zy||(zy=1,Object.defineProperty(Qf,"__esModule",{value:!0})),Qf}var Us={},Gy;function ax(){if(Gy)return Us;Gy=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.checkMiddlewareCondition=void 0;const n=async(r,i,s)=>(Array.isArray(r)?r:[r]).reduce(async(c,h)=>await c?await h(i,s):!1,Promise.resolve(!0));return Us.checkMiddlewareCondition=n,Us}var Kf={},ky;function ix(){return ky||(ky=1,Object.defineProperty(Kf,"__esModule",{value:!0})),Kf}var $f={},qy;function sx(){return qy||(qy=1,Object.defineProperty($f,"__esModule",{value:!0})),$f}var Wf={},Fy;function lx(){return Fy||(Fy=1,Object.defineProperty(Wf,"__esModule",{value:!0})),Wf}var Py;function ox(){return Py||(Py=1,function(n){var r=Na&&Na.__createBinding||(Object.create?function(s,u,c,h){h===void 0&&(h=c);var d=Object.getOwnPropertyDescriptor(u,c);(!d||("get"in d?!u.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return u[c]}}),Object.defineProperty(s,h,d)}:function(s,u,c,h){h===void 0&&(h=c),s[h]=u[c]}),i=Na&&Na.__exportStar||function(s,u){for(var c in s)c!=="default"&&!Object.prototype.hasOwnProperty.call(u,c)&&r(u,s,c)};Object.defineProperty(n,"__esModule",{value:!0}),i(ex(),n),i(tx(),n),i(nx(),n),i(rx(),n),i(ax(),n),i(ix(),n),i(sx(),n),i(lx(),n)}(Na)),Na}var Ma={},Ln={},Vy;function ux(){if(Vy)return Ln;Vy=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.ButtonTypeEnum=Ln.PostbackButton=Ln.UrlButton=Ln.Button=void 0;class n{title;type;constructor(c,h){this.title=c,this.type=h}}Ln.Button=n;class r extends n{url;constructor(c,h){super(c,s.WEB_URL),this.url=h}}Ln.UrlButton=r;class i extends n{payload;constructor(c,h){super(c,s.POSTBACK),this.payload=h}}Ln.PostbackButton=i;var s;return function(u){u.WEB_URL="web_url",u.POSTBACK="postback"}(s||(Ln.ButtonTypeEnum=s={})),Ln}var Jf={},Yy;function cx(){return Yy||(Yy=1,Object.defineProperty(Jf,"__esModule",{value:!0})),Jf}var Hs={},Xy;function fx(){if(Xy)return Hs;Xy=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.SatisfactionEnum=void 0;var n;return function(r){r.GOOD="GOOD",r.BAD="BAD"}(n||(Hs.SatisfactionEnum=n={})),Hs}var Zy;function Qy(){return Zy||(Zy=1,function(n){var r=Ma&&Ma.__createBinding||(Object.create?function(s,u,c,h){h===void 0&&(h=c);var d=Object.getOwnPropertyDescriptor(u,c);(!d||("get"in d?!u.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return u[c]}}),Object.defineProperty(s,h,d)}:function(s,u,c,h){h===void 0&&(h=c),s[h]=u[c]}),i=Ma&&Ma.__exportStar||function(s,u){for(var c in s)c!=="default"&&!Object.prototype.hasOwnProperty.call(u,c)&&r(u,s,c)};Object.defineProperty(n,"__esModule",{value:!0}),i(ux(),n),i(cx(),n),i(fx(),n),i(Sd(),n),i(Td(),n)}(Ma)),Ma}var Ky;function hx(){return Ky||(Ky=1,function(n){var r=Dn&&Dn.__createBinding||(Object.create?function(c,h,d,m){m===void 0&&(m=d);var g=Object.getOwnPropertyDescriptor(h,d);(!g||("get"in g?!h.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return h[d]}}),Object.defineProperty(c,m,g)}:function(c,h,d,m){m===void 0&&(m=d),c[m]=h[d]}),i=Dn&&Dn.__setModuleDefault||(Object.create?function(c,h){Object.defineProperty(c,"default",{enumerable:!0,value:h})}:function(c,h){c.default=h}),s=Dn&&Dn.__exportStar||function(c,h){for(var d in c)d!=="default"&&!Object.prototype.hasOwnProperty.call(h,d)&&r(h,c,d)},u=Dn&&Dn.__importStar||function(){var c=function(h){return c=Object.getOwnPropertyNames||function(d){var m=[];for(var g in d)Object.prototype.hasOwnProperty.call(d,g)&&(m[m.length]=g);return m},c(h)};return function(h){if(h&&h.__esModule)return h;var d={};if(h!=null)for(var m=c(h),g=0;g<m.length;g++)m[g]!=="default"&&r(d,h,m[g]);return i(d,h),d}}();Object.defineProperty(n,"__esModule",{value:!0}),n.Model=n.CMS=void 0,s(KA(),n),n.CMS=u(JA()),s(ox(),n),s(Qy(),n),n.Model=u(Qy())}(Dn)),Dn}var Oe=hx();const ab=n=>r=>(n.payload.type!==Oe.ActionTypes.MESSAGE_FROM_GUEST&&r(Oe.Actions.receiveTextMessageWithoutAnalysisFromGuest(n.label,n.payload)),r(n.payload)),ib=n=>(r,i)=>{const{quickReplies:s}=i().chat,u=s.find(c=>n.toLocaleLowerCase().indexOf(c.label.toLocaleLowerCase())>-1);return r(u?ab({...u,label:n}):JSON.parse(JSON.stringify(Oe.Actions.receiveTextMessageFromGuest(n))))},Ad="MESSAGE_TO_PARENT_PAGE",xd="RESTORE_PREVIOUS_CHAT_MESSAGES",Od="AUDIO_MESSAGE_FROM_USER",Rd="RECEIVE_SPEECH_TRANSCRIPTION",wd="ENABLE_CONVERSATION_RATING",sb="LOAD_SOURCE_INFOS_RESPONSE",Cd="LOAD_SOURCE_INFOS_ERROR",Nd="LOAD_SOURCE_INFOS_REQUEST",Md="CLOSE_SOURCE_INFOS",dx="webclient.get.started",lb="webclient.window.expand",ob="webclient.window.close",ub="webclient.transcript.pdf.download",mx=[Ad,xd,Od,Rd,wd,Nd,Md],px=n=>({type:Od,buffer:n}),gx=n=>({type:Rd,transcription:n}),yx=n=>({type:Oe.ActionTypes.TRANSCRIPT_MAIL_REQUEST,payload:{parameters:{mailTo:n}}}),vx=()=>({type:ub}),bx=({rating:n})=>({type:wd,payload:{rating:n}}),_x=(n,r)=>({type:Oe.ActionTypes.CONVERSATION_RATING_FROM_GUEST,payload:{value:n,feedback:r}}),cb=n=>Oe.Actions.requestNLUEvent(n),Ex=n=>({type:xd,messages:n}),Sx=n=>{switch(n.type){case Oe.ButtonTypeEnum.WEB_URL:return hb(n.url);case Oe.ButtonTypeEnum.POSTBACK:return n.payload;default:throw new Error(`unknown button type ${n.type}`)}},fb=n=>hb(n),hb=n=>({type:Ad,message:{type:"webclient.change.url",url:n}});/*! js-cookie v3.0.5 | MIT */function Do(n){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var s in i)n[s]=i[s]}return n}var Tx={read:function(n){return n[0]==='"'&&(n=n.slice(1,-1)),n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(n){return encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Kh(n,r){function i(u,c,h){if(!(typeof document>"u")){h=Do({},r,h),typeof h.expires=="number"&&(h.expires=new Date(Date.now()+h.expires*864e5)),h.expires&&(h.expires=h.expires.toUTCString()),u=encodeURIComponent(u).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var d="";for(var m in h)h[m]&&(d+="; "+m,h[m]!==!0&&(d+="="+h[m].split(";")[0]));return document.cookie=u+"="+n.write(c,u)+d}}function s(u){if(!(typeof document>"u"||arguments.length&&!u)){for(var c=document.cookie?document.cookie.split("; "):[],h={},d=0;d<c.length;d++){var m=c[d].split("="),g=m.slice(1).join("=");try{var y=decodeURIComponent(m[0]);if(h[y]=n.read(g,y),u===y)break}catch{}}return u?h[u]:h}}return Object.create({set:i,get:s,remove:function(u,c){i(u,"",Do({},c,{expires:-1}))},withAttributes:function(u){return Kh(this.converter,Do({},this.attributes,u))},withConverter:function(u){return Kh(Do({},this.converter,u),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(n)}})}var Bo=Kh(Tx,{path:"/"});const xt=[];for(let n=0;n<256;++n)xt.push((n+256).toString(16).slice(1));function Ax(n,r=0){return(xt[n[r+0]]+xt[n[r+1]]+xt[n[r+2]]+xt[n[r+3]]+"-"+xt[n[r+4]]+xt[n[r+5]]+"-"+xt[n[r+6]]+xt[n[r+7]]+"-"+xt[n[r+8]]+xt[n[r+9]]+"-"+xt[n[r+10]]+xt[n[r+11]]+xt[n[r+12]]+xt[n[r+13]]+xt[n[r+14]]+xt[n[r+15]]).toLowerCase()}let eh;const xx=new Uint8Array(16);function Ox(){if(!eh){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");eh=crypto.getRandomValues.bind(crypto)}return eh(xx)}const Rx=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$y={randomUUID:Rx};function $h(n,r,i){if($y.randomUUID&&!n)return $y.randomUUID();n=n||{};const s=n.random??n.rng?.()??Ox();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Ax(s)}function Ot(n){return`Minified Redux error #${n}; visit https://redux.js.org/Errors?code=${n} for the full message or use the non-minified dev environment for full errors. `}var wx=typeof Symbol=="function"&&Symbol.observable||"@@observable",Wy=wx,th=()=>Math.random().toString(36).substring(7).split("").join("."),Cx={INIT:`@@redux/INIT${th()}`,REPLACE:`@@redux/REPLACE${th()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${th()}`},Ko=Cx;function Dd(n){if(typeof n!="object"||n===null)return!1;let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r||Object.getPrototypeOf(n)===null}function db(n,r,i){if(typeof n!="function")throw new Error(Ot(2));if(typeof r=="function"&&typeof i=="function"||typeof i=="function"&&typeof arguments[3]=="function")throw new Error(Ot(0));if(typeof r=="function"&&typeof i>"u"&&(i=r,r=void 0),typeof i<"u"){if(typeof i!="function")throw new Error(Ot(1));return i(db)(n,r)}let s=n,u=r,c=new Map,h=c,d=0,m=!1;function g(){h===c&&(h=new Map,c.forEach((G,E)=>{h.set(E,G)}))}function y(){if(m)throw new Error(Ot(3));return u}function _(G){if(typeof G!="function")throw new Error(Ot(4));if(m)throw new Error(Ot(5));let E=!0;g();const w=d++;return h.set(w,G),function(){if(E){if(m)throw new Error(Ot(6));E=!1,g(),h.delete(w),c=null}}}function T(G){if(!Dd(G))throw new Error(Ot(7));if(typeof G.type>"u")throw new Error(Ot(8));if(typeof G.type!="string")throw new Error(Ot(17));if(m)throw new Error(Ot(9));try{m=!0,u=s(u,G)}finally{m=!1}return(c=h).forEach(w=>{w()}),G}function L(G){if(typeof G!="function")throw new Error(Ot(10));s=G,T({type:Ko.REPLACE})}function N(){const G=_;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(Ot(11));function w(){const I=E;I.next&&I.next(y())}return w(),{unsubscribe:G(w)}},[Wy](){return this}}}return T({type:Ko.INIT}),{dispatch:T,subscribe:_,getState:y,replaceReducer:L,[Wy]:N}}function Nx(n){Object.keys(n).forEach(r=>{const i=n[r];if(typeof i(void 0,{type:Ko.INIT})>"u")throw new Error(Ot(12));if(typeof i(void 0,{type:Ko.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ot(13))})}function mb(n){const r=Object.keys(n),i={};for(let c=0;c<r.length;c++){const h=r[c];typeof n[h]=="function"&&(i[h]=n[h])}const s=Object.keys(i);let u;try{Nx(i)}catch(c){u=c}return function(h={},d){if(u)throw u;let m=!1;const g={};for(let y=0;y<s.length;y++){const _=s[y],T=i[_],L=h[_],N=T(L,d);if(typeof N>"u")throw d&&d.type,new Error(Ot(14));g[_]=N,m=m||N!==L}return m=m||s.length!==Object.keys(h).length,m?g:h}}function $o(...n){return n.length===0?r=>r:n.length===1?n[0]:n.reduce((r,i)=>(...s)=>r(i(...s)))}function Mx(...n){return r=>(i,s)=>{const u=r(i,s);let c=()=>{throw new Error(Ot(15))};const h={getState:u.getState,dispatch:(m,...g)=>c(m,...g)},d=n.map(m=>m(h));return c=$o(...d)(u.dispatch),{...u,dispatch:c}}}function Dx(n){return Dd(n)&&"type"in n&&typeof n.type=="string"}var pb=Symbol.for("immer-nothing"),Jy=Symbol.for("immer-draftable"),on=Symbol.for("immer-state");function In(n,...r){throw new Error(`[Immer] minified error nr: ${n}. Full error at: https://bit.ly/3cXEKWf`)}var wi=Object.getPrototypeOf;function za(n){return!!n&&!!n[on]}function wr(n){return n?gb(n)||Array.isArray(n)||!!n[Jy]||!!n.constructor?.[Jy]||uu(n)||cu(n):!1}var Bx=Object.prototype.constructor.toString();function gb(n){if(!n||typeof n!="object")return!1;const r=wi(n);if(r===null)return!0;const i=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return i===Object?!0:typeof i=="function"&&Function.toString.call(i)===Bx}function Wo(n,r){ou(n)===0?Reflect.ownKeys(n).forEach(i=>{r(i,n[i],n)}):n.forEach((i,s)=>r(s,i,n))}function ou(n){const r=n[on];return r?r.type_:Array.isArray(n)?1:uu(n)?2:cu(n)?3:0}function Wh(n,r){return ou(n)===2?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function yb(n,r,i){const s=ou(n);s===2?n.set(r,i):s===3?n.add(i):n[r]=i}function Lx(n,r){return n===r?n!==0||1/n===1/r:n!==n&&r!==r}function uu(n){return n instanceof Map}function cu(n){return n instanceof Set}function Ua(n){return n.copy_||n.base_}function Jh(n,r){if(uu(n))return new Map(n);if(cu(n))return new Set(n);if(Array.isArray(n))return Array.prototype.slice.call(n);const i=gb(n);if(r===!0||r==="class_only"&&!i){const s=Object.getOwnPropertyDescriptors(n);delete s[on];let u=Reflect.ownKeys(s);for(let c=0;c<u.length;c++){const h=u[c],d=s[h];d.writable===!1&&(d.writable=!0,d.configurable=!0),(d.get||d.set)&&(s[h]={configurable:!0,writable:!0,enumerable:d.enumerable,value:n[h]})}return Object.create(wi(n),s)}else{const s=wi(n);if(s!==null&&i)return{...n};const u=Object.create(s);return Object.assign(u,n)}}function Bd(n,r=!1){return fu(n)||za(n)||!wr(n)||(ou(n)>1&&(n.set=n.add=n.clear=n.delete=Ux),Object.freeze(n),r&&Object.entries(n).forEach(([i,s])=>Bd(s,!0))),n}function Ux(){In(2)}function fu(n){return Object.isFrozen(n)}var Hx={};function Ga(n){const r=Hx[n];return r||In(0,n),r}var $s;function vb(){return $s}function jx(n,r){return{drafts_:[],parent_:n,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ev(n,r){r&&(Ga("Patches"),n.patches_=[],n.inversePatches_=[],n.patchListener_=r)}function ed(n){td(n),n.drafts_.forEach(Ix),n.drafts_=null}function td(n){n===$s&&($s=n.parent_)}function tv(n){return $s=jx($s,n)}function Ix(n){const r=n[on];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function nv(n,r){r.unfinalizedDrafts_=r.drafts_.length;const i=r.drafts_[0];return n!==void 0&&n!==i?(i[on].modified_&&(ed(r),In(4)),wr(n)&&(n=Jo(r,n),r.parent_||eu(r,n)),r.patches_&&Ga("Patches").generateReplacementPatches_(i[on].base_,n,r.patches_,r.inversePatches_)):n=Jo(r,i,[]),ed(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),n!==pb?n:void 0}function Jo(n,r,i){if(fu(r))return r;const s=r[on];if(!s)return Wo(r,(u,c)=>rv(n,s,r,u,c,i)),r;if(s.scope_!==n)return r;if(!s.modified_)return eu(n,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;const u=s.copy_;let c=u,h=!1;s.type_===3&&(c=new Set(u),u.clear(),h=!0),Wo(c,(d,m)=>rv(n,s,u,d,m,i,h)),eu(n,u,!1),i&&n.patches_&&Ga("Patches").generatePatches_(s,i,n.patches_,n.inversePatches_)}return s.copy_}function rv(n,r,i,s,u,c,h){if(za(u)){const d=c&&r&&r.type_!==3&&!Wh(r.assigned_,s)?c.concat(s):void 0,m=Jo(n,u,d);if(yb(i,s,m),za(m))n.canAutoFreeze_=!1;else return}else h&&i.add(u);if(wr(u)&&!fu(u)){if(!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1)return;Jo(n,u),(!r||!r.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(i,s)&&eu(n,u)}}function eu(n,r,i=!1){!n.parent_&&n.immer_.autoFreeze_&&n.canAutoFreeze_&&Bd(r,i)}function zx(n,r){const i=Array.isArray(n),s={type_:i?1:0,scope_:r?r.scope_:vb(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:n,draft_:null,copy_:null,revoke_:null,isManual_:!1};let u=s,c=Ld;i&&(u=[s],c=Ws);const{revoke:h,proxy:d}=Proxy.revocable(u,c);return s.draft_=d,s.revoke_=h,d}var Ld={get(n,r){if(r===on)return n;const i=Ua(n);if(!Wh(i,r))return Gx(n,i,r);const s=i[r];return n.finalized_||!wr(s)?s:s===nh(n.base_,r)?(rh(n),n.copy_[r]=rd(s,n)):s},has(n,r){return r in Ua(n)},ownKeys(n){return Reflect.ownKeys(Ua(n))},set(n,r,i){const s=bb(Ua(n),r);if(s?.set)return s.set.call(n.draft_,i),!0;if(!n.modified_){const u=nh(Ua(n),r),c=u?.[on];if(c&&c.base_===i)return n.copy_[r]=i,n.assigned_[r]=!1,!0;if(Lx(i,u)&&(i!==void 0||Wh(n.base_,r)))return!0;rh(n),nd(n)}return n.copy_[r]===i&&(i!==void 0||r in n.copy_)||Number.isNaN(i)&&Number.isNaN(n.copy_[r])||(n.copy_[r]=i,n.assigned_[r]=!0),!0},deleteProperty(n,r){return nh(n.base_,r)!==void 0||r in n.base_?(n.assigned_[r]=!1,rh(n),nd(n)):delete n.assigned_[r],n.copy_&&delete n.copy_[r],!0},getOwnPropertyDescriptor(n,r){const i=Ua(n),s=Reflect.getOwnPropertyDescriptor(i,r);return s&&{writable:!0,configurable:n.type_!==1||r!=="length",enumerable:s.enumerable,value:i[r]}},defineProperty(){In(11)},getPrototypeOf(n){return wi(n.base_)},setPrototypeOf(){In(12)}},Ws={};Wo(Ld,(n,r)=>{Ws[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}});Ws.deleteProperty=function(n,r){return Ws.set.call(this,n,r,void 0)};Ws.set=function(n,r,i){return Ld.set.call(this,n[0],r,i,n[0])};function nh(n,r){const i=n[on];return(i?Ua(i):n)[r]}function Gx(n,r,i){const s=bb(r,i);return s?"value"in s?s.value:s.get?.call(n.draft_):void 0}function bb(n,r){if(!(r in n))return;let i=wi(n);for(;i;){const s=Object.getOwnPropertyDescriptor(i,r);if(s)return s;i=wi(i)}}function nd(n){n.modified_||(n.modified_=!0,n.parent_&&nd(n.parent_))}function rh(n){n.copy_||(n.copy_=Jh(n.base_,n.scope_.immer_.useStrictShallowCopy_))}var kx=class{constructor(n){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(r,i,s)=>{if(typeof r=="function"&&typeof i!="function"){const c=i;i=r;const h=this;return function(m=c,...g){return h.produce(m,y=>i.call(this,y,...g))}}typeof i!="function"&&In(6),s!==void 0&&typeof s!="function"&&In(7);let u;if(wr(r)){const c=tv(this),h=rd(r,void 0);let d=!0;try{u=i(h),d=!1}finally{d?ed(c):td(c)}return ev(c,s),nv(u,c)}else if(!r||typeof r!="object"){if(u=i(r),u===void 0&&(u=r),u===pb&&(u=void 0),this.autoFreeze_&&Bd(u,!0),s){const c=[],h=[];Ga("Patches").generateReplacementPatches_(r,u,c,h),s(c,h)}return u}else In(1,r)},this.produceWithPatches=(r,i)=>{if(typeof r=="function")return(h,...d)=>this.produceWithPatches(h,m=>r(m,...d));let s,u;return[this.produce(r,i,(h,d)=>{s=h,u=d}),s,u]},typeof n?.autoFreeze=="boolean"&&this.setAutoFreeze(n.autoFreeze),typeof n?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(n.useStrictShallowCopy)}createDraft(n){wr(n)||In(8),za(n)&&(n=qx(n));const r=tv(this),i=rd(n,void 0);return i[on].isManual_=!0,td(r),i}finishDraft(n,r){const i=n&&n[on];(!i||!i.isManual_)&&In(9);const{scope_:s}=i;return ev(s,r),nv(void 0,s)}setAutoFreeze(n){this.autoFreeze_=n}setUseStrictShallowCopy(n){this.useStrictShallowCopy_=n}applyPatches(n,r){let i;for(i=r.length-1;i>=0;i--){const u=r[i];if(u.path.length===0&&u.op==="replace"){n=u.value;break}}i>-1&&(r=r.slice(i+1));const s=Ga("Patches").applyPatches_;return za(n)?s(n,r):this.produce(n,u=>s(u,r))}};function rd(n,r){const i=uu(n)?Ga("MapSet").proxyMap_(n,r):cu(n)?Ga("MapSet").proxySet_(n,r):zx(n,r);return(r?r.scope_:vb()).drafts_.push(i),i}function qx(n){return za(n)||In(10,n),_b(n)}function _b(n){if(!wr(n)||fu(n))return n;const r=n[on];let i;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,i=Jh(n,r.scope_.immer_.useStrictShallowCopy_)}else i=Jh(n,!0);return Wo(i,(s,u)=>{yb(i,s,_b(u))}),r&&(r.finalized_=!1),i}var un=new kx,Eb=un.produce;un.produceWithPatches.bind(un);un.setAutoFreeze.bind(un);un.setUseStrictShallowCopy.bind(un);un.applyPatches.bind(un);un.createDraft.bind(un);un.finishDraft.bind(un);function Sb(n){return({dispatch:i,getState:s})=>u=>c=>typeof c=="function"?c(i,s,n):u(c)}var Fx=Sb(),Px=Sb,Vx=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?$o:$o.apply(null,arguments)};function av(n,r){function i(...s){if(r){let u=r(...s);if(!u)throw new Error(Ar(0));return{type:n,payload:u.payload,..."meta"in u&&{meta:u.meta},..."error"in u&&{error:u.error}}}return{type:n,payload:s[0]}}return i.toString=()=>`${n}`,i.type=n,i.match=s=>Dx(s)&&s.type===n,i}var Tb=class Xs extends Array{constructor(...r){super(...r),Object.setPrototypeOf(this,Xs.prototype)}static get[Symbol.species](){return Xs}concat(...r){return super.concat.apply(this,r)}prepend(...r){return r.length===1&&Array.isArray(r[0])?new Xs(...r[0].concat(this)):new Xs(...r.concat(this))}};function iv(n){return wr(n)?Eb(n,()=>{}):n}function Lo(n,r,i){return n.has(r)?n.get(r):n.set(r,i(r)).get(r)}function Yx(n){return typeof n=="boolean"}var Xx=()=>function(r){const{thunk:i=!0,immutableCheck:s=!0,serializableCheck:u=!0,actionCreatorCheck:c=!0}=r??{};let h=new Tb;return i&&(Yx(i)?h.push(Fx):h.push(Px(i.extraArgument))),h},Zx="RTK_autoBatch",sv=n=>r=>{setTimeout(r,n)},Qx=(n={type:"raf"})=>r=>(...i)=>{const s=r(...i);let u=!0,c=!1,h=!1;const d=new Set,m=n.type==="tick"?queueMicrotask:n.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:sv(10):n.type==="callback"?n.queueNotification:sv(n.timeout),g=()=>{h=!1,c&&(c=!1,d.forEach(y=>y()))};return Object.assign({},s,{subscribe(y){const _=()=>u&&y(),T=s.subscribe(_);return d.add(y),()=>{T(),d.delete(y)}},dispatch(y){try{return u=!y?.meta?.[Zx],c=!u,c&&(h||(h=!0,m(g))),s.dispatch(y)}finally{u=!0}}})},Kx=n=>function(i){const{autoBatch:s=!0}=i??{};let u=new Tb(n);return s&&u.push(Qx(typeof s=="object"?s:void 0)),u};function $x(n){const r=Xx(),{reducer:i=void 0,middleware:s,devTools:u=!0,preloadedState:c=void 0,enhancers:h=void 0}=n||{};let d;if(typeof i=="function")d=i;else if(Dd(i))d=mb(i);else throw new Error(Ar(1));let m;typeof s=="function"?m=s(r):m=r();let g=$o;u&&(g=Vx({trace:!1,...typeof u=="object"&&u}));const y=Mx(...m),_=Kx(y);let T=typeof h=="function"?h(_):_();const L=g(...T);return db(d,c,L)}function Ab(n){const r={},i=[];let s;const u={addCase(c,h){const d=typeof c=="string"?c:c.type;if(!d)throw new Error(Ar(28));if(d in r)throw new Error(Ar(29));return r[d]=h,u},addMatcher(c,h){return i.push({matcher:c,reducer:h}),u},addDefaultCase(c){return s=c,u}};return n(u),[r,i,s]}function Wx(n){return typeof n=="function"}function Jx(n,r){let[i,s,u]=Ab(r),c;if(Wx(n))c=()=>iv(n());else{const d=iv(n);c=()=>d}function h(d=c(),m){let g=[i[m.type],...s.filter(({matcher:y})=>y(m)).map(({reducer:y})=>y)];return g.filter(y=>!!y).length===0&&(g=[u]),g.reduce((y,_)=>{if(_)if(za(y)){const L=_(y,m);return L===void 0?y:L}else{if(wr(y))return Eb(y,T=>_(T,m));{const T=_(y,m);if(T===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return T}}return y},d)}return h.getInitialState=c,h}var eO=Symbol.for("rtk-slice-createasyncthunk");function tO(n,r){return`${n}/${r}`}function nO({creators:n}={}){const r=n?.asyncThunk?.[eO];return function(s){const{name:u,reducerPath:c=u}=s;if(!u)throw new Error(Ar(11));const h=(typeof s.reducers=="function"?s.reducers(aO()):s.reducers)||{},d=Object.keys(h),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},g={addCase(S,I){const x=typeof S=="string"?S:S.type;if(!x)throw new Error(Ar(12));if(x in m.sliceCaseReducersByType)throw new Error(Ar(13));return m.sliceCaseReducersByType[x]=I,g},addMatcher(S,I){return m.sliceMatchers.push({matcher:S,reducer:I}),g},exposeAction(S,I){return m.actionCreators[S]=I,g},exposeCaseReducer(S,I){return m.sliceCaseReducersByName[S]=I,g}};d.forEach(S=>{const I=h[S],x={reducerName:S,type:tO(u,S),createNotation:typeof s.reducers=="function"};sO(I)?oO(x,I,g,r):iO(x,I,g)});function y(){const[S={},I=[],x=void 0]=typeof s.extraReducers=="function"?Ab(s.extraReducers):[s.extraReducers],Z={...S,...m.sliceCaseReducersByType};return Jx(s.initialState,$=>{for(let ie in Z)$.addCase(ie,Z[ie]);for(let ie of m.sliceMatchers)$.addMatcher(ie.matcher,ie.reducer);for(let ie of I)$.addMatcher(ie.matcher,ie.reducer);x&&$.addDefaultCase(x)})}const _=S=>S,T=new Map,L=new WeakMap;let N;function V(S,I){return N||(N=y()),N(S,I)}function G(){return N||(N=y()),N.getInitialState()}function E(S,I=!1){function x($){let ie=$[S];return typeof ie>"u"&&I&&(ie=Lo(L,x,G)),ie}function Z($=_){const ie=Lo(T,I,()=>new WeakMap);return Lo(ie,$,()=>{const _e={};for(const[Re,se]of Object.entries(s.selectors??{}))_e[Re]=rO(se,$,()=>Lo(L,$,G),I);return _e})}return{reducerPath:S,getSelectors:Z,get selectors(){return Z(x)},selectSlice:x}}const w={name:u,reducer:V,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:G,...E(c),injectInto(S,{reducerPath:I,...x}={}){const Z=I??c;return S.inject({reducerPath:Z,reducer:V},x),{...w,...E(Z,!0)}}};return w}}function rO(n,r,i,s){function u(c,...h){let d=r(c);return typeof d>"u"&&s&&(d=i()),n(d,...h)}return u.unwrapped=n,u}var Ud=nO();function aO(){function n(r,i){return{_reducerDefinitionType:"asyncThunk",payloadCreator:r,...i}}return n.withTypes=()=>n,{reducer(r){return Object.assign({[r.name](...i){return r(...i)}}[r.name],{_reducerDefinitionType:"reducer"})},preparedReducer(r,i){return{_reducerDefinitionType:"reducerWithPrepare",prepare:r,reducer:i}},asyncThunk:n}}function iO({type:n,reducerName:r,createNotation:i},s,u){let c,h;if("reducer"in s){if(i&&!lO(s))throw new Error(Ar(17));c=s.reducer,h=s.prepare}else c=s;u.addCase(n,c).exposeCaseReducer(r,c).exposeAction(r,h?av(n,h):av(n))}function sO(n){return n._reducerDefinitionType==="asyncThunk"}function lO(n){return n._reducerDefinitionType==="reducerWithPrepare"}function oO({type:n,reducerName:r},i,s,u){if(!u)throw new Error(Ar(18));const{payloadCreator:c,fulfilled:h,pending:d,rejected:m,settled:g,options:y}=i,_=u(n,c,y);s.exposeAction(r,_),h&&s.addCase(_.fulfilled,h),d&&s.addCase(_.pending,d),m&&s.addCase(_.rejected,m),g&&s.addMatcher(_.settled,g),s.exposeCaseReducer(r,{fulfilled:h||Uo,pending:d||Uo,rejected:m||Uo,settled:g||Uo})}function Uo(){}function Ar(n){return`Minified Redux Toolkit error #${n}; visit https://redux-toolkit.js.org/Errors?code=${n} for the full message or use the non-minified dev environment for full errors. `}const uO={formValues:{}},xb=Ud({name:"start-screen",initialState:uO,reducers:{showStartScreen(n){n.startScreenStatus="VISIBLE",n.formValues={}},startChat(n,r){n.startScreenStatus="HIDDEN",n.formValues=r.payload}}}),{startChat:cO,showStartScreen:fO}=xb.actions,hO=xb.reducer,Ob="RESET_CHAT_STATE",Rb="TOGGLE_TRANSCRIPT_MAIL_OVERLAY",dO=()=>({type:ob}),mO=()=>({type:Ob}),wb=()=>({type:Rb}),lv=(n,r,i)=>(s,u)=>{try{const c=u().connection.sessionId;if(!c)throw new Error("Session ID is not available");s({type:Nd,payload:{chunkId:i}}),ov(n,c,r,i,!1,s),ov(n,c,r,i,!0,s)}catch(c){console.error("Error loading source infos:",c),s({type:Cd})}},ov=(n,r,i,s,u,c)=>{const h=`/${n}/me/chat-widget/transcript/${i}/chunks/${s}?highlight=${u}`;fetch(h,{headers:{"x-bubble-chat-session-id":r}}).then(d=>{if(!d.ok)throw new Error(`HTTP error! Status: ${d.status}`);return d.json()}).then(d=>{const m={...d,chunkId:s,highlighted:u};c({type:sb,payload:m})}).catch(d=>{console.error("Error fetching source infos:",d),c({type:Cd,payload:{highlighted:u}})})},pO=()=>({type:Md}),Hd="CONNECT",jd="CONNECTING",Id="CONNECTED",zd="DISCONNECTED",Gd="RECONNECTED",kd="RESTORE_SESSION_ID",hu="START",du="CLEAR_SESSION_ID",gO=[Hd,jd,Id,zd,Gd,kd],yO=(n,r)=>({type:Hd,clientName:n,querystrings:r}),vO=n=>({type:kd,sessionId:n}),bO=()=>({type:jd}),_O=()=>({type:Id}),EO=()=>({type:zd}),SO=()=>({type:Gd}),Cb=(n,r)=>(i,s)=>{const u=s().connection,c=s().startScreen.formValues;let h=u.sessionId;h===void 0&&(h=$h());let d=u.userId;if(d===void 0){const m=Bo.get("bubble-chat-user-id")||Bo.get("bubble-chat-userId")||Bo.get("bf-webclient-userId");d=m||$h(),Bo.set("bubble-chat-user-id",d)}i({type:hu,payload:{sessionId:h,userId:d,clientName:n,querystrings:{...r,...c}}})},mu=(n,r)=>(i,s)=>{const u=s().connection.sessionId||"";if(i(TO(u)),i(mO()),s().settings.enableStartScreen)i(fO());else return i(Cb(n,r))},TO=n=>({type:du,payload:{sessionId:n}}),tt=()=>{const n=su();return i=>{const s=n.formatMessage({id:i});return s===i?void 0:s}};var ja=(n=>(n[n.CONNECTING=0]="CONNECTING",n[n.CONNECTED=1]="CONNECTED",n[n.RECONNECTED=2]="RECONNECTED",n[n.DISCONNECTED=3]="DISCONNECTED",n))(ja||{}),tu=(n=>(n.GUEST="GUEST",n.BOT="BOT",n.PERSON="PERSON",n))(tu||{});const AO="_container_q2uun_1",xO="_chatcontent_q2uun_6",OO="_accessabilityHidden_q2uun_12",ah={container:AO,chatcontent:xO,accessabilityHidden:OO},RO="_messageContainer_ofi0g_1",wO="_messages_ofi0g_12",uv={messageContainer:RO,messages:wO};function Ha(){return Ha=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},Ha.apply(this,arguments)}const CO=["children","options"],NO={footnoteReference:"7"},cv=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((n,r)=>(n[r.toLowerCase()]=r,n),{class:"className",for:"htmlFor"}),fv={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},MO=["style","script","pre"],DO=["src","href","data","formAction","srcDoc","action"],BO=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,LO=/mailto:/i,UO=/\n{2,}$/,hv=/^(\s*>[\s\S]*?)(?=\n\n|$)/,HO=/^ *> ?/gm,jO=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,IO=/^ {2,}\n/,zO=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,dv=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,mv=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,GO=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,kO=/^(?:\n *)*\n/,qO=/\r\n?/g,FO=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,PO=/^\[\^([^\]]+)]/,VO=/\f/g,YO=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,XO=/^\s*?\[(x|\s)\]/,pv=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,gv=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,yv=/^([^\n]+)\n *(=|-){3,} *\n/,ih=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,ZO=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,vv=/^<!--[\s\S]*?(?:-->)/,QO=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,sh=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,KO=/^\{.*\}$/,$O=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,WO=/^<([^ >]+@[^ >]+)>/,JO=/^<([^ >]+:\/[^ >]+)>/,eR=/-([a-z])?/gi,bv=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,tR=/^[^\n]+(?: \n|\n{2,})/,nR=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,rR=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,aR=/^\[([^\]]*)\] ?\[([^\]]*)\]/,iR=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,sR=/\t/g,lR=/(^ *\||\| *$)/g,oR=/^ *:-+: *$/,uR=/^ *:-+ *$/,cR=/^ *-+: *$/,pu="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",fR=RegExp(`^([*_])\\1${pu}\\1\\1(?!\\1)`),hR=RegExp(`^([*_])${pu}\\1(?!\\1)`),dR=RegExp(`^(==)${pu}\\1`),mR=RegExp(`^(~~)${pu}\\1`),pR=/^\\([^0-9A-Za-z\s])/,gR=/\\([^0-9A-Za-z\s])/g,yR=/^[\s\S](?:(?! |[0-9]\.|http)[^=*_~\-\n<`\\\[!])*/,vR=/^\n+/,bR=/^([ \t]*)/,_R=/(?:^|\n)( *)$/,qd="(?:\\d+\\.)",Fd="(?:[*+-])";function Nb(n){return"( *)("+(n===1?qd:Fd)+") +"}const Mb=Nb(1),Db=Nb(2);function Bb(n){return RegExp("^"+(n===1?Mb:Db))}const ER=Bb(1),SR=Bb(2);function Lb(n){return RegExp("^"+(n===1?Mb:Db)+"[^\\n]*(?:\\n(?!\\1"+(n===1?qd:Fd)+" )[^\\n]*)*(\\n|$)","gm")}const TR=Lb(1),AR=Lb(2);function Ub(n){const r=n===1?qd:Fd;return RegExp("^( *)("+r+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+r+" (?!"+r+" ))\\n*|\\s*\\n*$)")}const Hb=Ub(1),jb=Ub(2);function _v(n,r){const i=r===1,s=i?Hb:jb,u=i?TR:AR,c=i?ER:SR;return{t:h=>c.test(h),o:rl(function(h,d){const m=_R.exec(d.prevCapture);return m&&(d.list||!d.inline&&!d.simple)?s.exec(h=m[1]+h):null}),i:1,u(h,d,m){const g=i?+h[2]:void 0,y=h[0].replace(UO,`
|
|
93
|
+
*/var ly;function yA(){if(ly)return Le;ly=1;var n=typeof Symbol=="function"&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,u=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,h=n?Symbol.for("react.provider"):60109,d=n?Symbol.for("react.context"):60110,m=n?Symbol.for("react.async_mode"):60111,g=n?Symbol.for("react.concurrent_mode"):60111,y=n?Symbol.for("react.forward_ref"):60112,_=n?Symbol.for("react.suspense"):60113,T=n?Symbol.for("react.suspense_list"):60120,L=n?Symbol.for("react.memo"):60115,N=n?Symbol.for("react.lazy"):60116,V=n?Symbol.for("react.block"):60121,G=n?Symbol.for("react.fundamental"):60117,E=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function S(x){if(typeof x=="object"&&x!==null){var Z=x.$$typeof;switch(Z){case r:switch(x=x.type,x){case m:case g:case s:case c:case u:case _:return x;default:switch(x=x&&x.$$typeof,x){case d:case y:case N:case L:case h:return x;default:return Z}}case i:return Z}}}function I(x){return S(x)===g}return Le.AsyncMode=m,Le.ConcurrentMode=g,Le.ContextConsumer=d,Le.ContextProvider=h,Le.Element=r,Le.ForwardRef=y,Le.Fragment=s,Le.Lazy=N,Le.Memo=L,Le.Portal=i,Le.Profiler=c,Le.StrictMode=u,Le.Suspense=_,Le.isAsyncMode=function(x){return I(x)||S(x)===m},Le.isConcurrentMode=I,Le.isContextConsumer=function(x){return S(x)===d},Le.isContextProvider=function(x){return S(x)===h},Le.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===r},Le.isForwardRef=function(x){return S(x)===y},Le.isFragment=function(x){return S(x)===s},Le.isLazy=function(x){return S(x)===N},Le.isMemo=function(x){return S(x)===L},Le.isPortal=function(x){return S(x)===i},Le.isProfiler=function(x){return S(x)===c},Le.isStrictMode=function(x){return S(x)===u},Le.isSuspense=function(x){return S(x)===_},Le.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===s||x===g||x===c||x===u||x===_||x===T||typeof x=="object"&&x!==null&&(x.$$typeof===N||x.$$typeof===L||x.$$typeof===h||x.$$typeof===d||x.$$typeof===y||x.$$typeof===G||x.$$typeof===E||x.$$typeof===w||x.$$typeof===V)},Le.typeOf=S,Le}var oy;function vA(){return oy||(oy=1,kf.exports=yA()),kf.exports}var qf,uy;function bA(){if(uy)return qf;uy=1;var n=vA(),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},u={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c={};c[n.ForwardRef]=s,c[n.Memo]=u;function h(N){return n.isMemo(N)?u:c[N.$$typeof]||r}var d=Object.defineProperty,m=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols,y=Object.getOwnPropertyDescriptor,_=Object.getPrototypeOf,T=Object.prototype;function L(N,V,G){if(typeof V!="string"){if(T){var E=_(V);E&&E!==T&&L(N,E,G)}var w=m(V);g&&(w=w.concat(g(V)));for(var S=h(N),I=h(V),x=0;x<w.length;++x){var Z=w[x];if(!i[Z]&&!(G&&G[Z])&&!(I&&I[Z])&&!(S&&S[Z])){var $=y(V,Z);try{d(N,Z,$)}catch{}}}}return N}return qf=L,qf}bA();var bd=typeof window<"u"&&!window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__?window.__REACT_INTL_CONTEXT__||(window.__REACT_INTL_CONTEXT__=H.createContext(null)):H.createContext(null);bd.Consumer;var _A=bd.Provider,EA=_A,SA=bd;function su(){var n=H.useContext(SA);return V1(n),n}var Yh;(function(n){n.formatDate="FormattedDate",n.formatTime="FormattedTime",n.formatNumber="FormattedNumber",n.formatList="FormattedList",n.formatDisplayName="FormattedDisplayName"})(Yh||(Yh={}));var Xh;(function(n){n.formatDate="FormattedDateParts",n.formatTime="FormattedTimeParts",n.formatNumber="FormattedNumberParts",n.formatList="FormattedListParts"})(Xh||(Xh={}));function X1(n){var r=function(i){var s=su(),u=i.value,c=i.children,h=iu(i,["value","children"]),d=typeof u=="string"?new Date(u||0):u,m=n==="formatDate"?s.formatDateToParts(d,h):s.formatTimeToParts(d,h);return c(m)};return r.displayName=Xh[n],r}function nl(n){var r=function(i){var s=su(),u=i.value,c=i.children,h=iu(i,["value","children"]),d=s[n](u,h);if(typeof c=="function")return c(d);var m=s.textComponent||H.Fragment;return H.createElement(m,null,d)};return r.displayName=Yh[n],r}function Z1(n){return n&&Object.keys(n).reduce(function(r,i){var s=n[i];return r[i]=z1(s)?pA(s):s,r},{})}var cy=function(n,r,i,s){for(var u=[],c=4;c<arguments.length;c++)u[c-4]=arguments[c];var h=Z1(s),d=Vh.apply(void 0,$n([n,r,i,h],u,!1));return Array.isArray(d)?mA(d):d},fy=function(n,r){var i=n.defaultRichTextElements,s=iu(n,["defaultRichTextElements"]),u=Z1(i),c=cA(ae(ae(ae({},Y1),s),{defaultRichTextElements:u}),r),h={locale:c.locale,timeZone:c.timeZone,fallbackOnEmptyString:c.fallbackOnEmptyString,formats:c.formats,defaultLocale:c.defaultLocale,defaultFormats:c.defaultFormats,messages:c.messages,onError:c.onError,defaultRichTextElements:u};return ae(ae({},c),{formatMessage:cy.bind(null,h,c.formatters),$t:cy.bind(null,h,c.formatters)})};function Ff(n){return{locale:n.locale,timeZone:n.timeZone,fallbackOnEmptyString:n.fallbackOnEmptyString,formats:n.formats,textComponent:n.textComponent,messages:n.messages,defaultLocale:n.defaultLocale,defaultFormats:n.defaultFormats,onError:n.onError,onWarn:n.onWarn,wrapRichTextChunksInFragment:n.wrapRichTextChunksInFragment,defaultRichTextElements:n.defaultRichTextElements}}var TA=function(n){Tn(r,n);function r(){var i=n!==null&&n.apply(this,arguments)||this;return i.cache=q1(),i.state={cache:i.cache,intl:fy(Ff(i.props),i.cache),prevConfig:Ff(i.props)},i}return r.getDerivedStateFromProps=function(i,s){var u=s.prevConfig,c=s.cache,h=Ff(i);return gA(u,h)?null:{intl:fy(h,c),prevConfig:h}},r.prototype.render=function(){return V1(this.state.intl),H.createElement(EA,{value:this.state.intl},this.props.children)},r.displayName="IntlProvider",r.defaultProps=Y1,r}(H.PureComponent);nl("formatDate");nl("formatTime");nl("formatNumber");nl("formatList");nl("formatDisplayName");X1("formatDate");X1("formatTime");const AA="_app_1rj0t_1",xA={app:AA},ka=k2,Zt=P2,Q1="%[a-f0-9]{2}",hy=new RegExp("("+Q1+")|([^%]+?)","gi"),dy=new RegExp("("+Q1+")+","gi");function Zh(n,r){try{return[decodeURIComponent(n.join(""))]}catch{}if(n.length===1)return n;r=r||1;const i=n.slice(0,r),s=n.slice(r);return Array.prototype.concat.call([],Zh(i),Zh(s))}function OA(n){try{return decodeURIComponent(n)}catch{let r=n.match(hy)||[];for(let i=1;i<r.length;i++)n=Zh(r,i).join(""),r=n.match(hy)||[];return n}}function RA(n){const r={"%FE%FF":"��","%FF%FE":"��"};let i=dy.exec(n);for(;i;){try{r[i[0]]=decodeURIComponent(i[0])}catch{const u=OA(i[0]);u!==i[0]&&(r[i[0]]=u)}i=dy.exec(n)}r["%C2"]="�";const s=Object.keys(r);for(const u of s)n=n.replace(new RegExp(u,"g"),r[u]);return n}function wA(n){if(typeof n!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof n+"`");try{return decodeURIComponent(n)}catch{return RA(n)}}function CA(n,r){const i={};if(Array.isArray(r))for(const s of r){const u=Object.getOwnPropertyDescriptor(n,s);u?.enumerable&&Object.defineProperty(i,s,u)}else for(const s of Reflect.ownKeys(n)){const u=Object.getOwnPropertyDescriptor(n,s);if(u.enumerable){const c=n[s];r(s,c,n)&&Object.defineProperty(i,s,u)}}return i}function K1(n,r){if(!(typeof n=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(n===""||r==="")return[];const i=n.indexOf(r);return i===-1?[]:[n.slice(0,i),n.slice(i+r.length)]}const NA=n=>n==null,MA=n=>encodeURIComponent(n).replaceAll(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),Qh=Symbol("encodeFragmentIdentifier");function DA(n){switch(n.arrayFormat){case"index":return r=>(i,s)=>{const u=i.length;return s===void 0||n.skipNull&&s===null||n.skipEmptyString&&s===""?i:s===null?[...i,[ut(r,n),"[",u,"]"].join("")]:[...i,[ut(r,n),"[",ut(u,n),"]=",ut(s,n)].join("")]};case"bracket":return r=>(i,s)=>s===void 0||n.skipNull&&s===null||n.skipEmptyString&&s===""?i:s===null?[...i,[ut(r,n),"[]"].join("")]:[...i,[ut(r,n),"[]=",ut(s,n)].join("")];case"colon-list-separator":return r=>(i,s)=>s===void 0||n.skipNull&&s===null||n.skipEmptyString&&s===""?i:s===null?[...i,[ut(r,n),":list="].join("")]:[...i,[ut(r,n),":list=",ut(s,n)].join("")];case"comma":case"separator":case"bracket-separator":{const r=n.arrayFormat==="bracket-separator"?"[]=":"=";return i=>(s,u)=>u===void 0||n.skipNull&&u===null||n.skipEmptyString&&u===""?s:(u=u===null?"":u,s.length===0?[[ut(i,n),r,ut(u,n)].join("")]:[[s,ut(u,n)].join(n.arrayFormatSeparator)])}default:return r=>(i,s)=>s===void 0||n.skipNull&&s===null||n.skipEmptyString&&s===""?i:s===null?[...i,ut(r,n)]:[...i,[ut(r,n),"=",ut(s,n)].join("")]}}function BA(n){let r;switch(n.arrayFormat){case"index":return(i,s,u)=>{if(r=/\[(\d*)]$/.exec(i),i=i.replace(/\[\d*]$/,""),!r){u[i]=s;return}u[i]===void 0&&(u[i]={}),u[i][r[1]]=s};case"bracket":return(i,s,u)=>{if(r=/(\[])$/.exec(i),i=i.replace(/\[]$/,""),!r){u[i]=s;return}if(u[i]===void 0){u[i]=[s];return}u[i]=[...u[i],s]};case"colon-list-separator":return(i,s,u)=>{if(r=/(:list)$/.exec(i),i=i.replace(/:list$/,""),!r){u[i]=s;return}if(u[i]===void 0){u[i]=[s];return}u[i]=[...u[i],s]};case"comma":case"separator":return(i,s,u)=>{const c=typeof s=="string"&&s.includes(n.arrayFormatSeparator),h=typeof s=="string"&&!c&&Tr(s,n).includes(n.arrayFormatSeparator);s=h?Tr(s,n):s;const d=c||h?s.split(n.arrayFormatSeparator).map(m=>Tr(m,n)):s===null?s:Tr(s,n);u[i]=d};case"bracket-separator":return(i,s,u)=>{const c=/(\[])$/.test(i);if(i=i.replace(/\[]$/,""),!c){u[i]=s&&Tr(s,n);return}const h=s===null?[]:Tr(s,n).split(n.arrayFormatSeparator);if(u[i]===void 0){u[i]=h;return}u[i]=[...u[i],...h]};default:return(i,s,u)=>{if(u[i]===void 0){u[i]=s;return}u[i]=[...[u[i]].flat(),s]}}}function $1(n){if(typeof n!="string"||n.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function ut(n,r){return r.encode?r.strict?MA(n):encodeURIComponent(n):n}function Tr(n,r){return r.decode?wA(n):n}function W1(n){return Array.isArray(n)?n.sort():typeof n=="object"?W1(Object.keys(n)).sort((r,i)=>Number(r)-Number(i)).map(r=>n[r]):n}function J1(n){const r=n.indexOf("#");return r!==-1&&(n=n.slice(0,r)),n}function LA(n){let r="";const i=n.indexOf("#");return i!==-1&&(r=n.slice(i)),r}function my(n,r,i){return i==="string"&&typeof n=="string"?n:typeof i=="function"&&typeof n=="string"?i(n):i==="boolean"&&n===null?!0:i==="boolean"&&n!==null&&(n.toLowerCase()==="true"||n.toLowerCase()==="false")?n.toLowerCase()==="true":i==="boolean"&&n!==null&&(n.toLowerCase()==="1"||n.toLowerCase()==="0")?n.toLowerCase()==="1":i==="string[]"&&r.arrayFormat!=="none"&&typeof n=="string"?[n]:i==="number[]"&&r.arrayFormat!=="none"&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?[Number(n)]:i==="number"&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?Number(n):r.parseBooleans&&n!==null&&(n.toLowerCase()==="true"||n.toLowerCase()==="false")?n.toLowerCase()==="true":r.parseNumbers&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?Number(n):n}function _d(n){n=J1(n);const r=n.indexOf("?");return r===-1?"":n.slice(r+1)}function Ed(n,r){r={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...r},$1(r.arrayFormatSeparator);const i=BA(r),s=Object.create(null);if(typeof n!="string"||(n=n.trim().replace(/^[?#&]/,""),!n))return s;for(const u of n.split("&")){if(u==="")continue;const c=r.decode?u.replaceAll("+"," "):u;let[h,d]=K1(c,"=");h===void 0&&(h=c),d=d===void 0?null:["comma","separator","bracket-separator"].includes(r.arrayFormat)?d:Tr(d,r),i(Tr(h,r),d,s)}for(const[u,c]of Object.entries(s))if(typeof c=="object"&&c!==null&&r.types[u]!=="string")for(const[h,d]of Object.entries(c)){const m=r.types[u]?r.types[u].replace("[]",""):void 0;c[h]=my(d,r,m)}else typeof c=="object"&&c!==null&&r.types[u]==="string"?s[u]=Object.values(c).join(r.arrayFormatSeparator):s[u]=my(c,r,r.types[u]);return r.sort===!1?s:(r.sort===!0?Object.keys(s).sort():Object.keys(s).sort(r.sort)).reduce((u,c)=>{const h=s[c];return u[c]=h&&typeof h=="object"&&!Array.isArray(h)?W1(h):h,u},Object.create(null))}function eb(n,r){if(!n)return"";r={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...r},$1(r.arrayFormatSeparator);const i=h=>r.skipNull&&NA(n[h])||r.skipEmptyString&&n[h]==="",s=DA(r),u={};for(const[h,d]of Object.entries(n))i(h)||(u[h]=d);const c=Object.keys(u);return r.sort!==!1&&c.sort(r.sort),c.map(h=>{const d=n[h];return d===void 0?"":d===null?ut(h,r):Array.isArray(d)?d.length===0&&r.arrayFormat==="bracket-separator"?ut(h,r)+"[]":d.reduce(s(h),[]).join("&"):ut(h,r)+"="+ut(d,r)}).filter(h=>h.length>0).join("&")}function tb(n,r){r={decode:!0,...r};let[i,s]=K1(n,"#");return i===void 0&&(i=n),{url:i?.split("?")?.[0]??"",query:Ed(_d(n),r),...r&&r.parseFragmentIdentifier&&s?{fragmentIdentifier:Tr(s,r)}:{}}}function nb(n,r){r={encode:!0,strict:!0,[Qh]:!0,...r};const i=J1(n.url).split("?")[0]||"",s=_d(n.url),u={...Ed(s,{sort:!1,...r}),...n.query};let c=eb(u,r);c&&=`?${c}`;let h=LA(n.url);if(typeof n.fragmentIdentifier=="string"){const d=new URL(i);d.hash=n.fragmentIdentifier,h=r[Qh]?d.hash:`#${n.fragmentIdentifier}`}return`${i}${c}${h}`}function rb(n,r,i){i={parseFragmentIdentifier:!0,[Qh]:!1,...i};const{url:s,query:u,fragmentIdentifier:c}=tb(n,i);return nb({url:s,query:CA(u,r),fragmentIdentifier:c},i)}function UA(n,r,i){const s=Array.isArray(r)?u=>!r.includes(u):(u,c)=>!r(u,c);return rb(n,s,i)}const lu=Object.freeze(Object.defineProperty({__proto__:null,exclude:UA,extract:_d,parse:Ed,parseUrl:tb,pick:rb,stringify:eb,stringifyUrl:nb},Symbol.toStringTag,{value:"Module"}));var Dn={},Bn={},Ie={},_o={},pe={},py;function cn(){return py||(py=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.GUEST_LOCALE_CHANGED=pe.DRAWER_CLOSE=pe.DRAWER_OPEN=pe.CONVERSATION_RATING_FROM_GUEST=pe.TRANSCRIPT_ITEM_GUEST_REACTION=pe.TRANSCRIPT_MAIL_REQUEST=pe.INBOX_CONNECT_REQUEST=pe.RESTART_CHAT_REQUEST=pe.EVENT_TO_GUEST=pe.NLU_REQUEST_EVENT=pe.EXPERTS_DISCONNECTED=pe.EXPERTS_DISCONNECT_REQUEST=pe.EXPERTS_CONNECTED=pe.EXPERTS_CONNECT_REQUEST=pe.MESSAGE_TO_GUEST=pe.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST=pe.MESSAGE_FROM_GUEST=pe.GUEST_FEEDBACK_RESPONSE=pe.GUEST_DISCONNECTED=pe.GUEST_CONNECTED=pe.TYPING_OFF=pe.TYPING_ON=void 0,pe.TYPING_ON="core.typing.on",pe.TYPING_OFF="core.typing.off",pe.GUEST_CONNECTED="core.guest.connected",pe.GUEST_DISCONNECTED="core.guest.disconnected",pe.GUEST_FEEDBACK_RESPONSE="core.guest.feedback.response",pe.MESSAGE_FROM_GUEST="core.message.from.guest",pe.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST="core.message.without.analysis.from.guest",pe.MESSAGE_TO_GUEST="core.message.to.guest",pe.EXPERTS_CONNECT_REQUEST="core.experts.connect.request",pe.EXPERTS_CONNECTED="core.experts.connected",pe.EXPERTS_DISCONNECT_REQUEST="core.experts.disconnect.request",pe.EXPERTS_DISCONNECTED="core.experts.disconnected",pe.NLU_REQUEST_EVENT="core.nlu.request.event",pe.EVENT_TO_GUEST="core.event.to.guest",pe.RESTART_CHAT_REQUEST="core.chat.restart.request",pe.INBOX_CONNECT_REQUEST="core.inbox.connect.request",pe.TRANSCRIPT_MAIL_REQUEST="core.transcript.mail.request",pe.TRANSCRIPT_ITEM_GUEST_REACTION="core.transcript.item.guest.reaction",pe.CONVERSATION_RATING_FROM_GUEST="core.conversation.rating.from.guest",pe.DRAWER_OPEN="core.drawer.open",pe.DRAWER_CLOSE="core.drawer.close",pe.GUEST_LOCALE_CHANGED="core.guest.locale.changed"),pe}var gy;function HA(){if(gy)return _o;gy=1,Object.defineProperty(_o,"__esModule",{value:!0});const n=cn(),r=()=>({type:n.DRAWER_CLOSE});return _o.default=r,_o}var Eo={},yy;function jA(){if(yy)return Eo;yy=1,Object.defineProperty(Eo,"__esModule",{value:!0});const n=cn(),r=(i,s)=>({type:n.GUEST_FEEDBACK_RESPONSE,payload:{satisfaction:i,intent:s}});return Eo.default=r,Eo}var So={},vy;function IA(){if(vy)return So;vy=1,Object.defineProperty(So,"__esModule",{value:!0});const n=cn(),r=i=>({type:n.GUEST_CONNECTED,payload:{sessionId:i}});return So.default=r,So}var To={},by;function zA(){if(by)return To;by=1,Object.defineProperty(To,"__esModule",{value:!0});const n=cn(),r=i=>({type:n.GUEST_DISCONNECTED,payload:{sessionId:i}});return To.default=r,To}var Ao={},_y;function GA(){if(_y)return Ao;_y=1,Object.defineProperty(Ao,"__esModule",{value:!0});const n=cn(),r=(i,s)=>({type:n.GUEST_LOCALE_CHANGED,payload:{previousLocale:i,newLocale:s}});return Ao.default=r,Ao}var xo={},Ey;function kA(){if(Ey)return xo;Ey=1,Object.defineProperty(xo,"__esModule",{value:!0});const n=cn(),r=i=>({type:n.DRAWER_OPEN,payload:{parameters:{contentUrl:i}}});return xo.default=r,xo}var Oo={},Ke={},Sy;function Sd(){if(Sy)return Ke;Sy=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.getStringRepresentationFromMessage=Ke.MessageTypeEnum=Ke.AudioMessage=Ke.FileMessage=Ke.ImageMessage=Ke.VideoMessage=Ke.MarkdownMessage=Ke.DetailMessage=Ke.TextMessage=Ke.Message=void 0;class n{type;sender;sources;quickReplies;constructor(_,T,L=[],N=[]){this.type=_,this.sender=T,this.sources=L,this.quickReplies=N}addQuickReply(_,T){this.quickReplies.push({label:_,payload:T})}}Ke.Message=n;class r extends n{text;constructor(_,T,L=[],N=[]){super(m.TEXT,T,L,N),this.text=_}}Ke.TextMessage=r;class i extends n{title;text;imageUrl;itemUrl;buttons;constructor(_,T){super(m.DETAIL,T),this.title=_,this.text="",this.imageUrl="",this.itemUrl="",this.buttons=[]}setImageUrl(_){this.imageUrl=_}setItemUrl(_){this.itemUrl=_}setText(_){this.text=_}addButton(_){this.buttons.push(_)}}Ke.DetailMessage=i;class s extends n{markdown;constructor(_,T,L=[],N=[]){super(m.MARKDOWN,T,L,N),this.markdown=_}}Ke.MarkdownMessage=s;class u extends n{url;constructor(_,T){super(m.VIDEO,T),this.url=_}}Ke.VideoMessage=u;class c extends n{url;constructor(_,T){super(m.IMAGE,T),this.url=_}}Ke.ImageMessage=c;class h extends n{url;constructor(_,T){super(m.FILE,T),this.url=_}}Ke.FileMessage=h;class d extends n{url;constructor(_,T){super(m.AUDIO,T),this.url=_}}Ke.AudioMessage=d;var m;(function(y){y.TEXT="TEXT",y.DETAIL="DETAIL",y.MARKDOWN="MARKDOWN",y.VIDEO="VIDEO",y.IMAGE="IMAGE",y.FILE="FILE",y.AUDIO="AUDIO"})(m||(Ke.MessageTypeEnum=m={}));const g=y=>{switch(y.type){case m.TEXT:return y.text;case m.DETAIL:return`${y.title}`;case m.MARKDOWN:return y.markdown;case m.VIDEO:return`Video Url: ${y.url}`;case m.IMAGE:return`Image Url: ${y.url}`;case m.FILE:return`File Url: ${y.url}`;case m.AUDIO:return`Audio Url: ${y.url}`;default:throw new Error("Unknown message type "+y.type)}};return Ke.getStringRepresentationFromMessage=g,Ke}var an={},Ty;function Td(){if(Ty)return an;Ty=1,Object.defineProperty(an,"__esModule",{value:!0}),an.UserType=an.PersonUser=an.GuestUser=an.BotUser=an.User=void 0;class n{type;id;name;avatar;constructor(h,d,m,g){this.type=h,this.id=d,this.name=m,this.avatar=g}}an.User=n;class r extends n{constructor(){super(u.BOT,null,"Chatbot","bot.svg")}}an.BotUser=r;class i extends n{constructor(){super(u.GUEST,null,"Guest","visitor.svg")}}an.GuestUser=i;class s extends n{constructor(h,d,m){super(u.PERSON,h,d,m)}}an.PersonUser=s;var u;return function(c){c.GUEST="GUEST",c.BOT="BOT",c.PERSON="PERSON"}(u||(an.UserType=u={})),an}var Ay;function qA(){if(Ay)return Oo;Ay=1,Object.defineProperty(Oo,"__esModule",{value:!0});const n=Sd(),r=Td(),i=cn(),s=u=>{const c=new n.TextMessage(u,new r.GuestUser);return{type:i.MESSAGE_FROM_GUEST,message:c}};return Oo.default=s,Oo}var Ro={},xy;function FA(){if(xy)return Ro;xy=1,Object.defineProperty(Ro,"__esModule",{value:!0});const n=Sd(),r=Td(),i=cn(),s=(u,c={})=>{const h=new n.TextMessage(u,new r.GuestUser);return{type:i.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST,message:h,payload:c}};return Ro.default=s,Ro}var wo={},Oy;function PA(){if(Oy)return wo;Oy=1,Object.defineProperty(wo,"__esModule",{value:!0});const n=cn(),r=i=>({type:n.NLU_REQUEST_EVENT,event:i});return wo.default=r,wo}var Co={},Ry;function VA(){if(Ry)return Co;Ry=1,Object.defineProperty(Co,"__esModule",{value:!0});const n=cn(),r=()=>({type:n.RESTART_CHAT_REQUEST});return Co.default=r,Co}var No={},wy;function YA(){if(wy)return No;wy=1,Object.defineProperty(No,"__esModule",{value:!0});const n=cn(),r=i=>({type:n.MESSAGE_TO_GUEST,message:i});return No.default=r,No}var Mo={},Cy;function XA(){if(Cy)return Mo;Cy=1,Object.defineProperty(Mo,"__esModule",{value:!0});const n=cn(),r=(i,s)=>({type:n.TRANSCRIPT_ITEM_GUEST_REACTION,payload:{actionId:i,reaction:s}});return Mo.default=r,Mo}var Ny;function ZA(){if(Ny)return Ie;Ny=1;var n=Ie&&Ie.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.transcriptItemGuestReaction=Ie.sendMessageToGuest=Ie.restartChatRequest=Ie.requestNLUEvent=Ie.receiveTextMessageWithoutAnalysisFromGuest=Ie.receiveTextMessageFromGuest=Ie.openDrawer=Ie.guestLocaleChanged=Ie.guestDisconnected=Ie.guestConnected=Ie.feedbackFromGuestResponse=Ie.closeDrawer=void 0;const r=n(HA());Ie.closeDrawer=r.default;const i=n(jA());Ie.feedbackFromGuestResponse=i.default;const s=n(IA());Ie.guestConnected=s.default;const u=n(zA());Ie.guestDisconnected=u.default;const c=n(GA());Ie.guestLocaleChanged=c.default;const h=n(kA());Ie.openDrawer=h.default;const d=n(qA());Ie.receiveTextMessageFromGuest=d.default;const m=n(FA());Ie.receiveTextMessageWithoutAnalysisFromGuest=m.default;const g=n(PA());Ie.requestNLUEvent=g.default;const y=n(VA());Ie.restartChatRequest=y.default;const _=n(YA());Ie.sendMessageToGuest=_.default;const T=n(XA());return Ie.transcriptItemGuestReaction=T.default,Ie}var Pf={},My;function QA(){return My||(My=1,Object.defineProperty(Pf,"__esModule",{value:!0})),Pf}var Dy;function KA(){return Dy||(Dy=1,function(n){var r=Bn&&Bn.__createBinding||(Object.create?function(c,h,d,m){m===void 0&&(m=d);var g=Object.getOwnPropertyDescriptor(h,d);(!g||("get"in g?!h.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return h[d]}}),Object.defineProperty(c,m,g)}:function(c,h,d,m){m===void 0&&(m=d),c[m]=h[d]}),i=Bn&&Bn.__setModuleDefault||(Object.create?function(c,h){Object.defineProperty(c,"default",{enumerable:!0,value:h})}:function(c,h){c.default=h}),s=Bn&&Bn.__importStar||function(){var c=function(h){return c=Object.getOwnPropertyNames||function(d){var m=[];for(var g in d)Object.prototype.hasOwnProperty.call(d,g)&&(m[m.length]=g);return m},c(h)};return function(h){if(h&&h.__esModule)return h;var d={};if(h!=null)for(var m=c(h),g=0;g<m.length;g++)m[g]!=="default"&&r(d,h,m[g]);return i(d,h),d}}(),u=Bn&&Bn.__exportStar||function(c,h){for(var d in c)d!=="default"&&!Object.prototype.hasOwnProperty.call(h,d)&&r(h,c,d)};Object.defineProperty(n,"__esModule",{value:!0}),n.ActionTypes=n.Actions=void 0,n.Actions=s(ZA()),n.ActionTypes=s(cn()),u(QA(),n)}(Bn)),Bn}var sn={},Vf={},By;function $A(){return By||(By=1,Object.defineProperty(Vf,"__esModule",{value:!0})),Vf}var Ls={},Ly;function WA(){if(Ly)return Ls;Ly=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.NullableKnowledgeBaseAdapter=void 0;class n{async createApiKnowledgeBase(i){throw new Error("Method not implemented.")}async updateApiKnowledgeBase(i,s){throw new Error("Method not implemented.")}async deleteApiKnowledgeBase(i){throw new Error("Method not implemented.")}async upsertApiKnowledgeBase(i){throw new Error("Method not implemented.")}async findApiKnowledgeBaseById(i){throw new Error("Method not implemented.")}async findApiKnowledgeBaseByName(i){throw new Error("Method not implemented.")}async findApiKnowledgeBases(){throw new Error("Method not implemented.")}async deleteApiKnowledgeBaseByName(i){throw new Error("Method not implemented.")}async findKnowledgeBaseEntries(i){throw new Error("Method not implemented.")}async createKnowledgeBaseEntry(i,s){throw new Error("Method not implemented.")}async updateKnowledgeBaseEntry(i,s,u){throw new Error("Method not implemented.")}async deleteKnowledgeBaseEntry(i,s){throw new Error("Method not implemented.")}async upsertKnowledgeBaseEntry(i,s){throw new Error("Method not implemented.")}async retrieveKnowledgeBaseEntryConfig(i,s){throw new Error("Method not implemented.")}async findKnowledgeBaseEntryByUriAlias(i,s){throw new Error("Method not implemented.")}async deleteKnowledgeBaseEntriesIndexedBeforeDate(i,s){throw new Error("Method not implemented.")}async findKnowledgeBaseEntryAttachments(i,s){throw new Error("Method not implemented.")}async createKnowledgeBaseEntryAttachment(i,s,u){throw new Error("Method not implemented.")}async updateKnowledgeBaseEntryAttachment(i,s,u,c){throw new Error("Method not implemented.")}async deleteKnowledgeBaseEntryAttachment(i,s,u){throw new Error("Method not implemented.")}async setIndexingStatus(i,s){throw new Error("Method not implemented.")}async subscribeToReindex(i,s){throw new Error("Method not implemented.")}isContentTypeSupported(i){throw new Error("Method not implemented.")}registerTool(i,s){throw new Error("Method not implemented.")}async getTools(i){throw new Error("Method not implemented.")}}return Ls.NullableKnowledgeBaseAdapter=n,Ls}var Uy;function JA(){if(Uy)return sn;Uy=1;var n=sn&&sn.__createBinding||(Object.create?function(u,c,h,d){d===void 0&&(d=h);var m=Object.getOwnPropertyDescriptor(c,h);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[h]}}),Object.defineProperty(u,d,m)}:function(u,c,h,d){d===void 0&&(d=h),u[d]=c[h]}),r=sn&&sn.__setModuleDefault||(Object.create?function(u,c){Object.defineProperty(u,"default",{enumerable:!0,value:c})}:function(u,c){u.default=c}),i=sn&&sn.__importStar||function(){var u=function(c){return u=Object.getOwnPropertyNames||function(h){var d=[];for(var m in h)Object.prototype.hasOwnProperty.call(h,m)&&(d[d.length]=m);return d},u(c)};return function(c){if(c&&c.__esModule)return c;var h={};if(c!=null)for(var d=u(c),m=0;m<d.length;m++)d[m]!=="default"&&n(h,c,d[m]);return r(h,c),h}}();Object.defineProperty(sn,"__esModule",{value:!0}),sn.NullableCmsAdapter=sn.KnowledgeBase=void 0,sn.KnowledgeBase=i($A());const s=WA();return sn.NullableCmsAdapter={knowledgeBase:new s.NullableKnowledgeBaseAdapter},sn}var Na={},Yf={},Hy;function ex(){return Hy||(Hy=1,Object.defineProperty(Yf,"__esModule",{value:!0})),Yf}var Xf={},jy;function tx(){return jy||(jy=1,Object.defineProperty(Xf,"__esModule",{value:!0})),Xf}var Zf={},Iy;function nx(){return Iy||(Iy=1,Object.defineProperty(Zf,"__esModule",{value:!0})),Zf}var Qf={},zy;function rx(){return zy||(zy=1,Object.defineProperty(Qf,"__esModule",{value:!0})),Qf}var Us={},Gy;function ax(){if(Gy)return Us;Gy=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.checkMiddlewareCondition=void 0;const n=async(r,i,s)=>(Array.isArray(r)?r:[r]).reduce(async(c,h)=>await c?await h(i,s):!1,Promise.resolve(!0));return Us.checkMiddlewareCondition=n,Us}var Kf={},ky;function ix(){return ky||(ky=1,Object.defineProperty(Kf,"__esModule",{value:!0})),Kf}var $f={},qy;function sx(){return qy||(qy=1,Object.defineProperty($f,"__esModule",{value:!0})),$f}var Wf={},Fy;function lx(){return Fy||(Fy=1,Object.defineProperty(Wf,"__esModule",{value:!0})),Wf}var Py;function ox(){return Py||(Py=1,function(n){var r=Na&&Na.__createBinding||(Object.create?function(s,u,c,h){h===void 0&&(h=c);var d=Object.getOwnPropertyDescriptor(u,c);(!d||("get"in d?!u.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return u[c]}}),Object.defineProperty(s,h,d)}:function(s,u,c,h){h===void 0&&(h=c),s[h]=u[c]}),i=Na&&Na.__exportStar||function(s,u){for(var c in s)c!=="default"&&!Object.prototype.hasOwnProperty.call(u,c)&&r(u,s,c)};Object.defineProperty(n,"__esModule",{value:!0}),i(ex(),n),i(tx(),n),i(nx(),n),i(rx(),n),i(ax(),n),i(ix(),n),i(sx(),n),i(lx(),n)}(Na)),Na}var Ma={},Ln={},Vy;function ux(){if(Vy)return Ln;Vy=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.ButtonTypeEnum=Ln.PostbackButton=Ln.UrlButton=Ln.Button=void 0;class n{title;type;constructor(c,h){this.title=c,this.type=h}}Ln.Button=n;class r extends n{url;constructor(c,h){super(c,s.WEB_URL),this.url=h}}Ln.UrlButton=r;class i extends n{payload;constructor(c,h){super(c,s.POSTBACK),this.payload=h}}Ln.PostbackButton=i;var s;return function(u){u.WEB_URL="web_url",u.POSTBACK="postback"}(s||(Ln.ButtonTypeEnum=s={})),Ln}var Jf={},Yy;function cx(){return Yy||(Yy=1,Object.defineProperty(Jf,"__esModule",{value:!0})),Jf}var Hs={},Xy;function fx(){if(Xy)return Hs;Xy=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.SatisfactionEnum=void 0;var n;return function(r){r.GOOD="GOOD",r.BAD="BAD"}(n||(Hs.SatisfactionEnum=n={})),Hs}var Zy;function Qy(){return Zy||(Zy=1,function(n){var r=Ma&&Ma.__createBinding||(Object.create?function(s,u,c,h){h===void 0&&(h=c);var d=Object.getOwnPropertyDescriptor(u,c);(!d||("get"in d?!u.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return u[c]}}),Object.defineProperty(s,h,d)}:function(s,u,c,h){h===void 0&&(h=c),s[h]=u[c]}),i=Ma&&Ma.__exportStar||function(s,u){for(var c in s)c!=="default"&&!Object.prototype.hasOwnProperty.call(u,c)&&r(u,s,c)};Object.defineProperty(n,"__esModule",{value:!0}),i(ux(),n),i(cx(),n),i(fx(),n),i(Sd(),n),i(Td(),n)}(Ma)),Ma}var Ky;function hx(){return Ky||(Ky=1,function(n){var r=Dn&&Dn.__createBinding||(Object.create?function(c,h,d,m){m===void 0&&(m=d);var g=Object.getOwnPropertyDescriptor(h,d);(!g||("get"in g?!h.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return h[d]}}),Object.defineProperty(c,m,g)}:function(c,h,d,m){m===void 0&&(m=d),c[m]=h[d]}),i=Dn&&Dn.__setModuleDefault||(Object.create?function(c,h){Object.defineProperty(c,"default",{enumerable:!0,value:h})}:function(c,h){c.default=h}),s=Dn&&Dn.__exportStar||function(c,h){for(var d in c)d!=="default"&&!Object.prototype.hasOwnProperty.call(h,d)&&r(h,c,d)},u=Dn&&Dn.__importStar||function(){var c=function(h){return c=Object.getOwnPropertyNames||function(d){var m=[];for(var g in d)Object.prototype.hasOwnProperty.call(d,g)&&(m[m.length]=g);return m},c(h)};return function(h){if(h&&h.__esModule)return h;var d={};if(h!=null)for(var m=c(h),g=0;g<m.length;g++)m[g]!=="default"&&r(d,h,m[g]);return i(d,h),d}}();Object.defineProperty(n,"__esModule",{value:!0}),n.Model=n.CMS=void 0,s(KA(),n),n.CMS=u(JA()),s(ox(),n),s(Qy(),n),n.Model=u(Qy())}(Dn)),Dn}var Oe=hx();const ab=n=>r=>(n.payload.type!==Oe.ActionTypes.MESSAGE_FROM_GUEST&&r(Oe.Actions.receiveTextMessageWithoutAnalysisFromGuest(n.label,n.payload)),r(n.payload)),ib=n=>(r,i)=>{const{quickReplies:s}=i().chat,u=s.find(c=>n.toLocaleLowerCase().indexOf(c.label.toLocaleLowerCase())>-1);return r(u?ab({...u,label:n}):JSON.parse(JSON.stringify(Oe.Actions.receiveTextMessageFromGuest(n))))},Ad="MESSAGE_TO_PARENT_PAGE",xd="RESTORE_PREVIOUS_CHAT_MESSAGES",Od="AUDIO_MESSAGE_FROM_USER",Rd="RECEIVE_SPEECH_TRANSCRIPTION",wd="ENABLE_CONVERSATION_RATING",sb="LOAD_SOURCE_INFOS_RESPONSE",Cd="LOAD_SOURCE_INFOS_ERROR",Nd="LOAD_SOURCE_INFOS_REQUEST",Md="CLOSE_SOURCE_INFOS",dx="webclient.get.started",lb="webclient.window.expand",ob="webclient.window.close",ub="webclient.transcript.pdf.download",mx=[Ad,xd,Od,Rd,wd,Nd,Md],px=n=>({type:Od,buffer:n}),gx=n=>({type:Rd,transcription:n}),yx=n=>({type:Oe.ActionTypes.TRANSCRIPT_MAIL_REQUEST,payload:{parameters:{mailTo:n}}}),vx=()=>({type:ub}),bx=({rating:n})=>({type:wd,payload:{rating:n}}),_x=(n,r)=>({type:Oe.ActionTypes.CONVERSATION_RATING_FROM_GUEST,payload:{value:n,feedback:r}}),cb=n=>Oe.Actions.requestNLUEvent(n),Ex=n=>({type:xd,messages:n}),Sx=n=>{switch(n.type){case Oe.ButtonTypeEnum.WEB_URL:return hb(n.url);case Oe.ButtonTypeEnum.POSTBACK:return n.payload;default:throw new Error(`unknown button type ${n.type}`)}},fb=n=>hb(n),hb=n=>({type:Ad,message:{type:"webclient.change.url",url:n}});/*! js-cookie v3.0.5 | MIT */function Do(n){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var s in i)n[s]=i[s]}return n}var Tx={read:function(n){return n[0]==='"'&&(n=n.slice(1,-1)),n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(n){return encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Kh(n,r){function i(u,c,h){if(!(typeof document>"u")){h=Do({},r,h),typeof h.expires=="number"&&(h.expires=new Date(Date.now()+h.expires*864e5)),h.expires&&(h.expires=h.expires.toUTCString()),u=encodeURIComponent(u).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var d="";for(var m in h)h[m]&&(d+="; "+m,h[m]!==!0&&(d+="="+h[m].split(";")[0]));return document.cookie=u+"="+n.write(c,u)+d}}function s(u){if(!(typeof document>"u"||arguments.length&&!u)){for(var c=document.cookie?document.cookie.split("; "):[],h={},d=0;d<c.length;d++){var m=c[d].split("="),g=m.slice(1).join("=");try{var y=decodeURIComponent(m[0]);if(h[y]=n.read(g,y),u===y)break}catch{}}return u?h[u]:h}}return Object.create({set:i,get:s,remove:function(u,c){i(u,"",Do({},c,{expires:-1}))},withAttributes:function(u){return Kh(this.converter,Do({},this.attributes,u))},withConverter:function(u){return Kh(Do({},this.converter,u),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(n)}})}var Bo=Kh(Tx,{path:"/"});const xt=[];for(let n=0;n<256;++n)xt.push((n+256).toString(16).slice(1));function Ax(n,r=0){return(xt[n[r+0]]+xt[n[r+1]]+xt[n[r+2]]+xt[n[r+3]]+"-"+xt[n[r+4]]+xt[n[r+5]]+"-"+xt[n[r+6]]+xt[n[r+7]]+"-"+xt[n[r+8]]+xt[n[r+9]]+"-"+xt[n[r+10]]+xt[n[r+11]]+xt[n[r+12]]+xt[n[r+13]]+xt[n[r+14]]+xt[n[r+15]]).toLowerCase()}let eh;const xx=new Uint8Array(16);function Ox(){if(!eh){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");eh=crypto.getRandomValues.bind(crypto)}return eh(xx)}const Rx=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$y={randomUUID:Rx};function $h(n,r,i){if($y.randomUUID&&!n)return $y.randomUUID();n=n||{};const s=n.random??n.rng?.()??Ox();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Ax(s)}function Ot(n){return`Minified Redux error #${n}; visit https://redux.js.org/Errors?code=${n} for the full message or use the non-minified dev environment for full errors. `}var wx=typeof Symbol=="function"&&Symbol.observable||"@@observable",Wy=wx,th=()=>Math.random().toString(36).substring(7).split("").join("."),Cx={INIT:`@@redux/INIT${th()}`,REPLACE:`@@redux/REPLACE${th()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${th()}`},Ko=Cx;function Dd(n){if(typeof n!="object"||n===null)return!1;let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r||Object.getPrototypeOf(n)===null}function db(n,r,i){if(typeof n!="function")throw new Error(Ot(2));if(typeof r=="function"&&typeof i=="function"||typeof i=="function"&&typeof arguments[3]=="function")throw new Error(Ot(0));if(typeof r=="function"&&typeof i>"u"&&(i=r,r=void 0),typeof i<"u"){if(typeof i!="function")throw new Error(Ot(1));return i(db)(n,r)}let s=n,u=r,c=new Map,h=c,d=0,m=!1;function g(){h===c&&(h=new Map,c.forEach((G,E)=>{h.set(E,G)}))}function y(){if(m)throw new Error(Ot(3));return u}function _(G){if(typeof G!="function")throw new Error(Ot(4));if(m)throw new Error(Ot(5));let E=!0;g();const w=d++;return h.set(w,G),function(){if(E){if(m)throw new Error(Ot(6));E=!1,g(),h.delete(w),c=null}}}function T(G){if(!Dd(G))throw new Error(Ot(7));if(typeof G.type>"u")throw new Error(Ot(8));if(typeof G.type!="string")throw new Error(Ot(17));if(m)throw new Error(Ot(9));try{m=!0,u=s(u,G)}finally{m=!1}return(c=h).forEach(w=>{w()}),G}function L(G){if(typeof G!="function")throw new Error(Ot(10));s=G,T({type:Ko.REPLACE})}function N(){const G=_;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(Ot(11));function w(){const I=E;I.next&&I.next(y())}return w(),{unsubscribe:G(w)}},[Wy](){return this}}}return T({type:Ko.INIT}),{dispatch:T,subscribe:_,getState:y,replaceReducer:L,[Wy]:N}}function Nx(n){Object.keys(n).forEach(r=>{const i=n[r];if(typeof i(void 0,{type:Ko.INIT})>"u")throw new Error(Ot(12));if(typeof i(void 0,{type:Ko.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ot(13))})}function mb(n){const r=Object.keys(n),i={};for(let c=0;c<r.length;c++){const h=r[c];typeof n[h]=="function"&&(i[h]=n[h])}const s=Object.keys(i);let u;try{Nx(i)}catch(c){u=c}return function(h={},d){if(u)throw u;let m=!1;const g={};for(let y=0;y<s.length;y++){const _=s[y],T=i[_],L=h[_],N=T(L,d);if(typeof N>"u")throw d&&d.type,new Error(Ot(14));g[_]=N,m=m||N!==L}return m=m||s.length!==Object.keys(h).length,m?g:h}}function $o(...n){return n.length===0?r=>r:n.length===1?n[0]:n.reduce((r,i)=>(...s)=>r(i(...s)))}function Mx(...n){return r=>(i,s)=>{const u=r(i,s);let c=()=>{throw new Error(Ot(15))};const h={getState:u.getState,dispatch:(m,...g)=>c(m,...g)},d=n.map(m=>m(h));return c=$o(...d)(u.dispatch),{...u,dispatch:c}}}function Dx(n){return Dd(n)&&"type"in n&&typeof n.type=="string"}var pb=Symbol.for("immer-nothing"),Jy=Symbol.for("immer-draftable"),on=Symbol.for("immer-state");function In(n,...r){throw new Error(`[Immer] minified error nr: ${n}. Full error at: https://bit.ly/3cXEKWf`)}var wi=Object.getPrototypeOf;function za(n){return!!n&&!!n[on]}function wr(n){return n?gb(n)||Array.isArray(n)||!!n[Jy]||!!n.constructor?.[Jy]||uu(n)||cu(n):!1}var Bx=Object.prototype.constructor.toString();function gb(n){if(!n||typeof n!="object")return!1;const r=wi(n);if(r===null)return!0;const i=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return i===Object?!0:typeof i=="function"&&Function.toString.call(i)===Bx}function Wo(n,r){ou(n)===0?Reflect.ownKeys(n).forEach(i=>{r(i,n[i],n)}):n.forEach((i,s)=>r(s,i,n))}function ou(n){const r=n[on];return r?r.type_:Array.isArray(n)?1:uu(n)?2:cu(n)?3:0}function Wh(n,r){return ou(n)===2?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function yb(n,r,i){const s=ou(n);s===2?n.set(r,i):s===3?n.add(i):n[r]=i}function Lx(n,r){return n===r?n!==0||1/n===1/r:n!==n&&r!==r}function uu(n){return n instanceof Map}function cu(n){return n instanceof Set}function Ua(n){return n.copy_||n.base_}function Jh(n,r){if(uu(n))return new Map(n);if(cu(n))return new Set(n);if(Array.isArray(n))return Array.prototype.slice.call(n);const i=gb(n);if(r===!0||r==="class_only"&&!i){const s=Object.getOwnPropertyDescriptors(n);delete s[on];let u=Reflect.ownKeys(s);for(let c=0;c<u.length;c++){const h=u[c],d=s[h];d.writable===!1&&(d.writable=!0,d.configurable=!0),(d.get||d.set)&&(s[h]={configurable:!0,writable:!0,enumerable:d.enumerable,value:n[h]})}return Object.create(wi(n),s)}else{const s=wi(n);if(s!==null&&i)return{...n};const u=Object.create(s);return Object.assign(u,n)}}function Bd(n,r=!1){return fu(n)||za(n)||!wr(n)||(ou(n)>1&&(n.set=n.add=n.clear=n.delete=Ux),Object.freeze(n),r&&Object.entries(n).forEach(([i,s])=>Bd(s,!0))),n}function Ux(){In(2)}function fu(n){return Object.isFrozen(n)}var Hx={};function Ga(n){const r=Hx[n];return r||In(0,n),r}var $s;function vb(){return $s}function jx(n,r){return{drafts_:[],parent_:n,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ev(n,r){r&&(Ga("Patches"),n.patches_=[],n.inversePatches_=[],n.patchListener_=r)}function ed(n){td(n),n.drafts_.forEach(Ix),n.drafts_=null}function td(n){n===$s&&($s=n.parent_)}function tv(n){return $s=jx($s,n)}function Ix(n){const r=n[on];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function nv(n,r){r.unfinalizedDrafts_=r.drafts_.length;const i=r.drafts_[0];return n!==void 0&&n!==i?(i[on].modified_&&(ed(r),In(4)),wr(n)&&(n=Jo(r,n),r.parent_||eu(r,n)),r.patches_&&Ga("Patches").generateReplacementPatches_(i[on].base_,n,r.patches_,r.inversePatches_)):n=Jo(r,i,[]),ed(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),n!==pb?n:void 0}function Jo(n,r,i){if(fu(r))return r;const s=r[on];if(!s)return Wo(r,(u,c)=>rv(n,s,r,u,c,i)),r;if(s.scope_!==n)return r;if(!s.modified_)return eu(n,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;const u=s.copy_;let c=u,h=!1;s.type_===3&&(c=new Set(u),u.clear(),h=!0),Wo(c,(d,m)=>rv(n,s,u,d,m,i,h)),eu(n,u,!1),i&&n.patches_&&Ga("Patches").generatePatches_(s,i,n.patches_,n.inversePatches_)}return s.copy_}function rv(n,r,i,s,u,c,h){if(za(u)){const d=c&&r&&r.type_!==3&&!Wh(r.assigned_,s)?c.concat(s):void 0,m=Jo(n,u,d);if(yb(i,s,m),za(m))n.canAutoFreeze_=!1;else return}else h&&i.add(u);if(wr(u)&&!fu(u)){if(!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1)return;Jo(n,u),(!r||!r.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(i,s)&&eu(n,u)}}function eu(n,r,i=!1){!n.parent_&&n.immer_.autoFreeze_&&n.canAutoFreeze_&&Bd(r,i)}function zx(n,r){const i=Array.isArray(n),s={type_:i?1:0,scope_:r?r.scope_:vb(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:n,draft_:null,copy_:null,revoke_:null,isManual_:!1};let u=s,c=Ld;i&&(u=[s],c=Ws);const{revoke:h,proxy:d}=Proxy.revocable(u,c);return s.draft_=d,s.revoke_=h,d}var Ld={get(n,r){if(r===on)return n;const i=Ua(n);if(!Wh(i,r))return Gx(n,i,r);const s=i[r];return n.finalized_||!wr(s)?s:s===nh(n.base_,r)?(rh(n),n.copy_[r]=rd(s,n)):s},has(n,r){return r in Ua(n)},ownKeys(n){return Reflect.ownKeys(Ua(n))},set(n,r,i){const s=bb(Ua(n),r);if(s?.set)return s.set.call(n.draft_,i),!0;if(!n.modified_){const u=nh(Ua(n),r),c=u?.[on];if(c&&c.base_===i)return n.copy_[r]=i,n.assigned_[r]=!1,!0;if(Lx(i,u)&&(i!==void 0||Wh(n.base_,r)))return!0;rh(n),nd(n)}return n.copy_[r]===i&&(i!==void 0||r in n.copy_)||Number.isNaN(i)&&Number.isNaN(n.copy_[r])||(n.copy_[r]=i,n.assigned_[r]=!0),!0},deleteProperty(n,r){return nh(n.base_,r)!==void 0||r in n.base_?(n.assigned_[r]=!1,rh(n),nd(n)):delete n.assigned_[r],n.copy_&&delete n.copy_[r],!0},getOwnPropertyDescriptor(n,r){const i=Ua(n),s=Reflect.getOwnPropertyDescriptor(i,r);return s&&{writable:!0,configurable:n.type_!==1||r!=="length",enumerable:s.enumerable,value:i[r]}},defineProperty(){In(11)},getPrototypeOf(n){return wi(n.base_)},setPrototypeOf(){In(12)}},Ws={};Wo(Ld,(n,r)=>{Ws[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}});Ws.deleteProperty=function(n,r){return Ws.set.call(this,n,r,void 0)};Ws.set=function(n,r,i){return Ld.set.call(this,n[0],r,i,n[0])};function nh(n,r){const i=n[on];return(i?Ua(i):n)[r]}function Gx(n,r,i){const s=bb(r,i);return s?"value"in s?s.value:s.get?.call(n.draft_):void 0}function bb(n,r){if(!(r in n))return;let i=wi(n);for(;i;){const s=Object.getOwnPropertyDescriptor(i,r);if(s)return s;i=wi(i)}}function nd(n){n.modified_||(n.modified_=!0,n.parent_&&nd(n.parent_))}function rh(n){n.copy_||(n.copy_=Jh(n.base_,n.scope_.immer_.useStrictShallowCopy_))}var kx=class{constructor(n){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(r,i,s)=>{if(typeof r=="function"&&typeof i!="function"){const c=i;i=r;const h=this;return function(m=c,...g){return h.produce(m,y=>i.call(this,y,...g))}}typeof i!="function"&&In(6),s!==void 0&&typeof s!="function"&&In(7);let u;if(wr(r)){const c=tv(this),h=rd(r,void 0);let d=!0;try{u=i(h),d=!1}finally{d?ed(c):td(c)}return ev(c,s),nv(u,c)}else if(!r||typeof r!="object"){if(u=i(r),u===void 0&&(u=r),u===pb&&(u=void 0),this.autoFreeze_&&Bd(u,!0),s){const c=[],h=[];Ga("Patches").generateReplacementPatches_(r,u,c,h),s(c,h)}return u}else In(1,r)},this.produceWithPatches=(r,i)=>{if(typeof r=="function")return(h,...d)=>this.produceWithPatches(h,m=>r(m,...d));let s,u;return[this.produce(r,i,(h,d)=>{s=h,u=d}),s,u]},typeof n?.autoFreeze=="boolean"&&this.setAutoFreeze(n.autoFreeze),typeof n?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(n.useStrictShallowCopy)}createDraft(n){wr(n)||In(8),za(n)&&(n=qx(n));const r=tv(this),i=rd(n,void 0);return i[on].isManual_=!0,td(r),i}finishDraft(n,r){const i=n&&n[on];(!i||!i.isManual_)&&In(9);const{scope_:s}=i;return ev(s,r),nv(void 0,s)}setAutoFreeze(n){this.autoFreeze_=n}setUseStrictShallowCopy(n){this.useStrictShallowCopy_=n}applyPatches(n,r){let i;for(i=r.length-1;i>=0;i--){const u=r[i];if(u.path.length===0&&u.op==="replace"){n=u.value;break}}i>-1&&(r=r.slice(i+1));const s=Ga("Patches").applyPatches_;return za(n)?s(n,r):this.produce(n,u=>s(u,r))}};function rd(n,r){const i=uu(n)?Ga("MapSet").proxyMap_(n,r):cu(n)?Ga("MapSet").proxySet_(n,r):zx(n,r);return(r?r.scope_:vb()).drafts_.push(i),i}function qx(n){return za(n)||In(10,n),_b(n)}function _b(n){if(!wr(n)||fu(n))return n;const r=n[on];let i;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,i=Jh(n,r.scope_.immer_.useStrictShallowCopy_)}else i=Jh(n,!0);return Wo(i,(s,u)=>{yb(i,s,_b(u))}),r&&(r.finalized_=!1),i}var un=new kx,Eb=un.produce;un.produceWithPatches.bind(un);un.setAutoFreeze.bind(un);un.setUseStrictShallowCopy.bind(un);un.applyPatches.bind(un);un.createDraft.bind(un);un.finishDraft.bind(un);function Sb(n){return({dispatch:i,getState:s})=>u=>c=>typeof c=="function"?c(i,s,n):u(c)}var Fx=Sb(),Px=Sb,Vx=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?$o:$o.apply(null,arguments)};function av(n,r){function i(...s){if(r){let u=r(...s);if(!u)throw new Error(Ar(0));return{type:n,payload:u.payload,..."meta"in u&&{meta:u.meta},..."error"in u&&{error:u.error}}}return{type:n,payload:s[0]}}return i.toString=()=>`${n}`,i.type=n,i.match=s=>Dx(s)&&s.type===n,i}var Tb=class Xs extends Array{constructor(...r){super(...r),Object.setPrototypeOf(this,Xs.prototype)}static get[Symbol.species](){return Xs}concat(...r){return super.concat.apply(this,r)}prepend(...r){return r.length===1&&Array.isArray(r[0])?new Xs(...r[0].concat(this)):new Xs(...r.concat(this))}};function iv(n){return wr(n)?Eb(n,()=>{}):n}function Lo(n,r,i){return n.has(r)?n.get(r):n.set(r,i(r)).get(r)}function Yx(n){return typeof n=="boolean"}var Xx=()=>function(r){const{thunk:i=!0,immutableCheck:s=!0,serializableCheck:u=!0,actionCreatorCheck:c=!0}=r??{};let h=new Tb;return i&&(Yx(i)?h.push(Fx):h.push(Px(i.extraArgument))),h},Zx="RTK_autoBatch",sv=n=>r=>{setTimeout(r,n)},Qx=(n={type:"raf"})=>r=>(...i)=>{const s=r(...i);let u=!0,c=!1,h=!1;const d=new Set,m=n.type==="tick"?queueMicrotask:n.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:sv(10):n.type==="callback"?n.queueNotification:sv(n.timeout),g=()=>{h=!1,c&&(c=!1,d.forEach(y=>y()))};return Object.assign({},s,{subscribe(y){const _=()=>u&&y(),T=s.subscribe(_);return d.add(y),()=>{T(),d.delete(y)}},dispatch(y){try{return u=!y?.meta?.[Zx],c=!u,c&&(h||(h=!0,m(g))),s.dispatch(y)}finally{u=!0}}})},Kx=n=>function(i){const{autoBatch:s=!0}=i??{};let u=new Tb(n);return s&&u.push(Qx(typeof s=="object"?s:void 0)),u};function $x(n){const r=Xx(),{reducer:i=void 0,middleware:s,devTools:u=!0,preloadedState:c=void 0,enhancers:h=void 0}=n||{};let d;if(typeof i=="function")d=i;else if(Dd(i))d=mb(i);else throw new Error(Ar(1));let m;typeof s=="function"?m=s(r):m=r();let g=$o;u&&(g=Vx({trace:!1,...typeof u=="object"&&u}));const y=Mx(...m),_=Kx(y);let T=typeof h=="function"?h(_):_();const L=g(...T);return db(d,c,L)}function Ab(n){const r={},i=[];let s;const u={addCase(c,h){const d=typeof c=="string"?c:c.type;if(!d)throw new Error(Ar(28));if(d in r)throw new Error(Ar(29));return r[d]=h,u},addMatcher(c,h){return i.push({matcher:c,reducer:h}),u},addDefaultCase(c){return s=c,u}};return n(u),[r,i,s]}function Wx(n){return typeof n=="function"}function Jx(n,r){let[i,s,u]=Ab(r),c;if(Wx(n))c=()=>iv(n());else{const d=iv(n);c=()=>d}function h(d=c(),m){let g=[i[m.type],...s.filter(({matcher:y})=>y(m)).map(({reducer:y})=>y)];return g.filter(y=>!!y).length===0&&(g=[u]),g.reduce((y,_)=>{if(_)if(za(y)){const L=_(y,m);return L===void 0?y:L}else{if(wr(y))return Eb(y,T=>_(T,m));{const T=_(y,m);if(T===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return T}}return y},d)}return h.getInitialState=c,h}var eO=Symbol.for("rtk-slice-createasyncthunk");function tO(n,r){return`${n}/${r}`}function nO({creators:n}={}){const r=n?.asyncThunk?.[eO];return function(s){const{name:u,reducerPath:c=u}=s;if(!u)throw new Error(Ar(11));const h=(typeof s.reducers=="function"?s.reducers(aO()):s.reducers)||{},d=Object.keys(h),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},g={addCase(S,I){const x=typeof S=="string"?S:S.type;if(!x)throw new Error(Ar(12));if(x in m.sliceCaseReducersByType)throw new Error(Ar(13));return m.sliceCaseReducersByType[x]=I,g},addMatcher(S,I){return m.sliceMatchers.push({matcher:S,reducer:I}),g},exposeAction(S,I){return m.actionCreators[S]=I,g},exposeCaseReducer(S,I){return m.sliceCaseReducersByName[S]=I,g}};d.forEach(S=>{const I=h[S],x={reducerName:S,type:tO(u,S),createNotation:typeof s.reducers=="function"};sO(I)?oO(x,I,g,r):iO(x,I,g)});function y(){const[S={},I=[],x=void 0]=typeof s.extraReducers=="function"?Ab(s.extraReducers):[s.extraReducers],Z={...S,...m.sliceCaseReducersByType};return Jx(s.initialState,$=>{for(let ie in Z)$.addCase(ie,Z[ie]);for(let ie of m.sliceMatchers)$.addMatcher(ie.matcher,ie.reducer);for(let ie of I)$.addMatcher(ie.matcher,ie.reducer);x&&$.addDefaultCase(x)})}const _=S=>S,T=new Map,L=new WeakMap;let N;function V(S,I){return N||(N=y()),N(S,I)}function G(){return N||(N=y()),N.getInitialState()}function E(S,I=!1){function x($){let ie=$[S];return typeof ie>"u"&&I&&(ie=Lo(L,x,G)),ie}function Z($=_){const ie=Lo(T,I,()=>new WeakMap);return Lo(ie,$,()=>{const _e={};for(const[Re,se]of Object.entries(s.selectors??{}))_e[Re]=rO(se,$,()=>Lo(L,$,G),I);return _e})}return{reducerPath:S,getSelectors:Z,get selectors(){return Z(x)},selectSlice:x}}const w={name:u,reducer:V,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:G,...E(c),injectInto(S,{reducerPath:I,...x}={}){const Z=I??c;return S.inject({reducerPath:Z,reducer:V},x),{...w,...E(Z,!0)}}};return w}}function rO(n,r,i,s){function u(c,...h){let d=r(c);return typeof d>"u"&&s&&(d=i()),n(d,...h)}return u.unwrapped=n,u}var Ud=nO();function aO(){function n(r,i){return{_reducerDefinitionType:"asyncThunk",payloadCreator:r,...i}}return n.withTypes=()=>n,{reducer(r){return Object.assign({[r.name](...i){return r(...i)}}[r.name],{_reducerDefinitionType:"reducer"})},preparedReducer(r,i){return{_reducerDefinitionType:"reducerWithPrepare",prepare:r,reducer:i}},asyncThunk:n}}function iO({type:n,reducerName:r,createNotation:i},s,u){let c,h;if("reducer"in s){if(i&&!lO(s))throw new Error(Ar(17));c=s.reducer,h=s.prepare}else c=s;u.addCase(n,c).exposeCaseReducer(r,c).exposeAction(r,h?av(n,h):av(n))}function sO(n){return n._reducerDefinitionType==="asyncThunk"}function lO(n){return n._reducerDefinitionType==="reducerWithPrepare"}function oO({type:n,reducerName:r},i,s,u){if(!u)throw new Error(Ar(18));const{payloadCreator:c,fulfilled:h,pending:d,rejected:m,settled:g,options:y}=i,_=u(n,c,y);s.exposeAction(r,_),h&&s.addCase(_.fulfilled,h),d&&s.addCase(_.pending,d),m&&s.addCase(_.rejected,m),g&&s.addMatcher(_.settled,g),s.exposeCaseReducer(r,{fulfilled:h||Uo,pending:d||Uo,rejected:m||Uo,settled:g||Uo})}function Uo(){}function Ar(n){return`Minified Redux Toolkit error #${n}; visit https://redux-toolkit.js.org/Errors?code=${n} for the full message or use the non-minified dev environment for full errors. `}const uO={formValues:{}},xb=Ud({name:"start-screen",initialState:uO,reducers:{showStartScreen(n){n.startScreenStatus="VISIBLE",n.formValues={}},startChat(n,r){n.startScreenStatus="HIDDEN",n.formValues=r.payload}}}),{startChat:cO,showStartScreen:fO}=xb.actions,hO=xb.reducer,Ob="RESET_CHAT_STATE",Rb="TOGGLE_TRANSCRIPT_MAIL_OVERLAY",dO=()=>({type:ob}),mO=()=>({type:Ob}),wb=()=>({type:Rb}),lv=(n,r,i)=>(s,u)=>{try{const c=u().connection.sessionId;if(!c)throw new Error("Session ID is not available");s({type:Nd,payload:{chunkId:i}}),ov(n,c,r,i,!1,s),ov(n,c,r,i,!0,s)}catch(c){console.error("Error loading source infos:",c),s({type:Cd})}},ov=(n,r,i,s,u,c)=>{const h=`/${n}/me/chat-widget/transcript/${i}/chunks/${s}?highlight=${u}`;fetch(h,{headers:{"x-bubble-chat-session-id":r}}).then(d=>{if(!d.ok)throw new Error(`HTTP error! Status: ${d.status}`);return d.json()}).then(d=>{const m={...d,chunkId:s,highlighted:u};c({type:sb,payload:m})}).catch(d=>{console.error("Error fetching source infos:",d),c({type:Cd,payload:{highlighted:u}})})},pO=()=>({type:Md}),Hd="CONNECT",jd="CONNECTING",Id="CONNECTED",zd="DISCONNECTED",Gd="RECONNECTED",kd="RESTORE_SESSION_ID",hu="START",du="CLEAR_SESSION_ID",gO=[Hd,jd,Id,zd,Gd,kd],yO=(n,r)=>({type:Hd,clientName:n,querystrings:r}),vO=n=>({type:kd,sessionId:n}),bO=()=>({type:jd}),_O=()=>({type:Id}),EO=()=>({type:zd}),SO=()=>({type:Gd}),Cb=(n,r)=>(i,s)=>{const u=s().connection,c=s().startScreen.formValues;let h=u.sessionId;h===void 0&&(h=$h());let d=u.userId;if(d===void 0){const m=Bo.get("bubble-chat-user-id")||Bo.get("bubble-chat-userId")||Bo.get("bf-webclient-userId");d=m||$h(),Bo.set("bubble-chat-user-id",d)}i({type:hu,payload:{sessionId:h,userId:d,clientName:n,querystrings:{...r,...c}}})},mu=(n,r)=>(i,s)=>{const u=s().connection.sessionId||"";if(i(TO(u)),i(mO()),s().settings.enableStartScreen)i(fO());else return i(Cb(n,r))},TO=n=>({type:du,payload:{sessionId:n}}),tt=()=>{const n=su();return i=>{const s=n.formatMessage({id:i});return s===i?void 0:s}};var ja=(n=>(n[n.CONNECTING=0]="CONNECTING",n[n.CONNECTED=1]="CONNECTED",n[n.RECONNECTED=2]="RECONNECTED",n[n.DISCONNECTED=3]="DISCONNECTED",n))(ja||{}),tu=(n=>(n.GUEST="GUEST",n.BOT="BOT",n.PERSON="PERSON",n))(tu||{});const AO="_container_q2uun_1",xO="_chatcontent_q2uun_6",OO="_accessabilityHidden_q2uun_12",ah={container:AO,chatcontent:xO,accessabilityHidden:OO},RO="_messageContainer_ofi0g_1",wO="_messages_ofi0g_12",uv={messageContainer:RO,messages:wO};function Ha(){return Ha=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},Ha.apply(this,arguments)}const CO=["children","options"],NO={footnoteReference:"7"},cv=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((n,r)=>(n[r.toLowerCase()]=r,n),{class:"className",for:"htmlFor"}),fv={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},MO=["style","script","pre"],DO=["src","href","data","formAction","srcDoc","action"],BO=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,LO=/mailto:/i,UO=/\n{2,}$/,hv=/^(\s*>[\s\S]*?)(?=\n\n|$)/,HO=/^ *> ?/gm,jO=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,IO=/^ {2,}\n/,zO=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,dv=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,mv=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,GO=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,kO=/^(?:\n *)*\n/,qO=/\r\n?/g,FO=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,PO=/^\[\^([^\]]+)]/,VO=/\f/g,YO=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,XO=/^\s*?\[(x|\s)\]/,pv=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,gv=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,yv=/^([^\n]+)\n *(=|-){3,} *\n/,ih=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,ZO=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,vv=/^<!--[\s\S]*?(?:-->)/,QO=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,sh=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,KO=/^\{.*\}$/,$O=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,WO=/^<([^ >]+@[^ >]+)>/,JO=/^<([^ >]+:\/[^ >]+)>/,eR=/-([a-z])?/gi,bv=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,tR=/^[^\n]+(?: \n|\n{2,})/,nR=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,rR=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,aR=/^\[([^\]]*)\] ?\[([^\]]*)\]/,iR=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,sR=/\t/g,lR=/(^ *\||\| *$)/g,oR=/^ *:-+: *$/,uR=/^ *:-+ *$/,cR=/^ *-+: *$/,pu="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",fR=RegExp(`^([*_])\\1${pu}\\1\\1(?!\\1)`),hR=RegExp(`^([*_])${pu}\\1(?!\\1)`),dR=RegExp(`^(==)${pu}\\1`),mR=RegExp(`^(~~)${pu}\\1`),pR=/^\\([^0-9A-Za-z\s])/,gR=/\\([^0-9A-Za-z\s])/g,yR=/^[\s\S](?:(?! |[0-9]\.|http)[^=*_~\-\n<`\\\[!])*/,vR=/^\n+/,bR=/^([ \t]*)/,_R=/(?:^|\n)( *)$/,qd="(?:\\d+\\.)",Fd="(?:[*+-])";function Nb(n){return"( *)("+(n===1?qd:Fd)+") +"}const Mb=Nb(1),Db=Nb(2);function Bb(n){return RegExp("^"+(n===1?Mb:Db))}const ER=Bb(1),SR=Bb(2);function Lb(n){return RegExp("^"+(n===1?Mb:Db)+"[^\\n]*(?:\\n(?!\\1"+(n===1?qd:Fd)+" )[^\\n]*)*(\\n|$)","gm")}const TR=Lb(1),AR=Lb(2);function Ub(n){const r=n===1?qd:Fd;return RegExp("^( *)("+r+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+r+" (?!"+r+" ))\\n*|\\s*\\n*$)")}const Hb=Ub(1),jb=Ub(2);function _v(n,r){const i=r===1,s=i?Hb:jb,u=i?TR:AR,c=i?ER:SR;return{t:h=>c.test(h),o:rl(function(h,d){const m=_R.exec(d.prevCapture);return m&&(d.list||!d.inline&&!d.simple)?s.exec(h=m[1]+h):null}),i:1,u(h,d,m){const g=i?+h[2]:void 0,y=h[0].replace(UO,`
|
|
94
94
|
`).match(u);let _=!1;return{items:y.map(function(T,L){const N=c.exec(T)[0].length,V=RegExp("^ {1,"+N+"}","gm"),G=T.replace(V,"").replace(c,""),E=L===y.length-1,w=G.indexOf(`
|
|
95
95
|
|
|
96
96
|
`)!==-1||E&&_;_=w;const S=m.inline,I=m.list;let x;m.list=!0,w?(m.inline=!1,x=Ks(G)+`
|
|
@@ -106,7 +106,7 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
|
|
|
106
106
|
`)===-1)return null;let S="";E.split(`
|
|
107
107
|
`).every(x=>(x+=`
|
|
108
108
|
`,!c.some(Z=>Z.test(x))&&(S+=x,!!x.trim())));const I=Ks(S);return I===""?null:[S,,I]}),i:3,u:lh,l:(E,w,S)=>d("p",{key:S.key},w(E.children,S))},22:{t:["["],o:na(nR),i:0,u:E=>(_[E[1]]={target:E[2],title:E[4]},{}),l:uh},23:{t:["!["],o:ra(rR),i:0,u:E=>({alt:E[1]?Zn(E[1]):void 0,ref:E[2]}),l:(E,w,S)=>_[E.ref]?d("img",{key:S.key,alt:E.alt,src:s(_[E.ref].target,"img","src"),title:_[E.ref].title}):null},24:{t:["["],o:na(aR),i:0,u:(E,w,S)=>({children:w(E[1],S),fallbackChildren:E[0],ref:E[2]}),l:(E,w,S)=>_[E.ref]?d("a",{key:S.key,href:s(_[E.ref].target,"a","href"),title:_[E.ref].title},w(E.children,S)):d("span",{key:S.key},E.fallbackChildren)},25:{t:["|"],o:Er(bv),i:1,u:CR,l(E,w,S){const I=E;return d("table",{key:S.key},d("thead",null,d("tr",null,I.header.map(function(x,Z){return d("th",{key:Z,style:Sv(I,Z)},w(x,S))}))),d("tbody",null,I.cells.map(function(x,Z){return d("tr",{key:Z},x.map(function($,ie){return d("td",{key:ie,style:Sv(I,ie)},w($,S))}))})))}},27:{o:Is(yR),i:4,u(E){const w=E[0];return{text:w.indexOf("&")===-1?w:w.replace(ZO,(S,I)=>r.namedCodesToUnicode[I]||S)}},l:E=>E.text},28:{t:["**","__"],o:ra(fR),i:2,u:(E,w,S)=>({children:w(E[2],S)}),l:(E,w,S)=>d("strong",{key:S.key},w(E.children,S))},29:{t:E=>{const w=E[0];return(w==="*"||w==="_")&&E[1]!==w},o:ra(hR),i:3,u:(E,w,S)=>({children:w(E[2],S)}),l:(E,w,S)=>d("em",{key:S.key},w(E.children,S))},30:{t:["\\"],o:ra(pR),i:1,u:E=>({text:E[1],type:"27"})},31:{t:["=="],o:ra(dR),i:3,u:lh,l:(E,w,S)=>d("mark",{key:S.key},w(E.children,S))},32:{t:["~~"],o:ra(mR),i:3,u:lh,l:(E,w,S)=>d("del",{key:S.key},w(E.children,S))}};r.disableParsingRawHTML===!0&&(delete T[11],delete T[13]);const L=function(E){var w=Object.keys(E);function S(I,x){var Z=[];if(x.prevCapture=x.prevCapture||"",I.trim())for(;I;)for(var $=0;$<w.length;){var ie=w[$],_e=E[ie];if(!_e.t||RR(I,x,_e.t)){var Re=_e.o(I,x);if(Re&&Re[0]){I=I.substring(Re[0].length);var se=_e.u(Re,S,x);x.prevCapture+=Re[0],se.type||(se.type=ie),Z.push(se);break}$++}else $++}return x.prevCapture="",Z}return w.sort(function(I,x){return E[I].i-E[x].i||(I<x?-1:1)}),function(I,x){return S(function(Z){return Z.replace(qO,`
|
|
109
|
-
`).replace(VO,"").replace(sR," ")}(I),x)}}(T),N=(V=function(E,w){return function(S,I,x){const Z=E[S.type].l;return w?w(()=>Z(S,I,x),S,I,x):Z(S,I,x)}}(T,r.renderRule),function E(w,S={}){if(Array.isArray(w)){const I=S.key,x=[];let Z=!1;for(let $=0;$<w.length;$++){S.key=$;const ie=E(w[$],S),_e=typeof ie=="string";_e&&Z?x[x.length-1]+=ie:ie!==null&&x.push(ie),Z=_e}return S.key=I,x}return V(w,E,S)});var V;const G=m(n);return y.length?d("div",null,G,d("footer",{key:"footer"},y.map(function(E){return d("div",{id:i(E.identifier,js),key:E.identifier},E.identifier,N(L(E.footnote,{inline:!0})))}))):G}const xr=n=>{let{children:r="",options:i}=n,s=function(u,c){if(u==null)return{};var h,d,m={},g=Object.keys(u);for(d=0;d<g.length;d++)c.indexOf(h=g[d])>=0||(m[h]=u[h]);return m}(n,CO);return H.cloneElement(UR(r,i),s)},HR="_generalConditionsContainer_55hjg_1",jR="_generalConditions_55hjg_1",IR="_generalConditionsHeader_55hjg_15",zR="_generalConditionsBody_55hjg_26",GR="_generalConditionsAccept_55hjg_35",zs={generalConditionsContainer:HR,generalConditions:jR,generalConditionsHeader:IR,generalConditionsBody:zR,generalConditionsAccept:GR},kR=()=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"})}),qR=()=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"})}),FR="general-conditions.header",PR="general-conditions.body",Tv="general-conditions.accept-conditions-note",VR=()=>{const n=tt(),[r,i]=H.useState(!1),s=()=>i(!r),u=d=>{d.key==="ArrowDown"||d.key==="ArrowRight"?i(!0):d.key==="ArrowUp"||d.key==="ArrowLeft"||d.key==="Escape"?i(!1):(d.key==="Enter"||d.key==="Space"||d.key===" ")&&s()},c=n(FR),h=n(Tv);return v.jsxs("div",{className:Q(zs.generalConditionsContainer,"chat__generalConditions"),children:[!!c?.length&&v.jsxs("div",{className:zs.generalConditions,children:[v.jsxs("div",{role:"button",onClick:s,onKeyDown:u,tabIndex:0,className:Q(zs.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":r?"true":"false","aria-pressed":r?"true":"false",children:[v.jsx(xr,{children:c}),r?v.jsx(qR,{}):v.jsx(kR,{})]}),v.jsx("div",{className:Q(zs.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:r&&v.jsx(xr,{children:n(PR)||""})})]}),!!h?.length&&v.jsx("div",{className:Q(zs.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:v.jsx(xr,{children:n(Tv)||""})})]})},YR="_message_1sw52_1",XR="_messageBot_1sw52_9",ZR="_messageBotLast_1sw52_19",QR="_avatar_1sw52_19",KR="_messageBotFirst_1sw52_28",$R="_messageBotAnimated_1sw52_41",WR="_messageGuest_1sw52_52",JR="_messageGuestFirst_1sw52_58",ew="_messageGuestLast_1sw52_64",tw="_botAvatar_1sw52_78",nw="_agentAvatar_1sw52_82",rw="_bubble_1sw52_86",aw="_bubbleContent_1sw52_92",iw="_bubbleLeft_1sw52_106",sw="_leftText_1sw52_117",lw="_bubbleRight_1sw52_124",ow="_rightText_1sw52_134",uw="_sourceInfoReference_1sw52_166",cw="_sourceInfoReferenceActive_1sw52_178",ge={message:YR,messageBot:XR,messageBotLast:ZR,avatar:QR,messageBotFirst:KR,messageBotAnimated:$R,messageGuest:WR,messageGuestFirst:JR,messageGuestLast:ew,botAvatar:tw,agentAvatar:nw,bubble:rw,bubbleContent:aw,bubbleLeft:iw,leftText:sw,bubbleRight:lw,rightText:ow,sourceInfoReference:uw,sourceInfoReferenceActive:cw},fw="_botMessageActions_19z1f_1",hw="_alwaysVisible_19z1f_25",dw="_reported_19z1f_32",mw="_action_19z1f_36",aa={botMessageActions:fw,alwaysVisible:hw,reported:dw,action:mw},pw=({alwaysVisible:n,senderType:r,reaction:i,botMessageRef:s,onReaction:u})=>{const c=tt(),[h,d]=H.useState(!1),m=y=>()=>u(y),g=H.useCallback(async()=>{if(s.current)try{d(!0);const y=s.current.innerHTML,_=s.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([y],{type:"text/html"}),"text/plain":new Blob([_],{type:"text/plain"})})]),await new Promise(T=>setTimeout(T,1500))}finally{d(!1)}},[s]);return v.jsxs("div",{className:Q(aa.botMessageActions,n&&aa.alwaysVisible,i&&aa.reported),children:[r===tu.BOT&&v.jsx("button",{className:Q(aa.action,i==="GOOD"&&aa.reported,"tooltip--top-right"),tabIndex:0,"aria-label":c(i==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),"data-title":c(i==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),onClick:m(i==="GOOD"?null:"GOOD"),children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:i==="GOOD"?v.jsx("path",{d:"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32Z"}):v.jsx("path",{d:"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32ZM223.94,97l-12,96a8,8,0,0,1-7.94,7H88V105.89l36.71-73.43A24,24,0,0,1,144,56V80a8,8,0,0,0,8,8h64a8,8,0,0,1,7.94,9Z"})})}),r===tu.BOT&&v.jsx("button",{className:Q(aa.action,i==="BAD"&&aa.reported,"tooltip--top-right"),tabIndex:0,"aria-label":c(i==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),"data-title":c(i==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),onClick:m(i==="BAD"?null:"BAD"),children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:i==="BAD"?v.jsx("path",{d:"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Z"}):v.jsx("path",{d:"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Zm150,21.29a7.88,7.88,0,0,1-6,2.71H152a8,8,0,0,0-8,8v24a24,24,0,0,1-19.29,23.54L88,150.11V56H204a8,8,0,0,1,7.94,7l12,96A7.87,7.87,0,0,1,222,165.29Z"})})}),v.jsx("button",{className:Q(aa.action,"tooltip--top-right"),tabIndex:0,"aria-label":c("bot-bubble.copy"),"data-title":c("bot-bubble.copy"),onClick:g,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:h?v.jsx("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}):v.jsx("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"})})})]})},Ib=H.forwardRef(({message:n,isAnimated:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:u,children:c,onReaction:h},d)=>{const m=tt(),g=H.useRef(null),y=n.sender.type===Oe.UserType.BOT;return v.jsxs("li",{ref:d,className:Q(ge.message,ge.messageBot,i&&ge.lastMessage,s&&ge.messageBotFirst,u&&ge.messageBotLast,"chat__bubbleContainer",r&&ge.messageBotAnimated,r&&"chat__bubbleContainer--animated",y?"chat__botBubbleContainer":"chat__agentBubbleContainer",s&&"chat__bubbleContainer--first",u&&"chat__bubbleContainer--last"),children:[v.jsx("img",{className:Q(ge.avatar,y?ge.botAvatar:ge.agentAvatar,"chat__avatar",y?"chat__botAvatar":"chat__agentAvatar"),src:`${n.sender.avatar}`,alt:y?"Bot":"Agent",referrerPolicy:"no-referrer"}),v.jsxs("div",{ref:g,className:Q(ge.bubble,ge.bubbleLeft,"chat__bubble",y?"chat__botBubble":"chat__agentBubble"),tabIndex:0,"aria-label":m(y?"bot-bubble.label":"agent-bubble.label"),children:[v.jsx("div",{className:Q(ge.leftText),children:c}),h&&v.jsx(pw,{alwaysVisible:i&&u,senderType:n.sender.type,reaction:n.reaction,botMessageRef:g,onReaction:h})]})]})}),gw="_sourceList_1n31h_1",yw="_source_1n31h_1",vw="_label_1n31h_37",fh={sourceList:gw,source:yw,label:vw},zb=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),Gb=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z"})}),kb=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M222,152a6,6,0,0,1-6,6H190v20h18a6,6,0,0,1,0,12H190v18a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6h32A6,6,0,0,1,222,152ZM90,172a26,26,0,0,1-26,26H54v10a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6H64A26,26,0,0,1,90,172Zm-12,0a14,14,0,0,0-14-14H54v28H64A14,14,0,0,0,78,172Zm84,8a34,34,0,0,1-34,34H112a6,6,0,0,1-6-6V152a6,6,0,0,1,6-6h16A34,34,0,0,1,162,180Zm-12,0a22,22,0,0,0-22-22H118v44h10A22,22,0,0,0,150,180ZM42,112V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88v24a6,6,0,0,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,0,1-12,0ZM158,82h35.52L158,46.48Z"})}),qb=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"})}),bw=({type:n,...r})=>{switch(n){case"WEBSITE":return v.jsx(qb,{...r});case"PDF":return v.jsx(kb,{...r});case"DOCX":return v.jsx(zb,{...r});default:return v.jsx(Gb,{...r})}},Pd=({sources:n,onLinkClick:r})=>{const i=tt(),s=c=>()=>{r(c.url)},u=c=>h=>{(h.key==="Enter"||h.key===" ")&&r(c.url)};return n.length?v.jsx("ul",{className:fh.sourceList,"aria-label":i("bot-bubble.sources"),children:n.map(c=>v.jsx("li",{className:fh.source,children:v.jsxs("a",{role:"button",tabIndex:0,"aria-label":`${i("bot-bubble.source.open")}: ${c.label}`,onClick:s(c),onKeyDown:u(c),children:[v.jsx(bw,{type:c.type,"aria-hidden":"true"}),v.jsx("div",{className:fh.label,children:c.label})]})},c.url))}):null},_w="_button_3ui4g_1",Ew="_buttonDefault_3ui4g_13",Sw="_buttonPrimary_3ui4g_28",Js={button:_w,buttonDefault:Ew,buttonPrimary:Sw},gu=({className:n,children:r,...i})=>v.jsx("button",{className:Q(Js.button,n),type:"button",role:"button",...i,children:r}),Tw="_title_137pi_1",Aw="_buttons_137pi_6",xw="_button_137pi_6",Ow="_imageContainer_137pi_29",Rw="_image_137pi_29",ww="_video_container_137pi_44",Cw="_video_137pi_44",Nw="_only_137pi_58",ln={title:Tw,buttons:Aw,button:xw,imageContainer:Ow,image:Rw,video_container:ww,video:Cw,only:Nw},Mw=({buttons:n,onButtonClick:r})=>v.jsx("div",{className:Q(ln.buttons,"chat__bubbleButtons"),children:n.map((i,s)=>v.jsx(gu,{className:Q(ln.button,"chat__bubbleButton"),onClick:()=>r(i),children:i.title},s))}),Av="newtab#",Fb=({markdown:n,markdownOptions:r={},onLinkClick:i})=>{const s=c=>h=>(h.preventDefault(),c&&i(c),!1),u=({title:c,href:h,children:d})=>h.indexOf(Av)===0?v.jsx("a",{href:h.slice(Av.length),title:c,target:"_blank",rel:"noopener noreferrer",children:d}):v.jsx("a",{onClick:s(h),title:c,href:h,children:d});return v.jsx(xr,{options:{...r,overrides:{a:u}},children:n})},Dw=({text:n,onLinkClick:r})=>n?v.jsx("div",{children:v.jsx(Fb,{markdown:n,onLinkClick:r})}):null,Bw=({title:n})=>n?v.jsx("h1",{className:ln.title,children:n}):null,Lw=({title:n,text:r,buttons:i,onButtonClick:s,onLinkClick:u})=>n?.length||r?.length||i?.length?v.jsxs("div",{className:Q(ge.bubbleContent),children:[v.jsx(Bw,{title:n}),v.jsx(Dw,{text:r,onLinkClick:u}),v.jsx(Mw,{buttons:i,onButtonClick:s})]}):null,Uw=({alt:n,imageUrl:r,itemUrl:i,hasBody:s})=>r?i?i.indexOf("youtube.com")>-1?v.jsx("div",{className:ln.video_container,children:v.jsx("iframe",{className:Q(ln.video,{[ln.only]:!s}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):v.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:v.jsx("div",{className:ln.imageContainer,children:v.jsx("img",{className:Q(ln.image,{[ln.only]:!s}),src:r,alt:n})})}):v.jsx("div",{className:ln.imageContainer,children:v.jsx("img",{className:Q(ln.image,{[ln.only]:!s}),src:r,alt:n})}):null,Hw=({title:n,text:r,imageUrl:i,itemUrl:s,buttons:u,sources:c,onButtonClick:h,onLinkClick:d})=>{const m=!!n?.length||!!r?.length||!!u?.length;return v.jsxs("div",{className:Q(ln.detailMessage),children:[v.jsx(Uw,{hasBody:m,imageUrl:i,itemUrl:s,alt:n||""}),m&&v.jsx(Lw,{title:n,text:r,buttons:u,onLinkClick:d,onButtonClick:h}),v.jsx(Pd,{sources:c,onLinkClick:d})]})},jw=H.forwardRef(({isFirstMessageBySender:n,isLastMessageBySender:r,children:i},s)=>{const u=tt();return v.jsx("li",{ref:s,className:Q(ge.message,ge.messageGuest,n&&ge.messageGuestFirst,r&&ge.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:v.jsx("div",{className:Q(ge.bubble,ge.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":u("guest-bubble.label"),children:v.jsx("div",{className:Q(ge.rightText),children:i})})})}),Iw="_markdown_nw7vg_1",Pb={markdown:Iw},Vb=()=>zw(window.location.pathname),zw=n=>{const r=n.split("/"),i=n.endsWith("/");return r[r.length-(i?2:1)]},Vd=()=>H.useMemo(()=>Vb(),[]),Ho="source-info-reference",Gw=({actionId:n,markdown:r,sources:i,onLinkClick:s})=>{const u=Vd(),c=ka(),h=kw(),d=Zt(y=>{const _=y.chat.sourceInfos;if(_?.type==="loaded"||_?.type==="loading")return _.chunkId}),m=y=>_=>{const T=_.key;(T==="ArrowDown"||T==="ArrowRight"||T==="Enter"||T===" "||T==="Space")&&(_.stopPropagation(),c(lv(u,n,y)))},g=y=>()=>{c(lv(u,n,y))};return H.useLayoutEffect(()=>{document.querySelectorAll(`.${Ho}`).forEach(y=>{const _=y.previousSibling;_&&_.nodeType===Node.TEXT_NODE&&_.textContent?.endsWith(" ")&&_.textContent?.trim().length&&y.classList.add(`${Ho}--before-space`);const T=y.nextSibling;T&&T.nodeType===Node.TEXT_NODE&&T.textContent?.startsWith(" ")&&T.textContent?.trim().length&&y.classList.add(`${Ho}--after-space`)})},[r]),v.jsxs("div",{className:ge.bubbleContent,children:[v.jsx("div",{className:Pb.markdown,children:v.jsx(Fb,{markdown:r,onLinkClick:s,markdownOptions:{renderRule(y,_,T,L){if(_.type===NO.footnoteReference){const N=_.text===d;return v.jsx("span",{className:Q(ge.sourceInfoReference,N&&ge.sourceInfoReferenceActive,Ho),children:v.jsx("a",{type:"button",tabIndex:0,onClick:g(_.text),onKeyDown:m(_.text),children:h(_.text)})},L.key)}return y()}}})}),v.jsx(Pd,{sources:i,onLinkClick:s})]})},kw=()=>{const n=[];return i=>{const s=n.indexOf(i);return s>-1?s+1:(n.push(i),n.length)}},qw="_text_gp0s0_1",Fw="_command_gp0s0_5",xv={text:qw,command:Fw},Pw=({text:n,commands:r=[]})=>{const i=r.find(u=>n.startsWith(`/${u}`)),s=i?n.slice(i.length+1):n;return v.jsxs("div",{children:[i&&v.jsxs("code",{className:xv.command,children:["/",i]}),s.split(`
|
|
109
|
+
`).replace(VO,"").replace(sR," ")}(I),x)}}(T),N=(V=function(E,w){return function(S,I,x){const Z=E[S.type].l;return w?w(()=>Z(S,I,x),S,I,x):Z(S,I,x)}}(T,r.renderRule),function E(w,S={}){if(Array.isArray(w)){const I=S.key,x=[];let Z=!1;for(let $=0;$<w.length;$++){S.key=$;const ie=E(w[$],S),_e=typeof ie=="string";_e&&Z?x[x.length-1]+=ie:ie!==null&&x.push(ie),Z=_e}return S.key=I,x}return V(w,E,S)});var V;const G=m(n);return y.length?d("div",null,G,d("footer",{key:"footer"},y.map(function(E){return d("div",{id:i(E.identifier,js),key:E.identifier},E.identifier,N(L(E.footnote,{inline:!0})))}))):G}const xr=n=>{let{children:r="",options:i}=n,s=function(u,c){if(u==null)return{};var h,d,m={},g=Object.keys(u);for(d=0;d<g.length;d++)c.indexOf(h=g[d])>=0||(m[h]=u[h]);return m}(n,CO);return H.cloneElement(UR(r,i),s)},HR="_generalConditionsContainer_55hjg_1",jR="_generalConditions_55hjg_1",IR="_generalConditionsHeader_55hjg_15",zR="_generalConditionsBody_55hjg_26",GR="_generalConditionsAccept_55hjg_35",zs={generalConditionsContainer:HR,generalConditions:jR,generalConditionsHeader:IR,generalConditionsBody:zR,generalConditionsAccept:GR},kR=()=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"})}),qR=()=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"})}),FR="general-conditions.header",PR="general-conditions.body",Tv="general-conditions.accept-conditions-note",VR=()=>{const n=tt(),[r,i]=H.useState(!1),s=()=>i(!r),u=d=>{d.key==="ArrowDown"||d.key==="ArrowRight"?i(!0):d.key==="ArrowUp"||d.key==="ArrowLeft"||d.key==="Escape"?i(!1):(d.key==="Enter"||d.key==="Space"||d.key===" ")&&s()},c=n(FR),h=n(Tv);return v.jsxs("div",{className:Q(zs.generalConditionsContainer,"chat__generalConditions"),children:[!!c?.length&&v.jsxs("div",{className:zs.generalConditions,children:[v.jsxs("div",{role:"button",onClick:s,onKeyDown:u,tabIndex:0,className:Q(zs.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":r?"true":"false","aria-pressed":r?"true":"false",children:[v.jsx(xr,{children:c}),r?v.jsx(qR,{}):v.jsx(kR,{})]}),v.jsx("div",{className:Q(zs.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:r&&v.jsx(xr,{children:n(PR)||""})})]}),!!h?.length&&v.jsx("div",{className:Q(zs.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:v.jsx(xr,{children:n(Tv)||""})})]})},YR="_message_1sw52_1",XR="_messageBot_1sw52_9",ZR="_messageBotLast_1sw52_19",QR="_avatar_1sw52_19",KR="_messageBotFirst_1sw52_28",$R="_messageBotAnimated_1sw52_41",WR="_messageGuest_1sw52_52",JR="_messageGuestFirst_1sw52_58",ew="_messageGuestLast_1sw52_64",tw="_botAvatar_1sw52_78",nw="_agentAvatar_1sw52_82",rw="_bubble_1sw52_86",aw="_bubbleContent_1sw52_92",iw="_bubbleLeft_1sw52_106",sw="_leftText_1sw52_117",lw="_bubbleRight_1sw52_124",ow="_rightText_1sw52_134",uw="_sourceInfoReference_1sw52_166",cw="_sourceInfoReferenceActive_1sw52_178",ge={message:YR,messageBot:XR,messageBotLast:ZR,avatar:QR,messageBotFirst:KR,messageBotAnimated:$R,messageGuest:WR,messageGuestFirst:JR,messageGuestLast:ew,botAvatar:tw,agentAvatar:nw,bubble:rw,bubbleContent:aw,bubbleLeft:iw,leftText:sw,bubbleRight:lw,rightText:ow,sourceInfoReference:uw,sourceInfoReferenceActive:cw},fw="_botMessageActions_m0f8n_1",hw="_alwaysVisible_m0f8n_27",dw="_reported_m0f8n_34",mw="_action_m0f8n_38",aa={botMessageActions:fw,alwaysVisible:hw,reported:dw,action:mw},pw=({alwaysVisible:n,senderType:r,reaction:i,botMessageRef:s,onReaction:u})=>{const c=tt(),[h,d]=H.useState(!1),m=y=>()=>u(y),g=H.useCallback(async()=>{if(s.current)try{d(!0);const y=s.current.innerHTML,_=s.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([y],{type:"text/html"}),"text/plain":new Blob([_],{type:"text/plain"})})]),await new Promise(T=>setTimeout(T,1500))}finally{d(!1)}},[s]);return v.jsxs("div",{className:Q(aa.botMessageActions,n&&aa.alwaysVisible,i&&aa.reported),children:[r===tu.BOT&&v.jsx("button",{className:Q(aa.action,i==="GOOD"&&aa.reported,"tooltip--top-right"),tabIndex:0,"aria-label":c(i==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),"data-title":c(i==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),onClick:m(i==="GOOD"?null:"GOOD"),children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:i==="GOOD"?v.jsx("path",{d:"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32Z"}):v.jsx("path",{d:"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32ZM223.94,97l-12,96a8,8,0,0,1-7.94,7H88V105.89l36.71-73.43A24,24,0,0,1,144,56V80a8,8,0,0,0,8,8h64a8,8,0,0,1,7.94,9Z"})})}),r===tu.BOT&&v.jsx("button",{className:Q(aa.action,i==="BAD"&&aa.reported,"tooltip--top-right"),tabIndex:0,"aria-label":c(i==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),"data-title":c(i==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),onClick:m(i==="BAD"?null:"BAD"),children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:i==="BAD"?v.jsx("path",{d:"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Z"}):v.jsx("path",{d:"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Zm150,21.29a7.88,7.88,0,0,1-6,2.71H152a8,8,0,0,0-8,8v24a24,24,0,0,1-19.29,23.54L88,150.11V56H204a8,8,0,0,1,7.94,7l12,96A7.87,7.87,0,0,1,222,165.29Z"})})}),v.jsx("button",{className:Q(aa.action,"tooltip--top-right"),tabIndex:0,"aria-label":c("bot-bubble.copy"),"data-title":c("bot-bubble.copy"),onClick:g,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:h?v.jsx("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}):v.jsx("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"})})})]})},Ib=H.forwardRef(({message:n,isAnimated:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:u,children:c,onReaction:h},d)=>{const m=tt(),g=H.useRef(null),y=n.sender.type===Oe.UserType.BOT;return v.jsxs("li",{ref:d,className:Q(ge.message,ge.messageBot,i&&ge.lastMessage,s&&ge.messageBotFirst,u&&ge.messageBotLast,"chat__bubbleContainer",r&&ge.messageBotAnimated,r&&"chat__bubbleContainer--animated",y?"chat__botBubbleContainer":"chat__agentBubbleContainer",s&&"chat__bubbleContainer--first",u&&"chat__bubbleContainer--last"),children:[v.jsx("img",{className:Q(ge.avatar,y?ge.botAvatar:ge.agentAvatar,"chat__avatar",y?"chat__botAvatar":"chat__agentAvatar"),src:`${n.sender.avatar}`,alt:y?"Bot":"Agent",referrerPolicy:"no-referrer"}),v.jsxs("div",{ref:g,className:Q(ge.bubble,ge.bubbleLeft,"chat__bubble",y?"chat__botBubble":"chat__agentBubble"),tabIndex:0,"aria-label":m(y?"bot-bubble.label":"agent-bubble.label"),children:[v.jsx("div",{className:Q(ge.leftText),children:c}),h&&v.jsx(pw,{alwaysVisible:i&&u,senderType:n.sender.type,reaction:n.reaction,botMessageRef:g,onReaction:h})]})]})}),gw="_sourceList_1n31h_1",yw="_source_1n31h_1",vw="_label_1n31h_37",fh={sourceList:gw,source:yw,label:vw},zb=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),Gb=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z"})}),kb=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M222,152a6,6,0,0,1-6,6H190v20h18a6,6,0,0,1,0,12H190v18a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6h32A6,6,0,0,1,222,152ZM90,172a26,26,0,0,1-26,26H54v10a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6H64A26,26,0,0,1,90,172Zm-12,0a14,14,0,0,0-14-14H54v28H64A14,14,0,0,0,78,172Zm84,8a34,34,0,0,1-34,34H112a6,6,0,0,1-6-6V152a6,6,0,0,1,6-6h16A34,34,0,0,1,162,180Zm-12,0a22,22,0,0,0-22-22H118v44h10A22,22,0,0,0,150,180ZM42,112V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88v24a6,6,0,0,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,0,1-12,0ZM158,82h35.52L158,46.48Z"})}),qb=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"})}),bw=({type:n,...r})=>{switch(n){case"WEBSITE":return v.jsx(qb,{...r});case"PDF":return v.jsx(kb,{...r});case"DOCX":return v.jsx(zb,{...r});default:return v.jsx(Gb,{...r})}},Pd=({sources:n,onLinkClick:r})=>{const i=tt(),s=c=>()=>{r(c.url)},u=c=>h=>{(h.key==="Enter"||h.key===" ")&&r(c.url)};return n.length?v.jsx("ul",{className:fh.sourceList,"aria-label":i("bot-bubble.sources"),children:n.map(c=>v.jsx("li",{className:fh.source,children:v.jsxs("a",{role:"button",tabIndex:0,"aria-label":`${i("bot-bubble.source.open")}: ${c.label}`,onClick:s(c),onKeyDown:u(c),children:[v.jsx(bw,{type:c.type,"aria-hidden":"true"}),v.jsx("div",{className:fh.label,children:c.label})]})},c.url))}):null},_w="_button_3ui4g_1",Ew="_buttonDefault_3ui4g_13",Sw="_buttonPrimary_3ui4g_28",Js={button:_w,buttonDefault:Ew,buttonPrimary:Sw},gu=({className:n,children:r,...i})=>v.jsx("button",{className:Q(Js.button,n),type:"button",role:"button",...i,children:r}),Tw="_title_137pi_1",Aw="_buttons_137pi_6",xw="_button_137pi_6",Ow="_imageContainer_137pi_29",Rw="_image_137pi_29",ww="_video_container_137pi_44",Cw="_video_137pi_44",Nw="_only_137pi_58",ln={title:Tw,buttons:Aw,button:xw,imageContainer:Ow,image:Rw,video_container:ww,video:Cw,only:Nw},Mw=({buttons:n,onButtonClick:r})=>v.jsx("div",{className:Q(ln.buttons,"chat__bubbleButtons"),children:n.map((i,s)=>v.jsx(gu,{className:Q(ln.button,"chat__bubbleButton"),onClick:()=>r(i),children:i.title},s))}),Av="newtab#",Fb=({markdown:n,markdownOptions:r={},onLinkClick:i})=>{const s=c=>h=>(h.preventDefault(),c&&i(c),!1),u=({title:c,href:h,children:d})=>h.indexOf(Av)===0?v.jsx("a",{href:h.slice(Av.length),title:c,target:"_blank",rel:"noopener noreferrer",children:d}):v.jsx("a",{onClick:s(h),title:c,href:h,children:d});return v.jsx(xr,{options:{...r,overrides:{a:u}},children:n})},Dw=({text:n,onLinkClick:r})=>n?v.jsx("div",{children:v.jsx(Fb,{markdown:n,onLinkClick:r})}):null,Bw=({title:n})=>n?v.jsx("h1",{className:ln.title,children:n}):null,Lw=({title:n,text:r,buttons:i,onButtonClick:s,onLinkClick:u})=>n?.length||r?.length||i?.length?v.jsxs("div",{className:Q(ge.bubbleContent),children:[v.jsx(Bw,{title:n}),v.jsx(Dw,{text:r,onLinkClick:u}),v.jsx(Mw,{buttons:i,onButtonClick:s})]}):null,Uw=({alt:n,imageUrl:r,itemUrl:i,hasBody:s})=>r?i?i.indexOf("youtube.com")>-1?v.jsx("div",{className:ln.video_container,children:v.jsx("iframe",{className:Q(ln.video,{[ln.only]:!s}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):v.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:v.jsx("div",{className:ln.imageContainer,children:v.jsx("img",{className:Q(ln.image,{[ln.only]:!s}),src:r,alt:n})})}):v.jsx("div",{className:ln.imageContainer,children:v.jsx("img",{className:Q(ln.image,{[ln.only]:!s}),src:r,alt:n})}):null,Hw=({title:n,text:r,imageUrl:i,itemUrl:s,buttons:u,sources:c,onButtonClick:h,onLinkClick:d})=>{const m=!!n?.length||!!r?.length||!!u?.length;return v.jsxs("div",{className:Q(ln.detailMessage),children:[v.jsx(Uw,{hasBody:m,imageUrl:i,itemUrl:s,alt:n||""}),m&&v.jsx(Lw,{title:n,text:r,buttons:u,onLinkClick:d,onButtonClick:h}),v.jsx(Pd,{sources:c,onLinkClick:d})]})},jw=H.forwardRef(({isFirstMessageBySender:n,isLastMessageBySender:r,children:i},s)=>{const u=tt();return v.jsx("li",{ref:s,className:Q(ge.message,ge.messageGuest,n&&ge.messageGuestFirst,r&&ge.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:v.jsx("div",{className:Q(ge.bubble,ge.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":u("guest-bubble.label"),children:v.jsx("div",{className:Q(ge.rightText),children:i})})})}),Iw="_markdown_nw7vg_1",Pb={markdown:Iw},Vb=()=>zw(window.location.pathname),zw=n=>{const r=n.split("/"),i=n.endsWith("/");return r[r.length-(i?2:1)]},Vd=()=>H.useMemo(()=>Vb(),[]),Ho="source-info-reference",Gw=({actionId:n,markdown:r,sources:i,onLinkClick:s})=>{const u=Vd(),c=ka(),h=kw(),d=Zt(y=>{const _=y.chat.sourceInfos;if(_?.type==="loaded"||_?.type==="loading")return _.chunkId}),m=y=>_=>{const T=_.key;(T==="ArrowDown"||T==="ArrowRight"||T==="Enter"||T===" "||T==="Space")&&(_.stopPropagation(),c(lv(u,n,y)))},g=y=>()=>{c(lv(u,n,y))};return H.useLayoutEffect(()=>{document.querySelectorAll(`.${Ho}`).forEach(y=>{const _=y.previousSibling;_&&_.nodeType===Node.TEXT_NODE&&_.textContent?.endsWith(" ")&&_.textContent?.trim().length&&y.classList.add(`${Ho}--before-space`);const T=y.nextSibling;T&&T.nodeType===Node.TEXT_NODE&&T.textContent?.startsWith(" ")&&T.textContent?.trim().length&&y.classList.add(`${Ho}--after-space`)})},[r]),v.jsxs("div",{className:ge.bubbleContent,children:[v.jsx("div",{className:Pb.markdown,children:v.jsx(Fb,{markdown:r,onLinkClick:s,markdownOptions:{renderRule(y,_,T,L){if(_.type===NO.footnoteReference){const N=_.text===d;return v.jsx("span",{className:Q(ge.sourceInfoReference,N&&ge.sourceInfoReferenceActive,Ho),children:v.jsx("a",{type:"button",tabIndex:0,onClick:g(_.text),onKeyDown:m(_.text),children:h(_.text)})},L.key)}return y()}}})}),v.jsx(Pd,{sources:i,onLinkClick:s})]})},kw=()=>{const n=[];return i=>{const s=n.indexOf(i);return s>-1?s+1:(n.push(i),n.length)}},qw="_text_gp0s0_1",Fw="_command_gp0s0_5",xv={text:qw,command:Fw},Pw=({text:n,commands:r=[]})=>{const i=r.find(u=>n.startsWith(`/${u}`)),s=i?n.slice(i.length+1):n;return v.jsxs("div",{children:[i&&v.jsxs("code",{className:xv.command,children:["/",i]}),s.split(`
|
|
110
110
|
`).map((u,c)=>v.jsxs("span",{className:xv.text,children:[u,v.jsx("br",{})]},c))]})},Vw=({text:n,commands:r,sources:i,onLinkClick:s})=>v.jsxs("div",{className:ge.bubbleContent,children:[v.jsx(Pw,{text:n,commands:r}),v.jsx(Pd,{sources:i,onLinkClick:s})]}),Yw=H.forwardRef(({message:n,commands:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:u,onReaction:c,onButtonClick:h,onLinkClick:d},m)=>{const g=Xw(n._id,n,r,h,d);switch(n.sender.type){case Oe.UserType.GUEST:return v.jsx(jw,{ref:m,isFirstMessageBySender:s,isLastMessageBySender:u,children:g});default:{const y=_=>c(n._id,_);return v.jsx(Ib,{ref:m,message:n,isAnimated:!1,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:u,onReaction:y,children:g})}}}),Xw=(n,r,i,s,u)=>{switch(r.type){case Oe.MessageTypeEnum.TEXT:{const c=r;return v.jsx(Vw,{text:c.text,commands:i,sources:r.sources||[],onLinkClick:u})}case Oe.MessageTypeEnum.DETAIL:{const c=r;return v.jsx(Hw,{title:c.title,text:c.text,imageUrl:c.imageUrl,itemUrl:c.itemUrl,buttons:c.buttons,sources:r.sources||[],onButtonClick:s,onLinkClick:u})}case Oe.MessageTypeEnum.MARKDOWN:{const c=r;return v.jsx(Gw,{actionId:n,markdown:c.markdown,sources:c.sources||[],onLinkClick:u})}}},Zw=(n,r)=>n.message._id===r.message._id&&n.message.reaction===r.message.reaction&&n.isLastMessage===r.isLastMessage&&n.isFirstMessageBySender===r.isFirstMessageBySender&&n.isLastMessageBySender===r.isLastMessageBySender,Qw=g1.memo(Yw,Zw),Kw="_ticontainer_xg0dn_1",$w="_tiblock_xg0dn_5",Ww="_tidot_xg0dn_12",Gs={ticontainer:Kw,tiblock:$w,tidot:Ww},Jw=({isTyping:n=!1})=>v.jsx("div",{className:Gs.ticontainer,children:v.jsx("div",{className:Gs.tiblock,children:n?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:Q(Gs.tidot,"chat__typingIndicator")}),v.jsx("div",{className:Q(Gs.tidot,"chat__typingIndicator")}),v.jsx("div",{className:Q(Gs.tidot,"chat__typingIndicator")})]}):null})}),eC=Object.assign({_id:"typing-indicator"},new Oe.TextMessage("",new Oe.BotUser)),tC=({messages:n,isBotTyping:r,commands:i,onTranscriptItemReaction:s,onButtonClick:u,onLinkClick:c})=>{const h=H.useRef(0),d=H.useRef(!0),m=H.useRef(null),g=H.useRef(null),y=H.useRef(null),_=Zt(N=>N.settings.enableGeneralConditions);H.useLayoutEffect(()=>{if(n.length&&m.current&&(h.current<n.length||r)){if(g.current){const N=g.current.offsetTop;m.current.scrollTop=N}else if(y.current){const N=y.current.offsetTop;m.current.scrollTop=N}d.current&&(d.current=!1),h.current=n.length}},[n,d,r]);let T;const L=n.length;return v.jsxs("div",{ref:m,className:Q(uv.messageContainer,"chat__messageContainer"),style:{scrollBehavior:n.length&&d.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[_&&v.jsx(VR,{}),v.jsxs("ul",{className:uv.messages,children:[n.map((N,V)=>{const G=nC(N,T),E=rC(N,V,n,r);T=N.sender.type;const w=V+1===L,S=N._id||`added-${V}`;return v.jsx(Qw,{ref:w?y:null,message:N,commands:i,isLastMessage:w,isFirstMessageBySender:G,isLastMessageBySender:E,onButtonClick:u,onLinkClick:c,onReaction:s},w&&!r?"last":S)}),r&&v.jsx(Ib,{ref:g,message:eC,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:T!==Oe.UserType.BOT,isLastMessageBySender:!0,children:v.jsx(Jw,{isTyping:!0})},"last")]})]})},nC=(n,r)=>!r||r!==n.sender.type,rC=(n,r,i,s)=>{const u=n.sender.type,c=i.length;return r+1===c?!(u===Oe.UserType.BOT&&s):u!==i.at(r+1)?.sender.type},aC="_bottomSheet_jp8dl_1",iC="_bottomSheetOpen_jp8dl_15",sC="_bottomSheetClose_jp8dl_20",Or={bottomSheet:aC,bottomSheetOpen:iC,bottomSheetClose:sC},lC="_container_xc2nx_1",Ov={container:lC},oC=({contentUrl:n})=>{const r=Zt(c=>c.connection.sessionId),[i,s]=H.useState(!1);H.useEffect(()=>{s(c=>c||!!n)},[n]);const u=H.useMemo(()=>{if(n&&r){const c=new URL(n,document.baseURI);return c.searchParams.set("sessionId",r),c.toString()}else return},[n,r]);return v.jsx("div",{className:Q(Ov.container,Or.bottomSheet,{[Or.bottomSheetOpen]:!!n,[Or.bottomSheetClose]:i&&!n}),children:u&&v.jsx("iframe",{title:"Drawer",src:u,className:Ov.iframe})})},uC="_container_z787n_1",cC={container:uC},fC=({title:n,href:r,children:i})=>v.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),hC=()=>{const r=tt()("powered-by");return r&&r.length?v.jsx("div",{className:Q(cC.container,"chat__poweredBy"),children:v.jsx(xr,{options:{overrides:{a:fC}},children:r})}):null},dC=({className:n,children:r,...i})=>v.jsx(gu,{className:Q(Js.buttonDefault,n),type:"button",...i,children:r}),nu=({className:n,children:r,...i})=>v.jsx(gu,{className:Q(Js.buttonPrimary,n),...i,children:r}),mC="_container_h23mk_1",pC="_formContainer_h23mk_17",gC="_emailInput_h23mk_22",yC="_description_h23mk_52",vC="_actions_h23mk_57",bC="_validationError_h23mk_67",_C="_submitted_h23mk_74",Da={container:mC,formContainer:pC,emailInput:gC,description:yC,actions:vC,validationError:bC,submitted:_C},EC=({visible:n,onEmailExport:r,onClose:i})=>{const s=tt(),[u,c]=H.useState(void 0),[h,d]=H.useState(!1),[m,g]=H.useState(void 0),y=H.useRef(null);H.useEffect(()=>{n?(y.current?.focus(),d(!1),c(n)):u===!0&&c(!1)},[n,u]);const _=L=>{L.preventDefault(),m&&m.length>0&&(r(m),d(!0),setTimeout(i,3*1e3))},T=L=>{const N=L.target.value.trim(),V=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(N);g(V?N:"")};return v.jsxs("div",{className:Q(Da.container,Or.bottomSheet,{[Or.bottomSheetOpen]:u===!0,[Or.bottomSheetClose]:u===!1}),children:[v.jsx("h2",{children:s("export-transcript.email.title")}),v.jsx(xr,{className:Da.description,children:s("export-transcript.email.description")||""}),v.jsxs("form",{onSubmit:_,className:Da.formContainer,children:[v.jsxs("div",{children:[v.jsx("input",{disabled:h,ref:y,type:"email",placeholder:s("export-transcript.email.placeholder"),className:Da.emailInput,onChange:T}),m?.length===0?v.jsx("div",{className:Da.validationError,children:s("export-transcript.email.invalid")}):null]}),v.jsxs("div",{className:Da.actions,children:[v.jsx(dC,{onClick:i,children:s("export-transcript.email.cancel")}),v.jsx(nu,{type:"submit",disabled:h||m===void 0||m.length===0,children:s("export-transcript.email.send")})]})]}),h&&v.jsx("div",{className:Da.submitted,children:s("export-transcript.email.success")})]})},SC="_inputContainer_fi5ao_1",TC={inputContainer:SC},AC="_blockUserInput_pot9c_1",xC={blockUserInput:AC},OC=({visible:n})=>{const r=tt();return n?v.jsx("div",{className:Q(xC.blockUserInput,"chat__blockUserInput"),children:r("block-user-input.title")}):null},RC="_commandsDropdown_5ytuv_1",wC="_commands_5ytuv_1",CC="_command_5ytuv_1",NC="_commandActive_5ytuv_46",MC="_commandsSelections_5ytuv_55",Zs={commandsDropdown:RC,commands:wC,command:CC,commandActive:NC,commandsSelections:MC},Yb=(n,r)=>{H.useEffect(()=>{const i=s=>{n.current&&!n.current.contains(s.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,r])},DC=(n,r,i,s,u)=>{H.useEffect(()=>{const c=h=>{if(n.length)switch(h.key){case"Enter":i(n[r]);break;case"ArrowUp":s(d=>d>0?d-1:n.length-1);break;case"ArrowDown":s(d=>d<n.length-1?d+1:0);break;case"Escape":u([]);break}};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[n,r,i,s,u])},BC=({text:n,commands:r,onSelectCommand:i,onVisibilityChange:s})=>{const u=H.useRef(null),c=tt(),[h,d]=H.useState([]),[m,g]=H.useState(Rv(r)),[y,_]=H.useState(0),T=L=>i(`/${L}`);return Yb(u,()=>d([])),DC(h,y,T,_,d),H.useEffect(()=>{g(Rv(r))},[r]),H.useEffect(()=>{const L=n.length||0;L===0||L>m||!n.startsWith("/")?d([]):d(r.filter(LC(n))),_(0)},[r,n,m]),H.useEffect(()=>{s(!!h.length)},[h,s]),h.length?v.jsx("div",{ref:u,className:Zs.commandsDropdown,children:v.jsx("ul",{id:"command-list",className:Zs.commands,role:"listbox",children:h.map((L,N)=>v.jsxs("li",{className:Q([Zs.command,y===N&&Zs.commandActive]),role:"option",onClick:()=>T(L),onMouseOver:()=>_(N),children:[v.jsxs("h1",{children:["/",L]}),v.jsx("p",{children:c(`commands.${L}`)})]},L))})}):null},Rv=n=>Math.max(...n.map(r=>r.length+1)),LC=n=>r=>{const i=`/${r}`;return i.startsWith(n)&&i.length>=n.length},wv=3,UC=({commands:n,onSelectCommand:r})=>{const i=tt(),[s,u]=H.useState(!1),c=g=>()=>{r(`/${g}`),u(!1)},h=()=>{u(!0)},d=()=>{u(!1)},m=s?n:n.slice(0,wv);return v.jsxs("div",{className:Zs.commandsSelections,children:[m.map(g=>v.jsxs("button",{className:"tooltip--top-center","aria-label":i(`commands.${g}`),"data-title":i(`commands.${g}`),tabIndex:0,onClick:c(g),children:["/",g]},g)),m.length<n.length?v.jsx("button",{"aria-label":i("commands.show-more.tooltip"),"data-title":i("commands.show-more.tooltip"),tabIndex:0,onClick:h,children:i("commands.show-more.action")},"show-more"):m.length>wv?v.jsx("button",{"aria-label":i("commands.show-less.tooltip"),"data-title":i("commands.show-less.tooltip"),tabIndex:0,onClick:d,children:i("commands.show-less.action")},"show-less"):null]})},HC="_callToActionContainer_1pojq_1",jC="_callToActionTitle_1pojq_23",IC="_rateOverlay_1pojq_30",zC="_body_1pojq_52",GC="_footer_1pojq_60",kC="_actions_1pojq_73",qC="_bubbles_1pojq_101",FC="_stars_1pojq_203",PC="_starsSmall_1pojq_217",VC="_starsLarge_1pojq_223",YC="_star_1pojq_203",XC="_starReadonly_1pojq_237",ZC="_starIcon_1pojq_247",QC="_starsDescriptionContainer_1pojq_265",KC="_starsDescription_1pojq_265",jt={callToActionContainer:HC,callToActionTitle:jC,rateOverlay:IC,body:zC,footer:GC,actions:kC,bubbles:qC,stars:FC,starsSmall:PC,starsLarge:VC,star:YC,starReadonly:XC,starIcon:ZC,starsDescriptionContainer:QC,starsDescription:KC},$C=({value:n,index:r,count:i,readonly:s,onHover:u,onClick:c})=>{const h=d=>{c&&d.key==="Enter"&&c()};return v.jsx("li",{className:Q(jt.star,{[jt.starReadonly]:s},"chat__conversationRating__star"),children:v.jsx("div",{role:"radio","aria-checked":n>r?"true":"false","aria-posinset":r+1,"aria-setsize":i,tabIndex:0,onMouseOver:u,onKeyDown:h,onClick:c,children:v.jsx("span",{role:"img","aria-label":"Star",className:Q(jt.starIcon),children:v.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:v.jsx("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"})})})})})},Cv=5,Xb=({value:n,size:r,readonly:i=!1,onChange:s})=>{const[u,c]=H.useState(void 0),h=()=>{c(void 0)},d=g=>()=>{if(!i){const y=g+1;c(y)}},m=g=>()=>{s&&!i&&(s(g===0&&n===1?0:g+1),c(void 0))};return v.jsx("ul",{tabIndex:0,role:"radiogroup",className:Q(jt.stars,{[jt.starsSmall]:r==="small",[jt.starsLarge]:r==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:r==="small",chat__conversationRating__stars__large:r==="large"}),onMouseOut:h,children:Array(Cv).fill(0).map((g,y)=>v.jsx($C,{value:u===void 0?n:u,index:y,count:Cv,readonly:i,onHover:d(y),onClick:m(y)},y))})},WC=({visible:n,onRate:r})=>{const i=tt();return n?v.jsxs("div",{className:Q(jt.callToActionContainer,"chat__conversationRating__callToAction"),children:[v.jsx("div",{className:Q(jt.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),v.jsx(Xb,{value:0,size:"small",onChange:r})]}):null},hh=({isFirstMessageBySender:n,isLastMessageBySender:r,children:i})=>v.jsxs("div",{className:Q(ge.message,ge.messageBot,n&&ge.messageBotFirst,r&&ge.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:[v.jsx("img",{className:Q(ge.avatar,ge.botAvatar),src:"bot.svg",alt:"Bot"}),v.jsx("div",{className:Q(ge.bubble,ge.bubbleLeft,"chat__bubble","chat__botBubble"),children:v.jsx("div",{className:Q(ge.leftText,ge.bubbleContent),children:i})})]}),JC=({children:n})=>v.jsx("div",{className:Q(ge.message,ge.messageGuest,ge.messageGuestFirst,ge.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:v.jsx("div",{className:Q(ge.bubble,ge.bubbleRight,"chat__bubble","chat__guestBubble"),children:v.jsx("div",{className:Q(ge.rightText,ge.bubbleContent),children:n})})}),e6=({visible:n,rating:r,onRate:i,onClose:s})=>{const u=tt(),[c,h]=H.useState(r),[d,m]=H.useState(void 0),[g,y]=H.useState(void 0),[_,T]=H.useState({submitted:!1,feedback:""}),[L,N]=H.useState(!1),V=H.useRef(null);H.useEffect(()=>{n?(T({submitted:!1,feedback:""}),y(n)):g===!0&&y(!1)},[n,g]),H.useEffect(()=>{h(r)},[r]),H.useEffect(()=>{const E=c>0?u(`conversation-rating.overlay.bot-message.rate-feedback.value-${c}`):void 0;m(E?.length?E:void 0)},[c,u]),H.useEffect(()=>{_.submitted?setTimeout(()=>N(!0),_.feedback.length?500:0):N(!1)},[_]);const G=E=>{E.preventDefault();const w=V.current?.value?.trim()||"";i(c,w),T({submitted:!0,feedback:w})};return v.jsx("div",{className:Q(jt.rateOverlay,Or.bottomSheet,"chat__conversationRating__overlay",{[Or.bottomSheetOpen]:g===!0,[Or.bottomSheetClose]:g===!1}),children:v.jsxs("form",{onSubmit:G,children:[v.jsxs("div",{className:Q(jt.body,"chat__conversationRating__overlay__body"),children:[v.jsx("div",{}),v.jsx("div",{className:Q(jt.bubbles),children:n&&d&&v.jsxs(v.Fragment,{children:[v.jsxs(hh,{isFirstMessageBySender:!0,isLastMessageBySender:!1,children:[v.jsx("h2",{children:u("conversation-rating.overlay.title")}),v.jsxs("div",{className:Q(jt.starsDescriptionContainer),children:[v.jsx(Xb,{value:c,size:"large",readonly:_.submitted,onChange:h}),v.jsxs("div",{className:Q(jt.starsDescription),children:[v.jsx("div",{children:u("conversation-rating.overlay.star.very-bad")}),v.jsx("div",{children:u("conversation-rating.overlay.star.very-good")})]})]})]}),v.jsx(hh,{isFirstMessageBySender:!1,isLastMessageBySender:!L||!!_.feedback.length,children:v.jsx("div",{children:d})}),!!_.feedback.length&&v.jsx(JC,{children:_.feedback}),L&&v.jsx(hh,{isFirstMessageBySender:!!_.feedback.length,isLastMessageBySender:!0,children:v.jsx("div",{children:u("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),v.jsxs("div",{className:Q(jt.footer,"chat__conversationRating__overlay__footer"),children:[!_.submitted&&v.jsx("input",{ref:V,placeholder:u("conversation-rating.overlay.guest-feedback.input-placeholder")}),v.jsx("div",{className:Q(jt.actions,"chat__conversationRating__overlay__footer__actions"),children:_.submitted?v.jsx(nu,{type:"button",onClick:s,children:u("conversation-rating.overlay.action.close")}):v.jsx(nu,{type:"submit",children:u("conversation-rating.overlay.action.submit")})})]})]})})},t6=({conversationRating:{enabled:n,rating:r},numberOfMessagesFromGuest:i,showRatingOverlay:s,setShowRatingOverlay:u,onRate:c})=>{const[h,d]=H.useState(0),m=_=>{d(_),u(!0)},g=()=>u(!1),y=!r&&i>=1;return n?v.jsxs(v.Fragment,{children:[v.jsx(WC,{visible:y,onRate:m}),v.jsx(e6,{visible:s,rating:h,onRate:c,onClose:g})]}):null},n6=H.memo(t6),r6="_inputWrapper_e3h44_1",a6="_withOpenCommands_e3h44_14",i6="_messageInputWrapper_e3h44_20",s6="_messageInput_e3h44_20",l6="_buttons_e3h44_44",o6="_button_e3h44_44",xi={inputWrapper:r6,withOpenCommands:a6,messageInputWrapper:i6,messageInput:s6,buttons:l6,button:o6},u6="_audioRecorder_g845f_1",c6="_audioButton_g845f_6",f6="_recorderIcon_g845f_37",h6="_spinning_g845f_60",Ba={audioRecorder:u6,audioButton:c6,recorderIcon:f6,spinning:h6},Nv=2048,ru=16e3;class d6 extends g1.Component{audioInput=null;volume=null;leftchannel=[];recorder=null;recordingLength=0;sampleRate=null;mediaStream=null;constructor(r){super(r),this.state={recordingState:"none"},this.triggerAudioRecording=this.triggerAudioRecording.bind(this),this.triggerAudioRecordingSuccess=this.triggerAudioRecordingSuccess.bind(this),this.initRecording=this.initRecording.bind(this),this.processRecordingInput=this.processRecordingInput.bind(this),this.handleClickSubmitAudio=this.handleClickSubmitAudio.bind(this),this.handleClickStopAudio=this.handleClickStopAudio.bind(this)}triggerAudioRecording(){this.setState({recordingState:"connecting"}),navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(this.triggerAudioRecordingSuccess)}triggerAudioRecordingSuccess(r){this.mediaStream=r,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(r)}initRecording(r){const i=window.AudioContext||window.webkitAudioContext,s=new i;this.sampleRate=s.sampleRate,this.volume=s.createGain(),this.audioInput=s.createMediaStreamSource(r),this.audioInput.connect(this.volume),this.recorder=s.createScriptProcessor(Nv,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(s.destination)}processRecordingInput(r){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const i=r.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(i)),this.recordingLength+=Nv}}handleClickSubmitAudio(){const r=p6(this.leftchannel,this.recordingLength),i=g6(r,this.sampleRate||0),s=m6(i);this.props.onAudioRecorded(s),this.handleClickStopAudio()}handleClickStopAudio(){this.setState({recordingState:"none"}),this.audioInput?.disconnect(),this.volume?.disconnect(),this.recorder?.disconnect(),this.mediaStream&&this.mediaStream?.getAudioTracks().forEach(r=>{r.stop()})}render(){return v.jsxs("div",{className:Ba.audioRecorder,children:[this.state.recordingState==="none"&&v.jsx("button",{className:Q(Ba.audioButton,"chat__button"),type:"submit","aria-label":this.props.translate("message-input.actions.start-audio-recording.label"),"data-title":this.props.translate("message-input.actions.start-audio-recording.label"),tabIndex:0,onClick:this.triggerAudioRecording,children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z"}),v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&v.jsxs("svg",{className:Ba.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&v.jsxs("div",{className:Ba.audioRecorder,children:[v.jsx("button",{className:Q(Ba.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),v.jsx("div",{className:Ba.recorderIcon}),v.jsx("button",{className:Q(Ba.audioButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[v.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),v.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const m6=n=>{const r=new ArrayBuffer(44+n.length*2),i=new DataView(r);jo(i,0,"RIFF"),i.setUint32(4,44+n.length*2,!0),jo(i,8,"WAVE"),jo(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,ru,!0),i.setUint32(28,ru*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),jo(i,36,"data"),i.setUint32(40,n.length*2,!0);const s=n.length;let u=44;const c=1;for(let h=0;h<s;h++)i.setInt16(u,n[h]*(32767*c),!0),u+=2;return new Blob([i],{type:"audio/wav"})},jo=(n,r,i)=>{for(let s=0;s<i.length;s++)n.setUint8(r+s,i.charCodeAt(s))},p6=(n,r)=>{const i=new Float32Array(r);let s=0;const u=n.length;for(let c=0;c<u;c++){const h=n[c];i.set(h,s),s+=h.length}return i},g6=(n,r)=>{if(ru===r)return n;const i=r/ru,s=Math.round(n.length/i),u=new Float32Array(s);let c=0,h=0;for(;c<u.length;){const d=Math.round((c+1)*i);let m=0,g=0;for(let y=h;y<d&&y<n.length;y++)m+=n[y],g++;u[c]=m/g,c++,h=d}return u},y6=({disabled:n,textInput:r,commandsVisible:i,hasCommands:s,onTextInput:u,onTextInputSubmit:c,onAudioRecorded:h})=>{const d=tt(),m=H.useRef(null),{enableSpeechSupport:g}=Zt(N=>N.settings);H.useEffect(()=>{m.current?.focus()},[r]);const y=()=>{const N=m.current;N&&r.trim().length>=1&&c(r.trim())&&(N.value="",N.style.height="",N.focus())},_=N=>{N.preventDefault(),y()},T=N=>{const V=N.target.value;u(V),N.target.style.height="";const{scrollHeight:G}=N.target;N.target.style.height=`${G>150?150:G}px`},L=N=>{N.code==="Enter"&&!N.shiftKey?(N.repeat||y(),N.preventDefault()):i&&(N.code==="ArrowUp"||N.code==="ArrowDown")&&N.preventDefault()};return v.jsxs("form",{className:Q(xi.inputWrapper,i&&xi.withOpenCommands,"chat__textInput"),onSubmit:_,children:[v.jsx("div",{className:xi.messageInputWrapper,children:v.jsx("textarea",{id:"user_input",ref:m,className:xi.messageInput,tabIndex:0,placeholder:d("message-input-placeholder"),value:r,onChange:T,onKeyDown:L,"aria-label":d("message-input-label"),"aria-controls":s?"command-list":void 0,"aria-haspopup":s?"listbox":void 0})}),v.jsx("div",{className:Q(xi.buttons,"chat__buttons"),children:r.length||!g||navigator.mediaDevices===void 0?v.jsx("button",{className:Q(xi.button,"chat__button"),type:"submit","aria-label":d("message-input.actions.submit.label"),"data-title":d("message-input.actions.submit.label"),tabIndex:0,disabled:n,children:v.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:v.jsx("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})})}):g&&navigator.mediaDevices!==void 0&&v.jsx(d6,{translate:d,onAudioRecorded:h})})]})},v6="_quickReplies_83npe_1",b6="_quickReply_83npe_9",Mv={quickReplies:v6,quickReply:b6},_6=({quickReplies:n,onQuickReplyClick:r})=>n.length?v.jsx("div",{className:Q(Mv.quickReplies,"chat__quickReplies"),children:n.map(i=>v.jsx(gu,{tabIndex:0,className:Q(Mv.quickReply,"chat__button","chat__quickReply"),onClick:()=>r(i),children:i.label},i.label))}):null,Dv=5e3,E6=1e3,S6=({isBotTyping:n,quickReplies:r,conversationRating:i,numberOfMessagesFromGuest:s,showRatingOverlay:u,commands:c,setShowRatingOverlay:h,onTextInput:d,onRate:m,onQuickReplyClick:g,onAudioRecorded:y})=>{const[_,T]=H.useState(""),[L,N]=H.useState(!1),[V,G]=H.useState(!1),E=H.useRef(0),w=H.useRef(0);H.useEffect(()=>{if(L&&!n){const x=E.current?Date.now()-E.current:0;x>Dv?N(!1):setTimeout(()=>{N(!1)},Dv-x)}},[L,n]),H.useEffect(()=>{L&&(E.current=Date.now())},[L]);const S=x=>{const Z=Date.now()-w.current<E6;return V?!1:n||Z?(N(!0),!1):(d(x),T(""),w.current=Date.now(),!0)},I=x=>{T(x+" ")};return v.jsxs("div",{className:Q(TC.inputContainer),children:[v.jsx(_6,{quickReplies:r,onQuickReplyClick:g}),v.jsx(OC,{visible:L}),!L&&v.jsx(n6,{conversationRating:i,numberOfMessagesFromGuest:s,onRate:m,showRatingOverlay:u,setShowRatingOverlay:h}),!!c?.length&&v.jsx(BC,{text:_,commands:c,onSelectCommand:I,onVisibilityChange:G}),v.jsx(y6,{textInput:_,disabled:L,commandsVisible:V,hasCommands:!!c?.length,onTextInput:T,onTextInputSubmit:S,onAudioRecorded:y}),!!c?.length&&v.jsx(UC,{commands:c,onSelectCommand:T})]})},T6=({clientName:n,messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u,conversationRating:c,onMessageFromUser:h,onRate:d,onQuickReplyClick:m,onButtonClick:g,onLinkClick:y,onAudioRecorded:_,onTranscriptExport:T,onTranscriptItemReaction:L})=>{const N=ka(),V=Zt($=>$.connection.connectionState),{enableTranscriptExportEmail:G,commands:E}=Zt($=>$.settings),{showTranscriptMailOverlay:w}=Zt($=>$.chat),[S,I]=H.useState(!1),x=r.filter($=>$.sender.type===tu.GUEST).length;H.useEffect(()=>{if(V===ja.CONNECTED){const $=lu.parse(window.location.search);N(Cb(n,$))}},[n,V,N]);const Z=()=>{N(wb())};return v.jsxs("div",{className:ah.container,children:[v.jsxs("div",{className:Q([ah.chatcontent,(w||S)&&ah.accessabilityHidden]),children:[v.jsx(tC,{messages:r,isBotTyping:s,commands:E,onButtonClick:g,onLinkClick:y,onTranscriptItemReaction:L}),v.jsx(S6,{isBotTyping:s,quickReplies:s?[]:i,numberOfMessagesFromGuest:x,conversationRating:c,showRatingOverlay:S,setShowRatingOverlay:I,commands:E,onRate:d,onQuickReplyClick:m,onTextInput:h,onAudioRecorded:_}),v.jsx(hC,{})]}),G&&v.jsx(EC,{visible:!!w,onEmailExport:T,onClose:Z}),v.jsx(oC,{contentUrl:u})]})},A6=n=>{const{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u,conversationRating:c}=n.chat;return{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:u,conversationRating:c}},x6=n=>({onRestartChat:(r,i)=>n(mu(r,i)),onMessageFromUser:r=>n(ib(r)),onRate:(r,i)=>n(_x(r,i)),onAudioRecorded:r=>n(px(r)),onActionFromUser:r=>n(r),onQuickReplyClick:r=>n(ab(r)),onNluEvent:r=>n(cb(r)),onButtonClick:r=>n(Sx(r)),onLinkClick:r=>n(fb(r)),onTranscriptExport:r=>n(yx(r)),onTranscriptItemReaction:(r,i)=>n(Oe.Actions.transcriptItemGuestReaction(r,i||null))}),O6=H2(A6,x6)(T6),Zb=()=>{const[n,r]=H.useState(!1);return H.useEffect(()=>{r((()=>{try{return window.self!==window.top}catch{return!0}})())},[]),n},R6=n=>r=>{const i=r.key;(i==="ArrowDown"||i==="ArrowRight"||i==="Enter"||i===" "||i==="Space")&&(r.stopPropagation(),n())},w6=({onClick:n})=>{const r=tt();return Zb()?v.jsx("button",{className:"tooltip--bottom-left","aria-label":r("header.close-chat"),"data-title":r("header.close-chat"),tabIndex:0,onClick:n,onKeyDown:R6(n),children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"})})}):null},C6="_header_3gvbz_1",N6="_logoContainer_3gvbz_14",M6="_logo_3gvbz_14",D6="_actions_3gvbz_28",B6="_active_3gvbz_43",L6="_menuContainer_3gvbz_56",U6="_menu_3gvbz_56",H6="_divider_3gvbz_86",ia={header:C6,logoContainer:N6,logo:M6,actions:D6,active:B6,menuContainer:L6,menu:U6,divider:H6},j6=({icon:n})=>{switch(n){case"arrow-counter-clockwise":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"})});case"download":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"})});case"expand":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"})});case"mail":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"})});case"phone":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M144.27,45.93a8,8,0,0,1,9.8-5.66,86.22,86.22,0,0,1,61.66,61.66,8,8,0,0,1-5.66,9.8A8.23,8.23,0,0,1,208,112a8,8,0,0,1-7.73-5.94,70.35,70.35,0,0,0-50.33-50.33A8,8,0,0,1,144.27,45.93Zm-2.33,41.8c13.79,3.68,22.65,12.54,26.33,26.33A8,8,0,0,0,176,120a8.23,8.23,0,0,0,2.07-.27,8,8,0,0,0,5.66-9.8c-5.12-19.16-18.5-32.54-37.66-37.66a8,8,0,1,0-4.13,15.46Zm81.94,95.35A56.26,56.26,0,0,1,168,232C88.6,232,24,167.4,24,88A56.26,56.26,0,0,1,72.92,32.12a16,16,0,0,1,16.62,9.52l21.12,47.15,0,.12A16,16,0,0,1,109.39,104c-.18.27-.37.52-.57.77L88,129.45c7.49,15.22,23.41,31,38.83,38.51l24.34-20.71a8.12,8.12,0,0,1,.75-.56,16,16,0,0,1,15.17-1.4l.13.06,47.11,21.11A16,16,0,0,1,223.88,183.08Zm-15.88-2s-.07,0-.11,0h0l-47-21.05-24.35,20.71a8.44,8.44,0,0,1-.74.56,16,16,0,0,1-15.75,1.14c-18.73-9.05-37.4-27.58-46.46-46.11a16,16,0,0,1,1-15.7,6.13,6.13,0,0,1,.57-.77L96,95.15l-21-47a.61.61,0,0,1,0-.12A40.2,40.2,0,0,0,40,88,128.14,128.14,0,0,0,168,216,40.21,40.21,0,0,0,208,181.07Z"})});case"scroll":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M96,104a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H104A8,8,0,0,1,96,104Zm8,40h64a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16Zm128,48a32,32,0,0,1-32,32H88a32,32,0,0,1-32-32V64a16,16,0,0,0-32,0c0,5.74,4.83,9.62,4.88,9.66h0A8,8,0,0,1,24,88a7.89,7.89,0,0,1-4.79-1.61h0C18.05,85.54,8,77.61,8,64A32,32,0,0,1,40,32H176a32,32,0,0,1,32,32V168h8a8,8,0,0,1,4.8,1.6C222,170.46,232,178.39,232,192ZM96.26,173.48A8.07,8.07,0,0,1,104,168h88V64a16,16,0,0,0-16-16H67.69A31.71,31.71,0,0,1,72,64V192a16,16,0,0,0,32,0c0-5.74-4.83-9.62-4.88-9.66A7.82,7.82,0,0,1,96.26,173.48ZM216,192a12.58,12.58,0,0,0-3.23-8h-94a26.92,26.92,0,0,1,1.21,8,31.82,31.82,0,0,1-4.29,16H200A16,16,0,0,0,216,192Z"})});case"link":return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"})});default:return v.jsx("div",{})}},I6=H.forwardRef(({selected:n,item:r,onClick:i},s)=>{const u=tt(),c=h=>{h.preventDefault(),i()};return v.jsx("li",{"aria-selected":n,role:"option",className:r.withDivider?ia.divider:void 0,children:v.jsxs("a",{ref:s,type:"button",role:"button",tabIndex:-1,onClick:c,children:[v.jsx(j6,{icon:r.icon}),v.jsx("span",{children:u(`header.menu.${r.id}`)})]})})}),z6=n=>{const r=Zb(),{menuItems:i,enableStandaloneView:s,enableTranscriptExportPdf:u,enableTranscriptExportEmail:c}=Zt(d=>d.settings);return H.useMemo(()=>{const d=[];if(n&&(d.push({id:"restart-chat",type:"restart-chat",icon:"arrow-counter-clockwise",visibility:"chat-only"}),r&&s&&d.push({id:"expand-chat-window",type:"expand-chat-window",icon:"expand",visibility:"always"}),u&&d.push({id:"download-transcript",type:"download-transcript",icon:"download",visibility:"chat-only"}),c&&d.push({id:"send-transcript",type:"send-transcript",icon:"mail",visibility:"chat-only"}),d.length>1)){const m=d.pop();m&&i.length&&d.push({...m,withDivider:!0})}return d.push(...i),d.filter(({visibility:m})=>n?m==="always"||m==="chat-only":m==="always"||m==="start-screen-only")},[n,u,c,s,r,i])},G6=({chatStarted:n})=>{const r=ka(),i=Vd(),s=tt(),[u,c]=H.useState(!1),[h,d]=H.useState(-1),m=H.useRef(null),g=H.useRef(null),y=H.useRef([]),_=z6(n);H.useEffect(()=>{y.current[h]?.focus()},[h]);const T=H.useCallback(()=>{const G=lu.parse(window.location.search);r(mu(i,G)),c(!1),d(0)},[r,i]),L=H.useCallback(G=>{switch(G.type){case"restart-chat":T();break;case"expand-chat-window":window.open(window.location.href,"_blank");break;case"download-transcript":r(vx());break;case"send-transcript":r(wb());break;case"link":r(fb(G.url));break;case"action":r(JSON.parse(JSON.stringify(G.action)));break}c(!1)},[r,T,c]);H.useEffect(()=>{const G=E=>{if(u)switch(E.key){case"Enter":E.preventDefault(),L(_[h]);break;case"ArrowUp":d(w=>w>0?w-1:_.length-1);break;case"ArrowDown":d(w=>w<_.length-1?w+1:0);break;case"Escape":c(!1);break;case"Tab":h>-1&&c(!1);break}};return document.addEventListener("keydown",G),()=>{document.removeEventListener("keydown",G)}},[u,h,_,d,c,L]),H.useEffect(()=>{u||d(-1)},[u,h]),Yb(g,()=>c(!1));const N=()=>{c(G=>!G)},V=()=>{setTimeout(()=>{const G=document.activeElement;g.current&&!g.current.contains(G)&&c(!1)},0)};return _.length?v.jsxs("div",{className:Q(ia.menuContainer),ref:g,children:[v.jsx("button",{ref:m,className:Q(u&&ia.active,u?"tooltip-hidden":"tooltip--bottom-left"),"aria-label":s("header.menu.title"),"data-title":s("header.menu.title"),onClick:N,onBlur:V,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"})})}),u&&v.jsx("nav",{className:ia.menu,"aria-label":s("header.menu.title"),children:v.jsx("ul",{tabIndex:0,children:_.map((G,E)=>v.jsx(I6,{ref:w=>{y.current[E]=w},selected:h===E,item:G,onClick:()=>L(G)},G.id))})})]}):null},Bv=({className:n,chatStarted:r,...i})=>{const s=ka(),u=()=>{s(dO())};return v.jsxs("div",{className:Q([ia.header,n]),...i,children:[v.jsx("div",{className:ia.logoContainer,children:v.jsx("div",{className:ia.logo})}),v.jsxs("div",{className:ia.actions,children:[v.jsx(G6,{chatStarted:r}),v.jsx(w6,{onClick:u})]})]})},k6="_chatwindow_rkbir_1",q6="_chatwindowWithAside_rkbir_21",Lv={chatwindow:k6,chatwindowWithAside:q6},Qb=()=>{const[n,r]=H.useState(!1);return H.useEffect(()=>{const i=window.matchMedia("(max-width: 1023px)"),s=()=>r(i.matches);return s(),i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[]),n},F6="_sourceInfos_vei0l_1",P6="_waitForLoading_vei0l_24",V6="_loadingContent_vei0l_28",Y6="_sourceHeader_vei0l_37",X6="_sourceHeaderIcon_vei0l_57",Z6="_sourceContent_vei0l_61",Q6="_openSourceButton_vei0l_69",K6="_sourceButtonLabel_vei0l_79",$6="_closeSourceInfosButton_vei0l_101",W6="_loadingSourceInfos_vei0l_125",J6="_loading_vei0l_28",eN="_loadingError_vei0l_139",tN="_highlightLoadingInfo_vei0l_155",nN="_highlightLoadingInfoInnerContainer_vei0l_169",rN="_highlightLoadingInfoContent_vei0l_178",aN="_highlightLoadingInfoCloseIcon_vei0l_198",iN="_highlightLoader_vei0l_203",sN="_highlightLoaderLoading_vei0l_210",vt={sourceInfos:F6,waitForLoading:P6,loadingContent:V6,sourceHeader:Y6,sourceHeaderIcon:X6,sourceContent:Z6,openSourceButton:Q6,sourceButtonLabel:K6,closeSourceInfosButton:$6,loadingSourceInfos:W6,loading:J6,loadingError:eN,highlightLoadingInfo:tN,highlightLoadingInfoInnerContainer:nN,highlightLoadingInfoContent:rN,highlightLoadingInfoCloseIcon:aN,highlightLoader:iN,highlightLoaderLoading:sN},lN=({onClick:n})=>{const r=tt();return v.jsx("button",{className:Q(vt.closeSourceInfosButton,"tooltip--bottom-left"),"aria-label":r("source-infos.close"),"data-title":r("source-infos.close"),tabIndex:0,onClick:n,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})})},oN=H.forwardRef(({sourceInfos:n,onClose:r,...i},s)=>v.jsxs("div",{className:vt.sourceHeader,...i,ref:s,children:[v.jsx("div",{children:n?v.jsx("p",{id:"source-info-title",children:n.title}):v.jsx("p",{children:" "})}),v.jsx(lN,{onClick:r})]})),uN=({loading:n})=>v.jsx("div",{className:vt.highlightLoader,children:n&&v.jsx("div",{className:vt.highlightLoaderLoading})});/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:Kb,setPrototypeOf:Uv,isFrozen:cN,getPrototypeOf:fN,getOwnPropertyDescriptor:hN}=Object;let{freeze:It,seal:Sn,create:$b}=Object,{apply:id,construct:sd}=typeof Reflect<"u"&&Reflect;It||(It=function(r){return r});Sn||(Sn=function(r){return r});id||(id=function(r,i,s){return r.apply(i,s)});sd||(sd=function(r,i){return new r(...i)});const Io=zt(Array.prototype.forEach),dN=zt(Array.prototype.lastIndexOf),Hv=zt(Array.prototype.pop),ks=zt(Array.prototype.push),mN=zt(Array.prototype.splice),Po=zt(String.prototype.toLowerCase),dh=zt(String.prototype.toString),jv=zt(String.prototype.match),qs=zt(String.prototype.replace),pN=zt(String.prototype.indexOf),gN=zt(String.prototype.trim),Hn=zt(Object.prototype.hasOwnProperty),Ut=zt(RegExp.prototype.test),Fs=yN(TypeError);function zt(n){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var i=arguments.length,s=new Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];return id(n,r,s)}}function yN(n){return function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return sd(n,i)}}function xe(n,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Po;Uv&&Uv(n,null);let s=r.length;for(;s--;){let u=r[s];if(typeof u=="string"){const c=i(u);c!==u&&(cN(r)||(r[s]=c),u=c)}n[u]=!0}return n}function vN(n){for(let r=0;r<n.length;r++)Hn(n,r)||(n[r]=null);return n}function Sr(n){const r=$b(null);for(const[i,s]of Kb(n))Hn(n,i)&&(Array.isArray(s)?r[i]=vN(s):s&&typeof s=="object"&&s.constructor===Object?r[i]=Sr(s):r[i]=s);return r}function Ps(n,r){for(;n!==null;){const s=hN(n,r);if(s){if(s.get)return zt(s.get);if(typeof s.value=="function")return zt(s.value)}n=fN(n)}function i(){return null}return i}const Iv=It(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),mh=It(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ph=It(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),bN=It(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),gh=It(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),_N=It(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),zv=It(["#text"]),Gv=It(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),yh=It(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),kv=It(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),zo=It(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),EN=Sn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),SN=Sn(/<%[\w\W]*|[\w\W]*%>/gm),TN=Sn(/\$\{[\w\W]*/gm),AN=Sn(/^data-[\-\w.\u00B7-\uFFFF]+$/),xN=Sn(/^aria-[\-\w]+$/),Wb=Sn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ON=Sn(/^(?:\w+script|data):/i),RN=Sn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Jb=Sn(/^html$/i),wN=Sn(/^[a-z][.\w]*(-[.\w]+)+$/i);var qv=Object.freeze({__proto__:null,ARIA_ATTR:xN,ATTR_WHITESPACE:RN,CUSTOM_ELEMENT:wN,DATA_ATTR:AN,DOCTYPE_NAME:Jb,ERB_EXPR:SN,IS_ALLOWED_URI:Wb,IS_SCRIPT_OR_DATA:ON,MUSTACHE_EXPR:EN,TMPLIT_EXPR:TN});const Vs={element:1,text:3,progressingInstruction:7,comment:8,document:9},CN=function(){return typeof window>"u"?null:window},NN=function(r,i){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let s=null;const u="data-tt-policy-suffix";i&&i.hasAttribute(u)&&(s=i.getAttribute(u));const c="dompurify"+(s?"#"+s:"");try{return r.createPolicy(c,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Fv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function e_(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:CN();const r=le=>e_(le);if(r.version="3.2.6",r.removed=[],!n||!n.document||n.document.nodeType!==Vs.document||!n.Element)return r.isSupported=!1,r;let{document:i}=n;const s=i,u=s.currentScript,{DocumentFragment:c,HTMLTemplateElement:h,Node:d,Element:m,NodeFilter:g,NamedNodeMap:y=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:_,DOMParser:T,trustedTypes:L}=n,N=m.prototype,V=Ps(N,"cloneNode"),G=Ps(N,"remove"),E=Ps(N,"nextSibling"),w=Ps(N,"childNodes"),S=Ps(N,"parentNode");if(typeof h=="function"){const le=i.createElement("template");le.content&&le.content.ownerDocument&&(i=le.content.ownerDocument)}let I,x="";const{implementation:Z,createNodeIterator:$,createDocumentFragment:ie,getElementsByTagName:_e}=i,{importNode:Re}=s;let se=Fv();r.isSupported=typeof Kb=="function"&&typeof S=="function"&&Z&&Z.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:me,ERB_EXPR:ce,TMPLIT_EXPR:Ve,DATA_ATTR:ve,ARIA_ATTR:z,IS_SCRIPT_OR_DATA:K,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:Se}=qv;let{IS_ALLOWED_URI:O}=qv,k=null;const W=xe({},[...Iv,...mh,...ph,...gh,...zv]);let Y=null;const te=xe({},[...Gv,...yh,...kv,...zo]);let re=Object.seal($b(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ue=null,$e=null,Ue=!0,bt=!0,zn=!1,Cr=!0,Ze=!1,Gt=!0,xn=!1,Mi=!1,Di=!1,_t=!1,qa=!1,oa=!1,Bi=!0,ua=!1;const bu="user-content-";let Fa=!0,ca=!1,Nr={},fn=null;const wt=xe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let On=null;const Ct=xe({},["audio","video","img","source","image","track"]);let Li=null;const al=xe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pa="http://www.w3.org/1998/Math/MathML",tr="http://www.w3.org/2000/svg",kt="http://www.w3.org/1999/xhtml";let qt=kt,Mr=!1,nr=null;const _u=xe({},[Pa,tr,kt],dh);let fa=xe({},["mi","mo","mn","ms","mtext"]),ha=xe({},["annotation-xml"]);const Ui=xe({},["title","style","font","a","script"]);let Rn=null;const Eu=["application/xhtml+xml","text/html"],il="text/html";let nt=null,Gn=null;const Hi=i.createElement("form"),ji=function(C){return C instanceof RegExp||C instanceof Function},Ii=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Gn&&Gn===C)){if((!C||typeof C!="object")&&(C={}),C=Sr(C),Rn=Eu.indexOf(C.PARSER_MEDIA_TYPE)===-1?il:C.PARSER_MEDIA_TYPE,nt=Rn==="application/xhtml+xml"?dh:Po,k=Hn(C,"ALLOWED_TAGS")?xe({},C.ALLOWED_TAGS,nt):W,Y=Hn(C,"ALLOWED_ATTR")?xe({},C.ALLOWED_ATTR,nt):te,nr=Hn(C,"ALLOWED_NAMESPACES")?xe({},C.ALLOWED_NAMESPACES,dh):_u,Li=Hn(C,"ADD_URI_SAFE_ATTR")?xe(Sr(al),C.ADD_URI_SAFE_ATTR,nt):al,On=Hn(C,"ADD_DATA_URI_TAGS")?xe(Sr(Ct),C.ADD_DATA_URI_TAGS,nt):Ct,fn=Hn(C,"FORBID_CONTENTS")?xe({},C.FORBID_CONTENTS,nt):wt,ue=Hn(C,"FORBID_TAGS")?xe({},C.FORBID_TAGS,nt):Sr({}),$e=Hn(C,"FORBID_ATTR")?xe({},C.FORBID_ATTR,nt):Sr({}),Nr=Hn(C,"USE_PROFILES")?C.USE_PROFILES:!1,Ue=C.ALLOW_ARIA_ATTR!==!1,bt=C.ALLOW_DATA_ATTR!==!1,zn=C.ALLOW_UNKNOWN_PROTOCOLS||!1,Cr=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ze=C.SAFE_FOR_TEMPLATES||!1,Gt=C.SAFE_FOR_XML!==!1,xn=C.WHOLE_DOCUMENT||!1,_t=C.RETURN_DOM||!1,qa=C.RETURN_DOM_FRAGMENT||!1,oa=C.RETURN_TRUSTED_TYPE||!1,Di=C.FORCE_BODY||!1,Bi=C.SANITIZE_DOM!==!1,ua=C.SANITIZE_NAMED_PROPS||!1,Fa=C.KEEP_CONTENT!==!1,ca=C.IN_PLACE||!1,O=C.ALLOWED_URI_REGEXP||Wb,qt=C.NAMESPACE||kt,fa=C.MATHML_TEXT_INTEGRATION_POINTS||fa,ha=C.HTML_INTEGRATION_POINTS||ha,re=C.CUSTOM_ELEMENT_HANDLING||{},C.CUSTOM_ELEMENT_HANDLING&&ji(C.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(re.tagNameCheck=C.CUSTOM_ELEMENT_HANDLING.tagNameCheck),C.CUSTOM_ELEMENT_HANDLING&&ji(C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(re.attributeNameCheck=C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),C.CUSTOM_ELEMENT_HANDLING&&typeof C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(re.allowCustomizedBuiltInElements=C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ze&&(bt=!1),qa&&(_t=!0),Nr&&(k=xe({},zv),Y=[],Nr.html===!0&&(xe(k,Iv),xe(Y,Gv)),Nr.svg===!0&&(xe(k,mh),xe(Y,yh),xe(Y,zo)),Nr.svgFilters===!0&&(xe(k,ph),xe(Y,yh),xe(Y,zo)),Nr.mathMl===!0&&(xe(k,gh),xe(Y,kv),xe(Y,zo))),C.ADD_TAGS&&(k===W&&(k=Sr(k)),xe(k,C.ADD_TAGS,nt)),C.ADD_ATTR&&(Y===te&&(Y=Sr(Y)),xe(Y,C.ADD_ATTR,nt)),C.ADD_URI_SAFE_ATTR&&xe(Li,C.ADD_URI_SAFE_ATTR,nt),C.FORBID_CONTENTS&&(fn===wt&&(fn=Sr(fn)),xe(fn,C.FORBID_CONTENTS,nt)),Fa&&(k["#text"]=!0),xn&&xe(k,["html","head","body"]),k.table&&(xe(k,["tbody"]),delete ue.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw Fs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Fs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');I=C.TRUSTED_TYPES_POLICY,x=I.createHTML("")}else I===void 0&&(I=NN(L,u)),I!==null&&typeof x=="string"&&(x=I.createHTML(""));It&&It(C),Gn=C}},wn=xe({},[...mh,...ph,...bN]),ft=xe({},[...gh,..._N]),Nt=function(C){let X=S(C);(!X||!X.tagName)&&(X={namespaceURI:qt,tagName:"template"});const J=Po(C.tagName),Fe=Po(X.tagName);return nr[C.namespaceURI]?C.namespaceURI===tr?X.namespaceURI===kt?J==="svg":X.namespaceURI===Pa?J==="svg"&&(Fe==="annotation-xml"||fa[Fe]):!!wn[J]:C.namespaceURI===Pa?X.namespaceURI===kt?J==="math":X.namespaceURI===tr?J==="math"&&ha[Fe]:!!ft[J]:C.namespaceURI===kt?X.namespaceURI===tr&&!ha[Fe]||X.namespaceURI===Pa&&!fa[Fe]?!1:!ft[J]&&(Ui[J]||!wn[J]):!!(Rn==="application/xhtml+xml"&&nr[C.namespaceURI]):!1},Et=function(C){ks(r.removed,{element:C});try{S(C).removeChild(C)}catch{G(C)}},kn=function(C,X){try{ks(r.removed,{attribute:X.getAttributeNode(C),from:X})}catch{ks(r.removed,{attribute:null,from:X})}if(X.removeAttribute(C),C==="is")if(_t||qa)try{Et(X)}catch{}else try{X.setAttribute(C,"")}catch{}},sl=function(C){let X=null,J=null;if(Di)C="<remove></remove>"+C;else{const We=jv(C,/^[\r\n\t ]+/);J=We&&We[0]}Rn==="application/xhtml+xml"&&qt===kt&&(C='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+C+"</body></html>");const Fe=I?I.createHTML(C):C;if(qt===kt)try{X=new T().parseFromString(Fe,Rn)}catch{}if(!X||!X.documentElement){X=Z.createDocument(qt,"template",null);try{X.documentElement.innerHTML=Mr?x:Fe}catch{}}const ht=X.body||X.documentElement;return C&&J&&ht.insertBefore(i.createTextNode(J),ht.childNodes[0]||null),qt===kt?_e.call(X,xn?"html":"body")[0]:xn?X.documentElement:ht},ll=function(C){return $.call(C.ownerDocument||C,C,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Va=function(C){return C instanceof _&&(typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||!(C.attributes instanceof y)||typeof C.removeAttribute!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function")},Dr=function(C){return typeof d=="function"&&C instanceof d};function Qt(le,C,X){Io(le,J=>{J.call(r,C,X,Gn)})}const rr=function(C){let X=null;if(Qt(se.beforeSanitizeElements,C,null),Va(C))return Et(C),!0;const J=nt(C.nodeName);if(Qt(se.uponSanitizeElement,C,{tagName:J,allowedTags:k}),Gt&&C.hasChildNodes()&&!Dr(C.firstElementChild)&&Ut(/<[/\w!]/g,C.innerHTML)&&Ut(/<[/\w!]/g,C.textContent)||C.nodeType===Vs.progressingInstruction||Gt&&C.nodeType===Vs.comment&&Ut(/<[/\w]/g,C.data))return Et(C),!0;if(!k[J]||ue[J]){if(!ue[J]&&Br(J)&&(re.tagNameCheck instanceof RegExp&&Ut(re.tagNameCheck,J)||re.tagNameCheck instanceof Function&&re.tagNameCheck(J)))return!1;if(Fa&&!fn[J]){const Fe=S(C)||C.parentNode,ht=w(C)||C.childNodes;if(ht&&Fe){const We=ht.length;for(let Mt=We-1;Mt>=0;--Mt){const Ft=V(ht[Mt],!0);Ft.__removalCount=(C.__removalCount||0)+1,Fe.insertBefore(Ft,E(C))}}}return Et(C),!0}return C instanceof m&&!Nt(C)||(J==="noscript"||J==="noembed"||J==="noframes")&&Ut(/<\/no(script|embed|frames)/i,C.innerHTML)?(Et(C),!0):(Ze&&C.nodeType===Vs.text&&(X=C.textContent,Io([me,ce,Ve],Fe=>{X=qs(X,Fe," ")}),C.textContent!==X&&(ks(r.removed,{element:C.cloneNode()}),C.textContent=X)),Qt(se.afterSanitizeElements,C,null),!1)},ar=function(C,X,J){if(Bi&&(X==="id"||X==="name")&&(J in i||J in Hi))return!1;if(!(bt&&!$e[X]&&Ut(ve,X))){if(!(Ue&&Ut(z,X))){if(!Y[X]||$e[X]){if(!(Br(C)&&(re.tagNameCheck instanceof RegExp&&Ut(re.tagNameCheck,C)||re.tagNameCheck instanceof Function&&re.tagNameCheck(C))&&(re.attributeNameCheck instanceof RegExp&&Ut(re.attributeNameCheck,X)||re.attributeNameCheck instanceof Function&&re.attributeNameCheck(X))||X==="is"&&re.allowCustomizedBuiltInElements&&(re.tagNameCheck instanceof RegExp&&Ut(re.tagNameCheck,J)||re.tagNameCheck instanceof Function&&re.tagNameCheck(J))))return!1}else if(!Li[X]){if(!Ut(O,qs(J,ee,""))){if(!((X==="src"||X==="xlink:href"||X==="href")&&C!=="script"&&pN(J,"data:")===0&&On[C])){if(!(zn&&!Ut(K,qs(J,ee,"")))){if(J)return!1}}}}}}return!0},Br=function(C){return C!=="annotation-xml"&&jv(C,Se)},ir=function(C){Qt(se.beforeSanitizeAttributes,C,null);const{attributes:X}=C;if(!X||Va(C))return;const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let Fe=X.length;for(;Fe--;){const ht=X[Fe],{name:We,namespaceURI:Mt,value:Ft}=ht,qn=nt(We),Kt=Ft;let st=We==="value"?Kt:gN(Kt);if(J.attrName=qn,J.attrValue=st,J.keepAttr=!0,J.forceKeepAttr=void 0,Qt(se.uponSanitizeAttribute,C,J),st=J.attrValue,ua&&(qn==="id"||qn==="name")&&(kn(We,C),st=bu+st),Gt&&Ut(/((--!?|])>)|<\/(style|title)/i,st)){kn(We,C);continue}if(J.forceKeepAttr)continue;if(!J.keepAttr){kn(We,C);continue}if(!Cr&&Ut(/\/>/i,st)){kn(We,C);continue}Ze&&Io([me,ce,Ve],sr=>{st=qs(st,sr," ")});const zi=nt(C.nodeName);if(!ar(zi,qn,st)){kn(We,C);continue}if(I&&typeof L=="object"&&typeof L.getAttributeType=="function"&&!Mt)switch(L.getAttributeType(zi,qn)){case"TrustedHTML":{st=I.createHTML(st);break}case"TrustedScriptURL":{st=I.createScriptURL(st);break}}if(st!==Kt)try{Mt?C.setAttributeNS(Mt,We,st):C.setAttribute(We,st),Va(C)?Et(C):Hv(r.removed)}catch{kn(We,C)}}Qt(se.afterSanitizeAttributes,C,null)},it=function le(C){let X=null;const J=ll(C);for(Qt(se.beforeSanitizeShadowDOM,C,null);X=J.nextNode();)Qt(se.uponSanitizeShadowNode,X,null),rr(X),ir(X),X.content instanceof c&&le(X.content);Qt(se.afterSanitizeShadowDOM,C,null)};return r.sanitize=function(le){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=null,J=null,Fe=null,ht=null;if(Mr=!le,Mr&&(le="<!-->"),typeof le!="string"&&!Dr(le))if(typeof le.toString=="function"){if(le=le.toString(),typeof le!="string")throw Fs("dirty is not a string, aborting")}else throw Fs("toString is not a function");if(!r.isSupported)return le;if(Mi||Ii(C),r.removed=[],typeof le=="string"&&(ca=!1),ca){if(le.nodeName){const Ft=nt(le.nodeName);if(!k[Ft]||ue[Ft])throw Fs("root node is forbidden and cannot be sanitized in-place")}}else if(le instanceof d)X=sl("<!---->"),J=X.ownerDocument.importNode(le,!0),J.nodeType===Vs.element&&J.nodeName==="BODY"||J.nodeName==="HTML"?X=J:X.appendChild(J);else{if(!_t&&!Ze&&!xn&&le.indexOf("<")===-1)return I&&oa?I.createHTML(le):le;if(X=sl(le),!X)return _t?null:oa?x:""}X&&Di&&Et(X.firstChild);const We=ll(ca?le:X);for(;Fe=We.nextNode();)rr(Fe),ir(Fe),Fe.content instanceof c&&it(Fe.content);if(ca)return le;if(_t){if(qa)for(ht=ie.call(X.ownerDocument);X.firstChild;)ht.appendChild(X.firstChild);else ht=X;return(Y.shadowroot||Y.shadowrootmode)&&(ht=Re.call(s,ht,!0)),ht}let Mt=xn?X.outerHTML:X.innerHTML;return xn&&k["!doctype"]&&X.ownerDocument&&X.ownerDocument.doctype&&X.ownerDocument.doctype.name&&Ut(Jb,X.ownerDocument.doctype.name)&&(Mt="<!DOCTYPE "+X.ownerDocument.doctype.name+`>
|
|
111
111
|
`+Mt),Ze&&Io([me,ce,Ve],Ft=>{Mt=qs(Mt,Ft," ")}),I&&oa?I.createHTML(Mt):Mt},r.setConfig=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ii(le),Mi=!0},r.clearConfig=function(){Gn=null,Mi=!1},r.isValidAttribute=function(le,C,X){Gn||Ii({});const J=nt(le),Fe=nt(C);return ar(J,Fe,X)},r.addHook=function(le,C){typeof C=="function"&&ks(se[le],C)},r.removeHook=function(le,C){if(C!==void 0){const X=dN(se[le],C);return X===-1?void 0:mN(se[le],X,1)[0]}return Hv(se[le])},r.removeHooks=function(le){se[le]=[]},r.removeAllHooks=function(){se=Fv()},r}var MN=e_();const DN=({onClose:n})=>{const r=tt();return v.jsxs("div",{className:vt.highlightLoadingInfo,onClick:n,children:[v.jsx("div",{className:vt.highlightLoadingInfoCloseIcon,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})}),v.jsxs("div",{className:vt.highlightLoadingInfoInnerContainer,children:[v.jsxs("div",{className:vt.highlightLoadingInfoContent,children:[v.jsx("h3",{children:r("source-infos.highlight-loading.title")}),v.jsx("p",{children:r("source-infos.highlight-loading.description")})]}),v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#000000",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M253.66,106.34a8,8,0,0,0-11.32,0L192,156.69,107.31,72l50.35-50.34a8,8,0,1,0-11.32-11.32L96,60.69A16,16,0,0,0,93.18,79.5L72,100.69a16,16,0,0,0,0,22.62L76.69,128,18.34,186.34a8,8,0,0,0,3.13,13.25l72,24A7.88,7.88,0,0,0,96,224a8,8,0,0,0,5.66-2.34L136,187.31l4.69,4.69a16,16,0,0,0,22.62,0l21.19-21.18A16,16,0,0,0,203.31,168l50.35-50.34A8,8,0,0,0,253.66,106.34ZM93.84,206.85l-55-18.35L88,139.31,124.69,176ZM152,180.69,83.31,112,104,91.31,172.69,160Z"})})]})]})},BN=({title:n,href:r,children:i})=>v.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),LN=({className:n,children:r,...i})=>v.jsx("a",{className:Q(Js.button,Js.buttonDefault,n),type:"button",role:"button",...i,children:r}),UN=n=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:v.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),HN=({type:n,...r})=>{switch(n){case"WEBSITE":return v.jsx(qb,{...r});case"PDF":return v.jsx(kb,{...r});case"DOCX":return v.jsx(zb,{...r});case"TEXT":return v.jsx(UN,{...r});default:return v.jsx(Gb,{...r})}},jN=({url:n,knowledgeBaseType:r})=>{const i=tt();return v.jsx(LN,{className:vt.openSourceButton,href:n,target:"_blank",children:v.jsxs("div",{className:vt.sourceButtonLabel,children:[v.jsx("div",{className:vt.sourceHeaderIcon,children:v.jsx(HN,{type:r})}),v.jsx("p",{children:i("source-infos.open-source")})]})})},IN=({sourceInfos:{content:n,url:r,knowledgeBaseType:i,highlighted:s}})=>{const[u,c]=H.useState(!s);H.useEffect(()=>{s&&c(!1)},[s]);const h=MN.sanitize(n,{USE_PROFILES:{html:!0}});return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Q(vt.sourceContent,Pb.markdown),children:[v.jsx(xr,{options:{overrides:{a:BN}},children:h}),u&&v.jsx(DN,{onClose:()=>c(!1)})]}),v.jsx(jN,{url:r,knowledgeBaseType:i})]})},zN=""+new URL("undraw_fixing-bugs-D_eYxJc6.svg",import.meta.url).href,GN=()=>{const n=tt();return v.jsxs("div",{className:vt.loadingError,children:[v.jsx("h1",{children:n("source-infos.error.title")}),v.jsx("img",{src:zN,title:n("source-infos.error.title")}),v.jsx("p",{children:n("source-infos.error.info")})]})},kN=()=>v.jsx("div",{className:vt.loadingSourceInfos,children:v.jsx("svg",{className:vt.loading,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:v.jsx("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"})})});function qN({sourceInfos:n,onClose:r,threshold:i=100}){const s=H.useRef(null),[u,c]=H.useState(0),[h,d]=H.useState(!1),m=H.useRef(null),g=H.useRef(null),y=H.useCallback(N=>{m.current=N,d(!0)},[]),_=H.useCallback(N=>{if(m.current!==null&&h){const V=N-m.current;V>0&&c(V)}},[h]),T=H.useCallback(()=>{d(!1),u>i&&r(),c(0),m.current=null},[u,i,r]),L=H.useCallback(N=>{const V=x=>y(x.touches[0].clientY),G=x=>_(x.touches[0].clientY),E=()=>T(),w=x=>{x.preventDefault(),y(x.clientY),window.addEventListener("mousemove",S),window.addEventListener("mouseup",I)},S=x=>_(x.clientY),I=()=>{T(),window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",I)};N.addEventListener("touchstart",V),N.addEventListener("touchmove",G),N.addEventListener("touchend",E),N.addEventListener("mousedown",w),g.current=()=>{N.removeEventListener("touchstart",V),N.removeEventListener("touchmove",G),N.removeEventListener("touchend",E),N.removeEventListener("mousedown",w),window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",I)}},[y,_,T]);return H.useEffect(()=>{let N;return(()=>{s.current?(g.current?.(),L(s.current)):(N=new MutationObserver(()=>{s.current&&(g.current?.(),L(s.current),N?.disconnect())}),N.observe(document.body,{childList:!0,subtree:!0}))})(),()=>{N?.disconnect(),g.current?.()}},[L,n]),{ref:s,dragOffsetY:u,isDragging:h}}const FN=n=>{const[r,i]=H.useState(!0);return H.useEffect(()=>{let s=null;return n?.type==="loading"?(i(!0),s=setTimeout(()=>{i(!1)},300)):i(!n),()=>{s&&clearTimeout(s)}},[n]),r},PN=()=>{const n=ka(),r=Zt(m=>m.chat.sourceInfos),i=Qb(),s=H.useRef(null),u=FN(r);H.useEffect(()=>{s.current&&r?.type==="loading"&&(i?s.current.showModal():(s.current.setAttribute("open","true"),s.current?.focus()))},[r,i]);const c=H.useCallback(()=>{s.current&&(i?s.current.close():s.current.removeAttribute("open"),n(pO()))},[n,i]),{ref:h,dragOffsetY:d}=qN({onClose:c,sourceInfos:r});return r?v.jsx("dialog",{ref:s,className:Q(vt.sourceInfos,u?vt.waitForLoading:r.type==="loading"?vt.loadingContent:""),style:i&&d?{transform:`translateY(${d}px)`}:{},onClose:c,autoFocus:!0,role:"dialog","aria-labelledby":"source-info-title",children:u?null:v.jsxs(v.Fragment,{children:[v.jsx(oN,{ref:h,tabIndex:-1,sourceInfos:r.type==="loaded"?r:void 0,onClose:c}),r.type==="loading"?v.jsx(kN,{}):r.type==="loading-error"?v.jsx(GN,{}):v.jsxs(v.Fragment,{children:[v.jsx(uN,{loading:!r.highlighted}),v.jsx(IN,{sourceInfos:r})]})]})}):null},VN="_container_114wy_1",YN="_body_114wy_7",XN="_intro_114wy_14",ZN="_footer_114wy_39",QN="_footnote_114wy_43",KN="_containerWithFootnote_114wy_58",$N="_startChatButton_114wy_73",WN="_formFields_114wy_77",JN="_formField_114wy_77",e3="_radio_114wy_89",t3="_checkbox_114wy_96",n3="_input_114wy_104",r3="_inputLabel_114wy_138",a3="_selectWrapper_114wy_142",i3="_select_114wy_142",s3="_selectLabel_114wy_188",Rt={container:VN,body:YN,intro:XN,footer:ZN,footnote:QN,containerWithFootnote:KN,startChatButton:$N,formFields:WN,formField:JN,radio:e3,checkbox:t3,input:n3,inputLabel:r3,selectWrapper:a3,select:i3,selectLabel:s3},l3=({name:n,label:r,defaultValue:i,required:s,onChange:u})=>{const c=h=>{u(h.currentTarget.checked?"true":"false")};return v.jsxs("label",{className:Q(Rt.checkbox,"chat__startScreen__checkbox"),htmlFor:n,children:[v.jsx("input",{type:"checkbox",id:n,name:n,defaultChecked:i==="true",required:s,onChange:c}),v.jsx("div",{children:r})]})},o3=({type:n,name:r,label:i,defaultValue:s,placeholder:u,required:c,multiple:h,min:d,max:m,pattern:g,onChange:y})=>{const _=T=>{y(T.target.value)};return v.jsxs("label",{className:Q(Rt.input,"chat__startScreen__input"),htmlFor:r,children:[v.jsx("div",{className:Q(Rt.inputLabel),children:i}),v.jsx("input",{type:n,id:r,name:r,defaultValue:s,placeholder:u,required:c,multiple:h,min:d,max:m,pattern:g,onChange:_})]})},u3=({name:n,value:r,label:i,defaultChecked:s,required:u,onChange:c})=>{const h=`${n}-${r}`,d=m=>{c(m.target.value)};return v.jsxs("label",{className:Q(Rt.radio,"chat__startScreen__radio"),htmlFor:h,children:[v.jsx("input",{id:h,type:"radio",name:n,value:r,defaultChecked:s,required:u,onChange:d}),v.jsx("span",{className:Q(Rt.label),children:i})]})},c3=({name:n,label:r,defaultValue:i,required:s,multiple:u,options:c,onChange:h})=>{const d=m=>{h(m.target.value)};return v.jsxs("label",{className:Q(Rt.select,"chat__startScreen__select"),htmlFor:n,children:[v.jsx("div",{className:Q(Rt.selectLabel),children:r}),v.jsx("div",{className:Q(Rt.selectWrapper),children:v.jsx("select",{id:n,name:n,defaultValue:i,required:s,multiple:u,onChange:d,children:Object.entries(c||{}).map(([m,g])=>v.jsx("option",{value:m,selected:g===i,children:g}))})})]})},f3="start-screen.intro",h3="start-screen.start-chat",d3="start-screen.footnote",Un="start-screen.form",Pv=`${Un}.fields`,m3=()=>{const n=tt(),r=ka(),[i,s]=H.useState({}),u=()=>{const _=Object.entries(i).reduce((T,[L,N])=>({...T,[L]:N.value}),{});r(cO(_))},c=n(f3),h=n(h3),d=n(d3),m=H.useMemo(()=>n(Pv)?.split(";").map(_=>_.trim())??[],[n(Pv)]);H.useEffect(()=>{m.length&&Object.keys(i).length===0&&s(m.reduce((_,T)=>({..._,[T]:p3(T,n)}),{}))},[n,m,i]);const g=_=>{_.preventDefault(),u()},y=_=>T=>{s(L=>({...L,[_]:{...L[_],value:T}}))};return v.jsxs("form",{onSubmit:g,className:Q(Rt.container,d&&Rt.containerWithFootnote,"chat__startScreen"),children:[v.jsxs("div",{className:Q(Rt.body,"chat__startScreen__body"),children:[c&&v.jsx("div",{className:Q(Rt.intro,"chat__startScreen__intro"),children:v.jsx(xr,{options:{overrides:{a:Vv}},children:c})}),v.jsx("div",{className:Q(Rt.formFields,"chat__startScreen__fields"),children:Object.values(i).map(({type:_,name:T,label:L,placeholder:N,defaultValue:V,options:G,required:E,multiple:w,min:S,max:I,pattern:x})=>v.jsx("div",{className:Q(Rt.formField,"chat__startScreen__field"),children:(()=>{switch(_){case"radio":return v.jsxs(v.Fragment,{children:[v.jsx("div",{children:L}),Object.entries(G||{}).map(([Z,$])=>v.jsx(u3,{name:T,value:Z,label:$,defaultChecked:Z===V,required:E,onChange:y(T)},Z))]});case"checkbox":return v.jsx(l3,{name:T,label:L,defaultValue:V,required:E,onChange:y(T)});case"select":return v.jsx(c3,{name:T,label:L,defaultValue:V,required:E,multiple:w,options:G,onChange:y(T)});default:return v.jsx(o3,{type:_,name:T,label:L,placeholder:N,defaultValue:V,required:E,multiple:w,min:S,max:I,pattern:x,onChange:y(T)})}})()},T))})]}),v.jsxs("div",{className:Q(Rt.footer,"chat__startScreen__footer"),children:[v.jsx(nu,{type:"submit",className:Rt.startChatButton,children:h}),d&&v.jsx("div",{className:Rt.footnote,children:v.jsx(xr,{options:{overrides:{a:Vv}},children:d})})]})]})},Vv=({title:n,href:r,children:i})=>v.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),p3=(n,r)=>{const i=r(`${Un}.${n}.type`)||"text",s=r(`${Un}.${n}.required`)==="true",u=r(`${Un}.${n}.multiple`)==="true",c=r(`${Un}.${n}.placeholder`),h=r(`${Un}.${n}.label`)||"",d=r(`${Un}.${n}.defaultValue`),m=r(`${Un}.${n}.min`),g=r(`${Un}.${n}.max`),y=r(`${Un}.${n}.pattern`),_=y3(r(`${Un}.${n}.options`));return{name:n,label:h,placeholder:c,value:g3(i,d,_)||"",defaultValue:d,options:_,type:i,required:s,multiple:u,min:m,max:g,pattern:y}},g3=(n,r,i)=>r||n==="select"&&Object.keys(i)[0]||"",y3=(n="")=>n.split(";").map(r=>r.trim()).reduce((r,i)=>{const[s,u]=i.split(":").map(c=>c.trim());return{...r,[s]:u}},{}),v3=()=>{const n=su();H.useEffect(()=>{window.document.documentElement.lang=n.locale},[n.locale])},Oi={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"},b3=({clientName:n})=>{v3();const r=ka(),i=Zt(y=>y.intl.messages),s=tt(),u=Zt(y=>y.settings.enableStartScreen),c=Zt(y=>y.startScreen.startScreenStatus),[h,d]=H.useState(void 0);H.useEffect(()=>{const y=lu.parse(window.location.search);y.cssClassName&&d(y.cssClassName);const _=T=>{switch(T.data.type){case Oi.TRIGGER_ACTION:r(T.data.action);break;case Oi.TRIGGER_STORY:r(cb(T.data.story));break;case Oi.ON_CHAT_WINDOW_OPEN:r({type:"webclient.chatwindow.opened"});break;case Oi.ON_CHAT_WINDOW_CLOSE:r({type:"webclient.chatwindow.closed"});break;case Oi.CHAT_MESSAGE_FROM_GUEST:r(ib(T.data.text));break;case Oi.RESTART_CHAT:r(mu(n,y));break}};return r(yO(n,y)),window.addEventListener("message",T=>_(T),!1),()=>window.removeEventListener("message",_)},[n,r]),H.useEffect(()=>{const y=s("page.title");y&&document&&(document.title=y)},[i,s]);const m=u===void 0,g=u===!1||c==="HIDDEN";return v.jsx("div",{className:Q(Lv.chatwindow,g&&Lv.chatwindowWithAside,"chat__chatwindow",h),children:m?null:g?v.jsxs(v.Fragment,{children:[v.jsx("header",{children:v.jsx(Bv,{chatStarted:!0})}),v.jsx("main",{children:v.jsx(O6,{clientName:n})}),v.jsx("aside",{children:v.jsx(PN,{})})]}):v.jsxs(v.Fragment,{children:[v.jsx("header",{children:v.jsx(Bv,{chatStarted:!1})}),v.jsx("main",{children:v.jsx(m3,{})})]})})},_3=()=>{const n=Vd(),r=Qb(),i=Zt(u=>u.intl.locale),s=Zt(u=>u.intl.messages);return v.jsx(TA,{locale:i,messages:s,onError:()=>{},children:v.jsx("div",{className:Q([xA.app,r?"chat__small":"chat__large"]),children:v.jsx(b3,{clientName:n})})})};var vh,Yv;function Yd(){if(Yv)return vh;Yv=1;function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}return vh=n,vh}var bh,Xv;function E3(){if(Xv)return bh;Xv=1;var n=typeof yo=="object"&&yo&&yo.Object===Object&&yo;return bh=n,bh}var _h,Zv;function t_(){if(Zv)return _h;Zv=1;var n=E3(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();return _h=i,_h}var Eh,Qv;function S3(){if(Qv)return Eh;Qv=1;var n=t_(),r=function(){return n.Date.now()};return Eh=r,Eh}var Sh,Kv;function T3(){if(Kv)return Sh;Kv=1;var n=/\s/;function r(i){for(var s=i.length;s--&&n.test(i.charAt(s)););return s}return Sh=r,Sh}var Th,$v;function A3(){if($v)return Th;$v=1;var n=T3(),r=/^\s+/;function i(s){return s&&s.slice(0,n(s)+1).replace(r,"")}return Th=i,Th}var Ah,Wv;function n_(){if(Wv)return Ah;Wv=1;var n=t_(),r=n.Symbol;return Ah=r,Ah}var xh,Jv;function x3(){if(Jv)return xh;Jv=1;var n=n_(),r=Object.prototype,i=r.hasOwnProperty,s=r.toString,u=n?n.toStringTag:void 0;function c(h){var d=i.call(h,u),m=h[u];try{h[u]=void 0;var g=!0}catch{}var y=s.call(h);return g&&(d?h[u]=m:delete h[u]),y}return xh=c,xh}var Oh,e1;function O3(){if(e1)return Oh;e1=1;var n=Object.prototype,r=n.toString;function i(s){return r.call(s)}return Oh=i,Oh}var Rh,t1;function R3(){if(t1)return Rh;t1=1;var n=n_(),r=x3(),i=O3(),s="[object Null]",u="[object Undefined]",c=n?n.toStringTag:void 0;function h(d){return d==null?d===void 0?u:s:c&&c in Object(d)?r(d):i(d)}return Rh=h,Rh}var wh,n1;function w3(){if(n1)return wh;n1=1;function n(r){return r!=null&&typeof r=="object"}return wh=n,wh}var Ch,r1;function C3(){if(r1)return Ch;r1=1;var n=R3(),r=w3(),i="[object Symbol]";function s(u){return typeof u=="symbol"||r(u)&&n(u)==i}return Ch=s,Ch}var Nh,a1;function N3(){if(a1)return Nh;a1=1;var n=A3(),r=Yd(),i=C3(),s=NaN,u=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,h=/^0o[0-7]+$/i,d=parseInt;function m(g){if(typeof g=="number")return g;if(i(g))return s;if(r(g)){var y=typeof g.valueOf=="function"?g.valueOf():g;g=r(y)?y+"":y}if(typeof g!="string")return g===0?g:+g;g=n(g);var _=c.test(g);return _||h.test(g)?d(g.slice(2),_?2:8):u.test(g)?s:+g}return Nh=m,Nh}var Mh,i1;function M3(){if(i1)return Mh;i1=1;var n=Yd(),r=S3(),i=N3(),s="Expected a function",u=Math.max,c=Math.min;function h(d,m,g){var y,_,T,L,N,V,G=0,E=!1,w=!1,S=!0;if(typeof d!="function")throw new TypeError(s);m=i(m)||0,n(g)&&(E=!!g.leading,w="maxWait"in g,T=w?u(i(g.maxWait)||0,m):T,S="trailing"in g?!!g.trailing:S);function I(ce){var Ve=y,ve=_;return y=_=void 0,G=ce,L=d.apply(ve,Ve),L}function x(ce){return G=ce,N=setTimeout(ie,m),E?I(ce):L}function Z(ce){var Ve=ce-V,ve=ce-G,z=m-Ve;return w?c(z,T-ve):z}function $(ce){var Ve=ce-V,ve=ce-G;return V===void 0||Ve>=m||Ve<0||w&&ve>=T}function ie(){var ce=r();if($(ce))return _e(ce);N=setTimeout(ie,Z(ce))}function _e(ce){return N=void 0,S&&y?I(ce):(y=_=void 0,L)}function Re(){N!==void 0&&clearTimeout(N),G=0,y=V=_=N=void 0}function se(){return N===void 0?L:_e(r())}function me(){var ce=r(),Ve=$(ce);if(y=arguments,_=this,V=ce,Ve){if(N===void 0)return x(V);if(w)return clearTimeout(N),N=setTimeout(ie,m),I(V)}return N===void 0&&(N=setTimeout(ie,m)),L}return me.cancel=Re,me.flush=se,me}return Mh=h,Mh}var Dh,s1;function D3(){if(s1)return Dh;s1=1;var n=M3(),r=Yd(),i="Expected a function";function s(u,c,h){var d=!0,m=!0;if(typeof u!="function")throw new TypeError(i);return r(h)&&(d="leading"in h?!!h.leading:d,m="trailing"in h?!!h.trailing:m),n(u,c,{leading:d,maxWait:c,trailing:m})}return Dh=s,Dh}var B3=D3();const L3=md(B3);function U3(n){return n&&n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function H3(n){return n}function j3(n,r){r=r||{};const i=r.delimiter||".",s=r.maxDepth,u=r.transformKey||H3,c={};function h(d,m,g){g=g||1,Object.keys(d).forEach(function(y){const _=d[y],T=r.safe&&Array.isArray(_),L=Object.prototype.toString.call(_),N=U3(_),V=L==="[object Object]"||L==="[object Array]",G=m?m+i+u(y):u(y);if(!T&&!N&&V&&Object.keys(_).length&&(!r.maxDepth||g<s))return h(_,G,g+1);c[G]=_})}return h(n),c}const r_={"page.title":"Bubble Chat Chatbot","message-input-label":"Benutzereingabe","message-input-placeholder":"Nachricht","message-input.actions.submit.label":"Nachricht senden","message-input.actions.start-audio-recording.label":"Spracheingabe starten","message-input.actions.stop-audio-recording.label":"Spracheingabe stoppen","message-input.actions.submit-audio-recording.label":"Spracheingabe übermitteln","guest-bubble.label":"Ihre Nachricht","bot-bubble.label":"Nachricht des Chatbots","bot-bubble.reaction.good":"Gefällt mir","bot-bubble.reaction.bad":"Gefällt mir nicht","bot-bubble.reaction.remove":"Markierung entfernen","bot-bubble.copy":"Kopieren","bot-bubble.sources":"Quellenliste","bot-bubble.source.open":"Quelle öffnen","agent-bubble.label":"Nachricht des Live-Agenten","export-transcript.email.title":"Chatverlauf per E-Mail versenden","export-transcript.email.description":"Bitte E-Mail-Adresse angeben, an die der Chatverlauf gesendet werden soll.","export-transcript.email.cancel":"Abbrechen","export-transcript.email.send":"Senden","export-transcript.email.placeholder":"E-Mail-Adresse","export-transcript.email.invalid":"Bitte gültige E-Mail-Adresse eingeben.","export-transcript.email.success":"Der Chatverlauf wurde an die hinterlegte E-Mail-Adresse übermittelt.","general-conditions.header":"**Nutzungsbedingungen**","general-conditions.body":`Bitte berücksichtigen Sie die folgenden Punkte:
|
|
112
112
|
|
|
@@ -121,4 +121,4 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
|
|
|
121
121
|
|
|
122
122
|
- La cronologia delle chat è memorizzata nell'area UE e può essere visualizzata solo da persone autorizzate.
|
|
123
123
|
- Non inserire dati personali nella finestra di chat (password, data di nascita, ecc.).`,"general-conditions.accept-conditions-note":"Utilizzando la chat si accettano le condizioni d'uso.","block-user-input.title":"Attendere la risposta del chatbot.","conversation-rating.call-to-action.title":"Valuta questa chat","conversation-rating.overlay.title":"Quanto sei soddisfatto di questa chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Inserisci qui il tuo feedback (opzionale)","conversation-rating.overlay.star.very-bad":"Molto male","conversation-rating.overlay.star.very-good":"Molto buono","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"La media non è il mio obiettivo, cosa posso ancora migliorare?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Anche l'assenza è finita. Cosa posso migliorare per ottenere tutte le stelle la prossima volta?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfetto! Allora spero di potervi consigliare ancora una volta bene.","conversation-rating.overlay.bot-message.submit-feedback":"Grazie mille per il feedback. Mi impegno costantemente per migliorare.","conversation-rating.overlay.action.submit":"Invia","conversation-rating.overlay.action.close":"Chiudere","start-screen.intro":"","start-screen.start-chat":"Avviare la chat","header.close-chat":"Minimizzare la chat","header.menu.title":"Menu","header.menu.restart-chat":"Riavviare la chat","header.menu.expand-chat-window":"Espandere la finestra","header.menu.download-transcript":"Scaricare la trascrizione","header.menu.send-transcript":"Inviare la trascrizione","header.menu.export-transcript":"Esportare la trascrizione","source-infos.close":"Chiudere","source-infos.open-source":"Fonte aperta","source-infos.error.title":"Errore","source-infos.error.info":"Ops! Qualcosa è andato storto. Riprovare o contattare l'assistenza se il problema persiste.","source-infos.highlight-loading.title":"Il contenuto rilevante è evidenziato...","source-infos.highlight-loading.description":"Un momento - la fonte è in fase di analisi","commands.show-more.action":"Di più","commands.show-more.tooltip":"Mostra più comandi","commands.show-less.action":"Meno","commands.show-less.tooltip":"Mostra meno comandi"},k3=["de","en","fr","it"],a_={locale:"de",messages:r_},q3=(n,r)=>{if(k3.includes(n)){const i=F3(n),s=j3(r);return{...i,...s}}return r},F3=n=>{switch(n.toString()){case"en":return I3;case"fr":return z3;case"it":return G3;default:return r_}},P3=(n=V3,r)=>{switch(r.type){case jd:return Object.assign({},n,{connectionState:ja.CONNECTING});case Id:return Object.assign({},n,{connectionState:ja.CONNECTED});case zd:return Object.assign({},n,{connectionState:ja.DISCONNECTED});case Gd:return Object.assign({},n,{connectionState:ja.RECONNECTED});case kd:return Object.assign({},n,{sessionId:r.sessionId});case hu:return Object.assign({},n,{sessionId:r.payload.sessionId,userId:r.payload.userId});case du:return Object.assign({},n,{sessionId:void 0});default:return n}},V3={connectionState:ja.DISCONNECTED,sessionId:void 0,userId:void 0},Y3=(n=o1,r)=>{switch(r.type){case Ob:return o1;case hu:return La({type:"webclient.chat.started"}),n;case du:return La({type:"webclient.chat.ended"}),n;case Oe.ActionTypes.TYPING_ON:return Object.assign({},n,{isBotTyping:!0});case Oe.ActionTypes.TYPING_OFF:return Object.assign({},n,{isBotTyping:!1});case Oe.ActionTypes.MESSAGE_FROM_GUEST:case Oe.ActionTypes.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return l1(n,r.message);case Oe.ActionTypes.MESSAGE_TO_GUEST:{La(r);const i=Object.assign({},r.message,{_id:r.meta.actionId}),s=n.messages.filter(u=>u._id===r.meta.actionId).length>0;return Object.assign({},n,{isBotTyping:!1,messages:s?n.messages:n.messages.concat([i]),quickReplies:i.quickReplies?i.quickReplies:[]})}case xd:{const i=r.messages,s=i.length?i[i.length-1]:void 0;return Object.assign({},n,{isBotTyping:!1,messages:i,quickReplies:s?.quickReplies||[]})}case Ad:return La(r.message),n;case Oe.ActionTypes.EVENT_TO_GUEST:return La(r.event),n;case Oe.ActionTypes.DRAWER_OPEN:return Object.assign({},n,{drawerContentUrl:r.payload.parameters.contentUrl});case Oe.ActionTypes.DRAWER_CLOSE:return Object.assign({},n,{drawerContentUrl:void 0});case Oe.ActionTypes.GUEST_LOCALE_CHANGED:return Object.assign({},n,{locale:r.payload.locale});case lb:return La(r),n;case ob:return La(r),n;case Rd:{const i=new Oe.TextMessage(r.transcription,new Oe.GuestUser),s=Object.assign({},i,{_id:$h()});return l1(n,s)}case Oe.ActionTypes.TRANSCRIPT_ITEM_GUEST_REACTION:{const i=n.messages.map(s=>s._id===r.payload.actionId?Object.assign({},s,{reaction:r.payload.reaction}):s);return Object.assign({},n,{messages:i})}case wd:{const i={enabled:!0,rating:r.payload.rating};return Object.assign({},n,{conversationRating:i})}case Oe.ActionTypes.CONVERSATION_RATING_FROM_GUEST:{const i={...n.conversationRating,rating:r.payload};return Object.assign({},n,{conversationRating:i})}case Nd:return{...n,sourceInfos:{type:"loading",chunkId:r.payload.chunkId}};case Cd:{const{highlighted:i}=r.payload;return n.sourceInfos?.type==="loaded"&&i?{...n,sourceInfos:{...n.sourceInfos,highlighted:!0}}:{...n,sourceInfos:{type:"loading-error"}}}case sb:{const i=n.sourceInfos?.type,{chunkId:s,knowledgeBaseType:u,title:c,content:h,highlighted:d,url:m}=r.payload,g=n.sourceInfos?.type==="loading"||n.sourceInfos?.type==="loaded"?n.sourceInfos?.chunkId:void 0;return g&&g!==s?n:i==="loading"||i==="loaded"&&d?{...n,sourceInfos:{type:"loaded",chunkId:s,knowledgeBaseType:u,title:c,content:h,highlighted:d,url:m}}:n}case Md:return{...n,sourceInfos:void 0};case Rb:return{...n,showTranscriptMailOverlay:!n.showTranscriptMailOverlay};default:return n}},l1=(n,r)=>{const i=n.messages[n.messages.length-1],s=i?.text===r.text;return i&&i.sender.type===r.sender.type&&s?n:Object.assign({},n,{messages:n.messages.concat([r]),quickReplies:[]})},La=n=>{X3()?window.top?.postMessage(n,"*"):n.type==="webclient.change.url"&&window.open(n.url)},X3=()=>typeof window<"u"&&window.self!==window.top,o1={messages:[],quickReplies:[],isBotTyping:!1,showTranscriptMailOverlay:!1,conversationRating:{enabled:!1}},i_=Ud({name:"intl",initialState:a_,reducers:{updateIntl:(n,r)=>{n.locale=r.payload.language,n.messages=r.payload.messages}}}),{updateIntl:Z3}=i_.actions,Q3=i_.reducer,K3={version:void 0,enableStartScreen:void 0,enableStandaloneView:!1,enableTranscriptExportEmail:!1,enableTranscriptExportPdf:!1,enableGeneralConditions:!1,enableSpeechSupport:!1,commands:[],menuItems:[]},s_=Ud({name:"settings",initialState:K3,reducers:{setSettings(n,r){n.version&&n.version!==r.payload.version?(console.log("version changed, reloading chat window"),location.replace(location.href)):(n.version=r.payload.version,n.enableStartScreen=r.payload.enableStartScreen,n.enableStandaloneView=r.payload.enableStandaloneView,n.enableTranscriptExportEmail=r.payload.enableTranscriptExportEmail,n.enableTranscriptExportPdf=r.payload.enableTranscriptExportPdf,n.enableGeneralConditions=r.payload.enableGeneralConditions,n.enableSpeechSupport=r.payload.enableSpeechSupport,n.commands=r.payload.commands,n.menuItems=r.payload.menuItems||[])}}}),{setSettings:$3}=s_.actions,W3=s_.reducer,J3=mb({settings:W3,chat:Y3,startScreen:hO,connection:P3,intl:Q3}),eM="bubble-chat",l_="state-last-saved-at",o_="state",tM=n=>{try{if(!aM())return;const r=u1(n,l_);if(rM(r))return;{const i=u1(n,o_);return i===null?void 0:JSON.parse(i)}}catch(r){console.error(r);return}},nM=(n,r)=>{try{const i=JSON.stringify(r);c1(n,o_,i);const s=new Date().toISOString();c1(n,l_,s)}catch(i){console.error(i)}},rM=n=>{if(n===null)return!1;const r=new Date(n);return r.setHours(r.getHours()+12),new Date>r},aM=()=>typeof localStorage<"u",u1=(n,r)=>{const i=u_(n,r);return localStorage.getItem(i)},c1=(n,r,i)=>{const s=u_(n,r);return localStorage.setItem(s,i)},u_=(n,r)=>`${eM}-${n}-${r}`,er=Object.create(null);er.open="0";er.close="1";er.ping="2";er.pong="3";er.message="4";er.upgrade="5";er.noop="6";const Vo=Object.create(null);Object.keys(er).forEach(n=>{Vo[er[n]]=n});const ld={type:"error",data:"parser error"},c_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",f_=typeof ArrayBuffer=="function",h_=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,Xd=({type:n,data:r},i,s)=>c_&&r instanceof Blob?i?s(r):f1(r,s):f_&&(r instanceof ArrayBuffer||h_(r))?i?s(r):f1(new Blob([r]),s):s(er[n]+(r||"")),f1=(n,r)=>{const i=new FileReader;return i.onload=function(){const s=i.result.split(",")[1];r("b"+(s||""))},i.readAsDataURL(n)};function h1(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Bh;function iM(n,r){if(c_&&n.data instanceof Blob)return n.data.arrayBuffer().then(h1).then(r);if(f_&&(n.data instanceof ArrayBuffer||h_(n.data)))return r(h1(n.data));Xd(n,!1,i=>{Bh||(Bh=new TextEncoder),r(Bh.encode(i))})}const d1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qs=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<d1.length;n++)Qs[d1.charCodeAt(n)]=n;const sM=n=>{let r=n.length*.75,i=n.length,s,u=0,c,h,d,m;n[n.length-1]==="="&&(r--,n[n.length-2]==="="&&r--);const g=new ArrayBuffer(r),y=new Uint8Array(g);for(s=0;s<i;s+=4)c=Qs[n.charCodeAt(s)],h=Qs[n.charCodeAt(s+1)],d=Qs[n.charCodeAt(s+2)],m=Qs[n.charCodeAt(s+3)],y[u++]=c<<2|h>>4,y[u++]=(h&15)<<4|d>>2,y[u++]=(d&3)<<6|m&63;return g},lM=typeof ArrayBuffer=="function",Zd=(n,r)=>{if(typeof n!="string")return{type:"message",data:d_(n,r)};const i=n.charAt(0);return i==="b"?{type:"message",data:oM(n.substring(1),r)}:Vo[i]?n.length>1?{type:Vo[i],data:n.substring(1)}:{type:Vo[i]}:ld},oM=(n,r)=>{if(lM){const i=sM(n);return d_(i,r)}else return{base64:!0,data:n}},d_=(n,r)=>{switch(r){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},m_="",uM=(n,r)=>{const i=n.length,s=new Array(i);let u=0;n.forEach((c,h)=>{Xd(c,!1,d=>{s[h]=d,++u===i&&r(s.join(m_))})})},cM=(n,r)=>{const i=n.split(m_),s=[];for(let u=0;u<i.length;u++){const c=Zd(i[u],r);if(s.push(c),c.type==="error")break}return s};function fM(){return new TransformStream({transform(n,r){iM(n,i=>{const s=i.length;let u;if(s<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,s);else if(s<65536){u=new Uint8Array(3);const c=new DataView(u.buffer);c.setUint8(0,126),c.setUint16(1,s)}else{u=new Uint8Array(9);const c=new DataView(u.buffer);c.setUint8(0,127),c.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(u[0]|=128),r.enqueue(u),r.enqueue(i)})}})}let Lh;function Go(n){return n.reduce((r,i)=>r+i.length,0)}function ko(n,r){if(n[0].length===r)return n.shift();const i=new Uint8Array(r);let s=0;for(let u=0;u<r;u++)i[u]=n[0][s++],s===n[0].length&&(n.shift(),s=0);return n.length&&s<n[0].length&&(n[0]=n[0].slice(s)),i}function hM(n,r){Lh||(Lh=new TextDecoder);const i=[];let s=0,u=-1,c=!1;return new TransformStream({transform(h,d){for(i.push(h);;){if(s===0){if(Go(i)<1)break;const m=ko(i,1);c=(m[0]&128)===128,u=m[0]&127,u<126?s=3:u===126?s=1:s=2}else if(s===1){if(Go(i)<2)break;const m=ko(i,2);u=new DataView(m.buffer,m.byteOffset,m.length).getUint16(0),s=3}else if(s===2){if(Go(i)<8)break;const m=ko(i,8),g=new DataView(m.buffer,m.byteOffset,m.length),y=g.getUint32(0);if(y>Math.pow(2,21)-1){d.enqueue(ld);break}u=y*Math.pow(2,32)+g.getUint32(4),s=3}else{if(Go(i)<u)break;const m=ko(i,u);d.enqueue(Zd(c?m:Lh.decode(m),r)),s=0}if(u===0||u>n){d.enqueue(ld);break}}}})}const p_=4;function ct(n){if(n)return dM(n)}function dM(n){for(var r in ct.prototype)n[r]=ct.prototype[r];return n}ct.prototype.on=ct.prototype.addEventListener=function(n,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(r),this};ct.prototype.once=function(n,r){function i(){this.off(n,i),r.apply(this,arguments)}return i.fn=r,this.on(n,i),this};ct.prototype.off=ct.prototype.removeListener=ct.prototype.removeAllListeners=ct.prototype.removeEventListener=function(n,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+n];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,u=0;u<i.length;u++)if(s=i[u],s===r||s.fn===r){i.splice(u,1);break}return i.length===0&&delete this._callbacks["$"+n],this};ct.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),i=this._callbacks["$"+n],s=1;s<arguments.length;s++)r[s-1]=arguments[s];if(i){i=i.slice(0);for(var s=0,u=i.length;s<u;++s)i[s].apply(this,r)}return this};ct.prototype.emitReserved=ct.prototype.emit;ct.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};ct.prototype.hasListeners=function(n){return!!this.listeners(n).length};const yu=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,i)=>i(r,0),En=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),mM="arraybuffer";function g_(n,...r){return r.reduce((i,s)=>(n.hasOwnProperty(s)&&(i[s]=n[s]),i),{})}const pM=En.setTimeout,gM=En.clearTimeout;function vu(n,r){r.useNativeTimers?(n.setTimeoutFn=pM.bind(En),n.clearTimeoutFn=gM.bind(En)):(n.setTimeoutFn=En.setTimeout.bind(En),n.clearTimeoutFn=En.clearTimeout.bind(En))}const yM=1.33;function vM(n){return typeof n=="string"?bM(n):Math.ceil((n.byteLength||n.size)*yM)}function bM(n){let r=0,i=0;for(let s=0,u=n.length;s<u;s++)r=n.charCodeAt(s),r<128?i+=1:r<2048?i+=2:r<55296||r>=57344?i+=3:(s++,i+=4);return i}function y_(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function _M(n){let r="";for(let i in n)n.hasOwnProperty(i)&&(r.length&&(r+="&"),r+=encodeURIComponent(i)+"="+encodeURIComponent(n[i]));return r}function EM(n){let r={},i=n.split("&");for(let s=0,u=i.length;s<u;s++){let c=i[s].split("=");r[decodeURIComponent(c[0])]=decodeURIComponent(c[1])}return r}class SM extends Error{constructor(r,i,s){super(r),this.description=i,this.context=s,this.type="TransportError"}}class Qd extends ct{constructor(r){super(),this.writable=!1,vu(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,i,s){return super.emitReserved("error",new SM(r,i,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(r){this.readyState==="open"&&this.write(r)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(r){const i=Zd(r,this.socket.binaryType);this.onPacket(i)}onPacket(r){super.emitReserved("packet",r)}onClose(r){this.readyState="closed",super.emitReserved("close",r)}pause(r){}createUri(r,i={}){return r+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const r=this.opts.hostname;return r.indexOf(":")===-1?r:"["+r+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(r){const i=_M(r);return i.length?"?"+i:""}}class TM extends Qd{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(r){this.readyState="pausing";const i=()=>{this.readyState="paused",r()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||i()})),this.writable||(s++,this.once("drain",function(){--s||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const i=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};cM(r,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const r=()=>{this.write([{type:"close"}])};this.readyState==="open"?r():this.once("open",r)}write(r){this.writable=!1,uM(r,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=y_()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(r,i)}}let v_=!1;try{v_=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const AM=v_;function xM(){}class OM extends TM{constructor(r){if(super(r),typeof location<"u"){const i=location.protocol==="https:";let s=location.port;s||(s=i?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||s!==r.port}}doWrite(r,i){const s=this.request({method:"POST",data:r});s.on("success",i),s.on("error",(u,c)=>{this.onError("xhr post error",u,c)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(i,s)=>{this.onError("xhr poll error",i,s)}),this.pollXhr=r}}class Wn extends ct{constructor(r,i,s){super(),this.createRequest=r,vu(this,s),this._opts=s,this._method=s.method||"GET",this._uri=i,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var r;const i=g_(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(i);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let u in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(u)&&s.setRequestHeader(u,this._opts.extraHeaders[u])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var u;s.readyState===3&&((u=this._opts.cookieJar)===null||u===void 0||u.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(u){this.setTimeoutFn(()=>{this._onError(u)},0);return}typeof document<"u"&&(this._index=Wn.requestsCount++,Wn.requests[this._index]=this)}_onError(r){this.emitReserved("error",r,this._xhr),this._cleanup(!0)}_cleanup(r){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=xM,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Wn.requests[this._index],this._xhr=null}}_onLoad(){const r=this._xhr.responseText;r!==null&&(this.emitReserved("data",r),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Wn.requestsCount=0;Wn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",m1);else if(typeof addEventListener=="function"){const n="onpagehide"in En?"pagehide":"unload";addEventListener(n,m1,!1)}}function m1(){for(let n in Wn.requests)Wn.requests.hasOwnProperty(n)&&Wn.requests[n].abort()}const RM=function(){const n=b_({xdomain:!1});return n&&n.responseType!==null}();class wM extends OM{constructor(r){super(r);const i=r&&r.forceBase64;this.supportsBinary=RM&&!i}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new Wn(b_,this.uri(),r)}}function b_(n){const r=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||AM))return new XMLHttpRequest}catch{}if(!r)try{return new En[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const __=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class CM extends Qd{get name(){return"websocket"}doOpen(){const r=this.uri(),i=this.opts.protocols,s=__?{}:g_(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(r,i,s)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=r=>this.onClose({description:"websocket connection closed",context:r}),this.ws.onmessage=r=>this.onData(r.data),this.ws.onerror=r=>this.onError("websocket error",r)}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const s=r[i],u=i===r.length-1;Xd(s,this.supportsBinary,c=>{try{this.doWrite(s,c)}catch{}u&&yu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const r=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=y_()),this.supportsBinary||(i.b64=1),this.createUri(r,i)}}const Uh=En.WebSocket||En.MozWebSocket;class NM extends CM{createSocket(r,i,s){return __?new Uh(r,i,s):i?new Uh(r,i):new Uh(r)}doWrite(r,i){this.ws.send(i)}}class MM extends Qd{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(r){return this.emitReserved("error",r)}this._transport.closed.then(()=>{this.onClose()}).catch(r=>{this.onError("webtransport error",r)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(r=>{const i=hM(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=r.readable.pipeThrough(i).getReader(),u=fM();u.readable.pipeTo(r.writable),this._writer=u.writable.getWriter();const c=()=>{s.read().then(({done:d,value:m})=>{d||(this.onPacket(m),c())}).catch(d=>{})};c();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const s=r[i],u=i===r.length-1;this._writer.write(s).then(()=>{u&&yu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const DM={websocket:NM,webtransport:MM,polling:wM},BM=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,LM=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function od(n){if(n.length>8e3)throw"URI too long";const r=n,i=n.indexOf("["),s=n.indexOf("]");i!=-1&&s!=-1&&(n=n.substring(0,i)+n.substring(i,s).replace(/:/g,";")+n.substring(s,n.length));let u=BM.exec(n||""),c={},h=14;for(;h--;)c[LM[h]]=u[h]||"";return i!=-1&&s!=-1&&(c.source=r,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=UM(c,c.path),c.queryKey=HM(c,c.query),c}function UM(n,r){const i=/\/{2,9}/g,s=r.replace(i,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&s.splice(0,1),r.slice(-1)=="/"&&s.splice(s.length-1,1),s}function HM(n,r){const i={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,u,c){u&&(i[u]=c)}),i}const ud=typeof addEventListener=="function"&&typeof removeEventListener=="function",Yo=[];ud&&addEventListener("offline",()=>{Yo.forEach(n=>n())},!1);class sa extends ct{constructor(r,i){if(super(),this.binaryType=mM,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,r&&typeof r=="object"&&(i=r,r=null),r){const s=od(r);i.hostname=s.host,i.secure=s.protocol==="https"||s.protocol==="wss",i.port=s.port,s.query&&(i.query=s.query)}else i.host&&(i.hostname=od(i.host).host);vu(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(s=>{const u=s.prototype.name;this.transports.push(u),this._transportsByName[u]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=EM(this.opts.query)),ud&&(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"})},Yo.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const i=Object.assign({},this.opts.query);i.EIO=p_,i.transport=r,this.id&&(i.sid=this.id);const s=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[r]);return new this._transportsByName[r](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&sa.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(r);i.open(),this.setTransport(i)}setTransport(r){this.transport&&this.transport.removeAllListeners(),this.transport=r,r.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",sa.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",r),this.emitReserved("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=r.data,this._onError(i);break;case"message":this.emitReserved("data",r.data),this.emitReserved("message",r.data);break}}onHandshake(r){this.emitReserved("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this._pingInterval=r.pingInterval,this._pingTimeout=r.pingTimeout,this._maxPayload=r.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const r=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+r,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},r),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const r=this._getWritablePackets();this.transport.send(r),this._prevBufferLen=r.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let s=0;s<this.writeBuffer.length;s++){const u=this.writeBuffer[s].data;if(u&&(i+=vM(u)),s>0&&i>this._maxPayload)return this.writeBuffer.slice(0,s);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,yu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,i,s){return this._sendPacket("message",r,i,s),this}send(r,i,s){return this._sendPacket("message",r,i,s),this}_sendPacket(r,i,s,u){if(typeof i=="function"&&(u=i,i=void 0),typeof s=="function"&&(u=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const c={type:r,data:i,options:s};this.emitReserved("packetCreate",c),this.writeBuffer.push(c),u&&this.once("flush",u),this.flush()}close(){const r=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),r()},s=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():r()}):this.upgrading?s():r()),this}_onError(r){if(sa.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",r),this._onClose("transport error",r)}_onClose(r,i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ud&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Yo.indexOf(this._offlineEventListener);s!==-1&&Yo.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,i),this.writeBuffer=[],this._prevBufferLen=0}}}sa.protocol=p_;class jM extends sa{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let r=0;r<this._upgrades.length;r++)this._probe(this._upgrades[r])}_probe(r){let i=this.createTransport(r),s=!1;sa.priorWebsocketSuccess=!1;const u=()=>{s||(i.send([{type:"ping",data:"probe"}]),i.once("packet",_=>{if(!s)if(_.type==="pong"&&_.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;sa.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(y(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const T=new Error("probe error");T.transport=i.name,this.emitReserved("upgradeError",T)}}))};function c(){s||(s=!0,y(),i.close(),i=null)}const h=_=>{const T=new Error("probe error: "+_);T.transport=i.name,c(),this.emitReserved("upgradeError",T)};function d(){h("transport closed")}function m(){h("socket closed")}function g(_){i&&_.name!==i.name&&c()}const y=()=>{i.removeListener("open",u),i.removeListener("error",h),i.removeListener("close",d),this.off("close",m),this.off("upgrading",g)};i.once("open",u),i.once("error",h),i.once("close",d),this.once("close",m),this.once("upgrading",g),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{s||i.open()},200):i.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const i=[];for(let s=0;s<r.length;s++)~this.transports.indexOf(r[s])&&i.push(r[s]);return i}}let IM=class extends jM{constructor(r,i={}){const s=typeof r=="object"?r:i;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(u=>DM[u]).filter(u=>!!u)),super(r,s)}};function zM(n,r="",i){let s=n;i=i||typeof location<"u"&&location,n==null&&(n=i.protocol+"//"+i.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=i.protocol+n:n=i.host+n),/^(https?|wss?):\/\//.test(n)||(typeof i<"u"?n=i.protocol+"//"+n:n="https://"+n),s=od(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const c=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+c+":"+s.port+r,s.href=s.protocol+"://"+c+(i&&i.port===s.port?"":":"+s.port),s}const GM=typeof ArrayBuffer=="function",kM=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,E_=Object.prototype.toString,qM=typeof Blob=="function"||typeof Blob<"u"&&E_.call(Blob)==="[object BlobConstructor]",FM=typeof File=="function"||typeof File<"u"&&E_.call(File)==="[object FileConstructor]";function Kd(n){return GM&&(n instanceof ArrayBuffer||kM(n))||qM&&n instanceof Blob||FM&&n instanceof File}function Xo(n,r){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let i=0,s=n.length;i<s;i++)if(Xo(n[i]))return!0;return!1}if(Kd(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return Xo(n.toJSON(),!0);for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&Xo(n[i]))return!0;return!1}function PM(n){const r=[],i=n.data,s=n;return s.data=cd(i,r),s.attachments=r.length,{packet:s,buffers:r}}function cd(n,r){if(!n)return n;if(Kd(n)){const i={_placeholder:!0,num:r.length};return r.push(n),i}else if(Array.isArray(n)){const i=new Array(n.length);for(let s=0;s<n.length;s++)i[s]=cd(n[s],r);return i}else if(typeof n=="object"&&!(n instanceof Date)){const i={};for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=cd(n[s],r));return i}return n}function VM(n,r){return n.data=fd(n.data,r),delete n.attachments,n}function fd(n,r){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<r.length)return r[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let i=0;i<n.length;i++)n[i]=fd(n[i],r);else if(typeof n=="object")for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=fd(n[i],r));return n}const YM=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],XM=5;var Ce;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(Ce||(Ce={}));class ZM{constructor(r){this.replacer=r}encode(r){return(r.type===Ce.EVENT||r.type===Ce.ACK)&&Xo(r)?this.encodeAsBinary({type:r.type===Ce.EVENT?Ce.BINARY_EVENT:Ce.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let i=""+r.type;return(r.type===Ce.BINARY_EVENT||r.type===Ce.BINARY_ACK)&&(i+=r.attachments+"-"),r.nsp&&r.nsp!=="/"&&(i+=r.nsp+","),r.id!=null&&(i+=r.id),r.data!=null&&(i+=JSON.stringify(r.data,this.replacer)),i}encodeAsBinary(r){const i=PM(r),s=this.encodeAsString(i.packet),u=i.buffers;return u.unshift(s),u}}function p1(n){return Object.prototype.toString.call(n)==="[object Object]"}class $d extends ct{constructor(r){super(),this.reviver=r}add(r){let i;if(typeof r=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(r);const s=i.type===Ce.BINARY_EVENT;s||i.type===Ce.BINARY_ACK?(i.type=s?Ce.EVENT:Ce.ACK,this.reconstructor=new QM(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(Kd(r)||r.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(r),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+r)}decodeString(r){let i=0;const s={type:Number(r.charAt(0))};if(Ce[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===Ce.BINARY_EVENT||s.type===Ce.BINARY_ACK){const c=i+1;for(;r.charAt(++i)!=="-"&&i!=r.length;);const h=r.substring(c,i);if(h!=Number(h)||r.charAt(i)!=="-")throw new Error("Illegal attachments");s.attachments=Number(h)}if(r.charAt(i+1)==="/"){const c=i+1;for(;++i&&!(r.charAt(i)===","||i===r.length););s.nsp=r.substring(c,i)}else s.nsp="/";const u=r.charAt(i+1);if(u!==""&&Number(u)==u){const c=i+1;for(;++i;){const h=r.charAt(i);if(h==null||Number(h)!=h){--i;break}if(i===r.length)break}s.id=Number(r.substring(c,i+1))}if(r.charAt(++i)){const c=this.tryParse(r.substr(i));if($d.isPayloadValid(s.type,c))s.data=c;else throw new Error("invalid payload")}return s}tryParse(r){try{return JSON.parse(r,this.reviver)}catch{return!1}}static isPayloadValid(r,i){switch(r){case Ce.CONNECT:return p1(i);case Ce.DISCONNECT:return i===void 0;case Ce.CONNECT_ERROR:return typeof i=="string"||p1(i);case Ce.EVENT:case Ce.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&YM.indexOf(i[0])===-1);case Ce.ACK:case Ce.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class QM{constructor(r){this.packet=r,this.buffers=[],this.reconPack=r}takeBinaryData(r){if(this.buffers.push(r),this.buffers.length===this.reconPack.attachments){const i=VM(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const KM=Object.freeze(Object.defineProperty({__proto__:null,Decoder:$d,Encoder:ZM,get PacketType(){return Ce},protocol:XM},Symbol.toStringTag,{value:"Module"}));function jn(n,r,i){return n.on(r,i),function(){n.off(r,i)}}const $M=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class S_ extends ct{constructor(r,i,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=r,this.nsp=i,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const r=this.io;this.subs=[jn(r,"open",this.onopen.bind(this)),jn(r,"packet",this.onpacket.bind(this)),jn(r,"error",this.onerror.bind(this)),jn(r,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...r){return r.unshift("message"),this.emit.apply(this,r),this}emit(r,...i){var s,u,c;if($M.hasOwnProperty(r))throw new Error('"'+r.toString()+'" is a reserved event name');if(i.unshift(r),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const h={type:Ce.EVENT,data:i};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const y=this.ids++,_=i.pop();this._registerAckCallback(y,_),h.id=y}const d=(u=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||u===void 0?void 0:u.writable,m=this.connected&&!(!((c=this.io.engine)===null||c===void 0)&&c._hasPingExpired());return this.flags.volatile&&!d||(m?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(r,i){var s;const u=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(u===void 0){this.acks[r]=i;return}const c=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let d=0;d<this.sendBuffer.length;d++)this.sendBuffer[d].id===r&&this.sendBuffer.splice(d,1);i.call(this,new Error("operation has timed out"))},u),h=(...d)=>{this.io.clearTimeoutFn(c),i.apply(this,d)};h.withError=!0,this.acks[r]=h}emitWithAck(r,...i){return new Promise((s,u)=>{const c=(h,d)=>h?u(h):s(d);c.withError=!0,i.push(c),this.emit(r,...i)})}_addToQueue(r){let i;typeof r[r.length-1]=="function"&&(i=r.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((u,...c)=>s!==this._queue[0]?void 0:(u!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(u)):(this._queue.shift(),i&&i(null,...c)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(r=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!r||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(r){r.nsp=this.nsp,this.io._packet(r)}onopen(){typeof this.auth=="function"?this.auth(r=>{this._sendConnectPacket(r)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(r){this.packet({type:Ce.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},r):r})}onerror(r){this.connected||this.emitReserved("connect_error",r)}onclose(r,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",r,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(r=>{if(!this.sendBuffer.some(s=>String(s.id)===r)){const s=this.acks[r];delete this.acks[r],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case Ce.CONNECT:r.data&&r.data.sid?this.onconnect(r.data.sid,r.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ce.EVENT:case Ce.BINARY_EVENT:this.onevent(r);break;case Ce.ACK:case Ce.BINARY_ACK:this.onack(r);break;case Ce.DISCONNECT:this.ondisconnect();break;case Ce.CONNECT_ERROR:this.destroy();const s=new Error(r.data.message);s.data=r.data.data,this.emitReserved("connect_error",s);break}}onevent(r){const i=r.data||[];r.id!=null&&i.push(this.ack(r.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(r){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const s of i)s.apply(this,r)}super.emit.apply(this,r),this._pid&&r.length&&typeof r[r.length-1]=="string"&&(this._lastOffset=r[r.length-1])}ack(r){const i=this;let s=!1;return function(...u){s||(s=!0,i.packet({type:Ce.ACK,id:r,data:u}))}}onack(r){const i=this.acks[r.id];typeof i=="function"&&(delete this.acks[r.id],i.withError&&r.data.unshift(null),i.apply(this,r.data))}onconnect(r,i){this.id=r,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(r=>this.emitEvent(r)),this.receiveBuffer=[],this.sendBuffer.forEach(r=>{this.notifyOutgoingListeners(r),this.packet(r)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(r=>r()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ce.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(r){return this.flags.compress=r,this}get volatile(){return this.flags.volatile=!0,this}timeout(r){return this.flags.timeout=r,this}onAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(r),this}prependAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(r),this}offAny(r){if(!this._anyListeners)return this;if(r){const i=this._anyListeners;for(let s=0;s<i.length;s++)if(r===i[s])return i.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(r),this}prependAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(r),this}offAnyOutgoing(r){if(!this._anyOutgoingListeners)return this;if(r){const i=this._anyOutgoingListeners;for(let s=0;s<i.length;s++)if(r===i[s])return i.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(r){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const s of i)s.apply(this,r.data)}}}function Ni(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}Ni.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),i=Math.floor(r*this.jitter*n);n=(Math.floor(r*10)&1)==0?n-i:n+i}return Math.min(n,this.max)|0};Ni.prototype.reset=function(){this.attempts=0};Ni.prototype.setMin=function(n){this.ms=n};Ni.prototype.setMax=function(n){this.max=n};Ni.prototype.setJitter=function(n){this.jitter=n};class hd extends ct{constructor(r,i){var s;super(),this.nsps={},this.subs=[],r&&typeof r=="object"&&(i=r,r=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,vu(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((s=i.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Ni({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=r;const u=i.parser||KM;this.encoder=new u.Encoder,this.decoder=new u.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(r){return arguments.length?(this._reconnection=!!r,r||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(r){return r===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=r,this)}reconnectionDelay(r){var i;return r===void 0?this._reconnectionDelay:(this._reconnectionDelay=r,(i=this.backoff)===null||i===void 0||i.setMin(r),this)}randomizationFactor(r){var i;return r===void 0?this._randomizationFactor:(this._randomizationFactor=r,(i=this.backoff)===null||i===void 0||i.setJitter(r),this)}reconnectionDelayMax(r){var i;return r===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=r,(i=this.backoff)===null||i===void 0||i.setMax(r),this)}timeout(r){return arguments.length?(this._timeout=r,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(r){if(~this._readyState.indexOf("open"))return this;this.engine=new IM(this.uri,this.opts);const i=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const u=jn(i,"open",function(){s.onopen(),r&&r()}),c=d=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",d),r?r(d):this.maybeReconnectOnOpen()},h=jn(i,"error",c);if(this._timeout!==!1){const d=this._timeout,m=this.setTimeoutFn(()=>{u(),c(new Error("timeout")),i.close()},d);this.opts.autoUnref&&m.unref(),this.subs.push(()=>{this.clearTimeoutFn(m)})}return this.subs.push(u),this.subs.push(h),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(jn(r,"ping",this.onping.bind(this)),jn(r,"data",this.ondata.bind(this)),jn(r,"error",this.onerror.bind(this)),jn(r,"close",this.onclose.bind(this)),jn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(r){try{this.decoder.add(r)}catch(i){this.onclose("parse error",i)}}ondecoded(r){yu(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,i){let s=this.nsps[r];return s?this._autoConnect&&!s.active&&s.connect():(s=new S_(this,r,i),this.nsps[r]=s),s}_destroy(r){const i=Object.keys(this.nsps);for(const s of i)if(this.nsps[s].active)return;this._close()}_packet(r){const i=this.encoder.encode(r);for(let s=0;s<i.length;s++)this.engine.write(i[s],r.options)}cleanup(){this.subs.forEach(r=>r()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(r,i){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",r,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const r=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{r.skipReconnect||(this.emitReserved("reconnect_attempt",r.backoff.attempts),!r.skipReconnect&&r.open(u=>{u?(r._reconnecting=!1,r.reconnect(),this.emitReserved("reconnect_error",u)):r.onreconnect()}))},i);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const Ys={};function Zo(n,r){typeof n=="object"&&(r=n,n=void 0),r=r||{};const i=zM(n,r.path||"/socket.io"),s=i.source,u=i.id,c=i.path,h=Ys[u]&&c in Ys[u].nsps,d=r.forceNew||r["force new connection"]||r.multiplex===!1||h;let m;return d?m=new hd(s,r):(Ys[u]||(Ys[u]=new hd(s,r)),m=Ys[u]),i.query&&!r.query&&(r.query=i.queryKey),m.socket(i.path,r)}Object.assign(Zo,{Manager:hd,Socket:S_,io:Zo,connect:Zo});const WM=[Oe.ActionTypes.MESSAGE_TO_GUEST,Oe.ActionTypes.EVENT_TO_GUEST,Oe.ActionTypes.TYPING_ON,Oe.ActionTypes.TYPING_OFF,Oe.ActionTypes.RESTART_CHAT_REQUEST,...gO,...mx,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],JM=({dispatch:n,getState:r})=>i=>{let s=null;return u=>{const c=i(u);if(u.type===Hd){s?.disconnect(),n(bO());const h=`/chat?${lu.stringify(u.querystrings)}`;s=Zo(`/${u.clientName}${h}`),s.on("action",n),s.on("connect",()=>n(_O())),s.on("disconnect",()=>n(EO())),s.on("reconnect",()=>n(SO())),s.on("set-translations",(d,m)=>{n(Z3({language:d,messages:q3(d,m)}))}),s.on("set-settings",d=>{n($3(d))}),s.on("enable-conversation-rating",d=>n(bx(d))),s.on("speech-transcription",d=>n(gx(d))),s.on("restore-client-state",d=>{n(vO(d.sessionId)),n(Ex(d.messages))}),s.on("expand-window",({devices:d,initial:m=!1})=>{n({type:lb,devices:d,initial:m})}),s.on("restart-chat",()=>{n(mu(u.clientName,u.querystrings))})}else if(u.type===hu)s?.emit("start-chat",u.payload);else if(u.type===du)s?.emit("terminate-session",u.payload);else if(u.type===dx)s?.emit("get-started",JSON.stringify(u));else if(u.type===Od)s?.emit("audio-message",u.buffer);else if(u.type===Oe.ActionTypes.CONVERSATION_RATING_FROM_GUEST)s?.emit("conversation-rating",u.payload);else if(u.type===ub){const{connection:{sessionId:h}}=r();window.location.href=`/transcript-pdf/${h}`}else WM.indexOf(u.type)===-1&&u.meta===void 0&&s&&s.emit("action",JSON.stringify(u));return c}},T_=Vb(),e4={...tM(T_),intl:a_},dd=$x({middleware:n=>n().concat(JM),reducer:J3,preloadedState:e4});dd.subscribe(L3(()=>{const n=dd.getState();nM(T_,{connection:n.connection,startScreen:n.startScreen})},1e3));const t4=document.getElementById("root"),n4=zS.createRoot(t4);n4.render(v.jsx(I2,{store:dd,children:v.jsx(_3,{})}));
|
|
124
|
-
//# sourceMappingURL=index-
|
|
124
|
+
//# sourceMappingURL=index-Cvt8mpmq.js.map
|