@seamly/web-ui 20.1.0-alpha.1 → 20.2.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/lib/deprecated-view.css +1 -1
- package/build/dist/lib/index.debug.js +135 -135
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.js +107 -48
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +107 -48
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +53 -28
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/styles-default-implementation.css +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/package.json +2 -2
- package/src/javascripts/api/errors/seamly-base-error.js +1 -0
- package/src/javascripts/api/index.js +26 -20
- package/src/javascripts/api/producer.js +3 -3
- package/src/javascripts/domains/app/actions.js +17 -8
- package/src/javascripts/domains/app/hooks.js +1 -1
- package/src/javascripts/domains/app/utils.js +1 -1
- package/src/javascripts/domains/config/hooks.js +1 -1
- package/src/javascripts/domains/config/reducer.js +3 -3
- package/src/javascripts/domains/config/selectors.js +1 -1
- package/src/javascripts/domains/config/utils.js +1 -1
- package/src/javascripts/domains/errors/index.js +2 -2
- package/src/javascripts/domains/forms/hooks.js +1 -1
- package/src/javascripts/domains/forms/provider.js +5 -3
- package/src/javascripts/domains/forms/reducer.js +1 -1
- package/src/javascripts/domains/forms/selectors.js +1 -1
- package/src/javascripts/domains/forms/utils.js +1 -1
- package/src/javascripts/domains/i18n/actions.js +1 -1
- package/src/javascripts/domains/i18n/hooks.js +1 -1
- package/src/javascripts/domains/i18n/reducer.js +1 -1
- package/src/javascripts/domains/i18n/utils.js +1 -1
- package/src/javascripts/domains/interrupt/hooks.js +2 -2
- package/src/javascripts/domains/interrupt/middleware.js +6 -6
- package/src/javascripts/domains/interrupt/reducer.js +1 -1
- package/src/javascripts/domains/interrupt/utils.js +1 -1
- package/src/javascripts/domains/options/middleware.js +1 -1
- package/src/javascripts/domains/store/index.js +10 -10
- package/src/javascripts/domains/store/state-reducer.js +3 -3
- package/src/javascripts/domains/translations/components/chat-status.js +5 -5
- package/src/javascripts/domains/translations/components/options-button.js +6 -6
- package/src/javascripts/domains/translations/components/options-dialog/form.js +5 -5
- package/src/javascripts/domains/translations/components/options-dialog/index.js +7 -7
- package/src/javascripts/domains/translations/hooks.js +3 -3
- package/src/javascripts/domains/translations/middleware.js +2 -2
- package/src/javascripts/domains/translations/reducer.js +3 -3
- package/src/javascripts/domains/translations/selectors.js +1 -1
- package/src/javascripts/domains/translations/utils.js +1 -1
- package/src/javascripts/domains/visibility/actions.js +3 -3
- package/src/javascripts/domains/visibility/hooks.js +1 -1
- package/src/javascripts/domains/visibility/utils.js +7 -1
- package/src/javascripts/lib/css.js +1 -1
- package/src/javascripts/lib/engine/index.js +6 -5
- package/src/javascripts/lib/external-api/index.js +28 -2
- package/src/javascripts/lib/redux-helpers/index.js +1 -1
- package/src/javascripts/style-guide/components/app.js +1 -1
- package/src/javascripts/style-guide/components/links.js +1 -1
- package/src/javascripts/style-guide/components/static-core.js +8 -8
- package/src/javascripts/ui/components/app-options/index.js +4 -4
- package/src/javascripts/ui/components/chat-status/index.js +2 -2
- package/src/javascripts/ui/components/conversation/component-filter.js +1 -1
- package/src/javascripts/ui/components/conversation/conversation.js +6 -6
- package/src/javascripts/ui/components/conversation/event/card-component.js +4 -4
- package/src/javascripts/ui/components/conversation/event/card-message.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js +1 -1
- package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-message/index.js +3 -3
- package/src/javascripts/ui/components/conversation/event/choice-prompt.js +7 -7
- package/src/javascripts/ui/components/conversation/event/cta.js +6 -6
- package/src/javascripts/ui/components/conversation/event/divider/index.js +1 -1
- package/src/javascripts/ui/components/conversation/event/divider/variants/default.js +3 -3
- package/src/javascripts/ui/components/conversation/event/divider/variants/new-translation.js +4 -4
- package/src/javascripts/ui/components/conversation/event/divider/variants/time-indicator.js +5 -5
- package/src/javascripts/ui/components/conversation/event/event-participant.js +4 -4
- package/src/javascripts/ui/components/conversation/event/event.js +2 -2
- package/src/javascripts/ui/components/conversation/event/hooks/use-event-link-click-handler.js +2 -2
- package/src/javascripts/ui/components/conversation/event/hooks/use-formatted-date.js +3 -3
- package/src/javascripts/ui/components/conversation/event/image-lightbox.js +4 -4
- package/src/javascripts/ui/components/conversation/event/image.js +2 -2
- package/src/javascripts/ui/components/conversation/event/participant.js +4 -4
- package/src/javascripts/ui/components/conversation/event/text.js +3 -3
- package/src/javascripts/ui/components/conversation/event/translation.js +3 -3
- package/src/javascripts/ui/components/conversation/event/upload.js +5 -5
- package/src/javascripts/ui/components/conversation/event/video.js +4 -4
- package/src/javascripts/ui/components/conversation/event-divider.js +2 -2
- package/src/javascripts/ui/components/conversation/loader.js +2 -2
- package/src/javascripts/ui/components/conversation/message-container.js +4 -4
- package/src/javascripts/ui/components/core/seamly-activity-monitor.js +3 -3
- package/src/javascripts/ui/components/core/seamly-core.js +2 -2
- package/src/javascripts/ui/components/core/seamly-event-subscriber.js +8 -8
- package/src/javascripts/ui/components/core/seamly-file-upload.js +4 -4
- package/src/javascripts/ui/components/core/seamly-idle-detach-counter.js +2 -2
- package/src/javascripts/ui/components/core/seamly-initializer.js +2 -2
- package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +5 -5
- package/src/javascripts/ui/components/core/seamly-live-region.js +2 -2
- package/src/javascripts/ui/components/core/seamly-new-notifications.js +5 -5
- package/src/javascripts/ui/components/core/seamly-read-state.js +6 -6
- package/src/javascripts/ui/components/entry/deprecated-toggle-button.js +5 -5
- package/src/javascripts/ui/components/entry/entry-container.js +8 -8
- package/src/javascripts/ui/components/entry/text-entry/hooks.js +6 -6
- package/src/javascripts/ui/components/entry/text-entry/index.js +2 -2
- package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +8 -8
- package/src/javascripts/ui/components/entry/upload/file-upload-form.js +5 -5
- package/src/javascripts/ui/components/entry/upload/index.js +10 -10
- package/src/javascripts/ui/components/entry/upload-toggle.js +9 -9
- package/src/javascripts/ui/components/faq/faq.js +16 -16
- package/src/javascripts/ui/components/form-controls/error.js +2 -2
- package/src/javascripts/ui/components/form-controls/file-input.js +4 -4
- package/src/javascripts/ui/components/form-controls/form.js +2 -2
- package/src/javascripts/ui/components/form-controls/input.js +1 -1
- package/src/javascripts/ui/components/form-controls/select.js +1 -1
- package/src/javascripts/ui/components/form-controls/wrapper.js +1 -1
- package/src/javascripts/ui/components/layout/agent-info.js +6 -6
- package/src/javascripts/ui/components/layout/chat-frame.js +5 -5
- package/src/javascripts/ui/components/layout/deprecated-app-frame.js +7 -7
- package/src/javascripts/ui/components/layout/header.js +3 -3
- package/src/javascripts/ui/components/layout/icon.js +1 -1
- package/src/javascripts/ui/components/layout/interrupt.js +3 -3
- package/src/javascripts/ui/components/layout/privacy-disclaimer.js +3 -3
- package/src/javascripts/ui/components/options/options-button.js +7 -12
- package/src/javascripts/ui/components/options/options-frame.js +4 -4
- package/src/javascripts/ui/components/options/options.js +1 -1
- package/src/javascripts/ui/components/options/transcript/index.js +8 -8
- package/src/javascripts/ui/components/options/transcript/transcript-form.js +4 -4
- package/src/javascripts/ui/components/warnings/idle-detach-warning.js +6 -6
- package/src/javascripts/ui/components/warnings/prompt.js +2 -2
- package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +5 -5
- package/src/javascripts/ui/components/widgets/in-out-transition.js +3 -3
- package/src/javascripts/ui/components/widgets/lightbox.js +5 -5
- package/src/javascripts/ui/components/widgets/modal.js +2 -2
- package/src/javascripts/ui/components/widgets/upload-progress.js +4 -4
- package/src/javascripts/ui/hooks/component-helper-hooks.js +1 -1
- package/src/javascripts/ui/hooks/file-upload-hooks.js +2 -2
- package/src/javascripts/ui/hooks/focus-helper-hooks.js +2 -2
- package/src/javascripts/ui/hooks/live-region-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-api-hooks.js +1 -1
- package/src/javascripts/ui/hooks/seamly-entry-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-option-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-state-hooks.js +5 -5
- package/src/javascripts/ui/hooks/use-event-component-mapping.js +2 -2
- package/src/javascripts/ui/hooks/use-seamly-activity-event-handler.js +1 -1
- package/src/javascripts/ui/hooks/use-seamly-chat.js +3 -3
- package/src/javascripts/ui/hooks/use-seamly-commands.js +9 -9
- package/src/javascripts/ui/hooks/use-seamly-dispatch.js +1 -1
- package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +5 -5
- package/src/javascripts/ui/hooks/use-seamly-resume-conversation-prompt.js +2 -2
- package/src/javascripts/ui/hooks/use-single-file-upload.js +2 -2
- package/src/javascripts/ui/hooks/utility-hooks.js +1 -1
- package/src/stylesheets/4-base/_formelements.scss +3 -3
- package/src/stylesheets/5-components/_buttons.scss +1 -1
- package/src/stylesheets/5-components/_chat-status.scss +4 -0
- package/src/stylesheets/5-components/_input.scss +2 -2
- package/src/stylesheets/5-components/_message-translation-info.scss +4 -0
- package/src/stylesheets/6-default-implementation/_hover.scss +5 -5
- package/src/stylesheets/7-deprecated/4-base/_formelements.scss +4 -4
- package/src/stylesheets/7-deprecated/5-components/_buttons.scss +1 -1
- package/src/stylesheets/7-deprecated/5-components/_input.scss +1 -1
- package/src/stylesheets/7-deprecated/5-components/_message.scss +4 -0
- package/src/stylesheets/7-deprecated/5-components/_options.scss +2 -2
- package/webpack/config.common.js +5 -0
- package/webpack/config.package.js +10 -0
- package/src/.DS_Store +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.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=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"].forEach((function(e){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){this._defaults.forEach((function(n){var r;e[n.fn].apply(e,function(e){if(Array.isArray(e))return t(e)}(r=n.args)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(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}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}))},e.exports=n},766:(e,t,n)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var 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;var i=n(767),s=n(445),a=n(129),c=n(842),l=n(508),u=n(253),p=n(574);function h(){}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)};var f=t=e.exports;t.Request=O,f.getXHR=function(){if(o.XMLHttpRequest&&(!o.location||"file:"!==o.location.protocol||!o.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw new Error("Browser-only version of superagent could not find XHR")};var d="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};function y(e){if(!l(e))return e;var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&b(t,n,e[n]);return t.join("&")}function b(e,t,n){if(void 0!==n)if(null!==n)if(Array.isArray(n))n.forEach((function(n){b(e,t,n)}));else if(l(n))for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&b(e,"".concat(t,"[").concat(r,"]"),n[r]);else e.push(encodeURI(t)+"="+encodeURIComponent(n));else e.push(encodeURI(t))}function g(e){for(var t,n,r={},o=e.split("&"),i=0,s=o.length;i<s;++i)-1===(n=(t=o[i]).indexOf("="))?r[decodeURIComponent(t)]="":r[decodeURIComponent(t.slice(0,n))]=decodeURIComponent(t.slice(n+1));return r}function m(e){return/[/+]json($|[^-\w])/i.test(e)}function v(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;var t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.headers=function(e){for(var t,n,r,o,i=e.split(/\r?\n/),s={},a=0,c=i.length;a<c;++a)-1!==(t=(n=i[a]).indexOf(":"))&&(r=n.slice(0,t).toLowerCase(),o=d(n.slice(t+1)),s[r]=o);return s}(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 O(e,t){var n=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",(function(){var e,t=null,r=null;try{r=new v(n)}catch(e){return(t=new Error("Parser is unable to parse the response")).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=r.status,n.callback(e,r)):n.callback(null,r)}))}function w(e,t,n){var r=f("DELETE",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}f.serializeObject=y,f.parseString=g,f.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"},f.serialize={"application/x-www-form-urlencoded":a.stringify,"application/json":s},f.parse={"application/x-www-form-urlencoded":g,"application/json":JSON.parse},u(v.prototype),v.prototype._parseBody=function(e){var t=f.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&m(this.type)&&(t=f.parse["application/json"]),t&&e&&(e.length>0||e instanceof Object)?t(e):null)},v.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot ".concat(t," ").concat(n," (").concat(this.status,")"),o=new Error(r);return o.status=this.status,o.method=t,o.url=n,o},f.Response=v,i(O.prototype),c(O.prototype),O.prototype.type=function(e){return this.set("Content-Type",f.types[e]||e),this},O.prototype.accept=function(e){return this.set("Accept",f.types[e]||e),this},O.prototype.auth=function(e,t,n){1===arguments.length&&(t=""),"object"===r(t)&&null!==t&&(n=t,t=""),n||(n={type:"function"==typeof btoa?"basic":"auto"});var o=function(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,o)},O.prototype.query=function(e){return"string"!=typeof e&&(e=y(e)),e&&this._query.push(e),this},O.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},O.prototype._getFormData=function(){return this._formData||(this._formData=new o.FormData),this._formData},O.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var n=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),n(e,t)},O.prototype.crossDomainError=function(){var 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)},O.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},O.prototype.ca=O.prototype.agent,O.prototype.buffer=O.prototype.ca,O.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},O.prototype.pipe=O.prototype.write,O.prototype._isHost=function(e){return e&&"object"===r(e)&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},O.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||h,this._finalizeQueryString(),this._end()},O.prototype._setUploadTimeout=function(){var e=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){e._timeoutError("Upload timeout of ",e._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},O.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var e=this;this.xhr=f.getXHR();var t=this.xhr,n=this._formData||this._data;this._setTimeouts(),t.onreadystatechange=function(){var n=t.readyState;if(n>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4===n){var r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var r=function(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)){var o=this._header["content-type"],i=this._serializer||f.serialize[o?o.split(";")[0]:""];!i&&m(o)&&(i=f.serialize["application/json"]),i&&(n=i(n))}for(var s in this.header)null!==this.header[s]&&Object.prototype.hasOwnProperty.call(this.header,s)&&t.setRequestHeader(s,this.header[s]);this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0===n?null:n)},f.agent=function(){return new p},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(e){p.prototype[e.toLowerCase()]=function(t,n){var r=new f.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}})),p.prototype.del=p.prototype.delete,f.get=function(e,t,n){var r=f("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},f.head=function(e,t,n){var r=f("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},f.options=function(e,t,n){var r=f("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},f.del=w,f.delete=w,f.patch=function(e,t,n){var r=f("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},f.post=function(e,t,n){var r=f("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},f.put=function(e,t,n){var r=f("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}},508:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){return null!==e&&"object"===t(e)}},842:(e,t,n)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=n(508);function i(e){if(e)return function(e){for(var t in i.prototype)Object.prototype.hasOwnProperty.call(i.prototype,t)&&(e[t]=i.prototype[t]);return e}(e)}e.exports=i,i.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},i.prototype.parse=function(e){return this._parser=e,this},i.prototype.responseType=function(e){return this._responseType=e,this},i.prototype.serialize=function(e){return this._serializer=e,this},i.prototype.timeout=function(e){if(!e||"object"!==r(e))return this._timeout=e,this._responseTimeout=0,this._uploadTimeout=0,this;for(var t in e)if(Object.prototype.hasOwnProperty.call(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},i.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};var s=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),a=new Set([408,413,429,500,502,503,504,521,522,524]);i.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var n=this._retryCallback(e,t);if(!0===n)return!0;if(!1===n)return!1}catch(e){console.error(e)}if(t&&t.status&&a.has(t.status))return!0;if(e){if(e.code&&s.has(e.code))return!0;if(e.timeout&&"ECONNABORTED"===e.code)return!0;if(e.crossDomain)return!0}return!1},i.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()},i.prototype.then=function(e,t){var n=this;if(!this._fullfilledPromise){var r=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((function(e,t){r.on("abort",(function(){if(!(n._maxRetries&&n._maxRetries>n._retries))if(n.timedout&&n.timedoutError)t(n.timedoutError);else{var e=new Error("Aborted");e.code="ABORTED",e.status=n.status,e.method=n.method,e.url=n.url,t(e)}})),r.end((function(n,r){n?t(n):e(r)}))}))}return this._fullfilledPromise.then(e,t)},i.prototype.catch=function(e){return this.then(void 0,e)},i.prototype.use=function(e){return e(this),this},i.prototype.ok=function(e){if("function"!=typeof e)throw new Error("Callback required");return this._okCallback=e,this},i.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},i.prototype.get=function(e){return this._header[e.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(e,t){if(o(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},i.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},i.prototype.field=function(e,t){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(o(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.field(n,e[n]);return this}if(Array.isArray(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.field(e,t[r]);return this}if(null==t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=String(t)),this._getFormData().append(e,t),this},i.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},i.prototype._auth=function(e,t,n,r){switch(n.type){case"basic":this.set("Authorization","Basic ".concat(r("".concat(e,":").concat(t))));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer ".concat(e))}return this},i.prototype.withCredentials=function(e){return void 0===e&&(e=!0),this._withCredentials=e,this},i.prototype.redirects=function(e){return this._maxRedirects=e,this},i.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw new TypeError("Invalid argument");return this._maxResponseSize=e,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(e){var t=o(e),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&&o(this._data))for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this._data[r]=e[r]);else"string"==typeof e?(n||this.type("form"),(n=this._header["content-type"])&&(n=n.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===n?this._data?"".concat(this._data,"&").concat(e):e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)||n||this.type("json"),this},i.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},i.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.includes("?")?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var n=this.url.slice(t+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.slice(0,t)+"?"+n.join("&")}}},i.prototype._appendQueryString=function(){console.warn("Unsupported")},i.prototype._timeoutError=function(e,t,n){if(!this._aborted){var r=new Error("".concat(e+t,"ms exceeded"));r.timeout=t,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.timedoutError=r,this.abort(),this.callback(r)}},i.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},253:(e,t,n)=>{"use strict";var r=n(244);function o(e){if(e)return function(e){for(var t in o.prototype)Object.prototype.hasOwnProperty.call(o.prototype,t)&&(e[t]=o.prototype[t]);return e}(e)}e.exports=o,o.prototype.get=function(e){return this.header[e.toLowerCase()]},o.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=r.type(t);var n=r.params(t);for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(this[o]=n[o]);this.links={};try{e.link&&(this.links=r.parseLinks(e.link))}catch(e){}},o.prototype._setStatusProperties=function(e){var t=e/100|0;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;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw s}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t.type=function(e){return e.split(/ *; */).shift()},t.params=function(e){var t,r={},o=n(e.split(/ *; */));try{for(o.s();!(t=o.n()).done;){var i=t.value.split(/ *= */),s=i.shift(),a=i.shift();s&&a&&(r[s]=a)}}catch(e){o.e(e)}finally{o.f()}return r},t.parseLinks=function(e){var t,r={},o=n(e.split(/ *, */));try{for(o.s();!(t=o.n()).done;){var i=t.value.split(/ *; */),s=i[0].slice(1,-1);r[i[1].split(/ *= */)[1].slice(1,-1)]=s}}catch(e){o.e(e)}finally{o.f()}return r},t.cleanHeader=function(e,t){return delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e}},905:e=>{e.exports=()=>()=>null},698: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%"),s=o("%Function.prototype.call%"),a=o("%Reflect.apply%",!0)||r.call(s,i),c=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=a(r,s,arguments);if(c&&l){var n=c(t,"length");n.configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var p=function(){return a(r,i,arguments)};l?l(e.exports,"apply",{value:p}):e.exports.apply=p},767:e=>{function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}},289:(e,t,n)=>{"use strict";var r=n(215),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,c=a&&function(){var e={};try{for(var t in a(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),l=function(e,t,n,r){var o;(!(t in e)||"function"==typeof(o=r)&&"[object Function]"===i.call(o)&&r())&&(c?a(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)},u=function(e,t){var n=arguments.length>2?arguments[2]:{},i=r(t);o&&(i=s.call(i,Object.getOwnPropertySymbols(t)));for(var a=0;a<i.length;a+=1)l(e,i[a],t[i[a]],n[i[a]])};u.supportsDescriptors=!!c,e.exports=u},445:e=>{e.exports=r,r.default=r,r.stable=s,r.stableStringify=s;var t=[],n=[];function r(e,r,i){var s;for(o(e,"",[],void 0),s=0===n.length?JSON.stringify(e,r,i):JSON.stringify(e,c(r),i);0!==t.length;){var a=t.pop();4===a.length?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}return s}function o(e,r,i,s){var a;if("object"==typeof e&&null!==e){for(a=0;a<i.length;a++)if(i[a]===e){var c=Object.getOwnPropertyDescriptor(s,r);return void(void 0!==c.get?c.configurable?(Object.defineProperty(s,r,{value:"[Circular]"}),t.push([s,r,e,c])):n.push([e,r]):(s[r]="[Circular]",t.push([s,r,e])))}if(i.push(e),Array.isArray(e))for(a=0;a<e.length;a++)o(e[a],a,i,e);else{var l=Object.keys(e);for(a=0;a<l.length;a++){var u=l[a];o(e[u],u,i,e)}}i.pop()}}function i(e,t){return e<t?-1:e>t?1:0}function s(e,r,o){var i,s=a(e,"",[],void 0)||e;for(i=0===n.length?JSON.stringify(s,r,o):JSON.stringify(s,c(r),o);0!==t.length;){var l=t.pop();4===l.length?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}return i}function a(e,r,o,s){var c;if("object"==typeof e&&null!==e){for(c=0;c<o.length;c++)if(o[c]===e){var l=Object.getOwnPropertyDescriptor(s,r);return void(void 0!==l.get?l.configurable?(Object.defineProperty(s,r,{value:"[Circular]"}),t.push([s,r,e,l])):n.push([e,r]):(s[r]="[Circular]",t.push([s,r,e])))}if("function"==typeof e.toJSON)return;if(o.push(e),Array.isArray(e))for(c=0;c<e.length;c++)a(e[c],c,o,e);else{var u={},p=Object.keys(e).sort(i);for(c=0;c<p.length;c++){var h=p[c];a(e[h],h,o,e),u[h]=e[h]}if(void 0===s)return u;t.push([s,r,e]),s[r]=u}o.pop()}}function c(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(n.length>0)for(var o=0;o<n.length;o++){var i=n[o];if(i[1]===t&&i[0]===r){r="[Circular]",n.splice(o,1);break}}return e.call(this,t,r)}}},648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,r=Object.prototype.toString,o="[object Function]";e.exports=function(e){var i=this;if("function"!=typeof i||r.call(i)!==o)throw new TypeError(t+i);for(var s,a=n.call(arguments,1),c=function(){if(this instanceof s){var t=i.apply(this,a.concat(n.call(arguments)));return Object(t)===t?t:this}return i.apply(e,a.concat(n.call(arguments)))},l=Math.max(0,i.length-a.length),u=[],p=0;p<l;p++)u.push("$"+p);if(s=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(c),i.prototype){var h=function(){};h.prototype=i.prototype,s.prototype=new h,h.prototype=null}return s}},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,s=TypeError,a=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var l=function(){throw new s},u=c?function(){try{return l}catch(e){try{return c(arguments,"callee").get}catch(e){return l}}}():l,p=n(405)(),h=Object.getPrototypeOf||function(e){return e.__proto__},f={},d="undefined"==typeof Uint8Array?r:h(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":p?h([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p?h(h([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p?h((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p?h((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p?h(""[Symbol.iterator]()):r,"%Symbol%":p?Symbol:r,"%SyntaxError%":o,"%ThrowTypeError%":u,"%TypedArray%":d,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},b=function e(t){var n;if("%AsyncFunction%"===t)n=a("async function () {}");else if("%GeneratorFunction%"===t)n=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=a("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=h(o.prototype))}return y[t]=n,n},g={"%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"]},m=n(612),v=n(642),O=m.call(Function.call,Array.prototype.concat),w=m.call(Function.apply,Array.prototype.splice),j=m.call(Function.call,String.prototype.replace),_=m.call(Function.call,String.prototype.slice),x=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E=/\\(\\)?/g,S=function(e){var t=_(e,0,1),n=_(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,x,(function(e,t,n,o){r[r.length]=n?j(o,E,"$1"):t||e})),r},T=function(e,t){var n,r=e;if(v(g,r)&&(r="%"+(n=g[r])[0]+"%"),v(y,r)){var i=y[r];if(i===f&&(i=b(r)),void 0===i&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');var n=S(e),r=n.length>0?n[0]:"",i=T("%"+r+"%",t),a=i.name,l=i.value,u=!1,p=i.alias;p&&(r=p[0],w(n,O([0,1],p)));for(var h=1,f=!0;h<n.length;h+=1){var d=n[h],b=_(d,0,1),g=_(d,-1);if(('"'===b||"'"===b||"`"===b||'"'===g||"'"===g||"`"===g)&&b!==g)throw new o("property names with quotes must have matching quotes");if("constructor"!==d&&f||(u=!0),v(y,a="%"+(r+="."+d)+"%"))l=y[a];else if(null!=l){if(!(d in l)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&h+1>=n.length){var m=c(l,d);l=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:l[d]}else f=v(l,d),l=l[d];f&&!u&&(y[a]=l)}}return l}},221:e=>{"use strict";"undefined"!=typeof self?e.exports=self:"undefined"!=typeof window?e.exports=window:e.exports=Function("return this")()},503:(e,t,n)=>{"use strict";var r=n(289),o=n(221),i=n(168),s=n(471),a=i(),c=function(){return a};r(c,{getPolyfill:i,implementation:o,shim:s}),e.exports=c},168:(e,t,n)=>{"use strict";var r=n(221);e.exports=function(){return"object"==typeof n.g&&n.g&&n.g.Math===Math&&n.g.Array===Array?n.g:r}},471:(e,t,n)=>{"use strict";var r=n(289),o=n(168);e.exports=function(){var e=o();if(r.supportsDescriptors){var t=Object.getOwnPropertyDescriptor(e,"globalThis");(!t||t.configurable&&(t.enumerable||t.writable||globalThis!==e))&&Object.defineProperty(e,"globalThis",{configurable:!0,enumerable:!1,value:e,writable:!1})}else"object"==typeof globalThis&&globalThis===e||(e.globalThis=e);return e}},405:(e,t,n)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(419);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},642:(e,t,n)=>{"use strict";var r=n(612);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},679:e=>{e.exports=function(e){var t={},n=[];(e=e||this).on=function(n,r,o){return(t[n]=t[n]||[]).push([r,o]),e},e.off=function(r,o){r||(t={});for(var i=t[r]||n,s=i.length=o?i.length:0;s--;)o==i[s][0]&&i.splice(s,1);return e},e.emit=function(r){for(var o,i=t[r]||n,s=i.length>0?i.slice(0,i.length):i,a=0;o=s[a++];)o[0].apply(o[1],n.slice.call(arguments,1));return e}}},631:(e,t,n)=>{var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"==typeof o.get?o.get:null,s=r&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=a&&c&&"function"==typeof c.get?c.get:null,u=a&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,y=Object.prototype.toString,b=Function.prototype.toString,g=String.prototype.match,m="function"==typeof BigInt?BigInt.prototype.valueOf:null,v=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,w="function"==typeof Symbol&&"object"==typeof Symbol.iterator,j=Object.prototype.propertyIsEnumerable,_=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),x=n(654).custom,E=x&&C(x)?x:null,S="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function T(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function k(e){return String(e).replace(/"/g,""")}function P(e){return!("[object Array]"!==N(e)||S&&"object"==typeof e&&S in e)}function C(e){if(w)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,r,o){var a=n||{};if(I(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(I(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!I(a,"customInspect")||a.customInspect;if("boolean"!=typeof c)throw new TypeError('option "customInspect", if provided, must be `true` or `false`');if(I(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return R(t,a);if("number"==typeof t)return 0===t?1/0/t>0?"0":"-0":String(t);if("bigint"==typeof t)return String(t)+"n";var y=void 0===a.depth?5:a.depth;if(void 0===r&&(r=0),r>=y&&y>0&&"object"==typeof t)return P(t)?"[Array]":"[Object]";var v,j=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=Array(e.indent+1).join(" ")}return{base:n,prev:Array(t+1).join(n)}}(a,r);if(void 0===o)o=[];else if(D(o,t)>=0)return"[Circular]";function x(t,n,i){if(n&&(o=o.slice()).push(n),i){var s={depth:a.depth};return I(a,"quoteStyle")&&(s.quoteStyle=a.quoteStyle),e(t,s,r+1,o)}return e(t,a,r+1,o)}if("function"==typeof t){var A=function(e){if(e.name)return e.name;var t=g.call(b.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),L=B(t,x);return"[Function"+(A?": "+A:" (anonymous)")+"]"+(L.length>0?" { "+L.join(", ")+" }":"")}if(C(t)){var F=w?String(t).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!=typeof t||w?F:U(F)}if((v=t)&&"object"==typeof v&&("undefined"!=typeof HTMLElement&&v instanceof HTMLElement||"string"==typeof v.nodeName&&"function"==typeof v.getAttribute)){for(var H="<"+String(t.nodeName).toLowerCase(),q=t.attributes||[],V=0;V<q.length;V++)H+=" "+q[V].name+"="+T(k(q[V].value),"double",a);return H+=">",t.childNodes&&t.childNodes.length&&(H+="..."),H+"</"+String(t.nodeName).toLowerCase()+">"}if(P(t)){if(0===t.length)return"[]";var W=B(t,x);return j&&!function(e){for(var t=0;t<e.length;t++)if(D(e[t],"\n")>=0)return!1;return!0}(W)?"["+$(W,j)+"]":"[ "+W.join(", ")+" ]"}if(function(e){return!("[object Error]"!==N(e)||S&&"object"==typeof e&&S in e)}(t)){var G=B(t,x);return 0===G.length?"["+String(t)+"]":"{ ["+String(t)+"] "+G.join(", ")+" }"}if("object"==typeof t&&c){if(E&&"function"==typeof t[E])return t[E]();if("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 K=[];return s.call(t,(function(e,n){K.push(x(n,t,!0)+" => "+x(e,t))})),z("Map",i.call(t),K,j)}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 Y=[];return u.call(t,(function(e){Y.push(x(e,t))})),z("Set",l.call(t),Y,j)}if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{h.call(e,h)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return M("WeakMap");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{h.call(e,h);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return M("WeakSet");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{return f.call(e),!0}catch(e){}return!1}(t))return M("WeakRef");if(function(e){return!("[object Number]"!==N(e)||S&&"object"==typeof e&&S in e)}(t))return U(x(Number(t)));if(function(e){if(!e||"object"!=typeof e||!m)return!1;try{return m.call(e),!0}catch(e){}return!1}(t))return U(x(m.call(t)));if(function(e){return!("[object Boolean]"!==N(e)||S&&"object"==typeof e&&S in e)}(t))return U(d.call(t));if(function(e){return!("[object String]"!==N(e)||S&&"object"==typeof e&&S in e)}(t))return U(x(String(t)));if(!function(e){return!("[object Date]"!==N(e)||S&&"object"==typeof e&&S in e)}(t)&&!function(e){return!("[object RegExp]"!==N(e)||S&&"object"==typeof e&&S in e)}(t)){var J=B(t,x),Q=_?_(t)===Object.prototype:t instanceof Object||t.constructor===Object,Z=t instanceof Object?"":"null prototype",X=!Q&&S&&Object(t)===t&&S in t?N(t).slice(8,-1):Z?"Object":"",ee=(Q||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(X||Z?"["+[].concat(X||[],Z||[]).join(": ")+"] ":"");return 0===J.length?ee+"{}":j?ee+"{"+$(J,j)+"}":ee+"{ "+J.join(", ")+" }"}return String(t)};var A=Object.prototype.hasOwnProperty||function(e){return e in this};function I(e,t){return A.call(e,t)}function N(e){return y.call(e)}function D(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 R(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return R(e.slice(0,t.maxStringLength),t)+r}return T(e.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,L),"single",t)}function L(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":"")+t.toString(16).toUpperCase()}function U(e){return"Object("+e+")"}function M(e){return e+" { ? }"}function z(e,t,n,r){return e+" ("+t+") {"+(r?$(n,r):n.join(", "))+"}"}function $(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+e.join(","+n)+"\n"+t.prev}function B(e,t){var n=P(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=I(e,o)?t(e[o],e):""}var i,s="function"==typeof v?v(e):[];if(w){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var c in e)I(e,c)&&(n&&String(Number(c))===c&&c<e.length||w&&i["$"+c]instanceof Symbol||(/[^\w$]/.test(c)?r.push(t(c,e)+": "+t(e[c],e)):r.push(c+": "+t(e[c],e))));if("function"==typeof v)for(var l=0;l<s.length;l++)j.call(e,s[l])&&r.push("["+t(s[l])+"]: "+t(e[s[l]],e));return r}},987:(e,t,n)=>{"use strict";var r;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,s=n(414),a=Object.prototype.propertyIsEnumerable,c=!a.call({toString:null},"toString"),l=a.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(e){var t=e.constructor;return t&&t.prototype===e},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!h["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{p(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();r=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===i.call(e),r=s(e),a=t&&"[object String]"===i.call(e),h=[];if(!t&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var d=l&&n;if(a&&e.length>0&&!o.call(e,0))for(var y=0;y<e.length;++y)h.push(String(y));if(r&&e.length>0)for(var b=0;b<e.length;++b)h.push(String(b));else for(var g in e)d&&"prototype"===g||!o.call(e,g)||h.push(String(g));if(c)for(var m=function(e){if("undefined"==typeof window||!f)return p(e);try{return p(e)}catch(e){return!1}}(e),v=0;v<u.length;++v)m&&"constructor"===u[v]||!o.call(e,u[v])||h.push(u[v]);return h}}e.exports=r},215:(e,t,n)=>{"use strict";var r=Array.prototype.slice,o=n(414),i=Object.keys,s=i?function(e){return i(e)}:n(987),a=Object.keys;s.shim=function(){return Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function(e){return o(e)?a(r.call(e)):a(e)}):Object.keys=s,Object.keys||s},e.exports=s},414:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var n=t.call(e),r="[object Arguments]"===n;return r||(r="[object Array]"!==n&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),r}},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,s={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/g,a=n.depth>0&&/(\[[^[\]]*])/.exec(i),l=a?i.slice(0,a.index):i,u=[];if(l){if(!n.plainObjects&&o.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var p=0;n.depth>0&&null!==(a=s.exec(i))&&p<n.depth;){if(p+=1,!n.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(a[1])}return a&&u.push("["+i.slice(a.index)+"]"),function(e,t,n,r){for(var o=r?t:c(t,n),i=e.length-1;i>=0;--i){var s,a=e[i];if("[]"===a&&n.parseArrays)s=[].concat(o);else{s=n.plainObjects?Object.create(null):{};var l="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&a!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(s=[])[u]=o:s[l]=o:s={0:o}}o=s}return o}(u,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return s;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?s.charset:e.charset;return{allowDots:void 0===e.allowDots?s.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:s.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var n,l={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,p=t.parameterLimit===1/0?void 0:t.parameterLimit,h=u.split(t.delimiter,p),f=-1,d=t.charset;if(t.charsetSentinel)for(n=0;n<h.length;++n)0===h[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===h[n]?d="utf-8":"utf8=%26%2310003%3B"===h[n]&&(d="iso-8859-1"),f=n,n=h.length);for(n=0;n<h.length;++n)if(n!==f){var y,b,g=h[n],m=g.indexOf("]="),v=-1===m?g.indexOf("="):m+1;-1===v?(y=t.decoder(g,s.decoder,d,"key"),b=t.strictNullHandling?null:""):(y=t.decoder(g.slice(0,v),s.decoder,d,"key"),b=r.maybeMap(c(g.slice(v+1),t),(function(e){return t.decoder(e,s.decoder,d,"value")}))),b&&t.interpretNumericEntities&&"iso-8859-1"===d&&(b=a(b)),g.indexOf("[]=")>-1&&(b=i(b)?[b]:b),o.call(l,y)?l[y]=r.combine(l[y],b):l[y]=b}return l}(e,n):e,p=n.plainObjects?Object.create(null):{},h=Object.keys(u),f=0;f<h.length;++f){var d=h[f],y=l(d,u[d],n,"string"==typeof e);p=r.merge(p,y,n)}return!0===n.allowSparse?p:r.compact(p)}},261:(e,t,n)=>{"use strict";var r=n(478),o=n(769),i=n(798),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,l=Array.prototype.push,u=function(e,t){l.apply(e,c(t)?t:[t])},p=Date.prototype.toISOString,h=i.default,f={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:h,formatter:i.formatters[h],indices:!1,serializeDate:function(e){return p.call(e)},skipNulls:!1,strictNullHandling:!1},d=function e(t,n,i,s,a,l,p,h,d,y,b,g,m,v,O){var w,j=t;if(O.has(t))throw new RangeError("Cyclic object value");if("function"==typeof p?j=p(n,j):j instanceof Date?j=y(j):"comma"===i&&c(j)&&(j=o.maybeMap(j,(function(e){return e instanceof Date?y(e):e}))),null===j){if(s)return l&&!m?l(n,f.encoder,v,"key",b):n;j=""}if("string"==typeof(w=j)||"number"==typeof w||"boolean"==typeof w||"symbol"==typeof w||"bigint"==typeof w||o.isBuffer(j))return l?[g(m?n:l(n,f.encoder,v,"key",b))+"="+g(l(j,f.encoder,v,"value",b))]:[g(n)+"="+g(String(j))];var _,x=[];if(void 0===j)return x;if("comma"===i&&c(j))_=[{value:j.length>0?j.join(",")||null:void 0}];else if(c(p))_=p;else{var E=Object.keys(j);_=h?E.sort(h):E}for(var S=0;S<_.length;++S){var T=_[S],k="object"==typeof T&&void 0!==T.value?T.value:j[T];if(!a||null!==k){var P=c(j)?"function"==typeof i?i(n,T):n:n+(d?"."+T:"["+T+"]");O.set(t,!0);var C=r();u(x,e(k,P,i,s,a,l,p,h,d,y,b,g,m,v,C))}}return x};e.exports=function(e,t){var n,o=e,l=function(e){if(!e)return f;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||f.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=i.default;if(void 0!==e.format){if(!s.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=i.formatters[n],o=f.filter;return("function"==typeof e.filter||c(e.filter))&&(o=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:f.addQueryPrefix,allowDots:void 0===e.allowDots?f.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:f.charsetSentinel,delimiter:void 0===e.delimiter?f.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:f.encode,encoder:"function"==typeof e.encoder?e.encoder:f.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:f.encodeValuesOnly,filter:o,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:f.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:f.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:f.strictNullHandling}}(t);"function"==typeof l.filter?o=(0,l.filter)("",o):c(l.filter)&&(n=l.filter);var p,h=[];if("object"!=typeof o||null===o)return"";p=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var y=a[p];n||(n=Object.keys(o)),l.sort&&n.sort(l.sort);for(var b=r(),g=0;g<n.length;++g){var m=n[g];l.skipNulls&&null===o[m]||u(h,d(o[m],m,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 v=h.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&"),v.length>0?O+v:""}},769:(e,t,n)=>{"use strict";var r=n(798),o=Object.prototype.hasOwnProperty,i=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],s=o.obj[o.prop],a=Object.keys(s),c=0;c<a.length;++c){var l=a[c],u=s[l];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:s,prop:l}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,o,i){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===n)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var c="",l=0;l<a.length;++l){var u=a.charCodeAt(l);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===r.RFC1738&&(40===u||41===u)?c+=a.charAt(l):u<128?c+=s[u]:u<2048?c+=s[192|u>>6]+s[128|63&u]:u<55296||u>=57344?c+=s[224|u>>12]+s[128|u>>6&63]+s[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&a.charCodeAt(l)),c+=s[240|u>>18]+s[128|u>>12&63]+s[128|u>>6&63]+s[128|63&u])}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(i(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!o.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var s=t;return i(t)&&!i(n)&&(s=a(t,r)),i(t)&&i(n)?(n.forEach((function(n,i){if(o.call(t,i)){var s=t[i];s&&"object"==typeof s&&n&&"object"==typeof n?t[i]=e(s,n,r):t.push(n)}else t[i]=n})),t):Object.keys(n).reduce((function(t,i){var s=n[i];return o.call(t,i)?t[i]=e(t[i],s,r):t[i]=s,t}),s)}}},478:(e,t,n)=>{"use strict";var r=n(210),o=n(924),i=n(631),s=r("%TypeError%"),a=r("%WeakMap%",!0),c=r("%Map%",!0),l=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),p=o("WeakMap.prototype.has",!0),h=o("Map.prototype.get",!0),f=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),y=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n};e.exports=function(){var e,t,n,r={assert:function(e){if(!r.has(e))throw new s("Side channel does not contain "+i(e))},get:function(r){if(a&&r&&("object"==typeof r||"function"==typeof r)){if(e)return l(e,r)}else if(c){if(t)return h(t,r)}else if(n)return function(e,t){var n=y(e,t);return n&&n.value}(n,r)},has:function(r){if(a&&r&&("object"==typeof r||"function"==typeof r)){if(e)return p(e,r)}else if(c){if(t)return d(t,r)}else if(n)return function(e,t){return!!y(e,t)}(n,r);return!1},set:function(r,o){a&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new a),u(e,r,o)):c?(t||(t=new c),f(t,r,o)):(n||(n={key:{},next:null}),function(e,t,n){var r=y(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,r,o))}};return r}},839:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.Symbol;if("function"==typeof n)if(n.observable)t=n.observable;else{t=n.for("https://github.com/benlesh/symbol-observable");try{n.observable=t}catch(e){}}else t="@@observable";return t}},868:(e,t,n)=>{e.exports=n(839)},813:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.NO_IL=t.NO=t.MemoryStream=t.Stream=void 0;var i=n(868),s=n(503),a=i.default(s.getPolyfill()),c={};function l(){}function u(e){for(var t=e.length,n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function p(e,t,n){try{return e.f(t)}catch(e){return n._e(e),c}}t.NO=c;var h={_n:l,_e:l,_c:l};function f(e){e._start=function(e){e.next=e._n,e.error=e._e,e.complete=e._c,this.start(e)},e._stop=e.stop}t.NO_IL=h;var d=function(){function e(e,t){this._stream=e,this._listener=t}return e.prototype.unsubscribe=function(){this._stream._remove(this._listener)},e}(),y=function(){function e(e){this._listener=e}return e.prototype.next=function(e){this._listener._n(e)},e.prototype.error=function(e){this._listener._e(e)},e.prototype.complete=function(){this._listener._c()},e}(),b=function(){function e(e){this.type="fromObservable",this.ins=e,this.active=!1}return e.prototype._start=function(e){this.out=e,this.active=!0,this._sub=this.ins.subscribe(new y(e)),this.active||this._sub.unsubscribe()},e.prototype._stop=function(){this._sub&&this._sub.unsubscribe(),this.active=!1},e}(),g=function(){function e(e){this.type="merge",this.insArr=e,this.out=c,this.ac=0}return e.prototype._start=function(e){this.out=e;var t=this.insArr,n=t.length;this.ac=n;for(var r=0;r<n;r++)t[r]._add(this)},e.prototype._stop=function(){for(var e=this.insArr,t=e.length,n=0;n<t;n++)e[n]._remove(this);this.out=c},e.prototype._n=function(e){var t=this.out;t!==c&&t._n(e)},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){if(--this.ac<=0){var e=this.out;if(e===c)return;e._c()}},e}(),m=function(){function e(e,t,n){this.i=e,this.out=t,this.p=n,n.ils.push(this)}return e.prototype._n=function(e){var t=this.p,n=this.out;if(n!==c&&t.up(e,this.i)){var r=u(t.vals);n._n(r)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.p;e.out!==c&&0==--e.Nc&&e.out._c()},e}(),v=function(){function e(e){this.type="combine",this.insArr=e,this.out=c,this.ils=[],this.Nc=this.Nn=0,this.vals=[]}return e.prototype.up=function(e,t){var n=this.vals[t],r=this.Nn?n===c?--this.Nn:this.Nn:0;return this.vals[t]=e,0===r},e.prototype._start=function(e){this.out=e;var t=this.insArr,n=this.Nc=this.Nn=t.length,r=this.vals=new Array(n);if(0===n)e._n([]),e._c();else for(var o=0;o<n;o++)r[o]=c,t[o]._add(new m(o,e,this))},e.prototype._stop=function(){for(var e=this.insArr,t=e.length,n=this.ils,r=0;r<t;r++)e[r]._remove(n[r]);this.out=c,this.ils=[],this.vals=[]},e}(),O=function(){function e(e){this.type="fromArray",this.a=e}return e.prototype._start=function(e){for(var t=this.a,n=0,r=t.length;n<r;n++)e._n(t[n]);e._c()},e.prototype._stop=function(){},e}(),w=function(){function e(e){this.type="fromPromise",this.on=!1,this.p=e}return e.prototype._start=function(e){var t=this;this.on=!0,this.p.then((function(n){t.on&&(e._n(n),e._c())}),(function(t){e._e(t)})).then(l,(function(e){setTimeout((function(){throw e}))}))},e.prototype._stop=function(){this.on=!1},e}(),j=function(){function e(e){this.type="periodic",this.period=e,this.intervalID=-1,this.i=0}return e.prototype._start=function(e){var t=this;this.intervalID=setInterval((function(){e._n(t.i++)}),this.period)},e.prototype._stop=function(){-1!==this.intervalID&&clearInterval(this.intervalID),this.intervalID=-1,this.i=0},e}(),_=function(){function e(e,t){this.type="debug",this.ins=e,this.out=c,this.s=l,this.l="","string"==typeof t?this.l=t:"function"==typeof t&&(this.s=t)}return e.prototype._start=function(e){this.out=e,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=this.s,r=this.l;if(n!==l)try{n(e)}catch(e){t._e(e)}else r?console.log(r+":",e):console.log(e);t._n(e)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),x=function(){function e(e,t){this.type="drop",this.ins=t,this.out=c,this.max=e,this.dropped=0}return e.prototype._start=function(e){this.out=e,this.dropped=0,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;t!==c&&this.dropped++>=this.max&&t._n(e)},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),E=function(){function e(e,t){this.out=e,this.op=t}return e.prototype._n=function(){this.op.end()},e.prototype._e=function(e){this.out._e(e)},e.prototype._c=function(){this.op.end()},e}(),S=function(){function e(e,t){this.type="endWhen",this.ins=t,this.out=c,this.o=e,this.oil=h}return e.prototype._start=function(e){this.out=e,this.o._add(this.oil=new E(e,this)),this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.o._remove(this.oil),this.out=c,this.oil=h},e.prototype.end=function(){var e=this.out;e!==c&&e._c()},e.prototype._n=function(e){var t=this.out;t!==c&&t._n(e)},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){this.end()},e}(),T=function(){function e(e,t){this.type="filter",this.ins=t,this.out=c,this.f=e}return e.prototype._start=function(e){this.out=e,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=p(this,e,t);n!==c&&n&&t._n(e)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),k=function(){function e(e,t){this.out=e,this.op=t}return e.prototype._n=function(e){this.out._n(e)},e.prototype._e=function(e){this.out._e(e)},e.prototype._c=function(){this.op.inner=c,this.op.less()},e}(),P=function(){function e(e){this.type="flatten",this.ins=e,this.out=c,this.open=!0,this.inner=c,this.il=h}return e.prototype._start=function(e){this.out=e,this.open=!0,this.inner=c,this.il=h,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.inner!==c&&this.inner._remove(this.il),this.out=c,this.open=!0,this.inner=c,this.il=h},e.prototype.less=function(){var e=this.out;e!==c&&(this.open||this.inner!==c||e._c())},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=this.inner,r=this.il;n!==c&&r!==h&&n._remove(r),(this.inner=e)._add(this.il=new k(t,this))}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){this.open=!1,this.less()},e}(),C=function(){function e(e,t,n){var r=this;this.type="fold",this.ins=n,this.out=c,this.f=function(t){return e(r.acc,t)},this.acc=this.seed=t}return e.prototype._start=function(e){this.out=e,this.acc=this.seed,e._n(this.acc),this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c,this.acc=this.seed},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=p(this,e,t);n!==c&&t._n(this.acc=n)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),A=function(){function e(e){this.type="last",this.ins=e,this.out=c,this.has=!1,this.val=c}return e.prototype._start=function(e){this.out=e,this.has=!1,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c,this.val=c},e.prototype._n=function(e){this.has=!0,this.val=e},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&(this.has?(e._n(this.val),e._c()):e._e(new Error("last() failed because input stream completed")))},e}(),I=function(){function e(e,t){this.type="map",this.ins=t,this.out=c,this.f=e}return e.prototype._start=function(e){this.out=e,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=p(this,e,t);n!==c&&t._n(n)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),N=function(){function e(e){this.type="remember",this.ins=e,this.out=c}return e.prototype._start=function(e){this.out=e,this.ins._add(e)},e.prototype._stop=function(){this.ins._remove(this.out),this.out=c},e}(),D=function(){function e(e,t){this.type="replaceError",this.ins=t,this.out=c,this.f=e}return e.prototype._start=function(e){this.out=e,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;t!==c&&t._n(e)},e.prototype._e=function(e){var t=this.out;if(t!==c)try{this.ins._remove(this),(this.ins=this.f(e))._add(this)}catch(e){t._e(e)}},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),R=function(){function e(e,t){this.type="startWith",this.ins=e,this.out=c,this.val=t}return e.prototype._start=function(e){this.out=e,this.out._n(this.val),this.ins._add(e)},e.prototype._stop=function(){this.ins._remove(this.out),this.out=c},e}(),L=function(){function e(e,t){this.type="take",this.ins=t,this.out=c,this.max=e,this.taken=0}return e.prototype._start=function(e){this.out=e,this.taken=0,this.max<=0?e._c():this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=++this.taken;n<this.max?t._n(e):n===this.max&&(t._n(e),t._c())}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),U=function(){function e(e){this._prod=e||c,this._ils=[],this._stopID=c,this._dl=c,this._d=!1,this._target=null,this._err=c}return e.prototype._n=function(e){var t=this._ils,n=t.length;if(this._d&&this._dl._n(e),1==n)t[0]._n(e);else{if(0==n)return;for(var r=u(t),o=0;o<n;o++)r[o]._n(e)}},e.prototype._e=function(e){if(this._err===c){this._err=e;var t=this._ils,n=t.length;if(this._x(),this._d&&this._dl._e(e),1==n)t[0]._e(e);else{if(0==n)return;for(var r=u(t),o=0;o<n;o++)r[o]._e(e)}if(!this._d&&0==n)throw this._err}},e.prototype._c=function(){var e=this._ils,t=e.length;if(this._x(),this._d&&this._dl._c(),1==t)e[0]._c();else{if(0==t)return;for(var n=u(e),r=0;r<t;r++)n[r]._c()}},e.prototype._x=function(){0!==this._ils.length&&(this._prod!==c&&this._prod._stop(),this._err=c,this._ils=[])},e.prototype._stopNow=function(){this._prod._stop(),this._err=c,this._stopID=c},e.prototype._add=function(e){var t=this._target;if(t)return t._add(e);var n=this._ils;if(n.push(e),!(n.length>1))if(this._stopID!==c)clearTimeout(this._stopID),this._stopID=c;else{var r=this._prod;r!==c&&r._start(this)}},e.prototype._remove=function(e){var t=this,n=this._target;if(n)return n._remove(e);var r=this._ils,o=r.indexOf(e);o>-1&&(r.splice(o,1),this._prod!==c&&r.length<=0?(this._err=c,this._stopID=setTimeout((function(){return t._stopNow()}))):1===r.length&&this._pruneCycles())},e.prototype._pruneCycles=function(){this._hasNoSinks(this,[])&&this._remove(this._ils[0])},e.prototype._hasNoSinks=function(e,t){if(-1!==t.indexOf(e))return!0;if(e.out===this)return!0;if(e.out&&e.out!==c)return this._hasNoSinks(e.out,t.concat(e));if(e._ils){for(var n=0,r=e._ils.length;n<r;n++)if(!this._hasNoSinks(e._ils[n],t.concat(e)))return!1;return!0}return!1},e.prototype.ctor=function(){return this instanceof M?M:e},e.prototype.addListener=function(e){e._n=e.next||l,e._e=e.error||l,e._c=e.complete||l,this._add(e)},e.prototype.removeListener=function(e){this._remove(e)},e.prototype.subscribe=function(e){return this.addListener(e),new d(this,e)},e.prototype[a]=function(){return this},e.create=function(t){if(t){if("function"!=typeof t.start||"function"!=typeof t.stop)throw new Error("producer requires both start and stop functions");f(t)}return new e(t)},e.createWithMemory=function(e){return e&&f(e),new M(e)},e.never=function(){return new e({_start:l,_stop:l})},e.empty=function(){return new e({_start:function(e){e._c()},_stop:l})},e.throw=function(t){return new e({_start:function(e){e._e(t)},_stop:l})},e.from=function(t){if("function"==typeof t[a])return e.fromObservable(t);if("function"==typeof t.then)return e.fromPromise(t);if(Array.isArray(t))return e.fromArray(t);throw new TypeError("Type of input to from() must be an Array, Promise, or Observable")},e.of=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.fromArray(t)},e.fromArray=function(t){return new e(new O(t))},e.fromPromise=function(t){return new e(new w(t))},e.fromObservable=function(t){if(void 0!==t.endWhen)return t;var n="function"==typeof t[a]?t[a]():t;return new e(new b(n))},e.periodic=function(t){return new e(new j(t))},e.prototype._map=function(e){return new(this.ctor())(new I(e,this))},e.prototype.map=function(e){return this._map(e)},e.prototype.mapTo=function(e){var t=this.map((function(){return e}));return t._prod.type="mapTo",t},e.prototype.filter=function(t){var n,r,o=this._prod;return new e(o instanceof T?new T((n=o.f,r=t,function(e){return n(e)&&r(e)}),o.ins):new T(t,this))},e.prototype.take=function(e){return new(this.ctor())(new L(e,this))},e.prototype.drop=function(t){return new e(new x(t,this))},e.prototype.last=function(){return new e(new A(this))},e.prototype.startWith=function(e){return new M(new R(this,e))},e.prototype.endWhen=function(e){return new(this.ctor())(new S(e,this))},e.prototype.fold=function(e,t){return new M(new C(e,t,this))},e.prototype.replaceError=function(e){return new(this.ctor())(new D(e,this))},e.prototype.flatten=function(){return new e(new P(this))},e.prototype.compose=function(e){return e(this)},e.prototype.remember=function(){return new M(new N(this))},e.prototype.debug=function(e){return new(this.ctor())(new _(this,e))},e.prototype.imitate=function(e){if(e instanceof M)throw new Error("A MemoryStream was given to imitate(), but it only supports a Stream. Read more about this restriction here: https://github.com/staltz/xstream#faq");this._target=e;for(var t=this._ils,n=t.length,r=0;r<n;r++)e._add(t[r]);this._ils=[]},e.prototype.shamefullySendNext=function(e){this._n(e)},e.prototype.shamefullySendError=function(e){this._e(e)},e.prototype.shamefullySendComplete=function(){this._c()},e.prototype.setDebugListener=function(e){e?(this._d=!0,e._n=e.next||l,e._e=e.error||l,e._c=e.complete||l,this._dl=e):(this._d=!1,this._dl=c)},e.merge=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(new g(t))},e.combine=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(new v(t))},e}();t.Stream=U;var M=function(e){function t(t){var n=e.call(this,t)||this;return n._has=!1,n}return o(t,e),t.prototype._n=function(t){this._v=t,this._has=!0,e.prototype._n.call(this,t)},t.prototype._add=function(e){var t=this._target;if(t)return t._add(e);var n=this._ils;if(n.push(e),n.length>1)this._has&&e._n(this._v);else if(this._stopID!==c)this._has&&e._n(this._v),clearTimeout(this._stopID),this._stopID=c;else if(this._has)e._n(this._v);else{var r=this._prod;r!==c&&r._start(this)}},t.prototype._stopNow=function(){this._has=!1,e.prototype._stopNow.call(this)},t.prototype._x=function(){this._has=!1,e.prototype._x.call(this)},t.prototype.map=function(e){return this._map(e)},t.prototype.mapTo=function(t){return e.prototype.mapTo.call(this,t)},t.prototype.take=function(t){return e.prototype.take.call(this,t)},t.prototype.endWhen=function(t){return e.prototype.endWhen.call(this,t)},t.prototype.replaceError=function(t){return e.prototype.replaceError.call(this,t)},t.prototype.remember=function(){return this},t.prototype.debug=function(t){return e.prototype.debug.call(this,t)},t}(U);t.MemoryStream=M;var z=U;t.default=z},654:()=>{}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,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,{API:()=>oh,AgentInfo:()=>Th,Chat:()=>Ms,ChatFrame:()=>Eu,ComponentFilter:()=>Fl,Conversation:()=>ql,DeprecatedToggleButton:()=>Ph,DeprecatedView:()=>Lh,Engine:()=>Oh,EntryContainer:()=>bu,EventParticipant:()=>Js,ExternalApi:()=>Sh,Header:()=>kh,Icon:()=>fi,Interrupt:()=>zs,MessageContainer:()=>na,SeamlyApiContext:()=>$n,SeamlyEventBusContext:()=>Bn,SeamlyGeneralError:()=>Kr,SeamlyLiveRegionContext:()=>Oo,SeamlyOfflineError:()=>Jr,StoreProvider:()=>U,Text:()=>gc,View:()=>Du,calculateVisibility:()=>Yt,className:()=>zn,createReduxStore:()=>Y,default:()=>Uh,eventTypes:()=>je,getUrlParams:()=>he,getUrlSearchString:()=>fe,randomId:()=>s,seamlyActions:()=>Me,useChoicePrompt:()=>aa,useDispatch:()=>Wn,useEvents:()=>on,useGeneratedId:()=>Br,useI18n:()=>dr,useSeamlyChat:()=>Ao,useSeamlyCommands:()=>vo,useSeamlyConfig:()=>ee,useSeamlyEventStream:()=>Fo,useSeamlyIdleDetachCountdown:()=>zo,useSeamlyMessageContainerClassNames:()=>Kn,useSeamlyOptions:()=>Ir,useSeamlyVisibility:()=>ao,useTranslatedEventData:()=>ii,useTranslations:()=>oi,useTranslationsContainer:()=>si,visibilityStates:()=>T}),n(698);const e=require("preact");var t=n(679),o=n.n(t);const i=require("preact/hooks");function s(){return"_"+(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}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 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 l="//";function u(e,t,n="/"){return(r,...o)=>t(e+n+r,...o)}function p(e,t=(e=>({payload:e}))){const n=(...n)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c(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}({type:e},t(...n));return n.toString=()=>String(e),n.match=t=>(null==t?void 0:t.type)===String(e),n}function h(e,...t){const n=[];t.forEach((e=>{const t=typeof e;if("string"===t)return n.push([e]);"object"!==t||e instanceof Array||Object.keys(e).forEach((t=>n.push([t,e[t]])))}));const r=u(e,p,"/");return n.map((e=>r(...e)))}function f(e,t){const[n,r,o]=h(e,{pending:(e,t)=>({meta:{arg:e,requestId:t,status:"pending"}}),fulfilled:(e,t,n)=>({payload:t,meta:{arg:e,requestId:n,status:"fulfilled"}}),rejected:(e,t,n)=>({error:t,meta:{arg:e,requestId:n,status:"rejected",error:String(t)}})});return Object.assign((i=>(a,c,l)=>{const u=s(),p=(async()=>{let e;try{a(n(i,u));const o=t(i,{dispatch:a,getState:c,extra:l}),s=await o;e=r(i,s,u)}catch(t){e=o(i,t,u)}return a(e),e})();return Object.assign(p,{type:e,arg:i,requestId:u})}),{type:e,pending:n,fulfilled:r,rejected:o})}function d(e){return{createAction:u(e,p,l),createActions:u(e,h,l),createThunk:u(e,f,l),createReducer:(t,n)=>function(e,t={},n){const r=(e=n,r)=>{const o=null==t?void 0:t[null==r?void 0:r.type];return o?o(e,r):e};return r.toString=()=>e,r}(e,t,n),selectState:t=>t[e]}}const{createAction:y,createThunk:b,createReducer:g,selectState:m}=d("config"),v=y("initialize",(e=>({config:e}))),O=y("update",(e=>({config:e}))),w=y("setPreChatEvents",(e=>({events:e})));function j(e,t){return e===t}function _(e,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}function x(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 typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}var E=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=0,s=r.pop(),a=x(r),c=e.apply(void 0,[function(){return i++,s.apply(null,arguments)}].concat(n)),l=e((function(){for(var e=[],t=a.length,n=0;n<t;n++)e.push(a[n].apply(null,arguments));return c.apply(null,e)}));return l.resultFunc=s,l.dependencies=a,l.recomputations=function(){return i},l.resetRecomputations=function(){return i=0},l}}((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:j,n=null,r=null;return function(){return _(t,n,arguments)||(r=e.apply(null,arguments)),n=arguments,r}}));const S="visibility",T={hidden:"hidden",minimized:"minimized",open:"open",initialize:null};function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){C(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(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 A=E(m,(e=>{let t=P({visible:"inline"===(null==e?void 0:e.layoutMode)?T.open:T.minimized,appContainerClassNames:e.appContainerClassNames||[]},e);return"function"==typeof t.appContainerClassNames&&(t=P(P({},t),{},{appContainerClassNames:t.appContainerClassNames(t)})),t})),I=(0,e.createContext)(void 0),N=I,{Provider:D,Consumer:R}=I,L=require("preact/jsx-runtime");function U({store:e,children:t}){return(0,L.jsx)(D,{value:e,children:t})}function M(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(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 $(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach((function(t){M(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function B(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 F="function"==typeof Symbol&&Symbol.observable||"@@observable",H=function(){return Math.random().toString(36).substring(7).split("").join(".")},q={INIT:"@@redux/INIT"+H(),REPLACE:"@@redux/REPLACE"+H(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+H()}};function V(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 W(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(B(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(B(1));return n(W)(e,t)}if("function"!=typeof e)throw new Error(B(2));var o=e,i=t,s=[],a=s,c=!1;function l(){a===s&&(a=s.slice())}function u(){if(c)throw new Error(B(3));return i}function p(e){if("function"!=typeof e)throw new Error(B(4));if(c)throw new Error(B(5));var t=!0;return l(),a.push(e),function(){if(t){if(c)throw new Error(B(6));t=!1,l();var n=a.indexOf(e);a.splice(n,1),s=null}}}function h(e){if(!V(e))throw new Error(B(7));if(void 0===e.type)throw new Error(B(8));if(c)throw new Error(B(9));try{c=!0,i=o(i,e)}finally{c=!1}for(var t=s=a,n=0;n<t.length;n++)(0,t[n])();return e}function f(e){if("function"!=typeof e)throw new Error(B(10));o=e,h({type:q.REPLACE})}function d(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(B(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[F]=function(){return this},e}return h({type:q.INIT}),(r={dispatch:h,subscribe:p,getState:u,replaceReducer:f})[F]=d,r}function G(){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))}}))}let K=G;function Y({reducers:e={},initialState:t={},middlewares:n=[]}={}){return W(function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var i,s=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:q.INIT}))throw new Error(B(12));if(void 0===n(void 0,{type:q.PROBE_UNKNOWN_ACTION()}))throw new Error(B(13))}))}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},a=0;a<s.length;a++){var c=s[a],l=n[c],u=e[c],p=l(u,t);if(void 0===p)throw t&&t.type,new Error(B(14));o[c]=p,r=r||p!==u}return(r=r||s.length!==Object.keys(e).length)?o:e}}(e),t,K(function(){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(B(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=G.apply(void 0,i)(n.dispatch),$($({},n),{},{dispatch:r})}}}(...n)))}function J(){return(0,i.useContext)(N)}function Q(){return J().dispatch}function Z(e,t=[]){const n=J(),[,r]=(0,i.useReducer)((e=>e+1),0),o=(0,i.useRef)(),s=(0,i.useCallback)(e,t),a=(0,i.useRef)(),c=(0,i.useRef)(),l=n.getState();return a.current===s&&c.current===l||(c.current=l,o.current=s(c.current),a.current=s),(0,i.useLayoutEffect)((()=>n.subscribe((()=>{var e;if(n.getState()===c.current)return;const t=null===(e=a.current)||void 0===e?void 0:e.call(a,n.getState());t!==o.current&&(o.current=t,r())}))),[n]),o.current}const X=function(e,t,n=[]){return Z((0,i.useCallback)((n=>e(n,t)),n),n)};function ee(){return Z(A)}function te(){const{startChatIcon:e}=Z(A);return e}const ne="cvco",re="2",oe="seamly-client-participant";function ie(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 se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(n),!0).forEach((function(t){ae(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ce=(e,t)=>{let n;return function(...r){const o=this;let i=!1;return clearTimeout(n),n=setTimeout((()=>{n=null,i||e.apply(o,r),i=!1}),t),t=>{i=!0,t&&e.apply(o,r)}}},le=e=>Math.ceil(e/1e3),ue=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},pe=(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/Math.pow(1024,r)).toFixed(n))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]},he=()=>{const{search:e}=window.location;return e?e.slice(e.indexOf("?")+1).split("&").reduce(((e,t)=>{const[n,r]=t.split("=");return se(se({},e),{},{[n]:decodeURIComponent(r)})}),{}):{}},fe=e=>Object.keys(e).reduce(((t,n)=>`${t}${t?"&":""}${n}=${encodeURIComponent(e[n])}`),""),de={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},ye={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},be=e=>e.code?ye[e.code]:de[e.keyCode],ge=e=>{e&&e.focus()},me=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};function ve(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 Oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(n),!0).forEach((function(t){we(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function we(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const je={info:"info",message:"message",participant:"participant",system:"system"},_e="text",xe="text",Ee="upload",Se="received",Te="read",ke="custom",Pe="typing",Ce="read",Ae="detach_service",Ie="set_translation",Ne="click_cta",De="assertive",Re="polite",Le={new_topic:"newTopic",new_translation:"newTranslation"},Ue="uploads",Me={ADD_EVENT:"ADD_EVENT",CLEAR_EVENTS:"CLEAR_EVENTS",SET_HISTORY:"SET_HISTORY",SET_EVENTS_READ:"SET_EVENTS_READ",ACK_EVENT:"ACK_EVENT",SET_IS_LOADING:"SET_IS_LOADING",CLEAR_PARTICIPANTS:"CLEAR_PARTICIPANTS",SET_PARTICIPANT:"SET_PARTICIPANT",SET_HEADER_TITLE:"SET_HEADER_TITLE",SET_HEADER_SUB_TITLE:"SET_HEADER_SUB_TITLE",RESET_HISTORY_LOADED_FLAG:"RESET_HISTORY_LOADED_FLAG",SET_ACTIVE_SERVICE:"SET_ACTIVE_SERVICE",INIT_IDLE_DETACH_COUNTDOWN:"INIT_IDLE_DETACH_COUNTDOWN",DECREMENT_IDLE_DETACH_COUNTDOWN_COUNTER:"DECREMENT_IDLE_DETACH_COUNTDOWN_COUNTER",STOP_IDLE_DETACH_COUNTDOWN_COUNTER:"STOP_IDLE_DETACH_COUNTDOWN_COUNTER",CLEAR_IDLE_DETACH_COUNTDOWN:"CLEAR_IDLE_DETACH_COUNTDOWN",INIT_RESUME_CONVERSATION_PROMPT:"INIT_RESUME_CONVERSATION_PROMPT",CLEAR_RESUME_CONVERSATION_PROMPT:"CLEAR_RESUME_CONVERSATION_PROMPT",SET_SERVICE_DATA_ITEM:"SET_SERVICE_DATA_ITEM",SET_FEATURES:"SET_FEATURES",SET_FEATURE_ENABLED_STATE:"SET_FEATURE_ENABLED_STATE",CLEAR_FEATURES:"CLEAR_FEATURES",SET_INITIAL_STATE:"SET_INITIAL_STATE",SET_USER_SELECTED_OPTIONS:"SET_USER_SELECTED_OPTIONS",SET_USER_SELECTED_OPTION:"SET_USER_SELECTED_OPTION",SHOW_OPTION:"SHOW_OPTION",HIDE_OPTION:"HIDE_OPTION",SET_SERVICE_ENTRY_METADATA:"SET_SERVICE_ENTRY_METADATA",SET_BLOCK_AUTO_ENTRY_SWITCH:"SET_BLOCK_AUTO_ENTRY_SWITCH",SET_ACTIVE_ENTRY_TYPE:"SET_ACTIVE_ENTRY_TYPE",SET_USER_ENTRY_TYPE:"SET_USER_ENTRY_TYPE",REGISTER_UPLOAD:"REGISTER_UPLOAD",SET_UPLOAD_PROGRESS:"SET_UPLOAD_PROGRESS",SET_UPLOAD_COMPLETE:"SET_UPLOAD_COMPLETE",SET_UPLOAD_ERROR:"SET_UPLOAD_ERROR",CLEAR_UPLOAD:"CLEAR_UPLOAD",CLEAR_ALL_UPLOADS:"CLEAR_ALL_UPLOADS",SET_SEAMLY_CONTAINER_ELEMENT:"SET_SEAMLY_CONTAINER_ELEMENT"},ze="navigate",{ADD_EVENT:$e,CLEAR_EVENTS:Be,SET_HISTORY:Fe,SET_EVENTS_READ:He,ACK_EVENT:qe,SET_IS_LOADING:Ve,CLEAR_PARTICIPANTS:We,SET_PARTICIPANT:Ge,SET_HEADER_TITLE:Ke,SET_HEADER_SUB_TITLE:Ye,RESET_HISTORY_LOADED_FLAG:Je,SET_ACTIVE_SERVICE:Qe,INIT_IDLE_DETACH_COUNTDOWN:Ze,DECREMENT_IDLE_DETACH_COUNTDOWN_COUNTER:Xe,STOP_IDLE_DETACH_COUNTDOWN_COUNTER:et,CLEAR_IDLE_DETACH_COUNTDOWN:tt,INIT_RESUME_CONVERSATION_PROMPT:nt,CLEAR_RESUME_CONVERSATION_PROMPT:rt,SET_SERVICE_DATA_ITEM:ot,SET_FEATURES:it,SET_FEATURE_ENABLED_STATE:st,CLEAR_FEATURES:at,SET_INITIAL_STATE:ct,SET_USER_SELECTED_OPTION:lt,SET_USER_SELECTED_OPTIONS:ut,SHOW_OPTION:pt,HIDE_OPTION:ht,SET_BLOCK_AUTO_ENTRY_SWITCH:ft,SET_USER_ENTRY_TYPE:dt,SET_ACTIVE_ENTRY_TYPE:yt,SET_SERVICE_ENTRY_METADATA:bt,REGISTER_UPLOAD:gt,SET_UPLOAD_PROGRESS:mt,SET_UPLOAD_COMPLETE:vt,SET_UPLOAD_ERROR:Ot,CLEAR_UPLOAD:wt,CLEAR_ALL_UPLOADS:jt,SET_SEAMLY_CONTAINER_ELEMENT:_t}=Me,xt=({type:e,payload:t})=>e===je.message&&!t.fromClient||e===je.info&&t.type===_e,Et=e=>e.sort((({payload:{occurredAt:e}},{payload:{occurredAt:t}})=>e-t)),St=(e,t)=>{switch(t.type){case We:return{participants:{},currentAgent:""};case Ge:if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:o,name:i,introduction:s}=t.participant,a=n[r],c=Oe(Oe({},n),{},{[r]:a?Oe(Oe(Oe(Oe({},a),o?{avatar:o}:{}),i?{name:i}:{}),s?{introduction:s}:{}):t.participant});return Oe(Oe({},e),{},{participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r});default:return e}},Tt=(e,t)=>{switch(t.type){case Ke:return Oe(Oe({},e),{},{title:t.title});case Ye:return Oe(Oe({},e),{},{subTitle:t.title});default:return e}},kt=(e,t)=>{const{entry:n}=t,{blockAutoEntrySwitch:r}=e;if(!n)return Oe(Oe({},e),{},{optionsOverride:{}});const{type:o,options:i}=n;let s=e.active;return r||o===e.userSelected||(s=o),Oe(Oe({},e),{},{active:s,optionsOverride:Oe(Oe({},e.optionsOverride),{},{[o]:i||{}})})},{createAction:Pt,createThunk:Ct,createReducer:At,selectState:It}=d("i18n"),Nt=E(It,(e=>e.translations)),Dt=E(It,(e=>e.initialLocale)),Rt=E(It,(e=>e.locale)),Lt=Pt("setInitialLocale",(e=>({locale:e}))),Ut=function(){let e=!1;const t=[],n=async()=>{if(!e)for(;t.length;){const n=t.shift();e=!0,await n().catch((()=>{})),e=!1}};return{next:n,runExclusively:async e=>{const r=new Promise(((n,r)=>{t.push((async()=>{try{n(await e())}catch(e){r(e)}}))}));return n(),r}}}(),Mt=Ct("setLocale",(async(e,{getState:t,extra:{api:n}})=>Ut.runExclusively((()=>{if(e!==Rt(t()))return n.getTranslations(e)})))),{createAction:zt,createThunk:$t,createReducer:Bt,selectState:Ft}=d("app"),Ht=E(Ft,(e=>e.userHasResponded)),{createAction:qt,createActions:Vt,createThunk:Wt,createReducer:Gt,selectState:Kt}=d("visibility"),Yt=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:o,layoutMode:i,hideOnNoUserResponse:s}=r,{visible:a}=o||{};if("window"===i&&s&&n!==T.open)return e?n||t||T.open:T.hidden;const c=T.minimized;return n||t||a||c},Jt=E(Kt,(e=>e.visibility));function Qt(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 Zt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qt(Object(n),!0).forEach((function(t){Xt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const en=e=>e.state,tn=()=>Z(en),nn=E(en,A,Ht,(({events:e,serviceData:t},n,r)=>{var o;if(r||"inline"===n.layoutMode||!t.suggestion||null===(o=t.suggestion)||void 0===o||!o.body.length)return e;const i={type:"service_data",payload:t.suggestion};return[...e,i]})),rn=E(nn,A,((e,t)=>{var n;const{enabled:r,threshold:o}=(null==t||null===(n=t.messages)||void 0===n?void 0:n.timeIndicator)??{};if(!r)return e;const i=[];let s=null;return e.forEach(((e,t)=>{if(0===t)i.push(Zt(Zt({},e),{},{timeIndicator:e.payload.occurredAt}));else{const t=s&&le(e.payload.occurredAt-s.payload.occurredAt)>=o?e.payload.occurredAt:void 0;i.push(Zt(Zt({},e),{},{timeIndicator:t}))}s=e})),i})),on=()=>Z(rn,[]),sn=()=>tn().headerTitles,an=()=>tn().unreadEvents,cn=()=>tn().skiplinkTargetId,ln=E(rn,(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})),un=()=>{const{participants:e,currentAgent:t}=tn().participantInfo;return t?e[t]:null},pn=e=>tn().serviceData[e],hn=()=>{const{layoutMode:e}=ee();return{isInline:"inline"===e,isWindow:"window"===e,isResolving:!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 dn(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){yn(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,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const bn=qt("setFromStorage",(e=>({visibility:e}))),gn=[T.open,T.minimized,T.hidden],mn=Wt("set",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),i=Jt(o),s=Ht(o),a=n.hasConversation(),c=A(o),{visibilityCallback:l=Yt,layoutMode:u}=c,{unreadEvents:p}=en(o),h=l({hasConversation:a,hasResponded:s,previousVisibility:i,requestedVisibility:e,config:c});if(gn.includes(h)){if(i!==h)return n.store.set(S,dn(dn({},n.store.get(S)||{}),{},{[u]:e})),e&&r.emit("ui.visible",e,{visibility:e,hasConversation:a,hasResponded:s,unreadMessageCount:p}),h}else console.error('The visibilityCallback function should return "open", "minimized" or "hidden".')})),vn=Wt("initialize",(async(e,{dispatch:t,getState:n,extra:{api:r}})=>{var o;const{layoutMode:i}=A(n()),s=null===(o=r.store.get(S))||void 0===o?void 0:o[i];s&&t(bn(s)),t(mn(T.initialize))}));class On extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,On),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}class wn extends Error{constructor(e,...t){super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Object.getPrototypeOf(this)),this.originalError=e,null!=e&&e.payload&&(this.originalEvent=e,this.originalError=e.payload.error),null!=e&&e.error&&(this.originalError=e.error)}}class jn extends wn{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}const{createAction:_n,createReducer:xn,selectState:En}=d("interrupt"),Sn=_n("set",(e=>({error:e}))),Tn=_n("clear"),kn=zt("setHasResponded",(e=>({hasResponded:e}))),Pn=$t("initialize",(async(e,{dispatch:t,extra:{api:n,config:r}})=>{var o;t(v(r));let i=null==r||null===(o=r.context)||void 0===o?void 0:o.locale;try{const{features:e,defaultLocale:r,preChat:o,agentParticipant:s,userParticipant:a,startChatIcon:c}=await n.getConfig();t({type:Me.SET_FEATURES,features:e}),i=i||r,t(Lt(i)),t(w(o.map((e=>({type:"message",payload:e}))))),t(O({agentParticipant:s,userParticipant:a,startChatIcon:c})),null!=s&&s.name&&t({type:Me.SET_HEADER_TITLE,title:s.name})}catch(e){throw new On}try{if(n.hasConversation()){var s;const e=await n.getConversationIntitialState();t({type:Me.SET_INITIAL_STATE,initialState:e}),i=(null===(s=e.translation)||void 0===s?void 0:s.locale)||i,"userResponded"in e&&t(kn(e.userResponded))}}catch(e){if(e instanceof jn)throw e;throw new On}finally{await t(Mt(i)),t(vn())}})),Cn=$t("reset",(async(e,{dispatch:t,extra:{api:n}})=>{try{await n.disconnect(),await n.clearStore(),t(Pn())}catch(e){t(Sn(e))}})),An=["messages"];function In(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 Nn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?In(Object(n),!0).forEach((function(t){Dn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):In(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Dn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Rn=Nn(Nn({},{namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}}}),{},{hideOnNoUserResponse:!1,showDisclaimer:!1,showFaq:!1,customComponents:{},defaults:{},preChatEvents:[]}),Ln=["hideOnNoUserResponse","showDisclaimer","showFaq","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon"],Un=(e,{config:t})=>{const n=(i=t,Ln.reduce(((e,t)=>(t in i&&(e[t]=i[t]),e)),{})),{messages:r}=n,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}(n,An);var i;let s=e;return Object.keys(o).length>0&&(s=Nn(Nn({},s),o)),r&&(s=Nn(Nn({},s),{},{messages:Nn(Nn({},s.messages),r)})),s},Mn=g({[v]:(e,t)=>Un(e,t),[O]:(e,t)=>Un(e,t),[Pn.pending]:()=>Rn,[w]:(e,{events:t})=>Nn(Nn({},e),{},{preChatEvents:t})},Rn),zn=(...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(ne)>-1?e:[ne,e].join("-"))).join(" "),$n=(0,e.createContext)(null),Bn=(0,e.createContext)(""),Fn=()=>(0,i.useContext)($n),Hn=()=>Fn().store||{},qn=()=>{const{get:e}=Hn();return e?e("conversationUrl"):null},Vn=()=>!!qn(),Wn=Q,Gn=()=>ee().appContainerClassNames,Kn=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};function Yn(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 Jn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Yn(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)?Yn(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 Qn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zn(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 Xn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function er(e){return e.reduce((function(e,t){return e.concat(Array.isArray(t)?er(t):t)}),[])}function tr(e){var t={};return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=r.length?r.map((function(e){return null===e?"null":void 0===e?"undefined":"function"==typeof e?e.toString():e instanceof Date?e.toISOString():JSON.stringify(e)})).join("|"):"_(no-args)_";if(Object.prototype.hasOwnProperty.call(t,i))return t[i];var s=e.apply(void 0,r);return t[i]=s,s}}function nr(e){for(var t=function(e){return/\s/.test(e)},n=[],r={},o=0,i=null,s=!1,a=0;a<e.length;){if(s&&(t(e[a])||"{"===e[a]))s=!1,i=e.slice(o,a),"{"===e[a]&&a--;else if(!s&&!t(e[a])){var c="{"===e[a];if(i&&c){var l=rr(e,a);if(-1===l)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));r[i]=e.slice(a+1,l),a=l,i=null}else i&&(n.push(i),i=null),s=!0,o=a}a++}return s&&(i=e.slice(o)),i&&n.push(i),{args:n,cases:r}}function rr(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 or(e){return ir(e.slice(1,-1),",",3)}function ir(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!e)return r;if(1===n)return r.push(e),r;var o=e.indexOf(t);if(-1===o)return r.push(e),r;var i=e.substring(0,o).trim(),s=e.substring(o+t.length+1).trim();return r.push(i),ir(s,t,n-1,r)}var sr;function ar(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 cr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ar(Object(n),!0).forEach((function(t){Xn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ar(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var lr=0,ur="other";function pr(e,t){for(var n=0,r="",o=0,i={};n<e.length;){if("#"!==e[n]||o)r+=e[n];else{var s="__hashToken".concat(lr++);r+="{".concat(s,", number}"),i[s]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:i}}var hr="other";const fr=new(function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Qn(this,e),Xn(this,"format",tr((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return er(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=rr(e,n);if(-1===r)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));var o=e.substring(n,r+1);if(o){var i=[],s=e.substring(0,n);s&&i.push(s);var a=or(o),c=Jn(a,3),l=c[0],u=c[1],p=c[2],h=t[l];null==h&&(h="");var f=u&&this.typeHandlers[u];i.push(f?f(h,p,this.locale,t,this.process.bind(this)):h);var d=e.substring(r+1);return d&&i.push(this.process(d,t)),i}}return[e]}}])&&Zn(t.prototype,n),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=nr(t),s=i.args,a=i.cases,c=parseInt(e);s.forEach((function(e){e.startsWith("offset:")&&(c-=parseInt(e.slice("offset:".length)))}));var l=[];if("PluralRules"in Intl){void 0!==sr&&sr.resolvedOptions().locale===n||(sr=new Intl.PluralRules(n));var u=sr.select(c);u!==ur&&l.push(u)}1===c&&l.push("one"),l.push("=".concat(c),ur);for(var p=0;p<l.length;p++){var h=l[p];if(h in a){var f=pr(a[h],c),d=f.caseBody,y=f.numberValues;return o(d,cr(cr({},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=nr(t),i=o.cases;return e in i?r(i[e],n):hr in i?r(i.other,n):e}});function dr(){const e=Z(Nt),t=Z(Rt),n=Z(Dt);return{t:(0,i.useCallback)(((n,r={})=>{const o=e[n];return o?fr.format(o,r):(console.warn(`Translation key: ${n} is missing in locale: ${t}`),null)}),[e,t]),locale:t,initialLocale:n}}function yr(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 br(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yr(Object(n),!0).forEach((function(t){gr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const mr={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},vr=At({[Lt]:(e,{locale:t})=>br(br({},e),{},{initialLocale:t}),[Mt.pending]:e=>br(br({},e),{},{isLoading:!0}),[Mt.fulfilled]:(e,{payload:t,meta:{arg:n}})=>br(br({},e),{},t?{isLoading:!1,locale:n,translations:Object.keys(t).sort().reduce(((e,n)=>br(br({},e),{},{[n]:t[n]})),{})}:{isLoading:!1}),[Mt.rejected]:e=>br(br({},e),{},{isLoading:!1}),[Pn.pending]:()=>mr},mr),{SET_SEAMLY_CONTAINER_ELEMENT:Or}=Me,wr=e=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{const t="string"==typeof e?document.getElementById(e):e;ge(t)}))}))},jr=()=>{const{seamlyContainerElement:e}=tn(),t=Wn();return[e,(0,i.useCallback)((e=>{t({type:Or,element:e})}),[t])]},_r=e=>(0,i.useCallback)((()=>{wr(e)}),[e]),xr=()=>{const e=cn();return _r(e)};function Er(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 Sr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Er(Object(n),!0).forEach((function(t){Tr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Er(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Tr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{SET_USER_SELECTED_OPTION:kr,SET_USER_SELECTED_OPTIONS:Pr,SHOW_OPTION:Cr,HIDE_OPTION:Ar}=Me,Ir=()=>{const{t:e}=dr(),{options:t}=tn(),{panelActive:n,optionActive:r,userSelectedOptions:o,features:s}=t,{cobrowsing:a,sendTranscript:c}=s,l={cobrowsing:a,sendTranscript:c},u=Object.keys(l).filter((e=>l[e])).map((t=>({name:t,title:e(`options.${t}.menuTitle`),available:l[t].enabled}))),p=a||c,h=Wn(),{get:f,set:d}=Hn();return{allowOptionSelection:p,userSelectedOptions:o,features:s,menuOptions:u,initUserSelectedOptions:(0,i.useCallback)((()=>{const e=f("options")||{};h({type:Pr,options:e})}),[f,h]),setUserSelectedOptions:(0,i.useCallback)((e=>{h({type:Pr,options:e}),d("options",e)}),[d,h]),setUserSelectedOption:(0,i.useCallback)(((e,t)=>{const n=f("options")||{};d("options",Sr(Sr({},n),{},{[e]:t})),h({type:kr,option:e,value:t})}),[h,f,d]),showOption:e=>{h({type:Cr,optionName:e})},hideOption:()=>{h({type:Ar})},panelActive:n,optionActive:r}},Nr=()=>{const{optionsButtonId:e}=tn();return{id:e,focusButton:_r(e)}},Dr=(0,e.createContext)({});function Rr(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 Lr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rr(Object(n),!0).forEach((function(t){Ur(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ur(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{CLEAR_ALL_UPLOADS:Mr}=Me,zr=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=tn(),{allowedMimeTypes:o,maxSize:i}=n.upload||{},{enabled:s,enabledFromEntry:a}=r||{},{allowedMimeTypes:c,maxSize:l}=Lr(Lr(Lr({},t.upload||{allowedMimeTypes:[],maxSize:0}),o?{allowedMimeTypes:o}:{}),i?{maxSize:i}:{});return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:a||s,allowedMimeTypes:c,maxSize:l}},$r=()=>{const{currentUploads:e}=tn(),t=Wn(),n=(0,i.useContext)(Dr);return{uploadFile:(0,i.useCallback)((e=>{n(e)}),[n]),clearUploads:(0,i.useCallback)((()=>{t({type:Mr})}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}},Br=()=>{const[e]=(0,i.useState)((()=>s()));return e},Fr=e=>{const t=(0,i.useRef)();t.current=e;const n="function"==typeof e;return(0,i.useMemo)((()=>n?(...e)=>t.current(...e):void 0),[n])},Hr=E(En,(({error:e})=>e));function qr(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 Vr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qr(Object(n),!0).forEach((function(t){Wr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gr(){const{t:e}=dr(),t=Z(Hr);return{hasInterrupt:Boolean(t),meta:(0,i.useMemo)((()=>{if(!t)return{};const{langKey:n,action:r}=t,o=e(`${n}.title`),i=e(`${n}.message`),s=e(`${n}.srText`),a=e(`${n}.buttonText`);return Vr(Vr(Vr(Vr({},n?{title:o,message:i,srText:s}:{}),r?{action:r}:{}),r&&n?{buttonText:a}:{}),{},{originalError:t})}),[e,t]),error:t}}class Kr extends wn{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class Yr extends wn{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class Jr extends wn{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}class Qr extends wn{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}const Zr=[Kr,Yr,jn,Jr,Qr,On];function Xr({api:e}){return()=>t=>n=>{const{error:r}=n;if(r){if(!Zr.some((e=>r instanceof e)))throw r;"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}function eo(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 to(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eo(Object(n),!0).forEach((function(t){no(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function no(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ro={error:void 0},oo=(e,{error:t})=>to(to({},e),{},{error:t}),io=xn({[Sn]:oo,[Pn.rejected]:oo,[Tn]:()=>ro,[Pn.pending]:()=>ro},ro);function so(){return Z(Ht)}const ao=()=>{const e=Q(),t=Z(Jt);return{isVisible:!!t&&t!==T.hidden,isOpen:t===T.open,isMinimized:t===T.minimized,visible:t,setVisibility:(0,i.useCallback)((t=>e(mn(t))),[e])}};function co(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 lo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?co(Object(n),!0).forEach((function(t){uo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):co(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function uo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const po={visibility:T.initialize},ho=Gt({[bn]:(e,{visibility:t})=>lo(lo({},e),{},{visibility:t}),[mn.fulfilled]:(e,{payload:t})=>t?lo(lo({},e),{},{visibility:t}):e},po);function fo(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 yo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fo(Object(n),!0).forEach((function(t){bo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{ADD_EVENT:go,SET_INITIAL_STATE:mo}=Me,vo=()=>{const e=Fn(),t=ee(),n=Wn(),r=(0,i.useContext)(Bn),o=so(),a=Vn(),{visible:c}=ao(),l=an(),u=(0,i.useCallback)(((...e)=>{r.emit(...e)}),[r]),p=Fr((()=>{e.sendContext(t.context||{}),u("ui.beforeStart",{visibility:c,hasConversation:a,hasResponded:o,unreadMessageCount:l}),e.send("start"),u("ui.start",{visibility:c,hasConversation:a,hasResponded:o,unreadMessageCount:l})})),h=(0,i.useCallback)((async()=>{n(Cn())}),[n]),f=(0,i.useCallback)((e=>({type:e,id:s(),transactionId:s(),participant:oe,fromClient:!0,occurredAt:1e3*Date.now(),meta:{}})),[]),d=(0,i.useCallback)((e=>yo(yo({},f("text")),{},{body:{text:e}})),[f]),y=(0,i.useCallback)((({body:t,config:r={}})=>{if(""===t.trim())return;const o=yo(yo({},d(t)),r);e.send("message",o),u("message",o),n({type:go,event:{type:"message",payload:o}})}),[e,n,u,d]),b=(0,i.useCallback)((e=>{n({type:go,event:{type:"message",payload:d(e)}})}),[n,d]),g=(0,i.useCallback)(((e,t,r,o,i,s,a)=>{n({type:go,event:{type:"message",payload:{type:"upload",id:e,transactionId:t,participant:oe,fromClient:!0,occurredAt:r,meta:{},body:{contentType:o,filename:i,filesize:s,url:a}}}})}),[n]),m=(0,i.useCallback)((e=>{const t={body:{subtype:e,type:"divider"},fromClient:!1,fromHistory:!0,id:s(),transactionId:s(),type:"divider"};n({type:go,event:{type:"info",payload:t}})}),[n]),v=(0,i.useCallback)((({type:t,subtype:n})=>{const r={type:t,subtype:n,id:s(),transactionId:s(),participant:oe,fromClient:!0};e.send("info",r)}),[e]),O=(0,i.useCallback)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==Pe&&n!==Ce&&u(`action.${n}`,t)}),[e,u]),w=(0,i.useCallback)((t=>{e.sendContext(t)}),[e]);return{connect:(0,i.useCallback)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&n({type:mo,initialState:e})})).catch((e=>{n(Sn(e))}))),[e,n]),start:p,sendMessage:y,sendInfo:v,sendAction:O,sendContext:w,reset:h,emitEvent:u,addMessageBubble:b,addUploadBubble:g,addDivider:m,apiConfigReady:e.configReady}},Oo=(0,e.createContext)(null),wo=()=>{const e=(0,i.useContext)(Oo);return{sendPolite:(0,i.useCallback)((t=>{e({ariaLive:Re,messageText:t})}),[e]),sendAssertive:(0,i.useCallback)((t=>{e({ariaLive:De,messageText:t})}),[e])}},jo=(0,e.createContext)(null),_o=()=>(0,i.useContext)(jo);function xo(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 Eo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{SET_BLOCK_AUTO_ENTRY_SWITCH:So,SET_ACTIVE_ENTRY_TYPE:To,SET_USER_ENTRY_TYPE:ko}=Me,Po=()=>{const{default:e,active:t,userSelected:n,options:r}=tn().entryMeta,o=Wn(),s=n||t||e,a=r[s]||{},c=(0,i.useCallback)((e=>{o({type:So,value:e})}),[o]),l=(0,i.useCallback)((e=>{o({type:To,entryType:e})}),[o]),u=(0,i.useCallback)((e=>{o({type:ko,entryType:e})}),[o]),p=(0,i.useCallback)((()=>{n?u(null):l(e)}),[n,e,u,l]);return{activeEntry:s,activeEntryOptions:a,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:p,setBlockAutoEntrySwitch:c}},{SET_IS_LOADING:Co}=Me,Ao=()=>{const{t:e}=dr(),{layoutMode:t}=ee(),{isOpen:n,isVisible:r,setVisibility:o}=ao(),s=Wn(),a=on(),c=(0,i.useRef)(null),{start:l,connect:u,apiConfigReady:p}=vo(),h=Vn(),f=(0,i.useRef)(null),d=(0,i.useRef)(null),{sendAssertive:y}=wo(),b=(0,i.useRef)(!1),g=a.length>0;return(0,i.useEffect)((()=>{r&&setTimeout((()=>{y(e("window.srTexts.onLoad"))}),500)}),[r,y,e]),(0,i.useEffect)((()=>{if(r!==d.current)return f.current=n,void(d.current=r);null!==f.current&&y(e(n?"window.srTexts.onOpen":"window.srTexts.onClose")),f.current=n,d.current=r}),[n,r,y,e]),(0,i.useEffect)((()=>{c.current=setTimeout((()=>{s({type:Co,isLoading:!0})}),500)}),[s]),(0,i.useEffect)((()=>{g&&(clearTimeout(c.current),s({type:Co,isLoading:!1}))}),[g,s]),(0,i.useEffect)((()=>{h&&p||(b.current=!1)}),[h,p]),(0,i.useEffect)((()=>{("window"!==t||n||h)&&!b.current&&p&&(h&&(clearTimeout(c.current),s({type:Co,isLoading:!1})),u().then((()=>{l()})),b.current=!0)}),[n,h,p,l,u,s,t]),{openChat:()=>{o(T.open)},closeChat:()=>{o(T.minimized)}}};function Io(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 No(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Io(Object(n),!0).forEach((function(t){Do(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Io(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Do(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{CLEAR_IDLE_DETACH_COUNTDOWN:Ro,INIT_IDLE_DETACH_COUNTDOWN:Lo,DECREMENT_IDLE_DETACH_COUNTDOWN_COUNTER:Uo,STOP_IDLE_DETACH_COUNTDOWN_COUNTER:Mo}=Me,zo=()=>{const e=Wn(),{idleDetachCountdown:t}=tn(),{isOpen:n}=ao(),r=(0,i.useRef)({});r.current={hasCountdown:t.hasCountdown,isActive:t.isActive,remaining:t.remaining,wasStopped:t.wasStopped,isOpen:n};const{emitEvent:o,sendAction:s}=vo(),{t:a}=dr(),{sendAssertive:c,sendPolite:l}=wo(),u=(0,i.useCallback)((e=>{const{isOpen:t}=r.current;t&&c(e)}),[c]),p=(0,i.useCallback)((e=>{const{isOpen:t}=r.current;t&&l(e)}),[l]),h=(0,i.useCallback)((t=>{const n=(e=>Math.ceil(e/1e3))(t),r=ue(n);e({type:Lo,delaySeconds:n,delayTime:r}),o("idleTimer.start"),u(`${a("idleDetachWarning.countdownTitle")} ${a("idleDetachWarning.countdownText")} ${a("idleDetachWarning.countdownTimer",r)}`)}),[e,o,u,a]),f=(0,i.useCallback)(((t,n)=>{const{hasCountdown:i,wasStopped:c}=r.current;i&&(t||(n||s({type:Ae}),u(a("idleDetachWarning.notifyTransferText"))),c||o("idleTimer.stop"),e({type:Ro}))}),[e,s,o,u,a]),d=(0,i.useCallback)((()=>{const{remaining:t}=r.current;if(t<=0)return;const n=t-1;n%10==0&&u(`${a("idleDetachWarning.countdownText")} ${a("idleDetachWarning.countdownTimer",ue(n))}`),e({type:Uo})}),[e,u,a]),y=(0,i.useCallback)((()=>{const{isActive:t,remaining:n}=r.current;t&&(e({type:Mo}),n&&(o("idleTimer.stop"),p(a("idleDetachWarning.srCountDownStoppedText"))))}),[e,o,p,a]);return No(No({},t),{},{initCountdown:h,endCountdown:f,decrementCountdown:d,stopCountdown:y})},{CLEAR_RESUME_CONVERSATION_PROMPT:$o}=Me,Bo=()=>{const e=Wn(),t=tn().resumeConversationPrompt,{sendAction:n}=vo(),{t:r}=dr(),{sendAssertive:o}=wo();return{continueChat:()=>{n({type:"dismiss",body:{type:"resume_conversation_prompt"}}),e({type:$o})},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:Ae}),e({type:$o})}}},Fo=(e,t)=>{const n=Fn();(0,i.useEffect)((()=>{n.stream&&(t?n.stream().filter(t).subscribe({next:e}):n.stream().subscribe({next:e}))}),[n,e,t])};function Ho(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 qo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ho(Object(n),!0).forEach((function(t){Vo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ho(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Vo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wo=Bt({[kn]:(e,{hasResponded:t})=>qo(qo({},e),{},{userHasResponded:t})},{userHasResponded:!1}),{createActions:Go,createReducer:Ko,selectState:Yo}=d("translations"),[Jo,Qo]=Go("translate",{enable:e=>({locale:e}),disable:()=>({})}),[Zo,Xo]=Go("event",{enable:e=>({payloadId:e}),disable:e=>({payloadId:e})}),ei=(e,t)=>(n,r)=>r[e]||t,ti=Yo,ni=E(ti,(e=>e.originalPayloadIds)),ri=E(ni,ei("payloadId"),((e,t)=>!e.includes(t)));function oi(){const{sendAction:e}=vo(),t=Q(),n=Fr((n=>{e({type:Ie,body:{enabled:!0,locale:n}}),t(Jo(n))})),r=Fr((()=>{e({type:Ie,body:{enabled:!1}}),t(Qo())})),{languages:o,isActive:i,isAvailable:s,currentLocale:a}=Z(ti,[]);return{languages:o,isActive:i,isAvailable:s,currentLocale:a,enableTranslations:n,disableTranslations:r}}function ii({payload:e}={}){var t,n,r;const o=null==e?void 0:e.id;let i,s;switch(null==e?void 0:e.type){case"participant":i=e.participant.introduction,s=e.participant.translatedIntroduction;break;default:i=null==e?void 0:e.body,s=null==e?void 0:e.translatedBody}const a=!!s,c=X(ri,{payloadId:o},[o]),l=Q(),u=Fr((()=>{l(c?Xo(o):Zo(o))}));return[a&&c?null===(t=s)||void 0===t?void 0:t.data:i,{hasTranslation:a,isTranslated:c&&a,toggleTranslation:u,translatedBy:null===(n=s)||void 0===n?void 0:n.translatedBy,locale:null===(r=s)||void 0===r?void 0:r.locale}]}function si(){const e=Z(ti,[]).containerId;return{id:e,focusContainer:_r(e)}}function ai(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 ci(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ai(Object(n),!0).forEach((function(t){li(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ai(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function li(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ui={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],originalPayloadIds:[],containerId:s()},pi=Ko({[Me.SET_FEATURES]:(e,t)=>{var n;const r=null==t||null===(n=t.features)||void 0===n?void 0:n.translation;return r?ci(ci({},e),{},{isAvailable:!0===r.enabled,languages:r.languages||[]}):e},[Me.CLEAR_FEATURES]:()=>ui,[Jo]:(e,{locale:t})=>ci(ci({},e),{},{isActive:!0,currentLocale:t}),[Qo]:e=>ci(ci({},e),{},{isActive:!1,currentLocale:void 0}),[Zo]:(e,{payloadId:t})=>e.originalPayloadIds.includes(t)?ci(ci({},e),{},{originalPayloadIds:e.originalPayloadIds.filter((e=>e!==t))}):e,[Xo]:(e,{payloadId:t})=>e.originalPayloadIds.includes(t)?e:ci(ci({},e),{},{originalPayloadIds:[...e.originalPayloadIds,t]}),[Pn.pending]:()=>ui},ui),hi={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 xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#003A5D" d="M0,4.717C0,2.112,2.112,0,4.717,0h22.566C29.888,0,32,2.112,32,4.717v22.566C32,29.887,29.888,32,27.283,32 H4.717C2.113,32,0,29.887,0,27.283V4.717z"/><path fill="#FFF" d="M10.103,14.901c-1.107,0-2.004-0.897-2.004-2.004s0.897-2.005,2.004-2.005c1.107,0,2.005,0.897,2.005,2.005 C12.108,14.004,11.211,14.901,10.103,14.901z M16,14.901c1.107,0,2.005-0.897,2.005-2.004S17.108,10.892,16,10.892 c-1.108,0-2.005,0.897-2.005,2.005C13.995,14.004,14.892,14.901,16,14.901z M21.896,10.892c-1.106,0-2.004,0.897-2.004,2.005 c0,1.107,0.896,2.004,2.004,2.004c1.109,0,2.005-0.897,2.005-2.004C23.901,11.789,23.005,10.892,21.896,10.892z M21.408,18.207 H10.783C11.83,23.973,20.361,23.973,21.408,18.207z"/></svg>',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'},fi=({name:e,size:t="32",className:n,alt:r})=>{const o=`${e}${t}`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{"aria-hidden":"true",className:n||zn("icon"),dangerouslySetInnerHTML:{__html:hi[o]}}),r&&(0,L.jsx)("span",{className:zn("visually-hidden"),children:r})]})},di={visible:zn("transition--visible"),in:zn("transition--in"),visuallyHidden:zn("visually-hidden")},yi=Object.values(di),bi="notRendered",gi="rendered",mi="visuallyHidden",vi=({children:t,isActive:n,timeout:r,transitionStartState:o="notRendered",onInTransitionComplete:s,onOutTransitionComplete:a})=>{const c=(0,i.useRef)(!1),l=r?parseInt(r,10):300,u=Fr(s),p=Fr(a),h=o===mi,[f,d]=(0,i.useState)((()=>h?[di.visuallyHidden]:[])),y="notRendered"!==o||f.length>0;return(0,i.useEffect)((()=>{let e=null,t=null;return c.current&&!n&&(d([di.visible]),e=setTimeout((()=>{d([...h?[di.visuallyHidden]:[]]),p&&(t=requestAnimationFrame((()=>{p()})))}),l)),!c.current&&n&&(d([di.visible]),t=requestAnimationFrame((()=>{t=requestAnimationFrame((()=>{d([di.visible,di.in]),u&&(e=setTimeout((()=>{u()}),l))}))}))),c.current=n,()=>{clearTimeout(e),cancelAnimationFrame(t)}}),[n,h,l,u,p]),y&&(0,e.toChildArray)(t).map((t=>{const{className:n=""}=t.props,r=n.split(" ").filter((e=>!yi.includes(e)));return(0,e.cloneElement)(t,{className:[...r,...f].join(" ")})}))},Oi=({className:e,children:t,onCancel:n,headingText:r,cancelButtonText:o,disableButtonFocusing:s,cancelButtonRef:a,position:c="right"})=>{const l=(0,i.useRef)(null),u=Br(),{hideOption:p}=Ir(),{focusButton:h}=Nr();return(0,i.useEffect)((()=>{ge(l.current)}),[]),(0,L.jsx)("section",{className:zn("options",{"options--right":"left"!==c,"options--left":"left"===c},e),"aria-labelledby":u,tabIndex:"-1",ref:l,children:(0,L.jsxs)("div",{className:zn("options__body"),children:[(0,L.jsx)("h2",{id:u,className:zn("options__title"),children:r}),(0,L.jsxs)("button",{type:"button",onClick:()=>{n&&n(),p(),s||h()},"aria-describedby":u,className:zn("button","options__close"),ref:e=>{a&&(a.current=e)},children:[(0,L.jsx)(fi,{name:"close",size:"16"}),(0,L.jsx)("span",{children:o})]}),(0,L.jsx)("div",{className:zn("options__wrapper"),children:t})]})})},{createActions:wi,createReducer:ji,selectState:_i}=d("forms"),[xi,Ei]=wi("form",{register:(e,t)=>({formId:e,persistData:t}),deregister:e=>({formId:e})}),[Si,Ti,ki,Pi]=wi("control",{register:(e,t)=>({formId:e,name:t}),deregister:(e,t)=>({formId:e,name:t}),updateValue:(e,t,n)=>({formId:e,name:t,value:n}),updateTouched:(e,t,n)=>({formId:e,name:t,touched:n})}),Ci=E(_i,ei("formId"),((e,t)=>e[t])),Ai=E(Ci,(e=>(null==e?void 0:e.controls)||{})),Ii=E(Ai,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),Ni=E(Ai,ei("name"),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.value})),Di=E(Ai,ei("name"),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.touched})),Ri=(0,e.createContext)({}),Li=Ri,{Provider:Ui,Consumer:Mi}=Ri;function zi(){return(0,i.useContext)(Li)}function $i(e){const t=Q(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:s}=zi(),a=!!X(Ci,{formId:n},[n]),c=(0,i.useRef)();c.current=a;const l=X(Ni,{formId:n,name:e},[n,e]),u=X(Di,{formId:n,name:e},[n,e]),p=null==s?void 0:s[e],h=!p;(0,i.useEffect)((()=>{c.current&&t(Si(n,e))}),[a,n,e,t]),(0,i.useLayoutEffect)((()=>()=>{t(Ti(n,e))}),[a,n,e,t]);const f=(0,i.useCallback)((t=>r(e,t.target.value)),[e,r]),d=(0,i.useCallback)((()=>{o(e,!0)}),[o,e]);return[(0,i.useMemo)((()=>({name:e,onInput:f,onBlur:d,value:l})),[e,f,d,l]),(0,i.useMemo)((()=>({isValid:h,error:p,touched:u})),[h,p,u])]}const Bi=["children","formId","persistData","onError","onSubmit","validationSchema"];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){qi(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 qi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vi(e){let{children:t,formId:n,persistData:r,onError:o,onSubmit:s,validationSchema:a}=e,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Bi);const l=Q(),u=X(Ii,{formId:n},[n]),[p,h]=(0,i.useState)(!1),[f,d]=(0,i.useState)({}),{isValid:y,errors:b}=function(e,t){const n=(0,i.useMemo)((()=>function(e,t={}){return Object.entries(t).reduce(((t,[n,r])=>{r&&!Array.isArray(r)&&(r=[r]);for(let i=0;i<(null===(o=r)||void 0===o?void 0:o.length);i++){var o;if(!r[i].fn(e[n],r[i].compareValue)){t[n]=r[i].errorText;break}}return t}),{})}(e,t)),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(u,a),g=(0,i.useMemo)((()=>Hi(Hi({},b),f)),[b,f]);(0,i.useLayoutEffect)((()=>{l(xi(n,r))}),[n,r,l]),(0,i.useEffect)((()=>()=>{l(Ei(n))}),[n,r,l]);const m=(0,i.useCallback)(((e,t)=>{l(ki(n,e,t))}),[n,l]),v=(0,i.useCallback)(((e,t)=>{l(Pi(n,e,t))}),[l,n]),O=(0,i.useCallback)(((e,t)=>{d((n=>Hi(Hi({},n),{},{[e]:t})))}),[d]),w=(0,i.useCallback)((e=>{e.preventDefault(),h(!0),y&&s(u,{updateControlValue:m,setError:O})}),[y,s,u,m,O]);(0,i.useEffect)((()=>{o&&o({errors:g,isSubmitted:p,isValid:0===Object.keys(g).length})}),[p,g,o]);const j=(0,i.useMemo)((()=>({formId:n,values:u,errors:g,isValid:0===Object.keys(g).length,isSubmitted:p,handleSubmit:w,validationSchema:a,updateControlValue:m,updateControlTouched:v})),[n,u,g,p,w,a,m,v]);return n?s?(0,L.jsx)(Ui,Hi(Hi({},c),{},{value:j,children:t})):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)}function Wi(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 Gi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wi(Object(n),!0).forEach((function(t){Ki(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ki(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yi={},Ji={controls:{}},Qi={value:"",touched:!1};function Zi(e,t,n,r){var o;const i=(null===(o=e[t])||void 0===o?void 0:o.controls[n])||Qi;return Gi(Gi({},e),{},{[t]:Gi(Gi({},e[t]),{},{controls:Gi(Gi({},e[t].controls),{},{[n]:Gi(Gi({},i),r)})})})}const Xi=ji({[xi]:(e,{formId:t,persistData:n})=>{const r=n?e[t]??Gi(Gi({},Ji),{},{persistData:n}):Gi(Gi({},Ji),{},{persistData:n});return Gi(Gi({},e),{},{[t]:r})},[Ei]:(e,{formId:t})=>{var n;const r=Gi({},e);return null!==(n=r[t])&&void 0!==n&&n.persistData||delete r[t],r},[Si]:(e,{name:t,formId:n})=>Zi(e,n,t),[Ti]:(e,{formId:t,name:n})=>{const r=e[t];if(!r)return e;if(r.persistData)return e;const o=Gi({},r.controls);return delete o[n],Gi(Gi({},e),{},{[t]:Gi(Gi({},r),{},{controls:o})})},[ki]:(e,{formId:t,name:n,value:r})=>Zi(e,t,n,{value:r}),[Pi]:(e,{formId:t,name:n,touched:r})=>Zi(e,t,n,{touched:r}),[Pn.pending]:()=>Yi},Yi),es=["className","disableValidationClasses"];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,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rs=function(e){let{className:t,disableValidationClasses:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,es);const{handleSubmit:o,isValid:i,isSubmitted:s}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=zi();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),a=["form"];return!n&&s&&(a.push("form--submitted"),i?a.push("form--valid"):a.push("form--invalid")),(0,L.jsx)("form",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ts(Object(n),!0).forEach((function(t){ns(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}({onSubmit:o,className:zn([...a,t])},r))};function os({id:e,error:t}){const[n,r]=(0,i.useState)(!1);return(0,i.useEffect)((()=>{const e=setTimeout((()=>r(!0)),300);return()=>clearTimeout(e)}),[]),(0,L.jsx)("div",{className:zn("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&(0,L.jsxs)("span",{id:e,className:zn("error__message"),children:[(0,L.jsx)(fi,{name:"error",size:"16"}),t]})})}const is=({contentHint:e,id:t,labelText:n,labelClass:r=zn("label"),validity:o,errorText:i,children:s})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("label",{htmlFor:t,className:r,children:n}),e&&(0,L.jsx)("span",{id:`${t}-content-hint`,className:zn("input__content-hint"),children:e}),(0,L.jsx)(os,{id:`${t}-error`,error:!o&&i}),s]}),ss=["id","name","labelText","labelClass","contentHint","aria-describedby","options"];function as(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?as(Object(n),!0).forEach((function(t){ls(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):as(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ls(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const us=e=>{let{id:t,name:n,labelText:r,labelClass:o,contentHint:i,"aria-describedby":s,options:a=[]}=e,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ss);const{isSubmitted:l}=zi(),[u,{error:p}]=$i(n),h=l&&p,f=[];return s&&f.push(s),i&&f.push(`${t}-content-hint`),h&&f.push(`${t}-error`),(0,L.jsx)(is,{id:t,contentHint:i,validity:!h,errorText:p,labelText:r,labelClass:o,children:(0,L.jsx)("select",cs(cs(cs({id:t,name:n,"aria-invalid":h?"true":"false","aria-describedby":f.join(" ")||null},u),c),{},{children:a.map((e=>(0,L.jsx)("option",{value:e.value,children:e.label},e.value)))}))})},ps=function({controlName:e,descriptionId:t}){const{t:n}=dr(),{isActive:r,languages:o,currentLocale:s}=oi(),{locale:a}=dr(),c=(0,i.useMemo)((()=>{var e;return null==o||null===(e=o.find((e=>e.locale===s)))||void 0===e?void 0:e.nativeName}),[o,s]),l=(0,i.useMemo)((()=>[{value:"",label:n("translations.settings.defaultOptionLabel")},...o.filter((e=>e.locale.toLowerCase()!==String(a).toLowerCase())).map((e=>({value:e.locale,label:e.nativeName})))]),[n,o,a]);return(0,L.jsxs)(rs,{noValidate:"true",className:zn("options__form"),children:[(0,L.jsx)("p",{className:zn("options__description"),id:t,children:n("translations.settings.description")}),r?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("h3",{children:n("translations.settings.currentTranslationLabel")}),(0,L.jsx)("p",{className:zn("options__active-language"),children:c})]}):(0,L.jsx)(us,{name:e,type:"text",className:zn("input__select"),"aria-describedby":t,labelClass:zn("label"),labelText:n("translations.settings.inputLabel"),options:l,defaultValue:s||""}),(0,L.jsx)("div",{className:zn("options__actions"),children:(0,L.jsx)("button",{type:"submit",className:zn("button","button--primary","options__submit"),children:n(r?"translations.settings.endButtonText":"translations.settings.startButtonText")})})]})},{REGISTER_FORM:hs,DE_REGISTER_FORM:fs,REGISTER:ds,DE_REGISTER:ys,SET_VALUE:bs,SET_VALIDITY:gs,SET_STATE:ms,SET_SUBMITTED:vs,SET_PERSIST_FORM_DATA:Os}={REGISTER_FORM:"REGISTER_FORM",DE_REGISTER_FORM:"DE_REGISTER_FORM",REGISTER:"REGISTER",DE_REGISTER:"DEREGISTER",SET_VALUE:"SET_VALUE",SET_VALIDITY:"SET_VALIDITY",SET_STATE:"SET_STATE",SET_SUBMITTED:"SET_SUBMITTED",SET_PERSIST_FORM_DATA:"SET_PERSIST_FORM_DATA"},ws=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),js=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},_s=e=>!(null==e||!e.length)>0,xs=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))},Es=e=>!!e,Ss="translation-settings",Ts="locale",ks=function({onClose:e}){const[t,n]=(0,i.useState)(void 0),{t:r}=dr(),{isActive:o,enableTranslations:s,disableTranslations:a}=oi(),c=Br(),{focusContainer:l}=si(),u=(0,i.useCallback)((({isValid:e,isSubmitted:t})=>{n(t&&!e?"options--error":void 0)}),[n]),p=(0,i.useRef)(0),h=(0,i.useMemo)((()=>(p.current+=1,o?{}:{[Ts]:ws(Es,r("translations.settings.noLocaleText"))})),[o,r]);return(0,L.jsx)(Oi,{className:t,onCancel:e,formName:Ss,headingText:r("translations.settings.title"),cancelButtonText:r("translations.settings.cancelButtonText"),position:"left",disableButtonFocusing:!0,children:(0,L.jsx)(Vi,{onSubmit:({locale:t})=>{o?a():(s(t),e(),l())},formId:Ss,validationSchema:h,onError:u,children:(0,L.jsx)(ps,{controlName:Ts,descriptionId:c})},p.current)})};function Ps(){const{t:e}=dr(),[t,n]=(0,i.useState)(!1),r=(0,i.useRef)(null),o=Br();return(0,L.jsxs)("div",{className:zn("translations__container"),onKeyDown:e=>{t&&be(e)===ye.Escape&&(n(!1),ge(r.current))},children:[(0,L.jsx)(vi,{transitionStartState:bi,isActive:t,children:(0,L.jsx)("div",{className:zn("options__dialog"),role:"dialog",children:(0,L.jsx)(ks,{onClose:()=>{n(!1)}})})}),(0,L.jsxs)("button",{type:"button",className:zn(["button","button--secondary","chat__options__button"]),id:o,onClick:()=>{n((e=>!e))},onKeyDown:e=>{be(e)===ye.ArrowDown&&(n(!0),e.preventDefault())},ref:r,"aria-haspopup":"dialog","aria-expanded":t.toString(),children:[(0,L.jsx)(fi,{name:"newTranslation",size:"16"}),(0,L.jsx)("span",{className:zn("button__text"),children:e("translations.settings.openButtonText")})]})]})}function Cs({id:e,label:t,onButtonClick:n,buttonText:r,srButtonText:o,type:i}){const s=Br();return(0,L.jsxs)("section",{className:zn("chat-status",i&&`chat-status--${i}`),id:e,tabIndex:"-1","aria-labelledby":s,children:[(0,L.jsx)("h2",{className:zn("chat-status__title"),id:s,children:t}),(0,L.jsxs)("button",{type:"button",className:zn("button","button--tertiary"),onClick:n,children:[(0,L.jsx)("span",{"aria-hidden":o?"true":void 0,children:r}),o&&(0,L.jsx)("span",{className:zn("visually-hidden"),children:o})]})]})}function As(){const{t:e}=dr(),{id:t}=si(),{hasInterrupt:n}=Gr(),{isActive:r,disableTranslations:o,languages:s,currentLocale:a}=oi(),c=xr(),l=(0,i.useMemo)((()=>{var e;return null==s||null===(e=s.find((e=>e.locale===a)))||void 0===e?void 0:e.nativeName}),[s,a]),u=(0,i.useCallback)((()=>{o(),c()}),[o,c]);return!r||n?null:(0,L.jsx)(Cs,{type:"translations",id:t,label:e("translations.status.label",{language:l}),onButtonClick:u,buttonText:e("translations.status.stopText"),srButtonText:e("translations.status.srStopText")})}const Is=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,Ns=({id:e,categories:t=[],question:n,onClick:r,hasIcon:o})=>{const s=(0,i.useMemo)((()=>["suggestions-item",...t.map(Is)]),[t]),a=(0,i.useCallback)((()=>{r&&r({id:e,question:n})}),[e,n,r]);return(0,L.jsx)("li",{className:zn(s),children:(0,L.jsxs)("button",{type:"button",onClick:a,className:zn("button","button--primary"),children:[o&&(0,L.jsx)(fi,{name:"chevronRight",size:"8"}),n]})})};function Ds(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ls=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>(0,L.jsx)("ul",{className:zn("suggestions__list",e),children:t.map((e=>(0,L.jsx)(Ns,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ds(Object(n),!0).forEach((function(t){Rs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ds(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({hasIcon:r,onClick:n},e),e.id)))}),Us=({isAside:e})=>{const{layoutMode:t}=ee(),{t:n}=dr(),{sendAction:r,addMessageBubble:o}=vo(),{isOpen:s,setVisibility:a}=ao(),c=Br(),l=xr(),u=(0,i.useRef)(null),{sendPolite:p}=wo(),{hasInterrupt:h}=Gr(),{hasCountdown:f,endCountdown:d}=zo(),{hasPrompt:y,continueChat:b}=Bo(),g=so(),m=pn("suggestion"),[v]=ii({payload:m}),O=(0,i.useMemo)((()=>m&&!h?v:[]),[m,h,v]),w=(0,i.useRef)(null),j=(0,i.useRef)(!1),_=(0,i.useRef)([]),x=!!O.length,E="inline"===t?(g||s)&&!e:g,S=(0,i.useRef)(E),k=x&&!E,P=x?O:_.current;_.current=P;const C=(0,i.useCallback)((({id:e,question:t})=>{f&&d(!0),y&&b(),r({type:ke,originMessage:m.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),o(t),s||a(T.open),l()}),[o,b,d,l,f,y,m,r,a,s]);(0,i.useEffect)((()=>{if(w.current!==O&&!E){if(x){const e=j.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout((()=>{p(e)}),30)}else j.current&&p(n("suggestions.srUnavailableText"));w.current=O}!S.current&&E?(me(u.current,l),p(n("suggestions.srUnavailableText"))):!x&&j.current&&me(u.current,l),j.current=x,S.current=E}),[O,x,E,l,p,n]);const A=n("suggestions.headingText"),I=n("suggestions.footerText"),N=A?"section":"div";return(0,L.jsx)(vi,{isActive:k,transitionStartState:bi,children:(0,L.jsxs)(N,{className:zn("suggestions"),"aria-labelledby":A?c:null,ref:u,children:[A&&(0,L.jsx)("p",{id:c,className:zn("suggestions__heading"),children:A}),!!P.length&&(0,L.jsx)(Ls,{suggestions:P,onClickSuggestion:C}),I&&!s&&(0,L.jsx)("p",{className:zn("suggestions__footer"),children:I})]})})},Ms=({children:e,className:t=""})=>{const{isOpen:n,isVisible:r,setVisibility:o}=ao(),{namespace:i,layoutMode:s}=ee(),{isInline:a}=hn(),c=Gn(),l=so(),{t:u}=dr(),p=["chat",`chat--layout-${s}`,`namespace--${i}`,...c,t];return n||"app"===s||p.push("chat--collapsed"),l&&p.push("chat--user-responded"),r&&(0,L.jsxs)("section",{className:zn(p),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!a&&n&&o(T.minimized)},tabIndex:"-1","aria-label":u("chat.srLabel"),children:[(0,L.jsx)("div",{className:zn("chat-wrapper"),children:e}),"inline"===s&&n&&(0,L.jsx)(Us,{isAside:!0})]})},zs=({originalError:e,title:t,message:n,buttonText:r,action:o,srText:s})=>{const a=vo(),c=Br(),{sendPolite:l}=wo(),u=xr(),p=e instanceof jn;return(0,i.useEffect)((()=>{p&&a[o]()}),[o,a,p]),(0,i.useEffect)((()=>{!p&&s&&setTimeout((()=>{l(s)}),200)}),[l,s,p]),!p&&(0,L.jsx)("section",{className:zn("interrupt"),"aria-labelledby":c,children:(0,L.jsxs)("div",{className:zn("interrupt__body"),children:[(0,L.jsx)("h2",{id:c,className:zn("interrupt__title"),children:t}),(0,L.jsx)("p",{className:zn("interrupt__message"),children:n}),r&&o&&(0,L.jsx)("div",{className:zn("interrupt__actions"),children:(0,L.jsx)("button",{type:"button",className:zn("button","button--primary"),onClick:()=>{a[o](),u()},children:r})})]})})},$s=(0,e.createContext)({}),Bs=e=>{const t=(0,i.useContext)($s);let n=null;"choice_prompt"===e.payload.type&&(n=t[e.type][e.payload.body.prompt.type]);const r=t[e.type][e.payload.type]||t.fallback;return[r&&"function"!=typeof r?r[e.payload.body.type]||t.fallback:r,n]};function Fs(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 Hs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fs(Object(n),!0).forEach((function(t){qs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vs({children:e,childrenHTML:t,className:n,graphicSrc:r,graphicType:o="icon",iconName:i,iconSize:s,iconClassName:a,dividerType:c}){const l=Boolean(i||r),u=t?{dangerouslySetInnerHTML:{__html:t}}:{children:e};return(0,L.jsxs)("div",{className:zn("divider",c&&`divider--type-${c}`,n),children:[l&&(0,L.jsx)("span",{className:zn("divider__graphic"),children:i?(0,L.jsx)(fi,{name:i,size:s,className:a}):(0,L.jsx)("img",{src:r,className:zn({icon:"icon"===o,avatar:"avatar"===o},a)})}),(0,L.jsx)("div",Hs({className:zn("divider__body")},u))]})}const Ws={month:"long",day:"numeric",year:"numeric"},Gs={hour:"numeric",minute:"numeric"},Ks=({event:e})=>{const t=(()=>{const[e,t]=(0,i.useReducer)((e=>e+1),0);return(0,i.useCallback)((()=>{setTimeout((()=>{t()}))}),[])})(),{date:n,time:r,timeUntilMidnight:o,srText:s}=(e=>{var t;const{t:n}=dr(),r=ee(),o=(null==r||null===(t=r.context)||void 0===t?void 0:t.locale)??[],i=new Date(e),s=new Date,a=new Date(s);a.setHours(24,0,0,0);const c=a-s,l=i.toString(),u=new Intl.DateTimeFormat(o,Gs).format(i);let p=((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})(i,s);switch(p){case"today":p=n("dateTime.today");break;case"yesterday":p=n("dateTime.yesterday");break;default:p=new Intl.DateTimeFormat(o,Ws).format(i)}return{date:p,srText:n("dateTime.srText",{date:p,time:u}),time:u,fullDateTime:l,timeUntilMidnight:c}})(le(e.timeIndicator));return(0,i.useEffect)((()=>{const e=setTimeout((()=>{t()}),o);return()=>{clearTimeout(e)}}),[t,o]),(0,L.jsxs)(Vs,{dividerType:"time-indicator",children:[(0,L.jsxs)("p",{className:zn("divider__time"),"aria-hidden":"true",children:[(0,L.jsx)("span",{children:n}),(0,L.jsx)("span",{children:r})]}),(0,L.jsx)("p",{className:zn("visually-hidden"),children:s})]})},Ys=({event:e,newParticipant:t})=>{const[n,r]=Bs(e);if(!n)return null;const o=["conversation__item"];return"info"===e.type?o.push("conversation__item--source-info"):e.payload.fromClient?o.push("conversation__item--source-user"):o.push("conversation__item--source-agent"),t&&o.push("conversation__item--new-participant"),(0,L.jsxs)("li",{className:zn(o),children:[e.timeIndicator&&(0,L.jsx)(Ks,{event:e}),(0,L.jsx)(n,{event:e,children:(0,L.jsx)(r,{event:e})})]})},Js=({eventPayload:e})=>{const{t}=dr(),{fromClient:n,participant:r}=e,o=(e=>tn().participantInfo.participants[e])(r)||{},{messages:i}=ee(),s=n?t("participants.user.name"):o&&o.name,{showAvatar:a,showName:c}=i[n?"user":"agent"]||{};if(!a&&!c)return null;const l=[];return a&&s&&o.avatar&&l.push((0,L.jsx)("span",{className:zn("message__avatar"),children:(0,L.jsx)("img",{src:o.avatar,className:zn("avatar"),alt:""})})),c&&l.push((0,L.jsx)("span",{className:zn("message__author-name"),children:s})),l.length>0&&(0,L.jsx)("div",{className:zn("message__author"),children:l})},Qs=()=>{const{id:e}=un()||{};return(0,L.jsx)("li",{className:zn("conversation__item","conversation__item--source-agent"),children:(0,L.jsxs)("div",{className:zn("message","message--source-agent","message--type-loading"),children:[(0,L.jsx)(Js,{eventPayload:{fromClient:!1,participant:e}}),(0,L.jsx)("div",{className:zn("message__body"),children:(0,L.jsxs)("span",{className:zn("loader"),children:[(0,L.jsx)("span",{className:zn("loader__part","one")}),(0,L.jsx)("span",{className:zn("loader__part","two")}),(0,L.jsx)("span",{className:zn("loader__part","three")}),(0,L.jsx)("span",{className:zn("loader__part","four")})]})})]})})},Zs=["showParticipant","showTranslationToggle","event","type","modifiers","children","bodyProps","info"];function Xs(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?Xs(Object(n),!0).forEach((function(t){ta(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ta(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const na=function(e){let{showParticipant:t=!0,showTranslationToggle:n=!0,event:r,type:o,modifiers:i,children:s,bodyProps:a={},info: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,Zs);const u=Kn(r),{t:p}=dr(),[,{hasTranslation:h,isTranslated:f,toggleTranslation:d,locale:y}]=ii(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)}))),f&&u.push("message--is-translated"),h&&u.push("message--has-translation"),f&&(a=ea(ea({},a),{},{lang:y})),(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)("div",ea(ea({className:zn(u)},l),{},{children:[t&&(0,L.jsx)(Js,{eventPayload:r.payload}),(0,L.jsx)("div",ea(ea({className:zn("message__body")},a),{},{children:s})),c&&(0,L.jsx)("div",{"aria-hidden":"true",className:zn("message__info"),children:c}),n&&h&&(0,L.jsx)("div",{className:zn("message__translation-info"),children:(0,L.jsx)("button",{className:zn("message__translation-toggle","button","button--secondary"),onClick:d,children:p(f?"translations.toggle.hideButtonText":"translations.toggle.showButtonText")})})]}))})},ra=["event","children"];function oa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oa(Object(n),!0).forEach((function(t){sa(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const aa=e=>{const{payload:t}=e,[n,r]=(0,i.useState)(!1),{sendAction:o,addMessageBubble:s,addDivider:a}=vo(),{activeServiceSessionId:c}=tn().serviceInfo,l=Z(ln),[u]=ii(e),{service:p}=t,h=(0,i.useMemo)((()=>{var t;return ia(ia({},e),{},{payload:ia(ia({},e.payload),{},{body:null===(t=e.payload.body)||void 0===t?void 0:t.prompt,translatedBody:e.payload.translatedBody&&ia(ia({},e.payload.translatedBody),{},{data:e.payload.translatedBody.data.prompt})})})}),[e]),f=u.chooseAgain&&c===p.serviceSessionId&&t.id!==l;return(0,i.useEffect)((()=>{r(t.id===l)}),[t,l]),{body:u,subEvent:h,showOptions:n,chooseAgain:f,onChoiceClickHandler:e=>{f&&a("new_topic"),s(e.text),o({type:"pick_choice",originMessage:t.id,choice:{id:e.id,text:e.text,chooseAgain:f}}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}};let ca={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const la=/[&<>"']/,ua=/[&<>"']/g,pa=/[<>"']|&(?!#?\w+;)/,ha=/[<>"']|&(?!#?\w+;)/g,fa={"&":"&","<":"<",">":">",'"':""","'":"'"},da=e=>fa[e];function ya(e,t){if(t){if(la.test(e))return e.replace(ua,da)}else if(pa.test(e))return e.replace(ha,da);return e}const ba=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function ga(e){return e.replace(ba,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const ma=/(^|[^\[])\^/g;function va(e,t){e=e.source||e,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(ma,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const Oa=/[^\w:]/g,wa=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ja(e,t,n){if(e){let e;try{e=decodeURIComponent(ga(n)).replace(Oa,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!wa.test(n)&&(n=function(e,t){_a[" "+e]||(xa.test(e)?_a[" "+e]=e+"/":_a[" "+e]=Ca(e,"/",!0));const n=-1===(e=_a[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Ea,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(Sa,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const _a={},xa=/^[^:]+:\/*[^/]*$/,Ea=/^([^:]+:)[\s\S]*$/,Sa=/^([^:]+:\/*[^/]*)[\s\S]*$/,Ta={exec:function(){}};function ka(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function Pa(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function Ca(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i!==t||n){if(i===t||!n)break;o++}else o++}return e.substr(0,r-o)}function Aa(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Ia(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function Na(e,t,n,r){const o=t.href,i=t.title?ya(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s,[])};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:i,text:ya(s)}}class Da{constructor(e){this.options=e||ca}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Ca(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Ca(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,s,a,c,l,u,p,h,f,d=t[1].trim();const y=d.length>1,b={type:"list",raw:"",ordered:y,start:y?+d.slice(0,-1):"",loose:!1,items:[]};d=y?`\\d{1,9}\\${d.slice(-1)}`:`\\${d}`,this.options.pedantic&&(d=y?d:"[*+-]");const g=new RegExp(`^( {0,3}${d})((?: [^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=g.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),l=t[2].split("\n",1)[0],u=e.split("\n",1)[0],this.options.pedantic?(i=2,h=l.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,h=l.slice(i),i+=t[1].length),a=!1,!l&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(;e&&(p=e.split("\n",1)[0],l=p,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!t.test(l));){if(l.search(/[^ ]/)>=i||!l.trim())h+="\n"+l.slice(i);else{if(a)break;h+="\n"+l}a||l.trim()||(a=!0),n+=p+"\n",e=e.substring(p.length+1)}}b.loose||(c?b.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(h),r&&(o="[ ] "!==r[0],h=h.replace(/^\[[ xX]\] +/,""))),b.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:h}),b.raw+=n}b.items[b.items.length-1].raw=n.trimRight(),b.items[b.items.length-1].text=h.trimRight(),b.raw=b.raw.trimRight();const m=b.items.length;for(s=0;s<m;s++){this.lexer.state.top=!1,b.items[s].tokens=this.lexer.blockTokens(b.items[s].text,[]);const e=b.items[s].tokens.filter((e=>"space"===e.type)),t=e.every((e=>{const t=e.raw.split("");let n=0;for(const e of t)if("\n"===e&&(n+=1),n>1)return!0;return!1}));!b.loose&&e.length&&t&&(b.loose=!0,b.items[s].loose=!0)}return b}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):ya(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:Pa(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,s=e.align.length;for(n=0;n<s;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(s=e.rows.length,n=0;n<s;n++)e.rows[n]=Pa(e.rows[n],e.header.length).map((e=>({text:e})));for(s=e.header.length,r=0;r<s;r++)e.header[r].tokens=[],this.lexer.inlineTokens(e.header[r].text,e.header[r].tokens);for(s=e.rows.length,r=0;r<s;r++)for(i=e.rows[r],o=0;o<i.length;o++)i[o].tokens=[],this.lexer.inlineTokens(i[o].text,i[o].tokens);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t){const e={type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e={type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}text(e){const t=this.rules.block.text.exec(e);if(t){const e={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:ya(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):ya(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=Ca(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if("\\"===e[o])o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),Na(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Na(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,i,s=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=o.length,r[3]||r[4]){s+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(s-=i,s>0)continue;if(i=Math.min(i,i+s+a),Math.min(n,i)%2){const t=e.slice(1,n+r.index+i);return{type:"em",raw:e.slice(0,n+r.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,n+r.index+i-1);return{type:"strong",raw:e.slice(0,n+r.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=ya(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=ya(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=ya(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=ya(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=ya(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):ya(n[0]):n[0]:ya(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const Ra={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Ta,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Ra.def=va(Ra.def).replace("label",Ra._label).replace("title",Ra._title).getRegex(),Ra.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ra.listItemStart=va(/^( *)(bull) */).replace("bull",Ra.bullet).getRegex(),Ra.list=va(Ra.list).replace(/bull/g,Ra.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ra.def.source+")").getRegex(),Ra._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ra._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Ra.html=va(Ra.html,"i").replace("comment",Ra._comment).replace("tag",Ra._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ra.paragraph=va(Ra._paragraph).replace("hr",Ra.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ra._tag).getRegex(),Ra.blockquote=va(Ra.blockquote).replace("paragraph",Ra.paragraph).getRegex(),Ra.normal=ka({},Ra),Ra.gfm=ka({},Ra.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Ra.gfm.table=va(Ra.gfm.table).replace("hr",Ra.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ra._tag).getRegex(),Ra.gfm.paragraph=va(Ra._paragraph).replace("hr",Ra.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Ra.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ra._tag).getRegex(),Ra.pedantic=ka({},Ra.normal,{html:va("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Ra._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ta,paragraph:va(Ra.normal._paragraph).replace("hr",Ra.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Ra.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const La={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ta,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ta,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function Ua(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Ma(e){let t,n,r="";const o=e.length;for(t=0;t<o;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}La._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",La.punctuation=va(La.punctuation).replace(/punctuation/g,La._punctuation).getRegex(),La.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,La.escapedEmSt=/\\\*|\\_/g,La._comment=va(Ra._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),La.emStrong.lDelim=va(La.emStrong.lDelim).replace(/punct/g,La._punctuation).getRegex(),La.emStrong.rDelimAst=va(La.emStrong.rDelimAst,"g").replace(/punct/g,La._punctuation).getRegex(),La.emStrong.rDelimUnd=va(La.emStrong.rDelimUnd,"g").replace(/punct/g,La._punctuation).getRegex(),La._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,La._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,La._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,La.autolink=va(La.autolink).replace("scheme",La._scheme).replace("email",La._email).getRegex(),La._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,La.tag=va(La.tag).replace("comment",La._comment).replace("attribute",La._attribute).getRegex(),La._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,La._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,La._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,La.link=va(La.link).replace("label",La._label).replace("href",La._href).replace("title",La._title).getRegex(),La.reflink=va(La.reflink).replace("label",La._label).replace("ref",Ra._label).getRegex(),La.nolink=va(La.nolink).replace("ref",Ra._label).getRegex(),La.reflinkSearch=va(La.reflinkSearch,"g").replace("reflink",La.reflink).replace("nolink",La.nolink).getRegex(),La.normal=ka({},La),La.pedantic=ka({},La.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:va(/^!?\[(label)\]\((.*?)\)/).replace("label",La._label).getRegex(),reflink:va(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",La._label).getRegex()}),La.gfm=ka({},La.normal,{escape:va(La.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),La.gfm.url=va(La.gfm.url,"i").replace("email",La.gfm._extended_email).getRegex(),La.breaks=ka({},La.gfm,{br:va(La.br).replace("{2,}","*").getRegex(),text:va(La.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});class za{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ca,this.options.tokenizer=this.options.tokenizer||new Da,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Ra.normal,inline:La.normal};this.options.pedantic?(t.block=Ra.pedantic,t.inline=La.pedantic):this.options.gfm&&(t.block=Ra.gfm,this.options.breaks?t.inline=La.breaks:t.inline=La.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ra,inline:La}}static lex(e,t){return new za(t).lex(e)}static lexInline(e,t){return new za(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,o,i;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let n,r,o,i,s,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,i.index)+"["+Ia("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,i.index)+"["+Ia("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,i.index)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,Ma))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,Ma))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,Ua))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class $a{constructor(e){this.options=e||ca}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+ya(r,!0)+'">'+(n?e:ya(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:ya(e,!0))+"</code></pre>\n"}blockquote(e){return"<blockquote>\n"+e+"</blockquote>\n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return"<li>"+e+"</li>\n"}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+"</p>\n"}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return"<tr>\n"+e+"</tr>\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,n){if(null===(e=ja(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+ya(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=ja(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">",r}text(e){return e}}class Ba{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class Fa{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class Ha{constructor(e){this.options=e||ca,this.options.renderer=this.options.renderer||new $a,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ba,this.slugger=new Fa}static parse(e,t){return new Ha(t).parse(e)}static parseInline(e,t){return new Ha(t).parseInline(e)}parse(e,t=!0){let n,r,o,i,s,a,c,l,u,p,h,f,d,y,b,g,m,v,O,w="";const j=e.length;for(n=0;n<j;n++)if(p=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[p.type]&&(O=this.options.extensions.renderers[p.type].call({parser:this},p),!1!==O||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(p.type)))w+=O||"";else switch(p.type){case"space":continue;case"hr":w+=this.renderer.hr();continue;case"heading":w+=this.renderer.heading(this.parseInline(p.tokens),p.depth,ga(this.parseInline(p.tokens,this.textRenderer)),this.slugger);continue;case"code":w+=this.renderer.code(p.text,p.lang,p.escaped);continue;case"table":for(l="",c="",i=p.header.length,r=0;r<i;r++)c+=this.renderer.tablecell(this.parseInline(p.header[r].tokens),{header:!0,align:p.align[r]});for(l+=this.renderer.tablerow(c),u="",i=p.rows.length,r=0;r<i;r++){for(a=p.rows[r],c="",s=a.length,o=0;o<s;o++)c+=this.renderer.tablecell(this.parseInline(a[o].tokens),{header:!1,align:p.align[o]});u+=this.renderer.tablerow(c)}w+=this.renderer.table(l,u);continue;case"blockquote":u=this.parse(p.tokens),w+=this.renderer.blockquote(u);continue;case"list":for(h=p.ordered,f=p.start,d=p.loose,i=p.items.length,u="",r=0;r<i;r++)b=p.items[r],g=b.checked,m=b.task,y="",b.task&&(v=this.renderer.checkbox(g),d?b.tokens.length>0&&"paragraph"===b.tokens[0].type?(b.tokens[0].text=v+" "+b.tokens[0].text,b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&"text"===b.tokens[0].tokens[0].type&&(b.tokens[0].tokens[0].text=v+" "+b.tokens[0].tokens[0].text)):b.tokens.unshift({type:"text",text:v}):y+=v),y+=this.parse(b.tokens,d),u+=this.renderer.listitem(y,m,g);w+=this.renderer.list(u,h,f);continue;case"html":w+=this.renderer.html(p.text);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(p.tokens));continue;case"text":for(u=p.tokens?this.parseInline(p.tokens):p.text;n+1<j&&"text"===e[n+1].type;)p=e[++n],u+="\n"+(p.tokens?this.parseInline(p.tokens):p.text);w+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+p.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return w}parseInline(e,t){t=t||this.renderer;let n,r,o,i="";const s=e.length;for(n=0;n<s;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(o=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==o||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))i+=o||"";else switch(r.type){case"escape":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;case"text":i+=t.text(r.text);break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}function qa(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),Aa(t=ka({},qa.defaults,t||{})),n){const r=t.highlight;let o;try{o=za.lex(e,t)}catch(e){return n(e)}const i=function(e){let i;if(!e)try{t.walkTokens&&qa.walkTokens(o,t.walkTokens),i=Ha.parse(o,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,i)};if(!r||r.length<3)return i();if(delete t.highlight,!o.length)return i();let s=0;return qa.walkTokens(o,(function(e){"code"===e.type&&(s++,setTimeout((()=>{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),s--,0===s&&i()}))}),0))})),void(0===s&&i())}try{const n=za.lex(e,t);return t.walkTokens&&qa.walkTokens(n,t.walkTokens),Ha.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+ya(e.message+"",!0)+"</pre>";throw e}}qa.options=qa.setOptions=function(e){var t;return ka(qa.defaults,e),t=qa.defaults,ca=t,qa},qa.getDefaults=function(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}},qa.defaults=ca,qa.use=function(...e){const t=ka({},...e),n=qa.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach((e=>{if(e.extensions&&(r=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)}))),e.renderer){const n=qa.defaults.renderer||new $a;for(const t in e.renderer){const r=n[t];n[t]=(...o)=>{let i=e.renderer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.renderer=n}if(e.tokenizer){const n=qa.defaults.tokenizer||new Da;for(const t in e.tokenizer){const r=n[t];n[t]=(...o)=>{let i=e.tokenizer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.tokenizer=n}if(e.walkTokens){const n=qa.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),n&&n.call(this,t)}}r&&(t.extensions=n),qa.setOptions(t)}))},qa.walkTokens=function(e,t){for(const n of e)switch(t.call(qa,n),n.type){case"table":for(const e of n.header)qa.walkTokens(e.tokens,t);for(const e of n.rows)for(const n of e)qa.walkTokens(n.tokens,t);break;case"list":qa.walkTokens(n.items,t);break;default:qa.defaults.extensions&&qa.defaults.extensions.childTokens&&qa.defaults.extensions.childTokens[n.type]?qa.defaults.extensions.childTokens[n.type].forEach((function(e){qa.walkTokens(n[e],t)})):n.tokens&&qa.walkTokens(n.tokens,t)}},qa.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");Aa(t=ka({},qa.defaults,t||{}));try{const n=za.lexInline(e,t);return t.walkTokens&&qa.walkTokens(n,t.walkTokens),Ha.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+ya(e.message+"",!0)+"</pre>";throw e}},qa.Parser=Ha,qa.parser=Ha.parse,qa.Renderer=$a,qa.TextRenderer=Ba,qa.Lexer=za,qa.lexer=za.lex,qa.Tokenizer=Da,qa.Slugger=Fa,qa.parse=qa,qa.options,qa.setOptions,qa.use,qa.walkTokens,qa.parseInline,Ha.parse,za.lex;const Va=e=>{try{return qa(e)}catch(t){return console.log("Could not parse message",e,t),""}},Wa=e=>{const{sendAction:t}=vo();return n=>{n.target&&n.target.dataset.linkId&&t({type:"navigate",originMessage:e,link:{id:n.target.dataset.linkId,url:n.target.getAttribute("href")}})}};var Ga=Object.prototype.toString,Ka=Array.isArray||function(e){return"[object Array]"===Ga.call(e)};function Ya(e){return"function"==typeof e}function Ja(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Qa(e,t){return null!=e&&"object"==typeof e&&t in e}var Za=RegExp.prototype.test,Xa=/\S/;var ec={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},tc=/\s*/,nc=/\s+/,rc=/\s*=/,oc=/\s*\}/,ic=/#|\^|\/|>|\{|&|=|!/;function sc(e){this.string=e,this.tail=e,this.pos=0}function ac(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function cc(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}sc.prototype.eos=function(){return""===this.tail},sc.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},sc.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},ac.prototype.push=function(e){return new ac(e,this)},ac.prototype.lookup=function(e){var t,n,r,o=this.cache;if(o.hasOwnProperty(e))t=o[e];else{for(var i,s,a,c=this,l=!1;c;){if(e.indexOf(".")>0)for(i=c.view,s=e.split("."),a=0;null!=i&&a<s.length;)a===s.length-1&&(l=Qa(i,s[a])||(n=i,r=s[a],null!=n&&"object"!=typeof n&&n.hasOwnProperty&&n.hasOwnProperty(r))),i=i[s[a++]];else i=c.view[e],l=Qa(c.view,e);if(l){t=i;break}c=c.parent}o[e]=t}return Ya(t)&&(t=t.call(this.view)),t},cc.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},cc.prototype.parse=function(e,t){var n=this.templateCache,r=e+":"+(t||lc.tags).join(":"),o=void 0!==n,i=o?n.get(r):void 0;return null==i&&(i=function(e,t){if(!e)return[];var n,r,o,i,s=!1,a=[],c=[],l=[],u=!1,p=!1,h="",f=0;function d(){if(u&&!p)for(;l.length;)delete c[l.pop()];else l=[];u=!1,p=!1}function y(e){if("string"==typeof e&&(e=e.split(nc,2)),!Ka(e)||2!==e.length)throw new Error("Invalid tags: "+e);n=new RegExp(Ja(e[0])+"\\s*"),r=new RegExp("\\s*"+Ja(e[1])),o=new RegExp("\\s*"+Ja("}"+e[1]))}y(t||lc.tags);for(var b,g,m,v,O,w,j=new sc(e);!j.eos();){if(b=j.pos,m=j.scanUntil(n))for(var _=0,x=m.length;_<x;++_)i=v=m.charAt(_),function(e,t){return Za.call(e,t)}(Xa,i)?(p=!0,s=!0,h+=" "):(l.push(c.length),h+=v),c.push(["text",v,b,b+1]),b+=1,"\n"===v&&(d(),h="",f=0,s=!1);if(!j.scan(n))break;if(u=!0,g=j.scan(ic)||"name",j.scan(tc),"="===g?(m=j.scanUntil(rc),j.scan(rc),j.scanUntil(r)):"{"===g?(m=j.scanUntil(o),j.scan(oc),j.scanUntil(r),g="&"):m=j.scanUntil(r),!j.scan(r))throw new Error("Unclosed tag at "+j.pos);if(O=">"==g?[g,m,b,j.pos,h,f,s]:[g,m,b,j.pos],f++,c.push(O),"#"===g||"^"===g)a.push(O);else if("/"===g){if(!(w=a.pop()))throw new Error('Unopened section "'+m+'" at '+b);if(w[1]!==m)throw new Error('Unclosed section "'+w[1]+'" at '+b)}else"name"===g||"{"===g||"&"===g?p=!0:"="===g&&y(m)}if(d(),w=a.pop())throw new Error('Unclosed section "'+w[1]+'" at '+j.pos);return function(e){for(var t,n=[],r=n,o=[],i=0,s=e.length;i<s;++i)switch((t=e[i])[0]){case"#":case"^":r.push(t),o.push(t),r=t[4]=[];break;case"/":o.pop()[5]=t[2],r=o.length>0?o[o.length-1][4]:n;break;default:r.push(t)}return n}(function(e){for(var t,n,r=[],o=0,i=e.length;o<i;++o)(t=e[o])&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}(c))}(e,t),o&&n.set(r,i)),i},cc.prototype.render=function(e,t,n,r){var o=this.getConfigTags(r),i=this.parse(e,o),s=t instanceof ac?t:new ac(t,void 0);return this.renderTokens(i,s,n,e,r)},cc.prototype.renderTokens=function(e,t,n,r,o){for(var i,s,a,c="",l=0,u=e.length;l<u;++l)a=void 0,"#"===(s=(i=e[l])[0])?a=this.renderSection(i,t,n,r,o):"^"===s?a=this.renderInverted(i,t,n,r,o):">"===s?a=this.renderPartial(i,t,n,o):"&"===s?a=this.unescapedValue(i,t):"name"===s?a=this.escapedValue(i,t,o):"text"===s&&(a=this.rawValue(i)),void 0!==a&&(c+=a);return c},cc.prototype.renderSection=function(e,t,n,r,o){var i=this,s="",a=t.lookup(e[1]);if(a){if(Ka(a))for(var c=0,l=a.length;c<l;++c)s+=this.renderTokens(e[4],t.push(a[c]),n,r,o);else if("object"==typeof a||"string"==typeof a||"number"==typeof a)s+=this.renderTokens(e[4],t.push(a),n,r,o);else if(Ya(a)){if("string"!=typeof r)throw new Error("Cannot use higher-order sections without the original template");null!=(a=a.call(t.view,r.slice(e[3],e[5]),(function(e){return i.render(e,t,n,o)})))&&(s+=a)}else s+=this.renderTokens(e[4],t,n,r,o);return s}},cc.prototype.renderInverted=function(e,t,n,r,o){var i=t.lookup(e[1]);if(!i||Ka(i)&&0===i.length)return this.renderTokens(e[4],t,n,r,o)},cc.prototype.indentPartial=function(e,t,n){for(var r=t.replace(/[^ \t]/g,""),o=e.split("\n"),i=0;i<o.length;i++)o[i].length&&(i>0||!n)&&(o[i]=r+o[i]);return o.join("\n")},cc.prototype.renderPartial=function(e,t,n,r){if(n){var o=this.getConfigTags(r),i=Ya(n)?n(e[1]):n[e[1]];if(null!=i){var s=e[6],a=e[5],c=e[4],l=i;0==a&&c&&(l=this.indentPartial(i,c,s));var u=this.parse(l,o);return this.renderTokens(u,t,n,l,r)}}},cc.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},cc.prototype.escapedValue=function(e,t,n){var r=this.getConfigEscape(n)||lc.escape,o=t.lookup(e[1]);if(null!=o)return"number"==typeof o&&r===lc.escape?String(o):r(o)},cc.prototype.rawValue=function(e){return e[1]},cc.prototype.getConfigTags=function(e){return Ka(e)?e:e&&"object"==typeof e?e.tags:void 0},cc.prototype.getConfigEscape=function(e){return e&&"object"==typeof e&&!Ka(e)?e.escape:void 0};var lc={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){uc.templateCache=e},get templateCache(){return uc.templateCache}},uc=new cc;lc.clearCache=function(){return uc.clearCache()},lc.parse=function(e,t){return uc.parse(e,t)},lc.render=function(e,t,n,r){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+(Ka(o=e)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)');var o;return uc.render(e,t,n,r)},lc.escape=function(e){return String(e).replace(/[&<>"'`=\/]/g,(function(e){return ec[e]}))},lc.Scanner=sc,lc.Context=ac,lc.Writer=cc;const pc=lc;function hc(e,t={}){const n={};Object.entries(t).forEach((([e,t])=>{switch(t.type){case"link":n[e]=(e=>`<a href='${e.url}' data-link-id='${e.id}' ${e.newTab?'target="_blank"':""}>${e.name}</a>`)(t);break;case"text":n[e]=t.value}}),{});const r=pc.escape;pc.escape=function(e){return e};const o=pc.render(e,n);return pc.escape=r,o}pc.escape=function(e){return e};const fc=["event"];function dc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dc(Object(n),!0).forEach((function(t){bc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const gc=e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,fc);const[r]=ii(t),o=Wa(t.payload.id),s=(0,i.useMemo)((()=>t.payload.fromClient?{children:(0,L.jsx)("p",{children:r.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:hc(Va(r.text),r.variables)}}}),[r,t]);return(0,L.jsx)(na,yc(yc({type:"text",event:t,onClick:o},n),s))};var mc=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],vc=mc.join(","),Oc="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,wc=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:"AUDIO"!==e.nodeName&&"VIDEO"!==e.nodeName&&"DETAILS"!==e.nodeName||null!==e.getAttribute("tabindex")?e.tabIndex:0:t},jc=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},_c=function(e){return"INPUT"===e.tagName},xc=function(e,t){return!(t.disabled||function(e){return _c(e)&&"hidden"===e.type}(t)||function(e,t){if("hidden"===getComputedStyle(e).visibility)return!0;var n=Oc.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Oc.call(n,"details:not([open]) *"))return!0;if(t&&"full"!==t){if("non-zero-area"===t){var r=e.getBoundingClientRect(),o=r.width,i=r.height;return 0===o&&0===i}}else for(;e;){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(t,e.displayCheck)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(_c(e)||"SELECT"===e.tagName||"TEXTAREA"===e.tagName||"BUTTON"===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!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ec=function(e,t){return!(!xc(e,t)||function(e){return function(e){return _c(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||e.ownerDocument,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)||wc(t)<0)},Sc=mc.concat("iframe").join(","),Tc=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Oc.call(e,Sc)&&xc(t,e)};function kc(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 Pc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Cc,Ac=(Cc=[],{activateTrap:function(e){if(Cc.length>0){var t=Cc[Cc.length-1];t!==e&&t.pause()}var n=Cc.indexOf(e);-1===n||Cc.splice(n,1),Cc.push(e)},deactivateTrap:function(e){var t=Cc.indexOf(e);-1!==t&&Cc.splice(t,1),Cc.length>0&&Cc[Cc.length-1].unpause()}}),Ic=function(e){return setTimeout(e,0)},Nc=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},Dc=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},Rc=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},Lc=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kc(Object(n),!0).forEach((function(t){Pc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},t),i={containers:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:o[n||t]},a=function(e){return!(!e||!i.containers.some((function(t){return t.contains(e)})))},c=function(e){var t=o[e];if("function"==typeof t){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];t=t.apply(void 0,i)}if(!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},l=function(){var e=c("initialFocus");if(!1===e)return!1;if(void 0===e)if(a(r.activeElement))e=r.activeElement;else{var t=i.tabbableGroups[0];e=t&&t.firstTabbableNode||c("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},u=function(){if(i.tabbableGroups=i.containers.map((function(e){var t,n,r,o=(n=[],r=[],function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(vc));return t&&Oc.call(e,vc)&&r.unshift(e),r.filter(n)}(e,(t=t||{}).includeContainer,Ec.bind(null,t)).forEach((function(e,t){var o=wc(e);0===o?n.push(e):r.push({documentOrder:t,tabIndex:o,node:e})})),r.sort(jc).map((function(e){return e.node})).concat(n));if(o.length>0)return{container:e,firstTabbableNode:o[0],lastTabbableNode:o[o.length-1]}})).filter((function(e){return!!e})),i.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},p=function e(t){!1!==t&&t!==r.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!o.preventScroll}),i.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(l()))},h=function(e){var t=c("setReturnFocus",e);return t||!1!==t&&e},f=function(e){var t=Rc(e);a(t)||(Dc(o.clickOutsideDeactivates,e)?n.deactivate({returnFocus:o.returnFocusOnDeactivate&&!Tc(t)}):Dc(o.allowOutsideClick,e)||e.preventDefault())},d=function(e){var t=Rc(e),n=a(t);n||t instanceof Document?n&&(i.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),p(i.mostRecentlyFocusedNode||l()))},y=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==Dc(o.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var t=Rc(e);u();var n=null;if(i.tabbableGroups.length>0){var r=Nc(i.tabbableGroups,(function(e){return e.container.contains(t)}));if(r<0)n=e.shiftKey?i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:i.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var o=Nc(i.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(o<0&&i.tabbableGroups[r].container===t&&(o=r),o>=0){var s=0===o?i.tabbableGroups.length-1:o-1;n=i.tabbableGroups[s].lastTabbableNode}}else{var a=Nc(i.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(a<0&&i.tabbableGroups[r].container===t&&(a=r),a>=0){var l=a===i.tabbableGroups.length-1?0:a+1;n=i.tabbableGroups[l].firstTabbableNode}}}else n=c("fallbackFocus");n&&(e.preventDefault(),p(n))}(e)},b=function(e){if(!Dc(o.clickOutsideDeactivates,e)){var t=Rc(e);a(t)||Dc(o.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())}},g=function(){if(i.active)return Ac.activateTrap(n),i.delayInitialFocusTimer=o.delayInitialFocus?Ic((function(){p(l())})):p(l()),r.addEventListener("focusin",d,!0),r.addEventListener("mousedown",f,{capture:!0,passive:!1}),r.addEventListener("touchstart",f,{capture:!0,passive:!1}),r.addEventListener("click",b,{capture:!0,passive:!1}),r.addEventListener("keydown",y,{capture:!0,passive:!1}),n},m=function(){if(i.active)return r.removeEventListener("focusin",d,!0),r.removeEventListener("mousedown",f,!0),r.removeEventListener("touchstart",f,!0),r.removeEventListener("click",b,!0),r.removeEventListener("keydown",y,!0),n};return(n={activate:function(e){if(i.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),o=s(e,"checkCanFocusTrap");o||u(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,t&&t();var a=function(){o&&u(),g(),n&&n()};return o?(o(i.containers.concat()).then(a,a),this):(a(),this)},deactivate:function(e){if(!i.active)return this;clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,m(),i.active=!1,i.paused=!1,Ac.deactivateTrap(n);var t=s(e,"onDeactivate"),r=s(e,"onPostDeactivate"),o=s(e,"checkCanReturnFocus");t&&t();var a=s(e,"returnFocus","returnFocusOnDeactivate"),c=function(){Ic((function(){a&&p(h(i.nodeFocusedBeforeActivation)),r&&r()}))};return a&&o?(o(h(i.nodeFocusedBeforeActivation)).then(c,c),this):(c(),this)},pause:function(){return i.paused||!i.active||(i.paused=!0,m()),this},unpause:function(){return i.paused&&i.active?(i.paused=!1,u(),g(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return i.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),i.active&&u(),this}}).updateContainerElements(e),n};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 Mc(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 $c=({children:t,onClose:n,"aria-label":r,"aria-labelledby":o,fallBackFocusRef:s})=>{const a=Br(),c=(0,i.useRef)(null),l=(0,i.useRef)(null),[u,p]=(0,i.useState)(!1);return(0,i.useEffect)((()=>(u&&(l.current=Lc(c.current,{initialFocus:s&&s.current?s.current:null}),l.current.activate()),()=>{l.current&&l.current.deactivate()})),[u,s]),(0,i.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()}}),[u]),(0,i.useEffect)((()=>{u&&c.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&n()}))}),[u,n]),(0,i.useLayoutEffect)((()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",a),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),r&&t.setAttribute("aria-label",r),o&&t.setAttribute("aria-labelledby",o),e.appendChild(t),c.current=t,p(!0),()=>{c.current&&(e.removeChild(c.current),c.current=null)}}),[r,o,a]),"function"==typeof t?t({onClose:n,modalRenderFn:t=>c.current&&(0,e.render)(t,c.current)}):c.current&&(0,e.render)((0,e.toChildArray)(t).map((e=>(e.props=Mc(Mc({},e.props),{},{onClose:n}),e))),c.current)},Bc=({url:e,description:t,onClose:n})=>{const{zIndex:r,layoutMode:o,namespace:s}=ee(),a=_o(),c=Gn(),l=(0,i.useRef)(null),{t:u}=dr(),p=["modal",`app--layout-${o}`,`namespace--${s}`,...c],h=e=>{e.stopPropagation()},f=()=>{n()},d=r?{zIndex:r+1}:void 0;return(0,L.jsx)($c,{onClose:n,"aria-label":u("lightbox.heading"),fallBackFocusRef:l,children:({onClose:n,modalRenderFn:r})=>r((n=>(0,L.jsx)("div",{className:zn(p),onClick:f,style:d,children:(0,L.jsxs)("div",{className:zn("modal__float"),tabIndex:"-1",onMouseDown:a,onKeyDown:a,onTouchStart:a,onMouseMove:a,onWheel:a,onPointerDown:a,onPointerMove:a,ref:l,children:[(0,L.jsx)("div",{className:zn("modal__inner"),onClick:h,children:(0,L.jsx)("img",{className:zn("modal__image"),src:e,alt:t})}),(0,L.jsxs)("button",{type:"button",className:zn("modal__close"),onClick:n,children:[(0,L.jsx)(fi,{name:"close",size:"16"}),u("lightbox.closeLabel")]})]})}))(n))})},Fc=({description:e,url:t})=>{const{t:n}=dr(),[r,o]=(0,i.useState)(!1);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("button",{type:"button",className:zn("modal__enlarge"),onClick:()=>{o(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),(0,L.jsx)(fi,{name:"enlarge",size:"32"})]}),r&&(0,L.jsx)(Bc,{url:t,description:e,onClose:()=>{o(!1)}})]})},Hc=["event","descriptorId"];function qc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qc(Object(n),!0).forEach((function(t){Wc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function 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 Gc=["event","descriptorId"];function Kc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kc(Object(n),!0).forEach((function(t){Jc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kc(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}const Qc={[Le.new_topic]:"newtopic"},Zc=["event"];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 el(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const tl={default:({event:e})=>{const{t}=dr(),{subtype:n}=e.payload.body,r=Qc[Le[n]];return(0,L.jsx)(Vs,{dividerType:r,iconName:Le[n],children:(0,L.jsx)("p",{children:t(`dividerKeys.${Le[n]}`)})})},[Le.new_translation]:({event:e})=>{const{t}=dr(),{translationEnabled:n,translationLocale:r,text:o}=e.payload.body,{enableTranslations:s,languages:a}=oi(),c=(0,i.useMemo)((()=>{var e;return null==a||null===(e=a.find((e=>e.locale===r)))||void 0===e?void 0:e.nativeName}),[a,r]);return(0,L.jsxs)(Vs,{iconName:"newTranslation",dividerType:"newtranslation",children:[(0,L.jsx)("p",{className:zn("divider__title"),children:t(n?"translations.divider.startText":"translations.divider.stopText",{language:c})}),n?(0,L.jsx)("p",{children:o}):(0,L.jsx)("button",{className:zn("button","button--secondary"),onClick:()=>{s(r)},children:t("translations.divider.restartButtonText")})]})}},nl=["event"];function rl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ol(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rl(Object(n),!0).forEach((function(t){il(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function il(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const sl=["event"];function al(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 cl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?al(Object(n),!0).forEach((function(t){ll(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):al(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ll(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ul=["event"];function pl(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 hl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pl(Object(n),!0).forEach((function(t){fl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const dl=({children:e,url:t,target:n})=>t?(0,L.jsx)("a",{href:t,download:!0,target:n||void 0,className:zn(["download","download-link"]),children:e}):(0,L.jsx)("span",{className:zn("download"),children:e});function yl({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:o}){const s=e.length,a=(0,i.useCallback)((e=>{const r=Number(e.target.dataset.item||"0"),o=Math.min(s-1,Math.max(0,r));o!==t&&n(o)}),[s,t,n]);return(0,L.jsx)("div",{className:zn("carousel-pagination__wrapper"),role:"group",children:(0,L.jsx)("ul",{className:zn("carousel-pagination"),children:e.map(((e,n)=>{const i=t===n;return(0,L.jsx)("li",{className:zn("carousel-pagination__item",i?"is-active":void 0),children:(0,L.jsx)("button",{className:zn("carousel-pagination__button"),type:"button",onClick:a,"data-item":n,"aria-disabled":i?"true":void 0,"aria-label":o(e,n)})},r(e,n,"pagination-item-"))}))})})}function bl({items:e,currentIndex:t,onChange:n,children:r}){const{t:o}=dr(),i=e.length;return(0,L.jsxs)("div",{className:zn("carousel-controls"),children:[(0,L.jsx)("button",{className:zn("button","button--previous"),"aria-label":o("carousel.controls.previous"),onClick:()=>{n((t-1+i)%i)},children:(0,L.jsx)(fi,{name:"arrowLeft",size:"16"})}),r,(0,L.jsx)("button",{className:zn("button","button--next"),"aria-label":o("carousel.controls.next"),onClick:()=>{n((t+1)%i)},children:(0,L.jsx)(fi,{name:"arrowRight",size:"16"})})]})}function gl(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 ml(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gl(Object(n),!0).forEach((function(t){vl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ol=({id:e,action:t,buttonText:n,description:r,hasFocus:o,image:s,title:a,isCarouselItem:c})=>{const l=(0,i.useRef)(null),{sendMessage:u,sendAction:p,emitEvent:h}=vo(),f=Br(),d=(0,i.useRef)(),y=t.type===ze?"a":"button",b=(0,i.useCallback)((()=>h("action.click_card",{type:Ne,originMessage:e,action:t})),[h,e,t]),g=(0,i.useCallback)((()=>{if(b(),"ask"===t.type)u({body:t.ask});else if("topic"===t.type){const{topic:e,fallbackMessage:n}=t;p({type:"set_topic",body:{name:e,fallbackMessage:n}})}}),[u,t,p,b]),m=(0,i.useMemo)((()=>t.type===ze?{href:t.link,rel:"noopener noreferrer",target:t.newTab?"_blank":"_self",onClick:b}:{onClick:g}),[t,g,b]);return(0,i.useEffect)((()=>{c&&(o&&d.current?window.requestAnimationFrame((()=>l.current.focus())):l.current.blur()),d.current=!0}),[o,c]),(0,L.jsxs)("div",{className:zn("card__wrapper"),id:e,tabIndex:"-1",ref:l,children:[(0,L.jsx)("img",{className:zn("card__image"),src:s,alt:""}),(0,L.jsxs)("div",{className:zn("card__content"),id:e,children:[a&&(0,L.jsx)("h2",{className:zn("card__title"),children:a}),r&&(0,L.jsx)("div",{className:zn("card__description"),dangerouslySetInnerHTML:{__html:Va(r)}}),(0,L.jsx)(y,ml(ml({tabIndex:c&&!o?"-1":void 0,className:zn("button","button--primary"),"aria-describedby":f},m),{},{children:n}))]})]})};function wl(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 jl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wl(Object(n),!0).forEach((function(t){_l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xl({item:e,items:t,index:n,isActive:r}){const{t:o}=dr();return(0,L.jsx)("div",{className:zn("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":o("carousel.slide.label",{index:n+1,total:t.length}),children:(0,L.jsx)(Ol,jl(jl({},e),{},{isCarouselItem:!0,hasFocus:r}))})}const El=(e,t,n)=>`${n}${t}`,Sl=e=>e.label,Tl=({target:e})=>{e.scrollLeft=0};function kl({currentIndex:t,onChange:n,getItemKey:r=El,getItemLabel:o=Sl,items:s}){const a=Br(),c=s.length,[l,u]=(0,i.useState)(Number(t||"0"));(0,i.useEffect)((()=>{u(Number(t||"0"))}),[u,t]);const p=(0,i.useRef)([]);p.current=(0,i.useMemo)((()=>Array(c).fill(1).map((()=>(0,e.createRef)()))),[c]);const h=(0,i.useRef)(!0),f=(0,i.useRef)();return f.current=n,(0,i.useEffect)((()=>{h.current?h.current=!1:f.current&&f.current(l)}),[l]),(0,L.jsxs)("div",{className:zn("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,L.jsx)("div",{className:zn("carousel__slides-wrapper"),onScroll:Tl,children:(0,L.jsx)("div",{id:a,className:zn("carousel__slides"),style:{width:100*c+"%",left:-100*l+"%"},"aria-live":"polite","aria-atomic":"false",children:s.map(((e,t)=>{const n=l===t;return(0,L.jsx)("div",{ref:p.current[t],className:zn("carousel__slide",n?"is-active":void 0),"aria-hidden":n?void 0:"true",children:(0,L.jsx)(xl,{item:e,items:s,currentIndex:l,index:t,isActive:n})},r(e,t,"item-"))}))})}),(0,L.jsx)("div",{className:zn("carousel__controls"),children:(0,L.jsx)(bl,{currentIndex:l,items:s,onChange:u,controlId:a,children:(0,L.jsx)("div",{className:zn("carousel__pagination"),children:(0,L.jsx)(yl,{currentIndex:l,items:s,onChange:u,getItemKey:r,getItemLabel:o})})})})]})}const Pl=(e,t,n="")=>`${n}${e.title}:${t}`,Cl=e=>e.title;function Al(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 Il(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Al(Object(n),!0).forEach((function(t){Nl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Al(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Nl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Dl=["event"];function Rl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ll(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rl(Object(n),!0).forEach((function(t){Ul(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ul(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ml(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 zl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ml(Object(n),!0).forEach((function(t){$l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ml(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Bl={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,ra);const{t:i}=dr(),s=Br(),{body:a,subEvent:c,showOptions:l,chooseAgain:u,onChoiceClickHandler:p,onChooseAgainClickHandler:h}=aa(n);return(0,L.jsxs)(L.Fragment,{children:[(0,e.toChildArray)(r).map((e=>(e.props=ia(ia({},e.props),{},{event:c,descriptorId:s,showTranslationToggle:!1}),e))),u&&(0,L.jsxs)("button",{type:"button",className:zn("button","button--secondary","button--choose-again"),"aria-expanded":l?"true":"false",onClick:h,"aria-describedby":s,children:[i(l?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,L.jsx)(fi,{name:"chevronDown",size:"8"})]}),l&&(0,L.jsx)(na,ia(ia({type:"choice-prompt",showParticipant:!1,event:n},o),{},{children:(0,L.jsx)("ul",{className:zn("choice-prompt","choice-prompt--many"),children:a.choices.map((e=>(0,L.jsx)("li",{className:zn("choice-prompt__item",{[`choice-prompt__item--${e.category}`]:e.category}),children:(0,L.jsx)("button",{type:"button",className:zn("button","button--primary"),onClick:()=>{p(e)},children:e.text})},e.id)))})}))]})},text:gc,image:e=>{let{event:t,descriptorId:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Hc);const[o]=ii(t),{description:s,url:a,isZoomable:c}=o,[l,u]=(0,i.useState)(!1);return(0,L.jsxs)(na,Vc(Vc({event:t,type:"image"},r),{},{children:[(0,L.jsx)("img",{src:a,id:n,alt:s,onLoad:()=>{u(!0)}}),c&&l&&(0,L.jsx)(Fc,{description:s,url:a})]}))},splash:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,sl);const{payload:r}=t,[o]=ii(t),i=Wa(r.id);return(0,L.jsx)(na,cl(cl({type:"splash",event:t,onClick:i},n),{},{bodyProps:{dangerouslySetInnerHTML:{__html:hc(Va(o.text),o.variables)}}}))},video:e=>{let{event:t,descriptorId:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Gc);const[o]=ii(t),{description:i,url:s}=o;return Kn(t).push("message--type-video"),(0,L.jsxs)(na,Yc(Yc({event:t,type:"video"},r),{},{children:[(0,L.jsx)("div",{id:n,className:zn("visually-hidden"),children:i}),(0,L.jsx)("iframe",{title:i,src:s,allow:"autoplay; encrypted-media",allowFullScreen:!0})]}))},upload:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ul);const{t:r}=dr(),[o]=ii(t),{fromClient:s}=t.payload,{filename:a,url:c}=o,l=(0,i.useMemo)((()=>r(c?"fileUpload.srFileDownloadText":"fileUpload.srFileUploadedText",{fileName:a})),[c,a,r]);return(0,L.jsx)(na,hl(hl({event:t,type:"upload"},n),{},{children:(0,L.jsxs)(dl,{url:c,target:s?void 0:"_blank",children:[(0,L.jsx)(fi,{name:"download",size:"16"}),(0,L.jsx)("span",{"aria-hidden":"true",className:zn("file-download"),children:a}),(0,L.jsx)("span",{className:zn("visually-hidden"),children:l})]})}))},cta:({event:e})=>{const[t]=ii(e),n=Wa(e.payload.id),{emitEvent:r}=vo(),o=Br(),s=(0,i.useCallback)((()=>r("action.click_cta",{type:Ne,originMessage:e.payload.id,link:{url:t.buttonLink}})),[r,t,e]);return(0,L.jsxs)(na,{type:"cta",event:e,children:[(0,L.jsx)("div",{className:zn("cta__content"),id:o,dangerouslySetInnerHTML:{__html:Va(t.description)},onClick:n}),(0,L.jsx)("a",{className:zn("button","button--primary"),"aria-describedby":o,href:t.buttonLink,rel:"noreferrer",target:t.buttonNewTab?"_blank":"_self",onClick:s,children:t.buttonText})]})},carousel:({event:e})=>{const[t]=ii(e),n=t.cards;return(0,L.jsx)(na,{event:e,modifiers:"type-carousel",children:(0,L.jsx)(kl,{items:n,ItemComponent:xl,getItemKey:Pl,getItemLabel:Cl})})},card:({event:e})=>{const[t]=ii(e),n=Br();return(0,L.jsx)(na,{type:"card",event:e,children:(0,L.jsx)(Ol,Il({id:n},t))})}},info:{text:gc,divider:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Zc);const r=tl[Le[t.payload.body.subtype]]||tl.default;return(0,L.jsx)(r,function(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){el(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}({event:t},n))},translation:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,nl);const{t:r}=dr(),[o]=ii(t);return(0,L.jsx)(na,ol(ol({type:"text",event:t},n),{},{children:r(o.key.join("."),o.variables)}))},timeIndicator:Ks},participant:{participant:({event:e})=>{const{agent:t}=function(){const{agentParticipant:e,userParticipant:t}=Z(A);return{agent:e,user:t}}(),{participant:n}=e.payload,[r]=ii(e),o=(0,i.useMemo)((()=>r?pc.render(Va(r),n):void 0),[r,n]);if(!o)return null;const s=n.avatar||(null==t?void 0:t.avatar);return(0,L.jsx)(Vs,{graphicSrc:s,graphicType:n.avatar?"avatar":void 0,iconName:s?void 0:"balloon",childrenHTML:o,dividerType:"participant"})}},service_data:{suggestion:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Dl);const{userResponded:r}=ee(),[o,s]=(0,i.useState)(!0),{t:a}=dr(),c=a("suggestions.headingText"),l=a("suggestions.footerText"),{sendAction:u,addMessageBubble:p}=vo(),{suggestions:h,payload:f}=(e=>{const{payload:t}=e,[n]=ii(e);return{suggestions:n,payload:t}})(t),d=(0,i.useCallback)((({id:e,question:t})=>{s(!1),u({type:ke,originMessage:f.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),p(t)}),[f,u,p,s]);return!o||r?null:(0,L.jsxs)("div",{className:zn("suggestions","suggestions--conversation"),children:[c&&(0,L.jsx)("p",{className:zn("suggestions__heading"),children:c}),(0,L.jsxs)(na,Ll(Ll({type:"suggestions",showParticipant:!1,event:t},n),{},{children:[(0,L.jsx)(Ls,{className:"suggestions__list--conversation",onClickSuggestion:d,suggestions:h}),l&&(0,L.jsx)("p",{className:zn("suggestions__footer"),children:l})]}))]})}}},Fl=({children:e})=>{const{customComponents:t}=ee(),n=(0,i.useMemo)((()=>Object.keys(Bl).reduce(((e,n)=>zl(zl({},e),{},{[n]:zl(zl({},Bl[n]),t?t[n]:{})})),{fallback:gc})),[t]);return(0,L.jsx)($s.Provider,{value:n,children:e})},Hl=()=>{const{t:e}=dr(),{showDisclaimer:t}=ee();return t&&(0,L.jsxs)("div",{className:zn("disclaimer"),tabIndex:"0",children:[(0,L.jsx)("h2",{className:zn("disclaimer__title"),children:e("disclaimer.title")}),(0,L.jsx)("div",{className:zn("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]})},ql=()=>{const{t:e}=dr(),t=(0,i.useRef)(null),n=on(),r=tn().isLoading,{isOpen:o}=ao(),s=cn(),a=xr();return(0,i.useEffect)((()=>{window.requestAnimationFrame((()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)}))}),[n,r,o]),(0,L.jsxs)(L.Fragment,{children:[o&&(0,L.jsx)("a",{className:zn("skip-link"),href:`#${s}`,onClick:e=>{e.preventDefault(),a()},children:e("skiplinkText")}),(0,L.jsx)("div",{className:zn("chat__body"),ref:t,children:(0,L.jsxs)("div",{className:zn("conversation__container"),children:[(0,L.jsx)(Hl,{}),(0,L.jsxs)("ol",{className:zn("conversation"),children:[(0,L.jsx)(Fl,{children:(()=>{let e=null;return n.map((t=>{const{type:n,payload:r}=t,{participant:o,fromClient:i}=r;let s=!1;if("participant"!==n){const n=i?"seamly-client-participant":o;"info"!==t.type&&e!==n&&(s=!0),e=n}return(0,L.jsx)(Ys,{event:t,newParticipant:s},t.payload.id)}))})()}),r&&(0,L.jsx)(Qs,{})]})]})})]})},Vl=({baseClassName:e,children:t,title:n})=>{const r=cn(),o=Br();return(0,L.jsxs)("section",{id:r,className:zn(e),"aria-describedby":o,tabIndex:"-1",children:[(0,L.jsx)("h2",{className:zn(`${e}__title`),id:o,children:n}),t]})},Wl=()=>{const{t:e}=dr(),t=xr(),n=_o(),{emitEvent:r}=vo(),{isActive:o,remaining:i,timer:s,endCountdown:a}=zo(),c=i>0,l=e(c?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,L.jsx)(Vl,{baseClassName:"idle",title:l,children:c&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:zn("idle__count-container"),children:o&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("span",{className:zn("idle__count-text"),children:e("idleDetachWarning.countdownText")}),(0,L.jsx)("span",{className:zn("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",s)})]})}),(0,L.jsxs)("div",{className:zn("idle__options"),children:[(0,L.jsx)("button",{type:"button",className:zn("button","button--primary"),onClick:()=>{n(),a(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),(0,L.jsx)("button",{type:"button",className:zn("button","button--primary"),onClick:()=>{a(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},Gl=()=>{const{t:e}=dr(),t=_o(),{name:n}=un()||{},{continueChat:r,restartChat:o}=Bo();return(0,L.jsx)(Vl,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:(0,L.jsxs)("div",{className:zn("prompt__options"),children:[(0,L.jsx)("button",{type:"button",className:zn("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),(0,L.jsx)("button",{type:"button",className:zn("button","button--primary"),onClick:o,children:e("resumeConversationPrompt.detachButton")})]})})},Kl=["id","name","type","labelText","labelClass","contentHint","aria-describedby"];function Yl(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 Jl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yl(Object(n),!0).forEach((function(t){Ql(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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 Zl=function(e){let{id:t,name:n,type:r,labelText:o,labelClass:i,contentHint:s,"aria-describedby":a}=e,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Kl);const{isSubmitted:l}=zi(),[u,{error:p}]=$i(n),h=l&&p,f=[];return a&&f.push(a),s&&f.push(`${t}-content-hint`),h&&f.push(`${t}-error`),(0,L.jsx)(is,{id:t,contentHint:s,validity:!h,errorText:p,labelText:o,labelClass:i,children:(0,L.jsx)("input",Jl(Jl({id:t,name:n,type:r,"aria-invalid":h?"true":"false","aria-describedby":f.join(" ")||null},u),c))})};function Xl({controlName:e,skipLinkId:t}){const{t:n}=dr(),{sendAssertive:r}=wo(),{emitEvent:o}=vo(),s=(()=>{const{sendAction:e}=vo(),{features:t}=Ir(),{typingPeekahead:n}=t||{},r=(0,i.useRef)(null),o=(0,i.useRef)(null),s=(0,i.useRef)(!1),a=(0,i.useRef)(null);(0,i.useEffect)((()=>()=>{clearInterval(a.current),clearTimeout(r.current),clearTimeout(o.current)}),[]);const c=(t,r)=>{e(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xo(Object(n),!0).forEach((function(t){Eo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({type:Pe,state:t},n&&n.enabled?{body:{currentMessage:r}}:{}))};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(s.current=!0,a.current||(c(!0,e.target.value),a.current=setInterval((()=>{s.current?n&&n.enabled&&c(!0,e.target.value):(clearInterval(a.current),a.current=null)}),2e3)),clearTimeout(r.current),clearTimeout(o.current),r.current=setTimeout((()=>{s.current=!1}),300),o.current=setTimeout((()=>{c(!1,e.target.value)}),2e3))}})(),{setBlockAutoEntrySwitch:a}=Po(),{hasCharacterLimit:c,characterLimit:l,reachedCharacterWarning:u,reachedCharacterLimit:p,remainingChars:h}=function(e){const{t}=dr(),{sendAssertive:n}=wo(),{hasLimit:r,limit:o}=(()=>{const{entryMeta:{options:{text:e}}}=tn(),{limit:t}=e||{};return{hasLimit:null!=t,limit:null!=t?t:null}})(),s=(0,i.useMemo)((()=>ce(n,300)),[n]),a=(0,i.useMemo)((()=>ce(((e,n)=>{e&&s(t("input.srCharacterLimitText",{limit:n}))}),300)),[s,t]),[{value:c}]=$i(e),l=r&&c?o-c.length:o,u=!!r&&l<=50,p=!!r&&l<0;return(0,i.useEffect)((()=>{a(u,l)}),[u,l,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:u,reachedCharacterLimit:p,remainingChars:l}}(e),[{value:f}]=$i(e),d=!!f,y=(0,i.useCallback)((()=>{u&&r(n("input.srCharacterLimitText",{limit:h})),o("ui.inputFocus")}),[n,r,u,h,o]),b=(0,i.useMemo)((()=>n("input.inputPlaceholder",{hasLimit:c,limit:c?l:null})),[n,c,l]),g=(0,i.useMemo)((()=>n("input.inputLabel",{hasLimit:c,limit:c?l:null})),[n,c,l]);return(0,i.useLayoutEffect)((()=>(a(d),()=>{a(!1)})),[a,d]),(0,L.jsxs)(rs,{className:zn("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,L.jsxs)("div",{className:zn(["input--text__container",...u&&!p?["character-warning"]:[],...p?["character-exceeded"]:[]]),children:[(0,L.jsx)(Zl,{id:t,type:"text",name:e,className:zn("input__text"),autocomplete:"off",placeholder:b,labelText:g,labelClass:zn("visually-hidden"),"aria-invalid":c?p:null,onKeyUp:s,onFocus:y}),(0,L.jsx)("div",{className:zn("character-count"),children:u&&(0,L.jsx)("span",{children:h})})]}),(0,L.jsx)("button",{className:zn("button","input__submit"),type:"submit",disabled:!d||p,children:(0,L.jsx)(fi,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}function eu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tu(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){nu(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 nu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ru(){return(ru=Object.assign||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}).apply(this,arguments)}const ou="userText";function iu(e){let t=ru({},e);const{isOpen:n,setVisibility:r}=ao(),o=cn(),s=xr(),{sendMessage:a}=vo(),c=(0,i.useCallback)(((e,{updateControlValue:t})=>{a({body:e.userText}),t(ou,""),s(),n||r(T.open)}),[a,s,n,r]);return(0,L.jsx)(Vi,tu(tu({},t),{},{formId:"textEntry",persistData:!0,onSubmit:c,children:(0,L.jsx)(Xl,{controlName:ou,skipLinkId:o})}))}const su=()=>{const{t:e}=dr(),{showFileUpload:t,serviceAllowsUploads:n}=zr(),[r,o]=(0,i.useState)(n),s=xr(),a=(0,i.useRef)(null),{setUserEntryType:c,activeEntry:l}=Po(),u=(0,i.useRef)(null),{sendPolite:p}=wo(),h=!!un();return(0,i.useEffect)((()=>{me(u.current,(()=>{n||s()})),o(n)}),[n,s]),(0,i.useEffect)((()=>{a.current&&!n&&p(e("fileUpload.srUnavailableText")),!1===a.current&&n&&p(e("fileUpload.srAvailableText")),h&&(a.current=n)}),[n,h,p,e]),!t&&l!==Ee&&(0,L.jsx)(vi,{isActive:r,transitionStartState:gi,children:(0,L.jsx)("div",{className:zn("upload-toggle-wrapper"),children:(0,L.jsx)(vi,{isActive:r,transitionStartState:mi,children:(0,L.jsx)("button",{className:zn(["button","button--secondary","upload-toggle"]),ref:u,disabled:r?null:"true",type:"button",onClick:()=>{c(Ee),s()},children:(0,L.jsx)(fi,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})},au=()=>{const{t:e}=dr(),{currentUploads:t}=$r();return(0,L.jsx)("div",{className:zn("progress"),children:t.map((({id:t,name:n,progress:r,uploading:o,error:i})=>(0,L.jsxs)("div",{className:zn("progress_container"),children:[(0,L.jsxs)("div",{className:zn("progress__text"),children:[(0,L.jsx)("span",{className:zn("progress__text--file-name"),children:n}),(0,L.jsx)("span",{className:zn("progress__text--percentage"),children:`${r}%`})]}),(0,L.jsx)(os,{error:i}),(0,L.jsx)("progress",{className:zn("progress__bar"),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-label":e("fileUpload.srProgressLabel",{fileName:n}),max:"100","aria-valuenow":r,value:r,"aria-busy":o,children:`${r}%`})]},t)))})};function cu({id:e,name:t,labelText:n,contentHint:r,outputText:o,accept:s}){const{isSubmitted:a}=zi(),[c,l]=(0,i.useState)(!1),[{onInput:u,onBlur:p},{error:h}]=$i(t),f=Br(),d=Br(),y=Br(),b=a&&h,g=[y];r&&g.push(d),b&&g.push(f);const m=(0,i.useCallback)((()=>{l(!0)}),[l]),v=(0,i.useCallback)((()=>{l(!1),p()}),[l,p]),O=(0,i.useCallback)((e=>{const t={target:{value:e.target.files}};u(t)}),[u]);return(0,L.jsxs)("div",{className:zn("upload__container"),children:[r&&(0,L.jsx)("span",{className:zn("upload__content-hint"),id:d,children:r}),(0,L.jsx)(os,{id:f,error:b&&h}),(0,L.jsx)("div",{className:zn(["file-upload",...c?["focus-within"]:[]]),children:(0,L.jsxs)("label",{htmlFor:e,className:zn("upload__label"),children:[(0,L.jsx)(fi,{name:"upload",size:"32"}),(0,L.jsxs)("div",{children:[(0,L.jsx)("span",{className:zn(["upload__label--text"]),children:n}),(0,L.jsx)("input",{id:e,className:zn("upload__input"),type:"file",name:t,onChange:O,"aria-invalid":b?"true":"false","aria-describedby":g.join(" "),accept:s||null,onFocus:m,onBlur:v}),(0,L.jsx)("span",{className:zn("upload__output"),"aria-hidden":"true",id:y,children:o})]})]})})]})}function lu({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:o,isComplete:i,onClickCancel:s}){const{t:a}=dr(),[{value:c}]=$i(t),l=c&&c.length>0,u=l?c[0].name:"";return(0,L.jsxs)(rs,{className:zn("upload-form"),children:[(0,L.jsx)(cu,{name:t,id:e,accept:n,labelText:a("fileUpload.labelText"),outputText:a("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),(0,L.jsxs)("div",{className:zn("upload__button-container"),children:[(0,L.jsx)("button",{id:o||!i?e:void 0,type:"button",onClick:s,className:zn("button","button--secondary","upload__cancel"),children:a("fileUpload.cancelButtonText")}),(0,L.jsx)("button",{className:zn("button","button--primary"),type:"submit",children:a("fileUpload.uploadButtonText")})]})]})}const uu="fileListForm",pu="fileList",hu=()=>{const{t:e}=dr(),{sendPolite:t,sendAssertive:n}=wo(),r=cn(),o=xr(),{serviceAllowsUploads:s,allowedMimeTypes:a,maxSize:c}=zr(),l=(0,i.useRef)(null),u=(0,i.useRef)(s),{cancelEntrySelection:p}=Po(),{uploadFile:h,clearUploads:f,isUploading:d,isComplete:y}=$r(),{hasFile:b,selectedFileName:g,uploadHandle:m,hasServerError:v,progress:O}=((e,t)=>{const n=X(Ni,{formId:e,name:t},[e,t]),{currentUploads:r}=$r(),o=n&&n.length>0;let i=null,s=!1,a=0;if(r&&r.length>0){const e=r[0];i=e.uploadHandle,s=!!e.error,a=e.progress}return{hasFile:o,selectedFileName:o?n[0].name:"",uploadHandle:i,hasServerError:s,progress:a}})(uu,pu),w=Br(),j=(0,i.useRef)(!0),_=e("fileUpload.contentHint",{size:pe(c)}),x=(0,i.useRef)(""),E=(0,i.useRef)(null);(0,i.useEffect)((()=>{x.current&&E.current.contains(document.activeElement)&&"INPUT"===document.activeElement.tagName&&n(_),x.current=_}),[_,n]),(0,i.useEffect)((()=>{if(O>0)switch(O){case 1:t(e("fileUpload.srStartedText"));break;default:t(`${O}%`)}}),[O,t,e]),(0,i.useEffect)((()=>{j.current||d||!y||(f(),p(),o(),setTimeout((()=>{t(e("fileUpload.srCompleteText"))}),300)),j.current=y}),[d,y,f,p,o,t,e]);const S=(0,i.useCallback)((({fileList:e})=>{h(e[0]),o()}),[h,!1,o]),T=(0,i.useCallback)((()=>{m&&m.abort(),f(),p(),o()}),[m,f,p,o]),k=(0,i.useMemo)((()=>({[pu]:[ws((()=>s),e("fileUpload.errors.unavailable")),ws(_s,e("fileUpload.errors.noFile")),ws(js,e("fileUpload.errors.tooLarge"),c)]})),[c,s,e]);return(0,L.jsx)("div",{className:zn(["upload",...v?["upload--error"]:[]]),ref:E,children:(0,L.jsxs)(Vi,{formId:uu,persistData:!0,onSubmit:S,validationSchema:k,children:[(d||!y)&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(au,{}),(0,L.jsx)("div",{className:zn("upload__button-container"),children:(0,L.jsx)("button",{id:d||!y?r:void 0,type:"button",onClick:T,ref:l,className:zn("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!d&&y&&(0,L.jsx)(lu,{controlName:pu,skiplinkId:r,accept:a.join(", "),contentHint:_,isComplete:y,isUploading:d,outputText:e("fileUpload.selectedText",{hasFile:b,filename:g}),onClickCancel:T}),!u.current&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("span",{className:zn("notification"),id:w,children:e("fileUpload.unavailableText")}),(0,L.jsx)("div",{className:zn("upload__button-container"),children:(0,L.jsx)("button",{id:d||!y?r:void 0,type:"button",onClick:T,className:zn("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})};function fu(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 du(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fu(Object(n),!0).forEach((function(t){yu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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 bu=()=>{const{isOpen:e}=ao(),t=(0,i.useRef)(null),{hasCountdown:n}=zo(),[r,o]=(0,i.useState)(n),{hasPrompt:s}=Bo(),[a,c]=(0,i.useState)(s),l=xr(),u=(0,i.useRef)(!1),{activeEntry:p}=Po(),[h,f]=(0,i.useState)({text:iu,upload:hu}),[d,y]=(0,i.useState)((()=>p)),b=ee(),{accountAllowsUploads:g}=zr(),m=(0,i.useCallback)((()=>{me(t.current,(()=>{l()}))}),[l]);(0,i.useEffect)((()=>{const{customComponents:e}=b,{entry:t}=e||{};t&&f((e=>du(du({},e),t)))}),[b]),(0,i.useEffect)((()=>{m(),o(n),c(s)}),[n,s,m]),(0,i.useEffect)((()=>{y(p),m()}),[p,m,t]),u.current=!(!t.current||!t.current.contains(document.activeElement));const v=h[d];return(0,L.jsxs)("div",{className:zn("chat__entry"),ref:t,children:[r&&(0,L.jsx)(Wl,{}),a&&(0,L.jsx)(Gl,{}),(0,L.jsxs)("div",{className:zn(["entry__body",...n||s?["entry__body--hidden"]:[]]),children:[d!==Ee&&g&&e&&(0,L.jsx)(su,{}),(0,L.jsx)(v,{})]})]})};function gu({controlName:e,describedById:t}){const{t:n}=dr();return(0,L.jsxs)(rs,{noValidate:"true",className:zn("options__form"),children:[(0,L.jsx)(Zl,{name:e,type:"email",className:zn("transcript__input"),"aria-describedby":t,labelClass:zn("label"),labelText:n("options.sendTranscript.label")}),(0,L.jsx)("div",{className:zn("options__actions"),children:(0,L.jsx)("button",{type:"submit",className:zn("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const mu="email",vu={sendTranscript:()=>{const[e,t]=(0,i.useState)(void 0),{hideOption:n}=Ir(),{focusButton:r}=Nr(),{t:o}=dr(),s=Br(),{sendAction:a}=vo(),c=(0,i.useMemo)((()=>({[mu]:[ws(Es,o("options.sendTranscript.noEmailText")),ws(xs,o("options.sendTranscript.invalidEmailText"))]})),[o]),l=(0,i.useCallback)((e=>{const t=e.email.trim();a({type:"send_transcript",body:{emailAddress:t}}),n(),r()}),[a,n,r]),u=(0,i.useCallback)((({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)}),[t]);return(0,L.jsxs)(Oi,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),children:[(0,L.jsx)("p",{className:zn("options__description"),id:s,children:o("options.sendTranscript.description")}),(0,L.jsx)(Vi,{formId:"sendTranscript",onSubmit:l,validationSchema:c,onError:u,children:(0,L.jsx)(gu,{controlName:mu,describedById:s})})]})}},Ou=()=>{const{optionActive:e}=Ir(),t=(0,i.useRef)(null),n=vu[e||t.current];return e&&(t.current=e),n?(0,L.jsx)(n,{}):null},wu=()=>{const{t}=dr(),{menuOptions:n,showOption:r,panelActive:o,hideOption:s}=Ir(),{id:a}=Nr(),c=(0,i.useRef)(null),[l,u]=(0,i.useState)(!1),p=(0,i.useRef)(null),h=n.length,f=(0,i.useRef)(Array.from({length:h},(()=>(0,e.createRef)()))),d=(0,i.useRef)(!1),y=h>1,b=n[0],g=(0,i.useMemo)((()=>{var e;return null==b||null===(e=b.name)||void 0===e?void 0:e.trim().replace(/\s+/g,"")}),[b]);return(0,i.useEffect)((()=>()=>{clearTimeout(c.current)}),[]),(0,i.useEffect)((()=>{l&&!d.current&&requestAnimationFrame((()=>{requestAnimationFrame((()=>{const e=n.findIndex((e=>e.available)),t=-1===e?0:e;ge(f.current[t])}))})),d.current=l}),[l,n]),h?(0,L.jsxs)("div",{className:zn("options__container"),onKeyDown:e=>{l&&(be(e)===ye.Escape&&(u(!1),ge(p.current)),be(e)===ye.Home&&(ge(f.current[0]),e.preventDefault()),be(e)===ye.End&&(ge(f.current[h-1]),e.preventDefault()))},onfocusout:()=>{y&&(c.current=setTimeout((()=>{u(!1)}),200))},onfocusin:()=>{clearTimeout(c.current)},children:[(0,L.jsx)(vi,{transitionStartState:bi,isActive:o,children:(0,L.jsx)("div",{className:zn("options__dialog"),children:(0,L.jsx)(Ou,{})})}),y&&(0,L.jsx)(vi,{isActive:l,transitionStartState:bi,children:(0,L.jsx)("ul",{className:zn(["options__menu"]),role:"menu",tabIndex:"-1","aria-labelledby":a,children:n.map((({name:e,title:o,available:i},s)=>(0,L.jsx)("li",{className:zn("options__menu__item"),role:"menuitem","data-testid":e,children:(0,L.jsxs)("button",{type:"button",ref:e=>{f.current[s]=e},className:zn(["button","button--secondary",...i?[]:["button--disabled"]]),onKeyDown:e=>((e,t)=>{if(be(e)===ye.ArrowDown){const n=Math.min(h-1,t+1);ge(f.current[t===n?0:n]),e.preventDefault()}if(be(e)===ye.ArrowUp){const n=Math.max(0,t-1);ge(f.current[t===n?h-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&&ge(f.current[o])})(e,s),onClick:()=>((e,t)=>{t&&(u(!1),r(e))})(e,i),"aria-disabled":i?null:"true",children:[(0,L.jsxs)("span",{className:zn("button__text"),children:[o,!i&&" "]}),!i&&(0,L.jsx)("span",{className:zn("button__state"),children:t("options.unavailableText")})]})},e)))})}),(0,L.jsxs)("button",{type:"button",className:zn(["button","button--secondary","chat__options__button",...!y&&g?[`chat__options__button--${g}`]:[],...y||b.available?[]:["button--disabled"]]),id:a,onClick:()=>{o&&s(),y?u((e=>!e)):b.available&&r(b.name)},onKeyDown:y?e=>{be(e)===ye.ArrowDown&&(u(!0),e.preventDefault())}:null,ref:p,"aria-haspopup":y?"menu":null,"aria-expanded":y?l.toString():null,"aria-disabled":y||b.available?null:"true",children:[y&&(0,L.jsx)(fi,{name:"options",size:"32"}),(0,L.jsx)("span",{className:zn("button__text"),children:y?t("options.openButtonText"):`${b.title}${b.available?"":" "}`}),!y&&!b.available&&(0,L.jsx)("span",{className:zn("button__state"),children:t("options.unavailableText")})]})]}):null};function ju(){const{menuOptions:e,allowOptionSelection:t}=Ir(),{isAvailable:n}=oi();return n||t&&e.length?(0,L.jsxs)("div",{className:zn("chat__options"),children:[n&&(0,L.jsx)("div",{className:zn("chat__options-item","chat__options-item--left"),children:(0,L.jsx)(Ps,{})}),t&&(0,L.jsx)("div",{className:zn("chat__options-item","chat__options-item--right"),children:(0,L.jsx)(wu,{})})]}):null}function _u(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 xu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Eu=function({children:e,interruptComponent:t}){const{hasInterrupt:n,meta:r}=Gr(),{isOpen:o}=ao();return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(As,{}),(0,L.jsx)("div",{className:zn("chat__container"),children:n?o?(0,L.jsx)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_u(Object(n),!0).forEach((function(t){xu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},r)):null:e}),o&&(0,L.jsx)(ju,{})]})};function Su(){const{preChatEvents:e,layoutMode:t}=ee(),{hasInterrupt:n}=Gr(),{isOpen:r}=ao(),o=!(n||!e.length||r);return o&&(0,L.jsx)("ul",{className:zn("pre-chat-messages",`pre-chat-messages--${t}`),"aria-hidden":!o,children:e.map((e=>(0,L.jsx)("li",{className:zn("pre-chat-messages__message"),children:(0,L.jsx)(Tu,{event:e})},e.payload.id)))})}function Tu({event:e}){const[t]=Bs(e);return(0,L.jsx)(t,{event:e})}function ku(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pu(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 e=te(),t=un(),{hasInterrupt:n}=Gr(),r=t&&!n,o=r?t.avatar:e;return o?(0,L.jsx)("img",{className:zn(r?"avatar":"icon"),src:o,alt:""}):(0,L.jsx)(fi,{name:"avatar",size:"32"})},Au=({onClick:e})=>{const t=Vn(),{t:n}=dr(),r=n(t?"window.openButton.srContinue":"window.openButton.srStart"),o=xr(),{isOpen:s}=ao(),a=an(),c=(0,i.useCallback)((()=>{e(),o()}),[o,e]);return(0,L.jsx)(vi,{isActive:!s,transitionStartState:gi,children:(0,L.jsxs)("button",{className:zn("window-open-button"),"aria-label":r,"aria-hidden":s,onClick:c,children:[(0,L.jsx)("span",{className:zn("message-count"),"aria-hidden":"true",children:!!a&&a}),(0,L.jsx)(Cu,{})]})})},Iu=({onClick:e})=>{const{t}=dr(),n=(0,i.useCallback)((()=>e()),[e]);return(0,L.jsx)("button",{type:"button",className:zn("button","collapse-button"),onClick:n,children:(0,L.jsx)(fi,{name:"chevronDown",size:"32",alt:t("window.srCollapseButton")})})},Nu={app:()=>(Ao(),(0,L.jsx)(Ms,{children:(0,L.jsxs)(Eu,{interruptComponent:zs,children:[(0,L.jsx)(ql,{}),(0,L.jsx)(bu,{})]})})),inline:()=>{Ao();const{isOpen:e}=ao(),{hasInterrupt:t,meta:n}=Gr();return t&&!e?(0,L.jsx)(zs,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ku(Object(n),!0).forEach((function(t){Pu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ku(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n)):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(vi,{isActive:!e,transitionStartState:gi,children:(0,L.jsxs)("div",{className:zn("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,L.jsx)(Su,{}),(0,L.jsx)(Us,{})]})}),(0,L.jsx)(vi,{isActive:e,transitionStartState:gi,children:(0,L.jsx)(Ms,{children:(0,L.jsxs)(Eu,{interruptComponent:zs,children:[e&&(0,L.jsx)(ql,{}),(0,L.jsx)(bu,{})]})})})]})},window:()=>{const{openChat:e,closeChat:t}=Ao(),{isOpen:n}=ao(),r=so(),{t:o}=dr(),s=o("window.chat.continue"),a=(0,i.useMemo)((()=>({payload:{body:{text:s}}})),[s]);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Au,{onClick:e}),(0,L.jsx)(vi,{isActive:!n&&!r,transitionStartState:gi,children:(0,L.jsx)("div",{className:zn("unstarted-wrapper","unstarted-wrapper--window"),children:(0,L.jsx)(Su,{})})}),(0,L.jsx)(vi,{isActive:!n&&r,transitionStartState:bi,children:(0,L.jsx)("div",{className:zn("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,L.jsx)(gc,{event:a})})}),(0,L.jsx)(vi,{isActive:n,transitionStartState:bi,children:(0,L.jsxs)(Ms,{children:[n&&(0,L.jsx)(Iu,{onClick:t}),(0,L.jsxs)(Eu,{interruptComponent:zs,children:[(0,L.jsx)(ql,{}),(0,L.jsx)(bu,{})]})]})})]})}},Du=()=>{const[,e]=jr(),{namespace:t,layoutMode:n,zIndex:r}=ee(),{isOpen:o,isVisible:s}=ao(),a=Gn(),c=so(),{locale:l}=dr(),u=Nu[n],p=(0,i.useCallback)((t=>{e(t)}),[e]),h=(0,i.useMemo)((()=>{if(l&&document.querySelector("html").getAttribute("lang")!==l)return l}),[l]);if(!u)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const f=["app",`app--layout-${n}`,`namespace--${t}`,...a];return o||"app"===n||f.push("app--collapsed"),c&&f.push("app--user-responded"),s&&(0,L.jsx)("div",{className:zn(f),lang:h,tabIndex:"-1","data-nosnippet":!0,style:{zIndex:r},ref:p,children:(0,L.jsx)(u,{})})};function Ru(e,t,n=[]){const r=(0,i.useContext)(Bn),o=(0,i.useRef)();o.current=t,(0,i.useEffect)((()=>{if(!n.every(Boolean))return;const t=(...e)=>{var t;return null===(t=o.current)||void 0===t?void 0:t.call(o,...e)};return r.emit("function.register",e,t),()=>r.emit("function.unregister",e,t)}),[r,e,...n])}const Lu=()=>{const e=ee(),{sendMessage:t,sendContext:n,sendAction:r}=vo(),{setVisibility:o,visible:s}=ao(),a=(0,i.useRef)(s),c=(0,i.useContext)(Bn),l=Fn(),u=an(),p=(0,i.useRef)(null),h=(0,i.useRef)(null),{isInline:f,isResolving:d}=hn(),{hasInterrupt:y}=Gr(),b=qn(),g=(0,i.useRef)(null),m=_o(),{enableTranslations:v,disableTranslations:O}=oi();return(0,i.useEffect)((()=>{a.current=s}),[s]),Ru("askText",(e=>{t({body:e})}),[null==l?void 0:l.send]),Ru("setVariables",(e=>{n({variables:e})}),[null==l?void 0:l.send]),Ru("getVisibility",(e=>{e?e(a.current):console.warn("A callback function is required for the getVisibility action.")})),Ru("setVisibility",(e=>{Object.values(T).includes(e)?(m(),o(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[null==e?void 0:e.api]),Ru("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[l.send]),Ru("setTopic",(({name:e,fallbackMessage:t})=>{e&&t?r({type:"set_topic",body:{name:e,fallbackMessage:t}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[l.send]),Ru("setTranslation",(({enabled:e,locale:t})=>{e?v(t):O()}),[l.send]),(0,i.useEffect)((()=>{d||y||(g.current&&g.current!==b&&c.emit("unreadMessageCount",u),s===T.open&&s!==h.current&&0!==p.current&&c.emit("unreadMessageCount",0),s!==T.open&&u!==p.current&&c.emit("unreadMessageCount",u),h.current=s,p.current=u,g.current=b)}),[u,s,c,f,d,y,b]),null},{SET_EVENTS_READ:Uu}=Me,Mu=()=>{const{t:e}=dr(),t=on(),n=Wn(),{isOpen:r,isVisible:o}=ao(),{sendAction:s}=vo(),a=an(),{sendPolite:c}=wo(),l=(0,i.useMemo)((()=>ce(c,2e3)),[c]),u=(0,i.useRef)(null),p=(0,i.useRef)(null);return(0,i.useEffect)((()=>{if(!r)return;const e=t.filter((e=>xt(e)&&e.payload.messageStatus===Se)).map((e=>e.payload.id));e.length>0&&(n({type:Uu,ids:e}),s({type:Ce,events:e}))}),[t,n,r,s]),(0,i.useEffect)((()=>{u.current!==o&&!o&&p.current&&p.current(),0!==a&&!r&&o&&(p.current=l(e("message.srTextUnreadCount",{unreadCount:a}))),u.current=o}),[a,r,o,l,e]),null},zu=()=>{const{t:e}=dr(),t=on(),n=(0,i.useRef)(0),r=(0,i.useRef)(0),o=tn().historyLoaded,{sendPolite:s}=wo(),{isOpen:a}=ao(),c=(0,i.useRef)(null),l=(0,i.useRef)(null),u=(0,i.useMemo)((()=>ce((t=>{const n=t.filter((({payload:e})=>!e.fromClient&&!e.fromHistory)).length;n>r.current&&(s(e("message.srNewEventCount",{newCount:n-r.current})),r.current=n)}),1e3)),[s,e]);return(0,i.useEffect)((()=>{t.length>n.current&&(a&&(l.current=u(t)),n.current=t.length)}),[t,u,a]),(0,i.useEffect)((()=>{c.current&&!a&&l.current&&(l.current(!0),l.current=null)}),[a]),(0,i.useEffect)((()=>{o&&setTimeout((()=>{s(e("window.srTexts.onHistoryLoad"))}),500)}),[o,e,s]),null},$u=({children:e})=>{const t=(0,i.useContext)(Bn),[n,r]=(0,i.useState)({}),o=(0,i.useRef)(!0),s=(0,i.useCallback)((e=>{o.current&&(r(e),t.emit("aria-live",e))}),[r,t]);(0,i.useEffect)((()=>{let e=null;return n&&n.messageText&&(e=setTimeout((()=>{s({}),clearTimeout(e)}),500)),()=>{clearTimeout(e)}}),[n,s]),(0,i.useEffect)((()=>()=>{o.current=!1}),[]);const{ariaLive:a,messageText:c}=n;return(0,L.jsxs)(Oo.Provider,{value:s,children:[e,(0,L.jsxs)("div",{className:zn("app__live-container"),children:[(0,L.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:zn("visually-hidden"),children:a===De?c:null}),(0,L.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:zn("visually-hidden"),children:a===Re?c:null})]})]})},Bu=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=zo();return((e,t)=>{const n=(0,i.useRef)(e);(0,i.useEffect)((()=>{n.current=e}),[e]),(0,i.useEffect)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n>0?1e3:null),null},Fu=({children:e})=>{const t=(0,i.useRef)(0),{sendAction:n}=vo(),{hasCountdown:r,isActive:o,stopCountdown:s}=zo(),a=(0,i.useCallback)((()=>{const e=(new Date).getTime(),i=()=>{n({type:"interactivity_update"}),t.current=e};r&&o&&(i(),s()),e-t.current>15e3&&i()}),[n,r,o,s]);return(0,L.jsx)("div",{className:zn("activity-monitor"),tabIndex:"-1",onMouseDown:a,onKeyUp:a,onTouchStart:a,onMouseMove:a,onWheel:a,onPointerDown:a,onPointerMove:a,children:(0,L.jsx)(jo.Provider,{value:a,children:e})})},Hu=()=>{const{initUserSelectedOptions:e}=Ir(),t=(0,i.useRef)(!1),n=ee();return(0,i.useEffect)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null},qu=["serviceSettings"];const{ADD_EVENT:Vu,ACK_EVENT:Wu,SET_IS_LOADING:Gu,SET_PARTICIPANT:Ku,SET_HEADER_SUB_TITLE:Yu,SET_ACTIVE_SERVICE:Ju,INIT_RESUME_CONVERSATION_PROMPT:Qu,CLEAR_EVENTS:Zu,SET_SERVICE_DATA_ITEM:Xu,SET_FEATURE_ENABLED_STATE:ep,SET_SERVICE_ENTRY_METADATA:tp,SET_HISTORY:np}=Me,rp=["text","choice_prompt","image","video"],op=({eventBus:e})=>{const{t}=dr(),n=Fn(),r=Wn(),o=on(),s=(0,i.useRef)(null),{setUserSelectedOption:a}=Ir(),{initCountdown:c,endCountdown:l}=zo(),{emitEvent:u}=vo();return(0,i.useEffect)((()=>{if(n.connectionInfo){const t=e=>{const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:o}=t;!n&&o.name&&r({type:Yu,title:o.name}),r({type:Ku,participant:o,fromClient:n}),o.introduction&&r({type:Vu,event:e})};n.stream().subscribe({next:n=>{const{type:o,payload:i}=n;switch(o){case"ui":switch(i.state&&i.state.hasOwnProperty("loading")&&r({type:Gu,isLoading:i.state.loading}),i.type){case"idle_detach_countdown":c(i.body.duration);break;case"idle_detach_countdown_elapsed":l(void 0,!0);break;case"resume_conversation_prompt":r({type:Qu});break;case"user_first_response":r(kn(!0)),e.emit("system.userFirstResponse",i.body)}break;case"message":switch(t(i),i.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"cta":case"custom":case"carousel":case"card":i.service&&i.service.serviceSessionId&&r({type:Ju,activeServiceSessionId:i.service.serviceSessionId}),r({type:Vu,event:n})}break;case"participant":t(n);break;case"service_data":i.persist&&r({type:Xu,payload:i});break;case"ack":r({type:Wu,event:n});break;case"system":if("service_changed"===i.type){const{serviceSettings:e}=i,t=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}(i,qu),{uploads:n,entry:o}=e;r({type:ep,key:Ue,enabled:!(!n||!n.enabled)}),r({type:tp,entryMeta:o}),r({type:Ju,activeServiceSessionId:i.serviceSessionId}),u("system.serviceChanged",t)}break;case"info":"divider"!==i.type&&"text"!==i.type&&"translation"!==i.type||r({type:Vu,event:n});break;case"error":switch(i.type){case"find_conversation_erred":r(Sn(new jn(n)));break;case"seamly_offline":r(Sn(new Jr(n))),r({type:Zu});break;default:r(Sn(new Kr(n)))}break;case"socket_opened":r(Tn())}}}),n.stream().filter((e=>"message"===e.type&&rp.includes(e.payload.type))).subscribe({next:({payload:t})=>{t.id!==s.current&&e.emit("message",t),s.current=t.id}})}}),[r,n,e,t,a,c,l,u]),(0,i.useEffect)((()=>{if(n.stream){const e=n.stream().filter((e=>"sync"===e.type)).subscribe({next:e=>{const{payload:t}=e,i=o[o.length-1],{id:s}=t.lastEvent;i&&s===i.payload.id||n.getConversation().then((e=>{e&&r({type:np,history:e})})).catch((e=>{r(Sn(e))}))}});return()=>{e.unsubscribe()}}return()=>{}}),[n,o,r]),null},{REGISTER_UPLOAD:ip,SET_UPLOAD_PROGRESS:sp,SET_UPLOAD_ERROR:ap,SET_UPLOAD_COMPLETE:cp}=Me,lp=({children:e})=>{const{t}=dr(),n=Wn(),r=Fn(),{addUploadBubble:o}=vo();return(0,L.jsx)(Dr.Provider,{value:e=>{const i=s(),a=r.uploadFile(e,(e=>{n({type:sp,fileId:i,progress:Math.ceil(e)})}),(e=>{const{id:t,transactionId:r,occurredAt:s,body:{contentType:a,filename:c,filesize:l,url:u}}=e.body;n({type:cp,fileId:i}),o(t,r,s,a,c,l,u)}),(e=>{let r;switch(e&&e.body?e.body.error:""){case"file_uploads_are_disabled":r=t("fileUpload.errors.unavailable");break;case"request_entity_too_large":r=t("fileUpload.errors.tooLarge");break;case"file_has_invalid_mime_type":r=t("fileUpload.errors.wrongType");break;case"virus_found":r=t("fileUpload.errors.virusFound");break;default:r=t("fileUpload.errors.general")}n({type:ap,fileId:i,errorText:r})}));n({type:ip,fileId:i,fileName:e.name,uploadHandle:a})},children:e})},{createAction:up}=d("errors"),pp=up("catch-error",(e=>({error:e})));function hp({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:o,api:i,layoutMode:s}=A(t());null==r||r(n.error,{namespace:o,api:i,layoutMode:s,conversationUrl:e.getConversationUrl(),action:n.type?n:void 0})};return e=>t=>{try{return t.error&&n(t),e(t)}catch(e){throw n({error:e}),e}}}}const fp=({store:e,children:t,config:n,eventBus:r,api:o})=>((0,i.useErrorBoundary)((t=>e.dispatch(pp(t)))),(0,L.jsx)(U,{store:e,children:(0,L.jsx)(Bn.Provider,{value:r,children:(0,L.jsx)($n.Provider,{value:o,children:(0,L.jsx)($u,{children:(0,L.jsxs)(Fl,{children:[(0,L.jsx)(Hu,{config:n}),(0,L.jsx)(op,{eventBus:r}),(0,L.jsx)(Mu,{}),(0,L.jsx)(zu,{}),(0,L.jsx)(Bu,{}),(0,L.jsxs)(Fu,{children:[(0,L.jsx)(Lu,{}),(0,L.jsx)(lp,{children:t})]})]})})})})}));function dp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dp(Object(n),!0).forEach((function(t){bp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const gp=e=>(0,L.jsx)(fp,yp(yp({},e),{},{children:(0,L.jsx)(Du,{})}));var mp=n(813),vp=n.n(mp),Op=n(766),wp=n.n(Op),jp=e=>"function"==typeof e?e:function(){return e},_p="undefined"!=typeof self?self:null,xp="undefined"!=typeof window?window:null,Ep=_p||xp||void 0,Sp="closed",Tp="errored",kp="joined",Pp="joining",Cp="leaving",Ap="phx_close",Ip="phx_error",Np="phx_reply",Dp="phx_leave",Rp=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})}},Lp=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))}},Up=class{static request(e,t,n,r,o,i,s){if(Ep.XDomainRequest){let n=new Ep.XDomainRequest;this.xdomainRequest(n,e,t,r,o,i,s)}else{let a=new Ep.XMLHttpRequest;this.xhrRequest(a,e,t,n,r,o,i,s)}}static xdomainRequest(e,t,n,r,o,i,s){e.timeout=o,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);s&&s(t)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(r)}static xhrRequest(e,t,n,r,o,i,s,a){e.open(t,n,!0),e.timeout=i,e.setRequestHeader("Content-Type",r),e.onerror=()=>{a&&a(null)},e.onreadystatechange=()=>{if(4===e.readyState&&a){let t=this.parseJSON(e.responseText);a(t)}},s&&(e.ontimeout=s),e.send(o)}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)}`}},Mp=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,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 Up.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(){this.close(),this.readyState=0}ontimeout(){this.onerror("timeout"),this.closeAndRetry()}poll(){1!==this.readyState&&0!==this.readyState||Up.request("GET",this.endpointURL(),"application/json",null,this.timeout,this.ontimeout.bind(this),(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(),this.close();break;case 0:case 500:this.onerror(),this.closeAndRetry();break;default:throw new Error(`unhandled poll status ${t}`)}}))}send(e){Up.request("POST",this.endpointURL(),"application/json",e,this.timeout,this.onerror.bind(this,"timeout"),(e=>{e&&200===e.status||(this.onerror(e&&e.status),this.closeAndRetry())}))}close(e,t){this.readyState=3,this.onclose()}},zp={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,o,i,s]=JSON.parse(e);return t({join_ref:n,ref:r,topic:o,event:i,payload:s})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:o,payload:i}=e,s=this.META_LENGTH+t.length+n.length+o.length+r.length,a=new ArrayBuffer(this.HEADER_LENGTH+s),c=new DataView(a),l=0;c.setUint8(l++,this.KINDS.push),c.setUint8(l++,t.length),c.setUint8(l++,n.length),c.setUint8(l++,o.length),c.setUint8(l++,r.length),Array.from(t,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(n,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(o,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(r,(e=>c.setUint8(l++,e.charCodeAt(0))));var u=new Uint8Array(a.byteLength+i.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(i),a.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),s=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(e.slice(s,s+r));s+=r;let c=n.decode(e.slice(s,s+o));s+=o;let l=n.decode(e.slice(s,s+i));return s+=i,{join_ref:a,ref:null,topic:c,event:l,payload:e.slice(s,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),s=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(a,a+r));a+=r;let l=n.decode(e.slice(a,a+o));a+=o;let u=n.decode(e.slice(a,a+i));a+=i;let p=n.decode(e.slice(a,a+s));a+=s;let h=e.slice(a,e.byteLength);return{join_ref:c,ref:l,topic:u,event:Np,payload:{status:p,response:h}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=this.HEADER_LENGTH+2,s=n.decode(e.slice(i,i+r));i+=r;let a=n.decode(e.slice(i,i+o));return i+=o,{join_ref:null,ref:null,topic:s,event:a,payload:e.slice(i,e.byteLength)}}};function $p(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 Bp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$p(Object(n),!0).forEach((function(t){Fp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Hp=n(905),qp=n.n(Hp);function Vp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vp(Object(n),!0).forEach((function(t){Gp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Kp=qp()("seamly");class Yp{constructor(e,t,n,r){this.url=e,this.accessToken=r,this.channelName=t,this.channelTopic=n,this.connect(),this.socket.onError((e=>{Kp("[SOCKET][ERROR]",e),this.emit({type:"error",payload:{type:"seamly_offline",error:e}})})),this.socket.onOpen((()=>{Kp("[SOCKET]OPEN"),this.emit({type:"socket_opened"})})),this.channel.on("system",(e=>{switch(e.type){case"attach_channel_succeeded":this.emit({type:"connection",connected:!0,ready:!0})}})),this.socket.onClose((()=>{Kp("[SOCKET]CLOSE"),this.emit({type:"connection",connected:!1,ready:!1})})),this.channel.onClose((()=>{Kp("[CHANNEL]CLOSE"),this.emit({type:"connection",connected:!1,ready:!1})})),this.channel.onError((e=>{Kp("[CHANNEL][ERROR]",e),this.emit({type:"connection",connected:!1,ready:!1})})),this.listenTo("ack"),this.listenTo("ui"),this.listenTo("error"),this.listenTo("participant",((e,t)=>Wp(Wp({},t),{},{type:e}))),this.listenTo("message"),this.listenTo("service_data"),this.listenTo("system"),this.listenTo("info"),this.listenTo("sync")}start(e){this.listener=e,this.channel.join().receive("ok",(()=>{Kp("[CHANNEL][JOIN] OK"),this.emit({type:"connection",connected:!0,ready:!1})})).receive("error",(e=>{Kp("[CHANNEL][JOIN] ERROR",e),this.emit({type:"error",payload:{type:"join_channel_erred",error:e}}),this.emit({type:"connection",connected:!1,ready:!1}),this.channel.socket.disconnect()})).receive("timeout",(()=>{Kp("[CHANEL][JOIN] Networking issue. Still waiting...")}))}stop(){this.listener=null}connect(){const{url:e,params:t}=(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 Bp(Bp({},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||Ep.WebSocket||Mp,this.establishedConnections=0,this.defaultEncoder=zp.encode.bind(zp),this.defaultDecoder=zp.decode.bind(zp),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==Mp?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;xp&&xp.addEventListener&&(xp.addEventListener("pagehide",(e=>{this.conn&&(this.disconnect(),n=this.connectClock)})),xp.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=jp(t.params||{}),this.endPoint=`${e}/websocket`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Lp((()=>{this.teardown((()=>this.connect()))}),this.reconnectAfterMs)}replaceTransport(e){this.disconnect(),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=Up.appendParams(Up.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){this.connectClock++,e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=jp(e)),this.conn||(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}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.abnormalClose("heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,clearTimeout(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.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(),clearTimeout(this.heartbeatTimer),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(Ip)}))}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=Sp,this.topic=e,this.params=jp(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Rp(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Lp((()=>{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=kp,this.rejoinTimer.reset(),this.pushBuffer.forEach((e=>e.send())),this.pushBuffer=[]})),this.joinPush.receive("error",(()=>{this.state=Tp,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=Sp,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=Tp,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 Rp(this,Dp,jp({}),this.timeout).send(),this.state=Tp,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.on(Np,((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(Ap,e)}onError(e){return this.on(Ip,(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 Rp(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=Cp;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Ap,"leave")},n=new Rp(this,Dp,jp({}),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=Pp,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===Sp}isErrored(){return this.state===Tp}isJoined(){return this.state===kp}isJoining(){return this.state===Pp}isLeaving(){return this.state===Cp}}(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.heartbeatTimer=setTimeout((()=>this.heartbeatTimeout()),this.heartbeatIntervalMs))}abnormalClose(e){this.closeWasClean=!1,this.isConnected()&&this.conn.close(1e3,e)}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&&(clearTimeout(this.heartbeatTimer),this.pendingHeartbeatRef=null,setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${t} ${n} ${o&&"("+o+")"||""}`,r);for(let e=0;e<this.channels.length;e++){const s=this.channels[e];s.isMember(t,n,r,i)&&s.trigger(n,r,o,i)}for(let t=0;t<this.stateChangeCallbacks.message.length;t++){let[,n]=this.stateChangeCallbacks.message[t];n(e)}}))}leaveOpenTopic(e){let t=this.channels.find((t=>t.topic===e&&(t.isJoined()||t.isJoining())));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}}(e,{params:Wp(Wp({},t),{},{v:re})}),this.socket.connect(),this.channel=this.socket.channel(this.channelTopic,{authorization:`Bearer ${this.accessToken}`,channelName:this.channelName})}disconnect(){return new Promise((e=>{this.socket.disconnect(e)}))}listenTo(e,t=null){this.channel.on(e,(n=>{Kp("[RECEIVE]",e,n),this.emit({type:e,payload:t?t(e,n):n})}))}emit(e){this.listener&&this.listener.next(e)}push(e,t,n){this.channel.push(e,t,n)}}function Jp(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))}}}class Qp{constructor(e){this.name=e}emit(e){this.listener&&this.listener.next(e)}start(e){this.listener=e}stop(){this.listener=null}}function Zp(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?Zp(Object(n),!0).forEach((function(t){eh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function eh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const th=qp()("seamly");function nh(){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}function rh(){return{screenResolution:`${window.screen.width}x${window.screen.height}`,userAgent:navigator.userAgent,currentUrl:window.location.toString(),timezone:nh()}}class oh{constructor({namespace:e,config:t={},context:n={}}){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}}}(`${e}.connection${n.locale?"."+n.locale:""}`,t.storageProvider||Jp),this.connectionInfo={apiKey:t.key,domain:t.domain||"api.seamly-app.com",secure:!1!==t.secure&&(t.secure||!0)},this.config={sendEnvironment:t.sendEnvironment??!0,context:Xp(Xp({},n),{},{channelName:n.channelName||"web"})},this.connected=!1,this.configReady=!1,this.externalId=t.externalId,this.internalProducer=new Qp("API"),this.internal$=vp().create(this.internalProducer).flatten(),this.connection$=this.internal$.filter((e=>"connection"===e.type)),this.connection$.subscribe({next:({connected:e,ready:t})=>{this.connected=e,this.ready=t}}),this.URLS={}}getAccessToken(){return this.store.get("accessToken")}setAccessToken(e){this.store.set("accessToken",e)}getConversationUrl(){return this.store.get("conversationUrl")}setConversationUrl(e){this.store.set("conversationUrl",e)}hasConversation(){return!!this.getConversationUrl()}getChannelTopic(){return this.store.get("channelTopic")||this.store.get("channelName")}setChannelTopic(e){this.store.set("channelTopic",e)}clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}getUrlPrefix(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`}updateUrls({_links:e}){this.URLS=Object.entries(e).filter((([e])=>"self"!==e)).reduce(((e,[t,{href:n}])=>Xp(Xp({},e),{},{[t]:n})),this.URLS)}async reset(){return await this.disconnect(),this.clearStore(),this.getConfig()}async disconnect(){this.conversationProducer&&await this.conversationProducer.disconnect(),this.connected=!1,this.configReady=!1}async createConversation(){try{const e=wp().post(`${this.getUrlPrefix("http")}${this.URLS.conversations}`).set("Content-Type","application/json").query({v:re}).withCredentials().send({externalId:this.externalId||void 0}),{body:t}=await e,{conversation:n}=t,r=Xp({},n);return delete r.accessToken,delete r.channelTopic,this.setAccessToken(n.accessToken),this.setChannelTopic(n.channelTopic),this.updateUrls(t),this.setConversationUrl(this.URLS.conversation),r}catch(e){if(e.status>=500)throw new Kr(e);throw e}}getConfig(){return wp().post(`${this.getUrlPrefix("http")}/client/${this.connectionInfo.apiKey}/configs`).set("Content-Type","application/json").query({v:re}).send({context:Xp(Xp({},this.config.context),{},{environment:!0===this.config.sendEnvironment?rh():this.config.sendEnvironment})}).then((({body:e})=>(this.updateUrls(e),this.configReady=!0,e.config))).catch((e=>{if(404===e.status)throw new Yr;if(e.status>=500)throw new Kr;throw e}))}async getConversation(){if(!this.hasConversation())return null;try{const{body:e}=await wp().get(`${this.getUrlPrefix("http")}${this.URLS.history}`).set("Authorization",`Bearer ${this.getAccessToken()}`).query({v:re});this.updateUrls(e);const{messages:t,participants:n,activeServiceSessionId:r,activeServiceSettings:o,serviceData:i,ui:s,translation:a}=e.history;return{events:t.map((([e,t])=>({type:e,payload:Xp(Xp({},t),{},{type:"participant"===e?e:t.type})}))),participants:n,activeServiceSessionId:r,activeServiceSettings:o,serviceData:i,resumeConversationPrompt:!!s&&Boolean(s.resumeConversationPrompt),translation:a}}catch(e){if(401===e.status)throw new Qr(e);if(404===e.status)throw new jn(e);if(e.status>=500)throw new Kr(e);throw e}}async connect(){this.connected=!1;let e=null;return this.hasConversation()||(e=await this.createConversation()),this.conversationProducer=new Yp(`${this.getUrlPrefix("ws")}${this.URLS.socket}`,this.config.context.channelName,this.getChannelTopic(),this.getAccessToken()),this.internalProducer.emit(vp().create(this.conversationProducer)),this.config.sendEnvironment&&this.send("context",{environment:!0===this.config.sendEnvironment?rh():this.config.sendEnvironment},!1),e}uploadFile(e,t,n,r){const o=new FormData;o.append("upload",e);const i=wp().post(`${this.getUrlPrefix("http")}${this.URLS.uploads}`).set("Authorization",`Bearer ${this.getAccessToken()}`).send(o);return i.on("progress",(function(e){const{direction:n,percent:r}=e;"upload"===n&&"function"==typeof t&&t(r)})),i.then((e=>{n&&n(e)})).catch((e=>{if(!r)throw e;r(e.response)})),i}getConversationIntitialState(){return wp().get(`${this.getUrlPrefix("http")}${this.getConversationUrl()}`).set("Authorization",`Bearer ${this.getAccessToken()}`).query({v:re}).then((({body:e})=>{return this.updateUrls(e),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 Qr(e);if(404===e.status)throw new jn(e);if(e.status>=500)throw new Kr(e);throw e}))}async getTranslations(e){try{const t=`${this.getUrlPrefix("http")}${this.URLS.translations}`.replace("{version}",String(1)).replace("{locale}",e),n=wp().get(t),{body:r}=await n;return r.translations}catch(e){if(e.status>=500)throw new Kr(e);throw e}}send(e,t,n=!0){!this.connected||n&&!this.ready?this.connection$.filter((e=>n?e.connected&&e.ready:e.connected)).take(1).subscribe({next:()=>this.send(e,t,n)}):(th("[SEND]",e,t),this.conversationProducer.push(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)}stream(){return this.internal$.filter((e=>"connection"!==e.type))}}function ih(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 sh=ih();sh.withExtraArgument=ih;const ah=sh;function ch(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 lh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ch(Object(n),!0).forEach((function(t){uh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ch(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function uh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ph({api:e}){return()=>t=>n=>{const r=t(n);switch(n.type){case Me.SET_USER_SELECTED_OPTIONS:e.store.set("options",n.options);break;case Me.SET_USER_SELECTED_OPTION:e.store.set("options",lh(lh({},e.store.get("options")||{}),{},{[n.option]:n.value}))}return r}}const hh={events:[],initialState:{},unreadEvents:0,isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1},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:xe,active:xe,userSelected:null,blockAutoEntrySwitch:!1,options:{},optionsOverride:{}},seamlyContainerElement:null};function fh(e=hh,t){return t.type===String(Pn.pending)?hh:((e,t)=>{switch(t.type){case $e:const{type:n,payload:r}=t.event,o=e.options.features.hasOwnProperty(Ue),i=kt(e.entryMeta,r);let s=Oe({},e.options);if(o&&(n===je.message||n===je.participant)&&!r.fromClient){const{type:e}=r.entry||{};s=Oe(Oe({},s),{},{features:Oe(Oe({},s.features),{},{uploads:Oe(Oe({},s.features.uploads),{},{enabledFromEntry:e===Ee})})})}const a=xt(t.event);return e.events.find((e=>e.payload.id===r.id))?e:Oe(Oe({},e),{},{entryMeta:o||i.active!==Ee?i:Oe({},e.entryMeta),options:s,unreadEvents:a?e.unreadEvents+1:e.unreadEvents,events:[...e.events,Oe(Oe({},t.event),{},{payload:Oe(Oe({},a&&{messageStatus:r.fromClient?Te:Se}),r)})]});case qe:if(!t.event.payload.transactionId)return console.warn("ACK received without transaction ID."),e;const c=e.events.find((e=>e.payload.transactionId===t.event.payload.transactionId)),{id:l,occurredAt:u}=t.event.payload;return c?Oe(Oe({},e),{},{events:Et(e.events.map((e=>e.payload.id===c.payload.id?Oe(Oe({},e),{},{payload:Oe(Oe({},e.payload),{},{id:l,occurredAt:u})}):e)))}):e;case Be:return Oe(Oe({},e),{},{unreadEvents:0,events:[]});case He:return Oe(Oe({},e),{},{unreadEvents:0,events:e.events.map((e=>-1!==t.ids.indexOf(e.payload.id)?Oe(Oe({},e),{},{payload:Oe(Oe({},e.payload),e.payload.messageStatus===Se&&{messageStatus:Te})}):e))});case Fe:const{events:p,participants:h,activeServiceSessionId:f,activeServiceSettings:d={},serviceData:y,resumeConversationPrompt:b}=t.history,g=((e,t)=>{const n=t.filter((t=>!(e.find((e=>e.payload.id===t.payload.id))||"participant"===t.type&&!t.payload.participant.introduction))).reverse();return Et([...n,...e])})(e.events,p),m=Oe(Oe({},e.participantInfo.participants),h),v=g.slice().reverse().find((e=>("message"===e.type||"participant"===e.type)&&!e.payload.fromClient));let O=null;v&&("message"===v.type&&(O=v.payload.participant),"participant"===v.type&&(O=v.payload.participant.id));const{entry:w,uploads:j}=d,_=kt(Oe(Oe(Oe({},e.entryMeta),w),{},{active:w.default||_e,options:Oe({},w&&w.options?w.options:{})}),g[g.length-1].payload);let x=Oe({},e.options.features);const E=x.hasOwnProperty(Ue);if(E){const{payload:e}=v,{type:t}=e.entry||{};x=Oe(Oe({},x),{},{uploads:{enabled:!(!j||!j.enabled),enabledFromEntry:t===Ee}})}const S=Oe(Oe({},e),{},{unreadEvents:g.filter((e=>"message"===e.type&&e.payload.messageStatus===Se)).length,events:g.filter((e=>"participant"!==e.type||!!e.payload.participant.introduction)),participantInfo:Oe(Oe(Oe({},e.participantInfo),O?St(e.participantInfo,{type:Ge,participant:m[O]}):{}),{},{participants:m}),historyLoaded:!0,serviceInfo:Oe(Oe({},e.serviceInfo),{},{activeServiceSessionId:f}),serviceData:y||{},options:Oe(Oe({},e.options),{},{features:x}),entryMeta:E||_.active!==Ee?_:Oe({},e.entryMeta),resumeConversationPrompt:b||!1});return O&&(S.headerTitles=Tt(e.headerTitles,{type:Ye,title:m[O].name})),S;case Je:return Oe(Oe({},e),{},{historyLoaded:!1});case Ve:return Oe(Oe({},e),{},{isLoading:t.isLoading});case Ze:const{delaySeconds:T,delayTime:k}=t;return Oe(Oe({},e),{},{idleDetachCountdown:{hasCountdown:!0,isActive:!0,wasStopped:!1,count:T,remaining:T,timer:k}});case Xe:const{idleDetachCountdown:P}=e,{remaining:C}=P,A=C-1;return Oe(Oe({},e),{},{idleDetachCountdown:Oe(Oe({},e.idleDetachCountdown),{},{remaining:A,timer:ue(A)})});case et:return Oe(Oe({},e),{},{idleDetachCountdown:Oe(Oe({},e.idleDetachCountdown),{},{isActive:!1,wasStopped:!0})});case tt:return Oe(Oe({},e),{},{idleDetachCountdown:{hasCountdown:!1,isActive:!1}});case nt:return Oe(Oe({},e),{},{resumeConversationPrompt:!0});case rt:return Oe(Oe({},e),{},{resumeConversationPrompt:!1});case Ge:case We:return Oe(Oe({},e),{},{participantInfo:St(e.participantInfo,t)});case Qe:return e.serviceInfo.activeServiceSessionId!==t.activeServiceSessionId?Oe(Oe({},e),{},{serviceInfo:Oe(Oe({},e.serviceInfo),{},{activeServiceSessionId:t.activeServiceSessionId})}):e;case Ke:case Ye:return Oe(Oe({},e),{},{headerTitles:Tt(e.headerTitles,t)});case ct:return Oe(Oe({},e),{},{initialState:t.initialState});case ot:return Oe(Oe({},e),{},{serviceData:Oe(Oe({},e.serviceData),{},{[t.payload.type]:t.payload})});case it:return Oe(Oe({},e),{},{options:Oe(Oe({},e.options),{},{features:t.features})});case st:return e.options.features.hasOwnProperty(t.key)?Oe(Oe({},e),{},{options:Oe(Oe({},e.options),{},{features:Oe(Oe({},e.options.features),{},{[t.key]:Oe(Oe({},e.options.features[t.key]||{}),{},{enabled:t.enabled})})})}):e;case at:return Oe(Oe({},e),{},{options:Oe(Oe({},e.options),{},{features:{}})});case pt:return Oe(Oe({},e),{},{options:Oe(Oe({},e.options),{},{panelActive:!0,optionActive:t.optionName})});case ht:return Oe(Oe({},e),{},{options:Oe(Oe({},e.options),{},{panelActive:!1,optionActive:""})});case ut:return Oe(Oe({},e),{},{options:Oe(Oe({},e.options),{},{userSelectedOptions:t.options})});case lt:const{option:I,value:N}=t;return Oe(Oe({},e),{},{options:Oe(Oe({},e.options),{},{userSelectedOptions:Oe(Oe({},e.options.userSelectedOptions),{},{[I]:N})})});case ft:const{value:D}=t;return Oe(Oe({},e),{},{entryMeta:Oe(Oe({},e.entryMeta),{},{blockAutoEntrySwitch:D})});case bt:const{entryMeta:R}=t;return Oe(Oe({},e),{},{entryMeta:Oe(Oe(Oe({},e.entryMeta),R),{},{active:R.default,options:Oe({},R.options||{}),overrideOptions:{}})});case yt:const{entryType:L}=t;return Oe(Oe({},e),{},{entryMeta:Oe(Oe({},e.entryMeta),{},{active:L})});case dt:const{entryType:U}=t;return Oe(Oe({},e),{},{entryMeta:Oe(Oe({},e.entryMeta),{},{userSelected:U})});case gt:return Oe(Oe({},e),{},{currentUploads:[...e.currentUploads,{id:t.fileId,name:t.fileName,progress:1,uploading:!0,complete:!1,error:"",uploadHandle:t.uploadHandle}]});case mt:return Oe(Oe({},e),{},{currentUploads:e.currentUploads.map((e=>e.id===t.fileId?Oe(Oe({},e),{},{progress:t.progress,uploading:100!==t.progress,uploadHandle:100===t.progress?null:e.uploadHandle}):e))});case Ot:return Oe(Oe({},e),{},{currentUploads:e.currentUploads.map((e=>e.id===t.fileId?Oe(Oe({},e),{},{error:t.errorText,progress:0,uploading:!1,uploadHandle:null}):e))});case vt:return Oe(Oe({},e),{},{currentUploads:e.currentUploads.map((e=>e.id===t.fileId?Oe(Oe({},e),{},{complete:!0}):e))});case wt:return Oe(Oe({},e),{},{currentUploads:e.currentUploads.filter((e=>e.id!==t.fileId))});case jt:return Oe(Oe({},e),{},{currentUploads:[]});case _t:return Oe(Oe({},e),{},{seamlyContainerElement:t.element});default:return e}})(e,t)}const dh=["namespace","parentElement","showFaq"],yh=["view"];function bh(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 gh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bh(Object(n),!0).forEach((function(t){mh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vh(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}class Oh{constructor(e,t){const{namespace:n="",parentElement:r,showFaq:i}=e,s=vh(e,dh);this.config=gh(gh({},s),{},{namespace:n,showFaq:!1!==i}),this.namespace=n,this.parentElement=r,this.externalApi=t,this.api=new oh({namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(o()),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)))}async render(){const t=this.config.customComponents||{},{view:n}=t,r=vh(t,yh),o=gh(gh({},this.config),{},{customComponents:Object.keys(r).length?r:void 0}),i=function({initialState:e,api:t,eventBus:n,config:r}={}){return Y({reducers:{state:fh,[String(Wo)]:Wo,[String(Mn)]:Mn,[String(Xi)]:Xi,[String(pi)]:pi,[String(vr)]:vr,[String(io)]:io,[String(ho)]:ho},initialState:e,middlewares:[hp({api:t}),ah.withExtraArgument({api:t,eventBus:n,config:r}),Xr({api:t}),ph({api:t}),({dispatch:e,getState:t})=>n=>r=>{var o,i,s,a,c,l,u;const p=n(r);switch(r.type){case String(Me.SET_HISTORY):null!==(o=r.history)&&void 0!==o&&null!==(i=o.translation)&&void 0!==i&&i.enabled&&e(Jo(r.history.translation.locale));break;case String(Me.SET_INITIAL_STATE):null!==(s=r.initialState)&&void 0!==s&&null!==(a=s.translation)&&void 0!==a&&a.enabled&&(e(Jo(r.initialState.translation.locale)),e(Mt(r.locale)));break;case String(Me.ADD_EVENT):"info"===r.event.type&&"new_translation"===(null===(c=r.event)||void 0===c||null===(l=c.payload)||void 0===l||null===(u=l.body)||void 0===u?void 0:u.subtype)&&r.event.payload.body.translationEnabled&&e(Mt(r.event.payload.body.translationLocale));break;case String(Qo):const n=Dt(t());e(Mt(n))}return p}]})}({api:this.api,eventBus:this.eventBus,config:o});await i.dispatch(Pn()),n?(0,e.render)((0,L.jsx)(fp,{config:o,eventBus:this.eventBus,store:i,api:this.api,children:(0,L.jsx)(n,{})}),this.parentElement):(0,e.render)((0,L.jsx)(gp,{config:o,eventBus:this.eventBus,store:i,api:this.api}),this.parentElement)}destroy(){(0,e.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 wh(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 jh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wh(Object(n),!0).forEach((function(t){_h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xh=e=>"object"==typeof e&&"action"in e,Eh=e=>jh(jh({},e),{},{args:Array.isArray(e.args)?e.args:[e.args]}),Sh=class{constructor(e){this._waitingActions=[],this._instances={},this.appConfig=e}push(...e){(e=e.filter(xh).map(Eh)).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._waitingActions.push(e)}}))}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,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 Oh(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){if("function"==typeof this.appConfig)return this.appConfig(e);const t=jh(jh({},this.appConfig.defaults),e.defaults);return jh(jh(jh({},this.appConfig),e),{},{api:jh(jh({},this.appConfig.api),e.api),defaults:Object.keys(t).length?t:void 0})}},Th=()=>{const{t:e}=dr(),{title:t,subTitle:n}=sn(),r=an(),{isOpen:o}=ao(),i=un(),{hasInterrupt:s}=Gr(),a=te(),c=(null==i?void 0:i.avatar)??a,l=s?"":n,u=["message-count"];return o&&u.push("message-count__hide"),0===r&&u.push("message-count__empty"),(l||!o)&&(0,L.jsxs)("div",{className:zn("agent-info"),children:[(0,L.jsxs)("div",{className:zn("agent-info__graphic"),children:[c?(0,L.jsx)("img",{className:zn(null!=i&&i.avatar?"avatar":"icon"),src:c,alt:""}):(0,L.jsx)(fi,{name:"avatar",size:"32"}),(0,L.jsx)("span",{className:zn(u),"aria-hidden":"true",children:r})]}),(0,L.jsxs)("div",{className:zn("agent-info__body"),children:[(0,L.jsx)("p",{className:zn("agent-info__heading"),children:t??e("header.title")}),(0,L.jsx)("p",{className:zn("agent-info__text"),children:l})]})]})},kh=({children:e,onCloseChat:t})=>{const{headerCollapseButtonId:n}=tn(),r=(0,i.useRef)(null),{t:o}=dr();return(0,L.jsxs)("header",{className:zn("chat__header"),children:[e,(0,L.jsx)("div",{className:zn("header-controls"),children:(0,L.jsx)("button",{type:"button",className:zn("button","header-controls__collapse"),onClick:t,ref:r,id:n,children:(0,L.jsx)(fi,{name:"chevronDown",size:"32",alt:o("header.collapseApp")})})})]})},Ph=({onOpenChat:e})=>{const{t}=dr(),n=Br(),{isOpen:r}=ao(),o=(0,i.useRef)(null),s=(0,i.useRef)(null),a=(0,i.useRef)(),c=xr(),l=(()=>{const e=(0,i.useRef)(null),[t]=jr();return e.current=t,(0,i.useCallback)((t=>{me(e.current,(()=>{wr(t)}))}),[])})(),u=un(),p=sn().subTitle,{hasInterrupt:h}=Gr(),{headerCollapseButtonId:f}=tn(),d=u&&!h;return(0,i.useLayoutEffect)((()=>{!1===r&&!0===o.current&&l(s.current),o.current=r}),[r,l]),(0,L.jsxs)("div",{className:zn("toggle-button"),children:[(0,L.jsxs)("div",{id:n,children:[(0,L.jsx)("p",{className:zn("toggle-button__title"),children:t(d?"toggleButton.resumeTitle":"toggleButton.title")}),(0,L.jsx)("p",{className:zn("toggle-button__subtitle"),children:d?p:t("toggleButton.subtitle")})]}),(0,L.jsx)("button",{type:"button","aria-labelledby":n,className:zn("toggle-button__button"),ref:s,onMouseUp:()=>{a.current="mouse"},onKeyUp:()=>{a.current="key"},onClick:()=>{e(),"mouse"===a.current?c():"key"===a.current&&l(f)}})]})},Ch=["categories"];function Ah(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 Ih(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ah(Object(n),!0).forEach((function(t){Nh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ah(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Nh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Dh=()=>{const{t:e}=dr(),{sendAction:t,addMessageBubble:n}=vo(),r=Br(),o=xr(),{sendPolite:s}=wo(),{hasInterrupt:a}=Gr(),{hasCountdown:c,endCountdown:l}=zo(),{hasPrompt:u,continueChat:p}=Bo(),h=pn("suggestion"),[f]=ii({payload:h}),d=(0,i.useMemo)((()=>(h&&!a?f:[]).map((e=>{let{categories:t=[]}=e;return Ih(Ih({},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,Ch)),{},{categories:t,classNames:["faqs__item",...t.map((e=>`faqs__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`))]})}))),[h,a,f]),y=(0,i.useRef)(null),b=(0,i.useRef)(!1),{isInline:g}=hn(),m=so(),v=!g&&m,O=(0,i.useRef)(v),w=!!d.length,j=w&&!v,_=(0,i.useRef)([]),x=w?d:_.current;_.current=x;const E=(0,i.useRef)(null);(0,i.useEffect)((()=>{if(y.current!==d&&!v){if(w){const t=b.current?e("faq.srUpdatedText"):e("faq.srAvailableText");setTimeout((()=>{s(t)}),30)}else b.current&&s(e("faq.srUnavailableText"));y.current=d}!O.current&&v?(me(E.current,o),s(e("faq.srUnavailableText"))):!w&&b.current&&me(E.current,o),b.current=w,O.current=v}),[w,d,v,o,s,e]);const S=e("faq.headingText"),T=S?"section":"div";return(0,L.jsx)(vi,{isActive:j,transitionStartState:bi,children:(0,L.jsxs)(T,{className:zn("faqs"),"aria-labelledby":S?r:null,ref:E,children:[S&&(0,L.jsx)("h2",{id:r,className:zn("faqs__heading"),children:S}),!!x.length&&(0,L.jsx)("ul",{className:zn("faqs__list"),children:x.map((e=>(0,L.jsx)("li",{className:zn(e.classNames),children:(0,L.jsxs)("button",{type:"button",onClick:()=>{(({id:e,question:r})=>{c&&l(!0),u&&p(),t({type:ke,originMessage:h.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:r}}}),n(r),o()})(e)},className:zn("button","button--secondary"),children:[(0,L.jsx)(fi,{name:"chevronRight",size:"8"}),e.question]})},e.id.toString())))})]})})},Rh=({children:e})=>{const[,t]=jr(),{isOpen:n,isVisible:r,setVisibility:o}=ao(),{zIndex:s,showFaq:a,layoutMode:c}=ee(),{isInline:l}=hn(),u=Gn(),p=so(),{locale:h}=dr(),f=(0,i.useCallback)((e=>{t(e)}),[t]),d=(0,i.useMemo)((()=>{if(h&&document.querySelector("html").getAttribute("lang")!==h)return h}),[h]),y=["app","app--deprecated",...u];return n||"window"!==c||y.push("app--collapsed"),p&&y.push("app--user-responded"),y.push(`app--layout-${c}`),r&&(0,L.jsxs)("section",{className:zn(y),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!l&&n&&o(T.minimized)},lang:d,tabIndex:"-1",ref:f,style:{zIndex:s},"data-nosnippet":!0,children:[(0,L.jsx)("div",{className:zn("app-wrapper"),children:e}),a&&(0,L.jsx)(Dh,{})]})},Lh=()=>{const{isVisible:e}=ao(),{openChat:t,closeChat:n}=Ao();return e&&(0,L.jsxs)(Rh,{children:[(0,L.jsx)(Ph,{onOpenChat:t}),(0,L.jsx)(kh,{onCloseChat:n,children:(0,L.jsx)(Th,{})}),(0,L.jsxs)(Eu,{interruptComponent:zs,children:[(0,L.jsx)(ql,{}),(0,L.jsx)(bu,{})]})]})},Uh=function(e){if(window.seamly&&!Array.isArray(window.seamly))throw new Error("Seamly UI has already been initialised. Use the window.seamly object to start new instances instead.");const t=Array.isArray(window.seamly)?window.seamly:[],n=new Sh(e);window.seamly={push:n.push.bind(n)},n.push(...t)}})(),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=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"].forEach((function(e){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){this._defaults.forEach((function(n){var r;e[n.fn].apply(e,function(e){if(Array.isArray(e))return t(e)}(r=n.args)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(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}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}))},e.exports=n},766:(e,t,n)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var 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;var i=n(767),s=n(445),a=n(129),c=n(842),l=n(508),u=n(253),p=n(574);function h(){}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)};var f=t=e.exports;t.Request=O,f.getXHR=function(){if(o.XMLHttpRequest&&(!o.location||"file:"!==o.location.protocol||!o.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw new Error("Browser-only version of superagent could not find XHR")};var d="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};function y(e){if(!l(e))return e;var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&b(t,n,e[n]);return t.join("&")}function b(e,t,n){if(void 0!==n)if(null!==n)if(Array.isArray(n))n.forEach((function(n){b(e,t,n)}));else if(l(n))for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&b(e,"".concat(t,"[").concat(r,"]"),n[r]);else e.push(encodeURI(t)+"="+encodeURIComponent(n));else e.push(encodeURI(t))}function g(e){for(var t,n,r={},o=e.split("&"),i=0,s=o.length;i<s;++i)-1===(n=(t=o[i]).indexOf("="))?r[decodeURIComponent(t)]="":r[decodeURIComponent(t.slice(0,n))]=decodeURIComponent(t.slice(n+1));return r}function m(e){return/[/+]json($|[^-\w])/i.test(e)}function v(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;var t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.headers=function(e){for(var t,n,r,o,i=e.split(/\r?\n/),s={},a=0,c=i.length;a<c;++a)-1!==(t=(n=i[a]).indexOf(":"))&&(r=n.slice(0,t).toLowerCase(),o=d(n.slice(t+1)),s[r]=o);return s}(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 O(e,t){var n=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",(function(){var e,t=null,r=null;try{r=new v(n)}catch(e){return(t=new Error("Parser is unable to parse the response")).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=r.status,n.callback(e,r)):n.callback(null,r)}))}function w(e,t,n){var r=f("DELETE",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}f.serializeObject=y,f.parseString=g,f.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"},f.serialize={"application/x-www-form-urlencoded":a.stringify,"application/json":s},f.parse={"application/x-www-form-urlencoded":g,"application/json":JSON.parse},u(v.prototype),v.prototype._parseBody=function(e){var t=f.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&m(this.type)&&(t=f.parse["application/json"]),t&&e&&(e.length>0||e instanceof Object)?t(e):null)},v.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot ".concat(t," ").concat(n," (").concat(this.status,")"),o=new Error(r);return o.status=this.status,o.method=t,o.url=n,o},f.Response=v,i(O.prototype),c(O.prototype),O.prototype.type=function(e){return this.set("Content-Type",f.types[e]||e),this},O.prototype.accept=function(e){return this.set("Accept",f.types[e]||e),this},O.prototype.auth=function(e,t,n){1===arguments.length&&(t=""),"object"===r(t)&&null!==t&&(n=t,t=""),n||(n={type:"function"==typeof btoa?"basic":"auto"});var o=function(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,o)},O.prototype.query=function(e){return"string"!=typeof e&&(e=y(e)),e&&this._query.push(e),this},O.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},O.prototype._getFormData=function(){return this._formData||(this._formData=new o.FormData),this._formData},O.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var n=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),n(e,t)},O.prototype.crossDomainError=function(){var 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)},O.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},O.prototype.ca=O.prototype.agent,O.prototype.buffer=O.prototype.ca,O.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},O.prototype.pipe=O.prototype.write,O.prototype._isHost=function(e){return e&&"object"===r(e)&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},O.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||h,this._finalizeQueryString(),this._end()},O.prototype._setUploadTimeout=function(){var e=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){e._timeoutError("Upload timeout of ",e._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},O.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var e=this;this.xhr=f.getXHR();var t=this.xhr,n=this._formData||this._data;this._setTimeouts(),t.onreadystatechange=function(){var n=t.readyState;if(n>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4===n){var r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var r=function(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)){var o=this._header["content-type"],i=this._serializer||f.serialize[o?o.split(";")[0]:""];!i&&m(o)&&(i=f.serialize["application/json"]),i&&(n=i(n))}for(var s in this.header)null!==this.header[s]&&Object.prototype.hasOwnProperty.call(this.header,s)&&t.setRequestHeader(s,this.header[s]);this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0===n?null:n)},f.agent=function(){return new p},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(e){p.prototype[e.toLowerCase()]=function(t,n){var r=new f.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}})),p.prototype.del=p.prototype.delete,f.get=function(e,t,n){var r=f("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},f.head=function(e,t,n){var r=f("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},f.options=function(e,t,n){var r=f("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},f.del=w,f.delete=w,f.patch=function(e,t,n){var r=f("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},f.post=function(e,t,n){var r=f("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},f.put=function(e,t,n){var r=f("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}},508:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){return null!==e&&"object"===t(e)}},842:(e,t,n)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=n(508);function i(e){if(e)return function(e){for(var t in i.prototype)Object.prototype.hasOwnProperty.call(i.prototype,t)&&(e[t]=i.prototype[t]);return e}(e)}e.exports=i,i.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},i.prototype.parse=function(e){return this._parser=e,this},i.prototype.responseType=function(e){return this._responseType=e,this},i.prototype.serialize=function(e){return this._serializer=e,this},i.prototype.timeout=function(e){if(!e||"object"!==r(e))return this._timeout=e,this._responseTimeout=0,this._uploadTimeout=0,this;for(var t in e)if(Object.prototype.hasOwnProperty.call(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},i.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};var s=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),a=new Set([408,413,429,500,502,503,504,521,522,524]);i.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var n=this._retryCallback(e,t);if(!0===n)return!0;if(!1===n)return!1}catch(e){console.error(e)}if(t&&t.status&&a.has(t.status))return!0;if(e){if(e.code&&s.has(e.code))return!0;if(e.timeout&&"ECONNABORTED"===e.code)return!0;if(e.crossDomain)return!0}return!1},i.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()},i.prototype.then=function(e,t){var n=this;if(!this._fullfilledPromise){var r=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((function(e,t){r.on("abort",(function(){if(!(n._maxRetries&&n._maxRetries>n._retries))if(n.timedout&&n.timedoutError)t(n.timedoutError);else{var e=new Error("Aborted");e.code="ABORTED",e.status=n.status,e.method=n.method,e.url=n.url,t(e)}})),r.end((function(n,r){n?t(n):e(r)}))}))}return this._fullfilledPromise.then(e,t)},i.prototype.catch=function(e){return this.then(void 0,e)},i.prototype.use=function(e){return e(this),this},i.prototype.ok=function(e){if("function"!=typeof e)throw new Error("Callback required");return this._okCallback=e,this},i.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},i.prototype.get=function(e){return this._header[e.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(e,t){if(o(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},i.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},i.prototype.field=function(e,t){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(o(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.field(n,e[n]);return this}if(Array.isArray(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.field(e,t[r]);return this}if(null==t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=String(t)),this._getFormData().append(e,t),this},i.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},i.prototype._auth=function(e,t,n,r){switch(n.type){case"basic":this.set("Authorization","Basic ".concat(r("".concat(e,":").concat(t))));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer ".concat(e))}return this},i.prototype.withCredentials=function(e){return void 0===e&&(e=!0),this._withCredentials=e,this},i.prototype.redirects=function(e){return this._maxRedirects=e,this},i.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw new TypeError("Invalid argument");return this._maxResponseSize=e,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(e){var t=o(e),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&&o(this._data))for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this._data[r]=e[r]);else"string"==typeof e?(n||this.type("form"),(n=this._header["content-type"])&&(n=n.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===n?this._data?"".concat(this._data,"&").concat(e):e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)||n||this.type("json"),this},i.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},i.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.includes("?")?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var n=this.url.slice(t+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.slice(0,t)+"?"+n.join("&")}}},i.prototype._appendQueryString=function(){console.warn("Unsupported")},i.prototype._timeoutError=function(e,t,n){if(!this._aborted){var r=new Error("".concat(e+t,"ms exceeded"));r.timeout=t,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.timedoutError=r,this.abort(),this.callback(r)}},i.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},253:(e,t,n)=>{"use strict";var r=n(244);function o(e){if(e)return function(e){for(var t in o.prototype)Object.prototype.hasOwnProperty.call(o.prototype,t)&&(e[t]=o.prototype[t]);return e}(e)}e.exports=o,o.prototype.get=function(e){return this.header[e.toLowerCase()]},o.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=r.type(t);var n=r.params(t);for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(this[o]=n[o]);this.links={};try{e.link&&(this.links=r.parseLinks(e.link))}catch(e){}},o.prototype._setStatusProperties=function(e){var t=e/100|0;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;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw s}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t.type=function(e){return e.split(/ *; */).shift()},t.params=function(e){var t,r={},o=n(e.split(/ *; */));try{for(o.s();!(t=o.n()).done;){var i=t.value.split(/ *= */),s=i.shift(),a=i.shift();s&&a&&(r[s]=a)}}catch(e){o.e(e)}finally{o.f()}return r},t.parseLinks=function(e){var t,r={},o=n(e.split(/ *, */));try{for(o.s();!(t=o.n()).done;){var i=t.value.split(/ *; */),s=i[0].slice(1,-1);r[i[1].split(/ *= */)[1].slice(1,-1)]=s}}catch(e){o.e(e)}finally{o.f()}return r},t.cleanHeader=function(e,t){return delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e}},905:e=>{e.exports=()=>()=>null},698: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%"),s=o("%Function.prototype.call%"),a=o("%Reflect.apply%",!0)||r.call(s,i),c=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=a(r,s,arguments);if(c&&l){var n=c(t,"length");n.configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var p=function(){return a(r,i,arguments)};l?l(e.exports,"apply",{value:p}):e.exports.apply=p},767:e=>{function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}},289:(e,t,n)=>{"use strict";var r=n(215),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,c=a&&function(){var e={};try{for(var t in a(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),l=function(e,t,n,r){var o;(!(t in e)||"function"==typeof(o=r)&&"[object Function]"===i.call(o)&&r())&&(c?a(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)},u=function(e,t){var n=arguments.length>2?arguments[2]:{},i=r(t);o&&(i=s.call(i,Object.getOwnPropertySymbols(t)));for(var a=0;a<i.length;a+=1)l(e,i[a],t[i[a]],n[i[a]])};u.supportsDescriptors=!!c,e.exports=u},445:e=>{e.exports=r,r.default=r,r.stable=s,r.stableStringify=s;var t=[],n=[];function r(e,r,i){var s;for(o(e,"",[],void 0),s=0===n.length?JSON.stringify(e,r,i):JSON.stringify(e,c(r),i);0!==t.length;){var a=t.pop();4===a.length?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}return s}function o(e,r,i,s){var a;if("object"==typeof e&&null!==e){for(a=0;a<i.length;a++)if(i[a]===e){var c=Object.getOwnPropertyDescriptor(s,r);return void(void 0!==c.get?c.configurable?(Object.defineProperty(s,r,{value:"[Circular]"}),t.push([s,r,e,c])):n.push([e,r]):(s[r]="[Circular]",t.push([s,r,e])))}if(i.push(e),Array.isArray(e))for(a=0;a<e.length;a++)o(e[a],a,i,e);else{var l=Object.keys(e);for(a=0;a<l.length;a++){var u=l[a];o(e[u],u,i,e)}}i.pop()}}function i(e,t){return e<t?-1:e>t?1:0}function s(e,r,o){var i,s=a(e,"",[],void 0)||e;for(i=0===n.length?JSON.stringify(s,r,o):JSON.stringify(s,c(r),o);0!==t.length;){var l=t.pop();4===l.length?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}return i}function a(e,r,o,s){var c;if("object"==typeof e&&null!==e){for(c=0;c<o.length;c++)if(o[c]===e){var l=Object.getOwnPropertyDescriptor(s,r);return void(void 0!==l.get?l.configurable?(Object.defineProperty(s,r,{value:"[Circular]"}),t.push([s,r,e,l])):n.push([e,r]):(s[r]="[Circular]",t.push([s,r,e])))}if("function"==typeof e.toJSON)return;if(o.push(e),Array.isArray(e))for(c=0;c<e.length;c++)a(e[c],c,o,e);else{var u={},p=Object.keys(e).sort(i);for(c=0;c<p.length;c++){var h=p[c];a(e[h],h,o,e),u[h]=e[h]}if(void 0===s)return u;t.push([s,r,e]),s[r]=u}o.pop()}}function c(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(n.length>0)for(var o=0;o<n.length;o++){var i=n[o];if(i[1]===t&&i[0]===r){r="[Circular]",n.splice(o,1);break}}return e.call(this,t,r)}}},648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,r=Object.prototype.toString,o="[object Function]";e.exports=function(e){var i=this;if("function"!=typeof i||r.call(i)!==o)throw new TypeError(t+i);for(var s,a=n.call(arguments,1),c=function(){if(this instanceof s){var t=i.apply(this,a.concat(n.call(arguments)));return Object(t)===t?t:this}return i.apply(e,a.concat(n.call(arguments)))},l=Math.max(0,i.length-a.length),u=[],p=0;p<l;p++)u.push("$"+p);if(s=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(c),i.prototype){var h=function(){};h.prototype=i.prototype,s.prototype=new h,h.prototype=null}return s}},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,s=TypeError,a=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var l=function(){throw new s},u=c?function(){try{return l}catch(e){try{return c(arguments,"callee").get}catch(e){return l}}}():l,p=n(405)(),h=Object.getPrototypeOf||function(e){return e.__proto__},f={},d="undefined"==typeof Uint8Array?r:h(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":p?h([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p?h(h([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p?h((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p?h((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p?h(""[Symbol.iterator]()):r,"%Symbol%":p?Symbol:r,"%SyntaxError%":o,"%ThrowTypeError%":u,"%TypedArray%":d,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},b=function e(t){var n;if("%AsyncFunction%"===t)n=a("async function () {}");else if("%GeneratorFunction%"===t)n=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=a("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=h(o.prototype))}return y[t]=n,n},g={"%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"]},m=n(612),v=n(642),O=m.call(Function.call,Array.prototype.concat),w=m.call(Function.apply,Array.prototype.splice),j=m.call(Function.call,String.prototype.replace),x=m.call(Function.call,String.prototype.slice),_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E=/\\(\\)?/g,S=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,_,(function(e,t,n,o){r[r.length]=n?j(o,E,"$1"):t||e})),r},T=function(e,t){var n,r=e;if(v(g,r)&&(r="%"+(n=g[r])[0]+"%"),v(y,r)){var i=y[r];if(i===f&&(i=b(r)),void 0===i&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');var n=S(e),r=n.length>0?n[0]:"",i=T("%"+r+"%",t),a=i.name,l=i.value,u=!1,p=i.alias;p&&(r=p[0],w(n,O([0,1],p)));for(var h=1,f=!0;h<n.length;h+=1){var d=n[h],b=x(d,0,1),g=x(d,-1);if(('"'===b||"'"===b||"`"===b||'"'===g||"'"===g||"`"===g)&&b!==g)throw new o("property names with quotes must have matching quotes");if("constructor"!==d&&f||(u=!0),v(y,a="%"+(r+="."+d)+"%"))l=y[a];else if(null!=l){if(!(d in l)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&h+1>=n.length){var m=c(l,d);l=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:l[d]}else f=v(l,d),l=l[d];f&&!u&&(y[a]=l)}}return l}},221:e=>{"use strict";"undefined"!=typeof self?e.exports=self:"undefined"!=typeof window?e.exports=window:e.exports=Function("return this")()},503:(e,t,n)=>{"use strict";var r=n(289),o=n(221),i=n(168),s=n(471),a=i(),c=function(){return a};r(c,{getPolyfill:i,implementation:o,shim:s}),e.exports=c},168:(e,t,n)=>{"use strict";var r=n(221);e.exports=function(){return"object"==typeof n.g&&n.g&&n.g.Math===Math&&n.g.Array===Array?n.g:r}},471:(e,t,n)=>{"use strict";var r=n(289),o=n(168);e.exports=function(){var e=o();if(r.supportsDescriptors){var t=Object.getOwnPropertyDescriptor(e,"globalThis");(!t||t.configurable&&(t.enumerable||t.writable||globalThis!==e))&&Object.defineProperty(e,"globalThis",{configurable:!0,enumerable:!1,value:e,writable:!1})}else"object"==typeof globalThis&&globalThis===e||(e.globalThis=e);return e}},405:(e,t,n)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(419);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},642:(e,t,n)=>{"use strict";var r=n(612);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},679:e=>{e.exports=function(e){var t={},n=[];(e=e||this).on=function(n,r,o){return(t[n]=t[n]||[]).push([r,o]),e},e.off=function(r,o){r||(t={});for(var i=t[r]||n,s=i.length=o?i.length:0;s--;)o==i[s][0]&&i.splice(s,1);return e},e.emit=function(r){for(var o,i=t[r]||n,s=i.length>0?i.slice(0,i.length):i,a=0;o=s[a++];)o[0].apply(o[1],n.slice.call(arguments,1));return e}}},631:(e,t,n)=>{var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"==typeof o.get?o.get:null,s=r&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=a&&c&&"function"==typeof c.get?c.get:null,u=a&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,y=Object.prototype.toString,b=Function.prototype.toString,g=String.prototype.match,m="function"==typeof BigInt?BigInt.prototype.valueOf:null,v=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,w="function"==typeof Symbol&&"object"==typeof Symbol.iterator,j=Object.prototype.propertyIsEnumerable,x=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),_=n(654).custom,E=_&&C(_)?_:null,S="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function T(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function k(e){return String(e).replace(/"/g,""")}function P(e){return!("[object Array]"!==N(e)||S&&"object"==typeof e&&S in e)}function C(e){if(w)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,r,o){var a=n||{};if(I(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(I(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!I(a,"customInspect")||a.customInspect;if("boolean"!=typeof c)throw new TypeError('option "customInspect", if provided, must be `true` or `false`');if(I(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return R(t,a);if("number"==typeof t)return 0===t?1/0/t>0?"0":"-0":String(t);if("bigint"==typeof t)return String(t)+"n";var y=void 0===a.depth?5:a.depth;if(void 0===r&&(r=0),r>=y&&y>0&&"object"==typeof t)return P(t)?"[Array]":"[Object]";var v,j=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=Array(e.indent+1).join(" ")}return{base:n,prev:Array(t+1).join(n)}}(a,r);if(void 0===o)o=[];else if(D(o,t)>=0)return"[Circular]";function _(t,n,i){if(n&&(o=o.slice()).push(n),i){var s={depth:a.depth};return I(a,"quoteStyle")&&(s.quoteStyle=a.quoteStyle),e(t,s,r+1,o)}return e(t,a,r+1,o)}if("function"==typeof t){var A=function(e){if(e.name)return e.name;var t=g.call(b.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),L=B(t,_);return"[Function"+(A?": "+A:" (anonymous)")+"]"+(L.length>0?" { "+L.join(", ")+" }":"")}if(C(t)){var F=w?String(t).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!=typeof t||w?F:U(F)}if((v=t)&&"object"==typeof v&&("undefined"!=typeof HTMLElement&&v instanceof HTMLElement||"string"==typeof v.nodeName&&"function"==typeof v.getAttribute)){for(var H="<"+String(t.nodeName).toLowerCase(),q=t.attributes||[],V=0;V<q.length;V++)H+=" "+q[V].name+"="+T(k(q[V].value),"double",a);return H+=">",t.childNodes&&t.childNodes.length&&(H+="..."),H+"</"+String(t.nodeName).toLowerCase()+">"}if(P(t)){if(0===t.length)return"[]";var W=B(t,_);return j&&!function(e){for(var t=0;t<e.length;t++)if(D(e[t],"\n")>=0)return!1;return!0}(W)?"["+z(W,j)+"]":"[ "+W.join(", ")+" ]"}if(function(e){return!("[object Error]"!==N(e)||S&&"object"==typeof e&&S in e)}(t)){var G=B(t,_);return 0===G.length?"["+String(t)+"]":"{ ["+String(t)+"] "+G.join(", ")+" }"}if("object"==typeof t&&c){if(E&&"function"==typeof t[E])return t[E]();if("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 K=[];return s.call(t,(function(e,n){K.push(_(n,t,!0)+" => "+_(e,t))})),$("Map",i.call(t),K,j)}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 Y=[];return u.call(t,(function(e){Y.push(_(e,t))})),$("Set",l.call(t),Y,j)}if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{h.call(e,h)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return M("WeakMap");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{h.call(e,h);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return M("WeakSet");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{return f.call(e),!0}catch(e){}return!1}(t))return M("WeakRef");if(function(e){return!("[object Number]"!==N(e)||S&&"object"==typeof e&&S in e)}(t))return U(_(Number(t)));if(function(e){if(!e||"object"!=typeof e||!m)return!1;try{return m.call(e),!0}catch(e){}return!1}(t))return U(_(m.call(t)));if(function(e){return!("[object Boolean]"!==N(e)||S&&"object"==typeof e&&S in e)}(t))return U(d.call(t));if(function(e){return!("[object String]"!==N(e)||S&&"object"==typeof e&&S in e)}(t))return U(_(String(t)));if(!function(e){return!("[object Date]"!==N(e)||S&&"object"==typeof e&&S in e)}(t)&&!function(e){return!("[object RegExp]"!==N(e)||S&&"object"==typeof e&&S in e)}(t)){var J=B(t,_),Q=x?x(t)===Object.prototype:t instanceof Object||t.constructor===Object,Z=t instanceof Object?"":"null prototype",X=!Q&&S&&Object(t)===t&&S in t?N(t).slice(8,-1):Z?"Object":"",ee=(Q||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(X||Z?"["+[].concat(X||[],Z||[]).join(": ")+"] ":"");return 0===J.length?ee+"{}":j?ee+"{"+z(J,j)+"}":ee+"{ "+J.join(", ")+" }"}return String(t)};var A=Object.prototype.hasOwnProperty||function(e){return e in this};function I(e,t){return A.call(e,t)}function N(e){return y.call(e)}function D(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 R(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return R(e.slice(0,t.maxStringLength),t)+r}return T(e.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,L),"single",t)}function L(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":"")+t.toString(16).toUpperCase()}function U(e){return"Object("+e+")"}function M(e){return e+" { ? }"}function $(e,t,n,r){return e+" ("+t+") {"+(r?z(n,r):n.join(", "))+"}"}function z(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+e.join(","+n)+"\n"+t.prev}function B(e,t){var n=P(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=I(e,o)?t(e[o],e):""}var i,s="function"==typeof v?v(e):[];if(w){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var c in e)I(e,c)&&(n&&String(Number(c))===c&&c<e.length||w&&i["$"+c]instanceof Symbol||(/[^\w$]/.test(c)?r.push(t(c,e)+": "+t(e[c],e)):r.push(c+": "+t(e[c],e))));if("function"==typeof v)for(var l=0;l<s.length;l++)j.call(e,s[l])&&r.push("["+t(s[l])+"]: "+t(e[s[l]],e));return r}},987:(e,t,n)=>{"use strict";var r;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,s=n(414),a=Object.prototype.propertyIsEnumerable,c=!a.call({toString:null},"toString"),l=a.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(e){var t=e.constructor;return t&&t.prototype===e},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!h["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{p(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();r=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===i.call(e),r=s(e),a=t&&"[object String]"===i.call(e),h=[];if(!t&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var d=l&&n;if(a&&e.length>0&&!o.call(e,0))for(var y=0;y<e.length;++y)h.push(String(y));if(r&&e.length>0)for(var b=0;b<e.length;++b)h.push(String(b));else for(var g in e)d&&"prototype"===g||!o.call(e,g)||h.push(String(g));if(c)for(var m=function(e){if("undefined"==typeof window||!f)return p(e);try{return p(e)}catch(e){return!1}}(e),v=0;v<u.length;++v)m&&"constructor"===u[v]||!o.call(e,u[v])||h.push(u[v]);return h}}e.exports=r},215:(e,t,n)=>{"use strict";var r=Array.prototype.slice,o=n(414),i=Object.keys,s=i?function(e){return i(e)}:n(987),a=Object.keys;s.shim=function(){return Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function(e){return o(e)?a(r.call(e)):a(e)}):Object.keys=s,Object.keys||s},e.exports=s},414:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var n=t.call(e),r="[object Arguments]"===n;return r||(r="[object Array]"!==n&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),r}},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,s={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/g,a=n.depth>0&&/(\[[^[\]]*])/.exec(i),l=a?i.slice(0,a.index):i,u=[];if(l){if(!n.plainObjects&&o.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var p=0;n.depth>0&&null!==(a=s.exec(i))&&p<n.depth;){if(p+=1,!n.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(a[1])}return a&&u.push("["+i.slice(a.index)+"]"),function(e,t,n,r){for(var o=r?t:c(t,n),i=e.length-1;i>=0;--i){var s,a=e[i];if("[]"===a&&n.parseArrays)s=[].concat(o);else{s=n.plainObjects?Object.create(null):{};var l="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&a!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(s=[])[u]=o:s[l]=o:s={0:o}}o=s}return o}(u,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return s;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?s.charset:e.charset;return{allowDots:void 0===e.allowDots?s.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:s.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var n,l={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,p=t.parameterLimit===1/0?void 0:t.parameterLimit,h=u.split(t.delimiter,p),f=-1,d=t.charset;if(t.charsetSentinel)for(n=0;n<h.length;++n)0===h[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===h[n]?d="utf-8":"utf8=%26%2310003%3B"===h[n]&&(d="iso-8859-1"),f=n,n=h.length);for(n=0;n<h.length;++n)if(n!==f){var y,b,g=h[n],m=g.indexOf("]="),v=-1===m?g.indexOf("="):m+1;-1===v?(y=t.decoder(g,s.decoder,d,"key"),b=t.strictNullHandling?null:""):(y=t.decoder(g.slice(0,v),s.decoder,d,"key"),b=r.maybeMap(c(g.slice(v+1),t),(function(e){return t.decoder(e,s.decoder,d,"value")}))),b&&t.interpretNumericEntities&&"iso-8859-1"===d&&(b=a(b)),g.indexOf("[]=")>-1&&(b=i(b)?[b]:b),o.call(l,y)?l[y]=r.combine(l[y],b):l[y]=b}return l}(e,n):e,p=n.plainObjects?Object.create(null):{},h=Object.keys(u),f=0;f<h.length;++f){var d=h[f],y=l(d,u[d],n,"string"==typeof e);p=r.merge(p,y,n)}return!0===n.allowSparse?p:r.compact(p)}},261:(e,t,n)=>{"use strict";var r=n(478),o=n(769),i=n(798),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,l=Array.prototype.push,u=function(e,t){l.apply(e,c(t)?t:[t])},p=Date.prototype.toISOString,h=i.default,f={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:h,formatter:i.formatters[h],indices:!1,serializeDate:function(e){return p.call(e)},skipNulls:!1,strictNullHandling:!1},d=function e(t,n,i,s,a,l,p,h,d,y,b,g,m,v,O){var w,j=t;if(O.has(t))throw new RangeError("Cyclic object value");if("function"==typeof p?j=p(n,j):j instanceof Date?j=y(j):"comma"===i&&c(j)&&(j=o.maybeMap(j,(function(e){return e instanceof Date?y(e):e}))),null===j){if(s)return l&&!m?l(n,f.encoder,v,"key",b):n;j=""}if("string"==typeof(w=j)||"number"==typeof w||"boolean"==typeof w||"symbol"==typeof w||"bigint"==typeof w||o.isBuffer(j))return l?[g(m?n:l(n,f.encoder,v,"key",b))+"="+g(l(j,f.encoder,v,"value",b))]:[g(n)+"="+g(String(j))];var x,_=[];if(void 0===j)return _;if("comma"===i&&c(j))x=[{value:j.length>0?j.join(",")||null:void 0}];else if(c(p))x=p;else{var E=Object.keys(j);x=h?E.sort(h):E}for(var S=0;S<x.length;++S){var T=x[S],k="object"==typeof T&&void 0!==T.value?T.value:j[T];if(!a||null!==k){var P=c(j)?"function"==typeof i?i(n,T):n:n+(d?"."+T:"["+T+"]");O.set(t,!0);var C=r();u(_,e(k,P,i,s,a,l,p,h,d,y,b,g,m,v,C))}}return _};e.exports=function(e,t){var n,o=e,l=function(e){if(!e)return f;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||f.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=i.default;if(void 0!==e.format){if(!s.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=i.formatters[n],o=f.filter;return("function"==typeof e.filter||c(e.filter))&&(o=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:f.addQueryPrefix,allowDots:void 0===e.allowDots?f.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:f.charsetSentinel,delimiter:void 0===e.delimiter?f.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:f.encode,encoder:"function"==typeof e.encoder?e.encoder:f.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:f.encodeValuesOnly,filter:o,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:f.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:f.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:f.strictNullHandling}}(t);"function"==typeof l.filter?o=(0,l.filter)("",o):c(l.filter)&&(n=l.filter);var p,h=[];if("object"!=typeof o||null===o)return"";p=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var y=a[p];n||(n=Object.keys(o)),l.sort&&n.sort(l.sort);for(var b=r(),g=0;g<n.length;++g){var m=n[g];l.skipNulls&&null===o[m]||u(h,d(o[m],m,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 v=h.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&"),v.length>0?O+v:""}},769:(e,t,n)=>{"use strict";var r=n(798),o=Object.prototype.hasOwnProperty,i=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],s=o.obj[o.prop],a=Object.keys(s),c=0;c<a.length;++c){var l=a[c],u=s[l];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:s,prop:l}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,o,i){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===n)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var c="",l=0;l<a.length;++l){var u=a.charCodeAt(l);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===r.RFC1738&&(40===u||41===u)?c+=a.charAt(l):u<128?c+=s[u]:u<2048?c+=s[192|u>>6]+s[128|63&u]:u<55296||u>=57344?c+=s[224|u>>12]+s[128|u>>6&63]+s[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&a.charCodeAt(l)),c+=s[240|u>>18]+s[128|u>>12&63]+s[128|u>>6&63]+s[128|63&u])}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(i(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!o.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var s=t;return i(t)&&!i(n)&&(s=a(t,r)),i(t)&&i(n)?(n.forEach((function(n,i){if(o.call(t,i)){var s=t[i];s&&"object"==typeof s&&n&&"object"==typeof n?t[i]=e(s,n,r):t.push(n)}else t[i]=n})),t):Object.keys(n).reduce((function(t,i){var s=n[i];return o.call(t,i)?t[i]=e(t[i],s,r):t[i]=s,t}),s)}}},478:(e,t,n)=>{"use strict";var r=n(210),o=n(924),i=n(631),s=r("%TypeError%"),a=r("%WeakMap%",!0),c=r("%Map%",!0),l=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),p=o("WeakMap.prototype.has",!0),h=o("Map.prototype.get",!0),f=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),y=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n};e.exports=function(){var e,t,n,r={assert:function(e){if(!r.has(e))throw new s("Side channel does not contain "+i(e))},get:function(r){if(a&&r&&("object"==typeof r||"function"==typeof r)){if(e)return l(e,r)}else if(c){if(t)return h(t,r)}else if(n)return function(e,t){var n=y(e,t);return n&&n.value}(n,r)},has:function(r){if(a&&r&&("object"==typeof r||"function"==typeof r)){if(e)return p(e,r)}else if(c){if(t)return d(t,r)}else if(n)return function(e,t){return!!y(e,t)}(n,r);return!1},set:function(r,o){a&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new a),u(e,r,o)):c?(t||(t=new c),f(t,r,o)):(n||(n={key:{},next:null}),function(e,t,n){var r=y(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,r,o))}};return r}},839:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.Symbol;if("function"==typeof n)if(n.observable)t=n.observable;else{t=n.for("https://github.com/benlesh/symbol-observable");try{n.observable=t}catch(e){}}else t="@@observable";return t}},868:(e,t,n)=>{e.exports=n(839)},813:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.NO_IL=t.NO=t.MemoryStream=t.Stream=void 0;var i=n(868),s=n(503),a=i.default(s.getPolyfill()),c={};function l(){}function u(e){for(var t=e.length,n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function p(e,t,n){try{return e.f(t)}catch(e){return n._e(e),c}}t.NO=c;var h={_n:l,_e:l,_c:l};function f(e){e._start=function(e){e.next=e._n,e.error=e._e,e.complete=e._c,this.start(e)},e._stop=e.stop}t.NO_IL=h;var d=function(){function e(e,t){this._stream=e,this._listener=t}return e.prototype.unsubscribe=function(){this._stream._remove(this._listener)},e}(),y=function(){function e(e){this._listener=e}return e.prototype.next=function(e){this._listener._n(e)},e.prototype.error=function(e){this._listener._e(e)},e.prototype.complete=function(){this._listener._c()},e}(),b=function(){function e(e){this.type="fromObservable",this.ins=e,this.active=!1}return e.prototype._start=function(e){this.out=e,this.active=!0,this._sub=this.ins.subscribe(new y(e)),this.active||this._sub.unsubscribe()},e.prototype._stop=function(){this._sub&&this._sub.unsubscribe(),this.active=!1},e}(),g=function(){function e(e){this.type="merge",this.insArr=e,this.out=c,this.ac=0}return e.prototype._start=function(e){this.out=e;var t=this.insArr,n=t.length;this.ac=n;for(var r=0;r<n;r++)t[r]._add(this)},e.prototype._stop=function(){for(var e=this.insArr,t=e.length,n=0;n<t;n++)e[n]._remove(this);this.out=c},e.prototype._n=function(e){var t=this.out;t!==c&&t._n(e)},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){if(--this.ac<=0){var e=this.out;if(e===c)return;e._c()}},e}(),m=function(){function e(e,t,n){this.i=e,this.out=t,this.p=n,n.ils.push(this)}return e.prototype._n=function(e){var t=this.p,n=this.out;if(n!==c&&t.up(e,this.i)){var r=u(t.vals);n._n(r)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.p;e.out!==c&&0==--e.Nc&&e.out._c()},e}(),v=function(){function e(e){this.type="combine",this.insArr=e,this.out=c,this.ils=[],this.Nc=this.Nn=0,this.vals=[]}return e.prototype.up=function(e,t){var n=this.vals[t],r=this.Nn?n===c?--this.Nn:this.Nn:0;return this.vals[t]=e,0===r},e.prototype._start=function(e){this.out=e;var t=this.insArr,n=this.Nc=this.Nn=t.length,r=this.vals=new Array(n);if(0===n)e._n([]),e._c();else for(var o=0;o<n;o++)r[o]=c,t[o]._add(new m(o,e,this))},e.prototype._stop=function(){for(var e=this.insArr,t=e.length,n=this.ils,r=0;r<t;r++)e[r]._remove(n[r]);this.out=c,this.ils=[],this.vals=[]},e}(),O=function(){function e(e){this.type="fromArray",this.a=e}return e.prototype._start=function(e){for(var t=this.a,n=0,r=t.length;n<r;n++)e._n(t[n]);e._c()},e.prototype._stop=function(){},e}(),w=function(){function e(e){this.type="fromPromise",this.on=!1,this.p=e}return e.prototype._start=function(e){var t=this;this.on=!0,this.p.then((function(n){t.on&&(e._n(n),e._c())}),(function(t){e._e(t)})).then(l,(function(e){setTimeout((function(){throw e}))}))},e.prototype._stop=function(){this.on=!1},e}(),j=function(){function e(e){this.type="periodic",this.period=e,this.intervalID=-1,this.i=0}return e.prototype._start=function(e){var t=this;this.intervalID=setInterval((function(){e._n(t.i++)}),this.period)},e.prototype._stop=function(){-1!==this.intervalID&&clearInterval(this.intervalID),this.intervalID=-1,this.i=0},e}(),x=function(){function e(e,t){this.type="debug",this.ins=e,this.out=c,this.s=l,this.l="","string"==typeof t?this.l=t:"function"==typeof t&&(this.s=t)}return e.prototype._start=function(e){this.out=e,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=this.s,r=this.l;if(n!==l)try{n(e)}catch(e){t._e(e)}else r?console.log(r+":",e):console.log(e);t._n(e)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),_=function(){function e(e,t){this.type="drop",this.ins=t,this.out=c,this.max=e,this.dropped=0}return e.prototype._start=function(e){this.out=e,this.dropped=0,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;t!==c&&this.dropped++>=this.max&&t._n(e)},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),E=function(){function e(e,t){this.out=e,this.op=t}return e.prototype._n=function(){this.op.end()},e.prototype._e=function(e){this.out._e(e)},e.prototype._c=function(){this.op.end()},e}(),S=function(){function e(e,t){this.type="endWhen",this.ins=t,this.out=c,this.o=e,this.oil=h}return e.prototype._start=function(e){this.out=e,this.o._add(this.oil=new E(e,this)),this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.o._remove(this.oil),this.out=c,this.oil=h},e.prototype.end=function(){var e=this.out;e!==c&&e._c()},e.prototype._n=function(e){var t=this.out;t!==c&&t._n(e)},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){this.end()},e}(),T=function(){function e(e,t){this.type="filter",this.ins=t,this.out=c,this.f=e}return e.prototype._start=function(e){this.out=e,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=p(this,e,t);n!==c&&n&&t._n(e)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),k=function(){function e(e,t){this.out=e,this.op=t}return e.prototype._n=function(e){this.out._n(e)},e.prototype._e=function(e){this.out._e(e)},e.prototype._c=function(){this.op.inner=c,this.op.less()},e}(),P=function(){function e(e){this.type="flatten",this.ins=e,this.out=c,this.open=!0,this.inner=c,this.il=h}return e.prototype._start=function(e){this.out=e,this.open=!0,this.inner=c,this.il=h,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.inner!==c&&this.inner._remove(this.il),this.out=c,this.open=!0,this.inner=c,this.il=h},e.prototype.less=function(){var e=this.out;e!==c&&(this.open||this.inner!==c||e._c())},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=this.inner,r=this.il;n!==c&&r!==h&&n._remove(r),(this.inner=e)._add(this.il=new k(t,this))}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){this.open=!1,this.less()},e}(),C=function(){function e(e,t,n){var r=this;this.type="fold",this.ins=n,this.out=c,this.f=function(t){return e(r.acc,t)},this.acc=this.seed=t}return e.prototype._start=function(e){this.out=e,this.acc=this.seed,e._n(this.acc),this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c,this.acc=this.seed},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=p(this,e,t);n!==c&&t._n(this.acc=n)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),A=function(){function e(e){this.type="last",this.ins=e,this.out=c,this.has=!1,this.val=c}return e.prototype._start=function(e){this.out=e,this.has=!1,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c,this.val=c},e.prototype._n=function(e){this.has=!0,this.val=e},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&(this.has?(e._n(this.val),e._c()):e._e(new Error("last() failed because input stream completed")))},e}(),I=function(){function e(e,t){this.type="map",this.ins=t,this.out=c,this.f=e}return e.prototype._start=function(e){this.out=e,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=p(this,e,t);n!==c&&t._n(n)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),N=function(){function e(e){this.type="remember",this.ins=e,this.out=c}return e.prototype._start=function(e){this.out=e,this.ins._add(e)},e.prototype._stop=function(){this.ins._remove(this.out),this.out=c},e}(),D=function(){function e(e,t){this.type="replaceError",this.ins=t,this.out=c,this.f=e}return e.prototype._start=function(e){this.out=e,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;t!==c&&t._n(e)},e.prototype._e=function(e){var t=this.out;if(t!==c)try{this.ins._remove(this),(this.ins=this.f(e))._add(this)}catch(e){t._e(e)}},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),R=function(){function e(e,t){this.type="startWith",this.ins=e,this.out=c,this.val=t}return e.prototype._start=function(e){this.out=e,this.out._n(this.val),this.ins._add(e)},e.prototype._stop=function(){this.ins._remove(this.out),this.out=c},e}(),L=function(){function e(e,t){this.type="take",this.ins=t,this.out=c,this.max=e,this.taken=0}return e.prototype._start=function(e){this.out=e,this.taken=0,this.max<=0?e._c():this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=++this.taken;n<this.max?t._n(e):n===this.max&&(t._n(e),t._c())}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),U=function(){function e(e){this._prod=e||c,this._ils=[],this._stopID=c,this._dl=c,this._d=!1,this._target=null,this._err=c}return e.prototype._n=function(e){var t=this._ils,n=t.length;if(this._d&&this._dl._n(e),1==n)t[0]._n(e);else{if(0==n)return;for(var r=u(t),o=0;o<n;o++)r[o]._n(e)}},e.prototype._e=function(e){if(this._err===c){this._err=e;var t=this._ils,n=t.length;if(this._x(),this._d&&this._dl._e(e),1==n)t[0]._e(e);else{if(0==n)return;for(var r=u(t),o=0;o<n;o++)r[o]._e(e)}if(!this._d&&0==n)throw this._err}},e.prototype._c=function(){var e=this._ils,t=e.length;if(this._x(),this._d&&this._dl._c(),1==t)e[0]._c();else{if(0==t)return;for(var n=u(e),r=0;r<t;r++)n[r]._c()}},e.prototype._x=function(){0!==this._ils.length&&(this._prod!==c&&this._prod._stop(),this._err=c,this._ils=[])},e.prototype._stopNow=function(){this._prod._stop(),this._err=c,this._stopID=c},e.prototype._add=function(e){var t=this._target;if(t)return t._add(e);var n=this._ils;if(n.push(e),!(n.length>1))if(this._stopID!==c)clearTimeout(this._stopID),this._stopID=c;else{var r=this._prod;r!==c&&r._start(this)}},e.prototype._remove=function(e){var t=this,n=this._target;if(n)return n._remove(e);var r=this._ils,o=r.indexOf(e);o>-1&&(r.splice(o,1),this._prod!==c&&r.length<=0?(this._err=c,this._stopID=setTimeout((function(){return t._stopNow()}))):1===r.length&&this._pruneCycles())},e.prototype._pruneCycles=function(){this._hasNoSinks(this,[])&&this._remove(this._ils[0])},e.prototype._hasNoSinks=function(e,t){if(-1!==t.indexOf(e))return!0;if(e.out===this)return!0;if(e.out&&e.out!==c)return this._hasNoSinks(e.out,t.concat(e));if(e._ils){for(var n=0,r=e._ils.length;n<r;n++)if(!this._hasNoSinks(e._ils[n],t.concat(e)))return!1;return!0}return!1},e.prototype.ctor=function(){return this instanceof M?M:e},e.prototype.addListener=function(e){e._n=e.next||l,e._e=e.error||l,e._c=e.complete||l,this._add(e)},e.prototype.removeListener=function(e){this._remove(e)},e.prototype.subscribe=function(e){return this.addListener(e),new d(this,e)},e.prototype[a]=function(){return this},e.create=function(t){if(t){if("function"!=typeof t.start||"function"!=typeof t.stop)throw new Error("producer requires both start and stop functions");f(t)}return new e(t)},e.createWithMemory=function(e){return e&&f(e),new M(e)},e.never=function(){return new e({_start:l,_stop:l})},e.empty=function(){return new e({_start:function(e){e._c()},_stop:l})},e.throw=function(t){return new e({_start:function(e){e._e(t)},_stop:l})},e.from=function(t){if("function"==typeof t[a])return e.fromObservable(t);if("function"==typeof t.then)return e.fromPromise(t);if(Array.isArray(t))return e.fromArray(t);throw new TypeError("Type of input to from() must be an Array, Promise, or Observable")},e.of=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.fromArray(t)},e.fromArray=function(t){return new e(new O(t))},e.fromPromise=function(t){return new e(new w(t))},e.fromObservable=function(t){if(void 0!==t.endWhen)return t;var n="function"==typeof t[a]?t[a]():t;return new e(new b(n))},e.periodic=function(t){return new e(new j(t))},e.prototype._map=function(e){return new(this.ctor())(new I(e,this))},e.prototype.map=function(e){return this._map(e)},e.prototype.mapTo=function(e){var t=this.map((function(){return e}));return t._prod.type="mapTo",t},e.prototype.filter=function(t){var n,r,o=this._prod;return new e(o instanceof T?new T((n=o.f,r=t,function(e){return n(e)&&r(e)}),o.ins):new T(t,this))},e.prototype.take=function(e){return new(this.ctor())(new L(e,this))},e.prototype.drop=function(t){return new e(new _(t,this))},e.prototype.last=function(){return new e(new A(this))},e.prototype.startWith=function(e){return new M(new R(this,e))},e.prototype.endWhen=function(e){return new(this.ctor())(new S(e,this))},e.prototype.fold=function(e,t){return new M(new C(e,t,this))},e.prototype.replaceError=function(e){return new(this.ctor())(new D(e,this))},e.prototype.flatten=function(){return new e(new P(this))},e.prototype.compose=function(e){return e(this)},e.prototype.remember=function(){return new M(new N(this))},e.prototype.debug=function(e){return new(this.ctor())(new x(this,e))},e.prototype.imitate=function(e){if(e instanceof M)throw new Error("A MemoryStream was given to imitate(), but it only supports a Stream. Read more about this restriction here: https://github.com/staltz/xstream#faq");this._target=e;for(var t=this._ils,n=t.length,r=0;r<n;r++)e._add(t[r]);this._ils=[]},e.prototype.shamefullySendNext=function(e){this._n(e)},e.prototype.shamefullySendError=function(e){this._e(e)},e.prototype.shamefullySendComplete=function(){this._c()},e.prototype.setDebugListener=function(e){e?(this._d=!0,e._n=e.next||l,e._e=e.error||l,e._c=e.complete||l,this._dl=e):(this._d=!1,this._dl=c)},e.merge=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(new g(t))},e.combine=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(new v(t))},e}();t.Stream=U;var M=function(e){function t(t){var n=e.call(this,t)||this;return n._has=!1,n}return o(t,e),t.prototype._n=function(t){this._v=t,this._has=!0,e.prototype._n.call(this,t)},t.prototype._add=function(e){var t=this._target;if(t)return t._add(e);var n=this._ils;if(n.push(e),n.length>1)this._has&&e._n(this._v);else if(this._stopID!==c)this._has&&e._n(this._v),clearTimeout(this._stopID),this._stopID=c;else if(this._has)e._n(this._v);else{var r=this._prod;r!==c&&r._start(this)}},t.prototype._stopNow=function(){this._has=!1,e.prototype._stopNow.call(this)},t.prototype._x=function(){this._has=!1,e.prototype._x.call(this)},t.prototype.map=function(e){return this._map(e)},t.prototype.mapTo=function(t){return e.prototype.mapTo.call(this,t)},t.prototype.take=function(t){return e.prototype.take.call(this,t)},t.prototype.endWhen=function(t){return e.prototype.endWhen.call(this,t)},t.prototype.replaceError=function(t){return e.prototype.replaceError.call(this,t)},t.prototype.remember=function(){return this},t.prototype.debug=function(t){return e.prototype.debug.call(this,t)},t}(U);t.MemoryStream=M;var $=U;t.default=$},654:()=>{}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,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,{API:()=>rh,AgentInfo:()=>Sh,Chat:()=>Ms,ChatFrame:()=>Eu,ComponentFilter:()=>Fl,Conversation:()=>ql,DeprecatedToggleButton:()=>kh,DeprecatedView:()=>Rh,Engine:()=>vh,EntryContainer:()=>bu,EventParticipant:()=>Js,ExternalApi:()=>Eh,Header:()=>Th,Icon:()=>fi,Interrupt:()=>$s,MessageContainer:()=>na,SeamlyApiContext:()=>Gn,SeamlyEventBusContext:()=>Kn,SeamlyGeneralError:()=>to,SeamlyLiveRegionContext:()=>To,SeamlyOfflineError:()=>ro,StoreProvider:()=>U,Text:()=>gc,View:()=>Du,calculateVisibility:()=>nn,className:()=>Wn,createReduxStore:()=>Y,default:()=>Lh,eventTypes:()=>je,getUrlParams:()=>he,getUrlSearchString:()=>fe,randomId:()=>s,seamlyActions:()=>Me,useChoicePrompt:()=>aa,useDispatch:()=>Xn,useEvents:()=>hn,useGeneratedId:()=>Kr,useI18n:()=>wr,useSeamlyChat:()=>Mo,useSeamlyCommands:()=>So,useSeamlyConfig:()=>ee,useSeamlyEventStream:()=>Yo,useSeamlyIdleDetachCountdown:()=>Wo,useSeamlyMessageContainerClassNames:()=>tr,useSeamlyOptions:()=>$r,useSeamlyVisibility:()=>yo,useTranslatedEventData:()=>ii,useTranslations:()=>oi,useTranslationsContainer:()=>si,visibilityStates:()=>T}),n(698);const e=require("preact");var t=n(679),o=n.n(t);const i=require("preact/hooks");function s(){return"_"+(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}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 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 l="//";function u(e,t,n="/"){return(r,...o)=>t(e+n+r,...o)}function p(e,t=(e=>({payload:e}))){const n=(...n)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c(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}({type:e},t(...n));return n.toString=()=>String(e),n.match=t=>(null==t?void 0:t.type)===String(e),n}function h(e,...t){const n=[];t.forEach((e=>{const t=typeof e;if("string"===t)return n.push([e]);"object"!==t||e instanceof Array||Object.keys(e).forEach((t=>n.push([t,e[t]])))}));const r=u(e,p,"/");return n.map((e=>r(...e)))}function f(e,t){const[n,r,o]=h(e,{pending:(e,t)=>({meta:{arg:e,requestId:t,status:"pending"}}),fulfilled:(e,t,n)=>({payload:t,meta:{arg:e,requestId:n,status:"fulfilled"}}),rejected:(e,t,n)=>({error:t,meta:{arg:e,requestId:n,status:"rejected",error:String(t)}})});return Object.assign((i=>(a,c,l)=>{const u=s(),p=(async()=>{let e;try{a(n(i,u));const o=t(i,{dispatch:a,getState:c,extra:l}),s=await o;e=r(i,s,u)}catch(t){e=o(i,t,u)}return a(e),e})();return Object.assign(p,{type:e,arg:i,requestId:u})}),{type:e,pending:n,fulfilled:r,rejected:o})}function d(e){return{createAction:u(e,p,l),createActions:u(e,h,l),createThunk:u(e,f,l),createReducer:(t,n)=>function(e,t={},n){const r=(e=n,r)=>{const o=null==t?void 0:t[null==r?void 0:r.type];return o?o(e,r):e};return r.toString=()=>e,r}(e,t,n),selectState:t=>t[e]}}const{createAction:y,createThunk:b,createReducer:g,selectState:m}=d("config"),v=y("initialize",(e=>({config:e}))),O=y("update",(e=>({config:e}))),w=y("setPreChatEvents",(e=>({events:e})));function j(e,t){return e===t}function x(e,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}function _(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 typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}var E=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=0,s=r.pop(),a=_(r),c=e.apply(void 0,[function(){return i++,s.apply(null,arguments)}].concat(n)),l=e((function(){for(var e=[],t=a.length,n=0;n<t;n++)e.push(a[n].apply(null,arguments));return c.apply(null,e)}));return l.resultFunc=s,l.dependencies=a,l.recomputations=function(){return i},l.resetRecomputations=function(){return i=0},l}}((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:j,n=null,r=null;return function(){return x(t,n,arguments)||(r=e.apply(null,arguments)),n=arguments,r}}));const S="visibility",T={hidden:"hidden",minimized:"minimized",open:"open",initialize:null};function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){C(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(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 A=E(m,(e=>{let t=P({visible:"inline"===(null==e?void 0:e.layoutMode)?T.open:T.minimized,appContainerClassNames:e.appContainerClassNames||[]},e);return"function"==typeof t.appContainerClassNames&&(t=P(P({},t),{},{appContainerClassNames:t.appContainerClassNames(t)})),t})),I=(0,e.createContext)(void 0),N=I,{Provider:D,Consumer:R}=I,L=require("preact/jsx-runtime");function U({store:e,children:t}){return(0,L.jsx)(D,{value:e,children:t})}function M(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $(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 z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$(Object(n),!0).forEach((function(t){M(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function B(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 F="function"==typeof Symbol&&Symbol.observable||"@@observable",H=function(){return Math.random().toString(36).substring(7).split("").join(".")},q={INIT:"@@redux/INIT"+H(),REPLACE:"@@redux/REPLACE"+H(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+H()}};function V(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 W(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(B(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(B(1));return n(W)(e,t)}if("function"!=typeof e)throw new Error(B(2));var o=e,i=t,s=[],a=s,c=!1;function l(){a===s&&(a=s.slice())}function u(){if(c)throw new Error(B(3));return i}function p(e){if("function"!=typeof e)throw new Error(B(4));if(c)throw new Error(B(5));var t=!0;return l(),a.push(e),function(){if(t){if(c)throw new Error(B(6));t=!1,l();var n=a.indexOf(e);a.splice(n,1),s=null}}}function h(e){if(!V(e))throw new Error(B(7));if(void 0===e.type)throw new Error(B(8));if(c)throw new Error(B(9));try{c=!0,i=o(i,e)}finally{c=!1}for(var t=s=a,n=0;n<t.length;n++)(0,t[n])();return e}function f(e){if("function"!=typeof e)throw new Error(B(10));o=e,h({type:q.REPLACE})}function d(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(B(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[F]=function(){return this},e}return h({type:q.INIT}),(r={dispatch:h,subscribe:p,getState:u,replaceReducer:f})[F]=d,r}function G(){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))}}))}let K=G;function Y({reducers:e={},initialState:t={},middlewares:n=[]}={}){return W(function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var i,s=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:q.INIT}))throw new Error(B(12));if(void 0===n(void 0,{type:q.PROBE_UNKNOWN_ACTION()}))throw new Error(B(13))}))}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},a=0;a<s.length;a++){var c=s[a],l=n[c],u=e[c],p=l(u,t);if(void 0===p)throw t&&t.type,new Error(B(14));o[c]=p,r=r||p!==u}return(r=r||s.length!==Object.keys(e).length)?o:e}}(e),t,K(function(){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(B(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=G.apply(void 0,i)(n.dispatch),z(z({},n),{},{dispatch:r})}}}(...n)))}function J(){return(0,i.useContext)(N)}function Q(){return J().dispatch}function Z(e,t=[]){const n=J(),[,r]=(0,i.useReducer)((e=>e+1),0),o=(0,i.useRef)(),s=(0,i.useCallback)(e,t),a=(0,i.useRef)(),c=(0,i.useRef)(),l=n.getState();return a.current===s&&c.current===l||(c.current=l,o.current=s(c.current),a.current=s),(0,i.useLayoutEffect)((()=>n.subscribe((()=>{var e;if(n.getState()===c.current)return;const t=null===(e=a.current)||void 0===e?void 0:e.call(a,n.getState());t!==o.current&&(o.current=t,r())}))),[n]),o.current}const X=function(e,t,n=[]){return Z((0,i.useCallback)((n=>e(n,t)),n),n)};function ee(){return Z(A)}function te(){const{startChatIcon:e}=Z(A);return e}const ne="cvco",re="2",oe="seamly-client-participant";function ie(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 se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(n),!0).forEach((function(t){ae(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ce=(e,t)=>{let n;return function(...r){const o=this;let i=!1;return clearTimeout(n),n=setTimeout((()=>{n=null,i||e.apply(o,r),i=!1}),t),t=>{i=!0,t&&e.apply(o,r)}}},le=e=>Math.ceil(e/1e3),ue=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},pe=(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/Math.pow(1024,r)).toFixed(n))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]},he=()=>{const{search:e}=window.location;return e?e.slice(e.indexOf("?")+1).split("&").reduce(((e,t)=>{const[n,r]=t.split("=");return se(se({},e),{},{[n]:decodeURIComponent(r)})}),{}):{}},fe=e=>Object.keys(e).reduce(((t,n)=>`${t}${t?"&":""}${n}=${encodeURIComponent(e[n])}`),""),de={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},ye={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},be=e=>e.code?ye[e.code]:de[e.keyCode],ge=e=>{e&&e.focus()},me=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};function ve(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 Oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(n),!0).forEach((function(t){we(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function we(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const je={info:"info",message:"message",participant:"participant",system:"system"},xe="text",_e="text",Ee="upload",Se="received",Te="read",ke="custom",Pe="typing",Ce="read",Ae="detach_service",Ie="set_translation",Ne="click_cta",De="assertive",Re="polite",Le={new_topic:"newTopic",new_translation:"newTranslation"},Ue="uploads",Me={ADD_EVENT:"ADD_EVENT",CLEAR_EVENTS:"CLEAR_EVENTS",SET_HISTORY:"SET_HISTORY",SET_EVENTS_READ:"SET_EVENTS_READ",ACK_EVENT:"ACK_EVENT",SET_IS_LOADING:"SET_IS_LOADING",CLEAR_PARTICIPANTS:"CLEAR_PARTICIPANTS",SET_PARTICIPANT:"SET_PARTICIPANT",SET_HEADER_TITLE:"SET_HEADER_TITLE",SET_HEADER_SUB_TITLE:"SET_HEADER_SUB_TITLE",RESET_HISTORY_LOADED_FLAG:"RESET_HISTORY_LOADED_FLAG",SET_ACTIVE_SERVICE:"SET_ACTIVE_SERVICE",INIT_IDLE_DETACH_COUNTDOWN:"INIT_IDLE_DETACH_COUNTDOWN",DECREMENT_IDLE_DETACH_COUNTDOWN_COUNTER:"DECREMENT_IDLE_DETACH_COUNTDOWN_COUNTER",STOP_IDLE_DETACH_COUNTDOWN_COUNTER:"STOP_IDLE_DETACH_COUNTDOWN_COUNTER",CLEAR_IDLE_DETACH_COUNTDOWN:"CLEAR_IDLE_DETACH_COUNTDOWN",INIT_RESUME_CONVERSATION_PROMPT:"INIT_RESUME_CONVERSATION_PROMPT",CLEAR_RESUME_CONVERSATION_PROMPT:"CLEAR_RESUME_CONVERSATION_PROMPT",SET_SERVICE_DATA_ITEM:"SET_SERVICE_DATA_ITEM",SET_FEATURES:"SET_FEATURES",SET_FEATURE_ENABLED_STATE:"SET_FEATURE_ENABLED_STATE",CLEAR_FEATURES:"CLEAR_FEATURES",SET_INITIAL_STATE:"SET_INITIAL_STATE",SET_USER_SELECTED_OPTIONS:"SET_USER_SELECTED_OPTIONS",SET_USER_SELECTED_OPTION:"SET_USER_SELECTED_OPTION",SHOW_OPTION:"SHOW_OPTION",HIDE_OPTION:"HIDE_OPTION",SET_SERVICE_ENTRY_METADATA:"SET_SERVICE_ENTRY_METADATA",SET_BLOCK_AUTO_ENTRY_SWITCH:"SET_BLOCK_AUTO_ENTRY_SWITCH",SET_ACTIVE_ENTRY_TYPE:"SET_ACTIVE_ENTRY_TYPE",SET_USER_ENTRY_TYPE:"SET_USER_ENTRY_TYPE",REGISTER_UPLOAD:"REGISTER_UPLOAD",SET_UPLOAD_PROGRESS:"SET_UPLOAD_PROGRESS",SET_UPLOAD_COMPLETE:"SET_UPLOAD_COMPLETE",SET_UPLOAD_ERROR:"SET_UPLOAD_ERROR",CLEAR_UPLOAD:"CLEAR_UPLOAD",CLEAR_ALL_UPLOADS:"CLEAR_ALL_UPLOADS",SET_SEAMLY_CONTAINER_ELEMENT:"SET_SEAMLY_CONTAINER_ELEMENT"},$e="navigate",{ADD_EVENT:ze,CLEAR_EVENTS:Be,SET_HISTORY:Fe,SET_EVENTS_READ:He,ACK_EVENT:qe,SET_IS_LOADING:Ve,CLEAR_PARTICIPANTS:We,SET_PARTICIPANT:Ge,SET_HEADER_TITLE:Ke,SET_HEADER_SUB_TITLE:Ye,RESET_HISTORY_LOADED_FLAG:Je,SET_ACTIVE_SERVICE:Qe,INIT_IDLE_DETACH_COUNTDOWN:Ze,DECREMENT_IDLE_DETACH_COUNTDOWN_COUNTER:Xe,STOP_IDLE_DETACH_COUNTDOWN_COUNTER:et,CLEAR_IDLE_DETACH_COUNTDOWN:tt,INIT_RESUME_CONVERSATION_PROMPT:nt,CLEAR_RESUME_CONVERSATION_PROMPT:rt,SET_SERVICE_DATA_ITEM:ot,SET_FEATURES:it,SET_FEATURE_ENABLED_STATE:st,CLEAR_FEATURES:at,SET_INITIAL_STATE:ct,SET_USER_SELECTED_OPTION:lt,SET_USER_SELECTED_OPTIONS:ut,SHOW_OPTION:pt,HIDE_OPTION:ht,SET_BLOCK_AUTO_ENTRY_SWITCH:ft,SET_USER_ENTRY_TYPE:dt,SET_ACTIVE_ENTRY_TYPE:yt,SET_SERVICE_ENTRY_METADATA:bt,REGISTER_UPLOAD:gt,SET_UPLOAD_PROGRESS:mt,SET_UPLOAD_COMPLETE:vt,SET_UPLOAD_ERROR:Ot,CLEAR_UPLOAD:wt,CLEAR_ALL_UPLOADS:jt,SET_SEAMLY_CONTAINER_ELEMENT:xt}=Me,_t=({type:e,payload:t})=>e===je.message&&!t.fromClient||e===je.info&&t.type===xe,Et=e=>e.sort((({payload:{occurredAt:e}},{payload:{occurredAt:t}})=>e-t)),St=(e,t)=>{switch(t.type){case We:return{participants:{},currentAgent:""};case Ge:if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:o,name:i,introduction:s}=t.participant,a=n[r],c=Oe(Oe({},n),{},{[r]:a?Oe(Oe(Oe(Oe({},a),o?{avatar:o}:{}),i?{name:i}:{}),s?{introduction:s}:{}):t.participant});return Oe(Oe({},e),{},{participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r});default:return e}},Tt=(e,t)=>{switch(t.type){case Ke:return Oe(Oe({},e),{},{title:t.title});case Ye:return Oe(Oe({},e),{},{subTitle:t.title});default:return e}},kt=(e,t)=>{const{entry:n}=t,{blockAutoEntrySwitch:r}=e;if(!n)return Oe(Oe({},e),{},{optionsOverride:{}});const{type:o,options:i}=n;let s=e.active;return r||o===e.userSelected||(s=o),Oe(Oe({},e),{},{active:s,optionsOverride:Oe(Oe({},e.optionsOverride),{},{[o]:i||{}})})},{createAction:Pt,createThunk:Ct,createReducer:At,selectState:It}=d("i18n"),Nt=E(It,(e=>e.translations)),Dt=E(It,(e=>e.initialLocale)),Rt=E(It,(e=>e.locale)),Lt=Pt("setInitialLocale",(e=>({locale:e}))),Ut=function(){let e=!1;const t=[],n=async()=>{if(!e)for(;t.length;){const n=t.shift();e=!0,await n().catch((()=>{})),e=!1}};return{next:n,runExclusively:async e=>{const r=new Promise(((n,r)=>{t.push((async()=>{try{n(await e())}catch(e){r(e)}}))}));return n(),r}}}(),Mt=Ct("setLocale",(async(e,{getState:t,extra:{api:n}})=>Ut.runExclusively((()=>{if(e!==Rt(t()))return n.getTranslations(e)})))),{createActions:$t,createReducer:zt,selectState:Bt}=d("translations"),[Ft,Ht]=$t("translate",{enable:e=>({locale:e}),disable:()=>({})}),[qt,Vt]=$t("event",{enable:e=>({payloadId:e}),disable:e=>({payloadId:e})}),{createAction:Wt,createThunk:Gt,createReducer:Kt,selectState:Yt}=d("app"),Jt=E(Yt,(e=>e.userHasResponded)),{createAction:Qt,createActions:Zt,createThunk:Xt,createReducer:en,selectState:tn}=d("visibility"),nn=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:o,layoutMode:i,hideOnNoUserResponse:s}=r,{visible:a}=o||{};if("window"===i&&s&&n!==T.open)return e?n||t||T.open:T.hidden;if("inline"===i&&e&&!n)return t||T.open;const c=T.minimized;return n||t||a||c},rn=E(tn,(e=>e.visibility));function on(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?on(Object(n),!0).forEach((function(t){an(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):on(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function an(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const cn=e=>e.state,ln=()=>Z(cn),un=E(cn,A,Jt,(({events:e,serviceData:t},n,r)=>{var o;if(r||"inline"===n.layoutMode||!t.suggestion||null===(o=t.suggestion)||void 0===o||!o.body.length)return e;const i={type:"service_data",payload:t.suggestion};return[...e,i]})),pn=E(un,A,((e,t)=>{var n;const{enabled:r,threshold:o}=(null==t||null===(n=t.messages)||void 0===n?void 0:n.timeIndicator)??{};if(!r)return e;const i=[];let s=null;return e.forEach(((e,t)=>{if(0===t)i.push(sn(sn({},e),{},{timeIndicator:e.payload.occurredAt}));else{const t=s&&le(e.payload.occurredAt-s.payload.occurredAt)>=o?e.payload.occurredAt:void 0;i.push(sn(sn({},e),{},{timeIndicator:t}))}s=e})),i})),hn=()=>Z(pn,[]),fn=()=>ln().headerTitles,dn=()=>ln().unreadEvents,yn=()=>ln().skiplinkTargetId,bn=E(pn,(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})),gn=()=>{const{participants:e,currentAgent:t}=ln().participantInfo;return t?e[t]:null},mn=e=>ln().serviceData[e],vn=()=>{const{layoutMode:e}=ee();return{isInline:"inline"===e,isWindow:"window"===e,isResolving:!e}};function On(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?On(Object(n),!0).forEach((function(t){jn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):On(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xn=Qt("setFromStorage",(e=>({visibility:e}))),_n=[T.open,T.minimized,T.hidden],En=Xt("set",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),i=rn(o),s=Jt(o),a=n.hasConversation(),c=A(o),{visibilityCallback:l=nn,layoutMode:u}=c,{unreadEvents:p}=cn(o),h=l({hasConversation:a,hasResponded:s,previousVisibility:i,requestedVisibility:e,config:c});if(_n.includes(h)){if(i!==h)return n.store.set(S,wn(wn({},n.store.get(S)||{}),{},{[u]:e})),e&&r.emit("ui.visible",e,{visibility:e,hasConversation:a,hasResponded:s,unreadMessageCount:p}),h}else console.error('The visibilityCallback function should return "open", "minimized" or "hidden".')})),Sn=Xt("initialize",(async(e,{dispatch:t,getState:n,extra:{api:r}})=>{var o;const{layoutMode:i}=A(n()),s=null===(o=r.store.get(S))||void 0===o?void 0:o[i];s&&t(xn(s)),t(En(T.initialize))}));class Tn extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,Tn),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}class kn extends Error{constructor(e,...t){super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Object.getPrototypeOf(this)),this.originalError=e,null!=e&&e.payload&&(this.originalEvent=e,this.originalError=e.payload.error,this.message=`Event of type ${e.payload.type} encountered`),null!=e&&e.error&&(this.originalError=e.error)}}class Pn extends kn{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}const{createAction:Cn,createReducer:An,selectState:In}=d("interrupt"),Nn=Cn("set",(e=>({error:e}))),Dn=Cn("clear"),Rn=Wt("setHasResponded",(e=>({hasResponded:e}))),Ln=Gt("initialize",(async(e,{dispatch:t,extra:{api:n,config:r}})=>{var o;t(v(r));let i=null==r||null===(o=r.context)||void 0===o?void 0:o.locale;try{const{features:e,defaultLocale:r,preChat:o,agentParticipant:s,userParticipant:a,startChatIcon:c}=await n.getConfig();t({type:Me.SET_FEATURES,features:e}),i=i||r,t(Lt(i)),t(w(o.map((e=>({type:"message",payload:e}))))),t(O({agentParticipant:s,userParticipant:a,startChatIcon:c})),null!=s&&s.name&&t({type:Me.SET_HEADER_SUB_TITLE,title:s.name})}catch(e){throw new Tn}try{var s;if(n.hasConversation()){var a;const e=await n.getConversationIntitialState();t({type:Me.SET_INITIAL_STATE,initialState:e}),i=(null===(a=e.translation)||void 0===a?void 0:a.locale)||i,"userResponded"in e&&t(Rn(e.userResponded))}else null!=r&&null!==(s=r.context)&&void 0!==s&&s.translationLocale&&(i=r.context.translationLocale,n.send("action",{type:Ie,body:{enabled:!0,locale:i}}),t(Ft(i)))}catch(e){if(e instanceof Pn)throw e;throw new Tn}finally{await t(Mt(i)),t(Sn())}})),Un=Gt("reset",(async(e,{dispatch:t,extra:{api:n}})=>{try{await n.disconnect(),await n.clearStore(),t(Ln())}catch(e){t(Nn(e))}})),Mn=["messages"];function $n(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 zn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$n(Object(n),!0).forEach((function(t){Bn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$n(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fn=zn(zn({},{namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}}}),{},{hideOnNoUserResponse:!1,showDisclaimer:!1,showFaq:!1,customComponents:{},defaults:{},preChatEvents:[]}),Hn=["hideOnNoUserResponse","showDisclaimer","showFaq","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon"],qn=(e,{config:t})=>{const n=(i=t,Hn.reduce(((e,t)=>(t in i&&(e[t]=i[t]),e)),{})),{messages:r}=n,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}(n,Mn);var i;let s=e;return Object.keys(o).length>0&&(s=zn(zn({},s),o)),r&&(s=zn(zn({},s),{},{messages:zn(zn({},s.messages),r)})),s},Vn=g({[v]:(e,t)=>qn(e,t),[O]:(e,t)=>qn(e,t),[Ln.pending]:()=>Fn,[w]:(e,{events:t})=>zn(zn({},e),{},{preChatEvents:t})},Fn),Wn=(...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(ne)>-1?e:[ne,e].join("-"))).join(" "),Gn=(0,e.createContext)(null),Kn=(0,e.createContext)(""),Yn=()=>(0,i.useContext)(Gn),Jn=()=>Yn().store||{},Qn=()=>{const{get:e}=Jn();return e?e("conversationUrl"):null},Zn=()=>!!Qn(),Xn=Q,er=()=>ee().appContainerClassNames,tr=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};function nr(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 rr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nr(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)?nr(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 or(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ir(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 sr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ar(e){return e.reduce((function(e,t){return e.concat(Array.isArray(t)?ar(t):t)}),[])}function cr(e){var t={};return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=r.length?r.map((function(e){return null===e?"null":void 0===e?"undefined":"function"==typeof e?e.toString():e instanceof Date?e.toISOString():JSON.stringify(e)})).join("|"):"_(no-args)_";if(Object.prototype.hasOwnProperty.call(t,i))return t[i];var s=e.apply(void 0,r);return t[i]=s,s}}function lr(e){for(var t=function(e){return/\s/.test(e)},n=[],r={},o=0,i=null,s=!1,a=0;a<e.length;){if(s&&(t(e[a])||"{"===e[a]))s=!1,i=e.slice(o,a),"{"===e[a]&&a--;else if(!s&&!t(e[a])){var c="{"===e[a];if(i&&c){var l=ur(e,a);if(-1===l)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));r[i]=e.slice(a+1,l),a=l,i=null}else i&&(n.push(i),i=null),s=!0,o=a}a++}return s&&(i=e.slice(o)),i&&n.push(i),{args:n,cases:r}}function ur(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 pr(e){return hr(e.slice(1,-1),",",3)}function hr(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!e)return r;if(1===n)return r.push(e),r;var o=e.indexOf(t);if(-1===o)return r.push(e),r;var i=e.substring(0,o).trim(),s=e.substring(o+t.length+1).trim();return r.push(i),hr(s,t,n-1,r)}var fr;function dr(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 yr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dr(Object(n),!0).forEach((function(t){sr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var br=0,gr="other";function mr(e,t){for(var n=0,r="",o=0,i={};n<e.length;){if("#"!==e[n]||o)r+=e[n];else{var s="__hashToken".concat(br++);r+="{".concat(s,", number}"),i[s]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:i}}var vr="other";const Or=new(function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};or(this,e),sr(this,"format",cr((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ar(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=ur(e,n);if(-1===r)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));var o=e.substring(n,r+1);if(o){var i=[],s=e.substring(0,n);s&&i.push(s);var a=pr(o),c=rr(a,3),l=c[0],u=c[1],p=c[2],h=t[l];null==h&&(h="");var f=u&&this.typeHandlers[u];i.push(f?f(h,p,this.locale,t,this.process.bind(this)):h);var d=e.substring(r+1);return d&&i.push(this.process(d,t)),i}}return[e]}}])&&ir(t.prototype,n),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=lr(t),s=i.args,a=i.cases,c=parseInt(e);s.forEach((function(e){e.startsWith("offset:")&&(c-=parseInt(e.slice("offset:".length)))}));var l=[];if("PluralRules"in Intl){void 0!==fr&&fr.resolvedOptions().locale===n||(fr=new Intl.PluralRules(n));var u=fr.select(c);u!==gr&&l.push(u)}1===c&&l.push("one"),l.push("=".concat(c),gr);for(var p=0;p<l.length;p++){var h=l[p];if(h in a){var f=mr(a[h],c),d=f.caseBody,y=f.numberValues;return o(d,yr(yr({},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=lr(t),i=o.cases;return e in i?r(i[e],n):vr in i?r(i.other,n):e}});function wr(){const e=Z(Nt),t=Z(Rt),n=Z(Dt);return{t:(0,i.useCallback)(((n,r={})=>{const o=e[n];return o?Or.format(o,r):(console.warn(`Translation key: ${n} is missing in locale: ${t}`),null)}),[e,t]),locale:t,initialLocale:n}}function jr(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 xr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jr(Object(n),!0).forEach((function(t){_r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Er={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},Sr=At({[Lt]:(e,{locale:t})=>xr(xr({},e),{},{initialLocale:t}),[Mt.pending]:e=>xr(xr({},e),{},{isLoading:!0}),[Mt.fulfilled]:(e,{payload:t,meta:{arg:n}})=>xr(xr({},e),{},t?{isLoading:!1,locale:n,translations:Object.keys(t).sort().reduce(((e,n)=>xr(xr({},e),{},{[n]:t[n]})),{})}:{isLoading:!1}),[Mt.rejected]:e=>xr(xr({},e),{},{isLoading:!1}),[Ln.pending]:()=>Er},Er),{SET_SEAMLY_CONTAINER_ELEMENT:Tr}=Me,kr=e=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{const t="string"==typeof e?document.getElementById(e):e;ge(t)}))}))},Pr=()=>{const{seamlyContainerElement:e}=ln(),t=Xn();return[e,(0,i.useCallback)((e=>{t({type:Tr,element:e})}),[t])]},Cr=e=>(0,i.useCallback)((()=>{kr(e)}),[e]),Ar=()=>{const e=yn();return Cr(e)};function Ir(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 Nr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ir(Object(n),!0).forEach((function(t){Dr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ir(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Dr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{SET_USER_SELECTED_OPTION:Rr,SET_USER_SELECTED_OPTIONS:Lr,SHOW_OPTION:Ur,HIDE_OPTION:Mr}=Me,$r=()=>{const{t:e}=wr(),{options:t}=ln(),{panelActive:n,optionActive:r,userSelectedOptions:o,features:s}=t,{cobrowsing:a,sendTranscript:c}=s,l={cobrowsing:a,sendTranscript:c},u=Object.keys(l).filter((e=>l[e])).map((t=>({name:t,title:e(`options.${t}.menuTitle`),available:l[t].enabled}))),p=a||c,h=Xn(),{get:f,set:d}=Jn();return{allowOptionSelection:p,userSelectedOptions:o,features:s,menuOptions:u,initUserSelectedOptions:(0,i.useCallback)((()=>{const e=f("options")||{};h({type:Lr,options:e})}),[f,h]),setUserSelectedOptions:(0,i.useCallback)((e=>{h({type:Lr,options:e}),d("options",e)}),[d,h]),setUserSelectedOption:(0,i.useCallback)(((e,t)=>{const n=f("options")||{};d("options",Nr(Nr({},n),{},{[e]:t})),h({type:Rr,option:e,value:t})}),[h,f,d]),showOption:e=>{h({type:Ur,optionName:e})},hideOption:()=>{h({type:Mr})},panelActive:n,optionActive:r}},zr=()=>{const{optionsButtonId:e}=ln();return{id:e,focusButton:Cr(e)}},Br=(0,e.createContext)({});function Fr(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 Hr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fr(Object(n),!0).forEach((function(t){qr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{CLEAR_ALL_UPLOADS:Vr}=Me,Wr=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=ln(),{allowedMimeTypes:o,maxSize:i}=n.upload||{},{enabled:s,enabledFromEntry:a}=r||{},{allowedMimeTypes:c,maxSize:l}=Hr(Hr(Hr({},t.upload||{allowedMimeTypes:[],maxSize:0}),o?{allowedMimeTypes:o}:{}),i?{maxSize:i}:{});return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:a||s,allowedMimeTypes:c,maxSize:l}},Gr=()=>{const{currentUploads:e}=ln(),t=Xn(),n=(0,i.useContext)(Br);return{uploadFile:(0,i.useCallback)((e=>{n(e)}),[n]),clearUploads:(0,i.useCallback)((()=>{t({type:Vr})}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}},Kr=()=>{const[e]=(0,i.useState)((()=>s()));return e},Yr=e=>{const t=(0,i.useRef)();t.current=e;const n="function"==typeof e;return(0,i.useMemo)((()=>n?(...e)=>t.current(...e):void 0),[n])},Jr=E(In,(({error:e})=>e));function Qr(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 Zr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qr(Object(n),!0).forEach((function(t){Xr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Xr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eo(){const{t:e}=wr(),t=Z(Jr);return{hasInterrupt:Boolean(t),meta:(0,i.useMemo)((()=>{if(!t)return{};const{langKey:n,action:r}=t,o=e(`${n}.title`),i=e(`${n}.message`),s=e(`${n}.srText`),a=e(`${n}.buttonText`);return Zr(Zr(Zr(Zr({},n?{title:o,message:i,srText:s}:{}),r?{action:r}:{}),r&&n?{buttonText:a}:{}),{},{originalError:t})}),[e,t]),error:t}}class to extends kn{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class no extends kn{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class ro extends kn{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}class oo extends kn{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}const io=[to,no,Pn,ro,oo,Tn];function so({api:e}){return()=>t=>n=>{const{error:r}=n;if(r){if(!io.some((e=>r instanceof e)))throw r;"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}function ao(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 co(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ao(Object(n),!0).forEach((function(t){lo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ao(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const uo={error:void 0},po=(e,{error:t})=>co(co({},e),{},{error:t}),ho=An({[Nn]:po,[Ln.rejected]:po,[Dn]:()=>uo,[Ln.pending]:()=>uo},uo);function fo(){return Z(Jt)}const yo=()=>{const e=Q(),t=Z(rn);return{isVisible:!!t&&t!==T.hidden,isOpen:t===T.open,isMinimized:t===T.minimized,visible:t,setVisibility:(0,i.useCallback)((t=>e(En(t))),[e])}};function bo(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 go(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bo(Object(n),!0).forEach((function(t){mo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const vo={visibility:T.initialize},Oo=en({[xn]:(e,{visibility:t})=>go(go({},e),{},{visibility:t}),[En.fulfilled]:(e,{payload:t})=>t?go(go({},e),{},{visibility:t}):e},vo);function wo(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 jo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wo(Object(n),!0).forEach((function(t){xo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{ADD_EVENT:_o,SET_INITIAL_STATE:Eo}=Me,So=()=>{const e=Yn(),t=ee(),n=Xn(),r=(0,i.useContext)(Kn),o=fo(),a=Zn(),{visible:c}=yo(),l=dn(),u=(0,i.useCallback)(((...e)=>{r.emit(...e)}),[r]),p=Yr((()=>{e.sendContext(t.context||{}),u("ui.beforeStart",{visibility:c,hasConversation:a,hasResponded:o,unreadMessageCount:l}),e.send("start"),u("ui.start",{visibility:c,hasConversation:a,hasResponded:o,unreadMessageCount:l})})),h=(0,i.useCallback)((async()=>{n(Un())}),[n]),f=(0,i.useCallback)((e=>({type:e,id:s(),transactionId:s(),participant:oe,fromClient:!0,occurredAt:1e3*Date.now(),meta:{}})),[]),d=(0,i.useCallback)((e=>jo(jo({},f("text")),{},{body:{text:e}})),[f]),y=(0,i.useCallback)((({body:t,config:r={}})=>{if(""===t.trim())return;const o=jo(jo({},d(t)),r);e.send("message",o),u("message",o),n({type:_o,event:{type:"message",payload:o}})}),[e,n,u,d]),b=(0,i.useCallback)((e=>{n({type:_o,event:{type:"message",payload:d(e)}})}),[n,d]),g=(0,i.useCallback)(((e,t,r,o,i,s,a)=>{n({type:_o,event:{type:"message",payload:{type:"upload",id:e,transactionId:t,participant:oe,fromClient:!0,occurredAt:r,meta:{},body:{contentType:o,filename:i,filesize:s,url:a}}}})}),[n]),m=(0,i.useCallback)((e=>{const t={body:{subtype:e,type:"divider"},fromClient:!1,fromHistory:!0,id:s(),transactionId:s(),type:"divider"};n({type:_o,event:{type:"info",payload:t}})}),[n]),v=(0,i.useCallback)((({type:t,subtype:n})=>{const r={type:t,subtype:n,id:s(),transactionId:s(),participant:oe,fromClient:!0};e.send("info",r)}),[e]),O=(0,i.useCallback)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==Pe&&n!==Ce&&u(`action.${n}`,t)}),[e,u]),w=(0,i.useCallback)((t=>{e.sendContext(t)}),[e]);return{connect:(0,i.useCallback)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&n({type:Eo,initialState:e})})).catch((e=>{n(Nn(e))}))),[e,n]),start:p,sendMessage:y,sendInfo:v,sendAction:O,sendContext:w,reset:h,emitEvent:u,addMessageBubble:b,addUploadBubble:g,addDivider:m,apiConfigReady:e.configReady}},To=(0,e.createContext)(null),ko=()=>{const e=(0,i.useContext)(To);return{sendPolite:(0,i.useCallback)((t=>{e({ariaLive:Re,messageText:t})}),[e]),sendAssertive:(0,i.useCallback)((t=>{e({ariaLive:De,messageText:t})}),[e])}},Po=(0,e.createContext)(null),Co=()=>(0,i.useContext)(Po);function Ao(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 Io(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{SET_BLOCK_AUTO_ENTRY_SWITCH:No,SET_ACTIVE_ENTRY_TYPE:Do,SET_USER_ENTRY_TYPE:Ro}=Me,Lo=()=>{const{default:e,active:t,userSelected:n,options:r}=ln().entryMeta,o=Xn(),s=n||t||e,a=r[s]||{},c=(0,i.useCallback)((e=>{o({type:No,value:e})}),[o]),l=(0,i.useCallback)((e=>{o({type:Do,entryType:e})}),[o]),u=(0,i.useCallback)((e=>{o({type:Ro,entryType:e})}),[o]),p=(0,i.useCallback)((()=>{n?u(null):l(e)}),[n,e,u,l]);return{activeEntry:s,activeEntryOptions:a,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:p,setBlockAutoEntrySwitch:c}},{SET_IS_LOADING:Uo}=Me,Mo=()=>{const{t:e}=wr(),{layoutMode:t}=ee(),{isOpen:n,isVisible:r,setVisibility:o}=yo(),s=Xn(),a=hn(),c=(0,i.useRef)(null),{start:l,connect:u,apiConfigReady:p}=So(),h=Zn(),f=(0,i.useRef)(null),d=(0,i.useRef)(null),{sendAssertive:y}=ko(),b=(0,i.useRef)(!1),g=a.length>0;return(0,i.useEffect)((()=>{r&&setTimeout((()=>{y(e("window.srTexts.onLoad"))}),500)}),[r,y,e]),(0,i.useEffect)((()=>{if(r!==d.current)return f.current=n,void(d.current=r);null!==f.current&&y(e(n?"window.srTexts.onOpen":"window.srTexts.onClose")),f.current=n,d.current=r}),[n,r,y,e]),(0,i.useEffect)((()=>{c.current=setTimeout((()=>{s({type:Uo,isLoading:!0})}),500)}),[s]),(0,i.useEffect)((()=>{g&&(clearTimeout(c.current),s({type:Uo,isLoading:!1}))}),[g,s]),(0,i.useEffect)((()=>{h&&p||(b.current=!1)}),[h,p]),(0,i.useEffect)((()=>{("window"!==t||n||h)&&!b.current&&p&&(h&&(clearTimeout(c.current),s({type:Uo,isLoading:!1})),u().then((()=>{l()})),b.current=!0)}),[n,h,p,l,u,s,t]),{openChat:()=>{o(T.open)},closeChat:()=>{o(T.minimized)}}};function $o(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 zo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$o(Object(n),!0).forEach((function(t){Bo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{CLEAR_IDLE_DETACH_COUNTDOWN:Fo,INIT_IDLE_DETACH_COUNTDOWN:Ho,DECREMENT_IDLE_DETACH_COUNTDOWN_COUNTER:qo,STOP_IDLE_DETACH_COUNTDOWN_COUNTER:Vo}=Me,Wo=()=>{const e=Xn(),{idleDetachCountdown:t}=ln(),{isOpen:n}=yo(),r=(0,i.useRef)({});r.current={hasCountdown:t.hasCountdown,isActive:t.isActive,remaining:t.remaining,wasStopped:t.wasStopped,isOpen:n};const{emitEvent:o,sendAction:s}=So(),{t:a}=wr(),{sendAssertive:c,sendPolite:l}=ko(),u=(0,i.useCallback)((e=>{const{isOpen:t}=r.current;t&&c(e)}),[c]),p=(0,i.useCallback)((e=>{const{isOpen:t}=r.current;t&&l(e)}),[l]),h=(0,i.useCallback)((t=>{const n=(e=>Math.ceil(e/1e3))(t),r=ue(n);e({type:Ho,delaySeconds:n,delayTime:r}),o("idleTimer.start"),u(`${a("idleDetachWarning.countdownTitle")} ${a("idleDetachWarning.countdownText")} ${a("idleDetachWarning.countdownTimer",r)}`)}),[e,o,u,a]),f=(0,i.useCallback)(((t,n)=>{const{hasCountdown:i,wasStopped:c}=r.current;i&&(t||(n||s({type:Ae}),u(a("idleDetachWarning.notifyTransferText"))),c||o("idleTimer.stop"),e({type:Fo}))}),[e,s,o,u,a]),d=(0,i.useCallback)((()=>{const{remaining:t}=r.current;if(t<=0)return;const n=t-1;n%10==0&&u(`${a("idleDetachWarning.countdownText")} ${a("idleDetachWarning.countdownTimer",ue(n))}`),e({type:qo})}),[e,u,a]),y=(0,i.useCallback)((()=>{const{isActive:t,remaining:n}=r.current;t&&(e({type:Vo}),n&&(o("idleTimer.stop"),p(a("idleDetachWarning.srCountDownStoppedText"))))}),[e,o,p,a]);return zo(zo({},t),{},{initCountdown:h,endCountdown:f,decrementCountdown:d,stopCountdown:y})},{CLEAR_RESUME_CONVERSATION_PROMPT:Go}=Me,Ko=()=>{const e=Xn(),t=ln().resumeConversationPrompt,{sendAction:n}=So(),{t:r}=wr(),{sendAssertive:o}=ko();return{continueChat:()=>{n({type:"dismiss",body:{type:"resume_conversation_prompt"}}),e({type:Go})},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:Ae}),e({type:Go})}}},Yo=(e,t)=>{const n=Yn();(0,i.useEffect)((()=>{n.stream&&(t?n.stream().filter(t).subscribe({next:e}):n.stream().subscribe({next:e}))}),[n,e,t])};function Jo(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 Qo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jo(Object(n),!0).forEach((function(t){Zo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xo=Kt({[Rn]:(e,{hasResponded:t})=>Qo(Qo({},e),{},{userHasResponded:t})},{userHasResponded:!1}),ei=(e,t)=>(n,r)=>r[e]||t,ti=Bt,ni=E(ti,(e=>e.originalPayloadIds)),ri=E(ni,ei("payloadId"),((e,t)=>!e.includes(t)));function oi(){const{sendAction:e}=So(),t=Q(),n=Yr((n=>{e({type:Ie,body:{enabled:!0,locale:n}}),t(Ft(n))})),r=Yr((()=>{e({type:Ie,body:{enabled:!1}}),t(Ht())})),{languages:o,isActive:i,isAvailable:s,currentLocale:a}=Z(ti,[]);return{languages:o,isActive:i,isAvailable:s,currentLocale:a,enableTranslations:n,disableTranslations:r}}function ii({payload:e}={}){var t,n,r;const o=null==e?void 0:e.id;let i,s;switch(null==e?void 0:e.type){case"participant":i=e.participant.introduction,s=e.participant.translatedIntroduction;break;default:i=null==e?void 0:e.body,s=null==e?void 0:e.translatedBody}const a=!!s,c=X(ri,{payloadId:o},[o]),l=Q(),u=Yr((()=>{l(c?Vt(o):qt(o))}));return[a&&c?null===(t=s)||void 0===t?void 0:t.data:i,{hasTranslation:a,isTranslated:c&&a,toggleTranslation:u,translatedBy:null===(n=s)||void 0===n?void 0:n.translatedBy,locale:null===(r=s)||void 0===r?void 0:r.locale}]}function si(){const e=Z(ti,[]).containerId;return{id:e,focusContainer:Cr(e)}}function ai(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 ci(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ai(Object(n),!0).forEach((function(t){li(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ai(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function li(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ui={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],originalPayloadIds:[],containerId:s()},pi=zt({[Me.SET_FEATURES]:(e,t)=>{var n;const r=null==t||null===(n=t.features)||void 0===n?void 0:n.translation;return r?ci(ci({},e),{},{isAvailable:!0===r.enabled,languages:r.languages||[]}):e},[Me.CLEAR_FEATURES]:()=>ui,[Ft]:(e,{locale:t})=>ci(ci({},e),{},{isActive:!0,currentLocale:t}),[Ht]:e=>ci(ci({},e),{},{isActive:!1,currentLocale:void 0}),[qt]:(e,{payloadId:t})=>e.originalPayloadIds.includes(t)?ci(ci({},e),{},{originalPayloadIds:e.originalPayloadIds.filter((e=>e!==t))}):e,[Vt]:(e,{payloadId:t})=>e.originalPayloadIds.includes(t)?e:ci(ci({},e),{},{originalPayloadIds:[...e.originalPayloadIds,t]}),[Ln.pending]:()=>ui},ui),hi={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 xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#003A5D" d="M0,4.717C0,2.112,2.112,0,4.717,0h22.566C29.888,0,32,2.112,32,4.717v22.566C32,29.887,29.888,32,27.283,32 H4.717C2.113,32,0,29.887,0,27.283V4.717z"/><path fill="#FFF" d="M10.103,14.901c-1.107,0-2.004-0.897-2.004-2.004s0.897-2.005,2.004-2.005c1.107,0,2.005,0.897,2.005,2.005 C12.108,14.004,11.211,14.901,10.103,14.901z M16,14.901c1.107,0,2.005-0.897,2.005-2.004S17.108,10.892,16,10.892 c-1.108,0-2.005,0.897-2.005,2.005C13.995,14.004,14.892,14.901,16,14.901z M21.896,10.892c-1.106,0-2.004,0.897-2.004,2.005 c0,1.107,0.896,2.004,2.004,2.004c1.109,0,2.005-0.897,2.005-2.004C23.901,11.789,23.005,10.892,21.896,10.892z M21.408,18.207 H10.783C11.83,23.973,20.361,23.973,21.408,18.207z"/></svg>',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'},fi=({name:e,size:t="32",className:n,alt:r})=>{const o=`${e}${t}`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{"aria-hidden":"true",className:n||Wn("icon"),dangerouslySetInnerHTML:{__html:hi[o]}}),r&&(0,L.jsx)("span",{className:Wn("visually-hidden"),children:r})]})},di={visible:Wn("transition--visible"),in:Wn("transition--in"),visuallyHidden:Wn("visually-hidden")},yi=Object.values(di),bi="notRendered",gi="rendered",mi="visuallyHidden",vi=({children:t,isActive:n,timeout:r,transitionStartState:o="notRendered",onInTransitionComplete:s,onOutTransitionComplete:a})=>{const c=(0,i.useRef)(!1),l=r?parseInt(r,10):300,u=Yr(s),p=Yr(a),h=o===mi,[f,d]=(0,i.useState)((()=>h?[di.visuallyHidden]:[])),y="notRendered"!==o||f.length>0;return(0,i.useEffect)((()=>{let e=null,t=null;return c.current&&!n&&(d([di.visible]),e=setTimeout((()=>{d([...h?[di.visuallyHidden]:[]]),p&&(t=requestAnimationFrame((()=>{p()})))}),l)),!c.current&&n&&(d([di.visible]),t=requestAnimationFrame((()=>{t=requestAnimationFrame((()=>{d([di.visible,di.in]),u&&(e=setTimeout((()=>{u()}),l))}))}))),c.current=n,()=>{clearTimeout(e),cancelAnimationFrame(t)}}),[n,h,l,u,p]),y&&(0,e.toChildArray)(t).map((t=>{const{className:n=""}=t.props,r=n.split(" ").filter((e=>!yi.includes(e)));return(0,e.cloneElement)(t,{className:[...r,...f].join(" ")})}))},Oi=({className:e,children:t,onCancel:n,headingText:r,cancelButtonText:o,disableButtonFocusing:s,cancelButtonRef:a,position:c="right"})=>{const l=(0,i.useRef)(null),u=Kr(),{hideOption:p}=$r(),{focusButton:h}=zr();return(0,i.useEffect)((()=>{ge(l.current)}),[]),(0,L.jsx)("section",{className:Wn("options",{"options--right":"left"!==c,"options--left":"left"===c},e),"aria-labelledby":u,tabIndex:"-1",ref:l,children:(0,L.jsxs)("div",{className:Wn("options__body"),children:[(0,L.jsx)("h2",{id:u,className:Wn("options__title"),children:r}),(0,L.jsxs)("button",{type:"button",onClick:()=>{n&&n(),p(),s||h()},"aria-describedby":u,className:Wn("button","options__close"),ref:e=>{a&&(a.current=e)},children:[(0,L.jsx)(fi,{name:"close",size:"16"}),(0,L.jsx)("span",{children:o})]}),(0,L.jsx)("div",{className:Wn("options__wrapper"),children:t})]})})},{createActions:wi,createReducer:ji,selectState:xi}=d("forms"),[_i,Ei]=wi("form",{register:(e,t)=>({formId:e,persistData:t}),deregister:e=>({formId:e})}),[Si,Ti,ki,Pi]=wi("control",{register:(e,t)=>({formId:e,name:t}),deregister:(e,t)=>({formId:e,name:t}),updateValue:(e,t,n)=>({formId:e,name:t,value:n}),updateTouched:(e,t,n)=>({formId:e,name:t,touched:n})}),Ci=E(xi,ei("formId"),((e,t)=>e[t])),Ai=E(Ci,(e=>(null==e?void 0:e.controls)||{})),Ii=E(Ai,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),Ni=E(Ai,ei("name"),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.value})),Di=E(Ai,ei("name"),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.touched})),Ri=(0,e.createContext)({}),Li=Ri,{Provider:Ui,Consumer:Mi}=Ri;function $i(){return(0,i.useContext)(Li)}function zi(e){const t=Q(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:s}=$i(),a=!!X(Ci,{formId:n},[n]),c=(0,i.useRef)();c.current=a;const l=X(Ni,{formId:n,name:e},[n,e]),u=X(Di,{formId:n,name:e},[n,e]),p=null==s?void 0:s[e],h=!p;(0,i.useEffect)((()=>{c.current&&t(Si(n,e))}),[a,n,e,t]),(0,i.useLayoutEffect)((()=>()=>{t(Ti(n,e))}),[a,n,e,t]);const f=(0,i.useCallback)((t=>r(e,t.target.value)),[e,r]),d=(0,i.useCallback)((()=>{o(e,!0)}),[o,e]);return[(0,i.useMemo)((()=>({name:e,onInput:f,onBlur:d,value:l})),[e,f,d,l]),(0,i.useMemo)((()=>({isValid:h,error:p,touched:u})),[h,p,u])]}const Bi=["children","formId","persistData","onError","onSubmit","validationSchema"];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){qi(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 qi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vi(e){let{children:t,formId:n,persistData:r,onError:o,onSubmit:s,validationSchema:a}=e,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Bi);const l=Q(),u=X(Ii,{formId:n},[n]),[p,h]=(0,i.useState)(!1),[f,d]=(0,i.useState)({}),{isValid:y,errors:b}=function(e,t){const n=(0,i.useMemo)((()=>function(e,t={}){return Object.entries(t).reduce(((t,[n,r])=>{r&&!Array.isArray(r)&&(r=[r]);for(let i=0;i<(null===(o=r)||void 0===o?void 0:o.length);i++){var o;if(!r[i].fn(e[n],r[i].compareValue)){t[n]=r[i].errorText;break}}return t}),{})}(e,t)),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(u,a),g=(0,i.useMemo)((()=>Hi(Hi({},b),f)),[b,f]);(0,i.useLayoutEffect)((()=>{l(_i(n,r))}),[n,r,l]),(0,i.useEffect)((()=>()=>{l(Ei(n))}),[n,r,l]);const m=(0,i.useCallback)(((e,t)=>{l(ki(n,e,t))}),[n,l]),v=(0,i.useCallback)(((e,t)=>{l(Pi(n,e,t))}),[l,n]),O=(0,i.useCallback)(((e,t)=>{d((n=>Hi(Hi({},n),{},{[e]:t})))}),[d]),w=(0,i.useCallback)((e=>{var t;e.preventDefault();const n="true"===(null===(t=e.submitter)||void 0===t?void 0:t.ariaDisabled);h(!n),!n&&y&&s(u,{updateControlValue:m,setError:O})}),[y,s,u,m,O]);(0,i.useEffect)((()=>{o&&o({errors:g,isSubmitted:p,isValid:0===Object.keys(g).length})}),[p,g,o]);const j=(0,i.useMemo)((()=>({formId:n,values:u,errors:g,isValid:0===Object.keys(g).length,isSubmitted:p,handleSubmit:w,validationSchema:a,updateControlValue:m,updateControlTouched:v})),[n,u,g,p,w,a,m,v]);return n?s?(0,L.jsx)(Ui,Hi(Hi({},c),{},{value:j,children:t})):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)}function Wi(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 Gi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wi(Object(n),!0).forEach((function(t){Ki(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ki(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yi={},Ji={controls:{}},Qi={value:"",touched:!1};function Zi(e,t,n,r){var o;const i=(null===(o=e[t])||void 0===o?void 0:o.controls[n])||Qi;return Gi(Gi({},e),{},{[t]:Gi(Gi({},e[t]),{},{controls:Gi(Gi({},e[t].controls),{},{[n]:Gi(Gi({},i),r)})})})}const Xi=ji({[_i]:(e,{formId:t,persistData:n})=>{const r=n?e[t]??Gi(Gi({},Ji),{},{persistData:n}):Gi(Gi({},Ji),{},{persistData:n});return Gi(Gi({},e),{},{[t]:r})},[Ei]:(e,{formId:t})=>{var n;const r=Gi({},e);return null!==(n=r[t])&&void 0!==n&&n.persistData||delete r[t],r},[Si]:(e,{name:t,formId:n})=>Zi(e,n,t),[Ti]:(e,{formId:t,name:n})=>{const r=e[t];if(!r)return e;if(r.persistData)return e;const o=Gi({},r.controls);return delete o[n],Gi(Gi({},e),{},{[t]:Gi(Gi({},r),{},{controls:o})})},[ki]:(e,{formId:t,name:n,value:r})=>Zi(e,t,n,{value:r}),[Pi]:(e,{formId:t,name:n,touched:r})=>Zi(e,t,n,{touched:r}),[Ln.pending]:()=>Yi},Yi),es=["className","disableValidationClasses"];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,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rs=function(e){let{className:t,disableValidationClasses:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,es);const{handleSubmit:o,isValid:i,isSubmitted:s}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=$i();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),a=["form"];return!n&&s&&(a.push("form--submitted"),i?a.push("form--valid"):a.push("form--invalid")),(0,L.jsx)("form",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ts(Object(n),!0).forEach((function(t){ns(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}({onSubmit:o,className:Wn([...a,t])},r))};function os({id:e,error:t}){const[n,r]=(0,i.useState)(!1);return(0,i.useEffect)((()=>{const e=setTimeout((()=>r(!0)),300);return()=>clearTimeout(e)}),[]),(0,L.jsx)("div",{className:Wn("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&(0,L.jsxs)("span",{id:e,className:Wn("error__message"),children:[(0,L.jsx)(fi,{name:"error",size:"16"}),t]})})}const is=({contentHint:e,id:t,labelText:n,labelClass:r=Wn("label"),validity:o,errorText:i,children:s})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("label",{htmlFor:t,className:r,children:n}),e&&(0,L.jsx)("span",{id:`${t}-content-hint`,className:Wn("input__content-hint"),children:e}),(0,L.jsx)(os,{id:`${t}-error`,error:!o&&i}),s]}),ss=["id","name","labelText","labelClass","contentHint","aria-describedby","options"];function as(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?as(Object(n),!0).forEach((function(t){ls(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):as(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ls(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const us=e=>{let{id:t,name:n,labelText:r,labelClass:o,contentHint:i,"aria-describedby":s,options:a=[]}=e,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ss);const{isSubmitted:l}=$i(),[u,{error:p}]=zi(n),h=l&&p,f=[];return s&&f.push(s),i&&f.push(`${t}-content-hint`),h&&f.push(`${t}-error`),(0,L.jsx)(is,{id:t,contentHint:i,validity:!h,errorText:p,labelText:r,labelClass:o,children:(0,L.jsx)("select",cs(cs(cs({id:t,name:n,"aria-invalid":h?"true":"false","aria-describedby":f.join(" ")||null},u),c),{},{children:a.map((e=>(0,L.jsx)("option",{value:e.value,children:e.label},e.value)))}))})},ps=function({controlName:e,descriptionId:t}){const{t:n}=wr(),{isActive:r,languages:o,currentLocale:s}=oi(),{locale:a}=wr(),c=(0,i.useMemo)((()=>{var e;return null==o||null===(e=o.find((e=>e.locale===s)))||void 0===e?void 0:e.nativeName}),[o,s]),l=(0,i.useMemo)((()=>[{value:"",label:n("translations.settings.defaultOptionLabel")},...o.filter((e=>e.locale.toLowerCase()!==String(a).toLowerCase())).map((e=>({value:e.locale,label:e.nativeName})))]),[n,o,a]);return(0,L.jsxs)(rs,{noValidate:"true",className:Wn("options__form"),children:[(0,L.jsx)("p",{className:Wn("options__description"),id:t,children:n("translations.settings.description")}),r?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("h3",{children:n("translations.settings.currentTranslationLabel")}),(0,L.jsx)("p",{className:Wn("options__active-language"),children:c})]}):(0,L.jsx)(us,{name:e,type:"text",className:Wn("input__select"),"aria-describedby":t,labelClass:Wn("label"),labelText:n("translations.settings.inputLabel"),options:l,defaultValue:s||""}),(0,L.jsx)("div",{className:Wn("options__actions"),children:(0,L.jsx)("button",{type:"submit",className:Wn("button","button--primary","options__submit"),children:n(r?"translations.settings.endButtonText":"translations.settings.startButtonText")})})]})},{REGISTER_FORM:hs,DE_REGISTER_FORM:fs,REGISTER:ds,DE_REGISTER:ys,SET_VALUE:bs,SET_VALIDITY:gs,SET_STATE:ms,SET_SUBMITTED:vs,SET_PERSIST_FORM_DATA:Os}={REGISTER_FORM:"REGISTER_FORM",DE_REGISTER_FORM:"DE_REGISTER_FORM",REGISTER:"REGISTER",DE_REGISTER:"DEREGISTER",SET_VALUE:"SET_VALUE",SET_VALIDITY:"SET_VALIDITY",SET_STATE:"SET_STATE",SET_SUBMITTED:"SET_SUBMITTED",SET_PERSIST_FORM_DATA:"SET_PERSIST_FORM_DATA"},ws=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),js=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},xs=e=>!(null==e||!e.length)>0,_s=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))},Es=e=>!!e,Ss="translation-settings",Ts="locale",ks=function({onClose:e}){const[t,n]=(0,i.useState)(void 0),{t:r}=wr(),{isActive:o,enableTranslations:s,disableTranslations:a}=oi(),c=Kr(),{focusContainer:l}=si(),u=(0,i.useCallback)((({isValid:e,isSubmitted:t})=>{n(t&&!e?"options--error":void 0)}),[n]),p=(0,i.useRef)(0),h=(0,i.useMemo)((()=>(p.current+=1,o?{}:{[Ts]:ws(Es,r("translations.settings.noLocaleText"))})),[o,r]);return(0,L.jsx)(Oi,{className:t,onCancel:e,formName:Ss,headingText:r("translations.settings.title"),cancelButtonText:r("translations.settings.cancelButtonText"),position:"left",disableButtonFocusing:!0,children:(0,L.jsx)(Vi,{onSubmit:({locale:t})=>{o?a():(s(t),e(),l())},formId:Ss,validationSchema:h,onError:u,children:(0,L.jsx)(ps,{controlName:Ts,descriptionId:c})},p.current)})};function Ps(){const{t:e}=wr(),[t,n]=(0,i.useState)(!1),r=(0,i.useRef)(null),o=Kr();return(0,L.jsxs)("div",{className:Wn("translations__container"),onKeyDown:e=>{t&&be(e)===ye.Escape&&(n(!1),ge(r.current))},children:[(0,L.jsx)(vi,{transitionStartState:bi,isActive:t,children:(0,L.jsx)("div",{className:Wn("options__dialog"),role:"dialog",children:(0,L.jsx)(ks,{onClose:()=>{n(!1)}})})}),(0,L.jsxs)("button",{type:"button",className:Wn(["button","button--secondary","chat__options__button"]),id:o,onClick:()=>{n((e=>!e))},onKeyDown:e=>{be(e)===ye.ArrowDown&&(n(!0),e.preventDefault())},ref:r,"aria-haspopup":"dialog","aria-expanded":t.toString(),children:[(0,L.jsx)(fi,{name:"newTranslation",size:"16"}),(0,L.jsx)("span",{className:Wn("button__text"),children:e("translations.settings.openButtonText")})]})]})}function Cs({id:e,label:t,onButtonClick:n,buttonText:r,srButtonText:o,type:i}){const s=Kr();return(0,L.jsxs)("section",{className:Wn("chat-status",i&&`chat-status--${i}`),id:e,tabIndex:"-1","aria-labelledby":s,children:[(0,L.jsx)("h2",{className:Wn("chat-status__title"),id:s,children:t}),(0,L.jsxs)("button",{type:"button",className:Wn("button","button--tertiary"),onClick:n,children:[(0,L.jsx)("span",{"aria-hidden":o?"true":void 0,children:r}),o&&(0,L.jsx)("span",{className:Wn("visually-hidden"),children:o})]})]})}function As(){const{t:e}=wr(),{id:t}=si(),{hasInterrupt:n}=eo(),{isActive:r,disableTranslations:o,languages:s,currentLocale:a}=oi(),c=Ar(),l=(0,i.useMemo)((()=>{var e;return null==s||null===(e=s.find((e=>e.locale===a)))||void 0===e?void 0:e.nativeName}),[s,a]),u=(0,i.useCallback)((()=>{o(),c()}),[o,c]);return!r||n?null:(0,L.jsx)(Cs,{type:"translations",id:t,label:e("translations.status.label",{language:l}),onButtonClick:u,buttonText:e("translations.status.stopText"),srButtonText:e("translations.status.srStopText")})}const Is=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,Ns=({id:e,categories:t=[],question:n,onClick:r,hasIcon:o})=>{const s=(0,i.useMemo)((()=>["suggestions-item",...t.map(Is)]),[t]),a=(0,i.useCallback)((()=>{r&&r({id:e,question:n})}),[e,n,r]);return(0,L.jsx)("li",{className:Wn(s),children:(0,L.jsxs)("button",{type:"button",onClick:a,className:Wn("button","button--primary"),children:[o&&(0,L.jsx)(fi,{name:"chevronRight",size:"8"}),n]})})};function Ds(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ls=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>(0,L.jsx)("ul",{className:Wn("suggestions__list",e),children:t.map((e=>(0,L.jsx)(Ns,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ds(Object(n),!0).forEach((function(t){Rs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ds(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({hasIcon:r,onClick:n},e),e.id)))}),Us=({isAside:e})=>{const{layoutMode:t}=ee(),{t:n}=wr(),{sendAction:r,addMessageBubble:o}=So(),{isOpen:s,setVisibility:a}=yo(),c=Kr(),l=Ar(),u=(0,i.useRef)(null),{sendPolite:p}=ko(),{hasInterrupt:h}=eo(),{hasCountdown:f,endCountdown:d}=Wo(),{hasPrompt:y,continueChat:b}=Ko(),g=fo(),m=mn("suggestion"),[v]=ii({payload:m}),O=(0,i.useMemo)((()=>m&&!h?v:[]),[m,h,v]),w=(0,i.useRef)(null),j=(0,i.useRef)(!1),x=(0,i.useRef)([]),_=!!O.length,E="inline"===t?(g||s)&&!e:g,S=(0,i.useRef)(E),k=_&&!E,P=_?O:x.current;x.current=P;const C=(0,i.useCallback)((({id:e,question:t})=>{f&&d(!0),y&&b(),r({type:ke,originMessage:m.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),o(t),s||a(T.open),l()}),[o,b,d,l,f,y,m,r,a,s]);(0,i.useEffect)((()=>{if(w.current!==O&&!E){if(_){const e=j.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout((()=>{p(e)}),30)}else j.current&&p(n("suggestions.srUnavailableText"));w.current=O}!S.current&&E?(me(u.current,l),p(n("suggestions.srUnavailableText"))):!_&&j.current&&me(u.current,l),j.current=_,S.current=E}),[O,_,E,l,p,n]);const A=n("suggestions.headingText"),I=n("suggestions.footerText"),N=A?"section":"div";return(0,L.jsx)(vi,{isActive:k,transitionStartState:bi,children:(0,L.jsxs)(N,{className:Wn("suggestions"),"aria-labelledby":A?c:null,ref:u,children:[A&&(0,L.jsx)("p",{id:c,className:Wn("suggestions__heading"),children:A}),!!P.length&&(0,L.jsx)(Ls,{suggestions:P,onClickSuggestion:C}),I&&!s&&(0,L.jsx)("p",{className:Wn("suggestions__footer"),children:I})]})})},Ms=({children:e,className:t=""})=>{const{isOpen:n,isVisible:r,setVisibility:o}=yo(),{namespace:i,layoutMode:s}=ee(),{isInline:a}=vn(),c=er(),l=fo(),{t:u}=wr(),p=["chat",`chat--layout-${s}`,`namespace--${i}`,...c,t];return n||"app"===s||p.push("chat--collapsed"),l&&p.push("chat--user-responded"),r&&(0,L.jsxs)("section",{className:Wn(p),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!a&&n&&o(T.minimized)},tabIndex:"-1","aria-label":u("chat.srLabel"),children:[(0,L.jsx)("div",{className:Wn("chat-wrapper"),children:e}),"inline"===s&&n&&(0,L.jsx)(Us,{isAside:!0})]})},$s=({originalError:e,title:t,message:n,buttonText:r,action:o,srText:s})=>{const a=So(),c=Kr(),{sendPolite:l}=ko(),u=Ar(),p=e instanceof Pn;return(0,i.useEffect)((()=>{p&&a[o]()}),[o,a,p]),(0,i.useEffect)((()=>{!p&&s&&setTimeout((()=>{l(s)}),200)}),[l,s,p]),!p&&(0,L.jsx)("section",{className:Wn("interrupt"),"aria-labelledby":c,children:(0,L.jsxs)("div",{className:Wn("interrupt__body"),children:[(0,L.jsx)("h2",{id:c,className:Wn("interrupt__title"),children:t}),(0,L.jsx)("p",{className:Wn("interrupt__message"),children:n}),r&&o&&(0,L.jsx)("div",{className:Wn("interrupt__actions"),children:(0,L.jsx)("button",{type:"button",className:Wn("button","button--primary"),onClick:()=>{a[o](),u()},children:r})})]})})},zs=(0,e.createContext)({}),Bs=e=>{const t=(0,i.useContext)(zs);let n=null;"choice_prompt"===e.payload.type&&(n=t[e.type][e.payload.body.prompt.type]);const r=t[e.type][e.payload.type]||t.fallback;return[r&&"function"!=typeof r?r[e.payload.body.type]||t.fallback:r,n]};function Fs(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 Hs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fs(Object(n),!0).forEach((function(t){qs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vs({children:e,childrenHTML:t,className:n,graphicSrc:r,graphicType:o="icon",iconName:i,iconSize:s,iconClassName:a,dividerType:c}){const l=Boolean(i||r),u=t?{dangerouslySetInnerHTML:{__html:t}}:{children:e};return(0,L.jsxs)("div",{className:Wn("divider",c&&`divider--type-${c}`,n),children:[l&&(0,L.jsx)("span",{className:Wn("divider__graphic"),children:i?(0,L.jsx)(fi,{name:i,size:s,className:a}):(0,L.jsx)("img",{src:r,className:Wn({icon:"icon"===o,avatar:"avatar"===o},a)})}),(0,L.jsx)("div",Hs({className:Wn("divider__body")},u))]})}const Ws={month:"long",day:"numeric",year:"numeric"},Gs={hour:"numeric",minute:"numeric"},Ks=({event:e})=>{const t=(()=>{const[e,t]=(0,i.useReducer)((e=>e+1),0);return(0,i.useCallback)((()=>{setTimeout((()=>{t()}))}),[])})(),{date:n,time:r,timeUntilMidnight:o,srText:s}=(e=>{var t;const{t:n}=wr(),r=ee(),o=(null==r||null===(t=r.context)||void 0===t?void 0:t.locale)??[],i=new Date(e),s=new Date,a=new Date(s);a.setHours(24,0,0,0);const c=a-s,l=i.toString(),u=new Intl.DateTimeFormat(o,Gs).format(i);let p=((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})(i,s);switch(p){case"today":p=n("dateTime.today");break;case"yesterday":p=n("dateTime.yesterday");break;default:p=new Intl.DateTimeFormat(o,Ws).format(i)}return{date:p,srText:n("dateTime.srText",{date:p,time:u}),time:u,fullDateTime:l,timeUntilMidnight:c}})(le(e.timeIndicator));return(0,i.useEffect)((()=>{const e=setTimeout((()=>{t()}),o);return()=>{clearTimeout(e)}}),[t,o]),(0,L.jsxs)(Vs,{dividerType:"time-indicator",children:[(0,L.jsxs)("p",{className:Wn("divider__time"),"aria-hidden":"true",children:[(0,L.jsx)("span",{children:n}),(0,L.jsx)("span",{children:r})]}),(0,L.jsx)("p",{className:Wn("visually-hidden"),children:s})]})},Ys=({event:e,newParticipant:t})=>{const[n,r]=Bs(e);if(!n)return null;const o=["conversation__item"];return"info"===e.type?o.push("conversation__item--source-info"):e.payload.fromClient?o.push("conversation__item--source-user"):o.push("conversation__item--source-agent"),t&&o.push("conversation__item--new-participant"),(0,L.jsxs)("li",{className:Wn(o),children:[e.timeIndicator&&(0,L.jsx)(Ks,{event:e}),(0,L.jsx)(n,{event:e,children:(0,L.jsx)(r,{event:e})})]})},Js=({eventPayload:e})=>{const{t}=wr(),{fromClient:n,participant:r}=e,o=(e=>ln().participantInfo.participants[e])(r)||{},{messages:i}=ee(),s=n?t("participants.user.name"):o&&o.name,{showAvatar:a,showName:c}=i[n?"user":"agent"]||{};if(!a&&!c)return null;const l=[];return a&&s&&o.avatar&&l.push((0,L.jsx)("span",{className:Wn("message__avatar"),children:(0,L.jsx)("img",{src:o.avatar,className:Wn("avatar"),alt:""})})),c&&l.push((0,L.jsx)("span",{className:Wn("message__author-name"),children:s})),l.length>0&&(0,L.jsx)("div",{className:Wn("message__author"),children:l})},Qs=()=>{const{id:e}=gn()||{};return(0,L.jsx)("li",{className:Wn("conversation__item","conversation__item--source-agent"),children:(0,L.jsxs)("div",{className:Wn("message","message--source-agent","message--type-loading"),children:[(0,L.jsx)(Js,{eventPayload:{fromClient:!1,participant:e}}),(0,L.jsx)("div",{className:Wn("message__body"),children:(0,L.jsxs)("span",{className:Wn("loader"),children:[(0,L.jsx)("span",{className:Wn("loader__part","one")}),(0,L.jsx)("span",{className:Wn("loader__part","two")}),(0,L.jsx)("span",{className:Wn("loader__part","three")}),(0,L.jsx)("span",{className:Wn("loader__part","four")})]})})]})})},Zs=["showParticipant","showTranslationToggle","event","type","modifiers","children","bodyProps","info"];function Xs(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?Xs(Object(n),!0).forEach((function(t){ta(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ta(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const na=function(e){let{showParticipant:t=!0,showTranslationToggle:n=!0,event:r,type:o,modifiers:i,children:s,bodyProps:a={},info: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,Zs);const u=tr(r),{t:p}=wr(),[,{hasTranslation:h,isTranslated:f,toggleTranslation:d,locale:y}]=ii(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)}))),f&&u.push("message--is-translated"),h&&u.push("message--has-translation"),f&&(a=ea(ea({},a),{},{lang:y})),(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)("div",ea(ea({className:Wn(u)},l),{},{children:[t&&(0,L.jsx)(Js,{eventPayload:r.payload}),(0,L.jsx)("div",ea(ea({className:Wn("message__body")},a),{},{children:s})),c&&(0,L.jsx)("div",{"aria-hidden":"true",className:Wn("message__info"),children:c}),n&&h&&(0,L.jsx)("div",{className:Wn("message__translation-info"),children:(0,L.jsx)("button",{className:Wn("message__translation-toggle","button","button--secondary"),onClick:d,children:p(f?"translations.toggle.hideButtonText":"translations.toggle.showButtonText")})})]}))})},ra=["event","children"];function oa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oa(Object(n),!0).forEach((function(t){sa(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const aa=e=>{const{payload:t}=e,[n,r]=(0,i.useState)(!1),{sendAction:o,addMessageBubble:s,addDivider:a}=So(),{activeServiceSessionId:c}=ln().serviceInfo,l=Z(bn),[u]=ii(e),{service:p}=t,h=(0,i.useMemo)((()=>{var t;return ia(ia({},e),{},{payload:ia(ia({},e.payload),{},{body:null===(t=e.payload.body)||void 0===t?void 0:t.prompt,translatedBody:e.payload.translatedBody&&ia(ia({},e.payload.translatedBody),{},{data:e.payload.translatedBody.data.prompt})})})}),[e]),f=u.chooseAgain&&c===p.serviceSessionId&&t.id!==l;return(0,i.useEffect)((()=>{r(t.id===l)}),[t,l]),{body:u,subEvent:h,showOptions:n,chooseAgain:f,onChoiceClickHandler:e=>{f&&a("new_topic"),s(e.text),o({type:"pick_choice",originMessage:t.id,choice:{id:e.id,text:e.text,chooseAgain:f}}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}};let ca={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const la=/[&<>"']/,ua=/[&<>"']/g,pa=/[<>"']|&(?!#?\w+;)/,ha=/[<>"']|&(?!#?\w+;)/g,fa={"&":"&","<":"<",">":">",'"':""","'":"'"},da=e=>fa[e];function ya(e,t){if(t){if(la.test(e))return e.replace(ua,da)}else if(pa.test(e))return e.replace(ha,da);return e}const ba=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function ga(e){return e.replace(ba,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const ma=/(^|[^\[])\^/g;function va(e,t){e=e.source||e,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(ma,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const Oa=/[^\w:]/g,wa=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ja(e,t,n){if(e){let e;try{e=decodeURIComponent(ga(n)).replace(Oa,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!wa.test(n)&&(n=function(e,t){xa[" "+e]||(_a.test(e)?xa[" "+e]=e+"/":xa[" "+e]=Ca(e,"/",!0));const n=-1===(e=xa[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Ea,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(Sa,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const xa={},_a=/^[^:]+:\/*[^/]*$/,Ea=/^([^:]+:)[\s\S]*$/,Sa=/^([^:]+:\/*[^/]*)[\s\S]*$/,Ta={exec:function(){}};function ka(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function Pa(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function Ca(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i!==t||n){if(i===t||!n)break;o++}else o++}return e.substr(0,r-o)}function Aa(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Ia(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function Na(e,t,n,r){const o=t.href,i=t.title?ya(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s,[])};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:i,text:ya(s)}}class Da{constructor(e){this.options=e||ca}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Ca(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Ca(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,s,a,c,l,u,p,h,f,d=t[1].trim();const y=d.length>1,b={type:"list",raw:"",ordered:y,start:y?+d.slice(0,-1):"",loose:!1,items:[]};d=y?`\\d{1,9}\\${d.slice(-1)}`:`\\${d}`,this.options.pedantic&&(d=y?d:"[*+-]");const g=new RegExp(`^( {0,3}${d})((?: [^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=g.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),l=t[2].split("\n",1)[0],u=e.split("\n",1)[0],this.options.pedantic?(i=2,h=l.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,h=l.slice(i),i+=t[1].length),a=!1,!l&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(;e&&(p=e.split("\n",1)[0],l=p,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!t.test(l));){if(l.search(/[^ ]/)>=i||!l.trim())h+="\n"+l.slice(i);else{if(a)break;h+="\n"+l}a||l.trim()||(a=!0),n+=p+"\n",e=e.substring(p.length+1)}}b.loose||(c?b.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(h),r&&(o="[ ] "!==r[0],h=h.replace(/^\[[ xX]\] +/,""))),b.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:h}),b.raw+=n}b.items[b.items.length-1].raw=n.trimRight(),b.items[b.items.length-1].text=h.trimRight(),b.raw=b.raw.trimRight();const m=b.items.length;for(s=0;s<m;s++){this.lexer.state.top=!1,b.items[s].tokens=this.lexer.blockTokens(b.items[s].text,[]);const e=b.items[s].tokens.filter((e=>"space"===e.type)),t=e.every((e=>{const t=e.raw.split("");let n=0;for(const e of t)if("\n"===e&&(n+=1),n>1)return!0;return!1}));!b.loose&&e.length&&t&&(b.loose=!0,b.items[s].loose=!0)}return b}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):ya(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:Pa(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,s=e.align.length;for(n=0;n<s;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(s=e.rows.length,n=0;n<s;n++)e.rows[n]=Pa(e.rows[n],e.header.length).map((e=>({text:e})));for(s=e.header.length,r=0;r<s;r++)e.header[r].tokens=[],this.lexer.inlineTokens(e.header[r].text,e.header[r].tokens);for(s=e.rows.length,r=0;r<s;r++)for(i=e.rows[r],o=0;o<i.length;o++)i[o].tokens=[],this.lexer.inlineTokens(i[o].text,i[o].tokens);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t){const e={type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e={type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}text(e){const t=this.rules.block.text.exec(e);if(t){const e={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:ya(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):ya(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=Ca(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if("\\"===e[o])o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),Na(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Na(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,i,s=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=o.length,r[3]||r[4]){s+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(s-=i,s>0)continue;if(i=Math.min(i,i+s+a),Math.min(n,i)%2){const t=e.slice(1,n+r.index+i);return{type:"em",raw:e.slice(0,n+r.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,n+r.index+i-1);return{type:"strong",raw:e.slice(0,n+r.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=ya(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=ya(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=ya(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=ya(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=ya(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):ya(n[0]):n[0]:ya(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const Ra={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Ta,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Ra.def=va(Ra.def).replace("label",Ra._label).replace("title",Ra._title).getRegex(),Ra.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ra.listItemStart=va(/^( *)(bull) */).replace("bull",Ra.bullet).getRegex(),Ra.list=va(Ra.list).replace(/bull/g,Ra.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ra.def.source+")").getRegex(),Ra._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ra._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Ra.html=va(Ra.html,"i").replace("comment",Ra._comment).replace("tag",Ra._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ra.paragraph=va(Ra._paragraph).replace("hr",Ra.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ra._tag).getRegex(),Ra.blockquote=va(Ra.blockquote).replace("paragraph",Ra.paragraph).getRegex(),Ra.normal=ka({},Ra),Ra.gfm=ka({},Ra.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Ra.gfm.table=va(Ra.gfm.table).replace("hr",Ra.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ra._tag).getRegex(),Ra.gfm.paragraph=va(Ra._paragraph).replace("hr",Ra.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Ra.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ra._tag).getRegex(),Ra.pedantic=ka({},Ra.normal,{html:va("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Ra._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ta,paragraph:va(Ra.normal._paragraph).replace("hr",Ra.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Ra.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const La={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ta,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ta,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function Ua(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Ma(e){let t,n,r="";const o=e.length;for(t=0;t<o;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}La._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",La.punctuation=va(La.punctuation).replace(/punctuation/g,La._punctuation).getRegex(),La.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,La.escapedEmSt=/\\\*|\\_/g,La._comment=va(Ra._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),La.emStrong.lDelim=va(La.emStrong.lDelim).replace(/punct/g,La._punctuation).getRegex(),La.emStrong.rDelimAst=va(La.emStrong.rDelimAst,"g").replace(/punct/g,La._punctuation).getRegex(),La.emStrong.rDelimUnd=va(La.emStrong.rDelimUnd,"g").replace(/punct/g,La._punctuation).getRegex(),La._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,La._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,La._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,La.autolink=va(La.autolink).replace("scheme",La._scheme).replace("email",La._email).getRegex(),La._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,La.tag=va(La.tag).replace("comment",La._comment).replace("attribute",La._attribute).getRegex(),La._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,La._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,La._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,La.link=va(La.link).replace("label",La._label).replace("href",La._href).replace("title",La._title).getRegex(),La.reflink=va(La.reflink).replace("label",La._label).replace("ref",Ra._label).getRegex(),La.nolink=va(La.nolink).replace("ref",Ra._label).getRegex(),La.reflinkSearch=va(La.reflinkSearch,"g").replace("reflink",La.reflink).replace("nolink",La.nolink).getRegex(),La.normal=ka({},La),La.pedantic=ka({},La.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:va(/^!?\[(label)\]\((.*?)\)/).replace("label",La._label).getRegex(),reflink:va(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",La._label).getRegex()}),La.gfm=ka({},La.normal,{escape:va(La.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),La.gfm.url=va(La.gfm.url,"i").replace("email",La.gfm._extended_email).getRegex(),La.breaks=ka({},La.gfm,{br:va(La.br).replace("{2,}","*").getRegex(),text:va(La.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});class $a{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ca,this.options.tokenizer=this.options.tokenizer||new Da,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Ra.normal,inline:La.normal};this.options.pedantic?(t.block=Ra.pedantic,t.inline=La.pedantic):this.options.gfm&&(t.block=Ra.gfm,this.options.breaks?t.inline=La.breaks:t.inline=La.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ra,inline:La}}static lex(e,t){return new $a(t).lex(e)}static lexInline(e,t){return new $a(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,o,i;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let n,r,o,i,s,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,i.index)+"["+Ia("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,i.index)+"["+Ia("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,i.index)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,Ma))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,Ma))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,Ua))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class za{constructor(e){this.options=e||ca}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+ya(r,!0)+'">'+(n?e:ya(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:ya(e,!0))+"</code></pre>\n"}blockquote(e){return"<blockquote>\n"+e+"</blockquote>\n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return"<li>"+e+"</li>\n"}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+"</p>\n"}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return"<tr>\n"+e+"</tr>\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,n){if(null===(e=ja(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+ya(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=ja(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">",r}text(e){return e}}class Ba{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class Fa{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class Ha{constructor(e){this.options=e||ca,this.options.renderer=this.options.renderer||new za,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ba,this.slugger=new Fa}static parse(e,t){return new Ha(t).parse(e)}static parseInline(e,t){return new Ha(t).parseInline(e)}parse(e,t=!0){let n,r,o,i,s,a,c,l,u,p,h,f,d,y,b,g,m,v,O,w="";const j=e.length;for(n=0;n<j;n++)if(p=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[p.type]&&(O=this.options.extensions.renderers[p.type].call({parser:this},p),!1!==O||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(p.type)))w+=O||"";else switch(p.type){case"space":continue;case"hr":w+=this.renderer.hr();continue;case"heading":w+=this.renderer.heading(this.parseInline(p.tokens),p.depth,ga(this.parseInline(p.tokens,this.textRenderer)),this.slugger);continue;case"code":w+=this.renderer.code(p.text,p.lang,p.escaped);continue;case"table":for(l="",c="",i=p.header.length,r=0;r<i;r++)c+=this.renderer.tablecell(this.parseInline(p.header[r].tokens),{header:!0,align:p.align[r]});for(l+=this.renderer.tablerow(c),u="",i=p.rows.length,r=0;r<i;r++){for(a=p.rows[r],c="",s=a.length,o=0;o<s;o++)c+=this.renderer.tablecell(this.parseInline(a[o].tokens),{header:!1,align:p.align[o]});u+=this.renderer.tablerow(c)}w+=this.renderer.table(l,u);continue;case"blockquote":u=this.parse(p.tokens),w+=this.renderer.blockquote(u);continue;case"list":for(h=p.ordered,f=p.start,d=p.loose,i=p.items.length,u="",r=0;r<i;r++)b=p.items[r],g=b.checked,m=b.task,y="",b.task&&(v=this.renderer.checkbox(g),d?b.tokens.length>0&&"paragraph"===b.tokens[0].type?(b.tokens[0].text=v+" "+b.tokens[0].text,b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&"text"===b.tokens[0].tokens[0].type&&(b.tokens[0].tokens[0].text=v+" "+b.tokens[0].tokens[0].text)):b.tokens.unshift({type:"text",text:v}):y+=v),y+=this.parse(b.tokens,d),u+=this.renderer.listitem(y,m,g);w+=this.renderer.list(u,h,f);continue;case"html":w+=this.renderer.html(p.text);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(p.tokens));continue;case"text":for(u=p.tokens?this.parseInline(p.tokens):p.text;n+1<j&&"text"===e[n+1].type;)p=e[++n],u+="\n"+(p.tokens?this.parseInline(p.tokens):p.text);w+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+p.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return w}parseInline(e,t){t=t||this.renderer;let n,r,o,i="";const s=e.length;for(n=0;n<s;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(o=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==o||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))i+=o||"";else switch(r.type){case"escape":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;case"text":i+=t.text(r.text);break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}function qa(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),Aa(t=ka({},qa.defaults,t||{})),n){const r=t.highlight;let o;try{o=$a.lex(e,t)}catch(e){return n(e)}const i=function(e){let i;if(!e)try{t.walkTokens&&qa.walkTokens(o,t.walkTokens),i=Ha.parse(o,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,i)};if(!r||r.length<3)return i();if(delete t.highlight,!o.length)return i();let s=0;return qa.walkTokens(o,(function(e){"code"===e.type&&(s++,setTimeout((()=>{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),s--,0===s&&i()}))}),0))})),void(0===s&&i())}try{const n=$a.lex(e,t);return t.walkTokens&&qa.walkTokens(n,t.walkTokens),Ha.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+ya(e.message+"",!0)+"</pre>";throw e}}qa.options=qa.setOptions=function(e){var t;return ka(qa.defaults,e),t=qa.defaults,ca=t,qa},qa.getDefaults=function(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}},qa.defaults=ca,qa.use=function(...e){const t=ka({},...e),n=qa.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach((e=>{if(e.extensions&&(r=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)}))),e.renderer){const n=qa.defaults.renderer||new za;for(const t in e.renderer){const r=n[t];n[t]=(...o)=>{let i=e.renderer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.renderer=n}if(e.tokenizer){const n=qa.defaults.tokenizer||new Da;for(const t in e.tokenizer){const r=n[t];n[t]=(...o)=>{let i=e.tokenizer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.tokenizer=n}if(e.walkTokens){const n=qa.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),n&&n.call(this,t)}}r&&(t.extensions=n),qa.setOptions(t)}))},qa.walkTokens=function(e,t){for(const n of e)switch(t.call(qa,n),n.type){case"table":for(const e of n.header)qa.walkTokens(e.tokens,t);for(const e of n.rows)for(const n of e)qa.walkTokens(n.tokens,t);break;case"list":qa.walkTokens(n.items,t);break;default:qa.defaults.extensions&&qa.defaults.extensions.childTokens&&qa.defaults.extensions.childTokens[n.type]?qa.defaults.extensions.childTokens[n.type].forEach((function(e){qa.walkTokens(n[e],t)})):n.tokens&&qa.walkTokens(n.tokens,t)}},qa.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");Aa(t=ka({},qa.defaults,t||{}));try{const n=$a.lexInline(e,t);return t.walkTokens&&qa.walkTokens(n,t.walkTokens),Ha.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+ya(e.message+"",!0)+"</pre>";throw e}},qa.Parser=Ha,qa.parser=Ha.parse,qa.Renderer=za,qa.TextRenderer=Ba,qa.Lexer=$a,qa.lexer=$a.lex,qa.Tokenizer=Da,qa.Slugger=Fa,qa.parse=qa,qa.options,qa.setOptions,qa.use,qa.walkTokens,qa.parseInline,Ha.parse,$a.lex;const Va=e=>{try{return qa(e)}catch(t){return console.log("Could not parse message",e,t),""}},Wa=e=>{const{sendAction:t}=So();return n=>{n.target&&n.target.dataset.linkId&&t({type:"navigate",originMessage:e,link:{id:n.target.dataset.linkId,url:n.target.getAttribute("href")}})}};var Ga=Object.prototype.toString,Ka=Array.isArray||function(e){return"[object Array]"===Ga.call(e)};function Ya(e){return"function"==typeof e}function Ja(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Qa(e,t){return null!=e&&"object"==typeof e&&t in e}var Za=RegExp.prototype.test,Xa=/\S/;var ec={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},tc=/\s*/,nc=/\s+/,rc=/\s*=/,oc=/\s*\}/,ic=/#|\^|\/|>|\{|&|=|!/;function sc(e){this.string=e,this.tail=e,this.pos=0}function ac(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function cc(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}sc.prototype.eos=function(){return""===this.tail},sc.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},sc.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},ac.prototype.push=function(e){return new ac(e,this)},ac.prototype.lookup=function(e){var t,n,r,o=this.cache;if(o.hasOwnProperty(e))t=o[e];else{for(var i,s,a,c=this,l=!1;c;){if(e.indexOf(".")>0)for(i=c.view,s=e.split("."),a=0;null!=i&&a<s.length;)a===s.length-1&&(l=Qa(i,s[a])||(n=i,r=s[a],null!=n&&"object"!=typeof n&&n.hasOwnProperty&&n.hasOwnProperty(r))),i=i[s[a++]];else i=c.view[e],l=Qa(c.view,e);if(l){t=i;break}c=c.parent}o[e]=t}return Ya(t)&&(t=t.call(this.view)),t},cc.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},cc.prototype.parse=function(e,t){var n=this.templateCache,r=e+":"+(t||lc.tags).join(":"),o=void 0!==n,i=o?n.get(r):void 0;return null==i&&(i=function(e,t){if(!e)return[];var n,r,o,i,s=!1,a=[],c=[],l=[],u=!1,p=!1,h="",f=0;function d(){if(u&&!p)for(;l.length;)delete c[l.pop()];else l=[];u=!1,p=!1}function y(e){if("string"==typeof e&&(e=e.split(nc,2)),!Ka(e)||2!==e.length)throw new Error("Invalid tags: "+e);n=new RegExp(Ja(e[0])+"\\s*"),r=new RegExp("\\s*"+Ja(e[1])),o=new RegExp("\\s*"+Ja("}"+e[1]))}y(t||lc.tags);for(var b,g,m,v,O,w,j=new sc(e);!j.eos();){if(b=j.pos,m=j.scanUntil(n))for(var x=0,_=m.length;x<_;++x)i=v=m.charAt(x),function(e,t){return Za.call(e,t)}(Xa,i)?(p=!0,s=!0,h+=" "):(l.push(c.length),h+=v),c.push(["text",v,b,b+1]),b+=1,"\n"===v&&(d(),h="",f=0,s=!1);if(!j.scan(n))break;if(u=!0,g=j.scan(ic)||"name",j.scan(tc),"="===g?(m=j.scanUntil(rc),j.scan(rc),j.scanUntil(r)):"{"===g?(m=j.scanUntil(o),j.scan(oc),j.scanUntil(r),g="&"):m=j.scanUntil(r),!j.scan(r))throw new Error("Unclosed tag at "+j.pos);if(O=">"==g?[g,m,b,j.pos,h,f,s]:[g,m,b,j.pos],f++,c.push(O),"#"===g||"^"===g)a.push(O);else if("/"===g){if(!(w=a.pop()))throw new Error('Unopened section "'+m+'" at '+b);if(w[1]!==m)throw new Error('Unclosed section "'+w[1]+'" at '+b)}else"name"===g||"{"===g||"&"===g?p=!0:"="===g&&y(m)}if(d(),w=a.pop())throw new Error('Unclosed section "'+w[1]+'" at '+j.pos);return function(e){for(var t,n=[],r=n,o=[],i=0,s=e.length;i<s;++i)switch((t=e[i])[0]){case"#":case"^":r.push(t),o.push(t),r=t[4]=[];break;case"/":o.pop()[5]=t[2],r=o.length>0?o[o.length-1][4]:n;break;default:r.push(t)}return n}(function(e){for(var t,n,r=[],o=0,i=e.length;o<i;++o)(t=e[o])&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}(c))}(e,t),o&&n.set(r,i)),i},cc.prototype.render=function(e,t,n,r){var o=this.getConfigTags(r),i=this.parse(e,o),s=t instanceof ac?t:new ac(t,void 0);return this.renderTokens(i,s,n,e,r)},cc.prototype.renderTokens=function(e,t,n,r,o){for(var i,s,a,c="",l=0,u=e.length;l<u;++l)a=void 0,"#"===(s=(i=e[l])[0])?a=this.renderSection(i,t,n,r,o):"^"===s?a=this.renderInverted(i,t,n,r,o):">"===s?a=this.renderPartial(i,t,n,o):"&"===s?a=this.unescapedValue(i,t):"name"===s?a=this.escapedValue(i,t,o):"text"===s&&(a=this.rawValue(i)),void 0!==a&&(c+=a);return c},cc.prototype.renderSection=function(e,t,n,r,o){var i=this,s="",a=t.lookup(e[1]);if(a){if(Ka(a))for(var c=0,l=a.length;c<l;++c)s+=this.renderTokens(e[4],t.push(a[c]),n,r,o);else if("object"==typeof a||"string"==typeof a||"number"==typeof a)s+=this.renderTokens(e[4],t.push(a),n,r,o);else if(Ya(a)){if("string"!=typeof r)throw new Error("Cannot use higher-order sections without the original template");null!=(a=a.call(t.view,r.slice(e[3],e[5]),(function(e){return i.render(e,t,n,o)})))&&(s+=a)}else s+=this.renderTokens(e[4],t,n,r,o);return s}},cc.prototype.renderInverted=function(e,t,n,r,o){var i=t.lookup(e[1]);if(!i||Ka(i)&&0===i.length)return this.renderTokens(e[4],t,n,r,o)},cc.prototype.indentPartial=function(e,t,n){for(var r=t.replace(/[^ \t]/g,""),o=e.split("\n"),i=0;i<o.length;i++)o[i].length&&(i>0||!n)&&(o[i]=r+o[i]);return o.join("\n")},cc.prototype.renderPartial=function(e,t,n,r){if(n){var o=this.getConfigTags(r),i=Ya(n)?n(e[1]):n[e[1]];if(null!=i){var s=e[6],a=e[5],c=e[4],l=i;0==a&&c&&(l=this.indentPartial(i,c,s));var u=this.parse(l,o);return this.renderTokens(u,t,n,l,r)}}},cc.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},cc.prototype.escapedValue=function(e,t,n){var r=this.getConfigEscape(n)||lc.escape,o=t.lookup(e[1]);if(null!=o)return"number"==typeof o&&r===lc.escape?String(o):r(o)},cc.prototype.rawValue=function(e){return e[1]},cc.prototype.getConfigTags=function(e){return Ka(e)?e:e&&"object"==typeof e?e.tags:void 0},cc.prototype.getConfigEscape=function(e){return e&&"object"==typeof e&&!Ka(e)?e.escape:void 0};var lc={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){uc.templateCache=e},get templateCache(){return uc.templateCache}},uc=new cc;lc.clearCache=function(){return uc.clearCache()},lc.parse=function(e,t){return uc.parse(e,t)},lc.render=function(e,t,n,r){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+(Ka(o=e)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)');var o;return uc.render(e,t,n,r)},lc.escape=function(e){return String(e).replace(/[&<>"'`=\/]/g,(function(e){return ec[e]}))},lc.Scanner=sc,lc.Context=ac,lc.Writer=cc;const pc=lc;function hc(e,t={}){const n={};Object.entries(t).forEach((([e,t])=>{switch(t.type){case"link":n[e]=(e=>`<a href='${e.url}' data-link-id='${e.id}' ${e.newTab?'target="_blank"':""}>${e.name}</a>`)(t);break;case"text":n[e]=t.value}}),{});const r=pc.escape;pc.escape=function(e){return e};const o=pc.render(e,n);return pc.escape=r,o}pc.escape=function(e){return e};const fc=["event"];function dc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dc(Object(n),!0).forEach((function(t){bc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const gc=e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,fc);const[r]=ii(t),o=Wa(t.payload.id),s=(0,i.useMemo)((()=>t.payload.fromClient?{children:(0,L.jsx)("p",{children:r.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:hc(Va(r.text),r.variables)}}}),[r,t]);return(0,L.jsx)(na,yc(yc({type:"text",event:t,onClick:o},n),s))};var mc=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],vc=mc.join(","),Oc="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,wc=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:"AUDIO"!==e.nodeName&&"VIDEO"!==e.nodeName&&"DETAILS"!==e.nodeName||null!==e.getAttribute("tabindex")?e.tabIndex:0:t},jc=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},xc=function(e){return"INPUT"===e.tagName},_c=function(e,t){return!(t.disabled||function(e){return xc(e)&&"hidden"===e.type}(t)||function(e,t){if("hidden"===getComputedStyle(e).visibility)return!0;var n=Oc.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Oc.call(n,"details:not([open]) *"))return!0;if(t&&"full"!==t){if("non-zero-area"===t){var r=e.getBoundingClientRect(),o=r.width,i=r.height;return 0===o&&0===i}}else for(;e;){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(t,e.displayCheck)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(xc(e)||"SELECT"===e.tagName||"TEXTAREA"===e.tagName||"BUTTON"===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!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ec=function(e,t){return!(!_c(e,t)||function(e){return function(e){return xc(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||e.ownerDocument,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)||wc(t)<0)},Sc=mc.concat("iframe").join(","),Tc=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Oc.call(e,Sc)&&_c(t,e)};function kc(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 Pc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Cc,Ac=(Cc=[],{activateTrap:function(e){if(Cc.length>0){var t=Cc[Cc.length-1];t!==e&&t.pause()}var n=Cc.indexOf(e);-1===n||Cc.splice(n,1),Cc.push(e)},deactivateTrap:function(e){var t=Cc.indexOf(e);-1!==t&&Cc.splice(t,1),Cc.length>0&&Cc[Cc.length-1].unpause()}}),Ic=function(e){return setTimeout(e,0)},Nc=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},Dc=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},Rc=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},Lc=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kc(Object(n),!0).forEach((function(t){Pc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},t),i={containers:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:o[n||t]},a=function(e){return!(!e||!i.containers.some((function(t){return t.contains(e)})))},c=function(e){var t=o[e];if("function"==typeof t){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];t=t.apply(void 0,i)}if(!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},l=function(){var e=c("initialFocus");if(!1===e)return!1;if(void 0===e)if(a(r.activeElement))e=r.activeElement;else{var t=i.tabbableGroups[0];e=t&&t.firstTabbableNode||c("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},u=function(){if(i.tabbableGroups=i.containers.map((function(e){var t,n,r,o=(n=[],r=[],function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(vc));return t&&Oc.call(e,vc)&&r.unshift(e),r.filter(n)}(e,(t=t||{}).includeContainer,Ec.bind(null,t)).forEach((function(e,t){var o=wc(e);0===o?n.push(e):r.push({documentOrder:t,tabIndex:o,node:e})})),r.sort(jc).map((function(e){return e.node})).concat(n));if(o.length>0)return{container:e,firstTabbableNode:o[0],lastTabbableNode:o[o.length-1]}})).filter((function(e){return!!e})),i.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},p=function e(t){!1!==t&&t!==r.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!o.preventScroll}),i.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(l()))},h=function(e){var t=c("setReturnFocus",e);return t||!1!==t&&e},f=function(e){var t=Rc(e);a(t)||(Dc(o.clickOutsideDeactivates,e)?n.deactivate({returnFocus:o.returnFocusOnDeactivate&&!Tc(t)}):Dc(o.allowOutsideClick,e)||e.preventDefault())},d=function(e){var t=Rc(e),n=a(t);n||t instanceof Document?n&&(i.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),p(i.mostRecentlyFocusedNode||l()))},y=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==Dc(o.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var t=Rc(e);u();var n=null;if(i.tabbableGroups.length>0){var r=Nc(i.tabbableGroups,(function(e){return e.container.contains(t)}));if(r<0)n=e.shiftKey?i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:i.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var o=Nc(i.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(o<0&&i.tabbableGroups[r].container===t&&(o=r),o>=0){var s=0===o?i.tabbableGroups.length-1:o-1;n=i.tabbableGroups[s].lastTabbableNode}}else{var a=Nc(i.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(a<0&&i.tabbableGroups[r].container===t&&(a=r),a>=0){var l=a===i.tabbableGroups.length-1?0:a+1;n=i.tabbableGroups[l].firstTabbableNode}}}else n=c("fallbackFocus");n&&(e.preventDefault(),p(n))}(e)},b=function(e){if(!Dc(o.clickOutsideDeactivates,e)){var t=Rc(e);a(t)||Dc(o.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())}},g=function(){if(i.active)return Ac.activateTrap(n),i.delayInitialFocusTimer=o.delayInitialFocus?Ic((function(){p(l())})):p(l()),r.addEventListener("focusin",d,!0),r.addEventListener("mousedown",f,{capture:!0,passive:!1}),r.addEventListener("touchstart",f,{capture:!0,passive:!1}),r.addEventListener("click",b,{capture:!0,passive:!1}),r.addEventListener("keydown",y,{capture:!0,passive:!1}),n},m=function(){if(i.active)return r.removeEventListener("focusin",d,!0),r.removeEventListener("mousedown",f,!0),r.removeEventListener("touchstart",f,!0),r.removeEventListener("click",b,!0),r.removeEventListener("keydown",y,!0),n};return(n={activate:function(e){if(i.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),o=s(e,"checkCanFocusTrap");o||u(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,t&&t();var a=function(){o&&u(),g(),n&&n()};return o?(o(i.containers.concat()).then(a,a),this):(a(),this)},deactivate:function(e){if(!i.active)return this;clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,m(),i.active=!1,i.paused=!1,Ac.deactivateTrap(n);var t=s(e,"onDeactivate"),r=s(e,"onPostDeactivate"),o=s(e,"checkCanReturnFocus");t&&t();var a=s(e,"returnFocus","returnFocusOnDeactivate"),c=function(){Ic((function(){a&&p(h(i.nodeFocusedBeforeActivation)),r&&r()}))};return a&&o?(o(h(i.nodeFocusedBeforeActivation)).then(c,c),this):(c(),this)},pause:function(){return i.paused||!i.active||(i.paused=!0,m()),this},unpause:function(){return i.paused&&i.active?(i.paused=!1,u(),g(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return i.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),i.active&&u(),this}}).updateContainerElements(e),n};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 Mc(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){$c(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 $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 zc=({children:t,onClose:n,"aria-label":r,"aria-labelledby":o,fallBackFocusRef:s})=>{const a=Kr(),c=(0,i.useRef)(null),l=(0,i.useRef)(null),[u,p]=(0,i.useState)(!1);return(0,i.useEffect)((()=>(u&&(l.current=Lc(c.current,{initialFocus:s&&s.current?s.current:null}),l.current.activate()),()=>{l.current&&l.current.deactivate()})),[u,s]),(0,i.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()}}),[u]),(0,i.useEffect)((()=>{u&&c.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&n()}))}),[u,n]),(0,i.useLayoutEffect)((()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",a),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),r&&t.setAttribute("aria-label",r),o&&t.setAttribute("aria-labelledby",o),e.appendChild(t),c.current=t,p(!0),()=>{c.current&&(e.removeChild(c.current),c.current=null)}}),[r,o,a]),"function"==typeof t?t({onClose:n,modalRenderFn:t=>c.current&&(0,e.render)(t,c.current)}):c.current&&(0,e.render)((0,e.toChildArray)(t).map((e=>(e.props=Mc(Mc({},e.props),{},{onClose:n}),e))),c.current)},Bc=({url:e,description:t,onClose:n})=>{const{zIndex:r,layoutMode:o,namespace:s}=ee(),a=Co(),c=er(),l=(0,i.useRef)(null),{t:u}=wr(),p=["modal",`app--layout-${o}`,`namespace--${s}`,...c],h=e=>{e.stopPropagation()},f=()=>{n()},d=r?{zIndex:r+1}:void 0;return(0,L.jsx)(zc,{onClose:n,"aria-label":u("lightbox.heading"),fallBackFocusRef:l,children:({onClose:n,modalRenderFn:r})=>r((n=>(0,L.jsx)("div",{className:Wn(p),onClick:f,style:d,children:(0,L.jsxs)("div",{className:Wn("modal__float"),tabIndex:"-1",onMouseDown:a,onKeyDown:a,onTouchStart:a,onMouseMove:a,onWheel:a,onPointerDown:a,onPointerMove:a,ref:l,children:[(0,L.jsx)("div",{className:Wn("modal__inner"),onClick:h,children:(0,L.jsx)("img",{className:Wn("modal__image"),src:e,alt:t})}),(0,L.jsxs)("button",{type:"button",className:Wn("modal__close"),onClick:n,children:[(0,L.jsx)(fi,{name:"close",size:"16"}),u("lightbox.closeLabel")]})]})}))(n))})},Fc=({description:e,url:t})=>{const{t:n}=wr(),[r,o]=(0,i.useState)(!1);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("button",{type:"button",className:Wn("modal__enlarge"),onClick:()=>{o(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),(0,L.jsx)(fi,{name:"enlarge",size:"32"})]}),r&&(0,L.jsx)(Bc,{url:t,description:e,onClose:()=>{o(!1)}})]})},Hc=["event","descriptorId"];function qc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qc(Object(n),!0).forEach((function(t){Wc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function 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 Gc=["event","descriptorId"];function Kc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kc(Object(n),!0).forEach((function(t){Jc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kc(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}const Qc={[Le.new_topic]:"newtopic"},Zc=["event"];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 el(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const tl={default:({event:e})=>{const{t}=wr(),{subtype:n}=e.payload.body,r=Qc[Le[n]];return(0,L.jsx)(Vs,{dividerType:r,iconName:Le[n],children:(0,L.jsx)("p",{children:t(`dividerKeys.${Le[n]}`)})})},[Le.new_translation]:({event:e})=>{const{t}=wr(),{translationEnabled:n,translationLocale:r,text:o}=e.payload.body,{enableTranslations:s,languages:a}=oi(),c=(0,i.useMemo)((()=>{var e;return null==a||null===(e=a.find((e=>e.locale===r)))||void 0===e?void 0:e.nativeName}),[a,r]);return(0,L.jsxs)(Vs,{iconName:"newTranslation",dividerType:"newtranslation",children:[(0,L.jsx)("p",{className:Wn("divider__title"),children:t(n?"translations.divider.startText":"translations.divider.stopText",{language:c})}),n?(0,L.jsx)("p",{children:o}):(0,L.jsx)("button",{className:Wn("button","button--secondary"),onClick:()=>{s(r)},children:t("translations.divider.restartButtonText")})]})}},nl=["event"];function rl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ol(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rl(Object(n),!0).forEach((function(t){il(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function il(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const sl=["event"];function al(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 cl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?al(Object(n),!0).forEach((function(t){ll(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):al(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ll(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ul=["event"];function pl(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 hl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pl(Object(n),!0).forEach((function(t){fl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const dl=({children:e,url:t,target:n})=>t?(0,L.jsx)("a",{href:t,download:!0,target:n||void 0,className:Wn(["download","download-link"]),children:e}):(0,L.jsx)("span",{className:Wn("download"),children:e});function yl({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:o}){const s=e.length,a=(0,i.useCallback)((e=>{const r=Number(e.target.dataset.item||"0"),o=Math.min(s-1,Math.max(0,r));o!==t&&n(o)}),[s,t,n]);return(0,L.jsx)("div",{className:Wn("carousel-pagination__wrapper"),role:"group",children:(0,L.jsx)("ul",{className:Wn("carousel-pagination"),children:e.map(((e,n)=>{const i=t===n;return(0,L.jsx)("li",{className:Wn("carousel-pagination__item",i?"is-active":void 0),children:(0,L.jsx)("button",{className:Wn("carousel-pagination__button"),type:"button",onClick:a,"data-item":n,"aria-disabled":i?"true":void 0,"aria-label":o(e,n)})},r(e,n,"pagination-item-"))}))})})}function bl({items:e,currentIndex:t,onChange:n,children:r}){const{t:o}=wr(),i=e.length;return(0,L.jsxs)("div",{className:Wn("carousel-controls"),children:[(0,L.jsx)("button",{className:Wn("button","button--previous"),"aria-label":o("carousel.controls.previous"),onClick:()=>{n((t-1+i)%i)},children:(0,L.jsx)(fi,{name:"arrowLeft",size:"16"})}),r,(0,L.jsx)("button",{className:Wn("button","button--next"),"aria-label":o("carousel.controls.next"),onClick:()=>{n((t+1)%i)},children:(0,L.jsx)(fi,{name:"arrowRight",size:"16"})})]})}function gl(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 ml(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gl(Object(n),!0).forEach((function(t){vl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ol=({id:e,action:t,buttonText:n,description:r,hasFocus:o,image:s,title:a,isCarouselItem:c})=>{const l=(0,i.useRef)(null),{sendMessage:u,sendAction:p,emitEvent:h}=So(),f=Kr(),d=(0,i.useRef)(),y=t.type===$e?"a":"button",b=(0,i.useCallback)((()=>h("action.click_card",{type:Ne,originMessage:e,action:t})),[h,e,t]),g=(0,i.useCallback)((()=>{if(b(),"ask"===t.type)u({body:t.ask});else if("topic"===t.type){const{topic:e,fallbackMessage:n}=t;p({type:"set_topic",body:{name:e,fallbackMessage:n}})}}),[u,t,p,b]),m=(0,i.useMemo)((()=>t.type===$e?{href:t.link,rel:"noopener noreferrer",target:t.newTab?"_blank":"_self",onClick:b}:{onClick:g}),[t,g,b]);return(0,i.useEffect)((()=>{c&&(o&&d.current?window.requestAnimationFrame((()=>l.current.focus())):l.current.blur()),d.current=!0}),[o,c]),(0,L.jsxs)("div",{className:Wn("card__wrapper"),id:e,tabIndex:"-1",ref:l,children:[(0,L.jsx)("img",{className:Wn("card__image"),src:s,alt:""}),(0,L.jsxs)("div",{className:Wn("card__content"),id:e,children:[a&&(0,L.jsx)("h2",{className:Wn("card__title"),children:a}),r&&(0,L.jsx)("div",{className:Wn("card__description"),dangerouslySetInnerHTML:{__html:Va(r)}}),(0,L.jsx)(y,ml(ml({tabIndex:c&&!o?"-1":void 0,className:Wn("button","button--primary"),"aria-describedby":f},m),{},{children:n}))]})]})};function wl(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 jl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wl(Object(n),!0).forEach((function(t){xl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _l({item:e,items:t,index:n,isActive:r}){const{t:o}=wr();return(0,L.jsx)("div",{className:Wn("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":o("carousel.slide.label",{index:n+1,total:t.length}),children:(0,L.jsx)(Ol,jl(jl({},e),{},{isCarouselItem:!0,hasFocus:r}))})}const El=(e,t,n)=>`${n}${t}`,Sl=e=>e.label,Tl=({target:e})=>{e.scrollLeft=0};function kl({currentIndex:t,onChange:n,getItemKey:r=El,getItemLabel:o=Sl,items:s}){const a=Kr(),c=s.length,[l,u]=(0,i.useState)(Number(t||"0"));(0,i.useEffect)((()=>{u(Number(t||"0"))}),[u,t]);const p=(0,i.useRef)([]);p.current=(0,i.useMemo)((()=>Array(c).fill(1).map((()=>(0,e.createRef)()))),[c]);const h=(0,i.useRef)(!0),f=(0,i.useRef)();return f.current=n,(0,i.useEffect)((()=>{h.current?h.current=!1:f.current&&f.current(l)}),[l]),(0,L.jsxs)("div",{className:Wn("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,L.jsx)("div",{className:Wn("carousel__slides-wrapper"),onScroll:Tl,children:(0,L.jsx)("div",{id:a,className:Wn("carousel__slides"),style:{width:100*c+"%",left:-100*l+"%"},"aria-live":"polite","aria-atomic":"false",children:s.map(((e,t)=>{const n=l===t;return(0,L.jsx)("div",{ref:p.current[t],className:Wn("carousel__slide",n?"is-active":void 0),"aria-hidden":n?void 0:"true",children:(0,L.jsx)(_l,{item:e,items:s,currentIndex:l,index:t,isActive:n})},r(e,t,"item-"))}))})}),(0,L.jsx)("div",{className:Wn("carousel__controls"),children:(0,L.jsx)(bl,{currentIndex:l,items:s,onChange:u,controlId:a,children:(0,L.jsx)("div",{className:Wn("carousel__pagination"),children:(0,L.jsx)(yl,{currentIndex:l,items:s,onChange:u,getItemKey:r,getItemLabel:o})})})})]})}const Pl=(e,t,n="")=>`${n}${e.title}:${t}`,Cl=e=>e.title;function Al(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 Il(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Al(Object(n),!0).forEach((function(t){Nl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Al(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Nl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Dl=["event"];function Rl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ll(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rl(Object(n),!0).forEach((function(t){Ul(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ul(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ml(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 $l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ml(Object(n),!0).forEach((function(t){zl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ml(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Bl={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,ra);const{t:i}=wr(),s=Kr(),{body:a,subEvent:c,showOptions:l,chooseAgain:u,onChoiceClickHandler:p,onChooseAgainClickHandler:h}=aa(n);return(0,L.jsxs)(L.Fragment,{children:[(0,e.toChildArray)(r).map((e=>(e.props=ia(ia({},e.props),{},{event:c,descriptorId:s,showTranslationToggle:!1}),e))),u&&(0,L.jsxs)("button",{type:"button",className:Wn("button","button--secondary","button--choose-again"),"aria-expanded":l?"true":"false",onClick:h,"aria-describedby":s,children:[i(l?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,L.jsx)(fi,{name:"chevronDown",size:"8"})]}),l&&(0,L.jsx)(na,ia(ia({type:"choice-prompt",showParticipant:!1,event:n},o),{},{children:(0,L.jsx)("ul",{className:Wn("choice-prompt","choice-prompt--many"),children:a.choices.map((e=>(0,L.jsx)("li",{className:Wn("choice-prompt__item",{[`choice-prompt__item--${e.category}`]:e.category}),children:(0,L.jsx)("button",{type:"button",className:Wn("button","button--primary"),onClick:()=>{p(e)},children:e.text})},e.id)))})}))]})},text:gc,image:e=>{let{event:t,descriptorId:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Hc);const[o]=ii(t),{description:s,url:a,isZoomable:c}=o,[l,u]=(0,i.useState)(!1);return(0,L.jsxs)(na,Vc(Vc({event:t,type:"image"},r),{},{children:[(0,L.jsx)("img",{src:a,id:n,alt:s,onLoad:()=>{u(!0)}}),c&&l&&(0,L.jsx)(Fc,{description:s,url:a})]}))},splash:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,sl);const{payload:r}=t,[o]=ii(t),i=Wa(r.id);return(0,L.jsx)(na,cl(cl({type:"splash",event:t,onClick:i},n),{},{bodyProps:{dangerouslySetInnerHTML:{__html:hc(Va(o.text),o.variables)}}}))},video:e=>{let{event:t,descriptorId:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Gc);const[o]=ii(t),{description:i,url:s}=o;return tr(t).push("message--type-video"),(0,L.jsxs)(na,Yc(Yc({event:t,type:"video"},r),{},{children:[(0,L.jsx)("div",{id:n,className:Wn("visually-hidden"),children:i}),(0,L.jsx)("iframe",{title:i,src:s,allow:"autoplay; encrypted-media",allowFullScreen:!0})]}))},upload:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ul);const{t:r}=wr(),[o]=ii(t),{fromClient:s}=t.payload,{filename:a,url:c}=o,l=(0,i.useMemo)((()=>r(c?"fileUpload.srFileDownloadText":"fileUpload.srFileUploadedText",{fileName:a})),[c,a,r]);return(0,L.jsx)(na,hl(hl({event:t,type:"upload"},n),{},{children:(0,L.jsxs)(dl,{url:c,target:s?void 0:"_blank",children:[(0,L.jsx)(fi,{name:"download",size:"16"}),(0,L.jsx)("span",{"aria-hidden":"true",className:Wn("file-download"),children:a}),(0,L.jsx)("span",{className:Wn("visually-hidden"),children:l})]})}))},cta:({event:e})=>{const[t]=ii(e),n=Wa(e.payload.id),{emitEvent:r}=So(),o=Kr(),s=(0,i.useCallback)((()=>r("action.click_cta",{type:Ne,originMessage:e.payload.id,link:{url:t.buttonLink}})),[r,t,e]);return(0,L.jsxs)(na,{type:"cta",event:e,children:[(0,L.jsx)("div",{className:Wn("cta__content"),id:o,dangerouslySetInnerHTML:{__html:Va(t.description)},onClick:n}),(0,L.jsx)("a",{className:Wn("button","button--primary"),"aria-describedby":o,href:t.buttonLink,rel:"noreferrer",target:t.buttonNewTab?"_blank":"_self",onClick:s,children:t.buttonText})]})},carousel:({event:e})=>{const[t]=ii(e),n=t.cards;return(0,L.jsx)(na,{event:e,modifiers:"type-carousel",children:(0,L.jsx)(kl,{items:n,ItemComponent:_l,getItemKey:Pl,getItemLabel:Cl})})},card:({event:e})=>{const[t]=ii(e),n=Kr();return(0,L.jsx)(na,{type:"card",event:e,children:(0,L.jsx)(Ol,Il({id:n},t))})}},info:{text:gc,divider:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Zc);const r=tl[Le[t.payload.body.subtype]]||tl.default;return(0,L.jsx)(r,function(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){el(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}({event:t},n))},translation:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,nl);const{t:r}=wr(),[o]=ii(t);return(0,L.jsx)(na,ol(ol({type:"text",event:t},n),{},{children:r(o.key.join("."),o.variables)}))},timeIndicator:Ks},participant:{participant:({event:e})=>{const{agent:t}=function(){const{agentParticipant:e,userParticipant:t}=Z(A);return{agent:e,user:t}}(),{participant:n}=e.payload,[r]=ii(e),o=(0,i.useMemo)((()=>r?pc.render(Va(r),n):void 0),[r,n]);if(!o)return null;const s=n.avatar||(null==t?void 0:t.avatar);return(0,L.jsx)(Vs,{graphicSrc:s,graphicType:n.avatar?"avatar":void 0,iconName:s?void 0:"balloon",childrenHTML:o,dividerType:"participant"})}},service_data:{suggestion:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Dl);const{userResponded:r}=ee(),[o,s]=(0,i.useState)(!0),{t:a}=wr(),c=a("suggestions.headingText"),l=a("suggestions.footerText"),{sendAction:u,addMessageBubble:p}=So(),{suggestions:h,payload:f}=(e=>{const{payload:t}=e,[n]=ii(e);return{suggestions:n,payload:t}})(t),d=(0,i.useCallback)((({id:e,question:t})=>{s(!1),u({type:ke,originMessage:f.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),p(t)}),[f,u,p,s]);return!o||r?null:(0,L.jsxs)("div",{className:Wn("suggestions","suggestions--conversation"),children:[c&&(0,L.jsx)("p",{className:Wn("suggestions__heading"),children:c}),(0,L.jsxs)(na,Ll(Ll({type:"suggestions",showParticipant:!1,event:t},n),{},{children:[(0,L.jsx)(Ls,{className:"suggestions__list--conversation",onClickSuggestion:d,suggestions:h}),l&&(0,L.jsx)("p",{className:Wn("suggestions__footer"),children:l})]}))]})}}},Fl=({children:e})=>{const{customComponents:t}=ee(),n=(0,i.useMemo)((()=>Object.keys(Bl).reduce(((e,n)=>$l($l({},e),{},{[n]:$l($l({},Bl[n]),t?t[n]:{})})),{fallback:gc})),[t]);return(0,L.jsx)(zs.Provider,{value:n,children:e})},Hl=()=>{const{t:e}=wr(),{showDisclaimer:t}=ee();return t&&(0,L.jsxs)("div",{className:Wn("disclaimer"),tabIndex:"0",children:[(0,L.jsx)("h2",{className:Wn("disclaimer__title"),children:e("disclaimer.title")}),(0,L.jsx)("div",{className:Wn("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]})},ql=()=>{const{t:e}=wr(),t=(0,i.useRef)(null),n=hn(),r=ln().isLoading,{isOpen:o}=yo(),s=yn(),a=Ar();return(0,i.useEffect)((()=>{window.requestAnimationFrame((()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)}))}),[n,r,o]),(0,L.jsxs)(L.Fragment,{children:[o&&(0,L.jsx)("a",{className:Wn("skip-link"),href:`#${s}`,onClick:e=>{e.preventDefault(),a()},children:e("skiplinkText")}),(0,L.jsx)("div",{className:Wn("chat__body"),ref:t,children:(0,L.jsxs)("div",{className:Wn("conversation__container"),children:[(0,L.jsx)(Hl,{}),(0,L.jsxs)("ol",{className:Wn("conversation"),children:[(0,L.jsx)(Fl,{children:(()=>{let e=null;return n.map((t=>{const{type:n,payload:r}=t,{participant:o,fromClient:i}=r;let s=!1;if("participant"!==n){const n=i?"seamly-client-participant":o;"info"!==t.type&&e!==n&&(s=!0),e=n}return(0,L.jsx)(Ys,{event:t,newParticipant:s},t.payload.id)}))})()}),r&&(0,L.jsx)(Qs,{})]})]})})]})},Vl=({baseClassName:e,children:t,title:n})=>{const r=yn(),o=Kr();return(0,L.jsxs)("section",{id:r,className:Wn(e),"aria-describedby":o,tabIndex:"-1",children:[(0,L.jsx)("h2",{className:Wn(`${e}__title`),id:o,children:n}),t]})},Wl=()=>{const{t:e}=wr(),t=Ar(),n=Co(),{emitEvent:r}=So(),{isActive:o,remaining:i,timer:s,endCountdown:a}=Wo(),c=i>0,l=e(c?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,L.jsx)(Vl,{baseClassName:"idle",title:l,children:c&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:Wn("idle__count-container"),children:o&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("span",{className:Wn("idle__count-text"),children:e("idleDetachWarning.countdownText")}),(0,L.jsx)("span",{className:Wn("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",s)})]})}),(0,L.jsxs)("div",{className:Wn("idle__options"),children:[(0,L.jsx)("button",{type:"button",className:Wn("button","button--primary"),onClick:()=>{n(),a(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),(0,L.jsx)("button",{type:"button",className:Wn("button","button--primary"),onClick:()=>{a(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},Gl=()=>{const{t:e}=wr(),t=Co(),{name:n}=gn()||{},{continueChat:r,restartChat:o}=Ko();return(0,L.jsx)(Vl,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:(0,L.jsxs)("div",{className:Wn("prompt__options"),children:[(0,L.jsx)("button",{type:"button",className:Wn("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),(0,L.jsx)("button",{type:"button",className:Wn("button","button--primary"),onClick:o,children:e("resumeConversationPrompt.detachButton")})]})})},Kl=["id","name","type","labelText","labelClass","contentHint","aria-describedby"];function Yl(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 Jl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yl(Object(n),!0).forEach((function(t){Ql(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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 Zl=function(e){let{id:t,name:n,type:r,labelText:o,labelClass:i,contentHint:s,"aria-describedby":a}=e,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Kl);const{isSubmitted:l}=$i(),[u,{error:p}]=zi(n),h=l&&p,f=[];return a&&f.push(a),s&&f.push(`${t}-content-hint`),h&&f.push(`${t}-error`),(0,L.jsx)(is,{id:t,contentHint:s,validity:!h,errorText:p,labelText:o,labelClass:i,children:(0,L.jsx)("input",Jl(Jl({id:t,name:n,type:r,"aria-invalid":h?"true":"false","aria-describedby":f.join(" ")||null},u),c))})};function Xl({controlName:e,skipLinkId:t}){const{t:n}=wr(),{sendAssertive:r}=ko(),{emitEvent:o}=So(),s=(()=>{const{sendAction:e}=So(),{features:t}=$r(),{typingPeekahead:n}=t||{},r=(0,i.useRef)(null),o=(0,i.useRef)(null),s=(0,i.useRef)(!1),a=(0,i.useRef)(null);(0,i.useEffect)((()=>()=>{clearInterval(a.current),clearTimeout(r.current),clearTimeout(o.current)}),[]);const c=(t,r)=>{e(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ao(Object(n),!0).forEach((function(t){Io(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ao(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({type:Pe,state:t},n&&n.enabled?{body:{currentMessage:r}}:{}))};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(s.current=!0,a.current||(c(!0,e.target.value),a.current=setInterval((()=>{s.current?n&&n.enabled&&c(!0,e.target.value):(clearInterval(a.current),a.current=null)}),2e3)),clearTimeout(r.current),clearTimeout(o.current),r.current=setTimeout((()=>{s.current=!1}),300),o.current=setTimeout((()=>{c(!1,e.target.value)}),2e3))}})(),{setBlockAutoEntrySwitch:a}=Lo(),{hasCharacterLimit:c,characterLimit:l,reachedCharacterWarning:u,reachedCharacterLimit:p,remainingChars:h}=function(e){const{t}=wr(),{sendAssertive:n}=ko(),{hasLimit:r,limit:o}=(()=>{const{entryMeta:{options:{text:e}}}=ln(),{limit:t}=e||{};return{hasLimit:null!=t,limit:null!=t?t:null}})(),s=(0,i.useMemo)((()=>ce(n,300)),[n]),a=(0,i.useMemo)((()=>ce(((e,n)=>{e&&s(t("input.srCharacterLimitText",{limit:n}))}),300)),[s,t]),[{value:c}]=zi(e),l=r&&c?o-c.length:o,u=!!r&&l<=50,p=!!r&&l<0;return(0,i.useEffect)((()=>{a(u,l)}),[u,l,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:u,reachedCharacterLimit:p,remainingChars:l}}(e),[{value:f}]=zi(e),d=!!f,y=(0,i.useCallback)((()=>{u&&r(n("input.srCharacterLimitText",{limit:h})),o("ui.inputFocus")}),[n,r,u,h,o]),b=(0,i.useMemo)((()=>n("input.inputPlaceholder",{hasLimit:c,limit:c?l:null})),[n,c,l]),g=(0,i.useMemo)((()=>n("input.inputLabel",{hasLimit:c,limit:c?l:null})),[n,c,l]);return(0,i.useLayoutEffect)((()=>(a(d),()=>{a(!1)})),[a,d]),(0,L.jsxs)(rs,{className:Wn("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,L.jsxs)("div",{className:Wn(["input--text__container",...u&&!p?["character-warning"]:[],...p?["character-exceeded"]:[]]),children:[(0,L.jsx)(Zl,{id:t,type:"text",name:e,className:Wn("input__text"),autocomplete:"off",placeholder:b,labelText:g,labelClass:Wn("visually-hidden"),"aria-invalid":c?p:null,onKeyUp:s,onFocus:y}),(0,L.jsx)("div",{className:Wn("character-count"),children:u&&(0,L.jsx)("span",{children:h})})]}),(0,L.jsx)("button",{className:Wn("button","input__submit"),type:"submit","aria-disabled":!d||p?"true":null,children:(0,L.jsx)(fi,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}function eu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tu(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){nu(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 nu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ru(){return(ru=Object.assign||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}).apply(this,arguments)}const ou="userText";function iu(e){let t=ru({},e);const{isOpen:n,setVisibility:r}=yo(),o=yn(),s=Ar(),{sendMessage:a}=So(),c=(0,i.useCallback)(((e,{updateControlValue:t})=>{a({body:e.userText}),t(ou,""),s(),n||r(T.open)}),[a,s,n,r]);return(0,L.jsx)(Vi,tu(tu({},t),{},{formId:"textEntry",persistData:!0,onSubmit:c,children:(0,L.jsx)(Xl,{controlName:ou,skipLinkId:o})}))}const su=()=>{const{t:e}=wr(),{showFileUpload:t,serviceAllowsUploads:n}=Wr(),[r,o]=(0,i.useState)(n),s=Ar(),a=(0,i.useRef)(null),{setUserEntryType:c,activeEntry:l}=Lo(),u=(0,i.useRef)(null),{sendPolite:p}=ko(),h=!!gn();return(0,i.useEffect)((()=>{me(u.current,(()=>{n||s()})),o(n)}),[n,s]),(0,i.useEffect)((()=>{a.current&&!n&&p(e("fileUpload.srUnavailableText")),!1===a.current&&n&&p(e("fileUpload.srAvailableText")),h&&(a.current=n)}),[n,h,p,e]),!t&&l!==Ee&&(0,L.jsx)(vi,{isActive:r,transitionStartState:gi,children:(0,L.jsx)("div",{className:Wn("upload-toggle-wrapper"),children:(0,L.jsx)(vi,{isActive:r,transitionStartState:mi,children:(0,L.jsx)("button",{className:Wn(["button","button--secondary","upload-toggle"]),ref:u,"aria-disabled":r?null:"true",type:"button",onClick:r?()=>{c(Ee),s()}:null,children:(0,L.jsx)(fi,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})},au=()=>{const{t:e}=wr(),{currentUploads:t}=Gr();return(0,L.jsx)("div",{className:Wn("progress"),children:t.map((({id:t,name:n,progress:r,uploading:o,error:i})=>(0,L.jsxs)("div",{className:Wn("progress_container"),children:[(0,L.jsxs)("div",{className:Wn("progress__text"),children:[(0,L.jsx)("span",{className:Wn("progress__text--file-name"),children:n}),(0,L.jsx)("span",{className:Wn("progress__text--percentage"),children:`${r}%`})]}),(0,L.jsx)(os,{error:i}),(0,L.jsx)("progress",{className:Wn("progress__bar"),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-label":e("fileUpload.srProgressLabel",{fileName:n}),max:"100","aria-valuenow":r,value:r,"aria-busy":o,children:`${r}%`})]},t)))})};function cu({id:e,name:t,labelText:n,contentHint:r,outputText:o,accept:s}){const{isSubmitted:a}=$i(),[c,l]=(0,i.useState)(!1),[{onInput:u,onBlur:p},{error:h}]=zi(t),f=Kr(),d=Kr(),y=Kr(),b=a&&h,g=[y];r&&g.push(d),b&&g.push(f);const m=(0,i.useCallback)((()=>{l(!0)}),[l]),v=(0,i.useCallback)((()=>{l(!1),p()}),[l,p]),O=(0,i.useCallback)((e=>{const t={target:{value:e.target.files}};u(t)}),[u]);return(0,L.jsxs)("div",{className:Wn("upload__container"),children:[r&&(0,L.jsx)("span",{className:Wn("upload__content-hint"),id:d,children:r}),(0,L.jsx)(os,{id:f,error:b&&h}),(0,L.jsx)("div",{className:Wn(["file-upload",...c?["focus-within"]:[]]),children:(0,L.jsxs)("label",{htmlFor:e,className:Wn("upload__label"),children:[(0,L.jsx)(fi,{name:"upload",size:"32"}),(0,L.jsxs)("div",{children:[(0,L.jsx)("span",{className:Wn(["upload__label--text"]),children:n}),(0,L.jsx)("input",{id:e,className:Wn("upload__input"),type:"file",name:t,onChange:O,"aria-invalid":b?"true":"false","aria-describedby":g.join(" "),accept:s||null,onFocus:m,onBlur:v}),(0,L.jsx)("span",{className:Wn("upload__output"),"aria-hidden":"true",id:y,children:o})]})]})})]})}function lu({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:o,isComplete:i,onClickCancel:s}){const{t:a}=wr(),[{value:c}]=zi(t),l=c&&c.length>0,u=l?c[0].name:"";return(0,L.jsxs)(rs,{className:Wn("upload-form"),children:[(0,L.jsx)(cu,{name:t,id:e,accept:n,labelText:a("fileUpload.labelText"),outputText:a("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),(0,L.jsxs)("div",{className:Wn("upload__button-container"),children:[(0,L.jsx)("button",{id:o||!i?e:void 0,type:"button",onClick:s,className:Wn("button","button--secondary","upload__cancel"),children:a("fileUpload.cancelButtonText")}),(0,L.jsx)("button",{className:Wn("button","button--primary"),type:"submit",children:a("fileUpload.uploadButtonText")})]})]})}const uu="fileListForm",pu="fileList",hu=()=>{const{t:e}=wr(),{sendPolite:t,sendAssertive:n}=ko(),r=yn(),o=Ar(),{serviceAllowsUploads:s,allowedMimeTypes:a,maxSize:c}=Wr(),l=(0,i.useRef)(null),u=(0,i.useRef)(s),{cancelEntrySelection:p}=Lo(),{uploadFile:h,clearUploads:f,isUploading:d,isComplete:y}=Gr(),{hasFile:b,selectedFileName:g,uploadHandle:m,hasServerError:v,progress:O}=((e,t)=>{const n=X(Ni,{formId:e,name:t},[e,t]),{currentUploads:r}=Gr(),o=n&&n.length>0;let i=null,s=!1,a=0;if(r&&r.length>0){const e=r[0];i=e.uploadHandle,s=!!e.error,a=e.progress}return{hasFile:o,selectedFileName:o?n[0].name:"",uploadHandle:i,hasServerError:s,progress:a}})(uu,pu),w=Kr(),j=(0,i.useRef)(!0),x=e("fileUpload.contentHint",{size:pe(c)}),_=(0,i.useRef)(""),E=(0,i.useRef)(null);(0,i.useEffect)((()=>{_.current&&E.current.contains(document.activeElement)&&"INPUT"===document.activeElement.tagName&&n(x),_.current=x}),[x,n]),(0,i.useEffect)((()=>{if(O>0)switch(O){case 1:t(e("fileUpload.srStartedText"));break;default:t(`${O}%`)}}),[O,t,e]),(0,i.useEffect)((()=>{j.current||d||!y||(f(),p(),o(),setTimeout((()=>{t(e("fileUpload.srCompleteText"))}),300)),j.current=y}),[d,y,f,p,o,t,e]);const S=(0,i.useCallback)((({fileList:e})=>{h(e[0]),o()}),[h,!1,o]),T=(0,i.useCallback)((()=>{m&&m.abort(),f(),p(),o()}),[m,f,p,o]),k=(0,i.useMemo)((()=>({[pu]:[ws((()=>s),e("fileUpload.errors.unavailable")),ws(xs,e("fileUpload.errors.noFile")),ws(js,e("fileUpload.errors.tooLarge"),c)]})),[c,s,e]);return(0,L.jsx)("div",{className:Wn(["upload",...v?["upload--error"]:[]]),ref:E,children:(0,L.jsxs)(Vi,{formId:uu,persistData:!0,onSubmit:S,validationSchema:k,children:[(d||!y)&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(au,{}),(0,L.jsx)("div",{className:Wn("upload__button-container"),children:(0,L.jsx)("button",{id:d||!y?r:void 0,type:"button",onClick:T,ref:l,className:Wn("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!d&&y&&(0,L.jsx)(lu,{controlName:pu,skiplinkId:r,accept:a.join(", "),contentHint:x,isComplete:y,isUploading:d,outputText:e("fileUpload.selectedText",{hasFile:b,filename:g}),onClickCancel:T}),!u.current&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("span",{className:Wn("notification"),id:w,children:e("fileUpload.unavailableText")}),(0,L.jsx)("div",{className:Wn("upload__button-container"),children:(0,L.jsx)("button",{id:d||!y?r:void 0,type:"button",onClick:T,className:Wn("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})};function fu(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 du(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fu(Object(n),!0).forEach((function(t){yu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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 bu=()=>{const{isOpen:e}=yo(),t=(0,i.useRef)(null),{hasCountdown:n}=Wo(),[r,o]=(0,i.useState)(n),{hasPrompt:s}=Ko(),[a,c]=(0,i.useState)(s),l=Ar(),u=(0,i.useRef)(!1),{activeEntry:p}=Lo(),[h,f]=(0,i.useState)({text:iu,upload:hu}),[d,y]=(0,i.useState)((()=>p)),b=ee(),{accountAllowsUploads:g}=Wr(),m=(0,i.useCallback)((()=>{me(t.current,(()=>{l()}))}),[l]);(0,i.useEffect)((()=>{const{customComponents:e}=b,{entry:t}=e||{};t&&f((e=>du(du({},e),t)))}),[b]),(0,i.useEffect)((()=>{m(),o(n),c(s)}),[n,s,m]),(0,i.useEffect)((()=>{y(p),m()}),[p,m,t]),u.current=!(!t.current||!t.current.contains(document.activeElement));const v=h[d];return(0,L.jsxs)("div",{className:Wn("chat__entry"),ref:t,children:[r&&(0,L.jsx)(Wl,{}),a&&(0,L.jsx)(Gl,{}),(0,L.jsxs)("div",{className:Wn(["entry__body",...n||s?["entry__body--hidden"]:[]]),children:[d!==Ee&&g&&e&&(0,L.jsx)(su,{}),(0,L.jsx)(v,{})]})]})};function gu({controlName:e,describedById:t}){const{t:n}=wr();return(0,L.jsxs)(rs,{noValidate:"true",className:Wn("options__form"),children:[(0,L.jsx)(Zl,{name:e,type:"email",className:Wn("transcript__input"),"aria-describedby":t,labelClass:Wn("label"),labelText:n("options.sendTranscript.label")}),(0,L.jsx)("div",{className:Wn("options__actions"),children:(0,L.jsx)("button",{type:"submit",className:Wn("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const mu="email",vu={sendTranscript:()=>{const[e,t]=(0,i.useState)(void 0),{hideOption:n}=$r(),{focusButton:r}=zr(),{t:o}=wr(),s=Kr(),{sendAction:a}=So(),c=(0,i.useMemo)((()=>({[mu]:[ws(Es,o("options.sendTranscript.noEmailText")),ws(_s,o("options.sendTranscript.invalidEmailText"))]})),[o]),l=(0,i.useCallback)((e=>{const t=e.email.trim();a({type:"send_transcript",body:{emailAddress:t}}),n(),r()}),[a,n,r]),u=(0,i.useCallback)((({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)}),[t]);return(0,L.jsxs)(Oi,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),children:[(0,L.jsx)("p",{className:Wn("options__description"),id:s,children:o("options.sendTranscript.description")}),(0,L.jsx)(Vi,{formId:"sendTranscript",onSubmit:l,validationSchema:c,onError:u,children:(0,L.jsx)(gu,{controlName:mu,describedById:s})})]})}},Ou=()=>{const{optionActive:e}=$r(),t=(0,i.useRef)(null),n=vu[e||t.current];return e&&(t.current=e),n?(0,L.jsx)(n,{}):null},wu=()=>{const{t}=wr(),{menuOptions:n,showOption:r,panelActive:o,hideOption:s}=$r(),{id:a}=zr(),c=(0,i.useRef)(null),[l,u]=(0,i.useState)(!1),p=(0,i.useRef)(null),h=n.length,f=(0,i.useRef)(Array.from({length:h},(()=>(0,e.createRef)()))),d=(0,i.useRef)(!1),y=h>1,b=n[0],g=(0,i.useMemo)((()=>{var e;return null==b||null===(e=b.name)||void 0===e?void 0:e.trim().replace(/\s+/g,"")}),[b]);return(0,i.useEffect)((()=>()=>{clearTimeout(c.current)}),[]),(0,i.useEffect)((()=>{l&&!d.current&&requestAnimationFrame((()=>{requestAnimationFrame((()=>{const e=n.findIndex((e=>e.available)),t=-1===e?0:e;ge(f.current[t])}))})),d.current=l}),[l,n]),h?(0,L.jsxs)("div",{className:Wn("options__container"),onKeyDown:e=>{l&&(be(e)===ye.Escape&&(u(!1),ge(p.current)),be(e)===ye.Home&&(ge(f.current[0]),e.preventDefault()),be(e)===ye.End&&(ge(f.current[h-1]),e.preventDefault()))},onfocusout:()=>{y&&(c.current=setTimeout((()=>{u(!1)}),200))},onfocusin:()=>{clearTimeout(c.current)},children:[(0,L.jsx)(vi,{transitionStartState:bi,isActive:o,children:(0,L.jsx)("div",{className:Wn("options__dialog"),children:(0,L.jsx)(Ou,{})})}),y&&(0,L.jsx)(vi,{isActive:l,transitionStartState:bi,children:(0,L.jsx)("ul",{className:Wn(["options__menu"]),role:"menu",tabIndex:"-1","aria-labelledby":a,children:n.map((({name:e,title:o,available:i},s)=>(0,L.jsx)("li",{className:Wn("options__menu__item"),role:"menuitem","data-testid":e,children:(0,L.jsxs)("button",{type:"button",ref:e=>{f.current[s]=e},className:Wn(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(be(e)===ye.ArrowDown){const n=Math.min(h-1,t+1);ge(f.current[t===n?0:n]),e.preventDefault()}if(be(e)===ye.ArrowUp){const n=Math.max(0,t-1);ge(f.current[t===n?h-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&&ge(f.current[o])})(e,s),onClick:()=>((e,t)=>{t&&(u(!1),r(e))})(e,i),"aria-disabled":i?null:"true",children:[(0,L.jsxs)("span",{className:Wn("button__text"),children:[o,!i&&" "]}),!i&&(0,L.jsx)("span",{className:Wn("button__state"),children:t("options.unavailableText")})]})},e)))})}),(0,L.jsxs)("button",{type:"button",className:Wn(["button","button--secondary","chat__options__button",...!y&&g?[`chat__options__button--${g}`]:[]]),id:a,onClick:()=>{o&&s(),y?u((e=>!e)):b.available&&r(b.name)},onKeyDown:y?e=>{be(e)===ye.ArrowDown&&(u(!0),e.preventDefault())}:null,ref:p,"aria-haspopup":y?"menu":null,"aria-expanded":y?l.toString():null,"aria-disabled":y||b.available?null:"true",children:[y&&(0,L.jsx)(fi,{name:"options",size:"32"}),(0,L.jsx)("span",{className:Wn("button__text"),children:y?t("options.openButtonText"):`${b.title}${b.available?"":" "}`}),!y&&!b.available&&(0,L.jsx)("span",{className:Wn("button__state"),children:t("options.unavailableText")})]})]}):null};function ju(){const{menuOptions:e,allowOptionSelection:t}=$r(),{isAvailable:n}=oi();return n||t&&e.length?(0,L.jsxs)("div",{className:Wn("chat__options"),children:[n&&(0,L.jsx)("div",{className:Wn("chat__options-item","chat__options-item--left"),children:(0,L.jsx)(Ps,{})}),t&&(0,L.jsx)("div",{className:Wn("chat__options-item","chat__options-item--right"),children:(0,L.jsx)(wu,{})})]}):null}function xu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Eu=function({children:e,interruptComponent:t}){const{hasInterrupt:n,meta:r}=eo(),{isOpen:o}=yo();return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(As,{}),(0,L.jsx)("div",{className:Wn("chat__container"),children:n?o?(0,L.jsx)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xu(Object(n),!0).forEach((function(t){_u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},r)):null:e}),o&&(0,L.jsx)(ju,{})]})};function Su(){const{preChatEvents:e,layoutMode:t}=ee(),{hasInterrupt:n}=eo(),{isOpen:r}=yo(),o=!(n||!e.length||r);return o&&(0,L.jsx)("ul",{className:Wn("pre-chat-messages",`pre-chat-messages--${t}`),"aria-hidden":!o,children:e.map((e=>(0,L.jsx)("li",{className:Wn("pre-chat-messages__message"),children:(0,L.jsx)(Tu,{event:e})},e.payload.id)))})}function Tu({event:e}){const[t]=Bs(e);return(0,L.jsx)(t,{event:e})}function ku(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pu(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 e=te(),t=gn(),{hasInterrupt:n}=eo(),r=t&&!n,o=r?t.avatar:e;return o?(0,L.jsx)("img",{className:Wn(r?"avatar":"icon"),src:o,alt:""}):(0,L.jsx)(fi,{name:"avatar",size:"32"})},Au=({onClick:e})=>{const t=Zn(),{t:n}=wr(),r=n(t?"window.openButton.srContinue":"window.openButton.srStart"),o=Ar(),{isOpen:s}=yo(),a=dn(),c=(0,i.useCallback)((()=>{e(),o()}),[o,e]);return(0,L.jsx)(vi,{isActive:!s,transitionStartState:gi,children:(0,L.jsxs)("button",{className:Wn("window-open-button"),"aria-label":r,"aria-hidden":s,onClick:c,children:[(0,L.jsx)("span",{className:Wn("message-count"),"aria-hidden":"true",children:!!a&&a}),(0,L.jsx)(Cu,{})]})})},Iu=({onClick:e})=>{const{t}=wr(),n=(0,i.useCallback)((()=>e()),[e]);return(0,L.jsx)("button",{type:"button",className:Wn("button","collapse-button"),onClick:n,children:(0,L.jsx)(fi,{name:"chevronDown",size:"32",alt:t("window.srCollapseButton")})})},Nu={app:()=>(Mo(),(0,L.jsx)(Ms,{children:(0,L.jsxs)(Eu,{interruptComponent:$s,children:[(0,L.jsx)(ql,{}),(0,L.jsx)(bu,{})]})})),inline:()=>{Mo();const{isOpen:e}=yo(),{hasInterrupt:t,meta:n}=eo();return t&&!e?(0,L.jsx)($s,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ku(Object(n),!0).forEach((function(t){Pu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ku(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n)):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(vi,{isActive:!e,transitionStartState:gi,children:(0,L.jsxs)("div",{className:Wn("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,L.jsx)(Su,{}),(0,L.jsx)(Us,{})]})}),(0,L.jsx)(vi,{isActive:e,transitionStartState:gi,children:(0,L.jsx)(Ms,{children:(0,L.jsxs)(Eu,{interruptComponent:$s,children:[e&&(0,L.jsx)(ql,{}),(0,L.jsx)(bu,{})]})})})]})},window:()=>{const{openChat:e,closeChat:t}=Mo(),{isOpen:n}=yo(),r=fo(),{t:o}=wr(),s=o("window.chat.continue"),a=(0,i.useMemo)((()=>({payload:{body:{text:s}}})),[s]);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Au,{onClick:e}),(0,L.jsx)(vi,{isActive:!n&&!r,transitionStartState:gi,children:(0,L.jsx)("div",{className:Wn("unstarted-wrapper","unstarted-wrapper--window"),children:(0,L.jsx)(Su,{})})}),(0,L.jsx)(vi,{isActive:!n&&r,transitionStartState:bi,children:(0,L.jsx)("div",{className:Wn("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,L.jsx)(gc,{event:a})})}),(0,L.jsx)(vi,{isActive:n,transitionStartState:bi,children:(0,L.jsxs)(Ms,{children:[n&&(0,L.jsx)(Iu,{onClick:t}),(0,L.jsxs)(Eu,{interruptComponent:$s,children:[(0,L.jsx)(ql,{}),(0,L.jsx)(bu,{})]})]})})]})}},Du=()=>{const[,e]=Pr(),{namespace:t,layoutMode:n,zIndex:r}=ee(),{isOpen:o,isVisible:s}=yo(),a=er(),c=fo(),{locale:l}=wr(),u=Nu[n],p=(0,i.useCallback)((t=>{e(t)}),[e]),h=(0,i.useMemo)((()=>{if(l&&document.querySelector("html").getAttribute("lang")!==l)return l}),[l]);if(!u)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const f=["app",`app--layout-${n}`,`namespace--${t}`,...a];return o||"app"===n||f.push("app--collapsed"),c&&f.push("app--user-responded"),s&&(0,L.jsx)("div",{className:Wn(f),lang:h,tabIndex:"-1","data-nosnippet":!0,style:{zIndex:r},ref:p,children:(0,L.jsx)(u,{})})};function Ru(e,t,n=[]){const r=(0,i.useContext)(Kn),o=(0,i.useRef)();o.current=t,(0,i.useEffect)((()=>{if(!n.every(Boolean))return;const t=(...e)=>{var t;return null===(t=o.current)||void 0===t?void 0:t.call(o,...e)};return r.emit("function.register",e,t),()=>r.emit("function.unregister",e,t)}),[r,e,...n])}const Lu=()=>{const e=ee(),{sendMessage:t,sendContext:n,sendAction:r}=So(),{setVisibility:o,visible:s}=yo(),a=(0,i.useRef)(s),c=(0,i.useContext)(Kn),l=Yn(),u=dn(),p=(0,i.useRef)(null),h=(0,i.useRef)(null),{isInline:f,isResolving:d}=vn(),{hasInterrupt:y}=eo(),b=Qn(),g=(0,i.useRef)(null),m=Co(),{enableTranslations:v,disableTranslations:O}=oi();return(0,i.useEffect)((()=>{a.current=s}),[s]),Ru("askText",(e=>{t({body:e})}),[null==l?void 0:l.send]),Ru("setVariables",(e=>{n({variables:e})}),[null==l?void 0:l.send]),Ru("getVisibility",(e=>{e?e(a.current):console.warn("A callback function is required for the getVisibility action.")})),Ru("setVisibility",(e=>{Object.values(T).includes(e)?(m(),o(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[null==e?void 0:e.api]),Ru("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[l.send]),Ru("setTopic",(({name:e,fallbackMessage:t})=>{e&&t?r({type:"set_topic",body:{name:e,fallbackMessage:t}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[l.send]),Ru("setTranslation",(({enabled:e,locale:t})=>{e?v(t):O()}),[l.send]),(0,i.useEffect)((()=>{d||y||(g.current&&g.current!==b&&c.emit("unreadMessageCount",u),s===T.open&&s!==h.current&&0!==p.current&&c.emit("unreadMessageCount",0),s!==T.open&&u!==p.current&&c.emit("unreadMessageCount",u),h.current=s,p.current=u,g.current=b)}),[u,s,c,f,d,y,b]),null},{SET_EVENTS_READ:Uu}=Me,Mu=()=>{const{t:e}=wr(),t=hn(),n=Xn(),{isOpen:r,isVisible:o}=yo(),{sendAction:s}=So(),a=dn(),{sendPolite:c}=ko(),l=(0,i.useMemo)((()=>ce(c,2e3)),[c]),u=(0,i.useRef)(null),p=(0,i.useRef)(null);return(0,i.useEffect)((()=>{if(!r)return;const e=t.filter((e=>_t(e)&&e.payload.messageStatus===Se)).map((e=>e.payload.id));e.length>0&&(n({type:Uu,ids:e}),s({type:Ce,events:e}))}),[t,n,r,s]),(0,i.useEffect)((()=>{u.current!==o&&!o&&p.current&&p.current(),0!==a&&!r&&o&&(p.current=l(e("message.srTextUnreadCount",{unreadCount:a}))),u.current=o}),[a,r,o,l,e]),null},$u=()=>{const{t:e}=wr(),t=hn(),n=(0,i.useRef)(0),r=(0,i.useRef)(0),o=ln().historyLoaded,{sendPolite:s}=ko(),{isOpen:a}=yo(),c=(0,i.useRef)(null),l=(0,i.useRef)(null),u=(0,i.useMemo)((()=>ce((t=>{const n=t.filter((({payload:e})=>!e.fromClient&&!e.fromHistory)).length;n>r.current&&(s(e("message.srNewEventCount",{newCount:n-r.current})),r.current=n)}),1e3)),[s,e]);return(0,i.useEffect)((()=>{t.length>n.current&&(a&&(l.current=u(t)),n.current=t.length)}),[t,u,a]),(0,i.useEffect)((()=>{c.current&&!a&&l.current&&(l.current(!0),l.current=null)}),[a]),(0,i.useEffect)((()=>{o&&setTimeout((()=>{s(e("window.srTexts.onHistoryLoad"))}),500)}),[o,e,s]),null},zu=({children:e})=>{const t=(0,i.useContext)(Kn),[n,r]=(0,i.useState)({}),o=(0,i.useRef)(!0),s=(0,i.useCallback)((e=>{o.current&&(r(e),t.emit("aria-live",e))}),[r,t]);(0,i.useEffect)((()=>{let e=null;return n&&n.messageText&&(e=setTimeout((()=>{s({}),clearTimeout(e)}),500)),()=>{clearTimeout(e)}}),[n,s]),(0,i.useEffect)((()=>()=>{o.current=!1}),[]);const{ariaLive:a,messageText:c}=n;return(0,L.jsxs)(To.Provider,{value:s,children:[e,(0,L.jsxs)("div",{className:Wn("app__live-container"),children:[(0,L.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:Wn("visually-hidden"),children:a===De?c:null}),(0,L.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:Wn("visually-hidden"),children:a===Re?c:null})]})]})},Bu=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=Wo();return((e,t)=>{const n=(0,i.useRef)(e);(0,i.useEffect)((()=>{n.current=e}),[e]),(0,i.useEffect)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n>0?1e3:null),null},Fu=({children:e})=>{const t=(0,i.useRef)(0),{sendAction:n}=So(),{hasCountdown:r,isActive:o,stopCountdown:s}=Wo(),a=(0,i.useCallback)((()=>{const e=(new Date).getTime(),i=()=>{n({type:"interactivity_update"}),t.current=e};r&&o&&(i(),s()),e-t.current>15e3&&i()}),[n,r,o,s]);return(0,L.jsx)("div",{className:Wn("activity-monitor"),tabIndex:"-1",onMouseDown:a,onKeyUp:a,onTouchStart:a,onMouseMove:a,onWheel:a,onPointerDown:a,onPointerMove:a,children:(0,L.jsx)(Po.Provider,{value:a,children:e})})},Hu=()=>{const{initUserSelectedOptions:e}=$r(),t=(0,i.useRef)(!1),n=ee();return(0,i.useEffect)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null},qu=["serviceSettings"];const{ADD_EVENT:Vu,ACK_EVENT:Wu,SET_IS_LOADING:Gu,SET_PARTICIPANT:Ku,SET_HEADER_SUB_TITLE:Yu,SET_ACTIVE_SERVICE:Ju,INIT_RESUME_CONVERSATION_PROMPT:Qu,CLEAR_EVENTS:Zu,SET_SERVICE_DATA_ITEM:Xu,SET_FEATURE_ENABLED_STATE:ep,SET_SERVICE_ENTRY_METADATA:tp,SET_HISTORY:np}=Me,rp=["text","choice_prompt","image","video"],op=({eventBus:e})=>{const{t}=wr(),n=Yn(),r=Xn(),o=hn(),s=(0,i.useRef)(null),{setUserSelectedOption:a}=$r(),{initCountdown:c,endCountdown:l}=Wo(),{emitEvent:u}=So();return(0,i.useEffect)((()=>{if(n.connectionInfo){const t=e=>{const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:o}=t;!n&&o.name&&r({type:Yu,title:o.name}),r({type:Ku,participant:o,fromClient:n}),o.introduction&&r({type:Vu,event:e})};n.stream().subscribe({next:n=>{const{type:o,payload:i}=n;switch(o){case"ui":switch(i.state&&i.state.hasOwnProperty("loading")&&r({type:Gu,isLoading:i.state.loading}),i.type){case"idle_detach_countdown":c(i.body.duration);break;case"idle_detach_countdown_elapsed":l(void 0,!0);break;case"resume_conversation_prompt":r({type:Qu});break;case"user_first_response":r(Rn(!0)),e.emit("system.userFirstResponse",i.body)}break;case"message":switch(t(i),i.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"cta":case"custom":case"carousel":case"card":i.service&&i.service.serviceSessionId&&r({type:Ju,activeServiceSessionId:i.service.serviceSessionId}),r({type:Vu,event:n})}break;case"participant":t(n);break;case"service_data":i.persist&&r({type:Xu,payload:i});break;case"ack":r({type:Wu,event:n});break;case"system":if("service_changed"===i.type){const{serviceSettings:e}=i,t=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}(i,qu),{uploads:n,entry:o}=e;r({type:ep,key:Ue,enabled:!(!n||!n.enabled)}),r({type:tp,entryMeta:o}),r({type:Ju,activeServiceSessionId:i.serviceSessionId}),u("system.serviceChanged",t)}break;case"info":"divider"!==i.type&&"text"!==i.type&&"translation"!==i.type||r({type:Vu,event:n});break;case"error":switch(i.type){case"find_conversation_erred":r(Nn(new Pn(n)));break;case"seamly_offline":r(Nn(new ro(n))),r({type:Zu});break;default:r(Nn(new to(n)))}break;case"socket_opened":r(Dn())}}}),n.stream().filter((e=>"message"===e.type&&rp.includes(e.payload.type))).subscribe({next:({payload:t})=>{t.id!==s.current&&e.emit("message",t),s.current=t.id}})}}),[r,n,e,t,a,c,l,u]),(0,i.useEffect)((()=>{if(n.stream){const e=n.stream().filter((e=>"sync"===e.type)).subscribe({next:e=>{const{payload:t}=e,i=o[o.length-1],{id:s}=t.lastEvent;i&&s===i.payload.id||n.getConversation().then((e=>{e&&r({type:np,history:e})})).catch((e=>{r(Nn(e))}))}});return()=>{e.unsubscribe()}}return()=>{}}),[n,o,r]),null},{REGISTER_UPLOAD:ip,SET_UPLOAD_PROGRESS:sp,SET_UPLOAD_ERROR:ap,SET_UPLOAD_COMPLETE:cp}=Me,lp=({children:e})=>{const{t}=wr(),n=Xn(),r=Yn(),{addUploadBubble:o}=So();return(0,L.jsx)(Br.Provider,{value:e=>{const i=s(),a=r.uploadFile(e,(e=>{n({type:sp,fileId:i,progress:Math.ceil(e)})}),(e=>{const{id:t,transactionId:r,occurredAt:s,body:{contentType:a,filename:c,filesize:l,url:u}}=e.body;n({type:cp,fileId:i}),o(t,r,s,a,c,l,u)}),(e=>{let r;switch(e&&e.body?e.body.error:""){case"file_uploads_are_disabled":r=t("fileUpload.errors.unavailable");break;case"request_entity_too_large":r=t("fileUpload.errors.tooLarge");break;case"file_has_invalid_mime_type":r=t("fileUpload.errors.wrongType");break;case"virus_found":r=t("fileUpload.errors.virusFound");break;default:r=t("fileUpload.errors.general")}n({type:ap,fileId:i,errorText:r})}));n({type:ip,fileId:i,fileName:e.name,uploadHandle:a})},children:e})},{createAction:up}=d("errors"),pp=up("catch-error",(e=>({error:e})));function hp({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:o,api:i,layoutMode:s}=A(t());null==r||r(n.error,{namespace:o,api:i,layoutMode:s,conversationUrl:e.getConversationUrl(),action:n.type?n:void 0})};return e=>t=>{try{return t.error&&n(t),e(t)}catch(e){throw n({error:e}),e}}}}const fp=({store:e,children:t,config:n,eventBus:r,api:o})=>((0,i.useErrorBoundary)((t=>e.dispatch(pp(t)))),(0,L.jsx)(U,{store:e,children:(0,L.jsx)(Kn.Provider,{value:r,children:(0,L.jsx)(Gn.Provider,{value:o,children:(0,L.jsx)(zu,{children:(0,L.jsxs)(Fl,{children:[(0,L.jsx)(Hu,{config:n}),(0,L.jsx)(op,{eventBus:r}),(0,L.jsx)(Mu,{}),(0,L.jsx)($u,{}),(0,L.jsx)(Bu,{}),(0,L.jsxs)(Fu,{children:[(0,L.jsx)(Lu,{}),(0,L.jsx)(lp,{children:t})]})]})})})})}));function dp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dp(Object(n),!0).forEach((function(t){bp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const gp=e=>(0,L.jsx)(fp,yp(yp({},e),{},{children:(0,L.jsx)(Du,{})}));var mp=n(813),vp=n.n(mp),Op=n(766),wp=n.n(Op),jp=e=>"function"==typeof e?e:function(){return e},xp="undefined"!=typeof self?self:null,_p="undefined"!=typeof window?window:null,Ep=xp||_p||void 0,Sp="closed",Tp="errored",kp="joined",Pp="joining",Cp="leaving",Ap="phx_close",Ip="phx_error",Np="phx_reply",Dp="phx_leave",Rp=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})}},Lp=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))}},Up=class{static request(e,t,n,r,o,i,s){if(Ep.XDomainRequest){let n=new Ep.XDomainRequest;this.xdomainRequest(n,e,t,r,o,i,s)}else{let a=new Ep.XMLHttpRequest;this.xhrRequest(a,e,t,n,r,o,i,s)}}static xdomainRequest(e,t,n,r,o,i,s){e.timeout=o,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);s&&s(t)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(r)}static xhrRequest(e,t,n,r,o,i,s,a){e.open(t,n,!0),e.timeout=i,e.setRequestHeader("Content-Type",r),e.onerror=()=>{a&&a(null)},e.onreadystatechange=()=>{if(4===e.readyState&&a){let t=this.parseJSON(e.responseText);a(t)}},s&&(e.ontimeout=s),e.send(o)}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)}`}},Mp=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,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 Up.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(){this.close(),this.readyState=0}ontimeout(){this.onerror("timeout"),this.closeAndRetry()}poll(){1!==this.readyState&&0!==this.readyState||Up.request("GET",this.endpointURL(),"application/json",null,this.timeout,this.ontimeout.bind(this),(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(),this.close();break;case 0:case 500:this.onerror(),this.closeAndRetry();break;default:throw new Error(`unhandled poll status ${t}`)}}))}send(e){Up.request("POST",this.endpointURL(),"application/json",e,this.timeout,this.onerror.bind(this,"timeout"),(e=>{e&&200===e.status||(this.onerror(e&&e.status),this.closeAndRetry())}))}close(e,t){this.readyState=3,this.onclose()}},$p={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,o,i,s]=JSON.parse(e);return t({join_ref:n,ref:r,topic:o,event:i,payload:s})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:o,payload:i}=e,s=this.META_LENGTH+t.length+n.length+o.length+r.length,a=new ArrayBuffer(this.HEADER_LENGTH+s),c=new DataView(a),l=0;c.setUint8(l++,this.KINDS.push),c.setUint8(l++,t.length),c.setUint8(l++,n.length),c.setUint8(l++,o.length),c.setUint8(l++,r.length),Array.from(t,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(n,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(o,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(r,(e=>c.setUint8(l++,e.charCodeAt(0))));var u=new Uint8Array(a.byteLength+i.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(i),a.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),s=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(e.slice(s,s+r));s+=r;let c=n.decode(e.slice(s,s+o));s+=o;let l=n.decode(e.slice(s,s+i));return s+=i,{join_ref:a,ref:null,topic:c,event:l,payload:e.slice(s,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),s=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(a,a+r));a+=r;let l=n.decode(e.slice(a,a+o));a+=o;let u=n.decode(e.slice(a,a+i));a+=i;let p=n.decode(e.slice(a,a+s));a+=s;let h=e.slice(a,e.byteLength);return{join_ref:c,ref:l,topic:u,event:Np,payload:{status:p,response:h}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=this.HEADER_LENGTH+2,s=n.decode(e.slice(i,i+r));i+=r;let a=n.decode(e.slice(i,i+o));return i+=o,{join_ref:null,ref:null,topic:s,event:a,payload:e.slice(i,e.byteLength)}}};function zp(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 Bp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zp(Object(n),!0).forEach((function(t){Fp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Hp=n(905),qp=n.n(Hp);function Vp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vp(Object(n),!0).forEach((function(t){Gp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Kp=qp()("seamly");class Yp{constructor(e,t,n,r){this.url=e,this.accessToken=r,this.channelName=t,this.channelTopic=n,this.connect(),this.socket.onError((e=>{Kp("[SOCKET][ERROR]",e),this.emit({type:"error",payload:{type:"seamly_offline",error:e}})})),this.socket.onOpen((()=>{Kp("[SOCKET]OPEN"),this.emit({type:"socket_opened"})})),this.channel.on("system",(e=>{switch(e.type){case"attach_channel_succeeded":this.emit({type:"connection",connected:!0,ready:!0})}})),this.socket.onClose((()=>{Kp("[SOCKET]CLOSE"),this.emit({type:"connection",connected:!1,ready:!1})})),this.channel.onClose((()=>{Kp("[CHANNEL]CLOSE"),this.emit({type:"connection",connected:!1,ready:!1})})),this.channel.onError((e=>{Kp("[CHANNEL][ERROR]",e),this.emit({type:"connection",connected:!1,ready:!1})})),this.listenTo("ack"),this.listenTo("ui"),this.listenTo("error"),this.listenTo("participant",((e,t)=>Wp(Wp({},t),{},{type:e}))),this.listenTo("message"),this.listenTo("service_data"),this.listenTo("system"),this.listenTo("info"),this.listenTo("sync")}start(e){this.listener=e,this.channel.join().receive("ok",(()=>{Kp("[CHANNEL][JOIN] OK"),this.emit({type:"connection",connected:!0,ready:!1})})).receive("error",(e=>{Kp("[CHANNEL][JOIN] ERROR",e),this.emit({type:"error",payload:{type:"join_channel_erred",error:e}}),this.emit({type:"connection",connected:!1,ready:!1}),this.channel.socket.disconnect()})).receive("timeout",(()=>{Kp("[CHANEL][JOIN] Networking issue. Still waiting...")}))}stop(){this.listener=null}connect(){const{url:e,params:t}=(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 Bp(Bp({},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||Ep.WebSocket||Mp,this.establishedConnections=0,this.defaultEncoder=$p.encode.bind($p),this.defaultDecoder=$p.decode.bind($p),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==Mp?(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=jp(t.params||{}),this.endPoint=`${e}/websocket`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Lp((()=>{this.teardown((()=>this.connect()))}),this.reconnectAfterMs)}replaceTransport(e){this.disconnect(),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=Up.appendParams(Up.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){this.connectClock++,e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=jp(e)),this.conn||(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}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.abnormalClose("heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,clearTimeout(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.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(),clearTimeout(this.heartbeatTimer),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(Ip)}))}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=Sp,this.topic=e,this.params=jp(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Rp(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Lp((()=>{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=kp,this.rejoinTimer.reset(),this.pushBuffer.forEach((e=>e.send())),this.pushBuffer=[]})),this.joinPush.receive("error",(()=>{this.state=Tp,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=Sp,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=Tp,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 Rp(this,Dp,jp({}),this.timeout).send(),this.state=Tp,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.on(Np,((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(Ap,e)}onError(e){return this.on(Ip,(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 Rp(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=Cp;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Ap,"leave")},n=new Rp(this,Dp,jp({}),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=Pp,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===Sp}isErrored(){return this.state===Tp}isJoined(){return this.state===kp}isJoining(){return this.state===Pp}isLeaving(){return this.state===Cp}}(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.heartbeatTimer=setTimeout((()=>this.heartbeatTimeout()),this.heartbeatIntervalMs))}abnormalClose(e){this.closeWasClean=!1,this.isConnected()&&this.conn.close(1e3,e)}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&&(clearTimeout(this.heartbeatTimer),this.pendingHeartbeatRef=null,setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${t} ${n} ${o&&"("+o+")"||""}`,r);for(let e=0;e<this.channels.length;e++){const s=this.channels[e];s.isMember(t,n,r,i)&&s.trigger(n,r,o,i)}for(let t=0;t<this.stateChangeCallbacks.message.length;t++){let[,n]=this.stateChangeCallbacks.message[t];n(e)}}))}leaveOpenTopic(e){let t=this.channels.find((t=>t.topic===e&&(t.isJoined()||t.isJoining())));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}}(e,{params:Wp(Wp({},t),{},{v:re})}),this.socket.connect(),this.channel=this.socket.channel(this.channelTopic,{authorization:`Bearer ${this.accessToken}`,channelName:this.channelName})}disconnect(){return new Promise((e=>{this.socket.disconnect(e)}))}listenTo(e,t=null){this.channel.on(e,(n=>{Kp("[RECEIVE]",e,n),this.emit({type:e,payload:t?t(e,n):n})}))}emit(e){this.listener&&this.listener.next(e)}push(e,t,n){this.channel.push(e,t,n)}}function Jp(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))}}}class Qp{constructor(e){this.name=e}emit(e){this.listener&&this.listener.next(e)}start(e){this.listener=e}stop(){this.listener=null}}function Zp(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?Zp(Object(n),!0).forEach((function(t){eh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function eh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const th=qp()("seamly");function nh(){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 rh{constructor({layoutMode:e,namespace:t,config:n={},context:r={}}){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||Jp),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},this.config={sendEnvironment:n.sendEnvironment??!0,context:Xp(Xp({},r),{},{channelName:r.channelName||"web"})},this.connected=!1,this.configReady=!1,this.externalId=n.externalId,this.layoutMode=e,this.internalProducer=new Qp("API"),this.internal$=vp().create(this.internalProducer).flatten(),this.connection$=this.internal$.filter((e=>"connection"===e.type)),this.connection$.subscribe({next:({connected:e,ready:t})=>{this.connected=e,this.ready=t}}),this.URLS={}}getAccessToken(){return this.store.get("accessToken")}setAccessToken(e){this.store.set("accessToken",e)}getConversationUrl(){return this.store.get("conversationUrl")}setConversationUrl(e){this.store.set("conversationUrl",e)}hasConversation(){return!!this.getConversationUrl()}getChannelTopic(){return this.store.get("channelTopic")||this.store.get("channelName")}setChannelTopic(e){this.store.set("channelTopic",e)}clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}getUrlPrefix(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`}updateUrls({_links:e}){this.URLS=Object.entries(e).filter((([e])=>"self"!==e)).reduce(((e,[t,{href:n}])=>Xp(Xp({},e),{},{[t]:n})),this.URLS)}async reset(){return await this.disconnect(),this.clearStore(),this.getConfig()}async disconnect(){this.conversationProducer&&await this.conversationProducer.disconnect(),this.connected=!1,this.configReady=!1}async createConversation(){try{const e=wp().post(`${this.getUrlPrefix("http")}${this.URLS.conversations}`).set("Content-Type","application/json").query({v:re}).withCredentials().send({externalId:this.externalId||void 0}),{body:t}=await e,{conversation:n}=t,r=Xp({},n);return delete r.accessToken,delete r.channelTopic,this.setAccessToken(n.accessToken),this.setChannelTopic(n.channelTopic),this.updateUrls(t),this.setConversationUrl(this.URLS.conversation),r}catch(e){if(e.status>=500)throw new to(e);throw e}}getConfig(){return wp().post(`${this.getUrlPrefix("http")}/client/${this.connectionInfo.apiKey}/configs`).set("Content-Type","application/json").query({v:re}).send({context:Xp(Xp({},this.config.context),{},{environment:!0===this.config.sendEnvironment?this.getEnvironment():this.config.sendEnvironment})}).then((({body:e})=>(this.updateUrls(e),this.configReady=!0,e.config))).catch((e=>{if(404===e.status)throw new no;if(e.status>=500)throw new to(e);throw e}))}async getConversation(){if(!this.hasConversation())return null;try{const{body:e}=await wp().get(`${this.getUrlPrefix("http")}${this.URLS.history}`).set("Authorization",`Bearer ${this.getAccessToken()}`).query({v:re});this.updateUrls(e);const{messages:t,participants:n,activeServiceSessionId:r,activeServiceSettings:o,serviceData:i,ui:s,translation:a}=e.history;return{events:t.map((([e,t])=>({type:e,payload:Xp(Xp({},t),{},{type:"participant"===e?e:t.type})}))),participants:n,activeServiceSessionId:r,activeServiceSettings:o,serviceData:i,resumeConversationPrompt:!!s&&Boolean(s.resumeConversationPrompt),translation:a}}catch(e){if(401===e.status)throw new oo(e);if(404===e.status)throw new Pn(e);if(e.status>=500)throw new to(e);throw e}}async connect(){this.connected=!1;let e=null;return this.hasConversation()||(e=await this.createConversation()),this.conversationProducer=new Yp(`${this.getUrlPrefix("ws")}${this.URLS.socket}`,this.config.context.channelName,this.getChannelTopic(),this.getAccessToken()),this.internalProducer.emit(vp().create(this.conversationProducer)),this.config.sendEnvironment&&this.send("context",{environment:!0===this.config.sendEnvironment?this.getEnvironment():this.config.sendEnvironment},!1),e}uploadFile(e,t,n,r){const o=new FormData;o.append("upload",e);const i=wp().post(`${this.getUrlPrefix("http")}${this.URLS.uploads}`).set("Authorization",`Bearer ${this.getAccessToken()}`).send(o);return i.on("progress",(function(e){const{direction:n,percent:r}=e;"upload"===n&&"function"==typeof t&&t(r)})),i.then((e=>{n&&n(e)})).catch((e=>{if(!r)throw e;r(e.response)})),i}getConversationIntitialState(){return wp().get(`${this.getUrlPrefix("http")}${this.getConversationUrl()}`).set("Authorization",`Bearer ${this.getAccessToken()}`).query({v:re}).then((({body:e})=>{return this.updateUrls(e),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 oo(e);if(404===e.status)throw new Pn(e);if(e.status>=500)throw new to(e);throw e}))}async getTranslations(e){try{const t=`${this.getUrlPrefix("http")}${this.URLS.translations}`.replace("{version}",String(1)).replace("{locale}",e),n=wp().get(t),{body:r}=await n;return r.translations}catch(e){if(e.status>=500)throw new to(e);throw e}}send(e,t,n=!0){!this.connected||n&&!this.ready?this.connection$.filter((e=>n?e.connected&&e.ready:e.connected)).take(1).subscribe({next:()=>this.send(e,t,n)}):(th("[SEND]",e,t),this.conversationProducer.push(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)}stream(){return this.internal$.filter((e=>"connection"!==e.type))}getEnvironment(){return{clientName:"@seamly/web-ui",clientVariant:this.layoutMode,clientVersion:"20.1.0",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:nh(),userAgent:navigator.userAgent}}}function oh(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 ih=oh();ih.withExtraArgument=oh;const sh=ih;function ah(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 ch(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ah(Object(n),!0).forEach((function(t){lh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ah(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uh({api:e}){return()=>t=>n=>{const r=t(n);switch(n.type){case Me.SET_USER_SELECTED_OPTIONS:e.store.set("options",n.options);break;case Me.SET_USER_SELECTED_OPTION:e.store.set("options",ch(ch({},e.store.get("options")||{}),{},{[n.option]:n.value}))}return r}}const ph={events:[],initialState:{},unreadEvents:0,isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1},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:_e,active:_e,userSelected:null,blockAutoEntrySwitch:!1,options:{},optionsOverride:{}},seamlyContainerElement:null};function hh(e=ph,t){return t.type===String(Ln.pending)?ph:((e,t)=>{switch(t.type){case ze:const{type:n,payload:r}=t.event,o=e.options.features.hasOwnProperty(Ue),i=kt(e.entryMeta,r);let s=Oe({},e.options);if(o&&(n===je.message||n===je.participant)&&!r.fromClient){const{type:e}=r.entry||{};s=Oe(Oe({},s),{},{features:Oe(Oe({},s.features),{},{uploads:Oe(Oe({},s.features.uploads),{},{enabledFromEntry:e===Ee})})})}const a=_t(t.event);return e.events.find((e=>e.payload.id===r.id))?e:Oe(Oe({},e),{},{entryMeta:o||i.active!==Ee?i:Oe({},e.entryMeta),options:s,unreadEvents:a?e.unreadEvents+1:e.unreadEvents,events:[...e.events,Oe(Oe({},t.event),{},{payload:Oe(Oe({},a&&{messageStatus:r.fromClient?Te:Se}),r)})]});case qe:if(!t.event.payload.transactionId)return console.warn("ACK received without transaction ID."),e;const c=e.events.find((e=>e.payload.transactionId===t.event.payload.transactionId)),{id:l,occurredAt:u}=t.event.payload;return c?Oe(Oe({},e),{},{events:Et(e.events.map((e=>e.payload.id===c.payload.id?Oe(Oe({},e),{},{payload:Oe(Oe({},e.payload),{},{id:l,occurredAt:u})}):e)))}):e;case Be:return Oe(Oe({},e),{},{unreadEvents:0,events:[]});case He:return Oe(Oe({},e),{},{unreadEvents:0,events:e.events.map((e=>-1!==t.ids.indexOf(e.payload.id)?Oe(Oe({},e),{},{payload:Oe(Oe({},e.payload),e.payload.messageStatus===Se&&{messageStatus:Te})}):e))});case Fe:const{events:p,participants:h,activeServiceSessionId:f,activeServiceSettings:d={},serviceData:y,resumeConversationPrompt:b}=t.history,g=((e,t)=>{const n=t.filter((t=>!(e.find((e=>e.payload.id===t.payload.id))||"participant"===t.type&&!t.payload.participant.introduction))).reverse();return Et([...n,...e])})(e.events,p),m=Oe(Oe({},e.participantInfo.participants),h),v=g.slice().reverse().find((e=>("message"===e.type||"participant"===e.type)&&!e.payload.fromClient));let O=null;v&&("message"===v.type&&(O=v.payload.participant),"participant"===v.type&&(O=v.payload.participant.id));const{entry:w,uploads:j}=d,x=kt(Oe(Oe(Oe({},e.entryMeta),w),{},{active:w.default||xe,options:Oe({},w&&w.options?w.options:{})}),g[g.length-1].payload);let _=Oe({},e.options.features);const E=_.hasOwnProperty(Ue);if(E){const{payload:e}=v,{type:t}=e.entry||{};_=Oe(Oe({},_),{},{uploads:{enabled:!(!j||!j.enabled),enabledFromEntry:t===Ee}})}const S=Oe(Oe({},e),{},{unreadEvents:g.filter((e=>"message"===e.type&&e.payload.messageStatus===Se)).length,events:g.filter((e=>"participant"!==e.type||!!e.payload.participant.introduction)),participantInfo:Oe(Oe(Oe({},e.participantInfo),O?St(e.participantInfo,{type:Ge,participant:m[O]}):{}),{},{participants:m}),historyLoaded:!0,serviceInfo:Oe(Oe({},e.serviceInfo),{},{activeServiceSessionId:f}),serviceData:y||{},options:Oe(Oe({},e.options),{},{features:_}),entryMeta:E||x.active!==Ee?x:Oe({},e.entryMeta),resumeConversationPrompt:b||!1});return O&&(S.headerTitles=Tt(e.headerTitles,{type:Ye,title:m[O].name})),S;case Je:return Oe(Oe({},e),{},{historyLoaded:!1});case Ve:return Oe(Oe({},e),{},{isLoading:t.isLoading});case Ze:const{delaySeconds:T,delayTime:k}=t;return Oe(Oe({},e),{},{idleDetachCountdown:{hasCountdown:!0,isActive:!0,wasStopped:!1,count:T,remaining:T,timer:k}});case Xe:const{idleDetachCountdown:P}=e,{remaining:C}=P,A=C-1;return Oe(Oe({},e),{},{idleDetachCountdown:Oe(Oe({},e.idleDetachCountdown),{},{remaining:A,timer:ue(A)})});case et:return Oe(Oe({},e),{},{idleDetachCountdown:Oe(Oe({},e.idleDetachCountdown),{},{isActive:!1,wasStopped:!0})});case tt:return Oe(Oe({},e),{},{idleDetachCountdown:{hasCountdown:!1,isActive:!1}});case nt:return Oe(Oe({},e),{},{resumeConversationPrompt:!0});case rt:return Oe(Oe({},e),{},{resumeConversationPrompt:!1});case Ge:case We:return Oe(Oe({},e),{},{participantInfo:St(e.participantInfo,t)});case Qe:return e.serviceInfo.activeServiceSessionId!==t.activeServiceSessionId?Oe(Oe({},e),{},{serviceInfo:Oe(Oe({},e.serviceInfo),{},{activeServiceSessionId:t.activeServiceSessionId})}):e;case Ke:case Ye:return Oe(Oe({},e),{},{headerTitles:Tt(e.headerTitles,t)});case ct:return Oe(Oe({},e),{},{initialState:t.initialState});case ot:return Oe(Oe({},e),{},{serviceData:Oe(Oe({},e.serviceData),{},{[t.payload.type]:t.payload})});case it:return Oe(Oe({},e),{},{options:Oe(Oe({},e.options),{},{features:t.features})});case st:return e.options.features.hasOwnProperty(t.key)?Oe(Oe({},e),{},{options:Oe(Oe({},e.options),{},{features:Oe(Oe({},e.options.features),{},{[t.key]:Oe(Oe({},e.options.features[t.key]||{}),{},{enabled:t.enabled})})})}):e;case at:return Oe(Oe({},e),{},{options:Oe(Oe({},e.options),{},{features:{}})});case pt:return Oe(Oe({},e),{},{options:Oe(Oe({},e.options),{},{panelActive:!0,optionActive:t.optionName})});case ht:return Oe(Oe({},e),{},{options:Oe(Oe({},e.options),{},{panelActive:!1,optionActive:""})});case ut:return Oe(Oe({},e),{},{options:Oe(Oe({},e.options),{},{userSelectedOptions:t.options})});case lt:const{option:I,value:N}=t;return Oe(Oe({},e),{},{options:Oe(Oe({},e.options),{},{userSelectedOptions:Oe(Oe({},e.options.userSelectedOptions),{},{[I]:N})})});case ft:const{value:D}=t;return Oe(Oe({},e),{},{entryMeta:Oe(Oe({},e.entryMeta),{},{blockAutoEntrySwitch:D})});case bt:const{entryMeta:R}=t;return Oe(Oe({},e),{},{entryMeta:Oe(Oe(Oe({},e.entryMeta),R),{},{active:R.default,options:Oe({},R.options||{}),overrideOptions:{}})});case yt:const{entryType:L}=t;return Oe(Oe({},e),{},{entryMeta:Oe(Oe({},e.entryMeta),{},{active:L})});case dt:const{entryType:U}=t;return Oe(Oe({},e),{},{entryMeta:Oe(Oe({},e.entryMeta),{},{userSelected:U})});case gt:return Oe(Oe({},e),{},{currentUploads:[...e.currentUploads,{id:t.fileId,name:t.fileName,progress:1,uploading:!0,complete:!1,error:"",uploadHandle:t.uploadHandle}]});case mt:return Oe(Oe({},e),{},{currentUploads:e.currentUploads.map((e=>e.id===t.fileId?Oe(Oe({},e),{},{progress:t.progress,uploading:100!==t.progress,uploadHandle:100===t.progress?null:e.uploadHandle}):e))});case Ot:return Oe(Oe({},e),{},{currentUploads:e.currentUploads.map((e=>e.id===t.fileId?Oe(Oe({},e),{},{error:t.errorText,progress:0,uploading:!1,uploadHandle:null}):e))});case vt:return Oe(Oe({},e),{},{currentUploads:e.currentUploads.map((e=>e.id===t.fileId?Oe(Oe({},e),{},{complete:!0}):e))});case wt:return Oe(Oe({},e),{},{currentUploads:e.currentUploads.filter((e=>e.id!==t.fileId))});case jt:return Oe(Oe({},e),{},{currentUploads:[]});case xt:return Oe(Oe({},e),{},{seamlyContainerElement:t.element});default:return e}})(e,t)}const fh=["namespace","parentElement","showFaq"],dh=["view"];function yh(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 bh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yh(Object(n),!0).forEach((function(t){gh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mh(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}class vh{constructor(e,t){const{namespace:n="",parentElement:r,showFaq:i}=e,s=mh(e,fh);this.config=bh(bh({},s),{},{namespace:n,showFaq:!1!==i}),this.namespace=n,this.parentElement=r,this.externalApi=t,this.api=new rh({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(o()),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)))}async render(){const t=this.config.customComponents||{},{view:n}=t,r=mh(t,dh),o=bh(bh({},this.config),{},{customComponents:Object.keys(r).length?r:void 0}),i=function({initialState:e,api:t,eventBus:n,config:r}={}){return Y({reducers:{state:hh,[String(Xo)]:Xo,[String(Vn)]:Vn,[String(Xi)]:Xi,[String(pi)]:pi,[String(Sr)]:Sr,[String(ho)]:ho,[String(Oo)]:Oo},initialState:e,middlewares:[hp({api:t}),sh.withExtraArgument({api:t,eventBus:n,config:r}),so({api:t}),uh({api:t}),({dispatch:e,getState:t})=>n=>r=>{var o,i,s,a,c,l,u;const p=n(r);switch(r.type){case String(Me.SET_HISTORY):null!==(o=r.history)&&void 0!==o&&null!==(i=o.translation)&&void 0!==i&&i.enabled&&e(Ft(r.history.translation.locale));break;case String(Me.SET_INITIAL_STATE):null!==(s=r.initialState)&&void 0!==s&&null!==(a=s.translation)&&void 0!==a&&a.enabled&&(e(Ft(r.initialState.translation.locale)),e(Mt(r.locale)));break;case String(Me.ADD_EVENT):"info"===r.event.type&&"new_translation"===(null===(c=r.event)||void 0===c||null===(l=c.payload)||void 0===l||null===(u=l.body)||void 0===u?void 0:u.subtype)&&r.event.payload.body.translationEnabled&&e(Mt(r.event.payload.body.translationLocale));break;case String(Ht):const n=Dt(t());e(Mt(n))}return p}]})}({api:this.api,eventBus:this.eventBus,config:o});await i.dispatch(Ln()),n?(0,e.render)((0,L.jsx)(fp,{config:o,eventBus:this.eventBus,store:i,api:this.api,children:(0,L.jsx)(n,{})}),this.parentElement):(0,e.render)((0,L.jsx)(gp,{config:o,eventBus:this.eventBus,store:i,api:this.api}),this.parentElement)}destroy(){(0,e.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 Oh(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 wh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oh(Object(n),!0).forEach((function(t){jh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xh=e=>"object"==typeof e&&"action"in e,_h=e=>wh(wh({},e),{},{args:Array.isArray(e.args)?e.args:[e.args]}),Eh=class{constructor(e){this._waitingActions=[],this._instances={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(xh).map(_h)).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"setTranslation":const{enabled:e,locale:n}=t;return e&&n&&(this.context.translationLocale=n),!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 vh(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){if("function"==typeof this.appConfig)return this.appConfig(e);const t=wh(wh({},e.context||this.appConfig.context),this.context),n=wh(wh({},this.appConfig.defaults),e.defaults);return wh(wh(wh({},this.appConfig),e),{},{api:wh(wh({},this.appConfig.api),e.api),context:Object.keys(t).length?t:void 0,defaults:Object.keys(n).length?n:void 0})}},Sh=()=>{const{t:e}=wr(),{title:t,subTitle:n}=fn(),r=dn(),{isOpen:o}=yo(),i=gn(),{hasInterrupt:s}=eo(),a=te(),c=(null==i?void 0:i.avatar)??a,l=s?"":n,u=["message-count"];return o&&u.push("message-count__hide"),0===r&&u.push("message-count__empty"),(l||!o)&&(0,L.jsxs)("div",{className:Wn("agent-info"),children:[(0,L.jsxs)("div",{className:Wn("agent-info__graphic"),children:[c?(0,L.jsx)("img",{className:Wn(null!=i&&i.avatar?"avatar":"icon"),src:c,alt:""}):(0,L.jsx)(fi,{name:"avatar",size:"32"}),(0,L.jsx)("span",{className:Wn(u),"aria-hidden":"true",children:r})]}),(0,L.jsxs)("div",{className:Wn("agent-info__body"),children:[(0,L.jsx)("p",{className:Wn("agent-info__heading"),children:t??e("header.title")}),(0,L.jsx)("p",{className:Wn("agent-info__text"),children:l})]})]})},Th=({children:e,onCloseChat:t})=>{const{headerCollapseButtonId:n}=ln(),r=(0,i.useRef)(null),{t:o}=wr();return(0,L.jsxs)("header",{className:Wn("chat__header"),children:[e,(0,L.jsx)("div",{className:Wn("header-controls"),children:(0,L.jsx)("button",{type:"button",className:Wn("button","header-controls__collapse"),onClick:t,ref:r,id:n,children:(0,L.jsx)(fi,{name:"chevronDown",size:"32",alt:o("header.collapseApp")})})})]})},kh=({onOpenChat:e})=>{const{t}=wr(),n=Kr(),{isOpen:r}=yo(),o=(0,i.useRef)(null),s=(0,i.useRef)(null),a=(0,i.useRef)(),c=Ar(),l=(()=>{const e=(0,i.useRef)(null),[t]=Pr();return e.current=t,(0,i.useCallback)((t=>{me(e.current,(()=>{kr(t)}))}),[])})(),u=gn(),p=fn().subTitle,{hasInterrupt:h}=eo(),{headerCollapseButtonId:f}=ln(),d=u&&!h;return(0,i.useLayoutEffect)((()=>{!1===r&&!0===o.current&&l(s.current),o.current=r}),[r,l]),(0,L.jsxs)("div",{className:Wn("toggle-button"),children:[(0,L.jsxs)("div",{id:n,children:[(0,L.jsx)("p",{className:Wn("toggle-button__title"),children:t(d?"toggleButton.resumeTitle":"toggleButton.title")}),(0,L.jsx)("p",{className:Wn("toggle-button__subtitle"),children:d?p:t("toggleButton.subtitle")})]}),(0,L.jsx)("button",{type:"button","aria-labelledby":n,className:Wn("toggle-button__button"),ref:s,onMouseUp:()=>{a.current="mouse"},onKeyUp:()=>{a.current="key"},onClick:()=>{e(),"mouse"===a.current?c():"key"===a.current&&l(f)}})]})},Ph=["categories"];function Ch(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 Ah(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ch(Object(n),!0).forEach((function(t){Ih(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ch(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ih(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Nh=()=>{const{t:e}=wr(),{sendAction:t,addMessageBubble:n}=So(),r=Kr(),o=Ar(),{sendPolite:s}=ko(),{hasInterrupt:a}=eo(),{hasCountdown:c,endCountdown:l}=Wo(),{hasPrompt:u,continueChat:p}=Ko(),h=mn("suggestion"),[f]=ii({payload:h}),d=(0,i.useMemo)((()=>(h&&!a?f:[]).map((e=>{let{categories:t=[]}=e;return Ah(Ah({},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,Ph)),{},{categories:t,classNames:["faqs__item",...t.map((e=>`faqs__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`))]})}))),[h,a,f]),y=(0,i.useRef)(null),b=(0,i.useRef)(!1),{isInline:g}=vn(),m=fo(),v=!g&&m,O=(0,i.useRef)(v),w=!!d.length,j=w&&!v,x=(0,i.useRef)([]),_=w?d:x.current;x.current=_;const E=(0,i.useRef)(null);(0,i.useEffect)((()=>{if(y.current!==d&&!v){if(w){const t=b.current?e("faq.srUpdatedText"):e("faq.srAvailableText");setTimeout((()=>{s(t)}),30)}else b.current&&s(e("faq.srUnavailableText"));y.current=d}!O.current&&v?(me(E.current,o),s(e("faq.srUnavailableText"))):!w&&b.current&&me(E.current,o),b.current=w,O.current=v}),[w,d,v,o,s,e]);const S=e("faq.headingText"),T=S?"section":"div";return(0,L.jsx)(vi,{isActive:j,transitionStartState:bi,children:(0,L.jsxs)(T,{className:Wn("faqs"),"aria-labelledby":S?r:null,ref:E,children:[S&&(0,L.jsx)("h2",{id:r,className:Wn("faqs__heading"),children:S}),!!_.length&&(0,L.jsx)("ul",{className:Wn("faqs__list"),children:_.map((e=>(0,L.jsx)("li",{className:Wn(e.classNames),children:(0,L.jsxs)("button",{type:"button",onClick:()=>{(({id:e,question:r})=>{c&&l(!0),u&&p(),t({type:ke,originMessage:h.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:r}}}),n(r),o()})(e)},className:Wn("button","button--secondary"),children:[(0,L.jsx)(fi,{name:"chevronRight",size:"8"}),e.question]})},e.id.toString())))})]})})},Dh=({children:e})=>{const[,t]=Pr(),{isOpen:n,isVisible:r,setVisibility:o}=yo(),{zIndex:s,showFaq:a,layoutMode:c}=ee(),{isInline:l}=vn(),u=er(),p=fo(),{locale:h}=wr(),f=(0,i.useCallback)((e=>{t(e)}),[t]),d=(0,i.useMemo)((()=>{if(h&&document.querySelector("html").getAttribute("lang")!==h)return h}),[h]),y=["app","app--deprecated",...u];return n||"window"!==c||y.push("app--collapsed"),p&&y.push("app--user-responded"),y.push(`app--layout-${c}`),r&&(0,L.jsxs)("section",{className:Wn(y),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!l&&n&&o(T.minimized)},lang:d,tabIndex:"-1",ref:f,style:{zIndex:s},"data-nosnippet":!0,children:[(0,L.jsx)("div",{className:Wn("app-wrapper"),children:e}),a&&(0,L.jsx)(Nh,{})]})},Rh=()=>{const{isVisible:e}=yo(),{openChat:t,closeChat:n}=Mo();return e&&(0,L.jsxs)(Dh,{children:[(0,L.jsx)(kh,{onOpenChat:t}),(0,L.jsx)(Th,{onCloseChat:n,children:(0,L.jsx)(Sh,{})}),(0,L.jsxs)(Eu,{interruptComponent:$s,children:[(0,L.jsx)(ql,{}),(0,L.jsx)(bu,{})]})]})},Lh=function(e){if(window.seamly&&!Array.isArray(window.seamly))throw new Error("Seamly UI has already been initialised. Use the window.seamly object to start new instances instead.");const t=Array.isArray(window.seamly)?window.seamly:[],n=new Eh(e);window.seamly={push:n.push.bind(n)},n.push(...t)}})(),module.exports=r})();
|