@seamly/web-ui 25.3.0 → 25.4.0-beta.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.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see index.min.js.LICENSE.txt */
2
- (()=>{var e={34:(e,t,n)=>{"use strict";var r=n(4901);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},81:(e,t,n)=>{"use strict";var r=n(9565),o=n(9306),s=n(8551),a=n(6823),i=n(851),c=TypeError;e.exports=function(e,t){var n=arguments.length<2?i(e):t;if(o(n))return s(r(n,e));throw new c(a(e)+" is not iterable")}},116:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("find",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{find:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;return s(t,function(t,r){if(e(t,n++))return r(t)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},283:(e,t,n)=>{"use strict";var r=n(9504),o=n(9039),s=n(4901),a=n(9297),i=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),v=r([].join),g=i&&!o(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),(!a(e,"name")||c&&e.name!==t)&&(i?h(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&a(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?i&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=d(e);return a(r,"source")||(r.source=v(b,"string"==typeof t?t:"")),e};Function.prototype.toString=x(function(){return s(this)&&p(this).source||l(this)},"toString")},350:(e,t,n)=>{"use strict";var r=n(3724),o=n(9297),s=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,i=o(s,"name"),c=i&&"something"===function(){}.name,l=i&&(!r||r&&a(s,"name").configurable);e.exports={EXISTS:i,PROPER:c,CONFIGURABLE:l}},397:(e,t,n)=>{"use strict";var r=n(7751);e.exports=r("document","documentElement")},421:e=>{"use strict";e.exports={}},507:(e,t,n)=>{"use strict";var r=n(9565);e.exports=function(e,t,n){for(var o,s,a=n?e:e.iterator,i=e.next;!(o=r(i,a)).done;)if(void 0!==(s=t(o.value)))return s}},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")})},655:(e,t,n)=>{"use strict";var r=n(6955),o=String;e.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return o(e)}},679:(e,t,n)=>{"use strict";var r=n(1625),o=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw new o("Incorrect invocation")}},684:e=>{"use strict";e.exports=function(e,t){var n="function"==typeof Iterator&&Iterator.prototype[e];if(n)try{n.call({next:null},t).next()}catch(e){return!0}}},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)}},757:(e,t,n)=>{"use strict";var r=n(7751),o=n(4901),s=n(1625),a=n(7040),i=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&s(t.prototype,i(e))}},851:(e,t,n)=>{"use strict";var r=n(6955),o=n(5966),s=n(4117),a=n(6269),i=n(8227)("iterator");e.exports=function(e){if(!s(e))return o(e,i)||o(e,"@@iterator")||a[r(e)]}},1072:(e,t,n)=>{"use strict";var r=n(1828),o=n(8727);e.exports=Object.keys||function(e){return r(e,o)}},1148:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("every",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{every:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;return!s(t,function(t,r){if(!e(t,n++))return r()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},1162:e=>{"use strict";e.exports=require("preact/hooks")},1181:(e,t,n)=>{"use strict";var r,o,s,a=n(8622),i=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=i.TypeError,y=i.WeakMap;if(a||d.state){var v=d.state||(d.state=new y);v.get=v.get,v.has=v.has,v.set=v.set,r=function(e,t){if(v.has(e))throw new m(h);return t.facade=e,v.set(e,t),t},o=function(e){return v.get(e)||{}},s=function(e){return v.has(e)}}else{var g=p("state");f[g]=!0,r=function(e,t){if(u(e,g))throw new m(h);return t.facade=e,l(e,g,t),t},o=function(e){return u(e,g)?e[g]:{}},s=function(e){return u(e,g)}}e.exports={set:r,get:o,has:s,enforce:function(e){return s(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=o(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return n}}}},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)}},1385:(e,t,n)=>{"use strict";var r=n(9539);e.exports=function(e,t,n){for(var o=e.length-1;o>=0;o--)if(void 0!==e[o])try{n=r(e[o].iterator,t,n)}catch(e){t="throw",n=e}if("throw"===t)throw n;return n}},1454:(e,t,n)=>{"use strict";n(1701)},1625:(e,t,n)=>{"use strict";var r=n(9504);e.exports=r({}.isPrototypeOf)},1698:(e,t,n)=>{"use strict";var r=n(6518),o=n(4204),s=n(9835);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("union")||!s("union")},{union:o})},1701:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(9306),a=n(8551),i=n(1767),c=n(9462),l=n(6319),u=n(9539),d=n(684),p=n(4549),f=n(6395),h=!f&&!d("map",function(){}),m=!f&&!h&&p("map",TypeError),y=f||h||m,v=c(function(){var e=this.iterator,t=a(o(this.next,e));if(!(this.done=!!t.done))return l(e,this.mapper,[t.value,this.counter++],!0)});r({target:"Iterator",proto:!0,real:!0,forced:y},{map:function(e){a(this);try{s(e)}catch(e){u(this,"throw",e)}return m?o(m,this,e):new v(i(this),{mapper:e})}})},1767:e=>{"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},1828:(e,t,n)=>{"use strict";var r=n(9504),o=n(9297),s=n(5397),a=n(9617).indexOf,i=n(421),c=r([].push);e.exports=function(e,t){var n,r=s(e),l=0,u=[];for(n in r)!o(i,n)&&o(r,n)&&c(u,n);for(;t.length>l;)o(r,n=t[l++])&&(~a(u,n)||c(u,n));return u}},2086:e=>{e.exports=function(e){var t={},n=[];(e=e||this).on=function(n,r,o){return(t[n]=t[n]||[]).push([r,o]),e},e.off=function(r,o){r||(t={});for(var s=t[r]||n,a=s.length=o?s.length:0;a--;)o==s[a][0]&&s.splice(a,1);return e},e.emit=function(r){for(var o,s=t[r]||n,a=s.length>0?s.slice(0,s.length):s,i=0;o=a[i++];)o[0].apply(o[1],n.slice.call(arguments,1));return e}}},2106:(e,t,n)=>{"use strict";var r=n(283),o=n(4913);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),o.f(e,t,n)}},2140:(e,t,n)=>{"use strict";var r={};r[n(8227)("toStringTag")]="z",e.exports="[object z]"===String(r)},2195:(e,t,n)=>{"use strict";var r=n(9504),o=r({}.toString),s=r("".slice);e.exports=function(e){return s(o(e),8,-1)}},2211:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},2360:(e,t,n)=>{"use strict";var r,o=n(8551),s=n(6801),a=n(8727),i=n(421),c=n(397),l=n(4055),u=n(6119),d="prototype",p="script",f=u("IE_PROTO"),h=function(){},m=function(e){return"<"+p+">"+e+"</"+p+">"},y=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;v="undefined"!=typeof document?document.domain&&r?y(r):(t=l("iframe"),n="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):y(r);for(var o=a.length;o--;)delete v[d][a[o]];return v()};i[f]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h[d]=o(e),n=new h,h[d]=null,n[f]=e):n=v(),void 0===t?n:s.f(n,t)}},2475:(e,t,n)=>{"use strict";var r=n(6518),o=n(8527);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSupersetOf",function(e){return!e})},{isSupersetOf:o})},2489:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(9306),a=n(8551),i=n(1767),c=n(9462),l=n(6319),u=n(6395),d=n(9539),p=n(684),f=n(4549),h=!u&&!p("filter",function(){}),m=!u&&!h&&f("filter",TypeError),y=u||h||m,v=c(function(){for(var e,t,n=this.iterator,r=this.predicate,s=this.next;;){if(e=a(o(s,n)),this.done=!!e.done)return;if(t=e.value,l(n,r,[t,this.counter++],!0))return t}});r({target:"Iterator",proto:!0,real:!0,forced:y},{filter:function(e){a(this);try{s(e)}catch(e){d(this,"throw",e)}return m?o(m,this,e):new v(i(this),{predicate:e})}})},2529:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},2577:(e,t,n)=>{"use strict";n(116)},2652:(e,t,n)=>{"use strict";var r=n(6080),o=n(9565),s=n(8551),a=n(6823),i=n(4209),c=n(6198),l=n(1625),u=n(81),d=n(851),p=n(9539),f=TypeError,h=function(e,t){this.stopped=e,this.result=t},m=h.prototype;e.exports=function(e,t,n){var y,v,g,b,x,w,_,C=n&&n.that,S=!(!n||!n.AS_ENTRIES),E=!(!n||!n.IS_RECORD),j=!(!n||!n.IS_ITERATOR),T=!(!n||!n.INTERRUPTED),I=r(t,C),N=function(e){return y&&p(y,"normal"),new h(!0,e)},k=function(e){return S?(s(e),T?I(e[0],e[1],N):I(e[0],e[1])):T?I(e,N):I(e)};if(E)y=e.iterator;else if(j)y=e;else{if(!(v=d(e)))throw new f(a(e)+" is not iterable");if(i(v)){for(g=0,b=c(e);b>g;g++)if((x=k(e[g]))&&l(m,x))return x;return new h(!1)}y=u(e,v)}for(w=E?e.next:y.next;!(_=o(w,y)).done;){try{x=k(_.value)}catch(e){p(y,"throw",e)}if("object"==typeof x&&x&&l(m,x))return x}return new h(!1)}},2777:(e,t,n)=>{"use strict";var r=n(9565),o=n(34),s=n(757),a=n(5966),i=n(4270),c=n(8227),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!o(e)||s(e))return e;var n,c=a(e,u);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!o(n)||s(n))return n;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),i(e,t)}},2787:(e,t,n)=>{"use strict";var r=n(9297),o=n(4901),s=n(8981),a=n(6119),i=n(2211),c=a("IE_PROTO"),l=Object,u=l.prototype;e.exports=i?l.getPrototypeOf:function(e){var t=s(e);if(r(t,c))return t[c];var n=t.constructor;return o(n)&&t instanceof n?n.prototype:t instanceof l?u:null}},2796:(e,t,n)=>{"use strict";var r=n(9039),o=n(4901),s=/#|\.prototype\./,a=function(e,t){var n=c[i(e)];return n===u||n!==l&&(o(t)?r(t):!!t)},i=a.normalize=function(e){return String(e).replace(s,".").toLowerCase()},c=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},2812:e=>{"use strict";var t=TypeError;e.exports=function(e,n){if(e<n)throw new t("Not enough arguments");return e}},2839:(e,t,n)=>{"use strict";var r=n(4576).navigator,o=r&&r.userAgent;e.exports=o?String(o):""},3215:(e,t,n)=>{"use strict";n(1148)},3375:(e,t,n)=>{"use strict";n(7642)},3392:(e,t,n)=>{"use strict";var r=n(9504),o=0,s=Math.random(),a=r(1.1.toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+s,36)}},3440:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402),s=n(9286),a=n(5170),i=n(3789),c=n(8469),l=n(507),u=o.has,d=o.remove;e.exports=function(e){var t=r(this),n=i(e),o=s(t);return a(t)<=n.size?c(t,function(e){n.includes(e)&&d(o,e)}):l(n.getIterator(),function(e){u(o,e)&&d(o,e)}),o}},3579:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("some",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{some:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;return s(t,function(t,r){if(e(t,n++))return r()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3650:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402),s=n(9286),a=n(3789),i=n(507),c=o.add,l=o.has,u=o.remove;e.exports=function(e){var t=r(this),n=a(e).getIterator(),o=s(t);return i(n,function(e){l(t,e)?u(o,e):c(o,e)}),o}},3706:(e,t,n)=>{"use strict";var r=n(9504),o=n(4901),s=n(7629),a=r(Function.toString);o(s.inspectSource)||(s.inspectSource=function(e){return a(e)}),e.exports=s.inspectSource},3717:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},3724:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},3789:(e,t,n)=>{"use strict";var r=n(9306),o=n(8551),s=n(9565),a=n(1291),i=n(1767),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 i(o(s(this.keys,this.set)))},includes:function(e){return s(this.has,this.set,e)}},e.exports=function(e){o(e);var t=+e.size;if(t!=t)throw new u(c);var n=a(t);if(n<0)throw new l(c);return new p(e,n)}},3838:(e,t,n)=>{"use strict";var r=n(7080),o=n(5170),s=n(8469),a=n(3789);e.exports=function(e){var t=r(this),n=a(e);return!(o(t)>n.size)&&!1!==s(t,function(e){if(!n.includes(e))return!1},!0)}},3853:(e,t,n)=>{"use strict";var r=n(6518),o=n(4449);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isDisjointFrom",function(e){return!e})},{isDisjointFrom:o})},3949:(e,t,n)=>{"use strict";n(7588)},3972:(e,t,n)=>{"use strict";n(3853)},4055:(e,t,n)=>{"use strict";var r=n(4576),o=n(34),s=r.document,a=o(s)&&o(s.createElement);e.exports=function(e){return a?s.createElement(e):{}}},4114:(e,t,n)=>{"use strict";var r=n(6518),o=n(8981),s=n(6198),a=n(4527),i=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=o(this),n=s(t),r=arguments.length;i(n+r);for(var c=0;c<r;c++)t[n]=arguments[c],n++;return a(t,n),n}})},4117:e=>{"use strict";e.exports=function(e){return null==e}},4204:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402).add,s=n(9286),a=n(3789),i=n(507);e.exports=function(e){var t=r(this),n=a(e).getIterator(),c=s(t);return i(n,function(e){o(c,e)}),c}},4209:(e,t,n)=>{"use strict";var r=n(8227),o=n(6269),s=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[s]===e)}},4270:(e,t,n)=>{"use strict";var r=n(9565),o=n(4901),s=n(34),a=TypeError;e.exports=function(e,t){var n,i;if("string"===t&&o(n=e.toString)&&!s(i=r(n,e)))return i;if(o(n=e.valueOf)&&!s(i=r(n,e)))return i;if("string"!==t&&o(n=e.toString)&&!s(i=r(n,e)))return i;throw new a("Can't convert object to primitive value")}},4376:(e,t,n)=>{"use strict";var r=n(2195);e.exports=Array.isArray||function(e){return"Array"===r(e)}},4402:(e,t,n)=>{"use strict";var r=n(9504),o=Set.prototype;e.exports={Set,add:r(o.add),has:r(o.has),remove:r(o.delete),proto:o}},4449:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402).has,s=n(5170),a=n(3789),i=n(8469),c=n(507),l=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(s(t)<=n.size)return!1!==i(t,function(e){if(n.includes(e))return!1},!0);var u=n.getIterator();return!1!==c(u,function(e){if(o(t,e))return l(u,"normal",!1)})}},4495:(e,t,n)=>{"use strict";var r=n(9519),o=n(9039),s=n(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!o(function(){var e=Symbol("symbol detection");return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41})},4520:(e,t,n)=>{"use strict";n(2489)},4527:(e,t,n)=>{"use strict";var r=n(3724),o=n(4376),s=TypeError,a=Object.getOwnPropertyDescriptor,i=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=i?function(e,t){if(o(e)&&!a(e,"length").writable)throw new s("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},4549:(e,t,n)=>{"use strict";var r=n(4576);e.exports=function(e,t){var n=r.Iterator,o=n&&n.prototype,s=o&&o[e],a=!1;if(s)try{s.call({next:function(){return{done:!0}},return:function(){a=!0}},-1)}catch(e){e instanceof t||(a=!1)}if(!a)return s}},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")()},4603:(e,t,n)=>{"use strict";var r=n(6840),o=n(9504),s=n(655),a=n(2812),i=URLSearchParams,c=i.prototype,l=o(c.append),u=o(c.delete),d=o(c.forEach),p=o([].push),f=new i("a=1&a=2&b=3");f.delete("a",1),f.delete("b",void 0),f+""!="a=2"&&r(c,"delete",function(e){var t=arguments.length,n=t<2?void 0:arguments[1];if(t&&void 0===n)return u(this,e);var r=[];d(this,function(e,t){p(r,{key:t,value:e})}),a(t,1);for(var o,i=s(e),c=s(n),f=0,h=0,m=!1,y=r.length;f<y;)o=r[f++],m||o.key===i?(m=!0,u(this,o.key)):h++;for(;h<y;)(o=r[h++]).key===i&&o.value===c||l(this,o.key,o.value)},{enumerable:!0,unsafe:!0})},4659:(e,t,n)=>{"use strict";var r=n(3724),o=n(4913),s=n(6980);e.exports=function(e,t,n){r?o.f(e,t,s(0,n)):e[t]=n}},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}},4913:(e,t,n)=>{"use strict";var r=n(3724),o=n(5917),s=n(8686),a=n(8551),i=n(6969),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",f="writable";t.f=r?s?function(e,t,n){if(a(e),t=i(t),a(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(a(e),t=i(t),a(n),o)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}},4916:(e,t,n)=>{"use strict";var r=n(7751),o=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},s=function(e){return{size:e,has:function(){return!0},keys:function(){throw new Error("e")}}};e.exports=function(e,t){var n=r("Set");try{(new n)[e](o(0));try{return(new n)[e](o(-1)),!1}catch(r){if(!t)return!0;try{return(new n)[e](s(-1/0)),!1}catch(r){var a=new n;return a.add(1),a.add(2),t(a[e](s(1/0)))}}}catch(e){return!1}}},5024:(e,t,n)=>{"use strict";var r=n(6518),o=n(3650),s=n(9835);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("symmetricDifference")||!s("symmetricDifference")},{symmetricDifference:o})},5031:(e,t,n)=>{"use strict";var r=n(7751),o=n(9504),s=n(8480),a=n(3717),i=n(8551),c=o([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=s.f(i(e)),n=a.f;return n?c(t,n(e)):t}},5160:(e,t,n)=>{"use strict";var r=n(7402),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useSyncExternalStore,a=r.useRef,i=r.useEffect,c=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=a(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(!i){if(i=!0,s=e,e=r(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return a=t}return a=e}if(t=a,o(s,e))return t;var n=r(e);return void 0!==u&&u(t,n)?(s=e,t):(s=e,a=n)}var s,a,i=!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=s(e,d[0],d[1]);return i(function(){p.hasValue=!0,p.value=f},[f]),l(f),f}},5170:(e,t,n)=>{"use strict";var r=n(6706),o=n(4402);e.exports=r(o.proto,"size","get")||function(e){return e.size}},5397:(e,t,n)=>{"use strict";var r=n(7055),o=n(7750);e.exports=function(e){return r(o(e))}},5610:(e,t,n)=>{"use strict";var r=n(1291),o=Math.max,s=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):s(n,t)}},5714:(e,t,n)=>{"use strict";n(2475)},5745:(e,t,n)=>{"use strict";var r=n(7629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},5876:(e,t,n)=>{"use strict";var r=n(6518),o=n(3838);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSubsetOf",function(e){return e})},{isSubsetOf:o})},5917:(e,t,n)=>{"use strict";var r=n(3724),o=n(9039),s=n(4055);e.exports=!r&&!o(function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},5966:(e,t,n)=>{"use strict";var r=n(9306),o=n(4117);e.exports=function(e,t){var n=e[t];return o(n)?void 0:r(n)}},6080:(e,t,n)=>{"use strict";var r=n(7476),o=n(9306),s=n(616),a=r(r.bind);e.exports=function(e,t){return o(e),void 0===t?e:s?a(e,t):function(){return e.apply(t,arguments)}}},6119:(e,t,n)=>{"use strict";var r=n(5745),o=n(3392),s=r("keys");e.exports=function(e){return s[e]||(s[e]=o(e))}},6197:(e,t,n)=>{"use strict";n(1698)},6198:(e,t,n)=>{"use strict";var r=n(8014);e.exports=function(e){return r(e.length)}},6269:e=>{"use strict";e.exports={}},6279:(e,t,n)=>{"use strict";var r=n(6840);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},6319:(e,t,n)=>{"use strict";var r=n(8551),o=n(9539);e.exports=function(e,t,n,s){try{return s?t(r(n)[0],n[1]):t(n)}catch(t){o(e,"throw",t)}}},6395:e=>{"use strict";e.exports=!1},6469:(e,t,n)=>{"use strict";var r=n(8227),o=n(2360),s=n(4913).f,a=r("unscopables"),i=Array.prototype;void 0===i[a]&&s(i,a,{configurable:!0,value:o(null)}),e.exports=function(e){i[a][e]=!0}},6518:(e,t,n)=>{"use strict";var r=n(4576),o=n(7347).f,s=n(6699),a=n(6840),i=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]||i(h,{}):r[h]&&r[h].prototype)for(u in t){if(p=t[u],d=e.dontCallGetSet?(f=o(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)&&s(p,"sham",!0),a(n,u,p,e)}}},6699:(e,t,n)=>{"use strict";var r=n(3724),o=n(4913),s=n(6980);e.exports=r?function(e,t,n){return o.f(e,t,s(1,n))}:function(e,t,n){return e[t]=n,e}},6706:(e,t,n)=>{"use strict";var r=n(9504),o=n(9306);e.exports=function(e,t,n){try{return r(o(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},6801:(e,t,n)=>{"use strict";var r=n(3724),o=n(8686),s=n(4913),a=n(8551),i=n(5397),c=n(1072);t.f=r&&!o?Object.defineProperties:function(e,t){a(e);for(var n,r=i(t),o=c(t),l=o.length,u=0;l>u;)s.f(e,n=o[u++],r[n]);return e}},6823:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},6837:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},6840:(e,t,n)=>{"use strict";var r=n(4901),o=n(4913),s=n(283),a=n(9433);e.exports=function(e,t,n,i){i||(i={});var c=i.enumerable,l=void 0!==i.name?i.name:t;if(r(n)&&s(n,l,i),i.global)c?e[t]=n:a(t,n);else{try{i.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=n:o.f(e,t,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e}},6955:(e,t,n)=>{"use strict";var r=n(2140),o=n(4901),s=n(2195),a=n(8227)("toStringTag"),i=Object,c="Arguments"===s(function(){return arguments}());e.exports=r?s:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=i(e),a))?n:c?s(t):"Object"===(r=s(t))&&o(t.callee)?"Arguments":r}},6969:(e,t,n)=>{"use strict";var r=n(2777),o=n(757);e.exports=function(e){var t=r(e,"string");return o(t)?t:t+""}},6980:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7015:(e,t,n)=>{"use strict";var r=n(4576),o=n(9504);e.exports=function(e,t){return o(r[e].prototype[t])}},7040:(e,t,n)=>{"use strict";var r=n(4495);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:(e,t,n)=>{"use strict";var r=n(9504),o=n(9039),s=n(2195),a=Object,i=r("".split);e.exports=o(function(){return!a("z").propertyIsEnumerable(0)})?function(e){return"String"===s(e)?i(e,""):a(e)}:a},7080:(e,t,n)=>{"use strict";var r=n(4402).has;e.exports=function(e){return r(e),e}},7347:(e,t,n)=>{"use strict";var r=n(3724),o=n(9565),s=n(8773),a=n(6980),i=n(5397),c=n(6969),l=n(9297),u=n(5917),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=i(e),t=c(t),u)try{return d(e,t)}catch(e){}if(l(e,t))return a(!o(s.f,e,t),e[t])}},7402:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>x,Component:()=>r.Component,Fragment:()=>r.Fragment,PureComponent:()=>h,StrictMode:()=>ie,Suspense:()=>E,SuspenseList:()=>I,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>X,cloneElement:()=>ne,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>Q,createPortal:()=>L,createRef:()=>r.createRef,default:()=>le,findDOMNode:()=>oe,flushSync:()=>ae,forwardRef:()=>g,hydrate:()=>z,isElement:()=>ce,isFragment:()=>ee,isMemo:()=>te,isValidElement:()=>Z,lazy:()=>T,memo:()=>m,render:()=>F,startTransition:()=>u,unmountComponentAtNode:()=>re,unstable_batchedUpdates:()=>se,useDeferredValue:()=>d,useInsertionEffect:()=>f,useSyncExternalStore:()=>c,useTransition:()=>p,version:()=>Y});var r=n(8785),o=n(1162),s={};for(const e in o)["default","Component","Fragment","createContext","createElement","createRef","Children","PureComponent","StrictMode","Suspense","SuspenseList","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","cloneElement","createFactory","createPortal","findDOMNode","flushSync","forwardRef","hydrate","isElement","isFragment","isMemo","isValidElement","lazy","memo","render","startTransition","unmountComponentAtNode","unstable_batchedUpdates","useDeferredValue","useInsertionEffect","useSyncExternalStore","useTransition","version"].indexOf(e)<0&&(s[e]=()=>o[e]);function a(e,t){for(var n in t)e[n]=t[n];return e}function i(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function c(e,t){var n=t(),r=(0,o.useState)({t:{__:n,u:t}}),s=r[0].t,a=r[1];return(0,o.useLayoutEffect)(function(){s.__=n,s.u=t,l(s)&&a({t:s})},[e,n,t]),(0,o.useEffect)(function(){return l(s)&&a({t:s}),e(function(){l(s)&&a({t:s})})},[e]),n}function l(e){var t,n,r=e.u,o=e.__;try{var s=r();return!((t=o)===(n=s)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}function u(e){e()}function d(e){return e}function p(){return[!1,u]}n.d(t,s);var f=o.useLayoutEffect;function h(e,t){this.props=e,this.context=t}function m(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:i(this.props,e)}function o(t){return this.shouldComponentUpdate=n,(0,r.createElement)(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o.type=e,o}(h.prototype=new r.Component).isPureReactComponent=!0,h.prototype.shouldComponentUpdate=function(e,t){return i(this.props,e)||i(this.state,t)};var y=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),y&&y(e)};var v="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function g(e){function t(t){var n=a({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=v,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var b=function(e,t){return null==e?null:(0,r.toChildArray)((0,r.toChildArray)(e).map(t))},x={map:b,forEach:b,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},w=r.options.__e;r.options.__e=function(e,t,n,r){if(e.then)for(var o,s=t;s=s.__;)if((o=s.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);w(e,t,n,r)};var _=r.options.unmount;function C(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=a({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return C(e,t,n)})),e}function S(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return S(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 E(){this.__u=0,this.o=null,this.__b=null}function j(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function T(e){var t,n,o,s=null;function a(a){if(t||(t=e()).then(function(e){e&&(s=e.default||e),o=!0},function(e){n=e,o=!0}),n)throw n;if(!o)throw t;return s?(0,r.createElement)(s,a):null}return a.displayName="Lazy",a.__f=!0,a}function I(){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),_&&_(e)},(E.prototype=new r.Component).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var o=j(r.__v),s=!1,a=function(){s||(s=!0,n.__R=null,o?o(i):i())};n.__R=a;var i=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=S(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(a,a)},E.prototype.componentWillUnmount=function(){this.o=[]},E.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=C(this.__b,n,o.__O=o.__P)}this.__b=null}var s=t.__a&&(0,r.createElement)(r.Fragment,null,e.fallback);return s&&(s.__u&=-33),[(0,r.createElement)(r.Fragment,null,t.__a?null:e.children),s]};var N=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 k(e){return this.getChildContext=function(){return e.context},e.children}function O(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){(0,r.render)(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var o=t.__v;null!==o&&!o.__m&&null!==o.__;)o=o.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return!0},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)(k,{context:t.context},e.__v),t.v)}function L(e,t){var n=(0,r.createElement)(O,{__v:e,h:t});return n.containerInfo=t,n}(I.prototype=new r.Component).__a=function(e){var t=this,n=j(t.__v),r=t.l.get(e);return r[0]++,function(o){var s=function(){t.props.revealOrder?(r.push(o),N(t,e,r)):o()};n?n(s):s()}},I.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},I.prototype.componentDidUpdate=I.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){N(e,n,t)})};var R="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]/,P=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,M=/[A-Z0-9]/g,U="undefined"!=typeof document,D=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function F(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function z(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 B=r.options.event;function V(){}function $(){return this.cancelBubble}function H(){return this.defaultPrevented}r.options.event=function(e){return B&&(e=B(e)),e.persist=V,e.isPropagationStopped=$,e.isDefaultPrevented=H,e.nativeEvent=e};var W,G={enumerable:!1,configurable:!0,get:function(){return this.class}},q=r.options.vnode;r.options.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},s=-1===n.indexOf("-");for(var a in t){var i=t[a];if(!("value"===a&&"defaultValue"in t&&null==i||U&&"children"===a&&"noscript"===n||"class"===a||"className"===a)){var c=a.toLowerCase();"defaultValue"===a&&"value"in t&&null==t.value?a="value":"download"===a&&!0===i?i="":"translate"===c&&"no"===i?i=!1:"o"===c[0]&&"n"===c[1]?"ondoubleclick"===c?a="ondblclick":"onchange"!==c||"input"!==n&&"textarea"!==n||D(t.type)?"onfocus"===c?a="onfocusin":"onblur"===c?a="onfocusout":P.test(a)&&(a=c):c=a="oninput":s&&A.test(a)?a=a.replace(M,"-$&").toLowerCase():null===i&&(i=void 0),"oninput"===c&&o[a=c]&&(a="oninputCapture"),o[a]=i}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,r.toChildArray)(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),"select"==n&&null!=o.defaultValue&&(o.value=(0,r.toChildArray)(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value})),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",G)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=R,q&&q(e)};var K=r.options.__r;r.options.__r=function(e){K&&K(e),W=e.__c};var J=r.options.diffed;r.options.diffed=function(e){J&&J(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),W=null};var X={ReactCurrentDispatcher:{current:{readContext:function(e){return W.__n[e.__c].props.value},useCallback:o.useCallback,useContext:o.useContext,useDebugValue:o.useDebugValue,useDeferredValue:d,useEffect:o.useEffect,useId:o.useId,useImperativeHandle:o.useImperativeHandle,useInsertionEffect:f,useLayoutEffect:o.useLayoutEffect,useMemo:o.useMemo,useReducer:o.useReducer,useRef:o.useRef,useState:o.useState,useSyncExternalStore:c,useTransition:p}}},Y="18.3.1";function Q(e){return r.createElement.bind(null,e)}function Z(e){return!!e&&e.$$typeof===R}function ee(e){return Z(e)&&e.type===r.Fragment}function te(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function ne(e){return Z(e)?r.cloneElement.apply(null,arguments):e}function re(e){return!!e.__k&&((0,r.render)(null,e),!0)}function oe(e){return e&&(e.base||1===e.nodeType&&e)||null}var se=function(e,t){return e(t)},ae=function(e,t){return e(t)},ie=r.Fragment,ce=Z,le={useState:o.useState,useId:o.useId,useReducer:o.useReducer,useEffect:o.useEffect,useLayoutEffect:o.useLayoutEffect,useInsertionEffect:f,useTransition:p,useDeferredValue:d,useSyncExternalStore:c,startTransition:u,useRef:o.useRef,useImperativeHandle:o.useImperativeHandle,useMemo:o.useMemo,useCallback:o.useCallback,useContext:o.useContext,useDebugValue:o.useDebugValue,version:"18.3.1",Children:x,render:F,hydrate:z,unmountComponentAtNode:re,createPortal:L,createElement:r.createElement,createContext:r.createContext,createFactory:Q,cloneElement:ne,createRef:r.createRef,Fragment:r.Fragment,isValidElement:Z,isElement:ce,isFragment:ee,isMemo:te,findDOMNode:oe,Component:r.Component,PureComponent:h,memo:m,forwardRef:g,flushSync:ae,unstable_batchedUpdates:se,StrictMode:ie,Suspense:E,SuspenseList:I,lazy:T,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:X}},7476:(e,t,n)=>{"use strict";var r=n(2195),o=n(9504);e.exports=function(e){if("Function"===r(e))return o(e)}},7550:(e,t,n)=>{"use strict";n(3579)},7561:(e,t,n)=>{"use strict";n(5024)},7566:(e,t,n)=>{"use strict";var r=n(6840),o=n(9504),s=n(655),a=n(2812),i=URLSearchParams,c=i.prototype,l=o(c.getAll),u=o(c.has),d=new i("a=1");!d.has("a",2)&&d.has("a",void 0)||r(c,"has",function(e){var t=arguments.length,n=t<2?void 0:arguments[1];if(t&&void 0===n)return u(this,e);var r=l(this,e);a(t,1);for(var o=s(n),i=0;i<r.length;)if(r[i++]===o)return!0;return!1},{enumerable:!0,unsafe:!0})},7588:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("forEach",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{forEach:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;s(t,function(t){e(t,n++)},{IS_RECORD:!0})}})},7629:(e,t,n)=>{"use strict";var r=n(6395),o=n(4576),s=n(9433),a="__core-js_shared__",i=e.exports=o[a]||s(a,{});(i.versions||(i.versions=[])).push({version:"3.46.0",mode:r?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7642:(e,t,n)=>{"use strict";var r=n(6518),o=n(3440),s=n(9039);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("difference",function(e){return 0===e.size})||s(function(){var e={size:1,has:function(){return!0},keys:function(){var e=0;return{next:function(){var n=e++>1;return t.has(1)&&t.clear(),{done:n,value:2}}}}},t=new Set([1,2,3,4]);return 3!==t.difference(e).size})},{difference:o})},7657:(e,t,n)=>{"use strict";var r,o,s,a=n(9039),i=n(4901),c=n(34),l=n(2360),u=n(2787),d=n(6840),p=n(8227),f=n(6395),h=p("iterator"),m=!1;[].keys&&("next"in(s=[].keys())?(o=u(u(s)))!==Object.prototype&&(r=o):m=!0),!c(r)||a(function(){var e={};return r[h].call(e)!==e})?r={}:f&&(r=l(r)),i(r[h])||d(r,h,function(){return this}),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:m}},7740:(e,t,n)=>{"use strict";var r=n(9297),o=n(5031),s=n(7347),a=n(4913);e.exports=function(e,t,n){for(var i=o(t),c=a.f,l=s.f,u=0;u<i.length;u++){var d=i[u];r(e,d)||n&&r(n,d)||c(e,d,l(t,d))}}},7750:(e,t,n)=>{"use strict";var r=n(4117),o=TypeError;e.exports=function(e){if(r(e))throw new o("Can't call method on "+e);return e}},7751:(e,t,n)=>{"use strict";var r=n(4576),o=n(4901);e.exports=function(e,t){return arguments.length<2?(n=r[e],o(n)?n:void 0):r[e]&&r[e][t];var n}},8004:(e,t,n)=>{"use strict";var r=n(6518),o=n(9039),s=n(8750);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("intersection",function(e){return 2===e.size&&e.has(1)&&e.has(2)})||o(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:s})},8014:(e,t,n)=>{"use strict";var r=n(1291),o=Math.min;e.exports=function(e){var t=r(e);return t>0?o(t,9007199254740991):0}},8107:(e,t,n)=>{"use strict";var r=n(6518),o=n(8981),s=n(6198),a=n(1291),i=n(6469);r({target:"Array",proto:!0},{at:function(e){var t=o(this),n=s(t),r=a(e),i=r>=0?r:n+r;return i<0||i>=n?void 0:t[i]}}),i("at")},8111:(e,t,n)=>{"use strict";var r=n(6518),o=n(4576),s=n(679),a=n(8551),i=n(4901),c=n(2787),l=n(2106),u=n(4659),d=n(9039),p=n(9297),f=n(8227),h=n(7657).IteratorPrototype,m=n(3724),y=n(6395),v="constructor",g="Iterator",b=f("toStringTag"),x=TypeError,w=o[g],_=y||!i(w)||w.prototype!==h||!d(function(){w({})}),C=function(){if(s(this,h),c(this)===h)throw new x("Abstract class Iterator not directly constructable")},S=function(e,t){m?l(h,e,{configurable:!0,get:function(){return t},set:function(t){if(a(this),this===h)throw new x("You can't redefine this property");p(this,e)?this[e]=t:u(this,e,t)}}):h[e]=t};p(h,b)||S(b,g),!_&&p(h,v)&&h[v]!==Object||S(v,C),C.prototype=h,r({global:!0,constructor:!0,forced:_},{Iterator:C})},8227:(e,t,n)=>{"use strict";var r=n(4576),o=n(5745),s=n(9297),a=n(3392),i=n(4495),c=n(7040),l=r.Symbol,u=o("wks"),d=c?l.for||l:l&&l.withoutSetter||a;e.exports=function(e){return s(u,e)||(u[e]=i&&s(l,e)?l[e]:d("Symbol."+e)),u[e]}},8237:(e,t,n)=>{"use strict";var r=n(6518),o=n(2652),s=n(9306),a=n(8551),i=n(1767),c=n(9539),l=n(4549),u=n(8745),d=n(9039),p=TypeError,f=d(function(){[].keys().reduce(function(){},void 0)}),h=!f&&l("reduce",p);r({target:"Iterator",proto:!0,real:!0,forced:f||h},{reduce:function(e){a(this);try{s(e)}catch(e){c(this,"throw",e)}var t=arguments.length<2,n=t?void 0:arguments[1];if(h)return u(h,this,t?[e]:[e,n]);var r=i(this),l=0;if(o(r,function(r){t?(t=!1,n=r):n=e(n,r,l),l++},{IS_RECORD:!0}),t)throw new p("Reduce of empty iterator with no initial value");return n}})},8418:(e,t,n)=>{"use strict";e.exports=n(5160)},8469:(e,t,n)=>{"use strict";var r=n(9504),o=n(507),s=n(4402),a=s.Set,i=s.proto,c=r(i.forEach),l=r(i.keys),u=l(new a).next;e.exports=function(e,t,n){return n?o({iterator:l(e),next:u},t):c(e,t)}},8480:(e,t,n)=>{"use strict";var r=n(1828),o=n(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},8527:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402).has,s=n(5170),a=n(3789),i=n(507),c=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(s(t)<n.size)return!1;var l=n.getIterator();return!1!==i(l,function(e){if(!o(t,e))return c(l,"normal",!1)})}},8551:(e,t,n)=>{"use strict";var r=n(34),o=String,s=TypeError;e.exports=function(e){if(r(e))return e;throw new s(o(e)+" is not an object")}},8622:(e,t,n)=>{"use strict";var r=n(4576),o=n(4901),s=r.WeakMap;e.exports=o(s)&&/native code/.test(String(s))},8686:(e,t,n)=>{"use strict";var r=n(3724),o=n(9039);e.exports=r&&o(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},8721:(e,t,n)=>{"use strict";var r=n(3724),o=n(9504),s=n(2106),a=URLSearchParams.prototype,i=o(a.forEach);r&&!("size"in a)&&s(a,"size",{get:function(){var e=0;return i(this,function(){e++}),e},configurable:!0,enumerable:!0})},8727:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8745:(e,t,n)=>{"use strict";var r=n(616),o=Function.prototype,s=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(s):function(){return a.apply(s,arguments)})},8750:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402),s=n(5170),a=n(3789),i=n(8469),c=n(507),l=o.Set,u=o.add,d=o.has;e.exports=function(e){var t=r(this),n=a(e),o=new l;return s(t)>n.size?c(n.getIterator(),function(e){d(t,e)&&u(o,e)}):i(t,function(e){n.includes(e)&&u(o,e)}),o}},8773:(e,t)=>{"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},8785:e=>{"use strict";e.exports=require("preact")},8872:(e,t,n)=>{"use strict";n(8237)},8981:(e,t,n)=>{"use strict";var r=n(7750),o=Object;e.exports=function(e){return o(r(e))}},8992:(e,t,n)=>{"use strict";n(8111)},9039:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},9209:(e,t,n)=>{"use strict";n(5876)},9225:(e,t,n)=>{"use strict";n(8004)},9286:(e,t,n)=>{"use strict";var r=n(4402),o=n(8469),s=r.Set,a=r.add;e.exports=function(e){var t=new s;return o(e,function(e){a(t,e)}),t}},9297:(e,t,n)=>{"use strict";var r=n(9504),o=n(8981),s=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return s(o(e),t)}},9306:(e,t,n)=>{"use strict";var r=n(4901),o=n(6823),s=TypeError;e.exports=function(e){if(r(e))return e;throw new s(o(e)+" is not a function")}},9433:(e,t,n)=>{"use strict";var r=n(4576),o=Object.defineProperty;e.exports=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},9462:(e,t,n)=>{"use strict";var r=n(9565),o=n(2360),s=n(6699),a=n(6279),i=n(8227),c=n(1181),l=n(5966),u=n(7657).IteratorPrototype,d=n(2529),p=n(9539),f=n(1385),h=i("toStringTag"),m="IteratorHelper",y="WrapForValidIterator",v="normal",g="throw",b=c.set,x=function(e){var t=c.getterFor(e?y:m);return a(o(u),{next:function(){var n=t(this);if(e)return n.nextHandler();if(n.done)return d(void 0,!0);try{var r=n.nextHandler();return n.returnHandlerResult?r:d(r,n.done)}catch(e){throw n.done=!0,e}},return:function(){var n=t(this),o=n.iterator;if(n.done=!0,e){var s=l(o,"return");return s?r(s,o):d(void 0,!0)}if(n.inner)try{p(n.inner.iterator,v)}catch(e){return p(o,g,e)}if(n.openIters)try{f(n.openIters,v)}catch(e){return p(o,g,e)}return o&&p(o,v),d(void 0,!0)}})},w=x(!0),_=x(!1);s(_,h,"Iterator Helper"),e.exports=function(e,t,n){var r=function(r,o){o?(o.iterator=r.iterator,o.next=r.next):o=r,o.type=t?y:m,o.returnHandlerResult=!!n,o.nextHandler=e,o.counter=0,o.done=!1,b(this,o)};return r.prototype=t?w:_,r}},9497:(e,t,n)=>{"use strict";n(8107);var r=n(7015);e.exports=r("Array","at")},9504:(e,t,n)=>{"use strict";var r=n(616),o=Function.prototype,s=o.call,a=r&&o.bind.bind(s,s);e.exports=r?a:function(e){return function(){return s.apply(e,arguments)}}},9519:(e,t,n)=>{"use strict";var r,o,s=n(4576),a=n(2839),i=s.process,c=s.Deno,l=i&&i.versions||c&&c.version,u=l&&l.v8;u&&(o=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},9539:(e,t,n)=>{"use strict";var r=n(9565),o=n(8551),s=n(5966);e.exports=function(e,t,n){var a,i;o(e);try{if(!(a=s(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){i=!0,a=e}if("throw"===t)throw n;if(i)throw a;return o(a),n}},9565:(e,t,n)=>{"use strict";var r=n(616),o=Function.prototype.call;e.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},9617:(e,t,n)=>{"use strict";var r=n(5397),o=n(5610),s=n(6198),a=function(e){return function(t,n,a){var i=r(t),c=s(i);if(0===c)return!e&&-1;var l,u=o(a,c);if(e&&n!=n){for(;c>u;)if((l=i[u++])!=l)return!0}else for(;c>u;u++)if((e||u in i)&&i[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},9835:e=>{"use strict";e.exports=function(e){try{var t=new Set,n={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return t.clear(),t.add(4),function(){return{done:!0}}}})}},r=t[e](n);return 1===r.size&&4===r.values().next().value}catch(e){return!1}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.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 o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})();var r={};(()=>{"use strict";n.r(r),n.d(r,{API:()=>H,AgentInfo:()=>Il,Chat:()=>pc,ChatFrame:()=>sl,ComponentFilter:()=>vi,Conversation:()=>nc,Engine:()=>bl,EntryContainer:()=>nl,EventParticipant:()=>aa,ExternalApi:()=>_l,Header:()=>Nl,Icon:()=>da,Interrupt:()=>ol,MessageContainer:()=>ia,SeamlyActivityEventContext:()=>ea,SeamlyActivityMonitor:()=>gi,SeamlyApiContext:()=>gs,SeamlyEventBusContext:()=>bs,SeamlyFileUpload:()=>wi,SeamlyGeneralError:()=>v,SeamlyLiveRegionContext:()=>Es,SeamlyOfflineError:()=>pr,SeamlyStoreProvider:()=>cn,Text:()=>pi,TextEntry:()=>Kc,Upload:()=>el,View:()=>vl,appReducer:()=>dr,appStorageProvider:()=>Sl,calculateVisibility:()=>Xt,className:()=>Ws,configReducer:()=>ir,cookieStorageProvider:()=>Tl,default:()=>Pl,eventTypes:()=>w,formsReducer:()=>Er,getSearchParamsByKeys:()=>Ll,getUrlSearchParams:()=>kl,getUrlSearchString:()=>Ol,i18nReducer:()=>Or,initResetSearchParams:()=>Al,interruptReducer:()=>Ur,randomId:()=>z,replaceSearchParams:()=>Rl,sessionStorageProvider:()=>x,setConfig:()=>or,setInitialLocale:()=>Nr,setParticipant:()=>vo,setPreChatEvents:()=>ar,setTranslations:()=>kr,stateReducer:()=>Ro,timeout:()=>Ps,translationReducer:()=>Ho,useChoicePrompt:()=>xa,useEvents:()=>An,useGeneratedId:()=>oa,useI18n:()=>hs,useSeamlyActions:()=>Cl,useSeamlyChat:()=>ks,useSeamlyCommands:()=>Ss,useSeamlyConfig:()=>gn,useSeamlyEventStream:()=>sa,useSeamlyIdleDetachCountdown:()=>na,useSeamlyMessageContainerClassNames:()=>qs,useSeamlyOptions:()=>Qs,useSeamlyVisibility:()=>ms,useTranslatedEventData:()=>Vs,useTranslations:()=>Bs,useTranslationsContainer:()=>$s,visibilityReducer:()=>qo,visibilityStates:()=>Kt}),n(9497),n(4114),n(8992),n(4520),n(3949),n(1454),n(7550),n(4603),n(7566),n(8721),n(3375),n(9225),n(3972),n(9209),n(5714),n(7561),n(6197),n(8872);var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return a}var s=function(e,t){this.target=t,this.type=e},a=function(e){function n(t,n){var r=e.call(this,"error",n)||this;return r.message=t.message,r.error=t,r}return t(n,e),n}(s),i=function(e){function n(t,n,r){void 0===t&&(t=1e3),void 0===n&&(n="");var o=e.call(this,"close",r)||this;return o.wasClean=!0,o.code=t,o.reason=n,o}return t(n,e),n}(s),c=function(){if("undefined"!=typeof WebSocket)return WebSocket},l={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},u=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?l.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?l.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 o=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),s=o.next();!s.done;s=o.next()){var a=s.value;this._callEventListener(e,a)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}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(o(arguments[t]));return e}(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,n=void 0===t?l.reconnectionDelayGrowFactor:t,r=e.minReconnectionDelay,o=void 0===r?l.minReconnectionDelay:r,s=e.maxReconnectionDelay,a=void 0===s?l.maxReconnectionDelay:s,i=0;return this._retryCount>0&&(i=o*Math.pow(n,this._retryCount-1))>a&&(i=a),this._debug("next delay",i),i},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?l.maxRetries:n,o=t.connectionTimeout,s=void 0===o?l.connectionTimeout:o,a=t.WebSocket,i=void 0===a?c():a;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===(u=i)||!u||2!==u.CLOSING)throw Error("No valid WebSocket class provided");var u;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 i(t,e._protocols):new i(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout(function(){return e._handleTimeout()},s))})}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new a(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 i(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 d=u,p=new Set;class f{#e=[];#t=null;#n=null;#r=e=>{const t=JSON.parse(e.data);this.#t&&clearInterval(this.#t),this.#t=setInterval(()=>{this.socket?.readyState===d.OPEN&&this.socket?.send(JSON.stringify({type:"ping"}))},3e4);try{if("attach_channel_response"===t.type){if(!t.payload.success)return void this.#o({connected:!0,ready:!1,currentState:"attach_channel_erred"});this.#o({connected:!0,ready:!0,currentState:"attach_channel_response"})}}catch(e){console.warn(e)}};#s=()=>{this.#o({connected:!1,ready:!1,currentState:"socket_closed"})};#a=()=>{this.#o({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:o}=(e=>{const t=e.indexOf("?");return t<0?{url:e,params:{}}:{url:e.slice(0,t),params:e.slice(t+1).split("&").reduce((e,t)=>{const[n,r]=t.split("=");return{...e,[n]:decodeURIComponent(r)}},{})}})(this.url);this.socket=new d(o,[],{maxReconnectionDelay:1e4,minReconnectionDelay:500,reconnectionDelayGrowFactor:2});const s={type:"attach_channel",payload:{accessToken:this.accessToken,channelName:this.channelName}};this.#n=()=>{this.socket?.send(JSON.stringify(s)),this.#o({connected:!0,ready:!1,currentState:"socket_connected"})},this.socket?.addEventListener("open",this.#n),this.socket?.addEventListener("message",this.#r),this.socket?.addEventListener("close",this.#s),this.socket?.addEventListener("error",this.#a)}disconnect(){this.socket?.close(),this.#n&&this.socket?.removeEventListener("open",this.#n),this.socket?.removeEventListener("message",this.#r),this.socket?.removeEventListener("close",this.#s),this.socket?.removeEventListener("error",this.#a),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)}#o(e){this.#e=this.#e.filter(t=>!t(e)),p.forEach(e=>e())}pushToChannel(e,t){this.socket?.send(JSON.stringify({type:e,payload:t}))}static subscribe(e){return p.add(e),()=>p.delete(e)}}class h extends Error{constructor(e,t){super(e,{cause:t?.cause}),this.status=t?.status}}class m 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 y extends m{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class v extends m{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class g extends m{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class b extends m{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}function x(e){const t=`cvco.${e}`;return{get(){const e=[t,t.split(".").slice(0,-1).join(".")];let n;do{n=sessionStorage.getItem(e[0])}while(e.shift()&&!n);return n?JSON.parse(n):{}},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}const w={info:"info",message:"message",participant:"participant",system:"system"},_="text",C="text",S="upload",E="received",j="read",T="custom",I="detach_service",N="dismiss",k="set_topic",O="click_card",L="translation_proposal",R=L,A="window_api",P="assertive",M="polite",U={new_topic:"newTopic",new_translation:"newTranslation"},D="uploads",F="navigate";function z(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}const B=async(e,t)=>{const n=new URL(e),r=await fetch(n.href,{mode:"cors",...t});if(!r.ok)throw new h(r.statusText||`Request failed with status: ${r.status}`,{status:r.status});return r};function V(){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 $=()=>null;class H{#i;#c;#l;#u="window";#d;#p="new";URLS={};locale="";conversation=new f;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||x),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.#i=!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/v3/client/${this.connectionInfo.apiKey}/translations/{version}/{locale}.json`,templated:!0},config:{href:`/channels/api/v3/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 y;const t=`${this.#h("http")}${this.URLS.translations.href}`.replace("{version}",String(4)).replace("{locale}",this.getLocale(e)),n=await B(t,{method:"GET"});return(await n.json()).translations}catch(e){if(e.status>=500)throw new v(e);throw new h(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 o=this.#d.context?.userLocale;return{...o?{userLocale:o}:{},...e}}async downloadFile(e,t){try{const n=await B(`${this.#h("http")}${this.URLS.uploads.href}/${e}`,{method:"GET",headers:{Authorization:`Bearer ${this.getAccessToken()}`}}),r=document.createElement("a"),o=URL.createObjectURL(await n.blob());r.href=o,void 0!==r.download&&(r.download=t),r.click(),setTimeout(()=>{URL.revokeObjectURL(o)},6e4)}catch(e){}}uploadFile(e,t,n,r){const o=new FormData;o.append("upload",e);const s=new XMLHttpRequest;return s.open("POST",`${this.#h("http")}${this.URLS.uploads.href}`),s.setRequestHeader("Authorization",`Bearer ${this.getAccessToken()}`),s.upload.onprogress=e=>{if("function"==typeof t){const n=Math.ceil(e.loaded/e.total*100);t(n)}},s.onloadend=()=>{if(0!==s.status)if(200!==s.status&&201!==s.status||!n){if(!r)throw new Error(s.response);try{r(JSON.parse(s.response))}catch(e){r(s.response)}}else try{n(JSON.parse(s.response))}catch(e){n(s.response)}},s.send(o),s}async createConversation(){try{"function"==typeof this.#d?.getConversationAuthToken&&(this.#l=await this.#d.getConversationAuthToken());const e=await B(`${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 v(e);if(400===e.status)throw new b(e);if(404===e.status)throw new y(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 B(`${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 y(e);if(e.status>=500)throw new v(e);throw e}}async fetchConversation(){if(!this.hasConversation())return null;try{const e=await B(`${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 b(e);if(404===e.status)throw new g(e);if(e.status>=500)throw new v(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.#i=t}),this.send("context",this.#y())),e}send(e,t=void 0){this.connected&&this.#i?($("[SEND]",e,t),this.conversation.pushToChannel(e,function(e,t){if("message"!==e)return t;const{type:n,body:r}=t;let{transactionId:o}=t;return o||(o=z()),{type:n,body:r,transactionId:o}}(e,t))):this.conversation?.onConnection(({connected:n,ready:r})=>(this.connected=n,this.#i=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=A)}getEnvironment(){return{clientName:"@seamly/web-ui",clientVariant:this.#u,clientVersion:"25.3.0",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:V(),userAgent:navigator.userAgent,preferredLocale:navigator.language}}}var W=Symbol.for("immer-nothing"),G=Symbol.for("immer-draftable"),q=Symbol.for("immer-state");function K(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var J=Object,X=J.getPrototypeOf,Y="constructor",Q="prototype",Z="configurable",ee="enumerable",te="writable",ne="value",re=e=>!!e&&!!e[q];function oe(e){return!!e&&(ie(e)||fe(e)||!!e[G]||!!e[Y]?.[G]||he(e)||me(e))}var se=J[Q][Y].toString(),ae=new WeakMap;function ie(e){if(!e||!ye(e))return!1;const t=X(e);if(null===t||t===J[Q])return!0;const n=J.hasOwnProperty.call(t,Y)&&t[Y];if(n===Object)return!0;if(!ve(n))return!1;let r=ae.get(n);return void 0===r&&(r=Function.toString.call(n),ae.set(n,r)),r===se}function ce(e,t,n=!0){0===le(e)?(n?Reflect.ownKeys(e):J.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function le(e){const t=e[q];return t?t.type_:fe(e)?1:he(e)?2:me(e)?3:0}var ue=(e,t,n=le(e))=>2===n?e.has(t):J[Q].hasOwnProperty.call(e,t),de=(e,t,n=le(e))=>2===n?e.get(t):e[t],pe=(e,t,n,r=le(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n},fe=Array.isArray,he=e=>e instanceof Map,me=e=>e instanceof Set,ye=e=>"object"==typeof e,ve=e=>"function"==typeof e,ge=e=>"boolean"==typeof e,be=e=>e.copy_||e.base_,xe=e=>e.modified_?e.copy_:e.base_;function we(e,t){if(he(e))return new Map(e);if(me(e))return new Set(e);if(fe(e))return Array[Q].slice.call(e);const n=ie(e);if(!0===t||"class_only"===t&&!n){const t=J.getOwnPropertyDescriptors(e);delete t[q];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],s=t[o];!1===s[te]&&(s[te]=!0,s[Z]=!0),(s.get||s.set)&&(t[o]={[Z]:!0,[te]:!0,[ee]:s[ee],[ne]:e[o]})}return J.create(X(e),t)}{const t=X(e);if(null!==t&&n)return{...e};const r=J.create(t);return J.assign(r,e)}}function _e(e,t=!1){return Se(e)||re(e)||!oe(e)||(le(e)>1&&J.defineProperties(e,{set:Ce,add:Ce,clear:Ce,delete:Ce}),J.freeze(e),t&&ce(e,(e,t)=>{_e(t,!0)},!1)),e}var Ce={[ne]:function(){K(2)}};function Se(e){return null===e||!ye(e)||J.isFrozen(e)}var Ee,je="MapSet",Te="Patches",Ie={};function Ne(e){const t=Ie[e];return t||K(0),t}var ke=()=>Ee;function Oe(e,t){t&&(e.patchPlugin_=Ne(Te),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Le(e){Re(e),e.drafts_.forEach(Pe),e.drafts_=null}function Re(e){e===Ee&&(Ee=e.parent_)}var Ae=e=>{return Ee={drafts_:[],parent_:Ee,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:(t=je,Ie[t]?Ne(je):void 0)};var t};function Pe(e){const t=e[q];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Me(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[q].modified_&&(Le(t),K(4)),oe(e)&&(e=Ue(t,e));const{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[q].base_,e,t)}else e=Ue(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&_e(t,n)}(t,e,!0),Le(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==W?e:void 0}function Ue(e,t){if(Se(t))return t;const n=t[q];if(!n)return $e(t,e.handledSet_,e);if(!Fe(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);Ve(n,e)}return n.copy_}function De(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Fe=(e,t)=>e.scope_===t,ze=[];function Be(e,t,n,r){const o=be(e),s=e.type_;if(void 0!==r&&de(o,r,s)===t)return void pe(o,r,n,s);if(!e.draftLocations_){const t=e.draftLocations_=new Map;ce(o,(e,n)=>{if(re(n)){const r=t.get(n)||[];r.push(e),t.set(n,r)}})}const a=e.draftLocations_.get(t)??ze;for(const e of a)pe(o,e,n,s)}function Ve(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const r=n.getPath(e);r&&n.generatePatches_(e,r,t)}De(e)}}function $e(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||re(e)||t.has(e)||!oe(e)||Se(e)||(t.add(e),ce(e,(r,o)=>{if(re(o)){const t=o[q];if(Fe(t,n)){const n=xe(t);pe(e,r,n,e.type_),De(t)}}else oe(o)&&$e(o,t,n)})),e}var He={get(e,t){if(t===q)return e;const n=be(e);if(!ue(n,t,e.type_))return function(e,t,n){const r=qe(t,n);return r?ne in r?r[ne]:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];if(e.finalized_||!oe(r))return r;if(r===Ge(e.base_,t)){Je(e);const n=1===e.type_?+t:t,o=Xe(e.scope_,r,e,n);return e.copy_[n]=o}return r},has:(e,t)=>t in be(e),ownKeys:e=>Reflect.ownKeys(be(e)),set(e,t,n){const r=qe(be(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Ge(be(e),t),a=r?.[q];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(((o=n)===(s=r)?0!==o||1/o==1/s:o!=o&&s!=s)&&(void 0!==n||ue(e.base_,t,e.type_)))return!0;Je(e),Ke(e)}var o,s;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_.set(t,!0),function(e,t,n){const{scope_:r}=e;if(re(n)){const o=n[q];Fe(o,r)&&o.callbacks_.push(function(){Je(e);const r=xe(o);Be(e,n,r,t)})}else oe(n)&&e.callbacks_.push(function(){const o=be(e);de(o,t,e.type_)===n&&r.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&$e(de(e.copy_,t,e.type_),r.handledSet_,r)})}(e,t,n)),!0},deleteProperty:(e,t)=>(Je(e),void 0!==Ge(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),Ke(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=be(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[te]:!0,[Z]:1!==e.type_||"length"!==t,[ee]:r[ee],[ne]:n[t]}:r},defineProperty(){K(11)},getPrototypeOf:e=>X(e.base_),setPrototypeOf(){K(12)}},We={};function Ge(e,t){const n=e[q];return(n?be(n):e)[t]}function qe(e,t){if(!(t in e))return;let n=X(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=X(n)}}function Ke(e){e.modified_||(e.modified_=!0,e.parent_&&Ke(e.parent_))}function Je(e){e.copy_||(e.assigned_=new Map,e.copy_=we(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function Xe(e,t,n,r){const[o,s]=he(t)?Ne(je).proxyMap_(t,n):me(t)?Ne(je).proxySet_(t,n):function(e,t){const n=fe(e),r={type_:n?1:0,scope_:t?t.scope_:ke(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let o=r,s=He;n&&(o=[r],s=We);const{revoke:a,proxy:i}=Proxy.revocable(o,s);return r.draft_=i,r.revoke_=a,[i,r]}(t,n);return(n?.scope_??ke()).drafts_.push(o),s.callbacks_=n?.callbacks_??[],s.key_=r,n&&void 0!==r?function(e,t,n){e.callbacks_.push(function(r){const o=t;if(!o||!Fe(o,r))return;r.mapSetPlugin_?.fixSetContents(o);const s=xe(o);Be(e,o.draft_??o,s,n),Ve(o,r)})}(n,s,r):s.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(s);const{patchPlugin_:t}=e;s.modified_&&t&&t.generatePatches_(s,[],e)}),o}function Ye(e){if(!oe(e)||Se(e))return e;const t=e[q];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=we(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=we(e,!0);return ce(n,(e,t)=>{pe(n,e,Ye(t))},r),t&&(t.finalized_=!1),n}ce(He,(e,t)=>{We[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}),We.deleteProperty=function(e,t){return We.set.call(this,e,t,void 0)},We.set=function(e,t,n){return He.set.call(this,e[0],t,n,e[0])};var Qe=(new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(ve(e)&&!ve(t)){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,e=>t.call(this,e,...o))}}let r;if(ve(t)||K(6),void 0===n||ve(n)||K(7),oe(e)){const o=Ae(this),s=Xe(0,e,void 0);let a=!0;try{r=t(s),a=!1}finally{a?Le(o):Re(o)}return Oe(o,n),Me(r,o)}if(!e||!ye(e)){if(r=t(e),void 0===r&&(r=e),r===W&&(r=void 0),this.autoFreeze_&&_e(r,!0),n){const t=[],o=[];Ne(Te).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:o}),n(t,o)}return r}K(1)},this.produceWithPatches=(e,t)=>{if(ve(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]},ge(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),ge(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),ge(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){var t;oe(e)||K(8),re(e)&&(re(t=e)||K(10),e=Ye(t));const n=Ae(this),r=Xe(0,e,void 0);return r[q].isManual_=!0,Re(n),r}finishDraft(e,t){const n=e&&e[q];n&&n.isManual_||K(9);const{scope_:r}=n;return Oe(r,t),Me(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}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(Te).applyPatches_;return re(e)?r(e,t):this.produce(e,e=>r(e,t))}}).produce;function Ze(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 et=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),tt=()=>Math.random().toString(36).substring(7).split("").join("."),nt={INIT:`@@redux/INIT${tt()}`,REPLACE:`@@redux/REPLACE${tt()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${tt()}`};function rt(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 ot(e,t,n){if("function"!=typeof e)throw new Error(Ze(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Ze(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Ze(1));return n(ot)(e,t)}let r=e,o=t,s=new Map,a=s,i=0,c=!1;function l(){a===s&&(a=new Map,s.forEach((e,t)=>{a.set(t,e)}))}function u(){if(c)throw new Error(Ze(3));return o}function d(e){if("function"!=typeof e)throw new Error(Ze(4));if(c)throw new Error(Ze(5));let t=!0;l();const n=i++;return a.set(n,e),function(){if(t){if(c)throw new Error(Ze(6));t=!1,l(),a.delete(n),s=null}}}function p(e){if(!rt(e))throw new Error(Ze(7));if(void 0===e.type)throw new Error(Ze(8));if("string"!=typeof e.type)throw new Error(Ze(17));if(c)throw new Error(Ze(9));try{c=!0,o=r(o,e)}finally{c=!1}return(s=a).forEach(e=>{e()}),e}return p({type:nt.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(Ze(10));r=e,p({type:nt.REPLACE})},[et]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(Ze(11));function n(){const e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[et](){return this}}}}}function st(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o;try{!function(e){Object.keys(e).forEach(t=>{const n=e[t];if(void 0===n(void 0,{type:nt.INIT}))throw new Error(Ze(12));if(void 0===n(void 0,{type:nt.PROBE_UNKNOWN_ACTION()}))throw new Error(Ze(13))})}(n)}catch(e){o=e}return function(e={},t){if(o)throw o;let s=!1;const a={};for(let o=0;o<r.length;o++){const i=r[o],c=n[i],l=e[i],u=c(l,t);if(void 0===u)throw t&&t.type,new Error(Ze(14));a[i]=u,s=s||u!==l}return s=s||r.length!==Object.keys(e).length,s?a:e}}function at(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function it(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var ct=it(),lt=it,ut="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?at:at.apply(null,arguments)},dt=("undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function pt(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(Pt(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 rt(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var ft=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 ht(e){return oe(e)?Qe(e,()=>{}):e}function mt(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var yt=e=>t=>{setTimeout(t,e)};function vt(e){const t=function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let s=new ft;return t&&("boolean"==typeof t?s.push(ct):s.push(lt(t.extraArgument))),s},{reducer:n,middleware:r,devTools:o=!0,duplicateMiddlewareCheck:s=!0,preloadedState:a,enhancers:i}=e||{};let c,l;if("function"==typeof n)c=n;else{if(!rt(n))throw new Error(Pt(1));c=st(n)}l="function"==typeof r?r(t):t();let u=at;o&&(u=ut({trace:!1,..."object"==typeof o&&o}));const d=function(...e){return t=>(n,r)=>{const o=t(n,r);let s=()=>{throw new Error(Ze(15))};const a={getState:o.getState,dispatch:(e,...t)=>s(e,...t)},i=e.map(e=>e(a));return s=at(...i)(o.dispatch),{...o,dispatch:s}}}(...l),p=(e=>function(t){const{autoBatch:n=!0}=t??{};let r=new ft(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,s=!1,a=!1;const i=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:yt(10):"callback"===e.type?e.queueNotification:yt(e.timeout),l=()=>{a=!1,s&&(s=!1,i.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){const t=r.subscribe(()=>o&&e());return i.add(e),()=>{t(),i.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,s=!o,s&&(a||(a=!0,c(l))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r})(d);return ot(c,a,u(..."function"==typeof i?i(p):p()))}function gt(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(Pt(28));if(r in t)throw new Error(Pt(29));return t[r]=n,o},addAsyncThunk:(e,r)=>(r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),o),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),o),addDefaultCase:e=>(r=e,o)};return e(o),[t,n,r]}function bt(...e){return t=>e.some(e=>((e,t)=>dt(e)?e.match(t):e(t))(e,t))}var xt=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},wt=["name","message","stack","code"],_t=class{constructor(e,t){this.payload=e,this.meta=t}_type},Ct=class{constructor(e,t){this.payload=e,this.meta=t}_type},St=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of wt)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},Et="External signal was aborted",jt=(()=>{function e(e,t,n){const r=pt(e+"/fulfilled",(e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}})),o=pt(e+"/pending",(e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}})),s=pt(e+"/rejected",(e,t,r,o,s)=>({payload:o,error:(n&&n.serializeError||St)(e||"Rejected"),meta:{...s||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}}));return Object.assign(function(e,{signal:a}={}){return(i,c,l)=>{const u=n?.idGenerator?n.idGenerator(e):xt(),d=new AbortController;let p,f;function h(e){f=e,d.abort()}a&&(a.aborted?h(Et):a.addEventListener("abort",()=>h(Et),{once:!0}));const m=async function(){let a;try{let s=n?.condition?.(e,{getState:c,extra:l});if(null!==(m=s)&&"object"==typeof m&&"function"==typeof m.then&&(s=await s),!1===s||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const y=new Promise((e,t)=>{p=()=>{t({name:"AbortError",message:f||"Aborted"})},d.signal.addEventListener("abort",p)});i(o(u,e,n?.getPendingMeta?.({requestId:u,arg:e},{getState:c,extra:l}))),a=await Promise.race([y,Promise.resolve(t(e,{dispatch:i,getState:c,extra:l,requestId:u,signal:d.signal,abort:h,rejectWithValue:(e,t)=>new _t(e,t),fulfillWithValue:(e,t)=>new Ct(e,t)})).then(t=>{if(t instanceof _t)throw t;return t instanceof Ct?r(t.payload,u,e,t.meta):r(t,u,e)})])}catch(t){a=t instanceof _t?s(null,u,e,t.payload,t.meta):s(t,u,e)}finally{p&&d.signal.removeEventListener("abort",p)}var m;return n&&!n.dispatchConditionRejection&&s.match(a)&&a.meta.condition||i(a),a}();return Object.assign(m,{abort:h,requestId:u,arg:e,unwrap:()=>m.then(Tt)})}},{pending:o,rejected:s,fulfilled:r,settled:bt(s,r),typePrefix:e})}return e.withTypes=()=>e,e})();function Tt(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var It=Symbol.for("rtk-slice-createasyncthunk");function Nt(e,t){return`${e}/${t}`}function kt({creators:e}={}){const t=e?.asyncThunk?.[It];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(Pt(11));const o=("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)||{},s=Object.keys(o),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},i={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(Pt(12));if(n in a.sliceCaseReducersByType)throw new Error(Pt(13));return a.sliceCaseReducersByType[n]=t,i},addMatcher:(e,t)=>(a.sliceMatchers.push({matcher:e,reducer:t}),i),exposeAction:(e,t)=>(a.actionCreators[e]=t,i),exposeCaseReducer:(e,t)=>(a.sliceCaseReducersByName[e]=t,i)};function c(){const[t={},n=[],r]="function"==typeof e.extraReducers?gt(e.extraReducers):[e.extraReducers],o={...t,...a.sliceCaseReducersByType};return function(e){let t,[s,i,c]=gt(e=>{for(let t in o)e.addCase(t,o[t]);for(let t of a.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=()=>ht(e());else{const n=ht(e);t=()=>n}function l(e=t(),n){let r=[s[n.type],...i.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(re(e)){const r=t(e,n);return void 0===r?e:r}if(oe(e))return Qe(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)}s.forEach(r=>{const s=o[r],a={reducerName:r,type:Nt(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(s)?function({type:e,reducerName:t,createNotation:n},r,o){let s,a;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(Pt(17));s=r.reducer,a=r.prepare}else s=r;o.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,a?pt(e,a):pt(e))}(a,s,i):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error(Pt(18));const{payloadCreator:s,fulfilled:a,pending:i,rejected:c,settled:l,options:u}=n,d=o(e,s,u);r.exposeAction(t,d),a&&r.addCase(d.fulfilled,a),i&&r.addCase(d.pending,i),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:a||Rt,pending:i||Rt,rejected:c||Rt,settled:l||Rt})}(a,s,i,t)});const l=e=>e,u=new Map,d=new WeakMap;let p;function f(e,t){return p||(p=c()),p(e,t)}function h(){return p||(p=c()),p.getInitialState()}function m(t,n=!1){function r(e){let o=e[t];return void 0===o&&n&&(o=mt(d,r,h)),o}function o(t=l){const r=mt(u,n,()=>new WeakMap);return mt(r,t,()=>{const r={};for(const[o,s]of Object.entries(e.selectors??{}))r[o]=Ot(s,t,()=>mt(d,t,h),n);return r})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const y={name:n,reducer:f,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:h,...m(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:f},n),{...y,...m(o,!0)}}};return y}}function Ot(e,t,n,r){function o(o,...s){let a=t(o);return void 0===a&&r&&(a=n()),e(a,...s)}return o.unwrapped=e,o}var Lt=kt();function Rt(){}var{assign:At}=Object;function Pt(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 Mt extends m{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}const Ut=jt("initializeConfig",async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{try{const{features:e,preChat:r,agentParticipant:o,defaultContentLocale:s,defaultUserLocale:a,userParticipant:i,startChatIcon:c}=await t.getConfig(),{connectWhenInView:l}=n;return{features:e,preChat:r,agentParticipant:o,userParticipant:i,startChatIcon:c,defaultUserLocale:n?.context?.userLocale||a,defaultContentLocale:n?.context?.contentLocale||s,connectWhenInView:l}}catch(e){return r(e)}}),Dt=jt("resetConfig",async(e,{extra:{config:t}})=>t);var Ft=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var zt="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function Bt(){return{s:0,v:void 0,o:null,p:null}}function Vt(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let o,s=0;function a(){let t=n;const{length:a}=arguments;for(let e=0,n=a;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=Bt(),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=Bt(),e.set(n,t)):t=r}}const i=t;let c;if(1===t.s)c=t.v;else if(c=e.apply(null,arguments),s++,r){const e=o?.deref?.()??o;null!=e&&r(e,c)&&(c=e,0!==s&&s--),o="object"==typeof c&&null!==c||"function"==typeof c?new zt(c):c}return i.s=1,i.v=c,c}return a.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},a.resetResultsCount()},a.resultsCount=()=>s,a.resetResultsCount=()=>{s=0},a}function $t(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,s={},a=e.pop();"object"==typeof a&&(s=a,a=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const i={...n,...s},{memoize:c,memoizeOptions:l=[],argsMemoize:u=Vt,argsMemoizeOptions:d=[],devModeChecks:p={}}=i,f=Ft(l),h=Ft(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++,a.apply(null,arguments)},...f),v=u(function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}(m,arguments);return t=y.apply(null,e),t},...h);return Object.assign(v,{resultFunc:a,memoizedResultFunc:y,dependencies:m,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:c,argsMemoize:u})};return Object.assign(r,{withTypes:()=>r}),r}var Ht=$t(Vt),Wt=Object.assign((e,t=Ht)=>{!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:()=>Wt});const Gt=Ht(({app:e})=>e,({userHasResponded:e})=>e),qt="visibility",Kt={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},Jt=Ht(({config:e})=>e,e=>{let t={visible:"inline"===e?.layoutMode?Kt.open:Kt.minimized,appContainerClassNames:e?.appContainerClassNames||[],...e};return"function"==typeof t.appContainerClassNames&&(t={...t,appContainerClassNames:t.appContainerClassNames(t)}),t}),Xt=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:o,layoutMode:s,hideOnNoUserResponse:a}=r,{visible:i}=o||{};if("app"===s&&!t)return Kt.open;if("window"===s&&a&&n!==Kt.open)return e?n||t||Kt.open:Kt.hidden;if("inline"===s&&e&&!n)return t||Kt.open;const c=Kt.minimized;return n||t||i||c};var Yt=n(7402),Qt=n(8418);var Zt={notify(){},get:()=>[]};var en=(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),tn=(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),nn=(()=>en||tn?Yt.useLayoutEffect:Yt.useEffect)();Object.defineProperty,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var rn=Symbol.for("react-redux-context"),on="undefined"!=typeof globalThis?globalThis:{};function sn(){if(!Yt.createContext)return{};const e=on[rn]??=new Map;let t=e.get(Yt.createContext);return t||(t=Yt.createContext(null),e.set(Yt.createContext,t)),t}var an=sn(),cn=function(e){const{children:t,context:n,serverState:r,store:o}=e,s=Yt.useMemo(()=>{const e=function(e,t){let n,r=Zt,o=0,s=!1;function a(){l.onStateChange&&l.onStateChange()}function i(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),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 o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){r&&null!==e&&(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}function c(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=Zt)}const l={addNestedSub:function(e){i();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),c())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:a,isSubscribed:function(){return s},trySubscribe:function(){s||(s=!0,i())},tryUnsubscribe:function(){s&&(s=!1,c())},getListeners:()=>r};return l}(o);return{store:o,subscription:e,getServerState:r?()=>r:void 0}},[o,r]),a=Yt.useMemo(()=>o.getState(),[o]);nn(()=>{const{subscription:e}=s;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),a!==o.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[s,a]);const i=n||an;return Yt.createElement(i.Provider,{value:s},t)};function ln(e=an){return function(){return Yt.useContext(e)}}var un=ln();function dn(e=an){const t=e===an?un:ln(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var pn=dn();function fn(e=an){const t=e===an?pn:dn(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var hn=fn(),mn=(e,t)=>e===t;function yn(e=an){const t=e===an?un:ln(e),n=(e,n={})=>{const{equalityFn:r=mn}="function"==typeof n?{equalityFn:n}:n,o=t(),{store:s,subscription:a,getServerState:i}=o,c=(Yt.useRef(!0),Yt.useCallback({[e.name]:t=>e(t)}[e.name],[e])),l=(0,Qt.useSyncExternalStoreWithSelector)(a.addNestedSub,s.getState,i||s.getState,c,r);return Yt.useDebugValue(l),l};return Object.assign(n,{withTypes:()=>n}),n}var vn=yn();const gn=()=>vn(Jt);function bn(){const{startChatIcon:e}=gn();return e}const xn=(e,t)=>{let n;return function(...r){let o=!1;return clearTimeout(n),n=setTimeout(()=>{n=null,o||e.apply(this,r),o=!1},t),t=>{o=!0,t&&e.apply(this,r)}}},wn=e=>Math.ceil(e/1e3),_n=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},Cn=(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]}`},Sn={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},En={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},jn=e=>e.code?En[e.code]:Sn[e.keyCode],Tn=e=>{e&&e.focus()},In=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};function Nn(e){return"object"==typeof e}const kn=({state:e})=>e,On=()=>vn(kn),Ln=Ht(kn,Jt,Gt,({events:e,serviceData:t},n,r)=>{if(r||"inline"===n.layoutMode||!t?.suggestion||!t?.suggestion?.body?.length)return e;const o={type:"service_data",payload:t.suggestion};return[...e,o]}),Rn=Ht(Ln,Jt,(e,t)=>{const{enabled:n,threshold:r}=t?.messages?.timeIndicator??{};return n?e.map(({type:e,payload:t},n,o)=>{if(0===n)return{type:e,payload:{...t,timeIndicator:t?.occurredAt}};const s=o[n-1];if(!t?.occurredAt||!s.payload?.occurredAt||!r)return{type:e,payload:{...t,timeIndicator:void 0}};const a=wn(t.occurredAt-s.payload.occurredAt)>=r?t.occurredAt:void 0;return{type:e,payload:{...t,timeIndicator:a}}}):e}),An=()=>vn(Rn),Pn=(Ht(Rn,e=>e.map(e=>e.payload.id)),()=>On().isLoading),Mn=()=>On().unreadEvents,Un=()=>On().skiplinkElementId,Dn=()=>On().skiplinkTargetId,Fn=()=>On().serviceInfo,zn=Ht(Rn,e=>{const t=e.filter(e=>"message"===e.type);return t[t.length-1]?.payload.id}),Bn=()=>{const{participants:e,currentAgent:t}=On().participantInfo;return t?e[t]:null},Vn=()=>{const{entryMeta:{active:e,options:t,optionsOverride:n}}=On();let r=null;return e&&"number"==typeof n[e]?.limit?r=n[e].limit:e&&"number"==typeof t[e]?.limit&&(r=t[e].limit),{hasLimit:null!==r,limit:null!==r?r:null}},$n=()=>{const{layoutMode:e}=gn();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},Hn=Ht(({visibility:e})=>e,e=>e.visibility),Wn=Ht(({visibility:e})=>e,e=>e.showInlineView),Gn=Ht(({visibility:e})=>e,e=>e.setInputFocus),qn=[Kt.open,Kt.minimized,Kt.hidden],Kn=jt("setVisibility",(e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),s=e.visibility,a=Hn(o),i=Gt(o),c=n.hasConversation(),l=Jt(o),{visibilityCallback:u=Xt,layoutMode:d}=l,{unreadEvents:p}=kn(o),f=u({hasResponded:i,previousVisibility:a,requestedVisibility:s,config:l});if(f&&!qn.includes(f))return console.error('The visibilityCallback function should return "open", "minimized" or "hidden".'),{visibility:null,setInputFocus:e.setInputFocus};if(a===f)return{visibility:null,setInputFocus:e.setInputFocus};const h=n.store.get(qt);return n.store.set(qt,{...h||{},[d]:s}),s&&r.emit("ui.visible",s,{visibility:s,hasConversation:c,hasResponded:i,unreadMessageCount:p}),{visibility:f,setInputFocus:e.setInputFocus}}),Jn=jt("initialize",async(e,{dispatch:t,getState:n,extra:{api:r}})=>{const{layoutMode:o}=Jt(n()),s=r.store.get(qt)?.[o]||Kt.initialize;return t(Kn({visibility:s})),s}),Xn=jt("initializeApp",async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{const o=n?.context?.contentLocale,s=n?.context?.userLocale;try{return t.hasConversation()?{initialState:await t.getConversationIntitialState(),contentLocale:o,userLocale:s,config:n}:(n?.context?.topic&&t.send("action",{type:k,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),{initialState:void 0,contentLocale:o,userLocale:s,config:n})}catch(e){if(e instanceof g){const e=new g;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new Mt;return r({name:t.name,message:t.message,langKey:t.langKey})}}),Yn=((e,t,n)=>{const{wait:r=300,maxWait:o=0,leading:s=!1}=n??{};let a,i=null,c=null;const l=()=>{c&&clearTimeout(c),c=void 0,a&&(a(!0),a=void 0)};return jt(e,t,{condition:()=>{const e=s&&!i;return i&&clearTimeout(i),i=setTimeout(()=>{l(),i=null},r),!!e||(a&&(a(!1),a=void 0),o&&!c&&(c=setTimeout(l,o)),new Promise(e=>{a=e}))}})})("resetApp",async(e,{dispatch:t,extra:{api:n}})=>{await n.disconnect(),n.clearStore(),t(Dt()),await t(Ut()),await t(Xn()),t(Jn())},{wait:2e3,leading:!0}),Qn="cvco",Zn=50,er=300,tr=["alwaysShowEntryLabel","hideOnNoUserResponse","connectWhenInView","showDisclaimer","showSuggestions","useMultilineUserInput","continueChat","preChat","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon","notificationAudioURL"],nr=(e,t)=>{const{messages:n,...r}=(o=t,tr.reduce((e,t)=>(t in o&&(e[t]=o[t]),e),{}));var o;let s=e;return Object.keys(r).length>0&&(s={...s,...r}),n&&(s={...s,messages:{...s.messages,...n}}),s},rr=Lt({name:"config",initialState:{namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}},alwaysShowEntryLabel:!1,api:{domain:"",key:"",secure:!0,sendEnvironment:!0},context:{},notificationAudioURL:void 0,hideOnNoUserResponse:!1,connectWhenInView:!0,showDisclaimer:!1,showSuggestions:!0,useMultilineUserInput:!1,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})=>nr(e,t),updateConfig:(e,{payload:t})=>nr(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(Dt.fulfilled,e=>e).addCase(Ut.fulfilled,(e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:o,defaultContentLocale:s,defaultUserLocale:a}})=>{e.preChatEvents=t.map(e=>({type:"message",payload:e})),e.context.contentLocale=s,e.context.userLocale=a,e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=o||""})}}),{setConfig:or,updateConfig:sr,setPreChatEvents:ar}=rr.actions,ir=rr.reducer,cr={userHasResponded:!1},lr=Lt({name:"app",initialState:cr,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(Yn.pending,()=>cr).addCase(Xn.fulfilled,(e,{payload:t})=>{t.initialState&&"userResponded"in t.initialState&&(e.userHasResponded=t.initialState.userResponded||!1)})}}),{setHasResponded:ur}=lr.actions,dr=lr.reducer;class pr extends m{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const fr={SeamlyGeneralError:v,SeamlyConfigurationError:y,SeamlySessionExpiredError:g,SeamlyOfflineError:pr,SeamlyUnauthorizedError:b,SeamlyUnavailableError:Mt},hr=pt("catch-error",e=>({payload:e})),mr={controls:{}},yr={touched:!1},vr={controls:yr},gr=Lt({name:"forms",initialState:vr,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{const r=t?e[n]??{...mr,persistData:t}:{...mr,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]:yr}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const o={...r.controls};return delete o[t],{...e,[n]:{...r,controls:o}}},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(Yn.pending,()=>vr)}}),{registerForm:br,deregisterForm:xr,registerControl:wr,deregisterControl:_r,updateControlValue:Cr,updateControlTouched:Sr}=gr.actions,Er=gr.reducer,jr=jt("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}}),Tr={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},Ir=Lt({name:"app",initialState:Tr,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(Yn.pending,()=>Tr).addCase(Ut.fulfilled,(e,{payload:t})=>{e.initialLocale=t.defaultUserLocale}).addCase(jr.pending,e=>{e.isLoading=!0}).addCase(jr.rejected,e=>{e.isLoading=!1}).addCase(jr.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:Nr,setTranslations:kr}=Ir.actions,Or=Ir.reducer,Lr=jt("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}}),Rr={error:void 0},Ar=Lt({name:"interrupt",initialState:Rr,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>Rr},extraReducers:e=>{e.addCase(Ut.pending,()=>Rr).addMatcher(bt(Xn.rejected,Ut.rejected,jr.rejected,Kn.rejected,Jn.rejected,Lr.rejected),(e,{payload:t})=>{e.error=t})}}),{setInterrupt:Pr,clearInterrupt:Mr}=Ar.actions,Ur=Ar.reducer,Dr=["SeamlyGeneralError","SeamlyConfigurationError","SeamlySessionExpiredError","SeamlyOfflineError","SeamlyUnauthorizedError","SeamlyUnavailableError"];n(2577);const Fr=({type:e,payload:t})=>"hidden"===document.visibilityState||e===w.message&&!t.fromClient||e===w.info&&t.type===_,zr=e=>e.sort(({payload:{occurredAt:e=0}},{payload:{occurredAt:t=0}})=>e-t),Br=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:o,name:s,introduction:a}=t.participant,i=n[r],c={...n,[r]:i?{...i,...o?{avatar:o}:{},...s?{name:s}:{},...a?{introduction:a}:{}}:t.participant};return{...e,participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r}},Vr=(e,t)=>{if(!0===t?.payload?.fromClient||"message"!==t?.type)return e;const n=t?.payload?.translatedEntry||t?.payload?.entry,{blockAutoEntrySwitch:r}=e,o=t?.payload?.actions||{},s=t?.payload?.translatedActions||{},{type:a,options:i}=n||{};let c=e.active;return r||a===e.userSelected||(c=a),{...e,active:c,optionsOverride:{...a?{[a]:i}:{}},actions:o,translatedActions:s}},$r={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,skiplinkElementId:z(),skiplinkTargetId:z(),optionsButtonId:z(),headerCollapseButtonId:z(),windowOpenButtonId:z(),serviceData:{},options:{features:{webNotifications:{enabled:!1}},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],processingFileUploads:[],entryMeta:{default:C,optionsOverride:{},defaultEntry:C,active:C,userSelected:null,blockAutoEntrySwitch:!1,options:{},actions:{},translatedActions:{}},seamlyContainerElement:null},Hr=Lt({name:"store",initialState:$r,reducers:{addEvent:(e,t)=>{const{type:n,payload:r}=t.payload,o=Object.prototype.hasOwnProperty.call(e.options.features,D);let s={...e.options};if(o&&(n===w.message||n===w.participant)&&!r.fromClient){const e="message"===n?r.entry?.type:void 0;s={...s,features:{...s.features,uploads:{enabled:s.features.uploads?.enabled||!1,...s.features?.uploads||{},enabledFromEntry:e===S}}}}const a=Fr(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 i=Vr(e.entryMeta,t.payload);e.entryMeta=o||i.active!==S?i:{...e.entryMeta},e.options=s,a&&(e.unreadEvents+=1,"service_data"!==n&&(t.payload.payload.messageStatus=r.fromClient?j:E)),t.payload.payload.key=z(),e.events.push(t.payload),e.events=zr(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=zr(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===E&&{messageStatus:j}}),e))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setEvents:(e,{payload:{messages:t,unreadMessageCount:n,userResponded:r,participants:o,service:s,serviceData:a,ui:i}})=>{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 zr([...r,...n])})(e.events,t),l=Object.fromEntries(Object.entries(o).map(([e,t])=>[t.id,t])),u=t.find(e=>"participant"===e.type),d=u?.payload?.participant?.id,{entry:p}=s?.settings||{},f=Vr({...e.entryMeta,...p,active:_,options:{...p?.options}},c.findLast(e=>"message"===e.type));let h={...e.options.features};const m=t.find(e=>!e.payload.fromClient&&["message","participant"].includes(e.type)),y=Object.prototype.hasOwnProperty.call(h,D);if(y&&"message"===m?.type){const e=m.payload.entry?.type||"";h={...h,uploads:{enabled:h.uploads?.enabled||!1,enabledFromEntry:e===S}}}e.unreadEvents=n,e.userHasResponded=r,e.events=c.filter(e=>"participant"!==e.type||!!e.payload.participant?.introduction),e.participantInfo={...e.participantInfo,...d?Br(e.participantInfo,{participant:l[d]}):{},participants:l},e.historyLoaded=!0,e.serviceInfo={...e.serviceInfo,proactiveMessages:s?.settings?.proactiveMessages?.enabled||!1,activeServiceSessionId:s?.sessionId},e.serviceData={...e.serviceData,...a},e.options={...e.options,features:h},e.entryMeta=y||f.active!==S?f:{...e.entryMeta},e.resumeConversationPrompt=i.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=_n(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=Br(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=$r.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})=>{Object.prototype.hasOwnProperty.call(e.options.features,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.options={...e.entryMeta.options,upload:{...t.options.upload}},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(Yn.pending,()=>$r).addCase(Xn.pending,e=>{e.isLoading=!0}).addCase(Ut.fulfilled,(e,{payload:t})=>{e.headerTitles.subTitle=t.agentParticipant?.name||"",t.features&&(e.options.features=t.features)}).addCase(Xn.fulfilled,(e,{payload:t,type:n})=>{if(e.isLoading=!1,!t.initialState)return;e.initialState=t.initialState,"messages"in t.initialState&&Hr.caseReducers.setEvents(e,{payload:t.initialState,type:n});const{initialState:{service:r}}=t;r?.settings?.entry?.options?.upload&&Hr.caseReducers.setFeatureEnabledState(e,{payload:{key:D,enabled:r.settings.entry.options.upload.enabled||!1},type:n})}).addMatcher(bt(eo,to),e=>{e.isLastEventFromClient=!1})}}),{addEvent:Wr,updateEvent:Gr,clearAllUploads:qr,clearEvents:Kr,clearFeatures:Jr,clearIdleDetachCountdown:Xr,clearResumeConversationPrompt:Yr,decrementIdleDetachCountdownCounter:Qr,hideOption:Zr,initIdleDetachCountdown:eo,initResumeConversationPrompt:to,registerUpload:no,setActiveEntryType:ro,setActiveService:oo,setBlockAutoEntrySwitch:so,setEventsRead:ao,setFeatureEnabledState:io,updateFeatures:co,setFeatures:lo,setHeaderSubTitle:uo,setHeaderTitle:po,setEvents:fo,setInitialState:ho,setIsLoading:mo,setLoadedImageEventIds:yo,setParticipant:vo,setSeamlyContainerElement:go,setServiceDataItem:bo,setServiceEntryMetadata:xo,clearAbortTransaction:wo,setUploadComplete:_o,setUploadError:Co,setUploadProgress:So,startProcessingImage:Eo,doneProcessingImage:jo,setUserEntryType:To,setUserSelectedOption:Io,setUserSelectedOptions:No,showOption:ko,stopIdleDetachCountdownCounter:Oo,setProactiveMessages:Lo}=Hr.actions,Ro=Hr.reducer,Ao=({dispatch:e})=>t=>n=>{const r=t(n);if(Ut.fulfilled.match(n)&&n.payload.defaultUserLocale)return e(jr(n.payload.defaultUserLocale)),r;if(Xn.fulfilled.match(n))return n.payload.userLocale&&e(jr(n.payload.userLocale)),r;if(Wr.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(jr(t.translationLocale)),r}return r},Po={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:xt(),translatedEventGroups:{},translationProposal:null},Mo=(e,t)=>{const n=[...e].reduce((e,{payload:n,type:r},o,s)=>{if(e[t]&&n.id){if("info"===r&&"divider"===n?.type&&n?.body?.translationEnabled)return s.splice(0),e;e[t].push(n.id)}return n.id===t&&(e[t]=[]),e},{}),[[r,o]]=Object.entries(n);return{lastGroupId:e.filter(e=>"divider"===e.payload?.type).map(e=>e.payload.id).at(-1),groupId:r,eventIds:o}},Uo=Lt({name:"translation",initialState:Po,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}=Mo(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:o,eventIds:s}=Mo(t,n);e.lastGroupId=r,e.translatedEventGroups[o]=s},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(Yn.pending,()=>Po).addCase(Ut.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(jr.fulfilled,(e,{payload:t})=>{e.currentLocale=t.userLocale}).addCase(Wr,(e,{payload:t})=>{t.payload.id&&e.lastGroupId&&e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)}).addCase(fo,(e,{payload:t})=>{e.translationProposal=t?.ui?.translationProposal}).addCase(Xn.fulfilled,(e,{payload:t})=>{e.translationProposal=t.initialState?.ui?.translationProposal})}}),{enableTranslation:Do,disableTranslation:Fo,enableEventsTranslation:zo,disableEventsTranslation:Bo,setTranslationProposalPrompt:Vo,disableTranslationProposalPrompt:$o}=Uo.actions,Ho=Uo.reducer,Wo=Lt({name:"visibility",initialState:{visibility:Kt.initialize,showInlineView:!1,setInputFocus:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(Kn.fulfilled,(e,{payload:{visibility:t,setInputFocus:n}})=>{t&&(e.visibility=t,e.setInputFocus=Boolean(n))}).addCase(Ut.fulfilled,(e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)})}}),{setShowInlineView:Go}=Wo.actions,qo=Wo.reducer,Ko=st({state:Ro,app:dr,config:ir,i18n:Or,translations:Ho,visibility:qo,forms:Er,interrupt:Ur});const Jo=hn;var Xo=n(2086),Yo=n.n(Xo),Qo=n(8785),Zo=n(1162);function es(e=""){const t=e=>/\s/.test(e),n=[],r={};let o=0,s=null,a=!1,i=0;for(;i<e.length;){if(a&&(t(e[i])||"{"===e[i]))a=!1,s=e.slice(o,i),"{"===e[i]&&i--;else if(!a&&!t(e[i])){const t="{"===e[i];if(s&&t){const t=ts(e,i);if(-1===t)throw new Error(`Unbalanced curly braces in string: "${e}"`);r[s]=e.slice(i+1,t),i=t,s=null}else s&&(n.push(s),s=null),a=!0,o=i}i++}return a&&(s=e.slice(o)),s&&n.push(s),{args:n,cases:r}}function ts(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 ns(e){return rs(e.slice(1,-1),",",3)}function rs(e,t,n,r=[]){if(!e)return r;if(1===n)return r.push(e),r;let o=e.indexOf(t);if(-1===o)return r.push(e),r;let s=e.substring(0,o).trim(),a=e.substring(o+t.length+1).trim();return r.push(s),rs(a,t,n-1,r)}let os,ss=0;const as="other";function is(e,t){let n=0,r="",o=0;const s={};for(;n<e.length;){if("#"!==e[n]||o)r+=e[n];else{let e="__hashToken"+ss++;r+=`{${e}, number}`,s[e]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:s}}const cs="other",ls=Ht(({i18n:e})=>e,({translations:e})=>e),us=Ht(({i18n:e})=>e,({initialLocale:e})=>e),ds=Ht(({i18n:e})=>e,({userLocale:e})=>e),ps=Ht(({i18n:e})=>e,({isLoading:e})=>e),fs=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 o=e(...n);return t[r]=o,o}}((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=ts(e,n);if(-1===r)throw new Error(`Unbalanced curly braces in string: "${e}"`);{let o=e.substring(n,r+1);if(o){let s=[],a=e.substring(0,n);a&&s.push(a);let[i,c,l]=ns(o),u=t[i],d=c&&this.typeHandlers[c];s.push(d?d(u,l,this.locale,t,this.process.bind(this)):u);let p=e.substring(r+1);return p&&s.push(this.process(p,t)),s}}}return[e]}}("en-GB",{plural:function(e,t,n,r,o){const{args:s,cases:a}=es(t);let i=parseInt(e);s.forEach(e=>{e.startsWith("offset:")&&(i-=parseInt(e.slice(7)))});const c=[];if("PluralRules"in Intl){void 0!==os&&os.resolvedOptions().locale===n||(os=new Intl.PluralRules(n));const e=os.select(i);e!==as&&c.push(e)}1===i&&c.push("one"),c.push(`=${i}`,as);for(let e=0;e<c.length;e++){const t=c[e];if(t in a){const{caseBody:e,numberValues:n}=is(a[t],i);return o(e,{...r,...n})}}return e},select:function(e,t,n,r,o){const{cases:s}=es(t);return e in s?o(s[e],r):cs in s?o(s[cs],r):e}});function hs(){const e=vn(ls),t=vn(ds),n=vn(us),r=vn(ps);return{t:(0,Zo.useCallback)((n,o={})=>{if(!e)return"";const s=e[n];return s?fs.format(s,o):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),"")},[e,t,r]),userLocale:t,initialLocale:n}}const ms=()=>{const e=Jo(),t=vn(Hn),n=vn(Gn),r=!!t&&t!==Kt.hidden,o=t===Kt.open,s=t===Kt.minimized,a=(0,Zo.useCallback)(t=>{e(Kn("string"==typeof t||null===t?{visibility:t,setInputFocus:!1}:t))},[e]);return{isVisible:r,isOpen:o,isMinimized:s,visible:t,setVisibility:a,openChat:()=>{a({visibility:Kt.open})},closeChat:()=>{a({visibility:Kt.minimized})},setInputFocus:n}},ys=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,Qo.createRef)()})=>{const[r,o]=(0,Zo.useState)(null),s=!!r?.isIntersecting||!t,a=s&&e,i=([e])=>o(e);return(0,Zo.useEffect)(()=>{const e=n?.current;if(!window.IntersectionObserver||a||!e||!t)return()=>{};const r=new IntersectionObserver(i,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()},[n,t,a]),{isVisible:s,containerRef:n}},vs=()=>vn(Gt),gs=(0,Qo.createContext)(null),bs=(0,Qo.createContext)(null),xs=()=>{const e=(0,Zo.useContext)(bs);if(!e)throw new Error("useSeamlyEventBusContext has to be used within <SeamlyEventBusContext.Provider>");return e},ws=()=>{const e=(0,Zo.useContext)(gs);if(!e)throw new Error("useSeamlyApiContext has to be used within <SeamlyApiContext.Provider>");return e},_s=()=>ws().store,Cs=()=>{const e=ws();return(0,Zo.useCallback)(()=>e.hasConversation(),[e])},Ss=()=>{const e=ws(),t=Jo(),n=xs(),r=vs(),o=Cs(),{visible:s,setVisibility:a}=ms(),i=Mn(),c=(0,Zo.useCallback)((...e)=>{n.emit(...e)},[n]),l=(0,Zo.useCallback)(()=>{c("ui.beforeStart",{visibility:s,hasConversation:o(),hasResponded:r,unreadMessageCount:i}),e.send("start_conversation"),c("ui.start",{visibility:s,hasConversation:o(),hasResponded:r,unreadMessageCount:i})},[e,c,o,r,i,s]),u=(0,Zo.useCallback)(async()=>{await t(Yn())},[t]),d=(0,Zo.useCallback)(e=>({type:e,id:z(),transactionId:z(),fromClient:!0,participant:"seamly-client-participant",occurredAt:1e3*Date.now()}),[]),p=(0,Zo.useCallback)(e=>({...d("text"),body:{text:e}}),[d]),f=(0,Zo.useCallback)(({body:n,config:r={}})=>{if(""===n.trim())return;const o={...p(n),...r};e.send("message",o),c("message",o),t(Wr({type:"message",payload:{...o,body:o.body,type:o.type,optimisticallyInjected:!0}}))},[e,t,c,p]),h=(0,Zo.useCallback)((e,n=z())=>{t(Wr({type:"message",payload:{...p(e),transactionId:n}}))},[t,p]),m=(0,Zo.useCallback)((e,n,r,o,s,a)=>{t(Wr({type:"message",payload:{type:"upload",id:e,transactionId:n,fromClient:!0,participant:"seamly-client-participant",occurredAt:r,body:{contentType:o,filename:s,filesize:a,id:e||"",isDeleted:!1}}}))},[t]),y=(0,Zo.useCallback)(t=>{t&&e.send("action",t)},[e]),v=(0,Zo.useCallback)(t=>{e.sendContext(t)},[e]),g=(0,Zo.useCallback)(()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then(e=>{e&&(t(ho(e)),e.messages&&e.messages.length&&t(fo(e)),e.userResponded&&(t(ur(e.userResponded)),a({visibility:Kt.open})))}).catch(e=>{t(Pr({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}),[e,t,a]);return{connect:g,start:l,sendMessage:f,sendAction:y,sendContext:v,reset:u,emitEvent:c,addMessageBubble:h,addUploadBubble:m,apiConnected:e.connected,apiConfigReady:e.configReady}},Es=(0,Qo.createContext)(null),js=()=>{const e=(()=>{const e=(0,Zo.useContext)(Es);if(!e)throw new Error("useSeamlyLiveRegionContext has to be used within <SeamlyLiveRegionContext.Provider>");return e})();return{sendPolite:(0,Zo.useCallback)(t=>{t&&e({ariaLive:M,messageText:t})},[e]),sendAssertive:(0,Zo.useCallback)(t=>{t&&e({ariaLive:P,messageText:t})},[e])}},Ts=Ht(({interrupt:e})=>e,({error:e})=>e),Is=Ht(Ts,e=>Boolean(e));function Ns(){const{t:e}=hs(),t=vn(Ts);return{hasError:vn(Is),meta:(0,Zo.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,o=e(`${n}.title`),s=e(`${n}.message`),a=e(`${n}.srText`),i=r?e(`${n}.buttonText`):null;return{...n?{title:o,message:s,srText:a}:{},...r?{action:r}:{},...r&&n?{buttonText:i}:{},originalError:t}},[t,e]),error:t}}const ks=()=>{const{t:e}=hs(),{isInline:t,isWindow:n,isApp:r}=$n(),{isOpen:o,isVisible:s}=ms(),a=vn(Wn),{start:i,connect:c,apiConfigReady:l,apiConnected:u}=Ss(),d=(0,Zo.useRef)(!1),{sendAssertive:p}=js();!function(){const{meta:{originalError:e,action:t}}=Ns(),n=Jo(),{reset:r}=Ss(),o="SeamlySessionExpiredError"===e?.name,s=(0,Zo.useRef)(0),a=(0,Zo.useRef)(null);(0,Zo.useEffect)(()=>{if(o&&"reset"===t){if(s.current>=10){a.current=setTimeout(()=>{s.current=0},1e4);const e=new v;return n(Pr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),()=>{}}s.current+=1,r()}return()=>{a.current&&clearTimeout(a.current)}},[t,r,o,n])}(),(0,Zo.useEffect)(()=>{s&&setTimeout(()=>{p(e("window.srTexts.onLoad"))},500)},[s,p,e]),(0,Zo.useEffect)(()=>{s&&p(e(o?"window.srTexts.onOpen":"window.srTexts.onClose"))},[o,s,p,e]),(0,Zo.useEffect)(()=>{l||u||(d.current=!1)},[l,u]);const f=(0,Zo.useCallback)(async()=>{u||(d.current=!0,await c()),(r||o||s&&t)&&i()},[u,c,r,t,o,s,i]);(0,Zo.useEffect)(()=>{!l||d.current||n&&!o||!(!t||s&&a)||f()},[l,f,t,o,s,n,a])},Os=require("preact/compat"),Ls=require("preact/jsx-runtime"),Rs=({children:e})=>(ks(),(0,Ls.jsx)(Ls.Fragment,{children:e})),As=(0,Qo.createContext)(null),Ps=(e=0)=>new Promise(t=>{setTimeout(t,e)}),Ms=()=>{const{seamlyContainerElement:e}=On(),t=Jo();return[e,(0,Zo.useCallback)(e=>{t(go(e))},[t])]},Us=e=>(0,Zo.useCallback)(()=>{var t;t=e,requestAnimationFrame(async()=>{await Ps(180);const e="string"==typeof t?document.getElementById(t):t;Tn(e)})},[e]),Ds=()=>{const e=Dn();return Us(e)},Fs=()=>{const{windowOpenButtonId:e}=On();return Us(e)};n(3215);const zs=e=>Ht(e=>e.translations.translatedEventGroups,t=>Object.values(t).every(t=>e?.payload?.id&&!t.includes(e.payload.id)));function Bs(){const{sendContext:e}=Ss(),t=Jo(),n=gn(),r=(0,Zo.useCallback)((t,n)=>{e({userLocale:t,source:n})},[e]),o=(0,Zo.useCallback)(()=>{e({userLocale:n.context?.contentLocale}),t(Fo())},[n.context?.contentLocale,t,e]),{languages:s,isActive:a,isAvailable:i,currentLocale:c}=vn(({translations:e})=>e);return{languages:s,isActive:a,isAvailable:i,currentLocale:c,enableTranslations:r,disableTranslations:o}}const Vs=e=>{const t=vn(zs(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:o}={body:e.payload?.body,translation:e.payload?.translation},s=!!n;return{body:t&&s?n:o,hasTranslation:s,isTranslated:t&&s,locale:r?.locale}};function $s(){const e=vn(({translations:e})=>e.containerId);return{id:e,focusContainer:Us(e)}}function Hs(e){const{languages:t}=Bs();return(0,Zo.useMemo)(()=>t?.find(t=>t.locale===e)?.nativeName,[e,t])}const Ws=(...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(Qn)>-1?e:[Qn,e].join("-")).join(" "),Gs=()=>gn().appContainerClassNames,qs=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},Ks=()=>{const e=ws();return(0,Os.useSyncExternalStore)(f.subscribe,()=>e.conversation)},Js=(0,Qo.createContext)(null),Xs=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=On(),{allowedMimeTypes:o,maxSize:s}=n?.upload||{},{enabled:a,enabledFromEntry:i}=r||{},{allowedMimeTypes:c,maxSize:l}={...t.upload||{allowedMimeTypes:[],maxSize:0},...o?{allowedMimeTypes:o}:{},...s?{maxSize:s}:{}};return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:i||a,allowedMimeTypes:c,maxSize:l}},Ys=()=>{const{currentUploads:e}=On(),t=Jo(),n=(()=>{const e=(0,Zo.useContext)(Js);if(!e)throw new Error("useSeamlyFileUploadContext has to be used within <SeamlyFileUploadContext.Provider>");return e})();return{uploadFile:(0,Zo.useCallback)(e=>{n(e)},[n]),clearUploads:(0,Zo.useCallback)(()=>{t(qr())},[t]),currentUploads:e,isUploading:e.some(e=>e.uploading),isComplete:e.every(e=>e.complete)}},Qs=()=>{const{t:e}=hs(),{options:t}=On(),{panelActive:n,optionActive:r,userSelectedOptions:o,features:s}=t,{extraMenuItem:a,sendTranscript:i}=s,c={extraMenuItem:a,sendTranscript:i},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=a||i,p=Jo(),{get:f,set:h}=_s();return{allowOptionSelection:d,userSelectedOptions:o,features:s,menuOptions:u,initUserSelectedOptions:(0,Zo.useCallback)(()=>{const e=f("options")||{};p(No(e))},[f,p]),setUserSelectedOptions:(0,Zo.useCallback)(e=>{p(No(e)),h("options",e)},[h,p]),setUserSelectedOption:(0,Zo.useCallback)((e,t)=>{const n=f("options")||{};"object"==typeof n&&h("options",{...n,[e]:t}),p(Io({option:e,value:t}))},[p,f,h]),showOption:e=>{p(ko(e))},hideOption:()=>{p(Zr())},panelActive:n,optionActive:r}},Zs=()=>{const{optionsButtonId:e}=On();return{id:e,focusButton:Us(e)}},ea=(0,Qo.createContext)(null),ta=()=>{const e=(0,Zo.useContext)(ea);if(!e)throw new Error("useSeamlyActivityEventHandler has to be used within <SeamlyActivityEventContext.Provider>");return e},na=()=>{const e=Jo(),{idleDetachCountdown:{hasCountdown:t,isActive:n,count:r,remaining:o,timer:s,wasStopped:a}}=On(),{isOpen:i}=ms(),c=(0,Zo.useRef)({hasCountdown:!1,wasStopped:!1});c.current={hasCountdown:t,wasStopped:a||!1};const{emitEvent:l,sendAction:u}=Ss(),{t:d}=hs(),{sendAssertive:p,sendPolite:f}=js(),h=(0,Zo.useCallback)(e=>{i&&p(e)},[i,p]),m=(0,Zo.useCallback)(e=>{i&&f(e)},[i,f]),y=(0,Zo.useCallback)(t=>{const n=(e=>Math.ceil(e/1e3))(t),r=_n(n);e(eo({delaySeconds:n,delayTime:r})),l("idleTimer.start"),h(`${d("idleDetachWarning.countdownTitle")} ${d("idleDetachWarning.countdownText")} ${d("idleDetachWarning.countdownTimer",r)}`)},[e,l,h,d]),v=(0,Zo.useCallback)((t=void 0,n=!1)=>{const{hasCountdown:r,wasStopped:o}=c.current;r&&(t||(n||u({type:I}),h(d("idleDetachWarning.notifyTransferText"))),o||l("idleTimer.stop"),e(Xr()))},[e,l,u,h,d]),g=(0,Zo.useCallback)(()=>{if(!o||o<=0)return;const t=o-1;t%10==0&&h(`${d("idleDetachWarning.countdownText")} ${d("idleDetachWarning.countdownTimer",_n(t))}`),e(Qr())},[e,o,h,d]),b=(0,Zo.useCallback)(()=>{n&&(e(Oo()),o&&(l("idleTimer.stop"),m(d("idleDetachWarning.srCountDownStoppedText"))))},[e,l,n,o,m,d]);return{hasCountdown:t,isActive:n,count:r,remaining:o,timer:s,wasStopped:a,initCountdown:y,endCountdown:v,decrementCountdown:g,stopCountdown:b}},ra=()=>{const e=Jo(),t=On().resumeConversationPrompt,{sendAction:n}=Ss(),{t:r}=hs(),{sendAssertive:o}=js();return{continueChat:()=>{n({type:N,body:{type:"resume_conversation_prompt"}}),e(Yr())},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:I}),e(Yr())}}},oa=()=>{const[e]=(0,Zo.useState)(()=>z());return e},sa=(e,t)=>{const n=Ks();(0,Zo.useEffect)(()=>{n.onMessage((n,r)=>(t&&!t({type:n,payload:r})||e({type:n,payload:r}),r))},[e,t,n])},aa=({eventPayload:e})=>{const{t}=hs(),{fromClient:n,participant:r}=e,o=(e=>On().participantInfo.participants[e])(r)||{},{messages:s}=gn(),a=n?t("participants.user.name"):o&&o.name,{showAvatar:i,showName:c}=s&&s[n?"user":"agent"]||{};if(!i&&!c)return null;const l=[];return i&&a&&o.avatar&&l.push((0,Ls.jsx)("span",{className:Ws("message__avatar"),children:(0,Ls.jsx)("img",{src:o.avatar,className:Ws("avatar"),alt:""})})),c&&a&&l.push((0,Ls.jsx)("span",{className:Ws("message__author-name"),children:a})),l.length>0?(0,Ls.jsx)("div",{className:Ws("message__author"),children:l}):null},ia=({showParticipant:e=!0,event:t,type:n,modifiers:r,children:o,bodyProps:s={},info:a,...i})=>{const c=qs(t),{hasTranslation:l,isTranslated:u,locale:d}=Vs(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&&(s={...s,lang:d}),(0,Ls.jsx)(Ls.Fragment,{children:(0,Ls.jsxs)("div",{className:Ws(c),...i,children:[e&&(0,Ls.jsx)(aa,{eventPayload:t.payload}),(0,Ls.jsx)("div",{className:Ws("message__body"),...s,children:o}),a&&(0,Ls.jsx)("div",{"aria-hidden":"true",className:Ws("message__info"),children:a})]})})},ca=({id:e,action:t,buttonText:n,description:r,hasFocus:o,image:s,title:a,isCarouselItem:i})=>{const c=(0,Zo.useRef)(null),{sendMessage:l,sendAction:u,emitEvent:d}=Ss(),p=oa(),f=(0,Zo.useRef)(!1),h=t?.type===F?"a":"button",m=(0,Zo.useCallback)(()=>d(`action.${O}`,{type:O,originMessage:e,action:t}),[d,e,t]),y=(0,Zo.useCallback)(()=>{if(m(),"ask"===t?.type)l({body:t?.ask});else if("topic"===t?.type){const{topic:e,fallbackMessage:n}=t;u({type:k,body:{name:e,fallbackMessage:n}})}},[l,t,u,m]),v=(0,Zo.useMemo)(()=>t?.type===F?{href:t?.link,rel:"noopener noreferrer",target:t?.newTab?"_blank":"_self",onClick:m}:{onClick:y},[t,y,m]);return(0,Zo.useEffect)(()=>{i&&(o&&f.current?window.requestAnimationFrame(()=>c.current?.focus()):c.current?.blur()),f.current=!0},[o,i]),(0,Ls.jsxs)("div",{className:Ws("card__wrapper"),id:e,tabIndex:-1,ref:c,children:[s?(0,Ls.jsx)("img",{className:Ws("card__image"),src:s,alt:""}):null,(0,Ls.jsxs)("div",{className:Ws("card__content"),id:e,children:[a&&(0,Ls.jsx)("h2",{className:Ws("card__title"),children:a}),r&&(0,Ls.jsx)("div",{className:Ws("card__description"),dangerouslySetInnerHTML:{__html:r}}),(0,Ls.jsx)(h,{tabIndex:i&&!o?-1:void 0,className:Ws("button","button--primary"),"aria-describedby":p,...v,children:n})]})]})};function la({item:e,items:t,index:n,isActive:r}){const{t:o}=hs();return(0,Ls.jsx)("div",{className:Ws("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":o("carousel.slide.label",{index:n+1,total:t.length}),children:(0,Ls.jsx)(ca,{...e,isCarouselItem:!0,hasFocus:r})})}const ua={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'}},da=({name:e,size:t="32",className:n,alt:r})=>(0,Ls.jsxs)(Ls.Fragment,{children:[(0,Ls.jsx)("div",{"aria-hidden":"true",className:n||Ws("icon"),dangerouslySetInnerHTML:{__html:ua[e][t]}}),r&&(0,Ls.jsx)("span",{className:Ws("visually-hidden"),children:r})]});function pa({items:e,currentIndex:t,onChange:n,children:r}){const{t:o}=hs(),s=e.length;return(0,Ls.jsxs)("div",{className:Ws("carousel-controls"),children:[(0,Ls.jsx)("button",{className:Ws("button","button--previous"),"aria-label":o("carousel.controls.previous"),onClick:()=>{n((t-1+s)%s)},children:(0,Ls.jsx)(da,{name:"arrowLeft",size:"16",alt:""})}),r,(0,Ls.jsx)("button",{className:Ws("button","button--next"),"aria-label":o("carousel.controls.next"),onClick:()=>{n((t+1)%s)},children:(0,Ls.jsx)(da,{name:"arrowRight",size:"16",alt:""})})]})}function fa({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:o}){const s=e.length,a=(0,Zo.useCallback)(e=>{const r=Number(e.target.dataset.item||"0"),o=Math.min(s-1,Math.max(0,r));o!==t&&n(o)},[s,t,n]);return(0,Ls.jsx)("div",{className:Ws("carousel-pagination__wrapper"),role:"group",children:(0,Ls.jsx)("ul",{className:Ws("carousel-pagination"),children:e.map((e,n)=>{const s=t===n;return(0,Ls.jsx)("li",{className:Ws("carousel-pagination__item",s?"is-active":void 0),children:(0,Ls.jsx)("button",{className:Ws("carousel-pagination__button"),type:"button",onClick:a,"data-item":n,"aria-disabled":s?"true":void 0,"aria-label":o(e,n)})},r(e,n,"pagination-item-"))})})})}const ha=(e,t,n)=>`${n}${t}`,ma=e=>e.label,ya=({target:e})=>{e.scrollLeft=0};function va({currentIndex:e=0,onChange:t=()=>{},getItemKey:n=ha,getItemLabel:r=ma,items:o}){const s=oa(),a=o.length,[i,c]=(0,Zo.useState)(Number(e||0));(0,Zo.useEffect)(()=>{c(Number(e||0))},[c,e]);const l=(0,Zo.useRef)([]);l.current=(0,Zo.useMemo)(()=>Array(a).fill(1).map(()=>(0,Qo.createRef)()),[a]);const u=(0,Zo.useRef)(!0),d=(0,Zo.useRef)(null);return d.current=t,(0,Zo.useEffect)(()=>{u.current?u.current=!1:d.current&&d.current(i)},[i]),(0,Ls.jsxs)("div",{className:Ws("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,Ls.jsx)("div",{className:Ws("carousel__slides-wrapper"),onScroll:ya,children:(0,Ls.jsx)("div",{id:s,className:Ws("carousel__slides"),style:{width:100*a+"%",left:-100*i+"%"},"aria-live":"polite","aria-atomic":"false",children:o.map((e,t)=>{const r=i===t;return(0,Ls.jsx)("div",{ref:l.current[t],className:Ws("carousel__slide",r?"is-active":void 0),"aria-hidden":r?void 0:"true",children:(0,Ls.jsx)(la,{item:e,items:o,index:t,isActive:r})},n(e,t,"item-"))})})}),(0,Ls.jsx)("div",{className:Ws("carousel__controls"),children:(0,Ls.jsx)(pa,{currentIndex:i,items:o,onChange:c,children:(0,Ls.jsx)("div",{className:Ws("carousel__pagination"),children:(0,Ls.jsx)(fa,{currentIndex:i,items:o,onChange:c,getItemKey:n,getItemLabel:r})})})})]})}const ga=(e,t,n="")=>`${n}${e.title}:${t}`,ba=e=>e.title,xa=e=>{const{payload:t}=e,[n,r]=(0,Zo.useState)(!1),{addMessageBubble:o,emitEvent:s,sendAction:a}=Ss(),i=Cs(),{activeServiceSessionId:c}=Fn(),l=vn(zn),{body:u}=Vs(e),{service:d}=t,p=(0,Zo.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]),f=u?.chooseAgain&&c===d?.serviceSessionId&&t.id!==l;return(0,Zo.useEffect)(()=>{r(t.id===l)},[t,l]),{body:u,subEvent:p,showOptions:n,chooseAgain:f,onChoiceClickHandler:e=>{if(!i())return;const n=z(),c={type:"pick_choice",originMessage:t.id,choice:{chooseAgain:f,id:e.id},transactionId:n};o(e.text,n),a(c),r(!1),s(`action.${c.type}`,{...c,choice:{...c.choice,text:e.text}})},onChooseAgainClickHandler:()=>{r(e=>!e)}}},wa=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,_a=({id:e,categories:t=[],question:n,onClick:r,hasIcon:o})=>{const s=(0,Zo.useMemo)(()=>["suggestions__item",...t.map(wa)],[t]),a=(0,Zo.useCallback)(()=>{r&&r({id:e,question:n})},[e,n,r]);return(0,Ls.jsx)("li",{className:Ws(s),children:(0,Ls.jsxs)("button",{type:"button",onClick:a,className:Ws("button","button--primary"),children:[o&&(0,Ls.jsx)(da,{name:"chevronRight",size:"8",alt:""}),n]})})},Ca=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>(0,Ls.jsx)("ul",{className:Ws("suggestions__list",e||""),children:t.map(e=>(0,Ls.jsx)(_a,{hasIcon:r,onClick:n,categories:e.categories,id:e.id,question:e.question},e.id))}),Sa=({children:e,className:t,graphicSrc:n,graphicType:r="icon",iconName:o,iconSize:s,iconClassName:a,dividerType:i,title:c,description:l})=>{const u=Boolean(o||n);return(0,Ls.jsxs)("div",{className:Ws("divider",i&&`divider--type-${i}`,t),children:[u&&(0,Ls.jsx)("span",{className:Ws("divider__graphic"),children:o?(0,Ls.jsx)(da,{name:o,size:s,className:a,alt:""}):(0,Ls.jsx)("img",{src:n||void 0,className:Ws({icon:"icon"===r,avatar:"avatar"===r},a)})}),(0,Ls.jsxs)("div",{className:Ws("divider__body"),children:[c?(0,Ls.jsx)("h2",{className:Ws("divider__title"),dangerouslySetInnerHTML:{__html:c}}):null,l?(0,Ls.jsx)("p",{className:Ws("divider__description"),dangerouslySetInnerHTML:{__html:l}}):null,e]})]})},Ea={[U.new_topic]:"new-topic"},ja={default:({event:e})=>{const{t}=hs(),{subtype:n}=e.payload.body,r=Ea[U[n]];return U[n]?(0,Ls.jsx)(Sa,{dividerType:r,iconName:U[n],title:t(`dividerKeys.${U[n]}`)}):null},[U.new_translation]:({event:e})=>{const{t}=hs(),n=An(),{body:{translationEnabled:r,text:o,title:s},id:a}=e.payload,i=vn(e=>e.translations.translatedEventGroups),c=Jo(),l=(0,Zo.useCallback)(()=>{i[a]?c(zo({events:n,id:a})):c(Bo({events:n,id:a}))},[c,n,a,i]);return(0,Ls.jsx)(Sa,{iconName:"newTranslation",dividerType:"new-translation",title:s,description:o,children:r?(0,Ls.jsx)(Ls.Fragment,{children:(0,Ls.jsx)("button",{className:Ws("button","button--secondary"),onClick:l,children:t(i[a]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):null})}},Ta={month:"long",day:"numeric",year:"numeric"},Ia={hour:"numeric",minute:"numeric"},Na=({event:e})=>{const t=(()=>{const[e,t]=(0,Zo.useReducer)(e=>e+1,0);return(0,Zo.useCallback)(()=>{setTimeout(()=>{t()})},[])})(),{date:n,time:r,timeUntilMidnight:o,srText:s}=(e=>{const{t}=hs(),n=gn(),r=n?.context?.userLocale??[],o=new Date(e),s=new Date,a=new Date(s);a.setHours(24,0,0,0);const i=a.valueOf()-s.valueOf(),c=o.toString(),l=new Intl.DateTimeFormat(r,Ia).format(o);let u=((e,t)=>{const n=new Date(t).setHours(0,0,0,0),r=e.getTime(),o=864e5;return r>=n+o?e:r>n?"today":r>n-o?"yesterday":e})(o,s);switch(u){case"today":u=t("dateTime.today");break;case"yesterday":u=t("dateTime.yesterday");break;default:u=new Intl.DateTimeFormat(r,Ta).format(o)}return{date:u,srText:t("dateTime.srText",{date:u,time:l}),time:l,fullDateTime:c,timeUntilMidnight:i}})(wn(e.payload.timeIndicator));return(0,Zo.useEffect)(()=>{const e=setTimeout(()=>{t()},o);return()=>{clearTimeout(e)}},[t,o]),(0,Ls.jsxs)(Sa,{dividerType:"time-indicator",children:[(0,Ls.jsxs)("h2",{className:Ws("divider__time"),"aria-hidden":"true",children:[(0,Ls.jsx)("span",{className:Ws("divider__time--date"),children:n}),(0,Ls.jsx)("span",{className:Ws("divider__time--time"),children:r})]}),(0,Ls.jsx)("p",{className:Ws("visually-hidden"),children:s})]})};var ka=["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])"],Oa=ka.join(","),La="undefined"==typeof Element,Ra=La?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Aa=!La&&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},Pa=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&Pa(e.parentNode)},Ma=function(e,t,n){if(Pa(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Oa));return t&&Ra.call(e,Oa)&&r.unshift(e),r.filter(n)},Ua=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var s=o.shift();if(!Pa(s,!1))if("SLOT"===s.tagName){var a=s.assignedElements(),i=a.length?a:s.children,c=Ua(i,!0,n);n.flatten?r.push.apply(r,c):r.push({scopeParent:s,candidates:c})}else{Ra.call(s,Oa)&&n.filter(s)&&(t||!e.includes(s))&&r.push(s);var l=s.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(s),u=!Pa(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(s));if(l&&u){var d=Ua(!0===l?s.children:l.children,!0,n);n.flatten?r.push.apply(r,d):r.push({scopeParent:s,candidates:d})}else o.unshift.apply(o,s.children)}}return r},Da=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Fa=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))&&!Da(e)?0:e.tabIndex},za=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ba=function(e){return"INPUT"===e.tagName},Va=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},$a=function(e,t){return!(t.disabled||Pa(t)||function(e){return Ba(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=Ra.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Ra.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Va(e)}else{if("function"==typeof r){for(var s=e;e;){var a=e.parentElement,i=Aa(e);if(a&&!a.shadowRoot&&!0===r(a))return Va(e);e=e.assignedSlot?e.assignedSlot:a||i===e.ownerDocument?a:i.host}e=s}if(function(e){var t,n,r,o,s=e&&Aa(e),a=null===(t=s)||void 0===t?void 0:t.host,i=!1;if(s&&s!==e)for(i=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!i&&a;){var c,l,u;i=!(null===(l=a=null===(c=s=Aa(a))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(a))}return i}(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!!Ra.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ha=function(e,t){return!(function(e){return function(e){return Ba(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Aa(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||Fa(t)<0||!$a(e,t))},Wa=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ga=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,s=o?e.scopeParent:e,a=function(e,t){var n=Fa(e);return n<0&&t&&!Da(e)?0:n}(s,o),i=o?Ga(e.candidates):s;0===a?o?t.push.apply(t,i):t.push(s):n.push({documentOrder:r,tabIndex:a,item:e,isScope:o,content:i})}),n.sort(za).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},qa=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Ra.call(e,Oa)&&Ha(t,e)},Ka=ka.concat("iframe").join(","),Ja=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Ra.call(e,Ka)&&$a(t,e)};function Xa(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 Ya(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");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 Qa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Za(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qa(Object(n),!0).forEach(function(t){Ya(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ei=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},ti=function(e){return ei(e)&&!e.shiftKey},ni=function(e){return ei(e)&&e.shiftKey},ri=function(e){return setTimeout(e,0)},oi=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},si=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},ai=[],ii=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=(null==t?void 0:t.trapStack)||ai,s=Za({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:ti,isKeyBackward:ni},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},i=function(e,t,n){return e&&void 0!==e[t]?e[t]:s[n||t]},c=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var r=t.container,o=t.tabbableNodes;return r.contains(e)||(null==n?void 0:n.includes(r))||o.find(function(t){return t===e})})},l=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.hasFallback,a=void 0!==o&&o,i=n.params,c=void 0===i?[]:i,l=s[e];if("function"==typeof l&&(l=l.apply(void 0,function(e){if(Array.isArray(e))return Xa(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 Xa(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)?Xa(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&&!a)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&&!Ja(e,s.tabbableOptions))if(c(r.activeElement)>=0)e=r.activeElement;else{var t=a.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(a.containerGroups=a.containers.map(function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Ua([e],t.includeContainer,{filter:Ha.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Wa}):Ma(e,t.includeContainer,Ha.bind(null,t)),Ga(n)}(e,s.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?Ua([e],t.includeContainer,{filter:$a.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Ma(e,t.includeContainer,$a.bind(null,t))}(e,s.tabbableOptions),r=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,a=n.find(function(e){return qa(e)}),i=n.slice().reverse().find(function(e){return qa(e)}),c=!!t.find(function(e){return Fa(e)>0});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:a,lastDomTabbableNode:i,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=t.indexOf(e);return o<0?r?n.slice(n.indexOf(e)+1).find(function(e){return qa(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return qa(e)}):t[o+(r?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.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(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.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:!!s.preventScroll}),a.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,o=void 0!==r&&r;t=t||si(n),d();var i=null;if(a.tabbableGroups.length>0){var u=c(t,n),p=u>=0?a.containerGroups[u]:void 0;if(u<0)i=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var f=a.tabbableGroups.findIndex(function(e){var n=e.firstTabbableNode;return t===n});if(f<0&&(p.container===t||Ja(t,s.tabbableOptions)&&!qa(t,s.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(f=u),f>=0){var h=0===f?a.tabbableGroups.length-1:f-1,m=a.tabbableGroups[h];i=Fa(t)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else ei(n)||(i=p.nextTabbableNode(t,!1))}else{var y=a.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(y<0&&(p.container===t||Ja(t,s.tabbableOptions)&&!qa(t,s.tabbableOptions)&&!p.nextTabbableNode(t))&&(y=u),y>=0){var v=y===a.tabbableGroups.length-1?0:y+1,g=a.tabbableGroups[v];i=Fa(t)>=0?g.firstTabbableNode:g.firstDomTabbableNode}else ei(n)||(i=p.nextTabbableNode(t))}}else i=l("fallbackFocus");return i},y=function(e){var t=si(e);c(t,e)>=0||(oi(s.clickOutsideDeactivates,e)?n.deactivate({returnFocus:s.returnFocusOnDeactivate}):oi(s.allowOutsideClick,e)||e.preventDefault())},v=function(e){var t=si(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var o=!0;if(a.mostRecentlyFocusedNode)if(Fa(a.mostRecentlyFocusedNode)>0){var i=c(a.mostRecentlyFocusedNode),l=a.containerGroups[i].tabbableNodes;if(l.length>0){var d=l.findIndex(function(e){return e===a.mostRecentlyFocusedNode});d>=0&&(s.isKeyForward(a.recentNavEvent)?d+1<l.length&&(r=l[d+1],o=!1):d-1>=0&&(r=l[d-1],o=!1))}}else a.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return Fa(e)>0})})||(o=!1);else o=!1;o&&(r=m({target:a.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(a.recentNavEvent)})),f(r||a.mostRecentlyFocusedNode||u())}a.recentNavEvent=void 0},g=function(e){(s.isKeyForward(e)||s.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.recentNavEvent=e;var n=m({event:e,isBackward:t});n&&(ei(e)&&e.preventDefault(),f(n))}(e,s.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===oi(s.escapeDeactivates,e)||(e.preventDefault(),n.deactivate())},x=function(e){var t=si(e);c(t,e)>=0||oi(s.clickOutsideDeactivates,e)||oi(s.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},w=function(){if(a.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n._setPausedState(!0)}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)}(o,n),a.delayInitialFocusTimer=s.delayInitialFocus?ri(function(){f(u())}):f(u()),r.addEventListener("focusin",v,!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",g,{capture:!0,passive:!1}),r.addEventListener("keydown",b),n},_=function(){if(a.active)return r.removeEventListener("focusin",v,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",x,!0),r.removeEventListener("keydown",g,!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===a.mostRecentlyFocusedNode})})&&f(u())}):void 0,S=function(){C&&(C.disconnect(),a.active&&!a.paused&&a.containers.map(function(e){C.observe(e,{subtree:!0,childList:!0})}))};return n={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=i(e,"onActivate"),n=i(e,"onPostActivate"),o=i(e,"checkCanFocusTrap");o||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=p(r),null==t||t();var s=function(){o&&d(),w(),S(),null==n||n()};return o?(o(a.containers.concat()).then(s,s),this):(s(),this)},deactivate:function(e){if(!a.active)return this;var t=Za({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,_(),a.active=!1,a.paused=!1,S(),function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&!e[e.length-1]._isManuallyPaused()&&e[e.length-1]._setPausedState(!1)}(o,n);var r=i(t,"onDeactivate"),c=i(t,"onPostDeactivate"),l=i(t,"checkCanReturnFocus"),u=i(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){ri(function(){u&&f(h(a.nodeFocusedBeforeActivation)),null==c||c()})};return u&&l?(l(h(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return a.active?(a.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,e)):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return a.containers=t.map(function(e){return"string"==typeof e?r.querySelector(e):e}),a.active&&d(),S(),this}},Object.defineProperties(n,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(e,t){if(a.paused===e)return this;if(a.paused=e,e){var n=i(t,"onPause"),r=i(t,"onPostPause");null==n||n(),_(),S(),null==r||r()}else{var o=i(t,"onUnpause"),s=i(t,"onPostUnpause");null==o||o(),d(),w(),S(),null==s||s()}return this}}}),n.updateContainerElements(e),n};const ci=({children:e,onClose:t,fallBackFocusRef:n,"aria-label":r,"aria-labelledby":o})=>{const s=oa(),a=(0,Zo.useRef)(null),i=(0,Zo.useRef)(null),[c,l]=(0,Zo.useState)(!1);return(0,Zo.useEffect)(()=>(c&&a.current&&(i.current=ii(a.current,{initialFocus:n.current||void 0}),i.current.activate()),()=>{i.current&&i.current.deactivate()}),[c,n]),(0,Zo.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()}},[c]),(0,Zo.useEffect)(()=>{c&&a.current&&a.current.addEventListener("keydown",e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()})},[c,t]),(0,Zo.useLayoutEffect)(()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",s),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),r&&t.setAttribute("aria-label",r),o&&t.setAttribute("aria-labelledby",o),e.appendChild(t),a.current=t,l(!0),()=>{a.current&&(e.removeChild(a.current),a.current=null)}},[r,o,s]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>a.current&&(0,Qo.render)(e,a.current)}):a.current&&(0,Qo.render)((0,Qo.toChildArray)(e).filter(Nn).map(e=>(e.props={...e.props,onClose:t},e)),a.current)},li=({url:e,description:t,onClose:n})=>{const r=gn(),o=ta(),s=Gs(),a=(0,Zo.useRef)(null),{t:i}=hs(),c=["modal",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];"function"!=typeof s?c.push(...s):c.push(...s(r));const l=e=>{e.stopPropagation()},u=()=>{n()},d=r?.zIndex?{zIndex:r.zIndex+1}:void 0;return(0,Ls.jsx)(ci,{onClose:n,"aria-label":i("lightbox.heading"),fallBackFocusRef:a,children:({onClose:n,modalRenderFn:r})=>r((n=>(0,Ls.jsx)("div",{className:Ws(c),onClick:u,style:d,children:(0,Ls.jsxs)("div",{className:Ws("modal__float"),tabIndex:-1,onMouseDown:o,onKeyDown:o,onTouchStart:o,onMouseMove:o,onWheel:o,onPointerDown:o,onPointerMove:o,ref:a,children:[(0,Ls.jsx)("div",{className:Ws("modal__inner"),onClick:l,children:(0,Ls.jsx)("img",{className:Ws("modal__image"),src:e,alt:t})}),(0,Ls.jsxs)("button",{type:"button",className:Ws("modal__close"),onClick:n,children:[(0,Ls.jsx)(da,{name:"close",size:"16",alt:""}),i("lightbox.closeLabel")]})]})}))(n))})},ui=({description:e,url:t})=>{const{t:n}=hs(),[r,o]=(0,Zo.useState)(!1);return(0,Ls.jsxs)(Ls.Fragment,{children:[(0,Ls.jsxs)("button",{type:"button",className:Ws("modal__enlarge"),onClick:()=>{o(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),(0,Ls.jsx)(da,{name:"enlarge",size:"32",alt:""})]}),r&&(0,Ls.jsx)(li,{url:t,description:e,onClose:()=>{o(!1)}})]})},di=({originMessage:e,transactionId:t})=>{const{emitEvent:n,sendAction:r}=Ss();return o=>{if(o.target&&o.target.dataset.linkId){const s={type:"navigate",originMessage:e,transactionId:t,link:{id:o.target.dataset.linkId,url:o.target.getAttribute("href")}};r(s),n(`action.${s.type}`,s)}}},pi=({event:e,...t})=>{const{body:n}=Vs(e),r=di({originMessage:e.payload.id,transactionId:e.payload.transactionId}),o=(0,Zo.useMemo)(()=>e.payload.optimisticallyInjected?{children:(0,Ls.jsx)("p",{children:n?.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:n?.text||""}}},[n,e]);return(0,Ls.jsx)(ia,{type:"text",event:e,onClick:r,...t,...o})},fi="PROCESSING_IMAGE",hi=({img:e,filename:t})=>{const{t:n}=hs(),r=n("fileUpload.srFileUploadedText",{fileName:t});return(0,Ls.jsx)(Ls.Fragment,{children:(0,Ls.jsxs)("span",{className:Ws(["download","download--preview"]),children:[(0,Ls.jsx)("img",{src:e,alt:r}),(0,Ls.jsx)("span",{"aria-hidden":"true",className:Ws("file-download"),children:t})]})})},mi=({children:e,fileId:t,isDeleted:n,onClickHandler:r,url:o,target:s})=>t&&!n?(0,Ls.jsx)("button",{type:"button",onClick:r,className:Ws(["download","download-link"]),children:e}):o?(0,Ls.jsx)("a",{href:o,download:!0,target:s,className:Ws(["download","download-link"]),children:e}):(0,Ls.jsx)("span",{className:Ws("download"),children:e}),yi={message:{choice_prompt:({event:e,children:t,...n})=>{const{t:r}=hs(),o=oa(),{body:s,subEvent:a,showOptions:i,chooseAgain:c,onChoiceClickHandler:l,onChooseAgainClickHandler:u}=xa(e);return(0,Ls.jsxs)(Ls.Fragment,{children:[(0,Qo.toChildArray)(t).filter(Nn).map(e=>(e.props={...e.props,event:a,id:o,showTranslationToggle:!1},e)),c&&(0,Ls.jsxs)("button",{type:"button",className:Ws("button","button--secondary","button--choose-again"),"aria-expanded":i?"true":"false",onClick:u,"aria-describedby":o,children:[r(i?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,Ls.jsx)(da,{name:"chevronDown",size:"8",alt:""})]}),i&&(0,Ls.jsx)(ia,{type:"choice-prompt",showParticipant:!1,event:e,...n,children:(0,Ls.jsx)("ul",{className:Ws("choice-prompt","choice-prompt--many"),children:s?.choices?.map(e=>(0,Ls.jsx)("li",{className:Ws("choice-prompt__item",{[`choice-prompt__item--${e?.category}`]:!!e.category}),children:(0,Ls.jsx)("button",{type:"button",className:Ws("button","button--primary"),onClick:()=>{l(e)},children:e.text})},e.id))})})]})},text:pi,image:({event:e,descriptorId:t,...n})=>{const{body:r}=Vs(e),[o,s]=(0,Zo.useState)(!1),a=Jo();return(0,Ls.jsxs)(ia,{event:e,type:"image",...n,children:[(0,Ls.jsx)("img",{src:r?.url,id:t,alt:r?.description||void 0,onLoad:()=>{a(yo(e.payload.id)),s(!0)}}),r?.isZoomable&&o&&(0,Ls.jsx)(ui,{description:r?.description,url:r?.url})]})},splash:({event:e,...t})=>{const{payload:n}=e,{body:r}=Vs(e),o=di({originMessage:n.id,transactionId:n.transactionId});return(0,Ls.jsx)(ia,{type:"splash",event:e,onClick:o,...t,bodyProps:{dangerouslySetInnerHTML:{__html:r?.text||""}}})},video:({event:e,descriptorId:t,...n})=>{const{body:r}=Vs(e);return qs(e).push("message--type-video"),(0,Ls.jsxs)(ia,{event:e,type:"video",...n,children:[(0,Ls.jsx)("div",{id:t,className:Ws("visually-hidden"),children:r?.description}),(0,Ls.jsx)("iframe",{title:r?.description||"",src:r?.url,allow:"autoplay; encrypted-media",allowFullScreen:!0})]})},upload:({event:e,...t})=>{const{t:n}=hs(),{body:r}=Vs(e),{fromClient:o,id:s}=e.payload,{filename:a,id:i,isDeleted:c,url:l}=r,u=ws(),d=(e=>{const{processingFileUploads:t}=vn(({state:e})=>e);return(0,Zo.useMemo)(()=>{if(t.some(t=>t===e))return fi;try{return sessionStorage.getItem(`image-${e}`)}catch(e){return}},[e,t])})(s),p=(0,Zo.useMemo)(()=>n(c||!l&&!i?"fileUpload.srFileUploadedText":"fileUpload.srFileDownloadText",{fileName:a}),[l,i,a,c,n]);return(0,Ls.jsx)(ia,{event:e,type:"upload",...t,children:d&&d!==fi?(0,Ls.jsx)(hi,{img:d,filename:a}):(0,Ls.jsxs)(mi,{fileId:i,isDeleted:c,onClickHandler:()=>{i&&a&&u.downloadFile(i,a)},url:l,target:o?void 0:"_blank",children:[(0,Ls.jsx)(da,{name:"download",size:"16",alt:p}),(0,Ls.jsx)("span",{"aria-hidden":"true",className:Ws("file-download"),children:a})]})})},carousel:({event:e})=>{const{body:t}=Vs(e),n=t.cards;return(0,Ls.jsx)(ia,{event:e,modifiers:"type-carousel",children:(0,Ls.jsx)(va,{items:n,getItemKey:ga,getItemLabel:ba})})},card:({event:e})=>{const{body:t}=Vs(e),n=oa();return(0,Ls.jsx)(ia,{type:"card",event:e,children:(0,Ls.jsx)(ca,{id:n,...t})})}},info:{text:pi,divider:({event:e,...t})=>{const n=ja[U[e.payload.body.subtype]]||ja.default;return(0,Ls.jsx)(n,{event:e,...t})},translation:({event:e,...t})=>{const{t:n}=hs(),{body:r}=Vs(e);return(0,Ls.jsx)(ia,{type:"text",event:e,...t,children:n(r.key.join("."),r.variables)})},timeIndicator:Na},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},o=!!t,s=vn(zs(e));return{body:s&&o?t:r,hasTranslation:o,isTranslated:s&&o,userLocale:n?.locale}})(e);return n?(0,Ls.jsx)(Sa,{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,Zo.useState)(!0),o=Jo(),s=vs(),{addMessageBubble:a,emitEvent:i,sendAction:c}=Ss(),l=Cs(),{suggestions:u,payload:d}=(e=>{const{payload:t}=e,{body:n}=Vs(e);return{suggestions:n,payload:t}})(e),{showSuggestions:p}=gn(),f=An(),{t:h}=hs(),m=h("suggestions.headingText"),y=h("suggestions.footerText"),v=(0,Zo.useMemo)(()=>f.some(({payload:e,type:t})=>"message"===t&&e?.transactionLast),[f]),g=(0,Zo.useCallback)(({id:e,question:t})=>{if(!l())return;r(!1),o(ur(!0));const n=z(),s={type:T,originMessage:d.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n};c(s),a(t,n),i(`action.${s.type}`,s)},[a,o,i,l,d.id,c]);return n&&!s&&v&&p?(0,Ls.jsxs)("div",{className:Ws("suggestions","suggestions--conversation"),children:[m&&(0,Ls.jsx)("p",{className:Ws("suggestions__heading"),children:m}),(0,Ls.jsxs)(ia,{type:"suggestions",showParticipant:!1,event:e,...t,children:[(0,Ls.jsx)(Ca,{className:"suggestions__list--conversation",onClickSuggestion:g,suggestions:u}),y&&(0,Ls.jsx)("p",{className:Ws("suggestions__footer"),children:y})]})]}):null}}},vi=({children:e})=>{const{customComponents:t}=gn(),n=(0,Zo.useMemo)(()=>Object.keys(yi).reduce((e,n)=>(e[n]={...yi[n],...t?t[n]:{}},e),{fallback:pi}),[t]);return(0,Ls.jsx)(As.Provider,{value:n,children:e})},gi=({children:e})=>{const{isMinimized:t}=ms(),n=(0,Zo.useRef)(0),{sendAction:r}=Ss(),{hasCountdown:o,isActive:s,stopCountdown:a}=na(),i=(0,Zo.useCallback)(()=>{if(t)return;const e=(new Date).getTime(),i=()=>{r({type:"interactivity_update"}),n.current=e};o&&s&&(i(),a()),e-n.current>15e3&&i()},[r,o,s,a,t]);return(0,Ls.jsx)("div",{className:Ws("activity-monitor"),tabIndex:-1,onMouseDown:i,onKeyUp:i,onTouchStart:i,onMouseMove:i,onWheel:i,onPointerDown:i,onPointerMove:i,children:(0,Ls.jsx)(ea.Provider,{value:i,children:e})})},bi=["text","choice_prompt","image","video"],xi=()=>{const e=Ks(),t=(0,Zo.useRef)(),n=(0,Zo.useRef)(),r=Jo(),o=xs(),s=(0,Zo.useRef)(null),{initCountdown:a,endCountdown:i}=na(),{emitEvent:c}=Ss(),{hasPrompt:l,continueChat:u}=ra(),d=(0,Zo.useRef)(l);return(0,Zo.useEffect)(()=>{d.current=l},[l]),(0,Zo.useEffect)(()=>{e.socket&&(e.onConnection(({currentState:e})=>{if("attach_channel_erred"===e){const e=new v;return r(Pr({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 pr(e);r(Pr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r(Kr())}),e.onOpen(()=>{r(Mr())}))},[e,e.socket,r]),(0,Zo.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&&a(e.payload.body.duration);break;case"loading":r(mo(e.payload.body.loading));break;case"idle_detach_countdown_elapsed":i(void 0,!0);break;case"resume_conversation_prompt":r(to());break;case"user_first_response":r(ur(!0)),c("system.userFirstResponse",e.payload.body);break;case"translation_proposal":r(Vo(e.payload.body))}break;case"service_attach":{const{service:{name:t,settings:{proactiveMessages:{enabled:n},entry:o},sessionId:s}}=e.payload;r(Lo(n||!1)),t&&c("system.serviceChanged",t),s&&r(oo(s)),r(xo(o)),r(co({uploads:{enabled:o.options?.upload?.enabled||!1}}));break}case"context":e.payload.contentLocale&&e.payload.userLocale&&r(jr(e.payload.userLocale));break;case"message":switch(e.payload.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"custom":case"carousel":case"card":if(e.payload.service&&e.payload.service.serviceSessionId&&r(oo(e.payload.service.serviceSessionId)),e.payload.fromClient){r(Gr(e));break}d.current&&u(),r(Wr(e))}break;case"participant":(e=>{const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:o}=t;!n&&"string"!=typeof o&&o?.name&&r(uo(o.name)),r(vo(t)),"string"!=typeof o&&o.introduction&&r(Wr({...e,payload:{...t,type:"participant"}}))})(e);break;case"service_data":e.payload.persist&&r(bo(e.payload));break;case"info":"divider"!==e.payload.type&&"text"!==e.payload.type&&"translation"!==e.payload.type||r(Wr({type:"info",payload:{...e.payload,participant:null}}));break;case"error":switch(e.payload.type){case"find_conversation":{const t=new g(e);r(Pr({name:t.name,action:t.action,message:t.message,originalEvent:t.originalEvent,originalError:t.originalError}));break}case"conversation":{const t=new v(e);r(Pr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError,action:t.action}));break}}}return e},e.onMessage(n.current),!0))},[u,e,r,c,i,o,a]),(0,Zo.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(Lr(e)).unwrap();t&&"service"in t&&r(fo(t))}catch(e){}return bi.includes(e?.type)?(e.id!==s.current&&o.emit("message",e),s.current=e.id,e):e},e.addListener("message",t.current),!0))},[e,r,o]),null},wi=({children:e})=>{const{t}=hs(),n=Jo(),r=ws(),{addUploadBubble:o}=Ss(),s=(0,Zo.useCallback)(async(e,t)=>{n(Eo(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),o=new Image;o.src=r,await o.decode();const s=(e=>{const t=document.createElement("canvas"),n=t.getContext("2d"),[r,o]=(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=o,n?.drawImage(e,0,0,r,o),t.toDataURL()})(o);try{sessionStorage.setItem(`image-${t}`,s)}catch(e){}finally{n(jo(t))}},[n]),a=(0,Zo.useCallback)(e=>{const a=z(),i=r.uploadFile(e,e=>{n(So({fileId:a,progress:Math.ceil(e)}))},async t=>{const{id:r,transactionId:i,occurredAt:c,body:{contentType:l,filename:u,filesize:d}}=t;n(_o(a)),o(r,i,c,l,u,d),l.includes("image/")&&await s(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(Co({fileId:a,errorText:r}))});n(no({fileId:a,fileName:e.name,uploadHandle:i}))},[s,o,r,n,t]);return(0,Ls.jsx)(Js.Provider,{value:a,children:e})},_i=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=na();return((e,t)=>{const n=(0,Zo.useRef)(e);(0,Zo.useEffect)(()=>{n.current=e},[e]),(0,Zo.useEffect)(()=>{if(null!==t){const e=setInterval(function(){n.current()},t);return()=>clearInterval(e)}},[t])})(()=>{r()},e&&t&&n&&n>0?1e3:null),null},Ci=()=>{const{initUserSelectedOptions:e}=Qs(),t=(0,Zo.useRef)(!1),n=gn();return(0,Zo.useEffect)(()=>{n.api&&!t.current&&(t.current=!0,e())},[e,n]),null};function Si(e,t,n=[]){const r=xs(),o=(0,Zo.useRef)(t);(0,Zo.useEffect)(()=>{if(!n.every(Boolean))return;const t=(...e)=>o.current?.(...e);return r.emit("function.register",e,t),()=>r.emit("function.unregister",e,t)},[r,e,...n])}const Ei=()=>{const e=gn(),{emitEvent:t,sendAction:n,sendContext:r,sendMessage:o}=Ss(),s=Jo(),{setVisibility:a,visible:i}=ms(),c=(0,Zo.useRef)(i),l=xs(),u=ws(),d=Mn(),p=(0,Zo.useRef)(null),f=(0,Zo.useRef)(null),{isInline:h,isResolving:m}=$n(),y=vn(Is),v=(()=>{const{get:e}=_s();return e?e("conversationUrl"):null})(),g=(0,Zo.useRef)(null),b=ta(),{enableTranslations:x,disableTranslations:w}=Bs();return(0,Zo.useEffect)(()=>{c.current=i},[i]),Si("askText",e=>{o({body:e})},[u.send]),Si("setVariables",e=>{r({variables:e})},[u.send]),Si("getVisibility",e=>{e?e(c.current):console.warn("A callback function is required for the getVisibility action.")}),Si("setVisibility",e=>{const t="string"==typeof e||null===e?e:e.visibility;Object.values(Kt).includes(t)?(b(),a(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')},[e.api]),Si("sendCustomAction",(e,r)=>{const o={type:"custom",body:{type:e,body:r}};n(o),t(`action.${o.type}`,o)},[u.send]),Si("setTopic",({name:e,fallbackMessage:t,message:r,userTriggered:o})=>{o&&s(sr({showSuggestions:!1})),e&&t?n({type:k,body:{name:e,fallbackMessage:t,message:r}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")},[u.send]),Si("setContext",e=>{r(e)},[u.send]),Si("setTranslation",({enabled:e,locale:t})=>{e?x(t,A):w()},[u.send]),(0,Zo.useEffect)(()=>{m||y||(g.current&&g.current!==v&&l.emit("unreadMessageCount",d),i===Kt.open&&i!==f.current&&0!==p.current&&l.emit("unreadMessageCount",0),i!==Kt.open&&d!==p.current&&l.emit("unreadMessageCount",d),f.current=i,p.current=d,"string"==typeof v&&(g.current=v))},[d,i,l,h,m,y,v]),null},ji=({children:e})=>{const t=xs(),n=(0,Zo.useRef)(null),[r,o]=(0,Zo.useState)(),s=(0,Zo.useRef)(!0),a=(0,Zo.useCallback)(e=>{s.current&&(o(e),t.emit("aria-live",e))},[o,t]);return(0,Zo.useEffect)(()=>(n.current=null,r?.messageText&&(n.current=setTimeout(()=>{a({}),n.current&&clearTimeout(n.current)},600)),()=>{n.current&&clearTimeout(n.current)}),[r,a]),(0,Zo.useEffect)(()=>()=>{s.current=!1},[]),(0,Ls.jsxs)(Es.Provider,{value:a,children:[e,(0,Ls.jsxs)("div",{className:Ws("app__live-container"),children:[(0,Ls.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:Ws("visually-hidden"),children:r?.ariaLive===P?r?.messageText:null}),(0,Ls.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:Ws("visually-hidden"),children:r?.ariaLive===M?r?.messageText:null})]})]})},Ti=()=>{const{t:e}=hs(),t=On().historyLoaded,{sendPolite:n}=js();return(0,Zo.useEffect)(()=>{t&&setTimeout(()=>{n(e("window.srTexts.onHistoryLoad"))},500)},[t,e,n]),null},Ii=()=>{const{t:e}=hs(),{isOpen:t,isVisible:n}=ms(),r=Mn(),{sendPolite:o}=js(),s=(0,Zo.useMemo)(()=>xn(o,2e3),[o]),a=(0,Zo.useRef)(null),i=(0,Zo.useRef)(null);return(0,Zo.useEffect)(()=>{a.current!==n&&!n&&i.current&&i.current(),0!==r&&!t&&n&&(i.current=s(e("message.srTextUnreadCount",{unreadCount:r}))),a.current=n},[r,t,n,s,e]),null},Ni=({store:e,children:t,eventBus:n,api:r})=>((0,Zo.useErrorBoundary)(t=>{console.error(t),e.dispatch(hr(t))}),(0,Ls.jsx)(cn,{store:e,children:(0,Ls.jsx)(bs.Provider,{value:n,children:(0,Ls.jsx)(gs.Provider,{value:r,children:(0,Ls.jsx)(ji,{children:(0,Ls.jsx)(Rs,{children:(0,Ls.jsxs)(vi,{children:[(0,Ls.jsx)(Ci,{}),(0,Ls.jsx)(xi,{}),(0,Ls.jsx)(Ii,{}),(0,Ls.jsx)(Ti,{}),(0,Ls.jsx)(_i,{}),(0,Ls.jsxs)(gi,{children:[(0,Ls.jsx)(Ei,{}),(0,Ls.jsx)(wi,{children:t})]})]})})})})})})),ki=Ht(Rn,e=>e.filter(e=>Fr(e)&&"service_data"!==e.type&&e.payload?.messageStatus===E)),Oi=Ht([ki],e=>e.filter(e=>"participant"!==e.type).at(-1)),Li=Ht(ki,e=>e.filter(({payload:e})=>e?.id).map(({payload:e})=>e.id)),Ri=Ht(({state:e})=>e.options.features?.webNotifications,e=>e?.enabled),Ai=()=>{const{t:e}=hs(),{showDisclaimer:t}=gn();return t?(0,Ls.jsxs)("div",{className:Ws("disclaimer"),tabIndex:0,children:[(0,Ls.jsx)("h2",{className:Ws("disclaimer__title"),children:e("disclaimer.title")}),(0,Ls.jsx)("div",{className:Ws("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]}):null},Pi=Ht([({forms:e})=>e,(e,{formId:t})=>t],(e,t)=>e[t]),Mi=Ht(Pi,e=>e?.controls||{}),Ui=Ht(Mi,e=>{const t={};return Object.entries(e).forEach(([e,{value:n}])=>{t[e]=n}),t}),Di=Ht([Mi,(e,{name:t})=>t],(e,t)=>e[t]?.value),Fi=Ht([Mi,(e,{name:t})=>t],(e,t)=>e[t]?.touched),zi=(0,Qo.createContext)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),{Provider:Bi,Consumer:Vi}=zi,$i=zi;function Hi(){return(0,Zo.useContext)($i)}function Wi(e){const t=Jo(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:s}=Hi(),a=!!vn(e=>Pi(e,{formId:n})),i=vn(t=>Di(t,{formId:n,name:e})),c=vn(t=>Fi(t,{formId:n,name:e})),l=s?.[e],u=!l;(0,Zo.useEffect)(()=>{a&&t(wr({formId:n,name:e}))},[a,n,e,t]),(0,Zo.useLayoutEffect)(()=>()=>{t(_r({formId:n,name:e}))},[a,n,e,t]);const d=(0,Zo.useCallback)(t=>r(e,t.target.value),[e,r]),p=(0,Zo.useCallback)(()=>{o(e,!0)},[o,e]);return[(0,Zo.useMemo)(()=>({name:e,onInput:d,onBlur:p,value:i}),[e,d,p,i]),(0,Zo.useMemo)(()=>({isValid:u,error:l,touched:c}),[u,l,c])]}function Gi(e){const{t}=hs(),{sendAssertive:n}=js(),{hasLimit:r,limit:o}=Vn(),s=(0,Zo.useMemo)(()=>xn(n,er),[n]),a=(0,Zo.useMemo)(()=>xn((e,n)=>{e&&s(t("input.srCharacterLimitText",{limit:n}))},er),[s,t]),[{value:i}]=Wi(e),c="number"==typeof o&&r&&i?o-i.length:o,l=!(!r||"number"!=typeof c)&&c<=Zn,u=!(!r||"number"!=typeof c)&&c<0;return(0,Zo.useEffect)(()=>{a(l,c)},[l,c,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}const qi=e=>{const{hasCharacterLimit:t,characterLimit:n}=Gi(e),{entryMeta:{active:r,optionsOverride:o}}=On();let s=null,a=null;r&&o&&"object"==typeof o[r]&&(s=o[r].label,a=o[r].placeholder);const{alwaysShowEntryLabel:i}=gn(),{t:c}=hs();return{placeholder:(0,Zo.useMemo)(()=>c("input.inputPlaceholder",{hasLimit:t,text:a||c("input.inputPlaceholderText"),limit:t?n:null}),[c,t,n,a]),label:(0,Zo.useMemo)(()=>c("input.inputLabel",{hasLimit:!s&&t,text:s||c("input.inputLabelText"),limit:!s&&t?n:null}),[c,t,n,s]),labelClass:(0,Zo.useMemo)(()=>!0===i||s?"label":"visually-hidden",[i,s])}};function Ki(){const{abortTransaction:e,clearEntryAbortTransaction:t}=(()=>{const e=Jo(),{entryMeta:{actions:t,translatedActions:n}}=On();return{abortTransaction:n?.abortTransaction||t?.abortTransaction,clearEntryAbortTransaction:()=>{e(wo())}}})(),n=ws();return e?(0,Ls.jsx)("li",{className:Ws(["cvco-conversation__item","cvco-conversation__item--abort-transaction"]),children:(0,Ls.jsx)("button",{className:Ws(["button","button--secondary","abort-transaction__button"]),type:"button",onClick:()=>{n.send("action",{type:k,body:{name:e.topicName,fallbackMessage:e.topicFallbackMessage}}),t()},children:e.label})}):null}const Ji=(0,Qo.createContext)(null),Xi=()=>{const e=(0,Zo.useContext)(Ji);if(!e)throw new Error("useChatScrollContext has to be used within <ChatScrollContext.Provider>");return e},Yi=Ji,Qi=e=>{const t=(()=>{const e=(0,Zo.useContext)(As);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],o=null;return"choice_prompt"===e.payload.type&&(o=n[e.payload.body.prompt.type]),"participant"===e.type&&(r=n[e.type]),r&&"function"!=typeof r&&(r=r[e.payload.body.type]),[r||t?.fallback,o]},Zi=({event:e,newParticipant:t})=>{const{eventRefs:n,unreadIds:r}=Xi(),{sendAction:o}=Ss(),s=e.payload.id?n[e.payload.id]:void 0,{containerRef:a,isVisible:i}=ys({containerRef:s,freezeOnceVisible:!0}),c=Jo(),[l,u]=Qi(e);if((0,Os.useEffect)(()=>{if(i&&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(ao(t)),o({type:"read",events:t})}},[c,e.payload.id,i,o,r]),!l)return null;const d=["conversation__item"];return"info"===e.type?d.push("conversation__item--source-info"):e.payload.fromClient?d.push("conversation__item--source-user"):d.push("conversation__item--source-agent"),t&&d.push("conversation__item--new-participant"),(0,Ls.jsxs)("li",{className:Ws(d),ref:a,children:[e.payload.timeIndicator&&(0,Ls.jsx)(Na,{event:e}),(0,Ls.jsx)(l,{event:e,children:(0,Ls.jsx)(u,{event:e})})]})},ec=()=>{const{t:e}=hs(),{sendPolite:t}=js(),{id:n,name:r}=Bn()||{};return(0,Zo.useEffect)(()=>{r&&t(e("typing.srText",{name:r}))},[r,t,e]),(0,Ls.jsx)("li",{className:Ws("conversation__item","conversation__item--source-agent"),children:(0,Ls.jsxs)("div",{className:Ws("message","message--source-agent","message--type-loading"),children:[(0,Ls.jsx)(aa,{eventPayload:{fromClient:!1,participant:n}}),(0,Ls.jsx)("div",{className:Ws("message__body"),children:(0,Ls.jsxs)("span",{className:Ws("loader"),children:[(0,Ls.jsx)("span",{className:Ws("loader__part","one")}),(0,Ls.jsx)("span",{className:Ws("loader__part","two")}),(0,Ls.jsx)("span",{className:Ws("loader__part","three")}),(0,Ls.jsx)("span",{className:Ws("loader__part","four")})]})})]})})},tc=()=>{const e=An();let t;return(0,Ls.jsx)(Ls.Fragment,{children:e.map(e=>{const{type:n,payload:r}=e;let o=!1;if("info"===n||"message"===n){const{participant:n,fromClient:s}=r,a=s?"seamly-client-participant":n;"info"!==e.type&&t!==a&&(o=!0),t=a}return(0,Ls.jsx)(Zi,{event:e,newParticipant:o},e.payload.key||e.payload.id)})})},nc=()=>{const{t:e}=hs(),t=Pn(),n=((e,t=20)=>{const[n,r]=(0,Zo.useState)(e),o=(0,Zo.useRef)(null);return(0,Zo.useEffect)(()=>(o.current=setTimeout(()=>r(e),t),()=>{o.current&&clearTimeout(o.current)}),[e,t]),n})(t,t?0:20),{isOpen:r}=ms(),o=Un(),s=Dn(),a=Ds();return(0,Ls.jsxs)(Ls.Fragment,{children:[r&&(0,Ls.jsx)("a",{id:o,className:Ws("skip-link"),href:`#${s}`,onClick:e=>{e.preventDefault(),a()},children:e("skiplinkText")}),(0,Ls.jsx)("div",{className:Ws("chat__body"),children:(0,Ls.jsxs)("div",{className:Ws("conversation__container"),children:[(0,Ls.jsx)(Ai,{}),(0,Ls.jsx)("div",{role:"log","aria-label":e("chat.srLabel"),children:(0,Ls.jsxs)("ol",{className:Ws("conversation"),children:[(0,Ls.jsx)(vi,{children:(0,Ls.jsx)(tc,{})}),n?(0,Ls.jsx)(ec,{}):null,(0,Ls.jsx)(Ki,{})]})})]})})]})};function rc(e,t){const n=(0,Zo.useRef)(null),r=(0,Zo.useRef)(e);return(0,Zo.useEffect)(()=>{r.current=e},[e]),(0,Zo.useEffect)(()=>"number"!=typeof t?()=>{}:(n.current=setTimeout(()=>r.current(),t),()=>{n.current&&clearTimeout(n.current)}),[t]),n}const oc={visible:Ws("transition--visible"),in:Ws("transition--in"),visuallyHidden:Ws("visually-hidden")},sc=Object.values(oc),ac=e=>{const t=(0,Zo.useRef)(null);t.current=e;const n="function"==typeof e;return(0,Zo.useMemo)(()=>n?(...e)=>t.current(...e):void 0,[n])},ic="notRendered",cc="rendered",lc="visuallyHidden",uc=({children:e,isActive:t,timeout:n=300,transitionStartState:r=ic,onInTransitionComplete:o=()=>{},onOutTransitionComplete:s=()=>{},exitAfter:a,enterDelay:i=0})=>{const c=(0,Zo.useRef)(!1),l=(0,Zo.useRef)(null),u=(0,Zo.useRef)(null),d=r===lc,[p,f]=(0,Zo.useState)(()=>d?[oc.visuallyHidden]:[]),[h,m]=(0,Zo.useState)(()=>0===i),y=(0,Zo.useMemo)(()=>a?a+i:a,[i,a]);rc(()=>m(!1),t?y:void 0),rc(()=>m(!0),t?i:void 0);const v=(0,Zo.useMemo)(()=>h&&t,[t,h]),g=ac(o),b=ac(s),x="notRendered"!==r||p.length>0;return(0,Zo.useEffect)(()=>(c.current&&!v&&(f([oc.visible]),l.current=setTimeout(()=>{f([...d?[oc.visuallyHidden]:[]]),b&&(u.current=requestAnimationFrame(()=>{b()}))},n)),!c.current&&v&&(f([oc.visible]),u.current=requestAnimationFrame(()=>{u.current=requestAnimationFrame(()=>{f([oc.visible,oc.in]),g&&(l.current=setTimeout(()=>{g()},n))})})),c.current=v,()=>{l.current&&clearTimeout(l.current),u.current&&cancelAnimationFrame(u.current)}),[d,g,b,n,v]),(0,Ls.jsx)(Ls.Fragment,{children:x&&(0,Qo.toChildArray)(e).filter(Nn).map(e=>{const{className:t=""}=e.props,n=t.split(" ").filter(e=>!sc.includes(e));return(0,Qo.cloneElement)(e,{className:[...n,...p].join(" ")})})})},dc=({isAside:e=!1})=>{const{isInline:t}=$n(),{t:n}=hs(),{addMessageBubble:r,emitEvent:o,sendAction:s}=Ss(),a=Cs(),{isOpen:i,setVisibility:c}=ms(),{showSuggestions:l}=gn(),u=oa(),d=Ds(),p=(0,Zo.useRef)(null),{sendPolite:f}=js(),h=vn(Is),{hasCountdown:m,endCountdown:y}=na(),{hasPrompt:v,continueChat:g}=ra(),b=vs(),x=On().serviceData.suggestion;const{body:w}=Vs({payload:x,type:"service_data"}),_=(0,Zo.useMemo)(()=>h?[]:Array.isArray(w)?w:[],[w,h]),C=(0,Zo.useRef)(),S=(0,Zo.useRef)(!1),E=(0,Zo.useRef)(),j=!!_?.length,I=t?(b||i)&&!e:b,N=(0,Zo.useRef)(I),k=j&&!I&&l,O=j?_:E.current;E.current=O;const L=(0,Zo.useMemo)(()=>{const t=["suggestions"];return e&&t.push("suggestions--aside"),Ws(t)},[e]),R=(0,Zo.useCallback)(({id:e,question:t})=>{if(!a())return;m&&y(!0),v&&g();const n=z(),l={type:T,originMessage:x.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n};s(l),r(t,n),o(`action.${l.type}`,l),i||c({visibility:Kt.open}),d()},[r,g,y,o,d,a,m,v,i,x,s,c]);(0,Zo.useEffect)(()=>{if(C.current!==_&&!I){if(j){const e=S.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout(()=>{f(e)},30)}else S.current&&f(n("suggestions.srUnavailableText"));C.current=_}!N.current&&I?(In(p.current,d),f(n("suggestions.srUnavailableText"))):!j&&S.current&&In(p.current,d),S.current=j,N.current=I},[_,j,I,d,f,n]);const A=n("suggestions.headingText"),P=n("suggestions.footerText"),M=A?"section":"div";return(0,Ls.jsx)(uc,{isActive:!!k,transitionStartState:ic,children:(0,Ls.jsxs)(M,{className:L,"aria-labelledby":A?u:void 0,ref:p,children:[A&&(0,Ls.jsx)("p",{id:u,className:Ws("suggestions__heading"),children:A}),!!O&&(0,Ls.jsx)(Ca,{suggestions:O,onClickSuggestion:R}),P&&!i&&(0,Ls.jsx)("p",{className:Ws("suggestions__footer"),children:P})]})})},pc=(0,Os.forwardRef)(({children:e,className:t=""},n)=>{const r=(0,Os.useRef)(null),{closeChat:o,isOpen:s,isVisible:a}=ms(),i=Fs(),{namespace:c,layoutMode:l}=gn(),{isInline:u}=$n(),d=Gs(),p=oa(),f=oa(),h=vs(),{t:m}=hs(),y=["chat",`chat--layout-${l}`,`namespace--${c}`,t];return"function"!=typeof d&&y.push(...d),s||"app"===l||y.push("chat--collapsed"),h&&y.push("chat--user-responded"),(0,Os.useEffect)(()=>(a&&"window"===l&&(r.current=ii(`#${p}`,{initialFocus:!1,clickOutsideDeactivates:!0}),r.current.activate()),()=>{r.current&&r.current.deactivate()}),[p,a,l]),a&&(0,Ls.jsxs)("section",{id:p,className:Ws(y),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!u&&s&&(o(),i())},tabIndex:-1,ref:n,role:"window"===l?"dialog":void 0,"aria-labelledby":f,children:[(0,Ls.jsx)("h2",{className:Ws("chat__title","visually-hidden"),id:f,children:m("window.srModalLayoutLabel")}),(0,Ls.jsx)("div",{className:Ws("chat-wrapper"),children:e}),"inline"===l&&s&&(0,Ls.jsx)(dc,{isAside:!0})]})}),fc=({children:e,handleClose:t,title:n,closeButtonText:r,srCloseButtonText:o,id:s})=>{const a=oa();return(0,Ls.jsxs)("section",{tabIndex:-1,id:s,"aria-labelledby":n?a:void 0,className:Ws("chat-status",n?void 0:"chat-status--condensed"),children:[(0,Ls.jsxs)("div",{className:Ws("chat-status__body"),children:[n?(0,Ls.jsx)("h2",{className:Ws("chat-status__title"),id:a,children:n}):null,e]}),"function"==typeof t&&(0,Ls.jsxs)("button",{type:"button",onClick:t,className:Ws("button","button--tertiary","chat-status__close"),children:[r||(0,Ls.jsx)(da,{name:"close",size:"16",alt:""}),o&&(0,Ls.jsx)("span",{className:Ws("visually-hidden"),children:o})]})]})},hc=({handleClick:e,icon:t,title:n,srButtonText:r})=>(0,Ls.jsxs)("button",{type:"button",onClick:e,className:Ws("button","button--primary","chat-status__button"),children:[(0,Ls.jsx)(da,{name:t,size:"16",alt:""}),n,r&&(0,Ls.jsx)("span",{className:Ws("visually-hidden"),children:r})]});function mc(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=(()=>{const{isActive:e,languages:t}=Bs(),n=Jo(),{sendAction:r}=Ss(),{translationProposal:o}=vn(e=>e.translations),{enableTranslations:s}=Bs(),{isOpen:a}=ms(),{userLocale:i}=hs(),c=o?.proposedLocale,l=Hs(c),u=(0,Zo.useMemo)(()=>null!==o&&!e&&a&&i!==c&&t.some(e=>e.locale===c),[o,e,a,i,c,t]);return{activateTranslationProposal:()=>{o?.proposedLocale&&s(o.proposedLocale,R)},dismissTranslationProposal:()=>{r({type:N,body:{type:L}}),n($o())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:o}})(),{id:o}=$s();return e&&t?(0,Ls.jsx)(fc,{handleClose:n,srCloseButtonText:t.srDismissButtonText,id:o,title:t.titleLabel,children:(0,Ls.jsx)(hc,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})}):null}function yc(){const e=vn(Is),{isActive:t}=Bs();return e||t?null:(0,Ls.jsx)(mc,{})}const vc=({label:e,checked:t,description:n,onChange:r,id:o,itemClassName:s})=>(0,Ls.jsxs)("li",{className:Ws([s||"","translation-options__item"]),"aria-selected":t,role:"option",tabIndex:0,onClick:r,onKeyDown:e=>{"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),r())},id:o,children:[(0,Ls.jsx)(da,{name:"check",size:"16",alt:""}),e," ",n&&(0,Ls.jsxs)("span",{children:["(",n,")"]})]}),gc=({onChange:e,describedById:t})=>{const{context:{contentLocale:n}}=gn(),{t:r}=hs(),{languages:o,currentLocale:s,enableTranslations:a,disableTranslations:i}=Bs(),c=Ds(),l=t=>()=>{t&&(t===s||n===t?i():a(t,"translation_choice"),e(),c())},{primaryLanguages:u,remainingLanguages:d}=(0,Os.useMemo)(()=>o.reduce((e,t)=>{const r=t.locale===n,o=((e,t,n)=>t===e.locale||!t&&n)(t,s,r);t.locale!==n&&e.remainingLanguages.push({...t,checked:o,isOriginal:r});const a=e.remainingLanguages.findIndex(e=>e.locale===s);return(r||o&&a>4)&&e.primaryLanguages.push({...t,checked:o,isOriginal:r}),e},{primaryLanguages:[],remainingLanguages:[]}),[s,n,o]);return(0,Ls.jsxs)("ul",{"aria-describedby":t,role:"listbox",tabIndex:-1,className:Ws("translation-options"),children:[u.map(({locale:e,nativeName:t,checked:n,isOriginal:o},s)=>(0,Ls.jsx)(vc,{id:e,label:t,checked:n,description:o?r("translations.settings.original"):void 0,onChange:l(e),itemClassName:Ws({"translation-options__item--original":o,"translation-options__item--selected":n&&0!==s})},e)),d.map(({locale:e,nativeName:t,checked:n,isOriginal:o})=>(0,Ls.jsx)(vc,{id:e,label:t,checked:n,description:o?r("translations.settings.original"):void 0,onChange:l(e)},e))]})},bc=({className:e,children:t,onCancel:n,headingText:r,description:o,descriptionId:s,cancelButtonText:a,cancelButtonRef:i,disableButtonFocusing:c,position:l={horizontal:"left",vertical:"top"}})=>{const u=oa(),{hideOption:d}=Qs(),{focusButton:p}=Zs(),f=(0,Zo.useCallback)(()=>{d(),c||p()},[c,p,d]),h=(0,Zo.useCallback)(()=>{n&&n(),f()},[f,n]),m=(e=>{const t=(0,Zo.useRef)(null);return(0,Zo.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,Zo.useEffect)(()=>{Tn(m.current)},[m]),(0,Ls.jsx)("section",{className:Ws("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,Ls.jsxs)("div",{className:Ws("options__body"),children:[(0,Ls.jsx)("h2",{id:u,className:Ws("options__title"),children:r}),(0,Ls.jsxs)("button",{type:"button",onClick:h,"aria-describedby":u,className:Ws("button","options__close"),ref:e=>{i&&(i.current=e)},children:[(0,Ls.jsx)(da,{name:"close",size:"16",alt:""}),(0,Ls.jsx)("span",{children:a})]}),o?(0,Ls.jsx)("p",{className:Ws("options__description"),id:s,children:o}):null,(0,Ls.jsx)("div",{className:Ws("options__wrapper"),children:t})]})})},xc=function({onClose:e,position:t}){const{t:n}=hs(),r=oa();return(0,Ls.jsx)(bc,{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,Ls.jsx)(gc,{describedById:r,onChange:e})})};function wc({children:e,position:t={horizontal:"left",vertical:"top"},classNames:n=[]}){const[r,o]=(0,Zo.useState)(!1),s=(0,Zo.useRef)(null),a=oa();return(0,Ls.jsxs)("div",{className:Ws("translations__container"),onKeyDown:e=>{r&&jn(e)===En.Escape&&(o(!1),Tn(s.current))},children:[(0,Ls.jsx)(uc,{transitionStartState:ic,isActive:r,children:(0,Ls.jsx)("div",{className:Ws("options__dialog"),role:"dialog",children:(0,Ls.jsx)(xc,{onClose:()=>{o(!1)},position:t})})}),(0,Ls.jsx)("button",{type:"button",className:Ws(["button","chat__options__button",...n]),id:a,onClick:()=>{o(!r)},onKeyDown:e=>{jn(e)===En.ArrowDown&&(o(!0),e.preventDefault())},ref:s,"aria-haspopup":"dialog","aria-expanded":r,children:e})]})}const _c=({children:e,formId:t,persistData:n=!1,onError:r,onSubmit:o,validationSchema:s={},...a})=>{const i=Jo(),c=vn(e=>Ui(e,{formId:t})),[l,u]=(0,Zo.useState)(!1),[d,p]=(0,Zo.useState)({}),{isValid:f,errors:h}=function(e,t){const n=(0,Zo.useMemo)(()=>function(e,t={}){return Object.entries(t).reduce((t,[n,r])=>{const o=Array.isArray(r)?r:[r];for(let r=0;r<o.length;r++)if(!o[r].fn(e[n],o[r].compareValue)){t[n]=o[r].errorText;break}return t},{})}(e,t),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(c,s),m=(0,Zo.useMemo)(()=>({...h,...d}),[h,d]);(0,Zo.useLayoutEffect)(()=>{i(br({formId:t,persistData:n}))},[t,n,i]),(0,Zo.useEffect)(()=>()=>{i(xr({formId:t}))},[t,n,i]);const y=(0,Zo.useCallback)((e,n)=>{i(Cr({formId:t,name:e,value:n}))},[t,i]),v=(0,Zo.useCallback)((e,n)=>{i(Sr({formId:t,name:e,touched:n}))},[i,t]),g=(0,Zo.useCallback)((e,t)=>{p(n=>({...n,[e]:t}))},[p]),b=(0,Zo.useCallback)(e=>{e.preventDefault();const t="true"===e.submitter.getAttribute("aria-disabled");u(!t),!t&&f&&(i(ur(!0)),o(c,{updateControlValue:y,setError:g}))},[f,i,o,c,y,g]);(0,Zo.useEffect)(()=>{r&&r({errors:m,isSubmitted:l,isValid:0===Object.keys(m).length})},[l,m,r]);const x=(0,Zo.useMemo)(()=>({formId:t,values:c,errors:m,isValid:0===Object.keys(m).length,isSubmitted:l,handleSubmit:b,validationSchema:s,updateControlValue:y,updateControlTouched:v}),[t,c,m,l,b,s,y,v]);return t?o?(0,Ls.jsx)(Bi,{...a,value:x,children:e}):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)},Cc=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),Sc=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},Ec=e=>!!e?.length,jc=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))},Tc=e=>!!e,Ic=function({className:e,disableValidationClasses:t=!1,...n}){const{handleSubmit:r,isValid:o,isSubmitted:s}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=Hi();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),a=["form"];return!t&&s&&(a.push("form--submitted"),o?a.push("form--valid"):a.push("form--invalid")),(0,Ls.jsx)("form",{onSubmit:r,className:Ws([...a,e]),...n})};function Nc({id:e,error:t}){const[n,r]=(0,Zo.useState)(!1);return(0,Zo.useEffect)(()=>{const e=setTimeout(()=>r(!0),300);return()=>clearTimeout(e)},[]),(0,Ls.jsx)("div",{className:Ws("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&(0,Ls.jsxs)("span",{id:e,className:Ws("error__message"),children:[(0,Ls.jsx)(da,{name:"error",size:"16",alt:""}),t]})})}const kc=({contentHint:e,id:t,labelText:n,labelClass:r,validity:o,errorText:s,children:a})=>(0,Ls.jsxs)(Ls.Fragment,{children:[e&&(0,Ls.jsx)("span",{id:`${t}-content-hint`,className:Ws("input__content-hint"),children:e}),(0,Ls.jsx)(Nc,{id:`${t}-error`,error:!o&&s}),(0,Ls.jsxs)("div",{className:Ws("form-control__wrapper"),children:[(0,Ls.jsx)("label",{htmlFor:t,className:Ws(r),children:n}),a]})]}),Oc=function({id:e,name:t,type:n,labelText:r,labelClass:o,contentHint:s=null,focus:a,"aria-invalid":i,"aria-describedby":c,...l}){const u=(0,Zo.useRef)(null),{isSubmitted:d}=Hi(),[p,{error:f}]=Wi(t),h=d&&f,m=[];return c&&m.push(c),s&&m.push(`${e}-content-hint`),h&&m.push(`${e}-error`),(0,Zo.useLayoutEffect)(()=>{u.current&&a&&u.current.focus()},[a]),(0,Ls.jsx)(kc,{id:e,contentHint:s,validity:!h,errorText:f,labelText:r,labelClass:o,children:(0,Ls.jsx)("input",{...p,...l,ref:u,id:e,type:n,"aria-invalid":i||h?"true":"false","aria-describedby":m.join(" ")||void 0,name:t})})};function Lc({controlName:e,describedById:t}){const{t:n}=hs();return(0,Ls.jsxs)(Ic,{noValidate:"true",className:Ws("options__form"),children:[(0,Ls.jsx)(Oc,{id:"email-id",name:e,type:"email",autocomplete:"email",className:Ws("transcript__input"),"aria-describedby":t,labelClass:Ws("label"),labelText:n("options.sendTranscript.label")}),(0,Ls.jsx)("div",{className:Ws("options__actions"),children:(0,Ls.jsx)("button",{type:"submit",className:Ws("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const Rc="email",Ac={sendTranscript:()=>{const[e,t]=(0,Zo.useState)(void 0),{hideOption:n}=Qs(),{focusButton:r}=Zs(),{t:o}=hs(),s=oa(),{sendAction:a}=Ss(),i=(0,Zo.useMemo)(()=>({[Rc]:[Cc(Tc,o("options.sendTranscript.noEmailText")),Cc(jc,o("options.sendTranscript.invalidEmailText"))]}),[o]),c=(0,Zo.useCallback)(e=>{const t=e[Rc].trim();a({type:"send_transcript",body:{emailAddress:t}}),n(),r()},[a,n,r]),l=(0,Zo.useCallback)(({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)},[t]);return(0,Ls.jsx)(bc,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),description:o("options.sendTranscript.description"),descriptionId:s,position:{vertical:"top",horizontal:"right"},children:(0,Ls.jsx)(_c,{formId:"sendTranscript",onSubmit:c,validationSchema:i,onError:l,children:(0,Ls.jsx)(Lc,{controlName:Rc,describedById:s})})})}},Pc=()=>{const{optionActive:e}=Qs(),t=(0,Zo.useRef)(),n=Ac[t.current??e];return e&&(t.current=e),n?(0,Ls.jsx)(n,{}):null},Mc=()=>{const{t:e}=hs(),{menuOptions:t,showOption:n,panelActive:r,hideOption:o}=Qs(),{id:s}=Zs(),a=(0,Zo.useRef)(null),[i,c]=(0,Zo.useState)(!1),l=(0,Zo.useRef)(null),u=t.length,d=(0,Zo.useRef)([]),p=(0,Zo.useRef)(!1),f=u>1,h=t[0],m=(0,Zo.useMemo)(()=>h?.name?.trim().replace(/\s+/g,""),[h]);return(0,Zo.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]),(0,Zo.useEffect)(()=>{i&&!p.current&&requestAnimationFrame(async()=>{await Ps(60);const e=t.findIndex(e=>e.available),n=-1===e?0:e;d.current&&Tn(d.current[n])}),p.current=i},[i,t]),u?(0,Ls.jsxs)("div",{className:Ws("options__container"),onKeyDown:e=>{i&&(jn(e)===En.Escape&&(c(!1),Tn(l.current)),jn(e)===En.Home&&(d.current&&Tn(d.current[0]),e.preventDefault()),jn(e)===En.End&&(d.current&&Tn(d.current[u-1]),e.preventDefault()))},onFocusOut:()=>{f&&(a.current=setTimeout(()=>{c(!1)},200))},onFocusIn:()=>{a.current&&clearTimeout(a.current)},children:[(0,Ls.jsx)(uc,{transitionStartState:ic,isActive:r,children:(0,Ls.jsx)("div",{className:Ws("options__dialog"),children:(0,Ls.jsx)(Pc,{})})}),f&&(0,Ls.jsx)(uc,{isActive:i,transitionStartState:ic,children:(0,Ls.jsx)("ul",{className:Ws(["options__menu"]),role:"menu",tabIndex:-1,"aria-labelledby":s,children:t.map(({name:r,title:o,available:s},a)=>(0,Ls.jsx)("li",{className:Ws("options__menu__item"),role:"menuitem","data-testid":r,children:(0,Ls.jsxs)("button",{type:"button",ref:e=>{e&&(d.current[a]=e)},className:Ws(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(jn(e)===En.ArrowDown){const n=Math.min(u-1,t+1);d.current&&Tn(d.current[t===n?0:n]),e.preventDefault()}if(jn(e)===En.ArrowUp){const n=Math.max(0,t-1);d.current&&Tn(d.current[t===n?u-1:n]),e.preventDefault()}})(e,a),onKeyPress:e=>((e,n)=>{const r=String.fromCharCode(e.charCode);if(1!==r.length||!r.match(/\S/))return;let o=-1;t.forEach((e,t)=>{t>n&&e.title.charAt(0).toLowerCase()===r.toLowerCase()&&-1===o&&(o=t)}),-1!==o&&d.current&&Tn(d.current[o])})(e,a),onClick:()=>((e,t)=>{t&&(c(!1),n(e))})(r,s),"aria-disabled":!s,children:[(0,Ls.jsxs)("span",{className:Ws("button__text"),children:[o,!s&&" "]}),s?null:(0,Ls.jsx)("span",{className:Ws("button__state"),children:e("options.unavailableText")})]})},r))})}),(0,Ls.jsxs)("button",{type:"button",className:Ws(["button","button--secondary","chat__options__button",...!f&&m?[`chat__options__button--${m}`]:[]]),id:s,onClick:()=>{r&&o(),f?c(e=>!e):h.available&&!r&&n(h.name)},onKeyDown:f?e=>{jn(e)===En.ArrowDown&&(c(!0),e.preventDefault())}:void 0,ref:l,"aria-haspopup":!!f&&"menu","aria-expanded":!!f&&i,"aria-disabled":!f&&!h.available,children:[f?(0,Ls.jsx)(da,{name:"options",size:"32",alt:""}):null,(0,Ls.jsx)("span",{className:Ws("button__text"),children:f?e("options.openButtonText"):`${h.title}${h.available?"":" "}`}),f||h.available?null:(0,Ls.jsx)("span",{className:Ws("button__state"),children:e("options.unavailableText")})]})]}):null};function Uc(){const{menuOptions:e,allowOptionSelection:t}=Qs(),{isAvailable:n}=Bs(),r=vn(Is),{t:o,userLocale:s}=hs(),a=Hs(s);if(!n&&(!t||!e.length)||r)return null;const i=o("translations.settings.openButtonText",{hasLanguage:!!a,language:a});return(0,Ls.jsxs)("div",{className:Ws("chat__options"),children:[n&&(0,Ls.jsx)("div",{className:Ws("chat__options-item","chat__options-item--left"),children:(0,Ls.jsxs)(wc,{classNames:["button--secondary"],children:[(0,Ls.jsx)(da,{alt:i,name:"newTranslation",size:"16"}),(0,Ls.jsx)("span",{className:Ws("button__text"),children:i})]})}),t&&(0,Ls.jsx)("div",{className:Ws("chat__options-item","chat__options-item--right"),children:(0,Ls.jsx)(Mc,{})})]})}const Dc=()=>{const{scrollToRef:e,unreadIds:t}=Xi(),{isMinimized:n}=ms(),{t:r}=hs();return(0,Ls.jsx)(uc,{isActive:!!t.length&&!n,children:(0,Ls.jsx)("div",{className:Ws("unread-messages"),children:(0,Ls.jsxs)("button",{type:"button",className:Ws("button","button--primary"),onClick:e,children:[r("message.unreadMessagesCount",{unreadCount:t.length}),(0,Ls.jsx)(da,{name:"chevronDown",size:"32",alt:""})]})})})},Fc=({children:e})=>{const t=An(),n=(0,Zo.useMemo)(()=>t.reduce((e,t)=>t.payload.id?(e[t.payload.id]=(0,Qo.createRef)(),e):e,{}),[t]),{scrollToRef:r,scrollToBottom:o,containerRef:s,unreadIds:a}=(e=>{const t=(0,Zo.useRef)(null),[n,r]=(0,Zo.useState)(!0),o=vn(Li),s=An(),a=Pn(),{isOpen:i}=ms(),c=On().loadedImageEventIds,{processingFileUploads:l,isLastEventFromClient:u}=vn(({state:e})=>e);(0,Zo.useEffect)(()=>{const e=t.current;if(!e)return()=>{};const n=()=>{const{scrollHeight:t,scrollTop:n,clientHeight:o}=e,s=Math.abs(t-n-o)>10;r(!s)};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)},[]);const d=(0,Zo.useCallback)(()=>{requestAnimationFrame(async()=>{await Ps(30),t.current?.scrollTo({top:t.current?.scrollHeight,left:0,behavior:"auto"})})},[]);return(0,Zo.useEffect)(()=>{u&&d()},[u,d]),(0,Zo.useEffect)(()=>{n&&d()},[n,o,s,a,i,c,l,d]),{containerRef:t,unreadIds:o,scrollToRef:()=>{const n=o.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,Ls.jsx)(Yi.Provider,{value:{eventRefs:n,unreadIds:a,scrollToRef:r,scrollToBottom:o,containerRef:s},children:(0,Ls.jsxs)("div",{className:Ws("chat__container"),children:[(0,Ls.jsx)("div",{className:Ws("chat__container__scroll-area"),ref:s,children:e}),(0,Ls.jsx)(Dc,{})]})})},zc=({baseClassName:e,children:t,title:n})=>{const r=Dn(),o=oa();return(0,Ls.jsxs)("section",{id:r,className:Ws(e),"aria-describedby":o,tabIndex:-1,children:[(0,Ls.jsx)("h2",{className:Ws(`${e}__title`),id:o,children:n}),t]})},Bc=()=>{const{t:e}=hs(),t=Ds(),n=ta(),{emitEvent:r}=Ss(),{isActive:o,remaining:s,timer:a,endCountdown:i}=na(),c=!!s&&s>0,l=e(c?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,Ls.jsx)(zc,{baseClassName:"idle",title:l,children:c&&(0,Ls.jsxs)(Ls.Fragment,{children:[(0,Ls.jsx)("div",{className:Ws("idle__count-container"),children:o&&(0,Ls.jsxs)(Ls.Fragment,{children:[(0,Ls.jsx)("span",{className:Ws("idle__count-text"),children:e("idleDetachWarning.countdownText")}),(0,Ls.jsx)("span",{className:Ws("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",a)})]})}),(0,Ls.jsxs)("div",{className:Ws("idle__options"),children:[(0,Ls.jsx)("button",{type:"button",className:Ws("button","button--primary"),onClick:()=>{n(),i(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),(0,Ls.jsx)("button",{type:"button",className:Ws("button","button--primary"),onClick:()=>{i(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},Vc=()=>{const{t:e}=hs(),t=ta(),{name:n}=Bn()||{},{continueChat:r,restartChat:o}=ra();return(0,Ls.jsx)(zc,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:(0,Ls.jsxs)("div",{className:Ws("prompt__options"),children:[(0,Ls.jsx)("button",{type:"button",className:Ws("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),(0,Ls.jsx)("button",{type:"button",className:Ws("button","button--primary"),onClick:o,children:e("resumeConversationPrompt.detachButton")})]})})},$c=()=>{const{sendAction:e}=Ss(),{features:t}=Qs(),{typingPeekahead:n}=t||{},r=(0,Zo.useRef)(null),o=(0,Zo.useRef)(null),s=(0,Zo.useRef)(!1),a=(0,Zo.useRef)(null);(0,Zo.useEffect)(()=>()=>{a.current&&clearInterval(a.current),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current)},[]);const i=(t,r)=>{e({type:"typing",state:t,...n&&n.enabled?{body:{currentMessage:r}}:{}})};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(s.current=!0,a.current||(i(!0,e.target.value),a.current=setInterval(()=>{!s.current&&a.current?(clearInterval(a.current),a.current=null):n&&n.enabled&&i(!0,e.target.value)},2e3)),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current),r.current=setTimeout(()=>{s.current=!1},300),o.current=setTimeout(()=>{i(!1,e.target.value)},2e3))}},Hc=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:o}=On().entryMeta,s=Jo(),a=n||t||e,i=o&&o[a]||r&&r[a]||{},c=(0,Zo.useCallback)(e=>{s(so(e))},[s]),l=(0,Zo.useCallback)(e=>{s(ro(e))},[s]),u=(0,Zo.useCallback)(e=>{s(To(e))},[s]),d=(0,Zo.useCallback)(()=>{n?u(null):l(e)},[l,u,e,n]);return{activeEntry:a,activeEntryOptions:i,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:d,setBlockAutoEntrySwitch:c}},Wc=function({id:e,name:t,labelText:n,labelClass:r,contentHint:o=null,focus:s,submitButtonRef:a,"aria-invalid":i,"aria-describedby":c,...l}){const u=(0,Zo.useRef)(null),{isSubmitted:d}=Hi(),[p,{error:f}]=Wi(t),h=d&&f,m=[c&&c,o&&`${e}-content-hint`,h&&`${e}-error`].filter(Boolean).join(" ");return(0,Zo.useLayoutEffect)(()=>{u.current&&s&&u.current.focus()},[s]),(0,Ls.jsx)(kc,{id:e,contentHint:o,validity:!h,errorText:f,labelText:n,labelClass:r,children:(0,Ls.jsx)("textarea",{...p,...l,ref:u,id:e,"aria-invalid":i||h?"true":"false","aria-describedby":m||void 0,name:t,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),a.current&&a.current.click())}})})};function Gc({controlName:e,skipLinkId:t}){const{t:n}=hs(),{setInputFocus:r}=ms(),{sendAssertive:o}=js(),{emitEvent:s}=Ss(),a=$c(),{setBlockAutoEntrySwitch:i}=Hc(),{placeholder:c,label:l,labelClass:u}=qi(e),{hasCharacterLimit:d,reachedCharacterWarning:p,reachedCharacterLimit:f,remainingChars:h}=Gi(e),[{value:m}]=Wi(e),y=!!m,{useMultilineUserInput:v}=gn(),g=(0,Zo.useRef)(null),b=(0,Zo.useCallback)(()=>{p&&o(n("input.srCharacterLimitText",{limit:h})),s("ui.inputFocus")},[n,o,p,h,s]);(0,Zo.useLayoutEffect)(()=>(i(y),()=>{i(!1)}),[i,y]);const x={id:t,name:e,className:Ws("input__text"),autocomplete:"off",placeholder:c,labelText:l,labelClass:Ws(u),"aria-invalid":!!d&&f,onKeyUp:a,onFocus:b,focus:r};return(0,Ls.jsxs)(Ic,{className:Ws("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,Ls.jsxs)("div",{className:Ws(["input--text__container",...p&&!f?["character-warning"]:[],...f?["character-exceeded"]:[]]),children:[v?(0,Ls.jsx)(Wc,{...x,submitButtonRef:g,wrap:"hard"}):(0,Ls.jsx)(Oc,{...x,type:"text"}),(0,Ls.jsx)("div",{className:Ws("character-count"),children:p&&(0,Ls.jsx)("span",{children:h})})]}),(0,Ls.jsx)("button",{className:Ws("button","input__submit"),onPointerDown:e=>{e.preventDefault()},"aria-disabled":!y||f,ref:g,type:"submit",children:(0,Ls.jsx)(da,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}const qc="textMessageEntry";function Kc({...e}){const{isOpen:t,setVisibility:n}=ms(),r=Dn(),o=Ds(),{sendMessage:s}=Ss(),a=(0,Zo.useCallback)((e,{updateControlValue:r})=>{s({body:e[qc]}),r(qc,""),o(),t||n({visibility:Kt.open})},[s,o,t,n]);return(0,Ls.jsx)(_c,{...e,formId:"textEntry",persistData:!0,onSubmit:a,children:(0,Ls.jsx)(Gc,{controlName:qc,skipLinkId:r})})}const Jc=()=>{const{t:e}=hs(),{currentUploads:t}=Ys();return(0,Ls.jsx)("div",{className:Ws("progress"),children:t.map(({id:t,name:n,progress:r,uploading:o,error:s})=>(0,Ls.jsxs)("div",{className:Ws("progress_container"),children:[(0,Ls.jsxs)("div",{className:Ws("progress__text"),children:[(0,Ls.jsx)("span",{className:Ws("progress__text--file-name"),children:n}),(0,Ls.jsx)("span",{className:Ws("progress__text--percentage"),children:`${r}%`})]}),(0,Ls.jsx)(Nc,{error:s,id:"progress-error"}),(0,Ls.jsx)("progress",{className:Ws("progress__bar"),role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-label":e("fileUpload.srProgressLabel",{fileName:n}),max:"100","aria-valuenow":r,value:r,"aria-busy":o,children:`${r}%`})]},t))})};function Xc({id:e,name:t,labelText:n,contentHint:r,outputText:o,accept:s}){const{isSubmitted:a}=Hi(),[i,c]=(0,Zo.useState)(!1),[{onInput:l,onBlur:u},{error:d}]=Wi(t),p=oa(),f=oa(),h=oa(),m=a&&d,y=[h];r&&y.push(f),m&&y.push(p);const v=(0,Zo.useCallback)(()=>{c(!0)},[c]),g=(0,Zo.useCallback)(()=>{c(!1),u()},[c,u]),b=(0,Zo.useCallback)(e=>{const t={target:{value:e.target.files}};l(t)},[l]);return(0,Ls.jsxs)("div",{className:Ws("upload__container"),children:[r&&(0,Ls.jsx)("span",{className:Ws("upload__content-hint"),id:f,children:r}),(0,Ls.jsx)(Nc,{id:p,error:m&&d}),(0,Ls.jsx)("div",{className:Ws(["file-upload",...i?["focus-within"]:[]]),children:(0,Ls.jsxs)("label",{htmlFor:e,className:Ws("upload__label"),children:[(0,Ls.jsx)(da,{name:"upload",size:"32",alt:""}),(0,Ls.jsxs)("div",{children:[(0,Ls.jsx)("span",{className:Ws(["upload__label--text"]),children:n}),(0,Ls.jsx)("input",{id:e,className:Ws("upload__input"),type:"file",name:t,onChange:b,"aria-invalid":m?"true":"false","aria-describedby":y.join(" "),accept:s||null,onFocus:v,onBlur:g}),(0,Ls.jsx)("span",{className:Ws("upload__output"),"aria-hidden":"true",id:h,children:o})]})]})})]})}const Yc=({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:o,isComplete:s,onClickCancel:a})=>{const{t:i}=hs(),[{value:c}]=Wi(t),l=c&&c.length>0,u=l&&"string"!=typeof c?c[0].name:"";return(0,Ls.jsxs)(Ic,{className:Ws("upload-form"),children:[(0,Ls.jsx)(Xc,{name:t,id:e,accept:n,labelText:i("fileUpload.labelText"),outputText:i("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),(0,Ls.jsxs)("div",{className:Ws("upload__button-container"),children:[(0,Ls.jsx)("button",{id:o||!s?e:void 0,type:"button",onClick:a,className:Ws("button","button--secondary","upload__cancel"),children:i("fileUpload.cancelButtonText")}),(0,Ls.jsx)("button",{className:Ws("button","button--primary"),type:"submit",children:i("fileUpload.uploadButtonText")})]})]})},Qc="fileListForm",Zc="fileList",el=()=>{const{t:e}=hs(),{sendPolite:t,sendAssertive:n}=js(),r=Dn(),o=Ds(),{serviceAllowsUploads:s,allowedMimeTypes:a,maxSize:i}=Xs(),c=(0,Zo.useRef)(null),l=(0,Zo.useRef)(s),{cancelEntrySelection:u}=Hc(),{uploadFile:d,clearUploads:p,isUploading:f,isComplete:h}=Ys(),{uploadHandle:m,hasServerError:y,progress:v}=((e,t)=>{const n=vn(n=>Di(n,{formId:e,name:t})),{currentUploads:r}=Ys(),o=n&&n.length>0;let s=null,a=!1,i=0;if(r&&r.length>0){const e=r[0];s=e.uploadHandle,a=!!e.error,i=e.progress}return{hasFile:o,selectedFileName:o?n[0].name:"",uploadHandle:s,hasServerError:a,progress:i}})(Qc,Zc),g=oa(),b=(0,Zo.useRef)(!0),x=e("fileUpload.contentHint",{size:Cn(i)}),w=(0,Zo.useRef)(""),_=(0,Zo.useRef)(null);(0,Zo.useEffect)(()=>{w.current&&_.current?.contains(document.activeElement)&&"INPUT"===document.activeElement?.tagName&&n(x),w.current=x},[x,n]),(0,Zo.useEffect)(()=>{v>0&&t(1===v?e("fileUpload.srStartedText"):`${v}%`)},[v,t,e]),(0,Zo.useEffect)(()=>{b.current||f||!h||(p(),u(),o(),setTimeout(()=>{t(e("fileUpload.srCompleteText"))},300)),b.current=h},[f,h,p,u,o,t,e]),(0,Zo.useEffect)(()=>{s||f||(p(),u(),o())},[s,f,p,u,o]);const C=(0,Zo.useCallback)(({fileList:e})=>{d(e[0]),o()},[d,!1,o]),S=(0,Zo.useCallback)(()=>{m&&m.abort(),p(),u(),o()},[m,p,u,o]),E=(0,Zo.useMemo)(()=>({[Zc]:[Cc(()=>s,e("fileUpload.errors.unavailable")),Cc(Ec,e("fileUpload.errors.noFile")),Cc(Sc,e("fileUpload.errors.tooLarge"),i)]}),[i,s,e]);return(0,Ls.jsx)("div",{className:Ws(["upload",...y?["upload--error"]:[]]),ref:_,children:(0,Ls.jsxs)(_c,{formId:Qc,persistData:!0,onSubmit:C,validationSchema:E,children:[(f||!h)&&(0,Ls.jsxs)(Ls.Fragment,{children:[(0,Ls.jsx)(Jc,{}),(0,Ls.jsx)("div",{className:Ws("upload__button-container"),children:(0,Ls.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:S,ref:c,className:Ws("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!f&&h&&(0,Ls.jsx)(Yc,{controlName:Zc,skiplinkId:r,accept:a?.join(", ")||"",contentHint:x,isComplete:h,isUploading:f,onClickCancel:S}),!l.current&&(0,Ls.jsxs)(Ls.Fragment,{children:[(0,Ls.jsx)("span",{className:Ws("notification"),id:g,children:e("fileUpload.unavailableText")}),(0,Ls.jsx)("div",{className:Ws("upload__button-container"),children:(0,Ls.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:S,className:Ws("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},tl=()=>{const{t:e}=hs(),{showFileUpload:t,serviceAllowsUploads:n}=Xs(),[r,o]=(0,Zo.useState)(n||!1),s=Ds(),a=(0,Zo.useRef)(null),{setUserEntryType:i,activeEntry:c}=Hc(),l=(0,Zo.useRef)(null),{sendPolite:u}=js(),d=!!Bn();return(0,Zo.useEffect)(()=>{In(l.current,()=>{n||s()}),o(n||!1)},[n,s]),(0,Zo.useEffect)(()=>{a.current&&!n&&u(e("fileUpload.srUnavailableText")),!1===a.current&&n&&u(e("fileUpload.srAvailableText")),d&&(a.current=n)},[n,d,u,e]),t||c===S?null:(0,Ls.jsx)(uc,{isActive:r,transitionStartState:cc,children:(0,Ls.jsx)("div",{className:Ws("upload-toggle-wrapper"),children:(0,Ls.jsx)(uc,{isActive:r,transitionStartState:lc,children:(0,Ls.jsx)("button",{className:Ws(["button","button--secondary","upload-toggle"]),ref:l,"aria-disabled":!r,type:"button",onClick:r?()=>{i(S),s()}:void 0,tabIndex:r?void 0:-1,children:(0,Ls.jsx)(da,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})},nl=()=>{const{isOpen:e}=ms(),t=(0,Zo.useRef)(null),{hasCountdown:n}=na(),[r,o]=(0,Zo.useState)(n),{hasPrompt:s}=ra(),[a,i]=(0,Zo.useState)(s),c=Ds(),l=(0,Zo.useRef)(!1),{activeEntry:u,activeEntryOptions:d}=Hc(),[p,f]=(0,Zo.useState)({text:Kc,upload:el}),[h,m]=(0,Zo.useState)(()=>u),y=gn(),{accountAllowsUploads:v}=Xs(),g=(0,Zo.useCallback)(()=>{In(t.current,c)},[c]);(0,Zo.useEffect)(()=>{const{customComponents:e}=y,{entry:t}=e||{};t&&f(e=>({...e,...t}))},[y]),(0,Zo.useEffect)(()=>{g(),o(n),i(s)},[n,s,g]),(0,Zo.useEffect)(()=>{m(u),g()},[u,g,t]),l.current=!(!t.current||!t.current.contains(document.activeElement));const b=p[h]||Kc,{allowManualInput:x=!0}=d;return(0,Ls.jsxs)("div",{className:Ws("chat__entry"),ref:t,children:[r&&(0,Ls.jsx)(Bc,{}),a&&(0,Ls.jsx)(Vc,{}),(0,Ls.jsxs)("div",{className:Ws(["entry__body",...n||s||!1===x?["entry__body--hidden"]:[]]),children:[h!==S&&v&&e?(0,Ls.jsx)(tl,{}):null,(0,Ls.jsx)(b,{})]})]})},rl=()=>{const{t:e}=hs(),{isOpen:t,closeChat:n}=ms(),{isWindow:r}=$n(),o=Fs(),s=(0,Zo.useCallback)(()=>{n(),o()},[n,o]);return t&&r?(0,Ls.jsx)("button",{type:"button",className:Ws("button","collapse-button"),onClick:s,children:(0,Ls.jsx)(da,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null},ol=()=>{const{meta:{originalError:e,title:t,message:n,buttonText:r,action:o,srText:s}}=Ns(),a=Ss(),i=oa(),{sendPolite:c}=js(),l=Ds(),u="SeamlySessionExpiredError"===e?.name;return(0,Zo.useEffect)(()=>{!u&&s&&setTimeout(()=>{c(s)},200)},[c,s,u]),u?(0,Ls.jsx)(Ls.Fragment,{}):(0,Ls.jsxs)("section",{className:Ws("interrupt"),"aria-labelledby":i,children:[(0,Ls.jsx)(rl,{}),(0,Ls.jsxs)("div",{className:Ws("interrupt__body"),children:[(0,Ls.jsx)("h2",{id:i,className:Ws("interrupt__title"),children:t}),(0,Ls.jsx)("p",{className:Ws("interrupt__message"),children:n}),r&&o&&(0,Ls.jsx)("div",{className:Ws("interrupt__actions"),children:(0,Ls.jsx)("button",{type:"button",className:Ws("button","button--primary"),onClick:()=>{o&&a[o]&&a[o](),l()},children:r})})]})]})},sl=function({children:e}){const t=vn(Is),{isOpen:n}=ms();return t?(0,Ls.jsx)(ol,{}):(0,Ls.jsxs)(Ls.Fragment,{children:[(0,Ls.jsxs)(Fc,{children:[(0,Ls.jsxs)("div",{className:Ws("chat__container__header"),children:[(0,Ls.jsx)(yc,{}),(0,Ls.jsx)(rl,{})]}),e]}),(0,Ls.jsx)(nl,{}),n&&(0,Ls.jsx)(Uc,{})]})};function al({event:e}){const[t]=Qi(e);return(0,Ls.jsx)("li",{children:(0,Ls.jsx)(t,{event:e})})}function il({events:e}){return(0,Ls.jsx)("ul",{className:Ws("collapsed-chat-messages"),children:e.map(e=>(0,Ls.jsx)(al,{event:e},e.payload.id))})}function cl(){const{preChatEvents:e}=gn(),t=vn(Is),{isOpen:n}=ms();return t||!e?.length||n?null:(0,Ls.jsx)(il,{events:e})}function ll(){const{t:e}=hs(),t=e("window.chat.continue"),n=(0,Zo.useMemo)(()=>({type:"message",payload:{type:"custom",body:{text:t,type:"",data:{}},participant:"seamly-client-participant"}}),[t]);return(0,Ls.jsx)(il,{events:[n]})}const ul=()=>{const e=bn(),t=Bn(),n=vn(Is),r=t&&!n,o=r?t.avatar:e;return o?(0,Ls.jsx)("img",{className:Ws(r?"avatar":"icon"),src:o,alt:""}):(0,Ls.jsx)(da,{name:"avatar",size:"32",alt:""})},dl=({onClick:e})=>{const t=Cs(),{t:n}=hs(),r=t()?n("window.openButton.srContinue"):n("window.openButton.srStart"),o=(()=>{const e=Un();return Us(e)})(),s=Ds(),{isOpen:a}=ms(),{windowOpenButtonId:i}=On(),c=Mn(),l=(0,Zo.useCallback)(t=>{e(),t.detail>0?s():o()},[o,s,e]);return(0,Ls.jsx)(uc,{isActive:!a,transitionStartState:cc,children:(0,Ls.jsxs)("button",{type:"button",className:Ws("window-open-button"),"aria-label":r,onClick:l,inert:a||void 0,id:i,children:[(0,Ls.jsx)(uc,{isActive:!!c,transitionStartState:ic,children:(0,Ls.jsx)("span",{className:Ws("message-count"),"aria-hidden":"true",children:c})}),(0,Ls.jsx)(ul,{})]})})},pl=(e,t,n)=>"object"==typeof e?e[t]:n,fl=n.p+"sounds/beep.mp3",hl=!!window.Notification,ml={app:()=>(0,Ls.jsx)(pc,{children:(0,Ls.jsx)(sl,{children:(0,Ls.jsx)(nc,{})})}),inline:()=>{const{showInlineView:e,containerRef:t}=(()=>{const e=Jo(),{connectWhenInView:t}=gn(),n=vn(Wn),{containerRef:r,isVisible:o}=ys({enabled:t,freezeOnceVisible:!0});return(0,Zo.useEffect)(()=>{o&&e(Go())},[e,o]),{containerRef:r,showInlineView:n}})(),{isOpen:n}=ms();return(0,Ls.jsxs)(Ls.Fragment,{children:[(0,Ls.jsx)(uc,{isActive:!n,transitionStartState:cc,children:(0,Ls.jsxs)("div",{ref:t,className:Ws("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,Ls.jsx)(cl,{}),(0,Ls.jsx)(dc,{})]})}),(0,Ls.jsx)(uc,{isActive:n,transitionStartState:cc,children:(0,Ls.jsx)(pc,{ref:t,children:e&&(0,Ls.jsx)(sl,{children:n&&(0,Ls.jsx)(nc,{})})})})]})},window:()=>{const{isOpen:e,openChat:t}=ms(),n=vs(),{continueChat:r,preChat:o}=gn();return(0,Ls.jsxs)(Ls.Fragment,{children:[(0,Ls.jsx)(dl,{onClick:t}),(0,Ls.jsx)(uc,{isActive:!!o&&!e&&!n,exitAfter:pl(o,"exitAfter"),enterDelay:pl(o,"enterDelay"),transitionStartState:ic,children:(0,Ls.jsx)("div",{className:Ws("unstarted-wrapper","unstarted-wrapper--window"),children:(0,Ls.jsx)(cl,{})})}),(0,Ls.jsx)(uc,{isActive:r&&!e&&n,exitAfter:pl(r,"exitAfter"),enterDelay:pl(r,"enterDelay"),transitionStartState:ic,children:(0,Ls.jsx)("div",{className:Ws("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,Ls.jsx)(ll,{})})}),(0,Ls.jsx)(uc,{isActive:e,transitionStartState:ic,children:(0,Ls.jsx)(pc,{children:(0,Ls.jsx)(sl,{children:(0,Ls.jsx)(nc,{})})})})]})}};function yl(e){const t=document.createElement("div");return t.innerHTML=e||"",t.textContent||t.innerText||""}const vl=({children:e})=>{const{sendNotification:t}=(()=>{const{proactiveMessages:e}=Fn(),{notificationAudioURL:t}=gn(),[n,r]=(0,Zo.useState)(hl?Notification.permission:"default"),[o,s]=(0,Zo.useState)(document.visibilityState),a=vn(Ri),i=(0,Zo.useCallback)(async()=>{if(hl&&"granted"!==n){const e=await Notification.requestPermission();r(e)}},[n]),c=(0,Zo.useMemo)(()=>"granted"===n,[n]),l=(0,Zo.useMemo)(()=>"hidden"===o,[o]);(0,Zo.useEffect)(()=>{"default"===n&&e&&i()},[n,e,i]);const u=(0,Zo.useCallback)(async(e,r)=>{if(a&&hl){if("default"===n&&i(),!1!==t&&!c&&(l||!document.hasFocus()))try{const e=new Audio(t||fl);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=${qc}]`);e&&e.focus()}}}},[t,n,c,i,a,l]);return(0,Zo.useEffect)(()=>{if(!a)return()=>{};function e(){s(document.visibilityState)}return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e)}},[a]),{permission:n,requestPermission:i,sendNotification:u}})(),[,n]=Ms(),r=gn(),o=Bn(),{proactiveMessages:s}=Fn(),{isOpen:a,isVisible:i}=ms(),c=Gs(),l=vs(),u=vn(Oi),{body:d}=Vs(u),{userLocale:p}=hs(),f=(0,Zo.useRef)(void 0),h=(0,Zo.useMemo)(()=>d?"string"==typeof d?yl(d):"text"in d?yl(d.text):"prompt"in d&&d.prompt&&"text"in d.prompt?yl(d.prompt?.text):"":"",[d]);(0,Zo.useEffect)(()=>{o?.name&&h&&s&&u&&f.current!==u.payload?.id&&(t(o.name,{body:h,icon:o?.avatar||void 0}),f.current=u.payload.id)},[o?.avatar,o?.name,u,h,s,t]);const m=ml[r.layoutMode],y=(0,Zo.useCallback)(e=>{"function"==typeof n&&n(e)},[n]),v=(0,Zo.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 g=["app",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];return"function"!=typeof c?g.push(...c):g.push(...c(r)),a||"app"===r.layoutMode||g.push("app--collapsed"),l&&g.push("app--user-responded"),i?(0,Ls.jsx)("div",{className:Ws(g),lang:v,tabIndex:-1,"data-nosnippet":!0,style:{zIndex:r?.zIndex},ref:y,children:e||(0,Ls.jsx)(m,{})}):null},gl=e=>(0,Ls.jsx)(Ni,{...e,children:(0,Ls.jsx)(vl,{})});class bl{constructor(e,t){const{namespace:n="",parentElement:r,...o}=e;this.config={...o,namespace:n},this.namespace=n,this.parentElement=r,this.externalApi=t,this.api=new H({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(Yo()),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 o=vt({reducer:Ko,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:o,api:s,layoutMode:a}=Jt(t()),{error:i,type:c}=n,l=fr[i?.name]?new fr[i.name](i):new m(i);r?.(l,{namespace:o,api:s,layoutMode:a,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:o}=n;if(o===Pr.type){if(!Dr.includes(r.name))throw new v(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 No.toString():e.store.set("options",n.payload);break;case Io.toString():e.store.set("options",{...e.store.get("options")||{},[n.payload.option]:n.payload.value})}return r}}({api:t}),Ao)});return o}({api:this.api,eventBus:this.eventBus,config:n,initialState:void 0});r.dispatch(or(n)),await r.dispatch(Ut()),await r.dispatch(Xn()),r.dispatch(Jn()),e?(0,Qo.render)((0,Ls.jsx)(Ni,{eventBus:this.eventBus,store:r,api:this.api,children:(0,Ls.jsx)(e,{})}),this.parentElement):(0,Qo.render)((0,Ls.jsx)(gl,{config:n,eventBus:this.eventBus,store:r,api:this.api}),this.parentElement)}destroy(){(0,Qo.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 xl=e=>"object"==typeof e&&"action"in e,wl=e=>({...e,args:Array.isArray(e.args)?e.args:[e.args]}),_l=class{constructor(e){this._waitingActions=[],this._instances={},this.timeouts={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(xl).map(wl)).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:e,locale:n}=t;return e&&n&&(this.context.userLocale=n,this.context.source=A),!0}case"setContext":{const{userLocale:e,contentLocale:n}=t;return this.context.userLocale=e,this.context.contentLocale=n,e&&e!=this.appConfig?.userLocale&&(this.context.source=A),!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:o}=n||t;if(o?Object.values(this._instances).forEach(e=>{e.parentElement!==r&&e.namespace!==o||this.destroy(e)}):this.destroy(),n){const e=this.createInstance(n);this._instances[n.namespace]=e,this.context={},this.debouncedRender(e,n.namespace)}}handleDestroy(e){this.destroy(e.instance)}handleAction(e){const{action:t,instance:n,args:r}=e,o=Object.values(this._instances);return!n&&o.length>1&&console.warn(`Multiple instances detected. Due to potential race conditions, it is recommended to target a specific instance with the action: ${t}`),o.map(e=>(!n||e.namespace===n)&&e.execFunction(t,...r)).some(Boolean)}createInstance(e){return new bl(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},o={...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(o):o}getMergedVariables(e){return{...this.appConfig.context?.variables||{},...e.context?.variables||{},...this.context.variables||{}}}},Cl=()=>{const e=Jo();return{addEvent:t=>e(Wr(t)),clearEvents:()=>e(Kr()),setEventsRead:t=>e(ao(t)),setLoadedImageEventIds:t=>e(yo(t)),setIsLoading:t=>e(mo(t)),setParticipant:t=>e(vo(t)),setHeaderTitle:t=>e(po(t)),setHeaderSubTitle:t=>e(uo(t)),setActiveService:t=>e(oo(t)),initIdleDetachCountdown:t=>e(eo(t)),decrementIdleDetachCountdownCounter:()=>e(Qr()),stopIdleDetachCountdownCounter:()=>e(Oo()),clearIdleDetachCountdown:()=>e(Xr()),initResumeConversationPrompt:()=>e(to()),clearResumeConversationPrompt:()=>e(Yr()),setServiceDataItem:t=>e(bo(t)),setFeatures:t=>e(lo(t)),setFeatureEnabledState:t=>e(io(t)),clearFeatures:()=>e(Jr()),setInitialState:t=>e(ho(t)),setUserSelectedOptions:t=>e(No(t)),setUserSelectedOption:t=>e(Io(t)),showOption:t=>e(ko(t)),hideOption:()=>e(Zr()),setServiceEntryMetadata:t=>e(xo(t)),setBlockAutoEntrySwitch:t=>e(so(t)),setActiveEntryType:t=>e(ro(t)),setUserEntryType:t=>e(To(t)),registerUpload:t=>e(no(t)),setUploadProgress:t=>e(So(t)),setUploadComplete:t=>e(_o(t)),setUploadError:t=>e(Co(t)),clearAllUploads:()=>e(qr()),setSeamlyContainerElement:t=>e(go(t))}};function Sl(){return{get:()=>{if(Object.prototype.hasOwnProperty.call(window,"SeamlyBridge"))try{return JSON.parse(window.SeamlyBridge.getData())}catch(e){return console.error("Unexpected or malformed data retrieved from bridge",e),{}}return window.seamlyBridgeData},set:e=>{window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.seamlyBridge&&window.webkit.messageHandlers.seamlyBridge.postMessage(JSON.stringify(e)),Object.prototype.hasOwnProperty.call(window,"SeamlyBridge")&&window.SeamlyBridge.setData(JSON.stringify(e)),window.ReactNativeWebView&&window.ReactNativeWebView.postMessage(JSON.stringify(e))}}}function El(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var jl=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=El({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in o)o[a]&&(s+="; "+a,!0!==o[a]&&(s+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+s}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var s=n[o].split("="),a=s.slice(1).join("=");try{var i=decodeURIComponent(s[0]);if(r[i]=t.read(a,i),e===i)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",El({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,El({},this.attributes,t))},withConverter:function(t){return e(El({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});function Tl(e={}){return function(t){const n=`cvco.${t}`;return{get(){const e=jl.get(n);return e?JSON.parse(e):null},set(t){t&&jl.set(n,JSON.stringify(t),e)}}}}const Il=()=>{const{t:e}=hs(),{title:t,subTitle:n}=On().headerTitles,r=Mn(),{isOpen:o}=ms(),s=Bn(),a=vn(Is),i=bn(),c=s?.avatar??i,l=a?"":n,u=["message-count"];return o&&u.push("message-count__hide"),0===r&&u.push("message-count__empty"),l||!o?(0,Ls.jsxs)("div",{className:Ws("agent-info"),children:[(0,Ls.jsxs)("div",{className:Ws("agent-info__graphic"),children:[c?(0,Ls.jsx)("img",{className:Ws(s?.avatar?"avatar":"icon"),src:c,alt:""}):(0,Ls.jsx)(da,{name:"avatar",size:"32",alt:""}),(0,Ls.jsx)("span",{className:Ws(u),"aria-hidden":"true",children:r})]}),(0,Ls.jsxs)("div",{className:Ws("agent-info__body"),children:[(0,Ls.jsx)("p",{className:Ws("agent-info__heading"),children:t??e("header.title")}),(0,Ls.jsx)("p",{className:Ws("agent-info__text"),children:l})]})]}):null},Nl=({children:e,onCloseChat:t})=>{const{headerCollapseButtonId:n}=On(),r=(0,Zo.useRef)(null),{t:o}=hs();return(0,Ls.jsxs)("header",{className:Ws("chat__header"),children:[e,(0,Ls.jsx)("div",{className:Ws("header-controls"),children:(0,Ls.jsx)("button",{type:"button",className:Ws("button","header-controls__collapse"),onClick:t,ref:r,id:n,children:(0,Ls.jsx)(da,{name:"chevronDown",size:"32",alt:o("header.collapseApp")})})})]})},kl=()=>{const e=new URLSearchParams(window.location.search);return Array.from(e.entries()).reduce((e,[t,n])=>({...e,[t]:n}),{})},Ol=e=>new URLSearchParams(e).toString(),Ll=(...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},{})},Rl=(...e)=>{const t=new URL(window.location.href),n=e.reduce((e,n)=>{const r=t.searchParams.get(n),o=r||sessionStorage.getItem(n);return r&&sessionStorage.setItem(n,r),o?(e.set(n,o),e):e},new URLSearchParams),r=new URLSearchParams({...Object.fromEntries(t.searchParams),...Object.fromEntries(n)});return r.toString()&&window.history.replaceState(null,"",`?${r}`),Ll(...n.keys())},Al=(...e)=>{const t=document.querySelector("[data-reset-search-params]");t&&t.addEventListener("click",t=>{t.preventDefault();const n=new URL(window.location.href);e.forEach(e=>{sessionStorage.removeItem(e),n.searchParams.delete(e)}),window.location.href=n.toString()})},Pl=function(e){if(window.seamly&&!Array.isArray(window.seamly))throw new Error("Seamly UI has already been initialised. Use the window.seamly object to start new instances instead.");const t=Array.isArray(window.seamly)?window.seamly:[],n=new _l(e);window.seamly={push:n.push.bind(n)},n.push(...t)}})(),module.exports=r})();
2
+ (()=>{var e={2086(e){e.exports=function(e){var t={},n=[];(e=e||this).on=function(n,r,o){return(t[n]=t[n]||[]).push([r,o]),e},e.off=function(r,o){r||(t={});for(var s=t[r]||n,a=s.length=o?s.length:0;a--;)o==s[a][0]&&s.splice(a,1);return e},e.emit=function(r){for(var o,s=t[r]||n,a=s.length>0?s.slice(0,s.length):s,i=0;o=a[i++];)o[0].apply(o[1],n.slice.call(arguments,1));return e}}},7402(e,t,n){"use strict";n.r(t),n.d(t,{Children:()=>x,Component:()=>r.Component,Fragment:()=>r.Fragment,PureComponent:()=>h,StrictMode:()=>ie,Suspense:()=>E,SuspenseList:()=>I,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>X,cloneElement:()=>ne,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>Q,createPortal:()=>L,createRef:()=>r.createRef,default:()=>le,findDOMNode:()=>oe,flushSync:()=>ae,forwardRef:()=>g,hydrate:()=>z,isElement:()=>ce,isFragment:()=>ee,isMemo:()=>te,isValidElement:()=>Z,lazy:()=>T,memo:()=>m,render:()=>F,startTransition:()=>u,unmountComponentAtNode:()=>re,unstable_batchedUpdates:()=>se,useDeferredValue:()=>d,useInsertionEffect:()=>f,useSyncExternalStore:()=>c,useTransition:()=>p,version:()=>Y});var r=n(8785),o=n(1162),s={};for(const e in o)["default","Component","Fragment","createContext","createElement","createRef","Children","PureComponent","StrictMode","Suspense","SuspenseList","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","cloneElement","createFactory","createPortal","findDOMNode","flushSync","forwardRef","hydrate","isElement","isFragment","isMemo","isValidElement","lazy","memo","render","startTransition","unmountComponentAtNode","unstable_batchedUpdates","useDeferredValue","useInsertionEffect","useSyncExternalStore","useTransition","version"].indexOf(e)<0&&(s[e]=()=>o[e]);function a(e,t){for(var n in t)e[n]=t[n];return e}function i(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function c(e,t){var n=t(),r=(0,o.useState)({t:{__:n,u:t}}),s=r[0].t,a=r[1];return(0,o.useLayoutEffect)(function(){s.__=n,s.u=t,l(s)&&a({t:s})},[e,n,t]),(0,o.useEffect)(function(){return l(s)&&a({t:s}),e(function(){l(s)&&a({t:s})})},[e]),n}function l(e){try{return!((t=e.__)===(n=e.u())&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}var t,n}function u(e){e()}function d(e){return e}function p(){return[!1,u]}n.d(t,s);var f=o.useLayoutEffect;function h(e,t){this.props=e,this.context=t}function m(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:i(this.props,e)}function o(t){return this.shouldComponentUpdate=n,(0,r.createElement)(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o.type=e,o}(h.prototype=new r.Component).isPureReactComponent=!0,h.prototype.shouldComponentUpdate=function(e,t){return i(this.props,e)||i(this.state,t)};var y=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),y&&y(e)};var v="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function g(e){function t(t){var n=a({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=v,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var b=function(e,t){return null==e?null:(0,r.toChildArray)((0,r.toChildArray)(e).map(t))},x={map:b,forEach:b,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},w=r.options.__e;r.options.__e=function(e,t,n,r){if(e.then)for(var o,s=t;s=s.__;)if((o=s.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);w(e,t,n,r)};var _=r.options.unmount;function C(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=a({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return C(e,t,n)})),e}function S(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return S(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 E(){this.__u=0,this.o=null,this.__b=null}function j(e){if(!e.__)return null;var t=e.__.__c;return t&&t.__a&&t.__a(e)}function T(e){var t,n,o,s=null;function a(a){if(t||(t=e()).then(function(e){e&&(s=e.default||e),o=!0},function(e){n=e,o=!0}),n)throw n;if(!o)throw t;return s?(0,r.createElement)(s,a):null}return a.displayName="Lazy",a.__f=!0,a}function I(){this.i=null,this.l=null}r.options.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),_&&_(e)},(E.prototype=new r.Component).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var o=j(r.__v),s=!1,a=function(){s||r.__z||(s=!0,n.__R=null,o?o(c):c())};n.__R=a;var i=n.__P;n.__P=null;var c=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=S(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=i,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},E.prototype.componentWillUnmount=function(){this.o=[]},E.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=C(this.__b,n,o.__O=o.__P)}this.__b=null}var s=t.__a&&(0,r.createElement)(r.Fragment,null,e.fallback);return s&&(s.__u&=-33),[(0,r.createElement)(r.Fragment,null,t.__a?null:e.children),s]};var N=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 k(e){return this.getChildContext=function(){return e.context},e.children}function O(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){(0,r.render)(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var o=t.__v;null!==o&&!o.__m&&null!==o.__;)o=o.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,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)(k,{context:t.context},e.__v),t.v)}function L(e,t){var n=(0,r.createElement)(O,{__v:e,h:t});return n.containerInfo=t,n}(I.prototype=new r.Component).__a=function(e){var t=this,n=j(t.__v),r=t.l.get(e);return r[0]++,function(o){var s=function(){t.props.revealOrder?(r.push(o),N(t,e,r)):o()};n?n(s):s()}},I.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},I.prototype.componentDidUpdate=I.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){N(e,n,t)})};var R="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]/,P=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,M=/[A-Z0-9]/g,U="undefined"!=typeof document,D=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function F(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function z(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 B=r.options.event;function V(){}function $(){return this.cancelBubble}function H(){return this.defaultPrevented}r.options.event=function(e){return B&&(e=B(e)),e.persist=V,e.isPropagationStopped=$,e.isDefaultPrevented=H,e.nativeEvent=e};var W,G={enumerable:!1,configurable:!0,get:function(){return this.class}},q=r.options.vnode;r.options.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},s=-1===n.indexOf("-");for(var a in t){var i=t[a];if(!("value"===a&&"defaultValue"in t&&null==i||U&&"children"===a&&"noscript"===n||"class"===a||"className"===a)){var c=a.toLowerCase();"defaultValue"===a&&"value"in t&&null==t.value?a="value":"download"===a&&!0===i?i="":"translate"===c&&"no"===i?i=!1:"o"===c[0]&&"n"===c[1]?"ondoubleclick"===c?a="ondblclick":"onchange"!==c||"input"!==n&&"textarea"!==n||D(t.type)?"onfocus"===c?a="onfocusin":"onblur"===c?a="onfocusout":P.test(a)&&(a=c):c=a="oninput":s&&A.test(a)?a=a.replace(M,"-$&").toLowerCase():null===i&&(i=void 0),"oninput"===c&&o[a=c]&&(a="oninputCapture"),o[a]=i}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,r.toChildArray)(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),"select"==n&&null!=o.defaultValue&&(o.value=(0,r.toChildArray)(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value})),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",G)):t.className&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=R,q&&q(e)};var K=r.options.__r;r.options.__r=function(e){K&&K(e),W=e.__c};var J=r.options.diffed;r.options.diffed=function(e){J&&J(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),W=null};var X={ReactCurrentDispatcher:{current:{readContext:function(e){return W.__n[e.__c].props.value},useCallback:o.useCallback,useContext:o.useContext,useDebugValue:o.useDebugValue,useDeferredValue:d,useEffect:o.useEffect,useId:o.useId,useImperativeHandle:o.useImperativeHandle,useInsertionEffect:f,useLayoutEffect:o.useLayoutEffect,useMemo:o.useMemo,useReducer:o.useReducer,useRef:o.useRef,useState:o.useState,useSyncExternalStore:c,useTransition:p}}},Y="18.3.1";function Q(e){return r.createElement.bind(null,e)}function Z(e){return!!e&&e.$$typeof===R}function ee(e){return Z(e)&&e.type===r.Fragment}function te(e){return!!e&&"string"==typeof e.displayName&&e.displayName.startsWith("Memo(")}function ne(e){return Z(e)?r.cloneElement.apply(null,arguments):e}function re(e){return!!e.__k&&((0,r.render)(null,e),!0)}function oe(e){return e&&(e.base||1===e.nodeType&&e)||null}var se=function(e,t){return e(t)},ae=function(e,t){return e(t)},ie=r.Fragment,ce=Z,le={useState:o.useState,useId:o.useId,useReducer:o.useReducer,useEffect:o.useEffect,useLayoutEffect:o.useLayoutEffect,useInsertionEffect:f,useTransition:p,useDeferredValue:d,useSyncExternalStore:c,startTransition:u,useRef:o.useRef,useImperativeHandle:o.useImperativeHandle,useMemo:o.useMemo,useCallback:o.useCallback,useContext:o.useContext,useDebugValue:o.useDebugValue,version:"18.3.1",Children:x,render:F,hydrate:z,unmountComponentAtNode:re,createPortal:L,createElement:r.createElement,createContext:r.createContext,createFactory:Q,cloneElement:ne,createRef:r.createRef,Fragment:r.Fragment,isValidElement:Z,isElement:ce,isFragment:ee,isMemo:te,findDOMNode:oe,Component:r.Component,PureComponent:h,memo:m,forwardRef:g,flushSync:ae,unstable_batchedUpdates:se,StrictMode:ie,Suspense:E,SuspenseList:I,lazy:T,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:X}},5160(e,t,n){"use strict";var r=n(7402),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useSyncExternalStore,a=r.useRef,i=r.useEffect,c=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=a(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(!i){if(i=!0,s=e,e=r(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return a=t}return a=e}if(t=a,o(s,e))return t;var n=r(e);return void 0!==u&&u(t,n)?(s=e,t):(s=e,a=n)}var s,a,i=!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=s(e,d[0],d[1]);return i(function(){p.hasValue=!0,p.value=f},[f]),l(f),f}},8418(e,t,n){"use strict";e.exports=n(5160)},8785(e){"use strict";e.exports=require("preact")},1162(e){"use strict";e.exports=require("preact/hooks")},9497(e,t,n){"use strict";n(8107);var r=n(7015);e.exports=r("Array","at")},9306(e,t,n){"use strict";var r=n(4901),o=n(6823),s=TypeError;e.exports=function(e){if(r(e))return e;throw new s(o(e)+" is not a function")}},7080(e,t,n){"use strict";var r=n(4402).has;e.exports=function(e){return r(e),e}},6469(e,t,n){"use strict";var r=n(8227),o=n(2360),s=n(4913).f,a=r("unscopables"),i=Array.prototype;void 0===i[a]&&s(i,a,{configurable:!0,value:o(null)}),e.exports=function(e){i[a][e]=!0}},679(e,t,n){"use strict";var r=n(1625),o=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw new o("Incorrect invocation")}},8551(e,t,n){"use strict";var r=n(34),o=String,s=TypeError;e.exports=function(e){if(r(e))return e;throw new s(o(e)+" is not an object")}},9617(e,t,n){"use strict";var r=n(5397),o=n(5610),s=n(6198),a=function(e){return function(t,n,a){var i=r(t),c=s(i);if(0===c)return!e&&-1;var l,u=o(a,c);if(e&&n!=n){for(;c>u;)if((l=i[u++])!=l)return!0}else for(;c>u;u++)if((e||u in i)&&i[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},4527(e,t,n){"use strict";var r=n(3724),o=n(4376),s=TypeError,a=Object.getOwnPropertyDescriptor,i=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=i?function(e,t){if(o(e)&&!a(e,"length").writable)throw new s("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},6319(e,t,n){"use strict";var r=n(8551),o=n(9539);e.exports=function(e,t,n,s){try{return s?t(r(n)[0],n[1]):t(n)}catch(t){o(e,"throw",t)}}},2195(e,t,n){"use strict";var r=n(9504),o=r({}.toString),s=r("".slice);e.exports=function(e){return s(o(e),8,-1)}},6955(e,t,n){"use strict";var r=n(2140),o=n(4901),s=n(2195),a=n(8227)("toStringTag"),i=Object,c="Arguments"===s(function(){return arguments}());e.exports=r?s:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=i(e),a))?n:c?s(t):"Object"===(r=s(t))&&o(t.callee)?"Arguments":r}},7740(e,t,n){"use strict";var r=n(9297),o=n(5031),s=n(7347),a=n(4913);e.exports=function(e,t,n){for(var i=o(t),c=a.f,l=s.f,u=0;u<i.length;u++){var d=i[u];r(e,d)||n&&r(n,d)||c(e,d,l(t,d))}}},2211(e,t,n){"use strict";var r=n(9039);e.exports=!r(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},2529(e){"use strict";e.exports=function(e,t){return{value:e,done:t}}},6699(e,t,n){"use strict";var r=n(3724),o=n(4913),s=n(6980);e.exports=r?function(e,t,n){return o.f(e,t,s(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}}},4659(e,t,n){"use strict";var r=n(3724),o=n(4913),s=n(6980);e.exports=function(e,t,n){r?o.f(e,t,s(0,n)):e[t]=n}},2106(e,t,n){"use strict";var r=n(283),o=n(4913);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),o.f(e,t,n)}},6840(e,t,n){"use strict";var r=n(4901),o=n(4913),s=n(283),a=n(9433);e.exports=function(e,t,n,i){i||(i={});var c=i.enumerable,l=void 0!==i.name?i.name:t;if(r(n)&&s(n,l,i),i.global)c?e[t]=n:a(t,n);else{try{i.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=n:o.f(e,t,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e}},6279(e,t,n){"use strict";var r=n(6840);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},9433(e,t,n){"use strict";var r=n(4576),o=Object.defineProperty;e.exports=function(e,t){try{o(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),o=n(34),s=r.document,a=o(s)&&o(s.createElement);e.exports=function(e){return a?s.createElement(e):{}}},6837(e){"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},7015(e,t,n){"use strict";var r=n(4576),o=n(9504);e.exports=function(e,t){return o(r[e].prototype[t])}},8727(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2839(e,t,n){"use strict";var r=n(4576).navigator,o=r&&r.userAgent;e.exports=o?String(o):""},9519(e,t,n){"use strict";var r,o,s=n(4576),a=n(2839),i=s.process,c=s.Deno,l=i&&i.versions||c&&c.version,u=l&&l.v8;u&&(o=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},6518(e,t,n){"use strict";var r=n(4576),o=n(7347).f,s=n(6699),a=n(6840),i=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]||i(h,{}):r[h]&&r[h].prototype)for(u in t){if(p=t[u],d=e.dontCallGetSet?(f=o(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)&&s(p,"sham",!0),a(n,u,p,e)}}},9039(e){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},8745(e,t,n){"use strict";var r=n(616),o=Function.prototype,s=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(s):function(){return a.apply(s,arguments)})},6080(e,t,n){"use strict";var r=n(7476),o=n(9306),s=n(616),a=r(r.bind);e.exports=function(e,t){return o(e),void 0===t?e:s?a(e,t):function(){return e.apply(t,arguments)}}},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),o=Function.prototype.call;e.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},350(e,t,n){"use strict";var r=n(3724),o=n(9297),s=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,i=o(s,"name"),c=i&&"something"===function(){}.name,l=i&&(!r||r&&a(s,"name").configurable);e.exports={EXISTS:i,PROPER:c,CONFIGURABLE:l}},6706(e,t,n){"use strict";var r=n(9504),o=n(9306);e.exports=function(e,t,n){try{return r(o(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},7476(e,t,n){"use strict";var r=n(2195),o=n(9504);e.exports=function(e){if("Function"===r(e))return o(e)}},9504(e,t,n){"use strict";var r=n(616),o=Function.prototype,s=o.call,a=r&&o.bind.bind(s,s);e.exports=r?a:function(e){return function(){return s.apply(e,arguments)}}},7751(e,t,n){"use strict";var r=n(4576),o=n(4901);e.exports=function(e,t){return arguments.length<2?(n=r[e],o(n)?n:void 0):r[e]&&r[e][t];var n}},1767(e){"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},851(e,t,n){"use strict";var r=n(6955),o=n(5966),s=n(4117),a=n(6269),i=n(8227)("iterator");e.exports=function(e){if(!s(e))return o(e,i)||o(e,"@@iterator")||a[r(e)]}},81(e,t,n){"use strict";var r=n(9565),o=n(9306),s=n(8551),a=n(6823),i=n(851),c=TypeError;e.exports=function(e,t){var n=arguments.length<2?i(e):t;if(o(n))return s(r(n,e));throw new c(a(e)+" is not iterable")}},5966(e,t,n){"use strict";var r=n(9306),o=n(4117);e.exports=function(e,t){var n=e[t];return o(n)?void 0:r(n)}},3789(e,t,n){"use strict";var r=n(9306),o=n(8551),s=n(9565),a=n(1291),i=n(1767),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 i(o(s(this.keys,this.set)))},includes:function(e){return s(this.has,this.set,e)}},e.exports=function(e){o(e);var t=+e.size;if(t!=t)throw new u(c);var n=a(t);if(n<0)throw new l(c);return new p(e,n)}},4576(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),o=n(8981),s=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return s(o(e),t)}},421(e){"use strict";e.exports={}},397(e,t,n){"use strict";var r=n(7751);e.exports=r("document","documentElement")},5917(e,t,n){"use strict";var r=n(3724),o=n(9039),s=n(4055);e.exports=!r&&!o(function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},7055(e,t,n){"use strict";var r=n(9504),o=n(9039),s=n(2195),a=Object,i=r("".split);e.exports=o(function(){return!a("z").propertyIsEnumerable(0)})?function(e){return"String"===s(e)?i(e,""):a(e)}:a},3706(e,t,n){"use strict";var r=n(9504),o=n(4901),s=n(7629),a=r(Function.toString);o(s.inspectSource)||(s.inspectSource=function(e){return a(e)}),e.exports=s.inspectSource},1181(e,t,n){"use strict";var r,o,s,a=n(8622),i=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=i.TypeError,y=i.WeakMap;if(a||d.state){var v=d.state||(d.state=new y);v.get=v.get,v.has=v.has,v.set=v.set,r=function(e,t){if(v.has(e))throw new m(h);return t.facade=e,v.set(e,t),t},o=function(e){return v.get(e)||{}},s=function(e){return v.has(e)}}else{var g=p("state");f[g]=!0,r=function(e,t){if(u(e,g))throw new m(h);return t.facade=e,l(e,g,t),t},o=function(e){return u(e,g)?e[g]:{}},s=function(e){return u(e,g)}}e.exports={set:r,get:o,has:s,enforce:function(e){return s(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=o(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return n}}}},4209(e,t,n){"use strict";var r=n(8227),o=n(6269),s=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[s]===e)}},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),o=n(4901),s=/#|\.prototype\./,a=function(e,t){var n=c[i(e)];return n===u||n!==l&&(o(t)?r(t):!!t)},i=a.normalize=function(e){return String(e).replace(s,".").toLowerCase()},c=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},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),o=n(4901),s=n(1625),a=n(7040),i=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&s(t.prototype,i(e))}},507(e,t,n){"use strict";var r=n(9565);e.exports=function(e,t,n){for(var o,s,a=n?e:e.iterator,i=e.next;!(o=r(i,a)).done;)if(void 0!==(s=t(o.value)))return s}},2652(e,t,n){"use strict";var r=n(6080),o=n(9565),s=n(8551),a=n(6823),i=n(4209),c=n(6198),l=n(1625),u=n(81),d=n(851),p=n(9539),f=TypeError,h=function(e,t){this.stopped=e,this.result=t},m=h.prototype;e.exports=function(e,t,n){var y,v,g,b,x,w,_,C=n&&n.that,S=!(!n||!n.AS_ENTRIES),E=!(!n||!n.IS_RECORD),j=!(!n||!n.IS_ITERATOR),T=!(!n||!n.INTERRUPTED),I=r(t,C),N=function(e){return y&&p(y,"normal"),new h(!0,e)},k=function(e){return S?(s(e),T?I(e[0],e[1],N):I(e[0],e[1])):T?I(e,N):I(e)};if(E)y=e.iterator;else if(j)y=e;else{if(!(v=d(e)))throw new f(a(e)+" is not iterable");if(i(v)){for(g=0,b=c(e);b>g;g++)if((x=k(e[g]))&&l(m,x))return x;return new h(!1)}y=u(e,v)}for(w=E?e.next:y.next;!(_=o(w,y)).done;){try{x=k(_.value)}catch(e){p(y,"throw",e)}if("object"==typeof x&&x&&l(m,x))return x}return new h(!1)}},1385(e,t,n){"use strict";var r=n(9539);e.exports=function(e,t,n){for(var o=e.length-1;o>=0;o--)if(void 0!==e[o])try{n=r(e[o].iterator,t,n)}catch(e){t="throw",n=e}if("throw"===t)throw n;return n}},9539(e,t,n){"use strict";var r=n(9565),o=n(8551),s=n(5966);e.exports=function(e,t,n){var a,i;o(e);try{if(!(a=s(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){i=!0,a=e}if("throw"===t)throw n;if(i)throw a;return o(a),n}},9462(e,t,n){"use strict";var r=n(9565),o=n(2360),s=n(6699),a=n(6279),i=n(8227),c=n(1181),l=n(5966),u=n(7657).IteratorPrototype,d=n(2529),p=n(9539),f=n(1385),h=i("toStringTag"),m="IteratorHelper",y="WrapForValidIterator",v="normal",g="throw",b=c.set,x=function(e){var t=c.getterFor(e?y:m);return a(o(u),{next:function(){var n=t(this);if(e)return n.nextHandler();if(n.done)return d(void 0,!0);try{var r=n.nextHandler();return n.returnHandlerResult?r:d(r,n.done)}catch(e){throw n.done=!0,e}},return:function(){var n=t(this),o=n.iterator;if(n.done=!0,e){var s=l(o,"return");return s?r(s,o):d(void 0,!0)}if(n.inner)try{p(n.inner.iterator,v)}catch(e){return p(o,g,e)}if(n.openIters)try{f(n.openIters,v)}catch(e){return p(o,g,e)}return o&&p(o,v),d(void 0,!0)}})},w=x(!0),_=x(!1);s(_,h,"Iterator Helper"),e.exports=function(e,t,n){var r=function(r,o){o?(o.iterator=r.iterator,o.next=r.next):o=r,o.type=t?y:m,o.returnHandlerResult=!!n,o.nextHandler=e,o.counter=0,o.done=!1,b(this,o)};return r.prototype=t?w:_,r}},684(e){"use strict";e.exports=function(e,t){var n="function"==typeof Iterator&&Iterator.prototype[e];if(n)try{n.call({next:null},t).next()}catch(e){return!0}}},4549(e,t,n){"use strict";var r=n(4576);e.exports=function(e,t){var n=r.Iterator,o=n&&n.prototype,s=o&&o[e],a=!1;if(s)try{s.call({next:function(){return{done:!0}},return:function(){a=!0}},-1)}catch(e){e instanceof t||(a=!1)}if(!a)return s}},7657(e,t,n){"use strict";var r,o,s,a=n(9039),i=n(4901),c=n(34),l=n(2360),u=n(2787),d=n(6840),p=n(8227),f=n(6395),h=p("iterator"),m=!1;[].keys&&("next"in(s=[].keys())?(o=u(u(s)))!==Object.prototype&&(r=o):m=!0),!c(r)||a(function(){var e={};return r[h].call(e)!==e})?r={}:f&&(r=l(r)),i(r[h])||d(r,h,function(){return this}),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:m}},6269(e){"use strict";e.exports={}},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),o=n(9039),s=n(4901),a=n(9297),i=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),v=r([].join),g=i&&!o(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),(!a(e,"name")||c&&e.name!==t)&&(i?h(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&a(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?i&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=d(e);return a(r,"source")||(r.source=v(b,"string"==typeof t?t:"")),e};Function.prototype.toString=x(function(){return s(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)}},2360(e,t,n){"use strict";var r,o=n(8551),s=n(6801),a=n(8727),i=n(421),c=n(397),l=n(4055),u=n(6119),d="prototype",p="script",f=u("IE_PROTO"),h=function(){},m=function(e){return"<"+p+">"+e+"</"+p+">"},y=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;v="undefined"!=typeof document?document.domain&&r?y(r):(t=l("iframe"),n="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):y(r);for(var o=a.length;o--;)delete v[d][a[o]];return v()};i[f]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h[d]=o(e),n=new h,h[d]=null,n[f]=e):n=v(),void 0===t?n:s.f(n,t)}},6801(e,t,n){"use strict";var r=n(3724),o=n(8686),s=n(4913),a=n(8551),i=n(5397),c=n(1072);t.f=r&&!o?Object.defineProperties:function(e,t){a(e);for(var n,r=i(t),o=c(t),l=o.length,u=0;l>u;)s.f(e,n=o[u++],r[n]);return e}},4913(e,t,n){"use strict";var r=n(3724),o=n(5917),s=n(8686),a=n(8551),i=n(6969),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",f="writable";t.f=r?s?function(e,t,n){if(a(e),t=i(t),a(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(a(e),t=i(t),a(n),o)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),o=n(9565),s=n(8773),a=n(6980),i=n(5397),c=n(6969),l=n(9297),u=n(5917),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=i(e),t=c(t),u)try{return d(e,t)}catch(e){}if(l(e,t))return a(!o(s.f,e,t),e[t])}},8480(e,t,n){"use strict";var r=n(1828),o=n(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},3717(e,t){"use strict";t.f=Object.getOwnPropertySymbols},2787(e,t,n){"use strict";var r=n(9297),o=n(4901),s=n(8981),a=n(6119),i=n(2211),c=a("IE_PROTO"),l=Object,u=l.prototype;e.exports=i?l.getPrototypeOf:function(e){var t=s(e);if(r(t,c))return t[c];var n=t.constructor;return o(n)&&t instanceof n?n.prototype:t instanceof l?u:null}},1625(e,t,n){"use strict";var r=n(9504);e.exports=r({}.isPrototypeOf)},1828(e,t,n){"use strict";var r=n(9504),o=n(9297),s=n(5397),a=n(9617).indexOf,i=n(421),c=r([].push);e.exports=function(e,t){var n,r=s(e),l=0,u=[];for(n in r)!o(i,n)&&o(r,n)&&c(u,n);for(;t.length>l;)o(r,n=t[l++])&&(~a(u,n)||c(u,n));return u}},1072(e,t,n){"use strict";var r=n(1828),o=n(8727);e.exports=Object.keys||function(e){return r(e,o)}},8773(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},4270(e,t,n){"use strict";var r=n(9565),o=n(4901),s=n(34),a=TypeError;e.exports=function(e,t){var n,i;if("string"===t&&o(n=e.toString)&&!s(i=r(n,e)))return i;if(o(n=e.valueOf)&&!s(i=r(n,e)))return i;if("string"!==t&&o(n=e.toString)&&!s(i=r(n,e)))return i;throw new a("Can't convert object to primitive value")}},5031(e,t,n){"use strict";var r=n(7751),o=n(9504),s=n(8480),a=n(3717),i=n(8551),c=o([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=s.f(i(e)),n=a.f;return n?c(t,n(e)):t}},7750(e,t,n){"use strict";var r=n(4117),o=TypeError;e.exports=function(e){if(r(e))throw new o("Can't call method on "+e);return e}},9286(e,t,n){"use strict";var r=n(4402),o=n(8469),s=r.Set,a=r.add;e.exports=function(e){var t=new s;return o(e,function(e){a(t,e)}),t}},3440(e,t,n){"use strict";var r=n(7080),o=n(4402),s=n(9286),a=n(5170),i=n(3789),c=n(8469),l=n(507),u=o.has,d=o.remove;e.exports=function(e){var t=r(this),n=i(e),o=s(t);return a(t)<=n.size?c(t,function(e){n.includes(e)&&d(o,e)}):l(n.getIterator(),function(e){u(o,e)&&d(o,e)}),o}},4402(e,t,n){"use strict";var r=n(9504),o=Set.prototype;e.exports={Set,add:r(o.add),has:r(o.has),remove:r(o.delete),proto:o}},8750(e,t,n){"use strict";var r=n(7080),o=n(4402),s=n(5170),a=n(3789),i=n(8469),c=n(507),l=o.Set,u=o.add,d=o.has;e.exports=function(e){var t=r(this),n=a(e),o=new l;return s(t)>n.size?c(n.getIterator(),function(e){d(t,e)&&u(o,e)}):i(t,function(e){n.includes(e)&&u(o,e)}),o}},4449(e,t,n){"use strict";var r=n(7080),o=n(4402).has,s=n(5170),a=n(3789),i=n(8469),c=n(507),l=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(s(t)<=n.size)return!1!==i(t,function(e){if(n.includes(e))return!1},!0);var u=n.getIterator();return!1!==c(u,function(e){if(o(t,e))return l(u,"normal",!1)})}},3838(e,t,n){"use strict";var r=n(7080),o=n(5170),s=n(8469),a=n(3789);e.exports=function(e){var t=r(this),n=a(e);return!(o(t)>n.size)&&!1!==s(t,function(e){if(!n.includes(e))return!1},!0)}},8527(e,t,n){"use strict";var r=n(7080),o=n(4402).has,s=n(5170),a=n(3789),i=n(507),c=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(s(t)<n.size)return!1;var l=n.getIterator();return!1!==i(l,function(e){if(!o(t,e))return c(l,"normal",!1)})}},8469(e,t,n){"use strict";var r=n(9504),o=n(507),s=n(4402),a=s.Set,i=s.proto,c=r(i.forEach),l=r(i.keys),u=l(new a).next;e.exports=function(e,t,n){return n?o({iterator:l(e),next:u},t):c(e,t)}},4916(e,t,n){"use strict";var r=n(7751),o=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},s=function(e){return{size:e,has:function(){return!0},keys:function(){throw new Error("e")}}};e.exports=function(e,t){var n=r("Set");try{(new n)[e](o(0));try{return(new n)[e](o(-1)),!1}catch(r){if(!t)return!0;try{return(new n)[e](s(-1/0)),!1}catch(r){return t(new n([1,2])[e](s(1/0)))}}}catch(e){return!1}}},9835(e){"use strict";e.exports=function(e){try{var t=new Set,n={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return t.clear(),t.add(4),function(){return{done:!0}}}})}},r=t[e](n);return 1===r.size&&4===r.values().next().value}catch(e){return!1}}},5170(e,t,n){"use strict";var r=n(6706),o=n(4402);e.exports=r(o.proto,"size","get")||function(e){return e.size}},3650(e,t,n){"use strict";var r=n(7080),o=n(4402),s=n(9286),a=n(3789),i=n(507),c=o.add,l=o.has,u=o.remove;e.exports=function(e){var t=r(this),n=a(e).getIterator(),o=s(t);return i(n,function(e){l(t,e)?u(o,e):c(o,e)}),o}},4204(e,t,n){"use strict";var r=n(7080),o=n(4402).add,s=n(9286),a=n(3789),i=n(507);e.exports=function(e){var t=r(this),n=a(e).getIterator(),c=s(t);return i(n,function(e){o(c,e)}),c}},6119(e,t,n){"use strict";var r=n(5745),o=n(3392),s=r("keys");e.exports=function(e){return s[e]||(s[e]=o(e))}},7629(e,t,n){"use strict";var r=n(6395),o=n(4576),s=n(9433),a="__core-js_shared__",i=e.exports=o[a]||s(a,{});(i.versions||(i.versions=[])).push({version:"3.48.0",mode:r?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.48.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),o=n(9039),s=n(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!o(function(){var e=Symbol("symbol detection");return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41})},5610(e,t,n){"use strict";var r=n(1291),o=Math.max,s=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):s(n,t)}},5397(e,t,n){"use strict";var r=n(7055),o=n(7750);e.exports=function(e){return r(o(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),o=Math.min;e.exports=function(e){var t=r(e);return t>0?o(t,9007199254740991):0}},8981(e,t,n){"use strict";var r=n(7750),o=Object;e.exports=function(e){return o(r(e))}},2777(e,t,n){"use strict";var r=n(9565),o=n(34),s=n(757),a=n(5966),i=n(4270),c=n(8227),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!o(e)||s(e))return e;var n,c=a(e,u);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!o(n)||s(n))return n;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),i(e,t)}},6969(e,t,n){"use strict";var r=n(2777),o=n(757);e.exports=function(e){var t=r(e,"string");return o(t)?t:t+""}},2140(e,t,n){"use strict";var r={};r[n(8227)("toStringTag")]="z",e.exports="[object z]"===String(r)},655(e,t,n){"use strict";var r=n(6955),o=String;e.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return o(e)}},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),o=0,s=Math.random(),a=r(1.1.toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+s,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),o=n(9039);e.exports=r&&o(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},2812(e){"use strict";var t=TypeError;e.exports=function(e,n){if(e<n)throw new t("Not enough arguments");return e}},8622(e,t,n){"use strict";var r=n(4576),o=n(4901),s=r.WeakMap;e.exports=o(s)&&/native code/.test(String(s))},8227(e,t,n){"use strict";var r=n(4576),o=n(5745),s=n(9297),a=n(3392),i=n(4495),c=n(7040),l=r.Symbol,u=o("wks"),d=c?l.for||l:l&&l.withoutSetter||a;e.exports=function(e){return s(u,e)||(u[e]=i&&s(l,e)?l[e]:d("Symbol."+e)),u[e]}},8107(e,t,n){"use strict";var r=n(6518),o=n(8981),s=n(6198),a=n(1291),i=n(6469);r({target:"Array",proto:!0},{at:function(e){var t=o(this),n=s(t),r=a(e),i=r>=0?r:n+r;return i<0||i>=n?void 0:t[i]}}),i("at")},4114(e,t,n){"use strict";var r=n(6518),o=n(8981),s=n(6198),a=n(4527),i=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=o(this),n=s(t),r=arguments.length;i(n+r);for(var c=0;c<r;c++)t[n]=arguments[c],n++;return a(t,n),n}})},8111(e,t,n){"use strict";var r=n(6518),o=n(4576),s=n(679),a=n(8551),i=n(4901),c=n(2787),l=n(2106),u=n(4659),d=n(9039),p=n(9297),f=n(8227),h=n(7657).IteratorPrototype,m=n(3724),y=n(6395),v="constructor",g="Iterator",b=f("toStringTag"),x=TypeError,w=o[g],_=y||!i(w)||w.prototype!==h||!d(function(){w({})}),C=function(){if(s(this,h),c(this)===h)throw new x("Abstract class Iterator not directly constructable")},S=function(e,t){m?l(h,e,{configurable:!0,get:function(){return t},set:function(t){if(a(this),this===h)throw new x("You can't redefine this property");p(this,e)?this[e]=t:u(this,e,t)}}):h[e]=t};p(h,b)||S(b,g),!_&&p(h,v)&&h[v]!==Object||S(v,C),C.prototype=h,r({global:!0,constructor:!0,forced:_},{Iterator:C})},1148(e,t,n){"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("every",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{every:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;return!s(t,function(t,r){if(!e(t,n++))return r()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},2489(e,t,n){"use strict";var r=n(6518),o=n(9565),s=n(9306),a=n(8551),i=n(1767),c=n(9462),l=n(6319),u=n(6395),d=n(9539),p=n(684),f=n(4549),h=!u&&!p("filter",function(){}),m=!u&&!h&&f("filter",TypeError),y=u||h||m,v=c(function(){for(var e,t,n=this.iterator,r=this.predicate,s=this.next;;){if(e=a(o(s,n)),this.done=!!e.done)return;if(t=e.value,l(n,r,[t,this.counter++],!0))return t}});r({target:"Iterator",proto:!0,real:!0,forced:y},{filter:function(e){a(this);try{s(e)}catch(e){d(this,"throw",e)}return m?o(m,this,e):new v(i(this),{predicate:e})}})},116(e,t,n){"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("find",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{find:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;return s(t,function(t,r){if(e(t,n++))return r(t)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},7588(e,t,n){"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("forEach",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{forEach:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;s(t,function(t){e(t,n++)},{IS_RECORD:!0})}})},1701(e,t,n){"use strict";var r=n(6518),o=n(9565),s=n(9306),a=n(8551),i=n(1767),c=n(9462),l=n(6319),u=n(9539),d=n(684),p=n(4549),f=n(6395),h=!f&&!d("map",function(){}),m=!f&&!h&&p("map",TypeError),y=f||h||m,v=c(function(){var e=this.iterator,t=a(o(this.next,e));if(!(this.done=!!t.done))return l(e,this.mapper,[t.value,this.counter++],!0)});r({target:"Iterator",proto:!0,real:!0,forced:y},{map:function(e){a(this);try{s(e)}catch(e){u(this,"throw",e)}return m?o(m,this,e):new v(i(this),{mapper:e})}})},8237(e,t,n){"use strict";var r=n(6518),o=n(2652),s=n(9306),a=n(8551),i=n(1767),c=n(9539),l=n(4549),u=n(8745),d=n(9039),p=TypeError,f=d(function(){[].keys().reduce(function(){},void 0)}),h=!f&&l("reduce",p);r({target:"Iterator",proto:!0,real:!0,forced:f||h},{reduce:function(e){a(this);try{s(e)}catch(e){c(this,"throw",e)}var t=arguments.length<2,n=t?void 0:arguments[1];if(h)return u(h,this,t?[e]:[e,n]);var r=i(this),l=0;if(o(r,function(r){t?(t=!1,n=r):n=e(n,r,l),l++},{IS_RECORD:!0}),t)throw new p("Reduce of empty iterator with no initial value");return n}})},3579(e,t,n){"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("some",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{some:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;return s(t,function(t,r){if(e(t,n++))return r()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},7642(e,t,n){"use strict";var r=n(6518),o=n(3440),s=n(9039);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("difference",function(e){return 0===e.size})||s(function(){var e={size:1,has:function(){return!0},keys:function(){var e=0;return{next:function(){var n=e++>1;return t.has(1)&&t.clear(),{done:n,value:2}}}}},t=new Set([1,2,3,4]);return 3!==t.difference(e).size})},{difference:o})},8004(e,t,n){"use strict";var r=n(6518),o=n(9039),s=n(8750);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("intersection",function(e){return 2===e.size&&e.has(1)&&e.has(2)})||o(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:s})},3853(e,t,n){"use strict";var r=n(6518),o=n(4449);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isDisjointFrom",function(e){return!e})},{isDisjointFrom:o})},5876(e,t,n){"use strict";var r=n(6518),o=n(3838);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSubsetOf",function(e){return e})},{isSubsetOf:o})},2475(e,t,n){"use strict";var r=n(6518),o=n(8527);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSupersetOf",function(e){return!e})},{isSupersetOf:o})},5024(e,t,n){"use strict";var r=n(6518),o=n(3650),s=n(9835);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("symmetricDifference")||!s("symmetricDifference")},{symmetricDifference:o})},1698(e,t,n){"use strict";var r=n(6518),o=n(4204),s=n(9835);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("union")||!s("union")},{union:o})},8992(e,t,n){"use strict";n(8111)},3215(e,t,n){"use strict";n(1148)},4520(e,t,n){"use strict";n(2489)},2577(e,t,n){"use strict";n(116)},3949(e,t,n){"use strict";n(7588)},1454(e,t,n){"use strict";n(1701)},8872(e,t,n){"use strict";n(8237)},7550(e,t,n){"use strict";n(3579)},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)},4603(e,t,n){"use strict";var r=n(6840),o=n(9504),s=n(655),a=n(2812),i=URLSearchParams,c=i.prototype,l=o(c.append),u=o(c.delete),d=o(c.forEach),p=o([].push),f=new i("a=1&a=2&b=3");f.delete("a",1),f.delete("b",void 0),f+""!="a=2"&&r(c,"delete",function(e){var t=arguments.length,n=t<2?void 0:arguments[1];if(t&&void 0===n)return u(this,e);var r=[];d(this,function(e,t){p(r,{key:t,value:e})}),a(t,1);for(var o,i=s(e),c=s(n),f=0,h=0,m=!1,y=r.length;f<y;)o=r[f++],m||o.key===i?(m=!0,u(this,o.key)):h++;for(;h<y;)(o=r[h++]).key===i&&o.value===c||l(this,o.key,o.value)},{enumerable:!0,unsafe:!0})},7566(e,t,n){"use strict";var r=n(6840),o=n(9504),s=n(655),a=n(2812),i=URLSearchParams,c=i.prototype,l=o(c.getAll),u=o(c.has),d=new i("a=1");!d.has("a",2)&&d.has("a",void 0)||r(c,"has",function(e){var t=arguments.length,n=t<2?void 0:arguments[1];if(t&&void 0===n)return u(this,e);var r=l(this,e);a(t,1);for(var o=s(n),i=0;i<r.length;)if(r[i++]===o)return!0;return!1},{enumerable:!0,unsafe:!0})},8721(e,t,n){"use strict";var r=n(3724),o=n(9504),s=n(2106),a=URLSearchParams.prototype,i=o(a.forEach);r&&!("size"in a)&&s(a,"size",{get:function(){var e=0;return i(this,function(){e++}),e},configurable:!0,enumerable:!0})}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.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 o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})();var r={};(()=>{"use strict";n.r(r),n.d(r,{API:()=>H,AgentInfo:()=>kl,Chat:()=>hc,ChatFrame:()=>il,ComponentFilter:()=>bi,Conversation:()=>oc,Engine:()=>wl,EntryContainer:()=>ol,EventParticipant:()=>ca,ExternalApi:()=>Sl,Header:()=>Ol,Icon:()=>fa,Interrupt:()=>al,MessageContainer:()=>la,SeamlyActivityEventContext:()=>na,SeamlyActivityMonitor:()=>xi,SeamlyApiContext:()=>xs,SeamlyEventBusContext:()=>ws,SeamlyFileUpload:()=>Ci,SeamlyGeneralError:()=>v,SeamlyLiveRegionContext:()=>Ts,SeamlyOfflineError:()=>hr,SeamlyStoreProvider:()=>cn,Text:()=>hi,TextEntry:()=>Xc,Upload:()=>nl,View:()=>bl,appReducer:()=>fr,appStorageProvider:()=>jl,calculateVisibility:()=>Xt,className:()=>qs,configReducer:()=>lr,cookieStorageProvider:()=>Nl,default:()=>Ul,eventTypes:()=>w,formsReducer:()=>Tr,getSearchParamsByKeys:()=>Al,getUrlSearchParams:()=>Ll,getUrlSearchString:()=>Rl,i18nReducer:()=>Rr,initResetSearchParams:()=>Ml,interruptReducer:()=>Fr,randomId:()=>z,replaceSearchParams:()=>Pl,sessionStorageProvider:()=>x,setConfig:()=>ar,setInitialLocale:()=>Or,setParticipant:()=>bo,setPreChatEvents:()=>cr,setTranslations:()=>Lr,stateReducer:()=>Po,timeout:()=>Us,translationReducer:()=>Go,useChoicePrompt:()=>_a,useEvents:()=>An,useGeneratedId:()=>aa,useI18n:()=>ys,useSeamlyActions:()=>El,useSeamlyChat:()=>Ls,useSeamlyCommands:()=>js,useSeamlyConfig:()=>gn,useSeamlyEventStream:()=>ia,useSeamlyIdleDetachCountdown:()=>oa,useSeamlyMessageContainerClassNames:()=>Js,useSeamlyOptions:()=>ea,useSeamlyVisibility:()=>vs,useTranslatedEventData:()=>Hs,useTranslations:()=>$s,useTranslationsContainer:()=>Ws,visibilityReducer:()=>Jo,visibilityStates:()=>Kt}),n(9497),n(4114),n(8992),n(4520),n(3949),n(1454),n(7550),n(4603),n(7566),n(8721),n(3375),n(9225),n(3972),n(9209),n(5714),n(7561),n(6197),n(8872);var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return a}var s=function(e,t){this.target=t,this.type=e},a=function(e){function n(t,n){var r=e.call(this,"error",n)||this;return r.message=t.message,r.error=t,r}return t(n,e),n}(s),i=function(e){function n(t,n,r){void 0===t&&(t=1e3),void 0===n&&(n="");var o=e.call(this,"close",r)||this;return o.wasClean=!0,o.code=t,o.reason=n,o}return t(n,e),n}(s),c=function(){if("undefined"!=typeof WebSocket)return WebSocket},l={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},u=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?l.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?l.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 o=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),s=o.next();!s.done;s=o.next()){var a=s.value;this._callEventListener(e,a)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}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(o(arguments[t]));return e}(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,n=void 0===t?l.reconnectionDelayGrowFactor:t,r=e.minReconnectionDelay,o=void 0===r?l.minReconnectionDelay:r,s=e.maxReconnectionDelay,a=void 0===s?l.maxReconnectionDelay:s,i=0;return this._retryCount>0&&(i=o*Math.pow(n,this._retryCount-1))>a&&(i=a),this._debug("next delay",i),i},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?l.maxRetries:n,o=t.connectionTimeout,s=void 0===o?l.connectionTimeout:o,a=t.WebSocket,i=void 0===a?c():a;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===(u=i)||!u||2!==u.CLOSING)throw Error("No valid WebSocket class provided");var u;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 i(t,e._protocols):new i(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout(function(){return e._handleTimeout()},s))})}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new a(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 i(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 d=u,p=new Set;class f{#e=[];#t=null;#n=null;#r=e=>{const t=JSON.parse(e.data);this.#t&&clearInterval(this.#t),this.#t=setInterval(()=>{this.socket?.readyState===d.OPEN&&this.socket?.send(JSON.stringify({type:"ping"}))},3e4);try{if("attach_channel_response"===t.type){if(!t.payload.success)return void this.#o({connected:!0,ready:!1,currentState:"attach_channel_erred"});this.#o({connected:!0,ready:!0,currentState:"attach_channel_response"})}}catch(e){console.warn(e)}};#s=()=>{this.#o({connected:!1,ready:!1,currentState:"socket_closed"})};#a=()=>{this.#o({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:o}=(e=>{const t=e.indexOf("?");return t<0?{url:e,params:{}}:{url:e.slice(0,t),params:e.slice(t+1).split("&").reduce((e,t)=>{const[n,r]=t.split("=");return{...e,[n]:decodeURIComponent(r)}},{})}})(this.url);this.socket=new d(o,[],{maxReconnectionDelay:1e4,minReconnectionDelay:500,reconnectionDelayGrowFactor:2});const s={type:"attach_channel",payload:{accessToken:this.accessToken,channelName:this.channelName}};this.#n=()=>{this.socket?.send(JSON.stringify(s)),this.#o({connected:!0,ready:!1,currentState:"socket_connected"})},this.socket?.addEventListener("open",this.#n),this.socket?.addEventListener("message",this.#r),this.socket?.addEventListener("close",this.#s),this.socket?.addEventListener("error",this.#a)}disconnect(){this.socket?.close(),this.#n&&this.socket?.removeEventListener("open",this.#n),this.socket?.removeEventListener("message",this.#r),this.socket?.removeEventListener("close",this.#s),this.socket?.removeEventListener("error",this.#a),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)}#o(e){this.#e=this.#e.filter(t=>!t(e)),p.forEach(e=>e())}pushToChannel(e,t){this.socket?.send(JSON.stringify({type:e,payload:t}))}static subscribe(e){return p.add(e),()=>p.delete(e)}}class h extends Error{constructor(e,t){super(e,{cause:t?.cause}),this.status=t?.status}}class m 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 y extends m{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class v extends m{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class g extends m{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class b extends m{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}function x(e){const t=`cvco.${e}`;return{get(){const e=[t,t.split(".").slice(0,-1).join(".")];let n;do{n=sessionStorage.getItem(e[0])}while(e.shift()&&!n);return n?JSON.parse(n):{}},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}const w={info:"info",message:"message",participant:"participant",system:"system"},_="text",C="text",S="upload",E="received",j="read",T="custom",I="detach_service",N="dismiss",k="set_topic",O="click_card",L="translation_proposal",R=L,A="window_api",P="assertive",M="polite",U={new_topic:"newTopic",new_translation:"newTranslation"},D="uploads",F="navigate";function z(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}const B=async(e,t)=>{const n=new URL(e),r=await fetch(n.href,{mode:"cors",...t});if(!r.ok)throw new h(r.statusText||`Request failed with status: ${r.status}`,{status:r.status});return r};function V(){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 $=()=>null;class H{#i;#c;#l;#u="window";#d;#p="new";URLS={};locale="";conversation=new f;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||x),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.#i=!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/v3/client/${this.connectionInfo.apiKey}/translations/{version}/{locale}.json`,templated:!0},config:{href:`/channels/api/v3/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 y;const t=`${this.#h("http")}${this.URLS.translations.href}`.replace("{version}",String(4)).replace("{locale}",this.getLocale(e)),n=await B(t,{method:"GET"});return(await n.json()).translations}catch(e){if(e.status>=500)throw new v(e);throw new h(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 o=this.#d.context?.userLocale;return{...o?{userLocale:o}:{},...e}}async downloadFile(e,t){try{const n=await B(`${this.#h("http")}${this.URLS.uploads.href}/${e}`,{method:"GET",headers:{Authorization:`Bearer ${this.getAccessToken()}`}}),r=document.createElement("a"),o=URL.createObjectURL(await n.blob());r.href=o,void 0!==r.download&&(r.download=t),r.click(),setTimeout(()=>{URL.revokeObjectURL(o)},6e4)}catch(e){}}uploadFile(e,t,n,r){const o=new FormData;o.append("upload",e);const s=new XMLHttpRequest;return s.open("POST",`${this.#h("http")}${this.URLS.uploads.href}`),s.setRequestHeader("Authorization",`Bearer ${this.getAccessToken()}`),s.upload.onprogress=e=>{if("function"==typeof t){const n=Math.ceil(e.loaded/e.total*100);t(n)}},s.onloadend=()=>{if(0!==s.status)if(200!==s.status&&201!==s.status||!n){if(!r)throw new Error(s.response);try{r(JSON.parse(s.response))}catch(e){r(s.response)}}else try{n(JSON.parse(s.response))}catch(e){n(s.response)}},s.send(o),s}async createConversation(){try{"function"==typeof this.#d?.getConversationAuthToken&&(this.#l=await this.#d.getConversationAuthToken());const e=await B(`${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 v(e);if(400===e.status)throw new b(e);if(404===e.status)throw new y(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 B(`${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 y(e);if(e.status>=500)throw new v(e);throw e}}async fetchConversation(){if(!this.hasConversation())return null;try{const e=await B(`${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 b(e);if(404===e.status)throw new g(e);if(e.status>=500)throw new v(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.#i=t}),this.send("context",this.#y())),e}send(e,t=void 0){this.connected&&this.#i?($("[SEND]",e,t),this.conversation.pushToChannel(e,function(e,t){if("message"!==e)return t;const{type:n,body:r}=t;let{transactionId:o}=t;return o||(o=z()),{type:n,body:r,transactionId:o}}(e,t))):this.conversation?.onConnection(({connected:n,ready:r})=>(this.connected=n,this.#i=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=A)}getEnvironment(){return{clientName:"@seamly/web-ui",clientVariant:this.#u,clientVersion:"25.4.0-beta.1",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:V(),userAgent:navigator.userAgent,preferredLocale:navigator.language}}}var W=Symbol.for("immer-nothing"),G=Symbol.for("immer-draftable"),q=Symbol.for("immer-state");function K(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var J=Object,X=J.getPrototypeOf,Y="constructor",Q="prototype",Z="configurable",ee="enumerable",te="writable",ne="value",re=e=>!!e&&!!e[q];function oe(e){return!!e&&(ie(e)||fe(e)||!!e[G]||!!e[Y]?.[G]||he(e)||me(e))}var se=J[Q][Y].toString(),ae=new WeakMap;function ie(e){if(!e||!ye(e))return!1;const t=X(e);if(null===t||t===J[Q])return!0;const n=J.hasOwnProperty.call(t,Y)&&t[Y];if(n===Object)return!0;if(!ve(n))return!1;let r=ae.get(n);return void 0===r&&(r=Function.toString.call(n),ae.set(n,r)),r===se}function ce(e,t,n=!0){0===le(e)?(n?Reflect.ownKeys(e):J.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function le(e){const t=e[q];return t?t.type_:fe(e)?1:he(e)?2:me(e)?3:0}var ue=(e,t,n=le(e))=>2===n?e.has(t):J[Q].hasOwnProperty.call(e,t),de=(e,t,n=le(e))=>2===n?e.get(t):e[t],pe=(e,t,n,r=le(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n},fe=Array.isArray,he=e=>e instanceof Map,me=e=>e instanceof Set,ye=e=>"object"==typeof e,ve=e=>"function"==typeof e,ge=e=>"boolean"==typeof e,be=e=>e.copy_||e.base_,xe=e=>e.modified_?e.copy_:e.base_;function we(e,t){if(he(e))return new Map(e);if(me(e))return new Set(e);if(fe(e))return Array[Q].slice.call(e);const n=ie(e);if(!0===t||"class_only"===t&&!n){const t=J.getOwnPropertyDescriptors(e);delete t[q];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],s=t[o];!1===s[te]&&(s[te]=!0,s[Z]=!0),(s.get||s.set)&&(t[o]={[Z]:!0,[te]:!0,[ee]:s[ee],[ne]:e[o]})}return J.create(X(e),t)}{const t=X(e);if(null!==t&&n)return{...e};const r=J.create(t);return J.assign(r,e)}}function _e(e,t=!1){return Se(e)||re(e)||!oe(e)||(le(e)>1&&J.defineProperties(e,{set:Ce,add:Ce,clear:Ce,delete:Ce}),J.freeze(e),t&&ce(e,(e,t)=>{_e(t,!0)},!1)),e}var Ce={[ne]:function(){K(2)}};function Se(e){return null===e||!ye(e)||J.isFrozen(e)}var Ee,je="MapSet",Te="Patches",Ie={};function Ne(e){const t=Ie[e];return t||K(0),t}var ke=()=>Ee;function Oe(e,t){t&&(e.patchPlugin_=Ne(Te),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Le(e){Re(e),e.drafts_.forEach(Pe),e.drafts_=null}function Re(e){e===Ee&&(Ee=e.parent_)}var Ae=e=>{return Ee={drafts_:[],parent_:Ee,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:(t=je,Ie[t]?Ne(je):void 0)};var t};function Pe(e){const t=e[q];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Me(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[q].modified_&&(Le(t),K(4)),oe(e)&&(e=Ue(t,e));const{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[q].base_,e,t)}else e=Ue(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&_e(t,n)}(t,e,!0),Le(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==W?e:void 0}function Ue(e,t){if(Se(t))return t;const n=t[q];if(!n)return $e(t,e.handledSet_,e);if(!Fe(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);Ve(n,e)}return n.copy_}function De(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Fe=(e,t)=>e.scope_===t,ze=[];function Be(e,t,n,r){const o=be(e),s=e.type_;if(void 0!==r&&de(o,r,s)===t)return void pe(o,r,n,s);if(!e.draftLocations_){const t=e.draftLocations_=new Map;ce(o,(e,n)=>{if(re(n)){const r=t.get(n)||[];r.push(e),t.set(n,r)}})}const a=e.draftLocations_.get(t)??ze;for(const e of a)pe(o,e,n,s)}function Ve(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const r=n.getPath(e);r&&n.generatePatches_(e,r,t)}De(e)}}function $e(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||re(e)||t.has(e)||!oe(e)||Se(e)||(t.add(e),ce(e,(r,o)=>{if(re(o)){const t=o[q];if(Fe(t,n)){const n=xe(t);pe(e,r,n,e.type_),De(t)}}else oe(o)&&$e(o,t,n)})),e}var He={get(e,t){if(t===q)return e;const n=be(e);if(!ue(n,t,e.type_))return function(e,t,n){const r=qe(t,n);return r?ne in r?r[ne]:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];if(e.finalized_||!oe(r))return r;if(r===Ge(e.base_,t)){Je(e);const n=1===e.type_?+t:t,o=Xe(e.scope_,r,e,n);return e.copy_[n]=o}return r},has:(e,t)=>t in be(e),ownKeys:e=>Reflect.ownKeys(be(e)),set(e,t,n){const r=qe(be(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Ge(be(e),t),a=r?.[q];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(((o=n)===(s=r)?0!==o||1/o==1/s:o!=o&&s!=s)&&(void 0!==n||ue(e.base_,t,e.type_)))return!0;Je(e),Ke(e)}var o,s;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_.set(t,!0),function(e,t,n){const{scope_:r}=e;if(re(n)){const o=n[q];Fe(o,r)&&o.callbacks_.push(function(){Je(e);const r=xe(o);Be(e,n,r,t)})}else oe(n)&&e.callbacks_.push(function(){const o=be(e);de(o,t,e.type_)===n&&r.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&$e(de(e.copy_,t,e.type_),r.handledSet_,r)})}(e,t,n)),!0},deleteProperty:(e,t)=>(Je(e),void 0!==Ge(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),Ke(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=be(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[te]:!0,[Z]:1!==e.type_||"length"!==t,[ee]:r[ee],[ne]:n[t]}:r},defineProperty(){K(11)},getPrototypeOf:e=>X(e.base_),setPrototypeOf(){K(12)}},We={};function Ge(e,t){const n=e[q];return(n?be(n):e)[t]}function qe(e,t){if(!(t in e))return;let n=X(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=X(n)}}function Ke(e){e.modified_||(e.modified_=!0,e.parent_&&Ke(e.parent_))}function Je(e){e.copy_||(e.assigned_=new Map,e.copy_=we(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function Xe(e,t,n,r){const[o,s]=he(t)?Ne(je).proxyMap_(t,n):me(t)?Ne(je).proxySet_(t,n):function(e,t){const n=fe(e),r={type_:n?1:0,scope_:t?t.scope_:ke(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let o=r,s=He;n&&(o=[r],s=We);const{revoke:a,proxy:i}=Proxy.revocable(o,s);return r.draft_=i,r.revoke_=a,[i,r]}(t,n);return(n?.scope_??ke()).drafts_.push(o),s.callbacks_=n?.callbacks_??[],s.key_=r,n&&void 0!==r?function(e,t,n){e.callbacks_.push(function(r){const o=t;if(!o||!Fe(o,r))return;r.mapSetPlugin_?.fixSetContents(o);const s=xe(o);Be(e,o.draft_??o,s,n),Ve(o,r)})}(n,s,r):s.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(s);const{patchPlugin_:t}=e;s.modified_&&t&&t.generatePatches_(s,[],e)}),o}function Ye(e){if(!oe(e)||Se(e))return e;const t=e[q];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=we(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=we(e,!0);return ce(n,(e,t)=>{pe(n,e,Ye(t))},r),t&&(t.finalized_=!1),n}ce(He,(e,t)=>{We[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}),We.deleteProperty=function(e,t){return We.set.call(this,e,t,void 0)},We.set=function(e,t,n){return He.set.call(this,e[0],t,n,e[0])};var Qe=(new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(ve(e)&&!ve(t)){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,e=>t.call(this,e,...o))}}let r;if(ve(t)||K(6),void 0===n||ve(n)||K(7),oe(e)){const o=Ae(this),s=Xe(0,e,void 0);let a=!0;try{r=t(s),a=!1}finally{a?Le(o):Re(o)}return Oe(o,n),Me(r,o)}if(!e||!ye(e)){if(r=t(e),void 0===r&&(r=e),r===W&&(r=void 0),this.autoFreeze_&&_e(r,!0),n){const t=[],o=[];Ne(Te).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:o}),n(t,o)}return r}K(1)},this.produceWithPatches=(e,t)=>{if(ve(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]},ge(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),ge(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),ge(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){var t;oe(e)||K(8),re(e)&&(re(t=e)||K(10),e=Ye(t));const n=Ae(this),r=Xe(0,e,void 0);return r[q].isManual_=!0,Re(n),r}finishDraft(e,t){const n=e&&e[q];n&&n.isManual_||K(9);const{scope_:r}=n;return Oe(r,t),Me(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}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(Te).applyPatches_;return re(e)?r(e,t):this.produce(e,e=>r(e,t))}}).produce;function Ze(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 et=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),tt=()=>Math.random().toString(36).substring(7).split("").join("."),nt={INIT:`@@redux/INIT${tt()}`,REPLACE:`@@redux/REPLACE${tt()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${tt()}`};function rt(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 ot(e,t,n){if("function"!=typeof e)throw new Error(Ze(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Ze(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Ze(1));return n(ot)(e,t)}let r=e,o=t,s=new Map,a=s,i=0,c=!1;function l(){a===s&&(a=new Map,s.forEach((e,t)=>{a.set(t,e)}))}function u(){if(c)throw new Error(Ze(3));return o}function d(e){if("function"!=typeof e)throw new Error(Ze(4));if(c)throw new Error(Ze(5));let t=!0;l();const n=i++;return a.set(n,e),function(){if(t){if(c)throw new Error(Ze(6));t=!1,l(),a.delete(n),s=null}}}function p(e){if(!rt(e))throw new Error(Ze(7));if(void 0===e.type)throw new Error(Ze(8));if("string"!=typeof e.type)throw new Error(Ze(17));if(c)throw new Error(Ze(9));try{c=!0,o=r(o,e)}finally{c=!1}return(s=a).forEach(e=>{e()}),e}return p({type:nt.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(Ze(10));r=e,p({type:nt.REPLACE})},[et]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(Ze(11));function n(){const e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[et](){return this}}}}}function st(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o;try{!function(e){Object.keys(e).forEach(t=>{const n=e[t];if(void 0===n(void 0,{type:nt.INIT}))throw new Error(Ze(12));if(void 0===n(void 0,{type:nt.PROBE_UNKNOWN_ACTION()}))throw new Error(Ze(13))})}(n)}catch(e){o=e}return function(e={},t){if(o)throw o;let s=!1;const a={};for(let o=0;o<r.length;o++){const i=r[o],c=n[i],l=e[i],u=c(l,t);if(void 0===u)throw t&&t.type,new Error(Ze(14));a[i]=u,s=s||u!==l}return s=s||r.length!==Object.keys(e).length,s?a:e}}function at(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function it(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var ct=it(),lt=it,ut="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?at:at.apply(null,arguments)},dt=("undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function pt(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(Pt(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 rt(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var ft=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 ht(e){return oe(e)?Qe(e,()=>{}):e}function mt(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var yt=e=>t=>{setTimeout(t,e)};function vt(e){const t=function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let s=new ft;return t&&("boolean"==typeof t?s.push(ct):s.push(lt(t.extraArgument))),s},{reducer:n,middleware:r,devTools:o=!0,duplicateMiddlewareCheck:s=!0,preloadedState:a,enhancers:i}=e||{};let c,l;if("function"==typeof n)c=n;else{if(!rt(n))throw new Error(Pt(1));c=st(n)}l="function"==typeof r?r(t):t();let u=at;o&&(u=ut({trace:!1,..."object"==typeof o&&o}));const d=function(...e){return t=>(n,r)=>{const o=t(n,r);let s=()=>{throw new Error(Ze(15))};const a={getState:o.getState,dispatch:(e,...t)=>s(e,...t)},i=e.map(e=>e(a));return s=at(...i)(o.dispatch),{...o,dispatch:s}}}(...l),p=(e=>function(t){const{autoBatch:n=!0}=t??{};let r=new ft(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,s=!1,a=!1;const i=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:yt(10):"callback"===e.type?e.queueNotification:yt(e.timeout),l=()=>{a=!1,s&&(s=!1,i.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){const t=r.subscribe(()=>o&&e());return i.add(e),()=>{t(),i.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,s=!o,s&&(a||(a=!0,c(l))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r})(d);return ot(c,a,u(..."function"==typeof i?i(p):p()))}function gt(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(Pt(28));if(r in t)throw new Error(Pt(29));return t[r]=n,o},addAsyncThunk:(e,r)=>(r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),o),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),o),addDefaultCase:e=>(r=e,o)};return e(o),[t,n,r]}function bt(...e){return t=>e.some(e=>((e,t)=>dt(e)?e.match(t):e(t))(e,t))}var xt=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},wt=["name","message","stack","code"],_t=class{constructor(e,t){this.payload=e,this.meta=t}_type},Ct=class{constructor(e,t){this.payload=e,this.meta=t}_type},St=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of wt)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},Et="External signal was aborted",jt=(()=>{function e(e,t,n){const r=pt(e+"/fulfilled",(e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}})),o=pt(e+"/pending",(e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}})),s=pt(e+"/rejected",(e,t,r,o,s)=>({payload:o,error:(n&&n.serializeError||St)(e||"Rejected"),meta:{...s||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}}));return Object.assign(function(e,{signal:a}={}){return(i,c,l)=>{const u=n?.idGenerator?n.idGenerator(e):xt(),d=new AbortController;let p,f;function h(e){f=e,d.abort()}a&&(a.aborted?h(Et):a.addEventListener("abort",()=>h(Et),{once:!0}));const m=async function(){let a;try{let s=n?.condition?.(e,{getState:c,extra:l});if(null!==(m=s)&&"object"==typeof m&&"function"==typeof m.then&&(s=await s),!1===s||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const y=new Promise((e,t)=>{p=()=>{t({name:"AbortError",message:f||"Aborted"})},d.signal.addEventListener("abort",p,{once:!0})});i(o(u,e,n?.getPendingMeta?.({requestId:u,arg:e},{getState:c,extra:l}))),a=await Promise.race([y,Promise.resolve(t(e,{dispatch:i,getState:c,extra:l,requestId:u,signal:d.signal,abort:h,rejectWithValue:(e,t)=>new _t(e,t),fulfillWithValue:(e,t)=>new Ct(e,t)})).then(t=>{if(t instanceof _t)throw t;return t instanceof Ct?r(t.payload,u,e,t.meta):r(t,u,e)})])}catch(t){a=t instanceof _t?s(null,u,e,t.payload,t.meta):s(t,u,e)}finally{p&&d.signal.removeEventListener("abort",p)}var m;return n&&!n.dispatchConditionRejection&&s.match(a)&&a.meta.condition||i(a),a}();return Object.assign(m,{abort:h,requestId:u,arg:e,unwrap:()=>m.then(Tt)})}},{pending:o,rejected:s,fulfilled:r,settled:bt(s,r),typePrefix:e})}return e.withTypes=()=>e,e})();function Tt(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var It=Symbol.for("rtk-slice-createasyncthunk");function Nt(e,t){return`${e}/${t}`}function kt({creators:e}={}){const t=e?.asyncThunk?.[It];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(Pt(11));const o=("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)||{},s=Object.keys(o),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},i={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(Pt(12));if(n in a.sliceCaseReducersByType)throw new Error(Pt(13));return a.sliceCaseReducersByType[n]=t,i},addMatcher:(e,t)=>(a.sliceMatchers.push({matcher:e,reducer:t}),i),exposeAction:(e,t)=>(a.actionCreators[e]=t,i),exposeCaseReducer:(e,t)=>(a.sliceCaseReducersByName[e]=t,i)};function c(){const[t={},n=[],r]="function"==typeof e.extraReducers?gt(e.extraReducers):[e.extraReducers],o={...t,...a.sliceCaseReducersByType};return function(e){let t,[s,i,c]=gt(e=>{for(let t in o)e.addCase(t,o[t]);for(let t of a.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=()=>ht(e());else{const n=ht(e);t=()=>n}function l(e=t(),n){let r=[s[n.type],...i.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(re(e)){const r=t(e,n);return void 0===r?e:r}if(oe(e))return Qe(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)}s.forEach(r=>{const s=o[r],a={reducerName:r,type:Nt(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(s)?function({type:e,reducerName:t,createNotation:n},r,o){let s,a;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(Pt(17));s=r.reducer,a=r.prepare}else s=r;o.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,a?pt(e,a):pt(e))}(a,s,i):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error(Pt(18));const{payloadCreator:s,fulfilled:a,pending:i,rejected:c,settled:l,options:u}=n,d=o(e,s,u);r.exposeAction(t,d),a&&r.addCase(d.fulfilled,a),i&&r.addCase(d.pending,i),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:a||Rt,pending:i||Rt,rejected:c||Rt,settled:l||Rt})}(a,s,i,t)});const l=e=>e,u=new Map,d=new WeakMap;let p;function f(e,t){return p||(p=c()),p(e,t)}function h(){return p||(p=c()),p.getInitialState()}function m(t,n=!1){function r(e){let o=e[t];return void 0===o&&n&&(o=mt(d,r,h)),o}function o(t=l){const r=mt(u,n,()=>new WeakMap);return mt(r,t,()=>{const r={};for(const[o,s]of Object.entries(e.selectors??{}))r[o]=Ot(s,t,()=>mt(d,t,h),n);return r})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const y={name:n,reducer:f,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:h,...m(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:f},n),{...y,...m(o,!0)}}};return y}}function Ot(e,t,n,r){function o(o,...s){let a=t(o);return void 0===a&&r&&(a=n()),e(a,...s)}return o.unwrapped=e,o}var Lt=kt();function Rt(){}var{assign:At}=Object;function Pt(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 Mt extends m{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}const Ut=jt("initializeConfig",async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{try{const{features:e,preChat:r,agentParticipant:o,defaultContentLocale:s,defaultUserLocale:a,userParticipant:i,startChatIcon:c}=await t.getConfig(),{connectWhenInView:l}=n;return{features:e,preChat:r,agentParticipant:o,userParticipant:i,startChatIcon:c,defaultUserLocale:n?.context?.userLocale||a,defaultContentLocale:n?.context?.contentLocale||s,connectWhenInView:l}}catch(e){return r(e)}}),Dt=jt("resetConfig",async(e,{extra:{config:t}})=>t);var Ft=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var zt="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function Bt(){return{s:0,v:void 0,o:null,p:null}}function Vt(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let o,s=0;function a(){let t=n;const{length:a}=arguments;for(let e=0,n=a;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=Bt(),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=Bt(),e.set(n,t)):t=r}}const i=t;let c;if(1===t.s)c=t.v;else if(c=e.apply(null,arguments),s++,r){const e=o?.deref?.()??o;null!=e&&r(e,c)&&(c=e,0!==s&&s--),o="object"==typeof c&&null!==c||"function"==typeof c?new zt(c):c}return i.s=1,i.v=c,c}return a.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},a.resetResultsCount()},a.resultsCount=()=>s,a.resetResultsCount=()=>{s=0},a}function $t(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,s={},a=e.pop();"object"==typeof a&&(s=a,a=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const i={...n,...s},{memoize:c,memoizeOptions:l=[],argsMemoize:u=Vt,argsMemoizeOptions:d=[],devModeChecks:p={}}=i,f=Ft(l),h=Ft(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++,a.apply(null,arguments)},...f),v=u(function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}(m,arguments);return t=y.apply(null,e),t},...h);return Object.assign(v,{resultFunc:a,memoizedResultFunc:y,dependencies:m,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:c,argsMemoize:u})};return Object.assign(r,{withTypes:()=>r}),r}var Ht=$t(Vt),Wt=Object.assign((e,t=Ht)=>{!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:()=>Wt});const Gt=Ht(({app:e})=>e,({userHasResponded:e})=>e),qt="visibility",Kt={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},Jt=Ht(({config:e})=>e,e=>{let t={visible:"inline"===e?.layoutMode?Kt.open:Kt.minimized,appContainerClassNames:e?.appContainerClassNames||[],...e};return"function"==typeof t.appContainerClassNames&&(t={...t,appContainerClassNames:t.appContainerClassNames(t)}),t}),Xt=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:o,layoutMode:s,hideOnNoUserResponse:a}=r,{visible:i}=o||{};if("app"===s&&!t)return Kt.open;if("window"===s&&a&&n!==Kt.open)return e?n||t||Kt.open:Kt.hidden;if("inline"===s&&e&&!n)return t||Kt.open;const c=Kt.minimized;return n||t||i||c};var Yt=n(7402),Qt=n(8418);var Zt={notify(){},get:()=>[]};var en=(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),tn=(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),nn=(()=>en||tn?Yt.useLayoutEffect:Yt.useEffect)();Object.defineProperty,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var rn=Symbol.for("react-redux-context"),on="undefined"!=typeof globalThis?globalThis:{};function sn(){if(!Yt.createContext)return{};const e=on[rn]??=new Map;let t=e.get(Yt.createContext);return t||(t=Yt.createContext(null),e.set(Yt.createContext,t)),t}var an=sn(),cn=function(e){const{children:t,context:n,serverState:r,store:o}=e,s=Yt.useMemo(()=>{const e=function(e,t){let n,r=Zt,o=0,s=!1;function a(){l.onStateChange&&l.onStateChange()}function i(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),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 o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){r&&null!==e&&(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}function c(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=Zt)}const l={addNestedSub:function(e){i();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),c())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:a,isSubscribed:function(){return s},trySubscribe:function(){s||(s=!0,i())},tryUnsubscribe:function(){s&&(s=!1,c())},getListeners:()=>r};return l}(o);return{store:o,subscription:e,getServerState:r?()=>r:void 0}},[o,r]),a=Yt.useMemo(()=>o.getState(),[o]);nn(()=>{const{subscription:e}=s;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),a!==o.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[s,a]);const i=n||an;return Yt.createElement(i.Provider,{value:s},t)};function ln(e=an){return function(){return Yt.useContext(e)}}var un=ln();function dn(e=an){const t=e===an?un:ln(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var pn=dn();function fn(e=an){const t=e===an?pn:dn(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var hn=fn(),mn=(e,t)=>e===t;function yn(e=an){const t=e===an?un:ln(e),n=(e,n={})=>{const{equalityFn:r=mn}="function"==typeof n?{equalityFn:n}:n,o=t(),{store:s,subscription:a,getServerState:i}=o,c=(Yt.useRef(!0),Yt.useCallback({[e.name]:t=>e(t)}[e.name],[e])),l=(0,Qt.useSyncExternalStoreWithSelector)(a.addNestedSub,s.getState,i||s.getState,c,r);return Yt.useDebugValue(l),l};return Object.assign(n,{withTypes:()=>n}),n}var vn=yn();const gn=()=>vn(Jt);function bn(){const{startChatIcon:e}=gn();return e}const xn=(e,t)=>{let n;return function(...r){let o=!1;return clearTimeout(n),n=setTimeout(()=>{n=null,o||e.apply(this,r),o=!1},t),t=>{o=!0,t&&e.apply(this,r)}}},wn=e=>Math.ceil(e/1e3),_n=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},Cn=(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]}`},Sn={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},En={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},jn=e=>e.code?En[e.code]:Sn[e.keyCode],Tn=e=>{e&&e.focus()},In=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};function Nn(e){return"object"==typeof e}const kn=({state:e})=>e,On=()=>vn(kn),Ln=Ht(kn,Jt,Gt,({events:e,serviceData:t},n,r)=>{if(r||"inline"===n.layoutMode||!t?.suggestion||!t?.suggestion?.body?.length)return e;const o={type:"service_data",payload:t.suggestion};return[...e,o]}),Rn=Ht(Ln,Jt,(e,t)=>{const{enabled:n,threshold:r}=t?.messages?.timeIndicator??{};return n?e.map(({type:e,payload:t},n,o)=>{if(0===n)return{type:e,payload:{...t,timeIndicator:t?.occurredAt}};const s=o[n-1];if(!t?.occurredAt||!s.payload?.occurredAt||!r)return{type:e,payload:{...t,timeIndicator:void 0}};const a=wn(t.occurredAt-s.payload.occurredAt)>=r?t.occurredAt:void 0;return{type:e,payload:{...t,timeIndicator:a}}}):e}),An=()=>vn(Rn),Pn=(Ht(Rn,e=>e.map(e=>e.payload.id)),()=>On().isLoading),Mn=()=>On().unreadEvents,Un=()=>On().skiplinkElementId,Dn=()=>On().skiplinkTargetId,Fn=()=>On().serviceInfo,zn=Ht(Rn,e=>{const t=e.filter(e=>"message"===e.type);return t[t.length-1]?.payload.id}),Bn=()=>{const{participants:e,currentAgent:t}=On().participantInfo;return t?e[t]:null},Vn=()=>{const{entryMeta:{active:e,options:t,optionsOverride:n}}=On();let r=null;return e&&"number"==typeof n[e]?.limit?r=n[e].limit:e&&"number"==typeof t[e]?.limit&&(r=t[e].limit),{hasLimit:null!==r,limit:null!==r?r:null}},$n=()=>{const{layoutMode:e}=gn();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},Hn=Ht(({visibility:e})=>e,e=>e.visibility),Wn=Ht(({visibility:e})=>e,e=>e.showInlineView),Gn=Ht(({visibility:e})=>e,e=>e.showContinueChat),qn=Ht(({visibility:e})=>e,e=>e.showPreChat),Kn=Ht(({visibility:e})=>e,e=>e.setInputFocus),Jn=[Kt.open,Kt.minimized,Kt.hidden],Xn=jt("setVisibility",(e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),s=e.visibility,a=Hn(o),i=Gt(o),c=n.hasConversation(),l=Jt(o),u=e.showPreChat,d=e.showContinueChat,{visibilityCallback:p=Xt,layoutMode:f}=l,{unreadEvents:h}=kn(o),m=p({hasResponded:i,previousVisibility:a,requestedVisibility:s,config:l});if(m&&!Jn.includes(m))return console.error('The visibilityCallback function should return "open", "minimized" or "hidden".'),{visibility:null,setInputFocus:e.setInputFocus,showPreChat:u,showContinueChat:d};if(a===m)return{visibility:null,setInputFocus:e.setInputFocus,showPreChat:u,showContinueChat:d};const y=n.store.get(qt);return n.store.set(qt,{...y||{},[f]:s}),s&&r.emit("ui.visible",s,{visibility:s,hasConversation:c,hasResponded:i,unreadMessageCount:h}),{visibility:m,setInputFocus:e.setInputFocus,showPreChat:u,showContinueChat:d}}),Yn=jt("initialize",async(e,{dispatch:t,getState:n,extra:{api:r}})=>{const{layoutMode:o}=Jt(n()),s=r.store.get(qt)?.[o]||Kt.initialize;return t(Xn({visibility:s})),s}),Qn=jt("initializeApp",async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{const o=n?.context?.contentLocale,s=n?.context?.userLocale;try{return t.hasConversation()?{initialState:await t.getConversationIntitialState(),contentLocale:o,userLocale:s,config:n}:(n?.context?.topic&&t.send("action",{type:k,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),{initialState:void 0,contentLocale:o,userLocale:s,config:n})}catch(e){if(e instanceof g){const e=new g;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new Mt;return r({name:t.name,message:t.message,langKey:t.langKey})}}),Zn=((e,t,n)=>{const{wait:r=300,maxWait:o=0,leading:s=!1}=n??{};let a,i=null,c=null;const l=()=>{c&&clearTimeout(c),c=void 0,a&&(a(!0),a=void 0)};return jt(e,t,{condition:()=>{const e=s&&!i;return i&&clearTimeout(i),i=setTimeout(()=>{l(),i=null},r),!!e||(a&&(a(!1),a=void 0),o&&!c&&(c=setTimeout(l,o)),new Promise(e=>{a=e}))}})})("resetApp",async(e,{dispatch:t,extra:{api:n}})=>{await n.disconnect(),n.clearStore(),t(Dt()),await t(Ut()),await t(Qn()),t(Yn())},{wait:2e3,leading:!0}),er="cvco",tr=50,nr=300,rr=["alwaysShowEntryLabel","hideOnNoUserResponse","connectWhenInView","showDisclaimer","showSuggestions","useMultilineUserInput","continueChat","preChat","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon","notificationAudioURL"],or=(e,t)=>{const{messages:n,...r}=(o=t,rr.reduce((e,t)=>(t in o&&(e[t]=o[t]),e),{}));var o;let s=e;return Object.keys(r).length>0&&(s={...s,...r}),n&&(s={...s,messages:{...s.messages,...n}}),s},sr=Lt({name:"config",initialState:{namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}},alwaysShowEntryLabel:!1,api:{domain:"",key:"",secure:!0,sendEnvironment:!0},context:{},notificationAudioURL:void 0,hideOnNoUserResponse:!1,connectWhenInView:!0,showDisclaimer:!1,showSuggestions:!0,useMultilineUserInput:!1,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})=>or(e,t),updateConfig:(e,{payload:t})=>or(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(Dt.fulfilled,e=>e).addCase(Ut.fulfilled,(e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:o,defaultContentLocale:s,defaultUserLocale:a}})=>{e.preChatEvents=t.map(e=>({type:"message",payload:e})),e.context.contentLocale=s,e.context.userLocale=a,e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=o||""})}}),{setConfig:ar,updateConfig:ir,setPreChatEvents:cr}=sr.actions,lr=sr.reducer,ur={userHasResponded:!1},dr=Lt({name:"app",initialState:ur,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(Zn.pending,()=>ur).addCase(Qn.fulfilled,(e,{payload:t})=>{t.initialState&&"userResponded"in t.initialState&&(e.userHasResponded=t.initialState.userResponded||!1)})}}),{setHasResponded:pr}=dr.actions,fr=dr.reducer;class hr extends m{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const mr={SeamlyGeneralError:v,SeamlyConfigurationError:y,SeamlySessionExpiredError:g,SeamlyOfflineError:hr,SeamlyUnauthorizedError:b,SeamlyUnavailableError:Mt},yr=pt("catch-error",e=>({payload:e})),vr={controls:{}},gr={touched:!1},br={controls:gr},xr=Lt({name:"forms",initialState:br,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{const r=t?e[n]??{...vr,persistData:t}:{...vr,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]:gr}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const o={...r.controls};return delete o[t],{...e,[n]:{...r,controls:o}}},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(Zn.pending,()=>br)}}),{registerForm:wr,deregisterForm:_r,registerControl:Cr,deregisterControl:Sr,updateControlValue:Er,updateControlTouched:jr}=xr.actions,Tr=xr.reducer,Ir=jt("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}}),Nr={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},kr=Lt({name:"app",initialState:Nr,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(Zn.pending,()=>Nr).addCase(Ut.fulfilled,(e,{payload:t})=>{e.initialLocale=t.defaultUserLocale}).addCase(Ir.pending,e=>{e.isLoading=!0}).addCase(Ir.rejected,e=>{e.isLoading=!1}).addCase(Ir.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:Or,setTranslations:Lr}=kr.actions,Rr=kr.reducer,Ar=jt("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}}),Pr={error:void 0},Mr=Lt({name:"interrupt",initialState:Pr,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>Pr},extraReducers:e=>{e.addCase(Ut.pending,()=>Pr).addMatcher(bt(Qn.rejected,Ut.rejected,Ir.rejected,Xn.rejected,Yn.rejected,Ar.rejected),(e,{payload:t})=>{e.error=t})}}),{setInterrupt:Ur,clearInterrupt:Dr}=Mr.actions,Fr=Mr.reducer,zr=["SeamlyGeneralError","SeamlyConfigurationError","SeamlySessionExpiredError","SeamlyOfflineError","SeamlyUnauthorizedError","SeamlyUnavailableError"];n(2577);const Br=({type:e,payload:t})=>"hidden"===document.visibilityState||e===w.message&&!t.fromClient||e===w.info&&t.type===_,Vr=e=>e.sort(({payload:{occurredAt:e=0}},{payload:{occurredAt:t=0}})=>e-t),$r=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:o,name:s,introduction:a}=t.participant,i=n[r],c={...n,[r]:i?{...i,...o?{avatar:o}:{},...s?{name:s}:{},...a?{introduction:a}:{}}:t.participant};return{...e,participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r}},Hr=(e,t)=>{if(!0===t?.payload?.fromClient||"message"!==t?.type)return e;const n=t?.payload?.translatedEntry||t?.payload?.entry,{blockAutoEntrySwitch:r}=e,o=t?.payload?.actions||{},s=t?.payload?.translatedActions||{},{type:a,options:i}=n||{};let c=e.active;return r||a===e.userSelected||(c=a),{...e,active:c,optionsOverride:{...a?{[a]:i}:{}},actions:o,translatedActions:s}},Wr={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,skiplinkElementId:z(),skiplinkTargetId:z(),optionsButtonId:z(),headerCollapseButtonId:z(),windowOpenButtonId:z(),serviceData:{},options:{features:{webNotifications:{enabled:!1}},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],processingFileUploads:[],entryMeta:{default:C,optionsOverride:{},defaultEntry:C,active:C,userSelected:null,blockAutoEntrySwitch:!1,options:{},actions:{},translatedActions:{}},seamlyContainerElement:null},Gr=Lt({name:"store",initialState:Wr,reducers:{addEvent:(e,t)=>{const{type:n,payload:r}=t.payload,o=Object.prototype.hasOwnProperty.call(e.options.features,D);let s={...e.options};if(o&&(n===w.message||n===w.participant)&&!r.fromClient){const e="message"===n?r.entry?.type:void 0;s={...s,features:{...s.features,uploads:{enabled:s.features.uploads?.enabled||!1,...s.features?.uploads||{},enabledFromEntry:e===S}}}}const a=Br(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 i=Hr(e.entryMeta,t.payload);e.entryMeta=o||i.active!==S?i:{...e.entryMeta},e.options=s,a&&(e.unreadEvents+=1,"service_data"!==n&&(t.payload.payload.messageStatus=r.fromClient?j:E)),t.payload.payload.key=z(),e.events.push(t.payload),e.events=Vr(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=Vr(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===E&&{messageStatus:j}}),e))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setEvents:(e,{payload:{messages:t,unreadMessageCount:n,userResponded:r,participants:o,service:s,serviceData:a,ui:i}})=>{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 Vr([...r,...n])})(e.events,t),l=Object.fromEntries(Object.entries(o).map(([e,t])=>[t.id,t])),u=t.find(e=>"participant"===e.type),d=u?.payload?.participant?.id,{entry:p}=s?.settings||{},f=Hr({...e.entryMeta,...p,active:_,options:{...p?.options}},c.findLast(e=>"message"===e.type));let h={...e.options.features};const m=t.find(e=>!e.payload.fromClient&&["message","participant"].includes(e.type)),y=Object.prototype.hasOwnProperty.call(h,D);if(y&&"message"===m?.type){const e=m.payload.entry?.type||"";h={...h,uploads:{enabled:h.uploads?.enabled||!1,enabledFromEntry:e===S}}}e.unreadEvents=n,e.userHasResponded=r,e.events=c.filter(e=>"participant"!==e.type||!!e.payload.participant?.introduction),e.participantInfo={...e.participantInfo,...d?$r(e.participantInfo,{participant:l[d]}):{},participants:l},e.historyLoaded=!0,e.serviceInfo={...e.serviceInfo,proactiveMessages:s?.settings?.proactiveMessages?.enabled||!1,activeServiceSessionId:s?.sessionId},e.serviceData={...e.serviceData,...a},e.options={...e.options,features:h},e.entryMeta=y||f.active!==S?f:{...e.entryMeta},e.resumeConversationPrompt=i.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=_n(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=$r(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=Wr.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})=>{Object.prototype.hasOwnProperty.call(e.options.features,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.options={...e.entryMeta.options,upload:{...t.options.upload}},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(Zn.pending,()=>Wr).addCase(Qn.pending,e=>{e.isLoading=!0}).addCase(Ut.fulfilled,(e,{payload:t})=>{e.headerTitles.subTitle=t.agentParticipant?.name||"",t.features&&(e.options.features=t.features)}).addCase(Qn.fulfilled,(e,{payload:t,type:n})=>{if(e.isLoading=!1,!t.initialState)return;e.initialState=t.initialState,"messages"in t.initialState&&Gr.caseReducers.setEvents(e,{payload:t.initialState,type:n});const{initialState:{service:r}}=t;r?.settings?.entry?.options?.upload&&Gr.caseReducers.setFeatureEnabledState(e,{payload:{key:D,enabled:r.settings.entry.options.upload.enabled||!1},type:n})}).addMatcher(bt(no,ro),e=>{e.isLastEventFromClient=!1})}}),{addEvent:qr,updateEvent:Kr,clearAllUploads:Jr,clearEvents:Xr,clearFeatures:Yr,clearIdleDetachCountdown:Qr,clearResumeConversationPrompt:Zr,decrementIdleDetachCountdownCounter:eo,hideOption:to,initIdleDetachCountdown:no,initResumeConversationPrompt:ro,registerUpload:oo,setActiveEntryType:so,setActiveService:ao,setBlockAutoEntrySwitch:io,setEventsRead:co,setFeatureEnabledState:lo,updateFeatures:uo,setFeatures:po,setHeaderSubTitle:fo,setHeaderTitle:ho,setEvents:mo,setInitialState:yo,setIsLoading:vo,setLoadedImageEventIds:go,setParticipant:bo,setSeamlyContainerElement:xo,setServiceDataItem:wo,setServiceEntryMetadata:_o,clearAbortTransaction:Co,setUploadComplete:So,setUploadError:Eo,setUploadProgress:jo,startProcessingImage:To,doneProcessingImage:Io,setUserEntryType:No,setUserSelectedOption:ko,setUserSelectedOptions:Oo,showOption:Lo,stopIdleDetachCountdownCounter:Ro,setProactiveMessages:Ao}=Gr.actions,Po=Gr.reducer,Mo=({dispatch:e})=>t=>n=>{const r=t(n);if(Ut.fulfilled.match(n)&&n.payload.defaultUserLocale)return e(Ir(n.payload.defaultUserLocale)),r;if(Qn.fulfilled.match(n))return n.payload.userLocale&&e(Ir(n.payload.userLocale)),r;if(qr.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(Ir(t.translationLocale)),r}return r},Uo={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:xt(),translatedEventGroups:{},translationProposal:null},Do=(e,t)=>{const n=[...e].reduce((e,{payload:n,type:r},o,s)=>{if(e[t]&&n.id){if("info"===r&&"divider"===n?.type&&n?.body?.translationEnabled)return s.splice(0),e;e[t].push(n.id)}return n.id===t&&(e[t]=[]),e},{}),[[r,o]]=Object.entries(n);return{lastGroupId:e.filter(e=>"divider"===e.payload?.type).map(e=>e.payload.id).at(-1),groupId:r,eventIds:o}},Fo=Lt({name:"translation",initialState:Uo,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}=Do(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:o,eventIds:s}=Do(t,n);e.lastGroupId=r,e.translatedEventGroups[o]=s},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(Zn.pending,()=>Uo).addCase(Ut.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(Ir.fulfilled,(e,{payload:t})=>{e.currentLocale=t.userLocale}).addCase(qr,(e,{payload:t})=>{t.payload.id&&e.lastGroupId&&e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)}).addCase(mo,(e,{payload:t})=>{e.translationProposal=t?.ui?.translationProposal}).addCase(Qn.fulfilled,(e,{payload:t})=>{e.translationProposal=t.initialState?.ui?.translationProposal})}}),{enableTranslation:zo,disableTranslation:Bo,enableEventsTranslation:Vo,disableEventsTranslation:$o,setTranslationProposalPrompt:Ho,disableTranslationProposalPrompt:Wo}=Fo.actions,Go=Fo.reducer,qo=Lt({name:"visibility",initialState:{visibility:Kt.initialize,showInlineView:!1,showPreChat:!0,showContinueChat:!0,setInputFocus:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(Xn.fulfilled,(e,{payload:{visibility:t,setInputFocus:n,showPreChat:r,showContinueChat:o}})=>{t&&(e.visibility=t,e.setInputFocus=Boolean(n)),void 0!==r&&(e.showPreChat=r),void 0!==o&&(e.showContinueChat=o)}).addCase(Ut.fulfilled,(e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)})}}),{setShowInlineView:Ko}=qo.actions,Jo=qo.reducer,Xo=st({state:Po,app:fr,config:lr,i18n:Rr,translations:Go,visibility:Jo,forms:Tr,interrupt:Fr});const Yo=hn;var Qo=n(2086),Zo=n.n(Qo),es=n(8785),ts=n(1162);function ns(e=""){const t=e=>/\s/.test(e),n=[],r={};let o=0,s=null,a=!1,i=0;for(;i<e.length;){if(a&&(t(e[i])||"{"===e[i]))a=!1,s=e.slice(o,i),"{"===e[i]&&i--;else if(!a&&!t(e[i])){const t="{"===e[i];if(s&&t){const t=rs(e,i);if(-1===t)throw new Error(`Unbalanced curly braces in string: "${e}"`);r[s]=e.slice(i+1,t),i=t,s=null}else s&&(n.push(s),s=null),a=!0,o=i}i++}return a&&(s=e.slice(o)),s&&n.push(s),{args:n,cases:r}}function rs(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 os(e){return ss(e.slice(1,-1),",",3)}function ss(e,t,n,r=[]){if(!e)return r;if(1===n)return r.push(e),r;let o=e.indexOf(t);if(-1===o)return r.push(e),r;let s=e.substring(0,o).trim(),a=e.substring(o+t.length+1).trim();return r.push(s),ss(a,t,n-1,r)}let as,is=0;const cs="other";function ls(e,t){let n=0,r="",o=0;const s={};for(;n<e.length;){if("#"!==e[n]||o)r+=e[n];else{let e="__hashToken"+is++;r+=`{${e}, number}`,s[e]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:s}}const us="other",ds=Ht(({i18n:e})=>e,({translations:e})=>e),ps=Ht(({i18n:e})=>e,({initialLocale:e})=>e),fs=Ht(({i18n:e})=>e,({userLocale:e})=>e),hs=Ht(({i18n:e})=>e,({isLoading:e})=>e),ms=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 o=e(...n);return t[r]=o,o}}((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=rs(e,n);if(-1===r)throw new Error(`Unbalanced curly braces in string: "${e}"`);{let o=e.substring(n,r+1);if(o){let s=[],a=e.substring(0,n);a&&s.push(a);let[i,c,l]=os(o),u=t[i],d=c&&this.typeHandlers[c];s.push(d?d(u,l,this.locale,t,this.process.bind(this)):u);let p=e.substring(r+1);return p&&s.push(this.process(p,t)),s}}}return[e]}}("en-GB",{plural:function(e,t,n,r,o){const{args:s,cases:a}=ns(t);let i=parseInt(e);s.forEach(e=>{e.startsWith("offset:")&&(i-=parseInt(e.slice(7)))});const c=[];if("PluralRules"in Intl){void 0!==as&&as.resolvedOptions().locale===n||(as=new Intl.PluralRules(n));const e=as.select(i);e!==cs&&c.push(e)}1===i&&c.push("one"),c.push(`=${i}`,cs);for(let e=0;e<c.length;e++){const t=c[e];if(t in a){const{caseBody:e,numberValues:n}=ls(a[t],i);return o(e,{...r,...n})}}return e},select:function(e,t,n,r,o){const{cases:s}=ns(t);return e in s?o(s[e],r):us in s?o(s[us],r):e}});function ys(){const e=vn(ds),t=vn(fs),n=vn(ps),r=vn(hs);return{t:(0,ts.useCallback)((n,o={})=>{if(!e)return"";const s=e[n];return s?ms.format(s,o):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),"")},[e,t,r]),userLocale:t,initialLocale:n}}const vs=()=>{const e=Yo(),t=vn(Hn),n=vn(Kn),r=vn(qn),o=vn(Gn),s=!!t&&t!==Kt.hidden,a=t===Kt.open,i=t===Kt.minimized,c=(0,ts.useCallback)(t=>{e(Xn("string"==typeof t||null===t?{visibility:t,setInputFocus:!1}:t))},[e]);return{isVisible:s,isOpen:a,isMinimized:i,visible:t,setVisibility:c,openChat:()=>{c({visibility:Kt.open})},closeChat:()=>{c({visibility:Kt.minimized})},setInputFocus:n,showPreChat:r,closePreChat:()=>{c({visibility:t,showPreChat:!1})},showContinueChat:o,closeContinueChat:()=>{c({visibility:t,showContinueChat:!1})}}},gs=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,es.createRef)()})=>{const[r,o]=(0,ts.useState)(null),s=!!r?.isIntersecting||!t,a=s&&e,i=([e])=>o(e);return(0,ts.useEffect)(()=>{const e=n?.current;if(!window.IntersectionObserver||a||!e||!t)return()=>{};const r=new IntersectionObserver(i,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()},[n,t,a]),{isVisible:s,containerRef:n}},bs=()=>vn(Gt),xs=(0,es.createContext)(null),ws=(0,es.createContext)(null),_s=()=>{const e=(0,ts.useContext)(ws);if(!e)throw new Error("useSeamlyEventBusContext has to be used within <SeamlyEventBusContext.Provider>");return e},Cs=()=>{const e=(0,ts.useContext)(xs);if(!e)throw new Error("useSeamlyApiContext has to be used within <SeamlyApiContext.Provider>");return e},Ss=()=>Cs().store,Es=()=>{const e=Cs();return(0,ts.useCallback)(()=>e.hasConversation(),[e])},js=()=>{const e=Cs(),t=Yo(),n=_s(),r=bs(),o=Es(),{visible:s,setVisibility:a}=vs(),i=Mn(),c=(0,ts.useCallback)((...e)=>{n.emit(...e)},[n]),l=(0,ts.useCallback)(()=>{c("ui.beforeStart",{visibility:s,hasConversation:o(),hasResponded:r,unreadMessageCount:i}),e.send("start_conversation"),c("ui.start",{visibility:s,hasConversation:o(),hasResponded:r,unreadMessageCount:i})},[e,c,o,r,i,s]),u=(0,ts.useCallback)(async()=>{await t(Zn())},[t]),d=(0,ts.useCallback)(e=>({type:e,id:z(),transactionId:z(),fromClient:!0,participant:"seamly-client-participant",occurredAt:1e3*Date.now()}),[]),p=(0,ts.useCallback)(e=>({...d("text"),body:{text:e}}),[d]),f=(0,ts.useCallback)(({body:n,config:r={}})=>{if(""===n.trim())return;const o={...p(n),...r};e.send("message",o),c("message",o),t(qr({type:"message",payload:{...o,body:o.body,type:o.type,optimisticallyInjected:!0}}))},[e,t,c,p]),h=(0,ts.useCallback)((e,n=z())=>{t(qr({type:"message",payload:{...p(e),transactionId:n}}))},[t,p]),m=(0,ts.useCallback)((e,n,r,o,s,a)=>{t(qr({type:"message",payload:{type:"upload",id:e,transactionId:n,fromClient:!0,participant:"seamly-client-participant",occurredAt:r,body:{contentType:o,filename:s,filesize:a,id:e||"",isDeleted:!1}}}))},[t]),y=(0,ts.useCallback)(t=>{t&&e.send("action",t)},[e]),v=(0,ts.useCallback)(t=>{e.sendContext(t)},[e]),g=(0,ts.useCallback)(()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then(e=>{e&&(t(yo(e)),e.messages&&e.messages.length&&t(mo(e)),e.userResponded&&(t(pr(e.userResponded)),a({visibility:Kt.open})))}).catch(e=>{t(Ur({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}),[e,t,a]);return{connect:g,start:l,sendMessage:f,sendAction:y,sendContext:v,reset:u,emitEvent:c,addMessageBubble:h,addUploadBubble:m,apiConnected:e.connected,apiConfigReady:e.configReady}},Ts=(0,es.createContext)(null),Is=()=>{const e=(()=>{const e=(0,ts.useContext)(Ts);if(!e)throw new Error("useSeamlyLiveRegionContext has to be used within <SeamlyLiveRegionContext.Provider>");return e})();return{sendPolite:(0,ts.useCallback)(t=>{t&&e({ariaLive:M,messageText:t})},[e]),sendAssertive:(0,ts.useCallback)(t=>{t&&e({ariaLive:P,messageText:t})},[e])}},Ns=Ht(({interrupt:e})=>e,({error:e})=>e),ks=Ht(Ns,e=>Boolean(e));function Os(){const{t:e}=ys(),t=vn(Ns);return{hasError:vn(ks),meta:(0,ts.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,o=e(`${n}.title`),s=e(`${n}.message`),a=e(`${n}.srText`),i=r?e(`${n}.buttonText`):null;return{...n?{title:o,message:s,srText:a}:{},...r?{action:r}:{},...r&&n?{buttonText:i}:{},originalError:t}},[t,e]),error:t}}const Ls=()=>{const{t:e}=ys(),{isInline:t,isWindow:n,isApp:r}=$n(),{isOpen:o,isVisible:s}=vs(),a=vn(Wn),{start:i,connect:c,apiConfigReady:l,apiConnected:u}=js(),d=(0,ts.useRef)(!1),{sendAssertive:p}=Is();!function(){const{meta:{originalError:e,action:t}}=Os(),n=Yo(),{reset:r}=js(),o="SeamlySessionExpiredError"===e?.name,s=(0,ts.useRef)(0),a=(0,ts.useRef)(null);(0,ts.useEffect)(()=>{if(o&&"reset"===t){if(s.current>=10){a.current=setTimeout(()=>{s.current=0},1e4);const e=new v;return n(Ur({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),()=>{}}s.current+=1,r()}return()=>{a.current&&clearTimeout(a.current)}},[t,r,o,n])}(),(0,ts.useEffect)(()=>{s&&setTimeout(()=>{p(e("window.srTexts.onLoad"))},500)},[s,p,e]),(0,ts.useEffect)(()=>{s&&p(e(o?"window.srTexts.onOpen":"window.srTexts.onClose"))},[o,s,p,e]),(0,ts.useEffect)(()=>{l||u||(d.current=!1)},[l,u]);const f=(0,ts.useCallback)(async()=>{u||(d.current=!0,await c()),(r||o||s&&t)&&i()},[u,c,r,t,o,s,i]);(0,ts.useEffect)(()=>{!l||d.current||n&&!o||!(!t||s&&a)||f()},[l,f,t,o,s,n,a])},Rs=require("preact/compat"),As=require("preact/jsx-runtime"),Ps=({children:e})=>(Ls(),(0,As.jsx)(As.Fragment,{children:e})),Ms=(0,es.createContext)(null),Us=(e=0)=>new Promise(t=>{setTimeout(t,e)}),Ds=()=>{const{seamlyContainerElement:e}=On(),t=Yo();return[e,(0,ts.useCallback)(e=>{t(xo(e))},[t])]},Fs=e=>(0,ts.useCallback)(()=>{var t;t=e,requestAnimationFrame(async()=>{await Us(180);const e="string"==typeof t?document.getElementById(t):t;Tn(e)})},[e]),zs=()=>{const e=Dn();return Fs(e)},Bs=()=>{const{windowOpenButtonId:e}=On();return Fs(e)};n(3215);const Vs=e=>Ht(e=>e.translations.translatedEventGroups,t=>Object.values(t).every(t=>e?.payload?.id&&!t.includes(e.payload.id)));function $s(){const{sendContext:e}=js(),t=Yo(),n=gn(),r=(0,ts.useCallback)((t,n)=>{e({userLocale:t,source:n})},[e]),o=(0,ts.useCallback)(()=>{e({userLocale:n.context?.contentLocale}),t(Bo())},[n.context?.contentLocale,t,e]),{languages:s,isActive:a,isAvailable:i,currentLocale:c}=vn(({translations:e})=>e);return{languages:s,isActive:a,isAvailable:i,currentLocale:c,enableTranslations:r,disableTranslations:o}}const Hs=e=>{const t=vn(Vs(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:o}={body:e.payload?.body,translation:e.payload?.translation},s=!!n;return{body:t&&s?n:o,hasTranslation:s,isTranslated:t&&s,locale:r?.locale}};function Ws(){const e=vn(({translations:e})=>e.containerId);return{id:e,focusContainer:Fs(e)}}function Gs(e){const{languages:t}=$s();return(0,ts.useMemo)(()=>t?.find(t=>t.locale===e)?.nativeName,[e,t])}const qs=(...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(er)>-1?e:[er,e].join("-")).join(" "),Ks=()=>gn().appContainerClassNames,Js=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},Xs=()=>{const e=Cs();return(0,Rs.useSyncExternalStore)(f.subscribe,()=>e.conversation)},Ys=(0,es.createContext)(null),Qs=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=On(),{allowedMimeTypes:o,maxSize:s}=n?.upload||{},{enabled:a,enabledFromEntry:i}=r||{},{allowedMimeTypes:c,maxSize:l}={...t.upload||{allowedMimeTypes:[],maxSize:0},...o?{allowedMimeTypes:o}:{},...s?{maxSize:s}:{}};return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:i||a,allowedMimeTypes:c,maxSize:l}},Zs=()=>{const{currentUploads:e}=On(),t=Yo(),n=(()=>{const e=(0,ts.useContext)(Ys);if(!e)throw new Error("useSeamlyFileUploadContext has to be used within <SeamlyFileUploadContext.Provider>");return e})();return{uploadFile:(0,ts.useCallback)(e=>{n(e)},[n]),clearUploads:(0,ts.useCallback)(()=>{t(Jr())},[t]),currentUploads:e,isUploading:e.some(e=>e.uploading),isComplete:e.every(e=>e.complete)}},ea=()=>{const{t:e}=ys(),{options:t}=On(),{panelActive:n,optionActive:r,userSelectedOptions:o,features:s}=t,{extraMenuItem:a,sendTranscript:i}=s,c={extraMenuItem:a,sendTranscript:i},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=a||i,p=Yo(),{get:f,set:h}=Ss();return{allowOptionSelection:d,userSelectedOptions:o,features:s,menuOptions:u,initUserSelectedOptions:(0,ts.useCallback)(()=>{const e=f("options")||{};p(Oo(e))},[f,p]),setUserSelectedOptions:(0,ts.useCallback)(e=>{p(Oo(e)),h("options",e)},[h,p]),setUserSelectedOption:(0,ts.useCallback)((e,t)=>{const n=f("options")||{};"object"==typeof n&&h("options",{...n,[e]:t}),p(ko({option:e,value:t}))},[p,f,h]),showOption:e=>{p(Lo(e))},hideOption:()=>{p(to())},panelActive:n,optionActive:r}},ta=()=>{const{optionsButtonId:e}=On();return{id:e,focusButton:Fs(e)}},na=(0,es.createContext)(null),ra=()=>{const e=(0,ts.useContext)(na);if(!e)throw new Error("useSeamlyActivityEventHandler has to be used within <SeamlyActivityEventContext.Provider>");return e},oa=()=>{const e=Yo(),{idleDetachCountdown:{hasCountdown:t,isActive:n,count:r,remaining:o,timer:s,wasStopped:a}}=On(),{isOpen:i}=vs(),c=(0,ts.useRef)({hasCountdown:!1,wasStopped:!1});c.current={hasCountdown:t,wasStopped:a||!1};const{emitEvent:l,sendAction:u}=js(),{t:d}=ys(),{sendAssertive:p,sendPolite:f}=Is(),h=(0,ts.useCallback)(e=>{i&&p(e)},[i,p]),m=(0,ts.useCallback)(e=>{i&&f(e)},[i,f]),y=(0,ts.useCallback)(t=>{const n=(e=>Math.ceil(e/1e3))(t),r=_n(n);e(no({delaySeconds:n,delayTime:r})),l("idleTimer.start"),h(`${d("idleDetachWarning.countdownTitle")} ${d("idleDetachWarning.countdownText")} ${d("idleDetachWarning.countdownTimer",r)}`)},[e,l,h,d]),v=(0,ts.useCallback)((t=void 0,n=!1)=>{const{hasCountdown:r,wasStopped:o}=c.current;r&&(t||(n||u({type:I}),h(d("idleDetachWarning.notifyTransferText"))),o||l("idleTimer.stop"),e(Qr()))},[e,l,u,h,d]),g=(0,ts.useCallback)(()=>{if(!o||o<=0)return;const t=o-1;t%10==0&&h(`${d("idleDetachWarning.countdownText")} ${d("idleDetachWarning.countdownTimer",_n(t))}`),e(eo())},[e,o,h,d]),b=(0,ts.useCallback)(()=>{n&&(e(Ro()),o&&(l("idleTimer.stop"),m(d("idleDetachWarning.srCountDownStoppedText"))))},[e,l,n,o,m,d]);return{hasCountdown:t,isActive:n,count:r,remaining:o,timer:s,wasStopped:a,initCountdown:y,endCountdown:v,decrementCountdown:g,stopCountdown:b}},sa=()=>{const e=Yo(),t=On().resumeConversationPrompt,{sendAction:n}=js(),{t:r}=ys(),{sendAssertive:o}=Is();return{continueChat:()=>{n({type:N,body:{type:"resume_conversation_prompt"}}),e(Zr())},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:I}),e(Zr())}}},aa=()=>{const[e]=(0,ts.useState)(()=>z());return e},ia=(e,t)=>{const n=Xs();(0,ts.useEffect)(()=>{n.onMessage((n,r)=>(t&&!t({type:n,payload:r})||e({type:n,payload:r}),r))},[e,t,n])},ca=({eventPayload:e})=>{const{t}=ys(),{fromClient:n,participant:r}=e,o=(e=>On().participantInfo.participants[e])(r)||{},{messages:s}=gn(),a=n?t("participants.user.name"):o&&o.name,{showAvatar:i,showName:c}=s&&s[n?"user":"agent"]||{};if(!i&&!c)return null;const l=[];return i&&a&&o.avatar&&l.push((0,As.jsx)("span",{className:qs("message__avatar"),children:(0,As.jsx)("img",{src:o.avatar,className:qs("avatar"),alt:""})})),c&&a&&l.push((0,As.jsx)("span",{className:qs("message__author-name"),children:a})),l.length>0?(0,As.jsx)("div",{className:qs("message__author"),children:l}):null},la=({showParticipant:e=!0,event:t,type:n,modifiers:r,children:o,bodyProps:s={},info:a,...i})=>{const c=Js(t),{hasTranslation:l,isTranslated:u,locale:d}=Hs(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&&(s={...s,lang:d}),(0,As.jsx)(As.Fragment,{children:(0,As.jsxs)("div",{className:qs(c),...i,children:[e&&(0,As.jsx)(ca,{eventPayload:t.payload}),(0,As.jsx)("div",{className:qs("message__body"),...s,children:o}),a&&(0,As.jsx)("div",{"aria-hidden":"true",className:qs("message__info"),children:a})]})})},ua=({id:e,action:t,buttonText:n,description:r,hasFocus:o,image:s,title:a,isCarouselItem:i})=>{const c=(0,ts.useRef)(null),{sendMessage:l,sendAction:u,emitEvent:d}=js(),p=aa(),f=(0,ts.useRef)(!1),h=t?.type===F?"a":"button",m=(0,ts.useCallback)(()=>d(`action.${O}`,{type:O,originMessage:e,action:t}),[d,e,t]),y=(0,ts.useCallback)(()=>{if(m(),"ask"===t?.type)l({body:t?.ask});else if("topic"===t?.type){const{topic:e,fallbackMessage:n}=t;u({type:k,body:{name:e,fallbackMessage:n}})}},[l,t,u,m]),v=(0,ts.useMemo)(()=>t?.type===F?{href:t?.link,rel:"noopener noreferrer",target:t?.newTab?"_blank":"_self",onClick:m}:{onClick:y},[t,y,m]);return(0,ts.useEffect)(()=>{i&&(o&&f.current?window.requestAnimationFrame(()=>c.current?.focus()):c.current?.blur()),f.current=!0},[o,i]),(0,As.jsxs)("div",{className:qs("card__wrapper"),id:e,tabIndex:-1,ref:c,children:[s?(0,As.jsx)("img",{className:qs("card__image"),src:s,alt:""}):null,(0,As.jsxs)("div",{className:qs("card__content"),id:e,children:[a&&(0,As.jsx)("h2",{className:qs("card__title"),children:a}),r&&(0,As.jsx)("div",{className:qs("card__description"),dangerouslySetInnerHTML:{__html:r}}),(0,As.jsx)(h,{tabIndex:i&&!o?-1:void 0,className:qs("button","button--primary"),"aria-describedby":p,...v,children:n})]})]})};function da({item:e,items:t,index:n,isActive:r}){const{t:o}=ys();return(0,As.jsx)("div",{className:qs("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":o("carousel.slide.label",{index:n+1,total:t.length}),children:(0,As.jsx)(ua,{...e,isCarouselItem:!0,hasFocus:r})})}const pa={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'}},fa=({name:e,size:t="32",className:n,alt:r})=>(0,As.jsxs)(As.Fragment,{children:[(0,As.jsx)("div",{"aria-hidden":"true",className:n||qs("icon"),dangerouslySetInnerHTML:{__html:pa[e][t]}}),r&&(0,As.jsx)("span",{className:qs("visually-hidden"),children:r})]});function ha({items:e,currentIndex:t,onChange:n,children:r}){const{t:o}=ys(),s=e.length;return(0,As.jsxs)("div",{className:qs("carousel-controls"),children:[(0,As.jsx)("button",{className:qs("button","button--previous"),"aria-label":o("carousel.controls.previous"),onClick:()=>{n((t-1+s)%s)},children:(0,As.jsx)(fa,{name:"arrowLeft",size:"16",alt:""})}),r,(0,As.jsx)("button",{className:qs("button","button--next"),"aria-label":o("carousel.controls.next"),onClick:()=>{n((t+1)%s)},children:(0,As.jsx)(fa,{name:"arrowRight",size:"16",alt:""})})]})}function ma({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:o}){const s=e.length,a=(0,ts.useCallback)(e=>{const r=Number(e.target.dataset.item||"0"),o=Math.min(s-1,Math.max(0,r));o!==t&&n(o)},[s,t,n]);return(0,As.jsx)("div",{className:qs("carousel-pagination__wrapper"),role:"group",children:(0,As.jsx)("ul",{className:qs("carousel-pagination"),children:e.map((e,n)=>{const s=t===n;return(0,As.jsx)("li",{className:qs("carousel-pagination__item",s?"is-active":void 0),children:(0,As.jsx)("button",{className:qs("carousel-pagination__button"),type:"button",onClick:a,"data-item":n,"aria-disabled":s?"true":void 0,"aria-label":o(e,n)})},r(e,n,"pagination-item-"))})})})}const ya=(e,t,n)=>`${n}${t}`,va=e=>e.label,ga=({target:e})=>{e.scrollLeft=0};function ba({currentIndex:e=0,onChange:t=()=>{},getItemKey:n=ya,getItemLabel:r=va,items:o}){const s=aa(),a=o.length,[i,c]=(0,ts.useState)(Number(e||0));(0,ts.useEffect)(()=>{c(Number(e||0))},[c,e]);const l=(0,ts.useRef)([]);l.current=(0,ts.useMemo)(()=>Array(a).fill(1).map(()=>(0,es.createRef)()),[a]);const u=(0,ts.useRef)(!0),d=(0,ts.useRef)(null);return d.current=t,(0,ts.useEffect)(()=>{u.current?u.current=!1:d.current&&d.current(i)},[i]),(0,As.jsxs)("div",{className:qs("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,As.jsx)("div",{className:qs("carousel__slides-wrapper"),onScroll:ga,children:(0,As.jsx)("div",{id:s,className:qs("carousel__slides"),style:{width:100*a+"%",left:-100*i+"%"},"aria-live":"polite","aria-atomic":"false",children:o.map((e,t)=>{const r=i===t;return(0,As.jsx)("div",{ref:l.current[t],className:qs("carousel__slide",r?"is-active":void 0),"aria-hidden":r?void 0:"true",children:(0,As.jsx)(da,{item:e,items:o,index:t,isActive:r})},n(e,t,"item-"))})})}),(0,As.jsx)("div",{className:qs("carousel__controls"),children:(0,As.jsx)(ha,{currentIndex:i,items:o,onChange:c,children:(0,As.jsx)("div",{className:qs("carousel__pagination"),children:(0,As.jsx)(ma,{currentIndex:i,items:o,onChange:c,getItemKey:n,getItemLabel:r})})})})]})}const xa=(e,t,n="")=>`${n}${e.title}:${t}`,wa=e=>e.title,_a=e=>{const{payload:t}=e,[n,r]=(0,ts.useState)(!1),{addMessageBubble:o,emitEvent:s,sendAction:a}=js(),i=Es(),{activeServiceSessionId:c}=Fn(),l=vn(zn),{body:u}=Hs(e),{service:d}=t,p=(0,ts.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]),f=u?.chooseAgain&&c===d?.serviceSessionId&&t.id!==l;return(0,ts.useEffect)(()=>{r(t.id===l)},[t,l]),{body:u,subEvent:p,showOptions:n,chooseAgain:f,onChoiceClickHandler:e=>{if(!i())return;const n=z(),c={type:"pick_choice",originMessage:t.id,choice:{chooseAgain:f,id:e.id},transactionId:n};o(e.text,n),a(c),r(!1),s(`action.${c.type}`,{...c,choice:{...c.choice,text:e.text}})},onChooseAgainClickHandler:()=>{r(e=>!e)}}},Ca=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,Sa=({id:e,categories:t=[],question:n,onClick:r,hasIcon:o})=>{const s=(0,ts.useMemo)(()=>["suggestions__item",...t.map(Ca)],[t]),a=(0,ts.useCallback)(()=>{r&&r({id:e,question:n})},[e,n,r]);return(0,As.jsx)("li",{className:qs(s),children:(0,As.jsxs)("button",{type:"button",onClick:a,className:qs("button","button--primary"),children:[o&&(0,As.jsx)(fa,{name:"chevronRight",size:"8",alt:""}),n]})})},Ea=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>(0,As.jsx)("ul",{className:qs("suggestions__list",e||""),children:t.map(e=>(0,As.jsx)(Sa,{hasIcon:r,onClick:n,categories:e.categories,id:e.id,question:e.question},e.id))}),ja=({children:e,className:t,graphicSrc:n,graphicType:r="icon",iconName:o,iconSize:s,iconClassName:a,dividerType:i,title:c,description:l})=>{const u=Boolean(o||n);return(0,As.jsxs)("div",{className:qs("divider",i&&`divider--type-${i}`,t),children:[u&&(0,As.jsx)("span",{className:qs("divider__graphic"),children:o?(0,As.jsx)(fa,{name:o,size:s,className:a,alt:""}):(0,As.jsx)("img",{src:n||void 0,className:qs({icon:"icon"===r,avatar:"avatar"===r},a)})}),(0,As.jsxs)("div",{className:qs("divider__body"),children:[c?(0,As.jsx)("h2",{className:qs("divider__title"),dangerouslySetInnerHTML:{__html:c}}):null,l?(0,As.jsx)("p",{className:qs("divider__description"),dangerouslySetInnerHTML:{__html:l}}):null,e]})]})},Ta={[U.new_topic]:"new-topic"},Ia={default:({event:e})=>{const{t}=ys(),{subtype:n}=e.payload.body,r=Ta[U[n]];return U[n]?(0,As.jsx)(ja,{dividerType:r,iconName:U[n],title:t(`dividerKeys.${U[n]}`)}):null},[U.new_translation]:({event:e})=>{const{t}=ys(),n=An(),{body:{translationEnabled:r,text:o,title:s},id:a}=e.payload,i=vn(e=>e.translations.translatedEventGroups),c=Yo(),l=(0,ts.useCallback)(()=>{i[a]?c(Vo({events:n,id:a})):c($o({events:n,id:a}))},[c,n,a,i]);return(0,As.jsx)(ja,{iconName:"newTranslation",dividerType:"new-translation",title:s,description:o,children:r?(0,As.jsx)(As.Fragment,{children:(0,As.jsx)("button",{className:qs("button","button--secondary"),onClick:l,children:t(i[a]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):null})}},Na={month:"long",day:"numeric",year:"numeric"},ka={hour:"numeric",minute:"numeric"},Oa=({event:e})=>{const t=(()=>{const[e,t]=(0,ts.useReducer)(e=>e+1,0);return(0,ts.useCallback)(()=>{setTimeout(()=>{t()})},[])})(),{date:n,time:r,timeUntilMidnight:o,srText:s}=(e=>{const{t}=ys(),n=gn(),r=n?.context?.userLocale??[],o=new Date(e),s=new Date,a=new Date(s);a.setHours(24,0,0,0);const i=a.valueOf()-s.valueOf(),c=o.toString(),l=new Intl.DateTimeFormat(r,ka).format(o);let u=((e,t)=>{const n=new Date(t).setHours(0,0,0,0),r=e.getTime(),o=864e5;return r>=n+o?e:r>n?"today":r>n-o?"yesterday":e})(o,s);switch(u){case"today":u=t("dateTime.today");break;case"yesterday":u=t("dateTime.yesterday");break;default:u=new Intl.DateTimeFormat(r,Na).format(o)}return{date:u,srText:t("dateTime.srText",{date:u,time:l}),time:l,fullDateTime:c,timeUntilMidnight:i}})(wn(e.payload.timeIndicator));return(0,ts.useEffect)(()=>{const e=setTimeout(()=>{t()},o);return()=>{clearTimeout(e)}},[t,o]),(0,As.jsxs)(ja,{dividerType:"time-indicator",children:[(0,As.jsxs)("h2",{className:qs("divider__time"),"aria-hidden":"true",children:[(0,As.jsx)("span",{className:qs("divider__time--date"),children:n}),(0,As.jsx)("span",{className:qs("divider__time--time"),children:r})]}),(0,As.jsx)("p",{className:qs("visually-hidden"),children:s})]})};var La=["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])"],Ra=La.join(","),Aa="undefined"==typeof Element,Pa=Aa?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ma=!Aa&&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},Ua=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&Ua(e.parentNode)},Da=function(e,t,n){if(Ua(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Ra));return t&&Pa.call(e,Ra)&&r.unshift(e),r.filter(n)},Fa=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var s=o.shift();if(!Ua(s,!1))if("SLOT"===s.tagName){var a=s.assignedElements(),i=a.length?a:s.children,c=Fa(i,!0,n);n.flatten?r.push.apply(r,c):r.push({scopeParent:s,candidates:c})}else{Pa.call(s,Ra)&&n.filter(s)&&(t||!e.includes(s))&&r.push(s);var l=s.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(s),u=!Ua(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(s));if(l&&u){var d=Fa(!0===l?s.children:l.children,!0,n);n.flatten?r.push.apply(r,d):r.push({scopeParent:s,candidates:d})}else o.unshift.apply(o,s.children)}}return r},za=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ba=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))&&!za(e)?0:e.tabIndex},Va=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},$a=function(e){return"INPUT"===e.tagName},Ha=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Wa=function(e,t){return!(t.disabled||Ua(t)||function(e){return $a(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=Pa.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Pa.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ha(e)}else{if("function"==typeof r){for(var s=e;e;){var a=e.parentElement,i=Ma(e);if(a&&!a.shadowRoot&&!0===r(a))return Ha(e);e=e.assignedSlot?e.assignedSlot:a||i===e.ownerDocument?a:i.host}e=s}if(function(e){var t,n,r,o,s=e&&Ma(e),a=null===(t=s)||void 0===t?void 0:t.host,i=!1;if(s&&s!==e)for(i=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!i&&a;){var c,l,u;i=!(null===(l=a=null===(c=s=Ma(a))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(a))}return i}(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!!Pa.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ga=function(e,t){return!(function(e){return function(e){return $a(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Ma(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||Ba(t)<0||!Wa(e,t))},qa=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ka=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,s=o?e.scopeParent:e,a=function(e,t){var n=Ba(e);return n<0&&t&&!za(e)?0:n}(s,o),i=o?Ka(e.candidates):s;0===a?o?t.push.apply(t,i):t.push(s):n.push({documentOrder:r,tabIndex:a,item:e,isScope:o,content:i})}),n.sort(Va).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Ja=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Pa.call(e,Ra)&&Ga(t,e)},Xa=La.concat("iframe").join(","),Ya=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Pa.call(e,Xa)&&Wa(t,e)};function Qa(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 Za(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");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 ei(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ti(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ei(Object(n),!0).forEach(function(t){Za(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ei(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ni=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},ri=function(e){return ni(e)&&!e.shiftKey},oi=function(e){return ni(e)&&e.shiftKey},si=function(e){return setTimeout(e,0)},ai=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},ii=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},ci=[],li=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=(null==t?void 0:t.trapStack)||ci,s=ti({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:ri,isKeyBackward:oi},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},i=function(e,t,n){return e&&void 0!==e[t]?e[t]:s[n||t]},c=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var r=t.container,o=t.tabbableNodes;return r.contains(e)||(null==n?void 0:n.includes(r))||o.find(function(t){return t===e})})},l=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.hasFallback,a=void 0!==o&&o,i=n.params,c=void 0===i?[]:i,l=s[e];if("function"==typeof l&&(l=l.apply(void 0,function(e){if(Array.isArray(e))return Qa(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 Qa(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)?Qa(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&&!a)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&&!Ya(e,s.tabbableOptions))if(c(r.activeElement)>=0)e=r.activeElement;else{var t=a.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(a.containerGroups=a.containers.map(function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Fa([e],t.includeContainer,{filter:Ga.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:qa}):Da(e,t.includeContainer,Ga.bind(null,t)),Ka(n)}(e,s.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?Fa([e],t.includeContainer,{filter:Wa.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Da(e,t.includeContainer,Wa.bind(null,t))}(e,s.tabbableOptions),r=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,a=n.find(function(e){return Ja(e)}),i=n.slice().reverse().find(function(e){return Ja(e)}),c=!!t.find(function(e){return Ba(e)>0});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:a,lastDomTabbableNode:i,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=t.indexOf(e);return o<0?r?n.slice(n.indexOf(e)+1).find(function(e){return Ja(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return Ja(e)}):t[o+(r?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.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(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.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:!!s.preventScroll}),a.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,o=void 0!==r&&r;t=t||ii(n),d();var i=null;if(a.tabbableGroups.length>0){var u=c(t,n),p=u>=0?a.containerGroups[u]:void 0;if(u<0)i=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var f=a.tabbableGroups.findIndex(function(e){var n=e.firstTabbableNode;return t===n});if(f<0&&(p.container===t||Ya(t,s.tabbableOptions)&&!Ja(t,s.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(f=u),f>=0){var h=0===f?a.tabbableGroups.length-1:f-1,m=a.tabbableGroups[h];i=Ba(t)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else ni(n)||(i=p.nextTabbableNode(t,!1))}else{var y=a.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(y<0&&(p.container===t||Ya(t,s.tabbableOptions)&&!Ja(t,s.tabbableOptions)&&!p.nextTabbableNode(t))&&(y=u),y>=0){var v=y===a.tabbableGroups.length-1?0:y+1,g=a.tabbableGroups[v];i=Ba(t)>=0?g.firstTabbableNode:g.firstDomTabbableNode}else ni(n)||(i=p.nextTabbableNode(t))}}else i=l("fallbackFocus");return i},y=function(e){var t=ii(e);c(t,e)>=0||(ai(s.clickOutsideDeactivates,e)?n.deactivate({returnFocus:s.returnFocusOnDeactivate}):ai(s.allowOutsideClick,e)||e.preventDefault())},v=function(e){var t=ii(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var o=!0;if(a.mostRecentlyFocusedNode)if(Ba(a.mostRecentlyFocusedNode)>0){var i=c(a.mostRecentlyFocusedNode),l=a.containerGroups[i].tabbableNodes;if(l.length>0){var d=l.findIndex(function(e){return e===a.mostRecentlyFocusedNode});d>=0&&(s.isKeyForward(a.recentNavEvent)?d+1<l.length&&(r=l[d+1],o=!1):d-1>=0&&(r=l[d-1],o=!1))}}else a.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return Ba(e)>0})})||(o=!1);else o=!1;o&&(r=m({target:a.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(a.recentNavEvent)})),f(r||a.mostRecentlyFocusedNode||u())}a.recentNavEvent=void 0},g=function(e){(s.isKeyForward(e)||s.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.recentNavEvent=e;var n=m({event:e,isBackward:t});n&&(ni(e)&&e.preventDefault(),f(n))}(e,s.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===ai(s.escapeDeactivates,e)||(e.preventDefault(),n.deactivate())},x=function(e){var t=ii(e);c(t,e)>=0||ai(s.clickOutsideDeactivates,e)||ai(s.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},w=function(){if(a.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n._setPausedState(!0)}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)}(o,n),a.delayInitialFocusTimer=s.delayInitialFocus?si(function(){f(u())}):f(u()),r.addEventListener("focusin",v,!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",g,{capture:!0,passive:!1}),r.addEventListener("keydown",b),n},_=function(){if(a.active)return r.removeEventListener("focusin",v,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",x,!0),r.removeEventListener("keydown",g,!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===a.mostRecentlyFocusedNode})})&&f(u())}):void 0,S=function(){C&&(C.disconnect(),a.active&&!a.paused&&a.containers.map(function(e){C.observe(e,{subtree:!0,childList:!0})}))};return n={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=i(e,"onActivate"),n=i(e,"onPostActivate"),o=i(e,"checkCanFocusTrap");o||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=p(r),null==t||t();var s=function(){o&&d(),w(),S(),null==n||n()};return o?(o(a.containers.concat()).then(s,s),this):(s(),this)},deactivate:function(e){if(!a.active)return this;var t=ti({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,_(),a.active=!1,a.paused=!1,S(),function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&!e[e.length-1]._isManuallyPaused()&&e[e.length-1]._setPausedState(!1)}(o,n);var r=i(t,"onDeactivate"),c=i(t,"onPostDeactivate"),l=i(t,"checkCanReturnFocus"),u=i(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){si(function(){u&&f(h(a.nodeFocusedBeforeActivation)),null==c||c()})};return u&&l?(l(h(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return a.active?(a.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,e)):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return a.containers=t.map(function(e){return"string"==typeof e?r.querySelector(e):e}),a.active&&d(),S(),this}},Object.defineProperties(n,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(e,t){if(a.paused===e)return this;if(a.paused=e,e){var n=i(t,"onPause"),r=i(t,"onPostPause");null==n||n(),_(),S(),null==r||r()}else{var o=i(t,"onUnpause"),s=i(t,"onPostUnpause");null==o||o(),d(),w(),S(),null==s||s()}return this}}}),n.updateContainerElements(e),n};const ui=({children:e,onClose:t,fallBackFocusRef:n,"aria-label":r,"aria-labelledby":o})=>{const s=aa(),a=(0,ts.useRef)(null),i=(0,ts.useRef)(null),[c,l]=(0,ts.useState)(!1);return(0,ts.useEffect)(()=>(c&&a.current&&(i.current=li(a.current,{initialFocus:n.current||void 0}),i.current.activate()),()=>{i.current&&i.current.deactivate()}),[c,n]),(0,ts.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()}},[c]),(0,ts.useEffect)(()=>{c&&a.current&&a.current.addEventListener("keydown",e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()})},[c,t]),(0,ts.useLayoutEffect)(()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",s),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),r&&t.setAttribute("aria-label",r),o&&t.setAttribute("aria-labelledby",o),e.appendChild(t),a.current=t,l(!0),()=>{a.current&&(e.removeChild(a.current),a.current=null)}},[r,o,s]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>a.current&&(0,es.render)(e,a.current)}):a.current&&(0,es.render)((0,es.toChildArray)(e).filter(Nn).map(e=>(e.props={...e.props,onClose:t},e)),a.current)},di=({url:e,description:t,onClose:n})=>{const r=gn(),o=ra(),s=Ks(),a=(0,ts.useRef)(null),{t:i}=ys(),c=["modal",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];"function"!=typeof s?c.push(...s):c.push(...s(r));const l=e=>{e.stopPropagation()},u=()=>{n()},d=r?.zIndex?{zIndex:r.zIndex+1}:void 0;return(0,As.jsx)(ui,{onClose:n,"aria-label":i("lightbox.heading"),fallBackFocusRef:a,children:({onClose:n,modalRenderFn:r})=>r((n=>(0,As.jsx)("div",{className:qs(c),onClick:u,style:d,children:(0,As.jsxs)("div",{className:qs("modal__float"),tabIndex:-1,onMouseDown:o,onKeyDown:o,onTouchStart:o,onMouseMove:o,onWheel:o,onPointerDown:o,onPointerMove:o,ref:a,children:[(0,As.jsx)("div",{className:qs("modal__inner"),onClick:l,children:(0,As.jsx)("img",{className:qs("modal__image"),src:e,alt:t})}),(0,As.jsxs)("button",{type:"button",className:qs("modal__close"),onClick:n,children:[(0,As.jsx)(fa,{name:"close",size:"16",alt:""}),i("lightbox.closeLabel")]})]})}))(n))})},pi=({description:e,url:t})=>{const{t:n}=ys(),[r,o]=(0,ts.useState)(!1);return(0,As.jsxs)(As.Fragment,{children:[(0,As.jsxs)("button",{type:"button",className:qs("modal__enlarge"),onClick:()=>{o(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),(0,As.jsx)(fa,{name:"enlarge",size:"32",alt:""})]}),r&&(0,As.jsx)(di,{url:t,description:e,onClose:()=>{o(!1)}})]})},fi=({originMessage:e,transactionId:t})=>{const{emitEvent:n,sendAction:r}=js();return o=>{if(o.target&&o.target.dataset.linkId){const s={type:"navigate",originMessage:e,transactionId:t,link:{id:o.target.dataset.linkId,url:o.target.getAttribute("href")}};r(s),n(`action.${s.type}`,s)}}},hi=({event:e,...t})=>{const{body:n}=Hs(e),r=fi({originMessage:e.payload.id,transactionId:e.payload.transactionId}),o=(0,ts.useMemo)(()=>e.payload.optimisticallyInjected?{children:(0,As.jsx)("p",{children:n?.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:n?.text||""}}},[n,e]);return(0,As.jsx)(la,{type:"text",event:e,onClick:r,...t,...o})},mi="PROCESSING_IMAGE",yi=({img:e,filename:t})=>{const{t:n}=ys(),r=n("fileUpload.srFileUploadedText",{fileName:t});return(0,As.jsx)(As.Fragment,{children:(0,As.jsxs)("span",{className:qs(["download","download--preview"]),children:[(0,As.jsx)("img",{src:e,alt:r}),(0,As.jsx)("span",{"aria-hidden":"true",className:qs("file-download"),children:t})]})})},vi=({children:e,fileId:t,isDeleted:n,onClickHandler:r,url:o,target:s})=>t&&!n?(0,As.jsx)("button",{type:"button",onClick:r,className:qs(["download","download-link"]),children:e}):o?(0,As.jsx)("a",{href:o,download:!0,target:s,className:qs(["download","download-link"]),children:e}):(0,As.jsx)("span",{className:qs("download"),children:e}),gi={message:{choice_prompt:({event:e,children:t,...n})=>{const{t:r}=ys(),o=aa(),{body:s,subEvent:a,showOptions:i,chooseAgain:c,onChoiceClickHandler:l,onChooseAgainClickHandler:u}=_a(e);return(0,As.jsxs)(As.Fragment,{children:[(0,es.toChildArray)(t).filter(Nn).map(e=>(e.props={...e.props,event:a,id:o,showTranslationToggle:!1},e)),c&&(0,As.jsxs)("button",{type:"button",className:qs("button","button--secondary","button--choose-again"),"aria-expanded":i?"true":"false",onClick:u,"aria-describedby":o,children:[r(i?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,As.jsx)(fa,{name:"chevronDown",size:"8",alt:""})]}),i&&(0,As.jsx)(la,{type:"choice-prompt",showParticipant:!1,event:e,...n,children:(0,As.jsx)("ul",{className:qs("choice-prompt","choice-prompt--many"),children:s?.choices?.map(e=>(0,As.jsx)("li",{className:qs("choice-prompt__item",{[`choice-prompt__item--${e?.category}`]:!!e.category}),children:(0,As.jsx)("button",{type:"button",className:qs("button","button--primary"),onClick:()=>{l(e)},children:e.text})},e.id))})})]})},text:hi,image:({event:e,descriptorId:t,...n})=>{const{body:r}=Hs(e),[o,s]=(0,ts.useState)(!1),a=Yo();return(0,As.jsxs)(la,{event:e,type:"image",...n,children:[(0,As.jsx)("img",{src:r?.url,id:t,alt:r?.description||void 0,onLoad:()=>{a(go(e.payload.id)),s(!0)}}),r?.isZoomable&&o&&(0,As.jsx)(pi,{description:r?.description,url:r?.url})]})},splash:({event:e,...t})=>{const{payload:n}=e,{body:r}=Hs(e),o=fi({originMessage:n.id,transactionId:n.transactionId});return(0,As.jsx)(la,{type:"splash",event:e,onClick:o,...t,bodyProps:{dangerouslySetInnerHTML:{__html:r?.text||""}}})},video:({event:e,descriptorId:t,...n})=>{const{body:r}=Hs(e);return Js(e).push("message--type-video"),(0,As.jsxs)(la,{event:e,type:"video",...n,children:[(0,As.jsx)("div",{id:t,className:qs("visually-hidden"),children:r?.description}),(0,As.jsx)("iframe",{title:r?.description||"",src:r?.url,allow:"autoplay; encrypted-media",allowFullScreen:!0})]})},upload:({event:e,...t})=>{const{t:n}=ys(),{body:r}=Hs(e),{fromClient:o,id:s}=e.payload,{filename:a,id:i,isDeleted:c,url:l}=r,u=Cs(),d=(e=>{const{processingFileUploads:t}=vn(({state:e})=>e);return(0,ts.useMemo)(()=>{if(t.some(t=>t===e))return mi;try{return sessionStorage.getItem(`image-${e}`)}catch(e){return}},[e,t])})(s),p=(0,ts.useMemo)(()=>n(c||!l&&!i?"fileUpload.srFileUploadedText":"fileUpload.srFileDownloadText",{fileName:a}),[l,i,a,c,n]);return(0,As.jsx)(la,{event:e,type:"upload",...t,children:d&&d!==mi?(0,As.jsx)(yi,{img:d,filename:a}):(0,As.jsxs)(vi,{fileId:i,isDeleted:c,onClickHandler:()=>{i&&a&&u.downloadFile(i,a)},url:l,target:o?void 0:"_blank",children:[(0,As.jsx)(fa,{name:"download",size:"16",alt:p}),(0,As.jsx)("span",{"aria-hidden":"true",className:qs("file-download"),children:a})]})})},carousel:({event:e})=>{const{body:t}=Hs(e),n=t.cards;return(0,As.jsx)(la,{event:e,modifiers:"type-carousel",children:(0,As.jsx)(ba,{items:n,getItemKey:xa,getItemLabel:wa})})},card:({event:e})=>{const{body:t}=Hs(e),n=aa();return(0,As.jsx)(la,{type:"card",event:e,children:(0,As.jsx)(ua,{id:n,...t})})}},info:{text:hi,divider:({event:e,...t})=>{const n=Ia[U[e.payload.body.subtype]]||Ia.default;return(0,As.jsx)(n,{event:e,...t})},translation:({event:e,...t})=>{const{t:n}=ys(),{body:r}=Hs(e);return(0,As.jsx)(la,{type:"text",event:e,...t,children:n(r.key.join("."),r.variables)})},timeIndicator:Oa},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},o=!!t,s=vn(Vs(e));return{body:s&&o?t:r,hasTranslation:o,isTranslated:s&&o,userLocale:n?.locale}})(e);return n?(0,As.jsx)(ja,{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,ts.useState)(!0),o=Yo(),s=bs(),{addMessageBubble:a,emitEvent:i,sendAction:c}=js(),l=Es(),{suggestions:u,payload:d}=(e=>{const{payload:t}=e,{body:n}=Hs(e);return{suggestions:n,payload:t}})(e),{showSuggestions:p}=gn(),f=An(),{t:h}=ys(),m=h("suggestions.headingText"),y=h("suggestions.footerText"),v=(0,ts.useMemo)(()=>f.some(({payload:e,type:t})=>"message"===t&&e?.transactionLast),[f]),g=(0,ts.useCallback)(({id:e,question:t})=>{if(!l())return;r(!1),o(pr(!0));const n=z(),s={type:T,originMessage:d.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n};c(s),a(t,n),i(`action.${s.type}`,s)},[a,o,i,l,d.id,c]);return n&&!s&&v&&p?(0,As.jsxs)("div",{className:qs("suggestions","suggestions--conversation"),children:[m&&(0,As.jsx)("p",{className:qs("suggestions__heading"),children:m}),(0,As.jsxs)(la,{type:"suggestions",showParticipant:!1,event:e,...t,children:[(0,As.jsx)(Ea,{className:"suggestions__list--conversation",onClickSuggestion:g,suggestions:u}),y&&(0,As.jsx)("p",{className:qs("suggestions__footer"),children:y})]})]}):null}}},bi=({children:e})=>{const{customComponents:t}=gn(),n=(0,ts.useMemo)(()=>Object.keys(gi).reduce((e,n)=>(e[n]={...gi[n],...t?t[n]:{}},e),{fallback:hi}),[t]);return(0,As.jsx)(Ms.Provider,{value:n,children:e})},xi=({children:e})=>{const{isMinimized:t}=vs(),n=(0,ts.useRef)(0),{sendAction:r}=js(),{hasCountdown:o,isActive:s,stopCountdown:a}=oa(),i=(0,ts.useCallback)(()=>{if(t)return;const e=(new Date).getTime(),i=()=>{r({type:"interactivity_update"}),n.current=e};o&&s&&(i(),a()),e-n.current>15e3&&i()},[r,o,s,a,t]);return(0,As.jsx)("div",{className:qs("activity-monitor"),tabIndex:-1,onMouseDown:i,onKeyUp:i,onTouchStart:i,onMouseMove:i,onWheel:i,onPointerDown:i,onPointerMove:i,children:(0,As.jsx)(na.Provider,{value:i,children:e})})},wi=["text","choice_prompt","image","video"],_i=()=>{const e=Xs(),t=(0,ts.useRef)(),n=(0,ts.useRef)(),r=Yo(),o=_s(),s=(0,ts.useRef)(null),{initCountdown:a,endCountdown:i}=oa(),{emitEvent:c}=js(),{hasPrompt:l,continueChat:u}=sa(),d=(0,ts.useRef)(l);return(0,ts.useEffect)(()=>{d.current=l},[l]),(0,ts.useEffect)(()=>{e.socket&&(e.onConnection(({currentState:e})=>{if("attach_channel_erred"===e){const e=new v;return r(Ur({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 hr(e);r(Ur({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r(Xr())}),e.onOpen(()=>{r(Dr())}))},[e,e.socket,r]),(0,ts.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&&a(e.payload.body.duration);break;case"loading":r(vo(e.payload.body.loading));break;case"idle_detach_countdown_elapsed":i(void 0,!0);break;case"resume_conversation_prompt":r(ro());break;case"user_first_response":r(pr(!0)),c("system.userFirstResponse",e.payload.body);break;case"translation_proposal":r(Ho(e.payload.body))}break;case"service_attach":{const{service:{name:t,settings:{proactiveMessages:{enabled:n},entry:o},sessionId:s}}=e.payload;r(Ao(n||!1)),t&&c("system.serviceChanged",t),s&&r(ao(s)),r(_o(o)),r(uo({uploads:{enabled:o.options?.upload?.enabled||!1}}));break}case"context":e.payload.contentLocale&&e.payload.userLocale&&r(Ir(e.payload.userLocale));break;case"message":switch(e.payload.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"custom":case"carousel":case"card":if(e.payload.service&&e.payload.service.serviceSessionId&&r(ao(e.payload.service.serviceSessionId)),e.payload.fromClient){r(Kr(e));break}d.current&&u(),r(qr(e))}break;case"participant":(e=>{const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:o}=t;!n&&"string"!=typeof o&&o?.name&&r(fo(o.name)),r(bo(t)),"string"!=typeof o&&o.introduction&&r(qr({...e,payload:{...t,type:"participant"}}))})(e);break;case"service_data":e.payload.persist&&r(wo(e.payload));break;case"info":"divider"!==e.payload.type&&"text"!==e.payload.type&&"translation"!==e.payload.type||r(qr({type:"info",payload:{...e.payload,participant:null}}));break;case"error":switch(e.payload.type){case"find_conversation":{const t=new g(e);r(Ur({name:t.name,action:t.action,message:t.message,originalEvent:t.originalEvent,originalError:t.originalError}));break}case"conversation":{const t=new v(e);r(Ur({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError,action:t.action}));break}}}return e},e.onMessage(n.current),!0))},[u,e,r,c,i,o,a]),(0,ts.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(Ar(e)).unwrap();t&&"service"in t&&r(mo(t))}catch(e){}return wi.includes(e?.type)?(e.id!==s.current&&o.emit("message",e),s.current=e.id,e):e},e.addListener("message",t.current),!0))},[e,r,o]),null},Ci=({children:e})=>{const{t}=ys(),n=Yo(),r=Cs(),{addUploadBubble:o}=js(),s=(0,ts.useCallback)(async(e,t)=>{n(To(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),o=new Image;o.src=r,await o.decode();const s=(e=>{const t=document.createElement("canvas"),n=t.getContext("2d"),[r,o]=(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=o,n?.drawImage(e,0,0,r,o),t.toDataURL()})(o);try{sessionStorage.setItem(`image-${t}`,s)}catch(e){}finally{n(Io(t))}},[n]),a=(0,ts.useCallback)(e=>{const a=z(),i=r.uploadFile(e,e=>{n(jo({fileId:a,progress:Math.ceil(e)}))},async t=>{const{id:r,transactionId:i,occurredAt:c,body:{contentType:l,filename:u,filesize:d}}=t;n(So(a)),o(r,i,c,l,u,d),l.includes("image/")&&await s(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(Eo({fileId:a,errorText:r}))});n(oo({fileId:a,fileName:e.name,uploadHandle:i}))},[s,o,r,n,t]);return(0,As.jsx)(Ys.Provider,{value:a,children:e})},Si=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=oa();return((e,t)=>{const n=(0,ts.useRef)(e);(0,ts.useEffect)(()=>{n.current=e},[e]),(0,ts.useEffect)(()=>{if(null!==t){const e=setInterval(function(){n.current()},t);return()=>clearInterval(e)}},[t])})(()=>{r()},e&&t&&n&&n>0?1e3:null),null},Ei=()=>{const{initUserSelectedOptions:e}=ea(),t=(0,ts.useRef)(!1),n=gn();return(0,ts.useEffect)(()=>{n.api&&!t.current&&(t.current=!0,e())},[e,n]),null};function ji(e,t,n=[]){const r=_s(),o=(0,ts.useRef)(t);(0,ts.useEffect)(()=>{if(!n.every(Boolean))return;const t=(...e)=>o.current?.(...e);return r.emit("function.register",e,t),()=>r.emit("function.unregister",e,t)},[r,e,...n])}const Ti=()=>{const e=gn(),{emitEvent:t,sendAction:n,sendContext:r,sendMessage:o}=js(),s=Yo(),{setVisibility:a,visible:i}=vs(),c=(0,ts.useRef)(i),l=_s(),u=Cs(),d=Mn(),p=(0,ts.useRef)(null),f=(0,ts.useRef)(null),{isInline:h,isResolving:m}=$n(),y=vn(ks),v=(()=>{const{get:e}=Ss();return e?e("conversationUrl"):null})(),g=(0,ts.useRef)(null),b=ra(),{enableTranslations:x,disableTranslations:w}=$s();return(0,ts.useEffect)(()=>{c.current=i},[i]),ji("askText",e=>{o({body:e})},[u.send]),ji("setVariables",e=>{r({variables:e})},[u.send]),ji("getVisibility",e=>{e?e(c.current):console.warn("A callback function is required for the getVisibility action.")}),ji("setVisibility",e=>{const t="string"==typeof e||null===e?e:e.visibility;Object.values(Kt).includes(t)?(b(),a(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')},[e.api]),ji("sendCustomAction",(e,r)=>{const o={type:"custom",body:{type:e,body:r}};n(o),t(`action.${o.type}`,o)},[u.send]),ji("setTopic",({name:e,fallbackMessage:t,message:r,userTriggered:o})=>{o&&s(ir({showSuggestions:!1})),e&&t?n({type:k,body:{name:e,fallbackMessage:t,message:r}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")},[u.send]),ji("setContext",e=>{r(e)},[u.send]),ji("setTranslation",({enabled:e,locale:t})=>{e?x(t,A):w()},[u.send]),(0,ts.useEffect)(()=>{m||y||(g.current&&g.current!==v&&l.emit("unreadMessageCount",d),i===Kt.open&&i!==f.current&&0!==p.current&&l.emit("unreadMessageCount",0),i!==Kt.open&&d!==p.current&&l.emit("unreadMessageCount",d),f.current=i,p.current=d,"string"==typeof v&&(g.current=v))},[d,i,l,h,m,y,v]),null},Ii=({children:e})=>{const t=_s(),n=(0,ts.useRef)(null),[r,o]=(0,ts.useState)(),s=(0,ts.useRef)(!0),a=(0,ts.useCallback)(e=>{s.current&&(o(e),t.emit("aria-live",e))},[o,t]);return(0,ts.useEffect)(()=>(n.current=null,r?.messageText&&(n.current=setTimeout(()=>{a({}),n.current&&clearTimeout(n.current)},600)),()=>{n.current&&clearTimeout(n.current)}),[r,a]),(0,ts.useEffect)(()=>()=>{s.current=!1},[]),(0,As.jsxs)(Ts.Provider,{value:a,children:[e,(0,As.jsxs)("div",{className:qs("app__live-container"),children:[(0,As.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:qs("visually-hidden"),children:r?.ariaLive===P?r?.messageText:null}),(0,As.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:qs("visually-hidden"),children:r?.ariaLive===M?r?.messageText:null})]})]})},Ni=()=>{const{t:e}=ys(),t=On().historyLoaded,{sendPolite:n}=Is();return(0,ts.useEffect)(()=>{t&&setTimeout(()=>{n(e("window.srTexts.onHistoryLoad"))},500)},[t,e,n]),null},ki=()=>{const{t:e}=ys(),{isOpen:t,isVisible:n}=vs(),r=Mn(),{sendPolite:o}=Is(),s=(0,ts.useMemo)(()=>xn(o,2e3),[o]),a=(0,ts.useRef)(null),i=(0,ts.useRef)(null);return(0,ts.useEffect)(()=>{a.current!==n&&!n&&i.current&&i.current(),0!==r&&!t&&n&&(i.current=s(e("message.srTextUnreadCount",{unreadCount:r}))),a.current=n},[r,t,n,s,e]),null},Oi=({store:e,children:t,eventBus:n,api:r})=>((0,ts.useErrorBoundary)(t=>{console.error(t),e.dispatch(yr(t))}),(0,As.jsx)(cn,{store:e,children:(0,As.jsx)(ws.Provider,{value:n,children:(0,As.jsx)(xs.Provider,{value:r,children:(0,As.jsx)(Ii,{children:(0,As.jsx)(Ps,{children:(0,As.jsxs)(bi,{children:[(0,As.jsx)(Ei,{}),(0,As.jsx)(_i,{}),(0,As.jsx)(ki,{}),(0,As.jsx)(Ni,{}),(0,As.jsx)(Si,{}),(0,As.jsxs)(xi,{children:[(0,As.jsx)(Ti,{}),(0,As.jsx)(Ci,{children:t})]})]})})})})})})),Li=Ht(Rn,e=>e.filter(e=>Br(e)&&"service_data"!==e.type&&e.payload?.messageStatus===E)),Ri=Ht([Li],e=>e.filter(e=>"participant"!==e.type).at(-1)),Ai=Ht(Li,e=>e.filter(({payload:e})=>e?.id).map(({payload:e})=>e.id)),Pi=Ht(({state:e})=>e.options.features?.webNotifications,e=>e?.enabled),Mi=()=>{const{t:e}=ys(),{showDisclaimer:t}=gn();return t?(0,As.jsxs)("div",{className:qs("disclaimer"),tabIndex:0,children:[(0,As.jsx)("h2",{className:qs("disclaimer__title"),children:e("disclaimer.title")}),(0,As.jsx)("div",{className:qs("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]}):null},Ui=Ht([({forms:e})=>e,(e,{formId:t})=>t],(e,t)=>e[t]),Di=Ht(Ui,e=>e?.controls||{}),Fi=Ht(Di,e=>{const t={};return Object.entries(e).forEach(([e,{value:n}])=>{t[e]=n}),t}),zi=Ht([Di,(e,{name:t})=>t],(e,t)=>e[t]?.value),Bi=Ht([Di,(e,{name:t})=>t],(e,t)=>e[t]?.touched),Vi=(0,es.createContext)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),{Provider:$i,Consumer:Hi}=Vi,Wi=Vi;function Gi(){return(0,ts.useContext)(Wi)}function qi(e){const t=Yo(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:s}=Gi(),a=!!vn(e=>Ui(e,{formId:n})),i=vn(t=>zi(t,{formId:n,name:e})),c=vn(t=>Bi(t,{formId:n,name:e})),l=s?.[e],u=!l;(0,ts.useEffect)(()=>{a&&t(Cr({formId:n,name:e}))},[a,n,e,t]),(0,ts.useLayoutEffect)(()=>()=>{t(Sr({formId:n,name:e}))},[a,n,e,t]);const d=(0,ts.useCallback)(t=>r(e,t.target.value),[e,r]),p=(0,ts.useCallback)(()=>{o(e,!0)},[o,e]);return[(0,ts.useMemo)(()=>({name:e,onInput:d,onBlur:p,value:i}),[e,d,p,i]),(0,ts.useMemo)(()=>({isValid:u,error:l,touched:c}),[u,l,c])]}function Ki(e){const{t}=ys(),{sendAssertive:n}=Is(),{hasLimit:r,limit:o}=Vn(),s=(0,ts.useMemo)(()=>xn(n,nr),[n]),a=(0,ts.useMemo)(()=>xn((e,n)=>{e&&s(t("input.srCharacterLimitText",{limit:n}))},nr),[s,t]),[{value:i}]=qi(e),c="number"==typeof o&&r&&i?o-i.length:o,l=!(!r||"number"!=typeof c)&&c<=tr,u=!(!r||"number"!=typeof c)&&c<0;return(0,ts.useEffect)(()=>{a(l,c)},[l,c,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}const Ji=e=>{const{hasCharacterLimit:t,characterLimit:n}=Ki(e),{entryMeta:{active:r,optionsOverride:o}}=On();let s=null,a=null;r&&o&&"object"==typeof o[r]&&(s=o[r].label,a=o[r].placeholder);const{alwaysShowEntryLabel:i}=gn(),{t:c}=ys();return{placeholder:(0,ts.useMemo)(()=>c("input.inputPlaceholder",{hasLimit:t,text:a||c("input.inputPlaceholderText"),limit:t?n:null}),[c,t,n,a]),label:(0,ts.useMemo)(()=>c("input.inputLabel",{hasLimit:!s&&t,text:s||c("input.inputLabelText"),limit:!s&&t?n:null}),[c,t,n,s]),labelClass:(0,ts.useMemo)(()=>!0===i||s?"label":"visually-hidden",[i,s])}};function Xi(){const{abortTransaction:e,clearEntryAbortTransaction:t}=(()=>{const e=Yo(),{entryMeta:{actions:t,translatedActions:n}}=On();return{abortTransaction:n?.abortTransaction||t?.abortTransaction,clearEntryAbortTransaction:()=>{e(Co())}}})(),n=Cs();return e?(0,As.jsx)("li",{className:qs(["cvco-conversation__item","cvco-conversation__item--abort-transaction"]),children:(0,As.jsx)("button",{className:qs(["button","button--secondary","abort-transaction__button"]),type:"button",onClick:()=>{n.send("action",{type:k,body:{name:e.topicName,fallbackMessage:e.topicFallbackMessage}}),t()},children:e.label})}):null}const Yi=(0,es.createContext)(null),Qi=()=>{const e=(0,ts.useContext)(Yi);if(!e)throw new Error("useChatScrollContext has to be used within <ChatScrollContext.Provider>");return e},Zi=Yi,ec=e=>{const t=(()=>{const e=(0,ts.useContext)(Ms);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],o=null;return"choice_prompt"===e.payload.type&&(o=n[e.payload.body.prompt.type]),"participant"===e.type&&(r=n[e.type]),r&&"function"!=typeof r&&(r=r[e.payload.body.type]),[r||t?.fallback,o]},tc=({event:e,newParticipant:t})=>{const{eventRefs:n,unreadIds:r}=Qi(),{sendAction:o}=js(),s=e.payload.id?n[e.payload.id]:void 0,{containerRef:a,isVisible:i}=gs({containerRef:s,freezeOnceVisible:!0}),c=Yo(),[l,u]=ec(e);if((0,Rs.useEffect)(()=>{if(i&&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(co(t)),o({type:"read",events:t})}},[c,e.payload.id,i,o,r]),!l)return null;const d=["conversation__item"];return"info"===e.type?d.push("conversation__item--source-info"):e.payload.fromClient?d.push("conversation__item--source-user"):d.push("conversation__item--source-agent"),t&&d.push("conversation__item--new-participant"),(0,As.jsxs)("li",{className:qs(d),ref:a,children:[e.payload.timeIndicator&&(0,As.jsx)(Oa,{event:e}),(0,As.jsx)(l,{event:e,children:(0,As.jsx)(u,{event:e})})]})},nc=()=>{const{t:e}=ys(),{sendPolite:t}=Is(),{id:n,name:r}=Bn()||{};return(0,ts.useEffect)(()=>{r&&t(e("typing.srText",{name:r}))},[r,t,e]),(0,As.jsx)("li",{className:qs("conversation__item","conversation__item--source-agent"),children:(0,As.jsxs)("div",{className:qs("message","message--source-agent","message--type-loading"),children:[(0,As.jsx)(ca,{eventPayload:{fromClient:!1,participant:n}}),(0,As.jsx)("div",{className:qs("message__body"),children:(0,As.jsxs)("span",{className:qs("loader"),children:[(0,As.jsx)("span",{className:qs("loader__part","one")}),(0,As.jsx)("span",{className:qs("loader__part","two")}),(0,As.jsx)("span",{className:qs("loader__part","three")}),(0,As.jsx)("span",{className:qs("loader__part","four")})]})})]})})},rc=()=>{const e=An();let t;return(0,As.jsx)(As.Fragment,{children:e.map(e=>{const{type:n,payload:r}=e;let o=!1;if("info"===n||"message"===n){const{participant:n,fromClient:s}=r,a=s?"seamly-client-participant":n;"info"!==e.type&&t!==a&&(o=!0),t=a}return(0,As.jsx)(tc,{event:e,newParticipant:o},e.payload.key||e.payload.id)})})},oc=()=>{const{t:e}=ys(),t=Pn(),n=((e,t=20)=>{const[n,r]=(0,ts.useState)(e),o=(0,ts.useRef)(null);return(0,ts.useEffect)(()=>(o.current=setTimeout(()=>r(e),t),()=>{o.current&&clearTimeout(o.current)}),[e,t]),n})(t,t?0:20),{isOpen:r}=vs(),o=Un(),s=Dn(),a=zs();return(0,As.jsxs)(As.Fragment,{children:[r&&(0,As.jsx)("a",{id:o,className:qs("skip-link"),href:`#${s}`,onClick:e=>{e.preventDefault(),a()},children:e("skiplinkText")}),(0,As.jsx)("div",{className:qs("chat__body"),children:(0,As.jsxs)("div",{className:qs("conversation__container"),children:[(0,As.jsx)(Mi,{}),(0,As.jsx)("div",{role:"log","aria-label":e("chat.srLabel"),children:(0,As.jsxs)("ol",{className:qs("conversation"),children:[(0,As.jsx)(bi,{children:(0,As.jsx)(rc,{})}),n?(0,As.jsx)(nc,{}):null,(0,As.jsx)(Xi,{})]})})]})})]})};function sc(e,t){const n=(0,ts.useRef)(null),r=(0,ts.useRef)(e);return(0,ts.useEffect)(()=>{r.current=e},[e]),(0,ts.useEffect)(()=>"number"!=typeof t?()=>{}:(n.current=setTimeout(()=>r.current(),t),()=>{n.current&&clearTimeout(n.current)}),[t]),n}const ac={visible:qs("transition--visible"),in:qs("transition--in"),visuallyHidden:qs("visually-hidden")},ic=Object.values(ac),cc=e=>{const t=(0,ts.useRef)(null);t.current=e;const n="function"==typeof e;return(0,ts.useMemo)(()=>n?(...e)=>t.current(...e):void 0,[n])},lc="notRendered",uc="rendered",dc="visuallyHidden",pc=({children:e,isActive:t,timeout:n=300,transitionStartState:r=lc,onInTransitionComplete:o=()=>{},onOutTransitionComplete:s=()=>{},exitAfter:a,enterDelay:i=0})=>{const c=(0,ts.useRef)(!1),l=(0,ts.useRef)(null),u=(0,ts.useRef)(null),d=r===dc,[p,f]=(0,ts.useState)(()=>d?[ac.visuallyHidden]:[]),[h,m]=(0,ts.useState)(()=>0===i),y=(0,ts.useMemo)(()=>a?a+i:a,[i,a]);sc(()=>m(!1),t?y:void 0),sc(()=>m(!0),t?i:void 0);const v=(0,ts.useMemo)(()=>h&&t,[t,h]),g=cc(o),b=cc(s),x="notRendered"!==r||p.length>0;return(0,ts.useEffect)(()=>(c.current&&!v&&(f([ac.visible]),l.current=setTimeout(()=>{f([...d?[ac.visuallyHidden]:[]]),b&&(u.current=requestAnimationFrame(()=>{b()}))},n)),!c.current&&v&&(f([ac.visible]),u.current=requestAnimationFrame(()=>{u.current=requestAnimationFrame(()=>{f([ac.visible,ac.in]),g&&(l.current=setTimeout(()=>{g()},n))})})),c.current=v,()=>{l.current&&clearTimeout(l.current),u.current&&cancelAnimationFrame(u.current)}),[d,g,b,n,v]),(0,As.jsx)(As.Fragment,{children:x&&(0,es.toChildArray)(e).filter(Nn).map(e=>{const{className:t=""}=e.props,n=t.split(" ").filter(e=>!ic.includes(e));return(0,es.cloneElement)(e,{className:[...n,...p].join(" ")})})})},fc=({isAside:e=!1})=>{const{isInline:t}=$n(),{t:n}=ys(),{addMessageBubble:r,emitEvent:o,sendAction:s}=js(),a=Es(),{isOpen:i,setVisibility:c}=vs(),{showSuggestions:l}=gn(),u=aa(),d=zs(),p=(0,ts.useRef)(null),{sendPolite:f}=Is(),h=vn(ks),{hasCountdown:m,endCountdown:y}=oa(),{hasPrompt:v,continueChat:g}=sa(),b=bs(),x=On().serviceData.suggestion;const{body:w}=Hs({payload:x,type:"service_data"}),_=(0,ts.useMemo)(()=>h?[]:Array.isArray(w)?w:[],[w,h]),C=(0,ts.useRef)(),S=(0,ts.useRef)(!1),E=(0,ts.useRef)(),j=!!_?.length,I=t?(b||i)&&!e:b,N=(0,ts.useRef)(I),k=j&&!I&&l,O=j?_:E.current;E.current=O;const L=(0,ts.useMemo)(()=>{const t=["suggestions"];return e&&t.push("suggestions--aside"),qs(t)},[e]),R=(0,ts.useCallback)(({id:e,question:t})=>{if(!a())return;m&&y(!0),v&&g();const n=z(),l={type:T,originMessage:x.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n};s(l),r(t,n),o(`action.${l.type}`,l),i||c({visibility:Kt.open}),d()},[r,g,y,o,d,a,m,v,i,x,s,c]);(0,ts.useEffect)(()=>{if(C.current!==_&&!I){if(j){const e=S.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout(()=>{f(e)},30)}else S.current&&f(n("suggestions.srUnavailableText"));C.current=_}!N.current&&I?(In(p.current,d),f(n("suggestions.srUnavailableText"))):!j&&S.current&&In(p.current,d),S.current=j,N.current=I},[_,j,I,d,f,n]);const A=n("suggestions.headingText"),P=n("suggestions.footerText"),M=A?"section":"div";return(0,As.jsx)(pc,{isActive:!!k,transitionStartState:lc,children:(0,As.jsxs)(M,{className:L,"aria-labelledby":A?u:void 0,ref:p,children:[A&&(0,As.jsx)("p",{id:u,className:qs("suggestions__heading"),children:A}),!!O&&(0,As.jsx)(Ea,{suggestions:O,onClickSuggestion:R}),P&&!i&&(0,As.jsx)("p",{className:qs("suggestions__footer"),children:P})]})})},hc=(0,Rs.forwardRef)(({children:e,className:t=""},n)=>{const r=(0,Rs.useRef)(null),{closeChat:o,isOpen:s,isVisible:a}=vs(),i=Bs(),{namespace:c,layoutMode:l}=gn(),{isInline:u}=$n(),d=Ks(),p=aa(),f=aa(),h=bs(),{t:m}=ys(),y=["chat",`chat--layout-${l}`,`namespace--${c}`,t];return"function"!=typeof d&&y.push(...d),s||"app"===l||y.push("chat--collapsed"),h&&y.push("chat--user-responded"),(0,Rs.useEffect)(()=>(a&&"window"===l&&(r.current=li(`#${p}`,{initialFocus:!1,clickOutsideDeactivates:!0}),r.current.activate()),()=>{r.current&&r.current.deactivate()}),[p,a,l]),a&&(0,As.jsxs)("section",{id:p,className:qs(y),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!u&&s&&(o(),i())},tabIndex:-1,ref:n,role:"window"===l?"dialog":void 0,"aria-labelledby":f,children:[(0,As.jsx)("h2",{className:qs("chat__title","visually-hidden"),id:f,children:m("window.srModalLayoutLabel")}),(0,As.jsx)("div",{className:qs("chat-wrapper"),children:e}),"inline"===l&&s&&(0,As.jsx)(fc,{isAside:!0})]})}),mc=({children:e,handleClose:t,title:n,closeButtonText:r,srCloseButtonText:o,id:s})=>{const a=aa();return(0,As.jsxs)("section",{tabIndex:-1,id:s,"aria-labelledby":n?a:void 0,className:qs("chat-status",n?void 0:"chat-status--condensed"),children:[(0,As.jsxs)("div",{className:qs("chat-status__body"),children:[n?(0,As.jsx)("h2",{className:qs("chat-status__title"),id:a,children:n}):null,e]}),"function"==typeof t&&(0,As.jsxs)("button",{type:"button",onClick:t,className:qs("button","button--tertiary","chat-status__close"),children:[r||(0,As.jsx)(fa,{name:"close",size:"16",alt:""}),o&&(0,As.jsx)("span",{className:qs("visually-hidden"),children:o})]})]})},yc=({handleClick:e,icon:t,title:n,srButtonText:r})=>(0,As.jsxs)("button",{type:"button",onClick:e,className:qs("button","button--primary","chat-status__button"),children:[(0,As.jsx)(fa,{name:t,size:"16",alt:""}),n,r&&(0,As.jsx)("span",{className:qs("visually-hidden"),children:r})]});function vc(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=(()=>{const{isActive:e,languages:t}=$s(),n=Yo(),{sendAction:r}=js(),{translationProposal:o}=vn(e=>e.translations),{enableTranslations:s}=$s(),{isOpen:a}=vs(),{userLocale:i}=ys(),c=o?.proposedLocale,l=Gs(c),u=(0,ts.useMemo)(()=>null!==o&&!e&&a&&i!==c&&t.some(e=>e.locale===c),[o,e,a,i,c,t]);return{activateTranslationProposal:()=>{o?.proposedLocale&&s(o.proposedLocale,R)},dismissTranslationProposal:()=>{r({type:N,body:{type:L}}),n(Wo())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:o}})(),{id:o}=Ws();return e&&t?(0,As.jsx)(mc,{handleClose:n,srCloseButtonText:t.srDismissButtonText,id:o,title:t.titleLabel,children:(0,As.jsx)(yc,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})}):null}function gc(){const e=vn(ks),{isActive:t}=$s();return e||t?null:(0,As.jsx)(vc,{})}const bc=({label:e,checked:t,description:n,onChange:r,id:o,itemClassName:s})=>(0,As.jsxs)("li",{className:qs([s||"","translation-options__item"]),"aria-selected":t,role:"option",tabIndex:0,onClick:r,onKeyDown:e=>{"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),r())},id:o,children:[(0,As.jsx)(fa,{name:"check",size:"16",alt:""}),e," ",n&&(0,As.jsxs)("span",{children:["(",n,")"]})]}),xc=({onChange:e,describedById:t})=>{const{context:{contentLocale:n}}=gn(),{t:r}=ys(),{languages:o,currentLocale:s,enableTranslations:a,disableTranslations:i}=$s(),c=zs(),l=t=>()=>{t&&(t===s||n===t?i():a(t,"translation_choice"),e(),c())},{primaryLanguages:u,remainingLanguages:d}=(0,Rs.useMemo)(()=>o.reduce((e,t)=>{const r=t.locale===n,o=((e,t,n)=>t===e.locale||!t&&n)(t,s,r);t.locale!==n&&e.remainingLanguages.push({...t,checked:o,isOriginal:r});const a=e.remainingLanguages.findIndex(e=>e.locale===s);return(r||o&&a>4)&&e.primaryLanguages.push({...t,checked:o,isOriginal:r}),e},{primaryLanguages:[],remainingLanguages:[]}),[s,n,o]);return(0,As.jsxs)("ul",{"aria-describedby":t,role:"listbox",tabIndex:-1,className:qs("translation-options"),children:[u.map(({locale:e,nativeName:t,checked:n,isOriginal:o},s)=>(0,As.jsx)(bc,{id:e,label:t,checked:n,description:o?r("translations.settings.original"):void 0,onChange:l(e),itemClassName:qs({"translation-options__item--original":o,"translation-options__item--selected":n&&0!==s})},e)),d.map(({locale:e,nativeName:t,checked:n,isOriginal:o})=>(0,As.jsx)(bc,{id:e,label:t,checked:n,description:o?r("translations.settings.original"):void 0,onChange:l(e)},e))]})},wc=({className:e,children:t,onCancel:n,headingText:r,description:o,descriptionId:s,cancelButtonText:a,cancelButtonRef:i,disableButtonFocusing:c,position:l={horizontal:"left",vertical:"top"}})=>{const u=aa(),{hideOption:d}=ea(),{focusButton:p}=ta(),f=(0,ts.useCallback)(()=>{d(),c||p()},[c,p,d]),h=(0,ts.useCallback)(()=>{n&&n(),f()},[f,n]),m=(e=>{const t=(0,ts.useRef)(null);return(0,ts.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,ts.useEffect)(()=>{Tn(m.current)},[m]),(0,As.jsx)("section",{className:qs("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,As.jsxs)("div",{className:qs("options__body"),children:[(0,As.jsx)("h2",{id:u,className:qs("options__title"),children:r}),(0,As.jsxs)("button",{type:"button",onClick:h,"aria-describedby":u,className:qs("button","options__close"),ref:e=>{i&&(i.current=e)},children:[(0,As.jsx)(fa,{name:"close",size:"16",alt:""}),(0,As.jsx)("span",{children:a})]}),o?(0,As.jsx)("p",{className:qs("options__description"),id:s,children:o}):null,(0,As.jsx)("div",{className:qs("options__wrapper"),children:t})]})})},_c=function({onClose:e,position:t}){const{t:n}=ys(),r=aa();return(0,As.jsx)(wc,{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,As.jsx)(xc,{describedById:r,onChange:e})})};function Cc({children:e,position:t={horizontal:"left",vertical:"top"},classNames:n=[]}){const[r,o]=(0,ts.useState)(!1),s=(0,ts.useRef)(null),a=aa();return(0,As.jsxs)("div",{className:qs("translations__container"),onKeyDown:e=>{r&&jn(e)===En.Escape&&(o(!1),Tn(s.current))},children:[(0,As.jsx)(pc,{transitionStartState:lc,isActive:r,children:(0,As.jsx)("div",{className:qs("options__dialog"),role:"dialog",children:(0,As.jsx)(_c,{onClose:()=>{o(!1)},position:t})})}),(0,As.jsx)("button",{type:"button",className:qs(["button","chat__options__button",...n]),id:a,onClick:()=>{o(!r)},onKeyDown:e=>{jn(e)===En.ArrowDown&&(o(!0),e.preventDefault())},ref:s,"aria-haspopup":"dialog","aria-expanded":r,children:e})]})}const Sc=({children:e,formId:t,persistData:n=!1,onError:r,onSubmit:o,validationSchema:s={},...a})=>{const i=Yo(),c=vn(e=>Fi(e,{formId:t})),[l,u]=(0,ts.useState)(!1),[d,p]=(0,ts.useState)({}),{isValid:f,errors:h}=function(e,t){const n=(0,ts.useMemo)(()=>function(e,t={}){return Object.entries(t).reduce((t,[n,r])=>{const o=Array.isArray(r)?r:[r];for(let r=0;r<o.length;r++)if(!o[r].fn(e[n],o[r].compareValue)){t[n]=o[r].errorText;break}return t},{})}(e,t),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(c,s),m=(0,ts.useMemo)(()=>({...h,...d}),[h,d]);(0,ts.useLayoutEffect)(()=>{i(wr({formId:t,persistData:n}))},[t,n,i]),(0,ts.useEffect)(()=>()=>{i(_r({formId:t}))},[t,n,i]);const y=(0,ts.useCallback)((e,n)=>{i(Er({formId:t,name:e,value:n}))},[t,i]),v=(0,ts.useCallback)((e,n)=>{i(jr({formId:t,name:e,touched:n}))},[i,t]),g=(0,ts.useCallback)((e,t)=>{p(n=>({...n,[e]:t}))},[p]),b=(0,ts.useCallback)(e=>{e.preventDefault();const t="true"===e.submitter.getAttribute("aria-disabled");u(!t),!t&&f&&(i(pr(!0)),o(c,{updateControlValue:y,setError:g}))},[f,i,o,c,y,g]);(0,ts.useEffect)(()=>{r&&r({errors:m,isSubmitted:l,isValid:0===Object.keys(m).length})},[l,m,r]);const x=(0,ts.useMemo)(()=>({formId:t,values:c,errors:m,isValid:0===Object.keys(m).length,isSubmitted:l,handleSubmit:b,validationSchema:s,updateControlValue:y,updateControlTouched:v}),[t,c,m,l,b,s,y,v]);return t?o?(0,As.jsx)($i,{...a,value:x,children:e}):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)},Ec=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),jc=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},Tc=e=>!!e?.length,Ic=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))},Nc=e=>!!e,kc=function({className:e,disableValidationClasses:t=!1,...n}){const{handleSubmit:r,isValid:o,isSubmitted:s}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=Gi();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),a=["form"];return!t&&s&&(a.push("form--submitted"),o?a.push("form--valid"):a.push("form--invalid")),(0,As.jsx)("form",{onSubmit:r,className:qs([...a,e]),...n})};function Oc({id:e,error:t}){const[n,r]=(0,ts.useState)(!1);return(0,ts.useEffect)(()=>{const e=setTimeout(()=>r(!0),300);return()=>clearTimeout(e)},[]),(0,As.jsx)("div",{className:qs("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&(0,As.jsxs)("span",{id:e,className:qs("error__message"),children:[(0,As.jsx)(fa,{name:"error",size:"16",alt:""}),t]})})}const Lc=({contentHint:e,id:t,labelText:n,labelClass:r,validity:o,errorText:s,children:a})=>(0,As.jsxs)(As.Fragment,{children:[e&&(0,As.jsx)("span",{id:`${t}-content-hint`,className:qs("input__content-hint"),children:e}),(0,As.jsx)(Oc,{id:`${t}-error`,error:!o&&s}),(0,As.jsxs)("div",{className:qs("form-control__wrapper"),children:[(0,As.jsx)("label",{htmlFor:t,className:qs(r),children:n}),a]})]}),Rc=function({id:e,name:t,type:n,labelText:r,labelClass:o,contentHint:s=null,focus:a,"aria-invalid":i,"aria-describedby":c,...l}){const u=(0,ts.useRef)(null),{isSubmitted:d}=Gi(),[p,{error:f}]=qi(t),h=d&&f,m=[];return c&&m.push(c),s&&m.push(`${e}-content-hint`),h&&m.push(`${e}-error`),(0,ts.useLayoutEffect)(()=>{u.current&&a&&u.current.focus()},[a]),(0,As.jsx)(Lc,{id:e,contentHint:s,validity:!h,errorText:f,labelText:r,labelClass:o,children:(0,As.jsx)("input",{...p,...l,ref:u,id:e,type:n,"aria-invalid":i||h?"true":"false","aria-describedby":m.join(" ")||void 0,name:t})})};function Ac({controlName:e,describedById:t}){const{t:n}=ys();return(0,As.jsxs)(kc,{noValidate:"true",className:qs("options__form"),children:[(0,As.jsx)(Rc,{id:"email-id",name:e,type:"email",autocomplete:"email",className:qs("transcript__input"),"aria-describedby":t,labelClass:qs("label"),labelText:n("options.sendTranscript.label")}),(0,As.jsx)("div",{className:qs("options__actions"),children:(0,As.jsx)("button",{type:"submit",className:qs("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const Pc="email",Mc={sendTranscript:()=>{const[e,t]=(0,ts.useState)(void 0),{hideOption:n}=ea(),{focusButton:r}=ta(),{t:o}=ys(),s=aa(),{sendAction:a}=js(),i=(0,ts.useMemo)(()=>({[Pc]:[Ec(Nc,o("options.sendTranscript.noEmailText")),Ec(Ic,o("options.sendTranscript.invalidEmailText"))]}),[o]),c=(0,ts.useCallback)(e=>{const t=e[Pc].trim();a({type:"send_transcript",body:{emailAddress:t}}),n(),r()},[a,n,r]),l=(0,ts.useCallback)(({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)},[t]);return(0,As.jsx)(wc,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),description:o("options.sendTranscript.description"),descriptionId:s,position:{vertical:"top",horizontal:"right"},children:(0,As.jsx)(Sc,{formId:"sendTranscript",onSubmit:c,validationSchema:i,onError:l,children:(0,As.jsx)(Ac,{controlName:Pc,describedById:s})})})}},Uc=()=>{const{optionActive:e}=ea(),t=(0,ts.useRef)(),n=Mc[t.current??e];return e&&(t.current=e),n?(0,As.jsx)(n,{}):null},Dc=()=>{const{t:e}=ys(),{menuOptions:t,showOption:n,panelActive:r,hideOption:o}=ea(),{id:s}=ta(),a=(0,ts.useRef)(null),[i,c]=(0,ts.useState)(!1),l=(0,ts.useRef)(null),u=t.length,d=(0,ts.useRef)([]),p=(0,ts.useRef)(!1),f=u>1,h=t[0],m=(0,ts.useMemo)(()=>h?.name?.trim().replace(/\s+/g,""),[h]);return(0,ts.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]),(0,ts.useEffect)(()=>{i&&!p.current&&requestAnimationFrame(async()=>{await Us(60);const e=t.findIndex(e=>e.available),n=-1===e?0:e;d.current&&Tn(d.current[n])}),p.current=i},[i,t]),u?(0,As.jsxs)("div",{className:qs("options__container"),onKeyDown:e=>{i&&(jn(e)===En.Escape&&(c(!1),Tn(l.current)),jn(e)===En.Home&&(d.current&&Tn(d.current[0]),e.preventDefault()),jn(e)===En.End&&(d.current&&Tn(d.current[u-1]),e.preventDefault()))},onFocusOut:()=>{f&&(a.current=setTimeout(()=>{c(!1)},200))},onFocusIn:()=>{a.current&&clearTimeout(a.current)},children:[(0,As.jsx)(pc,{transitionStartState:lc,isActive:r,children:(0,As.jsx)("div",{className:qs("options__dialog"),children:(0,As.jsx)(Uc,{})})}),f&&(0,As.jsx)(pc,{isActive:i,transitionStartState:lc,children:(0,As.jsx)("ul",{className:qs(["options__menu"]),role:"menu",tabIndex:-1,"aria-labelledby":s,children:t.map(({name:r,title:o,available:s},a)=>(0,As.jsx)("li",{className:qs("options__menu__item"),role:"menuitem","data-testid":r,children:(0,As.jsxs)("button",{type:"button",ref:e=>{e&&(d.current[a]=e)},className:qs(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(jn(e)===En.ArrowDown){const n=Math.min(u-1,t+1);d.current&&Tn(d.current[t===n?0:n]),e.preventDefault()}if(jn(e)===En.ArrowUp){const n=Math.max(0,t-1);d.current&&Tn(d.current[t===n?u-1:n]),e.preventDefault()}})(e,a),onKeyPress:e=>((e,n)=>{const r=String.fromCharCode(e.charCode);if(1!==r.length||!r.match(/\S/))return;let o=-1;t.forEach((e,t)=>{t>n&&e.title.charAt(0).toLowerCase()===r.toLowerCase()&&-1===o&&(o=t)}),-1!==o&&d.current&&Tn(d.current[o])})(e,a),onClick:()=>((e,t)=>{t&&(c(!1),n(e))})(r,s),"aria-disabled":!s,children:[(0,As.jsxs)("span",{className:qs("button__text"),children:[o,!s&&" "]}),s?null:(0,As.jsx)("span",{className:qs("button__state"),children:e("options.unavailableText")})]})},r))})}),(0,As.jsxs)("button",{type:"button",className:qs(["button","button--secondary","chat__options__button",...!f&&m?[`chat__options__button--${m}`]:[]]),id:s,onClick:()=>{r&&o(),f?c(e=>!e):h.available&&!r&&n(h.name)},onKeyDown:f?e=>{jn(e)===En.ArrowDown&&(c(!0),e.preventDefault())}:void 0,ref:l,"aria-haspopup":!!f&&"menu","aria-expanded":!!f&&i,"aria-disabled":!f&&!h.available,children:[f?(0,As.jsx)(fa,{name:"options",size:"32",alt:""}):null,(0,As.jsx)("span",{className:qs("button__text"),children:f?e("options.openButtonText"):`${h.title}${h.available?"":" "}`}),f||h.available?null:(0,As.jsx)("span",{className:qs("button__state"),children:e("options.unavailableText")})]})]}):null};function Fc(){const{menuOptions:e,allowOptionSelection:t}=ea(),{isAvailable:n}=$s(),r=vn(ks),{t:o,userLocale:s}=ys(),a=Gs(s);if(!n&&(!t||!e.length)||r)return null;const i=o("translations.settings.openButtonText",{hasLanguage:!!a,language:a});return(0,As.jsxs)("div",{className:qs("chat__options"),children:[n&&(0,As.jsx)("div",{className:qs("chat__options-item","chat__options-item--left"),children:(0,As.jsxs)(Cc,{classNames:["button--secondary"],children:[(0,As.jsx)(fa,{alt:i,name:"newTranslation",size:"16"}),(0,As.jsx)("span",{className:qs("button__text"),children:i})]})}),t&&(0,As.jsx)("div",{className:qs("chat__options-item","chat__options-item--right"),children:(0,As.jsx)(Dc,{})})]})}const zc=()=>{const{scrollToRef:e,unreadIds:t}=Qi(),{isMinimized:n}=vs(),{t:r}=ys();return(0,As.jsx)(pc,{isActive:!!t.length&&!n,children:(0,As.jsx)("div",{className:qs("unread-messages"),children:(0,As.jsxs)("button",{type:"button",className:qs("button","button--primary"),onClick:e,children:[r("message.unreadMessagesCount",{unreadCount:t.length}),(0,As.jsx)(fa,{name:"chevronDown",size:"32",alt:""})]})})})},Bc=({children:e})=>{const t=An(),n=(0,ts.useMemo)(()=>t.reduce((e,t)=>t.payload.id?(e[t.payload.id]=(0,es.createRef)(),e):e,{}),[t]),{scrollToRef:r,scrollToBottom:o,containerRef:s,unreadIds:a}=(e=>{const t=(0,ts.useRef)(null),[n,r]=(0,ts.useState)(!0),o=vn(Ai),s=An(),a=Pn(),{isOpen:i}=vs(),c=On().loadedImageEventIds,{processingFileUploads:l,isLastEventFromClient:u}=vn(({state:e})=>e);(0,ts.useEffect)(()=>{const e=t.current;if(!e)return()=>{};const n=()=>{const{scrollHeight:t,scrollTop:n,clientHeight:o}=e,s=Math.abs(t-n-o)>10;r(!s)};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)},[]);const d=(0,ts.useCallback)(()=>{requestAnimationFrame(async()=>{await Us(30),t.current?.scrollTo({top:t.current?.scrollHeight,left:0,behavior:"auto"})})},[]);return(0,ts.useEffect)(()=>{u&&d()},[u,d]),(0,ts.useEffect)(()=>{n&&d()},[n,o,s,a,i,c,l,d]),{containerRef:t,unreadIds:o,scrollToRef:()=>{const n=o.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,As.jsx)(Zi.Provider,{value:{eventRefs:n,unreadIds:a,scrollToRef:r,scrollToBottom:o,containerRef:s},children:(0,As.jsxs)("div",{className:qs("chat__container"),children:[(0,As.jsx)("div",{className:qs("chat__container__scroll-area"),ref:s,children:e}),(0,As.jsx)(zc,{})]})})},Vc=({baseClassName:e,children:t,title:n})=>{const r=Dn(),o=aa();return(0,As.jsxs)("section",{id:r,className:qs(e),"aria-describedby":o,tabIndex:-1,children:[(0,As.jsx)("h2",{className:qs(`${e}__title`),id:o,children:n}),t]})},$c=()=>{const{t:e}=ys(),t=zs(),n=ra(),{emitEvent:r}=js(),{isActive:o,remaining:s,timer:a,endCountdown:i}=oa(),c=!!s&&s>0,l=e(c?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,As.jsx)(Vc,{baseClassName:"idle",title:l,children:c&&(0,As.jsxs)(As.Fragment,{children:[(0,As.jsx)("div",{className:qs("idle__count-container"),children:o&&(0,As.jsxs)(As.Fragment,{children:[(0,As.jsx)("span",{className:qs("idle__count-text"),children:e("idleDetachWarning.countdownText")}),(0,As.jsx)("span",{className:qs("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",a)})]})}),(0,As.jsxs)("div",{className:qs("idle__options"),children:[(0,As.jsx)("button",{type:"button",className:qs("button","button--primary"),onClick:()=>{n(),i(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),(0,As.jsx)("button",{type:"button",className:qs("button","button--primary"),onClick:()=>{i(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},Hc=()=>{const{t:e}=ys(),t=ra(),{name:n}=Bn()||{},{continueChat:r,restartChat:o}=sa();return(0,As.jsx)(Vc,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:(0,As.jsxs)("div",{className:qs("prompt__options"),children:[(0,As.jsx)("button",{type:"button",className:qs("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),(0,As.jsx)("button",{type:"button",className:qs("button","button--primary"),onClick:o,children:e("resumeConversationPrompt.detachButton")})]})})},Wc=()=>{const{sendAction:e}=js(),{features:t}=ea(),{typingPeekahead:n}=t||{},r=(0,ts.useRef)(null),o=(0,ts.useRef)(null),s=(0,ts.useRef)(!1),a=(0,ts.useRef)(null);(0,ts.useEffect)(()=>()=>{a.current&&clearInterval(a.current),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current)},[]);const i=(t,r)=>{e({type:"typing",state:t,...n&&n.enabled?{body:{currentMessage:r}}:{}})};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(s.current=!0,a.current||(i(!0,e.target.value),a.current=setInterval(()=>{!s.current&&a.current?(clearInterval(a.current),a.current=null):n&&n.enabled&&i(!0,e.target.value)},2e3)),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current),r.current=setTimeout(()=>{s.current=!1},300),o.current=setTimeout(()=>{i(!1,e.target.value)},2e3))}},Gc=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:o}=On().entryMeta,s=Yo(),a=n||t||e,i=o&&o[a]||r&&r[a]||{},c=(0,ts.useCallback)(e=>{s(io(e))},[s]),l=(0,ts.useCallback)(e=>{s(so(e))},[s]),u=(0,ts.useCallback)(e=>{s(No(e))},[s]),d=(0,ts.useCallback)(()=>{n?u(null):l(e)},[l,u,e,n]);return{activeEntry:a,activeEntryOptions:i,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:d,setBlockAutoEntrySwitch:c}},qc=function({id:e,name:t,labelText:n,labelClass:r,contentHint:o=null,focus:s,submitButtonRef:a,"aria-invalid":i,"aria-describedby":c,...l}){const u=(0,ts.useRef)(null),{isSubmitted:d}=Gi(),[p,{error:f}]=qi(t),h=d&&f,m=[c&&c,o&&`${e}-content-hint`,h&&`${e}-error`].filter(Boolean).join(" ");return(0,ts.useLayoutEffect)(()=>{u.current&&s&&u.current.focus()},[s]),(0,As.jsx)(Lc,{id:e,contentHint:o,validity:!h,errorText:f,labelText:n,labelClass:r,children:(0,As.jsx)("textarea",{...p,...l,ref:u,id:e,"aria-invalid":i||h?"true":"false","aria-describedby":m||void 0,name:t,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),a.current&&a.current.click())}})})};function Kc({controlName:e,skipLinkId:t}){const{t:n}=ys(),{setInputFocus:r}=vs(),{sendAssertive:o}=Is(),{emitEvent:s}=js(),a=Wc(),{setBlockAutoEntrySwitch:i}=Gc(),{placeholder:c,label:l,labelClass:u}=Ji(e),{hasCharacterLimit:d,reachedCharacterWarning:p,reachedCharacterLimit:f,remainingChars:h}=Ki(e),[{value:m}]=qi(e),y=!!m,{useMultilineUserInput:v}=gn(),g=(0,ts.useRef)(null),b=(0,ts.useCallback)(()=>{p&&o(n("input.srCharacterLimitText",{limit:h})),s("ui.inputFocus")},[n,o,p,h,s]);(0,ts.useLayoutEffect)(()=>(i(y),()=>{i(!1)}),[i,y]);const x={id:t,name:e,className:qs("input__text"),autocomplete:"off",placeholder:c,labelText:l,labelClass:qs(u),"aria-invalid":!!d&&f,onKeyUp:a,onFocus:b,focus:r};return(0,As.jsxs)(kc,{className:qs("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,As.jsxs)("div",{className:qs(["input--text__container",...p&&!f?["character-warning"]:[],...f?["character-exceeded"]:[]]),children:[v?(0,As.jsx)(qc,{...x,submitButtonRef:g,wrap:"hard"}):(0,As.jsx)(Rc,{...x,type:"text"}),(0,As.jsx)("div",{className:qs("character-count"),children:p&&(0,As.jsx)("span",{children:h})})]}),(0,As.jsx)("button",{className:qs("button","input__submit"),onPointerDown:e=>{e.preventDefault()},"aria-disabled":!y||f,ref:g,type:"submit",children:(0,As.jsx)(fa,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}const Jc="textMessageEntry";function Xc({...e}){const{isOpen:t,setVisibility:n}=vs(),r=Dn(),o=zs(),{sendMessage:s}=js(),a=(0,ts.useCallback)((e,{updateControlValue:r})=>{s({body:e[Jc]}),r(Jc,""),o(),t||n({visibility:Kt.open})},[s,o,t,n]);return(0,As.jsx)(Sc,{...e,formId:"textEntry",persistData:!0,onSubmit:a,children:(0,As.jsx)(Kc,{controlName:Jc,skipLinkId:r})})}const Yc=()=>{const{t:e}=ys(),{currentUploads:t}=Zs();return(0,As.jsx)("div",{className:qs("progress"),children:t.map(({id:t,name:n,progress:r,uploading:o,error:s})=>(0,As.jsxs)("div",{className:qs("progress_container"),children:[(0,As.jsxs)("div",{className:qs("progress__text"),children:[(0,As.jsx)("span",{className:qs("progress__text--file-name"),children:n}),(0,As.jsx)("span",{className:qs("progress__text--percentage"),children:`${r}%`})]}),(0,As.jsx)(Oc,{error:s,id:"progress-error"}),(0,As.jsx)("progress",{className:qs("progress__bar"),role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-label":e("fileUpload.srProgressLabel",{fileName:n}),max:"100","aria-valuenow":r,value:r,"aria-busy":o,children:`${r}%`})]},t))})};function Qc({id:e,name:t,labelText:n,contentHint:r,outputText:o,accept:s}){const{isSubmitted:a}=Gi(),[i,c]=(0,ts.useState)(!1),[{onInput:l,onBlur:u},{error:d}]=qi(t),p=aa(),f=aa(),h=aa(),m=a&&d,y=[h];r&&y.push(f),m&&y.push(p);const v=(0,ts.useCallback)(()=>{c(!0)},[c]),g=(0,ts.useCallback)(()=>{c(!1),u()},[c,u]),b=(0,ts.useCallback)(e=>{const t={target:{value:e.target.files}};l(t)},[l]);return(0,As.jsxs)("div",{className:qs("upload__container"),children:[r&&(0,As.jsx)("span",{className:qs("upload__content-hint"),id:f,children:r}),(0,As.jsx)(Oc,{id:p,error:m&&d}),(0,As.jsx)("div",{className:qs(["file-upload",...i?["focus-within"]:[]]),children:(0,As.jsxs)("label",{htmlFor:e,className:qs("upload__label"),children:[(0,As.jsx)(fa,{name:"upload",size:"32",alt:""}),(0,As.jsxs)("div",{children:[(0,As.jsx)("span",{className:qs(["upload__label--text"]),children:n}),(0,As.jsx)("input",{id:e,className:qs("upload__input"),type:"file",name:t,onChange:b,"aria-invalid":m?"true":"false","aria-describedby":y.join(" "),accept:s||null,onFocus:v,onBlur:g}),(0,As.jsx)("span",{className:qs("upload__output"),"aria-hidden":"true",id:h,children:o})]})]})})]})}const Zc=({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:o,isComplete:s,onClickCancel:a})=>{const{t:i}=ys(),[{value:c}]=qi(t),l=c&&c.length>0,u=l&&"string"!=typeof c?c[0].name:"";return(0,As.jsxs)(kc,{className:qs("upload-form"),children:[(0,As.jsx)(Qc,{name:t,id:e,accept:n,labelText:i("fileUpload.labelText"),outputText:i("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),(0,As.jsxs)("div",{className:qs("upload__button-container"),children:[(0,As.jsx)("button",{id:o||!s?e:void 0,type:"button",onClick:a,className:qs("button","button--secondary","upload__cancel"),children:i("fileUpload.cancelButtonText")}),(0,As.jsx)("button",{className:qs("button","button--primary"),type:"submit",children:i("fileUpload.uploadButtonText")})]})]})},el="fileListForm",tl="fileList",nl=()=>{const{t:e}=ys(),{sendPolite:t,sendAssertive:n}=Is(),r=Dn(),o=zs(),{serviceAllowsUploads:s,allowedMimeTypes:a,maxSize:i}=Qs(),c=(0,ts.useRef)(null),l=(0,ts.useRef)(s),{cancelEntrySelection:u}=Gc(),{uploadFile:d,clearUploads:p,isUploading:f,isComplete:h}=Zs(),{uploadHandle:m,hasServerError:y,progress:v}=((e,t)=>{const n=vn(n=>zi(n,{formId:e,name:t})),{currentUploads:r}=Zs(),o=n&&n.length>0;let s=null,a=!1,i=0;if(r&&r.length>0){const e=r[0];s=e.uploadHandle,a=!!e.error,i=e.progress}return{hasFile:o,selectedFileName:o?n[0].name:"",uploadHandle:s,hasServerError:a,progress:i}})(el,tl),g=aa(),b=(0,ts.useRef)(!0),x=e("fileUpload.contentHint",{size:Cn(i)}),w=(0,ts.useRef)(""),_=(0,ts.useRef)(null);(0,ts.useEffect)(()=>{w.current&&_.current?.contains(document.activeElement)&&"INPUT"===document.activeElement?.tagName&&n(x),w.current=x},[x,n]),(0,ts.useEffect)(()=>{v>0&&t(1===v?e("fileUpload.srStartedText"):`${v}%`)},[v,t,e]),(0,ts.useEffect)(()=>{b.current||f||!h||(p(),u(),o(),setTimeout(()=>{t(e("fileUpload.srCompleteText"))},300)),b.current=h},[f,h,p,u,o,t,e]),(0,ts.useEffect)(()=>{s||f||(p(),u(),o())},[s,f,p,u,o]);const C=(0,ts.useCallback)(({fileList:e})=>{d(e[0]),o()},[d,!1,o]),S=(0,ts.useCallback)(()=>{m&&m.abort(),p(),u(),o()},[m,p,u,o]),E=(0,ts.useMemo)(()=>({[tl]:[Ec(()=>s,e("fileUpload.errors.unavailable")),Ec(Tc,e("fileUpload.errors.noFile")),Ec(jc,e("fileUpload.errors.tooLarge"),i)]}),[i,s,e]);return(0,As.jsx)("div",{className:qs(["upload",...y?["upload--error"]:[]]),ref:_,children:(0,As.jsxs)(Sc,{formId:el,persistData:!0,onSubmit:C,validationSchema:E,children:[(f||!h)&&(0,As.jsxs)(As.Fragment,{children:[(0,As.jsx)(Yc,{}),(0,As.jsx)("div",{className:qs("upload__button-container"),children:(0,As.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:S,ref:c,className:qs("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!f&&h&&(0,As.jsx)(Zc,{controlName:tl,skiplinkId:r,accept:a?.join(", ")||"",contentHint:x,isComplete:h,isUploading:f,onClickCancel:S}),!l.current&&(0,As.jsxs)(As.Fragment,{children:[(0,As.jsx)("span",{className:qs("notification"),id:g,children:e("fileUpload.unavailableText")}),(0,As.jsx)("div",{className:qs("upload__button-container"),children:(0,As.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:S,className:qs("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},rl=()=>{const{t:e}=ys(),{showFileUpload:t,serviceAllowsUploads:n}=Qs(),[r,o]=(0,ts.useState)(n||!1),s=zs(),a=(0,ts.useRef)(null),{setUserEntryType:i,activeEntry:c}=Gc(),l=(0,ts.useRef)(null),{sendPolite:u}=Is(),d=!!Bn();return(0,ts.useEffect)(()=>{In(l.current,()=>{n||s()}),o(n||!1)},[n,s]),(0,ts.useEffect)(()=>{a.current&&!n&&u(e("fileUpload.srUnavailableText")),!1===a.current&&n&&u(e("fileUpload.srAvailableText")),d&&(a.current=n)},[n,d,u,e]),t||c===S?null:(0,As.jsx)(pc,{isActive:r,transitionStartState:uc,children:(0,As.jsx)("div",{className:qs("upload-toggle-wrapper"),children:(0,As.jsx)(pc,{isActive:r,transitionStartState:dc,children:(0,As.jsx)("button",{className:qs(["button","button--secondary","upload-toggle"]),ref:l,"aria-disabled":!r,type:"button",onClick:r?()=>{i(S),s()}:void 0,tabIndex:r?void 0:-1,children:(0,As.jsx)(fa,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})},ol=()=>{const{isOpen:e}=vs(),t=(0,ts.useRef)(null),{hasCountdown:n}=oa(),[r,o]=(0,ts.useState)(n),{hasPrompt:s}=sa(),[a,i]=(0,ts.useState)(s),c=zs(),l=(0,ts.useRef)(!1),{activeEntry:u,activeEntryOptions:d}=Gc(),[p,f]=(0,ts.useState)({text:Xc,upload:nl}),[h,m]=(0,ts.useState)(()=>u),y=gn(),{accountAllowsUploads:v}=Qs(),g=(0,ts.useCallback)(()=>{In(t.current,c)},[c]);(0,ts.useEffect)(()=>{const{customComponents:e}=y,{entry:t}=e||{};t&&f(e=>({...e,...t}))},[y]),(0,ts.useEffect)(()=>{g(),o(n),i(s)},[n,s,g]),(0,ts.useEffect)(()=>{m(u),g()},[u,g,t]),l.current=!(!t.current||!t.current.contains(document.activeElement));const b=p[h]||Xc,{allowManualInput:x=!0}=d;return(0,As.jsxs)("div",{className:qs("chat__entry"),ref:t,children:[r&&(0,As.jsx)($c,{}),a&&(0,As.jsx)(Hc,{}),(0,As.jsxs)("div",{className:qs(["entry__body",...n||s||!1===x?["entry__body--hidden"]:[]]),children:[h!==S&&v&&e?(0,As.jsx)(rl,{}):null,(0,As.jsx)(b,{})]})]})},sl=()=>{const{t:e}=ys(),{isOpen:t,closeChat:n}=vs(),{isWindow:r}=$n(),o=Bs(),s=(0,ts.useCallback)(()=>{n(),o()},[n,o]);return t&&r?(0,As.jsx)("button",{type:"button",className:qs("button","collapse-button"),onClick:s,children:(0,As.jsx)(fa,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null},al=()=>{const{meta:{originalError:e,title:t,message:n,buttonText:r,action:o,srText:s}}=Os(),a=js(),i=aa(),{sendPolite:c}=Is(),l=zs(),u="SeamlySessionExpiredError"===e?.name;return(0,ts.useEffect)(()=>{!u&&s&&setTimeout(()=>{c(s)},200)},[c,s,u]),u?(0,As.jsx)(As.Fragment,{}):(0,As.jsxs)("section",{className:qs("interrupt"),"aria-labelledby":i,children:[(0,As.jsx)(sl,{}),(0,As.jsxs)("div",{className:qs("interrupt__body"),children:[(0,As.jsx)("h2",{id:i,className:qs("interrupt__title"),children:t}),(0,As.jsx)("p",{className:qs("interrupt__message"),children:n}),r&&o&&(0,As.jsx)("div",{className:qs("interrupt__actions"),children:(0,As.jsx)("button",{type:"button",className:qs("button","button--primary"),onClick:()=>{o&&a[o]&&a[o](),l()},children:r})})]})]})},il=function({children:e}){const t=vn(ks),{isOpen:n}=vs();return t?(0,As.jsx)(al,{}):(0,As.jsxs)(As.Fragment,{children:[(0,As.jsxs)(Bc,{children:[(0,As.jsxs)("div",{className:qs("chat__container__header"),children:[(0,As.jsx)(gc,{}),(0,As.jsx)(sl,{})]}),e]}),(0,As.jsx)(ol,{}),n&&(0,As.jsx)(Fc,{})]})};function cl({event:e}){const[t]=ec(e);return(0,As.jsx)("li",{children:(0,As.jsx)(t,{event:e})})}function ll({events:e}){return(0,As.jsx)("ul",{className:qs("collapsed-chat-messages"),children:e.map(e=>(0,As.jsx)(cl,{event:e},e.payload.id))})}function ul(){const{preChatEvents:e}=gn(),t=vn(ks),{isOpen:n}=vs();return t||!e?.length||n?null:(0,As.jsx)(ll,{events:e})}function dl(){const{t:e}=ys(),t=e("window.chat.continue"),n=(0,ts.useMemo)(()=>({type:"message",payload:{type:"custom",body:{text:t,type:"",data:{}},participant:"seamly-client-participant"}}),[t]);return(0,As.jsx)(ll,{events:[n]})}const pl=()=>{const e=bn(),t=Bn(),n=vn(ks),r=t&&!n,o=r?t.avatar:e;return o?(0,As.jsx)("img",{className:qs(r?"avatar":"icon"),src:o,alt:""}):(0,As.jsx)(fa,{name:"avatar",size:"32",alt:""})},fl=({onClick:e})=>{const t=Es(),{t:n}=ys(),r=t()?n("window.openButton.srContinue"):n("window.openButton.srStart"),o=(()=>{const e=Un();return Fs(e)})(),s=zs(),{isOpen:a}=vs(),{windowOpenButtonId:i}=On(),c=Mn(),l=(0,ts.useCallback)(t=>{e(),t.detail>0?s():o()},[o,s,e]);return(0,As.jsx)(pc,{isActive:!a,transitionStartState:uc,children:(0,As.jsxs)("button",{type:"button",className:qs("window-open-button"),"aria-label":r,onClick:l,inert:a||void 0,id:i,children:[(0,As.jsx)(pc,{isActive:!!c,transitionStartState:lc,children:(0,As.jsx)("span",{className:qs("message-count"),"aria-hidden":"true",children:c})}),(0,As.jsx)(pl,{})]})})},hl=(e,t,n)=>"object"==typeof e?e[t]:n,ml=n.p+"sounds/beep.mp3",yl=!!window.Notification,vl={app:()=>(0,As.jsx)(hc,{children:(0,As.jsx)(il,{children:(0,As.jsx)(oc,{})})}),inline:()=>{const{showInlineView:e,containerRef:t}=(()=>{const e=Yo(),{connectWhenInView:t}=gn(),n=vn(Wn),{containerRef:r,isVisible:o}=gs({enabled:t,freezeOnceVisible:!0});return(0,ts.useEffect)(()=>{o&&e(Ko())},[e,o]),{containerRef:r,showInlineView:n}})(),{isOpen:n}=vs();return(0,As.jsxs)(As.Fragment,{children:[(0,As.jsx)(pc,{isActive:!n,transitionStartState:uc,children:(0,As.jsxs)("div",{ref:t,className:qs("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,As.jsx)(ul,{}),(0,As.jsx)(fc,{})]})}),(0,As.jsx)(pc,{isActive:n,transitionStartState:uc,children:(0,As.jsx)(hc,{ref:t,children:e&&(0,As.jsx)(il,{children:n&&(0,As.jsx)(oc,{})})})})]})},window:()=>{const{isOpen:e,openChat:t,showPreChat:n,closePreChat:r,showContinueChat:o,closeContinueChat:s}=vs(),{t:a}=ys(),i=bs(),{continueChat:c,preChat:l,preChatEvents:u}=gn(),d=!0===l&&!!u?.length,p=!0===c,f=(0,As.jsx)("button",{type:"button",className:"cvco-button cvco-collapsed-chat__close","aria-label":a("window.collapsedChat.closeLabel"),children:(0,As.jsx)(fa,{name:"close",size:"8",alt:""})});return(0,As.jsxs)(As.Fragment,{children:[(0,As.jsx)(fl,{onClick:t}),(0,As.jsx)(pc,{isActive:!!l&&!e&&!i&&n,exitAfter:hl(l,"exitAfter"),enterDelay:hl(l,"enterDelay"),transitionStartState:lc,children:(0,As.jsxs)("div",{className:qs("unstarted-wrapper","unstarted-wrapper--window"),onClick:d?r:void 0,children:[d?f:null,(0,As.jsx)(ul,{})]})}),(0,As.jsx)(pc,{isActive:Boolean(c)&&!e&&i&&o,exitAfter:hl(c,"exitAfter"),enterDelay:hl(c,"enterDelay"),transitionStartState:lc,children:(0,As.jsxs)("div",{className:qs("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),onClick:p?s:void 0,children:[p?f:null,(0,As.jsx)(dl,{})]})}),(0,As.jsx)(pc,{isActive:e,transitionStartState:lc,children:(0,As.jsx)(hc,{children:(0,As.jsx)(il,{children:(0,As.jsx)(oc,{})})})})]})}};function gl(e){const t=document.createElement("div");return t.innerHTML=e||"",t.textContent||t.innerText||""}const bl=({children:e})=>{const{sendNotification:t}=(()=>{const{proactiveMessages:e}=Fn(),{notificationAudioURL:t}=gn(),[n,r]=(0,ts.useState)(yl?Notification.permission:"default"),[o,s]=(0,ts.useState)(document.visibilityState),a=vn(Pi),i=(0,ts.useCallback)(async()=>{if(yl&&"granted"!==n){const e=await Notification.requestPermission();r(e)}},[n]),c=(0,ts.useMemo)(()=>"granted"===n,[n]),l=(0,ts.useMemo)(()=>"hidden"===o,[o]);(0,ts.useEffect)(()=>{"default"===n&&e&&i()},[n,e,i]);const u=(0,ts.useCallback)(async(e,r)=>{if(a&&yl){if("default"===n&&i(),!1!==t&&!c&&(l||!document.hasFocus()))try{const e=new Audio(t||ml);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=${Jc}]`);e&&e.focus()}}}},[t,n,c,i,a,l]);return(0,ts.useEffect)(()=>{if(!a)return()=>{};function e(){s(document.visibilityState)}return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e)}},[a]),{permission:n,requestPermission:i,sendNotification:u}})(),[,n]=Ds(),r=gn(),o=Bn(),{proactiveMessages:s}=Fn(),{isOpen:a,isVisible:i}=vs(),c=Ks(),l=bs(),u=vn(Ri),{body:d}=Hs(u),{userLocale:p}=ys(),f=(0,ts.useRef)(void 0),h=(0,ts.useMemo)(()=>d?"string"==typeof d?gl(d):"text"in d?gl(d.text):"prompt"in d&&d.prompt&&"text"in d.prompt?gl(d.prompt?.text):"":"",[d]);(0,ts.useEffect)(()=>{o?.name&&h&&s&&u&&f.current!==u.payload?.id&&(t(o.name,{body:h,icon:o?.avatar||void 0}),f.current=u.payload.id)},[o?.avatar,o?.name,u,h,s,t]);const m=vl[r.layoutMode],y=(0,ts.useCallback)(e=>{"function"==typeof n&&n(e)},[n]),v=(0,ts.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 g=["app",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];return"function"!=typeof c?g.push(...c):g.push(...c(r)),a||"app"===r.layoutMode||g.push("app--collapsed"),l&&g.push("app--user-responded"),i?(0,As.jsx)("div",{className:qs(g),lang:v,tabIndex:-1,"data-nosnippet":!0,style:{zIndex:r?.zIndex},ref:y,children:e||(0,As.jsx)(m,{})}):null},xl=e=>(0,As.jsx)(Oi,{...e,children:(0,As.jsx)(bl,{})});class wl{constructor(e,t){const{namespace:n="",parentElement:r,...o}=e;this.config={...o,namespace:n},this.namespace=n,this.parentElement=r,this.externalApi=t,this.api=new H({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(Zo()),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 o=vt({reducer:Xo,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:o,api:s,layoutMode:a}=Jt(t()),{error:i,type:c}=n,l=mr[i?.name]?new mr[i.name](i):new m(i);r?.(l,{namespace:o,api:s,layoutMode:a,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:o}=n;if(o===Ur.type){if(!zr.includes(r.name))throw new v(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 Oo.toString():e.store.set("options",n.payload);break;case ko.toString():e.store.set("options",{...e.store.get("options")||{},[n.payload.option]:n.payload.value})}return r}}({api:t}),Mo)});return o}({api:this.api,eventBus:this.eventBus,config:n,initialState:void 0});r.dispatch(ar(n)),await r.dispatch(Ut()),await r.dispatch(Qn()),r.dispatch(Yn()),e?(0,es.render)((0,As.jsx)(Oi,{eventBus:this.eventBus,store:r,api:this.api,children:(0,As.jsx)(e,{})}),this.parentElement):(0,es.render)((0,As.jsx)(xl,{config:n,eventBus:this.eventBus,store:r,api:this.api}),this.parentElement)}destroy(){(0,es.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 _l=e=>"object"==typeof e&&"action"in e,Cl=e=>({...e,args:Array.isArray(e.args)?e.args:[e.args]}),Sl=class{constructor(e){this._waitingActions=[],this._instances={},this.timeouts={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(_l).map(Cl)).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:e,locale:n}=t;return e&&n&&(this.context.userLocale=n,this.context.source=A),!0}case"setContext":{const{userLocale:e,contentLocale:n}=t;return this.context.userLocale=e,this.context.contentLocale=n,e&&e!=this.appConfig?.userLocale&&(this.context.source=A),!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:o}=n||t;if(o?Object.values(this._instances).forEach(e=>{e.parentElement!==r&&e.namespace!==o||this.destroy(e)}):this.destroy(),n){const e=this.createInstance(n);this._instances[n.namespace]=e,this.context={},this.debouncedRender(e,n.namespace)}}handleDestroy(e){this.destroy(e.instance)}handleAction(e){const{action:t,instance:n,args:r}=e,o=Object.values(this._instances);return!n&&o.length>1&&console.warn(`Multiple instances detected. Due to potential race conditions, it is recommended to target a specific instance with the action: ${t}`),o.map(e=>(!n||e.namespace===n)&&e.execFunction(t,...r)).some(Boolean)}createInstance(e){return new wl(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},o={...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(o):o}getMergedVariables(e){return{...this.appConfig.context?.variables||{},...e.context?.variables||{},...this.context.variables||{}}}},El=()=>{const e=Yo();return{addEvent:t=>e(qr(t)),clearEvents:()=>e(Xr()),setEventsRead:t=>e(co(t)),setLoadedImageEventIds:t=>e(go(t)),setIsLoading:t=>e(vo(t)),setParticipant:t=>e(bo(t)),setHeaderTitle:t=>e(ho(t)),setHeaderSubTitle:t=>e(fo(t)),setActiveService:t=>e(ao(t)),initIdleDetachCountdown:t=>e(no(t)),decrementIdleDetachCountdownCounter:()=>e(eo()),stopIdleDetachCountdownCounter:()=>e(Ro()),clearIdleDetachCountdown:()=>e(Qr()),initResumeConversationPrompt:()=>e(ro()),clearResumeConversationPrompt:()=>e(Zr()),setServiceDataItem:t=>e(wo(t)),setFeatures:t=>e(po(t)),setFeatureEnabledState:t=>e(lo(t)),clearFeatures:()=>e(Yr()),setInitialState:t=>e(yo(t)),setUserSelectedOptions:t=>e(Oo(t)),setUserSelectedOption:t=>e(ko(t)),showOption:t=>e(Lo(t)),hideOption:()=>e(to()),setServiceEntryMetadata:t=>e(_o(t)),setBlockAutoEntrySwitch:t=>e(io(t)),setActiveEntryType:t=>e(so(t)),setUserEntryType:t=>e(No(t)),registerUpload:t=>e(oo(t)),setUploadProgress:t=>e(jo(t)),setUploadComplete:t=>e(So(t)),setUploadError:t=>e(Eo(t)),clearAllUploads:()=>e(Jr()),setSeamlyContainerElement:t=>e(xo(t))}};function jl(){return{get:()=>{if(Object.prototype.hasOwnProperty.call(window,"SeamlyBridge"))try{return JSON.parse(window.SeamlyBridge.getData())}catch(e){return console.error("Unexpected or malformed data retrieved from bridge",e),{}}return window.seamlyBridgeData},set:e=>{window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.seamlyBridge&&window.webkit.messageHandlers.seamlyBridge.postMessage(JSON.stringify(e)),Object.prototype.hasOwnProperty.call(window,"SeamlyBridge")&&window.SeamlyBridge.setData(JSON.stringify(e)),window.ReactNativeWebView&&window.ReactNativeWebView.postMessage(JSON.stringify(e))}}}function Tl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Il=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=Tl({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in o)o[a]&&(s+="; "+a,!0!==o[a]&&(s+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+s}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var s=n[o].split("="),a=s.slice(1).join("=");try{var i=decodeURIComponent(s[0]);if(r[i]=t.read(a,i),e===i)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",Tl({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,Tl({},this.attributes,t))},withConverter:function(t){return e(Tl({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});function Nl(e={}){return function(t){const n=`cvco.${t}`;return{get(){const e=Il.get(n);return e?JSON.parse(e):null},set(t){t&&Il.set(n,JSON.stringify(t),e)}}}}const kl=()=>{const{t:e}=ys(),{title:t,subTitle:n}=On().headerTitles,r=Mn(),{isOpen:o}=vs(),s=Bn(),a=vn(ks),i=bn(),c=s?.avatar??i,l=a?"":n,u=["message-count"];return o&&u.push("message-count__hide"),0===r&&u.push("message-count__empty"),l||!o?(0,As.jsxs)("div",{className:qs("agent-info"),children:[(0,As.jsxs)("div",{className:qs("agent-info__graphic"),children:[c?(0,As.jsx)("img",{className:qs(s?.avatar?"avatar":"icon"),src:c,alt:""}):(0,As.jsx)(fa,{name:"avatar",size:"32",alt:""}),(0,As.jsx)("span",{className:qs(u),"aria-hidden":"true",children:r})]}),(0,As.jsxs)("div",{className:qs("agent-info__body"),children:[(0,As.jsx)("p",{className:qs("agent-info__heading"),children:t??e("header.title")}),(0,As.jsx)("p",{className:qs("agent-info__text"),children:l})]})]}):null},Ol=({children:e,onCloseChat:t})=>{const{headerCollapseButtonId:n}=On(),r=(0,ts.useRef)(null),{t:o}=ys();return(0,As.jsxs)("header",{className:qs("chat__header"),children:[e,(0,As.jsx)("div",{className:qs("header-controls"),children:(0,As.jsx)("button",{type:"button",className:qs("button","header-controls__collapse"),onClick:t,ref:r,id:n,children:(0,As.jsx)(fa,{name:"chevronDown",size:"32",alt:o("header.collapseApp")})})})]})},Ll=()=>{const e=new URLSearchParams(window.location.search);return Array.from(e.entries()).reduce((e,[t,n])=>({...e,[t]:n}),{})},Rl=e=>new URLSearchParams(e).toString(),Al=(...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},{})},Pl=(...e)=>{const t=new URL(window.location.href),n=e.reduce((e,n)=>{const r=t.searchParams.get(n),o=r||sessionStorage.getItem(n);return r&&sessionStorage.setItem(n,r),o?(e.set(n,o),e):e},new URLSearchParams),r=new URLSearchParams({...Object.fromEntries(t.searchParams),...Object.fromEntries(n)});return r.toString()&&window.history.replaceState(null,"",`?${r}`),Al(...n.keys())},Ml=(...e)=>{const t=document.querySelector("[data-reset-search-params]");t&&t.addEventListener("click",t=>{t.preventDefault();const n=new URL(window.location.href);e.forEach(e=>{sessionStorage.removeItem(e),n.searchParams.delete(e)}),window.location.href=n.toString()})},Ul=function(e){if(window.seamly&&!Array.isArray(window.seamly))throw new Error("Seamly UI has already been initialised. Use the window.seamly object to start new instances instead.");const t=Array.isArray(window.seamly)?window.seamly:[],n=new Sl(e);window.seamly={push:n.push.bind(n)},n.push(...t)}})(),module.exports=r})();
3
3
  //# sourceMappingURL=~/index.min.js.map