@seamly/web-ui 21.0.2-beta.3 → 21.0.2-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/lib/components.js +109 -182
- package/build/dist/lib/components.min.js +1 -1
- package/build/dist/lib/components.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/hooks.js +27 -27
- package/build/dist/lib/hooks.min.js +1 -1
- package/build/dist/lib/index.debug.js +5 -5
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.js +125 -186
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/standalone.js +156 -216
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/style-guide.js +131 -198
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/utils.js +123 -186
- package/build/dist/lib/utils.min.js +1 -1
- package/build/dist/lib/utils.min.js.LICENSE.txt +1 -1
- package/package.json +1 -1
- package/src/javascripts/index.ts +1 -0
- package/src/javascripts/lib/external-api/index.js +17 -4
- package/src/javascripts/style-guide/components/static-core.js +8 -11
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see style-guide.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 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,d=l.mixin,p=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 g(e){if(!u(e))return e;const t=[];for(const n in e)p(e,n)&&v(t,n,e[n]);return t.join("&")}function v(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;)v(e,t,o.value)}catch(e){i.e(e)}finally{i.f()}}else if(u(n))for(const r in n)p(n,r)&&v(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,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 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)}))}m.serializeObject=g,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},d(j.prototype,f.prototype),j.prototype._parseBody=function(e){let t=m.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&O(this.type)&&(t=m.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},m.Response=j,i(x.prototype),d(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=g(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&&O(e)&&(t=m.serialize["application/json"]),t&&(n=t(n))}for(const e in this.header)null!==this.header[e]&&p(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,C=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];S<C.length;S++){const e=C[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,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=_,m.delete=_,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(210),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(210),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 d=function(){return s(r,i,arguments)};l?l(e.exports,"apply",{value:d}):e.exports.apply=d},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,p(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 d;if(l+=1,"object"==typeof e&&null!==e){for(d=0;d<i.length;d++)if(i[d]===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(d=0;d<e.length;d++)c(e[d],d,d,i,e,l,u);else{var p=Object.keys(e);for(d=0;d<p.length;d++){var f=p[d];c(e[f],f,d,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=d(e,"",0,[],void 0,0,a)||e;try{s=0===o.length?JSON.stringify(c,t,n):JSON.stringify(c,p(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 d(e,o,i,a,c,u,p){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!==p.depthLimit&&u>p.depthLimit)return void s(t,e,o,c);if(void 0!==p.edgesLimit&&i+1>p.edgesLimit)return void s(t,e,o,c);if(a.push(e),Array.isArray(e))for(f=0;f<e.length;f++)d(e[f],f,f,a,e,u,p);else{var h={},y=Object.keys(e).sort(l);for(f=0;f<y.length;f++){var m=y[f];d(e[m],m,f,a,e,u,p),h[m]=e[m]}if(void 0===c)return h;r.push([c,o,e]),c[o]=h}a.pop()}}function p(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=[],d=0;d<l;d++)u.push("$"+d);if(a=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(c),i.prototype){var p=function(){};p.prototype=i.prototype,a.prototype=new p,p.prototype=null}return a}},612:(e,t,n)=>{"use strict";var r=n(648);e.exports=Function.prototype.bind||r},210:(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,d=n(405)(),p=Object.getPrototypeOf||function(e){return e.__proto__},f={},h="undefined"==typeof Uint8Array?r:p(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":d?p([][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%":d?p(p([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&d?p((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&&d?p((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":d?p(""[Symbol.iterator]()):r,"%Symbol%":d?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=p(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"]},g=n(612),v=n(642),w=g.call(Function.call,Array.prototype.concat),O=g.call(Function.apply,Array.prototype.splice),j=g.call(Function.call,String.prototype.replace),x=g.call(Function.call,String.prototype.slice),S=g.call(Function.call,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_=/\\(\\)?/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,C,(function(e,t,n,o){r[r.length]=n?j(o,_,"$1"):t||e})),r},P=function(e,t){var n,r=e;if(v(b,r)&&(r="%"+(n=b[r])[0]+"%"),v(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=E(e),r=n.length>0?n[0]:"",i=P("%"+r+"%",t),s=i.name,l=i.value,u=!1,d=i.alias;d&&(r=d[0],O(n,w([0,1],d)));for(var p=1,f=!0;p<n.length;p+=1){var h=n[p],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),v(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&&p+1>=n.length){var g=c(l,h);l=(f=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:l[h]}else f=v(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)},545:(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,d=Object.getOwnPropertySymbols,p=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);d&&(a=a.concat(d(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 g=p(n,b);try{l(t,b,g)}catch(e){}}}}return t}},679: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,d="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="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,g=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,O=String.prototype.toLowerCase,j=RegExp.prototype.test,x=Array.prototype.concat,S=Array.prototype.join,C=Array.prototype.slice,_=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 D(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?-_(-e):_(e);if(r!==e){var o=String(r),i=g.call(t,o.length+1);return v.call(o,n,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(t,n,"$&_")}var L=n(654),M=L.custom,R=H(M)?M:null;function U(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function F(e){return v.call(String(e),/"/g,""")}function z(e){return!("[object Array]"!==V(e)||A&&"object"==typeof e&&A in e)}function B(e){return!("[object RegExp]"!==V(e)||A&&"object"==typeof e&&A in e)}function H(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(q(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(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=!q(s,"customInspect")||s.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(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(q(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?D(t,w):w}if("bigint"==typeof t){var j=String(t)+"n";return y?D(t,j):j}var _=void 0===s.depth?5:s.depth;if(void 0===r&&(r=0),r>=_&&_>0&&"object"==typeof t)return z(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 $(t,n,i){if(n&&(o=C.call(o)).push(n),i){var a={depth:s.depth};return q(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),e(t,a,r+1,o)}return e(t,s,r+1,o)}if("function"==typeof t&&!B(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,$);return"[Function"+(K?": "+K:" (anonymous)")+"]"+(ee.length>0?" { "+S.call(ee,", ")+" }":"")}if(H(t)){var te=k?v.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",s);return ne+=">",t.childNodes&&t.childNodes.length&&(ne+="..."),ne+"</"+O.call(String(t.nodeName))+">"}if(z(t)){if(0===t.length)return"[]";var ie=Z(t,$);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]"!==V(e)||A&&"object"==typeof e&&A in e)}(t)){var ae=Z(t,$);return"cause"in Error.prototype||!("cause"in t)||I.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+S.call(ae,", ")+" }":"{ ["+String(t)+"] "+S.call(x.call("[cause]: "+$(t.cause),ae),", ")+" }"}if("object"==typeof t&&c){if(R&&"function"==typeof t[R]&&L)return L(t,{depth:_-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($(n,t,!0)+" => "+$(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($(e,t))})),Q("Set",l.call(t),ce,M)}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 WeakMap}catch(e){}return!1}(t))return X("WeakMap");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 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]"!==V(e)||A&&"object"==typeof e&&A in e)}(t))return J($(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($(E.call(t)));if(function(e){return!("[object Boolean]"!==V(e)||A&&"object"==typeof e&&A in e)}(t))return J(h.call(t));if(function(e){return!("[object String]"!==V(e)||A&&"object"==typeof e&&A in e)}(t))return J($(String(t)));if(!function(e){return!("[object Date]"!==V(e)||A&&"object"==typeof e&&A in e)}(t)&&!B(t)){var le=Z(t,$),ue=N?N(t)===Object.prototype:t instanceof Object||t.constructor===Object,de=t instanceof Object?"":"null prototype",pe=!ue&&A&&Object(t)===t&&A in t?g.call(V(t),8,-1):de?"Object":"",fe=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(pe||de?"["+S.call(x.call([],pe||[],de||[]),": ")+"] ":"");return 0===le.length?fe+"{}":M?fe+"{"+Y(le,M)+"}":fe+"{ "+S.call(le,", ")+" }"}return String(t)};var $=Object.prototype.hasOwnProperty||function(e){return e in this};function q(e,t){return $.call(e,t)}function V(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(g.call(e,0,t.maxStringLength),t)+r}return U(v.call(v.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=z(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=q(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)q(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<a.length;l++)I.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:()=>h,Component:()=>r.Component,Fragment:()=>r.Fragment,PureComponent:()=>c,StrictMode:()=>X,Suspense:()=>v,SuspenseList:()=>j,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>B,cloneElement:()=>V,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>$,createPortal:()=>_,createRef:()=>r.createRef,default:()=>ne,findDOMNode:()=>G,flushSync:()=>J,forwardRef:()=>p,hydrate:()=>I,isValidElement:()=>q,lazy:()=>O,memo:()=>l,render:()=>A,startTransition:()=>Q,unmountComponentAtNode:()=>W,unstable_batchedUpdates:()=>K,useDeferredValue:()=>Y,useInsertionEffect:()=>ee,useSyncExternalStore:()=>te,useTransition:()=>Z,version:()=>H});var r=n(710),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){this.props=e}function l(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),(c.prototype=new r.Component).isPureReactComponent=!0,c.prototype.shouldComponentUpdate=function(e,t){return s(this.props,e)||s(this.state,t)};var u=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),u&&u(e)};var d="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function p(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 f=function(e,t){return null==e?null:(0,r.toChildArray)((0,r.toChildArray)(e).map(t))},h={map:f,forEach:f,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},y=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);y(e,t,n,r)};var m=r.options.unmount;function b(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 b(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 v(){this.__u=0,this.t=null,this.__b=null}function w(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 j(){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)},(v.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=w(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)},v.prototype.componentWillUnmount=function(){this.t=[]},v.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]=b(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 x=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,t){var n=(0,r.createElement)(C,{__v:e,i:t});return n.containerInfo=t,n}(j.prototype=new r.Component).__a=function(e){var t=this,n=w(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),x(t,e,r)):o()};n?n(i):i()}},j.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},j.prototype.componentDidUpdate=j.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){x(e,n,t)}))};var E="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,P=/^(?: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]/,T="undefined"!=typeof document,k=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};function A(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 N=r.options.event;function D(){}function L(){return this.cancelBubble}function M(){return this.defaultPrevented}r.options.event=function(e){return N&&(e=N(e)),e.persist=D,e.isPropagationStopped=L,e.isDefaultPrevented=M,e.nativeEvent=e};var R,U={configurable:!0,get:function(){return this.class}},F=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];T&&"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)&&!k(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&&P.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&&(U.enumerable="className"in n,null!=n.className&&(o.class=n.className),Object.defineProperty(o,"className",U))}e.$$typeof=E,F&&F(e)};var z=r.options.__r;r.options.__r=function(e){z&&z(e),R=e.__c};var B={ReactCurrentDispatcher:{current:{readContext:function(e){return R.__n[e.__c].props.value}}}},H="17.0.2";function $(e){return r.createElement.bind(null,e)}function q(e){return!!e&&e.$$typeof===E}function V(e){return q(e)?r.cloneElement.apply(null,arguments):e}function W(e){return!!e.__k&&((0,r.render)(null,e),!0)}function G(e){return e&&(e.base||1===e.nodeType&&e)||null}var K=function(e,t){return e(t)},J=function(e,t){return e(t)},X=r.Fragment;function Q(e){e()}function Y(e){return e}function Z(){return[!1,Q]}var ee=o.useLayoutEffect;function te(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,i.__!==t()&&a({h:i})}),[e,n,t]),(0,o.useEffect)((function(){return i.__!==i.v()&&a({h:i}),e((function(){i.__!==i.v()&&a({h:i})}))}),[e]),n}var ne={useState:o.useState,useId:o.useId,useReducer:o.useReducer,useEffect:o.useEffect,useLayoutEffect:o.useLayoutEffect,useInsertionEffect:ee,useTransition:Z,useDeferredValue:Y,useSyncExternalStore:te,startTransition:Q,useRef:o.useRef,useImperativeHandle:o.useImperativeHandle,useMemo:o.useMemo,useCallback:o.useCallback,useContext:o.useContext,useDebugValue:o.useDebugValue,version:"17.0.2",Children:h,render:A,hydrate:I,unmountComponentAtNode:W,createPortal:_,createElement:r.createElement,createContext:r.createContext,createFactory:$,cloneElement:V,createRef:r.createRef,Fragment:r.Fragment,isValidElement:q,findDOMNode:G,Component:r.Component,PureComponent:c,memo:l,forwardRef:p,flushSync:J,unstable_batchedUpdates:K,StrictMode:X,Suspense:v,SuspenseList:j,lazy:O,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:B}},798: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(798);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 d=0;n.depth>0&&null!==(s=a.exec(i))&&d<n.depth;){if(d+=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,d=t.parameterLimit===1/0?void 0:t.parameterLimit,p=u.split(t.delimiter,d),f=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n<p.length;++n)0===p[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===p[n]?h="utf-8":"utf8=%26%2310003%3B"===p[n]&&(h="iso-8859-1"),f=n,n=p.length);for(n=0;n<p.length;++n)if(n!==f){var y,m,b=p[n],g=b.indexOf("]="),v=-1===g?b.indexOf("="):g+1;-1===v?(y=t.decoder(b,a.decoder,h,"key"),m=t.strictNullHandling?null:""):(y=t.decoder(b.slice(0,v),a.decoder,h,"key"),m=r.maybeMap(c(b.slice(v+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,d=n.plainObjects?Object.create(null):{},p=Object.keys(u),f=0;f<p.length;++f){var h=p[f],y=l(h,u[h],n,"string"==typeof e);d=r.merge(d,y,n)}return!0===n.allowSparse?d:r.compact(d)}},261:(e,t,n)=>{"use strict";var r=n(478),o=n(769),i=n(798),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,d=function(e,t){u.apply(e,c(t)?t:[t])},p=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 p.call(e)},skipNulls:!1,strictNullHandling:!1},y={},m=function e(t,n,i,a,s,u,p,f,m,b,g,v,w,O,j,x){for(var S,C=t,_=x,E=0,P=!1;void 0!==(_=_.get(y))&&!P;){var T=_.get(t);if(E+=1,void 0!==T){if(T===E)throw new RangeError("Cyclic object value");P=!0}void 0===_.get(y)&&(E=0)}if("function"==typeof f?C=f(n,C):C instanceof Date?C=g(C):"comma"===i&&c(C)&&(C=o.maybeMap(C,(function(e){return e instanceof Date?g(e):e}))),null===C){if(s)return p&&!O?p(n,h.encoder,j,"key",v):n;C=""}if("string"==typeof(S=C)||"number"==typeof S||"boolean"==typeof S||"symbol"==typeof S||"bigint"==typeof S||o.isBuffer(C)){if(p){var k=O?n:p(n,h.encoder,j,"key",v);if("comma"===i&&O){for(var A=l.call(String(C),","),I="",N=0;N<A.length;++N)I+=(0===N?"":",")+w(p(A[N],h.encoder,j,"value",v));return[w(k)+(a&&c(C)&&1===A.length?"[]":"")+"="+I]}return[w(k)+"="+w(p(C,h.encoder,j,"value",v))]}return[w(n)+"="+w(String(C))]}var D,L=[];if(void 0===C)return L;if("comma"===i&&c(C))D=[{value:C.length>0?C.join(",")||null:void 0}];else if(c(f))D=f;else{var M=Object.keys(C);D=m?M.sort(m):M}for(var R=a&&c(C)&&1===C.length?n+"[]":n,U=0;U<D.length;++U){var F=D[U],z="object"==typeof F&&void 0!==F.value?F.value:C[F];if(!u||null!==z){var B=c(C)?"function"==typeof i?i(R,F):R:R+(b?"."+F:"["+F+"]");x.set(t,E);var H=r();H.set(y,x),d(L,e(z,B,i,a,s,u,p,f,m,b,g,v,w,O,j,H))}}return L};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,p=[];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(),g=0;g<n.length;++g){var v=n[g];l.skipNulls&&null===o[v]||d(p,m(o[v],v,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=p.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(798),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,d=n?Symbol.for("react.concurrent_mode"):60111,p=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,g=n?Symbol.for("react.fundamental"):60117,v=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 d:case i:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case l:case p:case m:case y:case c:return e;default:return t}}case o:return t}}}function j(e){return O(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=l,t.ContextProvider=c,t.Element=r,t.ForwardRef=p,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 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)===p},t.isFragment=function(e){return O(e)===i},t.isLazy=function(e){return O(e)===m},t.isMemo=function(e){return O(e)===y},t.isPortal=function(e){return O(e)===o},t.isProfiler=function(e){return O(e)===s},t.isStrictMode=function(e){return O(e)===a},t.isSuspense=function(e){return O(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||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===p||e.$$typeof===g||e.$$typeof===v||e.$$typeof===w||e.$$typeof===b)},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(210),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),d=o("WeakMap.prototype.has",!0),p=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 p(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 d(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 d=s(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=l((function(){function e(e){if(!c){if(c=!0,a=e,e=r(e),void 0!==o&&p.hasValue){var t=p.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,d[0],d[1]);return c((function(){p.hasValue=!0,p.value=f}),[f]),u(f),f}},688:(e,t,n)=>{"use strict";e.exports=n(250)},738:(e,t,n)=>{"use strict";e.exports=n(139)},710: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,{SeamlyStaticCore:()=>Hp,default:()=>of});const e=require("preact/jsx-runtime");var t=n(766),o=n.n(t);const i="cvco",a="2",s="seamly-client-participant";class c 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 l extends c{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class u extends c{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class d extends c{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class p extends c{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}const f=(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)}}},h=e=>Math.ceil(e/1e3),y=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},m=(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]}`},b={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},g={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},v=e=>e.code?g[e.code]:b[e.keyCode],w=e=>{e&&e.focus()},O=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};var j=n(905),x=n.n(j);function S(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}function C(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 _=e=>"function"==typeof e?e:function(){return e},E="undefined"!=typeof self?self:null,P="undefined"!=typeof window?window:null,T=E||P||T,k="closed",A="errored",I="joined",N="joining",D="leaving",L="phx_close",M="phx_error",R="phx_reply",U="phx_leave",F=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})}},z=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))}},B=class{static request(e,t,n,r,o,i,a){if(T.XDomainRequest){let n=new T.XDomainRequest;return this.xdomainRequest(n,e,t,r,o,i,a)}{let s=new T.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)}`}},H=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 B.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=B.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)}},$={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 d=n.decode(e.slice(s,s+a));s+=a;let p=e.slice(s,e.byteLength);return{join_ref:c,ref:l,topic:u,event:R,payload:{status:d,response:p}}},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 q(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 V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?q(Object(n),!0).forEach((function(t){W(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function W(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var G,K,J,X,Q=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 Y=x()("seamly");class Z{constructor(){G.add(this),K.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 V(V({},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||T.WebSocket||H,this.establishedConnections=0,this.defaultEncoder=$.encode.bind($),this.defaultDecoder=$.decode.bind($),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==H?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;P&&P.addEventListener&&(P.addEventListener("pagehide",(e=>{this.conn&&(this.disconnect(),n=this.connectClock)})),P.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=_(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 z((()=>{this.teardown((()=>this.connect()))}),this.reconnectAfterMs)}getLongPollTransport(){return H}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=B.appendParams(B.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=_(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(M)}))}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=k,this.topic=e,this.params=_(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new F(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new z((()=>{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=I,this.rejoinTimer.reset(),this.pushBuffer.forEach((e=>e.send())),this.pushBuffer=[]})),this.joinPush.receive("error",(()=>{this.state=A,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=k,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=A,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 F(this,U,_({}),this.timeout).send(),this.state=A,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.on(R,((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(L,e)}onError(e){return this.on(M,(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 F(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=D;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(L,"leave")},n=new F(this,U,_({}),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=N,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===k}isErrored(){return this.state===A}isJoined(){return this.state===I}isJoining(){return this.state===N}isLeaving(){return this.state===D}}(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:a})}),this.socket.connect(),this.channel=this.socket.channel(this.channelTopic,{authorization:`Bearer ${this.accessToken}`,channelName:this.channelName}),this.start(),this.socket.onError((e=>{Y("[SOCKET][ERROR]",e)})),this.socket.onOpen((()=>{Y("[SOCKET]OPEN")})),this.channel.on("system",(e=>{"attach_channel_succeeded"===e.type&&Q(this,G,"m",X).call(this,"attach_channel_succeeded")})),this.socket.onClose((()=>{Y("[SOCKET]CLOSE"),Q(this,G,"m",X).call(this,"socket_closed")})),this.channel.onClose((()=>{Y("[CHANNEL]CLOSE"),Q(this,G,"m",X).call(this,"channel_closed")})),this.channel.onError((e=>{Y("[CHANNEL][ERROR]",e),Q(this,G,"m",X).call(this,"channel_erred")})),Q(this,G,"m",J).call(this,"ack","ui","error","participant","message","service_data","system","info","sync")}))}start(){this.channel.join().receive("ok",(()=>{Y("[CHANNEL][JOIN] OK"),Q(this,G,"m",X).call(this,"join_channel_succeeded")})).receive("error",(e=>{Y("[CHANNEL][JOIN] ERROR",e),Q(this,G,"m",X).call(this,"join_channel_erred"),this.channel.socket.disconnect()})).receive("timeout",(()=>{Y("[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,K,[],"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){Q(this,K,"f").push(e)}pushToChannel(e,t,n=1e4){this.channel.push(e,t,n)}}K=new WeakMap,G=new WeakSet,J=function(...e){e.forEach((e=>{this.channel.on(e,(t=>{Y("[RECEIVE]",e,t)}))}))},X=function(e){Q(this,K,"f").forEach((t=>t(e)))};var ee,te,ne,re,oe,ie,ae,se,ce,le,ue,de,pe,fe,he,ye=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())}))},me=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},be=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 ge=x()("seamly");function ve(){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 we{constructor({layoutMode:e,namespace:t,config:n,context:r}){var o;ee.add(this),te.set(this,void 0),ne.set(this,void 0),re.set(this,void 0),oe.set(this,void 0),this.conversation=new Z,ue.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||C),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},me(this,oe,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"),me(this,te,!1,"f"),this.connected=!1,this.configReady=!1,me(this,ne,n.externalId,"f"),me(this,re,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 ye(this,void 0,void 0,(function*(){return yield this.disconnect(),this.clearStore(),this.getConfig()}))}disconnect(){var e;return ye(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 o().post(`${be(this,ee,"m",de).call(this,"http")}/client/${this.connectionInfo.apiKey}/configs`).set("Content-Type","application/json").query({v:a}).send({context:Object.assign(Object.assign({},be(this,oe,"f").context),{environment:!0===be(this,oe,"f").sendEnvironment?be(this,ee,"m",he).call(this):be(this,oe,"f").sendEnvironment})}).then((({body:e})=>(be(this,ee,"m",pe).call(this,e),this.configReady=!0,e.config))).catch((e=>{if(404===e.status)throw new l(e);if(e.status>=500)throw new u(e);throw e}))}getConversation(){return ye(this,void 0,void 0,(function*(){if(!this.hasConversation())return null;try{const{body:e}=yield o().get(`${be(this,ee,"m",de).call(this,"http")}${this.URLS.history}`).set("Authorization",`Bearer ${be(this,ee,"m",ie).call(this)}`).query({v:a});be(this,ee,"m",pe).call(this,e);const{messages:t,participants:n,activeServiceSessionId:r,activeServiceSettings:i,serviceData:s,ui:c,translation:l}=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:i,serviceData:s,resumeConversationPrompt:!!c&&Boolean(c.resumeConversationPrompt),translationProposal:c.translationProposal,translation:l}}catch(e){if(401===e.status)throw new p(e);if(404===e.status)throw new d(e);if(e.status>=500)throw new u(e);throw e}}))}connect(){return ye(this,void 0,void 0,(function*(){this.connected=!1;let e={};return this.hasConversation()||(e=yield be(this,ee,"m",fe).call(this)),this.conversation.connect(`${be(this,ee,"m",de).call(this,"ws")}${this.URLS.socket}`,be(this,oe,"f").context.channelName,be(this,ee,"m",ce).call(this),be(this,ee,"m",ie).call(this)),this.conversation.onConnection((e=>{this.connected=["attach_channel_succeeded","join_channel_succeeded"].includes(e),me(this,te,"attach_channel_succeeded"===e,"f")})),be(this,oe,"f").sendEnvironment&&this.send("context",{environment:!0===be(this,oe,"f").sendEnvironment?be(this,ee,"m",he).call(this):be(this,oe,"f").sendEnvironment},!1),e}))}uploadFile(e,t,n,r){const i=new FormData;i.append("upload",e);const a=o().post(`${be(this,ee,"m",de).call(this,"http")}${this.URLS.uploads}`).set("Authorization",`Bearer ${be(this,ee,"m",ie).call(this)}`).send(i);return a.on("progress",(function(e){const{direction:n,percent:r}=e;"upload"===n&&"function"==typeof t&&t(r)})),a.then((e=>{n&&n(e)})).catch((e=>{if(!r)throw e;r(e.response)})),a}getConversationIntitialState(){return o().get(`${be(this,ee,"m",de).call(this,"http")}${this.getConversationUrl()}`).set("Authorization",`Bearer ${be(this,ee,"m",ie).call(this)}`).query({v:a}).then((({body:e})=>{return be(this,ee,"m",pe).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 p(e);if(404===e.status)throw new d(e);if(e.status>=500)throw new u(e);throw e}))}getTranslations(e){return ye(this,void 0,void 0,(function*(){try{if(!this.URLS.translations)throw new l;const t=`${be(this,ee,"m",de).call(this,"http")}${this.URLS.translations}`.replace("{version}",String(2)).replace("{locale}",be(this,ue,"f").call(this,e)),n=o().get(t),{body:r}=yield n;return r.translations}catch(e){if(e.status>=500)throw new u(e);throw e}}))}send(e,t,n=!0){var r;!this.connected||n&&!be(this,te,"f")?null===(r=this.conversation)||void 0===r||r.onConnection((r=>{("join_channel_succeeded"===r||"attach_channel_succeeded"===r)&&this.send(e,t,n)})):(ge("[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=S()),{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)}}te=new WeakMap,ne=new WeakMap,re=new WeakMap,oe=new WeakMap,ue=new WeakMap,ee=new WeakSet,ie=function(){return this.store.get("accessToken")},ae=function(e){this.store.set("accessToken",e)},se=function(e){this.store.set("conversationUrl",e)},ce=function(){return this.store.get("channelTopic")||this.store.get("channelName")},le=function(e){this.store.set("channelTopic",e)},de=function(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`},pe=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)},fe=function(){var e;return ye(this,void 0,void 0,(function*(){try{const t=o().post(`${be(this,ee,"m",de).call(this,"http")}${this.URLS.conversations}`).set("Content-Type","application/json").query({v:a}).withCredentials().send({externalId:be(this,ne,"f")||void 0}),{body:n}=yield t,{conversation:r}=n,i=Object.assign({},r);return delete i.accessToken,delete i.channelTopic,be(this,ee,"m",ae).call(this,r.accessToken),be(this,ee,"m",le).call(this,r.channelTopic),be(this,ee,"m",pe).call(this,n),be(this,ee,"m",se).call(this,this.URLS.conversation),this.locale=null===(e=r.translation)||void 0===e?void 0:e.locale,this.userResponded=r.userResponded,i}catch(e){if(e.status>=500)throw new u(e);throw e}}))},he=function(){return{clientName:"@seamly/web-ui",clientVariant:be(this,re,"f"),clientVersion:"21.0.2-beta.2",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:ve(),userAgent:navigator.userAgent,preferredLocale:navigator.language}};var Oe=n(679),je=n.n(Oe),xe=n(710),Se=n(207),Ce=n(688),_e=n(738),Ee=n(661);let Pe=function(e){e()};const Te=()=>Pe,ke=(0,Ee.createContext)(null);function Ae(){return(0,Ee.useContext)(ke)}let Ie=()=>{throw new Error("uSES not initialized!")};const Ne=(e,t)=>e===t;function De(e=ke){const t=e===ke?Ae:()=>(0,Ee.useContext)(e);return function(e,n=Ne){const{store:r,subscription:o,getServerState:i}=t(),a=Ie(o.addNestedSub,r.getState,i||r.getState,e,n);return(0,Ee.useDebugValue)(a),a}}const Le=De();n(545),n(973);const Me={notify(){},get:()=>[]};const Re="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?Ee.useLayoutEffect:Ee.useEffect;let Ue=null;const Fe=function({store:e,context:t,children:n,serverState:r}){const o=(0,Ee.useMemo)((()=>{const t=function(e,t){let n,r=Me;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){const e=Te();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=Me)},getListeners:()=>r};return a}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0}}),[e,r]),i=(0,Ee.useMemo)((()=>e.getState()),[e]);Re((()=>{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||ke;return Ee.default.createElement(a.Provider,{value:o},n)};function ze(e=ke){const t=e===ke?Ae:()=>(0,Ee.useContext)(e);return function(){const{store:e}=t();return e}}const Be=ze();function He(e=ke){const t=e===ke?Be:ze(e);return function(){return t().dispatch}}const $e=He();var qe;(e=>{Ie=e})(_e.useSyncExternalStoreWithSelector),(e=>{Ue=e})(Ce.useSyncExternalStore),qe=Ee.unstable_batchedUpdates,Pe=qe;const Ve=(0,xe.createContext)(null),We=(0,xe.createContext)(null),Ge="message",Ke="text",Je="text",Xe="upload",Qe="received",Ye="read",Ze="custom",et="typing",tt="read",nt="detach_service",rt="dismiss",ot="set_topic",it="set_translation",at="click_cta",st="translation_proposal",ct="assertive",lt="polite",ut={new_topic:"newTopic",new_translation:"newTranslation"},dt="uploads",pt="navigate";function ft(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 ht(e){return!!e&&!!e[en]}function yt(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)===tn}(e)||Array.isArray(e)||!!e[Zt]||!!(null===(t=e.constructor)||void 0===t?void 0:t[Zt])||Ot(e)||jt(e))}function mt(e,t,n){void 0===n&&(n=!1),0===bt(e)?(n?Object.keys:nn)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function bt(e){var t=e[en];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Ot(e)?2:jt(e)?3:0}function gt(e,t){return 2===bt(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function vt(e,t,n){var r=bt(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function wt(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function Ot(e){return Jt&&e instanceof Map}function jt(e){return Xt&&e instanceof Set}function xt(e){return e.o||e.t}function St(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=rn(e);delete t[en];for(var n=nn(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 Ct(e,t){return void 0===t&&(t=!1),Et(e)||ht(e)||!yt(e)||(bt(e)>1&&(e.set=e.add=e.clear=e.delete=_t),Object.freeze(e),t&&mt(e,(function(e,t){return Ct(t,!0)}),!0)),e}function _t(){ft(2)}function Et(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Pt(e){var t=on[e];return t||ft(18,e),t}function Tt(){return Gt}function kt(e,t){t&&(Pt("Patches"),e.u=[],e.s=[],e.v=t)}function At(e){It(e),e.p.forEach(Dt),e.p=null}function It(e){e===Gt&&(Gt=e.l)}function Nt(e){return Gt={p:[],l:Gt,h:e,m:!0,_:0}}function Dt(e){var t=e[en];0===t.i||1===t.i?t.j():t.O=!0}function Lt(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||Pt("ES5").S(t,e,r),r?(n[en].P&&(At(t),ft(4)),yt(e)&&(e=Mt(t,e),t.l||Ut(t,e)),t.u&&Pt("Patches").M(n[en].t,e,t.u,t.s)):e=Mt(t,n,[]),At(t),t.u&&t.v(t.u,t.s),e!==Yt?e:void 0}function Mt(e,t,n){if(Et(t))return t;var r=t[en];if(!r)return mt(t,(function(o,i){return Rt(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return Ut(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=St(r.k):r.o;mt(3===r.i?new Set(o):o,(function(t,i){return Rt(e,r,o,t,i,n)})),Ut(e,o,!1),n&&e.u&&Pt("Patches").R(r,n,e.u,e.s)}return r.o}function Rt(e,t,n,r,o,i){if(ht(o)){var a=Mt(e,o,i&&t&&3!==t.i&&!gt(t.D,r)?i.concat(r):void 0);if(vt(n,r,a),!ht(a))return;e.m=!1}if(yt(o)&&!Et(o)){if(!e.h.F&&e._<1)return;Mt(e,o),t&&t.A.l||Ut(e,o)}}function Ut(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&Ct(t,n)}function Ft(e,t){var n=e[en];return(n?xt(n):e)[t]}function zt(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 Bt(e){e.P||(e.P=!0,e.l&&Bt(e.l))}function Ht(e){e.o||(e.o=St(e.t))}function $t(e,t,n){var r=Ot(t)?Pt("MapSet").N(t,n):jt(t)?Pt("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:Tt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=an;n&&(o=[r],i=sn);var a=Proxy.revocable(o,i),s=a.revoke,c=a.proxy;return r.k=c,r.j=s,c}(t,n):Pt("ES5").J(t,n);return(n?n.A:Tt()).p.push(r),r}function qt(e){return ht(e)||ft(22,e),function e(t){if(!yt(t))return t;var n,r=t[en],o=bt(t);if(r){if(!r.P&&(r.i<4||!Pt("ES5").K(r)))return r.t;r.I=!0,n=Vt(t,o),r.I=!1}else n=Vt(t,o);return mt(n,(function(t,o){r&&function(e,t){return 2===bt(e)?e.get(t):e[t]}(r.t,t)===o||vt(n,t,e(o))})),3===o?new Set(n):n}(e)}function Vt(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return St(e)}var Wt,Gt,Kt="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Jt="undefined"!=typeof Map,Xt="undefined"!=typeof Set,Qt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Yt=Kt?Symbol.for("immer-nothing"):((Wt={})["immer-nothing"]=!0,Wt),Zt=Kt?Symbol.for("immer-draftable"):"__$immer_draftable",en=Kt?Symbol.for("immer-state"):"__$immer_state",tn=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(e){var t={};return nn(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},on={},an={get:function(e,t){if(t===en)return e;var n=xt(e);if(!gt(n,t))return function(e,t,n){var r,o=zt(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||!yt(r)?r:r===Ft(e.t,t)?(Ht(e),e.o[t]=$t(e.A.h,r,e)):r},has:function(e,t){return t in xt(e)},ownKeys:function(e){return Reflect.ownKeys(xt(e))},set:function(e,t,n){var r=zt(xt(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=Ft(xt(e),t),i=null==o?void 0:o[en];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(wt(n,o)&&(void 0!==n||gt(e.t,t)))return!0;Ht(e),Bt(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!==Ft(e.t,t)||t in e.t?(e.D[t]=!1,Ht(e),Bt(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=xt(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(){ft(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){ft(12)}},sn={};mt(an,(function(e,t){sn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),sn.deleteProperty=function(e,t){return sn.set.call(this,e,t,void 0)},sn.set=function(e,t,n){return an.set.call(this,e[0],t,n,e[0])};var cn=function(){function e(e){var t=this;this.g=Qt,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&&ft(6),void 0!==r&&"function"!=typeof r&&ft(7),yt(e)){var s=Nt(t),c=$t(t,e,void 0),l=!0;try{a=n(c),l=!1}finally{l?At(s):It(s)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return kt(s,r),Lt(e,s)}),(function(e){throw At(s),e})):(kt(s,r),Lt(a,s))}if(!e||"object"!=typeof e){if(void 0===(a=n(e))&&(a=e),a===Yt&&(a=void 0),t.F&&Ct(a,!0),r){var u=[],d=[];Pt("Patches").M(e,a,u,d),r(u,d)}return a}ft(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){yt(e)||ft(8),ht(e)&&(e=qt(e));var t=Nt(this),n=$t(this,e,void 0);return n[en].C=!0,It(t),n},t.finishDraft=function(e,t){var n=(e&&e[en]).A;return kt(n,t),Lt(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!Qt&&ft(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=Pt("Patches").$;return ht(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),ln=new cn,un=ln.produce;ln.produceWithPatches.bind(ln),ln.setAutoFreeze.bind(ln),ln.setUseProxies.bind(ln),ln.applyPatches.bind(ln),ln.createDraft.bind(ln),ln.finishDraft.bind(ln);const dn=un;function pn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fn(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 hn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fn(Object(n),!0).forEach((function(t){pn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yn(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 mn="function"==typeof Symbol&&Symbol.observable||"@@observable",bn=function(){return Math.random().toString(36).substring(7).split("").join(".")},gn={INIT:"@@redux/INIT"+bn(),REPLACE:"@@redux/REPLACE"+bn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+bn()}};function vn(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 wn(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(yn(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(yn(1));return n(wn)(e,t)}if("function"!=typeof e)throw new Error(yn(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(yn(3));return i}function d(e){if("function"!=typeof e)throw new Error(yn(4));if(c)throw new Error(yn(5));var t=!0;return l(),s.push(e),function(){if(t){if(c)throw new Error(yn(6));t=!1,l();var n=s.indexOf(e);s.splice(n,1),a=null}}}function p(e){if(!vn(e))throw new Error(yn(7));if(void 0===e.type)throw new Error(yn(8));if(c)throw new Error(yn(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(yn(10));o=e,p({type:gn.REPLACE})}function h(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(yn(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[mn]=function(){return this},e}return p({type:gn.INIT}),(r={dispatch:p,subscribe:d,getState:u,replaceReducer:f})[mn]=h,r}function On(){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 jn(){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(yn(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=On.apply(void 0,i)(n.dispatch),hn(hn({},n),{},{dispatch:r})}}}function xn(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 Sn=xn();Sn.withExtraArgument=xn;const Cn=Sn;var _n,En=(_n=function(e,t){return _n=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])},_n(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}_n(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Pn=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},Tn=Object.defineProperty,kn=Object.defineProperties,An=Object.getOwnPropertyDescriptors,In=Object.getOwnPropertySymbols,Nn=Object.prototype.hasOwnProperty,Dn=Object.prototype.propertyIsEnumerable,Ln=function(e,t,n){return t in e?Tn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Mn=function(e,t){for(var n in t||(t={}))Nn.call(t,n)&&Ln(e,n,t[n]);if(In)for(var r=0,o=In(t);r<o.length;r++)n=o[r],Dn.call(t,n)&&Ln(e,n,t[n]);return e},Rn=function(e,t){return kn(e,An(t))},Un="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?On:On.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Fn=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 En(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,Pn([void 0],e[0].concat(this)))):new(t.bind.apply(t,Pn([void 0],e.concat(this))))},t}(Array);function zn(e){return yt(e)?dn(e,(function(){})):e}function Bn(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 Fn);return n&&(function(e){return"boolean"==typeof e}(n)?r.push(Cn):r.push(Cn.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,d=void 0===u?void 0:u,p=r.enhancers,f=void 0===p?void 0:p;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:gn.INIT}))throw new Error(yn(12));if(void 0===n(void 0,{type:gn.PROBE_UNKNOWN_ACTION()}))throw new Error(yn(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],d=l(u,t);if(void 0===d)throw t&&t.type,new Error(yn(14));o[c]=d,r=r||d!==u}return(r=r||a.length!==Object.keys(e).length)?o:e}}(i)}var h=s;"function"==typeof h&&(h=h(n));var y=jn.apply(void 0,h),m=On;l&&(m=Un(Mn({trace:!1},"object"==typeof l&&l)));var b=[y];return Array.isArray(f)?b=Pn([y],f):"function"==typeof f&&(b=f(b)),wn(t,d,m.apply(void 0,b))}function Hn(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 Mn(Mn({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 $n(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 qn(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:zn(e.initialState),o=e.reducers||{},i=Object.keys(o),a={},s={},c={};function l(){var t="function"==typeof e.extraReducers?$n(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=Mn(Mn({},o),s);return function(e,t,n,r){void 0===n&&(n=[]);var o,i=$n(t),a=i[0],s=i[1],c=i[2];if(function(e){return"function"==typeof e}(e))o=function(){return zn(e())};else{var l=zn(e);o=function(){return l}}function u(e,t){void 0===e&&(e=o());var n=Pn([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(ht(e))return void 0===(r=n(e,t))?e:r;if(yt(e))return dn(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?Hn(l,r):Hn(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 Vn=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},Wn=["name","message","stack","code"],Gn=function(e,t){this.payload=e,this.meta=t},Kn=function(e,t){this.payload=e,this.meta=t},Jn=function(e){if("object"==typeof e&&null!==e){for(var t={},n=0,r=Wn;n<r.length;n++){var o=r[n];"string"==typeof e[o]&&(t[o]=e[o])}return t}return{message:String(e)}},Xn=function(){function e(e,t,n){var r=Hn(e+"/fulfilled",(function(e,t,n,r){return{payload:e,meta:Rn(Mn({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),o=Hn(e+"/pending",(function(e,t,n){return{payload:void 0,meta:Rn(Mn({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),i=Hn(e+"/rejected",(function(e,t,r,o,i){return{payload:o,error:(n&&n.serializeError||Jn)(e||"Rejected"),meta:Rn(Mn({},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,d=(null==n?void 0:n.idGenerator)?n.idGenerator(e):Vn(),p=new a,f=new Promise((function(e,t){return p.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:u||"Aborted"})}))})),h=!1;function y(e){h&&(u=e,p.abort())}var m=function(){return a=this,u=null,m=function(){var a,u,m,b,g;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(v){switch(v.label){case 0:return v.trys.push([0,4,,5]),null===(w=b=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,b];case 1:b=v.sent(),v.label=2;case 2:if(!1===b)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return h=!0,s(o(d,e,null==(u=null==n?void 0:n.getPendingMeta)?void 0:u.call(n,{requestId:d,arg:e},{getState:c,extra:l}))),[4,Promise.race([f,Promise.resolve(t(e,{dispatch:s,getState:c,extra:l,requestId:d,signal:p.signal,abort:y,rejectWithValue:function(e,t){return new Gn(e,t)},fulfillWithValue:function(e,t){return new Kn(e,t)}})).then((function(t){if(t instanceof Gn)throw t;return t instanceof Kn?r(t.payload,d,e,t.meta):r(t,d,e)}))])];case 3:return m=v.sent(),[3,5];case 4:return g=v.sent(),m=g instanceof Gn?i(null,d,e,g.payload,g.meta):i(g,d,e),[3,5];case 5:return n&&!n.dispatchConditionRejection&&i.match(m)&&m.meta.condition||s(m),[2,m]}var w}))},new Promise((function(e,t){var n=function(e){try{o(m.next(e))}catch(e){t(e)}},r=function(e){try{o(m.throw(e))}catch(e){t(e)}},o=function(t){return t.done?e(t.value):Promise.resolve(t.value).then(n,r)};o((m=m.apply(a,u)).next())}));var a,u,m}();return Object.assign(m,{abort:y,requestId:d,arg:e,unwrap:function(){return m.then(Qn)}})}}),{pending:o,rejected:i,fulfilled:r,typePrefix:e})}return e.withTypes=e,e}();function Qn(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var Yn=function(e,t){return function(e){return e&&"function"==typeof e.match}(e)?e.match(t):e(t)};function Zn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.some((function(e){return Yn(e,t)}))}}Object.assign;var er="listenerMiddleware";Hn(er+"/add"),Hn(er+"/removeAll"),Hn(er+"/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[en];return an.get(t,e)},set:function(t){var n=this[en];an.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][en];if(!o.P)switch(o.i){case 5:r(o)&&Bt(o);break;case 4:n(o)&&Bt(o)}}}function n(e){for(var t=e.t,n=e.k,r=nn(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==en){var a=t[i];if(void 0===a&&!gt(t,i))return!0;var s=n[i],c=s&&s[en];if(c?c.t!==a:!wt(s,a))return!0}}var l=!!t[en];return r.length!==nn(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){on[e]||(on[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=rn(n);delete i[en];for(var a=nn(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:Tt(),P:!1,I:!1,D:{},l:n,t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,en,{value:i,writable:!0}),o},S:function(e,n,o){o?ht(n)&&n[en].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[en];if(n){var o=n.t,i=n.k,a=n.D,s=n.i;if(4===s)mt(i,(function(t){t!==en&&(void 0!==o[t]||gt(o,t)?a[t]||e(i[t]):(a[t]=!0,Bt(n)))})),mt(o,(function(e){void 0!==i[e]||gt(i,e)||(a[e]=!1,Bt(n))}));else if(5===s){if(r(n)&&(Bt(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),d=0;d<u;d++)i.hasOwnProperty(d)||(a[d]=!0),void 0===a[d]&&e(i[d])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}})}();class tr extends c{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}var nr=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 rr=Xn("initializeConfig",((e,{extra:{api:t,config:n},rejectWithValue:r})=>nr(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)}})))),or=Xn("resetConfig",((e,{extra:{config:t}})=>nr(void 0,void 0,void 0,(function*(){return t}))));const ir=Xn("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 ar="NOT_FOUND",sr=function(e,t){return e===t};function cr(e,t){var n,r,o="object"==typeof t?t:{equalityCheck:t},i=o.equalityCheck,a=void 0===i?sr: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),d=1===c?(n=u,{get:function(e){return r&&n(r.key,e)?r.value:ar},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 ar}return{get:r,put:function(t,o){r(t)===ar&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(c,u);function p(){var t=d.get(arguments);if(t===ar){if(t=e.apply(null,arguments),l){var n=d.getEntries(),r=n.find((function(e){return l(e.value,t)}));r&&(t=r.value)}d.put(arguments,t)}return t}return p.clearCache=function(){return d.clear()},p}function lr(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 ur(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,d=void 0===u?n:u,p=Array.isArray(d)?d:[d],f=lr(r),h=e.apply(void 0,[function(){return a++,c.apply(null,arguments)}].concat(p)),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 dr=ur(cr);const pr=dr((({app:e})=>e),(({userHasResponded:e})=>e)),fr="visibility",hr={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},yr=dr((({config:e})=>e),(e=>{let t=Object.assign({visible:"inline"===(null==e?void 0:e.layoutMode)?hr.open:hr.minimized,appContainerClassNames:e.appContainerClassNames||[]},e);return"function"==typeof t.appContainerClassNames&&(t=Object.assign(Object.assign({},t),{appContainerClassNames:t.appContainerClassNames(t)})),t})),mr=()=>Le(yr),br=({state:e})=>e,gr=()=>Le(br),vr=dr(br,yr,pr,(({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]})),wr=dr(vr,yr,((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&&h(e.payload.occurredAt-s.payload.occurredAt)>=i?e.payload.occurredAt:void 0;a.push(Object.assign(Object.assign({},e),{timeIndicator:t}))}s=e})),a})),Or=()=>Le(wr),jr=(dr(wr,(e=>e.map((e=>e.payload.id)))),()=>gr().isLoading),xr=()=>gr().unreadEvents,Sr=()=>gr().skiplinkTargetId,Cr=dr(wr,(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})),_r=()=>{const{participants:e,currentAgent:t}=gr().participantInfo;return t?e[t]:null},Er=()=>{const{layoutMode:e}=mr();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},Pr=({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!==hr.open?e?n||t||hr.open:hr.hidden:"inline"===i&&e&&!n?t||hr.open:n||t||s||hr.minimized:hr.open},Tr=dr((({visibility:e})=>e),(e=>e.visibility)),kr=dr((({visibility:e})=>e),(e=>e.showInlineView));const Ar=[hr.open,hr.minimized,hr.hidden],Ir=Xn("setVisibility",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),i=Tr(o),a=pr(o),s=n.hasConversation(),c=yr(o),{visibilityCallback:l=Pr,layoutMode:u}=c,{unreadEvents:d}=br(o),p=l({hasResponded:a,previousVisibility:i,requestedVisibility:e,config:c});if(Ar.includes(p)){if(i!==p)return n.store.set(fr,Object.assign(Object.assign({},n.store.get(fr)||{}),{[u]:e})),e&&r.emit("ui.visible",e,{visibility:e,hasConversation:s,hasResponded:a,unreadMessageCount:d}),p}else console.error('The visibilityCallback function should return "open", "minimized" or "hidden".')})),Nr=Xn("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}=yr(n()),i=(null===(e=r.store.get(fr))||void 0===e?void 0:e[o])||hr.initialize;return t(Ir(i)),i}))));var Dr=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 Lr=Xn("initializeApp",((e,{extra:{api:t,config:n},rejectWithValue:r})=>Dr(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:ot,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:it,body:{enabled:!0,locale:s}},!1)),{initialState:void 0,locale:s,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 tr;return r({name:t.name,message:t.message,langKey:t.langKey})}})))),Mr=Xn("resetApp",((e,{dispatch:t,extra:{api:n}})=>Dr(void 0,void 0,void 0,(function*(){yield n.disconnect(),yield n.clearStore(),t(or()),yield t(rr());try{const{locale:e}=yield t(Lr()).unwrap();yield t(ir(e))}catch(e){}t(Nr())})))),Rr=()=>Le(pr),Ur={userHasResponded:!1},Fr=qn({name:"app",initialState:Ur,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(Mr.pending,(()=>Ur)).addCase(Lr.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:zr}=Fr.actions,Br=Fr.reducer,Hr={error:void 0},$r=qn({name:"interrupt",initialState:Hr,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>Hr},extraReducers:e=>{e.addCase(Mr.fulfilled,(()=>Hr)).addMatcher(Zn(Lr.rejected,rr.rejected,ir.rejected,Ir.rejected,Nr.rejected),((e,{payload:t})=>{e.error=t}))}}),{setInterrupt:qr,clearInterrupt:Vr}=$r.actions,Wr=$r.reducer,Gr=({type:e,payload:t})=>e===Ge&&!t.fromClient||"info"===e&&t.type===Ke,Kr=e=>e.sort((({payload:{occurredAt:e}},{payload:{occurredAt:t}})=>e-t)),Jr=(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})},Xr=(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||{}})})},Qr={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:S(),optionsButtonId:S(),headerCollapseButtonId:S(),serviceData:{},options:{features:{},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],entryMeta:{default:Je,active:Je,userSelected:null,blockAutoEntrySwitch:!1,options:{},optionsOverride:{}},seamlyContainerElement:null},Yr=qn({name:"store",initialState:Qr,reducers:{addEvent:(e,t)=>{var n,r;const{type:o,payload:i}=t.payload,a=e.options.features.hasOwnProperty(dt);let s=Object.assign({},e.options);if(a&&(o===Ge||"participant"===o)&&!i.fromClient){const e="message"===o?null===(n=i.entry)||void 0===n?void 0:n.type:{};s=Object.assign(Object.assign({},s),{features:Object.assign(Object.assign({},s.features),{uploads:Object.assign(Object.assign({},null===(r=s.features)||void 0===r?void 0:r.uploads),{enabledFromEntry:e===Xe})})})}const c=Gr(t.payload);if(e.events.find((e=>e.payload.id===i.id)))return;const l=Xr(e.entryMeta,t.payload);e.entryMeta=a||l.active!==Xe?l:Object.assign({},e.entryMeta),e.options=s,c&&(e.unreadEvents+=1,"service_data"!==o&&(t.payload.payload.messageStatus=i.fromClient?Ye:Qe)),t.payload.payload.key=S(),e.events.push(t.payload),e.isLastEventFromClient=i.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=Kr(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===Qe&&{messageStatus:Ye})),e)))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setHistory:(e,{payload:{events:t,participants:n,activeServiceSessionId:r,activeServiceSettings:o={},serviceData:i,resumeConversationPrompt:a}})=>{var s,c;const l=((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 Kr([...r,...n])})(e.events,t),u=Object.assign(Object.assign({},e.participantInfo.participants),n),d=l.slice().reverse().find((e=>("message"===e.type||"participant"===e.type)&&!e.payload.fromClient));let p=null;d&&("message"===d.type&&(p=d.payload.participant),"participant"===d.type&&(p=d.payload.participant.id));const{entry:f}=o,h=null===(s=null==f?void 0:f.options)||void 0===s?void 0:s.upload,y=Xr(Object.assign(Object.assign(Object.assign({},e.entryMeta),f),{active:(null==f?void 0:f.default)||Ke,options:Object.assign({},(null==f?void 0:f.options)?f.options:{})}),l[l.length-1]);let m=Object.assign({},e.options.features);const b=m.hasOwnProperty(dt);if(b&&"message"===(null==d?void 0:d.type)){const{payload:e}=d,t=(null===(c=null==e?void 0:e.entry)||void 0===c?void 0:c.type)||{};m=Object.assign(Object.assign({},m),{uploads:{enabled:!(!h||!(null==h?void 0:h.enabled)),enabledFromEntry:t===Xe}})}e.unreadEvents=l.filter((e=>"message"===e.type&&e.payload.messageStatus===Qe)).length,e.events=l.filter((e=>"participant"!==e.type||!!e.payload.participant.introduction)),e.participantInfo=Object.assign(Object.assign(Object.assign({},e.participantInfo),p?Jr(e.participantInfo,{participant:u[p]}):{}),{participants:u}),e.historyLoaded=!0,e.serviceInfo=Object.assign(Object.assign({},e.serviceInfo),{activeServiceSessionId:r}),e.serviceData=Object.assign(Object.assign({},e.serviceData),i),e.options=Object.assign(Object.assign({},e.options),{features:m||{}}),e.entryMeta=b||y.active!==Xe?y:Object.assign({},e.entryMeta),e.resumeConversationPrompt=a||!1,p&&(e.headerTitles.subTitle=u[p].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=y(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=Jr(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=Qr.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(Mr.pending,(()=>Qr)).addCase(rr.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(Lr.fulfilled,((e,{payload:t})=>{t.initialState&&(e.initialState=t.initialState)})).addMatcher(Zn(co,lo),(e=>{e.isLastEventFromClient=!1}))}}),{ackEvent:Zr,addEvent:eo,clearAllUploads:to,clearEvents:no,clearFeatures:ro,clearIdleDetachCountdown:oo,clearResumeConversationPrompt:io,decrementIdleDetachCountdownCounter:ao,hideOption:so,initIdleDetachCountdown:co,initResumeConversationPrompt:lo,registerUpload:uo,resetHistoryLoadedFlag:po,setActiveEntryType:fo,setActiveService:ho,setBlockAutoEntrySwitch:yo,setEventsRead:mo,setFeatureEnabledState:bo,setFeatures:go,setHeaderSubTitle:vo,setHeaderTitle:wo,setHistory:Oo,setInitialState:jo,setIsLoading:xo,setLoadedImageEventIds:So,setParticipant:Co,setSeamlyContainerElement:_o,setServiceDataItem:Eo,setServiceEntryMetadata:Po,setUploadComplete:To,setUploadError:ko,setUploadProgress:Ao,setUserEntryType:Io,setUserSelectedOption:No,setUserSelectedOptions:Do,showOption:Lo,stopIdleDetachCountdownCounter:Mo}=Yr.actions,Ro=Yr.reducer;const Uo=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:[]}),Fo=["hideOnNoUserResponse","connectWhenInView","showDisclaimer","showFaq","showSuggestions","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon"],zo=(e,t)=>{const n=(i=t,Fo.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},Bo=qn({name:"config",initialState:Uo,reducers:{setConfig:(e,{payload:t})=>zo(e,t),updateConfig:(e,{payload:t})=>zo(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(or.fulfilled,(e=>e)).addCase(rr.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:$o,setPreChatEvents:qo}=Bo.actions,Vo=Bo.reducer;class Wo extends c{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const Go={SeamlyGeneralError:u,SeamlyConfigurationError:l,SeamlySessionExpiredError:d,SeamlyOfflineError:Wo,SeamlyUnauthorizedError:p,SeamlyUnavailableError:tr},Ko=Hn("catch-error",(e=>({payload:e})));function Jo({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:o,api:i,layoutMode:a}=yr(t()),{error:s,type:l}=n,u=Go[null==s?void 0:s.name]?new Go[s.name](s):new c(s);null==r||r(u,{namespace:o,api:i,layoutMode:a,conversationUrl:e.getConversationUrl(),action:l?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 Xo={controls:{}},Qo={value:"",touched:!1},Yo={controls:Qo},Zo=qn({name:"forms",initialState:Yo,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({},Xo),{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]:Qo}},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(Mr.pending,(()=>Yo))}}),{registerForm:ei,deregisterForm:ti,registerControl:ni,deregisterControl:ri,updateControlValue:oi,updateControlTouched:ii}=Zo.actions,ai=Zo.reducer,si=qn({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(rr.fulfilled,((e,{payload:t})=>{e.initialLocale=t.locale})).addCase(ir.pending,(e=>{e.isLoading=!0})).addCase(ir.rejected,(e=>{e.isLoading=!1})).addCase(ir.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:ci,setTranslations:li}=si.actions,ui=si.reducer,di=[u,l,d,Wo,p,tr];function pi({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 u(r);"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}function fi(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?fi(Object(n),!0).forEach((function(t){yi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yi(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 No.toString():e.store.set("options",hi(hi({},e.store.get("options")||{}),{},{[n.payload.option]:n.payload.value}))}return r}}const bi=dr((({i18n:e})=>e),(({translations:e})=>e)),gi=dr((({i18n:e})=>e),(({initialLocale:e})=>e)),vi=dr((({i18n:e})=>e),(({locale:e})=>e)),wi=dr((({i18n:e})=>e),(({isLoading:e})=>e)),Oi={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:Vn(),translatedEventGroups:{},translationProposal:null},ji=(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}},xi=qn({name:"translation",initialState:Oi,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}=ji(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:o,eventIds:i}=ji(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(rr.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(Oo,((e,{payload:t})=>{e.translationProposal=t.translationProposal})).addCase(eo,((e,{payload:t})=>{e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)}))}}),{enableTranslation:Si,disableTranslation:Ci,enableEventsTranslation:_i,disableEventsTranslation:Ei,setTranslationProposalPrompt:Pi,disableTranslationProposalPrompt:Ti}=xi.actions,ki=xi.reducer;function Ai({dispatch:e,getState:t}){return n=>r=>{const o=n(r),{payload:i}=r;switch(r.type){case Oo.type:i?.translation?.enabled&&(e(Si(i.translation.locale)),e(ir(i.translation.locale)));break;case rr.fulfilled.type:i.locale&&e(ir(i.locale));break;case jo.type:i?.translation?.enabled&&(e(Si(i.translation.locale)),e(ir(i.locale)));break;case eo.type:"info"===i.type&&"new_translation"===i?.payload?.body?.subtype&&i.payload.body.translationEnabled&&e(ir(i.payload.body.translationLocale));break;case Ci.type:const n=gi(t());e(ir(n))}return o}}const Ii=qn({name:"visibility",initialState:{visibility:hr.initialize,showInlineView:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(Ir.fulfilled,((e,{payload:t})=>{t&&(e.visibility=t)})).addCase(rr.fulfilled,((e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)}))}}),{setShowInlineView:Ni}=Ii.actions,Di=Ii.reducer,Li=$e,Mi=()=>{const e=Li(),t=Le(Tr),n=!!t&&t!==hr.hidden,r=t===hr.open,o=t===hr.minimized,i=(0,Se.useCallback)((t=>e(Ir(t))),[e]);return{isVisible:n,isOpen:r,isMinimized:o,visible:t,setVisibility:i,openChat:()=>{i(hr.open)},closeChat:()=>{i(hr.minimized)}}},Ri=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,xe.createRef)()})=>{const[r,o]=(0,Se.useState)(null),i=!!(null==r?void 0:r.isIntersecting)||!t,a=i&&e,s=([e])=>o(e);return(0,Se.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}},Ui=()=>(0,Se.useContext)(Ve),Fi=()=>Ui().store||{},zi=()=>{const e=Ui();return(0,Se.useCallback)((()=>e.hasConversation()),[e])};function Bi(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?Bi(Object(n),!0).forEach((function(t){$i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $i(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=Ui(),t=mr(),n=$e(),r=(0,Se.useContext)(We),o=Rr(),i=zi(),{visible:a,setVisibility:c}=Mi(),l=xr(),u=(0,Se.useCallback)(((...e)=>{r.emit(...e)}),[r]),d=(0,Se.useCallback)((()=>{e.sendContext(t.context||{}),u("ui.beforeStart",{visibility:a,hasConversation:i(),hasResponded:o,unreadMessageCount:l}),e.send("start"),u("ui.start",{visibility:a,hasConversation:i(),hasResponded:o,unreadMessageCount:l})}),[e,t.context,u,i,o,l,a]),p=(0,Se.useCallback)((async()=>{n(Mr())}),[n]),f=(0,Se.useCallback)((e=>({type:e,id:S(),transactionId:S(),participant:s,fromClient:!0,occurredAt:1e3*Date.now(),meta:{}})),[]),h=(0,Se.useCallback)((e=>Hi(Hi({},f("text")),{},{body:{text:e}})),[f]),y=(0,Se.useCallback)((({body:t,config:r={}})=>{if(""===t.trim())return;const o=Hi(Hi({},h(t)),r);e.send("message",o),u("message",o),n(eo({type:"message",payload:Hi(Hi({},o),{},{optimisticallyInjected:!0})}))}),[e,n,u,h]),m=(0,Se.useCallback)(((e,t=S())=>{n(eo({type:"message",payload:Hi(Hi({},h(e)),{},{transactionId:t})}))}),[n,h]),b=(0,Se.useCallback)(((e,t,r,o,i,a,c)=>{n(eo({type:"message",payload:{type:"upload",id:e,transactionId:t,participant:s,fromClient:!0,occurredAt:r,meta:{},body:{contentType:o,filename:i,filesize:a,url:c}}}))}),[n]),g=(0,Se.useCallback)(((e,t=S())=>{const r={body:{subtype:e,type:"divider"},fromClient:!1,fromHistory:!0,id:S(),transactionId:t,type:"divider"};n(eo({type:"info",payload:r}))}),[n]),v=(0,Se.useCallback)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==et&&n!==tt&&u(`action.${n}`,t)}),[e,u]),w=(0,Se.useCallback)((t=>{e.sendContext(t)}),[e]),O=(0,Se.useCallback)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&(n(jo(e)),e.userResponded&&(n(zr(e.userResponded)),c(hr.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,c]);return{connect:O,start:d,sendMessage:y,sendAction:v,sendContext:w,reset:p,emitEvent:u,addMessageBubble:m,addUploadBubble:b,addDivider:g,apiConnected:e.connected,apiConfigReady:e.configReady}};function Vi(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 Wi(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=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Vi(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)?Vi(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 Gi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ki(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 Ji(e){return e.reduce((function(e,t){return e.concat(Array.isArray(t)?Ji(t):t)}),[])}function Xi(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 Qi(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=Yi(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 Yi(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 Zi(e){return ea(e.slice(1,-1),",",3)}function ea(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),ea(a,t,n-1,r)}var ta;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 ra(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){pn(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}var oa=0,ia="other";function aa(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(oa++);r+="{".concat(a,", number}"),i[a]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:i}}var sa="other";const ca=new(function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Gi(this,e),pn(this,"format",Xi((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ji(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=Yi(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=Zi(o),c=Wi(s,3),l=c[0],u=c[1],d=c[2],p=t[l];null==p&&(p="");var f=u&&this.typeHandlers[u];i.push(f?f(p,d,this.locale,t,this.process.bind(this)):p);var h=e.substring(r+1);return h&&i.push(this.process(h,t)),i}}return[e]}}],n&&Ki(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=Qi(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!==ta&&ta.resolvedOptions().locale===n||(ta=new Intl.PluralRules(n));var u=ta.select(c);u!==ia&&l.push(u)}1===c&&l.push("one"),l.push("=".concat(c),ia);for(var d=0;d<l.length;d++){var p=l[d];if(p in s){var f=aa(s[p],c),h=f.caseBody,y=f.numberValues;return o(h,ra(ra({},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=Qi(t),i=o.cases;return e in i?r(i[e],n):sa in i?r(i.other,n):e}});function la(){const e=Le(bi),t=Le(vi),n=Le(gi),r=Le(wi),o=(0,Se.useCallback)(((n,o={})=>{const i=e[n];return i?ca.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 ua=(0,xe.createContext)(null),da=()=>{const e=(0,Se.useContext)(ua);return{sendPolite:(0,Se.useCallback)((t=>{t&&e({ariaLive:lt,messageText:t})}),[e]),sendAssertive:(0,Se.useCallback)((t=>{t&&e({ariaLive:ct,messageText:t})}),[e])}},pa=({children:t})=>((()=>{const e=Or(),{t}=la(),{isInline:n,isWindow:r,isApp:o}=Er(),{isOpen:i,isVisible:a}=Mi(),s=Le(kr),c=$e(),l=(0,Se.useRef)(null),{start:u,connect:d,apiConfigReady:p,apiConnected:f}=qi(),h=zi(),y=(0,Se.useRef)(null),m=(0,Se.useRef)(null),b=(0,Se.useRef)(!1),{sendAssertive:g}=da();(0,Se.useEffect)((()=>{a&&setTimeout((()=>{g(t("window.srTexts.onLoad"))}),500)}),[a,g,t]),(0,Se.useEffect)((()=>{if(a!==m.current)return y.current=i,void(m.current=a);null!==y.current&&g(t(i?"window.srTexts.onOpen":"window.srTexts.onClose")),y.current=i,m.current=a}),[i,a,g,t]),(0,Se.useEffect)((()=>(l.current=setTimeout((()=>{c(xo(!0))}),500),()=>{clearTimeout(l.current)})),[c]),(0,Se.useEffect)((()=>(e.length&&(l.current=setTimeout((()=>{c(xo(!1))}),5e3)),()=>{clearTimeout(l.current)})),[e,c]),(0,Se.useEffect)((()=>{p&&f||(b.current=!1)}),[p,f]);const v=(0,Se.useCallback)((async()=>{f||(b.current=!0,await d()),(o||i||a&&n)&&u()}),[f,d,o,n,i,a,u]);(0,Se.useEffect)((()=>{p&&!b.current&&(!r||i||h())&&(!n||a&&s)&&(h()&&i&&(clearTimeout(l.current),c(xo(!1))),v())}),[p,v,c,h,n,i,r,a,s])})(),(0,e.jsx)(e.Fragment,{children:t})),fa=(0,xe.createContext)({}),ha=()=>mr().appContainerClassNames,ya=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},ma=(e=0)=>new Promise((t=>{setTimeout(t,e)})),ba=()=>{const{seamlyContainerElement:e}=gr(),t=$e();return[e,(0,Se.useCallback)((e=>{t(_o(e))}),[t])]},ga=e=>(0,Se.useCallback)((()=>{var t;t=e,requestAnimationFrame((async()=>{await ma(180);const e="string"==typeof t?document.getElementById(t):t;w(e)}))}),[e]),va=()=>{const e=Sr();return ga(e)},wa=(0,xe.createContext)({});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 ja(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){xa(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 xa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Sa=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=gr(),{allowedMimeTypes:o,maxSize:i}=n.upload||{},{enabled:a,enabledFromEntry:s}=r||{},{allowedMimeTypes:c,maxSize:l}=ja(ja(ja({},t.upload||{allowedMimeTypes:[],maxSize:0}),o?{allowedMimeTypes:o}:{}),i?{maxSize:i}:{});return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:s||a,allowedMimeTypes:c,maxSize:l}},Ca=()=>{const{currentUploads:e}=gr(),t=$e(),n=(0,Se.useContext)(wa);return{uploadFile:(0,Se.useCallback)((e=>{n(e)}),[n]),clearUploads:(0,Se.useCallback)((()=>{t(to())}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}};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 Ea(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){Pa(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}function Pa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ta=()=>{const{t:e}=la(),{options:t}=gr(),{panelActive:n,optionActive:r,userSelectedOptions:o,features:i}=t,{cobrowsing:a,sendTranscript:s}=i,c={cobrowsing:a,sendTranscript:s},l=Object.keys(c).filter((e=>c[e])).map((t=>({name:t,title:e(`options.${t}.menuTitle`),available:c[t].enabled}))),u=a||s,d=$e(),{get:p,set:f}=Fi();return{allowOptionSelection:u,userSelectedOptions:o,features:i,menuOptions:l,initUserSelectedOptions:(0,Se.useCallback)((()=>{const e=p("options")||{};d(Do(e))}),[p,d]),setUserSelectedOptions:(0,Se.useCallback)((e=>{d(Do(e)),f("options",e)}),[f,d]),setUserSelectedOption:(0,Se.useCallback)(((e,t)=>{const n=p("options")||{};f("options",Ea(Ea({},n),{},{[e]:t})),d(No({option:e,value:t}))}),[d,p,f]),showOption:e=>{d(Lo(e))},hideOption:()=>{d(so())},panelActive:n,optionActive:r}},ka=()=>{const{optionsButtonId:e}=gr();return{id:e,focusButton:ga(e)}},Aa=(0,xe.createContext)(null),Ia=()=>(0,Se.useContext)(Aa);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 Da(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){La(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 La(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ma=()=>{const e=$e(),{idleDetachCountdown:t}=gr(),{isOpen:n}=Mi(),r=(0,Se.useRef)({});r.current={hasCountdown:t.hasCountdown,isActive:t.isActive,remaining:t.remaining,wasStopped:t.wasStopped,isOpen:n};const{emitEvent:o,sendAction:i}=qi(),{t:a}=la(),{sendAssertive:s,sendPolite:c}=da(),l=(0,Se.useCallback)((e=>{const{isOpen:t}=r.current;t&&s(e)}),[s]),u=(0,Se.useCallback)((e=>{const{isOpen:t}=r.current;t&&c(e)}),[c]),d=(0,Se.useCallback)((t=>{const n=(e=>Math.ceil(e/1e3))(t),r=y(n);e(co({delaySeconds:n,delayTime:r})),o("idleTimer.start"),l(`${a("idleDetachWarning.countdownTitle")} ${a("idleDetachWarning.countdownText")} ${a("idleDetachWarning.countdownTimer",r)}`)}),[e,o,l,a]),p=(0,Se.useCallback)(((t,n)=>{const{hasCountdown:s,wasStopped:c}=r.current;s&&(t||(n||i({type:nt}),l(a("idleDetachWarning.notifyTransferText"))),c||o("idleTimer.stop"),e(oo()))}),[e,i,o,l,a]),f=(0,Se.useCallback)((()=>{const{remaining:t}=r.current;if(t<=0)return;const n=t-1;n%10==0&&l(`${a("idleDetachWarning.countdownText")} ${a("idleDetachWarning.countdownTimer",y(n))}`),e(ao())}),[e,l,a]),h=(0,Se.useCallback)((()=>{const{isActive:t,remaining:n}=r.current;t&&(e(Mo()),n&&(o("idleTimer.stop"),u(a("idleDetachWarning.srCountDownStoppedText"))))}),[e,o,u,a]);return Da(Da({},t),{},{initCountdown:d,endCountdown:p,decrementCountdown:f,stopCountdown:h})},Ra=()=>{const e=$e(),t=gr().resumeConversationPrompt,{sendAction:n}=qi(),{t:r}=la(),{sendAssertive:o}=da();return{continueChat:()=>{n({type:rt,body:{type:"resume_conversation_prompt"}}),e(io())},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:nt}),e(io())}}},Ua=()=>{const[e]=(0,Se.useState)((()=>S()));return e},Fa=e=>{const t=(0,Se.useRef)(null);t.current=e;const n="function"==typeof e;return(0,Se.useMemo)((()=>n?(...e)=>t.current(...e):void 0),[n])};function za(){const{sendAction:e}=qi(),t=$e(),n=(0,Se.useCallback)(((n,r="translation_choice")=>{e({type:it,body:{enabled:!0,locale:n,source:r}}),t(Si(n)),t(Ti())}),[e,t]),r=(0,Se.useCallback)((()=>{e({type:it,body:{enabled:!1}}),t(Ci())}),[e,t]),{languages:o,isActive:i,isAvailable:a,currentLocale:s}=Le((({translations:e})=>e));return{languages:o,isActive:i,isAvailable:a,currentLocale:s,enableTranslations:n,disableTranslations:r}}function Ba(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=Le((e=>dr((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 Ha(){const e=Le((({translations:e})=>e.containerId));return{id:e,focusContainer:ga(e)}}function $a(e){const{languages:t}=za();return(0,Se.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 qa=(...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(i)>-1?e:[i,e].join("-"))).join(" "),Va=({eventPayload:t})=>{const{t:n}=la(),{fromClient:r,participant:o}=t,i=(e=>gr().participantInfo.participants[e])(o)||{},{messages:a}=mr(),s=r?n("participants.user.name"):i&&i.name,{showAvatar:c,showName:l}=a[r?"user":"agent"]||{};if(!c&&!l)return null;const u=[];return c&&s&&i.avatar&&u.push((0,e.jsx)("span",{className:qa("message__avatar"),children:(0,e.jsx)("img",{src:i.avatar,className:qa("avatar"),alt:""})})),l&&u.push((0,e.jsx)("span",{className:qa("message__author-name"),children:s})),u.length>0&&(0,e.jsx)("div",{className:qa("message__author"),children:u})},Wa=["showParticipant","event","type","modifiers","children","bodyProps","info"];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 Ka(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){Ja(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 Ja(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xa=function(t){let{showParticipant:n=!0,event:r,type:o,modifiers:i,children:a,bodyProps:s={},info:c}=t,l=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}(t,Wa);const u=ya(r),{hasTranslation:d,isTranslated:p,locale:f}=Ba(r);return o&&u.push(`message--type-${o}`),i&&("string"==typeof i&&(i=i.split(" ").filter((e=>e.length))),i.forEach((e=>{u.push(`message--${e}`)}))),p&&u.push("message--is-translated"),d&&u.push("message--has-translation"),p&&(s=Ka(Ka({},s),{},{lang:f})),(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("div",Ka(Ka({className:qa(u)},l),{},{children:[n&&(0,e.jsx)(Va,{eventPayload:r.payload}),(0,e.jsx)("div",Ka(Ka({className:qa("message__body")},s),{},{children:a})),c&&(0,e.jsx)("div",{"aria-hidden":"true",className:qa("message__info"),children:c})]}))})};function Qa(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 Ya(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qa(Object(n),!0).forEach((function(t){Za(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Za(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const es=({id:t,action:n,buttonText:r,description:o,hasFocus:i,image:a,title:s,isCarouselItem:c})=>{const l=(0,Se.useRef)(null),{sendMessage:u,sendAction:d,emitEvent:p}=qi(),f=Ua(),h=(0,Se.useRef)(),y=n.type===pt?"a":"button",m=(0,Se.useCallback)((()=>p("action.click_card",{type:at,originMessage:t,action:n})),[p,t,n]),b=(0,Se.useCallback)((()=>{if(m(),"ask"===n.type)u({body:n.ask});else if("topic"===n.type){const{topic:e,fallbackMessage:t}=n;d({type:ot,body:{name:e,fallbackMessage:t}})}}),[u,n,d,m]),g=(0,Se.useMemo)((()=>n.type===pt?{href:n.link,rel:"noopener noreferrer",target:n.newTab?"_blank":"_self",onClick:m}:{onClick:b}),[n,b,m]);return(0,Se.useEffect)((()=>{c&&(i&&h.current?window.requestAnimationFrame((()=>l.current.focus())):l.current.blur()),h.current=!0}),[i,c]),(0,e.jsxs)("div",{className:qa("card__wrapper"),id:t,tabIndex:"-1",ref:l,children:[(0,e.jsx)("img",{className:qa("card__image"),src:a,alt:""}),(0,e.jsxs)("div",{className:qa("card__content"),id:t,children:[s&&(0,e.jsx)("h2",{className:qa("card__title"),children:s}),o&&(0,e.jsx)("div",{className:qa("card__description"),dangerouslySetInnerHTML:{__html:o}}),(0,e.jsx)(y,Ya(Ya({tabIndex:c&&!i?"-1":void 0,className:qa("button","button--primary"),"aria-describedby":f},g),{},{children:r}))]})]})};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 ns(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){rs(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}function rs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function os(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 is(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?os(Object(n),!0).forEach((function(t){as(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):os(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function as(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ss({item:t,items:n,index:r,isActive:o}){const{t:i}=la();return(0,e.jsx)("div",{className:qa("carousel-item",`carousel-item--${t.type}`),role:"group","aria-roledescription":"slide","aria-label":i("carousel.slide.label",{index:r+1,total:n.length}),children:(0,e.jsx)(es,is(is({},t),{},{isCarouselItem:!0,hasFocus:o}))})}const cs={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'},ls=({name:t,size:n="32",className:r,alt:o})=>{const i=`${t}${n}`;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{"aria-hidden":"true",className:r||qa("icon"),dangerouslySetInnerHTML:{__html:cs[i]}}),o&&(0,e.jsx)("span",{className:qa("visually-hidden"),children:o})]})};function us({items:t,currentIndex:n,onChange:r,children:o}){const{t:i}=la(),a=t.length;return(0,e.jsxs)("div",{className:qa("carousel-controls"),children:[(0,e.jsx)("button",{className:qa("button","button--previous"),"aria-label":i("carousel.controls.previous"),onClick:()=>{r((n-1+a)%a)},children:(0,e.jsx)(ls,{name:"arrowLeft",size:"16"})}),o,(0,e.jsx)("button",{className:qa("button","button--next"),"aria-label":i("carousel.controls.next"),onClick:()=>{r((n+1)%a)},children:(0,e.jsx)(ls,{name:"arrowRight",size:"16"})})]})}function ds({items:t,currentIndex:n,onChange:r,getItemKey:o,getItemLabel:i}){const a=t.length,s=(0,Se.useCallback)((e=>{const t=Number(e.target.dataset.item||"0"),o=Math.min(a-1,Math.max(0,t));o!==n&&r(o)}),[a,n,r]);return(0,e.jsx)("div",{className:qa("carousel-pagination__wrapper"),role:"group",children:(0,e.jsx)("ul",{className:qa("carousel-pagination"),children:t.map(((t,r)=>{const a=n===r;return(0,e.jsx)("li",{className:qa("carousel-pagination__item",a?"is-active":void 0),children:(0,e.jsx)("button",{className:qa("carousel-pagination__button"),type:"button",onClick:s,"data-item":r,"aria-disabled":a?"true":void 0,"aria-label":i(t,r)})},o(t,r,"pagination-item-"))}))})})}const ps=(e,t,n)=>`${n}${t}`,fs=e=>e.label,hs=({target:e})=>{e.scrollLeft=0};function ys({currentIndex:t,onChange:n,getItemKey:r=ps,getItemLabel:o=fs,items:i}){const a=Ua(),s=i.length,[c,l]=(0,Se.useState)(Number(t||"0"));(0,Se.useEffect)((()=>{l(Number(t||"0"))}),[l,t]);const u=(0,Se.useRef)([]);u.current=(0,Se.useMemo)((()=>Array(s).fill(1).map((()=>(0,xe.createRef)()))),[s]);const d=(0,Se.useRef)(!0),p=(0,Se.useRef)();return p.current=n,(0,Se.useEffect)((()=>{d.current?d.current=!1:p.current&&p.current(c)}),[c]),(0,e.jsxs)("div",{className:qa("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,e.jsx)("div",{className:qa("carousel__slides-wrapper"),onScroll:hs,children:(0,e.jsx)("div",{id:a,className:qa("carousel__slides"),style:{width:100*s+"%",left:-100*c+"%"},"aria-live":"polite","aria-atomic":"false",children:i.map(((t,n)=>{const o=c===n;return(0,e.jsx)("div",{ref:u.current[n],className:qa("carousel__slide",o?"is-active":void 0),"aria-hidden":o?void 0:"true",children:(0,e.jsx)(ss,{item:t,items:i,currentIndex:c,index:n,isActive:o})},r(t,n,"item-"))}))})}),(0,e.jsx)("div",{className:qa("carousel__controls"),children:(0,e.jsx)(us,{currentIndex:c,items:i,onChange:l,controlId:a,children:(0,e.jsx)("div",{className:qa("carousel__pagination"),children:(0,e.jsx)(ds,{currentIndex:c,items:i,onChange:l,getItemKey:r,getItemLabel:o})})})})]})}const ms=(e,t,n="")=>`${n}${e.title}:${t}`,bs=e=>e.title,gs=["event","children"];function vs(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 ws(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vs(Object(n),!0).forEach((function(t){Os(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Os(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const js=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,xs=({id:t,categories:n=[],question:r,onClick:o,hasIcon:i})=>{const a=(0,Se.useMemo)((()=>["suggestions__item",...n.map(js)]),[n]),s=(0,Se.useCallback)((()=>{o&&o({id:t,question:r})}),[t,r,o]);return(0,e.jsx)("li",{className:qa(a),children:(0,e.jsxs)("button",{type:"button",onClick:s,className:qa("button","button--primary"),children:[i&&(0,e.jsx)(ls,{name:"chevronRight",size:"8"}),r]})})};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 Cs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _s=({className:t,suggestions:n=[],onClickSuggestion:r,hasIcon:o=!0})=>(0,e.jsx)("ul",{className:qa("suggestions__list",t),children:n.map((t=>(0,e.jsx)(xs,function(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){Cs(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}({hasIcon:o,onClick:r},t),t.id)))}),Es=["event"];function Ps(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 Ts(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ps(Object(n),!0).forEach((function(t){ks(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ps(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ks(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const As=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 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 Ns(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 in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ls({children:t,childrenHTML:n,className:r,graphicSrc:o,graphicType:i="icon",iconName:a,iconSize:s,iconClassName:c,dividerType:l}){const u=Boolean(a||o),d=n?{dangerouslySetInnerHTML:{__html:n}}:{children:t};return(0,e.jsxs)("div",{className:qa("divider",l&&`divider--type-${l}`,r),children:[u&&(0,e.jsx)("span",{className:qa("divider__graphic"),children:a?(0,e.jsx)(ls,{name:a,size:s,className:c}):(0,e.jsx)("img",{src:o,className:qa({icon:"icon"===i,avatar:"avatar"===i},c)})}),(0,e.jsx)("div",Ns({className:qa("divider__body")},d))]})}const Ms={[ut.new_topic]:"newtopic"},Rs=["event"];function Us(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 Fs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const zs={default:({event:t})=>{const{t:n}=la(),{subtype:r}=t.payload.body,o=Ms[ut[r]];return(0,e.jsx)(Ls,{dividerType:o,iconName:ut[r],children:(0,e.jsx)("p",{children:n(`dividerKeys.${ut[r]}`)})})},[ut.new_translation]:({event:t})=>{const{t:n}=la(),r=Or(),{body:{restartButtonText:o,translationEnabled:i,translationLocale:a,text:s,title:c},id:l}=t.payload,{enableTranslations:u}=za(),d=Le((e=>e.translations.translatedEventGroups)),p=$e(),f=(0,Se.useCallback)((()=>{d[l]?p(_i({events:r,id:l})):p(Ei({events:r,id:l}))}),[p,r,l,d]);return(0,e.jsxs)(Ls,{iconName:"newTranslation",dividerType:"newtranslation",children:[(0,e.jsx)("p",{className:qa("divider__title"),children:c}),s&&(0,e.jsx)("p",{children:s}),i?(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("button",{className:qa("button","button--secondary"),onClick:f,children:n(d[l]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):(0,e.jsx)("button",{className:qa("button","button--secondary"),"data-testid":"restartTranslationButton",onClick:()=>{u(a)},children:o})]})}},Bs={month:"long",day:"numeric",year:"numeric"},Hs={hour:"numeric",minute:"numeric"},$s=({event:t})=>{const n=(()=>{const[e,t]=(0,Se.useReducer)((e=>e+1),0);return(0,Se.useCallback)((()=>{setTimeout((()=>{t()}))}),[])})(),{date:r,time:o,timeUntilMidnight:i,srText:a}=(e=>{const{t}=la(),n=mr()?.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,Hs).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,Bs).format(r)}return{date:l,srText:t("dateTime.srText",{date:l,time:c}),time:c,fullDateTime:s,timeUntilMidnight:a}})(h(t.timeIndicator));return(0,Se.useEffect)((()=>{const e=setTimeout((()=>{n()}),i);return()=>{clearTimeout(e)}}),[n,i]),(0,e.jsxs)(Ls,{dividerType:"time-indicator",children:[(0,e.jsxs)("p",{className:qa("divider__time"),"aria-hidden":"true",children:[(0,e.jsx)("span",{children:r}),(0,e.jsx)("span",{children:o})]}),(0,e.jsx)("p",{className:qa("visually-hidden"),children:a})]})};var qs=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],Vs=qs.join(","),Ws="undefined"==typeof Element,Gs=Ws?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ks=!Ws&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},Js=function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(Vs));return t&&Gs.call(e,Vs)&&r.unshift(e),r.filter(n)},Xs=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{Gs.call(a,Vs)&&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 d=e(!0===l?a.children:l.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}return o},Qs=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},Ys=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Zs=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 Zs(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Gs.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Gs.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 a=e.parentElement,s=Ks(e);if(a&&!a.shadowRoot&&!0===r(a))return ec(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){for(var t,n=Ks(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=Ks(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!!Gs.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 Zs(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Ks(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)||Qs(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,a=i?t.scopeParent:t,s=Qs(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(Ys).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?Xs([e],t.includeContainer,{filter:nc.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:rc}):Js(e,t.includeContainer,nc.bind(null,t)),oc(n)},ac=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Gs.call(e,Vs)&&nc(t,e)},sc=qs.concat("iframe").join(","),cc=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Gs.call(e,sc)&&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){dc(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 dc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pc,fc=(pc=[],{activateTrap:function(e){if(pc.length>0){var t=pc[pc.length-1];t!==e&&t.pause()}var n=pc.indexOf(e);-1===n||pc.splice(n,1),pc.push(e)},deactivateTrap:function(e){var t=pc.indexOf(e);-1!==t&&pc.splice(t,1),pc.length>0&&pc[pc.length-1].unpause()}}),hc=function(e){return setTimeout(e,0)},yc=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},mc=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 gc(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?gc(Object(n),!0).forEach((function(t){wc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Oc=({children:e,onClose:t,"aria-label":n,"aria-labelledby":r,fallBackFocusRef:o})=>{const i=Ua(),a=(0,Se.useRef)(null),s=(0,Se.useRef)(null),[c,l]=(0,Se.useState)(!1);return(0,Se.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=uc({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},t),l={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},u=function(e,t,n){return e&&void 0!==e[t]?e[t]:i[n||t]},d=function(e){return l.containerGroups.findIndex((function(t){var n=t.container,r=t.tabbableNodes;return n.contains(e)||r.find((function(t){return t===e}))}))},p=function(e){var t=i[e];if("function"==typeof t){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];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},f=function(){var e=p("initialFocus");if(!1===e)return!1;if(void 0===e)if(d(r.activeElement)>=0)e=r.activeElement;else{var t=l.tabbableGroups[0];e=t&&t.firstTabbableNode||p("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},h=function(){if(l.containerGroups=l.containers.map((function(e){var t=ic(e,i.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?Xs([e],t.includeContainer,{filter:tc.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Js(e,t.includeContainer,tc.bind(null,t))}(e,i.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 ac(e,i.tabbableOptions)})):n.slice(0,r).reverse().find((function(e){return ac(e,i.tabbableOptions)}))}}})),l.tabbableGroups=l.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),l.tabbableGroups.length<=0&&!p("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},y=function e(t){!1!==t&&t!==r.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!i.preventScroll}),l.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(f()))},m=function(e){var t=p("setReturnFocus",e);return t||!1!==t&&e},b=function(e){var t=bc(e);d(t)>=0||(mc(i.clickOutsideDeactivates,e)?n.deactivate({returnFocus:i.returnFocusOnDeactivate&&!cc(t,i.tabbableOptions)}):mc(i.allowOutsideClick,e)||e.preventDefault())},g=function(e){var t=bc(e),n=d(t)>=0;n||t instanceof Document?n&&(l.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),y(l.mostRecentlyFocusedNode||f()))},v=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==mc(i.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var t=bc(e);h();var n=null;if(l.tabbableGroups.length>0){var r=d(t),o=r>=0?l.containerGroups[r]:void 0;if(r<0)n=e.shiftKey?l.tabbableGroups[l.tabbableGroups.length-1].lastTabbableNode:l.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var a=yc(l.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(a<0&&(o.container===t||cc(t,i.tabbableOptions)&&!ac(t,i.tabbableOptions)&&!o.nextTabbableNode(t,!1))&&(a=r),a>=0){var s=0===a?l.tabbableGroups.length-1:a-1;n=l.tabbableGroups[s].lastTabbableNode}}else{var c=yc(l.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(c<0&&(o.container===t||cc(t,i.tabbableOptions)&&!ac(t,i.tabbableOptions)&&!o.nextTabbableNode(t))&&(c=r),c>=0){var u=c===l.tabbableGroups.length-1?0:c+1;n=l.tabbableGroups[u].firstTabbableNode}}}else n=p("fallbackFocus");n&&(e.preventDefault(),y(n))}(e)},w=function(e){var t=bc(e);d(t)>=0||mc(i.clickOutsideDeactivates,e)||mc(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},O=function(){if(l.active)return fc.activateTrap(n),l.delayInitialFocusTimer=i.delayInitialFocus?hc((function(){y(f())})):y(f()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",b,{capture:!0,passive:!1}),r.addEventListener("touchstart",b,{capture:!0,passive:!1}),r.addEventListener("click",w,{capture:!0,passive:!1}),r.addEventListener("keydown",v,{capture:!0,passive:!1}),n},j=function(){if(l.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",b,!0),r.removeEventListener("touchstart",b,!0),r.removeEventListener("click",w,!0),r.removeEventListener("keydown",v,!0),n},n={get active(){return l.active},get paused(){return l.paused},activate:function(e){if(l.active)return this;var t=u(e,"onActivate"),n=u(e,"onPostActivate"),o=u(e,"checkCanFocusTrap");o||h(),l.active=!0,l.paused=!1,l.nodeFocusedBeforeActivation=r.activeElement,t&&t();var i=function(){o&&h(),O(),n&&n()};return o?(o(l.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!l.active)return this;var t=uc({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(l.delayInitialFocusTimer),l.delayInitialFocusTimer=void 0,j(),l.active=!1,l.paused=!1,fc.deactivateTrap(n);var r=u(t,"onDeactivate"),o=u(t,"onPostDeactivate"),a=u(t,"checkCanReturnFocus"),s=u(t,"returnFocus","returnFocusOnDeactivate");r&&r();var c=function(){hc((function(){s&&y(m(l.nodeFocusedBeforeActivation)),o&&o()}))};return s&&a?(a(m(l.nodeFocusedBeforeActivation)).then(c,c),this):(c(),this)},pause:function(){return l.paused||!l.active||(l.paused=!0,j()),this},unpause:function(){return l.paused&&l.active?(l.paused=!1,h(),O(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return l.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),l.active&&h(),this}},n.updateContainerElements(e),n),s.current.activate()),()=>{s.current&&s.current.deactivate()};var e,t,n,r,i,l,u,d,p,f,h,y,m,b,g,v,w,O,j}),[c,o]),(0,Se.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,Se.useEffect)((()=>{c&&a.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()}))}),[c,t]),(0,Se.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=vc(vc({},e.props),{},{onClose:t}),e))),a.current)},jc=({url:t,description:n,onClose:r})=>{const{zIndex:o,layoutMode:i,namespace:a}=mr(),s=Ia(),c=ha(),l=(0,Se.useRef)(null),{t:u}=la(),d=["modal",`app--layout-${i}`,`namespace--${a}`,...c],p=e=>{e.stopPropagation()},f=()=>{r()},h=o?{zIndex:o+1}:void 0;return(0,e.jsx)(Oc,{onClose:r,"aria-label":u("lightbox.heading"),fallBackFocusRef:l,children:({onClose:r,modalRenderFn:o})=>o((r=>(0,e.jsx)("div",{className:qa(d),onClick:f,style:h,children:(0,e.jsxs)("div",{className:qa("modal__float"),tabIndex:"-1",onMouseDown:s,onKeyDown:s,onTouchStart:s,onMouseMove:s,onWheel:s,onPointerDown:s,onPointerMove:s,ref:l,children:[(0,e.jsx)("div",{className:qa("modal__inner"),onClick:p,children:(0,e.jsx)("img",{className:qa("modal__image"),src:t,alt:n})}),(0,e.jsxs)("button",{type:"button",className:qa("modal__close"),onClick:r,children:[(0,e.jsx)(ls,{name:"close",size:"16"}),u("lightbox.closeLabel")]})]})}))(r))})},xc=({description:t,url:n})=>{const{t:r}=la(),[o,i]=(0,Se.useState)(!1);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{type:"button",className:qa("modal__enlarge"),onClick:()=>{i(!0)},children:[r("message.image.srTextEnlargeButtonLabel",{description:t}),(0,e.jsx)(ls,{name:"enlarge",size:"32"})]}),o&&(0,e.jsx)(jc,{url:n,description:t,onClose:()=>{i(!1)}})]})},Sc=["event","descriptorId"];function Cc(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?Cc(Object(n),!0).forEach((function(t){Ec(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ec(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Pc=["event"];function Tc(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 kc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tc(Object(n),!0).forEach((function(t){Ac(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ac(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ic=["event"];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 Dc(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){Lc(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 Lc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Mc=t=>{let{event:n}=t,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}(t,Ic);const{body:o}=Ba(n),i=As(n.payload.id),a=(0,Se.useMemo)((()=>n.payload.optimisticallyInjected?{children:(0,e.jsx)("p",{children:o.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:o.text}}}),[o,n]);return(0,e.jsx)(Xa,Dc(Dc({type:"text",event:n,onClick:i},r),a))},Rc=["event"];function Uc(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 Fc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Uc(Object(n),!0).forEach((function(t){zc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zc(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 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 $c(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){qc(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 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 Vc=({children:t,url:n,target:r})=>n?(0,e.jsx)("a",{href:n,download:!0,target:r||void 0,className:qa(["download","download-link"]),children:t}):(0,e.jsx)("span",{className:qa("download"),children:t}),Wc=["event","descriptorId"];function Gc(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 Kc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gc(Object(n),!0).forEach((function(t){Jc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xc(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 Qc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xc(Object(n),!0).forEach((function(t){Yc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zc={message:{choice_prompt:t=>{let{event:n,children:r}=t,o=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}(t,gs);const{t:i}=la(),a=Ua(),{body:s,subEvent:c,showOptions:l,chooseAgain:u,onChoiceClickHandler:d,onChooseAgainClickHandler:p}=(e=>{const{payload:t}=e,[n,r]=(0,Se.useState)(!1),{sendAction:o,addMessageBubble:i,addDivider:a}=qi(),{activeServiceSessionId:s}=gr().serviceInfo,c=Le(Cr),{body:l}=Ba(e),{service:u}=t,d=(0,Se.useMemo)((()=>ws(ws({},e),{},{payload:ws(ws({},e.payload),{},{body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&ws(ws({},e.payload.translatedBody),{},{data:e.payload.translatedBody.data.prompt})})})),[e]),p=l.chooseAgain&&s===u.serviceSessionId&&t.id!==c;return(0,Se.useEffect)((()=>{r(t.id===c)}),[t,c]),{body:l,subEvent:d,showOptions:n,chooseAgain:p,onChoiceClickHandler:e=>{const n=S();p&&a("new_topic",n),i(e.text,n),o({type:"pick_choice",originMessage:t.id,choice:{id:e.id,text:e.text,chooseAgain:p},transactionId:n}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}})(n);return(0,e.jsxs)(e.Fragment,{children:[(0,xe.toChildArray)(r).map((e=>(e.props=ws(ws({},e.props),{},{event:c,descriptorId:a,showTranslationToggle:!1}),e))),u&&(0,e.jsxs)("button",{type:"button",className:qa("button","button--secondary","button--choose-again"),"aria-expanded":l?"true":"false",onClick:p,"aria-describedby":a,children:[i(l?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,e.jsx)(ls,{name:"chevronDown",size:"8"})]}),l&&(0,e.jsx)(Xa,ws(ws({type:"choice-prompt",showParticipant:!1,event:n},o),{},{children:(0,e.jsx)("ul",{className:qa("choice-prompt","choice-prompt--many"),children:s.choices.map((t=>(0,e.jsx)("li",{className:qa("choice-prompt__item",{[`choice-prompt__item--${t.category}`]:t.category}),children:(0,e.jsx)("button",{type:"button",className:qa("button","button--primary"),onClick:()=>{d(t)},children:t.text})},t.id)))})}))]})},text:Mc,image:t=>{let{event:n,descriptorId:r}=t,o=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}(t,Sc);const{body:i}=Ba(n),{description:a,url:s,isZoomable:c}=i,[l,u]=(0,Se.useState)(!1),d=$e();return(0,e.jsxs)(Xa,_c(_c({event:n,type:"image"},o),{},{children:[(0,e.jsx)("img",{src:s,id:r,alt:a,onLoad:()=>{d(So(n.payload.id)),u(!0)}}),c&&l&&(0,e.jsx)(xc,{description:a,url:s})]}))},splash:t=>{let{event:n}=t,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}(t,Pc);const{payload:o}=n,{body:i}=Ba(n),a=As(o.id);return(0,e.jsx)(Xa,kc(kc({type:"splash",event:n,onClick:a},r),{},{bodyProps:{dangerouslySetInnerHTML:{__html:i.text}}}))},video:t=>{let{event:n,descriptorId:r}=t,o=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}(t,Wc);const{body:i}=Ba(n),{description:a,url:s}=i;return ya(n).push("message--type-video"),(0,e.jsxs)(Xa,Kc(Kc({event:n,type:"video"},o),{},{children:[(0,e.jsx)("div",{id:r,className:qa("visually-hidden"),children:a}),(0,e.jsx)("iframe",{title:a,src:s,allow:"autoplay; encrypted-media",allowFullScreen:!0})]}))},upload:t=>{let{event:n}=t,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}(t,Bc);const{t:o}=la(),{body:i}=Ba(n),{fromClient:a}=n.payload,{filename:s,url:c}=i,l=(0,Se.useMemo)((()=>o(c?"fileUpload.srFileDownloadText":"fileUpload.srFileUploadedText",{fileName:s})),[c,s,o]);return(0,e.jsx)(Xa,$c($c({event:n,type:"upload"},r),{},{children:(0,e.jsxs)(Vc,{url:c,target:a?void 0:"_blank",children:[(0,e.jsx)(ls,{name:"download",size:"16"}),(0,e.jsx)("span",{"aria-hidden":"true",className:qa("file-download"),children:s}),(0,e.jsx)("span",{className:qa("visually-hidden"),children:l})]})}))},cta:({event:t})=>{const{body:n}=Ba(t),r=As(t.payload.id),{emitEvent:o}=qi(),i=Ua(),a=(0,Se.useCallback)((()=>o("action.click_cta",{type:at,originMessage:t.payload.id,link:{url:n.buttonLink}})),[o,n,t]);return(0,e.jsxs)(Xa,{type:"cta",event:t,children:[(0,e.jsx)("div",{className:qa("cta__content"),id:i,dangerouslySetInnerHTML:{__html:n.description},onClick:r}),(0,e.jsx)("a",{className:qa("button","button--primary"),"aria-describedby":i,href:n.buttonLink,rel:"noreferrer",target:n.buttonNewTab?"_blank":"_self",onClick:a,children:n.buttonText})]})},carousel:({event:t})=>{const{body:n}=Ba(t),r=n.cards;return(0,e.jsx)(Xa,{event:t,modifiers:"type-carousel",children:(0,e.jsx)(ys,{items:r,ItemComponent:ss,getItemKey:ms,getItemLabel:bs})})},card:({event:t})=>{const{body:n}=Ba(t),r=Ua();return(0,e.jsx)(Xa,{type:"card",event:t,children:(0,e.jsx)(es,ns({id:r},n))})}},info:{text:Mc,divider:t=>{let{event:n}=t,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}(t,Rs);const o=zs[ut[n.payload.body.subtype]]||zs.default;return(0,e.jsx)(o,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Us(Object(n),!0).forEach((function(t){Fs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Us(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({event:n},r))},translation:t=>{let{event:n}=t,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}(t,Rc);const{t:o}=la(),{body:i}=Ba(n);return(0,e.jsx)(Xa,Fc(Fc({type:"text",event:n},r),{},{children:o(i.key.join("."),i.variables)}))},timeIndicator:$s},participant:{participant:({event:t})=>{const{participant:n}=t.payload,{body:r}=Ba(t);return r?(0,e.jsx)(Ls,{graphicSrc:n.avatar,graphicType:n.avatar?"avatar":void 0,iconName:n.avatar?void 0:"balloon",childrenHTML:r,dividerType:"participant"}):null}},service_data:{suggestion:t=>{let{event:n}=t,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}(t,Es);const[o,i]=(0,Se.useState)(!0),a=$e(),s=Rr(),{sendAction:c,addMessageBubble:l}=qi(),{suggestions:u,payload:d}=(e=>{const{payload:t}=e,{body:n}=Ba(e);return{suggestions:n,payload:t}})(n),{showSuggestions:p}=mr(),f=Or(),{t:h}=la(),y=h("suggestions.headingText"),m=h("suggestions.footerText"),b=(0,Se.useMemo)((()=>f.some((({payload:e})=>e?.transactionLast))),[f]),g=(0,Se.useCallback)((({id:e,question:t})=>{i(!1),a(zr(!0)),c({type:Ze,originMessage:d.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),l(t)}),[a,c,d.id,l]);return o&&!s&&b&&p?(0,e.jsxs)("div",{className:qa("suggestions","suggestions--conversation"),children:[y&&(0,e.jsx)("p",{className:qa("suggestions__heading"),children:y}),(0,e.jsxs)(Xa,Ts(Ts({type:"suggestions",showParticipant:!1,event:n},r),{},{children:[(0,e.jsx)(_s,{className:"suggestions__list--conversation",onClickSuggestion:g,suggestions:u}),m&&(0,e.jsx)("p",{className:qa("suggestions__footer"),children:m})]}))]}):null}}},el=({children:t})=>{const{customComponents:n}=mr(),r=(0,Se.useMemo)((()=>Object.keys(Zc).reduce(((e,t)=>Qc(Qc({},e),{},{[t]:Qc(Qc({},Zc[t]),n?n[t]:{})})),{fallback:Mc})),[n]);return(0,e.jsx)(fa.Provider,{value:r,children:t})},tl=({children:t})=>{const{isMinimized:n}=Mi(),r=(0,Se.useRef)(0),{sendAction:o}=qi(),{hasCountdown:i,isActive:a,stopCountdown:s}=Ma(),c=(0,Se.useCallback)((()=>{if(n)return;const e=(new Date).getTime(),t=()=>{o({type:"interactivity_update"}),r.current=e};i&&a&&(t(),s()),e-r.current>15e3&&t()}),[o,i,a,s,n]);return(0,e.jsx)("div",Object.assign({className:qa("activity-monitor"),tabIndex:-1,onMouseDown:c,onKeyUp:c,onTouchStart:c,onMouseMove:c,onWheel:c,onPointerDown:c,onPointerMove:c},{children:(0,e.jsx)(Aa.Provider,Object.assign({value:c},{children:t}))}))};const nl=["text","choice_prompt","image","video"],rl=()=>{const e=Ui(),t=$e(),n=Or(),r=(0,Se.useContext)(We),o=(0,Se.useRef)(null),{initCountdown:i,endCountdown:a}=Ma(),{emitEvent:s}=qi();return(0,Se.useEffect)((()=>{if(e.connectionInfo&&e.conversation.socket){const{socket:n}=e.conversation;n.onError((e=>{const n=new Wo(e);t(qr({name:n.name,message:n.message,langKey:n.langKey,originalEvent:n.originalEvent,originalError:n.originalError})),t(no())})),n.onOpen((()=>{t(Vr())}))}}),[e,e.connectionInfo,e.conversation.socket,t]),(0,Se.useEffect)((()=>{if(e.connectionInfo&&e.conversation.channel){const{channel:t}=e.conversation;return()=>{null==t||t.leave()}}return()=>{}}),[e,e.connectionInfo,e.conversation]),(0,Se.useEffect)((()=>{e.conversation.onConnection((e=>{if("join_channel_erred"===e){const e=new u;t(qr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action}))}}))}),[e.conversation,t]),(0,Se.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(vo(o.name)),t(Co({participant:o,fromClient:r})),"string"!=typeof o&&o.introduction&&t(eo(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(xo(n.state.loading)),n.type){case"idle_detach_countdown":i(n.body.duration);break;case"idle_detach_countdown_elapsed":a(void 0,!0);break;case"resume_conversation_prompt":t(lo());break;case"translation_proposal":t(Pi(n.body));break;case"user_first_response":t(zr(!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(ho(n.service.serviceSessionId)),t(eo(c))}break;case"participant":o(c);break;case"service_data":n.persist&&t(Eo(n));break;case"ack":t(Zr(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(bo({key:dt,enabled:!(!i||!i.enabled)})),t(Po(o)),n.serviceSessionId&&t(ho(n.serviceSessionId)),s("system.serviceChanged",r)}break;case"info":"divider"!==n.type&&"text"!==n.type&&"translation"!==n.type||t(eo(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 u(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,s,a,r,i]),(0,Se.useEffect)((()=>{if(e.connectionInfo&&e.conversation.channel){const{channel:t}=e.conversation;t.on("message",(e=>nl.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,Se.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],a=null===(o=null==r?void 0:r.lastEvent)||void 0===o?void 0:o.id;return i&&a===i.payload.id?r:e.getConversation().then((e=>{e&&t(Oo(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},ol=({children:t})=>{const{t:n}=la(),r=$e(),o=Ui(),{addUploadBubble:i}=qi();return(0,e.jsx)(wa.Provider,{value:e=>{const t=S(),a=o.uploadFile(e,(e=>{r(Ao({fileId:t,progress:Math.ceil(e)}))}),(e=>{const{id:n,transactionId:o,occurredAt:a,body:{contentType:s,filename:c,filesize:l,url:u}}=e.body;r(To(t)),i(n,o,a,s,c,l,u)}),(e=>{let o;switch(e&&e.body?e.body.error:""){case"file_uploads_are_disabled":o=n("fileUpload.errors.unavailable");break;case"request_entity_too_large":o=n("fileUpload.errors.tooLarge");break;case"file_has_invalid_mime_type":o=n("fileUpload.errors.wrongType");break;case"virus_found":o=n("fileUpload.errors.virusFound");break;default:o=n("fileUpload.errors.general")}r(ko({fileId:t,errorText:o}))}));r(uo({fileId:t,fileName:e.name,uploadHandle:a}))},children:t})},il=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=Ma();return((e,t)=>{const n=(0,Se.useRef)(e);(0,Se.useEffect)((()=>{n.current=e}),[e]),(0,Se.useEffect)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n>0?1e3:null),null},al=()=>{const{initUserSelectedOptions:e}=Ta(),t=(0,Se.useRef)(!1),n=mr();return(0,Se.useEffect)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null},sl=dr((({interrupt:e})=>e),(({error:e})=>e));function cl(){const{t:e}=la(),t=Le(sl);return{hasInterrupt:Boolean(t),meta:(0,Se.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 ll(e,t,n=[]){const r=(0,Se.useContext)(We),o=(0,Se.useRef)();o.current=t,(0,Se.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 ul=()=>{const e=mr(),{sendMessage:t,sendContext:n,sendAction:r}=qi(),o=$e(),{setVisibility:i,visible:a}=Mi(),c=(0,Se.useRef)(a),l=(0,Se.useContext)(We),u=Ui(),d=xr(),p=(0,Se.useRef)(null),f=(0,Se.useRef)(null),{isInline:h,isResolving:y}=Er(),{hasInterrupt:m}=cl(),b=(()=>{const{get:e}=Fi();return e?e("conversationUrl"):null})(),g=(0,Se.useRef)(null),v=Ia(),{enableTranslations:w,disableTranslations:O}=za();return(0,Se.useEffect)((()=>{c.current=a}),[a]),ll("askText",(e=>{t({body:e})}),[u?.send]),ll("setVariables",(e=>{n({variables:e})}),[u?.send]),ll("getVisibility",(e=>{e?e(c.current):console.warn("A callback function is required for the getVisibility action.")})),ll("setVisibility",(e=>{Object.values(hr).includes(e)?(v(),i(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[e?.api]),ll("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[u.send]),ll("setTopic",(({name:e,fallbackMessage:t,userTriggered:n})=>{n&&o($o({showSuggestions:!1})),e&&t?r({type:ot,body:{name:e,fallbackMessage:t,participant:n?s:void 0}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[u.send]),ll("setTranslation",(({enabled:e,locale:t})=>{e?w(t,"window_api"):O()}),[u.send]),(0,Se.useEffect)((()=>{y||m||(g.current&&g.current!==b&&l.emit("unreadMessageCount",d),a===hr.open&&a!==f.current&&0!==p.current&&l.emit("unreadMessageCount",0),a!==hr.open&&d!==p.current&&l.emit("unreadMessageCount",d),f.current=a,p.current=d,g.current=b)}),[d,a,l,h,y,m,b]),null},dl=({children:t})=>{const n=(0,Se.useContext)(We),[r,o]=(0,Se.useState)({}),i=(0,Se.useRef)(!0),a=(0,Se.useCallback)((e=>{i.current&&(o(e),n.emit("aria-live",e))}),[o,n]);(0,Se.useEffect)((()=>{let e=null;return r&&r.messageText&&(e=setTimeout((()=>{a({}),clearTimeout(e)}),500)),()=>{clearTimeout(e)}}),[r,a]),(0,Se.useEffect)((()=>()=>{i.current=!1}),[]);const{ariaLive:s,messageText:c}=r;return(0,e.jsxs)(ua.Provider,{value:a,children:[t,(0,e.jsxs)("div",{className:qa("app__live-container"),children:[(0,e.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:qa("visually-hidden"),children:s===ct?c:null}),(0,e.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:qa("visually-hidden"),children:s===lt?c:null})]})]})},pl=()=>{const{t:e}=la(),t=Or(),n=(0,Se.useRef)(0),r=(0,Se.useRef)(0),o=gr().historyLoaded,{sendPolite:i}=da(),{isOpen:a}=Mi(),s=(0,Se.useRef)(null),c=(0,Se.useRef)(null),l=(0,Se.useMemo)((()=>f((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,Se.useEffect)((()=>{t.length>n.current&&(a&&(c.current=l(t)),n.current=t.length)}),[t,l,a]),(0,Se.useEffect)((()=>{s.current&&!a&&c.current&&(c.current(!0),c.current=null)}),[a]),(0,Se.useEffect)((()=>{o&&setTimeout((()=>{i(e("window.srTexts.onHistoryLoad"))}),500)}),[o,e,i]),null},fl=()=>{const{t:e}=la(),{isOpen:t,isVisible:n}=Mi(),r=xr(),{sendPolite:o}=da(),i=(0,Se.useMemo)((()=>f(o,2e3)),[o]),a=(0,Se.useRef)(null),s=(0,Se.useRef)(null);return(0,Se.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},hl=({store:t,children:n,eventBus:r,api:o})=>((0,Se.useErrorBoundary)((e=>{t.dispatch(Ko(e))})),(0,e.jsx)(Fe,Object.assign({store:t},{children:(0,e.jsx)(We.Provider,Object.assign({value:r},{children:(0,e.jsx)(Ve.Provider,Object.assign({value:o},{children:(0,e.jsx)(dl,{children:(0,e.jsx)(pa,{children:(0,e.jsxs)(el,{children:[(0,e.jsx)(al,{}),(0,e.jsx)(rl,{}),(0,e.jsx)(fl,{}),(0,e.jsx)(pl,{}),(0,e.jsx)(il,{}),(0,e.jsxs)(tl,{children:[(0,e.jsx)(ul,{}),(0,e.jsx)(ol,{children:n})]})]})})})}))}))}))),yl=()=>{const{t}=la(),{showDisclaimer:n}=mr();return n&&(0,e.jsxs)("div",{className:qa("disclaimer"),tabIndex:"0",children:[(0,e.jsx)("h2",{className:qa("disclaimer__title"),children:t("disclaimer.title")}),(0,e.jsx)("div",{className:qa("disclaimer__message"),dangerouslySetInnerHTML:{__html:t("disclaimer.content")}})]})},ml=require("preact/compat"),bl=(0,xe.createContext)(null),gl=e=>{const t=(0,Se.useContext)(fa),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:t,newParticipant:n})=>{const{eventRefs:r,unreadIds:o}=(0,ml.useContext)(bl),{sendAction:i}=qi(),a=r[t.payload.id],{containerRef:s,isVisible:c}=Ri({containerRef:a,freezeOnceVisible:!0}),l=$e(),[u,d]=gl(t);if((0,ml.useEffect)((()=>{if(c&&(null==o?void 0:o.includes(t.payload.id))){const e=o.reduce(((e,n)=>e.includes(t.payload.id)?e:e.concat(n)),[]);l(mo(e)),i({type:tt,events:e})}}),[l,t.payload.id,c,i,o]),!u)return null;const p=["conversation__item"];return"info"===t.type?p.push("conversation__item--source-info"):t.payload.fromClient?p.push("conversation__item--source-user"):p.push("conversation__item--source-agent"),n&&p.push("conversation__item--new-participant"),(0,e.jsxs)("li",Object.assign({className:qa(p),ref:s},{children:[t.timeIndicator&&(0,e.jsx)($s,{event:t}),(0,e.jsx)(u,Object.assign({event:t},{children:(0,e.jsx)(d,{event:t})}))]}))},wl=()=>{const{id:t}=_r()||{};return(0,e.jsx)("li",{className:qa("conversation__item","conversation__item--source-agent"),children:(0,e.jsxs)("div",{className:qa("message","message--source-agent","message--type-loading"),children:[(0,e.jsx)(Va,{eventPayload:{fromClient:!1,participant:t}}),(0,e.jsx)("div",{className:qa("message__body"),children:(0,e.jsxs)("span",{className:qa("loader"),children:[(0,e.jsx)("span",{className:qa("loader__part","one")}),(0,e.jsx)("span",{className:qa("loader__part","two")}),(0,e.jsx)("span",{className:qa("loader__part","three")}),(0,e.jsx)("span",{className:qa("loader__part","four")})]})})]})})},Ol=()=>{const t=Or();let n=null;return(0,e.jsx)(e.Fragment,{children:t.map((t=>{const{type:r,payload:o}=t;let i=!1;if("participant"!==r&&"service_data"!==r){const{participant:e,fromClient:r}=o,a=r?"seamly-client-participant":e;"info"!==t.type&&n!==a&&(i=!0),n=a}return(0,e.jsx)(vl,{event:t,newParticipant:i},t.payload.key||t.payload.id)}))})},jl=()=>{const{t}=la(),n=jr(),{isOpen:r}=Mi(),o=Sr(),i=va();return(0,e.jsxs)(e.Fragment,{children:[r&&(0,e.jsx)("a",Object.assign({className:qa("skip-link"),href:`#${o}`,onClick:e=>{e.preventDefault(),i()}},{children:t("skiplinkText")})),(0,e.jsx)("div",Object.assign({className:qa("chat__body")},{children:(0,e.jsxs)("div",Object.assign({className:qa("conversation__container")},{children:[(0,e.jsx)(yl,{}),(0,e.jsxs)("ol",Object.assign({className:qa("conversation")},{children:[(0,e.jsx)(el,{children:(0,e.jsx)(Ol,{})}),n&&(0,e.jsx)(wl,{})]}))]}))}))]})},xl={visible:qa("transition--visible"),in:qa("transition--in"),visuallyHidden:qa("visually-hidden")},Sl=Object.values(xl),Cl="notRendered",_l="rendered",El="visuallyHidden",Pl=({children:t,isActive:n,timeout:r=300,transitionStartState:o="notRendered",onInTransitionComplete:i=(()=>{}),onOutTransitionComplete:a=(()=>{})})=>{const s=(0,Se.useRef)(!1),c=parseInt(r,10),l=Fa(i),u=Fa(a),d=o===El,[p,f]=(0,Se.useState)((()=>d?[xl.visuallyHidden]:[])),h="notRendered"!==o||p.length>0;return(0,Se.useEffect)((()=>{let e=null,t=null;return s.current&&!n&&(f([xl.visible]),e=setTimeout((()=>{f([...d?[xl.visuallyHidden]:[]]),u&&(t=requestAnimationFrame((()=>{u()})))}),c)),!s.current&&n&&(f([xl.visible]),t=requestAnimationFrame((()=>{t=requestAnimationFrame((()=>{f([xl.visible,xl.in]),l&&(e=setTimeout((()=>{l()}),c))}))}))),s.current=n,()=>{clearTimeout(e),cancelAnimationFrame(t)}}),[n,d,c,l,u]),(0,e.jsx)(e.Fragment,{children:h&&(0,xe.toChildArray)(t).map((e=>{const{className:t=""}=e.props,n=t.split(" ").filter((e=>!Sl.includes(e)));return(0,xe.cloneElement)(e,{className:[...n,...p].join(" ")})}))})},Tl=({isAside:t=!1})=>{const{isInline:n}=Er(),{t:r}=la(),{sendAction:o,addMessageBubble:i}=qi(),{isOpen:a,setVisibility:s}=Mi(),{showSuggestions:c}=mr(),l=Ua(),u=va(),d=(0,Se.useRef)(null),{sendPolite:p}=da(),{hasInterrupt:f}=cl(),{hasCountdown:h,endCountdown:y}=Ma(),{hasPrompt:m,continueChat:b}=Ra(),g=Rr(),v=("suggestion",gr().serviceData.suggestion);const{body:w}=Ba({payload:v}),j=(0,Se.useMemo)((()=>v&&!f?w:[]),[v,f,w]),x=(0,Se.useRef)(null),S=(0,Se.useRef)(!1),C=(0,Se.useRef)([]),_=!!j.length,E=n?(g||a)&&!t:g,P=(0,Se.useRef)(E),T=_&&!E&&c,k=_?j:C.current;C.current=k;const A=(0,Se.useMemo)((()=>{const e=["suggestions"];return t&&e.push("suggestions--aside"),qa(e)}),[t]),I=(0,Se.useCallback)((({id:e,question:t})=>{h&&y(!0),m&&b(),o({type:Ze,originMessage:v.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),i(t),a||s(hr.open),u()}),[i,b,y,u,h,m,v,o,s,a]);(0,Se.useEffect)((()=>{if(x.current!==j&&!E){if(_){const e=S.current?r("suggestions.srUpdatedText"):r("suggestions.srAvailableText");setTimeout((()=>{p(e)}),30)}else S.current&&p(r("suggestions.srUnavailableText"));x.current=j}!P.current&&E?(O(d.current,u),p(r("suggestions.srUnavailableText"))):!_&&S.current&&O(d.current,u),S.current=_,P.current=E}),[j,_,E,u,p,r]);const N=r("suggestions.headingText"),D=r("suggestions.footerText"),L=N?"section":"div";return(0,e.jsx)(Pl,{isActive:T,transitionStartState:Cl,children:(0,e.jsxs)(L,{className:A,"aria-labelledby":N?l:null,ref:d,children:[N&&(0,e.jsx)("p",{id:l,className:qa("suggestions__heading"),children:N}),!!k.length&&(0,e.jsx)(_s,{suggestions:k,onClickSuggestion:I}),D&&!a&&(0,e.jsx)("p",{className:qa("suggestions__footer"),children:D})]})})},kl=(0,ml.forwardRef)((({children:t,className:n=""},r)=>{const{isOpen:o,isVisible:i,setVisibility:a}=Mi(),{namespace:s,layoutMode:c}=mr(),{isInline:l}=Er(),u=ha(),d=Rr(),{t:p}=la(),f=["chat",`chat--layout-${c}`,`namespace--${s}`,...u,n];return o||"app"===c||f.push("chat--collapsed"),d&&f.push("chat--user-responded"),i&&(0,e.jsxs)("section",{className:qa(f),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!l&&o&&a(hr.minimized)},tabIndex:"-1",ref:r,"aria-label":p("chat.srLabel"),children:[(0,e.jsx)("div",{className:qa("chat-wrapper"),children:t}),"inline"===c&&o&&(0,e.jsx)(Tl,{isAside:!0})]})})),Al=kl,Il=({className:t,children:n,onCancel:r,headingText:o,description:i,descriptionId:a,cancelButtonText:s,cancelButtonRef:c,disableButtonFocusing:l,position:u={horizontal:"left",vertical:"top"}})=>{const d=Ua(),{hideOption:p}=Ta(),{focusButton:f}=ka(),h=(0,Se.useCallback)((()=>{p(),l||f()}),[l,f,p]),y=(0,Se.useCallback)((()=>{r&&r(),h()}),[h,r]),m=(e=>{const t=(0,Se.useRef)(null);return(0,Se.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})(y);return(0,Se.useEffect)((()=>{w(m.current)}),[m]),(0,e.jsx)("section",Object.assign({className:qa("options",{"options--right":"right"===u.horizontal,"options--left":"left"===u.horizontal,"options--top":"top"===u.vertical,"options--bottom":"bottom"===u.vertical},t),"aria-labelledby":d,tabIndex:-1,ref:m},{children:(0,e.jsxs)("div",Object.assign({className:qa("options__body")},{children:[(0,e.jsx)("h2",Object.assign({id:d,className:qa("options__title")},{children:o})),(0,e.jsxs)("button",Object.assign({type:"button",onClick:y,"aria-describedby":d,className:qa("button","options__close"),ref:e=>{c&&(c.current=e)}},{children:[(0,e.jsx)(ls,{name:"close",size:"16",alt:""}),(0,e.jsx)("span",{children:s})]})),i?(0,e.jsx)("p",Object.assign({className:qa("options__description"),id:a},{children:i})):null,(0,e.jsx)("div",Object.assign({className:qa("options__wrapper")},{children:n}))]}))}))},Nl=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),Dl=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},Ll=e=>!!e?.length>0,Ml=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))},Rl=e=>!!e,Ul=(0,xe.createContext)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),Fl=Ul,{Provider:zl,Consumer:Bl}=Ul,Hl=dr((({forms:e})=>e),((e,{formId:t})=>t),((e,t)=>e[t])),$l=dr(Hl,(e=>(null==e?void 0:e.controls)||{})),ql=dr($l,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),Vl=dr($l,((e,{name:t})=>t),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.value})),Wl=dr($l,((e,{name:t})=>t),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.touched}));function Gl(){return(0,Se.useContext)(Fl)}function Kl(e){const t=$e(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:i}=Gl(),a=!!Le((e=>Hl(e,{formId:n}))),s=Le((t=>Vl(t,{formId:n,name:e}))),c=Le((t=>Wl(t,{formId:n,name:e}))),l=null==i?void 0:i[e],u=!l;(0,Se.useEffect)((()=>{a&&t(ni({formId:n,name:e}))}),[a,n,e,t]),(0,Se.useLayoutEffect)((()=>()=>{t(ri({formId:n,name:e}))}),[a,n,e,t]);const d=(0,Se.useCallback)((t=>r(e,t.target.value)),[e,r]),p=(0,Se.useCallback)((()=>{o(e,!0)}),[o,e]);return[(0,Se.useMemo)((()=>({name:e,onInput:d,onBlur:p,value:s})),[e,d,p,s]),(0,Se.useMemo)((()=>({isValid:u,error:l,touched:c})),[u,l,c])]}function Jl(t){var{children:n,formId:r,persistData:o,onError:i,onSubmit:a,validationSchema:s}=t,c=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,["children","formId","persistData","onError","onSubmit","validationSchema"]);const l=$e(),u=Le((e=>ql(e,{formId:r}))),[d,p]=(0,Se.useState)(!1),[f,h]=(0,Se.useState)({}),{isValid:y,errors:m}=function(e,t){const n=(0,Se.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}}(u,s),b=(0,Se.useMemo)((()=>Object.assign(Object.assign({},m),f)),[m,f]);(0,Se.useLayoutEffect)((()=>{l(ei({formId:r,persistData:o}))}),[r,o,l]),(0,Se.useEffect)((()=>()=>{l(ti({formId:r}))}),[r,o,l]);const g=(0,Se.useCallback)(((e,t)=>{l(oi({formId:r,name:e,value:t}))}),[r,l]),v=(0,Se.useCallback)(((e,t)=>{l(ii({formId:r,name:e,touched:t}))}),[l,r]),w=(0,Se.useCallback)(((e,t)=>{h((n=>Object.assign(Object.assign({},n),{[e]:t})))}),[h]),O=(0,Se.useCallback)((e=>{var t;e.preventDefault();const n="true"===(null===(t=e.submitter)||void 0===t?void 0:t.ariaDisabled);p(!n),!n&&y&&(l(zr(!0)),a(u,{updateControlValue:g,setError:w}))}),[y,l,a,u,g,w]);(0,Se.useEffect)((()=>{i&&i({errors:b,isSubmitted:d,isValid:0===Object.keys(b).length})}),[d,b,i]);const j=(0,Se.useMemo)((()=>({formId:r,values:u,errors:b,isValid:0===Object.keys(b).length,isSubmitted:d,handleSubmit:O,validationSchema:s,updateControlValue:g,updateControlTouched:v})),[r,u,b,d,O,s,g,v]);return r?a?(0,e.jsx)(zl,Object.assign({},c,{value:j},{children:n})):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)}const Xl=["className","disableValidationClasses"];function Ql(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 Yl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zl=function(t){let{className:n,disableValidationClasses:r}=t,o=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}(t,Xl);const{handleSubmit:i,isValid:a,isSubmitted:s}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=Gl();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),c=["form"];return!r&&s&&(c.push("form--submitted"),a?c.push("form--valid"):c.push("form--invalid")),(0,e.jsx)("form",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ql(Object(n),!0).forEach((function(t){Yl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ql(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({onSubmit:i,className:qa([...c,n])},o))};function eu({id:t,error:n}){const[r,o]=(0,Se.useState)(!1);return(0,Se.useEffect)((()=>{const e=setTimeout((()=>o(!0)),300);return()=>clearTimeout(e)}),[]),(0,e.jsx)("div",{className:qa("error"),"aria-live":"assertive","aria-atomic":"true",children:r&&n&&(0,e.jsxs)("span",{id:t,className:qa("error__message"),children:[(0,e.jsx)(ls,{name:"error",size:"16"}),n]})})}const tu=({contentHint:t,id:n,labelText:r,labelClass:o=qa("label"),validity:i,errorText:a,children:s})=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("label",{htmlFor:n,className:o,children:r}),t&&(0,e.jsx)("span",{id:`${n}-content-hint`,className:qa("input__content-hint"),children:t}),(0,e.jsx)(eu,{id:`${n}-error`,error:!i&&a}),s]}),nu=["id","name","type","labelText","labelClass","contentHint","aria-describedby"];function ru(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 ou(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ru(Object(n),!0).forEach((function(t){iu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ru(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function iu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const au=function(t){let{id:n,name:r,type:o,labelText:i,labelClass:a,contentHint:s,"aria-describedby":c}=t,l=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}(t,nu);const{isSubmitted:u}=Gl(),[d,{error:p}]=Kl(r),f=u&&p,h=[];return c&&h.push(c),s&&h.push(`${n}-content-hint`),f&&h.push(`${n}-error`),(0,e.jsx)(tu,{id:n,contentHint:s,validity:!f,errorText:p,labelText:i,labelClass:a,children:(0,e.jsx)("input",ou(ou({id:n,name:r,type:o,"aria-invalid":f?"true":"false","aria-describedby":h.join(" ")||null},d),l))})};function su({controlName:t,describedById:n}){const{t:r}=la();return(0,e.jsxs)(Zl,{noValidate:"true",className:qa("options__form"),children:[(0,e.jsx)(au,{name:t,type:"email",className:qa("transcript__input"),"aria-describedby":n,labelClass:qa("label"),labelText:r("options.sendTranscript.label")}),(0,e.jsx)("div",{className:qa("options__actions"),children:(0,e.jsx)("button",{type:"submit",className:qa("button","button--primary","options__submit"),children:r("options.sendTranscript.sendButtonText")})})]})}const cu="email",lu={sendTranscript:()=>{const[t,n]=(0,Se.useState)(void 0),{hideOption:r}=Ta(),{focusButton:o}=ka(),{t:i}=la(),a=Ua(),{sendAction:s}=qi(),c=(0,Se.useMemo)((()=>({[cu]:[Nl(Rl,i("options.sendTranscript.noEmailText")),Nl(Ml,i("options.sendTranscript.invalidEmailText"))]})),[i]),l=(0,Se.useCallback)((e=>{const t=e.email.trim();s({type:"send_transcript",body:{emailAddress:t}}),r(),o()}),[s,r,o]),u=(0,Se.useCallback)((({isValid:e,isSubmitted:t})=>{n(t&&!e?"options--error":void 0)}),[n]);return(0,e.jsx)(Il,{className:t,headingText:i("options.sendTranscript.title"),cancelButtonText:i("options.cancelButtonText"),description:i("options.sendTranscript.description"),descriptionId:a,position:{vertical:"top",horizontal:"right"},children:(0,e.jsx)(Jl,{formId:"sendTranscript",onSubmit:l,validationSchema:c,onError:u,children:(0,e.jsx)(su,{controlName:cu,describedById:a})})})}},uu=()=>{const{optionActive:t}=Ta(),n=(0,Se.useRef)(null),r=lu[t||n.current];return t&&(n.current=t),r?(0,e.jsx)(r,{}):null},du=()=>{const{t}=la(),{menuOptions:n,showOption:r,panelActive:o,hideOption:i}=Ta(),{id:a}=ka(),s=(0,Se.useRef)(null),[c,l]=(0,Se.useState)(!1),u=(0,Se.useRef)(null),d=n.length,p=(0,Se.useRef)(Array.from({length:d},(()=>(0,xe.createRef)()))),f=(0,Se.useRef)(!1),h=d>1,y=n[0],m=(0,Se.useMemo)((()=>y?.name?.trim().replace(/\s+/g,"")),[y]);return(0,Se.useEffect)((()=>()=>{clearTimeout(s.current)}),[]),(0,Se.useEffect)((()=>{c&&!f.current&&requestAnimationFrame((async()=>{await ma(60);const e=n.findIndex((e=>e.available)),t=-1===e?0:e;w(p.current[t])})),f.current=c}),[c,n]),d?(0,e.jsxs)("div",{className:qa("options__container"),onKeyDown:e=>{c&&(v(e)===g.Escape&&(l(!1),w(u.current)),v(e)===g.Home&&(w(p.current[0]),e.preventDefault()),v(e)===g.End&&(w(p.current[d-1]),e.preventDefault()))},onfocusout:()=>{h&&(s.current=setTimeout((()=>{l(!1)}),200))},onfocusin:()=>{clearTimeout(s.current)},children:[(0,e.jsx)(Pl,{transitionStartState:Cl,isActive:o,children:(0,e.jsx)("div",{className:qa("options__dialog"),children:(0,e.jsx)(uu,{})})}),h&&(0,e.jsx)(Pl,{isActive:c,transitionStartState:Cl,children:(0,e.jsx)("ul",{className:qa(["options__menu"]),role:"menu",tabIndex:"-1","aria-labelledby":a,children:n.map((({name:o,title:i,available:a},s)=>(0,e.jsx)("li",{className:qa("options__menu__item"),role:"menuitem","data-testid":o,children:(0,e.jsxs)("button",{type:"button",ref:e=>{p.current[s]=e},className:qa(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(v(e)===g.ArrowDown){const n=Math.min(d-1,t+1);w(p.current[t===n?0:n]),e.preventDefault()}if(v(e)===g.ArrowUp){const n=Math.max(0,t-1);w(p.current[t===n?d-1:n]),e.preventDefault()}})(e,s),onKeyPress:e=>((e,t)=>{const r=String.fromCharCode(e.charCode);if(1!==r.length||!r.match(/\S/))return;let o=-1;n.forEach(((e,n)=>{n>t&&e.title.charAt(0).toLowerCase()===r.toLowerCase()&&-1===o&&(o=n)})),-1!==o&&w(p.current[o])})(e,s),onClick:()=>((e,t)=>{t&&(l(!1),r(e))})(o,a),"aria-disabled":a?null:"true",children:[(0,e.jsxs)("span",{className:qa("button__text"),children:[i,!a&&" "]}),!a&&(0,e.jsx)("span",{className:qa("button__state"),children:t("options.unavailableText")})]})},o)))})}),(0,e.jsxs)("button",{type:"button",className:qa(["button","button--secondary","chat__options__button",...!h&&m?[`chat__options__button--${m}`]:[]]),id:a,onClick:()=>{o&&i(),h?l((e=>!e)):y.available&&r(y.name)},onKeyDown:h?e=>{v(e)===g.ArrowDown&&(l(!0),e.preventDefault())}:null,ref:u,"aria-haspopup":h?"menu":null,"aria-expanded":h?c.toString():null,"aria-disabled":h||y.available?null:"true",children:[h&&(0,e.jsx)(ls,{name:"options",size:"32"}),(0,e.jsx)("span",{className:qa("button__text"),children:h?t("options.openButtonText"):`${y.title}${y.available?"":" "}`}),!h&&!y.available&&(0,e.jsx)("span",{className:qa("button__state"),children:t("options.unavailableText")})]})]}):null},pu=({label:t,checked:n,description:r,onChange:o,id:i})=>(0,e.jsxs)("li",Object.assign({className:qa("translation-options__item",{"translation-options__item--checked":n})},{children:[(0,e.jsx)("input",{id:i,type:"radio",value:t,checked:n,className:qa("visually-hidden"),onChange:o,name:"language"}),(0,e.jsxs)("label",Object.assign({htmlFor:i},{children:[(0,e.jsx)(ls,{alt:"",name:"check",size:"16"}),t," ",r&&(0,e.jsxs)("span",{children:["(",r,")"]})]}))]})),fu=({onChange:t,describedById:n})=>{const{context:{locale:r}}=mr(),{t:o}=la(),{focusContainer:i}=Ha(),{languages:a,currentLocale:s,enableTranslations:c,disableTranslations:l}=za(),u=({locale:e})=>()=>{e===s||r===e?l():c(e),t(),i()},d=(0,Se.useMemo)((()=>[...a].sort(((e,t)=>e.locale===r?-1:t.locale===r?1:e.nativeName.localeCompare(t.nativeName,void 0,{sensitivity:"base"})))),[a,r]);return(0,e.jsx)("ul",Object.assign({"aria-describedby":n,className:qa("translation-options")},{children:d.map(((t,n)=>{const r=0===n,i=s===t.locale||!s&&r;return(0,e.jsx)(pu,{id:t.locale,label:t.nativeName,checked:i,description:r&&o("translations.settings.original"),onChange:u(t)},t.locale)}))}))},hu=function({onClose:t,position:n}){const{t:r}=la(),o=Ua();return(0,e.jsx)(Il,Object.assign({onCancel:t,headingText:r("translations.menu.title"),cancelButtonText:r("translations.settings.cancelButtonText"),description:r("translations.menu.description"),descriptionId:o,position:n,disableButtonFocusing:!0},{children:(0,e.jsx)(fu,{describedById:o,onChange:t})}))};function yu({children:t,position:n={horizontal:"left",vertical:"top"},classNames:r}){const[o,i]=(0,Se.useState)(!1),a=(0,Se.useRef)(null),s=Ua();return(0,e.jsxs)("div",Object.assign({className:qa("translations__container"),onKeyDown:e=>{o&&v(e)===g.Escape&&(i(!1),w(a.current))}},{children:[(0,e.jsx)(Pl,Object.assign({onOutTransitionComplete:()=>{},onInTransitionComplete:()=>{},timeout:0,transitionStartState:Cl,isActive:o},{children:(0,e.jsx)("div",Object.assign({className:qa("options__dialog"),role:"dialog"},{children:(0,e.jsx)(hu,{onClose:()=>{i(!1)},position:n})}))})),(0,e.jsx)("button",Object.assign({type:"button",className:qa(["button","chat__options__button",...r]),id:s,onClick:()=>{i((e=>!e))},onKeyDown:e=>{v(e)===g.ArrowDown&&(i(!0),e.preventDefault())},ref:a,"aria-haspopup":"dialog","aria-expanded":o.toString()},{children:t}))]}))}function mu(){const{menuOptions:t,allowOptionSelection:n}=Ta(),{isAvailable:r}=za(),{hasInterrupt:o}=cl(),{t:i,locale:a}=la(),s=$a(a);if(!r&&(!n||!t.length)||o)return null;const c=i("translations.settings.openButtonText",{hasLanguage:!!s,language:s});return(0,e.jsxs)("div",{className:qa("chat__options"),children:[r&&(0,e.jsx)("div",{className:qa("chat__options-item","chat__options-item--left"),children:(0,e.jsxs)(yu,{classNames:["button--secondary"],children:[(0,e.jsx)(ls,{alt:c,name:"newTranslation",size:"16"}),(0,e.jsx)("span",{className:qa("button__text"),children:c})]})}),n&&(0,e.jsx)("div",{className:qa("chat__options-item","chat__options-item--right"),children:(0,e.jsx)(du,{})})]})}const bu=()=>{const{scrollToRef:t,unreadIds:n}=(0,Se.useContext)(bl),{isMinimized:r}=Mi(),{t:o}=la();return(0,e.jsx)(Pl,Object.assign({isActive:!!n.length&&!r},{children:(0,e.jsx)("div",Object.assign({className:qa("unread-messages")},{children:(0,e.jsxs)("button",Object.assign({type:"button",className:qa("button","button--primary"),onClick:t},{children:[o("message.unreadMessagesCount",{unreadCount:n.length}),(0,e.jsx)(ls,{name:"chevronDown",size:"32",alt:""})]}))}))}))},gu=dr(wr,(e=>e.filter((e=>{var t;return Gr(e)&&"service_data"!==e.type&&(null===(t=e.payload)||void 0===t?void 0:t.messageStatus)===Qe})).map((e=>e.payload.id))));const vu=e=>{const t=(0,Se.useRef)(),[n,r]=(0,Se.useState)(!0),o=Le(gu),i=Or(),a=jr(),{isOpen:s}=Mi(),c=gr().loadedImageEventIds,l=Le((e=>e.state.isLastEventFromClient));(0,Se.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,Se.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 ma(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,Se.useEffect)((()=>{l&&u()}),[l,u]),(0,Se.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}},wu=({children:t})=>{const n=Or(),r=(0,Se.useMemo)((()=>n.reduce(((e,t)=>(e[t.payload.id]=(0,xe.createRef)(),e)),{})),[n]),{scrollToRef:o,scrollToBottom:i,containerRef:a,unreadIds:s}=vu(r);return(0,e.jsx)(bl.Provider,Object.assign({value:{eventRefs:r,unreadIds:s,scrollToRef:o,scrollToBottom:i,containerRef:a}},{children:(0,e.jsxs)("div",Object.assign({className:qa("chat__container")},{children:[(0,e.jsx)("div",Object.assign({className:qa("chat__container__scroll-area"),ref:a},{children:t})),(0,e.jsx)(bu,{})]}))}))},Ou=({baseClassName:t,children:n,title:r})=>{const o=Sr(),i=Ua();return(0,e.jsxs)("section",{id:o,className:qa(t),"aria-describedby":i,tabIndex:"-1",children:[(0,e.jsx)("h2",{className:qa(`${t}__title`),id:i,children:r}),n]})},ju=()=>{const{t}=la(),n=va(),r=Ia(),{emitEvent:o}=qi(),{isActive:i,remaining:a,timer:s,endCountdown:c}=Ma(),l=a>0,u=t(l?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,e.jsx)(Ou,{baseClassName:"idle",title:u,children:l&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:qa("idle__count-container"),children:i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:qa("idle__count-text"),children:t("idleDetachWarning.countdownText")}),(0,e.jsx)("span",{className:qa("idle__count-timer"),children:t("idleDetachWarning.countdownTimer",s)})]})}),(0,e.jsxs)("div",{className:qa("idle__options"),children:[(0,e.jsx)("button",{type:"button",className:qa("button","button--primary"),onClick:()=>{r(),c(!0),n(),o("idleTimer.selectContinue")},children:t("idleDetachWarning.continueButton")}),(0,e.jsx)("button",{type:"button",className:qa("button","button--primary"),onClick:()=>{c(),n(),o("idleTimer.selectEnd")},children:t("idleDetachWarning.detachButton")})]})]})})},xu=()=>{const{t}=la(),n=Ia(),{name:r}=_r()||{},{continueChat:o,restartChat:i}=Ra();return(0,e.jsx)(Ou,{baseClassName:"prompt",title:t("resumeConversationPrompt.title",{name:r}),children:(0,e.jsxs)("div",{className:qa("prompt__options"),children:[(0,e.jsx)("button",{type:"button",className:qa("button","button--primary"),onClick:()=>{n(),o()},children:t("resumeConversationPrompt.continueButton")}),(0,e.jsx)("button",{type:"button",className:qa("button","button--primary"),onClick:i,children:t("resumeConversationPrompt.detachButton")})]})})};function Su(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 Cu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _u=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:o}=gr().entryMeta,i=$e(),a=n||t||e,s=o[a]||r[a]||{},c=(0,Se.useCallback)((e=>{i(yo(e))}),[i]),l=(0,Se.useCallback)((e=>{i(fo(e))}),[i]),u=(0,Se.useCallback)((e=>{i(Io(e))}),[i]),d=(0,Se.useCallback)((()=>{n?u(null):l(e)}),[n,e,u,l]);return{activeEntry:a,activeEntryOptions:s,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:d,setBlockAutoEntrySwitch:c}};function Eu({controlName:t,skipLinkId:n}){const{t:r}=la(),{sendAssertive:o}=da(),{emitEvent:i}=qi(),a=(()=>{const{sendAction:e}=qi(),{features:t}=Ta(),{typingPeekahead:n}=t||{},r=(0,Se.useRef)(null),o=(0,Se.useRef)(null),i=(0,Se.useRef)(!1),a=(0,Se.useRef)(null);(0,Se.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?Su(Object(n),!0).forEach((function(t){Cu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Su(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({type:et,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:s}=_u(),{hasCharacterLimit:c,characterLimit:l,reachedCharacterWarning:u,reachedCharacterLimit:d,remainingChars:p}=function(e){const{t}=la(),{sendAssertive:n}=da(),{hasLimit:r,limit:o}=(()=>{const{entryMeta:{options:{text:e},optionsOverride:{text:t}}}=gr(),{limit:n}=t||e||{limit:null};return{hasLimit:null!==n,limit:null!==n?n:null}})(),i=(0,Se.useMemo)((()=>f(n,300)),[n]),a=(0,Se.useMemo)((()=>f(((e,n)=>{e&&i(t("input.srCharacterLimitText",{limit:n}))}),300)),[i,t]),[{value:s}]=Kl(e),c=r&&s?o-s.length:o,l=!!r&&c<=50,u=!!r&&c<0;return(0,Se.useEffect)((()=>{a(l,c)}),[l,c,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}(t),[{value:h}]=Kl(t),y=!!h,m=(0,Se.useCallback)((()=>{u&&o(r("input.srCharacterLimitText",{limit:p})),i("ui.inputFocus")}),[r,o,u,p,i]),b=(0,Se.useMemo)((()=>r("input.inputPlaceholder",{hasLimit:c,limit:c?l:null})),[r,c,l]),g=(0,Se.useMemo)((()=>r("input.inputLabel",{hasLimit:c,limit:c?l:null})),[r,c,l]);return(0,Se.useLayoutEffect)((()=>(s(y),()=>{s(!1)})),[s,y]),(0,e.jsxs)(Zl,{className:qa("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,e.jsxs)("div",{className:qa(["input--text__container",...u&&!d?["character-warning"]:[],...d?["character-exceeded"]:[]]),children:[(0,e.jsx)(au,{id:n,type:"text",name:t,className:qa("input__text"),autocomplete:"off",placeholder:b,labelText:g,labelClass:qa("visually-hidden"),"aria-invalid":c?d:null,onKeyUp:a,onFocus:m}),(0,e.jsx)("div",{className:qa("character-count"),children:u&&(0,e.jsx)("span",{children:p})})]}),(0,e.jsx)("button",{className:qa("button","input__submit"),type:"submit",onPointerDown:e=>{e.preventDefault()},"aria-disabled":!y||d?"true":null,children:(0,e.jsx)(ls,{name:"send",size:"32",alt:r("input.sendMessage")})})]})}function Pu(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 Tu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pu(Object(n),!0).forEach((function(t){ku(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ku(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Au(){return Au=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},Au.apply(this,arguments)}const Iu="textMessageEntry";function Nu(t){let n=Au({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(t),t));const{isOpen:r,setVisibility:o}=Mi(),i=Sr(),a=va(),{sendMessage:s}=qi(),c=(0,Se.useCallback)(((e,{updateControlValue:t})=>{s({body:e.textMessageEntry}),t(Iu,""),a(),r||o(hr.open)}),[s,a,r,o]);return(0,e.jsx)(Jl,Tu(Tu({},n),{},{formId:"textEntry",persistData:!0,onSubmit:c,children:(0,e.jsx)(Eu,{controlName:Iu,skipLinkId:i})}))}const Du=()=>{const{t}=la(),{currentUploads:n}=Ca();return(0,e.jsx)("div",{className:qa("progress"),children:n.map((({id:n,name:r,progress:o,uploading:i,error:a})=>(0,e.jsxs)("div",{className:qa("progress_container"),children:[(0,e.jsxs)("div",{className:qa("progress__text"),children:[(0,e.jsx)("span",{className:qa("progress__text--file-name"),children:r}),(0,e.jsx)("span",{className:qa("progress__text--percentage"),children:`${o}%`})]}),(0,e.jsx)(eu,{error:a}),(0,e.jsx)("progress",{className:qa("progress__bar"),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-label":t("fileUpload.srProgressLabel",{fileName:r}),max:"100","aria-valuenow":o,value:o,"aria-busy":i,children:`${o}%`})]},n)))})};function Lu({id:t,name:n,labelText:r,contentHint:o,outputText:i,accept:a}){const{isSubmitted:s}=Gl(),[c,l]=(0,Se.useState)(!1),[{onInput:u,onBlur:d},{error:p}]=Kl(n),f=Ua(),h=Ua(),y=Ua(),m=s&&p,b=[y];o&&b.push(h),m&&b.push(f);const g=(0,Se.useCallback)((()=>{l(!0)}),[l]),v=(0,Se.useCallback)((()=>{l(!1),d()}),[l,d]),w=(0,Se.useCallback)((e=>{const t={target:{value:e.target.files}};u(t)}),[u]);return(0,e.jsxs)("div",{className:qa("upload__container"),children:[o&&(0,e.jsx)("span",{className:qa("upload__content-hint"),id:h,children:o}),(0,e.jsx)(eu,{id:f,error:m&&p}),(0,e.jsx)("div",{className:qa(["file-upload",...c?["focus-within"]:[]]),children:(0,e.jsxs)("label",{htmlFor:t,className:qa("upload__label"),children:[(0,e.jsx)(ls,{name:"upload",size:"32"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:qa(["upload__label--text"]),children:r}),(0,e.jsx)("input",{id:t,className:qa("upload__input"),type:"file",name:n,onChange:w,"aria-invalid":m?"true":"false","aria-describedby":b.join(" "),accept:a||null,onFocus:g,onBlur:v}),(0,e.jsx)("span",{className:qa("upload__output"),"aria-hidden":"true",id:y,children:i})]})]})})]})}function Mu({skiplinkId:t,controlName:n,accept:r,contentHint:o,isUploading:i,isComplete:a,onClickCancel:s}){const{t:c}=la(),[{value:l}]=Kl(n),u=l&&l.length>0,d=u?l[0].name:"";return(0,e.jsxs)(Zl,{className:qa("upload-form"),children:[(0,e.jsx)(Lu,{name:n,id:t,accept:r,labelText:c("fileUpload.labelText"),outputText:c("fileUpload.selectedText",{hasFile:u,filename:d}),contentHint:o}),(0,e.jsxs)("div",{className:qa("upload__button-container"),children:[(0,e.jsx)("button",{id:i||!a?t:void 0,type:"button",onClick:s,className:qa("button","button--secondary","upload__cancel"),children:c("fileUpload.cancelButtonText")}),(0,e.jsx)("button",{className:qa("button","button--primary"),type:"submit",children:c("fileUpload.uploadButtonText")})]})]})}const Ru="fileListForm",Uu="fileList",Fu=()=>{const{t}=la(),{sendPolite:n,sendAssertive:r}=da(),o=Sr(),i=va(),{serviceAllowsUploads:a,allowedMimeTypes:s,maxSize:c}=Sa(),l=(0,Se.useRef)(null),u=(0,Se.useRef)(a),{cancelEntrySelection:d}=_u(),{uploadFile:p,clearUploads:f,isUploading:h,isComplete:y}=Ca(),{hasFile:b,selectedFileName:g,uploadHandle:v,hasServerError:w,progress:O}=((e,t)=>{const n=Le((n=>Vl(n,{formId:e,name:t}))),{currentUploads:r}=Ca(),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}})(Ru,Uu),j=Ua(),x=(0,Se.useRef)(!0),S=t("fileUpload.contentHint",{size:m(c)}),C=(0,Se.useRef)(""),_=(0,Se.useRef)(null);(0,Se.useEffect)((()=>{C.current&&_.current?.contains(document.activeElement)&&"INPUT"===document.activeElement.tagName&&r(S),C.current=S}),[S,r]),(0,Se.useEffect)((()=>{O>0&&n(1===O?t("fileUpload.srStartedText"):`${O}%`)}),[O,n,t]),(0,Se.useEffect)((()=>{x.current||h||!y||(f(),d(),i(),setTimeout((()=>{n(t("fileUpload.srCompleteText"))}),300)),x.current=y}),[h,y,f,d,i,n,t]);const E=(0,Se.useCallback)((({fileList:e})=>{p(e[0]),i()}),[p,!1,i]),P=(0,Se.useCallback)((()=>{v&&v.abort(),f(),d(),i()}),[v,f,d,i]),T=(0,Se.useMemo)((()=>({[Uu]:[Nl((()=>a),t("fileUpload.errors.unavailable")),Nl(Ll,t("fileUpload.errors.noFile")),Nl(Dl,t("fileUpload.errors.tooLarge"),c)]})),[c,a,t]);return(0,e.jsx)("div",{className:qa(["upload",...w?["upload--error"]:[]]),ref:_,children:(0,e.jsxs)(Jl,{formId:Ru,persistData:!0,onSubmit:E,validationSchema:T,children:[(h||!y)&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Du,{}),(0,e.jsx)("div",{className:qa("upload__button-container"),children:(0,e.jsx)("button",{id:h||!y?o:void 0,type:"button",onClick:P,ref:l,className:qa("button","button--secondary","upload__cancel"),children:t("fileUpload.cancelButtonText")})})]}),!h&&y&&(0,e.jsx)(Mu,{controlName:Uu,skiplinkId:o,accept:s.join(", "),contentHint:S,isComplete:y,isUploading:h,outputText:t("fileUpload.selectedText",{hasFile:b,filename:g}),onClickCancel:P}),!u.current&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:qa("notification"),id:j,children:t("fileUpload.unavailableText")}),(0,e.jsx)("div",{className:qa("upload__button-container"),children:(0,e.jsx)("button",{id:h||!y?o:void 0,type:"button",onClick:P,className:qa("button","button--secondary","upload__cancel"),children:t("fileUpload.cancelButtonText")})})]})]})})},zu=()=>{const{t}=la(),{showFileUpload:n,serviceAllowsUploads:r}=Sa(),[o,i]=(0,Se.useState)(r),a=va(),s=(0,Se.useRef)(null),{setUserEntryType:c,activeEntry:l}=_u(),u=(0,Se.useRef)(null),{sendPolite:d}=da(),p=!!_r();return(0,Se.useEffect)((()=>{O(u.current,(()=>{r||a()})),i(r)}),[r,a]),(0,Se.useEffect)((()=>{s.current&&!r&&d(t("fileUpload.srUnavailableText")),!1===s.current&&r&&d(t("fileUpload.srAvailableText")),p&&(s.current=r)}),[r,p,d,t]),!n&&l!==Xe&&(0,e.jsx)(Pl,{isActive:o,transitionStartState:_l,children:(0,e.jsx)("div",{className:qa("upload-toggle-wrapper"),children:(0,e.jsx)(Pl,{isActive:o,transitionStartState:El,children:(0,e.jsx)("button",{className:qa(["button","button--secondary","upload-toggle"]),ref:u,"aria-disabled":o?null:"true",type:"button",onClick:o?()=>{c(Xe),a()}:null,children:(0,e.jsx)(ls,{name:"file",size:"32",alt:t("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 Hu(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){$u(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 $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 qu=()=>{const{isOpen:t}=Mi(),n=(0,Se.useRef)(null),{hasCountdown:r}=Ma(),[o,i]=(0,Se.useState)(r),{hasPrompt:a}=Ra(),[s,c]=(0,Se.useState)(a),l=va(),u=(0,Se.useRef)(!1),{activeEntry:d}=_u(),[p,f]=(0,Se.useState)({text:Nu,upload:Fu}),[h,y]=(0,Se.useState)((()=>d)),m=mr(),{accountAllowsUploads:b}=Sa(),g=(0,Se.useCallback)((()=>{O(n.current,l)}),[l]);(0,Se.useEffect)((()=>{const{customComponents:e}=m,{entry:t}=e||{};t&&f((e=>Hu(Hu({},e),t)))}),[m]),(0,Se.useEffect)((()=>{g(),i(r),c(a)}),[r,a,g]),(0,Se.useEffect)((()=>{y(d),g()}),[d,g,n]),u.current=!(!n.current||!n.current.contains(document.activeElement));const v=p[h];return(0,e.jsxs)("div",{className:qa("chat__entry"),ref:n,children:[o&&(0,e.jsx)(ju,{}),s&&(0,e.jsx)(xu,{}),(0,e.jsxs)("div",{className:qa(["entry__body",...r||a?["entry__body--hidden"]:[]]),children:[h!==Xe&&b&&t&&(0,e.jsx)(zu,{}),(0,e.jsx)(v,{})]})]})},Vu=()=>{const{t}=la(),{isOpen:n,closeChat:r}=Mi(),{isWindow:o}=Er();return n&&o?(0,e.jsx)("button",{type:"button",className:qa("button","collapse-button"),onClick:r,children:(0,e.jsx)(ls,{name:"chevronDown",size:"32",alt:t("window.srCollapseButton")})}):null},Wu=({children:t,handleClose:n,title:r,closeButtonText:o,srCloseButtonText:i,id:a})=>{const s=Ua();return(0,e.jsxs)("section",Object.assign({tabIndex:-1,id:a,"aria-labelledby":r?s:void 0,className:qa("chat-status",!r&&"chat-status--condensed")},{children:[(0,e.jsxs)("div",Object.assign({className:qa("chat-status__body")},{children:[r?(0,e.jsx)("h2",Object.assign({className:qa("chat-status__title"),id:s},{children:r})):null,t]})),"function"==typeof n&&(0,e.jsxs)("button",Object.assign({type:"button",onClick:n,className:qa("button","button--tertiary","chat-status__close")},{children:[o||(0,e.jsx)(ls,{name:"close",size:"16",alt:""}),i&&(0,e.jsx)("span",Object.assign({className:qa("visually-hidden")},{children:i}))]}))]}))};function Gu(){const{t}=la(),{id:n}=Ha(),{hasInterrupt:r}=cl(),{disableTranslations:o,currentLocale:i}=za(),a=$a(i),s=va(),c=t("translations.status.label",{language:a}),l=(0,Se.useCallback)((()=>{o(),s()}),[o,s]);return r?null:(0,e.jsx)(Wu,{handleClose:l,title:c,id:n,closeButtonText:t("translations.status.stopText"),srCloseButtonText:t("translations.status.srStopText")})}const Ku=({handleClick:t,icon:n,title:r,srButtonText:o})=>(0,e.jsxs)("button",Object.assign({type:"button",onClick:t,className:qa("button","button--primary","chat-status__button")},{children:[(0,e.jsx)(ls,{name:n,size:"16",alt:""}),r,o&&(0,e.jsx)("span",Object.assign({className:qa("visually-hidden")},{children:o}))]}));function Ju(){const{showProposal:t,translationProposal:n,dismissTranslationProposal:r,activateTranslationProposal:o}=(()=>{const{isActive:e,languages:t}=za(),n=$e(),{sendAction:r}=qi(),{translationProposal:o}=Le((e=>e.translations)),{enableTranslations:i}=za(),{isOpen:a}=Mi(),{locale:s}=la(),c=null==o?void 0:o.proposedLocale,l=$a(c),u=(0,Se.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,"translation_proposal")},dismissTranslationProposal:()=>{r({type:rt,body:{type:st}}),n(Ti())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:o}})(),{id:i}=Ha();return t?(0,e.jsx)(Wu,Object.assign({handleClose:r,srCloseButtonText:n.srDismissButtonText,id:i,title:n.titleLabel},{children:(0,e.jsx)(Ku,{handleClick:o,icon:"newTranslation",title:n.buttonLabel})})):null}function Xu(){const{hasInterrupt:t}=cl(),{isActive:n}=za();return t?null:n?(0,e.jsx)(Gu,{}):(0,e.jsx)(Ju,{})}function Qu(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 Yu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zu=function({children:t,interruptComponent:n}){const{hasInterrupt:r,meta:o}=cl(),{isOpen:i}=Mi();return r?i?(0,e.jsx)(n,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qu(Object(n),!0).forEach((function(t){Yu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},o)):null:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(wu,{children:[(0,e.jsxs)("div",{className:qa("chat__container__header"),children:[(0,e.jsx)(Xu,{}),(0,e.jsx)(Vu,{})]}),t]}),(0,e.jsx)(qu,{}),i&&(0,e.jsx)(mu,{})]})},ed=({originalError:t,title:n,message:r,buttonText:o,action:i,srText:a})=>{const s=qi(),c=Ua(),{sendPolite:l}=da(),u=va(),d="SeamlySessionExpiredError"===t.name;return(0,Se.useEffect)((()=>{d&&s[i]&&s[i]()}),[i,s,d]),(0,Se.useEffect)((()=>{!d&&a&&setTimeout((()=>{l(a)}),200)}),[l,a,d]),d?(0,e.jsx)(e.Fragment,{}):(0,e.jsxs)("section",{className:qa("interrupt"),"aria-labelledby":c,children:[(0,e.jsx)(Vu,{}),(0,e.jsxs)("div",{className:qa("interrupt__body"),children:[(0,e.jsx)("h2",{id:c,className:qa("interrupt__title"),children:n}),(0,e.jsx)("p",{className:qa("interrupt__message"),children:r}),o&&i&&(0,e.jsx)("div",{className:qa("interrupt__actions"),children:(0,e.jsx)("button",{type:"button",className:qa("button","button--primary"),onClick:()=>{s[i]&&s[i](),u()},children:o})})]})]})};function td({event:t}){const[n]=gl(t);return(0,e.jsx)(n,{event:t})}function nd(){const{preChatEvents:t,layoutMode:n}=mr(),{hasInterrupt:r}=cl(),{isOpen:o}=Mi(),i=!(r||!t?.length||o);return i&&(0,e.jsx)("ul",{className:qa("pre-chat-messages",`pre-chat-messages--${n}`),"aria-hidden":!i,children:t.map((t=>(0,e.jsx)("li",{className:qa("pre-chat-messages__message"),children:(0,e.jsx)(td,{event:t})},t.payload.id)))})}function rd(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 od(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const id=()=>{const t=function(){const{startChatIcon:e}=mr();return e}(),n=_r(),{hasInterrupt:r}=cl(),o=n&&!r,i=o?n.avatar:t;return i?(0,e.jsx)("img",{className:qa(o?"avatar":"icon"),src:i,alt:""}):(0,e.jsx)(ls,{name:"avatar",size:"32"})},ad=({onClick:t})=>{const n=zi(),{t:r}=la(),o=n()?r("window.openButton.srContinue"):r("window.openButton.srStart"),i=va(),{isOpen:a}=Mi(),s=xr(),c=(0,Se.useCallback)((()=>{t(),i()}),[i,t]);return(0,e.jsx)(Pl,{isActive:!a,transitionStartState:_l,children:(0,e.jsxs)("button",{className:qa("window-open-button"),"aria-label":o,"aria-hidden":a,onClick:c,children:[(0,e.jsx)("span",{className:qa("message-count"),"aria-hidden":"true",children:!!s&&s}),(0,e.jsx)(id,{})]})})},sd={app:()=>(0,e.jsx)(Al,{children:(0,e.jsx)(Zu,{interruptComponent:ed,children:(0,e.jsx)(jl,{})})}),inline:()=>{const{showInlineView:t,containerRef:n}=(()=>{const e=$e(),{connectWhenInView:t}=mr(),n=Le(kr),{containerRef:r,isVisible:o}=Ri({enabled:t,freezeOnceVisible:!0});return(0,Se.useEffect)((()=>{o&&e(Ni())}),[e,o]),{containerRef:r,showInlineView:n}})(),{isOpen:r}=Mi(),{hasInterrupt:o,meta:i}=cl();return o&&!r?(0,e.jsx)(ed,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rd(Object(n),!0).forEach((function(t){od(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},i)):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Pl,{isActive:!r,transitionStartState:_l,children:(0,e.jsxs)("div",{ref:n,className:qa("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,e.jsx)(nd,{}),(0,e.jsx)(Tl,{})]})}),(0,e.jsx)(Pl,{isActive:r,transitionStartState:_l,children:(0,e.jsx)(Al,{ref:n,children:t&&(0,e.jsx)(Zu,{interruptComponent:ed,children:r&&(0,e.jsx)(jl,{})})})})]})},window:()=>{const{isOpen:t,openChat:n}=Mi(),r=Rr(),{t:o}=la(),i=o("window.chat.continue"),a=(0,Se.useMemo)((()=>({payload:{body:{text:i}}})),[i]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ad,{onClick:n}),(0,e.jsx)(Pl,{isActive:!t&&!r,transitionStartState:_l,children:(0,e.jsx)("div",{className:qa("unstarted-wrapper","unstarted-wrapper--window"),children:(0,e.jsx)(nd,{})})}),(0,e.jsx)(Pl,{isActive:!t&&r,transitionStartState:Cl,children:(0,e.jsx)("div",{className:qa("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,e.jsx)(Mc,{event:a})})}),(0,e.jsx)(Pl,{isActive:t,transitionStartState:Cl,children:(0,e.jsx)(Al,{children:(0,e.jsx)(Zu,{interruptComponent:ed,children:(0,e.jsx)(jl,{})})})})]})}},cd=({children:t})=>{const[,n]=ba(),{namespace:r,layoutMode:o,zIndex:i}=mr(),{isOpen:a,isVisible:s}=Mi(),c=ha(),l=Rr(),{locale:u}=la(),d=sd[o],p=(0,Se.useCallback)((e=>{n(e)}),[n]),f=(0,Se.useMemo)((()=>{if(u&&document.querySelector("html").getAttribute("lang")!==u)return u}),[u]);if(!d)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const h=["app",`app--layout-${o}`,`namespace--${r}`,...c];return a||"app"===o||h.push("app--collapsed"),l&&h.push("app--user-responded"),s&&(0,e.jsx)("div",{className:qa(h),lang:f,tabIndex:"-1","data-nosnippet":!0,style:{zIndex:i},ref:p,children:t||(0,e.jsx)(d,{})})};function ld(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 ud(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ld(Object(n),!0).forEach((function(t){dd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ld(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function dd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const pd=t=>(0,e.jsx)(hl,ud(ud({},t),{},{children:(0,e.jsx)(cd,{})}));var fd=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 hd{constructor(e,t){const{namespace:n="",parentElement:r,showFaq:o}=e,i=fd(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 we({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 t=this.config.customComponents||{},{view:n}=t,r=fd(t,["view"]),o=Object.assign(Object.assign({},this.config),{customComponents:Object.keys(r).length?r:void 0}),i=function({initialState:e,api:t,eventBus:n,config:r}){return Bn({reducer:{state:Ro,app:Br,config:Vo,i18n:ui,translations:ki,visibility:Di,forms:ai,interrupt:Wr},preloadedState:e,middleware:e=>e({thunk:{extraArgument:{api:t,eventBus:n,config:r}},serializableCheck:!1}).concat([Jo({api:t}),pi({api:t}),mi({api:t}),Ai])})}({api:this.api,eventBus:this.eventBus,config:o,initialState:void 0});i.dispatch(Ho(o)),yield i.dispatch(rr());try{const{locale:e}=yield i.dispatch(Lr()).unwrap();yield i.dispatch(ir(e))}catch(e){}i.dispatch(Nr()),n?(0,xe.render)((0,e.jsx)(hl,Object.assign({eventBus:this.eventBus,store:i,api:this.api},{children:(0,e.jsx)(n,{})})),this.parentElement):(0,xe.render)((0,e.jsx)(pd,{config:o,eventBus:this.eventBus,store:i,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 yd(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 md(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yd(Object(n),!0).forEach((function(t){bd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const gd=e=>"object"==typeof e&&"action"in e,vd=e=>md(md({},e),{},{args:Array.isArray(e.args)?e.args:[e.args]}),wd=class{constructor(e){this._waitingActions=[],this._instances={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(gd).map(vd)).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)}}))}setContext(e,t){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=md({},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 hd(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=md(md({},e.context||this.appConfig.context),this.context),n=this.getMergedVariables(e);Object.keys(n).length>0&&(t.variables=n);const r=md(md({},this.appConfig.defaults),e.defaults),o=md(md(md({},this.appConfig),e),{},{api:md(md({},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 md(md(md({},this.appConfig.context?.variables||{}),e.context?.variables||{}),this.context.variables||{})}},Od=()=>{const e=new URLSearchParams(window.location.search);return Array.from(e.entries()).reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n})),{})},jd=e=>new URLSearchParams(e).toString();function xd(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 Sd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xd(Object(n),!0).forEach((function(t){Cd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _d={direction:"to_translation_locale",locale:"nl",translatedBy:"deep_l",data:{}};function Ed(e){switch(e.payload.type){case"cta":case"image":case"text":case"choice_prompt":return Sd(Sd({},e),{},{payload:Sd(Sd({},e.payload),{},{translatedBody:Sd(Sd({},_d),{},{data:Sd(Sd({},e.payload.body),{},{text:e.payload.body.text?`NL - ${e.payload.body.text}`:void 0,description:e.payload.body.description?`NL - ${e.payload.body.description}`:void 0,buttonText:e.payload.body.buttonText?`NL - ${e.payload.body.buttonText}`:void 0,choices:e.payload.body.choices?e.payload.body.choices.map((e=>Sd(Sd({},e),{},{text:`NL - ${e.text}`}))):void 0,prompt:e.payload.body.prompt?Sd(Sd({},e.payload.body.prompt),{},{text:`NL - ${e.payload.body.prompt.text}`}):void 0})})})});default:return e}}const Pd=["headingText","category","description"];function Td(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 kd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Td(Object(n),!0).forEach((function(t){Ad(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Td(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ad(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Id={events:[],config:{layoutMode:"inline",accountConfig:{},hideOnNoUserResponse:!1,showFaq:!1,showDisclaimer:!1,showSuggestions:!0},initialState:{},unreadEvents:0,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1},resumeConversationPrompt:!1,visibility:{visibility:hr.open},serviceInfo:{activeServiceSessionId:""},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:"Test title",subTitle:"Test subtitle"},interrupt:{error:void 0},historyLoaded:!1,skiplinkTargetId:S(),optionsButtonId:S(),serviceData:{},options:{features:{},panelActive:!1,optionActive:"",userSelectedOptions:{}},entryMeta:{default:"text",active:"text",userSelected:null,options:{},optionsOverride:{}},currentUploads:[]},Nd={participants:{agent:{id:"agent",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},user:{id:"user",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}}},currentAgent:"agent"},Dd={type:"info",payload:{body:{subtype:"new_topic",type:"divider"},fromClient:!1,fromHistory:!0,id:S(),transactionId:"_1y9pz5fbyly",type:"divider"}},Ld={type:"info",payload:{body:{language:"Nederlands",restartButtonText:null,subtype:"new_translation",text:"[NL] Automatic translation to Dutch started. Please note that automatic translations may contain errors.",title:"[NL] Translating to Dutch",translationEnabled:!0,translationLocale:"nl"},fromClient:!1,fromHistory:!0,id:S(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},Md={type:"info",payload:{body:{language:"Nederlands",subtype:"new_translation",text:"[NL] Automatic translation to Dutch started. Please note that automatic translations may contain errors.",translationEnabled:!0,translationLocale:"nl"},fromClient:!1,fromHistory:!0,id:S(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},Rd={type:"info",payload:{body:{language:"Nederlands",restartButtonText:"[NL] Start again",subtype:"new_translation",text:null,title:"[NL] Automatic translation to Dutch ended",translationEnabled:!1,translationLocale:"nl"},fromClient:!1,fromHistory:!0,id:S(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},Ud={type:"info",payload:{body:{text:"This is a system generated info message",type:"text"},fromClient:!1,id:S(),participant:null,service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:null,type:"text"}},Fd={type:"info",payload:{body:{key:["info","sendTranscript","accepted"],variables:{emailAddress:"test@test.com"}},fromClient:!1,id:S(),participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,type:"translation"}},zd={title:"You're talking to",subTitle:"Mrs. Bot"},Bd={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:S(),messageStatus:"received",participant:{avatar:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjNEE0OEMxIiBkPSJNMTAsMTQuOGMtMS4xLDAtMi0wLjktMi0yczAuOS0yLDItMnMyLDAuOSwyLDJTMTEuMSwxNC44LDEwLDE0Ljh6IE0xNS45LDE0LjhjMS4xLDAsMi0wLjksMi0ycy0wLjktMi0yLTIKCXMtMiwwLjktMiwyUzE0LjgsMTQuOCwxNS45LDE0Ljh6IE0yMS44LDEwLjhjLTEuMSwwLTIsMC45LTIsMnMwLjksMiwyLDJzMi0wLjksMi0yUzIyLjksMTAuOCwyMS44LDEwLjh6IE0yMS4zLDE4LjFIMTAuNwoJQzExLjcsMjMuOSwyMC4yLDIzLjksMjEuMywxOC4xeiIvPgo8L3N2Zz4K",id:"agent",introduction:"You're now talking to Mrs. Bot gimme a minit",name:"Mrs. Bot",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},transactionId:"d63655bf-1d3d-42cf-b14e-4da9e2b6a642",type:"participant"}},Hd={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:S(),messageStatus:"received",participant:{introduction:"Welcome, you are now chatting with Mrs. Bot 2, give me a minit to read back the chat history.",id:"agent",avatar:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjNEE0OEMxIiBkPSJNMTAuMSwxNC45Yy0xLjEsMC0yLTAuOS0yLTJzMC45LTIsMi0yczIsMC45LDIsMlMxMS4yLDE0LjksMTAuMSwxNC45eiBNMjEuOSwxMC45Yy0xLjEsMC0yLDAuOS0yLDIKCXMwLjksMiwyLDJzMi0wLjksMi0yUzIzLDEwLjksMjEuOSwxMC45eiBNMjEuNCwxOC4ySDEwLjhDMTEuOCwyNCwyMC4zLDI0LDIxLjQsMTguMnogTTE3LjIsMjUuM2gtMi40Yy0wLjYsMC0xLjIsMC40LTEuNCwxCgljLTUuMS0wLjItOS4yLTQuNC05LjQtOS42YzAuMSwwLDAuMiwwLjEsMC40LDAuMWgwLjFjMC44LDAsMS40LTAuNiwxLjQtMS40di00LjdjMC0wLjgtMC42LTEuNC0xLjQtMS40aDBjLTAuOCwwLTEuNCwwLjYtMS40LDEuNAoJdjIuN3YydjEuMWMwLDUuOSw0LjcsMTAuNiwxMC41LDEwLjhjMC4yLDAuNSwwLjcsMC44LDEuMiwwLjhoMi40YzAuOCwwLDEuNC0wLjYsMS40LTEuNFMxOCwyNS4zLDE3LjIsMjUuM3oiLz4KPC9zdmc+Cg==",name:"Two",service:{expose:{map:{},version:3},meta:{},name:"new service",serviceSessionId:S(),settings:{}}},transactionId:S(),type:"participant"}},$d={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:S(),messageStatus:"received",participant:{id:"user",introduction:"You're now talking to Mrs. Bot gimme a minit",name:"Mrs. Bot",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},transactionId:"d63655bf-1d3d-42cf-b14e-4da9e2b6a642",type:"participant"}},qd=({type:e,data:t,text:n})=>({type:"message",payload:{body:{type:e,text:n,data:t},participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},fromClient:!1,fromHistory:!0,id:"4efacb4d-28a0-454e-8e36-3f17eb598c5d",messageStatus:"read",transactionId:"6f9beee7-ce82-418e-9bec-8001079aa769",transactionLast:!0,type:"custom"}}),Vd={type:"message",payload:{body:{text:"What do you want to do?",type:"text"},fromClient:!1,fromHistory:!0,id:S(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!1,type:"text"}},Wd={type:"message",payload:{type:"splash",id:S(),body:{text:"Example splash message ✨",type:"text",variables:{}}}},Gd={type:"message",payload:{body:{description:"Thanks for chatting!\n\nMore info about our <strong>products</strong>?",buttonLink:"https://seamly.ai",buttonText:"View website",buttonNewTab:!0},type:"cta",fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792z",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1}},Kd={type:"message",payload:{body:{text:"What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am. What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am. What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am.",type:"text"},fromClient:!1,fromHistory:!0,id:S(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!1,type:"text"}},Jd={type:"message",payload:{body:{text:"Bubble with <strong>bold</strong> <em>italic</em> <u>underline</u>",type:"text"},fromClient:!1,fromHistory:!0,id:S(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},Xd={type:"message",payload:{body:{text:'<a href="https://google.com" data-link-id="1">Link in same window</a> and <a href="https://google.com" data-link-id="2" target="_blank">link in new window</a> embedded in text',type:"text"},fromClient:!1,fromHistory:!0,id:S(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},Qd={type:"message",payload:{body:{text:'Here is a long link <a href="https://google.com" data-link-id="1">click me click me please click me yoohoooo please please click me here I am click me now what are you waiting for click me now now now now now click meeeeeeeeeeeeee</a> embedded in text',type:"text"},fromClient:!1,fromHistory:!0,id:"a964e54e-ea98-46ff-a952-979a47f162c0",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},Yd={type:"message",payload:{body:{text:"<ul>\n<li>Bullets</li>\n<li>bullets</li>\n<li>bullets</li>\n</ul>\n",type:"text"},fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792a",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},Zd={type:"message",payload:{body:{description:"Plaatje",isZoomable:!1,type:"image",url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-square-small.jpg"},fromClient:!1,fromHistory:!0,id:"b44ef42c-880c-43ff-b067-499e7f2e81f7",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"image"}},ep={type:"message",payload:{body:{description:"Plaatje",isZoomable:!0,type:"image",url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-portrait.jpg"},fromClient:!1,fromHistory:!0,id:"b44ef42c-880c-43ff-b067-499e7f2e81f8",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"image"}},tp={type:"message",payload:{body:{description:"test",source:"youtube",type:"video",url:"https://www.youtube.com/embed/K7Hn1rPQouU"},fromClient:!1,fromHistory:!0,id:S(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"video"}},np={type:"message",payload:{body:{choices:[{id:"703db9b3-2157-4d4a-9f9b-c382c6a10531",text:"Dialog (this is intentionally made longer for testing purposes)",type:"choice"},{id:"1eff6098-f14f-4683-a2b8-30d1c573d45e",text:"T-Dialog",type:"choice"},{id:"a8ba3ce8-3324-4e7a-accc-944ff78ac890",text:"Customers",type:"choice"},{id:"c89956ab-cf98-4b7e-9282-7087c988153d",text:"Features",type:"choice"},{id:"9fd9a28f-462d-4f07-9661-606dbe3b9466",category:"secondary",text:"Something else",type:"choice"}],chooseAgain:!0,prompt:{text:"Type "start" at any time to see this menu again",type:"text",variables:{}},type:"choice_prompt"},fromClient:!1,fromHistory:!0,id:S(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!0,type:"choice_prompt"}},rp={type:"message",payload:{body:{text:"This is what the user typed",type:"text"},fromClient:!0,fromHistory:!0,id:S(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},op={type:"message",payload:{body:{text:"This is what the user typed. And sometimes the user has quite a lot to say and then we get longer lines that need to wrap well and not break the styling so here goes with just such a line right here!!",type:"text"},fromClient:!0,fromHistory:!0,id:S(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},ip={type:"message",payload:{body:{text:'<a href="https://google.com" data-link-id="1">Link in same window</a> and <a href="https://google.com" data-link-id="2" target="_blank">link in new window</a> embedded in text',type:"text"},fromClient:!0,fromHistory:!0,id:S(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},ap={type:"upload",transactionId:"_vzhvnol0egf",meta:{},body:{contentType:"image/jpg",filename:"placeholder.jpg",filesize:991078,url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-square-small.jpg"}},sp={type:"message",payload:kd(kd({},ap),{},{fromClient:!1,participant:"agent",id:S()})},cp=kd(kd({},sp),{},{payload:kd(kd({},sp.payload),{},{body:kd({},sp.payload.body),id:S()})}),lp={type:"message",payload:kd(kd({},ap),{},{fromClient:!0,participant:"user",id:S()})},up=kd(kd({},lp),{},{payload:kd(kd({},lp.payload),{},{id:S(),body:kd(kd({},lp.payload.body),{},{url:null})})}),dp={isActive:!1,currentLocale:void 0,isAvailable:!1,showTranslationProposal:!1,languages:[],translatedEventGroups:{},containerId:S()},pp=[{id:"1",question:"Invoices",categories:["mixed","short"]},{id:"2",question:"Temporary subscription pause",categories:["mixed","medium"]},{id:"3",question:"Cancellation",categories:["mixed","short"]},{id:"4",question:"Apps",categories:["mixed","medium"]},{id:"5",question:"At what date will my subscription end?",categories:["mixed","long"]},{id:"A",question:"Quotes",categories:["short"]},{id:"B",question:"How to get in touch with us",categories:["long"]}],fp="unstarted",hp="messages",yp="errors",mp="uploads",bp="faq",gp="features",vp="options",wp="suggestions",Op="minimizedWindow",jp="minimizedInline",xp="translations",Sp={[fp]:{heading:"Unstarted UI",description:"Test the loader here"},[hp]:{heading:"Messages",description:""},[yp]:{heading:"UI errors",description:""},[mp]:{heading:"File uploads",description:""},[bp]:{heading:"FAQ",description:""},[gp]:{heading:"Other features",description:""},[vp]:{heading:"Options",description:""},[wp]:{heading:"Suggestions",description:""},[Op]:{heading:"Minimized window",desciption:""},[jp]:{heading:"Minimized Inline",description:""},[xp]:{heading:"Translations",description:""}},Cp={type:"message",payload:{type:"card",id:S(),body:{action:{ask:"",type:"ask"},buttonText:"Ask about pizzas!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.\n\nIt is made with San Marzano tomatoes, mozzarella cheese, fresh basil, salt, and extra-virgin olive oil.",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-square.jpg",title:"Pizza Margherita"}}},_p={type:"message",payload:{type:"card",id:S(),body:{action:{link:"https://seamly.ai",newTab:!0,type:"navigate"},buttonText:"Order now!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-landscape.jpg",title:"Pizza Margherita"}}},Ep={type:"message",payload:{type:"card",id:S(),body:{action:{topic:"Set topic",type:"topic"},buttonText:"Set topic! (title & description optional)",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-portrait.jpg"}}},Pp={faqEmptyList:kd(kd({category:bp,headingText:"Empty FAQ list",description:""},Id),{},{config:kd(kd({},Id.config),{},{showFaq:!0}),serviceData:{suggestion:{body:[]}}}),faqList:kd(kd({category:bp,headingText:"FAQ list",description:""},Id),{},{config:kd(kd({},Id.config),{},{showFaq:!0}),serviceData:{suggestion:{body:[{id:1,question:"Lorem ipsum dolor sit amet",categories:["short"]},{id:2,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",categories:["short"]},{id:3,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam",categories:["short"]}]}}}),faqListLong:kd(kd({category:bp,headingText:"Long FAQ list",description:""},Id),{},{config:kd(kd({},Id.config),{},{showFaq:!0}),serviceData:{suggestion:{body:[{id:1,question:"Lorem ipsum dolor sit amet",categories:["long"]},{id:2,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",categories:["long"]},{id:3,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam",categories:["long"]},{id:4,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed",categories:["long"]},{id:5,question:"Lorem ipsum dolor sit amet",categories:["long"]},{id:6,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",categories:["long"]},{id:7,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam",categories:["long"]},{id:8,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed",categories:["long"]},{id:9,question:"Lorem ipsum dolor sit amet",categories:["long"]},{id:10,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",categories:["long"]},{id:11,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam",categories:["long"]},{id:12,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed",categories:["long"]},{id:13,question:"Lorem ipsum dolor sit amet",categories:["long"]},{id:14,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",categories:["long"]},{id:15,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam",categories:["long"]},{id:16,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed",categories:["long"]},{id:17,question:"Lorem ipsum dolor sit amet",categories:["long"]},{id:18,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",categories:["long"]},{id:19,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam",categories:["long"]},{id:20,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed",categories:["long"]}]}}})},Tp={base:kd(kd({category:fp,headingText:"Standard with loader",description:""},Id),{},{isLoading:!0}),fullConversation:kd(kd({category:hp,headingText:"Full demo conversation",description:""},Id),{},{participantInfo:Nd,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[Bd,Ud,Vd,kd(kd({},np),{},{payload:kd(kd({},np.payload),{},{id:`${np.payload.id}XXX`})}),Kd,Hd,rp,Jd,ip,Dd,Zd,sp,cp,op,tp,Xd,Qd,ep,lp,up,Yd,np,Gd]}),userMessages:kd(kd({category:hp,headingText:"User messages",description:""},Id),{},{participantInfo:Nd,events:[rp,op,lp,up,ip]}),withParticipants:kd(kd({category:hp,headingText:"Messages with participant info",description:""},Id),{},{config:kd(kd({},Id.config),{},{overrideMessages:{agent:{showAvatar:!0,showName:!0},user:{showName:!0,showAvatar:!0}}}),participantInfo:Nd,events:[Vd,rp,Kd,op]}),textMessages:kd(kd({category:hp,headingText:"Text messages",description:""},Id),{},{participantInfo:Nd,events:[Vd,Kd,Jd,Xd,Qd,Yd]}),ctaMessages:kd(kd({category:hp,headingText:"CTA (call to action) messages",description:""},Id),{},{participantInfo:Nd,events:[Gd]}),imageVideoMessages:kd(kd({category:hp,headingText:"Download, image and video messages",description:""},Id),{},{participantInfo:Nd,events:[Zd,tp,ep,sp]}),systemMessages:kd(kd({category:hp,headingText:"System messages",description:""},Id),{},{config:{overrideMessages:{timeIndicator:{enabled:!0,threshold:36e5}}},participantInfo:Nd,events:[{type:"message",payload:kd(kd({},Vd.payload),{},{occurredAt:1e3*(Date.now()-432e6),id:S(),body:{text:"Long ago when a dialog started",type:"text"}})},Bd,$d,Hd,Dd,Fd,...[Ld,Rd].map(Ed),Ud]}),choicePromptMessages:kd(kd({category:hp,headingText:"Choice prompt messages",description:""},Id),{},{participantInfo:Nd,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[kd(kd({},np),{},{payload:kd(kd({},np.payload),{},{id:`${np.payload.id}XXX`})}),Vd,np]}),timeIndicators:kd(kd({category:hp,headingText:"Time Indicators",description:""},Id),{},{config:{overrideMessages:{timeIndicator:{enabled:!0,threshold:36e5}}},participantInfo:Nd,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{type:"message",payload:kd(kd({},Vd.payload),{},{occurredAt:1e3*(Date.now()-432e6),id:S(),body:{text:"Long ago when a dialog started",type:"text"}})},{type:"message",payload:kd(kd({},Vd.payload),{},{occurredAt:1e3*(Date.now()-3456e5),id:S(),body:{text:"Above me should be a time indicator showing the full date",type:"text"}})},{type:"message",payload:kd(kd({},Vd.payload),{},{occurredAt:1e3*(Date.now()+1-3456e5),id:S(),body:{text:"Another message",type:"text"}})},{type:"message",payload:kd(kd({},Vd.payload),{},{occurredAt:1e3*(Date.now()+2-3456e5),id:S(),body:{text:"And another message",type:"text"}})},{type:"message",payload:kd(kd({},Vd.payload),{},{occurredAt:1e3*(Date.now()-864e5),id:S(),body:{text:'Above me should be a time indicator showing "yesterday"',type:"text"}})},{type:"message",payload:kd(kd({},Vd.payload),{},{occurredAt:1e3*(Date.now()+1-864e5),id:S(),body:{text:"Another message",type:"text"}})},{type:"message",payload:kd(kd({},Vd.payload),{},{occurredAt:1e3*(Date.now()+2-864e5),id:S(),body:{text:"And another message",type:"text"}})},{type:"message",payload:kd(kd({},Vd.payload),{},{occurredAt:1e3*Date.now(),id:S(),body:{text:"Above me should be a time indicator showing me the dialog continues today",type:"text"}})}]}),cards:kd(kd({category:hp,headingText:"Cards",description:""},Id),{},{serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[Cp,_p,Ep]}),carousel:kd(kd({category:hp,headingText:"Carousel",description:""},Id),{},{serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{type:"message",payload:{type:"carousel",id:S(),body:{cards:[Cp.payload.body,_p.payload.body,Ep.payload.body]}}}]}),errorWithAction:kd(kd({category:yp,headingText:"Error with a user action",description:""},Id),{},{interrupt:{error:new u}}),errorWithoutAction:kd(kd({category:yp,headingText:"Error without a user action",description:""},Id),{},{interrupt:{error:new Wo}}),privacyDisclaimer:kd(kd({category:gp,headingText:"Privacy disclaimer",description:""},Id),{},{config:kd(kd({},Id.config),{},{showDisclaimer:!0})}),chatStatusBar:kd(kd({category:gp,headingText:"Chat status bar",description:""},Id),{},{translations:kd(kd({},dp),{},{currentLocale:"nl",isActive:!0,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]})}),characterLimit:kd(kd({category:gp,headingText:"Input character limit",description:""},Id),{},{entryMeta:{default:"text",active:"text",userSelected:null,options:{text:{limit:120}},optionsOverride:{}}}),fileUploadToggle:kd(kd({category:mp,headingText:"File upload toggle button",description:""},Id),{},{options:kd(kd({},Id.options),{},{features:{uploads:{enabled:!0}}})}),fileUploadToggleHidden:kd(kd({category:mp,headingText:"File upload toggle button hidden",description:""},Id),{},{options:kd(kd({},Id.options),{},{features:{uploads:{enabled:!1}}})}),fileUploadInput:kd(kd({category:mp,headingText:"File upload input",description:"Click on upload button to see an error",styleGuideReset:!0},Id),{},{config:kd(kd({},Id.config),{},{accountConfig:{features:{uploads:!0}}}),options:kd(kd({},Id.options),{},{features:{uploads:{enabled:!0}}}),entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}}}),fileUploadBusy:kd(kd({category:mp,headingText:"File upload in progress",description:"",styleGuideReset:!0},Id),{},{config:kd(kd({},Id.config),{},{accountConfig:{features:{uploads:!0}}}),options:kd(kd({},Id.options),{},{features:{uploads:{enabled:!0}}}),entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}},currentUploads:[{id:"_2olggurqhb4",name:"gGeyr3WepujbGn7khx.gif",progress:29,uploading:!0,complete:!1,error:"",uploadHandle:{abort:()=>{}}}]}),fileUploadError:kd(kd({category:mp,headingText:"File upload errored",description:"",styleGuideReset:!0},Id),{},{config:kd(kd({},Id.config),{},{accountConfig:{features:{uploads:!0}}}),options:kd(kd({},Id.options),{},{features:{uploads:{enabled:!0}}}),entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}},currentUploads:[{id:"_2olggurqhb4",name:"gGeyr3WepujbGn7khx.gif",progress:0,uploading:!1,complete:!1,error:"Something went wrong with the upload",uploadHandle:{abort:()=>{}}}]}),idleTimerCountdown:kd(kd({category:gp,headingText:"Idle timer with countdown",description:""},Id),{},{idleDetachCountdown:{hasCountdown:!0,isActive:!0,count:120,remaining:91,timer:{minutes:1,seconds:31}}}),idleTimerNoCountdown:kd(kd({category:gp,headingText:"Idle timer without countdown",description:""},Id),{},{idleDetachCountdown:{hasCountdown:!0,isActive:!1,count:120,remaining:91,timer:{minutes:1,seconds:31}}}),resumeConversationPrompt:kd(kd({category:gp,headingText:"Resume conversation prompt",description:""},Id),{},{participantInfo:Nd,resumeConversationPrompt:!0}),optionsSingleTriggerAvailable:kd(kd({category:vp,headingText:"Single option available",description:""},Id),{},{options:kd(kd({},Id.options),{},{features:{sendTranscript:{enabled:!0}}})}),optionsSingleTriggerUnavailable:kd(kd({category:vp,headingText:"Single option",description:"Option unavailable"},Id),{},{options:kd(kd({},Id.options),{},{features:{sendTranscript:{enabled:!1}}})}),optionsMultiple:kd(kd({category:vp,headingText:"Multiple options",description:"All options available"},Id),{},{options:kd(kd({},Id.options),{},{features:{cobrowsing:{enabled:!0},sendTranscript:{enabled:!0}}})}),optionsMultipleUnavailable:kd(kd({category:vp,headingText:"Multiple options",description:"Some unavailable"},Id),{},{options:kd(kd({},Id.options),{},{features:{cobrowsing:{enabled:!1},sendTranscript:{enabled:!0}}})}),optionSendTranscript:kd(kd({category:vp,headingText:"Send transcript option",description:"Press submit to view error message"},Id),{},{options:kd(kd({},Id.options),{},{optionActive:"sendTranscript",panelActive:!0,features:{sendTranscript:{enabled:!0}}})}),translationsAvailable:kd(kd({category:xp,headingText:"Show translations available",description:""},Id),{},{translations:kd(kd({},dp),{},{isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]})}),translationsAvailableWithOptions:kd(kd({category:xp,headingText:"Show translations available with other options available",description:""},Id),{},{options:kd(kd({},Id.options),{},{features:{sendTranscript:{enabled:!0}}}),translations:kd(kd({},dp),{},{isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"},{locale:"ar",nativeName:"Arabic"},{locale:"bg",nativeName:"Bulgarian"},{locale:"zh",nativeName:"Chinese"},{locale:"cs",nativeName:"Czech"},{locale:"da",nativeName:"Danish"},{locale:"et",nativeName:"Estonian"},{locale:"fi",nativeName:"Finnish"},{locale:"fr",nativeName:"French"},{locale:"de-informal",nativeName:"German"},{locale:"el",nativeName:"Greek"},{locale:"hu",nativeName:"Hungarian"},{locale:"it",nativeName:"Italian"},{locale:"ja",nativeName:"Japanese"},{locale:"lv",nativeName:"Latvian"},{locale:"pl",nativeName:"Polish"},{locale:"ro",nativeName:"Romanian"},{locale:"ru",nativeName:"Russian"},{locale:"sk",nativeName:"Slovak"},{locale:"sl",nativeName:"Slovenian"},{locale:"es-informal",nativeName:"Spanish"},{locale:"sv",nativeName:"Swedish"},{locale:"ti",nativeName:"Tigrinya"},{locale:"tr",nativeName:"Turkish"},{locale:"uk",nativeName:"Ukrainian"}]})}),translationsActive:kd(kd({category:xp,headingText:"Show translations active",description:""},Id),{},{translations:kd(kd({},dp),{},{currentLocale:"nl",isActive:!0,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]})}),translationsFullConversation:kd(kd({category:xp,headingText:"Show translated messages",description:""},Id),{},{participantInfo:Nd,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[Ld,Ud,Vd,kd(kd({},np),{},{payload:kd(kd({},np.payload),{},{id:`${np.payload.id}XXX`})}),Kd,rp,Jd,Dd,Md,Rd,Zd,sp,cp,op,tp,Xd,Qd,ep,lp,up,Yd,np,Gd,Rd].map(Ed),translations:kd(kd({},dp),{},{currentLocale:"nl",isActive:!0,isAvailable:!0,translatedEventGroups:{[Ld.payload.id]:[Ud,Vd,kd(kd({},np),{},{payload:kd(kd({},np.payload),{},{id:`${np.payload.id}XXX`})}),Kd,rp,Jd,Dd].map((e=>e.payload.id)),[Md.payload.id]:[Zd,sp,cp,op,tp,Xd,Qd,ep,lp,up,Yd,np,Gd].map((e=>e.payload.id))},languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]})}),translationProposal:kd(kd({category:xp,headingText:"Show translation proposal",description:""},Id),{},{events:[Vd,rp,op],config:kd(kd({},Id.config),{},{showDisclaimer:!0,context:{locale:"nl-informal"}}),translations:kd(kd({},dp),{},{translationProposal:{buttonLabel:"Activate",proposedLocale:"en-GB",srDismissButtonText:"Dismiss translation proposal",titleLabel:"Do you want to chat in English?"},isAvailable:!0,isActive:!1,languages:[{locale:"nl-informal",nativeName:"Dutch"},{locale:"en-GB",nativeName:"English"}]})}),translationProposalWithoutTitle:kd(kd({category:xp,headingText:"Show translation proposal without title",description:""},Id),{},{events:[Vd,rp,op],config:kd(kd({},Id.config),{},{showDisclaimer:!0,context:{locale:"nl-informal"}}),translations:kd(kd({},dp),{},{translationProposal:{buttonLabel:"Activate",proposedLocale:"en-GB",srDismissButtonText:"Dismiss translation proposal"},isAvailable:!0,isActive:!1,languages:[{locale:"nl-informal",nativeName:"Dutch"},{locale:"en-GB",nativeName:"English"}]})})},kp={minimizedInline:{category:jp,headingText:"Inline minimized",description:"",inline:kd(kd({},Id),{},{config:kd(kd({},Id.config),{},{layoutMode:"inline"}),visibility:kd(kd({},Id.visibility),{},{visibility:hr.minimized})})},minimizedInlineCharacterLimit:{category:jp,headingText:"Inline minimized with limited characters",description:"",inline:kd(kd({},Id),{},{config:kd(kd({},Id.config),{},{layoutMode:"inline"}),visibility:kd(kd({},Id.visibility),{},{visibility:hr.minimized}),entryMeta:kd(kd({},Id.entryMeta),{},{options:{text:{limit:120}}})})},minimizedInlinePrechat:{category:jp,headingText:"Inline minimized with pre-chat messages",description:"",inline:kd(kd({},Id),{},{config:kd(kd({},Id.config),{},{layoutMode:"inline",preChatEvents:[Wd]}),visibility:kd(kd({},Id.visibility),{},{visibility:hr.minimized})})},minimizedInlinePrechatSuggestions:{category:jp,headingText:"Inline minimized with pre-chat messages & suggestions",description:"",inline:kd(kd({},Id),{},{config:kd(kd({},Id.config),{},{layoutMode:"inline",preChatEvents:[Wd]}),serviceData:{suggestion:{body:pp}},visibility:kd(kd({},Id.visibility),{},{visibility:hr.minimized})})},inlineWithSuggestions:{category:wp,headingText:"Suggestions",description:"",inline:kd(kd({},Id),{},{config:kd(kd({},Id.config),{},{layoutMode:"inline",showFaq:!0}),visibility:kd(kd({},Id.visibility),{},{visibility:hr.open}),serviceData:{suggestion:{body:pp}}})},minimizedInlineWithError:{category:jp,headingText:"Inline minimized with error",description:"",inline:kd(kd({},Id),{},{config:kd(kd({},Id.config),{},{layoutMode:"inline"}),visibility:kd(kd({},Id.visibility),{},{visibility:hr.minimized}),interrupt:{error:new Wo}})}},Ap={minimizedWindow:{category:Op,headingText:"Unstarted minimized",description:"",window:kd(kd({},Id),{},{config:kd(kd({},Id.config),{},{layoutMode:"window"}),visibility:kd(kd({},Id.visibility),{},{visibility:hr.minimized})})},minimizedWindowStarted:{category:Op,headingText:"Started minimized",description:"",window:kd(kd({},Id),{},{config:kd(kd({},Id.config),{},{layoutMode:"window"}),visibility:kd(kd({},Id.visibility),{},{visibility:hr.minimized}),participantInfo:Nd,headerTitles:zd})},minimizedWindowStartedUnread:{category:Op,headingText:"Minimized with unread messages",description:"",window:kd(kd({},Id),{},{config:kd(kd({},Id.config),{},{layoutMode:"window"}),visibility:kd(kd({},Id.visibility),{},{visibility:hr.minimized}),participantInfo:Nd,headerTitles:zd,unreadEvents:12})}},Ip={suggestionsMessage:kd(kd({category:hp,headingText:"Suggestions message",description:""},Id),{},{events:[qd(Vd.payload.body),{type:"service_data",payload:{type:"suggestion",body:pp}}]})},Np=(e,t=[],n)=>{const r=kd(kd(kd({},n?kd(kd({},Tp),{},{fullConversation:kd(kd({},Tp.fullConversation),{},{events:[Wd,...Tp.fullConversation.events]})}):Tp),n?Ip:Pp),t.reduce(((e,t)=>{const{key:n,headingText:r,description:o,body:i}=t;return kd(kd({},e),{},{[n]:kd(kd({category:hp,headingText:r,description:o},Id),{},{participantInfo:Nd,events:[qd(i)]})})}),{}));return Object.keys(r).reduce(((t,n)=>{const o=r[n],{headingText:i,category:a,description:s}=o,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}(o,Pd);return kd(kd({},t),{},{[n]:kd({headingText:i,description:s,category:a},e.reduce(((e,t)=>kd(kd({},e),{},{[t]:kd(kd({},c),{},{config:kd(kd({},c.config),{},{layoutMode:t})})})),{}))})}),{})},Dp=(e,t)=>kd(kd({},Np(e,t)),-1!==e.indexOf("window")?Ap:{}),Lp=(e,t)=>kd(kd(kd({},Np(e,t,!0)),-1!==e.indexOf("window")?kd(kd({},Ap),{},{minimizedWindowPrechat:{category:Op,headingText:"Minimized with pre-chat messages",description:"",window:kd(kd({},Id),{},{config:kd(kd({},Id.config),{},{layoutMode:"window",preChatEvents:[Wd]}),visibility:kd(kd({},Id.visibility),{},{visibility:hr.minimized}),participantInfo:Nd,headerTitles:zd})}}):{}),kp),Mp=["headingText","descriptionId","description"];function Rp(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 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 Fp=({setSelectedState:t,states:n,headingLevel:r})=>{const o=`h${r.toString()}`,i=`h${(parseInt(r,10)+1).toString()}`,a=Od();return(0,e.jsx)("nav",{"aria-label":"Style guide navigation",className:"nav--styleguide",children:(0,e.jsx)("ol",{className:"list--styleguidestates",children:Object.keys(Sp).map((r=>{const{heading:s,description:c}=Sp[r],l=Object.keys(n).filter((e=>{const{category:t}=n[e];return t===r}));return l.length>0&&(0,e.jsxs)("li",{children:[(0,e.jsx)(o,{children:s}),(0,e.jsx)("span",{className:"category__description",children:c}),(0,e.jsx)("ol",{children:l.map((r=>{const o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rp(Object(n),!0).forEach((function(t){Up(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n[r]);delete o.category;const{headingText:s,descriptionId:c,description:l}=o,u=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}(o,Mp);return(0,e.jsxs)("li",{children:[(0,e.jsx)(i,{id:c,children:s}),l&&(0,e.jsx)("span",{className:"feature__description",children:l}),(0,e.jsx)("ul",{className:"list--styleguidelayouts",children:Object.keys(u).map((n=>(0,e.jsx)("li",{className:n===a?.layoutMode&&r===a?.feature?"state__selected":null,children:(0,e.jsx)("a",{"aria-describedby":c,href:`${window.location.pathname}?${jd({layoutMode:n,feature:r})}`,"aria-current":n===a?.layoutMode&&r===a?.feature?"page":null,onClick:e=>{var o;e.preventDefault(),"inline"===n&&window.scroll({top:document.querySelector(".cvco-app").offsetTop,behavior:"smooth"}),o={layoutMode:n,feature:r},window.history.pushState(null,null,`${window.location.pathname}?${jd(o)}`),t(o)},children:n.charAt(0).toUpperCase()+n.slice(1)})},n)))})]},r)}))})]},r)}))})})},zp=["translations","interrupt","config","visibility"];const Bp={send:()=>{},reset:()=>Promise.resolve({}),store:{get:()=>{},set:()=>{}},hasConversation:()=>!1,connected:!1,ready:!1},Hp=({state:t,translations:n,participants:r=[],children:o})=>{const i=(0,Se.useRef)((()=>{})),a=(0,Se.useRef)({emit:()=>{}}),s=(0,Se.useMemo)((()=>{const e=t||{},{translations:o,interrupt:i,config:s={},visibility:c}=e,l=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,zp),u=Bn({reducer:{state:Ro,app:Br,config:Vo,i18n:ui,translations:ki,visibility:Di,forms:ai,interrupt:Wr},preloadedState:{state:l,config:s,translations:o,interrupt:i,visibility:c},middleware:e=>e({thunk:{extraArgument:{api:Bp,eventBus:a.current}},serializableCheck:!1})}),{config:d}=u.getState();return u.dispatch(Ho(d)),d.preChatEvents&&u.dispatch(qo(d.preChatEvents)),u.dispatch(ci("en-GB")),u.dispatch(li(n)),r.forEach((e=>{u.dispatch(Co({participant:e,fromClient:"user"===e.id}))})),u}),[r,t,n]);return t&&(0,e.jsx)(Fe,{store:s,children:(0,e.jsx)(We.Provider,{value:a.current,children:(0,e.jsx)(ua.Provider,{value:i.current,children:(0,e.jsx)(Ve.Provider,{value:Bp,children:(0,e.jsx)(pa,{children:(0,e.jsx)(el,{children:o})})})})})})},$p=({state:t,customComponents:n={},translations:r,participants:o})=>{const[i,a]=(0,Se.useState)(!0),{config:s}=t||{},{layoutMode:c}=s||{},l=n[c];return(0,Se.useEffect)((()=>{a(!1),requestAnimationFrame((async()=>{await ma(60),a(!0)}))}),[t]),i?l?(0,e.jsx)(Hp,{state:t,translations:r,participants:o,children:(0,e.jsx)(l,{})}):(0,e.jsx)(Hp,{state:t,translations:r,participants:o,children:(0,e.jsx)(cd,{})}):null};function qp(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 Vp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qp(Object(n),!0).forEach((function(t){Wp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Gp=({config:t,styleGuideConfig:n,translations:r,headingLevel:o=2,participants:i})=>{const[a,s]=(0,Se.useState)(null),[c,l]=(0,Se.useState)(""),[u,d]=(0,Se.useState)(!0),[p]=(0,Se.useState)(S()),{stateUpdateCallback:f,customMessageEventBodies:h}=n,y=t.isDeprecated?Dp:Lp,[m]=(0,Se.useState)((()=>{const e=y(n.showLayoutModes||["inline","window"],h);return Object.keys(e).reduce(((t,n)=>Vp(Vp({},t),{},{[n]:Vp(Vp({},e[n]),{},{descriptionId:S()})})),{})})),b=(0,Se.useCallback)((e=>{s(f?f(e):e)}),[s,f]),g=(0,Se.useCallback)(((e,n)=>{const r=((...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}),{})})("apiKey","locale"),o=new URLSearchParams(Vp(Vp({},r),{},{layoutMode:e,feature:n}));window.history.replaceState(null,null,`?${o}`);const{headingText:a}=m[n];l(a);const s=m[n][e],{overrideMessages:c,showFaq:u,showSuggestions:d}=s.config,p=i.find((e=>"agent"===e.id));return Vp(Vp({},s),{},{config:Vp(Vp(Vp(Vp({},s.config),t),{},{showDisclaimer:s.config.showDisclaimer||t.showDisclaimer,context:Vp(Vp({},t.context),s.config?.context),layoutMode:s.config.layoutMode},c?{messages:c}:{}),{},{showFaq:u,showSuggestions:d}),headerTitles:Vp(Vp({},s.headerTitles),{},{subTitle:p?.name||s.headerTitles.subTitle})})}),[m,i,t]);(0,Se.useEffect)((()=>{if(u){const e=document.querySelector('[aria-modal="true"]');e&&e.addEventListener("click",(()=>{s((e=>Vp(Vp({},e),{},{visibility:Vp(Vp({},e.visibility),{},{visible:"minimized"})})))}))}}),[a,s,u]);const v=(0,Se.useCallback)((()=>{const e=Od(),{layoutMode:t="inline",feature:n="base"}=e;b(g(t,n)),window.title="Style"}),[g,b]);(0,Se.useEffect)((()=>{v()}),[v]),(0,Se.useEffect)((()=>{window.onpopstate=()=>{v()}}),[v]);const w=`h${o.toString()}`;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("section",{className:"chat-inline","aria-labelledby":p,children:[(0,e.jsxs)(w,{id:p,children:[(0,e.jsx)("span",{className:"heading__context",children:"Current selected state:"}),`${c}`]}),(0,e.jsx)("div",{children:u&&(0,e.jsx)($p,{customComponents:n.customComponents,translations:r,state:a,participants:i})})]}),(0,e.jsx)("aside",{className:"page-aside markdown",children:(0,e.jsx)("nav",{className:"page-controls",children:(0,e.jsx)(Fp,{headingLevel:o,setSelectedState:({layoutMode:e,feature:t})=>{const n=g(e,t);b(n),n.styleGuideReset&&(d(!1),setTimeout((()=>{d(!0)})))},states:m})})})]})},Kp=["styleGuideConfig"];function Jp(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 Xp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jp(Object(n),!0).forEach((function(t){Qp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yp=class extends hd{constructor(e,t){let{styleGuideConfig:n}=e;super(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,Kp),t),this.styleGuideConfig=n||{}}async render(){const t=Xp(Xp({},this.config.customComponents||{}),{},{view:void 0}),n=new we({namespace:this.config.namespace,config:this.config.api,context:this.config.context});n.URLS={translations:`/client/${this.config.api.key}/translations/{version}/{locale}.json`};const r=await n.getTranslations(this.config.context.locale||"en-GB"),{agentParticipant:o,userParticipant:i}=await n.getConfig(),a=[Xp({id:"user"},i),Xp({id:"agent",introduction:"I am {{name}}"},o)],s=Xp(Xp({},this.config),{},{customComponents:Object.keys(t).length?t:void 0});(0,xe.render)((0,e.jsx)(Gp,{config:s,styleGuideConfig:this.styleGuideConfig,translations:r,participants:a}),this.parentElement)}},Zp=["userStyleGuideConfig"];function ef(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 tf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ef(Object(n),!0).forEach((function(t){nf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ef(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rf=class extends wd{constructor(e,t){super(e),this.styleGuideConfig=t}createInstance(e){const{userStyleGuideConfig: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,Zp);return new Yp(tf({styleGuideConfig:tf(tf({},this.styleGuideConfig),t)},n),this)}getUserConfig(e={},t){return super.getUserConfig(tf(tf({},e),{},{userStyleGuideConfig:t}))}},of=function(e,t){if(window.seamlyStyleGuide&&!Array.isArray(window.seamlyStyleGuide))throw new Error("Seamly UI has already been initialised. Use the window.seamly object to start new instances instead.");const n=Array.isArray(window.seamlyStyleGuide)?window.seamlyStyleGuide:[],r=new rf(e,t);window.seamly=r,window.seamlyStyleGuide={push:r.push.bind(r)},r.push(...n)}})(),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,d=l.mixin,p=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 g(e){if(!u(e))return e;const t=[];for(const n in e)p(e,n)&&v(t,n,e[n]);return t.join("&")}function v(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;)v(e,t,o.value)}catch(e){i.e(e)}finally{i.f()}}else if(u(n))for(const r in n)p(n,r)&&v(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,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 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)}))}m.serializeObject=g,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},d(j.prototype,f.prototype),j.prototype._parseBody=function(e){let t=m.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&O(this.type)&&(t=m.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},m.Response=j,i(x.prototype),d(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=g(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&&O(e)&&(t=m.serialize["application/json"]),t&&(n=t(n))}for(const e in this.header)null!==this.header[e]&&p(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,C=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];S<C.length;S++){const e=C[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,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=_,m.delete=_,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(210),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(210),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 d=function(){return s(r,i,arguments)};l?l(e.exports,"apply",{value:d}):e.exports.apply=d},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,p(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 d;if(l+=1,"object"==typeof e&&null!==e){for(d=0;d<i.length;d++)if(i[d]===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(d=0;d<e.length;d++)c(e[d],d,d,i,e,l,u);else{var p=Object.keys(e);for(d=0;d<p.length;d++){var f=p[d];c(e[f],f,d,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=d(e,"",0,[],void 0,0,a)||e;try{s=0===o.length?JSON.stringify(c,t,n):JSON.stringify(c,p(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 d(e,o,i,a,c,u,p){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!==p.depthLimit&&u>p.depthLimit)return void s(t,e,o,c);if(void 0!==p.edgesLimit&&i+1>p.edgesLimit)return void s(t,e,o,c);if(a.push(e),Array.isArray(e))for(f=0;f<e.length;f++)d(e[f],f,f,a,e,u,p);else{var h={},y=Object.keys(e).sort(l);for(f=0;f<y.length;f++){var m=y[f];d(e[m],m,f,a,e,u,p),h[m]=e[m]}if(void 0===c)return h;r.push([c,o,e]),c[o]=h}a.pop()}}function p(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=[],d=0;d<l;d++)u.push("$"+d);if(a=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(c),i.prototype){var p=function(){};p.prototype=i.prototype,a.prototype=new p,p.prototype=null}return a}},612:(e,t,n)=>{"use strict";var r=n(648);e.exports=Function.prototype.bind||r},210:(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,d=n(405)(),p=Object.getPrototypeOf||function(e){return e.__proto__},f={},h="undefined"==typeof Uint8Array?r:p(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":d?p([][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%":d?p(p([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&d?p((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&&d?p((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":d?p(""[Symbol.iterator]()):r,"%Symbol%":d?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=p(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"]},g=n(612),v=n(642),w=g.call(Function.call,Array.prototype.concat),O=g.call(Function.apply,Array.prototype.splice),j=g.call(Function.call,String.prototype.replace),x=g.call(Function.call,String.prototype.slice),S=g.call(Function.call,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_=/\\(\\)?/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,C,(function(e,t,n,o){r[r.length]=n?j(o,_,"$1"):t||e})),r},P=function(e,t){var n,r=e;if(v(b,r)&&(r="%"+(n=b[r])[0]+"%"),v(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=E(e),r=n.length>0?n[0]:"",i=P("%"+r+"%",t),s=i.name,l=i.value,u=!1,d=i.alias;d&&(r=d[0],O(n,w([0,1],d)));for(var p=1,f=!0;p<n.length;p+=1){var h=n[p],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),v(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&&p+1>=n.length){var g=c(l,h);l=(f=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:l[h]}else f=v(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)},545:(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,d=Object.getOwnPropertySymbols,p=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);d&&(a=a.concat(d(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 g=p(n,b);try{l(t,b,g)}catch(e){}}}}return t}},679: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,d="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="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,g=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,O=String.prototype.toLowerCase,j=RegExp.prototype.test,x=Array.prototype.concat,S=Array.prototype.join,C=Array.prototype.slice,_=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 D(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?-_(-e):_(e);if(r!==e){var o=String(r),i=g.call(t,o.length+1);return v.call(o,n,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(t,n,"$&_")}var L=n(654),M=L.custom,R=H(M)?M:null;function U(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function F(e){return v.call(String(e),/"/g,""")}function z(e){return!("[object Array]"!==V(e)||A&&"object"==typeof e&&A in e)}function B(e){return!("[object RegExp]"!==V(e)||A&&"object"==typeof e&&A in e)}function H(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(q(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(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=!q(s,"customInspect")||s.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(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(q(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?D(t,w):w}if("bigint"==typeof t){var j=String(t)+"n";return y?D(t,j):j}var _=void 0===s.depth?5:s.depth;if(void 0===r&&(r=0),r>=_&&_>0&&"object"==typeof t)return z(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 $(t,n,i){if(n&&(o=C.call(o)).push(n),i){var a={depth:s.depth};return q(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),e(t,a,r+1,o)}return e(t,s,r+1,o)}if("function"==typeof t&&!B(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,$);return"[Function"+(K?": "+K:" (anonymous)")+"]"+(ee.length>0?" { "+S.call(ee,", ")+" }":"")}if(H(t)){var te=k?v.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",s);return ne+=">",t.childNodes&&t.childNodes.length&&(ne+="..."),ne+"</"+O.call(String(t.nodeName))+">"}if(z(t)){if(0===t.length)return"[]";var ie=Z(t,$);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]"!==V(e)||A&&"object"==typeof e&&A in e)}(t)){var ae=Z(t,$);return"cause"in Error.prototype||!("cause"in t)||I.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+S.call(ae,", ")+" }":"{ ["+String(t)+"] "+S.call(x.call("[cause]: "+$(t.cause),ae),", ")+" }"}if("object"==typeof t&&c){if(R&&"function"==typeof t[R]&&L)return L(t,{depth:_-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($(n,t,!0)+" => "+$(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($(e,t))})),Q("Set",l.call(t),ce,M)}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 WeakMap}catch(e){}return!1}(t))return X("WeakMap");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 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]"!==V(e)||A&&"object"==typeof e&&A in e)}(t))return J($(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($(E.call(t)));if(function(e){return!("[object Boolean]"!==V(e)||A&&"object"==typeof e&&A in e)}(t))return J(h.call(t));if(function(e){return!("[object String]"!==V(e)||A&&"object"==typeof e&&A in e)}(t))return J($(String(t)));if(!function(e){return!("[object Date]"!==V(e)||A&&"object"==typeof e&&A in e)}(t)&&!B(t)){var le=Z(t,$),ue=N?N(t)===Object.prototype:t instanceof Object||t.constructor===Object,de=t instanceof Object?"":"null prototype",pe=!ue&&A&&Object(t)===t&&A in t?g.call(V(t),8,-1):de?"Object":"",fe=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(pe||de?"["+S.call(x.call([],pe||[],de||[]),": ")+"] ":"");return 0===le.length?fe+"{}":M?fe+"{"+Y(le,M)+"}":fe+"{ "+S.call(le,", ")+" }"}return String(t)};var $=Object.prototype.hasOwnProperty||function(e){return e in this};function q(e,t){return $.call(e,t)}function V(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(g.call(e,0,t.maxStringLength),t)+r}return U(v.call(v.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=z(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=q(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)q(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<a.length;l++)I.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:()=>H,cloneElement:()=>W,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>q,createPortal:()=>E,createRef:()=>r.createRef,default:()=>re,findDOMNode:()=>K,flushSync:()=>X,forwardRef:()=>f,hydrate:()=>N,isValidElement:()=>V,lazy:()=>j,memo:()=>u,render:()=>I,startTransition:()=>Y,unmountComponentAtNode:()=>G,unstable_batchedUpdates:()=>J,useDeferredValue:()=>Z,useInsertionEffect:()=>te,useSyncExternalStore:()=>ne,useTransition:()=>ee,version:()=>$});var r=n(710),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 d=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),d&&d(e)};var p="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=p,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 g(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 g(e,t,n)}))),e}function v(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return v(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),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=O(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]=v(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]=g(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 C(e){return this.getChildContext=function(){return e.context},e.children}function _(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)(C,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function E(e,t){var n=(0,r.createElement)(_,{__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),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 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 D=r.options.event;function L(){}function M(){return this.cancelBubble}function R(){return this.defaultPrevented}r.options.event=function(e){return D&&(e=D(e)),e.persist=L,e.isPropagationStopped=M,e.isDefaultPrevented=R,e.nativeEvent=e};var U,F={configurable:!0,get:function(){return this.class}},z=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,z&&z(e)};var B=r.options.__r;r.options.__r=function(e){B&&B(e),U=e.__c};var H={ReactCurrentDispatcher:{current:{readContext:function(e){return U.__n[e.__c].props.value}}}},$="17.0.2";function q(e){return r.createElement.bind(null,e)}function V(e){return!!e&&e.$$typeof===P}function W(e){return V(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:I,hydrate:N,unmountComponentAtNode:G,createPortal:E,createElement:r.createElement,createContext:r.createContext,createFactory:q,cloneElement:W,createRef:r.createRef,Fragment:r.Fragment,isValidElement:V,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:H}},798: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(798);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 d=0;n.depth>0&&null!==(s=a.exec(i))&&d<n.depth;){if(d+=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,d=t.parameterLimit===1/0?void 0:t.parameterLimit,p=u.split(t.delimiter,d),f=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n<p.length;++n)0===p[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===p[n]?h="utf-8":"utf8=%26%2310003%3B"===p[n]&&(h="iso-8859-1"),f=n,n=p.length);for(n=0;n<p.length;++n)if(n!==f){var y,m,b=p[n],g=b.indexOf("]="),v=-1===g?b.indexOf("="):g+1;-1===v?(y=t.decoder(b,a.decoder,h,"key"),m=t.strictNullHandling?null:""):(y=t.decoder(b.slice(0,v),a.decoder,h,"key"),m=r.maybeMap(c(b.slice(v+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,d=n.plainObjects?Object.create(null):{},p=Object.keys(u),f=0;f<p.length;++f){var h=p[f],y=l(h,u[h],n,"string"==typeof e);d=r.merge(d,y,n)}return!0===n.allowSparse?d:r.compact(d)}},261:(e,t,n)=>{"use strict";var r=n(478),o=n(769),i=n(798),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,d=function(e,t){u.apply(e,c(t)?t:[t])},p=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 p.call(e)},skipNulls:!1,strictNullHandling:!1},y={},m=function e(t,n,i,a,s,u,p,f,m,b,g,v,w,O,j,x){for(var S,C=t,_=x,E=0,P=!1;void 0!==(_=_.get(y))&&!P;){var T=_.get(t);if(E+=1,void 0!==T){if(T===E)throw new RangeError("Cyclic object value");P=!0}void 0===_.get(y)&&(E=0)}if("function"==typeof f?C=f(n,C):C instanceof Date?C=g(C):"comma"===i&&c(C)&&(C=o.maybeMap(C,(function(e){return e instanceof Date?g(e):e}))),null===C){if(s)return p&&!O?p(n,h.encoder,j,"key",v):n;C=""}if("string"==typeof(S=C)||"number"==typeof S||"boolean"==typeof S||"symbol"==typeof S||"bigint"==typeof S||o.isBuffer(C)){if(p){var k=O?n:p(n,h.encoder,j,"key",v);if("comma"===i&&O){for(var A=l.call(String(C),","),I="",N=0;N<A.length;++N)I+=(0===N?"":",")+w(p(A[N],h.encoder,j,"value",v));return[w(k)+(a&&c(C)&&1===A.length?"[]":"")+"="+I]}return[w(k)+"="+w(p(C,h.encoder,j,"value",v))]}return[w(n)+"="+w(String(C))]}var D,L=[];if(void 0===C)return L;if("comma"===i&&c(C))D=[{value:C.length>0?C.join(",")||null:void 0}];else if(c(f))D=f;else{var M=Object.keys(C);D=m?M.sort(m):M}for(var R=a&&c(C)&&1===C.length?n+"[]":n,U=0;U<D.length;++U){var F=D[U],z="object"==typeof F&&void 0!==F.value?F.value:C[F];if(!u||null!==z){var B=c(C)?"function"==typeof i?i(R,F):R:R+(b?"."+F:"["+F+"]");x.set(t,E);var H=r();H.set(y,x),d(L,e(z,B,i,a,s,u,p,f,m,b,g,v,w,O,j,H))}}return L};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,p=[];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(),g=0;g<n.length;++g){var v=n[g];l.skipNulls&&null===o[v]||d(p,m(o[v],v,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=p.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(798),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,d=n?Symbol.for("react.concurrent_mode"):60111,p=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,g=n?Symbol.for("react.fundamental"):60117,v=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 d:case i:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case l:case p:case m:case y:case c:return e;default:return t}}case o:return t}}}function j(e){return O(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=l,t.ContextProvider=c,t.Element=r,t.ForwardRef=p,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 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)===p},t.isFragment=function(e){return O(e)===i},t.isLazy=function(e){return O(e)===m},t.isMemo=function(e){return O(e)===y},t.isPortal=function(e){return O(e)===o},t.isProfiler=function(e){return O(e)===s},t.isStrictMode=function(e){return O(e)===a},t.isSuspense=function(e){return O(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||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===p||e.$$typeof===g||e.$$typeof===v||e.$$typeof===w||e.$$typeof===b)},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(210),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),d=o("WeakMap.prototype.has",!0),p=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 p(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 d(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 d=s(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=l((function(){function e(e){if(!c){if(c=!0,a=e,e=r(e),void 0!==o&&p.hasValue){var t=p.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,d[0],d[1]);return c((function(){p.hasValue=!0,p.value=f}),[f]),u(f),f}},688:(e,t,n)=>{"use strict";e.exports=n(250)},738:(e,t,n)=>{"use strict";e.exports=n(139)},710: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,{SeamlyStaticCore:()=>Hp,default:()=>of});const e=require("preact/jsx-runtime");var t=n(766),o=n.n(t);const i="cvco",a="2",s="seamly-client-participant";class c 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 l extends c{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class u extends c{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class d extends c{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class p extends c{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}const f=(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)}}},h=e=>Math.ceil(e/1e3),y=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},m=(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]}`},b={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},g={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},v=e=>e.code?g[e.code]:b[e.keyCode],w=e=>{e&&e.focus()},O=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};var j=n(905),x=n.n(j);function S(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}function C(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 _=e=>"function"==typeof e?e:function(){return e},E="undefined"!=typeof self?self:null,P="undefined"!=typeof window?window:null,T=E||P||T,k="closed",A="errored",I="joined",N="joining",D="leaving",L="phx_close",M="phx_error",R="phx_reply",U="phx_leave",F=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})}},z=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))}},B=class{static request(e,t,n,r,o,i,a){if(T.XDomainRequest){let n=new T.XDomainRequest;return this.xdomainRequest(n,e,t,r,o,i,a)}{let s=new T.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)}`}},H=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 B.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=B.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)}},$={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 d=n.decode(e.slice(s,s+a));s+=a;let p=e.slice(s,e.byteLength);return{join_ref:c,ref:l,topic:u,event:R,payload:{status:d,response:p}}},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 q(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 V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?q(Object(n),!0).forEach((function(t){W(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function W(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var G,K,J,X,Q=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 Y=x()("seamly");class Z{constructor(){G.add(this),K.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 V(V({},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||T.WebSocket||H,this.establishedConnections=0,this.defaultEncoder=$.encode.bind($),this.defaultDecoder=$.decode.bind($),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==H?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;P&&P.addEventListener&&(P.addEventListener("pagehide",(e=>{this.conn&&(this.disconnect(),n=this.connectClock)})),P.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=_(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 z((()=>{this.teardown((()=>this.connect()))}),this.reconnectAfterMs)}getLongPollTransport(){return H}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=B.appendParams(B.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=_(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(M)}))}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=k,this.topic=e,this.params=_(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new F(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new z((()=>{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=I,this.rejoinTimer.reset(),this.pushBuffer.forEach((e=>e.send())),this.pushBuffer=[]})),this.joinPush.receive("error",(()=>{this.state=A,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=k,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=A,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 F(this,U,_({}),this.timeout).send(),this.state=A,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.on(R,((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(L,e)}onError(e){return this.on(M,(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 F(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=D;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(L,"leave")},n=new F(this,U,_({}),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=N,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===k}isErrored(){return this.state===A}isJoined(){return this.state===I}isJoining(){return this.state===N}isLeaving(){return this.state===D}}(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:a})}),this.socket.connect(),this.channel=this.socket.channel(this.channelTopic,{authorization:`Bearer ${this.accessToken}`,channelName:this.channelName}),this.start(),this.socket.onError((e=>{Y("[SOCKET][ERROR]",e)})),this.socket.onOpen((()=>{Y("[SOCKET]OPEN")})),this.channel.on("system",(e=>{"attach_channel_succeeded"===e.type&&Q(this,G,"m",X).call(this,"attach_channel_succeeded")})),this.socket.onClose((()=>{Y("[SOCKET]CLOSE"),Q(this,G,"m",X).call(this,"socket_closed")})),this.channel.onClose((()=>{Y("[CHANNEL]CLOSE"),Q(this,G,"m",X).call(this,"channel_closed")})),this.channel.onError((e=>{Y("[CHANNEL][ERROR]",e),Q(this,G,"m",X).call(this,"channel_erred")})),Q(this,G,"m",J).call(this,"ack","ui","error","participant","message","service_data","system","info","sync")}))}start(){this.channel.join().receive("ok",(()=>{Y("[CHANNEL][JOIN] OK"),Q(this,G,"m",X).call(this,"join_channel_succeeded")})).receive("error",(e=>{Y("[CHANNEL][JOIN] ERROR",e),Q(this,G,"m",X).call(this,"join_channel_erred"),this.channel.socket.disconnect()})).receive("timeout",(()=>{Y("[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,K,[],"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){Q(this,K,"f").push(e)}pushToChannel(e,t,n=1e4){this.channel.push(e,t,n)}}K=new WeakMap,G=new WeakSet,J=function(...e){e.forEach((e=>{this.channel.on(e,(t=>{Y("[RECEIVE]",e,t)}))}))},X=function(e){Q(this,K,"f").forEach((t=>t(e)))};var ee,te,ne,re,oe,ie,ae,se,ce,le,ue,de,pe,fe,he,ye=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())}))},me=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},be=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 ge=x()("seamly");function ve(){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 we{constructor({layoutMode:e,namespace:t,config:n,context:r}){var o;ee.add(this),te.set(this,void 0),ne.set(this,void 0),re.set(this,void 0),oe.set(this,void 0),this.conversation=new Z,ue.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||C),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},me(this,oe,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"),me(this,te,!1,"f"),this.connected=!1,this.configReady=!1,me(this,ne,n.externalId,"f"),me(this,re,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 ye(this,void 0,void 0,(function*(){return yield this.disconnect(),this.clearStore(),this.getConfig()}))}disconnect(){var e;return ye(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 o().post(`${be(this,ee,"m",de).call(this,"http")}/client/${this.connectionInfo.apiKey}/configs`).set("Content-Type","application/json").query({v:a}).send({context:Object.assign(Object.assign({},be(this,oe,"f").context),{environment:!0===be(this,oe,"f").sendEnvironment?be(this,ee,"m",he).call(this):be(this,oe,"f").sendEnvironment})}).then((({body:e})=>(be(this,ee,"m",pe).call(this,e),this.configReady=!0,e.config))).catch((e=>{if(404===e.status)throw new l(e);if(e.status>=500)throw new u(e);throw e}))}getConversation(){return ye(this,void 0,void 0,(function*(){if(!this.hasConversation())return null;try{const{body:e}=yield o().get(`${be(this,ee,"m",de).call(this,"http")}${this.URLS.history}`).set("Authorization",`Bearer ${be(this,ee,"m",ie).call(this)}`).query({v:a});be(this,ee,"m",pe).call(this,e);const{messages:t,participants:n,activeServiceSessionId:r,activeServiceSettings:i,serviceData:s,ui:c,translation:l}=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:i,serviceData:s,resumeConversationPrompt:!!c&&Boolean(c.resumeConversationPrompt),translationProposal:c.translationProposal,translation:l}}catch(e){if(401===e.status)throw new p(e);if(404===e.status)throw new d(e);if(e.status>=500)throw new u(e);throw e}}))}connect(){return ye(this,void 0,void 0,(function*(){this.connected=!1;let e={};return this.hasConversation()||(e=yield be(this,ee,"m",fe).call(this)),this.conversation.connect(`${be(this,ee,"m",de).call(this,"ws")}${this.URLS.socket}`,be(this,oe,"f").context.channelName,be(this,ee,"m",ce).call(this),be(this,ee,"m",ie).call(this)),this.conversation.onConnection((e=>{this.connected=["attach_channel_succeeded","join_channel_succeeded"].includes(e),me(this,te,"attach_channel_succeeded"===e,"f")})),be(this,oe,"f").sendEnvironment&&this.send("context",{environment:!0===be(this,oe,"f").sendEnvironment?be(this,ee,"m",he).call(this):be(this,oe,"f").sendEnvironment},!1),e}))}uploadFile(e,t,n,r){const i=new FormData;i.append("upload",e);const a=o().post(`${be(this,ee,"m",de).call(this,"http")}${this.URLS.uploads}`).set("Authorization",`Bearer ${be(this,ee,"m",ie).call(this)}`).send(i);return a.on("progress",(function(e){const{direction:n,percent:r}=e;"upload"===n&&"function"==typeof t&&t(r)})),a.then((e=>{n&&n(e)})).catch((e=>{if(!r)throw e;r(e.response)})),a}getConversationIntitialState(){return o().get(`${be(this,ee,"m",de).call(this,"http")}${this.getConversationUrl()}`).set("Authorization",`Bearer ${be(this,ee,"m",ie).call(this)}`).query({v:a}).then((({body:e})=>{return be(this,ee,"m",pe).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 p(e);if(404===e.status)throw new d(e);if(e.status>=500)throw new u(e);throw e}))}getTranslations(e){return ye(this,void 0,void 0,(function*(){try{if(!this.URLS.translations)throw new l;const t=`${be(this,ee,"m",de).call(this,"http")}${this.URLS.translations}`.replace("{version}",String(2)).replace("{locale}",be(this,ue,"f").call(this,e)),n=o().get(t),{body:r}=yield n;return r.translations}catch(e){if(e.status>=500)throw new u(e);throw e}}))}send(e,t,n=!0){var r;!this.connected||n&&!be(this,te,"f")?null===(r=this.conversation)||void 0===r||r.onConnection((r=>{("join_channel_succeeded"===r||"attach_channel_succeeded"===r)&&this.send(e,t,n)})):(ge("[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=S()),{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)}}te=new WeakMap,ne=new WeakMap,re=new WeakMap,oe=new WeakMap,ue=new WeakMap,ee=new WeakSet,ie=function(){return this.store.get("accessToken")},ae=function(e){this.store.set("accessToken",e)},se=function(e){this.store.set("conversationUrl",e)},ce=function(){return this.store.get("channelTopic")||this.store.get("channelName")},le=function(e){this.store.set("channelTopic",e)},de=function(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`},pe=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)},fe=function(){var e;return ye(this,void 0,void 0,(function*(){try{const t=o().post(`${be(this,ee,"m",de).call(this,"http")}${this.URLS.conversations}`).set("Content-Type","application/json").query({v:a}).withCredentials().send({externalId:be(this,ne,"f")||void 0}),{body:n}=yield t,{conversation:r}=n,i=Object.assign({},r);return delete i.accessToken,delete i.channelTopic,be(this,ee,"m",ae).call(this,r.accessToken),be(this,ee,"m",le).call(this,r.channelTopic),be(this,ee,"m",pe).call(this,n),be(this,ee,"m",se).call(this,this.URLS.conversation),this.locale=null===(e=r.translation)||void 0===e?void 0:e.locale,this.userResponded=r.userResponded,i}catch(e){if(e.status>=500)throw new u(e);throw e}}))},he=function(){return{clientName:"@seamly/web-ui",clientVariant:be(this,re,"f"),clientVersion:"21.0.2-beta.4",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:ve(),userAgent:navigator.userAgent,preferredLocale:navigator.language}};var Oe=n(679),je=n.n(Oe),xe=n(710),Se=n(207),Ce=n(688),_e=n(738),Ee=n(661);let Pe=function(e){e()};const Te=()=>Pe,ke=(0,Ee.createContext)(null);function Ae(){return(0,Ee.useContext)(ke)}let Ie=()=>{throw new Error("uSES not initialized!")};const Ne=(e,t)=>e===t;function De(e=ke){const t=e===ke?Ae:()=>(0,Ee.useContext)(e);return function(e,n=Ne){const{store:r,subscription:o,getServerState:i}=t(),a=Ie(o.addNestedSub,r.getState,i||r.getState,e,n);return(0,Ee.useDebugValue)(a),a}}const Le=De();n(545),n(973);const Me={notify(){},get:()=>[]};const Re="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?Ee.useLayoutEffect:Ee.useEffect;let Ue=null;const Fe=function({store:e,context:t,children:n,serverState:r}){const o=(0,Ee.useMemo)((()=>{const t=function(e,t){let n,r=Me;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){const e=Te();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=Me)},getListeners:()=>r};return a}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0}}),[e,r]),i=(0,Ee.useMemo)((()=>e.getState()),[e]);Re((()=>{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||ke;return Ee.default.createElement(a.Provider,{value:o},n)};function ze(e=ke){const t=e===ke?Ae:()=>(0,Ee.useContext)(e);return function(){const{store:e}=t();return e}}const Be=ze();function He(e=ke){const t=e===ke?Be:ze(e);return function(){return t().dispatch}}const $e=He();var qe;(e=>{Ie=e})(_e.useSyncExternalStoreWithSelector),(e=>{Ue=e})(Ce.useSyncExternalStore),qe=Ee.unstable_batchedUpdates,Pe=qe;const Ve=(0,xe.createContext)(null),We=(0,xe.createContext)(null),Ge="message",Ke="text",Je="text",Xe="upload",Qe="received",Ye="read",Ze="custom",et="typing",tt="read",nt="detach_service",rt="dismiss",ot="set_topic",it="set_translation",at="click_cta",st="translation_proposal",ct="assertive",lt="polite",ut={new_topic:"newTopic",new_translation:"newTranslation"},dt="uploads",pt="navigate";function ft(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 ht(e){return!!e&&!!e[en]}function yt(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)===tn}(e)||Array.isArray(e)||!!e[Zt]||!!(null===(t=e.constructor)||void 0===t?void 0:t[Zt])||Ot(e)||jt(e))}function mt(e,t,n){void 0===n&&(n=!1),0===bt(e)?(n?Object.keys:nn)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function bt(e){var t=e[en];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Ot(e)?2:jt(e)?3:0}function gt(e,t){return 2===bt(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function vt(e,t,n){var r=bt(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function wt(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function Ot(e){return Jt&&e instanceof Map}function jt(e){return Xt&&e instanceof Set}function xt(e){return e.o||e.t}function St(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=rn(e);delete t[en];for(var n=nn(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 Ct(e,t){return void 0===t&&(t=!1),Et(e)||ht(e)||!yt(e)||(bt(e)>1&&(e.set=e.add=e.clear=e.delete=_t),Object.freeze(e),t&&mt(e,(function(e,t){return Ct(t,!0)}),!0)),e}function _t(){ft(2)}function Et(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Pt(e){var t=on[e];return t||ft(18,e),t}function Tt(){return Gt}function kt(e,t){t&&(Pt("Patches"),e.u=[],e.s=[],e.v=t)}function At(e){It(e),e.p.forEach(Dt),e.p=null}function It(e){e===Gt&&(Gt=e.l)}function Nt(e){return Gt={p:[],l:Gt,h:e,m:!0,_:0}}function Dt(e){var t=e[en];0===t.i||1===t.i?t.j():t.O=!0}function Lt(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||Pt("ES5").S(t,e,r),r?(n[en].P&&(At(t),ft(4)),yt(e)&&(e=Mt(t,e),t.l||Ut(t,e)),t.u&&Pt("Patches").M(n[en].t,e,t.u,t.s)):e=Mt(t,n,[]),At(t),t.u&&t.v(t.u,t.s),e!==Yt?e:void 0}function Mt(e,t,n){if(Et(t))return t;var r=t[en];if(!r)return mt(t,(function(o,i){return Rt(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return Ut(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=St(r.k):r.o;mt(3===r.i?new Set(o):o,(function(t,i){return Rt(e,r,o,t,i,n)})),Ut(e,o,!1),n&&e.u&&Pt("Patches").R(r,n,e.u,e.s)}return r.o}function Rt(e,t,n,r,o,i){if(ht(o)){var a=Mt(e,o,i&&t&&3!==t.i&&!gt(t.D,r)?i.concat(r):void 0);if(vt(n,r,a),!ht(a))return;e.m=!1}if(yt(o)&&!Et(o)){if(!e.h.F&&e._<1)return;Mt(e,o),t&&t.A.l||Ut(e,o)}}function Ut(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&Ct(t,n)}function Ft(e,t){var n=e[en];return(n?xt(n):e)[t]}function zt(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 Bt(e){e.P||(e.P=!0,e.l&&Bt(e.l))}function Ht(e){e.o||(e.o=St(e.t))}function $t(e,t,n){var r=Ot(t)?Pt("MapSet").N(t,n):jt(t)?Pt("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:Tt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=an;n&&(o=[r],i=sn);var a=Proxy.revocable(o,i),s=a.revoke,c=a.proxy;return r.k=c,r.j=s,c}(t,n):Pt("ES5").J(t,n);return(n?n.A:Tt()).p.push(r),r}function qt(e){return ht(e)||ft(22,e),function e(t){if(!yt(t))return t;var n,r=t[en],o=bt(t);if(r){if(!r.P&&(r.i<4||!Pt("ES5").K(r)))return r.t;r.I=!0,n=Vt(t,o),r.I=!1}else n=Vt(t,o);return mt(n,(function(t,o){r&&function(e,t){return 2===bt(e)?e.get(t):e[t]}(r.t,t)===o||vt(n,t,e(o))})),3===o?new Set(n):n}(e)}function Vt(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return St(e)}var Wt,Gt,Kt="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Jt="undefined"!=typeof Map,Xt="undefined"!=typeof Set,Qt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Yt=Kt?Symbol.for("immer-nothing"):((Wt={})["immer-nothing"]=!0,Wt),Zt=Kt?Symbol.for("immer-draftable"):"__$immer_draftable",en=Kt?Symbol.for("immer-state"):"__$immer_state",tn=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(e){var t={};return nn(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},on={},an={get:function(e,t){if(t===en)return e;var n=xt(e);if(!gt(n,t))return function(e,t,n){var r,o=zt(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||!yt(r)?r:r===Ft(e.t,t)?(Ht(e),e.o[t]=$t(e.A.h,r,e)):r},has:function(e,t){return t in xt(e)},ownKeys:function(e){return Reflect.ownKeys(xt(e))},set:function(e,t,n){var r=zt(xt(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=Ft(xt(e),t),i=null==o?void 0:o[en];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(wt(n,o)&&(void 0!==n||gt(e.t,t)))return!0;Ht(e),Bt(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!==Ft(e.t,t)||t in e.t?(e.D[t]=!1,Ht(e),Bt(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=xt(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(){ft(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){ft(12)}},sn={};mt(an,(function(e,t){sn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),sn.deleteProperty=function(e,t){return sn.set.call(this,e,t,void 0)},sn.set=function(e,t,n){return an.set.call(this,e[0],t,n,e[0])};var cn=function(){function e(e){var t=this;this.g=Qt,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&&ft(6),void 0!==r&&"function"!=typeof r&&ft(7),yt(e)){var s=Nt(t),c=$t(t,e,void 0),l=!0;try{a=n(c),l=!1}finally{l?At(s):It(s)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return kt(s,r),Lt(e,s)}),(function(e){throw At(s),e})):(kt(s,r),Lt(a,s))}if(!e||"object"!=typeof e){if(void 0===(a=n(e))&&(a=e),a===Yt&&(a=void 0),t.F&&Ct(a,!0),r){var u=[],d=[];Pt("Patches").M(e,a,u,d),r(u,d)}return a}ft(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){yt(e)||ft(8),ht(e)&&(e=qt(e));var t=Nt(this),n=$t(this,e,void 0);return n[en].C=!0,It(t),n},t.finishDraft=function(e,t){var n=(e&&e[en]).A;return kt(n,t),Lt(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!Qt&&ft(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=Pt("Patches").$;return ht(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),ln=new cn,un=ln.produce;ln.produceWithPatches.bind(ln),ln.setAutoFreeze.bind(ln),ln.setUseProxies.bind(ln),ln.applyPatches.bind(ln),ln.createDraft.bind(ln),ln.finishDraft.bind(ln);const dn=un;function pn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fn(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 hn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fn(Object(n),!0).forEach((function(t){pn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yn(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 mn="function"==typeof Symbol&&Symbol.observable||"@@observable",bn=function(){return Math.random().toString(36).substring(7).split("").join(".")},gn={INIT:"@@redux/INIT"+bn(),REPLACE:"@@redux/REPLACE"+bn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+bn()}};function vn(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 wn(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(yn(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(yn(1));return n(wn)(e,t)}if("function"!=typeof e)throw new Error(yn(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(yn(3));return i}function d(e){if("function"!=typeof e)throw new Error(yn(4));if(c)throw new Error(yn(5));var t=!0;return l(),s.push(e),function(){if(t){if(c)throw new Error(yn(6));t=!1,l();var n=s.indexOf(e);s.splice(n,1),a=null}}}function p(e){if(!vn(e))throw new Error(yn(7));if(void 0===e.type)throw new Error(yn(8));if(c)throw new Error(yn(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(yn(10));o=e,p({type:gn.REPLACE})}function h(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(yn(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[mn]=function(){return this},e}return p({type:gn.INIT}),(r={dispatch:p,subscribe:d,getState:u,replaceReducer:f})[mn]=h,r}function On(){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 jn(){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(yn(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=On.apply(void 0,i)(n.dispatch),hn(hn({},n),{},{dispatch:r})}}}function xn(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 Sn=xn();Sn.withExtraArgument=xn;const Cn=Sn;var _n,En=(_n=function(e,t){return _n=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])},_n(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}_n(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Pn=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},Tn=Object.defineProperty,kn=Object.defineProperties,An=Object.getOwnPropertyDescriptors,In=Object.getOwnPropertySymbols,Nn=Object.prototype.hasOwnProperty,Dn=Object.prototype.propertyIsEnumerable,Ln=function(e,t,n){return t in e?Tn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Mn=function(e,t){for(var n in t||(t={}))Nn.call(t,n)&&Ln(e,n,t[n]);if(In)for(var r=0,o=In(t);r<o.length;r++)n=o[r],Dn.call(t,n)&&Ln(e,n,t[n]);return e},Rn=function(e,t){return kn(e,An(t))},Un="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?On:On.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Fn=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 En(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,Pn([void 0],e[0].concat(this)))):new(t.bind.apply(t,Pn([void 0],e.concat(this))))},t}(Array);function zn(e){return yt(e)?dn(e,(function(){})):e}function Bn(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 Fn);return n&&(function(e){return"boolean"==typeof e}(n)?r.push(Cn):r.push(Cn.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,d=void 0===u?void 0:u,p=r.enhancers,f=void 0===p?void 0:p;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:gn.INIT}))throw new Error(yn(12));if(void 0===n(void 0,{type:gn.PROBE_UNKNOWN_ACTION()}))throw new Error(yn(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],d=l(u,t);if(void 0===d)throw t&&t.type,new Error(yn(14));o[c]=d,r=r||d!==u}return(r=r||a.length!==Object.keys(e).length)?o:e}}(i)}var h=s;"function"==typeof h&&(h=h(n));var y=jn.apply(void 0,h),m=On;l&&(m=Un(Mn({trace:!1},"object"==typeof l&&l)));var b=[y];return Array.isArray(f)?b=Pn([y],f):"function"==typeof f&&(b=f(b)),wn(t,d,m.apply(void 0,b))}function Hn(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 Mn(Mn({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 $n(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 qn(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:zn(e.initialState),o=e.reducers||{},i=Object.keys(o),a={},s={},c={};function l(){var t="function"==typeof e.extraReducers?$n(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=Mn(Mn({},o),s);return function(e,t,n,r){void 0===n&&(n=[]);var o,i=$n(t),a=i[0],s=i[1],c=i[2];if(function(e){return"function"==typeof e}(e))o=function(){return zn(e())};else{var l=zn(e);o=function(){return l}}function u(e,t){void 0===e&&(e=o());var n=Pn([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(ht(e))return void 0===(r=n(e,t))?e:r;if(yt(e))return dn(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?Hn(l,r):Hn(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 Vn=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},Wn=["name","message","stack","code"],Gn=function(e,t){this.payload=e,this.meta=t},Kn=function(e,t){this.payload=e,this.meta=t},Jn=function(e){if("object"==typeof e&&null!==e){for(var t={},n=0,r=Wn;n<r.length;n++){var o=r[n];"string"==typeof e[o]&&(t[o]=e[o])}return t}return{message:String(e)}},Xn=function(){function e(e,t,n){var r=Hn(e+"/fulfilled",(function(e,t,n,r){return{payload:e,meta:Rn(Mn({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),o=Hn(e+"/pending",(function(e,t,n){return{payload:void 0,meta:Rn(Mn({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),i=Hn(e+"/rejected",(function(e,t,r,o,i){return{payload:o,error:(n&&n.serializeError||Jn)(e||"Rejected"),meta:Rn(Mn({},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,d=(null==n?void 0:n.idGenerator)?n.idGenerator(e):Vn(),p=new a,f=new Promise((function(e,t){return p.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:u||"Aborted"})}))})),h=!1;function y(e){h&&(u=e,p.abort())}var m=function(){return a=this,u=null,m=function(){var a,u,m,b,g;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(v){switch(v.label){case 0:return v.trys.push([0,4,,5]),null===(w=b=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,b];case 1:b=v.sent(),v.label=2;case 2:if(!1===b)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return h=!0,s(o(d,e,null==(u=null==n?void 0:n.getPendingMeta)?void 0:u.call(n,{requestId:d,arg:e},{getState:c,extra:l}))),[4,Promise.race([f,Promise.resolve(t(e,{dispatch:s,getState:c,extra:l,requestId:d,signal:p.signal,abort:y,rejectWithValue:function(e,t){return new Gn(e,t)},fulfillWithValue:function(e,t){return new Kn(e,t)}})).then((function(t){if(t instanceof Gn)throw t;return t instanceof Kn?r(t.payload,d,e,t.meta):r(t,d,e)}))])];case 3:return m=v.sent(),[3,5];case 4:return g=v.sent(),m=g instanceof Gn?i(null,d,e,g.payload,g.meta):i(g,d,e),[3,5];case 5:return n&&!n.dispatchConditionRejection&&i.match(m)&&m.meta.condition||s(m),[2,m]}var w}))},new Promise((function(e,t){var n=function(e){try{o(m.next(e))}catch(e){t(e)}},r=function(e){try{o(m.throw(e))}catch(e){t(e)}},o=function(t){return t.done?e(t.value):Promise.resolve(t.value).then(n,r)};o((m=m.apply(a,u)).next())}));var a,u,m}();return Object.assign(m,{abort:y,requestId:d,arg:e,unwrap:function(){return m.then(Qn)}})}}),{pending:o,rejected:i,fulfilled:r,typePrefix:e})}return e.withTypes=e,e}();function Qn(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var Yn=function(e,t){return function(e){return e&&"function"==typeof e.match}(e)?e.match(t):e(t)};function Zn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.some((function(e){return Yn(e,t)}))}}Object.assign;var er="listenerMiddleware";Hn(er+"/add"),Hn(er+"/removeAll"),Hn(er+"/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[en];return an.get(t,e)},set:function(t){var n=this[en];an.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][en];if(!o.P)switch(o.i){case 5:r(o)&&Bt(o);break;case 4:n(o)&&Bt(o)}}}function n(e){for(var t=e.t,n=e.k,r=nn(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==en){var a=t[i];if(void 0===a&&!gt(t,i))return!0;var s=n[i],c=s&&s[en];if(c?c.t!==a:!wt(s,a))return!0}}var l=!!t[en];return r.length!==nn(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){on[e]||(on[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=rn(n);delete i[en];for(var a=nn(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:Tt(),P:!1,I:!1,D:{},l:n,t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,en,{value:i,writable:!0}),o},S:function(e,n,o){o?ht(n)&&n[en].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[en];if(n){var o=n.t,i=n.k,a=n.D,s=n.i;if(4===s)mt(i,(function(t){t!==en&&(void 0!==o[t]||gt(o,t)?a[t]||e(i[t]):(a[t]=!0,Bt(n)))})),mt(o,(function(e){void 0!==i[e]||gt(i,e)||(a[e]=!1,Bt(n))}));else if(5===s){if(r(n)&&(Bt(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),d=0;d<u;d++)i.hasOwnProperty(d)||(a[d]=!0),void 0===a[d]&&e(i[d])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}})}();class tr extends c{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}var nr=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 rr=Xn("initializeConfig",((e,{extra:{api:t,config:n},rejectWithValue:r})=>nr(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)}})))),or=Xn("resetConfig",((e,{extra:{config:t}})=>nr(void 0,void 0,void 0,(function*(){return t}))));const ir=Xn("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 ar="NOT_FOUND",sr=function(e,t){return e===t};function cr(e,t){var n,r,o="object"==typeof t?t:{equalityCheck:t},i=o.equalityCheck,a=void 0===i?sr: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),d=1===c?(n=u,{get:function(e){return r&&n(r.key,e)?r.value:ar},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 ar}return{get:r,put:function(t,o){r(t)===ar&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(c,u);function p(){var t=d.get(arguments);if(t===ar){if(t=e.apply(null,arguments),l){var n=d.getEntries(),r=n.find((function(e){return l(e.value,t)}));r&&(t=r.value)}d.put(arguments,t)}return t}return p.clearCache=function(){return d.clear()},p}function lr(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 ur(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,d=void 0===u?n:u,p=Array.isArray(d)?d:[d],f=lr(r),h=e.apply(void 0,[function(){return a++,c.apply(null,arguments)}].concat(p)),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 dr=ur(cr);const pr=dr((({app:e})=>e),(({userHasResponded:e})=>e)),fr="visibility",hr={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},yr=dr((({config:e})=>e),(e=>{let t=Object.assign({visible:"inline"===(null==e?void 0:e.layoutMode)?hr.open:hr.minimized,appContainerClassNames:e.appContainerClassNames||[]},e);return"function"==typeof t.appContainerClassNames&&(t=Object.assign(Object.assign({},t),{appContainerClassNames:t.appContainerClassNames(t)})),t})),mr=()=>Le(yr),br=({state:e})=>e,gr=()=>Le(br),vr=dr(br,yr,pr,(({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]})),wr=dr(vr,yr,((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&&h(e.payload.occurredAt-s.payload.occurredAt)>=i?e.payload.occurredAt:void 0;a.push(Object.assign(Object.assign({},e),{timeIndicator:t}))}s=e})),a})),Or=()=>Le(wr),jr=(dr(wr,(e=>e.map((e=>e.payload.id)))),()=>gr().isLoading),xr=()=>gr().unreadEvents,Sr=()=>gr().skiplinkTargetId,Cr=dr(wr,(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})),_r=()=>{const{participants:e,currentAgent:t}=gr().participantInfo;return t?e[t]:null},Er=()=>{const{layoutMode:e}=mr();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},Pr=({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!==hr.open?e?n||t||hr.open:hr.hidden:"inline"===i&&e&&!n?t||hr.open:n||t||s||hr.minimized:hr.open},Tr=dr((({visibility:e})=>e),(e=>e.visibility)),kr=dr((({visibility:e})=>e),(e=>e.showInlineView));const Ar=[hr.open,hr.minimized,hr.hidden],Ir=Xn("setVisibility",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),i=Tr(o),a=pr(o),s=n.hasConversation(),c=yr(o),{visibilityCallback:l=Pr,layoutMode:u}=c,{unreadEvents:d}=br(o),p=l({hasResponded:a,previousVisibility:i,requestedVisibility:e,config:c});if(Ar.includes(p)){if(i!==p)return n.store.set(fr,Object.assign(Object.assign({},n.store.get(fr)||{}),{[u]:e})),e&&r.emit("ui.visible",e,{visibility:e,hasConversation:s,hasResponded:a,unreadMessageCount:d}),p}else console.error('The visibilityCallback function should return "open", "minimized" or "hidden".')})),Nr=Xn("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}=yr(n()),i=(null===(e=r.store.get(fr))||void 0===e?void 0:e[o])||hr.initialize;return t(Ir(i)),i}))));var Dr=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 Lr=Xn("initializeApp",((e,{extra:{api:t,config:n},rejectWithValue:r})=>Dr(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:ot,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:it,body:{enabled:!0,locale:s}},!1)),{initialState:void 0,locale:s,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 tr;return r({name:t.name,message:t.message,langKey:t.langKey})}})))),Mr=Xn("resetApp",((e,{dispatch:t,extra:{api:n}})=>Dr(void 0,void 0,void 0,(function*(){yield n.disconnect(),yield n.clearStore(),t(or()),yield t(rr());try{const{locale:e}=yield t(Lr()).unwrap();yield t(ir(e))}catch(e){}t(Nr())})))),Rr=()=>Le(pr),Ur={userHasResponded:!1},Fr=qn({name:"app",initialState:Ur,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(Mr.pending,(()=>Ur)).addCase(Lr.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:zr}=Fr.actions,Br=Fr.reducer,Hr={error:void 0},$r=qn({name:"interrupt",initialState:Hr,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>Hr},extraReducers:e=>{e.addCase(Mr.fulfilled,(()=>Hr)).addMatcher(Zn(Lr.rejected,rr.rejected,ir.rejected,Ir.rejected,Nr.rejected),((e,{payload:t})=>{e.error=t}))}}),{setInterrupt:qr,clearInterrupt:Vr}=$r.actions,Wr=$r.reducer,Gr=({type:e,payload:t})=>e===Ge&&!t.fromClient||"info"===e&&t.type===Ke,Kr=e=>e.sort((({payload:{occurredAt:e}},{payload:{occurredAt:t}})=>e-t)),Jr=(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})},Xr=(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||{}})})},Qr={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:S(),optionsButtonId:S(),headerCollapseButtonId:S(),serviceData:{},options:{features:{},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],entryMeta:{default:Je,active:Je,userSelected:null,blockAutoEntrySwitch:!1,options:{},optionsOverride:{}},seamlyContainerElement:null},Yr=qn({name:"store",initialState:Qr,reducers:{addEvent:(e,t)=>{var n,r;const{type:o,payload:i}=t.payload,a=e.options.features.hasOwnProperty(dt);let s=Object.assign({},e.options);if(a&&(o===Ge||"participant"===o)&&!i.fromClient){const e="message"===o?null===(n=i.entry)||void 0===n?void 0:n.type:{};s=Object.assign(Object.assign({},s),{features:Object.assign(Object.assign({},s.features),{uploads:Object.assign(Object.assign({},null===(r=s.features)||void 0===r?void 0:r.uploads),{enabledFromEntry:e===Xe})})})}const c=Gr(t.payload);if(e.events.find((e=>e.payload.id===i.id)))return;const l=Xr(e.entryMeta,t.payload);e.entryMeta=a||l.active!==Xe?l:Object.assign({},e.entryMeta),e.options=s,c&&(e.unreadEvents+=1,"service_data"!==o&&(t.payload.payload.messageStatus=i.fromClient?Ye:Qe)),t.payload.payload.key=S(),e.events.push(t.payload),e.isLastEventFromClient=i.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=Kr(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===Qe&&{messageStatus:Ye})),e)))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setHistory:(e,{payload:{events:t,participants:n,activeServiceSessionId:r,activeServiceSettings:o={},serviceData:i,resumeConversationPrompt:a}})=>{var s,c;const l=((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 Kr([...r,...n])})(e.events,t),u=Object.assign(Object.assign({},e.participantInfo.participants),n),d=l.slice().reverse().find((e=>("message"===e.type||"participant"===e.type)&&!e.payload.fromClient));let p=null;d&&("message"===d.type&&(p=d.payload.participant),"participant"===d.type&&(p=d.payload.participant.id));const{entry:f}=o,h=null===(s=null==f?void 0:f.options)||void 0===s?void 0:s.upload,y=Xr(Object.assign(Object.assign(Object.assign({},e.entryMeta),f),{active:(null==f?void 0:f.default)||Ke,options:Object.assign({},(null==f?void 0:f.options)?f.options:{})}),l[l.length-1]);let m=Object.assign({},e.options.features);const b=m.hasOwnProperty(dt);if(b&&"message"===(null==d?void 0:d.type)){const{payload:e}=d,t=(null===(c=null==e?void 0:e.entry)||void 0===c?void 0:c.type)||{};m=Object.assign(Object.assign({},m),{uploads:{enabled:!(!h||!(null==h?void 0:h.enabled)),enabledFromEntry:t===Xe}})}e.unreadEvents=l.filter((e=>"message"===e.type&&e.payload.messageStatus===Qe)).length,e.events=l.filter((e=>"participant"!==e.type||!!e.payload.participant.introduction)),e.participantInfo=Object.assign(Object.assign(Object.assign({},e.participantInfo),p?Jr(e.participantInfo,{participant:u[p]}):{}),{participants:u}),e.historyLoaded=!0,e.serviceInfo=Object.assign(Object.assign({},e.serviceInfo),{activeServiceSessionId:r}),e.serviceData=Object.assign(Object.assign({},e.serviceData),i),e.options=Object.assign(Object.assign({},e.options),{features:m||{}}),e.entryMeta=b||y.active!==Xe?y:Object.assign({},e.entryMeta),e.resumeConversationPrompt=a||!1,p&&(e.headerTitles.subTitle=u[p].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=y(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=Jr(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=Qr.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(Mr.pending,(()=>Qr)).addCase(rr.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(Lr.fulfilled,((e,{payload:t})=>{t.initialState&&(e.initialState=t.initialState)})).addMatcher(Zn(co,lo),(e=>{e.isLastEventFromClient=!1}))}}),{ackEvent:Zr,addEvent:eo,clearAllUploads:to,clearEvents:no,clearFeatures:ro,clearIdleDetachCountdown:oo,clearResumeConversationPrompt:io,decrementIdleDetachCountdownCounter:ao,hideOption:so,initIdleDetachCountdown:co,initResumeConversationPrompt:lo,registerUpload:uo,resetHistoryLoadedFlag:po,setActiveEntryType:fo,setActiveService:ho,setBlockAutoEntrySwitch:yo,setEventsRead:mo,setFeatureEnabledState:bo,setFeatures:go,setHeaderSubTitle:vo,setHeaderTitle:wo,setHistory:Oo,setInitialState:jo,setIsLoading:xo,setLoadedImageEventIds:So,setParticipant:Co,setSeamlyContainerElement:_o,setServiceDataItem:Eo,setServiceEntryMetadata:Po,setUploadComplete:To,setUploadError:ko,setUploadProgress:Ao,setUserEntryType:Io,setUserSelectedOption:No,setUserSelectedOptions:Do,showOption:Lo,stopIdleDetachCountdownCounter:Mo}=Yr.actions,Ro=Yr.reducer;const Uo=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:[]}),Fo=["hideOnNoUserResponse","connectWhenInView","showDisclaimer","showFaq","showSuggestions","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon"],zo=(e,t)=>{const n=(i=t,Fo.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},Bo=qn({name:"config",initialState:Uo,reducers:{setConfig:(e,{payload:t})=>zo(e,t),updateConfig:(e,{payload:t})=>zo(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(or.fulfilled,(e=>e)).addCase(rr.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:$o,setPreChatEvents:qo}=Bo.actions,Vo=Bo.reducer;class Wo extends c{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const Go={SeamlyGeneralError:u,SeamlyConfigurationError:l,SeamlySessionExpiredError:d,SeamlyOfflineError:Wo,SeamlyUnauthorizedError:p,SeamlyUnavailableError:tr},Ko=Hn("catch-error",(e=>({payload:e})));function Jo({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:o,api:i,layoutMode:a}=yr(t()),{error:s,type:l}=n,u=Go[null==s?void 0:s.name]?new Go[s.name](s):new c(s);null==r||r(u,{namespace:o,api:i,layoutMode:a,conversationUrl:e.getConversationUrl(),action:l?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 Xo={controls:{}},Qo={value:"",touched:!1},Yo={controls:Qo},Zo=qn({name:"forms",initialState:Yo,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({},Xo),{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]:Qo}},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(Mr.pending,(()=>Yo))}}),{registerForm:ei,deregisterForm:ti,registerControl:ni,deregisterControl:ri,updateControlValue:oi,updateControlTouched:ii}=Zo.actions,ai=Zo.reducer,si=qn({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(rr.fulfilled,((e,{payload:t})=>{e.initialLocale=t.locale})).addCase(ir.pending,(e=>{e.isLoading=!0})).addCase(ir.rejected,(e=>{e.isLoading=!1})).addCase(ir.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:ci,setTranslations:li}=si.actions,ui=si.reducer,di=[u,l,d,Wo,p,tr];function pi({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 u(r);"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}function fi(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?fi(Object(n),!0).forEach((function(t){yi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yi(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 No.toString():e.store.set("options",hi(hi({},e.store.get("options")||{}),{},{[n.payload.option]:n.payload.value}))}return r}}const bi=dr((({i18n:e})=>e),(({translations:e})=>e)),gi=dr((({i18n:e})=>e),(({initialLocale:e})=>e)),vi=dr((({i18n:e})=>e),(({locale:e})=>e)),wi=dr((({i18n:e})=>e),(({isLoading:e})=>e)),Oi={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:Vn(),translatedEventGroups:{},translationProposal:null},ji=(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}},xi=qn({name:"translation",initialState:Oi,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}=ji(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:o,eventIds:i}=ji(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(rr.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(Oo,((e,{payload:t})=>{e.translationProposal=t.translationProposal})).addCase(eo,((e,{payload:t})=>{e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)}))}}),{enableTranslation:Si,disableTranslation:Ci,enableEventsTranslation:_i,disableEventsTranslation:Ei,setTranslationProposalPrompt:Pi,disableTranslationProposalPrompt:Ti}=xi.actions,ki=xi.reducer;function Ai({dispatch:e,getState:t}){return n=>r=>{const o=n(r),{payload:i}=r;switch(r.type){case Oo.type:i?.translation?.enabled&&(e(Si(i.translation.locale)),e(ir(i.translation.locale)));break;case rr.fulfilled.type:i.locale&&e(ir(i.locale));break;case jo.type:i?.translation?.enabled&&(e(Si(i.translation.locale)),e(ir(i.locale)));break;case eo.type:"info"===i.type&&"new_translation"===i?.payload?.body?.subtype&&i.payload.body.translationEnabled&&e(ir(i.payload.body.translationLocale));break;case Ci.type:const n=gi(t());e(ir(n))}return o}}const Ii=qn({name:"visibility",initialState:{visibility:hr.initialize,showInlineView:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(Ir.fulfilled,((e,{payload:t})=>{t&&(e.visibility=t)})).addCase(rr.fulfilled,((e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)}))}}),{setShowInlineView:Ni}=Ii.actions,Di=Ii.reducer,Li=$e,Mi=()=>{const e=Li(),t=Le(Tr),n=!!t&&t!==hr.hidden,r=t===hr.open,o=t===hr.minimized,i=(0,Se.useCallback)((t=>e(Ir(t))),[e]);return{isVisible:n,isOpen:r,isMinimized:o,visible:t,setVisibility:i,openChat:()=>{i(hr.open)},closeChat:()=>{i(hr.minimized)}}},Ri=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,xe.createRef)()})=>{const[r,o]=(0,Se.useState)(null),i=!!(null==r?void 0:r.isIntersecting)||!t,a=i&&e,s=([e])=>o(e);return(0,Se.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}},Ui=()=>(0,Se.useContext)(Ve),Fi=()=>Ui().store||{},zi=()=>{const e=Ui();return(0,Se.useCallback)((()=>e.hasConversation()),[e])};function Bi(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?Bi(Object(n),!0).forEach((function(t){$i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $i(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=Ui(),t=mr(),n=$e(),r=(0,Se.useContext)(We),o=Rr(),i=zi(),{visible:a,setVisibility:c}=Mi(),l=xr(),u=(0,Se.useCallback)(((...e)=>{r.emit(...e)}),[r]),d=(0,Se.useCallback)((()=>{e.sendContext(t.context||{}),u("ui.beforeStart",{visibility:a,hasConversation:i(),hasResponded:o,unreadMessageCount:l}),e.send("start"),u("ui.start",{visibility:a,hasConversation:i(),hasResponded:o,unreadMessageCount:l})}),[e,t.context,u,i,o,l,a]),p=(0,Se.useCallback)((async()=>{n(Mr())}),[n]),f=(0,Se.useCallback)((e=>({type:e,id:S(),transactionId:S(),participant:s,fromClient:!0,occurredAt:1e3*Date.now(),meta:{}})),[]),h=(0,Se.useCallback)((e=>Hi(Hi({},f("text")),{},{body:{text:e}})),[f]),y=(0,Se.useCallback)((({body:t,config:r={}})=>{if(""===t.trim())return;const o=Hi(Hi({},h(t)),r);e.send("message",o),u("message",o),n(eo({type:"message",payload:Hi(Hi({},o),{},{optimisticallyInjected:!0})}))}),[e,n,u,h]),m=(0,Se.useCallback)(((e,t=S())=>{n(eo({type:"message",payload:Hi(Hi({},h(e)),{},{transactionId:t})}))}),[n,h]),b=(0,Se.useCallback)(((e,t,r,o,i,a,c)=>{n(eo({type:"message",payload:{type:"upload",id:e,transactionId:t,participant:s,fromClient:!0,occurredAt:r,meta:{},body:{contentType:o,filename:i,filesize:a,url:c}}}))}),[n]),g=(0,Se.useCallback)(((e,t=S())=>{const r={body:{subtype:e,type:"divider"},fromClient:!1,fromHistory:!0,id:S(),transactionId:t,type:"divider"};n(eo({type:"info",payload:r}))}),[n]),v=(0,Se.useCallback)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==et&&n!==tt&&u(`action.${n}`,t)}),[e,u]),w=(0,Se.useCallback)((t=>{e.sendContext(t)}),[e]),O=(0,Se.useCallback)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&(n(jo(e)),e.userResponded&&(n(zr(e.userResponded)),c(hr.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,c]);return{connect:O,start:d,sendMessage:y,sendAction:v,sendContext:w,reset:p,emitEvent:u,addMessageBubble:m,addUploadBubble:b,addDivider:g,apiConnected:e.connected,apiConfigReady:e.configReady}};function Vi(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 Wi(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=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Vi(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)?Vi(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 Gi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ki(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 Ji(e){return e.reduce((function(e,t){return e.concat(Array.isArray(t)?Ji(t):t)}),[])}function Xi(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 Qi(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=Yi(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 Yi(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 Zi(e){return ea(e.slice(1,-1),",",3)}function ea(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),ea(a,t,n-1,r)}var ta;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 ra(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){pn(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}var oa=0,ia="other";function aa(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(oa++);r+="{".concat(a,", number}"),i[a]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:i}}var sa="other";const ca=new(function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Gi(this,e),pn(this,"format",Xi((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ji(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=Yi(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=Zi(o),c=Wi(s,3),l=c[0],u=c[1],d=c[2],p=t[l];null==p&&(p="");var f=u&&this.typeHandlers[u];i.push(f?f(p,d,this.locale,t,this.process.bind(this)):p);var h=e.substring(r+1);return h&&i.push(this.process(h,t)),i}}return[e]}}],n&&Ki(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=Qi(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!==ta&&ta.resolvedOptions().locale===n||(ta=new Intl.PluralRules(n));var u=ta.select(c);u!==ia&&l.push(u)}1===c&&l.push("one"),l.push("=".concat(c),ia);for(var d=0;d<l.length;d++){var p=l[d];if(p in s){var f=aa(s[p],c),h=f.caseBody,y=f.numberValues;return o(h,ra(ra({},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=Qi(t),i=o.cases;return e in i?r(i[e],n):sa in i?r(i.other,n):e}});function la(){const e=Le(bi),t=Le(vi),n=Le(gi),r=Le(wi),o=(0,Se.useCallback)(((n,o={})=>{const i=e[n];return i?ca.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 ua=(0,xe.createContext)(null),da=()=>{const e=(0,Se.useContext)(ua);return{sendPolite:(0,Se.useCallback)((t=>{t&&e({ariaLive:lt,messageText:t})}),[e]),sendAssertive:(0,Se.useCallback)((t=>{t&&e({ariaLive:ct,messageText:t})}),[e])}},pa=({children:t})=>((()=>{const e=Or(),{t}=la(),{isInline:n,isWindow:r,isApp:o}=Er(),{isOpen:i,isVisible:a}=Mi(),s=Le(kr),c=$e(),l=(0,Se.useRef)(null),{start:u,connect:d,apiConfigReady:p,apiConnected:f}=qi(),h=zi(),y=(0,Se.useRef)(null),m=(0,Se.useRef)(null),b=(0,Se.useRef)(!1),{sendAssertive:g}=da();(0,Se.useEffect)((()=>{a&&setTimeout((()=>{g(t("window.srTexts.onLoad"))}),500)}),[a,g,t]),(0,Se.useEffect)((()=>{if(a!==m.current)return y.current=i,void(m.current=a);null!==y.current&&g(t(i?"window.srTexts.onOpen":"window.srTexts.onClose")),y.current=i,m.current=a}),[i,a,g,t]),(0,Se.useEffect)((()=>(l.current=setTimeout((()=>{c(xo(!0))}),500),()=>{clearTimeout(l.current)})),[c]),(0,Se.useEffect)((()=>(e.length&&(l.current=setTimeout((()=>{c(xo(!1))}),5e3)),()=>{clearTimeout(l.current)})),[e,c]),(0,Se.useEffect)((()=>{p&&f||(b.current=!1)}),[p,f]);const v=(0,Se.useCallback)((async()=>{f||(b.current=!0,await d()),(o||i||a&&n)&&u()}),[f,d,o,n,i,a,u]);(0,Se.useEffect)((()=>{p&&!b.current&&(!r||i||h())&&(!n||a&&s)&&(h()&&i&&(clearTimeout(l.current),c(xo(!1))),v())}),[p,v,c,h,n,i,r,a,s])})(),(0,e.jsx)(e.Fragment,{children:t})),fa=(0,xe.createContext)({}),ha=()=>mr().appContainerClassNames,ya=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},ma=(e=0)=>new Promise((t=>{setTimeout(t,e)})),ba=()=>{const{seamlyContainerElement:e}=gr(),t=$e();return[e,(0,Se.useCallback)((e=>{t(_o(e))}),[t])]},ga=e=>(0,Se.useCallback)((()=>{var t;t=e,requestAnimationFrame((async()=>{await ma(180);const e="string"==typeof t?document.getElementById(t):t;w(e)}))}),[e]),va=()=>{const e=Sr();return ga(e)},wa=(0,xe.createContext)({});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 ja(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){xa(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 xa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Sa=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=gr(),{allowedMimeTypes:o,maxSize:i}=n.upload||{},{enabled:a,enabledFromEntry:s}=r||{},{allowedMimeTypes:c,maxSize:l}=ja(ja(ja({},t.upload||{allowedMimeTypes:[],maxSize:0}),o?{allowedMimeTypes:o}:{}),i?{maxSize:i}:{});return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:s||a,allowedMimeTypes:c,maxSize:l}},Ca=()=>{const{currentUploads:e}=gr(),t=$e(),n=(0,Se.useContext)(wa);return{uploadFile:(0,Se.useCallback)((e=>{n(e)}),[n]),clearUploads:(0,Se.useCallback)((()=>{t(to())}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}};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 Ea(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){Pa(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}function Pa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ta=()=>{const{t:e}=la(),{options:t}=gr(),{panelActive:n,optionActive:r,userSelectedOptions:o,features:i}=t,{cobrowsing:a,sendTranscript:s}=i,c={cobrowsing:a,sendTranscript:s},l=Object.keys(c).filter((e=>c[e])).map((t=>({name:t,title:e(`options.${t}.menuTitle`),available:c[t].enabled}))),u=a||s,d=$e(),{get:p,set:f}=Fi();return{allowOptionSelection:u,userSelectedOptions:o,features:i,menuOptions:l,initUserSelectedOptions:(0,Se.useCallback)((()=>{const e=p("options")||{};d(Do(e))}),[p,d]),setUserSelectedOptions:(0,Se.useCallback)((e=>{d(Do(e)),f("options",e)}),[f,d]),setUserSelectedOption:(0,Se.useCallback)(((e,t)=>{const n=p("options")||{};f("options",Ea(Ea({},n),{},{[e]:t})),d(No({option:e,value:t}))}),[d,p,f]),showOption:e=>{d(Lo(e))},hideOption:()=>{d(so())},panelActive:n,optionActive:r}},ka=()=>{const{optionsButtonId:e}=gr();return{id:e,focusButton:ga(e)}},Aa=(0,xe.createContext)(null),Ia=()=>(0,Se.useContext)(Aa);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 Da(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){La(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 La(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ma=()=>{const e=$e(),{idleDetachCountdown:t}=gr(),{isOpen:n}=Mi(),r=(0,Se.useRef)({});r.current={hasCountdown:t.hasCountdown,isActive:t.isActive,remaining:t.remaining,wasStopped:t.wasStopped,isOpen:n};const{emitEvent:o,sendAction:i}=qi(),{t:a}=la(),{sendAssertive:s,sendPolite:c}=da(),l=(0,Se.useCallback)((e=>{const{isOpen:t}=r.current;t&&s(e)}),[s]),u=(0,Se.useCallback)((e=>{const{isOpen:t}=r.current;t&&c(e)}),[c]),d=(0,Se.useCallback)((t=>{const n=(e=>Math.ceil(e/1e3))(t),r=y(n);e(co({delaySeconds:n,delayTime:r})),o("idleTimer.start"),l(`${a("idleDetachWarning.countdownTitle")} ${a("idleDetachWarning.countdownText")} ${a("idleDetachWarning.countdownTimer",r)}`)}),[e,o,l,a]),p=(0,Se.useCallback)(((t,n)=>{const{hasCountdown:s,wasStopped:c}=r.current;s&&(t||(n||i({type:nt}),l(a("idleDetachWarning.notifyTransferText"))),c||o("idleTimer.stop"),e(oo()))}),[e,i,o,l,a]),f=(0,Se.useCallback)((()=>{const{remaining:t}=r.current;if(t<=0)return;const n=t-1;n%10==0&&l(`${a("idleDetachWarning.countdownText")} ${a("idleDetachWarning.countdownTimer",y(n))}`),e(ao())}),[e,l,a]),h=(0,Se.useCallback)((()=>{const{isActive:t,remaining:n}=r.current;t&&(e(Mo()),n&&(o("idleTimer.stop"),u(a("idleDetachWarning.srCountDownStoppedText"))))}),[e,o,u,a]);return Da(Da({},t),{},{initCountdown:d,endCountdown:p,decrementCountdown:f,stopCountdown:h})},Ra=()=>{const e=$e(),t=gr().resumeConversationPrompt,{sendAction:n}=qi(),{t:r}=la(),{sendAssertive:o}=da();return{continueChat:()=>{n({type:rt,body:{type:"resume_conversation_prompt"}}),e(io())},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:nt}),e(io())}}},Ua=()=>{const[e]=(0,Se.useState)((()=>S()));return e},Fa=e=>{const t=(0,Se.useRef)(null);t.current=e;const n="function"==typeof e;return(0,Se.useMemo)((()=>n?(...e)=>t.current(...e):void 0),[n])};function za(){const{sendAction:e}=qi(),t=$e(),n=(0,Se.useCallback)(((n,r="translation_choice")=>{e({type:it,body:{enabled:!0,locale:n,source:r}}),t(Si(n)),t(Ti())}),[e,t]),r=(0,Se.useCallback)((()=>{e({type:it,body:{enabled:!1}}),t(Ci())}),[e,t]),{languages:o,isActive:i,isAvailable:a,currentLocale:s}=Le((({translations:e})=>e));return{languages:o,isActive:i,isAvailable:a,currentLocale:s,enableTranslations:n,disableTranslations:r}}function Ba(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=Le((e=>dr((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 Ha(){const e=Le((({translations:e})=>e.containerId));return{id:e,focusContainer:ga(e)}}function $a(e){const{languages:t}=za();return(0,Se.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 qa=(...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(i)>-1?e:[i,e].join("-"))).join(" "),Va=({eventPayload:t})=>{const{t:n}=la(),{fromClient:r,participant:o}=t,i=(e=>gr().participantInfo.participants[e])(o)||{},{messages:a}=mr(),s=r?n("participants.user.name"):i&&i.name,{showAvatar:c,showName:l}=a[r?"user":"agent"]||{};if(!c&&!l)return null;const u=[];return c&&s&&i.avatar&&u.push((0,e.jsx)("span",{className:qa("message__avatar"),children:(0,e.jsx)("img",{src:i.avatar,className:qa("avatar"),alt:""})})),l&&u.push((0,e.jsx)("span",{className:qa("message__author-name"),children:s})),u.length>0&&(0,e.jsx)("div",{className:qa("message__author"),children:u})},Wa=["showParticipant","event","type","modifiers","children","bodyProps","info"];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 Ka(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){Ja(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 Ja(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xa=function(t){let{showParticipant:n=!0,event:r,type:o,modifiers:i,children:a,bodyProps:s={},info:c}=t,l=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}(t,Wa);const u=ya(r),{hasTranslation:d,isTranslated:p,locale:f}=Ba(r);return o&&u.push(`message--type-${o}`),i&&("string"==typeof i&&(i=i.split(" ").filter((e=>e.length))),i.forEach((e=>{u.push(`message--${e}`)}))),p&&u.push("message--is-translated"),d&&u.push("message--has-translation"),p&&(s=Ka(Ka({},s),{},{lang:f})),(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("div",Ka(Ka({className:qa(u)},l),{},{children:[n&&(0,e.jsx)(Va,{eventPayload:r.payload}),(0,e.jsx)("div",Ka(Ka({className:qa("message__body")},s),{},{children:a})),c&&(0,e.jsx)("div",{"aria-hidden":"true",className:qa("message__info"),children:c})]}))})};function Qa(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 Ya(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qa(Object(n),!0).forEach((function(t){Za(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Za(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const es=({id:t,action:n,buttonText:r,description:o,hasFocus:i,image:a,title:s,isCarouselItem:c})=>{const l=(0,Se.useRef)(null),{sendMessage:u,sendAction:d,emitEvent:p}=qi(),f=Ua(),h=(0,Se.useRef)(),y=n.type===pt?"a":"button",m=(0,Se.useCallback)((()=>p("action.click_card",{type:at,originMessage:t,action:n})),[p,t,n]),b=(0,Se.useCallback)((()=>{if(m(),"ask"===n.type)u({body:n.ask});else if("topic"===n.type){const{topic:e,fallbackMessage:t}=n;d({type:ot,body:{name:e,fallbackMessage:t}})}}),[u,n,d,m]),g=(0,Se.useMemo)((()=>n.type===pt?{href:n.link,rel:"noopener noreferrer",target:n.newTab?"_blank":"_self",onClick:m}:{onClick:b}),[n,b,m]);return(0,Se.useEffect)((()=>{c&&(i&&h.current?window.requestAnimationFrame((()=>l.current.focus())):l.current.blur()),h.current=!0}),[i,c]),(0,e.jsxs)("div",{className:qa("card__wrapper"),id:t,tabIndex:"-1",ref:l,children:[(0,e.jsx)("img",{className:qa("card__image"),src:a,alt:""}),(0,e.jsxs)("div",{className:qa("card__content"),id:t,children:[s&&(0,e.jsx)("h2",{className:qa("card__title"),children:s}),o&&(0,e.jsx)("div",{className:qa("card__description"),dangerouslySetInnerHTML:{__html:o}}),(0,e.jsx)(y,Ya(Ya({tabIndex:c&&!i?"-1":void 0,className:qa("button","button--primary"),"aria-describedby":f},g),{},{children:r}))]})]})};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 ns(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){rs(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}function rs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function os(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 is(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?os(Object(n),!0).forEach((function(t){as(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):os(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function as(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ss({item:t,items:n,index:r,isActive:o}){const{t:i}=la();return(0,e.jsx)("div",{className:qa("carousel-item",`carousel-item--${t.type}`),role:"group","aria-roledescription":"slide","aria-label":i("carousel.slide.label",{index:r+1,total:n.length}),children:(0,e.jsx)(es,is(is({},t),{},{isCarouselItem:!0,hasFocus:o}))})}const cs={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'},ls=({name:t,size:n="32",className:r,alt:o})=>{const i=`${t}${n}`;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{"aria-hidden":"true",className:r||qa("icon"),dangerouslySetInnerHTML:{__html:cs[i]}}),o&&(0,e.jsx)("span",{className:qa("visually-hidden"),children:o})]})};function us({items:t,currentIndex:n,onChange:r,children:o}){const{t:i}=la(),a=t.length;return(0,e.jsxs)("div",{className:qa("carousel-controls"),children:[(0,e.jsx)("button",{className:qa("button","button--previous"),"aria-label":i("carousel.controls.previous"),onClick:()=>{r((n-1+a)%a)},children:(0,e.jsx)(ls,{name:"arrowLeft",size:"16"})}),o,(0,e.jsx)("button",{className:qa("button","button--next"),"aria-label":i("carousel.controls.next"),onClick:()=>{r((n+1)%a)},children:(0,e.jsx)(ls,{name:"arrowRight",size:"16"})})]})}function ds({items:t,currentIndex:n,onChange:r,getItemKey:o,getItemLabel:i}){const a=t.length,s=(0,Se.useCallback)((e=>{const t=Number(e.target.dataset.item||"0"),o=Math.min(a-1,Math.max(0,t));o!==n&&r(o)}),[a,n,r]);return(0,e.jsx)("div",{className:qa("carousel-pagination__wrapper"),role:"group",children:(0,e.jsx)("ul",{className:qa("carousel-pagination"),children:t.map(((t,r)=>{const a=n===r;return(0,e.jsx)("li",{className:qa("carousel-pagination__item",a?"is-active":void 0),children:(0,e.jsx)("button",{className:qa("carousel-pagination__button"),type:"button",onClick:s,"data-item":r,"aria-disabled":a?"true":void 0,"aria-label":i(t,r)})},o(t,r,"pagination-item-"))}))})})}const ps=(e,t,n)=>`${n}${t}`,fs=e=>e.label,hs=({target:e})=>{e.scrollLeft=0};function ys({currentIndex:t,onChange:n,getItemKey:r=ps,getItemLabel:o=fs,items:i}){const a=Ua(),s=i.length,[c,l]=(0,Se.useState)(Number(t||"0"));(0,Se.useEffect)((()=>{l(Number(t||"0"))}),[l,t]);const u=(0,Se.useRef)([]);u.current=(0,Se.useMemo)((()=>Array(s).fill(1).map((()=>(0,xe.createRef)()))),[s]);const d=(0,Se.useRef)(!0),p=(0,Se.useRef)();return p.current=n,(0,Se.useEffect)((()=>{d.current?d.current=!1:p.current&&p.current(c)}),[c]),(0,e.jsxs)("div",{className:qa("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,e.jsx)("div",{className:qa("carousel__slides-wrapper"),onScroll:hs,children:(0,e.jsx)("div",{id:a,className:qa("carousel__slides"),style:{width:100*s+"%",left:-100*c+"%"},"aria-live":"polite","aria-atomic":"false",children:i.map(((t,n)=>{const o=c===n;return(0,e.jsx)("div",{ref:u.current[n],className:qa("carousel__slide",o?"is-active":void 0),"aria-hidden":o?void 0:"true",children:(0,e.jsx)(ss,{item:t,items:i,currentIndex:c,index:n,isActive:o})},r(t,n,"item-"))}))})}),(0,e.jsx)("div",{className:qa("carousel__controls"),children:(0,e.jsx)(us,{currentIndex:c,items:i,onChange:l,controlId:a,children:(0,e.jsx)("div",{className:qa("carousel__pagination"),children:(0,e.jsx)(ds,{currentIndex:c,items:i,onChange:l,getItemKey:r,getItemLabel:o})})})})]})}const ms=(e,t,n="")=>`${n}${e.title}:${t}`,bs=e=>e.title,gs=["event","children"];function vs(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 ws(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vs(Object(n),!0).forEach((function(t){Os(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Os(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const js=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,xs=({id:t,categories:n=[],question:r,onClick:o,hasIcon:i})=>{const a=(0,Se.useMemo)((()=>["suggestions__item",...n.map(js)]),[n]),s=(0,Se.useCallback)((()=>{o&&o({id:t,question:r})}),[t,r,o]);return(0,e.jsx)("li",{className:qa(a),children:(0,e.jsxs)("button",{type:"button",onClick:s,className:qa("button","button--primary"),children:[i&&(0,e.jsx)(ls,{name:"chevronRight",size:"8"}),r]})})};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 Cs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _s=({className:t,suggestions:n=[],onClickSuggestion:r,hasIcon:o=!0})=>(0,e.jsx)("ul",{className:qa("suggestions__list",t),children:n.map((t=>(0,e.jsx)(xs,function(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){Cs(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}({hasIcon:o,onClick:r},t),t.id)))}),Es=["event"];function Ps(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 Ts(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ps(Object(n),!0).forEach((function(t){ks(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ps(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ks(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const As=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 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 Ns(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 in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ls({children:t,childrenHTML:n,className:r,graphicSrc:o,graphicType:i="icon",iconName:a,iconSize:s,iconClassName:c,dividerType:l}){const u=Boolean(a||o),d=n?{dangerouslySetInnerHTML:{__html:n}}:{children:t};return(0,e.jsxs)("div",{className:qa("divider",l&&`divider--type-${l}`,r),children:[u&&(0,e.jsx)("span",{className:qa("divider__graphic"),children:a?(0,e.jsx)(ls,{name:a,size:s,className:c}):(0,e.jsx)("img",{src:o,className:qa({icon:"icon"===i,avatar:"avatar"===i},c)})}),(0,e.jsx)("div",Ns({className:qa("divider__body")},d))]})}const Ms={[ut.new_topic]:"newtopic"},Rs=["event"];function Us(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 Fs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const zs={default:({event:t})=>{const{t:n}=la(),{subtype:r}=t.payload.body,o=Ms[ut[r]];return(0,e.jsx)(Ls,{dividerType:o,iconName:ut[r],children:(0,e.jsx)("p",{children:n(`dividerKeys.${ut[r]}`)})})},[ut.new_translation]:({event:t})=>{const{t:n}=la(),r=Or(),{body:{restartButtonText:o,translationEnabled:i,translationLocale:a,text:s,title:c},id:l}=t.payload,{enableTranslations:u}=za(),d=Le((e=>e.translations.translatedEventGroups)),p=$e(),f=(0,Se.useCallback)((()=>{d[l]?p(_i({events:r,id:l})):p(Ei({events:r,id:l}))}),[p,r,l,d]);return(0,e.jsxs)(Ls,{iconName:"newTranslation",dividerType:"newtranslation",children:[(0,e.jsx)("p",{className:qa("divider__title"),children:c}),s&&(0,e.jsx)("p",{children:s}),i?(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("button",{className:qa("button","button--secondary"),onClick:f,children:n(d[l]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):(0,e.jsx)("button",{className:qa("button","button--secondary"),"data-testid":"restartTranslationButton",onClick:()=>{u(a)},children:o})]})}},Bs={month:"long",day:"numeric",year:"numeric"},Hs={hour:"numeric",minute:"numeric"},$s=({event:t})=>{const n=(()=>{const[e,t]=(0,Se.useReducer)((e=>e+1),0);return(0,Se.useCallback)((()=>{setTimeout((()=>{t()}))}),[])})(),{date:r,time:o,timeUntilMidnight:i,srText:a}=(e=>{const{t}=la(),n=mr()?.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,Hs).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,Bs).format(r)}return{date:l,srText:t("dateTime.srText",{date:l,time:c}),time:c,fullDateTime:s,timeUntilMidnight:a}})(h(t.timeIndicator));return(0,Se.useEffect)((()=>{const e=setTimeout((()=>{n()}),i);return()=>{clearTimeout(e)}}),[n,i]),(0,e.jsxs)(Ls,{dividerType:"time-indicator",children:[(0,e.jsxs)("p",{className:qa("divider__time"),"aria-hidden":"true",children:[(0,e.jsx)("span",{children:r}),(0,e.jsx)("span",{children:o})]}),(0,e.jsx)("p",{className:qa("visually-hidden"),children:a})]})};var qs=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],Vs=qs.join(","),Ws="undefined"==typeof Element,Gs=Ws?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ks=!Ws&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},Js=function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(Vs));return t&&Gs.call(e,Vs)&&r.unshift(e),r.filter(n)},Xs=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{Gs.call(a,Vs)&&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 d=e(!0===l?a.children:l.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}return o},Qs=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},Ys=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Zs=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 Zs(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Gs.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Gs.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 a=e.parentElement,s=Ks(e);if(a&&!a.shadowRoot&&!0===r(a))return ec(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){for(var t,n=Ks(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=Ks(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!!Gs.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 Zs(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Ks(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)||Qs(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,a=i?t.scopeParent:t,s=Qs(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(Ys).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?Xs([e],t.includeContainer,{filter:nc.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:rc}):Js(e,t.includeContainer,nc.bind(null,t)),oc(n)},ac=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Gs.call(e,Vs)&&nc(t,e)},sc=qs.concat("iframe").join(","),cc=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Gs.call(e,sc)&&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){dc(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 dc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pc=[],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},mc=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target};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 gc(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){vc(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 vc(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=Ua(),a=(0,Se.useRef)(null),s=(0,Se.useRef)(null),[c,l]=(0,Se.useState)(!1);return(0,Se.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)||pc,l=uc({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},t),u={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},d=function(e,t,n){return e&&void 0!==e[t]?e[t]:l[n||t]},p=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(p(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?Xs([e],t.includeContainer,{filter:tc.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Js(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 ac(e,l.tabbableOptions)})):n.slice(0,r).reverse().find((function(e){return ac(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},g=function(e){var t=mc(e);p(t)>=0||(yc(l.clickOutsideDeactivates,e)?n.deactivate({returnFocus:l.returnFocusOnDeactivate&&!cc(t,l.tabbableOptions)}):yc(l.allowOutsideClick,e)||e.preventDefault())},v=function(e){var t=mc(e),n=p(t)>=0;n||t instanceof Document?n&&(u.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),m(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=mc(e);y();var n=null;if(u.tabbableGroups.length>0){var r=p(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)&&!ac(t,l.tabbableOptions)&&!o.nextTabbableNode(t,!1))&&(i=r),i>=0){var a=0===i?u.tabbableGroups.length-1:i-1;n=u.tabbableGroups[a].lastTabbableNode}}else{var s=hc(u.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(s<0&&(o.container===t||cc(t,l.tabbableOptions)&&!ac(t,l.tabbableOptions)&&!o.nextTabbableNode(t))&&(s=r),s>=0){var c=s===u.tabbableGroups.length-1?0:s+1;n=u.tabbableGroups[c].firstTabbableNode}}}else n=f("fallbackFocus");n&&(e.preventDefault(),m(n))}(e)},O=function(e){var t=mc(e);p(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(){m(h())})):m(h()),r.addEventListener("focusin",v,!0),r.addEventListener("mousedown",g,{capture:!0,passive:!1}),r.addEventListener("touchstart",g,{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",v,!0),r.removeEventListener("mousedown",g,!0),r.removeEventListener("touchstart",g,!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=d(e,"onActivate"),n=d(e,"onPostActivate"),o=d(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=d(t,"onDeactivate"),o=d(t,"onPostDeactivate"),a=d(t,"checkCanReturnFocus"),s=d(t,"returnFocus","returnFocusOnDeactivate");r&&r();var c=function(){fc((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(),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),s.current.activate()),()=>{s.current&&s.current.deactivate()};var e,t,n,r,i,l,u,d,p,f,h,y,m,b,g,v,w,O,j,x}),[c,o]),(0,Se.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,Se.useEffect)((()=>{c&&a.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()}))}),[c,t]),(0,Se.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=gc(gc({},e.props),{},{onClose:t}),e))),a.current)},Oc=({url:t,description:n,onClose:r})=>{const{zIndex:o,layoutMode:i,namespace:a}=mr(),s=Ia(),c=ha(),l=(0,Se.useRef)(null),{t:u}=la(),d=["modal",`app--layout-${i}`,`namespace--${a}`,...c],p=e=>{e.stopPropagation()},f=()=>{r()},h=o?{zIndex:o+1}:void 0;return(0,e.jsx)(wc,{onClose:r,"aria-label":u("lightbox.heading"),fallBackFocusRef:l,children:({onClose:r,modalRenderFn:o})=>o((r=>(0,e.jsx)("div",{className:qa(d),onClick:f,style:h,children:(0,e.jsxs)("div",{className:qa("modal__float"),tabIndex:"-1",onMouseDown:s,onKeyDown:s,onTouchStart:s,onMouseMove:s,onWheel:s,onPointerDown:s,onPointerMove:s,ref:l,children:[(0,e.jsx)("div",{className:qa("modal__inner"),onClick:p,children:(0,e.jsx)("img",{className:qa("modal__image"),src:t,alt:n})}),(0,e.jsxs)("button",{type:"button",className:qa("modal__close"),onClick:r,children:[(0,e.jsx)(ls,{name:"close",size:"16"}),u("lightbox.closeLabel")]})]})}))(r))})},jc=({description:t,url:n})=>{const{t:r}=la(),[o,i]=(0,Se.useState)(!1);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{type:"button",className:qa("modal__enlarge"),onClick:()=>{i(!0)},children:[r("message.image.srTextEnlargeButtonLabel",{description:t}),(0,e.jsx)(ls,{name:"enlarge",size:"32"})]}),o&&(0,e.jsx)(Oc,{url:n,description:t,onClose:()=>{i(!1)}})]})},xc=["event","descriptorId"];function Sc(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 Cc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sc(Object(n),!0).forEach((function(t){_c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _c(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){Dc(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 Dc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Lc=t=>{let{event:n}=t,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}(t,Ac);const{body:o}=Ba(n),i=As(n.payload.id),a=(0,Se.useMemo)((()=>n.payload.optimisticallyInjected?{children:(0,e.jsx)("p",{children:o.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:o.text}}}),[o,n]);return(0,e.jsx)(Xa,Nc(Nc({type:"text",event:n,onClick:i},r),a))},Mc=["event"];function Rc(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?Rc(Object(n),!0).forEach((function(t){Fc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rc(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 zc=["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 Hc(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){$c(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 $c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qc=({children:t,url:n,target:r})=>n?(0,e.jsx)("a",{href:n,download:!0,target:r||void 0,className:qa(["download","download-link"]),children:t}):(0,e.jsx)("span",{className:qa("download"),children:t}),Vc=["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:t=>{let{event:n,children:r}=t,o=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}(t,gs);const{t:i}=la(),a=Ua(),{body:s,subEvent:c,showOptions:l,chooseAgain:u,onChoiceClickHandler:d,onChooseAgainClickHandler:p}=(e=>{const{payload:t}=e,[n,r]=(0,Se.useState)(!1),{sendAction:o,addMessageBubble:i,addDivider:a}=qi(),{activeServiceSessionId:s}=gr().serviceInfo,c=Le(Cr),{body:l}=Ba(e),{service:u}=t,d=(0,Se.useMemo)((()=>ws(ws({},e),{},{payload:ws(ws({},e.payload),{},{body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&ws(ws({},e.payload.translatedBody),{},{data:e.payload.translatedBody.data.prompt})})})),[e]),p=l.chooseAgain&&s===u.serviceSessionId&&t.id!==c;return(0,Se.useEffect)((()=>{r(t.id===c)}),[t,c]),{body:l,subEvent:d,showOptions:n,chooseAgain:p,onChoiceClickHandler:e=>{const n=S();p&&a("new_topic",n),i(e.text,n),o({type:"pick_choice",originMessage:t.id,choice:{id:e.id,text:e.text,chooseAgain:p},transactionId:n}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}})(n);return(0,e.jsxs)(e.Fragment,{children:[(0,xe.toChildArray)(r).map((e=>(e.props=ws(ws({},e.props),{},{event:c,descriptorId:a,showTranslationToggle:!1}),e))),u&&(0,e.jsxs)("button",{type:"button",className:qa("button","button--secondary","button--choose-again"),"aria-expanded":l?"true":"false",onClick:p,"aria-describedby":a,children:[i(l?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,e.jsx)(ls,{name:"chevronDown",size:"8"})]}),l&&(0,e.jsx)(Xa,ws(ws({type:"choice-prompt",showParticipant:!1,event:n},o),{},{children:(0,e.jsx)("ul",{className:qa("choice-prompt","choice-prompt--many"),children:s.choices.map((t=>(0,e.jsx)("li",{className:qa("choice-prompt__item",{[`choice-prompt__item--${t.category}`]:t.category}),children:(0,e.jsx)("button",{type:"button",className:qa("button","button--primary"),onClick:()=>{d(t)},children:t.text})},t.id)))})}))]})},text:Lc,image:t=>{let{event:n,descriptorId:r}=t,o=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}(t,xc);const{body:i}=Ba(n),{description:a,url:s,isZoomable:c}=i,[l,u]=(0,Se.useState)(!1),d=$e();return(0,e.jsxs)(Xa,Cc(Cc({event:n,type:"image"},o),{},{children:[(0,e.jsx)("img",{src:s,id:r,alt:a,onLoad:()=>{d(So(n.payload.id)),u(!0)}}),c&&l&&(0,e.jsx)(jc,{description:a,url:s})]}))},splash:t=>{let{event:n}=t,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}(t,Ec);const{payload:o}=n,{body:i}=Ba(n),a=As(o.id);return(0,e.jsx)(Xa,Tc(Tc({type:"splash",event:n,onClick:a},r),{},{bodyProps:{dangerouslySetInnerHTML:{__html:i.text}}}))},video:t=>{let{event:n,descriptorId:r}=t,o=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}(t,Vc);const{body:i}=Ba(n),{description:a,url:s}=i;return ya(n).push("message--type-video"),(0,e.jsxs)(Xa,Gc(Gc({event:n,type:"video"},o),{},{children:[(0,e.jsx)("div",{id:r,className:qa("visually-hidden"),children:a}),(0,e.jsx)("iframe",{title:a,src:s,allow:"autoplay; encrypted-media",allowFullScreen:!0})]}))},upload:t=>{let{event:n}=t,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}(t,zc);const{t:o}=la(),{body:i}=Ba(n),{fromClient:a}=n.payload,{filename:s,url:c}=i,l=(0,Se.useMemo)((()=>o(c?"fileUpload.srFileDownloadText":"fileUpload.srFileUploadedText",{fileName:s})),[c,s,o]);return(0,e.jsx)(Xa,Hc(Hc({event:n,type:"upload"},r),{},{children:(0,e.jsxs)(qc,{url:c,target:a?void 0:"_blank",children:[(0,e.jsx)(ls,{name:"download",size:"16"}),(0,e.jsx)("span",{"aria-hidden":"true",className:qa("file-download"),children:s}),(0,e.jsx)("span",{className:qa("visually-hidden"),children:l})]})}))},cta:({event:t})=>{const{body:n}=Ba(t),r=As(t.payload.id),{emitEvent:o}=qi(),i=Ua(),a=(0,Se.useCallback)((()=>o("action.click_cta",{type:at,originMessage:t.payload.id,link:{url:n.buttonLink}})),[o,n,t]);return(0,e.jsxs)(Xa,{type:"cta",event:t,children:[(0,e.jsx)("div",{className:qa("cta__content"),id:i,dangerouslySetInnerHTML:{__html:n.description},onClick:r}),(0,e.jsx)("a",{className:qa("button","button--primary"),"aria-describedby":i,href:n.buttonLink,rel:"noreferrer",target:n.buttonNewTab?"_blank":"_self",onClick:a,children:n.buttonText})]})},carousel:({event:t})=>{const{body:n}=Ba(t),r=n.cards;return(0,e.jsx)(Xa,{event:t,modifiers:"type-carousel",children:(0,e.jsx)(ys,{items:r,ItemComponent:ss,getItemKey:ms,getItemLabel:bs})})},card:({event:t})=>{const{body:n}=Ba(t),r=Ua();return(0,e.jsx)(Xa,{type:"card",event:t,children:(0,e.jsx)(es,ns({id:r},n))})}},info:{text:Lc,divider:t=>{let{event:n}=t,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}(t,Rs);const o=zs[ut[n.payload.body.subtype]]||zs.default;return(0,e.jsx)(o,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Us(Object(n),!0).forEach((function(t){Fs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Us(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({event:n},r))},translation:t=>{let{event:n}=t,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}(t,Mc);const{t:o}=la(),{body:i}=Ba(n);return(0,e.jsx)(Xa,Uc(Uc({type:"text",event:n},r),{},{children:o(i.key.join("."),i.variables)}))},timeIndicator:$s},participant:{participant:({event:t})=>{const{participant:n}=t.payload,{body:r}=Ba(t);return r?(0,e.jsx)(Ls,{graphicSrc:n.avatar,graphicType:n.avatar?"avatar":void 0,iconName:n.avatar?void 0:"balloon",childrenHTML:r,dividerType:"participant"}):null}},service_data:{suggestion:t=>{let{event:n}=t,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}(t,Es);const[o,i]=(0,Se.useState)(!0),a=$e(),s=Rr(),{sendAction:c,addMessageBubble:l}=qi(),{suggestions:u,payload:d}=(e=>{const{payload:t}=e,{body:n}=Ba(e);return{suggestions:n,payload:t}})(n),{showSuggestions:p}=mr(),f=Or(),{t:h}=la(),y=h("suggestions.headingText"),m=h("suggestions.footerText"),b=(0,Se.useMemo)((()=>f.some((({payload:e})=>e?.transactionLast))),[f]),g=(0,Se.useCallback)((({id:e,question:t})=>{i(!1),a(zr(!0)),c({type:Ze,originMessage:d.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),l(t)}),[a,c,d.id,l]);return o&&!s&&b&&p?(0,e.jsxs)("div",{className:qa("suggestions","suggestions--conversation"),children:[y&&(0,e.jsx)("p",{className:qa("suggestions__heading"),children:y}),(0,e.jsxs)(Xa,Ts(Ts({type:"suggestions",showParticipant:!1,event:n},r),{},{children:[(0,e.jsx)(_s,{className:"suggestions__list--conversation",onClickSuggestion:g,suggestions:u}),m&&(0,e.jsx)("p",{className:qa("suggestions__footer"),children:m})]}))]}):null}}},Zc=({children:t})=>{const{customComponents:n}=mr(),r=(0,Se.useMemo)((()=>Object.keys(Yc).reduce(((e,t)=>Xc(Xc({},e),{},{[t]:Xc(Xc({},Yc[t]),n?n[t]:{})})),{fallback:Lc})),[n]);return(0,e.jsx)(fa.Provider,{value:r,children:t})},el=({children:t})=>{const{isMinimized:n}=Mi(),r=(0,Se.useRef)(0),{sendAction:o}=qi(),{hasCountdown:i,isActive:a,stopCountdown:s}=Ma(),c=(0,Se.useCallback)((()=>{if(n)return;const e=(new Date).getTime(),t=()=>{o({type:"interactivity_update"}),r.current=e};i&&a&&(t(),s()),e-r.current>15e3&&t()}),[o,i,a,s,n]);return(0,e.jsx)("div",Object.assign({className:qa("activity-monitor"),tabIndex:-1,onMouseDown:c,onKeyUp:c,onTouchStart:c,onMouseMove:c,onWheel:c,onPointerDown:c,onPointerMove:c},{children:(0,e.jsx)(Aa.Provider,Object.assign({value:c},{children:t}))}))};const tl=["text","choice_prompt","image","video"],nl=()=>{const e=Ui(),t=$e(),n=Or(),r=(0,Se.useContext)(We),o=(0,Se.useRef)(null),{initCountdown:i,endCountdown:a}=Ma(),{emitEvent:s}=qi();return(0,Se.useEffect)((()=>{if(e.connectionInfo&&e.conversation.socket){const{socket:n}=e.conversation;n.onError((e=>{const n=new Wo(e);t(qr({name:n.name,message:n.message,langKey:n.langKey,originalEvent:n.originalEvent,originalError:n.originalError})),t(no())})),n.onOpen((()=>{t(Vr())}))}}),[e,e.connectionInfo,e.conversation.socket,t]),(0,Se.useEffect)((()=>{if(e.connectionInfo&&e.conversation.channel){const{channel:t}=e.conversation;return()=>{null==t||t.leave()}}return()=>{}}),[e,e.connectionInfo,e.conversation]),(0,Se.useEffect)((()=>{e.conversation.onConnection((e=>{if("join_channel_erred"===e){const e=new u;t(qr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action}))}}))}),[e.conversation,t]),(0,Se.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(vo(o.name)),t(Co({participant:o,fromClient:r})),"string"!=typeof o&&o.introduction&&t(eo(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(xo(n.state.loading)),n.type){case"idle_detach_countdown":i(n.body.duration);break;case"idle_detach_countdown_elapsed":a(void 0,!0);break;case"resume_conversation_prompt":t(lo());break;case"translation_proposal":t(Pi(n.body));break;case"user_first_response":t(zr(!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(ho(n.service.serviceSessionId)),t(eo(c))}break;case"participant":o(c);break;case"service_data":n.persist&&t(Eo(n));break;case"ack":t(Zr(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(bo({key:dt,enabled:!(!i||!i.enabled)})),t(Po(o)),n.serviceSessionId&&t(ho(n.serviceSessionId)),s("system.serviceChanged",r)}break;case"info":"divider"!==n.type&&"text"!==n.type&&"translation"!==n.type||t(eo(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 u(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,s,a,r,i]),(0,Se.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,Se.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],a=null===(o=null==r?void 0:r.lastEvent)||void 0===o?void 0:o.id;return i&&a===i.payload.id?r:e.getConversation().then((e=>{e&&t(Oo(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:t})=>{const{t:n}=la(),r=$e(),o=Ui(),{addUploadBubble:i}=qi();return(0,e.jsx)(wa.Provider,{value:e=>{const t=S(),a=o.uploadFile(e,(e=>{r(Ao({fileId:t,progress:Math.ceil(e)}))}),(e=>{const{id:n,transactionId:o,occurredAt:a,body:{contentType:s,filename:c,filesize:l,url:u}}=e.body;r(To(t)),i(n,o,a,s,c,l,u)}),(e=>{let o;switch(e&&e.body?e.body.error:""){case"file_uploads_are_disabled":o=n("fileUpload.errors.unavailable");break;case"request_entity_too_large":o=n("fileUpload.errors.tooLarge");break;case"file_has_invalid_mime_type":o=n("fileUpload.errors.wrongType");break;case"virus_found":o=n("fileUpload.errors.virusFound");break;default:o=n("fileUpload.errors.general")}r(ko({fileId:t,errorText:o}))}));r(uo({fileId:t,fileName:e.name,uploadHandle:a}))},children:t})},ol=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=Ma();return((e,t)=>{const n=(0,Se.useRef)(e);(0,Se.useEffect)((()=>{n.current=e}),[e]),(0,Se.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}=Ta(),t=(0,Se.useRef)(!1),n=mr();return(0,Se.useEffect)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null},al=dr((({interrupt:e})=>e),(({error:e})=>e));function sl(){const{t:e}=la(),t=Le(al);return{hasInterrupt:Boolean(t),meta:(0,Se.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 cl(e,t,n=[]){const r=(0,Se.useContext)(We),o=(0,Se.useRef)();o.current=t,(0,Se.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=mr(),{sendMessage:t,sendContext:n,sendAction:r}=qi(),o=$e(),{setVisibility:i,visible:a}=Mi(),c=(0,Se.useRef)(a),l=(0,Se.useContext)(We),u=Ui(),d=xr(),p=(0,Se.useRef)(null),f=(0,Se.useRef)(null),{isInline:h,isResolving:y}=Er(),{hasInterrupt:m}=sl(),b=(()=>{const{get:e}=Fi();return e?e("conversationUrl"):null})(),g=(0,Se.useRef)(null),v=Ia(),{enableTranslations:w,disableTranslations:O}=za();return(0,Se.useEffect)((()=>{c.current=a}),[a]),cl("askText",(e=>{t({body:e})}),[u?.send]),cl("setVariables",(e=>{n({variables:e})}),[u?.send]),cl("getVisibility",(e=>{e?e(c.current):console.warn("A callback function is required for the getVisibility action.")})),cl("setVisibility",(e=>{Object.values(hr).includes(e)?(v(),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}})}),[u.send]),cl("setTopic",(({name:e,fallbackMessage:t,userTriggered:n})=>{n&&o($o({showSuggestions:!1})),e&&t?r({type:ot,body:{name:e,fallbackMessage:t,participant:n?s:void 0}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[u.send]),cl("setTranslation",(({enabled:e,locale:t})=>{e?w(t,"window_api"):O()}),[u.send]),(0,Se.useEffect)((()=>{y||m||(g.current&&g.current!==b&&l.emit("unreadMessageCount",d),a===hr.open&&a!==f.current&&0!==p.current&&l.emit("unreadMessageCount",0),a!==hr.open&&d!==p.current&&l.emit("unreadMessageCount",d),f.current=a,p.current=d,g.current=b)}),[d,a,l,h,y,m,b]),null},ul=({children:t})=>{const n=(0,Se.useContext)(We),[r,o]=(0,Se.useState)({}),i=(0,Se.useRef)(!0),a=(0,Se.useCallback)((e=>{i.current&&(o(e),n.emit("aria-live",e))}),[o,n]);(0,Se.useEffect)((()=>{let e=null;return r&&r.messageText&&(e=setTimeout((()=>{a({}),clearTimeout(e)}),500)),()=>{clearTimeout(e)}}),[r,a]),(0,Se.useEffect)((()=>()=>{i.current=!1}),[]);const{ariaLive:s,messageText:c}=r;return(0,e.jsxs)(ua.Provider,{value:a,children:[t,(0,e.jsxs)("div",{className:qa("app__live-container"),children:[(0,e.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:qa("visually-hidden"),children:s===ct?c:null}),(0,e.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:qa("visually-hidden"),children:s===lt?c:null})]})]})},dl=()=>{const{t:e}=la(),t=Or(),n=(0,Se.useRef)(0),r=(0,Se.useRef)(0),o=gr().historyLoaded,{sendPolite:i}=da(),{isOpen:a}=Mi(),s=(0,Se.useRef)(null),c=(0,Se.useRef)(null),l=(0,Se.useMemo)((()=>f((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,Se.useEffect)((()=>{t.length>n.current&&(a&&(c.current=l(t)),n.current=t.length)}),[t,l,a]),(0,Se.useEffect)((()=>{s.current&&!a&&c.current&&(c.current(!0),c.current=null)}),[a]),(0,Se.useEffect)((()=>{o&&setTimeout((()=>{i(e("window.srTexts.onHistoryLoad"))}),500)}),[o,e,i]),null},pl=()=>{const{t:e}=la(),{isOpen:t,isVisible:n}=Mi(),r=xr(),{sendPolite:o}=da(),i=(0,Se.useMemo)((()=>f(o,2e3)),[o]),a=(0,Se.useRef)(null),s=(0,Se.useRef)(null);return(0,Se.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},fl=({store:t,children:n,eventBus:r,api:o})=>((0,Se.useErrorBoundary)((e=>{t.dispatch(Ko(e))})),(0,e.jsx)(Fe,Object.assign({store:t},{children:(0,e.jsx)(We.Provider,Object.assign({value:r},{children:(0,e.jsx)(Ve.Provider,Object.assign({value:o},{children:(0,e.jsx)(ul,{children:(0,e.jsx)(pa,{children:(0,e.jsxs)(Zc,{children:[(0,e.jsx)(il,{}),(0,e.jsx)(nl,{}),(0,e.jsx)(pl,{}),(0,e.jsx)(dl,{}),(0,e.jsx)(ol,{}),(0,e.jsxs)(el,{children:[(0,e.jsx)(ll,{}),(0,e.jsx)(rl,{children:n})]})]})})})}))}))}))),hl=()=>{const{t}=la(),{showDisclaimer:n}=mr();return n&&(0,e.jsxs)("div",{className:qa("disclaimer"),tabIndex:"0",children:[(0,e.jsx)("h2",{className:qa("disclaimer__title"),children:t("disclaimer.title")}),(0,e.jsx)("div",{className:qa("disclaimer__message"),dangerouslySetInnerHTML:{__html:t("disclaimer.content")}})]})},yl=require("preact/compat"),ml=(0,xe.createContext)(null),bl=e=>{const t=(0,Se.useContext)(fa),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]},gl=({event:t,newParticipant:n})=>{const{eventRefs:r,unreadIds:o}=(0,yl.useContext)(ml),{sendAction:i}=qi(),a=r[t.payload.id],{containerRef:s,isVisible:c}=Ri({containerRef:a,freezeOnceVisible:!0}),l=$e(),[u,d]=bl(t);if((0,yl.useEffect)((()=>{if(c&&(null==o?void 0:o.includes(t.payload.id))){const e=o.reduce(((e,n)=>e.includes(t.payload.id)?e:e.concat(n)),[]);l(mo(e)),i({type:tt,events:e})}}),[l,t.payload.id,c,i,o]),!u)return null;const p=["conversation__item"];return"info"===t.type?p.push("conversation__item--source-info"):t.payload.fromClient?p.push("conversation__item--source-user"):p.push("conversation__item--source-agent"),n&&p.push("conversation__item--new-participant"),(0,e.jsxs)("li",Object.assign({className:qa(p),ref:s},{children:[t.timeIndicator&&(0,e.jsx)($s,{event:t}),(0,e.jsx)(u,Object.assign({event:t},{children:(0,e.jsx)(d,{event:t})}))]}))},vl=()=>{const{id:t}=_r()||{};return(0,e.jsx)("li",{className:qa("conversation__item","conversation__item--source-agent"),children:(0,e.jsxs)("div",{className:qa("message","message--source-agent","message--type-loading"),children:[(0,e.jsx)(Va,{eventPayload:{fromClient:!1,participant:t}}),(0,e.jsx)("div",{className:qa("message__body"),children:(0,e.jsxs)("span",{className:qa("loader"),children:[(0,e.jsx)("span",{className:qa("loader__part","one")}),(0,e.jsx)("span",{className:qa("loader__part","two")}),(0,e.jsx)("span",{className:qa("loader__part","three")}),(0,e.jsx)("span",{className:qa("loader__part","four")})]})})]})})},wl=()=>{const t=Or();let n=null;return(0,e.jsx)(e.Fragment,{children:t.map((t=>{const{type:r,payload:o}=t;let i=!1;if("participant"!==r&&"service_data"!==r){const{participant:e,fromClient:r}=o,a=r?"seamly-client-participant":e;"info"!==t.type&&n!==a&&(i=!0),n=a}return(0,e.jsx)(gl,{event:t,newParticipant:i},t.payload.key||t.payload.id)}))})},Ol=()=>{const{t}=la(),n=jr(),{isOpen:r}=Mi(),o=Sr(),i=va();return(0,e.jsxs)(e.Fragment,{children:[r&&(0,e.jsx)("a",Object.assign({className:qa("skip-link"),href:`#${o}`,onClick:e=>{e.preventDefault(),i()}},{children:t("skiplinkText")})),(0,e.jsx)("div",Object.assign({className:qa("chat__body")},{children:(0,e.jsxs)("div",Object.assign({className:qa("conversation__container")},{children:[(0,e.jsx)(hl,{}),(0,e.jsxs)("ol",Object.assign({className:qa("conversation")},{children:[(0,e.jsx)(Zc,{children:(0,e.jsx)(wl,{})}),n&&(0,e.jsx)(vl,{})]}))]}))}))]})},jl={visible:qa("transition--visible"),in:qa("transition--in"),visuallyHidden:qa("visually-hidden")},xl=Object.values(jl),Sl="notRendered",Cl="rendered",_l="visuallyHidden",El=({children:t,isActive:n,timeout:r=300,transitionStartState:o="notRendered",onInTransitionComplete:i=(()=>{}),onOutTransitionComplete:a=(()=>{})})=>{const s=(0,Se.useRef)(!1),c=parseInt(r,10),l=Fa(i),u=Fa(a),d=o===_l,[p,f]=(0,Se.useState)((()=>d?[jl.visuallyHidden]:[])),h="notRendered"!==o||p.length>0;return(0,Se.useEffect)((()=>{let e=null,t=null;return s.current&&!n&&(f([jl.visible]),e=setTimeout((()=>{f([...d?[jl.visuallyHidden]:[]]),u&&(t=requestAnimationFrame((()=>{u()})))}),c)),!s.current&&n&&(f([jl.visible]),t=requestAnimationFrame((()=>{t=requestAnimationFrame((()=>{f([jl.visible,jl.in]),l&&(e=setTimeout((()=>{l()}),c))}))}))),s.current=n,()=>{clearTimeout(e),cancelAnimationFrame(t)}}),[n,d,c,l,u]),(0,e.jsx)(e.Fragment,{children:h&&(0,xe.toChildArray)(t).map((e=>{const{className:t=""}=e.props,n=t.split(" ").filter((e=>!xl.includes(e)));return(0,xe.cloneElement)(e,{className:[...n,...p].join(" ")})}))})},Pl=({isAside:t=!1})=>{const{isInline:n}=Er(),{t:r}=la(),{sendAction:o,addMessageBubble:i}=qi(),{isOpen:a,setVisibility:s}=Mi(),{showSuggestions:c}=mr(),l=Ua(),u=va(),d=(0,Se.useRef)(null),{sendPolite:p}=da(),{hasInterrupt:f}=sl(),{hasCountdown:h,endCountdown:y}=Ma(),{hasPrompt:m,continueChat:b}=Ra(),g=Rr(),v=("suggestion",gr().serviceData.suggestion);const{body:w}=Ba({payload:v}),j=(0,Se.useMemo)((()=>v&&!f?w:[]),[v,f,w]),x=(0,Se.useRef)(null),S=(0,Se.useRef)(!1),C=(0,Se.useRef)([]),_=!!j.length,E=n?(g||a)&&!t:g,P=(0,Se.useRef)(E),T=_&&!E&&c,k=_?j:C.current;C.current=k;const A=(0,Se.useMemo)((()=>{const e=["suggestions"];return t&&e.push("suggestions--aside"),qa(e)}),[t]),I=(0,Se.useCallback)((({id:e,question:t})=>{h&&y(!0),m&&b(),o({type:Ze,originMessage:v.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),i(t),a||s(hr.open),u()}),[i,b,y,u,h,m,v,o,s,a]);(0,Se.useEffect)((()=>{if(x.current!==j&&!E){if(_){const e=S.current?r("suggestions.srUpdatedText"):r("suggestions.srAvailableText");setTimeout((()=>{p(e)}),30)}else S.current&&p(r("suggestions.srUnavailableText"));x.current=j}!P.current&&E?(O(d.current,u),p(r("suggestions.srUnavailableText"))):!_&&S.current&&O(d.current,u),S.current=_,P.current=E}),[j,_,E,u,p,r]);const N=r("suggestions.headingText"),D=r("suggestions.footerText"),L=N?"section":"div";return(0,e.jsx)(El,{isActive:T,transitionStartState:Sl,children:(0,e.jsxs)(L,{className:A,"aria-labelledby":N?l:null,ref:d,children:[N&&(0,e.jsx)("p",{id:l,className:qa("suggestions__heading"),children:N}),!!k.length&&(0,e.jsx)(_s,{suggestions:k,onClickSuggestion:I}),D&&!a&&(0,e.jsx)("p",{className:qa("suggestions__footer"),children:D})]})})},Tl=(0,yl.forwardRef)((({children:t,className:n=""},r)=>{const{isOpen:o,isVisible:i,setVisibility:a}=Mi(),{namespace:s,layoutMode:c}=mr(),{isInline:l}=Er(),u=ha(),d=Rr(),{t:p}=la(),f=["chat",`chat--layout-${c}`,`namespace--${s}`,...u,n];return o||"app"===c||f.push("chat--collapsed"),d&&f.push("chat--user-responded"),i&&(0,e.jsxs)("section",{className:qa(f),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!l&&o&&a(hr.minimized)},tabIndex:"-1",ref:r,"aria-label":p("chat.srLabel"),children:[(0,e.jsx)("div",{className:qa("chat-wrapper"),children:t}),"inline"===c&&o&&(0,e.jsx)(Pl,{isAside:!0})]})})),kl=Tl,Al=({className:t,children:n,onCancel:r,headingText:o,description:i,descriptionId:a,cancelButtonText:s,cancelButtonRef:c,disableButtonFocusing:l,position:u={horizontal:"left",vertical:"top"}})=>{const d=Ua(),{hideOption:p}=Ta(),{focusButton:f}=ka(),h=(0,Se.useCallback)((()=>{p(),l||f()}),[l,f,p]),y=(0,Se.useCallback)((()=>{r&&r(),h()}),[h,r]),m=(e=>{const t=(0,Se.useRef)(null);return(0,Se.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})(y);return(0,Se.useEffect)((()=>{w(m.current)}),[m]),(0,e.jsx)("section",Object.assign({className:qa("options",{"options--right":"right"===u.horizontal,"options--left":"left"===u.horizontal,"options--top":"top"===u.vertical,"options--bottom":"bottom"===u.vertical},t),"aria-labelledby":d,tabIndex:-1,ref:m},{children:(0,e.jsxs)("div",Object.assign({className:qa("options__body")},{children:[(0,e.jsx)("h2",Object.assign({id:d,className:qa("options__title")},{children:o})),(0,e.jsxs)("button",Object.assign({type:"button",onClick:y,"aria-describedby":d,className:qa("button","options__close"),ref:e=>{c&&(c.current=e)}},{children:[(0,e.jsx)(ls,{name:"close",size:"16",alt:""}),(0,e.jsx)("span",{children:s})]})),i?(0,e.jsx)("p",Object.assign({className:qa("options__description"),id:a},{children:i})):null,(0,e.jsx)("div",Object.assign({className:qa("options__wrapper")},{children:n}))]}))}))},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},Dl=e=>!!e?.length>0,Ll=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,Rl=(0,xe.createContext)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),Ul=Rl,{Provider:Fl,Consumer:zl}=Rl,Bl=dr((({forms:e})=>e),((e,{formId:t})=>t),((e,t)=>e[t])),Hl=dr(Bl,(e=>(null==e?void 0:e.controls)||{})),$l=dr(Hl,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),ql=dr(Hl,((e,{name:t})=>t),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.value})),Vl=dr(Hl,((e,{name:t})=>t),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.touched}));function Wl(){return(0,Se.useContext)(Ul)}function Gl(e){const t=$e(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:i}=Wl(),a=!!Le((e=>Bl(e,{formId:n}))),s=Le((t=>ql(t,{formId:n,name:e}))),c=Le((t=>Vl(t,{formId:n,name:e}))),l=null==i?void 0:i[e],u=!l;(0,Se.useEffect)((()=>{a&&t(ni({formId:n,name:e}))}),[a,n,e,t]),(0,Se.useLayoutEffect)((()=>()=>{t(ri({formId:n,name:e}))}),[a,n,e,t]);const d=(0,Se.useCallback)((t=>r(e,t.target.value)),[e,r]),p=(0,Se.useCallback)((()=>{o(e,!0)}),[o,e]);return[(0,Se.useMemo)((()=>({name:e,onInput:d,onBlur:p,value:s})),[e,d,p,s]),(0,Se.useMemo)((()=>({isValid:u,error:l,touched:c})),[u,l,c])]}function Kl(t){var{children:n,formId:r,persistData:o,onError:i,onSubmit:a,validationSchema:s}=t,c=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,["children","formId","persistData","onError","onSubmit","validationSchema"]);const l=$e(),u=Le((e=>$l(e,{formId:r}))),[d,p]=(0,Se.useState)(!1),[f,h]=(0,Se.useState)({}),{isValid:y,errors:m}=function(e,t){const n=(0,Se.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}}(u,s),b=(0,Se.useMemo)((()=>Object.assign(Object.assign({},m),f)),[m,f]);(0,Se.useLayoutEffect)((()=>{l(ei({formId:r,persistData:o}))}),[r,o,l]),(0,Se.useEffect)((()=>()=>{l(ti({formId:r}))}),[r,o,l]);const g=(0,Se.useCallback)(((e,t)=>{l(oi({formId:r,name:e,value:t}))}),[r,l]),v=(0,Se.useCallback)(((e,t)=>{l(ii({formId:r,name:e,touched:t}))}),[l,r]),w=(0,Se.useCallback)(((e,t)=>{h((n=>Object.assign(Object.assign({},n),{[e]:t})))}),[h]),O=(0,Se.useCallback)((e=>{var t;e.preventDefault();const n="true"===(null===(t=e.submitter)||void 0===t?void 0:t.ariaDisabled);p(!n),!n&&y&&(l(zr(!0)),a(u,{updateControlValue:g,setError:w}))}),[y,l,a,u,g,w]);(0,Se.useEffect)((()=>{i&&i({errors:b,isSubmitted:d,isValid:0===Object.keys(b).length})}),[d,b,i]);const j=(0,Se.useMemo)((()=>({formId:r,values:u,errors:b,isValid:0===Object.keys(b).length,isSubmitted:d,handleSubmit:O,validationSchema:s,updateControlValue:g,updateControlTouched:v})),[r,u,b,d,O,s,g,v]);return r?a?(0,e.jsx)(Fl,Object.assign({},c,{value:j},{children:n})):(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(t){let{className:n,disableValidationClasses:r}=t,o=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}(t,Jl);const{handleSubmit:i,isValid:a,isSubmitted:s}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=Wl();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),c=["form"];return!r&&s&&(c.push("form--submitted"),a?c.push("form--valid"):c.push("form--invalid")),(0,e.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:i,className:qa([...c,n])},o))};function Zl({id:t,error:n}){const[r,o]=(0,Se.useState)(!1);return(0,Se.useEffect)((()=>{const e=setTimeout((()=>o(!0)),300);return()=>clearTimeout(e)}),[]),(0,e.jsx)("div",{className:qa("error"),"aria-live":"assertive","aria-atomic":"true",children:r&&n&&(0,e.jsxs)("span",{id:t,className:qa("error__message"),children:[(0,e.jsx)(ls,{name:"error",size:"16"}),n]})})}const eu=({contentHint:t,id:n,labelText:r,labelClass:o=qa("label"),validity:i,errorText:a,children:s})=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("label",{htmlFor:n,className:o,children:r}),t&&(0,e.jsx)("span",{id:`${n}-content-hint`,className:qa("input__content-hint"),children:t}),(0,e.jsx)(Zl,{id:`${n}-error`,error:!i&&a}),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(t){let{id:n,name:r,type:o,labelText:i,labelClass:a,contentHint:s,"aria-describedby":c}=t,l=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}(t,tu);const{isSubmitted:u}=Wl(),[d,{error:p}]=Gl(r),f=u&&p,h=[];return c&&h.push(c),s&&h.push(`${n}-content-hint`),f&&h.push(`${n}-error`),(0,e.jsx)(eu,{id:n,contentHint:s,validity:!f,errorText:p,labelText:i,labelClass:a,children:(0,e.jsx)("input",ru(ru({id:n,name:r,type:o,"aria-invalid":f?"true":"false","aria-describedby":h.join(" ")||null},d),l))})};function au({controlName:t,describedById:n}){const{t:r}=la();return(0,e.jsxs)(Yl,{noValidate:"true",className:qa("options__form"),children:[(0,e.jsx)(iu,{name:t,type:"email",className:qa("transcript__input"),"aria-describedby":n,labelClass:qa("label"),labelText:r("options.sendTranscript.label")}),(0,e.jsx)("div",{className:qa("options__actions"),children:(0,e.jsx)("button",{type:"submit",className:qa("button","button--primary","options__submit"),children:r("options.sendTranscript.sendButtonText")})})]})}const su="email",cu={sendTranscript:()=>{const[t,n]=(0,Se.useState)(void 0),{hideOption:r}=Ta(),{focusButton:o}=ka(),{t:i}=la(),a=Ua(),{sendAction:s}=qi(),c=(0,Se.useMemo)((()=>({[su]:[Il(Ml,i("options.sendTranscript.noEmailText")),Il(Ll,i("options.sendTranscript.invalidEmailText"))]})),[i]),l=(0,Se.useCallback)((e=>{const t=e.email.trim();s({type:"send_transcript",body:{emailAddress:t}}),r(),o()}),[s,r,o]),u=(0,Se.useCallback)((({isValid:e,isSubmitted:t})=>{n(t&&!e?"options--error":void 0)}),[n]);return(0,e.jsx)(Al,{className:t,headingText:i("options.sendTranscript.title"),cancelButtonText:i("options.cancelButtonText"),description:i("options.sendTranscript.description"),descriptionId:a,position:{vertical:"top",horizontal:"right"},children:(0,e.jsx)(Kl,{formId:"sendTranscript",onSubmit:l,validationSchema:c,onError:u,children:(0,e.jsx)(au,{controlName:su,describedById:a})})})}},lu=()=>{const{optionActive:t}=Ta(),n=(0,Se.useRef)(null),r=cu[t||n.current];return t&&(n.current=t),r?(0,e.jsx)(r,{}):null},uu=()=>{const{t}=la(),{menuOptions:n,showOption:r,panelActive:o,hideOption:i}=Ta(),{id:a}=ka(),s=(0,Se.useRef)(null),[c,l]=(0,Se.useState)(!1),u=(0,Se.useRef)(null),d=n.length,p=(0,Se.useRef)(Array.from({length:d},(()=>(0,xe.createRef)()))),f=(0,Se.useRef)(!1),h=d>1,y=n[0],m=(0,Se.useMemo)((()=>y?.name?.trim().replace(/\s+/g,"")),[y]);return(0,Se.useEffect)((()=>()=>{clearTimeout(s.current)}),[]),(0,Se.useEffect)((()=>{c&&!f.current&&requestAnimationFrame((async()=>{await ma(60);const e=n.findIndex((e=>e.available)),t=-1===e?0:e;w(p.current[t])})),f.current=c}),[c,n]),d?(0,e.jsxs)("div",{className:qa("options__container"),onKeyDown:e=>{c&&(v(e)===g.Escape&&(l(!1),w(u.current)),v(e)===g.Home&&(w(p.current[0]),e.preventDefault()),v(e)===g.End&&(w(p.current[d-1]),e.preventDefault()))},onfocusout:()=>{h&&(s.current=setTimeout((()=>{l(!1)}),200))},onfocusin:()=>{clearTimeout(s.current)},children:[(0,e.jsx)(El,{transitionStartState:Sl,isActive:o,children:(0,e.jsx)("div",{className:qa("options__dialog"),children:(0,e.jsx)(lu,{})})}),h&&(0,e.jsx)(El,{isActive:c,transitionStartState:Sl,children:(0,e.jsx)("ul",{className:qa(["options__menu"]),role:"menu",tabIndex:"-1","aria-labelledby":a,children:n.map((({name:o,title:i,available:a},s)=>(0,e.jsx)("li",{className:qa("options__menu__item"),role:"menuitem","data-testid":o,children:(0,e.jsxs)("button",{type:"button",ref:e=>{p.current[s]=e},className:qa(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(v(e)===g.ArrowDown){const n=Math.min(d-1,t+1);w(p.current[t===n?0:n]),e.preventDefault()}if(v(e)===g.ArrowUp){const n=Math.max(0,t-1);w(p.current[t===n?d-1:n]),e.preventDefault()}})(e,s),onKeyPress:e=>((e,t)=>{const r=String.fromCharCode(e.charCode);if(1!==r.length||!r.match(/\S/))return;let o=-1;n.forEach(((e,n)=>{n>t&&e.title.charAt(0).toLowerCase()===r.toLowerCase()&&-1===o&&(o=n)})),-1!==o&&w(p.current[o])})(e,s),onClick:()=>((e,t)=>{t&&(l(!1),r(e))})(o,a),"aria-disabled":a?null:"true",children:[(0,e.jsxs)("span",{className:qa("button__text"),children:[i,!a&&" "]}),!a&&(0,e.jsx)("span",{className:qa("button__state"),children:t("options.unavailableText")})]})},o)))})}),(0,e.jsxs)("button",{type:"button",className:qa(["button","button--secondary","chat__options__button",...!h&&m?[`chat__options__button--${m}`]:[]]),id:a,onClick:()=>{o&&i(),h?l((e=>!e)):y.available&&r(y.name)},onKeyDown:h?e=>{v(e)===g.ArrowDown&&(l(!0),e.preventDefault())}:null,ref:u,"aria-haspopup":h?"menu":null,"aria-expanded":h?c.toString():null,"aria-disabled":h||y.available?null:"true",children:[h&&(0,e.jsx)(ls,{name:"options",size:"32"}),(0,e.jsx)("span",{className:qa("button__text"),children:h?t("options.openButtonText"):`${y.title}${y.available?"":" "}`}),!h&&!y.available&&(0,e.jsx)("span",{className:qa("button__state"),children:t("options.unavailableText")})]})]}):null},du=({label:t,checked:n,description:r,onChange:o,id:i})=>(0,e.jsxs)("li",Object.assign({className:qa("translation-options__item",{"translation-options__item--checked":n})},{children:[(0,e.jsx)("input",{id:i,type:"radio",value:t,checked:n,className:qa("visually-hidden"),onChange:o,name:"language"}),(0,e.jsxs)("label",Object.assign({htmlFor:i},{children:[(0,e.jsx)(ls,{alt:"",name:"check",size:"16"}),t," ",r&&(0,e.jsxs)("span",{children:["(",r,")"]})]}))]})),pu=({onChange:t,describedById:n})=>{const{context:{locale:r}}=mr(),{t:o}=la(),{focusContainer:i}=Ha(),{languages:a,currentLocale:s,enableTranslations:c,disableTranslations:l}=za(),u=({locale:e})=>()=>{e===s||r===e?l():c(e),t(),i()},d=(0,Se.useMemo)((()=>[...a].sort(((e,t)=>e.locale===r?-1:t.locale===r?1:e.nativeName.localeCompare(t.nativeName,void 0,{sensitivity:"base"})))),[a,r]);return(0,e.jsx)("ul",Object.assign({"aria-describedby":n,className:qa("translation-options")},{children:d.map(((t,n)=>{const r=0===n,i=s===t.locale||!s&&r;return(0,e.jsx)(du,{id:t.locale,label:t.nativeName,checked:i,description:r&&o("translations.settings.original"),onChange:u(t)},t.locale)}))}))},fu=function({onClose:t,position:n}){const{t:r}=la(),o=Ua();return(0,e.jsx)(Al,Object.assign({onCancel:t,headingText:r("translations.menu.title"),cancelButtonText:r("translations.settings.cancelButtonText"),description:r("translations.menu.description"),descriptionId:o,position:n,disableButtonFocusing:!0},{children:(0,e.jsx)(pu,{describedById:o,onChange:t})}))};function hu({children:t,position:n={horizontal:"left",vertical:"top"},classNames:r}){const[o,i]=(0,Se.useState)(!1),a=(0,Se.useRef)(null),s=Ua();return(0,e.jsxs)("div",Object.assign({className:qa("translations__container"),onKeyDown:e=>{o&&v(e)===g.Escape&&(i(!1),w(a.current))}},{children:[(0,e.jsx)(El,Object.assign({onOutTransitionComplete:()=>{},onInTransitionComplete:()=>{},timeout:0,transitionStartState:Sl,isActive:o},{children:(0,e.jsx)("div",Object.assign({className:qa("options__dialog"),role:"dialog"},{children:(0,e.jsx)(fu,{onClose:()=>{i(!1)},position:n})}))})),(0,e.jsx)("button",Object.assign({type:"button",className:qa(["button","chat__options__button",...r]),id:s,onClick:()=>{i((e=>!e))},onKeyDown:e=>{v(e)===g.ArrowDown&&(i(!0),e.preventDefault())},ref:a,"aria-haspopup":"dialog","aria-expanded":o.toString()},{children:t}))]}))}function yu(){const{menuOptions:t,allowOptionSelection:n}=Ta(),{isAvailable:r}=za(),{hasInterrupt:o}=sl(),{t:i,locale:a}=la(),s=$a(a);if(!r&&(!n||!t.length)||o)return null;const c=i("translations.settings.openButtonText",{hasLanguage:!!s,language:s});return(0,e.jsxs)("div",{className:qa("chat__options"),children:[r&&(0,e.jsx)("div",{className:qa("chat__options-item","chat__options-item--left"),children:(0,e.jsxs)(hu,{classNames:["button--secondary"],children:[(0,e.jsx)(ls,{alt:c,name:"newTranslation",size:"16"}),(0,e.jsx)("span",{className:qa("button__text"),children:c})]})}),n&&(0,e.jsx)("div",{className:qa("chat__options-item","chat__options-item--right"),children:(0,e.jsx)(uu,{})})]})}const mu=()=>{const{scrollToRef:t,unreadIds:n}=(0,Se.useContext)(ml),{isMinimized:r}=Mi(),{t:o}=la();return(0,e.jsx)(El,Object.assign({isActive:!!n.length&&!r},{children:(0,e.jsx)("div",Object.assign({className:qa("unread-messages")},{children:(0,e.jsxs)("button",Object.assign({type:"button",className:qa("button","button--primary"),onClick:t},{children:[o("message.unreadMessagesCount",{unreadCount:n.length}),(0,e.jsx)(ls,{name:"chevronDown",size:"32",alt:""})]}))}))}))},bu=dr(wr,(e=>e.filter((e=>{var t;return Gr(e)&&"service_data"!==e.type&&(null===(t=e.payload)||void 0===t?void 0:t.messageStatus)===Qe})).map((e=>e.payload.id))));const gu=e=>{const t=(0,Se.useRef)(),[n,r]=(0,Se.useState)(!0),o=Le(bu),i=Or(),a=jr(),{isOpen:s}=Mi(),c=gr().loadedImageEventIds,l=Le((e=>e.state.isLastEventFromClient));(0,Se.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,Se.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 ma(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,Se.useEffect)((()=>{l&&u()}),[l,u]),(0,Se.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}},vu=({children:t})=>{const n=Or(),r=(0,Se.useMemo)((()=>n.reduce(((e,t)=>(e[t.payload.id]=(0,xe.createRef)(),e)),{})),[n]),{scrollToRef:o,scrollToBottom:i,containerRef:a,unreadIds:s}=gu(r);return(0,e.jsx)(ml.Provider,Object.assign({value:{eventRefs:r,unreadIds:s,scrollToRef:o,scrollToBottom:i,containerRef:a}},{children:(0,e.jsxs)("div",Object.assign({className:qa("chat__container")},{children:[(0,e.jsx)("div",Object.assign({className:qa("chat__container__scroll-area"),ref:a},{children:t})),(0,e.jsx)(mu,{})]}))}))},wu=({baseClassName:t,children:n,title:r})=>{const o=Sr(),i=Ua();return(0,e.jsxs)("section",{id:o,className:qa(t),"aria-describedby":i,tabIndex:"-1",children:[(0,e.jsx)("h2",{className:qa(`${t}__title`),id:i,children:r}),n]})},Ou=()=>{const{t}=la(),n=va(),r=Ia(),{emitEvent:o}=qi(),{isActive:i,remaining:a,timer:s,endCountdown:c}=Ma(),l=a>0,u=t(l?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,e.jsx)(wu,{baseClassName:"idle",title:u,children:l&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:qa("idle__count-container"),children:i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:qa("idle__count-text"),children:t("idleDetachWarning.countdownText")}),(0,e.jsx)("span",{className:qa("idle__count-timer"),children:t("idleDetachWarning.countdownTimer",s)})]})}),(0,e.jsxs)("div",{className:qa("idle__options"),children:[(0,e.jsx)("button",{type:"button",className:qa("button","button--primary"),onClick:()=>{r(),c(!0),n(),o("idleTimer.selectContinue")},children:t("idleDetachWarning.continueButton")}),(0,e.jsx)("button",{type:"button",className:qa("button","button--primary"),onClick:()=>{c(),n(),o("idleTimer.selectEnd")},children:t("idleDetachWarning.detachButton")})]})]})})},ju=()=>{const{t}=la(),n=Ia(),{name:r}=_r()||{},{continueChat:o,restartChat:i}=Ra();return(0,e.jsx)(wu,{baseClassName:"prompt",title:t("resumeConversationPrompt.title",{name:r}),children:(0,e.jsxs)("div",{className:qa("prompt__options"),children:[(0,e.jsx)("button",{type:"button",className:qa("button","button--primary"),onClick:()=>{n(),o()},children:t("resumeConversationPrompt.continueButton")}),(0,e.jsx)("button",{type:"button",className:qa("button","button--primary"),onClick:i,children:t("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 Su(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Cu=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:o}=gr().entryMeta,i=$e(),a=n||t||e,s=o[a]||r[a]||{},c=(0,Se.useCallback)((e=>{i(yo(e))}),[i]),l=(0,Se.useCallback)((e=>{i(fo(e))}),[i]),u=(0,Se.useCallback)((e=>{i(Io(e))}),[i]),d=(0,Se.useCallback)((()=>{n?u(null):l(e)}),[n,e,u,l]);return{activeEntry:a,activeEntryOptions:s,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:d,setBlockAutoEntrySwitch:c}};function _u({controlName:t,skipLinkId:n}){const{t:r}=la(),{sendAssertive:o}=da(),{emitEvent:i}=qi(),a=(()=>{const{sendAction:e}=qi(),{features:t}=Ta(),{typingPeekahead:n}=t||{},r=(0,Se.useRef)(null),o=(0,Se.useRef)(null),i=(0,Se.useRef)(!1),a=(0,Se.useRef)(null);(0,Se.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?xu(Object(n),!0).forEach((function(t){Su(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:et,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:s}=Cu(),{hasCharacterLimit:c,characterLimit:l,reachedCharacterWarning:u,reachedCharacterLimit:d,remainingChars:p}=function(e){const{t}=la(),{sendAssertive:n}=da(),{hasLimit:r,limit:o}=(()=>{const{entryMeta:{options:{text:e},optionsOverride:{text:t}}}=gr(),{limit:n}=t||e||{limit:null};return{hasLimit:null!==n,limit:null!==n?n:null}})(),i=(0,Se.useMemo)((()=>f(n,300)),[n]),a=(0,Se.useMemo)((()=>f(((e,n)=>{e&&i(t("input.srCharacterLimitText",{limit:n}))}),300)),[i,t]),[{value:s}]=Gl(e),c=r&&s?o-s.length:o,l=!!r&&c<=50,u=!!r&&c<0;return(0,Se.useEffect)((()=>{a(l,c)}),[l,c,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}(t),[{value:h}]=Gl(t),y=!!h,m=(0,Se.useCallback)((()=>{u&&o(r("input.srCharacterLimitText",{limit:p})),i("ui.inputFocus")}),[r,o,u,p,i]),b=(0,Se.useMemo)((()=>r("input.inputPlaceholder",{hasLimit:c,limit:c?l:null})),[r,c,l]),g=(0,Se.useMemo)((()=>r("input.inputLabel",{hasLimit:c,limit:c?l:null})),[r,c,l]);return(0,Se.useLayoutEffect)((()=>(s(y),()=>{s(!1)})),[s,y]),(0,e.jsxs)(Yl,{className:qa("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,e.jsxs)("div",{className:qa(["input--text__container",...u&&!d?["character-warning"]:[],...d?["character-exceeded"]:[]]),children:[(0,e.jsx)(iu,{id:n,type:"text",name:t,className:qa("input__text"),autocomplete:"off",placeholder:b,labelText:g,labelClass:qa("visually-hidden"),"aria-invalid":c?d:null,onKeyUp:a,onFocus:m}),(0,e.jsx)("div",{className:qa("character-count"),children:u&&(0,e.jsx)("span",{children:p})})]}),(0,e.jsx)("button",{className:qa("button","input__submit"),type:"submit",onPointerDown:e=>{e.preventDefault()},"aria-disabled":!y||d?"true":null,children:(0,e.jsx)(ls,{name:"send",size:"32",alt:r("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(t){let n=ku({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(t),t));const{isOpen:r,setVisibility:o}=Mi(),i=Sr(),a=va(),{sendMessage:s}=qi(),c=(0,Se.useCallback)(((e,{updateControlValue:t})=>{s({body:e.textMessageEntry}),t(Au,""),a(),r||o(hr.open)}),[s,a,r,o]);return(0,e.jsx)(Kl,Pu(Pu({},n),{},{formId:"textEntry",persistData:!0,onSubmit:c,children:(0,e.jsx)(_u,{controlName:Au,skipLinkId:i})}))}const Nu=()=>{const{t}=la(),{currentUploads:n}=Ca();return(0,e.jsx)("div",{className:qa("progress"),children:n.map((({id:n,name:r,progress:o,uploading:i,error:a})=>(0,e.jsxs)("div",{className:qa("progress_container"),children:[(0,e.jsxs)("div",{className:qa("progress__text"),children:[(0,e.jsx)("span",{className:qa("progress__text--file-name"),children:r}),(0,e.jsx)("span",{className:qa("progress__text--percentage"),children:`${o}%`})]}),(0,e.jsx)(Zl,{error:a}),(0,e.jsx)("progress",{className:qa("progress__bar"),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-label":t("fileUpload.srProgressLabel",{fileName:r}),max:"100","aria-valuenow":o,value:o,"aria-busy":i,children:`${o}%`})]},n)))})};function Du({id:t,name:n,labelText:r,contentHint:o,outputText:i,accept:a}){const{isSubmitted:s}=Wl(),[c,l]=(0,Se.useState)(!1),[{onInput:u,onBlur:d},{error:p}]=Gl(n),f=Ua(),h=Ua(),y=Ua(),m=s&&p,b=[y];o&&b.push(h),m&&b.push(f);const g=(0,Se.useCallback)((()=>{l(!0)}),[l]),v=(0,Se.useCallback)((()=>{l(!1),d()}),[l,d]),w=(0,Se.useCallback)((e=>{const t={target:{value:e.target.files}};u(t)}),[u]);return(0,e.jsxs)("div",{className:qa("upload__container"),children:[o&&(0,e.jsx)("span",{className:qa("upload__content-hint"),id:h,children:o}),(0,e.jsx)(Zl,{id:f,error:m&&p}),(0,e.jsx)("div",{className:qa(["file-upload",...c?["focus-within"]:[]]),children:(0,e.jsxs)("label",{htmlFor:t,className:qa("upload__label"),children:[(0,e.jsx)(ls,{name:"upload",size:"32"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:qa(["upload__label--text"]),children:r}),(0,e.jsx)("input",{id:t,className:qa("upload__input"),type:"file",name:n,onChange:w,"aria-invalid":m?"true":"false","aria-describedby":b.join(" "),accept:a||null,onFocus:g,onBlur:v}),(0,e.jsx)("span",{className:qa("upload__output"),"aria-hidden":"true",id:y,children:i})]})]})})]})}function Lu({skiplinkId:t,controlName:n,accept:r,contentHint:o,isUploading:i,isComplete:a,onClickCancel:s}){const{t:c}=la(),[{value:l}]=Gl(n),u=l&&l.length>0,d=u?l[0].name:"";return(0,e.jsxs)(Yl,{className:qa("upload-form"),children:[(0,e.jsx)(Du,{name:n,id:t,accept:r,labelText:c("fileUpload.labelText"),outputText:c("fileUpload.selectedText",{hasFile:u,filename:d}),contentHint:o}),(0,e.jsxs)("div",{className:qa("upload__button-container"),children:[(0,e.jsx)("button",{id:i||!a?t:void 0,type:"button",onClick:s,className:qa("button","button--secondary","upload__cancel"),children:c("fileUpload.cancelButtonText")}),(0,e.jsx)("button",{className:qa("button","button--primary"),type:"submit",children:c("fileUpload.uploadButtonText")})]})]})}const Mu="fileListForm",Ru="fileList",Uu=()=>{const{t}=la(),{sendPolite:n,sendAssertive:r}=da(),o=Sr(),i=va(),{serviceAllowsUploads:a,allowedMimeTypes:s,maxSize:c}=Sa(),l=(0,Se.useRef)(null),u=(0,Se.useRef)(a),{cancelEntrySelection:d}=Cu(),{uploadFile:p,clearUploads:f,isUploading:h,isComplete:y}=Ca(),{hasFile:b,selectedFileName:g,uploadHandle:v,hasServerError:w,progress:O}=((e,t)=>{const n=Le((n=>ql(n,{formId:e,name:t}))),{currentUploads:r}=Ca(),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}})(Mu,Ru),j=Ua(),x=(0,Se.useRef)(!0),S=t("fileUpload.contentHint",{size:m(c)}),C=(0,Se.useRef)(""),_=(0,Se.useRef)(null);(0,Se.useEffect)((()=>{C.current&&_.current?.contains(document.activeElement)&&"INPUT"===document.activeElement.tagName&&r(S),C.current=S}),[S,r]),(0,Se.useEffect)((()=>{O>0&&n(1===O?t("fileUpload.srStartedText"):`${O}%`)}),[O,n,t]),(0,Se.useEffect)((()=>{x.current||h||!y||(f(),d(),i(),setTimeout((()=>{n(t("fileUpload.srCompleteText"))}),300)),x.current=y}),[h,y,f,d,i,n,t]);const E=(0,Se.useCallback)((({fileList:e})=>{p(e[0]),i()}),[p,!1,i]),P=(0,Se.useCallback)((()=>{v&&v.abort(),f(),d(),i()}),[v,f,d,i]),T=(0,Se.useMemo)((()=>({[Ru]:[Il((()=>a),t("fileUpload.errors.unavailable")),Il(Dl,t("fileUpload.errors.noFile")),Il(Nl,t("fileUpload.errors.tooLarge"),c)]})),[c,a,t]);return(0,e.jsx)("div",{className:qa(["upload",...w?["upload--error"]:[]]),ref:_,children:(0,e.jsxs)(Kl,{formId:Mu,persistData:!0,onSubmit:E,validationSchema:T,children:[(h||!y)&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Nu,{}),(0,e.jsx)("div",{className:qa("upload__button-container"),children:(0,e.jsx)("button",{id:h||!y?o:void 0,type:"button",onClick:P,ref:l,className:qa("button","button--secondary","upload__cancel"),children:t("fileUpload.cancelButtonText")})})]}),!h&&y&&(0,e.jsx)(Lu,{controlName:Ru,skiplinkId:o,accept:s.join(", "),contentHint:S,isComplete:y,isUploading:h,outputText:t("fileUpload.selectedText",{hasFile:b,filename:g}),onClickCancel:P}),!u.current&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:qa("notification"),id:j,children:t("fileUpload.unavailableText")}),(0,e.jsx)("div",{className:qa("upload__button-container"),children:(0,e.jsx)("button",{id:h||!y?o:void 0,type:"button",onClick:P,className:qa("button","button--secondary","upload__cancel"),children:t("fileUpload.cancelButtonText")})})]})]})})},Fu=()=>{const{t}=la(),{showFileUpload:n,serviceAllowsUploads:r}=Sa(),[o,i]=(0,Se.useState)(r),a=va(),s=(0,Se.useRef)(null),{setUserEntryType:c,activeEntry:l}=Cu(),u=(0,Se.useRef)(null),{sendPolite:d}=da(),p=!!_r();return(0,Se.useEffect)((()=>{O(u.current,(()=>{r||a()})),i(r)}),[r,a]),(0,Se.useEffect)((()=>{s.current&&!r&&d(t("fileUpload.srUnavailableText")),!1===s.current&&r&&d(t("fileUpload.srAvailableText")),p&&(s.current=r)}),[r,p,d,t]),!n&&l!==Xe&&(0,e.jsx)(El,{isActive:o,transitionStartState:Cl,children:(0,e.jsx)("div",{className:qa("upload-toggle-wrapper"),children:(0,e.jsx)(El,{isActive:o,transitionStartState:_l,children:(0,e.jsx)("button",{className:qa(["button","button--secondary","upload-toggle"]),ref:u,"aria-disabled":o?null:"true",type:"button",onClick:o?()=>{c(Xe),a()}:null,children:(0,e.jsx)(ls,{name:"file",size:"32",alt:t("fileUpload.toggleButtonText")})})})})})};function zu(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 Bu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zu(Object(n),!0).forEach((function(t){Hu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const $u=()=>{const{isOpen:t}=Mi(),n=(0,Se.useRef)(null),{hasCountdown:r}=Ma(),[o,i]=(0,Se.useState)(r),{hasPrompt:a}=Ra(),[s,c]=(0,Se.useState)(a),l=va(),u=(0,Se.useRef)(!1),{activeEntry:d}=Cu(),[p,f]=(0,Se.useState)({text:Iu,upload:Uu}),[h,y]=(0,Se.useState)((()=>d)),m=mr(),{accountAllowsUploads:b}=Sa(),g=(0,Se.useCallback)((()=>{O(n.current,l)}),[l]);(0,Se.useEffect)((()=>{const{customComponents:e}=m,{entry:t}=e||{};t&&f((e=>Bu(Bu({},e),t)))}),[m]),(0,Se.useEffect)((()=>{g(),i(r),c(a)}),[r,a,g]),(0,Se.useEffect)((()=>{y(d),g()}),[d,g,n]),u.current=!(!n.current||!n.current.contains(document.activeElement));const v=p[h];return(0,e.jsxs)("div",{className:qa("chat__entry"),ref:n,children:[o&&(0,e.jsx)(Ou,{}),s&&(0,e.jsx)(ju,{}),(0,e.jsxs)("div",{className:qa(["entry__body",...r||a?["entry__body--hidden"]:[]]),children:[h!==Xe&&b&&t&&(0,e.jsx)(Fu,{}),(0,e.jsx)(v,{})]})]})},qu=()=>{const{t}=la(),{isOpen:n,closeChat:r}=Mi(),{isWindow:o}=Er();return n&&o?(0,e.jsx)("button",{type:"button",className:qa("button","collapse-button"),onClick:r,children:(0,e.jsx)(ls,{name:"chevronDown",size:"32",alt:t("window.srCollapseButton")})}):null},Vu=({children:t,handleClose:n,title:r,closeButtonText:o,srCloseButtonText:i,id:a})=>{const s=Ua();return(0,e.jsxs)("section",Object.assign({tabIndex:-1,id:a,"aria-labelledby":r?s:void 0,className:qa("chat-status",!r&&"chat-status--condensed")},{children:[(0,e.jsxs)("div",Object.assign({className:qa("chat-status__body")},{children:[r?(0,e.jsx)("h2",Object.assign({className:qa("chat-status__title"),id:s},{children:r})):null,t]})),"function"==typeof n&&(0,e.jsxs)("button",Object.assign({type:"button",onClick:n,className:qa("button","button--tertiary","chat-status__close")},{children:[o||(0,e.jsx)(ls,{name:"close",size:"16",alt:""}),i&&(0,e.jsx)("span",Object.assign({className:qa("visually-hidden")},{children:i}))]}))]}))};function Wu(){const{t}=la(),{id:n}=Ha(),{hasInterrupt:r}=sl(),{disableTranslations:o,currentLocale:i}=za(),a=$a(i),s=va(),c=t("translations.status.label",{language:a}),l=(0,Se.useCallback)((()=>{o(),s()}),[o,s]);return r?null:(0,e.jsx)(Vu,{handleClose:l,title:c,id:n,closeButtonText:t("translations.status.stopText"),srCloseButtonText:t("translations.status.srStopText")})}const Gu=({handleClick:t,icon:n,title:r,srButtonText:o})=>(0,e.jsxs)("button",Object.assign({type:"button",onClick:t,className:qa("button","button--primary","chat-status__button")},{children:[(0,e.jsx)(ls,{name:n,size:"16",alt:""}),r,o&&(0,e.jsx)("span",Object.assign({className:qa("visually-hidden")},{children:o}))]}));function Ku(){const{showProposal:t,translationProposal:n,dismissTranslationProposal:r,activateTranslationProposal:o}=(()=>{const{isActive:e,languages:t}=za(),n=$e(),{sendAction:r}=qi(),{translationProposal:o}=Le((e=>e.translations)),{enableTranslations:i}=za(),{isOpen:a}=Mi(),{locale:s}=la(),c=null==o?void 0:o.proposedLocale,l=$a(c),u=(0,Se.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,"translation_proposal")},dismissTranslationProposal:()=>{r({type:rt,body:{type:st}}),n(Ti())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:o}})(),{id:i}=Ha();return t?(0,e.jsx)(Vu,Object.assign({handleClose:r,srCloseButtonText:n.srDismissButtonText,id:i,title:n.titleLabel},{children:(0,e.jsx)(Gu,{handleClick:o,icon:"newTranslation",title:n.buttonLabel})})):null}function Ju(){const{hasInterrupt:t}=sl(),{isActive:n}=za();return t?null:n?(0,e.jsx)(Wu,{}):(0,e.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:t,interruptComponent:n}){const{hasInterrupt:r,meta:o}=sl(),{isOpen:i}=Mi();return r?i?(0,e.jsx)(n,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}({},o)):null:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(vu,{children:[(0,e.jsxs)("div",{className:qa("chat__container__header"),children:[(0,e.jsx)(Ju,{}),(0,e.jsx)(qu,{})]}),t]}),(0,e.jsx)($u,{}),i&&(0,e.jsx)(yu,{})]})},Zu=({originalError:t,title:n,message:r,buttonText:o,action:i,srText:a})=>{const s=qi(),c=Ua(),{sendPolite:l}=da(),u=va(),d="SeamlySessionExpiredError"===t.name;return(0,Se.useEffect)((()=>{d&&s[i]&&s[i]()}),[i,s,d]),(0,Se.useEffect)((()=>{!d&&a&&setTimeout((()=>{l(a)}),200)}),[l,a,d]),d?(0,e.jsx)(e.Fragment,{}):(0,e.jsxs)("section",{className:qa("interrupt"),"aria-labelledby":c,children:[(0,e.jsx)(qu,{}),(0,e.jsxs)("div",{className:qa("interrupt__body"),children:[(0,e.jsx)("h2",{id:c,className:qa("interrupt__title"),children:n}),(0,e.jsx)("p",{className:qa("interrupt__message"),children:r}),o&&i&&(0,e.jsx)("div",{className:qa("interrupt__actions"),children:(0,e.jsx)("button",{type:"button",className:qa("button","button--primary"),onClick:()=>{s[i]&&s[i](),u()},children:o})})]})]})};function ed({event:t}){const[n]=bl(t);return(0,e.jsx)(n,{event:t})}function td(){const{preChatEvents:t,layoutMode:n}=mr(),{hasInterrupt:r}=sl(),{isOpen:o}=Mi(),i=!(r||!t?.length||o);return i&&(0,e.jsx)("ul",{className:qa("pre-chat-messages",`pre-chat-messages--${n}`),"aria-hidden":!i,children:t.map((t=>(0,e.jsx)("li",{className:qa("pre-chat-messages__message"),children:(0,e.jsx)(ed,{event:t})},t.payload.id)))})}function nd(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 rd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const od=()=>{const t=function(){const{startChatIcon:e}=mr();return e}(),n=_r(),{hasInterrupt:r}=sl(),o=n&&!r,i=o?n.avatar:t;return i?(0,e.jsx)("img",{className:qa(o?"avatar":"icon"),src:i,alt:""}):(0,e.jsx)(ls,{name:"avatar",size:"32"})},id=({onClick:t})=>{const n=zi(),{t:r}=la(),o=n()?r("window.openButton.srContinue"):r("window.openButton.srStart"),i=va(),{isOpen:a}=Mi(),s=xr(),c=(0,Se.useCallback)((()=>{t(),i()}),[i,t]);return(0,e.jsx)(El,{isActive:!a,transitionStartState:Cl,children:(0,e.jsxs)("button",{className:qa("window-open-button"),"aria-label":o,"aria-hidden":a,onClick:c,children:[(0,e.jsx)("span",{className:qa("message-count"),"aria-hidden":"true",children:!!s&&s}),(0,e.jsx)(od,{})]})})},ad={app:()=>(0,e.jsx)(kl,{children:(0,e.jsx)(Yu,{interruptComponent:Zu,children:(0,e.jsx)(Ol,{})})}),inline:()=>{const{showInlineView:t,containerRef:n}=(()=>{const e=$e(),{connectWhenInView:t}=mr(),n=Le(kr),{containerRef:r,isVisible:o}=Ri({enabled:t,freezeOnceVisible:!0});return(0,Se.useEffect)((()=>{o&&e(Ni())}),[e,o]),{containerRef:r,showInlineView:n}})(),{isOpen:r}=Mi(),{hasInterrupt:o,meta:i}=sl();return o&&!r?(0,e.jsx)(Zu,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nd(Object(n),!0).forEach((function(t){rd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},i)):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(El,{isActive:!r,transitionStartState:Cl,children:(0,e.jsxs)("div",{ref:n,className:qa("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,e.jsx)(td,{}),(0,e.jsx)(Pl,{})]})}),(0,e.jsx)(El,{isActive:r,transitionStartState:Cl,children:(0,e.jsx)(kl,{ref:n,children:t&&(0,e.jsx)(Yu,{interruptComponent:Zu,children:r&&(0,e.jsx)(Ol,{})})})})]})},window:()=>{const{isOpen:t,openChat:n}=Mi(),r=Rr(),{t:o}=la(),i=o("window.chat.continue"),a=(0,Se.useMemo)((()=>({payload:{body:{text:i}}})),[i]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(id,{onClick:n}),(0,e.jsx)(El,{isActive:!t&&!r,transitionStartState:Cl,children:(0,e.jsx)("div",{className:qa("unstarted-wrapper","unstarted-wrapper--window"),children:(0,e.jsx)(td,{})})}),(0,e.jsx)(El,{isActive:!t&&r,transitionStartState:Sl,children:(0,e.jsx)("div",{className:qa("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,e.jsx)(Lc,{event:a})})}),(0,e.jsx)(El,{isActive:t,transitionStartState:Sl,children:(0,e.jsx)(kl,{children:(0,e.jsx)(Yu,{interruptComponent:Zu,children:(0,e.jsx)(Ol,{})})})})]})}},sd=({children:t})=>{const[,n]=ba(),{namespace:r,layoutMode:o,zIndex:i}=mr(),{isOpen:a,isVisible:s}=Mi(),c=ha(),l=Rr(),{locale:u}=la(),d=ad[o],p=(0,Se.useCallback)((e=>{n(e)}),[n]),f=(0,Se.useMemo)((()=>{if(u&&document.querySelector("html").getAttribute("lang")!==u)return u}),[u]);if(!d)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const h=["app",`app--layout-${o}`,`namespace--${r}`,...c];return a||"app"===o||h.push("app--collapsed"),l&&h.push("app--user-responded"),s&&(0,e.jsx)("div",{className:qa(h),lang:f,tabIndex:"-1","data-nosnippet":!0,style:{zIndex:i},ref:p,children:t||(0,e.jsx)(d,{})})};function cd(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 ld(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cd(Object(n),!0).forEach((function(t){ud(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ud(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const dd=t=>(0,e.jsx)(fl,ld(ld({},t),{},{children:(0,e.jsx)(sd,{})}));var pd=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 fd{constructor(e,t){const{namespace:n="",parentElement:r,showFaq:o}=e,i=pd(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 we({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 t=this.config.customComponents||{},{view:n}=t,r=pd(t,["view"]),o=Object.assign(Object.assign({},this.config),{customComponents:Object.keys(r).length?r:void 0}),i=function({initialState:e,api:t,eventBus:n,config:r}){return Bn({reducer:{state:Ro,app:Br,config:Vo,i18n:ui,translations:ki,visibility:Di,forms:ai,interrupt:Wr},preloadedState:e,middleware:e=>e({thunk:{extraArgument:{api:t,eventBus:n,config:r}},serializableCheck:!1}).concat([Jo({api:t}),pi({api:t}),mi({api:t}),Ai])})}({api:this.api,eventBus:this.eventBus,config:o,initialState:void 0});i.dispatch(Ho(o)),yield i.dispatch(rr());try{const{locale:e}=yield i.dispatch(Lr()).unwrap();yield i.dispatch(ir(e))}catch(e){}i.dispatch(Nr()),n?(0,xe.render)((0,e.jsx)(fl,Object.assign({eventBus:this.eventBus,store:i,api:this.api},{children:(0,e.jsx)(n,{})})),this.parentElement):(0,xe.render)((0,e.jsx)(dd,{config:o,eventBus:this.eventBus,store:i,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 hd(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 yd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hd(Object(n),!0).forEach((function(t){md(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function md(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const bd=e=>"object"==typeof e&&"action"in e,gd=e=>yd(yd({},e),{},{args:Array.isArray(e.args)?e.args:[e.args]}),vd=class{constructor(e){this._waitingActions=[],this._instances={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(bd).map(gd)).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=yd({},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 fd(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=yd(yd({},e.context||this.appConfig.context),this.context),n=this.getMergedVariables(e);Object.keys(n).length>0&&(t.variables=n);const r=yd(yd({},this.appConfig.defaults),e.defaults),o=yd(yd(yd({},this.appConfig),e),{},{api:yd(yd({},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 yd(yd(yd({},this.appConfig.context?.variables||{}),e.context?.variables||{}),this.context.variables||{})}},wd=()=>{const e=new URLSearchParams(window.location.search);return Array.from(e.entries()).reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n})),{})},Od=e=>new URLSearchParams(e).toString();function jd(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 xd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jd(Object(n),!0).forEach((function(t){Sd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Sd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Cd={direction:"to_translation_locale",locale:"nl",translatedBy:"deep_l",data:{}};function _d(e){switch(e.payload.type){case"cta":case"image":case"text":case"choice_prompt":return xd(xd({},e),{},{payload:xd(xd({},e.payload),{},{translatedBody:xd(xd({},Cd),{},{data:xd(xd({},e.payload.body),{},{text:e.payload.body.text?`NL - ${e.payload.body.text}`:void 0,description:e.payload.body.description?`NL - ${e.payload.body.description}`:void 0,buttonText:e.payload.body.buttonText?`NL - ${e.payload.body.buttonText}`:void 0,choices:e.payload.body.choices?e.payload.body.choices.map((e=>xd(xd({},e),{},{text:`NL - ${e.text}`}))):void 0,prompt:e.payload.body.prompt?xd(xd({},e.payload.body.prompt),{},{text:`NL - ${e.payload.body.prompt.text}`}):void 0})})})});default:return e}}const Ed=["headingText","category","description"];function Pd(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 Td(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pd(Object(n),!0).forEach((function(t){kd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function kd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ad={events:[],config:{layoutMode:"inline",accountConfig:{},hideOnNoUserResponse:!1,showFaq:!1,showDisclaimer:!1,showSuggestions:!0},initialState:{},unreadEvents:0,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1},resumeConversationPrompt:!1,visibility:{visibility:hr.open},serviceInfo:{activeServiceSessionId:""},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:"Test title",subTitle:"Test subtitle"},interrupt:{error:void 0},historyLoaded:!1,skiplinkTargetId:S(),optionsButtonId:S(),serviceData:{},options:{features:{},panelActive:!1,optionActive:"",userSelectedOptions:{}},entryMeta:{default:"text",active:"text",userSelected:null,options:{},optionsOverride:{}},currentUploads:[]},Id={participants:{agent:{id:"agent",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},user:{id:"user",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}}},currentAgent:"agent"},Nd={type:"info",payload:{body:{subtype:"new_topic",type:"divider"},fromClient:!1,fromHistory:!0,id:S(),transactionId:"_1y9pz5fbyly",type:"divider"}},Dd={type:"info",payload:{body:{language:"Nederlands",restartButtonText:null,subtype:"new_translation",text:"[NL] Automatic translation to Dutch started. Please note that automatic translations may contain errors.",title:"[NL] Translating to Dutch",translationEnabled:!0,translationLocale:"nl"},fromClient:!1,fromHistory:!0,id:S(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},Ld={type:"info",payload:{body:{language:"Nederlands",subtype:"new_translation",text:"[NL] Automatic translation to Dutch started. Please note that automatic translations may contain errors.",translationEnabled:!0,translationLocale:"nl"},fromClient:!1,fromHistory:!0,id:S(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},Md={type:"info",payload:{body:{language:"Nederlands",restartButtonText:"[NL] Start again",subtype:"new_translation",text:null,title:"[NL] Automatic translation to Dutch ended",translationEnabled:!1,translationLocale:"nl"},fromClient:!1,fromHistory:!0,id:S(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},Rd={type:"info",payload:{body:{text:"This is a system generated info message",type:"text"},fromClient:!1,id:S(),participant:null,service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:null,type:"text"}},Ud={type:"info",payload:{body:{key:["info","sendTranscript","accepted"],variables:{emailAddress:"test@test.com"}},fromClient:!1,id:S(),participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,type:"translation"}},Fd={title:"You're talking to",subTitle:"Mrs. Bot"},zd={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:S(),messageStatus:"received",participant:{avatar:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjNEE0OEMxIiBkPSJNMTAsMTQuOGMtMS4xLDAtMi0wLjktMi0yczAuOS0yLDItMnMyLDAuOSwyLDJTMTEuMSwxNC44LDEwLDE0Ljh6IE0xNS45LDE0LjhjMS4xLDAsMi0wLjksMi0ycy0wLjktMi0yLTIKCXMtMiwwLjktMiwyUzE0LjgsMTQuOCwxNS45LDE0Ljh6IE0yMS44LDEwLjhjLTEuMSwwLTIsMC45LTIsMnMwLjksMiwyLDJzMi0wLjksMi0yUzIyLjksMTAuOCwyMS44LDEwLjh6IE0yMS4zLDE4LjFIMTAuNwoJQzExLjcsMjMuOSwyMC4yLDIzLjksMjEuMywxOC4xeiIvPgo8L3N2Zz4K",id:"agent",introduction:"You're now talking to Mrs. Bot gimme a minit",name:"Mrs. Bot",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},transactionId:"d63655bf-1d3d-42cf-b14e-4da9e2b6a642",type:"participant"}},Bd={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:S(),messageStatus:"received",participant:{introduction:"Welcome, you are now chatting with Mrs. Bot 2, give me a minit to read back the chat history.",id:"agent",avatar:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjNEE0OEMxIiBkPSJNMTAuMSwxNC45Yy0xLjEsMC0yLTAuOS0yLTJzMC45LTIsMi0yczIsMC45LDIsMlMxMS4yLDE0LjksMTAuMSwxNC45eiBNMjEuOSwxMC45Yy0xLjEsMC0yLDAuOS0yLDIKCXMwLjksMiwyLDJzMi0wLjksMi0yUzIzLDEwLjksMjEuOSwxMC45eiBNMjEuNCwxOC4ySDEwLjhDMTEuOCwyNCwyMC4zLDI0LDIxLjQsMTguMnogTTE3LjIsMjUuM2gtMi40Yy0wLjYsMC0xLjIsMC40LTEuNCwxCgljLTUuMS0wLjItOS4yLTQuNC05LjQtOS42YzAuMSwwLDAuMiwwLjEsMC40LDAuMWgwLjFjMC44LDAsMS40LTAuNiwxLjQtMS40di00LjdjMC0wLjgtMC42LTEuNC0xLjQtMS40aDBjLTAuOCwwLTEuNCwwLjYtMS40LDEuNAoJdjIuN3YydjEuMWMwLDUuOSw0LjcsMTAuNiwxMC41LDEwLjhjMC4yLDAuNSwwLjcsMC44LDEuMiwwLjhoMi40YzAuOCwwLDEuNC0wLjYsMS40LTEuNFMxOCwyNS4zLDE3LjIsMjUuM3oiLz4KPC9zdmc+Cg==",name:"Two",service:{expose:{map:{},version:3},meta:{},name:"new service",serviceSessionId:S(),settings:{}}},transactionId:S(),type:"participant"}},Hd={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:S(),messageStatus:"received",participant:{id:"user",introduction:"You're now talking to Mrs. Bot gimme a minit",name:"Mrs. Bot",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},transactionId:"d63655bf-1d3d-42cf-b14e-4da9e2b6a642",type:"participant"}},$d=({type:e,data:t,text:n})=>({type:"message",payload:{body:{type:e,text:n,data:t},participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},fromClient:!1,fromHistory:!0,id:"4efacb4d-28a0-454e-8e36-3f17eb598c5d",messageStatus:"read",transactionId:"6f9beee7-ce82-418e-9bec-8001079aa769",transactionLast:!0,type:"custom"}}),qd={type:"message",payload:{body:{text:"What do you want to do?",type:"text"},fromClient:!1,fromHistory:!0,id:S(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!1,type:"text"}},Vd={type:"message",payload:{type:"splash",id:S(),body:{text:"Example splash message ✨",type:"text",variables:{}}}},Wd={type:"message",payload:{body:{description:"Thanks for chatting!\n\nMore info about our <strong>products</strong>?",buttonLink:"https://seamly.ai",buttonText:"View website",buttonNewTab:!0},type:"cta",fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792z",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1}},Gd={type:"message",payload:{body:{text:"What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am. What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am. What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am.",type:"text"},fromClient:!1,fromHistory:!0,id:S(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!1,type:"text"}},Kd={type:"message",payload:{body:{text:"Bubble with <strong>bold</strong> <em>italic</em> <u>underline</u>",type:"text"},fromClient:!1,fromHistory:!0,id:S(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},Jd={type:"message",payload:{body:{text:'<a href="https://google.com" data-link-id="1">Link in same window</a> and <a href="https://google.com" data-link-id="2" target="_blank">link in new window</a> embedded in text',type:"text"},fromClient:!1,fromHistory:!0,id:S(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},Xd={type:"message",payload:{body:{text:'Here is a long link <a href="https://google.com" data-link-id="1">click me click me please click me yoohoooo please please click me here I am click me now what are you waiting for click me now now now now now click meeeeeeeeeeeeee</a> embedded in text',type:"text"},fromClient:!1,fromHistory:!0,id:"a964e54e-ea98-46ff-a952-979a47f162c0",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},Qd={type:"message",payload:{body:{text:"<ul>\n<li>Bullets</li>\n<li>bullets</li>\n<li>bullets</li>\n</ul>\n",type:"text"},fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792a",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},Yd={type:"message",payload:{body:{description:"Plaatje",isZoomable:!1,type:"image",url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-square-small.jpg"},fromClient:!1,fromHistory:!0,id:"b44ef42c-880c-43ff-b067-499e7f2e81f7",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"image"}},Zd={type:"message",payload:{body:{description:"Plaatje",isZoomable:!0,type:"image",url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-portrait.jpg"},fromClient:!1,fromHistory:!0,id:"b44ef42c-880c-43ff-b067-499e7f2e81f8",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"image"}},ep={type:"message",payload:{body:{description:"test",source:"youtube",type:"video",url:"https://www.youtube.com/embed/K7Hn1rPQouU"},fromClient:!1,fromHistory:!0,id:S(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"video"}},tp={type:"message",payload:{body:{choices:[{id:"703db9b3-2157-4d4a-9f9b-c382c6a10531",text:"Dialog (this is intentionally made longer for testing purposes)",type:"choice"},{id:"1eff6098-f14f-4683-a2b8-30d1c573d45e",text:"T-Dialog",type:"choice"},{id:"a8ba3ce8-3324-4e7a-accc-944ff78ac890",text:"Customers",type:"choice"},{id:"c89956ab-cf98-4b7e-9282-7087c988153d",text:"Features",type:"choice"},{id:"9fd9a28f-462d-4f07-9661-606dbe3b9466",category:"secondary",text:"Something else",type:"choice"}],chooseAgain:!0,prompt:{text:"Type "start" at any time to see this menu again",type:"text",variables:{}},type:"choice_prompt"},fromClient:!1,fromHistory:!0,id:S(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!0,type:"choice_prompt"}},np={type:"message",payload:{body:{text:"This is what the user typed",type:"text"},fromClient:!0,fromHistory:!0,id:S(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},rp={type:"message",payload:{body:{text:"This is what the user typed. And sometimes the user has quite a lot to say and then we get longer lines that need to wrap well and not break the styling so here goes with just such a line right here!!",type:"text"},fromClient:!0,fromHistory:!0,id:S(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},op={type:"message",payload:{body:{text:'<a href="https://google.com" data-link-id="1">Link in same window</a> and <a href="https://google.com" data-link-id="2" target="_blank">link in new window</a> embedded in text',type:"text"},fromClient:!0,fromHistory:!0,id:S(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},ip={type:"upload",transactionId:"_vzhvnol0egf",meta:{},body:{contentType:"image/jpg",filename:"placeholder.jpg",filesize:991078,url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-square-small.jpg"}},ap={type:"message",payload:Td(Td({},ip),{},{fromClient:!1,participant:"agent",id:S()})},sp=Td(Td({},ap),{},{payload:Td(Td({},ap.payload),{},{body:Td({},ap.payload.body),id:S()})}),cp={type:"message",payload:Td(Td({},ip),{},{fromClient:!0,participant:"user",id:S()})},lp=Td(Td({},cp),{},{payload:Td(Td({},cp.payload),{},{id:S(),body:Td(Td({},cp.payload.body),{},{url:null})})}),up={isActive:!1,currentLocale:void 0,isAvailable:!1,showTranslationProposal:!1,languages:[],translatedEventGroups:{},containerId:S()},dp=[{id:"1",question:"Invoices",categories:["mixed","short"]},{id:"2",question:"Temporary subscription pause",categories:["mixed","medium"]},{id:"3",question:"Cancellation",categories:["mixed","short"]},{id:"4",question:"Apps",categories:["mixed","medium"]},{id:"5",question:"At what date will my subscription end?",categories:["mixed","long"]},{id:"A",question:"Quotes",categories:["short"]},{id:"B",question:"How to get in touch with us",categories:["long"]}],pp="unstarted",fp="messages",hp="errors",yp="uploads",mp="faq",bp="features",gp="options",vp="suggestions",wp="minimizedWindow",Op="minimizedInline",jp="translations",xp={[pp]:{heading:"Unstarted UI",description:"Test the loader here"},[fp]:{heading:"Messages",description:""},[hp]:{heading:"UI errors",description:""},[yp]:{heading:"File uploads",description:""},[mp]:{heading:"FAQ",description:""},[bp]:{heading:"Other features",description:""},[gp]:{heading:"Options",description:""},[vp]:{heading:"Suggestions",description:""},[wp]:{heading:"Minimized window",desciption:""},[Op]:{heading:"Minimized Inline",description:""},[jp]:{heading:"Translations",description:""}},Sp={type:"message",payload:{type:"card",id:S(),body:{action:{ask:"",type:"ask"},buttonText:"Ask about pizzas!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.\n\nIt is made with San Marzano tomatoes, mozzarella cheese, fresh basil, salt, and extra-virgin olive oil.",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-square.jpg",title:"Pizza Margherita"}}},Cp={type:"message",payload:{type:"card",id:S(),body:{action:{link:"https://seamly.ai",newTab:!0,type:"navigate"},buttonText:"Order now!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-landscape.jpg",title:"Pizza Margherita"}}},_p={type:"message",payload:{type:"card",id:S(),body:{action:{topic:"Set topic",type:"topic"},buttonText:"Set topic! (title & description optional)",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-portrait.jpg"}}},Ep={faqEmptyList:Td(Td({category:mp,headingText:"Empty FAQ list",description:""},Ad),{},{config:Td(Td({},Ad.config),{},{showFaq:!0}),serviceData:{suggestion:{body:[]}}}),faqList:Td(Td({category:mp,headingText:"FAQ list",description:""},Ad),{},{config:Td(Td({},Ad.config),{},{showFaq:!0}),serviceData:{suggestion:{body:[{id:1,question:"Lorem ipsum dolor sit amet",categories:["short"]},{id:2,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",categories:["short"]},{id:3,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam",categories:["short"]}]}}}),faqListLong:Td(Td({category:mp,headingText:"Long FAQ list",description:""},Ad),{},{config:Td(Td({},Ad.config),{},{showFaq:!0}),serviceData:{suggestion:{body:[{id:1,question:"Lorem ipsum dolor sit amet",categories:["long"]},{id:2,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",categories:["long"]},{id:3,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam",categories:["long"]},{id:4,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed",categories:["long"]},{id:5,question:"Lorem ipsum dolor sit amet",categories:["long"]},{id:6,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",categories:["long"]},{id:7,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam",categories:["long"]},{id:8,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed",categories:["long"]},{id:9,question:"Lorem ipsum dolor sit amet",categories:["long"]},{id:10,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",categories:["long"]},{id:11,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam",categories:["long"]},{id:12,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed",categories:["long"]},{id:13,question:"Lorem ipsum dolor sit amet",categories:["long"]},{id:14,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",categories:["long"]},{id:15,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam",categories:["long"]},{id:16,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed",categories:["long"]},{id:17,question:"Lorem ipsum dolor sit amet",categories:["long"]},{id:18,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",categories:["long"]},{id:19,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam",categories:["long"]},{id:20,question:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed",categories:["long"]}]}}})},Pp={base:Td(Td({category:pp,headingText:"Standard with loader",description:""},Ad),{},{isLoading:!0}),fullConversation:Td(Td({category:fp,headingText:"Full demo conversation",description:""},Ad),{},{participantInfo:Id,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[zd,Rd,qd,Td(Td({},tp),{},{payload:Td(Td({},tp.payload),{},{id:`${tp.payload.id}XXX`})}),Gd,Bd,np,Kd,op,Nd,Yd,ap,sp,rp,ep,Jd,Xd,Zd,cp,lp,Qd,tp,Wd]}),userMessages:Td(Td({category:fp,headingText:"User messages",description:""},Ad),{},{participantInfo:Id,events:[np,rp,cp,lp,op]}),withParticipants:Td(Td({category:fp,headingText:"Messages with participant info",description:""},Ad),{},{config:Td(Td({},Ad.config),{},{overrideMessages:{agent:{showAvatar:!0,showName:!0},user:{showName:!0,showAvatar:!0}}}),participantInfo:Id,events:[qd,np,Gd,rp]}),textMessages:Td(Td({category:fp,headingText:"Text messages",description:""},Ad),{},{participantInfo:Id,events:[qd,Gd,Kd,Jd,Xd,Qd]}),ctaMessages:Td(Td({category:fp,headingText:"CTA (call to action) messages",description:""},Ad),{},{participantInfo:Id,events:[Wd]}),imageVideoMessages:Td(Td({category:fp,headingText:"Download, image and video messages",description:""},Ad),{},{participantInfo:Id,events:[Yd,ep,Zd,ap]}),systemMessages:Td(Td({category:fp,headingText:"System messages",description:""},Ad),{},{config:{overrideMessages:{timeIndicator:{enabled:!0,threshold:36e5}}},participantInfo:Id,events:[{type:"message",payload:Td(Td({},qd.payload),{},{occurredAt:1e3*(Date.now()-432e6),id:S(),body:{text:"Long ago when a dialog started",type:"text"}})},zd,Hd,Bd,Nd,Ud,...[Dd,Md].map(_d),Rd]}),choicePromptMessages:Td(Td({category:fp,headingText:"Choice prompt messages",description:""},Ad),{},{participantInfo:Id,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[Td(Td({},tp),{},{payload:Td(Td({},tp.payload),{},{id:`${tp.payload.id}XXX`})}),qd,tp]}),timeIndicators:Td(Td({category:fp,headingText:"Time Indicators",description:""},Ad),{},{config:{overrideMessages:{timeIndicator:{enabled:!0,threshold:36e5}}},participantInfo:Id,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{type:"message",payload:Td(Td({},qd.payload),{},{occurredAt:1e3*(Date.now()-432e6),id:S(),body:{text:"Long ago when a dialog started",type:"text"}})},{type:"message",payload:Td(Td({},qd.payload),{},{occurredAt:1e3*(Date.now()-3456e5),id:S(),body:{text:"Above me should be a time indicator showing the full date",type:"text"}})},{type:"message",payload:Td(Td({},qd.payload),{},{occurredAt:1e3*(Date.now()+1-3456e5),id:S(),body:{text:"Another message",type:"text"}})},{type:"message",payload:Td(Td({},qd.payload),{},{occurredAt:1e3*(Date.now()+2-3456e5),id:S(),body:{text:"And another message",type:"text"}})},{type:"message",payload:Td(Td({},qd.payload),{},{occurredAt:1e3*(Date.now()-864e5),id:S(),body:{text:'Above me should be a time indicator showing "yesterday"',type:"text"}})},{type:"message",payload:Td(Td({},qd.payload),{},{occurredAt:1e3*(Date.now()+1-864e5),id:S(),body:{text:"Another message",type:"text"}})},{type:"message",payload:Td(Td({},qd.payload),{},{occurredAt:1e3*(Date.now()+2-864e5),id:S(),body:{text:"And another message",type:"text"}})},{type:"message",payload:Td(Td({},qd.payload),{},{occurredAt:1e3*Date.now(),id:S(),body:{text:"Above me should be a time indicator showing me the dialog continues today",type:"text"}})}]}),cards:Td(Td({category:fp,headingText:"Cards",description:""},Ad),{},{serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[Sp,Cp,_p]}),carousel:Td(Td({category:fp,headingText:"Carousel",description:""},Ad),{},{serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{type:"message",payload:{type:"carousel",id:S(),body:{cards:[Sp.payload.body,Cp.payload.body,_p.payload.body]}}}]}),errorWithAction:Td(Td({category:hp,headingText:"Error with a user action",description:""},Ad),{},{interrupt:{error:new u}}),errorWithoutAction:Td(Td({category:hp,headingText:"Error without a user action",description:""},Ad),{},{interrupt:{error:new Wo}}),privacyDisclaimer:Td(Td({category:bp,headingText:"Privacy disclaimer",description:""},Ad),{},{config:Td(Td({},Ad.config),{},{showDisclaimer:!0})}),chatStatusBar:Td(Td({category:bp,headingText:"Chat status bar",description:""},Ad),{},{translations:Td(Td({},up),{},{currentLocale:"nl",isActive:!0,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]})}),characterLimit:Td(Td({category:bp,headingText:"Input character limit",description:""},Ad),{},{entryMeta:{default:"text",active:"text",userSelected:null,options:{text:{limit:120}},optionsOverride:{}}}),fileUploadToggle:Td(Td({category:yp,headingText:"File upload toggle button",description:""},Ad),{},{options:Td(Td({},Ad.options),{},{features:{uploads:{enabled:!0}}})}),fileUploadToggleHidden:Td(Td({category:yp,headingText:"File upload toggle button hidden",description:""},Ad),{},{options:Td(Td({},Ad.options),{},{features:{uploads:{enabled:!1}}})}),fileUploadInput:Td(Td({category:yp,headingText:"File upload input",description:"Click on upload button to see an error",styleGuideReset:!0},Ad),{},{config:Td(Td({},Ad.config),{},{accountConfig:{features:{uploads:!0}}}),options:Td(Td({},Ad.options),{},{features:{uploads:{enabled:!0}}}),entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}}}),fileUploadBusy:Td(Td({category:yp,headingText:"File upload in progress",description:"",styleGuideReset:!0},Ad),{},{config:Td(Td({},Ad.config),{},{accountConfig:{features:{uploads:!0}}}),options:Td(Td({},Ad.options),{},{features:{uploads:{enabled:!0}}}),entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}},currentUploads:[{id:"_2olggurqhb4",name:"gGeyr3WepujbGn7khx.gif",progress:29,uploading:!0,complete:!1,error:"",uploadHandle:{abort:()=>{}}}]}),fileUploadError:Td(Td({category:yp,headingText:"File upload errored",description:"",styleGuideReset:!0},Ad),{},{config:Td(Td({},Ad.config),{},{accountConfig:{features:{uploads:!0}}}),options:Td(Td({},Ad.options),{},{features:{uploads:{enabled:!0}}}),entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}},currentUploads:[{id:"_2olggurqhb4",name:"gGeyr3WepujbGn7khx.gif",progress:0,uploading:!1,complete:!1,error:"Something went wrong with the upload",uploadHandle:{abort:()=>{}}}]}),idleTimerCountdown:Td(Td({category:bp,headingText:"Idle timer with countdown",description:""},Ad),{},{idleDetachCountdown:{hasCountdown:!0,isActive:!0,count:120,remaining:91,timer:{minutes:1,seconds:31}}}),idleTimerNoCountdown:Td(Td({category:bp,headingText:"Idle timer without countdown",description:""},Ad),{},{idleDetachCountdown:{hasCountdown:!0,isActive:!1,count:120,remaining:91,timer:{minutes:1,seconds:31}}}),resumeConversationPrompt:Td(Td({category:bp,headingText:"Resume conversation prompt",description:""},Ad),{},{participantInfo:Id,resumeConversationPrompt:!0}),optionsSingleTriggerAvailable:Td(Td({category:gp,headingText:"Single option available",description:""},Ad),{},{options:Td(Td({},Ad.options),{},{features:{sendTranscript:{enabled:!0}}})}),optionsSingleTriggerUnavailable:Td(Td({category:gp,headingText:"Single option",description:"Option unavailable"},Ad),{},{options:Td(Td({},Ad.options),{},{features:{sendTranscript:{enabled:!1}}})}),optionsMultiple:Td(Td({category:gp,headingText:"Multiple options",description:"All options available"},Ad),{},{options:Td(Td({},Ad.options),{},{features:{cobrowsing:{enabled:!0},sendTranscript:{enabled:!0}}})}),optionsMultipleUnavailable:Td(Td({category:gp,headingText:"Multiple options",description:"Some unavailable"},Ad),{},{options:Td(Td({},Ad.options),{},{features:{cobrowsing:{enabled:!1},sendTranscript:{enabled:!0}}})}),optionSendTranscript:Td(Td({category:gp,headingText:"Send transcript option",description:"Press submit to view error message"},Ad),{},{options:Td(Td({},Ad.options),{},{optionActive:"sendTranscript",panelActive:!0,features:{sendTranscript:{enabled:!0}}})}),translationsAvailable:Td(Td({category:jp,headingText:"Show translations available",description:""},Ad),{},{translations:Td(Td({},up),{},{isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]})}),translationsAvailableWithOptions:Td(Td({category:jp,headingText:"Show translations available with other options available",description:""},Ad),{},{options:Td(Td({},Ad.options),{},{features:{sendTranscript:{enabled:!0}}}),translations:Td(Td({},up),{},{isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"},{locale:"ar",nativeName:"Arabic"},{locale:"bg",nativeName:"Bulgarian"},{locale:"zh",nativeName:"Chinese"},{locale:"cs",nativeName:"Czech"},{locale:"da",nativeName:"Danish"},{locale:"et",nativeName:"Estonian"},{locale:"fi",nativeName:"Finnish"},{locale:"fr",nativeName:"French"},{locale:"de-informal",nativeName:"German"},{locale:"el",nativeName:"Greek"},{locale:"hu",nativeName:"Hungarian"},{locale:"it",nativeName:"Italian"},{locale:"ja",nativeName:"Japanese"},{locale:"lv",nativeName:"Latvian"},{locale:"pl",nativeName:"Polish"},{locale:"ro",nativeName:"Romanian"},{locale:"ru",nativeName:"Russian"},{locale:"sk",nativeName:"Slovak"},{locale:"sl",nativeName:"Slovenian"},{locale:"es-informal",nativeName:"Spanish"},{locale:"sv",nativeName:"Swedish"},{locale:"ti",nativeName:"Tigrinya"},{locale:"tr",nativeName:"Turkish"},{locale:"uk",nativeName:"Ukrainian"}]})}),translationsActive:Td(Td({category:jp,headingText:"Show translations active",description:""},Ad),{},{translations:Td(Td({},up),{},{currentLocale:"nl",isActive:!0,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]})}),translationsFullConversation:Td(Td({category:jp,headingText:"Show translated messages",description:""},Ad),{},{participantInfo:Id,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[Dd,Rd,qd,Td(Td({},tp),{},{payload:Td(Td({},tp.payload),{},{id:`${tp.payload.id}XXX`})}),Gd,np,Kd,Nd,Ld,Md,Yd,ap,sp,rp,ep,Jd,Xd,Zd,cp,lp,Qd,tp,Wd,Md].map(_d),translations:Td(Td({},up),{},{currentLocale:"nl",isActive:!0,isAvailable:!0,translatedEventGroups:{[Dd.payload.id]:[Rd,qd,Td(Td({},tp),{},{payload:Td(Td({},tp.payload),{},{id:`${tp.payload.id}XXX`})}),Gd,np,Kd,Nd].map((e=>e.payload.id)),[Ld.payload.id]:[Yd,ap,sp,rp,ep,Jd,Xd,Zd,cp,lp,Qd,tp,Wd].map((e=>e.payload.id))},languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]})}),translationProposal:Td(Td({category:jp,headingText:"Show translation proposal",description:""},Ad),{},{events:[qd,np,rp],config:Td(Td({},Ad.config),{},{showDisclaimer:!0,context:{locale:"nl-informal"}}),translations:Td(Td({},up),{},{translationProposal:{buttonLabel:"Activate",proposedLocale:"en-GB",srDismissButtonText:"Dismiss translation proposal",titleLabel:"Do you want to chat in English?"},isAvailable:!0,isActive:!1,languages:[{locale:"nl-informal",nativeName:"Dutch"},{locale:"en-GB",nativeName:"English"}]})}),translationProposalWithoutTitle:Td(Td({category:jp,headingText:"Show translation proposal without title",description:""},Ad),{},{events:[qd,np,rp],config:Td(Td({},Ad.config),{},{showDisclaimer:!0,context:{locale:"nl-informal"}}),translations:Td(Td({},up),{},{translationProposal:{buttonLabel:"Activate",proposedLocale:"en-GB",srDismissButtonText:"Dismiss translation proposal"},isAvailable:!0,isActive:!1,languages:[{locale:"nl-informal",nativeName:"Dutch"},{locale:"en-GB",nativeName:"English"}]})})},Tp={minimizedInline:{category:Op,headingText:"Inline minimized",description:"",inline:Td(Td({},Ad),{},{config:Td(Td({},Ad.config),{},{layoutMode:"inline"}),visibility:Td(Td({},Ad.visibility),{},{visibility:hr.minimized})})},minimizedInlineCharacterLimit:{category:Op,headingText:"Inline minimized with limited characters",description:"",inline:Td(Td({},Ad),{},{config:Td(Td({},Ad.config),{},{layoutMode:"inline"}),visibility:Td(Td({},Ad.visibility),{},{visibility:hr.minimized}),entryMeta:Td(Td({},Ad.entryMeta),{},{options:{text:{limit:120}}})})},minimizedInlinePrechat:{category:Op,headingText:"Inline minimized with pre-chat messages",description:"",inline:Td(Td({},Ad),{},{config:Td(Td({},Ad.config),{},{layoutMode:"inline",preChatEvents:[Vd]}),visibility:Td(Td({},Ad.visibility),{},{visibility:hr.minimized})})},minimizedInlinePrechatSuggestions:{category:Op,headingText:"Inline minimized with pre-chat messages & suggestions",description:"",inline:Td(Td({},Ad),{},{config:Td(Td({},Ad.config),{},{layoutMode:"inline",preChatEvents:[Vd]}),serviceData:{suggestion:{body:dp}},visibility:Td(Td({},Ad.visibility),{},{visibility:hr.minimized})})},inlineWithSuggestions:{category:vp,headingText:"Suggestions",description:"",inline:Td(Td({},Ad),{},{config:Td(Td({},Ad.config),{},{layoutMode:"inline",showFaq:!0}),visibility:Td(Td({},Ad.visibility),{},{visibility:hr.open}),serviceData:{suggestion:{body:dp}}})},minimizedInlineWithError:{category:Op,headingText:"Inline minimized with error",description:"",inline:Td(Td({},Ad),{},{config:Td(Td({},Ad.config),{},{layoutMode:"inline"}),visibility:Td(Td({},Ad.visibility),{},{visibility:hr.minimized}),interrupt:{error:new Wo}})}},kp={minimizedWindow:{category:wp,headingText:"Unstarted minimized",description:"",window:Td(Td({},Ad),{},{config:Td(Td({},Ad.config),{},{layoutMode:"window"}),visibility:Td(Td({},Ad.visibility),{},{visibility:hr.minimized})})},minimizedWindowStarted:{category:wp,headingText:"Started minimized",description:"",window:Td(Td({},Ad),{},{config:Td(Td({},Ad.config),{},{layoutMode:"window"}),visibility:Td(Td({},Ad.visibility),{},{visibility:hr.minimized}),participantInfo:Id,headerTitles:Fd})},minimizedWindowStartedUnread:{category:wp,headingText:"Minimized with unread messages",description:"",window:Td(Td({},Ad),{},{config:Td(Td({},Ad.config),{},{layoutMode:"window"}),visibility:Td(Td({},Ad.visibility),{},{visibility:hr.minimized}),participantInfo:Id,headerTitles:Fd,unreadEvents:12})}},Ap={suggestionsMessage:Td(Td({category:fp,headingText:"Suggestions message",description:""},Ad),{},{events:[$d(qd.payload.body),{type:"service_data",payload:{type:"suggestion",body:dp}}]})},Ip=(e,t=[],n)=>{const r=Td(Td(Td({},n?Td(Td({},Pp),{},{fullConversation:Td(Td({},Pp.fullConversation),{},{events:[Vd,...Pp.fullConversation.events]})}):Pp),n?Ap:Ep),t.reduce(((e,t)=>{const{key:n,headingText:r,description:o,body:i}=t;return Td(Td({},e),{},{[n]:Td(Td({category:fp,headingText:r,description:o},Ad),{},{participantInfo:Id,events:[$d(i)]})})}),{}));return Object.keys(r).reduce(((t,n)=>{const o=r[n],{headingText:i,category:a,description:s}=o,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}(o,Ed);return Td(Td({},t),{},{[n]:Td({headingText:i,description:s,category:a},e.reduce(((e,t)=>Td(Td({},e),{},{[t]:Td(Td({},c),{},{config:Td(Td({},c.config),{},{layoutMode:t})})})),{}))})}),{})},Np=(e,t)=>Td(Td({},Ip(e,t)),-1!==e.indexOf("window")?kp:{}),Dp=(e,t)=>Td(Td(Td({},Ip(e,t,!0)),-1!==e.indexOf("window")?Td(Td({},kp),{},{minimizedWindowPrechat:{category:wp,headingText:"Minimized with pre-chat messages",description:"",window:Td(Td({},Ad),{},{config:Td(Td({},Ad.config),{},{layoutMode:"window",preChatEvents:[Vd]}),visibility:Td(Td({},Ad.visibility),{},{visibility:hr.minimized}),participantInfo:Id,headerTitles:Fd})}}):{}),Tp),Lp=["headingText","descriptionId","description"];function Mp(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 Up=({setSelectedState:t,states:n,headingLevel:r})=>{const o=`h${r.toString()}`,i=`h${(parseInt(r,10)+1).toString()}`,a=wd();return(0,e.jsx)("nav",{"aria-label":"Style guide navigation",className:"nav--styleguide",children:(0,e.jsx)("ol",{className:"list--styleguidestates",children:Object.keys(xp).map((r=>{const{heading:s,description:c}=xp[r],l=Object.keys(n).filter((e=>{const{category:t}=n[e];return t===r}));return l.length>0&&(0,e.jsxs)("li",{children:[(0,e.jsx)(o,{children:s}),(0,e.jsx)("span",{className:"category__description",children:c}),(0,e.jsx)("ol",{children:l.map((r=>{const o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mp(Object(n),!0).forEach((function(t){Rp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n[r]);delete o.category;const{headingText:s,descriptionId:c,description:l}=o,u=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}(o,Lp);return(0,e.jsxs)("li",{children:[(0,e.jsx)(i,{id:c,children:s}),l&&(0,e.jsx)("span",{className:"feature__description",children:l}),(0,e.jsx)("ul",{className:"list--styleguidelayouts",children:Object.keys(u).map((n=>(0,e.jsx)("li",{className:n===a?.layoutMode&&r===a?.feature?"state__selected":null,children:(0,e.jsx)("a",{"aria-describedby":c,href:`${window.location.pathname}?${Od({layoutMode:n,feature:r})}`,"aria-current":n===a?.layoutMode&&r===a?.feature?"page":null,onClick:e=>{var o;e.preventDefault(),"inline"===n&&window.scroll({top:document.querySelector(".cvco-app").offsetTop,behavior:"smooth"}),o={layoutMode:n,feature:r},window.history.pushState(null,null,`${window.location.pathname}?${Od(o)}`),t(o)},children:n.charAt(0).toUpperCase()+n.slice(1)})},n)))})]},r)}))})]},r)}))})})},Fp=require("@seamly/web-ui"),zp=["translations","interrupt","config","visibility"];const Bp={send:()=>{},reset:()=>Promise.resolve({}),store:{get:()=>{},set:()=>{}},hasConversation:()=>!1,connected:!1,ready:!1},Hp=({state:t,translations:n,participants:r=[],children:o})=>{const i=(0,Se.useRef)((()=>{})),a=(0,Se.useRef)({emit:()=>{}}),s=(0,Se.useMemo)((()=>{const e=t||{},{translations:o,interrupt:i,config:s={},visibility:c}=e,l=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,zp),u=Bn({reducer:{state:Ro,app:Br,config:Vo,i18n:ui,translations:ki,visibility:Di,forms:ai,interrupt:Wr},preloadedState:{state:l,config:s,translations:o,interrupt:i,visibility:c},middleware:e=>e({thunk:{extraArgument:{api:Bp,eventBus:a.current}},serializableCheck:!1})}),{config:d}=u.getState();return u.dispatch(Ho(d)),d.preChatEvents&&u.dispatch(qo(d.preChatEvents)),u.dispatch(ci("en-GB")),u.dispatch(li(n)),r.forEach((e=>{u.dispatch(Co({participant:e,fromClient:"user"===e.id}))})),u}),[r,t,n]);return t&&(0,e.jsx)(Fp.SeamlyStoreProvider,{store:s,children:(0,e.jsx)(Fp.SeamlyEventBusContext.Provider,{value:a.current,children:(0,e.jsx)(Fp.SeamlyLiveRegionContext.Provider,{value:i.current,children:(0,e.jsx)(Fp.SeamlyApiContext.Provider,{value:Bp,children:(0,e.jsx)(Fp.ComponentFilter,{children:o})})})})})},$p=({state:t,customComponents:n={},translations:r,participants:o})=>{const[i,a]=(0,Se.useState)(!0),{config:s}=t||{},{layoutMode:c}=s||{},l=n[c];return(0,Se.useEffect)((()=>{a(!1),requestAnimationFrame((async()=>{await ma(60),a(!0)}))}),[t]),i?l?(0,e.jsx)(Hp,{state:t,translations:r,participants:o,children:(0,e.jsx)(l,{})}):(0,e.jsx)(Hp,{state:t,translations:r,participants:o,children:(0,e.jsx)(sd,{})}):null};function qp(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 Vp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qp(Object(n),!0).forEach((function(t){Wp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Gp=({config:t,styleGuideConfig:n,translations:r,headingLevel:o=2,participants:i})=>{const[a,s]=(0,Se.useState)(null),[c,l]=(0,Se.useState)(""),[u,d]=(0,Se.useState)(!0),[p]=(0,Se.useState)(S()),{stateUpdateCallback:f,customMessageEventBodies:h}=n,y=t.isDeprecated?Np:Dp,[m]=(0,Se.useState)((()=>{const e=y(n.showLayoutModes||["inline","window"],h);return Object.keys(e).reduce(((t,n)=>Vp(Vp({},t),{},{[n]:Vp(Vp({},e[n]),{},{descriptionId:S()})})),{})})),b=(0,Se.useCallback)((e=>{s(f?f(e):e)}),[s,f]),g=(0,Se.useCallback)(((e,n)=>{const r=((...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}),{})})("apiKey","locale"),o=new URLSearchParams(Vp(Vp({},r),{},{layoutMode:e,feature:n}));window.history.replaceState(null,null,`?${o}`);const{headingText:a}=m[n];l(a);const s=m[n][e],{overrideMessages:c,showFaq:u,showSuggestions:d}=s.config,p=i.find((e=>"agent"===e.id));return Vp(Vp({},s),{},{config:Vp(Vp(Vp(Vp({},s.config),t),{},{showDisclaimer:s.config.showDisclaimer||t.showDisclaimer,context:Vp(Vp({},t.context),s.config?.context),layoutMode:s.config.layoutMode},c?{messages:c}:{}),{},{showFaq:u,showSuggestions:d}),headerTitles:Vp(Vp({},s.headerTitles),{},{subTitle:p?.name||s.headerTitles.subTitle})})}),[m,i,t]);(0,Se.useEffect)((()=>{if(u){const e=document.querySelector('[aria-modal="true"]');e&&e.addEventListener("click",(()=>{s((e=>Vp(Vp({},e),{},{visibility:Vp(Vp({},e.visibility),{},{visible:"minimized"})})))}))}}),[a,s,u]);const v=(0,Se.useCallback)((()=>{const e=wd(),{layoutMode:t="inline",feature:n="base"}=e;b(g(t,n)),window.title="Style"}),[g,b]);(0,Se.useEffect)((()=>{v()}),[v]),(0,Se.useEffect)((()=>{window.onpopstate=()=>{v()}}),[v]);const w=`h${o.toString()}`;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("section",{className:"chat-inline","aria-labelledby":p,children:[(0,e.jsxs)(w,{id:p,children:[(0,e.jsx)("span",{className:"heading__context",children:"Current selected state:"}),`${c}`]}),(0,e.jsx)("div",{children:u&&(0,e.jsx)($p,{customComponents:n.customComponents,translations:r,state:a,participants:i})})]}),(0,e.jsx)("aside",{className:"page-aside markdown",children:(0,e.jsx)("nav",{className:"page-controls",children:(0,e.jsx)(Up,{headingLevel:o,setSelectedState:({layoutMode:e,feature:t})=>{const n=g(e,t);b(n),n.styleGuideReset&&(d(!1),setTimeout((()=>{d(!0)})))},states:m})})})]})},Kp=["styleGuideConfig"];function Jp(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 Xp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jp(Object(n),!0).forEach((function(t){Qp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yp=class extends fd{constructor(e,t){let{styleGuideConfig:n}=e;super(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,Kp),t),this.styleGuideConfig=n||{}}async render(){const t=Xp(Xp({},this.config.customComponents||{}),{},{view:void 0}),n=new we({namespace:this.config.namespace,config:this.config.api,context:this.config.context});n.URLS={translations:`/client/${this.config.api.key}/translations/{version}/{locale}.json`};const r=await n.getTranslations(this.config.context.locale||"en-GB"),{agentParticipant:o,userParticipant:i}=await n.getConfig(),a=[Xp({id:"user"},i),Xp({id:"agent",introduction:"I am {{name}}"},o)],s=Xp(Xp({},this.config),{},{customComponents:Object.keys(t).length?t:void 0});(0,xe.render)((0,e.jsx)(Gp,{config:s,styleGuideConfig:this.styleGuideConfig,translations:r,participants:a}),this.parentElement)}},Zp=["userStyleGuideConfig"];function ef(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 tf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ef(Object(n),!0).forEach((function(t){nf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ef(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rf=class extends vd{constructor(e,t){super(e),this.styleGuideConfig=t}createInstance(e){const{userStyleGuideConfig: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,Zp);return new Yp(tf({styleGuideConfig:tf(tf({},this.styleGuideConfig),t)},n),this)}getUserConfig(e={},t){return super.getUserConfig(tf(tf({},e),{},{userStyleGuideConfig:t}))}},of=function(e,t){if(window.seamlyStyleGuide&&!Array.isArray(window.seamlyStyleGuide))throw new Error("Seamly UI has already been initialised. Use the window.seamly object to start new instances instead.");const n=Array.isArray(window.seamlyStyleGuide)?window.seamlyStyleGuide:[],r=new rf(e,t);window.seamly=r,window.seamlyStyleGuide={push:r.push.bind(r)},r.push(...n)}})(),module.exports=r})();
|