@telia-ace/ace-chat-flamingo 1.1.120-rc.5 → 1.1.120-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,52 +1,52 @@
1
- "use strict";var Nr=Object.defineProperty;var Br=(s,e,t)=>e in s?Nr(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var k=(s,e,t)=>Br(s,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class _n{constructor(){this.registeredProviders=new Map}static async getInstance(e){let t=await e.get("conversation");return t||(t=new _n,await e.register("conversation",t),t)}registerProvider(e,t){this.registeredProviders.set(e,t)}}var an=function(s,e){return an=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},an(s,e)};function te(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");an(s,e);function t(){this.constructor=s}s.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Hr(s,e,t,n){function i(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{c(n.next(h))}catch(u){o(u)}}function l(h){try{c(n.throw(h))}catch(u){o(u)}}function c(h){h.done?r(h.value):i(h.value).then(a,l)}c((n=n.apply(s,e||[])).next())})}function ki(s,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(h){return l([c,h])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(n=1,i&&(r=c[0]&2?i.return:c[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;switch(i=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,i=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){t.label=c[1];break}if(c[0]===6&&t.label<r[1]){t.label=r[1],r=c;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(c);break}r[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(s,t)}catch(h){c=[6,h],i=0}finally{n=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Le(s){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&s[e],n=0;if(t)return t.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&n>=s.length&&(s=void 0),{value:s&&s[n++],done:!s}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ce(s,e){var t=typeof Symbol=="function"&&s[Symbol.iterator];if(!t)return s;var n=t.call(s),i,r=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return r}function me(s,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,r;n<i;n++)(r||!(n in e))&&(r||(r=Array.prototype.slice.call(e,0,n)),r[n]=e[n]);return s.concat(r||Array.prototype.slice.call(e))}function Ee(s){return this instanceof Ee?(this.v=s,this):new Ee(s)}function qr(s,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(s,e||[]),i,r=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(p){return function(m){return Promise.resolve(m).then(p,u)}}function a(p,m){n[p]&&(i[p]=function(f){return new Promise(function(E,ie){r.push([p,f,E,ie])>1||l(p,f)})},m&&(i[p]=m(i[p])))}function l(p,m){try{c(n[p](m))}catch(f){d(r[0][3],f)}}function c(p){p.value instanceof Ee?Promise.resolve(p.value.v).then(h,u):d(r[0][2],p)}function h(p){l("next",p)}function u(p){l("throw",p)}function d(p,m){p(m),r.shift(),r.length&&l(r[0][0],r[0][1])}}function Fr(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=s[Symbol.asyncIterator],t;return e?e.call(s):(s=typeof Le=="function"?Le(s):s[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=s[r]&&function(o){return new Promise(function(a,l){o=s[r](o),i(a,l,o.done,o.value)})}}function i(r,o,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},o)}}function x(s){return typeof s=="function"}function Ci(s){var e=function(n){Error.call(n),n.stack=new Error().stack},t=s(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Kt=Ci(function(s){return function(t){s(this),this.message=t?t.length+` errors occurred during unsubscription:
2
- `+t.map(function(n,i){return i+1+") "+n.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=t}});function mt(s,e){if(s){var t=s.indexOf(e);0<=t&&s.splice(t,1)}}var it=function(){function s(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var e,t,n,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Le(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(f){e={error:f}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var h=this.initialTeardown;if(x(h))try{h()}catch(f){r=f instanceof Kt?f.errors:[f]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=Le(u),p=d.next();!p.done;p=d.next()){var m=p.value;try{Es(m)}catch(f){r=r??[],f instanceof Kt?r=me(me([],ce(r)),ce(f.errors)):r.push(f)}}}catch(f){n={error:f}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}}if(r)throw new Kt(r)}},s.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Es(e);else{if(e instanceof s){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},s.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},s.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},s.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&mt(t,e)},s.prototype.remove=function(e){var t=this._finalizers;t&&mt(t,e),e instanceof s&&e._removeParent(this)},s.EMPTY=function(){var e=new s;return e.closed=!0,e}(),s}(),Si=it.EMPTY;function _i(s){return s instanceof it||s&&"closed"in s&&x(s.remove)&&x(s.add)&&x(s.unsubscribe)}function Es(s){x(s)?s():s.unsubscribe()}var Vr={Promise:void 0},Zr={setTimeout:function(s,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,me([s,e],ce(t)))},clearTimeout:function(s){return clearTimeout(s)},delegate:void 0};function Ei(s){Zr.setTimeout(function(){throw s})}function vt(){}function ft(s){s()}var En=function(s){te(e,s);function e(t){var n=s.call(this)||this;return n.isStopped=!1,t?(n.destination=t,_i(t)&&t.add(n)):n.destination=Qr,n}return e.create=function(t,n,i){return new ln(t,n,i)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(it),Wr=function(){function s(e){this.partialObserver=e}return s.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){ut(n)}},s.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){ut(n)}else ut(e)},s.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){ut(t)}},s}(),ln=function(s){te(e,s);function e(t,n,i){var r=s.call(this)||this,o;return x(t)||!t?o={next:t??void 0,error:n??void 0,complete:i??void 0}:o=t,r.destination=new Wr(o),r}return e}(En);function ut(s){Ei(s)}function Gr(s){throw s}var Qr={closed:!0,next:vt,error:Gr,complete:vt},An=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function je(s){return s}function Kr(s){return s.length===0?je:s.length===1?s[0]:function(t){return s.reduce(function(n,i){return i(n)},t)}}var T=function(){function s(e){e&&(this._subscribe=e)}return s.prototype.lift=function(e){var t=new s;return t.source=this,t.operator=e,t},s.prototype.subscribe=function(e,t,n){var i=this,r=Yr(e)?e:new ln(e,t,n);return ft(function(){var o=i,a=o.operator,l=o.source;r.add(a?a.call(r,l):l?i._subscribe(r):i._trySubscribe(r))}),r},s.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},s.prototype.forEach=function(e,t){var n=this;return t=As(t),new t(function(i,r){var o=new ln({next:function(a){try{e(a)}catch(l){r(l),o.unsubscribe()}},error:r,complete:i});n.subscribe(o)})},s.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},s.prototype[An]=function(){return this},s.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kr(e)(this)},s.prototype.toPromise=function(e){var t=this;return e=As(e),new e(function(n,i){var r;t.subscribe(function(o){return r=o},function(o){return i(o)},function(){return n(r)})})},s.create=function(e){return new s(e)},s}();function As(s){var e;return(e=s??Vr.Promise)!==null&&e!==void 0?e:Promise}function Jr(s){return s&&x(s.next)&&x(s.error)&&x(s.complete)}function Yr(s){return s&&s instanceof En||Jr(s)&&_i(s)}function Xr(s){return x(s==null?void 0:s.lift)}function D(s){return function(e){if(Xr(e))return e.lift(function(t){try{return s(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function P(s,e,t,n,i){return new eo(s,e,t,n,i)}var eo=function(s){te(e,s);function e(t,n,i,r,o,a){var l=s.call(this,t)||this;return l.onFinalize=o,l.shouldUnsubscribe=a,l._next=n?function(c){try{n(c)}catch(h){t.error(h)}}:s.prototype._next,l._error=r?function(c){try{r(c)}catch(h){t.error(h)}finally{this.unsubscribe()}}:s.prototype._error,l._complete=i?function(){try{i()}catch(c){t.error(c)}finally{this.unsubscribe()}}:s.prototype._complete,l}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;s.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(En),to=Ci(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),_=function(s){te(e,s);function e(){var t=s.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var n=new Ts(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new to},e.prototype.next=function(t){var n=this;ft(function(){var i,r;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=Le(n.currentObservers),a=o.next();!a.done;a=o.next()){var l=a.value;l.next(t)}}catch(c){i={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var n=this;ft(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var i=n.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;ft(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,i=this,r=i.hasError,o=i.isStopped,a=i.observers;return r||o?Si:(this.currentObservers=null,a.push(t),new it(function(){n.currentObservers=null,mt(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,r=n.thrownError,o=n.isStopped;i?t.error(r):o&&t.complete()},e.prototype.asObservable=function(){var t=new T;return t.source=this,t},e.create=function(t,n){return new Ts(t,n)},e}(T),Ts=function(s){te(e,s);function e(t,n){var i=s.call(this)||this;return i.destination=t,i.source=n,i}return e.prototype.next=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,t)},e.prototype.error=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&i!==void 0?i:Si},e}(_),H=function(s){te(e,s);function e(t){var n=s.call(this)||this;return n._value=t,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var n=s.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},e.prototype.getValue=function(){var t=this,n=t.hasError,i=t.thrownError,r=t._value;if(n)throw i;return this._throwIfClosed(),r},e.prototype.next=function(t){s.prototype.next.call(this,this._value=t)},e}(_),no={now:function(){return Date.now()}},so=function(s){te(e,s);function e(t,n){return s.call(this)||this}return e.prototype.schedule=function(t,n){return this},e}(it),Os={setInterval:function(s,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setInterval.apply(void 0,me([s,e],ce(t)))},clearInterval:function(s){return clearInterval(s)},delegate:void 0},io=function(s){te(e,s);function e(t,n){var i=s.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(t,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var r=this.id,o=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(o,r,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,n),this},e.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),Os.setInterval(t.flush.bind(t,this),i)},e.prototype.recycleAsyncId=function(t,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&Os.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var i=!1,r;try{this.work(t)}catch(o){i=!0,r=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),r},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,i=t.scheduler,r=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,mt(r,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,s.prototype.unsubscribe.call(this)}},e}(so),Ls=function(){function s(e,t){t===void 0&&(t=s.now),this.schedulerActionCtor=e,this.now=t}return s.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},s.now=no.now,s}(),ro=function(s){te(e,s);function e(t,n){n===void 0&&(n=Ls.now);var i=s.call(this,t,n)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var i;this._active=!0;do if(i=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,i){for(;t=n.shift();)t.unsubscribe();throw i}},e}(Ls),Ch=new ro(io);var $e=new T(function(s){return s.complete()});function oo(s){return s&&x(s.schedule)}function Tn(s){return s[s.length-1]}function Ai(s){return x(Tn(s))?s.pop():void 0}function On(s){return oo(Tn(s))?s.pop():void 0}function ao(s,e){return typeof Tn(s)=="number"?s.pop():e}var Ln=function(s){return s&&typeof s.length=="number"&&typeof s!="function"};function Ti(s){return x(s==null?void 0:s.then)}function Oi(s){return x(s[An])}function Li(s){return Symbol.asyncIterator&&x(s==null?void 0:s[Symbol.asyncIterator])}function Pi(s){return new TypeError("You provided "+(s!==null&&typeof s=="object"?"an invalid object":"'"+s+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function lo(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ri=lo();function Ii(s){return x(s==null?void 0:s[Ri])}function Ui(s){return qr(this,arguments,function(){var t,n,i,r;return ki(this,function(o){switch(o.label){case 0:t=s.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Ee(t.read())];case 3:return n=o.sent(),i=n.value,r=n.done,r?[4,Ee(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Ee(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function Mi(s){return x(s==null?void 0:s.getReader)}function N(s){if(s instanceof T)return s;if(s!=null){if(Oi(s))return co(s);if(Ln(s))return ho(s);if(Ti(s))return uo(s);if(Li(s))return ji(s);if(Ii(s))return po(s);if(Mi(s))return fo(s)}throw Pi(s)}function co(s){return new T(function(e){var t=s[An]();if(x(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ho(s){return new T(function(e){for(var t=0;t<s.length&&!e.closed;t++)e.next(s[t]);e.complete()})}function uo(s){return new T(function(e){s.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Ei)})}function po(s){return new T(function(e){var t,n;try{for(var i=Le(s),r=i.next();!r.done;r=i.next()){var o=r.value;if(e.next(o),e.closed)return}}catch(a){t={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}e.complete()})}function ji(s){return new T(function(e){go(s,e).catch(function(t){return e.error(t)})})}function fo(s){return ji(Ui(s))}function go(s,e){var t,n,i,r;return Hr(this,void 0,void 0,function(){var o,a;return ki(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),t=Fr(s),l.label=1;case 1:return[4,t.next()];case 2:if(n=l.sent(),!!n.done)return[3,4];if(o=n.value,e.next(o),e.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),i={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),n&&!n.done&&(r=t.return)?[4,r.call(t)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function ae(s,e,t,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var r=e.schedule(function(){t(),i?s.add(this.schedule(null,n)):this.unsubscribe()},n);if(s.add(r),!i)return r}function zi(s,e){return e===void 0&&(e=0),D(function(t,n){t.subscribe(P(n,function(i){return ae(n,s,function(){return n.next(i)},e)},function(){return ae(n,s,function(){return n.complete()},e)},function(i){return ae(n,s,function(){return n.error(i)},e)}))})}function Di(s,e){return e===void 0&&(e=0),D(function(t,n){n.add(s.schedule(function(){return t.subscribe(n)},e))})}function mo(s,e){return N(s).pipe(Di(e),zi(e))}function vo(s,e){return N(s).pipe(Di(e),zi(e))}function bo(s,e){return new T(function(t){var n=0;return e.schedule(function(){n===s.length?t.complete():(t.next(s[n++]),t.closed||this.schedule())})})}function yo(s,e){return new T(function(t){var n;return ae(t,e,function(){n=s[Ri](),ae(t,e,function(){var i,r,o;try{i=n.next(),r=i.value,o=i.done}catch(a){t.error(a);return}o?t.complete():t.next(r)},0,!0)}),function(){return x(n==null?void 0:n.return)&&n.return()}})}function Ni(s,e){if(!s)throw new Error("Iterable cannot be null");return new T(function(t){ae(t,e,function(){var n=s[Symbol.asyncIterator]();ae(t,e,function(){n.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}function $o(s,e){return Ni(Ui(s),e)}function xo(s,e){if(s!=null){if(Oi(s))return mo(s,e);if(Ln(s))return bo(s,e);if(Ti(s))return vo(s,e);if(Li(s))return Ni(s,e);if(Ii(s))return yo(s,e);if(Mi(s))return $o(s,e)}throw Pi(s)}function fe(s,e){return e?xo(s,e):N(s)}function cn(){for(var s=[],e=0;e<arguments.length;e++)s[e]=arguments[e];var t=On(s);return fe(s,t)}function bt(s,e){return D(function(t,n){var i=0;t.subscribe(P(n,function(r){n.next(s.call(e,r,i++))}))})}var wo=Array.isArray;function ko(s,e){return wo(e)?s.apply(void 0,me([],ce(e))):s(e)}function Bi(s){return bt(function(e){return ko(s,e)})}var Co=Array.isArray,So=Object.getPrototypeOf,_o=Object.prototype,Eo=Object.keys;function Ao(s){if(s.length===1){var e=s[0];if(Co(e))return{args:e,keys:null};if(To(e)){var t=Eo(e);return{args:t.map(function(n){return e[n]}),keys:t}}}return{args:s,keys:null}}function To(s){return s&&typeof s=="object"&&So(s)===_o}function Oo(s,e){return s.reduce(function(t,n,i){return t[n]=e[i],t},{})}function Lo(){for(var s=[],e=0;e<arguments.length;e++)s[e]=arguments[e];var t=On(s),n=Ai(s),i=Ao(s),r=i.args,o=i.keys;if(r.length===0)return fe([],t);var a=new T(Po(r,t,o?function(l){return Oo(o,l)}:je));return n?a.pipe(Bi(n)):a}function Po(s,e,t){return t===void 0&&(t=je),function(n){Ps(e,function(){for(var i=s.length,r=new Array(i),o=i,a=i,l=function(h){Ps(e,function(){var u=fe(s[h],e),d=!1;u.subscribe(P(n,function(p){r[h]=p,d||(d=!0,a--),a||n.next(t(r.slice()))},function(){--o||n.complete()}))},n)},c=0;c<i;c++)l(c)},n)}}function Ps(s,e,t){s?ae(t,s,e):e()}function Ro(s,e,t,n,i,r,o,a){var l=[],c=0,h=0,u=!1,d=function(){u&&!l.length&&!c&&e.complete()},p=function(f){return c<n?m(f):l.push(f)},m=function(f){c++;var E=!1;N(t(f,h++)).subscribe(P(e,function(ie){e.next(ie)},function(){E=!0},void 0,function(){if(E)try{c--;for(var ie=function(){var he=l.shift();o||m(he)};l.length&&c<n;)ie();d()}catch(he){e.error(he)}}))};return s.subscribe(P(e,p,function(){u=!0,d()})),function(){}}function Ge(s,e,t){return t===void 0&&(t=1/0),x(e)?Ge(function(n,i){return bt(function(r,o){return e(n,r,i,o)})(N(s(n,i)))},t):(typeof e=="number"&&(t=e),D(function(n,i){return Ro(n,i,s,t)}))}function Io(s){return s===void 0&&(s=1/0),Ge(je,s)}function Uo(s){return new T(function(e){N(s()).subscribe(e)})}var Mo=["addListener","removeListener"],jo=["addEventListener","removeEventListener"],zo=["on","off"];function yt(s,e,t,n){if(x(t)&&(n=t,t=void 0),n)return yt(s,e,t).pipe(Bi(n));var i=ce(Bo(s)?jo.map(function(a){return function(l){return s[a](e,l,t)}}):Do(s)?Mo.map(Rs(s,e)):No(s)?zo.map(Rs(s,e)):[],2),r=i[0],o=i[1];if(!r&&Ln(s))return Ge(function(a){return yt(a,e,t)})(N(s));if(!r)throw new TypeError("Invalid event target");return new T(function(a){var l=function(){for(var c=[],h=0;h<arguments.length;h++)c[h]=arguments[h];return a.next(1<c.length?c:c[0])};return r(l),function(){return o(l)}})}function Rs(s,e){return function(t){return function(n){return s[t](e,n)}}}function Do(s){return x(s.addListener)&&x(s.removeListener)}function No(s){return x(s.on)&&x(s.off)}function Bo(s){return x(s.addEventListener)&&x(s.removeEventListener)}function Ho(){for(var s=[],e=0;e<arguments.length;e++)s[e]=arguments[e];var t=On(s),n=ao(s,1/0),i=s;return i.length?i.length===1?N(i[0]):Io(n)(fe(i,t)):$e}function I(s,e){return D(function(t,n){var i=0;t.subscribe(P(n,function(r){return s.call(e,r,i++)&&n.next(r)}))})}function hn(s){return D(function(e,t){var n=null,i=!1,r;n=e.subscribe(P(t,void 0,void 0,function(o){r=N(s(o,hn(s)(e))),n?(n.unsubscribe(),n=null,r.subscribe(t)):i=!0})),i&&(n.unsubscribe(),n=null,r.subscribe(t))})}function Jt(s,e){return x(e)?Ge(s,e,1):Ge(s,1)}function V(s){return s<=0?function(){return $e}:D(function(e,t){var n=0;e.subscribe(P(t,function(i){++n<=s&&(t.next(i),s<=n&&t.complete())}))})}function Yt(s){var e=1/0,t;return e<=0?function(){return $e}:D(function(n,i){var r=0,o,a=function(){o==null||o.unsubscribe(),o=null;var c,h;t!=null||l()},l=function(){var c=!1;o=n.subscribe(P(i,void 0,function(){++r<e?o?a():c=!0:i.complete()})),c&&a()};l()})}function Y(s,e){return D(function(t,n){var i=null,r=0,o=!1,a=function(){return o&&!i&&n.complete()};t.subscribe(P(n,function(l){i==null||i.unsubscribe();var c=0,h=r++;N(s(l,h)).subscribe(i=P(n,function(u){return n.next(e?e(l,u,h,c++):u)},function(){i=null,a()}))},function(){o=!0,a()}))})}function O(s){return D(function(e,t){N(s).subscribe(P(t,function(){return t.complete()},vt)),!t.closed&&e.subscribe(t)})}function qo(s,e,t){var n=x(s)||e||t?{next:s,error:e,complete:t}:s;return n?D(function(i,r){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;i.subscribe(P(r,function(l){var c;(c=n.next)===null||c===void 0||c.call(n,l),r.next(l)},function(){var l;a=!1,(l=n.complete)===null||l===void 0||l.call(n),r.complete()},function(l){var c;a=!1,(c=n.error)===null||c===void 0||c.call(n,l),r.error(l)},function(){var l,c;a&&((l=n.unsubscribe)===null||l===void 0||l.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):je}function un(){for(var s=[],e=0;e<arguments.length;e++)s[e]=arguments[e];var t=Ai(s);return D(function(n,i){for(var r=s.length,o=new Array(r),a=s.map(function(){return!1}),l=!1,c=function(u){N(s[u]).subscribe(P(i,function(d){o[u]=d,!l&&!a[u]&&(a[u]=!0,(l=a.every(je))&&(a=null))},vt))},h=0;h<r;h++)c(h);n.subscribe(P(i,function(u){if(l){var d=me([u],ce(o));i.next(t?t.apply(void 0,me([],ce(d))):d)}}))})}var A=(s=>(s.User="user",s.Agent="agent",s.System="system",s))(A||{});const Fo=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,s=>(+s^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+s/4).toString(16)),Hi=()=>typeof crypto.randomUUID=="function"?crypto.randomUUID():Fo();function Is(s){let e=s;const t=/https?:\/\/[^\s<]+/gi,n=/<a [^>]*href="([^"]*)"[^>]*>[^<]*<\/a>/g,i=s.match(t)||[],r=[];let o;for(;(o=n.exec(s))!==null;)r.push(o[1]);return i.filter(l=>!r.includes(l)).forEach(l=>{const c=l.endsWith(".")?l.slice(0,-1):l,h=new RegExp(`(?<!<a[^>]*>)${c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![^<]*</a>)`,"gi");e=e.replace(h,`<a title='${c}' target='_blank' href='${c}'>${c}</a>`)}),e}function dn(s){if(s.includes("aceChatGuideTitle"))return Vo(s);const e=/<a [^>]*>https?:\/\/[^<]*<\/a>/gim;return s.replace(e,t=>{const n=qi(t);if(!n)return t;const i=50;if(n.length>i){const r=/^(https?:\/\/[^/]+)(\/.*)?$/i,o=n.match(r);if(!o)return t;const a=o[1],c=(o[2]||"/").split("?")[0],h=c.split("/").pop(),u=i-a.length;let d=c;h&&h.length<u&&c.length>u?d=c.substring(0,u-h.length-4)+".../"+h:d=c.substring(0,u-3)+"...";const p=`${a}${d}`;return pn(t,p)}return pn(t,n)})}function qi(s){const e=s.match(/href=["']([^'"]*)["']/);if(e&&e.length>1){let t=e[1];return t.endsWith(".")&&(t=t.slice(0,-1)),t}return null}function pn(s,e){return s.replace(/>[^<]*<\/a>/,`>${e}</a>`)}function Vo(s){const e=/<a [^>]*aceChatGuideTitle[^>]*>[^<]*<\/a>/gm;return s.replace(e,t=>{const n=qi(t);if(!n)return t;const i=n.split("?").pop(),o=new URLSearchParams(i).get("aceChatGuideTitle");return o?pn(t,o):t})}class U{constructor(e,t,n){this.type=e,this.sender=t,this.messages=n,this.status="delivered",this.didUpdate=new _,this.actions$=new _,this.remove$=new _,this.timestamp=Date.now(),this.id=Hi()}update(e){this.messages=[{items:e}],this.didUpdate.next(this)}setStatus(e){this.status=e,this.didUpdate.next(this)}remove(){this.remove$.next()}}class Zo{constructor(e){this.name=e,this.print$=new _}print(e,t="html",n=this.name){const i=new U(A.Agent,{name:n},[{items:[[t,{content:e}]]}]);return this.print$.next(i),i}subscribe(){return this.print$.asObservable()}}class Wo{constructor(e){this.name=e,this.print$=new _}print(e){const t=new U(A.User,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class Go{constructor(){this.print$=new _,this.name="system"}print(e){const t=new U(A.System,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class Qo{constructor(e,t){this.name=e,this.component=t,this.print$=new _,this.typingState$=new H(!1),this.complete$=new _,this.system=this.createSystem(),this.rehydrate$=new _,this.saveToCurrentSession$=new _,this.showChatOverlay$=new H(!1),this.onComplete=()=>this.complete$.asObservable()}connect(e={}){this.complete$.pipe(V(1)).subscribe(()=>{this.disconnected()})}disconnected(){}onUserSubmit(e){this.print(A.User,e.text)}print(e,t){const n=new U(e,{name:""},[{items:[["html",{content:t}]]}]);return this.printEntry(n)}printEntry(e){return this.print$.next(e),e}createAgent(e){const t=new Zo(e);return t.subscribe().subscribe(n=>{this.playNotification(),this.printEntry(n)}),t}createUser(e){const t=new Wo(e);return t.subscribe().subscribe(n=>{this.printEntry(n)}),t}createSystem(){const e=new Go;return e.subscribe().subscribe(t=>{this.printEntry(t)}),e}setTypingState(e){this.typingState$.next(e)}setToastMessage(e){this.component.setToastMessage(e)}isTyping(){return this.typingState$.asObservable()}actions(){return this.print$.asObservable()}playNotification(){const e=!document.hidden&&this.component.application.storage.get("open"),t="https://publicpoc.blob.core.windows.net/widget-assets/notification.mp3";!this.component.application.storage.get("muteAudioNotifications")&&!e&&new Audio(t).play().catch(i=>{})}complete(){this.complete$.next()}save(e){this.saveToCurrentSession$.next(e)}async rehydrate(e){}}/**
1
+ "use strict";var cl=Object.defineProperty;var ul=(n,e,t)=>e in n?cl(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var A=(n,e,t)=>ul(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class Xi{constructor(){this.registeredProviders=new Map}static async getInstance(e){let t=await e.get("conversation");return t||(t=new Xi,await e.register("conversation",t),t)}registerProvider(e,t){this.registeredProviders.set(e,t)}}var Ai=function(n,e){return Ai=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])},Ai(n,e)};function Ae(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ai(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function hl(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(u){try{c(i.next(u))}catch(p){o(p)}}function l(u){try{c(i.throw(u))}catch(p){o(p)}}function c(u){u.done?r(u.value):s(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function Co(n,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,s,r,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(u){return l([c,u])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(i=1,s&&(r=c[0]&2?s.return:c[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,c[1])).done)return r;switch(s=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){t.label=c[1];break}if(c[0]===6&&t.label<r[1]){t.label=r[1],r=c;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(c);break}r[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(u){c=[6,u],s=0}finally{i=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function gt(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function De(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),s,r=[],o;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)r.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return r}function Ge(n,e,t){if(t||arguments.length===2)for(var i=0,s=e.length,r;i<s;i++)(r||!(i in e))&&(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return n.concat(r||Array.prototype.slice.call(e))}function ht(n){return this instanceof ht?(this.v=n,this):new ht(n)}function dl(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(n,e||[]),s,r=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(g){return function(m){return Promise.resolve(m).then(g,p)}}function a(g,m){i[g]&&(s[g]=function($){return new Promise(function(me,se){r.push([g,$,me,se])>1||l(g,$)})},m&&(s[g]=m(s[g])))}function l(g,m){try{c(i[g](m))}catch($){d(r[0][3],$)}}function c(g){g.value instanceof ht?Promise.resolve(g.value.v).then(u,p):d(r[0][2],g)}function u(g){l("next",g)}function p(g){l("throw",g)}function d(g,m){g(m),r.shift(),r.length&&l(r[0][0],r[0][1])}}function pl(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof gt=="function"?gt(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=n[r]&&function(o){return new Promise(function(a,l){o=n[r](o),s(a,l,o.done,o.value)})}}function s(r,o,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},o)}}function C(n){return typeof n=="function"}function Eo(n){var e=function(i){Error.call(i),i.stack=new Error().stack},t=n(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var di=Eo(function(n){return function(t){n(this),this.message=t?t.length+` errors occurred during unsubscription:
2
+ `+t.map(function(i,s){return s+1+") "+i.toString()}).join(`
3
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function yn(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}var Yt=function(){function n(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var e,t,i,s,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=gt(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch($){e={error:$}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var u=this.initialTeardown;if(C(u))try{u()}catch($){r=$ instanceof di?$.errors:[$]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var d=gt(p),g=d.next();!g.done;g=d.next()){var m=g.value;try{$r(m)}catch($){r=r??[],$ instanceof di?r=Ge(Ge([],De(r)),De($.errors)):r.push($)}}}catch($){i={error:$}}finally{try{g&&!g.done&&(s=d.return)&&s.call(d)}finally{if(i)throw i.error}}}if(r)throw new di(r)}},n.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)$r(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},n.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},n.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},n.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&yn(t,e)},n.prototype.remove=function(e){var t=this._finalizers;t&&yn(t,e),e instanceof n&&e._removeParent(this)},n.EMPTY=function(){var e=new n;return e.closed=!0,e}(),n}(),Ao=Yt.EMPTY;function To(n){return n instanceof Yt||n&&"closed"in n&&C(n.remove)&&C(n.add)&&C(n.unsubscribe)}function $r(n){C(n)?n():n.unsubscribe()}var fl={Promise:void 0},gl={setTimeout:function(n,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setTimeout.apply(void 0,Ge([n,e],De(t)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function Oo(n){gl.setTimeout(function(){throw n})}function $n(){}function gn(n){n()}var Ki=function(n){Ae(e,n);function e(t){var i=n.call(this)||this;return i.isStopped=!1,t?(i.destination=t,To(t)&&t.add(i)):i.destination=bl,i}return e.create=function(t,i,s){return new Ti(t,i,s)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Yt),ml=function(){function n(e){this.partialObserver=e}return n.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(i){un(i)}},n.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){un(i)}else un(e)},n.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){un(t)}},n}(),Ti=function(n){Ae(e,n);function e(t,i,s){var r=n.call(this)||this,o;return C(t)||!t?o={next:t??void 0,error:i??void 0,complete:s??void 0}:o=t,r.destination=new ml(o),r}return e}(Ki);function un(n){Oo(n)}function vl(n){throw n}var bl={closed:!0,next:$n,error:vl,complete:$n},Ji=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function wt(n){return n}function yl(n){return n.length===0?wt:n.length===1?n[0]:function(t){return n.reduce(function(i,s){return s(i)},t)}}var j=function(){function n(e){e&&(this._subscribe=e)}return n.prototype.lift=function(e){var t=new n;return t.source=this,t.operator=e,t},n.prototype.subscribe=function(e,t,i){var s=this,r=wl(e)?e:new Ti(e,t,i);return gn(function(){var o=s,a=o.operator,l=o.source;r.add(a?a.call(r,l):l?s._subscribe(r):s._trySubscribe(r))}),r},n.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},n.prototype.forEach=function(e,t){var i=this;return t=wr(t),new t(function(s,r){var o=new Ti({next:function(a){try{e(a)}catch(l){r(l),o.unsubscribe()}},error:r,complete:s});i.subscribe(o)})},n.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},n.prototype[Ji]=function(){return this},n.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return yl(e)(this)},n.prototype.toPromise=function(e){var t=this;return e=wr(e),new e(function(i,s){var r;t.subscribe(function(o){return r=o},function(o){return s(o)},function(){return i(r)})})},n.create=function(e){return new n(e)},n}();function wr(n){var e;return(e=n??fl.Promise)!==null&&e!==void 0?e:Promise}function $l(n){return n&&C(n.next)&&C(n.error)&&C(n.complete)}function wl(n){return n&&n instanceof Ki||$l(n)&&To(n)}function xl(n){return C(n==null?void 0:n.lift)}function ne(n){return function(e){if(xl(e))return e.lift(function(t){try{return n(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function G(n,e,t,i,s){return new kl(n,e,t,i,s)}var kl=function(n){Ae(e,n);function e(t,i,s,r,o,a){var l=n.call(this,t)||this;return l.onFinalize=o,l.shouldUnsubscribe=a,l._next=i?function(c){try{i(c)}catch(u){t.error(u)}}:n.prototype._next,l._error=r?function(c){try{r(c)}catch(u){t.error(u)}finally{this.unsubscribe()}}:n.prototype._error,l._complete=s?function(){try{s()}catch(c){t.error(c)}finally{this.unsubscribe()}}:n.prototype._complete,l}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;n.prototype.unsubscribe.call(this),!i&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(Ki),Sl=Eo(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),P=function(n){Ae(e,n);function e(){var t=n.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var i=new xr(this,this);return i.operator=t,i},e.prototype._throwIfClosed=function(){if(this.closed)throw new Sl},e.prototype.next=function(t){var i=this;gn(function(){var s,r;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var o=gt(i.currentObservers),a=o.next();!a.done;a=o.next()){var l=a.value;l.next(t)}}catch(c){s={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}}})},e.prototype.error=function(t){var i=this;gn(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=t;for(var s=i.observers;s.length;)s.shift().error(t)}})},e.prototype.complete=function(){var t=this;gn(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var i=t.observers;i.length;)i.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var i=this,s=this,r=s.hasError,o=s.isStopped,a=s.observers;return r||o?Ao:(this.currentObservers=null,a.push(t),new Yt(function(){i.currentObservers=null,yn(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var i=this,s=i.hasError,r=i.thrownError,o=i.isStopped;s?t.error(r):o&&t.complete()},e.prototype.asObservable=function(){var t=new j;return t.source=this,t},e.create=function(t,i){return new xr(t,i)},e}(j),xr=function(n){Ae(e,n);function e(t,i){var s=n.call(this)||this;return s.destination=t,s.source=i,s}return e.prototype.next=function(t){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,t)},e.prototype.error=function(t){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,t)},e.prototype.complete=function(){var t,i;(i=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||i===void 0||i.call(t)},e.prototype._subscribe=function(t){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(t))!==null&&s!==void 0?s:Ao},e}(P),ae=function(n){Ae(e,n);function e(t){var i=n.call(this)||this;return i._value=t,i}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var i=n.prototype._subscribe.call(this,t);return!i.closed&&t.next(this._value),i},e.prototype.getValue=function(){var t=this,i=t.hasError,s=t.thrownError,r=t._value;if(i)throw s;return this._throwIfClosed(),r},e.prototype.next=function(t){n.prototype.next.call(this,this._value=t)},e}(P),_l={now:function(){return Date.now()}},Cl=function(n){Ae(e,n);function e(t,i){return n.call(this)||this}return e.prototype.schedule=function(t,i){return this},e}(Yt),kr={setInterval:function(n,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setInterval.apply(void 0,Ge([n,e],De(t)))},clearInterval:function(n){return clearInterval(n)},delegate:void 0},El=function(n){Ae(e,n);function e(t,i){var s=n.call(this,t,i)||this;return s.scheduler=t,s.work=i,s.pending=!1,s}return e.prototype.schedule=function(t,i){var s;if(i===void 0&&(i=0),this.closed)return this;this.state=t;var r=this.id,o=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(o,r,i)),this.pending=!0,this.delay=i,this.id=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(o,this.id,i),this},e.prototype.requestAsyncId=function(t,i,s){return s===void 0&&(s=0),kr.setInterval(t.flush.bind(t,this),s)},e.prototype.recycleAsyncId=function(t,i,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return i;i!=null&&kr.clearInterval(i)},e.prototype.execute=function(t,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(t,i);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,i){var s=!1,r;try{this.work(t)}catch(o){s=!0,r=o||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),r},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,i=t.id,s=t.scheduler,r=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,yn(r,this),i!=null&&(this.id=this.recycleAsyncId(s,i,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},e}(Cl),Sr=function(){function n(e,t){t===void 0&&(t=n.now),this.schedulerActionCtor=e,this.now=t}return n.prototype.schedule=function(e,t,i){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(i,t)},n.now=_l.now,n}(),Al=function(n){Ae(e,n);function e(t,i){i===void 0&&(i=Sr.now);var s=n.call(this,t,i)||this;return s.actions=[],s._active=!1,s}return e.prototype.flush=function(t){var i=this.actions;if(this._active){i.push(t);return}var s;this._active=!0;do if(s=t.execute(t.state,t.delay))break;while(t=i.shift());if(this._active=!1,s){for(;t=i.shift();)t.unsubscribe();throw s}},e}(Sr),pp=new Al(El);var Xe=new j(function(n){return n.complete()});function Tl(n){return n&&C(n.schedule)}function es(n){return n[n.length-1]}function Lo(n){return C(es(n))?n.pop():void 0}function ts(n){return Tl(es(n))?n.pop():void 0}function Ol(n,e){return typeof es(n)=="number"?n.pop():e}var ns=function(n){return n&&typeof n.length=="number"&&typeof n!="function"};function Ro(n){return C(n==null?void 0:n.then)}function Io(n){return C(n[Ji])}function Po(n){return Symbol.asyncIterator&&C(n==null?void 0:n[Symbol.asyncIterator])}function Mo(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Ll(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Do=Ll();function Uo(n){return C(n==null?void 0:n[Do])}function No(n){return dl(this,arguments,function(){var t,i,s,r;return Co(this,function(o){switch(o.label){case 0:t=n.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,ht(t.read())];case 3:return i=o.sent(),s=i.value,r=i.done,r?[4,ht(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,ht(s)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function zo(n){return C(n==null?void 0:n.getReader)}function ie(n){if(n instanceof j)return n;if(n!=null){if(Io(n))return Rl(n);if(ns(n))return Il(n);if(Ro(n))return Pl(n);if(Po(n))return jo(n);if(Uo(n))return Ml(n);if(zo(n))return Dl(n)}throw Mo(n)}function Rl(n){return new j(function(e){var t=n[Ji]();if(C(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Il(n){return new j(function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}function Pl(n){return new j(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Oo)})}function Ml(n){return new j(function(e){var t,i;try{for(var s=gt(n),r=s.next();!r.done;r=s.next()){var o=r.value;if(e.next(o),e.closed)return}}catch(a){t={error:a}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}e.complete()})}function jo(n){return new j(function(e){Ul(n,e).catch(function(t){return e.error(t)})})}function Dl(n){return jo(No(n))}function Ul(n,e){var t,i,s,r;return hl(this,void 0,void 0,function(){var o,a;return Co(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),t=pl(n),l.label=1;case 1:return[4,t.next()];case 2:if(i=l.sent(),!!i.done)return[3,4];if(o=i.value,e.next(o),e.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),s={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),i&&!i.done&&(r=t.return)?[4,r.call(t)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Pe(n,e,t,i,s){i===void 0&&(i=0),s===void 0&&(s=!1);var r=e.schedule(function(){t(),s?n.add(this.schedule(null,i)):this.unsubscribe()},i);if(n.add(r),!s)return r}function Ho(n,e){return e===void 0&&(e=0),ne(function(t,i){t.subscribe(G(i,function(s){return Pe(i,n,function(){return i.next(s)},e)},function(){return Pe(i,n,function(){return i.complete()},e)},function(s){return Pe(i,n,function(){return i.error(s)},e)}))})}function Fo(n,e){return e===void 0&&(e=0),ne(function(t,i){i.add(n.schedule(function(){return t.subscribe(i)},e))})}function Nl(n,e){return ie(n).pipe(Fo(e),Ho(e))}function zl(n,e){return ie(n).pipe(Fo(e),Ho(e))}function jl(n,e){return new j(function(t){var i=0;return e.schedule(function(){i===n.length?t.complete():(t.next(n[i++]),t.closed||this.schedule())})})}function Hl(n,e){return new j(function(t){var i;return Pe(t,e,function(){i=n[Do](),Pe(t,e,function(){var s,r,o;try{s=i.next(),r=s.value,o=s.done}catch(a){t.error(a);return}o?t.complete():t.next(r)},0,!0)}),function(){return C(i==null?void 0:i.return)&&i.return()}})}function Bo(n,e){if(!n)throw new Error("Iterable cannot be null");return new j(function(t){Pe(t,e,function(){var i=n[Symbol.asyncIterator]();Pe(t,e,function(){i.next().then(function(s){s.done?t.complete():t.next(s.value)})},0,!0)})})}function Fl(n,e){return Bo(No(n),e)}function Bl(n,e){if(n!=null){if(Io(n))return Nl(n,e);if(ns(n))return jl(n,e);if(Ro(n))return zl(n,e);if(Po(n))return Bo(n,e);if(Uo(n))return Hl(n,e);if(zo(n))return Fl(n,e)}throw Mo(n)}function Ve(n,e){return e?Bl(n,e):ie(n)}function Oi(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=ts(n);return Ve(n,t)}function wn(n,e){return ne(function(t,i){var s=0;t.subscribe(G(i,function(r){i.next(n.call(e,r,s++))}))})}var ql=Array.isArray;function Vl(n,e){return ql(e)?n.apply(void 0,Ge([],De(e))):n(e)}function qo(n){return wn(function(e){return Vl(n,e)})}var Wl=Array.isArray,Gl=Object.getPrototypeOf,Zl=Object.prototype,Yl=Object.keys;function Ql(n){if(n.length===1){var e=n[0];if(Wl(e))return{args:e,keys:null};if(Xl(e)){var t=Yl(e);return{args:t.map(function(i){return e[i]}),keys:t}}}return{args:n,keys:null}}function Xl(n){return n&&typeof n=="object"&&Gl(n)===Zl}function Kl(n,e){return n.reduce(function(t,i,s){return t[i]=e[s],t},{})}function Jl(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=ts(n),i=Lo(n),s=Ql(n),r=s.args,o=s.keys;if(r.length===0)return Ve([],t);var a=new j(ec(r,t,o?function(l){return Kl(o,l)}:wt));return i?a.pipe(qo(i)):a}function ec(n,e,t){return t===void 0&&(t=wt),function(i){_r(e,function(){for(var s=n.length,r=new Array(s),o=s,a=s,l=function(u){_r(e,function(){var p=Ve(n[u],e),d=!1;p.subscribe(G(i,function(g){r[u]=g,d||(d=!0,a--),a||i.next(t(r.slice()))},function(){--o||i.complete()}))},i)},c=0;c<s;c++)l(c)},i)}}function _r(n,e,t){n?Pe(t,n,e):e()}function tc(n,e,t,i,s,r,o,a){var l=[],c=0,u=0,p=!1,d=function(){p&&!l.length&&!c&&e.complete()},g=function($){return c<i?m($):l.push($)},m=function($){c++;var me=!1;ie(t($,u++)).subscribe(G(e,function(se){e.next(se)},function(){me=!0},void 0,function(){if(me)try{c--;for(var se=function(){var Le=l.shift();o||m(Le)};l.length&&c<i;)se();d()}catch(Le){e.error(Le)}}))};return n.subscribe(G(e,g,function(){p=!0,d()})),function(){}}function zt(n,e,t){return t===void 0&&(t=1/0),C(e)?zt(function(i,s){return wn(function(r,o){return e(i,r,s,o)})(ie(n(i,s)))},t):(typeof e=="number"&&(t=e),ne(function(i,s){return tc(i,s,n,t)}))}function nc(n){return n===void 0&&(n=1/0),zt(wt,n)}function ic(n){return new j(function(e){ie(n()).subscribe(e)})}var sc=["addListener","removeListener"],rc=["addEventListener","removeEventListener"],oc=["on","off"];function xn(n,e,t,i){if(C(t)&&(i=t,t=void 0),i)return xn(n,e,t).pipe(qo(i));var s=De(cc(n)?rc.map(function(a){return function(l){return n[a](e,l,t)}}):ac(n)?sc.map(Cr(n,e)):lc(n)?oc.map(Cr(n,e)):[],2),r=s[0],o=s[1];if(!r&&ns(n))return zt(function(a){return xn(a,e,t)})(ie(n));if(!r)throw new TypeError("Invalid event target");return new j(function(a){var l=function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];return a.next(1<c.length?c:c[0])};return r(l),function(){return o(l)}})}function Cr(n,e){return function(t){return function(i){return n[t](e,i)}}}function ac(n){return C(n.addListener)&&C(n.removeListener)}function lc(n){return C(n.on)&&C(n.off)}function cc(n){return C(n.addEventListener)&&C(n.removeEventListener)}function uc(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=ts(n),i=Ol(n,1/0),s=n;return s.length?s.length===1?ie(s[0]):nc(i)(Ve(s,t)):Xe}function K(n,e){return ne(function(t,i){var s=0;t.subscribe(G(i,function(r){return n.call(e,r,s++)&&i.next(r)}))})}function Li(n){return ne(function(e,t){var i=null,s=!1,r;i=e.subscribe(G(t,void 0,void 0,function(o){r=ie(n(o,Li(n)(e))),i?(i.unsubscribe(),i=null,r.subscribe(t)):s=!0})),s&&(i.unsubscribe(),i=null,r.subscribe(t))})}function pi(n,e){return C(e)?zt(n,e,1):zt(n,1)}function he(n){return n<=0?function(){return Xe}:ne(function(e,t){var i=0;e.subscribe(G(t,function(s){++i<=n&&(t.next(s),n<=i&&t.complete())}))})}function fi(n){var e=1/0,t;return e<=0?function(){return Xe}:ne(function(i,s){var r=0,o,a=function(){o==null||o.unsubscribe(),o=null;var c,u;t!=null||l()},l=function(){var c=!1;o=i.subscribe(G(s,void 0,function(){++r<e?o?a():c=!0:s.complete()})),c&&a()};l()})}function _e(n,e){return ne(function(t,i){var s=null,r=0,o=!1,a=function(){return o&&!s&&i.complete()};t.subscribe(G(i,function(l){s==null||s.unsubscribe();var c=0,u=r++;ie(n(l,u)).subscribe(s=G(i,function(p){return i.next(e?e(l,p,u,c++):p)},function(){s=null,a()}))},function(){o=!0,a()}))})}function B(n){return ne(function(e,t){ie(n).subscribe(G(t,function(){return t.complete()},$n)),!t.closed&&e.subscribe(t)})}function hc(n,e,t){var i=C(n)||e||t?{next:n,error:e,complete:t}:n;return i?ne(function(s,r){var o;(o=i.subscribe)===null||o===void 0||o.call(i);var a=!0;s.subscribe(G(r,function(l){var c;(c=i.next)===null||c===void 0||c.call(i,l),r.next(l)},function(){var l;a=!1,(l=i.complete)===null||l===void 0||l.call(i),r.complete()},function(l){var c;a=!1,(c=i.error)===null||c===void 0||c.call(i,l),r.error(l)},function(){var l,c;a&&((l=i.unsubscribe)===null||l===void 0||l.call(i)),(c=i.finalize)===null||c===void 0||c.call(i)}))}):wt}function Ri(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=Lo(n);return ne(function(i,s){for(var r=n.length,o=new Array(r),a=n.map(function(){return!1}),l=!1,c=function(p){ie(n[p]).subscribe(G(s,function(d){o[p]=d,!l&&!a[p]&&(a[p]=!0,(l=a.every(wt))&&(a=null))},$n))},u=0;u<r;u++)c(u);i.subscribe(G(s,function(p){if(l){var d=Ge([p],De(o));s.next(t?t.apply(void 0,Ge([],De(d))):d)}}))})}var z=(n=>(n.User="user",n.Agent="agent",n.System="system",n))(z||{});const dc=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+n/4).toString(16)),Vo=()=>typeof crypto.randomUUID=="function"?crypto.randomUUID():dc();function Er(n){let e=n;const t=/https?:\/\/[^\s<]+/gi,i=/<a [^>]*href="([^"]*)"[^>]*>[^<]*<\/a>/g,s=n.match(t)||[],r=[];let o;for(;(o=i.exec(n))!==null;)r.push(o[1]);return s.filter(l=>!r.includes(l)).forEach(l=>{const c=l.endsWith(".")?l.slice(0,-1):l,u=new RegExp(`(?<!<a[^>]*>)${c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![^<]*</a>)`,"gi");e=e.replace(u,`<a title='${c}' target='_blank' href='${c}'>${c}</a>`)}),e}function Ii(n){if(n.includes("aceChatGuideTitle"))return pc(n);const e=/<a [^>]*>https?:\/\/[^<]*<\/a>/gim;return n.replace(e,t=>{const i=Wo(t);if(!i)return t;const s=50;if(i.length>s){const r=/^(https?:\/\/[^/]+)(\/.*)?$/i,o=i.match(r);if(!o)return t;const a=o[1],c=(o[2]||"/").split("?")[0],u=c.split("/").pop(),p=s-a.length;let d=c;u&&u.length<p&&c.length>p?d=c.substring(0,p-u.length-4)+".../"+u:d=c.substring(0,p-3)+"...";const g=`${a}${d}`;return Pi(t,g)}return Pi(t,i)})}function Wo(n){const e=n.match(/href=["']([^'"]*)["']/);if(e&&e.length>1){let t=e[1];return t.endsWith(".")&&(t=t.slice(0,-1)),t}return null}function Pi(n,e){return n.replace(/>[^<]*<\/a>/,`>${e}</a>`)}function pc(n){const e=/<a [^>]*aceChatGuideTitle[^>]*>[^<]*<\/a>/gm;return n.replace(e,t=>{const i=Wo(t);if(!i)return t;const s=i.split("?").pop(),o=new URLSearchParams(s).get("aceChatGuideTitle");return o?Pi(t,o):t})}class J{constructor(e,t,i){this.type=e,this.sender=t,this.messages=i,this.status="delivered",this.didUpdate=new P,this.actions$=new P,this.remove$=new P,this.timestamp=Date.now(),this.id=Vo()}update(e){this.messages=[{items:e}],this.didUpdate.next(this)}setStatus(e){this.status=e,this.didUpdate.next(this)}remove(){this.remove$.next()}}class fc{constructor(e){this.name=e,this.print$=new P}print(e,t="html",i=this.name){const s=new J(z.Agent,{name:i},[{items:[[t,{content:e}]]}]);return this.print$.next(s),s}subscribe(){return this.print$.asObservable()}}class gc{constructor(e){this.name=e,this.print$=new P}print(e){const t=new J(z.User,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class mc{constructor(){this.print$=new P,this.name="system"}print(e){const t=new J(z.System,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class vc{constructor(e,t){this.name=e,this.component=t,this.print$=new P,this.typingState$=new ae(!1),this.complete$=new P,this.system=this.createSystem(),this.rehydrate$=new P,this.saveToCurrentSession$=new P,this.showChatOverlay$=new ae(!1),this.onComplete=()=>this.complete$.asObservable()}connect(e={}){this.complete$.pipe(he(1)).subscribe(()=>{this.disconnected()})}disconnected(){}onUserSubmit(e){this.print(z.User,e.text)}print(e,t){const i=new J(e,{name:""},[{items:[["html",{content:t}]]}]);return this.printEntry(i)}printEntry(e){return this.print$.next(e),e}createAgent(e){const t=new fc(e);return t.subscribe().subscribe(i=>{this.playNotification(),this.printEntry(i)}),t}createUser(e){const t=new gc(e);return t.subscribe().subscribe(i=>{this.printEntry(i)}),t}createSystem(){const e=new mc;return e.subscribe().subscribe(t=>{this.printEntry(t)}),e}setTypingState(e){this.typingState$.next(e)}setToastMessage(e){this.component.setToastMessage(e)}isTyping(){return this.typingState$.asObservable()}actions(){return this.print$.asObservable()}playNotification(){const e=!document.hidden&&this.component.application.storage.get("open"),t="https://publicpoc.blob.core.windows.net/widget-assets/notification.mp3";!this.component.application.storage.get("muteAudioNotifications")&&!e&&new Audio(t).play().catch(s=>{})}complete(){this.complete$.next()}save(e){this.saveToCurrentSession$.next(e)}async rehydrate(e){}}/**
4
4
  * @license
5
5
  * Copyright 2019 Google LLC
6
6
  * SPDX-License-Identifier: BSD-3-Clause
7
- */const gt=globalThis,Pn=gt.ShadowRoot&&(gt.ShadyCSS===void 0||gt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rn=Symbol(),Us=new WeakMap;let Fi=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Rn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Pn&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=Us.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Us.set(t,e))}return e}toString(){return this.cssText}};const Ko=s=>new Fi(typeof s=="string"?s:s+"",void 0,Rn),C=(s,...e)=>{const t=s.length===1?s[0]:e.reduce((n,i,r)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+s[r+1],s[0]);return new Fi(t,s,Rn)},Jo=(s,e)=>{if(Pn)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const n=document.createElement("style"),i=gt.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,s.appendChild(n)}},Ms=Pn?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return Ko(t)})(s):s;/**
7
+ */const mn=globalThis,is=mn.ShadowRoot&&(mn.ShadyCSS===void 0||mn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ss=Symbol(),Ar=new WeakMap;let Go=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==ss)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(is&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=Ar.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Ar.set(t,e))}return e}toString(){return this.cssText}};const bc=n=>new Go(typeof n=="string"?n:n+"",void 0,ss),T=(n,...e)=>{const t=n.length===1?n[0]:e.reduce((i,s,r)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+n[r+1],n[0]);return new Go(t,n,ss)},yc=(n,e)=>{if(is)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),s=mn.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,n.appendChild(i)}},Tr=is?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return bc(t)})(n):n;/**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
- */const{is:Yo,defineProperty:Xo,getOwnPropertyDescriptor:ea,getOwnPropertyNames:ta,getOwnPropertySymbols:na,getPrototypeOf:sa}=Object,le=globalThis,js=le.trustedTypes,ia=js?js.emptyScript:"",Xt=le.reactiveElementPolyfillSupport,qe=(s,e)=>s,$t={toAttribute(s,e){switch(e){case Boolean:s=s?ia:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},In=(s,e)=>!Yo(s,e),zs={attribute:!0,type:String,converter:$t,reflect:!1,useDefault:!1,hasChanged:In};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),le.litPropertyMetadata??(le.litPropertyMetadata=new WeakMap);let ke=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=zs){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(e,n,t);i!==void 0&&Xo(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){const{get:i,set:r}=ea(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:i,set(o){const a=i==null?void 0:i.call(this);r==null||r.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??zs}static _$Ei(){if(this.hasOwnProperty(qe("elementProperties")))return;const e=sa(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(qe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(qe("properties"))){const t=this.properties,n=[...ta(t),...na(t)];for(const i of n)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[n,i]of t)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const i=this._$Eu(t,n);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)t.unshift(Ms(i))}else e!==void 0&&t.push(Ms(e));return t}static _$Eu(e,t){const n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Jo(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostConnected)==null?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostDisconnected)==null?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){var r;const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){const o=(((r=n.converter)==null?void 0:r.toAttribute)!==void 0?n.converter:$t).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,t){var r,o;const n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const a=n.getPropertyOptions(i),l=typeof a.converter=="function"?{fromAttribute:a.converter}:((r=a.converter)==null?void 0:r.fromAttribute)!==void 0?a.converter:$t;this._$Em=i,this[i]=l.fromAttribute(t,a.type)??((o=this._$Ej)==null?void 0:o.get(i))??null,this._$Em=null}}requestUpdate(e,t,n){var i;if(e!==void 0){const r=this.constructor,o=this[e];if(n??(n=r.getPropertyOptions(e)),!((n.hasChanged??In)(o,t)||n.useDefault&&n.reflect&&o===((i=this._$Ej)==null?void 0:i.get(e))&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:i,wrapped:r},o){n&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,o]of i){const{wrapped:a}=o,l=this[r];a!==!0||this._$AL.has(r)||l===void 0||this.C(r,void 0,o,l)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(n=this._$EO)==null||n.forEach(i=>{var r;return(r=i.hostUpdate)==null?void 0:r.call(i)}),this.update(t)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(n=>{var i;return(i=n.hostUpdated)==null?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};ke.elementStyles=[],ke.shadowRootOptions={mode:"open"},ke[qe("elementProperties")]=new Map,ke[qe("finalized")]=new Map,Xt==null||Xt({ReactiveElement:ke}),(le.reactiveElementVersions??(le.reactiveElementVersions=[])).push("2.1.0");/**
11
+ */const{is:$c,defineProperty:wc,getOwnPropertyDescriptor:xc,getOwnPropertyNames:kc,getOwnPropertySymbols:Sc,getPrototypeOf:_c}=Object,Me=globalThis,Or=Me.trustedTypes,Cc=Or?Or.emptyScript:"",gi=Me.reactiveElementPolyfillSupport,Mt=(n,e)=>n,kn={toAttribute(n,e){switch(e){case Boolean:n=n?Cc:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},rs=(n,e)=>!$c(n,e),Lr={attribute:!0,type:String,converter:kn,reflect:!1,useDefault:!1,hasChanged:rs};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Me.litPropertyMetadata??(Me.litPropertyMetadata=new WeakMap);let at=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Lr){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&wc(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:r}=xc(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){const a=s==null?void 0:s.call(this);r==null||r.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Lr}static _$Ei(){if(this.hasOwnProperty(Mt("elementProperties")))return;const e=_c(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Mt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Mt("properties"))){const t=this.properties,i=[...kc(t),...Sc(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const s of i)t.unshift(Tr(s))}else e!==void 0&&t.push(Tr(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return yc(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){var r;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const o=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:kn).toAttribute(t,i.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){var r,o;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const a=i.getPropertyOptions(s),l=typeof a.converter=="function"?{fromAttribute:a.converter}:((r=a.converter)==null?void 0:r.fromAttribute)!==void 0?a.converter:kn;this._$Em=s,this[s]=l.fromAttribute(t,a.type)??((o=this._$Ej)==null?void 0:o.get(s))??null,this._$Em=null}}requestUpdate(e,t,i){var s;if(e!==void 0){const r=this.constructor,o=this[e];if(i??(i=r.getPropertyOptions(e)),!((i.hasChanged??rs)(o,t)||i.useDefault&&i.reflect&&o===((s=this._$Ej)==null?void 0:s.get(e))&&!this.hasAttribute(r._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[r,o]of s){const{wrapped:a}=o,l=this[r];a!==!0||this._$AL.has(r)||l===void 0||this.C(r,void 0,o,l)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(s=>{var r;return(r=s.hostUpdate)==null?void 0:r.call(s)}),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};at.elementStyles=[],at.shadowRootOptions={mode:"open"},at[Mt("elementProperties")]=new Map,at[Mt("finalized")]=new Map,gi==null||gi({ReactiveElement:at}),(Me.reactiveElementVersions??(Me.reactiveElementVersions=[])).push("2.1.0");/**
12
12
  * @license
13
13
  * Copyright 2017 Google LLC
14
14
  * SPDX-License-Identifier: BSD-3-Clause
15
- */const Fe=globalThis,xt=Fe.trustedTypes,Ds=xt?xt.createPolicy("lit-html",{createHTML:s=>s}):void 0,Vi="$lit$",re=`lit$${Math.random().toFixed(9).slice(2)}$`,Zi="?"+re,ra=`<${Zi}>`,ve=document,Qe=()=>ve.createComment(""),Ke=s=>s===null||typeof s!="object"&&typeof s!="function",Un=Array.isArray,oa=s=>Un(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",en=`[
16
- \f\r]`,Ne=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ns=/-->/g,Bs=/>/g,ue=RegExp(`>|${en}(?:([^\\s"'>=/]+)(${en}*=${en}*(?:[^
17
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Hs=/'/g,qs=/"/g,Wi=/^(?:script|style|textarea|title)$/i,aa=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),g=aa(1),X=Symbol.for("lit-noChange"),v=Symbol.for("lit-nothing"),Fs=new WeakMap,pe=ve.createTreeWalker(ve,129);function Gi(s,e){if(!Un(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ds!==void 0?Ds.createHTML(e):e}const la=(s,e)=>{const t=s.length-1,n=[];let i,r=e===2?"<svg>":e===3?"<math>":"",o=Ne;for(let a=0;a<t;a++){const l=s[a];let c,h,u=-1,d=0;for(;d<l.length&&(o.lastIndex=d,h=o.exec(l),h!==null);)d=o.lastIndex,o===Ne?h[1]==="!--"?o=Ns:h[1]!==void 0?o=Bs:h[2]!==void 0?(Wi.test(h[2])&&(i=RegExp("</"+h[2],"g")),o=ue):h[3]!==void 0&&(o=ue):o===ue?h[0]===">"?(o=i??Ne,u=-1):h[1]===void 0?u=-2:(u=o.lastIndex-h[2].length,c=h[1],o=h[3]===void 0?ue:h[3]==='"'?qs:Hs):o===qs||o===Hs?o=ue:o===Ns||o===Bs?o=Ne:(o=ue,i=void 0);const p=o===ue&&s[a+1].startsWith("/>")?" ":"";r+=o===Ne?l+ra:u>=0?(n.push(c),l.slice(0,u)+Vi+l.slice(u)+re+p):l+re+(u===-2?a:p)}return[Gi(s,r+(s[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};let fn=class Qi{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[c,h]=la(e,t);if(this.el=Qi.createElement(c,n),pe.currentNode=this.el.content,t===2||t===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(i=pe.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const u of i.getAttributeNames())if(u.endsWith(Vi)){const d=h[o++],p=i.getAttribute(u).split(re),m=/([.?@])?(.*)/.exec(d);l.push({type:1,index:r,name:m[2],strings:p,ctor:m[1]==="."?ha:m[1]==="?"?ua:m[1]==="@"?da:Ht}),i.removeAttribute(u)}else u.startsWith(re)&&(l.push({type:6,index:r}),i.removeAttribute(u));if(Wi.test(i.tagName)){const u=i.textContent.split(re),d=u.length-1;if(d>0){i.textContent=xt?xt.emptyScript:"";for(let p=0;p<d;p++)i.append(u[p],Qe()),pe.nextNode(),l.push({type:2,index:++r});i.append(u[d],Qe())}}}else if(i.nodeType===8)if(i.data===Zi)l.push({type:2,index:r});else{let u=-1;for(;(u=i.data.indexOf(re,u+1))!==-1;)l.push({type:7,index:r}),u+=re.length-1}r++}}static createElement(e,t){const n=ve.createElement("template");return n.innerHTML=e,n}};function Pe(s,e,t=s,n){var o,a;if(e===X)return e;let i=n!==void 0?(o=t._$Co)==null?void 0:o[n]:t._$Cl;const r=Ke(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==r&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),r===void 0?i=void 0:(i=new r(s),i._$AT(s,t,n)),n!==void 0?(t._$Co??(t._$Co=[]))[n]=i:t._$Cl=i),i!==void 0&&(e=Pe(s,i._$AS(s,e.values),i,n)),e}class ca{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,i=((e==null?void 0:e.creationScope)??ve).importNode(t,!0);pe.currentNode=i;let r=pe.nextNode(),o=0,a=0,l=n[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new rt(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new pa(r,this,e)),this._$AV.push(c),l=n[++a]}o!==(l==null?void 0:l.index)&&(r=pe.nextNode(),o++)}return pe.currentNode=ve,i}p(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class rt{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,n,i){this.type=2,this._$AH=v,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Pe(this,e,t),Ke(e)?e===v||e==null||e===""?(this._$AH!==v&&this._$AR(),this._$AH=v):e!==this._$AH&&e!==X&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):oa(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==v&&Ke(this._$AH)?this._$AA.nextSibling.data=e:this.T(ve.createTextNode(e)),this._$AH=e}$(e){var r;const{values:t,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=fn.createElement(Gi(n.h,n.h[0]),this.options)),n);if(((r=this._$AH)==null?void 0:r._$AD)===i)this._$AH.p(t);else{const o=new ca(i,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=Fs.get(e.strings);return t===void 0&&Fs.set(e.strings,t=new fn(e)),t}k(e){Un(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,i=0;for(const r of e)i===t.length?t.push(n=new rt(this.O(Qe()),this.O(Qe()),this,this.options)):n=t[i],n._$AI(r),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,t);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class Ht{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,i,r){this.type=1,this._$AH=v,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=v}_$AI(e,t=this,n,i){const r=this.strings;let o=!1;if(r===void 0)e=Pe(this,e,t,0),o=!Ke(e)||e!==this._$AH&&e!==X,o&&(this._$AH=e);else{const a=e;let l,c;for(e=r[0],l=0;l<r.length-1;l++)c=Pe(this,a[n+l],t,l),c===X&&(c=this._$AH[l]),o||(o=!Ke(c)||c!==this._$AH[l]),c===v?e=v:e!==v&&(e+=(c??"")+r[l+1]),this._$AH[l]=c}o&&!i&&this.j(e)}j(e){e===v?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let ha=class extends Ht{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===v?void 0:e}};class ua extends Ht{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==v)}}class da extends Ht{constructor(e,t,n,i,r){super(e,t,n,i,r),this.type=5}_$AI(e,t=this){if((e=Pe(this,e,t,0)??v)===X)return;const n=this._$AH,i=e===v&&n!==v||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==v&&(n===v||i);i&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class pa{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Pe(this,e)}}const tn=Fe.litHtmlPolyfillSupport;tn==null||tn(fn,rt),(Fe.litHtmlVersions??(Fe.litHtmlVersions=[])).push("3.3.0");const fa=(s,e,t)=>{const n=(t==null?void 0:t.renderBefore)??e;let i=n._$litPart$;if(i===void 0){const r=(t==null?void 0:t.renderBefore)??null;n._$litPart$=i=new rt(e.insertBefore(Qe(),r),r,void 0,t??{})}return i._$AI(s),i};/**
15
+ */const Dt=globalThis,Sn=Dt.trustedTypes,Rr=Sn?Sn.createPolicy("lit-html",{createHTML:n=>n}):void 0,Zo="$lit$",Re=`lit$${Math.random().toFixed(9).slice(2)}$`,Yo="?"+Re,Ec=`<${Yo}>`,Ze=document,jt=()=>Ze.createComment(""),Ht=n=>n===null||typeof n!="object"&&typeof n!="function",os=Array.isArray,Ac=n=>os(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",mi=`[
16
+ \f\r]`,Et=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ir=/-->/g,Pr=/>/g,Fe=RegExp(`>|${mi}(?:([^\\s"'>=/]+)(${mi}*=${mi}*(?:[^
17
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Mr=/'/g,Dr=/"/g,Qo=/^(?:script|style|textarea|title)$/i,Tc=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),y=Tc(1),Ce=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),Ur=new WeakMap,qe=Ze.createTreeWalker(Ze,129);function Xo(n,e){if(!os(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Rr!==void 0?Rr.createHTML(e):e}const Oc=(n,e)=>{const t=n.length-1,i=[];let s,r=e===2?"<svg>":e===3?"<math>":"",o=Et;for(let a=0;a<t;a++){const l=n[a];let c,u,p=-1,d=0;for(;d<l.length&&(o.lastIndex=d,u=o.exec(l),u!==null);)d=o.lastIndex,o===Et?u[1]==="!--"?o=Ir:u[1]!==void 0?o=Pr:u[2]!==void 0?(Qo.test(u[2])&&(s=RegExp("</"+u[2],"g")),o=Fe):u[3]!==void 0&&(o=Fe):o===Fe?u[0]===">"?(o=s??Et,p=-1):u[1]===void 0?p=-2:(p=o.lastIndex-u[2].length,c=u[1],o=u[3]===void 0?Fe:u[3]==='"'?Dr:Mr):o===Dr||o===Mr?o=Fe:o===Ir||o===Pr?o=Et:(o=Fe,s=void 0);const g=o===Fe&&n[a+1].startsWith("/>")?" ":"";r+=o===Et?l+Ec:p>=0?(i.push(c),l.slice(0,p)+Zo+l.slice(p)+Re+g):l+Re+(p===-2?a:g)}return[Xo(n,r+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};let Mi=class Ko{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[c,u]=Oc(e,t);if(this.el=Ko.createElement(c,i),qe.currentNode=this.el.content,t===2||t===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(s=qe.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(const p of s.getAttributeNames())if(p.endsWith(Zo)){const d=u[o++],g=s.getAttribute(p).split(Re),m=/([.?@])?(.*)/.exec(d);l.push({type:1,index:r,name:m[2],strings:g,ctor:m[1]==="."?Rc:m[1]==="?"?Ic:m[1]==="@"?Pc:Vn}),s.removeAttribute(p)}else p.startsWith(Re)&&(l.push({type:6,index:r}),s.removeAttribute(p));if(Qo.test(s.tagName)){const p=s.textContent.split(Re),d=p.length-1;if(d>0){s.textContent=Sn?Sn.emptyScript:"";for(let g=0;g<d;g++)s.append(p[g],jt()),qe.nextNode(),l.push({type:2,index:++r});s.append(p[d],jt())}}}else if(s.nodeType===8)if(s.data===Yo)l.push({type:2,index:r});else{let p=-1;for(;(p=s.data.indexOf(Re,p+1))!==-1;)l.push({type:7,index:r}),p+=Re.length-1}r++}}static createElement(e,t){const i=Ze.createElement("template");return i.innerHTML=e,i}};function mt(n,e,t=n,i){var o,a;if(e===Ce)return e;let s=i!==void 0?(o=t._$Co)==null?void 0:o[i]:t._$Cl;const r=Ht(e)?void 0:e._$litDirective$;return(s==null?void 0:s.constructor)!==r&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),r===void 0?s=void 0:(s=new r(n),s._$AT(n,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=s:t._$Cl=s),s!==void 0&&(e=mt(n,s._$AS(n,e.values),s,i)),e}class Lc{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,s=((e==null?void 0:e.creationScope)??Ze).importNode(t,!0);qe.currentNode=s;let r=qe.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Qt(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new Mc(r,this,e)),this._$AV.push(c),l=i[++a]}o!==(l==null?void 0:l.index)&&(r=qe.nextNode(),o++)}return qe.currentNode=Ze,s}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class Qt{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=mt(this,e,t),Ht(e)?e===w||e==null||e===""?(this._$AH!==w&&this._$AR(),this._$AH=w):e!==this._$AH&&e!==Ce&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ac(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==w&&Ht(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ze.createTextNode(e)),this._$AH=e}$(e){var r;const{values:t,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Mi.createElement(Xo(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===s)this._$AH.p(t);else{const o=new Lc(s,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=Ur.get(e.strings);return t===void 0&&Ur.set(e.strings,t=new Mi(e)),t}k(e){os(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const r of e)s===t.length?t.push(i=new Qt(this.O(jt()),this.O(jt()),this,this.options)):i=t[s],i._$AI(r),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e&&e!==this._$AB;){const s=e.nextSibling;e.remove(),e=s}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class Vn{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,r){this.type=1,this._$AH=w,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=w}_$AI(e,t=this,i,s){const r=this.strings;let o=!1;if(r===void 0)e=mt(this,e,t,0),o=!Ht(e)||e!==this._$AH&&e!==Ce,o&&(this._$AH=e);else{const a=e;let l,c;for(e=r[0],l=0;l<r.length-1;l++)c=mt(this,a[i+l],t,l),c===Ce&&(c=this._$AH[l]),o||(o=!Ht(c)||c!==this._$AH[l]),c===w?e=w:e!==w&&(e+=(c??"")+r[l+1]),this._$AH[l]=c}o&&!s&&this.j(e)}j(e){e===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let Rc=class extends Vn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===w?void 0:e}};class Ic extends Vn{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==w)}}class Pc extends Vn{constructor(e,t,i,s,r){super(e,t,i,s,r),this.type=5}_$AI(e,t=this){if((e=mt(this,e,t,0)??w)===Ce)return;const i=this._$AH,s=e===w&&i!==w||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==w&&(i===w||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class Mc{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){mt(this,e)}}const vi=Dt.litHtmlPolyfillSupport;vi==null||vi(Mi,Qt),(Dt.litHtmlVersions??(Dt.litHtmlVersions=[])).push("3.3.0");const Dc=(n,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let s=i._$litPart$;if(s===void 0){const r=(t==null?void 0:t.renderBefore)??null;i._$litPart$=s=new Qt(e.insertBefore(jt(),r),r,void 0,t??{})}return s._$AI(n),s};/**
18
18
  * @license
19
19
  * Copyright 2017 Google LLC
20
20
  * SPDX-License-Identifier: BSD-3-Clause
21
- */const ge=globalThis;let w=class extends ke{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=fa(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return X}};var wi;w._$litElement$=!0,w.finalized=!0,(wi=ge.litElementHydrateSupport)==null||wi.call(ge,{LitElement:w});const nn=ge.litElementPolyfillSupport;nn==null||nn({LitElement:w});(ge.litElementVersions??(ge.litElementVersions=[])).push("4.2.0");const ga={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 60C47.464 60 60 47.464 60 32C60 16.536 47.464 4 32 4C16.536 4 4 16.536 4 32C4.01731 47.4568 16.5432 59.9827 32 60ZM32 8.30769C45.0849 8.30769 55.6923 18.9151 55.6923 32C55.6923 45.0849 45.0849 55.6923 32 55.6923C18.9151 55.6923 8.30769 45.0849 8.30769 32C8.32247 18.9212 18.9212 8.32247 32 8.30769Z"/><path d="M29.3491 38.6031V20.6807C29.348 19.8662 29.4903 19.0598 29.7675 18.3096C29.9945 17.6371 30.3484 17.0302 30.804 16.5322C31.1251 16.1524 31.5593 15.9246 32.0204 15.894C32.6852 15.894 33.3496 16.471 34.0134 17.625C34.3738 18.1337 34.5955 18.7525 34.6509 19.4042V37.3267C34.6509 37.9947 34.2454 38.6329 33.4345 39.2414C32.6632 39.835 31.7547 40.1521 30.825 40.1523C29.8423 40.1524 29.3503 39.636 29.3491 38.6031Z"/><path d="M33.66 44.6959C33.9649 45.0866 34.161 45.551 34.2284 46.0419C34.2284 46.5397 33.8893 47.0083 33.2109 47.4476C32.5638 47.8771 31.8043 48.1062 31.0275 48.1061C30.1902 48.1061 29.7716 47.7271 29.7716 46.9693C29.7703 46.3788 29.8874 45.7941 30.116 45.2496C30.3064 44.7579 30.6022 44.3138 30.9826 43.9487C31.2626 43.6591 31.6427 43.4875 32.045 43.4692C32.5635 43.4692 33.1019 43.8781 33.66 44.6959Z"/></svg>'},Ki={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M52 7H24C19.5838 7.00505 16.0051 10.5838 16 15V23H12C7.58382 23.0051 4.00505 26.5838 4 31V43C4.00505 47.4162 7.58382 50.9949 12 51H19.1699L24.8789 56.7075C25.737 57.5654 27.0273 57.8219 28.1482 57.3575C29.2692 56.8931 30 55.7993 30 54.5859V51H39.999C44.4152 50.995 47.994 47.4162 47.999 43V35H52C56.4162 34.9949 59.9949 31.4162 60 27V15C59.9949 10.5838 56.4162 7.00505 52 7ZM43.999 43C43.9967 45.2082 42.2072 46.9977 39.999 47H26V52.1724L20.8262 47H12C9.79184 46.9976 8.00235 45.2082 8 43V31C8.00235 28.7918 9.79184 27.0024 12 27H16C16.0051 31.4162 19.5838 34.9949 24 35H30V38.5859C29.999 39.7998 30.7298 40.8945 31.8512 41.359C32.9726 41.8236 34.2634 41.5664 35.1211 40.7075L40.8291 35H43.999V43ZM56 27C55.9977 29.2082 54.2082 30.9976 52 31H39.1729L34 36.1719V31H24C21.7918 30.9976 20.0024 29.2082 20 27V15C20.0024 12.7918 21.7918 11.0024 24 11H52C54.2082 11.0024 55.9977 12.7918 56 15V27Z"/></svg>'},ma={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 4C16.536 4 4 16.536 4 32C4 47.464 16.536 60 32 60C47.464 60 60 47.464 60 32C59.9829 16.5431 47.4569 4.01712 32 4ZM44.5613 24.5793L31.6382 43.9639C31.2806 44.5011 30.7008 44.8493 30.0586 44.9126C29.988 44.9197 29.9171 44.9232 29.8462 44.9231C29.275 44.9229 28.7272 44.696 28.3233 44.2921L19.7079 35.6767C19.1639 35.1326 18.9514 34.3396 19.1505 33.5964C19.3497 32.8533 19.9302 32.2728 20.6734 32.0736C21.4166 31.8745 22.2095 32.087 22.7536 32.631L29.5117 39.3881L40.9772 22.1899C41.4016 21.5439 42.1396 21.1749 42.9111 21.2229C43.6825 21.2709 44.3691 21.7286 44.7101 22.4223C45.0511 23.1159 44.9944 23.9391 44.5613 24.5793Z"/></svg>'},va={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M31.9998 4C16.5358 4 3.99976 16.536 3.99976 32C3.99976 47.464 16.5358 60 31.9998 60C47.4637 60 59.9998 47.464 59.9998 32C59.9826 16.5431 47.4566 4.01712 31.9998 4ZM31.9998 55.6923C18.9149 55.6923 8.30745 45.0849 8.30745 32C8.30745 18.9151 18.9149 8.30769 31.9998 8.30769C45.0847 8.30769 55.6921 18.9151 55.6921 32C55.6773 45.0788 45.0785 55.6775 31.9998 55.6923ZM44.5611 24.5793L31.638 43.9639C31.2804 44.5011 30.7005 44.8493 30.0584 44.9126C29.9878 44.9197 29.9169 44.9232 29.8459 44.9231C29.2747 44.9229 28.727 44.696 28.3231 44.2921L19.7077 35.6767C19.1636 35.1326 18.9512 34.3396 19.1503 33.5964C19.3494 32.8533 19.9299 32.2728 20.6731 32.0736C21.4163 31.8745 22.2093 32.087 22.7534 32.631L29.5115 39.3881L40.9769 22.1899C41.4013 21.5439 42.1394 21.1749 42.9108 21.2229C43.6823 21.2709 44.3688 21.7286 44.7099 22.4223C45.0509 23.1159 44.9941 23.9391 44.5611 24.5793Z"/></svg>'},ba={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M57.5438 13.4967L28.717 50.5596C27.9537 51.5407 26.8061 52.147 25.5654 52.2248C25.4755 52.2301 25.3856 52.2332 25.2967 52.2332C24.1476 52.233 23.0455 51.7763 22.233 50.9637L6.63458 35.3654C6.08729 34.8181 5.87354 34.0204 6.07387 33.2728C6.27419 32.5252 6.85815 31.9412 7.60577 31.7409C8.35339 31.5406 9.15109 31.7543 9.69838 32.3016L25.2967 47.8999L54.1225 10.837C54.5976 10.2258 55.3626 9.91453 56.1295 10.0204C56.8963 10.1263 57.5484 10.6332 57.8402 11.3502C58.1319 12.0673 58.0189 12.8855 57.5438 13.4967Z"/></svg>'},Ji={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M53.0318 24.8653L33.5318 44.3653C33.1256 44.7717 32.5745 45.0001 31.9999 45.0001C31.4253 45.0001 30.8742 44.7717 30.468 44.3653L10.968 24.8653C10.122 24.0193 10.122 22.6476 10.968 21.8015C11.8141 20.9555 13.1858 20.9555 14.0318 21.8015L31.9999 39.7696L49.968 21.8015C50.8141 20.9555 52.1858 20.9555 53.0318 21.8015C53.8779 22.6476 53.8779 24.0193 53.0318 24.8653Z"/></svg>'},ya={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 56C45.2548 56 56 45.2548 56 32C56 18.7452 45.2548 8 32 8C18.7452 8 8 18.7452 8 32C8 45.2548 18.7452 56 32 56ZM32 60C47.464 60 60 47.464 60 32C60 16.536 47.464 4 32 4C16.536 4 4 16.536 4 32C4 47.464 16.536 60 32 60Z"/><path d="M25.2772 22.695C24.5164 21.8942 23.2505 21.8617 22.4497 22.6225C21.6488 23.3833 21.6164 24.6492 22.3772 25.45L29.2411 32.6752L22.4773 39.795C21.7166 40.5958 21.749 41.8617 22.5498 42.6225C23.3507 43.3833 24.6166 43.3508 25.3773 42.55L31.9998 35.5791L38.6222 42.55C39.3829 43.3508 40.6488 43.3833 41.4497 42.6225C42.2505 41.8617 42.2829 40.5958 41.5222 39.795L34.7584 32.6752L41.6223 25.45C42.3831 24.6492 42.3507 23.3833 41.5498 22.6225C40.749 21.8617 39.4831 21.8942 38.7224 22.695L31.9998 29.7714L25.2772 22.695Z"/></svg>'},Mn={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M51.365 48.3012C51.9123 48.8485 52.1261 49.6462 51.9258 50.3939C51.7254 51.1415 51.1415 51.7254 50.3939 51.9258C49.6462 52.1261 48.8485 51.9123 48.3012 51.365L32.4998 35.5636L16.6984 51.365C16.1511 51.9123 15.3534 52.1261 14.6058 51.9258C13.8581 51.7254 13.2742 51.1415 13.0739 50.3939C12.8735 49.6462 13.0873 48.8485 13.6346 48.3012L29.436 32.4998L13.6346 16.6984C13.0873 16.1511 12.8735 15.3534 13.0739 14.6058C13.2742 13.8581 13.8581 13.2742 14.6058 13.0739C15.3534 12.8735 16.1511 13.0873 16.6984 13.6346L32.4998 29.436L48.3012 13.6346C49.1473 12.7885 50.519 12.7885 51.365 13.6346C52.2111 14.4806 52.2111 15.8523 51.365 16.6984L35.5636 32.4998L51.365 48.3012Z"/></svg>'},$a={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M58.2618 43.8838L38.8585 11.5469C37.4136 9.13651 34.8097 7.66134 31.9994 7.66113C29.1891 7.66093 26.585 9.13572 25.1397 11.5459L5.73642 43.8838C4.25367 46.3552 4.21482 49.4331 5.6347 51.9411C7.05459 54.4492 9.71372 55.9997 12.5958 56H51.4024C54.2845 55.9997 56.9436 54.4492 58.3635 51.9411C59.7834 49.4331 59.7446 46.3552 58.2618 43.8838ZM29.9991 36.9772V25.1569C29.9983 24.6198 30.1056 24.0879 30.3148 23.5932C30.486 23.1496 30.753 22.7494 31.0968 22.4209C31.339 22.1704 31.6666 22.0202 32.0145 22C32.5161 22 33.0173 22.3805 33.5182 23.1416C33.7901 23.4771 33.9573 23.8852 33.9991 24.3151V36.1354C33.9991 36.5759 33.6932 36.9969 33.0814 37.3982C32.4994 37.7897 31.814 37.9988 31.1126 37.999C30.3712 37.999 30 37.6584 29.9991 36.9772ZM34.2408 43.9236C34.173 43.4297 33.9757 42.9626 33.669 42.5696C33.1076 41.7469 32.566 41.3355 32.0444 41.3355C31.6396 41.354 31.2573 41.5266 30.9757 41.8179C30.593 42.1852 30.2954 42.6319 30.1039 43.1266C29.874 43.6743 29.7562 44.2625 29.7574 44.8565C29.7574 45.6189 30.1786 46 31.0208 46C31.8022 46.0001 32.5662 45.7697 33.2173 45.3377C33.8996 44.8957 34.2408 44.4243 34.2408 43.9236Z"/></svg>'},Yi={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M59.9139 23.8477V7.90923C59.902 5.75094 58.1522 4.00588 55.9939 4H40.0554C38.8659 4 37.9016 4.96431 37.9016 6.15385C37.9016 7.34338 38.8659 8.30769 40.0554 8.30769H52.4616L29.8462 30.9231C29.4417 31.3271 29.2145 31.8753 29.2145 32.4469C29.2145 33.0186 29.4417 33.5668 29.8462 33.9708C30.2394 34.3609 30.7677 34.5846 31.3216 34.5954C31.8941 34.5987 32.4443 34.3739 32.8508 33.9708L55.6062 11.2046V23.8477C55.6062 25.0372 56.5705 26.0015 57.76 26.0015C58.9495 26.0015 59.9139 25.0372 59.9139 23.8477Z"/><path d="M12.217 60H47.4001C51.9189 59.9942 55.5874 56.3449 55.617 51.8262V38.4615C55.617 37.272 54.6527 36.3077 53.4631 36.3077C52.2736 36.3077 51.3093 37.272 51.3093 38.4615V51.7831C51.3034 53.9396 49.5566 55.6864 47.4001 55.6923H12.217C10.0771 55.6866 8.33714 53.9659 8.30776 51.8262V16.5569C8.29914 15.5145 8.7072 14.5119 9.44126 13.7718C10.1753 13.0316 11.1746 12.6153 12.217 12.6154H25.5385C26.7281 12.6154 27.6924 11.6511 27.6924 10.4615C27.6924 9.272 26.7281 8.30769 25.5385 8.30769H12.217C10.0321 8.30767 7.9372 9.17782 6.39529 10.7258C4.85339 12.2738 3.99147 14.3721 4.00006 16.5569V51.8262C4.02963 56.3449 7.6981 59.9942 12.217 60Z"/></svg>'},Vs={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M51.4283 11.6761L53.1768 9.53891C53.9347 8.61282 53.7982 7.24774 52.8722 6.48993C51.9461 5.73211 50.581 5.86852 49.8232 6.79461L36.3333 23.2822V13.3972C36.3332 11.6447 35.2774 10.0648 33.6583 9.39418C32.0391 8.72356 30.1755 9.09425 28.9362 10.3334L18.1029 21.1668H14.6667C9.88247 21.1722 6.00547 25.0492 6 29.8334V34.1668C6.00547 38.951 9.88247 42.828 14.6667 42.8334H18.1029L19.3315 44.0621L10.8232 54.4613C10.0653 55.3874 10.2018 56.7525 11.1279 57.5103C12.0539 58.2681 13.419 58.1317 14.1768 57.2056L22.411 47.1416L28.9362 53.6668C30.1755 54.9059 32.0391 55.2766 33.6583 54.606C35.2774 53.9354 36.3332 52.3555 36.3333 50.603V30.1254L42.6092 22.4549C44.2201 25.3756 45.044 28.6649 45 32.0001C45.1184 36.1899 43.7698 40.2896 41.1872 43.5909C40.409 44.5001 40.5152 45.8679 41.4243 46.6461C42.3334 47.4243 43.7012 47.3183 44.4795 46.4093C47.7313 42.3208 49.4486 37.2227 49.3333 32.0001C49.403 27.3538 48.067 22.7949 45.5005 18.9211L48.6119 15.1182C52.019 20.0793 53.7867 25.9829 53.6667 32.0001C53.6667 39.0587 51.4873 45.6518 47.6872 50.0909C46.909 51.0001 47.0152 52.3679 47.9243 53.1461C48.8334 53.9243 50.2012 53.8183 50.9795 52.9093C55.4408 47.6968 58 40.0764 58 32.0001C58 24.21 55.6006 16.8662 51.4283 11.6761ZM19.8971 38.5H14.6667C12.2744 38.4977 10.3357 36.559 10.3333 34.1667V29.8334C10.3357 27.4411 12.2744 25.5024 14.6667 25.5H19.8971L32 13.3972V28.5784L22.089 40.6919L19.8971 38.5ZM31.9997 50.603L25.1682 43.7715L31.9997 35.4218V50.603Z"/></svg>'},xa={name:"question",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 4C16.536 4 4 16.536 4 32C4 47.464 16.536 60 32 60C47.464 60 60 47.464 60 32C59.9827 16.5432 47.4568 4.01731 32 4ZM32 55.6923C18.9151 55.6923 8.30769 45.0849 8.30769 32C8.30769 18.9151 18.9151 8.30769 32 8.30769C45.0849 8.30769 55.6923 18.9151 55.6923 32C55.6775 45.0788 45.0788 55.6775 32 55.6923Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M31.9423 37.5723L36.311 32.9068L36.7354 32.4448C39.7555 29.1161 40.7645 27.0647 40.7645 24.5087C40.7645 23.1091 40.4251 21.7942 39.7041 20.6491C38.3044 18.3587 35.6323 16.9166 32.2816 16.9166C28.7565 16.9166 25.3125 18.7414 23.2581 21.6772L23.1201 21.8791C22.8232 22.3032 22.696 22.6849 22.696 22.9818C22.696 23.7029 23.926 25.9932 25.2833 25.9932C25.5378 25.9932 25.7922 25.9084 26.0467 25.7388C26.2588 25.5691 26.5981 25.2298 27.0647 24.7208C28.8885 22.6849 30.1185 21.9215 31.7726 21.9215C33.6813 21.9215 35.081 23.1939 35.081 24.8905C35.081 26.375 34.2751 27.7746 32.3664 29.8529L28.2523 34.2216C27.9554 34.6033 27.7857 34.9426 27.7857 35.282C27.7857 35.6213 27.9978 36.1726 28.4219 36.8937C29.0581 37.8692 29.7368 38.3782 30.4578 38.3782C30.9244 38.3782 31.3909 38.1237 31.9423 37.5723ZM30.882 47.4972C29.2278 47.4972 27.6585 44.7403 27.6585 43.6799C27.6585 42.1954 30.0761 40.6261 32.4089 40.6261C33.6389 40.6261 34.2751 41.1775 34.2751 42.3227C34.2751 44.0616 33.4692 45.843 32.4513 46.7761C31.9423 47.2427 31.4334 47.4972 30.882 47.4972Z"/></svg>'},Xi={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.41642 6.29292C5.99705 5.18016 3.38612 7.41823 4.12858 9.96847L10.5427 32L4.12858 54.0315C3.38612 56.5818 5.99704 58.8198 8.41642 57.7071L58.1942 34.8125C60.6019 33.7051 60.6019 30.2949 58.1942 29.1875L8.41642 6.29292ZM14.2569 29.9351L8.74174 10.9913L49.9295 29.9351H14.2569ZM14.2568 34.0651L8.74174 53.0087L49.9291 34.0651H14.2568Z"/></svg>'},Zs={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M33.6578 9.3322C32.0391 8.65799 30.1735 9.02919 28.9362 10.2717L18.1029 21.105H14.6667C9.88247 21.1105 6.00547 24.9875 6 29.7717V34.105C6.00547 38.8892 9.88247 42.7662 14.6667 42.7717H18.1029L28.9362 53.605C30.1755 54.8442 32.0391 55.2149 33.6583 54.5442C35.2774 53.8736 36.3332 52.2937 36.3333 50.5412V13.3355C36.3365 11.5817 35.2794 10.0001 33.6578 9.3322ZM32 50.5411L19.8971 38.4382H14.6667C12.2744 38.4358 10.3357 36.4971 10.3333 34.1049V29.7716C10.3357 27.3793 12.2744 25.4406 14.6667 25.4382H19.8971L32 13.3353V50.5411ZM49.3334 31.9383C49.4487 37.161 47.7314 42.2591 44.4796 46.3475C43.7013 47.2565 42.3335 47.3625 41.4244 46.5843C40.5153 45.8061 40.4092 44.4383 41.1873 43.5291C43.7699 40.2278 45.1185 36.1282 45.0001 31.9383C45.1185 27.7485 43.7699 23.6488 41.1873 20.3475C40.4092 19.4383 40.5153 18.0705 41.4244 17.2923C42.3335 16.5141 43.7013 16.6201 44.4796 17.5291C47.7314 21.6176 49.4487 26.7157 49.3334 31.9383ZM58.0001 31.9383C58.0001 40.0147 55.441 47.635 50.9796 52.8475C50.2013 53.7565 48.8335 53.8625 47.9244 53.0843C47.0153 52.3061 46.9092 50.9383 47.6873 50.0291C51.4874 45.59 53.6668 38.9969 53.6668 31.9383C53.6668 24.8797 51.4874 18.2866 47.6873 13.8475C46.9092 12.9383 47.0153 11.5705 47.9244 10.7923C48.8335 10.0141 50.2013 10.1201 50.9796 11.0291C55.441 16.2416 58.0001 23.862 58.0001 31.9383Z"/></svg>'},Ce={allRenderFn:!1,cmpDidLoad:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpDidRender:!0,cmpWillLoad:!0,cmpWillUpdate:!0,cmpWillRender:!0,connectedCallback:!0,disconnectedCallback:!0,element:!0,event:!0,hasRenderFn:!0,lifecycle:!0,hostListener:!0,hostListenerTargetWindow:!0,hostListenerTargetDocument:!0,hostListenerTargetBody:!0,hostListenerTargetParent:!1,hostListenerTarget:!0,member:!0,method:!0,mode:!0,observeAttribute:!0,prop:!0,propMutable:!0,reflect:!0,scoped:!0,shadowDom:!0,slot:!0,cssAnnotations:!0,state:!0,style:!0,svg:!0,updatable:!0,vdomAttribute:!0,vdomXlink:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomRef:!0,vdomPropOrAttr:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,watchCallback:!0,taskQueue:!0,hotModuleReplacement:!1,isDebug:!1,isDev:!1,isTesting:!1,hydrateServerSide:!1,hydrateClientSide:!1,lifecycleDOMEvents:!1,lazyLoad:!1,profile:!1,slotRelocation:!0,appendChildSlotFix:!1,cloneNodeFix:!1,hydratedAttribute:!1,hydratedClass:!0,safari10:!1,scriptDataOpts:!1,scopedSlotTextContentFix:!1,shadowDomShim:!1,slotChildNodesFix:!1,invisiblePrehydration:!0,propBoolean:!0,propNumber:!0,propString:!0,cssVarShim:!1,constructableCSS:!0,cmpShouldUpdate:!0,devTools:!1,dynamicImportShim:!1,shadowDelegatesFocus:!0,initializeNextTick:!1,asyncLoading:!1,asyncQueue:!1,transformTagName:!1,attachStyles:!0};let Se,er,qt,tr=!1,wt=!1,jn=!1,M=!1,Ws=null,gn=!1;const Ft=typeof window<"u"?window:{},G=Ft.document||{head:{}},nr=Ft.HTMLElement||class{},R={$flags$:0,$resourcesUrl$:"",jmp:s=>s(),raf:s=>requestAnimationFrame(s),ael:(s,e,t,n)=>s.addEventListener(e,t,n),rel:(s,e,t,n)=>s.removeEventListener(e,t,n),ce:(s,e)=>new CustomEvent(s,e)},wa=(()=>{let s=!1;try{G.addEventListener("e",null,Object.defineProperty({},"passive",{get(){s=!0}}))}catch{}return s})(),ka=s=>Promise.resolve(s),Ca=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replace=="function"}catch{}return!1})(),sr=(s,e,t,n)=>{t&&t.map(([i,r,o])=>{const a=_a(s,i),l=Sa(e,o),c=Ea(i);R.ael(a,r,l,c),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>R.rel(a,r,l,c))})},Sa=(s,e)=>t=>{try{Ce.lazyLoad||s.$hostElement$[e](t)}catch(n){ot(n)}},_a=(s,e)=>e&4?G:e&8?Ft:e&16?G.body:s,Ea=s=>wa?{passive:(s&1)!==0,capture:(s&2)!==0}:(s&2)!==0,Gs="http://www.w3.org/1999/xlink",be=(s,e="")=>()=>{},Qs=new WeakMap,Aa=(s,e,t)=>{let n=St.get(s);Ca&&t?(n=n||new CSSStyleSheet,n.replace(e)):n=e,St.set(s,n)},Ta=(s,e,t,n)=>{let i=ir(e,t),r=St.get(i);if(s=s.nodeType===11?s:G,r)if(typeof r=="string"){s=s.head||s;let o=Qs.get(s),a;o||Qs.set(s,o=new Set),o.has(i)||(a=G.createElement("style"),a.innerHTML=r,s.insertBefore(a,s.querySelector("link")),o&&o.add(i))}else s.adoptedStyleSheets.includes(r)||(s.adoptedStyleSheets=[...s.adoptedStyleSheets,r]);return i},Oa=s=>{const e=s.$cmpMeta$,t=s.$hostElement$,n=e.$flags$,i=be("attachStyles",e.$tagName$),r=Ta(t.shadowRoot?t.shadowRoot:t.getRootNode(),e,s.$modeName$);n&10&&(t["s-sc"]=r,t.classList.add(r+"-h"),n&2&&t.classList.add(r+"-s")),i()},ir=(s,e)=>"sc-"+(e&&s.$flags$&32?s.$tagName$+"-"+e:s.$tagName$),La=s=>rl.map(e=>e(s)).find(e=>!!e),Ks={},Pa="http://www.w3.org/2000/svg",Ra="http://www.w3.org/1999/xhtml",Ia=s=>s!=null,zn=s=>(s=typeof s,s==="object"||s==="function"),Ae=(s,e,...t)=>{let n=null,i=null,r=null,o=!1,a=!1,l=[];const c=u=>{for(let d=0;d<u.length;d++)n=u[d],Array.isArray(n)?c(n):n!=null&&typeof n!="boolean"&&((o=typeof s!="function"&&!zn(n))&&(n=String(n)),o&&a?l[l.length-1].$text$+=n:l.push(o?kt(null,n):n),a=o)};if(c(t),e){e.key&&(i=e.key),e.name&&(r=e.name);{const u=e.className||e.class;u&&(e.class=typeof u!="object"?u:Object.keys(u).filter(d=>u[d]).join(" "))}}if(typeof s=="function")return s(e===null?{}:e,l,Ma);const h=kt(s,null);return h.$attrs$=e,l.length>0&&(h.$children$=l),h.$key$=i,h.$name$=r,h},kt=(s,e)=>{const t={$flags$:0,$tag$:s,$text$:e,$elm$:null,$children$:null};return t.$attrs$=null,t.$key$=null,t.$name$=null,t},Dn={},Ua=s=>s&&s.$tag$===Dn,Ma={forEach:(s,e)=>s.map(Js).forEach(e),map:(s,e)=>s.map(Js).map(e).map(ja)},Js=s=>({vattrs:s.$attrs$,vchildren:s.$children$,vkey:s.$key$,vname:s.$name$,vtag:s.$tag$,vtext:s.$text$}),ja=s=>{if(typeof s.vtag=="function"){const t=Object.assign({},s.vattrs);return s.vkey&&(t.key=s.vkey),s.vname&&(t.name=s.vname),Ae(s.vtag,t,...s.vchildren||[])}const e=kt(s.vtag,s.vtext);return e.$attrs$=s.vattrs,e.$children$=s.vchildren,e.$key$=s.vkey,e.$name$=s.vname,e},Ys=(s,e,t,n,i,r)=>{if(t!==n){let o=ni(s,e),a=e.toLowerCase();if(e==="class"){const l=s.classList,c=Xs(t),h=Xs(n);l.remove(...c.filter(u=>u&&!h.includes(u))),l.add(...h.filter(u=>u&&!c.includes(u)))}else if(e==="style"){for(const l in t)(!n||n[l]==null)&&(l.includes("-")?s.style.removeProperty(l):s.style[l]="");for(const l in n)(!t||n[l]!==t[l])&&(l.includes("-")?s.style.setProperty(l,n[l]):s.style[l]=n[l])}else if(e!=="key")if(e==="ref")n&&n(s);else if(!s.__lookupSetter__(e)&&e[0]==="o"&&e[1]==="n")e[2]==="-"?e=e.slice(3):ni(Ft,a)?e=a.slice(2):e=a[2]+e.slice(3),t&&R.rel(s,e,t,!1),n&&R.ael(s,e,n,!1);else{const l=zn(n);if((o||l&&n!==null)&&!i)try{if(s.tagName.includes("-"))s[e]=n;else{let h=n??"";e==="list"?o=!1:(t==null||s[e]!=h)&&(s[e]=h)}}catch{}let c=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(e=a,c=!0),n==null||n===!1?(n!==!1||s.getAttribute(e)==="")&&(c?s.removeAttributeNS(Gs,e):s.removeAttribute(e)):(!o||r&4||i)&&!l&&(n=n===!0?"":n,c?s.setAttributeNS(Gs,e,n):s.setAttribute(e,n))}}},za=/\s/,Xs=s=>s?s.split(za):[],rr=(s,e,t,n)=>{const i=e.$elm$.nodeType===11&&e.$elm$.host?e.$elm$.host:e.$elm$,r=s&&s.$attrs$||Ks,o=e.$attrs$||Ks;for(n in r)n in o||Ys(i,n,r[n],void 0,t,e.$flags$);for(n in o)Ys(i,n,r[n],o[n],t,e.$flags$)},Ct=(s,e,t,n)=>{let i=e.$children$[t],r=0,o,a,l;if(tr||(jn=!0,i.$tag$==="slot"&&(Se&&n.classList.add(Se+"-s"),i.$flags$|=i.$children$?2:1)),i.$text$!==null)o=i.$elm$=G.createTextNode(i.$text$);else if(i.$flags$&1)o=i.$elm$=G.createTextNode("");else{if(M||(M=i.$tag$==="svg"),o=i.$elm$=G.createElementNS(M?Pa:Ra,i.$flags$&2?"slot-fb":i.$tag$),M&&i.$tag$==="foreignObject"&&(M=!1),rr(null,i,M),Ia(Se)&&o["s-si"]!==Se&&o.classList.add(o["s-si"]=Se),i.$children$)for(r=0;r<i.$children$.length;++r)a=Ct(s,i,r,o),a&&o.appendChild(a);i.$tag$==="svg"?M=!1:o.tagName==="foreignObject"&&(M=!0)}return o["s-hn"]=qt,i.$flags$&3&&(o["s-sr"]=!0,o["s-cr"]=er,o["s-sn"]=i.$name$||"",l=s&&s.$children$&&s.$children$[t],l&&l.$tag$===i.$tag$&&s.$elm$&&Je(s.$elm$,!1)),o},Je=(s,e)=>{R.$flags$|=1;const t=s.childNodes;for(let n=t.length-1;n>=0;n--){const i=t[n];i["s-hn"]!==qt&&i["s-ol"]&&(lr(i).insertBefore(i,Nn(i)),i["s-ol"].remove(),i["s-ol"]=void 0,jn=!0),e&&Je(i,e)}R.$flags$&=-2},or=(s,e,t,n,i,r)=>{let o=s["s-cr"]&&s["s-cr"].parentNode||s,a;for(o.shadowRoot&&o.tagName===qt&&(o=o.shadowRoot);i<=r;++i)n[i]&&(a=Ct(null,t,i,s),a&&(n[i].$elm$=a,o.insertBefore(a,Nn(e))))},ar=(s,e,t,n,i)=>{for(;e<=t;++e)(n=s[e])&&(i=n.$elm$,ur(n),wt=!0,i["s-ol"]?i["s-ol"].remove():Je(i,!0),i.remove())},Da=(s,e,t,n)=>{let i=0,r=0,o=0,a=0,l=e.length-1,c=e[0],h=e[l],u=n.length-1,d=n[0],p=n[u],m,f;for(;i<=l&&r<=u;)if(c==null)c=e[++i];else if(h==null)h=e[--l];else if(d==null)d=n[++r];else if(p==null)p=n[--u];else if(dt(c,d))_e(c,d),c=e[++i],d=n[++r];else if(dt(h,p))_e(h,p),h=e[--l],p=n[--u];else if(dt(c,p))(c.$tag$==="slot"||p.$tag$==="slot")&&Je(c.$elm$.parentNode,!1),_e(c,p),s.insertBefore(c.$elm$,h.$elm$.nextSibling),c=e[++i],p=n[--u];else if(dt(h,d))(c.$tag$==="slot"||p.$tag$==="slot")&&Je(h.$elm$.parentNode,!1),_e(h,d),s.insertBefore(h.$elm$,c.$elm$),h=e[--l],d=n[++r];else{for(o=-1,a=i;a<=l;++a)if(e[a]&&e[a].$key$!==null&&e[a].$key$===d.$key$){o=a;break}o>=0?(f=e[o],f.$tag$!==d.$tag$?m=Ct(e&&e[r],t,o,s):(_e(f,d),e[o]=void 0,m=f.$elm$),d=n[++r]):(m=Ct(e&&e[r],t,r,s),d=n[++r]),m&&lr(c.$elm$).insertBefore(m,Nn(c.$elm$))}i>l?or(s,n[u+1]==null?null:n[u+1].$elm$,t,n,r,u):r>u&&ar(e,i,l)},dt=(s,e)=>s.$tag$===e.$tag$?s.$tag$==="slot"?s.$name$===e.$name$:s.$key$===e.$key$:!1,Nn=s=>s&&s["s-ol"]||s,lr=s=>(s["s-ol"]?s["s-ol"]:s).parentNode,_e=(s,e)=>{const t=e.$elm$=s.$elm$,n=s.$children$,i=e.$children$,r=e.$tag$,o=e.$text$;let a;o===null?(M=r==="svg"?!0:r==="foreignObject"?!1:M,r==="slot"||rr(s,e,M),n!==null&&i!==null?Da(t,n,e,i):i!==null?(s.$text$!==null&&(t.textContent=""),or(t,null,e,i,0,i.length-1)):n!==null&&ar(n,0,n.length-1),M&&r==="svg"&&(M=!1)):(a=t["s-cr"])?a.parentNode.textContent=o:s.$text$!==o&&(t.data=o)},cr=s=>{let e=s.childNodes,t,n,i,r,o,a;for(n=0,i=e.length;n<i;n++)if(t=e[n],t.nodeType===1){if(t["s-sr"]){for(o=t["s-sn"],t.hidden=!1,r=0;r<i;r++)if(a=e[r].nodeType,e[r]["s-hn"]!==t["s-hn"]||o!==""){if(a===1&&o===e[r].getAttribute("slot")){t.hidden=!0;break}}else if(a===1||a===3&&e[r].textContent.trim()!==""){t.hidden=!0;break}}cr(t)}},B=[],hr=s=>{let e,t,n,i,r,o,a=0,l=s.childNodes,c=l.length;for(;a<c;a++){if(e=l[a],e["s-sr"]&&(t=e["s-cr"])&&t.parentNode)for(n=t.parentNode.childNodes,i=e["s-sn"],o=n.length-1;o>=0;o--)t=n[o],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==e["s-hn"]&&(ei(t,i)?(r=B.find(h=>h.$nodeToRelocate$===t),wt=!0,t["s-sn"]=t["s-sn"]||i,r?r.$slotRefNode$=e:B.push({$slotRefNode$:e,$nodeToRelocate$:t}),t["s-sr"]&&B.map(h=>{ei(h.$nodeToRelocate$,t["s-sn"])&&(r=B.find(u=>u.$nodeToRelocate$===t),r&&!h.$slotRefNode$&&(h.$slotRefNode$=r.$slotRefNode$))})):B.some(h=>h.$nodeToRelocate$===t)||B.push({$nodeToRelocate$:t}));e.nodeType===1&&hr(e)}},ei=(s,e)=>s.nodeType===1?s.getAttribute("slot")===null&&e===""||s.getAttribute("slot")===e:s["s-sn"]===e?!0:e==="",ur=s=>{s.$attrs$&&s.$attrs$.ref&&s.$attrs$.ref(null),s.$children$&&s.$children$.map(ur)},Na=(s,e)=>{const t=s.$hostElement$,n=s.$cmpMeta$,i=s.$vnode$||kt(null,null),r=Ua(e)?e:Ae(null,null,e);qt=t.tagName,n.$attrsToReflect$&&(r.$attrs$=r.$attrs$||{},n.$attrsToReflect$.map(([o,a])=>r.$attrs$[a]=t[o])),r.$tag$=null,r.$flags$|=4,s.$vnode$=r,r.$elm$=i.$elm$=t.shadowRoot||t,Se=t["s-sc"],er=t["s-cr"],tr=(n.$flags$&1)!==0,wt=!1,_e(i,r);{if(R.$flags$|=1,jn){hr(r.$elm$);let o,a,l,c,h,u,d=0;for(;d<B.length;d++)o=B[d],a=o.$nodeToRelocate$,a["s-ol"]||(l=G.createTextNode(""),l["s-nr"]=a,a.parentNode.insertBefore(a["s-ol"]=l,a));for(d=0;d<B.length;d++)if(o=B[d],a=o.$nodeToRelocate$,o.$slotRefNode$){for(c=o.$slotRefNode$.parentNode,h=o.$slotRefNode$.nextSibling,l=a["s-ol"];l=l.previousSibling;)if(u=l["s-nr"],u&&u["s-sn"]===a["s-sn"]&&c===u.parentNode&&(u=u.nextSibling,!u||!u["s-nr"])){h=u;break}(!h&&c!==a.parentNode||a.nextSibling!==h)&&a!==h&&(!a["s-hn"]&&a["s-ol"]&&(a["s-hn"]=a["s-ol"].parentNode.nodeName),c.insertBefore(a,h))}else a.nodeType===1&&(a.hidden=!0)}wt&&cr(r.$elm$),R.$flags$&=-2,B.length=0}},Ba=s=>s,Ha=(s,e,t)=>{const n=Ba(s);return{emit:i=>qa(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:i})}},qa=(s,e,t)=>{const n=R.ce(e,t);return s.dispatchEvent(n),n},Fa=(s,e)=>{},dr=(s,e)=>(s.$flags$|=16,Fa(s,s.$ancestorComponent$),ll(()=>Va(s,e))),Va=(s,e)=>{const t=s.$hostElement$,n=be("scheduleUpdate",s.$cmpMeta$.$tagName$),i=t;let r;return e?r=Te(i,"componentWillLoad"):r=Te(i,"componentWillUpdate"),r=ti(r,()=>Te(i,"componentWillRender")),n(),ti(r,()=>Za(s,i,e))},Za=async(s,e,t)=>{const n=s.$hostElement$,i=be("update",s.$cmpMeta$.$tagName$);n["s-rc"],t&&Oa(s);const r=be("render",s.$cmpMeta$.$tagName$);Wa(s,e,n),r(),i(),Ga(s)},Wa=(s,e,t)=>{try{Ws=e,e=e.render&&e.render(),s.$flags$&=-17,s.$flags$|=2,(Ce.hasRenderFn||Ce.reflect)&&(Ce.vdomRender||Ce.reflect)&&(Ce.hydrateServerSide||Na(s,e))}catch(a){ot(a,s.$hostElement$)}return Ws=null,null},Ga=s=>{const e=s.$cmpMeta$.$tagName$,t=s.$hostElement$,n=be("postUpdate",e),i=t;s.$ancestorComponent$,Te(i,"componentDidRender"),s.$flags$&64?(Te(i,"componentDidUpdate"),n()):(s.$flags$|=64,Te(i,"componentDidLoad"),n())},Te=(s,e,t)=>{if(s&&s[e])try{return s[e](t)}catch(n){ot(n)}},ti=(s,e)=>s&&s.then?s.then(e):e(),Qa=(s,e)=>s!=null&&!zn(s)?e&4?s==="false"?!1:s===""||!!s:e&2?parseFloat(s):e&1?String(s):s:s,Ka=(s,e)=>Vt(s).$instanceValues$.get(e),Ja=(s,e,t,n)=>{const i=Vt(s),r=s,o=i.$instanceValues$.get(e),a=i.$flags$,l=r;t=Qa(t,n.$members$[e][0]);const c=Number.isNaN(o)&&Number.isNaN(t);if(t!==o&&!c){i.$instanceValues$.set(e,t);{if(n.$watchers$&&a&128){const u=n.$watchers$[e];u&&u.map(d=>{try{l[d](t,o,e)}catch(p){ot(p,r)}})}if((a&18)===2){if(l.componentShouldUpdate&&l.componentShouldUpdate(t,o,e)===!1)return;dr(i,!1)}}}},Ya=(s,e,t)=>{if(e.$members$){s.watchers&&(e.$watchers$=s.watchers);const n=Object.entries(e.$members$),i=s.prototype;n.map(([r,[o]])=>{(o&31||o&32)&&Object.defineProperty(i,r,{get(){return Ka(this,r)},set(a){Ja(this,r,a,e)},configurable:!0,enumerable:!0})});{const r=new Map;i.attributeChangedCallback=function(o,a,l){R.jmp(()=>{const c=r.get(o);if(this.hasOwnProperty(c))l=this[c],delete this[c];else if(i.hasOwnProperty(c)&&typeof this[c]=="number"&&this[c]==l)return;this[c]=l===null&&typeof this[c]=="boolean"?!1:l})},s.observedAttributes=n.filter(([o,a])=>a[0]&15).map(([o,a])=>{const l=a[1]||o;return r.set(l,o),a[0]&512&&e.$attrsToReflect$.push([o,l]),l})}}return s},Xa=async(s,e,t,n,i)=>{if((e.$flags$&32)===0&&(i=s.constructor,e.$flags$|=32,customElements.whenDefined(t.$tagName$).then(()=>e.$flags$|=128),i.style)){let o=i.style;typeof o!="string"&&(o=o[e.$modeName$=La(s)]);const a=ir(t,e.$modeName$);if(!St.has(a)){const l=be("registerStyles",t.$tagName$);Aa(a,o,!!(t.$flags$&1)),l()}}e.$ancestorComponent$,dr(e,!0)},el=s=>{},tl=s=>{if((R.$flags$&1)===0){const e=Vt(s),t=e.$cmpMeta$,n=be("connectedCallback",t.$tagName$);e.$flags$&1?(sr(s,e,t.$listeners$),el(e.$lazyInstance$)):(e.$flags$|=1,t.$flags$&12&&nl(s),t.$members$&&Object.entries(t.$members$).map(([i,[r]])=>{if(r&31&&s.hasOwnProperty(i)){const o=s[i];delete s[i],s[i]=o}}),Xa(s,e,t)),n()}},nl=s=>{const e=s["s-cr"]=G.createComment("");e["s-cn"]=!0,s.insertBefore(e,s.firstChild)},sl=s=>{if((R.$flags$&1)===0){const e=Vt(s);e.$rmListeners$&&(e.$rmListeners$.map(t=>t()),e.$rmListeners$=void 0)}},pr=(s,e)=>{const t={$flags$:e[0],$tagName$:e[1]};t.$members$=e[2],t.$listeners$=e[3],t.$watchers$=s.$watchers$,t.$attrsToReflect$=[];const n=s.prototype.connectedCallback,i=s.prototype.disconnectedCallback;return Object.assign(s.prototype,{__registerHost(){il(this,t)},connectedCallback(){tl(this),n&&n.call(this)},disconnectedCallback(){sl(this),i&&i.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(t.$flags$&16)})}}),s.is=t.$tagName$,Ya(s,t)},fr=new WeakMap,Vt=s=>fr.get(s),il=(s,e)=>{const t={$flags$:0,$hostElement$:s,$cmpMeta$:e,$instanceValues$:new Map};return sr(s,t,e.$listeners$),fr.set(s,t)},ni=(s,e)=>e in s,ot=(s,e)=>(0,console.error)(s,e),St=new Map,rl=[],si=[],gr=[],ol=(s,e)=>t=>{s.push(t),gn||(gn=!0,e&&R.$flags$&4?al(mn):R.raf(mn))},ii=s=>{for(let e=0;e<s.length;e++)try{s[e](performance.now())}catch(t){ot(t)}s.length=0},mn=()=>{ii(si),ii(gr),(gn=si.length>0)&&R.raf(mn)},al=s=>ka().then(s),ll=ol(gr,!0),cl=(s={})=>{const{content:e="",title:t,attributes:n=[]}=s;let i="",r=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},...n];return t&&(i=`<title>${t}</title>`),`<svg ${r.map(a=>`${a.name}="${a.value}"`).join(" ")}>${i}${e}</svg>`},hl=s=>s.replace(/<(\/?)svg([^>]*)>/g,"").trim();function ul(s){return`${s.getFullYear()}.${s.getMonth()+1}`}class dl{constructor(e){this.voca_component=e,this.voca_added=ul(new Date)}}const pl="telia-vst{display:none}",fl=pr(class extends nr{constructor(){super(),this.__registerHost(),this.vocaInternalUStats=Ha(this,"vocaInternalUStats")}connectedCallback(){this.vocaInternalUStats.emit(new dl(this.dataTrackingId))}render(){return Ae(Dn,null)}static get style(){return pl}},[0,"telia-vst",{dataTrackingId:[1,"data-tracking-id"]}]);function mr(){if(typeof customElements>"u")return;["telia-vst"].forEach(e=>{switch(e){case"telia-vst":customElements.get(e)||customElements.define(e,fl);break}})}mr();function vn(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{vocadsIcons:void 0,vocadsIconsRegistered:!1}}function gl(){if(typeof vn().vocadsIcons!==void 0)return vn().vocadsIcons}function ml(){return vn().vocadsIconsRegistered}const vl=".telia-icon{display:inline-block}.telia-icon__container{display:block;height:inherit}.telia-icon svg{display:block}.telia-icon--sm{height:calc(1.6rem * var(--voca-rem-multiplier));min-width:calc(1.6rem * var(--voca-rem-multiplier));width:calc(1.6rem * var(--voca-rem-multiplier))}.telia-icon--md{height:calc(2.4rem * var(--voca-rem-multiplier));min-width:calc(2.4rem * var(--voca-rem-multiplier));width:calc(2.4rem * var(--voca-rem-multiplier))}.telia-icon--lg{height:calc(3.2rem * var(--voca-rem-multiplier));min-width:calc(3.2rem * var(--voca-rem-multiplier));width:calc(3.2rem * var(--voca-rem-multiplier))}",bl=pr(class extends nr{constructor(){super(),this.__registerHost(),this.size="md",this.allyTitle=null,this.dataTrackingId="telia-icon"}getSvgString(){if(this.svg)return this.svg;if(ml()&&this.name){const s=gl();return s[this.name]?s[this.name].svg:""}return this.name&&console.warn(this.name,"Icons bundle is not registered and will not be rendered. Check if you have registered icons bundle or use svg property"),""}render(){let s=this.getSvgString(),e=[{name:"viewBox",value:"0 0 64 64"}];this.allyTitle?e=[...e,{name:"role",value:"img"}]:e=[...e,{name:"aria-hidden",value:"true"}];const t=cl({content:hl(s),attributes:e,title:this.allyTitle});return Ae(Dn,{class:`telia-icon telia-icon--${this.size}`},Ae("span",{"aria-label":this.allyTitle,class:"telia-icon__container",innerHTML:t}),Ae("telia-vst",{dataTrackingId:this.dataTrackingId}))}static get style(){return vl}},[0,"telia-icon",{name:[1],svg:[1],size:[1],allyTitle:[1,"ally-title"],dataTestid:[1,"data-testid"]}]);function yl(){if(typeof customElements>"u")return;["telia-icon","telia-vst"].forEach(e=>{switch(e){case"telia-icon":customElements.get(e)||customElements.define(e,bl);break;case"telia-vst":customElements.get(e)||mr();break}})}yl();/**
21
+ */const We=globalThis;let E=class extends at{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Dc(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Ce}};var _o;E._$litElement$=!0,E.finalized=!0,(_o=We.litElementHydrateSupport)==null||_o.call(We,{LitElement:E});const bi=We.litElementPolyfillSupport;bi==null||bi({LitElement:E});(We.litElementVersions??(We.litElementVersions=[])).push("4.2.0");const Uc={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 60C47.464 60 60 47.464 60 32C60 16.536 47.464 4 32 4C16.536 4 4 16.536 4 32C4.01731 47.4568 16.5432 59.9827 32 60ZM32 8.30769C45.0849 8.30769 55.6923 18.9151 55.6923 32C55.6923 45.0849 45.0849 55.6923 32 55.6923C18.9151 55.6923 8.30769 45.0849 8.30769 32C8.32247 18.9212 18.9212 8.32247 32 8.30769Z"/><path d="M29.3491 38.6031V20.6807C29.348 19.8662 29.4903 19.0598 29.7675 18.3096C29.9945 17.6371 30.3484 17.0302 30.804 16.5322C31.1251 16.1524 31.5593 15.9246 32.0204 15.894C32.6852 15.894 33.3496 16.471 34.0134 17.625C34.3738 18.1337 34.5955 18.7525 34.6509 19.4042V37.3267C34.6509 37.9947 34.2454 38.6329 33.4345 39.2414C32.6632 39.835 31.7547 40.1521 30.825 40.1523C29.8423 40.1524 29.3503 39.636 29.3491 38.6031Z"/><path d="M33.66 44.6959C33.9649 45.0866 34.161 45.551 34.2284 46.0419C34.2284 46.5397 33.8893 47.0083 33.2109 47.4476C32.5638 47.8771 31.8043 48.1062 31.0275 48.1061C30.1902 48.1061 29.7716 47.7271 29.7716 46.9693C29.7703 46.3788 29.8874 45.7941 30.116 45.2496C30.3064 44.7579 30.6022 44.3138 30.9826 43.9487C31.2626 43.6591 31.6427 43.4875 32.045 43.4692C32.5635 43.4692 33.1019 43.8781 33.66 44.6959Z"/></svg>'},Jo={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M52 7H24C19.5838 7.00505 16.0051 10.5838 16 15V23H12C7.58382 23.0051 4.00505 26.5838 4 31V43C4.00505 47.4162 7.58382 50.9949 12 51H19.1699L24.8789 56.7075C25.737 57.5654 27.0273 57.8219 28.1482 57.3575C29.2692 56.8931 30 55.7993 30 54.5859V51H39.999C44.4152 50.995 47.994 47.4162 47.999 43V35H52C56.4162 34.9949 59.9949 31.4162 60 27V15C59.9949 10.5838 56.4162 7.00505 52 7ZM43.999 43C43.9967 45.2082 42.2072 46.9977 39.999 47H26V52.1724L20.8262 47H12C9.79184 46.9976 8.00235 45.2082 8 43V31C8.00235 28.7918 9.79184 27.0024 12 27H16C16.0051 31.4162 19.5838 34.9949 24 35H30V38.5859C29.999 39.7998 30.7298 40.8945 31.8512 41.359C32.9726 41.8236 34.2634 41.5664 35.1211 40.7075L40.8291 35H43.999V43ZM56 27C55.9977 29.2082 54.2082 30.9976 52 31H39.1729L34 36.1719V31H24C21.7918 30.9976 20.0024 29.2082 20 27V15C20.0024 12.7918 21.7918 11.0024 24 11H52C54.2082 11.0024 55.9977 12.7918 56 15V27Z"/></svg>'},Nc={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 4C16.536 4 4 16.536 4 32C4 47.464 16.536 60 32 60C47.464 60 60 47.464 60 32C59.9829 16.5431 47.4569 4.01712 32 4ZM44.5613 24.5793L31.6382 43.9639C31.2806 44.5011 30.7008 44.8493 30.0586 44.9126C29.988 44.9197 29.9171 44.9232 29.8462 44.9231C29.275 44.9229 28.7272 44.696 28.3233 44.2921L19.7079 35.6767C19.1639 35.1326 18.9514 34.3396 19.1505 33.5964C19.3497 32.8533 19.9302 32.2728 20.6734 32.0736C21.4166 31.8745 22.2095 32.087 22.7536 32.631L29.5117 39.3881L40.9772 22.1899C41.4016 21.5439 42.1396 21.1749 42.9111 21.2229C43.6825 21.2709 44.3691 21.7286 44.7101 22.4223C45.0511 23.1159 44.9944 23.9391 44.5613 24.5793Z"/></svg>'},zc={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M31.9998 4C16.5358 4 3.99976 16.536 3.99976 32C3.99976 47.464 16.5358 60 31.9998 60C47.4637 60 59.9998 47.464 59.9998 32C59.9826 16.5431 47.4566 4.01712 31.9998 4ZM31.9998 55.6923C18.9149 55.6923 8.30745 45.0849 8.30745 32C8.30745 18.9151 18.9149 8.30769 31.9998 8.30769C45.0847 8.30769 55.6921 18.9151 55.6921 32C55.6773 45.0788 45.0785 55.6775 31.9998 55.6923ZM44.5611 24.5793L31.638 43.9639C31.2804 44.5011 30.7005 44.8493 30.0584 44.9126C29.9878 44.9197 29.9169 44.9232 29.8459 44.9231C29.2747 44.9229 28.727 44.696 28.3231 44.2921L19.7077 35.6767C19.1636 35.1326 18.9512 34.3396 19.1503 33.5964C19.3494 32.8533 19.9299 32.2728 20.6731 32.0736C21.4163 31.8745 22.2093 32.087 22.7534 32.631L29.5115 39.3881L40.9769 22.1899C41.4013 21.5439 42.1394 21.1749 42.9108 21.2229C43.6823 21.2709 44.3688 21.7286 44.7099 22.4223C45.0509 23.1159 44.9941 23.9391 44.5611 24.5793Z"/></svg>'},jc={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M57.5438 13.4967L28.717 50.5596C27.9537 51.5407 26.8061 52.147 25.5654 52.2248C25.4755 52.2301 25.3856 52.2332 25.2967 52.2332C24.1476 52.233 23.0455 51.7763 22.233 50.9637L6.63458 35.3654C6.08729 34.8181 5.87354 34.0204 6.07387 33.2728C6.27419 32.5252 6.85815 31.9412 7.60577 31.7409C8.35339 31.5406 9.15109 31.7543 9.69838 32.3016L25.2967 47.8999L54.1225 10.837C54.5976 10.2258 55.3626 9.91453 56.1295 10.0204C56.8963 10.1263 57.5484 10.6332 57.8402 11.3502C58.1319 12.0673 58.0189 12.8855 57.5438 13.4967Z"/></svg>'},ea={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M53.0318 24.8653L33.5318 44.3653C33.1256 44.7717 32.5745 45.0001 31.9999 45.0001C31.4253 45.0001 30.8742 44.7717 30.468 44.3653L10.968 24.8653C10.122 24.0193 10.122 22.6476 10.968 21.8015C11.8141 20.9555 13.1858 20.9555 14.0318 21.8015L31.9999 39.7696L49.968 21.8015C50.8141 20.9555 52.1858 20.9555 53.0318 21.8015C53.8779 22.6476 53.8779 24.0193 53.0318 24.8653Z"/></svg>'},Hc={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 56C45.2548 56 56 45.2548 56 32C56 18.7452 45.2548 8 32 8C18.7452 8 8 18.7452 8 32C8 45.2548 18.7452 56 32 56ZM32 60C47.464 60 60 47.464 60 32C60 16.536 47.464 4 32 4C16.536 4 4 16.536 4 32C4 47.464 16.536 60 32 60Z"/><path d="M25.2772 22.695C24.5164 21.8942 23.2505 21.8617 22.4497 22.6225C21.6488 23.3833 21.6164 24.6492 22.3772 25.45L29.2411 32.6752L22.4773 39.795C21.7166 40.5958 21.749 41.8617 22.5498 42.6225C23.3507 43.3833 24.6166 43.3508 25.3773 42.55L31.9998 35.5791L38.6222 42.55C39.3829 43.3508 40.6488 43.3833 41.4497 42.6225C42.2505 41.8617 42.2829 40.5958 41.5222 39.795L34.7584 32.6752L41.6223 25.45C42.3831 24.6492 42.3507 23.3833 41.5498 22.6225C40.749 21.8617 39.4831 21.8942 38.7224 22.695L31.9998 29.7714L25.2772 22.695Z"/></svg>'},as={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M51.365 48.3012C51.9123 48.8485 52.1261 49.6462 51.9258 50.3939C51.7254 51.1415 51.1415 51.7254 50.3939 51.9258C49.6462 52.1261 48.8485 51.9123 48.3012 51.365L32.4998 35.5636L16.6984 51.365C16.1511 51.9123 15.3534 52.1261 14.6058 51.9258C13.8581 51.7254 13.2742 51.1415 13.0739 50.3939C12.8735 49.6462 13.0873 48.8485 13.6346 48.3012L29.436 32.4998L13.6346 16.6984C13.0873 16.1511 12.8735 15.3534 13.0739 14.6058C13.2742 13.8581 13.8581 13.2742 14.6058 13.0739C15.3534 12.8735 16.1511 13.0873 16.6984 13.6346L32.4998 29.436L48.3012 13.6346C49.1473 12.7885 50.519 12.7885 51.365 13.6346C52.2111 14.4806 52.2111 15.8523 51.365 16.6984L35.5636 32.4998L51.365 48.3012Z"/></svg>'},Fc={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M58.2618 43.8838L38.8585 11.5469C37.4136 9.13651 34.8097 7.66134 31.9994 7.66113C29.1891 7.66093 26.585 9.13572 25.1397 11.5459L5.73642 43.8838C4.25367 46.3552 4.21482 49.4331 5.6347 51.9411C7.05459 54.4492 9.71372 55.9997 12.5958 56H51.4024C54.2845 55.9997 56.9436 54.4492 58.3635 51.9411C59.7834 49.4331 59.7446 46.3552 58.2618 43.8838ZM29.9991 36.9772V25.1569C29.9983 24.6198 30.1056 24.0879 30.3148 23.5932C30.486 23.1496 30.753 22.7494 31.0968 22.4209C31.339 22.1704 31.6666 22.0202 32.0145 22C32.5161 22 33.0173 22.3805 33.5182 23.1416C33.7901 23.4771 33.9573 23.8852 33.9991 24.3151V36.1354C33.9991 36.5759 33.6932 36.9969 33.0814 37.3982C32.4994 37.7897 31.814 37.9988 31.1126 37.999C30.3712 37.999 30 37.6584 29.9991 36.9772ZM34.2408 43.9236C34.173 43.4297 33.9757 42.9626 33.669 42.5696C33.1076 41.7469 32.566 41.3355 32.0444 41.3355C31.6396 41.354 31.2573 41.5266 30.9757 41.8179C30.593 42.1852 30.2954 42.6319 30.1039 43.1266C29.874 43.6743 29.7562 44.2625 29.7574 44.8565C29.7574 45.6189 30.1786 46 31.0208 46C31.8022 46.0001 32.5662 45.7697 33.2173 45.3377C33.8996 44.8957 34.2408 44.4243 34.2408 43.9236Z"/></svg>'},ta={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M59.9139 23.8477V7.90923C59.902 5.75094 58.1522 4.00588 55.9939 4H40.0554C38.8659 4 37.9016 4.96431 37.9016 6.15385C37.9016 7.34338 38.8659 8.30769 40.0554 8.30769H52.4616L29.8462 30.9231C29.4417 31.3271 29.2145 31.8753 29.2145 32.4469C29.2145 33.0186 29.4417 33.5668 29.8462 33.9708C30.2394 34.3609 30.7677 34.5846 31.3216 34.5954C31.8941 34.5987 32.4443 34.3739 32.8508 33.9708L55.6062 11.2046V23.8477C55.6062 25.0372 56.5705 26.0015 57.76 26.0015C58.9495 26.0015 59.9139 25.0372 59.9139 23.8477Z"/><path d="M12.217 60H47.4001C51.9189 59.9942 55.5874 56.3449 55.617 51.8262V38.4615C55.617 37.272 54.6527 36.3077 53.4631 36.3077C52.2736 36.3077 51.3093 37.272 51.3093 38.4615V51.7831C51.3034 53.9396 49.5566 55.6864 47.4001 55.6923H12.217C10.0771 55.6866 8.33714 53.9659 8.30776 51.8262V16.5569C8.29914 15.5145 8.7072 14.5119 9.44126 13.7718C10.1753 13.0316 11.1746 12.6153 12.217 12.6154H25.5385C26.7281 12.6154 27.6924 11.6511 27.6924 10.4615C27.6924 9.272 26.7281 8.30769 25.5385 8.30769H12.217C10.0321 8.30767 7.9372 9.17782 6.39529 10.7258C4.85339 12.2738 3.99147 14.3721 4.00006 16.5569V51.8262C4.02963 56.3449 7.6981 59.9942 12.217 60Z"/></svg>'},Nr={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M51.4283 11.6761L53.1768 9.53891C53.9347 8.61282 53.7982 7.24774 52.8722 6.48993C51.9461 5.73211 50.581 5.86852 49.8232 6.79461L36.3333 23.2822V13.3972C36.3332 11.6447 35.2774 10.0648 33.6583 9.39418C32.0391 8.72356 30.1755 9.09425 28.9362 10.3334L18.1029 21.1668H14.6667C9.88247 21.1722 6.00547 25.0492 6 29.8334V34.1668C6.00547 38.951 9.88247 42.828 14.6667 42.8334H18.1029L19.3315 44.0621L10.8232 54.4613C10.0653 55.3874 10.2018 56.7525 11.1279 57.5103C12.0539 58.2681 13.419 58.1317 14.1768 57.2056L22.411 47.1416L28.9362 53.6668C30.1755 54.9059 32.0391 55.2766 33.6583 54.606C35.2774 53.9354 36.3332 52.3555 36.3333 50.603V30.1254L42.6092 22.4549C44.2201 25.3756 45.044 28.6649 45 32.0001C45.1184 36.1899 43.7698 40.2896 41.1872 43.5909C40.409 44.5001 40.5152 45.8679 41.4243 46.6461C42.3334 47.4243 43.7012 47.3183 44.4795 46.4093C47.7313 42.3208 49.4486 37.2227 49.3333 32.0001C49.403 27.3538 48.067 22.7949 45.5005 18.9211L48.6119 15.1182C52.019 20.0793 53.7867 25.9829 53.6667 32.0001C53.6667 39.0587 51.4873 45.6518 47.6872 50.0909C46.909 51.0001 47.0152 52.3679 47.9243 53.1461C48.8334 53.9243 50.2012 53.8183 50.9795 52.9093C55.4408 47.6968 58 40.0764 58 32.0001C58 24.21 55.6006 16.8662 51.4283 11.6761ZM19.8971 38.5H14.6667C12.2744 38.4977 10.3357 36.559 10.3333 34.1667V29.8334C10.3357 27.4411 12.2744 25.5024 14.6667 25.5H19.8971L32 13.3972V28.5784L22.089 40.6919L19.8971 38.5ZM31.9997 50.603L25.1682 43.7715L31.9997 35.4218V50.603Z"/></svg>'},Bc={name:"question",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 4C16.536 4 4 16.536 4 32C4 47.464 16.536 60 32 60C47.464 60 60 47.464 60 32C59.9827 16.5432 47.4568 4.01731 32 4ZM32 55.6923C18.9151 55.6923 8.30769 45.0849 8.30769 32C8.30769 18.9151 18.9151 8.30769 32 8.30769C45.0849 8.30769 55.6923 18.9151 55.6923 32C55.6775 45.0788 45.0788 55.6775 32 55.6923Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M31.9423 37.5723L36.311 32.9068L36.7354 32.4448C39.7555 29.1161 40.7645 27.0647 40.7645 24.5087C40.7645 23.1091 40.4251 21.7942 39.7041 20.6491C38.3044 18.3587 35.6323 16.9166 32.2816 16.9166C28.7565 16.9166 25.3125 18.7414 23.2581 21.6772L23.1201 21.8791C22.8232 22.3032 22.696 22.6849 22.696 22.9818C22.696 23.7029 23.926 25.9932 25.2833 25.9932C25.5378 25.9932 25.7922 25.9084 26.0467 25.7388C26.2588 25.5691 26.5981 25.2298 27.0647 24.7208C28.8885 22.6849 30.1185 21.9215 31.7726 21.9215C33.6813 21.9215 35.081 23.1939 35.081 24.8905C35.081 26.375 34.2751 27.7746 32.3664 29.8529L28.2523 34.2216C27.9554 34.6033 27.7857 34.9426 27.7857 35.282C27.7857 35.6213 27.9978 36.1726 28.4219 36.8937C29.0581 37.8692 29.7368 38.3782 30.4578 38.3782C30.9244 38.3782 31.3909 38.1237 31.9423 37.5723ZM30.882 47.4972C29.2278 47.4972 27.6585 44.7403 27.6585 43.6799C27.6585 42.1954 30.0761 40.6261 32.4089 40.6261C33.6389 40.6261 34.2751 41.1775 34.2751 42.3227C34.2751 44.0616 33.4692 45.843 32.4513 46.7761C31.9423 47.2427 31.4334 47.4972 30.882 47.4972Z"/></svg>'},na={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.41642 6.29292C5.99705 5.18016 3.38612 7.41823 4.12858 9.96847L10.5427 32L4.12858 54.0315C3.38612 56.5818 5.99704 58.8198 8.41642 57.7071L58.1942 34.8125C60.6019 33.7051 60.6019 30.2949 58.1942 29.1875L8.41642 6.29292ZM14.2569 29.9351L8.74174 10.9913L49.9295 29.9351H14.2569ZM14.2568 34.0651L8.74174 53.0087L49.9291 34.0651H14.2568Z"/></svg>'},zr={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M33.6578 9.3322C32.0391 8.65799 30.1735 9.02919 28.9362 10.2717L18.1029 21.105H14.6667C9.88247 21.1105 6.00547 24.9875 6 29.7717V34.105C6.00547 38.8892 9.88247 42.7662 14.6667 42.7717H18.1029L28.9362 53.605C30.1755 54.8442 32.0391 55.2149 33.6583 54.5442C35.2774 53.8736 36.3332 52.2937 36.3333 50.5412V13.3355C36.3365 11.5817 35.2794 10.0001 33.6578 9.3322ZM32 50.5411L19.8971 38.4382H14.6667C12.2744 38.4358 10.3357 36.4971 10.3333 34.1049V29.7716C10.3357 27.3793 12.2744 25.4406 14.6667 25.4382H19.8971L32 13.3353V50.5411ZM49.3334 31.9383C49.4487 37.161 47.7314 42.2591 44.4796 46.3475C43.7013 47.2565 42.3335 47.3625 41.4244 46.5843C40.5153 45.8061 40.4092 44.4383 41.1873 43.5291C43.7699 40.2278 45.1185 36.1282 45.0001 31.9383C45.1185 27.7485 43.7699 23.6488 41.1873 20.3475C40.4092 19.4383 40.5153 18.0705 41.4244 17.2923C42.3335 16.5141 43.7013 16.6201 44.4796 17.5291C47.7314 21.6176 49.4487 26.7157 49.3334 31.9383ZM58.0001 31.9383C58.0001 40.0147 55.441 47.635 50.9796 52.8475C50.2013 53.7565 48.8335 53.8625 47.9244 53.0843C47.0153 52.3061 46.9092 50.9383 47.6873 50.0291C51.4874 45.59 53.6668 38.9969 53.6668 31.9383C53.6668 24.8797 51.4874 18.2866 47.6873 13.8475C46.9092 12.9383 47.0153 11.5705 47.9244 10.7923C48.8335 10.0141 50.2013 10.1201 50.9796 11.0291C55.441 16.2416 58.0001 23.862 58.0001 31.9383Z"/></svg>'},lt={allRenderFn:!1,cmpDidLoad:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpDidRender:!0,cmpWillLoad:!0,cmpWillUpdate:!0,cmpWillRender:!0,connectedCallback:!0,disconnectedCallback:!0,element:!0,event:!0,hasRenderFn:!0,lifecycle:!0,hostListener:!0,hostListenerTargetWindow:!0,hostListenerTargetDocument:!0,hostListenerTargetBody:!0,hostListenerTargetParent:!1,hostListenerTarget:!0,member:!0,method:!0,mode:!0,observeAttribute:!0,prop:!0,propMutable:!0,reflect:!0,scoped:!0,shadowDom:!0,slot:!0,cssAnnotations:!0,state:!0,style:!0,svg:!0,updatable:!0,vdomAttribute:!0,vdomXlink:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomRef:!0,vdomPropOrAttr:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,watchCallback:!0,taskQueue:!0,hotModuleReplacement:!1,isDebug:!1,isDev:!1,isTesting:!1,hydrateServerSide:!1,hydrateClientSide:!1,lifecycleDOMEvents:!1,lazyLoad:!1,profile:!1,slotRelocation:!0,appendChildSlotFix:!1,cloneNodeFix:!1,hydratedAttribute:!1,hydratedClass:!0,safari10:!1,scriptDataOpts:!1,scopedSlotTextContentFix:!1,shadowDomShim:!1,slotChildNodesFix:!1,invisiblePrehydration:!0,propBoolean:!0,propNumber:!0,propString:!0,cssVarShim:!1,constructableCSS:!0,cmpShouldUpdate:!0,devTools:!1,dynamicImportShim:!1,shadowDelegatesFocus:!0,initializeNextTick:!1,asyncLoading:!1,asyncQueue:!1,transformTagName:!1,attachStyles:!0};let ct,ia,Wn,sa=!1,_n=!1,ls=!1,ee=!1,jr=null,Di=!1;const Gn=typeof window<"u"?window:{},fe=Gn.document||{head:{}},ra=Gn.HTMLElement||class{},Z={$flags$:0,$resourcesUrl$:"",jmp:n=>n(),raf:n=>requestAnimationFrame(n),ael:(n,e,t,i)=>n.addEventListener(e,t,i),rel:(n,e,t,i)=>n.removeEventListener(e,t,i),ce:(n,e)=>new CustomEvent(n,e)},qc=(()=>{let n=!1;try{fe.addEventListener("e",null,Object.defineProperty({},"passive",{get(){n=!0}}))}catch{}return n})(),Vc=n=>Promise.resolve(n),Wc=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replace=="function"}catch{}return!1})(),oa=(n,e,t,i)=>{t&&t.map(([s,r,o])=>{const a=Zc(n,s),l=Gc(e,o),c=Yc(s);Z.ael(a,r,l,c),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>Z.rel(a,r,l,c))})},Gc=(n,e)=>t=>{try{lt.lazyLoad||n.$hostElement$[e](t)}catch(i){Xt(i)}},Zc=(n,e)=>e&4?fe:e&8?Gn:e&16?fe.body:n,Yc=n=>qc?{passive:(n&1)!==0,capture:(n&2)!==0}:(n&2)!==0,Hr="http://www.w3.org/1999/xlink",Ye=(n,e="")=>()=>{},Fr=new WeakMap,Qc=(n,e,t)=>{let i=An.get(n);Wc&&t?(i=i||new CSSStyleSheet,i.replace(e)):i=e,An.set(n,i)},Xc=(n,e,t,i)=>{let s=aa(e,t),r=An.get(s);if(n=n.nodeType===11?n:fe,r)if(typeof r=="string"){n=n.head||n;let o=Fr.get(n),a;o||Fr.set(n,o=new Set),o.has(s)||(a=fe.createElement("style"),a.innerHTML=r,n.insertBefore(a,n.querySelector("link")),o&&o.add(s))}else n.adoptedStyleSheets.includes(r)||(n.adoptedStyleSheets=[...n.adoptedStyleSheets,r]);return s},Kc=n=>{const e=n.$cmpMeta$,t=n.$hostElement$,i=e.$flags$,s=Ye("attachStyles",e.$tagName$),r=Xc(t.shadowRoot?t.shadowRoot:t.getRootNode(),e,n.$modeName$);i&10&&(t["s-sc"]=r,t.classList.add(r+"-h"),i&2&&t.classList.add(r+"-s")),s()},aa=(n,e)=>"sc-"+(e&&n.$flags$&32?n.$tagName$+"-"+e:n.$tagName$),Jc=n=>Eu.map(e=>e(n)).find(e=>!!e),Br={},eu="http://www.w3.org/2000/svg",tu="http://www.w3.org/1999/xhtml",nu=n=>n!=null,cs=n=>(n=typeof n,n==="object"||n==="function"),dt=(n,e,...t)=>{let i=null,s=null,r=null,o=!1,a=!1,l=[];const c=p=>{for(let d=0;d<p.length;d++)i=p[d],Array.isArray(i)?c(i):i!=null&&typeof i!="boolean"&&((o=typeof n!="function"&&!cs(i))&&(i=String(i)),o&&a?l[l.length-1].$text$+=i:l.push(o?Cn(null,i):i),a=o)};if(c(t),e){e.key&&(s=e.key),e.name&&(r=e.name);{const p=e.className||e.class;p&&(e.class=typeof p!="object"?p:Object.keys(p).filter(d=>p[d]).join(" "))}}if(typeof n=="function")return n(e===null?{}:e,l,su);const u=Cn(n,null);return u.$attrs$=e,l.length>0&&(u.$children$=l),u.$key$=s,u.$name$=r,u},Cn=(n,e)=>{const t={$flags$:0,$tag$:n,$text$:e,$elm$:null,$children$:null};return t.$attrs$=null,t.$key$=null,t.$name$=null,t},us={},iu=n=>n&&n.$tag$===us,su={forEach:(n,e)=>n.map(qr).forEach(e),map:(n,e)=>n.map(qr).map(e).map(ru)},qr=n=>({vattrs:n.$attrs$,vchildren:n.$children$,vkey:n.$key$,vname:n.$name$,vtag:n.$tag$,vtext:n.$text$}),ru=n=>{if(typeof n.vtag=="function"){const t=Object.assign({},n.vattrs);return n.vkey&&(t.key=n.vkey),n.vname&&(t.name=n.vname),dt(n.vtag,t,...n.vchildren||[])}const e=Cn(n.vtag,n.vtext);return e.$attrs$=n.vattrs,e.$children$=n.vchildren,e.$key$=n.vkey,e.$name$=n.vname,e},Vr=(n,e,t,i,s,r)=>{if(t!==i){let o=Yr(n,e),a=e.toLowerCase();if(e==="class"){const l=n.classList,c=Wr(t),u=Wr(i);l.remove(...c.filter(p=>p&&!u.includes(p))),l.add(...u.filter(p=>p&&!c.includes(p)))}else if(e==="style"){for(const l in t)(!i||i[l]==null)&&(l.includes("-")?n.style.removeProperty(l):n.style[l]="");for(const l in i)(!t||i[l]!==t[l])&&(l.includes("-")?n.style.setProperty(l,i[l]):n.style[l]=i[l])}else if(e!=="key")if(e==="ref")i&&i(n);else if(!n.__lookupSetter__(e)&&e[0]==="o"&&e[1]==="n")e[2]==="-"?e=e.slice(3):Yr(Gn,a)?e=a.slice(2):e=a[2]+e.slice(3),t&&Z.rel(n,e,t,!1),i&&Z.ael(n,e,i,!1);else{const l=cs(i);if((o||l&&i!==null)&&!s)try{if(n.tagName.includes("-"))n[e]=i;else{let u=i??"";e==="list"?o=!1:(t==null||n[e]!=u)&&(n[e]=u)}}catch{}let c=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(e=a,c=!0),i==null||i===!1?(i!==!1||n.getAttribute(e)==="")&&(c?n.removeAttributeNS(Hr,e):n.removeAttribute(e)):(!o||r&4||s)&&!l&&(i=i===!0?"":i,c?n.setAttributeNS(Hr,e,i):n.setAttribute(e,i))}}},ou=/\s/,Wr=n=>n?n.split(ou):[],la=(n,e,t,i)=>{const s=e.$elm$.nodeType===11&&e.$elm$.host?e.$elm$.host:e.$elm$,r=n&&n.$attrs$||Br,o=e.$attrs$||Br;for(i in r)i in o||Vr(s,i,r[i],void 0,t,e.$flags$);for(i in o)Vr(s,i,r[i],o[i],t,e.$flags$)},En=(n,e,t,i)=>{let s=e.$children$[t],r=0,o,a,l;if(sa||(ls=!0,s.$tag$==="slot"&&(ct&&i.classList.add(ct+"-s"),s.$flags$|=s.$children$?2:1)),s.$text$!==null)o=s.$elm$=fe.createTextNode(s.$text$);else if(s.$flags$&1)o=s.$elm$=fe.createTextNode("");else{if(ee||(ee=s.$tag$==="svg"),o=s.$elm$=fe.createElementNS(ee?eu:tu,s.$flags$&2?"slot-fb":s.$tag$),ee&&s.$tag$==="foreignObject"&&(ee=!1),la(null,s,ee),nu(ct)&&o["s-si"]!==ct&&o.classList.add(o["s-si"]=ct),s.$children$)for(r=0;r<s.$children$.length;++r)a=En(n,s,r,o),a&&o.appendChild(a);s.$tag$==="svg"?ee=!1:o.tagName==="foreignObject"&&(ee=!0)}return o["s-hn"]=Wn,s.$flags$&3&&(o["s-sr"]=!0,o["s-cr"]=ia,o["s-sn"]=s.$name$||"",l=n&&n.$children$&&n.$children$[t],l&&l.$tag$===s.$tag$&&n.$elm$&&Ft(n.$elm$,!1)),o},Ft=(n,e)=>{Z.$flags$|=1;const t=n.childNodes;for(let i=t.length-1;i>=0;i--){const s=t[i];s["s-hn"]!==Wn&&s["s-ol"]&&(ha(s).insertBefore(s,hs(s)),s["s-ol"].remove(),s["s-ol"]=void 0,ls=!0),e&&Ft(s,e)}Z.$flags$&=-2},ca=(n,e,t,i,s,r)=>{let o=n["s-cr"]&&n["s-cr"].parentNode||n,a;for(o.shadowRoot&&o.tagName===Wn&&(o=o.shadowRoot);s<=r;++s)i[s]&&(a=En(null,t,s,n),a&&(i[s].$elm$=a,o.insertBefore(a,hs(e))))},ua=(n,e,t,i,s)=>{for(;e<=t;++e)(i=n[e])&&(s=i.$elm$,fa(i),_n=!0,s["s-ol"]?s["s-ol"].remove():Ft(s,!0),s.remove())},au=(n,e,t,i)=>{let s=0,r=0,o=0,a=0,l=e.length-1,c=e[0],u=e[l],p=i.length-1,d=i[0],g=i[p],m,$;for(;s<=l&&r<=p;)if(c==null)c=e[++s];else if(u==null)u=e[--l];else if(d==null)d=i[++r];else if(g==null)g=i[--p];else if(hn(c,d))ut(c,d),c=e[++s],d=i[++r];else if(hn(u,g))ut(u,g),u=e[--l],g=i[--p];else if(hn(c,g))(c.$tag$==="slot"||g.$tag$==="slot")&&Ft(c.$elm$.parentNode,!1),ut(c,g),n.insertBefore(c.$elm$,u.$elm$.nextSibling),c=e[++s],g=i[--p];else if(hn(u,d))(c.$tag$==="slot"||g.$tag$==="slot")&&Ft(u.$elm$.parentNode,!1),ut(u,d),n.insertBefore(u.$elm$,c.$elm$),u=e[--l],d=i[++r];else{for(o=-1,a=s;a<=l;++a)if(e[a]&&e[a].$key$!==null&&e[a].$key$===d.$key$){o=a;break}o>=0?($=e[o],$.$tag$!==d.$tag$?m=En(e&&e[r],t,o,n):(ut($,d),e[o]=void 0,m=$.$elm$),d=i[++r]):(m=En(e&&e[r],t,r,n),d=i[++r]),m&&ha(c.$elm$).insertBefore(m,hs(c.$elm$))}s>l?ca(n,i[p+1]==null?null:i[p+1].$elm$,t,i,r,p):r>p&&ua(e,s,l)},hn=(n,e)=>n.$tag$===e.$tag$?n.$tag$==="slot"?n.$name$===e.$name$:n.$key$===e.$key$:!1,hs=n=>n&&n["s-ol"]||n,ha=n=>(n["s-ol"]?n["s-ol"]:n).parentNode,ut=(n,e)=>{const t=e.$elm$=n.$elm$,i=n.$children$,s=e.$children$,r=e.$tag$,o=e.$text$;let a;o===null?(ee=r==="svg"?!0:r==="foreignObject"?!1:ee,r==="slot"||la(n,e,ee),i!==null&&s!==null?au(t,i,e,s):s!==null?(n.$text$!==null&&(t.textContent=""),ca(t,null,e,s,0,s.length-1)):i!==null&&ua(i,0,i.length-1),ee&&r==="svg"&&(ee=!1)):(a=t["s-cr"])?a.parentNode.textContent=o:n.$text$!==o&&(t.data=o)},da=n=>{let e=n.childNodes,t,i,s,r,o,a;for(i=0,s=e.length;i<s;i++)if(t=e[i],t.nodeType===1){if(t["s-sr"]){for(o=t["s-sn"],t.hidden=!1,r=0;r<s;r++)if(a=e[r].nodeType,e[r]["s-hn"]!==t["s-hn"]||o!==""){if(a===1&&o===e[r].getAttribute("slot")){t.hidden=!0;break}}else if(a===1||a===3&&e[r].textContent.trim()!==""){t.hidden=!0;break}}da(t)}},oe=[],pa=n=>{let e,t,i,s,r,o,a=0,l=n.childNodes,c=l.length;for(;a<c;a++){if(e=l[a],e["s-sr"]&&(t=e["s-cr"])&&t.parentNode)for(i=t.parentNode.childNodes,s=e["s-sn"],o=i.length-1;o>=0;o--)t=i[o],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==e["s-hn"]&&(Gr(t,s)?(r=oe.find(u=>u.$nodeToRelocate$===t),_n=!0,t["s-sn"]=t["s-sn"]||s,r?r.$slotRefNode$=e:oe.push({$slotRefNode$:e,$nodeToRelocate$:t}),t["s-sr"]&&oe.map(u=>{Gr(u.$nodeToRelocate$,t["s-sn"])&&(r=oe.find(p=>p.$nodeToRelocate$===t),r&&!u.$slotRefNode$&&(u.$slotRefNode$=r.$slotRefNode$))})):oe.some(u=>u.$nodeToRelocate$===t)||oe.push({$nodeToRelocate$:t}));e.nodeType===1&&pa(e)}},Gr=(n,e)=>n.nodeType===1?n.getAttribute("slot")===null&&e===""||n.getAttribute("slot")===e:n["s-sn"]===e?!0:e==="",fa=n=>{n.$attrs$&&n.$attrs$.ref&&n.$attrs$.ref(null),n.$children$&&n.$children$.map(fa)},lu=(n,e)=>{const t=n.$hostElement$,i=n.$cmpMeta$,s=n.$vnode$||Cn(null,null),r=iu(e)?e:dt(null,null,e);Wn=t.tagName,i.$attrsToReflect$&&(r.$attrs$=r.$attrs$||{},i.$attrsToReflect$.map(([o,a])=>r.$attrs$[a]=t[o])),r.$tag$=null,r.$flags$|=4,n.$vnode$=r,r.$elm$=s.$elm$=t.shadowRoot||t,ct=t["s-sc"],ia=t["s-cr"],sa=(i.$flags$&1)!==0,_n=!1,ut(s,r);{if(Z.$flags$|=1,ls){pa(r.$elm$);let o,a,l,c,u,p,d=0;for(;d<oe.length;d++)o=oe[d],a=o.$nodeToRelocate$,a["s-ol"]||(l=fe.createTextNode(""),l["s-nr"]=a,a.parentNode.insertBefore(a["s-ol"]=l,a));for(d=0;d<oe.length;d++)if(o=oe[d],a=o.$nodeToRelocate$,o.$slotRefNode$){for(c=o.$slotRefNode$.parentNode,u=o.$slotRefNode$.nextSibling,l=a["s-ol"];l=l.previousSibling;)if(p=l["s-nr"],p&&p["s-sn"]===a["s-sn"]&&c===p.parentNode&&(p=p.nextSibling,!p||!p["s-nr"])){u=p;break}(!u&&c!==a.parentNode||a.nextSibling!==u)&&a!==u&&(!a["s-hn"]&&a["s-ol"]&&(a["s-hn"]=a["s-ol"].parentNode.nodeName),c.insertBefore(a,u))}else a.nodeType===1&&(a.hidden=!0)}_n&&da(r.$elm$),Z.$flags$&=-2,oe.length=0}},cu=n=>n,uu=(n,e,t)=>{const i=cu(n);return{emit:s=>hu(i,e,{bubbles:!0,composed:!0,cancelable:!0,detail:s})}},hu=(n,e,t)=>{const i=Z.ce(e,t);return n.dispatchEvent(i),i},du=(n,e)=>{},ga=(n,e)=>(n.$flags$|=16,du(n,n.$ancestorComponent$),Ou(()=>pu(n,e))),pu=(n,e)=>{const t=n.$hostElement$,i=Ye("scheduleUpdate",n.$cmpMeta$.$tagName$),s=t;let r;return e?r=pt(s,"componentWillLoad"):r=pt(s,"componentWillUpdate"),r=Zr(r,()=>pt(s,"componentWillRender")),i(),Zr(r,()=>fu(n,s,e))},fu=async(n,e,t)=>{const i=n.$hostElement$,s=Ye("update",n.$cmpMeta$.$tagName$);i["s-rc"],t&&Kc(n);const r=Ye("render",n.$cmpMeta$.$tagName$);gu(n,e,i),r(),s(),mu(n)},gu=(n,e,t)=>{try{jr=e,e=e.render&&e.render(),n.$flags$&=-17,n.$flags$|=2,(lt.hasRenderFn||lt.reflect)&&(lt.vdomRender||lt.reflect)&&(lt.hydrateServerSide||lu(n,e))}catch(a){Xt(a,n.$hostElement$)}return jr=null,null},mu=n=>{const e=n.$cmpMeta$.$tagName$,t=n.$hostElement$,i=Ye("postUpdate",e),s=t;n.$ancestorComponent$,pt(s,"componentDidRender"),n.$flags$&64?(pt(s,"componentDidUpdate"),i()):(n.$flags$|=64,pt(s,"componentDidLoad"),i())},pt=(n,e,t)=>{if(n&&n[e])try{return n[e](t)}catch(i){Xt(i)}},Zr=(n,e)=>n&&n.then?n.then(e):e(),vu=(n,e)=>n!=null&&!cs(n)?e&4?n==="false"?!1:n===""||!!n:e&2?parseFloat(n):e&1?String(n):n:n,bu=(n,e)=>Zn(n).$instanceValues$.get(e),yu=(n,e,t,i)=>{const s=Zn(n),r=n,o=s.$instanceValues$.get(e),a=s.$flags$,l=r;t=vu(t,i.$members$[e][0]);const c=Number.isNaN(o)&&Number.isNaN(t);if(t!==o&&!c){s.$instanceValues$.set(e,t);{if(i.$watchers$&&a&128){const p=i.$watchers$[e];p&&p.map(d=>{try{l[d](t,o,e)}catch(g){Xt(g,r)}})}if((a&18)===2){if(l.componentShouldUpdate&&l.componentShouldUpdate(t,o,e)===!1)return;ga(s,!1)}}}},$u=(n,e,t)=>{if(e.$members$){n.watchers&&(e.$watchers$=n.watchers);const i=Object.entries(e.$members$),s=n.prototype;i.map(([r,[o]])=>{(o&31||o&32)&&Object.defineProperty(s,r,{get(){return bu(this,r)},set(a){yu(this,r,a,e)},configurable:!0,enumerable:!0})});{const r=new Map;s.attributeChangedCallback=function(o,a,l){Z.jmp(()=>{const c=r.get(o);if(this.hasOwnProperty(c))l=this[c],delete this[c];else if(s.hasOwnProperty(c)&&typeof this[c]=="number"&&this[c]==l)return;this[c]=l===null&&typeof this[c]=="boolean"?!1:l})},n.observedAttributes=i.filter(([o,a])=>a[0]&15).map(([o,a])=>{const l=a[1]||o;return r.set(l,o),a[0]&512&&e.$attrsToReflect$.push([o,l]),l})}}return n},wu=async(n,e,t,i,s)=>{if((e.$flags$&32)===0&&(s=n.constructor,e.$flags$|=32,customElements.whenDefined(t.$tagName$).then(()=>e.$flags$|=128),s.style)){let o=s.style;typeof o!="string"&&(o=o[e.$modeName$=Jc(n)]);const a=aa(t,e.$modeName$);if(!An.has(a)){const l=Ye("registerStyles",t.$tagName$);Qc(a,o,!!(t.$flags$&1)),l()}}e.$ancestorComponent$,ga(e,!0)},xu=n=>{},ku=n=>{if((Z.$flags$&1)===0){const e=Zn(n),t=e.$cmpMeta$,i=Ye("connectedCallback",t.$tagName$);e.$flags$&1?(oa(n,e,t.$listeners$),xu(e.$lazyInstance$)):(e.$flags$|=1,t.$flags$&12&&Su(n),t.$members$&&Object.entries(t.$members$).map(([s,[r]])=>{if(r&31&&n.hasOwnProperty(s)){const o=n[s];delete n[s],n[s]=o}}),wu(n,e,t)),i()}},Su=n=>{const e=n["s-cr"]=fe.createComment("");e["s-cn"]=!0,n.insertBefore(e,n.firstChild)},_u=n=>{if((Z.$flags$&1)===0){const e=Zn(n);e.$rmListeners$&&(e.$rmListeners$.map(t=>t()),e.$rmListeners$=void 0)}},ma=(n,e)=>{const t={$flags$:e[0],$tagName$:e[1]};t.$members$=e[2],t.$listeners$=e[3],t.$watchers$=n.$watchers$,t.$attrsToReflect$=[];const i=n.prototype.connectedCallback,s=n.prototype.disconnectedCallback;return Object.assign(n.prototype,{__registerHost(){Cu(this,t)},connectedCallback(){ku(this),i&&i.call(this)},disconnectedCallback(){_u(this),s&&s.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(t.$flags$&16)})}}),n.is=t.$tagName$,$u(n,t)},va=new WeakMap,Zn=n=>va.get(n),Cu=(n,e)=>{const t={$flags$:0,$hostElement$:n,$cmpMeta$:e,$instanceValues$:new Map};return oa(n,t,e.$listeners$),va.set(n,t)},Yr=(n,e)=>e in n,Xt=(n,e)=>(0,console.error)(n,e),An=new Map,Eu=[],Qr=[],ba=[],Au=(n,e)=>t=>{n.push(t),Di||(Di=!0,e&&Z.$flags$&4?Tu(Ui):Z.raf(Ui))},Xr=n=>{for(let e=0;e<n.length;e++)try{n[e](performance.now())}catch(t){Xt(t)}n.length=0},Ui=()=>{Xr(Qr),Xr(ba),(Di=Qr.length>0)&&Z.raf(Ui)},Tu=n=>Vc().then(n),Ou=Au(ba,!0),Lu=(n={})=>{const{content:e="",title:t,attributes:i=[]}=n;let s="",r=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},...i];return t&&(s=`<title>${t}</title>`),`<svg ${r.map(a=>`${a.name}="${a.value}"`).join(" ")}>${s}${e}</svg>`},Ru=n=>n.replace(/<(\/?)svg([^>]*)>/g,"").trim();function Iu(n){return`${n.getFullYear()}.${n.getMonth()+1}`}class Pu{constructor(e){this.voca_component=e,this.voca_added=Iu(new Date)}}const Mu="telia-vst{display:none}",Du=ma(class extends ra{constructor(){super(),this.__registerHost(),this.vocaInternalUStats=uu(this,"vocaInternalUStats")}connectedCallback(){this.vocaInternalUStats.emit(new Pu(this.dataTrackingId))}render(){return dt(us,null)}static get style(){return Mu}},[0,"telia-vst",{dataTrackingId:[1,"data-tracking-id"]}]);function ya(){if(typeof customElements>"u")return;["telia-vst"].forEach(e=>{switch(e){case"telia-vst":customElements.get(e)||customElements.define(e,Du);break}})}ya();function Ni(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{vocadsIcons:void 0,vocadsIconsRegistered:!1}}function Uu(){if(typeof Ni().vocadsIcons!==void 0)return Ni().vocadsIcons}function Nu(){return Ni().vocadsIconsRegistered}const zu=".telia-icon{display:inline-block}.telia-icon__container{display:block;height:inherit}.telia-icon svg{display:block}.telia-icon--sm{height:calc(1.6rem * var(--voca-rem-multiplier));min-width:calc(1.6rem * var(--voca-rem-multiplier));width:calc(1.6rem * var(--voca-rem-multiplier))}.telia-icon--md{height:calc(2.4rem * var(--voca-rem-multiplier));min-width:calc(2.4rem * var(--voca-rem-multiplier));width:calc(2.4rem * var(--voca-rem-multiplier))}.telia-icon--lg{height:calc(3.2rem * var(--voca-rem-multiplier));min-width:calc(3.2rem * var(--voca-rem-multiplier));width:calc(3.2rem * var(--voca-rem-multiplier))}",ju=ma(class extends ra{constructor(){super(),this.__registerHost(),this.size="md",this.allyTitle=null,this.dataTrackingId="telia-icon"}getSvgString(){if(this.svg)return this.svg;if(Nu()&&this.name){const n=Uu();return n[this.name]?n[this.name].svg:""}return this.name&&console.warn(this.name,"Icons bundle is not registered and will not be rendered. Check if you have registered icons bundle or use svg property"),""}render(){let n=this.getSvgString(),e=[{name:"viewBox",value:"0 0 64 64"}];this.allyTitle?e=[...e,{name:"role",value:"img"}]:e=[...e,{name:"aria-hidden",value:"true"}];const t=Lu({content:Ru(n),attributes:e,title:this.allyTitle});return dt(us,{class:`telia-icon telia-icon--${this.size}`},dt("span",{"aria-label":this.allyTitle,class:"telia-icon__container",innerHTML:t}),dt("telia-vst",{dataTrackingId:this.dataTrackingId}))}static get style(){return zu}},[0,"telia-icon",{name:[1],svg:[1],size:[1],allyTitle:[1,"ally-title"],dataTestid:[1,"data-testid"]}]);function Hu(){if(typeof customElements>"u")return;["telia-icon","telia-vst"].forEach(e=>{switch(e){case"telia-icon":customElements.get(e)||customElements.define(e,ju);break;case"telia-vst":customElements.get(e)||ya();break}})}Hu();/**
22
22
  * @license
23
23
  * Copyright 2017 Google LLC
24
24
  * SPDX-License-Identifier: BSD-3-Clause
25
- */const $l={attribute:!0,type:String,converter:$t,reflect:!1,hasChanged:In},xl=(s=$l,e,t)=>{const{kind:n,metadata:i}=t;let r=globalThis.litPropertyMetadata.get(i);if(r===void 0&&globalThis.litPropertyMetadata.set(i,r=new Map),n==="setter"&&((s=Object.create(s)).wrapped=!0),r.set(t.name,s),n==="accessor"){const{name:o}=t;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,s)},init(a){return a!==void 0&&this.C(o,void 0,s,a),a}}}if(n==="setter"){const{name:o}=t;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,s)}}throw Error("Unsupported decorator location: "+n)};function b(s){return(e,t)=>typeof t=="object"?xl(s,e,t):((n,i,r)=>{const o=i.hasOwnProperty(r);return i.constructor.createProperty(r,n),o?Object.getOwnPropertyDescriptor(i,r):void 0})(s,e,t)}/**
25
+ */const Fu={attribute:!0,type:String,converter:kn,reflect:!1,hasChanged:rs},Bu=(n=Fu,e,t)=>{const{kind:i,metadata:s}=t;let r=globalThis.litPropertyMetadata.get(s);if(r===void 0&&globalThis.litPropertyMetadata.set(s,r=new Map),i==="setter"&&((n=Object.create(n)).wrapped=!0),r.set(t.name,n),i==="accessor"){const{name:o}=t;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,n)},init(a){return a!==void 0&&this.C(o,void 0,n,a),a}}}if(i==="setter"){const{name:o}=t;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,n)}}throw Error("Unsupported decorator location: "+i)};function k(n){return(e,t)=>typeof t=="object"?Bu(n,e,t):((i,s,r)=>{const o=s.hasOwnProperty(r);return s.constructor.createProperty(r,i),o?Object.getOwnPropertyDescriptor(s,r):void 0})(n,e,t)}/**
26
26
  * @license
27
27
  * Copyright 2017 Google LLC
28
28
  * SPDX-License-Identifier: BSD-3-Clause
29
- */function S(s){return b({...s,state:!0,attribute:!1})}/**
29
+ */function O(n){return k({...n,state:!0,attribute:!1})}/**
30
30
  * @license
31
31
  * Copyright 2020 Google LLC
32
32
  * SPDX-License-Identifier: BSD-3-Clause
33
- */const wl=s=>s.strings===void 0;/**
33
+ */const qu=n=>n.strings===void 0;/**
34
34
  * @license
35
35
  * Copyright 2017 Google LLC
36
36
  * SPDX-License-Identifier: BSD-3-Clause
37
- */const at={ATTRIBUTE:1,CHILD:2},lt=s=>(...e)=>({_$litDirective$:s,values:e});let Zt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/**
37
+ */const Kt={ATTRIBUTE:1,CHILD:2},Jt=n=>(...e)=>({_$litDirective$:n,values:e});let Yn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/**
38
38
  * @license
39
39
  * Copyright 2017 Google LLC
40
40
  * SPDX-License-Identifier: BSD-3-Clause
41
- */const Ve=(s,e)=>{var n;const t=s._$AN;if(t===void 0)return!1;for(const i of t)(n=i._$AO)==null||n.call(i,e,!1),Ve(i,e);return!0},_t=s=>{let e,t;do{if((e=s._$AM)===void 0)break;t=e._$AN,t.delete(s),s=e}while((t==null?void 0:t.size)===0)},vr=s=>{for(let e;e=s._$AM;s=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(s))break;t.add(s),Sl(e)}};function kl(s){this._$AN!==void 0?(_t(this),this._$AM=s,vr(this)):this._$AM=s}function Cl(s,e=!1,t=0){const n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(n))for(let r=t;r<n.length;r++)Ve(n[r],!1),_t(n[r]);else n!=null&&(Ve(n,!1),_t(n));else Ve(this,s)}const Sl=s=>{s.type==at.CHILD&&(s._$AP??(s._$AP=Cl),s._$AQ??(s._$AQ=kl))};let br=class extends Zt{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),vr(this),this.isConnected=e._$AU}_$AO(e,t=!0){var n,i;e!==this.isConnected&&(this.isConnected=e,e?(n=this.reconnected)==null||n.call(this):(i=this.disconnected)==null||i.call(this)),t&&(Ve(this,e),_t(this))}setValue(e){if(wl(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};/**
41
+ */const Ut=(n,e)=>{var i;const t=n._$AN;if(t===void 0)return!1;for(const s of t)(i=s._$AO)==null||i.call(s,e,!1),Ut(s,e);return!0},Tn=n=>{let e,t;do{if((e=n._$AM)===void 0)break;t=e._$AN,t.delete(n),n=e}while((t==null?void 0:t.size)===0)},$a=n=>{for(let e;e=n._$AM;n=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(n))break;t.add(n),Gu(e)}};function Vu(n){this._$AN!==void 0?(Tn(this),this._$AM=n,$a(this)):this._$AM=n}function Wu(n,e=!1,t=0){const i=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(e)if(Array.isArray(i))for(let r=t;r<i.length;r++)Ut(i[r],!1),Tn(i[r]);else i!=null&&(Ut(i,!1),Tn(i));else Ut(this,n)}const Gu=n=>{n.type==Kt.CHILD&&(n._$AP??(n._$AP=Wu),n._$AQ??(n._$AQ=Vu))};let wa=class extends Yn{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),$a(this),this.isConnected=e._$AU}_$AO(e,t=!0){var i,s;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(s=this.disconnected)==null||s.call(this)),t&&(Ut(this,e),Tn(this))}setValue(e){if(qu(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};/**
42
42
  * @license
43
43
  * Copyright 2020 Google LLC
44
44
  * SPDX-License-Identifier: BSD-3-Clause
45
- */const Z=()=>new _l;class _l{}const sn=new WeakMap,W=lt(class extends br{render(s){return v}update(s,[e]){var n;const t=e!==this.G;return t&&this.G!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=(n=s.options)==null?void 0:n.host,this.rt(this.ct=s.element)),v}rt(s){if(this.isConnected||(s=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=sn.get(e);t===void 0&&(t=new WeakMap,sn.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,s),s!==void 0&&this.G.call(this.ht,s)}else this.G.value=s}get lt(){var s,e;return typeof this.G=="function"?(s=sn.get(this.ht??globalThis))==null?void 0:s.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/**
45
+ */const de=()=>new Zu;class Zu{}const yi=new WeakMap,pe=Jt(class extends wa{render(n){return w}update(n,[e]){var i;const t=e!==this.G;return t&&this.G!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=(i=n.options)==null?void 0:i.host,this.rt(this.ct=n.element)),w}rt(n){if(this.isConnected||(n=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=yi.get(e);t===void 0&&(t=new WeakMap,yi.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,n),n!==void 0&&this.G.call(this.ht,n)}else this.G.value=n}get lt(){var n,e;return typeof this.G=="function"?(n=yi.get(this.ht??globalThis))==null?void 0:n.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/**
46
46
  * @license
47
47
  * Copyright 2018 Google LLC
48
48
  * SPDX-License-Identifier: BSD-3-Clause
49
- */const Re=lt(class extends Zt{constructor(s){var e;if(super(s),s.type!==at.ATTRIBUTE||s.name!=="class"||((e=s.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(e=>s[e]).join(" ")+" "}update(s,[e]){var n,i;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in e)e[r]&&!((n=this.nt)!=null&&n.has(r))&&this.st.add(r);return this.render(e)}const t=s.element.classList;for(const r of this.st)r in e||(t.remove(r),this.st.delete(r));for(const r in e){const o=!!e[r];o===this.st.has(r)||(i=this.nt)!=null&&i.has(r)||(o?(t.add(r),this.st.add(r)):(t.remove(r),this.st.delete(r)))}return X}});var El=Object.defineProperty,Al=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&El(e,t,i),i};const ts=class ts extends w{constructor(){super(...arguments),this.anchor="BottomRight"}appendChild(e){var t;return(t=this.shadowRoot)==null||t.appendChild(e),e}render(){return this.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right"),v}};ts.styles=[C`
49
+ */const vt=Jt(class extends Yn{constructor(n){var e;if(super(n),n.type!==Kt.ATTRIBUTE||n.name!=="class"||((e=n.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(n){return" "+Object.keys(n).filter(e=>n[e]).join(" ")+" "}update(n,[e]){var i,s;if(this.st===void 0){this.st=new Set,n.strings!==void 0&&(this.nt=new Set(n.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in e)e[r]&&!((i=this.nt)!=null&&i.has(r))&&this.st.add(r);return this.render(e)}const t=n.element.classList;for(const r of this.st)r in e||(t.remove(r),this.st.delete(r));for(const r in e){const o=!!e[r];o===this.st.has(r)||(s=this.nt)!=null&&s.has(r)||(o?(t.add(r),this.st.add(r)):(t.remove(r),this.st.delete(r)))}return Ce}});var Yu=Object.defineProperty,Qu=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Yu(e,t,s),s};const Cs=class Cs extends E{constructor(){super(...arguments),this.anchor="BottomRight"}appendChild(e){var t;return(t=this.shadowRoot)==null||t.appendChild(e),e}render(){return this.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right"),w}};Cs.styles=[T`
50
50
  :host {
51
51
  position: fixed;
52
52
  display: flex;
@@ -62,28 +62,28 @@
62
62
  bottom: 20px;
63
63
  left: 20px;
64
64
  }
65
- `];let Et=ts;Al([b({attribute:!0})],Et.prototype,"anchor");const Tl=new WeakMap;let ri=0;const rn=new Map,oi=new WeakSet,ai=()=>new Promise(s=>requestAnimationFrame(s)),Ol=[{transform:"translateX(100%) scale(0)",opacity:0}],Ll=[{opacity:0}],li=[{opacity:0},{opacity:1}],ci=(s,e)=>{const t=s-e;return t===0?void 0:t},hi=(s,e)=>{const t=s/e;return t===1?void 0:t},on={left:(s,e)=>{const t=ci(s,e);return{value:t,transform:t==null||isNaN(t)?void 0:`translateX(${t}px)`}},top:(s,e)=>{const t=ci(s,e);return{value:t,transform:t==null||isNaN(t)?void 0:`translateY(${t}px)`}},width:(s,e)=>{let t;e===0&&(e=1,t={width:"1px"});const n=hi(s,e);return{value:n,overrideFrom:t,transform:n==null||isNaN(n)?void 0:`scaleX(${n})`}},height:(s,e)=>{let t;e===0&&(e=1,t={height:"1px"});const n=hi(s,e);return{value:n,overrideFrom:t,transform:n==null||isNaN(n)?void 0:`scaleY(${n})`}}},Pl={duration:333,easing:"ease-in-out"},Rl=["left","top","width","height","opacity","color","background"],ui=new WeakMap;class Il extends br{constructor(e){if(super(e),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,e.type===at.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){var e;(e=this.resolveFinished)==null||e.call(this),this.finished=new Promise(t=>{this.l=t})}async resolveFinished(){var e;(e=this.l)==null||e.call(this),this.l=void 0}render(e){return v}getController(){return Tl.get(this.u)}isDisabled(){var e;return this.options.disabled||((e=this.getController())==null?void 0:e.disabled)}update(e,[t]){var i;const n=this.u===void 0;return n&&(this.u=(i=e.options)==null?void 0:i.host,this.u.addController(this),this.u.updateComplete.then(r=>this.t=!0),this.element=e.element,ui.set(this.element,this)),this.optionsOrCallback=t,(n||typeof t!="function")&&this.p(t),this.render(t)}p(e){e=e??{};const t=this.getController();t!==void 0&&((e={...t.defaultOptions,...e}).keyframeOptions={...t.defaultOptions.keyframeOptions,...e.keyframeOptions}),e.properties??(e.properties=Rl),this.options=e}m(){const e={},t=this.element.getBoundingClientRect(),n=getComputedStyle(this.element);return this.options.properties.forEach(i=>{const r=t[i]??(on[i]?void 0:n[i]),o=Number(r);e[i]=isNaN(o)?r+"":o}),e}v(){let e,t=!0;return this.options.guard&&(e=this.options.guard(),t=((n,i)=>{if(Array.isArray(n)){if(Array.isArray(i)&&i.length===n.length&&n.every((r,o)=>r===i[o]))return!1}else if(i===n)return!1;return!0})(e,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&t&&this.element.isConnected,this.h&&(this._=Array.isArray(e)?Array.from(e):e),this.h}hostUpdate(){typeof this.optionsOrCallback=="function"&&this.p(this.optionsOrCallback()),this.v()&&(this.A=this.m(),this.i=this.i??this.element.parentNode,this.o=this.element.nextSibling)}async hostUpdated(){if(!this.h||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let e;this.prepare(),await ai;const t=this.O(),n=this.j(this.options.keyframeOptions,t),i=this.m();if(this.A!==void 0){const{from:r,to:o}=this.N(this.A,i,t);this.log("measured",[this.A,i,r,o]),e=this.calculateKeyframes(r,o)}else{const r=rn.get(this.options.inId);if(r){rn.delete(this.options.inId);const{from:o,to:a}=this.N(r,i,t);e=this.calculateKeyframes(o,a),e=this.options.in?[{...this.options.in[0],...e[0]},...this.options.in.slice(1),e[1]]:e,ri++,e.forEach(l=>l.zIndex=ri)}else this.options.in&&(e=[...this.options.in,{}])}this.animate(e,n)}resetStyles(){this.P!==void 0&&(this.element.setAttribute("style",this.P??""),this.P=void 0)}commitStyles(){var e,t;this.P=this.element.getAttribute("style"),(e=this.webAnimation)==null||e.commitStyles(),(t=this.webAnimation)==null||t.cancel()}reconnected(){}async disconnected(){var t;if(!this.h||(this.options.id!==void 0&&rn.set(this.options.id,this.A),this.options.out===void 0))return;if(this.prepare(),await ai(),(t=this.i)==null?void 0:t.isConnected){const n=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,n),this.options.stabilizeOut){const i=this.m();this.log("stabilizing out");const r=this.A.left-i.left,o=this.A.top-i.top;getComputedStyle(this.element).position!=="static"||r===0&&o===0||(this.element.style.position="relative"),r!==0&&(this.element.style.left=r+"px"),o!==0&&(this.element.style.top=o+"px")}}const e=this.j(this.options.keyframeOptions);await this.animate(this.options.out,e),this.element.remove()}prepare(){this.createFinished()}start(){var e,t;(t=(e=this.options).onStart)==null||t.call(e,this)}didFinish(e){var t,n;e&&((n=(t=this.options).onComplete)==null||n.call(t,this)),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}O(){const e=[];for(let t=this.element.parentNode;t;t=t==null?void 0:t.parentNode){const n=ui.get(t);n&&!n.isDisabled()&&n&&e.push(n)}return e}get isHostRendered(){const e=oi.has(this.u);return e||this.u.updateComplete.then(()=>{oi.add(this.u)}),e}j(e,t=this.O()){const n={...Pl};return t.forEach(i=>Object.assign(n,i.options.keyframeOptions)),Object.assign(n,e),n}N(e,t,n){e={...e},t={...t};const i=n.map(a=>a.animatingProperties).filter(a=>a!==void 0);let r=1,o=1;return i.length>0&&(i.forEach(a=>{a.width&&(r/=a.width),a.height&&(o/=a.height)}),e.left!==void 0&&t.left!==void 0&&(e.left=r*e.left,t.left=r*t.left),e.top!==void 0&&t.top!==void 0&&(e.top=o*e.top,t.top=o*t.top)),{from:e,to:t}}calculateKeyframes(e,t,n=!1){const i={},r={};let o=!1;const a={};for(const l in t){const c=e[l],h=t[l];if(l in on){const u=on[l];if(c===void 0||h===void 0)continue;const d=u(c,h);d.transform!==void 0&&(a[l]=d.value,o=!0,i.transform=`${i.transform??""} ${d.transform}`,d.overrideFrom!==void 0&&Object.assign(i,d.overrideFrom))}else c!==h&&c!==void 0&&h!==void 0&&(o=!0,i[l]=c,r[l]=h)}return i.transformOrigin=r.transformOrigin=n?"center center":"top left",this.animatingProperties=a,o?[i,r]:void 0}async animate(e,t=this.options.keyframeOptions){this.start(),this.frames=e;let n=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=e=this.options.onFrames(this),this.log("modified frames",e)),e!==void 0)){this.log("animate",[e,t]),n=!0,this.webAnimation=this.element.animate(e,t);const i=this.getController();i==null||i.add(this);try{await this.webAnimation.finished}catch{}i==null||i.remove(this)}return this.didFinish(n),n}isAnimating(){var e,t;return((e=this.webAnimation)==null?void 0:e.playState)==="running"||((t=this.webAnimation)==null?void 0:t.pending)}log(e,t){this.shouldLog&&!this.isDisabled()&&console.log(e,this.options.id,t)}}const bn=lt(Il),K=(s,e,t)=>{s&&t.style.setProperty(e,s)},yr=(s,e)=>{var t,n,i,r,o,a,l,c,h;K((t=s.colors)==null?void 0:t.primaryBackground,"--primary-background",e),K((n=s.colors)==null?void 0:n.textOnPrimaryBackground,"--text-on-primary-background",e),K((i=s.colors)==null?void 0:i.secondaryBackground,"--secondary-background",e),K((r=s.colors)==null?void 0:r.textOnSecondaryBackground,"--text-on-secondary-background",e),K((o=s.colors)==null?void 0:o.interactiveDestructiveBackground,"--destructive-color",e),K((a=s.colors)==null?void 0:a.interactiveTextOnDestructiveBackground,"--text-on-destructive-color",e),K((l=s.colors)==null?void 0:l.interactivePrimaryBackground,"--interactive-primary-background",e),K((c=s.colors)==null?void 0:c.interactiveTextOnPrimaryBackground,"--interactive-text-on-primary-background",e),K((h=s.colors)==null?void 0:h.focusColor,"--focus-color",e)};var Ul=Object.defineProperty,ct=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&Ul(e,t,i),i};const ns=class ns extends w{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=Z(),this.widgetActive$=new H(!1),this.componentIsDestroyed$=new _}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}disconnectedCallback(){super.disconnectedCallback(),this.componentIsDestroyed$.next(),this.componentIsDestroyed$.complete()}toggleActive(){var e;if(!((e=this.application)!=null&&e.root)){console.warn("Could not activate widget. No root element assigned to widget.");return}this.active=!this.active,this.active?(this.application.appendToDOM(),this.notify("widget-set-active",{widgetId:this.application.id,active:!0}),this.widgetActive$.next(!0),this.hideTrigger()):(this.application.hide(),this.notify("widget-set-active",{widgetId:this.application.id,active:!1}),this.widgetActive$.next(!1),this.showTrigger())}notify(e,t={}){window!=null&&window.parent&&window.parent.postMessage({type:e,data:t},"*")}_applyBranding(){var e;(e=this.application)!=null&&e.settings&&yr(this.application.settings.branding,this)}async _renderSymbol(){var a,l,c;const e=(a=this.application)==null?void 0:a.branding(),t=(l=e==null?void 0:e.graphics)==null?void 0:l.trigger;if(t)return g` <img src=${t} class="trigger-icon" alt="" /> `;const n=(c=this.application)==null?void 0:c.triggerIcon;if(!n)return v;const i=async h=>xa,{type:r,content:o}=n;switch(r){case"Telia":{const h=await i();return h?g`<telia-icon
65
+ `];let On=Cs;Qu([k({attribute:!0})],On.prototype,"anchor");const Xu=new WeakMap;let Kr=0;const $i=new Map,Jr=new WeakSet,eo=()=>new Promise(n=>requestAnimationFrame(n)),Ku=[{transform:"translateX(100%) scale(0)",opacity:0}],Ju=[{opacity:0}],to=[{opacity:0},{opacity:1}],no=(n,e)=>{const t=n-e;return t===0?void 0:t},io=(n,e)=>{const t=n/e;return t===1?void 0:t},wi={left:(n,e)=>{const t=no(n,e);return{value:t,transform:t==null||isNaN(t)?void 0:`translateX(${t}px)`}},top:(n,e)=>{const t=no(n,e);return{value:t,transform:t==null||isNaN(t)?void 0:`translateY(${t}px)`}},width:(n,e)=>{let t;e===0&&(e=1,t={width:"1px"});const i=io(n,e);return{value:i,overrideFrom:t,transform:i==null||isNaN(i)?void 0:`scaleX(${i})`}},height:(n,e)=>{let t;e===0&&(e=1,t={height:"1px"});const i=io(n,e);return{value:i,overrideFrom:t,transform:i==null||isNaN(i)?void 0:`scaleY(${i})`}}},eh={duration:333,easing:"ease-in-out"},th=["left","top","width","height","opacity","color","background"],so=new WeakMap;class nh extends wa{constructor(e){if(super(e),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,e.type===Kt.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){var e;(e=this.resolveFinished)==null||e.call(this),this.finished=new Promise(t=>{this.l=t})}async resolveFinished(){var e;(e=this.l)==null||e.call(this),this.l=void 0}render(e){return w}getController(){return Xu.get(this.u)}isDisabled(){var e;return this.options.disabled||((e=this.getController())==null?void 0:e.disabled)}update(e,[t]){var s;const i=this.u===void 0;return i&&(this.u=(s=e.options)==null?void 0:s.host,this.u.addController(this),this.u.updateComplete.then(r=>this.t=!0),this.element=e.element,so.set(this.element,this)),this.optionsOrCallback=t,(i||typeof t!="function")&&this.p(t),this.render(t)}p(e){e=e??{};const t=this.getController();t!==void 0&&((e={...t.defaultOptions,...e}).keyframeOptions={...t.defaultOptions.keyframeOptions,...e.keyframeOptions}),e.properties??(e.properties=th),this.options=e}m(){const e={},t=this.element.getBoundingClientRect(),i=getComputedStyle(this.element);return this.options.properties.forEach(s=>{const r=t[s]??(wi[s]?void 0:i[s]),o=Number(r);e[s]=isNaN(o)?r+"":o}),e}v(){let e,t=!0;return this.options.guard&&(e=this.options.guard(),t=((i,s)=>{if(Array.isArray(i)){if(Array.isArray(s)&&s.length===i.length&&i.every((r,o)=>r===s[o]))return!1}else if(s===i)return!1;return!0})(e,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&t&&this.element.isConnected,this.h&&(this._=Array.isArray(e)?Array.from(e):e),this.h}hostUpdate(){typeof this.optionsOrCallback=="function"&&this.p(this.optionsOrCallback()),this.v()&&(this.A=this.m(),this.i=this.i??this.element.parentNode,this.o=this.element.nextSibling)}async hostUpdated(){if(!this.h||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let e;this.prepare(),await eo;const t=this.O(),i=this.j(this.options.keyframeOptions,t),s=this.m();if(this.A!==void 0){const{from:r,to:o}=this.N(this.A,s,t);this.log("measured",[this.A,s,r,o]),e=this.calculateKeyframes(r,o)}else{const r=$i.get(this.options.inId);if(r){$i.delete(this.options.inId);const{from:o,to:a}=this.N(r,s,t);e=this.calculateKeyframes(o,a),e=this.options.in?[{...this.options.in[0],...e[0]},...this.options.in.slice(1),e[1]]:e,Kr++,e.forEach(l=>l.zIndex=Kr)}else this.options.in&&(e=[...this.options.in,{}])}this.animate(e,i)}resetStyles(){this.P!==void 0&&(this.element.setAttribute("style",this.P??""),this.P=void 0)}commitStyles(){var e,t;this.P=this.element.getAttribute("style"),(e=this.webAnimation)==null||e.commitStyles(),(t=this.webAnimation)==null||t.cancel()}reconnected(){}async disconnected(){var t;if(!this.h||(this.options.id!==void 0&&$i.set(this.options.id,this.A),this.options.out===void 0))return;if(this.prepare(),await eo(),(t=this.i)==null?void 0:t.isConnected){const i=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,i),this.options.stabilizeOut){const s=this.m();this.log("stabilizing out");const r=this.A.left-s.left,o=this.A.top-s.top;getComputedStyle(this.element).position!=="static"||r===0&&o===0||(this.element.style.position="relative"),r!==0&&(this.element.style.left=r+"px"),o!==0&&(this.element.style.top=o+"px")}}const e=this.j(this.options.keyframeOptions);await this.animate(this.options.out,e),this.element.remove()}prepare(){this.createFinished()}start(){var e,t;(t=(e=this.options).onStart)==null||t.call(e,this)}didFinish(e){var t,i;e&&((i=(t=this.options).onComplete)==null||i.call(t,this)),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}O(){const e=[];for(let t=this.element.parentNode;t;t=t==null?void 0:t.parentNode){const i=so.get(t);i&&!i.isDisabled()&&i&&e.push(i)}return e}get isHostRendered(){const e=Jr.has(this.u);return e||this.u.updateComplete.then(()=>{Jr.add(this.u)}),e}j(e,t=this.O()){const i={...eh};return t.forEach(s=>Object.assign(i,s.options.keyframeOptions)),Object.assign(i,e),i}N(e,t,i){e={...e},t={...t};const s=i.map(a=>a.animatingProperties).filter(a=>a!==void 0);let r=1,o=1;return s.length>0&&(s.forEach(a=>{a.width&&(r/=a.width),a.height&&(o/=a.height)}),e.left!==void 0&&t.left!==void 0&&(e.left=r*e.left,t.left=r*t.left),e.top!==void 0&&t.top!==void 0&&(e.top=o*e.top,t.top=o*t.top)),{from:e,to:t}}calculateKeyframes(e,t,i=!1){const s={},r={};let o=!1;const a={};for(const l in t){const c=e[l],u=t[l];if(l in wi){const p=wi[l];if(c===void 0||u===void 0)continue;const d=p(c,u);d.transform!==void 0&&(a[l]=d.value,o=!0,s.transform=`${s.transform??""} ${d.transform}`,d.overrideFrom!==void 0&&Object.assign(s,d.overrideFrom))}else c!==u&&c!==void 0&&u!==void 0&&(o=!0,s[l]=c,r[l]=u)}return s.transformOrigin=r.transformOrigin=i?"center center":"top left",this.animatingProperties=a,o?[s,r]:void 0}async animate(e,t=this.options.keyframeOptions){this.start(),this.frames=e;let i=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=e=this.options.onFrames(this),this.log("modified frames",e)),e!==void 0)){this.log("animate",[e,t]),i=!0,this.webAnimation=this.element.animate(e,t);const s=this.getController();s==null||s.add(this);try{await this.webAnimation.finished}catch{}s==null||s.remove(this)}return this.didFinish(i),i}isAnimating(){var e,t;return((e=this.webAnimation)==null?void 0:e.playState)==="running"||((t=this.webAnimation)==null?void 0:t.pending)}log(e,t){this.shouldLog&&!this.isDisabled()&&console.log(e,this.options.id,t)}}const zi=Jt(nh),$e=(n,e,t)=>{n&&t.style.setProperty(e,n)},xa=(n,e)=>{var t,i,s,r,o,a,l,c,u;$e((t=n.colors)==null?void 0:t.primaryBackground,"--primary-background",e),$e((i=n.colors)==null?void 0:i.textOnPrimaryBackground,"--text-on-primary-background",e),$e((s=n.colors)==null?void 0:s.secondaryBackground,"--secondary-background",e),$e((r=n.colors)==null?void 0:r.textOnSecondaryBackground,"--text-on-secondary-background",e),$e((o=n.colors)==null?void 0:o.interactiveDestructiveBackground,"--destructive-color",e),$e((a=n.colors)==null?void 0:a.interactiveTextOnDestructiveBackground,"--text-on-destructive-color",e),$e((l=n.colors)==null?void 0:l.interactivePrimaryBackground,"--interactive-primary-background",e),$e((c=n.colors)==null?void 0:c.interactiveTextOnPrimaryBackground,"--interactive-text-on-primary-background",e),$e((u=n.colors)==null?void 0:u.focusColor,"--focus-color",e)};var ih=Object.defineProperty,en=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&ih(e,t,s),s};const Es=class Es extends E{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=de(),this.widgetActive$=new ae(!1),this.componentIsDestroyed$=new P}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}disconnectedCallback(){super.disconnectedCallback(),this.componentIsDestroyed$.next(),this.componentIsDestroyed$.complete()}toggleActive(){var e;if(!((e=this.application)!=null&&e.root)){console.warn("Could not activate widget. No root element assigned to widget.");return}this.active=!this.active,this.active?(this.application.appendToDOM(),this.notify("widget-set-active",{widgetId:this.application.id,active:!0}),this.widgetActive$.next(!0),this.hideTrigger()):(this.application.hide(),this.notify("widget-set-active",{widgetId:this.application.id,active:!1}),this.widgetActive$.next(!1),this.showTrigger())}notify(e,t={}){window!=null&&window.parent&&window.parent.postMessage({type:e,data:t},"*")}_applyBranding(){var e;(e=this.application)!=null&&e.settings&&xa(this.application.settings.branding,this)}async _renderSymbol(){var a,l,c;const e=(a=this.application)==null?void 0:a.branding(),t=(l=e==null?void 0:e.graphics)==null?void 0:l.trigger;if(t)return y` <img src=${t} class="trigger-icon" alt="" /> `;const i=(c=this.application)==null?void 0:c.triggerIcon;if(!i)return w;const s=async u=>Bc,{type:r,content:o}=i;switch(r){case"Telia":{const u=await s();return u?y`<telia-icon
66
66
  class="trigger-icon"
67
- svg=${h.svg}
67
+ svg=${u.svg}
68
68
  size="lg"
69
- ></telia-icon>`:v}default:return v}}hideTrigger(){this.triggerVisible=!1}showTrigger(){this.triggerVisible=!0}render(){var e,t,n,i;return g`<div
70
- class=${Re({"trigger-container":!0,hidden:!this.triggerVisible})}
71
- ${W(this.containerRef)}
69
+ ></telia-icon>`:w}default:return w}}hideTrigger(){this.triggerVisible=!1}showTrigger(){this.triggerVisible=!0}render(){var e,t,i,s;return y`<div
70
+ class=${vt({"trigger-container":!0,hidden:!this.triggerVisible})}
71
+ ${pe(this.containerRef)}
72
72
  >
73
- ${!this.active&&((i=(n=(t=(e=this.application)==null?void 0:e.settings)==null?void 0:t.branding)==null?void 0:n.other)!=null&&i.showButtonLabel)?g`
73
+ ${!this.active&&((s=(i=(t=(e=this.application)==null?void 0:e.settings)==null?void 0:t.branding)==null?void 0:i.other)!=null&&s.showButtonLabel)?y`
74
74
  <button
75
75
  label="${this.application.settings.branding.other.buttonLabelText??"Widget trigger"}"
76
76
  class="trigger-label"
77
77
  @click=${this.toggleActive}
78
- ${bn({keyframeOptions:{},in:Ol,stabilizeOut:!0,skipInitial:!1})}
78
+ ${zi({keyframeOptions:{},in:Ku,stabilizeOut:!0,skipInitial:!1})}
79
79
  >
80
80
  ${this.application.settings.branding.other.buttonLabelText}
81
81
  </button>
82
- `:v}
82
+ `:w}
83
83
 
84
84
  <button
85
85
  label="Widget trigger"
86
- class=${Re({trigger:!0,active:this.active,rendered:this.loaded})}
86
+ class=${vt({trigger:!0,active:this.active,rendered:this.loaded})}
87
87
  @click=${this.toggleActive}
88
88
  >
89
89
  ${this.icon}
@@ -115,7 +115,7 @@
115
115
  </svg>
116
116
  </span>
117
117
  </button>
118
- </div>`}};ns.styles=[C`
118
+ </div>`}};Es.styles=[T`
119
119
  :host {
120
120
  --voca-rem-multiplier: 0.625;
121
121
  --trigger-label-bg: #f5e0ff;
@@ -244,7 +244,7 @@
244
244
  .trigger-label:hover {
245
245
  opacity: 0.8;
246
246
  }
247
- `];let ee=ns;ct([b({attribute:!1})],ee.prototype,"application");ct([S()],ee.prototype,"active");ct([S()],ee.prototype,"triggerVisible");ct([S()],ee.prototype,"loaded");ct([S()],ee.prototype,"icon");var Ml=Object.defineProperty,de=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&Ml(e,t,i),i};const $r=s=>{const t=class t extends s{constructor(){super(...arguments),this.properties={},this.context={},this.layout={},this.nodes=[]}writeProperties(i){this.properties=i}writeLayout(i){this.layout=i}writeContext(i){this.context=i}addChild(i){i.parent=this,this.nodes.push(i)}connectedCallback(){super.connectedCallback(),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),this.application.mountComponent(this)}};t.styles=[C`
247
+ `];let Ee=Es;en([k({attribute:!1})],Ee.prototype,"application");en([O()],Ee.prototype,"active");en([O()],Ee.prototype,"triggerVisible");en([O()],Ee.prototype,"loaded");en([O()],Ee.prototype,"icon");var sh=Object.defineProperty,Be=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&sh(e,t,s),s};const ka=n=>{const t=class t extends n{constructor(){super(...arguments),this.properties={},this.context={},this.layout={},this.nodes=[]}writeProperties(s){this.properties=s}writeLayout(s){this.layout=s}writeContext(s){this.context=s}addChild(s){s.parent=this,this.nodes.push(s)}connectedCallback(){super.connectedCallback(),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),this.application.mountComponent(this)}};t.styles=[T`
248
248
  :host {
249
249
  font-family: var(--font-family);
250
250
  grid-column: span var(--width);
@@ -256,19 +256,19 @@
256
256
  * {
257
257
  box-sizing: border-box;
258
258
  }
259
- `];let e=t;return de([b()],e.prototype,"properties"),de([b()],e.prototype,"context"),de([b()],e.prototype,"layout"),de([b()],e.prototype,"name"),de([b()],e.prototype,"type"),de([b({attribute:!1})],e.prototype,"application"),de([b({attribute:!1})],e.prototype,"parent"),e},ss=class ss extends $r(w){render(){return g`Non resolved component`}};ss.styles=[C`
259
+ `];let e=t;return Be([k()],e.prototype,"properties"),Be([k()],e.prototype,"context"),Be([k()],e.prototype,"layout"),Be([k()],e.prototype,"name"),Be([k()],e.prototype,"type"),Be([k({attribute:!1})],e.prototype,"application"),Be([k({attribute:!1})],e.prototype,"parent"),e},As=class As extends ka(E){render(){return y`Non resolved component`}};As.styles=[T`
260
260
  :host {
261
261
  display: block;
262
262
  }
263
- `];let yn=ss;/**
263
+ `];let ji=As;/**
264
264
  * @license
265
265
  * Copyright 2021 Google LLC
266
266
  * SPDX-License-Identifier: BSD-3-Clause
267
- */function*jl(s,e){if(s!==void 0){let t=0;for(const n of s)yield e(n,t++)}}var Ye=(s=>(s.Inline="inline",s.Trigger="trigger",s))(Ye||{});/**
267
+ */function*rh(n,e){if(n!==void 0){let t=0;for(const i of n)yield e(i,t++)}}var Bt=(n=>(n.Inline="inline",n.Trigger="trigger",n))(Bt||{});/**
268
268
  * @license
269
269
  * Copyright 2021 Google LLC
270
270
  * SPDX-License-Identifier: BSD-3-Clause
271
- */let xr=class extends Event{constructor(e,t,n,i){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=n,this.subscribe=i??!1}};/**
271
+ */let Sa=class extends Event{constructor(e,t,i,s){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=i,this.subscribe=s??!1}};/**
272
272
  * @license
273
273
  * Copyright 2021 Google LLC
274
274
  * SPDX-License-Identifier: BSD-3-Clause
@@ -276,25 +276,25 @@
276
276
  * @license
277
277
  * Copyright 2021 Google LLC
278
278
  * SPDX-License-Identifier: BSD-3-Clause
279
- */let di=class{constructor(e,t,n,i){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,o)),this.unsubscribe=o},this.host=e,t.context!==void 0){const r=t;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=t,this.callback=n,this.subscribe=i??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new xr(this.context,this.host,this.t,this.subscribe))}};/**
279
+ */let ro=class{constructor(e,t,i,s){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,o)),this.unsubscribe=o},this.host=e,t.context!==void 0){const r=t;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=t,this.callback=i,this.subscribe=s??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new Sa(this.context,this.host,this.t,this.subscribe))}};/**
280
280
  * @license
281
281
  * Copyright 2021 Google LLC
282
282
  * SPDX-License-Identifier: BSD-3-Clause
283
- */class zl{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){const n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:n}]of this.subscriptions)t(this.o,n)},e!==void 0&&(this.value=e)}addCallback(e,t,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});const{disposer:i}=this.subscriptions.get(e);e(this.value,i)}clearCallbacks(){this.subscriptions.clear()}}/**
283
+ */class oh{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){const i=t||!Object.is(e,this.o);this.o=e,i&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:i}]of this.subscriptions)t(this.o,i)},e!==void 0&&(this.value=e)}addCallback(e,t,i){if(!i)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});const{disposer:s}=this.subscriptions.get(e);e(this.value,s)}clearCallbacks(){this.subscriptions.clear()}}/**
284
284
  * @license
285
285
  * Copyright 2021 Google LLC
286
286
  * SPDX-License-Identifier: BSD-3-Clause
287
- */let Dl=class extends Event{constructor(e,t){super("context-provider",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},pi=class extends zl{constructor(e,t,n){var i,r;super(t.context!==void 0?t.initialValue:n),this.onContextRequest=o=>{if(o.context!==this.context)return;const a=o.contextTarget??o.composedPath()[0];a!==this.host&&(o.stopPropagation(),this.addCallback(o.callback,a,o.subscribe))},this.onProviderRequest=o=>{if(o.context!==this.context||(o.contextTarget??o.composedPath()[0])===this.host)return;const a=new Set;for(const[l,{consumerHost:c}]of this.subscriptions)a.has(l)||(a.add(l),c.dispatchEvent(new xr(this.context,c,l,!0)));o.stopPropagation()},this.host=e,t.context!==void 0?this.context=t.context:this.context=t,this.attachListeners(),(r=(i=this.host).addController)==null||r.call(i,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Dl(this.context,this.host))}};/**
287
+ */let ah=class extends Event{constructor(e,t){super("context-provider",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},oo=class extends oh{constructor(e,t,i){var s,r;super(t.context!==void 0?t.initialValue:i),this.onContextRequest=o=>{if(o.context!==this.context)return;const a=o.contextTarget??o.composedPath()[0];a!==this.host&&(o.stopPropagation(),this.addCallback(o.callback,a,o.subscribe))},this.onProviderRequest=o=>{if(o.context!==this.context||(o.contextTarget??o.composedPath()[0])===this.host)return;const a=new Set;for(const[l,{consumerHost:c}]of this.subscriptions)a.has(l)||(a.add(l),c.dispatchEvent(new Sa(this.context,c,l,!0)));o.stopPropagation()},this.host=e,t.context!==void 0?this.context=t.context:this.context=t,this.attachListeners(),(r=(s=this.host).addController)==null||r.call(s,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new ah(this.context,this.host))}};/**
288
288
  * @license
289
289
  * Copyright 2017 Google LLC
290
290
  * SPDX-License-Identifier: BSD-3-Clause
291
- */function Nl({context:s}){return(e,t)=>{const n=new WeakMap;if(typeof t=="object")return{get(){return e.get.call(this)},set(i){return n.get(this).setValue(i),e.set.call(this,i)},init(i){return n.set(this,new pi(this,{context:s,initialValue:i})),i}};{e.constructor.addInitializer(o=>{n.set(o,new pi(o,{context:s}))});const i=Object.getOwnPropertyDescriptor(e,t);let r;if(i===void 0){const o=new WeakMap;r={get(){return o.get(this)},set(a){n.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=i.set;r={...i,set(a){n.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(e,t,r)}}}/**
291
+ */function lh({context:n}){return(e,t)=>{const i=new WeakMap;if(typeof t=="object")return{get(){return e.get.call(this)},set(s){return i.get(this).setValue(s),e.set.call(this,s)},init(s){return i.set(this,new oo(this,{context:n,initialValue:s})),s}};{e.constructor.addInitializer(o=>{i.set(o,new oo(o,{context:n}))});const s=Object.getOwnPropertyDescriptor(e,t);let r;if(s===void 0){const o=new WeakMap;r={get(){return o.get(this)},set(a){i.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=s.set;r={...s,set(a){i.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(e,t,r)}}}/**
292
292
  * @license
293
293
  * Copyright 2022 Google LLC
294
294
  * SPDX-License-Identifier: BSD-3-Clause
295
- */function ne({context:s,subscribe:e}){return(t,n)=>{typeof n=="object"?n.addInitializer(function(){new di(this,{context:s,callback:i=>{t.set.call(this,i)},subscribe:e})}):t.constructor.addInitializer(i=>{new di(i,{context:s,callback:r=>{i[n]=r},subscribe:e})})}}var Bl=Object.defineProperty,wr=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&Bl(e,t,i),i};const Q="application",is=class is extends w{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=Z(),this.fullscreen=!1,this.isReady=new H(!1)}addChild(e){e.parent=this,this.nodes.push(e)}applyBranding(){if(!this.wrapperRef.value)return;const e=this.application.settings;e!=null&&e.branding&&yr(e.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const e=this.application.styles(),t=this.wrapperRef.value;Object.entries(e).forEach(([n,i])=>{t.style.setProperty(`--${n}`,i)})}firstUpdated(e){this.applyBranding(),this.applyStyles()}render(){var n,i;const e=this.application.settings.components.conversation;return((i=(n=e==null?void 0:e.properties)==null?void 0:n.chat)==null?void 0:i.isThirdPartyWidget)?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===Ye.Trigger&&(this.renderRoot.host.classList.add("floating"),this.application.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.application.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right")),this.application.fullscreen&&this.renderRoot.host.classList.add("fullscreen"),window.self!==window.top&&this.renderRoot.host.classList.add("embedded"),g`<div class="widget-container" ${W(this.wrapperRef)}>
296
- ${jl(this.nodes,r=>r)}
297
- </div>`}};is.styles=C`
295
+ */function Te({context:n,subscribe:e}){return(t,i)=>{typeof i=="object"?i.addInitializer(function(){new ro(this,{context:n,callback:s=>{t.set.call(this,s)},subscribe:e})}):t.constructor.addInitializer(s=>{new ro(s,{context:n,callback:r=>{s[i]=r},subscribe:e})})}}var ch=Object.defineProperty,_a=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&ch(e,t,s),s};const ge="application",Ts=class Ts extends E{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=de(),this.fullscreen=!1,this.isReady=new ae(!1)}addChild(e){e.parent=this,this.nodes.push(e)}applyBranding(){if(!this.wrapperRef.value)return;const e=this.application.settings;e!=null&&e.branding&&xa(e.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const e=this.application.styles(),t=this.wrapperRef.value;Object.entries(e).forEach(([i,s])=>{t.style.setProperty(`--${i}`,s)})}firstUpdated(e){this.applyBranding(),this.applyStyles()}render(){var i,s;const e=this.application.settings.components.conversation;return((s=(i=e==null?void 0:e.properties)==null?void 0:i.chat)==null?void 0:s.isThirdPartyWidget)?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===Bt.Trigger&&(this.renderRoot.host.classList.add("floating"),this.application.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.application.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right")),this.application.fullscreen&&this.renderRoot.host.classList.add("fullscreen"),window.self!==window.top&&this.renderRoot.host.classList.add("embedded"),y`<div class="widget-container" ${pe(this.wrapperRef)}>
296
+ ${rh(this.nodes,r=>r)}
297
+ </div>`}};Ts.styles=T`
298
298
  :host {
299
299
  --font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
300
300
  --spacing-xs: 0.2rem;
@@ -459,24 +459,24 @@
459
459
  :host(.expanded.embedded) {
460
460
  animation: none;
461
461
  }
462
- `;let Xe=is;wr([b({attribute:!0})],Xe.prototype,"fullscreen");wr([b({attribute:!1}),Nl({context:Q})],Xe.prototype,"application");const Bt=class Bt{constructor(e=Bt.endpoint){this._endpoint=e}async getSite(e){const n=await(await fetch(e)).json();return n?{id:n.id,triggers:n.triggers||[],apps:(n.widgets||[]).map(i=>{let r=Ye.Trigger;i.renderStrategy.toLowerCase()==="inline"&&(r=Ye.Inline);const o=i.widgetId?i.widgetId:i.id,a=typeof i.autoActivate=="boolean"?i.autoActivate:!1,l=typeof i.anchor=="string"?i.anchor:"BottomRight",c=typeof i.triggerIcon=="string"?i.triggerIcon:"question";return{id:o,widgetId:o,renderStrategy:r,autoActivate:a,anchor:l,triggerIcon:{type:"Telia",content:c}}})}:null}async getWidget(e){const n=await(await fetch(`${this._endpoint}/widget/${e}`)).json();return n?{name:n.name,config:JSON.parse(n.configuration)}:null}};Bt.endpoint="https://widgets.ace.teliacompany.net/api";let fi=Bt;var Hl=Object.defineProperty,Bn=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&Hl(e,t,i),i};const rs=class rs extends w{constructor(){super(),this.status="deactivated",this.addEventListener("environment-created",this.onEnvironmentCreated)}async connectedCallback(){super.connectedCallback(),await this.getGlobalEnvironment()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("environment-created",this.onEnvironmentCreated)}async onEnvironmentCreated(e){this.widget=e.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const e=globalThis.widgets;e&&(this.widget=e.applications.find(t=>t.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return v;if(this.widget.renderStrategy===Ye.Trigger){const e=new ee;return e.application=this.widget,e}return this.widget.render()}};rs.styles=[C`
462
+ `;let qt=Ts;_a([k({attribute:!0})],qt.prototype,"fullscreen");_a([k({attribute:!1}),lh({context:ge})],qt.prototype,"application");const qn=class qn{constructor(e=qn.endpoint){this._endpoint=e}async getSite(e){const i=await(await fetch(e)).json();return i?{id:i.id,triggers:i.triggers||[],apps:(i.widgets||[]).map(s=>{let r=Bt.Trigger;s.renderStrategy.toLowerCase()==="inline"&&(r=Bt.Inline);const o=s.widgetId?s.widgetId:s.id,a=typeof s.autoActivate=="boolean"?s.autoActivate:!1,l=typeof s.anchor=="string"?s.anchor:"BottomRight",c=typeof s.triggerIcon=="string"?s.triggerIcon:"question";return{id:o,widgetId:o,renderStrategy:r,autoActivate:a,anchor:l,triggerIcon:{type:"Telia",content:c}}})}:null}async getWidget(e){const i=await(await fetch(`${this._endpoint}/widget/${e}`)).json();return i?{name:i.name,config:JSON.parse(i.configuration)}:null}};qn.endpoint="https://widgets.ace.teliacompany.net/api";let ao=qn;var uh=Object.defineProperty,ds=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&uh(e,t,s),s};const Os=class Os extends E{constructor(){super(),this.status="deactivated",this.addEventListener("environment-created",this.onEnvironmentCreated)}async connectedCallback(){super.connectedCallback(),await this.getGlobalEnvironment()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("environment-created",this.onEnvironmentCreated)}async onEnvironmentCreated(e){this.widget=e.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const e=globalThis.widgets;e&&(this.widget=e.applications.find(t=>t.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return w;if(this.widget.renderStrategy===Bt.Trigger){const e=new Ee;return e.application=this.widget,e}return this.widget.render()}};Os.styles=[T`
463
463
  :host {
464
464
  display: block;
465
465
  }
466
- `];let Ie=rs;Bn([b({attribute:!0})],Ie.prototype,"name");Bn([S()],Ie.prototype,"widget");Bn([S()],Ie.prototype,"status");customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",Et);customElements.get("ace-trigger")||customElements.define("ace-trigger",ee);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",yn);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",Xe);customElements.get("ace-widget")||customElements.define("ace-widget",Ie);class ql{constructor(e){this._message=null,this._host=e,e.addController(this)}hostConnected(){}set message(e){this._message=e,this._host.requestUpdate()}get message(){return this._message}hasMessage(){return!!this.message}}class gi{constructor(e,t,n,i,r){this.id=e,this.providerKey=t,this.providerOptions=n,this.component=r,this.provider$=new H(null),this.entries$=new H([]),this.removeEntryAction$=new _,this.kill$=new _,this.isTyping$=new H(!1),this.data$=new H({}),this.complete$=this.provider$.pipe(Y(l=>l?l.onComplete():$e));const o=this._getProviderFactory(t);if(!o)throw new Error(`No provider with key "${t}" was found.`);this.data$.next(i);const a=o(this.component);this.provider$.next(a),a.actions().pipe(O(this.kill$)).subscribe(l=>{this.write(l)}),a.isTyping().pipe(O(this.kill$)).subscribe(l=>{this.isTyping$.next(l)})}start(){const e=this.provider$.value;if(!e)throw new Error("No provider bound to session.");e.saveToCurrentSession$.subscribe(t=>{this.data$.next(t)}),e.connect(this.providerOptions)}entries(){return this.entries$.asObservable()}rehydrate(){var e;(e=this.provider$.value)==null||e.rehydrate(this.data$.value)}toStore(){return{id:this.id,providerKey:this.providerKey,providerOptions:this.providerOptions,data:this.data$.value}}write(e){this._addEntryRemoveHandler(e),this.entries$.pipe(V(1)).subscribe(t=>{this.entries$.next([...t,e])})}_addEntryRemoveHandler(e){e.remove$.pipe(Y(()=>this.entries$),V(1)).subscribe(t=>{this.removeEntryAction$.next(e),this.entries$.next(t.filter(n=>n!==e))})}_getProviderFactory(e){return this.component.platform.registeredProviders.get(e)}}class Fl{constructor(e){this.component=e,this.currentSession$=new H(null),this.sessions=[],this.storage=null,yt(e,"handover").subscribe(t=>{const n=this._createNewSession(t.detail.providerKey,t.detail.providerOptions);this._setSession(n),t.detail.complete=n.complete$,n.start()})}loadFromStorage(){const e=this._getStoredSessions();this.sessions=e.sessions,this.sessions.forEach(t=>{this._setSession(t),t.rehydrate()}),this.save(e)}startSession(){const e=this._getStoredSessions();let t=null;if(e.sessions.length)t=e.sessions[e.sessions.length-1];else{const n=this._getInitialProviderKey(),i={};t=this._createNewSession(n,i)}this._setSession(t),t.start()}setStorageService(e){this.storage=e}currentSession(){return this.currentSession$.asObservable()}_getStoredSessions(){if(!this.storage)throw new Error("Could not locate StorageService in SessionService.");if(this.sessions.length)return{sessions:this.sessions};const e=this.storage.get("conversation");return e?{sessions:e.sessions.map(t=>new gi(t.id,t.providerKey,t.providerOptions,t.data,this.component))}:{sessions:[]}}_setSession(e){this.currentSession$.next(e),e.data$.subscribe(()=>{this._saveSession(e)})}_saveSession(e){let t=this._getStoredSessions();const n=t.sessions.findIndex(i=>i.id===e.id);n>-1?t={sessions:[...t.sessions.slice(0,n),e,...t.sessions.slice(n+1)]}:t.sessions.push(e),this.save(t)}save(e){if(!this.storage)throw new Error("Could not locate StorageService in SessionService.");const t={sessions:e.sessions.map(n=>n.toStore())};this.storage.set("conversation",t)}_createNewSession(e,t={}){const n=this._getStoredSessions(),i=new gi(Hi(),e,t,{},this.component);return n.sessions.push(i),this.save(n),i}_getInitialProviderKey(){var e;if(!((e=this.component.properties.providers)!=null&&e.length))throw new Error("No providers registered on conversation component.");return this.component.properties.providers[0]}}class Vl{constructor(e,t){this.state$=e,this.component=t,this.entries$=new H([]),this.session=()=>this.session$,this.isTyping=()=>this.isTyping$,this.entries=()=>this.entries$.asObservable(),this.sessionService=new Fl(this.component),this.session$=this.sessionService.currentSession(),this.isTyping$=this.session$.pipe(Y(n=>n?n.provider$.pipe(Y(i=>i?i.isTyping():cn(!1))):cn(!1))),e.subscribe(n=>{switch(n){case"init":this.initialize();break;case"rehydrating":this.rehydrate();break;case"connected":this.connected();break}})}setStorage(e){var t;(t=this.sessionService)==null||t.setStorageService(e)}initialize(){this.state$.next("rehydrating")}rehydrate(){this.session$.pipe(Y(e=>{if(!e)return $e;const t=e.removeEntryAction$.pipe(un(this.entries$)).pipe(bt(([i,r])=>r.filter(o=>o.id!==i.id))),n=e.entries().pipe(bt(i=>{const r=this.entries$.value,o=i.filter(a=>r.findIndex(l=>l.id===a.id)===-1);return[...r,...o]}));return Ho(t,n)})).subscribe(e=>{this.entries$.next(e)}),this.sessionService.loadFromStorage(),this.state$.next("connected")}connected(){var e;(e=this.sessionService)==null||e.startSession()}}var Zl=Object.defineProperty,Wl=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&Zl(e,t,i),i};const os=class os extends w{connectedCallback(){var e;super.connectedCallback(),(e=this.entry.didUpdate)==null||e.subscribe(()=>{this.requestUpdate()})}_getTimestamp(e){return new Date(e).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hourCycle:"h23"})}_renderTimestamp(e,t){if(!e&&!t)return v;let n="";return e?t?n=`${e}: ${this._getTimestamp(t)}`:n=e:t&&(n=this._getTimestamp(t)),g`<p class="conversation-timestamp">${n}</p>`}_renderDeliveryStatus(e){return e==="delivered"?g`<telia-icon
467
- svg=${ma.svg}
466
+ `];let bt=Os;ds([k({attribute:!0})],bt.prototype,"name");ds([O()],bt.prototype,"widget");ds([O()],bt.prototype,"status");customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",On);customElements.get("ace-trigger")||customElements.define("ace-trigger",Ee);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",ji);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",qt);customElements.get("ace-widget")||customElements.define("ace-widget",bt);class hh{constructor(e){this._message=null,this._host=e,e.addController(this)}hostConnected(){}set message(e){this._message=e,this._host.requestUpdate()}get message(){return this._message}hasMessage(){return!!this.message}}class lo{constructor(e,t,i,s,r){this.id=e,this.providerKey=t,this.providerOptions=i,this.component=r,this.provider$=new ae(null),this.entries$=new ae([]),this.removeEntryAction$=new P,this.kill$=new P,this.isTyping$=new ae(!1),this.data$=new ae({}),this.complete$=this.provider$.pipe(_e(l=>l?l.onComplete():Xe));const o=this._getProviderFactory(t);if(!o)throw new Error(`No provider with key "${t}" was found.`);this.data$.next(s);const a=o(this.component);this.provider$.next(a),a.actions().pipe(B(this.kill$)).subscribe(l=>{this.write(l)}),a.isTyping().pipe(B(this.kill$)).subscribe(l=>{this.isTyping$.next(l)})}start(){const e=this.provider$.value;if(!e)throw new Error("No provider bound to session.");e.saveToCurrentSession$.subscribe(t=>{this.data$.next(t)}),e.connect(this.providerOptions)}entries(){return this.entries$.asObservable()}rehydrate(){var e;(e=this.provider$.value)==null||e.rehydrate(this.data$.value)}toStore(){return{id:this.id,providerKey:this.providerKey,providerOptions:this.providerOptions,data:this.data$.value}}write(e){this._addEntryRemoveHandler(e),this.entries$.pipe(he(1)).subscribe(t=>{this.entries$.next([...t,e])})}_addEntryRemoveHandler(e){e.remove$.pipe(_e(()=>this.entries$),he(1)).subscribe(t=>{this.removeEntryAction$.next(e),this.entries$.next(t.filter(i=>i!==e))})}_getProviderFactory(e){return this.component.platform.registeredProviders.get(e)}}class dh{constructor(e){this.component=e,this.currentSession$=new ae(null),this.sessions=[],this.storage=null,xn(e,"handover").subscribe(t=>{const i=this._createNewSession(t.detail.providerKey,t.detail.providerOptions);this._setSession(i),t.detail.complete=i.complete$,i.start()})}loadFromStorage(){const e=this._getStoredSessions();this.sessions=e.sessions,this.sessions.forEach(t=>{this._setSession(t),t.rehydrate()}),this.save(e)}startSession(){const e=this._getStoredSessions();let t=null;if(e.sessions.length)t=e.sessions[e.sessions.length-1];else{const i=this._getInitialProviderKey(),s={};t=this._createNewSession(i,s)}this._setSession(t),t.start()}setStorageService(e){this.storage=e}currentSession(){return this.currentSession$.asObservable()}_getStoredSessions(){if(!this.storage)throw new Error("Could not locate StorageService in SessionService.");if(this.sessions.length)return{sessions:this.sessions};const e=this.storage.get("conversation");return e?{sessions:e.sessions.map(t=>new lo(t.id,t.providerKey,t.providerOptions,t.data,this.component))}:{sessions:[]}}_setSession(e){this.currentSession$.next(e),e.data$.subscribe(()=>{this._saveSession(e)})}_saveSession(e){let t=this._getStoredSessions();const i=t.sessions.findIndex(s=>s.id===e.id);i>-1?t={sessions:[...t.sessions.slice(0,i),e,...t.sessions.slice(i+1)]}:t.sessions.push(e),this.save(t)}save(e){if(!this.storage)throw new Error("Could not locate StorageService in SessionService.");const t={sessions:e.sessions.map(i=>i.toStore())};this.storage.set("conversation",t)}_createNewSession(e,t={}){const i=this._getStoredSessions(),s=new lo(Vo(),e,t,{},this.component);return i.sessions.push(s),this.save(i),s}_getInitialProviderKey(){var e;if(!((e=this.component.properties.providers)!=null&&e.length))throw new Error("No providers registered on conversation component.");return this.component.properties.providers[0]}}class ph{constructor(e,t){this.state$=e,this.component=t,this.entries$=new ae([]),this.session=()=>this.session$,this.isTyping=()=>this.isTyping$,this.entries=()=>this.entries$.asObservable(),this.sessionService=new dh(this.component),this.session$=this.sessionService.currentSession(),this.isTyping$=this.session$.pipe(_e(i=>i?i.provider$.pipe(_e(s=>s?s.isTyping():Oi(!1))):Oi(!1))),e.subscribe(i=>{switch(i){case"init":this.initialize();break;case"rehydrating":this.rehydrate();break;case"connected":this.connected();break}})}setStorage(e){var t;(t=this.sessionService)==null||t.setStorageService(e)}initialize(){this.state$.next("rehydrating")}rehydrate(){this.session$.pipe(_e(e=>{if(!e)return Xe;const t=e.removeEntryAction$.pipe(Ri(this.entries$)).pipe(wn(([s,r])=>r.filter(o=>o.id!==s.id))),i=e.entries().pipe(wn(s=>{const r=this.entries$.value,o=s.filter(a=>r.findIndex(l=>l.id===a.id)===-1);return[...r,...o]}));return uc(t,i)})).subscribe(e=>{this.entries$.next(e)}),this.sessionService.loadFromStorage(),this.state$.next("connected")}connected(){var e;(e=this.sessionService)==null||e.startSession()}}var fh=Object.defineProperty,gh=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&fh(e,t,s),s};const Ls=class Ls extends E{connectedCallback(){var e;super.connectedCallback(),(e=this.entry.didUpdate)==null||e.subscribe(()=>{this.requestUpdate()})}_getTimestamp(e){return new Date(e).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hourCycle:"h23"})}_renderTimestamp(e,t){if(!e&&!t)return w;let i="";return e?t?i=`${e}: ${this._getTimestamp(t)}`:i=e:t&&(i=this._getTimestamp(t)),y`<p class="conversation-timestamp">${i}</p>`}_renderDeliveryStatus(e){return e==="delivered"?y`<telia-icon
467
+ svg=${Nc.svg}
468
468
  size="sm"
469
- ></telia-icon>`:e==="failed"?g`<telia-icon
470
- svg=${ga.svg}
469
+ ></telia-icon>`:e==="failed"?y`<telia-icon
470
+ svg=${Uc.svg}
471
471
  size="sm"
472
472
  title="Message could not be delivered"
473
- ></telia-icon>`:g`<telia-icon svg=${va.svg} size="sm"></telia-icon>`}_dispatchEntryAction(e){this.entry.actions$.next(e.detail)}render(){var e,t;switch(this.entry.type){case A.System:return g`
473
+ ></telia-icon>`:y`<telia-icon svg=${zc.svg} size="sm"></telia-icon>`}_dispatchEntryAction(e){this.entry.actions$.next(e.detail)}render(){var e,t;switch(this.entry.type){case z.System:return y`
474
474
  <div class="conversation-system-message">
475
- ${this.entry.messages.map(n=>g`
475
+ ${this.entry.messages.map(i=>y`
476
476
  <div class="message-container">
477
477
  <div class="message-content">
478
478
  <conversation-group
479
- .group=${n}
479
+ .group=${i}
480
480
  @action=${this._dispatchEntryAction}
481
481
  ></conversation-group>
482
482
  </div>
@@ -484,18 +484,18 @@
484
484
  `)}
485
485
  <span>${this._getTimestamp(this.entry.timestamp)}</span>
486
486
  </div>
487
- `;case A.Agent:return g`<div
488
- class=${Re({"conversation-agent-message":!0,"has-avatar":!!((e=this.entry.sender)!=null&&e.avatar)})}
487
+ `;case z.Agent:return y`<div
488
+ class=${vt({"conversation-agent-message":!0,"has-avatar":!!((e=this.entry.sender)!=null&&e.avatar)})}
489
489
  >
490
- ${typeof((t=this.entry.sender)==null?void 0:t.avatar)=="string"?g`<div class="avatar">
490
+ ${typeof((t=this.entry.sender)==null?void 0:t.avatar)=="string"?y`<div class="avatar">
491
491
  <img src=${this.entry.sender.avatar} />
492
- </div>`:v}
492
+ </div>`:w}
493
493
 
494
494
  <div class="entry-content">
495
- ${this.entry.messages.map(n=>g`
495
+ ${this.entry.messages.map(i=>y`
496
496
  <div class="message-container">
497
497
  <div class="message-content">
498
- <conversation-group .group=${n}></conversation-group>
498
+ <conversation-group .group=${i}></conversation-group>
499
499
  </div>
500
500
  </div>
501
501
  `)}
@@ -503,14 +503,14 @@
503
503
  <div class="message-details">
504
504
  ${this._renderTimestamp(this.entry.sender.name||"",this.entry.timestamp)}
505
505
  </div>
506
- </div>`;case A.User:return g`<div
507
- class=${Re({"conversation-user-message":!0,"has-error":this.entry.status==="failed"})}
506
+ </div>`;case z.User:return y`<div
507
+ class=${vt({"conversation-user-message":!0,"has-error":this.entry.status==="failed"})}
508
508
  >
509
509
  <div class="entry-content">
510
- ${this.entry.messages.map(n=>g`
510
+ ${this.entry.messages.map(i=>y`
511
511
  <div class="message-container">
512
512
  <div class="message-content">
513
- <conversation-group .group=${n}></conversation-group>
513
+ <conversation-group .group=${i}></conversation-group>
514
514
  </div>
515
515
  </div>
516
516
  `)}
@@ -519,7 +519,7 @@
519
519
  ${this._renderTimestamp(this.entry.sender.name||"",this.entry.timestamp)}
520
520
  ${this._renderDeliveryStatus(this.entry.status)}
521
521
  </div>
522
- </div>`;default:return v}}};os.styles=[C`
522
+ </div>`;default:return w}}};Ls.styles=[T`
523
523
  :host {
524
524
  box-sizing: border-box;
525
525
  display: inline;
@@ -639,18 +639,18 @@
639
639
  .entry-content {
640
640
  grid-area: content;
641
641
  }
642
- `];let At=os;Wl([b({attribute:!1})],At.prototype,"entry");var Gl=Object.defineProperty,kr=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&Gl(e,t,i),i};const as=class as extends w{constructor(){super(...arguments),this.entries=[],this.loading=!0}updated(e){const t=new CustomEvent("updated",{});this.dispatchEvent(t)}render(){return g`<div class="conversation-feed">
643
- ${this.entries.map(e=>g`<div class="conversation-entry" tabindex="-1">
642
+ `];let Ln=Ls;gh([k({attribute:!1})],Ln.prototype,"entry");var mh=Object.defineProperty,Ca=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&mh(e,t,s),s};const Rs=class Rs extends E{constructor(){super(...arguments),this.entries=[],this.loading=!0}updated(e){const t=new CustomEvent("updated",{});this.dispatchEvent(t)}render(){return y`<div class="conversation-feed">
643
+ ${this.entries.map(e=>y`<div class="conversation-entry" tabindex="-1">
644
644
  <conversation-entry
645
645
  .entry=${e}
646
- ${bn({keyframeOptions:{},in:li,stabilizeOut:!0,skipInitial:!1})}
646
+ ${zi({keyframeOptions:{},in:to,stabilizeOut:!0,skipInitial:!1})}
647
647
  >
648
648
  </conversation-entry>
649
649
  </div>`)}
650
- ${this.loading?g`<ace-typing-state
651
- ${bn({keyframeOptions:{},in:li,out:Ll,stabilizeOut:!0,skipInitial:!1})}
652
- ></ace-typing-state>`:v}
653
- </div>`}};as.styles=[C`
650
+ ${this.loading?y`<ace-typing-state
651
+ ${zi({keyframeOptions:{},in:to,out:Ju,stabilizeOut:!0,skipInitial:!1})}
652
+ ></ace-typing-state>`:w}
653
+ </div>`}};Rs.styles=[T`
654
654
  :host {
655
655
  display: block;
656
656
  }
@@ -666,17 +666,17 @@
666
666
  .conversation-entry:focus {
667
667
  outline-color: var(--focus-color);
668
668
  }
669
- `];let et=as;kr([b({attribute:!1})],et.prototype,"entries");kr([b({type:Boolean})],et.prototype,"loading");/**
669
+ `];let Vt=Rs;Ca([k({attribute:!1})],Vt.prototype,"entries");Ca([k({type:Boolean})],Vt.prototype,"loading");/**
670
670
  * @license
671
671
  * Copyright 2021 Google LLC
672
672
  * SPDX-License-Identifier: BSD-3-Clause
673
- */const Ql=(s,e,t)=>{for(const n of e)if(n[0]===s)return(0,n[1])();return t==null?void 0:t()};var Kl=Object.defineProperty,Jl=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&Kl(e,t,i),i};const ls=class ls extends w{render(){return g`
673
+ */const vh=(n,e,t)=>{for(const i of e)if(i[0]===n)return(0,i[1])();return t==null?void 0:t()};var bh=Object.defineProperty,yh=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&bh(e,t,s),s};const Is=class Is extends E{render(){return y`
674
674
  <div class="message-group">
675
- ${this.group.items.map(([e,t,n])=>g`
676
- ${Ql(e,[["html",()=>g`<message-type-html .message=${t} />`],["markdown",()=>g`<message-type-markdown .message=${t} />`]],()=>{const i=customElements.get(e);if(!i)return v;const r=new i(n||null);return g`${r}`})}
675
+ ${this.group.items.map(([e,t,i])=>y`
676
+ ${vh(e,[["html",()=>y`<message-type-html .message=${t} />`],["markdown",()=>y`<message-type-markdown .message=${t} />`]],()=>{const s=customElements.get(e);if(!s)return w;const r=new s(i||null);return y`${r}`})}
677
677
  `)}
678
678
  </div>
679
- `}};ls.styles=[C`
679
+ `}};Is.styles=[T`
680
680
  :host {
681
681
  box-sizing: border-box;
682
682
  display: block;
@@ -689,11 +689,11 @@
689
689
  flex-direction: column;
690
690
  gap: var(--spacing-md);
691
691
  }
692
- `];let Tt=ls;Jl([b({attribute:!1})],Tt.prototype,"group");const cs=class cs extends w{render(){return g`<div class="container">
692
+ `];let Rn=Is;yh([k({attribute:!1})],Rn.prototype,"group");const Ps=class Ps extends E{render(){return y`<div class="container">
693
693
  <div class="dot"></div>
694
694
  <div class="dot"></div>
695
695
  <div class="dot"></div>
696
- </div>`}};cs.styles=[C`
696
+ </div>`}};Ps.styles=[T`
697
697
  :host {
698
698
  display: block;
699
699
  }
@@ -727,13 +727,14 @@
727
727
  opacity: 1;
728
728
  }
729
729
  }
730
- `];let $n=cs;/**
730
+ `];let Hi=Ps;/**
731
731
  * @license
732
732
  * Copyright 2017 Google LLC
733
733
  * SPDX-License-Identifier: BSD-3-Clause
734
- */class xn extends Zt{constructor(e){if(super(e),this.it=v,e.type!==at.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===v||e==null)return this._t=void 0,this.it=e;if(e===X)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}xn.directiveName="unsafeHTML",xn.resultType=1;const Yl=lt(xn);var Xl=Object.defineProperty,ec=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&Xl(e,t,i),i};const hs=class hs extends w{render(){return g`<div class="message-type-html">
735
- ${Yl(this.message.content)}
736
- </div>`}};hs.styles=[C`
734
+ */class Fi extends Yn{constructor(e){if(super(e),this.it=w,e.type!==Kt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===w||e==null)return this._t=void 0,this.it=e;if(e===Ce)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Fi.directiveName="unsafeHTML",Fi.resultType=1;const $h=Jt(Fi);/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:Ea,setPrototypeOf:co,isFrozen:wh,getPrototypeOf:xh,getOwnPropertyDescriptor:kh}=Object;let{freeze:Y,seal:te,create:Aa}=Object,{apply:Bi,construct:qi}=typeof Reflect<"u"&&Reflect;Y||(Y=function(e){return e});te||(te=function(e){return e});Bi||(Bi=function(e,t,i){return e.apply(t,i)});qi||(qi=function(e,t){return new e(...t)});const dn=Q(Array.prototype.forEach),Sh=Q(Array.prototype.lastIndexOf),uo=Q(Array.prototype.pop),At=Q(Array.prototype.push),_h=Q(Array.prototype.splice),vn=Q(String.prototype.toLowerCase),xi=Q(String.prototype.toString),ho=Q(String.prototype.match),Tt=Q(String.prototype.replace),Ch=Q(String.prototype.indexOf),Eh=Q(String.prototype.trim),re=Q(Object.prototype.hasOwnProperty),V=Q(RegExp.prototype.test),Ot=Ah(TypeError);function Q(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return Bi(n,e,i)}}function Ah(n){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return qi(n,t)}}function x(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vn;co&&co(n,null);let i=e.length;for(;i--;){let s=e[i];if(typeof s=="string"){const r=t(s);r!==s&&(wh(e)||(e[i]=r),s=r)}n[s]=!0}return n}function Th(n){for(let e=0;e<n.length;e++)re(n,e)||(n[e]=null);return n}function xe(n){const e=Aa(null);for(const[t,i]of Ea(n))re(n,t)&&(Array.isArray(i)?e[t]=Th(i):i&&typeof i=="object"&&i.constructor===Object?e[t]=xe(i):e[t]=i);return e}function Lt(n,e){for(;n!==null;){const i=kh(n,e);if(i){if(i.get)return Q(i.get);if(typeof i.value=="function")return Q(i.value)}n=xh(n)}function t(){return null}return t}const po=Y(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ki=Y(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Si=Y(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Oh=Y(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),_i=Y(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Lh=Y(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fo=Y(["#text"]),go=Y(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ci=Y(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mo=Y(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),pn=Y(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Rh=te(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ih=te(/<%[\w\W]*|[\w\W]*%>/gm),Ph=te(/\$\{[\w\W]*/gm),Mh=te(/^data-[\-\w.\u00B7-\uFFFF]+$/),Dh=te(/^aria-[\-\w]+$/),Ta=te(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Uh=te(/^(?:\w+script|data):/i),Nh=te(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Oa=te(/^html$/i),zh=te(/^[a-z][.\w]*(-[.\w]+)+$/i);var vo=Object.freeze({__proto__:null,ARIA_ATTR:Dh,ATTR_WHITESPACE:Nh,CUSTOM_ELEMENT:zh,DATA_ATTR:Mh,DOCTYPE_NAME:Oa,ERB_EXPR:Ih,IS_ALLOWED_URI:Ta,IS_SCRIPT_OR_DATA:Uh,MUSTACHE_EXPR:Rh,TMPLIT_EXPR:Ph});const Rt={element:1,text:3,progressingInstruction:7,comment:8,document:9},jh=function(){return typeof window>"u"?null:window},Hh=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(i=t.getAttribute(s));const r="dompurify"+(i?"#"+i:"");try{return e.createPolicy(r,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},bo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function La(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:jh();const e=b=>La(b);if(e.version="3.2.6",e.removed=[],!n||!n.document||n.document.nodeType!==Rt.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const i=t,s=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:p,DOMParser:d,trustedTypes:g}=n,m=l.prototype,$=Lt(m,"cloneNode"),me=Lt(m,"remove"),se=Lt(m,"nextSibling"),Le=Lt(m,"childNodes"),Ue=Lt(m,"parentNode");if(typeof o=="function"){const b=t.createElement("template");b.content&&b.content.ownerDocument&&(t=b.content.ownerDocument)}let M,Ne="";const{implementation:ze,createNodeIterator:je,createDocumentFragment:Za,getElementsByTagName:Ya}=t,{importNode:Qa}=i;let q=bo();e.isSupported=typeof Ea=="function"&&typeof Ue=="function"&&ze&&ze.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Kn,ERB_EXPR:Jn,TMPLIT_EXPR:ei,DATA_ATTR:Xa,ARIA_ATTR:Ka,IS_SCRIPT_OR_DATA:Ja,ATTR_WHITESPACE:Ys,CUSTOM_ELEMENT:el}=vo;let{IS_ALLOWED_URI:Qs}=vo,D=null;const Xs=x({},[...po,...ki,...Si,..._i,...fo]);let N=null;const Ks=x({},[...go,...Ci,...mo,...pn]);let R=Object.seal(Aa(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),kt=null,ti=null,Js=!0,ni=!0,er=!1,tr=!0,et=!1,nn=!0,He=!1,ii=!1,si=!1,tt=!1,sn=!1,rn=!1,nr=!0,ir=!1;const tl="user-content-";let ri=!0,St=!1,nt={},it=null;const sr=x({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let rr=null;const or=x({},["audio","video","img","source","image","track"]);let oi=null;const ar=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),on="http://www.w3.org/1998/Math/MathML",an="http://www.w3.org/2000/svg",ve="http://www.w3.org/1999/xhtml";let st=ve,ai=!1,li=null;const nl=x({},[on,an,ve],xi);let ln=x({},["mi","mo","mn","ms","mtext"]),cn=x({},["annotation-xml"]);const il=x({},["title","style","font","a","script"]);let _t=null;const sl=["application/xhtml+xml","text/html"],rl="text/html";let U=null,rt=null;const ol=t.createElement("form"),lr=function(h){return h instanceof RegExp||h instanceof Function},ci=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(rt&&rt===h)){if((!h||typeof h!="object")&&(h={}),h=xe(h),_t=sl.indexOf(h.PARSER_MEDIA_TYPE)===-1?rl:h.PARSER_MEDIA_TYPE,U=_t==="application/xhtml+xml"?xi:vn,D=re(h,"ALLOWED_TAGS")?x({},h.ALLOWED_TAGS,U):Xs,N=re(h,"ALLOWED_ATTR")?x({},h.ALLOWED_ATTR,U):Ks,li=re(h,"ALLOWED_NAMESPACES")?x({},h.ALLOWED_NAMESPACES,xi):nl,oi=re(h,"ADD_URI_SAFE_ATTR")?x(xe(ar),h.ADD_URI_SAFE_ATTR,U):ar,rr=re(h,"ADD_DATA_URI_TAGS")?x(xe(or),h.ADD_DATA_URI_TAGS,U):or,it=re(h,"FORBID_CONTENTS")?x({},h.FORBID_CONTENTS,U):sr,kt=re(h,"FORBID_TAGS")?x({},h.FORBID_TAGS,U):xe({}),ti=re(h,"FORBID_ATTR")?x({},h.FORBID_ATTR,U):xe({}),nt=re(h,"USE_PROFILES")?h.USE_PROFILES:!1,Js=h.ALLOW_ARIA_ATTR!==!1,ni=h.ALLOW_DATA_ATTR!==!1,er=h.ALLOW_UNKNOWN_PROTOCOLS||!1,tr=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,et=h.SAFE_FOR_TEMPLATES||!1,nn=h.SAFE_FOR_XML!==!1,He=h.WHOLE_DOCUMENT||!1,tt=h.RETURN_DOM||!1,sn=h.RETURN_DOM_FRAGMENT||!1,rn=h.RETURN_TRUSTED_TYPE||!1,si=h.FORCE_BODY||!1,nr=h.SANITIZE_DOM!==!1,ir=h.SANITIZE_NAMED_PROPS||!1,ri=h.KEEP_CONTENT!==!1,St=h.IN_PLACE||!1,Qs=h.ALLOWED_URI_REGEXP||Ta,st=h.NAMESPACE||ve,ln=h.MATHML_TEXT_INTEGRATION_POINTS||ln,cn=h.HTML_INTEGRATION_POINTS||cn,R=h.CUSTOM_ELEMENT_HANDLING||{},h.CUSTOM_ELEMENT_HANDLING&&lr(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(R.tagNameCheck=h.CUSTOM_ELEMENT_HANDLING.tagNameCheck),h.CUSTOM_ELEMENT_HANDLING&&lr(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(R.attributeNameCheck=h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(R.allowCustomizedBuiltInElements=h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),et&&(ni=!1),sn&&(tt=!0),nt&&(D=x({},fo),N=[],nt.html===!0&&(x(D,po),x(N,go)),nt.svg===!0&&(x(D,ki),x(N,Ci),x(N,pn)),nt.svgFilters===!0&&(x(D,Si),x(N,Ci),x(N,pn)),nt.mathMl===!0&&(x(D,_i),x(N,mo),x(N,pn))),h.ADD_TAGS&&(D===Xs&&(D=xe(D)),x(D,h.ADD_TAGS,U)),h.ADD_ATTR&&(N===Ks&&(N=xe(N)),x(N,h.ADD_ATTR,U)),h.ADD_URI_SAFE_ATTR&&x(oi,h.ADD_URI_SAFE_ATTR,U),h.FORBID_CONTENTS&&(it===sr&&(it=xe(it)),x(it,h.FORBID_CONTENTS,U)),ri&&(D["#text"]=!0),He&&x(D,["html","head","body"]),D.table&&(x(D,["tbody"]),delete kt.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ot('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ot('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=h.TRUSTED_TYPES_POLICY,Ne=M.createHTML("")}else M===void 0&&(M=Hh(g,s)),M!==null&&typeof Ne=="string"&&(Ne=M.createHTML(""));Y&&Y(h),rt=h}},cr=x({},[...ki,...Si,...Oh]),ur=x({},[..._i,...Lh]),al=function(h){let f=Ue(h);(!f||!f.tagName)&&(f={namespaceURI:st,tagName:"template"});const v=vn(h.tagName),L=vn(f.tagName);return li[h.namespaceURI]?h.namespaceURI===an?f.namespaceURI===ve?v==="svg":f.namespaceURI===on?v==="svg"&&(L==="annotation-xml"||ln[L]):!!cr[v]:h.namespaceURI===on?f.namespaceURI===ve?v==="math":f.namespaceURI===an?v==="math"&&cn[L]:!!ur[v]:h.namespaceURI===ve?f.namespaceURI===an&&!cn[L]||f.namespaceURI===on&&!ln[L]?!1:!ur[v]&&(il[v]||!cr[v]):!!(_t==="application/xhtml+xml"&&li[h.namespaceURI]):!1},ce=function(h){At(e.removed,{element:h});try{Ue(h).removeChild(h)}catch{me(h)}},ot=function(h,f){try{At(e.removed,{attribute:f.getAttributeNode(h),from:f})}catch{At(e.removed,{attribute:null,from:f})}if(f.removeAttribute(h),h==="is")if(tt||sn)try{ce(f)}catch{}else try{f.setAttribute(h,"")}catch{}},hr=function(h){let f=null,v=null;if(si)h="<remove></remove>"+h;else{const I=ho(h,/^[\r\n\t ]+/);v=I&&I[0]}_t==="application/xhtml+xml"&&st===ve&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const L=M?M.createHTML(h):h;if(st===ve)try{f=new d().parseFromString(L,_t)}catch{}if(!f||!f.documentElement){f=ze.createDocument(st,"template",null);try{f.documentElement.innerHTML=ai?Ne:L}catch{}}const H=f.body||f.documentElement;return h&&v&&H.insertBefore(t.createTextNode(v),H.childNodes[0]||null),st===ve?Ya.call(f,He?"html":"body")[0]:He?f.documentElement:H},dr=function(h){return je.call(h.ownerDocument||h,h,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ui=function(h){return h instanceof p&&(typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||!(h.attributes instanceof u)||typeof h.removeAttribute!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function")},pr=function(h){return typeof a=="function"&&h instanceof a};function be(b,h,f){dn(b,v=>{v.call(e,h,f,rt)})}const fr=function(h){let f=null;if(be(q.beforeSanitizeElements,h,null),ui(h))return ce(h),!0;const v=U(h.nodeName);if(be(q.uponSanitizeElement,h,{tagName:v,allowedTags:D}),nn&&h.hasChildNodes()&&!pr(h.firstElementChild)&&V(/<[/\w!]/g,h.innerHTML)&&V(/<[/\w!]/g,h.textContent)||h.nodeType===Rt.progressingInstruction||nn&&h.nodeType===Rt.comment&&V(/<[/\w]/g,h.data))return ce(h),!0;if(!D[v]||kt[v]){if(!kt[v]&&mr(v)&&(R.tagNameCheck instanceof RegExp&&V(R.tagNameCheck,v)||R.tagNameCheck instanceof Function&&R.tagNameCheck(v)))return!1;if(ri&&!it[v]){const L=Ue(h)||h.parentNode,H=Le(h)||h.childNodes;if(H&&L){const I=H.length;for(let X=I-1;X>=0;--X){const ye=$(H[X],!0);ye.__removalCount=(h.__removalCount||0)+1,L.insertBefore(ye,se(h))}}}return ce(h),!0}return h instanceof l&&!al(h)||(v==="noscript"||v==="noembed"||v==="noframes")&&V(/<\/no(script|embed|frames)/i,h.innerHTML)?(ce(h),!0):(et&&h.nodeType===Rt.text&&(f=h.textContent,dn([Kn,Jn,ei],L=>{f=Tt(f,L," ")}),h.textContent!==f&&(At(e.removed,{element:h.cloneNode()}),h.textContent=f)),be(q.afterSanitizeElements,h,null),!1)},gr=function(h,f,v){if(nr&&(f==="id"||f==="name")&&(v in t||v in ol))return!1;if(!(ni&&!ti[f]&&V(Xa,f))){if(!(Js&&V(Ka,f))){if(!N[f]||ti[f]){if(!(mr(h)&&(R.tagNameCheck instanceof RegExp&&V(R.tagNameCheck,h)||R.tagNameCheck instanceof Function&&R.tagNameCheck(h))&&(R.attributeNameCheck instanceof RegExp&&V(R.attributeNameCheck,f)||R.attributeNameCheck instanceof Function&&R.attributeNameCheck(f))||f==="is"&&R.allowCustomizedBuiltInElements&&(R.tagNameCheck instanceof RegExp&&V(R.tagNameCheck,v)||R.tagNameCheck instanceof Function&&R.tagNameCheck(v))))return!1}else if(!oi[f]){if(!V(Qs,Tt(v,Ys,""))){if(!((f==="src"||f==="xlink:href"||f==="href")&&h!=="script"&&Ch(v,"data:")===0&&rr[h])){if(!(er&&!V(Ja,Tt(v,Ys,"")))){if(v)return!1}}}}}}return!0},mr=function(h){return h!=="annotation-xml"&&ho(h,el)},vr=function(h){be(q.beforeSanitizeAttributes,h,null);const{attributes:f}=h;if(!f||ui(h))return;const v={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:N,forceKeepAttr:void 0};let L=f.length;for(;L--;){const H=f[L],{name:I,namespaceURI:X,value:ye}=H,Ct=U(I),hi=ye;let F=I==="value"?hi:Eh(hi);if(v.attrName=Ct,v.attrValue=F,v.keepAttr=!0,v.forceKeepAttr=void 0,be(q.uponSanitizeAttribute,h,v),F=v.attrValue,ir&&(Ct==="id"||Ct==="name")&&(ot(I,h),F=tl+F),nn&&V(/((--!?|])>)|<\/(style|title)/i,F)){ot(I,h);continue}if(v.forceKeepAttr)continue;if(!v.keepAttr){ot(I,h);continue}if(!tr&&V(/\/>/i,F)){ot(I,h);continue}et&&dn([Kn,Jn,ei],yr=>{F=Tt(F,yr," ")});const br=U(h.nodeName);if(!gr(br,Ct,F)){ot(I,h);continue}if(M&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!X)switch(g.getAttributeType(br,Ct)){case"TrustedHTML":{F=M.createHTML(F);break}case"TrustedScriptURL":{F=M.createScriptURL(F);break}}if(F!==hi)try{X?h.setAttributeNS(X,I,F):h.setAttribute(I,F),ui(h)?ce(h):uo(e.removed)}catch{ot(I,h)}}be(q.afterSanitizeAttributes,h,null)},ll=function b(h){let f=null;const v=dr(h);for(be(q.beforeSanitizeShadowDOM,h,null);f=v.nextNode();)be(q.uponSanitizeShadowNode,f,null),fr(f),vr(f),f.content instanceof r&&b(f.content);be(q.afterSanitizeShadowDOM,h,null)};return e.sanitize=function(b){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,v=null,L=null,H=null;if(ai=!b,ai&&(b="<!-->"),typeof b!="string"&&!pr(b))if(typeof b.toString=="function"){if(b=b.toString(),typeof b!="string")throw Ot("dirty is not a string, aborting")}else throw Ot("toString is not a function");if(!e.isSupported)return b;if(ii||ci(h),e.removed=[],typeof b=="string"&&(St=!1),St){if(b.nodeName){const ye=U(b.nodeName);if(!D[ye]||kt[ye])throw Ot("root node is forbidden and cannot be sanitized in-place")}}else if(b instanceof a)f=hr("<!---->"),v=f.ownerDocument.importNode(b,!0),v.nodeType===Rt.element&&v.nodeName==="BODY"||v.nodeName==="HTML"?f=v:f.appendChild(v);else{if(!tt&&!et&&!He&&b.indexOf("<")===-1)return M&&rn?M.createHTML(b):b;if(f=hr(b),!f)return tt?null:rn?Ne:""}f&&si&&ce(f.firstChild);const I=dr(St?b:f);for(;L=I.nextNode();)fr(L),vr(L),L.content instanceof r&&ll(L.content);if(St)return b;if(tt){if(sn)for(H=Za.call(f.ownerDocument);f.firstChild;)H.appendChild(f.firstChild);else H=f;return(N.shadowroot||N.shadowrootmode)&&(H=Qa.call(i,H,!0)),H}let X=He?f.outerHTML:f.innerHTML;return He&&D["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&V(Oa,f.ownerDocument.doctype.name)&&(X="<!DOCTYPE "+f.ownerDocument.doctype.name+`>
735
+ `+X),et&&dn([Kn,Jn,ei],ye=>{X=Tt(X,ye," ")}),M&&rn?M.createHTML(X):X},e.setConfig=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ci(b),ii=!0},e.clearConfig=function(){rt=null,ii=!1},e.isValidAttribute=function(b,h,f){rt||ci({});const v=U(b),L=U(h);return gr(v,L,f)},e.addHook=function(b,h){typeof h=="function"&&At(q[b],h)},e.removeHook=function(b,h){if(h!==void 0){const f=Sh(q[b],h);return f===-1?void 0:_h(q[b],f,1)[0]}return uo(q[b])},e.removeHooks=function(b){q[b]=[]},e.removeAllHooks=function(){q=bo()},e}var Ra=La(),Fh=Object.defineProperty,Bh=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Fh(e,t,s),s};const Ms=class Ms extends E{render(){return y`<div class="message-type-html">
736
+ ${$h(Ra.sanitize(this.message.content))}
737
+ </div>`}};Ms.styles=[T`
737
738
  :host {
738
739
  box-sizing: border-box;
739
740
  }
@@ -767,71 +768,71 @@
767
768
  height: auto;
768
769
  object-fit: contain;
769
770
  }
770
- `];let Ot=hs;ec([b({attribute:!1})],Ot.prototype,"message");function Hn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let xe=Hn();function Cr(s){xe=s}const Ze={exec:()=>null};function $(s,e=""){let t=typeof s=="string"?s:s.source;const n={replace:(i,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(L.caret,"$1"),t=t.replace(i,o),n},getRegex:()=>new RegExp(t,e)};return n}const L={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i")},tc=/^(?:[ \t]*(?:\n|$))+/,nc=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,sc=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ht=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ic=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,qn=/(?:[*+-]|\d{1,9}[.)])/,Sr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_r=$(Sr).replace(/bull/g,qn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),rc=$(Sr).replace(/bull/g,qn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Fn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,oc=/^[^\n]+/,Vn=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ac=$(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Vn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),lc=$(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,qn).getRegex(),Wt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Zn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,cc=$("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Zn).replace("tag",Wt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Er=$(Fn).replace("hr",ht).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wt).getRegex(),hc=$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Er).getRegex(),Wn={blockquote:hc,code:nc,def:ac,fences:sc,heading:ic,hr:ht,html:cc,lheading:_r,list:lc,newline:tc,paragraph:Er,table:Ze,text:oc},mi=$("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ht).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wt).getRegex(),uc={...Wn,lheading:rc,table:mi,paragraph:$(Fn).replace("hr",ht).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",mi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wt).getRegex()},dc={...Wn,html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Zn).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ze,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$(Fn).replace("hr",ht).replace("heading",` *#{1,6} *[^
771
- ]`).replace("lheading",_r).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},pc=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fc=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ar=/^( {2,}|\\)\n(?!\s*$)/,gc=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Gt=/[\p{P}\p{S}]/u,Gn=/[\s\p{P}\p{S}]/u,Tr=/[^\s\p{P}\p{S}]/u,mc=$(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Gn).getRegex(),Or=/(?!~)[\p{P}\p{S}]/u,vc=/(?!~)[\s\p{P}\p{S}]/u,bc=/(?:[^\s\p{P}\p{S}]|~)/u,yc=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Lr=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,$c=$(Lr,"u").replace(/punct/g,Gt).getRegex(),xc=$(Lr,"u").replace(/punct/g,Or).getRegex(),Pr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",wc=$(Pr,"gu").replace(/notPunctSpace/g,Tr).replace(/punctSpace/g,Gn).replace(/punct/g,Gt).getRegex(),kc=$(Pr,"gu").replace(/notPunctSpace/g,bc).replace(/punctSpace/g,vc).replace(/punct/g,Or).getRegex(),Cc=$("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Tr).replace(/punctSpace/g,Gn).replace(/punct/g,Gt).getRegex(),Sc=$(/\\(punct)/,"gu").replace(/punct/g,Gt).getRegex(),_c=$(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ec=$(Zn).replace("(?:-->|$)","-->").getRegex(),Ac=$("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ec).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Lt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Tc=$(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Lt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Rr=$(/^!?\[(label)\]\[(ref)\]/).replace("label",Lt).replace("ref",Vn).getRegex(),Ir=$(/^!?\[(ref)\](?:\[\])?/).replace("ref",Vn).getRegex(),Oc=$("reflink|nolink(?!\\()","g").replace("reflink",Rr).replace("nolink",Ir).getRegex(),Qn={_backpedal:Ze,anyPunctuation:Sc,autolink:_c,blockSkip:yc,br:Ar,code:fc,del:Ze,emStrongLDelim:$c,emStrongRDelimAst:wc,emStrongRDelimUnd:Cc,escape:pc,link:Tc,nolink:Ir,punctuation:mc,reflink:Rr,reflinkSearch:Oc,tag:Ac,text:gc,url:Ze},Lc={...Qn,link:$(/^!?\[(label)\]\((.*?)\)/).replace("label",Lt).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Lt).getRegex()},wn={...Qn,emStrongRDelimAst:kc,emStrongLDelim:xc,url:$(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Pc={...wn,br:$(Ar).replace("{2,}","*").getRegex(),text:$(wn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},pt={normal:Wn,gfm:uc,pedantic:dc},Be={normal:Qn,gfm:wn,breaks:Pc,pedantic:Lc},Rc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},vi=s=>Rc[s];function F(s,e){if(e){if(L.escapeTest.test(s))return s.replace(L.escapeReplace,vi)}else if(L.escapeTestNoEncode.test(s))return s.replace(L.escapeReplaceNoEncode,vi);return s}function bi(s){try{s=encodeURI(s).replace(L.percentDecode,"%")}catch{return null}return s}function yi(s,e){var r;const t=s.replace(L.findPipe,(o,a,l)=>{let c=!1,h=a;for(;--h>=0&&l[h]==="\\";)c=!c;return c?"|":" |"}),n=t.split(L.splitPipe);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!((r=n.at(-1))!=null&&r.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(L.slashPipe,"|");return n}function He(s,e,t){const n=s.length;if(n===0)return"";let i=0;for(;i<n&&s.charAt(n-i-1)===e;)i++;return s.slice(0,n-i)}function Ic(s,e){if(s.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<s.length;n++)if(s[n]==="\\")n++;else if(s[n]===e[0])t++;else if(s[n]===e[1]&&(t--,t<0))return n;return t>0?-2:-1}function $i(s,e,t,n,i){const r=e.href,o=e.title||null,a=s[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;const l={type:s[0].charAt(0)==="!"?"image":"link",raw:t,href:r,title:o,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,l}function Uc(s,e,t){const n=s.match(t.other.indentCodeCompensation);if(n===null)return e;const i=n[1];return e.split(`
772
- `).map(r=>{const o=r.match(t.other.beginningSpace);if(o===null)return r;const[a]=o;return a.length>=i.length?r.slice(i.length):r}).join(`
773
- `)}class Pt{constructor(e){k(this,"options");k(this,"rules");k(this,"lexer");this.options=e||xe}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:He(n,`
774
- `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=Uc(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const i=He(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:He(t[0],`
775
- `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=He(t[0],`
771
+ `];let In=Ms;Bh([k({attribute:!1})],In.prototype,"message");function ps(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ke=ps();function Ia(n){Ke=n}var Nt={exec:()=>null};function _(n,e=""){let t=typeof n=="string"?n:n.source;const i={replace:(s,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(W.caret,"$1"),t=t.replace(s,o),i},getRegex:()=>new RegExp(t,e)};return i}var W={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},qh=/^(?:[ \t]*(?:\n|$))+/,Vh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Wh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,tn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Gh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fs=/(?:[*+-]|\d{1,9}[.)])/,Pa=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ma=_(Pa).replace(/bull/g,fs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Zh=_(Pa).replace(/bull/g,fs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),gs=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Yh=/^[^\n]+/,ms=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Qh=_(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ms).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Xh=_(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fs).getRegex(),Qn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",vs=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Kh=_("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",vs).replace("tag",Qn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Da=_(gs).replace("hr",tn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qn).getRegex(),Jh=_(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Da).getRegex(),bs={blockquote:Jh,code:Vh,def:Qh,fences:Wh,heading:Gh,hr:tn,html:Kh,lheading:Ma,list:Xh,newline:qh,paragraph:Da,table:Nt,text:Yh},yo=_("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",tn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qn).getRegex(),ed={...bs,lheading:Zh,table:yo,paragraph:_(gs).replace("hr",tn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",yo).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qn).getRegex()},td={...bs,html:_(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vs).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Nt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_(gs).replace("hr",tn).replace("heading",` *#{1,6} *[^
772
+ ]`).replace("lheading",Ma).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},nd=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,id=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ua=/^( {2,}|\\)\n(?!\s*$)/,sd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Xn=/[\p{P}\p{S}]/u,ys=/[\s\p{P}\p{S}]/u,Na=/[^\s\p{P}\p{S}]/u,rd=_(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ys).getRegex(),za=/(?!~)[\p{P}\p{S}]/u,od=/(?!~)[\s\p{P}\p{S}]/u,ad=/(?:[^\s\p{P}\p{S}]|~)/u,ld=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ja=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,cd=_(ja,"u").replace(/punct/g,Xn).getRegex(),ud=_(ja,"u").replace(/punct/g,za).getRegex(),Ha="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",hd=_(Ha,"gu").replace(/notPunctSpace/g,Na).replace(/punctSpace/g,ys).replace(/punct/g,Xn).getRegex(),dd=_(Ha,"gu").replace(/notPunctSpace/g,ad).replace(/punctSpace/g,od).replace(/punct/g,za).getRegex(),pd=_("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Na).replace(/punctSpace/g,ys).replace(/punct/g,Xn).getRegex(),fd=_(/\\(punct)/,"gu").replace(/punct/g,Xn).getRegex(),gd=_(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),md=_(vs).replace("(?:-->|$)","-->").getRegex(),vd=_("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",md).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Pn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,bd=_(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Pn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Fa=_(/^!?\[(label)\]\[(ref)\]/).replace("label",Pn).replace("ref",ms).getRegex(),Ba=_(/^!?\[(ref)\](?:\[\])?/).replace("ref",ms).getRegex(),yd=_("reflink|nolink(?!\\()","g").replace("reflink",Fa).replace("nolink",Ba).getRegex(),$s={_backpedal:Nt,anyPunctuation:fd,autolink:gd,blockSkip:ld,br:Ua,code:id,del:Nt,emStrongLDelim:cd,emStrongRDelimAst:hd,emStrongRDelimUnd:pd,escape:nd,link:bd,nolink:Ba,punctuation:rd,reflink:Fa,reflinkSearch:yd,tag:vd,text:sd,url:Nt},$d={...$s,link:_(/^!?\[(label)\]\((.*?)\)/).replace("label",Pn).getRegex(),reflink:_(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Pn).getRegex()},Vi={...$s,emStrongRDelimAst:dd,emStrongLDelim:ud,url:_(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},wd={...Vi,br:_(Ua).replace("{2,}","*").getRegex(),text:_(Vi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},fn={normal:bs,gfm:ed,pedantic:td},It={normal:$s,gfm:Vi,breaks:wd,pedantic:$d},xd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$o=n=>xd[n];function ue(n,e){if(e){if(W.escapeTest.test(n))return n.replace(W.escapeReplace,$o)}else if(W.escapeTestNoEncode.test(n))return n.replace(W.escapeReplaceNoEncode,$o);return n}function wo(n){try{n=encodeURI(n).replace(W.percentDecode,"%")}catch{return null}return n}function xo(n,e){var r;const t=n.replace(W.findPipe,(o,a,l)=>{let c=!1,u=a;for(;--u>=0&&l[u]==="\\";)c=!c;return c?"|":" |"}),i=t.split(W.splitPipe);let s=0;if(i[0].trim()||i.shift(),i.length>0&&!((r=i.at(-1))!=null&&r.trim())&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(W.slashPipe,"|");return i}function Pt(n,e,t){const i=n.length;if(i===0)return"";let s=0;for(;s<i&&n.charAt(i-s-1)===e;)s++;return n.slice(0,i-s)}function kd(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let i=0;i<n.length;i++)if(n[i]==="\\")i++;else if(n[i]===e[0])t++;else if(n[i]===e[1]&&(t--,t<0))return i;return t>0?-2:-1}function ko(n,e,t,i,s){const r=e.href,o=e.title||null,a=n[1].replace(s.other.outputLinkReplace,"$1");i.state.inLink=!0;const l={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:r,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,l}function Sd(n,e,t){const i=n.match(t.other.indentCodeCompensation);if(i===null)return e;const s=i[1];return e.split(`
773
+ `).map(r=>{const o=r.match(t.other.beginningSpace);if(o===null)return r;const[a]=o;return a.length>=s.length?r.slice(s.length):r}).join(`
774
+ `)}var Mn=class{constructor(n){A(this,"options");A(this,"rules");A(this,"lexer");this.options=n||Ke}space(n){const e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){const e=this.rules.block.code.exec(n);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Pt(t,`
775
+ `)}}}fences(n){const e=this.rules.block.fences.exec(n);if(e){const t=e[0],i=Sd(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(n){const e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const i=Pt(t,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(t=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){const e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:Pt(e[0],`
776
+ `)}}blockquote(n){const e=this.rules.block.blockquote.exec(n);if(e){let t=Pt(e[0],`
776
777
  `).split(`
777
- `),i="",r="";const o=[];for(;n.length>0;){let a=!1;const l=[];let c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))l.push(n[c]),a=!0;else if(!a)l.push(n[c]);else break;n=n.slice(c);const h=l.join(`
778
- `),u=h.replace(this.rules.other.blockquoteSetextReplace,`
778
+ `),i="",s="";const r=[];for(;t.length>0;){let o=!1;const a=[];let l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))a.push(t[l]),o=!0;else if(!o)a.push(t[l]);else break;t=t.slice(l);const c=a.join(`
779
+ `),u=c.replace(this.rules.other.blockquoteSetextReplace,`
779
780
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
780
- ${h}`:h,r=r?`${r}
781
- ${u}`:u;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,o,!0),this.lexer.state.top=d,n.length===0)break;const p=o.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){const m=p,f=m.raw+`
782
- `+n.join(`
783
- `),E=this.blockquote(f);o[o.length-1]=E,i=i.substring(0,i.length-m.raw.length)+E.raw,r=r.substring(0,r.length-m.text.length)+E.text;break}else if((p==null?void 0:p.type)==="list"){const m=p,f=m.raw+`
784
- `+n.join(`
785
- `),E=this.list(f);o[o.length-1]=E,i=i.substring(0,i.length-p.raw.length)+E.raw,r=r.substring(0,r.length-m.raw.length)+E.raw,n=f.substring(o.at(-1).raw.length).split(`
786
- `);continue}}return{type:"blockquote",raw:i,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const i=n.length>1,r={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");const o=this.rules.other.listItemRegex(n);let a=!1;for(;e;){let c=!1,h="",u="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;h=t[0],e=e.substring(h.length);let d=t[2].split(`
787
- `,1)[0].replace(this.rules.other.listReplaceTabs,he=>" ".repeat(3*he.length)),p=e.split(`
788
- `,1)[0],m=!d.trim(),f=0;if(this.options.pedantic?(f=2,u=d.trimStart()):m?f=t[1].length+1:(f=t[2].search(this.rules.other.nonSpaceChar),f=f>4?1:f,u=d.slice(f),f+=t[1].length),m&&this.rules.other.blankLine.test(p)&&(h+=p+`
789
- `,e=e.substring(p.length+1),c=!0),!c){const he=this.rules.other.nextBulletRegex(f),Cs=this.rules.other.hrRegex(f),Ss=this.rules.other.fencesBeginRegex(f),_s=this.rules.other.headingBeginRegex(f),Dr=this.rules.other.htmlBeginRegex(f);for(;e;){const Qt=e.split(`
790
- `,1)[0];let De;if(p=Qt,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),De=p):De=p.replace(this.rules.other.tabCharGlobal," "),Ss.test(p)||_s.test(p)||Dr.test(p)||he.test(p)||Cs.test(p))break;if(De.search(this.rules.other.nonSpaceChar)>=f||!p.trim())u+=`
791
- `+De.slice(f);else{if(m||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Ss.test(d)||_s.test(d)||Cs.test(d))break;u+=`
792
- `+p}!m&&!p.trim()&&(m=!0),h+=Qt+`
793
- `,e=e.substring(Qt.length+1),d=De.slice(f)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(a=!0));let E=null,ie;this.options.gfm&&(E=this.rules.other.listIsTask.exec(u),E&&(ie=E[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:h,task:!!E,checked:ie,loose:!1,text:u,tokens:[]}),r.raw+=h}const l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let c=0;c<r.items.length;c++)if(this.lexer.state.top=!1,r.items[c].tokens=this.lexer.blockTokens(r.items[c].text,[]),!r.loose){const h=r.items[c].tokens.filter(d=>d.type==="space"),u=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));r.loose=u}if(r.loose)for(let c=0;c<r.items.length;c++)r.items[c].loose=!0;return r}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:i,title:r}}}table(e){var a;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=yi(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
794
- `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(const l of i)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<n.length;l++)o.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:o.align[l]});for(const l of r)o.rows.push(yi(l,o.header.length).map((c,h)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[h]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
795
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const o=He(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=Ic(t[2],"()");if(o===-2)return;if(o>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let i=t[2],r="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],r=o[3])}else r=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),$i(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[i.toLowerCase()];if(!r){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return $i(n,r,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...i[0]].length-1;let a,l,c=o,h=0;const u=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+o);(i=u.exec(t))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(l=[...a].length,i[3]||i[4]){c+=l;continue}else if((i[5]||i[6])&&o%3&&!((o+l)%3)){h+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+h);const d=[...i[0]][0].length,p=e.slice(0,o+i.index+d+l);if(Math.min(o,l)%2){const f=p.slice(1,-1);return{type:"em",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}const m=p.slice(2,-2);return{type:"strong",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,i;return t[2]==="@"?(n=t[1],i="mailto:"+n):(n=t[1],i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let i,r;if(t[2]==="@")i=t[0],r="mailto:"+i;else{let o;do o=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(o!==t[0]);i=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}}class j{constructor(e){k(this,"tokens");k(this,"options");k(this,"state");k(this,"tokenizer");k(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||xe,this.options.tokenizer=this.options.tokenizer||new Pt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:L,block:pt.normal,inline:Be.normal};this.options.pedantic?(t.block=pt.pedantic,t.inline=Be.pedantic):this.options.gfm&&(t.block=pt.gfm,this.options.breaks?t.inline=Be.breaks:t.inline=Be.gfm),this.tokenizer.rules=t}static get rules(){return{block:pt,inline:Be}}static lex(e,t){return new j(t).lex(e)}static lexInline(e,t){return new j(t).inlineTokens(e)}lex(e){e=e.replace(L.carriageReturn,`
796
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){var i,r,o;for(this.options.pedantic&&(e=e.replace(L.tabCharGlobal," ").replace(L.spaceLine,""));e;){let a;if((r=(i=this.options.extensions)==null?void 0:i.block)!=null&&r.some(c=>(a=c.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);const c=t.at(-1);a.raw.length===1&&c!==void 0?c.raw+=`
781
+ ${c}`:c,s=s?`${s}
782
+ ${u}`:u;const p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,r,!0),this.lexer.state.top=p,t.length===0)break;const d=r.at(-1);if((d==null?void 0:d.type)==="code")break;if((d==null?void 0:d.type)==="blockquote"){const g=d,m=g.raw+`
783
+ `+t.join(`
784
+ `),$=this.blockquote(m);r[r.length-1]=$,i=i.substring(0,i.length-g.raw.length)+$.raw,s=s.substring(0,s.length-g.text.length)+$.text;break}else if((d==null?void 0:d.type)==="list"){const g=d,m=g.raw+`
785
+ `+t.join(`
786
+ `),$=this.list(m);r[r.length-1]=$,i=i.substring(0,i.length-d.raw.length)+$.raw,s=s.substring(0,s.length-g.raw.length)+$.raw,t=m.substring(r.at(-1).raw.length).split(`
787
+ `);continue}}return{type:"blockquote",raw:i,tokens:r,text:s}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim();const i=t.length>1,s={type:"list",raw:"",ordered:i,start:i?+t.slice(0,-1):"",loose:!1,items:[]};t=i?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=i?t:"[*+-]");const r=this.rules.other.listItemRegex(t);let o=!1;for(;n;){let l=!1,c="",u="";if(!(e=r.exec(n))||this.rules.block.hr.test(n))break;c=e[0],n=n.substring(c.length);let p=e[2].split(`
788
+ `,1)[0].replace(this.rules.other.listReplaceTabs,se=>" ".repeat(3*se.length)),d=n.split(`
789
+ `,1)[0],g=!p.trim(),m=0;if(this.options.pedantic?(m=2,u=p.trimStart()):g?m=e[1].length+1:(m=e[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,u=p.slice(m),m+=e[1].length),g&&this.rules.other.blankLine.test(d)&&(c+=d+`
790
+ `,n=n.substring(d.length+1),l=!0),!l){const se=this.rules.other.nextBulletRegex(m),Le=this.rules.other.hrRegex(m),Ue=this.rules.other.fencesBeginRegex(m),M=this.rules.other.headingBeginRegex(m),Ne=this.rules.other.htmlBeginRegex(m);for(;n;){const ze=n.split(`
791
+ `,1)[0];let je;if(d=ze,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),je=d):je=d.replace(this.rules.other.tabCharGlobal," "),Ue.test(d)||M.test(d)||Ne.test(d)||se.test(d)||Le.test(d))break;if(je.search(this.rules.other.nonSpaceChar)>=m||!d.trim())u+=`
792
+ `+je.slice(m);else{if(g||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Ue.test(p)||M.test(p)||Le.test(p))break;u+=`
793
+ `+d}!g&&!d.trim()&&(g=!0),c+=ze+`
794
+ `,n=n.substring(ze.length+1),p=je.slice(m)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0));let $=null,me;this.options.gfm&&($=this.rules.other.listIsTask.exec(u),$&&(me=$[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:c,task:!!$,checked:me,loose:!1,text:u,tokens:[]}),s.raw+=c}const a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){const c=s.items[l].tokens.filter(p=>p.type==="space"),u=c.length>0&&c.some(p=>this.rules.other.anyLine.test(p.raw));s.loose=u}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(n){const e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){const e=this.rules.block.def.exec(n);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:i,title:s}}}table(n){var o;const e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const t=xo(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
795
+ `):[],r={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===i.length){for(const a of i)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<t.length;a++)r.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:r.align[a]});for(const a of s)r.rows.push(xo(a,r.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:r.align[c]})));return r}}lheading(n){const e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){const e=this.rules.block.paragraph.exec(n);if(e){const t=e[1].charAt(e[1].length-1)===`
796
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){const e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){const e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){const e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){const e=this.rules.inline.link.exec(n);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const r=Pt(t.slice(0,-1),"\\");if((t.length-r.length)%2===0)return}else{const r=kd(e[2],"()");if(r===-2)return;if(r>-1){const a=(e[0].indexOf("!")===0?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],s="";if(this.options.pedantic){const r=this.rules.other.pedanticHrefTitle.exec(i);r&&(i=r[1],s=r[3])}else s=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?i=i.slice(1):i=i.slice(1,-1)),ko(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){const i=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[i.toLowerCase()];if(!s){const r=t[0].charAt(0);return{type:"text",raw:r,text:r}}return ko(t,s,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let i=this.rules.inline.emStrongLDelim.exec(n);if(!i||i[3]&&t.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!t||this.rules.inline.punctuation.exec(t)){const r=[...i[0]].length-1;let o,a,l=r,c=0;const u=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*n.length+r);(i=u.exec(e))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(a=[...o].length,i[3]||i[4]){l+=a;continue}else if((i[5]||i[6])&&r%3&&!((r+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);const p=[...i[0]][0].length,d=n.slice(0,r+i.index+p+a);if(Math.min(r,a)%2){const m=d.slice(1,-1);return{type:"em",raw:d,text:m,tokens:this.lexer.inlineTokens(m)}}const g=d.slice(2,-2);return{type:"strong",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(n){const e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return i&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){const e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){const e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){const e=this.rules.inline.autolink.exec(n);if(e){let t,i;return e[2]==="@"?(t=e[1],i="mailto:"+t):(t=e[1],i=t),{type:"link",raw:e[0],text:t,href:i,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let i,s;if(e[2]==="@")i=e[0],s="mailto:"+i;else{let r;do r=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(r!==e[0]);i=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(n){const e=this.rules.inline.text.exec(n);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},ke=class Wi{constructor(e){A(this,"tokens");A(this,"options");A(this,"state");A(this,"tokenizer");A(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ke,this.options.tokenizer=this.options.tokenizer||new Mn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:W,block:fn.normal,inline:It.normal};this.options.pedantic?(t.block=fn.pedantic,t.inline=It.pedantic):this.options.gfm&&(t.block=fn.gfm,this.options.breaks?t.inline=It.breaks:t.inline=It.gfm),this.tokenizer.rules=t}static get rules(){return{block:fn,inline:It}}static lex(e,t){return new Wi(t).lex(e)}static lexInline(e,t){return new Wi(t).inlineTokens(e)}lex(e){e=e.replace(W.carriageReturn,`
797
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const i=this.inlineQueue[t];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],i=!1){var s,r,o;for(this.options.pedantic&&(e=e.replace(W.tabCharGlobal," ").replace(W.spaceLine,""));e;){let a;if((r=(s=this.options.extensions)==null?void 0:s.block)!=null&&r.some(c=>(a=c.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);const c=t.at(-1);a.raw.length===1&&c!==void 0?c.raw+=`
797
798
  `:t.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);const c=t.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
798
799
  `+a.raw,c.text+=`
799
800
  `+a.text,this.inlineQueue.at(-1).src=c.text):t.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);const c=t.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
800
801
  `+a.raw,c.text+=`
801
- `+a.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title});continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),t.push(a);continue}let l=e;if((o=this.options.extensions)!=null&&o.startBlock){let c=1/0;const h=e.slice(1);let u;this.options.extensions.startBlock.forEach(d=>{u=d.call({lexer:this},h),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(this.state.top&&(a=this.tokenizer.paragraph(l))){const c=t.at(-1);n&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=`
802
+ `+a.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title});continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),t.push(a);continue}let l=e;if((o=this.options.extensions)!=null&&o.startBlock){let c=1/0;const u=e.slice(1);let p;this.options.extensions.startBlock.forEach(d=>{p=d.call({lexer:this},u),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(this.state.top&&(a=this.tokenizer.paragraph(l))){const c=t.at(-1);i&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=`
802
803
  `+a.raw,c.text+=`
803
- `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(a),n=l.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);const c=t.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=`
804
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(a),i=l.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);const c=t.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=`
804
805
  `+a.raw,c.text+=`
805
- `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(a);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var a,l,c;let n=e,i=null;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)h.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let r=!1,o="";for(;e;){r||(o=""),r=!1;let h;if((l=(a=this.options.extensions)==null?void 0:a.inline)!=null&&l.some(d=>(h=d.call({lexer:this},e,t))?(e=e.substring(h.raw.length),t.push(h),!0):!1))continue;if(h=this.tokenizer.escape(e)){e=e.substring(h.raw.length),t.push(h);continue}if(h=this.tokenizer.tag(e)){e=e.substring(h.raw.length),t.push(h);continue}if(h=this.tokenizer.link(e)){e=e.substring(h.raw.length),t.push(h);continue}if(h=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(h.raw.length);const d=t.at(-1);h.type==="text"&&(d==null?void 0:d.type)==="text"?(d.raw+=h.raw,d.text+=h.text):t.push(h);continue}if(h=this.tokenizer.emStrong(e,n,o)){e=e.substring(h.raw.length),t.push(h);continue}if(h=this.tokenizer.codespan(e)){e=e.substring(h.raw.length),t.push(h);continue}if(h=this.tokenizer.br(e)){e=e.substring(h.raw.length),t.push(h);continue}if(h=this.tokenizer.del(e)){e=e.substring(h.raw.length),t.push(h);continue}if(h=this.tokenizer.autolink(e)){e=e.substring(h.raw.length),t.push(h);continue}if(!this.state.inLink&&(h=this.tokenizer.url(e))){e=e.substring(h.raw.length),t.push(h);continue}let u=e;if((c=this.options.extensions)!=null&&c.startInline){let d=1/0;const p=e.slice(1);let m;this.options.extensions.startInline.forEach(f=>{m=f.call({lexer:this},p),typeof m=="number"&&m>=0&&(d=Math.min(d,m))}),d<1/0&&d>=0&&(u=e.substring(0,d+1))}if(h=this.tokenizer.inlineText(u)){e=e.substring(h.raw.length),h.raw.slice(-1)!=="_"&&(o=h.raw.slice(-1)),r=!0;const d=t.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=h.raw,d.text+=h.text):t.push(h);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}}class tt{constructor(e){k(this,"options");k(this,"parser");this.options=e||xe}space(e){return""}code({text:e,lang:t,escaped:n}){var o;const i=(o=(t||"").match(L.notSpaceStart))==null?void 0:o[0],r=e.replace(L.endingNewline,"")+`
806
- `;return i?'<pre><code class="language-'+F(i)+'">'+(n?r:F(r,!0))+`</code></pre>
807
- `:"<pre><code>"+(n?r:F(r,!0))+`</code></pre>
808
- `}blockquote({tokens:e}){return`<blockquote>
809
- ${this.parser.parse(e)}</blockquote>
810
- `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
811
- `}hr(e){return`<hr>
812
- `}list(e){const t=e.ordered,n=e.start;let i="";for(let a=0;a<e.items.length;a++){const l=e.items[a];i+=this.listitem(l)}const r=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+r+o+`>
813
- `+i+"</"+r+`>
814
- `}listitem(e){var n;let t="";if(e.task){const i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+F(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):t+=i+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
815
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
816
- `}table(e){let t="",n="";for(let r=0;r<e.header.length;r++)n+=this.tablecell(e.header[r]);t+=this.tablerow({text:n});let i="";for(let r=0;r<e.rows.length;r++){const o=e.rows[r];n="";for(let a=0;a<o.length;a++)n+=this.tablecell(o[a]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
806
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(a);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var a,l,c;let i=e,s=null;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)u.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,s.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let r=!1,o="";for(;e;){r||(o=""),r=!1;let u;if((l=(a=this.options.extensions)==null?void 0:a.inline)!=null&&l.some(d=>(u=d.call({lexer:this},e,t))?(e=e.substring(u.raw.length),t.push(u),!0):!1))continue;if(u=this.tokenizer.escape(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.tag(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.link(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(u.raw.length);const d=t.at(-1);u.type==="text"&&(d==null?void 0:d.type)==="text"?(d.raw+=u.raw,d.text+=u.text):t.push(u);continue}if(u=this.tokenizer.emStrong(e,i,o)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.codespan(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.br(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.del(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.autolink(e)){e=e.substring(u.raw.length),t.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(e))){e=e.substring(u.raw.length),t.push(u);continue}let p=e;if((c=this.options.extensions)!=null&&c.startInline){let d=1/0;const g=e.slice(1);let m;this.options.extensions.startInline.forEach($=>{m=$.call({lexer:this},g),typeof m=="number"&&m>=0&&(d=Math.min(d,m))}),d<1/0&&d>=0&&(p=e.substring(0,d+1))}if(u=this.tokenizer.inlineText(p)){e=e.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(o=u.raw.slice(-1)),r=!0;const d=t.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=u.raw,d.text+=u.text):t.push(u);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}},Wt=class{constructor(n){A(this,"options");A(this,"parser");this.options=n||Ke}space(n){return""}code({text:n,lang:e,escaped:t}){var r;const i=(r=(e||"").match(W.notSpaceStart))==null?void 0:r[0],s=n.replace(W.endingNewline,"")+`
807
+ `;return i?'<pre><code class="language-'+ue(i)+'">'+(t?s:ue(s,!0))+`</code></pre>
808
+ `:"<pre><code>"+(t?s:ue(s,!0))+`</code></pre>
809
+ `}blockquote({tokens:n}){return`<blockquote>
810
+ ${this.parser.parse(n)}</blockquote>
811
+ `}html({text:n}){return n}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
812
+ `}hr(n){return`<hr>
813
+ `}list(n){const e=n.ordered,t=n.start;let i="";for(let o=0;o<n.items.length;o++){const a=n.items[o];i+=this.listitem(a)}const s=e?"ol":"ul",r=e&&t!==1?' start="'+t+'"':"";return"<"+s+r+`>
814
+ `+i+"</"+s+`>
815
+ `}listitem(n){var t;let e="";if(n.task){const i=this.checkbox({checked:!!n.checked});n.loose?((t=n.tokens[0])==null?void 0:t.type)==="paragraph"?(n.tokens[0].text=i+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=i+" "+ue(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):e+=i+" "}return e+=this.parser.parse(n.tokens,!!n.loose),`<li>${e}</li>
816
+ `}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
817
+ `}table(n){let e="",t="";for(let s=0;s<n.header.length;s++)t+=this.tablecell(n.header[s]);e+=this.tablerow({text:t});let i="";for(let s=0;s<n.rows.length;s++){const r=n.rows[s];t="";for(let o=0;o<r.length;o++)t+=this.tablecell(r[o]);i+=this.tablerow({text:t})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
817
818
  <thead>
818
- `+t+`</thead>
819
+ `+e+`</thead>
819
820
  `+i+`</table>
820
- `}tablerow({text:e}){return`<tr>
821
- ${e}</tr>
822
- `}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
823
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${F(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const i=this.parser.parseInline(n),r=bi(e);if(r===null)return i;e=r;let o='<a href="'+e+'"';return t&&(o+=' title="'+F(t)+'"'),o+=">"+i+"</a>",o}image({href:e,title:t,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));const r=bi(e);if(r===null)return F(n);e=r;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${F(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:F(e.text)}}class Kn{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class z{constructor(e){k(this,"options");k(this,"renderer");k(this,"textRenderer");this.options=e||xe,this.options.renderer=this.options.renderer||new tt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Kn}static parse(e,t){return new z(t).parse(e)}static parseInline(e,t){return new z(t).parseInline(e)}parse(e,t=!0){var i,r;let n="";for(let o=0;o<e.length;o++){const a=e[o];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[a.type]){const c=a,h=this.options.extensions.renderers[c.type].call({parser:this},c);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){n+=h||"";continue}}const l=a;switch(l.type){case"space":{n+=this.renderer.space(l);continue}case"hr":{n+=this.renderer.hr(l);continue}case"heading":{n+=this.renderer.heading(l);continue}case"code":{n+=this.renderer.code(l);continue}case"table":{n+=this.renderer.table(l);continue}case"blockquote":{n+=this.renderer.blockquote(l);continue}case"list":{n+=this.renderer.list(l);continue}case"html":{n+=this.renderer.html(l);continue}case"paragraph":{n+=this.renderer.paragraph(l);continue}case"text":{let c=l,h=this.renderer.text(c);for(;o+1<e.length&&e[o+1].type==="text";)c=e[++o],h+=`
824
- `+this.renderer.text(c);t?n+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):n+=h;continue}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}parseInline(e,t=this.renderer){var i,r;let n="";for(let o=0;o<e.length;o++){const a=e[o];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[a.type]){const c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=c||"";continue}}const l=a;switch(l.type){case"escape":{n+=t.text(l);break}case"html":{n+=t.html(l);break}case"link":{n+=t.link(l);break}case"image":{n+=t.image(l);break}case"strong":{n+=t.strong(l);break}case"em":{n+=t.em(l);break}case"codespan":{n+=t.codespan(l);break}case"br":{n+=t.br(l);break}case"del":{n+=t.del(l);break}case"text":{n+=t.text(l);break}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}}class We{constructor(e){k(this,"options");k(this,"block");this.options=e||xe}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?j.lex:j.lexInline}provideParser(){return this.block?z.parse:z.parseInline}}k(We,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Mc{constructor(...e){k(this,"defaults",Hn());k(this,"options",this.setOptions);k(this,"parse",this.parseMarkdown(!0));k(this,"parseInline",this.parseMarkdown(!1));k(this,"Parser",z);k(this,"Renderer",tt);k(this,"TextRenderer",Kn);k(this,"Lexer",j);k(this,"Tokenizer",Pt);k(this,"Hooks",We);this.use(...e)}walkTokens(e,t){var i,r;let n=[];for(const o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{const a=o;for(const l of a.header)n=n.concat(this.walkTokens(l.tokens,t));for(const l of a.rows)for(const c of l)n=n.concat(this.walkTokens(c.tokens,t));break}case"list":{const a=o;n=n.concat(this.walkTokens(a.items,t));break}default:{const a=o;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{const c=a[l].flat(1/0);n=n.concat(this.walkTokens(c,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const o=t.renderers[r.name];o?t.renderers[r.name]=function(...a){let l=r.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[r.level];o?o.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),i.extensions=t),n.renderer){const r=this.defaults.renderer||new tt(this.defaults);for(const o in n.renderer){if(!(o in r))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const a=o,l=n.renderer[a],c=r[a];r[a]=(...h)=>{let u=l.apply(r,h);return u===!1&&(u=c.apply(r,h)),u||""}}i.renderer=r}if(n.tokenizer){const r=this.defaults.tokenizer||new Pt(this.defaults);for(const o in n.tokenizer){if(!(o in r))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const a=o,l=n.tokenizer[a],c=r[a];r[a]=(...h)=>{let u=l.apply(r,h);return u===!1&&(u=c.apply(r,h)),u}}i.tokenizer=r}if(n.hooks){const r=this.defaults.hooks||new We;for(const o in n.hooks){if(!(o in r))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const a=o,l=n.hooks[a],c=r[a];We.passThroughHooks.has(o)?r[a]=h=>{if(this.defaults.async)return Promise.resolve(l.call(r,h)).then(d=>c.call(r,d));const u=l.call(r,h);return c.call(r,u)}:r[a]=(...h)=>{let u=l.apply(r,h);return u===!1&&(u=c.apply(r,h)),u}}i.hooks=r}if(n.walkTokens){const r=this.defaults.walkTokens,o=n.walkTokens;i.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),r&&(l=l.concat(r.call(this,a))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return j.lex(e,t??this.defaults)}parser(e,t){return z.parse(e,t??this.defaults)}parseMarkdown(e){return(n,i)=>{const r={...i},o={...this.defaults,...r},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&r.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const l=o.hooks?o.hooks.provideLexer():e?j.lex:j.lexInline,c=o.hooks?o.hooks.provideParser():e?z.parse:z.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(h=>l(h,o)).then(h=>o.hooks?o.hooks.processAllTokens(h):h).then(h=>o.walkTokens?Promise.all(this.walkTokens(h,o.walkTokens)).then(()=>h):h).then(h=>c(h,o)).then(h=>o.hooks?o.hooks.postprocess(h):h).catch(a);try{o.hooks&&(n=o.hooks.preprocess(n));let h=l(n,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let u=c(h,o);return o.hooks&&(u=o.hooks.postprocess(u)),u}catch(h){return a(h)}}}onError(e,t){return n=>{if(n.message+=`
825
- Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+F(n.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}}}const ye=new Mc;function y(s,e){return ye.parse(s,e)}y.options=y.setOptions=function(s){return ye.setOptions(s),y.defaults=ye.defaults,Cr(y.defaults),y};y.getDefaults=Hn;y.defaults=xe;y.use=function(...s){return ye.use(...s),y.defaults=ye.defaults,Cr(y.defaults),y};y.walkTokens=function(s,e){return ye.walkTokens(s,e)};y.parseInline=ye.parseInline;y.Parser=z;y.parser=z.parse;y.Renderer=tt;y.TextRenderer=Kn;y.Lexer=j;y.lexer=j.lex;y.Tokenizer=Pt;y.Hooks=We;y.parse=y;y.options;y.setOptions;y.use;y.walkTokens;y.parseInline;z.parse;j.lex;var jc=Object.defineProperty,Ur=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&jc(e,t,i),i};const Mr=new tt;Mr.link=function({href:s,title:e,text:t}){return e||(e=t),`<a target="_blank" href="${s}" title="${e}">${t}</a>`};y.use({renderer:Mr});const us=class us extends w{constructor(){super(...arguments),this.showLightbox=!1,this.imageUrl="",this.altText="",this.scrollRef=Z(),this.contentRef=Z(),this.autoScroll=!0,this.buffer="",this.pointer=0,this.imageRegexp=new RegExp(/!\[[^[]*\([^)]*\)/gm),this.includesImage=e=>this.imageRegexp.test(e)}handleAutoscroll(){this.addEventListener("wheel",()=>{this.autoScroll=!1},{passive:!0}),this.addEventListener("click",()=>{this.autoScroll=!1})}handleLightboxClose(){this.addEventListener("action",e=>{e.detail.key==="close-lightbox"&&(this.showLightbox=!1)})}handleLightboxOpen(){this.contentRef.value.addEventListener("click",e=>{e.target.tagName==="IMG"&&(this.showLightbox=!0,this.imageUrl=e.target.src,this.altText=e.target.alt)})}getLastChunk(){const e=this.message.content.length-this.pointer;return e===0?"":(this.pointer=this.message.content.length,this.message.content.slice(-e))}async firstUpdated(){this.handleAutoscroll(),this.handleLightboxOpen(),this.handleLightboxClose()}updated(){var i,r;const e=this.getLastChunk();if(!e)return;this.buffer+=e;const t=y.parse(this.buffer),n=(i=this.contentRef.value)==null?void 0:i.querySelector("div:last-of-type");if(this.includesImage(this.buffer))(r=this.contentRef.value)==null||r.appendChild(document.createElement("div")),this.buffer="";else if(this.buffer.includes("!["))return;n.innerHTML=dn(t),this.applyCodeStyles(n),this.autoScroll&&this.scrollRef.value.scrollIntoView()}applyCodeStyles(e){if(!e)return;e.querySelectorAll("code").forEach(n=>{n.style.whiteSpace="pre-wrap"})}render(){return g`
826
- <div class="message-type-markdown" ${W(this.contentRef)}>
821
+ `}tablerow({text:n}){return`<tr>
822
+ ${n}</tr>
823
+ `}tablecell(n){const e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
824
+ `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${ue(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){const i=this.parser.parseInline(t),s=wo(n);if(s===null)return i;n=s;let r='<a href="'+n+'"';return e&&(r+=' title="'+ue(e)+'"'),r+=">"+i+"</a>",r}image({href:n,title:e,text:t,tokens:i}){i&&(t=this.parser.parseInline(i,this.parser.textRenderer));const s=wo(n);if(s===null)return ue(t);n=s;let r=`<img src="${n}" alt="${t}"`;return e&&(r+=` title="${ue(e)}"`),r+=">",r}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:ue(n.text)}},ws=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},Se=class Gi{constructor(e){A(this,"options");A(this,"renderer");A(this,"textRenderer");this.options=e||Ke,this.options.renderer=this.options.renderer||new Wt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ws}static parse(e,t){return new Gi(t).parse(e)}static parseInline(e,t){return new Gi(t).parseInline(e)}parse(e,t=!0){var s,r;let i="";for(let o=0;o<e.length;o++){const a=e[o];if((r=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&r[a.type]){const c=a,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){i+=u||"";continue}}const l=a;switch(l.type){case"space":{i+=this.renderer.space(l);continue}case"hr":{i+=this.renderer.hr(l);continue}case"heading":{i+=this.renderer.heading(l);continue}case"code":{i+=this.renderer.code(l);continue}case"table":{i+=this.renderer.table(l);continue}case"blockquote":{i+=this.renderer.blockquote(l);continue}case"list":{i+=this.renderer.list(l);continue}case"html":{i+=this.renderer.html(l);continue}case"paragraph":{i+=this.renderer.paragraph(l);continue}case"text":{let c=l,u=this.renderer.text(c);for(;o+1<e.length&&e[o+1].type==="text";)c=e[++o],u+=`
825
+ `+this.renderer.text(c);t?i+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):i+=u;continue}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return i}parseInline(e,t=this.renderer){var s,r;let i="";for(let o=0;o<e.length;o++){const a=e[o];if((r=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&r[a.type]){const c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){i+=c||"";continue}}const l=a;switch(l.type){case"escape":{i+=t.text(l);break}case"html":{i+=t.html(l);break}case"link":{i+=t.link(l);break}case"image":{i+=t.image(l);break}case"strong":{i+=t.strong(l);break}case"em":{i+=t.em(l);break}case"codespan":{i+=t.codespan(l);break}case"br":{i+=t.br(l);break}case"del":{i+=t.del(l);break}case"text":{i+=t.text(l);break}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return i}},Ei,bn=(Ei=class{constructor(n){A(this,"options");A(this,"block");this.options=n||Ke}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?ke.lex:ke.lexInline}provideParser(){return this.block?Se.parse:Se.parseInline}},A(Ei,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Ei),_d=class{constructor(...n){A(this,"defaults",ps());A(this,"options",this.setOptions);A(this,"parse",this.parseMarkdown(!0));A(this,"parseInline",this.parseMarkdown(!1));A(this,"Parser",Se);A(this,"Renderer",Wt);A(this,"TextRenderer",ws);A(this,"Lexer",ke);A(this,"Tokenizer",Mn);A(this,"Hooks",bn);this.use(...n)}walkTokens(n,e){var i,s;let t=[];for(const r of n)switch(t=t.concat(e.call(this,r)),r.type){case"table":{const o=r;for(const a of o.header)t=t.concat(this.walkTokens(a.tokens,e));for(const a of o.rows)for(const l of a)t=t.concat(this.walkTokens(l.tokens,e));break}case"list":{const o=r;t=t.concat(this.walkTokens(o.items,e));break}default:{const o=r;(s=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&s[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{const l=o[a].flat(1/0);t=t.concat(this.walkTokens(l,e))}):o.tokens&&(t=t.concat(this.walkTokens(o.tokens,e)))}}return t}use(...n){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{const i={...t};if(i.async=this.defaults.async||i.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const r=e.renderers[s.name];r?e.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=e[s.level];r?r.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),i.extensions=e),t.renderer){const s=this.defaults.renderer||new Wt(this.defaults);for(const r in t.renderer){if(!(r in s))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const o=r,a=t.renderer[o],l=s[o];s[o]=(...c)=>{let u=a.apply(s,c);return u===!1&&(u=l.apply(s,c)),u||""}}i.renderer=s}if(t.tokenizer){const s=this.defaults.tokenizer||new Mn(this.defaults);for(const r in t.tokenizer){if(!(r in s))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const o=r,a=t.tokenizer[o],l=s[o];s[o]=(...c)=>{let u=a.apply(s,c);return u===!1&&(u=l.apply(s,c)),u}}i.tokenizer=s}if(t.hooks){const s=this.defaults.hooks||new bn;for(const r in t.hooks){if(!(r in s))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const o=r,a=t.hooks[o],l=s[o];bn.passThroughHooks.has(r)?s[o]=c=>{if(this.defaults.async)return Promise.resolve(a.call(s,c)).then(p=>l.call(s,p));const u=a.call(s,c);return l.call(s,u)}:s[o]=(...c)=>{let u=a.apply(s,c);return u===!1&&(u=l.apply(s,c)),u}}i.hooks=s}if(t.walkTokens){const s=this.defaults.walkTokens,r=t.walkTokens;i.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...i}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return ke.lex(n,e??this.defaults)}parser(n,e){return Se.parse(n,e??this.defaults)}parseMarkdown(n){return(t,i)=>{const s={...i},r={...this.defaults,...s},o=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));r.hooks&&(r.hooks.options=r,r.hooks.block=n);const a=r.hooks?r.hooks.provideLexer():n?ke.lex:ke.lexInline,l=r.hooks?r.hooks.provideParser():n?Se.parse:Se.parseInline;if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(t):t).then(c=>a(c,r)).then(c=>r.hooks?r.hooks.processAllTokens(c):c).then(c=>r.walkTokens?Promise.all(this.walkTokens(c,r.walkTokens)).then(()=>c):c).then(c=>l(c,r)).then(c=>r.hooks?r.hooks.postprocess(c):c).catch(o);try{r.hooks&&(t=r.hooks.preprocess(t));let c=a(t,r);r.hooks&&(c=r.hooks.processAllTokens(c)),r.walkTokens&&this.walkTokens(c,r.walkTokens);let u=l(c,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(c){return o(c)}}}onError(n,e){return t=>{if(t.message+=`
826
+ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An error occurred:</p><pre>"+ue(t.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(t);throw t}}},Qe=new _d;function S(n,e){return Qe.parse(n,e)}S.options=S.setOptions=function(n){return Qe.setOptions(n),S.defaults=Qe.defaults,Ia(S.defaults),S};S.getDefaults=ps;S.defaults=Ke;S.use=function(...n){return Qe.use(...n),S.defaults=Qe.defaults,Ia(S.defaults),S};S.walkTokens=function(n,e){return Qe.walkTokens(n,e)};S.parseInline=Qe.parseInline;S.Parser=Se;S.parser=Se.parse;S.Renderer=Wt;S.TextRenderer=ws;S.Lexer=ke;S.lexer=ke.lex;S.Tokenizer=Mn;S.Hooks=bn;S.parse=S;S.options;S.setOptions;S.use;S.walkTokens;S.parseInline;Se.parse;ke.lex;var Cd=Object.defineProperty,qa=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Cd(e,t,s),s};const Va=new Wt;Va.link=function({href:n,title:e,text:t}){return e??(e=t),`<a target="_blank" href="${n}" title="${e}">${t}</a>`};S.use({renderer:Va});const Ds=class Ds extends E{constructor(){super(...arguments),this.showLightbox=!1,this.imageUrl="",this.altText="",this.scrollRef=de(),this.contentRef=de(),this.autoScroll=!0,this.buffer="",this.pointer=0,this.imageRegexp=new RegExp(/!\[[^[]*\([^)]*\)/gm)}handleAutoscroll(){this.addEventListener("wheel",()=>{this.autoScroll=!1},{passive:!0}),this.addEventListener("click",()=>{this.autoScroll=!1})}handleLightboxClose(){this.addEventListener("action",e=>{e.detail.key==="close-lightbox"&&(this.showLightbox=!1)})}handleLightboxOpen(){this.contentRef.value.addEventListener("click",e=>{e.target.tagName==="IMG"&&(this.showLightbox=!0,this.imageUrl=e.target.src,this.altText=e.target.alt)})}includesImage(e){return this.imageRegexp.test(e)}getLastChunk(){const e=this.message.content.length-this.pointer;return e===0?"":(this.pointer=this.message.content.length,this.message.content.slice(-e))}firstUpdated(){this.handleAutoscroll(),this.handleLightboxOpen(),this.handleLightboxClose()}updated(){var s,r;const e=this.getLastChunk();if(!e)return;this.buffer+=e;const t=Ra.sanitize(S.parse(this.buffer));if(this.includesImage(this.buffer))(s=this.contentRef.value)==null||s.appendChild(document.createElement("div")),this.buffer="";else if(this.buffer.includes("!["))return;const i=(r=this.contentRef.value)==null?void 0:r.querySelector("div:last-of-type");i.innerHTML=Ii(t),this.applyCodeStyles(i),this.autoScroll&&this.scrollRef.value.scrollIntoView()}applyCodeStyles(e){if(!e)return;e.querySelectorAll("code").forEach(i=>{i.style.whiteSpace="pre-wrap"})}render(){return y`
827
+ <div class="message-type-markdown" ${pe(this.contentRef)}>
827
828
  <div></div>
828
829
  </div>
829
- <div class="scroll" ${W(this.scrollRef)}></div>
830
- ${this.showLightbox?g`<ace-lightbox
830
+ <div class="scroll" ${pe(this.scrollRef)}></div>
831
+ ${this.showLightbox?y`<ace-lightbox
831
832
  imageUrl="${this.imageUrl}"
832
833
  altText="${this.altText}"
833
834
  />`:null}
834
- `}};us.styles=[C`
835
+ `}};Ds.styles=[T`
835
836
  :host {
836
837
  box-sizing: border-box;
837
838
  }
@@ -869,16 +870,16 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
869
870
  height: auto;
870
871
  object-fit: contain;
871
872
  }
872
- `];let nt=us;Ur([b({attribute:!1})],nt.prototype,"message");Ur([S()],nt.prototype,"showLightbox");var zc=Object.defineProperty,Dc=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&zc(e,t,i),i};const ds=class ds extends w{constructor(){super(...arguments),this.escapeListener=e=>{e.key==="Escape"&&this.closeLightbox()}}firstUpdated(){document.addEventListener("keydown",this.escapeListener)}disconnectedCallback(){document.removeEventListener("keydown",this.escapeListener)}closeLightbox(){const e=new CustomEvent("action",{composed:!0,detail:{key:"close-lightbox"}});this.dispatchEvent(e)}handleKeyDown(e){if(e.key==="Tab"){const t=this.shadowRoot.querySelectorAll("button");if(t.length){const n=t[0],i=t[t.length-1];e.shiftKey?e.target===n&&(i.focus(),e.preventDefault()):e.target===i&&(n.focus(),e.preventDefault())}}}render(){return g`<div
873
+ `];let Gt=Ds;qa([k({attribute:!1})],Gt.prototype,"message");qa([O()],Gt.prototype,"showLightbox");var Ed=Object.defineProperty,Ad=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Ed(e,t,s),s};const Us=class Us extends E{constructor(){super(...arguments),this.escapeListener=e=>{e.key==="Escape"&&this.closeLightbox()}}firstUpdated(){document.addEventListener("keydown",this.escapeListener)}disconnectedCallback(){document.removeEventListener("keydown",this.escapeListener)}closeLightbox(){const e=new CustomEvent("action",{composed:!0,detail:{key:"close-lightbox"}});this.dispatchEvent(e)}handleKeyDown(e){if(e.key==="Tab"){const t=this.shadowRoot.querySelectorAll("button");if(t.length){const i=t[0],s=t[t.length-1];e.shiftKey?e.target===i&&(s.focus(),e.preventDefault()):e.target===s&&(i.focus(),e.preventDefault())}}}render(){return y`<div
873
874
  class="lightbox"
874
875
  tabindex="-1"
875
876
  @keydown=${this.handleKeyDown}
876
877
  >
877
878
  <button class="close" @click=${this.closeLightbox}>
878
- <telia-icon svg=${ya.svg} size="lg"></telia-icon>
879
+ <telia-icon svg=${Hc.svg} size="lg"></telia-icon>
879
880
  </button>
880
881
  <img src="${this.imageUrl}" alt="${this.altText??""}" />
881
- </div> `}};ds.styles=[C`
882
+ </div> `}};Us.styles=[T`
882
883
  :focus {
883
884
  outline-color: var(--focus-color);
884
885
  }
@@ -916,37 +917,37 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
916
917
  width: 80%;
917
918
  max-width: 700px;
918
919
  }
919
- `];let Rt=ds;Dc([b({attribute:!0})],Rt.prototype,"imageUrl");var Nc=Object.defineProperty,se=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&Nc(e,t,i),i};customElements.get("conversation-entry")||customElements.define("conversation-entry",At);customElements.get("ace-conversation-feed")||customElements.define("ace-conversation-feed",et);customElements.get("conversation-group")||customElements.define("conversation-group",Tt);customElements.get("ace-typing-state")||customElements.define("ace-typing-state",$n);customElements.get("message-type-html")||customElements.define("message-type-html",Ot);customElements.get("message-type-markdown")||customElements.define("message-type-markdown",nt);customElements.get("ace-lightbox")||customElements.define("ace-lightbox",Rt);const xi=$r(w),ps=class ps extends xi{constructor(){super(...arguments),this.message="",this.disabledInput=!1,this.disabledSkipToLatest=!1,this.disabledSubmit=!1,this.chatOverlayActive=!1,this.textAreaLength=0,this.isMuted=!1,this.conversationContentRef=Z(),this.conversationFeedRef=Z(),this.formRef=Z(),this.inputRef=Z(),this.scrollRef=Z(),this.counterRef=Z(),this.chatScrollHeight=0,this.chatCurrentScrollPosition=0,this.toast=new ql(this),this.messageMaxLength=1e3,this.messageMaxLengthLabel="Maximum character limit reached",this.skipToLatestMessageLabel="Skip to latest message",this.platform=null,this.entries=[],this.typing=!1,this.conversationState$=new H("waiting"),this.stateMachine=new Vl(this.conversationState$,this),this.provider$=this.stateMachine.session().pipe(Y(e=>e?e==null?void 0:e.provider$:cn(null))),this.userTyping$=new _}async connectedCallback(){super.connectedCallback(),this.messageMaxLength=this.properties.messageMaxLength??this.messageMaxLength,this.messageMaxLengthLabel=this.properties.messageMaxLengthLabel??this.messageMaxLengthLabel,this.skipToLatestMessageLabel=this.properties.skipToLatestMessageLabel??this.skipToLatestMessageLabel;const e=await this.application.container.get("conversation");this.platform=e||null;const t=this.application.trigger;t&&t.widgetActive$.pipe(O(t.componentIsDestroyed$)).subscribe(n=>{const i=this.conversationContentRef.value;i&&(n?i.scrollTop=this.chatCurrentScrollPosition:this.chatCurrentScrollPosition=i.scrollTop)}),this.stateSubscription=Lo([this.stateMachine.entries(),this.stateMachine.isTyping()]).subscribe(([n,i])=>{this.entries=n,this.typing=i}),this.userSubmitSubscription=yt(this,"user-submit").pipe(un(this.provider$)).subscribe(([n,i])=>{i&&i.onUserSubmit(n.detail)}),this._addHeaderOptions(),this.provider$.pipe(un(this.provider$)).subscribe(([n,i])=>{i&&i.showChatOverlay$.pipe().subscribe(r=>{this.chatOverlayActive=r})})}disconnectedCallback(){var e,t;super.disconnectedCallback(),(e=this.userSubmitSubscription)==null||e.unsubscribe(),(t=this.stateSubscription)==null||t.unsubscribe()}_actionHandler(e){}isTypingState(){var t,n;const e=(n=(t=this.conversationFeedRef.value)==null?void 0:t.shadowRoot)==null?void 0:n.querySelector(".conversation-feed");if(e){const i=e.lastElementChild;if(i&&i.tagName.toLowerCase()==="ace-typing-state")return!0}return!1}isAtBottom(){const e=this.conversationContentRef.value;return e?e.scrollHeight-e.scrollTop-e.clientHeight<1:!1}scrollToBottom(){var e,t;(!this.isTypingState()||this.isAtBottom())&&(setTimeout(()=>{var n;return(n=this.scrollRef.value)==null?void 0:n.scrollIntoView({behavior:"smooth"})},300),this.chatScrollHeight=(e=this.scrollRef.value)==null?void 0:e.scrollHeight,this.chatCurrentScrollPosition=(t=this.scrollRef.value)==null?void 0:t.scrollTop)}onSessionUpdated(){this.scrollToBottom()}disableInput(){this.disabledInput=!0,this.message=""}enableInput(){this.disabledInput=!1}enableSkipToLatestMessage(){this.disabledSkipToLatest=!1}disableSkipToLatestMessage(){this.disabledSkipToLatest=!0}disableSubmit(){this.disabledSubmit=!0}enableSubmit(){this.disabledSubmit=!1}clearMessages(){var i,r;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("ace-conversation-feed"),t=(r=e==null?void 0:e.shadowRoot)==null?void 0:r.querySelector(".conversation-feed"),n=t==null?void 0:t.querySelectorAll(".conversation-entry");n==null||n.forEach(o=>o.remove())}setToastMessage(e){this.toast.message=e}async _onSendMessage(e){var n,i;if(e.preventDefault(),this.message.length<=0||this.message.length>this.messageMaxLength){(n=this.formRef.value)==null||n.classList.add("shake"),setTimeout(()=>{var r;(r=this.formRef.value)==null||r.classList.remove("shake")},500);return}this.message=this.message.slice(0,this.messageMaxLength);const t=new CustomEvent("user-submit",{detail:{text:this.message}});this.dispatchEvent(t),this.message="",this.textAreaLength=0,(i=this.counterRef.value)==null||i.classList.remove("max-char-count-reached"),this.inputRef.value.style.height=this.style.getPropertyValue("--textarea-default-height")}_addHeaderOptions(){const e=this.application.getComponent("widget-header");if(!e)return;const t=this.application.texts,n=t.getOrFallback("conversation.mute","Mute"),i=t.getOrFallback("conversation.unmute","Unmute"),r=e.addOption({label:this.isMuted?i:n,icon:this.isMuted?Vs.svg:Zs.svg,closeOnClick:!1,datatestid:"options-mute-button",onClick:()=>{this.isMuted?(this.isMuted=!1,this.application.unmute(),r.updateLabel(n),r.updateIcon(Zs.svg)):(this.isMuted=!0,this.application.mute(),r.updateLabel(i),r.updateIcon(Vs.svg))}})}_inputHandler(e){var t,n;this.message=e.target.value,e.target.style.height=this.style.getPropertyValue("--textarea-default-height"),e.target.style.height=e.target.scrollHeight+"px",this.textAreaLength=e.target.value.length,e.target.value.length>this.messageMaxLength?(t=this.counterRef.value)==null||t.classList.add("max-char-count-reached"):(n=this.counterRef.value)==null||n.classList.remove("max-char-count-reached")}_keyDownHandler(e){this.userTyping$.next(e.key),e.key==="Enter"&&!e.shiftKey&&!this.disabledSubmit&&(this._onSendMessage(e),e.preventDefault())}skipToLatestMessage(){var n,i;const e=(n=this.conversationFeedRef)==null?void 0:n.value,t=(i=e==null?void 0:e.shadowRoot)==null?void 0:i.querySelectorAll(".conversation-entry");t.length&&Array.from(t).pop().focus()}handover(e,t){this.enableInput(),this.setToastMessage(null);const n=new CustomEvent("handover",{detail:{providerKey:e,providerOptions:t}});return this.dispatchEvent(n),n.detail.complete||$e}firstUpdated(){this.isMuted=this.application.storage.get("muteAudioNotifications")??!1}render(){var i,r,o;const e=this.application.texts;this.conversationState$.value==="waiting"&&((i=this.application)!=null&&i.storage)&&this.platform&&(this.stateMachine.setStorage(this.application.storage),this.conversationState$.next("init"));const t=this.application.settings.components.conversation;return((o=(r=t==null?void 0:t.properties)==null?void 0:r.chat)==null?void 0:o.isThirdPartyWidget)&&(this.renderRoot.host.style.width="100%"),g` <div
920
+ `];let Dn=Us;Ad([k({attribute:!0})],Dn.prototype,"imageUrl");var Td=Object.defineProperty,Oe=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Td(e,t,s),s};customElements.get("conversation-entry")||customElements.define("conversation-entry",Ln);customElements.get("ace-conversation-feed")||customElements.define("ace-conversation-feed",Vt);customElements.get("conversation-group")||customElements.define("conversation-group",Rn);customElements.get("ace-typing-state")||customElements.define("ace-typing-state",Hi);customElements.get("message-type-html")||customElements.define("message-type-html",In);customElements.get("message-type-markdown")||customElements.define("message-type-markdown",Gt);customElements.get("ace-lightbox")||customElements.define("ace-lightbox",Dn);const So=ka(E),Ns=class Ns extends So{constructor(){super(...arguments),this.message="",this.disabledInput=!1,this.disabledSkipToLatest=!1,this.disabledSubmit=!1,this.chatOverlayActive=!1,this.textAreaLength=0,this.isMuted=!1,this.conversationContentRef=de(),this.conversationFeedRef=de(),this.formRef=de(),this.inputRef=de(),this.scrollRef=de(),this.counterRef=de(),this.chatScrollHeight=0,this.chatCurrentScrollPosition=0,this.toast=new hh(this),this.messageMaxLength=1e3,this.messageMaxLengthLabel="Maximum character limit reached",this.skipToLatestMessageLabel="Skip to latest message",this.platform=null,this.entries=[],this.typing=!1,this.conversationState$=new ae("waiting"),this.stateMachine=new ph(this.conversationState$,this),this.provider$=this.stateMachine.session().pipe(_e(e=>e?e==null?void 0:e.provider$:Oi(null))),this.userTyping$=new P}async connectedCallback(){super.connectedCallback(),this.messageMaxLength=this.properties.messageMaxLength??this.messageMaxLength,this.messageMaxLengthLabel=this.properties.messageMaxLengthLabel??this.messageMaxLengthLabel,this.skipToLatestMessageLabel=this.properties.skipToLatestMessageLabel??this.skipToLatestMessageLabel;const e=await this.application.container.get("conversation");this.platform=e||null;const t=this.application.trigger;t&&t.widgetActive$.pipe(B(t.componentIsDestroyed$)).subscribe(i=>{const s=this.conversationContentRef.value;s&&(i?s.scrollTop=this.chatCurrentScrollPosition:this.chatCurrentScrollPosition=s.scrollTop)}),this.stateSubscription=Jl([this.stateMachine.entries(),this.stateMachine.isTyping()]).subscribe(([i,s])=>{this.entries=i,this.typing=s}),this.userSubmitSubscription=xn(this,"user-submit").pipe(Ri(this.provider$)).subscribe(([i,s])=>{s&&s.onUserSubmit(i.detail)}),this._addHeaderOptions(),this.provider$.pipe(Ri(this.provider$)).subscribe(([i,s])=>{s&&s.showChatOverlay$.pipe().subscribe(r=>{this.chatOverlayActive=r})})}disconnectedCallback(){var e,t;super.disconnectedCallback(),(e=this.userSubmitSubscription)==null||e.unsubscribe(),(t=this.stateSubscription)==null||t.unsubscribe()}_actionHandler(e){}isTypingState(){var t,i;const e=(i=(t=this.conversationFeedRef.value)==null?void 0:t.shadowRoot)==null?void 0:i.querySelector(".conversation-feed");if(e){const s=e.lastElementChild;if(s&&s.tagName.toLowerCase()==="ace-typing-state")return!0}return!1}isAtBottom(){const e=this.conversationContentRef.value;return e?e.scrollHeight-e.scrollTop-e.clientHeight<1:!1}scrollToBottom(){var e,t;(!this.isTypingState()||this.isAtBottom())&&(setTimeout(()=>{var i;return(i=this.scrollRef.value)==null?void 0:i.scrollIntoView({behavior:"smooth"})},300),this.chatScrollHeight=(e=this.scrollRef.value)==null?void 0:e.scrollHeight,this.chatCurrentScrollPosition=(t=this.scrollRef.value)==null?void 0:t.scrollTop)}onSessionUpdated(){this.scrollToBottom()}disableInput(){this.disabledInput=!0,this.message=""}enableInput(){this.disabledInput=!1}enableSkipToLatestMessage(){this.disabledSkipToLatest=!1}disableSkipToLatestMessage(){this.disabledSkipToLatest=!0}disableSubmit(){this.disabledSubmit=!0}enableSubmit(){this.disabledSubmit=!1}clearMessages(){var s,r;const e=(s=this.shadowRoot)==null?void 0:s.querySelector("ace-conversation-feed"),t=(r=e==null?void 0:e.shadowRoot)==null?void 0:r.querySelector(".conversation-feed"),i=t==null?void 0:t.querySelectorAll(".conversation-entry");i==null||i.forEach(o=>o.remove())}setToastMessage(e){this.toast.message=e}async _onSendMessage(e){var i,s;if(e.preventDefault(),this.message.length<=0||this.message.length>this.messageMaxLength){(i=this.formRef.value)==null||i.classList.add("shake"),setTimeout(()=>{var r;(r=this.formRef.value)==null||r.classList.remove("shake")},500);return}this.message=this.message.slice(0,this.messageMaxLength);const t=new CustomEvent("user-submit",{detail:{text:this.message}});this.dispatchEvent(t),this.message="",this.textAreaLength=0,(s=this.counterRef.value)==null||s.classList.remove("max-char-count-reached"),this.inputRef.value.style.height=this.style.getPropertyValue("--textarea-default-height")}_addHeaderOptions(){const e=this.application.getComponent("widget-header");if(!e)return;const t=this.application.texts,i=t.getOrFallback("conversation.mute","Mute"),s=t.getOrFallback("conversation.unmute","Unmute"),r=e.addOption({label:this.isMuted?s:i,icon:this.isMuted?Nr.svg:zr.svg,closeOnClick:!1,datatestid:"options-mute-button",onClick:()=>{this.isMuted?(this.isMuted=!1,this.application.unmute(),r.updateLabel(i),r.updateIcon(zr.svg)):(this.isMuted=!0,this.application.mute(),r.updateLabel(s),r.updateIcon(Nr.svg))}})}_inputHandler(e){var t,i;this.message=e.target.value,e.target.style.height=this.style.getPropertyValue("--textarea-default-height"),e.target.style.height=e.target.scrollHeight+"px",this.textAreaLength=e.target.value.length,e.target.value.length>this.messageMaxLength?(t=this.counterRef.value)==null||t.classList.add("max-char-count-reached"):(i=this.counterRef.value)==null||i.classList.remove("max-char-count-reached")}_keyDownHandler(e){this.userTyping$.next(e.key),e.key==="Enter"&&!e.shiftKey&&!this.disabledSubmit&&(this._onSendMessage(e),e.preventDefault())}skipToLatestMessage(){var i,s;const e=(i=this.conversationFeedRef)==null?void 0:i.value,t=(s=e==null?void 0:e.shadowRoot)==null?void 0:s.querySelectorAll(".conversation-entry");t.length&&Array.from(t).pop().focus()}handover(e,t){this.enableInput(),this.setToastMessage(null);const i=new CustomEvent("handover",{detail:{providerKey:e,providerOptions:t}});return this.dispatchEvent(i),i.detail.complete||Xe}firstUpdated(){this.isMuted=this.application.storage.get("muteAudioNotifications")??!1}render(){var s,r,o;const e=this.application.texts;this.conversationState$.value==="waiting"&&((s=this.application)!=null&&s.storage)&&this.platform&&(this.stateMachine.setStorage(this.application.storage),this.conversationState$.next("init"));const t=this.application.settings.components.conversation;return((o=(r=t==null?void 0:t.properties)==null?void 0:r.chat)==null?void 0:o.isThirdPartyWidget)&&(this.renderRoot.host.style.width="100%"),y` <div
920
921
  @action=${this._actionHandler}
921
- class=${Re({conversation:!0,disabled:this.disabledInput,"conversation--has-toast":this.toast.hasMessage(),"conversation--input-has-valid-text":this.message.length>0&&this.message.length<=this.messageMaxLength&&!this.disabledSubmit,"overlay-mode":this.chatOverlayActive})}
922
+ class=${vt({conversation:!0,disabled:this.disabledInput,"conversation--has-toast":this.toast.hasMessage(),"conversation--input-has-valid-text":this.message.length>0&&this.message.length<=this.messageMaxLength&&!this.disabledSubmit,"overlay-mode":this.chatOverlayActive})}
922
923
  >
923
- ${this.chatOverlayActive?g`<div class="overlay-header">
924
+ ${this.chatOverlayActive?y`<div class="overlay-header">
924
925
  <button
925
926
  class="overlay-button"
926
927
  @click=${()=>this.chatOverlayActive=!1}
927
928
  >
928
- <telia-icon svg=${Ji.svg}></telia-icon>
929
+ <telia-icon svg=${ea.svg}></telia-icon>
929
930
  </button>
930
- </div>`:v}
931
+ </div>`:w}
931
932
  <div
932
- class=${Re({"conversation-content":!0,"conversation-overlay-mode":this.chatOverlayActive})}
933
+ class=${vt({"conversation-content":!0,"conversation-overlay-mode":this.chatOverlayActive})}
933
934
  part="scroll-container"
934
935
  aria-live="polite"
935
- ${W(this.conversationContentRef)}
936
+ ${pe(this.conversationContentRef)}
936
937
  >
937
- ${this.toast.hasMessage()?g`<div class="conversation__toast">${this.toast.message}</div>`:v}
938
+ ${this.toast.hasMessage()?y`<div class="conversation__toast">${this.toast.message}</div>`:w}
938
939
  <ace-conversation-feed
939
940
  .entries=${this.entries}
940
941
  .loading=${this.typing}
941
- ${W(this.conversationFeedRef)}
942
+ ${pe(this.conversationFeedRef)}
942
943
  @updated=${this.onSessionUpdated}
943
944
  ></ace-conversation-feed>
944
- <div class="scroll" ${W(this.scrollRef)}></div>
945
+ <div class="scroll" ${pe(this.scrollRef)}></div>
945
946
  </div>
946
947
  <form
947
948
  class="conversation-bottom"
948
949
  @submit=${this._onSendMessage}
949
- ${W(this.formRef)}
950
+ ${pe(this.formRef)}
950
951
  >
951
952
  <label for="chat-message-input" class="visually-hidden">
952
953
  Chat message
@@ -960,7 +961,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
960
961
  ?disabled=${this.disabledInput}
961
962
  @input=${this._inputHandler}
962
963
  @keydown=${this._keyDownHandler}
963
- ${W(this.inputRef)}
964
+ ${pe(this.inputRef)}
964
965
  aria-valuenow=${this.textAreaLength}
965
966
  aria-valuemax=${this.messageMaxLength}
966
967
  aria-valuemin="0"
@@ -975,9 +976,9 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
975
976
  title=${e.getOrFallback("conversation.send-alt","Send")}
976
977
  ?disabled=${this.disabledSubmit}
977
978
  >
978
- <telia-icon svg=${Xi.svg}></telia-icon>
979
+ <telia-icon svg=${na.svg}></telia-icon>
979
980
  </button>
980
- <span class="counter" ${W(this.counterRef)}>
981
+ <span class="counter" ${pe(this.counterRef)}>
981
982
  ${this.textAreaLength} / ${this.messageMaxLength}</span
982
983
  >
983
984
  </div>
@@ -985,13 +986,13 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
985
986
  ${this.textAreaLength>this.messageMaxLength?this.messageMaxLengthLabel:""}
986
987
  </div>
987
988
  </form>
988
- ${this.disabledSkipToLatest?v:g`<button
989
+ ${this.disabledSkipToLatest?w:y`<button
989
990
  class="skip-to-latest-message-button"
990
991
  @click=${this.skipToLatestMessage}
991
992
  >
992
993
  ${this.skipToLatestMessageLabel}
993
994
  </button>`}
994
- </div>`}};ps.styles=[xi.styles||[],C`
995
+ </div>`}};Ns.styles=[So.styles||[],T`
995
996
  :host {
996
997
  font-family: var(--font-family);
997
998
  /* --send-icon-color: var(--gray-dark-color, #a6a6a6); */
@@ -1273,10 +1274,10 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1273
1274
  clip: rect(0, 0, 0, 0);
1274
1275
  border: 0;
1275
1276
  }
1276
- `];let q=ps;se([S()],q.prototype,"message");se([S()],q.prototype,"disabledInput");se([S()],q.prototype,"disabledSkipToLatest");se([S()],q.prototype,"disabledSubmit");se([S()],q.prototype,"chatOverlayActive");se([S()],q.prototype,"textAreaLength");se([S()],q.prototype,"platform");se([S()],q.prototype,"entries");se([S()],q.prototype,"typing");const J=s=>s.objectType==="info",Bc=s=>s.objectType==="chatEntry",Hc=s=>s.objectType==="pen",qc=s=>s.objectType==="chatButtonClicked",Fc=s=>s.objectType==="endVideoButtonClicked",Vc=s=>s.type==="queue-status",Zc=s=>s.type==="established",Wc=s=>s.type==="pen-status",Gc=s=>s.type==="prepareVideo",Qc=s=>s.type==="videoPrepared",Kc=s=>s.type==="chatButtonClicked",Jc=s=>s.type==="endVideoButtonClicked",Yc=s=>s.type==="chat-ended";class It extends Error{constructor(e){super(e),this.name="EngineException"}}class Jn{constructor(e,t){this.endpoint=e,this.timeout=t,this.protocolVersion="A",this.penStatusJustSent=!1}async chatJoin(e){var n,i,r;const t=await this.sendRequest("chatJoin",{invitationUid:e.invitationUid,uid:e.uid,instance:e.instance,protocolVersion:this.protocolVersion,videoChatMode:e.videoChatMode,customerName:e.customerName});if(!t.dataObjects||!((n=t==null?void 0:t.dataObjects)!=null&&n.length)||((i=t==null?void 0:t.dataObjects[0])==null?void 0:i.infoType)==="error")throw t.dataObjects?new Error(`chatRequest - ${(r=t==null?void 0:t.dataObjects[0])==null?void 0:r.text}`):new Error("chatRequest - unknown error")}async chatRequest(e){var n,i,r,o,a;const t=await this.sendRequest("chatRequest",{...e.customData,uid:e.uid,instance:e.instance,queueMessageInterval:e.queueMessageInterval.toString(),protocolVersion:this.protocolVersion,entrance:e.entrance,errand:e.errand.length?e.errand:"997",videoChatMode:e.videoChatMode,customerName:e.customerName,customerEmailAddress:e.customerEmailAddress,visitorQuestion:e.visitorQuestion,visitorUserAgent:((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)||"",sourceUrl:((i=window==null?void 0:window.location)==null?void 0:i.href)||"",...e.authToken&&{authToken:e.authToken}});if(!t.dataObjects||!((r=t==null?void 0:t.dataObjects)!=null&&r.length)||((o=t==null?void 0:t.dataObjects[0])==null?void 0:o.infoType)==="error")throw t.dataObjects?new Error(`chatRequest - ${(a=t==null?void 0:t.dataObjects[0])==null?void 0:a.text}`):new Error("chatRequest - unknown error")}async videoPrepared(e){await this.sendRequest("videoPrepared",{uid:e.uid,instance:e.instance,result:e.result,protocolVersion:this.protocolVersion})}chatRead(e){return this.sendRequest("chatRead",{uid:e.uid,instance:e.instance,entrance:e.entrance,maxObjectId:`${e.maxObjectId}`,protocolVersion:this.protocolVersion})}sendPenStatusOn(e){if(this.penStatusTimer&&clearTimeout(this.penStatusTimer),e.key==="Enter"){this.penStatusJustSent=!1;return}this.penStatusJustSent||(this.sendRequest("chatPenStatus",{uid:e.uid,instance:e.instance,penStatus:"on",protocolVersion:this.protocolVersion}),this.penStatusJustSent=!0,setTimeout(()=>{this.penStatusJustSent=!1},5e3)),this.penStatusTimer=setTimeout(()=>this.sendPenStatusOff(e),5e3)}sendPenStatusOff(e){this.penStatusJustSent&&clearTimeout(this.penStatusTimer),this.sendRequest("chatPenStatus",{uid:e.uid,instance:e.instance,penStatus:"off",protocolVersion:this.protocolVersion})}chatWrite(e){return this.sendPenStatusOff(e),this.sendRequest("chatWrite",{uid:e.uid,instance:e.instance,clockstamp:e.clockstamp,message:e.message,protocolVersion:this.protocolVersion})}async chatQuit(e){this.sendPenStatusOff(e),await this.sendRequest("chatQuit",{uid:e.uid,instance:e.instance,protocolVersion:this.protocolVersion})}async chatCheckSession(e){var n;const t=await this.sendRequest("chatCheckSession",{uid:e.uid,instance:e.instance,protocolVersion:this.protocolVersion});return Object.keys(t).length===0?null:((n=t.dataObjects)==null||n.sort((i,r)=>i.objectId-r.objectId),t)}async chatEmailSession(e){return this.sendRequest("chatEmailSession",{uid:e.uid,instance:e.instance,emailAddress:e.emailAddress,protocolVersion:this.protocolVersion})}async sendRequest(e,t){const n=this.endpoint.includes("engine-simulator")?"include":void 0,i=`${Jn.removeTrailingSlashes(this.endpoint)}/${e}`,r=await fetch(i,{body:new URLSearchParams(t),method:"POST",credentials:n,headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"*/*"},signal:this.timeout?AbortSignal.timeout(this.timeout):void 0});return Number(r.headers.get("content-length"))>0?r.json():{}}static removeTrailingSlashes(e){return e.replace(/\/+$/,"")}}const Xc=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,s=>(+s^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+s/4).toString(16)),kn=()=>typeof crypto.randomUUID=="function"?crypto.randomUUID():Xc();function Cn(s){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)}function jr(s){return s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class eh{constructor(e,t){this.config=e,this.messageSubject$=new _,this.actionsSubject$=new _,this.messages=()=>this.messageSubject$.asObservable(),this.actions=()=>this.actionsSubject$.asObservable(),this.sessionId="",this.lastObjectId=0,this.sessionId=t??kn(),this.client=new Jn(this.config.engineUrl,this.config.engineTimeout)}chatJoin(e){return fe(this.client.chatJoin({invitationUid:e.invitationUid,uid:this.sessionId,customerName:e.customerName,instance:this.config.instance,videoChatMode:this.config.videoChatMode})).pipe(hn(t=>(console.error(t),this.messageSubject$.next({text:this.config.errorMessage??"An error occured",source:"system"}),new T)),Y(()=>this.poll().pipe(Jt(()=>this.poll()),Yt())))}chatRequest(e){return fe(this.client.chatRequest({uid:this.sessionId,customerName:e.customerName,customerEmailAddress:e.customerEmailAddress,visitorQuestion:e.visitorQuestion,instance:this.config.instance,queueMessageInterval:this.config.queueMessageInterval,entrance:this.config.entrance,errand:e.errand,videoChatMode:this.config.videoChatMode,customData:e.customData,...e.authToken&&{authToken:e.authToken}})).pipe(hn(t=>(console.error(t),this.messageSubject$.next({text:this.config.errorMessage??"An error occured",source:"system"}),new T)),Y(()=>this.poll().pipe(Jt(()=>this.poll()),Yt())))}reconnect(){return this.poll().pipe(Jt(()=>this.poll()),Yt())}poll(){return Uo(()=>fe(this.client.chatRead({uid:this.sessionId,instance:this.config.instance,entrance:this.config.entrance,maxObjectId:this.lastObjectId})).pipe(qo(e=>{this.processMessages(e)})))}async chatWrite(e){const t=await this.client.chatWrite({uid:this.sessionId,instance:this.config.instance,clockstamp:Date.now().toString(),message:e}),n=((t==null?void 0:t.dataObjects)||[]).find(i=>J(i)&&i.infoType==="error");if(n)throw new It(n.text||"Unable to send message")}sendPenStatusOn(e){this.client.sendPenStatusOn({uid:this.sessionId,instance:this.config.instance,key:e})}async videoPrepared(e){await this.client.videoPrepared({uid:this.sessionId,instance:this.config.instance,result:e})}async chatQuit(){await this.client.chatQuit({uid:this.sessionId,instance:this.config.instance})}async chatEmailSession(e){const t=await this.client.chatEmailSession({uid:this.sessionId,instance:this.config.instance,emailAddress:e});if(((t==null?void 0:t.dataObjects)||[]).find(i=>J(i)&&i.infoType==="error"))throw new It("Unable to send email with conversation")}processMessages(e){e.dataObjects.forEach(t=>{Bc(t)&&t.source&&t.objectId>=this.lastObjectId&&this.messageSubject$.next({text:t.message,source:t.source,invitationNo:t.invitationNo.toString(),alias:t.alias}),Hc(t)&&this.actionsSubject$.next({penStatus:t.penStatus,type:"pen-status"}),J(t)&&t.infoType==="queue"&&this.actionsSubject$.next({text:t.text,type:"queue-status"}),J(t)&&t.infoType==="established"&&this.actionsSubject$.next({text:t.text,agent:t.agent,type:"established",videoEnded:t.videoEnded,contactId:t.contactId,agentUsername:t.agentUsername,entrance:t.entrance,errand:t.errand}),J(t)&&t.infoType==="prepareVideo"&&this.actionsSubject$.next({type:"prepareVideo"}),J(t)&&t.infoType==="videoPrepared"&&this.actionsSubject$.next({text:t.text,agent:t.agent,type:"videoPrepared",userUrl:t.userUrl}),qc(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"chatButtonClicked"}),Fc(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"endVideoButtonClicked"}),J(t)&&["afterChat","finished"].includes(t.infoType)&&this.actionsSubject$.next({text:t.text,type:"chat-ended",showForm:t.infoType==="afterChat",contactId:t.contactId})}),this.lastObjectId=e.maxObjectId}async getChatStatus(){const e=await this.client.chatCheckSession({uid:this.sessionId,instance:this.config.instance});if(!e)return"noSession";const t=e.dataObjects;for(const n of t)if(J(n))switch(n.infoType){case"finished":case"afterChat":return"finished";case"noSession":return"noSession"}return"active"}async rehydrate(){const e=await this.client.chatCheckSession({uid:this.sessionId,instance:this.config.instance});return!e||(e.dataObjects||[]).find(t=>J(t)&&t.infoType==="noSession")?null:(this.processMessages(e),e)}}class oe{constructor(e){this._email="",this._host=e,e.addController(this)}static getInstance(e){return oe.instance?oe.instance.updateHost(e):oe.instance=new oe(e),oe.instance}updateHost(e){this._host=e,e.addController(this)}hostConnected(){}set email(e){this._email=e,this._host.requestUpdate()}get email(){return this._email}clearData(){this._email="",this._host.requestUpdate()}}var th=Object.defineProperty,ze=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&th(e,t,i),i},Oe;let we=(Oe=class extends w{constructor(){super(),this.submitted=!1,this.customData=[],this.customerName="",this.validationErrors=[],this.showValidationWarning=!1,this.emailController=oe.getInstance(this),this.emailController.clearData()}connectedCallback(){var r,o,a,l;super.connectedCallback();const e=this.application.settings.components.conversation,t=this.application.userData,n=((o=(r=e==null?void 0:e.properties)==null?void 0:r.chat)==null?void 0:o.customData)||[];this.customData=n.map(c=>{let h;switch(c.entryType){case"text":case"dropdown":h="";break;case"number":h=0;break;case"boolean":h=!1;break}return{...c,value:h}});const i=this.customData.find(c=>c.name==="customerName");i&&(this.customerName=((l=(a=t.completionData)==null?void 0:a.user)==null?void 0:l.name)||"",i.value=this.customerName)}_onStartChat(e){if(e.preventDefault(),this.showValidationWarning=!1,this.customData.forEach(c=>{this.validateCustomDataEntry(c)}),this.validationErrors.length>0){this.showValidationWarning=!0;return}this.submitted=!0;const t=this.customData.find(c=>c.name==="customerEmailAddress");t&&(this.emailController.email=t.value);const n=this.customData.reduce((c,h)=>(c[h.name]=h.value,c),{}),{customerName:i,customerEmailAddress:r,visitorQuestion:o,...a}=n,l=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{key:"submitted",data:{name:i,email:r,question:o,customData:a}}});this.dispatchEvent(l)}_customDataValueChanged(e,t){this.customData=this.customData.map(n=>(n.name===t.name&&(n.value=e),n))}validateCustomDataEntry(e){e.required&&(e.name==="customerEmailAddress"&&!Cn(e.value)?this.validationErrors.includes(e.name)||this.validationErrors.push(e.name):e.value?this.validationErrors=this.validationErrors.filter(t=>t!==e.name):this.validationErrors.includes(e.name)||this.validationErrors.push(e.name))}render(){if(this.submitted)return v;const e=this.application.texts;return g`<div class="container">
1277
+ `];let le=Ns;Oe([O()],le.prototype,"message");Oe([O()],le.prototype,"disabledInput");Oe([O()],le.prototype,"disabledSkipToLatest");Oe([O()],le.prototype,"disabledSubmit");Oe([O()],le.prototype,"chatOverlayActive");Oe([O()],le.prototype,"textAreaLength");Oe([O()],le.prototype,"platform");Oe([O()],le.prototype,"entries");Oe([O()],le.prototype,"typing");const we=n=>n.objectType==="info",Od=n=>n.objectType==="chatEntry",Ld=n=>n.objectType==="pen",Rd=n=>n.objectType==="chatButtonClicked",Id=n=>n.objectType==="endVideoButtonClicked",Pd=n=>n.type==="queue-status",Md=n=>n.type==="established",Dd=n=>n.type==="pen-status",Ud=n=>n.type==="prepareVideo",Nd=n=>n.type==="videoPrepared",zd=n=>n.type==="chatButtonClicked",jd=n=>n.type==="endVideoButtonClicked",Hd=n=>n.type==="chat-ended";class Un extends Error{constructor(e){super(e),this.name="EngineException"}}class xs{constructor(e,t){this.endpoint=e,this.timeout=t,this.protocolVersion="A",this.penStatusJustSent=!1}async chatJoin(e){var i,s,r;const t=await this.sendRequest("chatJoin",{invitationUid:e.invitationUid,uid:e.uid,instance:e.instance,protocolVersion:this.protocolVersion,videoChatMode:e.videoChatMode,customerName:e.customerName});if(!t.dataObjects||!((i=t==null?void 0:t.dataObjects)!=null&&i.length)||((s=t==null?void 0:t.dataObjects[0])==null?void 0:s.infoType)==="error")throw t.dataObjects?new Error(`chatRequest - ${(r=t==null?void 0:t.dataObjects[0])==null?void 0:r.text}`):new Error("chatRequest - unknown error")}async chatRequest(e){var i,s,r,o,a;const t=await this.sendRequest("chatRequest",{...e.customData,uid:e.uid,instance:e.instance,queueMessageInterval:e.queueMessageInterval.toString(),protocolVersion:this.protocolVersion,entrance:e.entrance,errand:e.errand.length?e.errand:"997",videoChatMode:e.videoChatMode,customerName:e.customerName,customerEmailAddress:e.customerEmailAddress,visitorQuestion:e.visitorQuestion,visitorUserAgent:((i=window==null?void 0:window.navigator)==null?void 0:i.userAgent)||"",sourceUrl:((s=window==null?void 0:window.location)==null?void 0:s.href)||"",...e.authToken&&{authToken:e.authToken}});if(!t.dataObjects||!((r=t==null?void 0:t.dataObjects)!=null&&r.length)||((o=t==null?void 0:t.dataObjects[0])==null?void 0:o.infoType)==="error")throw t.dataObjects?new Error(`chatRequest - ${(a=t==null?void 0:t.dataObjects[0])==null?void 0:a.text}`):new Error("chatRequest - unknown error")}async videoPrepared(e){await this.sendRequest("videoPrepared",{uid:e.uid,instance:e.instance,result:e.result,protocolVersion:this.protocolVersion})}chatRead(e){return this.sendRequest("chatRead",{uid:e.uid,instance:e.instance,entrance:e.entrance,maxObjectId:`${e.maxObjectId}`,protocolVersion:this.protocolVersion})}sendPenStatusOn(e){if(this.penStatusTimer&&clearTimeout(this.penStatusTimer),e.key==="Enter"){this.penStatusJustSent=!1;return}this.penStatusJustSent||(this.sendRequest("chatPenStatus",{uid:e.uid,instance:e.instance,penStatus:"on",protocolVersion:this.protocolVersion}),this.penStatusJustSent=!0,setTimeout(()=>{this.penStatusJustSent=!1},5e3)),this.penStatusTimer=setTimeout(()=>this.sendPenStatusOff(e),5e3)}sendPenStatusOff(e){this.penStatusJustSent&&clearTimeout(this.penStatusTimer),this.sendRequest("chatPenStatus",{uid:e.uid,instance:e.instance,penStatus:"off",protocolVersion:this.protocolVersion})}chatWrite(e){return this.sendPenStatusOff(e),this.sendRequest("chatWrite",{uid:e.uid,instance:e.instance,clockstamp:e.clockstamp,message:e.message,protocolVersion:this.protocolVersion})}async chatQuit(e){this.sendPenStatusOff(e),await this.sendRequest("chatQuit",{uid:e.uid,instance:e.instance,protocolVersion:this.protocolVersion})}async chatCheckSession(e){var i;const t=await this.sendRequest("chatCheckSession",{uid:e.uid,instance:e.instance,protocolVersion:this.protocolVersion});return Object.keys(t).length===0?null:((i=t.dataObjects)==null||i.sort((s,r)=>s.objectId-r.objectId),t)}async chatEmailSession(e){return this.sendRequest("chatEmailSession",{uid:e.uid,instance:e.instance,emailAddress:e.emailAddress,protocolVersion:this.protocolVersion})}async sendRequest(e,t){const i=this.endpoint.includes("engine-simulator")?"include":void 0,s=`${xs.removeTrailingSlashes(this.endpoint)}/${e}`,r=await fetch(s,{body:new URLSearchParams(t),method:"POST",credentials:i,headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"*/*"},signal:this.timeout?AbortSignal.timeout(this.timeout):void 0});return Number(r.headers.get("content-length"))>0?r.json():{}}static removeTrailingSlashes(e){return e.replace(/\/+$/,"")}}const Fd=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+n/4).toString(16)),Zi=()=>typeof crypto.randomUUID=="function"?crypto.randomUUID():Fd();function Yi(n){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)}function Wa(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class Bd{constructor(e,t){this.config=e,this.messageSubject$=new P,this.actionsSubject$=new P,this.messages=()=>this.messageSubject$.asObservable(),this.actions=()=>this.actionsSubject$.asObservable(),this.sessionId="",this.lastObjectId=0,this.sessionId=t??Zi(),this.client=new xs(this.config.engineUrl,this.config.engineTimeout)}chatJoin(e){return Ve(this.client.chatJoin({invitationUid:e.invitationUid,uid:this.sessionId,customerName:e.customerName,instance:this.config.instance,videoChatMode:this.config.videoChatMode})).pipe(Li(t=>(console.error(t),this.messageSubject$.next({text:this.config.errorMessage??"An error occured",source:"system"}),new j)),_e(()=>this.poll().pipe(pi(()=>this.poll()),fi())))}chatRequest(e){return Ve(this.client.chatRequest({uid:this.sessionId,customerName:e.customerName,customerEmailAddress:e.customerEmailAddress,visitorQuestion:e.visitorQuestion,instance:this.config.instance,queueMessageInterval:this.config.queueMessageInterval,entrance:this.config.entrance,errand:e.errand,videoChatMode:this.config.videoChatMode,customData:e.customData,...e.authToken&&{authToken:e.authToken}})).pipe(Li(t=>(console.error(t),this.messageSubject$.next({text:this.config.errorMessage??"An error occured",source:"system"}),new j)),_e(()=>this.poll().pipe(pi(()=>this.poll()),fi())))}reconnect(){return this.poll().pipe(pi(()=>this.poll()),fi())}poll(){return ic(()=>Ve(this.client.chatRead({uid:this.sessionId,instance:this.config.instance,entrance:this.config.entrance,maxObjectId:this.lastObjectId})).pipe(hc(e=>{this.processMessages(e)})))}async chatWrite(e){const t=await this.client.chatWrite({uid:this.sessionId,instance:this.config.instance,clockstamp:Date.now().toString(),message:e}),i=((t==null?void 0:t.dataObjects)||[]).find(s=>we(s)&&s.infoType==="error");if(i)throw new Un(i.text||"Unable to send message")}sendPenStatusOn(e){this.client.sendPenStatusOn({uid:this.sessionId,instance:this.config.instance,key:e})}async videoPrepared(e){await this.client.videoPrepared({uid:this.sessionId,instance:this.config.instance,result:e})}async chatQuit(){await this.client.chatQuit({uid:this.sessionId,instance:this.config.instance})}async chatEmailSession(e){const t=await this.client.chatEmailSession({uid:this.sessionId,instance:this.config.instance,emailAddress:e});if(((t==null?void 0:t.dataObjects)||[]).find(s=>we(s)&&s.infoType==="error"))throw new Un("Unable to send email with conversation")}processMessages(e){e.dataObjects.forEach(t=>{Od(t)&&t.source&&t.objectId>=this.lastObjectId&&this.messageSubject$.next({text:t.message,source:t.source,invitationNo:t.invitationNo.toString(),alias:t.alias}),Ld(t)&&this.actionsSubject$.next({penStatus:t.penStatus,type:"pen-status"}),we(t)&&t.infoType==="queue"&&this.actionsSubject$.next({text:t.text,type:"queue-status"}),we(t)&&t.infoType==="established"&&this.actionsSubject$.next({text:t.text,agent:t.agent,type:"established",videoEnded:t.videoEnded,contactId:t.contactId,agentUsername:t.agentUsername,entrance:t.entrance,errand:t.errand}),we(t)&&t.infoType==="prepareVideo"&&this.actionsSubject$.next({type:"prepareVideo"}),we(t)&&t.infoType==="videoPrepared"&&this.actionsSubject$.next({text:t.text,agent:t.agent,type:"videoPrepared",userUrl:t.userUrl}),Rd(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"chatButtonClicked"}),Id(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"endVideoButtonClicked"}),we(t)&&["afterChat","finished"].includes(t.infoType)&&this.actionsSubject$.next({text:t.text,type:"chat-ended",showForm:t.infoType==="afterChat",contactId:t.contactId})}),this.lastObjectId=e.maxObjectId}async getChatStatus(){const e=await this.client.chatCheckSession({uid:this.sessionId,instance:this.config.instance});if(!e)return"noSession";const t=e.dataObjects;for(const i of t)if(we(i))switch(i.infoType){case"finished":case"afterChat":return"finished";case"noSession":return"noSession"}return"active"}async rehydrate(){const e=await this.client.chatCheckSession({uid:this.sessionId,instance:this.config.instance});return!e||(e.dataObjects||[]).find(t=>we(t)&&t.infoType==="noSession")?null:(this.processMessages(e),e)}}class Ie{constructor(e){this._email="",this._host=e,e.addController(this)}static getInstance(e){return Ie.instance?Ie.instance.updateHost(e):Ie.instance=new Ie(e),Ie.instance}updateHost(e){this._host=e,e.addController(this)}hostConnected(){}set email(e){this._email=e,this._host.requestUpdate()}get email(){return this._email}clearData(){this._email="",this._host.requestUpdate()}}var qd=Object.defineProperty,xt=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&qd(e,t,s),s},ft;let Je=(ft=class extends E{constructor(){super(),this.submitted=!1,this.customData=[],this.customerName="",this.validationErrors=[],this.showValidationWarning=!1,this.emailController=Ie.getInstance(this),this.emailController.clearData()}connectedCallback(){var r,o,a,l;super.connectedCallback();const e=this.application.settings.components.conversation,t=this.application.userData,i=((o=(r=e==null?void 0:e.properties)==null?void 0:r.chat)==null?void 0:o.customData)??[];this.customData=i.map(c=>{let u;switch(c.entryType){case"text":case"dropdown":u="";break;case"number":u=0;break;case"boolean":u=!1;break}return{...c,value:u}});const s=this.customData.find(c=>c.name==="customerName");s&&(this.customerName=((l=(a=t.completionData)==null?void 0:a.user)==null?void 0:l.name)??"",s.value=this.customerName)}_onStartChat(e){if(e.preventDefault(),this.showValidationWarning=!1,this.customData.forEach(c=>{this.validateCustomDataEntry(c)}),this.validationErrors.length>0){this.showValidationWarning=!0;return}this.submitted=!0;const t=this.customData.find(c=>c.name==="customerEmailAddress");t&&(this.emailController.email=t.value);const i=this.customData.reduce((c,u)=>(c[u.name]=u.value,c),{}),{customerName:s,customerEmailAddress:r,visitorQuestion:o,...a}=i,l=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{key:"submitted",data:{name:s,email:r,question:o,customData:a}}});this.dispatchEvent(l)}_customDataValueChanged(e,t){this.customData=this.customData.map(i=>(i.name===t.name&&(i.value=e),i))}validateCustomDataEntry(e){e.required&&(e.name==="customerEmailAddress"&&!Yi(e.value)||!e.value?this.validationErrors.includes(e.name)||this.validationErrors.push(e.name):this.validationErrors=this.validationErrors.filter(t=>t!==e.name))}render(){if(this.submitted)return w;const e=this.application.texts;return y`<div class="container">
1277
1278
  <form class="form" @submit=${this._onStartChat}>
1278
1279
  <div class="header-row">
1279
- <telia-icon class="header-icon" svg=${Ki.svg}></telia-icon>
1280
+ <telia-icon class="header-icon" svg=${Jo.svg}></telia-icon>
1280
1281
  <h3 class="header-text">
1281
1282
  ${this.customerName?e.getOrFallback("welcome-form.header-text-personal","Chat with us").replace("{customerName}",this.customerName):e.getOrFallback("welcome-form.header-text","Chat with us")}
1282
1283
  </h3>
@@ -1284,21 +1285,21 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1284
1285
  <p class="description-text">
1285
1286
  ${e.getOrFallback("welcome-form.welcome-text","Please fill out the form below to start chatting with the next available agent.")}
1286
1287
  </p>
1287
- ${this.customData.map(t=>{if(t.name==="customerName"){const n=this.application.storage.get("auth");n!=null&&n.authenticated&&(t.value=n==null?void 0:n.name,t.disabled=!0)}return g`<div>
1288
+ ${this.customData.map(t=>{if(t.name==="customerName"){const i=this.application.storage.get("auth");i!=null&&i.authenticated&&(t.value=i==null?void 0:i.name,t.disabled=!0)}return y`<div>
1288
1289
  <ace-contact-data-field
1289
1290
  value=${t.value}
1290
1291
  .entry=${t}
1291
- @changed=${n=>{this._customDataValueChanged(n.detail.value,t)}}
1292
- @keydown=${n=>{n.key==="Enter"&&this._onStartChat(new SubmitEvent("submit"))}}
1292
+ @changed=${i=>{this._customDataValueChanged(i.detail.value,t)}}
1293
+ @keydown=${i=>{i.key==="Enter"&&this._onStartChat(new SubmitEvent("submit"))}}
1293
1294
  ></ace-contact-data-field>
1294
1295
  <div
1295
1296
  class="warning-row"
1296
- data-testid=${`form-${jr(t.name)}-warning`}
1297
+ data-testid=${`form-${Wa(t.name)}-warning`}
1297
1298
  style="display: ${this.showValidationWarning&&this.validationErrors.includes(t.name)?"flex":"none"};"
1298
1299
  >
1299
1300
  <telia-icon
1300
1301
  class="error-icon"
1301
- svg=${$a.svg}
1302
+ svg=${Fc.svg}
1302
1303
  ></telia-icon>
1303
1304
  <p class="error-text">${t.errorText}</p>
1304
1305
  </div>
@@ -1308,7 +1309,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1308
1309
  ${e.getOrFallback("welcome-form.submit-button","Start chat")}
1309
1310
  </button>
1310
1311
  </form>
1311
- </div>`}},Oe.styles=[C`
1312
+ </div>`}},ft.styles=[T`
1312
1313
  :host {
1313
1314
  display: block;
1314
1315
  }
@@ -1389,15 +1390,15 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1389
1390
  color: var(--destructive-color);
1390
1391
  margin: 0;
1391
1392
  }
1392
- `],Oe);ze([S()],we.prototype,"submitted");ze([S()],we.prototype,"customData");ze([S()],we.prototype,"customerName");ze([S()],we.prototype,"validationErrors");ze([S()],we.prototype,"showValidationWarning");ze([ne({context:Q}),b({attribute:!1})],we.prototype,"application");window.customElements.get("ace-welcome-form")||window.customElements.define("ace-welcome-form",we);var nh=Object.defineProperty,Yn=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&nh(e,t,i),i};const fs=class fs extends w{constructor(){super(...arguments),this.submitted=!1,this.name=""}_onStartChat(e){e.preventDefault(),this.submitted=!0;const t=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{key:"submitted",data:{name:this.name}}});this.dispatchEvent(t)}_nameInputHandler(e){this.name=e.target.value}render(){var o;const t=(o=this.application.branding().graphics)==null?void 0:o.logotype,n=this.application.texts;this.application.root.style.getPropertyValue("visibility")===""&&(this.application.root.style.visibility="hidden");const r=new URLSearchParams(document.location.search).get("invitationUid");return this.submitted?v:r?g`<div class="container">
1393
+ `],ft);xt([O()],Je.prototype,"submitted");xt([O()],Je.prototype,"customData");xt([O()],Je.prototype,"customerName");xt([O()],Je.prototype,"validationErrors");xt([O()],Je.prototype,"showValidationWarning");xt([Te({context:ge}),k({attribute:!1})],Je.prototype,"application");window.customElements.get("ace-welcome-form")||window.customElements.define("ace-welcome-form",Je);var Vd=Object.defineProperty,ks=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Vd(e,t,s),s};const zs=class zs extends E{constructor(){super(...arguments),this.submitted=!1,this.name=""}_onStartChat(e){e.preventDefault(),this.submitted=!0;const t=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{key:"submitted",data:{name:this.name}}});this.dispatchEvent(t)}_nameInputHandler(e){this.name=e.target.value}render(){var o;const t=(o=this.application.branding().graphics)==null?void 0:o.logotype,i=this.application.texts;this.application.root.style.getPropertyValue("visibility")===""&&(this.application.root.style.visibility="hidden");const r=new URLSearchParams(document.location.search).get("invitationUid");return this.submitted?w:r?y`<div class="container">
1393
1394
  <img class="logotype" src="${t}" />
1394
1395
  <p>
1395
- ${n.getOrFallback("third-pary-chat.ingress","You’ve been invited to an ongoing chat. Please fill in your name or alias to participate in the chat.")}
1396
+ ${i.getOrFallback("third-pary-chat.ingress","You’ve been invited to an ongoing chat. Please fill in your name or alias to participate in the chat.")}
1396
1397
  </p>
1397
1398
 
1398
1399
  <form class="form" @submit=${this._onStartChat}>
1399
1400
  <label for="form-name-input" class=""
1400
- >${n.getOrFallback("third-party-chat.name-label","* Name")}</label
1401
+ >${i.getOrFallback("third-party-chat.name-label","* Name")}</label
1401
1402
  >
1402
1403
  <input
1403
1404
  .value=${this.name}
@@ -1408,12 +1409,12 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1408
1409
  />
1409
1410
 
1410
1411
  <button type="submit" data-testid="start-chat-button">
1411
- ${n.getOrFallback("third-party-chat.join-button","Join Chat")}
1412
+ ${i.getOrFallback("third-party-chat.join-button","Join Chat")}
1412
1413
  </button>
1413
1414
  </form>
1414
- </div>`:g`<div>
1415
- ${n.getOrFallback("third-pary-chat.error-message","Please check your invitation URL")}
1416
- </div>`}};fs.styles=[C`
1415
+ </div>`:y`<div>
1416
+ ${i.getOrFallback("third-pary-chat.error-message","Please check your invitation URL")}
1417
+ </div>`}};zs.styles=[T`
1417
1418
  :host {
1418
1419
  display: block;
1419
1420
  visibility: visible;
@@ -1491,7 +1492,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1491
1492
  button:hover {
1492
1493
  filter: brightness(150%);
1493
1494
  }
1494
- `];let Ue=fs;Yn([S()],Ue.prototype,"submitted");Yn([S()],Ue.prototype,"name");Yn([ne({context:Q}),b({attribute:!1})],Ue.prototype,"application");window.customElements.get("ace-welcome-form-third-party")||window.customElements.define("ace-welcome-form-third-party",Ue);var sh=Object.defineProperty,Xn=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&sh(e,t,i),i};const gs=class gs extends w{constructor(){super(...arguments),this.email="",this.isEmailValid=!1,this.emailController=oe.getInstance(this)}_onSendChatLog(e){e.preventDefault();const t=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{key:"submitted",data:{email:this.email}}});this.dispatchEvent(t)}_emailInputHandler(e){this.email=e.target.value}connectedCallback(){super.connectedCallback(),this.email=this.emailController.email,this.isEmailValid=Cn(this.email)}render(){const e=this.application.texts;return g`<div class="container">
1495
+ `];let yt=zs;ks([O()],yt.prototype,"submitted");ks([O()],yt.prototype,"name");ks([Te({context:ge}),k({attribute:!1})],yt.prototype,"application");window.customElements.get("ace-welcome-form-third-party")||window.customElements.define("ace-welcome-form-third-party",yt);var Wd=Object.defineProperty,Ss=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Wd(e,t,s),s};const js=class js extends E{constructor(){super(...arguments),this.email="",this.isEmailValid=!1,this.emailController=Ie.getInstance(this)}_onSendChatLog(e){e.preventDefault();const t=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{key:"submitted",data:{email:this.email}}});this.dispatchEvent(t)}_emailInputHandler(e){this.email=e.target.value}connectedCallback(){super.connectedCallback(),this.email=this.emailController.email,this.isEmailValid=Yi(this.email)}render(){const e=this.application.texts;return y`<div class="container">
1495
1496
  <form class="form" @submit=${this._onSendChatLog}>
1496
1497
  <h3>
1497
1498
  ${e.getOrFallback("email-form.title","Chat sent to email")}
@@ -1507,7 +1508,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1507
1508
  id="email"
1508
1509
  placeholder=${e.getOrFallback("email-form.email-label","Email address")}
1509
1510
  .value=${this.email}
1510
- @input=${t=>{this._emailInputHandler(t),this.isEmailValid=Cn(this.email)}}
1511
+ @input=${t=>{this._emailInputHandler(t),this.isEmailValid=Yi(this.email)}}
1511
1512
  autocomplete="email"
1512
1513
  />
1513
1514
 
@@ -1520,7 +1521,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1520
1521
  ${e.getOrFallback("email-form.send-button","Send Conversation")}
1521
1522
  </button>
1522
1523
  </form>
1523
- </div>`}};gs.styles=[C`
1524
+ </div>`}};js.styles=[T`
1524
1525
  :host {
1525
1526
  display: block;
1526
1527
  }
@@ -1594,7 +1595,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1594
1595
  button:hover {
1595
1596
  opacity: 0.8;
1596
1597
  }
1597
- `];let Me=gs;Xn([S()],Me.prototype,"email");Xn([S()],Me.prototype,"isEmailValid");Xn([ne({context:Q}),b({attribute:!1})],Me.prototype,"application");window.customElements.get("ace-conversation-ended-form")||window.customElements.define("ace-conversation-ended-form",Me);var ih=Object.defineProperty,rh=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&ih(e,t,i),i};const ms=class ms extends w{_onStartVideo(e){e.preventDefault(),this.dispatchResult("ok",this.application.texts.getOrFallback("video-confirm.accepted","Video call was accepted"))}_onCancel(){this.dispatchResult("declined",this.application.texts.getOrFallback("video-confirm.declined","Video call was declined"))}dispatchResult(e,t){const n=new CustomEvent("action",{composed:!0,detail:{key:"video-confirm",data:{result:e,text:t}}});this.dispatchEvent(n)}render(){const e=this.application.texts;return g`<div class="container">
1598
+ `];let $t=js;Ss([O()],$t.prototype,"email");Ss([O()],$t.prototype,"isEmailValid");Ss([Te({context:ge}),k({attribute:!1})],$t.prototype,"application");window.customElements.get("ace-conversation-ended-form")||window.customElements.define("ace-conversation-ended-form",$t);var Gd=Object.defineProperty,Zd=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Gd(e,t,s),s};const Hs=class Hs extends E{_onStartVideo(e){e.preventDefault(),this.dispatchResult("ok",this.application.texts.getOrFallback("video-confirm.accepted","Video call was accepted"))}_onCancel(){this.dispatchResult("declined",this.application.texts.getOrFallback("video-confirm.declined","Video call was declined"))}dispatchResult(e,t){const i=new CustomEvent("action",{composed:!0,detail:{key:"video-confirm",data:{result:e,text:t}}});this.dispatchEvent(i)}render(){const e=this.application.texts;return y`<div class="container">
1598
1599
  <h3>
1599
1600
  ${e.getOrFallback("video-confirm.title","Start video call with agent")}
1600
1601
  </h3>
@@ -1603,15 +1604,15 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1603
1604
  </p>
1604
1605
  <div class="button-container">
1605
1606
  <button class="primary" type="submit" @click=${this._onStartVideo}>
1606
- <telia-icon svg=${ba.svg}></telia-icon>
1607
+ <telia-icon svg=${jc.svg}></telia-icon>
1607
1608
  ${e.getOrFallback("video-confirm.accept-button","Accept")}
1608
1609
  </button>
1609
1610
  <button class="secondary" type="button" @click=${this._onCancel}>
1610
- <telia-icon svg=${Mn.svg}></telia-icon>
1611
+ <telia-icon svg=${as.svg}></telia-icon>
1611
1612
  ${e.getOrFallback("video-confirm.decline-button","Decline")}
1612
1613
  </button>
1613
1614
  </div>
1614
- </div>`}};ms.styles=[C`
1615
+ </div>`}};Hs.styles=[T`
1615
1616
  :host {
1616
1617
  display: block;
1617
1618
  }
@@ -1673,16 +1674,16 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1673
1674
  button:hover {
1674
1675
  filter: brightness(150%);
1675
1676
  }
1676
- `];let Ut=ms;rh([ne({context:Q}),b({attribute:!1})],Ut.prototype,"application");window.customElements.get("ace-video-confirm-dialog")||window.customElements.define("ace-video-confirm-dialog",Ut);var oh=Object.defineProperty,ah=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&oh(e,t,i),i};const vs=class vs extends w{constructor(e){super(),this.surveyUrl="",this.surveyLinkText="",this.surveyText="",this.surveyTitle="",this.searchParams={},e&&(this.searchParams=e)}connectedCallback(){super.connectedCallback();const e=this.application.settings.survey,t=e.surveyBaseUrl;this.surveyLinkText=e.surveyLinkText,this.surveyText=e.surveyText,this.surveyTitle=e.surveyTitle;const n=new URL(t);Object.keys(this.searchParams).forEach(i=>{n.searchParams.has(i)&&n.searchParams.set(i,this.searchParams[i])}),this.surveyUrl=n.href}render(){return g`<div class="container survey">
1677
+ `];let Nn=Hs;Zd([Te({context:ge}),k({attribute:!1})],Nn.prototype,"application");window.customElements.get("ace-video-confirm-dialog")||window.customElements.define("ace-video-confirm-dialog",Nn);var Yd=Object.defineProperty,Qd=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Yd(e,t,s),s};const Fs=class Fs extends E{constructor(e){super(),this.surveyUrl="",this.surveyLinkText="",this.surveyText="",this.surveyTitle="",this.searchParams={},e&&(this.searchParams=e)}connectedCallback(){super.connectedCallback();const e=this.application.settings.survey,t=e.surveyBaseUrl;this.surveyLinkText=e.surveyLinkText,this.surveyText=e.surveyText,this.surveyTitle=e.surveyTitle;const i=new URL(t);Object.keys(this.searchParams).forEach(s=>{i.searchParams.has(s)&&i.searchParams.set(s,this.searchParams[s])}),this.surveyUrl=i.href}render(){return y`<div class="container survey">
1677
1678
  <h3>${this.surveyTitle}</h3>
1678
1679
  <p>${this.surveyText}</p>
1679
1680
  <div class="link-container">
1680
1681
  <a class="primary" target="_blank" href="${this.surveyUrl}">
1681
1682
  ${this.surveyLinkText}
1682
- <telia-icon svg=${Yi.svg} size="sm"></telia-icon>
1683
+ <telia-icon svg=${ta.svg} size="sm"></telia-icon>
1683
1684
  </a>
1684
1685
  </div>
1685
- </div>`}};vs.styles=[C`
1686
+ </div>`}};Fs.styles=[T`
1686
1687
  :focus {
1687
1688
  outline-color: var(--focus-color);
1688
1689
  }
@@ -1728,20 +1729,24 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1728
1729
  justify-content: center;
1729
1730
  align-items: center;
1730
1731
  }
1731
- `];let Mt=vs;ah([ne({context:Q}),b({attribute:!1})],Mt.prototype,"application");window.customElements.get("ace-survey")||window.customElements.define("ace-survey",Mt);var lh=Object.defineProperty,ch=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&lh(e,t,i),i};const bs=class bs extends w{_onClose(){this.application.trigger&&this.application.trigger.toggleActive()}render(){const e=this.application.texts;return g`<div class="container">
1732
- <h3>
1732
+ `];let zn=Fs;Qd([Te({context:ge}),k({attribute:!1})],zn.prototype,"application");window.customElements.get("ace-survey")||window.customElements.define("ace-survey",zn);var Xd=Object.defineProperty,Kd=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Xd(e,t,s),s};const Bs=class Bs extends E{_onClose(){this.application.trigger&&this.application.trigger.toggleActive()}render(){const e=this.application.texts;return y`<div class="container">
1733
+ <h3 data-testid="entrance-closed-title">
1733
1734
  ${e.getOrFallback("entrance-closed.title","We're currently closed")}
1734
1735
  </h3>
1735
- <p>
1736
+ <p data-testid="entrance-closed-ingress">
1736
1737
  ${e.getOrFallback("entrance-closed.ingress","Our team is currently away, but we'll be back during our regular opening hours.")}
1737
1738
  </p>
1738
1739
  <div class="button-container">
1739
- <button type="button" @click=${this._onClose}>
1740
- <telia-icon svg=${Mn.svg}></telia-icon>
1740
+ <button
1741
+ type="button"
1742
+ @click=${this._onClose}
1743
+ data-testid="entrance-closed-button"
1744
+ >
1745
+ <telia-icon svg=${as.svg}></telia-icon>
1741
1746
  ${e.getOrFallback("entrance-closed.close-button","Close chat")}
1742
1747
  </button>
1743
1748
  </div>
1744
- </div>`}};bs.styles=[C`
1749
+ </div>`}};Bs.styles=[T`
1745
1750
  :host {
1746
1751
  display: block;
1747
1752
  }
@@ -1792,43 +1797,43 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1792
1797
  button:hover {
1793
1798
  filter: brightness(150%);
1794
1799
  }
1795
- `];let jt=bs;ch([ne({context:Q}),b({attribute:!1})],jt.prototype,"application");window.customElements.get("ace-entrance-closed-dialog")||window.customElements.define("ace-entrance-closed-dialog",jt);var hh=Object.defineProperty,uh=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&hh(e,t,i),i};const ys=class ys extends w{connectedCallback(){super.connectedCallback()}_valueChanged(e){this.dispatchEvent(new CustomEvent("changed",{detail:{value:e},bubbles:!0,composed:!0}))}autocompleteName(e){switch(e){case"customerEmailAddress":return"email";case"customerName":return"given-name";default:return"off"}}render(){const e=`form-${jr(this.entry.name)}`,t=this.entry.required?`* ${this.entry.displayName}`:this.entry.displayName;return this.entry.entryType==="text"?g`<div class="container">
1800
+ `];let jn=Bs;Kd([Te({context:ge}),k({attribute:!1})],jn.prototype,"application");window.customElements.get("ace-entrance-closed-dialog")||window.customElements.define("ace-entrance-closed-dialog",jn);var Jd=Object.defineProperty,ep=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Jd(e,t,s),s};const qs=class qs extends E{connectedCallback(){super.connectedCallback()}_valueChanged(e){this.dispatchEvent(new CustomEvent("changed",{detail:{value:e},bubbles:!0,composed:!0}))}autocompleteName(e){switch(e){case"customerEmailAddress":return"email";case"customerName":return"given-name";default:return"off"}}render(){const e=`form-${Wa(this.entry.name)}`,t=this.entry.required?`* ${this.entry.displayName}`:this.entry.displayName;return this.entry.entryType==="text"?y`<div class="container">
1796
1801
  <label for=${e}>${t}</label>
1797
1802
  <input
1798
1803
  placeholder=${this.entry.placeholderText}
1799
1804
  .value=${this.entry.value}
1800
- @input=${n=>{this._valueChanged(n.target.value)}}
1805
+ @input=${i=>{this._valueChanged(i.target.value)}}
1801
1806
  data-testid=${e}
1802
1807
  id=${e}
1803
1808
  autocomplete="${this.autocompleteName(this.entry.name)}"
1804
1809
  ?required=${this.entry.required}
1805
1810
  ?disabled=${this.entry.disabled}
1806
1811
  />
1807
- </div>`:this.entry.entryType==="dropdown"?g`<div class="container">
1812
+ </div>`:this.entry.entryType==="dropdown"?y`<div class="container">
1808
1813
  <label for=${e}>${t}</label>
1809
1814
  <div class="custom-select">
1810
1815
  <select
1811
1816
  class="placeholder-text-color"
1812
1817
  data-testid=${e}
1813
1818
  id=${e}
1814
- @change=${n=>{const i=n.target;this._valueChanged(i.value),i.value&&i.classList.remove("placeholder-text-color")}}
1819
+ @change=${i=>{const s=i.target;this._valueChanged(s.value),s.value&&s.classList.remove("placeholder-text-color")}}
1815
1820
  ?required=${this.entry.required}
1816
1821
  >
1817
1822
  <option value="" selected hidden ?disabled=${this.entry.required}>
1818
1823
  ${this.entry.placeholderText}
1819
1824
  </option>
1820
- ${(this.entry.dropdownOptions||[]).map(n=>g`<option
1825
+ ${(this.entry.dropdownOptions||[]).map(i=>y`<option
1821
1826
  class="options-text-color"
1822
- value=${n.value}
1827
+ value=${i.value}
1823
1828
  >
1824
- ${n.label}
1829
+ ${i.label}
1825
1830
  </option>`)}
1826
1831
  </select>
1827
1832
  <div class="custom-chevron-down">
1828
- <telia-icon .svg=${Ji.svg}></telia-icon>
1833
+ <telia-icon .svg=${ea.svg}></telia-icon>
1829
1834
  </div>
1830
1835
  </div>
1831
- </div>`:g`<div>Unknown entry type</div>`}};ys.styles=[C`
1836
+ </div>`:y`<div>Unknown entry type</div>`}};qs.styles=[T`
1832
1837
  :focus {
1833
1838
  outline-color: var(--focus-color);
1834
1839
  }
@@ -1908,7 +1913,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1908
1913
  .options-text-color {
1909
1914
  color: var(--text-on-primary-background);
1910
1915
  }
1911
- `];let zt=ys;uh([b({attribute:!1})],zt.prototype,"entry");window.customElements.get("ace-contact-data-field")||window.customElements.define("ace-contact-data-field",zt);var dh=Object.defineProperty,ph=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&dh(e,t,i),i};const $s=class $s extends w{_onQuit(){this.dispatchResult("quit")}_onCancel(){this.dispatchResult("cancel")}dispatchResult(e){const t=new CustomEvent("action",{composed:!0,detail:{key:"quit-chat",data:{result:e}}});this.dispatchEvent(t)}render(){const e=this.application.texts;return g`<div class="container">
1916
+ `];let Hn=qs;ep([k({attribute:!1})],Hn.prototype,"entry");window.customElements.get("ace-contact-data-field")||window.customElements.define("ace-contact-data-field",Hn);var tp=Object.defineProperty,np=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&tp(e,t,s),s};const Vs=class Vs extends E{_onQuit(){this.dispatchResult("quit")}_onCancel(){this.dispatchResult("cancel")}dispatchResult(e){const t=new CustomEvent("action",{composed:!0,detail:{key:"quit-chat",data:{result:e}}});this.dispatchEvent(t)}render(){const e=this.application.texts;return y`<div class="container">
1912
1917
  <h3>
1913
1918
  ${e.getOrFallback("quit-confirm.title","Do you want to end the chat?")}
1914
1919
  </h3>
@@ -1923,7 +1928,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1923
1928
  ${e.getOrFallback("quit-confirm.end-chat-button","End chat")}
1924
1929
  </button>
1925
1930
  </div>
1926
- </div>`}};$s.styles=[C`
1931
+ </div>`}};Vs.styles=[T`
1927
1932
  :host {
1928
1933
  display: block;
1929
1934
  }
@@ -1985,7 +1990,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1985
1990
  button:hover {
1986
1991
  filter: brightness(150%);
1987
1992
  }
1988
- `];let Dt=$s;ph([ne({context:Q}),b({attribute:!1})],Dt.prototype,"application");window.customElements.get("ace-quit-confirm-dialog")||window.customElements.define("ace-quit-confirm-dialog",Dt);var fh=Object.defineProperty,gh=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&fh(e,t,i),i};const xs=class xs extends w{_onQuit(){this.dispatchResult("logout")}_onCancel(){this.dispatchResult("cancel")}dispatchResult(e){const t=new CustomEvent("action",{composed:!0,detail:{key:"logout-chat",data:{result:e}}});this.dispatchEvent(t)}render(){const e=this.application.texts;return g`<div class="container">
1993
+ `];let Fn=Vs;np([Te({context:ge}),k({attribute:!1})],Fn.prototype,"application");window.customElements.get("ace-quit-confirm-dialog")||window.customElements.define("ace-quit-confirm-dialog",Fn);var ip=Object.defineProperty,sp=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&ip(e,t,s),s};const Ws=class Ws extends E{_onQuit(){this.dispatchResult("logout")}_onCancel(){this.dispatchResult("cancel")}dispatchResult(e){const t=new CustomEvent("action",{composed:!0,detail:{key:"logout-chat",data:{result:e}}});this.dispatchEvent(t)}render(){const e=this.application.texts;return y`<div class="container">
1989
1994
  <h3>
1990
1995
  ${e.getOrFallback("logout-confirm.title","Do you want to log out?")}
1991
1996
  </h3>
@@ -2000,7 +2005,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
2000
2005
  ${e.getOrFallback("logout-confirm.end-chat-button","Log out")}
2001
2006
  </button>
2002
2007
  </div>
2003
- </div>`}};xs.styles=[C`
2008
+ </div>`}};Ws.styles=[T`
2004
2009
  :host {
2005
2010
  display: block;
2006
2011
  }
@@ -2062,9 +2067,9 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
2062
2067
  button:hover {
2063
2068
  filter: brightness(150%);
2064
2069
  }
2065
- `];let Nt=xs;gh([ne({context:Q}),b({attribute:!1})],Nt.prototype,"application");window.customElements.get("ace-logout-confirm-dialog")||window.customElements.define("ace-logout-confirm-dialog",Nt);const ws=class ws extends w{constructor(e){super(),this.tunnistusURL="",e&&(this.tunnistusURL=e.tunnistusURL),console.log(this.tunnistusURL)}_onStartAuth(){const e=new CustomEvent("action",{composed:!0,detail:{key:"start-auth"}});this.dispatchEvent(e)}render(){return g`<div class="container">
2070
+ `];let Bn=Ws;sp([Te({context:ge}),k({attribute:!1})],Bn.prototype,"application");window.customElements.get("ace-logout-confirm-dialog")||window.customElements.define("ace-logout-confirm-dialog",Bn);const Gs=class Gs extends E{constructor(e){super(),this.tunnistusURL="",e&&(this.tunnistusURL=e.tunnistusURL),console.log(this.tunnistusURL)}_onStartAuth(){const e=new CustomEvent("action",{composed:!0,detail:{key:"start-auth"}});this.dispatchEvent(e)}render(){return y`<div class="container">
2066
2071
  <div class="header-row">
2067
- <telia-icon class="header-icon" svg=${Ki.svg}></telia-icon>
2072
+ <telia-icon class="header-icon" svg=${Jo.svg}></telia-icon>
2068
2073
 
2069
2074
  <h3>Identify yourself!</h3>
2070
2075
  </div>
@@ -2078,12 +2083,13 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
2078
2083
  target="_blank"
2079
2084
  href="${this.tunnistusURL}"
2080
2085
  @click=${this._onStartAuth}
2086
+ data-testid="card-auth-link"
2081
2087
  >
2082
2088
  Authenticate with Tunnistus
2083
- <telia-icon svg=${Yi.svg} size="sm"></telia-icon>
2089
+ <telia-icon svg=${ta.svg} size="sm"></telia-icon>
2084
2090
  </a>
2085
2091
  </div>
2086
- </div>`}};ws.styles=[C`
2092
+ </div>`}};Gs.styles=[T`
2087
2093
  :focus {
2088
2094
  outline-color: var(--focus-color);
2089
2095
  }
@@ -2151,17 +2157,17 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
2151
2157
  justify-content: center;
2152
2158
  align-items: center;
2153
2159
  }
2154
- `];let Sn=ws;window.customElements.get("tunnistus-link-button")||window.customElements.define("tunnistus-link-button",Sn);/**
2160
+ `];let Qi=Gs;window.customElements.get("ace-tunnistus-auth-card")||window.customElements.define("ace-tunnistus-auth-card",Qi);/**
2155
2161
  * @license
2156
2162
  * Copyright 2018 Google LLC
2157
2163
  * SPDX-License-Identifier: BSD-3-Clause
2158
- */const zr="important",mh=" !"+zr,vh=lt(class extends Zt{constructor(s){var e;if(super(s),s.type!==at.ATTRIBUTE||s.name!=="style"||((e=s.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((e,t)=>{const n=s[t];return n==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(s,[e]){const{style:t}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const n of this.ft)e[n]==null&&(this.ft.delete(n),n.includes("-")?t.removeProperty(n):t[n]=null);for(const n in e){const i=e[n];if(i!=null){this.ft.add(n);const r=typeof i=="string"&&i.endsWith(mh);n.includes("-")||r?t.setProperty(n,r?i.slice(0,-11):i,r?zr:""):t[n]=i}}return X}});var bh=Object.defineProperty,yh=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(i=o(e,t,i)||i);return i&&bh(e,t,i),i};const ks=class ks extends w{constructor(e,t){super(),this.primaryColor="",this.secondaryColor="",this.tertiaryColor="",this.headerHeight=0,this.copyrightHeight=0,this.userUrl=new URL(e),this.userUrl.searchParams.set("lang","en"),this.userUrl.searchParams.set("guestId",t)}connectedCallback(){var i;super.connectedCallback();const e=this.application.getComponent("widget-header");e&&(this.headerHeight=e.getBoundingClientRect().height);const t=this.application.getComponent("copyright");t&&(this.copyrightHeight=t.getBoundingClientRect().height);const n=(i=this.application.settings)==null?void 0:i.branding.colors;this.primaryColor=n.interactivePrimaryBackground,this.secondaryColor=n.interactiveTextOnPrimaryBackground,this.tertiaryColor=n.interactiveDestructiveBackground,this.primaryColor&&this.userUrl.searchParams.set("primaryColor",this.primaryColor),this.secondaryColor&&this.userUrl.searchParams.set("secondaryColor",this.secondaryColor),this.tertiaryColor&&this.userUrl.searchParams.set("tertiaryColor",this.tertiaryColor)}getSpacingMd(){const t=getComputedStyle(this).getPropertyValue("--spacing-md").trim();if(t.endsWith("rem")){const i=parseFloat(getComputedStyle(this).fontSize);return parseFloat(t)*i}const n=parseFloat(t);return isNaN(n)?0:n}render(){const e=this.getSpacingMd(),t={top:this.headerHeight+e+"px",bottom:this.copyrightHeight+e+"px"};return g` <div class="container" style=${vh(t)}>
2164
+ */const Ga="important",rp=" !"+Ga,op=Jt(class extends Yn{constructor(n){var e;if(super(n),n.type!==Kt.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const i=n[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const s=e[i];if(s!=null){this.ft.add(i);const r=typeof s=="string"&&s.endsWith(rp);i.includes("-")||r?t.setProperty(i,r?s.slice(0,-11):s,r?Ga:""):t[i]=s}}return Ce}});var ap=Object.defineProperty,lp=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&ap(e,t,s),s};const Zs=class Zs extends E{constructor(e,t){super(),this.primaryColor="",this.secondaryColor="",this.tertiaryColor="",this.headerHeight=0,this.copyrightHeight=0,this.userUrl=new URL(e),this.userUrl.searchParams.set("lang","en"),this.userUrl.searchParams.set("guestId",t)}connectedCallback(){var s;super.connectedCallback();const e=this.application.getComponent("widget-header");e&&(this.headerHeight=e.getBoundingClientRect().height);const t=this.application.getComponent("copyright");t&&(this.copyrightHeight=t.getBoundingClientRect().height);const i=(s=this.application.settings)==null?void 0:s.branding.colors;this.primaryColor=i.interactivePrimaryBackground,this.secondaryColor=i.interactiveTextOnPrimaryBackground,this.tertiaryColor=i.interactiveDestructiveBackground,this.primaryColor&&this.userUrl.searchParams.set("primaryColor",this.primaryColor),this.secondaryColor&&this.userUrl.searchParams.set("secondaryColor",this.secondaryColor),this.tertiaryColor&&this.userUrl.searchParams.set("tertiaryColor",this.tertiaryColor)}getSpacingMd(){const t=getComputedStyle(this).getPropertyValue("--spacing-md").trim();if(t.endsWith("rem")){const s=parseFloat(getComputedStyle(this).fontSize);return parseFloat(t)*s}const i=parseFloat(t);return isNaN(i)?0:i}render(){const e=this.getSpacingMd(),t={top:this.headerHeight+e+"px",bottom:this.copyrightHeight+e+"px"};return y` <div class="container" style=${op(t)}>
2159
2165
  <iframe
2160
2166
  class="video-iframe"
2161
2167
  src=${this.userUrl.href}
2162
2168
  allow="camera; microphone; display-capture;"
2163
2169
  ></iframe>
2164
- </div>`}};ks.styles=[C`
2170
+ </div>`}};Zs.styles=[T`
2165
2171
  :host {
2166
2172
  display: block;
2167
2173
  }
@@ -2182,15 +2188,15 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
2182
2188
  border: 1px solid var(--border-color-medium);
2183
2189
  box-sizing: border-box;
2184
2190
  }
2185
- `];let st=ks;yh([ne({context:Q}),b({attribute:!1})],st.prototype,"application");window.customElements.get("ace-video-iframe")||window.customElements.define("ace-video-iframe",st);class $h{constructor(e){this.url="",this.maxRetries=300,this.orderRef="",this.tunnistusUrl="",this.url=`${e.idHubUrl}/${e.idHubCustomerKey}/${e.idHubOrgKey}/${e.idHubEidType.toLowerCase()}`,this.maxRetries=e.idHubMaxRetries}async auth(){console.log("\x1B[31mID-Hub \x1B[32m - Initializing auth");try{const t=await(await fetch(this.url+"/auth",{headers:{accept:"application/json","accept-language":"sv-SE,sv;q=0.9,en-US;q=0.8,en;q=0.7","content-type":"application/json"},body:`{
2191
+ `];let Zt=Zs;lp([Te({context:ge}),k({attribute:!1})],Zt.prototype,"application");window.customElements.get("ace-video-iframe")||window.customElements.define("ace-video-iframe",Zt);class cp{constructor(e){this.url="",this.maxRetries=300,this.orderRef="",this.tunnistusUrl="",this.url=`${e.idHubUrl}/${e.idHubCustomerKey}/${e.idHubOrgKey}/${e.idHubEidType.toLowerCase()}`,this.maxRetries=e.idHubMaxRetries}async auth(){console.log("\x1B[31mID-Hub \x1B[32m - Initializing auth");try{const t=await(await fetch(this.url+"/auth",{headers:{accept:"application/json","accept-language":"sv-SE,sv;q=0.9,en-US;q=0.8,en;q=0.7","content-type":"application/json"},body:`{
2186
2192
  "clientName": "idhub-web-1.0.0",
2187
2193
  "register": {
2188
2194
  "clientType": "ACEWIDGET",
2189
2195
  "agentId": "ACEWIDGET",
2190
2196
  "userName": "ACEWIDGET"
2191
2197
  }
2192
- }`,method:"POST"})).json();return console.log("\x1B[31mID-Hub \x1B[32m - Initializing result",t),this.tunnistusUrl=t.tunnistusURL,this.orderRef=t.orderRef,this.tunnistusUrl}catch{return}}async collectPolling(){let e=this.maxRetries,t;do await new Promise(n=>setTimeout(n,1e3)),t=await this.collect(),e--;while(t.status=="pending"&&e>0);return t}async collect(){if(this.orderRef==="")throw new Error("OrderRef is missing");const t=await(await fetch(this.url+"/collect",{headers:{accept:"application/json","accept-language":"sv-SE,sv;q=0.9,en-US;q=0.8,en;q=0.7","content-type":"application/json"},body:`{
2198
+ }`,method:"POST"})).json();return console.log("\x1B[31mID-Hub \x1B[32m - Initializing result",t),this.tunnistusUrl=t.tunnistusURL,this.orderRef=t.orderRef,this.tunnistusUrl}catch{return}}async collectPolling(){let e=this.maxRetries,t;do await new Promise(i=>setTimeout(i,1e3)),t=await this.collect(),e--;while(t.status=="pending"&&e>0);return t}async collect(){if(this.orderRef==="")throw new Error("OrderRef is missing");const t=await(await fetch(this.url+"/collect",{headers:{accept:"application/json","accept-language":"sv-SE,sv;q=0.9,en-US;q=0.8,en;q=0.7","content-type":"application/json"},body:`{
2193
2199
  "clientName": "idhub-web-1.0.0",
2194
2200
  "orderRef": "${this.orderRef}",
2195
2201
  "method": "auth"
2196
- }`,method:"POST"})).json();return console.log("\x1B[31mID-Hub \x1B[32m - Collect result",t),t}}function xh(s){return decodeURIComponent(atob(s).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}class es extends Qo{constructor(e,t){var n,i;super(e,t),this.agent=this.createAgent(""),this.user=this.createUser(""),this.pendingMessages=[],this.texts=this.component.application.texts,this.isThirdPartyParticipant=this.component.properties.chat.isThirdPartyWidget,this.disconnected$=new _,this.agentUsername=null,this.conversationOption=null,this._conversationOptions={},this.sessionId=null,this.contactId=null,this.errand=null,this.entrance=null,this.guestId=null,this.chatOverlayActive=!1,this.inVideoCall=!1,this._onQueueStatusReceived=r=>{this._setQueueStatus(r.text||null)},this._onEstablished=r=>{this.contactId=r.contactId,this.errand=r.errand,this.entrance=r.entrance,this.agentUsername=r.agentUsername;const o={contactId:this.contactId,errand:this.errand,entrance:this.entrance,agentUsername:this.agentUsername};this.save({survey:o}),this._setQueueStatus(null),this.agent.name=r.agent,r.videoEnded&&this.removeVideo()},this._onPrepareVideo=()=>{this.prepareVideo()},this._onVideoPrepared=r=>{this.showVideo(r.userUrl)},this._onChatButtonClicked=r=>{this.showChatOverVideo(r.guestId)},this._onEndVideoButtonClicked=r=>{this.handleEndVideoConference(r.guestId)},this._onPenStatusChange=r=>{r.penStatus==="on"?this.setTypingState(!0):this.setTypingState(!1)},this._onChatEnded=async r=>{var a,l;this.setToastMessage(null),this.setTypingState(!1),this.videoConfirmDialogEntry&&this.videoConfirmDialogEntry.remove(),this.component.disableInput(),r.showForm&&this.showConversationEndedForm();const o=this.component.application.settings;(a=o==null?void 0:o.survey)!=null&&a.shouldUseSurvey&&((l=o==null?void 0:o.survey)!=null&&l.surveyBaseUrl)&&this.showSurvey(),this.isThirdPartyParticipant?this._removeHeaderOptions():this._setStartNewChatOption(),this.complete()},this.headerComponent=this.component.application.getComponent("widget-header"),this.params=new URLSearchParams(document.location.search),this.invitationUid=this.params.get("invitationUid"),this.customerName=this.params.get("customerName")||void 0,this.properties=t.properties,(n=this.component.application.settings)!=null&&n.auth&&(this.idHubClient=new $h((i=this.component.application.settings)==null?void 0:i.auth))}static getInstance(e,t){return t.providerInstance??(t.providerInstance=new es(e,t)),t.providerInstance}connect(e={}){super.connect(),this._conversationOptions=e;const t={...this.properties.chat??{},...e},n=!!this.sessionId;if(!n){const r=kn();this._setSessionId(r)}this.save({chatSessionId:this.sessionId}),this.engine=new eh(t,this.sessionId),this.engine.messages().subscribe(r=>{switch(r.source){case"agent":this.printAgent(r.text);break;case"customer":this._clearPendingMessages(),this.isThirdPartyParticipant?r.source==="customer"&&r.invitationNo==="0"?this.printAgent(r.text,r.alias):this.printUser(r.text):r.source==="customer"&&Number(r.invitationNo)>0?this.printAgent(r.text,r.alias):this.printUser(r.text);break;case"system":this.printSystem(r.text);break}}),this.engine.actions().pipe(O(this.disconnected$),I(Vc)).subscribe(this._onQueueStatusReceived),this.engine.actions().pipe(O(this.disconnected$),I(Zc)).subscribe(this._onEstablished),this.engine.actions().pipe(O(this.disconnected$),I(Gc)).subscribe(this._onPrepareVideo),this.engine.actions().pipe(O(this.disconnected$),I(Qc)).subscribe(this._onVideoPrepared),this.engine.actions().pipe(O(this.disconnected$),I(Kc)).subscribe(this._onChatButtonClicked),this.engine.actions().pipe(O(this.disconnected$),I(Jc)).subscribe(this._onEndVideoButtonClicked),this.engine.actions().pipe(O(this.disconnected$),I(Wc)).subscribe(this._onPenStatusChange),this.engine.actions().pipe(O(this.disconnected$),I(Yc)).subscribe(this._onChatEnded),this.setHeaderOption();const i=this.component.application.trigger;i&&i.widgetActive$.pipe(O(i.componentIsDestroyed$)).subscribe(r=>{r&&(this.conversationOption=null,this.setHeaderOption())}),this.component.userTyping$.pipe(O(this.disconnected$)).subscribe(r=>{var o;(o=this.engine)==null||o.sendPenStatusOn(r)}),n?this.engine.rehydrate().then(r=>{var o;r?(o=this.engine)==null||o.reconnect().pipe(O(this.disconnected$)).subscribe({error:a=>{console.error("Failed to reconnect to the engine:",a)}}):this.initializeChat(t).catch(a=>{console.error("Failed to initialize chat during rehydration:",a)})}):this.initializeChat(t).catch(r=>{console.error("Failed to initialize chat:",r)})}async setHeaderOption(){switch(await this.engine.getChatStatus()){case"finished":this.isThirdPartyParticipant?this._removeHeaderOptions():this._setStartNewChatOption();break;case"active":this._setEndConversationOption();break;case"noSession":this.conversationOption=null}}disconnected(){super.disconnected(),this.disconnected$.next()}_removeHeaderOptions(){const e=this.component.application.getComponent("widget-header");e&&e.removeOption(this.conversationOption)}_addHeaderOptions(e,t,n,i,r=!0){const o=this.component.application.getComponent("widget-header");if(o)return this.conversationOption?(this.conversationOption.label=e,this.conversationOption.key=t,this.conversationOption.icon=n,this.conversationOption.onClick=i,this.conversationOption.enabled=r,o.requestUpdate(),this.conversationOption):o.addOption({label:e,icon:n,closeOnClick:!0,key:t,onClick:i,enabled:r})}_startChat(e){var n,i;if(!this.engine)return;const t=e.customData.errand??this.engine.config.defaultErrand;if(!t)throw new Error("Errand is required but was not configured");if(this.isThirdPartyParticipant)this.component.application.root.style.visibility="visible",this.engine.chatJoin({invitationUid:this.invitationUid,customerName:this.customerName??e.customerName}).pipe(O(this.disconnected$)).subscribe();else{const r=(i=(n=this.component.application)==null?void 0:n.userData)==null?void 0:i.idhubEIDToken;this.engine.chatRequest({customerName:e.customerName,customerEmailAddress:e.customerEmailAddress??"",visitorQuestion:e.visitorQuestion??"",customData:e.customData,errand:t,...r&&{authToken:r}}).pipe(O(this.disconnected$)).subscribe()}this.component.enableInput(),this.component.enableSkipToLatestMessage(),this._setEndConversationOption()}_restartNewChat(){this.engine&&(this._setSessionId(null),this.component.clearMessages(),this._removeHeaderOptions(),this.connect(this._conversationOptions))}showSurvey(){const e=new U(A.System,{name:""},[{items:[["ace-survey",{content:""},{agentUsername:this.agentUsername??"",entrance:this.entrance??this.engine.config.entrance,errand:this.errand??this.engine.config.defaultErrand,contactId:this.contactId??""}]]}]);this.printEntry(e)}async startAuthenticationFlow(){var n;const e=await((n=this.idHubClient)==null?void 0:n.auth());let t;e&&(this.headerComponent.authUrl=e,this.headerComponent.provider=this,this.headerComponent.authState="non-authenticated",t=this.showTunnistusLinkButton(e),this.headerComponent.idref=t,t.actions$.pipe(I(i=>i.key==="start-auth"),V(1)).subscribe(()=>{this.handleAuthentication(t)}))}async handleAuthentication(e){var n,i,r,o;this.headerComponent.UserName="Authenticating...",this.headerComponent.authState="authenticating",this.headerComponent.requestUpdate();const t=await((n=this.idHubClient)==null?void 0:n.collectPolling());if(this.component.application.userData=t,(t==null?void 0:t.status)==="authenticated"){const a=xh(((i=t==null?void 0:t.idhubEIDToken)==null?void 0:i.split(".")[1])||""),l=JSON.parse(a),c=((o=(r=l==null?void 0:l.completionData)==null?void 0:r.user)==null?void 0:o.name)||"";this.headerComponent.UserName=c,this.headerComponent.authState="authenticated",this.component.application.storage.set("auth",{name:c,authenticated:!0}),e==null||e.remove(),this.handleWelcomeForm(this.engine.config)}}async handleWelcomeForm(e){let t=!0;e.webApiUrl&&(t=await this.isEntranceOpen(e.webApiUrl,e.entrance)),t?this.customerName?this._startChat({customerName:this.customerName,customData:{}}):this.showWelcomeForm():this.showEntranceClosedDialog()}async initializeChat(e){var t,n;(n=(t=this.component.application.settings)==null?void 0:t.auth)!=null&&n.shouldUseAuth?await this.startAuthenticationFlow():this.handleWelcomeForm(e)}showTunnistusLinkButton(e){const t=new U(A.System,{name:""},[{items:[["tunnistus-link-button",{content:""},{tunnistusURL:e}]]}]);return this.printEntry(t),t}showWelcomeForm(){this.component.disableInput(),this.component.disableSkipToLatestMessage();let e;this.isThirdPartyParticipant?e=new U(A.System,{name:""},[{items:[["ace-welcome-form-third-party",{content:""}]]}]):e=new U(A.System,{name:""},[{items:[["ace-welcome-form",{content:""}]]}]),this.printEntry(e),e.actions$.pipe(I(t=>t.key==="submitted"),V(1)).subscribe(t=>{e.remove(),this._startChat({customerName:t.data.name,customerEmailAddress:t.data.email,visitorQuestion:t.data.question,customData:t.data.customData})})}showEntranceClosedDialog(){this.component.disableInput();const e=new U(A.System,{name:""},[{items:[["ace-entrance-closed-dialog",{content:""}]]}]);this.printEntry(e)}_setQueueStatus(e){this.setToastMessage(e)}showLogoutConfirmDialog(){var e;(e=this.logoutConfirmDialogEntry)==null||e.remove(),this.logoutConfirmDialogEntry=new U(A.System,{name:""},[{items:[["ace-logout-confirm-dialog",{content:""}]]}]),this.printEntry(this.logoutConfirmDialogEntry),this.logoutConfirmDialogEntry.actions$.pipe(I(t=>t.key==="logout-chat"),V(1)).subscribe(async t=>{var n;this.logoutConfirmDialogEntry&&this.logoutConfirmDialogEntry.remove(),((n=t.data)==null?void 0:n.result)==="logout"&&(await this.engine.getChatStatus()==="noSession"?(this.headerComponent._logout(),this._setSessionId(null),this.component.clearMessages(),this.startAuthenticationFlow()):this.endConversation())})}showQuitConfirmDialog(){var e;(e=this.quitConfirmDialogEntry)==null||e.remove(),this.quitConfirmDialogEntry=new U(A.System,{name:""},[{items:[["ace-quit-confirm-dialog",{content:""}]]}]),this.printEntry(this.quitConfirmDialogEntry),this.quitConfirmDialogEntry.actions$.pipe(I(t=>t.key==="quit-chat"),V(1)).subscribe(t=>{var n;this.quitConfirmDialogEntry&&this.quitConfirmDialogEntry.remove(),((n=t.data)==null?void 0:n.result)==="quit"&&this.endConversation()})}showConversationEndedForm(){const e=new U(A.System,{name:""},[{items:[["ace-conversation-ended-form",{content:""}]]}]);this.printEntry(e),e.actions$.pipe(I(t=>t.key==="submitted"),V(1)).subscribe(t=>{e.remove(),t.data.email&&this.sendConversationEmail(t.data.email)})}prepareVideo(){this.videoConfirmDialogEntry=new U(A.System,{name:""},[{items:[["ace-video-confirm-dialog",{content:""}]]}]),this.printEntry(this.videoConfirmDialogEntry),this.videoConfirmDialogEntry.actions$.pipe(I(e=>e.key==="video-confirm"),V(1)).subscribe(e=>{var t;this.videoConfirmDialogEntry&&this.videoConfirmDialogEntry.remove(),e.data.result==="declined"&&(this.guestId=null),(t=this.engine)==null||t.videoPrepared(e.data.result),this.printSystem(e.data.text)})}showVideo(e){var n;this.guestId=kn(),this.videoIFrameElement=new st(e,this.guestId);const t=this.component.application.root;(n=t==null?void 0:t.shadowRoot)==null||n.prepend(this.videoIFrameElement),this.inVideoCall=!0,this.setHeaderOption()}showChatOverVideo(e){this.guestId&&e===this.guestId&&(this.chatOverlayActive=!0,this.showChatOverlay$.next(this.chatOverlayActive))}handleEndVideoConference(e){this.guestId&&e===this.guestId&&this.removeVideo()}printAgent(e,t=""){const n=t.length>0?this.agent.print(e,"markdown",t):this.agent.print(e,"markdown");return this.setTypingState(!1),n}printUser(e){const t=dn(Is(e));return this.user.print(t)}printSystem(e){const t=dn(Is(e));return this.system.print(t)}_setEndConversationOption(){this.conversationOption=this._addHeaderOptions(this.texts.getOrFallback("widget-header.end-conversation","End conversation"),"end-conversation-button",Mn.svg,()=>{this.showQuitConfirmDialog()},!this.inVideoCall)}_setStartNewChatOption(){this.conversationOption=this._addHeaderOptions(this.texts.getOrFallback("widget-header.start-new-chat","Start new chat"),"start-new-chat-button",Xi.svg,()=>{this._restartNewChat()})}removeVideo(){var e;(e=this.videoIFrameElement)==null||e.remove(),this.guestId=null,this.chatOverlayActive&&(this.chatOverlayActive=!1,this.showChatOverlay$.next(this.chatOverlayActive)),this.inVideoCall=!1,this.setHeaderOption()}async endConversation(){var e,t,n;(t=(e=this.component.application.settings)==null?void 0:e.auth)!=null&&t.shouldUseAuth&&this.headerComponent._logout("chat-ended"),await((n=this.engine)==null?void 0:n.chatQuit())}async sendConversationEmail(e){var t;try{await((t=this.engine)==null?void 0:t.chatEmailSession(e)),this.printSystem(this.texts.getOrFallback("email-form.email-sent-label","An email with the conversation was sent."))}catch(n){this.printSystem(this.texts.getOrFallback("email-form.error-message","Unable to send email with the conversation.")),n instanceof It||console.warn("Unhandled error:",n)}}_clearPendingMessages(){this.pendingMessages.forEach(e=>{e.remove()})}_setSessionId(e){this.sessionId=e}onUserSubmit(e){const t=this.printUser(e.text);t.setStatus("pending"),this.pendingMessages.push(t),(async()=>{var n;try{await((n=this.engine)==null?void 0:n.chatWrite(e.text))}catch(i){i instanceof It?t.setStatus("failed"):(t.setStatus("failed"),console.warn("Unhandled error:",i))}})()}async rehydrate(e){e.chatSessionId&&this._setSessionId(e.chatSessionId),e.survey&&(this.contactId=e.survey.contactId,this.errand=e.survey.errand,this.entrance=e.survey.entrance,this.agentUsername=e.survey.agentUsername)}save(e){this.component.stateMachine.session().pipe(Y(t=>(t==null?void 0:t.data$)||$e),V(1)).subscribe(t=>{this.saveToCurrentSession$.next({...t,...e})})}async isEntranceOpen(e,t){var i;let n=!1;try{const r=await fetch(`${e}/1/entrances/${t}/is-open`),o=await r.json();r.ok?n=(i=o==null?void 0:o.resultData)==null?void 0:i.isOpen:console.log(`Problem when fetching open status for entrance ${t}:`,o==null?void 0:o.resultMessage)}catch(r){console.log(`Failed to fetch open status for ${t}:`,r)}return n}}const wh=async s=>{(await _n.getInstance(s.container)).registerProvider("ace-chat",t=>es.getInstance("ace-chat",t))};exports.ChatProviderPlugin=wh;
2202
+ }`,method:"POST"})).json();return console.log("\x1B[31mID-Hub \x1B[32m - Collect result",t),t}}function up(n){return decodeURIComponent(atob(n).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}class _s extends vc{constructor(e,t){var i,s;super(e,t),this.agent=this.createAgent(""),this.user=this.createUser(""),this.pendingMessages=[],this.texts=this.component.application.texts,this.isThirdPartyParticipant=this.component.properties.chat.isThirdPartyWidget,this.disconnected$=new P,this.agentUsername=null,this.conversationOption=null,this._conversationOptions={},this.sessionId=null,this.contactId=null,this.errand=null,this.entrance=null,this.guestId=null,this.chatOverlayActive=!1,this.inVideoCall=!1,this._onQueueStatusReceived=r=>{this._setQueueStatus(r.text||null)},this._onEstablished=r=>{this.contactId=r.contactId,this.errand=r.errand,this.entrance=r.entrance,this.agentUsername=r.agentUsername;const o={contactId:this.contactId,errand:this.errand,entrance:this.entrance,agentUsername:this.agentUsername};this.save({survey:o}),this._setQueueStatus(null),this.agent.name=r.agent,r.videoEnded&&this.removeVideo()},this._onPrepareVideo=()=>{this.prepareVideo()},this._onVideoPrepared=r=>{this.showVideo(r.userUrl)},this._onChatButtonClicked=r=>{this.showChatOverVideo(r.guestId)},this._onEndVideoButtonClicked=r=>{this.handleEndVideoConference(r.guestId)},this._onPenStatusChange=r=>{r.penStatus==="on"?this.setTypingState(!0):this.setTypingState(!1)},this._onChatEnded=async r=>{var a,l;this.setToastMessage(null),this.setTypingState(!1),this.videoConfirmDialogEntry&&this.videoConfirmDialogEntry.remove(),this.component.disableInput(),r.showForm&&this.showConversationEndedForm();const o=this.component.application.settings;(a=o==null?void 0:o.survey)!=null&&a.shouldUseSurvey&&((l=o==null?void 0:o.survey)!=null&&l.surveyBaseUrl)&&this.showSurvey(),this.isThirdPartyParticipant?this._removeHeaderOptions():this._setStartNewChatOption(),this.complete()},this.headerComponent=this.component.application.getComponent("widget-header"),this.params=new URLSearchParams(document.location.search),this.invitationUid=this.params.get("invitationUid"),this.customerName=this.params.get("customerName")||void 0,this.properties=t.properties,(i=this.component.application.settings)!=null&&i.auth&&(this.idHubClient=new cp((s=this.component.application.settings)==null?void 0:s.auth))}static getInstance(e,t){return t.providerInstance??(t.providerInstance=new _s(e,t)),t.providerInstance}connect(e={}){super.connect(),this._conversationOptions=e;const t={...this.properties.chat??{},...e},i=!!this.sessionId;if(!i){const r=Zi();this._setSessionId(r)}this.save({chatSessionId:this.sessionId}),this.engine=new Bd(t,this.sessionId),this.engine.messages().subscribe(r=>{switch(r.source){case"agent":this.printAgent(r.text);break;case"customer":this._clearPendingMessages(),this.isThirdPartyParticipant?r.source==="customer"&&r.invitationNo==="0"?this.printAgent(r.text,r.alias):this.printUser(r.text):r.source==="customer"&&Number(r.invitationNo)>0?this.printAgent(r.text,r.alias):this.printUser(r.text);break;case"system":this.printSystem(r.text);break}}),this.engine.actions().pipe(B(this.disconnected$),K(Pd)).subscribe(this._onQueueStatusReceived),this.engine.actions().pipe(B(this.disconnected$),K(Md)).subscribe(this._onEstablished),this.engine.actions().pipe(B(this.disconnected$),K(Ud)).subscribe(this._onPrepareVideo),this.engine.actions().pipe(B(this.disconnected$),K(Nd)).subscribe(this._onVideoPrepared),this.engine.actions().pipe(B(this.disconnected$),K(zd)).subscribe(this._onChatButtonClicked),this.engine.actions().pipe(B(this.disconnected$),K(jd)).subscribe(this._onEndVideoButtonClicked),this.engine.actions().pipe(B(this.disconnected$),K(Dd)).subscribe(this._onPenStatusChange),this.engine.actions().pipe(B(this.disconnected$),K(Hd)).subscribe(this._onChatEnded),this.setHeaderOption();const s=this.component.application.trigger;s&&s.widgetActive$.pipe(B(s.componentIsDestroyed$)).subscribe(r=>{r&&(this.conversationOption=null,this.setHeaderOption())}),this.component.userTyping$.pipe(B(this.disconnected$)).subscribe(r=>{var o;(o=this.engine)==null||o.sendPenStatusOn(r)}),i?this.engine.rehydrate().then(r=>{var o;r?(o=this.engine)==null||o.reconnect().pipe(B(this.disconnected$)).subscribe({error:a=>{console.error("Failed to reconnect to the engine:",a)}}):this.initializeChat(t).catch(a=>{console.error("Failed to initialize chat during rehydration:",a)})}):this.initializeChat(t).catch(r=>{console.error("Failed to initialize chat:",r)})}async setHeaderOption(){switch(await this.engine.getChatStatus()){case"finished":this.isThirdPartyParticipant?this._removeHeaderOptions():this._setStartNewChatOption();break;case"active":this._setEndConversationOption();break;case"noSession":this.conversationOption=null}}disconnected(){super.disconnected(),this.disconnected$.next()}_removeHeaderOptions(){const e=this.component.application.getComponent("widget-header");e&&e.removeOption(this.conversationOption)}_addHeaderOptions(e,t,i,s,r=!0){const o=this.component.application.getComponent("widget-header");if(o)return this.conversationOption?(this.conversationOption.label=e,this.conversationOption.key=t,this.conversationOption.icon=i,this.conversationOption.onClick=s,this.conversationOption.enabled=r,o.requestUpdate(),this.conversationOption):o.addOption({label:e,icon:i,closeOnClick:!0,key:t,onClick:s,enabled:r})}_startChat(e){var i,s;if(!this.engine)return;const t=e.customData.errand??this.engine.config.defaultErrand;if(!t)throw new Error("Errand is required but was not configured");if(this.isThirdPartyParticipant)this.component.application.root.style.visibility="visible",this.engine.chatJoin({invitationUid:this.invitationUid,customerName:this.customerName??e.customerName}).pipe(B(this.disconnected$)).subscribe();else{const r=(s=(i=this.component.application)==null?void 0:i.userData)==null?void 0:s.idhubEIDToken;this.engine.chatRequest({customerName:e.customerName,customerEmailAddress:e.customerEmailAddress??"",visitorQuestion:e.visitorQuestion??"",customData:e.customData,errand:t,...r&&{authToken:r}}).pipe(B(this.disconnected$)).subscribe()}this.component.enableInput(),this.component.enableSkipToLatestMessage(),this._setEndConversationOption()}_restartNewChat(){this.engine&&(this._setSessionId(null),this.component.clearMessages(),this._removeHeaderOptions(),this.connect(this._conversationOptions))}showSurvey(){const e=new J(z.System,{name:""},[{items:[["ace-survey",{content:""},{agentUsername:this.agentUsername??"",entrance:this.entrance??this.engine.config.entrance,errand:this.errand??this.engine.config.defaultErrand,contactId:this.contactId??""}]]}]);this.printEntry(e)}async startAuthenticationFlow(){var i;const e=await((i=this.idHubClient)==null?void 0:i.auth());let t;e&&(this.headerComponent.authUrl=e,this.headerComponent.provider=this,this.headerComponent.authState="non-authenticated",t=this.showTunnistusAuthCard(e),this.headerComponent.idref=t,t.actions$.pipe(K(s=>s.key==="start-auth"),he(1)).subscribe(()=>{this.handleAuthentication(t)}))}async handleAuthentication(e){var i,s,r,o;this.headerComponent.UserName="Authenticating...",this.headerComponent.authState="authenticating",this.headerComponent.requestUpdate();const t=await((i=this.idHubClient)==null?void 0:i.collectPolling());if(this.component.application.userData=t,(t==null?void 0:t.status)==="authenticated"){const a=up(((s=t==null?void 0:t.idhubEIDToken)==null?void 0:s.split(".")[1])??""),l=JSON.parse(a),c=((o=(r=l==null?void 0:l.completionData)==null?void 0:r.user)==null?void 0:o.name)??"";this.headerComponent.UserName=c,this.headerComponent.authState="authenticated",this.component.application.storage.set("auth",{name:c,authenticated:!0}),e==null||e.remove(),this.handleWelcomeForm(this.engine.config)}}async handleWelcomeForm(e){let t=!0;e.webApiUrl&&(t=await this.isEntranceOpen(e.webApiUrl,e.entrance)),t?this.customerName?this._startChat({customerName:this.customerName,customData:{}}):this.showWelcomeForm():this.showEntranceClosedDialog()}async initializeChat(e){var t,i;(i=(t=this.component.application.settings)==null?void 0:t.auth)!=null&&i.shouldUseAuth?await this.startAuthenticationFlow():this.handleWelcomeForm(e)}showTunnistusAuthCard(e){const t=new J(z.System,{name:""},[{items:[["ace-tunnistus-auth-card",{content:""},{tunnistusURL:e}]]}]);return this.printEntry(t),t}showWelcomeForm(){this.component.disableInput(),this.component.disableSkipToLatestMessage();let e;this.isThirdPartyParticipant?e=new J(z.System,{name:""},[{items:[["ace-welcome-form-third-party",{content:""}]]}]):e=new J(z.System,{name:""},[{items:[["ace-welcome-form",{content:""}]]}]),this.printEntry(e),e.actions$.pipe(K(t=>t.key==="submitted"),he(1)).subscribe(t=>{e.remove(),this._startChat({customerName:t.data.name,customerEmailAddress:t.data.email,visitorQuestion:t.data.question,customData:t.data.customData})})}showEntranceClosedDialog(){this.component.disableInput();const e=new J(z.System,{name:""},[{items:[["ace-entrance-closed-dialog",{content:""}]]}]);this.printEntry(e)}_setQueueStatus(e){this.setToastMessage(e)}showLogoutConfirmDialog(){var e;(e=this.logoutConfirmDialogEntry)==null||e.remove(),this.logoutConfirmDialogEntry=new J(z.System,{name:""},[{items:[["ace-logout-confirm-dialog",{content:""}]]}]),this.printEntry(this.logoutConfirmDialogEntry),this.logoutConfirmDialogEntry.actions$.pipe(K(t=>t.key==="logout-chat"),he(1)).subscribe(async t=>{var i;this.logoutConfirmDialogEntry&&this.logoutConfirmDialogEntry.remove(),((i=t.data)==null?void 0:i.result)==="logout"&&(await this.engine.getChatStatus()==="noSession"?(this.headerComponent._logout(),this._setSessionId(null),this.component.clearMessages(),this.startAuthenticationFlow()):this.endConversation())})}showQuitConfirmDialog(){var e;(e=this.quitConfirmDialogEntry)==null||e.remove(),this.quitConfirmDialogEntry=new J(z.System,{name:""},[{items:[["ace-quit-confirm-dialog",{content:""}]]}]),this.printEntry(this.quitConfirmDialogEntry),this.quitConfirmDialogEntry.actions$.pipe(K(t=>t.key==="quit-chat"),he(1)).subscribe(t=>{var i;this.quitConfirmDialogEntry&&this.quitConfirmDialogEntry.remove(),((i=t.data)==null?void 0:i.result)==="quit"&&this.endConversation()})}showConversationEndedForm(){const e=new J(z.System,{name:""},[{items:[["ace-conversation-ended-form",{content:""}]]}]);this.printEntry(e),e.actions$.pipe(K(t=>t.key==="submitted"),he(1)).subscribe(t=>{e.remove(),t.data.email&&this.sendConversationEmail(t.data.email)})}prepareVideo(){this.videoConfirmDialogEntry=new J(z.System,{name:""},[{items:[["ace-video-confirm-dialog",{content:""}]]}]),this.printEntry(this.videoConfirmDialogEntry),this.videoConfirmDialogEntry.actions$.pipe(K(e=>e.key==="video-confirm"),he(1)).subscribe(e=>{var t;this.videoConfirmDialogEntry&&this.videoConfirmDialogEntry.remove(),e.data.result==="declined"&&(this.guestId=null),(t=this.engine)==null||t.videoPrepared(e.data.result),this.printSystem(e.data.text)})}showVideo(e){var i;this.guestId=Zi(),this.videoIFrameElement=new Zt(e,this.guestId);const t=this.component.application.root;(i=t==null?void 0:t.shadowRoot)==null||i.prepend(this.videoIFrameElement),this.inVideoCall=!0,this.setHeaderOption()}showChatOverVideo(e){this.guestId&&e===this.guestId&&(this.chatOverlayActive=!0,this.showChatOverlay$.next(this.chatOverlayActive))}handleEndVideoConference(e){this.guestId&&e===this.guestId&&this.removeVideo()}printAgent(e,t=""){const i=t.length>0?this.agent.print(e,"markdown",t):this.agent.print(e,"markdown");return this.setTypingState(!1),i}printUser(e){const t=Ii(Er(e));return this.user.print(t)}printSystem(e){const t=Ii(Er(e));return this.system.print(t)}_setEndConversationOption(){this.conversationOption=this._addHeaderOptions(this.texts.getOrFallback("widget-header.end-conversation","End conversation"),"end-conversation-button",as.svg,()=>{this.showQuitConfirmDialog()},!this.inVideoCall)}_setStartNewChatOption(){this.conversationOption=this._addHeaderOptions(this.texts.getOrFallback("widget-header.start-new-chat","Start new chat"),"start-new-chat-button",na.svg,()=>{this._restartNewChat()})}removeVideo(){var e;(e=this.videoIFrameElement)==null||e.remove(),this.guestId=null,this.chatOverlayActive&&(this.chatOverlayActive=!1,this.showChatOverlay$.next(this.chatOverlayActive)),this.inVideoCall=!1,this.setHeaderOption()}async endConversation(){var e,t,i;(t=(e=this.component.application.settings)==null?void 0:e.auth)!=null&&t.shouldUseAuth&&this.headerComponent._logout("chat-ended"),await((i=this.engine)==null?void 0:i.chatQuit())}async sendConversationEmail(e){var t;try{await((t=this.engine)==null?void 0:t.chatEmailSession(e)),this.printSystem(this.texts.getOrFallback("email-form.email-sent-label","An email with the conversation was sent."))}catch(i){this.printSystem(this.texts.getOrFallback("email-form.error-message","Unable to send email with the conversation.")),i instanceof Un||console.warn("Unhandled error:",i)}}_clearPendingMessages(){this.pendingMessages.forEach(e=>{e.remove()})}_setSessionId(e){this.sessionId=e}onUserSubmit(e){const t=this.printUser(e.text);t.setStatus("pending"),this.pendingMessages.push(t),(async()=>{var i;try{await((i=this.engine)==null?void 0:i.chatWrite(e.text))}catch(s){s instanceof Un?t.setStatus("failed"):(t.setStatus("failed"),console.warn("Unhandled error:",s))}})()}async rehydrate(e){e.chatSessionId&&this._setSessionId(e.chatSessionId),e.survey&&(this.contactId=e.survey.contactId,this.errand=e.survey.errand,this.entrance=e.survey.entrance,this.agentUsername=e.survey.agentUsername)}save(e){this.component.stateMachine.session().pipe(_e(t=>(t==null?void 0:t.data$)||Xe),he(1)).subscribe(t=>{this.saveToCurrentSession$.next({...t,...e})})}async isEntranceOpen(e,t){var s;let i=!1;try{const r=await fetch(`${e}/1/entrances/${t}/is-open`),o=await r.json();r.ok?i=(s=o==null?void 0:o.resultData)==null?void 0:s.isOpen:console.log(`Problem when fetching open status for entrance ${t}:`,o==null?void 0:o.resultMessage)}catch(r){console.log(`Failed to fetch open status for ${t}:`,r)}return i}}const hp=async n=>{(await Xi.getInstance(n.container)).registerProvider("ace-chat",t=>_s.getInstance("ace-chat",t))};exports.ChatProviderPlugin=hp;