@botfabrik/engine-webclient 4.65.0 → 4.65.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-rRIDvcNN.js → index-CtRHUofL.js} +2 -2
- package/dist/client/assets/{index-rRIDvcNN.js.map → index-CtRHUofL.js.map} +1 -1
- package/dist/client/assets/{index-DWQZ1b4m.css → index-vVZBi9_F.css} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/client/problem-report-active.svg +1 -1
- package/dist/views/index.js +1 -1
- package/package.json +4 -4
|
@@ -81,7 +81,7 @@ For more details see https://formatjs.io/docs/getting-started/message-distributi
|
|
|
81
81
|
Copyright (c) 2018 Jed Watson.
|
|
82
82
|
Licensed under the MIT License (MIT), see
|
|
83
83
|
http://jedwatson.github.io/classnames
|
|
84
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(o=i(o,r(a)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var a in o)t.call(o,a)&&o[a]&&(s=i(s,a));return s}function i(o,s){return s?o?o+" "+s:o+s:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(vy);var KS=vy.exports;const R=Ru(KS),_y="%[a-f0-9]{2}",ih=new RegExp("("+_y+")|([^%]+?)","gi"),oh=new RegExp("("+_y+")+","gi");function uu(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],uu(n),uu(r))}function YS(e){try{return decodeURIComponent(e)}catch{let t=e.match(ih)||[];for(let n=1;n<t.length;n++)e=uu(t,n).join(""),t=e.match(ih)||[];return e}}function ZS(e){const t={"%FE%FF":"��","%FF%FE":"��"};let n=oh.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const i=YS(n[0]);i!==n[0]&&(t[n[0]]=i)}n=oh.exec(e)}t["%C2"]="�";const r=Object.keys(t);for(const i of r)e=e.replace(new RegExp(i,"g"),t[i]);return e}function JS(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return ZS(e)}}function Ey(e,t){if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||t==="")return[];const n=e.indexOf(t);return n===-1?[]:[e.slice(0,n),e.slice(n+t.length)]}function eb(e,t){const n={};if(Array.isArray(t))for(const r of t){const i=Object.getOwnPropertyDescriptor(e,r);i!=null&&i.enumerable&&Object.defineProperty(n,r,i)}else for(const r of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,r);if(i.enumerable){const o=e[r];t(r,o,e)&&Object.defineProperty(n,r,i)}}return n}const tb=e=>e==null,nb=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),cu=Symbol("encodeFragmentIdentifier");function rb(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const i=n.length;return r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[ce(t,e),"[",i,"]"].join("")]:[...n,[ce(t,e),"[",ce(i,e),"]=",ce(r,e)].join("")]};case"bracket":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[ce(t,e),"[]"].join("")]:[...n,[ce(t,e),"[]=",ce(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[ce(t,e),":list="].join("")]:[...n,[ce(t,e),":list=",ce(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t=e.arrayFormat==="bracket-separator"?"[]=":"=";return n=>(r,i)=>i===void 0||e.skipNull&&i===null||e.skipEmptyString&&i===""?r:(i=i===null?"":i,r.length===0?[[ce(n,e),t,ce(i,e)].join("")]:[[r,ce(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,ce(t,e)]:[...n,[ce(t,e),"=",ce(r,e)].join("")]}}function ib(e){let t;switch(e.arrayFormat){case"index":return(n,r,i)=>{if(t=/\[(\d*)]$/.exec(n),n=n.replace(/\[\d*]$/,""),!t){i[n]=r;return}i[n]===void 0&&(i[n]={}),i[n][t[1]]=r};case"bracket":return(n,r,i)=>{if(t=/(\[])$/.exec(n),n=n.replace(/\[]$/,""),!t){i[n]=r;return}if(i[n]===void 0){i[n]=[r];return}i[n]=[...i[n],r]};case"colon-list-separator":return(n,r,i)=>{if(t=/(:list)$/.exec(n),n=n.replace(/:list$/,""),!t){i[n]=r;return}if(i[n]===void 0){i[n]=[r];return}i[n]=[...i[n],r]};case"comma":case"separator":return(n,r,i)=>{const o=typeof r=="string"&&r.includes(e.arrayFormatSeparator),s=typeof r=="string"&&!o&&Gt(r,e).includes(e.arrayFormatSeparator);r=s?Gt(r,e):r;const a=o||s?r.split(e.arrayFormatSeparator).map(l=>Gt(l,e)):r===null?r:Gt(r,e);i[n]=a};case"bracket-separator":return(n,r,i)=>{const o=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!o){i[n]=r&&Gt(r,e);return}const s=r===null?[]:r.split(e.arrayFormatSeparator).map(a=>Gt(a,e));if(i[n]===void 0){i[n]=s;return}i[n]=[...i[n],...s]};default:return(n,r,i)=>{if(i[n]===void 0){i[n]=r;return}i[n]=[...[i[n]].flat(),r]}}}function wy(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function ce(e,t){return t.encode?t.strict?nb(e):encodeURIComponent(e):e}function Gt(e,t){return t.decode?JS(e):e}function Sy(e){return Array.isArray(e)?e.sort():typeof e=="object"?Sy(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function by(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function ob(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function sh(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?e=Number(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")&&(e=e.toLowerCase()==="true"),e}function Hc(e){e=by(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function Gc(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t},wy(t.arrayFormatSeparator);const n=ib(t),r=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return r;for(const i of e.split("&")){if(i==="")continue;const o=t.decode?i.replaceAll("+"," "):i;let[s,a]=Ey(o,"=");s===void 0&&(s=o),a=a===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:Gt(a,t),n(Gt(s,t),a,r)}for(const[i,o]of Object.entries(r))if(typeof o=="object"&&o!==null)for(const[s,a]of Object.entries(o))o[s]=sh(a,t);else r[i]=sh(o,t);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((i,o)=>{const s=r[o];return i[o]=s&&typeof s=="object"&&!Array.isArray(s)?Sy(s):s,i},Object.create(null))}function xy(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},wy(t.arrayFormatSeparator);const n=s=>t.skipNull&&tb(e[s])||t.skipEmptyString&&e[s]==="",r=rb(t),i={};for(const[s,a]of Object.entries(e))n(s)||(i[s]=a);const o=Object.keys(i);return t.sort!==!1&&o.sort(t.sort),o.map(s=>{const a=e[s];return a===void 0?"":a===null?ce(s,t):Array.isArray(a)?a.length===0&&t.arrayFormat==="bracket-separator"?ce(s,t)+"[]":a.reduce(r(s),[]).join("&"):ce(s,t)+"="+ce(a,t)}).filter(s=>s.length>0).join("&")}function Ty(e,t){var i;t={decode:!0,...t};let[n,r]=Ey(e,"#");return n===void 0&&(n=e),{url:((i=n==null?void 0:n.split("?"))==null?void 0:i[0])??"",query:Gc(Hc(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:Gt(r,t)}:{}}}function Cy(e,t){t={encode:!0,strict:!0,[cu]:!0,...t};const n=by(e.url).split("?")[0]||"",r=Hc(e.url),i={...Gc(r,{sort:!1}),...e.query};let o=xy(i,t);o&&(o=`?${o}`);let s=ob(e.url);if(typeof e.fragmentIdentifier=="string"){const a=new URL(n);a.hash=e.fragmentIdentifier,s=t[cu]?a.hash:`#${e.fragmentIdentifier}`}return`${n}${o}${s}`}function ky(e,t,n){n={parseFragmentIdentifier:!0,[cu]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=Ty(e,n);return Cy({url:r,query:eb(i,t),fragmentIdentifier:o},n)}function sb(e,t,n){const r=Array.isArray(t)?i=>!t.includes(i):(i,o)=>!t(i,o);return ky(e,r,n)}const fu=Object.freeze(Object.defineProperty({__proto__:null,exclude:sb,extract:Hc,parse:Gc,parseUrl:Ty,pick:ky,stringify:xy,stringifyUrl:Cy},Symbol.toStringTag,{value:"Module"})),Oy=e=>t=>(e.payload.type!==U.ActionTypes.MESSAGE_FROM_GUEST&&t(U.receiveTextMessageWithoutAnalysisFromGuest(e.label,e.payload)),t(e.payload)),ab=e=>(t,n)=>{const{quickReplies:r}=n().chat,i=r.find(o=>e.toLocaleLowerCase().indexOf(o.label.toLocaleLowerCase())>-1);return t(i?Oy({...i,label:e}):U.receiveTextMessageFromGuest(e))},Vc="MESSAGE_TO_PARENT_PAGE",Wc="RESTORE_PREVIOUS_CHAT_MESSAGES",qc="AUDIO_MESSAGE_FROM_USER",Xc="ENABLE_SPEECH_SUPPORT",Qc="ENABLE_BOT_REPLIES_VOTING_SUPPORT",Kc="ENABLE_TRANSCRIPT_EXPORT",lb="EXPORT_TRANSCRIPT",Yc="RECEIVE_SPEECH_TRANSCRIPTION",Zc="SHOW_GENERAL_CONDITIONS",Jc="ENABLE_CONVERSATION_RATING",ub="webclient.get.started",Ry="webclient.expand.window",Ny="webclient.transcript.pdf.download",cb=[Vc,Wc,qc,Xc,Qc,Kc,lb,Yc,Zc,Jc],fb=e=>({type:qc,buffer:e}),db=()=>({type:Xc}),hb=()=>({type:Qc}),pb=e=>({type:Yc,transcription:e}),mb=e=>({type:Kc,methods:e}),gb=e=>({type:U.ActionTypes.TRANSCRIPT_MAIL_REQUEST,payload:{parameters:{mailTo:e}}}),yb=()=>({type:Zc}),vb=()=>({type:Ny}),_b=({rating:e})=>({type:Jc,payload:{rating:e}}),Eb=(e,t)=>({type:U.ActionTypes.CONVERSATION_RATING_FROM_GUEST,payload:{value:e,feedback:t}}),wb=e=>U.requestNLUEvent(e),Sb=e=>({type:Wc,messages:e}),bb=e=>{switch(e.type){case U.ButtonTypeEnum.WEB_URL:return Ay(e.url);case U.ButtonTypeEnum.POSTBACK:return e.payload;default:throw new Error(`unknown button type ${e.type}`)}},xb=e=>Ay(e),Ay=e=>({type:Vc,message:{type:"webclient.change.url",url:e}});/*! js-cookie v3.0.5 | MIT */function ho(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Tb={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function du(e,t){function n(i,o,s){if(!(typeof document>"u")){s=ho({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in s)s[l]&&(a+="; "+l,s[l]!==!0&&(a+="="+s[l].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+a}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],s={},a=0;a<o.length;a++){var l=o[a].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(s[c]=e.read(u,c),i===c)break}catch{}}return i?s[i]:s}}return Object.create({set:n,get:r,remove:function(i,o){n(i,"",ho({},o,{expires:-1}))},withAttributes:function(i){return du(this.converter,ho({},this.attributes,i))},withConverter:function(i){return du(ho({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var ah=du(Tb,{path:"/"});const Js="CONNECT",ef="CONNECTING",tf="CONNECTED",nf="DISCONNECTED",rf="RECONNECTED",of="RESTORE_SESSION_ID",Py="RESTART",Cb=[Js,ef,tf,nf,rf,of],Iy=(e,t)=>(n,r)=>{const i=fu.parse(t),o=r().connection;let s=o.sessionId;s===void 0&&(s=crypto.randomUUID());let a=o.userId;if(a===void 0){const l=ah.get("bf-webclient-userId");a=l||crypto.randomUUID(),ah.set("bf-webclient-userId",a)}return i.sessionId=s,i.userId=a,n(kb(s,a,e,fu.stringify(i)))},kb=(e,t,n,r)=>({type:Js,sessionId:e,userId:t,clientName:n,querystrings:r}),Ob=e=>({type:of,sessionId:e}),Rb=()=>({type:ef}),Nb=()=>({type:tf}),Ab=()=>({type:nf}),Pb=()=>({type:rf}),Dy=(e,t)=>n=>(n(Ib()),n(Iy(e,t))),Ib=()=>({type:Py});var In=(e=>(e[e.CONNECTING=0]="CONNECTING",e[e.CONNECTED=1]="CONNECTED",e[e.RECONNECTED=2]="RECONNECTED",e[e.DISCONNECTED=3]="DISCONNECTED",e))(In||{}),My=(e=>(e.GUEST="GUEST",e.BOT="BOT",e.PERSON="PERSON",e))(My||{});const Db="_button_5quu7_54",Mb="_buttonDefault_5quu7_66",Fb="_buttonPrimary_5quu7_80",Bb="_accessabilityHidden_5quu7_132",Pe={button:Db,buttonDefault:Mb,buttonPrimary:Fb,accessabilityHidden:Bb},Lb="_chatwindow_phukm_1",jb="_chatcontent_phukm_13",lh={chatwindow:Lb,chatcontent:jb},zb="_messageContainer_1wdci_1",Ub="_messages_1wdci_10",uh={messageContainer:zb,messages:Ub};function Dn(){return Dn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dn.apply(this,arguments)}const $b=["children","options"];var ch,fh;(function(e){e.blockQuote="0",e.breakLine="1",e.breakThematic="2",e.codeBlock="3",e.codeFenced="4",e.codeInline="5",e.footnote="6",e.footnoteReference="7",e.gfmTask="8",e.heading="9",e.headingSetext="10",e.htmlBlock="11",e.htmlComment="12",e.htmlSelfClosing="13",e.image="14",e.link="15",e.linkAngleBraceStyleDetector="16",e.linkBareUrlDetector="17",e.linkMailtoDetector="18",e.newlineCoalescer="19",e.orderedList="20",e.paragraph="21",e.ref="22",e.refImage="23",e.refLink="24",e.table="25",e.tableSeparator="26",e.text="27",e.textBolded="28",e.textEmphasized="29",e.textEscaped="30",e.textMarked="31",e.textStrikethroughed="32",e.unorderedList="33"})(ch||(ch={})),function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"}(fh||(fh={}));const dh=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","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((e,t)=>(e[t.toLowerCase()]=t,e),{for:"htmlFor"}),hh={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},Hb=["style","script"],Gb=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,Vb=/mailto:/i,Wb=/\n{2,}$/,Fy=/^(\s*>[\s\S]*?)(?=\n{2,})/,qb=/^ *> ?/gm,Xb=/^ {2,}\n/,Qb=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,By=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,Ly=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,Kb=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,Yb=/^(?:\n *)*\n/,Zb=/\r\n?/g,Jb=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,ex=/^\[\^([^\]]+)]/,tx=/\f/g,nx=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,rx=/^\s*?\[(x|\s)\]/,jy=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,zy=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,Uy=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,hu=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,ix=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,$y=/^<!--[\s\S]*?(?:-->)/,ox=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,pu=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,sx=/^\{.*\}$/,ax=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,lx=/^<([^ >]+@[^ >]+)>/,ux=/^<([^ >]+:\/[^ >]+)>/,cx=/-([a-z])?/gi,Hy=/^(.*\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,fx=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,dx=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,hx=/^\[([^\]]*)\] ?\[([^\]]*)\]/,px=/(\[|\])/g,mx=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,gx=/\t/g,yx=/(^ *\||\| *$)/g,vx=/^ *:-+: *$/,_x=/^ *:-+ *$/,Ex=/^ *-+: *$/,ea="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~~.*?~~|==.*?==|.|\\n)*?)",wx=new RegExp(`^([*_])\\1${ea}\\1\\1(?!\\1)`),Sx=new RegExp(`^([*_])${ea}\\1(?!\\1|\\w)`),bx=new RegExp(`^==${ea}==`),xx=new RegExp(`^~~${ea}~~`),Tx=/^\\([^0-9A-Za-z\s])/,Cx=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,kx=/^\n+/,Ox=/^([ \t]*)/,Rx=/\\([^\\])/g,ph=/ *\n+$/,Nx=/(?:^|\n)( *)$/,sf="(?:\\d+\\.)",af="(?:[*+-])";function Gy(e){return"( *)("+(e===1?sf:af)+") +"}const Vy=Gy(1),Wy=Gy(2);function qy(e){return new RegExp("^"+(e===1?Vy:Wy))}const Ax=qy(1),Px=qy(2);function Xy(e){return new RegExp("^"+(e===1?Vy:Wy)+"[^\\n]*(?:\\n(?!\\1"+(e===1?sf:af)+" )[^\\n]*)*(\\n|$)","gm")}const Qy=Xy(1),Ky=Xy(2);function Yy(e){const t=e===1?sf:af;return new RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const Zy=Yy(1),Jy=Yy(2);function mh(e,t){const n=t===1,r=n?Zy:Jy,i=n?Qy:Ky,o=n?Ax:Px;return{match(s,a,l){const u=Nx.exec(l);return u&&(a.list||!a.inline&&!a.simple)?r.exec(s=u[1]+s):null},order:1,parse(s,a,l){const u=n?+s[2]:void 0,c=s[0].replace(Wb,`
|
|
84
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(o=i(o,r(a)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var a in o)t.call(o,a)&&o[a]&&(s=i(s,a));return s}function i(o,s){return s?o?o+" "+s:o+s:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(vy);var KS=vy.exports;const R=Ru(KS),_y="%[a-f0-9]{2}",ih=new RegExp("("+_y+")|([^%]+?)","gi"),oh=new RegExp("("+_y+")+","gi");function uu(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],uu(n),uu(r))}function YS(e){try{return decodeURIComponent(e)}catch{let t=e.match(ih)||[];for(let n=1;n<t.length;n++)e=uu(t,n).join(""),t=e.match(ih)||[];return e}}function ZS(e){const t={"%FE%FF":"��","%FF%FE":"��"};let n=oh.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const i=YS(n[0]);i!==n[0]&&(t[n[0]]=i)}n=oh.exec(e)}t["%C2"]="�";const r=Object.keys(t);for(const i of r)e=e.replace(new RegExp(i,"g"),t[i]);return e}function JS(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return ZS(e)}}function Ey(e,t){if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||t==="")return[];const n=e.indexOf(t);return n===-1?[]:[e.slice(0,n),e.slice(n+t.length)]}function eb(e,t){const n={};if(Array.isArray(t))for(const r of t){const i=Object.getOwnPropertyDescriptor(e,r);i!=null&&i.enumerable&&Object.defineProperty(n,r,i)}else for(const r of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,r);if(i.enumerable){const o=e[r];t(r,o,e)&&Object.defineProperty(n,r,i)}}return n}const tb=e=>e==null,nb=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),cu=Symbol("encodeFragmentIdentifier");function rb(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const i=n.length;return r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[ce(t,e),"[",i,"]"].join("")]:[...n,[ce(t,e),"[",ce(i,e),"]=",ce(r,e)].join("")]};case"bracket":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[ce(t,e),"[]"].join("")]:[...n,[ce(t,e),"[]=",ce(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[ce(t,e),":list="].join("")]:[...n,[ce(t,e),":list=",ce(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t=e.arrayFormat==="bracket-separator"?"[]=":"=";return n=>(r,i)=>i===void 0||e.skipNull&&i===null||e.skipEmptyString&&i===""?r:(i=i===null?"":i,r.length===0?[[ce(n,e),t,ce(i,e)].join("")]:[[r,ce(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,ce(t,e)]:[...n,[ce(t,e),"=",ce(r,e)].join("")]}}function ib(e){let t;switch(e.arrayFormat){case"index":return(n,r,i)=>{if(t=/\[(\d*)]$/.exec(n),n=n.replace(/\[\d*]$/,""),!t){i[n]=r;return}i[n]===void 0&&(i[n]={}),i[n][t[1]]=r};case"bracket":return(n,r,i)=>{if(t=/(\[])$/.exec(n),n=n.replace(/\[]$/,""),!t){i[n]=r;return}if(i[n]===void 0){i[n]=[r];return}i[n]=[...i[n],r]};case"colon-list-separator":return(n,r,i)=>{if(t=/(:list)$/.exec(n),n=n.replace(/:list$/,""),!t){i[n]=r;return}if(i[n]===void 0){i[n]=[r];return}i[n]=[...i[n],r]};case"comma":case"separator":return(n,r,i)=>{const o=typeof r=="string"&&r.includes(e.arrayFormatSeparator),s=typeof r=="string"&&!o&&Gt(r,e).includes(e.arrayFormatSeparator);r=s?Gt(r,e):r;const a=o||s?r.split(e.arrayFormatSeparator).map(l=>Gt(l,e)):r===null?r:Gt(r,e);i[n]=a};case"bracket-separator":return(n,r,i)=>{const o=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!o){i[n]=r&&Gt(r,e);return}const s=r===null?[]:r.split(e.arrayFormatSeparator).map(a=>Gt(a,e));if(i[n]===void 0){i[n]=s;return}i[n]=[...i[n],...s]};default:return(n,r,i)=>{if(i[n]===void 0){i[n]=r;return}i[n]=[...[i[n]].flat(),r]}}}function wy(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function ce(e,t){return t.encode?t.strict?nb(e):encodeURIComponent(e):e}function Gt(e,t){return t.decode?JS(e):e}function Sy(e){return Array.isArray(e)?e.sort():typeof e=="object"?Sy(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function by(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function ob(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function sh(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?e=Number(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")&&(e=e.toLowerCase()==="true"),e}function Hc(e){e=by(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function Gc(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t},wy(t.arrayFormatSeparator);const n=ib(t),r=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return r;for(const i of e.split("&")){if(i==="")continue;const o=t.decode?i.replaceAll("+"," "):i;let[s,a]=Ey(o,"=");s===void 0&&(s=o),a=a===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:Gt(a,t),n(Gt(s,t),a,r)}for(const[i,o]of Object.entries(r))if(typeof o=="object"&&o!==null)for(const[s,a]of Object.entries(o))o[s]=sh(a,t);else r[i]=sh(o,t);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((i,o)=>{const s=r[o];return i[o]=s&&typeof s=="object"&&!Array.isArray(s)?Sy(s):s,i},Object.create(null))}function xy(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},wy(t.arrayFormatSeparator);const n=s=>t.skipNull&&tb(e[s])||t.skipEmptyString&&e[s]==="",r=rb(t),i={};for(const[s,a]of Object.entries(e))n(s)||(i[s]=a);const o=Object.keys(i);return t.sort!==!1&&o.sort(t.sort),o.map(s=>{const a=e[s];return a===void 0?"":a===null?ce(s,t):Array.isArray(a)?a.length===0&&t.arrayFormat==="bracket-separator"?ce(s,t)+"[]":a.reduce(r(s),[]).join("&"):ce(s,t)+"="+ce(a,t)}).filter(s=>s.length>0).join("&")}function Ty(e,t){var i;t={decode:!0,...t};let[n,r]=Ey(e,"#");return n===void 0&&(n=e),{url:((i=n==null?void 0:n.split("?"))==null?void 0:i[0])??"",query:Gc(Hc(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:Gt(r,t)}:{}}}function Cy(e,t){t={encode:!0,strict:!0,[cu]:!0,...t};const n=by(e.url).split("?")[0]||"",r=Hc(e.url),i={...Gc(r,{sort:!1}),...e.query};let o=xy(i,t);o&&(o=`?${o}`);let s=ob(e.url);if(typeof e.fragmentIdentifier=="string"){const a=new URL(n);a.hash=e.fragmentIdentifier,s=t[cu]?a.hash:`#${e.fragmentIdentifier}`}return`${n}${o}${s}`}function ky(e,t,n){n={parseFragmentIdentifier:!0,[cu]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=Ty(e,n);return Cy({url:r,query:eb(i,t),fragmentIdentifier:o},n)}function sb(e,t,n){const r=Array.isArray(t)?i=>!t.includes(i):(i,o)=>!t(i,o);return ky(e,r,n)}const fu=Object.freeze(Object.defineProperty({__proto__:null,exclude:sb,extract:Hc,parse:Gc,parseUrl:Ty,pick:ky,stringify:xy,stringifyUrl:Cy},Symbol.toStringTag,{value:"Module"})),Oy=e=>t=>(e.payload.type!==U.ActionTypes.MESSAGE_FROM_GUEST&&t(U.receiveTextMessageWithoutAnalysisFromGuest(e.label,e.payload)),t(e.payload)),ab=e=>(t,n)=>{const{quickReplies:r}=n().chat,i=r.find(o=>e.toLocaleLowerCase().indexOf(o.label.toLocaleLowerCase())>-1);return t(i?Oy({...i,label:e}):U.receiveTextMessageFromGuest(e))},Vc="MESSAGE_TO_PARENT_PAGE",Wc="RESTORE_PREVIOUS_CHAT_MESSAGES",qc="AUDIO_MESSAGE_FROM_USER",Xc="ENABLE_SPEECH_SUPPORT",Qc="ENABLE_BOT_REPLIES_VOTING_SUPPORT",Kc="ENABLE_TRANSCRIPT_EXPORT",lb="EXPORT_TRANSCRIPT",Yc="RECEIVE_SPEECH_TRANSCRIPTION",Zc="SHOW_GENERAL_CONDITIONS",Jc="ENABLE_CONVERSATION_RATING",ub="webclient.get.started",Ry="webclient.expand.window",Ny="webclient.transcript.pdf.download",cb=[Vc,Wc,qc,Xc,Qc,Kc,lb,Yc,Zc,Jc],fb=e=>({type:qc,buffer:e}),db=()=>({type:Xc}),hb=()=>({type:Qc}),pb=e=>({type:Yc,transcription:e}),mb=e=>({type:Kc,methods:e}),gb=e=>({type:U.ActionTypes.TRANSCRIPT_MAIL_REQUEST,payload:{parameters:{mailTo:e}}}),yb=()=>({type:Zc}),vb=()=>({type:Ny}),_b=({rating:e})=>({type:Jc,payload:{rating:e}}),Eb=(e,t)=>({type:U.ActionTypes.CONVERSATION_RATING_FROM_GUEST,payload:{value:e,feedback:t}}),wb=e=>U.requestNLUEvent(e),Sb=e=>({type:Wc,messages:e}),bb=e=>{switch(e.type){case U.ButtonTypeEnum.WEB_URL:return Ay(e.url);case U.ButtonTypeEnum.POSTBACK:return e.payload;default:throw new Error(`unknown button type ${e.type}`)}},xb=e=>Ay(e),Ay=e=>({type:Vc,message:{type:"webclient.change.url",url:e}});/*! js-cookie v3.0.5 | MIT */function ho(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Tb={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function du(e,t){function n(i,o,s){if(!(typeof document>"u")){s=ho({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in s)s[l]&&(a+="; "+l,s[l]!==!0&&(a+="="+s[l].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+a}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],s={},a=0;a<o.length;a++){var l=o[a].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(s[c]=e.read(u,c),i===c)break}catch{}}return i?s[i]:s}}return Object.create({set:n,get:r,remove:function(i,o){n(i,"",ho({},o,{expires:-1}))},withAttributes:function(i){return du(this.converter,ho({},this.attributes,i))},withConverter:function(i){return du(ho({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var ah=du(Tb,{path:"/"});const Js="CONNECT",ef="CONNECTING",tf="CONNECTED",nf="DISCONNECTED",rf="RECONNECTED",of="RESTORE_SESSION_ID",Py="RESTART",Cb=[Js,ef,tf,nf,rf,of],Iy=(e,t)=>(n,r)=>{const i=fu.parse(t),o=r().connection;let s=o.sessionId;s===void 0&&(s=crypto.randomUUID());let a=o.userId;if(a===void 0){const l=ah.get("bf-webclient-userId");a=l||crypto.randomUUID(),ah.set("bf-webclient-userId",a)}return i.sessionId=s,i.userId=a,n(kb(s,a,e,fu.stringify(i)))},kb=(e,t,n,r)=>({type:Js,sessionId:e,userId:t,clientName:n,querystrings:r}),Ob=e=>({type:of,sessionId:e}),Rb=()=>({type:ef}),Nb=()=>({type:tf}),Ab=()=>({type:nf}),Pb=()=>({type:rf}),Dy=(e,t)=>n=>(n(Ib()),n(Iy(e,t))),Ib=()=>({type:Py});var In=(e=>(e[e.CONNECTING=0]="CONNECTING",e[e.CONNECTED=1]="CONNECTED",e[e.RECONNECTED=2]="RECONNECTED",e[e.DISCONNECTED=3]="DISCONNECTED",e))(In||{}),My=(e=>(e.GUEST="GUEST",e.BOT="BOT",e.PERSON="PERSON",e))(My||{});const Db="_button_1e5of_54",Mb="_buttonDefault_1e5of_66",Fb="_buttonPrimary_1e5of_80",Bb="_accessabilityHidden_1e5of_132",Pe={button:Db,buttonDefault:Mb,buttonPrimary:Fb,accessabilityHidden:Bb},Lb="_chatwindow_phukm_1",jb="_chatcontent_phukm_13",lh={chatwindow:Lb,chatcontent:jb},zb="_messageContainer_1wdci_1",Ub="_messages_1wdci_10",uh={messageContainer:zb,messages:Ub};function Dn(){return Dn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dn.apply(this,arguments)}const $b=["children","options"];var ch,fh;(function(e){e.blockQuote="0",e.breakLine="1",e.breakThematic="2",e.codeBlock="3",e.codeFenced="4",e.codeInline="5",e.footnote="6",e.footnoteReference="7",e.gfmTask="8",e.heading="9",e.headingSetext="10",e.htmlBlock="11",e.htmlComment="12",e.htmlSelfClosing="13",e.image="14",e.link="15",e.linkAngleBraceStyleDetector="16",e.linkBareUrlDetector="17",e.linkMailtoDetector="18",e.newlineCoalescer="19",e.orderedList="20",e.paragraph="21",e.ref="22",e.refImage="23",e.refLink="24",e.table="25",e.tableSeparator="26",e.text="27",e.textBolded="28",e.textEmphasized="29",e.textEscaped="30",e.textMarked="31",e.textStrikethroughed="32",e.unorderedList="33"})(ch||(ch={})),function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"}(fh||(fh={}));const dh=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","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((e,t)=>(e[t.toLowerCase()]=t,e),{for:"htmlFor"}),hh={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},Hb=["style","script"],Gb=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,Vb=/mailto:/i,Wb=/\n{2,}$/,Fy=/^(\s*>[\s\S]*?)(?=\n{2,})/,qb=/^ *> ?/gm,Xb=/^ {2,}\n/,Qb=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,By=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,Ly=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,Kb=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,Yb=/^(?:\n *)*\n/,Zb=/\r\n?/g,Jb=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,ex=/^\[\^([^\]]+)]/,tx=/\f/g,nx=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,rx=/^\s*?\[(x|\s)\]/,jy=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,zy=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,Uy=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,hu=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,ix=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,$y=/^<!--[\s\S]*?(?:-->)/,ox=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,pu=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,sx=/^\{.*\}$/,ax=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,lx=/^<([^ >]+@[^ >]+)>/,ux=/^<([^ >]+:\/[^ >]+)>/,cx=/-([a-z])?/gi,Hy=/^(.*\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,fx=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,dx=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,hx=/^\[([^\]]*)\] ?\[([^\]]*)\]/,px=/(\[|\])/g,mx=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,gx=/\t/g,yx=/(^ *\||\| *$)/g,vx=/^ *:-+: *$/,_x=/^ *:-+ *$/,Ex=/^ *-+: *$/,ea="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~~.*?~~|==.*?==|.|\\n)*?)",wx=new RegExp(`^([*_])\\1${ea}\\1\\1(?!\\1)`),Sx=new RegExp(`^([*_])${ea}\\1(?!\\1|\\w)`),bx=new RegExp(`^==${ea}==`),xx=new RegExp(`^~~${ea}~~`),Tx=/^\\([^0-9A-Za-z\s])/,Cx=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,kx=/^\n+/,Ox=/^([ \t]*)/,Rx=/\\([^\\])/g,ph=/ *\n+$/,Nx=/(?:^|\n)( *)$/,sf="(?:\\d+\\.)",af="(?:[*+-])";function Gy(e){return"( *)("+(e===1?sf:af)+") +"}const Vy=Gy(1),Wy=Gy(2);function qy(e){return new RegExp("^"+(e===1?Vy:Wy))}const Ax=qy(1),Px=qy(2);function Xy(e){return new RegExp("^"+(e===1?Vy:Wy)+"[^\\n]*(?:\\n(?!\\1"+(e===1?sf:af)+" )[^\\n]*)*(\\n|$)","gm")}const Qy=Xy(1),Ky=Xy(2);function Yy(e){const t=e===1?sf:af;return new RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const Zy=Yy(1),Jy=Yy(2);function mh(e,t){const n=t===1,r=n?Zy:Jy,i=n?Qy:Ky,o=n?Ax:Px;return{match(s,a,l){const u=Nx.exec(l);return u&&(a.list||!a.inline&&!a.simple)?r.exec(s=u[1]+s):null},order:1,parse(s,a,l){const u=n?+s[2]:void 0,c=s[0].replace(Wb,`
|
|
85
85
|
`).match(i);let g=!1;return{items:c.map(function(y,f){const v=o.exec(y)[0].length,p=new RegExp("^ {1,"+v+"}","gm"),w=y.replace(p,"").replace(o,""),h=f===c.length-1,d=w.indexOf(`
|
|
86
86
|
|
|
87
87
|
`)!==-1||h&&g;g=d;const m=l.inline,E=l.list;let b;l.list=!0,d?(l.inline=!1,b=w.replace(ph,`
|
|
@@ -108,4 +108,4 @@ For more details see https://formatjs.io/docs/getting-started/message-distributi
|
|
|
108
108
|
|
|
109
109
|
- La cronologia delle chat è memorizzata nell'area UE e può essere visualizzata solo da persone autorizzate.
|
|
110
110
|
- Non inserire dati personali nella finestra di chat (password, data di nascita, ecc.).`,"general-conditions.accept-conditions-note":"Utilizzando la chat si accettano le condizioni d'uso.","problem-report.action.mark":"Segna come errato","problem-report.action.unmark":"Rimuovere il marcatore","block-user-input.title":"Attendere la risposta del chatbot.","conversation-rating.call-to-action.title":"Valuta questa chat","conversation-rating.overlay.title":"Quanto sei soddisfatto di questa chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Inserisci qui il tuo feedback (opzionale)","conversation-rating.overlay.star.very-bad":"Molto male","conversation-rating.overlay.star.very-good":"Molto buono","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"La media non è il mio obiettivo, cosa posso ancora migliorare?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Anche l'assenza è finita. Cosa posso migliorare per ottenere tutte le stelle la prossima volta?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfetto! Allora spero di potervi consigliare ancora una volta bene.","conversation-rating.overlay.bot-message.submit-feedback":"Grazie mille per il feedback. Mi impegno costantemente per migliorare.","conversation-rating.overlay.action.submit":"Invia","conversation-rating.overlay.action.close":"Chiudere"},LR=["de","en","fr","it"],Iv={locale:"de",messages:Pv},jR=(e,t)=>{if(LR.includes(e)){const n=zR(e),r=DR.dot(t);return{...n,...r}}return t},zR=e=>{switch(e.toString()){case"en":return MR;case"fr":return FR;case"it":return BR;default:return Pv}},UR=(e=$R,t)=>{switch(t.type){case Js:return Object.assign({},e,{sessionId:t.sessionId,userId:t.userId});case ef:return Object.assign({},e,{connectionState:In.CONNECTING});case tf:return Object.assign({},e,{connectionState:In.CONNECTED});case nf:return Object.assign({},e,{connectionState:In.DISCONNECTED});case rf:return Object.assign({},e,{connectionState:In.RECONNECTED});case of:return Object.assign({},e,{sessionId:t.sessionId});case Py:return Object.assign({},e,{connectionState:In.DISCONNECTED,sessionId:void 0});default:return e}},$R={connectionState:In.DISCONNECTED,sessionId:void 0,userId:void 0},HR=(e=el,t)=>{switch(t.type){case U.ActionTypes.TYPING_ON:return Object.assign({},e,{isBotTyping:!0});case U.ActionTypes.TYPING_OFF:return Object.assign({},e,{isBotTyping:!1});case U.ActionTypes.MESSAGE_FROM_GUEST:case U.ActionTypes.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return ep(e,t.message);case U.ActionTypes.MESSAGE_TO_GUEST:yo(t);const n=Object.assign({},t.message,{_id:t.meta.actionId}),r=e.messages.filter(u=>u._id===t.meta.actionId).length>0;return Object.assign({},e,{isBotTyping:!1,messages:r?e.messages:e.messages.concat([n]),quickReplies:n.quickReplies?n.quickReplies:[]});case Wc:const i=t.messages;if(i.length>0){const u=i[i.length-1];return Object.assign({},el,{messages:i,quickReplies:u.quickReplies?u.quickReplies:[]})}else return el;case Vc:return yo(t.message),e;case U.ActionTypes.EVENT_TO_GUEST:return yo(t.event),e;case Ry:return yo(t),e;case Xc:return Object.assign({},e,{speechSupport:!0});case Qc:return Object.assign({},e,{problemReportingEnabled:!0});case Yc:const o=new U.TextMessage(t.transcription,new U.GuestUser),s=Object.assign({},o,{_id:crypto.randomUUID()});return ep(e,s);case Kc:return Object.assign({},e,{transcriptExportEnabled:t.methods});case Zc:return Object.assign({},e,{showGeneralConditions:!0});case U.ActionTypes.PROBLEM_REPORT_FROM_GUEST:const a=e.messages.map(u=>u._id===t.payload.actionId?Object.assign({},u,{problemReport:t.payload.problem}):u);return Object.assign({},e,{messages:a});case Jc:const l={enabled:!0,rating:t.payload.rating};return Object.assign({},e,{conversationRating:l});case U.ActionTypes.CONVERSATION_RATING_FROM_GUEST:{const u={...e.conversationRating,rating:t.payload};return Object.assign({},e,{conversationRating:u})}default:return e}},ep=(e,t)=>{const n=e.messages[e.messages.length-1],r=(n==null?void 0:n.text)===t.text;return n&&n.sender.type===t.sender.type&&r?e:Object.assign({},e,{messages:e.messages.concat([t]),quickReplies:[]})},yo=e=>{var t;GR()?(t=window.top)==null||t.postMessage(e,"*"):e.type==="webclient.change.url"&&window.open(e.url)},GR=()=>typeof window<"u"&&window.self!==window.top,el={messages:[],quickReplies:[],isBotTyping:!1,speechSupport:!1,problemReportingEnabled:!1,transcriptExportEnabled:{pdf:!1,email:!1},showGeneralConditions:!1,conversationRating:{enabled:!1}},Dv=pO({name:"intl",initialState:Iv,reducers:{updateIntl:(e,t)=>{e.locale=t.payload.language,e.messages=t.payload.messages}}}),{updateIntl:VR}=Dv.actions,WR=Dv.reducer,qR=mv({chat:HR,connection:UR,intl:WR}),Mv="bf-webclient-state-last-saved-at",Fv="bf-webclient-state",XR=e=>{try{if(!YR())return;const t=tp(e,Mv);if(KR(t))return;{const n=tp(e,Fv);return n===null?void 0:JSON.parse(n)}}catch(t){console.error(t);return}},QR=(e,t)=>{try{const n=JSON.stringify(t);np(e,Fv,n);let r=new Date().toISOString();np(e,Mv,r)}catch(n){console.error(n)}},KR=e=>{if(e===null)return!1;let t=new Date(e);return t.setHours(t.getHours()+12),new Date>t},YR=()=>typeof localStorage<"u",tp=(e,t)=>localStorage.getItem(`${e}_${t}`),np=(e,t,n)=>localStorage.setItem(`${e}_${t}`,n),Lt=Object.create(null);Lt.open="0";Lt.close="1";Lt.ping="2";Lt.pong="3";Lt.message="4";Lt.upgrade="5";Lt.noop="6";const Lo=Object.create(null);Object.keys(Lt).forEach(e=>{Lo[Lt[e]]=e});const Su={type:"error",data:"parser error"},Bv=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Lv=typeof ArrayBuffer=="function",jv=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,_f=({type:e,data:t},n,r)=>Bv&&t instanceof Blob?n?r(t):rp(t,r):Lv&&(t instanceof ArrayBuffer||jv(t))?n?r(t):rp(new Blob([t]),r):r(Lt[e]+(t||"")),rp=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function ip(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let tl;function ZR(e,t){if(Bv&&e.data instanceof Blob)return e.data.arrayBuffer().then(ip).then(t);if(Lv&&(e.data instanceof ArrayBuffer||jv(e.data)))return t(ip(e.data));_f(e,!1,n=>{tl||(tl=new TextEncoder),t(tl.encode(n))})}const op="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",si=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<op.length;e++)si[op.charCodeAt(e)]=e;const JR=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)o=si[e.charCodeAt(r)],s=si[e.charCodeAt(r+1)],a=si[e.charCodeAt(r+2)],l=si[e.charCodeAt(r+3)],c[i++]=o<<2|s>>4,c[i++]=(s&15)<<4|a>>2,c[i++]=(a&3)<<6|l&63;return u},eN=typeof ArrayBuffer=="function",Ef=(e,t)=>{if(typeof e!="string")return{type:"message",data:zv(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:tN(e.substring(1),t)}:Lo[n]?e.length>1?{type:Lo[n],data:e.substring(1)}:{type:Lo[n]}:Su},tN=(e,t)=>{if(eN){const n=JR(e);return zv(n,t)}else return{base64:!0,data:e}},zv=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Uv="",nN=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{_f(o,!1,a=>{r[s]=a,++i===n&&t(r.join(Uv))})})},rN=(e,t)=>{const n=e.split(Uv),r=[];for(let i=0;i<n.length;i++){const o=Ef(n[i],t);if(r.push(o),o.type==="error")break}return r};function iN(){return new TransformStream({transform(e,t){ZR(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let nl;function vo(e){return e.reduce((t,n)=>t+n.length,0)}function _o(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function oN(e,t){nl||(nl=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(vo(n)<1)break;const l=_o(n,1);o=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(vo(n)<2)break;const l=_o(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(vo(n)<8)break;const l=_o(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,21)-1){a.enqueue(Su);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(vo(n)<i)break;const l=_o(n,i);a.enqueue(Ef(o?l:nl.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(Su);break}}}})}const $v=4;function de(e){if(e)return sN(e)}function sN(e){for(var t in de.prototype)e[t]=de.prototype[t];return e}de.prototype.on=de.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};de.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};de.prototype.off=de.prototype.removeListener=de.prototype.removeAllListeners=de.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};de.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};de.prototype.emitReserved=de.prototype.emit;de.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};de.prototype.hasListeners=function(e){return!!this.listeners(e).length};const rt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function Hv(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const aN=rt.setTimeout,lN=rt.clearTimeout;function la(e,t){t.useNativeTimers?(e.setTimeoutFn=aN.bind(rt),e.clearTimeoutFn=lN.bind(rt)):(e.setTimeoutFn=rt.setTimeout.bind(rt),e.clearTimeoutFn=rt.clearTimeout.bind(rt))}const uN=1.33;function cN(e){return typeof e=="string"?fN(e):Math.ceil((e.byteLength||e.size)*uN)}function fN(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function dN(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function hN(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class pN extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class wf extends de{constructor(t){super(),this.writable=!1,la(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new pN(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Ef(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=dN(t);return n.length?"?"+n:""}}const Gv="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),bu=64,mN={};let sp=0,Eo=0,ap;function lp(e){let t="";do t=Gv[e%bu]+t,e=Math.floor(e/bu);while(e>0);return t}function Vv(){const e=lp(+new Date);return e!==ap?(sp=0,ap=e):e+"."+lp(sp++)}for(;Eo<bu;Eo++)mN[Gv[Eo]]=Eo;let Wv=!1;try{Wv=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const gN=Wv;function qv(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||gN))return new XMLHttpRequest}catch{}if(!t)try{return new rt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function yN(){}const vN=function(){return new qv({xdomain:!1}).responseType!=null}();class _N extends wf{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=vN&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};rN(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,nN(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Vv()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Ft(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Ft extends de{constructor(t,n){super(),la(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=Hv(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new qv(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Ft.requestsCount++,Ft.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=yN,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Ft.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Ft.requestsCount=0;Ft.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",up);else if(typeof addEventListener=="function"){const e="onpagehide"in rt?"pagehide":"unload";addEventListener(e,up,!1)}}function up(){for(let e in Ft.requests)Ft.requests.hasOwnProperty(e)&&Ft.requests[e].abort()}const Sf=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),wo=rt.WebSocket||rt.MozWebSocket,cp=!0,EN="arraybuffer",fp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class wN extends wf{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=fp?{}:Hv(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=cp&&!fp?n?new wo(t,n):new wo(t):new wo(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;_f(r,this.supportsBinary,o=>{const s={};try{cp&&this.ws.send(o)}catch{}i&&Sf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Vv()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!wo}}class SN extends wf{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=oN(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=iN();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),o())}).catch(a=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&Sf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const bN={websocket:wN,webtransport:SN,polling:_N},xN=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,TN=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function xu(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=xN.exec(e||""),o={},s=14;for(;s--;)o[TN[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=CN(o,o.path),o.queryKey=kN(o,o.query),o}function CN(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function kN(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let Xv=class rr extends de{constructor(t,n={}){super(),this.binaryType=EN,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=xu(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=xu(n.host).host),la(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=hN(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=$v,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new bN[t](r)}open(){let t;if(this.opts.rememberUpgrade&&rr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;rr.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",g=>{if(!r)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;rr.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const y=new Error("probe error");y.transport=n.name,this.emitReserved("upgradeError",y)}}))};function o(){r||(r=!0,c(),n.close(),n=null)}const s=g=>{const y=new Error("probe error: "+g);y.transport=n.name,o(),this.emitReserved("upgradeError",y)};function a(){s("transport closed")}function l(){s("socket closed")}function u(g){n&&g.name!==n.name&&o()}const c=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",rr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=cN(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){rr.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};Xv.protocol=$v;function ON(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=xu(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const RN=typeof ArrayBuffer=="function",NN=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Qv=Object.prototype.toString,AN=typeof Blob=="function"||typeof Blob<"u"&&Qv.call(Blob)==="[object BlobConstructor]",PN=typeof File=="function"||typeof File<"u"&&Qv.call(File)==="[object FileConstructor]";function bf(e){return RN&&(e instanceof ArrayBuffer||NN(e))||AN&&e instanceof Blob||PN&&e instanceof File}function jo(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(jo(e[n]))return!0;return!1}if(bf(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return jo(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&jo(e[n]))return!0;return!1}function IN(e){const t=[],n=e.data,r=e;return r.data=Tu(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Tu(e,t){if(!e)return e;if(bf(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Tu(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Tu(e[r],t));return n}return e}function DN(e,t){return e.data=Cu(e.data,t),delete e.attachments,e}function Cu(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Cu(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Cu(e[n],t));return e}const MN=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],FN=5;var z;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(z||(z={}));class BN{constructor(t){this.replacer=t}encode(t){return(t.type===z.EVENT||t.type===z.ACK)&&jo(t)?this.encodeAsBinary({type:t.type===z.EVENT?z.BINARY_EVENT:z.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===z.BINARY_EVENT||t.type===z.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=IN(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function dp(e){return Object.prototype.toString.call(e)==="[object Object]"}class xf extends de{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===z.BINARY_EVENT;r||n.type===z.BINARY_ACK?(n.type=r?z.EVENT:z.ACK,this.reconstructor=new LN(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(bf(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(z[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===z.BINARY_EVENT||r.type===z.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(o,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(xf.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case z.CONNECT:return dp(n);case z.DISCONNECT:return n===void 0;case z.CONNECT_ERROR:return typeof n=="string"||dp(n);case z.EVENT:case z.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&MN.indexOf(n[0])===-1);case z.ACK:case z.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class LN{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=DN(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const jN=Object.freeze(Object.defineProperty({__proto__:null,Decoder:xf,Encoder:BN,get PacketType(){return z},protocol:FN},Symbol.toStringTag,{value:"Module"}));function gt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const zN=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Kv extends de{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[gt(t,"open",this.onopen.bind(this)),gt(t,"packet",this.onpacket.bind(this)),gt(t,"error",this.onerror.bind(this)),gt(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(zN.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:z.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++,a=n.pop();this._registerAckCallback(s,a),r.id=s}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),s=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,i)=>{const o=(s,a)=>s?i(s):r(a);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:z.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case z.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case z.EVENT:case z.BINARY_EVENT:this.onevent(t);break;case z.ACK:case z.BINARY_ACK:this.onack(t);break;case z.DISCONNECT:this.ondisconnect();break;case z.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:z.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:z.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Br(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Br.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Br.prototype.reset=function(){this.attempts=0};Br.prototype.setMin=function(e){this.ms=e};Br.prototype.setMax=function(e){this.max=e};Br.prototype.setJitter=function(e){this.jitter=e};class ku extends de{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,la(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Br({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||jN;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Xv(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=gt(n,"open",function(){r.onopen(),t&&t()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=gt(n,"error",o);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(gt(t,"ping",this.onping.bind(this)),gt(t,"data",this.ondata.bind(this)),gt(t,"error",this.onerror.bind(this)),gt(t,"close",this.onclose.bind(this)),gt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Sf(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Kv(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Jr={};function zo(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=ON(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=Jr[i]&&o in Jr[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new ku(r,t):(Jr[i]||(Jr[i]=new ku(r,t)),l=Jr[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(zo,{Manager:ku,Socket:Kv,io:zo,connect:zo});const UN=[U.ActionTypes.MESSAGE_TO_GUEST,U.ActionTypes.EVENT_TO_GUEST,U.ActionTypes.TYPING_ON,U.ActionTypes.TYPING_OFF,U.ActionTypes.RESTART_CHAT_REQUEST,...Cb,...cb,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],$N=({dispatch:e,getState:t})=>n=>{let r=null;return i=>{let o=n(i);if(i.type===Js)r!=null&&r.disconnect(),e(Rb()),r=zo(`/${i.clientName}/chat?${i.querystrings}`),r.on("action",e),r.on("connect",()=>e(Nb())),r.on("disconnect",()=>e(Ab())),r.on("reconnect",()=>e(Pb())),r.on("set-translations",(s,a)=>{e(VR({language:s,messages:jR(s,a)}))}),r.on("enable-speech-support",()=>e(db())),r.on("enable-problem-reporting",()=>e(hb())),r.on("enable-transcript-export",s=>e(mb(s))),r.on("enable-conversation-rating",s=>e(_b(s))),r.on("speech-transcription",s=>e(pb(s))),r.on("restore-client-state",s=>{e(Ob(s.sessionId)),e(Sb(s.messages))}),r.on("expand-window",({devices:s})=>e({type:Ry,devices:s})),r.on("show-general-conditions",()=>e(yb())),r.on("restart-chat",()=>{e(Dy(i.clientName,i.querystrings))});else if(i.type===ub)r==null||r.emit("get-started",JSON.stringify(i));else if(i.type===qc)r==null||r.emit("audio-message",i.buffer);else if(i.type===U.ActionTypes.CONVERSATION_RATING_FROM_GUEST)r==null||r.emit("conversation-rating",i.payload);else if(i.type===Ny){const{connection:{sessionId:s}}=t();window.location.href=`/transcript-pdf/${s}`}else UN.indexOf(i.type)===-1&&i.meta===void 0&&r&&r.emit("action",JSON.stringify(i));return o}},Yv=hv(),HN={...XR(Yv),intl:Iv},Ou=oO({middleware:e=>e().concat($N),reducer:qR,preloadedState:HN});Ou.subscribe(RR(()=>{const e=Ou.getState();QR(Yv,{connection:e.connection})},1e3));const GN=document.getElementById("root"),VN=Tg(GN);VN.render(_.jsx(PE,{store:Ou,children:_.jsx(bk,{})}));
|
|
111
|
-
//# sourceMappingURL=index-
|
|
111
|
+
//# sourceMappingURL=index-CtRHUofL.js.map
|