@seamly/web-ui 24.2.1-beta.1 → 24.2.1
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/index.debug.js +1 -1
- package/build/dist/lib/index.debug.js.map +1 -1
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +1 -1
- package/build/dist/lib/index.js.map +1 -1
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/standalone.js +1 -1
- package/build/dist/lib/standalone.js.map +1 -1
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +1 -1
- package/build/dist/lib/style-guide.js.map +1 -1
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.map +1 -1
- package/build/dist/lib/utils.js +1 -1
- package/build/dist/lib/utils.js.map +1 -1
- package/build/dist/lib/utils.min.js +1 -1
- package/build/dist/lib/utils.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see style-guide.min.js.LICENSE.txt */
|
|
2
|
-
(()=>{var e={2086:e=>{e.exports=function(e){var t={},n=[];(e=e||this).on=function(n,r,a){return(t[n]=t[n]||[]).push([r,a]),e},e.off=function(r,a){r||(t={});for(var i=t[r]||n,o=i.length=a?i.length:0;o--;)a==i[o][0]&&i.splice(o,1);return e},e.emit=function(r){for(var a,i=t[r]||n,o=i.length>0?i.slice(0,i.length):i,s=0;a=o[s++];)a[0].apply(a[1],n.slice.call(arguments,1));return e}}},7402:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>b,Component:()=>r.Component,Fragment:()=>r.Fragment,PureComponent:()=>f,StrictMode:()=>oe,Suspense:()=>S,SuspenseList:()=>T,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>J,cloneElement:()=>te,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>Y,createPortal:()=>k,createRef:()=>r.createRef,default:()=>ce,findDOMNode:()=>re,flushSync:()=>ie,forwardRef:()=>g,hydrate:()=>F,isElement:()=>se,isFragment:()=>Q,isMemo:()=>ee,isValidElement:()=>Z,lazy:()=>j,memo:()=>h,render:()=>z,startTransition:()=>l,unmountComponentAtNode:()=>ne,unstable_batchedUpdates:()=>ae,useDeferredValue:()=>u,useInsertionEffect:()=>p,useSyncExternalStore:()=>s,useTransition:()=>d,version:()=>X});var r=n(8785),a=n(1162),i={};for(const e in a)["default","Component","Fragment","createContext","createElement","createRef","Children","PureComponent","StrictMode","Suspense","SuspenseList","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","cloneElement","createFactory","createPortal","findDOMNode","flushSync","forwardRef","hydrate","isElement","isFragment","isMemo","isValidElement","lazy","memo","render","startTransition","unmountComponentAtNode","unstable_batchedUpdates","useDeferredValue","useInsertionEffect","useSyncExternalStore","useTransition","version"].indexOf(e)<0&&(i[e]=()=>a[e]);function o(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function s(e,t){var n=t(),r=(0,a.useState)({t:{__:n,u:t}}),i=r[0].t,o=r[1];return(0,a.useLayoutEffect)((function(){i.__=n,i.u=t,c(i)&&o({t:i})}),[e,n,t]),(0,a.useEffect)((function(){return c(i)&&o({t:i}),e((function(){c(i)&&o({t:i})}))}),[e]),n}function c(e){var t,n,r=e.u,a=e.__;try{var i=r();return!((t=a)===(n=i)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}function l(e){e()}function u(e){return e}function d(){return[!1,l]}n.d(t,i);var p=a.useLayoutEffect;function f(e,t){this.props=e,this.context=t}function h(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:o(this.props,e)}function a(t){return this.shouldComponentUpdate=n,(0,r.createElement)(e,t)}return a.displayName="Memo("+(e.displayName||e.name)+")",a.prototype.isReactComponent=!0,a.__f=!0,a}(f.prototype=new r.Component).isPureReactComponent=!0,f.prototype.shouldComponentUpdate=function(e,t){return o(this.props,e)||o(this.state,t)};var m=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),m&&m(e)};var y="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function g(e){function t(t){if(!("ref"in t))return e(t,null);var n=t.ref;delete t.ref;var r=e(t,n);return t.ref=n,r}return t.$$typeof=y,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var v=function(e,t){return null==e?null:(0,r.toChildArray)((0,r.toChildArray)(e).map(t))},b={map:v,forEach:v,count:function(e){return e?(0,r.toChildArray)(e).length:0},only:function(e){var t=(0,r.toChildArray)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.toChildArray},x=r.options.__e;r.options.__e=function(e,t,n,r){if(e.then)for(var a,i=t;i=i.__;)if((a=i.__c)&&a.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),a.__c(e,t);x(e,t,n,r)};var w=r.options.unmount;function _(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=function(e,t){for(var n in t)e[n]=t[n];return e}({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return _(e,t,n)}))),e}function C(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return C(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function S(){this.__u=0,this.o=null,this.__b=null}function E(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function j(e){var t,n,a;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){a=e})),a)throw a;if(!n)throw t;return(0,r.createElement)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function T(){this.i=null,this.l=null}r.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),w&&w(e)},(S.prototype=new r.Component).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var a=E(r.__v),i=!1,o=function(){i||(i=!0,n.__R=null,a?a(s):s())};n.__R=o;var s=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=C(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},S.prototype.componentWillUnmount=function(){this.o=[]},S.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),a=this.__v.__k[0].__c;this.__v.__k[0]=_(this.__b,n,a.__O=a.__P)}this.__b=null}var i=t.__a&&(0,r.createElement)(r.Fragment,null,e.fallback);return i&&(i.__u&=-33),[(0,r.createElement)(r.Fragment,null,t.__a?null:e.children),i]};var I=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function N(e){return this.getChildContext=function(){return e.context},e.children}function L(e){var t=this,n=e.h;t.componentWillUnmount=function(){(0,r.render)(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),t.v||(t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],contains:function(){return!0},appendChild:function(e){this.childNodes.push(e),t.h.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}),(0,r.render)((0,r.createElement)(N,{context:t.context},e.__v),t.v)}function k(e,t){var n=(0,r.createElement)(L,{__v:e,h:t});return n.containerInfo=t,n}(T.prototype=new r.Component).__a=function(e){var t=this,n=E(t.__v),r=t.l.get(e);return r[0]++,function(a){var i=function(){t.props.revealOrder?(r.push(a),I(t,e,r)):a()};n?n(i):i()}},T.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,r.toChildArray)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},T.prototype.componentDidUpdate=T.prototype.componentDidMount=function(){var e=this;this.l.forEach((function(t,n){I(e,n,t)}))};var M="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,A=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,O=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,P=/[A-Z0-9]/g,R="undefined"!=typeof document,D=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function z(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function F(e,t,n){return(0,r.hydrate)(e,t),"function"==typeof n&&n(),e?e.__c:null}r.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(r.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var U=r.options.event;function B(){}function H(){return this.cancelBubble}function $(){return this.defaultPrevented}r.options.event=function(e){return U&&(e=U(e)),e.persist=B,e.isPropagationStopped=H,e.isDefaultPrevented=$,e.nativeEvent=e};var V,G={enumerable:!1,configurable:!0,get:function(){return this.class}},W=r.options.vnode;r.options.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,a={},i=-1===n.indexOf("-");for(var o in t){var s=t[o];if(!("value"===o&&"defaultValue"in t&&null==s||R&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var c=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===s?s="":"translate"===c&&"no"===s?s=!1:"o"===c[0]&&"n"===c[1]?"ondoubleclick"===c?o="ondblclick":"onchange"!==c||"input"!==n&&"textarea"!==n||D(t.type)?"onfocus"===c?o="onfocusin":"onblur"===c?o="onfocusout":O.test(o)&&(o=c):c=o="oninput":i&&A.test(o)?o=o.replace(P,"-$&").toLowerCase():null===s&&(s=void 0),"oninput"===c&&a[o=c]&&(o="oninputCapture"),a[o]=s}}"select"==n&&a.multiple&&Array.isArray(a.value)&&(a.value=(0,r.toChildArray)(t.children).forEach((function(e){e.props.selected=-1!=a.value.indexOf(e.props.value)}))),"select"==n&&null!=a.defaultValue&&(a.value=(0,r.toChildArray)(t.children).forEach((function(e){e.props.selected=a.multiple?-1!=a.defaultValue.indexOf(e.props.value):a.defaultValue==e.props.value}))),t.class&&!t.className?(a.class=t.class,Object.defineProperty(a,"className",G)):(t.className&&!t.class||t.class&&t.className)&&(a.class=a.className=t.className),e.props=a}(e),e.$$typeof=M,W&&W(e)};var q=r.options.__r;r.options.__r=function(e){q&&q(e),V=e.__c};var K=r.options.diffed;r.options.diffed=function(e){K&&K(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),V=null};var J={ReactCurrentDispatcher:{current:{readContext:function(e){return V.__n[e.__c].props.value},useCallback:a.useCallback,useContext:a.useContext,useDebugValue:a.useDebugValue,useDeferredValue:u,useEffect:a.useEffect,useId:a.useId,useImperativeHandle:a.useImperativeHandle,useInsertionEffect:p,useLayoutEffect:a.useLayoutEffect,useMemo:a.useMemo,useReducer:a.useReducer,useRef:a.useRef,useState:a.useState,useSyncExternalStore:s,useTransition:d}}},X="18.3.1";function Y(e){return r.createElement.bind(null,e)}function Z(e){return!!e&&e.$$typeof===M}function Q(e){return Z(e)&&e.type===r.Fragment}function ee(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function te(e){return Z(e)?r.cloneElement.apply(null,arguments):e}function ne(e){return!!e.__k&&((0,r.render)(null,e),!0)}function re(e){return e&&(e.base||1===e.nodeType&&e)||null}var ae=function(e,t){return e(t)},ie=function(e,t){return e(t)},oe=r.Fragment,se=Z,ce={useState:a.useState,useId:a.useId,useReducer:a.useReducer,useEffect:a.useEffect,useLayoutEffect:a.useLayoutEffect,useInsertionEffect:p,useTransition:d,useDeferredValue:u,useSyncExternalStore:s,startTransition:l,useRef:a.useRef,useImperativeHandle:a.useImperativeHandle,useMemo:a.useMemo,useCallback:a.useCallback,useContext:a.useContext,useDebugValue:a.useDebugValue,version:"18.3.1",Children:b,render:z,hydrate:F,unmountComponentAtNode:ne,createPortal:k,createElement:r.createElement,createContext:r.createContext,createFactory:Y,cloneElement:te,createRef:r.createRef,Fragment:r.Fragment,isValidElement:Z,isElement:se,isFragment:Q,isMemo:ee,findDOMNode:re,Component:r.Component,PureComponent:f,memo:h,forwardRef:g,flushSync:ie,unstable_batchedUpdates:ae,StrictMode:oe,Suspense:S,SuspenseList:T,lazy:j,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:J}},7154:(e,t,n)=>{"use strict";var r=n(7402),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useSyncExternalStore,o=r.useRef,s=r.useEffect,c=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=c((function(){function e(e){if(!s){if(s=!0,i=e,e=r(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return o=t}return o=e}if(t=o,a(i,e))return t;var n=r(e);return void 0!==u&&u(t,n)?t:(i=e,o=n)}var i,o,s=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,u]);var f=i(e,d[0],d[1]);return s((function(){p.hasValue=!0,p.value=f}),[f]),l(f),f}},8418:(e,t,n)=>{"use strict";e.exports=n(7154)},8785:e=>{"use strict";e.exports=require("preact")},1162:e=>{"use strict";e.exports=require("preact/hooks")},9306:(e,t,n)=>{"use strict";var r=n(4901),a=n(6823),i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(a(e)+" is not a function")}},7080:(e,t,n)=>{"use strict";var r=n(4402).has;e.exports=function(e){return r(e),e}},8551:(e,t,n)=>{"use strict";var r=n(34),a=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(a(e)+" is not an object")}},9617:(e,t,n)=>{"use strict";var r=n(5397),a=n(5610),i=n(6198),o=function(e){return function(t,n,o){var s=r(t),c=i(s);if(0===c)return!e&&-1;var l,u=a(o,c);if(e&&n!=n){for(;c>u;)if((l=s[u++])!=l)return!0}else for(;c>u;u++)if((e||u in s)&&s[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},4527:(e,t,n)=>{"use strict";var r=n(3724),a=n(4376),i=TypeError,o=Object.getOwnPropertyDescriptor,s=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(a(e)&&!o(e,"length").writable)throw new i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},2195:(e,t,n)=>{"use strict";var r=n(9504),a=r({}.toString),i=r("".slice);e.exports=function(e){return i(a(e),8,-1)}},7740:(e,t,n)=>{"use strict";var r=n(9297),a=n(5031),i=n(7347),o=n(4913);e.exports=function(e,t,n){for(var s=a(t),c=o.f,l=i.f,u=0;u<s.length;u++){var d=s[u];r(e,d)||n&&r(n,d)||c(e,d,l(t,d))}}},6699:(e,t,n)=>{"use strict";var r=n(3724),a=n(4913),i=n(6980);e.exports=r?function(e,t,n){return a.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},6980:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6840:(e,t,n)=>{"use strict";var r=n(4901),a=n(4913),i=n(283),o=n(9433);e.exports=function(e,t,n,s){s||(s={});var c=s.enumerable,l=void 0!==s.name?s.name:t;if(r(n)&&i(n,l,s),s.global)c?e[t]=n:o(t,n);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=n:a.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},9433:(e,t,n)=>{"use strict";var r=n(4576),a=Object.defineProperty;e.exports=function(e,t){try{a(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},3724:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4055:(e,t,n)=>{"use strict";var r=n(4576),a=n(34),i=r.document,o=a(i)&&a(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},6837:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},8727:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2839:(e,t,n)=>{"use strict";var r=n(4576).navigator,a=r&&r.userAgent;e.exports=a?String(a):""},9519:(e,t,n)=>{"use strict";var r,a,i=n(4576),o=n(2839),s=i.process,c=i.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u&&(a=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!a&&o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(a=+r[1]),e.exports=a},6518:(e,t,n)=>{"use strict";var r=n(4576),a=n(7347).f,i=n(6699),o=n(6840),s=n(9433),c=n(7740),l=n(2796);e.exports=function(e,t){var n,u,d,p,f,h=e.target,m=e.global,y=e.stat;if(n=m?r:y?r[h]||s(h,{}):r[h]&&r[h].prototype)for(u in t){if(p=t[u],d=e.dontCallGetSet?(f=a(n,u))&&f.value:n[u],!l(m?u:h+(y?".":"#")+u,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;c(p,d)}(e.sham||d&&d.sham)&&i(p,"sham",!0),o(n,u,p,e)}}},9039:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},616:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},9565:(e,t,n)=>{"use strict";var r=n(616),a=Function.prototype.call;e.exports=r?a.bind(a):function(){return a.apply(a,arguments)}},350:(e,t,n)=>{"use strict";var r=n(3724),a=n(9297),i=Function.prototype,o=r&&Object.getOwnPropertyDescriptor,s=a(i,"name"),c=s&&"something"===function(){}.name,l=s&&(!r||r&&o(i,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:l}},6706:(e,t,n)=>{"use strict";var r=n(9504),a=n(9306);e.exports=function(e,t,n){try{return r(a(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},9504:(e,t,n)=>{"use strict";var r=n(616),a=Function.prototype,i=a.call,o=r&&a.bind.bind(i,i);e.exports=r?o:function(e){return function(){return i.apply(e,arguments)}}},7751:(e,t,n)=>{"use strict";var r=n(4576),a=n(4901);e.exports=function(e,t){return arguments.length<2?(n=r[e],a(n)?n:void 0):r[e]&&r[e][t];var n}},4148:e=>{"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},5966:(e,t,n)=>{"use strict";var r=n(9306),a=n(4117);e.exports=function(e,t){var n=e[t];return a(n)?void 0:r(n)}},3789:(e,t,n)=>{"use strict";var r=n(9306),a=n(8551),i=n(9565),o=n(1291),s=n(4148),c="Invalid size",l=RangeError,u=TypeError,d=Math.max,p=function(e,t){this.set=e,this.size=d(t,0),this.has=r(e.has),this.keys=r(e.keys)};p.prototype={getIterator:function(){return s(a(i(this.keys,this.set)))},includes:function(e){return i(this.has,this.set,e)}},e.exports=function(e){a(e);var t=+e.size;if(t!=t)throw new u(c);var n=o(t);if(n<0)throw new l(c);return new p(e,n)}},4576:function(e,t,n){"use strict";var r=function(e){return e&&e.Math===Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||r("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297:(e,t,n)=>{"use strict";var r=n(9504),a=n(8981),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(a(e),t)}},421:e=>{"use strict";e.exports={}},5917:(e,t,n)=>{"use strict";var r=n(3724),a=n(9039),i=n(4055);e.exports=!r&&!a((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},7055:(e,t,n)=>{"use strict";var r=n(9504),a=n(9039),i=n(2195),o=Object,s=r("".split);e.exports=a((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"===i(e)?s(e,""):o(e)}:o},3706:(e,t,n)=>{"use strict";var r=n(9504),a=n(4901),i=n(7629),o=r(Function.toString);a(i.inspectSource)||(i.inspectSource=function(e){return o(e)}),e.exports=i.inspectSource},1181:(e,t,n)=>{"use strict";var r,a,i,o=n(8622),s=n(4576),c=n(34),l=n(6699),u=n(9297),d=n(7629),p=n(6119),f=n(421),h="Object already initialized",m=s.TypeError,y=s.WeakMap;if(o||d.state){var g=d.state||(d.state=new y);g.get=g.get,g.has=g.has,g.set=g.set,r=function(e,t){if(g.has(e))throw new m(h);return t.facade=e,g.set(e,t),t},a=function(e){return g.get(e)||{}},i=function(e){return g.has(e)}}else{var v=p("state");f[v]=!0,r=function(e,t){if(u(e,v))throw new m(h);return t.facade=e,l(e,v,t),t},a=function(e){return u(e,v)?e[v]:{}},i=function(e){return u(e,v)}}e.exports={set:r,get:a,has:i,enforce:function(e){return i(e)?a(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=a(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return n}}}},4376:(e,t,n)=>{"use strict";var r=n(2195);e.exports=Array.isArray||function(e){return"Array"===r(e)}},4901:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},2796:(e,t,n)=>{"use strict";var r=n(9039),a=n(4901),i=/#|\.prototype\./,o=function(e,t){var n=c[s(e)];return n===u||n!==l&&(a(t)?r(t):!!t)},s=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=o.data={},l=o.NATIVE="N",u=o.POLYFILL="P";e.exports=o},4117:e=>{"use strict";e.exports=function(e){return null==e}},34:(e,t,n)=>{"use strict";var r=n(4901);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},6395:e=>{"use strict";e.exports=!1},757:(e,t,n)=>{"use strict";var r=n(7751),a=n(4901),i=n(1625),o=n(7040),s=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return a(t)&&i(t.prototype,s(e))}},507:(e,t,n)=>{"use strict";var r=n(9565);e.exports=function(e,t,n){for(var a,i,o=n?e:e.iterator,s=e.next;!(a=r(s,o)).done;)if(void 0!==(i=t(a.value)))return i}},9539:(e,t,n)=>{"use strict";var r=n(9565),a=n(8551),i=n(5966);e.exports=function(e,t,n){var o,s;a(e);try{if(!(o=i(e,"return"))){if("throw"===t)throw n;return n}o=r(o,e)}catch(e){s=!0,o=e}if("throw"===t)throw n;if(s)throw o;return a(o),n}},6198:(e,t,n)=>{"use strict";var r=n(8014);e.exports=function(e){return r(e.length)}},283:(e,t,n)=>{"use strict";var r=n(9504),a=n(9039),i=n(4901),o=n(9297),s=n(3724),c=n(350).CONFIGURABLE,l=n(3706),u=n(1181),d=u.enforce,p=u.get,f=String,h=Object.defineProperty,m=r("".slice),y=r("".replace),g=r([].join),v=s&&!a((function(){return 8!==h((function(){}),"length",{value:8}).length})),b=String(String).split("String"),x=e.exports=function(e,t,n){"Symbol("===m(f(t),0,7)&&(t="["+y(f(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!o(e,"name")||c&&e.name!==t)&&(s?h(e,"name",{value:t,configurable:!0}):e.name=t),v&&n&&o(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?s&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=d(e);return o(r,"source")||(r.source=g(b,"string"==typeof t?t:"")),e};Function.prototype.toString=x((function(){return i(this)&&p(this).source||l(this)}),"toString")},741:e=>{"use strict";var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},4913:(e,t,n)=>{"use strict";var r=n(3724),a=n(5917),i=n(8686),o=n(8551),s=n(6969),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",f="writable";t.f=r?i?function(e,t,n){if(o(e),t=s(t),o(n),"function"==typeof e&&"prototype"===t&&"value"in n&&f in n&&!n[f]){var r=u(e,t);r&&r[f]&&(e[t]=n.value,n={configurable:p in n?n[p]:r[p],enumerable:d in n?n[d]:r[d],writable:!1})}return l(e,t,n)}:l:function(e,t,n){if(o(e),t=s(t),o(n),a)try{return l(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new c("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},7347:(e,t,n)=>{"use strict";var r=n(3724),a=n(9565),i=n(8773),o=n(6980),s=n(5397),c=n(6969),l=n(9297),u=n(5917),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=s(e),t=c(t),u)try{return d(e,t)}catch(e){}if(l(e,t))return o(!a(i.f,e,t),e[t])}},8480:(e,t,n)=>{"use strict";var r=n(1828),a=n(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,a)}},3717:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},1625:(e,t,n)=>{"use strict";var r=n(9504);e.exports=r({}.isPrototypeOf)},1828:(e,t,n)=>{"use strict";var r=n(9504),a=n(9297),i=n(5397),o=n(9617).indexOf,s=n(421),c=r([].push);e.exports=function(e,t){var n,r=i(e),l=0,u=[];for(n in r)!a(s,n)&&a(r,n)&&c(u,n);for(;t.length>l;)a(r,n=t[l++])&&(~o(u,n)||c(u,n));return u}},8773:(e,t)=>{"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,a=r&&!n.call({1:2},1);t.f=a?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},4270:(e,t,n)=>{"use strict";var r=n(9565),a=n(4901),i=n(34),o=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&a(n=e.toString)&&!i(s=r(n,e)))return s;if(a(n=e.valueOf)&&!i(s=r(n,e)))return s;if("string"!==t&&a(n=e.toString)&&!i(s=r(n,e)))return s;throw new o("Can't convert object to primitive value")}},5031:(e,t,n)=>{"use strict";var r=n(7751),a=n(9504),i=n(8480),o=n(3717),s=n(8551),c=a([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(s(e)),n=o.f;return n?c(t,n(e)):t}},7750:(e,t,n)=>{"use strict";var r=n(4117),a=TypeError;e.exports=function(e){if(r(e))throw new a("Can't call method on "+e);return e}},9286:(e,t,n)=>{"use strict";var r=n(4402),a=n(8469),i=r.Set,o=r.add;e.exports=function(e){var t=new i;return a(e,(function(e){o(t,e)})),t}},3440:(e,t,n)=>{"use strict";var r=n(7080),a=n(4402),i=n(9286),o=n(5170),s=n(3789),c=n(8469),l=n(507),u=a.has,d=a.remove;e.exports=function(e){var t=r(this),n=s(e),a=i(t);return o(t)<=n.size?c(t,(function(e){n.includes(e)&&d(a,e)})):l(n.getIterator(),(function(e){u(t,e)&&d(a,e)})),a}},4402:(e,t,n)=>{"use strict";var r=n(9504),a=Set.prototype;e.exports={Set,add:r(a.add),has:r(a.has),remove:r(a.delete),proto:a}},8750:(e,t,n)=>{"use strict";var r=n(7080),a=n(4402),i=n(5170),o=n(3789),s=n(8469),c=n(507),l=a.Set,u=a.add,d=a.has;e.exports=function(e){var t=r(this),n=o(e),a=new l;return i(t)>n.size?c(n.getIterator(),(function(e){d(t,e)&&u(a,e)})):s(t,(function(e){n.includes(e)&&u(a,e)})),a}},4449:(e,t,n)=>{"use strict";var r=n(7080),a=n(4402).has,i=n(5170),o=n(3789),s=n(8469),c=n(507),l=n(9539);e.exports=function(e){var t=r(this),n=o(e);if(i(t)<=n.size)return!1!==s(t,(function(e){if(n.includes(e))return!1}),!0);var u=n.getIterator();return!1!==c(u,(function(e){if(a(t,e))return l(u,"normal",!1)}))}},3838:(e,t,n)=>{"use strict";var r=n(7080),a=n(5170),i=n(8469),o=n(3789);e.exports=function(e){var t=r(this),n=o(e);return!(a(t)>n.size)&&!1!==i(t,(function(e){if(!n.includes(e))return!1}),!0)}},8527:(e,t,n)=>{"use strict";var r=n(7080),a=n(4402).has,i=n(5170),o=n(3789),s=n(507),c=n(9539);e.exports=function(e){var t=r(this),n=o(e);if(i(t)<n.size)return!1;var l=n.getIterator();return!1!==s(l,(function(e){if(!a(t,e))return c(l,"normal",!1)}))}},8469:(e,t,n)=>{"use strict";var r=n(9504),a=n(507),i=n(4402),o=i.Set,s=i.proto,c=r(s.forEach),l=r(s.keys),u=l(new o).next;e.exports=function(e,t,n){return n?a({iterator:l(e),next:u},t):c(e,t)}},4916:(e,t,n)=>{"use strict";var r=n(7751),a=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};e.exports=function(e){var t=r("Set");try{(new t)[e](a(0));try{return(new t)[e](a(-1)),!1}catch(e){return!0}}catch(e){return!1}}},5170:(e,t,n)=>{"use strict";var r=n(6706),a=n(4402);e.exports=r(a.proto,"size","get")||function(e){return e.size}},3650:(e,t,n)=>{"use strict";var r=n(7080),a=n(4402),i=n(9286),o=n(3789),s=n(507),c=a.add,l=a.has,u=a.remove;e.exports=function(e){var t=r(this),n=o(e).getIterator(),a=i(t);return s(n,(function(e){l(t,e)?u(a,e):c(a,e)})),a}},4204:(e,t,n)=>{"use strict";var r=n(7080),a=n(4402).add,i=n(9286),o=n(3789),s=n(507);e.exports=function(e){var t=r(this),n=o(e).getIterator(),c=i(t);return s(n,(function(e){a(c,e)})),c}},6119:(e,t,n)=>{"use strict";var r=n(5745),a=n(3392),i=r("keys");e.exports=function(e){return i[e]||(i[e]=a(e))}},7629:(e,t,n)=>{"use strict";var r=n(6395),a=n(4576),i=n(9433),o="__core-js_shared__",s=e.exports=a[o]||i(o,{});(s.versions||(s.versions=[])).push({version:"3.39.0",mode:r?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:(e,t,n)=>{"use strict";var r=n(7629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},4495:(e,t,n)=>{"use strict";var r=n(9519),a=n(9039),i=n(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!a((function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},5610:(e,t,n)=>{"use strict";var r=n(1291),a=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?a(n+t,0):i(n,t)}},5397:(e,t,n)=>{"use strict";var r=n(7055),a=n(7750);e.exports=function(e){return r(a(e))}},1291:(e,t,n)=>{"use strict";var r=n(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},8014:(e,t,n)=>{"use strict";var r=n(1291),a=Math.min;e.exports=function(e){var t=r(e);return t>0?a(t,9007199254740991):0}},8981:(e,t,n)=>{"use strict";var r=n(7750),a=Object;e.exports=function(e){return a(r(e))}},2777:(e,t,n)=>{"use strict";var r=n(9565),a=n(34),i=n(757),o=n(5966),s=n(4270),c=n(8227),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!a(e)||i(e))return e;var n,c=o(e,u);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!a(n)||i(n))return n;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},6969:(e,t,n)=>{"use strict";var r=n(2777),a=n(757);e.exports=function(e){var t=r(e,"string");return a(t)?t:t+""}},6823:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},3392:(e,t,n)=>{"use strict";var r=n(9504),a=0,i=Math.random(),o=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++a+i,36)}},7040:(e,t,n)=>{"use strict";var r=n(4495);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686:(e,t,n)=>{"use strict";var r=n(3724),a=n(9039);e.exports=r&&a((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8622:(e,t,n)=>{"use strict";var r=n(4576),a=n(4901),i=r.WeakMap;e.exports=a(i)&&/native code/.test(String(i))},8227:(e,t,n)=>{"use strict";var r=n(4576),a=n(5745),i=n(9297),o=n(3392),s=n(4495),c=n(7040),l=r.Symbol,u=a("wks"),d=c?l.for||l:l&&l.withoutSetter||o;e.exports=function(e){return i(u,e)||(u[e]=s&&i(l,e)?l[e]:d("Symbol."+e)),u[e]}},4114:(e,t,n)=>{"use strict";var r=n(6518),a=n(8981),i=n(6198),o=n(4527),s=n(6837);r({target:"Array",proto:!0,arity:1,forced:n(9039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=a(this),n=i(t),r=arguments.length;s(n+r);for(var c=0;c<r;c++)t[n]=arguments[c],n++;return o(t,n),n}})},7642:(e,t,n)=>{"use strict";var r=n(6518),a=n(3440);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("difference")},{difference:a})},8004:(e,t,n)=>{"use strict";var r=n(6518),a=n(9039),i=n(8750);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("intersection")||a((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:i})},3853:(e,t,n)=>{"use strict";var r=n(6518),a=n(4449);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isDisjointFrom")},{isDisjointFrom:a})},5876:(e,t,n)=>{"use strict";var r=n(6518),a=n(3838);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSubsetOf")},{isSubsetOf:a})},2475:(e,t,n)=>{"use strict";var r=n(6518),a=n(8527);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSupersetOf")},{isSupersetOf:a})},5024:(e,t,n)=>{"use strict";var r=n(6518),a=n(3650);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("symmetricDifference")},{symmetricDifference:a})},1698:(e,t,n)=>{"use strict";var r=n(6518),a=n(4204);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("union")},{union:a})},3375:(e,t,n)=>{"use strict";n(7642)},9225:(e,t,n)=>{"use strict";n(8004)},3972:(e,t,n)=>{"use strict";n(3853)},9209:(e,t,n)=>{"use strict";n(5876)},5714:(e,t,n)=>{"use strict";n(2475)},7561:(e,t,n)=>{"use strict";n(5024)},6197:(e,t,n)=>{"use strict";n(1698)}},t={};function n(r){var a=t[r];if(void 0!==a)return a.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 e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var a=r.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=r[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})();var r={};(()=>{"use strict";n.r(r),n.d(r,{SeamlyStaticCore:()=>su,default:()=>fu}),n(4114);var e=n(2086),t=n.n(e),a=n(8785),i=(n(3375),n(9225),n(3972),n(9209),n(5714),n(7561),n(6197),function(e,t){return i=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])},i(e,t)});function o(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,i=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o}var c=function(e,t){this.target=t,this.type=e},l=function(e){function t(t,n){var r=e.call(this,"error",n)||this;return r.message=t.message,r.error=t,r}return o(t,e),t}(c),u=function(e){function t(t,n,r){void 0===t&&(t=1e3),void 0===n&&(n="");var a=e.call(this,"close",r)||this;return a.wasClean=!0,a.code=t,a.reason=n,a}return o(t,e),t}(c),d=function(){if("undefined"!=typeof WebSocket)return WebSocket},p={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},f=function(){function e(e,t,n){var r=this;void 0===n&&(n={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){r._debug("open event");var t=r._options.minUptime,n=void 0===t?p.minUptime:t;clearTimeout(r._connectTimeout),r._uptimeTimeout=setTimeout((function(){return r._acceptOpen()}),n),r._ws.binaryType=r._binaryType,r._messageQueue.forEach((function(e){return r._ws.send(e)})),r._messageQueue=[],r.onopen&&r.onopen(e),r._listeners.open.forEach((function(t){return r._callEventListener(e,t)}))},this._handleMessage=function(e){r._debug("message event"),r.onmessage&&r.onmessage(e),r._listeners.message.forEach((function(t){return r._callEventListener(e,t)}))},this._handleError=function(e){r._debug("error event",e.message),r._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),r.onerror&&r.onerror(e),r._debug("exec error listeners"),r._listeners.error.forEach((function(t){return r._callEventListener(e,t)})),r._connect()},this._handleClose=function(e){r._debug("close event"),r._clearTimeouts(),r._shouldReconnect&&r._connect(),r.onclose&&r.onclose(e),r._listeners.close.forEach((function(t){return r._callEventListener(e,t)}))},this._url=e,this._protocols=t,this._options=n,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(e,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CONNECTING",{get:function(){return e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OPEN",{get:function(){return e.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSING",{get:function(){return e.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSED",{get:function(){return e.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce((function(e,t){return"string"==typeof t?e+=t.length:t instanceof Blob?e+=t.size:e+=t.byteLength,e}),0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),e.prototype.close=function(e,t){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,t):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},e.prototype.reconnect=function(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,t),this._connect()):this._connect()},e.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{var t=this._options.maxEnqueuedMessages,n=void 0===t?p.maxEnqueuedMessages:t;this._messageQueue.length<n&&(this._debug("enqueue",e),this._messageQueue.push(e))}},e.prototype.addEventListener=function(e,t){this._listeners[e]&&this._listeners[e].push(t)},e.prototype.dispatchEvent=function(e){var t,n,r=this._listeners[e.type];if(r)try{for(var a=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(r),i=a.next();!i.done;i=a.next()){var o=i.value;this._callEventListener(e,o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return!0},e.prototype.removeEventListener=function(e,t){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter((function(e){return e!==t})))},e.prototype._debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._options.debug&&console.log.apply(console,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e}(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,n=void 0===t?p.reconnectionDelayGrowFactor:t,r=e.minReconnectionDelay,a=void 0===r?p.minReconnectionDelay:r,i=e.maxReconnectionDelay,o=void 0===i?p.maxReconnectionDelay:i,s=0;return this._retryCount>0&&(s=a*Math.pow(n,this._retryCount-1))>o&&(s=o),this._debug("next delay",s),s},e.prototype._wait=function(){var e=this;return new Promise((function(t){setTimeout(t,e._getNextDelay())}))},e.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var t=e();if("string"==typeof t)return Promise.resolve(t);if(t.then)return t}throw Error("Invalid URL")},e.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var t=this._options,n=t.maxRetries,r=void 0===n?p.maxRetries:n,a=t.connectionTimeout,i=void 0===a?p.connectionTimeout:a,o=t.WebSocket,s=void 0===o?d():o;if(this._retryCount>=r)this._debug("max retries reached",this._retryCount,">=",r);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),void 0===(c=s)||!c||2!==c.CLOSING)throw Error("No valid WebSocket class provided");var c;this._wait().then((function(){return e._getNextUrl(e._url)})).then((function(t){e._closeCalled||(e._debug("connect",{url:t,protocols:e._protocols}),e._ws=e._protocols?new s(t,e._protocols):new s(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout((function(){return e._handleTimeout()}),i))}))}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new l(Error("TIMEOUT"),this))},e.prototype._disconnect=function(e,t){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new u(e,t,this))}catch(e){}}},e.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},e.prototype._callEventListener=function(e,t){"handleEvent"in t?t.handleEvent(e):t(e)},e.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},e.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},e.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},e}();const h=f,m=new Set;class y{#e=[];#t=null;#n=null;#r=e=>{const t=JSON.parse(e.data);this.#t&&clearInterval(this.#t),this.#t=setInterval((()=>{this.socket?.readyState===h.OPEN&&this.socket?.send(JSON.stringify({type:"ping"}))}),3e4);try{if("attach_channel_response"===t.type){if(!t.payload.success)return void this.#a({connected:!0,ready:!1,currentState:"attach_channel_erred"});this.#a({connected:!0,ready:!0,currentState:"attach_channel_response"})}}catch(e){console.warn(e)}};#i=()=>{this.#a({connected:!1,ready:!1,currentState:"socket_closed"})};#o=()=>{this.#a({connected:!1,ready:!1,currentState:"socket_join_error"})};accessToken="";channelName="";channelTopic="";url="";async connect(e,t,n,r){this.url=e,this.accessToken=r,this.channelName=t,this.channelTopic=n;const{url:a}=(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{...e,[n]:decodeURIComponent(r)}}),{})}})(this.url);this.socket=new h(a,[],{maxReconnectionDelay:1e4,minReconnectionDelay:500,reconnectionDelayGrowFactor:2});const i={type:"attach_channel",payload:{accessToken:this.accessToken,channelName:this.channelName}};this.#n=()=>{this.socket?.send(JSON.stringify(i)),this.#a({connected:!0,ready:!1,currentState:"socket_connected"})},this.socket?.addEventListener("open",this.#n),this.socket?.addEventListener("message",this.#r),this.socket?.addEventListener("close",this.#i),this.socket?.addEventListener("error",this.#o)}disconnect(){this.socket?.close(),this.#n&&this.socket?.removeEventListener("open",this.#n),this.socket?.removeEventListener("message",this.#r),this.socket?.removeEventListener("close",this.#i),this.socket?.removeEventListener("error",this.#o),this.#e=[]}onOpen=e=>{this?.socket?.addEventListener("open",e)};onError=e=>{this?.socket?.addEventListener("error",e)};addListener=(e,t)=>{this?.socket?.addEventListener(e,(e=>t(JSON.parse(e.data))))};onMessage=e=>{this?.socket&&(this.socket.onmessage=t=>e(JSON.parse(t.data)))};removeListener=(e,t)=>{this.socket?.removeEventListener(e,t)};onConnection(e){this.#e.push(e)}#a(e){this.#e=this.#e.filter((t=>!t(e))),m.forEach((e=>e()))}pushToChannel(e,t){this.socket?.send(JSON.stringify({type:e,payload:t}))}static subscribe(e){return m.add(e),()=>m.delete(e)}}class g extends Error{constructor(e,t){super(e,{cause:t?.cause}),this.status=t?.status}}class v extends Error{action="";langKey="";constructor(e,...t){if(super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Object.getPrototypeOf(this)),this.originalError=e,e?.payload&&(this.originalEvent=e,this.originalError=e.payload.error,this.message=`Event of type ${e.payload.type} encountered`),!this.message&&e?.message){const t=function(e){try{return JSON.parse(e).error}catch(t){return e}}(e.message);this.message=t}e?.error&&(this.originalError=e.error)}}class b extends v{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class x extends v{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class w extends v{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class _ extends v{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}function C(e){const t=`cvco.${e}`;return{get(){const e=[t,t.split(".").slice(0,-1).join(".")];let n;do{n=sessionStorage.getItem(e[0])}while(e.shift()&&!n);return n?JSON.parse(n):{}},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}const S="message",E="text",j="text",T="upload",I="received",N="read",L="custom",k="typing",M="read",A="detach_service",O="dismiss",P="set_topic",R="click_cta",D="translation_proposal",z=D,F="window_api",U="assertive",B="polite",H={new_topic:"newTopic",new_translation:"newTranslation"},$="uploads",V="navigate";function G(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}const W=async(e,t)=>{const n=new URL(e),r=await fetch(n.href,{mode:"cors",...t});if(!r.ok)throw new g(r.statusText||`Request failed with status: ${r.status}`,{status:r.status});return r};function q(){if(!Intl||"undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return;const e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return;const t=e.resolvedOptions().timeZone;return t&&(t.indexOf("/")>-1||"UTC"===t)?t:void 0}const K=(...e)=>console.debug("seamly",...e);class J{#s;#c;#l;#u="window";#d;#p="new";URLS={};locale="";conversation=new y;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.userLocale?`.${r.userLocale}`:""}`,n.storageProvider||C),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},this.#d={...n,sendEnvironment:n.sendEnvironment??!0,context:{...r,channelName:r.channelName||"web"}},this.#s=!1,this.connected=!1,this.configReady=!1,n.externalId&&(this.#c=n.externalId),this.#u=e,this.userResponded=!1,this.URLS={translations:{href:`/channels/api/v2/client/${this.connectionInfo.apiKey}/translations/{version}/{locale}.json`,templated:!0},config:{href:`/channels/api/v2/client/${this.connectionInfo.apiKey}/configs`,templated:!0}},window.addEventListener("pageshow",(e=>{e.persisted&&this.connected&&this.connect()}))}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?.href)}hasConversation(){return!!this.getConversationUrl()}getChannelTopic(){return this.store.get("channelTopic")||this.store.get("channelName")}getLocale=e=>e||this.locale;#f({_links:{self:e,...t}}){this.URLS={...this.URLS,...t}}clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}#h(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`}async getTranslations(e){try{if(!this.URLS.translations?.href)throw new b;const t=`${this.#h("http")}${this.URLS.translations.href}`.replace("{version}",String(4)).replace("{locale}",this.getLocale(e)),n=await W(t,{method:"GET"});return(await n.json()).translations}catch(e){if(e.status>=500)throw new x(e);throw new g(e)}}getContext(e){const{source:t,userLocale:n,variables:r}=e;if(t&&"string"!=typeof t)throw new Error("Source must be a string");if(n){if("string"!=typeof n)throw new Error("Locale must be a string");this.#m(e,n)}if(r&&"object"!=typeof r)throw new Error("Variables must be an object");if(0===Object.keys(e).length&&e.constructor===Object)return;const a=this.#d.context?.contentLocale,i=this.#d.context?.userLocale;return{...a?{contentLocale:a}:{},...i?{userLocale:i}:{},...e}}async downloadFile(e,t){try{const n=await W(`${this.#h("http")}${this.URLS.uploads.href}/${e}`,{method:"GET",headers:{Authorization:`Bearer ${this.getAccessToken()}`}}),r=document.createElement("a"),a=URL.createObjectURL(await n.blob());r.href=a,void 0!==r.download&&(r.download=t),r.click(),setTimeout((()=>{URL.revokeObjectURL(a)}),6e4)}catch(e){}}uploadFile(e,t,n,r){const a=new FormData;a.append("upload",e);const i=new XMLHttpRequest;return i.open("POST",`${this.#h("http")}${this.URLS.uploads.href}`),i.setRequestHeader("Authorization",`Bearer ${this.getAccessToken()}`),i.upload.onprogress=e=>{if("function"==typeof t){const n=Math.ceil(e.loaded/e.total*100);t(n)}},i.onloadend=()=>{if(0!==i.status)if(200!==i.status&&201!==i.status||!n){if(!r)throw new Error(i.response);try{r(JSON.parse(i.response))}catch(e){r(i.response)}}else try{n(JSON.parse(i.response))}catch(e){n(i.response)}},i.send(a),i}async createConversation(){try{"function"==typeof this.#d?.getConversationAuthToken&&(this.#l=await this.#d.getConversationAuthToken());const e=await W(`${this.#h("http")}${this.URLS.conversations?.href}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({externalId:this.#l?void 0:this.#c,token:this.#l})}),t=await e.json(),{conversation:n}=t,r={...n};return this.setAccessToken(n.accessToken),this.#f(t),this.URLS.conversation&&this.setConversationUrl(this.URLS.conversation),this.locale=n.context.userLocale,this.userResponded=n.userResponded,this.#p=n.status,r}catch(e){if(e.status>=500)throw new x(e);if(400===e.status)throw new _(e);if(404===e.status)throw new b(e);throw e}}async getConfig(){try{const e={channelName:this.#d.context.channelName,contentLocale:this.#d.context.contentLocale,environment:!0===this.#d.sendEnvironment?this.getEnvironment():this.#d.sendEnvironment,userLocale:this.#d.context.userLocale,variables:this.#d.context.variables},t=await W(`${this.#h("http")}${this.URLS.config?.href}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e})}),n=await t.json();return this.#f(n),this.configReady=!0,n.config}catch(e){if(404===e.status)throw new b(e);if(e.status>=500)throw new x(e);throw e}}async fetchConversation(){if(!this.hasConversation())return null;try{const e=await W(`${this.#h("http")}${this.getConversationUrl()}`,{method:"GET",headers:{Authorization:`Bearer ${this.getAccessToken()}`}}),t=await e.json();return this.#p=t.conversation.status,this.#f(t),t.conversation}catch(e){if(401===e.status)throw new _(e);if(404===e.status)throw new w(e);if(e.status>=500)throw new x(e);throw e}}async getConversation(){return this.hasConversation()?this.fetchConversation():null}async getConversationIntitialState(){return this.fetchConversation()}async disconnect(){this.conversation?.disconnect&&this.conversation.disconnect(),this.connected=!1,this.configReady=!1}async connect(){this.connected=!1;const e=this.hasConversation()?void 0:await this.createConversation();return this.URLS.socket&&(this.conversation.connect(`${this.#h("ws")}${this.URLS.socket.href}`,this.#d.context.channelName||"",this.getChannelTopic(),this.getAccessToken()),this.conversation.onConnection((({connected:e,ready:t})=>{this.connected=e,this.#s=t})),this.send("context",this.#y())),e}send(e,t=void 0){this.connected&&this.#s?(K("[SEND]",e,t),this.conversation.pushToChannel(e,function(e,t){if("message"!==e)return t;const{type:n,body:r}=t;let{transactionId:a}=t;return a||(a=G()),{type:n,body:r,transactionId:a}}(e,t))):this.conversation?.onConnection((({connected:n,ready:r})=>(this.connected=n,this.#s=r,!!r&&(this.send(e,t),!0))))}sendContext(e){const t=this.getContext(e);t&&this.send("context",t)}#y(){const e=!0===this.#d.sendEnvironment?this.getEnvironment():void 0,t="string"==typeof this.#d.context?.source?this.#d.context?.source:void 0,n=this.#d.context?.variables;return{contentLocale:"started"!==this.#p?this.#d.context?.contentLocale:void 0,environment:e,source:t,userLocale:"started"!==this.#p?this.#d.context?.userLocale:void 0,variables:n}}#m(e,t){e.source||t==this.#d.context?.userLocale||(e.source=F)}getEnvironment(){return{clientName:"@seamly/web-ui",clientVariant:this.#u,clientVersion:"24.2.1-beta.1",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:q(),userAgent:navigator.userAgent,preferredLocale:navigator.language}}}function X(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 Y=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Z=()=>Math.random().toString(36).substring(7).split("").join("."),Q={INIT:`@@redux/INIT${Z()}`,REPLACE:`@@redux/REPLACE${Z()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Z()}`};function ee(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function te(e,t,n){if("function"!=typeof e)throw new Error(X(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(X(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(X(1));return n(te)(e,t)}let r=e,a=t,i=new Map,o=i,s=0,c=!1;function l(){o===i&&(o=new Map,i.forEach(((e,t)=>{o.set(t,e)})))}function u(){if(c)throw new Error(X(3));return a}function d(e){if("function"!=typeof e)throw new Error(X(4));if(c)throw new Error(X(5));let t=!0;l();const n=s++;return o.set(n,e),function(){if(t){if(c)throw new Error(X(6));t=!1,l(),o.delete(n),i=null}}}function p(e){if(!ee(e))throw new Error(X(7));if(void 0===e.type)throw new Error(X(8));if("string"!=typeof e.type)throw new Error(X(17));if(c)throw new Error(X(9));try{c=!0,a=r(a,e)}finally{c=!1}return(i=o).forEach((e=>{e()})),e}return p({type:Q.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(X(10));r=e,p({type:Q.REPLACE})},[Y]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(X(11));function n(){const e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[Y](){return this}}}}}function ne(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const a=t[r];"function"==typeof e[a]&&(n[a]=e[a])}const r=Object.keys(n);let a;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:Q.INIT}))throw new Error(X(12));if(void 0===n(void 0,{type:Q.PROBE_UNKNOWN_ACTION()}))throw new Error(X(13))}))}(n)}catch(e){a=e}return function(e={},t){if(a)throw a;let i=!1;const o={};for(let a=0;a<r.length;a++){const s=r[a],c=n[s],l=e[s],u=c(l,t);if(void 0===u)throw t&&t.type,new Error(X(14));o[s]=u,i=i||u!==l}return i=i||r.length!==Object.keys(e).length,i?o:e}}function re(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function ae(e){return({dispatch:t,getState:n})=>r=>a=>"function"==typeof a?a(t,n,e):r(a)}var ie=ae(),oe=ae,se=Symbol.for("immer-nothing"),ce=Symbol.for("immer-draftable"),le=Symbol.for("immer-state");function ue(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var de=Object.getPrototypeOf;function pe(e){return!!e&&!!e[le]}function fe(e){return!!e&&(me(e)||Array.isArray(e)||!!e[ce]||!!e.constructor?.[ce]||xe(e)||we(e))}var he=Object.prototype.constructor.toString();function me(e){if(!e||"object"!=typeof e)return!1;const t=de(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===he}function ye(e,t){0===ge(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function ge(e){const t=e[le];return t?t.type_:Array.isArray(e)?1:xe(e)?2:we(e)?3:0}function ve(e,t){return 2===ge(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function be(e,t,n){const r=ge(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function xe(e){return e instanceof Map}function we(e){return e instanceof Set}function _e(e){return e.copy_||e.base_}function Ce(e,t){if(xe(e))return new Map(e);if(we(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=me(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[le];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const a=n[r],i=t[a];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[a]})}return Object.create(de(e),t)}{const t=de(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function Se(e,t=!1){return je(e)||pe(e)||!fe(e)||(ge(e)>1&&(e.set=e.add=e.clear=e.delete=Ee),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Se(t,!0)))),e}function Ee(){ue(2)}function je(e){return Object.isFrozen(e)}var Te,Ie={};function Ne(e){const t=Ie[e];return t||ue(0),t}function Le(){return Te}function ke(e,t){t&&(Ne("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Me(e){Ae(e),e.drafts_.forEach(Pe),e.drafts_=null}function Ae(e){e===Te&&(Te=e.parent_)}function Oe(e){return Te={drafts_:[],parent_:Te,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Pe(e){const t=e[le];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Re(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[le].modified_&&(Me(t),ue(4)),fe(e)&&(e=De(t,e),t.parent_||Fe(t,e)),t.patches_&&Ne("Patches").generateReplacementPatches_(n[le].base_,e,t.patches_,t.inversePatches_)):e=De(t,n,[]),Me(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==se?e:void 0}function De(e,t,n){if(je(t))return t;const r=t[le];if(!r)return ye(t,((a,i)=>ze(e,r,t,a,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return Fe(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let a=t,i=!1;3===r.type_&&(a=new Set(t),t.clear(),i=!0),ye(a,((a,o)=>ze(e,r,t,a,o,n,i))),Fe(e,t,!1),n&&e.patches_&&Ne("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function ze(e,t,n,r,a,i,o){if(pe(a)){const o=De(e,a,i&&t&&3!==t.type_&&!ve(t.assigned_,r)?i.concat(r):void 0);if(be(n,r,o),!pe(o))return;e.canAutoFreeze_=!1}else o&&n.add(a);if(fe(a)&&!je(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;De(e,a),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||Fe(e,a)}}function Fe(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Se(t,n)}var Ue={get(e,t){if(t===le)return e;const n=_e(e);if(!ve(n,t))return function(e,t,n){const r=$e(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!fe(r)?r:r===He(e.base_,t)?(Ge(e),e.copy_[t]=We(r,e)):r},has:(e,t)=>t in _e(e),ownKeys:e=>Reflect.ownKeys(_e(e)),set(e,t,n){const r=$e(_e(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=He(_e(e),t),o=r?.[le];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((a=n)===(i=r)?0!==a||1/a==1/i:a!=a&&i!=i)&&(void 0!==n||ve(e.base_,t)))return!0;Ge(e),Ve(e)}var a,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==He(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Ge(e),Ve(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=_e(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){ue(11)},getPrototypeOf:e=>de(e.base_),setPrototypeOf(){ue(12)}},Be={};function He(e,t){const n=e[le];return(n?_e(n):e)[t]}function $e(e,t){if(!(t in e))return;let n=de(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=de(n)}}function Ve(e){e.modified_||(e.modified_=!0,e.parent_&&Ve(e.parent_))}function Ge(e){e.copy_||(e.copy_=Ce(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function We(e,t){const n=xe(e)?Ne("MapSet").proxyMap_(e,t):we(e)?Ne("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Le(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=r,i=Ue;n&&(a=[r],i=Be);const{revoke:o,proxy:s}=Proxy.revocable(a,i);return r.draft_=s,r.revoke_=o,s}(e,t);return(t?t.scope_:Le()).drafts_.push(n),n}function qe(e){if(!fe(e)||je(e))return e;const t=e[le];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ce(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Ce(e,!0);return ye(n,((e,t)=>{be(n,e,qe(t))})),t&&(t.finalized_=!1),n}ye(Ue,((e,t)=>{Be[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Be.deleteProperty=function(e,t){return Be.set.call(this,e,t,void 0)},Be.set=function(e,t,n){return Ue.set.call(this,e[0],t,n,e[0])};var Ke=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...a){return r.produce(e,(e=>t.call(this,e,...a)))}}let r;if("function"!=typeof t&&ue(6),void 0!==n&&"function"!=typeof n&&ue(7),fe(e)){const a=Oe(this),i=We(e,void 0);let o=!0;try{r=t(i),o=!1}finally{o?Me(a):Ae(a)}return ke(a,n),Re(r,a)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===se&&(r=void 0),this.autoFreeze_&&Se(r,!0),n){const t=[],a=[];Ne("Patches").generateReplacementPatches_(e,r,t,a),n(t,a)}return r}ue(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){var t;fe(e)||ue(8),pe(e)&&(pe(t=e)||ue(10),e=qe(t));const n=Oe(this),r=We(e,void 0);return r[le].isManual_=!0,Ae(n),r}finishDraft(e,t){const n=e&&e[le];n&&n.isManual_||ue(9);const{scope_:r}=n;return ke(r,t),Re(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Ne("Patches").applyPatches_;return pe(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},Je=Ke.produce;Ke.produceWithPatches.bind(Ke),Ke.setAutoFreeze.bind(Ke),Ke.setUseStrictShallowCopy.bind(Ke),Ke.applyPatches.bind(Ke),Ke.createDraft.bind(Ke),Ke.finishDraft.bind(Ke);var Xe="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?re:re.apply(null,arguments)},Ye=("undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function Ze(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(xt(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return ee(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var Qe=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function et(e){return fe(e)?Je(e,(()=>{})):e}function tt(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var nt=e=>t=>{setTimeout(t,e)};function rt(e){const t=function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:a=!0}=e??{};let i=new Qe;return t&&("boolean"==typeof t?i.push(ie):i.push(oe(t.extraArgument))),i},{reducer:n,middleware:r,devTools:a=!0,preloadedState:i,enhancers:o}=e||{};let s,c;if("function"==typeof n)s=n;else{if(!ee(n))throw new Error(xt(1));s=ne(n)}c="function"==typeof r?r(t):t();let l=re;a&&(l=Xe({trace:!1,..."object"==typeof a&&a}));const u=function(...e){return t=>(n,r)=>{const a=t(n,r);let i=()=>{throw new Error(X(15))};const o={getState:a.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map((e=>e(o)));return i=re(...s)(a.dispatch),{...a,dispatch:i}}}(...c),d=(e=>function(t){const{autoBatch:n=!0}=t??{};let r=new Qe(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let a=!0,i=!1,o=!1;const s=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:nt(10):"callback"===e.type?e.queueNotification:nt(e.timeout),l=()=>{o=!1,i&&(i=!1,s.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>a&&e()));return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return a=!e?.meta?.RTK_autoBatch,i=!a,i&&(o||(o=!0,c(l))),r.dispatch(e)}finally{a=!0}}})})("object"==typeof n?n:void 0)),r})(u);return te(s,i,l(..."function"==typeof o?o(d):d()))}function at(e){const t={},n=[];let r;const a={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(xt(28));if(r in t)throw new Error(xt(29));return t[r]=n,a},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),a),addDefaultCase:e=>(r=e,a)};return e(a),[t,n,r]}function it(...e){return t=>e.some((e=>((e,t)=>Ye(e)?e.match(t):e(t))(e,t)))}var ot=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},st=["name","message","stack","code"],ct=class{constructor(e,t){this.payload=e,this.meta=t}_type},lt=class{constructor(e,t){this.payload=e,this.meta=t}_type},ut=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of st)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},dt=(()=>{function e(e,t,n){const r=Ze(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}}))),a=Ze(e+"/pending",((e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}}))),i=Ze(e+"/rejected",((e,t,r,a,i)=>({payload:a,error:(n&&n.serializeError||ut)(e||"Rejected"),meta:{...i||{},arg:r,requestId:t,rejectedWithValue:!!a,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(o,s,c)=>{const l=n?.idGenerator?n.idGenerator(e):ot(),u=new AbortController;let d,p;function f(e){p=e,u.abort()}const h=async function(){let h;try{let i=n?.condition?.(e,{getState:s,extra:c});if(null!==(m=i)&&"object"==typeof m&&"function"==typeof m.then&&(i=await i),!1===i||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const y=new Promise(((e,t)=>{d=()=>{t({name:"AbortError",message:p||"Aborted"})},u.signal.addEventListener("abort",d)}));o(a(l,e,n?.getPendingMeta?.({requestId:l,arg:e},{getState:s,extra:c}))),h=await Promise.race([y,Promise.resolve(t(e,{dispatch:o,getState:s,extra:c,requestId:l,signal:u.signal,abort:f,rejectWithValue:(e,t)=>new ct(e,t),fulfillWithValue:(e,t)=>new lt(e,t)})).then((t=>{if(t instanceof ct)throw t;return t instanceof lt?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){h=t instanceof ct?i(null,l,e,t.payload,t.meta):i(t,l,e)}finally{d&&u.signal.removeEventListener("abort",d)}var m;return n&&!n.dispatchConditionRejection&&i.match(h)&&h.meta.condition||o(h),h}();return Object.assign(h,{abort:f,requestId:l,arg:e,unwrap:()=>h.then(pt)})}}),{pending:a,rejected:i,fulfilled:r,settled:it(i,r),typePrefix:e})}return e.withTypes=()=>e,e})();function pt(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var ft=Symbol.for("rtk-slice-createasyncthunk");function ht(e,t){return`${e}/${t}`}function mt({creators:e}={}){const t=e?.asyncThunk?.[ft];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(xt(11));const a=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},i=Object.keys(a),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(xt(12));if(n in o.sliceCaseReducersByType)throw new Error(xt(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher:(e,t)=>(o.sliceMatchers.push({matcher:e,reducer:t}),s),exposeAction:(e,t)=>(o.actionCreators[e]=t,s),exposeCaseReducer:(e,t)=>(o.sliceCaseReducersByName[e]=t,s)};function c(){const[t={},n=[],r]="function"==typeof e.extraReducers?at(e.extraReducers):[e.extraReducers],a={...t,...o.sliceCaseReducersByType};return function(e){let t,[i,s,c]=at((e=>{for(let t in a)e.addCase(t,a[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)}));if("function"==typeof e)t=()=>et(e());else{const n=et(e);t=()=>n}function l(e=t(),n){let r=[i[n.type],...s.filter((({matcher:e})=>e(n))).map((({reducer:e})=>e))];return 0===r.filter((e=>!!e)).length&&(r=[c]),r.reduce(((e,t)=>{if(t){if(pe(e)){const r=t(e,n);return void 0===r?e:r}if(fe(e))return Je(e,(e=>t(e,n)));{const r=t(e,n);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e}),e)}return l.getInitialState=t,l}(e.initialState)}i.forEach((r=>{const i=a[r],o={reducerName:r,type:ht(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:n},r,a){let i,o;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(xt(17));i=r.reducer,o=r.prepare}else i=r;a.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,o?Ze(e,o):Ze(e))}(o,i,s):function({type:e,reducerName:t},n,r,a){if(!a)throw new Error(xt(18));const{payloadCreator:i,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=a(e,i,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||vt,pending:s||vt,rejected:c||vt,settled:l||vt})}(o,i,s,t)}));const l=e=>e,u=new Map;let d;function p(e,t){return d||(d=c()),d(e,t)}function f(){return d||(d=c()),d.getInitialState()}function h(t,n=!1){function r(e){let r=e[t];return void 0===r&&n&&(r=f()),r}function a(t=l){const r=tt(u,n,(()=>new WeakMap));return tt(r,t,(()=>{const r={};for(const[a,i]of Object.entries(e.selectors??{}))r[a]=yt(i,t,f,n);return r}))}return{reducerPath:t,getSelectors:a,get selectors(){return a(r)},selectSlice:r}}const m={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:f,...h(r),injectInto(e,{reducerPath:t,...n}={}){const a=t??r;return e.inject({reducerPath:a,reducer:p},n),{...m,...h(a,!0)}}};return m}}function yt(e,t,n,r){function a(a,...i){let o=t(a);return void 0===o&&r&&(o=n()),e(o,...i)}return a.unwrapped=e,a}var gt=mt();function vt(){}var{assign:bt}=Object;function xt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}Symbol.for("rtk-state-proxy-original");class wt extends v{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}const _t=dt("initializeConfig",(async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{try{const{features:e,preChat:r,agentParticipant:a,defaultContentLocale:i,defaultUserLocale:o,userParticipant:s,startChatIcon:c}=await t.getConfig(),{connectWhenInView:l}=n;return{features:e,preChat:r,agentParticipant:a,userParticipant:s,startChatIcon:c,defaultUserLocale:n?.context?.userLocale||o,defaultContentLocale:n?.context?.contentLocale||i,connectWhenInView:l}}catch(e){return r(e)}})),Ct=dt("resetConfig",(async(e,{extra:{config:t}})=>t));var St=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var Et="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function jt(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let a,i=0;function o(){let t=n;const{length:o}=arguments;for(let e=0,n=o;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t={s:0,v:void 0,o:null,p:null},e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t={s:0,v:void 0,o:null,p:null},e.set(n,t)):t=r}}const s=t;let c;if(1===t.s)c=t.v;else if(c=e.apply(null,arguments),i++,r){const e=a?.deref?.()??a;null!=e&&r(e,c)&&(c=e,0!==i&&i--),a="object"==typeof c&&null!==c||"function"==typeof c?new Et(c):c}return s.s=1,s.v=c,c}return o.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},o.resetResultsCount()},o.resultsCount=()=>i,o.resetResultsCount=()=>{i=0},o}function Tt(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,a=0,i={},o=e.pop();"object"==typeof o&&(i=o,o=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);const s={...n,...i},{memoize:c,memoizeOptions:l=[],argsMemoize:u=jt,argsMemoizeOptions:d=[],devModeChecks:p={}}=s,f=St(l),h=St(d),m=function(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const n=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),y=c((function(){return r++,o.apply(null,arguments)}),...f),g=u((function(){a++;const e=function(e,t){const n=[],{length:r}=e;for(let a=0;a<r;a++)n.push(e[a].apply(null,t));return n}(m,arguments);return t=y.apply(null,e),t}),...h);return Object.assign(g,{resultFunc:o,memoizedResultFunc:y,dependencies:m,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:c,argsMemoize:u})};return Object.assign(r,{withTypes:()=>r}),r}var It=Tt(jt),Nt=Object.assign(((e,t=It)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map((t=>e[t])),((...e)=>e.reduce(((e,t,r)=>(e[n[r]]=t,e)),{})))}),{withTypes:()=>Nt});const Lt=It((({app:e})=>e),(({userHasResponded:e})=>e)),kt="visibility",Mt={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},At=It((({config:e})=>e),(e=>{let t={visible:"inline"===e?.layoutMode?Mt.open:Mt.minimized,appContainerClassNames:e?.appContainerClassNames||[],...e};return"function"==typeof t.appContainerClassNames&&(t={...t,appContainerClassNames:t.appContainerClassNames(t)}),t})),Ot=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:a,layoutMode:i,hideOnNoUserResponse:o}=r,{visible:s}=a||{};return"app"!==i||t?"window"===i&&o&&n!==Mt.open?e?n||t||Mt.open:Mt.hidden:"inline"===i&&e&&!n?t||Mt.open:n||t||s||Mt.minimized:Mt.open};var Pt=n(7402),Rt=n(8418),Dt=Pt.default,zt=Symbol.for("react-redux-context"),Ft="undefined"!=typeof globalThis?globalThis:{};function Ut(){if(!Dt.createContext)return{};const e=Ft[zt]??(Ft[zt]=new Map);let t=e.get(Dt.createContext);return t||(t=Dt.createContext(null),e.set(Dt.createContext,t)),t}var Bt=Ut();function Ht(e=Bt){return function(){return Dt.useContext(e)}}var $t=Ht(),Vt=()=>{throw new Error("uSES not initialized!")},Gt=(e,t)=>e===t;function Wt(e=Bt){const t=e===Bt?$t:Ht(e),n=(e,n={})=>{const{equalityFn:r=Gt,devModeChecks:a={}}="function"==typeof n?{equalityFn:n}:n,{store:i,subscription:o,getServerState:s,stabilityCheck:c,identityFunctionCheck:l}=t(),u=(Dt.useRef(!0),Dt.useCallback({[e.name]:t=>e(t)}[e.name],[e,c,a.stabilityCheck])),d=Vt(o.addNestedSub,i.getState,s||i.getState,u,r);return Dt.useDebugValue(d),d};return Object.assign(n,{withTypes:()=>n}),n}var qt=Wt();Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen"),Symbol.for("react.client.reference");var Kt={notify(){},get:()=>[]};var Jt=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Xt="undefined"!=typeof navigator&&"ReactNative"===navigator.product,Yt=Jt||Xt?Dt.useLayoutEffect:Dt.useEffect;Object.defineProperty,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var Zt=function({store:e,context:t,children:n,serverState:r,stabilityCheck:a="once",identityFunctionCheck:i="once"}){const o=Dt.useMemo((()=>{const t=function(e,t){let n,r=Kt,a=0,i=!1;function o(){l.onStateChange&&l.onStateChange()}function s(){a++,n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){let e=null,t=null;return{clear(){e=null,t=null},notify(){(()=>{let t=e;for(;t;)t.callback(),t=t.next})()},get(){const t=[];let n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0;const a=t={callback:n,next:null,prev:t};return a.prev?a.prev.next=a:e=a,function(){r&&null!==e&&(r=!1,a.next?a.next.prev=a.prev:t=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}())}function c(){a--,n&&0===a&&(n(),n=void 0,r.clear(),r=Kt)}const l={addNestedSub:function(e){s();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),c())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return i},trySubscribe:function(){i||(i=!0,s())},tryUnsubscribe:function(){i&&(i=!1,c())},getListeners:()=>r};return l}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0,stabilityCheck:a,identityFunctionCheck:i}}),[e,r,a,i]),s=Dt.useMemo((()=>e.getState()),[e]);Yt((()=>{const{subscription:t}=o;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),s!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[o,s]);const c=t||Bt;return Dt.createElement(c.Provider,{value:o},n)};function Qt(e=Bt){const t=e===Bt?$t:Ht(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var en=Qt();function tn(e=Bt){const t=e===Bt?en:Qt(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var nn,rn=tn();nn=Rt.useSyncExternalStoreWithSelector,Vt=nn,Pt.useSyncExternalStore;const an=()=>qt(At),on=(e,t)=>{let n;return function(...r){let a=!1;return clearTimeout(n),n=setTimeout((()=>{n=null,a||e.apply(this,r),a=!1}),t),t=>{a=!0,t&&e.apply(this,r)}}},sn=e=>Math.ceil(e/1e3),cn=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},ln=(e,t=2)=>{if(0===e)return"0 Bytes";const n=t<0?0:t,r=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**r).toFixed(n))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`},un={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},dn={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},pn=e=>e.code?dn[e.code]:un[e.keyCode],fn=e=>{e&&e.focus()},hn=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};function mn(e){return"object"==typeof e}const yn=({state:e})=>e,gn=()=>qt(yn),vn=It(yn,At,Lt,(({events:e,serviceData:t},n,r)=>{if(r||"inline"===n.layoutMode||!t?.suggestion||!t?.suggestion?.body?.length)return e;const a={type:"service_data",payload:t.suggestion};return[...e,a]})),bn=It(vn,At,((e,t)=>{const{enabled:n,threshold:r}=t?.messages?.timeIndicator??{};return n?e.map((({type:e,payload:t},n,a)=>{if(0===n)return{type:e,payload:{...t,timeIndicator:t?.occurredAt}};const i=a[n-1];if(!t?.occurredAt||!i.payload?.occurredAt||!r)return{type:e,payload:{...t,timeIndicator:void 0}};const o=sn(t.occurredAt-i.payload.occurredAt)>=r?t.occurredAt:void 0;return{type:e,payload:{...t,timeIndicator:o}}})):e})),xn=()=>qt(bn),wn=(It(bn,(e=>e.map((e=>e.payload.id)))),()=>gn().isLoading),_n=()=>gn().unreadEvents,Cn=()=>gn().skiplinkTargetId,Sn=()=>gn().serviceInfo,En=It(bn,(e=>{const t=e.filter((e=>"message"===e.type));return t[t.length-1]?.payload.id})),jn=()=>{const{participants:e,currentAgent:t}=gn().participantInfo;return t?e[t]:null},Tn=()=>{const{layoutMode:e}=an();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},In=It((({visibility:e})=>e),(e=>e.visibility)),Nn=It((({visibility:e})=>e),(e=>e.showInlineView)),Ln=It((({visibility:e})=>e),(e=>e.setInputFocus)),kn=[Mt.open,Mt.minimized,Mt.hidden],Mn=dt("setVisibility",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const a=t(),i=e.visibility,o=In(a),s=Lt(a),c=n.hasConversation(),l=At(a),{visibilityCallback:u=Ot,layoutMode:d}=l,{unreadEvents:p}=yn(a),f=u({hasResponded:s,previousVisibility:o,requestedVisibility:i,config:l});if(f&&!kn.includes(f))return console.error('The visibilityCallback function should return "open", "minimized" or "hidden".'),{visibility:null,setInputFocus:e.setInputFocus};if(o===f)return{visibility:null,setInputFocus:e.setInputFocus};const h=n.store.get(kt);return n.store.set(kt,{...h||{},[d]:i}),i&&r.emit("ui.visible",i,{visibility:i,hasConversation:c,hasResponded:s,unreadMessageCount:p}),{visibility:f,setInputFocus:e.setInputFocus}})),An=dt("initialize",(async(e,{dispatch:t,getState:n,extra:{api:r}})=>{const{layoutMode:a}=At(n()),i=r.store.get(kt)?.[a]||Mt.initialize;return t(Mn({visibility:i})),i})),On=dt("initializeApp",(async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{const a=n?.context?.contentLocale,i=n?.context?.userLocale;try{return t.hasConversation()?{initialState:await t.getConversationIntitialState(),contentLocale:a,userLocale:i,config:n}:(n?.context?.topic&&t.send("action",{type:P,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),{initialState:void 0,contentLocale:a,userLocale:i,config:n})}catch(e){if(e instanceof w){const e=new w;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new wt;return r({name:t.name,message:t.message,langKey:t.langKey})}})),Pn=((e,t,n)=>{const{wait:r=300,maxWait:a=0,leading:i=!1}=n??{};let o,s=null,c=null;const l=()=>{c&&clearTimeout(c),c=void 0,o&&(o(!0),o=void 0)};return dt(e,t,{condition:()=>{const e=i&&!s;return s&&clearTimeout(s),s=setTimeout((()=>{l(),s=null}),r),!!e||(o&&(o(!1),o=void 0),a&&!c&&(c=setTimeout(l,a)),new Promise((e=>{o=e})))}})})("resetApp",(async(e,{dispatch:t,extra:{api:n}})=>{await n.disconnect(),n.clearStore(),t(Ct()),await t(_t()),await t(On()),t(An())}),{wait:2e3,leading:!0}),Rn="cvco",Dn=["hideOnNoUserResponse","connectWhenInView","showDisclaimer","showSuggestions","continueChat","preChat","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon","notificationAudioURL"],zn=(e,t)=>{const{messages:n,...r}=(a=t,Dn.reduce(((e,t)=>(t in a&&(e[t]=a[t]),e)),{}));var a;let i=e;return Object.keys(r).length>0&&(i={...i,...r}),n&&(i={...i,messages:{...i.messages,...n}}),i},Fn=gt({name:"config",initialState:{namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}},api:{domain:"",key:"",secure:!0,sendEnvironment:!0},context:{},notificationAudioURL:void 0,hideOnNoUserResponse:!1,connectWhenInView:!0,showDisclaimer:!1,showSuggestions:!0,preChat:{enterDelay:1e3,exitAfter:4e3},continueChat:{enterDelay:0,exitAfter:2e3},customComponents:{},defaults:{visible:null},preChatEvents:[],parentElement:void 0,layoutMode:"window"},reducers:{setConfig:(e,{payload:t})=>zn(e,t),updateConfig:(e,{payload:t})=>zn(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(Ct.fulfilled,(e=>e)).addCase(_t.fulfilled,((e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:a,defaultContentLocale:i,defaultUserLocale:o}})=>{e.preChatEvents=t.map((e=>({type:"message",payload:e}))),e.context.contentLocale=i,e.context.userLocale=o,e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=a||""}))}}),{setConfig:Un,updateConfig:Bn,setPreChatEvents:Hn}=Fn.actions,$n=Fn.reducer,Vn={userHasResponded:!1},Gn=gt({name:"app",initialState:Vn,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(Pn.pending,(()=>Vn)).addCase(On.fulfilled,((e,{payload:t})=>{t.initialState&&"userResponded"in t.initialState&&(e.userHasResponded=t.initialState.userResponded||!1)}))}}),{setHasResponded:Wn}=Gn.actions,qn=Gn.reducer;class Kn extends v{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const Jn={SeamlyGeneralError:x,SeamlyConfigurationError:b,SeamlySessionExpiredError:w,SeamlyOfflineError:Kn,SeamlyUnauthorizedError:_,SeamlyUnavailableError:wt},Xn=Ze("catch-error",(e=>({payload:e}))),Yn={controls:{}},Zn={touched:!1},Qn={controls:Zn},er=gt({name:"forms",initialState:Qn,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{const r=t?e[n]??{...Yn,persistData:t}:{...Yn,persistData:t};e[n]=r},deregisterForm:(e,{payload:{formId:t}})=>(e[t]?.persistData||delete e[t],e),registerControl:(e,{payload:{name:t,formId:n}})=>{e[n].controls={[t]:Zn}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const a={...r.controls};return delete a[t],{...e,[n]:{...r,controls:a}}},updateControlValue:(e,{payload:{formId:t,name:n,value:r}})=>{e[t]?.controls&&(e[t].controls[n].value=r)},updateControlTouched:(e,{payload:{formId:t,name:n,touched:r}})=>{e[t]?.controls[n]&&(e[t].controls[n].touched=r)}},extraReducers:e=>{e.addCase(Pn.pending,(()=>Qn))}}),{registerForm:tr,deregisterForm:nr,registerControl:rr,deregisterControl:ar,updateControlValue:ir,updateControlTouched:or}=er.actions,sr=er.reducer,cr=dt("setLocale",(async(e,{extra:{api:t},rejectWithValue:n})=>{try{return{translations:await t.getTranslations(e),userLocale:e}}catch(e){return n(e)}}),{condition:(e,{getState:t})=>{const{i18n:{isLoading:n,userLocale:r}}=t();return e!==r&&!n}}),lr={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,userLocale:void 0},ur=gt({name:"app",initialState:lr,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(Pn.pending,(()=>lr)).addCase(_t.fulfilled,((e,{payload:t})=>{e.initialLocale=t.defaultUserLocale})).addCase(cr.pending,(e=>{e.isLoading=!0})).addCase(cr.rejected,(e=>{e.isLoading=!1})).addCase(cr.fulfilled,((e,{payload:t})=>{e.isLoading=!1,t?.translations&&(e.userLocale=t.userLocale,e.translations=Object.keys(t.translations).sort().reduce(((e,n)=>{if(!t.translations)return e;const r=t.translations[n];return e[n]=r,e}),{}))}))}}),{setInitialLocale:dr,setTranslations:pr}=ur.actions,fr=ur.reducer,hr=dt("getConversation",(async(e,{extra:{api:t},rejectWithValue:n})=>{try{const e=await t.getConversation();if(!e)throw new Error("No conversation found");return e}catch(e){return n({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError})}}),{condition(e,{getState:t}){const{state:{events:n}}=t(),r=n.at(-1);return r&&("lastEvent"in e?e?.lastEvent?.id:e?.body?.lastEvent?.id)!==r.payload.id}}),mr={error:void 0},yr=gt({name:"interrupt",initialState:mr,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>mr},extraReducers:e=>{e.addCase(_t.pending,(()=>mr)).addMatcher(it(On.rejected,_t.rejected,cr.rejected,Mn.rejected,An.rejected,hr.rejected),((e,{payload:t})=>{e.error=t}))}}),{setInterrupt:gr,clearInterrupt:vr}=yr.actions,br=yr.reducer,xr=["SeamlyGeneralError","SeamlyConfigurationError","SeamlySessionExpiredError","SeamlyOfflineError","SeamlyUnauthorizedError","SeamlyUnavailableError"],wr=({type:e,payload:t})=>"hidden"===document.visibilityState||e===S&&!t.fromClient||"info"===e&&t.type===E,_r=e=>e.sort((({payload:{occurredAt:e=0}},{payload:{occurredAt:t=0}})=>e-t)),Cr=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:a,name:i,introduction:o}=t.participant,s=n[r],c={...n,[r]:s?{...s,...a?{avatar:a}:{},...i?{name:i}:{},...o?{introduction:o}:{}}:t.participant};return{...e,participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r}},Sr=(e,t)=>{const n="message"===t?.type?t?.payload.translatedEntry||t?.payload.entry:{options:void 0,type:void 0},{blockAutoEntrySwitch:r}=e,a=t?.payload?.actions||{},i=t?.payload?.translatedActions||{};if(!n)return{...e,actions:a,optionsOverride:{},translatedActions:i};const{type:o,options:s}=n||{};let c=e.active;return r||o===e.userSelected||(c=o),{...e,active:c,optionsOverride:{...e.optionsOverride||{},...o?{[o]:s}:{}},actions:a,translatedActions:i}},Er={events:[],isLastEventFromClient:!1,initialState:{userResponded:!1,context:{contentLocale:"",translationActive:!1,userLocale:""}},unreadEvents:0,userHasResponded:!1,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1,remaining:void 0,wasStopped:void 0,count:void 0,timer:void 0},resumeConversationPrompt:!1,serviceInfo:{activeServiceSessionId:"",proactiveMessages:!1},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:null,subTitle:""},historyLoaded:!1,skiplinkTargetId:G(),optionsButtonId:G(),headerCollapseButtonId:G(),serviceData:{},options:{features:{webNotifications:{enabled:!1}},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],processingFileUploads:[],entryMeta:{default:j,optionsOverride:{},defaultEntry:j,active:j,userSelected:null,blockAutoEntrySwitch:!1,options:{},actions:{},translatedActions:{}},seamlyContainerElement:null},jr=gt({name:"store",initialState:Er,reducers:{addEvent:(e,t)=>{const{type:n,payload:r}=t.payload,a=e.options.features.hasOwnProperty($);let i={...e.options};if(a&&(n===S||"participant"===n)&&!r.fromClient){const e="message"===n?r.entry?.type:void 0;i={...i,features:{...i.features,uploads:{enabled:i.features.uploads?.enabled||!1,...i.features?.uploads||{},enabledFromEntry:e===T}}}}const o=wr(t.payload);if(!e.events.find((e=>e.payload.id===r.id))){if(!e.events.find((e=>"transactionId"in e.payload&&"transactionId"in r&&e.payload.transactionId===r.transactionId&&(!t.payload.type||e.type===t.payload.type)&&r.fromClient))){const s=Sr(e.entryMeta,t.payload);e.entryMeta=a||s.active!==T?s:{...e.entryMeta},e.options=i,o&&(e.unreadEvents+=1,"service_data"!==n&&(t.payload.payload.messageStatus=r.fromClient?N:I)),t.payload.payload.key=G(),e.events.push(t.payload),e.events=_r(e.events)}r.fromClient&&(e.isLastEventFromClient=r.fromClient)}},updateEvent:(e,{payload:t})=>{const n=e.events.find((e=>"service_data"!==e.type&&"service_data"!==t.type&&e.payload.transactionId===t.payload.transactionId));n?(n.payload.id=t.payload.id,n.payload.occurredAt=t.payload.occurredAt):e.events.push(t),e.events=_r(e.events)},clearEvents:e=>{e.unreadEvents=0,e.loadedImageEventIds=[],e.events=[]},setEventsRead:(e,{payload:t})=>{e.unreadEvents=0,e.events.forEach((e=>(e.payload.id&&-1!==t.indexOf(e.payload.id)&&(e.payload={...e.payload,..."service_data"!==e.type&&e.payload.messageStatus===I&&{messageStatus:N}}),e)))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setEvents:(e,{payload:{messages:t,unreadMessageCount:n,userResponded:r,participants:a,service:i,serviceData:o,ui:s}})=>{const c=((e,t)=>{const n=e.filter((e=>"message"===e.type&&!e.payload.optimisticallyInjected&&!t.some((t=>t.payload?.id===e.payload.id)))),r=t.filter((({type:e,payload:t})=>!("participant"===e&&!t?.participant?.introduction))).reverse();return _r([...r,...n])})(e.events,t),l=Object.fromEntries(Object.entries(a).map((([e,t])=>[t.id,t]))),u=c.find((e=>"participant"===e.type)),d=u?.payload.participant?.id,{entry:p}=i?.settings||{},f=Sr({...e.entryMeta,...p,active:p?.default||E,options:{...p?.options?p.options:{}}},c[c.length-1]),h={...e.options.features},m=h.hasOwnProperty($);e.unreadEvents=n,e.userHasResponded=r,e.events=c.filter((e=>"participant"!==e.type||!!e.payload.participant?.introduction)),e.participantInfo={...e.participantInfo,...d?Cr(e.participantInfo,{participant:l[d]}):{},participants:l},e.historyLoaded=!0,e.serviceInfo={...e.serviceInfo,proactiveMessages:i?.settings?.proactiveMessages?.enabled||!1,activeServiceSessionId:i?.sessionId},e.serviceData={...e.serviceData,...o},e.options={...e.options,features:h},e.entryMeta=m||f.active!==T?f:{...e.entryMeta},e.resumeConversationPrompt=s.resumeConversationPrompt||!1,d&&(e.headerTitles.subTitle=l[d]?.name)},setIsLoading:(e,{payload:t})=>{e.isLoading=t},initIdleDetachCountdown:(e,{payload:t})=>{const{delaySeconds:n,delayTime:r}=t;e.idleDetachCountdown={hasCountdown:!0,isActive:!0,wasStopped:!1,count:n,remaining:n,timer:r}},decrementIdleDetachCountdownCounter:e=>{const{idleDetachCountdown:t}=e,{remaining:n=0}=t,r=n-1;e.idleDetachCountdown.remaining=r,e.idleDetachCountdown.timer=cn(r)},stopIdleDetachCountdownCounter:e=>{e.idleDetachCountdown.isActive=!1,e.idleDetachCountdown.wasStopped=!0},clearIdleDetachCountdown:e=>{e.idleDetachCountdown.hasCountdown=!1,e.idleDetachCountdown.isActive=!1},initResumeConversationPrompt:e=>{e.resumeConversationPrompt=!0},clearResumeConversationPrompt:e=>{e.resumeConversationPrompt=!1},setParticipant:(e,{payload:t})=>{e.participantInfo=Cr(e.participantInfo,{participant:t.participant,fromClient:t.fromClient})},setActiveService:(e,{payload:t})=>{e.serviceInfo.activeServiceSessionId!==t&&(e.serviceInfo.activeServiceSessionId=t)},setHeaderTitle:(e,{payload:t})=>{e.headerTitles.title=t},setHeaderSubTitle:(e,{payload:t})=>{e.headerTitles.subTitle=t},setInitialState:(e,{payload:t})=>{e.initialState=t,e.unreadEvents=Er.unreadEvents},setServiceDataItem:(e,{payload:t})=>{e.serviceData[t.type]=t},setFeatures:(e,{payload:t})=>{t.features&&(e.options.features=t.features)},updateFeatures:(e,{payload:t})=>{Object.entries(t).forEach((([t,n])=>{e.options.features[t]=n}))},setFeatureEnabledState:(e,{payload:t})=>{e.options.features.hasOwnProperty(t.key)&&(e.options.features[t.key].enabled=t.enabled)},clearFeatures:e=>{e.options.features={webNotifications:e.options.features.webNotifications}},showOption:(e,{payload:t})=>{e.options.panelActive=!0,e.options.optionActive=t},hideOption:e=>{e.options.panelActive=!1,e.options.optionActive=""},setUserSelectedOptions:(e,{payload:t})=>{e.options.userSelectedOptions=t},setUserSelectedOption:(e,{payload:t})=>{const{option:n,value:r}=t;e.options.userSelectedOptions[n]=r},setBlockAutoEntrySwitch:(e,{payload:t})=>{e.entryMeta.blockAutoEntrySwitch=t},setServiceEntryMetadata:(e,{payload:t})=>{e.entryMeta.active=t.default,e.entryMeta.options=t.options||{},e.entryMeta.optionsOverride={},e.entryMeta.actions={},e.entryMeta.translatedActions={}},setActiveEntryType:(e,{payload:t})=>{e.entryMeta.active=t},setUserEntryType:(e,{payload:t})=>{e.entryMeta.userSelected=t},clearAbortTransaction:e=>{e.entryMeta.actions={}},registerUpload:(e,{payload:t})=>{e.currentUploads.push({id:t.fileId,name:t.fileName,progress:1,uploading:!0,complete:!1,error:"",uploadHandle:t.uploadHandle})},setUploadProgress:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?{...e,progress:t.progress,uploading:100!==t.progress,uploadHandle:100===t.progress?null:e.uploadHandle}:e))},startProcessingImage:(e,{payload:t})=>{e.processingFileUploads.push(t)},doneProcessingImage:(e,{payload:t})=>{e.processingFileUploads=e.processingFileUploads.filter((e=>e!==t))},setUploadError:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?{...e,error:t.errorText,progress:0,uploading:!1,uploadHandle:null}:e))},setUploadComplete:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t?{...e,complete:!0}:e))},clearAllUploads:e=>{e.currentUploads=[]},setSeamlyContainerElement:(e,{payload:t})=>{e.seamlyContainerElement=t},setProactiveMessages:(e,{payload:t})=>{e.serviceInfo.proactiveMessages=t}},extraReducers:e=>{e.addCase(Pn.pending,(()=>Er)).addCase(On.pending,(e=>{e.isLoading=!0})).addCase(_t.fulfilled,((e,{payload:t})=>{e.headerTitles.subTitle=t.agentParticipant?.name||"",t.features&&(e.options.features=t.features)})).addCase(On.fulfilled,((e,{payload:t,type:n})=>{if(e.isLoading=!1,!t.initialState)return;e.initialState=t.initialState,"messages"in t.initialState&&jr.caseReducers.setEvents(e,{payload:t.initialState,type:n});const{initialState:{service:r}}=t;r?.settings?.entry?.options?.upload&&jr.caseReducers.setFeatureEnabledState(e,{payload:{key:$,enabled:r.settings.entry.options.upload.enabled||!1},type:n})})).addMatcher(it(Rr,Dr),(e=>{e.isLastEventFromClient=!1}))}}),{addEvent:Tr,updateEvent:Ir,clearAllUploads:Nr,clearEvents:Lr,clearFeatures:kr,clearIdleDetachCountdown:Mr,clearResumeConversationPrompt:Ar,decrementIdleDetachCountdownCounter:Or,hideOption:Pr,initIdleDetachCountdown:Rr,initResumeConversationPrompt:Dr,registerUpload:zr,setActiveEntryType:Fr,setActiveService:Ur,setBlockAutoEntrySwitch:Br,setEventsRead:Hr,setFeatureEnabledState:$r,updateFeatures:Vr,setFeatures:Gr,setHeaderSubTitle:Wr,setHeaderTitle:qr,setEvents:Kr,setInitialState:Jr,setIsLoading:Xr,setLoadedImageEventIds:Yr,setParticipant:Zr,setSeamlyContainerElement:Qr,setServiceDataItem:ea,setServiceEntryMetadata:ta,clearAbortTransaction:na,setUploadComplete:ra,setUploadError:aa,setUploadProgress:ia,startProcessingImage:oa,doneProcessingImage:sa,setUserEntryType:ca,setUserSelectedOption:la,setUserSelectedOptions:ua,showOption:da,stopIdleDetachCountdownCounter:pa,setProactiveMessages:fa}=jr.actions,ha=jr.reducer,ma=({dispatch:e})=>t=>n=>{const r=t(n);if(_t.fulfilled.match(n)&&n.payload.defaultUserLocale)return e(cr(n.payload.defaultUserLocale)),r;if(On.fulfilled.match(n))return n.payload.userLocale&&e(cr(n.payload.userLocale)),r;if(Tr.match(n)&&"info"===n.payload.type&&n.payload.payload.body&&"subtype"in n.payload.payload.body&&"new_translation"===n.payload.payload.body.subtype){const{body:t}=n.payload.payload;if(t.translationLocale&&t.translationEnabled)return e(cr(t.translationLocale)),r}return r},ya={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:ot(),translatedEventGroups:{},translationProposal:null},ga=(e,t)=>{const n=[...e].reduce(((e,{payload:n,type:r},a,i)=>{if(e[t]&&n.id){if("info"===r&&"divider"===n?.type&&n?.body?.translationEnabled)return i.splice(0),e;e[t].push(n.id)}return n.id===t&&(e[t]=[]),e}),{}),[[r,a]]=Object.entries(n);return{lastGroupId:e.filter((e=>"divider"===e.payload?.type)).map((e=>e.payload.id)).at(-1),groupId:r,eventIds:a}},va=gt({name:"translation",initialState:ya,reducers:{enableTranslation:(e,{payload:t})=>{e.isActive=!0,e.currentLocale=t},disableTranslation:e=>{e.isActive=!1,e.currentLocale=void 0},enableEventsTranslation:(e,{payload:{events:t,id:n}})=>{delete e.translatedEventGroups[n];const{lastGroupId:r}=ga(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:a,eventIds:i}=ga(t,n);e.lastGroupId=r,e.translatedEventGroups[a]=i},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(Pn.pending,(()=>ya)).addCase(_t.fulfilled,((e,{payload:t})=>{const n=t?.features?.translation;n?.languages&&(e.isAvailable=!0===n.enabled,e.languages=[...n.languages].sort(((e,n)=>e.locale===t.defaultUserLocale?-1:n.locale===t.defaultUserLocale?1:e.nativeName?.localeCompare(n.nativeName||"",void 0,{sensitivity:"base"})||0)))})).addCase(cr.fulfilled,((e,{payload:t})=>{e.currentLocale=t.userLocale})).addCase(Tr,((e,{payload:t})=>{t.payload.id&&e.lastGroupId&&e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)})).addCase(Kr,((e,{payload:t})=>{e.translationProposal=t?.ui?.translationProposal})).addCase(On.fulfilled,((e,{payload:t})=>{e.translationProposal=t.initialState?.ui?.translationProposal}))}}),{enableTranslation:ba,disableTranslation:xa,enableEventsTranslation:wa,disableEventsTranslation:_a,setTranslationProposalPrompt:Ca,disableTranslationProposalPrompt:Sa}=va.actions,Ea=va.reducer,ja=gt({name:"visibility",initialState:{visibility:Mt.initialize,showInlineView:!1,setInputFocus:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(Mn.fulfilled,((e,{payload:{visibility:t,setInputFocus:n}})=>{t&&(e.visibility=t,e.setInputFocus=Boolean(n))})).addCase(_t.fulfilled,((e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)}))}}),{setShowInlineView:Ta}=ja.actions,Ia=ja.reducer,Na=ne({state:ha,app:qn,config:$n,i18n:fr,translations:Ea,visibility:Ia,forms:sr,interrupt:br});const La=rn;var ka=n(1162);function Ma(e=""){const t=e=>/\s/.test(e),n=[],r={};let a=0,i=null,o=!1,s=0;for(;s<e.length;){if(o&&(t(e[s])||"{"===e[s]))o=!1,i=e.slice(a,s),"{"===e[s]&&s--;else if(!o&&!t(e[s])){const t="{"===e[s];if(i&&t){const t=Aa(e,s);if(-1===t)throw new Error(`Unbalanced curly braces in string: "${e}"`);r[i]=e.slice(s+1,t),s=t,i=null}else i&&(n.push(i),i=null),o=!0,a=s}s++}return o&&(i=e.slice(a)),i&&n.push(i),{args:n,cases:r}}function Aa(e,t){let n=0;for(let r=t+1;r<e.length;r++){let t=e.charAt(r);if("}"===t){if(0===n)return r;n--}else"{"===t&&n++}return-1}function Oa(e){return Pa(e.slice(1,-1),",",3)}function Pa(e,t,n,r=[]){if(!e)return r;if(1===n)return r.push(e),r;let a=e.indexOf(t);if(-1===a)return r.push(e),r;let i=e.substring(0,a).trim(),o=e.substring(a+t.length+1).trim();return r.push(i),Pa(o,t,n-1,r)}let Ra,Da=0;const za="other";function Fa(e,t){let n=0,r="",a=0;const i={};for(;n<e.length;){if("#"!==e[n]||a)r+=e[n];else{let e="__hashToken"+Da++;r+=`{${e}, number}`,i[e]=t}"{"===e[n]?a++:"}"===e[n]&&a--,n++}return{caseBody:r,numberValues:i}}const Ua="other",Ba=It((({i18n:e})=>e),(({translations:e})=>e)),Ha=It((({i18n:e})=>e),(({initialLocale:e})=>e)),$a=It((({i18n:e})=>e),(({userLocale:e})=>e)),Va=It((({i18n:e})=>e),(({isLoading:e})=>e)),Ga=new class{constructor(e,t={}){this.locale=e,this.typeHandlers=t}format=function(e){const t={};return function(...n){let r=n.length?n.map((e=>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,r))return t[r];let a=e(...n);return t[r]=a,a}}(((e,t={})=>this.process(e,t).flat(1/0).join("")));process(e,t={}){if(!e)return[];let n=e.indexOf("{");if(-1!==n){let r=Aa(e,n);if(-1===r)throw new Error(`Unbalanced curly braces in string: "${e}"`);{let a=e.substring(n,r+1);if(a){let i=[],o=e.substring(0,n);o&&i.push(o);let[s,c,l]=Oa(a),u=t[s];null==u&&(u="");let d=c&&this.typeHandlers[c];i.push(d?d(u,l,this.locale,t,this.process.bind(this)):u);let p=e.substring(r+1);return p&&i.push(this.process(p,t)),i}}}return[e]}}("en-GB",{plural:function(e,t,n,r,a){const{args:i,cases:o}=Ma(t);let s=parseInt(e);i.forEach((e=>{e.startsWith("offset:")&&(s-=parseInt(e.slice(7)))}));const c=[];if("PluralRules"in Intl){void 0!==Ra&&Ra.resolvedOptions().locale===n||(Ra=new Intl.PluralRules(n));const e=Ra.select(s);e!==za&&c.push(e)}1===s&&c.push("one"),c.push(`=${s}`,za);for(let e=0;e<c.length;e++){const t=c[e];if(t in o){const{caseBody:e,numberValues:n}=Fa(o[t],s);return a(e,{...r,...n})}}return e},select:function(e,t,n,r,a){const{cases:i}=Ma(t);return e in i?a(i[e],r):Ua in i?a(i[Ua],r):e}});function Wa(){const e=qt(Ba),t=qt($a),n=qt(Ha),r=qt(Va);return{t:(0,ka.useCallback)(((n,a={})=>{if(!e)return"";const i=e[n];return i?Ga.format(i,a):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),"")}),[e,t,r]),userLocale:t,initialLocale:n}}const qa=()=>{const e=La(),t=qt(In),n=qt(Ln),r=!!t&&t!==Mt.hidden,a=t===Mt.open,i=t===Mt.minimized,o=(0,ka.useCallback)((t=>{e(Mn("string"==typeof t||null===t?{visibility:t,setInputFocus:!1}:t))}),[e]);return{isVisible:r,isOpen:a,isMinimized:i,visible:t,setVisibility:o,openChat:()=>{o({visibility:Mt.open})},closeChat:()=>{o({visibility:Mt.minimized})},setInputFocus:n}},Ka=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,a.createRef)()})=>{const[r,i]=(0,ka.useState)(null),o=!!r?.isIntersecting||!t,s=o&&e,c=([e])=>i(e);return(0,ka.useEffect)((()=>{const e=n?.current;if(!window.IntersectionObserver||s||!e||!t)return()=>{};const r=new IntersectionObserver(c,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()}),[n,t,s]),{isVisible:o,containerRef:n}},Ja=()=>qt(Lt),Xa=(0,a.createContext)(null),Ya=(0,a.createContext)(null),Za=(0,a.createContext)(null),Qa=()=>{const e=(0,ka.useContext)(Ya);if(!e)throw new Error("useSeamlyEventBusContext has to be used within <SeamlyEventBusContext.Provider>");return e},ei=()=>{const e=(0,ka.useContext)(Xa);if(!e)throw new Error("useSeamlyApiContext has to be used within <SeamlyApiContext.Provider>");return e},ti=()=>ei().store,ni=()=>{const e=ei();return(0,ka.useCallback)((()=>e.hasConversation()),[e])},ri=()=>{const e=ei(),t=La(),n=Qa(),r=Ja(),a=ni(),{visible:i,setVisibility:o}=qa(),s=_n(),c=(0,ka.useCallback)(((...e)=>{n.emit(...e)}),[n]),l=(0,ka.useCallback)((()=>{c("ui.beforeStart",{visibility:i,hasConversation:a(),hasResponded:r,unreadMessageCount:s}),e.send("start_conversation"),c("ui.start",{visibility:i,hasConversation:a(),hasResponded:r,unreadMessageCount:s})}),[e,c,a,r,s,i]),u=(0,ka.useCallback)((async()=>{await t(Pn())}),[t]),d=(0,ka.useCallback)((e=>({type:e,id:G(),transactionId:G(),fromClient:!0,participant:"seamly-client-participant",occurredAt:1e3*Date.now()})),[]),p=(0,ka.useCallback)((e=>({...d("text"),body:{text:e}})),[d]),f=(0,ka.useCallback)((({body:n,config:r={}})=>{if(""===n.trim())return;const a={...p(n),...r};e.send("message",a),c("message",a),t(Tr({type:"message",payload:{...a,body:a.body,type:a.type,optimisticallyInjected:!0}}))}),[e,t,c,p]),h=(0,ka.useCallback)(((e,n=G())=>{t(Tr({type:"message",payload:{...p(e),transactionId:n}}))}),[t,p]),m=(0,ka.useCallback)(((e,n,r,a,i,o)=>{t(Tr({type:"message",payload:{type:"upload",id:e,transactionId:n,fromClient:!0,participant:"seamly-client-participant",occurredAt:r,body:{contentType:a,filename:i,filesize:o,id:e||"",isDeleted:!1}}}))}),[t]),y=(0,ka.useCallback)(((e,n=G())=>{t(Tr({type:"info",payload:{type:"divider",body:{subtype:e},fromClient:!1,participant:null,id:G(),transactionId:n}}))}),[t]),g=(0,ka.useCallback)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==k&&n!==M&&c(`action.${n}`,t)}),[e,c]),v=(0,ka.useCallback)((t=>{e.sendContext(t)}),[e]),b=(0,ka.useCallback)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&(t(Jr(e)),e.messages&&e.messages.length&&t(Kr(e)),e.userResponded&&(t(Wn(e.userResponded)),o({visibility:Mt.open})))})).catch((e=>{t(gr({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}))),[e,t,o]);return{connect:b,start:l,sendMessage:f,sendAction:g,sendContext:v,reset:u,emitEvent:c,addMessageBubble:h,addUploadBubble:m,addDivider:y,apiConnected:e.connected,apiConfigReady:e.configReady}},ai=()=>{const e=(()=>{const e=(0,ka.useContext)(Za);if(!e)throw new Error("useSeamlyLiveRegionContext has to be used within <SeamlyLiveRegionContext.Provider>");return e})();return{sendPolite:(0,ka.useCallback)((t=>{t&&e({ariaLive:B,messageText:t})}),[e]),sendAssertive:(0,ka.useCallback)((t=>{t&&e({ariaLive:U,messageText:t})}),[e])}},ii=It((({interrupt:e})=>e),(({error:e})=>e)),oi=It(ii,(e=>Boolean(e)));function si(){const{t:e}=Wa(),t=qt(ii);return{hasError:qt(oi),meta:(0,ka.useMemo)((()=>{if(!t)return{title:void 0,message:void 0,srText:void 0,buttonText:void 0,originalError:void 0,action:void 0};const{langKey:n,action:r}=t,a=e(`${n}.title`),i=e(`${n}.message`),o=e(`${n}.srText`),s=r?e(`${n}.buttonText`):null;return{...n?{title:a,message:i,srText:o}:{},...r?{action:r}:{},...r&&n?{buttonText:s}:{},originalError:t}}),[t,e]),error:t}}const ci=require("preact/compat"),li=require("preact/jsx-runtime"),ui=({children:e})=>((()=>{const{t:e}=Wa(),{isInline:t,isWindow:n,isApp:r}=Tn(),{isOpen:a,isVisible:i}=qa(),o=qt(Nn),{start:s,connect:c,apiConfigReady:l,apiConnected:u}=ri(),d=(0,ka.useRef)(!1),{sendAssertive:p}=ai();!function(){const{meta:{originalError:e,action:t}}=si(),n=La(),{reset:r}=ri(),a="SeamlySessionExpiredError"===e?.name,i=(0,ka.useRef)(0),o=(0,ka.useRef)(null);(0,ka.useEffect)((()=>{if(a&&"reset"===t){if(i.current>=10){o.current=setTimeout((()=>{i.current=0}),1e4);const e=new x;return n(gr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),()=>{}}i.current+=1,r()}return()=>{o.current&&clearTimeout(o.current)}}),[t,r,a,n])}(),(0,ka.useEffect)((()=>{i&&setTimeout((()=>{p(e("window.srTexts.onLoad"))}),500)}),[i,p,e]),(0,ka.useEffect)((()=>{i&&p(e(a?"window.srTexts.onOpen":"window.srTexts.onClose"))}),[a,i,p,e]),(0,ka.useEffect)((()=>{l||u||(d.current=!1)}),[l,u]);const f=(0,ka.useCallback)((async()=>{u||(d.current=!0,await c()),(r||a||i&&t)&&s()}),[u,c,r,t,a,i,s]);(0,ka.useEffect)((()=>{!l||d.current||n&&!a||!(!t||i&&o)||f()}),[l,f,t,a,i,n,o])})(),(0,li.jsx)(li.Fragment,{children:e})),di=(0,a.createContext)(null),pi=(e=0)=>new Promise((t=>{setTimeout(t,e)})),fi=()=>{const{seamlyContainerElement:e}=gn(),t=La();return[e,(0,ka.useCallback)((e=>{t(Qr(e))}),[t])]},hi=e=>(0,ka.useCallback)((()=>{var t;t=e,requestAnimationFrame((async()=>{await pi(180);const e="string"==typeof t?document.getElementById(t):t;fn(e)}))}),[e]),mi=()=>{const e=Cn();return hi(e)},yi=e=>It((e=>e.translations.translatedEventGroups),(t=>Object.values(t).every((t=>e?.payload?.id&&!t.includes(e.payload.id)))));function gi(){const{sendContext:e}=ri(),t=La(),n=an(),r=(0,ka.useCallback)(((t,n)=>{e({userLocale:t,source:n})}),[e]),a=(0,ka.useCallback)((()=>{e({userLocale:n.context?.contentLocale}),t(xa())}),[n.context?.contentLocale,t,e]),{languages:i,isActive:o,isAvailable:s,currentLocale:c}=qt((({translations:e})=>e));return{languages:i,isActive:o,isAvailable:s,currentLocale:c,enableTranslations:r,disableTranslations:a}}const vi=e=>{const t=qt(yi(e));if(!e?.payload)return{body:void 0,hasTranslation:!1,isTranslated:!1,locale:""};const n=e.payload?.translatedBody&&"data"in e.payload.translatedBody?e.payload?.translatedBody.data:e.payload.translatedBody,{translation:r,body:a}={body:e.payload?.body,translation:e.payload?.translation},i=!!n;return{body:t&&i?n:a,hasTranslation:i,isTranslated:t&&i,locale:r?.locale}};function bi(e){const{languages:t}=gi();return(0,ka.useMemo)((()=>t?.find((t=>t.locale===e))?.nativeName),[e,t])}const xi=(...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&&e.length)).map((e=>e&&e.indexOf(Rn)>-1?e:[Rn,e].join("-"))).join(" "),wi=()=>an().appContainerClassNames,_i=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},Ci=(0,a.createContext)(null),Si=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=gn(),{allowedMimeTypes:a,maxSize:i}=n?.upload||{},{enabled:o,enabledFromEntry:s}=r||{},{allowedMimeTypes:c,maxSize:l}={...t.upload||{allowedMimeTypes:[],maxSize:0},...a?{allowedMimeTypes:a}:{},...i?{maxSize:i}:{}};return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:s||o,allowedMimeTypes:c,maxSize:l}},Ei=()=>{const{currentUploads:e}=gn(),t=La(),n=(()=>{const e=(0,ka.useContext)(Ci);if(!e)throw new Error("useSeamlyFileUploadContext has to be used within <SeamlyFileUploadContext.Provider>");return e})();return{uploadFile:(0,ka.useCallback)((e=>{n(e)}),[n]),clearUploads:(0,ka.useCallback)((()=>{t(Nr())}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}},ji=()=>{const{t:e}=Wa(),{options:t}=gn(),{panelActive:n,optionActive:r,userSelectedOptions:a,features:i}=t,{extraMenuItem:o,sendTranscript:s}=i,c={extraMenuItem:o,sendTranscript:s},l=t=>"extraMenuItem"===t?"Extra menu item":e(`options.${t}.menuTitle`),u=Object.keys(c).filter((e=>c[e])).map((e=>({name:e,title:l(e),available:c[e].enabled}))),d=o||s,p=La(),{get:f,set:h}=ti();return{allowOptionSelection:d,userSelectedOptions:a,features:i,menuOptions:u,initUserSelectedOptions:(0,ka.useCallback)((()=>{const e=f("options")||{};p(ua(e))}),[f,p]),setUserSelectedOptions:(0,ka.useCallback)((e=>{p(ua(e)),h("options",e)}),[h,p]),setUserSelectedOption:(0,ka.useCallback)(((e,t)=>{const n=f("options")||{};"object"==typeof n&&h("options",{...n,[e]:t}),p(la({option:e,value:t}))}),[p,f,h]),showOption:e=>{p(da(e))},hideOption:()=>{p(Pr())},panelActive:n,optionActive:r}},Ti=()=>{const{optionsButtonId:e}=gn();return{id:e,focusButton:hi(e)}},Ii=(0,a.createContext)(null),Ni=()=>{const e=(0,ka.useContext)(Ii);if(!e)throw new Error("useSeamlyActivityEventHandler has to be used within <SeamlyActivityEventContext.Provider>");return e},Li=()=>{const e=La(),{idleDetachCountdown:{hasCountdown:t,isActive:n,count:r,remaining:a,timer:i,wasStopped:o}}=gn(),{isOpen:s}=qa(),{emitEvent:c,sendAction:l}=ri(),{t:u}=Wa(),{sendAssertive:d,sendPolite:p}=ai(),f=(0,ka.useCallback)((e=>{s&&d(e)}),[s,d]),h=(0,ka.useCallback)((e=>{s&&p(e)}),[s,p]),m=(0,ka.useCallback)((t=>{const n=(e=>Math.ceil(e/1e3))(t),r=cn(n);e(Rr({delaySeconds:n,delayTime:r})),c("idleTimer.start"),f(`${u("idleDetachWarning.countdownTitle")} ${u("idleDetachWarning.countdownText")} ${u("idleDetachWarning.countdownTimer",r)}`)}),[e,c,f,u]),y=(0,ka.useCallback)(((n=void 0,r=!1)=>{t&&(n||(r||l({type:A}),f(u("idleDetachWarning.notifyTransferText"))),o||c("idleTimer.stop"),e(Mr()))}),[e,c,t,l,f,u,o]),g=(0,ka.useCallback)((()=>{if(!a||a<=0)return;const t=a-1;t%10==0&&f(`${u("idleDetachWarning.countdownText")} ${u("idleDetachWarning.countdownTimer",cn(t))}`),e(Or())}),[e,a,f,u]),v=(0,ka.useCallback)((()=>{n&&(e(pa()),a&&(c("idleTimer.stop"),h(u("idleDetachWarning.srCountDownStoppedText"))))}),[e,c,n,a,h,u]);return{hasCountdown:t,isActive:n,count:r,remaining:a,timer:i,wasStopped:o,initCountdown:m,endCountdown:y,decrementCountdown:g,stopCountdown:v}},ki=()=>{const e=La(),t=gn().resumeConversationPrompt,{sendAction:n}=ri(),{t:r}=Wa(),{sendAssertive:a}=ai();return{continueChat:()=>{n({type:O,body:{type:"resume_conversation_prompt"}}),e(Ar())},hasPrompt:t,restartChat:()=>{a(r("resumeConversationPrompt.srNotifyRestartText")),n({type:A}),e(Ar())}}},Mi=()=>{const[e]=(0,ka.useState)((()=>G()));return e},Ai=({eventPayload:e})=>{const{t}=Wa(),{fromClient:n,participant:r}=e,a=(e=>gn().participantInfo.participants[e])(r)||{},{messages:i}=an(),o=n?t("participants.user.name"):a&&a.name,{showAvatar:s,showName:c}=i&&i[n?"user":"agent"]||{};if(!s&&!c)return null;const l=[];return s&&o&&a.avatar&&l.push((0,li.jsx)("span",{className:xi("message__avatar"),children:(0,li.jsx)("img",{src:a.avatar,className:xi("avatar"),alt:""})})),c&&o&&l.push((0,li.jsx)("span",{className:xi("message__author-name"),children:o})),l.length>0?(0,li.jsx)("div",{className:xi("message__author"),children:l}):null},Oi=({showParticipant:e=!0,event:t,type:n,modifiers:r,children:a,bodyProps:i={},info:o,...s})=>{const c=_i(t),{hasTranslation:l,isTranslated:u,locale:d}=vi(t);return n&&c.push(`message--type-${n}`),r&&("string"==typeof r&&(r=r.split(" ").filter((e=>e.length))),r.forEach((e=>{c.push(`message--${e}`)}))),u&&c.push("message--is-translated"),l&&c.push("message--has-translation"),u&&(i={...i,lang:d}),(0,li.jsx)(li.Fragment,{children:(0,li.jsxs)("div",{className:xi(c),...s,children:[e&&(0,li.jsx)(Ai,{eventPayload:t.payload}),(0,li.jsx)("div",{className:xi("message__body"),...i,children:a}),o&&(0,li.jsx)("div",{"aria-hidden":"true",className:xi("message__info"),children:o})]})})},Pi=({id:e,action:t,buttonText:n,description:r,hasFocus:a,image:i,title:o,isCarouselItem:s})=>{const c=(0,ka.useRef)(null),{sendMessage:l,sendAction:u,emitEvent:d}=ri(),p=Mi(),f=(0,ka.useRef)(!1),h=t?.type===V?"a":"button",m=(0,ka.useCallback)((()=>d("action.click_card",{type:R,originMessage:e,action:t})),[d,e,t]),y=(0,ka.useCallback)((()=>{if(m(),"ask"===t?.type)l({body:t?.ask});else if("topic"===t?.type){const{topic:e,fallbackMessage:n}=t;u({type:P,body:{name:e,fallbackMessage:n}})}}),[l,t,u,m]),g=(0,ka.useMemo)((()=>t?.type===V?{href:t?.link,rel:"noopener noreferrer",target:t?.newTab?"_blank":"_self",onClick:m}:{onClick:y}),[t,y,m]);return(0,ka.useEffect)((()=>{s&&(a&&f.current?window.requestAnimationFrame((()=>c.current?.focus())):c.current?.blur()),f.current=!0}),[a,s]),(0,li.jsxs)("div",{className:xi("card__wrapper"),id:e,tabIndex:-1,ref:c,children:[i?(0,li.jsx)("img",{className:xi("card__image"),src:i,alt:""}):null,(0,li.jsxs)("div",{className:xi("card__content"),id:e,children:[o&&(0,li.jsx)("h2",{className:xi("card__title"),children:o}),r&&(0,li.jsx)("div",{className:xi("card__description"),dangerouslySetInnerHTML:{__html:r}}),(0,li.jsx)(h,{tabIndex:s&&!a?-1:void 0,className:xi("button","button--primary"),"aria-describedby":p,...g,children:n})]})]})};function Ri({item:e,items:t,index:n,isActive:r}){const{t:a}=Wa();return(0,li.jsx)("div",{className:xi("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":a("carousel.slide.label",{index:n+1,total:t.length}),children:(0,li.jsx)(Pi,{...e,isCarouselItem:!0,hasFocus:r})})}const Di={send:{32:'<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>'},balloon:{32:'<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>'},newTopic:{32:'<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>'},newTranslation:{16:'<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>',32:'<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>'},avatar:{32:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">\n<path fill="#4A48C1" d="M10,14.8c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S11.1,14.8,10,14.8z M15.9,14.8c1.1,0,2-0.9,2-2s-0.9-2-2-2\n\ts-2,0.9-2,2S14.8,14.8,15.9,14.8z M21.8,10.8c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S22.9,10.8,21.8,10.8z M21.3,18.1H10.7\n\tC11.7,23.9,20.2,23.9,21.3,18.1z"/>\n</svg>\n'},chevronDown:{8:'<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>',32:'<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>'},chevronRight:{8:'<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>',16:'<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>'},close:{8:'<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>',16:'<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>'},enlarge:{32:'<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>'},options:{32:'<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>'},file:{32:'<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>'},upload:{32:'<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>'},download:{16:'<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>'},error:{16:'<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>'},arrowLeft:{16:'<?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'},arrowRight:{16:'<?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'},check:{16:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="16px"\n height="16px"\n x="0px"\n y="0px"\n viewBox="0 0 16 16"\n>\n <path\n fill="currentColor"\n d="M11.6,4.3l-5,5L4.9,7.5C4.4,7,3.7,7,3.2,7.5l0,0C2.8,8,2.8,8.7,3.2,9.2l1.7,1.7l0,0l0.8,0.8\n\tc0.5,0.5,1.2,0.5,1.7,0l0.8-0.8l5-5c0.5-0.5,0.5-1.2,0-1.7l0,0C12.8,3.8,12.1,3.8,11.6,4.3z"\n />\n</svg>\n',32:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="32px"\n height="32px"\n x="0px"\n y="0px"\n viewBox="0 0 32 32"\n>\n <path\n fill="currentColor"\n d="M22.9,9.3l-9.3,9.3l-3.2-3.2c-0.9-0.9-2.3-0.9-3.2,0l0,0c-0.9,0.9-0.9,2.3,0,3.2l3.2,3.2l0,0l1.6,1.6\n\tc0.9,0.9,2.3,0.9,3.2,0l1.6-1.6l9.3-9.3c0.9-0.9,0.9-2.3,0-3.2l0,0C25.2,8.4,23.7,8.4,22.9,9.3z"\n />\n</svg>\n'}},zi=({name:e,size:t="32",className:n,alt:r})=>(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)("div",{"aria-hidden":"true",className:n||xi("icon"),dangerouslySetInnerHTML:{__html:Di[e][t]}}),r&&(0,li.jsx)("span",{className:xi("visually-hidden"),children:r})]});function Fi({items:e,currentIndex:t,onChange:n,children:r}){const{t:a}=Wa(),i=e.length;return(0,li.jsxs)("div",{className:xi("carousel-controls"),children:[(0,li.jsx)("button",{className:xi("button","button--previous"),"aria-label":a("carousel.controls.previous"),onClick:()=>{n((t-1+i)%i)},children:(0,li.jsx)(zi,{name:"arrowLeft",size:"16",alt:""})}),r,(0,li.jsx)("button",{className:xi("button","button--next"),"aria-label":a("carousel.controls.next"),onClick:()=>{n((t+1)%i)},children:(0,li.jsx)(zi,{name:"arrowRight",size:"16",alt:""})})]})}function Ui({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:a}){const i=e.length,o=(0,ka.useCallback)((e=>{const r=Number(e.target.dataset.item||"0"),a=Math.min(i-1,Math.max(0,r));a!==t&&n(a)}),[i,t,n]);return(0,li.jsx)("div",{className:xi("carousel-pagination__wrapper"),role:"group",children:(0,li.jsx)("ul",{className:xi("carousel-pagination"),children:e.map(((e,n)=>{const i=t===n;return(0,li.jsx)("li",{className:xi("carousel-pagination__item",i?"is-active":void 0),children:(0,li.jsx)("button",{className:xi("carousel-pagination__button"),type:"button",onClick:o,"data-item":n,"aria-disabled":i?"true":void 0,"aria-label":a(e,n)})},r(e,n,"pagination-item-"))}))})})}const Bi=(e,t,n)=>`${n}${t}`,Hi=e=>e.label,$i=({target:e})=>{e.scrollLeft=0};function Vi({currentIndex:e=0,onChange:t=()=>{},getItemKey:n=Bi,getItemLabel:r=Hi,items:i}){const o=Mi(),s=i.length,[c,l]=(0,ka.useState)(Number(e||0));(0,ka.useEffect)((()=>{l(Number(e||0))}),[l,e]);const u=(0,ka.useRef)([]);u.current=(0,ka.useMemo)((()=>Array(s).fill(1).map((()=>(0,a.createRef)()))),[s]);const d=(0,ka.useRef)(!0),p=(0,ka.useRef)(null);return p.current=t,(0,ka.useEffect)((()=>{d.current?d.current=!1:p.current&&p.current(c)}),[c]),(0,li.jsxs)("div",{className:xi("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,li.jsx)("div",{className:xi("carousel__slides-wrapper"),onScroll:$i,children:(0,li.jsx)("div",{id:o,className:xi("carousel__slides"),style:{width:100*s+"%",left:-100*c+"%"},"aria-live":"polite","aria-atomic":"false",children:i.map(((e,t)=>{const r=c===t;return(0,li.jsx)("div",{ref:u.current[t],className:xi("carousel__slide",r?"is-active":void 0),"aria-hidden":r?void 0:"true",children:(0,li.jsx)(Ri,{item:e,items:i,index:t,isActive:r})},n(e,t,"item-"))}))})}),(0,li.jsx)("div",{className:xi("carousel__controls"),children:(0,li.jsx)(Fi,{currentIndex:c,items:i,onChange:l,children:(0,li.jsx)("div",{className:xi("carousel__pagination"),children:(0,li.jsx)(Ui,{currentIndex:c,items:i,onChange:l,getItemKey:n,getItemLabel:r})})})})]})}const Gi=(e,t,n="")=>`${n}${e.title}:${t}`,Wi=e=>e.title,qi=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,Ki=({id:e,categories:t=[],question:n,onClick:r,hasIcon:a})=>{const i=(0,ka.useMemo)((()=>["suggestions__item",...t.map(qi)]),[t]),o=(0,ka.useCallback)((()=>{r&&r({id:e,question:n})}),[e,n,r]);return(0,li.jsx)("li",{className:xi(i),children:(0,li.jsxs)("button",{type:"button",onClick:o,className:xi("button","button--primary"),children:[a&&(0,li.jsx)(zi,{name:"chevronRight",size:"8",alt:""}),n]})})},Ji=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>(0,li.jsx)("ul",{className:xi("suggestions__list",e||""),children:t.map((e=>(0,li.jsx)(Ki,{hasIcon:r,onClick:n,categories:e.categories,id:e.id,question:e.question},e.id)))}),Xi=({originMessage:e,transactionId:t})=>{const{sendAction:n}=ri();return r=>{r.target&&r.target.dataset.linkId&&n({type:"navigate",originMessage:e,transactionId:t,link:{id:r.target.dataset.linkId,url:r.target.getAttribute("href")}})}},Yi=({children:e,className:t,graphicSrc:n,graphicType:r="icon",iconName:a,iconSize:i,iconClassName:o,dividerType:s,title:c,description:l})=>{const u=Boolean(a||n);return(0,li.jsxs)("div",{className:xi("divider",s&&`divider--type-${s}`,t),children:[u&&(0,li.jsx)("span",{className:xi("divider__graphic"),children:a?(0,li.jsx)(zi,{name:a,size:i,className:o,alt:""}):(0,li.jsx)("img",{src:n||void 0,className:xi({icon:"icon"===r,avatar:"avatar"===r},o)})}),(0,li.jsxs)("div",{className:xi("divider__body"),children:[c?(0,li.jsx)("h2",{className:xi("divider__title"),dangerouslySetInnerHTML:{__html:c}}):null,l?(0,li.jsx)("p",{className:xi("divider__description"),dangerouslySetInnerHTML:{__html:l}}):null,e]})]})},Zi={[H.new_topic]:"new-topic"},Qi={default:({event:e})=>{const{t}=Wa(),{subtype:n}=e.payload.body,r=Zi[H[n]];return H[n]?(0,li.jsx)(Yi,{dividerType:r,iconName:H[n],title:t(`dividerKeys.${H[n]}`)}):null},[H.new_translation]:({event:e})=>{const{t}=Wa(),n=xn(),{body:{translationEnabled:r,text:a,title:i},id:o}=e.payload,s=qt((e=>e.translations.translatedEventGroups)),c=La(),l=(0,ka.useCallback)((()=>{s[o]?c(wa({events:n,id:o})):c(_a({events:n,id:o}))}),[c,n,o,s]);return(0,li.jsx)(Yi,{iconName:"newTranslation",dividerType:"new-translation",title:i,description:a,children:r?(0,li.jsx)(li.Fragment,{children:(0,li.jsx)("button",{className:xi("button","button--secondary"),onClick:l,children:t(s[o]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):null})}},eo={month:"long",day:"numeric",year:"numeric"},to={hour:"numeric",minute:"numeric"},no=({event:e})=>{const t=(()=>{const[e,t]=(0,ka.useReducer)((e=>e+1),0);return(0,ka.useCallback)((()=>{setTimeout((()=>{t()}))}),[])})(),{date:n,time:r,timeUntilMidnight:a,srText:i}=(e=>{const{t}=Wa(),n=an(),r=n?.context?.userLocale??[],a=new Date(e),i=new Date,o=new Date(i);o.setHours(24,0,0,0);const s=o.valueOf()-i.valueOf(),c=a.toString(),l=new Intl.DateTimeFormat(r,to).format(a);let u=((e,t)=>{const n=new Date(t).setHours(0,0,0,0),r=e.getTime(),a=864e5;return r>=n+a?e:r>n?"today":r>n-a?"yesterday":e})(a,i);switch(u){case"today":u=t("dateTime.today");break;case"yesterday":u=t("dateTime.yesterday");break;default:u=new Intl.DateTimeFormat(r,eo).format(a)}return{date:u,srText:t("dateTime.srText",{date:u,time:l}),time:l,fullDateTime:c,timeUntilMidnight:s}})(sn(e.payload.timeIndicator));return(0,ka.useEffect)((()=>{const e=setTimeout((()=>{t()}),a);return()=>{clearTimeout(e)}}),[t,a]),(0,li.jsxs)(Yi,{dividerType:"time-indicator",children:[(0,li.jsxs)("h2",{className:xi("divider__time"),"aria-hidden":"true",children:[(0,li.jsx)("span",{className:xi("divider__time--date"),children:n}),(0,li.jsx)("span",{className:xi("divider__time--time"),children:r})]}),(0,li.jsx)("p",{className:xi("visually-hidden"),children:i})]})};var ro=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ao=ro.join(","),io="undefined"==typeof Element,oo=io?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,so=!io&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},co=function e(t,n){var r;void 0===n&&(n=!0);var a=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===a||"true"===a||n&&t&&e(t.parentNode)},lo=function(e,t,n){if(co(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ao));return t&&oo.call(e,ao)&&r.unshift(e),r.filter(n)},uo=function e(t,n,r){for(var a=[],i=Array.from(t);i.length;){var o=i.shift();if(!co(o,!1))if("SLOT"===o.tagName){var s=o.assignedElements(),c=e(s.length?s:o.children,!0,r);r.flatten?a.push.apply(a,c):a.push({scopeParent:o,candidates:c})}else{oo.call(o,ao)&&r.filter(o)&&(n||!t.includes(o))&&a.push(o);var l=o.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(o),u=!co(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(l&&u){var d=e(!0===l?o.children:l.children,!0,r);r.flatten?a.push.apply(a,d):a.push({scopeParent:o,candidates:d})}else i.unshift.apply(i,o.children)}}return a},po=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},fo=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!po(e)?0:e.tabIndex},ho=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},mo=function(e){return"INPUT"===e.tagName},yo=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},go=function(e,t){return!(t.disabled||co(t)||function(e){return mo(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var a=oo.call(e,"details>summary:first-of-type")?e.parentElement:e;if(oo.call(a,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return yo(e)}else{if("function"==typeof r){for(var i=e;e;){var o=e.parentElement,s=so(e);if(o&&!o.shadowRoot&&!0===r(o))return yo(e);e=e.assignedSlot?e.assignedSlot:o||s===e.ownerDocument?o:s.host}e=i}if(function(e){var t,n,r,a,i=e&&so(e),o=null===(t=i)||void 0===t?void 0:t.host,s=!1;if(i&&i!==e)for(s=!!(null!==(n=o)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(o)||null!=e&&null!==(a=e.ownerDocument)&&void 0!==a&&a.contains(e));!s&&o;){var c,l,u;s=!(null===(l=o=null===(c=i=so(o))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(o))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!oo.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},vo=function(e,t){return!(function(e){return function(e){return mo(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||so(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var a=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!a||a===e}(e)}(t)||fo(t)<0||!go(e,t))},bo=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},xo=function e(t){var n=[],r=[];return t.forEach((function(t,a){var i=!!t.scopeParent,o=i?t.scopeParent:t,s=function(e,t){var n=fo(e);return n<0&&t&&!po(e)?0:n}(o,i),c=i?e(t.candidates):o;0===s?i?n.push.apply(n,c):n.push(o):r.push({documentOrder:a,tabIndex:s,item:t,isScope:i,content:c})})),r.sort(ho).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},wo=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==oo.call(e,ao)&&vo(t,e)},_o=ro.concat("iframe").join(","),Co=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==oo.call(e,_o)&&go(t,e)};function So(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Eo(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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 To(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){Eo(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}var Io=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},No=function(e){return Io(e)&&!e.shiftKey},Lo=function(e){return Io(e)&&e.shiftKey},ko=function(e){return setTimeout(e,0)},Mo=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},Ao=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},Oo=[],Po=function(e,t){var n,r=(null==t?void 0:t.document)||document,a=(null==t?void 0:t.trapStack)||Oo,i=To({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:No,isKeyBackward:Lo},t),o={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:i[n||t]},c=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return o.containerGroups.findIndex((function(t){var r=t.container,a=t.tabbableNodes;return r.contains(e)||(null==n?void 0:n.includes(r))||a.find((function(t){return t===e}))}))},l=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=n.hasFallback,o=void 0!==a&&a,s=n.params,c=void 0===s?[]:s,l=i[e];if("function"==typeof l&&(l=l.apply(void 0,function(e){if(Array.isArray(e))return So(e)}(t=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return So(e,t);var n={}.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)?So(e,t):void 0}}(t)||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.")}())),!0===l&&(l=void 0),!l){if(void 0===l||!1===l)return l;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var u=l;if("string"==typeof l){try{u=r.querySelector(l)}catch(t){throw new Error("`".concat(e,'` appears to be an invalid selector; error="').concat(t.message,'"'))}if(!u&&!o)throw new Error("`".concat(e,"` as selector refers to no known node"))}return u},u=function(){var e=l("initialFocus",{hasFallback:!0});if(!1===e)return!1;if(void 0===e||e&&!Co(e,i.tabbableOptions))if(c(r.activeElement)>=0)e=r.activeElement;else{var t=o.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}else null===e&&(e=l("fallbackFocus"));if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(o.containerGroups=o.containers.map((function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?uo([e],t.includeContainer,{filter:vo.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:bo}):lo(e,t.includeContainer,vo.bind(null,t)),xo(n)}(e,i.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?uo([e],t.includeContainer,{filter:go.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):lo(e,t.includeContainer,go.bind(null,t))}(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,a=t.length>0?t[t.length-1]:void 0,o=n.find((function(e){return wo(e)})),s=n.slice().reverse().find((function(e){return wo(e)})),c=!!t.find((function(e){return fo(e)>0}));return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:a,firstDomTabbableNode:o,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=t.indexOf(e);return a<0?r?n.slice(n.indexOf(e)+1).find((function(e){return wo(e)})):n.slice(0,n.indexOf(e)).reverse().find((function(e){return wo(e)})):t[a+(r?1:-1)]}}})),o.tabbableGroups=o.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),o.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(o.containerGroups.find((function(e){return e.posTabIndexesFound}))&&o.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function(e){var t=e.activeElement;if(t)return t.shadowRoot&&null!==t.shadowRoot.activeElement?p(t.shadowRoot):t},f=function(e){!1!==e&&e!==p(document)&&(e&&e.focus?(e.focus({preventScroll:!!i.preventScroll}),o.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):f(u()))},h=function(e){var t=l("setReturnFocus",{params:[e]});return t||!1!==t&&e},m=function(e){var t=e.target,n=e.event,r=e.isBackward,a=void 0!==r&&r;t=t||Ao(n),d();var s=null;if(o.tabbableGroups.length>0){var u=c(t,n),p=u>=0?o.containerGroups[u]:void 0;if(u<0)s=a?o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:o.tabbableGroups[0].firstTabbableNode;else if(a){var f=o.tabbableGroups.findIndex((function(e){var n=e.firstTabbableNode;return t===n}));if(f<0&&(p.container===t||Co(t,i.tabbableOptions)&&!wo(t,i.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(f=u),f>=0){var h=0===f?o.tabbableGroups.length-1:f-1,m=o.tabbableGroups[h];s=fo(t)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else Io(n)||(s=p.nextTabbableNode(t,!1))}else{var y=o.tabbableGroups.findIndex((function(e){var n=e.lastTabbableNode;return t===n}));if(y<0&&(p.container===t||Co(t,i.tabbableOptions)&&!wo(t,i.tabbableOptions)&&!p.nextTabbableNode(t))&&(y=u),y>=0){var g=y===o.tabbableGroups.length-1?0:y+1,v=o.tabbableGroups[g];s=fo(t)>=0?v.firstTabbableNode:v.firstDomTabbableNode}else Io(n)||(s=p.nextTabbableNode(t))}}else s=l("fallbackFocus");return s},y=function(e){var t=Ao(e);c(t,e)>=0||(Mo(i.clickOutsideDeactivates,e)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):Mo(i.allowOutsideClick,e)||e.preventDefault())},g=function(e){var t=Ao(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(o.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var a=!0;if(o.mostRecentlyFocusedNode)if(fo(o.mostRecentlyFocusedNode)>0){var s=c(o.mostRecentlyFocusedNode),l=o.containerGroups[s].tabbableNodes;if(l.length>0){var d=l.findIndex((function(e){return e===o.mostRecentlyFocusedNode}));d>=0&&(i.isKeyForward(o.recentNavEvent)?d+1<l.length&&(r=l[d+1],a=!1):d-1>=0&&(r=l[d-1],a=!1))}}else o.containerGroups.some((function(e){return e.tabbableNodes.some((function(e){return fo(e)>0}))}))||(a=!1);else a=!1;a&&(r=m({target:o.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(o.recentNavEvent)})),f(r||o.mostRecentlyFocusedNode||u())}o.recentNavEvent=void 0},v=function(e){(i.isKeyForward(e)||i.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o.recentNavEvent=e;var n=m({event:e,isBackward:t});n&&(Io(e)&&e.preventDefault(),f(n))}(e,i.isKeyBackward(e))},b=function(e){var t;"Escape"!==(null==(t=e)?void 0:t.key)&&"Esc"!==(null==t?void 0:t.key)&&27!==(null==t?void 0:t.keyCode)||!1===Mo(i.escapeDeactivates,e)||(e.preventDefault(),n.deactivate())},x=function(e){var t=Ao(e);c(t,e)>=0||Mo(i.clickOutsideDeactivates,e)||Mo(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},w=function(){if(o.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)}(a,n),o.delayInitialFocusTimer=i.delayInitialFocus?ko((function(){f(u())})):f(u()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",x,{capture:!0,passive:!1}),r.addEventListener("keydown",v,{capture:!0,passive:!1}),r.addEventListener("keydown",b),n},_=function(){if(o.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",x,!0),r.removeEventListener("keydown",v,!0),r.removeEventListener("keydown",b),n},C="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver((function(e){e.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===o.mostRecentlyFocusedNode}))}))&&f(u())})):void 0,S=function(){C&&(C.disconnect(),o.active&&!o.paused&&o.containers.map((function(e){C.observe(e,{subtree:!0,childList:!0})})))};return n={get active(){return o.active},get paused(){return o.paused},activate:function(e){if(o.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),a=s(e,"checkCanFocusTrap");a||d(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,null==t||t();var i=function(){a&&d(),w(),S(),null==n||n()};return a?(a(o.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!o.active)return this;var t=To({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,_(),o.active=!1,o.paused=!1,S(),function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}(a,n);var r=s(t,"onDeactivate"),c=s(t,"onPostDeactivate"),l=s(t,"checkCanReturnFocus"),u=s(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){ko((function(){u&&f(h(o.nodeFocusedBeforeActivation)),null==c||c()}))};return u&&l?(l(h(o.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){if(o.paused||!o.active)return this;var t=s(e,"onPause"),n=s(e,"onPostPause");return o.paused=!0,null==t||t(),_(),S(),null==n||n(),this},unpause:function(e){if(!o.paused||!o.active)return this;var t=s(e,"onUnpause"),n=s(e,"onPostUnpause");return o.paused=!1,null==t||t(),d(),w(),S(),null==n||n(),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return o.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),o.active&&d(),S(),this}},n.updateContainerElements(e),n};const Ro=({children:e,onClose:t,fallBackFocusRef:n,"aria-label":r,"aria-labelledby":i})=>{const o=Mi(),s=(0,ka.useRef)(null),c=(0,ka.useRef)(null),[l,u]=(0,ka.useState)(!1);return(0,ka.useEffect)((()=>(l&&s.current&&(c.current=Po(s.current,{initialFocus:n.current||void 0}),c.current.activate()),()=>{c.current&&c.current.deactivate()})),[l,n]),(0,ka.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||(null!==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()}}),[l]),(0,ka.useEffect)((()=>{l&&s.current&&s.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()}))}),[l,t]),(0,ka.useLayoutEffect)((()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",o),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),r&&t.setAttribute("aria-label",r),i&&t.setAttribute("aria-labelledby",i),e.appendChild(t),s.current=t,u(!0),()=>{s.current&&(e.removeChild(s.current),s.current=null)}}),[r,i,o]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>s.current&&(0,a.render)(e,s.current)}):s.current&&(0,a.render)((0,a.toChildArray)(e).filter(mn).map((e=>(e.props={...e.props,onClose:t},e))),s.current)},Do=({url:e,description:t,onClose:n})=>{const r=an(),a=Ni(),i=wi(),o=(0,ka.useRef)(null),{t:s}=Wa(),c=["modal",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];"function"!=typeof i?c.push(...i):c.push(...i(r));const l=e=>{e.stopPropagation()},u=()=>{n()},d=r?.zIndex?{zIndex:r.zIndex+1}:void 0;return(0,li.jsx)(Ro,{onClose:n,"aria-label":s("lightbox.heading"),fallBackFocusRef:o,children:({onClose:n,modalRenderFn:r})=>r((n=>(0,li.jsx)("div",{className:xi(c),onClick:u,style:d,children:(0,li.jsxs)("div",{className:xi("modal__float"),tabIndex:-1,onMouseDown:a,onKeyDown:a,onTouchStart:a,onMouseMove:a,onWheel:a,onPointerDown:a,onPointerMove:a,ref:o,children:[(0,li.jsx)("div",{className:xi("modal__inner"),onClick:l,children:(0,li.jsx)("img",{className:xi("modal__image"),src:e,alt:t})}),(0,li.jsxs)("button",{type:"button",className:xi("modal__close"),onClick:n,children:[(0,li.jsx)(zi,{name:"close",size:"16",alt:""}),s("lightbox.closeLabel")]})]})}))(n))})},zo=({description:e,url:t})=>{const{t:n}=Wa(),[r,a]=(0,ka.useState)(!1);return(0,li.jsxs)(li.Fragment,{children:[(0,li.jsxs)("button",{type:"button",className:xi("modal__enlarge"),onClick:()=>{a(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),(0,li.jsx)(zi,{name:"enlarge",size:"32",alt:""})]}),r&&(0,li.jsx)(Do,{url:t,description:e,onClose:()=>{a(!1)}})]})},Fo=({event:e,...t})=>{const{body:n}=vi(e),r=Xi({originMessage:e.payload.id,transactionId:e.payload.transactionId}),a=(0,ka.useMemo)((()=>e.payload.optimisticallyInjected?{children:(0,li.jsx)("p",{children:n?.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:n?.text||""}}}),[n,e]);return(0,li.jsx)(Oi,{type:"text",event:e,onClick:r,...t,...a})},Uo="PROCESSING_IMAGE",Bo=({img:e,filename:t})=>{const{t:n}=Wa(),r=n("fileUpload.srFileUploadedText",{fileName:t});return(0,li.jsx)(li.Fragment,{children:(0,li.jsxs)("span",{className:xi(["download","download--preview"]),children:[(0,li.jsx)("img",{src:e,alt:r}),(0,li.jsx)("span",{"aria-hidden":"true",className:xi("file-download"),children:t})]})})},Ho=({children:e,fileId:t,isDeleted:n,onClickHandler:r,url:a,target:i})=>t&&!n?(0,li.jsx)("button",{onClick:r,className:xi(["button","download","download-link"]),children:e}):a?(0,li.jsx)("a",{href:a,download:!0,target:i,className:xi(["download","download-link"]),children:e}):(0,li.jsx)("span",{className:xi("download"),children:e}),$o={message:{choice_prompt:({event:e,children:t,...n})=>{const{t:r}=Wa(),i=Mi(),{body:o,subEvent:s,showOptions:c,chooseAgain:l,onChoiceClickHandler:u,onChooseAgainClickHandler:d}=(e=>{const{payload:t}=e,[n,r]=(0,ka.useState)(!1),{sendAction:a,addMessageBubble:i,addDivider:o}=ri(),{activeServiceSessionId:s}=Sn(),c=qt(En),{body:l}=vi(e),{service:u}=t,d=(0,ka.useMemo)((()=>{if("choice_prompt"===e.payload.type)return{...e,payload:{...e.payload,body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&{...e.payload.translatedBody,data:e.payload.translatedBody?.prompt}}}}),[e]),p=l?.chooseAgain&&s===u?.serviceSessionId&&t.id!==c;return(0,ka.useEffect)((()=>{r(t.id===c)}),[t,c]),{body:l,subEvent:d,showOptions:n,chooseAgain:p,onChoiceClickHandler:e=>{const n=G();p&&o("new_topic",n),i(e.text,n),a({type:"pick_choice",originMessage:t.id,choice:{id:e.id,chooseAgain:p},transactionId:n}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}})(e);return(0,li.jsxs)(li.Fragment,{children:[(0,a.toChildArray)(t).filter(mn).map((e=>(e.props={...e.props,event:s,descriptorId:i,showTranslationToggle:!1},e))),l&&(0,li.jsxs)("button",{type:"button",className:xi("button","button--secondary","button--choose-again"),"aria-expanded":c?"true":"false",onClick:d,"aria-describedby":i,children:[r(c?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,li.jsx)(zi,{name:"chevronDown",size:"8",alt:""})]}),c&&(0,li.jsx)(Oi,{type:"choice-prompt",showParticipant:!1,event:e,...n,children:(0,li.jsx)("ul",{className:xi("choice-prompt","choice-prompt--many"),children:o?.choices?.map((e=>(0,li.jsx)("li",{className:xi("choice-prompt__item",{[`choice-prompt__item--${e?.category}`]:!!e.category}),children:(0,li.jsx)("button",{type:"button",className:xi("button","button--primary"),onClick:()=>{u(e)},children:e.text})},e.id)))})})]})},text:Fo,image:({event:e,descriptorId:t,...n})=>{const{body:r}=vi(e),[a,i]=(0,ka.useState)(!1),o=La();return(0,li.jsxs)(Oi,{event:e,type:"image",...n,children:[(0,li.jsx)("img",{src:r?.url,id:t,alt:r?.description||void 0,onLoad:()=>{o(Yr(e.payload.id)),i(!0)}}),r?.isZoomable&&a&&(0,li.jsx)(zo,{description:r?.description,url:r?.url})]})},splash:({event:e,...t})=>{const{payload:n}=e,{body:r}=vi(e),a=Xi({originMessage:n.id,transactionId:n.transactionId});return(0,li.jsx)(Oi,{type:"splash",event:e,onClick:a,...t,bodyProps:{dangerouslySetInnerHTML:{__html:r?.text||""}}})},video:({event:e,descriptorId:t,...n})=>{const{body:r}=vi(e);return _i(e).push("message--type-video"),(0,li.jsxs)(Oi,{event:e,type:"video",...n,children:[(0,li.jsx)("div",{id:t,className:xi("visually-hidden"),children:r?.description}),(0,li.jsx)("iframe",{title:r?.description||"",src:r?.url,allow:"autoplay; encrypted-media",allowFullScreen:!0})]})},upload:({event:e,...t})=>{const{t:n}=Wa(),{body:r}=vi(e),{fromClient:a,id:i}=e.payload,{filename:o,id:s,isDeleted:c,url:l}=r,u=ei(),d=(e=>{const{processingFileUploads:t}=qt((({state:e})=>e));return(0,ka.useMemo)((()=>{if(t.some((t=>t===e)))return Uo;try{return sessionStorage.getItem(`image-${e}`)}catch(e){return}}),[e,t])})(i),p=(0,ka.useMemo)((()=>n(c||!l&&!s?"fileUpload.srFileUploadedText":"fileUpload.srFileDownloadText",{fileName:o})),[l,s,o,c,n]);return(0,li.jsx)(Oi,{event:e,type:"upload",...t,children:d&&d!==Uo?(0,li.jsx)(Bo,{img:d,filename:o}):(0,li.jsxs)(Ho,{fileId:s,isDeleted:c,onClickHandler:()=>{s&&o&&u.downloadFile(s,o)},url:l,target:a?void 0:"_blank",children:[(0,li.jsx)(zi,{name:"download",size:"16",alt:p}),(0,li.jsx)("span",{"aria-hidden":"true",className:xi("file-download"),children:o})]})})},cta:({event:e})=>{const{body:t}=vi(e),n=Xi({originMessage:e.payload.id,transactionId:e.payload.transactionId}),{emitEvent:r}=ri(),a=Mi(),i=(0,ka.useCallback)((()=>r(`action.${R}`,{type:R,originMessage:e.payload.id,link:{url:t?.buttonLink}})),[r,t,e]);return(0,li.jsxs)(Oi,{type:"cta",event:e,children:[(0,li.jsx)("div",{className:xi("cta__content"),id:a,dangerouslySetInnerHTML:t?.description?{__html:t.description}:void 0,onClick:n}),(0,li.jsx)("a",{className:xi("button","button--primary"),"aria-describedby":a,href:t?.buttonLink,rel:"noreferrer",target:t?.buttonNewTab?"_blank":"_self",onClick:i,children:t?.buttonText})]})},carousel:({event:e})=>{const{body:t}=vi(e),n=t.cards;return(0,li.jsx)(Oi,{event:e,modifiers:"type-carousel",children:(0,li.jsx)(Vi,{items:n,getItemKey:Gi,getItemLabel:Wi})})},card:({event:e})=>{const{body:t}=vi(e),n=Mi();return(0,li.jsx)(Oi,{type:"card",event:e,children:(0,li.jsx)(Pi,{id:n,...t})})}},info:{text:Fo,divider:({event:e,...t})=>{const n=Qi[H[e.payload.body.subtype]]||Qi.default;return(0,li.jsx)(n,{event:e,...t})},translation:({event:e,...t})=>{const{t:n}=Wa(),{body:r}=vi(e);return(0,li.jsx)(Oi,{type:"text",event:e,...t,children:n(r.key.join("."),r.variables)})},timeIndicator:no},participant:{participant:({event:e})=>{const{participant:t}=e.payload,{body:n}=(e=>{const{translatedBody:t,translation:n,body:r}={body:e.payload?.participant?.introduction,translatedBody:e.payload?.participant?.translatedIntroduction,translation:e.payload?.participant?.translation},a=!!t,i=qt(yi(e));return{body:i&&a?t:r,hasTranslation:a,isTranslated:i&&a,userLocale:n?.locale}})(e);return n?(0,li.jsx)(Yi,{graphicSrc:t?.avatar,graphicType:t?.avatar?"avatar":void 0,iconName:t?.avatar?void 0:"balloon",dividerType:"participant",title:n}):null}},service_data:{suggestion:({event:e,...t})=>{const[n,r]=(0,ka.useState)(!0),a=La(),i=Ja(),{sendAction:o,addMessageBubble:s}=ri(),{suggestions:c,payload:l}=(e=>{const{payload:t}=e,{body:n}=vi(e);return{suggestions:n,payload:t}})(e),{showSuggestions:u}=an(),d=xn(),{t:p}=Wa(),f=p("suggestions.headingText"),h=p("suggestions.footerText"),m=(0,ka.useMemo)((()=>d.some((({payload:e,type:t})=>"message"===t&&e?.transactionLast))),[d]),y=(0,ka.useCallback)((({id:e,question:t})=>{r(!1),a(Wn(!0));const n=G();o({type:L,originMessage:l.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n}),s(t,n)}),[a,o,l.id,s]);return n&&!i&&m&&u?(0,li.jsxs)("div",{className:xi("suggestions","suggestions--conversation"),children:[f&&(0,li.jsx)("p",{className:xi("suggestions__heading"),children:f}),(0,li.jsxs)(Oi,{type:"suggestions",showParticipant:!1,event:e,...t,children:[(0,li.jsx)(Ji,{className:"suggestions__list--conversation",onClickSuggestion:y,suggestions:c}),h&&(0,li.jsx)("p",{className:xi("suggestions__footer"),children:h})]})]}):null}}},Vo=({children:e})=>{const{customComponents:t}=an(),n=(0,ka.useMemo)((()=>Object.keys($o).reduce(((e,n)=>(e[n]={...$o[n],...t?t[n]:{}},e)),{fallback:Fo})),[t]);return(0,li.jsx)(di.Provider,{value:n,children:e})},Go=({children:e})=>{const{isMinimized:t}=qa(),n=(0,ka.useRef)(0),{sendAction:r}=ri(),{hasCountdown:a,isActive:i,stopCountdown:o}=Li(),s=(0,ka.useCallback)((()=>{if(t)return;const e=(new Date).getTime(),s=()=>{r({type:"interactivity_update"}),n.current=e};a&&i&&(s(),o()),e-n.current>15e3&&s()}),[r,a,i,o,t]);return(0,li.jsx)("div",{className:xi("activity-monitor"),tabIndex:-1,onMouseDown:s,onKeyUp:s,onTouchStart:s,onMouseMove:s,onWheel:s,onPointerDown:s,onPointerMove:s,children:(0,li.jsx)(Ii.Provider,{value:s,children:e})})},Wo=["text","choice_prompt","image","video"],qo=()=>{const e=(()=>{const e=ei();return(0,ci.useSyncExternalStore)(y.subscribe,(()=>e.conversation))})(),t=(0,ka.useRef)(),n=(0,ka.useRef)(),r=La(),a=Qa(),i=(0,ka.useRef)(null),{initCountdown:o,endCountdown:s}=Li(),{emitEvent:c}=ri(),{hasPrompt:l,continueChat:u}=ki(),d=(0,ka.useRef)(l);return(0,ka.useEffect)((()=>{d.current=l}),[l]),(0,ka.useEffect)((()=>{e.socket&&(e.onConnection((({currentState:e})=>{if("attach_channel_erred"===e){const e=new x;return r(gr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),!0}return!1})),e.onError((e=>{const t=new Kn(e);r(gr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r(Lr())})),e.onOpen((()=>{r(vr())})))}),[e,e.socket,r]),(0,ka.useEffect)((()=>{e.onConnection((({connected:t})=>!!t&&(n.current&&e?.removeListener("message",n.current),n.current=e=>{switch(e.type){case"ui":switch(e.payload.type){case"idle_detach_countdown":"idle_detach_countdown"===e.payload.body.type&&o(e.payload.body.duration);break;case"loading":r(Xr(e.payload.body.loading));break;case"idle_detach_countdown_elapsed":s(void 0,!0);break;case"resume_conversation_prompt":r(Dr());break;case"user_first_response":r(Wn(!0)),c("system.userFirstResponse",e.payload.body);break;case"translation_proposal":r(Ca(e.payload.body))}break;case"service_attach":const{service:{name:t,settings:{proactiveMessages:{enabled:n},entry:a},sessionId:i}}=e.payload;r(fa(n||!1)),t&&c("system.serviceChanged",t),i&&r(Ur(i)),r(ta(a)),r(Vr({uploads:{enabled:a.options?.upload?.enabled||!1}}));break;case"context":e.payload.contentLocale&&e.payload.userLocale&&r(cr(e.payload.userLocale));break;case"message":switch(e.payload.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"cta":case"custom":case"carousel":case"card":if(e.payload.service&&e.payload.service.serviceSessionId&&r(Ur(e.payload.service.serviceSessionId)),e.payload.fromClient){r(Ir(e));break}d.current&&u(),r(Tr(e))}break;case"participant":(e=>{const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:a}=t;!n&&"string"!=typeof a&&a?.name&&r(Wr(a.name)),r(Zr(t)),"string"!=typeof a&&a.introduction&&r(Tr({...e,payload:{...t,type:"participant"}}))})(e);break;case"service_data":e.payload.persist&&r(ea(e.payload));break;case"info":"divider"!==e.payload.type&&"text"!==e.payload.type&&"translation"!==e.payload.type||r(Tr({type:"info",payload:{...e.payload,participant:null}}));break;case"error":switch(e.payload.type){case"find_conversation":const t=new w(e);r(gr({name:t.name,action:t.action,message:t.message,originalEvent:t.originalEvent,originalError:t.originalError}));break;case"conversation":const n=new x(e);r(gr({name:n.name,message:n.message,langKey:n.langKey,originalEvent:n.originalEvent,originalError:n.originalError,action:n.action}))}}return e},e.onMessage(n.current),!0)))}),[u,e,r,c,s,a,o]),(0,ka.useEffect)((()=>{e.onConnection((({connected:n})=>!!n&&(t.current&&e.removeListener("message",t.current),t.current=async({payload:e})=>{if("history_changed"===e?.type)try{const t=await r(hr(e)).unwrap();t&&"service"in t&&r(Kr(t))}catch(e){}return Wo.includes(e?.type)?(e.id!==i.current&&a.emit("message",e),i.current=e.id,e):e},e.addListener("message",t.current),!0)))}),[e,r,a]),null},Ko=({children:e})=>{const{t}=Wa(),n=La(),r=ei(),{addUploadBubble:a}=ri(),i=(0,ka.useCallback)((async(e,t)=>{n(oa(t));const r=await(e=>new Promise(((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>{"string"==typeof r.result&&t(r.result)},r.onerror=e=>n(e)})))(e),a=new Image;a.src=r,await a.decode();const i=(e=>{const t=document.createElement("canvas"),n=t.getContext("2d"),[r,a]=(e=>{const{height:t,width:n}=e;return n>t&&n>600?[600,600*t/n]:t>600?[600*n/t,600]:[n,t]})(e);return t.width=r,t.height=a,n?.drawImage(e,0,0,r,a),t.toDataURL()})(a);try{sessionStorage.setItem(`image-${t}`,i)}catch(e){}finally{n(sa(t))}}),[n]),o=(0,ka.useCallback)((e=>{const o=G(),s=r.uploadFile(e,(e=>{n(ia({fileId:o,progress:Math.ceil(e)}))}),(async t=>{const{id:r,transactionId:s,occurredAt:c,body:{contentType:l,filename:u,filesize:d}}=t;n(ra(o)),a(r,s,c,l,u,d),l.includes("image/")&&await i(e,r)}),(e=>{let r;switch(e?.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(aa({fileId:o,errorText:r}))}));n(zr({fileId:o,fileName:e.name,uploadHandle:s}))}),[i,a,r,n,t]);return(0,li.jsx)(Ci.Provider,{value:o,children:e})},Jo=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=Li();return((e,t)=>{const n=(0,ka.useRef)(e);(0,ka.useEffect)((()=>{n.current=e}),[e]),(0,ka.useEffect)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n&&n>0?1e3:null),null},Xo=()=>{const{initUserSelectedOptions:e}=ji(),t=(0,ka.useRef)(!1),n=an();return(0,ka.useEffect)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null};function Yo(e,t,n=[]){const r=Qa(),a=(0,ka.useRef)(t);(0,ka.useEffect)((()=>{if(!n.every(Boolean))return;const t=(...e)=>a.current?.(...e);return r.emit("function.register",e,t),()=>r.emit("function.unregister",e,t)}),[r,e,...n])}const Zo=()=>{const e=an(),{sendMessage:t,sendContext:n,sendAction:r}=ri(),a=La(),{setVisibility:i,visible:o}=qa(),s=(0,ka.useRef)(o),c=Qa(),l=ei(),u=_n(),d=(0,ka.useRef)(null),p=(0,ka.useRef)(null),{isInline:f,isResolving:h}=Tn(),m=qt(oi),y=(()=>{const{get:e}=ti();return e?e("conversationUrl"):null})(),g=(0,ka.useRef)(null),v=Ni(),{enableTranslations:b,disableTranslations:x}=gi();return(0,ka.useEffect)((()=>{s.current=o}),[o]),Yo("askText",(e=>{t({body:e})}),[l.send]),Yo("setVariables",(e=>{n({variables:e})}),[l.send]),Yo("getVisibility",(e=>{e?e(s.current):console.warn("A callback function is required for the getVisibility action.")})),Yo("setVisibility",(e=>{const t="string"==typeof e||null===e?e:e.visibility;Object.values(Mt).includes(t)?(v(),i(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[e.api]),Yo("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[l.send]),Yo("setTopic",(({name:e,fallbackMessage:t,message:n,userTriggered:i})=>{i&&a(Bn({showSuggestions:!1})),e&&t?r({type:P,body:{name:e,fallbackMessage:t,message:n}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[l.send]),Yo("setContext",(e=>{n(e)}),[l.send]),Yo("setTranslation",(({enabled:e,locale:t})=>{e?b(t,F):x()}),[l.send]),(0,ka.useEffect)((()=>{h||m||(g.current&&g.current!==y&&c.emit("unreadMessageCount",u),o===Mt.open&&o!==p.current&&0!==d.current&&c.emit("unreadMessageCount",0),o!==Mt.open&&u!==d.current&&c.emit("unreadMessageCount",u),p.current=o,d.current=u,"string"==typeof y&&(g.current=y))}),[u,o,c,f,h,m,y]),null},Qo=({children:e})=>{const t=Qa(),n=(0,ka.useRef)(null),[r,a]=(0,ka.useState)(),i=(0,ka.useRef)(!0),o=(0,ka.useCallback)((e=>{i.current&&(a(e),t.emit("aria-live",e))}),[a,t]);return(0,ka.useEffect)((()=>(n.current=null,r?.messageText&&(n.current=setTimeout((()=>{o({}),n.current&&clearTimeout(n.current)}),600)),()=>{n.current&&clearTimeout(n.current)})),[r,o]),(0,ka.useEffect)((()=>()=>{i.current=!1}),[]),(0,li.jsxs)(Za.Provider,{value:o,children:[e,(0,li.jsxs)("div",{className:xi("app__live-container"),children:[(0,li.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:xi("visually-hidden"),children:r?.ariaLive===U?r?.messageText:null}),(0,li.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:xi("visually-hidden"),children:r?.ariaLive===B?r?.messageText:null})]})]})},es=()=>{const{t:e}=Wa(),t=xn(),n=(0,ka.useRef)(0),r=(0,ka.useRef)(0),a=gn().historyLoaded,{sendPolite:i}=ai(),{isOpen:o}=qa(),s=(0,ka.useRef)(null),c=(0,ka.useRef)(null),l=(0,ka.useMemo)((()=>on((t=>{const n=t.filter((({payload:e})=>!e.fromClient&&!e.fromHistory)).length;n>r.current&&(i(e("message.srNewEventCount",{newCount:n-r.current})),r.current=n)}),1e3)),[i,e]);return(0,ka.useEffect)((()=>{t.length>n.current&&(o&&(c.current=l(t)),n.current=t.length)}),[t,l,o]),(0,ka.useEffect)((()=>{s.current&&!o&&c.current&&(c.current(!0),c.current=null)}),[o]),(0,ka.useEffect)((()=>{a&&setTimeout((()=>{i(e("window.srTexts.onHistoryLoad"))}),500)}),[a,e,i]),null},ts=()=>{const{t:e}=Wa(),{isOpen:t,isVisible:n}=qa(),r=_n(),{sendPolite:a}=ai(),i=(0,ka.useMemo)((()=>on(a,2e3)),[a]),o=(0,ka.useRef)(null),s=(0,ka.useRef)(null);return(0,ka.useEffect)((()=>{o.current!==n&&!n&&s.current&&s.current(),0!==r&&!t&&n&&(s.current=i(e("message.srTextUnreadCount",{unreadCount:r}))),o.current=n}),[r,t,n,i,e]),null},ns=({store:e,children:t,eventBus:n,api:r})=>((0,ka.useErrorBoundary)((t=>{console.error(t),e.dispatch(Xn(t))})),(0,li.jsx)(Zt,{store:e,children:(0,li.jsx)(Ya.Provider,{value:n,children:(0,li.jsx)(Xa.Provider,{value:r,children:(0,li.jsx)(Qo,{children:(0,li.jsx)(ui,{children:(0,li.jsxs)(Vo,{children:[(0,li.jsx)(Xo,{}),(0,li.jsx)(qo,{}),(0,li.jsx)(ts,{}),(0,li.jsx)(es,{}),(0,li.jsx)(Jo,{}),(0,li.jsxs)(Go,{children:[(0,li.jsx)(Zo,{}),(0,li.jsx)(Ko,{children:t})]})]})})})})})})),rs=It(bn,(e=>e.filter((e=>wr(e)&&"service_data"!==e.type&&e.payload?.messageStatus===I)))),as=It([rs],(e=>e.filter((e=>"participant"!==e.type)).at(-1))),is=It(rs,(e=>e.filter((({payload:e})=>e?.id)).map((({payload:e})=>e.id)))),os=It((({state:e})=>e.options.features?.webNotifications),(e=>e?.enabled)),ss=()=>{const{t:e}=Wa(),{showDisclaimer:t}=an();return t?(0,li.jsxs)("div",{className:xi("disclaimer"),tabIndex:0,children:[(0,li.jsx)("h2",{className:xi("disclaimer__title"),children:e("disclaimer.title")}),(0,li.jsx)("div",{className:xi("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]}):null},cs=It([({forms:e})=>e,(e,{formId:t})=>t],((e,t)=>e[t])),ls=It(cs,(e=>e?.controls||{})),us=It(ls,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),ds=It([ls,(e,{name:t})=>t],((e,t)=>e[t]?.value)),ps=It([ls,(e,{name:t})=>t],((e,t)=>e[t]?.touched)),fs=(0,a.createContext)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),{Provider:hs,Consumer:ms}=fs,ys=fs;function gs(){return(0,ka.useContext)(ys)}function vs(e){const t=La(),{formId:n,updateControlValue:r,updateControlTouched:a,errors:i}=gs(),o=!!qt((e=>cs(e,{formId:n}))),s=qt((t=>ds(t,{formId:n,name:e}))),c=qt((t=>ps(t,{formId:n,name:e}))),l=i?.[e],u=!l;(0,ka.useEffect)((()=>{o&&t(rr({formId:n,name:e}))}),[o,n,e,t]),(0,ka.useLayoutEffect)((()=>()=>{t(ar({formId:n,name:e}))}),[o,n,e,t]);const d=(0,ka.useCallback)((t=>r(e,t.target.value)),[e,r]),p=(0,ka.useCallback)((()=>{a(e,!0)}),[a,e]);return[(0,ka.useMemo)((()=>({name:e,onInput:d,onBlur:p,value:s})),[e,d,p,s]),(0,ka.useMemo)((()=>({isValid:u,error:l,touched:c})),[u,l,c])]}function bs(e){const{t}=Wa(),{sendAssertive:n}=ai(),{hasLimit:r,limit:a}=(()=>{const{entryMeta:{options:e,optionsOverride:t}}=gn(),{limit:n}=t?.text||e?.text||{limit:null};return{hasLimit:null!==n,limit:null!==n?n:null}})(),i=(0,ka.useMemo)((()=>on(n,300)),[n]),o=(0,ka.useMemo)((()=>on(((e,n)=>{e&&i(t("input.srCharacterLimitText",{limit:n}))}),300)),[i,t]),[{value:s}]=vs(e),c=a&&r&&s?a-s.length:a,l=!(!r||"number"!=typeof c)&&c<=50,u=!(!r||!c)&&c<0;return(0,ka.useEffect)((()=>{o(l,c)}),[l,c,o]),{hasCharacterLimit:r,characterLimit:a,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}function xs(){const{abortTransaction:e,clearEntryAbortTransaction:t}=(()=>{const e=La(),{entryMeta:{actions:t,translatedActions:n}}=gn();return{abortTransaction:n?.abortTransaction||t?.abortTransaction,clearEntryAbortTransaction:()=>{e(na())}}})(),n=ei();return e?(0,li.jsx)("li",{className:xi(["cvco-conversation__item","cvco-conversation__item--abort-transaction"]),children:(0,li.jsx)("button",{className:xi(["button","button--secondary","abort-transaction__button"]),type:"button",onClick:()=>{n.send("action",{type:P,body:{name:e.topicName,fallbackMessage:e.topicFallbackMessage}}),t()},children:e.label})}):null}const ws=(0,a.createContext)(null),_s=()=>{const e=(0,ka.useContext)(ws);if(!e)throw new Error("useChatScrollContext has to be used within <ChatScrollContext.Provider>");return e},Cs=ws,Ss=e=>{const t=(()=>{const e=(0,ka.useContext)(di);if(!e)throw new Error("useComponentContext has to be used within <ComponentContext.Provider>");return e})(),n=t[e.type];let r=n[e.payload.type],a=null;return"choice_prompt"===e.payload.type&&(a=n[e.payload.body.prompt.type]),"participant"===e.type&&(r=n[e.type]),r&&"function"!=typeof r&&(r=r[e.payload.body.type]),[r||t?.fallback,a]},Es=({event:e,newParticipant:t})=>{const{eventRefs:n,unreadIds:r}=_s(),{sendAction:a}=ri(),i=e.payload.id?n[e.payload.id]:void 0,{containerRef:o,isVisible:s}=Ka({containerRef:i,freezeOnceVisible:!0}),c=La(),[l,u]=Ss(e);if((0,ci.useEffect)((()=>{if(s&&r?.includes(e.payload.id)){const t=r.reduce(((t,n)=>e?.payload?.id&&n&&!t.includes(e.payload.id)?t.concat(n):t),[]);c(Hr(t)),a({type:M,events:t})}}),[c,e.payload.id,s,a,r]),!l)return null;const d=["conversation__item"];return"info"===e.type?d.push("conversation__item--source-info"):e.payload.fromClient?d.push("conversation__item--source-user"):d.push("conversation__item--source-agent"),t&&d.push("conversation__item--new-participant"),(0,li.jsxs)("li",{className:xi(d),ref:o,children:[e.payload.timeIndicator&&(0,li.jsx)(no,{event:e}),(0,li.jsx)(l,{event:e,children:(0,li.jsx)(u,{event:e})})]})},js=()=>{const{id:e}=jn()||{};return(0,li.jsx)("li",{className:xi("conversation__item","conversation__item--source-agent"),children:(0,li.jsxs)("div",{className:xi("message","message--source-agent","message--type-loading"),children:[(0,li.jsx)(Ai,{eventPayload:{fromClient:!1,participant:e}}),(0,li.jsx)("div",{className:xi("message__body"),children:(0,li.jsxs)("span",{className:xi("loader"),children:[(0,li.jsx)("span",{className:xi("loader__part","one")}),(0,li.jsx)("span",{className:xi("loader__part","two")}),(0,li.jsx)("span",{className:xi("loader__part","three")}),(0,li.jsx)("span",{className:xi("loader__part","four")})]})})]})})},Ts=()=>{const e=xn();let t;return(0,li.jsx)(li.Fragment,{children:e.map((e=>{const{type:n,payload:r}=e;let a=!1;if("info"===n||"message"===n){const{participant:n,fromClient:i}=r,o=i?"seamly-client-participant":n;"info"!==e.type&&t!==o&&(a=!0),t=o}return(0,li.jsx)(Es,{event:e,newParticipant:a},e.payload.key||e.payload.id)}))})},Is=()=>{const{t:e}=Wa(),t=wn(),n=((e,t=20)=>{const[n,r]=(0,ka.useState)(e),a=(0,ka.useRef)(null);return(0,ka.useEffect)((()=>(a.current=setTimeout((()=>r(e)),t),()=>{a.current&&clearTimeout(a.current)})),[e,t]),n})(t,t?0:20),{isOpen:r}=qa(),a=Cn(),i=mi();return(0,li.jsxs)(li.Fragment,{children:[r&&(0,li.jsx)("a",{className:xi("skip-link"),href:`#${a}`,onClick:e=>{e.preventDefault(),i()},children:e("skiplinkText")}),(0,li.jsx)("div",{className:xi("chat__body"),children:(0,li.jsxs)("div",{className:xi("conversation__container"),children:[(0,li.jsx)(ss,{}),(0,li.jsxs)("ol",{className:xi("conversation"),children:[(0,li.jsx)(Vo,{children:(0,li.jsx)(Ts,{})}),n?(0,li.jsx)(js,{}):null,(0,li.jsx)(xs,{})]})]})})]})};function Ns(e,t){const n=(0,ka.useRef)(null),r=(0,ka.useRef)(e);return(0,ka.useEffect)((()=>{r.current=e}),[e]),(0,ka.useEffect)((()=>"number"!=typeof t?()=>{}:(n.current=setTimeout((()=>r.current()),t),()=>{n.current&&clearTimeout(n.current)})),[t]),n}const Ls={visible:xi("transition--visible"),in:xi("transition--in"),visuallyHidden:xi("visually-hidden")},ks=Object.values(Ls),Ms=e=>{const t=(0,ka.useRef)(null);t.current=e;const n="function"==typeof e;return(0,ka.useMemo)((()=>n?(...e)=>t.current(...e):void 0),[n])},As="notRendered",Os="rendered",Ps="visuallyHidden",Rs=({children:e,isActive:t,timeout:n=300,transitionStartState:r=As,onInTransitionComplete:i=()=>{},onOutTransitionComplete:o=()=>{},exitAfter:s,enterDelay:c=0})=>{const l=(0,ka.useRef)(!1),u=(0,ka.useRef)(null),d=(0,ka.useRef)(null),p=r===Ps,[f,h]=(0,ka.useState)((()=>p?[Ls.visuallyHidden]:[])),[m,y]=(0,ka.useState)((()=>0===c)),g=(0,ka.useMemo)((()=>s?s+c:s),[c,s]);Ns((()=>y(!1)),t?g:void 0),Ns((()=>y(!0)),t?c:void 0);const v=(0,ka.useMemo)((()=>m&&t),[t,m]),b=Ms(i),x=Ms(o),w="notRendered"!==r||f.length>0;return(0,ka.useEffect)((()=>(l.current&&!v&&(h([Ls.visible]),u.current=setTimeout((()=>{h([...p?[Ls.visuallyHidden]:[]]),x&&(d.current=requestAnimationFrame((()=>{x()})))}),n)),!l.current&&v&&(h([Ls.visible]),d.current=requestAnimationFrame((()=>{d.current=requestAnimationFrame((()=>{h([Ls.visible,Ls.in]),b&&(u.current=setTimeout((()=>{b()}),n))}))}))),l.current=v,()=>{u.current&&clearTimeout(u.current),d.current&&cancelAnimationFrame(d.current)})),[p,b,x,n,v]),(0,li.jsx)(li.Fragment,{children:w&&(0,a.toChildArray)(e).filter(mn).map((e=>{const{className:t=""}=e.props,n=t.split(" ").filter((e=>!ks.includes(e)));return(0,a.cloneElement)(e,{className:[...n,...f].join(" ")})}))})},Ds=({isAside:e=!1})=>{const{isInline:t}=Tn(),{t:n}=Wa(),{sendAction:r,addMessageBubble:a}=ri(),{isOpen:i,setVisibility:o}=qa(),{showSuggestions:s}=an(),c=Mi(),l=mi(),u=(0,ka.useRef)(null),{sendPolite:d}=ai(),p=qt(oi),{hasCountdown:f,endCountdown:h}=Li(),{hasPrompt:m,continueChat:y}=ki(),g=Ja(),v=gn().serviceData.suggestion;const{body:b}=vi({payload:v,type:"service_data"}),x=(0,ka.useMemo)((()=>p?[]:Array.isArray(b)?b:[]),[b,p]),w=(0,ka.useRef)(),_=(0,ka.useRef)(!1),C=(0,ka.useRef)(),S=!!x?.length,E=t?(g||i)&&!e:g,j=(0,ka.useRef)(E),T=S&&!E&&s,I=S?x:C.current;C.current=I;const N=(0,ka.useMemo)((()=>{const t=["suggestions"];return e&&t.push("suggestions--aside"),xi(t)}),[e]),k=(0,ka.useCallback)((({id:e,question:t})=>{f&&h(!0),m&&y();const n=G();r({type:L,originMessage:v.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n}),a(t,n),i||o({visibility:Mt.open}),l()}),[a,y,h,l,f,m,v,r,o,i]);(0,ka.useEffect)((()=>{if(w.current!==x&&!E){if(S){const e=_.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout((()=>{d(e)}),30)}else _.current&&d(n("suggestions.srUnavailableText"));w.current=x}!j.current&&E?(hn(u.current,l),d(n("suggestions.srUnavailableText"))):!S&&_.current&&hn(u.current,l),_.current=S,j.current=E}),[x,S,E,l,d,n]);const M=n("suggestions.headingText"),A=n("suggestions.footerText"),O=M?"section":"div";return(0,li.jsx)(Rs,{isActive:!!T,transitionStartState:As,children:(0,li.jsxs)(O,{className:N,"aria-labelledby":M?c:void 0,ref:u,children:[M&&(0,li.jsx)("p",{id:c,className:xi("suggestions__heading"),children:M}),!!I&&(0,li.jsx)(Ji,{suggestions:I,onClickSuggestion:k}),A&&!i&&(0,li.jsx)("p",{className:xi("suggestions__footer"),children:A})]})})},zs=(0,ci.forwardRef)((({children:e,className:t=""},n)=>{const{isOpen:r,isVisible:a,setVisibility:i}=qa(),{namespace:o,layoutMode:s}=an(),{isInline:c}=Tn(),l=wi(),u=Ja(),{t:d}=Wa(),p=["chat",`chat--layout-${s}`,`namespace--${o}`,t];return"function"!=typeof l&&p.push(...l),r||"app"===s||p.push("chat--collapsed"),u&&p.push("chat--user-responded"),a&&(0,li.jsxs)("section",{className:xi(p),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!c&&r&&i({visibility:Mt.minimized})},tabIndex:-1,ref:n,"aria-label":d("chat.srLabel"),children:[(0,li.jsx)("div",{className:xi("chat-wrapper"),children:e}),"inline"===s&&r&&(0,li.jsx)(Ds,{isAside:!0})]})})),Fs=zs,Us=({children:e,handleClose:t,title:n,closeButtonText:r,srCloseButtonText:a,id:i})=>{const o=Mi();return(0,li.jsxs)("section",{tabIndex:-1,id:i,"aria-labelledby":n?o:void 0,className:xi("chat-status",n?void 0:"chat-status--condensed"),children:[(0,li.jsxs)("div",{className:xi("chat-status__body"),children:[n?(0,li.jsx)("h2",{className:xi("chat-status__title"),id:o,children:n}):null,e]}),"function"==typeof t&&(0,li.jsxs)("button",{type:"button",onClick:t,className:xi("button","button--tertiary","chat-status__close"),children:[r||(0,li.jsx)(zi,{name:"close",size:"16",alt:""}),a&&(0,li.jsx)("span",{className:xi("visually-hidden"),children:a})]})]})},Bs=({handleClick:e,icon:t,title:n,srButtonText:r})=>(0,li.jsxs)("button",{type:"button",onClick:e,className:xi("button","button--primary","chat-status__button"),children:[(0,li.jsx)(zi,{name:t,size:"16",alt:""}),n,r&&(0,li.jsx)("span",{className:xi("visually-hidden"),children:r})]});function Hs(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=(()=>{const{isActive:e,languages:t}=gi(),n=La(),{sendAction:r}=ri(),{translationProposal:a}=qt((e=>e.translations)),{enableTranslations:i}=gi(),{isOpen:o}=qa(),{userLocale:s}=Wa(),c=a?.proposedLocale,l=bi(c),u=(0,ka.useMemo)((()=>null!==a&&!e&&o&&s!==c&&t.some((e=>e.locale===c))),[a,e,o,s,c,t]);return{activateTranslationProposal:()=>{a?.proposedLocale&&i(a.proposedLocale,z)},dismissTranslationProposal:()=>{r({type:O,body:{type:D}}),n(Sa())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:a}})(),{id:a}=function(){const e=qt((({translations:e})=>e.containerId));return{id:e,focusContainer:hi(e)}}();return e&&t?(0,li.jsx)(Us,{handleClose:n,srCloseButtonText:t.srDismissButtonText,id:a,title:t.titleLabel,children:(0,li.jsx)(Bs,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})}):null}function $s(){const e=qt(oi),{isActive:t}=gi();return e||t?null:(0,li.jsx)(Hs,{})}const Vs=({label:e,checked:t,description:n,onChange:r,id:a,itemClassName:i})=>(0,li.jsxs)("li",{className:xi([i||"","translation-options__item"]),"aria-selected":t,role:"option",tabIndex:0,onClick:r,onKeyDown:e=>{"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),r())},id:a,children:[(0,li.jsx)(zi,{name:"check",size:"16",alt:""}),e," ",n&&(0,li.jsxs)("span",{children:["(",n,")"]})]}),Gs=({onChange:e,describedById:t})=>{const{context:{contentLocale:n}}=an(),{t:r}=Wa(),{languages:a,currentLocale:i,enableTranslations:o,disableTranslations:s}=gi(),c=mi(),l=t=>()=>{t&&(t===i||n===t?s():o(t,"translation_choice"),e(),c())},{primaryLanguages:u,remainingLanguages:d}=(0,ci.useMemo)((()=>a.reduce(((e,t)=>{const r=t.locale===n,a=((e,t,n)=>t===e.locale||!t&&n)(t,i,r);t.locale!==n&&e.remainingLanguages.push({...t,checked:a,isOriginal:r});const o=e.remainingLanguages.findIndex((e=>e.locale===i));return(r||a&&o>4)&&e.primaryLanguages.push({...t,checked:a,isOriginal:r}),e}),{primaryLanguages:[],remainingLanguages:[]})),[i,n,a]);return(0,li.jsxs)("ul",{"aria-describedby":t,role:"listbox",tabIndex:-1,className:xi("translation-options"),children:[u.map((({locale:e,nativeName:t,checked:n,isOriginal:a},i)=>(0,li.jsx)(Vs,{id:e,label:t,checked:n,description:a?r("translations.settings.original"):void 0,onChange:l(e),itemClassName:xi({"translation-options__item--original":a,"translation-options__item--selected":n&&0!==i})},e))),d.map((({locale:e,nativeName:t,checked:n,isOriginal:a})=>(0,li.jsx)(Vs,{id:e,label:t,checked:n,description:a?r("translations.settings.original"):void 0,onChange:l(e)},e)))]})},Ws=({className:e,children:t,onCancel:n,headingText:r,description:a,descriptionId:i,cancelButtonText:o,cancelButtonRef:s,disableButtonFocusing:c,position:l={horizontal:"left",vertical:"top"}})=>{const u=Mi(),{hideOption:d}=ji(),{focusButton:p}=Ti(),f=(0,ka.useCallback)((()=>{d(),c||p()}),[c,p,d]),h=(0,ka.useCallback)((()=>{n&&n(),f()}),[f,n]),m=(e=>{const t=(0,ka.useRef)(null);return(0,ka.useEffect)((()=>{const n=n=>{t.current&&n.target instanceof HTMLElement&&!t.current.contains(n.target)&&(n.preventDefault(),n.stopPropagation(),e())};return document.addEventListener("click",n,!0),document.addEventListener("touchstart",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("touchstart",n,!0)}}),[e,t]),t})(h);return(0,ka.useEffect)((()=>{fn(m.current)}),[m]),(0,li.jsx)("section",{className:xi("options",{"options--right":"right"===l.horizontal,"options--left":"left"===l.horizontal,"options--top":"top"===l.vertical,"options--bottom":"bottom"===l.vertical},e||""),"aria-labelledby":u,tabIndex:-1,ref:m,children:(0,li.jsxs)("div",{className:xi("options__body"),children:[(0,li.jsx)("h2",{id:u,className:xi("options__title"),children:r}),(0,li.jsxs)("button",{type:"button",onClick:h,"aria-describedby":u,className:xi("button","options__close"),ref:e=>{s&&(s.current=e)},children:[(0,li.jsx)(zi,{name:"close",size:"16",alt:""}),(0,li.jsx)("span",{children:o})]}),a?(0,li.jsx)("p",{className:xi("options__description"),id:i,children:a}):null,(0,li.jsx)("div",{className:xi("options__wrapper"),children:t})]})})},qs=function({onClose:e,position:t}){const{t:n}=Wa(),r=Mi();return(0,li.jsx)(Ws,{onCancel:e,headingText:n("translations.menu.title"),cancelButtonText:n("translations.settings.cancelButtonText"),description:n("translations.menu.description"),descriptionId:r,position:t,disableButtonFocusing:!0,children:(0,li.jsx)(Gs,{describedById:r,onChange:e})})};function Ks({children:e,position:t={horizontal:"left",vertical:"top"},classNames:n=[]}){const[r,a]=(0,ka.useState)(!1),i=(0,ka.useRef)(null),o=Mi();return(0,li.jsxs)("div",{className:xi("translations__container"),onKeyDown:e=>{r&&pn(e)===dn.Escape&&(a(!1),fn(i.current))},children:[(0,li.jsx)(Rs,{transitionStartState:As,isActive:r,children:(0,li.jsx)("div",{className:xi("options__dialog"),role:"dialog",children:(0,li.jsx)(qs,{onClose:()=>{a(!1)},position:t})})}),(0,li.jsx)("button",{type:"button",className:xi(["button","chat__options__button",...n]),id:o,onClick:()=>{a(!r)},onKeyDown:e=>{pn(e)===dn.ArrowDown&&(a(!0),e.preventDefault())},ref:i,"aria-haspopup":"dialog","aria-expanded":r,children:e})]})}const Js=({children:e,formId:t,persistData:n=!1,onError:r,onSubmit:a,validationSchema:i={},...o})=>{const s=La(),c=qt((e=>us(e,{formId:t}))),[l,u]=(0,ka.useState)(!1),[d,p]=(0,ka.useState)({}),{isValid:f,errors:h}=function(e,t){const n=(0,ka.useMemo)((()=>function(e,t={}){return Object.entries(t).reduce(((t,[n,r])=>{const a=Array.isArray(r)?r:[r];for(let r=0;r<a.length;r++)if(!a[r].fn(e[n],a[r].compareValue)){t[n]=a[r].errorText;break}return t}),{})}(e,t)),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(c,i),m=(0,ka.useMemo)((()=>({...h,...d})),[h,d]);(0,ka.useLayoutEffect)((()=>{s(tr({formId:t,persistData:n}))}),[t,n,s]),(0,ka.useEffect)((()=>()=>{s(nr({formId:t}))}),[t,n,s]);const y=(0,ka.useCallback)(((e,n)=>{s(ir({formId:t,name:e,value:n}))}),[t,s]),g=(0,ka.useCallback)(((e,n)=>{s(or({formId:t,name:e,touched:n}))}),[s,t]),v=(0,ka.useCallback)(((e,t)=>{p((n=>({...n,[e]:t})))}),[p]),b=(0,ka.useCallback)((e=>{e.preventDefault();const t="true"===e.submitter.getAttribute("aria-disabled");u(!t),!t&&f&&(s(Wn(!0)),a(c,{updateControlValue:y,setError:v}))}),[f,s,a,c,y,v]);(0,ka.useEffect)((()=>{r&&r({errors:m,isSubmitted:l,isValid:0===Object.keys(m).length})}),[l,m,r]);const x=(0,ka.useMemo)((()=>({formId:t,values:c,errors:m,isValid:0===Object.keys(m).length,isSubmitted:l,handleSubmit:b,validationSchema:i,updateControlValue:y,updateControlTouched:g})),[t,c,m,l,b,i,y,g]);return t?a?(0,li.jsx)(hs,{...o,value:x,children:e}):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)},Xs=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),Ys=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},Zs=e=>!!e?.length,Qs=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))},ec=e=>!!e,tc=function({className:e,disableValidationClasses:t=!1,...n}){const{handleSubmit:r,isValid:a,isSubmitted:i}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=gs();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),o=["form"];return!t&&i&&(o.push("form--submitted"),a?o.push("form--valid"):o.push("form--invalid")),(0,li.jsx)("form",{onSubmit:r,className:xi([...o,e]),...n})};function nc({id:e,error:t}){const[n,r]=(0,ka.useState)(!1);return(0,ka.useEffect)((()=>{const e=setTimeout((()=>r(!0)),300);return()=>clearTimeout(e)}),[]),(0,li.jsx)("div",{className:xi("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&(0,li.jsxs)("span",{id:e,className:xi("error__message"),children:[(0,li.jsx)(zi,{name:"error",size:"16",alt:""}),t]})})}const rc=({contentHint:e,id:t,labelText:n,labelClass:r,validity:a,errorText:i,children:o})=>(0,li.jsxs)(li.Fragment,{children:[e&&(0,li.jsx)("span",{id:`${t}-content-hint`,className:xi("input__content-hint"),children:e}),(0,li.jsx)(nc,{id:`${t}-error`,error:!a&&i}),(0,li.jsxs)("div",{className:xi("form-control__wrapper"),children:[(0,li.jsx)("label",{htmlFor:t,className:xi(r),children:n}),o]})]}),ac=function({id:e,name:t,type:n,labelText:r,labelClass:a,contentHint:i=null,focus:o,"aria-invalid":s,"aria-describedby":c,...l}){const u=(0,ka.useRef)(null),{isSubmitted:d}=gs(),[p,{error:f}]=vs(t),h=d&&f,m=[];return c&&m.push(c),i&&m.push(`${e}-content-hint`),h&&m.push(`${e}-error`),(0,ka.useLayoutEffect)((()=>{u.current&&o&&u.current.focus()}),[o]),(0,li.jsx)(rc,{id:e,contentHint:i,validity:!h,errorText:f,labelText:r,labelClass:a,children:(0,li.jsx)("input",{...p,...l,ref:u,id:e,type:n,"aria-invalid":s||h?"true":"false","aria-describedby":m.join(" ")||void 0,name:t})})};function ic({controlName:e,describedById:t}){const{t:n}=Wa();return(0,li.jsxs)(tc,{noValidate:"true",className:xi("options__form"),children:[(0,li.jsx)(ac,{id:"email-id",name:e,type:"email",className:xi("transcript__input"),"aria-describedby":t,labelClass:xi("label"),labelText:n("options.sendTranscript.label")}),(0,li.jsx)("div",{className:xi("options__actions"),children:(0,li.jsx)("button",{type:"submit",className:xi("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const oc="email",sc={sendTranscript:()=>{const[e,t]=(0,ka.useState)(void 0),{hideOption:n}=ji(),{focusButton:r}=Ti(),{t:a}=Wa(),i=Mi(),{sendAction:o}=ri(),s=(0,ka.useMemo)((()=>({[oc]:[Xs(ec,a("options.sendTranscript.noEmailText")),Xs(Qs,a("options.sendTranscript.invalidEmailText"))]})),[a]),c=(0,ka.useCallback)((e=>{const t=e[oc].trim();o({type:"send_transcript",body:{emailAddress:t}}),n(),r()}),[o,n,r]),l=(0,ka.useCallback)((({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)}),[t]);return(0,li.jsx)(Ws,{className:e,headingText:a("options.sendTranscript.title"),cancelButtonText:a("options.cancelButtonText"),description:a("options.sendTranscript.description"),descriptionId:i,position:{vertical:"top",horizontal:"right"},children:(0,li.jsx)(Js,{formId:"sendTranscript",onSubmit:c,validationSchema:s,onError:l,children:(0,li.jsx)(ic,{controlName:oc,describedById:i})})})}},cc=()=>{const{optionActive:e}=ji(),t=(0,ka.useRef)(),n=sc[t.current??e];return e&&(t.current=e),n?(0,li.jsx)(n,{}):null},lc=()=>{const{t:e}=Wa(),{menuOptions:t,showOption:n,panelActive:r,hideOption:a}=ji(),{id:i}=Ti(),o=(0,ka.useRef)(null),[s,c]=(0,ka.useState)(!1),l=(0,ka.useRef)(null),u=t.length,d=(0,ka.useRef)([]),p=(0,ka.useRef)(!1),f=u>1,h=t[0],m=(0,ka.useMemo)((()=>h?.name?.trim().replace(/\s+/g,"")),[h]);return(0,ka.useEffect)((()=>()=>{o.current&&clearTimeout(o.current)}),[]),(0,ka.useEffect)((()=>{s&&!p.current&&requestAnimationFrame((async()=>{await pi(60);const e=t.findIndex((e=>e.available)),n=-1===e?0:e;d.current&&fn(d.current[n])})),p.current=s}),[s,t]),u?(0,li.jsxs)("div",{className:xi("options__container"),onKeyDown:e=>{s&&(pn(e)===dn.Escape&&(c(!1),fn(l.current)),pn(e)===dn.Home&&(d.current&&fn(d.current[0]),e.preventDefault()),pn(e)===dn.End&&(d.current&&fn(d.current[u-1]),e.preventDefault()))},onFocusOut:()=>{f&&(o.current=setTimeout((()=>{c(!1)}),200))},onFocusIn:()=>{o.current&&clearTimeout(o.current)},children:[(0,li.jsx)(Rs,{transitionStartState:As,isActive:r,children:(0,li.jsx)("div",{className:xi("options__dialog"),children:(0,li.jsx)(cc,{})})}),f&&(0,li.jsx)(Rs,{isActive:s,transitionStartState:As,children:(0,li.jsx)("ul",{className:xi(["options__menu"]),role:"menu",tabIndex:-1,"aria-labelledby":i,children:t.map((({name:r,title:a,available:i},o)=>(0,li.jsx)("li",{className:xi("options__menu__item"),role:"menuitem","data-testid":r,children:(0,li.jsxs)("button",{type:"button",ref:e=>{e&&(d.current[o]=e)},className:xi(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(pn(e)===dn.ArrowDown){const n=Math.min(u-1,t+1);d.current&&fn(d.current[t===n?0:n]),e.preventDefault()}if(pn(e)===dn.ArrowUp){const n=Math.max(0,t-1);d.current&&fn(d.current[t===n?u-1:n]),e.preventDefault()}})(e,o),onKeyPress:e=>((e,n)=>{const r=String.fromCharCode(e.charCode);if(1!==r.length||!r.match(/\S/))return;let a=-1;t.forEach(((e,t)=>{t>n&&e.title.charAt(0).toLowerCase()===r.toLowerCase()&&-1===a&&(a=t)})),-1!==a&&d.current&&fn(d.current[a])})(e,o),onClick:()=>((e,t)=>{t&&(c(!1),n(e))})(r,i),"aria-disabled":!i,children:[(0,li.jsxs)("span",{className:xi("button__text"),children:[a,!i&&" "]}),i?null:(0,li.jsx)("span",{className:xi("button__state"),children:e("options.unavailableText")})]})},r)))})}),(0,li.jsxs)("button",{type:"button",className:xi(["button","button--secondary","chat__options__button",...!f&&m?[`chat__options__button--${m}`]:[]]),id:i,onClick:()=>{r&&a(),f?c((e=>!e)):h.available&&!r&&n(h.name)},onKeyDown:f?e=>{pn(e)===dn.ArrowDown&&(c(!0),e.preventDefault())}:void 0,ref:l,"aria-haspopup":!!f&&"menu","aria-expanded":!!f&&s,"aria-disabled":!f&&!h.available,children:[f?(0,li.jsx)(zi,{name:"options",size:"32",alt:""}):null,(0,li.jsx)("span",{className:xi("button__text"),children:f?e("options.openButtonText"):`${h.title}${h.available?"":" "}`}),f||h.available?null:(0,li.jsx)("span",{className:xi("button__state"),children:e("options.unavailableText")})]})]}):null};function uc(){const{menuOptions:e,allowOptionSelection:t}=ji(),{isAvailable:n}=gi(),r=qt(oi),{t:a,userLocale:i}=Wa(),o=bi(i);if(!n&&(!t||!e.length)||r)return null;const s=a("translations.settings.openButtonText",{hasLanguage:!!o,language:o});return(0,li.jsxs)("div",{className:xi("chat__options"),children:[n&&(0,li.jsx)("div",{className:xi("chat__options-item","chat__options-item--left"),children:(0,li.jsxs)(Ks,{classNames:["button--secondary"],children:[(0,li.jsx)(zi,{alt:s,name:"newTranslation",size:"16"}),(0,li.jsx)("span",{className:xi("button__text"),children:s})]})}),t&&(0,li.jsx)("div",{className:xi("chat__options-item","chat__options-item--right"),children:(0,li.jsx)(lc,{})})]})}const dc=()=>{const{scrollToRef:e,unreadIds:t}=_s(),{isMinimized:n}=qa(),{t:r}=Wa();return(0,li.jsx)(Rs,{isActive:!!t.length&&!n,children:(0,li.jsx)("div",{className:xi("unread-messages"),children:(0,li.jsxs)("button",{type:"button",className:xi("button","button--primary"),onClick:e,children:[r("message.unreadMessagesCount",{unreadCount:t.length}),(0,li.jsx)(zi,{name:"chevronDown",size:"32",alt:""})]})})})},pc=({children:e})=>{const t=xn(),n=(0,ka.useMemo)((()=>t.reduce(((e,t)=>t.payload.id?(e[t.payload.id]=(0,a.createRef)(),e):e),{})),[t]),{scrollToRef:r,scrollToBottom:i,containerRef:o,unreadIds:s}=(e=>{const t=(0,ka.useRef)(null),[n,r]=(0,ka.useState)(!0),a=qt(is),i=xn(),o=wn(),{isOpen:s}=qa(),c=gn().loadedImageEventIds,{processingFileUploads:l,isLastEventFromClient:u}=qt((({state:e})=>e));(0,ka.useEffect)((()=>{const e=t.current;if(!e)return()=>{};const n=()=>{const{scrollHeight:t,scrollTop:n,clientHeight:a}=e,i=Math.abs(t-n-a)>10;r(!i)};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}),[]);const d=(0,ka.useCallback)((()=>{requestAnimationFrame((async()=>{await pi(30),t.current?.scrollTo({top:t.current?.scrollHeight,left:0,behavior:"auto"})}))}),[]);return(0,ka.useEffect)((()=>{u&&d()}),[u,d]),(0,ka.useEffect)((()=>{n&&d()}),[n,a,i,o,s,c,l,d]),{containerRef:t,unreadIds:a,scrollToRef:()=>{const n=a.at(0);if(void 0!==n){const r=e[n]?.current;t.current?.scrollTo({top:r?.offsetTop,behavior:"auto",left:0})}},scrollToBottom:d}})(n);return(0,li.jsx)(Cs.Provider,{value:{eventRefs:n,unreadIds:s,scrollToRef:r,scrollToBottom:i,containerRef:o},children:(0,li.jsxs)("div",{className:xi("chat__container"),children:[(0,li.jsx)("div",{className:xi("chat__container__scroll-area"),ref:o,children:e}),(0,li.jsx)(dc,{})]})})},fc=({baseClassName:e,children:t,title:n})=>{const r=Cn(),a=Mi();return(0,li.jsxs)("section",{id:r,className:xi(e),"aria-describedby":a,tabIndex:-1,children:[(0,li.jsx)("h2",{className:xi(`${e}__title`),id:a,children:n}),t]})},hc=()=>{const{t:e}=Wa(),t=mi(),n=Ni(),{emitEvent:r}=ri(),{isActive:a,remaining:i,timer:o,endCountdown:s}=Li(),c=!!i&&i>0,l=e(c?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,li.jsx)(fc,{baseClassName:"idle",title:l,children:c&&(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)("div",{className:xi("idle__count-container"),children:a&&(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)("span",{className:xi("idle__count-text"),children:e("idleDetachWarning.countdownText")}),(0,li.jsx)("span",{className:xi("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",o)})]})}),(0,li.jsxs)("div",{className:xi("idle__options"),children:[(0,li.jsx)("button",{type:"button",className:xi("button","button--primary"),onClick:()=>{n(),s(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),(0,li.jsx)("button",{type:"button",className:xi("button","button--primary"),onClick:()=>{s(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},mc=()=>{const{t:e}=Wa(),t=Ni(),{name:n}=jn()||{},{continueChat:r,restartChat:a}=ki();return(0,li.jsx)(fc,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:(0,li.jsxs)("div",{className:xi("prompt__options"),children:[(0,li.jsx)("button",{type:"button",className:xi("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),(0,li.jsx)("button",{type:"button",className:xi("button","button--primary"),onClick:a,children:e("resumeConversationPrompt.detachButton")})]})})},yc=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:a}=gn().entryMeta,i=La(),o=n||t||e,s=a&&a[o]||r&&r[o]||{},c=(0,ka.useCallback)((e=>{i(Br(e))}),[i]),l=(0,ka.useCallback)((e=>{i(Fr(e))}),[i]),u=(0,ka.useCallback)((e=>{i(ca(e))}),[i]),d=(0,ka.useCallback)((()=>{n?u(null):l(e)}),[l,u,e,n]);return{activeEntry:o,activeEntryOptions:s,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:d,setBlockAutoEntrySwitch:c}};function gc({controlName:e,skipLinkId:t}){const{t:n}=Wa(),{setInputFocus:r}=qa(),{sendAssertive:a}=ai(),{emitEvent:i}=ri(),o=(()=>{const{sendAction:e}=ri(),{features:t}=ji(),{typingPeekahead:n}=t||{},r=(0,ka.useRef)(null),a=(0,ka.useRef)(null),i=(0,ka.useRef)(!1),o=(0,ka.useRef)(null);(0,ka.useEffect)((()=>()=>{o.current&&clearInterval(o.current),r.current&&clearTimeout(r.current),a.current&&clearTimeout(a.current)}),[]);const s=(t,r)=>{e({type:k,state:t,...n&&n.enabled?{body:{currentMessage:r}}:{}})};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(i.current=!0,o.current||(s(!0,e.target.value),o.current=setInterval((()=>{!i.current&&o.current?(clearInterval(o.current),o.current=null):n&&n.enabled&&s(!0,e.target.value)}),2e3)),r.current&&clearTimeout(r.current),a.current&&clearTimeout(a.current),r.current=setTimeout((()=>{i.current=!1}),300),a.current=setTimeout((()=>{s(!1,e.target.value)}),2e3))}})(),{setBlockAutoEntrySwitch:s}=yc(),{placeholder:c,label:l,labelClass:u}=(e=>{const{hasCharacterLimit:t,characterLimit:n}=bs(e),{entryMeta:{optionsOverride:r}}=gn(),{t:a}=Wa();return{placeholder:(0,ka.useMemo)((()=>a("input.inputPlaceholder",{hasLimit:t,text:r?.text?.placeholder||a("input.inputPlaceholderText"),limit:t?n:null})),[a,t,n,r?.text?.placeholder]),label:(0,ka.useMemo)((()=>a("input.inputLabel",{hasLimit:!r?.text?.label&&t,text:r?.text?.label||a("input.inputLabelText"),limit:!r?.text?.label&&t?n:null})),[a,t,n,r?.text?.label]),labelClass:(0,ka.useMemo)((()=>r?.text?.label?"label":"visually-hidden"),[r?.text?.label])}})(e),{hasCharacterLimit:d,reachedCharacterWarning:p,reachedCharacterLimit:f,remainingChars:h}=bs(e),[{value:m}]=vs(e),y=!!m,g=(0,ka.useCallback)((()=>{p&&a(n("input.srCharacterLimitText",{limit:h})),i("ui.inputFocus")}),[n,a,p,h,i]);return(0,ka.useLayoutEffect)((()=>(s(y),()=>{s(!1)})),[s,y]),(0,li.jsxs)(tc,{className:xi("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,li.jsxs)("div",{className:xi(["input--text__container",...p&&!f?["character-warning"]:[],...f?["character-exceeded"]:[]]),children:[(0,li.jsx)(ac,{id:t,type:"text",name:e,className:xi("input__text"),autocomplete:"off",placeholder:c,labelText:l,labelClass:xi(u),"aria-invalid":!!d&&f,onKeyUp:o,onFocus:g,focus:r}),(0,li.jsx)("div",{className:xi("character-count"),children:p&&(0,li.jsx)("span",{children:h})})]}),(0,li.jsx)("button",{className:xi("button","input__submit"),onPointerDown:e=>{e.preventDefault()},"aria-disabled":!y||f,children:(0,li.jsx)(zi,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}const vc="textMessageEntry";function bc({...e}){const{isOpen:t,setVisibility:n}=qa(),r=Cn(),a=mi(),{sendMessage:i}=ri(),o=(0,ka.useCallback)(((e,{updateControlValue:r})=>{i({body:e[vc]}),r(vc,""),a(),t||n({visibility:Mt.open})}),[i,a,t,n]);return(0,li.jsx)(Js,{...e,formId:"textEntry",persistData:!0,onSubmit:o,children:(0,li.jsx)(gc,{controlName:vc,skipLinkId:r})})}const xc=()=>{const{t:e}=Wa(),{currentUploads:t}=Ei();return(0,li.jsx)("div",{className:xi("progress"),children:t.map((({id:t,name:n,progress:r,uploading:a,error:i})=>(0,li.jsxs)("div",{className:xi("progress_container"),children:[(0,li.jsxs)("div",{className:xi("progress__text"),children:[(0,li.jsx)("span",{className:xi("progress__text--file-name"),children:n}),(0,li.jsx)("span",{className:xi("progress__text--percentage"),children:`${r}%`})]}),(0,li.jsx)(nc,{error:i,id:"progress-error"}),(0,li.jsx)("progress",{className:xi("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":a,children:`${r}%`})]},t)))})};function wc({id:e,name:t,labelText:n,contentHint:r,outputText:a,accept:i}){const{isSubmitted:o}=gs(),[s,c]=(0,ka.useState)(!1),[{onInput:l,onBlur:u},{error:d}]=vs(t),p=Mi(),f=Mi(),h=Mi(),m=o&&d,y=[h];r&&y.push(f),m&&y.push(p);const g=(0,ka.useCallback)((()=>{c(!0)}),[c]),v=(0,ka.useCallback)((()=>{c(!1),u()}),[c,u]),b=(0,ka.useCallback)((e=>{const t={target:{value:e.target.files}};l(t)}),[l]);return(0,li.jsxs)("div",{className:xi("upload__container"),children:[r&&(0,li.jsx)("span",{className:xi("upload__content-hint"),id:f,children:r}),(0,li.jsx)(nc,{id:p,error:m&&d}),(0,li.jsx)("div",{className:xi(["file-upload",...s?["focus-within"]:[]]),children:(0,li.jsxs)("label",{htmlFor:e,className:xi("upload__label"),children:[(0,li.jsx)(zi,{name:"upload",size:"32",alt:""}),(0,li.jsxs)("div",{children:[(0,li.jsx)("span",{className:xi(["upload__label--text"]),children:n}),(0,li.jsx)("input",{id:e,className:xi("upload__input"),type:"file",name:t,onChange:b,"aria-invalid":m?"true":"false","aria-describedby":y.join(" "),accept:i||null,onFocus:g,onBlur:v}),(0,li.jsx)("span",{className:xi("upload__output"),"aria-hidden":"true",id:h,children:a})]})]})})]})}const _c=({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:a,isComplete:i,onClickCancel:o})=>{const{t:s}=Wa(),[{value:c}]=vs(t),l=c&&c.length>0,u=l&&"string"!=typeof c?c[0].name:"";return(0,li.jsxs)(tc,{className:xi("upload-form"),children:[(0,li.jsx)(wc,{name:t,id:e,accept:n,labelText:s("fileUpload.labelText"),outputText:s("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),(0,li.jsxs)("div",{className:xi("upload__button-container"),children:[(0,li.jsx)("button",{id:a||!i?e:void 0,type:"button",onClick:o,className:xi("button","button--secondary","upload__cancel"),children:s("fileUpload.cancelButtonText")}),(0,li.jsx)("button",{className:xi("button","button--primary"),type:"submit",children:s("fileUpload.uploadButtonText")})]})]})},Cc="fileListForm",Sc="fileList",Ec=()=>{const{t:e}=Wa(),{sendPolite:t,sendAssertive:n}=ai(),r=Cn(),a=mi(),{serviceAllowsUploads:i,allowedMimeTypes:o,maxSize:s}=Si(),c=(0,ka.useRef)(null),l=(0,ka.useRef)(i),{cancelEntrySelection:u}=yc(),{uploadFile:d,clearUploads:p,isUploading:f,isComplete:h}=Ei(),{uploadHandle:m,hasServerError:y,progress:g}=((e,t)=>{const n=qt((n=>ds(n,{formId:e,name:t}))),{currentUploads:r}=Ei(),a=n&&n.length>0;let i=null,o=!1,s=0;if(r&&r.length>0){const e=r[0];i=e.uploadHandle,o=!!e.error,s=e.progress}return{hasFile:a,selectedFileName:a?n[0].name:"",uploadHandle:i,hasServerError:o,progress:s}})(Cc,Sc),v=Mi(),b=(0,ka.useRef)(!0),x=e("fileUpload.contentHint",{size:ln(s)}),w=(0,ka.useRef)(""),_=(0,ka.useRef)(null);(0,ka.useEffect)((()=>{w.current&&_.current?.contains(document.activeElement)&&"INPUT"===document.activeElement?.tagName&&n(x),w.current=x}),[x,n]),(0,ka.useEffect)((()=>{g>0&&t(1===g?e("fileUpload.srStartedText"):`${g}%`)}),[g,t,e]),(0,ka.useEffect)((()=>{b.current||f||!h||(p(),u(),a(),setTimeout((()=>{t(e("fileUpload.srCompleteText"))}),300)),b.current=h}),[f,h,p,u,a,t,e]);const C=(0,ka.useCallback)((({fileList:e})=>{d(e[0]),a()}),[d,!1,a]),S=(0,ka.useCallback)((()=>{m&&m.abort(),p(),u(),a()}),[m,p,u,a]),E=(0,ka.useMemo)((()=>({[Sc]:[Xs((()=>i),e("fileUpload.errors.unavailable")),Xs(Zs,e("fileUpload.errors.noFile")),Xs(Ys,e("fileUpload.errors.tooLarge"),s)]})),[s,i,e]);return(0,li.jsx)("div",{className:xi(["upload",...y?["upload--error"]:[]]),ref:_,children:(0,li.jsxs)(Js,{formId:Cc,persistData:!0,onSubmit:C,validationSchema:E,children:[(f||!h)&&(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)(xc,{}),(0,li.jsx)("div",{className:xi("upload__button-container"),children:(0,li.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:S,ref:c,className:xi("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!f&&h&&(0,li.jsx)(_c,{controlName:Sc,skiplinkId:r,accept:o?.join(", ")||"",contentHint:x,isComplete:h,isUploading:f,onClickCancel:S}),!l.current&&(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)("span",{className:xi("notification"),id:v,children:e("fileUpload.unavailableText")}),(0,li.jsx)("div",{className:xi("upload__button-container"),children:(0,li.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:S,className:xi("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},jc=()=>{const{t:e}=Wa(),{showFileUpload:t,serviceAllowsUploads:n}=Si(),[r,a]=(0,ka.useState)(n||!1),i=mi(),o=(0,ka.useRef)(null),{setUserEntryType:s,activeEntry:c}=yc(),l=(0,ka.useRef)(null),{sendPolite:u}=ai(),d=!!jn();return(0,ka.useEffect)((()=>{hn(l.current,(()=>{n||i()})),a(n||!1)}),[n,i]),(0,ka.useEffect)((()=>{o.current&&!n&&u(e("fileUpload.srUnavailableText")),!1===o.current&&n&&u(e("fileUpload.srAvailableText")),d&&(o.current=n)}),[n,d,u,e]),t||c===T?null:(0,li.jsx)(Rs,{isActive:r,transitionStartState:Os,children:(0,li.jsx)("div",{className:xi("upload-toggle-wrapper"),children:(0,li.jsx)(Rs,{isActive:r,transitionStartState:Ps,children:(0,li.jsx)("button",{className:xi(["button","button--secondary","upload-toggle"]),ref:l,"aria-disabled":!r,type:"button",onClick:r?()=>{s(T),i()}:void 0,children:(0,li.jsx)(zi,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})},Tc=()=>{const{isOpen:e}=qa(),t=(0,ka.useRef)(null),{hasCountdown:n}=Li(),[r,a]=(0,ka.useState)(n),{hasPrompt:i}=ki(),[o,s]=(0,ka.useState)(i),c=mi(),l=(0,ka.useRef)(!1),{activeEntry:u,activeEntryOptions:d}=yc(),[p,f]=(0,ka.useState)({text:bc,upload:Ec}),[h,m]=(0,ka.useState)((()=>u)),[y,g]=(0,ka.useState)((()=>d)),v=an(),{accountAllowsUploads:b}=Si(),x=(0,ka.useCallback)((()=>{hn(t.current,c)}),[c]);(0,ka.useEffect)((()=>{const{customComponents:e}=v,{entry:t}=e||{};t&&f((e=>({...e,...t})))}),[v]),(0,ka.useEffect)((()=>{x(),a(n),s(i)}),[n,i,x]),(0,ka.useEffect)((()=>{m(u),g(d),x()}),[u,d,x,t]),l.current=!(!t.current||!t.current.contains(document.activeElement));const w=p[h],{allowManualInput:_=!0}=y;return(0,li.jsxs)("div",{className:xi("chat__entry"),ref:t,children:[r&&(0,li.jsx)(hc,{}),o&&(0,li.jsx)(mc,{}),(0,li.jsxs)("div",{className:xi(["entry__body",...n||i||!1===_?["entry__body--hidden"]:[]]),children:[h!==T&&b&&e?(0,li.jsx)(jc,{}):null,(0,li.jsx)(w,{})]})]})},Ic=()=>{const{t:e}=Wa(),{isOpen:t,closeChat:n}=qa(),{isWindow:r}=Tn();return t&&r?(0,li.jsx)("button",{type:"button",className:xi("button","collapse-button"),onClick:n,children:(0,li.jsx)(zi,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null},Nc=()=>{const{meta:{originalError:e,title:t,message:n,buttonText:r,action:a,srText:i}}=si(),o=ri(),s=Mi(),{sendPolite:c}=ai(),l=mi(),u="SeamlySessionExpiredError"===e?.name;return(0,ka.useEffect)((()=>{!u&&i&&setTimeout((()=>{c(i)}),200)}),[c,i,u]),u?(0,li.jsx)(li.Fragment,{}):(0,li.jsxs)("section",{className:xi("interrupt"),"aria-labelledby":s,children:[(0,li.jsx)(Ic,{}),(0,li.jsxs)("div",{className:xi("interrupt__body"),children:[(0,li.jsx)("h2",{id:s,className:xi("interrupt__title"),children:t}),(0,li.jsx)("p",{className:xi("interrupt__message"),children:n}),r&&a&&(0,li.jsx)("div",{className:xi("interrupt__actions"),children:(0,li.jsx)("button",{type:"button",className:xi("button","button--primary"),onClick:()=>{a&&o[a]&&o[a](),l()},children:r})})]})]})},Lc=function({children:e}){const t=qt(oi),{isOpen:n}=qa();return t?(0,li.jsx)(Nc,{}):(0,li.jsxs)(li.Fragment,{children:[(0,li.jsxs)(pc,{children:[(0,li.jsxs)("div",{className:xi("chat__container__header"),children:[(0,li.jsx)($s,{}),(0,li.jsx)(Ic,{})]}),e]}),(0,li.jsx)(Tc,{}),n&&(0,li.jsx)(uc,{})]})};function kc({event:e}){const[t]=Ss(e);return(0,li.jsx)("li",{children:(0,li.jsx)(t,{event:e})})}function Mc({events:e}){return(0,li.jsx)("ul",{className:xi("collapsed-chat-messages"),children:e.map((e=>(0,li.jsx)(kc,{event:e},e.payload.id)))})}function Ac(){const{preChatEvents:e}=an(),t=qt(oi),{isOpen:n}=qa();return t||!e?.length||n?null:(0,li.jsx)(Mc,{events:e})}function Oc(){const{t:e}=Wa(),t=e("window.chat.continue"),n=(0,ka.useMemo)((()=>({type:"message",payload:{type:"custom",body:{text:t,type:"",data:{}},participant:"seamly-client-participant"}})),[t]);return(0,li.jsx)(Mc,{events:[n]})}const Pc=()=>{const e=function(){const{startChatIcon:e}=an();return e}(),t=jn(),n=qt(oi),r=t&&!n,a=r?t.avatar:e;return a?(0,li.jsx)("img",{className:xi(r?"avatar":"icon"),src:a,alt:""}):(0,li.jsx)(zi,{name:"avatar",size:"32",alt:""})},Rc=({onClick:e})=>{const t=ni(),{t:n}=Wa(),r=t()?n("window.openButton.srContinue"):n("window.openButton.srStart"),a=mi(),{isOpen:i}=qa(),o=_n(),s=(0,ka.useCallback)((()=>{e(),a()}),[a,e]);return(0,li.jsx)(Rs,{isActive:!i,transitionStartState:Os,children:(0,li.jsxs)("button",{className:xi("window-open-button"),"aria-label":r,"aria-hidden":i,onClick:s,children:[(0,li.jsx)(Rs,{isActive:!!o,transitionStartState:As,children:(0,li.jsx)("span",{className:xi("message-count"),"aria-hidden":"true",children:o})}),(0,li.jsx)(Pc,{})]})})},Dc=(e,t,n)=>"object"==typeof e?e[t]:n,zc=n.p+"sounds/beep.mp3",Fc=!!window.Notification,Uc={app:()=>(0,li.jsx)(Fs,{children:(0,li.jsx)(Lc,{children:(0,li.jsx)(Is,{})})}),inline:()=>{const{showInlineView:e,containerRef:t}=(()=>{const e=La(),{connectWhenInView:t}=an(),n=qt(Nn),{containerRef:r,isVisible:a}=Ka({enabled:t,freezeOnceVisible:!0});return(0,ka.useEffect)((()=>{a&&e(Ta())}),[e,a]),{containerRef:r,showInlineView:n}})(),{isOpen:n}=qa();return(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)(Rs,{isActive:!n,transitionStartState:Os,children:(0,li.jsxs)("div",{ref:t,className:xi("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,li.jsx)(Ac,{}),(0,li.jsx)(Ds,{})]})}),(0,li.jsx)(Rs,{isActive:n,transitionStartState:Os,children:(0,li.jsx)(Fs,{ref:t,children:e&&(0,li.jsx)(Lc,{children:n&&(0,li.jsx)(Is,{})})})})]})},window:()=>{const{isOpen:e,openChat:t}=qa(),n=Ja(),{continueChat:r,preChat:a}=an();return(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)(Rc,{onClick:t}),(0,li.jsx)(Rs,{isActive:!!a&&!e&&!n,exitAfter:Dc(a,"exitAfter"),enterDelay:Dc(a,"enterDelay"),transitionStartState:As,children:(0,li.jsx)("div",{className:xi("unstarted-wrapper","unstarted-wrapper--window"),children:(0,li.jsx)(Ac,{})})}),(0,li.jsx)(Rs,{isActive:r&&!e&&n,exitAfter:Dc(r,"exitAfter"),enterDelay:Dc(r,"enterDelay"),transitionStartState:As,children:(0,li.jsx)("div",{className:xi("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,li.jsx)(Oc,{})})}),(0,li.jsx)(Rs,{isActive:e,transitionStartState:As,children:(0,li.jsx)(Fs,{children:(0,li.jsx)(Lc,{children:(0,li.jsx)(Is,{})})})})]})}};function Bc(e){const t=document.createElement("div");return t.innerHTML=e||"",t.textContent||t.innerText||""}const Hc=({children:e})=>{const{sendNotification:t}=(()=>{const{proactiveMessages:e}=Sn(),{notificationAudioURL:t}=an(),[n,r]=(0,ka.useState)(Fc?Notification.permission:"default"),[a,i]=(0,ka.useState)(document.visibilityState),o=qt(os),s=(0,ka.useCallback)((async()=>{if(Fc&&"granted"!==n){const e=await Notification.requestPermission();r(e)}}),[n]),c=(0,ka.useMemo)((()=>"granted"===n),[n]),l=(0,ka.useMemo)((()=>"hidden"===a),[a]);(0,ka.useEffect)((()=>{"default"===n&&e&&s()}),[n,e,s]);const u=(0,ka.useCallback)((async(e,r)=>{if(o&&Fc){if("default"===n&&s(),!1!==t&&!c&&(l||!document.hasFocus()))try{const e=new Audio(t||zc);await e.play()}catch(e){console.warn(e)}if(c&&(l||!document.hasFocus())){const t=new Notification(e,r);t.onclick=function(){window.parent.focus(),window.focus(),t.close();const e=document.querySelector(`input[name=${vc}]`);e&&e.focus()}}}}),[t,n,c,s,o,l]);return(0,ka.useEffect)((()=>{if(!o)return()=>{};function e(){i(document.visibilityState)}return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e)}}),[o]),{permission:n,requestPermission:s,sendNotification:u}})(),[,n]=fi(),r=an(),a=jn(),{proactiveMessages:i}=Sn(),{isOpen:o,isVisible:s}=qa(),c=wi(),l=Ja(),u=qt(as),{body:d}=vi(u),{userLocale:p}=Wa(),f=(0,ka.useRef)(void 0),h=(0,ka.useMemo)((()=>d?"string"==typeof d?Bc(d):"text"in d?Bc(d.text):"prompt"in d&&d.prompt&&"text"in d.prompt?Bc(d.prompt?.text):"":""),[d]);(0,ka.useEffect)((()=>{a?.name&&h&&i&&u&&f.current!==u.payload?.id&&(t(a.name,{body:h,icon:a?.avatar||void 0}),f.current=u.payload.id)}),[a?.avatar,a?.name,u,h,i,t]);const m=Uc[r.layoutMode],y=(0,ka.useCallback)((e=>{"function"==typeof n&&n(e)}),[n]),g=(0,ka.useMemo)((()=>{if(p){const e=document.querySelector("html")?.getAttribute("lang");if(e!==p)return p}}),[p]);if(!m)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const v=["app",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];return"function"!=typeof c?v.push(...c):v.push(...c(r)),o||"app"===r.layoutMode||v.push("app--collapsed"),l&&v.push("app--user-responded"),s?(0,li.jsx)("div",{className:xi(v),lang:g,tabIndex:-1,"data-nosnippet":!0,style:{zIndex:r?.zIndex},ref:y,children:e||(0,li.jsx)(m,{})}):null},$c=e=>(0,li.jsx)(ns,{...e,children:(0,li.jsx)(Hc,{})});class Vc{constructor(e,n){const{namespace:r="",parentElement:a,...i}=e;this.config={...i,namespace:r},this.namespace=r,this.parentElement=a,this.externalApi=n,this.api=new J({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(t()),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{view:e,...t}=this.config.customComponents||{},n={...this.config,parentElement:this.parentElement,customComponents:Object.keys(t).length?t:void 0},r=function({initialState:e,api:t,eventBus:n,config:r}){const a=rt({reducer:Na,preloadedState:e,middleware:e=>e({thunk:{extraArgument:{api:t,eventBus:n,config:r}},serializableCheck:!1}).concat(function({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:a,api:i,layoutMode:o}=At(t()),{error:s,type:c}=n,l=Jn[s?.name]?new Jn[s.name](s):new v(s);r?.(l,{namespace:a,api:i,layoutMode:o,conversationUrl:e.getConversationUrl(),action:c?n:void 0})};return e=>t=>{try{return t.payload?.originalEvent?.payload?n({error:t.payload,type:t.payload?.originalEvent?.payload?.type}):t.payload?.originalError&&n({error:t.payload,type:void 0}),e(t)}catch(e){throw n({error:e}),e}}}}({api:t}),function({api:e}){return()=>t=>n=>{const{payload:r,type:a}=n;if(a===gr.type){if(!xr.includes(r.name))throw new x(r);"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}({api:t}),function({api:e}){return()=>t=>n=>{const r=t(n);switch(n.type){case ua.toString():e.store.set("options",n.payload);break;case la.toString():e.store.set("options",{...e.store.get("options")||{},[n.payload.option]:n.payload.value})}return r}}({api:t}),ma)});return a}({api:this.api,eventBus:this.eventBus,config:n,initialState:void 0});r.dispatch(Un(n)),await r.dispatch(_t()),await r.dispatch(On()),r.dispatch(An()),e?(0,a.render)((0,li.jsx)(ns,{eventBus:this.eventBus,store:r,api:this.api,children:(0,li.jsx)(e,{})}),this.parentElement):(0,a.render)((0,li.jsx)($c,{config:n,eventBus:this.eventBus,store:r,api:this.api}),this.parentElement)}destroy(){(0,a.render)(null,this.parentElement),this.eventBus.off(),this.api.disconnect(),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))}}const Gc=e=>"object"==typeof e&&"action"in e,Wc=e=>({...e,args:Array.isArray(e.args)?e.args:[e.args]}),qc=class{constructor(e){this._waitingActions=[],this._instances={},this.timeouts={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(Gc).map(Wc)).length&&(this._waitingActions.push(...e),this.handleActions())}handleActions(){const e=this._waitingActions;this._waitingActions=[],e.forEach((e=>{switch(e.action){case"init":this.handleInit(e);break;case"destroy":this.handleDestroy(e);break;default:this.handleAction(e)||this.setContext(e.action,...e.args)||this._waitingActions.push(e)}}))}instanceInitializing(e){const t=Object.keys(this._instances);return!e&&t.length>0||t.includes(e)}setContext(e,t){const{instance:n}=t;if(this.instanceInitializing(n))return!1;switch(e){case"setTopic":const{name:e}=t;return e&&(this.context.topic=e),!0;case"setTranslation":const{enabled:n,locale:r}=t;return n&&r&&(this.context.userLocale=r,this.context.source=F),!0;case"setContext":const{userLocale:a,contentLocale:i}=t;return this.context.userLocale=a,this.context.contentLocale=i,a&&a!=this.appConfig?.userLocale&&(this.context.source=F),!0;case"setVariables":return Object.keys(t).length>0&&(this.context.variables={...t}),!0;default:return!1}}handleInit(e){const t=this.getUserConfig(...e.args),n=this.getCombinedConfig(t),{parentElement:r,namespace:a}=n||t;if(a?Object.values(this._instances).forEach((e=>{e.parentElement!==r&&e.namespace!==a||this.destroy(e)})):this.destroy(),n){const e=this.createInstance(n);this._instances[n.namespace]=e,this.context={},this.debouncedRender(e,n.namespace)}}handleDestroy(e){this.destroy(e.instance)}handleAction(e){const{action:t,instance:n,args:r}=e,a=Object.values(this._instances);return!n&&a.length>1&&console.warn(`Multiple instances detected. Due to potential race conditions, it is recommended to target a specific instance with the action: ${t}`),a.map((e=>(!n||e.namespace===n)&&e.execFunction(t,...r))).some(Boolean)}createInstance(e){return new Vc(e,this)}debouncedRender(e,t){window.clearTimeout(this.timeouts[t]),this.timeouts[t]=window.setTimeout((()=>{e.render()}),100)}destroy(e){e?("string"==typeof e&&(e=this._instances[e]),e&&(e.destroy(),delete this._instances[e.namespace])):Object.entries(this._instances).forEach((([e,t])=>{t.destroy(),delete this._instances[e]}))}getUserConfig(e={}){return e}getCombinedConfig(e){const t={...e.context||this.appConfig.context,...this.context},n=this.getMergedVariables(e);Object.keys(n).length>0&&(t.variables=n);const r={...this.appConfig.defaults,...e.defaults},a={...this.appConfig,...e,api:{...this.appConfig.api,...e.api},context:Object.keys(t).length?t:void 0,defaults:Object.keys(r).length?r:void 0};return"function"==typeof this.appConfig?this.appConfig(a):a}getMergedVariables(e){return{...this.appConfig.context?.variables||{},...e.context?.variables||{},...this.context.variables||{}}}},Kc=()=>{const e=new URLSearchParams(window.location.search);return Array.from(e.entries()).reduce(((e,[t,n])=>({...e,[t]:n})),{})},Jc=e=>new URLSearchParams(e).toString(),Xc={direction:"to_translation_locale",locale:"nl",translatedBy:"deep_l",data:{}};function Yc(e){switch(e.payload.type){case"cta":case"image":case"text":case"choice_prompt":return{...e,payload:{...e.payload,translatedBody:{...Xc,data:{...e.payload.body,text:e.payload.body.text?`NL - ${e.payload.body.text}`:void 0,description:e.payload.body.description?`NL - ${e.payload.body.description}`:void 0,buttonText:e.payload.body.buttonText?`NL - ${e.payload.body.buttonText}`:void 0,choices:e.payload.body.choices?e.payload.body.choices.map((e=>({...e,text:`NL - ${e.text}`}))):void 0,prompt:e.payload.body.prompt?{...e.payload.body.prompt,text:`NL - ${e.payload.body.prompt.text}`}:void 0}}}};default:return e}}const Zc={events:[],config:{layoutMode:"inline",accountConfig:{},hideOnNoUserResponse:!1,showDisclaimer:!1,showSuggestions:!0,preChat:!0},context:{},initialState:{},unreadEvents:0,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1},resumeConversationPrompt:!1,visibility:{visibility:Mt.open},serviceInfo:{activeServiceSessionId:""},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:"Test title",subTitle:"Test subtitle"},interrupt:{error:void 0},historyLoaded:!1,skiplinkTargetId:G(),optionsButtonId:G(),serviceData:{},options:{features:{},panelActive:!1,optionActive:"",userSelectedOptions:{}},entryMeta:{default:"text",active:"text",userSelected:null,options:{},optionsOverride:{}},currentUploads:[],processingFileUploads:[]},Qc={participants:{agent:{id:"agent",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},user:{id:"user",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}}},currentAgent:"agent"},el={type:"info",payload:{body:{subtype:"new_topic",type:"divider"},fromClient:!1,fromHistory:!0,id:G(),transactionId:"_1y9pz5fbyly",type:"divider"}},tl={type:"info",payload:{body:{language:"Nederlands",restartButtonText:null,subtype:"new_translation",text:"[NL] Automatic translation to Dutch started. Please note that automatic translations may contain errors.",title:"[NL] Translating to Dutch",translationEnabled:!0,userLocale:"nl"},fromClient:!1,fromHistory:!0,id:G(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},nl={type:"info",payload:{body:{language:"Nederlands",subtype:"new_translation",text:"[NL] Automatic translation to Dutch started. Please note that automatic translations may contain errors.",translationEnabled:!0,userLocale:"nl"},fromClient:!1,fromHistory:!0,id:G(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},rl={type:"info",payload:{body:{language:"Nederlands",restartButtonText:"[NL] Start again",subtype:"new_translation",text:null,title:"[NL] Automatic translation to Dutch ended",translationEnabled:!1,userLocale:"nl"},fromClient:!1,fromHistory:!0,id:G(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},al={type:"info",payload:{body:{text:"This is a system generated info message",type:"text"},fromClient:!1,id:G(),participant:null,service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:null,type:"text"}},il={type:"info",payload:{body:{key:["info","sendTranscript","accepted"],variables:{emailAddress:"test@test.com"}},fromClient:!1,id:G(),participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,type:"translation"}},ol={title:"You're talking to",subTitle:"Mrs. Bot"},sl={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:G(),messageStatus:"received",participant:{avatar:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjNEE0OEMxIiBkPSJNMTAsMTQuOGMtMS4xLDAtMi0wLjktMi0yczAuOS0yLDItMnMyLDAuOSwyLDJTMTEuMSwxNC44LDEwLDE0Ljh6IE0xNS45LDE0LjhjMS4xLDAsMi0wLjksMi0ycy0wLjktMi0yLTIKCXMtMiwwLjktMiwyUzE0LjgsMTQuOCwxNS45LDE0Ljh6IE0yMS44LDEwLjhjLTEuMSwwLTIsMC45LTIsMnMwLjksMiwyLDJzMi0wLjksMi0yUzIyLjksMTAuOCwyMS44LDEwLjh6IE0yMS4zLDE4LjFIMTAuNwoJQzExLjcsMjMuOSwyMC4yLDIzLjksMjEuMywxOC4xeiIvPgo8L3N2Zz4K",id:"agent",introduction:"You're now talking to Mrs. Bot gimme a minit",name:"Mrs. Bot",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},transactionId:"d63655bf-1d3d-42cf-b14e-4da9e2b6a642",type:"participant"}},cl={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:G(),messageStatus:"received",participant:{introduction:"Welcome, you are now chatting with Mrs. Bot 2, give me a minit to read back the chat history.",id:"agent",avatar:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjNEE0OEMxIiBkPSJNMTAuMSwxNC45Yy0xLjEsMC0yLTAuOS0yLTJzMC45LTIsMi0yczIsMC45LDIsMlMxMS4yLDE0LjksMTAuMSwxNC45eiBNMjEuOSwxMC45Yy0xLjEsMC0yLDAuOS0yLDIKCXMwLjksMiwyLDJzMi0wLjksMi0yUzIzLDEwLjksMjEuOSwxMC45eiBNMjEuNCwxOC4ySDEwLjhDMTEuOCwyNCwyMC4zLDI0LDIxLjQsMTguMnogTTE3LjIsMjUuM2gtMi40Yy0wLjYsMC0xLjIsMC40LTEuNCwxCgljLTUuMS0wLjItOS4yLTQuNC05LjQtOS42YzAuMSwwLDAuMiwwLjEsMC40LDAuMWgwLjFjMC44LDAsMS40LTAuNiwxLjQtMS40di00LjdjMC0wLjgtMC42LTEuNC0xLjQtMS40aDBjLTAuOCwwLTEuNCwwLjYtMS40LDEuNAoJdjIuN3YydjEuMWMwLDUuOSw0LjcsMTAuNiwxMC41LDEwLjhjMC4yLDAuNSwwLjcsMC44LDEuMiwwLjhoMi40YzAuOCwwLDEuNC0wLjYsMS40LTEuNFMxOCwyNS4zLDE3LjIsMjUuM3oiLz4KPC9zdmc+Cg==",name:"Two",service:{expose:{map:{},version:3},meta:{},name:"new service",serviceSessionId:G(),settings:{}}},transactionId:G(),type:"participant"}},ll={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:G(),messageStatus:"received",participant:{id:"user",introduction:"You're now talking to Mrs. Bot gimme a minit",name:"Mrs. Bot",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},transactionId:"d63655bf-1d3d-42cf-b14e-4da9e2b6a642",type:"participant"}},ul=({type:e,data:t,text:n})=>({type:"message",payload:{body:{type:e,text:n,data:t},participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},fromClient:!1,fromHistory:!0,id:"4efacb4d-28a0-454e-8e36-3f17eb598c5d",messageStatus:"read",transactionId:"6f9beee7-ce82-418e-9bec-8001079aa769",transactionLast:!0,type:"custom"}}),dl={type:"message",payload:{body:{text:"What do you want to do?",type:"text",data:void 0},fromClient:!1,fromHistory:!0,id:G(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!1,type:"text"}},pl={type:"message",payload:{type:"splash",id:G(),body:{text:"Example splash message ✨",type:"text",variables:{}}}},fl={type:"message",payload:{body:{description:"Thanks for chatting!\n\nMore info about our <strong>products</strong>?",buttonLink:"https://seamly.ai",buttonText:"View website",buttonNewTab:!0},type:"cta",fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792z",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1}},hl={type:"message",payload:{body:{text:"What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am. What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am. What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am.",type:"text"},fromClient:!1,fromHistory:!0,id:G(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!1,type:"text"}},ml={type:"message",payload:{body:{text:"Bubble with <strong>bold</strong> <em>italic</em> <u>underline</u>",type:"text"},fromClient:!1,fromHistory:!0,id:G(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},yl={type:"message",payload:{body:{text:'<a href="https://google.com" data-link-id="1">Link in same window</a> and <a href="https://google.com" data-link-id="2" target="_blank">link in new window</a> embedded in text',type:"text"},fromClient:!1,fromHistory:!0,id:G(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},gl={type:"message",payload:{body:{text:'Here is a long link <a href="https://google.com" data-link-id="1">click me click me please click me yoohoooo please please click me here I am click me now what are you waiting for click me now now now now now click meeeeeeeeeeeeee</a> embedded in text',type:"text"},fromClient:!1,fromHistory:!0,id:"a964e54e-ea98-46ff-a952-979a47f162c0",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},vl={type:"message",payload:{body:{text:"\n <ul>\n <li>Short list item</li>\n <li>This list item is longer to showcase different type lengths of text in list items and how they reflow in the browser</li>\n <li>\n This list item has a nested list with 3 items in it.\n <ul>\n <li>First item</li>\n <li>second item</li>\n <li>Third item</li>\n </ul>\n </li>\n <li>Another one just to be sure :)</li>\n </ul>\n ",type:"text"},fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792a",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},bl={type:"message",payload:{body:{text:"\n <ol>\n <li>Short list item</li>\n <li>This list item is longer to showcase different type lengths of text in list items and how they reflow in the browser</li>\n <li>\n This list item has a nested list with 3 items in it.\n <ol>\n <li>First item</li>\n <li>second item</li>\n <li>Third item</li>\n </ol>\n </li>\n <li>Another one just to be sure :)</li>\n </ol>\n ",type:"text"},fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792a",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},xl={type:"message",payload:{body:{description:"Plaatje",isZoomable:!1,type:"image",url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-square-small.jpg"},fromClient:!1,fromHistory:!0,id:"b44ef42c-880c-43ff-b067-499e7f2e81f7",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"image"}},wl={type:"message",payload:{body:{description:"Plaatje",isZoomable:!0,type:"image",url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-portrait.jpg"},fromClient:!1,fromHistory:!0,id:"b44ef42c-880c-43ff-b067-499e7f2e81f8",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"image"}},_l={type:"message",payload:{body:{description:"test",source:"youtube",type:"video",url:"https://www.youtube.com/embed/K7Hn1rPQouU"},fromClient:!1,fromHistory:!0,id:G(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"video"}},Cl={type:"message",payload:{body:{choices:[{id:"703db9b3-2157-4d4a-9f9b-c382c6a10531",text:"Dialog (this is intentionally made longer for testing purposes)",type:"choice"},{id:"1eff6098-f14f-4683-a2b8-30d1c573d45e",text:"T-Dialog",type:"choice"},{id:"a8ba3ce8-3324-4e7a-accc-944ff78ac890",text:"Customers",type:"choice"},{id:"c89956ab-cf98-4b7e-9282-7087c988153d",text:"Features",type:"choice"},{id:"9fd9a28f-462d-4f07-9661-606dbe3b9466",category:"secondary",text:"Something else",type:"choice"}],chooseAgain:!0,prompt:{text:"Type "start" at any time to see this menu again",type:"text",variables:{}},type:"choice_prompt"},fromClient:!1,fromHistory:!0,id:G(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!0,type:"choice_prompt"}},Sl={type:"message",payload:{body:{text:"This is what the user typed",type:"text"},fromClient:!0,fromHistory:!0,id:G(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},El={type:"message",payload:{body:{text:"This is what the user typed. And sometimes the user has quite a lot to say and then we get longer lines that need to wrap well and not break the styling so here goes with just such a line right here!!",type:"text"},fromClient:!0,fromHistory:!0,id:G(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},jl={type:"message",payload:{body:{text:'<a href="https://google.com" data-link-id="1">Link in same window</a> and <a href="https://google.com" data-link-id="2" target="_blank">link in new window</a> embedded in text',type:"text"},fromClient:!0,fromHistory:!0,id:G(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},Tl={type:"upload",transactionId:G(),meta:{},body:{contentType:"plain/text",filename:"This-is-an-example.txt",filesize:12,id:G(),isDeleted:!1}},Il={type:"upload",transactionId:G(),meta:{},body:{contentType:"application/pdf",filename:"This-is-a-sample.pdf",filesize:18810,id:"",isDeleted:!1,url:"https://pdfobject.com/pdf/sample.pdf"}},Nl={type:"upload",transactionId:G(),meta:{},body:{contentType:"image/jpeg",filename:"image-square-small.jpg",filesize:12020,id:"",isDeleted:!1,url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-square-small.jpg"}},Ll={type:"message",payload:{...Tl,fromClient:!1,participant:"agent",id:G()}},kl={type:"message",payload:{...Il,fromClient:!1,participant:"agent",id:G()}},Ml={type:"message",payload:{...Nl,fromClient:!1,participant:"agent",id:G()}};sessionStorage.setItem(`image-${Ml.payload.id}`,Ml.payload.body.url);const Al={...Ml,payload:{...Ml.payload,body:{...Ml.payload.body,isDeleted:!0,url:void 0},id:G()}},Ol={type:"message",payload:{...Nl,fromClient:!0,participant:"user",id:G()}};sessionStorage.setItem(`image-${Ol.payload.id}`,Ol.payload.body.url);const Pl={...Ol,payload:{...Ol.payload,id:G(),body:{...Ol.payload.body,url:null}}},Rl={isActive:!1,currentLocale:void 0,isAvailable:!1,showTranslationProposal:!1,languages:[],translatedEventGroups:{},containerId:G()},Dl=[{id:"1",question:"Invoices",categories:["mixed","short"]},{id:"2",question:"Temporary subscription pause",categories:["mixed","medium"]},{id:"3",question:"Cancellation",categories:["mixed","short"]},{id:"4",question:"Apps",categories:["mixed","medium"]},{id:"5",question:"At what date will my subscription end?",categories:["mixed","long"]},{id:"A",question:"Quotes",categories:["short"]},{id:"B",question:"How to get in touch with us",categories:["long"]}],zl="unstarted",Fl="messages",Ul="errors",Bl="uploads",Hl="features",$l="options",Vl="suggestions",Gl="minimizedWindow",Wl="minimizedInline",ql="translations",Kl={[zl]:{heading:"Unstarted UI",description:"Test the loader here"},[Fl]:{heading:"Messages",description:""},[Ul]:{heading:"UI errors",description:""},[Bl]:{heading:"File uploads",description:""},[Hl]:{heading:"Other features",description:""},[$l]:{heading:"Options",description:""},[Vl]:{heading:"Suggestions",description:""},[Gl]:{heading:"Minimized window",desciption:""},[Wl]:{heading:"Minimized Inline",description:""},[ql]:{heading:"Translations",description:""}},Jl={type:"message",payload:{type:"card",id:G(),body:{action:{ask:"",type:"ask"},buttonText:"Ask about pizzas!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.\n\nIt is made with San Marzano tomatoes, mozzarella cheese, fresh basil, salt, and extra-virgin olive oil.",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-square.jpg",title:"Pizza Margherita"}}},Xl={type:"message",payload:{type:"card",id:G(),body:{action:{link:"https://seamly.ai",newTab:!0,type:"navigate"},buttonText:"Order now!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-landscape.jpg",title:"Pizza Margherita"}}},Yl={type:"message",payload:{type:"card",id:G(),body:{action:{topic:"Set topic",type:"topic"},buttonText:"Set topic! (title & description optional)",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-portrait.jpg"}}},Zl={type:"message",payload:{type:"card",id:G(),body:{action:{ask:"",type:"ask"},buttonText:"Ask about pizzas!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.\n\nIt is made with San Marzano tomatoes, mozzarella cheese, fresh basil, salt, and extra-virgin olive oil.",title:"Pizza Margherita"}}},Ql={base:{category:zl,headingText:"Standard with loader",description:"",...Zc,isLoading:!0},fullConversation:{category:Fl,headingText:"Full demo conversation",description:"",...Zc,participantInfo:Qc,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[sl,al,dl,{...Cl,payload:{...Cl.payload,id:`${Cl.payload.id}XXX`}},hl,cl,Sl,ml,jl,el,xl,Ll,kl,Ml,Al,El,_l,yl,gl,wl,Ol,Pl,vl,bl,Cl,fl]},userMessages:{category:Fl,headingText:"User messages",description:"",...Zc,participantInfo:Qc,events:[Sl,El,Ol,Pl,jl]},withParticipants:{category:Fl,headingText:"Messages with participant info",description:"",...Zc,config:{...Zc.config,overrideMessages:{agent:{showAvatar:!0,showName:!0},user:{showName:!0,showAvatar:!0}}},participantInfo:Qc,events:[dl,Sl,hl,El]},textMessages:{category:Fl,headingText:"Text messages",description:"",...Zc,participantInfo:Qc,events:[dl,hl,ml,yl,gl,vl,bl]},ctaMessages:{category:Fl,headingText:"CTA (call to action) messages",description:"",...Zc,participantInfo:Qc,events:[fl]},imageVideoMessages:{category:Fl,headingText:"Download, image and video messages",description:"",...Zc,participantInfo:Qc,events:[xl,_l,wl,Ll,kl,Ml,Al,Ol,Pl]},systemMessages:{category:Fl,headingText:"System messages",description:"",...Zc,config:{overrideMessages:{timeIndicator:{enabled:!0,threshold:36e5}}},participantInfo:Qc,events:[{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()-432e6),id:G(),body:{text:"Long ago when a dialog started",type:"text"}}},sl,ll,cl,el,il,...[tl,rl].map(Yc),al]},choicePromptMessages:{category:Fl,headingText:"Choice prompt messages",description:"",...Zc,participantInfo:Qc,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{...Cl,payload:{...Cl.payload,id:`${Cl.payload.id}XXX`}},dl,Cl]},timeIndicators:{category:Fl,headingText:"Time Indicators",description:"",...Zc,config:{overrideMessages:{timeIndicator:{enabled:!0,threshold:36e5}}},participantInfo:Qc,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()-432e6),id:G(),body:{text:"Long ago when a dialog started",type:"text"}}},{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()-3456e5),id:G(),body:{text:"Above me should be a time indicator showing the full date",type:"text"}}},{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()+1-3456e5),id:G(),body:{text:"Another message",type:"text"}}},{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()+2-3456e5),id:G(),body:{text:"And another message",type:"text"}}},{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()-864e5),id:G(),body:{text:'Above me should be a time indicator showing "yesterday"',type:"text"}}},{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()+1-864e5),id:G(),body:{text:"Another message",type:"text"}}},{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()+2-864e5),id:G(),body:{text:"And another message",type:"text"}}},{type:"message",payload:{...dl.payload,occurredAt:1e3*Date.now(),id:G(),body:{text:"Above me should be a time indicator showing me the dialog continues today",type:"text"}}}]},cards:{category:Fl,headingText:"Cards",description:"",...Zc,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[Jl,Xl,Yl,Zl]},carousel:{category:Fl,headingText:"Carousel",description:"",...Zc,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{type:"message",payload:{type:"carousel",id:G(),body:{cards:[Jl.payload.body,Xl.payload.body,Yl.payload.body,Zl.payload.body]}}}]},errorWithAction:{category:Ul,headingText:"Error with a user action",description:"",...Zc,interrupt:{error:new x(new Error("general error"))}},errorWithoutAction:{category:Ul,headingText:"Error without a user action",description:"",...Zc,interrupt:{error:new Kn(new Error("seamly offline error"))}},privacyDisclaimer:{category:Hl,headingText:"Privacy disclaimer",description:"",...Zc,config:{...Zc.config,showDisclaimer:!0}},characterLimit:{category:Hl,headingText:"Input character limit",description:"",...Zc,entryMeta:{default:"text",active:"text",userSelected:null,options:{text:{limit:120}},optionsOverride:{}}},inputLabel:{category:Hl,headingText:"Input label",...Zc,entryMeta:{default:"text",active:"text",options:{text:{limit:null}},optionsOverride:{text:{label:"What is your name?",limit:null,placeholder:"Please enter your name"}}}},inputLabelWithFileUploadToggle:{category:Hl,headingText:"Input label with file upload toggle button",...Zc,options:{...Zc.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",options:{text:{limit:null}},optionsOverride:{text:{label:"What is the title of the uploaded document?",limit:null,placeholder:"Please enter the title of the document"}}}},abortTransactional:{category:Hl,headingText:"Abort transaction",...Zc,events:[dl,Sl],entryMeta:{default:"text",active:"text",options:{text:{limit:null}},optionsOverride:{},actions:{abortTransaction:{label:"Ask for another question",topicFallbackMessage:"Oops...",topicName:"abort_transaction"}},translatedActions:{}}},fileUploadToggle:{category:Bl,headingText:"File upload toggle button",description:"",...Zc,options:{...Zc.options,features:{uploads:{enabled:!0}}}},fileUploadToggleHidden:{category:Bl,headingText:"File upload toggle button hidden",description:"",...Zc,options:{...Zc.options,features:{uploads:{enabled:!1}}}},fileUploadInput:{category:Bl,headingText:"File upload input",description:"Click on upload button to see an error",styleGuideReset:!0,...Zc,config:{...Zc.config,accountConfig:{features:{uploads:!0}}},options:{...Zc.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}}},fileUploadBusy:{category:Bl,headingText:"File upload in progress",description:"",styleGuideReset:!0,...Zc,config:{...Zc.config,accountConfig:{features:{uploads:!0}}},options:{...Zc.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}},currentUploads:[{id:"_2olggurqhb4",name:"gGeyr3WepujbGn7khx.gif",progress:29,uploading:!0,complete:!1,error:"",uploadHandle:{abort:()=>{}}}]},fileUploadError:{category:Bl,headingText:"File upload errored",description:"",styleGuideReset:!0,...Zc,config:{...Zc.config,accountConfig:{features:{uploads:!0}}},options:{...Zc.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}},currentUploads:[{id:"_2olggurqhb4",name:"gGeyr3WepujbGn7khx.gif",progress:0,uploading:!1,complete:!1,error:"Something went wrong with the upload",uploadHandle:{abort:()=>{}}}]},idleTimerCountdown:{category:Hl,headingText:"Idle timer with countdown",description:"",...Zc,idleDetachCountdown:{hasCountdown:!0,isActive:!0,count:120,remaining:91,timer:{minutes:1,seconds:31}}},idleTimerNoCountdown:{category:Hl,headingText:"Idle timer without countdown",description:"",...Zc,idleDetachCountdown:{hasCountdown:!0,isActive:!1,count:120,remaining:91,timer:{minutes:1,seconds:31}}},resumeConversationPrompt:{category:Hl,headingText:"Resume conversation prompt",description:"",...Zc,participantInfo:Qc,resumeConversationPrompt:!0},optionsSingleTriggerAvailable:{category:$l,headingText:"Single option available",description:"",...Zc,options:{...Zc.options,features:{sendTranscript:{enabled:!0}}}},optionsSingleTriggerUnavailable:{category:$l,headingText:"Single option",description:"Option unavailable",...Zc,options:{...Zc.options,features:{sendTranscript:{enabled:!1}}}},optionsMultiple:{category:$l,headingText:"Multiple options",description:"All options available",...Zc,options:{...Zc.options,features:{extraMenuItem:{enabled:!0},sendTranscript:{enabled:!0}}}},optionsMultipleUnavailable:{category:$l,headingText:"Multiple options",description:"Some unavailable",...Zc,options:{...Zc.options,features:{extraMenuItem:{enabled:!1},sendTranscript:{enabled:!0}}}},optionSendTranscript:{category:$l,headingText:"Send transcript option",description:"Press submit to view error message",...Zc,options:{...Zc.options,optionActive:"sendTranscript",panelActive:!0,features:{sendTranscript:{enabled:!0}}}},translationsAvailable:{category:ql,headingText:"Show translations available",description:"",...Zc,translations:{...Rl,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]}},translationsAvailableWithOptions:{category:ql,headingText:"Show translations available with other options available",description:"",...Zc,options:{...Zc.options,features:{sendTranscript:{enabled:!0}}},config:{...Zc.config,context:{...Zc.context,contentLocale:"nl",userLocale:"en"}},translations:{...Rl,isAvailable:!0,currentLocale:"lv",isActive:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"},{locale:"ar",nativeName:"Arabic"},{locale:"bg",nativeName:"Bulgarian"},{locale:"zh",nativeName:"Chinese"},{locale:"cs",nativeName:"Czech"},{locale:"da",nativeName:"Danish"},{locale:"et",nativeName:"Estonian"},{locale:"fi",nativeName:"Finnish"},{locale:"fr",nativeName:"French"},{locale:"de-informal",nativeName:"German"},{locale:"el",nativeName:"Greek"},{locale:"hu",nativeName:"Hungarian"},{locale:"it",nativeName:"Italian"},{locale:"ja",nativeName:"Japanese"},{locale:"lv",nativeName:"Latvian"},{locale:"pl",nativeName:"Polish"},{locale:"ro",nativeName:"Romanian"},{locale:"ru",nativeName:"Russian"},{locale:"sk",nativeName:"Slovak"},{locale:"sl",nativeName:"Slovenian"},{locale:"es-informal",nativeName:"Spanish"},{locale:"sv",nativeName:"Swedish"},{locale:"ti",nativeName:"Tigrinya"},{locale:"tr",nativeName:"Turkish"},{locale:"uk",nativeName:"Ukrainian"}]}},translationsActive:{category:ql,headingText:"Show translations active",description:"",...Zc,translations:{...Rl,currentLocale:"nl",isActive:!0,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]}},translationsActiveLarge:{category:ql,headingText:"Show translations active (large list)",description:"",...Zc,config:{...Zc.config,context:{...Zc.context,contentLocale:"nl",userLocale:"en"}},translations:{...Rl,currentLocale:"lv",isActive:!0,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"},{locale:"ar",nativeName:"Arabic"},{locale:"bg",nativeName:"Bulgarian"},{locale:"zh",nativeName:"Chinese"},{locale:"cs",nativeName:"Czech"},{locale:"da",nativeName:"Danish"},{locale:"et",nativeName:"Estonian"},{locale:"fi",nativeName:"Finnish"},{locale:"fr",nativeName:"French"},{locale:"de-informal",nativeName:"German"},{locale:"el",nativeName:"Greek"},{locale:"hu",nativeName:"Hungarian"},{locale:"it",nativeName:"Italian"},{locale:"ja",nativeName:"Japanese"},{locale:"lv",nativeName:"Latvian"},{locale:"pl",nativeName:"Polish"},{locale:"ro",nativeName:"Romanian"},{locale:"ru",nativeName:"Russian"},{locale:"sk",nativeName:"Slovak"},{locale:"sl",nativeName:"Slovenian"},{locale:"es-informal",nativeName:"Spanish"},{locale:"sv",nativeName:"Swedish"},{locale:"ti",nativeName:"Tigrinya"},{locale:"tr",nativeName:"Turkish"},{locale:"uk",nativeName:"Ukrainian"}]}},translationsFullConversation:{category:ql,headingText:"Show translated messages",description:"",...Zc,participantInfo:Qc,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[tl,al,dl,{...Cl,payload:{...Cl.payload,id:`${Cl.payload.id}XXX`}},hl,Sl,ml,el,nl,rl,xl,Ll,kl,Ml,Al,El,_l,yl,gl,wl,Ol,Pl,vl,bl,Cl,fl,rl].map(Yc),translations:{...Rl,currentLocale:"nl",isActive:!0,isAvailable:!0,translatedEventGroups:{[tl.payload.id]:[al,dl,{...Cl,payload:{...Cl.payload,id:`${Cl.payload.id}XXX`}},hl,Sl,ml,el].map((e=>e.payload.id)),[nl.payload.id]:[xl,Ll,kl,Ml,Al,El,_l,yl,gl,wl,Ol,Pl,vl,bl,Cl,fl].map((e=>e.payload.id))},languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]}},translationProposal:{category:ql,headingText:"Show translation proposal",description:"",...Zc,events:[dl,Sl,El],config:{...Zc.config,showDisclaimer:!0,context:{contentLocale:"nl-informal",userLocale:"en-GB"}},translations:{...Rl,translationProposal:{buttonLabel:"Activate",proposedLocale:"en-GB",srDismissButtonText:"Dismiss translation proposal",titleLabel:"Do you want to chat in English?"},isAvailable:!0,isActive:!1,languages:[{locale:"nl-informal",nativeName:"Dutch"},{locale:"en-GB",nativeName:"English"}]}},translationProposalWithoutTitle:{category:ql,headingText:"Show translation proposal without title",description:"",...Zc,events:[dl,Sl,El],config:{...Zc.config,showDisclaimer:!0,context:{contentLocale:"nl-informal",userLocale:"en-GB"}},translations:{...Rl,translationProposal:{buttonLabel:"Activate",proposedLocale:"en-GB",srDismissButtonText:"Dismiss translation proposal"},isAvailable:!0,isActive:!1,languages:[{locale:"nl-informal",nativeName:"Dutch"},{locale:"en-GB",nativeName:"English"}]}}},eu={minimizedInline:{category:Wl,headingText:"Inline minimized",description:"",inline:{...Zc,config:{...Zc.config,layoutMode:"inline"},visibility:{...Zc.visibility,visibility:Mt.minimized}}},minimizedInlineCharacterLimit:{category:Wl,headingText:"Inline minimized with limited characters",description:"",inline:{...Zc,config:{...Zc.config,layoutMode:"inline"},visibility:{...Zc.visibility,visibility:Mt.minimized},entryMeta:{...Zc.entryMeta,options:{text:{limit:120}}}}},minimizedInlinePrechat:{category:Wl,headingText:"Inline minimized with pre-chat messages",description:"",inline:{...Zc,config:{...Zc.config,layoutMode:"inline",preChatEvents:[pl]},visibility:{...Zc.visibility,visibility:Mt.minimized}}},minimizedInlinePrechatSuggestions:{category:Wl,headingText:"Inline minimized with pre-chat messages & suggestions",description:"",inline:{...Zc,config:{...Zc.config,layoutMode:"inline",preChatEvents:[pl]},serviceData:{suggestion:{body:Dl}},visibility:{...Zc.visibility,visibility:Mt.minimized}}},inlineWithSuggestions:{category:Vl,headingText:"Suggestions",description:"",inline:{...Zc,config:{...Zc.config,layoutMode:"inline"},visibility:{...Zc.visibility,visibility:Mt.open},serviceData:{suggestion:{body:Dl}}}},minimizedInlineWithError:{category:Wl,headingText:"Inline minimized with error",description:"",inline:{...Zc,config:{...Zc.config,layoutMode:"inline"},visibility:{...Zc.visibility,visibility:Mt.minimized},interrupt:{error:new Kn(new Error("seamly offline error"))}}}},tu={minimizedWindow:{category:Gl,headingText:"Unstarted minimized",description:"",window:{...Zc,config:{...Zc.config,layoutMode:"window"},visibility:{...Zc.visibility,visibility:Mt.minimized}}},minimizedWindowStarted:{category:Gl,headingText:"Started minimized",description:"",window:{...Zc,config:{...Zc.config,layoutMode:"window"},visibility:{...Zc.visibility,visibility:Mt.minimized},participantInfo:Qc,headerTitles:ol}},minimizedWindowStartedUnread:{category:Gl,headingText:"Minimized with unread messages",description:"",window:{...Zc,config:{...Zc.config,layoutMode:"window"},visibility:{...Zc.visibility,visibility:Mt.minimized},participantInfo:Qc,headerTitles:ol,unreadEvents:12}}},nu={suggestionsMessage:{category:Fl,headingText:"Suggestions message",description:"",...Zc,events:[ul(dl.payload.body),{type:"service_data",payload:{type:"suggestion",body:Dl}}]}},ru=(e,t=[])=>{const n={...Ql,fullConversation:{...Ql.fullConversation,events:[pl,...Ql.fullConversation.events]},...nu,...t.reduce(((e,t)=>{const{key:n,headingText:r,description:a,body:i}=t;return{...e,[n]:{category:Fl,headingText:r,description:a,...Zc,participantInfo:Qc,events:[ul(i)]}}}),{})};return Object.keys(n).reduce(((t,r)=>{const{headingText:a,category:i,description:o,...s}=n[r];return{...t,[r]:{headingText:a,description:o,category:i,...e.reduce(((e,t)=>({...e,[t]:{...s,config:{...s.config,layoutMode:t}}})),{})}}}),{})},au=({setSelectedState:e,states:t,headingLevel:n})=>{const r=`h${n.toString()}`,a=`h${(parseInt(n,10)+1).toString()}`,i=Kc();return(0,li.jsx)("nav",{"aria-label":"Style guide navigation",className:"nav--styleguide",children:(0,li.jsx)("ol",{className:"list--styleguidestates",children:Object.keys(Kl).map((n=>{const{heading:o,description:s}=Kl[n],c=Object.keys(t).filter((e=>{const{category:r}=t[e];return r===n}));return c.length>0&&(0,li.jsxs)("li",{children:[(0,li.jsx)(r,{children:o}),(0,li.jsx)("span",{className:"category__description",children:s}),(0,li.jsx)("ol",{children:c.map((n=>{const r={...t[n]};delete r.category;const{headingText:o,descriptionId:s,description:c,...l}=r;return(0,li.jsxs)("li",{children:[(0,li.jsx)(a,{id:s,children:o}),c&&(0,li.jsx)("span",{className:"feature__description",children:c}),(0,li.jsx)("ul",{className:"list--styleguidelayouts",children:Object.keys(l).map((t=>(0,li.jsx)("li",{className:t===i?.layoutMode&&n===i?.feature?"state__selected":void 0,children:(0,li.jsx)("a",{"aria-describedby":s,href:`${window.location.pathname}?${Jc({layoutMode:t,feature:n})}`,"aria-current":t===i?.layoutMode&&n===i?.feature?"page":void 0,onClick:r=>{if(r.preventDefault(),"inline"===t){const e=window.document.querySelector(".chat-inline");e&&window.scroll({top:e.offsetTop,behavior:"smooth"})}var a;a={layoutMode:t,feature:n},window.history.pushState(null,"",`${window.location.pathname}?${Jc(a)}`),e(a)},children:t.charAt(0).toUpperCase()+t.slice(1)})},t)))})]},n)}))})]},n)}))})})},iu=require("@seamly/web-ui"),ou={send:()=>{},store:{get:e=>e,set:e=>e,delete:e=>e},sendContext:()=>{},hasConversation:()=>!1,connected:!1},su=({state:e,translations:t,participants:n=[],children:r})=>{const a=(0,ka.useRef)((()=>{})),i=(0,ka.useRef)({emit:()=>{},on:()=>{},off:()=>{}}),o=(0,ka.useMemo)((()=>{const{translations:r,interrupt:a,config:o,visibility:s,...c}=e||{},l=rt({reducer:{state:ha,app:qn,config:$n,i18n:fr,translations:Ea,visibility:Ia,forms:sr,interrupt:br},preloadedState:{state:c,config:o,translations:r,interrupt:a,visibility:s},middleware:e=>e({thunk:{extraArgument:{api:ou,eventBus:i.current}},serializableCheck:!1})}),{config:u}=l.getState();return l.dispatch(Un(u)),u.preChatEvents&&l.dispatch(Hn(u.preChatEvents)),l.dispatch(dr("en-GB")),l.dispatch(pr(t)),n.forEach((e=>{l.dispatch(Zr({participant:e,fromClient:"user"===e?.id}))})),l}),[n,e,t]);return e&&(0,li.jsx)(iu.SeamlyStoreProvider,{store:o,children:(0,li.jsx)(iu.SeamlyEventBusContext.Provider,{value:i.current,children:(0,li.jsx)(iu.SeamlyApiContext.Provider,{value:ou,children:(0,li.jsx)(iu.SeamlyLiveRegionContext.Provider,{value:a.current,children:(0,li.jsx)(iu.ComponentFilter,{children:(0,li.jsx)(iu.SeamlyActivityMonitor,{children:(0,li.jsx)(iu.SeamlyFileUpload,{children:r})})})})})})})},cu=({state:e,customComponents:t={},translations:n,participants:r})=>{const[a,i]=(0,ka.useState)(!0),{config:o}=e||{},{layoutMode:s}=o||{},c=t[s];return(0,ka.useEffect)((()=>{i(!1),requestAnimationFrame((async()=>{await pi(60),i(!0)}))}),[e]),a?c?(0,li.jsx)(su,{state:e,translations:n,participants:r,children:(0,li.jsx)(c,{})}):(0,li.jsx)(su,{state:e,translations:n,participants:r,children:(0,li.jsx)(iu.View,{})}):null},lu=({tag:e,id:t,children:n})=>{const r=e;return(0,li.jsx)(r,{id:t,children:n})},uu=({config:e,styleGuideConfig:t,translations:n,headingLevel:r=2,participants:a})=>{const[i,o]=(0,ka.useState)(null),[s,c]=(0,ka.useState)(""),[l,u]=(0,ka.useState)(!0),[d]=(0,ka.useState)(G()),{stateUpdateCallback:p,customMessageEventBodies:f}=t,[h]=(0,ka.useState)((()=>{const e=(n=t.showLayoutModes||["inline","window"],{...ru(n,f),...-1!==n.indexOf("window")?{...tu,minimizedWindowPrechat:{category:Gl,headingText:"Minimized with pre-chat messages",description:"",window:{...Zc,config:{...Zc.config,layoutMode:"window",preChatEvents:[pl]},visibility:{...Zc.visibility,visibility:Mt.minimized},participantInfo:Qc,headerTitles:ol}},minimizedWindowPrechatDelayed:{category:Gl,headingText:"Minimized with delayed pre-chat messages",description:"",window:{...Zc,config:{...Zc.config,layoutMode:"window",preChatEvents:[pl],preChat:{enterDelay:1e3,exitAfter:3e3}},visibility:{...Zc.visibility,visibility:Mt.minimized},participantInfo:Qc,headerTitles:ol}},minimizedWindowPrechatDisabled:{category:Gl,headingText:"Minimized with disabled pre-chat messages",description:"",window:{...Zc,config:{...Zc.config,layoutMode:"window",preChatEvents:[pl],preChat:!1},visibility:{...Zc.visibility,visibility:Mt.minimized},participantInfo:Qc,headerTitles:ol}}}:{},...eu});var n;return Object.keys(e).reduce(((t,n)=>({...t,[n]:{...e[n],descriptionId:G()}})),{})})),m=(0,ka.useCallback)((e=>{o(p?p(e):e)}),[o,p]),y=(0,ka.useCallback)(((t,n)=>{const r=((...e)=>{const t=new URL(window.location.href);return e.reduce(((e,n)=>{const r=t.searchParams.get(n)||sessionStorage.getItem(n);return r&&(e[n]=r),e}),{})})("apiKey","locale"),i=new URLSearchParams({...r,layoutMode:t,feature:n});window.history.replaceState(null,"",`?${i}`);const{headingText:o}=h[n];c(o);const s=h[n][t],{overrideMessages:l,showSuggestions:u}=s.config,d=a.find((e=>"agent"===e.id));return{...s,config:{...s.config,...e,showDisclaimer:s.config.showDisclaimer||e.showDisclaimer,context:{...e.context,...s.config?.context},layoutMode:s.config.layoutMode,...l?{messages:l}:{},showSuggestions:u},headerTitles:{...s.headerTitles,subTitle:d?.name||s.headerTitles.subTitle}}}),[h,a,e]);(0,ka.useEffect)((()=>{if(l){const e=document.querySelector('[aria-modal="true"]');e&&e.addEventListener("click",(()=>{o((e=>e?{...e,visibility:{...e.visibility,visible:"minimized"}}:e))}))}}),[i,o,l]);const g=(0,ka.useCallback)((()=>{const e=Kc(),{layoutMode:t,feature:n}={layoutMode:"inline",feature:"base",...e};m(y(t,n)),window.document.title="Style"}),[y,m]);return(0,ka.useEffect)((()=>{g()}),[g]),(0,ka.useEffect)((()=>{window.onpopstate=()=>{g()}}),[g]),(0,li.jsxs)(li.Fragment,{children:[(0,li.jsxs)("section",{className:"chat-inline","aria-labelledby":d,children:[(0,li.jsxs)(lu,{tag:`h${r.toString()}`,id:d,children:[(0,li.jsx)("span",{className:"heading__context",children:"Current selected state:"}),`${s}`]}),(0,li.jsx)("div",{children:l&&(0,li.jsx)(cu,{customComponents:t.customComponents,translations:n,state:i,participants:a})})]}),(0,li.jsx)("aside",{className:"page-aside markdown",children:(0,li.jsx)("nav",{className:"page-controls",children:(0,li.jsx)(au,{headingLevel:r,setSelectedState:({layoutMode:e,feature:t})=>{const n=y(e,t);m(n),n.styleGuideReset&&(u(!1),setTimeout((()=>{u(!0)})))},states:h})})})]})},du=class extends Vc{constructor({styleGuideConfig:e,...t},n){super(t,n),this.styleGuideConfig=e||{}}async render(){const e={...this.config.customComponents||{},view:void 0},t=new J({namespace:this.config.namespace||"",config:this.config.api,context:this.config.context,layoutMode:this.config.layoutMode}),n=await t.getTranslations(this.config.context?.userLocale||"en-GB"),{agentParticipant:r,userParticipant:i}=await t.getConfig(),o=[{id:"user",...i},{id:"agent",introduction:"I am {{name}}",...r}],s={...this.config,customComponents:Object.keys(e).length?e:void 0};(0,a.render)((0,li.jsx)(uu,{config:s,styleGuideConfig:this.styleGuideConfig,translations:n,participants:o}),this.parentElement)}},pu=class extends qc{constructor(e,t){super(e),this.styleGuideConfig=t}createInstance(e){const{userStyleGuideConfig:t,...n}=e;return new du({styleGuideConfig:{...this.styleGuideConfig,...t},...n},this)}getUserConfig(e={},t){return super.getUserConfig({...e,...t})}},fu=function(e,t){if(window.seamlyStyleGuide&&!Array.isArray(window.seamlyStyleGuide))throw new Error("Seamly UI has already been initialised. Use the window.seamly object to start new instances instead.");const n=Array.isArray(window.seamlyStyleGuide)?window.seamlyStyleGuide:[],r=new pu(e,t);window.seamly=r,window.seamlyStyleGuide={push:r.push.bind(r)},r.push(...n)}})(),module.exports=r})();
|
|
2
|
+
(()=>{var e={2086:e=>{e.exports=function(e){var t={},n=[];(e=e||this).on=function(n,r,a){return(t[n]=t[n]||[]).push([r,a]),e},e.off=function(r,a){r||(t={});for(var i=t[r]||n,o=i.length=a?i.length:0;o--;)a==i[o][0]&&i.splice(o,1);return e},e.emit=function(r){for(var a,i=t[r]||n,o=i.length>0?i.slice(0,i.length):i,s=0;a=o[s++];)a[0].apply(a[1],n.slice.call(arguments,1));return e}}},7402:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>b,Component:()=>r.Component,Fragment:()=>r.Fragment,PureComponent:()=>f,StrictMode:()=>oe,Suspense:()=>S,SuspenseList:()=>T,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>J,cloneElement:()=>te,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>Y,createPortal:()=>k,createRef:()=>r.createRef,default:()=>ce,findDOMNode:()=>re,flushSync:()=>ie,forwardRef:()=>g,hydrate:()=>F,isElement:()=>se,isFragment:()=>Q,isMemo:()=>ee,isValidElement:()=>Z,lazy:()=>j,memo:()=>h,render:()=>z,startTransition:()=>l,unmountComponentAtNode:()=>ne,unstable_batchedUpdates:()=>ae,useDeferredValue:()=>u,useInsertionEffect:()=>p,useSyncExternalStore:()=>s,useTransition:()=>d,version:()=>X});var r=n(8785),a=n(1162),i={};for(const e in a)["default","Component","Fragment","createContext","createElement","createRef","Children","PureComponent","StrictMode","Suspense","SuspenseList","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","cloneElement","createFactory","createPortal","findDOMNode","flushSync","forwardRef","hydrate","isElement","isFragment","isMemo","isValidElement","lazy","memo","render","startTransition","unmountComponentAtNode","unstable_batchedUpdates","useDeferredValue","useInsertionEffect","useSyncExternalStore","useTransition","version"].indexOf(e)<0&&(i[e]=()=>a[e]);function o(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function s(e,t){var n=t(),r=(0,a.useState)({t:{__:n,u:t}}),i=r[0].t,o=r[1];return(0,a.useLayoutEffect)((function(){i.__=n,i.u=t,c(i)&&o({t:i})}),[e,n,t]),(0,a.useEffect)((function(){return c(i)&&o({t:i}),e((function(){c(i)&&o({t:i})}))}),[e]),n}function c(e){var t,n,r=e.u,a=e.__;try{var i=r();return!((t=a)===(n=i)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}function l(e){e()}function u(e){return e}function d(){return[!1,l]}n.d(t,i);var p=a.useLayoutEffect;function f(e,t){this.props=e,this.context=t}function h(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:o(this.props,e)}function a(t){return this.shouldComponentUpdate=n,(0,r.createElement)(e,t)}return a.displayName="Memo("+(e.displayName||e.name)+")",a.prototype.isReactComponent=!0,a.__f=!0,a}(f.prototype=new r.Component).isPureReactComponent=!0,f.prototype.shouldComponentUpdate=function(e,t){return o(this.props,e)||o(this.state,t)};var m=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),m&&m(e)};var y="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function g(e){function t(t){if(!("ref"in t))return e(t,null);var n=t.ref;delete t.ref;var r=e(t,n);return t.ref=n,r}return t.$$typeof=y,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var v=function(e,t){return null==e?null:(0,r.toChildArray)((0,r.toChildArray)(e).map(t))},b={map:v,forEach:v,count:function(e){return e?(0,r.toChildArray)(e).length:0},only:function(e){var t=(0,r.toChildArray)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.toChildArray},x=r.options.__e;r.options.__e=function(e,t,n,r){if(e.then)for(var a,i=t;i=i.__;)if((a=i.__c)&&a.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),a.__c(e,t);x(e,t,n,r)};var w=r.options.unmount;function _(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=function(e,t){for(var n in t)e[n]=t[n];return e}({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return _(e,t,n)}))),e}function C(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return C(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function S(){this.__u=0,this.o=null,this.__b=null}function E(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function j(e){var t,n,a;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){a=e})),a)throw a;if(!n)throw t;return(0,r.createElement)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function T(){this.i=null,this.l=null}r.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),w&&w(e)},(S.prototype=new r.Component).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var a=E(r.__v),i=!1,o=function(){i||(i=!0,n.__R=null,a?a(s):s())};n.__R=o;var s=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=C(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},S.prototype.componentWillUnmount=function(){this.o=[]},S.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),a=this.__v.__k[0].__c;this.__v.__k[0]=_(this.__b,n,a.__O=a.__P)}this.__b=null}var i=t.__a&&(0,r.createElement)(r.Fragment,null,e.fallback);return i&&(i.__u&=-33),[(0,r.createElement)(r.Fragment,null,t.__a?null:e.children),i]};var I=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function N(e){return this.getChildContext=function(){return e.context},e.children}function L(e){var t=this,n=e.h;t.componentWillUnmount=function(){(0,r.render)(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),t.v||(t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],contains:function(){return!0},appendChild:function(e){this.childNodes.push(e),t.h.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}),(0,r.render)((0,r.createElement)(N,{context:t.context},e.__v),t.v)}function k(e,t){var n=(0,r.createElement)(L,{__v:e,h:t});return n.containerInfo=t,n}(T.prototype=new r.Component).__a=function(e){var t=this,n=E(t.__v),r=t.l.get(e);return r[0]++,function(a){var i=function(){t.props.revealOrder?(r.push(a),I(t,e,r)):a()};n?n(i):i()}},T.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,r.toChildArray)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},T.prototype.componentDidUpdate=T.prototype.componentDidMount=function(){var e=this;this.l.forEach((function(t,n){I(e,n,t)}))};var M="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,A=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,O=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,P=/[A-Z0-9]/g,R="undefined"!=typeof document,D=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function z(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function F(e,t,n){return(0,r.hydrate)(e,t),"function"==typeof n&&n(),e?e.__c:null}r.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(r.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var U=r.options.event;function B(){}function H(){return this.cancelBubble}function $(){return this.defaultPrevented}r.options.event=function(e){return U&&(e=U(e)),e.persist=B,e.isPropagationStopped=H,e.isDefaultPrevented=$,e.nativeEvent=e};var V,G={enumerable:!1,configurable:!0,get:function(){return this.class}},W=r.options.vnode;r.options.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,a={},i=-1===n.indexOf("-");for(var o in t){var s=t[o];if(!("value"===o&&"defaultValue"in t&&null==s||R&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var c=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===s?s="":"translate"===c&&"no"===s?s=!1:"o"===c[0]&&"n"===c[1]?"ondoubleclick"===c?o="ondblclick":"onchange"!==c||"input"!==n&&"textarea"!==n||D(t.type)?"onfocus"===c?o="onfocusin":"onblur"===c?o="onfocusout":O.test(o)&&(o=c):c=o="oninput":i&&A.test(o)?o=o.replace(P,"-$&").toLowerCase():null===s&&(s=void 0),"oninput"===c&&a[o=c]&&(o="oninputCapture"),a[o]=s}}"select"==n&&a.multiple&&Array.isArray(a.value)&&(a.value=(0,r.toChildArray)(t.children).forEach((function(e){e.props.selected=-1!=a.value.indexOf(e.props.value)}))),"select"==n&&null!=a.defaultValue&&(a.value=(0,r.toChildArray)(t.children).forEach((function(e){e.props.selected=a.multiple?-1!=a.defaultValue.indexOf(e.props.value):a.defaultValue==e.props.value}))),t.class&&!t.className?(a.class=t.class,Object.defineProperty(a,"className",G)):(t.className&&!t.class||t.class&&t.className)&&(a.class=a.className=t.className),e.props=a}(e),e.$$typeof=M,W&&W(e)};var q=r.options.__r;r.options.__r=function(e){q&&q(e),V=e.__c};var K=r.options.diffed;r.options.diffed=function(e){K&&K(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),V=null};var J={ReactCurrentDispatcher:{current:{readContext:function(e){return V.__n[e.__c].props.value},useCallback:a.useCallback,useContext:a.useContext,useDebugValue:a.useDebugValue,useDeferredValue:u,useEffect:a.useEffect,useId:a.useId,useImperativeHandle:a.useImperativeHandle,useInsertionEffect:p,useLayoutEffect:a.useLayoutEffect,useMemo:a.useMemo,useReducer:a.useReducer,useRef:a.useRef,useState:a.useState,useSyncExternalStore:s,useTransition:d}}},X="18.3.1";function Y(e){return r.createElement.bind(null,e)}function Z(e){return!!e&&e.$$typeof===M}function Q(e){return Z(e)&&e.type===r.Fragment}function ee(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function te(e){return Z(e)?r.cloneElement.apply(null,arguments):e}function ne(e){return!!e.__k&&((0,r.render)(null,e),!0)}function re(e){return e&&(e.base||1===e.nodeType&&e)||null}var ae=function(e,t){return e(t)},ie=function(e,t){return e(t)},oe=r.Fragment,se=Z,ce={useState:a.useState,useId:a.useId,useReducer:a.useReducer,useEffect:a.useEffect,useLayoutEffect:a.useLayoutEffect,useInsertionEffect:p,useTransition:d,useDeferredValue:u,useSyncExternalStore:s,startTransition:l,useRef:a.useRef,useImperativeHandle:a.useImperativeHandle,useMemo:a.useMemo,useCallback:a.useCallback,useContext:a.useContext,useDebugValue:a.useDebugValue,version:"18.3.1",Children:b,render:z,hydrate:F,unmountComponentAtNode:ne,createPortal:k,createElement:r.createElement,createContext:r.createContext,createFactory:Y,cloneElement:te,createRef:r.createRef,Fragment:r.Fragment,isValidElement:Z,isElement:se,isFragment:Q,isMemo:ee,findDOMNode:re,Component:r.Component,PureComponent:f,memo:h,forwardRef:g,flushSync:ie,unstable_batchedUpdates:ae,StrictMode:oe,Suspense:S,SuspenseList:T,lazy:j,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:J}},7154:(e,t,n)=>{"use strict";var r=n(7402),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useSyncExternalStore,o=r.useRef,s=r.useEffect,c=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=c((function(){function e(e){if(!s){if(s=!0,i=e,e=r(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return o=t}return o=e}if(t=o,a(i,e))return t;var n=r(e);return void 0!==u&&u(t,n)?t:(i=e,o=n)}var i,o,s=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,u]);var f=i(e,d[0],d[1]);return s((function(){p.hasValue=!0,p.value=f}),[f]),l(f),f}},8418:(e,t,n)=>{"use strict";e.exports=n(7154)},8785:e=>{"use strict";e.exports=require("preact")},1162:e=>{"use strict";e.exports=require("preact/hooks")},9306:(e,t,n)=>{"use strict";var r=n(4901),a=n(6823),i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(a(e)+" is not a function")}},7080:(e,t,n)=>{"use strict";var r=n(4402).has;e.exports=function(e){return r(e),e}},8551:(e,t,n)=>{"use strict";var r=n(34),a=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(a(e)+" is not an object")}},9617:(e,t,n)=>{"use strict";var r=n(5397),a=n(5610),i=n(6198),o=function(e){return function(t,n,o){var s=r(t),c=i(s);if(0===c)return!e&&-1;var l,u=a(o,c);if(e&&n!=n){for(;c>u;)if((l=s[u++])!=l)return!0}else for(;c>u;u++)if((e||u in s)&&s[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},4527:(e,t,n)=>{"use strict";var r=n(3724),a=n(4376),i=TypeError,o=Object.getOwnPropertyDescriptor,s=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(a(e)&&!o(e,"length").writable)throw new i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},2195:(e,t,n)=>{"use strict";var r=n(9504),a=r({}.toString),i=r("".slice);e.exports=function(e){return i(a(e),8,-1)}},7740:(e,t,n)=>{"use strict";var r=n(9297),a=n(5031),i=n(7347),o=n(4913);e.exports=function(e,t,n){for(var s=a(t),c=o.f,l=i.f,u=0;u<s.length;u++){var d=s[u];r(e,d)||n&&r(n,d)||c(e,d,l(t,d))}}},6699:(e,t,n)=>{"use strict";var r=n(3724),a=n(4913),i=n(6980);e.exports=r?function(e,t,n){return a.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},6980:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6840:(e,t,n)=>{"use strict";var r=n(4901),a=n(4913),i=n(283),o=n(9433);e.exports=function(e,t,n,s){s||(s={});var c=s.enumerable,l=void 0!==s.name?s.name:t;if(r(n)&&i(n,l,s),s.global)c?e[t]=n:o(t,n);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=n:a.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},9433:(e,t,n)=>{"use strict";var r=n(4576),a=Object.defineProperty;e.exports=function(e,t){try{a(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},3724:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4055:(e,t,n)=>{"use strict";var r=n(4576),a=n(34),i=r.document,o=a(i)&&a(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},6837:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},8727:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2839:(e,t,n)=>{"use strict";var r=n(4576).navigator,a=r&&r.userAgent;e.exports=a?String(a):""},9519:(e,t,n)=>{"use strict";var r,a,i=n(4576),o=n(2839),s=i.process,c=i.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u&&(a=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!a&&o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(a=+r[1]),e.exports=a},6518:(e,t,n)=>{"use strict";var r=n(4576),a=n(7347).f,i=n(6699),o=n(6840),s=n(9433),c=n(7740),l=n(2796);e.exports=function(e,t){var n,u,d,p,f,h=e.target,m=e.global,y=e.stat;if(n=m?r:y?r[h]||s(h,{}):r[h]&&r[h].prototype)for(u in t){if(p=t[u],d=e.dontCallGetSet?(f=a(n,u))&&f.value:n[u],!l(m?u:h+(y?".":"#")+u,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;c(p,d)}(e.sham||d&&d.sham)&&i(p,"sham",!0),o(n,u,p,e)}}},9039:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},616:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},9565:(e,t,n)=>{"use strict";var r=n(616),a=Function.prototype.call;e.exports=r?a.bind(a):function(){return a.apply(a,arguments)}},350:(e,t,n)=>{"use strict";var r=n(3724),a=n(9297),i=Function.prototype,o=r&&Object.getOwnPropertyDescriptor,s=a(i,"name"),c=s&&"something"===function(){}.name,l=s&&(!r||r&&o(i,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:l}},6706:(e,t,n)=>{"use strict";var r=n(9504),a=n(9306);e.exports=function(e,t,n){try{return r(a(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},9504:(e,t,n)=>{"use strict";var r=n(616),a=Function.prototype,i=a.call,o=r&&a.bind.bind(i,i);e.exports=r?o:function(e){return function(){return i.apply(e,arguments)}}},7751:(e,t,n)=>{"use strict";var r=n(4576),a=n(4901);e.exports=function(e,t){return arguments.length<2?(n=r[e],a(n)?n:void 0):r[e]&&r[e][t];var n}},4148:e=>{"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},5966:(e,t,n)=>{"use strict";var r=n(9306),a=n(4117);e.exports=function(e,t){var n=e[t];return a(n)?void 0:r(n)}},3789:(e,t,n)=>{"use strict";var r=n(9306),a=n(8551),i=n(9565),o=n(1291),s=n(4148),c="Invalid size",l=RangeError,u=TypeError,d=Math.max,p=function(e,t){this.set=e,this.size=d(t,0),this.has=r(e.has),this.keys=r(e.keys)};p.prototype={getIterator:function(){return s(a(i(this.keys,this.set)))},includes:function(e){return i(this.has,this.set,e)}},e.exports=function(e){a(e);var t=+e.size;if(t!=t)throw new u(c);var n=o(t);if(n<0)throw new l(c);return new p(e,n)}},4576:function(e,t,n){"use strict";var r=function(e){return e&&e.Math===Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||r("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297:(e,t,n)=>{"use strict";var r=n(9504),a=n(8981),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(a(e),t)}},421:e=>{"use strict";e.exports={}},5917:(e,t,n)=>{"use strict";var r=n(3724),a=n(9039),i=n(4055);e.exports=!r&&!a((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},7055:(e,t,n)=>{"use strict";var r=n(9504),a=n(9039),i=n(2195),o=Object,s=r("".split);e.exports=a((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"===i(e)?s(e,""):o(e)}:o},3706:(e,t,n)=>{"use strict";var r=n(9504),a=n(4901),i=n(7629),o=r(Function.toString);a(i.inspectSource)||(i.inspectSource=function(e){return o(e)}),e.exports=i.inspectSource},1181:(e,t,n)=>{"use strict";var r,a,i,o=n(8622),s=n(4576),c=n(34),l=n(6699),u=n(9297),d=n(7629),p=n(6119),f=n(421),h="Object already initialized",m=s.TypeError,y=s.WeakMap;if(o||d.state){var g=d.state||(d.state=new y);g.get=g.get,g.has=g.has,g.set=g.set,r=function(e,t){if(g.has(e))throw new m(h);return t.facade=e,g.set(e,t),t},a=function(e){return g.get(e)||{}},i=function(e){return g.has(e)}}else{var v=p("state");f[v]=!0,r=function(e,t){if(u(e,v))throw new m(h);return t.facade=e,l(e,v,t),t},a=function(e){return u(e,v)?e[v]:{}},i=function(e){return u(e,v)}}e.exports={set:r,get:a,has:i,enforce:function(e){return i(e)?a(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=a(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return n}}}},4376:(e,t,n)=>{"use strict";var r=n(2195);e.exports=Array.isArray||function(e){return"Array"===r(e)}},4901:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},2796:(e,t,n)=>{"use strict";var r=n(9039),a=n(4901),i=/#|\.prototype\./,o=function(e,t){var n=c[s(e)];return n===u||n!==l&&(a(t)?r(t):!!t)},s=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=o.data={},l=o.NATIVE="N",u=o.POLYFILL="P";e.exports=o},4117:e=>{"use strict";e.exports=function(e){return null==e}},34:(e,t,n)=>{"use strict";var r=n(4901);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},6395:e=>{"use strict";e.exports=!1},757:(e,t,n)=>{"use strict";var r=n(7751),a=n(4901),i=n(1625),o=n(7040),s=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return a(t)&&i(t.prototype,s(e))}},507:(e,t,n)=>{"use strict";var r=n(9565);e.exports=function(e,t,n){for(var a,i,o=n?e:e.iterator,s=e.next;!(a=r(s,o)).done;)if(void 0!==(i=t(a.value)))return i}},9539:(e,t,n)=>{"use strict";var r=n(9565),a=n(8551),i=n(5966);e.exports=function(e,t,n){var o,s;a(e);try{if(!(o=i(e,"return"))){if("throw"===t)throw n;return n}o=r(o,e)}catch(e){s=!0,o=e}if("throw"===t)throw n;if(s)throw o;return a(o),n}},6198:(e,t,n)=>{"use strict";var r=n(8014);e.exports=function(e){return r(e.length)}},283:(e,t,n)=>{"use strict";var r=n(9504),a=n(9039),i=n(4901),o=n(9297),s=n(3724),c=n(350).CONFIGURABLE,l=n(3706),u=n(1181),d=u.enforce,p=u.get,f=String,h=Object.defineProperty,m=r("".slice),y=r("".replace),g=r([].join),v=s&&!a((function(){return 8!==h((function(){}),"length",{value:8}).length})),b=String(String).split("String"),x=e.exports=function(e,t,n){"Symbol("===m(f(t),0,7)&&(t="["+y(f(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!o(e,"name")||c&&e.name!==t)&&(s?h(e,"name",{value:t,configurable:!0}):e.name=t),v&&n&&o(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?s&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=d(e);return o(r,"source")||(r.source=g(b,"string"==typeof t?t:"")),e};Function.prototype.toString=x((function(){return i(this)&&p(this).source||l(this)}),"toString")},741:e=>{"use strict";var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},4913:(e,t,n)=>{"use strict";var r=n(3724),a=n(5917),i=n(8686),o=n(8551),s=n(6969),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",f="writable";t.f=r?i?function(e,t,n){if(o(e),t=s(t),o(n),"function"==typeof e&&"prototype"===t&&"value"in n&&f in n&&!n[f]){var r=u(e,t);r&&r[f]&&(e[t]=n.value,n={configurable:p in n?n[p]:r[p],enumerable:d in n?n[d]:r[d],writable:!1})}return l(e,t,n)}:l:function(e,t,n){if(o(e),t=s(t),o(n),a)try{return l(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new c("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},7347:(e,t,n)=>{"use strict";var r=n(3724),a=n(9565),i=n(8773),o=n(6980),s=n(5397),c=n(6969),l=n(9297),u=n(5917),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=s(e),t=c(t),u)try{return d(e,t)}catch(e){}if(l(e,t))return o(!a(i.f,e,t),e[t])}},8480:(e,t,n)=>{"use strict";var r=n(1828),a=n(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,a)}},3717:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},1625:(e,t,n)=>{"use strict";var r=n(9504);e.exports=r({}.isPrototypeOf)},1828:(e,t,n)=>{"use strict";var r=n(9504),a=n(9297),i=n(5397),o=n(9617).indexOf,s=n(421),c=r([].push);e.exports=function(e,t){var n,r=i(e),l=0,u=[];for(n in r)!a(s,n)&&a(r,n)&&c(u,n);for(;t.length>l;)a(r,n=t[l++])&&(~o(u,n)||c(u,n));return u}},8773:(e,t)=>{"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,a=r&&!n.call({1:2},1);t.f=a?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},4270:(e,t,n)=>{"use strict";var r=n(9565),a=n(4901),i=n(34),o=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&a(n=e.toString)&&!i(s=r(n,e)))return s;if(a(n=e.valueOf)&&!i(s=r(n,e)))return s;if("string"!==t&&a(n=e.toString)&&!i(s=r(n,e)))return s;throw new o("Can't convert object to primitive value")}},5031:(e,t,n)=>{"use strict";var r=n(7751),a=n(9504),i=n(8480),o=n(3717),s=n(8551),c=a([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(s(e)),n=o.f;return n?c(t,n(e)):t}},7750:(e,t,n)=>{"use strict";var r=n(4117),a=TypeError;e.exports=function(e){if(r(e))throw new a("Can't call method on "+e);return e}},9286:(e,t,n)=>{"use strict";var r=n(4402),a=n(8469),i=r.Set,o=r.add;e.exports=function(e){var t=new i;return a(e,(function(e){o(t,e)})),t}},3440:(e,t,n)=>{"use strict";var r=n(7080),a=n(4402),i=n(9286),o=n(5170),s=n(3789),c=n(8469),l=n(507),u=a.has,d=a.remove;e.exports=function(e){var t=r(this),n=s(e),a=i(t);return o(t)<=n.size?c(t,(function(e){n.includes(e)&&d(a,e)})):l(n.getIterator(),(function(e){u(t,e)&&d(a,e)})),a}},4402:(e,t,n)=>{"use strict";var r=n(9504),a=Set.prototype;e.exports={Set,add:r(a.add),has:r(a.has),remove:r(a.delete),proto:a}},8750:(e,t,n)=>{"use strict";var r=n(7080),a=n(4402),i=n(5170),o=n(3789),s=n(8469),c=n(507),l=a.Set,u=a.add,d=a.has;e.exports=function(e){var t=r(this),n=o(e),a=new l;return i(t)>n.size?c(n.getIterator(),(function(e){d(t,e)&&u(a,e)})):s(t,(function(e){n.includes(e)&&u(a,e)})),a}},4449:(e,t,n)=>{"use strict";var r=n(7080),a=n(4402).has,i=n(5170),o=n(3789),s=n(8469),c=n(507),l=n(9539);e.exports=function(e){var t=r(this),n=o(e);if(i(t)<=n.size)return!1!==s(t,(function(e){if(n.includes(e))return!1}),!0);var u=n.getIterator();return!1!==c(u,(function(e){if(a(t,e))return l(u,"normal",!1)}))}},3838:(e,t,n)=>{"use strict";var r=n(7080),a=n(5170),i=n(8469),o=n(3789);e.exports=function(e){var t=r(this),n=o(e);return!(a(t)>n.size)&&!1!==i(t,(function(e){if(!n.includes(e))return!1}),!0)}},8527:(e,t,n)=>{"use strict";var r=n(7080),a=n(4402).has,i=n(5170),o=n(3789),s=n(507),c=n(9539);e.exports=function(e){var t=r(this),n=o(e);if(i(t)<n.size)return!1;var l=n.getIterator();return!1!==s(l,(function(e){if(!a(t,e))return c(l,"normal",!1)}))}},8469:(e,t,n)=>{"use strict";var r=n(9504),a=n(507),i=n(4402),o=i.Set,s=i.proto,c=r(s.forEach),l=r(s.keys),u=l(new o).next;e.exports=function(e,t,n){return n?a({iterator:l(e),next:u},t):c(e,t)}},4916:(e,t,n)=>{"use strict";var r=n(7751),a=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};e.exports=function(e){var t=r("Set");try{(new t)[e](a(0));try{return(new t)[e](a(-1)),!1}catch(e){return!0}}catch(e){return!1}}},5170:(e,t,n)=>{"use strict";var r=n(6706),a=n(4402);e.exports=r(a.proto,"size","get")||function(e){return e.size}},3650:(e,t,n)=>{"use strict";var r=n(7080),a=n(4402),i=n(9286),o=n(3789),s=n(507),c=a.add,l=a.has,u=a.remove;e.exports=function(e){var t=r(this),n=o(e).getIterator(),a=i(t);return s(n,(function(e){l(t,e)?u(a,e):c(a,e)})),a}},4204:(e,t,n)=>{"use strict";var r=n(7080),a=n(4402).add,i=n(9286),o=n(3789),s=n(507);e.exports=function(e){var t=r(this),n=o(e).getIterator(),c=i(t);return s(n,(function(e){a(c,e)})),c}},6119:(e,t,n)=>{"use strict";var r=n(5745),a=n(3392),i=r("keys");e.exports=function(e){return i[e]||(i[e]=a(e))}},7629:(e,t,n)=>{"use strict";var r=n(6395),a=n(4576),i=n(9433),o="__core-js_shared__",s=e.exports=a[o]||i(o,{});(s.versions||(s.versions=[])).push({version:"3.39.0",mode:r?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:(e,t,n)=>{"use strict";var r=n(7629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},4495:(e,t,n)=>{"use strict";var r=n(9519),a=n(9039),i=n(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!a((function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},5610:(e,t,n)=>{"use strict";var r=n(1291),a=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?a(n+t,0):i(n,t)}},5397:(e,t,n)=>{"use strict";var r=n(7055),a=n(7750);e.exports=function(e){return r(a(e))}},1291:(e,t,n)=>{"use strict";var r=n(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},8014:(e,t,n)=>{"use strict";var r=n(1291),a=Math.min;e.exports=function(e){var t=r(e);return t>0?a(t,9007199254740991):0}},8981:(e,t,n)=>{"use strict";var r=n(7750),a=Object;e.exports=function(e){return a(r(e))}},2777:(e,t,n)=>{"use strict";var r=n(9565),a=n(34),i=n(757),o=n(5966),s=n(4270),c=n(8227),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!a(e)||i(e))return e;var n,c=o(e,u);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!a(n)||i(n))return n;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},6969:(e,t,n)=>{"use strict";var r=n(2777),a=n(757);e.exports=function(e){var t=r(e,"string");return a(t)?t:t+""}},6823:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},3392:(e,t,n)=>{"use strict";var r=n(9504),a=0,i=Math.random(),o=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++a+i,36)}},7040:(e,t,n)=>{"use strict";var r=n(4495);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686:(e,t,n)=>{"use strict";var r=n(3724),a=n(9039);e.exports=r&&a((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8622:(e,t,n)=>{"use strict";var r=n(4576),a=n(4901),i=r.WeakMap;e.exports=a(i)&&/native code/.test(String(i))},8227:(e,t,n)=>{"use strict";var r=n(4576),a=n(5745),i=n(9297),o=n(3392),s=n(4495),c=n(7040),l=r.Symbol,u=a("wks"),d=c?l.for||l:l&&l.withoutSetter||o;e.exports=function(e){return i(u,e)||(u[e]=s&&i(l,e)?l[e]:d("Symbol."+e)),u[e]}},4114:(e,t,n)=>{"use strict";var r=n(6518),a=n(8981),i=n(6198),o=n(4527),s=n(6837);r({target:"Array",proto:!0,arity:1,forced:n(9039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=a(this),n=i(t),r=arguments.length;s(n+r);for(var c=0;c<r;c++)t[n]=arguments[c],n++;return o(t,n),n}})},7642:(e,t,n)=>{"use strict";var r=n(6518),a=n(3440);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("difference")},{difference:a})},8004:(e,t,n)=>{"use strict";var r=n(6518),a=n(9039),i=n(8750);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("intersection")||a((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:i})},3853:(e,t,n)=>{"use strict";var r=n(6518),a=n(4449);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isDisjointFrom")},{isDisjointFrom:a})},5876:(e,t,n)=>{"use strict";var r=n(6518),a=n(3838);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSubsetOf")},{isSubsetOf:a})},2475:(e,t,n)=>{"use strict";var r=n(6518),a=n(8527);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSupersetOf")},{isSupersetOf:a})},5024:(e,t,n)=>{"use strict";var r=n(6518),a=n(3650);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("symmetricDifference")},{symmetricDifference:a})},1698:(e,t,n)=>{"use strict";var r=n(6518),a=n(4204);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("union")},{union:a})},3375:(e,t,n)=>{"use strict";n(7642)},9225:(e,t,n)=>{"use strict";n(8004)},3972:(e,t,n)=>{"use strict";n(3853)},9209:(e,t,n)=>{"use strict";n(5876)},5714:(e,t,n)=>{"use strict";n(2475)},7561:(e,t,n)=>{"use strict";n(5024)},6197:(e,t,n)=>{"use strict";n(1698)}},t={};function n(r){var a=t[r];if(void 0!==a)return a.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 e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var a=r.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=r[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})();var r={};(()=>{"use strict";n.r(r),n.d(r,{SeamlyStaticCore:()=>su,default:()=>fu}),n(4114);var e=n(2086),t=n.n(e),a=n(8785),i=(n(3375),n(9225),n(3972),n(9209),n(5714),n(7561),n(6197),function(e,t){return i=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])},i(e,t)});function o(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,i=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o}var c=function(e,t){this.target=t,this.type=e},l=function(e){function t(t,n){var r=e.call(this,"error",n)||this;return r.message=t.message,r.error=t,r}return o(t,e),t}(c),u=function(e){function t(t,n,r){void 0===t&&(t=1e3),void 0===n&&(n="");var a=e.call(this,"close",r)||this;return a.wasClean=!0,a.code=t,a.reason=n,a}return o(t,e),t}(c),d=function(){if("undefined"!=typeof WebSocket)return WebSocket},p={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},f=function(){function e(e,t,n){var r=this;void 0===n&&(n={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){r._debug("open event");var t=r._options.minUptime,n=void 0===t?p.minUptime:t;clearTimeout(r._connectTimeout),r._uptimeTimeout=setTimeout((function(){return r._acceptOpen()}),n),r._ws.binaryType=r._binaryType,r._messageQueue.forEach((function(e){return r._ws.send(e)})),r._messageQueue=[],r.onopen&&r.onopen(e),r._listeners.open.forEach((function(t){return r._callEventListener(e,t)}))},this._handleMessage=function(e){r._debug("message event"),r.onmessage&&r.onmessage(e),r._listeners.message.forEach((function(t){return r._callEventListener(e,t)}))},this._handleError=function(e){r._debug("error event",e.message),r._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),r.onerror&&r.onerror(e),r._debug("exec error listeners"),r._listeners.error.forEach((function(t){return r._callEventListener(e,t)})),r._connect()},this._handleClose=function(e){r._debug("close event"),r._clearTimeouts(),r._shouldReconnect&&r._connect(),r.onclose&&r.onclose(e),r._listeners.close.forEach((function(t){return r._callEventListener(e,t)}))},this._url=e,this._protocols=t,this._options=n,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(e,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CONNECTING",{get:function(){return e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OPEN",{get:function(){return e.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSING",{get:function(){return e.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSED",{get:function(){return e.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce((function(e,t){return"string"==typeof t?e+=t.length:t instanceof Blob?e+=t.size:e+=t.byteLength,e}),0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),e.prototype.close=function(e,t){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,t):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},e.prototype.reconnect=function(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,t),this._connect()):this._connect()},e.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{var t=this._options.maxEnqueuedMessages,n=void 0===t?p.maxEnqueuedMessages:t;this._messageQueue.length<n&&(this._debug("enqueue",e),this._messageQueue.push(e))}},e.prototype.addEventListener=function(e,t){this._listeners[e]&&this._listeners[e].push(t)},e.prototype.dispatchEvent=function(e){var t,n,r=this._listeners[e.type];if(r)try{for(var a=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(r),i=a.next();!i.done;i=a.next()){var o=i.value;this._callEventListener(e,o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return!0},e.prototype.removeEventListener=function(e,t){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter((function(e){return e!==t})))},e.prototype._debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._options.debug&&console.log.apply(console,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e}(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,n=void 0===t?p.reconnectionDelayGrowFactor:t,r=e.minReconnectionDelay,a=void 0===r?p.minReconnectionDelay:r,i=e.maxReconnectionDelay,o=void 0===i?p.maxReconnectionDelay:i,s=0;return this._retryCount>0&&(s=a*Math.pow(n,this._retryCount-1))>o&&(s=o),this._debug("next delay",s),s},e.prototype._wait=function(){var e=this;return new Promise((function(t){setTimeout(t,e._getNextDelay())}))},e.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var t=e();if("string"==typeof t)return Promise.resolve(t);if(t.then)return t}throw Error("Invalid URL")},e.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var t=this._options,n=t.maxRetries,r=void 0===n?p.maxRetries:n,a=t.connectionTimeout,i=void 0===a?p.connectionTimeout:a,o=t.WebSocket,s=void 0===o?d():o;if(this._retryCount>=r)this._debug("max retries reached",this._retryCount,">=",r);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),void 0===(c=s)||!c||2!==c.CLOSING)throw Error("No valid WebSocket class provided");var c;this._wait().then((function(){return e._getNextUrl(e._url)})).then((function(t){e._closeCalled||(e._debug("connect",{url:t,protocols:e._protocols}),e._ws=e._protocols?new s(t,e._protocols):new s(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout((function(){return e._handleTimeout()}),i))}))}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new l(Error("TIMEOUT"),this))},e.prototype._disconnect=function(e,t){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new u(e,t,this))}catch(e){}}},e.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},e.prototype._callEventListener=function(e,t){"handleEvent"in t?t.handleEvent(e):t(e)},e.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},e.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},e.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},e}();const h=f,m=new Set;class y{#e=[];#t=null;#n=null;#r=e=>{const t=JSON.parse(e.data);this.#t&&clearInterval(this.#t),this.#t=setInterval((()=>{this.socket?.readyState===h.OPEN&&this.socket?.send(JSON.stringify({type:"ping"}))}),3e4);try{if("attach_channel_response"===t.type){if(!t.payload.success)return void this.#a({connected:!0,ready:!1,currentState:"attach_channel_erred"});this.#a({connected:!0,ready:!0,currentState:"attach_channel_response"})}}catch(e){console.warn(e)}};#i=()=>{this.#a({connected:!1,ready:!1,currentState:"socket_closed"})};#o=()=>{this.#a({connected:!1,ready:!1,currentState:"socket_join_error"})};accessToken="";channelName="";channelTopic="";url="";async connect(e,t,n,r){this.url=e,this.accessToken=r,this.channelName=t,this.channelTopic=n;const{url:a}=(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{...e,[n]:decodeURIComponent(r)}}),{})}})(this.url);this.socket=new h(a,[],{maxReconnectionDelay:1e4,minReconnectionDelay:500,reconnectionDelayGrowFactor:2});const i={type:"attach_channel",payload:{accessToken:this.accessToken,channelName:this.channelName}};this.#n=()=>{this.socket?.send(JSON.stringify(i)),this.#a({connected:!0,ready:!1,currentState:"socket_connected"})},this.socket?.addEventListener("open",this.#n),this.socket?.addEventListener("message",this.#r),this.socket?.addEventListener("close",this.#i),this.socket?.addEventListener("error",this.#o)}disconnect(){this.socket?.close(),this.#n&&this.socket?.removeEventListener("open",this.#n),this.socket?.removeEventListener("message",this.#r),this.socket?.removeEventListener("close",this.#i),this.socket?.removeEventListener("error",this.#o),this.#e=[]}onOpen=e=>{this?.socket?.addEventListener("open",e)};onError=e=>{this?.socket?.addEventListener("error",e)};addListener=(e,t)=>{this?.socket?.addEventListener(e,(e=>t(JSON.parse(e.data))))};onMessage=e=>{this?.socket&&(this.socket.onmessage=t=>e(JSON.parse(t.data)))};removeListener=(e,t)=>{this.socket?.removeEventListener(e,t)};onConnection(e){this.#e.push(e)}#a(e){this.#e=this.#e.filter((t=>!t(e))),m.forEach((e=>e()))}pushToChannel(e,t){this.socket?.send(JSON.stringify({type:e,payload:t}))}static subscribe(e){return m.add(e),()=>m.delete(e)}}class g extends Error{constructor(e,t){super(e,{cause:t?.cause}),this.status=t?.status}}class v extends Error{action="";langKey="";constructor(e,...t){if(super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Object.getPrototypeOf(this)),this.originalError=e,e?.payload&&(this.originalEvent=e,this.originalError=e.payload.error,this.message=`Event of type ${e.payload.type} encountered`),!this.message&&e?.message){const t=function(e){try{return JSON.parse(e).error}catch(t){return e}}(e.message);this.message=t}e?.error&&(this.originalError=e.error)}}class b extends v{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class x extends v{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class w extends v{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class _ extends v{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}function C(e){const t=`cvco.${e}`;return{get(){const e=[t,t.split(".").slice(0,-1).join(".")];let n;do{n=sessionStorage.getItem(e[0])}while(e.shift()&&!n);return n?JSON.parse(n):{}},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}const S="message",E="text",j="text",T="upload",I="received",N="read",L="custom",k="typing",M="read",A="detach_service",O="dismiss",P="set_topic",R="click_cta",D="translation_proposal",z=D,F="window_api",U="assertive",B="polite",H={new_topic:"newTopic",new_translation:"newTranslation"},$="uploads",V="navigate";function G(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}const W=async(e,t)=>{const n=new URL(e),r=await fetch(n.href,{mode:"cors",...t});if(!r.ok)throw new g(r.statusText||`Request failed with status: ${r.status}`,{status:r.status});return r};function q(){if(!Intl||"undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return;const e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return;const t=e.resolvedOptions().timeZone;return t&&(t.indexOf("/")>-1||"UTC"===t)?t:void 0}const K=(...e)=>console.debug("seamly",...e);class J{#s;#c;#l;#u="window";#d;#p="new";URLS={};locale="";conversation=new y;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.userLocale?`.${r.userLocale}`:""}`,n.storageProvider||C),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},this.#d={...n,sendEnvironment:n.sendEnvironment??!0,context:{...r,channelName:r.channelName||"web"}},this.#s=!1,this.connected=!1,this.configReady=!1,n.externalId&&(this.#c=n.externalId),this.#u=e,this.userResponded=!1,this.URLS={translations:{href:`/channels/api/v2/client/${this.connectionInfo.apiKey}/translations/{version}/{locale}.json`,templated:!0},config:{href:`/channels/api/v2/client/${this.connectionInfo.apiKey}/configs`,templated:!0}},window.addEventListener("pageshow",(e=>{e.persisted&&this.connected&&this.connect()}))}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?.href)}hasConversation(){return!!this.getConversationUrl()}getChannelTopic(){return this.store.get("channelTopic")||this.store.get("channelName")}getLocale=e=>e||this.locale;#f({_links:{self:e,...t}}){this.URLS={...this.URLS,...t}}clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}#h(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`}async getTranslations(e){try{if(!this.URLS.translations?.href)throw new b;const t=`${this.#h("http")}${this.URLS.translations.href}`.replace("{version}",String(4)).replace("{locale}",this.getLocale(e)),n=await W(t,{method:"GET"});return(await n.json()).translations}catch(e){if(e.status>=500)throw new x(e);throw new g(e)}}getContext(e){const{source:t,userLocale:n,variables:r}=e;if(t&&"string"!=typeof t)throw new Error("Source must be a string");if(n){if("string"!=typeof n)throw new Error("Locale must be a string");this.#m(e,n)}if(r&&"object"!=typeof r)throw new Error("Variables must be an object");if(0===Object.keys(e).length&&e.constructor===Object)return;const a=this.#d.context?.contentLocale,i=this.#d.context?.userLocale;return{...a?{contentLocale:a}:{},...i?{userLocale:i}:{},...e}}async downloadFile(e,t){try{const n=await W(`${this.#h("http")}${this.URLS.uploads.href}/${e}`,{method:"GET",headers:{Authorization:`Bearer ${this.getAccessToken()}`}}),r=document.createElement("a"),a=URL.createObjectURL(await n.blob());r.href=a,void 0!==r.download&&(r.download=t),r.click(),setTimeout((()=>{URL.revokeObjectURL(a)}),6e4)}catch(e){}}uploadFile(e,t,n,r){const a=new FormData;a.append("upload",e);const i=new XMLHttpRequest;return i.open("POST",`${this.#h("http")}${this.URLS.uploads.href}`),i.setRequestHeader("Authorization",`Bearer ${this.getAccessToken()}`),i.upload.onprogress=e=>{if("function"==typeof t){const n=Math.ceil(e.loaded/e.total*100);t(n)}},i.onloadend=()=>{if(0!==i.status)if(200!==i.status&&201!==i.status||!n){if(!r)throw new Error(i.response);try{r(JSON.parse(i.response))}catch(e){r(i.response)}}else try{n(JSON.parse(i.response))}catch(e){n(i.response)}},i.send(a),i}async createConversation(){try{"function"==typeof this.#d?.getConversationAuthToken&&(this.#l=await this.#d.getConversationAuthToken());const e=await W(`${this.#h("http")}${this.URLS.conversations?.href}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({externalId:this.#l?void 0:this.#c,token:this.#l})}),t=await e.json(),{conversation:n}=t,r={...n};return this.setAccessToken(n.accessToken),this.#f(t),this.URLS.conversation&&this.setConversationUrl(this.URLS.conversation),this.locale=n.context.userLocale,this.userResponded=n.userResponded,this.#p=n.status,r}catch(e){if(e.status>=500)throw new x(e);if(400===e.status)throw new _(e);if(404===e.status)throw new b(e);throw e}}async getConfig(){try{const e={channelName:this.#d.context.channelName,contentLocale:this.#d.context.contentLocale,environment:!0===this.#d.sendEnvironment?this.getEnvironment():this.#d.sendEnvironment,userLocale:this.#d.context.userLocale,variables:this.#d.context.variables},t=await W(`${this.#h("http")}${this.URLS.config?.href}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e})}),n=await t.json();return this.#f(n),this.configReady=!0,n.config}catch(e){if(404===e.status)throw new b(e);if(e.status>=500)throw new x(e);throw e}}async fetchConversation(){if(!this.hasConversation())return null;try{const e=await W(`${this.#h("http")}${this.getConversationUrl()}`,{method:"GET",headers:{Authorization:`Bearer ${this.getAccessToken()}`}}),t=await e.json();return this.#p=t.conversation.status,this.#f(t),t.conversation}catch(e){if(401===e.status)throw new _(e);if(404===e.status)throw new w(e);if(e.status>=500)throw new x(e);throw e}}async getConversation(){return this.hasConversation()?this.fetchConversation():null}async getConversationIntitialState(){return this.fetchConversation()}async disconnect(){this.conversation?.disconnect&&this.conversation.disconnect(),this.connected=!1,this.configReady=!1}async connect(){this.connected=!1;const e=this.hasConversation()?void 0:await this.createConversation();return this.URLS.socket&&(this.conversation.connect(`${this.#h("ws")}${this.URLS.socket.href}`,this.#d.context.channelName||"",this.getChannelTopic(),this.getAccessToken()),this.conversation.onConnection((({connected:e,ready:t})=>{this.connected=e,this.#s=t})),this.send("context",this.#y())),e}send(e,t=void 0){this.connected&&this.#s?(K("[SEND]",e,t),this.conversation.pushToChannel(e,function(e,t){if("message"!==e)return t;const{type:n,body:r}=t;let{transactionId:a}=t;return a||(a=G()),{type:n,body:r,transactionId:a}}(e,t))):this.conversation?.onConnection((({connected:n,ready:r})=>(this.connected=n,this.#s=r,!!r&&(this.send(e,t),!0))))}sendContext(e){const t=this.getContext(e);t&&this.send("context",t)}#y(){const e=!0===this.#d.sendEnvironment?this.getEnvironment():void 0,t="string"==typeof this.#d.context?.source?this.#d.context?.source:void 0,n=this.#d.context?.variables;return{contentLocale:"started"!==this.#p?this.#d.context?.contentLocale:void 0,environment:e,source:t,userLocale:"started"!==this.#p?this.#d.context?.userLocale:void 0,variables:n}}#m(e,t){e.source||t==this.#d.context?.userLocale||(e.source=F)}getEnvironment(){return{clientName:"@seamly/web-ui",clientVariant:this.#u,clientVersion:"24.2.1",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:q(),userAgent:navigator.userAgent,preferredLocale:navigator.language}}}function X(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 Y=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Z=()=>Math.random().toString(36).substring(7).split("").join("."),Q={INIT:`@@redux/INIT${Z()}`,REPLACE:`@@redux/REPLACE${Z()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Z()}`};function ee(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function te(e,t,n){if("function"!=typeof e)throw new Error(X(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(X(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(X(1));return n(te)(e,t)}let r=e,a=t,i=new Map,o=i,s=0,c=!1;function l(){o===i&&(o=new Map,i.forEach(((e,t)=>{o.set(t,e)})))}function u(){if(c)throw new Error(X(3));return a}function d(e){if("function"!=typeof e)throw new Error(X(4));if(c)throw new Error(X(5));let t=!0;l();const n=s++;return o.set(n,e),function(){if(t){if(c)throw new Error(X(6));t=!1,l(),o.delete(n),i=null}}}function p(e){if(!ee(e))throw new Error(X(7));if(void 0===e.type)throw new Error(X(8));if("string"!=typeof e.type)throw new Error(X(17));if(c)throw new Error(X(9));try{c=!0,a=r(a,e)}finally{c=!1}return(i=o).forEach((e=>{e()})),e}return p({type:Q.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(X(10));r=e,p({type:Q.REPLACE})},[Y]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(X(11));function n(){const e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[Y](){return this}}}}}function ne(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const a=t[r];"function"==typeof e[a]&&(n[a]=e[a])}const r=Object.keys(n);let a;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:Q.INIT}))throw new Error(X(12));if(void 0===n(void 0,{type:Q.PROBE_UNKNOWN_ACTION()}))throw new Error(X(13))}))}(n)}catch(e){a=e}return function(e={},t){if(a)throw a;let i=!1;const o={};for(let a=0;a<r.length;a++){const s=r[a],c=n[s],l=e[s],u=c(l,t);if(void 0===u)throw t&&t.type,new Error(X(14));o[s]=u,i=i||u!==l}return i=i||r.length!==Object.keys(e).length,i?o:e}}function re(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function ae(e){return({dispatch:t,getState:n})=>r=>a=>"function"==typeof a?a(t,n,e):r(a)}var ie=ae(),oe=ae,se=Symbol.for("immer-nothing"),ce=Symbol.for("immer-draftable"),le=Symbol.for("immer-state");function ue(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var de=Object.getPrototypeOf;function pe(e){return!!e&&!!e[le]}function fe(e){return!!e&&(me(e)||Array.isArray(e)||!!e[ce]||!!e.constructor?.[ce]||xe(e)||we(e))}var he=Object.prototype.constructor.toString();function me(e){if(!e||"object"!=typeof e)return!1;const t=de(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===he}function ye(e,t){0===ge(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function ge(e){const t=e[le];return t?t.type_:Array.isArray(e)?1:xe(e)?2:we(e)?3:0}function ve(e,t){return 2===ge(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function be(e,t,n){const r=ge(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function xe(e){return e instanceof Map}function we(e){return e instanceof Set}function _e(e){return e.copy_||e.base_}function Ce(e,t){if(xe(e))return new Map(e);if(we(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=me(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[le];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const a=n[r],i=t[a];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[a]})}return Object.create(de(e),t)}{const t=de(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function Se(e,t=!1){return je(e)||pe(e)||!fe(e)||(ge(e)>1&&(e.set=e.add=e.clear=e.delete=Ee),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Se(t,!0)))),e}function Ee(){ue(2)}function je(e){return Object.isFrozen(e)}var Te,Ie={};function Ne(e){const t=Ie[e];return t||ue(0),t}function Le(){return Te}function ke(e,t){t&&(Ne("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Me(e){Ae(e),e.drafts_.forEach(Pe),e.drafts_=null}function Ae(e){e===Te&&(Te=e.parent_)}function Oe(e){return Te={drafts_:[],parent_:Te,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Pe(e){const t=e[le];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Re(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[le].modified_&&(Me(t),ue(4)),fe(e)&&(e=De(t,e),t.parent_||Fe(t,e)),t.patches_&&Ne("Patches").generateReplacementPatches_(n[le].base_,e,t.patches_,t.inversePatches_)):e=De(t,n,[]),Me(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==se?e:void 0}function De(e,t,n){if(je(t))return t;const r=t[le];if(!r)return ye(t,((a,i)=>ze(e,r,t,a,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return Fe(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let a=t,i=!1;3===r.type_&&(a=new Set(t),t.clear(),i=!0),ye(a,((a,o)=>ze(e,r,t,a,o,n,i))),Fe(e,t,!1),n&&e.patches_&&Ne("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function ze(e,t,n,r,a,i,o){if(pe(a)){const o=De(e,a,i&&t&&3!==t.type_&&!ve(t.assigned_,r)?i.concat(r):void 0);if(be(n,r,o),!pe(o))return;e.canAutoFreeze_=!1}else o&&n.add(a);if(fe(a)&&!je(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;De(e,a),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||Fe(e,a)}}function Fe(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Se(t,n)}var Ue={get(e,t){if(t===le)return e;const n=_e(e);if(!ve(n,t))return function(e,t,n){const r=$e(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!fe(r)?r:r===He(e.base_,t)?(Ge(e),e.copy_[t]=We(r,e)):r},has:(e,t)=>t in _e(e),ownKeys:e=>Reflect.ownKeys(_e(e)),set(e,t,n){const r=$e(_e(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=He(_e(e),t),o=r?.[le];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((a=n)===(i=r)?0!==a||1/a==1/i:a!=a&&i!=i)&&(void 0!==n||ve(e.base_,t)))return!0;Ge(e),Ve(e)}var a,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==He(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Ge(e),Ve(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=_e(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){ue(11)},getPrototypeOf:e=>de(e.base_),setPrototypeOf(){ue(12)}},Be={};function He(e,t){const n=e[le];return(n?_e(n):e)[t]}function $e(e,t){if(!(t in e))return;let n=de(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=de(n)}}function Ve(e){e.modified_||(e.modified_=!0,e.parent_&&Ve(e.parent_))}function Ge(e){e.copy_||(e.copy_=Ce(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function We(e,t){const n=xe(e)?Ne("MapSet").proxyMap_(e,t):we(e)?Ne("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Le(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=r,i=Ue;n&&(a=[r],i=Be);const{revoke:o,proxy:s}=Proxy.revocable(a,i);return r.draft_=s,r.revoke_=o,s}(e,t);return(t?t.scope_:Le()).drafts_.push(n),n}function qe(e){if(!fe(e)||je(e))return e;const t=e[le];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ce(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Ce(e,!0);return ye(n,((e,t)=>{be(n,e,qe(t))})),t&&(t.finalized_=!1),n}ye(Ue,((e,t)=>{Be[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Be.deleteProperty=function(e,t){return Be.set.call(this,e,t,void 0)},Be.set=function(e,t,n){return Ue.set.call(this,e[0],t,n,e[0])};var Ke=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...a){return r.produce(e,(e=>t.call(this,e,...a)))}}let r;if("function"!=typeof t&&ue(6),void 0!==n&&"function"!=typeof n&&ue(7),fe(e)){const a=Oe(this),i=We(e,void 0);let o=!0;try{r=t(i),o=!1}finally{o?Me(a):Ae(a)}return ke(a,n),Re(r,a)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===se&&(r=void 0),this.autoFreeze_&&Se(r,!0),n){const t=[],a=[];Ne("Patches").generateReplacementPatches_(e,r,t,a),n(t,a)}return r}ue(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){var t;fe(e)||ue(8),pe(e)&&(pe(t=e)||ue(10),e=qe(t));const n=Oe(this),r=We(e,void 0);return r[le].isManual_=!0,Ae(n),r}finishDraft(e,t){const n=e&&e[le];n&&n.isManual_||ue(9);const{scope_:r}=n;return ke(r,t),Re(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Ne("Patches").applyPatches_;return pe(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},Je=Ke.produce;Ke.produceWithPatches.bind(Ke),Ke.setAutoFreeze.bind(Ke),Ke.setUseStrictShallowCopy.bind(Ke),Ke.applyPatches.bind(Ke),Ke.createDraft.bind(Ke),Ke.finishDraft.bind(Ke);var Xe="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?re:re.apply(null,arguments)},Ye=("undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function Ze(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(xt(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return ee(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var Qe=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function et(e){return fe(e)?Je(e,(()=>{})):e}function tt(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var nt=e=>t=>{setTimeout(t,e)};function rt(e){const t=function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:a=!0}=e??{};let i=new Qe;return t&&("boolean"==typeof t?i.push(ie):i.push(oe(t.extraArgument))),i},{reducer:n,middleware:r,devTools:a=!0,preloadedState:i,enhancers:o}=e||{};let s,c;if("function"==typeof n)s=n;else{if(!ee(n))throw new Error(xt(1));s=ne(n)}c="function"==typeof r?r(t):t();let l=re;a&&(l=Xe({trace:!1,..."object"==typeof a&&a}));const u=function(...e){return t=>(n,r)=>{const a=t(n,r);let i=()=>{throw new Error(X(15))};const o={getState:a.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map((e=>e(o)));return i=re(...s)(a.dispatch),{...a,dispatch:i}}}(...c),d=(e=>function(t){const{autoBatch:n=!0}=t??{};let r=new Qe(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let a=!0,i=!1,o=!1;const s=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:nt(10):"callback"===e.type?e.queueNotification:nt(e.timeout),l=()=>{o=!1,i&&(i=!1,s.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>a&&e()));return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return a=!e?.meta?.RTK_autoBatch,i=!a,i&&(o||(o=!0,c(l))),r.dispatch(e)}finally{a=!0}}})})("object"==typeof n?n:void 0)),r})(u);return te(s,i,l(..."function"==typeof o?o(d):d()))}function at(e){const t={},n=[];let r;const a={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(xt(28));if(r in t)throw new Error(xt(29));return t[r]=n,a},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),a),addDefaultCase:e=>(r=e,a)};return e(a),[t,n,r]}function it(...e){return t=>e.some((e=>((e,t)=>Ye(e)?e.match(t):e(t))(e,t)))}var ot=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},st=["name","message","stack","code"],ct=class{constructor(e,t){this.payload=e,this.meta=t}_type},lt=class{constructor(e,t){this.payload=e,this.meta=t}_type},ut=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of st)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},dt=(()=>{function e(e,t,n){const r=Ze(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}}))),a=Ze(e+"/pending",((e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}}))),i=Ze(e+"/rejected",((e,t,r,a,i)=>({payload:a,error:(n&&n.serializeError||ut)(e||"Rejected"),meta:{...i||{},arg:r,requestId:t,rejectedWithValue:!!a,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(o,s,c)=>{const l=n?.idGenerator?n.idGenerator(e):ot(),u=new AbortController;let d,p;function f(e){p=e,u.abort()}const h=async function(){let h;try{let i=n?.condition?.(e,{getState:s,extra:c});if(null!==(m=i)&&"object"==typeof m&&"function"==typeof m.then&&(i=await i),!1===i||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const y=new Promise(((e,t)=>{d=()=>{t({name:"AbortError",message:p||"Aborted"})},u.signal.addEventListener("abort",d)}));o(a(l,e,n?.getPendingMeta?.({requestId:l,arg:e},{getState:s,extra:c}))),h=await Promise.race([y,Promise.resolve(t(e,{dispatch:o,getState:s,extra:c,requestId:l,signal:u.signal,abort:f,rejectWithValue:(e,t)=>new ct(e,t),fulfillWithValue:(e,t)=>new lt(e,t)})).then((t=>{if(t instanceof ct)throw t;return t instanceof lt?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){h=t instanceof ct?i(null,l,e,t.payload,t.meta):i(t,l,e)}finally{d&&u.signal.removeEventListener("abort",d)}var m;return n&&!n.dispatchConditionRejection&&i.match(h)&&h.meta.condition||o(h),h}();return Object.assign(h,{abort:f,requestId:l,arg:e,unwrap:()=>h.then(pt)})}}),{pending:a,rejected:i,fulfilled:r,settled:it(i,r),typePrefix:e})}return e.withTypes=()=>e,e})();function pt(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var ft=Symbol.for("rtk-slice-createasyncthunk");function ht(e,t){return`${e}/${t}`}function mt({creators:e}={}){const t=e?.asyncThunk?.[ft];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(xt(11));const a=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},i=Object.keys(a),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(xt(12));if(n in o.sliceCaseReducersByType)throw new Error(xt(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher:(e,t)=>(o.sliceMatchers.push({matcher:e,reducer:t}),s),exposeAction:(e,t)=>(o.actionCreators[e]=t,s),exposeCaseReducer:(e,t)=>(o.sliceCaseReducersByName[e]=t,s)};function c(){const[t={},n=[],r]="function"==typeof e.extraReducers?at(e.extraReducers):[e.extraReducers],a={...t,...o.sliceCaseReducersByType};return function(e){let t,[i,s,c]=at((e=>{for(let t in a)e.addCase(t,a[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)}));if("function"==typeof e)t=()=>et(e());else{const n=et(e);t=()=>n}function l(e=t(),n){let r=[i[n.type],...s.filter((({matcher:e})=>e(n))).map((({reducer:e})=>e))];return 0===r.filter((e=>!!e)).length&&(r=[c]),r.reduce(((e,t)=>{if(t){if(pe(e)){const r=t(e,n);return void 0===r?e:r}if(fe(e))return Je(e,(e=>t(e,n)));{const r=t(e,n);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e}),e)}return l.getInitialState=t,l}(e.initialState)}i.forEach((r=>{const i=a[r],o={reducerName:r,type:ht(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:n},r,a){let i,o;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(xt(17));i=r.reducer,o=r.prepare}else i=r;a.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,o?Ze(e,o):Ze(e))}(o,i,s):function({type:e,reducerName:t},n,r,a){if(!a)throw new Error(xt(18));const{payloadCreator:i,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=a(e,i,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||vt,pending:s||vt,rejected:c||vt,settled:l||vt})}(o,i,s,t)}));const l=e=>e,u=new Map;let d;function p(e,t){return d||(d=c()),d(e,t)}function f(){return d||(d=c()),d.getInitialState()}function h(t,n=!1){function r(e){let r=e[t];return void 0===r&&n&&(r=f()),r}function a(t=l){const r=tt(u,n,(()=>new WeakMap));return tt(r,t,(()=>{const r={};for(const[a,i]of Object.entries(e.selectors??{}))r[a]=yt(i,t,f,n);return r}))}return{reducerPath:t,getSelectors:a,get selectors(){return a(r)},selectSlice:r}}const m={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:f,...h(r),injectInto(e,{reducerPath:t,...n}={}){const a=t??r;return e.inject({reducerPath:a,reducer:p},n),{...m,...h(a,!0)}}};return m}}function yt(e,t,n,r){function a(a,...i){let o=t(a);return void 0===o&&r&&(o=n()),e(o,...i)}return a.unwrapped=e,a}var gt=mt();function vt(){}var{assign:bt}=Object;function xt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}Symbol.for("rtk-state-proxy-original");class wt extends v{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}const _t=dt("initializeConfig",(async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{try{const{features:e,preChat:r,agentParticipant:a,defaultContentLocale:i,defaultUserLocale:o,userParticipant:s,startChatIcon:c}=await t.getConfig(),{connectWhenInView:l}=n;return{features:e,preChat:r,agentParticipant:a,userParticipant:s,startChatIcon:c,defaultUserLocale:n?.context?.userLocale||o,defaultContentLocale:n?.context?.contentLocale||i,connectWhenInView:l}}catch(e){return r(e)}})),Ct=dt("resetConfig",(async(e,{extra:{config:t}})=>t));var St=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var Et="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function jt(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let a,i=0;function o(){let t=n;const{length:o}=arguments;for(let e=0,n=o;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t={s:0,v:void 0,o:null,p:null},e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t={s:0,v:void 0,o:null,p:null},e.set(n,t)):t=r}}const s=t;let c;if(1===t.s)c=t.v;else if(c=e.apply(null,arguments),i++,r){const e=a?.deref?.()??a;null!=e&&r(e,c)&&(c=e,0!==i&&i--),a="object"==typeof c&&null!==c||"function"==typeof c?new Et(c):c}return s.s=1,s.v=c,c}return o.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},o.resetResultsCount()},o.resultsCount=()=>i,o.resetResultsCount=()=>{i=0},o}function Tt(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,a=0,i={},o=e.pop();"object"==typeof o&&(i=o,o=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);const s={...n,...i},{memoize:c,memoizeOptions:l=[],argsMemoize:u=jt,argsMemoizeOptions:d=[],devModeChecks:p={}}=s,f=St(l),h=St(d),m=function(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const n=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),y=c((function(){return r++,o.apply(null,arguments)}),...f),g=u((function(){a++;const e=function(e,t){const n=[],{length:r}=e;for(let a=0;a<r;a++)n.push(e[a].apply(null,t));return n}(m,arguments);return t=y.apply(null,e),t}),...h);return Object.assign(g,{resultFunc:o,memoizedResultFunc:y,dependencies:m,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:c,argsMemoize:u})};return Object.assign(r,{withTypes:()=>r}),r}var It=Tt(jt),Nt=Object.assign(((e,t=It)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map((t=>e[t])),((...e)=>e.reduce(((e,t,r)=>(e[n[r]]=t,e)),{})))}),{withTypes:()=>Nt});const Lt=It((({app:e})=>e),(({userHasResponded:e})=>e)),kt="visibility",Mt={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},At=It((({config:e})=>e),(e=>{let t={visible:"inline"===e?.layoutMode?Mt.open:Mt.minimized,appContainerClassNames:e?.appContainerClassNames||[],...e};return"function"==typeof t.appContainerClassNames&&(t={...t,appContainerClassNames:t.appContainerClassNames(t)}),t})),Ot=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:a,layoutMode:i,hideOnNoUserResponse:o}=r,{visible:s}=a||{};return"app"!==i||t?"window"===i&&o&&n!==Mt.open?e?n||t||Mt.open:Mt.hidden:"inline"===i&&e&&!n?t||Mt.open:n||t||s||Mt.minimized:Mt.open};var Pt=n(7402),Rt=n(8418),Dt=Pt.default,zt=Symbol.for("react-redux-context"),Ft="undefined"!=typeof globalThis?globalThis:{};function Ut(){if(!Dt.createContext)return{};const e=Ft[zt]??(Ft[zt]=new Map);let t=e.get(Dt.createContext);return t||(t=Dt.createContext(null),e.set(Dt.createContext,t)),t}var Bt=Ut();function Ht(e=Bt){return function(){return Dt.useContext(e)}}var $t=Ht(),Vt=()=>{throw new Error("uSES not initialized!")},Gt=(e,t)=>e===t;function Wt(e=Bt){const t=e===Bt?$t:Ht(e),n=(e,n={})=>{const{equalityFn:r=Gt,devModeChecks:a={}}="function"==typeof n?{equalityFn:n}:n,{store:i,subscription:o,getServerState:s,stabilityCheck:c,identityFunctionCheck:l}=t(),u=(Dt.useRef(!0),Dt.useCallback({[e.name]:t=>e(t)}[e.name],[e,c,a.stabilityCheck])),d=Vt(o.addNestedSub,i.getState,s||i.getState,u,r);return Dt.useDebugValue(d),d};return Object.assign(n,{withTypes:()=>n}),n}var qt=Wt();Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen"),Symbol.for("react.client.reference");var Kt={notify(){},get:()=>[]};var Jt=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Xt="undefined"!=typeof navigator&&"ReactNative"===navigator.product,Yt=Jt||Xt?Dt.useLayoutEffect:Dt.useEffect;Object.defineProperty,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var Zt=function({store:e,context:t,children:n,serverState:r,stabilityCheck:a="once",identityFunctionCheck:i="once"}){const o=Dt.useMemo((()=>{const t=function(e,t){let n,r=Kt,a=0,i=!1;function o(){l.onStateChange&&l.onStateChange()}function s(){a++,n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){let e=null,t=null;return{clear(){e=null,t=null},notify(){(()=>{let t=e;for(;t;)t.callback(),t=t.next})()},get(){const t=[];let n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0;const a=t={callback:n,next:null,prev:t};return a.prev?a.prev.next=a:e=a,function(){r&&null!==e&&(r=!1,a.next?a.next.prev=a.prev:t=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}())}function c(){a--,n&&0===a&&(n(),n=void 0,r.clear(),r=Kt)}const l={addNestedSub:function(e){s();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),c())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return i},trySubscribe:function(){i||(i=!0,s())},tryUnsubscribe:function(){i&&(i=!1,c())},getListeners:()=>r};return l}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0,stabilityCheck:a,identityFunctionCheck:i}}),[e,r,a,i]),s=Dt.useMemo((()=>e.getState()),[e]);Yt((()=>{const{subscription:t}=o;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),s!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[o,s]);const c=t||Bt;return Dt.createElement(c.Provider,{value:o},n)};function Qt(e=Bt){const t=e===Bt?$t:Ht(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var en=Qt();function tn(e=Bt){const t=e===Bt?en:Qt(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var nn,rn=tn();nn=Rt.useSyncExternalStoreWithSelector,Vt=nn,Pt.useSyncExternalStore;const an=()=>qt(At),on=(e,t)=>{let n;return function(...r){let a=!1;return clearTimeout(n),n=setTimeout((()=>{n=null,a||e.apply(this,r),a=!1}),t),t=>{a=!0,t&&e.apply(this,r)}}},sn=e=>Math.ceil(e/1e3),cn=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},ln=(e,t=2)=>{if(0===e)return"0 Bytes";const n=t<0?0:t,r=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**r).toFixed(n))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`},un={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},dn={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},pn=e=>e.code?dn[e.code]:un[e.keyCode],fn=e=>{e&&e.focus()},hn=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};function mn(e){return"object"==typeof e}const yn=({state:e})=>e,gn=()=>qt(yn),vn=It(yn,At,Lt,(({events:e,serviceData:t},n,r)=>{if(r||"inline"===n.layoutMode||!t?.suggestion||!t?.suggestion?.body?.length)return e;const a={type:"service_data",payload:t.suggestion};return[...e,a]})),bn=It(vn,At,((e,t)=>{const{enabled:n,threshold:r}=t?.messages?.timeIndicator??{};return n?e.map((({type:e,payload:t},n,a)=>{if(0===n)return{type:e,payload:{...t,timeIndicator:t?.occurredAt}};const i=a[n-1];if(!t?.occurredAt||!i.payload?.occurredAt||!r)return{type:e,payload:{...t,timeIndicator:void 0}};const o=sn(t.occurredAt-i.payload.occurredAt)>=r?t.occurredAt:void 0;return{type:e,payload:{...t,timeIndicator:o}}})):e})),xn=()=>qt(bn),wn=(It(bn,(e=>e.map((e=>e.payload.id)))),()=>gn().isLoading),_n=()=>gn().unreadEvents,Cn=()=>gn().skiplinkTargetId,Sn=()=>gn().serviceInfo,En=It(bn,(e=>{const t=e.filter((e=>"message"===e.type));return t[t.length-1]?.payload.id})),jn=()=>{const{participants:e,currentAgent:t}=gn().participantInfo;return t?e[t]:null},Tn=()=>{const{layoutMode:e}=an();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},In=It((({visibility:e})=>e),(e=>e.visibility)),Nn=It((({visibility:e})=>e),(e=>e.showInlineView)),Ln=It((({visibility:e})=>e),(e=>e.setInputFocus)),kn=[Mt.open,Mt.minimized,Mt.hidden],Mn=dt("setVisibility",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const a=t(),i=e.visibility,o=In(a),s=Lt(a),c=n.hasConversation(),l=At(a),{visibilityCallback:u=Ot,layoutMode:d}=l,{unreadEvents:p}=yn(a),f=u({hasResponded:s,previousVisibility:o,requestedVisibility:i,config:l});if(f&&!kn.includes(f))return console.error('The visibilityCallback function should return "open", "minimized" or "hidden".'),{visibility:null,setInputFocus:e.setInputFocus};if(o===f)return{visibility:null,setInputFocus:e.setInputFocus};const h=n.store.get(kt);return n.store.set(kt,{...h||{},[d]:i}),i&&r.emit("ui.visible",i,{visibility:i,hasConversation:c,hasResponded:s,unreadMessageCount:p}),{visibility:f,setInputFocus:e.setInputFocus}})),An=dt("initialize",(async(e,{dispatch:t,getState:n,extra:{api:r}})=>{const{layoutMode:a}=At(n()),i=r.store.get(kt)?.[a]||Mt.initialize;return t(Mn({visibility:i})),i})),On=dt("initializeApp",(async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{const a=n?.context?.contentLocale,i=n?.context?.userLocale;try{return t.hasConversation()?{initialState:await t.getConversationIntitialState(),contentLocale:a,userLocale:i,config:n}:(n?.context?.topic&&t.send("action",{type:P,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),{initialState:void 0,contentLocale:a,userLocale:i,config:n})}catch(e){if(e instanceof w){const e=new w;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new wt;return r({name:t.name,message:t.message,langKey:t.langKey})}})),Pn=((e,t,n)=>{const{wait:r=300,maxWait:a=0,leading:i=!1}=n??{};let o,s=null,c=null;const l=()=>{c&&clearTimeout(c),c=void 0,o&&(o(!0),o=void 0)};return dt(e,t,{condition:()=>{const e=i&&!s;return s&&clearTimeout(s),s=setTimeout((()=>{l(),s=null}),r),!!e||(o&&(o(!1),o=void 0),a&&!c&&(c=setTimeout(l,a)),new Promise((e=>{o=e})))}})})("resetApp",(async(e,{dispatch:t,extra:{api:n}})=>{await n.disconnect(),n.clearStore(),t(Ct()),await t(_t()),await t(On()),t(An())}),{wait:2e3,leading:!0}),Rn="cvco",Dn=["hideOnNoUserResponse","connectWhenInView","showDisclaimer","showSuggestions","continueChat","preChat","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon","notificationAudioURL"],zn=(e,t)=>{const{messages:n,...r}=(a=t,Dn.reduce(((e,t)=>(t in a&&(e[t]=a[t]),e)),{}));var a;let i=e;return Object.keys(r).length>0&&(i={...i,...r}),n&&(i={...i,messages:{...i.messages,...n}}),i},Fn=gt({name:"config",initialState:{namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}},api:{domain:"",key:"",secure:!0,sendEnvironment:!0},context:{},notificationAudioURL:void 0,hideOnNoUserResponse:!1,connectWhenInView:!0,showDisclaimer:!1,showSuggestions:!0,preChat:{enterDelay:1e3,exitAfter:4e3},continueChat:{enterDelay:0,exitAfter:2e3},customComponents:{},defaults:{visible:null},preChatEvents:[],parentElement:void 0,layoutMode:"window"},reducers:{setConfig:(e,{payload:t})=>zn(e,t),updateConfig:(e,{payload:t})=>zn(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(Ct.fulfilled,(e=>e)).addCase(_t.fulfilled,((e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:a,defaultContentLocale:i,defaultUserLocale:o}})=>{e.preChatEvents=t.map((e=>({type:"message",payload:e}))),e.context.contentLocale=i,e.context.userLocale=o,e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=a||""}))}}),{setConfig:Un,updateConfig:Bn,setPreChatEvents:Hn}=Fn.actions,$n=Fn.reducer,Vn={userHasResponded:!1},Gn=gt({name:"app",initialState:Vn,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(Pn.pending,(()=>Vn)).addCase(On.fulfilled,((e,{payload:t})=>{t.initialState&&"userResponded"in t.initialState&&(e.userHasResponded=t.initialState.userResponded||!1)}))}}),{setHasResponded:Wn}=Gn.actions,qn=Gn.reducer;class Kn extends v{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const Jn={SeamlyGeneralError:x,SeamlyConfigurationError:b,SeamlySessionExpiredError:w,SeamlyOfflineError:Kn,SeamlyUnauthorizedError:_,SeamlyUnavailableError:wt},Xn=Ze("catch-error",(e=>({payload:e}))),Yn={controls:{}},Zn={touched:!1},Qn={controls:Zn},er=gt({name:"forms",initialState:Qn,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{const r=t?e[n]??{...Yn,persistData:t}:{...Yn,persistData:t};e[n]=r},deregisterForm:(e,{payload:{formId:t}})=>(e[t]?.persistData||delete e[t],e),registerControl:(e,{payload:{name:t,formId:n}})=>{e[n].controls={[t]:Zn}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const a={...r.controls};return delete a[t],{...e,[n]:{...r,controls:a}}},updateControlValue:(e,{payload:{formId:t,name:n,value:r}})=>{e[t]?.controls&&(e[t].controls[n].value=r)},updateControlTouched:(e,{payload:{formId:t,name:n,touched:r}})=>{e[t]?.controls[n]&&(e[t].controls[n].touched=r)}},extraReducers:e=>{e.addCase(Pn.pending,(()=>Qn))}}),{registerForm:tr,deregisterForm:nr,registerControl:rr,deregisterControl:ar,updateControlValue:ir,updateControlTouched:or}=er.actions,sr=er.reducer,cr=dt("setLocale",(async(e,{extra:{api:t},rejectWithValue:n})=>{try{return{translations:await t.getTranslations(e),userLocale:e}}catch(e){return n(e)}}),{condition:(e,{getState:t})=>{const{i18n:{isLoading:n,userLocale:r}}=t();return e!==r&&!n}}),lr={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,userLocale:void 0},ur=gt({name:"app",initialState:lr,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(Pn.pending,(()=>lr)).addCase(_t.fulfilled,((e,{payload:t})=>{e.initialLocale=t.defaultUserLocale})).addCase(cr.pending,(e=>{e.isLoading=!0})).addCase(cr.rejected,(e=>{e.isLoading=!1})).addCase(cr.fulfilled,((e,{payload:t})=>{e.isLoading=!1,t?.translations&&(e.userLocale=t.userLocale,e.translations=Object.keys(t.translations).sort().reduce(((e,n)=>{if(!t.translations)return e;const r=t.translations[n];return e[n]=r,e}),{}))}))}}),{setInitialLocale:dr,setTranslations:pr}=ur.actions,fr=ur.reducer,hr=dt("getConversation",(async(e,{extra:{api:t},rejectWithValue:n})=>{try{const e=await t.getConversation();if(!e)throw new Error("No conversation found");return e}catch(e){return n({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError})}}),{condition(e,{getState:t}){const{state:{events:n}}=t(),r=n.at(-1);return r&&("lastEvent"in e?e?.lastEvent?.id:e?.body?.lastEvent?.id)!==r.payload.id}}),mr={error:void 0},yr=gt({name:"interrupt",initialState:mr,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>mr},extraReducers:e=>{e.addCase(_t.pending,(()=>mr)).addMatcher(it(On.rejected,_t.rejected,cr.rejected,Mn.rejected,An.rejected,hr.rejected),((e,{payload:t})=>{e.error=t}))}}),{setInterrupt:gr,clearInterrupt:vr}=yr.actions,br=yr.reducer,xr=["SeamlyGeneralError","SeamlyConfigurationError","SeamlySessionExpiredError","SeamlyOfflineError","SeamlyUnauthorizedError","SeamlyUnavailableError"],wr=({type:e,payload:t})=>"hidden"===document.visibilityState||e===S&&!t.fromClient||"info"===e&&t.type===E,_r=e=>e.sort((({payload:{occurredAt:e=0}},{payload:{occurredAt:t=0}})=>e-t)),Cr=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:a,name:i,introduction:o}=t.participant,s=n[r],c={...n,[r]:s?{...s,...a?{avatar:a}:{},...i?{name:i}:{},...o?{introduction:o}:{}}:t.participant};return{...e,participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r}},Sr=(e,t)=>{const n="message"===t?.type?t?.payload.translatedEntry||t?.payload.entry:{options:void 0,type:void 0},{blockAutoEntrySwitch:r}=e,a=t?.payload?.actions||{},i=t?.payload?.translatedActions||{};if(!n)return{...e,actions:a,optionsOverride:{},translatedActions:i};const{type:o,options:s}=n||{};let c=e.active;return r||o===e.userSelected||(c=o),{...e,active:c,optionsOverride:{...e.optionsOverride||{},...o?{[o]:s}:{}},actions:a,translatedActions:i}},Er={events:[],isLastEventFromClient:!1,initialState:{userResponded:!1,context:{contentLocale:"",translationActive:!1,userLocale:""}},unreadEvents:0,userHasResponded:!1,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1,remaining:void 0,wasStopped:void 0,count:void 0,timer:void 0},resumeConversationPrompt:!1,serviceInfo:{activeServiceSessionId:"",proactiveMessages:!1},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:null,subTitle:""},historyLoaded:!1,skiplinkTargetId:G(),optionsButtonId:G(),headerCollapseButtonId:G(),serviceData:{},options:{features:{webNotifications:{enabled:!1}},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],processingFileUploads:[],entryMeta:{default:j,optionsOverride:{},defaultEntry:j,active:j,userSelected:null,blockAutoEntrySwitch:!1,options:{},actions:{},translatedActions:{}},seamlyContainerElement:null},jr=gt({name:"store",initialState:Er,reducers:{addEvent:(e,t)=>{const{type:n,payload:r}=t.payload,a=e.options.features.hasOwnProperty($);let i={...e.options};if(a&&(n===S||"participant"===n)&&!r.fromClient){const e="message"===n?r.entry?.type:void 0;i={...i,features:{...i.features,uploads:{enabled:i.features.uploads?.enabled||!1,...i.features?.uploads||{},enabledFromEntry:e===T}}}}const o=wr(t.payload);if(!e.events.find((e=>e.payload.id===r.id))){if(!e.events.find((e=>"transactionId"in e.payload&&"transactionId"in r&&e.payload.transactionId===r.transactionId&&(!t.payload.type||e.type===t.payload.type)&&r.fromClient))){const s=Sr(e.entryMeta,t.payload);e.entryMeta=a||s.active!==T?s:{...e.entryMeta},e.options=i,o&&(e.unreadEvents+=1,"service_data"!==n&&(t.payload.payload.messageStatus=r.fromClient?N:I)),t.payload.payload.key=G(),e.events.push(t.payload),e.events=_r(e.events)}r.fromClient&&(e.isLastEventFromClient=r.fromClient)}},updateEvent:(e,{payload:t})=>{const n=e.events.find((e=>"service_data"!==e.type&&"service_data"!==t.type&&e.payload.transactionId===t.payload.transactionId));n?(n.payload.id=t.payload.id,n.payload.occurredAt=t.payload.occurredAt):e.events.push(t),e.events=_r(e.events)},clearEvents:e=>{e.unreadEvents=0,e.loadedImageEventIds=[],e.events=[]},setEventsRead:(e,{payload:t})=>{e.unreadEvents=0,e.events.forEach((e=>(e.payload.id&&-1!==t.indexOf(e.payload.id)&&(e.payload={...e.payload,..."service_data"!==e.type&&e.payload.messageStatus===I&&{messageStatus:N}}),e)))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setEvents:(e,{payload:{messages:t,unreadMessageCount:n,userResponded:r,participants:a,service:i,serviceData:o,ui:s}})=>{const c=((e,t)=>{const n=e.filter((e=>"message"===e.type&&!e.payload.optimisticallyInjected&&!t.some((t=>t.payload?.id===e.payload.id)))),r=t.filter((({type:e,payload:t})=>!("participant"===e&&!t?.participant?.introduction))).reverse();return _r([...r,...n])})(e.events,t),l=Object.fromEntries(Object.entries(a).map((([e,t])=>[t.id,t]))),u=c.find((e=>"participant"===e.type)),d=u?.payload.participant?.id,{entry:p}=i?.settings||{},f=Sr({...e.entryMeta,...p,active:p?.default||E,options:{...p?.options?p.options:{}}},c[c.length-1]),h={...e.options.features},m=h.hasOwnProperty($);e.unreadEvents=n,e.userHasResponded=r,e.events=c.filter((e=>"participant"!==e.type||!!e.payload.participant?.introduction)),e.participantInfo={...e.participantInfo,...d?Cr(e.participantInfo,{participant:l[d]}):{},participants:l},e.historyLoaded=!0,e.serviceInfo={...e.serviceInfo,proactiveMessages:i?.settings?.proactiveMessages?.enabled||!1,activeServiceSessionId:i?.sessionId},e.serviceData={...e.serviceData,...o},e.options={...e.options,features:h},e.entryMeta=m||f.active!==T?f:{...e.entryMeta},e.resumeConversationPrompt=s.resumeConversationPrompt||!1,d&&(e.headerTitles.subTitle=l[d]?.name)},setIsLoading:(e,{payload:t})=>{e.isLoading=t},initIdleDetachCountdown:(e,{payload:t})=>{const{delaySeconds:n,delayTime:r}=t;e.idleDetachCountdown={hasCountdown:!0,isActive:!0,wasStopped:!1,count:n,remaining:n,timer:r}},decrementIdleDetachCountdownCounter:e=>{const{idleDetachCountdown:t}=e,{remaining:n=0}=t,r=n-1;e.idleDetachCountdown.remaining=r,e.idleDetachCountdown.timer=cn(r)},stopIdleDetachCountdownCounter:e=>{e.idleDetachCountdown.isActive=!1,e.idleDetachCountdown.wasStopped=!0},clearIdleDetachCountdown:e=>{e.idleDetachCountdown.hasCountdown=!1,e.idleDetachCountdown.isActive=!1},initResumeConversationPrompt:e=>{e.resumeConversationPrompt=!0},clearResumeConversationPrompt:e=>{e.resumeConversationPrompt=!1},setParticipant:(e,{payload:t})=>{e.participantInfo=Cr(e.participantInfo,{participant:t.participant,fromClient:t.fromClient})},setActiveService:(e,{payload:t})=>{e.serviceInfo.activeServiceSessionId!==t&&(e.serviceInfo.activeServiceSessionId=t)},setHeaderTitle:(e,{payload:t})=>{e.headerTitles.title=t},setHeaderSubTitle:(e,{payload:t})=>{e.headerTitles.subTitle=t},setInitialState:(e,{payload:t})=>{e.initialState=t,e.unreadEvents=Er.unreadEvents},setServiceDataItem:(e,{payload:t})=>{e.serviceData[t.type]=t},setFeatures:(e,{payload:t})=>{t.features&&(e.options.features=t.features)},updateFeatures:(e,{payload:t})=>{Object.entries(t).forEach((([t,n])=>{e.options.features[t]=n}))},setFeatureEnabledState:(e,{payload:t})=>{e.options.features.hasOwnProperty(t.key)&&(e.options.features[t.key].enabled=t.enabled)},clearFeatures:e=>{e.options.features={webNotifications:e.options.features.webNotifications}},showOption:(e,{payload:t})=>{e.options.panelActive=!0,e.options.optionActive=t},hideOption:e=>{e.options.panelActive=!1,e.options.optionActive=""},setUserSelectedOptions:(e,{payload:t})=>{e.options.userSelectedOptions=t},setUserSelectedOption:(e,{payload:t})=>{const{option:n,value:r}=t;e.options.userSelectedOptions[n]=r},setBlockAutoEntrySwitch:(e,{payload:t})=>{e.entryMeta.blockAutoEntrySwitch=t},setServiceEntryMetadata:(e,{payload:t})=>{e.entryMeta.active=t.default,e.entryMeta.options=t.options||{},e.entryMeta.optionsOverride={},e.entryMeta.actions={},e.entryMeta.translatedActions={}},setActiveEntryType:(e,{payload:t})=>{e.entryMeta.active=t},setUserEntryType:(e,{payload:t})=>{e.entryMeta.userSelected=t},clearAbortTransaction:e=>{e.entryMeta.actions={}},registerUpload:(e,{payload:t})=>{e.currentUploads.push({id:t.fileId,name:t.fileName,progress:1,uploading:!0,complete:!1,error:"",uploadHandle:t.uploadHandle})},setUploadProgress:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?{...e,progress:t.progress,uploading:100!==t.progress,uploadHandle:100===t.progress?null:e.uploadHandle}:e))},startProcessingImage:(e,{payload:t})=>{e.processingFileUploads.push(t)},doneProcessingImage:(e,{payload:t})=>{e.processingFileUploads=e.processingFileUploads.filter((e=>e!==t))},setUploadError:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?{...e,error:t.errorText,progress:0,uploading:!1,uploadHandle:null}:e))},setUploadComplete:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t?{...e,complete:!0}:e))},clearAllUploads:e=>{e.currentUploads=[]},setSeamlyContainerElement:(e,{payload:t})=>{e.seamlyContainerElement=t},setProactiveMessages:(e,{payload:t})=>{e.serviceInfo.proactiveMessages=t}},extraReducers:e=>{e.addCase(Pn.pending,(()=>Er)).addCase(On.pending,(e=>{e.isLoading=!0})).addCase(_t.fulfilled,((e,{payload:t})=>{e.headerTitles.subTitle=t.agentParticipant?.name||"",t.features&&(e.options.features=t.features)})).addCase(On.fulfilled,((e,{payload:t,type:n})=>{if(e.isLoading=!1,!t.initialState)return;e.initialState=t.initialState,"messages"in t.initialState&&jr.caseReducers.setEvents(e,{payload:t.initialState,type:n});const{initialState:{service:r}}=t;r?.settings?.entry?.options?.upload&&jr.caseReducers.setFeatureEnabledState(e,{payload:{key:$,enabled:r.settings.entry.options.upload.enabled||!1},type:n})})).addMatcher(it(Rr,Dr),(e=>{e.isLastEventFromClient=!1}))}}),{addEvent:Tr,updateEvent:Ir,clearAllUploads:Nr,clearEvents:Lr,clearFeatures:kr,clearIdleDetachCountdown:Mr,clearResumeConversationPrompt:Ar,decrementIdleDetachCountdownCounter:Or,hideOption:Pr,initIdleDetachCountdown:Rr,initResumeConversationPrompt:Dr,registerUpload:zr,setActiveEntryType:Fr,setActiveService:Ur,setBlockAutoEntrySwitch:Br,setEventsRead:Hr,setFeatureEnabledState:$r,updateFeatures:Vr,setFeatures:Gr,setHeaderSubTitle:Wr,setHeaderTitle:qr,setEvents:Kr,setInitialState:Jr,setIsLoading:Xr,setLoadedImageEventIds:Yr,setParticipant:Zr,setSeamlyContainerElement:Qr,setServiceDataItem:ea,setServiceEntryMetadata:ta,clearAbortTransaction:na,setUploadComplete:ra,setUploadError:aa,setUploadProgress:ia,startProcessingImage:oa,doneProcessingImage:sa,setUserEntryType:ca,setUserSelectedOption:la,setUserSelectedOptions:ua,showOption:da,stopIdleDetachCountdownCounter:pa,setProactiveMessages:fa}=jr.actions,ha=jr.reducer,ma=({dispatch:e})=>t=>n=>{const r=t(n);if(_t.fulfilled.match(n)&&n.payload.defaultUserLocale)return e(cr(n.payload.defaultUserLocale)),r;if(On.fulfilled.match(n))return n.payload.userLocale&&e(cr(n.payload.userLocale)),r;if(Tr.match(n)&&"info"===n.payload.type&&n.payload.payload.body&&"subtype"in n.payload.payload.body&&"new_translation"===n.payload.payload.body.subtype){const{body:t}=n.payload.payload;if(t.translationLocale&&t.translationEnabled)return e(cr(t.translationLocale)),r}return r},ya={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:ot(),translatedEventGroups:{},translationProposal:null},ga=(e,t)=>{const n=[...e].reduce(((e,{payload:n,type:r},a,i)=>{if(e[t]&&n.id){if("info"===r&&"divider"===n?.type&&n?.body?.translationEnabled)return i.splice(0),e;e[t].push(n.id)}return n.id===t&&(e[t]=[]),e}),{}),[[r,a]]=Object.entries(n);return{lastGroupId:e.filter((e=>"divider"===e.payload?.type)).map((e=>e.payload.id)).at(-1),groupId:r,eventIds:a}},va=gt({name:"translation",initialState:ya,reducers:{enableTranslation:(e,{payload:t})=>{e.isActive=!0,e.currentLocale=t},disableTranslation:e=>{e.isActive=!1,e.currentLocale=void 0},enableEventsTranslation:(e,{payload:{events:t,id:n}})=>{delete e.translatedEventGroups[n];const{lastGroupId:r}=ga(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:a,eventIds:i}=ga(t,n);e.lastGroupId=r,e.translatedEventGroups[a]=i},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(Pn.pending,(()=>ya)).addCase(_t.fulfilled,((e,{payload:t})=>{const n=t?.features?.translation;n?.languages&&(e.isAvailable=!0===n.enabled,e.languages=[...n.languages].sort(((e,n)=>e.locale===t.defaultUserLocale?-1:n.locale===t.defaultUserLocale?1:e.nativeName?.localeCompare(n.nativeName||"",void 0,{sensitivity:"base"})||0)))})).addCase(cr.fulfilled,((e,{payload:t})=>{e.currentLocale=t.userLocale})).addCase(Tr,((e,{payload:t})=>{t.payload.id&&e.lastGroupId&&e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)})).addCase(Kr,((e,{payload:t})=>{e.translationProposal=t?.ui?.translationProposal})).addCase(On.fulfilled,((e,{payload:t})=>{e.translationProposal=t.initialState?.ui?.translationProposal}))}}),{enableTranslation:ba,disableTranslation:xa,enableEventsTranslation:wa,disableEventsTranslation:_a,setTranslationProposalPrompt:Ca,disableTranslationProposalPrompt:Sa}=va.actions,Ea=va.reducer,ja=gt({name:"visibility",initialState:{visibility:Mt.initialize,showInlineView:!1,setInputFocus:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(Mn.fulfilled,((e,{payload:{visibility:t,setInputFocus:n}})=>{t&&(e.visibility=t,e.setInputFocus=Boolean(n))})).addCase(_t.fulfilled,((e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)}))}}),{setShowInlineView:Ta}=ja.actions,Ia=ja.reducer,Na=ne({state:ha,app:qn,config:$n,i18n:fr,translations:Ea,visibility:Ia,forms:sr,interrupt:br});const La=rn;var ka=n(1162);function Ma(e=""){const t=e=>/\s/.test(e),n=[],r={};let a=0,i=null,o=!1,s=0;for(;s<e.length;){if(o&&(t(e[s])||"{"===e[s]))o=!1,i=e.slice(a,s),"{"===e[s]&&s--;else if(!o&&!t(e[s])){const t="{"===e[s];if(i&&t){const t=Aa(e,s);if(-1===t)throw new Error(`Unbalanced curly braces in string: "${e}"`);r[i]=e.slice(s+1,t),s=t,i=null}else i&&(n.push(i),i=null),o=!0,a=s}s++}return o&&(i=e.slice(a)),i&&n.push(i),{args:n,cases:r}}function Aa(e,t){let n=0;for(let r=t+1;r<e.length;r++){let t=e.charAt(r);if("}"===t){if(0===n)return r;n--}else"{"===t&&n++}return-1}function Oa(e){return Pa(e.slice(1,-1),",",3)}function Pa(e,t,n,r=[]){if(!e)return r;if(1===n)return r.push(e),r;let a=e.indexOf(t);if(-1===a)return r.push(e),r;let i=e.substring(0,a).trim(),o=e.substring(a+t.length+1).trim();return r.push(i),Pa(o,t,n-1,r)}let Ra,Da=0;const za="other";function Fa(e,t){let n=0,r="",a=0;const i={};for(;n<e.length;){if("#"!==e[n]||a)r+=e[n];else{let e="__hashToken"+Da++;r+=`{${e}, number}`,i[e]=t}"{"===e[n]?a++:"}"===e[n]&&a--,n++}return{caseBody:r,numberValues:i}}const Ua="other",Ba=It((({i18n:e})=>e),(({translations:e})=>e)),Ha=It((({i18n:e})=>e),(({initialLocale:e})=>e)),$a=It((({i18n:e})=>e),(({userLocale:e})=>e)),Va=It((({i18n:e})=>e),(({isLoading:e})=>e)),Ga=new class{constructor(e,t={}){this.locale=e,this.typeHandlers=t}format=function(e){const t={};return function(...n){let r=n.length?n.map((e=>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,r))return t[r];let a=e(...n);return t[r]=a,a}}(((e,t={})=>this.process(e,t).flat(1/0).join("")));process(e,t={}){if(!e)return[];let n=e.indexOf("{");if(-1!==n){let r=Aa(e,n);if(-1===r)throw new Error(`Unbalanced curly braces in string: "${e}"`);{let a=e.substring(n,r+1);if(a){let i=[],o=e.substring(0,n);o&&i.push(o);let[s,c,l]=Oa(a),u=t[s];null==u&&(u="");let d=c&&this.typeHandlers[c];i.push(d?d(u,l,this.locale,t,this.process.bind(this)):u);let p=e.substring(r+1);return p&&i.push(this.process(p,t)),i}}}return[e]}}("en-GB",{plural:function(e,t,n,r,a){const{args:i,cases:o}=Ma(t);let s=parseInt(e);i.forEach((e=>{e.startsWith("offset:")&&(s-=parseInt(e.slice(7)))}));const c=[];if("PluralRules"in Intl){void 0!==Ra&&Ra.resolvedOptions().locale===n||(Ra=new Intl.PluralRules(n));const e=Ra.select(s);e!==za&&c.push(e)}1===s&&c.push("one"),c.push(`=${s}`,za);for(let e=0;e<c.length;e++){const t=c[e];if(t in o){const{caseBody:e,numberValues:n}=Fa(o[t],s);return a(e,{...r,...n})}}return e},select:function(e,t,n,r,a){const{cases:i}=Ma(t);return e in i?a(i[e],r):Ua in i?a(i[Ua],r):e}});function Wa(){const e=qt(Ba),t=qt($a),n=qt(Ha),r=qt(Va);return{t:(0,ka.useCallback)(((n,a={})=>{if(!e)return"";const i=e[n];return i?Ga.format(i,a):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),"")}),[e,t,r]),userLocale:t,initialLocale:n}}const qa=()=>{const e=La(),t=qt(In),n=qt(Ln),r=!!t&&t!==Mt.hidden,a=t===Mt.open,i=t===Mt.minimized,o=(0,ka.useCallback)((t=>{e(Mn("string"==typeof t||null===t?{visibility:t,setInputFocus:!1}:t))}),[e]);return{isVisible:r,isOpen:a,isMinimized:i,visible:t,setVisibility:o,openChat:()=>{o({visibility:Mt.open})},closeChat:()=>{o({visibility:Mt.minimized})},setInputFocus:n}},Ka=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,a.createRef)()})=>{const[r,i]=(0,ka.useState)(null),o=!!r?.isIntersecting||!t,s=o&&e,c=([e])=>i(e);return(0,ka.useEffect)((()=>{const e=n?.current;if(!window.IntersectionObserver||s||!e||!t)return()=>{};const r=new IntersectionObserver(c,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()}),[n,t,s]),{isVisible:o,containerRef:n}},Ja=()=>qt(Lt),Xa=(0,a.createContext)(null),Ya=(0,a.createContext)(null),Za=(0,a.createContext)(null),Qa=()=>{const e=(0,ka.useContext)(Ya);if(!e)throw new Error("useSeamlyEventBusContext has to be used within <SeamlyEventBusContext.Provider>");return e},ei=()=>{const e=(0,ka.useContext)(Xa);if(!e)throw new Error("useSeamlyApiContext has to be used within <SeamlyApiContext.Provider>");return e},ti=()=>ei().store,ni=()=>{const e=ei();return(0,ka.useCallback)((()=>e.hasConversation()),[e])},ri=()=>{const e=ei(),t=La(),n=Qa(),r=Ja(),a=ni(),{visible:i,setVisibility:o}=qa(),s=_n(),c=(0,ka.useCallback)(((...e)=>{n.emit(...e)}),[n]),l=(0,ka.useCallback)((()=>{c("ui.beforeStart",{visibility:i,hasConversation:a(),hasResponded:r,unreadMessageCount:s}),e.send("start_conversation"),c("ui.start",{visibility:i,hasConversation:a(),hasResponded:r,unreadMessageCount:s})}),[e,c,a,r,s,i]),u=(0,ka.useCallback)((async()=>{await t(Pn())}),[t]),d=(0,ka.useCallback)((e=>({type:e,id:G(),transactionId:G(),fromClient:!0,participant:"seamly-client-participant",occurredAt:1e3*Date.now()})),[]),p=(0,ka.useCallback)((e=>({...d("text"),body:{text:e}})),[d]),f=(0,ka.useCallback)((({body:n,config:r={}})=>{if(""===n.trim())return;const a={...p(n),...r};e.send("message",a),c("message",a),t(Tr({type:"message",payload:{...a,body:a.body,type:a.type,optimisticallyInjected:!0}}))}),[e,t,c,p]),h=(0,ka.useCallback)(((e,n=G())=>{t(Tr({type:"message",payload:{...p(e),transactionId:n}}))}),[t,p]),m=(0,ka.useCallback)(((e,n,r,a,i,o)=>{t(Tr({type:"message",payload:{type:"upload",id:e,transactionId:n,fromClient:!0,participant:"seamly-client-participant",occurredAt:r,body:{contentType:a,filename:i,filesize:o,id:e||"",isDeleted:!1}}}))}),[t]),y=(0,ka.useCallback)(((e,n=G())=>{t(Tr({type:"info",payload:{type:"divider",body:{subtype:e},fromClient:!1,participant:null,id:G(),transactionId:n}}))}),[t]),g=(0,ka.useCallback)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==k&&n!==M&&c(`action.${n}`,t)}),[e,c]),v=(0,ka.useCallback)((t=>{e.sendContext(t)}),[e]),b=(0,ka.useCallback)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&(t(Jr(e)),e.messages&&e.messages.length&&t(Kr(e)),e.userResponded&&(t(Wn(e.userResponded)),o({visibility:Mt.open})))})).catch((e=>{t(gr({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}))),[e,t,o]);return{connect:b,start:l,sendMessage:f,sendAction:g,sendContext:v,reset:u,emitEvent:c,addMessageBubble:h,addUploadBubble:m,addDivider:y,apiConnected:e.connected,apiConfigReady:e.configReady}},ai=()=>{const e=(()=>{const e=(0,ka.useContext)(Za);if(!e)throw new Error("useSeamlyLiveRegionContext has to be used within <SeamlyLiveRegionContext.Provider>");return e})();return{sendPolite:(0,ka.useCallback)((t=>{t&&e({ariaLive:B,messageText:t})}),[e]),sendAssertive:(0,ka.useCallback)((t=>{t&&e({ariaLive:U,messageText:t})}),[e])}},ii=It((({interrupt:e})=>e),(({error:e})=>e)),oi=It(ii,(e=>Boolean(e)));function si(){const{t:e}=Wa(),t=qt(ii);return{hasError:qt(oi),meta:(0,ka.useMemo)((()=>{if(!t)return{title:void 0,message:void 0,srText:void 0,buttonText:void 0,originalError:void 0,action:void 0};const{langKey:n,action:r}=t,a=e(`${n}.title`),i=e(`${n}.message`),o=e(`${n}.srText`),s=r?e(`${n}.buttonText`):null;return{...n?{title:a,message:i,srText:o}:{},...r?{action:r}:{},...r&&n?{buttonText:s}:{},originalError:t}}),[t,e]),error:t}}const ci=require("preact/compat"),li=require("preact/jsx-runtime"),ui=({children:e})=>((()=>{const{t:e}=Wa(),{isInline:t,isWindow:n,isApp:r}=Tn(),{isOpen:a,isVisible:i}=qa(),o=qt(Nn),{start:s,connect:c,apiConfigReady:l,apiConnected:u}=ri(),d=(0,ka.useRef)(!1),{sendAssertive:p}=ai();!function(){const{meta:{originalError:e,action:t}}=si(),n=La(),{reset:r}=ri(),a="SeamlySessionExpiredError"===e?.name,i=(0,ka.useRef)(0),o=(0,ka.useRef)(null);(0,ka.useEffect)((()=>{if(a&&"reset"===t){if(i.current>=10){o.current=setTimeout((()=>{i.current=0}),1e4);const e=new x;return n(gr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),()=>{}}i.current+=1,r()}return()=>{o.current&&clearTimeout(o.current)}}),[t,r,a,n])}(),(0,ka.useEffect)((()=>{i&&setTimeout((()=>{p(e("window.srTexts.onLoad"))}),500)}),[i,p,e]),(0,ka.useEffect)((()=>{i&&p(e(a?"window.srTexts.onOpen":"window.srTexts.onClose"))}),[a,i,p,e]),(0,ka.useEffect)((()=>{l||u||(d.current=!1)}),[l,u]);const f=(0,ka.useCallback)((async()=>{u||(d.current=!0,await c()),(r||a||i&&t)&&s()}),[u,c,r,t,a,i,s]);(0,ka.useEffect)((()=>{!l||d.current||n&&!a||!(!t||i&&o)||f()}),[l,f,t,a,i,n,o])})(),(0,li.jsx)(li.Fragment,{children:e})),di=(0,a.createContext)(null),pi=(e=0)=>new Promise((t=>{setTimeout(t,e)})),fi=()=>{const{seamlyContainerElement:e}=gn(),t=La();return[e,(0,ka.useCallback)((e=>{t(Qr(e))}),[t])]},hi=e=>(0,ka.useCallback)((()=>{var t;t=e,requestAnimationFrame((async()=>{await pi(180);const e="string"==typeof t?document.getElementById(t):t;fn(e)}))}),[e]),mi=()=>{const e=Cn();return hi(e)},yi=e=>It((e=>e.translations.translatedEventGroups),(t=>Object.values(t).every((t=>e?.payload?.id&&!t.includes(e.payload.id)))));function gi(){const{sendContext:e}=ri(),t=La(),n=an(),r=(0,ka.useCallback)(((t,n)=>{e({userLocale:t,source:n})}),[e]),a=(0,ka.useCallback)((()=>{e({userLocale:n.context?.contentLocale}),t(xa())}),[n.context?.contentLocale,t,e]),{languages:i,isActive:o,isAvailable:s,currentLocale:c}=qt((({translations:e})=>e));return{languages:i,isActive:o,isAvailable:s,currentLocale:c,enableTranslations:r,disableTranslations:a}}const vi=e=>{const t=qt(yi(e));if(!e?.payload)return{body:void 0,hasTranslation:!1,isTranslated:!1,locale:""};const n=e.payload?.translatedBody&&"data"in e.payload.translatedBody?e.payload?.translatedBody.data:e.payload.translatedBody,{translation:r,body:a}={body:e.payload?.body,translation:e.payload?.translation},i=!!n;return{body:t&&i?n:a,hasTranslation:i,isTranslated:t&&i,locale:r?.locale}};function bi(e){const{languages:t}=gi();return(0,ka.useMemo)((()=>t?.find((t=>t.locale===e))?.nativeName),[e,t])}const xi=(...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&&e.length)).map((e=>e&&e.indexOf(Rn)>-1?e:[Rn,e].join("-"))).join(" "),wi=()=>an().appContainerClassNames,_i=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},Ci=(0,a.createContext)(null),Si=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=gn(),{allowedMimeTypes:a,maxSize:i}=n?.upload||{},{enabled:o,enabledFromEntry:s}=r||{},{allowedMimeTypes:c,maxSize:l}={...t.upload||{allowedMimeTypes:[],maxSize:0},...a?{allowedMimeTypes:a}:{},...i?{maxSize:i}:{}};return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:s||o,allowedMimeTypes:c,maxSize:l}},Ei=()=>{const{currentUploads:e}=gn(),t=La(),n=(()=>{const e=(0,ka.useContext)(Ci);if(!e)throw new Error("useSeamlyFileUploadContext has to be used within <SeamlyFileUploadContext.Provider>");return e})();return{uploadFile:(0,ka.useCallback)((e=>{n(e)}),[n]),clearUploads:(0,ka.useCallback)((()=>{t(Nr())}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}},ji=()=>{const{t:e}=Wa(),{options:t}=gn(),{panelActive:n,optionActive:r,userSelectedOptions:a,features:i}=t,{extraMenuItem:o,sendTranscript:s}=i,c={extraMenuItem:o,sendTranscript:s},l=t=>"extraMenuItem"===t?"Extra menu item":e(`options.${t}.menuTitle`),u=Object.keys(c).filter((e=>c[e])).map((e=>({name:e,title:l(e),available:c[e].enabled}))),d=o||s,p=La(),{get:f,set:h}=ti();return{allowOptionSelection:d,userSelectedOptions:a,features:i,menuOptions:u,initUserSelectedOptions:(0,ka.useCallback)((()=>{const e=f("options")||{};p(ua(e))}),[f,p]),setUserSelectedOptions:(0,ka.useCallback)((e=>{p(ua(e)),h("options",e)}),[h,p]),setUserSelectedOption:(0,ka.useCallback)(((e,t)=>{const n=f("options")||{};"object"==typeof n&&h("options",{...n,[e]:t}),p(la({option:e,value:t}))}),[p,f,h]),showOption:e=>{p(da(e))},hideOption:()=>{p(Pr())},panelActive:n,optionActive:r}},Ti=()=>{const{optionsButtonId:e}=gn();return{id:e,focusButton:hi(e)}},Ii=(0,a.createContext)(null),Ni=()=>{const e=(0,ka.useContext)(Ii);if(!e)throw new Error("useSeamlyActivityEventHandler has to be used within <SeamlyActivityEventContext.Provider>");return e},Li=()=>{const e=La(),{idleDetachCountdown:{hasCountdown:t,isActive:n,count:r,remaining:a,timer:i,wasStopped:o}}=gn(),{isOpen:s}=qa(),{emitEvent:c,sendAction:l}=ri(),{t:u}=Wa(),{sendAssertive:d,sendPolite:p}=ai(),f=(0,ka.useCallback)((e=>{s&&d(e)}),[s,d]),h=(0,ka.useCallback)((e=>{s&&p(e)}),[s,p]),m=(0,ka.useCallback)((t=>{const n=(e=>Math.ceil(e/1e3))(t),r=cn(n);e(Rr({delaySeconds:n,delayTime:r})),c("idleTimer.start"),f(`${u("idleDetachWarning.countdownTitle")} ${u("idleDetachWarning.countdownText")} ${u("idleDetachWarning.countdownTimer",r)}`)}),[e,c,f,u]),y=(0,ka.useCallback)(((n=void 0,r=!1)=>{t&&(n||(r||l({type:A}),f(u("idleDetachWarning.notifyTransferText"))),o||c("idleTimer.stop"),e(Mr()))}),[e,c,t,l,f,u,o]),g=(0,ka.useCallback)((()=>{if(!a||a<=0)return;const t=a-1;t%10==0&&f(`${u("idleDetachWarning.countdownText")} ${u("idleDetachWarning.countdownTimer",cn(t))}`),e(Or())}),[e,a,f,u]),v=(0,ka.useCallback)((()=>{n&&(e(pa()),a&&(c("idleTimer.stop"),h(u("idleDetachWarning.srCountDownStoppedText"))))}),[e,c,n,a,h,u]);return{hasCountdown:t,isActive:n,count:r,remaining:a,timer:i,wasStopped:o,initCountdown:m,endCountdown:y,decrementCountdown:g,stopCountdown:v}},ki=()=>{const e=La(),t=gn().resumeConversationPrompt,{sendAction:n}=ri(),{t:r}=Wa(),{sendAssertive:a}=ai();return{continueChat:()=>{n({type:O,body:{type:"resume_conversation_prompt"}}),e(Ar())},hasPrompt:t,restartChat:()=>{a(r("resumeConversationPrompt.srNotifyRestartText")),n({type:A}),e(Ar())}}},Mi=()=>{const[e]=(0,ka.useState)((()=>G()));return e},Ai=({eventPayload:e})=>{const{t}=Wa(),{fromClient:n,participant:r}=e,a=(e=>gn().participantInfo.participants[e])(r)||{},{messages:i}=an(),o=n?t("participants.user.name"):a&&a.name,{showAvatar:s,showName:c}=i&&i[n?"user":"agent"]||{};if(!s&&!c)return null;const l=[];return s&&o&&a.avatar&&l.push((0,li.jsx)("span",{className:xi("message__avatar"),children:(0,li.jsx)("img",{src:a.avatar,className:xi("avatar"),alt:""})})),c&&o&&l.push((0,li.jsx)("span",{className:xi("message__author-name"),children:o})),l.length>0?(0,li.jsx)("div",{className:xi("message__author"),children:l}):null},Oi=({showParticipant:e=!0,event:t,type:n,modifiers:r,children:a,bodyProps:i={},info:o,...s})=>{const c=_i(t),{hasTranslation:l,isTranslated:u,locale:d}=vi(t);return n&&c.push(`message--type-${n}`),r&&("string"==typeof r&&(r=r.split(" ").filter((e=>e.length))),r.forEach((e=>{c.push(`message--${e}`)}))),u&&c.push("message--is-translated"),l&&c.push("message--has-translation"),u&&(i={...i,lang:d}),(0,li.jsx)(li.Fragment,{children:(0,li.jsxs)("div",{className:xi(c),...s,children:[e&&(0,li.jsx)(Ai,{eventPayload:t.payload}),(0,li.jsx)("div",{className:xi("message__body"),...i,children:a}),o&&(0,li.jsx)("div",{"aria-hidden":"true",className:xi("message__info"),children:o})]})})},Pi=({id:e,action:t,buttonText:n,description:r,hasFocus:a,image:i,title:o,isCarouselItem:s})=>{const c=(0,ka.useRef)(null),{sendMessage:l,sendAction:u,emitEvent:d}=ri(),p=Mi(),f=(0,ka.useRef)(!1),h=t?.type===V?"a":"button",m=(0,ka.useCallback)((()=>d("action.click_card",{type:R,originMessage:e,action:t})),[d,e,t]),y=(0,ka.useCallback)((()=>{if(m(),"ask"===t?.type)l({body:t?.ask});else if("topic"===t?.type){const{topic:e,fallbackMessage:n}=t;u({type:P,body:{name:e,fallbackMessage:n}})}}),[l,t,u,m]),g=(0,ka.useMemo)((()=>t?.type===V?{href:t?.link,rel:"noopener noreferrer",target:t?.newTab?"_blank":"_self",onClick:m}:{onClick:y}),[t,y,m]);return(0,ka.useEffect)((()=>{s&&(a&&f.current?window.requestAnimationFrame((()=>c.current?.focus())):c.current?.blur()),f.current=!0}),[a,s]),(0,li.jsxs)("div",{className:xi("card__wrapper"),id:e,tabIndex:-1,ref:c,children:[i?(0,li.jsx)("img",{className:xi("card__image"),src:i,alt:""}):null,(0,li.jsxs)("div",{className:xi("card__content"),id:e,children:[o&&(0,li.jsx)("h2",{className:xi("card__title"),children:o}),r&&(0,li.jsx)("div",{className:xi("card__description"),dangerouslySetInnerHTML:{__html:r}}),(0,li.jsx)(h,{tabIndex:s&&!a?-1:void 0,className:xi("button","button--primary"),"aria-describedby":p,...g,children:n})]})]})};function Ri({item:e,items:t,index:n,isActive:r}){const{t:a}=Wa();return(0,li.jsx)("div",{className:xi("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":a("carousel.slide.label",{index:n+1,total:t.length}),children:(0,li.jsx)(Pi,{...e,isCarouselItem:!0,hasFocus:r})})}const Di={send:{32:'<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>'},balloon:{32:'<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>'},newTopic:{32:'<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>'},newTranslation:{16:'<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>',32:'<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>'},avatar:{32:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">\n<path fill="#4A48C1" d="M10,14.8c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S11.1,14.8,10,14.8z M15.9,14.8c1.1,0,2-0.9,2-2s-0.9-2-2-2\n\ts-2,0.9-2,2S14.8,14.8,15.9,14.8z M21.8,10.8c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S22.9,10.8,21.8,10.8z M21.3,18.1H10.7\n\tC11.7,23.9,20.2,23.9,21.3,18.1z"/>\n</svg>\n'},chevronDown:{8:'<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>',32:'<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>'},chevronRight:{8:'<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>',16:'<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>'},close:{8:'<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>',16:'<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>'},enlarge:{32:'<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>'},options:{32:'<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>'},file:{32:'<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>'},upload:{32:'<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>'},download:{16:'<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>'},error:{16:'<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>'},arrowLeft:{16:'<?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'},arrowRight:{16:'<?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'},check:{16:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="16px"\n height="16px"\n x="0px"\n y="0px"\n viewBox="0 0 16 16"\n>\n <path\n fill="currentColor"\n d="M11.6,4.3l-5,5L4.9,7.5C4.4,7,3.7,7,3.2,7.5l0,0C2.8,8,2.8,8.7,3.2,9.2l1.7,1.7l0,0l0.8,0.8\n\tc0.5,0.5,1.2,0.5,1.7,0l0.8-0.8l5-5c0.5-0.5,0.5-1.2,0-1.7l0,0C12.8,3.8,12.1,3.8,11.6,4.3z"\n />\n</svg>\n',32:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="32px"\n height="32px"\n x="0px"\n y="0px"\n viewBox="0 0 32 32"\n>\n <path\n fill="currentColor"\n d="M22.9,9.3l-9.3,9.3l-3.2-3.2c-0.9-0.9-2.3-0.9-3.2,0l0,0c-0.9,0.9-0.9,2.3,0,3.2l3.2,3.2l0,0l1.6,1.6\n\tc0.9,0.9,2.3,0.9,3.2,0l1.6-1.6l9.3-9.3c0.9-0.9,0.9-2.3,0-3.2l0,0C25.2,8.4,23.7,8.4,22.9,9.3z"\n />\n</svg>\n'}},zi=({name:e,size:t="32",className:n,alt:r})=>(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)("div",{"aria-hidden":"true",className:n||xi("icon"),dangerouslySetInnerHTML:{__html:Di[e][t]}}),r&&(0,li.jsx)("span",{className:xi("visually-hidden"),children:r})]});function Fi({items:e,currentIndex:t,onChange:n,children:r}){const{t:a}=Wa(),i=e.length;return(0,li.jsxs)("div",{className:xi("carousel-controls"),children:[(0,li.jsx)("button",{className:xi("button","button--previous"),"aria-label":a("carousel.controls.previous"),onClick:()=>{n((t-1+i)%i)},children:(0,li.jsx)(zi,{name:"arrowLeft",size:"16",alt:""})}),r,(0,li.jsx)("button",{className:xi("button","button--next"),"aria-label":a("carousel.controls.next"),onClick:()=>{n((t+1)%i)},children:(0,li.jsx)(zi,{name:"arrowRight",size:"16",alt:""})})]})}function Ui({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:a}){const i=e.length,o=(0,ka.useCallback)((e=>{const r=Number(e.target.dataset.item||"0"),a=Math.min(i-1,Math.max(0,r));a!==t&&n(a)}),[i,t,n]);return(0,li.jsx)("div",{className:xi("carousel-pagination__wrapper"),role:"group",children:(0,li.jsx)("ul",{className:xi("carousel-pagination"),children:e.map(((e,n)=>{const i=t===n;return(0,li.jsx)("li",{className:xi("carousel-pagination__item",i?"is-active":void 0),children:(0,li.jsx)("button",{className:xi("carousel-pagination__button"),type:"button",onClick:o,"data-item":n,"aria-disabled":i?"true":void 0,"aria-label":a(e,n)})},r(e,n,"pagination-item-"))}))})})}const Bi=(e,t,n)=>`${n}${t}`,Hi=e=>e.label,$i=({target:e})=>{e.scrollLeft=0};function Vi({currentIndex:e=0,onChange:t=()=>{},getItemKey:n=Bi,getItemLabel:r=Hi,items:i}){const o=Mi(),s=i.length,[c,l]=(0,ka.useState)(Number(e||0));(0,ka.useEffect)((()=>{l(Number(e||0))}),[l,e]);const u=(0,ka.useRef)([]);u.current=(0,ka.useMemo)((()=>Array(s).fill(1).map((()=>(0,a.createRef)()))),[s]);const d=(0,ka.useRef)(!0),p=(0,ka.useRef)(null);return p.current=t,(0,ka.useEffect)((()=>{d.current?d.current=!1:p.current&&p.current(c)}),[c]),(0,li.jsxs)("div",{className:xi("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,li.jsx)("div",{className:xi("carousel__slides-wrapper"),onScroll:$i,children:(0,li.jsx)("div",{id:o,className:xi("carousel__slides"),style:{width:100*s+"%",left:-100*c+"%"},"aria-live":"polite","aria-atomic":"false",children:i.map(((e,t)=>{const r=c===t;return(0,li.jsx)("div",{ref:u.current[t],className:xi("carousel__slide",r?"is-active":void 0),"aria-hidden":r?void 0:"true",children:(0,li.jsx)(Ri,{item:e,items:i,index:t,isActive:r})},n(e,t,"item-"))}))})}),(0,li.jsx)("div",{className:xi("carousel__controls"),children:(0,li.jsx)(Fi,{currentIndex:c,items:i,onChange:l,children:(0,li.jsx)("div",{className:xi("carousel__pagination"),children:(0,li.jsx)(Ui,{currentIndex:c,items:i,onChange:l,getItemKey:n,getItemLabel:r})})})})]})}const Gi=(e,t,n="")=>`${n}${e.title}:${t}`,Wi=e=>e.title,qi=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,Ki=({id:e,categories:t=[],question:n,onClick:r,hasIcon:a})=>{const i=(0,ka.useMemo)((()=>["suggestions__item",...t.map(qi)]),[t]),o=(0,ka.useCallback)((()=>{r&&r({id:e,question:n})}),[e,n,r]);return(0,li.jsx)("li",{className:xi(i),children:(0,li.jsxs)("button",{type:"button",onClick:o,className:xi("button","button--primary"),children:[a&&(0,li.jsx)(zi,{name:"chevronRight",size:"8",alt:""}),n]})})},Ji=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>(0,li.jsx)("ul",{className:xi("suggestions__list",e||""),children:t.map((e=>(0,li.jsx)(Ki,{hasIcon:r,onClick:n,categories:e.categories,id:e.id,question:e.question},e.id)))}),Xi=({originMessage:e,transactionId:t})=>{const{sendAction:n}=ri();return r=>{r.target&&r.target.dataset.linkId&&n({type:"navigate",originMessage:e,transactionId:t,link:{id:r.target.dataset.linkId,url:r.target.getAttribute("href")}})}},Yi=({children:e,className:t,graphicSrc:n,graphicType:r="icon",iconName:a,iconSize:i,iconClassName:o,dividerType:s,title:c,description:l})=>{const u=Boolean(a||n);return(0,li.jsxs)("div",{className:xi("divider",s&&`divider--type-${s}`,t),children:[u&&(0,li.jsx)("span",{className:xi("divider__graphic"),children:a?(0,li.jsx)(zi,{name:a,size:i,className:o,alt:""}):(0,li.jsx)("img",{src:n||void 0,className:xi({icon:"icon"===r,avatar:"avatar"===r},o)})}),(0,li.jsxs)("div",{className:xi("divider__body"),children:[c?(0,li.jsx)("h2",{className:xi("divider__title"),dangerouslySetInnerHTML:{__html:c}}):null,l?(0,li.jsx)("p",{className:xi("divider__description"),dangerouslySetInnerHTML:{__html:l}}):null,e]})]})},Zi={[H.new_topic]:"new-topic"},Qi={default:({event:e})=>{const{t}=Wa(),{subtype:n}=e.payload.body,r=Zi[H[n]];return H[n]?(0,li.jsx)(Yi,{dividerType:r,iconName:H[n],title:t(`dividerKeys.${H[n]}`)}):null},[H.new_translation]:({event:e})=>{const{t}=Wa(),n=xn(),{body:{translationEnabled:r,text:a,title:i},id:o}=e.payload,s=qt((e=>e.translations.translatedEventGroups)),c=La(),l=(0,ka.useCallback)((()=>{s[o]?c(wa({events:n,id:o})):c(_a({events:n,id:o}))}),[c,n,o,s]);return(0,li.jsx)(Yi,{iconName:"newTranslation",dividerType:"new-translation",title:i,description:a,children:r?(0,li.jsx)(li.Fragment,{children:(0,li.jsx)("button",{className:xi("button","button--secondary"),onClick:l,children:t(s[o]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):null})}},eo={month:"long",day:"numeric",year:"numeric"},to={hour:"numeric",minute:"numeric"},no=({event:e})=>{const t=(()=>{const[e,t]=(0,ka.useReducer)((e=>e+1),0);return(0,ka.useCallback)((()=>{setTimeout((()=>{t()}))}),[])})(),{date:n,time:r,timeUntilMidnight:a,srText:i}=(e=>{const{t}=Wa(),n=an(),r=n?.context?.userLocale??[],a=new Date(e),i=new Date,o=new Date(i);o.setHours(24,0,0,0);const s=o.valueOf()-i.valueOf(),c=a.toString(),l=new Intl.DateTimeFormat(r,to).format(a);let u=((e,t)=>{const n=new Date(t).setHours(0,0,0,0),r=e.getTime(),a=864e5;return r>=n+a?e:r>n?"today":r>n-a?"yesterday":e})(a,i);switch(u){case"today":u=t("dateTime.today");break;case"yesterday":u=t("dateTime.yesterday");break;default:u=new Intl.DateTimeFormat(r,eo).format(a)}return{date:u,srText:t("dateTime.srText",{date:u,time:l}),time:l,fullDateTime:c,timeUntilMidnight:s}})(sn(e.payload.timeIndicator));return(0,ka.useEffect)((()=>{const e=setTimeout((()=>{t()}),a);return()=>{clearTimeout(e)}}),[t,a]),(0,li.jsxs)(Yi,{dividerType:"time-indicator",children:[(0,li.jsxs)("h2",{className:xi("divider__time"),"aria-hidden":"true",children:[(0,li.jsx)("span",{className:xi("divider__time--date"),children:n}),(0,li.jsx)("span",{className:xi("divider__time--time"),children:r})]}),(0,li.jsx)("p",{className:xi("visually-hidden"),children:i})]})};var ro=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ao=ro.join(","),io="undefined"==typeof Element,oo=io?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,so=!io&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},co=function e(t,n){var r;void 0===n&&(n=!0);var a=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===a||"true"===a||n&&t&&e(t.parentNode)},lo=function(e,t,n){if(co(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ao));return t&&oo.call(e,ao)&&r.unshift(e),r.filter(n)},uo=function e(t,n,r){for(var a=[],i=Array.from(t);i.length;){var o=i.shift();if(!co(o,!1))if("SLOT"===o.tagName){var s=o.assignedElements(),c=e(s.length?s:o.children,!0,r);r.flatten?a.push.apply(a,c):a.push({scopeParent:o,candidates:c})}else{oo.call(o,ao)&&r.filter(o)&&(n||!t.includes(o))&&a.push(o);var l=o.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(o),u=!co(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(l&&u){var d=e(!0===l?o.children:l.children,!0,r);r.flatten?a.push.apply(a,d):a.push({scopeParent:o,candidates:d})}else i.unshift.apply(i,o.children)}}return a},po=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},fo=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!po(e)?0:e.tabIndex},ho=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},mo=function(e){return"INPUT"===e.tagName},yo=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},go=function(e,t){return!(t.disabled||co(t)||function(e){return mo(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var a=oo.call(e,"details>summary:first-of-type")?e.parentElement:e;if(oo.call(a,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return yo(e)}else{if("function"==typeof r){for(var i=e;e;){var o=e.parentElement,s=so(e);if(o&&!o.shadowRoot&&!0===r(o))return yo(e);e=e.assignedSlot?e.assignedSlot:o||s===e.ownerDocument?o:s.host}e=i}if(function(e){var t,n,r,a,i=e&&so(e),o=null===(t=i)||void 0===t?void 0:t.host,s=!1;if(i&&i!==e)for(s=!!(null!==(n=o)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(o)||null!=e&&null!==(a=e.ownerDocument)&&void 0!==a&&a.contains(e));!s&&o;){var c,l,u;s=!(null===(l=o=null===(c=i=so(o))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(o))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!oo.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},vo=function(e,t){return!(function(e){return function(e){return mo(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||so(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var a=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!a||a===e}(e)}(t)||fo(t)<0||!go(e,t))},bo=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},xo=function e(t){var n=[],r=[];return t.forEach((function(t,a){var i=!!t.scopeParent,o=i?t.scopeParent:t,s=function(e,t){var n=fo(e);return n<0&&t&&!po(e)?0:n}(o,i),c=i?e(t.candidates):o;0===s?i?n.push.apply(n,c):n.push(o):r.push({documentOrder:a,tabIndex:s,item:t,isScope:i,content:c})})),r.sort(ho).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},wo=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==oo.call(e,ao)&&vo(t,e)},_o=ro.concat("iframe").join(","),Co=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==oo.call(e,_o)&&go(t,e)};function So(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Eo(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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 To(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){Eo(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}var Io=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},No=function(e){return Io(e)&&!e.shiftKey},Lo=function(e){return Io(e)&&e.shiftKey},ko=function(e){return setTimeout(e,0)},Mo=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},Ao=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},Oo=[],Po=function(e,t){var n,r=(null==t?void 0:t.document)||document,a=(null==t?void 0:t.trapStack)||Oo,i=To({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:No,isKeyBackward:Lo},t),o={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:i[n||t]},c=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return o.containerGroups.findIndex((function(t){var r=t.container,a=t.tabbableNodes;return r.contains(e)||(null==n?void 0:n.includes(r))||a.find((function(t){return t===e}))}))},l=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=n.hasFallback,o=void 0!==a&&a,s=n.params,c=void 0===s?[]:s,l=i[e];if("function"==typeof l&&(l=l.apply(void 0,function(e){if(Array.isArray(e))return So(e)}(t=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return So(e,t);var n={}.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)?So(e,t):void 0}}(t)||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.")}())),!0===l&&(l=void 0),!l){if(void 0===l||!1===l)return l;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var u=l;if("string"==typeof l){try{u=r.querySelector(l)}catch(t){throw new Error("`".concat(e,'` appears to be an invalid selector; error="').concat(t.message,'"'))}if(!u&&!o)throw new Error("`".concat(e,"` as selector refers to no known node"))}return u},u=function(){var e=l("initialFocus",{hasFallback:!0});if(!1===e)return!1;if(void 0===e||e&&!Co(e,i.tabbableOptions))if(c(r.activeElement)>=0)e=r.activeElement;else{var t=o.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}else null===e&&(e=l("fallbackFocus"));if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(o.containerGroups=o.containers.map((function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?uo([e],t.includeContainer,{filter:vo.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:bo}):lo(e,t.includeContainer,vo.bind(null,t)),xo(n)}(e,i.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?uo([e],t.includeContainer,{filter:go.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):lo(e,t.includeContainer,go.bind(null,t))}(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,a=t.length>0?t[t.length-1]:void 0,o=n.find((function(e){return wo(e)})),s=n.slice().reverse().find((function(e){return wo(e)})),c=!!t.find((function(e){return fo(e)>0}));return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:a,firstDomTabbableNode:o,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=t.indexOf(e);return a<0?r?n.slice(n.indexOf(e)+1).find((function(e){return wo(e)})):n.slice(0,n.indexOf(e)).reverse().find((function(e){return wo(e)})):t[a+(r?1:-1)]}}})),o.tabbableGroups=o.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),o.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(o.containerGroups.find((function(e){return e.posTabIndexesFound}))&&o.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function(e){var t=e.activeElement;if(t)return t.shadowRoot&&null!==t.shadowRoot.activeElement?p(t.shadowRoot):t},f=function(e){!1!==e&&e!==p(document)&&(e&&e.focus?(e.focus({preventScroll:!!i.preventScroll}),o.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):f(u()))},h=function(e){var t=l("setReturnFocus",{params:[e]});return t||!1!==t&&e},m=function(e){var t=e.target,n=e.event,r=e.isBackward,a=void 0!==r&&r;t=t||Ao(n),d();var s=null;if(o.tabbableGroups.length>0){var u=c(t,n),p=u>=0?o.containerGroups[u]:void 0;if(u<0)s=a?o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:o.tabbableGroups[0].firstTabbableNode;else if(a){var f=o.tabbableGroups.findIndex((function(e){var n=e.firstTabbableNode;return t===n}));if(f<0&&(p.container===t||Co(t,i.tabbableOptions)&&!wo(t,i.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(f=u),f>=0){var h=0===f?o.tabbableGroups.length-1:f-1,m=o.tabbableGroups[h];s=fo(t)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else Io(n)||(s=p.nextTabbableNode(t,!1))}else{var y=o.tabbableGroups.findIndex((function(e){var n=e.lastTabbableNode;return t===n}));if(y<0&&(p.container===t||Co(t,i.tabbableOptions)&&!wo(t,i.tabbableOptions)&&!p.nextTabbableNode(t))&&(y=u),y>=0){var g=y===o.tabbableGroups.length-1?0:y+1,v=o.tabbableGroups[g];s=fo(t)>=0?v.firstTabbableNode:v.firstDomTabbableNode}else Io(n)||(s=p.nextTabbableNode(t))}}else s=l("fallbackFocus");return s},y=function(e){var t=Ao(e);c(t,e)>=0||(Mo(i.clickOutsideDeactivates,e)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):Mo(i.allowOutsideClick,e)||e.preventDefault())},g=function(e){var t=Ao(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(o.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var a=!0;if(o.mostRecentlyFocusedNode)if(fo(o.mostRecentlyFocusedNode)>0){var s=c(o.mostRecentlyFocusedNode),l=o.containerGroups[s].tabbableNodes;if(l.length>0){var d=l.findIndex((function(e){return e===o.mostRecentlyFocusedNode}));d>=0&&(i.isKeyForward(o.recentNavEvent)?d+1<l.length&&(r=l[d+1],a=!1):d-1>=0&&(r=l[d-1],a=!1))}}else o.containerGroups.some((function(e){return e.tabbableNodes.some((function(e){return fo(e)>0}))}))||(a=!1);else a=!1;a&&(r=m({target:o.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(o.recentNavEvent)})),f(r||o.mostRecentlyFocusedNode||u())}o.recentNavEvent=void 0},v=function(e){(i.isKeyForward(e)||i.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o.recentNavEvent=e;var n=m({event:e,isBackward:t});n&&(Io(e)&&e.preventDefault(),f(n))}(e,i.isKeyBackward(e))},b=function(e){var t;"Escape"!==(null==(t=e)?void 0:t.key)&&"Esc"!==(null==t?void 0:t.key)&&27!==(null==t?void 0:t.keyCode)||!1===Mo(i.escapeDeactivates,e)||(e.preventDefault(),n.deactivate())},x=function(e){var t=Ao(e);c(t,e)>=0||Mo(i.clickOutsideDeactivates,e)||Mo(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},w=function(){if(o.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)}(a,n),o.delayInitialFocusTimer=i.delayInitialFocus?ko((function(){f(u())})):f(u()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",x,{capture:!0,passive:!1}),r.addEventListener("keydown",v,{capture:!0,passive:!1}),r.addEventListener("keydown",b),n},_=function(){if(o.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",x,!0),r.removeEventListener("keydown",v,!0),r.removeEventListener("keydown",b),n},C="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver((function(e){e.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===o.mostRecentlyFocusedNode}))}))&&f(u())})):void 0,S=function(){C&&(C.disconnect(),o.active&&!o.paused&&o.containers.map((function(e){C.observe(e,{subtree:!0,childList:!0})})))};return n={get active(){return o.active},get paused(){return o.paused},activate:function(e){if(o.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),a=s(e,"checkCanFocusTrap");a||d(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,null==t||t();var i=function(){a&&d(),w(),S(),null==n||n()};return a?(a(o.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!o.active)return this;var t=To({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,_(),o.active=!1,o.paused=!1,S(),function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}(a,n);var r=s(t,"onDeactivate"),c=s(t,"onPostDeactivate"),l=s(t,"checkCanReturnFocus"),u=s(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){ko((function(){u&&f(h(o.nodeFocusedBeforeActivation)),null==c||c()}))};return u&&l?(l(h(o.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){if(o.paused||!o.active)return this;var t=s(e,"onPause"),n=s(e,"onPostPause");return o.paused=!0,null==t||t(),_(),S(),null==n||n(),this},unpause:function(e){if(!o.paused||!o.active)return this;var t=s(e,"onUnpause"),n=s(e,"onPostUnpause");return o.paused=!1,null==t||t(),d(),w(),S(),null==n||n(),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return o.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),o.active&&d(),S(),this}},n.updateContainerElements(e),n};const Ro=({children:e,onClose:t,fallBackFocusRef:n,"aria-label":r,"aria-labelledby":i})=>{const o=Mi(),s=(0,ka.useRef)(null),c=(0,ka.useRef)(null),[l,u]=(0,ka.useState)(!1);return(0,ka.useEffect)((()=>(l&&s.current&&(c.current=Po(s.current,{initialFocus:n.current||void 0}),c.current.activate()),()=>{c.current&&c.current.deactivate()})),[l,n]),(0,ka.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||(null!==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()}}),[l]),(0,ka.useEffect)((()=>{l&&s.current&&s.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()}))}),[l,t]),(0,ka.useLayoutEffect)((()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",o),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),r&&t.setAttribute("aria-label",r),i&&t.setAttribute("aria-labelledby",i),e.appendChild(t),s.current=t,u(!0),()=>{s.current&&(e.removeChild(s.current),s.current=null)}}),[r,i,o]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>s.current&&(0,a.render)(e,s.current)}):s.current&&(0,a.render)((0,a.toChildArray)(e).filter(mn).map((e=>(e.props={...e.props,onClose:t},e))),s.current)},Do=({url:e,description:t,onClose:n})=>{const r=an(),a=Ni(),i=wi(),o=(0,ka.useRef)(null),{t:s}=Wa(),c=["modal",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];"function"!=typeof i?c.push(...i):c.push(...i(r));const l=e=>{e.stopPropagation()},u=()=>{n()},d=r?.zIndex?{zIndex:r.zIndex+1}:void 0;return(0,li.jsx)(Ro,{onClose:n,"aria-label":s("lightbox.heading"),fallBackFocusRef:o,children:({onClose:n,modalRenderFn:r})=>r((n=>(0,li.jsx)("div",{className:xi(c),onClick:u,style:d,children:(0,li.jsxs)("div",{className:xi("modal__float"),tabIndex:-1,onMouseDown:a,onKeyDown:a,onTouchStart:a,onMouseMove:a,onWheel:a,onPointerDown:a,onPointerMove:a,ref:o,children:[(0,li.jsx)("div",{className:xi("modal__inner"),onClick:l,children:(0,li.jsx)("img",{className:xi("modal__image"),src:e,alt:t})}),(0,li.jsxs)("button",{type:"button",className:xi("modal__close"),onClick:n,children:[(0,li.jsx)(zi,{name:"close",size:"16",alt:""}),s("lightbox.closeLabel")]})]})}))(n))})},zo=({description:e,url:t})=>{const{t:n}=Wa(),[r,a]=(0,ka.useState)(!1);return(0,li.jsxs)(li.Fragment,{children:[(0,li.jsxs)("button",{type:"button",className:xi("modal__enlarge"),onClick:()=>{a(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),(0,li.jsx)(zi,{name:"enlarge",size:"32",alt:""})]}),r&&(0,li.jsx)(Do,{url:t,description:e,onClose:()=>{a(!1)}})]})},Fo=({event:e,...t})=>{const{body:n}=vi(e),r=Xi({originMessage:e.payload.id,transactionId:e.payload.transactionId}),a=(0,ka.useMemo)((()=>e.payload.optimisticallyInjected?{children:(0,li.jsx)("p",{children:n?.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:n?.text||""}}}),[n,e]);return(0,li.jsx)(Oi,{type:"text",event:e,onClick:r,...t,...a})},Uo="PROCESSING_IMAGE",Bo=({img:e,filename:t})=>{const{t:n}=Wa(),r=n("fileUpload.srFileUploadedText",{fileName:t});return(0,li.jsx)(li.Fragment,{children:(0,li.jsxs)("span",{className:xi(["download","download--preview"]),children:[(0,li.jsx)("img",{src:e,alt:r}),(0,li.jsx)("span",{"aria-hidden":"true",className:xi("file-download"),children:t})]})})},Ho=({children:e,fileId:t,isDeleted:n,onClickHandler:r,url:a,target:i})=>t&&!n?(0,li.jsx)("button",{onClick:r,className:xi(["button","download","download-link"]),children:e}):a?(0,li.jsx)("a",{href:a,download:!0,target:i,className:xi(["download","download-link"]),children:e}):(0,li.jsx)("span",{className:xi("download"),children:e}),$o={message:{choice_prompt:({event:e,children:t,...n})=>{const{t:r}=Wa(),i=Mi(),{body:o,subEvent:s,showOptions:c,chooseAgain:l,onChoiceClickHandler:u,onChooseAgainClickHandler:d}=(e=>{const{payload:t}=e,[n,r]=(0,ka.useState)(!1),{sendAction:a,addMessageBubble:i,addDivider:o}=ri(),{activeServiceSessionId:s}=Sn(),c=qt(En),{body:l}=vi(e),{service:u}=t,d=(0,ka.useMemo)((()=>{if("choice_prompt"===e.payload.type)return{...e,payload:{...e.payload,body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&{...e.payload.translatedBody,data:e.payload.translatedBody?.prompt}}}}),[e]),p=l?.chooseAgain&&s===u?.serviceSessionId&&t.id!==c;return(0,ka.useEffect)((()=>{r(t.id===c)}),[t,c]),{body:l,subEvent:d,showOptions:n,chooseAgain:p,onChoiceClickHandler:e=>{const n=G();p&&o("new_topic",n),i(e.text,n),a({type:"pick_choice",originMessage:t.id,choice:{id:e.id,chooseAgain:p},transactionId:n}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}})(e);return(0,li.jsxs)(li.Fragment,{children:[(0,a.toChildArray)(t).filter(mn).map((e=>(e.props={...e.props,event:s,descriptorId:i,showTranslationToggle:!1},e))),l&&(0,li.jsxs)("button",{type:"button",className:xi("button","button--secondary","button--choose-again"),"aria-expanded":c?"true":"false",onClick:d,"aria-describedby":i,children:[r(c?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,li.jsx)(zi,{name:"chevronDown",size:"8",alt:""})]}),c&&(0,li.jsx)(Oi,{type:"choice-prompt",showParticipant:!1,event:e,...n,children:(0,li.jsx)("ul",{className:xi("choice-prompt","choice-prompt--many"),children:o?.choices?.map((e=>(0,li.jsx)("li",{className:xi("choice-prompt__item",{[`choice-prompt__item--${e?.category}`]:!!e.category}),children:(0,li.jsx)("button",{type:"button",className:xi("button","button--primary"),onClick:()=>{u(e)},children:e.text})},e.id)))})})]})},text:Fo,image:({event:e,descriptorId:t,...n})=>{const{body:r}=vi(e),[a,i]=(0,ka.useState)(!1),o=La();return(0,li.jsxs)(Oi,{event:e,type:"image",...n,children:[(0,li.jsx)("img",{src:r?.url,id:t,alt:r?.description||void 0,onLoad:()=>{o(Yr(e.payload.id)),i(!0)}}),r?.isZoomable&&a&&(0,li.jsx)(zo,{description:r?.description,url:r?.url})]})},splash:({event:e,...t})=>{const{payload:n}=e,{body:r}=vi(e),a=Xi({originMessage:n.id,transactionId:n.transactionId});return(0,li.jsx)(Oi,{type:"splash",event:e,onClick:a,...t,bodyProps:{dangerouslySetInnerHTML:{__html:r?.text||""}}})},video:({event:e,descriptorId:t,...n})=>{const{body:r}=vi(e);return _i(e).push("message--type-video"),(0,li.jsxs)(Oi,{event:e,type:"video",...n,children:[(0,li.jsx)("div",{id:t,className:xi("visually-hidden"),children:r?.description}),(0,li.jsx)("iframe",{title:r?.description||"",src:r?.url,allow:"autoplay; encrypted-media",allowFullScreen:!0})]})},upload:({event:e,...t})=>{const{t:n}=Wa(),{body:r}=vi(e),{fromClient:a,id:i}=e.payload,{filename:o,id:s,isDeleted:c,url:l}=r,u=ei(),d=(e=>{const{processingFileUploads:t}=qt((({state:e})=>e));return(0,ka.useMemo)((()=>{if(t.some((t=>t===e)))return Uo;try{return sessionStorage.getItem(`image-${e}`)}catch(e){return}}),[e,t])})(i),p=(0,ka.useMemo)((()=>n(c||!l&&!s?"fileUpload.srFileUploadedText":"fileUpload.srFileDownloadText",{fileName:o})),[l,s,o,c,n]);return(0,li.jsx)(Oi,{event:e,type:"upload",...t,children:d&&d!==Uo?(0,li.jsx)(Bo,{img:d,filename:o}):(0,li.jsxs)(Ho,{fileId:s,isDeleted:c,onClickHandler:()=>{s&&o&&u.downloadFile(s,o)},url:l,target:a?void 0:"_blank",children:[(0,li.jsx)(zi,{name:"download",size:"16",alt:p}),(0,li.jsx)("span",{"aria-hidden":"true",className:xi("file-download"),children:o})]})})},cta:({event:e})=>{const{body:t}=vi(e),n=Xi({originMessage:e.payload.id,transactionId:e.payload.transactionId}),{emitEvent:r}=ri(),a=Mi(),i=(0,ka.useCallback)((()=>r(`action.${R}`,{type:R,originMessage:e.payload.id,link:{url:t?.buttonLink}})),[r,t,e]);return(0,li.jsxs)(Oi,{type:"cta",event:e,children:[(0,li.jsx)("div",{className:xi("cta__content"),id:a,dangerouslySetInnerHTML:t?.description?{__html:t.description}:void 0,onClick:n}),(0,li.jsx)("a",{className:xi("button","button--primary"),"aria-describedby":a,href:t?.buttonLink,rel:"noreferrer",target:t?.buttonNewTab?"_blank":"_self",onClick:i,children:t?.buttonText})]})},carousel:({event:e})=>{const{body:t}=vi(e),n=t.cards;return(0,li.jsx)(Oi,{event:e,modifiers:"type-carousel",children:(0,li.jsx)(Vi,{items:n,getItemKey:Gi,getItemLabel:Wi})})},card:({event:e})=>{const{body:t}=vi(e),n=Mi();return(0,li.jsx)(Oi,{type:"card",event:e,children:(0,li.jsx)(Pi,{id:n,...t})})}},info:{text:Fo,divider:({event:e,...t})=>{const n=Qi[H[e.payload.body.subtype]]||Qi.default;return(0,li.jsx)(n,{event:e,...t})},translation:({event:e,...t})=>{const{t:n}=Wa(),{body:r}=vi(e);return(0,li.jsx)(Oi,{type:"text",event:e,...t,children:n(r.key.join("."),r.variables)})},timeIndicator:no},participant:{participant:({event:e})=>{const{participant:t}=e.payload,{body:n}=(e=>{const{translatedBody:t,translation:n,body:r}={body:e.payload?.participant?.introduction,translatedBody:e.payload?.participant?.translatedIntroduction,translation:e.payload?.participant?.translation},a=!!t,i=qt(yi(e));return{body:i&&a?t:r,hasTranslation:a,isTranslated:i&&a,userLocale:n?.locale}})(e);return n?(0,li.jsx)(Yi,{graphicSrc:t?.avatar,graphicType:t?.avatar?"avatar":void 0,iconName:t?.avatar?void 0:"balloon",dividerType:"participant",title:n}):null}},service_data:{suggestion:({event:e,...t})=>{const[n,r]=(0,ka.useState)(!0),a=La(),i=Ja(),{sendAction:o,addMessageBubble:s}=ri(),{suggestions:c,payload:l}=(e=>{const{payload:t}=e,{body:n}=vi(e);return{suggestions:n,payload:t}})(e),{showSuggestions:u}=an(),d=xn(),{t:p}=Wa(),f=p("suggestions.headingText"),h=p("suggestions.footerText"),m=(0,ka.useMemo)((()=>d.some((({payload:e,type:t})=>"message"===t&&e?.transactionLast))),[d]),y=(0,ka.useCallback)((({id:e,question:t})=>{r(!1),a(Wn(!0));const n=G();o({type:L,originMessage:l.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n}),s(t,n)}),[a,o,l.id,s]);return n&&!i&&m&&u?(0,li.jsxs)("div",{className:xi("suggestions","suggestions--conversation"),children:[f&&(0,li.jsx)("p",{className:xi("suggestions__heading"),children:f}),(0,li.jsxs)(Oi,{type:"suggestions",showParticipant:!1,event:e,...t,children:[(0,li.jsx)(Ji,{className:"suggestions__list--conversation",onClickSuggestion:y,suggestions:c}),h&&(0,li.jsx)("p",{className:xi("suggestions__footer"),children:h})]})]}):null}}},Vo=({children:e})=>{const{customComponents:t}=an(),n=(0,ka.useMemo)((()=>Object.keys($o).reduce(((e,n)=>(e[n]={...$o[n],...t?t[n]:{}},e)),{fallback:Fo})),[t]);return(0,li.jsx)(di.Provider,{value:n,children:e})},Go=({children:e})=>{const{isMinimized:t}=qa(),n=(0,ka.useRef)(0),{sendAction:r}=ri(),{hasCountdown:a,isActive:i,stopCountdown:o}=Li(),s=(0,ka.useCallback)((()=>{if(t)return;const e=(new Date).getTime(),s=()=>{r({type:"interactivity_update"}),n.current=e};a&&i&&(s(),o()),e-n.current>15e3&&s()}),[r,a,i,o,t]);return(0,li.jsx)("div",{className:xi("activity-monitor"),tabIndex:-1,onMouseDown:s,onKeyUp:s,onTouchStart:s,onMouseMove:s,onWheel:s,onPointerDown:s,onPointerMove:s,children:(0,li.jsx)(Ii.Provider,{value:s,children:e})})},Wo=["text","choice_prompt","image","video"],qo=()=>{const e=(()=>{const e=ei();return(0,ci.useSyncExternalStore)(y.subscribe,(()=>e.conversation))})(),t=(0,ka.useRef)(),n=(0,ka.useRef)(),r=La(),a=Qa(),i=(0,ka.useRef)(null),{initCountdown:o,endCountdown:s}=Li(),{emitEvent:c}=ri(),{hasPrompt:l,continueChat:u}=ki(),d=(0,ka.useRef)(l);return(0,ka.useEffect)((()=>{d.current=l}),[l]),(0,ka.useEffect)((()=>{e.socket&&(e.onConnection((({currentState:e})=>{if("attach_channel_erred"===e){const e=new x;return r(gr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),!0}return!1})),e.onError((e=>{const t=new Kn(e);r(gr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r(Lr())})),e.onOpen((()=>{r(vr())})))}),[e,e.socket,r]),(0,ka.useEffect)((()=>{e.onConnection((({connected:t})=>!!t&&(n.current&&e?.removeListener("message",n.current),n.current=e=>{switch(e.type){case"ui":switch(e.payload.type){case"idle_detach_countdown":"idle_detach_countdown"===e.payload.body.type&&o(e.payload.body.duration);break;case"loading":r(Xr(e.payload.body.loading));break;case"idle_detach_countdown_elapsed":s(void 0,!0);break;case"resume_conversation_prompt":r(Dr());break;case"user_first_response":r(Wn(!0)),c("system.userFirstResponse",e.payload.body);break;case"translation_proposal":r(Ca(e.payload.body))}break;case"service_attach":const{service:{name:t,settings:{proactiveMessages:{enabled:n},entry:a},sessionId:i}}=e.payload;r(fa(n||!1)),t&&c("system.serviceChanged",t),i&&r(Ur(i)),r(ta(a)),r(Vr({uploads:{enabled:a.options?.upload?.enabled||!1}}));break;case"context":e.payload.contentLocale&&e.payload.userLocale&&r(cr(e.payload.userLocale));break;case"message":switch(e.payload.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"cta":case"custom":case"carousel":case"card":if(e.payload.service&&e.payload.service.serviceSessionId&&r(Ur(e.payload.service.serviceSessionId)),e.payload.fromClient){r(Ir(e));break}d.current&&u(),r(Tr(e))}break;case"participant":(e=>{const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:a}=t;!n&&"string"!=typeof a&&a?.name&&r(Wr(a.name)),r(Zr(t)),"string"!=typeof a&&a.introduction&&r(Tr({...e,payload:{...t,type:"participant"}}))})(e);break;case"service_data":e.payload.persist&&r(ea(e.payload));break;case"info":"divider"!==e.payload.type&&"text"!==e.payload.type&&"translation"!==e.payload.type||r(Tr({type:"info",payload:{...e.payload,participant:null}}));break;case"error":switch(e.payload.type){case"find_conversation":const t=new w(e);r(gr({name:t.name,action:t.action,message:t.message,originalEvent:t.originalEvent,originalError:t.originalError}));break;case"conversation":const n=new x(e);r(gr({name:n.name,message:n.message,langKey:n.langKey,originalEvent:n.originalEvent,originalError:n.originalError,action:n.action}))}}return e},e.onMessage(n.current),!0)))}),[u,e,r,c,s,a,o]),(0,ka.useEffect)((()=>{e.onConnection((({connected:n})=>!!n&&(t.current&&e.removeListener("message",t.current),t.current=async({payload:e})=>{if("history_changed"===e?.type)try{const t=await r(hr(e)).unwrap();t&&"service"in t&&r(Kr(t))}catch(e){}return Wo.includes(e?.type)?(e.id!==i.current&&a.emit("message",e),i.current=e.id,e):e},e.addListener("message",t.current),!0)))}),[e,r,a]),null},Ko=({children:e})=>{const{t}=Wa(),n=La(),r=ei(),{addUploadBubble:a}=ri(),i=(0,ka.useCallback)((async(e,t)=>{n(oa(t));const r=await(e=>new Promise(((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>{"string"==typeof r.result&&t(r.result)},r.onerror=e=>n(e)})))(e),a=new Image;a.src=r,await a.decode();const i=(e=>{const t=document.createElement("canvas"),n=t.getContext("2d"),[r,a]=(e=>{const{height:t,width:n}=e;return n>t&&n>600?[600,600*t/n]:t>600?[600*n/t,600]:[n,t]})(e);return t.width=r,t.height=a,n?.drawImage(e,0,0,r,a),t.toDataURL()})(a);try{sessionStorage.setItem(`image-${t}`,i)}catch(e){}finally{n(sa(t))}}),[n]),o=(0,ka.useCallback)((e=>{const o=G(),s=r.uploadFile(e,(e=>{n(ia({fileId:o,progress:Math.ceil(e)}))}),(async t=>{const{id:r,transactionId:s,occurredAt:c,body:{contentType:l,filename:u,filesize:d}}=t;n(ra(o)),a(r,s,c,l,u,d),l.includes("image/")&&await i(e,r)}),(e=>{let r;switch(e?.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(aa({fileId:o,errorText:r}))}));n(zr({fileId:o,fileName:e.name,uploadHandle:s}))}),[i,a,r,n,t]);return(0,li.jsx)(Ci.Provider,{value:o,children:e})},Jo=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=Li();return((e,t)=>{const n=(0,ka.useRef)(e);(0,ka.useEffect)((()=>{n.current=e}),[e]),(0,ka.useEffect)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n&&n>0?1e3:null),null},Xo=()=>{const{initUserSelectedOptions:e}=ji(),t=(0,ka.useRef)(!1),n=an();return(0,ka.useEffect)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null};function Yo(e,t,n=[]){const r=Qa(),a=(0,ka.useRef)(t);(0,ka.useEffect)((()=>{if(!n.every(Boolean))return;const t=(...e)=>a.current?.(...e);return r.emit("function.register",e,t),()=>r.emit("function.unregister",e,t)}),[r,e,...n])}const Zo=()=>{const e=an(),{sendMessage:t,sendContext:n,sendAction:r}=ri(),a=La(),{setVisibility:i,visible:o}=qa(),s=(0,ka.useRef)(o),c=Qa(),l=ei(),u=_n(),d=(0,ka.useRef)(null),p=(0,ka.useRef)(null),{isInline:f,isResolving:h}=Tn(),m=qt(oi),y=(()=>{const{get:e}=ti();return e?e("conversationUrl"):null})(),g=(0,ka.useRef)(null),v=Ni(),{enableTranslations:b,disableTranslations:x}=gi();return(0,ka.useEffect)((()=>{s.current=o}),[o]),Yo("askText",(e=>{t({body:e})}),[l.send]),Yo("setVariables",(e=>{n({variables:e})}),[l.send]),Yo("getVisibility",(e=>{e?e(s.current):console.warn("A callback function is required for the getVisibility action.")})),Yo("setVisibility",(e=>{const t="string"==typeof e||null===e?e:e.visibility;Object.values(Mt).includes(t)?(v(),i(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[e.api]),Yo("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[l.send]),Yo("setTopic",(({name:e,fallbackMessage:t,message:n,userTriggered:i})=>{i&&a(Bn({showSuggestions:!1})),e&&t?r({type:P,body:{name:e,fallbackMessage:t,message:n}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[l.send]),Yo("setContext",(e=>{n(e)}),[l.send]),Yo("setTranslation",(({enabled:e,locale:t})=>{e?b(t,F):x()}),[l.send]),(0,ka.useEffect)((()=>{h||m||(g.current&&g.current!==y&&c.emit("unreadMessageCount",u),o===Mt.open&&o!==p.current&&0!==d.current&&c.emit("unreadMessageCount",0),o!==Mt.open&&u!==d.current&&c.emit("unreadMessageCount",u),p.current=o,d.current=u,"string"==typeof y&&(g.current=y))}),[u,o,c,f,h,m,y]),null},Qo=({children:e})=>{const t=Qa(),n=(0,ka.useRef)(null),[r,a]=(0,ka.useState)(),i=(0,ka.useRef)(!0),o=(0,ka.useCallback)((e=>{i.current&&(a(e),t.emit("aria-live",e))}),[a,t]);return(0,ka.useEffect)((()=>(n.current=null,r?.messageText&&(n.current=setTimeout((()=>{o({}),n.current&&clearTimeout(n.current)}),600)),()=>{n.current&&clearTimeout(n.current)})),[r,o]),(0,ka.useEffect)((()=>()=>{i.current=!1}),[]),(0,li.jsxs)(Za.Provider,{value:o,children:[e,(0,li.jsxs)("div",{className:xi("app__live-container"),children:[(0,li.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:xi("visually-hidden"),children:r?.ariaLive===U?r?.messageText:null}),(0,li.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:xi("visually-hidden"),children:r?.ariaLive===B?r?.messageText:null})]})]})},es=()=>{const{t:e}=Wa(),t=xn(),n=(0,ka.useRef)(0),r=(0,ka.useRef)(0),a=gn().historyLoaded,{sendPolite:i}=ai(),{isOpen:o}=qa(),s=(0,ka.useRef)(null),c=(0,ka.useRef)(null),l=(0,ka.useMemo)((()=>on((t=>{const n=t.filter((({payload:e})=>!e.fromClient&&!e.fromHistory)).length;n>r.current&&(i(e("message.srNewEventCount",{newCount:n-r.current})),r.current=n)}),1e3)),[i,e]);return(0,ka.useEffect)((()=>{t.length>n.current&&(o&&(c.current=l(t)),n.current=t.length)}),[t,l,o]),(0,ka.useEffect)((()=>{s.current&&!o&&c.current&&(c.current(!0),c.current=null)}),[o]),(0,ka.useEffect)((()=>{a&&setTimeout((()=>{i(e("window.srTexts.onHistoryLoad"))}),500)}),[a,e,i]),null},ts=()=>{const{t:e}=Wa(),{isOpen:t,isVisible:n}=qa(),r=_n(),{sendPolite:a}=ai(),i=(0,ka.useMemo)((()=>on(a,2e3)),[a]),o=(0,ka.useRef)(null),s=(0,ka.useRef)(null);return(0,ka.useEffect)((()=>{o.current!==n&&!n&&s.current&&s.current(),0!==r&&!t&&n&&(s.current=i(e("message.srTextUnreadCount",{unreadCount:r}))),o.current=n}),[r,t,n,i,e]),null},ns=({store:e,children:t,eventBus:n,api:r})=>((0,ka.useErrorBoundary)((t=>{console.error(t),e.dispatch(Xn(t))})),(0,li.jsx)(Zt,{store:e,children:(0,li.jsx)(Ya.Provider,{value:n,children:(0,li.jsx)(Xa.Provider,{value:r,children:(0,li.jsx)(Qo,{children:(0,li.jsx)(ui,{children:(0,li.jsxs)(Vo,{children:[(0,li.jsx)(Xo,{}),(0,li.jsx)(qo,{}),(0,li.jsx)(ts,{}),(0,li.jsx)(es,{}),(0,li.jsx)(Jo,{}),(0,li.jsxs)(Go,{children:[(0,li.jsx)(Zo,{}),(0,li.jsx)(Ko,{children:t})]})]})})})})})})),rs=It(bn,(e=>e.filter((e=>wr(e)&&"service_data"!==e.type&&e.payload?.messageStatus===I)))),as=It([rs],(e=>e.filter((e=>"participant"!==e.type)).at(-1))),is=It(rs,(e=>e.filter((({payload:e})=>e?.id)).map((({payload:e})=>e.id)))),os=It((({state:e})=>e.options.features?.webNotifications),(e=>e?.enabled)),ss=()=>{const{t:e}=Wa(),{showDisclaimer:t}=an();return t?(0,li.jsxs)("div",{className:xi("disclaimer"),tabIndex:0,children:[(0,li.jsx)("h2",{className:xi("disclaimer__title"),children:e("disclaimer.title")}),(0,li.jsx)("div",{className:xi("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]}):null},cs=It([({forms:e})=>e,(e,{formId:t})=>t],((e,t)=>e[t])),ls=It(cs,(e=>e?.controls||{})),us=It(ls,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),ds=It([ls,(e,{name:t})=>t],((e,t)=>e[t]?.value)),ps=It([ls,(e,{name:t})=>t],((e,t)=>e[t]?.touched)),fs=(0,a.createContext)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),{Provider:hs,Consumer:ms}=fs,ys=fs;function gs(){return(0,ka.useContext)(ys)}function vs(e){const t=La(),{formId:n,updateControlValue:r,updateControlTouched:a,errors:i}=gs(),o=!!qt((e=>cs(e,{formId:n}))),s=qt((t=>ds(t,{formId:n,name:e}))),c=qt((t=>ps(t,{formId:n,name:e}))),l=i?.[e],u=!l;(0,ka.useEffect)((()=>{o&&t(rr({formId:n,name:e}))}),[o,n,e,t]),(0,ka.useLayoutEffect)((()=>()=>{t(ar({formId:n,name:e}))}),[o,n,e,t]);const d=(0,ka.useCallback)((t=>r(e,t.target.value)),[e,r]),p=(0,ka.useCallback)((()=>{a(e,!0)}),[a,e]);return[(0,ka.useMemo)((()=>({name:e,onInput:d,onBlur:p,value:s})),[e,d,p,s]),(0,ka.useMemo)((()=>({isValid:u,error:l,touched:c})),[u,l,c])]}function bs(e){const{t}=Wa(),{sendAssertive:n}=ai(),{hasLimit:r,limit:a}=(()=>{const{entryMeta:{options:e,optionsOverride:t}}=gn(),{limit:n}=t?.text||e?.text||{limit:null};return{hasLimit:null!==n,limit:null!==n?n:null}})(),i=(0,ka.useMemo)((()=>on(n,300)),[n]),o=(0,ka.useMemo)((()=>on(((e,n)=>{e&&i(t("input.srCharacterLimitText",{limit:n}))}),300)),[i,t]),[{value:s}]=vs(e),c=a&&r&&s?a-s.length:a,l=!(!r||"number"!=typeof c)&&c<=50,u=!(!r||!c)&&c<0;return(0,ka.useEffect)((()=>{o(l,c)}),[l,c,o]),{hasCharacterLimit:r,characterLimit:a,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}function xs(){const{abortTransaction:e,clearEntryAbortTransaction:t}=(()=>{const e=La(),{entryMeta:{actions:t,translatedActions:n}}=gn();return{abortTransaction:n?.abortTransaction||t?.abortTransaction,clearEntryAbortTransaction:()=>{e(na())}}})(),n=ei();return e?(0,li.jsx)("li",{className:xi(["cvco-conversation__item","cvco-conversation__item--abort-transaction"]),children:(0,li.jsx)("button",{className:xi(["button","button--secondary","abort-transaction__button"]),type:"button",onClick:()=>{n.send("action",{type:P,body:{name:e.topicName,fallbackMessage:e.topicFallbackMessage}}),t()},children:e.label})}):null}const ws=(0,a.createContext)(null),_s=()=>{const e=(0,ka.useContext)(ws);if(!e)throw new Error("useChatScrollContext has to be used within <ChatScrollContext.Provider>");return e},Cs=ws,Ss=e=>{const t=(()=>{const e=(0,ka.useContext)(di);if(!e)throw new Error("useComponentContext has to be used within <ComponentContext.Provider>");return e})(),n=t[e.type];let r=n[e.payload.type],a=null;return"choice_prompt"===e.payload.type&&(a=n[e.payload.body.prompt.type]),"participant"===e.type&&(r=n[e.type]),r&&"function"!=typeof r&&(r=r[e.payload.body.type]),[r||t?.fallback,a]},Es=({event:e,newParticipant:t})=>{const{eventRefs:n,unreadIds:r}=_s(),{sendAction:a}=ri(),i=e.payload.id?n[e.payload.id]:void 0,{containerRef:o,isVisible:s}=Ka({containerRef:i,freezeOnceVisible:!0}),c=La(),[l,u]=Ss(e);if((0,ci.useEffect)((()=>{if(s&&r?.includes(e.payload.id)){const t=r.reduce(((t,n)=>e?.payload?.id&&n&&!t.includes(e.payload.id)?t.concat(n):t),[]);c(Hr(t)),a({type:M,events:t})}}),[c,e.payload.id,s,a,r]),!l)return null;const d=["conversation__item"];return"info"===e.type?d.push("conversation__item--source-info"):e.payload.fromClient?d.push("conversation__item--source-user"):d.push("conversation__item--source-agent"),t&&d.push("conversation__item--new-participant"),(0,li.jsxs)("li",{className:xi(d),ref:o,children:[e.payload.timeIndicator&&(0,li.jsx)(no,{event:e}),(0,li.jsx)(l,{event:e,children:(0,li.jsx)(u,{event:e})})]})},js=()=>{const{id:e}=jn()||{};return(0,li.jsx)("li",{className:xi("conversation__item","conversation__item--source-agent"),children:(0,li.jsxs)("div",{className:xi("message","message--source-agent","message--type-loading"),children:[(0,li.jsx)(Ai,{eventPayload:{fromClient:!1,participant:e}}),(0,li.jsx)("div",{className:xi("message__body"),children:(0,li.jsxs)("span",{className:xi("loader"),children:[(0,li.jsx)("span",{className:xi("loader__part","one")}),(0,li.jsx)("span",{className:xi("loader__part","two")}),(0,li.jsx)("span",{className:xi("loader__part","three")}),(0,li.jsx)("span",{className:xi("loader__part","four")})]})})]})})},Ts=()=>{const e=xn();let t;return(0,li.jsx)(li.Fragment,{children:e.map((e=>{const{type:n,payload:r}=e;let a=!1;if("info"===n||"message"===n){const{participant:n,fromClient:i}=r,o=i?"seamly-client-participant":n;"info"!==e.type&&t!==o&&(a=!0),t=o}return(0,li.jsx)(Es,{event:e,newParticipant:a},e.payload.key||e.payload.id)}))})},Is=()=>{const{t:e}=Wa(),t=wn(),n=((e,t=20)=>{const[n,r]=(0,ka.useState)(e),a=(0,ka.useRef)(null);return(0,ka.useEffect)((()=>(a.current=setTimeout((()=>r(e)),t),()=>{a.current&&clearTimeout(a.current)})),[e,t]),n})(t,t?0:20),{isOpen:r}=qa(),a=Cn(),i=mi();return(0,li.jsxs)(li.Fragment,{children:[r&&(0,li.jsx)("a",{className:xi("skip-link"),href:`#${a}`,onClick:e=>{e.preventDefault(),i()},children:e("skiplinkText")}),(0,li.jsx)("div",{className:xi("chat__body"),children:(0,li.jsxs)("div",{className:xi("conversation__container"),children:[(0,li.jsx)(ss,{}),(0,li.jsxs)("ol",{className:xi("conversation"),children:[(0,li.jsx)(Vo,{children:(0,li.jsx)(Ts,{})}),n?(0,li.jsx)(js,{}):null,(0,li.jsx)(xs,{})]})]})})]})};function Ns(e,t){const n=(0,ka.useRef)(null),r=(0,ka.useRef)(e);return(0,ka.useEffect)((()=>{r.current=e}),[e]),(0,ka.useEffect)((()=>"number"!=typeof t?()=>{}:(n.current=setTimeout((()=>r.current()),t),()=>{n.current&&clearTimeout(n.current)})),[t]),n}const Ls={visible:xi("transition--visible"),in:xi("transition--in"),visuallyHidden:xi("visually-hidden")},ks=Object.values(Ls),Ms=e=>{const t=(0,ka.useRef)(null);t.current=e;const n="function"==typeof e;return(0,ka.useMemo)((()=>n?(...e)=>t.current(...e):void 0),[n])},As="notRendered",Os="rendered",Ps="visuallyHidden",Rs=({children:e,isActive:t,timeout:n=300,transitionStartState:r=As,onInTransitionComplete:i=()=>{},onOutTransitionComplete:o=()=>{},exitAfter:s,enterDelay:c=0})=>{const l=(0,ka.useRef)(!1),u=(0,ka.useRef)(null),d=(0,ka.useRef)(null),p=r===Ps,[f,h]=(0,ka.useState)((()=>p?[Ls.visuallyHidden]:[])),[m,y]=(0,ka.useState)((()=>0===c)),g=(0,ka.useMemo)((()=>s?s+c:s),[c,s]);Ns((()=>y(!1)),t?g:void 0),Ns((()=>y(!0)),t?c:void 0);const v=(0,ka.useMemo)((()=>m&&t),[t,m]),b=Ms(i),x=Ms(o),w="notRendered"!==r||f.length>0;return(0,ka.useEffect)((()=>(l.current&&!v&&(h([Ls.visible]),u.current=setTimeout((()=>{h([...p?[Ls.visuallyHidden]:[]]),x&&(d.current=requestAnimationFrame((()=>{x()})))}),n)),!l.current&&v&&(h([Ls.visible]),d.current=requestAnimationFrame((()=>{d.current=requestAnimationFrame((()=>{h([Ls.visible,Ls.in]),b&&(u.current=setTimeout((()=>{b()}),n))}))}))),l.current=v,()=>{u.current&&clearTimeout(u.current),d.current&&cancelAnimationFrame(d.current)})),[p,b,x,n,v]),(0,li.jsx)(li.Fragment,{children:w&&(0,a.toChildArray)(e).filter(mn).map((e=>{const{className:t=""}=e.props,n=t.split(" ").filter((e=>!ks.includes(e)));return(0,a.cloneElement)(e,{className:[...n,...f].join(" ")})}))})},Ds=({isAside:e=!1})=>{const{isInline:t}=Tn(),{t:n}=Wa(),{sendAction:r,addMessageBubble:a}=ri(),{isOpen:i,setVisibility:o}=qa(),{showSuggestions:s}=an(),c=Mi(),l=mi(),u=(0,ka.useRef)(null),{sendPolite:d}=ai(),p=qt(oi),{hasCountdown:f,endCountdown:h}=Li(),{hasPrompt:m,continueChat:y}=ki(),g=Ja(),v=gn().serviceData.suggestion;const{body:b}=vi({payload:v,type:"service_data"}),x=(0,ka.useMemo)((()=>p?[]:Array.isArray(b)?b:[]),[b,p]),w=(0,ka.useRef)(),_=(0,ka.useRef)(!1),C=(0,ka.useRef)(),S=!!x?.length,E=t?(g||i)&&!e:g,j=(0,ka.useRef)(E),T=S&&!E&&s,I=S?x:C.current;C.current=I;const N=(0,ka.useMemo)((()=>{const t=["suggestions"];return e&&t.push("suggestions--aside"),xi(t)}),[e]),k=(0,ka.useCallback)((({id:e,question:t})=>{f&&h(!0),m&&y();const n=G();r({type:L,originMessage:v.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n}),a(t,n),i||o({visibility:Mt.open}),l()}),[a,y,h,l,f,m,v,r,o,i]);(0,ka.useEffect)((()=>{if(w.current!==x&&!E){if(S){const e=_.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout((()=>{d(e)}),30)}else _.current&&d(n("suggestions.srUnavailableText"));w.current=x}!j.current&&E?(hn(u.current,l),d(n("suggestions.srUnavailableText"))):!S&&_.current&&hn(u.current,l),_.current=S,j.current=E}),[x,S,E,l,d,n]);const M=n("suggestions.headingText"),A=n("suggestions.footerText"),O=M?"section":"div";return(0,li.jsx)(Rs,{isActive:!!T,transitionStartState:As,children:(0,li.jsxs)(O,{className:N,"aria-labelledby":M?c:void 0,ref:u,children:[M&&(0,li.jsx)("p",{id:c,className:xi("suggestions__heading"),children:M}),!!I&&(0,li.jsx)(Ji,{suggestions:I,onClickSuggestion:k}),A&&!i&&(0,li.jsx)("p",{className:xi("suggestions__footer"),children:A})]})})},zs=(0,ci.forwardRef)((({children:e,className:t=""},n)=>{const{isOpen:r,isVisible:a,setVisibility:i}=qa(),{namespace:o,layoutMode:s}=an(),{isInline:c}=Tn(),l=wi(),u=Ja(),{t:d}=Wa(),p=["chat",`chat--layout-${s}`,`namespace--${o}`,t];return"function"!=typeof l&&p.push(...l),r||"app"===s||p.push("chat--collapsed"),u&&p.push("chat--user-responded"),a&&(0,li.jsxs)("section",{className:xi(p),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!c&&r&&i({visibility:Mt.minimized})},tabIndex:-1,ref:n,"aria-label":d("chat.srLabel"),children:[(0,li.jsx)("div",{className:xi("chat-wrapper"),children:e}),"inline"===s&&r&&(0,li.jsx)(Ds,{isAside:!0})]})})),Fs=zs,Us=({children:e,handleClose:t,title:n,closeButtonText:r,srCloseButtonText:a,id:i})=>{const o=Mi();return(0,li.jsxs)("section",{tabIndex:-1,id:i,"aria-labelledby":n?o:void 0,className:xi("chat-status",n?void 0:"chat-status--condensed"),children:[(0,li.jsxs)("div",{className:xi("chat-status__body"),children:[n?(0,li.jsx)("h2",{className:xi("chat-status__title"),id:o,children:n}):null,e]}),"function"==typeof t&&(0,li.jsxs)("button",{type:"button",onClick:t,className:xi("button","button--tertiary","chat-status__close"),children:[r||(0,li.jsx)(zi,{name:"close",size:"16",alt:""}),a&&(0,li.jsx)("span",{className:xi("visually-hidden"),children:a})]})]})},Bs=({handleClick:e,icon:t,title:n,srButtonText:r})=>(0,li.jsxs)("button",{type:"button",onClick:e,className:xi("button","button--primary","chat-status__button"),children:[(0,li.jsx)(zi,{name:t,size:"16",alt:""}),n,r&&(0,li.jsx)("span",{className:xi("visually-hidden"),children:r})]});function Hs(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=(()=>{const{isActive:e,languages:t}=gi(),n=La(),{sendAction:r}=ri(),{translationProposal:a}=qt((e=>e.translations)),{enableTranslations:i}=gi(),{isOpen:o}=qa(),{userLocale:s}=Wa(),c=a?.proposedLocale,l=bi(c),u=(0,ka.useMemo)((()=>null!==a&&!e&&o&&s!==c&&t.some((e=>e.locale===c))),[a,e,o,s,c,t]);return{activateTranslationProposal:()=>{a?.proposedLocale&&i(a.proposedLocale,z)},dismissTranslationProposal:()=>{r({type:O,body:{type:D}}),n(Sa())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:a}})(),{id:a}=function(){const e=qt((({translations:e})=>e.containerId));return{id:e,focusContainer:hi(e)}}();return e&&t?(0,li.jsx)(Us,{handleClose:n,srCloseButtonText:t.srDismissButtonText,id:a,title:t.titleLabel,children:(0,li.jsx)(Bs,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})}):null}function $s(){const e=qt(oi),{isActive:t}=gi();return e||t?null:(0,li.jsx)(Hs,{})}const Vs=({label:e,checked:t,description:n,onChange:r,id:a,itemClassName:i})=>(0,li.jsxs)("li",{className:xi([i||"","translation-options__item"]),"aria-selected":t,role:"option",tabIndex:0,onClick:r,onKeyDown:e=>{"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),r())},id:a,children:[(0,li.jsx)(zi,{name:"check",size:"16",alt:""}),e," ",n&&(0,li.jsxs)("span",{children:["(",n,")"]})]}),Gs=({onChange:e,describedById:t})=>{const{context:{contentLocale:n}}=an(),{t:r}=Wa(),{languages:a,currentLocale:i,enableTranslations:o,disableTranslations:s}=gi(),c=mi(),l=t=>()=>{t&&(t===i||n===t?s():o(t,"translation_choice"),e(),c())},{primaryLanguages:u,remainingLanguages:d}=(0,ci.useMemo)((()=>a.reduce(((e,t)=>{const r=t.locale===n,a=((e,t,n)=>t===e.locale||!t&&n)(t,i,r);t.locale!==n&&e.remainingLanguages.push({...t,checked:a,isOriginal:r});const o=e.remainingLanguages.findIndex((e=>e.locale===i));return(r||a&&o>4)&&e.primaryLanguages.push({...t,checked:a,isOriginal:r}),e}),{primaryLanguages:[],remainingLanguages:[]})),[i,n,a]);return(0,li.jsxs)("ul",{"aria-describedby":t,role:"listbox",tabIndex:-1,className:xi("translation-options"),children:[u.map((({locale:e,nativeName:t,checked:n,isOriginal:a},i)=>(0,li.jsx)(Vs,{id:e,label:t,checked:n,description:a?r("translations.settings.original"):void 0,onChange:l(e),itemClassName:xi({"translation-options__item--original":a,"translation-options__item--selected":n&&0!==i})},e))),d.map((({locale:e,nativeName:t,checked:n,isOriginal:a})=>(0,li.jsx)(Vs,{id:e,label:t,checked:n,description:a?r("translations.settings.original"):void 0,onChange:l(e)},e)))]})},Ws=({className:e,children:t,onCancel:n,headingText:r,description:a,descriptionId:i,cancelButtonText:o,cancelButtonRef:s,disableButtonFocusing:c,position:l={horizontal:"left",vertical:"top"}})=>{const u=Mi(),{hideOption:d}=ji(),{focusButton:p}=Ti(),f=(0,ka.useCallback)((()=>{d(),c||p()}),[c,p,d]),h=(0,ka.useCallback)((()=>{n&&n(),f()}),[f,n]),m=(e=>{const t=(0,ka.useRef)(null);return(0,ka.useEffect)((()=>{const n=n=>{t.current&&n.target instanceof HTMLElement&&!t.current.contains(n.target)&&(n.preventDefault(),n.stopPropagation(),e())};return document.addEventListener("click",n,!0),document.addEventListener("touchstart",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("touchstart",n,!0)}}),[e,t]),t})(h);return(0,ka.useEffect)((()=>{fn(m.current)}),[m]),(0,li.jsx)("section",{className:xi("options",{"options--right":"right"===l.horizontal,"options--left":"left"===l.horizontal,"options--top":"top"===l.vertical,"options--bottom":"bottom"===l.vertical},e||""),"aria-labelledby":u,tabIndex:-1,ref:m,children:(0,li.jsxs)("div",{className:xi("options__body"),children:[(0,li.jsx)("h2",{id:u,className:xi("options__title"),children:r}),(0,li.jsxs)("button",{type:"button",onClick:h,"aria-describedby":u,className:xi("button","options__close"),ref:e=>{s&&(s.current=e)},children:[(0,li.jsx)(zi,{name:"close",size:"16",alt:""}),(0,li.jsx)("span",{children:o})]}),a?(0,li.jsx)("p",{className:xi("options__description"),id:i,children:a}):null,(0,li.jsx)("div",{className:xi("options__wrapper"),children:t})]})})},qs=function({onClose:e,position:t}){const{t:n}=Wa(),r=Mi();return(0,li.jsx)(Ws,{onCancel:e,headingText:n("translations.menu.title"),cancelButtonText:n("translations.settings.cancelButtonText"),description:n("translations.menu.description"),descriptionId:r,position:t,disableButtonFocusing:!0,children:(0,li.jsx)(Gs,{describedById:r,onChange:e})})};function Ks({children:e,position:t={horizontal:"left",vertical:"top"},classNames:n=[]}){const[r,a]=(0,ka.useState)(!1),i=(0,ka.useRef)(null),o=Mi();return(0,li.jsxs)("div",{className:xi("translations__container"),onKeyDown:e=>{r&&pn(e)===dn.Escape&&(a(!1),fn(i.current))},children:[(0,li.jsx)(Rs,{transitionStartState:As,isActive:r,children:(0,li.jsx)("div",{className:xi("options__dialog"),role:"dialog",children:(0,li.jsx)(qs,{onClose:()=>{a(!1)},position:t})})}),(0,li.jsx)("button",{type:"button",className:xi(["button","chat__options__button",...n]),id:o,onClick:()=>{a(!r)},onKeyDown:e=>{pn(e)===dn.ArrowDown&&(a(!0),e.preventDefault())},ref:i,"aria-haspopup":"dialog","aria-expanded":r,children:e})]})}const Js=({children:e,formId:t,persistData:n=!1,onError:r,onSubmit:a,validationSchema:i={},...o})=>{const s=La(),c=qt((e=>us(e,{formId:t}))),[l,u]=(0,ka.useState)(!1),[d,p]=(0,ka.useState)({}),{isValid:f,errors:h}=function(e,t){const n=(0,ka.useMemo)((()=>function(e,t={}){return Object.entries(t).reduce(((t,[n,r])=>{const a=Array.isArray(r)?r:[r];for(let r=0;r<a.length;r++)if(!a[r].fn(e[n],a[r].compareValue)){t[n]=a[r].errorText;break}return t}),{})}(e,t)),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(c,i),m=(0,ka.useMemo)((()=>({...h,...d})),[h,d]);(0,ka.useLayoutEffect)((()=>{s(tr({formId:t,persistData:n}))}),[t,n,s]),(0,ka.useEffect)((()=>()=>{s(nr({formId:t}))}),[t,n,s]);const y=(0,ka.useCallback)(((e,n)=>{s(ir({formId:t,name:e,value:n}))}),[t,s]),g=(0,ka.useCallback)(((e,n)=>{s(or({formId:t,name:e,touched:n}))}),[s,t]),v=(0,ka.useCallback)(((e,t)=>{p((n=>({...n,[e]:t})))}),[p]),b=(0,ka.useCallback)((e=>{e.preventDefault();const t="true"===e.submitter.getAttribute("aria-disabled");u(!t),!t&&f&&(s(Wn(!0)),a(c,{updateControlValue:y,setError:v}))}),[f,s,a,c,y,v]);(0,ka.useEffect)((()=>{r&&r({errors:m,isSubmitted:l,isValid:0===Object.keys(m).length})}),[l,m,r]);const x=(0,ka.useMemo)((()=>({formId:t,values:c,errors:m,isValid:0===Object.keys(m).length,isSubmitted:l,handleSubmit:b,validationSchema:i,updateControlValue:y,updateControlTouched:g})),[t,c,m,l,b,i,y,g]);return t?a?(0,li.jsx)(hs,{...o,value:x,children:e}):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)},Xs=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),Ys=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},Zs=e=>!!e?.length,Qs=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))},ec=e=>!!e,tc=function({className:e,disableValidationClasses:t=!1,...n}){const{handleSubmit:r,isValid:a,isSubmitted:i}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=gs();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),o=["form"];return!t&&i&&(o.push("form--submitted"),a?o.push("form--valid"):o.push("form--invalid")),(0,li.jsx)("form",{onSubmit:r,className:xi([...o,e]),...n})};function nc({id:e,error:t}){const[n,r]=(0,ka.useState)(!1);return(0,ka.useEffect)((()=>{const e=setTimeout((()=>r(!0)),300);return()=>clearTimeout(e)}),[]),(0,li.jsx)("div",{className:xi("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&(0,li.jsxs)("span",{id:e,className:xi("error__message"),children:[(0,li.jsx)(zi,{name:"error",size:"16",alt:""}),t]})})}const rc=({contentHint:e,id:t,labelText:n,labelClass:r,validity:a,errorText:i,children:o})=>(0,li.jsxs)(li.Fragment,{children:[e&&(0,li.jsx)("span",{id:`${t}-content-hint`,className:xi("input__content-hint"),children:e}),(0,li.jsx)(nc,{id:`${t}-error`,error:!a&&i}),(0,li.jsxs)("div",{className:xi("form-control__wrapper"),children:[(0,li.jsx)("label",{htmlFor:t,className:xi(r),children:n}),o]})]}),ac=function({id:e,name:t,type:n,labelText:r,labelClass:a,contentHint:i=null,focus:o,"aria-invalid":s,"aria-describedby":c,...l}){const u=(0,ka.useRef)(null),{isSubmitted:d}=gs(),[p,{error:f}]=vs(t),h=d&&f,m=[];return c&&m.push(c),i&&m.push(`${e}-content-hint`),h&&m.push(`${e}-error`),(0,ka.useLayoutEffect)((()=>{u.current&&o&&u.current.focus()}),[o]),(0,li.jsx)(rc,{id:e,contentHint:i,validity:!h,errorText:f,labelText:r,labelClass:a,children:(0,li.jsx)("input",{...p,...l,ref:u,id:e,type:n,"aria-invalid":s||h?"true":"false","aria-describedby":m.join(" ")||void 0,name:t})})};function ic({controlName:e,describedById:t}){const{t:n}=Wa();return(0,li.jsxs)(tc,{noValidate:"true",className:xi("options__form"),children:[(0,li.jsx)(ac,{id:"email-id",name:e,type:"email",className:xi("transcript__input"),"aria-describedby":t,labelClass:xi("label"),labelText:n("options.sendTranscript.label")}),(0,li.jsx)("div",{className:xi("options__actions"),children:(0,li.jsx)("button",{type:"submit",className:xi("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const oc="email",sc={sendTranscript:()=>{const[e,t]=(0,ka.useState)(void 0),{hideOption:n}=ji(),{focusButton:r}=Ti(),{t:a}=Wa(),i=Mi(),{sendAction:o}=ri(),s=(0,ka.useMemo)((()=>({[oc]:[Xs(ec,a("options.sendTranscript.noEmailText")),Xs(Qs,a("options.sendTranscript.invalidEmailText"))]})),[a]),c=(0,ka.useCallback)((e=>{const t=e[oc].trim();o({type:"send_transcript",body:{emailAddress:t}}),n(),r()}),[o,n,r]),l=(0,ka.useCallback)((({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)}),[t]);return(0,li.jsx)(Ws,{className:e,headingText:a("options.sendTranscript.title"),cancelButtonText:a("options.cancelButtonText"),description:a("options.sendTranscript.description"),descriptionId:i,position:{vertical:"top",horizontal:"right"},children:(0,li.jsx)(Js,{formId:"sendTranscript",onSubmit:c,validationSchema:s,onError:l,children:(0,li.jsx)(ic,{controlName:oc,describedById:i})})})}},cc=()=>{const{optionActive:e}=ji(),t=(0,ka.useRef)(),n=sc[t.current??e];return e&&(t.current=e),n?(0,li.jsx)(n,{}):null},lc=()=>{const{t:e}=Wa(),{menuOptions:t,showOption:n,panelActive:r,hideOption:a}=ji(),{id:i}=Ti(),o=(0,ka.useRef)(null),[s,c]=(0,ka.useState)(!1),l=(0,ka.useRef)(null),u=t.length,d=(0,ka.useRef)([]),p=(0,ka.useRef)(!1),f=u>1,h=t[0],m=(0,ka.useMemo)((()=>h?.name?.trim().replace(/\s+/g,"")),[h]);return(0,ka.useEffect)((()=>()=>{o.current&&clearTimeout(o.current)}),[]),(0,ka.useEffect)((()=>{s&&!p.current&&requestAnimationFrame((async()=>{await pi(60);const e=t.findIndex((e=>e.available)),n=-1===e?0:e;d.current&&fn(d.current[n])})),p.current=s}),[s,t]),u?(0,li.jsxs)("div",{className:xi("options__container"),onKeyDown:e=>{s&&(pn(e)===dn.Escape&&(c(!1),fn(l.current)),pn(e)===dn.Home&&(d.current&&fn(d.current[0]),e.preventDefault()),pn(e)===dn.End&&(d.current&&fn(d.current[u-1]),e.preventDefault()))},onFocusOut:()=>{f&&(o.current=setTimeout((()=>{c(!1)}),200))},onFocusIn:()=>{o.current&&clearTimeout(o.current)},children:[(0,li.jsx)(Rs,{transitionStartState:As,isActive:r,children:(0,li.jsx)("div",{className:xi("options__dialog"),children:(0,li.jsx)(cc,{})})}),f&&(0,li.jsx)(Rs,{isActive:s,transitionStartState:As,children:(0,li.jsx)("ul",{className:xi(["options__menu"]),role:"menu",tabIndex:-1,"aria-labelledby":i,children:t.map((({name:r,title:a,available:i},o)=>(0,li.jsx)("li",{className:xi("options__menu__item"),role:"menuitem","data-testid":r,children:(0,li.jsxs)("button",{type:"button",ref:e=>{e&&(d.current[o]=e)},className:xi(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(pn(e)===dn.ArrowDown){const n=Math.min(u-1,t+1);d.current&&fn(d.current[t===n?0:n]),e.preventDefault()}if(pn(e)===dn.ArrowUp){const n=Math.max(0,t-1);d.current&&fn(d.current[t===n?u-1:n]),e.preventDefault()}})(e,o),onKeyPress:e=>((e,n)=>{const r=String.fromCharCode(e.charCode);if(1!==r.length||!r.match(/\S/))return;let a=-1;t.forEach(((e,t)=>{t>n&&e.title.charAt(0).toLowerCase()===r.toLowerCase()&&-1===a&&(a=t)})),-1!==a&&d.current&&fn(d.current[a])})(e,o),onClick:()=>((e,t)=>{t&&(c(!1),n(e))})(r,i),"aria-disabled":!i,children:[(0,li.jsxs)("span",{className:xi("button__text"),children:[a,!i&&" "]}),i?null:(0,li.jsx)("span",{className:xi("button__state"),children:e("options.unavailableText")})]})},r)))})}),(0,li.jsxs)("button",{type:"button",className:xi(["button","button--secondary","chat__options__button",...!f&&m?[`chat__options__button--${m}`]:[]]),id:i,onClick:()=>{r&&a(),f?c((e=>!e)):h.available&&!r&&n(h.name)},onKeyDown:f?e=>{pn(e)===dn.ArrowDown&&(c(!0),e.preventDefault())}:void 0,ref:l,"aria-haspopup":!!f&&"menu","aria-expanded":!!f&&s,"aria-disabled":!f&&!h.available,children:[f?(0,li.jsx)(zi,{name:"options",size:"32",alt:""}):null,(0,li.jsx)("span",{className:xi("button__text"),children:f?e("options.openButtonText"):`${h.title}${h.available?"":" "}`}),f||h.available?null:(0,li.jsx)("span",{className:xi("button__state"),children:e("options.unavailableText")})]})]}):null};function uc(){const{menuOptions:e,allowOptionSelection:t}=ji(),{isAvailable:n}=gi(),r=qt(oi),{t:a,userLocale:i}=Wa(),o=bi(i);if(!n&&(!t||!e.length)||r)return null;const s=a("translations.settings.openButtonText",{hasLanguage:!!o,language:o});return(0,li.jsxs)("div",{className:xi("chat__options"),children:[n&&(0,li.jsx)("div",{className:xi("chat__options-item","chat__options-item--left"),children:(0,li.jsxs)(Ks,{classNames:["button--secondary"],children:[(0,li.jsx)(zi,{alt:s,name:"newTranslation",size:"16"}),(0,li.jsx)("span",{className:xi("button__text"),children:s})]})}),t&&(0,li.jsx)("div",{className:xi("chat__options-item","chat__options-item--right"),children:(0,li.jsx)(lc,{})})]})}const dc=()=>{const{scrollToRef:e,unreadIds:t}=_s(),{isMinimized:n}=qa(),{t:r}=Wa();return(0,li.jsx)(Rs,{isActive:!!t.length&&!n,children:(0,li.jsx)("div",{className:xi("unread-messages"),children:(0,li.jsxs)("button",{type:"button",className:xi("button","button--primary"),onClick:e,children:[r("message.unreadMessagesCount",{unreadCount:t.length}),(0,li.jsx)(zi,{name:"chevronDown",size:"32",alt:""})]})})})},pc=({children:e})=>{const t=xn(),n=(0,ka.useMemo)((()=>t.reduce(((e,t)=>t.payload.id?(e[t.payload.id]=(0,a.createRef)(),e):e),{})),[t]),{scrollToRef:r,scrollToBottom:i,containerRef:o,unreadIds:s}=(e=>{const t=(0,ka.useRef)(null),[n,r]=(0,ka.useState)(!0),a=qt(is),i=xn(),o=wn(),{isOpen:s}=qa(),c=gn().loadedImageEventIds,{processingFileUploads:l,isLastEventFromClient:u}=qt((({state:e})=>e));(0,ka.useEffect)((()=>{const e=t.current;if(!e)return()=>{};const n=()=>{const{scrollHeight:t,scrollTop:n,clientHeight:a}=e,i=Math.abs(t-n-a)>10;r(!i)};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}),[]);const d=(0,ka.useCallback)((()=>{requestAnimationFrame((async()=>{await pi(30),t.current?.scrollTo({top:t.current?.scrollHeight,left:0,behavior:"auto"})}))}),[]);return(0,ka.useEffect)((()=>{u&&d()}),[u,d]),(0,ka.useEffect)((()=>{n&&d()}),[n,a,i,o,s,c,l,d]),{containerRef:t,unreadIds:a,scrollToRef:()=>{const n=a.at(0);if(void 0!==n){const r=e[n]?.current;t.current?.scrollTo({top:r?.offsetTop,behavior:"auto",left:0})}},scrollToBottom:d}})(n);return(0,li.jsx)(Cs.Provider,{value:{eventRefs:n,unreadIds:s,scrollToRef:r,scrollToBottom:i,containerRef:o},children:(0,li.jsxs)("div",{className:xi("chat__container"),children:[(0,li.jsx)("div",{className:xi("chat__container__scroll-area"),ref:o,children:e}),(0,li.jsx)(dc,{})]})})},fc=({baseClassName:e,children:t,title:n})=>{const r=Cn(),a=Mi();return(0,li.jsxs)("section",{id:r,className:xi(e),"aria-describedby":a,tabIndex:-1,children:[(0,li.jsx)("h2",{className:xi(`${e}__title`),id:a,children:n}),t]})},hc=()=>{const{t:e}=Wa(),t=mi(),n=Ni(),{emitEvent:r}=ri(),{isActive:a,remaining:i,timer:o,endCountdown:s}=Li(),c=!!i&&i>0,l=e(c?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,li.jsx)(fc,{baseClassName:"idle",title:l,children:c&&(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)("div",{className:xi("idle__count-container"),children:a&&(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)("span",{className:xi("idle__count-text"),children:e("idleDetachWarning.countdownText")}),(0,li.jsx)("span",{className:xi("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",o)})]})}),(0,li.jsxs)("div",{className:xi("idle__options"),children:[(0,li.jsx)("button",{type:"button",className:xi("button","button--primary"),onClick:()=>{n(),s(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),(0,li.jsx)("button",{type:"button",className:xi("button","button--primary"),onClick:()=>{s(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},mc=()=>{const{t:e}=Wa(),t=Ni(),{name:n}=jn()||{},{continueChat:r,restartChat:a}=ki();return(0,li.jsx)(fc,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:(0,li.jsxs)("div",{className:xi("prompt__options"),children:[(0,li.jsx)("button",{type:"button",className:xi("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),(0,li.jsx)("button",{type:"button",className:xi("button","button--primary"),onClick:a,children:e("resumeConversationPrompt.detachButton")})]})})},yc=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:a}=gn().entryMeta,i=La(),o=n||t||e,s=a&&a[o]||r&&r[o]||{},c=(0,ka.useCallback)((e=>{i(Br(e))}),[i]),l=(0,ka.useCallback)((e=>{i(Fr(e))}),[i]),u=(0,ka.useCallback)((e=>{i(ca(e))}),[i]),d=(0,ka.useCallback)((()=>{n?u(null):l(e)}),[l,u,e,n]);return{activeEntry:o,activeEntryOptions:s,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:d,setBlockAutoEntrySwitch:c}};function gc({controlName:e,skipLinkId:t}){const{t:n}=Wa(),{setInputFocus:r}=qa(),{sendAssertive:a}=ai(),{emitEvent:i}=ri(),o=(()=>{const{sendAction:e}=ri(),{features:t}=ji(),{typingPeekahead:n}=t||{},r=(0,ka.useRef)(null),a=(0,ka.useRef)(null),i=(0,ka.useRef)(!1),o=(0,ka.useRef)(null);(0,ka.useEffect)((()=>()=>{o.current&&clearInterval(o.current),r.current&&clearTimeout(r.current),a.current&&clearTimeout(a.current)}),[]);const s=(t,r)=>{e({type:k,state:t,...n&&n.enabled?{body:{currentMessage:r}}:{}})};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(i.current=!0,o.current||(s(!0,e.target.value),o.current=setInterval((()=>{!i.current&&o.current?(clearInterval(o.current),o.current=null):n&&n.enabled&&s(!0,e.target.value)}),2e3)),r.current&&clearTimeout(r.current),a.current&&clearTimeout(a.current),r.current=setTimeout((()=>{i.current=!1}),300),a.current=setTimeout((()=>{s(!1,e.target.value)}),2e3))}})(),{setBlockAutoEntrySwitch:s}=yc(),{placeholder:c,label:l,labelClass:u}=(e=>{const{hasCharacterLimit:t,characterLimit:n}=bs(e),{entryMeta:{optionsOverride:r}}=gn(),{t:a}=Wa();return{placeholder:(0,ka.useMemo)((()=>a("input.inputPlaceholder",{hasLimit:t,text:r?.text?.placeholder||a("input.inputPlaceholderText"),limit:t?n:null})),[a,t,n,r?.text?.placeholder]),label:(0,ka.useMemo)((()=>a("input.inputLabel",{hasLimit:!r?.text?.label&&t,text:r?.text?.label||a("input.inputLabelText"),limit:!r?.text?.label&&t?n:null})),[a,t,n,r?.text?.label]),labelClass:(0,ka.useMemo)((()=>r?.text?.label?"label":"visually-hidden"),[r?.text?.label])}})(e),{hasCharacterLimit:d,reachedCharacterWarning:p,reachedCharacterLimit:f,remainingChars:h}=bs(e),[{value:m}]=vs(e),y=!!m,g=(0,ka.useCallback)((()=>{p&&a(n("input.srCharacterLimitText",{limit:h})),i("ui.inputFocus")}),[n,a,p,h,i]);return(0,ka.useLayoutEffect)((()=>(s(y),()=>{s(!1)})),[s,y]),(0,li.jsxs)(tc,{className:xi("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,li.jsxs)("div",{className:xi(["input--text__container",...p&&!f?["character-warning"]:[],...f?["character-exceeded"]:[]]),children:[(0,li.jsx)(ac,{id:t,type:"text",name:e,className:xi("input__text"),autocomplete:"off",placeholder:c,labelText:l,labelClass:xi(u),"aria-invalid":!!d&&f,onKeyUp:o,onFocus:g,focus:r}),(0,li.jsx)("div",{className:xi("character-count"),children:p&&(0,li.jsx)("span",{children:h})})]}),(0,li.jsx)("button",{className:xi("button","input__submit"),onPointerDown:e=>{e.preventDefault()},"aria-disabled":!y||f,children:(0,li.jsx)(zi,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}const vc="textMessageEntry";function bc({...e}){const{isOpen:t,setVisibility:n}=qa(),r=Cn(),a=mi(),{sendMessage:i}=ri(),o=(0,ka.useCallback)(((e,{updateControlValue:r})=>{i({body:e[vc]}),r(vc,""),a(),t||n({visibility:Mt.open})}),[i,a,t,n]);return(0,li.jsx)(Js,{...e,formId:"textEntry",persistData:!0,onSubmit:o,children:(0,li.jsx)(gc,{controlName:vc,skipLinkId:r})})}const xc=()=>{const{t:e}=Wa(),{currentUploads:t}=Ei();return(0,li.jsx)("div",{className:xi("progress"),children:t.map((({id:t,name:n,progress:r,uploading:a,error:i})=>(0,li.jsxs)("div",{className:xi("progress_container"),children:[(0,li.jsxs)("div",{className:xi("progress__text"),children:[(0,li.jsx)("span",{className:xi("progress__text--file-name"),children:n}),(0,li.jsx)("span",{className:xi("progress__text--percentage"),children:`${r}%`})]}),(0,li.jsx)(nc,{error:i,id:"progress-error"}),(0,li.jsx)("progress",{className:xi("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":a,children:`${r}%`})]},t)))})};function wc({id:e,name:t,labelText:n,contentHint:r,outputText:a,accept:i}){const{isSubmitted:o}=gs(),[s,c]=(0,ka.useState)(!1),[{onInput:l,onBlur:u},{error:d}]=vs(t),p=Mi(),f=Mi(),h=Mi(),m=o&&d,y=[h];r&&y.push(f),m&&y.push(p);const g=(0,ka.useCallback)((()=>{c(!0)}),[c]),v=(0,ka.useCallback)((()=>{c(!1),u()}),[c,u]),b=(0,ka.useCallback)((e=>{const t={target:{value:e.target.files}};l(t)}),[l]);return(0,li.jsxs)("div",{className:xi("upload__container"),children:[r&&(0,li.jsx)("span",{className:xi("upload__content-hint"),id:f,children:r}),(0,li.jsx)(nc,{id:p,error:m&&d}),(0,li.jsx)("div",{className:xi(["file-upload",...s?["focus-within"]:[]]),children:(0,li.jsxs)("label",{htmlFor:e,className:xi("upload__label"),children:[(0,li.jsx)(zi,{name:"upload",size:"32",alt:""}),(0,li.jsxs)("div",{children:[(0,li.jsx)("span",{className:xi(["upload__label--text"]),children:n}),(0,li.jsx)("input",{id:e,className:xi("upload__input"),type:"file",name:t,onChange:b,"aria-invalid":m?"true":"false","aria-describedby":y.join(" "),accept:i||null,onFocus:g,onBlur:v}),(0,li.jsx)("span",{className:xi("upload__output"),"aria-hidden":"true",id:h,children:a})]})]})})]})}const _c=({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:a,isComplete:i,onClickCancel:o})=>{const{t:s}=Wa(),[{value:c}]=vs(t),l=c&&c.length>0,u=l&&"string"!=typeof c?c[0].name:"";return(0,li.jsxs)(tc,{className:xi("upload-form"),children:[(0,li.jsx)(wc,{name:t,id:e,accept:n,labelText:s("fileUpload.labelText"),outputText:s("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),(0,li.jsxs)("div",{className:xi("upload__button-container"),children:[(0,li.jsx)("button",{id:a||!i?e:void 0,type:"button",onClick:o,className:xi("button","button--secondary","upload__cancel"),children:s("fileUpload.cancelButtonText")}),(0,li.jsx)("button",{className:xi("button","button--primary"),type:"submit",children:s("fileUpload.uploadButtonText")})]})]})},Cc="fileListForm",Sc="fileList",Ec=()=>{const{t:e}=Wa(),{sendPolite:t,sendAssertive:n}=ai(),r=Cn(),a=mi(),{serviceAllowsUploads:i,allowedMimeTypes:o,maxSize:s}=Si(),c=(0,ka.useRef)(null),l=(0,ka.useRef)(i),{cancelEntrySelection:u}=yc(),{uploadFile:d,clearUploads:p,isUploading:f,isComplete:h}=Ei(),{uploadHandle:m,hasServerError:y,progress:g}=((e,t)=>{const n=qt((n=>ds(n,{formId:e,name:t}))),{currentUploads:r}=Ei(),a=n&&n.length>0;let i=null,o=!1,s=0;if(r&&r.length>0){const e=r[0];i=e.uploadHandle,o=!!e.error,s=e.progress}return{hasFile:a,selectedFileName:a?n[0].name:"",uploadHandle:i,hasServerError:o,progress:s}})(Cc,Sc),v=Mi(),b=(0,ka.useRef)(!0),x=e("fileUpload.contentHint",{size:ln(s)}),w=(0,ka.useRef)(""),_=(0,ka.useRef)(null);(0,ka.useEffect)((()=>{w.current&&_.current?.contains(document.activeElement)&&"INPUT"===document.activeElement?.tagName&&n(x),w.current=x}),[x,n]),(0,ka.useEffect)((()=>{g>0&&t(1===g?e("fileUpload.srStartedText"):`${g}%`)}),[g,t,e]),(0,ka.useEffect)((()=>{b.current||f||!h||(p(),u(),a(),setTimeout((()=>{t(e("fileUpload.srCompleteText"))}),300)),b.current=h}),[f,h,p,u,a,t,e]);const C=(0,ka.useCallback)((({fileList:e})=>{d(e[0]),a()}),[d,!1,a]),S=(0,ka.useCallback)((()=>{m&&m.abort(),p(),u(),a()}),[m,p,u,a]),E=(0,ka.useMemo)((()=>({[Sc]:[Xs((()=>i),e("fileUpload.errors.unavailable")),Xs(Zs,e("fileUpload.errors.noFile")),Xs(Ys,e("fileUpload.errors.tooLarge"),s)]})),[s,i,e]);return(0,li.jsx)("div",{className:xi(["upload",...y?["upload--error"]:[]]),ref:_,children:(0,li.jsxs)(Js,{formId:Cc,persistData:!0,onSubmit:C,validationSchema:E,children:[(f||!h)&&(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)(xc,{}),(0,li.jsx)("div",{className:xi("upload__button-container"),children:(0,li.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:S,ref:c,className:xi("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!f&&h&&(0,li.jsx)(_c,{controlName:Sc,skiplinkId:r,accept:o?.join(", ")||"",contentHint:x,isComplete:h,isUploading:f,onClickCancel:S}),!l.current&&(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)("span",{className:xi("notification"),id:v,children:e("fileUpload.unavailableText")}),(0,li.jsx)("div",{className:xi("upload__button-container"),children:(0,li.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:S,className:xi("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},jc=()=>{const{t:e}=Wa(),{showFileUpload:t,serviceAllowsUploads:n}=Si(),[r,a]=(0,ka.useState)(n||!1),i=mi(),o=(0,ka.useRef)(null),{setUserEntryType:s,activeEntry:c}=yc(),l=(0,ka.useRef)(null),{sendPolite:u}=ai(),d=!!jn();return(0,ka.useEffect)((()=>{hn(l.current,(()=>{n||i()})),a(n||!1)}),[n,i]),(0,ka.useEffect)((()=>{o.current&&!n&&u(e("fileUpload.srUnavailableText")),!1===o.current&&n&&u(e("fileUpload.srAvailableText")),d&&(o.current=n)}),[n,d,u,e]),t||c===T?null:(0,li.jsx)(Rs,{isActive:r,transitionStartState:Os,children:(0,li.jsx)("div",{className:xi("upload-toggle-wrapper"),children:(0,li.jsx)(Rs,{isActive:r,transitionStartState:Ps,children:(0,li.jsx)("button",{className:xi(["button","button--secondary","upload-toggle"]),ref:l,"aria-disabled":!r,type:"button",onClick:r?()=>{s(T),i()}:void 0,children:(0,li.jsx)(zi,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})},Tc=()=>{const{isOpen:e}=qa(),t=(0,ka.useRef)(null),{hasCountdown:n}=Li(),[r,a]=(0,ka.useState)(n),{hasPrompt:i}=ki(),[o,s]=(0,ka.useState)(i),c=mi(),l=(0,ka.useRef)(!1),{activeEntry:u,activeEntryOptions:d}=yc(),[p,f]=(0,ka.useState)({text:bc,upload:Ec}),[h,m]=(0,ka.useState)((()=>u)),[y,g]=(0,ka.useState)((()=>d)),v=an(),{accountAllowsUploads:b}=Si(),x=(0,ka.useCallback)((()=>{hn(t.current,c)}),[c]);(0,ka.useEffect)((()=>{const{customComponents:e}=v,{entry:t}=e||{};t&&f((e=>({...e,...t})))}),[v]),(0,ka.useEffect)((()=>{x(),a(n),s(i)}),[n,i,x]),(0,ka.useEffect)((()=>{m(u),g(d),x()}),[u,d,x,t]),l.current=!(!t.current||!t.current.contains(document.activeElement));const w=p[h],{allowManualInput:_=!0}=y;return(0,li.jsxs)("div",{className:xi("chat__entry"),ref:t,children:[r&&(0,li.jsx)(hc,{}),o&&(0,li.jsx)(mc,{}),(0,li.jsxs)("div",{className:xi(["entry__body",...n||i||!1===_?["entry__body--hidden"]:[]]),children:[h!==T&&b&&e?(0,li.jsx)(jc,{}):null,(0,li.jsx)(w,{})]})]})},Ic=()=>{const{t:e}=Wa(),{isOpen:t,closeChat:n}=qa(),{isWindow:r}=Tn();return t&&r?(0,li.jsx)("button",{type:"button",className:xi("button","collapse-button"),onClick:n,children:(0,li.jsx)(zi,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null},Nc=()=>{const{meta:{originalError:e,title:t,message:n,buttonText:r,action:a,srText:i}}=si(),o=ri(),s=Mi(),{sendPolite:c}=ai(),l=mi(),u="SeamlySessionExpiredError"===e?.name;return(0,ka.useEffect)((()=>{!u&&i&&setTimeout((()=>{c(i)}),200)}),[c,i,u]),u?(0,li.jsx)(li.Fragment,{}):(0,li.jsxs)("section",{className:xi("interrupt"),"aria-labelledby":s,children:[(0,li.jsx)(Ic,{}),(0,li.jsxs)("div",{className:xi("interrupt__body"),children:[(0,li.jsx)("h2",{id:s,className:xi("interrupt__title"),children:t}),(0,li.jsx)("p",{className:xi("interrupt__message"),children:n}),r&&a&&(0,li.jsx)("div",{className:xi("interrupt__actions"),children:(0,li.jsx)("button",{type:"button",className:xi("button","button--primary"),onClick:()=>{a&&o[a]&&o[a](),l()},children:r})})]})]})},Lc=function({children:e}){const t=qt(oi),{isOpen:n}=qa();return t?(0,li.jsx)(Nc,{}):(0,li.jsxs)(li.Fragment,{children:[(0,li.jsxs)(pc,{children:[(0,li.jsxs)("div",{className:xi("chat__container__header"),children:[(0,li.jsx)($s,{}),(0,li.jsx)(Ic,{})]}),e]}),(0,li.jsx)(Tc,{}),n&&(0,li.jsx)(uc,{})]})};function kc({event:e}){const[t]=Ss(e);return(0,li.jsx)("li",{children:(0,li.jsx)(t,{event:e})})}function Mc({events:e}){return(0,li.jsx)("ul",{className:xi("collapsed-chat-messages"),children:e.map((e=>(0,li.jsx)(kc,{event:e},e.payload.id)))})}function Ac(){const{preChatEvents:e}=an(),t=qt(oi),{isOpen:n}=qa();return t||!e?.length||n?null:(0,li.jsx)(Mc,{events:e})}function Oc(){const{t:e}=Wa(),t=e("window.chat.continue"),n=(0,ka.useMemo)((()=>({type:"message",payload:{type:"custom",body:{text:t,type:"",data:{}},participant:"seamly-client-participant"}})),[t]);return(0,li.jsx)(Mc,{events:[n]})}const Pc=()=>{const e=function(){const{startChatIcon:e}=an();return e}(),t=jn(),n=qt(oi),r=t&&!n,a=r?t.avatar:e;return a?(0,li.jsx)("img",{className:xi(r?"avatar":"icon"),src:a,alt:""}):(0,li.jsx)(zi,{name:"avatar",size:"32",alt:""})},Rc=({onClick:e})=>{const t=ni(),{t:n}=Wa(),r=t()?n("window.openButton.srContinue"):n("window.openButton.srStart"),a=mi(),{isOpen:i}=qa(),o=_n(),s=(0,ka.useCallback)((()=>{e(),a()}),[a,e]);return(0,li.jsx)(Rs,{isActive:!i,transitionStartState:Os,children:(0,li.jsxs)("button",{className:xi("window-open-button"),"aria-label":r,"aria-hidden":i,onClick:s,children:[(0,li.jsx)(Rs,{isActive:!!o,transitionStartState:As,children:(0,li.jsx)("span",{className:xi("message-count"),"aria-hidden":"true",children:o})}),(0,li.jsx)(Pc,{})]})})},Dc=(e,t,n)=>"object"==typeof e?e[t]:n,zc=n.p+"sounds/beep.mp3",Fc=!!window.Notification,Uc={app:()=>(0,li.jsx)(Fs,{children:(0,li.jsx)(Lc,{children:(0,li.jsx)(Is,{})})}),inline:()=>{const{showInlineView:e,containerRef:t}=(()=>{const e=La(),{connectWhenInView:t}=an(),n=qt(Nn),{containerRef:r,isVisible:a}=Ka({enabled:t,freezeOnceVisible:!0});return(0,ka.useEffect)((()=>{a&&e(Ta())}),[e,a]),{containerRef:r,showInlineView:n}})(),{isOpen:n}=qa();return(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)(Rs,{isActive:!n,transitionStartState:Os,children:(0,li.jsxs)("div",{ref:t,className:xi("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,li.jsx)(Ac,{}),(0,li.jsx)(Ds,{})]})}),(0,li.jsx)(Rs,{isActive:n,transitionStartState:Os,children:(0,li.jsx)(Fs,{ref:t,children:e&&(0,li.jsx)(Lc,{children:n&&(0,li.jsx)(Is,{})})})})]})},window:()=>{const{isOpen:e,openChat:t}=qa(),n=Ja(),{continueChat:r,preChat:a}=an();return(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)(Rc,{onClick:t}),(0,li.jsx)(Rs,{isActive:!!a&&!e&&!n,exitAfter:Dc(a,"exitAfter"),enterDelay:Dc(a,"enterDelay"),transitionStartState:As,children:(0,li.jsx)("div",{className:xi("unstarted-wrapper","unstarted-wrapper--window"),children:(0,li.jsx)(Ac,{})})}),(0,li.jsx)(Rs,{isActive:r&&!e&&n,exitAfter:Dc(r,"exitAfter"),enterDelay:Dc(r,"enterDelay"),transitionStartState:As,children:(0,li.jsx)("div",{className:xi("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,li.jsx)(Oc,{})})}),(0,li.jsx)(Rs,{isActive:e,transitionStartState:As,children:(0,li.jsx)(Fs,{children:(0,li.jsx)(Lc,{children:(0,li.jsx)(Is,{})})})})]})}};function Bc(e){const t=document.createElement("div");return t.innerHTML=e||"",t.textContent||t.innerText||""}const Hc=({children:e})=>{const{sendNotification:t}=(()=>{const{proactiveMessages:e}=Sn(),{notificationAudioURL:t}=an(),[n,r]=(0,ka.useState)(Fc?Notification.permission:"default"),[a,i]=(0,ka.useState)(document.visibilityState),o=qt(os),s=(0,ka.useCallback)((async()=>{if(Fc&&"granted"!==n){const e=await Notification.requestPermission();r(e)}}),[n]),c=(0,ka.useMemo)((()=>"granted"===n),[n]),l=(0,ka.useMemo)((()=>"hidden"===a),[a]);(0,ka.useEffect)((()=>{"default"===n&&e&&s()}),[n,e,s]);const u=(0,ka.useCallback)((async(e,r)=>{if(o&&Fc){if("default"===n&&s(),!1!==t&&!c&&(l||!document.hasFocus()))try{const e=new Audio(t||zc);await e.play()}catch(e){console.warn(e)}if(c&&(l||!document.hasFocus())){const t=new Notification(e,r);t.onclick=function(){window.parent.focus(),window.focus(),t.close();const e=document.querySelector(`input[name=${vc}]`);e&&e.focus()}}}}),[t,n,c,s,o,l]);return(0,ka.useEffect)((()=>{if(!o)return()=>{};function e(){i(document.visibilityState)}return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e)}}),[o]),{permission:n,requestPermission:s,sendNotification:u}})(),[,n]=fi(),r=an(),a=jn(),{proactiveMessages:i}=Sn(),{isOpen:o,isVisible:s}=qa(),c=wi(),l=Ja(),u=qt(as),{body:d}=vi(u),{userLocale:p}=Wa(),f=(0,ka.useRef)(void 0),h=(0,ka.useMemo)((()=>d?"string"==typeof d?Bc(d):"text"in d?Bc(d.text):"prompt"in d&&d.prompt&&"text"in d.prompt?Bc(d.prompt?.text):"":""),[d]);(0,ka.useEffect)((()=>{a?.name&&h&&i&&u&&f.current!==u.payload?.id&&(t(a.name,{body:h,icon:a?.avatar||void 0}),f.current=u.payload.id)}),[a?.avatar,a?.name,u,h,i,t]);const m=Uc[r.layoutMode],y=(0,ka.useCallback)((e=>{"function"==typeof n&&n(e)}),[n]),g=(0,ka.useMemo)((()=>{if(p){const e=document.querySelector("html")?.getAttribute("lang");if(e!==p)return p}}),[p]);if(!m)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const v=["app",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];return"function"!=typeof c?v.push(...c):v.push(...c(r)),o||"app"===r.layoutMode||v.push("app--collapsed"),l&&v.push("app--user-responded"),s?(0,li.jsx)("div",{className:xi(v),lang:g,tabIndex:-1,"data-nosnippet":!0,style:{zIndex:r?.zIndex},ref:y,children:e||(0,li.jsx)(m,{})}):null},$c=e=>(0,li.jsx)(ns,{...e,children:(0,li.jsx)(Hc,{})});class Vc{constructor(e,n){const{namespace:r="",parentElement:a,...i}=e;this.config={...i,namespace:r},this.namespace=r,this.parentElement=a,this.externalApi=n,this.api=new J({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(t()),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{view:e,...t}=this.config.customComponents||{},n={...this.config,parentElement:this.parentElement,customComponents:Object.keys(t).length?t:void 0},r=function({initialState:e,api:t,eventBus:n,config:r}){const a=rt({reducer:Na,preloadedState:e,middleware:e=>e({thunk:{extraArgument:{api:t,eventBus:n,config:r}},serializableCheck:!1}).concat(function({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:a,api:i,layoutMode:o}=At(t()),{error:s,type:c}=n,l=Jn[s?.name]?new Jn[s.name](s):new v(s);r?.(l,{namespace:a,api:i,layoutMode:o,conversationUrl:e.getConversationUrl(),action:c?n:void 0})};return e=>t=>{try{return t.payload?.originalEvent?.payload?n({error:t.payload,type:t.payload?.originalEvent?.payload?.type}):t.payload?.originalError&&n({error:t.payload,type:void 0}),e(t)}catch(e){throw n({error:e}),e}}}}({api:t}),function({api:e}){return()=>t=>n=>{const{payload:r,type:a}=n;if(a===gr.type){if(!xr.includes(r.name))throw new x(r);"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}({api:t}),function({api:e}){return()=>t=>n=>{const r=t(n);switch(n.type){case ua.toString():e.store.set("options",n.payload);break;case la.toString():e.store.set("options",{...e.store.get("options")||{},[n.payload.option]:n.payload.value})}return r}}({api:t}),ma)});return a}({api:this.api,eventBus:this.eventBus,config:n,initialState:void 0});r.dispatch(Un(n)),await r.dispatch(_t()),await r.dispatch(On()),r.dispatch(An()),e?(0,a.render)((0,li.jsx)(ns,{eventBus:this.eventBus,store:r,api:this.api,children:(0,li.jsx)(e,{})}),this.parentElement):(0,a.render)((0,li.jsx)($c,{config:n,eventBus:this.eventBus,store:r,api:this.api}),this.parentElement)}destroy(){(0,a.render)(null,this.parentElement),this.eventBus.off(),this.api.disconnect(),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))}}const Gc=e=>"object"==typeof e&&"action"in e,Wc=e=>({...e,args:Array.isArray(e.args)?e.args:[e.args]}),qc=class{constructor(e){this._waitingActions=[],this._instances={},this.timeouts={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(Gc).map(Wc)).length&&(this._waitingActions.push(...e),this.handleActions())}handleActions(){const e=this._waitingActions;this._waitingActions=[],e.forEach((e=>{switch(e.action){case"init":this.handleInit(e);break;case"destroy":this.handleDestroy(e);break;default:this.handleAction(e)||this.setContext(e.action,...e.args)||this._waitingActions.push(e)}}))}instanceInitializing(e){const t=Object.keys(this._instances);return!e&&t.length>0||t.includes(e)}setContext(e,t){const{instance:n}=t;if(this.instanceInitializing(n))return!1;switch(e){case"setTopic":const{name:e}=t;return e&&(this.context.topic=e),!0;case"setTranslation":const{enabled:n,locale:r}=t;return n&&r&&(this.context.userLocale=r,this.context.source=F),!0;case"setContext":const{userLocale:a,contentLocale:i}=t;return this.context.userLocale=a,this.context.contentLocale=i,a&&a!=this.appConfig?.userLocale&&(this.context.source=F),!0;case"setVariables":return Object.keys(t).length>0&&(this.context.variables={...t}),!0;default:return!1}}handleInit(e){const t=this.getUserConfig(...e.args),n=this.getCombinedConfig(t),{parentElement:r,namespace:a}=n||t;if(a?Object.values(this._instances).forEach((e=>{e.parentElement!==r&&e.namespace!==a||this.destroy(e)})):this.destroy(),n){const e=this.createInstance(n);this._instances[n.namespace]=e,this.context={},this.debouncedRender(e,n.namespace)}}handleDestroy(e){this.destroy(e.instance)}handleAction(e){const{action:t,instance:n,args:r}=e,a=Object.values(this._instances);return!n&&a.length>1&&console.warn(`Multiple instances detected. Due to potential race conditions, it is recommended to target a specific instance with the action: ${t}`),a.map((e=>(!n||e.namespace===n)&&e.execFunction(t,...r))).some(Boolean)}createInstance(e){return new Vc(e,this)}debouncedRender(e,t){window.clearTimeout(this.timeouts[t]),this.timeouts[t]=window.setTimeout((()=>{e.render()}),100)}destroy(e){e?("string"==typeof e&&(e=this._instances[e]),e&&(e.destroy(),delete this._instances[e.namespace])):Object.entries(this._instances).forEach((([e,t])=>{t.destroy(),delete this._instances[e]}))}getUserConfig(e={}){return e}getCombinedConfig(e){const t={...e.context||this.appConfig.context,...this.context},n=this.getMergedVariables(e);Object.keys(n).length>0&&(t.variables=n);const r={...this.appConfig.defaults,...e.defaults},a={...this.appConfig,...e,api:{...this.appConfig.api,...e.api},context:Object.keys(t).length?t:void 0,defaults:Object.keys(r).length?r:void 0};return"function"==typeof this.appConfig?this.appConfig(a):a}getMergedVariables(e){return{...this.appConfig.context?.variables||{},...e.context?.variables||{},...this.context.variables||{}}}},Kc=()=>{const e=new URLSearchParams(window.location.search);return Array.from(e.entries()).reduce(((e,[t,n])=>({...e,[t]:n})),{})},Jc=e=>new URLSearchParams(e).toString(),Xc={direction:"to_translation_locale",locale:"nl",translatedBy:"deep_l",data:{}};function Yc(e){switch(e.payload.type){case"cta":case"image":case"text":case"choice_prompt":return{...e,payload:{...e.payload,translatedBody:{...Xc,data:{...e.payload.body,text:e.payload.body.text?`NL - ${e.payload.body.text}`:void 0,description:e.payload.body.description?`NL - ${e.payload.body.description}`:void 0,buttonText:e.payload.body.buttonText?`NL - ${e.payload.body.buttonText}`:void 0,choices:e.payload.body.choices?e.payload.body.choices.map((e=>({...e,text:`NL - ${e.text}`}))):void 0,prompt:e.payload.body.prompt?{...e.payload.body.prompt,text:`NL - ${e.payload.body.prompt.text}`}:void 0}}}};default:return e}}const Zc={events:[],config:{layoutMode:"inline",accountConfig:{},hideOnNoUserResponse:!1,showDisclaimer:!1,showSuggestions:!0,preChat:!0},context:{},initialState:{},unreadEvents:0,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1},resumeConversationPrompt:!1,visibility:{visibility:Mt.open},serviceInfo:{activeServiceSessionId:""},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:"Test title",subTitle:"Test subtitle"},interrupt:{error:void 0},historyLoaded:!1,skiplinkTargetId:G(),optionsButtonId:G(),serviceData:{},options:{features:{},panelActive:!1,optionActive:"",userSelectedOptions:{}},entryMeta:{default:"text",active:"text",userSelected:null,options:{},optionsOverride:{}},currentUploads:[],processingFileUploads:[]},Qc={participants:{agent:{id:"agent",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},user:{id:"user",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}}},currentAgent:"agent"},el={type:"info",payload:{body:{subtype:"new_topic",type:"divider"},fromClient:!1,fromHistory:!0,id:G(),transactionId:"_1y9pz5fbyly",type:"divider"}},tl={type:"info",payload:{body:{language:"Nederlands",restartButtonText:null,subtype:"new_translation",text:"[NL] Automatic translation to Dutch started. Please note that automatic translations may contain errors.",title:"[NL] Translating to Dutch",translationEnabled:!0,userLocale:"nl"},fromClient:!1,fromHistory:!0,id:G(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},nl={type:"info",payload:{body:{language:"Nederlands",subtype:"new_translation",text:"[NL] Automatic translation to Dutch started. Please note that automatic translations may contain errors.",translationEnabled:!0,userLocale:"nl"},fromClient:!1,fromHistory:!0,id:G(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},rl={type:"info",payload:{body:{language:"Nederlands",restartButtonText:"[NL] Start again",subtype:"new_translation",text:null,title:"[NL] Automatic translation to Dutch ended",translationEnabled:!1,userLocale:"nl"},fromClient:!1,fromHistory:!0,id:G(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},al={type:"info",payload:{body:{text:"This is a system generated info message",type:"text"},fromClient:!1,id:G(),participant:null,service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:null,type:"text"}},il={type:"info",payload:{body:{key:["info","sendTranscript","accepted"],variables:{emailAddress:"test@test.com"}},fromClient:!1,id:G(),participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,type:"translation"}},ol={title:"You're talking to",subTitle:"Mrs. Bot"},sl={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:G(),messageStatus:"received",participant:{avatar:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjNEE0OEMxIiBkPSJNMTAsMTQuOGMtMS4xLDAtMi0wLjktMi0yczAuOS0yLDItMnMyLDAuOSwyLDJTMTEuMSwxNC44LDEwLDE0Ljh6IE0xNS45LDE0LjhjMS4xLDAsMi0wLjksMi0ycy0wLjktMi0yLTIKCXMtMiwwLjktMiwyUzE0LjgsMTQuOCwxNS45LDE0Ljh6IE0yMS44LDEwLjhjLTEuMSwwLTIsMC45LTIsMnMwLjksMiwyLDJzMi0wLjksMi0yUzIyLjksMTAuOCwyMS44LDEwLjh6IE0yMS4zLDE4LjFIMTAuNwoJQzExLjcsMjMuOSwyMC4yLDIzLjksMjEuMywxOC4xeiIvPgo8L3N2Zz4K",id:"agent",introduction:"You're now talking to Mrs. Bot gimme a minit",name:"Mrs. Bot",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},transactionId:"d63655bf-1d3d-42cf-b14e-4da9e2b6a642",type:"participant"}},cl={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:G(),messageStatus:"received",participant:{introduction:"Welcome, you are now chatting with Mrs. Bot 2, give me a minit to read back the chat history.",id:"agent",avatar:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjNEE0OEMxIiBkPSJNMTAuMSwxNC45Yy0xLjEsMC0yLTAuOS0yLTJzMC45LTIsMi0yczIsMC45LDIsMlMxMS4yLDE0LjksMTAuMSwxNC45eiBNMjEuOSwxMC45Yy0xLjEsMC0yLDAuOS0yLDIKCXMwLjksMiwyLDJzMi0wLjksMi0yUzIzLDEwLjksMjEuOSwxMC45eiBNMjEuNCwxOC4ySDEwLjhDMTEuOCwyNCwyMC4zLDI0LDIxLjQsMTguMnogTTE3LjIsMjUuM2gtMi40Yy0wLjYsMC0xLjIsMC40LTEuNCwxCgljLTUuMS0wLjItOS4yLTQuNC05LjQtOS42YzAuMSwwLDAuMiwwLjEsMC40LDAuMWgwLjFjMC44LDAsMS40LTAuNiwxLjQtMS40di00LjdjMC0wLjgtMC42LTEuNC0xLjQtMS40aDBjLTAuOCwwLTEuNCwwLjYtMS40LDEuNAoJdjIuN3YydjEuMWMwLDUuOSw0LjcsMTAuNiwxMC41LDEwLjhjMC4yLDAuNSwwLjcsMC44LDEuMiwwLjhoMi40YzAuOCwwLDEuNC0wLjYsMS40LTEuNFMxOCwyNS4zLDE3LjIsMjUuM3oiLz4KPC9zdmc+Cg==",name:"Two",service:{expose:{map:{},version:3},meta:{},name:"new service",serviceSessionId:G(),settings:{}}},transactionId:G(),type:"participant"}},ll={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:G(),messageStatus:"received",participant:{id:"user",introduction:"You're now talking to Mrs. Bot gimme a minit",name:"Mrs. Bot",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},transactionId:"d63655bf-1d3d-42cf-b14e-4da9e2b6a642",type:"participant"}},ul=({type:e,data:t,text:n})=>({type:"message",payload:{body:{type:e,text:n,data:t},participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},fromClient:!1,fromHistory:!0,id:"4efacb4d-28a0-454e-8e36-3f17eb598c5d",messageStatus:"read",transactionId:"6f9beee7-ce82-418e-9bec-8001079aa769",transactionLast:!0,type:"custom"}}),dl={type:"message",payload:{body:{text:"What do you want to do?",type:"text",data:void 0},fromClient:!1,fromHistory:!0,id:G(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!1,type:"text"}},pl={type:"message",payload:{type:"splash",id:G(),body:{text:"Example splash message ✨",type:"text",variables:{}}}},fl={type:"message",payload:{body:{description:"Thanks for chatting!\n\nMore info about our <strong>products</strong>?",buttonLink:"https://seamly.ai",buttonText:"View website",buttonNewTab:!0},type:"cta",fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792z",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1}},hl={type:"message",payload:{body:{text:"What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am. What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am. What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am.",type:"text"},fromClient:!1,fromHistory:!0,id:G(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!1,type:"text"}},ml={type:"message",payload:{body:{text:"Bubble with <strong>bold</strong> <em>italic</em> <u>underline</u>",type:"text"},fromClient:!1,fromHistory:!0,id:G(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},yl={type:"message",payload:{body:{text:'<a href="https://google.com" data-link-id="1">Link in same window</a> and <a href="https://google.com" data-link-id="2" target="_blank">link in new window</a> embedded in text',type:"text"},fromClient:!1,fromHistory:!0,id:G(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},gl={type:"message",payload:{body:{text:'Here is a long link <a href="https://google.com" data-link-id="1">click me click me please click me yoohoooo please please click me here I am click me now what are you waiting for click me now now now now now click meeeeeeeeeeeeee</a> embedded in text',type:"text"},fromClient:!1,fromHistory:!0,id:"a964e54e-ea98-46ff-a952-979a47f162c0",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},vl={type:"message",payload:{body:{text:"\n <ul>\n <li>Short list item</li>\n <li>This list item is longer to showcase different type lengths of text in list items and how they reflow in the browser</li>\n <li>\n This list item has a nested list with 3 items in it.\n <ul>\n <li>First item</li>\n <li>second item</li>\n <li>Third item</li>\n </ul>\n </li>\n <li>Another one just to be sure :)</li>\n </ul>\n ",type:"text"},fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792a",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},bl={type:"message",payload:{body:{text:"\n <ol>\n <li>Short list item</li>\n <li>This list item is longer to showcase different type lengths of text in list items and how they reflow in the browser</li>\n <li>\n This list item has a nested list with 3 items in it.\n <ol>\n <li>First item</li>\n <li>second item</li>\n <li>Third item</li>\n </ol>\n </li>\n <li>Another one just to be sure :)</li>\n </ol>\n ",type:"text"},fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792a",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},xl={type:"message",payload:{body:{description:"Plaatje",isZoomable:!1,type:"image",url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-square-small.jpg"},fromClient:!1,fromHistory:!0,id:"b44ef42c-880c-43ff-b067-499e7f2e81f7",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"image"}},wl={type:"message",payload:{body:{description:"Plaatje",isZoomable:!0,type:"image",url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-portrait.jpg"},fromClient:!1,fromHistory:!0,id:"b44ef42c-880c-43ff-b067-499e7f2e81f8",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"image"}},_l={type:"message",payload:{body:{description:"test",source:"youtube",type:"video",url:"https://www.youtube.com/embed/K7Hn1rPQouU"},fromClient:!1,fromHistory:!0,id:G(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"video"}},Cl={type:"message",payload:{body:{choices:[{id:"703db9b3-2157-4d4a-9f9b-c382c6a10531",text:"Dialog (this is intentionally made longer for testing purposes)",type:"choice"},{id:"1eff6098-f14f-4683-a2b8-30d1c573d45e",text:"T-Dialog",type:"choice"},{id:"a8ba3ce8-3324-4e7a-accc-944ff78ac890",text:"Customers",type:"choice"},{id:"c89956ab-cf98-4b7e-9282-7087c988153d",text:"Features",type:"choice"},{id:"9fd9a28f-462d-4f07-9661-606dbe3b9466",category:"secondary",text:"Something else",type:"choice"}],chooseAgain:!0,prompt:{text:"Type "start" at any time to see this menu again",type:"text",variables:{}},type:"choice_prompt"},fromClient:!1,fromHistory:!0,id:G(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!0,type:"choice_prompt"}},Sl={type:"message",payload:{body:{text:"This is what the user typed",type:"text"},fromClient:!0,fromHistory:!0,id:G(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},El={type:"message",payload:{body:{text:"This is what the user typed. And sometimes the user has quite a lot to say and then we get longer lines that need to wrap well and not break the styling so here goes with just such a line right here!!",type:"text"},fromClient:!0,fromHistory:!0,id:G(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},jl={type:"message",payload:{body:{text:'<a href="https://google.com" data-link-id="1">Link in same window</a> and <a href="https://google.com" data-link-id="2" target="_blank">link in new window</a> embedded in text',type:"text"},fromClient:!0,fromHistory:!0,id:G(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},Tl={type:"upload",transactionId:G(),meta:{},body:{contentType:"plain/text",filename:"This-is-an-example.txt",filesize:12,id:G(),isDeleted:!1}},Il={type:"upload",transactionId:G(),meta:{},body:{contentType:"application/pdf",filename:"This-is-a-sample.pdf",filesize:18810,id:"",isDeleted:!1,url:"https://pdfobject.com/pdf/sample.pdf"}},Nl={type:"upload",transactionId:G(),meta:{},body:{contentType:"image/jpeg",filename:"image-square-small.jpg",filesize:12020,id:"",isDeleted:!1,url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-square-small.jpg"}},Ll={type:"message",payload:{...Tl,fromClient:!1,participant:"agent",id:G()}},kl={type:"message",payload:{...Il,fromClient:!1,participant:"agent",id:G()}},Ml={type:"message",payload:{...Nl,fromClient:!1,participant:"agent",id:G()}};sessionStorage.setItem(`image-${Ml.payload.id}`,Ml.payload.body.url);const Al={...Ml,payload:{...Ml.payload,body:{...Ml.payload.body,isDeleted:!0,url:void 0},id:G()}},Ol={type:"message",payload:{...Nl,fromClient:!0,participant:"user",id:G()}};sessionStorage.setItem(`image-${Ol.payload.id}`,Ol.payload.body.url);const Pl={...Ol,payload:{...Ol.payload,id:G(),body:{...Ol.payload.body,url:null}}},Rl={isActive:!1,currentLocale:void 0,isAvailable:!1,showTranslationProposal:!1,languages:[],translatedEventGroups:{},containerId:G()},Dl=[{id:"1",question:"Invoices",categories:["mixed","short"]},{id:"2",question:"Temporary subscription pause",categories:["mixed","medium"]},{id:"3",question:"Cancellation",categories:["mixed","short"]},{id:"4",question:"Apps",categories:["mixed","medium"]},{id:"5",question:"At what date will my subscription end?",categories:["mixed","long"]},{id:"A",question:"Quotes",categories:["short"]},{id:"B",question:"How to get in touch with us",categories:["long"]}],zl="unstarted",Fl="messages",Ul="errors",Bl="uploads",Hl="features",$l="options",Vl="suggestions",Gl="minimizedWindow",Wl="minimizedInline",ql="translations",Kl={[zl]:{heading:"Unstarted UI",description:"Test the loader here"},[Fl]:{heading:"Messages",description:""},[Ul]:{heading:"UI errors",description:""},[Bl]:{heading:"File uploads",description:""},[Hl]:{heading:"Other features",description:""},[$l]:{heading:"Options",description:""},[Vl]:{heading:"Suggestions",description:""},[Gl]:{heading:"Minimized window",desciption:""},[Wl]:{heading:"Minimized Inline",description:""},[ql]:{heading:"Translations",description:""}},Jl={type:"message",payload:{type:"card",id:G(),body:{action:{ask:"",type:"ask"},buttonText:"Ask about pizzas!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.\n\nIt is made with San Marzano tomatoes, mozzarella cheese, fresh basil, salt, and extra-virgin olive oil.",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-square.jpg",title:"Pizza Margherita"}}},Xl={type:"message",payload:{type:"card",id:G(),body:{action:{link:"https://seamly.ai",newTab:!0,type:"navigate"},buttonText:"Order now!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-landscape.jpg",title:"Pizza Margherita"}}},Yl={type:"message",payload:{type:"card",id:G(),body:{action:{topic:"Set topic",type:"topic"},buttonText:"Set topic! (title & description optional)",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-portrait.jpg"}}},Zl={type:"message",payload:{type:"card",id:G(),body:{action:{ask:"",type:"ask"},buttonText:"Ask about pizzas!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.\n\nIt is made with San Marzano tomatoes, mozzarella cheese, fresh basil, salt, and extra-virgin olive oil.",title:"Pizza Margherita"}}},Ql={base:{category:zl,headingText:"Standard with loader",description:"",...Zc,isLoading:!0},fullConversation:{category:Fl,headingText:"Full demo conversation",description:"",...Zc,participantInfo:Qc,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[sl,al,dl,{...Cl,payload:{...Cl.payload,id:`${Cl.payload.id}XXX`}},hl,cl,Sl,ml,jl,el,xl,Ll,kl,Ml,Al,El,_l,yl,gl,wl,Ol,Pl,vl,bl,Cl,fl]},userMessages:{category:Fl,headingText:"User messages",description:"",...Zc,participantInfo:Qc,events:[Sl,El,Ol,Pl,jl]},withParticipants:{category:Fl,headingText:"Messages with participant info",description:"",...Zc,config:{...Zc.config,overrideMessages:{agent:{showAvatar:!0,showName:!0},user:{showName:!0,showAvatar:!0}}},participantInfo:Qc,events:[dl,Sl,hl,El]},textMessages:{category:Fl,headingText:"Text messages",description:"",...Zc,participantInfo:Qc,events:[dl,hl,ml,yl,gl,vl,bl]},ctaMessages:{category:Fl,headingText:"CTA (call to action) messages",description:"",...Zc,participantInfo:Qc,events:[fl]},imageVideoMessages:{category:Fl,headingText:"Download, image and video messages",description:"",...Zc,participantInfo:Qc,events:[xl,_l,wl,Ll,kl,Ml,Al,Ol,Pl]},systemMessages:{category:Fl,headingText:"System messages",description:"",...Zc,config:{overrideMessages:{timeIndicator:{enabled:!0,threshold:36e5}}},participantInfo:Qc,events:[{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()-432e6),id:G(),body:{text:"Long ago when a dialog started",type:"text"}}},sl,ll,cl,el,il,...[tl,rl].map(Yc),al]},choicePromptMessages:{category:Fl,headingText:"Choice prompt messages",description:"",...Zc,participantInfo:Qc,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{...Cl,payload:{...Cl.payload,id:`${Cl.payload.id}XXX`}},dl,Cl]},timeIndicators:{category:Fl,headingText:"Time Indicators",description:"",...Zc,config:{overrideMessages:{timeIndicator:{enabled:!0,threshold:36e5}}},participantInfo:Qc,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()-432e6),id:G(),body:{text:"Long ago when a dialog started",type:"text"}}},{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()-3456e5),id:G(),body:{text:"Above me should be a time indicator showing the full date",type:"text"}}},{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()+1-3456e5),id:G(),body:{text:"Another message",type:"text"}}},{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()+2-3456e5),id:G(),body:{text:"And another message",type:"text"}}},{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()-864e5),id:G(),body:{text:'Above me should be a time indicator showing "yesterday"',type:"text"}}},{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()+1-864e5),id:G(),body:{text:"Another message",type:"text"}}},{type:"message",payload:{...dl.payload,occurredAt:1e3*(Date.now()+2-864e5),id:G(),body:{text:"And another message",type:"text"}}},{type:"message",payload:{...dl.payload,occurredAt:1e3*Date.now(),id:G(),body:{text:"Above me should be a time indicator showing me the dialog continues today",type:"text"}}}]},cards:{category:Fl,headingText:"Cards",description:"",...Zc,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[Jl,Xl,Yl,Zl]},carousel:{category:Fl,headingText:"Carousel",description:"",...Zc,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{type:"message",payload:{type:"carousel",id:G(),body:{cards:[Jl.payload.body,Xl.payload.body,Yl.payload.body,Zl.payload.body]}}}]},errorWithAction:{category:Ul,headingText:"Error with a user action",description:"",...Zc,interrupt:{error:new x(new Error("general error"))}},errorWithoutAction:{category:Ul,headingText:"Error without a user action",description:"",...Zc,interrupt:{error:new Kn(new Error("seamly offline error"))}},privacyDisclaimer:{category:Hl,headingText:"Privacy disclaimer",description:"",...Zc,config:{...Zc.config,showDisclaimer:!0}},characterLimit:{category:Hl,headingText:"Input character limit",description:"",...Zc,entryMeta:{default:"text",active:"text",userSelected:null,options:{text:{limit:120}},optionsOverride:{}}},inputLabel:{category:Hl,headingText:"Input label",...Zc,entryMeta:{default:"text",active:"text",options:{text:{limit:null}},optionsOverride:{text:{label:"What is your name?",limit:null,placeholder:"Please enter your name"}}}},inputLabelWithFileUploadToggle:{category:Hl,headingText:"Input label with file upload toggle button",...Zc,options:{...Zc.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",options:{text:{limit:null}},optionsOverride:{text:{label:"What is the title of the uploaded document?",limit:null,placeholder:"Please enter the title of the document"}}}},abortTransactional:{category:Hl,headingText:"Abort transaction",...Zc,events:[dl,Sl],entryMeta:{default:"text",active:"text",options:{text:{limit:null}},optionsOverride:{},actions:{abortTransaction:{label:"Ask for another question",topicFallbackMessage:"Oops...",topicName:"abort_transaction"}},translatedActions:{}}},fileUploadToggle:{category:Bl,headingText:"File upload toggle button",description:"",...Zc,options:{...Zc.options,features:{uploads:{enabled:!0}}}},fileUploadToggleHidden:{category:Bl,headingText:"File upload toggle button hidden",description:"",...Zc,options:{...Zc.options,features:{uploads:{enabled:!1}}}},fileUploadInput:{category:Bl,headingText:"File upload input",description:"Click on upload button to see an error",styleGuideReset:!0,...Zc,config:{...Zc.config,accountConfig:{features:{uploads:!0}}},options:{...Zc.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}}},fileUploadBusy:{category:Bl,headingText:"File upload in progress",description:"",styleGuideReset:!0,...Zc,config:{...Zc.config,accountConfig:{features:{uploads:!0}}},options:{...Zc.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}},currentUploads:[{id:"_2olggurqhb4",name:"gGeyr3WepujbGn7khx.gif",progress:29,uploading:!0,complete:!1,error:"",uploadHandle:{abort:()=>{}}}]},fileUploadError:{category:Bl,headingText:"File upload errored",description:"",styleGuideReset:!0,...Zc,config:{...Zc.config,accountConfig:{features:{uploads:!0}}},options:{...Zc.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}},currentUploads:[{id:"_2olggurqhb4",name:"gGeyr3WepujbGn7khx.gif",progress:0,uploading:!1,complete:!1,error:"Something went wrong with the upload",uploadHandle:{abort:()=>{}}}]},idleTimerCountdown:{category:Hl,headingText:"Idle timer with countdown",description:"",...Zc,idleDetachCountdown:{hasCountdown:!0,isActive:!0,count:120,remaining:91,timer:{minutes:1,seconds:31}}},idleTimerNoCountdown:{category:Hl,headingText:"Idle timer without countdown",description:"",...Zc,idleDetachCountdown:{hasCountdown:!0,isActive:!1,count:120,remaining:91,timer:{minutes:1,seconds:31}}},resumeConversationPrompt:{category:Hl,headingText:"Resume conversation prompt",description:"",...Zc,participantInfo:Qc,resumeConversationPrompt:!0},optionsSingleTriggerAvailable:{category:$l,headingText:"Single option available",description:"",...Zc,options:{...Zc.options,features:{sendTranscript:{enabled:!0}}}},optionsSingleTriggerUnavailable:{category:$l,headingText:"Single option",description:"Option unavailable",...Zc,options:{...Zc.options,features:{sendTranscript:{enabled:!1}}}},optionsMultiple:{category:$l,headingText:"Multiple options",description:"All options available",...Zc,options:{...Zc.options,features:{extraMenuItem:{enabled:!0},sendTranscript:{enabled:!0}}}},optionsMultipleUnavailable:{category:$l,headingText:"Multiple options",description:"Some unavailable",...Zc,options:{...Zc.options,features:{extraMenuItem:{enabled:!1},sendTranscript:{enabled:!0}}}},optionSendTranscript:{category:$l,headingText:"Send transcript option",description:"Press submit to view error message",...Zc,options:{...Zc.options,optionActive:"sendTranscript",panelActive:!0,features:{sendTranscript:{enabled:!0}}}},translationsAvailable:{category:ql,headingText:"Show translations available",description:"",...Zc,translations:{...Rl,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]}},translationsAvailableWithOptions:{category:ql,headingText:"Show translations available with other options available",description:"",...Zc,options:{...Zc.options,features:{sendTranscript:{enabled:!0}}},config:{...Zc.config,context:{...Zc.context,contentLocale:"nl",userLocale:"en"}},translations:{...Rl,isAvailable:!0,currentLocale:"lv",isActive:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"},{locale:"ar",nativeName:"Arabic"},{locale:"bg",nativeName:"Bulgarian"},{locale:"zh",nativeName:"Chinese"},{locale:"cs",nativeName:"Czech"},{locale:"da",nativeName:"Danish"},{locale:"et",nativeName:"Estonian"},{locale:"fi",nativeName:"Finnish"},{locale:"fr",nativeName:"French"},{locale:"de-informal",nativeName:"German"},{locale:"el",nativeName:"Greek"},{locale:"hu",nativeName:"Hungarian"},{locale:"it",nativeName:"Italian"},{locale:"ja",nativeName:"Japanese"},{locale:"lv",nativeName:"Latvian"},{locale:"pl",nativeName:"Polish"},{locale:"ro",nativeName:"Romanian"},{locale:"ru",nativeName:"Russian"},{locale:"sk",nativeName:"Slovak"},{locale:"sl",nativeName:"Slovenian"},{locale:"es-informal",nativeName:"Spanish"},{locale:"sv",nativeName:"Swedish"},{locale:"ti",nativeName:"Tigrinya"},{locale:"tr",nativeName:"Turkish"},{locale:"uk",nativeName:"Ukrainian"}]}},translationsActive:{category:ql,headingText:"Show translations active",description:"",...Zc,translations:{...Rl,currentLocale:"nl",isActive:!0,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]}},translationsActiveLarge:{category:ql,headingText:"Show translations active (large list)",description:"",...Zc,config:{...Zc.config,context:{...Zc.context,contentLocale:"nl",userLocale:"en"}},translations:{...Rl,currentLocale:"lv",isActive:!0,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"},{locale:"ar",nativeName:"Arabic"},{locale:"bg",nativeName:"Bulgarian"},{locale:"zh",nativeName:"Chinese"},{locale:"cs",nativeName:"Czech"},{locale:"da",nativeName:"Danish"},{locale:"et",nativeName:"Estonian"},{locale:"fi",nativeName:"Finnish"},{locale:"fr",nativeName:"French"},{locale:"de-informal",nativeName:"German"},{locale:"el",nativeName:"Greek"},{locale:"hu",nativeName:"Hungarian"},{locale:"it",nativeName:"Italian"},{locale:"ja",nativeName:"Japanese"},{locale:"lv",nativeName:"Latvian"},{locale:"pl",nativeName:"Polish"},{locale:"ro",nativeName:"Romanian"},{locale:"ru",nativeName:"Russian"},{locale:"sk",nativeName:"Slovak"},{locale:"sl",nativeName:"Slovenian"},{locale:"es-informal",nativeName:"Spanish"},{locale:"sv",nativeName:"Swedish"},{locale:"ti",nativeName:"Tigrinya"},{locale:"tr",nativeName:"Turkish"},{locale:"uk",nativeName:"Ukrainian"}]}},translationsFullConversation:{category:ql,headingText:"Show translated messages",description:"",...Zc,participantInfo:Qc,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[tl,al,dl,{...Cl,payload:{...Cl.payload,id:`${Cl.payload.id}XXX`}},hl,Sl,ml,el,nl,rl,xl,Ll,kl,Ml,Al,El,_l,yl,gl,wl,Ol,Pl,vl,bl,Cl,fl,rl].map(Yc),translations:{...Rl,currentLocale:"nl",isActive:!0,isAvailable:!0,translatedEventGroups:{[tl.payload.id]:[al,dl,{...Cl,payload:{...Cl.payload,id:`${Cl.payload.id}XXX`}},hl,Sl,ml,el].map((e=>e.payload.id)),[nl.payload.id]:[xl,Ll,kl,Ml,Al,El,_l,yl,gl,wl,Ol,Pl,vl,bl,Cl,fl].map((e=>e.payload.id))},languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]}},translationProposal:{category:ql,headingText:"Show translation proposal",description:"",...Zc,events:[dl,Sl,El],config:{...Zc.config,showDisclaimer:!0,context:{contentLocale:"nl-informal",userLocale:"en-GB"}},translations:{...Rl,translationProposal:{buttonLabel:"Activate",proposedLocale:"en-GB",srDismissButtonText:"Dismiss translation proposal",titleLabel:"Do you want to chat in English?"},isAvailable:!0,isActive:!1,languages:[{locale:"nl-informal",nativeName:"Dutch"},{locale:"en-GB",nativeName:"English"}]}},translationProposalWithoutTitle:{category:ql,headingText:"Show translation proposal without title",description:"",...Zc,events:[dl,Sl,El],config:{...Zc.config,showDisclaimer:!0,context:{contentLocale:"nl-informal",userLocale:"en-GB"}},translations:{...Rl,translationProposal:{buttonLabel:"Activate",proposedLocale:"en-GB",srDismissButtonText:"Dismiss translation proposal"},isAvailable:!0,isActive:!1,languages:[{locale:"nl-informal",nativeName:"Dutch"},{locale:"en-GB",nativeName:"English"}]}}},eu={minimizedInline:{category:Wl,headingText:"Inline minimized",description:"",inline:{...Zc,config:{...Zc.config,layoutMode:"inline"},visibility:{...Zc.visibility,visibility:Mt.minimized}}},minimizedInlineCharacterLimit:{category:Wl,headingText:"Inline minimized with limited characters",description:"",inline:{...Zc,config:{...Zc.config,layoutMode:"inline"},visibility:{...Zc.visibility,visibility:Mt.minimized},entryMeta:{...Zc.entryMeta,options:{text:{limit:120}}}}},minimizedInlinePrechat:{category:Wl,headingText:"Inline minimized with pre-chat messages",description:"",inline:{...Zc,config:{...Zc.config,layoutMode:"inline",preChatEvents:[pl]},visibility:{...Zc.visibility,visibility:Mt.minimized}}},minimizedInlinePrechatSuggestions:{category:Wl,headingText:"Inline minimized with pre-chat messages & suggestions",description:"",inline:{...Zc,config:{...Zc.config,layoutMode:"inline",preChatEvents:[pl]},serviceData:{suggestion:{body:Dl}},visibility:{...Zc.visibility,visibility:Mt.minimized}}},inlineWithSuggestions:{category:Vl,headingText:"Suggestions",description:"",inline:{...Zc,config:{...Zc.config,layoutMode:"inline"},visibility:{...Zc.visibility,visibility:Mt.open},serviceData:{suggestion:{body:Dl}}}},minimizedInlineWithError:{category:Wl,headingText:"Inline minimized with error",description:"",inline:{...Zc,config:{...Zc.config,layoutMode:"inline"},visibility:{...Zc.visibility,visibility:Mt.minimized},interrupt:{error:new Kn(new Error("seamly offline error"))}}}},tu={minimizedWindow:{category:Gl,headingText:"Unstarted minimized",description:"",window:{...Zc,config:{...Zc.config,layoutMode:"window"},visibility:{...Zc.visibility,visibility:Mt.minimized}}},minimizedWindowStarted:{category:Gl,headingText:"Started minimized",description:"",window:{...Zc,config:{...Zc.config,layoutMode:"window"},visibility:{...Zc.visibility,visibility:Mt.minimized},participantInfo:Qc,headerTitles:ol}},minimizedWindowStartedUnread:{category:Gl,headingText:"Minimized with unread messages",description:"",window:{...Zc,config:{...Zc.config,layoutMode:"window"},visibility:{...Zc.visibility,visibility:Mt.minimized},participantInfo:Qc,headerTitles:ol,unreadEvents:12}}},nu={suggestionsMessage:{category:Fl,headingText:"Suggestions message",description:"",...Zc,events:[ul(dl.payload.body),{type:"service_data",payload:{type:"suggestion",body:Dl}}]}},ru=(e,t=[])=>{const n={...Ql,fullConversation:{...Ql.fullConversation,events:[pl,...Ql.fullConversation.events]},...nu,...t.reduce(((e,t)=>{const{key:n,headingText:r,description:a,body:i}=t;return{...e,[n]:{category:Fl,headingText:r,description:a,...Zc,participantInfo:Qc,events:[ul(i)]}}}),{})};return Object.keys(n).reduce(((t,r)=>{const{headingText:a,category:i,description:o,...s}=n[r];return{...t,[r]:{headingText:a,description:o,category:i,...e.reduce(((e,t)=>({...e,[t]:{...s,config:{...s.config,layoutMode:t}}})),{})}}}),{})},au=({setSelectedState:e,states:t,headingLevel:n})=>{const r=`h${n.toString()}`,a=`h${(parseInt(n,10)+1).toString()}`,i=Kc();return(0,li.jsx)("nav",{"aria-label":"Style guide navigation",className:"nav--styleguide",children:(0,li.jsx)("ol",{className:"list--styleguidestates",children:Object.keys(Kl).map((n=>{const{heading:o,description:s}=Kl[n],c=Object.keys(t).filter((e=>{const{category:r}=t[e];return r===n}));return c.length>0&&(0,li.jsxs)("li",{children:[(0,li.jsx)(r,{children:o}),(0,li.jsx)("span",{className:"category__description",children:s}),(0,li.jsx)("ol",{children:c.map((n=>{const r={...t[n]};delete r.category;const{headingText:o,descriptionId:s,description:c,...l}=r;return(0,li.jsxs)("li",{children:[(0,li.jsx)(a,{id:s,children:o}),c&&(0,li.jsx)("span",{className:"feature__description",children:c}),(0,li.jsx)("ul",{className:"list--styleguidelayouts",children:Object.keys(l).map((t=>(0,li.jsx)("li",{className:t===i?.layoutMode&&n===i?.feature?"state__selected":void 0,children:(0,li.jsx)("a",{"aria-describedby":s,href:`${window.location.pathname}?${Jc({layoutMode:t,feature:n})}`,"aria-current":t===i?.layoutMode&&n===i?.feature?"page":void 0,onClick:r=>{if(r.preventDefault(),"inline"===t){const e=window.document.querySelector(".chat-inline");e&&window.scroll({top:e.offsetTop,behavior:"smooth"})}var a;a={layoutMode:t,feature:n},window.history.pushState(null,"",`${window.location.pathname}?${Jc(a)}`),e(a)},children:t.charAt(0).toUpperCase()+t.slice(1)})},t)))})]},n)}))})]},n)}))})})},iu=require("@seamly/web-ui"),ou={send:()=>{},store:{get:e=>e,set:e=>e,delete:e=>e},sendContext:()=>{},hasConversation:()=>!1,connected:!1},su=({state:e,translations:t,participants:n=[],children:r})=>{const a=(0,ka.useRef)((()=>{})),i=(0,ka.useRef)({emit:()=>{},on:()=>{},off:()=>{}}),o=(0,ka.useMemo)((()=>{const{translations:r,interrupt:a,config:o,visibility:s,...c}=e||{},l=rt({reducer:{state:ha,app:qn,config:$n,i18n:fr,translations:Ea,visibility:Ia,forms:sr,interrupt:br},preloadedState:{state:c,config:o,translations:r,interrupt:a,visibility:s},middleware:e=>e({thunk:{extraArgument:{api:ou,eventBus:i.current}},serializableCheck:!1})}),{config:u}=l.getState();return l.dispatch(Un(u)),u.preChatEvents&&l.dispatch(Hn(u.preChatEvents)),l.dispatch(dr("en-GB")),l.dispatch(pr(t)),n.forEach((e=>{l.dispatch(Zr({participant:e,fromClient:"user"===e?.id}))})),l}),[n,e,t]);return e&&(0,li.jsx)(iu.SeamlyStoreProvider,{store:o,children:(0,li.jsx)(iu.SeamlyEventBusContext.Provider,{value:i.current,children:(0,li.jsx)(iu.SeamlyApiContext.Provider,{value:ou,children:(0,li.jsx)(iu.SeamlyLiveRegionContext.Provider,{value:a.current,children:(0,li.jsx)(iu.ComponentFilter,{children:(0,li.jsx)(iu.SeamlyActivityMonitor,{children:(0,li.jsx)(iu.SeamlyFileUpload,{children:r})})})})})})})},cu=({state:e,customComponents:t={},translations:n,participants:r})=>{const[a,i]=(0,ka.useState)(!0),{config:o}=e||{},{layoutMode:s}=o||{},c=t[s];return(0,ka.useEffect)((()=>{i(!1),requestAnimationFrame((async()=>{await pi(60),i(!0)}))}),[e]),a?c?(0,li.jsx)(su,{state:e,translations:n,participants:r,children:(0,li.jsx)(c,{})}):(0,li.jsx)(su,{state:e,translations:n,participants:r,children:(0,li.jsx)(iu.View,{})}):null},lu=({tag:e,id:t,children:n})=>{const r=e;return(0,li.jsx)(r,{id:t,children:n})},uu=({config:e,styleGuideConfig:t,translations:n,headingLevel:r=2,participants:a})=>{const[i,o]=(0,ka.useState)(null),[s,c]=(0,ka.useState)(""),[l,u]=(0,ka.useState)(!0),[d]=(0,ka.useState)(G()),{stateUpdateCallback:p,customMessageEventBodies:f}=t,[h]=(0,ka.useState)((()=>{const e=(n=t.showLayoutModes||["inline","window"],{...ru(n,f),...-1!==n.indexOf("window")?{...tu,minimizedWindowPrechat:{category:Gl,headingText:"Minimized with pre-chat messages",description:"",window:{...Zc,config:{...Zc.config,layoutMode:"window",preChatEvents:[pl]},visibility:{...Zc.visibility,visibility:Mt.minimized},participantInfo:Qc,headerTitles:ol}},minimizedWindowPrechatDelayed:{category:Gl,headingText:"Minimized with delayed pre-chat messages",description:"",window:{...Zc,config:{...Zc.config,layoutMode:"window",preChatEvents:[pl],preChat:{enterDelay:1e3,exitAfter:3e3}},visibility:{...Zc.visibility,visibility:Mt.minimized},participantInfo:Qc,headerTitles:ol}},minimizedWindowPrechatDisabled:{category:Gl,headingText:"Minimized with disabled pre-chat messages",description:"",window:{...Zc,config:{...Zc.config,layoutMode:"window",preChatEvents:[pl],preChat:!1},visibility:{...Zc.visibility,visibility:Mt.minimized},participantInfo:Qc,headerTitles:ol}}}:{},...eu});var n;return Object.keys(e).reduce(((t,n)=>({...t,[n]:{...e[n],descriptionId:G()}})),{})})),m=(0,ka.useCallback)((e=>{o(p?p(e):e)}),[o,p]),y=(0,ka.useCallback)(((t,n)=>{const r=((...e)=>{const t=new URL(window.location.href);return e.reduce(((e,n)=>{const r=t.searchParams.get(n)||sessionStorage.getItem(n);return r&&(e[n]=r),e}),{})})("apiKey","locale"),i=new URLSearchParams({...r,layoutMode:t,feature:n});window.history.replaceState(null,"",`?${i}`);const{headingText:o}=h[n];c(o);const s=h[n][t],{overrideMessages:l,showSuggestions:u}=s.config,d=a.find((e=>"agent"===e.id));return{...s,config:{...s.config,...e,showDisclaimer:s.config.showDisclaimer||e.showDisclaimer,context:{...e.context,...s.config?.context},layoutMode:s.config.layoutMode,...l?{messages:l}:{},showSuggestions:u},headerTitles:{...s.headerTitles,subTitle:d?.name||s.headerTitles.subTitle}}}),[h,a,e]);(0,ka.useEffect)((()=>{if(l){const e=document.querySelector('[aria-modal="true"]');e&&e.addEventListener("click",(()=>{o((e=>e?{...e,visibility:{...e.visibility,visible:"minimized"}}:e))}))}}),[i,o,l]);const g=(0,ka.useCallback)((()=>{const e=Kc(),{layoutMode:t,feature:n}={layoutMode:"inline",feature:"base",...e};m(y(t,n)),window.document.title="Style"}),[y,m]);return(0,ka.useEffect)((()=>{g()}),[g]),(0,ka.useEffect)((()=>{window.onpopstate=()=>{g()}}),[g]),(0,li.jsxs)(li.Fragment,{children:[(0,li.jsxs)("section",{className:"chat-inline","aria-labelledby":d,children:[(0,li.jsxs)(lu,{tag:`h${r.toString()}`,id:d,children:[(0,li.jsx)("span",{className:"heading__context",children:"Current selected state:"}),`${s}`]}),(0,li.jsx)("div",{children:l&&(0,li.jsx)(cu,{customComponents:t.customComponents,translations:n,state:i,participants:a})})]}),(0,li.jsx)("aside",{className:"page-aside markdown",children:(0,li.jsx)("nav",{className:"page-controls",children:(0,li.jsx)(au,{headingLevel:r,setSelectedState:({layoutMode:e,feature:t})=>{const n=y(e,t);m(n),n.styleGuideReset&&(u(!1),setTimeout((()=>{u(!0)})))},states:h})})})]})},du=class extends Vc{constructor({styleGuideConfig:e,...t},n){super(t,n),this.styleGuideConfig=e||{}}async render(){const e={...this.config.customComponents||{},view:void 0},t=new J({namespace:this.config.namespace||"",config:this.config.api,context:this.config.context,layoutMode:this.config.layoutMode}),n=await t.getTranslations(this.config.context?.userLocale||"en-GB"),{agentParticipant:r,userParticipant:i}=await t.getConfig(),o=[{id:"user",...i},{id:"agent",introduction:"I am {{name}}",...r}],s={...this.config,customComponents:Object.keys(e).length?e:void 0};(0,a.render)((0,li.jsx)(uu,{config:s,styleGuideConfig:this.styleGuideConfig,translations:n,participants:o}),this.parentElement)}},pu=class extends qc{constructor(e,t){super(e),this.styleGuideConfig=t}createInstance(e){const{userStyleGuideConfig:t,...n}=e;return new du({styleGuideConfig:{...this.styleGuideConfig,...t},...n},this)}getUserConfig(e={},t){return super.getUserConfig({...e,...t})}},fu=function(e,t){if(window.seamlyStyleGuide&&!Array.isArray(window.seamlyStyleGuide))throw new Error("Seamly UI has already been initialised. Use the window.seamly object to start new instances instead.");const n=Array.isArray(window.seamlyStyleGuide)?window.seamlyStyleGuide:[],r=new pu(e,t);window.seamly=r,window.seamlyStyleGuide={push:r.push.bind(r)},r.push(...n)}})(),module.exports=r})();
|
|
3
3
|
//# sourceMappingURL=~/style-guide.min.js.map
|