@seamly/web-ui 21.0.6 → 21.0.8

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.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see utils.min.js.LICENSE.txt */
2
- (()=>{var e={574:e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function n(){this._defaults=[]}for(var r=0,o=["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"];r<o.length;r++){const e=o[r];n.prototype[e]=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this._defaults.push({fn:e,args:n}),this}}n.prototype._setDefaults=function(e){var n,r=function(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw s}}}}(this._defaults);try{for(r.s();!(n=r.n()).done;){const t=n.value;e[t.fn](...t.args)}}catch(e){r.e(e)}finally{r.f()}},e.exports=n},766:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}let o;"undefined"!=typeof window?o=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),o=void 0):o=self;const i=n(767),s=n(445),a=n(129),c=n(842),l=n(244),u=l.isObject,p=l.mixin,d=l.hasOwn,f=n(253),h=n(574);function y(){}e.exports=function(e,n){return"function"==typeof n?new t.Request("GET",e).end(n):1===arguments.length?new t.Request("GET",e):new t.Request(e,n)};const b=t=e.exports;t.Request=x,b.getXHR=()=>{if(o.XMLHttpRequest)return new o.XMLHttpRequest;throw new Error("Browser-only version of superagent could not find XHR")};const m="".trim?e=>e.trim():e=>e.replace(/(^\s*|\s*$)/g,"");function v(e){if(!u(e))return e;const t=[];for(const n in e)d(e,n)&&g(t,n,e[n]);return t.join("&")}function g(e,t,n){if(void 0!==n)if(null!==n)if(Array.isArray(n)){var o,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw s}}}}(n);try{for(i.s();!(o=i.n()).done;)g(e,t,o.value)}catch(e){i.e(e)}finally{i.f()}}else if(u(n))for(const r in n)d(n,r)&&g(e,`${t}[${r}]`,n[r]);else e.push(encodeURI(t)+"="+encodeURIComponent(n));else e.push(encodeURI(t))}function w(e){const t={},n=e.split("&");let r,o;for(let e=0,i=n.length;e<i;++e)r=n[e],o=r.indexOf("="),-1===o?t[decodeURIComponent(r)]="":t[decodeURIComponent(r.slice(0,o))]=decodeURIComponent(r.slice(o+1));return t}function O(e){return/[/+]json($|[^-\w])/i.test(e)}function j(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;let t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.headers=function(e){const t=e.split(/\r?\n/),n={};let r,o,i,s;for(let e=0,a=t.length;e<a;++e)o=t[e],r=o.indexOf(":"),-1!==r&&(i=o.slice(0,r).toLowerCase(),s=m(o.slice(r+1)),n[i]=s);return n}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&e._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function x(e,t){const n=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",(()=>{let e,t=null,r=null;try{r=new j(n)}catch(e){return t=new Error("Parser is unable to parse the response"),t.parse=!0,t.original=e,n.xhr?(t.rawResponse=void 0===n.xhr.responseType?n.xhr.responseText:n.xhr.response,t.status=n.xhr.status?n.xhr.status:null,t.statusCode=t.status):(t.rawResponse=null,t.status=null),n.callback(t)}n.emit("response",r);try{n._isResponseOK(r)||(e=new Error(r.statusText||r.text||"Unsuccessful HTTP response"))}catch(t){e=t}e?(e.original=t,e.response=r,e.status=e.status||r.status,n.callback(e,r)):n.callback(null,r)}))}b.serializeObject=v,b.parseString=w,b.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},b.serialize={"application/x-www-form-urlencoded":a.stringify,"application/json":s},b.parse={"application/x-www-form-urlencoded":w,"application/json":JSON.parse},p(j.prototype,f.prototype),j.prototype._parseBody=function(e){let t=b.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&O(this.type)&&(t=b.parse["application/json"]),t&&e&&(e.length>0||e instanceof Object)?t(e):null)},j.prototype.toError=function(){const e=this.req,t=e.method,n=e.url,r=`cannot ${t} ${n} (${this.status})`,o=new Error(r);return o.status=this.status,o.method=t,o.url=n,o},b.Response=j,i(x.prototype),p(x.prototype,c.prototype),x.prototype.type=function(e){return this.set("Content-Type",b.types[e]||e),this},x.prototype.accept=function(e){return this.set("Accept",b.types[e]||e),this},x.prototype.auth=function(e,t,n){1===arguments.length&&(t=""),"object"==typeof t&&null!==t&&(n=t,t=""),n||(n={type:"function"==typeof btoa?"basic":"auto"});const r=n.encoder?n.encoder:e=>{if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(e,t,n,r)},x.prototype.query=function(e){return"string"!=typeof e&&(e=v(e)),e&&this._query.push(e),this},x.prototype.attach=function(e,t,n){if(t){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,n||t.name)}return this},x.prototype._getFormData=function(){return this._formData||(this._formData=new o.FormData),this._formData},x.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();const n=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),n(e,t)},x.prototype.crossDomainError=function(){const e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},x.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},x.prototype.ca=x.prototype.agent,x.prototype.buffer=x.prototype.ca,x.prototype.write=()=>{throw new Error("Streaming is not supported in browser version of superagent")},x.prototype.pipe=x.prototype.write,x.prototype._isHost=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},x.prototype.end=function(e){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||y,this._finalizeQueryString(),this._end()},x.prototype._setUploadTimeout=function(){const e=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((()=>{e._timeoutError("Upload timeout of ",e._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},x.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));const e=this;this.xhr=b.getXHR();const t=this.xhr;let n=this._formData||this._data;this._setTimeouts(),t.addEventListener("readystatechange",(()=>{const n=t.readyState;if(n>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4!==n)return;let r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}));const r=(t,n)=>{n.total>0&&(n.percent=n.loaded/n.total*100,100===n.percent&&clearTimeout(e._uploadTimeoutTimer)),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{t.addEventListener("progress",r.bind(null,"download")),t.upload&&t.upload.addEventListener("progress",r.bind(null,"upload"))}catch(e){}t.upload&&this._setUploadTimeout();try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof n&&!this._isHost(n)){const e=this._header["content-type"];let t=this._serializer||b.serialize[e?e.split(";")[0]:""];!t&&O(e)&&(t=b.serialize["application/json"]),t&&(n=t(n))}for(const e in this.header)null!==this.header[e]&&d(this.header,e)&&t.setRequestHeader(e,this.header[e]);this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0===n?null:n)},b.agent=()=>new h;for(var _=0,S=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];_<S.length;_++){const e=S[_];h.prototype[e.toLowerCase()]=function(t,n){const r=new b.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}}function C(e,t,n){const r=b("DELETE",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}h.prototype.del=h.prototype.delete,b.get=(e,t,n)=>{const r=b("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},b.head=(e,t,n)=>{const r=b("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},b.options=(e,t,n)=>{const r=b("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},b.del=C,b.delete=C,b.patch=(e,t,n)=>{const r=b("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},b.post=(e,t,n)=>{const r=b("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},b.put=(e,t,n)=>{const r=b("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}},842:(e,t,n)=>{"use strict";const r=n(695),o=n(244),i=o.isObject,s=o.hasOwn;function a(){}e.exports=a,a.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},a.prototype.parse=function(e){return this._parser=e,this},a.prototype.responseType=function(e){return this._responseType=e,this},a.prototype.serialize=function(e){return this._serializer=e,this},a.prototype.timeout=function(e){if(!e||"object"!=typeof e)return this._timeout=e,this._responseTimeout=0,this._uploadTimeout=0,this;for(const t in e)if(s(e,t))switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;case"upload":this._uploadTimeout=e.upload;break;default:console.warn("Unknown timeout option",t)}return this},a.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};const c=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),l=new Set([408,413,429,500,502,503,504,521,522,524]);a.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{const n=this._retryCallback(e,t);if(!0===n)return!0;if(!1===n)return!1}catch(e){console.error(e)}if(t&&t.status&&l.has(t.status))return!0;if(e){if(e.code&&c.has(e.code))return!0;if(e.timeout&&"ECONNABORTED"===e.code)return!0;if(e.crossDomain)return!0}return!1},a.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},a.prototype.then=function(e,t){if(!this._fullfilledPromise){const e=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(((t,n)=>{e.on("abort",(()=>{if(this._maxRetries&&this._maxRetries>this._retries)return;if(this.timedout&&this.timedoutError)return void n(this.timedoutError);const e=new Error("Aborted");e.code="ABORTED",e.status=this.status,e.method=this.method,e.url=this.url,n(e)})),e.end(((e,r)=>{e?n(e):t(r)}))}))}return this._fullfilledPromise.then(e,t)},a.prototype.catch=function(e){return this.then(void 0,e)},a.prototype.use=function(e){return e(this),this},a.prototype.ok=function(e){if("function"!=typeof e)throw new Error("Callback required");return this._okCallback=e,this},a.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},a.prototype.get=function(e){return this._header[e.toLowerCase()]},a.prototype.getHeader=a.prototype.get,a.prototype.set=function(e,t){if(i(e)){for(const t in e)s(e,t)&&this.set(t,e[t]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},a.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},a.prototype.field=function(e,t,n){if(null==e)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(i(e)){for(const t in e)s(e,t)&&this.field(t,e[t]);return this}if(Array.isArray(t)){for(const n in t)s(t,n)&&this.field(e,t[n]);return this}if(null==t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=String(t)),n?this._getFormData().append(e,t,n):this._getFormData().append(e,t),this},a.prototype.abort=function(){if(this._aborted)return this;if(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req){if(r.gte(process.version,"v13.0.0")&&r.lt(process.version,"v14.0.0"))throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes");r.gte(process.version,"v14.0.0")&&(this.req.destroyed=!0),this.req.abort()}return this.clearTimeout(),this.emit("abort"),this},a.prototype._auth=function(e,t,n,r){switch(n.type){case"basic":this.set("Authorization",`Basic ${r(`${e}:${t}`)}`);break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization",`Bearer ${e}`)}return this},a.prototype.withCredentials=function(e){return void 0===e&&(e=!0),this._withCredentials=e,this},a.prototype.redirects=function(e){return this._maxRedirects=e,this},a.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw new TypeError("Invalid argument");return this._maxResponseSize=e,this},a.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},a.prototype.send=function(e){const t=i(e);let n=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(t&&i(this._data))for(const t in e)s(e,t)&&(this._data[t]=e[t]);else"string"==typeof e?(n||this.type("form"),n=this._header["content-type"],n&&(n=n.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===n?this._data?`${this._data}&${e}`:e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)||n||this.type("json"),this},a.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},a.prototype._finalizeQueryString=function(){const e=this._query.join("&");if(e&&(this.url+=(this.url.includes("?")?"&":"?")+e),this._query.length=0,this._sort){const e=this.url.indexOf("?");if(e>=0){const t=this.url.slice(e+1).split("&");"function"==typeof this._sort?t.sort(this._sort):t.sort(),this.url=this.url.slice(0,e)+"?"+t.join("&")}}},a.prototype._appendQueryString=()=>{console.warn("Unsupported")},a.prototype._timeoutError=function(e,t,n){if(this._aborted)return;const r=new Error(`${e+t}ms exceeded`);r.timeout=t,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.timedoutError=r,this.abort(),this.callback(r)},a.prototype._setTimeouts=function(){const e=this;this._timeout&&!this._timer&&(this._timer=setTimeout((()=>{e._timeoutError("Timeout of ",e._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((()=>{e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},253:(e,t,n)=>{"use strict";const r=n(244);function o(){}e.exports=o,o.prototype.get=function(e){return this.header[e.toLowerCase()]},o.prototype._setHeaderProperties=function(e){const t=e["content-type"]||"";this.type=r.type(t);const n=r.params(t);for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(this[e]=n[e]);this.links={};try{e.link&&(this.links=r.parseLinks(e.link))}catch(e){}},o.prototype._setStatusProperties=function(e){const t=Math.trunc(e/100);this.statusCode=e,this.status=this.statusCode,this.statusType=t,this.info=1===t,this.ok=2===t,this.redirect=3===t,this.clientError=4===t,this.serverError=5===t,this.error=(4===t||5===t)&&this.toError(),this.created=201===e,this.accepted=202===e,this.noContent=204===e,this.badRequest=400===e,this.unauthorized=401===e,this.notAcceptable=406===e,this.forbidden=403===e,this.notFound=404===e,this.unprocessableEntity=422===e}},244:(e,t)=>{"use strict";function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw s}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t.type=e=>e.split(/ *; */).shift(),t.params=e=>{const t={};var r,o=n(e.split(/ *; */));try{for(o.s();!(r=o.n()).done;){const e=r.value.split(/ *= */),n=e.shift(),o=e.shift();n&&o&&(t[n]=o)}}catch(e){o.e(e)}finally{o.f()}return t},t.parseLinks=e=>{const t={};var r,o=n(e.split(/ *, */));try{for(o.s();!(r=o.n()).done;){const e=r.value.split(/ *; */),n=e[0].slice(1,-1);t[e[1].split(/ *= */)[1].slice(1,-1)]=n}}catch(e){o.e(e)}finally{o.f()}return t},t.cleanHeader=(e,t)=>(delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e),t.isObject=e=>null!==e&&"object"==typeof e,t.hasOwn=Object.hasOwn||function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(new Object(e),t)},t.mixin=(e,n)=>{for(const r in n)t.hasOwn(n,r)&&(e[r]=n[r])}},905:e=>{e.exports=()=>()=>null},924:(e,t,n)=>{"use strict";var r=n(141),o=n(559),i=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&i(e,".prototype.")>-1?o(n):n}},559:(e,t,n)=>{"use strict";var r=n(612),o=n(141),i=o("%Function.prototype.apply%"),s=o("%Function.prototype.call%"),a=o("%Reflect.apply%",!0)||r.call(s,i),c=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=a(r,s,arguments);if(c&&l){var n=c(t,"length");n.configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var p=function(){return a(r,i,arguments)};l?l(e.exports,"apply",{value:p}):e.exports.apply=p},767:e=>{function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},t.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){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}},445:e=>{e.exports=s,s.default=s,s.stable=u,s.stableStringify=u;var t="[...]",n="[Circular]",r=[],o=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,n,s){var a;void 0===s&&(s=i()),c(e,"",0,[],void 0,0,s);try{a=0===o.length?JSON.stringify(e,t,n):JSON.stringify(e,d(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var l=r.pop();4===l.length?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return a}function a(e,t,n,i){var s=Object.getOwnPropertyDescriptor(i,n);void 0!==s.get?s.configurable?(Object.defineProperty(i,n,{value:e}),r.push([i,n,t,s])):o.push([t,n,e]):(i[n]=e,r.push([i,n,t]))}function c(e,r,o,i,s,l,u){var p;if(l+=1,"object"==typeof e&&null!==e){for(p=0;p<i.length;p++)if(i[p]===e)return void a(n,e,r,s);if(void 0!==u.depthLimit&&l>u.depthLimit)return void a(t,e,r,s);if(void 0!==u.edgesLimit&&o+1>u.edgesLimit)return void a(t,e,r,s);if(i.push(e),Array.isArray(e))for(p=0;p<e.length;p++)c(e[p],p,p,i,e,l,u);else{var d=Object.keys(e);for(p=0;p<d.length;p++){var f=d[p];c(e[f],f,p,i,e,l,u)}}i.pop()}}function l(e,t){return e<t?-1:e>t?1:0}function u(e,t,n,s){void 0===s&&(s=i());var a,c=p(e,"",0,[],void 0,0,s)||e;try{a=0===o.length?JSON.stringify(c,t,n):JSON.stringify(c,d(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var l=r.pop();4===l.length?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return a}function p(e,o,i,s,c,u,d){var f;if(u+=1,"object"==typeof e&&null!==e){for(f=0;f<s.length;f++)if(s[f]===e)return void a(n,e,o,c);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==d.depthLimit&&u>d.depthLimit)return void a(t,e,o,c);if(void 0!==d.edgesLimit&&i+1>d.edgesLimit)return void a(t,e,o,c);if(s.push(e),Array.isArray(e))for(f=0;f<e.length;f++)p(e[f],f,f,s,e,u,d);else{var h={},y=Object.keys(e).sort(l);for(f=0;f<y.length;f++){var b=y[f];p(e[b],b,f,s,e,u,d),h[b]=e[b]}if(void 0===c)return h;r.push([c,o,e]),c[o]=h}s.pop()}}function d(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(o.length>0)for(var r=0;r<o.length;r++){var i=o[r];if(i[1]===t&&i[0]===n){n=i[2],o.splice(r,1);break}}return e.call(this,t,n)}}},648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,r=Object.prototype.toString,o="[object Function]";e.exports=function(e){var i=this;if("function"!=typeof i||r.call(i)!==o)throw new TypeError(t+i);for(var s,a=n.call(arguments,1),c=function(){if(this instanceof s){var t=i.apply(this,a.concat(n.call(arguments)));return Object(t)===t?t:this}return i.apply(e,a.concat(n.call(arguments)))},l=Math.max(0,i.length-a.length),u=[],p=0;p<l;p++)u.push("$"+p);if(s=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(c),i.prototype){var d=function(){};d.prototype=i.prototype,s.prototype=new d,d.prototype=null}return s}},612:(e,t,n)=>{"use strict";var r=n(648);e.exports=Function.prototype.bind||r},141:(e,t,n)=>{"use strict";var r,o=SyntaxError,i=Function,s=TypeError,a=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var l=function(){throw new s},u=c?function(){try{return l}catch(e){try{return c(arguments,"callee").get}catch(e){return l}}}():l,p=n(405)(),d=Object.getPrototypeOf||function(e){return e.__proto__},f={},h="undefined"==typeof Uint8Array?r:d(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":p?d([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p?d(d([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p?d((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p?d((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p?d(""[Symbol.iterator]()):r,"%Symbol%":p?Symbol:r,"%SyntaxError%":o,"%ThrowTypeError%":u,"%TypedArray%":h,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},b=function e(t){var n;if("%AsyncFunction%"===t)n=a("async function () {}");else if("%GeneratorFunction%"===t)n=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=a("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=d(o.prototype))}return y[t]=n,n},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=n(612),g=n(642),w=v.call(Function.call,Array.prototype.concat),O=v.call(Function.apply,Array.prototype.splice),j=v.call(Function.call,String.prototype.replace),x=v.call(Function.call,String.prototype.slice),_=v.call(Function.call,RegExp.prototype.exec),S=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,C=/\\(\\)?/g,E=function(e){var t=x(e,0,1),n=x(e,-1);if("%"===t&&"%"!==n)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var r=[];return j(e,S,(function(e,t,n,o){r[r.length]=n?j(o,C,"$1"):t||e})),r},P=function(e,t){var n,r=e;if(g(m,r)&&(r="%"+(n=m[r])[0]+"%"),g(y,r)){var i=y[r];if(i===f&&(i=b(r)),void 0===i&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===_(/^%?[^%]*%?$/,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=E(e),r=n.length>0?n[0]:"",i=P("%"+r+"%",t),a=i.name,l=i.value,u=!1,p=i.alias;p&&(r=p[0],O(n,w([0,1],p)));for(var d=1,f=!0;d<n.length;d+=1){var h=n[d],b=x(h,0,1),m=x(h,-1);if(('"'===b||"'"===b||"`"===b||'"'===m||"'"===m||"`"===m)&&b!==m)throw new o("property names with quotes must have matching quotes");if("constructor"!==h&&f||(u=!0),g(y,a="%"+(r+="."+h)+"%"))l=y[a];else if(null!=l){if(!(h in l)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&d+1>=n.length){var v=c(l,h);l=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:l[h]}else f=g(l,h),l=l[h];f&&!u&&(y[a]=l)}}return l}},405:(e,t,n)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(419);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},642:(e,t,n)=>{"use strict";var r=n(612);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},679:(e,t,n)=>{"use strict";var r=n(864),o={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,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function c(e){return r.isMemo(e)?s:a[e.$$typeof]||o}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=s;var l=Object.defineProperty,u=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=f(n);o&&o!==h&&e(t,o,r)}var s=u(n);p&&(s=s.concat(p(n)));for(var a=c(t),y=c(n),b=0;b<s.length;++b){var m=s[b];if(!(i[m]||r&&r[m]||y&&y[m]||a&&a[m])){var v=d(n,m);try{l(t,m,v)}catch(e){}}}}return t}},554:e=>{e.exports=function(e){var t={},n=[];(e=e||this).on=function(n,r,o){return(t[n]=t[n]||[]).push([r,o]),e},e.off=function(r,o){r||(t={});for(var i=t[r]||n,s=i.length=o?i.length:0;s--;)o==i[s][0]&&i.splice(s,1);return e},e.emit=function(r){for(var o,i=t[r]||n,s=i.length>0?i.slice(0,i.length):i,a=0;o=s[a++];)o[0].apply(o[1],n.slice.call(arguments,1));return e}}},631:(e,t,n)=>{var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"==typeof o.get?o.get:null,s=r&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=a&&c&&"function"==typeof c.get?c.get:null,u=a&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,y=Object.prototype.toString,b=Function.prototype.toString,m=String.prototype.match,v=String.prototype.slice,g=String.prototype.replace,w=String.prototype.toUpperCase,O=String.prototype.toLowerCase,j=RegExp.prototype.test,x=Array.prototype.concat,_=Array.prototype.join,S=Array.prototype.slice,C=Math.floor,E="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,k="function"==typeof Symbol&&"object"==typeof Symbol.iterator,A="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,I=Object.prototype.propertyIsEnumerable,N=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function R(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||j.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-C(-e):C(e);if(r!==e){var o=String(r),i=v.call(t,o.length+1);return g.call(o,n,"$&_")+"."+g.call(g.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return g.call(t,n,"$&_")}var D=n(654),M=D.custom,L=z(M)?M:null;function U(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function F(e){return g.call(String(e),/"/g,"&quot;")}function B(e){return!("[object Array]"!==q(e)||A&&"object"==typeof e&&A in e)}function $(e){return!("[object RegExp]"!==q(e)||A&&"object"==typeof e&&A in e)}function z(e){if(k)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!T)return!1;try{return T.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,r,o){var a=n||{};if(V(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!V(a,"customInspect")||a.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var y=a.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return G(t,a);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return y?R(t,w):w}if("bigint"==typeof t){var j=String(t)+"n";return y?R(t,j):j}var C=void 0===a.depth?5:a.depth;if(void 0===r&&(r=0),r>=C&&C>0&&"object"==typeof t)return B(t)?"[Array]":"[Object]";var P,M=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=_.call(Array(e.indent+1)," ")}return{base:n,prev:_.call(Array(t+1),n)}}(a,r);if(void 0===o)o=[];else if(W(o,t)>=0)return"[Circular]";function H(t,n,i){if(n&&(o=S.call(o)).push(n),i){var s={depth:a.depth};return V(a,"quoteStyle")&&(s.quoteStyle=a.quoteStyle),e(t,s,r+1,o)}return e(t,a,r+1,o)}if("function"==typeof t&&!$(t)){var K=function(e){if(e.name)return e.name;var t=m.call(b.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ee=Z(t,H);return"[Function"+(K?": "+K:" (anonymous)")+"]"+(ee.length>0?" { "+_.call(ee,", ")+" }":"")}if(z(t)){var te=k?g.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):T.call(t);return"object"!=typeof t||k?te:J(te)}if((P=t)&&"object"==typeof P&&("undefined"!=typeof HTMLElement&&P instanceof HTMLElement||"string"==typeof P.nodeName&&"function"==typeof P.getAttribute)){for(var ne="<"+O.call(String(t.nodeName)),re=t.attributes||[],oe=0;oe<re.length;oe++)ne+=" "+re[oe].name+"="+U(F(re[oe].value),"double",a);return ne+=">",t.childNodes&&t.childNodes.length&&(ne+="..."),ne+"</"+O.call(String(t.nodeName))+">"}if(B(t)){if(0===t.length)return"[]";var ie=Z(t,H);return M&&!function(e){for(var t=0;t<e.length;t++)if(W(e[t],"\n")>=0)return!1;return!0}(ie)?"["+Y(ie,M)+"]":"[ "+_.call(ie,", ")+" ]"}if(function(e){return!("[object Error]"!==q(e)||A&&"object"==typeof e&&A in e)}(t)){var se=Z(t,H);return"cause"in Error.prototype||!("cause"in t)||I.call(t,"cause")?0===se.length?"["+String(t)+"]":"{ ["+String(t)+"] "+_.call(se,", ")+" }":"{ ["+String(t)+"] "+_.call(x.call("[cause]: "+H(t.cause),se),", ")+" }"}if("object"==typeof t&&c){if(L&&"function"==typeof t[L]&&D)return D(t,{depth:C-r});if("symbol"!==c&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{l.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ae=[];return s.call(t,(function(e,n){ae.push(H(n,t,!0)+" => "+H(e,t))})),Q("Map",i.call(t),ae,M)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ce=[];return u.call(t,(function(e){ce.push(H(e,t))})),Q("Set",l.call(t),ce,M)}if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return X("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return X("WeakSet");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{return f.call(e),!0}catch(e){}return!1}(t))return X("WeakRef");if(function(e){return!("[object Number]"!==q(e)||A&&"object"==typeof e&&A in e)}(t))return J(H(Number(t)));if(function(e){if(!e||"object"!=typeof e||!E)return!1;try{return E.call(e),!0}catch(e){}return!1}(t))return J(H(E.call(t)));if(function(e){return!("[object Boolean]"!==q(e)||A&&"object"==typeof e&&A in e)}(t))return J(h.call(t));if(function(e){return!("[object String]"!==q(e)||A&&"object"==typeof e&&A in e)}(t))return J(H(String(t)));if(!function(e){return!("[object Date]"!==q(e)||A&&"object"==typeof e&&A in e)}(t)&&!$(t)){var le=Z(t,H),ue=N?N(t)===Object.prototype:t instanceof Object||t.constructor===Object,pe=t instanceof Object?"":"null prototype",de=!ue&&A&&Object(t)===t&&A in t?v.call(q(t),8,-1):pe?"Object":"",fe=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(de||pe?"["+_.call(x.call([],de||[],pe||[]),": ")+"] ":"");return 0===le.length?fe+"{}":M?fe+"{"+Y(le,M)+"}":fe+"{ "+_.call(le,", ")+" }"}return String(t)};var H=Object.prototype.hasOwnProperty||function(e){return e in this};function V(e,t){return H.call(e,t)}function q(e){return y.call(e)}function W(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function G(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return G(v.call(e,0,t.maxStringLength),t)+r}return U(g.call(g.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,K),"single",t)}function K(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function J(e){return"Object("+e+")"}function X(e){return e+" { ? }"}function Q(e,t,n,r){return e+" ("+t+") {"+(r?Y(n,r):_.call(n,", "))+"}"}function Y(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+_.call(e,","+n)+"\n"+t.prev}function Z(e,t){var n=B(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=V(e,o)?t(e[o],e):""}var i,s="function"==typeof P?P(e):[];if(k){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var c in e)V(e,c)&&(n&&String(Number(c))===c&&c<e.length||k&&i["$"+c]instanceof Symbol||(j.call(/[^\w$]/,c)?r.push(t(c,e)+": "+t(e[c],e)):r.push(c+": "+t(e[c],e))));if("function"==typeof P)for(var l=0;l<s.length;l++)I.call(e,s[l])&&r.push("["+t(s[l])+"]: "+t(e[s[l]],e));return r}},661:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>y,Component:()=>r.Component,Fragment:()=>r.Fragment,PureComponent:()=>l,StrictMode:()=>Q,Suspense:()=>w,SuspenseList:()=>x,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>z,cloneElement:()=>W,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>V,createPortal:()=>E,createRef:()=>r.createRef,default:()=>re,findDOMNode:()=>K,flushSync:()=>X,forwardRef:()=>f,hydrate:()=>N,isValidElement:()=>q,lazy:()=>j,memo:()=>u,render:()=>I,startTransition:()=>Y,unmountComponentAtNode:()=>G,unstable_batchedUpdates:()=>J,useDeferredValue:()=>Z,useInsertionEffect:()=>te,useSyncExternalStore:()=>ne,useTransition:()=>ee,version:()=>H});var r=n(210),o=n(207),i={};for(const e in o)["default","Component","Fragment","createContext","createElement","createRef","Children","PureComponent","StrictMode","Suspense","SuspenseList","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","cloneElement","createFactory","createPortal","findDOMNode","flushSync","forwardRef","hydrate","isValidElement","lazy","memo","render","startTransition","unmountComponentAtNode","unstable_batchedUpdates","useDeferredValue","useInsertionEffect","useSyncExternalStore","useTransition","version"].indexOf(e)<0&&(i[e]=()=>o[e]);function s(e,t){for(var n in t)e[n]=t[n];return e}function a(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function c(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}function l(e){this.props=e}function u(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:a(this.props,e)}function o(t){return this.shouldComponentUpdate=n,(0,r.createElement)(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}n.d(t,i),(l.prototype=new r.Component).isPureReactComponent=!0,l.prototype.shouldComponentUpdate=function(e,t){return a(this.props,e)||a(this.state,t)};var p=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),p&&p(e)};var d="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function f(e){function t(t){var n=s({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=d,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var h=function(e,t){return null==e?null:(0,r.toChildArray)((0,r.toChildArray)(e).map(t))},y={map:h,forEach:h,count:function(e){return e?(0,r.toChildArray)(e).length:0},only:function(e){var t=(0,r.toChildArray)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.toChildArray},b=r.options.__e;r.options.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);b(e,t,n,r)};var m=r.options.unmount;function v(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=s({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return v(e,t,n)}))),e}function g(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return g(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function w(){this.__u=0,this.t=null,this.__b=null}function O(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function j(e){var t,n,o;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){o=e})),o)throw o;if(!n)throw t;return(0,r.createElement)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function x(){this.u=null,this.o=null}r.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),m&&m(e)},(w.prototype=new r.Component).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=O(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(a):a())};n.__R=s;var a=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=g(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},w.prototype.componentWillUnmount=function(){this.t=[]},w.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=v(this.__b,n,o.__O=o.__P)}this.__b=null}var i=t.__a&&(0,r.createElement)(r.Fragment,null,e.fallback);return i&&(i.__h=null),[(0,r.createElement)(r.Fragment,null,t.__a?null:e.children),i]};var _=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function S(e){return this.getChildContext=function(){return e.context},e.children}function C(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,r.render)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,r.render)((0,r.createElement)(S,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function E(e,t){var n=(0,r.createElement)(C,{__v:e,i:t});return n.containerInfo=t,n}(x.prototype=new r.Component).__a=function(e){var t=this,n=O(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),_(t,e,r)):o()};n?n(i):i()}},x.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,r.toChildArray)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},x.prototype.componentDidUpdate=x.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){_(e,n,t)}))};var P="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,T=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,k="undefined"!=typeof document,A=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};function I(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function N(e,t,n){return(0,r.hydrate)(e,t),"function"==typeof n&&n(),e?e.__c:null}r.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(r.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var R=r.options.event;function D(){}function M(){return this.cancelBubble}function L(){return this.defaultPrevented}r.options.event=function(e){return R&&(e=R(e)),e.persist=D,e.isPropagationStopped=M,e.isDefaultPrevented=L,e.nativeEvent=e};var U,F={configurable:!0,get:function(){return this.class}},B=r.options.vnode;r.options.vnode=function(e){var t=e.type,n=e.props,o=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var s in o={},n){var a=n[s];k&&"children"===s&&"noscript"===t||"value"===s&&"defaultValue"in n&&null==a||("defaultValue"===s&&"value"in n&&null==n.value?s="value":"download"===s&&!0===a?a="":/ondoubleclick/i.test(s)?s="ondblclick":/^onchange(textarea|input)/i.test(s+t)&&!A(n.type)?s="oninput":/^onfocus$/i.test(s)?s="onfocusin":/^onblur$/i.test(s)?s="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(s)?s=s.toLowerCase():i&&T.test(s)?s=s.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===a&&(a=void 0),/^oninput$/i.test(s)&&(s=s.toLowerCase(),o[s]&&(s="oninputCapture")),o[s]=a)}"select"==t&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,r.toChildArray)(n.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==t&&null!=o.defaultValue&&(o.value=(0,r.toChildArray)(n.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),e.props=o,n.class!=n.className&&(F.enumerable="className"in n,null!=n.className&&(o.class=n.className),Object.defineProperty(o,"className",F))}e.$$typeof=P,B&&B(e)};var $=r.options.__r;r.options.__r=function(e){$&&$(e),U=e.__c};var z={ReactCurrentDispatcher:{current:{readContext:function(e){return U.__n[e.__c].props.value}}}},H="17.0.2";function V(e){return r.createElement.bind(null,e)}function q(e){return!!e&&e.$$typeof===P}function W(e){return q(e)?r.cloneElement.apply(null,arguments):e}function G(e){return!!e.__k&&((0,r.render)(null,e),!0)}function K(e){return e&&(e.base||1===e.nodeType&&e)||null}var J=function(e,t){return e(t)},X=function(e,t){return e(t)},Q=r.Fragment;function Y(e){e()}function Z(e){return e}function ee(){return[!1,Y]}var te=o.useLayoutEffect;function ne(e,t){var n=t(),r=(0,o.useState)({h:{__:n,v:t}}),i=r[0].h,s=r[1];return(0,o.useLayoutEffect)((function(){i.__=n,i.v=t,c(i.__,t())||s({h:i})}),[e,n,t]),(0,o.useEffect)((function(){return c(i.__,i.v())||s({h:i}),e((function(){c(i.__,i.v())||s({h:i})}))}),[e]),n}var re={useState:o.useState,useId:o.useId,useReducer:o.useReducer,useEffect:o.useEffect,useLayoutEffect:o.useLayoutEffect,useInsertionEffect:te,useTransition:ee,useDeferredValue:Z,useSyncExternalStore:ne,startTransition:Y,useRef:o.useRef,useImperativeHandle:o.useImperativeHandle,useMemo:o.useMemo,useCallback:o.useCallback,useContext:o.useContext,useDebugValue:o.useDebugValue,version:"17.0.2",Children:y,render:I,hydrate:N,unmountComponentAtNode:G,createPortal:E,createElement:r.createElement,createContext:r.createContext,createFactory:V,cloneElement:W,createRef:r.createRef,Fragment:r.Fragment,isValidElement:q,findDOMNode:K,Component:r.Component,PureComponent:l,memo:u,forwardRef:f,flushSync:X,unstable_batchedUpdates:J,StrictMode:Q,Suspense:w,SuspenseList:x,lazy:j,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:z}},569:e=>{"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC3986";e.exports={default:r,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:r}},129:(e,t,n)=>{"use strict";var r=n(261),o=n(235),i=n(569);e.exports={formats:i,parse:o,stringify:r}},235:(e,t,n)=>{"use strict";var r=n(769),o=Object.prototype.hasOwnProperty,i=Array.isArray,s={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/g,a=n.depth>0&&/(\[[^[\]]*])/.exec(i),l=a?i.slice(0,a.index):i,u=[];if(l){if(!n.plainObjects&&o.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var p=0;n.depth>0&&null!==(a=s.exec(i))&&p<n.depth;){if(p+=1,!n.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(a[1])}return a&&u.push("["+i.slice(a.index)+"]"),function(e,t,n,r){for(var o=r?t:c(t,n),i=e.length-1;i>=0;--i){var s,a=e[i];if("[]"===a&&n.parseArrays)s=[].concat(o);else{s=n.plainObjects?Object.create(null):{};var l="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&a!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(s=[])[u]=o:"__proto__"!==l&&(s[l]=o):s={0:o}}o=s}return o}(u,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return s;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?s.charset:e.charset;return{allowDots:void 0===e.allowDots?s.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:s.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var n,l={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,p=t.parameterLimit===1/0?void 0:t.parameterLimit,d=u.split(t.delimiter,p),f=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n<d.length;++n)0===d[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===d[n]?h="utf-8":"utf8=%26%2310003%3B"===d[n]&&(h="iso-8859-1"),f=n,n=d.length);for(n=0;n<d.length;++n)if(n!==f){var y,b,m=d[n],v=m.indexOf("]="),g=-1===v?m.indexOf("="):v+1;-1===g?(y=t.decoder(m,s.decoder,h,"key"),b=t.strictNullHandling?null:""):(y=t.decoder(m.slice(0,g),s.decoder,h,"key"),b=r.maybeMap(c(m.slice(g+1),t),(function(e){return t.decoder(e,s.decoder,h,"value")}))),b&&t.interpretNumericEntities&&"iso-8859-1"===h&&(b=a(b)),m.indexOf("[]=")>-1&&(b=i(b)?[b]:b),o.call(l,y)?l[y]=r.combine(l[y],b):l[y]=b}return l}(e,n):e,p=n.plainObjects?Object.create(null):{},d=Object.keys(u),f=0;f<d.length;++f){var h=d[f],y=l(h,u[h],n,"string"==typeof e);p=r.merge(p,y,n)}return!0===n.allowSparse?p:r.compact(p)}},261:(e,t,n)=>{"use strict";var r=n(478),o=n(769),i=n(569),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,l=String.prototype.split,u=Array.prototype.push,p=function(e,t){u.apply(e,c(t)?t:[t])},d=Date.prototype.toISOString,f=i.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:f,formatter:i.formatters[f],indices:!1,serializeDate:function(e){return d.call(e)},skipNulls:!1,strictNullHandling:!1},y={},b=function e(t,n,i,s,a,u,d,f,b,m,v,g,w,O,j,x){for(var _,S=t,C=x,E=0,P=!1;void 0!==(C=C.get(y))&&!P;){var T=C.get(t);if(E+=1,void 0!==T){if(T===E)throw new RangeError("Cyclic object value");P=!0}void 0===C.get(y)&&(E=0)}if("function"==typeof f?S=f(n,S):S instanceof Date?S=v(S):"comma"===i&&c(S)&&(S=o.maybeMap(S,(function(e){return e instanceof Date?v(e):e}))),null===S){if(a)return d&&!O?d(n,h.encoder,j,"key",g):n;S=""}if("string"==typeof(_=S)||"number"==typeof _||"boolean"==typeof _||"symbol"==typeof _||"bigint"==typeof _||o.isBuffer(S)){if(d){var k=O?n:d(n,h.encoder,j,"key",g);if("comma"===i&&O){for(var A=l.call(String(S),","),I="",N=0;N<A.length;++N)I+=(0===N?"":",")+w(d(A[N],h.encoder,j,"value",g));return[w(k)+(s&&c(S)&&1===A.length?"[]":"")+"="+I]}return[w(k)+"="+w(d(S,h.encoder,j,"value",g))]}return[w(n)+"="+w(String(S))]}var R,D=[];if(void 0===S)return D;if("comma"===i&&c(S))R=[{value:S.length>0?S.join(",")||null:void 0}];else if(c(f))R=f;else{var M=Object.keys(S);R=b?M.sort(b):M}for(var L=s&&c(S)&&1===S.length?n+"[]":n,U=0;U<R.length;++U){var F=R[U],B="object"==typeof F&&void 0!==F.value?F.value:S[F];if(!u||null!==B){var $=c(S)?"function"==typeof i?i(L,F):L:L+(m?"."+F:"["+F+"]");x.set(t,E);var z=r();z.set(y,x),p(D,e(B,$,i,s,a,u,d,f,b,m,v,g,w,O,j,z))}}return D};e.exports=function(e,t){var n,o=e,l=function(e){if(!e)return h;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=i.default;if(void 0!==e.format){if(!s.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=i.formatters[n],o=h.filter;return("function"==typeof e.filter||c(e.filter))&&(o=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:void 0===e.allowDots?h.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:h.encode,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:o,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"==typeof l.filter?o=(0,l.filter)("",o):c(l.filter)&&(n=l.filter);var u,d=[];if("object"!=typeof o||null===o)return"";u=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var f=a[u];if(t&&"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var y="comma"===f&&t&&t.commaRoundTrip;n||(n=Object.keys(o)),l.sort&&n.sort(l.sort);for(var m=r(),v=0;v<n.length;++v){var g=n[v];l.skipNulls&&null===o[g]||p(d,b(o[g],g,f,y,l.strictNullHandling,l.skipNulls,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.format,l.formatter,l.encodeValuesOnly,l.charset,m))}var w=d.join(l.delimiter),O=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?O+="utf8=%26%2310003%3B&":O+="utf8=%E2%9C%93&"),w.length>0?O+w:""}},769:(e,t,n)=>{"use strict";var r=n(569),o=Object.prototype.hasOwnProperty,i=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],s=o.obj[o.prop],a=Object.keys(s),c=0;c<a.length;++c){var l=a[c],u=s[l];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:s,prop:l}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,o,i){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===n)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var c="",l=0;l<a.length;++l){var u=a.charCodeAt(l);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===r.RFC1738&&(40===u||41===u)?c+=a.charAt(l):u<128?c+=s[u]:u<2048?c+=s[192|u>>6]+s[128|63&u]:u<55296||u>=57344?c+=s[224|u>>12]+s[128|u>>6&63]+s[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&a.charCodeAt(l)),c+=s[240|u>>18]+s[128|u>>12&63]+s[128|u>>6&63]+s[128|63&u])}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(i(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!o.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var s=t;return i(t)&&!i(n)&&(s=a(t,r)),i(t)&&i(n)?(n.forEach((function(n,i){if(o.call(t,i)){var s=t[i];s&&"object"==typeof s&&n&&"object"==typeof n?t[i]=e(s,n,r):t.push(n)}else t[i]=n})),t):Object.keys(n).reduce((function(t,i){var s=n[i];return o.call(t,i)?t[i]=e(t[i],s,r):t[i]=s,t}),s)}}},921:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,y=n?Symbol.for("react.memo"):60115,b=n?Symbol.for("react.lazy"):60116,m=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,g=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function O(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case p:case i:case a:case s:case f:return e;default:switch(e=e&&e.$$typeof){case l:case d:case b:case y:case c:return e;default:return t}}case o:return t}}}function j(e){return O(e)===p}t.AsyncMode=u,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=c,t.Element=r,t.ForwardRef=d,t.Fragment=i,t.Lazy=b,t.Memo=y,t.Portal=o,t.Profiler=a,t.StrictMode=s,t.Suspense=f,t.isAsyncMode=function(e){return j(e)||O(e)===u},t.isConcurrentMode=j,t.isContextConsumer=function(e){return O(e)===l},t.isContextProvider=function(e){return O(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return O(e)===d},t.isFragment=function(e){return O(e)===i},t.isLazy=function(e){return O(e)===b},t.isMemo=function(e){return O(e)===y},t.isPortal=function(e){return O(e)===o},t.isProfiler=function(e){return O(e)===a},t.isStrictMode=function(e){return O(e)===s},t.isSuspense=function(e){return O(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===a||e===s||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===y||e.$$typeof===c||e.$$typeof===l||e.$$typeof===d||e.$$typeof===v||e.$$typeof===g||e.$$typeof===w||e.$$typeof===m)},t.typeOf=O},864:(e,t,n)=>{"use strict";e.exports=n(921)},359:(e,t)=>{"use strict";Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen");Symbol.for("react.module.reference")},973:(e,t,n)=>{"use strict";n(359)},478:(e,t,n)=>{"use strict";var r=n(141),o=n(924),i=n(631),s=r("%TypeError%"),a=r("%WeakMap%",!0),c=r("%Map%",!0),l=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),p=o("WeakMap.prototype.has",!0),d=o("Map.prototype.get",!0),f=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),y=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n};e.exports=function(){var e,t,n,r={assert:function(e){if(!r.has(e))throw new s("Side channel does not contain "+i(e))},get:function(r){if(a&&r&&("object"==typeof r||"function"==typeof r)){if(e)return l(e,r)}else if(c){if(t)return d(t,r)}else if(n)return function(e,t){var n=y(e,t);return n&&n.value}(n,r)},has:function(r){if(a&&r&&("object"==typeof r||"function"==typeof r)){if(e)return p(e,r)}else if(c){if(t)return h(t,r)}else if(n)return function(e,t){return!!y(e,t)}(n,r);return!1},set:function(r,o){a&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new a),u(e,r,o)):c?(t||(t=new c),f(t,r,o)):(n||(n={key:{},next:null}),function(e,t,n){var r=y(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,r,o))}};return r}},250:(e,t,n)=>{"use strict";var r=n(661),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,a=r.useLayoutEffect,c=r.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return a((function(){o.value=n,o.getSnapshot=t,l(o)&&u({inst:o})}),[e,n,t]),s((function(){return l(o)&&u({inst:o}),e((function(){l(o)&&u({inst:o})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},139:(e,t,n)=>{"use strict";var r=n(661),o=n(688),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=o.useSyncExternalStore,a=r.useRef,c=r.useEffect,l=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var p=a(null);if(null===p.current){var d={hasValue:!1,value:null};p.current=d}else d=p.current;p=l((function(){function e(e){if(!c){if(c=!0,s=e,e=r(e),void 0!==o&&d.hasValue){var t=d.value;if(o(t,e))return a=t}return a=e}if(t=a,i(s,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(s=e,a=n)}var s,a,c=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]}),[t,n,r,o]);var f=s(e,p[0],p[1]);return c((function(){d.hasValue=!0,d.value=f}),[f]),u(f),f}},688:(e,t,n)=>{"use strict";e.exports=n(250)},798:(e,t,n)=>{"use strict";e.exports=n(139)},210:e=>{"use strict";e.exports=require("preact")},207:e=>{"use strict";e.exports=require("preact/hooks")},654:()=>{},695:()=>{}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{Engine:()=>fp,ExternalApi:()=>gp,calculateVisibility:()=>_,className:()=>P,eventTypes:()=>e,getSearchParamsByKeys:()=>wp,initResetSearchParams:()=>jp,randomId:()=>K,replaceSearchParams:()=>Op});const e={info:"info",message:"message",participant:"participant",system:"system"},t="text",o="text",i="upload",s="received",a="read",c="custom",l="typing",u="read",p="detach_service",d="dismiss",f="set_topic",h="set_translation",y="click_cta",b="translation_proposal",m="assertive",v="polite",g={new_topic:"newTopic",new_translation:"newTranslation"},w="uploads",O="navigate",j="visibility",x={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},_=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:o,layoutMode:i,hideOnNoUserResponse:s}=r,{visible:a}=o||{};return"app"!==i||t?"window"===i&&s&&n!==x.open?e?n||t||x.open:x.hidden:"inline"===i&&e&&!n?t||x.open:n||t||a||x.minimized:x.open},S="cvco",C="2",E="seamly-client-participant",P=(...e)=>e.flat().map((e=>"object"==typeof e?Object.entries(e).map((([e,t])=>t?e:"")).join(" "):e)).filter((e=>"string"==typeof e)).map((e=>e.split(" "))).flat().filter((e=>e.length)).map((e=>e.indexOf(S)>-1?e:[S,e].join("-"))).join(" "),T=require("preact/jsx-runtime");var k=n(766),A=n.n(k);class I extends Error{action="";langKey="";constructor(e,...t){if(super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Object.getPrototypeOf(this)),this.originalError=e,e?.payload&&(this.originalEvent=e,this.originalError=e.payload.error,this.message=`Event of type ${e.payload.type} encountered`),!this.message&&e?.message){const t=function(e){try{return JSON.parse(e).error}catch(t){return e}}(e.message);this.message=t}e?.error&&(this.originalError=e.error)}}class N extends I{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class R extends I{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class D extends I{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class M extends I{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}const L=(e,t)=>{let n;return function(...r){let o=!1;return clearTimeout(n),n=setTimeout((()=>{n=null,o||e.apply(this,r),o=!1}),t),t=>{o=!0,t&&e.apply(this,r)}}},U=e=>Math.ceil(e/1e3),F=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},B=(e,t=2)=>{if(0===e)return"0 Bytes";const n=t<0?0:t,r=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**r).toFixed(n))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`},$={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},z={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},H=e=>e.code?z[e.code]:$[e.keyCode],V=e=>{e&&e.focus()},q=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};var W=n(905),G=n.n(W);function K(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}function J(e){const t=`cvco.${e}`;return{get(){const e=[t,t.split(".").slice(0,-1).join(".")];let n;do{n=sessionStorage.getItem(e[0])}while(e.shift()&&!n);return JSON.parse(n)},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}var X=e=>"function"==typeof e?e:function(){return e},Q="undefined"!=typeof self?self:null,Y="undefined"!=typeof window?window:null,Z=Q||Y||Z,ee="closed",te="errored",ne="joined",re="joining",oe="leaving",ie="phx_close",se="phx_error",ae="phx_reply",ce="phx_leave",le=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter((t=>t.status===e)).forEach((e=>e.callback(t)))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,(e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)})),this.timeoutTimer=setTimeout((()=>{this.trigger("timeout",{})}),this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},ue=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout((()=>{this.tries=this.tries+1,this.callback()}),this.timerCalc(this.tries+1))}},pe=class{static request(e,t,n,r,o,i,s){if(Z.XDomainRequest){let n=new Z.XDomainRequest;return this.xdomainRequest(n,e,t,r,o,i,s)}{let a=new Z.XMLHttpRequest;return this.xhrRequest(a,e,t,n,r,o,i,s)}}static xdomainRequest(e,t,n,r,o,i,s){return e.timeout=o,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);s&&s(t)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,o,i,s,a){return e.open(t,n,!0),e.timeout=i,e.setRequestHeader("Content-Type",r),e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(4===e.readyState&&a){let t=this.parseJSON(e.responseText);a(t)}},s&&(e.ontimeout=s),e.send(o),e}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch(t){return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let o=t?`${t}[${r}]`:r,i=e[r];"object"==typeof i?n.push(this.serialize(i,o)):n.push(encodeURIComponent(o)+"="+encodeURIComponent(i))}return n.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},de=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,this.poll()}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/websocket"),"$1/longpoll")}endpointURL(){return pe.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=0}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return 1===this.readyState||0===this.readyState}poll(){this.ajax("GET",null,(()=>this.ontimeout()),(e=>{if(e){var{status:t,token:n,messages:r}=e;this.token=n}else t=0;switch(t){case 200:r.forEach((e=>{setTimeout((()=>this.onmessage({data:e})),0)})),this.poll();break;case 204:this.poll();break;case 410:this.readyState=1,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}}))}send(e){this.ajax("POST",e,(()=>this.onerror("timeout")),(e=>{e&&200===e.status||(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1))}))}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=3;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});"undefined"!=typeof CloseEvent?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r){let o;o=pe.request(e,this.endpointURL(),"application/json",t,this.timeout,(()=>{this.reqs.delete(o),n()}),(e=>{this.reqs.delete(o),this.isActive()&&r(e)})),this.reqs.add(o)}},fe={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,o,i,s]=JSON.parse(e);return t({join_ref:n,ref:r,topic:o,event:i,payload:s})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:o,payload:i}=e,s=this.META_LENGTH+t.length+n.length+o.length+r.length,a=new ArrayBuffer(this.HEADER_LENGTH+s),c=new DataView(a),l=0;c.setUint8(l++,this.KINDS.push),c.setUint8(l++,t.length),c.setUint8(l++,n.length),c.setUint8(l++,o.length),c.setUint8(l++,r.length),Array.from(t,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(n,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(o,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(r,(e=>c.setUint8(l++,e.charCodeAt(0))));var u=new Uint8Array(a.byteLength+i.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(i),a.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),s=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(e.slice(s,s+r));s+=r;let c=n.decode(e.slice(s,s+o));s+=o;let l=n.decode(e.slice(s,s+i));return s+=i,{join_ref:a,ref:null,topic:c,event:l,payload:e.slice(s,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),s=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(a,a+r));a+=r;let l=n.decode(e.slice(a,a+o));a+=o;let u=n.decode(e.slice(a,a+i));a+=i;let p=n.decode(e.slice(a,a+s));a+=s;let d=e.slice(a,e.byteLength);return{join_ref:c,ref:l,topic:u,event:ae,payload:{status:p,response:d}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=this.HEADER_LENGTH+2,s=n.decode(e.slice(i,i+r));i+=r;let a=n.decode(e.slice(i,i+o));return i+=o,{join_ref:null,ref:null,topic:s,event:a,payload:e.slice(i,e.byteLength)}}};function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ye(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?he(Object(n),!0).forEach((function(t){be(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):he(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var me,ve,ge,we,Oe=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};const je=G()("seamly");class xe{constructor(){me.add(this),ve.set(this,[])}connect(e,t,n,r){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){this.url=e,this.accessToken=r,this.channelName=t,this.channelTopic=n;const{url:o,params:i}=(e=>{const t=e.indexOf("?");return t<0?{url:e,params:{}}:{url:e.slice(0,t),params:e.slice(t+1).split("&").reduce((function(e,t){const[n,r]=t.split("=");return ye(ye({},e),{},{[n]:decodeURIComponent(r)})}),{})}})(this.url);this.socket=new class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||1e4,this.transport=t.transport||Z.WebSocket||de,this.establishedConnections=0,this.defaultEncoder=fe.encode.bind(fe),this.defaultDecoder=fe.decode.bind(fe),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==de?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Y&&Y.addEventListener&&(Y.addEventListener("pagehide",(e=>{this.conn&&(this.disconnect(),n=this.connectClock)})),Y.addEventListener("pageshow",(e=>{n===this.connectClock&&(n=null,this.connect())}))),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=X(t.params||{}),this.endPoint=`${e}/websocket`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new ue((()=>{this.teardown((()=>this.connect()))}),this.reconnectAfterMs)}getLongPollTransport(){return de}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.sendBuffer=[],this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=pe.appendParams(pe.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.teardown(e,t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=X(e)),this.conn||(this.connectClock++,this.closeWasClean=!1,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e))}log(e,t,n){this.logger(e,t,n)}hasLogger(){return null!==this.logger}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage((o=>{o.ref===t&&(this.off([r]),e(Date.now()-n))}));return!0}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach((([,e])=>e()))}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown((()=>this.reconnectTimer.scheduleTimeout()),1e3,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();this.waitForBufferDone((()=>{this.conn&&(t?this.conn.close(t,n||""):this.conn.close()),this.waitForSocketClosed((()=>{this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()}))}))}waitForBufferDone(e,t=1){5!==t&&this.conn&&this.conn.bufferedAmount?setTimeout((()=>{this.waitForBufferDone(e,t+1)}),150*t):e()}waitForSocketClosed(e,t=1){5!==t&&this.conn&&3!==this.conn.readyState?setTimeout((()=>{this.waitForSocketClosed(e,t+1)}),150*t):e()}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||1e3===t||this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach((([,t])=>t(e)))}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach((([,r])=>{r(e,t,n)})),(t===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach((e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(se)}))}connectionState(){switch(this.conn&&this.conn.readyState){case 0:return"connecting";case 1:return"open";case 2:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter((t=>t.joinRef()!==e.joinRef()))}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter((([t])=>-1===e.indexOf(t)))}channel(e,t={}){let n=new class{constructor(e,t,n){this.state=ee,this.topic=e,this.params=X(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new le(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new ue((()=>{this.socket.isConnected()&&this.rejoin()}),this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError((()=>this.rejoinTimer.reset()))),this.stateChangeRefs.push(this.socket.onOpen((()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()}))),this.joinPush.receive("ok",(()=>{this.state=ne,this.rejoinTimer.reset(),this.pushBuffer.forEach((e=>e.send())),this.pushBuffer=[]})),this.joinPush.receive("error",(()=>{this.state=te,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.onClose((()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=ee,this.socket.remove(this)})),this.onError((e=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=te,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.joinPush.receive("timeout",(()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new le(this,ce,X({}),this.timeout).send(),this.state=te,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.on(ae,((e,t)=>{this.trigger(this.replyEventName(t),e)}))}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(e){this.on(ie,e)}onError(e){return this.on(se,(t=>e(t)))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter((n=>!(n.event===e&&(void 0===t||t===n.ref))))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new le(this,e,(function(){return t}),n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=oe;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(ie,"leave")},n=new le(this,ce,X({}),e);return n.receive("ok",(()=>t())).receive("timeout",(()=>t())),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}isMember(e,t,n,r){return!(this.topic!==e||r&&r!==this.joinRef()&&(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),1))}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=re,this.joinPush.resend(e))}trigger(e,t,n,r){let o=this.onMessage(e,t,n,r);if(t&&!o)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter((t=>t.event===e));for(let e=0;e<i.length;e++)i[e].callback(o,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===ee}isErrored(){return this.state===te}isJoined(){return this.state===ne}isJoining(){return this.state===re}isLeaving(){return this.state===oe}}(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:o,join_ref:i}=e;this.log("push",`${t} ${n} (${i}, ${o})`,r)}this.isConnected()?this.encode(e,(e=>this.conn.send(e))):this.sendBuffer.push((()=>this.encode(e,(e=>this.conn.send(e)))))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout((()=>this.heartbeatTimeout()),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach((e=>e())),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,(e=>{let{topic:t,event:n,payload:r,ref:o,join_ref:i}=e;o&&o===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${t} ${n} ${o&&"("+o+")"||""}`,r);for(let e=0;e<this.channels.length;e++){const s=this.channels[e];s.isMember(t,n,r,i)&&s.trigger(n,r,o,i)}for(let t=0;t<this.stateChangeCallbacks.message.length;t++){let[,n]=this.stateChangeCallbacks.message[t];n(e)}}))}leaveOpenTopic(e){let t=this.channels.find((t=>t.topic===e&&(t.isJoined()||t.isJoining())));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}}(o,{params:Object.assign(Object.assign({},i),{v:C})}),this.socket.connect(),this.channel=this.socket.channel(this.channelTopic,{authorization:`Bearer ${this.accessToken}`,channelName:this.channelName}),this.start(),this.socket.onError((e=>{je("[SOCKET][ERROR]",e)})),this.socket.onOpen((()=>{je("[SOCKET]OPEN")})),this.channel.on("system",(e=>{"attach_channel_succeeded"===e.type&&Oe(this,me,"m",we).call(this,{connected:!0,ready:!0,currentState:"attach_channel_succeeded"})})),this.socket.onClose((()=>{je("[SOCKET]CLOSE"),Oe(this,me,"m",we).call(this,{connected:!1,ready:!1,currentState:"socket_closed"})})),this.channel.onClose((()=>{je("[CHANNEL]CLOSE"),Oe(this,me,"m",we).call(this,{connected:!1,ready:!1,currentState:"channel_closed"})})),this.channel.onError((e=>{je("[CHANNEL][ERROR]",e),Oe(this,me,"m",we).call(this,{connected:!1,ready:!1,currentState:"channel_erred"})})),Oe(this,me,"m",ge).call(this,"ack","ui","error","participant","message","service_data","system","info","sync")}))}start(){this.channel.join().receive("ok",(()=>{je("[CHANNEL][JOIN] OK"),Oe(this,me,"m",we).call(this,{connected:!0,ready:!1,currentState:"join_channel_succeeded"})})).receive("error",(e=>{je("[CHANNEL][JOIN] ERROR",e),Oe(this,me,"m",we).call(this,{connected:!1,ready:!1,currentState:"join_channel_erred"}),this.channel.socket.disconnect()})).receive("timeout",(()=>{je("[CHANEL][JOIN] Networking issue. Still waiting...")}))}disconnect(){var e,t,n;(function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?o.call(e,n):o?o.value=n:t.set(e,n)})(this,ve,[],"f"),null===(e=this.channel)||void 0===e||e.leave(),null===(t=this.socket)||void 0===t||t.remove(this.channel),null===(n=this.socket)||void 0===n||n.disconnect()}onConnection(e){Oe(this,ve,"f").push(e)}pushToChannel(e,t,n=1e4){this.channel.push(e,t,n)}}ve=new WeakMap,me=new WeakSet,ge=function(...e){e.forEach((e=>{this.channel.on(e,(t=>{je("[RECEIVE]",e,t)}))}))},we=function(e){for(let t=Oe(this,ve,"f").length-1;t>=0;t--)(0,Oe(this,ve,"f")[t])(e)&&Oe(this,ve,"f").splice(t,1)};var _e,Se,Ce,Ee,Pe,Te,ke,Ae,Ie,Ne,Re,De,Me,Le,Ue,Fe=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Be=function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},$e=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};const ze=G()("seamly");function He(){if(!Intl||"undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;const e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;const t=e.resolvedOptions().timeZone;return t&&(t.indexOf("/")>-1||"UTC"===t)?t:null}class Ve{constructor({layoutMode:e,namespace:t,config:n,context:r}){var o;_e.add(this),Se.set(this,void 0),Ce.set(this,void 0),Ee.set(this,void 0),Pe.set(this,void 0),this.conversation=new xe,Re.set(this,(e=>e||this.locale)),this.store=function(e,t){const n=t(e),r=n.get()||{};return{get:e=>void 0===e?r:r[e],set:(e,t)=>(r[e]=t,n.set(r),t),delete(e){const t=this.get(e);return delete r[e],n.set(r),t}}}(`${t}.connection${r.locale?`.${r.locale}`:""}`,n.storageProvider||J),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},Be(this,Pe,Object.assign(Object.assign({},n),{sendEnvironment:null===(o=n.sendEnvironment)||void 0===o||o,context:Object.assign(Object.assign({},r),{channelName:r.channelName||"web"})}),"f"),Be(this,Se,!1,"f"),this.connected=!1,this.configReady=!1,Be(this,Ce,n.externalId,"f"),Be(this,Ee,e,"f"),this.userResponded=!1,this.URLS={},window.addEventListener("pageshow",(e=>{e.persisted&&this.connected&&this.connect()}))}getConversationUrl(){return this.store.get("conversationUrl")}hasConversation(){return!!this.getConversationUrl()}clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}reset(){return Fe(this,void 0,void 0,(function*(){return yield this.disconnect(),this.clearStore(),this.getConfig()}))}disconnect(){var e;return Fe(this,void 0,void 0,(function*(){(null===(e=this.conversation)||void 0===e?void 0:e.disconnect)&&this.conversation.disconnect(),this.connected=!1,this.configReady=!1}))}getConfig(){return A().post(`${$e(this,_e,"m",De).call(this,"http")}/client/${this.connectionInfo.apiKey}/configs`).set("Content-Type","application/json").query({v:C}).send({context:Object.assign(Object.assign({},$e(this,Pe,"f").context),{environment:!0===$e(this,Pe,"f").sendEnvironment?$e(this,_e,"m",Ue).call(this):$e(this,Pe,"f").sendEnvironment})}).then((({body:e})=>($e(this,_e,"m",Me).call(this,e),this.configReady=!0,e.config))).catch((e=>{if(404===e.status)throw new N(e);if(e.status>=500)throw new R(e);throw e}))}getConversation(){return Fe(this,void 0,void 0,(function*(){if(!this.hasConversation())return null;try{const{body:e}=yield A().get(`${$e(this,_e,"m",De).call(this,"http")}${this.URLS.history}`).set("Authorization",`Bearer ${$e(this,_e,"m",Te).call(this)}`).query({v:C});$e(this,_e,"m",Me).call(this,e);const{messages:t,participants:n,activeServiceSessionId:r,activeServiceSettings:o,serviceData:i,ui:s,translation:a}=e.history;return{events:t.map((([e,t])=>({type:e,payload:Object.assign(Object.assign({},t),{type:"participant"===e?e:t.type})}))),participants:n,activeServiceSessionId:r,activeServiceSettings:o,serviceData:i,resumeConversationPrompt:!!s&&Boolean(s.resumeConversationPrompt),translationProposal:s.translationProposal,translation:a}}catch(e){if(401===e.status)throw new M(e);if(404===e.status)throw new D(e);if(e.status>=500)throw new R(e);throw e}}))}connect(){return Fe(this,void 0,void 0,(function*(){this.connected=!1;let e={};return this.hasConversation()||(e=yield $e(this,_e,"m",Le).call(this)),this.conversation.connect(`${$e(this,_e,"m",De).call(this,"ws")}${this.URLS.socket}`,$e(this,Pe,"f").context.channelName,$e(this,_e,"m",Ie).call(this),$e(this,_e,"m",Te).call(this)),this.conversation.onConnection((({connected:e,ready:t})=>{this.connected=e,Be(this,Se,t,"f")})),$e(this,Pe,"f").sendEnvironment&&this.send("context",{environment:!0===$e(this,Pe,"f").sendEnvironment?$e(this,_e,"m",Ue).call(this):$e(this,Pe,"f").sendEnvironment},!1),e}))}uploadFile(e,t,n,r){const o=new FormData;o.append("upload",e);const i=A().post(`${$e(this,_e,"m",De).call(this,"http")}${this.URLS.uploads}`).set("Authorization",`Bearer ${$e(this,_e,"m",Te).call(this)}`).send(o);return i.on("progress",(function(e){const{direction:n,percent:r}=e;"upload"===n&&"function"==typeof t&&t(r)})),i.then((e=>{n&&n(e)})).catch((e=>{if(!r)throw e;r(e.response)})),i}getConversationIntitialState(){return A().get(`${$e(this,_e,"m",De).call(this,"http")}${this.getConversationUrl()}`).set("Authorization",`Bearer ${$e(this,_e,"m",Te).call(this)}`).query({v:C}).then((({body:e})=>{return $e(this,_e,"m",Me).call(this,e),this.userResponded=e.conversation.userResponded,t=e.conversation,n=["accessToken","channelTopic"],Object.keys(t).reduce(((e,r)=>(n.includes(r)||(e[r]=t[r]),e)),{});var t,n})).catch((e=>{if(401===e.status)throw new M(e);if(404===e.status)throw new D(e);if(e.status>=500)throw new R(e);throw e}))}getTranslations(e){return Fe(this,void 0,void 0,(function*(){try{if(!this.URLS.translations)throw new N;const t=`${$e(this,_e,"m",De).call(this,"http")}${this.URLS.translations}`.replace("{version}",String(2)).replace("{locale}",$e(this,Re,"f").call(this,e)),n=A().get(t),{body:r}=yield n;return r.translations}catch(e){if(e.status>=500)throw new R(e);throw e}}))}send(e,t,n=!0){var r;!this.connected||n&&!$e(this,Se,"f")?null===(r=this.conversation)||void 0===r||r.onConnection((({connected:r,ready:o})=>(this.connected=r,Be(this,Se,o,"f"),!!(n?o:r)&&(this.send(e,t,n),!0)))):(ze("[SEND]",e,t),this.conversation.pushToChannel(e,function(e,t){if("message"!==e)return t;const{type:n,body:r}=t;let{transactionId:o}=t;return o||(o=K()),{type:n,body:r,transactionId:o}}(e,t),1e4))}sendContext(e){const{locale:t,variables:n}=e,r={};if(t){if("string"!=typeof t)throw new Error("Locale must be a string");r.locale=t}if(n){if("object"!=typeof n)throw new Error("Variables must be an object");r.variables=n}0===Object.keys(r).length&&r.constructor===Object||this.send("context",r,!1)}}Se=new WeakMap,Ce=new WeakMap,Ee=new WeakMap,Pe=new WeakMap,Re=new WeakMap,_e=new WeakSet,Te=function(){return this.store.get("accessToken")},ke=function(e){this.store.set("accessToken",e)},Ae=function(e){this.store.set("conversationUrl",e)},Ie=function(){return this.store.get("channelTopic")||this.store.get("channelName")},Ne=function(e){this.store.set("channelTopic",e)},De=function(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`},Me=function({_links:e}){this.URLS=Object.entries(e).filter((([e])=>"self"!==e)).reduce(((e,[t,{href:n}])=>Object.assign(Object.assign({},e),{[t]:n})),this.URLS)},Le=function(){var e;return Fe(this,void 0,void 0,(function*(){try{const t=A().post(`${$e(this,_e,"m",De).call(this,"http")}${this.URLS.conversations}`).set("Content-Type","application/json").query({v:C}).withCredentials().send({externalId:$e(this,Ce,"f")||void 0}),{body:n}=yield t,{conversation:r}=n,o=Object.assign({},r);return delete o.accessToken,delete o.channelTopic,$e(this,_e,"m",ke).call(this,r.accessToken),$e(this,_e,"m",Ne).call(this,r.channelTopic),$e(this,_e,"m",Me).call(this,n),$e(this,_e,"m",Ae).call(this,this.URLS.conversation),this.locale=null===(e=r.translation)||void 0===e?void 0:e.locale,this.userResponded=r.userResponded,o}catch(e){if(e.status>=500)throw new R(e);throw e}}))},Ue=function(){return{clientName:"@seamly/web-ui",clientVariant:$e(this,Ee,"f"),clientVersion:"21.0.4",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:He(),userAgent:navigator.userAgent,preferredLocale:navigator.language}};var qe=n(554),We=n.n(qe),Ge=n(210),Ke=n(207),Je=n(688),Xe=n(798),Qe=n(661);let Ye=function(e){e()};const Ze=()=>Ye,et=(0,Qe.createContext)(null);function tt(){return(0,Qe.useContext)(et)}let nt=()=>{throw new Error("uSES not initialized!")};const rt=(e,t)=>e===t;function ot(e=et){const t=e===et?tt:()=>(0,Qe.useContext)(e);return function(e,n=rt){const{store:r,subscription:o,getServerState:i}=t(),s=nt(o.addNestedSub,r.getState,i||r.getState,e,n);return(0,Qe.useDebugValue)(s),s}}const it=ot();n(679),n(973);const st={notify(){},get:()=>[]};const at="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?Qe.useLayoutEffect:Qe.useEffect;let ct=null;const lt=function({store:e,context:t,children:n,serverState:r}){const o=(0,Qe.useMemo)((()=>{const t=function(e,t){let n,r=st;function o(){s.onStateChange&&s.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){const e=Ze();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}const s={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=st)},getListeners:()=>r};return s}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0}}),[e,r]),i=(0,Qe.useMemo)((()=>e.getState()),[e]);at((()=>{const{subscription:t}=o;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),i!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[o,i]);const s=t||et;return Qe.default.createElement(s.Provider,{value:o},n)};function ut(e=et){const t=e===et?tt:()=>(0,Qe.useContext)(e);return function(){const{store:e}=t();return e}}const pt=ut();function dt(e=et){const t=e===et?pt:ut(e);return function(){return t().dispatch}}const ft=dt();var ht;(e=>{nt=e})(Xe.useSyncExternalStoreWithSelector),(e=>{ct=e})(Je.useSyncExternalStore),ht=Qe.unstable_batchedUpdates,Ye=ht;const yt=(0,Ge.createContext)(null),bt=(0,Ge.createContext)(null);function mt(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function vt(e){return!!e&&!!e[on]}function gt(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===sn}(e)||Array.isArray(e)||!!e[rn]||!!(null===(t=e.constructor)||void 0===t?void 0:t[rn])||St(e)||Ct(e))}function wt(e,t,n){void 0===n&&(n=!1),0===Ot(e)?(n?Object.keys:an)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function Ot(e){var t=e[on];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:St(e)?2:Ct(e)?3:0}function jt(e,t){return 2===Ot(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function xt(e,t,n){var r=Ot(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function _t(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function St(e){return Zt&&e instanceof Map}function Ct(e){return en&&e instanceof Set}function Et(e){return e.o||e.t}function Pt(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=cn(e);delete t[on];for(var n=an(t),r=0;r<n.length;r++){var o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Tt(e,t){return void 0===t&&(t=!1),At(e)||vt(e)||!gt(e)||(Ot(e)>1&&(e.set=e.add=e.clear=e.delete=kt),Object.freeze(e),t&&wt(e,(function(e,t){return Tt(t,!0)}),!0)),e}function kt(){mt(2)}function At(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function It(e){var t=ln[e];return t||mt(18,e),t}function Nt(){return Qt}function Rt(e,t){t&&(It("Patches"),e.u=[],e.s=[],e.v=t)}function Dt(e){Mt(e),e.p.forEach(Ut),e.p=null}function Mt(e){e===Qt&&(Qt=e.l)}function Lt(e){return Qt={p:[],l:Qt,h:e,m:!0,_:0}}function Ut(e){var t=e[on];0===t.i||1===t.i?t.j():t.O=!0}function Ft(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||It("ES5").S(t,e,r),r?(n[on].P&&(Dt(t),mt(4)),gt(e)&&(e=Bt(t,e),t.l||zt(t,e)),t.u&&It("Patches").M(n[on].t,e,t.u,t.s)):e=Bt(t,n,[]),Dt(t),t.u&&t.v(t.u,t.s),e!==nn?e:void 0}function Bt(e,t,n){if(At(t))return t;var r=t[on];if(!r)return wt(t,(function(o,i){return $t(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return zt(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=Pt(r.k):r.o;wt(3===r.i?new Set(o):o,(function(t,i){return $t(e,r,o,t,i,n)})),zt(e,o,!1),n&&e.u&&It("Patches").R(r,n,e.u,e.s)}return r.o}function $t(e,t,n,r,o,i){if(vt(o)){var s=Bt(e,o,i&&t&&3!==t.i&&!jt(t.D,r)?i.concat(r):void 0);if(xt(n,r,s),!vt(s))return;e.m=!1}if(gt(o)&&!At(o)){if(!e.h.F&&e._<1)return;Bt(e,o),t&&t.A.l||zt(e,o)}}function zt(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&Tt(t,n)}function Ht(e,t){var n=e[on];return(n?Et(n):e)[t]}function Vt(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function qt(e){e.P||(e.P=!0,e.l&&qt(e.l))}function Wt(e){e.o||(e.o=Pt(e.t))}function Gt(e,t,n){var r=St(t)?It("MapSet").N(t,n):Ct(t)?It("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:Nt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=un;n&&(o=[r],i=pn);var s=Proxy.revocable(o,i),a=s.revoke,c=s.proxy;return r.k=c,r.j=a,c}(t,n):It("ES5").J(t,n);return(n?n.A:Nt()).p.push(r),r}function Kt(e){return vt(e)||mt(22,e),function e(t){if(!gt(t))return t;var n,r=t[on],o=Ot(t);if(r){if(!r.P&&(r.i<4||!It("ES5").K(r)))return r.t;r.I=!0,n=Jt(t,o),r.I=!1}else n=Jt(t,o);return wt(n,(function(t,o){r&&function(e,t){return 2===Ot(e)?e.get(t):e[t]}(r.t,t)===o||xt(n,t,e(o))})),3===o?new Set(n):n}(e)}function Jt(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Pt(e)}var Xt,Qt,Yt="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Zt="undefined"!=typeof Map,en="undefined"!=typeof Set,tn="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,nn=Yt?Symbol.for("immer-nothing"):((Xt={})["immer-nothing"]=!0,Xt),rn=Yt?Symbol.for("immer-draftable"):"__$immer_draftable",on=Yt?Symbol.for("immer-state"):"__$immer_state",sn=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),an="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,cn=Object.getOwnPropertyDescriptors||function(e){var t={};return an(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},ln={},un={get:function(e,t){if(t===on)return e;var n=Et(e);if(!jt(n,t))return function(e,t,n){var r,o=Vt(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!gt(r)?r:r===Ht(e.t,t)?(Wt(e),e.o[t]=Gt(e.A.h,r,e)):r},has:function(e,t){return t in Et(e)},ownKeys:function(e){return Reflect.ownKeys(Et(e))},set:function(e,t,n){var r=Vt(Et(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=Ht(Et(e),t),i=null==o?void 0:o[on];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(_t(n,o)&&(void 0!==n||jt(e.t,t)))return!0;Wt(e),qt(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==Ht(e.t,t)||t in e.t?(e.D[t]=!1,Wt(e),qt(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Et(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){mt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){mt(12)}},pn={};wt(un,(function(e,t){pn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),pn.deleteProperty=function(e,t){return pn.set.call(this,e,t,void 0)},pn.set=function(e,t,n){return un.set.call(this,e[0],t,n,e[0])};var dn=function(){function e(e){var t=this;this.g=tn,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,s=Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];return i.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(s))}))}}var s;if("function"!=typeof n&&mt(6),void 0!==r&&"function"!=typeof r&&mt(7),gt(e)){var a=Lt(t),c=Gt(t,e,void 0),l=!0;try{s=n(c),l=!1}finally{l?Dt(a):Mt(a)}return"undefined"!=typeof Promise&&s instanceof Promise?s.then((function(e){return Rt(a,r),Ft(e,a)}),(function(e){throw Dt(a),e})):(Rt(a,r),Ft(s,a))}if(!e||"object"!=typeof e){if(void 0===(s=n(e))&&(s=e),s===nn&&(s=void 0),t.F&&Tt(s,!0),r){var u=[],p=[];It("Patches").M(e,s,u,p),r(u,p)}return s}mt(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(o))}))};var r,o,i=t.produce(e,n,(function(e,t){r=e,o=t}));return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return[e,r,o]})):[i,r,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){gt(e)||mt(8),vt(e)&&(e=Kt(e));var t=Lt(this),n=Gt(this,e,void 0);return n[on].C=!0,Mt(t),n},t.finishDraft=function(e,t){var n=(e&&e[on]).A;return Rt(n,t),Ft(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!tn&&mt(20),this.g=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=It("Patches").$;return vt(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),fn=new dn,hn=fn.produce;fn.produceWithPatches.bind(fn),fn.setAutoFreeze.bind(fn),fn.setUseProxies.bind(fn),fn.applyPatches.bind(fn),fn.createDraft.bind(fn),fn.finishDraft.bind(fn);const yn=hn;function bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mn(Object(n),!0).forEach((function(t){bn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gn(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var wn="function"==typeof Symbol&&Symbol.observable||"@@observable",On=function(){return Math.random().toString(36).substring(7).split("").join(".")},jn={INIT:"@@redux/INIT"+On(),REPLACE:"@@redux/REPLACE"+On(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+On()}};function xn(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function _n(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(gn(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(gn(1));return n(_n)(e,t)}if("function"!=typeof e)throw new Error(gn(2));var o=e,i=t,s=[],a=s,c=!1;function l(){a===s&&(a=s.slice())}function u(){if(c)throw new Error(gn(3));return i}function p(e){if("function"!=typeof e)throw new Error(gn(4));if(c)throw new Error(gn(5));var t=!0;return l(),a.push(e),function(){if(t){if(c)throw new Error(gn(6));t=!1,l();var n=a.indexOf(e);a.splice(n,1),s=null}}}function d(e){if(!xn(e))throw new Error(gn(7));if(void 0===e.type)throw new Error(gn(8));if(c)throw new Error(gn(9));try{c=!0,i=o(i,e)}finally{c=!1}for(var t=s=a,n=0;n<t.length;n++)(0,t[n])();return e}function f(e){if("function"!=typeof e)throw new Error(gn(10));o=e,d({type:jn.REPLACE})}function h(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(gn(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[wn]=function(){return this},e}return d({type:jn.INIT}),(r={dispatch:d,subscribe:p,getState:u,replaceReducer:f})[wn]=h,r}function Sn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function Cn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(gn(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=Sn.apply(void 0,i)(n.dispatch),vn(vn({},n),{},{dispatch:r})}}}function En(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var Pn=En();Pn.withExtraArgument=En;const Tn=Pn;var kn,An=(kn=function(e,t){return kn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},kn(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}kn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),In=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},Nn=Object.defineProperty,Rn=Object.defineProperties,Dn=Object.getOwnPropertyDescriptors,Mn=Object.getOwnPropertySymbols,Ln=Object.prototype.hasOwnProperty,Un=Object.prototype.propertyIsEnumerable,Fn=function(e,t,n){return t in e?Nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Bn=function(e,t){for(var n in t||(t={}))Ln.call(t,n)&&Fn(e,n,t[n]);if(Mn)for(var r=0,o=Mn(t);r<o.length;r++)n=o[r],Un.call(t,n)&&Fn(e,n,t[n]);return e},$n=function(e,t){return Rn(e,Dn(t))},zn="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Sn:Sn.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Hn=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return An(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,In([void 0],e[0].concat(this)))):new(t.bind.apply(t,In([void 0],e.concat(this))))},t}(Array);function Vn(e){return gt(e)?yn(e,(function(){})):e}function qn(e){var t,n=function(e){return function(e){void 0===e&&(e={});var t=e.thunk,n=void 0===t||t,r=(e.immutableCheck,e.serializableCheck,new Hn);return n&&(function(e){return"boolean"==typeof e}(n)?r.push(Tn):r.push(Tn.withExtraArgument(n.extraArgument))),r}(e)},r=e||{},o=r.reducer,i=void 0===o?void 0:o,s=r.middleware,a=void 0===s?n():s,c=r.devTools,l=void 0===c||c,u=r.preloadedState,p=void 0===u?void 0:u,d=r.enhancers,f=void 0===d?void 0:d;if("function"==typeof i)t=i;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var i,s=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:jn.INIT}))throw new Error(gn(12));if(void 0===n(void 0,{type:jn.PROBE_UNKNOWN_ACTION()}))throw new Error(gn(13))}))}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},a=0;a<s.length;a++){var c=s[a],l=n[c],u=e[c],p=l(u,t);if(void 0===p)throw t&&t.type,new Error(gn(14));o[c]=p,r=r||p!==u}return(r=r||s.length!==Object.keys(e).length)?o:e}}(i)}var h=a;"function"==typeof h&&(h=h(n));var y=Cn.apply(void 0,h),b=Sn;l&&(b=zn(Bn({trace:!1},"object"==typeof l&&l)));var m=[y];return Array.isArray(f)?m=In([y],f):"function"==typeof f&&(m=f(m)),_n(t,p,b.apply(void 0,m))}function Wn(e,t){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(t){var o=t.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return Bn(Bn({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:n[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(t){return t.type===e},n}function Gn(e){var t,n={},r=[],o={addCase:function(e,t){var r="string"==typeof e?e:e.type;if(r in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[r]=t,o},addMatcher:function(e,t){return r.push({matcher:e,reducer:t}),o},addDefaultCase:function(e){return t=e,o}};return e(o),[n,r,t]}function Kn(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof e.initialState?e.initialState:Vn(e.initialState),o=e.reducers||{},i=Object.keys(o),s={},a={},c={};function l(){var t="function"==typeof e.extraReducers?Gn(e.extraReducers):[e.extraReducers],n=t[0],o=void 0===n?{}:n,i=t[1],s=void 0===i?[]:i,c=t[2],l=void 0===c?void 0:c,u=Bn(Bn({},o),a);return function(e,t,n,r){void 0===n&&(n=[]);var o,i=Gn(t),s=i[0],a=i[1],c=i[2];if(function(e){return"function"==typeof e}(e))o=function(){return Vn(e())};else{var l=Vn(e);o=function(){return l}}function u(e,t){void 0===e&&(e=o());var n=In([s[t.type]],a.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return!!e})).length&&(n=[c]),n.reduce((function(e,n){if(n){var r;if(vt(e))return void 0===(r=n(e,t))?e:r;if(gt(e))return yn(e,(function(e){return n(e,t)}));if(void 0===(r=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return u.getInitialState=o,u}(r,(function(e){for(var t in u)e.addCase(t,u[t]);for(var n=0,r=s;n<r.length;n++){var o=r[n];e.addMatcher(o.matcher,o.reducer)}l&&e.addDefaultCase(l)}))}return i.forEach((function(e){var n,r,i=o[e],l=function(e,t){return e+"/"+t}(t,e);"reducer"in i?(n=i.reducer,r=i.prepare):n=i,s[e]=n,a[l]=n,c[e]=r?Wn(l,r):Wn(l)})),{name:t,reducer:function(e,t){return n||(n=l()),n(e,t)},actions:c,caseReducers:s,getInitialState:function(){return n||(n=l()),n.getInitialState()}}}var Jn=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},Xn=["name","message","stack","code"],Qn=function(e,t){this.payload=e,this.meta=t},Yn=function(e,t){this.payload=e,this.meta=t},Zn=function(e){if("object"==typeof e&&null!==e){for(var t={},n=0,r=Xn;n<r.length;n++){var o=r[n];"string"==typeof e[o]&&(t[o]=e[o])}return t}return{message:String(e)}},er=function(){function e(e,t,n){var r=Wn(e+"/fulfilled",(function(e,t,n,r){return{payload:e,meta:$n(Bn({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),o=Wn(e+"/pending",(function(e,t,n){return{payload:void 0,meta:$n(Bn({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),i=Wn(e+"/rejected",(function(e,t,r,o,i){return{payload:o,error:(n&&n.serializeError||Zn)(e||"Rejected"),meta:$n(Bn({},i||{}),{arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),s="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(a,c,l){var u,p=(null==n?void 0:n.idGenerator)?n.idGenerator(e):Jn(),d=new s,f=new Promise((function(e,t){return d.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:u||"Aborted"})}))})),h=!1;function y(e){h&&(u=e,d.abort())}var b=function(){return s=this,u=null,b=function(){var s,u,b,m,v;return function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(g){switch(g.label){case 0:return g.trys.push([0,4,,5]),null===(w=m=null==(s=null==n?void 0:n.condition)?void 0:s.call(n,e,{getState:c,extra:l}))||"object"!=typeof w||"function"!=typeof w.then?[3,2]:[4,m];case 1:m=g.sent(),g.label=2;case 2:if(!1===m)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return h=!0,a(o(p,e,null==(u=null==n?void 0:n.getPendingMeta)?void 0:u.call(n,{requestId:p,arg:e},{getState:c,extra:l}))),[4,Promise.race([f,Promise.resolve(t(e,{dispatch:a,getState:c,extra:l,requestId:p,signal:d.signal,abort:y,rejectWithValue:function(e,t){return new Qn(e,t)},fulfillWithValue:function(e,t){return new Yn(e,t)}})).then((function(t){if(t instanceof Qn)throw t;return t instanceof Yn?r(t.payload,p,e,t.meta):r(t,p,e)}))])];case 3:return b=g.sent(),[3,5];case 4:return v=g.sent(),b=v instanceof Qn?i(null,p,e,v.payload,v.meta):i(v,p,e),[3,5];case 5:return n&&!n.dispatchConditionRejection&&i.match(b)&&b.meta.condition||a(b),[2,b]}var w}))},new Promise((function(e,t){var n=function(e){try{o(b.next(e))}catch(e){t(e)}},r=function(e){try{o(b.throw(e))}catch(e){t(e)}},o=function(t){return t.done?e(t.value):Promise.resolve(t.value).then(n,r)};o((b=b.apply(s,u)).next())}));var s,u,b}();return Object.assign(b,{abort:y,requestId:p,arg:e,unwrap:function(){return b.then(tr)}})}}),{pending:o,rejected:i,fulfilled:r,typePrefix:e})}return e.withTypes=e,e}();function tr(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var nr=function(e,t){return function(e){return e&&"function"==typeof e.match}(e)?e.match(t):e(t)};function rr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.some((function(e){return nr(e,t)}))}}Object.assign;var or="listenerMiddleware";Wn(or+"/add"),Wn(or+"/removeAll"),Wn(or+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:n.g),function(){function e(e,t){var n=o[e];return n?n.enumerable=t:o[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[on];return un.get(t,e)},set:function(t){var n=this[on];un.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][on];if(!o.P)switch(o.i){case 5:r(o)&&qt(o);break;case 4:n(o)&&qt(o)}}}function n(e){for(var t=e.t,n=e.k,r=an(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==on){var s=t[i];if(void 0===s&&!jt(t,i))return!0;var a=n[i],c=a&&a[on];if(c?c.t!==s:!_t(a,s))return!0}}var l=!!t[on];return r.length!==an(t).length+(l?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return!0;return!1}var o={};!function(e,t){ln[e]||(ln[e]=t)}("ES5",{J:function(t,n){var r=Array.isArray(t),o=function(t,n){if(t){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,e(o,!0));return r}var i=cn(n);delete i[on];for(var s=an(i),a=0;a<s.length;a++){var c=s[a];i[c]=e(c,t||!!i[c].enumerable)}return Object.create(Object.getPrototypeOf(n),i)}(r,t),i={i:r?5:4,A:n?n.A:Nt(),P:!1,I:!1,D:{},l:n,t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,on,{value:i,writable:!0}),o},S:function(e,n,o){o?vt(n)&&n[on].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[on];if(n){var o=n.t,i=n.k,s=n.D,a=n.i;if(4===a)wt(i,(function(t){t!==on&&(void 0!==o[t]||jt(o,t)?s[t]||e(i[t]):(s[t]=!0,qt(n)))})),wt(o,(function(e){void 0!==i[e]||jt(i,e)||(s[e]=!1,qt(n))}));else if(5===a){if(r(n)&&(qt(n),s.length=!0),i.length<o.length)for(var c=i.length;c<o.length;c++)s[c]=!1;else for(var l=o.length;l<i.length;l++)s[l]=!0;for(var u=Math.min(i.length,o.length),p=0;p<u;p++)i.hasOwnProperty(p)||(s[p]=!0),void 0===s[p]&&e(i[p])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}})}();class ir extends I{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}var sr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const ar=er("initializeConfig",((e,{extra:{api:t,config:n},rejectWithValue:r})=>sr(void 0,void 0,void 0,(function*(){var e;try{const{features:r,defaultLocale:o,preChat:i,agentParticipant:s,userParticipant:a,startChatIcon:c}=yield t.getConfig(),l=(null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.locale)||o,{connectWhenInView:u}=n;return{features:r,defaultLocale:o,preChat:i,agentParticipant:s,userParticipant:a,startChatIcon:c,locale:l,connectWhenInView:u}}catch(e){return r(e)}})))),cr=er("resetConfig",((e,{extra:{config:t}})=>sr(void 0,void 0,void 0,(function*(){return t}))));const lr=er("setLocale",((e,{extra:{api:t},rejectWithValue:n})=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){try{return{translations:yield t.getTranslations(e),locale:e}}catch(e){return n(e)}}))),{condition:(e,{getState:t})=>{const{i18n:{isLoading:n,locale:r}}=t();return e!==r&&!n}});var ur="NOT_FOUND",pr=function(e,t){return e===t};function dr(e,t){var n,r,o="object"==typeof t?t:{equalityCheck:t},i=o.equalityCheck,s=void 0===i?pr:i,a=o.maxSize,c=void 0===a?1:a,l=o.resultEqualityCheck,u=function(e){return function(t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}}(s),p=1===c?(n=u,{get:function(e){return r&&n(r.key,e)?r.value:ur},put:function(e,t){r={key:e,value:t}},getEntries:function(){return r?[r]:[]},clear:function(){r=void 0}}):function(e,t){var n=[];function r(e){var r=n.findIndex((function(n){return t(e,n.key)}));if(r>-1){var o=n[r];return r>0&&(n.splice(r,1),n.unshift(o)),o.value}return ur}return{get:r,put:function(t,o){r(t)===ur&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(c,u);function d(){var t=p.get(arguments);if(t===ur){if(t=e.apply(null,arguments),l){var n=p.getEntries(),r=n.find((function(e){return l(e.value,t)}));r&&(t=r.value)}p.put(arguments,t)}return t}return d.clearCache=function(){return p.clear()},d}function fr(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return"function"==typeof e?"function "+(e.name||"unnamed")+"()":typeof e})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function hr(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i,s=0,a={memoizeOptions:void 0},c=r.pop();if("object"==typeof c&&(a=c,c=r.pop()),"function"!=typeof c)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof c+"]");var l=a,u=l.memoizeOptions,p=void 0===u?n:u,d=Array.isArray(p)?p:[p],f=fr(r),h=e.apply(void 0,[function(){return s++,c.apply(null,arguments)}].concat(d)),y=e((function(){for(var e=[],t=f.length,n=0;n<t;n++)e.push(f[n].apply(null,arguments));return i=h.apply(null,e)}));return Object.assign(y,{resultFunc:c,memoizedResultFunc:h,dependencies:f,lastResult:function(){return i},recomputations:function(){return s},resetRecomputations:function(){return s=0}}),y};return o}var yr=hr(dr);const br=yr((({app:e})=>e),(({userHasResponded:e})=>e)),mr=yr((({config:e})=>e),(e=>{let t=Object.assign({visible:"inline"===(null==e?void 0:e.layoutMode)?x.open:x.minimized,appContainerClassNames:e.appContainerClassNames||[]},e);return"function"==typeof t.appContainerClassNames&&(t=Object.assign(Object.assign({},t),{appContainerClassNames:t.appContainerClassNames(t)})),t})),vr=()=>it(mr),gr=({state:e})=>e,wr=()=>it(gr),Or=yr(gr,mr,br,(({events:e,serviceData:t},n,r)=>{var o;if(r||"inline"===n.layoutMode||!(null==t?void 0:t.suggestion)||!(null===(o=null==t?void 0:t.suggestion)||void 0===o?void 0:o.body.length))return e;const i={type:"service_data",payload:t.suggestion};return[...e,i]})),jr=yr(Or,mr,((e,t)=>{var n,r;const{enabled:o,threshold:i}=null!==(r=null===(n=null==t?void 0:t.messages)||void 0===n?void 0:n.timeIndicator)&&void 0!==r?r:{};if(!o)return e;const s=[];let a=null;return e.forEach(((e,t)=>{if(0===t)s.push(Object.assign(Object.assign({},e),{timeIndicator:e.payload.occurredAt}));else{const t=a&&U(e.payload.occurredAt-a.payload.occurredAt)>=i?e.payload.occurredAt:void 0;s.push(Object.assign(Object.assign({},e),{timeIndicator:t}))}a=e})),s})),xr=()=>it(jr),_r=(yr(jr,(e=>e.map((e=>e.payload.id)))),()=>wr().isLoading),Sr=()=>wr().unreadEvents,Cr=()=>wr().skiplinkTargetId,Er=yr(jr,(e=>{var t;const n=e.filter((e=>"message"===e.type));return null===(t=n[n.length-1])||void 0===t?void 0:t.payload.id})),Pr=()=>{const{participants:e,currentAgent:t}=wr().participantInfo;return t?e[t]:null},Tr=()=>{const{layoutMode:e}=vr();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},kr=yr((({visibility:e})=>e),(e=>e.visibility)),Ar=yr((({visibility:e})=>e),(e=>e.showInlineView));const Ir=[x.open,x.minimized,x.hidden],Nr=er("setVisibility",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),i=kr(o),s=br(o),a=n.hasConversation(),c=mr(o),{visibilityCallback:l=_,layoutMode:u}=c,{unreadEvents:p}=gr(o),d=l({hasResponded:s,previousVisibility:i,requestedVisibility:e,config:c});if(Ir.includes(d)){if(i!==d)return n.store.set(j,Object.assign(Object.assign({},n.store.get(j)||{}),{[u]:e})),e&&r.emit("ui.visible",e,{visibility:e,hasConversation:a,hasResponded:s,unreadMessageCount:p}),d}else console.error('The visibilityCallback function should return "open", "minimized" or "hidden".')})),Rr=er("initialize",((e,{dispatch:t,getState:n,extra:{api:r}})=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){var e;const{layoutMode:o}=mr(n()),i=(null===(e=r.store.get(j))||void 0===e?void 0:e[o])||x.initialize;return t(Nr(i)),i}))));var Dr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const Mr=er("initializeApp",((e,{extra:{api:t,config:n},rejectWithValue:r})=>Dr(void 0,void 0,void 0,(function*(){var e,o,i,s;let a=null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.locale;try{if(t.hasConversation()){const e=yield t.getConversationIntitialState();return a=(null===(o=e.translation)||void 0===o?void 0:o.locale)||a,{initialState:e,locale:a,config:n}}return(null===(i=null==n?void 0:n.context)||void 0===i?void 0:i.topic)&&t.send("action",{type:f,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),(null===(s=null==n?void 0:n.context)||void 0===s?void 0:s.translationLocale)&&(a=n.context.translationLocale,t.send("action",{type:h,body:{enabled:!0,locale:a}},!1)),{initialState:void 0,locale:a,config:n}}catch(e){if(e instanceof D){const e=new D;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new ir;return r({name:t.name,message:t.message,langKey:t.langKey})}})))),Lr=er("resetApp",((e,{dispatch:t,extra:{api:n}})=>Dr(void 0,void 0,void 0,(function*(){yield n.disconnect(),yield n.clearStore(),t(cr()),yield t(ar());try{const{locale:e}=yield t(Mr()).unwrap();yield t(lr(e))}catch(e){}t(Rr())})))),Ur=()=>it(br),Fr={userHasResponded:!1},Br=Kn({name:"app",initialState:Fr,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(Lr.pending,(()=>Fr)).addCase(Mr.fulfilled,((e,{payload:t})=>{var n;t.initialState&&"userResponded"in t.initialState&&(e.userHasResponded=null===(n=t.initialState)||void 0===n?void 0:n.userResponded)}))}}),{setHasResponded:$r}=Br.actions,zr=Br.reducer,Hr={error:void 0},Vr=Kn({name:"interrupt",initialState:Hr,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>Hr},extraReducers:e=>{e.addCase(Lr.fulfilled,(()=>Hr)).addMatcher(rr(Mr.rejected,ar.rejected,lr.rejected,Nr.rejected,Rr.rejected),((e,{payload:t})=>{e.error=t}))}}),{setInterrupt:qr,clearInterrupt:Wr}=Vr.actions,Gr=Vr.reducer,Kr=({type:n,payload:r})=>n===e.message&&!r.fromClient||n===e.info&&r.type===t,Jr=e=>e.sort((({payload:{occurredAt:e}},{payload:{occurredAt:t}})=>e-t)),Xr=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:o,name:i,introduction:s}=t.participant,a=n[r],c=Object.assign(Object.assign({},n),{[r]:a?Object.assign(Object.assign(Object.assign(Object.assign({},a),o?{avatar:o}:{}),i?{name:i}:{}),s?{introduction:s}:{}):t.participant});return Object.assign(Object.assign({},e),{participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r})},Qr=(e,t)=>{const n="message"===(null==t?void 0:t.type)?null==t?void 0:t.payload.entry:{},{blockAutoEntrySwitch:r}=e;if(!n)return Object.assign(Object.assign({},e),{optionsOverride:{}});const{type:o,options:i}=n;let s=e.active;return r||o===e.userSelected||(s=o),Object.assign(Object.assign({},e),{active:s,optionsOverride:Object.assign(Object.assign({},e.optionsOverride),{[o]:i||{}})})},Yr={events:[],isLastEventFromClient:!1,initialState:{userResponded:!1},unreadEvents:0,userHasResponded:!1,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1,remaining:void 0,wasStopped:void 0,count:void 0,timer:void 0},resumeConversationPrompt:!1,serviceInfo:{activeServiceSessionId:""},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:null,subTitle:""},historyLoaded:!1,skiplinkTargetId:K(),optionsButtonId:K(),headerCollapseButtonId:K(),serviceData:{},options:{features:{},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],entryMeta:{default:o,active:o,userSelected:null,blockAutoEntrySwitch:!1,options:{},optionsOverride:{}},seamlyContainerElement:null},Zr=Kn({name:"store",initialState:Yr,reducers:{addEvent:(t,n)=>{var r,o;const{type:c,payload:l}=n.payload,u=t.options.features.hasOwnProperty(w);let p=Object.assign({},t.options);if(u&&(c===e.message||c===e.participant)&&!l.fromClient){const e="message"===c?null===(r=l.entry)||void 0===r?void 0:r.type:{};p=Object.assign(Object.assign({},p),{features:Object.assign(Object.assign({},p.features),{uploads:Object.assign(Object.assign({},null===(o=p.features)||void 0===o?void 0:o.uploads),{enabledFromEntry:e===i})})})}const d=Kr(n.payload);if(t.events.find((e=>e.payload.id===l.id)))return;const f=Qr(t.entryMeta,n.payload);t.entryMeta=u||f.active!==i?f:Object.assign({},t.entryMeta),t.options=p,d&&(t.unreadEvents+=1,"service_data"!==c&&(n.payload.payload.messageStatus=l.fromClient?a:s)),n.payload.payload.key=K(),t.events.push(n.payload),t.isLastEventFromClient=l.fromClient},ackEvent:(e,{payload:{payload:t}})=>{if(!t.transactionId)return void console.warn("ACK received without transaction ID.");const n=e.events.find((e=>e.payload.transactionId===t.transactionId&&(!t.type||e.type===t.type))),{id:r,occurredAt:o}=t;n&&(n.payload.id=r,n.payload.occurredAt=o,e.events=Jr(e.events))},clearEvents:e=>{e.unreadEvents=0,e.loadedImageEventIds=[],e.events=[]},setEventsRead:(e,{payload:t})=>{e.unreadEvents=0,e.events.forEach((e=>(-1!==t.indexOf(e.payload.id)&&(e.payload=Object.assign(Object.assign({},e.payload),"service_data"!==e.type&&e.payload.messageStatus===s&&{messageStatus:a})),e)))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setHistory:(e,{payload:{events:n,participants:r,activeServiceSessionId:o,activeServiceSettings:a={},serviceData:c,resumeConversationPrompt:l}})=>{var u,p;const d=((e,t)=>{const n=e.filter((e=>!t.some((t=>t.payload.id===e.payload.id)))),r=t.filter((e=>!("participant"===e.type&&!e.payload.participant.introduction))).reverse();return Jr([...r,...n])})(e.events,n),f=Object.assign(Object.assign({},e.participantInfo.participants),r),h=d.slice().reverse().find((e=>("message"===e.type||"participant"===e.type)&&!e.payload.fromClient));let y=null;h&&("message"===h.type&&(y=h.payload.participant),"participant"===h.type&&(y=h.payload.participant.id));const{entry:b}=a,m=null===(u=null==b?void 0:b.options)||void 0===u?void 0:u.upload,v=Qr(Object.assign(Object.assign(Object.assign({},e.entryMeta),b),{active:(null==b?void 0:b.default)||t,options:Object.assign({},(null==b?void 0:b.options)?b.options:{})}),d[d.length-1]);let g=Object.assign({},e.options.features);const O=g.hasOwnProperty(w);if(O&&"message"===(null==h?void 0:h.type)){const{payload:e}=h,t=(null===(p=null==e?void 0:e.entry)||void 0===p?void 0:p.type)||{};g=Object.assign(Object.assign({},g),{uploads:{enabled:!(!m||!(null==m?void 0:m.enabled)),enabledFromEntry:t===i}})}e.unreadEvents=d.filter((e=>"message"===e.type&&e.payload.messageStatus===s)).length,e.events=d.filter((e=>"participant"!==e.type||!!e.payload.participant.introduction)),e.participantInfo=Object.assign(Object.assign(Object.assign({},e.participantInfo),y?Xr(e.participantInfo,{participant:f[y]}):{}),{participants:f}),e.historyLoaded=!0,e.serviceInfo=Object.assign(Object.assign({},e.serviceInfo),{activeServiceSessionId:o}),e.serviceData=Object.assign(Object.assign({},e.serviceData),c),e.options=Object.assign(Object.assign({},e.options),{features:g||{}}),e.entryMeta=O||v.active!==i?v:Object.assign({},e.entryMeta),e.resumeConversationPrompt=l||!1,y&&(e.headerTitles.subTitle=f[y].name)},resetHistoryLoadedFlag:e=>{e.historyLoaded=!1},setIsLoading:(e,{payload:t})=>{e.isLoading=t},initIdleDetachCountdown:(e,{payload:t})=>{const{delaySeconds:n,delayTime:r}=t;e.idleDetachCountdown={hasCountdown:!0,isActive:!0,wasStopped:!1,count:n,remaining:n,timer:r}},decrementIdleDetachCountdownCounter:e=>{const{idleDetachCountdown:t}=e,{remaining:n}=t,r=n-1;e.idleDetachCountdown.remaining=r,e.idleDetachCountdown.timer=F(r)},stopIdleDetachCountdownCounter:e=>{e.idleDetachCountdown.isActive=!1,e.idleDetachCountdown.wasStopped=!0},clearIdleDetachCountdown:e=>{e.idleDetachCountdown.hasCountdown=!1,e.idleDetachCountdown.isActive=!1},initResumeConversationPrompt:e=>{e.resumeConversationPrompt=!0},clearResumeConversationPrompt:e=>{e.resumeConversationPrompt=!1},setParticipant:(e,{payload:t})=>{e.participantInfo=Xr(e.participantInfo,{participant:t.participant,fromClient:t.fromClient})},setActiveService:(e,{payload:t})=>{e.serviceInfo.activeServiceSessionId!==t&&(e.serviceInfo.activeServiceSessionId=t)},setHeaderTitle:(e,{payload:t})=>{e.headerTitles.title=t},setHeaderSubTitle:(e,{payload:t})=>{e.headerTitles.subTitle=t},setInitialState:(e,{payload:t})=>{e.initialState=t.initialState,e.unreadEvents=Yr.unreadEvents},setServiceDataItem:(e,{payload:t})=>{e.serviceData[t.type]=t},setFeatures:(e,{payload:t})=>{t.features&&(e.options.features=t.features)},setFeatureEnabledState:(e,{payload:t})=>{e.options.features.hasOwnProperty(t.key)&&(e.options.features[t.key].enabled=t.enabled)},clearFeatures:e=>{e.options.features={}},showOption:(e,{payload:t})=>{e.options.panelActive=!0,e.options.optionActive=t},hideOption:e=>{e.options.panelActive=!1,e.options.optionActive=""},setUserSelectedOptions:(e,{payload:t})=>{e.options.userSelectedOptions=t},setUserSelectedOption:(e,{payload:t})=>{const{option:n,value:r}=t;e.options.userSelectedOptions[n]=r},setBlockAutoEntrySwitch:(e,{payload:t})=>{e.entryMeta.blockAutoEntrySwitch=t},setServiceEntryMetadata:(e,{payload:t})=>{e.entryMeta.active=t.default,e.entryMeta.options=t.options||{},e.entryMeta.optionsOverride={}},setActiveEntryType:(e,{payload:t})=>{e.entryMeta.active=t},setUserEntryType:(e,{payload:t})=>{e.entryMeta.userSelected=t},registerUpload:(e,{payload:t})=>{e.currentUploads.push({id:t.fileId,name:t.fileName,progress:1,uploading:!0,complete:!1,error:"",uploadHandle:t.uploadHandle})},setUploadProgress:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?Object.assign(Object.assign({},e),{progress:t.progress,uploading:100!==t.progress,uploadHandle:100===t.progress?null:e.uploadHandle}):e))},setUploadError:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?Object.assign(Object.assign({},e),{error:t.errorText,progress:0,uploading:!1,uploadHandle:null}):e))},setUploadComplete:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t?Object.assign(Object.assign({},e),{complete:!0}):e))},clearAllUploads:e=>{e.currentUploads=[]},setSeamlyContainerElement:(e,{payload:t})=>{e.seamlyContainerElement=t}},extraReducers:e=>{e.addCase(Lr.pending,(()=>Yr)).addCase(ar.fulfilled,((e,{payload:t})=>{var n;e.headerTitles.subTitle=null===(n=t.agentParticipant)||void 0===n?void 0:n.name,t.features&&(e.options.features=t.features)})).addCase(Mr.fulfilled,((e,{payload:t})=>{t.initialState&&(e.initialState=t.initialState)})).addMatcher(rr(lo,uo),(e=>{e.isLastEventFromClient=!1}))}}),{ackEvent:eo,addEvent:to,clearAllUploads:no,clearEvents:ro,clearFeatures:oo,clearIdleDetachCountdown:io,clearResumeConversationPrompt:so,decrementIdleDetachCountdownCounter:ao,hideOption:co,initIdleDetachCountdown:lo,initResumeConversationPrompt:uo,registerUpload:po,resetHistoryLoadedFlag:fo,setActiveEntryType:ho,setActiveService:yo,setBlockAutoEntrySwitch:bo,setEventsRead:mo,setFeatureEnabledState:vo,setFeatures:go,setHeaderSubTitle:wo,setHeaderTitle:Oo,setHistory:jo,setInitialState:xo,setIsLoading:_o,setLoadedImageEventIds:So,setParticipant:Co,setSeamlyContainerElement:Eo,setServiceDataItem:Po,setServiceEntryMetadata:To,setUploadComplete:ko,setUploadError:Ao,setUploadProgress:Io,setUserEntryType:No,setUserSelectedOption:Ro,setUserSelectedOptions:Do,showOption:Mo,stopIdleDetachCountdownCounter:Lo}=Zr.actions,Uo=Zr.reducer;const Fo=Object.assign(Object.assign({},{namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}}}),{api:{domain:"",key:"",secure:!0},hideOnNoUserResponse:!1,connectWhenInView:!0,showDisclaimer:!1,showFaq:!1,showSuggestions:!0,customComponents:{},defaults:{visible:null},preChatEvents:[]}),Bo=["hideOnNoUserResponse","connectWhenInView","showDisclaimer","showFaq","showSuggestions","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon"],$o=(e,t)=>{const n=(i=t,Bo.reduce(((e,t)=>(t in i&&(e[t]=i[t]),e)),{})),{messages:r}=n,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(n,["messages"]);var i;let s=e;return Object.keys(o).length>0&&(s=Object.assign(Object.assign({},s),o)),r&&(s=Object.assign(Object.assign({},s),{messages:Object.assign(Object.assign({},s.messages),r)})),s},zo=Kn({name:"config",initialState:Fo,reducers:{setConfig:(e,{payload:t})=>$o(e,t),updateConfig:(e,{payload:t})=>$o(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(cr.fulfilled,(e=>e)).addCase(ar.fulfilled,((e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:o}})=>{e.preChatEvents=t.map((e=>({type:"message",payload:e}))),e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=o}))}}),{setConfig:Ho,updateConfig:Vo,setPreChatEvents:qo}=zo.actions,Wo=zo.reducer;class Go extends I{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const Ko={SeamlyGeneralError:R,SeamlyConfigurationError:N,SeamlySessionExpiredError:D,SeamlyOfflineError:Go,SeamlyUnauthorizedError:M,SeamlyUnavailableError:ir},Jo=Wn("catch-error",(e=>({payload:e})));function Xo({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:o,api:i,layoutMode:s}=mr(t()),{error:a,type:c}=n,l=Ko[null==a?void 0:a.name]?new Ko[a.name](a):new I(a);null==r||r(l,{namespace:o,api:i,layoutMode:s,conversationUrl:e.getConversationUrl(),action:c?n:void 0})};return e=>t=>{var r,o,i,s,a,c;try{return(null===(o=null===(r=t.payload)||void 0===r?void 0:r.originalEvent)||void 0===o?void 0:o.payload)?n({error:t.payload,type:null===(a=null===(s=null===(i=t.payload)||void 0===i?void 0:i.originalEvent)||void 0===s?void 0:s.payload)||void 0===a?void 0:a.type}):(null===(c=t.payload)||void 0===c?void 0:c.originalError)&&n({error:t.payload,type:void 0}),e(t)}catch(e){throw n({error:e}),e}}}}const Qo={controls:{}},Yo={value:"",touched:!1},Zo={controls:Yo},ei=Kn({name:"forms",initialState:Zo,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{var r;const o=t&&null!==(r=e[n])&&void 0!==r?r:Object.assign(Object.assign({},Qo),{persistData:t});e[n]=o},deregisterForm:(e,{payload:{formId:t}})=>{var n;return(null===(n=e[t])||void 0===n?void 0:n.persistData)||delete e[t],e},registerControl:(e,{payload:{name:t,formId:n}})=>{e[n].controls={[t]:Yo}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const o=Object.assign({},r.controls);return delete o[t],Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},r),{controls:o})})},updateControlValue:(e,{payload:{formId:t,name:n,value:r}})=>{var o;(null===(o=e[t])||void 0===o?void 0:o.controls)&&(e[t].controls[n].value=r)},updateControlTouched:(e,{payload:{formId:t,name:n,touched:r}})=>{var o;(null===(o=e[t])||void 0===o?void 0:o.controls[n])&&(e[t].controls[n].touched=r)}},extraReducers:e=>{e.addCase(Lr.pending,(()=>Zo))}}),{registerForm:ti,deregisterForm:ni,registerControl:ri,deregisterControl:oi,updateControlValue:ii,updateControlTouched:si}=ei.actions,ai=ei.reducer,ci=Kn({name:"app",initialState:{translations:{"errors.configError.message":"We are sorry this happened, please retry at a later time.","errors.configError.srText":"A chat configuration error occurred. Our apologies, please retry at a later time.","errors.configError.title":"Chat configuration error.","errors.general.buttonText":"Restart chat","errors.general.message":"Do you want to start a new chat session?","errors.general.srText":"Something went wrong with the chat session. You can restart the chat.","errors.general.title":"Something went wrong","errors.seamlyOffline.message":"There might be a problem with your or our network connection. The chat session should resume as soon the connection is available again.","errors.seamlyOffline.srText":"The chat has connection issues. There might be a problem with your or our network connection. The chat session should resume as soon as the connection is available again.","errors.seamlyOffline.title":"Connection issues","errors.seamlyUnavailable.buttonText":"Try again","errors.seamlyUnavailable.message":"The server could not be reached. Try again in a little while.","errors.seamlyUnavailable.srText":"The chat server could not be reached. Try again in a little while.","errors.seamlyUnavailable.title":"Server unavailable"},isLoading:!1,initialLocale:void 0,locale:void 0},reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(ar.fulfilled,((e,{payload:t})=>{e.initialLocale=t.locale})).addCase(lr.pending,(e=>{e.isLoading=!0})).addCase(lr.rejected,(e=>{e.isLoading=!1})).addCase(lr.fulfilled,((e,{payload:t})=>{e.isLoading=!1,(null==t?void 0:t.translations)&&(e.locale=t.locale,e.translations=Object.keys(t.translations).sort().reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t.translations[n]})),{}))}))}}),{setInitialLocale:li,setTranslations:ui}=ci.actions,pi=ci.reducer,di=[R,N,D,Go,M,ir];function fi({api:e}){return()=>t=>n=>{const{payload:r,type:o}=n;if(o===qr.type){if(!di.some((e=>r.name===e.name)))throw new R(r);"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}function hi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hi(Object(n),!0).forEach((function(t){bi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mi({api:e}){return()=>t=>n=>{const r=t(n);switch(n.type){case Do.toString():e.store.set("options",n.payload);break;case Ro.toString():e.store.set("options",yi(yi({},e.store.get("options")||{}),{},{[n.payload.option]:n.payload.value}))}return r}}const vi=yr((({i18n:e})=>e),(({translations:e})=>e)),gi=yr((({i18n:e})=>e),(({initialLocale:e})=>e)),wi=yr((({i18n:e})=>e),(({locale:e})=>e)),Oi=yr((({i18n:e})=>e),(({isLoading:e})=>e)),ji={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:Jn(),translatedEventGroups:{},translationProposal:null},xi=(e,t)=>{const n=[...e].reduce(((e,{payload:n},r,o)=>{var i;if(e[t]){if("divider"===(null==n?void 0:n.type)&&(null===(i=null==n?void 0:n.body)||void 0===i?void 0:i.translationEnabled))return o.splice(0),e;e[t].push(n.id)}return n.id===t&&(e[t]=[]),e}),{}),[[r,o]]=Object.entries(n);return{lastGroupId:e.filter((e=>{var t;return"divider"===(null===(t=e.payload)||void 0===t?void 0:t.type)})).map((e=>e.payload.id)).at(-1),groupId:r,eventIds:o}},_i=Kn({name:"translation",initialState:ji,reducers:{enableTranslation:(e,{payload:t})=>{e.isActive=!0,e.currentLocale=t},disableTranslation:e=>{e.isActive=!1,e.currentLocale=void 0},enableEventsTranslation:(e,{payload:{events:t,id:n}})=>{delete e.translatedEventGroups[n];const{lastGroupId:r}=xi(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:o,eventIds:i}=xi(t,n);e.lastGroupId=r,e.translatedEventGroups[o]=i},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(ar.fulfilled,((e,{payload:t})=>{var n;const r=null===(n=null==t?void 0:t.features)||void 0===n?void 0:n.translation;r&&(e.isAvailable=!0===r.enabled,e.languages=r.languages)})).addCase(jo,((e,{payload:t})=>{e.translationProposal=t.translationProposal})).addCase(to,((e,{payload:t})=>{e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)}))}}),{enableTranslation:Si,disableTranslation:Ci,enableEventsTranslation:Ei,disableEventsTranslation:Pi,setTranslationProposalPrompt:Ti,disableTranslationProposalPrompt:ki}=_i.actions,Ai=_i.reducer;function Ii({dispatch:e,getState:t}){return n=>r=>{const o=n(r),{payload:i}=r;switch(r.type){case jo.type:i?.translation?.enabled&&(e(Si(i.translation.locale)),e(lr(i.translation.locale)));break;case ar.fulfilled.type:i.locale&&e(lr(i.locale));break;case xo.type:i?.translation?.enabled&&(e(Si(i.translation.locale)),e(lr(i.locale)));break;case to.type:"info"===i.type&&"new_translation"===i?.payload?.body?.subtype&&i.payload.body.translationEnabled&&e(lr(i.payload.body.translationLocale));break;case Ci.type:const n=gi(t());e(lr(n))}return o}}const Ni=Kn({name:"visibility",initialState:{visibility:x.initialize,showInlineView:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(Nr.fulfilled,((e,{payload:t})=>{t&&(e.visibility=t)})).addCase(ar.fulfilled,((e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)}))}}),{setShowInlineView:Ri}=Ni.actions,Di=Ni.reducer,Mi=ft,Li=()=>{const e=Mi(),t=it(kr),n=!!t&&t!==x.hidden,r=t===x.open,o=t===x.minimized,i=(0,Ke.useCallback)((t=>e(Nr(t))),[e]);return{isVisible:n,isOpen:r,isMinimized:o,visible:t,setVisibility:i,openChat:()=>{i(x.open)},closeChat:()=>{i(x.minimized)}}},Ui=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,Ge.createRef)()})=>{const[r,o]=(0,Ke.useState)(null),i=!!(null==r?void 0:r.isIntersecting)||!t,s=i&&e,a=([e])=>o(e);return(0,Ke.useEffect)((()=>{const e=null==n?void 0:n.current;if(!window.IntersectionObserver||s||!e||!t)return()=>{};const r=new IntersectionObserver(a,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()}),[n,t,s]),{isVisible:i,containerRef:n}},Fi=()=>(0,Ke.useContext)(yt),Bi=()=>Fi().store||{},$i=()=>{const e=Fi();return(0,Ke.useCallback)((()=>e.hasConversation()),[e])};function zi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zi(Object(n),!0).forEach((function(t){Vi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Vi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qi=()=>{const e=Fi(),t=vr(),n=ft(),r=(0,Ke.useContext)(bt),o=Ur(),i=$i(),{visible:s,setVisibility:a}=Li(),c=Sr(),p=(0,Ke.useCallback)(((...e)=>{r.emit(...e)}),[r]),d=(0,Ke.useCallback)((()=>{e.sendContext(t.context||{}),p("ui.beforeStart",{visibility:s,hasConversation:i(),hasResponded:o,unreadMessageCount:c}),e.send("start"),p("ui.start",{visibility:s,hasConversation:i(),hasResponded:o,unreadMessageCount:c})}),[e,t.context,p,i,o,c,s]),f=(0,Ke.useCallback)((async()=>{n(Lr())}),[n]),h=(0,Ke.useCallback)((e=>({type:e,id:K(),transactionId:K(),participant:E,fromClient:!0,occurredAt:1e3*Date.now(),meta:{}})),[]),y=(0,Ke.useCallback)((e=>Hi(Hi({},h("text")),{},{body:{text:e}})),[h]),b=(0,Ke.useCallback)((({body:t,config:r={}})=>{if(""===t.trim())return;const o=Hi(Hi({},y(t)),r);e.send("message",o),p("message",o),n(to({type:"message",payload:Hi(Hi({},o),{},{optimisticallyInjected:!0})}))}),[e,n,p,y]),m=(0,Ke.useCallback)(((e,t=K())=>{n(to({type:"message",payload:Hi(Hi({},y(e)),{},{transactionId:t})}))}),[n,y]),v=(0,Ke.useCallback)(((e,t,r,o,i,s,a)=>{n(to({type:"message",payload:{type:"upload",id:e,transactionId:t,participant:E,fromClient:!0,occurredAt:r,meta:{},body:{contentType:o,filename:i,filesize:s,url:a}}}))}),[n]),g=(0,Ke.useCallback)(((e,t=K())=>{const r={body:{subtype:e,type:"divider"},fromClient:!1,fromHistory:!0,id:K(),transactionId:t,type:"divider"};n(to({type:"info",payload:r}))}),[n]),w=(0,Ke.useCallback)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==l&&n!==u&&p(`action.${n}`,t)}),[e,p]),O=(0,Ke.useCallback)((t=>{e.sendContext(t)}),[e]),j=(0,Ke.useCallback)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&(n(xo(e)),e.userResponded&&(n($r(e.userResponded)),a(x.open)))})).catch((e=>{n(qr({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}))),[e,n,a]);return{connect:j,start:d,sendMessage:b,sendAction:w,sendContext:O,reset:f,emitEvent:p,addMessageBubble:m,addUploadBubble:v,addDivider:g,apiConnected:e.connected,apiConfigReady:e.configReady}};function Wi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Gi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Wi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wi(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ki(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ji(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Xi(e){return e.reduce((function(e,t){return e.concat(Array.isArray(t)?Xi(t):t)}),[])}function Qi(e){var t={};return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=r.length?r.map((function(e){return null===e?"null":void 0===e?"undefined":"function"==typeof e?e.toString():e instanceof Date?e.toISOString():JSON.stringify(e)})).join("|"):"_(no-args)_";if(Object.prototype.hasOwnProperty.call(t,i))return t[i];var s=e.apply(void 0,r);return t[i]=s,s}}function Yi(e){for(var t=function(e){return/\s/.test(e)},n=[],r={},o=0,i=null,s=!1,a=0;a<e.length;){if(s&&(t(e[a])||"{"===e[a]))s=!1,i=e.slice(o,a),"{"===e[a]&&a--;else if(!s&&!t(e[a])){var c="{"===e[a];if(i&&c){var l=Zi(e,a);if(-1===l)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));r[i]=e.slice(a+1,l),a=l,i=null}else i&&(n.push(i),i=null),s=!0,o=a}a++}return s&&(i=e.slice(o)),i&&n.push(i),{args:n,cases:r}}function Zi(e,t){for(var n=0,r=t+1;r<e.length;r++){var o=e.charAt(r);if("}"===o){if(0===n)return r;n--}else"{"===o&&n++}return-1}function es(e){return ts(e.slice(1,-1),",",3)}function ts(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!e)return r;if(1===n)return r.push(e),r;var o=e.indexOf(t);if(-1===o)return r.push(e),r;var i=e.substring(0,o).trim(),s=e.substring(o+t.length+1).trim();return r.push(i),ts(s,t,n-1,r)}var ns;function rs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function os(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rs(Object(n),!0).forEach((function(t){bn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var is=0,ss="other";function as(e,t){for(var n=0,r="",o=0,i={};n<e.length;){if("#"!==e[n]||o)r+=e[n];else{var s="__hashToken".concat(is++);r+="{".concat(s,", number}"),i[s]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:i}}var cs="other";const ls=new(function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ki(this,e),bn(this,"format",Qi((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Xi(n.process(e,t)).join("")}))),this.locale=t,this.typeHandlers=r}var t,n;return t=e,n=[{key:"process",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return[];var n=e.indexOf("{");if(-1!==n){var r=Zi(e,n);if(-1===r)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));var o=e.substring(n,r+1);if(o){var i=[],s=e.substring(0,n);s&&i.push(s);var a=es(o),c=Gi(a,3),l=c[0],u=c[1],p=c[2],d=t[l];null==d&&(d="");var f=u&&this.typeHandlers[u];i.push(f?f(d,p,this.locale,t,this.process.bind(this)):d);var h=e.substring(r+1);return h&&i.push(this.process(h,t)),i}}return[e]}}],n&&Ji(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}())("en-GB",{plural:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=Yi(t),s=i.args,a=i.cases,c=parseInt(e);s.forEach((function(e){e.startsWith("offset:")&&(c-=parseInt(e.slice("offset:".length)))}));var l=[];if("PluralRules"in Intl){void 0!==ns&&ns.resolvedOptions().locale===n||(ns=new Intl.PluralRules(n));var u=ns.select(c);u!==ss&&l.push(u)}1===c&&l.push("one"),l.push("=".concat(c),ss);for(var p=0;p<l.length;p++){var d=l[p];if(d in a){var f=as(a[d],c),h=f.caseBody,y=f.numberValues;return o(h,os(os({},r),y))}}return e},select:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,o=Yi(t),i=o.cases;return e in i?r(i[e],n):cs in i?r(i.other,n):e}});function us(){const e=it(vi),t=it(wi),n=it(gi),r=it(Oi),o=(0,Ke.useCallback)(((n,o={})=>{const i=e[n];return i?ls.format(i,o):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),null)}),[e,t,r]);return{t:o,locale:t,initialLocale:n}}const ps=(0,Ge.createContext)(null),ds=()=>{const e=(0,Ke.useContext)(ps);return{sendPolite:(0,Ke.useCallback)((t=>{t&&e({ariaLive:v,messageText:t})}),[e]),sendAssertive:(0,Ke.useCallback)((t=>{t&&e({ariaLive:m,messageText:t})}),[e])}},fs=({children:e})=>((()=>{const e=xr(),{t}=us(),{isInline:n,isWindow:r,isApp:o}=Tr(),{isOpen:i,isVisible:s}=Li(),a=it(Ar),c=ft(),l=(0,Ke.useRef)(null),{start:u,connect:p,apiConfigReady:d,apiConnected:f}=qi(),h=$i(),y=(0,Ke.useRef)(null),b=(0,Ke.useRef)(null),m=(0,Ke.useRef)(!1),{sendAssertive:v}=ds();(0,Ke.useEffect)((()=>{s&&setTimeout((()=>{v(t("window.srTexts.onLoad"))}),500)}),[s,v,t]),(0,Ke.useEffect)((()=>{if(s!==b.current)return y.current=i,void(b.current=s);null!==y.current&&v(t(i?"window.srTexts.onOpen":"window.srTexts.onClose")),y.current=i,b.current=s}),[i,s,v,t]),(0,Ke.useEffect)((()=>(l.current=setTimeout((()=>{c(_o(!0))}),500),()=>{clearTimeout(l.current)})),[c]),(0,Ke.useEffect)((()=>(e.length&&(l.current=setTimeout((()=>{c(_o(!1))}),5e3)),()=>{clearTimeout(l.current)})),[e,c]),(0,Ke.useEffect)((()=>{d&&f||(m.current=!1)}),[d,f]);const g=(0,Ke.useCallback)((async()=>{f||(m.current=!0,await p()),(o||i||s&&n)&&u()}),[f,p,o,n,i,s,u]);(0,Ke.useEffect)((()=>{d&&!m.current&&(!r||i||h())&&(!n||s&&a)&&(h()&&i&&(clearTimeout(l.current),c(_o(!1))),g())}),[d,g,c,h,n,i,r,s,a])})(),(0,T.jsx)(T.Fragment,{children:e})),hs=(0,Ge.createContext)({}),ys=()=>vr().appContainerClassNames,bs=e=>{const{fromClient:t}=e.payload,n=["message"];return"info"===e.type?n.push("message--source-info"):t?n.push("message--source-user"):n.push("message--source-agent"),n},ms=(e=0)=>new Promise((t=>{setTimeout(t,e)})),vs=()=>{const{seamlyContainerElement:e}=wr(),t=ft();return[e,(0,Ke.useCallback)((e=>{t(Eo(e))}),[t])]},gs=e=>(0,Ke.useCallback)((()=>{var t;t=e,requestAnimationFrame((async()=>{await ms(180);const e="string"==typeof t?document.getElementById(t):t;V(e)}))}),[e]),ws=()=>{const e=Cr();return gs(e)},Os=(0,Ge.createContext)({});function js(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?js(Object(n),!0).forEach((function(t){_s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):js(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ss=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=wr(),{allowedMimeTypes:o,maxSize:i}=n.upload||{},{enabled:s,enabledFromEntry:a}=r||{},{allowedMimeTypes:c,maxSize:l}=xs(xs(xs({},t.upload||{allowedMimeTypes:[],maxSize:0}),o?{allowedMimeTypes:o}:{}),i?{maxSize:i}:{});return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:a||s,allowedMimeTypes:c,maxSize:l}},Cs=()=>{const{currentUploads:e}=wr(),t=ft(),n=(0,Ke.useContext)(Os);return{uploadFile:(0,Ke.useCallback)((e=>{n(e)}),[n]),clearUploads:(0,Ke.useCallback)((()=>{t(no())}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}};function Es(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ps(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Es(Object(n),!0).forEach((function(t){Ts(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Es(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ts(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ks=()=>{const{t:e}=us(),{options:t}=wr(),{panelActive:n,optionActive:r,userSelectedOptions:o,features:i}=t,{extraMenuItem:s,sendTranscript:a}=i,c={extraMenuItem:s,sendTranscript:a},l=t=>"extraMenuItem"===t?"Extra menu item":e(`options.${t}.menuTitle`),u=Object.keys(c).filter((e=>c[e])).map((e=>({name:e,title:l(e),available:c[e].enabled}))),p=s||a,d=ft(),{get:f,set:h}=Bi();return{allowOptionSelection:p,userSelectedOptions:o,features:i,menuOptions:u,initUserSelectedOptions:(0,Ke.useCallback)((()=>{const e=f("options")||{};d(Do(e))}),[f,d]),setUserSelectedOptions:(0,Ke.useCallback)((e=>{d(Do(e)),h("options",e)}),[h,d]),setUserSelectedOption:(0,Ke.useCallback)(((e,t)=>{const n=f("options")||{};h("options",Ps(Ps({},n),{},{[e]:t})),d(Ro({option:e,value:t}))}),[d,f,h]),showOption:e=>{d(Mo(e))},hideOption:()=>{d(co())},panelActive:n,optionActive:r}},As=()=>{const{optionsButtonId:e}=wr();return{id:e,focusButton:gs(e)}},Is=(0,Ge.createContext)(null),Ns=()=>(0,Ke.useContext)(Is);function Rs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ds(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rs(Object(n),!0).forEach((function(t){Ms(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ms(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ls=()=>{const e=ft(),{idleDetachCountdown:t}=wr(),{isOpen:n}=Li(),r=(0,Ke.useRef)({});r.current={hasCountdown:t.hasCountdown,isActive:t.isActive,remaining:t.remaining,wasStopped:t.wasStopped,isOpen:n};const{emitEvent:o,sendAction:i}=qi(),{t:s}=us(),{sendAssertive:a,sendPolite:c}=ds(),l=(0,Ke.useCallback)((e=>{const{isOpen:t}=r.current;t&&a(e)}),[a]),u=(0,Ke.useCallback)((e=>{const{isOpen:t}=r.current;t&&c(e)}),[c]),d=(0,Ke.useCallback)((t=>{const n=(e=>Math.ceil(e/1e3))(t),r=F(n);e(lo({delaySeconds:n,delayTime:r})),o("idleTimer.start"),l(`${s("idleDetachWarning.countdownTitle")} ${s("idleDetachWarning.countdownText")} ${s("idleDetachWarning.countdownTimer",r)}`)}),[e,o,l,s]),f=(0,Ke.useCallback)(((t,n)=>{const{hasCountdown:a,wasStopped:c}=r.current;a&&(t||(n||i({type:p}),l(s("idleDetachWarning.notifyTransferText"))),c||o("idleTimer.stop"),e(io()))}),[e,i,o,l,s]),h=(0,Ke.useCallback)((()=>{const{remaining:t}=r.current;if(t<=0)return;const n=t-1;n%10==0&&l(`${s("idleDetachWarning.countdownText")} ${s("idleDetachWarning.countdownTimer",F(n))}`),e(ao())}),[e,l,s]),y=(0,Ke.useCallback)((()=>{const{isActive:t,remaining:n}=r.current;t&&(e(Lo()),n&&(o("idleTimer.stop"),u(s("idleDetachWarning.srCountDownStoppedText"))))}),[e,o,u,s]);return Ds(Ds({},t),{},{initCountdown:d,endCountdown:f,decrementCountdown:h,stopCountdown:y})},Us=()=>{const e=ft(),t=wr().resumeConversationPrompt,{sendAction:n}=qi(),{t:r}=us(),{sendAssertive:o}=ds();return{continueChat:()=>{n({type:d,body:{type:"resume_conversation_prompt"}}),e(so())},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:p}),e(so())}}},Fs=()=>{const[e]=(0,Ke.useState)((()=>K()));return e},Bs=e=>{const t=(0,Ke.useRef)(null);t.current=e;const n="function"==typeof e;return(0,Ke.useMemo)((()=>n?(...e)=>t.current(...e):void 0),[n])};function $s(){const{sendAction:e}=qi(),t=ft(),n=(0,Ke.useCallback)(((n,r="translation_choice")=>{e({type:h,body:{enabled:!0,locale:n,source:r}}),t(Si(n)),t(ki())}),[e,t]),r=(0,Ke.useCallback)((()=>{e({type:h,body:{enabled:!1}}),t(Ci())}),[e,t]),{languages:o,isActive:i,isAvailable:s,currentLocale:a}=it((({translations:e})=>e));return{languages:o,isActive:i,isAvailable:s,currentLocale:a,enableTranslations:n,disableTranslations:r}}function zs(e){const{translatedBody:t,body:n}=e.payload?"participant"===e.type?{body:null===(r=e.payload)||void 0===r?void 0:r.participant.introduction,translatedBody:null===(i=null===(o=e.payload)||void 0===o?void 0:o.participant)||void 0===i?void 0:i.translatedIntroduction}:{body:e.payload.body,translatedBody:e.payload.translatedBody}:{body:void 0,translatedBody:void 0};var r,o,i;const s=!!t,a=it((e=>yr((e=>e.translations.translatedEventGroups),(t=>Object.values(t).every((t=>{var n;return!t.includes(null===(n=null==e?void 0:e.payload)||void 0===n?void 0:n.id)})))))(e));return{body:s&&a?null==t?void 0:t.data:n,hasTranslation:s,isTranslated:a&&s,locale:null==t?void 0:t.locale}}function Hs(){const e=it((({translations:e})=>e.containerId));return{id:e,focusContainer:gs(e)}}function Vs(e){const{languages:t}=$s();return(0,Ke.useMemo)((()=>{var n;return null===(n=null==t?void 0:t.find((t=>t.locale===e)))||void 0===n?void 0:n.nativeName}),[e,t])}const qs=({eventPayload:e})=>{const{t}=us(),{fromClient:n,participant:r}=e,o=(e=>wr().participantInfo.participants[e])(r)||{},{messages:i}=vr(),s=n?t("participants.user.name"):o&&o.name,{showAvatar:a,showName:c}=i[n?"user":"agent"]||{};if(!a&&!c)return null;const l=[];return a&&s&&o.avatar&&l.push((0,T.jsx)("span",{className:P("message__avatar"),children:(0,T.jsx)("img",{src:o.avatar,className:P("avatar"),alt:""})})),c&&l.push((0,T.jsx)("span",{className:P("message__author-name"),children:s})),l.length>0&&(0,T.jsx)("div",{className:P("message__author"),children:l})},Ws=["showParticipant","event","type","modifiers","children","bodyProps","info"];function Gs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ks(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gs(Object(n),!0).forEach((function(t){Js(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Js(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xs=function(e){let{showParticipant:t=!0,event:n,type:r,modifiers:o,children:i,bodyProps:s={},info:a}=e,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Ws);const l=bs(n),{hasTranslation:u,isTranslated:p,locale:d}=zs(n);return r&&l.push(`message--type-${r}`),o&&("string"==typeof o&&(o=o.split(" ").filter((e=>e.length))),o.forEach((e=>{l.push(`message--${e}`)}))),p&&l.push("message--is-translated"),u&&l.push("message--has-translation"),p&&(s=Ks(Ks({},s),{},{lang:d})),(0,T.jsx)(T.Fragment,{children:(0,T.jsxs)("div",Ks(Ks({className:P(l)},c),{},{children:[t&&(0,T.jsx)(qs,{eventPayload:n.payload}),(0,T.jsx)("div",Ks(Ks({className:P("message__body")},s),{},{children:i})),a&&(0,T.jsx)("div",{"aria-hidden":"true",className:P("message__info"),children:a})]}))})};function Qs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ys(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qs(Object(n),!0).forEach((function(t){Zs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ea=({id:e,action:t,buttonText:n,description:r,hasFocus:o,image:i,title:s,isCarouselItem:a})=>{const c=(0,Ke.useRef)(null),{sendMessage:l,sendAction:u,emitEvent:p}=qi(),d=Fs(),h=(0,Ke.useRef)(),b=t.type===O?"a":"button",m=(0,Ke.useCallback)((()=>p("action.click_card",{type:y,originMessage:e,action:t})),[p,e,t]),v=(0,Ke.useCallback)((()=>{if(m(),"ask"===t.type)l({body:t.ask});else if("topic"===t.type){const{topic:e,fallbackMessage:n}=t;u({type:f,body:{name:e,fallbackMessage:n}})}}),[l,t,u,m]),g=(0,Ke.useMemo)((()=>t.type===O?{href:t.link,rel:"noopener noreferrer",target:t.newTab?"_blank":"_self",onClick:m}:{onClick:v}),[t,v,m]);return(0,Ke.useEffect)((()=>{a&&(o&&h.current?window.requestAnimationFrame((()=>c.current.focus())):c.current.blur()),h.current=!0}),[o,a]),(0,T.jsxs)("div",{className:P("card__wrapper"),id:e,tabIndex:"-1",ref:c,children:[(0,T.jsx)("img",{className:P("card__image"),src:i,alt:""}),(0,T.jsxs)("div",{className:P("card__content"),id:e,children:[s&&(0,T.jsx)("h2",{className:P("card__title"),children:s}),r&&(0,T.jsx)("div",{className:P("card__description"),dangerouslySetInnerHTML:{__html:r}}),(0,T.jsx)(b,Ys(Ys({tabIndex:a&&!o?"-1":void 0,className:P("button","button--primary"),"aria-describedby":d},g),{},{children:n}))]})]})};function ta(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function na(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ta(Object(n),!0).forEach((function(t){ra(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ta(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ra(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oa(Object(n),!0).forEach((function(t){sa(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aa({item:e,items:t,index:n,isActive:r}){const{t:o}=us();return(0,T.jsx)("div",{className:P("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":o("carousel.slide.label",{index:n+1,total:t.length}),children:(0,T.jsx)(ea,ia(ia({},e),{},{isCarouselItem:!0,hasFocus:r}))})}const ca={send32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M6.714,14.985l17.837-7.906c0.681-0.302,1.414,0.301,1.25,1.027L22.273,23.59\tc-0.13,0.566-0.751,0.865-1.275,0.613l-3.623-1.752l-2.334,2.287c-0.572,0.562-1.538,0.156-1.538-0.645V21.01\tc0-0.217,0.078-0.43,0.222-0.594l7.676-8.841l-10.414,7.472l-4.351-2.445C5.987,16.236,6.033,15.287,6.714,14.985L6.714,14.985z"/></svg>',balloon32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,10.824v10.375c0,1.104-0.896,2-2,2h-4.694l-4.931,3.625v-3.625H10c-1.104,0-2-0.896-2-2V10.824\tc0-1.104,0.896-2,2-2h12C23.104,8.824,24,9.719,24,10.824z"/></svg>',newTopic32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,8.593l2.407,4.573l5.093,0.876l-3.604,3.702l0.74,5.115L16,20.574l-4.634,2.285l0.739-5.115L8.5,14.042\tl5.094-0.876L16,8.593z"/></svg>',newTranslation16:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 16 16"><path fill="#4A48C1" d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M14.1,7.1h-1.4c-0.1-1.5-0.4-2.9-1-4\tC13,4,13.9,5.4,14.1,7.1z M7.1,2.1v5H5C5.2,4.7,6.1,2.9,7.1,2.1z M7.1,8.9v5c-1-0.7-1.9-2.5-2.1-5H7.1z M8.9,13.9v-5H11\tC10.8,11.3,9.9,13.2,8.9,13.9z M8.9,7.1v-5c1,0.7,1.9,2.5,2.1,5H8.9z M4.2,3.1c-0.5,1.1-0.9,2.5-1,4H1.9C2.1,5.4,3,4,4.2,3.1z M1.9,8.9h1.4c0.1,1.5,0.4,2.9,1,4C3,12,2.1,10.5,1.9,8.9z M11.8,12.9c0.5-1.1,0.9-2.5,1-4h1.4C13.9,10.5,13,12,11.8,12.9z"/></svg>',newTranslation32:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,7c-4.9,0-9,4.1-9,9s4.1,9,9,9s9-4.1,9-9S20.9,7,16,7z M22.9,15h-1.6c-0.1-1.7-0.5-3.3-1.1-4.5\tC21.6,11.5,22.6,13.1,22.9,15z M15,9.4V15h-2.3C12.9,12.3,13.9,10.2,15,9.4z M15,17v5.6c-1.1-0.8-2.1-2.9-2.3-5.6H15z M17,22.6V17\th2.3C19.1,19.8,18.1,21.8,17,22.6z M17,15V9.4c1.1,0.8,2.1,2.9,2.3,5.6H17z M11.8,10.4c-0.6,1.3-1,2.8-1.1,4.5H9.1\tC9.4,13.1,10.4,11.5,11.8,10.4z M9.1,17h1.6c0.1,1.7,0.5,3.3,1.1,4.5C10.4,20.5,9.4,18.9,9.1,17z M20.2,21.5c0.6-1.3,1-2.8,1.1-4.5\th1.6C22.6,18.8,21.6,20.5,20.2,21.5z"/></svg>',avatar32:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">\n<path fill="#4A48C1" d="M10,14.8c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S11.1,14.8,10,14.8z M15.9,14.8c1.1,0,2-0.9,2-2s-0.9-2-2-2\n\ts-2,0.9-2,2S14.8,14.8,15.9,14.8z M21.8,10.8c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S22.9,10.8,21.8,10.8z M21.3,18.1H10.7\n\tC11.7,23.9,20.2,23.9,21.3,18.1z"/>\n</svg>\n',chevronDown8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M-0.001,2.876c0-0.247,0.091-0.494,0.273-0.688c0.38-0.401,1.013-0.418,1.414-0.039l1.938,1.834\tc0.199,0.188,0.547,0.188,0.746,0L6.31,2.15c0.401-0.379,1.034-0.362,1.414,0.04c0.379,0.401,0.361,1.034-0.04,1.414L5.745,5.437\tC4.782,6.35,3.213,6.35,2.249,5.436L0.311,3.603C0.103,3.406-0.001,3.142-0.001,2.876z"/></svg>',chevronDown32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M16,20.425c-0.782,0-1.563-0.291-2.159-0.874l-6.541-6.408c-0.395-0.387-0.401-1.02-0.015-1.414\tc0.387-0.394,1.021-0.4,1.414-0.015l6.541,6.408c0.42,0.409,1.102,0.409,1.52-0.001l6.541-6.407c0.396-0.386,1.028-0.38,1.414,0.015\tc0.387,0.395,0.381,1.027-0.014,1.414l-6.541,6.407C17.563,20.133,16.782,20.425,16,20.425z"/></svg>',chevronRight8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M2.875,7.998c-0.247,0-0.494-0.091-0.688-0.273c-0.401-0.38-0.418-1.013-0.039-1.414l1.834-1.938\tc0.188-0.199,0.188-0.547,0-0.746l-1.835-1.94c-0.379-0.401-0.362-1.034,0.04-1.414s1.034-0.361,1.414,0.04l1.834,1.939\tc0.913,0.963,0.913,2.532-0.001,3.496L3.601,7.686C3.405,7.894,3.14,7.998,2.875,7.998z"/></svg>',chevronRight16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M6.5,13c-0.247,0-0.494-0.091-0.687-0.273c-0.401-0.38-0.419-1.013-0.04-1.414L8.22,8.727\tc0.373-0.394,0.373-1.06,0-1.454L5.773,4.687c-0.379-0.401-0.362-1.034,0.04-1.414c0.4-0.378,1.034-0.362,1.414,0.04l2.446,2.586\tc1.096,1.159,1.096,3.043,0,4.203l-2.446,2.586C7.03,12.896,6.765,13,6.5,13z"/></svg>',close8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M7.705,7.729C7.511,7.923,7.255,8.02,7,8.02c-0.257,0-0.514-0.099-0.709-0.295L4,5.423L1.709,7.725\tC1.513,7.921,1.257,8.02,1,8.02c-0.255,0-0.51-0.097-0.706-0.291c-0.391-0.39-0.393-1.022-0.003-1.414l2.298-2.309l-2.27-2.28\tC-0.07,1.334-0.068,0.701,0.323,0.311c0.392-0.389,1.024-0.387,1.415,0.003L4,2.587l2.263-2.274C6.653-0.077,7.287-0.079,7.677,0.31\tC8.068,0.7,8.07,1.333,7.681,1.725l-2.27,2.281l2.298,2.309C8.099,6.705,8.097,7.339,7.705,7.729z"/></svg>',close16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M12.709,11.295L9.411,7.982l3.262-3.276c0.39-0.392,0.388-1.024-0.004-1.414\tc-0.39-0.39-1.023-0.388-1.414,0.003L8,6.564L4.746,3.295C4.357,2.904,3.724,2.903,3.332,3.292C2.94,3.682,2.939,4.315,3.329,4.707\tl3.261,3.275l-3.298,3.313c-0.39,0.391-0.388,1.024,0.003,1.414C3.49,12.903,3.745,13,4,13c0.257,0,0.513-0.099,0.708-0.295L8,9.399\tl3.291,3.306C11.486,12.901,11.743,13,12,13c0.255,0,0.511-0.097,0.705-0.291C13.097,12.319,13.099,11.686,12.709,11.295z"/></svg>',enlarge32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,9v6.5c0,0.552-0.447,1-1,1s-1-0.448-1-1v-4.086L11.414,22H15.5c0.552,0,1,0.447,1,1s-0.448,1-1,1H9\tc-0.13,0-0.26-0.026-0.382-0.077c-0.245-0.102-0.439-0.296-0.541-0.541C8.026,23.26,8,23.13,8,23v-6.5c0-0.552,0.448-1,1-1\ts1,0.448,1,1v4.085L20.586,10H16.5c-0.552,0-1-0.448-1-1s0.448-1,1-1H23c0.13,0,0.26,0.026,0.382,0.077\tc0.245,0.102,0.439,0.296,0.541,0.541C23.974,8.74,24,8.87,24,9z"/></svg>',options32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M26.1,21.383c0.334-0.625,0.602-1.279,0.812-1.949L32,18.609V13.51l-5.058-0.846\tc-0.208-0.67-0.468-1.325-0.795-1.956l3.009-4.145l-3.604-3.634L21.38,5.903c-0.626-0.333-1.276-0.602-1.948-0.81L18.609,0\tl-5.098,0.001l-0.847,5.061c-0.669,0.203-1.326,0.465-1.957,0.794L6.562,2.847L2.929,6.449l2.973,4.171\tC5.569,11.247,5.3,11.9,5.091,12.569L0,13.373v5.099l5.06,0.866c0.204,0.669,0.467,1.324,0.796,1.955l-3.009,4.146l3.601,3.635\tl4.171-2.975c0.627,0.335,1.282,0.603,1.951,0.811L13.372,32h5.118l0.849-5.057c0.668-0.207,1.323-0.469,1.953-0.795l4.144,3.01\tl3.639-3.604L26.1,21.383z M19.01,19.035c-1.675,1.663-4.381,1.652-6.041-0.025c-1.662-1.675-1.649-4.381,0.024-6.042\tc1.676-1.661,4.382-1.648,6.043,0.025C20.699,14.67,20.686,17.377,19.01,19.035z"/></svg>',file32:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" x="0px" y="0px" version="1.1" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,28.5c-3.6,0-6.5-3-6.5-6.6V9.6c0-0.6,0.4-1,1-1s1,0.4,1,1v12.3c0,2.5,2,4.6,4.5,4.6\tc2.5,0,4.5-2.1,4.5-4.6V8.3c0-1.5-1.2-2.8-2.7-2.8c-1.5,0-2.7,1.3-2.7,2.8v13.5c0,0.6,0.5,1.1,1,1.1c0.6,0,1-0.5,1-1.1v-10\tc0-0.6,0.4-1,1-1s1,0.4,1,1v10c0,1.7-1.4,3.1-3,3.1s-3-1.4-3-3.1V8.3c0-2.6,2.1-4.8,4.7-4.8c2.6,0,4.7,2.2,4.7,4.8v13.6\tC22.5,25.5,19.6,28.5,16,28.5z"/></svg>',upload32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M9.488,13.481c-0.391-0.391-0.391-1.023,0-1.414l5.805-5.805c0.026-0.026,0.06-0.036,0.088-0.058\tc0.073-0.06,0.146-0.119,0.235-0.156c0.246-0.103,0.522-0.103,0.769,0c0.093,0.039,0.171,0.101,0.249,0.165\tc0.023,0.02,0.053,0.027,0.074,0.049l5.805,5.805c0.391,0.391,0.391,1.023,0,1.414c-0.195,0.195-0.451,0.293-0.707,0.293\ts-0.512-0.098-0.707-0.293L17,9.383V20.33c0,0.553-0.447,1-1,1c-0.552,0-1-0.447-1-1V9.383l-4.098,4.098\tC10.512,13.872,9.879,13.872,9.488,13.481z M22.819,24.031H9.181c-0.552,0-1,0.447-1,1s0.448,1,1,1h13.639c0.553,0,1-0.447,1-1\tS23.372,24.031,22.819,24.031z"/></svg>',download16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#FFF" d="M3.175,7.726c-0.413-0.367-0.45-0.999-0.083-1.412c0.367-0.413,0.999-0.45,1.412-0.083L7,8.45V1.5\tc0-0.552,0.448-1,1-1c0.553,0,1,0.448,1,1v6.95l2.496-2.219c0.412-0.367,1.044-0.331,1.411,0.083\tc0.367,0.413,0.33,1.045-0.083,1.412l-4.16,3.698c-0.047,0.041-0.103,0.062-0.154,0.094c-0.047,0.028-0.089,0.064-0.141,0.085\tC8.25,11.649,8.125,11.677,8,11.677c-0.126,0-0.25-0.027-0.369-0.074c-0.05-0.021-0.09-0.055-0.136-0.083\tc-0.053-0.031-0.111-0.053-0.159-0.096L3.175,7.726z M12.018,13.5H3.983c-0.552,0-1,0.447-1,1s0.448,1,1,1h8.035\tc0.553,0,1-0.447,1-1S12.57,13.5,12.018,13.5z"/></svg>',error16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#ad001f" d="M15.744,13.104L9.097,1.47c-0.604-1.055-1.59-1.055-2.193,0L0.256,13.104\tc-0.604,1.056-0.102,1.919,1.113,1.919H14.63C15.847,15.022,16.348,14.159,15.744,13.104z M7,5.045c0-0.552,0.448-1,1-1s1,0.448,1,1\tv3.656c0,0.552-0.448,1-1,1s-1-0.448-1-1V5.045z M8,13.212c-0.748,0-1.354-0.607-1.354-1.354c0-0.748,0.606-1.354,1.354-1.354\ts1.354,0.606,1.354,1.354C9.354,12.604,8.748,13.212,8,13.212z"/></svg>',arrowLeft16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M13.6,8c0,0.6-0.4,1-1,1h-7l2.2,2.5c0.4,0.4,0.3,1-0.1,1.4c-0.2,0.2-0.4,0.2-0.7,0.2c-0.3,0-0.6-0.1-0.8-0.3\n\tL2.6,8.6c0,0-0.1-0.1-0.1-0.2c0,0-0.1-0.1-0.1-0.1c0-0.1-0.1-0.2-0.1-0.3c0,0,0,0,0,0c0,0,0,0,0,0c0-0.1,0-0.3,0.1-0.4\n\tc0,0,0.1-0.1,0.1-0.1c0-0.1,0.1-0.1,0.1-0.2l3.7-4.1c0.4-0.4,1-0.4,1.4-0.1c0.4,0.4,0.4,1,0.1,1.4L5.6,7h7C13.2,7,13.6,7.4,13.6,8z"\n\t/>\n</svg>\n',arrowRight16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M2.4,8.1c0-0.6,0.4-1,1-1h7L8.1,4.5c-0.4-0.4-0.3-1,0.1-1.4c0.2-0.2,0.4-0.2,0.7-0.2c0.3,0,0.6,0.1,0.8,0.3\n\tl3.7,4.2c0,0,0.1,0.1,0.1,0.2c0,0,0.1,0.1,0.1,0.1c0,0.1,0.1,0.2,0.1,0.3c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.3-0.1,0.4\n\tc0,0-0.1,0.1-0.1,0.1c0,0.1-0.1,0.1-0.1,0.2l-3.7,4.1c-0.4,0.4-1,0.4-1.4,0.1c-0.4-0.4-0.4-1-0.1-1.4l2.2-2.4h-7\n\tC2.8,9.1,2.4,8.6,2.4,8.1z"/>\n</svg>\n',check32:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="32px"\n height="32px"\n x="0px"\n y="0px"\n viewBox="0 0 32 32"\n>\n <path\n fill="currentColor"\n d="M22.9,9.3l-9.3,9.3l-3.2-3.2c-0.9-0.9-2.3-0.9-3.2,0l0,0c-0.9,0.9-0.9,2.3,0,3.2l3.2,3.2l0,0l1.6,1.6\n\tc0.9,0.9,2.3,0.9,3.2,0l1.6-1.6l9.3-9.3c0.9-0.9,0.9-2.3,0-3.2l0,0C25.2,8.4,23.7,8.4,22.9,9.3z"\n />\n</svg>\n',check16:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="16px"\n height="16px"\n x="0px"\n y="0px"\n viewBox="0 0 16 16"\n>\n <path\n fill="currentColor"\n d="M11.6,4.3l-5,5L4.9,7.5C4.4,7,3.7,7,3.2,7.5l0,0C2.8,8,2.8,8.7,3.2,9.2l1.7,1.7l0,0l0.8,0.8\n\tc0.5,0.5,1.2,0.5,1.7,0l0.8-0.8l5-5c0.5-0.5,0.5-1.2,0-1.7l0,0C12.8,3.8,12.1,3.8,11.6,4.3z"\n />\n</svg>\n'},la=({name:e,size:t="32",className:n,alt:r})=>{const o=`${e}${t}`;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{"aria-hidden":"true",className:n||P("icon"),dangerouslySetInnerHTML:{__html:ca[o]}}),r&&(0,T.jsx)("span",{className:P("visually-hidden"),children:r})]})};function ua({items:e,currentIndex:t,onChange:n,children:r}){const{t:o}=us(),i=e.length;return(0,T.jsxs)("div",{className:P("carousel-controls"),children:[(0,T.jsx)("button",{className:P("button","button--previous"),"aria-label":o("carousel.controls.previous"),onClick:()=>{n((t-1+i)%i)},children:(0,T.jsx)(la,{name:"arrowLeft",size:"16"})}),r,(0,T.jsx)("button",{className:P("button","button--next"),"aria-label":o("carousel.controls.next"),onClick:()=>{n((t+1)%i)},children:(0,T.jsx)(la,{name:"arrowRight",size:"16"})})]})}function pa({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:o}){const i=e.length,s=(0,Ke.useCallback)((e=>{const r=Number(e.target.dataset.item||"0"),o=Math.min(i-1,Math.max(0,r));o!==t&&n(o)}),[i,t,n]);return(0,T.jsx)("div",{className:P("carousel-pagination__wrapper"),role:"group",children:(0,T.jsx)("ul",{className:P("carousel-pagination"),children:e.map(((e,n)=>{const i=t===n;return(0,T.jsx)("li",{className:P("carousel-pagination__item",i?"is-active":void 0),children:(0,T.jsx)("button",{className:P("carousel-pagination__button"),type:"button",onClick:s,"data-item":n,"aria-disabled":i?"true":void 0,"aria-label":o(e,n)})},r(e,n,"pagination-item-"))}))})})}const da=(e,t,n)=>`${n}${t}`,fa=e=>e.label,ha=({target:e})=>{e.scrollLeft=0};function ya({currentIndex:e,onChange:t,getItemKey:n=da,getItemLabel:r=fa,items:o}){const i=Fs(),s=o.length,[a,c]=(0,Ke.useState)(Number(e||"0"));(0,Ke.useEffect)((()=>{c(Number(e||"0"))}),[c,e]);const l=(0,Ke.useRef)([]);l.current=(0,Ke.useMemo)((()=>Array(s).fill(1).map((()=>(0,Ge.createRef)()))),[s]);const u=(0,Ke.useRef)(!0),p=(0,Ke.useRef)();return p.current=t,(0,Ke.useEffect)((()=>{u.current?u.current=!1:p.current&&p.current(a)}),[a]),(0,T.jsxs)("div",{className:P("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,T.jsx)("div",{className:P("carousel__slides-wrapper"),onScroll:ha,children:(0,T.jsx)("div",{id:i,className:P("carousel__slides"),style:{width:100*s+"%",left:-100*a+"%"},"aria-live":"polite","aria-atomic":"false",children:o.map(((e,t)=>{const r=a===t;return(0,T.jsx)("div",{ref:l.current[t],className:P("carousel__slide",r?"is-active":void 0),"aria-hidden":r?void 0:"true",children:(0,T.jsx)(aa,{item:e,items:o,currentIndex:a,index:t,isActive:r})},n(e,t,"item-"))}))})}),(0,T.jsx)("div",{className:P("carousel__controls"),children:(0,T.jsx)(ua,{currentIndex:a,items:o,onChange:c,controlId:i,children:(0,T.jsx)("div",{className:P("carousel__pagination"),children:(0,T.jsx)(pa,{currentIndex:a,items:o,onChange:c,getItemKey:n,getItemLabel:r})})})})]})}const ba=(e,t,n="")=>`${n}${e.title}:${t}`,ma=e=>e.title,va=["event","children"];function ga(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ga(Object(n),!0).forEach((function(t){Oa(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ga(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Oa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ja=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,xa=({id:e,categories:t=[],question:n,onClick:r,hasIcon:o})=>{const i=(0,Ke.useMemo)((()=>["suggestions__item",...t.map(ja)]),[t]),s=(0,Ke.useCallback)((()=>{r&&r({id:e,question:n})}),[e,n,r]);return(0,T.jsx)("li",{className:P(i),children:(0,T.jsxs)("button",{type:"button",onClick:s,className:P("button","button--primary"),children:[o&&(0,T.jsx)(la,{name:"chevronRight",size:"8"}),n]})})};function _a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ca=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>(0,T.jsx)("ul",{className:P("suggestions__list",e),children:t.map((e=>(0,T.jsx)(xa,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_a(Object(n),!0).forEach((function(t){Sa(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({hasIcon:r,onClick:n},e),e.id)))}),Ea=["event"];function Pa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ta(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pa(Object(n),!0).forEach((function(t){ka(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ka(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Aa=e=>{const{sendAction:t}=qi();return n=>{n.target&&n.target.dataset.linkId&&t({type:"navigate",originMessage:e,link:{id:n.target.dataset.linkId,url:n.target.getAttribute("href")}})}};function Ia(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Na(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ia(Object(n),!0).forEach((function(t){Ra(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ia(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ra(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Da({children:e,childrenHTML:t,className:n,graphicSrc:r,graphicType:o="icon",iconName:i,iconSize:s,iconClassName:a,dividerType:c}){const l=Boolean(i||r),u=t?{dangerouslySetInnerHTML:{__html:t}}:{children:e};return(0,T.jsxs)("div",{className:P("divider",c&&`divider--type-${c}`,n),children:[l&&(0,T.jsx)("span",{className:P("divider__graphic"),children:i?(0,T.jsx)(la,{name:i,size:s,className:a}):(0,T.jsx)("img",{src:r,className:P({icon:"icon"===o,avatar:"avatar"===o},a)})}),(0,T.jsx)("div",Na({className:P("divider__body")},u))]})}const Ma={[g.new_topic]:"newtopic"},La=["event"];function Ua(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ba={default:({event:e})=>{const{t}=us(),{subtype:n}=e.payload.body,r=Ma[g[n]];return(0,T.jsx)(Da,{dividerType:r,iconName:g[n],children:(0,T.jsx)("p",{children:t(`dividerKeys.${g[n]}`)})})},[g.new_translation]:({event:e})=>{const{t}=us(),n=xr(),{body:{restartButtonText:r,translationEnabled:o,translationLocale:i,text:s,title:a},id:c}=e.payload,{enableTranslations:l}=$s(),u=it((e=>e.translations.translatedEventGroups)),p=ft(),d=(0,Ke.useCallback)((()=>{u[c]?p(Ei({events:n,id:c})):p(Pi({events:n,id:c}))}),[p,n,c,u]);return(0,T.jsxs)(Da,{iconName:"newTranslation",dividerType:"newtranslation",children:[(0,T.jsx)("p",{className:P("divider__title"),children:a}),s&&(0,T.jsx)("p",{children:s}),o?(0,T.jsx)(T.Fragment,{children:(0,T.jsx)("button",{className:P("button","button--secondary"),onClick:d,children:t(u[c]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):(0,T.jsx)("button",{className:P("button","button--secondary"),"data-testid":"restartTranslationButton",onClick:()=>{l(i)},children:r})]})}},$a={month:"long",day:"numeric",year:"numeric"},za={hour:"numeric",minute:"numeric"},Ha=({event:e})=>{const t=(()=>{const[e,t]=(0,Ke.useReducer)((e=>e+1),0);return(0,Ke.useCallback)((()=>{setTimeout((()=>{t()}))}),[])})(),{date:n,time:r,timeUntilMidnight:o,srText:i}=(e=>{const{t}=us(),n=vr()?.context?.locale??[],r=new Date(e),o=new Date,i=new Date(o);i.setHours(24,0,0,0);const s=i-o,a=r.toString(),c=new Intl.DateTimeFormat(n,za).format(r);let l=((e,t)=>{const n=new Date(t).setHours(0,0,0,0),r=e.getTime(),o=864e5;return r>=n+o?e:r>n?"today":r>n-o?"yesterday":e})(r,o);switch(l){case"today":l=t("dateTime.today");break;case"yesterday":l=t("dateTime.yesterday");break;default:l=new Intl.DateTimeFormat(n,$a).format(r)}return{date:l,srText:t("dateTime.srText",{date:l,time:c}),time:c,fullDateTime:a,timeUntilMidnight:s}})(U(e.timeIndicator));return(0,Ke.useEffect)((()=>{const e=setTimeout((()=>{t()}),o);return()=>{clearTimeout(e)}}),[t,o]),(0,T.jsxs)(Da,{dividerType:"time-indicator",children:[(0,T.jsxs)("p",{className:P("divider__time"),"aria-hidden":"true",children:[(0,T.jsx)("span",{children:n}),(0,T.jsx)("span",{children:r})]}),(0,T.jsx)("p",{className:P("visually-hidden"),children:i})]})};var Va=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],qa=Va.join(","),Wa="undefined"==typeof Element,Ga=Wa?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ka=!Wa&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},Ja=function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(qa));return t&&Ga.call(e,qa)&&r.unshift(e),r.filter(n)},Xa=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if("SLOT"===s.tagName){var a=s.assignedElements(),c=e(a.length?a:s.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:s,candidates:c})}else{Ga.call(s,qa)&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var l=s.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(s),u=!r.shadowRootFilter||r.shadowRootFilter(s);if(l&&u){var p=e(!0===l?s.children:l.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:s,candidates:p})}else i.unshift.apply(i,s.children)}}return o},Qa=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},Ya=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Za=function(e){return"INPUT"===e.tagName},ec=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},tc=function(e,t){return!(t.disabled||function(e){return Za(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Ga.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Ga.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ec(e)}else{if("function"==typeof r){for(var i=e;e;){var s=e.parentElement,a=Ka(e);if(s&&!s.shadowRoot&&!0===r(s))return ec(e);e=e.assignedSlot?e.assignedSlot:s||a===e.ownerDocument?s:a.host}e=i}if(function(e){for(var t,n=Ka(e).host,r=!!(null!==(t=n)&&void 0!==t&&t.ownerDocument.contains(n)||e.ownerDocument.contains(e));!r&&n;){var o;r=!(null===(o=n=Ka(n).host)||void 0===o||!o.ownerDocument.contains(n))}return r}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Ga.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},nc=function(e,t){return!(function(e){return function(e){return Za(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Ka(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||Qa(t)<0||!tc(e,t))},rc=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},oc=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,s=i?t.scopeParent:t,a=Qa(s,i),c=i?e(t.candidates):s;0===a?i?n.push.apply(n,c):n.push(s):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:c})})),r.sort(Ya).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ic=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Xa([e],t.includeContainer,{filter:nc.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:rc}):Ja(e,t.includeContainer,nc.bind(null,t)),oc(n)},sc=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Ga.call(e,qa)&&nc(t,e)},ac=Va.concat("iframe").join(","),cc=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Ga.call(e,ac)&&tc(t,e)};function lc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lc(Object(n),!0).forEach((function(t){pc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var dc=[],fc=function(e){return setTimeout(e,0)},hc=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},yc=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},bc=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target};function mc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mc(Object(n),!0).forEach((function(t){gc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const wc=({children:e,onClose:t,"aria-label":n,"aria-labelledby":r,fallBackFocusRef:o})=>{const i=Fs(),s=(0,Ke.useRef)(null),a=(0,Ke.useRef)(null),[c,l]=(0,Ke.useState)(!1);return(0,Ke.useEffect)((()=>{return c&&(a.current=(e=s.current,t={initialFocus:o&&o.current?o.current:null},r=(null==t?void 0:t.document)||document,i=(null==t?void 0:t.trapStack)||dc,l=uc({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},t),u={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},p=function(e,t,n){return e&&void 0!==e[t]?e[t]:l[n||t]},d=function(e){return u.containerGroups.findIndex((function(t){var n=t.container,r=t.tabbableNodes;return n.contains(e)||r.find((function(t){return t===e}))}))},f=function(e){var t=l[e];if("function"==typeof t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];t=t.apply(void 0,o)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var s=t;if("string"==typeof t&&!(s=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return s},h=function(){var e=f("initialFocus");if(!1===e)return!1;if(void 0===e)if(d(r.activeElement)>=0)e=r.activeElement;else{var t=u.tabbableGroups[0];e=t&&t.firstTabbableNode||f("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},y=function(){if(u.containerGroups=u.containers.map((function(e){var t=ic(e,l.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?Xa([e],t.includeContainer,{filter:tc.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Ja(e,t.includeContainer,tc.bind(null,t))}(e,l.tabbableOptions);return{container:e,tabbableNodes:t,focusableNodes:n,firstTabbableNode:t.length>0?t[0]:null,lastTabbableNode:t.length>0?t[t.length-1]:null,nextTabbableNode:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=n.findIndex((function(t){return t===e}));if(!(r<0))return t?n.slice(r+1).find((function(e){return sc(e,l.tabbableOptions)})):n.slice(0,r).reverse().find((function(e){return sc(e,l.tabbableOptions)}))}}})),u.tabbableGroups=u.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),u.tabbableGroups.length<=0&&!f("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},b=function e(t){!1!==t&&t!==r.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!l.preventScroll}),u.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(h()))},m=function(e){var t=f("setReturnFocus",e);return t||!1!==t&&e},v=function(e){var t=bc(e);d(t)>=0||(yc(l.clickOutsideDeactivates,e)?n.deactivate({returnFocus:l.returnFocusOnDeactivate&&!cc(t,l.tabbableOptions)}):yc(l.allowOutsideClick,e)||e.preventDefault())},g=function(e){var t=bc(e),n=d(t)>=0;n||t instanceof Document?n&&(u.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),b(u.mostRecentlyFocusedNode||h()))},w=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==yc(l.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var t=bc(e);y();var n=null;if(u.tabbableGroups.length>0){var r=d(t),o=r>=0?u.containerGroups[r]:void 0;if(r<0)n=e.shiftKey?u.tabbableGroups[u.tabbableGroups.length-1].lastTabbableNode:u.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var i=hc(u.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(i<0&&(o.container===t||cc(t,l.tabbableOptions)&&!sc(t,l.tabbableOptions)&&!o.nextTabbableNode(t,!1))&&(i=r),i>=0){var s=0===i?u.tabbableGroups.length-1:i-1;n=u.tabbableGroups[s].lastTabbableNode}}else{var a=hc(u.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(a<0&&(o.container===t||cc(t,l.tabbableOptions)&&!sc(t,l.tabbableOptions)&&!o.nextTabbableNode(t))&&(a=r),a>=0){var c=a===u.tabbableGroups.length-1?0:a+1;n=u.tabbableGroups[c].firstTabbableNode}}}else n=f("fallbackFocus");n&&(e.preventDefault(),b(n))}(e)},O=function(e){var t=bc(e);d(t)>=0||yc(l.clickOutsideDeactivates,e)||yc(l.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},j=function(){if(u.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)}(i,n),u.delayInitialFocusTimer=l.delayInitialFocus?fc((function(){b(h())})):b(h()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",O,{capture:!0,passive:!1}),r.addEventListener("keydown",w,{capture:!0,passive:!1}),n},x=function(){if(u.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",O,!0),r.removeEventListener("keydown",w,!0),n},n={get active(){return u.active},get paused(){return u.paused},activate:function(e){if(u.active)return this;var t=p(e,"onActivate"),n=p(e,"onPostActivate"),o=p(e,"checkCanFocusTrap");o||y(),u.active=!0,u.paused=!1,u.nodeFocusedBeforeActivation=r.activeElement,t&&t();var i=function(){o&&y(),j(),n&&n()};return o?(o(u.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!u.active)return this;var t=uc({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},e);clearTimeout(u.delayInitialFocusTimer),u.delayInitialFocusTimer=void 0,x(),u.active=!1,u.paused=!1,function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}(i,n);var r=p(t,"onDeactivate"),o=p(t,"onPostDeactivate"),s=p(t,"checkCanReturnFocus"),a=p(t,"returnFocus","returnFocusOnDeactivate");r&&r();var c=function(){fc((function(){a&&b(m(u.nodeFocusedBeforeActivation)),o&&o()}))};return a&&s?(s(m(u.nodeFocusedBeforeActivation)).then(c,c),this):(c(),this)},pause:function(){return u.paused||!u.active||(u.paused=!0,x()),this},unpause:function(){return u.paused&&u.active?(u.paused=!1,y(),j(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return u.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),u.active&&y(),this}},n.updateContainerElements(e),n),a.current.activate()),()=>{a.current&&a.current.deactivate()};var e,t,n,r,i,l,u,p,d,f,h,y,b,m,v,g,w,O,j,x}),[c,o]),(0,Ke.useEffect)((()=>{const e=(()=>{const e=[],t=[];return document.querySelectorAll('body > *:not([role="dialog"])').forEach((n=>{const r=n.getAttribute("aria-hidden");null!==r&&"false"!==r||(e.push(r),t.push(n),n.setAttribute("aria-hidden","true"))})),()=>{t.forEach(((t,n)=>{const r=e[n];null===r?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",r)}))}})();return()=>{e()}}),[c]),(0,Ke.useEffect)((()=>{c&&s.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()}))}),[c,t]),(0,Ke.useLayoutEffect)((()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",i),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),n&&t.setAttribute("aria-label",n),r&&t.setAttribute("aria-labelledby",r),e.appendChild(t),s.current=t,l(!0),()=>{s.current&&(e.removeChild(s.current),s.current=null)}}),[n,r,i]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>s.current&&(0,Ge.render)(e,s.current)}):s.current&&(0,Ge.render)((0,Ge.toChildArray)(e).map((e=>(e.props=vc(vc({},e.props),{},{onClose:t}),e))),s.current)},Oc=({url:e,description:t,onClose:n})=>{const{zIndex:r,layoutMode:o,namespace:i}=vr(),s=Ns(),a=ys(),c=(0,Ke.useRef)(null),{t:l}=us(),u=["modal",`app--layout-${o}`,`namespace--${i}`,...a],p=e=>{e.stopPropagation()},d=()=>{n()},f=r?{zIndex:r+1}:void 0;return(0,T.jsx)(wc,{onClose:n,"aria-label":l("lightbox.heading"),fallBackFocusRef:c,children:({onClose:n,modalRenderFn:r})=>r((n=>(0,T.jsx)("div",{className:P(u),onClick:d,style:f,children:(0,T.jsxs)("div",{className:P("modal__float"),tabIndex:"-1",onMouseDown:s,onKeyDown:s,onTouchStart:s,onMouseMove:s,onWheel:s,onPointerDown:s,onPointerMove:s,ref:c,children:[(0,T.jsx)("div",{className:P("modal__inner"),onClick:p,children:(0,T.jsx)("img",{className:P("modal__image"),src:e,alt:t})}),(0,T.jsxs)("button",{type:"button",className:P("modal__close"),onClick:n,children:[(0,T.jsx)(la,{name:"close",size:"16"}),l("lightbox.closeLabel")]})]})}))(n))})},jc=({description:e,url:t})=>{const{t:n}=us(),[r,o]=(0,Ke.useState)(!1);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("button",{type:"button",className:P("modal__enlarge"),onClick:()=>{o(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),(0,T.jsx)(la,{name:"enlarge",size:"32"})]}),r&&(0,T.jsx)(Oc,{url:t,description:e,onClose:()=>{o(!1)}})]})},xc=["event","descriptorId"];function _c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_c(Object(n),!0).forEach((function(t){Cc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ec=["event"];function Pc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Tc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pc(Object(n),!0).forEach((function(t){kc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function kc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ac=["event"];function Ic(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ic(Object(n),!0).forEach((function(t){Rc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ic(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Dc=e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Ac);const{body:r}=zs(t),o=Aa(t.payload.id),i=(0,Ke.useMemo)((()=>t.payload.optimisticallyInjected?{children:(0,T.jsx)("p",{children:r.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:r.text}}}),[r,t]);return(0,T.jsx)(Xs,Nc(Nc({type:"text",event:t,onClick:o},n),i))},Mc=["event"];function Lc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Uc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lc(Object(n),!0).forEach((function(t){Fc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Bc=["event"];function $c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$c(Object(n),!0).forEach((function(t){Hc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vc=({children:e,url:t,target:n})=>t?(0,T.jsx)("a",{href:t,download:!0,target:n||void 0,className:P(["download","download-link"]),children:e}):(0,T.jsx)("span",{className:P("download"),children:e}),qc=["event","descriptorId"];function Wc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wc(Object(n),!0).forEach((function(t){Kc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Kc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jc(Object(n),!0).forEach((function(t){Qc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yc={message:{choice_prompt:e=>{let{event:t,children:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,va);const{t:o}=us(),i=Fs(),{body:s,subEvent:a,showOptions:c,chooseAgain:l,onChoiceClickHandler:u,onChooseAgainClickHandler:p}=(e=>{const{payload:t}=e,[n,r]=(0,Ke.useState)(!1),{sendAction:o,addMessageBubble:i,addDivider:s}=qi(),{activeServiceSessionId:a}=wr().serviceInfo,c=it(Er),{body:l}=zs(e),{service:u}=t,p=(0,Ke.useMemo)((()=>wa(wa({},e),{},{payload:wa(wa({},e.payload),{},{body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&wa(wa({},e.payload.translatedBody),{},{data:e.payload.translatedBody.data.prompt})})})),[e]),d=l.chooseAgain&&a===u.serviceSessionId&&t.id!==c;return(0,Ke.useEffect)((()=>{r(t.id===c)}),[t,c]),{body:l,subEvent:p,showOptions:n,chooseAgain:d,onChoiceClickHandler:e=>{const n=K();d&&s("new_topic",n),i(e.text,n),o({type:"pick_choice",originMessage:t.id,choice:{id:e.id,text:e.text,chooseAgain:d},transactionId:n}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}})(t);return(0,T.jsxs)(T.Fragment,{children:[(0,Ge.toChildArray)(n).map((e=>(e.props=wa(wa({},e.props),{},{event:a,descriptorId:i,showTranslationToggle:!1}),e))),l&&(0,T.jsxs)("button",{type:"button",className:P("button","button--secondary","button--choose-again"),"aria-expanded":c?"true":"false",onClick:p,"aria-describedby":i,children:[o(c?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,T.jsx)(la,{name:"chevronDown",size:"8"})]}),c&&(0,T.jsx)(Xs,wa(wa({type:"choice-prompt",showParticipant:!1,event:t},r),{},{children:(0,T.jsx)("ul",{className:P("choice-prompt","choice-prompt--many"),children:s.choices.map((e=>(0,T.jsx)("li",{className:P("choice-prompt__item",{[`choice-prompt__item--${e.category}`]:e.category}),children:(0,T.jsx)("button",{type:"button",className:P("button","button--primary"),onClick:()=>{u(e)},children:e.text})},e.id)))})}))]})},text:Dc,image:e=>{let{event:t,descriptorId:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,xc);const{body:o}=zs(t),{description:i,url:s,isZoomable:a}=o,[c,l]=(0,Ke.useState)(!1),u=ft();return(0,T.jsxs)(Xs,Sc(Sc({event:t,type:"image"},r),{},{children:[(0,T.jsx)("img",{src:s,id:n,alt:i,onLoad:()=>{u(So(t.payload.id)),l(!0)}}),a&&c&&(0,T.jsx)(jc,{description:i,url:s})]}))},splash:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Ec);const{payload:r}=t,{body:o}=zs(t),i=Aa(r.id);return(0,T.jsx)(Xs,Tc(Tc({type:"splash",event:t,onClick:i},n),{},{bodyProps:{dangerouslySetInnerHTML:{__html:o.text}}}))},video:e=>{let{event:t,descriptorId:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,qc);const{body:o}=zs(t),{description:i,url:s}=o;return bs(t).push("message--type-video"),(0,T.jsxs)(Xs,Gc(Gc({event:t,type:"video"},r),{},{children:[(0,T.jsx)("div",{id:n,className:P("visually-hidden"),children:i}),(0,T.jsx)("iframe",{title:i,src:s,allow:"autoplay; encrypted-media",allowFullScreen:!0})]}))},upload:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Bc);const{t:r}=us(),{body:o}=zs(t),{fromClient:i}=t.payload,{filename:s,url:a}=o,c=(0,Ke.useMemo)((()=>r(a?"fileUpload.srFileDownloadText":"fileUpload.srFileUploadedText",{fileName:s})),[a,s,r]);return(0,T.jsx)(Xs,zc(zc({event:t,type:"upload"},n),{},{children:(0,T.jsxs)(Vc,{url:a,target:i?void 0:"_blank",children:[(0,T.jsx)(la,{name:"download",size:"16"}),(0,T.jsx)("span",{"aria-hidden":"true",className:P("file-download"),children:s}),(0,T.jsx)("span",{className:P("visually-hidden"),children:c})]})}))},cta:({event:e})=>{const{body:t}=zs(e),n=Aa(e.payload.id),{emitEvent:r}=qi(),o=Fs(),i=(0,Ke.useCallback)((()=>r("action.click_cta",{type:y,originMessage:e.payload.id,link:{url:t.buttonLink}})),[r,t,e]);return(0,T.jsxs)(Xs,{type:"cta",event:e,children:[(0,T.jsx)("div",{className:P("cta__content"),id:o,dangerouslySetInnerHTML:{__html:t.description},onClick:n}),(0,T.jsx)("a",{className:P("button","button--primary"),"aria-describedby":o,href:t.buttonLink,rel:"noreferrer",target:t.buttonNewTab?"_blank":"_self",onClick:i,children:t.buttonText})]})},carousel:({event:e})=>{const{body:t}=zs(e),n=t.cards;return(0,T.jsx)(Xs,{event:e,modifiers:"type-carousel",children:(0,T.jsx)(ya,{items:n,ItemComponent:aa,getItemKey:ba,getItemLabel:ma})})},card:({event:e})=>{const{body:t}=zs(e),n=Fs();return(0,T.jsx)(Xs,{type:"card",event:e,children:(0,T.jsx)(ea,na({id:n},t))})}},info:{text:Dc,divider:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,La);const r=Ba[g[t.payload.body.subtype]]||Ba.default;return(0,T.jsx)(r,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ua(Object(n),!0).forEach((function(t){Fa(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ua(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({event:t},n))},translation:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Mc);const{t:r}=us(),{body:o}=zs(t);return(0,T.jsx)(Xs,Uc(Uc({type:"text",event:t},n),{},{children:r(o.key.join("."),o.variables)}))},timeIndicator:Ha},participant:{participant:({event:e})=>{const{participant:t}=e.payload,{body:n}=zs(e);return n?(0,T.jsx)(Da,{graphicSrc:t.avatar,graphicType:t.avatar?"avatar":void 0,iconName:t.avatar?void 0:"balloon",childrenHTML:n,dividerType:"participant"}):null}},service_data:{suggestion:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Ea);const[r,o]=(0,Ke.useState)(!0),i=ft(),s=Ur(),{sendAction:a,addMessageBubble:l}=qi(),{suggestions:u,payload:p}=(e=>{const{payload:t}=e,{body:n}=zs(e);return{suggestions:n,payload:t}})(t),{showSuggestions:d}=vr(),f=xr(),{t:h}=us(),y=h("suggestions.headingText"),b=h("suggestions.footerText"),m=(0,Ke.useMemo)((()=>f.some((({payload:e})=>e?.transactionLast))),[f]),v=(0,Ke.useCallback)((({id:e,question:t})=>{o(!1),i($r(!0)),a({type:c,originMessage:p.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),l(t)}),[i,a,p.id,l]);return r&&!s&&m&&d?(0,T.jsxs)("div",{className:P("suggestions","suggestions--conversation"),children:[y&&(0,T.jsx)("p",{className:P("suggestions__heading"),children:y}),(0,T.jsxs)(Xs,Ta(Ta({type:"suggestions",showParticipant:!1,event:t},n),{},{children:[(0,T.jsx)(Ca,{className:"suggestions__list--conversation",onClickSuggestion:v,suggestions:u}),b&&(0,T.jsx)("p",{className:P("suggestions__footer"),children:b})]}))]}):null}}},Zc=({children:e})=>{const{customComponents:t}=vr(),n=(0,Ke.useMemo)((()=>Object.keys(Yc).reduce(((e,n)=>Xc(Xc({},e),{},{[n]:Xc(Xc({},Yc[n]),t?t[n]:{})})),{fallback:Dc})),[t]);return(0,T.jsx)(hs.Provider,{value:n,children:e})},el=({children:e})=>{const{isMinimized:t}=Li(),n=(0,Ke.useRef)(0),{sendAction:r}=qi(),{hasCountdown:o,isActive:i,stopCountdown:s}=Ls(),a=(0,Ke.useCallback)((()=>{if(t)return;const e=(new Date).getTime(),a=()=>{r({type:"interactivity_update"}),n.current=e};o&&i&&(a(),s()),e-n.current>15e3&&a()}),[r,o,i,s,t]);return(0,T.jsx)("div",Object.assign({className:P("activity-monitor"),tabIndex:-1,onMouseDown:a,onKeyUp:a,onTouchStart:a,onMouseMove:a,onWheel:a,onPointerDown:a,onPointerMove:a},{children:(0,T.jsx)(Is.Provider,Object.assign({value:a},{children:e}))}))};const tl=["text","choice_prompt","image","video"],nl=()=>{const e=Fi(),t=ft(),n=xr(),r=(0,Ke.useContext)(bt),o=(0,Ke.useRef)(null),{initCountdown:i,endCountdown:s}=Ls(),{emitEvent:a}=qi();return(0,Ke.useEffect)((()=>{if(e.connectionInfo&&e.conversation.socket){const{socket:n}=e.conversation;n.onError((e=>{const n=new Go(e);t(qr({name:n.name,message:n.message,langKey:n.langKey,originalEvent:n.originalEvent,originalError:n.originalError})),t(ro())})),n.onOpen((()=>{t(Wr())}))}}),[e,e.connectionInfo,e.conversation.socket,t]),(0,Ke.useEffect)((()=>{if(e.connectionInfo&&e.conversation.channel){const{channel:t}=e.conversation;return()=>{null==t||t.leave()}}return()=>{}}),[e,e.connectionInfo,e.conversation]),(0,Ke.useEffect)((()=>{e.conversation.onConnection((({currentState:e})=>{if("join_channel_erred"===e){const e=new R;t(qr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action}))}}))}),[e.conversation,t]),(0,Ke.useEffect)((()=>{if(e.connectionInfo&&e.conversation.channel){const{channel:n}=e.conversation,o=e=>{const{payload:n}=e;if(!n||!n.participant)return;const{fromClient:r,participant:o}=n;!r&&"string"!=typeof o&&(null==o?void 0:o.name)&&t(wo(o.name)),t(Co({participant:o,fromClient:r})),"string"!=typeof o&&o.introduction&&t(to(Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},n),{type:"participant"})})))};n.onMessage=(e,n)=>{const c={type:e,payload:n};switch(e){case"ui":switch(n.state&&n.state.hasOwnProperty("loading")&&t(_o(n.state.loading)),n.type){case"idle_detach_countdown":i(n.body.duration);break;case"idle_detach_countdown_elapsed":s(void 0,!0);break;case"resume_conversation_prompt":t(uo());break;case"translation_proposal":t(Ti(n.body));break;case"user_first_response":t($r(!0)),r.emit("system.userFirstResponse",n.body)}break;case"message":switch(o(n),n.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"cta":case"custom":case"carousel":case"card":n.service&&n.service.serviceSessionId&&t(yo(n.service.serviceSessionId)),t(to(c))}break;case"participant":o(c);break;case"service_data":n.persist&&t(Po(n));break;case"ack":t(eo(c));break;case"system":if("service_changed"===n.type){const{serviceSettings:e}=n,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(n,["serviceSettings"]),{entry:o}=e,{upload:i}=o.options;t(vo({key:w,enabled:!(!i||!i.enabled)})),t(To(o)),n.serviceSessionId&&t(yo(n.serviceSessionId)),a("system.serviceChanged",r)}break;case"info":"divider"!==n.type&&"text"!==n.type&&"translation"!==n.type||t(to(c));break;case"error":switch(n.type){case"find_conversation_erred":const e=new D(c);t(qr({name:e.name,action:e.action,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError}));break;case"conversation_erred":const n=new R(c);t(qr({name:n.name,message:n.message,langKey:n.langKey,originalEvent:n.originalEvent,originalError:n.originalError,action:n.action}))}}return n}}}),[e,e.connectionInfo,e.conversation.channel,t,a,s,r,i]),(0,Ke.useEffect)((()=>{if(e.connectionInfo&&e.conversation.channel){const{channel:t}=e.conversation;t.on("message",(e=>tl.includes(e.type)?(e.id!==o.current&&r.emit("message",e),o.current=e.id,e):e))}}),[e,e.connectionInfo,e.conversation.channel,r]),(0,Ke.useEffect)((()=>{if(e.connectionInfo&&e.conversation.channel){const{channel:r}=e.conversation,o=r.on("sync",(r=>{var o;const i=n[n.length-1],s=null===(o=null==r?void 0:r.lastEvent)||void 0===o?void 0:o.id;return i&&s===i.payload.id?r:e.getConversation().then((e=>{e&&t(jo(e))})).catch((e=>{t(qr({name:null==e?void 0:e.name,message:null==e?void 0:e.message,langKey:null==e?void 0:e.langKey,action:null==e?void 0:e.action,originalEvent:null==e?void 0:e.originalEvent,originalError:null==e?void 0:e.originalError}))}))}));return()=>{r.off("sync",o)}}return()=>{}}),[e,e.connectionInfo,e.conversation.channel,n,t]),null},rl=({children:e})=>{const{t}=us(),n=ft(),r=Fi(),{addUploadBubble:o}=qi();return(0,T.jsx)(Os.Provider,{value:e=>{const i=K(),s=r.uploadFile(e,(e=>{n(Io({fileId:i,progress:Math.ceil(e)}))}),(e=>{const{id:t,transactionId:r,occurredAt:s,body:{contentType:a,filename:c,filesize:l,url:u}}=e.body;n(ko(i)),o(t,r,s,a,c,l,u)}),(e=>{let r;switch(e&&e.body?e.body.error:""){case"file_uploads_are_disabled":r=t("fileUpload.errors.unavailable");break;case"request_entity_too_large":r=t("fileUpload.errors.tooLarge");break;case"file_has_invalid_mime_type":r=t("fileUpload.errors.wrongType");break;case"virus_found":r=t("fileUpload.errors.virusFound");break;default:r=t("fileUpload.errors.general")}n(Ao({fileId:i,errorText:r}))}));n(po({fileId:i,fileName:e.name,uploadHandle:s}))},children:e})},ol=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=Ls();return((e,t)=>{const n=(0,Ke.useRef)(e);(0,Ke.useEffect)((()=>{n.current=e}),[e]),(0,Ke.useEffect)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n>0?1e3:null),null},il=()=>{const{initUserSelectedOptions:e}=ks(),t=(0,Ke.useRef)(!1),n=vr();return(0,Ke.useEffect)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null},sl=yr((({interrupt:e})=>e),(({error:e})=>e));function al(){const{t:e}=us(),t=it(sl);return{hasInterrupt:Boolean(t),meta:(0,Ke.useMemo)((()=>{if(!t)return{};const{langKey:n,action:r}=t,o=e(`${n}.title`),i=e(`${n}.message`),s=e(`${n}.srText`),a=e(`${n}.buttonText`);return Object.assign(Object.assign(Object.assign(Object.assign({},n?{title:o,message:i,srText:s}:{}),r?{action:r}:{}),r&&n?{buttonText:a}:{}),{originalError:t})}),[e,t]),error:t}}function cl(e,t,n=[]){const r=(0,Ke.useContext)(bt),o=(0,Ke.useRef)();o.current=t,(0,Ke.useEffect)((()=>{if(!n.every(Boolean))return;const t=(...e)=>o.current?.(...e);return r.emit("function.register",e,t),()=>r.emit("function.unregister",e,t)}),[r,e,...n])}const ll=()=>{const e=vr(),{sendMessage:t,sendContext:n,sendAction:r}=qi(),o=ft(),{setVisibility:i,visible:s}=Li(),a=(0,Ke.useRef)(s),c=(0,Ke.useContext)(bt),l=Fi(),u=Sr(),p=(0,Ke.useRef)(null),d=(0,Ke.useRef)(null),{isInline:h,isResolving:y}=Tr(),{hasInterrupt:b}=al(),m=(()=>{const{get:e}=Bi();return e?e("conversationUrl"):null})(),v=(0,Ke.useRef)(null),g=Ns(),{enableTranslations:w,disableTranslations:O}=$s();return(0,Ke.useEffect)((()=>{a.current=s}),[s]),cl("askText",(e=>{t({body:e})}),[l?.send]),cl("setVariables",(e=>{n({variables:e})}),[l?.send]),cl("getVisibility",(e=>{e?e(a.current):console.warn("A callback function is required for the getVisibility action.")})),cl("setVisibility",(e=>{Object.values(x).includes(e)?(g(),i(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[e?.api]),cl("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[l.send]),cl("setTopic",(({name:e,fallbackMessage:t,userTriggered:n})=>{n&&o(Vo({showSuggestions:!1})),e&&t?r({type:f,body:{name:e,fallbackMessage:t,participant:n?E:void 0}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[l.send]),cl("setTranslation",(({enabled:e,locale:t})=>{e?w(t,"window_api"):O()}),[l.send]),(0,Ke.useEffect)((()=>{y||b||(v.current&&v.current!==m&&c.emit("unreadMessageCount",u),s===x.open&&s!==d.current&&0!==p.current&&c.emit("unreadMessageCount",0),s!==x.open&&u!==p.current&&c.emit("unreadMessageCount",u),d.current=s,p.current=u,v.current=m)}),[u,s,c,h,y,b,m]),null},ul=({children:e})=>{const t=(0,Ke.useContext)(bt),[n,r]=(0,Ke.useState)({}),o=(0,Ke.useRef)(!0),i=(0,Ke.useCallback)((e=>{o.current&&(r(e),t.emit("aria-live",e))}),[r,t]);(0,Ke.useEffect)((()=>{let e=null;return n&&n.messageText&&(e=setTimeout((()=>{i({}),clearTimeout(e)}),500)),()=>{clearTimeout(e)}}),[n,i]),(0,Ke.useEffect)((()=>()=>{o.current=!1}),[]);const{ariaLive:s,messageText:a}=n;return(0,T.jsxs)(ps.Provider,{value:i,children:[e,(0,T.jsxs)("div",{className:P("app__live-container"),children:[(0,T.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:P("visually-hidden"),children:s===m?a:null}),(0,T.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:P("visually-hidden"),children:s===v?a:null})]})]})},pl=()=>{const{t:e}=us(),t=xr(),n=(0,Ke.useRef)(0),r=(0,Ke.useRef)(0),o=wr().historyLoaded,{sendPolite:i}=ds(),{isOpen:s}=Li(),a=(0,Ke.useRef)(null),c=(0,Ke.useRef)(null),l=(0,Ke.useMemo)((()=>L((t=>{const n=t.filter((({payload:e})=>!e.fromClient&&!e.fromHistory)).length;n>r.current&&(i(e("message.srNewEventCount",{newCount:n-r.current})),r.current=n)}),1e3)),[i,e]);return(0,Ke.useEffect)((()=>{t.length>n.current&&(s&&(c.current=l(t)),n.current=t.length)}),[t,l,s]),(0,Ke.useEffect)((()=>{a.current&&!s&&c.current&&(c.current(!0),c.current=null)}),[s]),(0,Ke.useEffect)((()=>{o&&setTimeout((()=>{i(e("window.srTexts.onHistoryLoad"))}),500)}),[o,e,i]),null},dl=()=>{const{t:e}=us(),{isOpen:t,isVisible:n}=Li(),r=Sr(),{sendPolite:o}=ds(),i=(0,Ke.useMemo)((()=>L(o,2e3)),[o]),s=(0,Ke.useRef)(null),a=(0,Ke.useRef)(null);return(0,Ke.useEffect)((()=>{s.current!==n&&!n&&a.current&&a.current(),0!==r&&!t&&n&&(a.current=i(e("message.srTextUnreadCount",{unreadCount:r}))),s.current=n}),[r,t,n,i,e]),null},fl=({store:e,children:t,eventBus:n,api:r})=>((0,Ke.useErrorBoundary)((t=>{e.dispatch(Jo(t))})),(0,T.jsx)(lt,Object.assign({store:e},{children:(0,T.jsx)(bt.Provider,Object.assign({value:n},{children:(0,T.jsx)(yt.Provider,Object.assign({value:r},{children:(0,T.jsx)(ul,{children:(0,T.jsx)(fs,{children:(0,T.jsxs)(Zc,{children:[(0,T.jsx)(il,{}),(0,T.jsx)(nl,{}),(0,T.jsx)(dl,{}),(0,T.jsx)(pl,{}),(0,T.jsx)(ol,{}),(0,T.jsxs)(el,{children:[(0,T.jsx)(ll,{}),(0,T.jsx)(rl,{children:t})]})]})})})}))}))}))),hl=()=>{const{t:e}=us(),{showDisclaimer:t}=vr();return t&&(0,T.jsxs)("div",{className:P("disclaimer"),tabIndex:"0",children:[(0,T.jsx)("h2",{className:P("disclaimer__title"),children:e("disclaimer.title")}),(0,T.jsx)("div",{className:P("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]})},yl=require("preact/compat"),bl=(0,Ge.createContext)(null),ml=e=>{const t=(0,Ke.useContext)(hs),n=t[e.type];let r=n[e.payload.type],o=null;return"choice_prompt"===e.payload.type&&(o=n[e.payload.body.prompt.type]),"participant"===e.type&&(r=n[e.type]),r&&"function"!=typeof r&&(r=r[e.payload.body.type]),[r||t.fallback,o]},vl=({event:e,newParticipant:t})=>{const{eventRefs:n,unreadIds:r}=(0,yl.useContext)(bl),{sendAction:o}=qi(),i=n[e.payload.id],{containerRef:s,isVisible:a}=Ui({containerRef:i,freezeOnceVisible:!0}),c=ft(),[l,p]=ml(e);if((0,yl.useEffect)((()=>{if(a&&(null==r?void 0:r.includes(e.payload.id))){const t=r.reduce(((t,n)=>t.includes(e.payload.id)?t:t.concat(n)),[]);c(mo(t)),o({type:u,events:t})}}),[c,e.payload.id,a,o,r]),!l)return null;const d=["conversation__item"];return"info"===e.type?d.push("conversation__item--source-info"):e.payload.fromClient?d.push("conversation__item--source-user"):d.push("conversation__item--source-agent"),t&&d.push("conversation__item--new-participant"),(0,T.jsxs)("li",Object.assign({className:P(d),ref:s},{children:[e.timeIndicator&&(0,T.jsx)(Ha,{event:e}),(0,T.jsx)(l,Object.assign({event:e},{children:(0,T.jsx)(p,{event:e})}))]}))},gl=()=>{const{id:e}=Pr()||{};return(0,T.jsx)("li",{className:P("conversation__item","conversation__item--source-agent"),children:(0,T.jsxs)("div",{className:P("message","message--source-agent","message--type-loading"),children:[(0,T.jsx)(qs,{eventPayload:{fromClient:!1,participant:e}}),(0,T.jsx)("div",{className:P("message__body"),children:(0,T.jsxs)("span",{className:P("loader"),children:[(0,T.jsx)("span",{className:P("loader__part","one")}),(0,T.jsx)("span",{className:P("loader__part","two")}),(0,T.jsx)("span",{className:P("loader__part","three")}),(0,T.jsx)("span",{className:P("loader__part","four")})]})})]})})},wl=()=>{const e=xr();let t=null;return(0,T.jsx)(T.Fragment,{children:e.map((e=>{const{type:n,payload:r}=e;let o=!1;if("participant"!==n&&"service_data"!==n){const{participant:n,fromClient:i}=r,s=i?"seamly-client-participant":n;"info"!==e.type&&t!==s&&(o=!0),t=s}return(0,T.jsx)(vl,{event:e,newParticipant:o},e.payload.key||e.payload.id)}))})},Ol=()=>{const{t:e}=us(),t=_r(),{isOpen:n}=Li(),r=Cr(),o=ws();return(0,T.jsxs)(T.Fragment,{children:[n&&(0,T.jsx)("a",Object.assign({className:P("skip-link"),href:`#${r}`,onClick:e=>{e.preventDefault(),o()}},{children:e("skiplinkText")})),(0,T.jsx)("div",Object.assign({className:P("chat__body")},{children:(0,T.jsxs)("div",Object.assign({className:P("conversation__container")},{children:[(0,T.jsx)(hl,{}),(0,T.jsxs)("ol",Object.assign({className:P("conversation")},{children:[(0,T.jsx)(Zc,{children:(0,T.jsx)(wl,{})}),t&&(0,T.jsx)(gl,{})]}))]}))}))]})},jl={visible:P("transition--visible"),in:P("transition--in"),visuallyHidden:P("visually-hidden")},xl=Object.values(jl),_l="notRendered",Sl="rendered",Cl="visuallyHidden",El=({children:e,isActive:t,timeout:n=300,transitionStartState:r="notRendered",onInTransitionComplete:o=(()=>{}),onOutTransitionComplete:i=(()=>{})})=>{const s=(0,Ke.useRef)(!1),a=parseInt(n,10),c=Bs(o),l=Bs(i),u=r===Cl,[p,d]=(0,Ke.useState)((()=>u?[jl.visuallyHidden]:[])),f="notRendered"!==r||p.length>0;return(0,Ke.useEffect)((()=>{let e=null,n=null;return s.current&&!t&&(d([jl.visible]),e=setTimeout((()=>{d([...u?[jl.visuallyHidden]:[]]),l&&(n=requestAnimationFrame((()=>{l()})))}),a)),!s.current&&t&&(d([jl.visible]),n=requestAnimationFrame((()=>{n=requestAnimationFrame((()=>{d([jl.visible,jl.in]),c&&(e=setTimeout((()=>{c()}),a))}))}))),s.current=t,()=>{clearTimeout(e),cancelAnimationFrame(n)}}),[t,u,a,c,l]),(0,T.jsx)(T.Fragment,{children:f&&(0,Ge.toChildArray)(e).map((e=>{const{className:t=""}=e.props,n=t.split(" ").filter((e=>!xl.includes(e)));return(0,Ge.cloneElement)(e,{className:[...n,...p].join(" ")})}))})},Pl=({isAside:e=!1})=>{const{isInline:t}=Tr(),{t:n}=us(),{sendAction:r,addMessageBubble:o}=qi(),{isOpen:i,setVisibility:s}=Li(),{showSuggestions:a}=vr(),l=Fs(),u=ws(),p=(0,Ke.useRef)(null),{sendPolite:d}=ds(),{hasInterrupt:f}=al(),{hasCountdown:h,endCountdown:y}=Ls(),{hasPrompt:b,continueChat:m}=Us(),v=Ur(),g=("suggestion",wr().serviceData.suggestion);const{body:w}=zs({payload:g}),O=(0,Ke.useMemo)((()=>g&&!f?w:[]),[g,f,w]),j=(0,Ke.useRef)(null),_=(0,Ke.useRef)(!1),S=(0,Ke.useRef)([]),C=!!O.length,E=t?(v||i)&&!e:v,k=(0,Ke.useRef)(E),A=C&&!E&&a,I=C?O:S.current;S.current=I;const N=(0,Ke.useMemo)((()=>{const t=["suggestions"];return e&&t.push("suggestions--aside"),P(t)}),[e]),R=(0,Ke.useCallback)((({id:e,question:t})=>{h&&y(!0),b&&m(),r({type:c,originMessage:g.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),o(t),i||s(x.open),u()}),[o,m,y,u,h,b,g,r,s,i]);(0,Ke.useEffect)((()=>{if(j.current!==O&&!E){if(C){const e=_.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout((()=>{d(e)}),30)}else _.current&&d(n("suggestions.srUnavailableText"));j.current=O}!k.current&&E?(q(p.current,u),d(n("suggestions.srUnavailableText"))):!C&&_.current&&q(p.current,u),_.current=C,k.current=E}),[O,C,E,u,d,n]);const D=n("suggestions.headingText"),M=n("suggestions.footerText"),L=D?"section":"div";return(0,T.jsx)(El,{isActive:A,transitionStartState:_l,children:(0,T.jsxs)(L,{className:N,"aria-labelledby":D?l:null,ref:p,children:[D&&(0,T.jsx)("p",{id:l,className:P("suggestions__heading"),children:D}),!!I.length&&(0,T.jsx)(Ca,{suggestions:I,onClickSuggestion:R}),M&&!i&&(0,T.jsx)("p",{className:P("suggestions__footer"),children:M})]})})},Tl=(0,yl.forwardRef)((({children:e,className:t=""},n)=>{const{isOpen:r,isVisible:o,setVisibility:i}=Li(),{namespace:s,layoutMode:a}=vr(),{isInline:c}=Tr(),l=ys(),u=Ur(),{t:p}=us(),d=["chat",`chat--layout-${a}`,`namespace--${s}`,...l,t];return r||"app"===a||d.push("chat--collapsed"),u&&d.push("chat--user-responded"),o&&(0,T.jsxs)("section",{className:P(d),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!c&&r&&i(x.minimized)},tabIndex:"-1",ref:n,"aria-label":p("chat.srLabel"),children:[(0,T.jsx)("div",{className:P("chat-wrapper"),children:e}),"inline"===a&&r&&(0,T.jsx)(Pl,{isAside:!0})]})})),kl=Tl,Al=({className:e,children:t,onCancel:n,headingText:r,description:o,descriptionId:i,cancelButtonText:s,cancelButtonRef:a,disableButtonFocusing:c,position:l={horizontal:"left",vertical:"top"}})=>{const u=Fs(),{hideOption:p}=ks(),{focusButton:d}=As(),f=(0,Ke.useCallback)((()=>{p(),c||d()}),[c,d,p]),h=(0,Ke.useCallback)((()=>{n&&n(),f()}),[f,n]),y=(e=>{const t=(0,Ke.useRef)(null);return(0,Ke.useEffect)((()=>{const n=({target:n})=>{t.current&&n instanceof HTMLElement&&!t.current.contains(n)&&e()};return document.addEventListener("click",n,!0),document.addEventListener("touchstart",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("touchstart",n,!0)}}),[e,t]),t})(h);return(0,Ke.useEffect)((()=>{V(y.current)}),[y]),(0,T.jsx)("section",Object.assign({className:P("options",{"options--right":"right"===l.horizontal,"options--left":"left"===l.horizontal,"options--top":"top"===l.vertical,"options--bottom":"bottom"===l.vertical},e),"aria-labelledby":u,tabIndex:-1,ref:y},{children:(0,T.jsxs)("div",Object.assign({className:P("options__body")},{children:[(0,T.jsx)("h2",Object.assign({id:u,className:P("options__title")},{children:r})),(0,T.jsxs)("button",Object.assign({type:"button",onClick:h,"aria-describedby":u,className:P("button","options__close"),ref:e=>{a&&(a.current=e)}},{children:[(0,T.jsx)(la,{name:"close",size:"16",alt:""}),(0,T.jsx)("span",{children:s})]})),o?(0,T.jsx)("p",Object.assign({className:P("options__description"),id:i},{children:o})):null,(0,T.jsx)("div",Object.assign({className:P("options__wrapper")},{children:t}))]}))}))},Il=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),Nl=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},Rl=e=>!!e?.length>0,Dl=e=>{const t=e&&e.trim();return!(!t||!t.match(/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i))},Ml=e=>!!e,Ll=(0,Ge.createContext)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),Ul=Ll,{Provider:Fl,Consumer:Bl}=Ll,$l=yr((({forms:e})=>e),((e,{formId:t})=>t),((e,t)=>e[t])),zl=yr($l,(e=>(null==e?void 0:e.controls)||{})),Hl=yr(zl,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),Vl=yr(zl,((e,{name:t})=>t),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.value})),ql=yr(zl,((e,{name:t})=>t),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.touched}));function Wl(){return(0,Ke.useContext)(Ul)}function Gl(e){const t=ft(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:i}=Wl(),s=!!it((e=>$l(e,{formId:n}))),a=it((t=>Vl(t,{formId:n,name:e}))),c=it((t=>ql(t,{formId:n,name:e}))),l=null==i?void 0:i[e],u=!l;(0,Ke.useEffect)((()=>{s&&t(ri({formId:n,name:e}))}),[s,n,e,t]),(0,Ke.useLayoutEffect)((()=>()=>{t(oi({formId:n,name:e}))}),[s,n,e,t]);const p=(0,Ke.useCallback)((t=>r(e,t.target.value)),[e,r]),d=(0,Ke.useCallback)((()=>{o(e,!0)}),[o,e]);return[(0,Ke.useMemo)((()=>({name:e,onInput:p,onBlur:d,value:a})),[e,p,d,a]),(0,Ke.useMemo)((()=>({isValid:u,error:l,touched:c})),[u,l,c])]}function Kl(e){var{children:t,formId:n,persistData:r,onError:o,onSubmit:i,validationSchema:s}=e,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children","formId","persistData","onError","onSubmit","validationSchema"]);const c=ft(),l=it((e=>Hl(e,{formId:n}))),[u,p]=(0,Ke.useState)(!1),[d,f]=(0,Ke.useState)({}),{isValid:h,errors:y}=function(e,t){const n=(0,Ke.useMemo)((()=>function(e,t={}){return Object.entries(t).reduce(((t,[n,r])=>{var o;const i=Array.isArray(r)?r:[r];for(let r=0;null!==(o=r<(null==i?void 0:i.length))&&void 0!==o&&o;r++)if(!i[r].fn(e[n],i[r].compareValue)){t[n]=i[r].errorText;break}return t}),{})}(e,t)),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(l,s),b=(0,Ke.useMemo)((()=>Object.assign(Object.assign({},y),d)),[y,d]);(0,Ke.useLayoutEffect)((()=>{c(ti({formId:n,persistData:r}))}),[n,r,c]),(0,Ke.useEffect)((()=>()=>{c(ni({formId:n}))}),[n,r,c]);const m=(0,Ke.useCallback)(((e,t)=>{c(ii({formId:n,name:e,value:t}))}),[n,c]),v=(0,Ke.useCallback)(((e,t)=>{c(si({formId:n,name:e,touched:t}))}),[c,n]),g=(0,Ke.useCallback)(((e,t)=>{f((n=>Object.assign(Object.assign({},n),{[e]:t})))}),[f]),w=(0,Ke.useCallback)((e=>{var t;e.preventDefault();const n="true"===(null===(t=e.submitter)||void 0===t?void 0:t.ariaDisabled);p(!n),!n&&h&&(c($r(!0)),i(l,{updateControlValue:m,setError:g}))}),[h,c,i,l,m,g]);(0,Ke.useEffect)((()=>{o&&o({errors:b,isSubmitted:u,isValid:0===Object.keys(b).length})}),[u,b,o]);const O=(0,Ke.useMemo)((()=>({formId:n,values:l,errors:b,isValid:0===Object.keys(b).length,isSubmitted:u,handleSubmit:w,validationSchema:s,updateControlValue:m,updateControlTouched:v})),[n,l,b,u,w,s,m,v]);return n?i?(0,T.jsx)(Fl,Object.assign({},a,{value:O},{children:t})):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)}const Jl=["className","disableValidationClasses"];function Xl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ql(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yl=function(e){let{className:t,disableValidationClasses:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Jl);const{handleSubmit:o,isValid:i,isSubmitted:s}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=Wl();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),a=["form"];return!n&&s&&(a.push("form--submitted"),i?a.push("form--valid"):a.push("form--invalid")),(0,T.jsx)("form",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xl(Object(n),!0).forEach((function(t){Ql(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({onSubmit:o,className:P([...a,t])},r))};function Zl({id:e,error:t}){const[n,r]=(0,Ke.useState)(!1);return(0,Ke.useEffect)((()=>{const e=setTimeout((()=>r(!0)),300);return()=>clearTimeout(e)}),[]),(0,T.jsx)("div",{className:P("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&(0,T.jsxs)("span",{id:e,className:P("error__message"),children:[(0,T.jsx)(la,{name:"error",size:"16"}),t]})})}const eu=({contentHint:e,id:t,labelText:n,labelClass:r=P("label"),validity:o,errorText:i,children:s})=>(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("label",{htmlFor:t,className:r,children:n}),e&&(0,T.jsx)("span",{id:`${t}-content-hint`,className:P("input__content-hint"),children:e}),(0,T.jsx)(Zl,{id:`${t}-error`,error:!o&&i}),s]}),tu=["id","name","type","labelText","labelClass","contentHint","aria-describedby"];function nu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ru(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nu(Object(n),!0).forEach((function(t){ou(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ou(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const iu=function(e){let{id:t,name:n,type:r,labelText:o,labelClass:i,contentHint:s,"aria-describedby":a}=e,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,tu);const{isSubmitted:l}=Wl(),[u,{error:p}]=Gl(n),d=l&&p,f=[];return a&&f.push(a),s&&f.push(`${t}-content-hint`),d&&f.push(`${t}-error`),(0,T.jsx)(eu,{id:t,contentHint:s,validity:!d,errorText:p,labelText:o,labelClass:i,children:(0,T.jsx)("input",ru(ru({id:t,name:n,type:r,"aria-invalid":d?"true":"false","aria-describedby":f.join(" ")||null},u),c))})};function su({controlName:e,describedById:t}){const{t:n}=us();return(0,T.jsxs)(Yl,{noValidate:"true",className:P("options__form"),children:[(0,T.jsx)(iu,{name:e,type:"email",className:P("transcript__input"),"aria-describedby":t,labelClass:P("label"),labelText:n("options.sendTranscript.label")}),(0,T.jsx)("div",{className:P("options__actions"),children:(0,T.jsx)("button",{type:"submit",className:P("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const au="email",cu={sendTranscript:()=>{const[e,t]=(0,Ke.useState)(void 0),{hideOption:n}=ks(),{focusButton:r}=As(),{t:o}=us(),i=Fs(),{sendAction:s}=qi(),a=(0,Ke.useMemo)((()=>({[au]:[Il(Ml,o("options.sendTranscript.noEmailText")),Il(Dl,o("options.sendTranscript.invalidEmailText"))]})),[o]),c=(0,Ke.useCallback)((e=>{const t=e.email.trim();s({type:"send_transcript",body:{emailAddress:t}}),n(),r()}),[s,n,r]),l=(0,Ke.useCallback)((({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)}),[t]);return(0,T.jsx)(Al,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),description:o("options.sendTranscript.description"),descriptionId:i,position:{vertical:"top",horizontal:"right"},children:(0,T.jsx)(Kl,{formId:"sendTranscript",onSubmit:c,validationSchema:a,onError:l,children:(0,T.jsx)(su,{controlName:au,describedById:i})})})}},lu=()=>{const{optionActive:e}=ks(),t=(0,Ke.useRef)(null),n=cu[e||t.current];return e&&(t.current=e),n?(0,T.jsx)(n,{}):null},uu=()=>{const{t:e}=us(),{menuOptions:t,showOption:n,panelActive:r,hideOption:o}=ks(),{id:i}=As(),s=(0,Ke.useRef)(null),[a,c]=(0,Ke.useState)(!1),l=(0,Ke.useRef)(null),u=t.length,p=(0,Ke.useRef)(Array.from({length:u},(()=>(0,Ge.createRef)()))),d=(0,Ke.useRef)(!1),f=u>1,h=t[0],y=(0,Ke.useMemo)((()=>h?.name?.trim().replace(/\s+/g,"")),[h]);return(0,Ke.useEffect)((()=>()=>{clearTimeout(s.current)}),[]),(0,Ke.useEffect)((()=>{a&&!d.current&&requestAnimationFrame((async()=>{await ms(60);const e=t.findIndex((e=>e.available)),n=-1===e?0:e;V(p.current[n])})),d.current=a}),[a,t]),u?(0,T.jsxs)("div",{className:P("options__container"),onKeyDown:e=>{a&&(H(e)===z.Escape&&(c(!1),V(l.current)),H(e)===z.Home&&(V(p.current[0]),e.preventDefault()),H(e)===z.End&&(V(p.current[u-1]),e.preventDefault()))},onfocusout:()=>{f&&(s.current=setTimeout((()=>{c(!1)}),200))},onfocusin:()=>{clearTimeout(s.current)},children:[(0,T.jsx)(El,{transitionStartState:_l,isActive:r,children:(0,T.jsx)("div",{className:P("options__dialog"),children:(0,T.jsx)(lu,{})})}),f&&(0,T.jsx)(El,{isActive:a,transitionStartState:_l,children:(0,T.jsx)("ul",{className:P(["options__menu"]),role:"menu",tabIndex:"-1","aria-labelledby":i,children:t.map((({name:r,title:o,available:i},s)=>(0,T.jsx)("li",{className:P("options__menu__item"),role:"menuitem","data-testid":r,children:(0,T.jsxs)("button",{type:"button",ref:e=>{p.current[s]=e},className:P(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(H(e)===z.ArrowDown){const n=Math.min(u-1,t+1);V(p.current[t===n?0:n]),e.preventDefault()}if(H(e)===z.ArrowUp){const n=Math.max(0,t-1);V(p.current[t===n?u-1:n]),e.preventDefault()}})(e,s),onKeyPress:e=>((e,n)=>{const r=String.fromCharCode(e.charCode);if(1!==r.length||!r.match(/\S/))return;let o=-1;t.forEach(((e,t)=>{t>n&&e.title.charAt(0).toLowerCase()===r.toLowerCase()&&-1===o&&(o=t)})),-1!==o&&V(p.current[o])})(e,s),onClick:()=>((e,t)=>{t&&(c(!1),n(e))})(r,i),"aria-disabled":i?null:"true",children:[(0,T.jsxs)("span",{className:P("button__text"),children:[o,!i&&" "]}),!i&&(0,T.jsx)("span",{className:P("button__state"),children:e("options.unavailableText")})]})},r)))})}),(0,T.jsxs)("button",{type:"button",className:P(["button","button--secondary","chat__options__button",...!f&&y?[`chat__options__button--${y}`]:[]]),id:i,onClick:()=>{r&&o(),f?c((e=>!e)):h.available&&n(h.name)},onKeyDown:f?e=>{H(e)===z.ArrowDown&&(c(!0),e.preventDefault())}:null,ref:l,"aria-haspopup":f?"menu":null,"aria-expanded":f?a.toString():null,"aria-disabled":f||h.available?null:"true",children:[f&&(0,T.jsx)(la,{name:"options",size:"32"}),(0,T.jsx)("span",{className:P("button__text"),children:f?e("options.openButtonText"):`${h.title}${h.available?"":" "}`}),!f&&!h.available&&(0,T.jsx)("span",{className:P("button__state"),children:e("options.unavailableText")})]})]}):null},pu=({label:e,checked:t,description:n,onChange:r,id:o})=>(0,T.jsxs)("li",Object.assign({className:P("translation-options__item"),"aria-selected":t,role:"option",tabIndex:0,onClick:r,onKeyDown:e=>{"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),r())},id:o},{children:[(0,T.jsx)(la,{alt:"",name:"check",size:"16"}),e," ",n&&(0,T.jsxs)("span",{children:["(",n,")"]})]})),du=({onChange:e,describedById:t})=>{const{context:{locale:n}}=vr(),{t:r}=us(),{focusContainer:o}=Hs(),{languages:i,currentLocale:s,enableTranslations:a,disableTranslations:c}=$s(),l=({locale:t})=>()=>{t===s||n===t?c():a(t),e(),o()},u=(0,Ke.useMemo)((()=>[...i].sort(((e,t)=>e.locale===n?-1:t.locale===n?1:e.nativeName.localeCompare(t.nativeName,void 0,{sensitivity:"base"})))),[i,n]);return(0,T.jsx)("ul",Object.assign({"aria-describedby":t,role:"listbox",tabIndex:-1,className:P("translation-options")},{children:u.map(((e,t)=>{const n=0===t,o=s===e.locale||!s&&n;return(0,T.jsx)(pu,{id:e.locale,label:e.nativeName,checked:o,description:n&&r("translations.settings.original"),onChange:l(e)},e.locale)}))}))},fu=function({onClose:e,position:t}){const{t:n}=us(),r=Fs();return(0,T.jsx)(Al,Object.assign({onCancel:e,headingText:n("translations.menu.title"),cancelButtonText:n("translations.settings.cancelButtonText"),description:n("translations.menu.description"),descriptionId:r,position:t,disableButtonFocusing:!0},{children:(0,T.jsx)(du,{describedById:r,onChange:e})}))};function hu({children:e,position:t={horizontal:"left",vertical:"top"},classNames:n}){const[r,o]=(0,Ke.useState)(!1),i=(0,Ke.useRef)(null),s=Fs();return(0,T.jsxs)("div",Object.assign({className:P("translations__container"),onKeyDown:e=>{r&&H(e)===z.Escape&&(o(!1),V(i.current))}},{children:[(0,T.jsx)(El,Object.assign({onOutTransitionComplete:()=>{},onInTransitionComplete:()=>{},timeout:0,transitionStartState:_l,isActive:r},{children:(0,T.jsx)("div",Object.assign({className:P("options__dialog"),role:"dialog"},{children:(0,T.jsx)(fu,{onClose:()=>{o(!1)},position:t})}))})),(0,T.jsx)("button",Object.assign({type:"button",className:P(["button","chat__options__button",...n]),id:s,onClick:()=>{o((e=>!e))},onKeyDown:e=>{H(e)===z.ArrowDown&&(o(!0),e.preventDefault())},ref:i,"aria-haspopup":"dialog","aria-expanded":r.toString()},{children:e}))]}))}function yu(){const{menuOptions:e,allowOptionSelection:t}=ks(),{isAvailable:n}=$s(),{hasInterrupt:r}=al(),{t:o,locale:i}=us(),s=Vs(i);if(!n&&(!t||!e.length)||r)return null;const a=o("translations.settings.openButtonText",{hasLanguage:!!s,language:s});return(0,T.jsxs)("div",{className:P("chat__options"),children:[n&&(0,T.jsx)("div",{className:P("chat__options-item","chat__options-item--left"),children:(0,T.jsxs)(hu,{classNames:["button--secondary"],children:[(0,T.jsx)(la,{alt:a,name:"newTranslation",size:"16"}),(0,T.jsx)("span",{className:P("button__text"),children:a})]})}),t&&(0,T.jsx)("div",{className:P("chat__options-item","chat__options-item--right"),children:(0,T.jsx)(uu,{})})]})}const bu=()=>{const{scrollToRef:e,unreadIds:t}=(0,Ke.useContext)(bl),{isMinimized:n}=Li(),{t:r}=us();return(0,T.jsx)(El,Object.assign({isActive:!!t.length&&!n},{children:(0,T.jsx)("div",Object.assign({className:P("unread-messages")},{children:(0,T.jsxs)("button",Object.assign({type:"button",className:P("button","button--primary"),onClick:e},{children:[r("message.unreadMessagesCount",{unreadCount:t.length}),(0,T.jsx)(la,{name:"chevronDown",size:"32",alt:""})]}))}))}))},mu=yr(jr,(e=>e.filter((e=>{var t;return Kr(e)&&"service_data"!==e.type&&(null===(t=e.payload)||void 0===t?void 0:t.messageStatus)===s})).map((e=>e.payload.id))));const vu=e=>{const t=(0,Ke.useRef)(),[n,r]=(0,Ke.useState)(!0),o=it(mu),i=xr(),s=_r(),{isOpen:a}=Li(),c=wr().loadedImageEventIds,l=it((e=>e.state.isLastEventFromClient));(0,Ke.useEffect)((()=>{const e=t.current,n=()=>{const{scrollHeight:t,scrollTop:n,clientHeight:o}=e,i=Math.abs(t-n-o)>10;r(!i)};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}),[]);const u=(0,Ke.useCallback)((()=>{requestAnimationFrame((()=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){var e,n;yield ms(30),null===(e=t.current)||void 0===e||e.scrollTo({top:null===(n=t.current)||void 0===n?void 0:n.scrollHeight,left:0,behavior:"auto"})}))))}),[]);return(0,Ke.useEffect)((()=>{l&&u()}),[l,u]),(0,Ke.useEffect)((()=>{n&&u()}),[n,o,i,s,a,c,u]),{containerRef:t,unreadIds:o,scrollToRef:()=>{var n,r;const i=null===(n=e[null==o?void 0:o.at(0)])||void 0===n?void 0:n.current;null===(r=t.current)||void 0===r||r.scrollTo({top:null==i?void 0:i.offsetTop,behavior:"auto",left:0})},scrollToBottom:u}},gu=({children:e})=>{const t=xr(),n=(0,Ke.useMemo)((()=>t.reduce(((e,t)=>(e[t.payload.id]=(0,Ge.createRef)(),e)),{})),[t]),{scrollToRef:r,scrollToBottom:o,containerRef:i,unreadIds:s}=vu(n);return(0,T.jsx)(bl.Provider,Object.assign({value:{eventRefs:n,unreadIds:s,scrollToRef:r,scrollToBottom:o,containerRef:i}},{children:(0,T.jsxs)("div",Object.assign({className:P("chat__container")},{children:[(0,T.jsx)("div",Object.assign({className:P("chat__container__scroll-area"),ref:i},{children:e})),(0,T.jsx)(bu,{})]}))}))},wu=({baseClassName:e,children:t,title:n})=>{const r=Cr(),o=Fs();return(0,T.jsxs)("section",{id:r,className:P(e),"aria-describedby":o,tabIndex:"-1",children:[(0,T.jsx)("h2",{className:P(`${e}__title`),id:o,children:n}),t]})},Ou=()=>{const{t:e}=us(),t=ws(),n=Ns(),{emitEvent:r}=qi(),{isActive:o,remaining:i,timer:s,endCountdown:a}=Ls(),c=i>0,l=e(c?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,T.jsx)(wu,{baseClassName:"idle",title:l,children:c&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:P("idle__count-container"),children:o&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("span",{className:P("idle__count-text"),children:e("idleDetachWarning.countdownText")}),(0,T.jsx)("span",{className:P("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",s)})]})}),(0,T.jsxs)("div",{className:P("idle__options"),children:[(0,T.jsx)("button",{type:"button",className:P("button","button--primary"),onClick:()=>{n(),a(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),(0,T.jsx)("button",{type:"button",className:P("button","button--primary"),onClick:()=>{a(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},ju=()=>{const{t:e}=us(),t=Ns(),{name:n}=Pr()||{},{continueChat:r,restartChat:o}=Us();return(0,T.jsx)(wu,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:(0,T.jsxs)("div",{className:P("prompt__options"),children:[(0,T.jsx)("button",{type:"button",className:P("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),(0,T.jsx)("button",{type:"button",className:P("button","button--primary"),onClick:o,children:e("resumeConversationPrompt.detachButton")})]})})};function xu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Su=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:o}=wr().entryMeta,i=ft(),s=n||t||e,a=o[s]||r[s]||{},c=(0,Ke.useCallback)((e=>{i(bo(e))}),[i]),l=(0,Ke.useCallback)((e=>{i(ho(e))}),[i]),u=(0,Ke.useCallback)((e=>{i(No(e))}),[i]),p=(0,Ke.useCallback)((()=>{n?u(null):l(e)}),[n,e,u,l]);return{activeEntry:s,activeEntryOptions:a,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:p,setBlockAutoEntrySwitch:c}};function Cu({controlName:e,skipLinkId:t}){const{t:n}=us(),{sendAssertive:r}=ds(),{emitEvent:o}=qi(),i=(()=>{const{sendAction:e}=qi(),{features:t}=ks(),{typingPeekahead:n}=t||{},r=(0,Ke.useRef)(null),o=(0,Ke.useRef)(null),i=(0,Ke.useRef)(!1),s=(0,Ke.useRef)(null);(0,Ke.useEffect)((()=>()=>{clearInterval(s.current),clearTimeout(r.current),clearTimeout(o.current)}),[]);const a=(t,r)=>{e(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xu(Object(n),!0).forEach((function(t){_u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({type:l,state:t},n&&n.enabled?{body:{currentMessage:r}}:{}))};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(i.current=!0,s.current||(a(!0,e.target.value),s.current=setInterval((()=>{i.current?n&&n.enabled&&a(!0,e.target.value):(clearInterval(s.current),s.current=null)}),2e3)),clearTimeout(r.current),clearTimeout(o.current),r.current=setTimeout((()=>{i.current=!1}),300),o.current=setTimeout((()=>{a(!1,e.target.value)}),2e3))}})(),{setBlockAutoEntrySwitch:s}=Su(),{hasCharacterLimit:a,characterLimit:c,reachedCharacterWarning:u,reachedCharacterLimit:p,remainingChars:d}=function(e){const{t}=us(),{sendAssertive:n}=ds(),{hasLimit:r,limit:o}=(()=>{const{entryMeta:{options:{text:e},optionsOverride:{text:t}}}=wr(),{limit:n}=t||e||{limit:null};return{hasLimit:null!==n,limit:null!==n?n:null}})(),i=(0,Ke.useMemo)((()=>L(n,300)),[n]),s=(0,Ke.useMemo)((()=>L(((e,n)=>{e&&i(t("input.srCharacterLimitText",{limit:n}))}),300)),[i,t]),[{value:a}]=Gl(e),c=r&&a?o-a.length:o,l=!!r&&c<=50,u=!!r&&c<0;return(0,Ke.useEffect)((()=>{s(l,c)}),[l,c,s]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}(e),[{value:f}]=Gl(e),h=!!f,y=(0,Ke.useCallback)((()=>{u&&r(n("input.srCharacterLimitText",{limit:d})),o("ui.inputFocus")}),[n,r,u,d,o]),b=(0,Ke.useMemo)((()=>n("input.inputPlaceholder",{hasLimit:a,limit:a?c:null})),[n,a,c]),m=(0,Ke.useMemo)((()=>n("input.inputLabel",{hasLimit:a,limit:a?c:null})),[n,a,c]);return(0,Ke.useLayoutEffect)((()=>(s(h),()=>{s(!1)})),[s,h]),(0,T.jsxs)(Yl,{className:P("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,T.jsxs)("div",{className:P(["input--text__container",...u&&!p?["character-warning"]:[],...p?["character-exceeded"]:[]]),children:[(0,T.jsx)(iu,{id:t,type:"text",name:e,className:P("input__text"),autocomplete:"off",placeholder:b,labelText:m,labelClass:P("visually-hidden"),"aria-invalid":a?p:null,onKeyUp:i,onFocus:y}),(0,T.jsx)("div",{className:P("character-count"),children:u&&(0,T.jsx)("span",{children:d})})]}),(0,T.jsx)("button",{className:P("button","input__submit"),type:"submit",onPointerDown:e=>{e.preventDefault()},"aria-disabled":!h||p?"true":null,children:(0,T.jsx)(la,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}function Eu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Eu(Object(n),!0).forEach((function(t){Tu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Eu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Tu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ku(){return ku=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},ku.apply(this,arguments)}const Au="textMessageEntry";function Iu(e){let t=ku({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));const{isOpen:n,setVisibility:r}=Li(),o=Cr(),i=ws(),{sendMessage:s}=qi(),a=(0,Ke.useCallback)(((e,{updateControlValue:t})=>{s({body:e.textMessageEntry}),t(Au,""),i(),n||r(x.open)}),[s,i,n,r]);return(0,T.jsx)(Kl,Pu(Pu({},t),{},{formId:"textEntry",persistData:!0,onSubmit:a,children:(0,T.jsx)(Cu,{controlName:Au,skipLinkId:o})}))}const Nu=()=>{const{t:e}=us(),{currentUploads:t}=Cs();return(0,T.jsx)("div",{className:P("progress"),children:t.map((({id:t,name:n,progress:r,uploading:o,error:i})=>(0,T.jsxs)("div",{className:P("progress_container"),children:[(0,T.jsxs)("div",{className:P("progress__text"),children:[(0,T.jsx)("span",{className:P("progress__text--file-name"),children:n}),(0,T.jsx)("span",{className:P("progress__text--percentage"),children:`${r}%`})]}),(0,T.jsx)(Zl,{error:i}),(0,T.jsx)("progress",{className:P("progress__bar"),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-label":e("fileUpload.srProgressLabel",{fileName:n}),max:"100","aria-valuenow":r,value:r,"aria-busy":o,children:`${r}%`})]},t)))})};function Ru({id:e,name:t,labelText:n,contentHint:r,outputText:o,accept:i}){const{isSubmitted:s}=Wl(),[a,c]=(0,Ke.useState)(!1),[{onInput:l,onBlur:u},{error:p}]=Gl(t),d=Fs(),f=Fs(),h=Fs(),y=s&&p,b=[h];r&&b.push(f),y&&b.push(d);const m=(0,Ke.useCallback)((()=>{c(!0)}),[c]),v=(0,Ke.useCallback)((()=>{c(!1),u()}),[c,u]),g=(0,Ke.useCallback)((e=>{const t={target:{value:e.target.files}};l(t)}),[l]);return(0,T.jsxs)("div",{className:P("upload__container"),children:[r&&(0,T.jsx)("span",{className:P("upload__content-hint"),id:f,children:r}),(0,T.jsx)(Zl,{id:d,error:y&&p}),(0,T.jsx)("div",{className:P(["file-upload",...a?["focus-within"]:[]]),children:(0,T.jsxs)("label",{htmlFor:e,className:P("upload__label"),children:[(0,T.jsx)(la,{name:"upload",size:"32"}),(0,T.jsxs)("div",{children:[(0,T.jsx)("span",{className:P(["upload__label--text"]),children:n}),(0,T.jsx)("input",{id:e,className:P("upload__input"),type:"file",name:t,onChange:g,"aria-invalid":y?"true":"false","aria-describedby":b.join(" "),accept:i||null,onFocus:m,onBlur:v}),(0,T.jsx)("span",{className:P("upload__output"),"aria-hidden":"true",id:h,children:o})]})]})})]})}function Du({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:o,isComplete:i,onClickCancel:s}){const{t:a}=us(),[{value:c}]=Gl(t),l=c&&c.length>0,u=l?c[0].name:"";return(0,T.jsxs)(Yl,{className:P("upload-form"),children:[(0,T.jsx)(Ru,{name:t,id:e,accept:n,labelText:a("fileUpload.labelText"),outputText:a("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),(0,T.jsxs)("div",{className:P("upload__button-container"),children:[(0,T.jsx)("button",{id:o||!i?e:void 0,type:"button",onClick:s,className:P("button","button--secondary","upload__cancel"),children:a("fileUpload.cancelButtonText")}),(0,T.jsx)("button",{className:P("button","button--primary"),type:"submit",children:a("fileUpload.uploadButtonText")})]})]})}const Mu="fileListForm",Lu="fileList",Uu=()=>{const{t:e}=us(),{sendPolite:t,sendAssertive:n}=ds(),r=Cr(),o=ws(),{serviceAllowsUploads:i,allowedMimeTypes:s,maxSize:a}=Ss(),c=(0,Ke.useRef)(null),l=(0,Ke.useRef)(i),{cancelEntrySelection:u}=Su(),{uploadFile:p,clearUploads:d,isUploading:f,isComplete:h}=Cs(),{hasFile:y,selectedFileName:b,uploadHandle:m,hasServerError:v,progress:g}=((e,t)=>{const n=it((n=>Vl(n,{formId:e,name:t}))),{currentUploads:r}=Cs(),o=n&&n.length>0;let i=null,s=!1,a=0;if(r&&r.length>0){const e=r[0];i=e.uploadHandle,s=!!e.error,a=e.progress}return{hasFile:o,selectedFileName:o?n[0].name:"",uploadHandle:i,hasServerError:s,progress:a}})(Mu,Lu),w=Fs(),O=(0,Ke.useRef)(!0),j=e("fileUpload.contentHint",{size:B(a)}),x=(0,Ke.useRef)(""),_=(0,Ke.useRef)(null);(0,Ke.useEffect)((()=>{x.current&&_.current?.contains(document.activeElement)&&"INPUT"===document.activeElement.tagName&&n(j),x.current=j}),[j,n]),(0,Ke.useEffect)((()=>{g>0&&t(1===g?e("fileUpload.srStartedText"):`${g}%`)}),[g,t,e]),(0,Ke.useEffect)((()=>{O.current||f||!h||(d(),u(),o(),setTimeout((()=>{t(e("fileUpload.srCompleteText"))}),300)),O.current=h}),[f,h,d,u,o,t,e]);const S=(0,Ke.useCallback)((({fileList:e})=>{p(e[0]),o()}),[p,!1,o]),C=(0,Ke.useCallback)((()=>{m&&m.abort(),d(),u(),o()}),[m,d,u,o]),E=(0,Ke.useMemo)((()=>({[Lu]:[Il((()=>i),e("fileUpload.errors.unavailable")),Il(Rl,e("fileUpload.errors.noFile")),Il(Nl,e("fileUpload.errors.tooLarge"),a)]})),[a,i,e]);return(0,T.jsx)("div",{className:P(["upload",...v?["upload--error"]:[]]),ref:_,children:(0,T.jsxs)(Kl,{formId:Mu,persistData:!0,onSubmit:S,validationSchema:E,children:[(f||!h)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Nu,{}),(0,T.jsx)("div",{className:P("upload__button-container"),children:(0,T.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:C,ref:c,className:P("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!f&&h&&(0,T.jsx)(Du,{controlName:Lu,skiplinkId:r,accept:s.join(", "),contentHint:j,isComplete:h,isUploading:f,outputText:e("fileUpload.selectedText",{hasFile:y,filename:b}),onClickCancel:C}),!l.current&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("span",{className:P("notification"),id:w,children:e("fileUpload.unavailableText")}),(0,T.jsx)("div",{className:P("upload__button-container"),children:(0,T.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:C,className:P("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},Fu=()=>{const{t:e}=us(),{showFileUpload:t,serviceAllowsUploads:n}=Ss(),[r,o]=(0,Ke.useState)(n),s=ws(),a=(0,Ke.useRef)(null),{setUserEntryType:c,activeEntry:l}=Su(),u=(0,Ke.useRef)(null),{sendPolite:p}=ds(),d=!!Pr();return(0,Ke.useEffect)((()=>{q(u.current,(()=>{n||s()})),o(n)}),[n,s]),(0,Ke.useEffect)((()=>{a.current&&!n&&p(e("fileUpload.srUnavailableText")),!1===a.current&&n&&p(e("fileUpload.srAvailableText")),d&&(a.current=n)}),[n,d,p,e]),!t&&l!==i&&(0,T.jsx)(El,{isActive:r,transitionStartState:Sl,children:(0,T.jsx)("div",{className:P("upload-toggle-wrapper"),children:(0,T.jsx)(El,{isActive:r,transitionStartState:Cl,children:(0,T.jsx)("button",{className:P(["button","button--secondary","upload-toggle"]),ref:u,"aria-disabled":r?null:"true",type:"button",onClick:r?()=>{c(i),s()}:null,children:(0,T.jsx)(la,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})};function Bu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bu(Object(n),!0).forEach((function(t){zu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Hu=()=>{const{isOpen:e}=Li(),t=(0,Ke.useRef)(null),{hasCountdown:n}=Ls(),[r,o]=(0,Ke.useState)(n),{hasPrompt:s}=Us(),[a,c]=(0,Ke.useState)(s),l=ws(),u=(0,Ke.useRef)(!1),{activeEntry:p}=Su(),[d,f]=(0,Ke.useState)({text:Iu,upload:Uu}),[h,y]=(0,Ke.useState)((()=>p)),b=vr(),{accountAllowsUploads:m}=Ss(),v=(0,Ke.useCallback)((()=>{q(t.current,l)}),[l]);(0,Ke.useEffect)((()=>{const{customComponents:e}=b,{entry:t}=e||{};t&&f((e=>$u($u({},e),t)))}),[b]),(0,Ke.useEffect)((()=>{v(),o(n),c(s)}),[n,s,v]),(0,Ke.useEffect)((()=>{y(p),v()}),[p,v,t]),u.current=!(!t.current||!t.current.contains(document.activeElement));const g=d[h];return(0,T.jsxs)("div",{className:P("chat__entry"),ref:t,children:[r&&(0,T.jsx)(Ou,{}),a&&(0,T.jsx)(ju,{}),(0,T.jsxs)("div",{className:P(["entry__body",...n||s?["entry__body--hidden"]:[]]),children:[h!==i&&m&&e&&(0,T.jsx)(Fu,{}),(0,T.jsx)(g,{})]})]})},Vu=()=>{const{t:e}=us(),{isOpen:t,closeChat:n}=Li(),{isWindow:r}=Tr();return t&&r?(0,T.jsx)("button",{type:"button",className:P("button","collapse-button"),onClick:n,children:(0,T.jsx)(la,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null},qu=({children:e,handleClose:t,title:n,closeButtonText:r,srCloseButtonText:o,id:i})=>{const s=Fs();return(0,T.jsxs)("section",Object.assign({tabIndex:-1,id:i,"aria-labelledby":n?s:void 0,className:P("chat-status",!n&&"chat-status--condensed")},{children:[(0,T.jsxs)("div",Object.assign({className:P("chat-status__body")},{children:[n?(0,T.jsx)("h2",Object.assign({className:P("chat-status__title"),id:s},{children:n})):null,e]})),"function"==typeof t&&(0,T.jsxs)("button",Object.assign({type:"button",onClick:t,className:P("button","button--tertiary","chat-status__close")},{children:[r||(0,T.jsx)(la,{name:"close",size:"16",alt:""}),o&&(0,T.jsx)("span",Object.assign({className:P("visually-hidden")},{children:o}))]}))]}))};function Wu(){const{t:e}=us(),{id:t}=Hs(),{hasInterrupt:n}=al(),{disableTranslations:r,currentLocale:o}=$s(),i=Vs(o),s=ws(),a=e("translations.status.label",{language:i}),c=(0,Ke.useCallback)((()=>{r(),s()}),[r,s]);return n?null:(0,T.jsx)(qu,{handleClose:c,title:a,id:t,closeButtonText:e("translations.status.stopText"),srCloseButtonText:e("translations.status.srStopText")})}const Gu=({handleClick:e,icon:t,title:n,srButtonText:r})=>(0,T.jsxs)("button",Object.assign({type:"button",onClick:e,className:P("button","button--primary","chat-status__button")},{children:[(0,T.jsx)(la,{name:t,size:"16",alt:""}),n,r&&(0,T.jsx)("span",Object.assign({className:P("visually-hidden")},{children:r}))]}));function Ku(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=(()=>{const{isActive:e,languages:t}=$s(),n=ft(),{sendAction:r}=qi(),{translationProposal:o}=it((e=>e.translations)),{enableTranslations:i}=$s(),{isOpen:s}=Li(),{locale:a}=us(),c=null==o?void 0:o.proposedLocale,l=Vs(c),u=(0,Ke.useMemo)((()=>null!==o&&!e&&s&&a!==c&&t.some((e=>e.locale===c))),[o,e,s,a,c,t]);return{activateTranslationProposal:()=>{i(null==o?void 0:o.proposedLocale,"translation_proposal")},dismissTranslationProposal:()=>{r({type:d,body:{type:b}}),n(ki())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:o}})(),{id:o}=Hs();return e?(0,T.jsx)(qu,Object.assign({handleClose:n,srCloseButtonText:t.srDismissButtonText,id:o,title:t.titleLabel},{children:(0,T.jsx)(Gu,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})})):null}function Ju(){const{hasInterrupt:e}=al(),{isActive:t}=$s();return e?null:t?(0,T.jsx)(Wu,{}):(0,T.jsx)(Ku,{})}function Xu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yu=function({children:e,interruptComponent:t}){const{hasInterrupt:n,meta:r}=al(),{isOpen:o}=Li();return n?o?(0,T.jsx)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xu(Object(n),!0).forEach((function(t){Qu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},r)):null:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(gu,{children:[(0,T.jsxs)("div",{className:P("chat__container__header"),children:[(0,T.jsx)(Ju,{}),(0,T.jsx)(Vu,{})]}),e]}),(0,T.jsx)(Hu,{}),o&&(0,T.jsx)(yu,{})]})},Zu=({originalError:e,title:t,message:n,buttonText:r,action:o,srText:i})=>{const s=qi(),a=Fs(),{sendPolite:c}=ds(),l=ws(),u="SeamlySessionExpiredError"===e.name;return(0,Ke.useEffect)((()=>{u&&s[o]&&s[o]()}),[o,s,u]),(0,Ke.useEffect)((()=>{!u&&i&&setTimeout((()=>{c(i)}),200)}),[c,i,u]),u?(0,T.jsx)(T.Fragment,{}):(0,T.jsxs)("section",{className:P("interrupt"),"aria-labelledby":a,children:[(0,T.jsx)(Vu,{}),(0,T.jsxs)("div",{className:P("interrupt__body"),children:[(0,T.jsx)("h2",{id:a,className:P("interrupt__title"),children:t}),(0,T.jsx)("p",{className:P("interrupt__message"),children:n}),r&&o&&(0,T.jsx)("div",{className:P("interrupt__actions"),children:(0,T.jsx)("button",{type:"button",className:P("button","button--primary"),onClick:()=>{s[o]&&s[o](),l()},children:r})})]})]})};function ep({event:e}){const[t]=ml(e);return(0,T.jsx)(t,{event:e})}function tp(){const{preChatEvents:e,layoutMode:t}=vr(),{hasInterrupt:n}=al(),{isOpen:r}=Li(),o=!(n||!e?.length||r);return o&&(0,T.jsx)("ul",{className:P("pre-chat-messages",`pre-chat-messages--${t}`),"aria-hidden":!o,children:e.map((e=>(0,T.jsx)("li",{className:P("pre-chat-messages__message"),children:(0,T.jsx)(ep,{event:e})},e.payload.id)))})}function np(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const op=()=>{const e=function(){const{startChatIcon:e}=vr();return e}(),t=Pr(),{hasInterrupt:n}=al(),r=t&&!n,o=r?t.avatar:e;return o?(0,T.jsx)("img",{className:P(r?"avatar":"icon"),src:o,alt:""}):(0,T.jsx)(la,{name:"avatar",size:"32"})},ip=({onClick:e})=>{const t=$i(),{t:n}=us(),r=t()?n("window.openButton.srContinue"):n("window.openButton.srStart"),o=ws(),{isOpen:i}=Li(),s=Sr(),a=(0,Ke.useCallback)((()=>{e(),o()}),[o,e]);return(0,T.jsx)(El,{isActive:!i,transitionStartState:Sl,children:(0,T.jsxs)("button",{className:P("window-open-button"),"aria-label":r,"aria-hidden":i,onClick:a,children:[(0,T.jsx)("span",{className:P("message-count"),"aria-hidden":"true",children:!!s&&s}),(0,T.jsx)(op,{})]})})},sp={app:()=>(0,T.jsx)(kl,{children:(0,T.jsx)(Yu,{interruptComponent:Zu,children:(0,T.jsx)(Ol,{})})}),inline:()=>{const{showInlineView:e,containerRef:t}=(()=>{const e=ft(),{connectWhenInView:t}=vr(),n=it(Ar),{containerRef:r,isVisible:o}=Ui({enabled:t,freezeOnceVisible:!0});return(0,Ke.useEffect)((()=>{o&&e(Ri())}),[e,o]),{containerRef:r,showInlineView:n}})(),{isOpen:n}=Li(),{hasInterrupt:r,meta:o}=al();return r&&!n?(0,T.jsx)(Zu,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?np(Object(n),!0).forEach((function(t){rp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):np(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},o)):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(El,{isActive:!n,transitionStartState:Sl,children:(0,T.jsxs)("div",{ref:t,className:P("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,T.jsx)(tp,{}),(0,T.jsx)(Pl,{})]})}),(0,T.jsx)(El,{isActive:n,transitionStartState:Sl,children:(0,T.jsx)(kl,{ref:t,children:e&&(0,T.jsx)(Yu,{interruptComponent:Zu,children:n&&(0,T.jsx)(Ol,{})})})})]})},window:()=>{const{isOpen:e,openChat:t}=Li(),n=Ur(),{t:r}=us(),o=r("window.chat.continue"),i=(0,Ke.useMemo)((()=>({payload:{body:{text:o}}})),[o]);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ip,{onClick:t}),(0,T.jsx)(El,{isActive:!e&&!n,transitionStartState:Sl,children:(0,T.jsx)("div",{className:P("unstarted-wrapper","unstarted-wrapper--window"),children:(0,T.jsx)(tp,{})})}),(0,T.jsx)(El,{isActive:!e&&n,transitionStartState:_l,children:(0,T.jsx)("div",{className:P("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,T.jsx)(Dc,{event:i})})}),(0,T.jsx)(El,{isActive:e,transitionStartState:_l,children:(0,T.jsx)(kl,{children:(0,T.jsx)(Yu,{interruptComponent:Zu,children:(0,T.jsx)(Ol,{})})})})]})}},ap=({children:e})=>{const[,t]=vs(),{namespace:n,layoutMode:r,zIndex:o}=vr(),{isOpen:i,isVisible:s}=Li(),a=ys(),c=Ur(),{locale:l}=us(),u=sp[r],p=(0,Ke.useCallback)((e=>{t(e)}),[t]),d=(0,Ke.useMemo)((()=>{if(l&&document.querySelector("html").getAttribute("lang")!==l)return l}),[l]);if(!u)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const f=["app",`app--layout-${r}`,`namespace--${n}`,...a];return i||"app"===r||f.push("app--collapsed"),c&&f.push("app--user-responded"),s&&(0,T.jsx)("div",{className:P(f),lang:d,tabIndex:"-1","data-nosnippet":!0,style:{zIndex:o},ref:p,children:e||(0,T.jsx)(u,{})})};function cp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cp(Object(n),!0).forEach((function(t){up(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function up(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const pp=e=>(0,T.jsx)(fl,lp(lp({},e),{},{children:(0,T.jsx)(ap,{})}));var dp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};class fp{constructor(e,t){const{namespace:n="",parentElement:r,showFaq:o}=e,i=dp(e,["namespace","parentElement","showFaq"]);this.config=Object.assign(Object.assign({},i),{namespace:n,showFaq:!1!==o}),this.namespace=n,this.parentElement=r,this.externalApi=t,this.api=new Ve({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(We()),this.functions={},this.registerFunctions({on:this.eventBus.on,off:this.eventBus.off}),this.eventBus.on("function.register",((e,t)=>this.registerFunction(e,t))),this.eventBus.on("function.unregister",((e,t)=>this.unregisterFunction(e,t)))}render(){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const e=this.config.customComponents||{},{view:t}=e,n=dp(e,["view"]),r=Object.assign(Object.assign({},this.config),{customComponents:Object.keys(n).length?n:void 0}),o=function({initialState:e,api:t,eventBus:n,config:r}){return qn({reducer:{state:Uo,app:zr,config:Wo,i18n:pi,translations:Ai,visibility:Di,forms:ai,interrupt:Gr},preloadedState:e,middleware:e=>e({thunk:{extraArgument:{api:t,eventBus:n,config:r}},serializableCheck:!1}).concat([Xo({api:t}),fi({api:t}),mi({api:t}),Ii])})}({api:this.api,eventBus:this.eventBus,config:r,initialState:void 0});o.dispatch(Ho(r)),yield o.dispatch(ar());try{const{locale:e}=yield o.dispatch(Mr()).unwrap();yield o.dispatch(lr(e))}catch(e){}o.dispatch(Rr()),t?(0,Ge.render)((0,T.jsx)(fl,Object.assign({eventBus:this.eventBus,store:o,api:this.api},{children:(0,T.jsx)(t,{})})),this.parentElement):(0,Ge.render)((0,T.jsx)(pp,{config:r,eventBus:this.eventBus,store:o,api:this.api}),this.parentElement)}))}destroy(){(0,Ge.render)(null,this.parentElement),this.eventBus.off(),this.api.disconnect(),delete this.functions}registerFunctions(e){Object.entries(e).forEach((([e,t])=>{this.registerFunction(e,t)}))}registerFunction(e,t){this.functions[e]=this.functions[e]||[],this.functions[e].push(t),this.externalApi.handleActions()}unregisterFunction(e,t){const n=this.functions[e];n&&n.length&&(this.functions[e]=n.filter((e=>e!==t)))}execFunction(e,...t){const n=this.functions[e];return!(!n||!n.length||(n.forEach((n=>{try{n(...t)}catch(t){console.error(`Action(${e}) failed: `,t)}})),0))}}function hp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hp(Object(n),!0).forEach((function(t){bp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const mp=e=>"object"==typeof e&&"action"in e,vp=e=>yp(yp({},e),{},{args:Array.isArray(e.args)?e.args:[e.args]}),gp=class{constructor(e){this._waitingActions=[],this._instances={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(mp).map(vp)).length&&(this._waitingActions.push(...e),this.handleActions())}handleActions(){const e=this._waitingActions;this._waitingActions=[],e.forEach((e=>{switch(e.action){case"init":this.handleInit(e);break;case"destroy":this.handleDestroy(e);break;default:this.handleAction(e)||this.setContext(e.action,...e.args)||this._waitingActions.push(e)}}))}instanceInitializing(e){const t=Object.keys(this._instances);return!e&&t.length>0||t.includes(e)}setContext(e,t){const{instance:n}=t;if(this.instanceInitializing(n))return!1;switch(e){case"setTopic":const{name:e}=t;return e&&(this.context.topic=e),!0;case"setTranslation":const{enabled:n,locale:r}=t;return n&&r&&(this.context.translationLocale=r),!0;case"setVariables":return Object.keys(t).length>0&&(this.context.variables=yp({},t)),!0;default:return!1}}handleInit(e){const t=this.getUserConfig(...e.args),n=this.getCombinedConfig(t),{parentElement:r,namespace:o}=n||t;if(o?Object.values(this._instances).forEach((e=>{e.parentElement!==r&&e.namespace!==o||this.destroy(e)})):this.destroy(),n){const e=this.createInstance(n);this._instances[n.namespace]=e,this.context={},e.render()}}handleDestroy(e){this.destroy(e.instance)}handleAction(e){const{action:t,instance:n,args:r}=e,o=Object.values(this._instances);return!n&&o.length>1&&console.warn(`Multiple instances detected. Due to potential race conditions, it is recommended to target a specific instance with the action: ${t}`),o.map((e=>(!n||e.namespace===n)&&e.execFunction(t,...r))).some(Boolean)}createInstance(e){return new fp(e,this)}destroy(e){e?("string"==typeof e&&(e=this._instances[e]),e&&(e.destroy(),delete this._instances[e.namespace])):Object.entries(this._instances).forEach((([e,t])=>{t.destroy(),delete this._instances[e]}))}getUserConfig(e={}){return e}getCombinedConfig(e){const t=yp(yp({},e.context||this.appConfig.context),this.context),n=this.getMergedVariables(e);Object.keys(n).length>0&&(t.variables=n);const r=yp(yp({},this.appConfig.defaults),e.defaults),o=yp(yp(yp({},this.appConfig),e),{},{api:yp(yp({},this.appConfig.api),e.api),context:Object.keys(t).length?t:void 0,defaults:Object.keys(r).length?r:void 0});return"function"==typeof this.appConfig?this.appConfig(o):o}getMergedVariables(e){return yp(yp(yp({},this.appConfig.context?.variables||{}),e.context?.variables||{}),this.context.variables||{})}},wp=(...e)=>{const t=new URL(window.location.href);return e.reduce(((e,n)=>{const r=t.searchParams.get(n)||sessionStorage.getItem(n);return r&&(e[n]=r),e}),{})},Op=(...e)=>{const t=new URL(window.location.href),n=e.reduce(((e,n)=>{const r=t.searchParams.get(n),o=r||sessionStorage.getItem(n);return r&&sessionStorage.setItem(n,r),o?(e.set(n,o),e):e}),new URLSearchParams),r=new URLSearchParams(Object.assign(Object.assign({},Object.fromEntries(t.searchParams)),Object.fromEntries(n)));return r.toString()&&window.history.replaceState(null,null,`?${r}`),wp(...n.keys())},jp=(...e)=>{const t=document.querySelector("[data-reset-search-params]");t&&t.addEventListener("click",(t=>{t.preventDefault();const n=new URL(window.location.href);e.forEach((e=>{sessionStorage.removeItem(e),n.searchParams.delete(e)})),window.location.href=n.toString()}))}})(),module.exports=r})();
2
+ (()=>{var e={574:e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function n(){this._defaults=[]}for(var r=0,o=["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"];r<o.length;r++){const e=o[r];n.prototype[e]=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this._defaults.push({fn:e,args:n}),this}}n.prototype._setDefaults=function(e){var n,r=function(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(this._defaults);try{for(r.s();!(n=r.n()).done;){const t=n.value;e[t.fn](...t.args)}}catch(e){r.e(e)}finally{r.f()}},e.exports=n},766:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}let o;"undefined"!=typeof window?o=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),o=void 0):o=self;const i=n(767),a=n(445),s=n(129),c=n(842),l=n(244),u=l.isObject,p=l.mixin,d=l.hasOwn,f=n(253),h=n(574);function y(){}e.exports=function(e,n){return"function"==typeof n?new t.Request("GET",e).end(n):1===arguments.length?new t.Request("GET",e):new t.Request(e,n)};const m=t=e.exports;t.Request=x,m.getXHR=()=>{if(o.XMLHttpRequest)return new o.XMLHttpRequest;throw new Error("Browser-only version of superagent could not find XHR")};const b="".trim?e=>e.trim():e=>e.replace(/(^\s*|\s*$)/g,"");function v(e){if(!u(e))return e;const t=[];for(const n in e)d(e,n)&&g(t,n,e[n]);return t.join("&")}function g(e,t,n){if(void 0!==n)if(null!==n)if(Array.isArray(n)){var o,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}(n);try{for(i.s();!(o=i.n()).done;)g(e,t,o.value)}catch(e){i.e(e)}finally{i.f()}}else if(u(n))for(const r in n)d(n,r)&&g(e,`${t}[${r}]`,n[r]);else e.push(encodeURI(t)+"="+encodeURIComponent(n));else e.push(encodeURI(t))}function w(e){const t={},n=e.split("&");let r,o;for(let e=0,i=n.length;e<i;++e)r=n[e],o=r.indexOf("="),-1===o?t[decodeURIComponent(r)]="":t[decodeURIComponent(r.slice(0,o))]=decodeURIComponent(r.slice(o+1));return t}function j(e){return/[/+]json($|[^-\w])/i.test(e)}function O(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;let t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.headers=function(e){const t=e.split(/\r?\n/),n={};let r,o,i,a;for(let e=0,s=t.length;e<s;++e)o=t[e],r=o.indexOf(":"),-1!==r&&(i=o.slice(0,r).toLowerCase(),a=b(o.slice(r+1)),n[i]=a);return n}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&e._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function x(e,t){const n=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",(()=>{let e,t=null,r=null;try{r=new O(n)}catch(e){return t=new Error("Parser is unable to parse the response"),t.parse=!0,t.original=e,n.xhr?(t.rawResponse=void 0===n.xhr.responseType?n.xhr.responseText:n.xhr.response,t.status=n.xhr.status?n.xhr.status:null,t.statusCode=t.status):(t.rawResponse=null,t.status=null),n.callback(t)}n.emit("response",r);try{n._isResponseOK(r)||(e=new Error(r.statusText||r.text||"Unsuccessful HTTP response"))}catch(t){e=t}e?(e.original=t,e.response=r,e.status=e.status||r.status,n.callback(e,r)):n.callback(null,r)}))}m.serializeObject=v,m.parseString=w,m.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},m.serialize={"application/x-www-form-urlencoded":s.stringify,"application/json":a},m.parse={"application/x-www-form-urlencoded":w,"application/json":JSON.parse},p(O.prototype,f.prototype),O.prototype._parseBody=function(e){let t=m.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&j(this.type)&&(t=m.parse["application/json"]),t&&e&&(e.length>0||e instanceof Object)?t(e):null)},O.prototype.toError=function(){const e=this.req,t=e.method,n=e.url,r=`cannot ${t} ${n} (${this.status})`,o=new Error(r);return o.status=this.status,o.method=t,o.url=n,o},m.Response=O,i(x.prototype),p(x.prototype,c.prototype),x.prototype.type=function(e){return this.set("Content-Type",m.types[e]||e),this},x.prototype.accept=function(e){return this.set("Accept",m.types[e]||e),this},x.prototype.auth=function(e,t,n){1===arguments.length&&(t=""),"object"==typeof t&&null!==t&&(n=t,t=""),n||(n={type:"function"==typeof btoa?"basic":"auto"});const r=n.encoder?n.encoder:e=>{if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(e,t,n,r)},x.prototype.query=function(e){return"string"!=typeof e&&(e=v(e)),e&&this._query.push(e),this},x.prototype.attach=function(e,t,n){if(t){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,n||t.name)}return this},x.prototype._getFormData=function(){return this._formData||(this._formData=new o.FormData),this._formData},x.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();const n=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),n(e,t)},x.prototype.crossDomainError=function(){const e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},x.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},x.prototype.ca=x.prototype.agent,x.prototype.buffer=x.prototype.ca,x.prototype.write=()=>{throw new Error("Streaming is not supported in browser version of superagent")},x.prototype.pipe=x.prototype.write,x.prototype._isHost=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},x.prototype.end=function(e){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||y,this._finalizeQueryString(),this._end()},x.prototype._setUploadTimeout=function(){const e=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((()=>{e._timeoutError("Upload timeout of ",e._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},x.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));const e=this;this.xhr=m.getXHR();const t=this.xhr;let n=this._formData||this._data;this._setTimeouts(),t.addEventListener("readystatechange",(()=>{const n=t.readyState;if(n>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4!==n)return;let r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}));const r=(t,n)=>{n.total>0&&(n.percent=n.loaded/n.total*100,100===n.percent&&clearTimeout(e._uploadTimeoutTimer)),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{t.addEventListener("progress",r.bind(null,"download")),t.upload&&t.upload.addEventListener("progress",r.bind(null,"upload"))}catch(e){}t.upload&&this._setUploadTimeout();try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof n&&!this._isHost(n)){const e=this._header["content-type"];let t=this._serializer||m.serialize[e?e.split(";")[0]:""];!t&&j(e)&&(t=m.serialize["application/json"]),t&&(n=t(n))}for(const e in this.header)null!==this.header[e]&&d(this.header,e)&&t.setRequestHeader(e,this.header[e]);this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0===n?null:n)},m.agent=()=>new h;for(var S=0,_=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];S<_.length;S++){const e=_[S];h.prototype[e.toLowerCase()]=function(t,n){const r=new m.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}}function E(e,t,n){const r=m("DELETE",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}h.prototype.del=h.prototype.delete,m.get=(e,t,n)=>{const r=m("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},m.head=(e,t,n)=>{const r=m("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},m.options=(e,t,n)=>{const r=m("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.del=E,m.delete=E,m.patch=(e,t,n)=>{const r=m("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.post=(e,t,n)=>{const r=m("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.put=(e,t,n)=>{const r=m("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}},842:(e,t,n)=>{"use strict";const r=n(695),o=n(244),i=o.isObject,a=o.hasOwn;function s(){}e.exports=s,s.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},s.prototype.parse=function(e){return this._parser=e,this},s.prototype.responseType=function(e){return this._responseType=e,this},s.prototype.serialize=function(e){return this._serializer=e,this},s.prototype.timeout=function(e){if(!e||"object"!=typeof e)return this._timeout=e,this._responseTimeout=0,this._uploadTimeout=0,this;for(const t in e)if(a(e,t))switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;case"upload":this._uploadTimeout=e.upload;break;default:console.warn("Unknown timeout option",t)}return this},s.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};const c=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),l=new Set([408,413,429,500,502,503,504,521,522,524]);s.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{const n=this._retryCallback(e,t);if(!0===n)return!0;if(!1===n)return!1}catch(e){console.error(e)}if(t&&t.status&&l.has(t.status))return!0;if(e){if(e.code&&c.has(e.code))return!0;if(e.timeout&&"ECONNABORTED"===e.code)return!0;if(e.crossDomain)return!0}return!1},s.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},s.prototype.then=function(e,t){if(!this._fullfilledPromise){const e=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(((t,n)=>{e.on("abort",(()=>{if(this._maxRetries&&this._maxRetries>this._retries)return;if(this.timedout&&this.timedoutError)return void n(this.timedoutError);const e=new Error("Aborted");e.code="ABORTED",e.status=this.status,e.method=this.method,e.url=this.url,n(e)})),e.end(((e,r)=>{e?n(e):t(r)}))}))}return this._fullfilledPromise.then(e,t)},s.prototype.catch=function(e){return this.then(void 0,e)},s.prototype.use=function(e){return e(this),this},s.prototype.ok=function(e){if("function"!=typeof e)throw new Error("Callback required");return this._okCallback=e,this},s.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},s.prototype.get=function(e){return this._header[e.toLowerCase()]},s.prototype.getHeader=s.prototype.get,s.prototype.set=function(e,t){if(i(e)){for(const t in e)a(e,t)&&this.set(t,e[t]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},s.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},s.prototype.field=function(e,t,n){if(null==e)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(i(e)){for(const t in e)a(e,t)&&this.field(t,e[t]);return this}if(Array.isArray(t)){for(const n in t)a(t,n)&&this.field(e,t[n]);return this}if(null==t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=String(t)),n?this._getFormData().append(e,t,n):this._getFormData().append(e,t),this},s.prototype.abort=function(){if(this._aborted)return this;if(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req){if(r.gte(process.version,"v13.0.0")&&r.lt(process.version,"v14.0.0"))throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes");r.gte(process.version,"v14.0.0")&&(this.req.destroyed=!0),this.req.abort()}return this.clearTimeout(),this.emit("abort"),this},s.prototype._auth=function(e,t,n,r){switch(n.type){case"basic":this.set("Authorization",`Basic ${r(`${e}:${t}`)}`);break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization",`Bearer ${e}`)}return this},s.prototype.withCredentials=function(e){return void 0===e&&(e=!0),this._withCredentials=e,this},s.prototype.redirects=function(e){return this._maxRedirects=e,this},s.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw new TypeError("Invalid argument");return this._maxResponseSize=e,this},s.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},s.prototype.send=function(e){const t=i(e);let n=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(t&&i(this._data))for(const t in e)a(e,t)&&(this._data[t]=e[t]);else"string"==typeof e?(n||this.type("form"),n=this._header["content-type"],n&&(n=n.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===n?this._data?`${this._data}&${e}`:e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)||n||this.type("json"),this},s.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},s.prototype._finalizeQueryString=function(){const e=this._query.join("&");if(e&&(this.url+=(this.url.includes("?")?"&":"?")+e),this._query.length=0,this._sort){const e=this.url.indexOf("?");if(e>=0){const t=this.url.slice(e+1).split("&");"function"==typeof this._sort?t.sort(this._sort):t.sort(),this.url=this.url.slice(0,e)+"?"+t.join("&")}}},s.prototype._appendQueryString=()=>{console.warn("Unsupported")},s.prototype._timeoutError=function(e,t,n){if(this._aborted)return;const r=new Error(`${e+t}ms exceeded`);r.timeout=t,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.timedoutError=r,this.abort(),this.callback(r)},s.prototype._setTimeouts=function(){const e=this;this._timeout&&!this._timer&&(this._timer=setTimeout((()=>{e._timeoutError("Timeout of ",e._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((()=>{e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},253:(e,t,n)=>{"use strict";const r=n(244);function o(){}e.exports=o,o.prototype.get=function(e){return this.header[e.toLowerCase()]},o.prototype._setHeaderProperties=function(e){const t=e["content-type"]||"";this.type=r.type(t);const n=r.params(t);for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(this[e]=n[e]);this.links={};try{e.link&&(this.links=r.parseLinks(e.link))}catch(e){}},o.prototype._setStatusProperties=function(e){const t=Math.trunc(e/100);this.statusCode=e,this.status=this.statusCode,this.statusType=t,this.info=1===t,this.ok=2===t,this.redirect=3===t,this.clientError=4===t,this.serverError=5===t,this.error=(4===t||5===t)&&this.toError(),this.created=201===e,this.accepted=202===e,this.noContent=204===e,this.badRequest=400===e,this.unauthorized=401===e,this.notAcceptable=406===e,this.forbidden=403===e,this.notFound=404===e,this.unprocessableEntity=422===e}},244:(e,t)=>{"use strict";function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t.type=e=>e.split(/ *; */).shift(),t.params=e=>{const t={};var r,o=n(e.split(/ *; */));try{for(o.s();!(r=o.n()).done;){const e=r.value.split(/ *= */),n=e.shift(),o=e.shift();n&&o&&(t[n]=o)}}catch(e){o.e(e)}finally{o.f()}return t},t.parseLinks=e=>{const t={};var r,o=n(e.split(/ *, */));try{for(o.s();!(r=o.n()).done;){const e=r.value.split(/ *; */),n=e[0].slice(1,-1);t[e[1].split(/ *= */)[1].slice(1,-1)]=n}}catch(e){o.e(e)}finally{o.f()}return t},t.cleanHeader=(e,t)=>(delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e),t.isObject=e=>null!==e&&"object"==typeof e,t.hasOwn=Object.hasOwn||function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(new Object(e),t)},t.mixin=(e,n)=>{for(const r in n)t.hasOwn(n,r)&&(e[r]=n[r])}},905:e=>{e.exports=()=>()=>null},924:(e,t,n)=>{"use strict";var r=n(141),o=n(559),i=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&i(e,".prototype.")>-1?o(n):n}},559:(e,t,n)=>{"use strict";var r=n(612),o=n(141),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||r.call(a,i),c=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=s(r,a,arguments);if(c&&l){var n=c(t,"length");n.configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var p=function(){return s(r,i,arguments)};l?l(e.exports,"apply",{value:p}):e.exports.apply=p},767:e=>{function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},t.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){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}},445:e=>{e.exports=a,a.default=a,a.stable=u,a.stableStringify=u;var t="[...]",n="[Circular]",r=[],o=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(e,t,n,a){var s;void 0===a&&(a=i()),c(e,"",0,[],void 0,0,a);try{s=0===o.length?JSON.stringify(e,t,n):JSON.stringify(e,d(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var l=r.pop();4===l.length?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return s}function s(e,t,n,i){var a=Object.getOwnPropertyDescriptor(i,n);void 0!==a.get?a.configurable?(Object.defineProperty(i,n,{value:e}),r.push([i,n,t,a])):o.push([t,n,e]):(i[n]=e,r.push([i,n,t]))}function c(e,r,o,i,a,l,u){var p;if(l+=1,"object"==typeof e&&null!==e){for(p=0;p<i.length;p++)if(i[p]===e)return void s(n,e,r,a);if(void 0!==u.depthLimit&&l>u.depthLimit)return void s(t,e,r,a);if(void 0!==u.edgesLimit&&o+1>u.edgesLimit)return void s(t,e,r,a);if(i.push(e),Array.isArray(e))for(p=0;p<e.length;p++)c(e[p],p,p,i,e,l,u);else{var d=Object.keys(e);for(p=0;p<d.length;p++){var f=d[p];c(e[f],f,p,i,e,l,u)}}i.pop()}}function l(e,t){return e<t?-1:e>t?1:0}function u(e,t,n,a){void 0===a&&(a=i());var s,c=p(e,"",0,[],void 0,0,a)||e;try{s=0===o.length?JSON.stringify(c,t,n):JSON.stringify(c,d(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var l=r.pop();4===l.length?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return s}function p(e,o,i,a,c,u,d){var f;if(u+=1,"object"==typeof e&&null!==e){for(f=0;f<a.length;f++)if(a[f]===e)return void s(n,e,o,c);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==d.depthLimit&&u>d.depthLimit)return void s(t,e,o,c);if(void 0!==d.edgesLimit&&i+1>d.edgesLimit)return void s(t,e,o,c);if(a.push(e),Array.isArray(e))for(f=0;f<e.length;f++)p(e[f],f,f,a,e,u,d);else{var h={},y=Object.keys(e).sort(l);for(f=0;f<y.length;f++){var m=y[f];p(e[m],m,f,a,e,u,d),h[m]=e[m]}if(void 0===c)return h;r.push([c,o,e]),c[o]=h}a.pop()}}function d(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(o.length>0)for(var r=0;r<o.length;r++){var i=o[r];if(i[1]===t&&i[0]===n){n=i[2],o.splice(r,1);break}}return e.call(this,t,n)}}},648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,r=Object.prototype.toString,o="[object Function]";e.exports=function(e){var i=this;if("function"!=typeof i||r.call(i)!==o)throw new TypeError(t+i);for(var a,s=n.call(arguments,1),c=function(){if(this instanceof a){var t=i.apply(this,s.concat(n.call(arguments)));return Object(t)===t?t:this}return i.apply(e,s.concat(n.call(arguments)))},l=Math.max(0,i.length-s.length),u=[],p=0;p<l;p++)u.push("$"+p);if(a=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(c),i.prototype){var d=function(){};d.prototype=i.prototype,a.prototype=new d,d.prototype=null}return a}},612:(e,t,n)=>{"use strict";var r=n(648);e.exports=Function.prototype.bind||r},141:(e,t,n)=>{"use strict";var r,o=SyntaxError,i=Function,a=TypeError,s=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var l=function(){throw new a},u=c?function(){try{return l}catch(e){try{return c(arguments,"callee").get}catch(e){return l}}}():l,p=n(405)(),d=Object.getPrototypeOf||function(e){return e.__proto__},f={},h="undefined"==typeof Uint8Array?r:d(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":p?d([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p?d(d([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p?d((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p?d((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p?d(""[Symbol.iterator]()):r,"%Symbol%":p?Symbol:r,"%SyntaxError%":o,"%ThrowTypeError%":u,"%TypedArray%":h,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},m=function e(t){var n;if("%AsyncFunction%"===t)n=s("async function () {}");else if("%GeneratorFunction%"===t)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=s("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=d(o.prototype))}return y[t]=n,n},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=n(612),g=n(642),w=v.call(Function.call,Array.prototype.concat),j=v.call(Function.apply,Array.prototype.splice),O=v.call(Function.call,String.prototype.replace),x=v.call(Function.call,String.prototype.slice),S=v.call(Function.call,RegExp.prototype.exec),_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E=/\\(\\)?/g,C=function(e){var t=x(e,0,1),n=x(e,-1);if("%"===t&&"%"!==n)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var r=[];return O(e,_,(function(e,t,n,o){r[r.length]=n?O(o,E,"$1"):t||e})),r},P=function(e,t){var n,r=e;if(g(b,r)&&(r="%"+(n=b[r])[0]+"%"),g(y,r)){var i=y[r];if(i===f&&(i=m(r)),void 0===i&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===S(/^%?[^%]*%?$/,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=C(e),r=n.length>0?n[0]:"",i=P("%"+r+"%",t),s=i.name,l=i.value,u=!1,p=i.alias;p&&(r=p[0],j(n,w([0,1],p)));for(var d=1,f=!0;d<n.length;d+=1){var h=n[d],m=x(h,0,1),b=x(h,-1);if(('"'===m||"'"===m||"`"===m||'"'===b||"'"===b||"`"===b)&&m!==b)throw new o("property names with quotes must have matching quotes");if("constructor"!==h&&f||(u=!0),g(y,s="%"+(r+="."+h)+"%"))l=y[s];else if(null!=l){if(!(h in l)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&d+1>=n.length){var v=c(l,h);l=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:l[h]}else f=g(l,h),l=l[h];f&&!u&&(y[s]=l)}}return l}},405:(e,t,n)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(419);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},642:(e,t,n)=>{"use strict";var r=n(612);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},679:(e,t,n)=>{"use strict";var r=n(864),o={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},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=f(n);o&&o!==h&&e(t,o,r)}var a=u(n);p&&(a=a.concat(p(n)));for(var s=c(t),y=c(n),m=0;m<a.length;++m){var b=a[m];if(!(i[b]||r&&r[b]||y&&y[b]||s&&s[b])){var v=d(n,b);try{l(t,b,v)}catch(e){}}}}return t}},554:e=>{e.exports=function(e){var t={},n=[];(e=e||this).on=function(n,r,o){return(t[n]=t[n]||[]).push([r,o]),e},e.off=function(r,o){r||(t={});for(var i=t[r]||n,a=i.length=o?i.length:0;a--;)o==i[a][0]&&i.splice(a,1);return e},e.emit=function(r){for(var o,i=t[r]||n,a=i.length>0?i.slice(0,i.length):i,s=0;o=a[s++];)o[0].apply(o[1],n.slice.call(arguments,1));return e}}},631:(e,t,n)=>{var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"==typeof o.get?o.get:null,a=r&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=s&&c&&"function"==typeof c.get?c.get:null,u=s&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,y=Object.prototype.toString,m=Function.prototype.toString,b=String.prototype.match,v=String.prototype.slice,g=String.prototype.replace,w=String.prototype.toUpperCase,j=String.prototype.toLowerCase,O=RegExp.prototype.test,x=Array.prototype.concat,S=Array.prototype.join,_=Array.prototype.slice,E=Math.floor,C="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,k="function"==typeof Symbol&&"object"==typeof Symbol.iterator,A="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,I=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function R(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||O.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-E(-e):E(e);if(r!==e){var o=String(r),i=v.call(t,o.length+1);return g.call(o,n,"$&_")+"."+g.call(g.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return g.call(t,n,"$&_")}var D=n(654),M=D.custom,L=z(M)?M:null;function U(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function F(e){return g.call(String(e),/"/g,"&quot;")}function B(e){return!("[object Array]"!==q(e)||A&&"object"==typeof e&&A in e)}function $(e){return!("[object RegExp]"!==q(e)||A&&"object"==typeof e&&A in e)}function z(e){if(k)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!T)return!1;try{return T.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,r,o){var s=n||{};if(V(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!V(s,"customInspect")||s.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var y=s.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return G(t,s);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return y?R(t,w):w}if("bigint"==typeof t){var O=String(t)+"n";return y?R(t,O):O}var E=void 0===s.depth?5:s.depth;if(void 0===r&&(r=0),r>=E&&E>0&&"object"==typeof t)return B(t)?"[Array]":"[Object]";var P,M=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=S.call(Array(e.indent+1)," ")}return{base:n,prev:S.call(Array(t+1),n)}}(s,r);if(void 0===o)o=[];else if(W(o,t)>=0)return"[Circular]";function H(t,n,i){if(n&&(o=_.call(o)).push(n),i){var a={depth:s.depth};return V(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),e(t,a,r+1,o)}return e(t,s,r+1,o)}if("function"==typeof t&&!$(t)){var K=function(e){if(e.name)return e.name;var t=b.call(m.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ee=Z(t,H);return"[Function"+(K?": "+K:" (anonymous)")+"]"+(ee.length>0?" { "+S.call(ee,", ")+" }":"")}if(z(t)){var te=k?g.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):T.call(t);return"object"!=typeof t||k?te:J(te)}if((P=t)&&"object"==typeof P&&("undefined"!=typeof HTMLElement&&P instanceof HTMLElement||"string"==typeof P.nodeName&&"function"==typeof P.getAttribute)){for(var ne="<"+j.call(String(t.nodeName)),re=t.attributes||[],oe=0;oe<re.length;oe++)ne+=" "+re[oe].name+"="+U(F(re[oe].value),"double",s);return ne+=">",t.childNodes&&t.childNodes.length&&(ne+="..."),ne+"</"+j.call(String(t.nodeName))+">"}if(B(t)){if(0===t.length)return"[]";var ie=Z(t,H);return M&&!function(e){for(var t=0;t<e.length;t++)if(W(e[t],"\n")>=0)return!1;return!0}(ie)?"["+Y(ie,M)+"]":"[ "+S.call(ie,", ")+" ]"}if(function(e){return!("[object Error]"!==q(e)||A&&"object"==typeof e&&A in e)}(t)){var ae=Z(t,H);return"cause"in Error.prototype||!("cause"in t)||N.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+S.call(ae,", ")+" }":"{ ["+String(t)+"] "+S.call(x.call("[cause]: "+H(t.cause),ae),", ")+" }"}if("object"==typeof t&&c){if(L&&"function"==typeof t[L]&&D)return D(t,{depth:E-r});if("symbol"!==c&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{l.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var se=[];return a.call(t,(function(e,n){se.push(H(n,t,!0)+" => "+H(e,t))})),Q("Map",i.call(t),se,M)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ce=[];return u.call(t,(function(e){ce.push(H(e,t))})),Q("Set",l.call(t),ce,M)}if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return X("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return X("WeakSet");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{return f.call(e),!0}catch(e){}return!1}(t))return X("WeakRef");if(function(e){return!("[object Number]"!==q(e)||A&&"object"==typeof e&&A in e)}(t))return J(H(Number(t)));if(function(e){if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}(t))return J(H(C.call(t)));if(function(e){return!("[object Boolean]"!==q(e)||A&&"object"==typeof e&&A in e)}(t))return J(h.call(t));if(function(e){return!("[object String]"!==q(e)||A&&"object"==typeof e&&A in e)}(t))return J(H(String(t)));if(!function(e){return!("[object Date]"!==q(e)||A&&"object"==typeof e&&A in e)}(t)&&!$(t)){var le=Z(t,H),ue=I?I(t)===Object.prototype:t instanceof Object||t.constructor===Object,pe=t instanceof Object?"":"null prototype",de=!ue&&A&&Object(t)===t&&A in t?v.call(q(t),8,-1):pe?"Object":"",fe=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(de||pe?"["+S.call(x.call([],de||[],pe||[]),": ")+"] ":"");return 0===le.length?fe+"{}":M?fe+"{"+Y(le,M)+"}":fe+"{ "+S.call(le,", ")+" }"}return String(t)};var H=Object.prototype.hasOwnProperty||function(e){return e in this};function V(e,t){return H.call(e,t)}function q(e){return y.call(e)}function W(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function G(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return G(v.call(e,0,t.maxStringLength),t)+r}return U(g.call(g.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,K),"single",t)}function K(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function J(e){return"Object("+e+")"}function X(e){return e+" { ? }"}function Q(e,t,n,r){return e+" ("+t+") {"+(r?Y(n,r):S.call(n,", "))+"}"}function Y(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+S.call(e,","+n)+"\n"+t.prev}function Z(e,t){var n=B(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=V(e,o)?t(e[o],e):""}var i,a="function"==typeof P?P(e):[];if(k){i={};for(var s=0;s<a.length;s++)i["$"+a[s]]=a[s]}for(var c in e)V(e,c)&&(n&&String(Number(c))===c&&c<e.length||k&&i["$"+c]instanceof Symbol||(O.call(/[^\w$]/,c)?r.push(t(c,e)+": "+t(e[c],e)):r.push(c+": "+t(e[c],e))));if("function"==typeof P)for(var l=0;l<a.length;l++)N.call(e,a[l])&&r.push("["+t(a[l])+"]: "+t(e[a[l]],e));return r}},661:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>y,Component:()=>r.Component,Fragment:()=>r.Fragment,PureComponent:()=>l,StrictMode:()=>Q,Suspense:()=>w,SuspenseList:()=>x,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>z,cloneElement:()=>W,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>V,createPortal:()=>C,createRef:()=>r.createRef,default:()=>re,findDOMNode:()=>K,flushSync:()=>X,forwardRef:()=>f,hydrate:()=>I,isValidElement:()=>q,lazy:()=>O,memo:()=>u,render:()=>N,startTransition:()=>Y,unmountComponentAtNode:()=>G,unstable_batchedUpdates:()=>J,useDeferredValue:()=>Z,useInsertionEffect:()=>te,useSyncExternalStore:()=>ne,useTransition:()=>ee,version:()=>H});var r=n(210),o=n(207),i={};for(const e in o)["default","Component","Fragment","createContext","createElement","createRef","Children","PureComponent","StrictMode","Suspense","SuspenseList","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","cloneElement","createFactory","createPortal","findDOMNode","flushSync","forwardRef","hydrate","isValidElement","lazy","memo","render","startTransition","unmountComponentAtNode","unstable_batchedUpdates","useDeferredValue","useInsertionEffect","useSyncExternalStore","useTransition","version"].indexOf(e)<0&&(i[e]=()=>o[e]);function a(e,t){for(var n in t)e[n]=t[n];return e}function s(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function c(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}function l(e){this.props=e}function u(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:s(this.props,e)}function o(t){return this.shouldComponentUpdate=n,(0,r.createElement)(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}n.d(t,i),(l.prototype=new r.Component).isPureReactComponent=!0,l.prototype.shouldComponentUpdate=function(e,t){return s(this.props,e)||s(this.state,t)};var p=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),p&&p(e)};var d="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function f(e){function t(t){var n=a({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=d,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var h=function(e,t){return null==e?null:(0,r.toChildArray)((0,r.toChildArray)(e).map(t))},y={map:h,forEach:h,count:function(e){return e?(0,r.toChildArray)(e).length:0},only:function(e){var t=(0,r.toChildArray)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.toChildArray},m=r.options.__e;r.options.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);m(e,t,n,r)};var b=r.options.unmount;function v(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=a({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return v(e,t,n)}))),e}function g(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return g(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function w(){this.__u=0,this.t=null,this.__b=null}function j(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function O(e){var t,n,o;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){o=e})),o)throw o;if(!n)throw t;return(0,r.createElement)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function x(){this.u=null,this.o=null}r.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),b&&b(e)},(w.prototype=new r.Component).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=j(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=g(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},w.prototype.componentWillUnmount=function(){this.t=[]},w.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=v(this.__b,n,o.__O=o.__P)}this.__b=null}var i=t.__a&&(0,r.createElement)(r.Fragment,null,e.fallback);return i&&(i.__h=null),[(0,r.createElement)(r.Fragment,null,t.__a?null:e.children),i]};var S=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function _(e){return this.getChildContext=function(){return e.context},e.children}function E(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,r.render)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,r.render)((0,r.createElement)(_,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function C(e,t){var n=(0,r.createElement)(E,{__v:e,i:t});return n.containerInfo=t,n}(x.prototype=new r.Component).__a=function(e){var t=this,n=j(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),S(t,e,r)):o()};n?n(i):i()}},x.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,r.toChildArray)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},x.prototype.componentDidUpdate=x.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){S(e,n,t)}))};var P="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,T=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,k="undefined"!=typeof document,A=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};function N(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function I(e,t,n){return(0,r.hydrate)(e,t),"function"==typeof n&&n(),e?e.__c:null}r.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(r.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var R=r.options.event;function D(){}function M(){return this.cancelBubble}function L(){return this.defaultPrevented}r.options.event=function(e){return R&&(e=R(e)),e.persist=D,e.isPropagationStopped=M,e.isDefaultPrevented=L,e.nativeEvent=e};var U,F={configurable:!0,get:function(){return this.class}},B=r.options.vnode;r.options.vnode=function(e){var t=e.type,n=e.props,o=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var a in o={},n){var s=n[a];k&&"children"===a&&"noscript"===t||"value"===a&&"defaultValue"in n&&null==s||("defaultValue"===a&&"value"in n&&null==n.value?a="value":"download"===a&&!0===s?s="":/ondoubleclick/i.test(a)?a="ondblclick":/^onchange(textarea|input)/i.test(a+t)&&!A(n.type)?a="oninput":/^onfocus$/i.test(a)?a="onfocusin":/^onblur$/i.test(a)?a="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(a)?a=a.toLowerCase():i&&T.test(a)?a=a.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===s&&(s=void 0),/^oninput$/i.test(a)&&(a=a.toLowerCase(),o[a]&&(a="oninputCapture")),o[a]=s)}"select"==t&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,r.toChildArray)(n.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==t&&null!=o.defaultValue&&(o.value=(0,r.toChildArray)(n.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),e.props=o,n.class!=n.className&&(F.enumerable="className"in n,null!=n.className&&(o.class=n.className),Object.defineProperty(o,"className",F))}e.$$typeof=P,B&&B(e)};var $=r.options.__r;r.options.__r=function(e){$&&$(e),U=e.__c};var z={ReactCurrentDispatcher:{current:{readContext:function(e){return U.__n[e.__c].props.value}}}},H="17.0.2";function V(e){return r.createElement.bind(null,e)}function q(e){return!!e&&e.$$typeof===P}function W(e){return q(e)?r.cloneElement.apply(null,arguments):e}function G(e){return!!e.__k&&((0,r.render)(null,e),!0)}function K(e){return e&&(e.base||1===e.nodeType&&e)||null}var J=function(e,t){return e(t)},X=function(e,t){return e(t)},Q=r.Fragment;function Y(e){e()}function Z(e){return e}function ee(){return[!1,Y]}var te=o.useLayoutEffect;function ne(e,t){var n=t(),r=(0,o.useState)({h:{__:n,v:t}}),i=r[0].h,a=r[1];return(0,o.useLayoutEffect)((function(){i.__=n,i.v=t,c(i.__,t())||a({h:i})}),[e,n,t]),(0,o.useEffect)((function(){return c(i.__,i.v())||a({h:i}),e((function(){c(i.__,i.v())||a({h:i})}))}),[e]),n}var re={useState:o.useState,useId:o.useId,useReducer:o.useReducer,useEffect:o.useEffect,useLayoutEffect:o.useLayoutEffect,useInsertionEffect:te,useTransition:ee,useDeferredValue:Z,useSyncExternalStore:ne,startTransition:Y,useRef:o.useRef,useImperativeHandle:o.useImperativeHandle,useMemo:o.useMemo,useCallback:o.useCallback,useContext:o.useContext,useDebugValue:o.useDebugValue,version:"17.0.2",Children:y,render:N,hydrate:I,unmountComponentAtNode:G,createPortal:C,createElement:r.createElement,createContext:r.createContext,createFactory:V,cloneElement:W,createRef:r.createRef,Fragment:r.Fragment,isValidElement:q,findDOMNode:K,Component:r.Component,PureComponent:l,memo:u,forwardRef:f,flushSync:X,unstable_batchedUpdates:J,StrictMode:Q,Suspense:w,SuspenseList:x,lazy:O,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:z}},569:e=>{"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC3986";e.exports={default:r,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:r}},129:(e,t,n)=>{"use strict";var r=n(261),o=n(235),i=n(569);e.exports={formats:i,parse:o,stringify:r}},235:(e,t,n)=>{"use strict";var r=n(769),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=n.depth>0&&/(\[[^[\]]*])/.exec(i),l=s?i.slice(0,s.index):i,u=[];if(l){if(!n.plainObjects&&o.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var p=0;n.depth>0&&null!==(s=a.exec(i))&&p<n.depth;){if(p+=1,!n.plainObjects&&o.call(Object.prototype,s[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(s[1])}return s&&u.push("["+i.slice(s.index)+"]"),function(e,t,n,r){for(var o=r?t:c(t,n),i=e.length-1;i>=0;--i){var a,s=e[i];if("[]"===s&&n.parseArrays)a=[].concat(o);else{a=n.plainObjects?Object.create(null):{};var l="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&s!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(a=[])[u]=o:"__proto__"!==l&&(a[l]=o):a={0:o}}o=a}return o}(u,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var n,l={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,p=t.parameterLimit===1/0?void 0:t.parameterLimit,d=u.split(t.delimiter,p),f=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n<d.length;++n)0===d[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===d[n]?h="utf-8":"utf8=%26%2310003%3B"===d[n]&&(h="iso-8859-1"),f=n,n=d.length);for(n=0;n<d.length;++n)if(n!==f){var y,m,b=d[n],v=b.indexOf("]="),g=-1===v?b.indexOf("="):v+1;-1===g?(y=t.decoder(b,a.decoder,h,"key"),m=t.strictNullHandling?null:""):(y=t.decoder(b.slice(0,g),a.decoder,h,"key"),m=r.maybeMap(c(b.slice(g+1),t),(function(e){return t.decoder(e,a.decoder,h,"value")}))),m&&t.interpretNumericEntities&&"iso-8859-1"===h&&(m=s(m)),b.indexOf("[]=")>-1&&(m=i(m)?[m]:m),o.call(l,y)?l[y]=r.combine(l[y],m):l[y]=m}return l}(e,n):e,p=n.plainObjects?Object.create(null):{},d=Object.keys(u),f=0;f<d.length;++f){var h=d[f],y=l(h,u[h],n,"string"==typeof e);p=r.merge(p,y,n)}return!0===n.allowSparse?p:r.compact(p)}},261:(e,t,n)=>{"use strict";var r=n(478),o=n(769),i=n(569),a=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,l=String.prototype.split,u=Array.prototype.push,p=function(e,t){u.apply(e,c(t)?t:[t])},d=Date.prototype.toISOString,f=i.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:f,formatter:i.formatters[f],indices:!1,serializeDate:function(e){return d.call(e)},skipNulls:!1,strictNullHandling:!1},y={},m=function e(t,n,i,a,s,u,d,f,m,b,v,g,w,j,O,x){for(var S,_=t,E=x,C=0,P=!1;void 0!==(E=E.get(y))&&!P;){var T=E.get(t);if(C+=1,void 0!==T){if(T===C)throw new RangeError("Cyclic object value");P=!0}void 0===E.get(y)&&(C=0)}if("function"==typeof f?_=f(n,_):_ instanceof Date?_=v(_):"comma"===i&&c(_)&&(_=o.maybeMap(_,(function(e){return e instanceof Date?v(e):e}))),null===_){if(s)return d&&!j?d(n,h.encoder,O,"key",g):n;_=""}if("string"==typeof(S=_)||"number"==typeof S||"boolean"==typeof S||"symbol"==typeof S||"bigint"==typeof S||o.isBuffer(_)){if(d){var k=j?n:d(n,h.encoder,O,"key",g);if("comma"===i&&j){for(var A=l.call(String(_),","),N="",I=0;I<A.length;++I)N+=(0===I?"":",")+w(d(A[I],h.encoder,O,"value",g));return[w(k)+(a&&c(_)&&1===A.length?"[]":"")+"="+N]}return[w(k)+"="+w(d(_,h.encoder,O,"value",g))]}return[w(n)+"="+w(String(_))]}var R,D=[];if(void 0===_)return D;if("comma"===i&&c(_))R=[{value:_.length>0?_.join(",")||null:void 0}];else if(c(f))R=f;else{var M=Object.keys(_);R=m?M.sort(m):M}for(var L=a&&c(_)&&1===_.length?n+"[]":n,U=0;U<R.length;++U){var F=R[U],B="object"==typeof F&&void 0!==F.value?F.value:_[F];if(!u||null!==B){var $=c(_)?"function"==typeof i?i(L,F):L:L+(b?"."+F:"["+F+"]");x.set(t,C);var z=r();z.set(y,x),p(D,e(B,$,i,a,s,u,d,f,m,b,v,g,w,j,O,z))}}return D};e.exports=function(e,t){var n,o=e,l=function(e){if(!e)return h;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=i.default;if(void 0!==e.format){if(!a.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=i.formatters[n],o=h.filter;return("function"==typeof e.filter||c(e.filter))&&(o=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:void 0===e.allowDots?h.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:h.encode,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:o,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"==typeof l.filter?o=(0,l.filter)("",o):c(l.filter)&&(n=l.filter);var u,d=[];if("object"!=typeof o||null===o)return"";u=t&&t.arrayFormat in s?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var f=s[u];if(t&&"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var y="comma"===f&&t&&t.commaRoundTrip;n||(n=Object.keys(o)),l.sort&&n.sort(l.sort);for(var b=r(),v=0;v<n.length;++v){var g=n[v];l.skipNulls&&null===o[g]||p(d,m(o[g],g,f,y,l.strictNullHandling,l.skipNulls,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.format,l.formatter,l.encodeValuesOnly,l.charset,b))}var w=d.join(l.delimiter),j=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?j+="utf8=%26%2310003%3B&":j+="utf8=%E2%9C%93&"),w.length>0?j+w:""}},769:(e,t,n)=>{"use strict";var r=n(569),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:s,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],a=o.obj[o.prop],s=Object.keys(a),c=0;c<s.length;++c){var l=s[c],u=a[l];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:a,prop:l}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,o,i){if(0===e.length)return e;var s=e;if("symbol"==typeof e?s=Symbol.prototype.toString.call(e):"string"!=typeof e&&(s=String(e)),"iso-8859-1"===n)return escape(s).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var c="",l=0;l<s.length;++l){var u=s.charCodeAt(l);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===r.RFC1738&&(40===u||41===u)?c+=s.charAt(l):u<128?c+=a[u]:u<2048?c+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?c+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(l)),c+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(i(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!o.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var a=t;return i(t)&&!i(n)&&(a=s(t,r)),i(t)&&i(n)?(n.forEach((function(n,i){if(o.call(t,i)){var a=t[i];a&&"object"==typeof a&&n&&"object"==typeof n?t[i]=e(a,n,r):t.push(n)}else t[i]=n})),t):Object.keys(n).reduce((function(t,i){var a=n[i];return o.call(t,i)?t[i]=e(t[i],a,r):t[i]=a,t}),a)}}},921:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,y=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,g=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function j(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case p:case i:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case l:case d:case m:case y:case c:return e;default:return t}}case o:return t}}}function O(e){return j(e)===p}t.AsyncMode=u,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=c,t.Element=r,t.ForwardRef=d,t.Fragment=i,t.Lazy=m,t.Memo=y,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=f,t.isAsyncMode=function(e){return O(e)||j(e)===u},t.isConcurrentMode=O,t.isContextConsumer=function(e){return j(e)===l},t.isContextProvider=function(e){return j(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return j(e)===d},t.isFragment=function(e){return j(e)===i},t.isLazy=function(e){return j(e)===m},t.isMemo=function(e){return j(e)===y},t.isPortal=function(e){return j(e)===o},t.isProfiler=function(e){return j(e)===s},t.isStrictMode=function(e){return j(e)===a},t.isSuspense=function(e){return j(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===s||e===a||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===y||e.$$typeof===c||e.$$typeof===l||e.$$typeof===d||e.$$typeof===v||e.$$typeof===g||e.$$typeof===w||e.$$typeof===b)},t.typeOf=j},864:(e,t,n)=>{"use strict";e.exports=n(921)},359:(e,t)=>{"use strict";Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen");Symbol.for("react.module.reference")},973:(e,t,n)=>{"use strict";n(359)},478:(e,t,n)=>{"use strict";var r=n(141),o=n(924),i=n(631),a=r("%TypeError%"),s=r("%WeakMap%",!0),c=r("%Map%",!0),l=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),p=o("WeakMap.prototype.has",!0),d=o("Map.prototype.get",!0),f=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),y=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n};e.exports=function(){var e,t,n,r={assert:function(e){if(!r.has(e))throw new a("Side channel does not contain "+i(e))},get:function(r){if(s&&r&&("object"==typeof r||"function"==typeof r)){if(e)return l(e,r)}else if(c){if(t)return d(t,r)}else if(n)return function(e,t){var n=y(e,t);return n&&n.value}(n,r)},has:function(r){if(s&&r&&("object"==typeof r||"function"==typeof r)){if(e)return p(e,r)}else if(c){if(t)return h(t,r)}else if(n)return function(e,t){return!!y(e,t)}(n,r);return!1},set:function(r,o){s&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new s),u(e,r,o)):c?(t||(t=new c),f(t,r,o)):(n||(n={key:{},next:null}),function(e,t,n){var r=y(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,r,o))}};return r}},250:(e,t,n)=>{"use strict";var r=n(661),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,s=r.useLayoutEffect,c=r.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return s((function(){o.value=n,o.getSnapshot=t,l(o)&&u({inst:o})}),[e,n,t]),a((function(){return l(o)&&u({inst:o}),e((function(){l(o)&&u({inst:o})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},139:(e,t,n)=>{"use strict";var r=n(661),o=n(688),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=o.useSyncExternalStore,s=r.useRef,c=r.useEffect,l=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var p=s(null);if(null===p.current){var d={hasValue:!1,value:null};p.current=d}else d=p.current;p=l((function(){function e(e){if(!c){if(c=!0,a=e,e=r(e),void 0!==o&&d.hasValue){var t=d.value;if(o(t,e))return s=t}return s=e}if(t=s,i(a,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(a=e,s=n)}var a,s,c=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]}),[t,n,r,o]);var f=a(e,p[0],p[1]);return c((function(){d.hasValue=!0,d.value=f}),[f]),u(f),f}},688:(e,t,n)=>{"use strict";e.exports=n(250)},798:(e,t,n)=>{"use strict";e.exports=n(139)},210:e=>{"use strict";e.exports=require("preact")},207:e=>{"use strict";e.exports=require("preact/hooks")},654:()=>{},695:()=>{}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{Engine:()=>xp,ExternalApi:()=>Tp,calculateVisibility:()=>_,className:()=>T,eventTypes:()=>e,getSearchParamsByKeys:()=>kp,initResetSearchParams:()=>Np,randomId:()=>J,replaceSearchParams:()=>Ap});const e={info:"info",message:"message",participant:"participant",system:"system"},t="text",o="text",i="upload",a="received",s="read",c="custom",l="typing",u="read",p="detach_service",d="dismiss",f="set_topic",h="set_translation",y="click_cta",m="translation_proposal",b=m,v="assertive",g="polite",w={new_topic:"newTopic",new_translation:"newTranslation"},j="uploads",O="navigate",x="visibility",S={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},_=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:o,layoutMode:i,hideOnNoUserResponse:a}=r,{visible:s}=o||{};return"app"!==i||t?"window"===i&&a&&n!==S.open?e?n||t||S.open:S.hidden:"inline"===i&&e&&!n?t||S.open:n||t||s||S.minimized:S.open},E="cvco",C="2",P="seamly-client-participant",T=(...e)=>e.flat().map((e=>"object"==typeof e?Object.entries(e).map((([e,t])=>t?e:"")).join(" "):e)).filter((e=>"string"==typeof e)).map((e=>e.split(" "))).flat().filter((e=>e.length)).map((e=>e.indexOf(E)>-1?e:[E,e].join("-"))).join(" "),k=require("preact/jsx-runtime");var A=n(766),N=n.n(A);class I extends Error{action="";langKey="";constructor(e,...t){if(super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Object.getPrototypeOf(this)),this.originalError=e,e?.payload&&(this.originalEvent=e,this.originalError=e.payload.error,this.message=`Event of type ${e.payload.type} encountered`),!this.message&&e?.message){const t=function(e){try{return JSON.parse(e).error}catch(t){return e}}(e.message);this.message=t}e?.error&&(this.originalError=e.error)}}class R extends I{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class D extends I{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class M extends I{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class L extends I{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}const U=(e,t)=>{let n;return function(...r){let o=!1;return clearTimeout(n),n=setTimeout((()=>{n=null,o||e.apply(this,r),o=!1}),t),t=>{o=!0,t&&e.apply(this,r)}}},F=e=>Math.ceil(e/1e3),B=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},$=(e,t=2)=>{if(0===e)return"0 Bytes";const n=t<0?0:t,r=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**r).toFixed(n))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`},z={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},H={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},V=e=>e.code?H[e.code]:z[e.keyCode],q=e=>{e&&e.focus()},W=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};var G=n(905),K=n.n(G);function J(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}function X(e){const t=`cvco.${e}`;return{get(){const e=[t,t.split(".").slice(0,-1).join(".")];let n;do{n=sessionStorage.getItem(e[0])}while(e.shift()&&!n);return JSON.parse(n)},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}var Q=e=>"function"==typeof e?e:function(){return e},Y="undefined"!=typeof self?self:null,Z="undefined"!=typeof window?window:null,ee=Y||Z||ee,te="closed",ne="errored",re="joined",oe="joining",ie="leaving",ae="phx_close",se="phx_error",ce="phx_reply",le="phx_leave",ue="websocket",pe=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter((t=>t.status===e)).forEach((e=>e.callback(t)))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,(e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)})),this.timeoutTimer=setTimeout((()=>{this.trigger("timeout",{})}),this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},de=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout((()=>{this.tries=this.tries+1,this.callback()}),this.timerCalc(this.tries+1))}},fe=class{static request(e,t,n,r,o,i,a){if(ee.XDomainRequest){let n=new ee.XDomainRequest;return this.xdomainRequest(n,e,t,r,o,i,a)}{let s=new ee.XMLHttpRequest;return this.xhrRequest(s,e,t,n,r,o,i,a)}}static xdomainRequest(e,t,n,r,o,i,a){return e.timeout=o,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);a&&a(t)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,o,i,a,s){return e.open(t,n,!0),e.timeout=i,e.setRequestHeader("Content-Type",r),e.onerror=()=>s&&s(null),e.onreadystatechange=()=>{if(4===e.readyState&&s){let t=this.parseJSON(e.responseText);s(t)}},a&&(e.ontimeout=a),e.send(o),e}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch(t){return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let o=t?`${t}[${r}]`:r,i=e[r];"object"==typeof i?n.push(this.serialize(i,o)):n.push(encodeURIComponent(o)+"="+encodeURIComponent(i))}return n.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},he=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,this.poll()}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+ue),"$1/longpoll")}endpointURL(){return fe.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=0}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return 1===this.readyState||0===this.readyState}poll(){this.ajax("GET",null,(()=>this.ontimeout()),(e=>{if(e){var{status:t,token:n,messages:r}=e;this.token=n}else t=0;switch(t){case 200:r.forEach((e=>{setTimeout((()=>this.onmessage({data:e})),0)})),this.poll();break;case 204:this.poll();break;case 410:this.readyState=1,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}}))}send(e){this.ajax("POST",e,(()=>this.onerror("timeout")),(e=>{e&&200===e.status||(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1))}))}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=3;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});"undefined"!=typeof CloseEvent?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r){let o;o=fe.request(e,this.endpointURL(),"application/json",t,this.timeout,(()=>{this.reqs.delete(o),n()}),(e=>{this.reqs.delete(o),this.isActive()&&r(e)})),this.reqs.add(o)}},ye={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,o,i,a]=JSON.parse(e);return t({join_ref:n,ref:r,topic:o,event:i,payload:a})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:o,payload:i}=e,a=this.META_LENGTH+t.length+n.length+o.length+r.length,s=new ArrayBuffer(this.HEADER_LENGTH+a),c=new DataView(s),l=0;c.setUint8(l++,this.KINDS.push),c.setUint8(l++,t.length),c.setUint8(l++,n.length),c.setUint8(l++,o.length),c.setUint8(l++,r.length),Array.from(t,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(n,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(o,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(r,(e=>c.setUint8(l++,e.charCodeAt(0))));var u=new Uint8Array(s.byteLength+i.byteLength);return u.set(new Uint8Array(s),0),u.set(new Uint8Array(i),s.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,s=n.decode(e.slice(a,a+r));a+=r;let c=n.decode(e.slice(a,a+o));a+=o;let l=n.decode(e.slice(a,a+i));return a+=i,{join_ref:s,ref:null,topic:c,event:l,payload:e.slice(a,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),s=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+o));s+=o;let u=n.decode(e.slice(s,s+i));s+=i;let p=n.decode(e.slice(s,s+a));s+=a;let d=e.slice(s,e.byteLength);return{join_ref:c,ref:l,topic:u,event:ce,payload:{status:p,response:d}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=this.HEADER_LENGTH+2,a=n.decode(e.slice(i,i+r));i+=r;let s=n.decode(e.slice(i,i+o));return i+=o,{join_ref:null,ref:null,topic:a,event:s,payload:e.slice(i,e.byteLength)}}};function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){ve(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ve(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ge,we,je,Oe,xe=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},Se=function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n};const _e=K()("seamly");class Ee{constructor(){ge.add(this),we.set(this,[])}connect(e,t,n,r){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){this.url=e,this.accessToken=r,this.channelName=t,this.channelTopic=n;const{url:o,params:i}=(e=>{const t=e.indexOf("?");return t<0?{url:e,params:{}}:{url:e.slice(0,t),params:e.slice(t+1).split("&").reduce((function(e,t){const[n,r]=t.split("=");return be(be({},e),{},{[n]:decodeURIComponent(r)})}),{})}})(this.url);this.socket=new class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||1e4,this.transport=t.transport||ee.WebSocket||he,this.establishedConnections=0,this.defaultEncoder=ye.encode.bind(ye),this.defaultDecoder=ye.decode.bind(ye),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==he?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Z&&Z.addEventListener&&(Z.addEventListener("pagehide",(e=>{this.conn&&(this.disconnect(),n=this.connectClock)})),Z.addEventListener("pageshow",(e=>{n===this.connectClock&&(n=null,this.connect())}))),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Q(t.params||{}),this.endPoint=`${e}/${ue}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new de((()=>{this.teardown((()=>this.connect()))}),this.reconnectAfterMs)}getLongPollTransport(){return he}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.sendBuffer=[],this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=fe.appendParams(fe.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.teardown(e,t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Q(e)),this.conn||(this.connectClock++,this.closeWasClean=!1,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e))}log(e,t,n){this.logger(e,t,n)}hasLogger(){return null!==this.logger}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage((o=>{o.ref===t&&(this.off([r]),e(Date.now()-n))}));return!0}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach((([,e])=>e()))}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown((()=>this.reconnectTimer.scheduleTimeout()),1e3,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();this.waitForBufferDone((()=>{this.conn&&(t?this.conn.close(t,n||""):this.conn.close()),this.waitForSocketClosed((()=>{this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()}))}))}waitForBufferDone(e,t=1){5!==t&&this.conn&&this.conn.bufferedAmount?setTimeout((()=>{this.waitForBufferDone(e,t+1)}),150*t):e()}waitForSocketClosed(e,t=1){5!==t&&this.conn&&3!==this.conn.readyState?setTimeout((()=>{this.waitForSocketClosed(e,t+1)}),150*t):e()}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||1e3===t||this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach((([,t])=>t(e)))}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach((([,r])=>{r(e,t,n)})),(t===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach((e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(se)}))}connectionState(){switch(this.conn&&this.conn.readyState){case 0:return"connecting";case 1:return"open";case 2:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter((t=>t.joinRef()!==e.joinRef()))}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter((([t])=>-1===e.indexOf(t)))}channel(e,t={}){let n=new class{constructor(e,t,n){this.state=te,this.topic=e,this.params=Q(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new pe(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new de((()=>{this.socket.isConnected()&&this.rejoin()}),this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError((()=>this.rejoinTimer.reset()))),this.stateChangeRefs.push(this.socket.onOpen((()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()}))),this.joinPush.receive("ok",(()=>{this.state=re,this.rejoinTimer.reset(),this.pushBuffer.forEach((e=>e.send())),this.pushBuffer=[]})),this.joinPush.receive("error",(()=>{this.state=ne,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.onClose((()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=te,this.socket.remove(this)})),this.onError((e=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=ne,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.joinPush.receive("timeout",(()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new pe(this,le,Q({}),this.timeout).send(),this.state=ne,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.on(ce,((e,t)=>{this.trigger(this.replyEventName(t),e)}))}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(e){this.on(ae,e)}onError(e){return this.on(se,(t=>e(t)))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter((n=>!(n.event===e&&(void 0===t||t===n.ref))))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new pe(this,e,(function(){return t}),n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=ie;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(ae,"leave")},n=new pe(this,le,Q({}),e);return n.receive("ok",(()=>t())).receive("timeout",(()=>t())),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}isMember(e,t,n,r){return!(this.topic!==e||r&&r!==this.joinRef()&&(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),1))}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=oe,this.joinPush.resend(e))}trigger(e,t,n,r){let o=this.onMessage(e,t,n,r);if(t&&!o)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter((t=>t.event===e));for(let e=0;e<i.length;e++)i[e].callback(o,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===te}isErrored(){return this.state===ne}isJoined(){return this.state===re}isJoining(){return this.state===oe}isLeaving(){return this.state===ie}}(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:o,join_ref:i}=e;this.log("push",`${t} ${n} (${i}, ${o})`,r)}this.isConnected()?this.encode(e,(e=>this.conn.send(e))):this.sendBuffer.push((()=>this.encode(e,(e=>this.conn.send(e)))))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout((()=>this.heartbeatTimeout()),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach((e=>e())),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,(e=>{let{topic:t,event:n,payload:r,ref:o,join_ref:i}=e;o&&o===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${t} ${n} ${o&&"("+o+")"||""}`,r);for(let e=0;e<this.channels.length;e++){const a=this.channels[e];a.isMember(t,n,r,i)&&a.trigger(n,r,o,i)}for(let t=0;t<this.stateChangeCallbacks.message.length;t++){let[,n]=this.stateChangeCallbacks.message[t];n(e)}}))}leaveOpenTopic(e){let t=this.channels.find((t=>t.topic===e&&(t.isJoined()||t.isJoining())));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}}(o,{params:Object.assign(Object.assign({},i),{v:C})}),this.socket.connect(),this.channel=this.socket.channel(this.channelTopic,{authorization:`Bearer ${this.accessToken}`,channelName:this.channelName}),this.start(),this.socket.onError((e=>{_e("[SOCKET][ERROR]",e)})),this.socket.onOpen((()=>{_e("[SOCKET]OPEN")})),this.channel.on("system",(e=>{"attach_channel_succeeded"===e.type&&xe(this,ge,"m",Oe).call(this,{connected:!0,ready:!0,currentState:"attach_channel_succeeded"})})),this.socket.onClose((()=>{_e("[SOCKET]CLOSE"),xe(this,ge,"m",Oe).call(this,{connected:!1,ready:!1,currentState:"socket_closed"})})),this.channel.onClose((()=>{_e("[CHANNEL]CLOSE"),xe(this,ge,"m",Oe).call(this,{connected:!1,ready:!1,currentState:"channel_closed"})})),this.channel.onError((e=>{_e("[CHANNEL][ERROR]",e),xe(this,ge,"m",Oe).call(this,{connected:!1,ready:!1,currentState:"channel_erred"})})),xe(this,ge,"m",je).call(this,"ack","ui","error","participant","message","service_data","system","info","sync")}))}start(){this.channel.join().receive("ok",(()=>{_e("[CHANNEL][JOIN] OK"),xe(this,ge,"m",Oe).call(this,{connected:!0,ready:!1,currentState:"join_channel_succeeded"})})).receive("error",(e=>{_e("[CHANNEL][JOIN] ERROR",e),xe(this,ge,"m",Oe).call(this,{connected:!1,ready:!1,currentState:"join_channel_erred"}),this.channel.socket.disconnect()})).receive("timeout",(()=>{_e("[CHANEL][JOIN] Networking issue. Still waiting...")}))}disconnect(){var e,t,n;null===(e=this.channel)||void 0===e||e.leave(),null===(t=this.socket)||void 0===t||t.remove(this.channel),null===(n=this.socket)||void 0===n||n.disconnect(),Se(this,we,[],"f")}onConnection(e){xe(this,we,"f").push(e)}pushToChannel(e,t,n=1e4){this.channel.push(e,t,n)}}we=new WeakMap,ge=new WeakSet,je=function(...e){e.forEach((e=>{this.channel.on(e,(t=>{_e("[RECEIVE]",e,t)}))}))},Oe=function(e){Se(this,we,xe(this,we,"f").filter((t=>!t(e))),"f")};var Ce,Pe,Te,ke,Ae,Ne,Ie,Re,De,Me,Le,Ue,Fe,Be,$e,ze=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},He=function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},Ve=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};const qe=K()("seamly");function We(){if(!Intl||"undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;const e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;const t=e.resolvedOptions().timeZone;return t&&(t.indexOf("/")>-1||"UTC"===t)?t:null}class Ge{constructor({layoutMode:e,namespace:t,config:n,context:r}){var o;Ce.add(this),Pe.set(this,void 0),Te.set(this,void 0),ke.set(this,void 0),Ae.set(this,void 0),this.conversation=new Ee,Le.set(this,(e=>e||this.locale)),this.store=function(e,t){const n=t(e),r=n.get()||{};return{get:e=>void 0===e?r:r[e],set:(e,t)=>(r[e]=t,n.set(r),t),delete(e){const t=this.get(e);return delete r[e],n.set(r),t}}}(`${t}.connection${r.locale?`.${r.locale}`:""}`,n.storageProvider||X),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},He(this,Ae,Object.assign(Object.assign({},n),{sendEnvironment:null===(o=n.sendEnvironment)||void 0===o||o,context:Object.assign(Object.assign({},r),{channelName:r.channelName||"web"})}),"f"),He(this,Pe,!1,"f"),this.connected=!1,this.configReady=!1,He(this,Te,n.externalId,"f"),He(this,ke,e,"f"),this.userResponded=!1,this.URLS={},window.addEventListener("pageshow",(e=>{e.persisted&&this.connected&&this.connect()}))}getConversationUrl(){return this.store.get("conversationUrl")}hasConversation(){return!!this.getConversationUrl()}clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}reset(){return ze(this,void 0,void 0,(function*(){return yield this.disconnect(),this.clearStore(),this.getConfig()}))}disconnect(){var e;return ze(this,void 0,void 0,(function*(){(null===(e=this.conversation)||void 0===e?void 0:e.disconnect)&&this.conversation.disconnect(),this.connected=!1,this.configReady=!1}))}getConfig(){return N().post(`${Ve(this,Ce,"m",Ue).call(this,"http")}/client/${this.connectionInfo.apiKey}/configs`).set("Content-Type","application/json").query({v:C}).send({context:Object.assign(Object.assign({},Ve(this,Ae,"f").context),{environment:!0===Ve(this,Ae,"f").sendEnvironment?Ve(this,Ce,"m",$e).call(this):Ve(this,Ae,"f").sendEnvironment})}).then((({body:e})=>(Ve(this,Ce,"m",Fe).call(this,e),this.configReady=!0,e.config))).catch((e=>{if(404===e.status)throw new R(e);if(e.status>=500)throw new D(e);throw e}))}getConversation(){return ze(this,void 0,void 0,(function*(){if(!this.hasConversation())return null;try{const{body:e}=yield N().get(`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.URLS.history}`).set("Authorization",`Bearer ${Ve(this,Ce,"m",Ne).call(this)}`).query({v:C});Ve(this,Ce,"m",Fe).call(this,e);const{messages:t,participants:n,activeServiceSessionId:r,activeServiceSettings:o,serviceData:i,ui:a,translation:s}=e.history;return{events:t.map((([e,t])=>({type:e,payload:Object.assign(Object.assign({},t),{type:"participant"===e?e:t.type})}))),participants:n,activeServiceSessionId:r,activeServiceSettings:o,serviceData:i,resumeConversationPrompt:!!a&&Boolean(a.resumeConversationPrompt),translationProposal:a.translationProposal,translation:s}}catch(e){if(401===e.status)throw new L(e);if(404===e.status)throw new M(e);if(e.status>=500)throw new D(e);throw e}}))}connect(){return ze(this,void 0,void 0,(function*(){this.connected=!1;let e={};return this.hasConversation()||(e=yield Ve(this,Ce,"m",Be).call(this)),this.conversation.connect(`${Ve(this,Ce,"m",Ue).call(this,"ws")}${this.URLS.socket}`,Ve(this,Ae,"f").context.channelName,Ve(this,Ce,"m",De).call(this),Ve(this,Ce,"m",Ne).call(this)),this.conversation.onConnection((({connected:e,ready:t})=>{this.connected=e,He(this,Pe,t,"f")})),Ve(this,Ae,"f").sendEnvironment&&this.send("context",{environment:!0===Ve(this,Ae,"f").sendEnvironment?Ve(this,Ce,"m",$e).call(this):Ve(this,Ae,"f").sendEnvironment},!1),e}))}uploadFile(e,t,n,r){const o=new FormData;o.append("upload",e);const i=N().post(`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.URLS.uploads}`).set("Authorization",`Bearer ${Ve(this,Ce,"m",Ne).call(this)}`).send(o);return i.on("progress",(function(e){const{direction:n,percent:r}=e;"upload"===n&&"function"==typeof t&&t(r)})),i.then((e=>{n&&n(e)})).catch((e=>{if(!r)throw e;r(e.response)})),i}getConversationIntitialState(){return N().get(`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.getConversationUrl()}`).set("Authorization",`Bearer ${Ve(this,Ce,"m",Ne).call(this)}`).query({v:C}).then((({body:e})=>{return Ve(this,Ce,"m",Fe).call(this,e),this.userResponded=e.conversation.userResponded,t=e.conversation,n=["accessToken","channelTopic"],Object.keys(t).reduce(((e,r)=>(n.includes(r)||(e[r]=t[r]),e)),{});var t,n})).catch((e=>{if(401===e.status)throw new L(e);if(404===e.status)throw new M(e);if(e.status>=500)throw new D(e);throw e}))}getTranslations(e){return ze(this,void 0,void 0,(function*(){try{if(!this.URLS.translations)throw new R;const t=`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.URLS.translations}`.replace("{version}",String(2)).replace("{locale}",Ve(this,Le,"f").call(this,e)),n=N().get(t),{body:r}=yield n;return r.translations}catch(e){if(e.status>=500)throw new D(e);throw e}}))}send(e,t,n=!0){var r;!this.connected||n&&!Ve(this,Pe,"f")?null===(r=this.conversation)||void 0===r||r.onConnection((({connected:r,ready:o})=>(this.connected=r,He(this,Pe,o,"f"),!!(n?o:r)&&(this.send(e,t,n),!0)))):(qe("[SEND]",e,t),this.conversation.pushToChannel(e,function(e,t){if("message"!==e)return t;const{type:n,body:r}=t;let{transactionId:o}=t;return o||(o=J()),{type:n,body:r,transactionId:o}}(e,t),1e4))}sendContext(e){const{locale:t,variables:n}=e,r={};if(t){if("string"!=typeof t)throw new Error("Locale must be a string");r.locale=t}if(n){if("object"!=typeof n)throw new Error("Variables must be an object");r.variables=n}0===Object.keys(r).length&&r.constructor===Object||this.send("context",r,!1)}}Pe=new WeakMap,Te=new WeakMap,ke=new WeakMap,Ae=new WeakMap,Le=new WeakMap,Ce=new WeakSet,Ne=function(){return this.store.get("accessToken")},Ie=function(e){this.store.set("accessToken",e)},Re=function(e){this.store.set("conversationUrl",e)},De=function(){return this.store.get("channelTopic")||this.store.get("channelName")},Me=function(e){this.store.set("channelTopic",e)},Ue=function(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`},Fe=function({_links:e}){this.URLS=Object.entries(e).filter((([e])=>"self"!==e)).reduce(((e,[t,{href:n}])=>Object.assign(Object.assign({},e),{[t]:n})),this.URLS)},Be=function(){var e;return ze(this,void 0,void 0,(function*(){try{const t=N().post(`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.URLS.conversations}`).set("Content-Type","application/json").query({v:C}).withCredentials().send({externalId:Ve(this,Te,"f")||void 0}),{body:n}=yield t,{conversation:r}=n,o=Object.assign({},r);return delete o.accessToken,delete o.channelTopic,Ve(this,Ce,"m",Ie).call(this,r.accessToken),Ve(this,Ce,"m",Me).call(this,r.channelTopic),Ve(this,Ce,"m",Fe).call(this,n),Ve(this,Ce,"m",Re).call(this,this.URLS.conversation),this.locale=null===(e=r.translation)||void 0===e?void 0:e.locale,this.userResponded=r.userResponded,o}catch(e){if(e.status>=500)throw new D(e);throw e}}))},$e=function(){return{clientName:"@seamly/web-ui",clientVariant:Ve(this,ke,"f"),clientVersion:"21.0.8",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:We(),userAgent:navigator.userAgent,preferredLocale:navigator.language}};var Ke=n(554),Je=n.n(Ke),Xe=n(210),Qe=n(207),Ye=n(688),Ze=n(798),et=n(661);let tt=function(e){e()};const nt=()=>tt,rt=(0,et.createContext)(null);function ot(){return(0,et.useContext)(rt)}let it=()=>{throw new Error("uSES not initialized!")};const at=(e,t)=>e===t;function st(e=rt){const t=e===rt?ot:()=>(0,et.useContext)(e);return function(e,n=at){const{store:r,subscription:o,getServerState:i}=t(),a=it(o.addNestedSub,r.getState,i||r.getState,e,n);return(0,et.useDebugValue)(a),a}}const ct=st();n(679),n(973);const lt={notify(){},get:()=>[]};const ut="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?et.useLayoutEffect:et.useEffect;let pt=null;const dt=function({store:e,context:t,children:n,serverState:r}){const o=(0,et.useMemo)((()=>{const t=function(e,t){let n,r=lt;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){const e=nt();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}const a={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=lt)},getListeners:()=>r};return a}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0}}),[e,r]),i=(0,et.useMemo)((()=>e.getState()),[e]);ut((()=>{const{subscription:t}=o;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),i!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[o,i]);const a=t||rt;return et.default.createElement(a.Provider,{value:o},n)};function ft(e=rt){const t=e===rt?ot:()=>(0,et.useContext)(e);return function(){const{store:e}=t();return e}}const ht=ft();function yt(e=rt){const t=e===rt?ht:ft(e);return function(){return t().dispatch}}const mt=yt();var bt;(e=>{it=e})(Ze.useSyncExternalStoreWithSelector),(e=>{pt=e})(Ye.useSyncExternalStore),bt=et.unstable_batchedUpdates,tt=bt;const vt=(0,Xe.createContext)(null),gt=(0,Xe.createContext)(null);function wt(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function jt(e){return!!e&&!!e[cn]}function Ot(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===ln}(e)||Array.isArray(e)||!!e[sn]||!!(null===(t=e.constructor)||void 0===t?void 0:t[sn])||Pt(e)||Tt(e))}function xt(e,t,n){void 0===n&&(n=!1),0===St(e)?(n?Object.keys:un)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function St(e){var t=e[cn];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Pt(e)?2:Tt(e)?3:0}function _t(e,t){return 2===St(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Et(e,t,n){var r=St(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function Ct(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function Pt(e){return nn&&e instanceof Map}function Tt(e){return rn&&e instanceof Set}function kt(e){return e.o||e.t}function At(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=pn(e);delete t[cn];for(var n=un(t),r=0;r<n.length;r++){var o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Nt(e,t){return void 0===t&&(t=!1),Rt(e)||jt(e)||!Ot(e)||(St(e)>1&&(e.set=e.add=e.clear=e.delete=It),Object.freeze(e),t&&xt(e,(function(e,t){return Nt(t,!0)}),!0)),e}function It(){wt(2)}function Rt(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Dt(e){var t=dn[e];return t||wt(18,e),t}function Mt(){return en}function Lt(e,t){t&&(Dt("Patches"),e.u=[],e.s=[],e.v=t)}function Ut(e){Ft(e),e.p.forEach($t),e.p=null}function Ft(e){e===en&&(en=e.l)}function Bt(e){return en={p:[],l:en,h:e,m:!0,_:0}}function $t(e){var t=e[cn];0===t.i||1===t.i?t.j():t.O=!0}function zt(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||Dt("ES5").S(t,e,r),r?(n[cn].P&&(Ut(t),wt(4)),Ot(e)&&(e=Ht(t,e),t.l||qt(t,e)),t.u&&Dt("Patches").M(n[cn].t,e,t.u,t.s)):e=Ht(t,n,[]),Ut(t),t.u&&t.v(t.u,t.s),e!==an?e:void 0}function Ht(e,t,n){if(Rt(t))return t;var r=t[cn];if(!r)return xt(t,(function(o,i){return Vt(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return qt(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=At(r.k):r.o;xt(3===r.i?new Set(o):o,(function(t,i){return Vt(e,r,o,t,i,n)})),qt(e,o,!1),n&&e.u&&Dt("Patches").R(r,n,e.u,e.s)}return r.o}function Vt(e,t,n,r,o,i){if(jt(o)){var a=Ht(e,o,i&&t&&3!==t.i&&!_t(t.D,r)?i.concat(r):void 0);if(Et(n,r,a),!jt(a))return;e.m=!1}if(Ot(o)&&!Rt(o)){if(!e.h.F&&e._<1)return;Ht(e,o),t&&t.A.l||qt(e,o)}}function qt(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&Nt(t,n)}function Wt(e,t){var n=e[cn];return(n?kt(n):e)[t]}function Gt(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Kt(e){e.P||(e.P=!0,e.l&&Kt(e.l))}function Jt(e){e.o||(e.o=At(e.t))}function Xt(e,t,n){var r=Pt(t)?Dt("MapSet").N(t,n):Tt(t)?Dt("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:Mt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=fn;n&&(o=[r],i=hn);var a=Proxy.revocable(o,i),s=a.revoke,c=a.proxy;return r.k=c,r.j=s,c}(t,n):Dt("ES5").J(t,n);return(n?n.A:Mt()).p.push(r),r}function Qt(e){return jt(e)||wt(22,e),function e(t){if(!Ot(t))return t;var n,r=t[cn],o=St(t);if(r){if(!r.P&&(r.i<4||!Dt("ES5").K(r)))return r.t;r.I=!0,n=Yt(t,o),r.I=!1}else n=Yt(t,o);return xt(n,(function(t,o){r&&function(e,t){return 2===St(e)?e.get(t):e[t]}(r.t,t)===o||Et(n,t,e(o))})),3===o?new Set(n):n}(e)}function Yt(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return At(e)}var Zt,en,tn="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),nn="undefined"!=typeof Map,rn="undefined"!=typeof Set,on="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,an=tn?Symbol.for("immer-nothing"):((Zt={})["immer-nothing"]=!0,Zt),sn=tn?Symbol.for("immer-draftable"):"__$immer_draftable",cn=tn?Symbol.for("immer-state"):"__$immer_state",ln=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),un="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,pn=Object.getOwnPropertyDescriptors||function(e){var t={};return un(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},dn={},fn={get:function(e,t){if(t===cn)return e;var n=kt(e);if(!_t(n,t))return function(e,t,n){var r,o=Gt(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!Ot(r)?r:r===Wt(e.t,t)?(Jt(e),e.o[t]=Xt(e.A.h,r,e)):r},has:function(e,t){return t in kt(e)},ownKeys:function(e){return Reflect.ownKeys(kt(e))},set:function(e,t,n){var r=Gt(kt(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=Wt(kt(e),t),i=null==o?void 0:o[cn];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(Ct(n,o)&&(void 0!==n||_t(e.t,t)))return!0;Jt(e),Kt(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==Wt(e.t,t)||t in e.t?(e.D[t]=!1,Jt(e),Kt(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=kt(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){wt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){wt(12)}},hn={};xt(fn,(function(e,t){hn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),hn.deleteProperty=function(e,t){return hn.set.call(this,e,t,void 0)},hn.set=function(e,t,n){return fn.set.call(this,e[0],t,n,e[0])};var yn=function(){function e(e){var t=this;this.g=on,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,a=Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];return i.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(a))}))}}var a;if("function"!=typeof n&&wt(6),void 0!==r&&"function"!=typeof r&&wt(7),Ot(e)){var s=Bt(t),c=Xt(t,e,void 0),l=!0;try{a=n(c),l=!1}finally{l?Ut(s):Ft(s)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return Lt(s,r),zt(e,s)}),(function(e){throw Ut(s),e})):(Lt(s,r),zt(a,s))}if(!e||"object"!=typeof e){if(void 0===(a=n(e))&&(a=e),a===an&&(a=void 0),t.F&&Nt(a,!0),r){var u=[],p=[];Dt("Patches").M(e,a,u,p),r(u,p)}return a}wt(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(o))}))};var r,o,i=t.produce(e,n,(function(e,t){r=e,o=t}));return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return[e,r,o]})):[i,r,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){Ot(e)||wt(8),jt(e)&&(e=Qt(e));var t=Bt(this),n=Xt(this,e,void 0);return n[cn].C=!0,Ft(t),n},t.finishDraft=function(e,t){var n=(e&&e[cn]).A;return Lt(n,t),zt(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!on&&wt(20),this.g=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=Dt("Patches").$;return jt(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),mn=new yn,bn=mn.produce;mn.produceWithPatches.bind(mn),mn.setAutoFreeze.bind(mn),mn.setUseProxies.bind(mn),mn.applyPatches.bind(mn),mn.createDraft.bind(mn),mn.finishDraft.bind(mn);const vn=bn;function gn(e){return gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gn(e)}function wn(e){var t=function(e,t){if("object"!==gn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==gn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===gn(t)?t:String(t)}function jn(e,t,n){return(t=wn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function On(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?On(Object(n),!0).forEach((function(t){jn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):On(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Sn(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var _n="function"==typeof Symbol&&Symbol.observable||"@@observable",En=function(){return Math.random().toString(36).substring(7).split("").join(".")},Cn={INIT:"@@redux/INIT"+En(),REPLACE:"@@redux/REPLACE"+En(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+En()}};function Pn(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Tn(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Sn(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Sn(1));return n(Tn)(e,t)}if("function"!=typeof e)throw new Error(Sn(2));var o=e,i=t,a=[],s=a,c=!1;function l(){s===a&&(s=a.slice())}function u(){if(c)throw new Error(Sn(3));return i}function p(e){if("function"!=typeof e)throw new Error(Sn(4));if(c)throw new Error(Sn(5));var t=!0;return l(),s.push(e),function(){if(t){if(c)throw new Error(Sn(6));t=!1,l();var n=s.indexOf(e);s.splice(n,1),a=null}}}function d(e){if(!Pn(e))throw new Error(Sn(7));if(void 0===e.type)throw new Error(Sn(8));if(c)throw new Error(Sn(9));try{c=!0,i=o(i,e)}finally{c=!1}for(var t=a=s,n=0;n<t.length;n++)(0,t[n])();return e}function f(e){if("function"!=typeof e)throw new Error(Sn(10));o=e,d({type:Cn.REPLACE})}function h(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(Sn(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[_n]=function(){return this},e}return d({type:Cn.INIT}),(r={dispatch:d,subscribe:p,getState:u,replaceReducer:f})[_n]=h,r}function kn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function An(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(Sn(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=kn.apply(void 0,i)(n.dispatch),xn(xn({},n),{},{dispatch:r})}}}function Nn(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var In=Nn();In.withExtraArgument=Nn;const Rn=In;var Dn,Mn=(Dn=function(e,t){return Dn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Dn(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Dn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Ln=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},Un=Object.defineProperty,Fn=Object.defineProperties,Bn=Object.getOwnPropertyDescriptors,$n=Object.getOwnPropertySymbols,zn=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable,Vn=function(e,t,n){return t in e?Un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},qn=function(e,t){for(var n in t||(t={}))zn.call(t,n)&&Vn(e,n,t[n]);if($n)for(var r=0,o=$n(t);r<o.length;r++)n=o[r],Hn.call(t,n)&&Vn(e,n,t[n]);return e},Wn=function(e,t){return Fn(e,Bn(t))},Gn="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?kn:kn.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Kn=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return Mn(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,Ln([void 0],e[0].concat(this)))):new(t.bind.apply(t,Ln([void 0],e.concat(this))))},t}(Array);function Jn(e){return Ot(e)?vn(e,(function(){})):e}function Xn(e){var t,n=function(e){return function(e){void 0===e&&(e={});var t=e.thunk,n=void 0===t||t,r=(e.immutableCheck,e.serializableCheck,new Kn);return n&&(function(e){return"boolean"==typeof e}(n)?r.push(Rn):r.push(Rn.withExtraArgument(n.extraArgument))),r}(e)},r=e||{},o=r.reducer,i=void 0===o?void 0:o,a=r.middleware,s=void 0===a?n():a,c=r.devTools,l=void 0===c||c,u=r.preloadedState,p=void 0===u?void 0:u,d=r.enhancers,f=void 0===d?void 0:d;if("function"==typeof i)t=i;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var i,a=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:Cn.INIT}))throw new Error(Sn(12));if(void 0===n(void 0,{type:Cn.PROBE_UNKNOWN_ACTION()}))throw new Error(Sn(13))}))}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},s=0;s<a.length;s++){var c=a[s],l=n[c],u=e[c],p=l(u,t);if(void 0===p)throw t&&t.type,new Error(Sn(14));o[c]=p,r=r||p!==u}return(r=r||a.length!==Object.keys(e).length)?o:e}}(i)}var h=s;"function"==typeof h&&(h=h(n));var y=An.apply(void 0,h),m=kn;l&&(m=Gn(qn({trace:!1},"object"==typeof l&&l)));var b=[y];return Array.isArray(f)?b=Ln([y],f):"function"==typeof f&&(b=f(b)),Tn(t,p,m.apply(void 0,b))}function Qn(e,t){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(t){var o=t.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return qn(qn({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:n[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(t){return t.type===e},n}function Yn(e){var t,n={},r=[],o={addCase:function(e,t){var r="string"==typeof e?e:e.type;if(r in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[r]=t,o},addMatcher:function(e,t){return r.push({matcher:e,reducer:t}),o},addDefaultCase:function(e){return t=e,o}};return e(o),[n,r,t]}function Zn(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof e.initialState?e.initialState:Jn(e.initialState),o=e.reducers||{},i=Object.keys(o),a={},s={},c={};function l(){var t="function"==typeof e.extraReducers?Yn(e.extraReducers):[e.extraReducers],n=t[0],o=void 0===n?{}:n,i=t[1],a=void 0===i?[]:i,c=t[2],l=void 0===c?void 0:c,u=qn(qn({},o),s);return function(e,t,n,r){void 0===n&&(n=[]);var o,i=Yn(t),a=i[0],s=i[1],c=i[2];if(function(e){return"function"==typeof e}(e))o=function(){return Jn(e())};else{var l=Jn(e);o=function(){return l}}function u(e,t){void 0===e&&(e=o());var n=Ln([a[t.type]],s.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return!!e})).length&&(n=[c]),n.reduce((function(e,n){if(n){var r;if(jt(e))return void 0===(r=n(e,t))?e:r;if(Ot(e))return vn(e,(function(e){return n(e,t)}));if(void 0===(r=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return u.getInitialState=o,u}(r,(function(e){for(var t in u)e.addCase(t,u[t]);for(var n=0,r=a;n<r.length;n++){var o=r[n];e.addMatcher(o.matcher,o.reducer)}l&&e.addDefaultCase(l)}))}return i.forEach((function(e){var n,r,i=o[e],l=function(e,t){return e+"/"+t}(t,e);"reducer"in i?(n=i.reducer,r=i.prepare):n=i,a[e]=n,s[l]=n,c[e]=r?Qn(l,r):Qn(l)})),{name:t,reducer:function(e,t){return n||(n=l()),n(e,t)},actions:c,caseReducers:a,getInitialState:function(){return n||(n=l()),n.getInitialState()}}}var er=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},tr=["name","message","stack","code"],nr=function(e,t){this.payload=e,this.meta=t},rr=function(e,t){this.payload=e,this.meta=t},or=function(e){if("object"==typeof e&&null!==e){for(var t={},n=0,r=tr;n<r.length;n++){var o=r[n];"string"==typeof e[o]&&(t[o]=e[o])}return t}return{message:String(e)}},ir=function(){function e(e,t,n){var r=Qn(e+"/fulfilled",(function(e,t,n,r){return{payload:e,meta:Wn(qn({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),o=Qn(e+"/pending",(function(e,t,n){return{payload:void 0,meta:Wn(qn({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),i=Qn(e+"/rejected",(function(e,t,r,o,i){return{payload:o,error:(n&&n.serializeError||or)(e||"Rejected"),meta:Wn(qn({},i||{}),{arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),a="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(s,c,l){var u,p=(null==n?void 0:n.idGenerator)?n.idGenerator(e):er(),d=new a;function f(e){u=e,d.abort()}var h=function(){return a=this,h=null,y=function(){var a,h,y,m,b,v;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}(this,(function(g){switch(g.label){case 0:return g.trys.push([0,4,,5]),null===(w=m=null==(a=null==n?void 0:n.condition)?void 0:a.call(n,e,{getState:c,extra:l}))||"object"!=typeof w||"function"!=typeof w.then?[3,2]:[4,m];case 1:m=g.sent(),g.label=2;case 2:if(!1===m||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(e,t){return d.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:u||"Aborted"})}))})),s(o(p,e,null==(h=null==n?void 0:n.getPendingMeta)?void 0:h.call(n,{requestId:p,arg:e},{getState:c,extra:l}))),[4,Promise.race([b,Promise.resolve(t(e,{dispatch:s,getState:c,extra:l,requestId:p,signal:d.signal,abort:f,rejectWithValue:function(e,t){return new nr(e,t)},fulfillWithValue:function(e,t){return new rr(e,t)}})).then((function(t){if(t instanceof nr)throw t;return t instanceof rr?r(t.payload,p,e,t.meta):r(t,p,e)}))])];case 3:return y=g.sent(),[3,5];case 4:return v=g.sent(),y=v instanceof nr?i(null,p,e,v.payload,v.meta):i(v,p,e),[3,5];case 5:return n&&!n.dispatchConditionRejection&&i.match(y)&&y.meta.condition||s(y),[2,y]}var w}))},new Promise((function(e,t){var n=function(e){try{o(y.next(e))}catch(e){t(e)}},r=function(e){try{o(y.throw(e))}catch(e){t(e)}},o=function(t){return t.done?e(t.value):Promise.resolve(t.value).then(n,r)};o((y=y.apply(a,h)).next())}));var a,h,y}();return Object.assign(h,{abort:f,requestId:p,arg:e,unwrap:function(){return h.then(ar)}})}}),{pending:o,rejected:i,fulfilled:r,typePrefix:e})}return e.withTypes=function(){return e},e}();function ar(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var sr=function(e,t){return function(e){return e&&"function"==typeof e.match}(e)?e.match(t):e(t)};function cr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.some((function(e){return sr(e,t)}))}}Object.assign;var lr="listenerMiddleware";Qn(lr+"/add"),Qn(lr+"/removeAll"),Qn(lr+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:void 0!==n.g?n.g:globalThis);"undefined"!=typeof window&&window.requestAnimationFrame&&window.requestAnimationFrame,function(){function e(e,t){var n=o[e];return n?n.enumerable=t:o[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[cn];return fn.get(t,e)},set:function(t){var n=this[cn];fn.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][cn];if(!o.P)switch(o.i){case 5:r(o)&&Kt(o);break;case 4:n(o)&&Kt(o)}}}function n(e){for(var t=e.t,n=e.k,r=un(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==cn){var a=t[i];if(void 0===a&&!_t(t,i))return!0;var s=n[i],c=s&&s[cn];if(c?c.t!==a:!Ct(s,a))return!0}}var l=!!t[cn];return r.length!==un(t).length+(l?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return!0;return!1}var o={};!function(e,t){dn[e]||(dn[e]=t)}("ES5",{J:function(t,n){var r=Array.isArray(t),o=function(t,n){if(t){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,e(o,!0));return r}var i=pn(n);delete i[cn];for(var a=un(i),s=0;s<a.length;s++){var c=a[s];i[c]=e(c,t||!!i[c].enumerable)}return Object.create(Object.getPrototypeOf(n),i)}(r,t),i={i:r?5:4,A:n?n.A:Mt(),P:!1,I:!1,D:{},l:n,t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,cn,{value:i,writable:!0}),o},S:function(e,n,o){o?jt(n)&&n[cn].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[cn];if(n){var o=n.t,i=n.k,a=n.D,s=n.i;if(4===s)xt(i,(function(t){t!==cn&&(void 0!==o[t]||_t(o,t)?a[t]||e(i[t]):(a[t]=!0,Kt(n)))})),xt(o,(function(e){void 0!==i[e]||_t(i,e)||(a[e]=!1,Kt(n))}));else if(5===s){if(r(n)&&(Kt(n),a.length=!0),i.length<o.length)for(var c=i.length;c<o.length;c++)a[c]=!1;else for(var l=o.length;l<i.length;l++)a[l]=!0;for(var u=Math.min(i.length,o.length),p=0;p<u;p++)i.hasOwnProperty(p)||(a[p]=!0),void 0===a[p]&&e(i[p])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}})}();class ur extends I{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}var pr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};const dr=ir("initializeConfig",((e,{extra:{api:t,config:n},rejectWithValue:r})=>pr(void 0,void 0,void 0,(function*(){var e;try{const{features:r,defaultLocale:o,preChat:i,agentParticipant:a,userParticipant:s,startChatIcon:c}=yield t.getConfig(),l=(null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.locale)||o,{connectWhenInView:u}=n;return{features:r,defaultLocale:o,preChat:i,agentParticipant:a,userParticipant:s,startChatIcon:c,locale:l,connectWhenInView:u}}catch(e){return r(e)}})))),fr=ir("resetConfig",((e,{extra:{config:t}})=>pr(void 0,void 0,void 0,(function*(){return t}))));const hr=ir("setLocale",((e,{extra:{api:t},rejectWithValue:n})=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){try{return{translations:yield t.getTranslations(e),locale:e}}catch(e){return n(e)}}))),{condition:(e,{getState:t})=>{const{i18n:{isLoading:n,locale:r}}=t();return e!==r&&!n}});var yr="NOT_FOUND",mr=function(e,t){return e===t};function br(e,t){var n,r,o="object"==typeof t?t:{equalityCheck:t},i=o.equalityCheck,a=void 0===i?mr:i,s=o.maxSize,c=void 0===s?1:s,l=o.resultEqualityCheck,u=function(e){return function(t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}}(a),p=1===c?(n=u,{get:function(e){return r&&n(r.key,e)?r.value:yr},put:function(e,t){r={key:e,value:t}},getEntries:function(){return r?[r]:[]},clear:function(){r=void 0}}):function(e,t){var n=[];function r(e){var r=n.findIndex((function(n){return t(e,n.key)}));if(r>-1){var o=n[r];return r>0&&(n.splice(r,1),n.unshift(o)),o.value}return yr}return{get:r,put:function(t,o){r(t)===yr&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(c,u);function d(){var t=p.get(arguments);if(t===yr){if(t=e.apply(null,arguments),l){var n=p.getEntries(),r=n.find((function(e){return l(e.value,t)}));r&&(t=r.value)}p.put(arguments,t)}return t}return d.clearCache=function(){return p.clear()},d}function vr(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return"function"==typeof e?"function "+(e.name||"unnamed")+"()":typeof e})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function gr(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i,a=0,s={memoizeOptions:void 0},c=r.pop();if("object"==typeof c&&(s=c,c=r.pop()),"function"!=typeof c)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof c+"]");var l=s,u=l.memoizeOptions,p=void 0===u?n:u,d=Array.isArray(p)?p:[p],f=vr(r),h=e.apply(void 0,[function(){return a++,c.apply(null,arguments)}].concat(d)),y=e((function(){for(var e=[],t=f.length,n=0;n<t;n++)e.push(f[n].apply(null,arguments));return i=h.apply(null,e)}));return Object.assign(y,{resultFunc:c,memoizedResultFunc:h,dependencies:f,lastResult:function(){return i},recomputations:function(){return a},resetRecomputations:function(){return a=0}}),y};return o}var wr=gr(br);const jr=wr((({app:e})=>e),(({userHasResponded:e})=>e)),Or=wr((({config:e})=>e),(e=>{let t=Object.assign({visible:"inline"===(null==e?void 0:e.layoutMode)?S.open:S.minimized,appContainerClassNames:e.appContainerClassNames||[]},e);return"function"==typeof t.appContainerClassNames&&(t=Object.assign(Object.assign({},t),{appContainerClassNames:t.appContainerClassNames(t)})),t})),xr=()=>ct(Or),Sr=({state:e})=>e,_r=()=>ct(Sr),Er=wr(Sr,Or,jr,(({events:e,serviceData:t},n,r)=>{var o;if(r||"inline"===n.layoutMode||!(null==t?void 0:t.suggestion)||!(null===(o=null==t?void 0:t.suggestion)||void 0===o?void 0:o.body.length))return e;const i={type:"service_data",payload:t.suggestion};return[...e,i]})),Cr=wr(Er,Or,((e,t)=>{var n,r;const{enabled:o,threshold:i}=null!==(r=null===(n=null==t?void 0:t.messages)||void 0===n?void 0:n.timeIndicator)&&void 0!==r?r:{};if(!o)return e;const a=[];let s=null;return e.forEach(((e,t)=>{if(0===t)a.push(Object.assign(Object.assign({},e),{timeIndicator:e.payload.occurredAt}));else{const t=s&&F(e.payload.occurredAt-s.payload.occurredAt)>=i?e.payload.occurredAt:void 0;a.push(Object.assign(Object.assign({},e),{timeIndicator:t}))}s=e})),a})),Pr=()=>ct(Cr),Tr=(wr(Cr,(e=>e.map((e=>e.payload.id)))),()=>_r().isLoading),kr=()=>_r().unreadEvents,Ar=()=>_r().skiplinkTargetId,Nr=wr(Cr,(e=>{var t;const n=e.filter((e=>"message"===e.type));return null===(t=n[n.length-1])||void 0===t?void 0:t.payload.id})),Ir=()=>{const{participants:e,currentAgent:t}=_r().participantInfo;return t?e[t]:null},Rr=()=>{const{layoutMode:e}=xr();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},Dr=wr((({visibility:e})=>e),(e=>e.visibility)),Mr=wr((({visibility:e})=>e),(e=>e.showInlineView));const Lr=[S.open,S.minimized,S.hidden],Ur=ir("setVisibility",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),i=Dr(o),a=jr(o),s=n.hasConversation(),c=Or(o),{visibilityCallback:l=_,layoutMode:u}=c,{unreadEvents:p}=Sr(o),d=l({hasResponded:a,previousVisibility:i,requestedVisibility:e,config:c});if(Lr.includes(d)){if(i!==d)return n.store.set(x,Object.assign(Object.assign({},n.store.get(x)||{}),{[u]:e})),e&&r.emit("ui.visible",e,{visibility:e,hasConversation:s,hasResponded:a,unreadMessageCount:p}),d}else console.error('The visibilityCallback function should return "open", "minimized" or "hidden".')})),Fr=ir("initialize",((e,{dispatch:t,getState:n,extra:{api:r}})=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){var e;const{layoutMode:o}=Or(n()),i=(null===(e=r.store.get(x))||void 0===e?void 0:e[o])||S.initialize;return t(Ur(i)),i}))));var Br=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};const $r=ir("initializeApp",((e,{extra:{api:t,config:n},rejectWithValue:r})=>Br(void 0,void 0,void 0,(function*(){var e,o,i,a;let s=null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.locale;try{if(t.hasConversation()){const e=yield t.getConversationIntitialState();return s=(null===(o=e.translation)||void 0===o?void 0:o.locale)||s,{initialState:e,locale:s,config:n}}return(null===(i=null==n?void 0:n.context)||void 0===i?void 0:i.topic)&&t.send("action",{type:f,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),(null===(a=null==n?void 0:n.context)||void 0===a?void 0:a.translationLocale)&&(s=n.context.translationLocale,t.send("action",{type:h,body:{enabled:!0,locale:s}},!1)),{initialState:void 0,locale:s,config:n}}catch(e){if(e instanceof M){const e=new M;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new ur;return r({name:t.name,message:t.message,langKey:t.langKey})}})))),zr=ir("resetApp",((e,{dispatch:t,extra:{api:n}})=>Br(void 0,void 0,void 0,(function*(){yield n.disconnect(),yield n.clearStore(),t(fr()),yield t(dr());try{const{locale:e}=yield t($r()).unwrap();yield t(hr(e))}catch(e){}t(Fr())})))),Hr=()=>ct(jr),Vr={userHasResponded:!1},qr=Zn({name:"app",initialState:Vr,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(zr.pending,(()=>Vr)).addCase($r.fulfilled,((e,{payload:t})=>{var n;t.initialState&&"userResponded"in t.initialState&&(e.userHasResponded=null===(n=t.initialState)||void 0===n?void 0:n.userResponded)}))}}),{setHasResponded:Wr}=qr.actions,Gr=qr.reducer,Kr={error:void 0},Jr=Zn({name:"interrupt",initialState:Kr,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>Kr},extraReducers:e=>{e.addCase(zr.fulfilled,(()=>Kr)).addMatcher(cr($r.rejected,dr.rejected,hr.rejected,Ur.rejected,Fr.rejected),((e,{payload:t})=>{e.error=t}))}}),{setInterrupt:Xr,clearInterrupt:Qr}=Jr.actions,Yr=Jr.reducer,Zr=({type:n,payload:r})=>n===e.message&&!r.fromClient||n===e.info&&r.type===t,eo=e=>e.sort((({payload:{occurredAt:e}},{payload:{occurredAt:t}})=>e-t)),to=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:o,name:i,introduction:a}=t.participant,s=n[r],c=Object.assign(Object.assign({},n),{[r]:s?Object.assign(Object.assign(Object.assign(Object.assign({},s),o?{avatar:o}:{}),i?{name:i}:{}),a?{introduction:a}:{}):t.participant});return Object.assign(Object.assign({},e),{participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r})},no=(e,t)=>{const n="message"===(null==t?void 0:t.type)?null==t?void 0:t.payload.entry:{},{blockAutoEntrySwitch:r}=e;if(!n)return Object.assign(Object.assign({},e),{optionsOverride:{}});const{type:o,options:i}=n;let a=e.active;return r||o===e.userSelected||(a=o),Object.assign(Object.assign({},e),{active:a,optionsOverride:Object.assign(Object.assign({},e.optionsOverride),{[o]:i||{}})})},ro={events:[],isLastEventFromClient:!1,initialState:{userResponded:!1},unreadEvents:0,userHasResponded:!1,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1,remaining:void 0,wasStopped:void 0,count:void 0,timer:void 0},resumeConversationPrompt:!1,serviceInfo:{activeServiceSessionId:""},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:null,subTitle:""},historyLoaded:!1,skiplinkTargetId:J(),optionsButtonId:J(),headerCollapseButtonId:J(),serviceData:{},options:{features:{},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],entryMeta:{default:o,active:o,userSelected:null,blockAutoEntrySwitch:!1,options:{},optionsOverride:{}},seamlyContainerElement:null},oo=Zn({name:"store",initialState:ro,reducers:{addEvent:(t,n)=>{var r,o;const{type:c,payload:l}=n.payload,u=t.options.features.hasOwnProperty(j);let p=Object.assign({},t.options);if(u&&(c===e.message||c===e.participant)&&!l.fromClient){const e="message"===c?null===(r=l.entry)||void 0===r?void 0:r.type:{};p=Object.assign(Object.assign({},p),{features:Object.assign(Object.assign({},p.features),{uploads:Object.assign(Object.assign({},null===(o=p.features)||void 0===o?void 0:o.uploads),{enabledFromEntry:e===i})})})}const d=Zr(n.payload);if(t.events.find((e=>e.payload.id===l.id)))return;const f=no(t.entryMeta,n.payload);t.entryMeta=u||f.active!==i?f:Object.assign({},t.entryMeta),t.options=p,d&&(t.unreadEvents+=1,"service_data"!==c&&(n.payload.payload.messageStatus=l.fromClient?s:a)),n.payload.payload.key=J(),t.events.push(n.payload),t.isLastEventFromClient=l.fromClient},ackEvent:(e,{payload:{payload:t}})=>{if(!t.transactionId)return void console.warn("ACK received without transaction ID.");const n=e.events.find((e=>e.payload.transactionId===t.transactionId&&(!t.type||e.type===t.type))),{id:r,occurredAt:o}=t;n&&(n.payload.id=r,n.payload.occurredAt=o,e.events=eo(e.events))},clearEvents:e=>{e.unreadEvents=0,e.loadedImageEventIds=[],e.events=[]},setEventsRead:(e,{payload:t})=>{e.unreadEvents=0,e.events.forEach((e=>(-1!==t.indexOf(e.payload.id)&&(e.payload=Object.assign(Object.assign({},e.payload),"service_data"!==e.type&&e.payload.messageStatus===a&&{messageStatus:s})),e)))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setHistory:(e,{payload:{events:n,participants:r,activeServiceSessionId:o,activeServiceSettings:s={},serviceData:c,resumeConversationPrompt:l}})=>{var u,p;const d=((e,t)=>{const n=e.filter((e=>!t.some((t=>t.payload.id===e.payload.id)))),r=t.filter((e=>!("participant"===e.type&&!e.payload.participant.introduction))).reverse();return eo([...r,...n])})(e.events,n),f=Object.assign(Object.assign({},e.participantInfo.participants),r),h=d.slice().reverse().find((e=>("message"===e.type||"participant"===e.type)&&!e.payload.fromClient));let y=null;h&&("message"===h.type&&(y=h.payload.participant),"participant"===h.type&&(y=h.payload.participant.id));const{entry:m}=s,b=null===(u=null==m?void 0:m.options)||void 0===u?void 0:u.upload,v=no(Object.assign(Object.assign(Object.assign({},e.entryMeta),m),{active:(null==m?void 0:m.default)||t,options:Object.assign({},(null==m?void 0:m.options)?m.options:{})}),d[d.length-1]);let g=Object.assign({},e.options.features);const w=g.hasOwnProperty(j);if(w&&"message"===(null==h?void 0:h.type)){const{payload:e}=h,t=(null===(p=null==e?void 0:e.entry)||void 0===p?void 0:p.type)||{};g=Object.assign(Object.assign({},g),{uploads:{enabled:!(!b||!(null==b?void 0:b.enabled)),enabledFromEntry:t===i}})}e.unreadEvents=d.filter((e=>"message"===e.type&&e.payload.messageStatus===a)).length,e.events=d.filter((e=>"participant"!==e.type||!!e.payload.participant.introduction)),e.participantInfo=Object.assign(Object.assign(Object.assign({},e.participantInfo),y?to(e.participantInfo,{participant:f[y]}):{}),{participants:f}),e.historyLoaded=!0,e.serviceInfo=Object.assign(Object.assign({},e.serviceInfo),{activeServiceSessionId:o}),e.serviceData=Object.assign(Object.assign({},e.serviceData),c),e.options=Object.assign(Object.assign({},e.options),{features:g||{}}),e.entryMeta=w||v.active!==i?v:Object.assign({},e.entryMeta),e.resumeConversationPrompt=l||!1,y&&(e.headerTitles.subTitle=f[y].name)},resetHistoryLoadedFlag:e=>{e.historyLoaded=!1},setIsLoading:(e,{payload:t})=>{e.isLoading=t},initIdleDetachCountdown:(e,{payload:t})=>{const{delaySeconds:n,delayTime:r}=t;e.idleDetachCountdown={hasCountdown:!0,isActive:!0,wasStopped:!1,count:n,remaining:n,timer:r}},decrementIdleDetachCountdownCounter:e=>{const{idleDetachCountdown:t}=e,{remaining:n}=t,r=n-1;e.idleDetachCountdown.remaining=r,e.idleDetachCountdown.timer=B(r)},stopIdleDetachCountdownCounter:e=>{e.idleDetachCountdown.isActive=!1,e.idleDetachCountdown.wasStopped=!0},clearIdleDetachCountdown:e=>{e.idleDetachCountdown.hasCountdown=!1,e.idleDetachCountdown.isActive=!1},initResumeConversationPrompt:e=>{e.resumeConversationPrompt=!0},clearResumeConversationPrompt:e=>{e.resumeConversationPrompt=!1},setParticipant:(e,{payload:t})=>{e.participantInfo=to(e.participantInfo,{participant:t.participant,fromClient:t.fromClient})},setActiveService:(e,{payload:t})=>{e.serviceInfo.activeServiceSessionId!==t&&(e.serviceInfo.activeServiceSessionId=t)},setHeaderTitle:(e,{payload:t})=>{e.headerTitles.title=t},setHeaderSubTitle:(e,{payload:t})=>{e.headerTitles.subTitle=t},setInitialState:(e,{payload:t})=>{e.initialState=t.initialState,e.unreadEvents=ro.unreadEvents},setServiceDataItem:(e,{payload:t})=>{e.serviceData[t.type]=t},setFeatures:(e,{payload:t})=>{t.features&&(e.options.features=t.features)},setFeatureEnabledState:(e,{payload:t})=>{e.options.features.hasOwnProperty(t.key)&&(e.options.features[t.key].enabled=t.enabled)},clearFeatures:e=>{e.options.features={}},showOption:(e,{payload:t})=>{e.options.panelActive=!0,e.options.optionActive=t},hideOption:e=>{e.options.panelActive=!1,e.options.optionActive=""},setUserSelectedOptions:(e,{payload:t})=>{e.options.userSelectedOptions=t},setUserSelectedOption:(e,{payload:t})=>{const{option:n,value:r}=t;e.options.userSelectedOptions[n]=r},setBlockAutoEntrySwitch:(e,{payload:t})=>{e.entryMeta.blockAutoEntrySwitch=t},setServiceEntryMetadata:(e,{payload:t})=>{e.entryMeta.active=t.default,e.entryMeta.options=t.options||{},e.entryMeta.optionsOverride={}},setActiveEntryType:(e,{payload:t})=>{e.entryMeta.active=t},setUserEntryType:(e,{payload:t})=>{e.entryMeta.userSelected=t},registerUpload:(e,{payload:t})=>{e.currentUploads.push({id:t.fileId,name:t.fileName,progress:1,uploading:!0,complete:!1,error:"",uploadHandle:t.uploadHandle})},setUploadProgress:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?Object.assign(Object.assign({},e),{progress:t.progress,uploading:100!==t.progress,uploadHandle:100===t.progress?null:e.uploadHandle}):e))},setUploadError:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?Object.assign(Object.assign({},e),{error:t.errorText,progress:0,uploading:!1,uploadHandle:null}):e))},setUploadComplete:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t?Object.assign(Object.assign({},e),{complete:!0}):e))},clearAllUploads:e=>{e.currentUploads=[]},setSeamlyContainerElement:(e,{payload:t})=>{e.seamlyContainerElement=t}},extraReducers:e=>{e.addCase(zr.pending,(()=>ro)).addCase(dr.fulfilled,((e,{payload:t})=>{var n;e.headerTitles.subTitle=null===(n=t.agentParticipant)||void 0===n?void 0:n.name,t.features&&(e.options.features=t.features)})).addCase($r.fulfilled,((e,{payload:t})=>{t.initialState&&(e.initialState=t.initialState)})).addMatcher(cr(yo,mo),(e=>{e.isLastEventFromClient=!1}))}}),{ackEvent:io,addEvent:ao,clearAllUploads:so,clearEvents:co,clearFeatures:lo,clearIdleDetachCountdown:uo,clearResumeConversationPrompt:po,decrementIdleDetachCountdownCounter:fo,hideOption:ho,initIdleDetachCountdown:yo,initResumeConversationPrompt:mo,registerUpload:bo,resetHistoryLoadedFlag:vo,setActiveEntryType:go,setActiveService:wo,setBlockAutoEntrySwitch:jo,setEventsRead:Oo,setFeatureEnabledState:xo,setFeatures:So,setHeaderSubTitle:_o,setHeaderTitle:Eo,setHistory:Co,setInitialState:Po,setIsLoading:To,setLoadedImageEventIds:ko,setParticipant:Ao,setSeamlyContainerElement:No,setServiceDataItem:Io,setServiceEntryMetadata:Ro,setUploadComplete:Do,setUploadError:Mo,setUploadProgress:Lo,setUserEntryType:Uo,setUserSelectedOption:Fo,setUserSelectedOptions:Bo,showOption:$o,stopIdleDetachCountdownCounter:zo}=oo.actions,Ho=oo.reducer;const Vo=Object.assign(Object.assign({},{namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}}}),{api:{domain:"",key:"",secure:!0},hideOnNoUserResponse:!1,connectWhenInView:!0,showDisclaimer:!1,showFaq:!1,showSuggestions:!0,customComponents:{},defaults:{visible:null},preChatEvents:[]}),qo=["hideOnNoUserResponse","connectWhenInView","showDisclaimer","showFaq","showSuggestions","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon"],Wo=(e,t)=>{const n=(i=t,qo.reduce(((e,t)=>(t in i&&(e[t]=i[t]),e)),{})),{messages:r}=n,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(n,["messages"]);var i;let a=e;return Object.keys(o).length>0&&(a=Object.assign(Object.assign({},a),o)),r&&(a=Object.assign(Object.assign({},a),{messages:Object.assign(Object.assign({},a.messages),r)})),a},Go=Zn({name:"config",initialState:Vo,reducers:{setConfig:(e,{payload:t})=>Wo(e,t),updateConfig:(e,{payload:t})=>Wo(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(fr.fulfilled,(e=>e)).addCase(dr.fulfilled,((e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:o}})=>{e.preChatEvents=t.map((e=>({type:"message",payload:e}))),e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=o}))}}),{setConfig:Ko,updateConfig:Jo,setPreChatEvents:Xo}=Go.actions,Qo=Go.reducer;class Yo extends I{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const Zo={SeamlyGeneralError:D,SeamlyConfigurationError:R,SeamlySessionExpiredError:M,SeamlyOfflineError:Yo,SeamlyUnauthorizedError:L,SeamlyUnavailableError:ur},ei=Qn("catch-error",(e=>({payload:e})));function ti({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:o,api:i,layoutMode:a}=Or(t()),{error:s,type:c}=n,l=Zo[null==s?void 0:s.name]?new Zo[s.name](s):new I(s);null==r||r(l,{namespace:o,api:i,layoutMode:a,conversationUrl:e.getConversationUrl(),action:c?n:void 0})};return e=>t=>{var r,o,i,a,s,c;try{return(null===(o=null===(r=t.payload)||void 0===r?void 0:r.originalEvent)||void 0===o?void 0:o.payload)?n({error:t.payload,type:null===(s=null===(a=null===(i=t.payload)||void 0===i?void 0:i.originalEvent)||void 0===a?void 0:a.payload)||void 0===s?void 0:s.type}):(null===(c=t.payload)||void 0===c?void 0:c.originalError)&&n({error:t.payload,type:void 0}),e(t)}catch(e){throw n({error:e}),e}}}}const ni={controls:{}},ri={value:"",touched:!1},oi={controls:ri},ii=Zn({name:"forms",initialState:oi,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{var r;const o=t&&null!==(r=e[n])&&void 0!==r?r:Object.assign(Object.assign({},ni),{persistData:t});e[n]=o},deregisterForm:(e,{payload:{formId:t}})=>{var n;return(null===(n=e[t])||void 0===n?void 0:n.persistData)||delete e[t],e},registerControl:(e,{payload:{name:t,formId:n}})=>{e[n].controls={[t]:ri}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const o=Object.assign({},r.controls);return delete o[t],Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},r),{controls:o})})},updateControlValue:(e,{payload:{formId:t,name:n,value:r}})=>{var o;(null===(o=e[t])||void 0===o?void 0:o.controls)&&(e[t].controls[n].value=r)},updateControlTouched:(e,{payload:{formId:t,name:n,touched:r}})=>{var o;(null===(o=e[t])||void 0===o?void 0:o.controls[n])&&(e[t].controls[n].touched=r)}},extraReducers:e=>{e.addCase(zr.pending,(()=>oi))}}),{registerForm:ai,deregisterForm:si,registerControl:ci,deregisterControl:li,updateControlValue:ui,updateControlTouched:pi}=ii.actions,di=ii.reducer,fi=Zn({name:"app",initialState:{translations:{"errors.configError.message":"We are sorry this happened, please retry at a later time.","errors.configError.srText":"A chat configuration error occurred. Our apologies, please retry at a later time.","errors.configError.title":"Chat configuration error.","errors.general.buttonText":"Restart chat","errors.general.message":"Do you want to start a new chat session?","errors.general.srText":"Something went wrong with the chat session. You can restart the chat.","errors.general.title":"Something went wrong","errors.seamlyOffline.message":"There might be a problem with your or our network connection. The chat session should resume as soon the connection is available again.","errors.seamlyOffline.srText":"The chat has connection issues. There might be a problem with your or our network connection. The chat session should resume as soon as the connection is available again.","errors.seamlyOffline.title":"Connection issues","errors.seamlyUnavailable.buttonText":"Try again","errors.seamlyUnavailable.message":"The server could not be reached. Try again in a little while.","errors.seamlyUnavailable.srText":"The chat server could not be reached. Try again in a little while.","errors.seamlyUnavailable.title":"Server unavailable"},isLoading:!1,initialLocale:void 0,locale:void 0},reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(dr.fulfilled,((e,{payload:t})=>{e.initialLocale=t.locale})).addCase(hr.pending,(e=>{e.isLoading=!0})).addCase(hr.rejected,(e=>{e.isLoading=!1})).addCase(hr.fulfilled,((e,{payload:t})=>{e.isLoading=!1,(null==t?void 0:t.translations)&&(e.locale=t.locale,e.translations=Object.keys(t.translations).sort().reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t.translations[n]})),{}))}))}}),{setInitialLocale:hi,setTranslations:yi}=fi.actions,mi=fi.reducer,bi=["SeamlyGeneralError","SeamlyConfigurationError","SeamlySessionExpiredError","SeamlyOfflineError","SeamlyUnauthorizedError","SeamlyUnavailableError"];function vi({api:e}){return()=>t=>n=>{const{payload:r,type:o}=n;if(o===Xr.type){if(!bi.includes(r.name))throw new D(r);"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}function gi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gi(Object(n),!0).forEach((function(t){ji(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ji(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oi({api:e}){return()=>t=>n=>{const r=t(n);switch(n.type){case Bo.toString():e.store.set("options",n.payload);break;case Fo.toString():e.store.set("options",wi(wi({},e.store.get("options")||{}),{},{[n.payload.option]:n.payload.value}))}return r}}const xi=wr((({i18n:e})=>e),(({translations:e})=>e)),Si=wr((({i18n:e})=>e),(({initialLocale:e})=>e)),_i=wr((({i18n:e})=>e),(({locale:e})=>e)),Ei=wr((({i18n:e})=>e),(({isLoading:e})=>e)),Ci={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:er(),translatedEventGroups:{},translationProposal:null},Pi=(e,t)=>{const n=[...e].reduce(((e,{payload:n},r,o)=>{var i;if(e[t]){if("divider"===(null==n?void 0:n.type)&&(null===(i=null==n?void 0:n.body)||void 0===i?void 0:i.translationEnabled))return o.splice(0),e;e[t].push(n.id)}return n.id===t&&(e[t]=[]),e}),{}),[[r,o]]=Object.entries(n);return{lastGroupId:e.filter((e=>{var t;return"divider"===(null===(t=e.payload)||void 0===t?void 0:t.type)})).map((e=>e.payload.id)).at(-1),groupId:r,eventIds:o}},Ti=Zn({name:"translation",initialState:Ci,reducers:{enableTranslation:(e,{payload:t})=>{e.isActive=!0,e.currentLocale=t},disableTranslation:e=>{e.isActive=!1,e.currentLocale=void 0},enableEventsTranslation:(e,{payload:{events:t,id:n}})=>{delete e.translatedEventGroups[n];const{lastGroupId:r}=Pi(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:o,eventIds:i}=Pi(t,n);e.lastGroupId=r,e.translatedEventGroups[o]=i},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(dr.fulfilled,((e,{payload:t})=>{var n;const r=null===(n=null==t?void 0:t.features)||void 0===n?void 0:n.translation;r&&(e.isAvailable=!0===r.enabled,e.languages=r.languages)})).addCase(Co,((e,{payload:t})=>{e.translationProposal=t.translationProposal})).addCase(ao,((e,{payload:t})=>{e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)}))}}),{enableTranslation:ki,disableTranslation:Ai,enableEventsTranslation:Ni,disableEventsTranslation:Ii,setTranslationProposalPrompt:Ri,disableTranslationProposalPrompt:Di}=Ti.actions,Mi=Ti.reducer;function Li({dispatch:e,getState:t}){return n=>r=>{const o=n(r),{payload:i}=r;switch(r.type){case Co.type:i?.translation?.enabled&&(e(ki(i.translation.locale)),e(hr(i.translation.locale)));break;case dr.fulfilled.type:i.locale&&e(hr(i.locale));break;case Po.type:i?.translation?.enabled&&(e(ki(i.translation.locale)),e(hr(i.locale)));break;case ao.type:"info"===i.type&&"new_translation"===i?.payload?.body?.subtype&&i.payload.body.translationEnabled&&e(hr(i.payload.body.translationLocale));break;case Ai.type:const n=Si(t());e(hr(n))}return o}}const Ui=Zn({name:"visibility",initialState:{visibility:S.initialize,showInlineView:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(Ur.fulfilled,((e,{payload:t})=>{t&&(e.visibility=t)})).addCase(dr.fulfilled,((e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)}))}}),{setShowInlineView:Fi}=Ui.actions,Bi=Ui.reducer,$i=mt,zi=()=>{const e=$i(),t=ct(Dr),n=!!t&&t!==S.hidden,r=t===S.open,o=t===S.minimized,i=(0,Qe.useCallback)((t=>e(Ur(t))),[e]);return{isVisible:n,isOpen:r,isMinimized:o,visible:t,setVisibility:i,openChat:()=>{i(S.open)},closeChat:()=>{i(S.minimized)}}},Hi=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,Xe.createRef)()})=>{const[r,o]=(0,Qe.useState)(null),i=!!(null==r?void 0:r.isIntersecting)||!t,a=i&&e,s=([e])=>o(e);return(0,Qe.useEffect)((()=>{const e=null==n?void 0:n.current;if(!window.IntersectionObserver||a||!e||!t)return()=>{};const r=new IntersectionObserver(s,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()}),[n,t,a]),{isVisible:i,containerRef:n}},Vi=()=>(0,Qe.useContext)(vt),qi=()=>Vi().store||{},Wi=()=>{const e=Vi();return(0,Qe.useCallback)((()=>e.hasConversation()),[e])};function Gi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ki(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gi(Object(n),!0).forEach((function(t){Ji(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ji(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xi=()=>{const e=Vi(),t=xr(),n=mt(),r=(0,Qe.useContext)(gt),o=Hr(),i=Wi(),{visible:a,setVisibility:s}=zi(),c=kr(),p=(0,Qe.useCallback)(((...e)=>{r.emit(...e)}),[r]),d=(0,Qe.useCallback)((()=>{e.sendContext(t.context||{}),p("ui.beforeStart",{visibility:a,hasConversation:i(),hasResponded:o,unreadMessageCount:c}),e.send("start"),p("ui.start",{visibility:a,hasConversation:i(),hasResponded:o,unreadMessageCount:c})}),[e,t.context,p,i,o,c,a]),f=(0,Qe.useCallback)((async()=>{n(zr())}),[n]),h=(0,Qe.useCallback)((e=>({type:e,id:J(),transactionId:J(),participant:P,fromClient:!0,occurredAt:1e3*Date.now(),meta:{}})),[]),y=(0,Qe.useCallback)((e=>Ki(Ki({},h("text")),{},{body:{text:e}})),[h]),m=(0,Qe.useCallback)((({body:t,config:r={}})=>{if(""===t.trim())return;const o=Ki(Ki({},y(t)),r);e.send("message",o),p("message",o),n(ao({type:"message",payload:Ki(Ki({},o),{},{optimisticallyInjected:!0})}))}),[e,n,p,y]),b=(0,Qe.useCallback)(((e,t=J())=>{n(ao({type:"message",payload:Ki(Ki({},y(e)),{},{transactionId:t})}))}),[n,y]),v=(0,Qe.useCallback)(((e,t,r,o,i,a,s)=>{n(ao({type:"message",payload:{type:"upload",id:e,transactionId:t,participant:P,fromClient:!0,occurredAt:r,meta:{},body:{contentType:o,filename:i,filesize:a,url:s}}}))}),[n]),g=(0,Qe.useCallback)(((e,t=J())=>{const r={body:{subtype:e,type:"divider"},fromClient:!1,fromHistory:!0,id:J(),transactionId:t,type:"divider"};n(ao({type:"info",payload:r}))}),[n]),w=(0,Qe.useCallback)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==l&&n!==u&&p(`action.${n}`,t)}),[e,p]),j=(0,Qe.useCallback)((t=>{e.sendContext(t)}),[e]),O=(0,Qe.useCallback)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&(n(Po(e)),e.userResponded&&(n(Wr(e.userResponded)),s(S.open)))})).catch((e=>{n(Xr({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}))),[e,n,s]);return{connect:O,start:d,sendMessage:m,sendAction:w,sendContext:j,reset:f,emitEvent:p,addMessageBubble:b,addUploadBubble:v,addDivider:g,apiConnected:e.connected,apiConfigReady:e.configReady}};function Qi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Yi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Qi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qi(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ea(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wn(r.key),r)}}function ta(e){return e.reduce((function(e,t){return e.concat(Array.isArray(t)?ta(t):t)}),[])}function na(e){var t={};return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=r.length?r.map((function(e){return null===e?"null":void 0===e?"undefined":"function"==typeof e?e.toString():e instanceof Date?e.toISOString():JSON.stringify(e)})).join("|"):"_(no-args)_";if(Object.prototype.hasOwnProperty.call(t,i))return t[i];var a=e.apply(void 0,r);return t[i]=a,a}}function ra(e){for(var t=function(e){return/\s/.test(e)},n=[],r={},o=0,i=null,a=!1,s=0;s<e.length;){if(a&&(t(e[s])||"{"===e[s]))a=!1,i=e.slice(o,s),"{"===e[s]&&s--;else if(!a&&!t(e[s])){var c="{"===e[s];if(i&&c){var l=oa(e,s);if(-1===l)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));r[i]=e.slice(s+1,l),s=l,i=null}else i&&(n.push(i),i=null),a=!0,o=s}s++}return a&&(i=e.slice(o)),i&&n.push(i),{args:n,cases:r}}function oa(e,t){for(var n=0,r=t+1;r<e.length;r++){var o=e.charAt(r);if("}"===o){if(0===n)return r;n--}else"{"===o&&n++}return-1}function ia(e){return aa(e.slice(1,-1),",",3)}function aa(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!e)return r;if(1===n)return r.push(e),r;var o=e.indexOf(t);if(-1===o)return r.push(e),r;var i=e.substring(0,o).trim(),a=e.substring(o+t.length+1).trim();return r.push(i),aa(a,t,n-1,r)}var sa;function ca(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function la(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ca(Object(n),!0).forEach((function(t){jn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ca(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ua=0,pa="other";function da(e,t){for(var n=0,r="",o=0,i={};n<e.length;){if("#"!==e[n]||o)r+=e[n];else{var a="__hashToken".concat(ua++);r+="{".concat(a,", number}"),i[a]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:i}}var fa="other";const ha=new(function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Zi(this,e),jn(this,"format",na((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ta(n.process(e,t)).join("")}))),this.locale=t,this.typeHandlers=r}var t,n;return t=e,n=[{key:"process",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return[];var n=e.indexOf("{");if(-1!==n){var r=oa(e,n);if(-1===r)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));var o=e.substring(n,r+1);if(o){var i=[],a=e.substring(0,n);a&&i.push(a);var s=ia(o),c=Yi(s,3),l=c[0],u=c[1],p=c[2],d=t[l];null==d&&(d="");var f=u&&this.typeHandlers[u];i.push(f?f(d,p,this.locale,t,this.process.bind(this)):d);var h=e.substring(r+1);return h&&i.push(this.process(h,t)),i}}return[e]}}],n&&ea(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}())("en-GB",{plural:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=ra(t),a=i.args,s=i.cases,c=parseInt(e);a.forEach((function(e){e.startsWith("offset:")&&(c-=parseInt(e.slice("offset:".length)))}));var l=[];if("PluralRules"in Intl){void 0!==sa&&sa.resolvedOptions().locale===n||(sa=new Intl.PluralRules(n));var u=sa.select(c);u!==pa&&l.push(u)}1===c&&l.push("one"),l.push("=".concat(c),pa);for(var p=0;p<l.length;p++){var d=l[p];if(d in s){var f=da(s[d],c),h=f.caseBody,y=f.numberValues;return o(h,la(la({},r),y))}}return e},select:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,o=ra(t),i=o.cases;return e in i?r(i[e],n):fa in i?r(i[fa],n):e}});function ya(){const e=ct(xi),t=ct(_i),n=ct(Si),r=ct(Ei),o=(0,Qe.useCallback)(((n,o={})=>{const i=e[n];return i?ha.format(i,o):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),null)}),[e,t,r]);return{t:o,locale:t,initialLocale:n}}const ma=(0,Xe.createContext)(null),ba=()=>{const e=(0,Qe.useContext)(ma);return{sendPolite:(0,Qe.useCallback)((t=>{t&&e({ariaLive:g,messageText:t})}),[e]),sendAssertive:(0,Qe.useCallback)((t=>{t&&e({ariaLive:v,messageText:t})}),[e])}},va=({children:e})=>((()=>{const e=Pr(),{t}=ya(),{isInline:n,isWindow:r,isApp:o}=Rr(),{isOpen:i,isVisible:a}=zi(),s=ct(Mr),c=mt(),l=(0,Qe.useRef)(null),{start:u,connect:p,apiConfigReady:d,apiConnected:f}=Xi(),h=Wi(),y=(0,Qe.useRef)(!1),{sendAssertive:m}=ba();(0,Qe.useEffect)((()=>{a&&setTimeout((()=>{m(t("window.srTexts.onLoad"))}),500)}),[a,m,t]),(0,Qe.useEffect)((()=>{a&&m(t(i?"window.srTexts.onOpen":"window.srTexts.onClose"))}),[i,a,m,t]),(0,Qe.useEffect)((()=>(l.current=setTimeout((()=>{c(To(!0))}),500),()=>{clearTimeout(l.current)})),[c]),(0,Qe.useEffect)((()=>(e.length&&(l.current=setTimeout((()=>{c(To(!1))}),5e3)),()=>{clearTimeout(l.current)})),[e,c]),(0,Qe.useEffect)((()=>{d&&f||(y.current=!1)}),[d,f]);const b=(0,Qe.useCallback)((async()=>{f||(y.current=!0,await p()),(o||i||a&&n)&&u()}),[f,p,o,n,i,a,u]);(0,Qe.useEffect)((()=>{d&&!y.current&&(!r||i||h())&&(!n||a&&s)&&(h()&&i&&(clearTimeout(l.current),c(To(!1))),b())}),[d,b,c,h,n,i,r,a,s])})(),(0,k.jsx)(k.Fragment,{children:e})),ga=(0,Xe.createContext)({}),wa=()=>xr().appContainerClassNames,ja=e=>{const{fromClient:t}=e.payload,n=["message"];return"info"===e.type?n.push("message--source-info"):t?n.push("message--source-user"):n.push("message--source-agent"),n},Oa=(e=0)=>new Promise((t=>{setTimeout(t,e)})),xa=()=>{const{seamlyContainerElement:e}=_r(),t=mt();return[e,(0,Qe.useCallback)((e=>{t(No(e))}),[t])]},Sa=e=>(0,Qe.useCallback)((()=>{var t;t=e,requestAnimationFrame((async()=>{await Oa(180);const e="string"==typeof t?document.getElementById(t):t;q(e)}))}),[e]),_a=()=>{const e=Ar();return Sa(e)},Ea=(0,Xe.createContext)({});function Ca(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ca(Object(n),!0).forEach((function(t){Ta(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ca(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ta(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ka=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=_r(),{allowedMimeTypes:o,maxSize:i}=n.upload||{},{enabled:a,enabledFromEntry:s}=r||{},{allowedMimeTypes:c,maxSize:l}=Pa(Pa(Pa({},t.upload||{allowedMimeTypes:[],maxSize:0}),o?{allowedMimeTypes:o}:{}),i?{maxSize:i}:{});return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:s||a,allowedMimeTypes:c,maxSize:l}},Aa=()=>{const{currentUploads:e}=_r(),t=mt(),n=(0,Qe.useContext)(Ea);return{uploadFile:(0,Qe.useCallback)((e=>{n(e)}),[n]),clearUploads:(0,Qe.useCallback)((()=>{t(so())}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}};function Na(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Na(Object(n),!0).forEach((function(t){Ra(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Na(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ra(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Da=()=>{const{t:e}=ya(),{options:t}=_r(),{panelActive:n,optionActive:r,userSelectedOptions:o,features:i}=t,{extraMenuItem:a,sendTranscript:s}=i,c={extraMenuItem:a,sendTranscript:s},l=t=>"extraMenuItem"===t?"Extra menu item":e(`options.${t}.menuTitle`),u=Object.keys(c).filter((e=>c[e])).map((e=>({name:e,title:l(e),available:c[e].enabled}))),p=a||s,d=mt(),{get:f,set:h}=qi();return{allowOptionSelection:p,userSelectedOptions:o,features:i,menuOptions:u,initUserSelectedOptions:(0,Qe.useCallback)((()=>{const e=f("options")||{};d(Bo(e))}),[f,d]),setUserSelectedOptions:(0,Qe.useCallback)((e=>{d(Bo(e)),h("options",e)}),[h,d]),setUserSelectedOption:(0,Qe.useCallback)(((e,t)=>{const n=f("options")||{};h("options",Ia(Ia({},n),{},{[e]:t})),d(Fo({option:e,value:t}))}),[d,f,h]),showOption:e=>{d($o(e))},hideOption:()=>{d(ho())},panelActive:n,optionActive:r}},Ma=()=>{const{optionsButtonId:e}=_r();return{id:e,focusButton:Sa(e)}},La=(0,Xe.createContext)(null),Ua=()=>(0,Qe.useContext)(La);function Fa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ba(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fa(Object(n),!0).forEach((function(t){$a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $a(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const za=()=>{const e=mt(),{idleDetachCountdown:t}=_r(),{isOpen:n}=zi(),r=(0,Qe.useRef)({});r.current={hasCountdown:t.hasCountdown,isActive:t.isActive,remaining:t.remaining,wasStopped:t.wasStopped,isOpen:n};const{emitEvent:o,sendAction:i}=Xi(),{t:a}=ya(),{sendAssertive:s,sendPolite:c}=ba(),l=(0,Qe.useCallback)((e=>{const{isOpen:t}=r.current;t&&s(e)}),[s]),u=(0,Qe.useCallback)((e=>{const{isOpen:t}=r.current;t&&c(e)}),[c]),d=(0,Qe.useCallback)((t=>{const n=(e=>Math.ceil(e/1e3))(t),r=B(n);e(yo({delaySeconds:n,delayTime:r})),o("idleTimer.start"),l(`${a("idleDetachWarning.countdownTitle")} ${a("idleDetachWarning.countdownText")} ${a("idleDetachWarning.countdownTimer",r)}`)}),[e,o,l,a]),f=(0,Qe.useCallback)(((t,n)=>{const{hasCountdown:s,wasStopped:c}=r.current;s&&(t||(n||i({type:p}),l(a("idleDetachWarning.notifyTransferText"))),c||o("idleTimer.stop"),e(uo()))}),[e,i,o,l,a]),h=(0,Qe.useCallback)((()=>{const{remaining:t}=r.current;if(t<=0)return;const n=t-1;n%10==0&&l(`${a("idleDetachWarning.countdownText")} ${a("idleDetachWarning.countdownTimer",B(n))}`),e(fo())}),[e,l,a]),y=(0,Qe.useCallback)((()=>{const{isActive:t,remaining:n}=r.current;t&&(e(zo()),n&&(o("idleTimer.stop"),u(a("idleDetachWarning.srCountDownStoppedText"))))}),[e,o,u,a]);return Ba(Ba({},t),{},{initCountdown:d,endCountdown:f,decrementCountdown:h,stopCountdown:y})},Ha=()=>{const e=mt(),t=_r().resumeConversationPrompt,{sendAction:n}=Xi(),{t:r}=ya(),{sendAssertive:o}=ba();return{continueChat:()=>{n({type:d,body:{type:"resume_conversation_prompt"}}),e(po())},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:p}),e(po())}}},Va=()=>{const[e]=(0,Qe.useState)((()=>J()));return e},qa=e=>{const t=(0,Qe.useRef)(null);t.current=e;const n="function"==typeof e;return(0,Qe.useMemo)((()=>n?(...e)=>t.current(...e):void 0),[n])};function Wa(){const{sendAction:e}=Xi(),t=mt(),n=(0,Qe.useCallback)(((n,r="translation_choice")=>{e({type:h,body:{enabled:!0,locale:n,source:r}}),t(ki(n)),t(Di())}),[e,t]),r=(0,Qe.useCallback)((()=>{e({type:h,body:{enabled:!1}}),t(Ai())}),[e,t]),{languages:o,isActive:i,isAvailable:a,currentLocale:s}=ct((({translations:e})=>e));return{languages:o,isActive:i,isAvailable:a,currentLocale:s,enableTranslations:n,disableTranslations:r}}function Ga(e){const{translatedBody:t,body:n}=e.payload?"participant"===e.type?{body:null===(r=e.payload)||void 0===r?void 0:r.participant.introduction,translatedBody:null===(i=null===(o=e.payload)||void 0===o?void 0:o.participant)||void 0===i?void 0:i.translatedIntroduction}:{body:e.payload.body,translatedBody:e.payload.translatedBody}:{body:void 0,translatedBody:void 0};var r,o,i;const a=!!t,s=ct((e=>wr((e=>e.translations.translatedEventGroups),(t=>Object.values(t).every((t=>{var n;return!t.includes(null===(n=null==e?void 0:e.payload)||void 0===n?void 0:n.id)})))))(e));return{body:a&&s?null==t?void 0:t.data:n,hasTranslation:a,isTranslated:s&&a,locale:null==t?void 0:t.locale}}function Ka(){const e=ct((({translations:e})=>e.containerId));return{id:e,focusContainer:Sa(e)}}function Ja(e){const{languages:t}=Wa();return(0,Qe.useMemo)((()=>{var n;return null===(n=null==t?void 0:t.find((t=>t.locale===e)))||void 0===n?void 0:n.nativeName}),[e,t])}const Xa=({eventPayload:e})=>{const{t}=ya(),{fromClient:n,participant:r}=e,o=(e=>_r().participantInfo.participants[e])(r)||{},{messages:i}=xr(),a=n?t("participants.user.name"):o&&o.name,{showAvatar:s,showName:c}=i[n?"user":"agent"]||{};if(!s&&!c)return null;const l=[];return s&&a&&o.avatar&&l.push((0,k.jsx)("span",{className:T("message__avatar"),children:(0,k.jsx)("img",{src:o.avatar,className:T("avatar"),alt:""})})),c&&l.push((0,k.jsx)("span",{className:T("message__author-name"),children:a})),l.length>0&&(0,k.jsx)("div",{className:T("message__author"),children:l})},Qa=["showParticipant","event","type","modifiers","children","bodyProps","info"];function Ya(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Za(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ya(Object(n),!0).forEach((function(t){es(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ya(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function es(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ts=function(e){let{showParticipant:t=!0,event:n,type:r,modifiers:o,children:i,bodyProps:a={},info:s}=e,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Qa);const l=ja(n),{hasTranslation:u,isTranslated:p,locale:d}=Ga(n);return r&&l.push(`message--type-${r}`),o&&("string"==typeof o&&(o=o.split(" ").filter((e=>e.length))),o.forEach((e=>{l.push(`message--${e}`)}))),p&&l.push("message--is-translated"),u&&l.push("message--has-translation"),p&&(a=Za(Za({},a),{},{lang:d})),(0,k.jsx)(k.Fragment,{children:(0,k.jsxs)("div",Za(Za({className:T(l)},c),{},{children:[t&&(0,k.jsx)(Xa,{eventPayload:n.payload}),(0,k.jsx)("div",Za(Za({className:T("message__body")},a),{},{children:i})),s&&(0,k.jsx)("div",{"aria-hidden":"true",className:T("message__info"),children:s})]}))})};function ns(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ns(Object(n),!0).forEach((function(t){os(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ns(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function os(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const is=({id:e,action:t,buttonText:n,description:r,hasFocus:o,image:i,title:a,isCarouselItem:s})=>{const c=(0,Qe.useRef)(null),{sendMessage:l,sendAction:u,emitEvent:p}=Xi(),d=Va(),h=(0,Qe.useRef)(),m=t.type===O?"a":"button",b=(0,Qe.useCallback)((()=>p("action.click_card",{type:y,originMessage:e,action:t})),[p,e,t]),v=(0,Qe.useCallback)((()=>{if(b(),"ask"===t.type)l({body:t.ask});else if("topic"===t.type){const{topic:e,fallbackMessage:n}=t;u({type:f,body:{name:e,fallbackMessage:n}})}}),[l,t,u,b]),g=(0,Qe.useMemo)((()=>t.type===O?{href:t.link,rel:"noopener noreferrer",target:t.newTab?"_blank":"_self",onClick:b}:{onClick:v}),[t,v,b]);return(0,Qe.useEffect)((()=>{s&&(o&&h.current?window.requestAnimationFrame((()=>c.current.focus())):c.current.blur()),h.current=!0}),[o,s]),(0,k.jsxs)("div",{className:T("card__wrapper"),id:e,tabIndex:"-1",ref:c,children:[(0,k.jsx)("img",{className:T("card__image"),src:i,alt:""}),(0,k.jsxs)("div",{className:T("card__content"),id:e,children:[a&&(0,k.jsx)("h2",{className:T("card__title"),children:a}),r&&(0,k.jsx)("div",{className:T("card__description"),dangerouslySetInnerHTML:{__html:r}}),(0,k.jsx)(m,rs(rs({tabIndex:s&&!o?"-1":void 0,className:T("button","button--primary"),"aria-describedby":d},g),{},{children:n}))]})]})};function as(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ss(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?as(Object(n),!0).forEach((function(t){cs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):as(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cs(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ls(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function us(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ls(Object(n),!0).forEach((function(t){ps(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ls(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ps(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ds({item:e,items:t,index:n,isActive:r}){const{t:o}=ya();return(0,k.jsx)("div",{className:T("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":o("carousel.slide.label",{index:n+1,total:t.length}),children:(0,k.jsx)(is,us(us({},e),{},{isCarouselItem:!0,hasFocus:r}))})}const fs={send32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M6.714,14.985l17.837-7.906c0.681-0.302,1.414,0.301,1.25,1.027L22.273,23.59\tc-0.13,0.566-0.751,0.865-1.275,0.613l-3.623-1.752l-2.334,2.287c-0.572,0.562-1.538,0.156-1.538-0.645V21.01\tc0-0.217,0.078-0.43,0.222-0.594l7.676-8.841l-10.414,7.472l-4.351-2.445C5.987,16.236,6.033,15.287,6.714,14.985L6.714,14.985z"/></svg>',balloon32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,10.824v10.375c0,1.104-0.896,2-2,2h-4.694l-4.931,3.625v-3.625H10c-1.104,0-2-0.896-2-2V10.824\tc0-1.104,0.896-2,2-2h12C23.104,8.824,24,9.719,24,10.824z"/></svg>',newTopic32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,8.593l2.407,4.573l5.093,0.876l-3.604,3.702l0.74,5.115L16,20.574l-4.634,2.285l0.739-5.115L8.5,14.042\tl5.094-0.876L16,8.593z"/></svg>',newTranslation16:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 16 16"><path fill="#4A48C1" d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M14.1,7.1h-1.4c-0.1-1.5-0.4-2.9-1-4\tC13,4,13.9,5.4,14.1,7.1z M7.1,2.1v5H5C5.2,4.7,6.1,2.9,7.1,2.1z M7.1,8.9v5c-1-0.7-1.9-2.5-2.1-5H7.1z M8.9,13.9v-5H11\tC10.8,11.3,9.9,13.2,8.9,13.9z M8.9,7.1v-5c1,0.7,1.9,2.5,2.1,5H8.9z M4.2,3.1c-0.5,1.1-0.9,2.5-1,4H1.9C2.1,5.4,3,4,4.2,3.1z M1.9,8.9h1.4c0.1,1.5,0.4,2.9,1,4C3,12,2.1,10.5,1.9,8.9z M11.8,12.9c0.5-1.1,0.9-2.5,1-4h1.4C13.9,10.5,13,12,11.8,12.9z"/></svg>',newTranslation32:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,7c-4.9,0-9,4.1-9,9s4.1,9,9,9s9-4.1,9-9S20.9,7,16,7z M22.9,15h-1.6c-0.1-1.7-0.5-3.3-1.1-4.5\tC21.6,11.5,22.6,13.1,22.9,15z M15,9.4V15h-2.3C12.9,12.3,13.9,10.2,15,9.4z M15,17v5.6c-1.1-0.8-2.1-2.9-2.3-5.6H15z M17,22.6V17\th2.3C19.1,19.8,18.1,21.8,17,22.6z M17,15V9.4c1.1,0.8,2.1,2.9,2.3,5.6H17z M11.8,10.4c-0.6,1.3-1,2.8-1.1,4.5H9.1\tC9.4,13.1,10.4,11.5,11.8,10.4z M9.1,17h1.6c0.1,1.7,0.5,3.3,1.1,4.5C10.4,20.5,9.4,18.9,9.1,17z M20.2,21.5c0.6-1.3,1-2.8,1.1-4.5\th1.6C22.6,18.8,21.6,20.5,20.2,21.5z"/></svg>',avatar32:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">\n<path fill="#4A48C1" d="M10,14.8c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S11.1,14.8,10,14.8z M15.9,14.8c1.1,0,2-0.9,2-2s-0.9-2-2-2\n\ts-2,0.9-2,2S14.8,14.8,15.9,14.8z M21.8,10.8c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S22.9,10.8,21.8,10.8z M21.3,18.1H10.7\n\tC11.7,23.9,20.2,23.9,21.3,18.1z"/>\n</svg>\n',chevronDown8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M-0.001,2.876c0-0.247,0.091-0.494,0.273-0.688c0.38-0.401,1.013-0.418,1.414-0.039l1.938,1.834\tc0.199,0.188,0.547,0.188,0.746,0L6.31,2.15c0.401-0.379,1.034-0.362,1.414,0.04c0.379,0.401,0.361,1.034-0.04,1.414L5.745,5.437\tC4.782,6.35,3.213,6.35,2.249,5.436L0.311,3.603C0.103,3.406-0.001,3.142-0.001,2.876z"/></svg>',chevronDown32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M16,20.425c-0.782,0-1.563-0.291-2.159-0.874l-6.541-6.408c-0.395-0.387-0.401-1.02-0.015-1.414\tc0.387-0.394,1.021-0.4,1.414-0.015l6.541,6.408c0.42,0.409,1.102,0.409,1.52-0.001l6.541-6.407c0.396-0.386,1.028-0.38,1.414,0.015\tc0.387,0.395,0.381,1.027-0.014,1.414l-6.541,6.407C17.563,20.133,16.782,20.425,16,20.425z"/></svg>',chevronRight8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M2.875,7.998c-0.247,0-0.494-0.091-0.688-0.273c-0.401-0.38-0.418-1.013-0.039-1.414l1.834-1.938\tc0.188-0.199,0.188-0.547,0-0.746l-1.835-1.94c-0.379-0.401-0.362-1.034,0.04-1.414s1.034-0.361,1.414,0.04l1.834,1.939\tc0.913,0.963,0.913,2.532-0.001,3.496L3.601,7.686C3.405,7.894,3.14,7.998,2.875,7.998z"/></svg>',chevronRight16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M6.5,13c-0.247,0-0.494-0.091-0.687-0.273c-0.401-0.38-0.419-1.013-0.04-1.414L8.22,8.727\tc0.373-0.394,0.373-1.06,0-1.454L5.773,4.687c-0.379-0.401-0.362-1.034,0.04-1.414c0.4-0.378,1.034-0.362,1.414,0.04l2.446,2.586\tc1.096,1.159,1.096,3.043,0,4.203l-2.446,2.586C7.03,12.896,6.765,13,6.5,13z"/></svg>',close8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M7.705,7.729C7.511,7.923,7.255,8.02,7,8.02c-0.257,0-0.514-0.099-0.709-0.295L4,5.423L1.709,7.725\tC1.513,7.921,1.257,8.02,1,8.02c-0.255,0-0.51-0.097-0.706-0.291c-0.391-0.39-0.393-1.022-0.003-1.414l2.298-2.309l-2.27-2.28\tC-0.07,1.334-0.068,0.701,0.323,0.311c0.392-0.389,1.024-0.387,1.415,0.003L4,2.587l2.263-2.274C6.653-0.077,7.287-0.079,7.677,0.31\tC8.068,0.7,8.07,1.333,7.681,1.725l-2.27,2.281l2.298,2.309C8.099,6.705,8.097,7.339,7.705,7.729z"/></svg>',close16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M12.709,11.295L9.411,7.982l3.262-3.276c0.39-0.392,0.388-1.024-0.004-1.414\tc-0.39-0.39-1.023-0.388-1.414,0.003L8,6.564L4.746,3.295C4.357,2.904,3.724,2.903,3.332,3.292C2.94,3.682,2.939,4.315,3.329,4.707\tl3.261,3.275l-3.298,3.313c-0.39,0.391-0.388,1.024,0.003,1.414C3.49,12.903,3.745,13,4,13c0.257,0,0.513-0.099,0.708-0.295L8,9.399\tl3.291,3.306C11.486,12.901,11.743,13,12,13c0.255,0,0.511-0.097,0.705-0.291C13.097,12.319,13.099,11.686,12.709,11.295z"/></svg>',enlarge32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,9v6.5c0,0.552-0.447,1-1,1s-1-0.448-1-1v-4.086L11.414,22H15.5c0.552,0,1,0.447,1,1s-0.448,1-1,1H9\tc-0.13,0-0.26-0.026-0.382-0.077c-0.245-0.102-0.439-0.296-0.541-0.541C8.026,23.26,8,23.13,8,23v-6.5c0-0.552,0.448-1,1-1\ts1,0.448,1,1v4.085L20.586,10H16.5c-0.552,0-1-0.448-1-1s0.448-1,1-1H23c0.13,0,0.26,0.026,0.382,0.077\tc0.245,0.102,0.439,0.296,0.541,0.541C23.974,8.74,24,8.87,24,9z"/></svg>',options32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M26.1,21.383c0.334-0.625,0.602-1.279,0.812-1.949L32,18.609V13.51l-5.058-0.846\tc-0.208-0.67-0.468-1.325-0.795-1.956l3.009-4.145l-3.604-3.634L21.38,5.903c-0.626-0.333-1.276-0.602-1.948-0.81L18.609,0\tl-5.098,0.001l-0.847,5.061c-0.669,0.203-1.326,0.465-1.957,0.794L6.562,2.847L2.929,6.449l2.973,4.171\tC5.569,11.247,5.3,11.9,5.091,12.569L0,13.373v5.099l5.06,0.866c0.204,0.669,0.467,1.324,0.796,1.955l-3.009,4.146l3.601,3.635\tl4.171-2.975c0.627,0.335,1.282,0.603,1.951,0.811L13.372,32h5.118l0.849-5.057c0.668-0.207,1.323-0.469,1.953-0.795l4.144,3.01\tl3.639-3.604L26.1,21.383z M19.01,19.035c-1.675,1.663-4.381,1.652-6.041-0.025c-1.662-1.675-1.649-4.381,0.024-6.042\tc1.676-1.661,4.382-1.648,6.043,0.025C20.699,14.67,20.686,17.377,19.01,19.035z"/></svg>',file32:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" x="0px" y="0px" version="1.1" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,28.5c-3.6,0-6.5-3-6.5-6.6V9.6c0-0.6,0.4-1,1-1s1,0.4,1,1v12.3c0,2.5,2,4.6,4.5,4.6\tc2.5,0,4.5-2.1,4.5-4.6V8.3c0-1.5-1.2-2.8-2.7-2.8c-1.5,0-2.7,1.3-2.7,2.8v13.5c0,0.6,0.5,1.1,1,1.1c0.6,0,1-0.5,1-1.1v-10\tc0-0.6,0.4-1,1-1s1,0.4,1,1v10c0,1.7-1.4,3.1-3,3.1s-3-1.4-3-3.1V8.3c0-2.6,2.1-4.8,4.7-4.8c2.6,0,4.7,2.2,4.7,4.8v13.6\tC22.5,25.5,19.6,28.5,16,28.5z"/></svg>',upload32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M9.488,13.481c-0.391-0.391-0.391-1.023,0-1.414l5.805-5.805c0.026-0.026,0.06-0.036,0.088-0.058\tc0.073-0.06,0.146-0.119,0.235-0.156c0.246-0.103,0.522-0.103,0.769,0c0.093,0.039,0.171,0.101,0.249,0.165\tc0.023,0.02,0.053,0.027,0.074,0.049l5.805,5.805c0.391,0.391,0.391,1.023,0,1.414c-0.195,0.195-0.451,0.293-0.707,0.293\ts-0.512-0.098-0.707-0.293L17,9.383V20.33c0,0.553-0.447,1-1,1c-0.552,0-1-0.447-1-1V9.383l-4.098,4.098\tC10.512,13.872,9.879,13.872,9.488,13.481z M22.819,24.031H9.181c-0.552,0-1,0.447-1,1s0.448,1,1,1h13.639c0.553,0,1-0.447,1-1\tS23.372,24.031,22.819,24.031z"/></svg>',download16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#FFF" d="M3.175,7.726c-0.413-0.367-0.45-0.999-0.083-1.412c0.367-0.413,0.999-0.45,1.412-0.083L7,8.45V1.5\tc0-0.552,0.448-1,1-1c0.553,0,1,0.448,1,1v6.95l2.496-2.219c0.412-0.367,1.044-0.331,1.411,0.083\tc0.367,0.413,0.33,1.045-0.083,1.412l-4.16,3.698c-0.047,0.041-0.103,0.062-0.154,0.094c-0.047,0.028-0.089,0.064-0.141,0.085\tC8.25,11.649,8.125,11.677,8,11.677c-0.126,0-0.25-0.027-0.369-0.074c-0.05-0.021-0.09-0.055-0.136-0.083\tc-0.053-0.031-0.111-0.053-0.159-0.096L3.175,7.726z M12.018,13.5H3.983c-0.552,0-1,0.447-1,1s0.448,1,1,1h8.035\tc0.553,0,1-0.447,1-1S12.57,13.5,12.018,13.5z"/></svg>',error16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#ad001f" d="M15.744,13.104L9.097,1.47c-0.604-1.055-1.59-1.055-2.193,0L0.256,13.104\tc-0.604,1.056-0.102,1.919,1.113,1.919H14.63C15.847,15.022,16.348,14.159,15.744,13.104z M7,5.045c0-0.552,0.448-1,1-1s1,0.448,1,1\tv3.656c0,0.552-0.448,1-1,1s-1-0.448-1-1V5.045z M8,13.212c-0.748,0-1.354-0.607-1.354-1.354c0-0.748,0.606-1.354,1.354-1.354\ts1.354,0.606,1.354,1.354C9.354,12.604,8.748,13.212,8,13.212z"/></svg>',arrowLeft16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M13.6,8c0,0.6-0.4,1-1,1h-7l2.2,2.5c0.4,0.4,0.3,1-0.1,1.4c-0.2,0.2-0.4,0.2-0.7,0.2c-0.3,0-0.6-0.1-0.8-0.3\n\tL2.6,8.6c0,0-0.1-0.1-0.1-0.2c0,0-0.1-0.1-0.1-0.1c0-0.1-0.1-0.2-0.1-0.3c0,0,0,0,0,0c0,0,0,0,0,0c0-0.1,0-0.3,0.1-0.4\n\tc0,0,0.1-0.1,0.1-0.1c0-0.1,0.1-0.1,0.1-0.2l3.7-4.1c0.4-0.4,1-0.4,1.4-0.1c0.4,0.4,0.4,1,0.1,1.4L5.6,7h7C13.2,7,13.6,7.4,13.6,8z"\n\t/>\n</svg>\n',arrowRight16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M2.4,8.1c0-0.6,0.4-1,1-1h7L8.1,4.5c-0.4-0.4-0.3-1,0.1-1.4c0.2-0.2,0.4-0.2,0.7-0.2c0.3,0,0.6,0.1,0.8,0.3\n\tl3.7,4.2c0,0,0.1,0.1,0.1,0.2c0,0,0.1,0.1,0.1,0.1c0,0.1,0.1,0.2,0.1,0.3c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.3-0.1,0.4\n\tc0,0-0.1,0.1-0.1,0.1c0,0.1-0.1,0.1-0.1,0.2l-3.7,4.1c-0.4,0.4-1,0.4-1.4,0.1c-0.4-0.4-0.4-1-0.1-1.4l2.2-2.4h-7\n\tC2.8,9.1,2.4,8.6,2.4,8.1z"/>\n</svg>\n',check32:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="32px"\n height="32px"\n x="0px"\n y="0px"\n viewBox="0 0 32 32"\n>\n <path\n fill="currentColor"\n d="M22.9,9.3l-9.3,9.3l-3.2-3.2c-0.9-0.9-2.3-0.9-3.2,0l0,0c-0.9,0.9-0.9,2.3,0,3.2l3.2,3.2l0,0l1.6,1.6\n\tc0.9,0.9,2.3,0.9,3.2,0l1.6-1.6l9.3-9.3c0.9-0.9,0.9-2.3,0-3.2l0,0C25.2,8.4,23.7,8.4,22.9,9.3z"\n />\n</svg>\n',check16:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="16px"\n height="16px"\n x="0px"\n y="0px"\n viewBox="0 0 16 16"\n>\n <path\n fill="currentColor"\n d="M11.6,4.3l-5,5L4.9,7.5C4.4,7,3.7,7,3.2,7.5l0,0C2.8,8,2.8,8.7,3.2,9.2l1.7,1.7l0,0l0.8,0.8\n\tc0.5,0.5,1.2,0.5,1.7,0l0.8-0.8l5-5c0.5-0.5,0.5-1.2,0-1.7l0,0C12.8,3.8,12.1,3.8,11.6,4.3z"\n />\n</svg>\n'},hs=({name:e,size:t="32",className:n,alt:r})=>{const o=`${e}${t}`;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{"aria-hidden":"true",className:n||T("icon"),dangerouslySetInnerHTML:{__html:fs[o]}}),r&&(0,k.jsx)("span",{className:T("visually-hidden"),children:r})]})};function ys({items:e,currentIndex:t,onChange:n,children:r}){const{t:o}=ya(),i=e.length;return(0,k.jsxs)("div",{className:T("carousel-controls"),children:[(0,k.jsx)("button",{className:T("button","button--previous"),"aria-label":o("carousel.controls.previous"),onClick:()=>{n((t-1+i)%i)},children:(0,k.jsx)(hs,{name:"arrowLeft",size:"16"})}),r,(0,k.jsx)("button",{className:T("button","button--next"),"aria-label":o("carousel.controls.next"),onClick:()=>{n((t+1)%i)},children:(0,k.jsx)(hs,{name:"arrowRight",size:"16"})})]})}function ms({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:o}){const i=e.length,a=(0,Qe.useCallback)((e=>{const r=Number(e.target.dataset.item||"0"),o=Math.min(i-1,Math.max(0,r));o!==t&&n(o)}),[i,t,n]);return(0,k.jsx)("div",{className:T("carousel-pagination__wrapper"),role:"group",children:(0,k.jsx)("ul",{className:T("carousel-pagination"),children:e.map(((e,n)=>{const i=t===n;return(0,k.jsx)("li",{className:T("carousel-pagination__item",i?"is-active":void 0),children:(0,k.jsx)("button",{className:T("carousel-pagination__button"),type:"button",onClick:a,"data-item":n,"aria-disabled":i?"true":void 0,"aria-label":o(e,n)})},r(e,n,"pagination-item-"))}))})})}const bs=(e,t,n)=>`${n}${t}`,vs=e=>e.label,gs=({target:e})=>{e.scrollLeft=0};function ws({currentIndex:e,onChange:t,getItemKey:n=bs,getItemLabel:r=vs,items:o}){const i=Va(),a=o.length,[s,c]=(0,Qe.useState)(Number(e||"0"));(0,Qe.useEffect)((()=>{c(Number(e||"0"))}),[c,e]);const l=(0,Qe.useRef)([]);l.current=(0,Qe.useMemo)((()=>Array(a).fill(1).map((()=>(0,Xe.createRef)()))),[a]);const u=(0,Qe.useRef)(!0),p=(0,Qe.useRef)();return p.current=t,(0,Qe.useEffect)((()=>{u.current?u.current=!1:p.current&&p.current(s)}),[s]),(0,k.jsxs)("div",{className:T("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,k.jsx)("div",{className:T("carousel__slides-wrapper"),onScroll:gs,children:(0,k.jsx)("div",{id:i,className:T("carousel__slides"),style:{width:100*a+"%",left:-100*s+"%"},"aria-live":"polite","aria-atomic":"false",children:o.map(((e,t)=>{const r=s===t;return(0,k.jsx)("div",{ref:l.current[t],className:T("carousel__slide",r?"is-active":void 0),"aria-hidden":r?void 0:"true",children:(0,k.jsx)(ds,{item:e,items:o,currentIndex:s,index:t,isActive:r})},n(e,t,"item-"))}))})}),(0,k.jsx)("div",{className:T("carousel__controls"),children:(0,k.jsx)(ys,{currentIndex:s,items:o,onChange:c,controlId:i,children:(0,k.jsx)("div",{className:T("carousel__pagination"),children:(0,k.jsx)(ms,{currentIndex:s,items:o,onChange:c,getItemKey:n,getItemLabel:r})})})})]})}const js=(e,t,n="")=>`${n}${e.title}:${t}`,Os=e=>e.title,xs=["event","children"];function Ss(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ss(Object(n),!0).forEach((function(t){Es(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ss(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Es(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Cs=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,Ps=({id:e,categories:t=[],question:n,onClick:r,hasIcon:o})=>{const i=(0,Qe.useMemo)((()=>["suggestions__item",...t.map(Cs)]),[t]),a=(0,Qe.useCallback)((()=>{r&&r({id:e,question:n})}),[e,n,r]);return(0,k.jsx)("li",{className:T(i),children:(0,k.jsxs)("button",{type:"button",onClick:a,className:T("button","button--primary"),children:[o&&(0,k.jsx)(hs,{name:"chevronRight",size:"8"}),n]})})};function Ts(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ks(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const As=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>(0,k.jsx)("ul",{className:T("suggestions__list",e),children:t.map((e=>(0,k.jsx)(Ps,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ts(Object(n),!0).forEach((function(t){ks(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ts(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({hasIcon:r,onClick:n},e),e.id)))}),Ns=["event"];function Is(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Is(Object(n),!0).forEach((function(t){Ds(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Is(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ds(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ms=e=>{const{sendAction:t}=Xi();return n=>{n.target&&n.target.dataset.linkId&&t({type:"navigate",originMessage:e,link:{id:n.target.dataset.linkId,url:n.target.getAttribute("href")}})}};function Ls(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Us(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ls(Object(n),!0).forEach((function(t){Fs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ls(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fs(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bs({children:e,childrenHTML:t,className:n,graphicSrc:r,graphicType:o="icon",iconName:i,iconSize:a,iconClassName:s,dividerType:c}){const l=Boolean(i||r),u=t?{dangerouslySetInnerHTML:{__html:t}}:{children:e};return(0,k.jsxs)("div",{className:T("divider",c&&`divider--type-${c}`,n),children:[l&&(0,k.jsx)("span",{className:T("divider__graphic"),children:i?(0,k.jsx)(hs,{name:i,size:a,className:s}):(0,k.jsx)("img",{src:r,className:T({icon:"icon"===o,avatar:"avatar"===o},s)})}),(0,k.jsx)("div",Us({className:T("divider__body")},u))]})}const $s={[w.new_topic]:"newtopic"},zs=["event"];function Hs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vs(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qs={default:({event:e})=>{const{t}=ya(),{subtype:n}=e.payload.body,r=$s[w[n]];return(0,k.jsx)(Bs,{dividerType:r,iconName:w[n],children:(0,k.jsx)("p",{children:t(`dividerKeys.${w[n]}`)})})},[w.new_translation]:({event:e})=>{const{t}=ya(),n=Pr(),{body:{restartButtonText:r,translationEnabled:o,translationLocale:i,text:a,title:s},id:c}=e.payload,{enableTranslations:l}=Wa(),u=ct((e=>e.translations.translatedEventGroups)),p=mt(),d=(0,Qe.useCallback)((()=>{u[c]?p(Ni({events:n,id:c})):p(Ii({events:n,id:c}))}),[p,n,c,u]);return(0,k.jsxs)(Bs,{iconName:"newTranslation",dividerType:"newtranslation",children:[(0,k.jsx)("p",{className:T("divider__title"),children:s}),a&&(0,k.jsx)("p",{children:a}),o?(0,k.jsx)(k.Fragment,{children:(0,k.jsx)("button",{className:T("button","button--secondary"),onClick:d,children:t(u[c]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):(0,k.jsx)("button",{className:T("button","button--secondary"),"data-testid":"restartTranslationButton",onClick:()=>{l(i)},children:r})]})}},Ws={month:"long",day:"numeric",year:"numeric"},Gs={hour:"numeric",minute:"numeric"},Ks=({event:e})=>{const t=(()=>{const[e,t]=(0,Qe.useReducer)((e=>e+1),0);return(0,Qe.useCallback)((()=>{setTimeout((()=>{t()}))}),[])})(),{date:n,time:r,timeUntilMidnight:o,srText:i}=(e=>{const{t}=ya(),n=xr()?.context?.locale??[],r=new Date(e),o=new Date,i=new Date(o);i.setHours(24,0,0,0);const a=i-o,s=r.toString(),c=new Intl.DateTimeFormat(n,Gs).format(r);let l=((e,t)=>{const n=new Date(t).setHours(0,0,0,0),r=e.getTime(),o=864e5;return r>=n+o?e:r>n?"today":r>n-o?"yesterday":e})(r,o);switch(l){case"today":l=t("dateTime.today");break;case"yesterday":l=t("dateTime.yesterday");break;default:l=new Intl.DateTimeFormat(n,Ws).format(r)}return{date:l,srText:t("dateTime.srText",{date:l,time:c}),time:c,fullDateTime:s,timeUntilMidnight:a}})(F(e.timeIndicator));return(0,Qe.useEffect)((()=>{const e=setTimeout((()=>{t()}),o);return()=>{clearTimeout(e)}}),[t,o]),(0,k.jsxs)(Bs,{dividerType:"time-indicator",children:[(0,k.jsxs)("p",{className:T("divider__time"),"aria-hidden":"true",children:[(0,k.jsx)("span",{children:n}),(0,k.jsx)("span",{children:r})]}),(0,k.jsx)("p",{className:T("visually-hidden"),children:i})]})};var Js=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],Xs=Js.join(","),Qs="undefined"==typeof Element,Ys=Qs?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Zs=!Qs&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},ec=function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(Xs));return t&&Ys.call(e,Xs)&&r.unshift(e),r.filter(n)},tc=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if("SLOT"===a.tagName){var s=a.assignedElements(),c=e(s.length?s:a.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:a,candidates:c})}else{Ys.call(a,Xs)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),u=!r.shadowRootFilter||r.shadowRootFilter(a);if(l&&u){var p=e(!0===l?a.children:l.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:a,candidates:p})}else i.unshift.apply(i,a.children)}}return o},nc=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},rc=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},oc=function(e){return"INPUT"===e.tagName},ic=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},ac=function(e,t){return!(t.disabled||function(e){return oc(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Ys.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Ys.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ic(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,s=Zs(e);if(a&&!a.shadowRoot&&!0===r(a))return ic(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){for(var t,n=Zs(e).host,r=!!(null!==(t=n)&&void 0!==t&&t.ownerDocument.contains(n)||e.ownerDocument.contains(e));!r&&n;){var o;r=!(null===(o=n=Zs(n).host)||void 0===o||!o.ownerDocument.contains(n))}return r}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Ys.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},sc=function(e,t){return!(function(e){return function(e){return oc(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Zs(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||nc(t)<0||!ac(e,t))},cc=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},lc=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,s=nc(a,i),c=i?e(t.candidates):a;0===s?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:o,tabIndex:s,item:t,isScope:i,content:c})})),r.sort(rc).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},uc=function(e,t){var n;return n=(t=t||{}).getShadowRoot?tc([e],t.includeContainer,{filter:sc.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:cc}):ec(e,t.includeContainer,sc.bind(null,t)),lc(n)},pc=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Ys.call(e,Xs)&&sc(t,e)},dc=Js.concat("iframe").join(","),fc=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Ys.call(e,dc)&&ac(t,e)};function hc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hc(Object(n),!0).forEach((function(t){mc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bc=function(e){return"Tab"===e.key||9===e.keyCode},vc=function(e){return bc(e)&&!e.shiftKey},gc=function(e){return bc(e)&&e.shiftKey},wc=function(e){return setTimeout(e,0)},jc=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},Oc=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},xc=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},Sc=[];function _c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ec(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_c(Object(n),!0).forEach((function(t){Cc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Pc=({children:e,onClose:t,"aria-label":n,"aria-labelledby":r,fallBackFocusRef:o})=>{const i=Va(),a=(0,Qe.useRef)(null),s=(0,Qe.useRef)(null),[c,l]=(0,Qe.useState)(!1);return(0,Qe.useEffect)((()=>{return c&&(s.current=(e=a.current,t={initialFocus:o&&o.current?o.current:null},r=(null==t?void 0:t.document)||document,i=(null==t?void 0:t.trapStack)||Sc,l=yc({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:vc,isKeyBackward:gc},t),u={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},p=function(e,t,n){return e&&void 0!==e[t]?e[t]:l[n||t]},d=function(e){return u.containerGroups.findIndex((function(t){var n=t.container,r=t.tabbableNodes;return n.contains(e)||r.find((function(t){return t===e}))}))},f=function(e){var t=l[e];if("function"==typeof t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];t=t.apply(void 0,o)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var a=t;if("string"==typeof t&&!(a=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return a},h=function(){var e=f("initialFocus");if(!1===e)return!1;if(void 0===e)if(d(r.activeElement)>=0)e=r.activeElement;else{var t=u.tabbableGroups[0];e=t&&t.firstTabbableNode||f("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},y=function(){if(u.containerGroups=u.containers.map((function(e){var t=uc(e,l.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?tc([e],t.includeContainer,{filter:ac.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):ec(e,t.includeContainer,ac.bind(null,t))}(e,l.tabbableOptions);return{container:e,tabbableNodes:t,focusableNodes:n,firstTabbableNode:t.length>0?t[0]:null,lastTabbableNode:t.length>0?t[t.length-1]:null,nextTabbableNode:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=n.findIndex((function(t){return t===e}));if(!(r<0))return t?n.slice(r+1).find((function(e){return pc(e,l.tabbableOptions)})):n.slice(0,r).reverse().find((function(e){return pc(e,l.tabbableOptions)}))}}})),u.tabbableGroups=u.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),u.tabbableGroups.length<=0&&!f("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},m=function e(t){!1!==t&&t!==r.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!l.preventScroll}),u.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(h()))},b=function(e){var t=f("setReturnFocus",e);return t||!1!==t&&e},v=function(e){var t=xc(e);d(t)>=0||(Oc(l.clickOutsideDeactivates,e)?n.deactivate({returnFocus:l.returnFocusOnDeactivate&&!fc(t,l.tabbableOptions)}):Oc(l.allowOutsideClick,e)||e.preventDefault())},g=function(e){var t=xc(e),n=d(t)>=0;n||t instanceof Document?n&&(u.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),m(u.mostRecentlyFocusedNode||h()))},w=function(e){if(("Escape"===(t=e).key||"Esc"===t.key||27===t.keyCode)&&!1!==Oc(l.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();var t;(l.isKeyForward(e)||l.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=xc(e);y();var r=null;if(u.tabbableGroups.length>0){var o=d(n),i=o>=0?u.containerGroups[o]:void 0;if(o<0)r=t?u.tabbableGroups[u.tabbableGroups.length-1].lastTabbableNode:u.tabbableGroups[0].firstTabbableNode;else if(t){var a=jc(u.tabbableGroups,(function(e){var t=e.firstTabbableNode;return n===t}));if(a<0&&(i.container===n||fc(n,l.tabbableOptions)&&!pc(n,l.tabbableOptions)&&!i.nextTabbableNode(n,!1))&&(a=o),a>=0){var s=0===a?u.tabbableGroups.length-1:a-1;r=u.tabbableGroups[s].lastTabbableNode}else bc(e)||(r=i.nextTabbableNode(n,!1))}else{var c=jc(u.tabbableGroups,(function(e){var t=e.lastTabbableNode;return n===t}));if(c<0&&(i.container===n||fc(n,l.tabbableOptions)&&!pc(n,l.tabbableOptions)&&!i.nextTabbableNode(n))&&(c=o),c>=0){var p=c===u.tabbableGroups.length-1?0:c+1;r=u.tabbableGroups[p].firstTabbableNode}else bc(e)||(r=i.nextTabbableNode(n))}}else r=f("fallbackFocus");r&&(bc(e)&&e.preventDefault(),m(r))}(e,l.isKeyBackward(e))},j=function(e){var t=xc(e);d(t)>=0||Oc(l.clickOutsideDeactivates,e)||Oc(l.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},O=function(){if(u.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)}(i,n),u.delayInitialFocusTimer=l.delayInitialFocus?wc((function(){m(h())})):m(h()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",j,{capture:!0,passive:!1}),r.addEventListener("keydown",w,{capture:!0,passive:!1}),n},x=function(){if(u.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",j,!0),r.removeEventListener("keydown",w,!0),n},n={get active(){return u.active},get paused(){return u.paused},activate:function(e){if(u.active)return this;var t=p(e,"onActivate"),n=p(e,"onPostActivate"),o=p(e,"checkCanFocusTrap");o||y(),u.active=!0,u.paused=!1,u.nodeFocusedBeforeActivation=r.activeElement,t&&t();var i=function(){o&&y(),O(),n&&n()};return o?(o(u.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!u.active)return this;var t=yc({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},e);clearTimeout(u.delayInitialFocusTimer),u.delayInitialFocusTimer=void 0,x(),u.active=!1,u.paused=!1,function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}(i,n);var r=p(t,"onDeactivate"),o=p(t,"onPostDeactivate"),a=p(t,"checkCanReturnFocus"),s=p(t,"returnFocus","returnFocusOnDeactivate");r&&r();var c=function(){wc((function(){s&&m(b(u.nodeFocusedBeforeActivation)),o&&o()}))};return s&&a?(a(b(u.nodeFocusedBeforeActivation)).then(c,c),this):(c(),this)},pause:function(){return u.paused||!u.active||(u.paused=!0,x()),this},unpause:function(){return u.paused&&u.active?(u.paused=!1,y(),O(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return u.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),u.active&&y(),this}},n.updateContainerElements(e),n),s.current.activate()),()=>{s.current&&s.current.deactivate()};var e,t,n,r,i,l,u,p,d,f,h,y,m,b,v,g,w,j,O,x}),[c,o]),(0,Qe.useEffect)((()=>{const e=(()=>{const e=[],t=[];return document.querySelectorAll('body > *:not([role="dialog"])').forEach((n=>{const r=n.getAttribute("aria-hidden");null!==r&&"false"!==r||(e.push(r),t.push(n),n.setAttribute("aria-hidden","true"))})),()=>{t.forEach(((t,n)=>{const r=e[n];null===r?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",r)}))}})();return()=>{e()}}),[c]),(0,Qe.useEffect)((()=>{c&&a.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()}))}),[c,t]),(0,Qe.useLayoutEffect)((()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",i),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),n&&t.setAttribute("aria-label",n),r&&t.setAttribute("aria-labelledby",r),e.appendChild(t),a.current=t,l(!0),()=>{a.current&&(e.removeChild(a.current),a.current=null)}}),[n,r,i]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>a.current&&(0,Xe.render)(e,a.current)}):a.current&&(0,Xe.render)((0,Xe.toChildArray)(e).map((e=>(e.props=Ec(Ec({},e.props),{},{onClose:t}),e))),a.current)},Tc=({url:e,description:t,onClose:n})=>{const{zIndex:r,layoutMode:o,namespace:i}=xr(),a=Ua(),s=wa(),c=(0,Qe.useRef)(null),{t:l}=ya(),u=["modal",`app--layout-${o}`,`namespace--${i}`,...s],p=e=>{e.stopPropagation()},d=()=>{n()},f=r?{zIndex:r+1}:void 0;return(0,k.jsx)(Pc,{onClose:n,"aria-label":l("lightbox.heading"),fallBackFocusRef:c,children:({onClose:n,modalRenderFn:r})=>r((n=>(0,k.jsx)("div",{className:T(u),onClick:d,style:f,children:(0,k.jsxs)("div",{className:T("modal__float"),tabIndex:"-1",onMouseDown:a,onKeyDown:a,onTouchStart:a,onMouseMove:a,onWheel:a,onPointerDown:a,onPointerMove:a,ref:c,children:[(0,k.jsx)("div",{className:T("modal__inner"),onClick:p,children:(0,k.jsx)("img",{className:T("modal__image"),src:e,alt:t})}),(0,k.jsxs)("button",{type:"button",className:T("modal__close"),onClick:n,children:[(0,k.jsx)(hs,{name:"close",size:"16"}),l("lightbox.closeLabel")]})]})}))(n))})},kc=({description:e,url:t})=>{const{t:n}=ya(),[r,o]=(0,Qe.useState)(!1);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("button",{type:"button",className:T("modal__enlarge"),onClick:()=>{o(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),(0,k.jsx)(hs,{name:"enlarge",size:"32"})]}),r&&(0,k.jsx)(Tc,{url:t,description:e,onClose:()=>{o(!1)}})]})},Ac=["event","descriptorId"];function Nc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ic(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nc(Object(n),!0).forEach((function(t){Rc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Dc=["event"];function Mc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mc(Object(n),!0).forEach((function(t){Uc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Uc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fc=["event"];function Bc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bc(Object(n),!0).forEach((function(t){zc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Hc=e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Fc);const{body:r}=Ga(t),o=Ms(t.payload.id),i=(0,Qe.useMemo)((()=>t.payload.optimisticallyInjected?{children:(0,k.jsx)("p",{children:r.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:r.text}}}),[r,t]);return(0,k.jsx)(ts,$c($c({type:"text",event:t,onClick:o},n),i))},Vc=["event"];function qc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qc(Object(n),!0).forEach((function(t){Gc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Kc=["event"];function Jc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jc(Object(n),!0).forEach((function(t){Qc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yc=({children:e,url:t,target:n})=>t?(0,k.jsx)("a",{href:t,download:!0,target:n||void 0,className:T(["download","download-link"]),children:e}):(0,k.jsx)("span",{className:T("download"),children:e}),Zc=["event","descriptorId"];function el(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?el(Object(n),!0).forEach((function(t){nl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):el(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nl(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ol(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rl(Object(n),!0).forEach((function(t){il(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function il(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const al={message:{choice_prompt:e=>{let{event:t,children:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,xs);const{t:o}=ya(),i=Va(),{body:a,subEvent:s,showOptions:c,chooseAgain:l,onChoiceClickHandler:u,onChooseAgainClickHandler:p}=(e=>{const{payload:t}=e,[n,r]=(0,Qe.useState)(!1),{sendAction:o,addMessageBubble:i,addDivider:a}=Xi(),{activeServiceSessionId:s}=_r().serviceInfo,c=ct(Nr),{body:l}=Ga(e),{service:u}=t,p=(0,Qe.useMemo)((()=>_s(_s({},e),{},{payload:_s(_s({},e.payload),{},{body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&_s(_s({},e.payload.translatedBody),{},{data:e.payload.translatedBody.data.prompt})})})),[e]),d=l.chooseAgain&&s===u.serviceSessionId&&t.id!==c;return(0,Qe.useEffect)((()=>{r(t.id===c)}),[t,c]),{body:l,subEvent:p,showOptions:n,chooseAgain:d,onChoiceClickHandler:e=>{const n=J();d&&a("new_topic",n),i(e.text,n),o({type:"pick_choice",originMessage:t.id,choice:{id:e.id,text:e.text,chooseAgain:d},transactionId:n}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}})(t);return(0,k.jsxs)(k.Fragment,{children:[(0,Xe.toChildArray)(n).map((e=>(e.props=_s(_s({},e.props),{},{event:s,descriptorId:i,showTranslationToggle:!1}),e))),l&&(0,k.jsxs)("button",{type:"button",className:T("button","button--secondary","button--choose-again"),"aria-expanded":c?"true":"false",onClick:p,"aria-describedby":i,children:[o(c?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,k.jsx)(hs,{name:"chevronDown",size:"8"})]}),c&&(0,k.jsx)(ts,_s(_s({type:"choice-prompt",showParticipant:!1,event:t},r),{},{children:(0,k.jsx)("ul",{className:T("choice-prompt","choice-prompt--many"),children:a.choices.map((e=>(0,k.jsx)("li",{className:T("choice-prompt__item",{[`choice-prompt__item--${e.category}`]:e.category}),children:(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{u(e)},children:e.text})},e.id)))})}))]})},text:Hc,image:e=>{let{event:t,descriptorId:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Ac);const{body:o}=Ga(t),{description:i,url:a,isZoomable:s}=o,[c,l]=(0,Qe.useState)(!1),u=mt();return(0,k.jsxs)(ts,Ic(Ic({event:t,type:"image"},r),{},{children:[(0,k.jsx)("img",{src:a,id:n,alt:i,onLoad:()=>{u(ko(t.payload.id)),l(!0)}}),s&&c&&(0,k.jsx)(kc,{description:i,url:a})]}))},splash:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Dc);const{payload:r}=t,{body:o}=Ga(t),i=Ms(r.id);return(0,k.jsx)(ts,Lc(Lc({type:"splash",event:t,onClick:i},n),{},{bodyProps:{dangerouslySetInnerHTML:{__html:o.text}}}))},video:e=>{let{event:t,descriptorId:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Zc);const{body:o}=Ga(t),{description:i,url:a}=o;return ja(t).push("message--type-video"),(0,k.jsxs)(ts,tl(tl({event:t,type:"video"},r),{},{children:[(0,k.jsx)("div",{id:n,className:T("visually-hidden"),children:i}),(0,k.jsx)("iframe",{title:i,src:a,allow:"autoplay; encrypted-media",allowFullScreen:!0})]}))},upload:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Kc);const{t:r}=ya(),{body:o}=Ga(t),{fromClient:i}=t.payload,{filename:a,url:s}=o,c=(0,Qe.useMemo)((()=>r(s?"fileUpload.srFileDownloadText":"fileUpload.srFileUploadedText",{fileName:a})),[s,a,r]);return(0,k.jsx)(ts,Xc(Xc({event:t,type:"upload"},n),{},{children:(0,k.jsxs)(Yc,{url:s,target:i?void 0:"_blank",children:[(0,k.jsx)(hs,{name:"download",size:"16"}),(0,k.jsx)("span",{"aria-hidden":"true",className:T("file-download"),children:a}),(0,k.jsx)("span",{className:T("visually-hidden"),children:c})]})}))},cta:({event:e})=>{const{body:t}=Ga(e),n=Ms(e.payload.id),{emitEvent:r}=Xi(),o=Va(),i=(0,Qe.useCallback)((()=>r(`action.${y}`,{type:y,originMessage:e.payload.id,link:{url:t.buttonLink}})),[r,t,e]);return(0,k.jsxs)(ts,{type:"cta",event:e,children:[(0,k.jsx)("div",{className:T("cta__content"),id:o,dangerouslySetInnerHTML:{__html:t.description},onClick:n}),(0,k.jsx)("a",{className:T("button","button--primary"),"aria-describedby":o,href:t.buttonLink,rel:"noreferrer",target:t.buttonNewTab?"_blank":"_self",onClick:i,children:t.buttonText})]})},carousel:({event:e})=>{const{body:t}=Ga(e),n=t.cards;return(0,k.jsx)(ts,{event:e,modifiers:"type-carousel",children:(0,k.jsx)(ws,{items:n,ItemComponent:ds,getItemKey:js,getItemLabel:Os})})},card:({event:e})=>{const{body:t}=Ga(e),n=Va();return(0,k.jsx)(ts,{type:"card",event:e,children:(0,k.jsx)(is,ss({id:n},t))})}},info:{text:Hc,divider:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,zs);const r=qs[w[t.payload.body.subtype]]||qs.default;return(0,k.jsx)(r,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hs(Object(n),!0).forEach((function(t){Vs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({event:t},n))},translation:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Vc);const{t:r}=ya(),{body:o}=Ga(t);return(0,k.jsx)(ts,Wc(Wc({type:"text",event:t},n),{},{children:r(o.key.join("."),o.variables)}))},timeIndicator:Ks},participant:{participant:({event:e})=>{const{participant:t}=e.payload,{body:n}=Ga(e);return n?(0,k.jsx)(Bs,{graphicSrc:t.avatar,graphicType:t.avatar?"avatar":void 0,iconName:t.avatar?void 0:"balloon",childrenHTML:n,dividerType:"participant"}):null}},service_data:{suggestion:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Ns);const[r,o]=(0,Qe.useState)(!0),i=mt(),a=Hr(),{sendAction:s,addMessageBubble:l}=Xi(),{suggestions:u,payload:p}=(e=>{const{payload:t}=e,{body:n}=Ga(e);return{suggestions:n,payload:t}})(t),{showSuggestions:d}=xr(),f=Pr(),{t:h}=ya(),y=h("suggestions.headingText"),m=h("suggestions.footerText"),b=(0,Qe.useMemo)((()=>f.some((({payload:e})=>e?.transactionLast))),[f]),v=(0,Qe.useCallback)((({id:e,question:t})=>{o(!1),i(Wr(!0)),s({type:c,originMessage:p.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),l(t)}),[i,s,p.id,l]);return r&&!a&&b&&d?(0,k.jsxs)("div",{className:T("suggestions","suggestions--conversation"),children:[y&&(0,k.jsx)("p",{className:T("suggestions__heading"),children:y}),(0,k.jsxs)(ts,Rs(Rs({type:"suggestions",showParticipant:!1,event:t},n),{},{children:[(0,k.jsx)(As,{className:"suggestions__list--conversation",onClickSuggestion:v,suggestions:u}),m&&(0,k.jsx)("p",{className:T("suggestions__footer"),children:m})]}))]}):null}}},sl=({children:e})=>{const{customComponents:t}=xr(),n=(0,Qe.useMemo)((()=>Object.keys(al).reduce(((e,n)=>ol(ol({},e),{},{[n]:ol(ol({},al[n]),t?t[n]:{})})),{fallback:Hc})),[t]);return(0,k.jsx)(ga.Provider,{value:n,children:e})},cl=({children:e})=>{const{isMinimized:t}=zi(),n=(0,Qe.useRef)(0),{sendAction:r}=Xi(),{hasCountdown:o,isActive:i,stopCountdown:a}=za(),s=(0,Qe.useCallback)((()=>{if(t)return;const e=(new Date).getTime(),s=()=>{r({type:"interactivity_update"}),n.current=e};o&&i&&(s(),a()),e-n.current>15e3&&s()}),[r,o,i,a,t]);return(0,k.jsx)("div",Object.assign({className:T("activity-monitor"),tabIndex:-1,onMouseDown:s,onKeyUp:s,onTouchStart:s,onMouseMove:s,onWheel:s,onPointerDown:s,onPointerMove:s},{children:(0,k.jsx)(La.Provider,Object.assign({value:s},{children:e}))}))};const ll=["text","choice_prompt","image","video"],ul=()=>{const e=Vi(),t=(0,Qe.useRef)(),n=(0,Qe.useRef)(),r=mt(),o=Pr(),i=(0,Qe.useContext)(gt),a=(0,Qe.useRef)(null),{initCountdown:s,endCountdown:c}=za(),{emitEvent:l}=Xi();return(0,Qe.useEffect)((()=>{if(e.connectionInfo&&e.conversation.socket){const{socket:t}=e.conversation;t.onError((e=>{const t=new Yo(e);r(Xr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r(co())})),t.onOpen((()=>{r(Qr())}))}}),[e,e.connectionInfo,e.conversation.socket,r]),(0,Qe.useEffect)((()=>{if(e.connectionInfo&&e.conversation.channel){const{channel:t}=e.conversation;return()=>{null==t||t.leave()}}return()=>{}}),[e,e.connectionInfo,e.conversation]),(0,Qe.useEffect)((()=>{e.conversation.onConnection((({currentState:e})=>{if("join_channel_erred"===e){const e=new D;r(Xr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action}))}}))}),[e.conversation,r]),(0,Qe.useEffect)((()=>{e.connectionInfo&&e.conversation.onConnection((({connected:t})=>{if(!t)return!1;const{channel:n}=e.conversation,o=e=>{const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:o}=t;!n&&"string"!=typeof o&&(null==o?void 0:o.name)&&r(_o(o.name)),r(Ao({participant:o,fromClient:n})),"string"!=typeof o&&o.introduction&&r(ao(Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},t),{type:"participant"})})))};return n.onMessage=(e,t)=>{const n={type:e,payload:t};switch(e){case"ui":switch(t.state&&t.state.hasOwnProperty("loading")&&r(To(t.state.loading)),t.type){case"idle_detach_countdown":s(t.body.duration);break;case"idle_detach_countdown_elapsed":c(void 0,!0);break;case"resume_conversation_prompt":r(mo());break;case"translation_proposal":r(Ri(t.body));break;case"user_first_response":r(Wr(!0)),i.emit("system.userFirstResponse",t.body)}break;case"message":switch(o(t),t.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"cta":case"custom":case"carousel":case"card":t.service&&t.service.serviceSessionId&&r(wo(t.service.serviceSessionId)),r(ao(n))}break;case"participant":o(n);break;case"service_data":t.persist&&r(Io(t));break;case"ack":r(io(n));break;case"system":if("service_changed"===t.type){const{serviceSettings:e}=t,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["serviceSettings"]),{entry:o}=e,{upload:i}=o.options;r(xo({key:j,enabled:!(!i||!i.enabled)})),r(Ro(o)),t.serviceSessionId&&r(wo(t.serviceSessionId)),l("system.serviceChanged",n)}break;case"info":"divider"!==t.type&&"text"!==t.type&&"translation"!==t.type||r(ao(n));break;case"error":switch(t.type){case"find_conversation_erred":const e=new M(n);r(Xr({name:e.name,action:e.action,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError}));break;case"conversation_erred":const t=new D(n);r(Xr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError,action:t.action}))}}return t},!0}))}),[e,e.connectionInfo,e.conversation.channel,r,l,c,i,s]),(0,Qe.useEffect)((()=>e.connectionInfo?(e.conversation.onConnection((({connected:t})=>{if(!t)return!1;const{channel:r}=e.conversation;return n.current=r.on("message",(e=>ll.includes(e.type)?(e.id!==a.current&&i.emit("message",e),a.current=e.id,e):e)),!0})),()=>{var t;null===(t=e.conversation.channel)||void 0===t||t.off("message",n.current)}):()=>{}),[e,e.connectionInfo,e.conversation.channel,i]),(0,Qe.useEffect)((()=>e.connectionInfo?(e.conversation.onConnection((({connected:n})=>!!n&&(t.current=e.conversation.channel.on("sync",(t=>{var n;const i=o[o.length-1],a=null===(n=null==t?void 0:t.lastEvent)||void 0===n?void 0:n.id;return i&&a===i.payload.id?t:e.getConversation().then((e=>{e&&r(Co(e))})).catch((e=>{r(Xr({name:null==e?void 0:e.name,message:null==e?void 0:e.message,langKey:null==e?void 0:e.langKey,action:null==e?void 0:e.action,originalEvent:null==e?void 0:e.originalEvent,originalError:null==e?void 0:e.originalError}))}))})),!0))),()=>{var n;null===(n=e.conversation.channel)||void 0===n||n.off("sync",t.current)}):()=>{}),[e,e.connectionInfo,e.conversation.channel,o,r]),null},pl=({children:e})=>{const{t}=ya(),n=mt(),r=Vi(),{addUploadBubble:o}=Xi();return(0,k.jsx)(Ea.Provider,{value:e=>{const i=J(),a=r.uploadFile(e,(e=>{n(Lo({fileId:i,progress:Math.ceil(e)}))}),(e=>{const{id:t,transactionId:r,occurredAt:a,body:{contentType:s,filename:c,filesize:l,url:u}}=e.body;n(Do(i)),o(t,r,a,s,c,l,u)}),(e=>{let r;switch(e&&e.body?e.body.error:""){case"file_uploads_are_disabled":r=t("fileUpload.errors.unavailable");break;case"request_entity_too_large":r=t("fileUpload.errors.tooLarge");break;case"file_has_invalid_mime_type":r=t("fileUpload.errors.wrongType");break;case"virus_found":r=t("fileUpload.errors.virusFound");break;default:r=t("fileUpload.errors.general")}n(Mo({fileId:i,errorText:r}))}));n(bo({fileId:i,fileName:e.name,uploadHandle:a}))},children:e})},dl=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=za();return((e,t)=>{const n=(0,Qe.useRef)(e);(0,Qe.useEffect)((()=>{n.current=e}),[e]),(0,Qe.useEffect)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n>0?1e3:null),null},fl=()=>{const{initUserSelectedOptions:e}=Da(),t=(0,Qe.useRef)(!1),n=xr();return(0,Qe.useEffect)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null},hl=wr((({interrupt:e})=>e),(({error:e})=>e));function yl(){const{t:e}=ya(),t=ct(hl);return{hasInterrupt:Boolean(t),meta:(0,Qe.useMemo)((()=>{if(!t)return{};const{langKey:n,action:r}=t,o=e(`${n}.title`),i=e(`${n}.message`),a=e(`${n}.srText`),s=e(`${n}.buttonText`);return Object.assign(Object.assign(Object.assign(Object.assign({},n?{title:o,message:i,srText:a}:{}),r?{action:r}:{}),r&&n?{buttonText:s}:{}),{originalError:t})}),[e,t]),error:t}}function ml(e,t,n=[]){const r=(0,Qe.useContext)(gt),o=(0,Qe.useRef)();o.current=t,(0,Qe.useEffect)((()=>{if(!n.every(Boolean))return;const t=(...e)=>o.current?.(...e);return r.emit("function.register",e,t),()=>r.emit("function.unregister",e,t)}),[r,e,...n])}const bl=()=>{const e=xr(),{sendMessage:t,sendContext:n,sendAction:r}=Xi(),o=mt(),{setVisibility:i,visible:a}=zi(),s=(0,Qe.useRef)(a),c=(0,Qe.useContext)(gt),l=Vi(),u=kr(),p=(0,Qe.useRef)(null),d=(0,Qe.useRef)(null),{isInline:h,isResolving:y}=Rr(),{hasInterrupt:m}=yl(),b=(()=>{const{get:e}=qi();return e?e("conversationUrl"):null})(),v=(0,Qe.useRef)(null),g=Ua(),{enableTranslations:w,disableTranslations:j}=Wa();return(0,Qe.useEffect)((()=>{s.current=a}),[a]),ml("askText",(e=>{t({body:e})}),[l?.send]),ml("setVariables",(e=>{n({variables:e})}),[l?.send]),ml("getVisibility",(e=>{e?e(s.current):console.warn("A callback function is required for the getVisibility action.")})),ml("setVisibility",(e=>{Object.values(S).includes(e)?(g(),i(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[e?.api]),ml("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[l.send]),ml("setTopic",(({name:e,fallbackMessage:t,userTriggered:n})=>{n&&o(Jo({showSuggestions:!1})),e&&t?r({type:f,body:{name:e,fallbackMessage:t,participant:n?P:void 0}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[l.send]),ml("setTranslation",(({enabled:e,locale:t})=>{e?w(t,"window_api"):j()}),[l.send]),(0,Qe.useEffect)((()=>{y||m||(v.current&&v.current!==b&&c.emit("unreadMessageCount",u),a===S.open&&a!==d.current&&0!==p.current&&c.emit("unreadMessageCount",0),a!==S.open&&u!==p.current&&c.emit("unreadMessageCount",u),d.current=a,p.current=u,v.current=b)}),[u,a,c,h,y,m,b]),null},vl=({children:e})=>{const t=(0,Qe.useContext)(gt),[n,r]=(0,Qe.useState)({}),o=(0,Qe.useRef)(!0),i=(0,Qe.useCallback)((e=>{o.current&&(r(e),t.emit("aria-live",e))}),[r,t]);(0,Qe.useEffect)((()=>{let e=null;return n&&n.messageText&&(e=setTimeout((()=>{i({}),clearTimeout(e)}),500)),()=>{clearTimeout(e)}}),[n,i]),(0,Qe.useEffect)((()=>()=>{o.current=!1}),[]);const{ariaLive:a,messageText:s}=n;return(0,k.jsxs)(ma.Provider,{value:i,children:[e,(0,k.jsxs)("div",{className:T("app__live-container"),children:[(0,k.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:T("visually-hidden"),children:a===v?s:null}),(0,k.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:T("visually-hidden"),children:a===g?s:null})]})]})},gl=()=>{const{t:e}=ya(),t=Pr(),n=(0,Qe.useRef)(0),r=(0,Qe.useRef)(0),o=_r().historyLoaded,{sendPolite:i}=ba(),{isOpen:a}=zi(),s=(0,Qe.useRef)(null),c=(0,Qe.useRef)(null),l=(0,Qe.useMemo)((()=>U((t=>{const n=t.filter((({payload:e})=>!e.fromClient&&!e.fromHistory)).length;n>r.current&&(i(e("message.srNewEventCount",{newCount:n-r.current})),r.current=n)}),1e3)),[i,e]);return(0,Qe.useEffect)((()=>{t.length>n.current&&(a&&(c.current=l(t)),n.current=t.length)}),[t,l,a]),(0,Qe.useEffect)((()=>{s.current&&!a&&c.current&&(c.current(!0),c.current=null)}),[a]),(0,Qe.useEffect)((()=>{o&&setTimeout((()=>{i(e("window.srTexts.onHistoryLoad"))}),500)}),[o,e,i]),null},wl=()=>{const{t:e}=ya(),{isOpen:t,isVisible:n}=zi(),r=kr(),{sendPolite:o}=ba(),i=(0,Qe.useMemo)((()=>U(o,2e3)),[o]),a=(0,Qe.useRef)(null),s=(0,Qe.useRef)(null);return(0,Qe.useEffect)((()=>{a.current!==n&&!n&&s.current&&s.current(),0!==r&&!t&&n&&(s.current=i(e("message.srTextUnreadCount",{unreadCount:r}))),a.current=n}),[r,t,n,i,e]),null},jl=({store:e,children:t,eventBus:n,api:r})=>((0,Qe.useErrorBoundary)((t=>{e.dispatch(ei(t))})),(0,k.jsx)(dt,Object.assign({store:e},{children:(0,k.jsx)(gt.Provider,Object.assign({value:n},{children:(0,k.jsx)(vt.Provider,Object.assign({value:r},{children:(0,k.jsx)(vl,{children:(0,k.jsx)(va,{children:(0,k.jsxs)(sl,{children:[(0,k.jsx)(fl,{}),(0,k.jsx)(ul,{}),(0,k.jsx)(wl,{}),(0,k.jsx)(gl,{}),(0,k.jsx)(dl,{}),(0,k.jsxs)(cl,{children:[(0,k.jsx)(bl,{}),(0,k.jsx)(pl,{children:t})]})]})})})}))}))}))),Ol=()=>{const{t:e}=ya(),{showDisclaimer:t}=xr();return t&&(0,k.jsxs)("div",{className:T("disclaimer"),tabIndex:"0",children:[(0,k.jsx)("h2",{className:T("disclaimer__title"),children:e("disclaimer.title")}),(0,k.jsx)("div",{className:T("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]})},xl=require("preact/compat"),Sl=(0,Xe.createContext)(null),_l=e=>{const t=(0,Qe.useContext)(ga),n=t[e.type];let r=n[e.payload.type],o=null;return"choice_prompt"===e.payload.type&&(o=n[e.payload.body.prompt.type]),"participant"===e.type&&(r=n[e.type]),r&&"function"!=typeof r&&(r=r[e.payload.body.type]),[r||t.fallback,o]},El=({event:e,newParticipant:t})=>{const{eventRefs:n,unreadIds:r}=(0,xl.useContext)(Sl),{sendAction:o}=Xi(),i=n[e.payload.id],{containerRef:a,isVisible:s}=Hi({containerRef:i,freezeOnceVisible:!0}),c=mt(),[l,p]=_l(e);if((0,xl.useEffect)((()=>{if(s&&(null==r?void 0:r.includes(e.payload.id))){const t=r.reduce(((t,n)=>t.includes(e.payload.id)?t:t.concat(n)),[]);c(Oo(t)),o({type:u,events:t})}}),[c,e.payload.id,s,o,r]),!l)return null;const d=["conversation__item"];return"info"===e.type?d.push("conversation__item--source-info"):e.payload.fromClient?d.push("conversation__item--source-user"):d.push("conversation__item--source-agent"),t&&d.push("conversation__item--new-participant"),(0,k.jsxs)("li",Object.assign({className:T(d),ref:a},{children:[e.timeIndicator&&(0,k.jsx)(Ks,{event:e}),(0,k.jsx)(l,Object.assign({event:e},{children:(0,k.jsx)(p,{event:e})}))]}))},Cl=()=>{const{id:e}=Ir()||{};return(0,k.jsx)("li",{className:T("conversation__item","conversation__item--source-agent"),children:(0,k.jsxs)("div",{className:T("message","message--source-agent","message--type-loading"),children:[(0,k.jsx)(Xa,{eventPayload:{fromClient:!1,participant:e}}),(0,k.jsx)("div",{className:T("message__body"),children:(0,k.jsxs)("span",{className:T("loader"),children:[(0,k.jsx)("span",{className:T("loader__part","one")}),(0,k.jsx)("span",{className:T("loader__part","two")}),(0,k.jsx)("span",{className:T("loader__part","three")}),(0,k.jsx)("span",{className:T("loader__part","four")})]})})]})})},Pl=()=>{const e=Pr();let t=null;return(0,k.jsx)(k.Fragment,{children:e.map((e=>{const{type:n,payload:r}=e;let o=!1;if("participant"!==n&&"service_data"!==n){const{participant:n,fromClient:i}=r,a=i?"seamly-client-participant":n;"info"!==e.type&&t!==a&&(o=!0),t=a}return(0,k.jsx)(El,{event:e,newParticipant:o},e.payload.key||e.payload.id)}))})},Tl=()=>{const{t:e}=ya(),t=Tr(),{isOpen:n}=zi(),r=Ar(),o=_a();return(0,k.jsxs)(k.Fragment,{children:[n&&(0,k.jsx)("a",Object.assign({className:T("skip-link"),href:`#${r}`,onClick:e=>{e.preventDefault(),o()}},{children:e("skiplinkText")})),(0,k.jsx)("div",Object.assign({className:T("chat__body")},{children:(0,k.jsxs)("div",Object.assign({className:T("conversation__container")},{children:[(0,k.jsx)(Ol,{}),(0,k.jsxs)("ol",Object.assign({className:T("conversation")},{children:[(0,k.jsx)(sl,{children:(0,k.jsx)(Pl,{})}),t&&(0,k.jsx)(Cl,{})]}))]}))}))]})},kl={visible:T("transition--visible"),in:T("transition--in"),visuallyHidden:T("visually-hidden")},Al=Object.values(kl),Nl="notRendered",Il="rendered",Rl="visuallyHidden",Dl=({children:e,isActive:t,timeout:n=300,transitionStartState:r=Nl,onInTransitionComplete:o=(()=>{}),onOutTransitionComplete:i=(()=>{})})=>{const a=(0,Qe.useRef)(!1),s=parseInt(n,10),c=qa(o),l=qa(i),u=r===Rl,[p,d]=(0,Qe.useState)((()=>u?[kl.visuallyHidden]:[])),f="notRendered"!==r||p.length>0;return(0,Qe.useEffect)((()=>{let e=null,n=null;return a.current&&!t&&(d([kl.visible]),e=setTimeout((()=>{d([...u?[kl.visuallyHidden]:[]]),l&&(n=requestAnimationFrame((()=>{l()})))}),s)),!a.current&&t&&(d([kl.visible]),n=requestAnimationFrame((()=>{n=requestAnimationFrame((()=>{d([kl.visible,kl.in]),c&&(e=setTimeout((()=>{c()}),s))}))}))),a.current=t,()=>{clearTimeout(e),cancelAnimationFrame(n)}}),[t,u,s,c,l]),(0,k.jsx)(k.Fragment,{children:f&&(0,Xe.toChildArray)(e).map((e=>{const{className:t=""}=e.props,n=t.split(" ").filter((e=>!Al.includes(e)));return(0,Xe.cloneElement)(e,{className:[...n,...p].join(" ")})}))})},Ml=({isAside:e=!1})=>{const{isInline:t}=Rr(),{t:n}=ya(),{sendAction:r,addMessageBubble:o}=Xi(),{isOpen:i,setVisibility:a}=zi(),{showSuggestions:s}=xr(),l=Va(),u=_a(),p=(0,Qe.useRef)(null),{sendPolite:d}=ba(),{hasInterrupt:f}=yl(),{hasCountdown:h,endCountdown:y}=za(),{hasPrompt:m,continueChat:b}=Ha(),v=Hr(),g=("suggestion",_r().serviceData.suggestion);const{body:w}=Ga({payload:g}),j=(0,Qe.useMemo)((()=>g&&!f?w:[]),[g,f,w]),O=(0,Qe.useRef)(null),x=(0,Qe.useRef)(!1),_=(0,Qe.useRef)([]),E=!!j.length,C=t?(v||i)&&!e:v,P=(0,Qe.useRef)(C),A=E&&!C&&s,N=E?j:_.current;_.current=N;const I=(0,Qe.useMemo)((()=>{const t=["suggestions"];return e&&t.push("suggestions--aside"),T(t)}),[e]),R=(0,Qe.useCallback)((({id:e,question:t})=>{h&&y(!0),m&&b(),r({type:c,originMessage:g.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),o(t),i||a(S.open),u()}),[o,b,y,u,h,m,g,r,a,i]);(0,Qe.useEffect)((()=>{if(O.current!==j&&!C){if(E){const e=x.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout((()=>{d(e)}),30)}else x.current&&d(n("suggestions.srUnavailableText"));O.current=j}!P.current&&C?(W(p.current,u),d(n("suggestions.srUnavailableText"))):!E&&x.current&&W(p.current,u),x.current=E,P.current=C}),[j,E,C,u,d,n]);const D=n("suggestions.headingText"),M=n("suggestions.footerText"),L=D?"section":"div";return(0,k.jsx)(Dl,{isActive:A,transitionStartState:Nl,children:(0,k.jsxs)(L,{className:I,"aria-labelledby":D?l:null,ref:p,children:[D&&(0,k.jsx)("p",{id:l,className:T("suggestions__heading"),children:D}),!!N.length&&(0,k.jsx)(As,{suggestions:N,onClickSuggestion:R}),M&&!i&&(0,k.jsx)("p",{className:T("suggestions__footer"),children:M})]})})},Ll=(0,xl.forwardRef)((({children:e,className:t=""},n)=>{const{isOpen:r,isVisible:o,setVisibility:i}=zi(),{namespace:a,layoutMode:s}=xr(),{isInline:c}=Rr(),l=wa(),u=Hr(),{t:p}=ya(),d=["chat",`chat--layout-${s}`,`namespace--${a}`,...l,t];return r||"app"===s||d.push("chat--collapsed"),u&&d.push("chat--user-responded"),o&&(0,k.jsxs)("section",{className:T(d),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!c&&r&&i(S.minimized)},tabIndex:"-1",ref:n,"aria-label":p("chat.srLabel"),children:[(0,k.jsx)("div",{className:T("chat-wrapper"),children:e}),"inline"===s&&r&&(0,k.jsx)(Ml,{isAside:!0})]})})),Ul=Ll,Fl=({className:e,children:t,onCancel:n,headingText:r,description:o,descriptionId:i,cancelButtonText:a,cancelButtonRef:s,disableButtonFocusing:c,position:l={horizontal:"left",vertical:"top"}})=>{const u=Va(),{hideOption:p}=Da(),{focusButton:d}=Ma(),f=(0,Qe.useCallback)((()=>{p(),c||d()}),[c,d,p]),h=(0,Qe.useCallback)((()=>{n&&n(),f()}),[f,n]),y=(e=>{const t=(0,Qe.useRef)(null);return(0,Qe.useEffect)((()=>{const n=({target:n})=>{t.current&&n instanceof HTMLElement&&!t.current.contains(n)&&e()};return document.addEventListener("click",n,!0),document.addEventListener("touchstart",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("touchstart",n,!0)}}),[e,t]),t})(h);return(0,Qe.useEffect)((()=>{q(y.current)}),[y]),(0,k.jsx)("section",Object.assign({className:T("options",{"options--right":"right"===l.horizontal,"options--left":"left"===l.horizontal,"options--top":"top"===l.vertical,"options--bottom":"bottom"===l.vertical},e),"aria-labelledby":u,tabIndex:-1,ref:y},{children:(0,k.jsxs)("div",Object.assign({className:T("options__body")},{children:[(0,k.jsx)("h2",Object.assign({id:u,className:T("options__title")},{children:r})),(0,k.jsxs)("button",Object.assign({type:"button",onClick:h,"aria-describedby":u,className:T("button","options__close"),ref:e=>{s&&(s.current=e)}},{children:[(0,k.jsx)(hs,{name:"close",size:"16",alt:""}),(0,k.jsx)("span",{children:a})]})),o?(0,k.jsx)("p",Object.assign({className:T("options__description"),id:i},{children:o})):null,(0,k.jsx)("div",Object.assign({className:T("options__wrapper")},{children:t}))]}))}))},Bl=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),$l=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},zl=e=>!!e?.length>0,Hl=e=>{const t=e&&e.trim();return!(!t||!t.match(/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i))},Vl=e=>!!e,ql=(0,Xe.createContext)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),Wl=ql,{Provider:Gl,Consumer:Kl}=ql,Jl=wr((({forms:e})=>e),((e,{formId:t})=>t),((e,t)=>e[t])),Xl=wr(Jl,(e=>(null==e?void 0:e.controls)||{})),Ql=wr(Xl,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),Yl=wr(Xl,((e,{name:t})=>t),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.value})),Zl=wr(Xl,((e,{name:t})=>t),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.touched}));function eu(){return(0,Qe.useContext)(Wl)}function tu(e){const t=mt(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:i}=eu(),a=!!ct((e=>Jl(e,{formId:n}))),s=ct((t=>Yl(t,{formId:n,name:e}))),c=ct((t=>Zl(t,{formId:n,name:e}))),l=null==i?void 0:i[e],u=!l;(0,Qe.useEffect)((()=>{a&&t(ci({formId:n,name:e}))}),[a,n,e,t]),(0,Qe.useLayoutEffect)((()=>()=>{t(li({formId:n,name:e}))}),[a,n,e,t]);const p=(0,Qe.useCallback)((t=>r(e,t.target.value)),[e,r]),d=(0,Qe.useCallback)((()=>{o(e,!0)}),[o,e]);return[(0,Qe.useMemo)((()=>({name:e,onInput:p,onBlur:d,value:s})),[e,p,d,s]),(0,Qe.useMemo)((()=>({isValid:u,error:l,touched:c})),[u,l,c])]}function nu(e){var{children:t,formId:n,persistData:r,onError:o,onSubmit:i,validationSchema:a}=e,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children","formId","persistData","onError","onSubmit","validationSchema"]);const c=mt(),l=ct((e=>Ql(e,{formId:n}))),[u,p]=(0,Qe.useState)(!1),[d,f]=(0,Qe.useState)({}),{isValid:h,errors:y}=function(e,t){const n=(0,Qe.useMemo)((()=>function(e,t={}){return Object.entries(t).reduce(((t,[n,r])=>{var o;const i=Array.isArray(r)?r:[r];for(let r=0;null!==(o=r<(null==i?void 0:i.length))&&void 0!==o&&o;r++)if(!i[r].fn(e[n],i[r].compareValue)){t[n]=i[r].errorText;break}return t}),{})}(e,t)),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(l,a),m=(0,Qe.useMemo)((()=>Object.assign(Object.assign({},y),d)),[y,d]);(0,Qe.useLayoutEffect)((()=>{c(ai({formId:n,persistData:r}))}),[n,r,c]),(0,Qe.useEffect)((()=>()=>{c(si({formId:n}))}),[n,r,c]);const b=(0,Qe.useCallback)(((e,t)=>{c(ui({formId:n,name:e,value:t}))}),[n,c]),v=(0,Qe.useCallback)(((e,t)=>{c(pi({formId:n,name:e,touched:t}))}),[c,n]),g=(0,Qe.useCallback)(((e,t)=>{f((n=>Object.assign(Object.assign({},n),{[e]:t})))}),[f]),w=(0,Qe.useCallback)((e=>{var t;e.preventDefault();const n="true"===(null===(t=e.submitter)||void 0===t?void 0:t.ariaDisabled);p(!n),!n&&h&&(c(Wr(!0)),i(l,{updateControlValue:b,setError:g}))}),[h,c,i,l,b,g]);(0,Qe.useEffect)((()=>{o&&o({errors:m,isSubmitted:u,isValid:0===Object.keys(m).length})}),[u,m,o]);const j=(0,Qe.useMemo)((()=>({formId:n,values:l,errors:m,isValid:0===Object.keys(m).length,isSubmitted:u,handleSubmit:w,validationSchema:a,updateControlValue:b,updateControlTouched:v})),[n,l,m,u,w,a,b,v]);return n?i?(0,k.jsx)(Gl,Object.assign({},s,{value:j},{children:t})):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)}const ru=["className","disableValidationClasses"];function ou(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function iu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const au=function(e){let{className:t,disableValidationClasses:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ru);const{handleSubmit:o,isValid:i,isSubmitted:a}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=eu();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),s=["form"];return!n&&a&&(s.push("form--submitted"),i?s.push("form--valid"):s.push("form--invalid")),(0,k.jsx)("form",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ou(Object(n),!0).forEach((function(t){iu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ou(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({onSubmit:o,className:T([...s,t])},r))};function su({id:e,error:t}){const[n,r]=(0,Qe.useState)(!1);return(0,Qe.useEffect)((()=>{const e=setTimeout((()=>r(!0)),300);return()=>clearTimeout(e)}),[]),(0,k.jsx)("div",{className:T("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&(0,k.jsxs)("span",{id:e,className:T("error__message"),children:[(0,k.jsx)(hs,{name:"error",size:"16"}),t]})})}const cu=({contentHint:e,id:t,labelText:n,labelClass:r=T("label"),validity:o,errorText:i,children:a})=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("label",{htmlFor:t,className:r,children:n}),e&&(0,k.jsx)("span",{id:`${t}-content-hint`,className:T("input__content-hint"),children:e}),(0,k.jsx)(su,{id:`${t}-error`,error:!o&&i}),a]}),lu=["id","name","type","labelText","labelClass","contentHint","aria-describedby"];function uu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uu(Object(n),!0).forEach((function(t){du(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function du(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fu=function(e){let{id:t,name:n,type:r,labelText:o,labelClass:i,contentHint:a,"aria-describedby":s}=e,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,lu);const{isSubmitted:l}=eu(),[u,{error:p}]=tu(n),d=l&&p,f=[];return s&&f.push(s),a&&f.push(`${t}-content-hint`),d&&f.push(`${t}-error`),(0,k.jsx)(cu,{id:t,contentHint:a,validity:!d,errorText:p,labelText:o,labelClass:i,children:(0,k.jsx)("input",pu(pu({id:t,name:n,type:r,"aria-invalid":d?"true":"false","aria-describedby":f.join(" ")||null},u),c))})};function hu({controlName:e,describedById:t}){const{t:n}=ya();return(0,k.jsxs)(au,{noValidate:"true",className:T("options__form"),children:[(0,k.jsx)(fu,{name:e,type:"email",className:T("transcript__input"),"aria-describedby":t,labelClass:T("label"),labelText:n("options.sendTranscript.label")}),(0,k.jsx)("div",{className:T("options__actions"),children:(0,k.jsx)("button",{type:"submit",className:T("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const yu="email",mu={sendTranscript:()=>{const[e,t]=(0,Qe.useState)(void 0),{hideOption:n}=Da(),{focusButton:r}=Ma(),{t:o}=ya(),i=Va(),{sendAction:a}=Xi(),s=(0,Qe.useMemo)((()=>({[yu]:[Bl(Vl,o("options.sendTranscript.noEmailText")),Bl(Hl,o("options.sendTranscript.invalidEmailText"))]})),[o]),c=(0,Qe.useCallback)((e=>{const t=e[yu].trim();a({type:"send_transcript",body:{emailAddress:t}}),n(),r()}),[a,n,r]),l=(0,Qe.useCallback)((({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)}),[t]);return(0,k.jsx)(Fl,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),description:o("options.sendTranscript.description"),descriptionId:i,position:{vertical:"top",horizontal:"right"},children:(0,k.jsx)(nu,{formId:"sendTranscript",onSubmit:c,validationSchema:s,onError:l,children:(0,k.jsx)(hu,{controlName:yu,describedById:i})})})}},bu=()=>{const{optionActive:e}=Da(),t=(0,Qe.useRef)(null),n=mu[e||t.current];return e&&(t.current=e),n?(0,k.jsx)(n,{}):null},vu=()=>{const{t:e}=ya(),{menuOptions:t,showOption:n,panelActive:r,hideOption:o}=Da(),{id:i}=Ma(),a=(0,Qe.useRef)(null),[s,c]=(0,Qe.useState)(!1),l=(0,Qe.useRef)(null),u=t.length,p=(0,Qe.useRef)(Array.from({length:u},(()=>(0,Xe.createRef)()))),d=(0,Qe.useRef)(!1),f=u>1,h=t[0],y=(0,Qe.useMemo)((()=>h?.name?.trim().replace(/\s+/g,"")),[h]);return(0,Qe.useEffect)((()=>()=>{clearTimeout(a.current)}),[]),(0,Qe.useEffect)((()=>{s&&!d.current&&requestAnimationFrame((async()=>{await Oa(60);const e=t.findIndex((e=>e.available)),n=-1===e?0:e;q(p.current[n])})),d.current=s}),[s,t]),u?(0,k.jsxs)("div",{className:T("options__container"),onKeyDown:e=>{s&&(V(e)===H.Escape&&(c(!1),q(l.current)),V(e)===H.Home&&(q(p.current[0]),e.preventDefault()),V(e)===H.End&&(q(p.current[u-1]),e.preventDefault()))},onfocusout:()=>{f&&(a.current=setTimeout((()=>{c(!1)}),200))},onfocusin:()=>{clearTimeout(a.current)},children:[(0,k.jsx)(Dl,{transitionStartState:Nl,isActive:r,children:(0,k.jsx)("div",{className:T("options__dialog"),children:(0,k.jsx)(bu,{})})}),f&&(0,k.jsx)(Dl,{isActive:s,transitionStartState:Nl,children:(0,k.jsx)("ul",{className:T(["options__menu"]),role:"menu",tabIndex:"-1","aria-labelledby":i,children:t.map((({name:r,title:o,available:i},a)=>(0,k.jsx)("li",{className:T("options__menu__item"),role:"menuitem","data-testid":r,children:(0,k.jsxs)("button",{type:"button",ref:e=>{p.current[a]=e},className:T(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(V(e)===H.ArrowDown){const n=Math.min(u-1,t+1);q(p.current[t===n?0:n]),e.preventDefault()}if(V(e)===H.ArrowUp){const n=Math.max(0,t-1);q(p.current[t===n?u-1:n]),e.preventDefault()}})(e,a),onKeyPress:e=>((e,n)=>{const r=String.fromCharCode(e.charCode);if(1!==r.length||!r.match(/\S/))return;let o=-1;t.forEach(((e,t)=>{t>n&&e.title.charAt(0).toLowerCase()===r.toLowerCase()&&-1===o&&(o=t)})),-1!==o&&q(p.current[o])})(e,a),onClick:()=>((e,t)=>{t&&(c(!1),n(e))})(r,i),"aria-disabled":i?null:"true",children:[(0,k.jsxs)("span",{className:T("button__text"),children:[o,!i&&" "]}),!i&&(0,k.jsx)("span",{className:T("button__state"),children:e("options.unavailableText")})]})},r)))})}),(0,k.jsxs)("button",{type:"button",className:T(["button","button--secondary","chat__options__button",...!f&&y?[`chat__options__button--${y}`]:[]]),id:i,onClick:()=>{r&&o(),f?c((e=>!e)):h.available&&!r&&n(h.name)},onKeyDown:f?e=>{V(e)===H.ArrowDown&&(c(!0),e.preventDefault())}:null,ref:l,"aria-haspopup":f?"menu":null,"aria-expanded":f?s.toString():null,"aria-disabled":f||h.available?null:"true",children:[f&&(0,k.jsx)(hs,{name:"options",size:"32"}),(0,k.jsx)("span",{className:T("button__text"),children:f?e("options.openButtonText"):`${h.title}${h.available?"":" "}`}),!f&&!h.available&&(0,k.jsx)("span",{className:T("button__state"),children:e("options.unavailableText")})]})]}):null},gu=({label:e,checked:t,description:n,onChange:r,id:o})=>(0,k.jsxs)("li",Object.assign({className:T("translation-options__item"),"aria-selected":t,role:"option",tabIndex:0,onClick:r,onKeyDown:e=>{"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),r())},id:o},{children:[(0,k.jsx)(hs,{alt:"",name:"check",size:"16"}),e," ",n&&(0,k.jsxs)("span",{children:["(",n,")"]})]})),wu=({onChange:e,describedById:t})=>{const{context:{locale:n}}=xr(),{t:r}=ya(),{focusContainer:o}=Ka(),{languages:i,currentLocale:a,enableTranslations:s,disableTranslations:c}=Wa(),l=({locale:t})=>()=>{t===a||n===t?c():s(t),e(),o()},u=(0,Qe.useMemo)((()=>[...i].sort(((e,t)=>e.locale===n?-1:t.locale===n?1:e.nativeName.localeCompare(t.nativeName,void 0,{sensitivity:"base"})))),[i,n]);return(0,k.jsx)("ul",Object.assign({"aria-describedby":t,role:"listbox",tabIndex:-1,className:T("translation-options")},{children:u.map(((e,t)=>{const n=0===t,o=a===e.locale||!a&&n;return(0,k.jsx)(gu,{id:e.locale,label:e.nativeName,checked:o,description:n&&r("translations.settings.original"),onChange:l(e)},e.locale)}))}))},ju=function({onClose:e,position:t}){const{t:n}=ya(),r=Va();return(0,k.jsx)(Fl,Object.assign({onCancel:e,headingText:n("translations.menu.title"),cancelButtonText:n("translations.settings.cancelButtonText"),description:n("translations.menu.description"),descriptionId:r,position:t,disableButtonFocusing:!0},{children:(0,k.jsx)(wu,{describedById:r,onChange:e})}))};function Ou({children:e,position:t={horizontal:"left",vertical:"top"},classNames:n}){const[r,o]=(0,Qe.useState)(!1),i=(0,Qe.useRef)(null),a=Va();return(0,k.jsxs)("div",Object.assign({className:T("translations__container"),onKeyDown:e=>{r&&V(e)===H.Escape&&(o(!1),q(i.current))}},{children:[(0,k.jsx)(Dl,Object.assign({onOutTransitionComplete:()=>{},onInTransitionComplete:()=>{},timeout:0,transitionStartState:Nl,isActive:r},{children:(0,k.jsx)("div",Object.assign({className:T("options__dialog"),role:"dialog"},{children:(0,k.jsx)(ju,{onClose:()=>{o(!1)},position:t})}))})),(0,k.jsx)("button",Object.assign({type:"button",className:T(["button","chat__options__button",...n]),id:a,onClick:()=>{o(!r)},onKeyDown:e=>{V(e)===H.ArrowDown&&(o(!0),e.preventDefault())},ref:i,"aria-haspopup":"dialog","aria-expanded":r.toString()},{children:e}))]}))}function xu(){const{menuOptions:e,allowOptionSelection:t}=Da(),{isAvailable:n}=Wa(),{hasInterrupt:r}=yl(),{t:o,locale:i}=ya(),a=Ja(i);if(!n&&(!t||!e.length)||r)return null;const s=o("translations.settings.openButtonText",{hasLanguage:!!a,language:a});return(0,k.jsxs)("div",{className:T("chat__options"),children:[n&&(0,k.jsx)("div",{className:T("chat__options-item","chat__options-item--left"),children:(0,k.jsxs)(Ou,{classNames:["button--secondary"],children:[(0,k.jsx)(hs,{alt:s,name:"newTranslation",size:"16"}),(0,k.jsx)("span",{className:T("button__text"),children:s})]})}),t&&(0,k.jsx)("div",{className:T("chat__options-item","chat__options-item--right"),children:(0,k.jsx)(vu,{})})]})}const Su=()=>{const{scrollToRef:e,unreadIds:t}=(0,Qe.useContext)(Sl),{isMinimized:n}=zi(),{t:r}=ya();return(0,k.jsx)(Dl,Object.assign({isActive:!!t.length&&!n},{children:(0,k.jsx)("div",Object.assign({className:T("unread-messages")},{children:(0,k.jsxs)("button",Object.assign({type:"button",className:T("button","button--primary"),onClick:e},{children:[r("message.unreadMessagesCount",{unreadCount:t.length}),(0,k.jsx)(hs,{name:"chevronDown",size:"32",alt:""})]}))}))}))},_u=wr(Cr,(e=>e.filter((e=>{var t;return Zr(e)&&"service_data"!==e.type&&(null===(t=e.payload)||void 0===t?void 0:t.messageStatus)===a})).map((e=>e.payload.id))));const Eu=e=>{const t=(0,Qe.useRef)(),[n,r]=(0,Qe.useState)(!0),o=ct(_u),i=Pr(),a=Tr(),{isOpen:s}=zi(),c=_r().loadedImageEventIds,l=ct((e=>e.state.isLastEventFromClient));(0,Qe.useEffect)((()=>{const e=t.current,n=()=>{const{scrollHeight:t,scrollTop:n,clientHeight:o}=e,i=Math.abs(t-n-o)>10;r(!i)};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}),[]);const u=(0,Qe.useCallback)((()=>{requestAnimationFrame((()=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){var e,n;yield Oa(30),null===(e=t.current)||void 0===e||e.scrollTo({top:null===(n=t.current)||void 0===n?void 0:n.scrollHeight,left:0,behavior:"auto"})}))))}),[]);return(0,Qe.useEffect)((()=>{l&&u()}),[l,u]),(0,Qe.useEffect)((()=>{n&&u()}),[n,o,i,a,s,c,u]),{containerRef:t,unreadIds:o,scrollToRef:()=>{var n,r;const i=null===(n=e[null==o?void 0:o.at(0)])||void 0===n?void 0:n.current;null===(r=t.current)||void 0===r||r.scrollTo({top:null==i?void 0:i.offsetTop,behavior:"auto",left:0})},scrollToBottom:u}},Cu=({children:e})=>{const t=Pr(),n=(0,Qe.useMemo)((()=>t.reduce(((e,t)=>(e[t.payload.id]=(0,Xe.createRef)(),e)),{})),[t]),{scrollToRef:r,scrollToBottom:o,containerRef:i,unreadIds:a}=Eu(n);return(0,k.jsx)(Sl.Provider,Object.assign({value:{eventRefs:n,unreadIds:a,scrollToRef:r,scrollToBottom:o,containerRef:i}},{children:(0,k.jsxs)("div",Object.assign({className:T("chat__container")},{children:[(0,k.jsx)("div",Object.assign({className:T("chat__container__scroll-area"),ref:i},{children:e})),(0,k.jsx)(Su,{})]}))}))},Pu=({baseClassName:e,children:t,title:n})=>{const r=Ar(),o=Va();return(0,k.jsxs)("section",{id:r,className:T(e),"aria-describedby":o,tabIndex:"-1",children:[(0,k.jsx)("h2",{className:T(`${e}__title`),id:o,children:n}),t]})},Tu=()=>{const{t:e}=ya(),t=_a(),n=Ua(),{emitEvent:r}=Xi(),{isActive:o,remaining:i,timer:a,endCountdown:s}=za(),c=i>0,l=e(c?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,k.jsx)(Pu,{baseClassName:"idle",title:l,children:c&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{className:T("idle__count-container"),children:o&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("span",{className:T("idle__count-text"),children:e("idleDetachWarning.countdownText")}),(0,k.jsx)("span",{className:T("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",a)})]})}),(0,k.jsxs)("div",{className:T("idle__options"),children:[(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{n(),s(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{s(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},ku=()=>{const{t:e}=ya(),t=Ua(),{name:n}=Ir()||{},{continueChat:r,restartChat:o}=Ha();return(0,k.jsx)(Pu,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:(0,k.jsxs)("div",{className:T("prompt__options"),children:[(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:o,children:e("resumeConversationPrompt.detachButton")})]})})};function Au(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Iu=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:o}=_r().entryMeta,i=mt(),a=n||t||e,s=o[a]||r[a]||{},c=(0,Qe.useCallback)((e=>{i(jo(e))}),[i]),l=(0,Qe.useCallback)((e=>{i(go(e))}),[i]),u=(0,Qe.useCallback)((e=>{i(Uo(e))}),[i]),p=(0,Qe.useCallback)((()=>{n?u(null):l(e)}),[n,e,u,l]);return{activeEntry:a,activeEntryOptions:s,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:p,setBlockAutoEntrySwitch:c}};function Ru({controlName:e,skipLinkId:t}){const{t:n}=ya(),{sendAssertive:r}=ba(),{emitEvent:o}=Xi(),i=(()=>{const{sendAction:e}=Xi(),{features:t}=Da(),{typingPeekahead:n}=t||{},r=(0,Qe.useRef)(null),o=(0,Qe.useRef)(null),i=(0,Qe.useRef)(!1),a=(0,Qe.useRef)(null);(0,Qe.useEffect)((()=>()=>{clearInterval(a.current),clearTimeout(r.current),clearTimeout(o.current)}),[]);const s=(t,r)=>{e(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Au(Object(n),!0).forEach((function(t){Nu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Au(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({type:l,state:t},n&&n.enabled?{body:{currentMessage:r}}:{}))};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(i.current=!0,a.current||(s(!0,e.target.value),a.current=setInterval((()=>{i.current?n&&n.enabled&&s(!0,e.target.value):(clearInterval(a.current),a.current=null)}),2e3)),clearTimeout(r.current),clearTimeout(o.current),r.current=setTimeout((()=>{i.current=!1}),300),o.current=setTimeout((()=>{s(!1,e.target.value)}),2e3))}})(),{setBlockAutoEntrySwitch:a}=Iu(),{hasCharacterLimit:s,characterLimit:c,reachedCharacterWarning:u,reachedCharacterLimit:p,remainingChars:d}=function(e){const{t}=ya(),{sendAssertive:n}=ba(),{hasLimit:r,limit:o}=(()=>{const{entryMeta:{options:{text:e},optionsOverride:{text:t}}}=_r(),{limit:n}=t||e||{limit:null};return{hasLimit:null!==n,limit:null!==n?n:null}})(),i=(0,Qe.useMemo)((()=>U(n,300)),[n]),a=(0,Qe.useMemo)((()=>U(((e,n)=>{e&&i(t("input.srCharacterLimitText",{limit:n}))}),300)),[i,t]),[{value:s}]=tu(e),c=r&&s?o-s.length:o,l=!!r&&c<=50,u=!!r&&c<0;return(0,Qe.useEffect)((()=>{a(l,c)}),[l,c,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}(e),[{value:f}]=tu(e),h=!!f,y=(0,Qe.useCallback)((()=>{u&&r(n("input.srCharacterLimitText",{limit:d})),o("ui.inputFocus")}),[n,r,u,d,o]),m=(0,Qe.useMemo)((()=>n("input.inputPlaceholder",{hasLimit:s,limit:s?c:null})),[n,s,c]),b=(0,Qe.useMemo)((()=>n("input.inputLabel",{hasLimit:s,limit:s?c:null})),[n,s,c]);return(0,Qe.useLayoutEffect)((()=>(a(h),()=>{a(!1)})),[a,h]),(0,k.jsxs)(au,{className:T("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,k.jsxs)("div",{className:T(["input--text__container",...u&&!p?["character-warning"]:[],...p?["character-exceeded"]:[]]),children:[(0,k.jsx)(fu,{id:t,type:"text",name:e,className:T("input__text"),autocomplete:"off",placeholder:m,labelText:b,labelClass:T("visually-hidden"),"aria-invalid":s?p:null,onKeyUp:i,onFocus:y}),(0,k.jsx)("div",{className:T("character-count"),children:u&&(0,k.jsx)("span",{children:d})})]}),(0,k.jsx)("button",{className:T("button","input__submit"),type:"submit",onPointerDown:e=>{e.preventDefault()},"aria-disabled":!h||p?"true":null,children:(0,k.jsx)(hs,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}function Du(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Du(Object(n),!0).forEach((function(t){Lu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Du(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Lu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uu(){return Uu=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},Uu.apply(this,arguments)}const Fu="textMessageEntry";function Bu(e){let t=Uu({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));const{isOpen:n,setVisibility:r}=zi(),o=Ar(),i=_a(),{sendMessage:a}=Xi(),s=(0,Qe.useCallback)(((e,{updateControlValue:t})=>{a({body:e[Fu]}),t(Fu,""),i(),n||r(S.open)}),[a,i,n,r]);return(0,k.jsx)(nu,Mu(Mu({},t),{},{formId:"textEntry",persistData:!0,onSubmit:s,children:(0,k.jsx)(Ru,{controlName:Fu,skipLinkId:o})}))}const $u=()=>{const{t:e}=ya(),{currentUploads:t}=Aa();return(0,k.jsx)("div",{className:T("progress"),children:t.map((({id:t,name:n,progress:r,uploading:o,error:i})=>(0,k.jsxs)("div",{className:T("progress_container"),children:[(0,k.jsxs)("div",{className:T("progress__text"),children:[(0,k.jsx)("span",{className:T("progress__text--file-name"),children:n}),(0,k.jsx)("span",{className:T("progress__text--percentage"),children:`${r}%`})]}),(0,k.jsx)(su,{error:i}),(0,k.jsx)("progress",{className:T("progress__bar"),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-label":e("fileUpload.srProgressLabel",{fileName:n}),max:"100","aria-valuenow":r,value:r,"aria-busy":o,children:`${r}%`})]},t)))})};function zu({id:e,name:t,labelText:n,contentHint:r,outputText:o,accept:i}){const{isSubmitted:a}=eu(),[s,c]=(0,Qe.useState)(!1),[{onInput:l,onBlur:u},{error:p}]=tu(t),d=Va(),f=Va(),h=Va(),y=a&&p,m=[h];r&&m.push(f),y&&m.push(d);const b=(0,Qe.useCallback)((()=>{c(!0)}),[c]),v=(0,Qe.useCallback)((()=>{c(!1),u()}),[c,u]),g=(0,Qe.useCallback)((e=>{const t={target:{value:e.target.files}};l(t)}),[l]);return(0,k.jsxs)("div",{className:T("upload__container"),children:[r&&(0,k.jsx)("span",{className:T("upload__content-hint"),id:f,children:r}),(0,k.jsx)(su,{id:d,error:y&&p}),(0,k.jsx)("div",{className:T(["file-upload",...s?["focus-within"]:[]]),children:(0,k.jsxs)("label",{htmlFor:e,className:T("upload__label"),children:[(0,k.jsx)(hs,{name:"upload",size:"32"}),(0,k.jsxs)("div",{children:[(0,k.jsx)("span",{className:T(["upload__label--text"]),children:n}),(0,k.jsx)("input",{id:e,className:T("upload__input"),type:"file",name:t,onChange:g,"aria-invalid":y?"true":"false","aria-describedby":m.join(" "),accept:i||null,onFocus:b,onBlur:v}),(0,k.jsx)("span",{className:T("upload__output"),"aria-hidden":"true",id:h,children:o})]})]})})]})}function Hu({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:o,isComplete:i,onClickCancel:a}){const{t:s}=ya(),[{value:c}]=tu(t),l=c&&c.length>0,u=l?c[0].name:"";return(0,k.jsxs)(au,{className:T("upload-form"),children:[(0,k.jsx)(zu,{name:t,id:e,accept:n,labelText:s("fileUpload.labelText"),outputText:s("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),(0,k.jsxs)("div",{className:T("upload__button-container"),children:[(0,k.jsx)("button",{id:o||!i?e:void 0,type:"button",onClick:a,className:T("button","button--secondary","upload__cancel"),children:s("fileUpload.cancelButtonText")}),(0,k.jsx)("button",{className:T("button","button--primary"),type:"submit",children:s("fileUpload.uploadButtonText")})]})]})}const Vu="fileListForm",qu="fileList",Wu=()=>{const{t:e}=ya(),{sendPolite:t,sendAssertive:n}=ba(),r=Ar(),o=_a(),{serviceAllowsUploads:i,allowedMimeTypes:a,maxSize:s}=ka(),c=(0,Qe.useRef)(null),l=(0,Qe.useRef)(i),{cancelEntrySelection:u}=Iu(),{uploadFile:p,clearUploads:d,isUploading:f,isComplete:h}=Aa(),{hasFile:y,selectedFileName:m,uploadHandle:b,hasServerError:v,progress:g}=((e,t)=>{const n=ct((n=>Yl(n,{formId:e,name:t}))),{currentUploads:r}=Aa(),o=n&&n.length>0;let i=null,a=!1,s=0;if(r&&r.length>0){const e=r[0];i=e.uploadHandle,a=!!e.error,s=e.progress}return{hasFile:o,selectedFileName:o?n[0].name:"",uploadHandle:i,hasServerError:a,progress:s}})(Vu,qu),w=Va(),j=(0,Qe.useRef)(!0),O=e("fileUpload.contentHint",{size:$(s)}),x=(0,Qe.useRef)(""),S=(0,Qe.useRef)(null);(0,Qe.useEffect)((()=>{x.current&&S.current?.contains(document.activeElement)&&"INPUT"===document.activeElement.tagName&&n(O),x.current=O}),[O,n]),(0,Qe.useEffect)((()=>{g>0&&t(1===g?e("fileUpload.srStartedText"):`${g}%`)}),[g,t,e]),(0,Qe.useEffect)((()=>{j.current||f||!h||(d(),u(),o(),setTimeout((()=>{t(e("fileUpload.srCompleteText"))}),300)),j.current=h}),[f,h,d,u,o,t,e]);const _=(0,Qe.useCallback)((({fileList:e})=>{p(e[0]),o()}),[p,!1,o]),E=(0,Qe.useCallback)((()=>{b&&b.abort(),d(),u(),o()}),[b,d,u,o]),C=(0,Qe.useMemo)((()=>({[qu]:[Bl((()=>i),e("fileUpload.errors.unavailable")),Bl(zl,e("fileUpload.errors.noFile")),Bl($l,e("fileUpload.errors.tooLarge"),s)]})),[s,i,e]);return(0,k.jsx)("div",{className:T(["upload",...v?["upload--error"]:[]]),ref:S,children:(0,k.jsxs)(nu,{formId:Vu,persistData:!0,onSubmit:_,validationSchema:C,children:[(f||!h)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)($u,{}),(0,k.jsx)("div",{className:T("upload__button-container"),children:(0,k.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:E,ref:c,className:T("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!f&&h&&(0,k.jsx)(Hu,{controlName:qu,skiplinkId:r,accept:a.join(", "),contentHint:O,isComplete:h,isUploading:f,outputText:e("fileUpload.selectedText",{hasFile:y,filename:m}),onClickCancel:E}),!l.current&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("span",{className:T("notification"),id:w,children:e("fileUpload.unavailableText")}),(0,k.jsx)("div",{className:T("upload__button-container"),children:(0,k.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:E,className:T("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},Gu=()=>{const{t:e}=ya(),{showFileUpload:t,serviceAllowsUploads:n}=ka(),[r,o]=(0,Qe.useState)(n),a=_a(),s=(0,Qe.useRef)(null),{setUserEntryType:c,activeEntry:l}=Iu(),u=(0,Qe.useRef)(null),{sendPolite:p}=ba(),d=!!Ir();return(0,Qe.useEffect)((()=>{W(u.current,(()=>{n||a()})),o(n)}),[n,a]),(0,Qe.useEffect)((()=>{s.current&&!n&&p(e("fileUpload.srUnavailableText")),!1===s.current&&n&&p(e("fileUpload.srAvailableText")),d&&(s.current=n)}),[n,d,p,e]),!t&&l!==i&&(0,k.jsx)(Dl,{isActive:r,transitionStartState:Il,children:(0,k.jsx)("div",{className:T("upload-toggle-wrapper"),children:(0,k.jsx)(Dl,{isActive:r,transitionStartState:Rl,children:(0,k.jsx)("button",{className:T(["button","button--secondary","upload-toggle"]),ref:u,"aria-disabled":r?null:"true",type:"button",onClick:r?()=>{c(i),a()}:null,children:(0,k.jsx)(hs,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})};function Ku(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ju(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ku(Object(n),!0).forEach((function(t){Xu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ku(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Xu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Qu=()=>{const{isOpen:e}=zi(),t=(0,Qe.useRef)(null),{hasCountdown:n}=za(),[r,o]=(0,Qe.useState)(n),{hasPrompt:a}=Ha(),[s,c]=(0,Qe.useState)(a),l=_a(),u=(0,Qe.useRef)(!1),{activeEntry:p}=Iu(),[d,f]=(0,Qe.useState)({text:Bu,upload:Wu}),[h,y]=(0,Qe.useState)((()=>p)),m=xr(),{accountAllowsUploads:b}=ka(),v=(0,Qe.useCallback)((()=>{W(t.current,l)}),[l]);(0,Qe.useEffect)((()=>{const{customComponents:e}=m,{entry:t}=e||{};t&&f((e=>Ju(Ju({},e),t)))}),[m]),(0,Qe.useEffect)((()=>{v(),o(n),c(a)}),[n,a,v]),(0,Qe.useEffect)((()=>{y(p),v()}),[p,v,t]),u.current=!(!t.current||!t.current.contains(document.activeElement));const g=d[h];return(0,k.jsxs)("div",{className:T("chat__entry"),ref:t,children:[r&&(0,k.jsx)(Tu,{}),s&&(0,k.jsx)(ku,{}),(0,k.jsxs)("div",{className:T(["entry__body",...n||a?["entry__body--hidden"]:[]]),children:[h!==i&&b&&e&&(0,k.jsx)(Gu,{}),(0,k.jsx)(g,{})]})]})},Yu=()=>{const{t:e}=ya(),{isOpen:t,closeChat:n}=zi(),{isWindow:r}=Rr();return t&&r?(0,k.jsx)("button",{type:"button",className:T("button","collapse-button"),onClick:n,children:(0,k.jsx)(hs,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null},Zu=({children:e,handleClose:t,title:n,closeButtonText:r,srCloseButtonText:o,id:i})=>{const a=Va();return(0,k.jsxs)("section",Object.assign({tabIndex:-1,id:i,"aria-labelledby":n?a:void 0,className:T("chat-status",!n&&"chat-status--condensed")},{children:[(0,k.jsxs)("div",Object.assign({className:T("chat-status__body")},{children:[n?(0,k.jsx)("h2",Object.assign({className:T("chat-status__title"),id:a},{children:n})):null,e]})),"function"==typeof t&&(0,k.jsxs)("button",Object.assign({type:"button",onClick:t,className:T("button","button--tertiary","chat-status__close")},{children:[r||(0,k.jsx)(hs,{name:"close",size:"16",alt:""}),o&&(0,k.jsx)("span",Object.assign({className:T("visually-hidden")},{children:o}))]}))]}))};function ep(){const{t:e}=ya(),{id:t}=Ka(),{hasInterrupt:n}=yl(),{disableTranslations:r,currentLocale:o}=Wa(),i=Ja(o),a=_a(),s=e("translations.status.label",{language:i}),c=(0,Qe.useCallback)((()=>{r(),a()}),[r,a]);return n?null:(0,k.jsx)(Zu,{handleClose:c,title:s,id:t,closeButtonText:e("translations.status.stopText"),srCloseButtonText:e("translations.status.srStopText")})}const tp=({handleClick:e,icon:t,title:n,srButtonText:r})=>(0,k.jsxs)("button",Object.assign({type:"button",onClick:e,className:T("button","button--primary","chat-status__button")},{children:[(0,k.jsx)(hs,{name:t,size:"16",alt:""}),n,r&&(0,k.jsx)("span",Object.assign({className:T("visually-hidden")},{children:r}))]}));function np(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=(()=>{const{isActive:e,languages:t}=Wa(),n=mt(),{sendAction:r}=Xi(),{translationProposal:o}=ct((e=>e.translations)),{enableTranslations:i}=Wa(),{isOpen:a}=zi(),{locale:s}=ya(),c=null==o?void 0:o.proposedLocale,l=Ja(c),u=(0,Qe.useMemo)((()=>null!==o&&!e&&a&&s!==c&&t.some((e=>e.locale===c))),[o,e,a,s,c,t]);return{activateTranslationProposal:()=>{i(null==o?void 0:o.proposedLocale,b)},dismissTranslationProposal:()=>{r({type:d,body:{type:m}}),n(Di())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:o}})(),{id:o}=Ka();return e?(0,k.jsx)(Zu,Object.assign({handleClose:n,srCloseButtonText:t.srDismissButtonText,id:o,title:t.titleLabel},{children:(0,k.jsx)(tp,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})})):null}function rp(){const{hasInterrupt:e}=yl(),{isActive:t}=Wa();return e?null:t?(0,k.jsx)(ep,{}):(0,k.jsx)(np,{})}function op(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ip(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ap=function({children:e,interruptComponent:t}){const{hasInterrupt:n,meta:r}=yl(),{isOpen:o}=zi();return n?o?(0,k.jsx)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?op(Object(n),!0).forEach((function(t){ip(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):op(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},r)):null:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(Cu,{children:[(0,k.jsxs)("div",{className:T("chat__container__header"),children:[(0,k.jsx)(rp,{}),(0,k.jsx)(Yu,{})]}),e]}),(0,k.jsx)(Qu,{}),o&&(0,k.jsx)(xu,{})]})},sp=({originalError:e,title:t,message:n,buttonText:r,action:o,srText:i})=>{const a=Xi(),s=Va(),{sendPolite:c}=ba(),l=_a(),u="SeamlySessionExpiredError"===e.name;return(0,Qe.useEffect)((()=>{u&&a[o]&&a[o]()}),[o,a,u]),(0,Qe.useEffect)((()=>{!u&&i&&setTimeout((()=>{c(i)}),200)}),[c,i,u]),u?(0,k.jsx)(k.Fragment,{}):(0,k.jsxs)("section",{className:T("interrupt"),"aria-labelledby":s,children:[(0,k.jsx)(Yu,{}),(0,k.jsxs)("div",{className:T("interrupt__body"),children:[(0,k.jsx)("h2",{id:s,className:T("interrupt__title"),children:t}),(0,k.jsx)("p",{className:T("interrupt__message"),children:n}),r&&o&&(0,k.jsx)("div",{className:T("interrupt__actions"),children:(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{a[o]&&a[o](),l()},children:r})})]})]})};function cp({event:e}){const[t]=_l(e);return(0,k.jsx)(t,{event:e})}function lp(){const{preChatEvents:e,layoutMode:t}=xr(),{hasInterrupt:n}=yl(),{isOpen:r}=zi(),o=!(n||!e?.length||r);return o&&(0,k.jsx)("ul",{className:T("pre-chat-messages",`pre-chat-messages--${t}`),"aria-hidden":!o,children:e.map((e=>(0,k.jsx)("li",{className:T("pre-chat-messages__message"),children:(0,k.jsx)(cp,{event:e})},e.payload.id)))})}function up(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pp(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const dp=()=>{const e=function(){const{startChatIcon:e}=xr();return e}(),t=Ir(),{hasInterrupt:n}=yl(),r=t&&!n,o=r?t.avatar:e;return o?(0,k.jsx)("img",{className:T(r?"avatar":"icon"),src:o,alt:""}):(0,k.jsx)(hs,{name:"avatar",size:"32"})},fp=({onClick:e})=>{const t=Wi(),{t:n}=ya(),r=t()?n("window.openButton.srContinue"):n("window.openButton.srStart"),o=_a(),{isOpen:i}=zi(),a=kr(),s=(0,Qe.useCallback)((()=>{e(),o()}),[o,e]);return(0,k.jsx)(Dl,{isActive:!i,transitionStartState:Il,children:(0,k.jsxs)("button",{className:T("window-open-button"),"aria-label":r,"aria-hidden":i,onClick:s,children:[(0,k.jsx)("span",{className:T("message-count"),"aria-hidden":"true",children:!!a&&a}),(0,k.jsx)(dp,{})]})})};function hp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yp(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const mp={app:()=>(0,k.jsx)(Ul,{children:(0,k.jsx)(ap,{interruptComponent:sp,children:(0,k.jsx)(Tl,{})})}),inline:()=>{const{showInlineView:e,containerRef:t}=(()=>{const e=mt(),{connectWhenInView:t}=xr(),n=ct(Mr),{containerRef:r,isVisible:o}=Hi({enabled:t,freezeOnceVisible:!0});return(0,Qe.useEffect)((()=>{o&&e(Fi())}),[e,o]),{containerRef:r,showInlineView:n}})(),{isOpen:n}=zi(),{hasInterrupt:r,meta:o}=yl();return r&&!n?(0,k.jsx)(sp,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?up(Object(n),!0).forEach((function(t){pp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):up(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},o)):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Dl,{isActive:!n,transitionStartState:Il,children:(0,k.jsxs)("div",{ref:t,className:T("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,k.jsx)(lp,{}),(0,k.jsx)(Ml,{})]})}),(0,k.jsx)(Dl,{isActive:n,transitionStartState:Il,children:(0,k.jsx)(Ul,{ref:t,children:e&&(0,k.jsx)(ap,{interruptComponent:sp,children:n&&(0,k.jsx)(Tl,{})})})})]})},window:()=>{const{isOpen:e,openChat:t}=zi(),n=Hr(),{hasInterrupt:r,meta:o}=yl(),{t:i}=ya(),a=i("window.chat.continue"),s=(0,Qe.useMemo)((()=>({payload:{body:{text:a}}})),[a]);return r&&!e?(0,k.jsx)(sp,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hp(Object(n),!0).forEach((function(t){yp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},o)):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(fp,{onClick:t}),(0,k.jsx)(Dl,{isActive:!e&&!n,transitionStartState:Il,children:(0,k.jsx)("div",{className:T("unstarted-wrapper","unstarted-wrapper--window"),children:(0,k.jsx)(lp,{})})}),(0,k.jsx)(Dl,{isActive:!e&&n,transitionStartState:Nl,children:(0,k.jsx)("div",{className:T("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,k.jsx)(Hc,{event:s})})}),(0,k.jsx)(Dl,{isActive:e,transitionStartState:Nl,children:(0,k.jsx)(Ul,{children:(0,k.jsx)(ap,{interruptComponent:sp,children:(0,k.jsx)(Tl,{})})})})]})}},bp=({children:e})=>{const[,t]=xa(),{namespace:n,layoutMode:r,zIndex:o}=xr(),{isOpen:i,isVisible:a}=zi(),s=wa(),c=Hr(),{locale:l}=ya(),u=mp[r],p=(0,Qe.useCallback)((e=>{t(e)}),[t]),d=(0,Qe.useMemo)((()=>{if(l&&document.querySelector("html").getAttribute("lang")!==l)return l}),[l]);if(!u)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const f=["app",`app--layout-${r}`,`namespace--${n}`,...s];return i||"app"===r||f.push("app--collapsed"),c&&f.push("app--user-responded"),a&&(0,k.jsx)("div",{className:T(f),lang:d,tabIndex:"-1","data-nosnippet":!0,style:{zIndex:o},ref:p,children:e||(0,k.jsx)(u,{})})};function vp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vp(Object(n),!0).forEach((function(t){wp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wp(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jp=e=>(0,k.jsx)(jl,gp(gp({},e),{},{children:(0,k.jsx)(bp,{})}));var Op=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};class xp{constructor(e,t){const{namespace:n="",parentElement:r,showFaq:o}=e,i=Op(e,["namespace","parentElement","showFaq"]);this.config=Object.assign(Object.assign({},i),{namespace:n,showFaq:!1!==o}),this.namespace=n,this.parentElement=r,this.externalApi=t,this.api=new Ge({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(Je()),this.functions={},this.registerFunctions({on:this.eventBus.on,off:this.eventBus.off}),this.eventBus.on("function.register",((e,t)=>this.registerFunction(e,t))),this.eventBus.on("function.unregister",((e,t)=>this.unregisterFunction(e,t)))}render(){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const e=this.config.customComponents||{},{view:t}=e,n=Op(e,["view"]),r=Object.assign(Object.assign({},this.config),{customComponents:Object.keys(n).length?n:void 0}),o=function({initialState:e,api:t,eventBus:n,config:r}){return Xn({reducer:{state:Ho,app:Gr,config:Qo,i18n:mi,translations:Mi,visibility:Bi,forms:di,interrupt:Yr},preloadedState:e,middleware:e=>e({thunk:{extraArgument:{api:t,eventBus:n,config:r}},serializableCheck:!1}).concat([ti({api:t}),vi({api:t}),Oi({api:t}),Li])})}({api:this.api,eventBus:this.eventBus,config:r,initialState:void 0});o.dispatch(Ko(r)),yield o.dispatch(dr());try{const{locale:e}=yield o.dispatch($r()).unwrap();yield o.dispatch(hr(e))}catch(e){}o.dispatch(Fr()),t?(0,Xe.render)((0,k.jsx)(jl,Object.assign({eventBus:this.eventBus,store:o,api:this.api},{children:(0,k.jsx)(t,{})})),this.parentElement):(0,Xe.render)((0,k.jsx)(jp,{config:r,eventBus:this.eventBus,store:o,api:this.api}),this.parentElement)}))}destroy(){(0,Xe.render)(null,this.parentElement),this.eventBus.off(),this.api.disconnect(),delete this.functions}registerFunctions(e){Object.entries(e).forEach((([e,t])=>{this.registerFunction(e,t)}))}registerFunction(e,t){this.functions[e]=this.functions[e]||[],this.functions[e].push(t),this.externalApi.handleActions()}unregisterFunction(e,t){const n=this.functions[e];n&&n.length&&(this.functions[e]=n.filter((e=>e!==t)))}execFunction(e,...t){const n=this.functions[e];return!(!n||!n.length||(n.forEach((n=>{try{n(...t)}catch(t){console.error(`Action(${e}) failed: `,t)}})),0))}}function Sp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sp(Object(n),!0).forEach((function(t){Ep(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ep(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Cp=e=>"object"==typeof e&&"action"in e,Pp=e=>_p(_p({},e),{},{args:Array.isArray(e.args)?e.args:[e.args]}),Tp=class{constructor(e){this._waitingActions=[],this._instances={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(Cp).map(Pp)).length&&(this._waitingActions.push(...e),this.handleActions())}handleActions(){const e=this._waitingActions;this._waitingActions=[],e.forEach((e=>{switch(e.action){case"init":this.handleInit(e);break;case"destroy":this.handleDestroy(e);break;default:this.handleAction(e)||this.setContext(e.action,...e.args)||this._waitingActions.push(e)}}))}instanceInitializing(e){const t=Object.keys(this._instances);return!e&&t.length>0||t.includes(e)}setContext(e,t){const{instance:n}=t;if(this.instanceInitializing(n))return!1;switch(e){case"setTopic":const{name:e}=t;return e&&(this.context.topic=e),!0;case"setTranslation":const{enabled:n,locale:r}=t;return n&&r&&(this.context.translationLocale=r),!0;case"setVariables":return Object.keys(t).length>0&&(this.context.variables=_p({},t)),!0;default:return!1}}handleInit(e){const t=this.getUserConfig(...e.args),n=this.getCombinedConfig(t),{parentElement:r,namespace:o}=n||t;if(o?Object.values(this._instances).forEach((e=>{e.parentElement!==r&&e.namespace!==o||this.destroy(e)})):this.destroy(),n){const e=this.createInstance(n);this._instances[n.namespace]=e,this.context={},e.render()}}handleDestroy(e){this.destroy(e.instance)}handleAction(e){const{action:t,instance:n,args:r}=e,o=Object.values(this._instances);return!n&&o.length>1&&console.warn(`Multiple instances detected. Due to potential race conditions, it is recommended to target a specific instance with the action: ${t}`),o.map((e=>(!n||e.namespace===n)&&e.execFunction(t,...r))).some(Boolean)}createInstance(e){return new xp(e,this)}destroy(e){e?("string"==typeof e&&(e=this._instances[e]),e&&(e.destroy(),delete this._instances[e.namespace])):Object.entries(this._instances).forEach((([e,t])=>{t.destroy(),delete this._instances[e]}))}getUserConfig(e={}){return e}getCombinedConfig(e){const t=_p(_p({},e.context||this.appConfig.context),this.context),n=this.getMergedVariables(e);Object.keys(n).length>0&&(t.variables=n);const r=_p(_p({},this.appConfig.defaults),e.defaults),o=_p(_p(_p({},this.appConfig),e),{},{api:_p(_p({},this.appConfig.api),e.api),context:Object.keys(t).length?t:void 0,defaults:Object.keys(r).length?r:void 0});return"function"==typeof this.appConfig?this.appConfig(o):o}getMergedVariables(e){return _p(_p(_p({},this.appConfig.context?.variables||{}),e.context?.variables||{}),this.context.variables||{})}},kp=(...e)=>{const t=new URL(window.location.href);return e.reduce(((e,n)=>{const r=t.searchParams.get(n)||sessionStorage.getItem(n);return r&&(e[n]=r),e}),{})},Ap=(...e)=>{const t=new URL(window.location.href),n=e.reduce(((e,n)=>{const r=t.searchParams.get(n),o=r||sessionStorage.getItem(n);return r&&sessionStorage.setItem(n,r),o?(e.set(n,o),e):e}),new URLSearchParams),r=new URLSearchParams(Object.assign(Object.assign({},Object.fromEntries(t.searchParams)),Object.fromEntries(n)));return r.toString()&&window.history.replaceState(null,null,`?${r}`),kp(...n.keys())},Np=(...e)=>{const t=document.querySelector("[data-reset-search-params]");t&&t.addEventListener("click",(t=>{t.preventDefault();const n=new URL(window.location.href);e.forEach((e=>{sessionStorage.removeItem(e),n.searchParams.delete(e)})),window.location.href=n.toString()}))}})(),module.exports=r})();