@telia-ace/ace-chat-flamingo 1.1.123-rc.45 → 1.1.123-rc.47
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 +162 -162
- package/index.mjs +1630 -1605
- package/package.json +3 -3
- package/ui/auth-session-end-confirm-dialog.d.ts +3 -3
- package/ui/chat-unavailable-card.d.ts +3 -3
- package/ui/contact-data-field.d.ts +3 -3
- package/ui/conversation-ended-form.d.ts +3 -3
- package/ui/entrance-closed-dialog.d.ts +3 -3
- package/ui/quit-confirm-dialog.d.ts +3 -3
- package/ui/survey.d.ts +3 -3
- package/ui/tunnistus-auth-card.d.ts +3 -3
- package/ui/video-confirm-dialog.d.ts +3 -3
- package/ui/video-iframe.d.ts +3 -3
- package/ui/welcome-form-third-party.d.ts +3 -3
- package/ui/welcome-form.d.ts +3 -3
package/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var bl=Object.defineProperty;var yl=(i,e,t)=>e in i?bl(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var A=(i,e,t)=>yl(i,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Dn=function(i,e){return Dn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])},Dn(i,e)};function De(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Dn(i,e);function t(){this.constructor=i}i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function wl(i,e,t,n){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(n.next(u))}catch(p){o(p)}}function l(u){try{c(n.throw(u))}catch(p){o(p)}}function c(u){u.done?r(u.value):s(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})}function Po(i,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,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(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(n=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(i,t)}catch(u){c=[6,u],s=0}finally{n=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function kt(i){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&i[e],n=0;if(t)return t.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&n>=i.length&&(i=void 0),{value:i&&i[n++],done:!i}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Be(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var n=t.call(i),s,r=[],o;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)r.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return r}function tt(i,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,r;n<s;n++)(r||!(n in e))&&(r||(r=Array.prototype.slice.call(e,0,n)),r[n]=e[n]);return i.concat(r||Array.prototype.slice.call(e))}function bt(i){return this instanceof bt?(this.v=i,this):new bt(i)}function $l(i,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(i,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(v){return Promise.resolve(v).then(g,p)}}function a(g,v){n[g]&&(s[g]=function(m){return new Promise(function(W,G){r.push([g,m,W,G])>1||l(g,m)})},v&&(s[g]=v(s[g])))}function l(g,v){try{c(n[g](v))}catch(m){d(r[0][3],m)}}function c(g){g.value instanceof bt?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,v){g(v),r.shift(),r.length&&l(r[0][0],r[0][1])}}function xl(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof kt=="function"?kt(i):i[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=i[r]&&function(o){return new Promise(function(a,l){o=i[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(i){return typeof i=="function"}function Mo(i){var e=function(n){Error.call(n),n.stack=new Error().stack},t=i(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var yn=Mo(function(i){return function(t){i(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
2
2
|
`+t.map(function(n,s){return s+1+") "+n.toString()}).join(`
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=t}});function _i(i,e){if(i){var t=i.indexOf(e);0<=t&&i.splice(t,1)}}var ni=(function(){function i(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return i.prototype.unsubscribe=function(){var e,t,n,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=wt(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(m){e={error:m}}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(m){r=m instanceof vn?m.errors:[m]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var d=wt(p),g=d.next();!g.done;g=d.next()){var v=g.value;try{_r(v)}catch(m){r=r??[],m instanceof vn?r=Je(Je([],je(r)),je(m.errors)):r.push(m)}}}catch(m){n={error:m}}finally{try{g&&!g.done&&(s=d.return)&&s.call(d)}finally{if(n)throw n.error}}}if(r)throw new vn(r)}},i.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)_r(e);else{if(e instanceof i){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},i.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},i.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},i.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&_i(t,e)},i.prototype.remove=function(e){var t=this._finalizers;t&&_i(t,e),e instanceof i&&e._removeParent(this)},i.EMPTY=(function(){var e=new i;return e.closed=!0,e})(),i})(),Po=ni.EMPTY;function Mo(i){return i instanceof ni||i&&"closed"in i&&C(i.remove)&&C(i.add)&&C(i.unsubscribe)}function _r(i){C(i)?i():i.unsubscribe()}var xl={Promise:void 0},kl={setTimeout:function(i,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,Je([i,e],je(t)))},clearTimeout:function(i){return clearTimeout(i)},delegate:void 0};function No(i){kl.setTimeout(function(){throw i})}function Ei(){}function xi(i){i()}var ts=(function(i){Ne(e,i);function e(t){var n=i.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Mo(t)&&t.add(n)):n.destination=_l,n}return e.create=function(t,n,s){return new Mn(t,n,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,i.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})(ni),Sl=(function(){function i(e){this.partialObserver=e}return i.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){vi(n)}},i.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){vi(n)}else vi(e)},i.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){vi(t)}},i})(),Mn=(function(i){Ne(e,i);function e(t,n,s){var r=i.call(this)||this,o;return C(t)||!t?o={next:t??void 0,error:n??void 0,complete:s??void 0}:o=t,r.destination=new Sl(o),r}return e})(ts);function vi(i){No(i)}function Cl(i){throw i}var _l={closed:!0,next:Ei,error:Cl,complete:Ei},is=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Et(i){return i}function El(i){return i.length===0?Et:i.length===1?i[0]:function(t){return i.reduce(function(n,s){return s(n)},t)}}var V=(function(){function i(e){e&&(this._subscribe=e)}return i.prototype.lift=function(e){var t=new i;return t.source=this,t.operator=e,t},i.prototype.subscribe=function(e,t,n){var s=this,r=Tl(e)?e:new Mn(e,t,n);return xi(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},i.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},i.prototype.forEach=function(e,t){var n=this;return t=Er(t),new t(function(s,r){var o=new Mn({next:function(a){try{e(a)}catch(l){r(l),o.unsubscribe()}},error:r,complete:s});n.subscribe(o)})},i.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},i.prototype[is]=function(){return this},i.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return El(e)(this)},i.prototype.toPromise=function(e){var t=this;return e=Er(e),new e(function(n,s){var r;t.subscribe(function(o){return r=o},function(o){return s(o)},function(){return n(r)})})},i.create=function(e){return new i(e)},i})();function Er(i){var e;return(e=i??xl.Promise)!==null&&e!==void 0?e:Promise}function Al(i){return i&&C(i.next)&&C(i.error)&&C(i.complete)}function Tl(i){return i&&i instanceof ts||Al(i)&&Mo(i)}function Ol(i){return C(i==null?void 0:i.lift)}function le(i){return function(e){if(Ol(e))return e.lift(function(t){try{return i(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function K(i,e,t,n,s){return new Rl(i,e,t,n,s)}var Rl=(function(i){Ne(e,i);function e(t,n,s,r,o,a){var l=i.call(this,t)||this;return l.onFinalize=o,l.shouldUnsubscribe=a,l._next=n?function(c){try{n(c)}catch(u){t.error(u)}}:i.prototype._next,l._error=r?function(c){try{r(c)}catch(u){t.error(u)}finally{this.unsubscribe()}}:i.prototype._error,l._complete=s?function(){try{s()}catch(c){t.error(c)}finally{this.unsubscribe()}}:i.prototype._complete,l}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;i.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e})(ts),Ll=Io(function(i){return function(){i(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),P=(function(i){Ne(e,i);function e(){var t=i.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 Ar(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new Ll},e.prototype.next=function(t){var n=this;xi(function(){var s,r;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=wt(n.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 n=this;xi(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var s=n.observers;s.length;)s.shift().error(t)}})},e.prototype.complete=function(){var t=this;xi(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(),i.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,s=this,r=s.hasError,o=s.isStopped,a=s.observers;return r||o?Po:(this.currentObservers=null,a.push(t),new ni(function(){n.currentObservers=null,_i(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,s=n.hasError,r=n.thrownError,o=n.isStopped;s?t.error(r):o&&t.complete()},e.prototype.asObservable=function(){var t=new V;return t.source=this,t},e.create=function(t,n){return new Ar(t,n)},e})(V),Ar=(function(i){Ne(e,i);function e(t,n){var s=i.call(this)||this;return s.destination=t,s.source=n,s}return e.prototype.next=function(t){var n,s;(s=(n=this.destination)===null||n===void 0?void 0:n.next)===null||s===void 0||s.call(n,t)},e.prototype.error=function(t){var n,s;(s=(n=this.destination)===null||n===void 0?void 0:n.error)===null||s===void 0||s.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,s;return(s=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&s!==void 0?s:Po},e})(P),fe=(function(i){Ne(e,i);function e(t){var n=i.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=i.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},e.prototype.getValue=function(){var t=this,n=t.hasError,s=t.thrownError,r=t._value;if(n)throw s;return this._throwIfClosed(),r},e.prototype.next=function(t){i.prototype.next.call(this,this._value=t)},e})(P),Il={now:function(){return Date.now()}},Pl=(function(i){Ne(e,i);function e(t,n){return i.call(this)||this}return e.prototype.schedule=function(t,n){return this},e})(ni),Tr={setInterval:function(i,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setInterval.apply(void 0,Je([i,e],je(t)))},clearInterval:function(i){return clearInterval(i)},delegate:void 0},Ml=(function(i){Ne(e,i);function e(t,n){var s=i.call(this,t,n)||this;return s.scheduler=t,s.work=n,s.pending=!1,s}return e.prototype.schedule=function(t,n){var s;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=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(o,this.id,n),this},e.prototype.requestAsyncId=function(t,n,s){return s===void 0&&(s=0),Tr.setInterval(t.flush.bind(t,this),s)},e.prototype.recycleAsyncId=function(t,n,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return n;n!=null&&Tr.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(t,n);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){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,n=t.id,s=t.scheduler,r=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,_i(r,this),n!=null&&(this.id=this.recycleAsyncId(s,n,null)),this.delay=null,i.prototype.unsubscribe.call(this)}},e})(Pl),Or=(function(){function i(e,t){t===void 0&&(t=i.now),this.schedulerActionCtor=e,this.now=t}return i.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},i.now=Il.now,i})(),Nl=(function(i){Ne(e,i);function e(t,n){n===void 0&&(n=Or.now);var s=i.call(this,t,n)||this;return s.actions=[],s._active=!1,s}return e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var s;this._active=!0;do if(s=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,s){for(;t=n.shift();)t.unsubscribe();throw s}},e})(Or),kp=new Nl(Ml);var Le=new V(function(i){return i.complete()});function Ul(i){return i&&C(i.schedule)}function ns(i){return i[i.length-1]}function Uo(i){return C(ns(i))?i.pop():void 0}function ss(i){return Ul(ns(i))?i.pop():void 0}function Dl(i,e){return typeof ns(i)=="number"?i.pop():e}var rs=(function(i){return i&&typeof i.length=="number"&&typeof i!="function"});function Do(i){return C(i==null?void 0:i.then)}function zo(i){return C(i[is])}function Ho(i){return Symbol.asyncIterator&&C(i==null?void 0:i[Symbol.asyncIterator])}function Fo(i){return new TypeError("You provided "+(i!==null&&typeof i=="object"?"an invalid object":"'"+i+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function zl(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var jo=zl();function Bo(i){return C(i==null?void 0:i[jo])}function qo(i){return $l(this,arguments,function(){var t,n,s,r;return Lo(this,function(o){switch(o.label){case 0:t=i.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,mt(t.read())];case 3:return n=o.sent(),s=n.value,r=n.done,r?[4,mt(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,mt(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 Vo(i){return C(i==null?void 0:i.getReader)}function ce(i){if(i instanceof V)return i;if(i!=null){if(zo(i))return Hl(i);if(rs(i))return Fl(i);if(Do(i))return jl(i);if(Ho(i))return Wo(i);if(Bo(i))return Bl(i);if(Vo(i))return ql(i)}throw Fo(i)}function Hl(i){return new V(function(e){var t=i[is]();if(C(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Fl(i){return new V(function(e){for(var t=0;t<i.length&&!e.closed;t++)e.next(i[t]);e.complete()})}function jl(i){return new V(function(e){i.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,No)})}function Bl(i){return new V(function(e){var t,n;try{for(var s=wt(i),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&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}e.complete()})}function Wo(i){return new V(function(e){Vl(i,e).catch(function(t){return e.error(t)})})}function ql(i){return Wo(qo(i))}function Vl(i,e){var t,n,s,r;return yl(this,void 0,void 0,function(){var o,a;return Lo(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),t=wl(i),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(),s={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(s)throw s.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function He(i,e,t,n,s){n===void 0&&(n=0),s===void 0&&(s=!1);var r=e.schedule(function(){t(),s?i.add(this.schedule(null,n)):this.unsubscribe()},n);if(i.add(r),!s)return r}function Go(i,e){return e===void 0&&(e=0),le(function(t,n){t.subscribe(K(n,function(s){return He(n,i,function(){return n.next(s)},e)},function(){return He(n,i,function(){return n.complete()},e)},function(s){return He(n,i,function(){return n.error(s)},e)}))})}function Zo(i,e){return e===void 0&&(e=0),le(function(t,n){n.add(i.schedule(function(){return t.subscribe(n)},e))})}function Wl(i,e){return ce(i).pipe(Zo(e),Go(e))}function Gl(i,e){return ce(i).pipe(Zo(e),Go(e))}function Zl(i,e){return new V(function(t){var n=0;return e.schedule(function(){n===i.length?t.complete():(t.next(i[n++]),t.closed||this.schedule())})})}function Yl(i,e){return new V(function(t){var n;return He(t,e,function(){n=i[jo](),He(t,e,function(){var s,r,o;try{s=n.next(),r=s.value,o=s.done}catch(a){t.error(a);return}o?t.complete():t.next(r)},0,!0)}),function(){return C(n==null?void 0:n.return)&&n.return()}})}function Yo(i,e){if(!i)throw new Error("Iterable cannot be null");return new V(function(t){He(t,e,function(){var n=i[Symbol.asyncIterator]();He(t,e,function(){n.next().then(function(s){s.done?t.complete():t.next(s.value)})},0,!0)})})}function Ql(i,e){return Yo(qo(i),e)}function Xl(i,e){if(i!=null){if(zo(i))return Wl(i,e);if(rs(i))return Zl(i,e);if(Do(i))return Gl(i,e);if(Ho(i))return Yo(i,e);if(Bo(i))return Yl(i,e);if(Vo(i))return Ql(i,e)}throw Fo(i)}function Xe(i,e){return e?Xl(i,e):ce(i)}function Nn(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var t=ss(i);return Xe(i,t)}function bn(i,e){var t=C(i)?i:function(){return i},n=function(s){return s.error(t())};return new V(n)}function Ai(i,e){return le(function(t,n){var s=0;t.subscribe(K(n,function(r){n.next(i.call(e,r,s++))}))})}var Kl=Array.isArray;function Jl(i,e){return Kl(e)?i.apply(void 0,Je([],je(e))):i(e)}function Qo(i){return Ai(function(e){return Jl(i,e)})}var ec=Array.isArray,tc=Object.getPrototypeOf,ic=Object.prototype,nc=Object.keys;function sc(i){if(i.length===1){var e=i[0];if(ec(e))return{args:e,keys:null};if(rc(e)){var t=nc(e);return{args:t.map(function(n){return e[n]}),keys:t}}}return{args:i,keys:null}}function rc(i){return i&&typeof i=="object"&&tc(i)===ic}function oc(i,e){return i.reduce(function(t,n,s){return t[n]=e[s],t},{})}function ac(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var t=ss(i),n=Uo(i),s=sc(i),r=s.args,o=s.keys;if(r.length===0)return Xe([],t);var a=new V(lc(r,t,o?function(l){return oc(o,l)}:Et));return n?a.pipe(Qo(n)):a}function lc(i,e,t){return t===void 0&&(t=Et),function(n){Rr(e,function(){for(var s=i.length,r=new Array(s),o=s,a=s,l=function(u){Rr(e,function(){var p=Xe(i[u],e),d=!1;p.subscribe(K(n,function(g){r[u]=g,d||(d=!0,a--),a||n.next(t(r.slice()))},function(){--o||n.complete()}))},n)},c=0;c<s;c++)l(c)},n)}}function Rr(i,e,t){i?He(t,i,e):e()}function cc(i,e,t,n,s,r,o,a){var l=[],c=0,u=0,p=!1,d=function(){p&&!l.length&&!c&&e.complete()},g=function(m){return c<n?v(m):l.push(m)},v=function(m){c++;var W=!1;ce(t(m,u++)).subscribe(K(e,function(G){e.next(G)},function(){W=!0},void 0,function(){if(W)try{c--;for(var G=function(){var Ue=l.shift();o||v(Ue)};l.length&&c<n;)G();d()}catch(Ue){e.error(Ue)}}))};return i.subscribe(K(e,g,function(){p=!0,d()})),function(){}}function Wt(i,e,t){return t===void 0&&(t=1/0),C(e)?Wt(function(n,s){return Ai(function(r,o){return e(n,r,s,o)})(ce(i(n,s)))},t):(typeof e=="number"&&(t=e),le(function(n,s){return cc(n,s,i,t)}))}function uc(i){return i===void 0&&(i=1/0),Wt(Et,i)}function hc(i){return new V(function(e){ce(i()).subscribe(e)})}var dc=["addListener","removeListener"],pc=["addEventListener","removeEventListener"],fc=["on","off"];function Ti(i,e,t,n){if(C(t)&&(n=t,t=void 0),n)return Ti(i,e,t).pipe(Qo(n));var s=je(vc(i)?pc.map(function(a){return function(l){return i[a](e,l,t)}}):gc(i)?dc.map(Lr(i,e)):mc(i)?fc.map(Lr(i,e)):[],2),r=s[0],o=s[1];if(!r&&rs(i))return Wt(function(a){return Ti(a,e,t)})(ce(i));if(!r)throw new TypeError("Invalid event target");return new V(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 Lr(i,e){return function(t){return function(n){return i[t](e,n)}}}function gc(i){return C(i.addListener)&&C(i.removeListener)}function mc(i){return C(i.on)&&C(i.off)}function vc(i){return C(i.addEventListener)&&C(i.removeEventListener)}function bc(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var t=ss(i),n=Dl(i,1/0),s=i;return s.length?s.length===1?ce(s[0]):uc(n)(Xe(s,t)):Le}function Q(i,e){return le(function(t,n){var s=0;t.subscribe(K(n,function(r){return i.call(e,r,s++)&&n.next(r)}))})}function vt(i){return le(function(e,t){var n=null,s=!1,r;n=e.subscribe(K(t,void 0,void 0,function(o){r=ce(i(o,vt(i)(e))),n?(n.unsubscribe(),n=null,r.subscribe(t)):s=!0})),s&&(n.unsubscribe(),n=null,r.subscribe(t))})}function yn(i,e){return C(e)?Wt(i,e,1):Wt(i,1)}function we(i){return i<=0?function(){return Le}:le(function(e,t){var n=0;e.subscribe(K(t,function(s){++n<=i&&(t.next(s),i<=n&&t.complete())}))})}function $n(i){var e=1/0,t;return e<=0?function(){return Le}:le(function(n,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=n.subscribe(K(s,void 0,function(){++r<e?o?a():c=!0:s.complete()})),c&&a()};l()})}function Ie(i,e){return le(function(t,n){var s=null,r=0,o=!1,a=function(){return o&&!s&&n.complete()};t.subscribe(K(n,function(l){s==null||s.unsubscribe();var c=0,u=r++;ce(i(l,u)).subscribe(s=K(n,function(p){return n.next(e?e(l,p,u,c++):p)},function(){s=null,a()}))},function(){o=!0,a()}))})}function z(i){return le(function(e,t){ce(i).subscribe(K(t,function(){return t.complete()},Ei)),!t.closed&&e.subscribe(t)})}function yc(i,e,t){var n=C(i)||e||t?{next:i,error:e,complete:t}:i;return n?le(function(s,r){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;s.subscribe(K(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)}))}):Et}function Un(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var t=Uo(i);return le(function(n,s){for(var r=i.length,o=new Array(r),a=i.map(function(){return!1}),l=!1,c=function(p){ce(i[p]).subscribe(K(s,function(d){o[p]=d,!l&&!a[p]&&(a[p]=!0,(l=a.every(Et))&&(a=null))},Ei))},u=0;u<r;u++)c(u);n.subscribe(K(s,function(p){if(l){var d=Je([p],je(o));s.next(t?t.apply(void 0,Je([],je(d))):d)}}))})}class os{constructor(){this.registeredProviders=new Map}static async getInstance(e){let t=await e.get("conversation");return t||(t=new os,await e.register("conversation",t),t)}registerProvider(e,t){this.registeredProviders.set(e,t)}}var j=(i=>(i.User="user",i.Agent="agent",i.System="system",i))(j||{});const $c=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+i/4).toString(16)),Xo=()=>typeof crypto.randomUUID=="function"?crypto.randomUUID():$c();function Ir(i){let e=i;const t=/https?:\/\/[^\s<]+/gi,n=/<a [^>]*href="([^"]*)"[^>]*>[^<]*<\/a>/g,s=i.match(t)||[],r=[];let o;for(;(o=n.exec(i))!==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 Dn(i){if(i.includes("aceChatGuideTitle"))return wc(i);const e=/<a [^>]*>https?:\/\/[^<]*<\/a>/gim;return i.replace(e,t=>{const n=Ko(t);if(!n)return t;const s=50;if(n.length>s){const r=/^(https?:\/\/[^/]+)(\/.*)?$/i,o=n.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 zn(t,g)}return zn(t,n)})}function Ko(i){const e=i.match(/href=["']([^'"]*)["']/);if(e&&e.length>1){let t=e[1];return t.endsWith(".")&&(t=t.slice(0,-1)),t}return null}function zn(i,e){return i.replace(/>[^<]*<\/a>/,`>${e}</a>`)}function wc(i){const e=/<a [^>]*aceChatGuideTitle[^>]*>[^<]*<\/a>/gm;return i.replace(e,t=>{const n=Ko(t);if(!n)return t;const s=n.split("?").pop(),o=new URLSearchParams(s).get("aceChatGuideTitle");return o?zn(t,o):t})}class ne{constructor(e,t,n){this.type=e,this.sender=t,this.messages=n,this.status="delivered",this.didUpdate=new P,this.actions$=new P,this.remove$=new P,this.timestamp=Date.now(),this.id=Xo()}update(e){this.messages=[{items:e}],this.didUpdate.next(this)}setStatus(e){this.status=e,this.didUpdate.next(this)}remove(){this.remove$.next()}}class xc{constructor(e){this.name=e,this.print$=new P}print(e,t="html",n=this.name){const s=new ne(j.Agent,{name:n},[{items:[[t,{content:e}]]}]);return this.print$.next(s),s}subscribe(){return this.print$.asObservable()}}class kc{constructor(e){this.name=e,this.print$=new P}print(e){const t=new ne(j.User,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class Sc{constructor(){this.print$=new P,this.name="system"}print(e){const t=new ne(j.System,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class Cc{constructor(e,t){this.name=e,this.component=t,this.print$=new P,this.typingState$=new fe(!1),this.complete$=new P,this.system=this.createSystem(),this.rehydrate$=new P,this.saveToCurrentSession$=new P,this.showChatOverlay$=new fe(!1),this.onComplete=()=>this.complete$.asObservable()}connect(e={}){this.complete$.pipe(we(1)).subscribe(()=>{this.disconnected()})}disconnected(){}onUserSubmit(e){this.print(j.User,e.text)}print(e,t){const n=new ne(e,{name:""},[{items:[["html",{content:t}]]}]);return this.printEntry(n)}printEntry(e){return this.print$.next(e),e}createAgent(e){const t=new xc(e);return t.subscribe().subscribe(n=>{this.playNotification(),this.printEntry(n)}),t}createUser(e){const t=new kc(e);return t.subscribe().subscribe(n=>{this.printEntry(n)}),t}createSystem(){const e=new Sc;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){}}/**
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=t}});function Ei(i,e){if(i){var t=i.indexOf(e);0<=t&&i.splice(t,1)}}var si=(function(){function i(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return i.prototype.unsubscribe=function(){var e,t,n,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=kt(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(m){e={error:m}}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(m){r=m instanceof yn?m.errors:[m]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var d=kt(p),g=d.next();!g.done;g=d.next()){var v=g.value;try{Tr(v)}catch(m){r=r??[],m instanceof yn?r=tt(tt([],Be(r)),Be(m.errors)):r.push(m)}}}catch(m){n={error:m}}finally{try{g&&!g.done&&(s=d.return)&&s.call(d)}finally{if(n)throw n.error}}}if(r)throw new yn(r)}},i.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Tr(e);else{if(e instanceof i){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},i.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},i.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},i.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Ei(t,e)},i.prototype.remove=function(e){var t=this._finalizers;t&&Ei(t,e),e instanceof i&&e._removeParent(this)},i.EMPTY=(function(){var e=new i;return e.closed=!0,e})(),i})(),No=si.EMPTY;function Do(i){return i instanceof si||i&&"closed"in i&&C(i.remove)&&C(i.add)&&C(i.unsubscribe)}function Tr(i){C(i)?i():i.unsubscribe()}var kl={Promise:void 0},Sl={setTimeout:function(i,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,tt([i,e],Be(t)))},clearTimeout:function(i){return clearTimeout(i)},delegate:void 0};function Uo(i){Sl.setTimeout(function(){throw i})}function Ai(){}function ki(i){i()}var rs=(function(i){De(e,i);function e(t){var n=i.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Do(t)&&t.add(n)):n.destination=El,n}return e.create=function(t,n,s){return new Un(t,n,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,i.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})(si),Cl=(function(){function i(e){this.partialObserver=e}return i.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){bi(n)}},i.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){bi(n)}else bi(e)},i.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){bi(t)}},i})(),Un=(function(i){De(e,i);function e(t,n,s){var r=i.call(this)||this,o;return C(t)||!t?o={next:t??void 0,error:n??void 0,complete:s??void 0}:o=t,r.destination=new Cl(o),r}return e})(rs);function bi(i){Uo(i)}function _l(i){throw i}var El={closed:!0,next:Ai,error:_l,complete:Ai},os=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Tt(i){return i}function Al(i){return i.length===0?Tt:i.length===1?i[0]:function(t){return i.reduce(function(n,s){return s(n)},t)}}var V=(function(){function i(e){e&&(this._subscribe=e)}return i.prototype.lift=function(e){var t=new i;return t.source=this,t.operator=e,t},i.prototype.subscribe=function(e,t,n){var s=this,r=Ol(e)?e:new Un(e,t,n);return ki(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},i.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},i.prototype.forEach=function(e,t){var n=this;return t=Or(t),new t(function(s,r){var o=new Un({next:function(a){try{e(a)}catch(l){r(l),o.unsubscribe()}},error:r,complete:s});n.subscribe(o)})},i.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},i.prototype[os]=function(){return this},i.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Al(e)(this)},i.prototype.toPromise=function(e){var t=this;return e=Or(e),new e(function(n,s){var r;t.subscribe(function(o){return r=o},function(o){return s(o)},function(){return n(r)})})},i.create=function(e){return new i(e)},i})();function Or(i){var e;return(e=i??kl.Promise)!==null&&e!==void 0?e:Promise}function Tl(i){return i&&C(i.next)&&C(i.error)&&C(i.complete)}function Ol(i){return i&&i instanceof rs||Tl(i)&&Do(i)}function Rl(i){return C(i==null?void 0:i.lift)}function le(i){return function(e){if(Rl(e))return e.lift(function(t){try{return i(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function K(i,e,t,n,s){return new Ll(i,e,t,n,s)}var Ll=(function(i){De(e,i);function e(t,n,s,r,o,a){var l=i.call(this,t)||this;return l.onFinalize=o,l.shouldUnsubscribe=a,l._next=n?function(c){try{n(c)}catch(u){t.error(u)}}:i.prototype._next,l._error=r?function(c){try{r(c)}catch(u){t.error(u)}finally{this.unsubscribe()}}:i.prototype._error,l._complete=s?function(){try{s()}catch(c){t.error(c)}finally{this.unsubscribe()}}:i.prototype._complete,l}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;i.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e})(rs),Il=Mo(function(i){return function(){i(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),M=(function(i){De(e,i);function e(){var t=i.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 Rr(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new Il},e.prototype.next=function(t){var n=this;ki(function(){var s,r;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=kt(n.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 n=this;ki(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var s=n.observers;s.length;)s.shift().error(t)}})},e.prototype.complete=function(){var t=this;ki(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(),i.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,s=this,r=s.hasError,o=s.isStopped,a=s.observers;return r||o?No:(this.currentObservers=null,a.push(t),new si(function(){n.currentObservers=null,Ei(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,s=n.hasError,r=n.thrownError,o=n.isStopped;s?t.error(r):o&&t.complete()},e.prototype.asObservable=function(){var t=new V;return t.source=this,t},e.create=function(t,n){return new Rr(t,n)},e})(V),Rr=(function(i){De(e,i);function e(t,n){var s=i.call(this)||this;return s.destination=t,s.source=n,s}return e.prototype.next=function(t){var n,s;(s=(n=this.destination)===null||n===void 0?void 0:n.next)===null||s===void 0||s.call(n,t)},e.prototype.error=function(t){var n,s;(s=(n=this.destination)===null||n===void 0?void 0:n.error)===null||s===void 0||s.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,s;return(s=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&s!==void 0?s:No},e})(M),fe=(function(i){De(e,i);function e(t){var n=i.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=i.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},e.prototype.getValue=function(){var t=this,n=t.hasError,s=t.thrownError,r=t._value;if(n)throw s;return this._throwIfClosed(),r},e.prototype.next=function(t){i.prototype.next.call(this,this._value=t)},e})(M),Pl={now:function(){return Date.now()}},Ml=(function(i){De(e,i);function e(t,n){return i.call(this)||this}return e.prototype.schedule=function(t,n){return this},e})(si),Lr={setInterval:function(i,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setInterval.apply(void 0,tt([i,e],Be(t)))},clearInterval:function(i){return clearInterval(i)},delegate:void 0},Nl=(function(i){De(e,i);function e(t,n){var s=i.call(this,t,n)||this;return s.scheduler=t,s.work=n,s.pending=!1,s}return e.prototype.schedule=function(t,n){var s;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=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(o,this.id,n),this},e.prototype.requestAsyncId=function(t,n,s){return s===void 0&&(s=0),Lr.setInterval(t.flush.bind(t,this),s)},e.prototype.recycleAsyncId=function(t,n,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return n;n!=null&&Lr.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(t,n);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){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,n=t.id,s=t.scheduler,r=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Ei(r,this),n!=null&&(this.id=this.recycleAsyncId(s,n,null)),this.delay=null,i.prototype.unsubscribe.call(this)}},e})(Ml),Ir=(function(){function i(e,t){t===void 0&&(t=i.now),this.schedulerActionCtor=e,this.now=t}return i.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},i.now=Pl.now,i})(),Dl=(function(i){De(e,i);function e(t,n){n===void 0&&(n=Ir.now);var s=i.call(this,t,n)||this;return s.actions=[],s._active=!1,s}return e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var s;this._active=!0;do if(s=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,s){for(;t=n.shift();)t.unsubscribe();throw s}},e})(Ir),Sp=new Dl(Nl);var Ie=new V(function(i){return i.complete()});function Ul(i){return i&&C(i.schedule)}function as(i){return i[i.length-1]}function zo(i){return C(as(i))?i.pop():void 0}function ls(i){return Ul(as(i))?i.pop():void 0}function zl(i,e){return typeof as(i)=="number"?i.pop():e}var cs=(function(i){return i&&typeof i.length=="number"&&typeof i!="function"});function Fo(i){return C(i==null?void 0:i.then)}function Ho(i){return C(i[os])}function jo(i){return Symbol.asyncIterator&&C(i==null?void 0:i[Symbol.asyncIterator])}function Bo(i){return new TypeError("You provided "+(i!==null&&typeof i=="object"?"an invalid object":"'"+i+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Fl(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var qo=Fl();function Vo(i){return C(i==null?void 0:i[qo])}function Wo(i){return $l(this,arguments,function(){var t,n,s,r;return Po(this,function(o){switch(o.label){case 0:t=i.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,bt(t.read())];case 3:return n=o.sent(),s=n.value,r=n.done,r?[4,bt(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,bt(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 Go(i){return C(i==null?void 0:i.getReader)}function ce(i){if(i instanceof V)return i;if(i!=null){if(Ho(i))return Hl(i);if(cs(i))return jl(i);if(Fo(i))return Bl(i);if(jo(i))return Zo(i);if(Vo(i))return ql(i);if(Go(i))return Vl(i)}throw Bo(i)}function Hl(i){return new V(function(e){var t=i[os]();if(C(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function jl(i){return new V(function(e){for(var t=0;t<i.length&&!e.closed;t++)e.next(i[t]);e.complete()})}function Bl(i){return new V(function(e){i.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Uo)})}function ql(i){return new V(function(e){var t,n;try{for(var s=kt(i),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&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}e.complete()})}function Zo(i){return new V(function(e){Wl(i,e).catch(function(t){return e.error(t)})})}function Vl(i){return Zo(Wo(i))}function Wl(i,e){var t,n,s,r;return wl(this,void 0,void 0,function(){var o,a;return Po(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),t=xl(i),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(),s={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(s)throw s.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function He(i,e,t,n,s){n===void 0&&(n=0),s===void 0&&(s=!1);var r=e.schedule(function(){t(),s?i.add(this.schedule(null,n)):this.unsubscribe()},n);if(i.add(r),!s)return r}function Yo(i,e){return e===void 0&&(e=0),le(function(t,n){t.subscribe(K(n,function(s){return He(n,i,function(){return n.next(s)},e)},function(){return He(n,i,function(){return n.complete()},e)},function(s){return He(n,i,function(){return n.error(s)},e)}))})}function Qo(i,e){return e===void 0&&(e=0),le(function(t,n){n.add(i.schedule(function(){return t.subscribe(n)},e))})}function Gl(i,e){return ce(i).pipe(Qo(e),Yo(e))}function Zl(i,e){return ce(i).pipe(Qo(e),Yo(e))}function Yl(i,e){return new V(function(t){var n=0;return e.schedule(function(){n===i.length?t.complete():(t.next(i[n++]),t.closed||this.schedule())})})}function Ql(i,e){return new V(function(t){var n;return He(t,e,function(){n=i[qo](),He(t,e,function(){var s,r,o;try{s=n.next(),r=s.value,o=s.done}catch(a){t.error(a);return}o?t.complete():t.next(r)},0,!0)}),function(){return C(n==null?void 0:n.return)&&n.return()}})}function Xo(i,e){if(!i)throw new Error("Iterable cannot be null");return new V(function(t){He(t,e,function(){var n=i[Symbol.asyncIterator]();He(t,e,function(){n.next().then(function(s){s.done?t.complete():t.next(s.value)})},0,!0)})})}function Xl(i,e){return Xo(Wo(i),e)}function Kl(i,e){if(i!=null){if(Ho(i))return Gl(i,e);if(cs(i))return Yl(i,e);if(Fo(i))return Zl(i,e);if(jo(i))return Xo(i,e);if(Vo(i))return Ql(i,e);if(Go(i))return Xl(i,e)}throw Bo(i)}function Je(i,e){return e?Kl(i,e):ce(i)}function zn(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var t=ls(i);return Je(i,t)}function wn(i,e){var t=C(i)?i:function(){return i},n=function(s){return s.error(t())};return new V(n)}function Ti(i,e){return le(function(t,n){var s=0;t.subscribe(K(n,function(r){n.next(i.call(e,r,s++))}))})}var Jl=Array.isArray;function ec(i,e){return Jl(e)?i.apply(void 0,tt([],Be(e))):i(e)}function Ko(i){return Ti(function(e){return ec(i,e)})}var tc=Array.isArray,ic=Object.getPrototypeOf,nc=Object.prototype,sc=Object.keys;function rc(i){if(i.length===1){var e=i[0];if(tc(e))return{args:e,keys:null};if(oc(e)){var t=sc(e);return{args:t.map(function(n){return e[n]}),keys:t}}}return{args:i,keys:null}}function oc(i){return i&&typeof i=="object"&&ic(i)===nc}function ac(i,e){return i.reduce(function(t,n,s){return t[n]=e[s],t},{})}function lc(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var t=ls(i),n=zo(i),s=rc(i),r=s.args,o=s.keys;if(r.length===0)return Je([],t);var a=new V(cc(r,t,o?function(l){return ac(o,l)}:Tt));return n?a.pipe(Ko(n)):a}function cc(i,e,t){return t===void 0&&(t=Tt),function(n){Pr(e,function(){for(var s=i.length,r=new Array(s),o=s,a=s,l=function(u){Pr(e,function(){var p=Je(i[u],e),d=!1;p.subscribe(K(n,function(g){r[u]=g,d||(d=!0,a--),a||n.next(t(r.slice()))},function(){--o||n.complete()}))},n)},c=0;c<s;c++)l(c)},n)}}function Pr(i,e,t){i?He(t,i,e):e()}function uc(i,e,t,n,s,r,o,a){var l=[],c=0,u=0,p=!1,d=function(){p&&!l.length&&!c&&e.complete()},g=function(m){return c<n?v(m):l.push(m)},v=function(m){c++;var W=!1;ce(t(m,u++)).subscribe(K(e,function(G){e.next(G)},function(){W=!0},void 0,function(){if(W)try{c--;for(var G=function(){var Ue=l.shift();o||v(Ue)};l.length&&c<n;)G();d()}catch(Ue){e.error(Ue)}}))};return i.subscribe(K(e,g,function(){p=!0,d()})),function(){}}function Gt(i,e,t){return t===void 0&&(t=1/0),C(e)?Gt(function(n,s){return Ti(function(r,o){return e(n,r,s,o)})(ce(i(n,s)))},t):(typeof e=="number"&&(t=e),le(function(n,s){return uc(n,s,i,t)}))}function hc(i){return i===void 0&&(i=1/0),Gt(Tt,i)}function dc(i){return new V(function(e){ce(i()).subscribe(e)})}var pc=["addListener","removeListener"],fc=["addEventListener","removeEventListener"],gc=["on","off"];function Oi(i,e,t,n){if(C(t)&&(n=t,t=void 0),n)return Oi(i,e,t).pipe(Ko(n));var s=Be(bc(i)?fc.map(function(a){return function(l){return i[a](e,l,t)}}):mc(i)?pc.map(Mr(i,e)):vc(i)?gc.map(Mr(i,e)):[],2),r=s[0],o=s[1];if(!r&&cs(i))return Gt(function(a){return Oi(a,e,t)})(ce(i));if(!r)throw new TypeError("Invalid event target");return new V(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 Mr(i,e){return function(t){return function(n){return i[t](e,n)}}}function mc(i){return C(i.addListener)&&C(i.removeListener)}function vc(i){return C(i.on)&&C(i.off)}function bc(i){return C(i.addEventListener)&&C(i.removeEventListener)}function yc(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var t=ls(i),n=zl(i,1/0),s=i;return s.length?s.length===1?ce(s[0]):hc(n)(Je(s,t)):Ie}function Q(i,e){return le(function(t,n){var s=0;t.subscribe(K(n,function(r){return i.call(e,r,s++)&&n.next(r)}))})}function yt(i){return le(function(e,t){var n=null,s=!1,r;n=e.subscribe(K(t,void 0,void 0,function(o){r=ce(i(o,yt(i)(e))),n?(n.unsubscribe(),n=null,r.subscribe(t)):s=!0})),s&&(n.unsubscribe(),n=null,r.subscribe(t))})}function $n(i,e){return C(e)?Gt(i,e,1):Gt(i,1)}function ke(i){return i<=0?function(){return Ie}:le(function(e,t){var n=0;e.subscribe(K(t,function(s){++n<=i&&(t.next(s),i<=n&&t.complete())}))})}function xn(i){var e=1/0,t;return e<=0?function(){return Ie}:le(function(n,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=n.subscribe(K(s,void 0,function(){++r<e?o?a():c=!0:s.complete()})),c&&a()};l()})}function Pe(i,e){return le(function(t,n){var s=null,r=0,o=!1,a=function(){return o&&!s&&n.complete()};t.subscribe(K(n,function(l){s==null||s.unsubscribe();var c=0,u=r++;ce(i(l,u)).subscribe(s=K(n,function(p){return n.next(e?e(l,p,u,c++):p)},function(){s=null,a()}))},function(){o=!0,a()}))})}function F(i){return le(function(e,t){ce(i).subscribe(K(t,function(){return t.complete()},Ai)),!t.closed&&e.subscribe(t)})}function wc(i,e,t){var n=C(i)||e||t?{next:i,error:e,complete:t}:i;return n?le(function(s,r){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;s.subscribe(K(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)}))}):Tt}function Fn(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var t=zo(i);return le(function(n,s){for(var r=i.length,o=new Array(r),a=i.map(function(){return!1}),l=!1,c=function(p){ce(i[p]).subscribe(K(s,function(d){o[p]=d,!l&&!a[p]&&(a[p]=!0,(l=a.every(Tt))&&(a=null))},Ai))},u=0;u<r;u++)c(u);n.subscribe(K(s,function(p){if(l){var d=tt([p],Be(o));s.next(t?t.apply(void 0,tt([],Be(d))):d)}}))})}class us{constructor(){this.registeredProviders=new Map}static async getInstance(e){let t=await e.get("conversation");return t||(t=new us,await e.register("conversation",t),t)}registerProvider(e,t){this.registeredProviders.set(e,t)}}var B=(i=>(i.User="user",i.Agent="agent",i.System="system",i))(B||{});const $c=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+i/4).toString(16)),Jo=()=>typeof crypto.randomUUID=="function"?crypto.randomUUID():$c();function Nr(i){let e=i;const t=/https?:\/\/[^\s<]+/gi,n=/<a [^>]*href="([^"]*)"[^>]*>[^<]*<\/a>/g,s=i.match(t)||[],r=[];let o;for(;(o=n.exec(i))!==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 Hn(i){if(i.includes("aceChatGuideTitle"))return xc(i);const e=/<a [^>]*>https?:\/\/[^<]*<\/a>/gim;return i.replace(e,t=>{const n=ea(t);if(!n)return t;const s=50;if(n.length>s){const r=/^(https?:\/\/[^/]+)(\/.*)?$/i,o=n.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 jn(t,g)}return jn(t,n)})}function ea(i){const e=i.match(/href=["']([^'"]*)["']/);if(e&&e.length>1){let t=e[1];return t.endsWith(".")&&(t=t.slice(0,-1)),t}return null}function jn(i,e){return i.replace(/>[^<]*<\/a>/,`>${e}</a>`)}function xc(i){const e=/<a [^>]*aceChatGuideTitle[^>]*>[^<]*<\/a>/gm;return i.replace(e,t=>{const n=ea(t);if(!n)return t;const s=n.split("?").pop(),o=new URLSearchParams(s).get("aceChatGuideTitle");return o?jn(t,o):t})}class ne{constructor(e,t,n){this.type=e,this.sender=t,this.messages=n,this.status="delivered",this.didUpdate=new M,this.actions$=new M,this.remove$=new M,this.timestamp=Date.now(),this.id=Jo()}update(e){this.messages=[{items:e}],this.didUpdate.next(this)}setStatus(e){this.status=e,this.didUpdate.next(this)}remove(){this.remove$.next()}}class kc{constructor(e){this.name=e,this.print$=new M}print(e,t="html",n=this.name){const s=new ne(B.Agent,{name:n},[{items:[[t,{content:e}]]}]);return this.print$.next(s),s}subscribe(){return this.print$.asObservable()}}class Sc{constructor(e){this.name=e,this.print$=new M}print(e){const t=new ne(B.User,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class Cc{constructor(){this.print$=new M,this.name="system"}print(e){const t=new ne(B.System,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class _c{constructor(e,t){this.name=e,this.component=t,this.print$=new M,this.typingState$=new fe(!1),this.complete$=new M,this.system=this.createSystem(),this.rehydrate$=new M,this.saveToCurrentSession$=new M,this.showChatOverlay$=new fe(!1),this.onComplete=()=>this.complete$.asObservable()}connect(e={}){this.complete$.pipe(ke(1)).subscribe(()=>{this.disconnected()})}disconnected(){}onUserSubmit(e){this.print(B.User,e.text)}print(e,t){const n=new ne(e,{name:""},[{items:[["html",{content:t}]]}]);return this.printEntry(n)}printEntry(e){return this.print$.next(e),e}createAgent(e){const t=new kc(e);return t.subscribe().subscribe(n=>{this.playNotification(),this.printEntry(n)}),t}createUser(e){const t=new Sc(e);return t.subscribe().subscribe(n=>{this.printEntry(n)}),t}createSystem(){const e=new Cc;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
|
|
7
|
+
*/const Si=globalThis,hs=Si.ShadowRoot&&(Si.ShadyCSS===void 0||Si.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ds=Symbol(),Dr=new WeakMap;let ta=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==ds)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(hs&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=Dr.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Dr.set(t,e))}return e}toString(){return this.cssText}};const Ec=i=>new ta(typeof i=="string"?i:i+"",void 0,ds),O=(i,...e)=>{const t=i.length===1?i[0]:e.reduce(((n,s,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.")})(s)+i[r+1]),i[0]);return new ta(t,i,ds)},Ac=(i,e)=>{if(hs)i.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const t of e){const n=document.createElement("style"),s=Si.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=t.cssText,i.appendChild(n)}},Ur=hs?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return Ec(t)})(i):i;/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/const{is:
|
|
11
|
+
*/const{is:Tc,defineProperty:Oc,getOwnPropertyDescriptor:Rc,getOwnPropertyNames:Lc,getOwnPropertySymbols:Ic,getPrototypeOf:Pc}=Object,je=globalThis,zr=je.trustedTypes,Mc=zr?zr.emptyScript:"",kn=je.reactiveElementPolyfillSupport,jt=(i,e)=>i,Ri={toAttribute(i,e){switch(e){case Boolean:i=i?Mc:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},ps=(i,e)=>!Tc(i,e),Fr={attribute:!0,type:String,converter:Ri,reflect:!1,useDefault:!1,hasChanged:ps};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),je.litPropertyMetadata??(je.litPropertyMetadata=new WeakMap);let ft=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=Fr){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(),s=this.getPropertyDescriptor(e,n,t);s!==void 0&&Oc(this.prototype,e,s)}}static getPropertyDescriptor(e,t,n){const{get:s,set:r}=Rc(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,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Fr}static _$Ei(){if(this.hasOwnProperty(jt("elementProperties")))return;const e=Pc(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(jt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(jt("properties"))){const t=this.properties,n=[...Lc(t),...Ic(t)];for(const s of n)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[n,s]of t)this.elementProperties.set(n,s)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const s=this._$Eu(t,n);s!==void 0&&this._$Eh.set(s,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 s of n)t.unshift(Ur(s))}else e!==void 0&&t.push(Ur(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 Ac(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),s=this.constructor._$Eu(e,n);if(s!==void 0&&n.reflect===!0){const o=(((r=n.converter)==null?void 0:r.toAttribute)!==void 0?n.converter:Ri).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){var r,o;const n=this.constructor,s=n._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const a=n.getPropertyOptions(s),l=typeof a.converter=="function"?{fromAttribute:a.converter}:((r=a.converter)==null?void 0:r.fromAttribute)!==void 0?a.converter:Ri;this._$Em=s;const c=l.fromAttribute(t,a.type);this[s]=c??((o=this._$Ej)==null?void 0:o.get(s))??c,this._$Em=null}}requestUpdate(e,t,n){var s;if(e!==void 0){const r=this.constructor,o=this[e];if(n??(n=r.getPropertyOptions(e)),!((n.hasChanged??ps)(o,t)||n.useDefault&&n.reflect&&o===((s=this._$Ej)==null?void 0:s.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:s,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)),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 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 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),(n=this._$EO)==null||n.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((n=>{var s;return(s=n.hostUpdated)==null?void 0:s.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){}};ft.elementStyles=[],ft.shadowRootOptions={mode:"open"},ft[jt("elementProperties")]=new Map,ft[jt("finalized")]=new Map,kn==null||kn({ReactiveElement:ft}),(je.reactiveElementVersions??(je.reactiveElementVersions=[])).push("2.1.1");/**
|
|
12
12
|
* @license
|
|
13
13
|
* Copyright 2017 Google LLC
|
|
14
14
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
15
|
-
*/const
|
|
16
|
-
\f\r]`,
|
|
17
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
15
|
+
*/const Bt=globalThis,Li=Bt.trustedTypes,Hr=Li?Li.createPolicy("lit-html",{createHTML:i=>i}):void 0,ia="$lit$",ze=`lit$${Math.random().toFixed(9).slice(2)}$`,na="?"+ze,Nc=`<${na}>`,it=document,Zt=()=>it.createComment(""),Yt=i=>i===null||typeof i!="object"&&typeof i!="function",fs=Array.isArray,Dc=i=>fs(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Sn=`[
|
|
16
|
+
\f\r]`,Pt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,jr=/-->/g,Br=/>/g,Qe=RegExp(`>|${Sn}(?:([^\\s"'>=/]+)(${Sn}*=${Sn}*(?:[^
|
|
17
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),qr=/'/g,Vr=/"/g,sa=/^(?:script|style|textarea|title)$/i,Uc=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),w=Uc(1),Me=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),Wr=new WeakMap,Ke=it.createTreeWalker(it,129);function ra(i,e){if(!fs(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Hr!==void 0?Hr.createHTML(e):e}const zc=(i,e)=>{const t=i.length-1,n=[];let s,r=e===2?"<svg>":e===3?"<math>":"",o=Pt;for(let a=0;a<t;a++){const l=i[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===Pt?u[1]==="!--"?o=jr:u[1]!==void 0?o=Br:u[2]!==void 0?(sa.test(u[2])&&(s=RegExp("</"+u[2],"g")),o=Qe):u[3]!==void 0&&(o=Qe):o===Qe?u[0]===">"?(o=s??Pt,p=-1):u[1]===void 0?p=-2:(p=o.lastIndex-u[2].length,c=u[1],o=u[3]===void 0?Qe:u[3]==='"'?Vr:qr):o===Vr||o===qr?o=Qe:o===jr||o===Br?o=Pt:(o=Qe,s=void 0);const g=o===Qe&&i[a+1].startsWith("/>")?" ":"";r+=o===Pt?l+Nc:p>=0?(n.push(c),l.slice(0,p)+ia+l.slice(p)+ze+g):l+ze+(p===-2?a:g)}return[ra(i,r+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};let Bn=class oa{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[c,u]=zc(e,t);if(this.el=oa.createElement(c,n),Ke.currentNode=this.el.content,t===2||t===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(s=Ke.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(const p of s.getAttributeNames())if(p.endsWith(ia)){const d=u[o++],g=s.getAttribute(p).split(ze),v=/([.?@])?(.*)/.exec(d);l.push({type:1,index:r,name:v[2],strings:g,ctor:v[1]==="."?Hc:v[1]==="?"?jc:v[1]==="@"?Bc:Qi}),s.removeAttribute(p)}else p.startsWith(ze)&&(l.push({type:6,index:r}),s.removeAttribute(p));if(sa.test(s.tagName)){const p=s.textContent.split(ze),d=p.length-1;if(d>0){s.textContent=Li?Li.emptyScript:"";for(let g=0;g<d;g++)s.append(p[g],Zt()),Ke.nextNode(),l.push({type:2,index:++r});s.append(p[d],Zt())}}}else if(s.nodeType===8)if(s.data===na)l.push({type:2,index:r});else{let p=-1;for(;(p=s.data.indexOf(ze,p+1))!==-1;)l.push({type:7,index:r}),p+=ze.length-1}r++}}static createElement(e,t){const n=it.createElement("template");return n.innerHTML=e,n}};function St(i,e,t=i,n){var o,a;if(e===Me)return e;let s=n!==void 0?(o=t._$Co)==null?void 0:o[n]:t._$Cl;const r=Yt(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(i),s._$AT(i,t,n)),n!==void 0?(t._$Co??(t._$Co=[]))[n]=s:t._$Cl=s),s!==void 0&&(e=St(i,s._$AS(i,e.values),s,n)),e}class Fc{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,s=((e==null?void 0:e.creationScope)??it).importNode(t,!0);Ke.currentNode=s;let r=Ke.nextNode(),o=0,a=0,l=n[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new ri(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new qc(r,this,e)),this._$AV.push(c),l=n[++a]}o!==(l==null?void 0:l.index)&&(r=Ke.nextNode(),o++)}return Ke.currentNode=it,s}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 ri{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=$,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,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=St(this,e,t),Yt(e)?e===$||e==null||e===""?(this._$AH!==$&&this._$AR(),this._$AH=$):e!==this._$AH&&e!==Me&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Dc(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!==$&&Yt(this._$AH)?this._$AA.nextSibling.data=e:this.T(it.createTextNode(e)),this._$AH=e}$(e){var r;const{values:t,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Bn.createElement(ra(n.h,n.h[0]),this.options)),n);if(((r=this._$AH)==null?void 0:r._$AD)===s)this._$AH.p(t);else{const o=new Fc(s,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=Wr.get(e.strings);return t===void 0&&Wr.set(e.strings,t=new Bn(e)),t}k(e){fs(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,s=0;for(const r of e)s===t.length?t.push(n=new ri(this.O(Zt()),this.O(Zt()),this,this.options)):n=t[s],n._$AI(r),s++;s<t.length&&(this._$AR(n&&n._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,t);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 Qi{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,r){this.type=1,this._$AH=$,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=$}_$AI(e,t=this,n,s){const r=this.strings;let o=!1;if(r===void 0)e=St(this,e,t,0),o=!Yt(e)||e!==this._$AH&&e!==Me,o&&(this._$AH=e);else{const a=e;let l,c;for(e=r[0],l=0;l<r.length-1;l++)c=St(this,a[n+l],t,l),c===Me&&(c=this._$AH[l]),o||(o=!Yt(c)||c!==this._$AH[l]),c===$?e=$:e!==$&&(e+=(c??"")+r[l+1]),this._$AH[l]=c}o&&!s&&this.j(e)}j(e){e===$?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let Hc=class extends Qi{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===$?void 0:e}};class jc extends Qi{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==$)}}class Bc extends Qi{constructor(e,t,n,s,r){super(e,t,n,s,r),this.type=5}_$AI(e,t=this){if((e=St(this,e,t,0)??$)===Me)return;const n=this._$AH,s=e===$&&n!==$||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==$&&(n===$||s);s&&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 qc{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){St(this,e)}}const Cn=Bt.litHtmlPolyfillSupport;Cn==null||Cn(Bn,ri),(Bt.litHtmlVersions??(Bt.litHtmlVersions=[])).push("3.3.1");const Vc=(i,e,t)=>{const n=(t==null?void 0:t.renderBefore)??e;let s=n._$litPart$;if(s===void 0){const r=(t==null?void 0:t.renderBefore)??null;n._$litPart$=s=new ri(e.insertBefore(Zt(),r),r,void 0,t??{})}return s._$AI(i),s};/**
|
|
18
18
|
* @license
|
|
19
19
|
* Copyright 2017 Google LLC
|
|
20
20
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
-
*/const Ke=globalThis;let E=class extends dt{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=qc(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 Pe}};var Ro;E._$litElement$=!0,E.finalized=!0,(Ro=Ke.litElementHydrateSupport)==null||Ro.call(Ke,{LitElement:E});const Sn=Ke.litElementPolyfillSupport;Sn==null||Sn({LitElement:E});(Ke.litElementVersions??(Ke.litElementVersions=[])).push("4.2.1");const Vc={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>'},ra={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>'},Wc={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>'},oa={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>'},Gc={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>'},aa={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>'},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="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>'},hs={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>'},Yc={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>'},Fn={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>'},qr={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>'},Qc={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>'},la={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>'},Vr={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>'},Wr={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M27.2561 39.1924C27.3201 40.5364 28.0241 41.1764 29.3681 41.1764C32.1201 41.1764 34.8081 39.3844 34.8721 37.5924L35.8961 12.3764C35.8961 10.6484 35.0001 9.81641 33.1441 9.81641C29.6241 9.81641 25.9761 12.1844 25.9761 14.4244L27.2561 39.1924ZM30.9041 55.3847C28.4081 55.3847 26.0401 51.2247 26.0401 49.6247C26.0401 47.3847 29.6881 45.0167 33.2081 45.0167C35.0641 45.0167 36.0241 45.8487 36.0241 47.5767C36.0241 50.2007 34.8081 52.8887 33.2721 54.2967C32.5041 55.0007 31.7361 55.3847 30.9041 55.3847Z"/></svg>'},pt={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 ft,ca,Qi,ua=!1,Li=!1,ds=!1,se=!1,Gr=null,jn=!1;const Xi=typeof window<"u"?window:{},xe=Xi.document||{head:{}},ha=Xi.HTMLElement||class{},J={$flags$:0,$resourcesUrl$:"",jmp:i=>i(),raf:i=>requestAnimationFrame(i),ael:(i,e,t,n)=>i.addEventListener(e,t,n),rel:(i,e,t,n)=>i.removeEventListener(e,t,n),ce:(i,e)=>new CustomEvent(i,e)},Xc=(()=>{let i=!1;try{xe.addEventListener("e",null,Object.defineProperty({},"passive",{get(){i=!0}}))}catch{}return i})(),Kc=i=>Promise.resolve(i),Jc=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replace=="function"}catch{}return!1})(),da=(i,e,t,n)=>{t&&t.map(([s,r,o])=>{const a=tu(i,s),l=eu(e,o),c=iu(s);J.ael(a,r,l,c),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>J.rel(a,r,l,c))})},eu=(i,e)=>t=>{try{pt.lazyLoad||i.$hostElement$[e](t)}catch(n){ri(n)}},tu=(i,e)=>e&4?xe:e&8?Xi:e&16?xe.body:i,iu=i=>Xc?{passive:(i&1)!==0,capture:(i&2)!==0}:(i&2)!==0,Zr="http://www.w3.org/1999/xlink",tt=(i,e="")=>()=>{},Yr=new WeakMap,nu=(i,e,t)=>{let n=Mi.get(i);Jc&&t?(n=n||new CSSStyleSheet,n.replace(e)):n=e,Mi.set(i,n)},su=(i,e,t,n)=>{let s=pa(e,t),r=Mi.get(s);if(i=i.nodeType===11?i:xe,r)if(typeof r=="string"){i=i.head||i;let o=Yr.get(i),a;o||Yr.set(i,o=new Set),o.has(s)||(a=xe.createElement("style"),a.innerHTML=r,i.insertBefore(a,i.querySelector("link")),o&&o.add(s))}else i.adoptedStyleSheets.includes(r)||(i.adoptedStyleSheets=[...i.adoptedStyleSheets,r]);return s},ru=i=>{const e=i.$cmpMeta$,t=i.$hostElement$,n=e.$flags$,s=tt("attachStyles",e.$tagName$),r=su(t.shadowRoot?t.shadowRoot:t.getRootNode(),e,i.$modeName$);n&10&&(t["s-sc"]=r,t.classList.add(r+"-h"),n&2&&t.classList.add(r+"-s")),s()},pa=(i,e)=>"sc-"+(e&&i.$flags$&32?i.$tagName$+"-"+e:i.$tagName$),ou=i=>Pu.map(e=>e(i)).find(e=>!!e),Qr={},au="http://www.w3.org/2000/svg",lu="http://www.w3.org/1999/xhtml",cu=i=>i!=null,ps=i=>(i=typeof i,i==="object"||i==="function"),bt=(i,e,...t)=>{let n=null,s=null,r=null,o=!1,a=!1,l=[];const c=p=>{for(let d=0;d<p.length;d++)n=p[d],Array.isArray(n)?c(n):n!=null&&typeof n!="boolean"&&((o=typeof i!="function"&&!ps(n))&&(n=String(n)),o&&a?l[l.length-1].$text$+=n:l.push(o?Ii(null,n):n),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 i=="function")return i(e===null?{}:e,l,hu);const u=Ii(i,null);return u.$attrs$=e,l.length>0&&(u.$children$=l),u.$key$=s,u.$name$=r,u},Ii=(i,e)=>{const t={$flags$:0,$tag$:i,$text$:e,$elm$:null,$children$:null};return t.$attrs$=null,t.$key$=null,t.$name$=null,t},fs={},uu=i=>i&&i.$tag$===fs,hu={forEach:(i,e)=>i.map(Xr).forEach(e),map:(i,e)=>i.map(Xr).map(e).map(du)},Xr=i=>({vattrs:i.$attrs$,vchildren:i.$children$,vkey:i.$key$,vname:i.$name$,vtag:i.$tag$,vtext:i.$text$}),du=i=>{if(typeof i.vtag=="function"){const t=Object.assign({},i.vattrs);return i.vkey&&(t.key=i.vkey),i.vname&&(t.name=i.vname),bt(i.vtag,t,...i.vchildren||[])}const e=Ii(i.vtag,i.vtext);return e.$attrs$=i.vattrs,e.$children$=i.vchildren,e.$key$=i.vkey,e.$name$=i.vname,e},Kr=(i,e,t,n,s,r)=>{if(t!==n){let o=io(i,e),a=e.toLowerCase();if(e==="class"){const l=i.classList,c=Jr(t),u=Jr(n);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)(!n||n[l]==null)&&(l.includes("-")?i.style.removeProperty(l):i.style[l]="");for(const l in n)(!t||n[l]!==t[l])&&(l.includes("-")?i.style.setProperty(l,n[l]):i.style[l]=n[l])}else if(e!=="key")if(e==="ref")n&&n(i);else if(!i.__lookupSetter__(e)&&e[0]==="o"&&e[1]==="n")e[2]==="-"?e=e.slice(3):io(Xi,a)?e=a.slice(2):e=a[2]+e.slice(3),t&&J.rel(i,e,t,!1),n&&J.ael(i,e,n,!1);else{const l=ps(n);if((o||l&&n!==null)&&!s)try{if(i.tagName.includes("-"))i[e]=n;else{let u=n??"";e==="list"?o=!1:(t==null||i[e]!=u)&&(i[e]=u)}}catch{}let c=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(e=a,c=!0),n==null||n===!1?(n!==!1||i.getAttribute(e)==="")&&(c?i.removeAttributeNS(Zr,e):i.removeAttribute(e)):(!o||r&4||s)&&!l&&(n=n===!0?"":n,c?i.setAttributeNS(Zr,e,n):i.setAttribute(e,n))}}},pu=/\s/,Jr=i=>i?i.split(pu):[],fa=(i,e,t,n)=>{const s=e.$elm$.nodeType===11&&e.$elm$.host?e.$elm$.host:e.$elm$,r=i&&i.$attrs$||Qr,o=e.$attrs$||Qr;for(n in r)n in o||Kr(s,n,r[n],void 0,t,e.$flags$);for(n in o)Kr(s,n,r[n],o[n],t,e.$flags$)},Pi=(i,e,t,n)=>{let s=e.$children$[t],r=0,o,a,l;if(ua||(ds=!0,s.$tag$==="slot"&&(ft&&n.classList.add(ft+"-s"),s.$flags$|=s.$children$?2:1)),s.$text$!==null)o=s.$elm$=xe.createTextNode(s.$text$);else if(s.$flags$&1)o=s.$elm$=xe.createTextNode("");else{if(se||(se=s.$tag$==="svg"),o=s.$elm$=xe.createElementNS(se?au:lu,s.$flags$&2?"slot-fb":s.$tag$),se&&s.$tag$==="foreignObject"&&(se=!1),fa(null,s,se),cu(ft)&&o["s-si"]!==ft&&o.classList.add(o["s-si"]=ft),s.$children$)for(r=0;r<s.$children$.length;++r)a=Pi(i,s,r,o),a&&o.appendChild(a);s.$tag$==="svg"?se=!1:o.tagName==="foreignObject"&&(se=!0)}return o["s-hn"]=Qi,s.$flags$&3&&(o["s-sr"]=!0,o["s-cr"]=ca,o["s-sn"]=s.$name$||"",l=i&&i.$children$&&i.$children$[t],l&&l.$tag$===s.$tag$&&i.$elm$&&Yt(i.$elm$,!1)),o},Yt=(i,e)=>{J.$flags$|=1;const t=i.childNodes;for(let n=t.length-1;n>=0;n--){const s=t[n];s["s-hn"]!==Qi&&s["s-ol"]&&(va(s).insertBefore(s,gs(s)),s["s-ol"].remove(),s["s-ol"]=void 0,ds=!0),e&&Yt(s,e)}J.$flags$&=-2},ga=(i,e,t,n,s,r)=>{let o=i["s-cr"]&&i["s-cr"].parentNode||i,a;for(o.shadowRoot&&o.tagName===Qi&&(o=o.shadowRoot);s<=r;++s)n[s]&&(a=Pi(null,t,s,i),a&&(n[s].$elm$=a,o.insertBefore(a,gs(e))))},ma=(i,e,t,n,s)=>{for(;e<=t;++e)(n=i[e])&&(s=n.$elm$,$a(n),Li=!0,s["s-ol"]?s["s-ol"].remove():Yt(s,!0),s.remove())},fu=(i,e,t,n)=>{let s=0,r=0,o=0,a=0,l=e.length-1,c=e[0],u=e[l],p=n.length-1,d=n[0],g=n[p],v,m;for(;s<=l&&r<=p;)if(c==null)c=e[++s];else if(u==null)u=e[--l];else if(d==null)d=n[++r];else if(g==null)g=n[--p];else if(bi(c,d))gt(c,d),c=e[++s],d=n[++r];else if(bi(u,g))gt(u,g),u=e[--l],g=n[--p];else if(bi(c,g))(c.$tag$==="slot"||g.$tag$==="slot")&&Yt(c.$elm$.parentNode,!1),gt(c,g),i.insertBefore(c.$elm$,u.$elm$.nextSibling),c=e[++s],g=n[--p];else if(bi(u,d))(c.$tag$==="slot"||g.$tag$==="slot")&&Yt(u.$elm$.parentNode,!1),gt(u,d),i.insertBefore(u.$elm$,c.$elm$),u=e[--l],d=n[++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?(m=e[o],m.$tag$!==d.$tag$?v=Pi(e&&e[r],t,o,i):(gt(m,d),e[o]=void 0,v=m.$elm$),d=n[++r]):(v=Pi(e&&e[r],t,r,i),d=n[++r]),v&&va(c.$elm$).insertBefore(v,gs(c.$elm$))}s>l?ga(i,n[p+1]==null?null:n[p+1].$elm$,t,n,r,p):r>p&&ma(e,s,l)},bi=(i,e)=>i.$tag$===e.$tag$?i.$tag$==="slot"?i.$name$===e.$name$:i.$key$===e.$key$:!1,gs=i=>i&&i["s-ol"]||i,va=i=>(i["s-ol"]?i["s-ol"]:i).parentNode,gt=(i,e)=>{const t=e.$elm$=i.$elm$,n=i.$children$,s=e.$children$,r=e.$tag$,o=e.$text$;let a;o===null?(se=r==="svg"?!0:r==="foreignObject"?!1:se,r==="slot"||fa(i,e,se),n!==null&&s!==null?fu(t,n,e,s):s!==null?(i.$text$!==null&&(t.textContent=""),ga(t,null,e,s,0,s.length-1)):n!==null&&ma(n,0,n.length-1),se&&r==="svg"&&(se=!1)):(a=t["s-cr"])?a.parentNode.textContent=o:i.$text$!==o&&(t.data=o)},ba=i=>{let e=i.childNodes,t,n,s,r,o,a;for(n=0,s=e.length;n<s;n++)if(t=e[n],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}}ba(t)}},de=[],ya=i=>{let e,t,n,s,r,o,a=0,l=i.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,s=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"]&&(eo(t,s)?(r=de.find(u=>u.$nodeToRelocate$===t),Li=!0,t["s-sn"]=t["s-sn"]||s,r?r.$slotRefNode$=e:de.push({$slotRefNode$:e,$nodeToRelocate$:t}),t["s-sr"]&&de.map(u=>{eo(u.$nodeToRelocate$,t["s-sn"])&&(r=de.find(p=>p.$nodeToRelocate$===t),r&&!u.$slotRefNode$&&(u.$slotRefNode$=r.$slotRefNode$))})):de.some(u=>u.$nodeToRelocate$===t)||de.push({$nodeToRelocate$:t}));e.nodeType===1&&ya(e)}},eo=(i,e)=>i.nodeType===1?i.getAttribute("slot")===null&&e===""||i.getAttribute("slot")===e:i["s-sn"]===e?!0:e==="",$a=i=>{i.$attrs$&&i.$attrs$.ref&&i.$attrs$.ref(null),i.$children$&&i.$children$.map($a)},gu=(i,e)=>{const t=i.$hostElement$,n=i.$cmpMeta$,s=i.$vnode$||Ii(null,null),r=uu(e)?e:bt(null,null,e);Qi=t.tagName,n.$attrsToReflect$&&(r.$attrs$=r.$attrs$||{},n.$attrsToReflect$.map(([o,a])=>r.$attrs$[a]=t[o])),r.$tag$=null,r.$flags$|=4,i.$vnode$=r,r.$elm$=s.$elm$=t.shadowRoot||t,ft=t["s-sc"],ca=t["s-cr"],ua=(n.$flags$&1)!==0,Li=!1,gt(s,r);{if(J.$flags$|=1,ds){ya(r.$elm$);let o,a,l,c,u,p,d=0;for(;d<de.length;d++)o=de[d],a=o.$nodeToRelocate$,a["s-ol"]||(l=xe.createTextNode(""),l["s-nr"]=a,a.parentNode.insertBefore(a["s-ol"]=l,a));for(d=0;d<de.length;d++)if(o=de[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)}Li&&ba(r.$elm$),J.$flags$&=-2,de.length=0}},mu=i=>i,vu=(i,e,t)=>{const n=mu(i);return{emit:s=>bu(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:s})}},bu=(i,e,t)=>{const n=J.ce(e,t);return i.dispatchEvent(n),n},yu=(i,e)=>{},wa=(i,e)=>(i.$flags$|=16,yu(i,i.$ancestorComponent$),Uu(()=>$u(i,e))),$u=(i,e)=>{const t=i.$hostElement$,n=tt("scheduleUpdate",i.$cmpMeta$.$tagName$),s=t;let r;return e?r=yt(s,"componentWillLoad"):r=yt(s,"componentWillUpdate"),r=to(r,()=>yt(s,"componentWillRender")),n(),to(r,()=>wu(i,s,e))},wu=async(i,e,t)=>{const n=i.$hostElement$,s=tt("update",i.$cmpMeta$.$tagName$);n["s-rc"],t&&ru(i);const r=tt("render",i.$cmpMeta$.$tagName$);xu(i,e,n),r(),s(),ku(i)},xu=(i,e,t)=>{try{Gr=e,e=e.render&&e.render(),i.$flags$&=-17,i.$flags$|=2,(pt.hasRenderFn||pt.reflect)&&(pt.vdomRender||pt.reflect)&&(pt.hydrateServerSide||gu(i,e))}catch(a){ri(a,i.$hostElement$)}return Gr=null,null},ku=i=>{const e=i.$cmpMeta$.$tagName$,t=i.$hostElement$,n=tt("postUpdate",e),s=t;i.$ancestorComponent$,yt(s,"componentDidRender"),i.$flags$&64?(yt(s,"componentDidUpdate"),n()):(i.$flags$|=64,yt(s,"componentDidLoad"),n())},yt=(i,e,t)=>{if(i&&i[e])try{return i[e](t)}catch(n){ri(n)}},to=(i,e)=>i&&i.then?i.then(e):e(),Su=(i,e)=>i!=null&&!ps(i)?e&4?i==="false"?!1:i===""||!!i:e&2?parseFloat(i):e&1?String(i):i:i,Cu=(i,e)=>Ki(i).$instanceValues$.get(e),_u=(i,e,t,n)=>{const s=Ki(i),r=i,o=s.$instanceValues$.get(e),a=s.$flags$,l=r;t=Su(t,n.$members$[e][0]);const c=Number.isNaN(o)&&Number.isNaN(t);if(t!==o&&!c){s.$instanceValues$.set(e,t);{if(n.$watchers$&&a&128){const p=n.$watchers$[e];p&&p.map(d=>{try{l[d](t,o,e)}catch(g){ri(g,r)}})}if((a&18)===2){if(l.componentShouldUpdate&&l.componentShouldUpdate(t,o,e)===!1)return;wa(s,!1)}}}},Eu=(i,e,t)=>{if(e.$members$){i.watchers&&(e.$watchers$=i.watchers);const n=Object.entries(e.$members$),s=i.prototype;n.map(([r,[o]])=>{(o&31||o&32)&&Object.defineProperty(s,r,{get(){return Cu(this,r)},set(a){_u(this,r,a,e)},configurable:!0,enumerable:!0})});{const r=new Map;s.attributeChangedCallback=function(o,a,l){J.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})},i.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 i},Au=async(i,e,t,n,s)=>{if((e.$flags$&32)===0&&(s=i.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$=ou(i)]);const a=pa(t,e.$modeName$);if(!Mi.has(a)){const l=tt("registerStyles",t.$tagName$);nu(a,o,!!(t.$flags$&1)),l()}}e.$ancestorComponent$,wa(e,!0)},Tu=i=>{},Ou=i=>{if((J.$flags$&1)===0){const e=Ki(i),t=e.$cmpMeta$,n=tt("connectedCallback",t.$tagName$);e.$flags$&1?(da(i,e,t.$listeners$),Tu(e.$lazyInstance$)):(e.$flags$|=1,t.$flags$&12&&Ru(i),t.$members$&&Object.entries(t.$members$).map(([s,[r]])=>{if(r&31&&i.hasOwnProperty(s)){const o=i[s];delete i[s],i[s]=o}}),Au(i,e,t)),n()}},Ru=i=>{const e=i["s-cr"]=xe.createComment("");e["s-cn"]=!0,i.insertBefore(e,i.firstChild)},Lu=i=>{if((J.$flags$&1)===0){const e=Ki(i);e.$rmListeners$&&(e.$rmListeners$.map(t=>t()),e.$rmListeners$=void 0)}},xa=(i,e)=>{const t={$flags$:e[0],$tagName$:e[1]};t.$members$=e[2],t.$listeners$=e[3],t.$watchers$=i.$watchers$,t.$attrsToReflect$=[];const n=i.prototype.connectedCallback,s=i.prototype.disconnectedCallback;return Object.assign(i.prototype,{__registerHost(){Iu(this,t)},connectedCallback(){Ou(this),n&&n.call(this)},disconnectedCallback(){Lu(this),s&&s.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(t.$flags$&16)})}}),i.is=t.$tagName$,Eu(i,t)},ka=new WeakMap,Ki=i=>ka.get(i),Iu=(i,e)=>{const t={$flags$:0,$hostElement$:i,$cmpMeta$:e,$instanceValues$:new Map};return da(i,t,e.$listeners$),ka.set(i,t)},io=(i,e)=>e in i,ri=(i,e)=>(0,console.error)(i,e),Mi=new Map,Pu=[],no=[],Sa=[],Mu=(i,e)=>t=>{i.push(t),jn||(jn=!0,e&&J.$flags$&4?Nu(Bn):J.raf(Bn))},so=i=>{for(let e=0;e<i.length;e++)try{i[e](performance.now())}catch(t){ri(t)}i.length=0},Bn=()=>{so(no),so(Sa),(jn=no.length>0)&&J.raf(Bn)},Nu=i=>Kc().then(i),Uu=Mu(Sa,!0),Du=(i={})=>{const{content:e="",title:t,attributes:n=[]}=i;let s="",r=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},...n];return t&&(s=`<title>${t}</title>`),`<svg ${r.map(a=>`${a.name}="${a.value}"`).join(" ")}>${s}${e}</svg>`},zu=i=>i.replace(/<(\/?)svg([^>]*)>/g,"").trim();function Hu(i){return`${i.getFullYear()}.${i.getMonth()+1}`}class Fu{constructor(e){this.voca_component=e,this.voca_added=Hu(new Date)}}const ju="telia-vst{display:none}",Bu=xa(class extends ha{constructor(){super(),this.__registerHost(),this.vocaInternalUStats=vu(this,"vocaInternalUStats")}connectedCallback(){this.vocaInternalUStats.emit(new Fu(this.dataTrackingId))}render(){return bt(fs,null)}static get style(){return ju}},[0,"telia-vst",{dataTrackingId:[1,"data-tracking-id"]}]);function Ca(){if(typeof customElements>"u")return;["telia-vst"].forEach(e=>{switch(e){case"telia-vst":customElements.get(e)||customElements.define(e,Bu);break}})}Ca();function qn(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{vocadsIcons:void 0,vocadsIconsRegistered:!1}}function qu(){if(typeof qn().vocadsIcons!==void 0)return qn().vocadsIcons}function Vu(){return qn().vocadsIconsRegistered}const Wu=".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))}",Gu=xa(class extends ha{constructor(){super(),this.__registerHost(),this.size="md",this.allyTitle=null,this.dataTrackingId="telia-icon"}getSvgString(){if(this.svg)return this.svg;if(Vu()&&this.name){const i=qu();return i[this.name]?i[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 i=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=Du({content:zu(i),attributes:e,title:this.allyTitle});return bt(fs,{class:`telia-icon telia-icon--${this.size}`},bt("span",{"aria-label":this.allyTitle,class:"telia-icon__container",innerHTML:t}),bt("telia-vst",{dataTrackingId:this.dataTrackingId}))}static get style(){return Wu}},[0,"telia-icon",{name:[1],svg:[1],size:[1],allyTitle:[1,"ally-title"],dataTestid:[1,"data-testid"]}]);function Zu(){if(typeof customElements>"u")return;["telia-icon","telia-vst"].forEach(e=>{switch(e){case"telia-icon":customElements.get(e)||customElements.define(e,Gu);break;case"telia-vst":customElements.get(e)||Ca();break}})}Zu();/**
|
|
21
|
+
*/const et=globalThis;let E=class extends ft{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=Vc(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 Me}};var Io;E._$litElement$=!0,E.finalized=!0,(Io=et.litElementHydrateSupport)==null||Io.call(et,{LitElement:E});const _n=et.litElementPolyfillSupport;_n==null||_n({LitElement:E});(et.litElementVersions??(et.litElementVersions=[])).push("4.2.1");const Wc={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>'},aa={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>'},Gc={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>'},la={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>'},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="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>'},ca={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>'},Yc={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>'},gs={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>'},Qc={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>'},qn={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>'},Gr={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>'},Xc={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>'},ua={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>'},Yr={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M27.2561 39.1924C27.3201 40.5364 28.0241 41.1764 29.3681 41.1764C32.1201 41.1764 34.8081 39.3844 34.8721 37.5924L35.8961 12.3764C35.8961 10.6484 35.0001 9.81641 33.1441 9.81641C29.6241 9.81641 25.9761 12.1844 25.9761 14.4244L27.2561 39.1924ZM30.9041 55.3847C28.4081 55.3847 26.0401 51.2247 26.0401 49.6247C26.0401 47.3847 29.6881 45.0167 33.2081 45.0167C35.0641 45.0167 36.0241 45.8487 36.0241 47.5767C36.0241 50.2007 34.8081 52.8887 33.2721 54.2967C32.5041 55.0007 31.7361 55.3847 30.9041 55.3847Z"/></svg>'},gt={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 mt,ha,Xi,da=!1,Ii=!1,ms=!1,se=!1,Qr=null,Vn=!1;const Ki=typeof window<"u"?window:{},Se=Ki.document||{head:{}},pa=Ki.HTMLElement||class{},J={$flags$:0,$resourcesUrl$:"",jmp:i=>i(),raf:i=>requestAnimationFrame(i),ael:(i,e,t,n)=>i.addEventListener(e,t,n),rel:(i,e,t,n)=>i.removeEventListener(e,t,n),ce:(i,e)=>new CustomEvent(i,e)},Kc=(()=>{let i=!1;try{Se.addEventListener("e",null,Object.defineProperty({},"passive",{get(){i=!0}}))}catch{}return i})(),Jc=i=>Promise.resolve(i),eu=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replace=="function"}catch{}return!1})(),fa=(i,e,t,n)=>{t&&t.map(([s,r,o])=>{const a=iu(i,s),l=tu(e,o),c=nu(s);J.ael(a,r,l,c),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>J.rel(a,r,l,c))})},tu=(i,e)=>t=>{try{gt.lazyLoad||i.$hostElement$[e](t)}catch(n){oi(n)}},iu=(i,e)=>e&4?Se:e&8?Ki:e&16?Se.body:i,nu=i=>Kc?{passive:(i&1)!==0,capture:(i&2)!==0}:(i&2)!==0,Xr="http://www.w3.org/1999/xlink",nt=(i,e="")=>()=>{},Kr=new WeakMap,su=(i,e,t)=>{let n=Ni.get(i);eu&&t?(n=n||new CSSStyleSheet,n.replace(e)):n=e,Ni.set(i,n)},ru=(i,e,t,n)=>{let s=ga(e,t),r=Ni.get(s);if(i=i.nodeType===11?i:Se,r)if(typeof r=="string"){i=i.head||i;let o=Kr.get(i),a;o||Kr.set(i,o=new Set),o.has(s)||(a=Se.createElement("style"),a.innerHTML=r,i.insertBefore(a,i.querySelector("link")),o&&o.add(s))}else i.adoptedStyleSheets.includes(r)||(i.adoptedStyleSheets=[...i.adoptedStyleSheets,r]);return s},ou=i=>{const e=i.$cmpMeta$,t=i.$hostElement$,n=e.$flags$,s=nt("attachStyles",e.$tagName$),r=ru(t.shadowRoot?t.shadowRoot:t.getRootNode(),e,i.$modeName$);n&10&&(t["s-sc"]=r,t.classList.add(r+"-h"),n&2&&t.classList.add(r+"-s")),s()},ga=(i,e)=>"sc-"+(e&&i.$flags$&32?i.$tagName$+"-"+e:i.$tagName$),au=i=>Mu.map(e=>e(i)).find(e=>!!e),Jr={},lu="http://www.w3.org/2000/svg",cu="http://www.w3.org/1999/xhtml",uu=i=>i!=null,vs=i=>(i=typeof i,i==="object"||i==="function"),wt=(i,e,...t)=>{let n=null,s=null,r=null,o=!1,a=!1,l=[];const c=p=>{for(let d=0;d<p.length;d++)n=p[d],Array.isArray(n)?c(n):n!=null&&typeof n!="boolean"&&((o=typeof i!="function"&&!vs(n))&&(n=String(n)),o&&a?l[l.length-1].$text$+=n:l.push(o?Pi(null,n):n),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 i=="function")return i(e===null?{}:e,l,du);const u=Pi(i,null);return u.$attrs$=e,l.length>0&&(u.$children$=l),u.$key$=s,u.$name$=r,u},Pi=(i,e)=>{const t={$flags$:0,$tag$:i,$text$:e,$elm$:null,$children$:null};return t.$attrs$=null,t.$key$=null,t.$name$=null,t},bs={},hu=i=>i&&i.$tag$===bs,du={forEach:(i,e)=>i.map(eo).forEach(e),map:(i,e)=>i.map(eo).map(e).map(pu)},eo=i=>({vattrs:i.$attrs$,vchildren:i.$children$,vkey:i.$key$,vname:i.$name$,vtag:i.$tag$,vtext:i.$text$}),pu=i=>{if(typeof i.vtag=="function"){const t=Object.assign({},i.vattrs);return i.vkey&&(t.key=i.vkey),i.vname&&(t.name=i.vname),wt(i.vtag,t,...i.vchildren||[])}const e=Pi(i.vtag,i.vtext);return e.$attrs$=i.vattrs,e.$children$=i.vchildren,e.$key$=i.vkey,e.$name$=i.vname,e},to=(i,e,t,n,s,r)=>{if(t!==n){let o=ro(i,e),a=e.toLowerCase();if(e==="class"){const l=i.classList,c=io(t),u=io(n);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)(!n||n[l]==null)&&(l.includes("-")?i.style.removeProperty(l):i.style[l]="");for(const l in n)(!t||n[l]!==t[l])&&(l.includes("-")?i.style.setProperty(l,n[l]):i.style[l]=n[l])}else if(e!=="key")if(e==="ref")n&&n(i);else if(!i.__lookupSetter__(e)&&e[0]==="o"&&e[1]==="n")e[2]==="-"?e=e.slice(3):ro(Ki,a)?e=a.slice(2):e=a[2]+e.slice(3),t&&J.rel(i,e,t,!1),n&&J.ael(i,e,n,!1);else{const l=vs(n);if((o||l&&n!==null)&&!s)try{if(i.tagName.includes("-"))i[e]=n;else{let u=n??"";e==="list"?o=!1:(t==null||i[e]!=u)&&(i[e]=u)}}catch{}let c=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(e=a,c=!0),n==null||n===!1?(n!==!1||i.getAttribute(e)==="")&&(c?i.removeAttributeNS(Xr,e):i.removeAttribute(e)):(!o||r&4||s)&&!l&&(n=n===!0?"":n,c?i.setAttributeNS(Xr,e,n):i.setAttribute(e,n))}}},fu=/\s/,io=i=>i?i.split(fu):[],ma=(i,e,t,n)=>{const s=e.$elm$.nodeType===11&&e.$elm$.host?e.$elm$.host:e.$elm$,r=i&&i.$attrs$||Jr,o=e.$attrs$||Jr;for(n in r)n in o||to(s,n,r[n],void 0,t,e.$flags$);for(n in o)to(s,n,r[n],o[n],t,e.$flags$)},Mi=(i,e,t,n)=>{let s=e.$children$[t],r=0,o,a,l;if(da||(ms=!0,s.$tag$==="slot"&&(mt&&n.classList.add(mt+"-s"),s.$flags$|=s.$children$?2:1)),s.$text$!==null)o=s.$elm$=Se.createTextNode(s.$text$);else if(s.$flags$&1)o=s.$elm$=Se.createTextNode("");else{if(se||(se=s.$tag$==="svg"),o=s.$elm$=Se.createElementNS(se?lu:cu,s.$flags$&2?"slot-fb":s.$tag$),se&&s.$tag$==="foreignObject"&&(se=!1),ma(null,s,se),uu(mt)&&o["s-si"]!==mt&&o.classList.add(o["s-si"]=mt),s.$children$)for(r=0;r<s.$children$.length;++r)a=Mi(i,s,r,o),a&&o.appendChild(a);s.$tag$==="svg"?se=!1:o.tagName==="foreignObject"&&(se=!0)}return o["s-hn"]=Xi,s.$flags$&3&&(o["s-sr"]=!0,o["s-cr"]=ha,o["s-sn"]=s.$name$||"",l=i&&i.$children$&&i.$children$[t],l&&l.$tag$===s.$tag$&&i.$elm$&&Qt(i.$elm$,!1)),o},Qt=(i,e)=>{J.$flags$|=1;const t=i.childNodes;for(let n=t.length-1;n>=0;n--){const s=t[n];s["s-hn"]!==Xi&&s["s-ol"]&&(ya(s).insertBefore(s,ys(s)),s["s-ol"].remove(),s["s-ol"]=void 0,ms=!0),e&&Qt(s,e)}J.$flags$&=-2},va=(i,e,t,n,s,r)=>{let o=i["s-cr"]&&i["s-cr"].parentNode||i,a;for(o.shadowRoot&&o.tagName===Xi&&(o=o.shadowRoot);s<=r;++s)n[s]&&(a=Mi(null,t,s,i),a&&(n[s].$elm$=a,o.insertBefore(a,ys(e))))},ba=(i,e,t,n,s)=>{for(;e<=t;++e)(n=i[e])&&(s=n.$elm$,xa(n),Ii=!0,s["s-ol"]?s["s-ol"].remove():Qt(s,!0),s.remove())},gu=(i,e,t,n)=>{let s=0,r=0,o=0,a=0,l=e.length-1,c=e[0],u=e[l],p=n.length-1,d=n[0],g=n[p],v,m;for(;s<=l&&r<=p;)if(c==null)c=e[++s];else if(u==null)u=e[--l];else if(d==null)d=n[++r];else if(g==null)g=n[--p];else if(yi(c,d))vt(c,d),c=e[++s],d=n[++r];else if(yi(u,g))vt(u,g),u=e[--l],g=n[--p];else if(yi(c,g))(c.$tag$==="slot"||g.$tag$==="slot")&&Qt(c.$elm$.parentNode,!1),vt(c,g),i.insertBefore(c.$elm$,u.$elm$.nextSibling),c=e[++s],g=n[--p];else if(yi(u,d))(c.$tag$==="slot"||g.$tag$==="slot")&&Qt(u.$elm$.parentNode,!1),vt(u,d),i.insertBefore(u.$elm$,c.$elm$),u=e[--l],d=n[++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?(m=e[o],m.$tag$!==d.$tag$?v=Mi(e&&e[r],t,o,i):(vt(m,d),e[o]=void 0,v=m.$elm$),d=n[++r]):(v=Mi(e&&e[r],t,r,i),d=n[++r]),v&&ya(c.$elm$).insertBefore(v,ys(c.$elm$))}s>l?va(i,n[p+1]==null?null:n[p+1].$elm$,t,n,r,p):r>p&&ba(e,s,l)},yi=(i,e)=>i.$tag$===e.$tag$?i.$tag$==="slot"?i.$name$===e.$name$:i.$key$===e.$key$:!1,ys=i=>i&&i["s-ol"]||i,ya=i=>(i["s-ol"]?i["s-ol"]:i).parentNode,vt=(i,e)=>{const t=e.$elm$=i.$elm$,n=i.$children$,s=e.$children$,r=e.$tag$,o=e.$text$;let a;o===null?(se=r==="svg"?!0:r==="foreignObject"?!1:se,r==="slot"||ma(i,e,se),n!==null&&s!==null?gu(t,n,e,s):s!==null?(i.$text$!==null&&(t.textContent=""),va(t,null,e,s,0,s.length-1)):n!==null&&ba(n,0,n.length-1),se&&r==="svg"&&(se=!1)):(a=t["s-cr"])?a.parentNode.textContent=o:i.$text$!==o&&(t.data=o)},wa=i=>{let e=i.childNodes,t,n,s,r,o,a;for(n=0,s=e.length;n<s;n++)if(t=e[n],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}}wa(t)}},de=[],$a=i=>{let e,t,n,s,r,o,a=0,l=i.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,s=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"]&&(no(t,s)?(r=de.find(u=>u.$nodeToRelocate$===t),Ii=!0,t["s-sn"]=t["s-sn"]||s,r?r.$slotRefNode$=e:de.push({$slotRefNode$:e,$nodeToRelocate$:t}),t["s-sr"]&&de.map(u=>{no(u.$nodeToRelocate$,t["s-sn"])&&(r=de.find(p=>p.$nodeToRelocate$===t),r&&!u.$slotRefNode$&&(u.$slotRefNode$=r.$slotRefNode$))})):de.some(u=>u.$nodeToRelocate$===t)||de.push({$nodeToRelocate$:t}));e.nodeType===1&&$a(e)}},no=(i,e)=>i.nodeType===1?i.getAttribute("slot")===null&&e===""||i.getAttribute("slot")===e:i["s-sn"]===e?!0:e==="",xa=i=>{i.$attrs$&&i.$attrs$.ref&&i.$attrs$.ref(null),i.$children$&&i.$children$.map(xa)},mu=(i,e)=>{const t=i.$hostElement$,n=i.$cmpMeta$,s=i.$vnode$||Pi(null,null),r=hu(e)?e:wt(null,null,e);Xi=t.tagName,n.$attrsToReflect$&&(r.$attrs$=r.$attrs$||{},n.$attrsToReflect$.map(([o,a])=>r.$attrs$[a]=t[o])),r.$tag$=null,r.$flags$|=4,i.$vnode$=r,r.$elm$=s.$elm$=t.shadowRoot||t,mt=t["s-sc"],ha=t["s-cr"],da=(n.$flags$&1)!==0,Ii=!1,vt(s,r);{if(J.$flags$|=1,ms){$a(r.$elm$);let o,a,l,c,u,p,d=0;for(;d<de.length;d++)o=de[d],a=o.$nodeToRelocate$,a["s-ol"]||(l=Se.createTextNode(""),l["s-nr"]=a,a.parentNode.insertBefore(a["s-ol"]=l,a));for(d=0;d<de.length;d++)if(o=de[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)}Ii&&wa(r.$elm$),J.$flags$&=-2,de.length=0}},vu=i=>i,bu=(i,e,t)=>{const n=vu(i);return{emit:s=>yu(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:s})}},yu=(i,e,t)=>{const n=J.ce(e,t);return i.dispatchEvent(n),n},wu=(i,e)=>{},ka=(i,e)=>(i.$flags$|=16,wu(i,i.$ancestorComponent$),Uu(()=>$u(i,e))),$u=(i,e)=>{const t=i.$hostElement$,n=nt("scheduleUpdate",i.$cmpMeta$.$tagName$),s=t;let r;return e?r=$t(s,"componentWillLoad"):r=$t(s,"componentWillUpdate"),r=so(r,()=>$t(s,"componentWillRender")),n(),so(r,()=>xu(i,s,e))},xu=async(i,e,t)=>{const n=i.$hostElement$,s=nt("update",i.$cmpMeta$.$tagName$);n["s-rc"],t&&ou(i);const r=nt("render",i.$cmpMeta$.$tagName$);ku(i,e,n),r(),s(),Su(i)},ku=(i,e,t)=>{try{Qr=e,e=e.render&&e.render(),i.$flags$&=-17,i.$flags$|=2,(gt.hasRenderFn||gt.reflect)&&(gt.vdomRender||gt.reflect)&&(gt.hydrateServerSide||mu(i,e))}catch(a){oi(a,i.$hostElement$)}return Qr=null,null},Su=i=>{const e=i.$cmpMeta$.$tagName$,t=i.$hostElement$,n=nt("postUpdate",e),s=t;i.$ancestorComponent$,$t(s,"componentDidRender"),i.$flags$&64?($t(s,"componentDidUpdate"),n()):(i.$flags$|=64,$t(s,"componentDidLoad"),n())},$t=(i,e,t)=>{if(i&&i[e])try{return i[e](t)}catch(n){oi(n)}},so=(i,e)=>i&&i.then?i.then(e):e(),Cu=(i,e)=>i!=null&&!vs(i)?e&4?i==="false"?!1:i===""||!!i:e&2?parseFloat(i):e&1?String(i):i:i,_u=(i,e)=>Ji(i).$instanceValues$.get(e),Eu=(i,e,t,n)=>{const s=Ji(i),r=i,o=s.$instanceValues$.get(e),a=s.$flags$,l=r;t=Cu(t,n.$members$[e][0]);const c=Number.isNaN(o)&&Number.isNaN(t);if(t!==o&&!c){s.$instanceValues$.set(e,t);{if(n.$watchers$&&a&128){const p=n.$watchers$[e];p&&p.map(d=>{try{l[d](t,o,e)}catch(g){oi(g,r)}})}if((a&18)===2){if(l.componentShouldUpdate&&l.componentShouldUpdate(t,o,e)===!1)return;ka(s,!1)}}}},Au=(i,e,t)=>{if(e.$members$){i.watchers&&(e.$watchers$=i.watchers);const n=Object.entries(e.$members$),s=i.prototype;n.map(([r,[o]])=>{(o&31||o&32)&&Object.defineProperty(s,r,{get(){return _u(this,r)},set(a){Eu(this,r,a,e)},configurable:!0,enumerable:!0})});{const r=new Map;s.attributeChangedCallback=function(o,a,l){J.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})},i.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 i},Tu=async(i,e,t,n,s)=>{if((e.$flags$&32)===0&&(s=i.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$=au(i)]);const a=ga(t,e.$modeName$);if(!Ni.has(a)){const l=nt("registerStyles",t.$tagName$);su(a,o,!!(t.$flags$&1)),l()}}e.$ancestorComponent$,ka(e,!0)},Ou=i=>{},Ru=i=>{if((J.$flags$&1)===0){const e=Ji(i),t=e.$cmpMeta$,n=nt("connectedCallback",t.$tagName$);e.$flags$&1?(fa(i,e,t.$listeners$),Ou(e.$lazyInstance$)):(e.$flags$|=1,t.$flags$&12&&Lu(i),t.$members$&&Object.entries(t.$members$).map(([s,[r]])=>{if(r&31&&i.hasOwnProperty(s)){const o=i[s];delete i[s],i[s]=o}}),Tu(i,e,t)),n()}},Lu=i=>{const e=i["s-cr"]=Se.createComment("");e["s-cn"]=!0,i.insertBefore(e,i.firstChild)},Iu=i=>{if((J.$flags$&1)===0){const e=Ji(i);e.$rmListeners$&&(e.$rmListeners$.map(t=>t()),e.$rmListeners$=void 0)}},Sa=(i,e)=>{const t={$flags$:e[0],$tagName$:e[1]};t.$members$=e[2],t.$listeners$=e[3],t.$watchers$=i.$watchers$,t.$attrsToReflect$=[];const n=i.prototype.connectedCallback,s=i.prototype.disconnectedCallback;return Object.assign(i.prototype,{__registerHost(){Pu(this,t)},connectedCallback(){Ru(this),n&&n.call(this)},disconnectedCallback(){Iu(this),s&&s.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(t.$flags$&16)})}}),i.is=t.$tagName$,Au(i,t)},Ca=new WeakMap,Ji=i=>Ca.get(i),Pu=(i,e)=>{const t={$flags$:0,$hostElement$:i,$cmpMeta$:e,$instanceValues$:new Map};return fa(i,t,e.$listeners$),Ca.set(i,t)},ro=(i,e)=>e in i,oi=(i,e)=>(0,console.error)(i,e),Ni=new Map,Mu=[],oo=[],_a=[],Nu=(i,e)=>t=>{i.push(t),Vn||(Vn=!0,e&&J.$flags$&4?Du(Wn):J.raf(Wn))},ao=i=>{for(let e=0;e<i.length;e++)try{i[e](performance.now())}catch(t){oi(t)}i.length=0},Wn=()=>{ao(oo),ao(_a),(Vn=oo.length>0)&&J.raf(Wn)},Du=i=>Jc().then(i),Uu=Nu(_a,!0),zu=(i={})=>{const{content:e="",title:t,attributes:n=[]}=i;let s="",r=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},...n];return t&&(s=`<title>${t}</title>`),`<svg ${r.map(a=>`${a.name}="${a.value}"`).join(" ")}>${s}${e}</svg>`},Fu=i=>i.replace(/<(\/?)svg([^>]*)>/g,"").trim();function Hu(i){return`${i.getFullYear()}.${i.getMonth()+1}`}class ju{constructor(e){this.voca_component=e,this.voca_added=Hu(new Date)}}const Bu="telia-vst{display:none}",qu=Sa(class extends pa{constructor(){super(),this.__registerHost(),this.vocaInternalUStats=bu(this,"vocaInternalUStats")}connectedCallback(){this.vocaInternalUStats.emit(new ju(this.dataTrackingId))}render(){return wt(bs,null)}static get style(){return Bu}},[0,"telia-vst",{dataTrackingId:[1,"data-tracking-id"]}]);function Ea(){if(typeof customElements>"u")return;["telia-vst"].forEach(e=>{switch(e){case"telia-vst":customElements.get(e)||customElements.define(e,qu);break}})}Ea();function Gn(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{vocadsIcons:void 0,vocadsIconsRegistered:!1}}function Vu(){if(typeof Gn().vocadsIcons!==void 0)return Gn().vocadsIcons}function Wu(){return Gn().vocadsIconsRegistered}const Gu=".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))}",Zu=Sa(class extends pa{constructor(){super(),this.__registerHost(),this.size="md",this.allyTitle=null,this.dataTrackingId="telia-icon"}getSvgString(){if(this.svg)return this.svg;if(Wu()&&this.name){const i=Vu();return i[this.name]?i[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 i=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=zu({content:Fu(i),attributes:e,title:this.allyTitle});return wt(bs,{class:`telia-icon telia-icon--${this.size}`},wt("span",{"aria-label":this.allyTitle,class:"telia-icon__container",innerHTML:t}),wt("telia-vst",{dataTrackingId:this.dataTrackingId}))}static get style(){return Gu}},[0,"telia-icon",{name:[1],svg:[1],size:[1],allyTitle:[1,"ally-title"],dataTestid:[1,"data-testid"]}]);function Yu(){if(typeof customElements>"u")return;["telia-icon","telia-vst"].forEach(e=>{switch(e){case"telia-icon":customElements.get(e)||customElements.define(e,Zu);break;case"telia-vst":customElements.get(e)||Ea();break}})}Yu();/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright 2017 Google LLC
|
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
-
*/const
|
|
25
|
+
*/const Qu={attribute:!0,type:String,converter:Ri,reflect:!1,hasChanged:ps},Xu=(i=Qu,e,t)=>{const{kind:n,metadata:s}=t;let r=globalThis.litPropertyMetadata.get(s);if(r===void 0&&globalThis.litPropertyMetadata.set(s,r=new Map),n==="setter"&&((i=Object.create(i)).wrapped=!0),r.set(t.name,i),n==="accessor"){const{name:o}=t;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,i)},init(a){return a!==void 0&&this.C(o,void 0,i,a),a}}}if(n==="setter"){const{name:o}=t;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,i)}}throw Error("Unsupported decorator location: "+n)};function k(i){return(e,t)=>typeof t=="object"?Xu(i,e,t):((n,s,r)=>{const o=s.hasOwnProperty(r);return s.constructor.createProperty(r,n),o?Object.getOwnPropertyDescriptor(s,r):void 0})(i,e,t)}/**
|
|
26
26
|
* @license
|
|
27
27
|
* Copyright 2017 Google LLC
|
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -30,23 +30,23 @@
|
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright 2020 Google LLC
|
|
32
32
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
-
*/const
|
|
33
|
+
*/const Ku=i=>i.strings===void 0;/**
|
|
34
34
|
* @license
|
|
35
35
|
* Copyright 2017 Google LLC
|
|
36
36
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
|
-
*/const
|
|
37
|
+
*/const ai={ATTRIBUTE:1,CHILD:2},li=i=>(...e)=>({_$litDirective$:i,values:e});let en=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)}};/**
|
|
38
38
|
* @license
|
|
39
39
|
* Copyright 2017 Google LLC
|
|
40
40
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
41
|
-
*/const
|
|
41
|
+
*/const qt=(i,e)=>{var n;const t=i._$AN;if(t===void 0)return!1;for(const s of t)(n=s._$AO)==null||n.call(s,e,!1),qt(s,e);return!0},Di=i=>{let e,t;do{if((e=i._$AM)===void 0)break;t=e._$AN,t.delete(i),i=e}while((t==null?void 0:t.size)===0)},Aa=i=>{for(let e;e=i._$AM;i=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(i))break;t.add(i),th(e)}};function Ju(i){this._$AN!==void 0?(Di(this),this._$AM=i,Aa(this)):this._$AM=i}function eh(i,e=!1,t=0){const n=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(e)if(Array.isArray(n))for(let r=t;r<n.length;r++)qt(n[r],!1),Di(n[r]);else n!=null&&(qt(n,!1),Di(n));else qt(this,i)}const th=i=>{i.type==ai.CHILD&&(i._$AP??(i._$AP=eh),i._$AQ??(i._$AQ=Ju))};let Ta=class extends en{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Aa(this),this.isConnected=e._$AU}_$AO(e,t=!0){var n,s;e!==this.isConnected&&(this.isConnected=e,e?(n=this.reconnected)==null||n.call(this):(s=this.disconnected)==null||s.call(this)),t&&(qt(this,e),Di(this))}setValue(e){if(Ku(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
|
|
45
|
+
*/const $e=()=>new ih;class ih{}const En=new WeakMap,xe=li(class extends Ta{render(i){return $}update(i,[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=i.options)==null?void 0:n.host,this.rt(this.ct=i.element)),$}rt(i){if(this.isConnected||(i=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=En.get(e);t===void 0&&(t=new WeakMap,En.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,i),i!==void 0&&this.G.call(this.ht,i)}else this.G.value=i}get lt(){var i,e;return typeof this.G=="function"?(i=En.get(this.ht??globalThis))==null?void 0:i.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
|
|
49
|
+
*/const Ct=li(class extends en{constructor(i){var e;if(super(i),i.type!==ai.ATTRIBUTE||i.name!=="class"||((e=i.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(i){return" "+Object.keys(i).filter((e=>i[e])).join(" ")+" "}update(i,[e]){var n,s;if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.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=i.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 Me}});var nh=Object.defineProperty,sh=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&nh(e,t,s),s};const Ns=class Ns 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"),$}};Ns.styles=[O`
|
|
50
50
|
:host {
|
|
51
51
|
position: fixed;
|
|
52
52
|
display: flex;
|
|
@@ -62,30 +62,30 @@
|
|
|
62
62
|
bottom: 20px;
|
|
63
63
|
left: 20px;
|
|
64
64
|
}
|
|
65
|
-
`];let Ui=
|
|
65
|
+
`];let Ui=Ns;sh([k({attribute:!0})],Ui.prototype,"anchor");const rh=new WeakMap;let lo=0;const An=new Map,co=new WeakSet,uo=()=>new Promise((i=>requestAnimationFrame(i))),oh=[{transform:"translateX(100%) scale(0)",opacity:0}],ah=[{opacity:0}],ho=[{opacity:0},{opacity:1}],po=(i,e)=>{const t=i-e;return t===0?void 0:t},fo=(i,e)=>{const t=i/e;return t===1?void 0:t},Tn={left:(i,e)=>{const t=po(i,e);return{value:t,transform:t==null||isNaN(t)?void 0:`translateX(${t}px)`}},top:(i,e)=>{const t=po(i,e);return{value:t,transform:t==null||isNaN(t)?void 0:`translateY(${t}px)`}},width:(i,e)=>{let t;e===0&&(e=1,t={width:"1px"});const n=fo(i,e);return{value:n,overrideFrom:t,transform:n==null||isNaN(n)?void 0:`scaleX(${n})`}},height:(i,e)=>{let t;e===0&&(e=1,t={height:"1px"});const n=fo(i,e);return{value:n,overrideFrom:t,transform:n==null||isNaN(n)?void 0:`scaleY(${n})`}}},lh={duration:333,easing:"ease-in-out"},ch=["left","top","width","height","opacity","color","background"],go=new WeakMap;class uh extends Ta{constructor(e){if(super(e),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,e.type===ai.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 $}getController(){return rh.get(this.u)}isDisabled(){var e;return this.options.disabled||((e=this.getController())==null?void 0:e.disabled)}update(e,[t]){var s;const n=this.u===void 0;return n&&(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,go.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=ch),this.options=e}m(){const e={},t=this.element.getBoundingClientRect(),n=getComputedStyle(this.element);return this.options.properties.forEach((s=>{const r=t[s]??(Tn[s]?void 0:n[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=((n,s)=>{if(Array.isArray(n)){if(Array.isArray(s)&&s.length===n.length&&n.every(((r,o)=>r===s[o])))return!1}else if(s===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 uo;const t=this.O(),n=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=An.get(this.options.inId);if(r){An.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,lo++,e.forEach((l=>l.zIndex=lo))}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&&An.set(this.options.id,this.A),this.options.out===void 0))return;if(this.prepare(),await uo(),(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 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,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=go.get(t);n&&!n.isDisabled()&&n&&e.push(n)}return e}get isHostRendered(){const e=co.has(this.u);return e||this.u.updateComplete.then((()=>{co.add(this.u)})),e}j(e,t=this.O()){const n={...lh};return t.forEach((s=>Object.assign(n,s.options.keyframeOptions))),Object.assign(n,e),n}N(e,t,n){e={...e},t={...t};const s=n.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,n=!1){const s={},r={};let o=!1;const a={};for(const l in t){const c=e[l],u=t[l];if(l in Tn){const p=Tn[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=n?"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 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 s=this.getController();s==null||s.add(this);try{await this.webAnimation.finished}catch{}s==null||s.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 Zn=li(uh),Ae=(i,e,t)=>{i&&t.style.setProperty(e,i)},Oa=(i,e)=>{var t,n,s,r,o,a,l,c,u;Ae((t=i.colors)==null?void 0:t.primaryBackground,"--primary-background",e),Ae((n=i.colors)==null?void 0:n.textOnPrimaryBackground,"--text-on-primary-background",e),Ae((s=i.colors)==null?void 0:s.secondaryBackground,"--secondary-background",e),Ae((r=i.colors)==null?void 0:r.textOnSecondaryBackground,"--text-on-secondary-background",e),Ae((o=i.colors)==null?void 0:o.interactiveDestructiveBackground,"--destructive-color",e),Ae((a=i.colors)==null?void 0:a.interactiveTextOnDestructiveBackground,"--text-on-destructive-color",e),Ae((l=i.colors)==null?void 0:l.interactivePrimaryBackground,"--interactive-primary-background",e),Ae((c=i.colors)==null?void 0:c.interactiveTextOnPrimaryBackground,"--interactive-text-on-primary-background",e),Ae((u=i.colors)==null?void 0:u.focusColor,"--focus-color",e)};var hh=Object.defineProperty,ci=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&hh(e,t,s),s};const Ds=class Ds extends E{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=$e(),this.widgetActive$=new fe(!1),this.componentIsDestroyed$=new M}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&&Oa(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 w` <img src=${t} class="trigger-icon" alt="" /> `;const n=(c=this.application)==null?void 0:c.triggerIcon;if(!n)return $;const s=async u=>Xc,{type:r,content:o}=n;switch(r){case"Telia":{const u=await s();return u?w`<telia-icon
|
|
66
66
|
class="trigger-icon"
|
|
67
67
|
svg=${u.svg}
|
|
68
68
|
size="lg"
|
|
69
|
-
></telia-icon
|
|
70
|
-
class=${
|
|
71
|
-
${
|
|
69
|
+
></telia-icon>`:$}default:return $}}hideTrigger(){this.triggerVisible=!1}showTrigger(){this.triggerVisible=!0}render(){var e,t,n,s,r,o,a;return w`<div
|
|
70
|
+
class=${Ct({"trigger-container":!0,"ace-hidden":!this.triggerVisible})}
|
|
71
|
+
${xe(this.containerRef)}
|
|
72
72
|
>
|
|
73
|
-
${!this.active&&((s=(n=(t=(e=this.application)==null?void 0:e.settings)==null?void 0:t.branding)==null?void 0:n.other)!=null&&s.showButtonLabel)
|
|
73
|
+
${!this.active&&((s=(n=(t=(e=this.application)==null?void 0:e.settings)==null?void 0:t.branding)==null?void 0:n.other)!=null&&s.showButtonLabel)?w`
|
|
74
74
|
<button
|
|
75
75
|
type="button"
|
|
76
76
|
aria-label="${this.application.settings.branding.other.buttonLabelText??"Widget trigger"}"
|
|
77
77
|
class="trigger-label"
|
|
78
78
|
@click=${this.toggleActive}
|
|
79
|
-
${
|
|
79
|
+
${Zn({keyframeOptions:{},in:oh,stabilizeOut:!0,skipInitial:!1})}
|
|
80
80
|
>
|
|
81
81
|
${this.application.settings.branding.other.buttonLabelText??"Widget trigger"}
|
|
82
82
|
</button>
|
|
83
|
-
|
|
83
|
+
`:$}
|
|
84
84
|
|
|
85
85
|
<button
|
|
86
86
|
type="button"
|
|
87
87
|
aria-label="${((a=(o=(r=this.application)==null?void 0:r.settings)==null?void 0:o.branding.other)==null?void 0:a.buttonLabelText)??"Widget trigger"}"
|
|
88
|
-
class=${
|
|
88
|
+
class=${Ct({trigger:!0,active:this.active,rendered:this.loaded})}
|
|
89
89
|
@click=${this.toggleActive}
|
|
90
90
|
>
|
|
91
91
|
${this.icon}
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
</svg>
|
|
118
118
|
</span>
|
|
119
119
|
</button>
|
|
120
|
-
</div>`}};
|
|
120
|
+
</div>`}};Ds.styles=[O`
|
|
121
121
|
:host {
|
|
122
122
|
--voca-rem-multiplier: 0.625;
|
|
123
123
|
--trigger-label-bg: #f5e0ff;
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
.trigger-label:hover {
|
|
247
247
|
opacity: 0.8;
|
|
248
248
|
}
|
|
249
|
-
`];let
|
|
249
|
+
`];let Ne=Ds;ci([k({attribute:!1})],Ne.prototype,"application");ci([T()],Ne.prototype,"active");ci([T()],Ne.prototype,"triggerVisible");ci([T()],Ne.prototype,"loaded");ci([T()],Ne.prototype,"icon");var dh=Object.defineProperty,Xe=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&dh(e,t,s),s};const Ra=i=>{const t=class t extends i{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=[O`
|
|
250
250
|
:host {
|
|
251
251
|
font-family: var(--font-family);
|
|
252
252
|
grid-column: span var(--width);
|
|
@@ -258,19 +258,19 @@
|
|
|
258
258
|
* {
|
|
259
259
|
box-sizing: border-box;
|
|
260
260
|
}
|
|
261
|
-
`];let e=t;return
|
|
261
|
+
`];let e=t;return Xe([k()],e.prototype,"properties"),Xe([k()],e.prototype,"context"),Xe([k()],e.prototype,"layout"),Xe([k()],e.prototype,"name"),Xe([k()],e.prototype,"type"),Xe([k({attribute:!1})],e.prototype,"application"),Xe([k({attribute:!1})],e.prototype,"parent"),e},Us=class Us extends Ra(E){render(){return w`Non resolved component`}};Us.styles=[O`
|
|
262
262
|
:host {
|
|
263
263
|
display: block;
|
|
264
264
|
}
|
|
265
|
-
`];let
|
|
265
|
+
`];let Yn=Us;/**
|
|
266
266
|
* @license
|
|
267
267
|
* Copyright 2021 Google LLC
|
|
268
268
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
269
|
-
*/function*
|
|
269
|
+
*/function*ph(i,e){if(i!==void 0){let t=0;for(const n of i)yield e(n,t++)}}var ws=(i=>(i.Inline="inline",i.Trigger="trigger",i))(ws||{}),j=(i=>(i.NonAuthenticated="non-authenticated",i.Authenticating="authenticating",i.Authenticated="authenticated",i.ChatEnded="chat-ended",i))(j||{});/**
|
|
270
270
|
* @license
|
|
271
271
|
* Copyright 2021 Google LLC
|
|
272
272
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
273
|
-
*/let
|
|
273
|
+
*/let La=class extends Event{constructor(e,t,n,s){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=n,this.subscribe=s??!1}};/**
|
|
274
274
|
* @license
|
|
275
275
|
* Copyright 2021 Google LLC
|
|
276
276
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -278,25 +278,25 @@
|
|
|
278
278
|
* @license
|
|
279
279
|
* Copyright 2021 Google LLC
|
|
280
280
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
281
|
-
*/let
|
|
281
|
+
*/let mo=class{constructor(e,t,n,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=n,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 La(this.context,this.host,this.t,this.subscribe))}};/**
|
|
282
282
|
* @license
|
|
283
283
|
* Copyright 2021 Google LLC
|
|
284
284
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
285
|
-
*/class
|
|
285
|
+
*/class fh{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:s}=this.subscriptions.get(e);e(this.value,s)}clearCallbacks(){this.subscriptions.clear()}}/**
|
|
286
286
|
* @license
|
|
287
287
|
* Copyright 2021 Google LLC
|
|
288
288
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
289
|
-
*/let
|
|
289
|
+
*/let gh=class extends Event{constructor(e,t){super("context-provider",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},vo=class extends fh{constructor(e,t,n){var s,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 La(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 gh(this.context,this.host))}};/**
|
|
290
290
|
* @license
|
|
291
291
|
* Copyright 2017 Google LLC
|
|
292
292
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
293
|
-
*/function
|
|
293
|
+
*/function mh({context:i}){return(e,t)=>{const n=new WeakMap;if(typeof t=="object")return{get(){return e.get.call(this)},set(s){return n.get(this).setValue(s),e.set.call(this,s)},init(s){return n.set(this,new vo(this,{context:i,initialValue:s})),s}};{e.constructor.addInitializer((o=>{n.set(o,new vo(o,{context:i}))}));const s=Object.getOwnPropertyDescriptor(e,t);let r;if(s===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=s.set;r={...s,set(a){n.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(e,t,r)}}}/**
|
|
294
294
|
* @license
|
|
295
295
|
* Copyright 2022 Google LLC
|
|
296
296
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
297
|
-
*/function ue({context:i,subscribe:e}){return(t,n)=>{typeof n=="object"?n.addInitializer((function(){new
|
|
298
|
-
${
|
|
299
|
-
</div>`}};
|
|
297
|
+
*/function ue({context:i,subscribe:e}){return(t,n)=>{typeof n=="object"?n.addInitializer((function(){new mo(this,{context:i,callback:s=>{t.set.call(this,s)},subscribe:e})})):t.constructor.addInitializer((s=>{new mo(s,{context:i,callback:r=>{s[n]=r},subscribe:e})}))}}var vh=Object.defineProperty,Ia=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&vh(e,t,s),s};const oe="application",zs=class zs extends E{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=$e(),this.fullscreen=!1,this.isReady=new fe(!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&&Oa(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,s])=>{t.style.setProperty(`--${n}`,s)})}firstUpdated(e){this.applyBranding(),this.applyStyles()}render(){var t,n,s;return((s=(n=(t=this.application.settings)==null?void 0:t.agentConfig)==null?void 0:n.live)==null?void 0:s.isThirdPartyWidget)??!1?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===ws.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"),w`<div class="widget-container" ${xe(this.wrapperRef)}>
|
|
298
|
+
${ph(this.nodes,r=>r)}
|
|
299
|
+
</div>`}};zs.styles=O`
|
|
300
300
|
:host {
|
|
301
301
|
--font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
|
|
302
302
|
--spacing-xs: 0.2rem;
|
|
@@ -461,25 +461,25 @@
|
|
|
461
461
|
:host(.ace-expanded.embedded) {
|
|
462
462
|
animation: none;
|
|
463
463
|
}
|
|
464
|
-
`;let
|
|
464
|
+
`;let Xt=zs;Ia([k({attribute:!0})],Xt.prototype,"fullscreen");Ia([k({attribute:!1}),mh({context:oe})],Xt.prototype,"application");var bh=Object.defineProperty,$s=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&bh(e,t,s),s};const Fs=class Fs 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 $;if(this.widget.renderStrategy===ws.Trigger){const e=new Ne;return e.application=this.widget,e}return this.widget.render()}};Fs.styles=[O`
|
|
465
465
|
:host {
|
|
466
466
|
display: block;
|
|
467
467
|
}
|
|
468
|
-
`];let
|
|
468
|
+
`];let _t=Fs;$s([k({attribute:!0})],_t.prototype,"name");$s([T()],_t.prototype,"widget");$s([T()],_t.prototype,"status");customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",Ui);customElements.get("ace-trigger")||customElements.define("ace-trigger",Ne);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",Yn);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",Xt);customElements.get("ace-widget")||customElements.define("ace-widget",_t);class yh{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 bo{constructor(e,t,n,s,r){this.id=e,this.providerKey=t,this.providerOptions=n,this.component=r,this.provider$=new fe(null),this.entries$=new fe([]),this.removeEntryAction$=new M,this.kill$=new M,this.isTyping$=new fe(!1),this.data$=new fe({}),this.complete$=this.provider$.pipe(Pe(l=>l?l.onComplete():Ie));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(F(this.kill$)).subscribe(l=>{this.write(l)}),a.isTyping().pipe(F(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(ke(1)).subscribe(t=>{this.entries$.next([...t,e])})}_addEntryRemoveHandler(e){e.remove$.pipe(Pe(()=>this.entries$),ke(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 wh{constructor(e){this.component=e,this.currentSession$=new fe(null),this.sessions=[],this.storage=null,Oi(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(),s={};t=this._createNewSession(n,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 bo(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(s=>s.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(),s=new bo(Jo(),e,t,{},this.component);return n.sessions.push(s),this.save(n),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 $h{constructor(e,t){this.state$=e,this.component=t,this.entries$=new fe([]),this.session=()=>this.session$,this.isTyping=()=>this.isTyping$,this.entries=()=>this.entries$.asObservable(),this.sessionService=new wh(this.component),this.session$=this.sessionService.currentSession(),this.isTyping$=this.session$.pipe(Pe(n=>n?n.provider$.pipe(Pe(s=>s?s.isTyping():zn(!1))):zn(!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(Pe(e=>{if(!e)return Ie;const t=e.removeEntryAction$.pipe(Fn(this.entries$)).pipe(Ti(([s,r])=>r.filter(o=>o.id!==s.id))),n=e.entries().pipe(Ti(s=>{const r=this.entries$.value,o=s.filter(a=>r.findIndex(l=>l.id===a.id)===-1);return[...r,...o]}));return yc(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 xh=Object.defineProperty,Pa=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&xh(e,t,s),s};const Hs=class Hs 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 $;let n="";e?t?n=`${e}: ${this._getTimestamp(t)}`:n=e:t&&(n=this._getTimestamp(t));const s=this.application.texts.getOrFallback("conversation.sr-only.message-from-label","Message from");return w`
|
|
469
469
|
<p class="conversation-timestamp">
|
|
470
470
|
<span class="sr-only">${s}</span>
|
|
471
471
|
${n}
|
|
472
472
|
</p>
|
|
473
|
-
`}_renderDeliveryStatus(e){return e==="delivered"
|
|
474
|
-
svg=${
|
|
473
|
+
`}_renderDeliveryStatus(e){return e==="delivered"?w`<telia-icon
|
|
474
|
+
svg=${Gc.svg}
|
|
475
475
|
size="sm"
|
|
476
|
-
></telia-icon>`:e==="failed"
|
|
477
|
-
svg=${
|
|
476
|
+
></telia-icon>`:e==="failed"?w`<telia-icon
|
|
477
|
+
svg=${Wc.svg}
|
|
478
478
|
size="sm"
|
|
479
479
|
title="Message could not be delivered"
|
|
480
|
-
></telia-icon
|
|
480
|
+
></telia-icon>`:w`<telia-icon svg=${la.svg} size="sm"></telia-icon>`}_dispatchEntryAction(e){this.entry.actions$.next(e.detail)}render(){var e,t;switch(this.entry.type){case B.System:return w`
|
|
481
481
|
<div class="conversation-system-message">
|
|
482
|
-
${this.entry.messages.map(n
|
|
482
|
+
${this.entry.messages.map(n=>w`
|
|
483
483
|
<div class="message-container">
|
|
484
484
|
<div class="message-content">
|
|
485
485
|
<conversation-group
|
|
@@ -491,15 +491,15 @@
|
|
|
491
491
|
`)}
|
|
492
492
|
<span>${this._getTimestamp(this.entry.timestamp)}</span>
|
|
493
493
|
</div>
|
|
494
|
-
`;case
|
|
495
|
-
class=${
|
|
494
|
+
`;case B.Agent:return w`<div
|
|
495
|
+
class=${Ct({"conversation-agent-message":!0,"has-avatar":!!((e=this.entry.sender)!=null&&e.avatar)})}
|
|
496
496
|
>
|
|
497
|
-
${typeof((t=this.entry.sender)==null?void 0:t.avatar)=="string"
|
|
497
|
+
${typeof((t=this.entry.sender)==null?void 0:t.avatar)=="string"?w`<div class="avatar">
|
|
498
498
|
<img src=${this.entry.sender.avatar} />
|
|
499
|
-
</div
|
|
499
|
+
</div>`:$}
|
|
500
500
|
|
|
501
501
|
<div class="entry-content">
|
|
502
|
-
${this.entry.messages.map(n
|
|
502
|
+
${this.entry.messages.map(n=>w`
|
|
503
503
|
<div class="message-container">
|
|
504
504
|
<div class="message-content">
|
|
505
505
|
<conversation-group .group=${n}></conversation-group>
|
|
@@ -510,11 +510,11 @@
|
|
|
510
510
|
<div class="message-details">
|
|
511
511
|
${this._renderTimestamp(this.entry.sender.name||"",this.entry.timestamp)}
|
|
512
512
|
</div>
|
|
513
|
-
</div>`;case
|
|
514
|
-
class=${
|
|
513
|
+
</div>`;case B.User:return w`<div
|
|
514
|
+
class=${Ct({"conversation-user-message":!0,"has-error":this.entry.status==="failed"})}
|
|
515
515
|
>
|
|
516
516
|
<div class="entry-content">
|
|
517
|
-
${this.entry.messages.map(n
|
|
517
|
+
${this.entry.messages.map(n=>w`
|
|
518
518
|
<div class="message-container">
|
|
519
519
|
<div class="message-content">
|
|
520
520
|
<conversation-group .group=${n}></conversation-group>
|
|
@@ -526,7 +526,7 @@
|
|
|
526
526
|
${this._renderTimestamp(this.entry.sender.name||"",this.entry.timestamp)}
|
|
527
527
|
${this._renderDeliveryStatus(this.entry.status)}
|
|
528
528
|
</div>
|
|
529
|
-
</div>`;default:return
|
|
529
|
+
</div>`;default:return $}}};Hs.styles=[O`
|
|
530
530
|
:host {
|
|
531
531
|
box-sizing: border-box;
|
|
532
532
|
display: inline;
|
|
@@ -658,18 +658,18 @@
|
|
|
658
658
|
white-space: nowrap;
|
|
659
659
|
border-width: 0;
|
|
660
660
|
}
|
|
661
|
-
`];let
|
|
662
|
-
${this.entries.map(e
|
|
661
|
+
`];let Kt=Hs;Pa([k({attribute:!1})],Kt.prototype,"entry");Pa([ue({context:oe}),k({attribute:!1})],Kt.prototype,"application");var kh=Object.defineProperty,Ma=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&kh(e,t,s),s};const js=class js extends E{constructor(){super(...arguments),this.entries=[],this.loading=!0}updated(e){const t=new CustomEvent("updated",{});this.dispatchEvent(t)}render(){return w`<div class="conversation-feed">
|
|
662
|
+
${this.entries.map(e=>w`<div class="conversation-entry" tabindex="-1">
|
|
663
663
|
<conversation-entry
|
|
664
664
|
.entry=${e}
|
|
665
|
-
${
|
|
665
|
+
${Zn({keyframeOptions:{},in:ho,stabilizeOut:!0,skipInitial:!1})}
|
|
666
666
|
>
|
|
667
667
|
</conversation-entry>
|
|
668
668
|
</div>`)}
|
|
669
|
-
${this.loading
|
|
670
|
-
${
|
|
671
|
-
></ace-typing-state
|
|
672
|
-
</div>`}};
|
|
669
|
+
${this.loading?w`<ace-typing-state
|
|
670
|
+
${Zn({keyframeOptions:{},in:ho,out:ah,stabilizeOut:!0,skipInitial:!1})}
|
|
671
|
+
></ace-typing-state>`:$}
|
|
672
|
+
</div>`}};js.styles=[O`
|
|
673
673
|
:host {
|
|
674
674
|
display: block;
|
|
675
675
|
}
|
|
@@ -685,17 +685,17 @@
|
|
|
685
685
|
.conversation-entry:focus {
|
|
686
686
|
outline-color: var(--focus-color);
|
|
687
687
|
}
|
|
688
|
-
`];let
|
|
688
|
+
`];let Jt=js;Ma([k({attribute:!1})],Jt.prototype,"entries");Ma([k({type:Boolean})],Jt.prototype,"loading");/**
|
|
689
689
|
* @license
|
|
690
690
|
* Copyright 2021 Google LLC
|
|
691
691
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
692
|
-
*/const
|
|
692
|
+
*/const Sh=(i,e,t)=>{for(const n of e)if(n[0]===i)return(0,n[1])();return t==null?void 0:t()};var Ch=Object.defineProperty,_h=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&Ch(e,t,s),s};const Bs=class Bs extends E{render(){return w`
|
|
693
693
|
<div class="message-group">
|
|
694
|
-
${this.group.items.map(([e,t,n])
|
|
695
|
-
${
|
|
694
|
+
${this.group.items.map(([e,t,n])=>w`
|
|
695
|
+
${Sh(e,[["html",()=>w`<message-type-html .message=${t} />`],["markdown",()=>w`<message-type-markdown .message=${t} />`]],()=>{const s=customElements.get(e);if(!s)return $;const r=new s(n||null);return w`${r}`})}
|
|
696
696
|
`)}
|
|
697
697
|
</div>
|
|
698
|
-
`}};
|
|
698
|
+
`}};Bs.styles=[O`
|
|
699
699
|
:host {
|
|
700
700
|
box-sizing: border-box;
|
|
701
701
|
display: block;
|
|
@@ -708,11 +708,11 @@
|
|
|
708
708
|
flex-direction: column;
|
|
709
709
|
gap: var(--spacing-md);
|
|
710
710
|
}
|
|
711
|
-
`];let
|
|
711
|
+
`];let zi=Bs;_h([k({attribute:!1})],zi.prototype,"group");const qs=class qs extends E{render(){return w`<div class="container">
|
|
712
712
|
<div class="dot"></div>
|
|
713
713
|
<div class="dot"></div>
|
|
714
714
|
<div class="dot"></div>
|
|
715
|
-
</div>`}};
|
|
715
|
+
</div>`}};qs.styles=[O`
|
|
716
716
|
:host {
|
|
717
717
|
display: block;
|
|
718
718
|
}
|
|
@@ -746,14 +746,14 @@
|
|
|
746
746
|
opacity: 1;
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
|
-
`];let
|
|
749
|
+
`];let Qn=qs;/**
|
|
750
750
|
* @license
|
|
751
751
|
* Copyright 2017 Google LLC
|
|
752
752
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
753
|
-
*/class Zn extends Ji{constructor(e){if(super(e),this.it=w,e.type!==oi.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===Pe)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:[]}}}Zn.directiveName="unsafeHTML",Zn.resultType=1;const _h=ai(Zn);/*! @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:Pa,setPrototypeOf:mo,isFrozen:Eh,getPrototypeOf:Ah,getOwnPropertyDescriptor:Th}=Object;let{freeze:ee,seal:ae,create:Ma}=Object,{apply:Yn,construct:Qn}=typeof Reflect<"u"&&Reflect;ee||(ee=function(e){return e});ae||(ae=function(e){return e});Yn||(Yn=function(e,t,n){return e.apply(t,n)});Qn||(Qn=function(e,t){return new e(...t)});const yi=te(Array.prototype.forEach),Oh=te(Array.prototype.lastIndexOf),vo=te(Array.prototype.pop),Pt=te(Array.prototype.push),Rh=te(Array.prototype.splice),Si=te(String.prototype.toLowerCase),An=te(String.prototype.toString),bo=te(String.prototype.match),Mt=te(String.prototype.replace),Lh=te(String.prototype.indexOf),Ih=te(String.prototype.trim),he=te(Object.prototype.hasOwnProperty),Y=te(RegExp.prototype.test),Nt=Ph(TypeError);function te(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return Yn(i,e,n)}}function Ph(i){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Qn(i,t)}}function x(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Si;mo&&mo(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=t(s);r!==s&&(Eh(e)||(e[n]=r),s=r)}i[s]=!0}return i}function Mh(i){for(let e=0;e<i.length;e++)he(i,e)||(i[e]=null);return i}function Ee(i){const e=Ma(null);for(const[t,n]of Pa(i))he(i,t)&&(Array.isArray(n)?e[t]=Mh(n):n&&typeof n=="object"&&n.constructor===Object?e[t]=Ee(n):e[t]=n);return e}function Ut(i,e){for(;i!==null;){const n=Th(i,e);if(n){if(n.get)return te(n.get);if(typeof n.value=="function")return te(n.value)}i=Ah(i)}function t(){return null}return t}const yo=ee(["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"]),Tn=ee(["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"]),On=ee(["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"]),Nh=ee(["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"]),Rn=ee(["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"]),Uh=ee(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$o=ee(["#text"]),wo=ee(["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"]),Ln=ee(["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"]),xo=ee(["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"]),$i=ee(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Dh=ae(/\{\{[\w\W]*|[\w\W]*\}\}/gm),zh=ae(/<%[\w\W]*|[\w\W]*%>/gm),Hh=ae(/\$\{[\w\W]*/gm),Fh=ae(/^data-[\-\w.\u00B7-\uFFFF]+$/),jh=ae(/^aria-[\-\w]+$/),Na=ae(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Bh=ae(/^(?:\w+script|data):/i),qh=ae(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ua=ae(/^html$/i),Vh=ae(/^[a-z][.\w]*(-[.\w]+)+$/i);var ko=Object.freeze({__proto__:null,ARIA_ATTR:jh,ATTR_WHITESPACE:qh,CUSTOM_ELEMENT:Vh,DATA_ATTR:Fh,DOCTYPE_NAME:Ua,ERB_EXPR:zh,IS_ALLOWED_URI:Na,IS_SCRIPT_OR_DATA:Bh,MUSTACHE_EXPR:Dh,TMPLIT_EXPR:Hh});const Dt={element:1,text:3,progressingInstruction:7,comment:8,document:9},Wh=function(){return typeof window>"u"?null:window},Gh=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(n=t.getAttribute(s));const r="dompurify"+(n?"#"+n:"");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}},So=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Da(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Wh();const e=y=>Da(y);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==Dt.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const n=t,s=n.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:p,DOMParser:d,trustedTypes:g}=i,v=l.prototype,m=Ut(v,"cloneNode"),W=Ut(v,"remove"),G=Ut(v,"nextSibling"),Ue=Ut(v,"childNodes"),Be=Ut(v,"parentNode");if(typeof o=="function"){const y=t.createElement("template");y.content&&y.content.ownerDocument&&(t=y.content.ownerDocument)}let M,qe="";const{implementation:Ve,createNodeIterator:We,createDocumentFragment:il,getElementsByTagName:nl}=t,{importNode:sl}=n;let Z=So();e.isSupported=typeof Pa=="function"&&typeof Be=="function"&&Ve&&Ve.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:nn,ERB_EXPR:sn,TMPLIT_EXPR:rn,DATA_ATTR:rl,ARIA_ATTR:ol,IS_SCRIPT_OR_DATA:al,ATTR_WHITESPACE:tr,CUSTOM_ELEMENT:ll}=ko;let{IS_ALLOWED_URI:ir}=ko,N=null;const nr=x({},[...yo,...Tn,...On,...Rn,...$o]);let D=null;const sr=x({},[...wo,...Ln,...xo,...$i]);let L=Object.seal(Ma(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}})),Tt=null,on=null,rr=!0,an=!0,or=!1,ar=!0,rt=!1,ui=!0,Ge=!1,ln=!1,cn=!1,ot=!1,hi=!1,di=!1,lr=!0,cr=!1;const cl="user-content-";let un=!0,Ot=!1,at={},lt=null;const ur=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 hr=null;const dr=x({},["audio","video","img","source","image","track"]);let hn=null;const pr=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pi="http://www.w3.org/1998/Math/MathML",fi="http://www.w3.org/2000/svg",ke="http://www.w3.org/1999/xhtml";let ct=ke,dn=!1,pn=null;const ul=x({},[pi,fi,ke],An);let gi=x({},["mi","mo","mn","ms","mtext"]),mi=x({},["annotation-xml"]);const hl=x({},["title","style","font","a","script"]);let Rt=null;const dl=["application/xhtml+xml","text/html"],pl="text/html";let U=null,ut=null;const fl=t.createElement("form"),fr=function(h){return h instanceof RegExp||h instanceof Function},fn=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ut&&ut===h)){if((!h||typeof h!="object")&&(h={}),h=Ee(h),Rt=dl.indexOf(h.PARSER_MEDIA_TYPE)===-1?pl:h.PARSER_MEDIA_TYPE,U=Rt==="application/xhtml+xml"?An:Si,N=he(h,"ALLOWED_TAGS")?x({},h.ALLOWED_TAGS,U):nr,D=he(h,"ALLOWED_ATTR")?x({},h.ALLOWED_ATTR,U):sr,pn=he(h,"ALLOWED_NAMESPACES")?x({},h.ALLOWED_NAMESPACES,An):ul,hn=he(h,"ADD_URI_SAFE_ATTR")?x(Ee(pr),h.ADD_URI_SAFE_ATTR,U):pr,hr=he(h,"ADD_DATA_URI_TAGS")?x(Ee(dr),h.ADD_DATA_URI_TAGS,U):dr,lt=he(h,"FORBID_CONTENTS")?x({},h.FORBID_CONTENTS,U):ur,Tt=he(h,"FORBID_TAGS")?x({},h.FORBID_TAGS,U):Ee({}),on=he(h,"FORBID_ATTR")?x({},h.FORBID_ATTR,U):Ee({}),at=he(h,"USE_PROFILES")?h.USE_PROFILES:!1,rr=h.ALLOW_ARIA_ATTR!==!1,an=h.ALLOW_DATA_ATTR!==!1,or=h.ALLOW_UNKNOWN_PROTOCOLS||!1,ar=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,rt=h.SAFE_FOR_TEMPLATES||!1,ui=h.SAFE_FOR_XML!==!1,Ge=h.WHOLE_DOCUMENT||!1,ot=h.RETURN_DOM||!1,hi=h.RETURN_DOM_FRAGMENT||!1,di=h.RETURN_TRUSTED_TYPE||!1,cn=h.FORCE_BODY||!1,lr=h.SANITIZE_DOM!==!1,cr=h.SANITIZE_NAMED_PROPS||!1,un=h.KEEP_CONTENT!==!1,Ot=h.IN_PLACE||!1,ir=h.ALLOWED_URI_REGEXP||Na,ct=h.NAMESPACE||ke,gi=h.MATHML_TEXT_INTEGRATION_POINTS||gi,mi=h.HTML_INTEGRATION_POINTS||mi,L=h.CUSTOM_ELEMENT_HANDLING||{},h.CUSTOM_ELEMENT_HANDLING&&fr(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(L.tagNameCheck=h.CUSTOM_ELEMENT_HANDLING.tagNameCheck),h.CUSTOM_ELEMENT_HANDLING&&fr(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(L.attributeNameCheck=h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),rt&&(an=!1),hi&&(ot=!0),at&&(N=x({},$o),D=[],at.html===!0&&(x(N,yo),x(D,wo)),at.svg===!0&&(x(N,Tn),x(D,Ln),x(D,$i)),at.svgFilters===!0&&(x(N,On),x(D,Ln),x(D,$i)),at.mathMl===!0&&(x(N,Rn),x(D,xo),x(D,$i))),h.ADD_TAGS&&(N===nr&&(N=Ee(N)),x(N,h.ADD_TAGS,U)),h.ADD_ATTR&&(D===sr&&(D=Ee(D)),x(D,h.ADD_ATTR,U)),h.ADD_URI_SAFE_ATTR&&x(hn,h.ADD_URI_SAFE_ATTR,U),h.FORBID_CONTENTS&&(lt===ur&&(lt=Ee(lt)),x(lt,h.FORBID_CONTENTS,U)),un&&(N["#text"]=!0),Ge&&x(N,["html","head","body"]),N.table&&(x(N,["tbody"]),delete Tt.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw Nt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Nt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=h.TRUSTED_TYPES_POLICY,qe=M.createHTML("")}else M===void 0&&(M=Gh(g,s)),M!==null&&typeof qe=="string"&&(qe=M.createHTML(""));ee&&ee(h),ut=h}},gr=x({},[...Tn,...On,...Nh]),mr=x({},[...Rn,...Uh]),gl=function(h){let f=Be(h);(!f||!f.tagName)&&(f={namespaceURI:ct,tagName:"template"});const b=Si(h.tagName),R=Si(f.tagName);return pn[h.namespaceURI]?h.namespaceURI===fi?f.namespaceURI===ke?b==="svg":f.namespaceURI===pi?b==="svg"&&(R==="annotation-xml"||gi[R]):!!gr[b]:h.namespaceURI===pi?f.namespaceURI===ke?b==="math":f.namespaceURI===fi?b==="math"&&mi[R]:!!mr[b]:h.namespaceURI===ke?f.namespaceURI===fi&&!mi[R]||f.namespaceURI===pi&&!gi[R]?!1:!mr[b]&&(hl[b]||!gr[b]):!!(Rt==="application/xhtml+xml"&&pn[h.namespaceURI]):!1},me=function(h){Pt(e.removed,{element:h});try{Be(h).removeChild(h)}catch{W(h)}},ht=function(h,f){try{Pt(e.removed,{attribute:f.getAttributeNode(h),from:f})}catch{Pt(e.removed,{attribute:null,from:f})}if(f.removeAttribute(h),h==="is")if(ot||hi)try{me(f)}catch{}else try{f.setAttribute(h,"")}catch{}},vr=function(h){let f=null,b=null;if(cn)h="<remove></remove>"+h;else{const I=bo(h,/^[\r\n\t ]+/);b=I&&I[0]}Rt==="application/xhtml+xml"&&ct===ke&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const R=M?M.createHTML(h):h;if(ct===ke)try{f=new d().parseFromString(R,Rt)}catch{}if(!f||!f.documentElement){f=Ve.createDocument(ct,"template",null);try{f.documentElement.innerHTML=dn?qe:R}catch{}}const B=f.body||f.documentElement;return h&&b&&B.insertBefore(t.createTextNode(b),B.childNodes[0]||null),ct===ke?nl.call(f,Ge?"html":"body")[0]:Ge?f.documentElement:B},br=function(h){return We.call(h.ownerDocument||h,h,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},gn=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")},yr=function(h){return typeof a=="function"&&h instanceof a};function Se(y,h,f){yi(y,b=>{b.call(e,h,f,ut)})}const $r=function(h){let f=null;if(Se(Z.beforeSanitizeElements,h,null),gn(h))return me(h),!0;const b=U(h.nodeName);if(Se(Z.uponSanitizeElement,h,{tagName:b,allowedTags:N}),ui&&h.hasChildNodes()&&!yr(h.firstElementChild)&&Y(/<[/\w!]/g,h.innerHTML)&&Y(/<[/\w!]/g,h.textContent)||h.nodeType===Dt.progressingInstruction||ui&&h.nodeType===Dt.comment&&Y(/<[/\w]/g,h.data))return me(h),!0;if(!N[b]||Tt[b]){if(!Tt[b]&&xr(b)&&(L.tagNameCheck instanceof RegExp&&Y(L.tagNameCheck,b)||L.tagNameCheck instanceof Function&&L.tagNameCheck(b)))return!1;if(un&&!lt[b]){const R=Be(h)||h.parentNode,B=Ue(h)||h.childNodes;if(B&&R){const I=B.length;for(let ie=I-1;ie>=0;--ie){const Ce=m(B[ie],!0);Ce.__removalCount=(h.__removalCount||0)+1,R.insertBefore(Ce,G(h))}}}return me(h),!0}return h instanceof l&&!gl(h)||(b==="noscript"||b==="noembed"||b==="noframes")&&Y(/<\/no(script|embed|frames)/i,h.innerHTML)?(me(h),!0):(rt&&h.nodeType===Dt.text&&(f=h.textContent,yi([nn,sn,rn],R=>{f=Mt(f,R," ")}),h.textContent!==f&&(Pt(e.removed,{element:h.cloneNode()}),h.textContent=f)),Se(Z.afterSanitizeElements,h,null),!1)},wr=function(h,f,b){if(lr&&(f==="id"||f==="name")&&(b in t||b in fl))return!1;if(!(an&&!on[f]&&Y(rl,f))){if(!(rr&&Y(ol,f))){if(!D[f]||on[f]){if(!(xr(h)&&(L.tagNameCheck instanceof RegExp&&Y(L.tagNameCheck,h)||L.tagNameCheck instanceof Function&&L.tagNameCheck(h))&&(L.attributeNameCheck instanceof RegExp&&Y(L.attributeNameCheck,f)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(f))||f==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&Y(L.tagNameCheck,b)||L.tagNameCheck instanceof Function&&L.tagNameCheck(b))))return!1}else if(!hn[f]){if(!Y(ir,Mt(b,tr,""))){if(!((f==="src"||f==="xlink:href"||f==="href")&&h!=="script"&&Lh(b,"data:")===0&&hr[h])){if(!(or&&!Y(al,Mt(b,tr,"")))){if(b)return!1}}}}}}return!0},xr=function(h){return h!=="annotation-xml"&&bo(h,ll)},kr=function(h){Se(Z.beforeSanitizeAttributes,h,null);const{attributes:f}=h;if(!f||gn(h))return;const b={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0};let R=f.length;for(;R--;){const B=f[R],{name:I,namespaceURI:ie,value:Ce}=B,Lt=U(I),mn=Ce;let q=I==="value"?mn:Ih(mn);if(b.attrName=Lt,b.attrValue=q,b.keepAttr=!0,b.forceKeepAttr=void 0,Se(Z.uponSanitizeAttribute,h,b),q=b.attrValue,cr&&(Lt==="id"||Lt==="name")&&(ht(I,h),q=cl+q),ui&&Y(/((--!?|])>)|<\/(style|title)/i,q)){ht(I,h);continue}if(b.forceKeepAttr)continue;if(!b.keepAttr){ht(I,h);continue}if(!ar&&Y(/\/>/i,q)){ht(I,h);continue}rt&&yi([nn,sn,rn],Cr=>{q=Mt(q,Cr," ")});const Sr=U(h.nodeName);if(!wr(Sr,Lt,q)){ht(I,h);continue}if(M&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!ie)switch(g.getAttributeType(Sr,Lt)){case"TrustedHTML":{q=M.createHTML(q);break}case"TrustedScriptURL":{q=M.createScriptURL(q);break}}if(q!==mn)try{ie?h.setAttributeNS(ie,I,q):h.setAttribute(I,q),gn(h)?me(h):vo(e.removed)}catch{ht(I,h)}}Se(Z.afterSanitizeAttributes,h,null)},ml=function y(h){let f=null;const b=br(h);for(Se(Z.beforeSanitizeShadowDOM,h,null);f=b.nextNode();)Se(Z.uponSanitizeShadowNode,f,null),$r(f),kr(f),f.content instanceof r&&y(f.content);Se(Z.afterSanitizeShadowDOM,h,null)};return e.sanitize=function(y){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,b=null,R=null,B=null;if(dn=!y,dn&&(y="<!-->"),typeof y!="string"&&!yr(y))if(typeof y.toString=="function"){if(y=y.toString(),typeof y!="string")throw Nt("dirty is not a string, aborting")}else throw Nt("toString is not a function");if(!e.isSupported)return y;if(ln||fn(h),e.removed=[],typeof y=="string"&&(Ot=!1),Ot){if(y.nodeName){const Ce=U(y.nodeName);if(!N[Ce]||Tt[Ce])throw Nt("root node is forbidden and cannot be sanitized in-place")}}else if(y instanceof a)f=vr("<!---->"),b=f.ownerDocument.importNode(y,!0),b.nodeType===Dt.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?f=b:f.appendChild(b);else{if(!ot&&!rt&&!Ge&&y.indexOf("<")===-1)return M&&di?M.createHTML(y):y;if(f=vr(y),!f)return ot?null:di?qe:""}f&&cn&&me(f.firstChild);const I=br(Ot?y:f);for(;R=I.nextNode();)$r(R),kr(R),R.content instanceof r&&ml(R.content);if(Ot)return y;if(ot){if(hi)for(B=il.call(f.ownerDocument);f.firstChild;)B.appendChild(f.firstChild);else B=f;return(D.shadowroot||D.shadowrootmode)&&(B=sl.call(n,B,!0)),B}let ie=Ge?f.outerHTML:f.innerHTML;return Ge&&N["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&Y(Ua,f.ownerDocument.doctype.name)&&(ie="<!DOCTYPE "+f.ownerDocument.doctype.name+`>
|
|
754
|
-
`+ie),
|
|
755
|
-
${
|
|
756
|
-
</div>`}};
|
|
753
|
+
*/class Xn extends en{constructor(e){if(super(e),this.it=$,e.type!==ai.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===$||e==null)return this._t=void 0,this.it=e;if(e===Me)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 Eh=li(Xn);/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:Na,setPrototypeOf:yo,isFrozen:Ah,getPrototypeOf:Th,getOwnPropertyDescriptor:Oh}=Object;let{freeze:ee,seal:ae,create:Kn}=Object,{apply:Jn,construct:es}=typeof Reflect<"u"&&Reflect;ee||(ee=function(e){return e});ae||(ae=function(e){return e});Jn||(Jn=function(e,t){for(var n=arguments.length,s=new Array(n>2?n-2:0),r=2;r<n;r++)s[r-2]=arguments[r];return e.apply(t,s)});es||(es=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return new e(...n)});const wi=te(Array.prototype.forEach),Rh=te(Array.prototype.lastIndexOf),wo=te(Array.prototype.pop),Mt=te(Array.prototype.push),Lh=te(Array.prototype.splice),Ci=te(String.prototype.toLowerCase),On=te(String.prototype.toString),Rn=te(String.prototype.match),Nt=te(String.prototype.replace),Ih=te(String.prototype.indexOf),Ph=te(String.prototype.trim),he=te(Object.prototype.hasOwnProperty),Y=te(RegExp.prototype.test),Dt=Mh(TypeError);function te(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return Jn(i,e,n)}}function Mh(i){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return es(i,t)}}function x(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ci;yo&&yo(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=t(s);r!==s&&(Ah(e)||(e[n]=r),s=r)}i[s]=!0}return i}function Nh(i){for(let e=0;e<i.length;e++)he(i,e)||(i[e]=null);return i}function ye(i){const e=Kn(null);for(const[t,n]of Na(i))he(i,t)&&(Array.isArray(n)?e[t]=Nh(n):n&&typeof n=="object"&&n.constructor===Object?e[t]=ye(n):e[t]=n);return e}function Ut(i,e){for(;i!==null;){const n=Oh(i,e);if(n){if(n.get)return te(n.get);if(typeof n.value=="function")return te(n.value)}i=Th(i)}function t(){return null}return t}const $o=ee(["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","search","section","select","shadow","slot","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"]),Ln=ee(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),In=ee(["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"]),Dh=ee(["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"]),Pn=ee(["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"]),Uh=ee(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xo=ee(["#text"]),ko=ee(["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","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Mn=ee(["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","mask-type","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"]),So=ee(["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"]),$i=ee(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zh=ae(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Fh=ae(/<%[\w\W]*|[\w\W]*%>/gm),Hh=ae(/\$\{[\w\W]*/gm),jh=ae(/^data-[\-\w.\u00B7-\uFFFF]+$/),Bh=ae(/^aria-[\-\w]+$/),Da=ae(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qh=ae(/^(?:\w+script|data):/i),Vh=ae(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ua=ae(/^html$/i),Wh=ae(/^[a-z][.\w]*(-[.\w]+)+$/i);var Co=Object.freeze({__proto__:null,ARIA_ATTR:Bh,ATTR_WHITESPACE:Vh,CUSTOM_ELEMENT:Wh,DATA_ATTR:jh,DOCTYPE_NAME:Ua,ERB_EXPR:Fh,IS_ALLOWED_URI:Da,IS_SCRIPT_OR_DATA:qh,MUSTACHE_EXPR:zh,TMPLIT_EXPR:Hh});const zt={element:1,text:3,progressingInstruction:7,comment:8,document:9},Gh=function(){return typeof window>"u"?null:window},Zh=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(n=t.getAttribute(s));const r="dompurify"+(n?"#"+n:"");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}},_o=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function za(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gh();const e=y=>za(y);if(e.version="3.3.1",e.removed=[],!i||!i.document||i.document.nodeType!==zt.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const n=t,s=n.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:p,DOMParser:d,trustedTypes:g}=i,v=l.prototype,m=Ut(v,"cloneNode"),W=Ut(v,"remove"),G=Ut(v,"nextSibling"),Ue=Ut(v,"childNodes"),qe=Ut(v,"parentNode");if(typeof o=="function"){const y=t.createElement("template");y.content&&y.content.ownerDocument&&(t=y.content.ownerDocument)}let N,Ve="";const{implementation:We,createNodeIterator:Ge,createDocumentFragment:nl,getElementsByTagName:sl}=t,{importNode:rl}=n;let Z=_o();e.isSupported=typeof Na=="function"&&typeof qe=="function"&&We&&We.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:sn,ERB_EXPR:rn,TMPLIT_EXPR:on,DATA_ATTR:ol,ARIA_ATTR:al,IS_SCRIPT_OR_DATA:ll,ATTR_WHITESPACE:rr,CUSTOM_ELEMENT:cl}=Co;let{IS_ALLOWED_URI:or}=Co,D=null;const ar=x({},[...$o,...Ln,...In,...Pn,...xo]);let U=null;const lr=x({},[...ko,...Mn,...So,...$i]);let L=Object.seal(Kn(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}})),Rt=null,an=null;const at=Object.seal(Kn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let cr=!0,ln=!0,ur=!1,hr=!0,lt=!1,hi=!0,Ze=!1,cn=!1,un=!1,ct=!1,di=!1,pi=!1,dr=!0,pr=!1;const ul="user-content-";let hn=!0,Lt=!1,ut={},me=null;const dn=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 fr=null;const gr=x({},["audio","video","img","source","image","track"]);let pn=null;const mr=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fi="http://www.w3.org/1998/Math/MathML",gi="http://www.w3.org/2000/svg",Ce="http://www.w3.org/1999/xhtml";let ht=Ce,fn=!1,gn=null;const hl=x({},[fi,gi,Ce],On);let mi=x({},["mi","mo","mn","ms","mtext"]),vi=x({},["annotation-xml"]);const dl=x({},["title","style","font","a","script"]);let It=null;const pl=["application/xhtml+xml","text/html"],fl="text/html";let P=null,dt=null;const gl=t.createElement("form"),vr=function(h){return h instanceof RegExp||h instanceof Function},mn=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(dt&&dt===h)){if((!h||typeof h!="object")&&(h={}),h=ye(h),It=pl.indexOf(h.PARSER_MEDIA_TYPE)===-1?fl:h.PARSER_MEDIA_TYPE,P=It==="application/xhtml+xml"?On:Ci,D=he(h,"ALLOWED_TAGS")?x({},h.ALLOWED_TAGS,P):ar,U=he(h,"ALLOWED_ATTR")?x({},h.ALLOWED_ATTR,P):lr,gn=he(h,"ALLOWED_NAMESPACES")?x({},h.ALLOWED_NAMESPACES,On):hl,pn=he(h,"ADD_URI_SAFE_ATTR")?x(ye(mr),h.ADD_URI_SAFE_ATTR,P):mr,fr=he(h,"ADD_DATA_URI_TAGS")?x(ye(gr),h.ADD_DATA_URI_TAGS,P):gr,me=he(h,"FORBID_CONTENTS")?x({},h.FORBID_CONTENTS,P):dn,Rt=he(h,"FORBID_TAGS")?x({},h.FORBID_TAGS,P):ye({}),an=he(h,"FORBID_ATTR")?x({},h.FORBID_ATTR,P):ye({}),ut=he(h,"USE_PROFILES")?h.USE_PROFILES:!1,cr=h.ALLOW_ARIA_ATTR!==!1,ln=h.ALLOW_DATA_ATTR!==!1,ur=h.ALLOW_UNKNOWN_PROTOCOLS||!1,hr=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,lt=h.SAFE_FOR_TEMPLATES||!1,hi=h.SAFE_FOR_XML!==!1,Ze=h.WHOLE_DOCUMENT||!1,ct=h.RETURN_DOM||!1,di=h.RETURN_DOM_FRAGMENT||!1,pi=h.RETURN_TRUSTED_TYPE||!1,un=h.FORCE_BODY||!1,dr=h.SANITIZE_DOM!==!1,pr=h.SANITIZE_NAMED_PROPS||!1,hn=h.KEEP_CONTENT!==!1,Lt=h.IN_PLACE||!1,or=h.ALLOWED_URI_REGEXP||Da,ht=h.NAMESPACE||Ce,mi=h.MATHML_TEXT_INTEGRATION_POINTS||mi,vi=h.HTML_INTEGRATION_POINTS||vi,L=h.CUSTOM_ELEMENT_HANDLING||{},h.CUSTOM_ELEMENT_HANDLING&&vr(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(L.tagNameCheck=h.CUSTOM_ELEMENT_HANDLING.tagNameCheck),h.CUSTOM_ELEMENT_HANDLING&&vr(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(L.attributeNameCheck=h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),lt&&(ln=!1),di&&(ct=!0),ut&&(D=x({},xo),U=[],ut.html===!0&&(x(D,$o),x(U,ko)),ut.svg===!0&&(x(D,Ln),x(U,Mn),x(U,$i)),ut.svgFilters===!0&&(x(D,In),x(U,Mn),x(U,$i)),ut.mathMl===!0&&(x(D,Pn),x(U,So),x(U,$i))),h.ADD_TAGS&&(typeof h.ADD_TAGS=="function"?at.tagCheck=h.ADD_TAGS:(D===ar&&(D=ye(D)),x(D,h.ADD_TAGS,P))),h.ADD_ATTR&&(typeof h.ADD_ATTR=="function"?at.attributeCheck=h.ADD_ATTR:(U===lr&&(U=ye(U)),x(U,h.ADD_ATTR,P))),h.ADD_URI_SAFE_ATTR&&x(pn,h.ADD_URI_SAFE_ATTR,P),h.FORBID_CONTENTS&&(me===dn&&(me=ye(me)),x(me,h.FORBID_CONTENTS,P)),h.ADD_FORBID_CONTENTS&&(me===dn&&(me=ye(me)),x(me,h.ADD_FORBID_CONTENTS,P)),hn&&(D["#text"]=!0),Ze&&x(D,["html","head","body"]),D.table&&(x(D,["tbody"]),delete Rt.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw Dt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Dt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');N=h.TRUSTED_TYPES_POLICY,Ve=N.createHTML("")}else N===void 0&&(N=Zh(g,s)),N!==null&&typeof Ve=="string"&&(Ve=N.createHTML(""));ee&&ee(h),dt=h}},br=x({},[...Ln,...In,...Dh]),yr=x({},[...Pn,...Uh]),ml=function(h){let f=qe(h);(!f||!f.tagName)&&(f={namespaceURI:ht,tagName:"template"});const b=Ci(h.tagName),R=Ci(f.tagName);return gn[h.namespaceURI]?h.namespaceURI===gi?f.namespaceURI===Ce?b==="svg":f.namespaceURI===fi?b==="svg"&&(R==="annotation-xml"||mi[R]):!!br[b]:h.namespaceURI===fi?f.namespaceURI===Ce?b==="math":f.namespaceURI===gi?b==="math"&&vi[R]:!!yr[b]:h.namespaceURI===Ce?f.namespaceURI===gi&&!vi[R]||f.namespaceURI===fi&&!mi[R]?!1:!yr[b]&&(dl[b]||!br[b]):!!(It==="application/xhtml+xml"&&gn[h.namespaceURI]):!1},ve=function(h){Mt(e.removed,{element:h});try{qe(h).removeChild(h)}catch{W(h)}},Ye=function(h,f){try{Mt(e.removed,{attribute:f.getAttributeNode(h),from:f})}catch{Mt(e.removed,{attribute:null,from:f})}if(f.removeAttribute(h),h==="is")if(ct||di)try{ve(f)}catch{}else try{f.setAttribute(h,"")}catch{}},wr=function(h){let f=null,b=null;if(un)h="<remove></remove>"+h;else{const I=Rn(h,/^[\r\n\t ]+/);b=I&&I[0]}It==="application/xhtml+xml"&&ht===Ce&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const R=N?N.createHTML(h):h;if(ht===Ce)try{f=new d().parseFromString(R,It)}catch{}if(!f||!f.documentElement){f=We.createDocument(ht,"template",null);try{f.documentElement.innerHTML=fn?Ve:R}catch{}}const q=f.body||f.documentElement;return h&&b&&q.insertBefore(t.createTextNode(b),q.childNodes[0]||null),ht===Ce?sl.call(f,Ze?"html":"body")[0]:Ze?f.documentElement:q},$r=function(h){return Ge.call(h.ownerDocument||h,h,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},vn=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")},xr=function(h){return typeof a=="function"&&h instanceof a};function _e(y,h,f){wi(y,b=>{b.call(e,h,f,dt)})}const kr=function(h){let f=null;if(_e(Z.beforeSanitizeElements,h,null),vn(h))return ve(h),!0;const b=P(h.nodeName);if(_e(Z.uponSanitizeElement,h,{tagName:b,allowedTags:D}),hi&&h.hasChildNodes()&&!xr(h.firstElementChild)&&Y(/<[/\w!]/g,h.innerHTML)&&Y(/<[/\w!]/g,h.textContent)||h.nodeType===zt.progressingInstruction||hi&&h.nodeType===zt.comment&&Y(/<[/\w]/g,h.data))return ve(h),!0;if(!(at.tagCheck instanceof Function&&at.tagCheck(b))&&(!D[b]||Rt[b])){if(!Rt[b]&&Cr(b)&&(L.tagNameCheck instanceof RegExp&&Y(L.tagNameCheck,b)||L.tagNameCheck instanceof Function&&L.tagNameCheck(b)))return!1;if(hn&&!me[b]){const R=qe(h)||h.parentNode,q=Ue(h)||h.childNodes;if(q&&R){const I=q.length;for(let ie=I-1;ie>=0;--ie){const Ee=m(q[ie],!0);Ee.__removalCount=(h.__removalCount||0)+1,R.insertBefore(Ee,G(h))}}}return ve(h),!0}return h instanceof l&&!ml(h)||(b==="noscript"||b==="noembed"||b==="noframes")&&Y(/<\/no(script|embed|frames)/i,h.innerHTML)?(ve(h),!0):(lt&&h.nodeType===zt.text&&(f=h.textContent,wi([sn,rn,on],R=>{f=Nt(f,R," ")}),h.textContent!==f&&(Mt(e.removed,{element:h.cloneNode()}),h.textContent=f)),_e(Z.afterSanitizeElements,h,null),!1)},Sr=function(h,f,b){if(dr&&(f==="id"||f==="name")&&(b in t||b in gl))return!1;if(!(ln&&!an[f]&&Y(ol,f))){if(!(cr&&Y(al,f))){if(!(at.attributeCheck instanceof Function&&at.attributeCheck(f,h))){if(!U[f]||an[f]){if(!(Cr(h)&&(L.tagNameCheck instanceof RegExp&&Y(L.tagNameCheck,h)||L.tagNameCheck instanceof Function&&L.tagNameCheck(h))&&(L.attributeNameCheck instanceof RegExp&&Y(L.attributeNameCheck,f)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(f,h))||f==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&Y(L.tagNameCheck,b)||L.tagNameCheck instanceof Function&&L.tagNameCheck(b))))return!1}else if(!pn[f]){if(!Y(or,Nt(b,rr,""))){if(!((f==="src"||f==="xlink:href"||f==="href")&&h!=="script"&&Ih(b,"data:")===0&&fr[h])){if(!(ur&&!Y(ll,Nt(b,rr,"")))){if(b)return!1}}}}}}}return!0},Cr=function(h){return h!=="annotation-xml"&&Rn(h,cl)},_r=function(h){_e(Z.beforeSanitizeAttributes,h,null);const{attributes:f}=h;if(!f||vn(h))return;const b={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U,forceKeepAttr:void 0};let R=f.length;for(;R--;){const q=f[R],{name:I,namespaceURI:ie,value:Ee}=q,pt=P(I),bn=Ee;let z=I==="value"?bn:Ph(bn);if(b.attrName=pt,b.attrValue=z,b.keepAttr=!0,b.forceKeepAttr=void 0,_e(Z.uponSanitizeAttribute,h,b),z=b.attrValue,pr&&(pt==="id"||pt==="name")&&(Ye(I,h),z=ul+z),hi&&Y(/((--!?|])>)|<\/(style|title|textarea)/i,z)){Ye(I,h);continue}if(pt==="attributename"&&Rn(z,"href")){Ye(I,h);continue}if(b.forceKeepAttr)continue;if(!b.keepAttr){Ye(I,h);continue}if(!hr&&Y(/\/>/i,z)){Ye(I,h);continue}lt&&wi([sn,rn,on],Ar=>{z=Nt(z,Ar," ")});const Er=P(h.nodeName);if(!Sr(Er,pt,z)){Ye(I,h);continue}if(N&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!ie)switch(g.getAttributeType(Er,pt)){case"TrustedHTML":{z=N.createHTML(z);break}case"TrustedScriptURL":{z=N.createScriptURL(z);break}}if(z!==bn)try{ie?h.setAttributeNS(ie,I,z):h.setAttribute(I,z),vn(h)?ve(h):wo(e.removed)}catch{Ye(I,h)}}_e(Z.afterSanitizeAttributes,h,null)},vl=function y(h){let f=null;const b=$r(h);for(_e(Z.beforeSanitizeShadowDOM,h,null);f=b.nextNode();)_e(Z.uponSanitizeShadowNode,f,null),kr(f),_r(f),f.content instanceof r&&y(f.content);_e(Z.afterSanitizeShadowDOM,h,null)};return e.sanitize=function(y){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,b=null,R=null,q=null;if(fn=!y,fn&&(y="<!-->"),typeof y!="string"&&!xr(y))if(typeof y.toString=="function"){if(y=y.toString(),typeof y!="string")throw Dt("dirty is not a string, aborting")}else throw Dt("toString is not a function");if(!e.isSupported)return y;if(cn||mn(h),e.removed=[],typeof y=="string"&&(Lt=!1),Lt){if(y.nodeName){const Ee=P(y.nodeName);if(!D[Ee]||Rt[Ee])throw Dt("root node is forbidden and cannot be sanitized in-place")}}else if(y instanceof a)f=wr("<!---->"),b=f.ownerDocument.importNode(y,!0),b.nodeType===zt.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?f=b:f.appendChild(b);else{if(!ct&&!lt&&!Ze&&y.indexOf("<")===-1)return N&&pi?N.createHTML(y):y;if(f=wr(y),!f)return ct?null:pi?Ve:""}f&&un&&ve(f.firstChild);const I=$r(Lt?y:f);for(;R=I.nextNode();)kr(R),_r(R),R.content instanceof r&&vl(R.content);if(Lt)return y;if(ct){if(di)for(q=nl.call(f.ownerDocument);f.firstChild;)q.appendChild(f.firstChild);else q=f;return(U.shadowroot||U.shadowrootmode)&&(q=rl.call(n,q,!0)),q}let ie=Ze?f.outerHTML:f.innerHTML;return Ze&&D["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&Y(Ua,f.ownerDocument.doctype.name)&&(ie="<!DOCTYPE "+f.ownerDocument.doctype.name+`>
|
|
754
|
+
`+ie),lt&&wi([sn,rn,on],Ee=>{ie=Nt(ie,Ee," ")}),N&&pi?N.createHTML(ie):ie},e.setConfig=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};mn(y),cn=!0},e.clearConfig=function(){dt=null,cn=!1},e.isValidAttribute=function(y,h,f){dt||mn({});const b=P(y),R=P(h);return Sr(b,R,f)},e.addHook=function(y,h){typeof h=="function"&&Mt(Z[y],h)},e.removeHook=function(y,h){if(h!==void 0){const f=Rh(Z[y],h);return f===-1?void 0:Lh(Z[y],f,1)[0]}return wo(Z[y])},e.removeHooks=function(y){Z[y]=[]},e.removeAllHooks=function(){Z=_o()},e}var Fa=za(),Yh=Object.defineProperty,Qh=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&Yh(e,t,s),s};const Vs=class Vs extends E{render(){return w`<div class="message-type-html">
|
|
755
|
+
${Eh(Fa.sanitize(this.message.content))}
|
|
756
|
+
</div>`}};Vs.styles=[O`
|
|
757
757
|
:host {
|
|
758
758
|
box-sizing: border-box;
|
|
759
759
|
}
|
|
@@ -787,11 +787,11 @@
|
|
|
787
787
|
height: auto;
|
|
788
788
|
object-fit: contain;
|
|
789
789
|
}
|
|
790
|
-
`];let
|
|
791
|
-
]`).replace("lheading",
|
|
790
|
+
`];let Fi=Vs;Qh([k({attribute:!1})],Fi.prototype,"message");function xs(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var rt=xs();function Ha(i){rt=i}var Vt={exec:()=>null};function _(i,e=""){let t=typeof i=="string"?i:i.source;const n={replace:(s,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(X.caret,"$1"),t=t.replace(s,o),n},getRegex:()=>new RegExp(t,e)};return n}var X={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:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i")},Xh=/^(?:[ \t]*(?:\n|$))+/,Kh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Jh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ui=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ed=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ks=/(?:[*+-]|\d{1,9}[.)])/,ja=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ba=_(ja).replace(/bull/g,ks).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(),td=_(ja).replace(/bull/g,ks).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(),Ss=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,id=/^[^\n]+/,Cs=/(?!\s*\])(?:\\.|[^\[\]\\])+/,nd=_(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Cs).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),sd=_(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ks).getRegex(),tn="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",_s=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,rd=_("^ {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",_s).replace("tag",tn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),qa=_(Ss).replace("hr",ui).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",tn).getRegex(),od=_(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",qa).getRegex(),Es={blockquote:od,code:Kh,def:nd,fences:Jh,heading:ed,hr:ui,html:rd,lheading:Ba,list:sd,newline:Xh,paragraph:qa,table:Vt,text:id},Eo=_("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ui).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",tn).getRegex(),ad={...Es,lheading:td,table:Eo,paragraph:_(Ss).replace("hr",ui).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Eo).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",tn).getRegex()},ld={...Es,html:_(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_s).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:Vt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_(Ss).replace("hr",ui).replace("heading",` *#{1,6} *[^
|
|
791
|
+
]`).replace("lheading",Ba).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},cd=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ud=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Va=/^( {2,}|\\)\n(?!\s*$)/,hd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,nn=/[\p{P}\p{S}]/u,As=/[\s\p{P}\p{S}]/u,Wa=/[^\s\p{P}\p{S}]/u,dd=_(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,As).getRegex(),Ga=/(?!~)[\p{P}\p{S}]/u,pd=/(?!~)[\s\p{P}\p{S}]/u,fd=/(?:[^\s\p{P}\p{S}]|~)/u,gd=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Za=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,md=_(Za,"u").replace(/punct/g,nn).getRegex(),vd=_(Za,"u").replace(/punct/g,Ga).getRegex(),Ya="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bd=_(Ya,"gu").replace(/notPunctSpace/g,Wa).replace(/punctSpace/g,As).replace(/punct/g,nn).getRegex(),yd=_(Ya,"gu").replace(/notPunctSpace/g,fd).replace(/punctSpace/g,pd).replace(/punct/g,Ga).getRegex(),wd=_("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Wa).replace(/punctSpace/g,As).replace(/punct/g,nn).getRegex(),$d=_(/\\(punct)/,"gu").replace(/punct/g,nn).getRegex(),xd=_(/^<(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(),kd=_(_s).replace("(?:-->|$)","-->").getRegex(),Sd=_("^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",kd).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Hi=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Cd=_(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Hi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Qa=_(/^!?\[(label)\]\[(ref)\]/).replace("label",Hi).replace("ref",Cs).getRegex(),Xa=_(/^!?\[(ref)\](?:\[\])?/).replace("ref",Cs).getRegex(),_d=_("reflink|nolink(?!\\()","g").replace("reflink",Qa).replace("nolink",Xa).getRegex(),Ts={_backpedal:Vt,anyPunctuation:$d,autolink:xd,blockSkip:gd,br:Va,code:ud,del:Vt,emStrongLDelim:md,emStrongRDelimAst:bd,emStrongRDelimUnd:wd,escape:cd,link:Cd,nolink:Xa,punctuation:dd,reflink:Qa,reflinkSearch:_d,tag:Sd,text:hd,url:Vt},Ed={...Ts,link:_(/^!?\[(label)\]\((.*?)\)/).replace("label",Hi).getRegex(),reflink:_(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Hi).getRegex()},ts={...Ts,emStrongRDelimAst:yd,emStrongLDelim:vd,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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ad={...ts,br:_(Va).replace("{2,}","*").getRegex(),text:_(ts.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},xi={normal:Es,gfm:ad,pedantic:ld},Ft={normal:Ts,gfm:ts,breaks:Ad,pedantic:Ed},Td={"&":"&","<":"<",">":">",'"':""","'":"'"},Ao=i=>Td[i];function we(i,e){if(e){if(X.escapeTest.test(i))return i.replace(X.escapeReplace,Ao)}else if(X.escapeTestNoEncode.test(i))return i.replace(X.escapeReplaceNoEncode,Ao);return i}function To(i){try{i=encodeURI(i).replace(X.percentDecode,"%")}catch{return null}return i}function Oo(i,e){var r;const t=i.replace(X.findPipe,(o,a,l)=>{let c=!1,u=a;for(;--u>=0&&l[u]==="\\";)c=!c;return c?"|":" |"}),n=t.split(X.splitPipe);let s=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(;s<n.length;s++)n[s]=n[s].trim().replace(X.slashPipe,"|");return n}function Ht(i,e,t){const n=i.length;if(n===0)return"";let s=0;for(;s<n&&i.charAt(n-s-1)===e;)s++;return i.slice(0,n-s)}function Od(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<i.length;n++)if(i[n]==="\\")n++;else if(i[n]===e[0])t++;else if(i[n]===e[1]&&(t--,t<0))return n;return t>0?-2:-1}function Ro(i,e,t,n,s){const r=e.href,o=e.title||null,a=i[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;const l={type:i[0].charAt(0)==="!"?"image":"link",raw:t,href:r,title:o,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,l}function Rd(i,e,t){const n=i.match(t.other.indentCodeCompensation);if(n===null)return e;const s=n[1];return e.split(`
|
|
792
792
|
`).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(`
|
|
793
|
-
`)}var
|
|
794
|
-
`)}}}fences(i){const e=this.rules.block.fences.exec(i);if(e){const t=e[0],n=
|
|
793
|
+
`)}var ji=class{constructor(i){A(this,"options");A(this,"rules");A(this,"lexer");this.options=i||rt}space(i){const e=this.rules.block.newline.exec(i);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(i){const e=this.rules.block.code.exec(i);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Ht(t,`
|
|
794
|
+
`)}}}fences(i){const e=this.rules.block.fences.exec(i);if(e){const t=e[0],n=Rd(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:n}}}heading(i){const e=this.rules.block.heading.exec(i);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const n=Ht(t,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(t=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(i){const e=this.rules.block.hr.exec(i);if(e)return{type:"hr",raw:Ht(e[0],`
|
|
795
795
|
`)}}blockquote(i){const e=this.rules.block.blockquote.exec(i);if(e){let t=Ht(e[0],`
|
|
796
796
|
`).split(`
|
|
797
797
|
`),n="",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(`
|
|
@@ -806,13 +806,13 @@ ${u}`:u;const p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
806
806
|
`);continue}}return{type:"blockquote",raw:n,tokens:r,text:s}}}list(i){let e=this.rules.block.list.exec(i);if(e){let t=e[1].trim();const n=t.length>1,s={type:"list",raw:"",ordered:n,start:n?+t.slice(0,-1):"",loose:!1,items:[]};t=n?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=n?t:"[*+-]");const r=this.rules.other.listItemRegex(t);let o=!1;for(;i;){let l=!1,c="",u="";if(!(e=r.exec(i))||this.rules.block.hr.test(i))break;c=e[0],i=i.substring(c.length);let p=e[2].split(`
|
|
807
807
|
`,1)[0].replace(this.rules.other.listReplaceTabs,G=>" ".repeat(3*G.length)),d=i.split(`
|
|
808
808
|
`,1)[0],g=!p.trim(),v=0;if(this.options.pedantic?(v=2,u=p.trimStart()):g?v=e[1].length+1:(v=e[2].search(this.rules.other.nonSpaceChar),v=v>4?1:v,u=p.slice(v),v+=e[1].length),g&&this.rules.other.blankLine.test(d)&&(c+=d+`
|
|
809
|
-
`,i=i.substring(d.length+1),l=!0),!l){const G=this.rules.other.nextBulletRegex(v),Ue=this.rules.other.hrRegex(v),
|
|
810
|
-
`,1)[0];let
|
|
811
|
-
`+
|
|
812
|
-
`+d}!g&&!d.trim()&&(g=!0),c+=
|
|
813
|
-
`,i=i.substring(
|
|
814
|
-
`):[],r={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===n.length){for(const a of n)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(
|
|
815
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(i){const e=this.rules.block.text.exec(i);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(i){const e=this.rules.inline.escape.exec(i);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(i){const e=this.rules.inline.tag.exec(i);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(i){const e=this.rules.inline.link.exec(i);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=Ht(t.slice(0,-1),"\\");if((t.length-r.length)%2===0)return}else{const r=
|
|
809
|
+
`,i=i.substring(d.length+1),l=!0),!l){const G=this.rules.other.nextBulletRegex(v),Ue=this.rules.other.hrRegex(v),qe=this.rules.other.fencesBeginRegex(v),N=this.rules.other.headingBeginRegex(v),Ve=this.rules.other.htmlBeginRegex(v);for(;i;){const We=i.split(`
|
|
810
|
+
`,1)[0];let Ge;if(d=We,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),Ge=d):Ge=d.replace(this.rules.other.tabCharGlobal," "),qe.test(d)||N.test(d)||Ve.test(d)||G.test(d)||Ue.test(d))break;if(Ge.search(this.rules.other.nonSpaceChar)>=v||!d.trim())u+=`
|
|
811
|
+
`+Ge.slice(v);else{if(g||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||qe.test(p)||N.test(p)||Ue.test(p))break;u+=`
|
|
812
|
+
`+d}!g&&!d.trim()&&(g=!0),c+=We+`
|
|
813
|
+
`,i=i.substring(We.length+1),p=Ge.slice(v)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0));let m=null,W;this.options.gfm&&(m=this.rules.other.listIsTask.exec(u),m&&(W=m[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:c,task:!!m,checked:W,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(i){const e=this.rules.block.html.exec(i);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(i){const e=this.rules.block.def.exec(i);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=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:n,title:s}}}table(i){var o;const e=this.rules.block.table.exec(i);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const t=Oo(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
814
|
+
`):[],r={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===n.length){for(const a of n)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(Oo(a,r.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:r.align[c]})));return r}}lheading(i){const e=this.rules.block.lheading.exec(i);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(i){const e=this.rules.block.paragraph.exec(i);if(e){const t=e[1].charAt(e[1].length-1)===`
|
|
815
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(i){const e=this.rules.block.text.exec(i);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(i){const e=this.rules.inline.escape.exec(i);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(i){const e=this.rules.inline.tag.exec(i);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(i){const e=this.rules.inline.link.exec(i);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=Ht(t.slice(0,-1),"\\");if((t.length-r.length)%2===0)return}else{const r=Od(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 n=e[2],s="";if(this.options.pedantic){const r=this.rules.other.pedanticHrefTitle.exec(n);r&&(n=r[1],s=r[3])}else s=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?n=n.slice(1):n=n.slice(1,-1)),Ro(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(i,e){let t;if((t=this.rules.inline.reflink.exec(i))||(t=this.rules.inline.nolink.exec(i))){const n=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[n.toLowerCase()];if(!s){const r=t[0].charAt(0);return{type:"text",raw:r,text:r}}return Ro(t,s,t[0],this.lexer,this.rules)}}emStrong(i,e,t=""){let n=this.rules.inline.emStrongLDelim.exec(i);if(!n||n[3]&&t.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!t||this.rules.inline.punctuation.exec(t)){const r=[...n[0]].length-1;let o,a,l=r,c=0;const u=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*i.length+r);(n=u.exec(e))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(a=[...o].length,n[3]||n[4]){l+=a;continue}else if((n[5]||n[6])&&r%3&&!((r+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);const p=[...n[0]][0].length,d=i.slice(0,r+n.index+p+a);if(Math.min(r,a)%2){const v=d.slice(1,-1);return{type:"em",raw:d,text:v,tokens:this.lexer.inlineTokens(v)}}const g=d.slice(2,-2);return{type:"strong",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(i){const e=this.rules.inline.code.exec(i);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return n&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(i){const e=this.rules.inline.br.exec(i);if(e)return{type:"br",raw:e[0]}}del(i){const e=this.rules.inline.del.exec(i);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(i){const e=this.rules.inline.autolink.exec(i);if(e){let t,n;return e[2]==="@"?(t=e[1],n="mailto:"+t):(t=e[1],n=t),{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}url(i){var t;let e;if(e=this.rules.inline.url.exec(i)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;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]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(i){const e=this.rules.inline.text.exec(i);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},Oe=class is{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||rt,this.options.tokenizer=this.options.tokenizer||new ji,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:X,block:xi.normal,inline:Ft.normal};this.options.pedantic?(t.block=xi.pedantic,t.inline=Ft.pedantic):this.options.gfm&&(t.block=xi.gfm,this.options.breaks?t.inline=Ft.breaks:t.inline=Ft.gfm),this.tokenizer.rules=t}static get rules(){return{block:xi,inline:Ft}}static lex(e,t){return new is(t).lex(e)}static lexInline(e,t){return new is(t).inlineTokens(e)}lex(e){e=e.replace(X.carriageReturn,`
|
|
816
816
|
`),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 s,r,o;for(this.options.pedantic&&(e=e.replace(X.tabCharGlobal," ").replace(X.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+=`
|
|
817
817
|
`: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+=`
|
|
818
818
|
`+a.raw,c.text+=`
|
|
@@ -822,16 +822,16 @@ ${u}`:u;const p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
822
822
|
`+a.raw,c.text+=`
|
|
823
823
|
`+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+=`
|
|
824
824
|
`+a.raw,c.text+=`
|
|
825
|
-
`+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,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(n))!=null;)u.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.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,n,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 v;this.options.extensions.startInline.forEach(m=>{v=m.call({lexer:this},g),typeof v=="number"&&v>=0&&(d=Math.min(d,v))}),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}},
|
|
826
|
-
`;return n?'<pre><code class="language-'+
|
|
827
|
-
`:"<pre><code>"+(t?s:
|
|
825
|
+
`+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,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(n))!=null;)u.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.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,n,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 v;this.options.extensions.startInline.forEach(m=>{v=m.call({lexer:this},g),typeof v=="number"&&v>=0&&(d=Math.min(d,v))}),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}},ei=class{constructor(i){A(this,"options");A(this,"parser");this.options=i||rt}space(i){return""}code({text:i,lang:e,escaped:t}){var r;const n=(r=(e||"").match(X.notSpaceStart))==null?void 0:r[0],s=i.replace(X.endingNewline,"")+`
|
|
826
|
+
`;return n?'<pre><code class="language-'+we(n)+'">'+(t?s:we(s,!0))+`</code></pre>
|
|
827
|
+
`:"<pre><code>"+(t?s:we(s,!0))+`</code></pre>
|
|
828
828
|
`}blockquote({tokens:i}){return`<blockquote>
|
|
829
829
|
${this.parser.parse(i)}</blockquote>
|
|
830
830
|
`}html({text:i}){return i}heading({tokens:i,depth:e}){return`<h${e}>${this.parser.parseInline(i)}</h${e}>
|
|
831
831
|
`}hr(i){return`<hr>
|
|
832
832
|
`}list(i){const e=i.ordered,t=i.start;let n="";for(let o=0;o<i.items.length;o++){const a=i.items[o];n+=this.listitem(a)}const s=e?"ol":"ul",r=e&&t!==1?' start="'+t+'"':"";return"<"+s+r+`>
|
|
833
833
|
`+n+"</"+s+`>
|
|
834
|
-
`}listitem(i){var t;let e="";if(i.task){const n=this.checkbox({checked:!!i.checked});i.loose?((t=i.tokens[0])==null?void 0:t.type)==="paragraph"?(i.tokens[0].text=n+" "+i.tokens[0].text,i.tokens[0].tokens&&i.tokens[0].tokens.length>0&&i.tokens[0].tokens[0].type==="text"&&(i.tokens[0].tokens[0].text=n+" "+
|
|
834
|
+
`}listitem(i){var t;let e="";if(i.task){const n=this.checkbox({checked:!!i.checked});i.loose?((t=i.tokens[0])==null?void 0:t.type)==="paragraph"?(i.tokens[0].text=n+" "+i.tokens[0].text,i.tokens[0].tokens&&i.tokens[0].tokens.length>0&&i.tokens[0].tokens[0].type==="text"&&(i.tokens[0].tokens[0].text=n+" "+we(i.tokens[0].tokens[0].text),i.tokens[0].tokens[0].escaped=!0)):i.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(i.tokens,!!i.loose),`<li>${e}</li>
|
|
835
835
|
`}checkbox({checked:i}){return"<input "+(i?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:i}){return`<p>${this.parser.parseInline(i)}</p>
|
|
836
836
|
`}table(i){let e="",t="";for(let s=0;s<i.header.length;s++)t+=this.tablecell(i.header[s]);e+=this.tablerow({text:t});let n="";for(let s=0;s<i.rows.length;s++){const r=i.rows[s];t="";for(let o=0;o<r.length;o++)t+=this.tablecell(r[o]);n+=this.tablerow({text:t})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
837
837
|
<thead>
|
|
@@ -840,18 +840,18 @@ ${this.parser.parse(i)}</blockquote>
|
|
|
840
840
|
`}tablerow({text:i}){return`<tr>
|
|
841
841
|
${i}</tr>
|
|
842
842
|
`}tablecell(i){const e=this.parser.parseInline(i.tokens),t=i.header?"th":"td";return(i.align?`<${t} align="${i.align}">`:`<${t}>`)+e+`</${t}>
|
|
843
|
-
`}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${
|
|
844
|
-
`+this.renderer.text(c);t?n+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):n+=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 n}parseInline(e,t=this.renderer){var s,r;let n="";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)){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}},
|
|
845
|
-
Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An error occurred:</p><pre>"+
|
|
846
|
-
<div class="message-type-markdown" ${
|
|
843
|
+
`}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${we(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:e,tokens:t}){const n=this.parser.parseInline(t),s=To(i);if(s===null)return n;i=s;let r='<a href="'+i+'"';return e&&(r+=' title="'+we(e)+'"'),r+=">"+n+"</a>",r}image({href:i,title:e,text:t,tokens:n}){n&&(t=this.parser.parseInline(n,this.parser.textRenderer));const s=To(i);if(s===null)return we(t);i=s;let r=`<img src="${i}" alt="${t}"`;return e&&(r+=` title="${we(e)}"`),r+=">",r}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:we(i.text)}},Os=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}},Re=class ns{constructor(e){A(this,"options");A(this,"renderer");A(this,"textRenderer");this.options=e||rt,this.options.renderer=this.options.renderer||new ei,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Os}static parse(e,t){return new ns(t).parse(e)}static parseInline(e,t){return new ns(t).parseInline(e)}parse(e,t=!0){var s,r;let n="";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)){n+=u||"";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,u=this.renderer.text(c);for(;o+1<e.length&&e[o+1].type==="text";)c=e[++o],u+=`
|
|
844
|
+
`+this.renderer.text(c);t?n+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):n+=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 n}parseInline(e,t=this.renderer){var s,r;let n="";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)){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}},Nn,_i=(Nn=class{constructor(i){A(this,"options");A(this,"block");this.options=i||rt}preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}provideLexer(){return this.block?Oe.lex:Oe.lexInline}provideParser(){return this.block?Re.parse:Re.parseInline}},A(Nn,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Nn),Ld=class{constructor(...i){A(this,"defaults",xs());A(this,"options",this.setOptions);A(this,"parse",this.parseMarkdown(!0));A(this,"parseInline",this.parseMarkdown(!1));A(this,"Parser",Re);A(this,"Renderer",ei);A(this,"TextRenderer",Os);A(this,"Lexer",Oe);A(this,"Tokenizer",ji);A(this,"Hooks",_i);this.use(...i)}walkTokens(i,e){var n,s;let t=[];for(const r of i)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=(n=this.defaults.extensions)==null?void 0:n.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(...i){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(t=>{const n={...t};if(n.async=this.defaults.async||n.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)}),n.extensions=e),t.renderer){const s=this.defaults.renderer||new ei(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||""}}n.renderer=s}if(t.tokenizer){const s=this.defaults.tokenizer||new ji(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}}n.tokenizer=s}if(t.hooks){const s=this.defaults.hooks||new _i;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];_i.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}}n.hooks=s}if(t.walkTokens){const s=this.defaults.walkTokens,r=t.walkTokens;n.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,...n}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,e){return Oe.lex(i,e??this.defaults)}parser(i,e){return Re.parse(i,e??this.defaults)}parseMarkdown(i){return(t,n)=>{const s={...n},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=i);const a=r.hooks?r.hooks.provideLexer():i?Oe.lex:Oe.lexInline,l=r.hooks?r.hooks.provideParser():i?Re.parse:Re.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(i,e){return t=>{if(t.message+=`
|
|
845
|
+
Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An error occurred:</p><pre>"+we(t.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(t);throw t}}},st=new Ld;function S(i,e){return st.parse(i,e)}S.options=S.setOptions=function(i){return st.setOptions(i),S.defaults=st.defaults,Ha(S.defaults),S};S.getDefaults=xs;S.defaults=rt;S.use=function(...i){return st.use(...i),S.defaults=st.defaults,Ha(S.defaults),S};S.walkTokens=function(i,e){return st.walkTokens(i,e)};S.parseInline=st.parseInline;S.Parser=Re;S.parser=Re.parse;S.Renderer=ei;S.TextRenderer=Os;S.Lexer=Oe;S.lexer=Oe.lex;S.Tokenizer=ji;S.Hooks=_i;S.parse=S;S.options;S.setOptions;S.use;S.walkTokens;S.parseInline;Re.parse;Oe.lex;var Id=Object.defineProperty,Ka=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&Id(e,t,s),s};const Ja=new ei;Ja.link=function({href:i,title:e,text:t}){return e??(e=t),`<a target="_blank" href="${i}" title="${e}">${t}</a>`};S.use({renderer:Ja});const Ws=class Ws extends E{constructor(){super(...arguments),this.showLightbox=!1,this.imageUrl="",this.altText="",this.scrollRef=$e(),this.contentRef=$e(),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 o,a;const e=this.getLastChunk();if(!e)return;if(this.buffer+=e,this.includesImage(this.buffer))(o=this.contentRef.value)==null||o.appendChild(document.createElement("div")),this.buffer="";else if(this.buffer.includes("!["))return;const t=S.parse(this.buffer),n=Hn(t),s=Fa.sanitize(n,{ADD_ATTR:["target"]}),r=(a=this.contentRef.value)==null?void 0:a.querySelector("div:last-of-type");r&&(r.innerHTML=s,this.applyCodeStyles(r)),this.autoScroll&&this.scrollRef.value.scrollIntoView()}applyCodeStyles(e){if(!e)return;e.querySelectorAll("code").forEach(n=>{n.style.whiteSpace="pre-wrap"})}render(){return w`
|
|
846
|
+
<div class="message-type-markdown" ${xe(this.contentRef)}>
|
|
847
847
|
<div></div>
|
|
848
848
|
</div>
|
|
849
|
-
<div class="scroll" ${
|
|
850
|
-
${this.showLightbox
|
|
849
|
+
<div class="scroll" ${xe(this.scrollRef)}></div>
|
|
850
|
+
${this.showLightbox?w`<ace-lightbox
|
|
851
851
|
imageUrl="${this.imageUrl}"
|
|
852
852
|
altText="${this.altText}"
|
|
853
853
|
/>`:null}
|
|
854
|
-
`}};
|
|
854
|
+
`}};Ws.styles=[O`
|
|
855
855
|
:host {
|
|
856
856
|
box-sizing: border-box;
|
|
857
857
|
}
|
|
@@ -889,16 +889,16 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
889
889
|
height: auto;
|
|
890
890
|
object-fit: contain;
|
|
891
891
|
}
|
|
892
|
-
`];let
|
|
892
|
+
`];let ti=Ws;Ka([k({attribute:!1})],ti.prototype,"message");Ka([T()],ti.prototype,"showLightbox");var Pd=Object.defineProperty,Md=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&Pd(e,t,s),s};const Gs=class Gs 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 n=t[0],s=t[t.length-1];e.shiftKey?e.target===n&&(s.focus(),e.preventDefault()):e.target===s&&(n.focus(),e.preventDefault())}}}render(){return w`<div
|
|
893
893
|
class="lightbox"
|
|
894
894
|
tabindex="-1"
|
|
895
895
|
@keydown=${this.handleKeyDown}
|
|
896
896
|
>
|
|
897
897
|
<button class="close" @click=${this.closeLightbox}>
|
|
898
|
-
<telia-icon svg=${
|
|
898
|
+
<telia-icon svg=${Yc.svg} size="lg"></telia-icon>
|
|
899
899
|
</button>
|
|
900
900
|
<img src="${this.imageUrl}" alt="${this.altText??""}" />
|
|
901
|
-
</div> `}};
|
|
901
|
+
</div> `}};Gs.styles=[O`
|
|
902
902
|
:focus {
|
|
903
903
|
outline-color: var(--focus-color);
|
|
904
904
|
}
|
|
@@ -936,50 +936,50 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
936
936
|
width: 80%;
|
|
937
937
|
max-width: 700px;
|
|
938
938
|
}
|
|
939
|
-
`];let
|
|
940
|
-
${this.showAuthBanner
|
|
939
|
+
`];let Bi=Gs;Md([k({attribute:!0})],Bi.prototype,"imageUrl");var Nd=Object.defineProperty,ge=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&Nd(e,t,s),s};customElements.get("conversation-entry")||customElements.define("conversation-entry",Kt);customElements.get("ace-conversation-feed")||customElements.define("ace-conversation-feed",Jt);customElements.get("conversation-group")||customElements.define("conversation-group",zi);customElements.get("ace-typing-state")||customElements.define("ace-typing-state",Qn);customElements.get("message-type-html")||customElements.define("message-type-html",Fi);customElements.get("message-type-markdown")||customElements.define("message-type-markdown",ti);customElements.get("ace-lightbox")||customElements.define("ace-lightbox",Bi);const Lo=Ra(E),Zs=class Zs extends Lo{constructor(){super(...arguments),this.platform=null,this.entries=[],this.typing=!1,this.message="",this.disabledInput=!1,this.disabledSkipToLatest=!1,this.disabledSubmit=!1,this.chatOverlayActive=!1,this.textAreaLength=0,this.showAuthBanner=!1,this.authenticated=!1,this.isMuted=!1,this.isKeyboardNavigation=!1,this.conversationContentRef=$e(),this.conversationFeedRef=$e(),this.formRef=$e(),this.inputRef=$e(),this.scrollRef=$e(),this.counterRef=$e(),this.chatCurrentScrollPosition=0,this.toast=new yh(this),this.messageMaxLength=1e3,this.messageMaxLengthLabel="Maximum character limit reached",this.skipToLatestMessageLabel="Skip to latest message",this.conversationState$=new fe("waiting"),this.stateMachine=new $h(this.conversationState$,this),this.provider$=this.stateMachine.session().pipe(Pe(e=>e?e==null?void 0:e.provider$:zn(null))),this.userTyping$=new M}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(F(t.componentIsDestroyed$)).subscribe(n=>{const s=this.conversationContentRef.value;s&&(n?s.scrollTop=this.chatCurrentScrollPosition:this.chatCurrentScrollPosition=s.scrollTop)}),this.stateSubscription=lc([this.stateMachine.entries(),this.stateMachine.isTyping()]).subscribe(([n,s])=>{this.entries=n,this.typing=s}),this.userSubmitSubscription=Oi(this,"user-submit").pipe(Fn(this.provider$)).subscribe(([n,s])=>{s&&s.onUserSubmit(n.detail)}),this.addHeaderOptions(),this.provider$.pipe(Fn(this.provider$)).subscribe(([n,s])=>{s&&s.showChatOverlay$.pipe().subscribe(r=>{this.chatOverlayActive=r})})}firstUpdated(){this.isMuted=this.application.storage.get("muteAudioNotifications")??!1}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 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;(!this.isTypingState()||this.isAtBottom())&&(setTimeout(()=>{var t;return(t=this.scrollRef.value)==null?void 0:t.scrollIntoView({behavior:"smooth"})},300),this.chatCurrentScrollPosition=(e=this.scrollRef.value)==null?void 0:e.scrollTop)}onSessionUpdated(){this.scrollToBottom()}async onSendMessage(e){var n,s;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,(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,n=t.getOrFallback("conversation.mute","Mute"),s=t.getOrFallback("conversation.unmute","Unmute"),r=e.addOption({label:this.isMuted?s:n,icon:this.isMuted?Gr.svg:Zr.svg,closeOnClick:!1,datatestid:"options-mute-button",onClick:()=>{this.isMuted?(this.isMuted=!1,this.application.unmute(),r.updateLabel(n),r.updateIcon(Zr.svg)):(this.isMuted=!0,this.application.mute(),r.updateLabel(s),r.updateIcon(Gr.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==="Tab"&&(this.isKeyboardNavigation=!0),e.key==="Enter"&&!e.shiftKey&&!this.disabledSubmit&&(this.onSendMessage(e),e.preventDefault())}mouseDownHandler(e){e.target===this.inputRef.value&&(this.isKeyboardNavigation=!1)}focusHandler(){this.isKeyboardNavigation&&this.inputRef.value&&this.inputRef.value.classList.add("keyboard-focused")}blurHandler(){this.inputRef.value&&this.inputRef.value.classList.remove("keyboard-focused")}getAuthBannerMessage(){const e=this.application.texts;return this.authenticated?e.getOrFallback("conversation.auth-banner.authenticated","Authenticated"):e.getOrFallback("conversation.auth-banner.unauthenticated","Not authenticated")}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"),n=t==null?void 0:t.querySelectorAll(".conversation-entry");n==null||n.forEach(o=>o.remove())}setToastMessage(e){this.toast.message=e}skipToLatestMessage(){var n,s;const e=(n=this.conversationFeedRef)==null?void 0:n.value,t=(s=e==null?void 0:e.shadowRoot)==null?void 0:s.querySelectorAll(".conversation-entry");t.length&&Array.from(t).pop().focus()}setAuthenticationBannerStatus(e){this.showAuthBanner=e!==null,this.authenticated=e===j.Authenticated}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||Ie}render(){var n,s,r,o;const e=this.application.texts;return this.conversationState$.value==="waiting"&&((n=this.application)!=null&&n.storage)&&this.platform&&(this.stateMachine.setStorage(this.application.storage),this.conversationState$.next("init")),(((o=(r=(s=this.application.settings)==null?void 0:s.agentConfig)==null?void 0:r.live)==null?void 0:o.isThirdPartyWidget)??!1)&&(this.renderRoot.host.style.width="100%"),w` <div class="conversation-container">
|
|
940
|
+
${this.showAuthBanner?w`<div
|
|
941
941
|
class="auth-banner ${this.authenticated?"auth-banner--authenticated":"auth-banner--unauthenticated"}"
|
|
942
942
|
role="status"
|
|
943
943
|
aria-live="polite"
|
|
944
944
|
>
|
|
945
|
-
${this.authenticated
|
|
945
|
+
${this.authenticated?w`<telia-icon
|
|
946
946
|
class="auth-banner__icon"
|
|
947
947
|
size="sm"
|
|
948
|
-
svg=${
|
|
949
|
-
></telia-icon
|
|
948
|
+
svg=${la.svg}
|
|
949
|
+
></telia-icon>`:$}
|
|
950
950
|
<span>${this.getAuthBannerMessage()}</span>
|
|
951
|
-
</div
|
|
951
|
+
</div>`:$}
|
|
952
952
|
<div
|
|
953
953
|
@action=${this.actionHandler}
|
|
954
|
-
class=${
|
|
954
|
+
class=${Ct({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})}
|
|
955
955
|
>
|
|
956
|
-
${this.chatOverlayActive
|
|
956
|
+
${this.chatOverlayActive?w`<div class="overlay-header">
|
|
957
957
|
<button
|
|
958
958
|
class="overlay-button"
|
|
959
959
|
@click=${()=>this.chatOverlayActive=!1}
|
|
960
960
|
>
|
|
961
|
-
<telia-icon svg=${
|
|
961
|
+
<telia-icon svg=${ca.svg}></telia-icon>
|
|
962
962
|
</button>
|
|
963
|
-
</div
|
|
963
|
+
</div>`:$}
|
|
964
964
|
<div
|
|
965
|
-
class=${
|
|
965
|
+
class=${Ct({"conversation-content":!0,"conversation-overlay-mode":this.chatOverlayActive})}
|
|
966
966
|
part="scroll-container"
|
|
967
967
|
aria-live="polite"
|
|
968
|
-
${
|
|
968
|
+
${xe(this.conversationContentRef)}
|
|
969
969
|
>
|
|
970
|
-
${this.toast.hasMessage()
|
|
970
|
+
${this.toast.hasMessage()?w`<div class="conversation__toast">${this.toast.message}</div>`:$}
|
|
971
971
|
<ace-conversation-feed
|
|
972
972
|
.entries=${this.entries}
|
|
973
973
|
.loading=${this.typing}
|
|
974
|
-
${
|
|
974
|
+
${xe(this.conversationFeedRef)}
|
|
975
975
|
@updated=${this.onSessionUpdated}
|
|
976
976
|
></ace-conversation-feed>
|
|
977
|
-
<div class="scroll" ${
|
|
977
|
+
<div class="scroll" ${xe(this.scrollRef)}></div>
|
|
978
978
|
</div>
|
|
979
979
|
<form
|
|
980
980
|
class="conversation-bottom"
|
|
981
981
|
@submit=${this.onSendMessage}
|
|
982
|
-
${
|
|
982
|
+
${xe(this.formRef)}
|
|
983
983
|
?inert=${this.disabledInput}
|
|
984
984
|
data-testid="conversation-bottom"
|
|
985
985
|
>
|
|
@@ -997,7 +997,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
997
997
|
@mousedown=${this.mouseDownHandler}
|
|
998
998
|
@focus=${this.focusHandler}
|
|
999
999
|
@blur=${this.blurHandler}
|
|
1000
|
-
${
|
|
1000
|
+
${xe(this.inputRef)}
|
|
1001
1001
|
aria-valuenow=${this.textAreaLength}
|
|
1002
1002
|
aria-valuemax=${this.messageMaxLength}
|
|
1003
1003
|
aria-valuemin="0"
|
|
@@ -1011,9 +1011,9 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1011
1011
|
data-testid="send-message-button"
|
|
1012
1012
|
title=${e.getOrFallback("conversation.send-alt","Send")}
|
|
1013
1013
|
>
|
|
1014
|
-
<telia-icon svg=${
|
|
1014
|
+
<telia-icon svg=${ua.svg}></telia-icon>
|
|
1015
1015
|
</button>
|
|
1016
|
-
<span class="counter" ${
|
|
1016
|
+
<span class="counter" ${xe(this.counterRef)}>
|
|
1017
1017
|
${this.textAreaLength} / ${this.messageMaxLength}</span
|
|
1018
1018
|
>
|
|
1019
1019
|
</div>
|
|
@@ -1021,14 +1021,14 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1021
1021
|
${this.textAreaLength>this.messageMaxLength?this.messageMaxLengthLabel:""}
|
|
1022
1022
|
</div>
|
|
1023
1023
|
</form>
|
|
1024
|
-
${this.disabledSkipToLatest
|
|
1024
|
+
${this.disabledSkipToLatest?$:w`<button
|
|
1025
1025
|
class="skip-to-latest-message-button"
|
|
1026
1026
|
@click=${this.skipToLatestMessage}
|
|
1027
1027
|
>
|
|
1028
1028
|
${this.skipToLatestMessageLabel}
|
|
1029
1029
|
</button>`}
|
|
1030
1030
|
</div>
|
|
1031
|
-
</div>`}};
|
|
1031
|
+
</div>`}};Zs.styles=[Lo.styles||[],O`
|
|
1032
1032
|
/* ===== HOST & GLOBAL STYLES ===== */
|
|
1033
1033
|
:host {
|
|
1034
1034
|
font-family: var(--font-family);
|
|
@@ -1367,17 +1367,17 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1367
1367
|
width: 100%;
|
|
1368
1368
|
}
|
|
1369
1369
|
}
|
|
1370
|
-
`];let re=qs;ge([T()],re.prototype,"platform");ge([T()],re.prototype,"entries");ge([T()],re.prototype,"typing");ge([T()],re.prototype,"message");ge([T()],re.prototype,"disabledInput");ge([T()],re.prototype,"disabledSkipToLatest");ge([T()],re.prototype,"disabledSubmit");ge([T()],re.prototype,"chatOverlayActive");ge([T()],re.prototype,"textAreaLength");ge([T()],re.prototype,"showAuthBanner");ge([T()],re.prototype,"authenticated");const ve=i=>i.objectType==="info",Nd=i=>i.objectType==="chatEntry",Ud=i=>i.objectType==="pen",Dd=i=>i.objectType==="chatButtonClicked",zd=i=>i.objectType==="endVideoButtonClicked",Hd=i=>i.type==="queue-status",Fd=i=>i.type==="established",jd=i=>i.type==="pen-status",Bd=i=>i.type==="prepareVideo",qd=i=>i.type==="videoPrepared",Vd=i=>i.type==="chatButtonClicked",Wd=i=>i.type==="endVideoButtonClicked",Gd=i=>i.type==="chat-ended";var pe=(i=>(i.Initial="initial",i.Error="error",i.Retry="retry",i.InitError="init-error",i))(pe||{});class Ae extends Error{constructor(e,t,n){super(n||(t==null?void 0:t.message)||"Unknown engine error"),this.errorType=e,this.originalError=t}}class Es{constructor(e){this.endpoint=e,this.protocolVersion="A",this.timeout=2e4,this.penStatusJustSent=!1}async chatJoin(e){var n,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(!((n=t==null?void 0:t.dataObjects)!=null&&n.length)||(s=t==null?void 0:t.dataObjects)!=null&&s.some(o=>o.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,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:((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)||"",sourceUrl:((s=window==null?void 0:window.location)==null?void 0:s.href)||"",...e.authToken&&{authToken:e.authToken}});if(!((r=t==null?void 0:t.dataObjects)!=null&&r.length)||(o=t==null?void 0:t.dataObjects)!=null&&o.some(l=>l.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((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 isOpenEntrance(e){var s;const t=await this.sendRequest("isOpenEntrance",{uid:e.uid,instance:e.instance,entrance:e.entrance,protocolVersion:this.protocolVersion}),n=(s=t==null?void 0:t.dataObjects)==null?void 0:s[0];return{open:(n==null?void 0:n.open)??!1,result:(n==null?void 0:n.result)??"error"}}async sendRequest(e,t){const n=this.endpoint.includes("engine-simulator")?"include":void 0,s=`${Es.removeTrailingSlashes(this.endpoint)}/${e}`,r=await fetch(s,{body:new URLSearchParams(t),method:"POST",credentials:n,headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"*/*"},signal:AbortSignal.timeout(this.timeout)});return Number(r.headers.get("content-length"))>0?r.json():{}}static removeTrailingSlashes(e){return e.replace(/\/+$/,"")}}const Zd=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+i/4).toString(16)),As=()=>typeof crypto.randomUUID=="function"?crypto.randomUUID():Zd();function es(i){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)}function Ja(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Yd(i){return decodeURIComponent(atob(i).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""))}class Qd{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??As(),this.client=new Es(this.config.engineUrl)}chatJoin(e){return Xe(this.client.chatJoin({invitationUid:e.invitationUid,uid:this.sessionId,customerName:e.customerName,instance:this.config.instance,videoChatMode:this.config.videoChatMode})).pipe(vt(t=>bn(()=>new Ae("chat-join-error",t))),Ie(()=>this.poll().pipe(yn(()=>this.poll()),$n())))}chatRequest(e){return Xe(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(vt(t=>bn(()=>new Ae("chat-request-error",t))),Ie(()=>this.poll().pipe(yn(()=>this.poll()),$n())))}reconnect(){return this.poll().pipe(yn(()=>this.poll()),$n(),vt(e=>bn(()=>new Ae("chat-engine-error",e))))}poll(){return hc(()=>Xe(this.client.chatRead({uid:this.sessionId,instance:this.config.instance,entrance:this.config.entrance,maxObjectId:this.lastObjectId})).pipe(yc(e=>{const t=e==null?void 0:e.dataObjects.find(n=>ve(n)&&n.infoType==="error");if(t)throw new Ae("chat-engine-error",void 0,t.text||"Chat engine error occurred");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(s=>ve(s)&&s.infoType==="error");if(n)throw new Ae("chat-write-error",void 0,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}),n=((t==null?void 0:t.dataObjects)||[]).find(s=>ve(s)&&s.infoType==="error");if(n)throw new Ae("chat-email-session-error",void 0,n.text||"Unable to send email with conversation")}async isOpenEntrance(e){const t=await this.client.isOpenEntrance({uid:this.sessionId,instance:this.config.instance,entrance:e});if(t.result!=="ok")throw new Ae("chat-is-open-error",void 0,"Failed to check if entrance is open");return t.open}processMessages(e){e.dataObjects.forEach(t=>{Nd(t)&&t.source&&t.objectId>=this.lastObjectId&&this.messageSubject$.next({text:t.message,source:t.source,invitationNo:t.invitationNo.toString(),alias:t.alias||t.agentAlias}),Ud(t)&&this.actionsSubject$.next({penStatus:t.penStatus,type:"pen-status"}),ve(t)&&t.infoType==="queue"&&this.actionsSubject$.next({text:t.text,type:"queue-status"}),ve(t)&&t.infoType==="established"&&this.actionsSubject$.next({text:t.text,agentAlias:t.agentAlias,type:"established",videoEnded:t.videoEnded,contactId:t.contactId,agentUsername:t.agentUsername,entrance:t.entrance,errand:t.errand}),ve(t)&&t.infoType==="prepareVideo"&&this.actionsSubject$.next({type:"prepareVideo"}),ve(t)&&t.infoType==="videoPrepared"&&this.actionsSubject$.next({text:t.text,agent:t.agent,type:"videoPrepared",userUrl:t.userUrl}),Dd(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"chatButtonClicked"}),zd(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"endVideoButtonClicked"}),ve(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(ve(n))switch(n.infoType){case"startup":case"queue":case"placedInQueue":case"pendingJoin":case"prepareVideo":case"videoPrepared":case"established":return"active";case"finished":case"afterChat":return"finished";case"noSession":return"noSession"}return"noSession"}async rehydrate(){const e=await this.client.chatCheckSession({uid:this.sessionId,instance:this.config.instance});return!e||(e.dataObjects||[]).find(t=>ve(t)&&t.infoType==="noSession")?null:(this.processMessages(e),e)}}var Re=(i=>(i.Tunnistus="tunnistus",i.BankId="bankid",i.Freja="freja",i))(Re||{}),H=(i=>(i.Pending="pending",i.Authenticated="authenticated",i.Error="error",i))(H||{});class Vt{constructor(e){this.orderRef="",this.config=e,this.url=`${e.idHubUrl}/${e.idHubCustomerKey}/${e.idHubOrgKey}/${e.idHubEidType}`,this.maxRetries=e.idHubMaxRetries??300}async auth(){try{const e=await fetch(`${this.url}/auth`,{headers:Vt.getHeaders(),body:JSON.stringify({clientName:"idhub-web-1.0.0",register:{clientType:"ACEWIDGET",agentId:"",userName:""}}),method:"POST"});if(!e.ok)return{status:H.Error,errorMessage:`Auth failed with response: ${e.status} ${e.statusText}`};const t=await e.json();switch(this.orderRef=t.orderRef,this.config.idHubEidType){case Re.Tunnistus:return{tunnistusURL:t.tunnistusURL,status:H.Pending};case Re.BankId:return{autoStartToken:t.autoStartToken,status:H.Pending};case Re.Freja:throw new Error(`${Re.Freja} is not implemented`);default:throw new Error(`The service ${this.config.idHubEidType} is not implemented`)}}catch(e){return{status:H.Error,errorMessage:`Auth failed. Error: ${e}`}}}async collect(){for(let e=0;e<this.maxRetries;e++){await new Promise(n=>setTimeout(n,1e3));const t=await this.collectOnce();if(t&&t.status!==H.Pending)return t}return{status:H.Error}}async cancel(){try{return this.orderRef?(await fetch(`${this.url}/cancel`,{headers:Vt.getHeaders(),body:JSON.stringify({clientName:"idhub-web-1.0.0",orderRef:this.orderRef,method:"auth"}),method:"POST"}),{}):{status:H.Error,errorMessage:"Missing order reference."}}catch(e){return{status:H.Error,errorMessage:`Cancel failed. Error: ${e}`}}}static getHeaders(){return{accept:"application/json","accept-language":"sv-SE,sv;q=0.9,en-US;q=0.8,en;q=0.7","content-type":"application/json"}}async collectOnce(){try{if(!this.orderRef)return{status:H.Error,errorMessage:"Missing order reference."};const e=await fetch(`${this.url}/collect`,{headers:Vt.getHeaders(),body:JSON.stringify({clientName:"idhub-web-1.0.0",orderRef:this.orderRef,method:"auth"}),method:"POST"});if(!e.ok)return{status:H.Error,errorMessage:`Collect failed with response: ${e.status} ${e.statusText}`};const t=await e.json();return t.status===H.Error?{status:H.Error,subStatus:t.subStatus??void 0}:t}catch(e){return{status:H.Error,errorMessage:`Collect failed. Error: ${e}`}}}}class Xd{constructor(e){this.provider=e}get authResult(){return this._authResult}get authenticationCardEntry(){return this._authenticationCardEntry}setupIDHubAuth(){this._idHubClient=new Vt(this.provider.auth)}async startAuthenticationFlow(e=!1){if(this.provider.component.disableInput(),e===!1&&(this.resetAuthState(F.NonAuthenticated),this._authResult=await this.getAuthResult()),!!this._authResult)switch(this.provider.auth.idHubEidType){case Re.Tunnistus:if(!this._authResult.tunnistusURL){this.provider.printSystem(this.provider.textsService.getOrFallback("auth.setup.tunnistus.url-error-message","Unable to retrieve the Tunnistus authentication URL.")),this.provider.headerComponent.showAuthOptions=!1;return}this.provider.headerComponent.authUrl=this._authResult.tunnistusURL,this.provider.headerComponent.authState=F.NonAuthenticated,e?this.handleAuthentication():(this._authenticationCardEntry=this.provider.showTunnistusAuthCard(pe.Initial,this._authResult.tunnistusURL),this._authenticationCardEntry.actions$.pipe(Q(t=>t.key==="start-auth"),we(1)).subscribe(()=>{this.handleAuthentication()}));break;case Re.BankId:break}}async handleAuthentication(){var t,n,s,r,o,a,l,c;this.provider.headerComponent.userName=this.provider.textsService.getOrFallback("widget-header.authenticating","Authenticating..."),this.provider.headerComponent.authState=F.Authenticating,(t=this._authenticationCardEntry)==null||t.remove(),this._authenticationCardEntry=this.provider.showTunnistusAuthCard((n=this._authResult)!=null&&n.tunnistusURL?pe.Initial:pe.InitError,(s=this._authResult)==null?void 0:s.tunnistusURL,void 0,!0);const e=await this._idHubClient.collect();switch((r=this._authenticationCardEntry)==null||r.remove(),this.provider.auth.idHubEidType){case Re.Tunnistus:if(e.status===H.Error){if(this._authResult=await this.getAuthResult(),!this._authResult)return;this.provider.headerComponent.userName=this.provider.textsService.getOrFallback("widget-header.not-authenticated","Not authenticated"),this.provider.headerComponent.authState=F.NonAuthenticated,this.provider.headerComponent.authUrl=this._authResult.tunnistusURL,this._authenticationCardEntry=this.provider.showTunnistusAuthCard(pe.Error,this._authResult.tunnistusURL),this._authenticationCardEntry.actions$.pipe(Q(u=>u.key==="start-auth"),we(1)).subscribe(async()=>{this.startAuthenticationFlow(!0)});return}else if(e.status===H.Authenticated){const u=Yd(((o=e==null?void 0:e.idhubEIDToken)==null?void 0:o.split(".")[1])??""),p=JSON.parse(u),d=((l=(a=p==null?void 0:p.completionData)==null?void 0:a.user)==null?void 0:l.name)??"";this.provider.headerComponent.userName=d,this.provider.headerComponent.authState=F.Authenticated,this.provider.storageService.set("auth",{name:d,authenticated:!0}),this.provider.component.setAuthenticationBannerStatus(F.Authenticated),(c=this._authenticationCardEntry)==null||c.remove(),await this.provider.handleWelcomeForm(e.idhubEIDToken)}break;case Re.BankId:break}}async endAuthenticatedSession(){this.provider.component.setAuthenticationBannerStatus(F.NonAuthenticated),await this.provider.getChatStatus()==="noSession"?(this.resetAuthState(F.NonAuthenticated),this.provider.setSessionId(null),this.provider.component.clearMessages(),this.provider.auth.shouldUseAuth&&this.startAuthenticationFlow()):this.provider.endConversation()}resetAuthState(e){this.provider.headerComponent.authState=e,this.provider.headerComponent.userName="",this.provider.headerComponent.authUrl="",e===F.ChatEnded&&(this._authResult=void 0),this.provider.storageService.removeItem("auth")}async getAuthResult(){const e=await this._idHubClient.auth();if(e.status===H.Error){this.provider.showTunnistusAuthCard(pe.InitError),this.provider.headerComponent.showAuthOptions=!1;return}return e}}class Kd{constructor(e){this.provider=e}get videoConfirmDialogEntry(){return this._videoConfirmDialogEntry}get quitConfirmDialogEntry(){return this._quitConfirmDialogEntry}removeVideoConfirmDialog(){var e;(e=this._videoConfirmDialogEntry)==null||e.remove(),this._videoConfirmDialogEntry=void 0}showSurvey(e,t,n,s){const r=new ne(j.System,{name:""},[{items:[["ace-survey",{content:""},{agentUsername:e,entrance:t,errand:n,contactId:s}]]}]);this.provider.printEntry(r)}showTunnistusAuthCard(e,t,n,s){const r=new ne(j.System,{name:""},[{items:[["ace-tunnistus-auth-card",{content:""},{state:e,tunnistusURL:t??"",errorMessage:n??"",isAuthenticating:s??!1}]]}]);return this.provider.printEntry(r),r}showWelcomeForm(e,t){this.provider.component.disableInput(),this.provider.component.disableSkipToLatestMessage();let n;this.provider.isThirdPartyWidget?n=new ne(j.System,{name:""},[{items:[["ace-welcome-form-third-party",{content:""}]]}]):n=new ne(j.System,{name:""},[{items:[["ace-welcome-form",{content:""}]]}]),this.provider.printEntry(n),n.actions$.pipe(Q(s=>s.key==="submitted"),we(1)).subscribe(s=>{n.remove(),t({customerName:s.data.name,customerEmailAddress:s.data.email,visitorQuestion:s.data.question,customData:s.data.customData,idhubEIDToken:e})})}showEntranceClosedDialog(){this.provider.component.disableInput();const e=new ne(j.System,{name:""},[{items:[["ace-entrance-closed-dialog",{content:""}]]}]);this.provider.printEntry(e)}showQuitConfirmDialog(e){var t;(t=this._quitConfirmDialogEntry)==null||t.remove(),this._quitConfirmDialogEntry=new ne(j.System,{name:""},[{items:[["ace-quit-confirm-dialog",{content:""}]]}]),this.provider.printEntry(this._quitConfirmDialogEntry),this._quitConfirmDialogEntry.actions$.pipe(Q(n=>n.key==="quit-chat"),we(1)).subscribe(n=>{var s,r,o,a;((s=n.data)==null?void 0:s.result)==="quit"?(e(),(r=this._quitConfirmDialogEntry)==null||r.remove()):((o=n.data)==null?void 0:o.result)==="cancel"&&((a=this._quitConfirmDialogEntry)==null||a.remove())})}showConversationEndedForm(e){const t=new ne(j.System,{name:""},[{items:[["ace-conversation-ended-form",{content:""}]]}]);this.provider.printEntry(t),t.actions$.pipe(Q(n=>n.key==="submitted"),we(1)).subscribe(n=>{t.remove(),n.data.email&&e(n.data.email)})}showVideoConfirmDialog(e){this._videoConfirmDialogEntry=new ne(j.System,{name:""},[{items:[["ace-video-confirm-dialog",{content:""}]]}]),this.provider.printEntry(this._videoConfirmDialogEntry),this._videoConfirmDialogEntry.actions$.pipe(Q(t=>t.key==="video-confirm"),we(1)).subscribe(t=>{var n;(n=this._videoConfirmDialogEntry)==null||n.remove(),e(t.data.result,t.data.text)})}}class Jd{constructor(e){this.provider=e}addOption(e,t,n,s,r=!0){const o=this.provider.headerComponent;if(o)return this.provider.conversationOption?(this.provider.conversationOption.label=e,this.provider.conversationOption.key=t,this.provider.conversationOption.icon=n,this.provider.conversationOption.onClick=s,this.provider.conversationOption.enabled=r,o.requestUpdate(),this.provider.conversationOption):o.addOption({label:e,icon:n,closeOnClick:!0,key:t,onClick:s,enabled:r})}removeOptions(){const e=this.provider.headerComponent;e&&e.removeOption(this.provider.conversationOption)}setStartNewChatOption(){this.provider.conversationOption=this.addOption(this.provider.textsService.getOrFallback("widget-header.start-new-chat","Start new chat"),"start-new-chat-button",la.svg,()=>{this.provider.restartNewChat()})}setEndConversationOption(){this.provider.conversationOption=this.addOption(this.provider.textsService.getOrFallback("widget-header.end-conversation","End conversation"),"end-conversation-button",hs.svg,()=>{this.provider.showQuitConfirmDialog()},!this.provider.inVideoCall)}async setHeaderOption(){switch(await this.provider.getChatStatus()){case"finished":this.provider.isThirdPartyWidget?this.removeOptions():this.setStartNewChatOption();break;case"active":this.setEndConversationOption();break;case"noSession":this.provider.conversationOption=null;break}}}/**
|
|
1370
|
+
`];let re=Zs;ge([T()],re.prototype,"platform");ge([T()],re.prototype,"entries");ge([T()],re.prototype,"typing");ge([T()],re.prototype,"message");ge([T()],re.prototype,"disabledInput");ge([T()],re.prototype,"disabledSkipToLatest");ge([T()],re.prototype,"disabledSubmit");ge([T()],re.prototype,"chatOverlayActive");ge([T()],re.prototype,"textAreaLength");ge([T()],re.prototype,"showAuthBanner");ge([T()],re.prototype,"authenticated");const be=i=>i.objectType==="info",Dd=i=>i.objectType==="chatEntry",Ud=i=>i.objectType==="pen",zd=i=>i.objectType==="chatButtonClicked",Fd=i=>i.objectType==="endVideoButtonClicked",Hd=i=>i.type==="queue-status",jd=i=>i.type==="established",Bd=i=>i.type==="pen-status",qd=i=>i.type==="prepareVideo",Vd=i=>i.type==="videoPrepared",Wd=i=>i.type==="chatButtonClicked",Gd=i=>i.type==="endVideoButtonClicked",Zd=i=>i.type==="chat-ended";var pe=(i=>(i.Initial="initial",i.Error="error",i.Retry="retry",i.InitError="init-error",i))(pe||{});class Te extends Error{constructor(e,t,n){super(n||(t==null?void 0:t.message)||"Unknown engine error"),this.errorType=e,this.originalError=t}}class Rs{constructor(e){this.endpoint=e,this.protocolVersion="A",this.timeout=2e4,this.penStatusJustSent=!1}async chatJoin(e){var n,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(!((n=t==null?void 0:t.dataObjects)!=null&&n.length)||(s=t==null?void 0:t.dataObjects)!=null&&s.some(o=>o.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,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:((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)||"",sourceUrl:((s=window==null?void 0:window.location)==null?void 0:s.href)||"",...e.authToken&&{authToken:e.authToken}});if(!((r=t==null?void 0:t.dataObjects)!=null&&r.length)||(o=t==null?void 0:t.dataObjects)!=null&&o.some(l=>l.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((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 isOpenEntrance(e){var s;const t=await this.sendRequest("isOpenEntrance",{uid:e.uid,instance:e.instance,entrance:e.entrance,protocolVersion:this.protocolVersion}),n=(s=t==null?void 0:t.dataObjects)==null?void 0:s[0];return{open:(n==null?void 0:n.open)??!1,result:(n==null?void 0:n.result)??"error"}}async sendRequest(e,t){const n=this.endpoint.includes("engine-simulator")?"include":void 0,s=`${Rs.removeTrailingSlashes(this.endpoint)}/${e}`,r=await fetch(s,{body:new URLSearchParams(t),method:"POST",credentials:n,headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"*/*"},signal:AbortSignal.timeout(this.timeout)});return Number(r.headers.get("content-length"))>0?r.json():{}}static removeTrailingSlashes(e){return e.replace(/\/+$/,"")}}const Yd=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+i/4).toString(16)),Ls=()=>typeof crypto.randomUUID=="function"?crypto.randomUUID():Yd();function ss(i){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)}function el(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Qd(i){return decodeURIComponent(atob(i).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""))}class Xd{constructor(e,t){this.config=e,this.messageSubject$=new M,this.actionsSubject$=new M,this.messages=()=>this.messageSubject$.asObservable(),this.actions=()=>this.actionsSubject$.asObservable(),this.sessionId="",this.lastObjectId=0,this.sessionId=t??Ls(),this.client=new Rs(this.config.engineUrl)}chatJoin(e){return Je(this.client.chatJoin({invitationUid:e.invitationUid,uid:this.sessionId,customerName:e.customerName,instance:this.config.instance,videoChatMode:this.config.videoChatMode})).pipe(yt(t=>wn(()=>new Te("chat-join-error",t))),Pe(()=>this.poll().pipe($n(()=>this.poll()),xn())))}chatRequest(e){return Je(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(yt(t=>wn(()=>new Te("chat-request-error",t))),Pe(()=>this.poll().pipe($n(()=>this.poll()),xn())))}reconnect(){return this.poll().pipe($n(()=>this.poll()),xn(),yt(e=>wn(()=>new Te("chat-engine-error",e))))}poll(){return dc(()=>Je(this.client.chatRead({uid:this.sessionId,instance:this.config.instance,entrance:this.config.entrance,maxObjectId:this.lastObjectId})).pipe(wc(e=>{const t=e==null?void 0:e.dataObjects.find(n=>be(n)&&n.infoType==="error");if(t)throw new Te("chat-engine-error",void 0,t.text||"Chat engine error occurred");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(s=>be(s)&&s.infoType==="error");if(n)throw new Te("chat-write-error",void 0,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}),n=((t==null?void 0:t.dataObjects)||[]).find(s=>be(s)&&s.infoType==="error");if(n)throw new Te("chat-email-session-error",void 0,n.text||"Unable to send email with conversation")}async isOpenEntrance(e){const t=await this.client.isOpenEntrance({uid:this.sessionId,instance:this.config.instance,entrance:e});if(t.result!=="ok")throw new Te("chat-is-open-error",void 0,"Failed to check if entrance is open");return t.open}processMessages(e){e.dataObjects.forEach(t=>{Dd(t)&&t.source&&t.objectId>=this.lastObjectId&&this.messageSubject$.next({text:t.message,source:t.source,invitationNo:t.invitationNo.toString(),alias:t.alias||t.agentAlias}),Ud(t)&&this.actionsSubject$.next({penStatus:t.penStatus,type:"pen-status"}),be(t)&&t.infoType==="queue"&&this.actionsSubject$.next({text:t.text,type:"queue-status"}),be(t)&&t.infoType==="established"&&this.actionsSubject$.next({text:t.text,agentAlias:t.agentAlias,type:"established",videoEnded:t.videoEnded,contactId:t.contactId,agentUsername:t.agentUsername,entrance:t.entrance,errand:t.errand}),be(t)&&t.infoType==="prepareVideo"&&this.actionsSubject$.next({type:"prepareVideo"}),be(t)&&t.infoType==="videoPrepared"&&this.actionsSubject$.next({text:t.text,agent:t.agent,type:"videoPrepared",userUrl:t.userUrl}),zd(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"chatButtonClicked"}),Fd(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"endVideoButtonClicked"}),be(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(be(n))switch(n.infoType){case"startup":case"queue":case"placedInQueue":case"pendingJoin":case"prepareVideo":case"videoPrepared":case"established":return"active";case"finished":case"afterChat":return"finished";case"noSession":return"noSession"}return"noSession"}async rehydrate(){const e=await this.client.chatCheckSession({uid:this.sessionId,instance:this.config.instance});return!e||(e.dataObjects||[]).find(t=>be(t)&&t.infoType==="noSession")?null:(this.processMessages(e),e)}}var Le=(i=>(i.Tunnistus="tunnistus",i.BankId="bankid",i.Freja="freja",i))(Le||{}),H=(i=>(i.Pending="pending",i.Authenticated="authenticated",i.Error="error",i))(H||{});class Wt{constructor(e){this.orderRef="",this.config=e,this.url=`${e.idHubUrl}/${e.idHubCustomerKey}/${e.idHubOrgKey}/${e.idHubEidType}`,this.maxRetries=e.idHubMaxRetries??300}async auth(){try{const e=await fetch(`${this.url}/auth`,{headers:Wt.getHeaders(),body:JSON.stringify({clientName:"idhub-web-1.0.0",register:{clientType:"ACEWIDGET",agentId:"",userName:""}}),method:"POST"});if(!e.ok)return{status:H.Error,errorMessage:`Auth failed with response: ${e.status} ${e.statusText}`};const t=await e.json();switch(this.orderRef=t.orderRef,this.config.idHubEidType){case Le.Tunnistus:return{tunnistusURL:t.tunnistusURL,status:H.Pending};case Le.BankId:return{autoStartToken:t.autoStartToken,status:H.Pending};case Le.Freja:throw new Error(`${Le.Freja} is not implemented`);default:throw new Error(`The service ${this.config.idHubEidType} is not implemented`)}}catch(e){return{status:H.Error,errorMessage:`Auth failed. Error: ${e}`}}}async collect(){for(let e=0;e<this.maxRetries;e++){await new Promise(n=>setTimeout(n,1e3));const t=await this.collectOnce();if(t&&t.status!==H.Pending)return t}return{status:H.Error}}async cancel(){try{return this.orderRef?(await fetch(`${this.url}/cancel`,{headers:Wt.getHeaders(),body:JSON.stringify({clientName:"idhub-web-1.0.0",orderRef:this.orderRef,method:"auth"}),method:"POST"}),{}):{status:H.Error,errorMessage:"Missing order reference."}}catch(e){return{status:H.Error,errorMessage:`Cancel failed. Error: ${e}`}}}static getHeaders(){return{accept:"application/json","accept-language":"sv-SE,sv;q=0.9,en-US;q=0.8,en;q=0.7","content-type":"application/json"}}async collectOnce(){try{if(!this.orderRef)return{status:H.Error,errorMessage:"Missing order reference."};const e=await fetch(`${this.url}/collect`,{headers:Wt.getHeaders(),body:JSON.stringify({clientName:"idhub-web-1.0.0",orderRef:this.orderRef,method:"auth"}),method:"POST"});if(!e.ok)return{status:H.Error,errorMessage:`Collect failed with response: ${e.status} ${e.statusText}`};const t=await e.json();return t.status===H.Error?{status:H.Error,subStatus:t.subStatus??void 0}:t}catch(e){return{status:H.Error,errorMessage:`Collect failed. Error: ${e}`}}}}class Kd{constructor(e){this.provider=e}get authResult(){return this._authResult}get authenticationCardEntry(){return this._authenticationCardEntry}setupIDHubAuth(){this._idHubClient=new Wt(this.provider.auth)}async startAuthenticationFlow(e=!1){if(this.provider.component.disableInput(),e===!1&&(this.resetAuthState(j.NonAuthenticated),this._authResult=await this.getAuthResult()),!!this._authResult)switch(this.provider.auth.idHubEidType){case Le.Tunnistus:if(!this._authResult.tunnistusURL){this.provider.printSystem(this.provider.textsService.getOrFallback("auth.setup.tunnistus.url-error-message","Unable to retrieve the Tunnistus authentication URL.")),this.provider.headerComponent.showAuthOptions=!1;return}this.provider.headerComponent.authUrl=this._authResult.tunnistusURL,this.provider.headerComponent.authState=j.NonAuthenticated,e?this.handleAuthentication():(this._authenticationCardEntry=this.provider.showTunnistusAuthCard(pe.Initial,this._authResult.tunnistusURL),this._authenticationCardEntry.actions$.pipe(Q(t=>t.key==="start-auth"),ke(1)).subscribe(()=>{this.handleAuthentication()}));break;case Le.BankId:break}}async handleAuthentication(){var t,n,s,r,o,a,l,c;this.provider.headerComponent.userName=this.provider.textsService.getOrFallback("widget-header.authenticating","Authenticating..."),this.provider.headerComponent.authState=j.Authenticating,(t=this._authenticationCardEntry)==null||t.remove(),this._authenticationCardEntry=this.provider.showTunnistusAuthCard((n=this._authResult)!=null&&n.tunnistusURL?pe.Initial:pe.InitError,(s=this._authResult)==null?void 0:s.tunnistusURL,void 0,!0);const e=await this._idHubClient.collect();switch((r=this._authenticationCardEntry)==null||r.remove(),this.provider.auth.idHubEidType){case Le.Tunnistus:if(e.status===H.Error){if(this._authResult=await this.getAuthResult(),!this._authResult)return;this.provider.headerComponent.userName=this.provider.textsService.getOrFallback("widget-header.not-authenticated","Not authenticated"),this.provider.headerComponent.authState=j.NonAuthenticated,this.provider.headerComponent.authUrl=this._authResult.tunnistusURL,this._authenticationCardEntry=this.provider.showTunnistusAuthCard(pe.Error,this._authResult.tunnistusURL),this._authenticationCardEntry.actions$.pipe(Q(u=>u.key==="start-auth"),ke(1)).subscribe(async()=>{this.startAuthenticationFlow(!0)});return}else if(e.status===H.Authenticated){const u=Qd(((o=e==null?void 0:e.idhubEIDToken)==null?void 0:o.split(".")[1])??""),p=JSON.parse(u),d=((l=(a=p==null?void 0:p.completionData)==null?void 0:a.user)==null?void 0:l.name)??"";this.provider.headerComponent.userName=d,this.provider.headerComponent.authState=j.Authenticated,this.provider.storageService.set("auth",{name:d,authenticated:!0}),this.provider.component.setAuthenticationBannerStatus(j.Authenticated),(c=this._authenticationCardEntry)==null||c.remove(),await this.provider.handleWelcomeForm(e.idhubEIDToken)}break;case Le.BankId:break}}async endAuthenticatedSession(){this.provider.component.setAuthenticationBannerStatus(j.NonAuthenticated),await this.provider.getChatStatus()==="noSession"?(this.resetAuthState(j.NonAuthenticated),this.provider.setSessionId(null),this.provider.component.clearMessages(),this.provider.auth.shouldUseAuth&&this.startAuthenticationFlow()):this.provider.endConversation()}resetAuthState(e){this.provider.headerComponent.authState=e,this.provider.headerComponent.userName="",this.provider.headerComponent.authUrl="",e===j.ChatEnded&&(this._authResult=void 0),this.provider.storageService.removeItem("auth")}async getAuthResult(){const e=await this._idHubClient.auth();if(e.status===H.Error){this.provider.showTunnistusAuthCard(pe.InitError),this.provider.headerComponent.showAuthOptions=!1;return}return e}}class Jd{constructor(e){this.provider=e}get videoConfirmDialogEntry(){return this._videoConfirmDialogEntry}get quitConfirmDialogEntry(){return this._quitConfirmDialogEntry}removeVideoConfirmDialog(){var e;(e=this._videoConfirmDialogEntry)==null||e.remove(),this._videoConfirmDialogEntry=void 0}showSurvey(e,t,n,s){const r=new ne(B.System,{name:""},[{items:[["ace-survey",{content:""},{agentUsername:e,entrance:t,errand:n,contactId:s}]]}]);this.provider.printEntry(r)}showTunnistusAuthCard(e,t,n,s){const r=new ne(B.System,{name:""},[{items:[["ace-tunnistus-auth-card",{content:""},{state:e,tunnistusURL:t??"",errorMessage:n??"",isAuthenticating:s??!1}]]}]);return this.provider.printEntry(r),r}showWelcomeForm(e,t){this.provider.component.disableInput(),this.provider.component.disableSkipToLatestMessage();let n;this.provider.isThirdPartyWidget?n=new ne(B.System,{name:""},[{items:[["ace-welcome-form-third-party",{content:""}]]}]):n=new ne(B.System,{name:""},[{items:[["ace-welcome-form",{content:""}]]}]),this.provider.printEntry(n),n.actions$.pipe(Q(s=>s.key==="submitted"),ke(1)).subscribe(s=>{n.remove(),t({customerName:s.data.name,customerEmailAddress:s.data.email,visitorQuestion:s.data.question,customData:s.data.customData,idhubEIDToken:e})})}showEntranceClosedDialog(){this.provider.component.disableInput();const e=new ne(B.System,{name:""},[{items:[["ace-entrance-closed-dialog",{content:""}]]}]);this.provider.printEntry(e)}showQuitConfirmDialog(e){var t;(t=this._quitConfirmDialogEntry)==null||t.remove(),this._quitConfirmDialogEntry=new ne(B.System,{name:""},[{items:[["ace-quit-confirm-dialog",{content:""}]]}]),this.provider.printEntry(this._quitConfirmDialogEntry),this._quitConfirmDialogEntry.actions$.pipe(Q(n=>n.key==="quit-chat"),ke(1)).subscribe(n=>{var s,r,o,a;((s=n.data)==null?void 0:s.result)==="quit"?(e(),(r=this._quitConfirmDialogEntry)==null||r.remove()):((o=n.data)==null?void 0:o.result)==="cancel"&&((a=this._quitConfirmDialogEntry)==null||a.remove())})}showConversationEndedForm(e){const t=new ne(B.System,{name:""},[{items:[["ace-conversation-ended-form",{content:""}]]}]);this.provider.printEntry(t),t.actions$.pipe(Q(n=>n.key==="submitted"),ke(1)).subscribe(n=>{t.remove(),n.data.email&&e(n.data.email)})}showVideoConfirmDialog(e){this._videoConfirmDialogEntry=new ne(B.System,{name:""},[{items:[["ace-video-confirm-dialog",{content:""}]]}]),this.provider.printEntry(this._videoConfirmDialogEntry),this._videoConfirmDialogEntry.actions$.pipe(Q(t=>t.key==="video-confirm"),ke(1)).subscribe(t=>{var n;(n=this._videoConfirmDialogEntry)==null||n.remove(),e(t.data.result,t.data.text)})}}class ep{constructor(e){this.provider=e}addOption(e,t,n,s,r=!0){const o=this.provider.headerComponent;if(o)return this.provider.conversationOption?(this.provider.conversationOption.label=e,this.provider.conversationOption.key=t,this.provider.conversationOption.icon=n,this.provider.conversationOption.onClick=s,this.provider.conversationOption.enabled=r,o.requestUpdate(),this.provider.conversationOption):o.addOption({label:e,icon:n,closeOnClick:!0,key:t,onClick:s,enabled:r})}removeOptions(){const e=this.provider.headerComponent;e&&e.removeOption(this.provider.conversationOption)}setStartNewChatOption(){this.provider.conversationOption=this.addOption(this.provider.textsService.getOrFallback("widget-header.start-new-chat","Start new chat"),"start-new-chat-button",ua.svg,()=>{this.provider.restartNewChat()})}setEndConversationOption(){this.provider.conversationOption=this.addOption(this.provider.textsService.getOrFallback("widget-header.end-conversation","End conversation"),"end-conversation-button",gs.svg,()=>{this.provider.showQuitConfirmDialog()},!this.provider.inVideoCall)}async setHeaderOption(){switch(await this.provider.getChatStatus()){case"finished":this.provider.isThirdPartyWidget?this.removeOptions():this.setStartNewChatOption();break;case"active":this.setEndConversationOption();break;case"noSession":this.provider.conversationOption=null;break}}}/**
|
|
1371
1371
|
* @license
|
|
1372
1372
|
* Copyright 2018 Google LLC
|
|
1373
1373
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1374
|
-
*/const
|
|
1374
|
+
*/const tl="important",tp=" !"+tl,ip=li(class extends en{constructor(i){var e;if(super(i),i.type!==ai.ATTRIBUTE||i.name!=="style"||((e=i.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(i){return Object.keys(i).reduce(((e,t)=>{const n=i[t];return n==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(i,[e]){const{style:t}=i.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 s=e[n];if(s!=null){this.ft.add(n);const r=typeof s=="string"&&s.endsWith(tp);n.includes("-")||r?t.setProperty(n,r?s.slice(0,-11):s,r?tl:""):t[n]=s}}return Me}});var np=Object.defineProperty,sp=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&np(e,t,s),s};const Ys=class Ys 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 n=(s=this.application.settings)==null?void 0:s.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 s=parseFloat(getComputedStyle(this).fontSize);return parseFloat(t)*s}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 w` <div class="container" style=${ip(t)}>
|
|
1375
1375
|
<iframe
|
|
1376
1376
|
class="video-iframe"
|
|
1377
1377
|
src=${this.userUrl.href}
|
|
1378
1378
|
allow="camera; microphone; display-capture;"
|
|
1379
1379
|
></iframe>
|
|
1380
|
-
</div>`}};
|
|
1380
|
+
</div>`}};Ys.styles=[O`
|
|
1381
1381
|
:host {
|
|
1382
1382
|
display: block;
|
|
1383
1383
|
}
|
|
@@ -1398,7 +1398,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1398
1398
|
border: 1px solid var(--border-color-medium);
|
|
1399
1399
|
box-sizing: border-box;
|
|
1400
1400
|
}
|
|
1401
|
-
`];let
|
|
1401
|
+
`];let ii=Ys;sp([ue({context:oe}),k({attribute:!1})],ii.prototype,"application");window.customElements.get("ace-video-iframe")||window.customElements.define("ace-video-iframe",ii);class rp{constructor(e){this.provider=e,this._guestId=null,this._chatOverlayActive=!1,this._inVideoCall=!1}get videoIFrameElement(){return this._videoIFrameElement}get guestId(){return this._guestId}get chatOverlayActive(){return this._chatOverlayActive}get inVideoCall(){return this._inVideoCall}clearGuestId(){this._guestId=null}showVideoIFrame(e){var n;this._guestId=Ls(),this._videoIFrameElement=new ii(e,this._guestId);const t=this.provider.component.application.root;(n=t==null?void 0:t.shadowRoot)==null||n.prepend(this._videoIFrameElement),this._inVideoCall=!0,this.provider.updateHeaderOption()}showChatOverVideo(e){this._guestId&&e===this._guestId&&(this._chatOverlayActive=!0,this.provider.showChatOverlay$.next(this._chatOverlayActive))}removeVideo(){var e;(e=this._videoIFrameElement)==null||e.remove(),this._guestId=null,this._chatOverlayActive&&(this._chatOverlayActive=!1,this.provider.showChatOverlay$.next(this._chatOverlayActive)),this._inVideoCall=!1,this.provider.updateHeaderOption()}}var op=Object.defineProperty,ap=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&op(e,t,s),s};const Qs=class Qs extends E{onClose(){this.application.trigger&&this.application.trigger.toggleActive()}render(){const e=this.application.texts;return w`<div class="container">
|
|
1402
1402
|
<h3 data-testid="chat-unavailable-title">
|
|
1403
1403
|
${e.getOrFallback("chat-unavailable.title","Chat not available")}
|
|
1404
1404
|
</h3>
|
|
@@ -1411,11 +1411,11 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1411
1411
|
@click=${this.onClose}
|
|
1412
1412
|
data-testid="chat-unavailable-button"
|
|
1413
1413
|
>
|
|
1414
|
-
<telia-icon svg=${
|
|
1414
|
+
<telia-icon svg=${gs.svg}></telia-icon>
|
|
1415
1415
|
${e.getOrFallback("chat-unavailable.close-button","Close widget")}
|
|
1416
1416
|
</button>
|
|
1417
1417
|
</div>
|
|
1418
|
-
</div>`}};
|
|
1418
|
+
</div>`}};Qs.styles=[O`
|
|
1419
1419
|
:host {
|
|
1420
1420
|
display: block;
|
|
1421
1421
|
}
|
|
@@ -1466,12 +1466,12 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1466
1466
|
button:hover {
|
|
1467
1467
|
filter: brightness(150%);
|
|
1468
1468
|
}
|
|
1469
|
-
`];let
|
|
1469
|
+
`];let qi=Qs;ap([ue({context:oe}),k({attribute:!1})],qi.prototype,"application");window.customElements.get("ace-chat-unavailable-card")||window.customElements.define("ace-chat-unavailable-card",qi);var lp=Object.defineProperty,il=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&lp(e,t,s),s};const Xs=class Xs 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"}}renderRequiredIndicator(e){if(!e)return $;const t=this.application.texts;return w`
|
|
1470
1470
|
<span aria-hidden="true">*</span>
|
|
1471
1471
|
<span class="sr-only">
|
|
1472
1472
|
${t.getOrFallback("welcome-form.sr-only.required","(required)")}
|
|
1473
1473
|
</span>
|
|
1474
|
-
`}render(){const e=`form-${
|
|
1474
|
+
`}render(){const e=`form-${el(this.entry.name)}`,t=this.entry.displayName;return this.entry.entryType==="text"?w`<div class="container">
|
|
1475
1475
|
<label for=${e}
|
|
1476
1476
|
>${t} ${this.renderRequiredIndicator(this.entry.required)}
|
|
1477
1477
|
</label>
|
|
@@ -1485,7 +1485,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1485
1485
|
?required=${this.entry.required}
|
|
1486
1486
|
?disabled=${this.entry.disabled}
|
|
1487
1487
|
/>
|
|
1488
|
-
</div>`:this.entry.entryType==="dropdown"
|
|
1488
|
+
</div>`:this.entry.entryType==="dropdown"?w`<div class="container">
|
|
1489
1489
|
<label for=${e}
|
|
1490
1490
|
>${t} ${this.renderRequiredIndicator(this.entry.required)}
|
|
1491
1491
|
</label>
|
|
@@ -1500,7 +1500,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1500
1500
|
<option value="" selected hidden ?disabled=${this.entry.required}>
|
|
1501
1501
|
${this.entry.placeholderText}
|
|
1502
1502
|
</option>
|
|
1503
|
-
${(this.entry.dropdownOptions||[]).map(n
|
|
1503
|
+
${(this.entry.dropdownOptions||[]).map(n=>w`<option
|
|
1504
1504
|
class="options-text-color"
|
|
1505
1505
|
value=${n.value}
|
|
1506
1506
|
>
|
|
@@ -1508,10 +1508,10 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1508
1508
|
</option>`)}
|
|
1509
1509
|
</select>
|
|
1510
1510
|
<div class="custom-chevron-down">
|
|
1511
|
-
<telia-icon .svg=${
|
|
1511
|
+
<telia-icon .svg=${ca.svg}></telia-icon>
|
|
1512
1512
|
</div>
|
|
1513
1513
|
</div>
|
|
1514
|
-
</div
|
|
1514
|
+
</div>`:w`<div>Unknown entry type</div>`}};Xs.styles=[O`
|
|
1515
1515
|
:focus {
|
|
1516
1516
|
outline-color: var(--focus-color);
|
|
1517
1517
|
}
|
|
@@ -1602,7 +1602,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1602
1602
|
clip: rect(0, 0, 0, 0);
|
|
1603
1603
|
border: 0;
|
|
1604
1604
|
}
|
|
1605
|
-
`];let
|
|
1605
|
+
`];let ni=Xs;il([k({attribute:!1})],ni.prototype,"entry");il([ue({context:oe}),k({attribute:!1})],ni.prototype,"application");window.customElements.get("ace-contact-data-field")||window.customElements.define("ace-contact-data-field",ni);class Fe{constructor(e){this._email="",this._host=e,e.addController(this)}static getInstance(e){return Fe.instance?Fe.instance.updateHost(e):Fe.instance=new Fe(e),Fe.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 cp=Object.defineProperty,Is=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&cp(e,t,s),s};const Ks=class Ks extends E{constructor(){super(...arguments),this.email="",this.isEmailValid=!1,this.emailController=Fe.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=ss(this.email)}render(){const e=this.application.texts;return w`<div class="container">
|
|
1606
1606
|
<form class="form" @submit=${this._onSendChatLog}>
|
|
1607
1607
|
<h3>
|
|
1608
1608
|
${e.getOrFallback("email-form.title","Chat sent to email")}
|
|
@@ -1618,7 +1618,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1618
1618
|
id="email"
|
|
1619
1619
|
placeholder=${e.getOrFallback("email-form.email-label","Email address")}
|
|
1620
1620
|
.value=${this.email}
|
|
1621
|
-
@input=${t=>{this._emailInputHandler(t),this.isEmailValid=
|
|
1621
|
+
@input=${t=>{this._emailInputHandler(t),this.isEmailValid=ss(this.email)}}
|
|
1622
1622
|
autocomplete="email"
|
|
1623
1623
|
/>
|
|
1624
1624
|
|
|
@@ -1631,7 +1631,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1631
1631
|
${e.getOrFallback("email-form.send-button","Send Conversation")}
|
|
1632
1632
|
</button>
|
|
1633
1633
|
</form>
|
|
1634
|
-
</div>`}};
|
|
1634
|
+
</div>`}};Ks.styles=[O`
|
|
1635
1635
|
:host {
|
|
1636
1636
|
display: block;
|
|
1637
1637
|
}
|
|
@@ -1705,14 +1705,14 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1705
1705
|
button:hover {
|
|
1706
1706
|
opacity: 0.8;
|
|
1707
1707
|
}
|
|
1708
|
-
`];let
|
|
1708
|
+
`];let Et=Ks;Is([T()],Et.prototype,"email");Is([T()],Et.prototype,"isEmailValid");Is([ue({context:oe}),k({attribute:!1})],Et.prototype,"application");window.customElements.get("ace-conversation-ended-form")||window.customElements.define("ace-conversation-ended-form",Et);var up=Object.defineProperty,hp=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&up(e,t,s),s};const Js=class Js extends E{render(){const e=this.application.texts;return w`<div class="container">
|
|
1709
1709
|
<h3 data-testid="entrance-closed-title">
|
|
1710
1710
|
${e.getOrFallback("entrance-closed.title","We're currently closed")}
|
|
1711
1711
|
</h3>
|
|
1712
1712
|
<p data-testid="entrance-closed-ingress">
|
|
1713
1713
|
${e.getOrFallback("entrance-closed.ingress","Our team is currently away, but we'll be back during our regular opening hours.")}
|
|
1714
1714
|
</p>
|
|
1715
|
-
</div>`}};
|
|
1715
|
+
</div>`}};Js.styles=[O`
|
|
1716
1716
|
:host {
|
|
1717
1717
|
display: block;
|
|
1718
1718
|
}
|
|
@@ -1763,7 +1763,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1763
1763
|
button:hover {
|
|
1764
1764
|
filter: brightness(150%);
|
|
1765
1765
|
}
|
|
1766
|
-
`];let
|
|
1766
|
+
`];let Vi=Js;hp([ue({context:oe}),k({attribute:!1})],Vi.prototype,"application");window.customElements.get("ace-entrance-closed-dialog")||window.customElements.define("ace-entrance-closed-dialog",Vi);var dp=Object.defineProperty,pp=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&dp(e,t,s),s};const er=class er extends E{firstUpdated(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector(".container");e&&e.focus()}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 w`<div
|
|
1767
1767
|
class="container"
|
|
1768
1768
|
role="dialog"
|
|
1769
1769
|
aria-modal="true"
|
|
@@ -1783,7 +1783,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1783
1783
|
${e.getOrFallback("quit-confirm.end-chat-button","End chat")}
|
|
1784
1784
|
</button>
|
|
1785
1785
|
</div>
|
|
1786
|
-
</div>`}};
|
|
1786
|
+
</div>`}};er.styles=[O`
|
|
1787
1787
|
:host {
|
|
1788
1788
|
display: block;
|
|
1789
1789
|
}
|
|
@@ -1845,16 +1845,16 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1845
1845
|
button:hover {
|
|
1846
1846
|
filter: brightness(150%);
|
|
1847
1847
|
}
|
|
1848
|
-
`];let
|
|
1848
|
+
`];let Wi=er;pp([ue({context:oe}),k({attribute:!1})],Wi.prototype,"application");window.customElements.get("ace-quit-confirm-dialog")||window.customElements.define("ace-quit-confirm-dialog",Wi);var fp=Object.defineProperty,gp=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&fp(e,t,s),s};const tr=class tr 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 n=new URL(t);Object.keys(this.searchParams).forEach(s=>{n.searchParams.has(s)&&n.searchParams.set(s,this.searchParams[s])}),this.surveyUrl=n.href}render(){return w`<div class="container survey">
|
|
1849
1849
|
<h3>${this.surveyTitle}</h3>
|
|
1850
1850
|
<p>${this.surveyText}</p>
|
|
1851
1851
|
<div class="link-container">
|
|
1852
1852
|
<a class="primary" target="_blank" href="${this.surveyUrl}">
|
|
1853
1853
|
${this.surveyLinkText}
|
|
1854
|
-
<telia-icon svg=${
|
|
1854
|
+
<telia-icon svg=${qn.svg} size="sm"></telia-icon>
|
|
1855
1855
|
</a>
|
|
1856
1856
|
</div>
|
|
1857
|
-
</div>`}};
|
|
1857
|
+
</div>`}};tr.styles=[O`
|
|
1858
1858
|
:focus {
|
|
1859
1859
|
outline-color: var(--focus-color);
|
|
1860
1860
|
}
|
|
@@ -1900,9 +1900,9 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1900
1900
|
justify-content: center;
|
|
1901
1901
|
align-items: center;
|
|
1902
1902
|
}
|
|
1903
|
-
`];let
|
|
1903
|
+
`];let Gi=tr;gp([ue({context:oe}),k({attribute:!1})],Gi.prototype,"application");window.customElements.get("ace-survey")||window.customElements.define("ace-survey",Gi);var mp=Object.defineProperty,vp=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&mp(e,t,s),s};const ir=class ir extends E{constructor(e){super(),this.tunnistusURL="",this.state=pe.Initial,this.isAuthenticating=!1;const{tunnistusURL:t="",state:n=pe.Initial,isAuthenticating:s=!1}=e??{};this.tunnistusURL=t,this.state=n,this.isAuthenticating=s}onStartAuth(){const e=new CustomEvent("action",{composed:!0,detail:{key:"start-auth"}});this.dispatchEvent(e)}render(){const e=this.application.texts;switch(this.state){case pe.InitError:return w`<div class="container">
|
|
1904
1904
|
<div class="header-row">
|
|
1905
|
-
<telia-icon class="error-icon" svg=${
|
|
1905
|
+
<telia-icon class="error-icon" svg=${Yr.svg}></telia-icon>
|
|
1906
1906
|
<h3>
|
|
1907
1907
|
${e.getOrFallback("auth.setup.error-header","Something went wrong")}
|
|
1908
1908
|
</h3>
|
|
@@ -1910,9 +1910,9 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1910
1910
|
<p>
|
|
1911
1911
|
${e.getOrFallback("auth.setup.error-message","An error occurred while setting up authentication. Please contact your system administrator.")}
|
|
1912
1912
|
</p>
|
|
1913
|
-
</div>`;case pe.Error:return
|
|
1913
|
+
</div>`;case pe.Error:return w`<div class="container">
|
|
1914
1914
|
<div class="header-row">
|
|
1915
|
-
<telia-icon class="error-icon" svg=${
|
|
1915
|
+
<telia-icon class="error-icon" svg=${Yr.svg}></telia-icon>
|
|
1916
1916
|
<h3>
|
|
1917
1917
|
${e.getOrFallback("tunnistus-auth.error.header","Identification failed")}
|
|
1918
1918
|
</h3>
|
|
@@ -1931,12 +1931,12 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1931
1931
|
style=${this.isAuthenticating?"pointer-events: none; opacity: 0.5;":""}
|
|
1932
1932
|
>
|
|
1933
1933
|
${e.getOrFallback("tunnistus-auth.error.link-button","Try again")}
|
|
1934
|
-
<telia-icon svg=${
|
|
1934
|
+
<telia-icon svg=${qn.svg} size="sm"></telia-icon>
|
|
1935
1935
|
</a>
|
|
1936
1936
|
</div>
|
|
1937
|
-
</div>`;case pe.Initial:default:return
|
|
1937
|
+
</div>`;case pe.Initial:default:return w`<div class="container">
|
|
1938
1938
|
<div class="header-row">
|
|
1939
|
-
<telia-icon class="header-icon" svg=${
|
|
1939
|
+
<telia-icon class="header-icon" svg=${aa.svg}></telia-icon>
|
|
1940
1940
|
<h3>
|
|
1941
1941
|
${e.getOrFallback("tunnistus-auth.initial.header","Identify yourself")}
|
|
1942
1942
|
</h3>
|
|
@@ -1955,10 +1955,10 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
1955
1955
|
style=${this.isAuthenticating?"pointer-events: none; opacity: 0.5;":""}
|
|
1956
1956
|
>
|
|
1957
1957
|
${e.getOrFallback("tunnistus-auth.initial.link-button","Authenticate with Tunnistus")}
|
|
1958
|
-
<telia-icon svg=${
|
|
1958
|
+
<telia-icon svg=${qn.svg} size="sm"></telia-icon>
|
|
1959
1959
|
</a>
|
|
1960
1960
|
</div>
|
|
1961
|
-
</div>`}}};
|
|
1961
|
+
</div>`}}};ir.styles=[O`
|
|
1962
1962
|
:focus {
|
|
1963
1963
|
outline-color: var(--focus-color);
|
|
1964
1964
|
}
|
|
@@ -2029,7 +2029,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
2029
2029
|
justify-content: center;
|
|
2030
2030
|
align-items: center;
|
|
2031
2031
|
}
|
|
2032
|
-
`];let
|
|
2032
|
+
`];let Zi=ir;vp([ue({context:oe}),k({attribute:!1})],Zi.prototype,"application");window.customElements.get("ace-tunnistus-auth-card")||window.customElements.define("ace-tunnistus-auth-card",Zi);var bp=Object.defineProperty,yp=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&bp(e,t,s),s};const nr=class nr 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 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 w`<div class="container">
|
|
2033
2033
|
<h3>
|
|
2034
2034
|
${e.getOrFallback("video-confirm.title","Start video call with agent")}
|
|
2035
2035
|
</h3>
|
|
@@ -2038,15 +2038,15 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
2038
2038
|
</p>
|
|
2039
2039
|
<div class="button-container">
|
|
2040
2040
|
<button class="primary" type="submit" @click=${this._onStartVideo}>
|
|
2041
|
-
<telia-icon svg=${
|
|
2041
|
+
<telia-icon svg=${Zc.svg}></telia-icon>
|
|
2042
2042
|
${e.getOrFallback("video-confirm.accept-button","Accept")}
|
|
2043
2043
|
</button>
|
|
2044
2044
|
<button class="secondary" type="button" @click=${this._onCancel}>
|
|
2045
|
-
<telia-icon svg=${
|
|
2045
|
+
<telia-icon svg=${gs.svg}></telia-icon>
|
|
2046
2046
|
${e.getOrFallback("video-confirm.decline-button","Decline")}
|
|
2047
2047
|
</button>
|
|
2048
2048
|
</div>
|
|
2049
|
-
</div>`}};
|
|
2049
|
+
</div>`}};nr.styles=[O`
|
|
2050
2050
|
:host {
|
|
2051
2051
|
display: block;
|
|
2052
2052
|
}
|
|
@@ -2108,10 +2108,10 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
2108
2108
|
button:hover {
|
|
2109
2109
|
filter: brightness(150%);
|
|
2110
2110
|
}
|
|
2111
|
-
`];let
|
|
2111
|
+
`];let Yi=nr;yp([ue({context:oe}),k({attribute:!1})],Yi.prototype,"application");window.customElements.get("ace-video-confirm-dialog")||window.customElements.define("ace-video-confirm-dialog",Yi);var wp=Object.defineProperty,Ot=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&wp(e,t,s),s},xt;let ot=(xt=class extends E{constructor(){super(),this.submitted=!1,this.customData=[],this.customerName="",this.validationErrors=[],this.showValidationWarning=!1,this.emailController=Fe.getInstance(this),this.emailController.clearData()}connectedCallback(){var t,n;super.connectedCallback();const e=((n=(t=this.application.settings.agentConfig)==null?void 0:t.live)==null?void 0:n.customData)??[];this.customData=e.map(s=>{let r;switch(s.entryType){case"text":case"dropdown":r="";break;case"number":r=0;break;case"boolean":r=!1;break}return{...s,value:r}})}_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,u)=>(c[u.name]=u.value,c),{}),{customerName:s,customerEmailAddress:r,visitorQuestion:o,...a}=n,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(n=>(n.name===t.name&&(n.value=e),n))}validateCustomDataEntry(e){let t=!1;e.name==="customerEmailAddress"&&e.value&&(ss(e.value)||(t=!0)),e.required&&!e.value&&(t=!0),t?this.validationErrors.includes(e.name)||this.validationErrors.push(e.name):this.validationErrors=this.validationErrors.filter(n=>n!==e.name)}render(){if(this.submitted)return $;const e=this.application.texts;return w`<div class="container">
|
|
2112
2112
|
<form class="form" @submit=${this._onStartChat}>
|
|
2113
2113
|
<div class="header-row">
|
|
2114
|
-
<telia-icon class="header-icon" svg=${
|
|
2114
|
+
<telia-icon class="header-icon" svg=${aa.svg}></telia-icon>
|
|
2115
2115
|
<h3 class="header-text">
|
|
2116
2116
|
${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")}
|
|
2117
2117
|
</h3>
|
|
@@ -2119,7 +2119,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
2119
2119
|
<p class="description-text">
|
|
2120
2120
|
${e.getOrFallback("welcome-form.welcome-text","Please fill out the form below to start chatting with the next available agent.")}
|
|
2121
2121
|
</p>
|
|
2122
|
-
${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
|
|
2122
|
+
${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 w`<div>
|
|
2123
2123
|
<ace-contact-data-field
|
|
2124
2124
|
value=${t.value}
|
|
2125
2125
|
.entry=${t}
|
|
@@ -2128,12 +2128,12 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
2128
2128
|
></ace-contact-data-field>
|
|
2129
2129
|
<div
|
|
2130
2130
|
class="warning-row"
|
|
2131
|
-
data-testid=${`form-${
|
|
2131
|
+
data-testid=${`form-${el(t.name)}-warning`}
|
|
2132
2132
|
style="display: ${this.showValidationWarning&&this.validationErrors.includes(t.name)?"flex":"none"};"
|
|
2133
2133
|
>
|
|
2134
2134
|
<telia-icon
|
|
2135
2135
|
class="error-icon"
|
|
2136
|
-
svg=${
|
|
2136
|
+
svg=${Qc.svg}
|
|
2137
2137
|
></telia-icon>
|
|
2138
2138
|
<p class="error-text">${t.errorText}</p>
|
|
2139
2139
|
</div>
|
|
@@ -2143,7 +2143,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
2143
2143
|
${e.getOrFallback("welcome-form.submit-button","Start chat")}
|
|
2144
2144
|
</button>
|
|
2145
2145
|
</form>
|
|
2146
|
-
</div>`}}
|
|
2146
|
+
</div>`}},xt.styles=[O`
|
|
2147
2147
|
:host {
|
|
2148
2148
|
display: block;
|
|
2149
2149
|
}
|
|
@@ -2224,7 +2224,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
2224
2224
|
color: var(--destructive-color);
|
|
2225
2225
|
margin: 0;
|
|
2226
2226
|
}
|
|
2227
|
-
`]
|
|
2227
|
+
`],xt);Ot([T()],ot.prototype,"submitted");Ot([T()],ot.prototype,"customData");Ot([T()],ot.prototype,"customerName");Ot([T()],ot.prototype,"validationErrors");Ot([T()],ot.prototype,"showValidationWarning");Ot([ue({context:oe}),k({attribute:!1})],ot.prototype,"application");window.customElements.get("ace-welcome-form")||window.customElements.define("ace-welcome-form",ot);var $p=Object.defineProperty,Ps=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&$p(e,t,s),s};const sr=class sr 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,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?$:r?w`<div class="container">
|
|
2228
2228
|
<img class="logotype" src="${t}" />
|
|
2229
2229
|
<p>
|
|
2230
2230
|
${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.")}
|
|
@@ -2246,9 +2246,9 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
2246
2246
|
${n.getOrFallback("third-party-chat.join-button","Join Chat")}
|
|
2247
2247
|
</button>
|
|
2248
2248
|
</form>
|
|
2249
|
-
</div
|
|
2249
|
+
</div>`:w`<div>
|
|
2250
2250
|
${n.getOrFallback("third-pary-chat.error-message","Please check your invitation URL")}
|
|
2251
|
-
</div>`}};
|
|
2251
|
+
</div>`}};sr.styles=[O`
|
|
2252
2252
|
:host {
|
|
2253
2253
|
display: flex;
|
|
2254
2254
|
justify-content: center;
|
|
@@ -2330,4 +2330,4 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
|
|
|
2330
2330
|
button:hover {
|
|
2331
2331
|
filter: brightness(150%);
|
|
2332
2332
|
}
|
|
2333
|
-
`];let _t=er;Os([T()],_t.prototype,"submitted");Os([T()],_t.prototype,"name");Os([ue({context:oe}),k({attribute:!1})],_t.prototype,"application");window.customElements.get("ace-welcome-form-third-party")||window.customElements.define("ace-welcome-form-third-party",_t);class Rs extends Cc{constructor(e,t){var o,a;super(e,t),this.pendingMessages=[],this.disconnected$=new P,this.agentUsername=null,this.sessionId=null,this.contactId=null,this.errand=null,this.entrance=null,this.conversationOptions={},this._conversationOption=null,this.onQueueStatusReceived=l=>{this.setQueueStatus(l.text||null)},this.onEstablished=l=>{this.contactId=l.contactId,this.errand=l.errand,this.entrance=l.entrance,this.agentUsername=l.agentUsername;const c={contactId:this.contactId,errand:this.errand,entrance:this.entrance,agentUsername:this.agentUsername};this.save({survey:c}),this.setQueueStatus(null),this.agent.name=l.agentAlias,this.storageService.set("agentName",{name:this.agent.name}),l.videoEnded&&this.videoService.removeVideo()},this.onPrepareVideo=()=>{this.dialogService.showVideoConfirmDialog((l,c)=>{var u;l==="declined"&&this.videoService.clearGuestId(),(u=this.engine)==null||u.videoPrepared(l),this.printSystem(c)})},this.onVideoPrepared=l=>{this.videoService.showVideoIFrame(l.userUrl)},this.onChatButtonClicked=l=>{this.videoService.showChatOverVideo(l.guestId)},this.onEndVideoButtonClicked=l=>{this.videoService.guestId&&(l==null?void 0:l.guestId)===this.videoService.guestId&&this.videoService.removeVideo()},this.onPenStatusChange=l=>{l.penStatus==="on"?this.setTypingState(!0):this.setTypingState(!1)},this.onChatEnded=async l=>{var c,u;this.auth.shouldUseAuth&&this.authService.endAuthenticatedSession(),this.setToastMessage(null),this.setTypingState(!1),l.text&&this.printSystem(l.text),this.dialogService.videoConfirmDialogEntry&&this.dialogService.removeVideoConfirmDialog(),this.component.disableInput(),l.showForm&&this.dialogService.showConversationEndedForm(p=>{this.sendConversationEmail(p)}),(c=this.survey)!=null&&c.shouldUseSurvey&&((u=this.survey)!=null&&u.surveyBaseUrl)&&this.dialogService.showSurvey(this.agentUsername??"",this.entrance??this.live.entrance,this.errand??this.live.defaultErrand,this.contactId??""),this.isThirdPartyWidget?this.headerMenuService.removeOptions():this.headerMenuService.setStartNewChatOption(),this.complete()},this.application=t.application,this.storageService=this.application.storage,this.textsService=this.application.texts;const{auth:n,agentConfig:s,survey:r}=this.application.settings;this.survey=r,this.auth={...n,idHubEidType:n.idHubEidType.toLowerCase()},this.live=s.live,this.isThirdPartyWidget=this.live.isThirdPartyWidget??!1,this.headerComponent=this.application.getComponent("widget-header"),this.agent=this.createAgent(((o=this.storageService.get("agentName"))==null?void 0:o.name)||""),this.user=this.createUser(((a=this.storageService.get("userName"))==null?void 0:a.name)||""),this.params=new URLSearchParams(document.location.search),this.invitationUid=this.params.get("invitationUid"),this.customerName=this.params.get("customerName")||void 0,this.initializeServices()}get conversationOption(){return this._conversationOption}set conversationOption(e){this._conversationOption=e}get inVideoCall(){return this.videoService.inVideoCall}updateHeaderOption(){this.headerMenuService.setHeaderOption()}showTunnistusAuthCard(e,t,n,s){return this.dialogService.showTunnistusAuthCard(e,t,n,s)}async getChatStatus(){var e;return(e=this.engine)==null?void 0:e.getChatStatus()}initializeServices(){this.headerMenuService=new Jd(this),this.videoService=new sp(this),this.dialogService=new Kd(this),this.authService=new Xd(this)}connect(e={}){var r,o,a,l,c,u,p,d,g,v;if(super.connect(),!this.live.shouldUseLiveAgent){this.headerComponent.showAuthOptions=!1;const m=new ne(j.System,{name:""},[{items:[["ace-chat-unavailable-card",{content:""}]]}]);this.printEntry(m);return}this.setupAuthenticationListeners(),this.conversationOptions=e;const t=this.createEngineConfig(),n=!!this.sessionId;if(!n){const m=As();this.setSessionId(m)}this.save({chatSessionId:this.sessionId}),this.engine=new Qd(t,this.sessionId),(r=this.engine)==null||r.messages().subscribe(m=>{switch(m.source){case"agent":this.printAgent(m.text);break;case"customer":this.clearPendingMessages(),this.isThirdPartyWidget?m.source==="customer"&&m.invitationNo==="0"?this.printAgent(m.text,m.alias):this.printUser(m.text):m.source==="customer"&&Number(m.invitationNo)>0?this.printAgent(m.text,m.alias):this.printUser(m.text);break;case"system":this.printSystem(m.text);break}}),(o=this.engine)==null||o.actions().pipe(z(this.disconnected$),Q(Hd)).subscribe(this.onQueueStatusReceived),(a=this.engine)==null||a.actions().pipe(z(this.disconnected$),Q(Fd)).subscribe(this.onEstablished),(l=this.engine)==null||l.actions().pipe(z(this.disconnected$),Q(Bd)).subscribe(this.onPrepareVideo),(c=this.engine)==null||c.actions().pipe(z(this.disconnected$),Q(qd)).subscribe(this.onVideoPrepared),(u=this.engine)==null||u.actions().pipe(z(this.disconnected$),Q(Vd)).subscribe(this.onChatButtonClicked),(p=this.engine)==null||p.actions().pipe(z(this.disconnected$),Q(Wd)).subscribe(this.onEndVideoButtonClicked),(d=this.engine)==null||d.actions().pipe(z(this.disconnected$),Q(jd)).subscribe(this.onPenStatusChange),(g=this.engine)==null||g.actions().pipe(z(this.disconnected$),Q(Gd)).subscribe(this.onChatEnded),this.headerMenuService.setHeaderOption();const s=this.application.trigger;s&&s.widgetActive$.pipe(z(s.componentIsDestroyed$)).subscribe(m=>{m&&(this.conversationOption=null,this.headerMenuService.setHeaderOption())}),this.component.userTyping$.pipe(z(this.disconnected$)).subscribe(m=>{var W;(W=this.engine)==null||W.sendPenStatusOn(m)}),n?(v=this.engine)==null||v.rehydrate().then(m=>{var W;m?(W=this.engine)==null||W.reconnect().pipe(z(this.disconnected$)).subscribe({error:G=>{console.error("Failed to reconnect to the engine"),this.handleChatEngineError(G)}}):this.initializeChat().catch(G=>{console.error("Failed to initialize chat during rehydration:",G)})}):this.initializeChat().catch(m=>{console.error("Failed to initialize chat:",m)})}disconnected(){super.disconnected(),this.disconnected$.next()}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(s){s instanceof Ae?t.setStatus("failed"):(t.setStatus("failed"),console.warn("Unhandled error:",s))}})()}save(e){this.component.stateMachine.session().pipe(Ie(t=>(t==null?void 0:t.data$)||Le),we(1)).subscribe(t=>{this.saveToCurrentSession$.next({...t,...e})})}async rehydrate(e){if(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),this.auth.shouldUseAuth){const t=this.storageService.get("auth");t!=null&&t.authenticated?this.component.setAuthenticationBannerStatus(F.Authenticated):this.component.setAuthenticationBannerStatus(F.NonAuthenticated)}}static getInstance(e,t){return t.providerInstance??(t.providerInstance=new Rs(e,t)),t.providerInstance}createEngineConfig(){var e,t,n,s,r;return{engineUrl:((e=this.live)==null?void 0:e.engineUrl)??"",instance:((t=this.live)==null?void 0:t.instance)??"",entrance:((n=this.live)==null?void 0:n.entrance)??"",queueMessageInterval:((s=this.live)==null?void 0:s.queueMessageInterval)??120,videoChatMode:((r=this.live)==null?void 0:r.videoChatMode)??"disabled"}}async initializeChat(){var t;if(!await this.isEntranceOpen((t=this.live)==null?void 0:t.entrance)){this.headerComponent.showAuthOptions=!1,this.dialogService.showEntranceClosedDialog();return}this.auth.shouldUseAuth&&this.auth.idHubEidType?(this.component.setAuthenticationBannerStatus(F.NonAuthenticated),this.authService.setupIDHubAuth(),await this.authService.startAuthenticationFlow()):this.handleWelcomeForm()}setupAuthenticationListeners(){var e,t;this.auth.shouldUseAuth&&((e=this.headerComponent)!=null&&e.actions$)&&((t=this.headerComponent)==null||t.actions$.pipe(Q(n=>n.key==="start-auth"),z(this.disconnected$)).subscribe(n=>{n.key==="start-auth"&&this.authService.handleAuthentication()}))}async handleWelcomeForm(e){this.customerName?(this.user.name=this.customerName,this.startChat({customerName:this.customerName,customData:{}},e)):this.dialogService.showWelcomeForm(e,t=>{this.user.name=t.customerName,this.storageService.set("userName",{name:this.user.name}),this.startChat({customerName:t.customerName,customerEmailAddress:t.customerEmailAddress,visitorQuestion:t.visitorQuestion,customData:t.customData},t.idhubEIDToken)})}startChat(e,t){var s;if(!this.engine)return;const n=((s=e.customData)==null?void 0:s.errand)??this.live.defaultErrand;if(!n)throw new Error("Errand is required but was not configured");this.isThirdPartyWidget?(this.application.root.style.visibility="visible",this.engine.chatJoin({invitationUid:this.invitationUid,customerName:this.customerName??e.customerName}).pipe(z(this.disconnected$),vt(r=>(this.handleChatEngineError(r),Le))).subscribe()):this.engine.chatRequest({customerName:e.customerName,customerEmailAddress:e.customerEmailAddress??"",visitorQuestion:e.visitorQuestion??"",customData:e.customData,errand:n,...t&&{authToken:t}}).pipe(z(this.disconnected$),vt(r=>(this.handleChatEngineError(r),Le))).subscribe(),this.component.enableInput(),this.component.enableSkipToLatestMessage(),this.headerMenuService.setEndConversationOption()}restartNewChat(){this.engine&&(this.setSessionId(null),this.component.clearMessages(),this.headerMenuService.removeOptions(),this.connect(this.conversationOptions))}handleChatEngineError(e){console.error(e),this.printSystem(this.textsService.getOrFallback("chat-engine.service-error","We are experiencing issues. Chat is temporarily down.")),this.resetChatState()}resetChatState(){this.component.setAuthenticationBannerStatus(F.NonAuthenticated),this.setSessionId(null),this.authService.resetAuthState(F.NonAuthenticated),this.endConversation(),this.headerMenuService.setStartNewChatOption()}setQueueStatus(e){this.setToastMessage(e)}async endConversation(){var e;this.auth.shouldUseAuth&&this.authService.resetAuthState(F.ChatEnded),await((e=this.engine)==null?void 0:e.chatQuit())}async sendConversationEmail(e){var t;try{await((t=this.engine)==null?void 0:t.chatEmailSession(e)),this.printSystem(this.textsService.getOrFallback("email-form.email-sent-label","An email with the conversation was sent."))}catch(n){this.printSystem(this.textsService.getOrFallback("email-form.error-message","Unable to send email with the conversation.")),n instanceof Ae||console.warn("Unhandled error:",n)}}clearPendingMessages(){for(const e of this.pendingMessages)e.remove()}setSessionId(e){this.sessionId=e}async isEntranceOpen(e){var t;try{return await((t=this.engine)==null?void 0:t.isOpenEntrance(e))??!1}catch(n){return console.log(`Failed to check if entrance ${e} is open:`,n),!1}}unescapeHtml(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}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=this.unescapeHtml(e),n=Dn(Ir(t));return this.user.print(n)}printSystem(e){const t=Dn(Ir(e));return this.system.print(t)}showQuitConfirmDialog(){this.dialogService.showQuitConfirmDialog(()=>{this.endConversation()})}}const wp=async i=>{(await os.getInstance(i.container)).registerProvider("ace-chat",t=>Rs.getInstance("ace-chat",t))};exports.ChatProviderPlugin=wp;
|
|
2333
|
+
`];let At=sr;Ps([T()],At.prototype,"submitted");Ps([T()],At.prototype,"name");Ps([ue({context:oe}),k({attribute:!1})],At.prototype,"application");window.customElements.get("ace-welcome-form-third-party")||window.customElements.define("ace-welcome-form-third-party",At);class Ms extends _c{constructor(e,t){var o,a;super(e,t),this.pendingMessages=[],this.disconnected$=new M,this.agentUsername=null,this.sessionId=null,this.contactId=null,this.errand=null,this.entrance=null,this.conversationOptions={},this._conversationOption=null,this.onQueueStatusReceived=l=>{this.setQueueStatus(l.text||null)},this.onEstablished=l=>{this.contactId=l.contactId,this.errand=l.errand,this.entrance=l.entrance,this.agentUsername=l.agentUsername;const c={contactId:this.contactId,errand:this.errand,entrance:this.entrance,agentUsername:this.agentUsername};this.save({survey:c}),this.setQueueStatus(null),this.agent.name=l.agentAlias,this.storageService.set("agentName",{name:this.agent.name}),l.videoEnded&&this.videoService.removeVideo()},this.onPrepareVideo=()=>{this.dialogService.showVideoConfirmDialog((l,c)=>{var u;l==="declined"&&this.videoService.clearGuestId(),(u=this.engine)==null||u.videoPrepared(l),this.printSystem(c)})},this.onVideoPrepared=l=>{this.videoService.showVideoIFrame(l.userUrl)},this.onChatButtonClicked=l=>{this.videoService.showChatOverVideo(l.guestId)},this.onEndVideoButtonClicked=l=>{this.videoService.guestId&&(l==null?void 0:l.guestId)===this.videoService.guestId&&this.videoService.removeVideo()},this.onPenStatusChange=l=>{l.penStatus==="on"?this.setTypingState(!0):this.setTypingState(!1)},this.onChatEnded=async l=>{var c,u;this.auth.shouldUseAuth&&this.authService.endAuthenticatedSession(),this.setToastMessage(null),this.setTypingState(!1),l.text&&this.printSystem(l.text),this.dialogService.videoConfirmDialogEntry&&this.dialogService.removeVideoConfirmDialog(),this.component.disableInput(),l.showForm&&this.dialogService.showConversationEndedForm(p=>{this.sendConversationEmail(p)}),(c=this.survey)!=null&&c.shouldUseSurvey&&((u=this.survey)!=null&&u.surveyBaseUrl)&&this.dialogService.showSurvey(this.agentUsername??"",this.entrance??this.live.entrance,this.errand??this.live.defaultErrand,this.contactId??""),this.isThirdPartyWidget?this.headerMenuService.removeOptions():this.headerMenuService.setStartNewChatOption(),this.complete()},this.application=t.application,this.storageService=this.application.storage,this.textsService=this.application.texts;const{auth:n,agentConfig:s,survey:r}=this.application.settings;this.survey=r,this.auth={...n,idHubEidType:n.idHubEidType.toLowerCase()},this.live=s.live,this.isThirdPartyWidget=this.live.isThirdPartyWidget??!1,this.headerComponent=this.application.getComponent("widget-header"),this.agent=this.createAgent(((o=this.storageService.get("agentName"))==null?void 0:o.name)||""),this.user=this.createUser(((a=this.storageService.get("userName"))==null?void 0:a.name)||""),this.params=new URLSearchParams(document.location.search),this.invitationUid=this.params.get("invitationUid"),this.customerName=this.params.get("customerName")||void 0,this.initializeServices()}get conversationOption(){return this._conversationOption}set conversationOption(e){this._conversationOption=e}get inVideoCall(){return this.videoService.inVideoCall}updateHeaderOption(){this.headerMenuService.setHeaderOption()}showTunnistusAuthCard(e,t,n,s){return this.dialogService.showTunnistusAuthCard(e,t,n,s)}async getChatStatus(){var e;return(e=this.engine)==null?void 0:e.getChatStatus()}initializeServices(){this.headerMenuService=new ep(this),this.videoService=new rp(this),this.dialogService=new Jd(this),this.authService=new Kd(this)}connect(e={}){var r,o,a,l,c,u,p,d,g,v;if(super.connect(),!this.live.shouldUseLiveAgent){this.headerComponent.showAuthOptions=!1;const m=new ne(B.System,{name:""},[{items:[["ace-chat-unavailable-card",{content:""}]]}]);this.printEntry(m);return}this.setupAuthenticationListeners(),this.conversationOptions=e;const t=this.createEngineConfig(),n=!!this.sessionId;if(!n){const m=Ls();this.setSessionId(m)}this.save({chatSessionId:this.sessionId}),this.engine=new Xd(t,this.sessionId),(r=this.engine)==null||r.messages().subscribe(m=>{switch(m.source){case"agent":this.printAgent(m.text);break;case"customer":this.clearPendingMessages(),this.isThirdPartyWidget?m.source==="customer"&&m.invitationNo==="0"?this.printAgent(m.text,m.alias):this.printUser(m.text):m.source==="customer"&&Number(m.invitationNo)>0?this.printAgent(m.text,m.alias):this.printUser(m.text);break;case"system":this.printSystem(m.text);break}}),(o=this.engine)==null||o.actions().pipe(F(this.disconnected$),Q(Hd)).subscribe(this.onQueueStatusReceived),(a=this.engine)==null||a.actions().pipe(F(this.disconnected$),Q(jd)).subscribe(this.onEstablished),(l=this.engine)==null||l.actions().pipe(F(this.disconnected$),Q(qd)).subscribe(this.onPrepareVideo),(c=this.engine)==null||c.actions().pipe(F(this.disconnected$),Q(Vd)).subscribe(this.onVideoPrepared),(u=this.engine)==null||u.actions().pipe(F(this.disconnected$),Q(Wd)).subscribe(this.onChatButtonClicked),(p=this.engine)==null||p.actions().pipe(F(this.disconnected$),Q(Gd)).subscribe(this.onEndVideoButtonClicked),(d=this.engine)==null||d.actions().pipe(F(this.disconnected$),Q(Bd)).subscribe(this.onPenStatusChange),(g=this.engine)==null||g.actions().pipe(F(this.disconnected$),Q(Zd)).subscribe(this.onChatEnded),this.headerMenuService.setHeaderOption();const s=this.application.trigger;s&&s.widgetActive$.pipe(F(s.componentIsDestroyed$)).subscribe(m=>{m&&(this.conversationOption=null,this.headerMenuService.setHeaderOption())}),this.component.userTyping$.pipe(F(this.disconnected$)).subscribe(m=>{var W;(W=this.engine)==null||W.sendPenStatusOn(m)}),n?(v=this.engine)==null||v.rehydrate().then(m=>{var W;m?(W=this.engine)==null||W.reconnect().pipe(F(this.disconnected$)).subscribe({error:G=>{console.error("Failed to reconnect to the engine"),this.handleChatEngineError(G)}}):this.initializeChat().catch(G=>{console.error("Failed to initialize chat during rehydration:",G)})}):this.initializeChat().catch(m=>{console.error("Failed to initialize chat:",m)})}disconnected(){super.disconnected(),this.disconnected$.next()}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(s){s instanceof Te?t.setStatus("failed"):(t.setStatus("failed"),console.warn("Unhandled error:",s))}})()}save(e){this.component.stateMachine.session().pipe(Pe(t=>(t==null?void 0:t.data$)||Ie),ke(1)).subscribe(t=>{this.saveToCurrentSession$.next({...t,...e})})}async rehydrate(e){if(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),this.auth.shouldUseAuth){const t=this.storageService.get("auth");t!=null&&t.authenticated?this.component.setAuthenticationBannerStatus(j.Authenticated):this.component.setAuthenticationBannerStatus(j.NonAuthenticated)}}static getInstance(e,t){return t.providerInstance??(t.providerInstance=new Ms(e,t)),t.providerInstance}createEngineConfig(){var e,t,n,s,r;return{engineUrl:((e=this.live)==null?void 0:e.engineUrl)??"",instance:((t=this.live)==null?void 0:t.instance)??"",entrance:((n=this.live)==null?void 0:n.entrance)??"",queueMessageInterval:((s=this.live)==null?void 0:s.queueMessageInterval)??120,videoChatMode:((r=this.live)==null?void 0:r.videoChatMode)??"disabled"}}async initializeChat(){var t;if(!await this.isEntranceOpen((t=this.live)==null?void 0:t.entrance)){this.headerComponent.showAuthOptions=!1,this.dialogService.showEntranceClosedDialog();return}this.auth.shouldUseAuth&&this.auth.idHubEidType?(this.component.setAuthenticationBannerStatus(j.NonAuthenticated),this.authService.setupIDHubAuth(),await this.authService.startAuthenticationFlow()):this.handleWelcomeForm()}setupAuthenticationListeners(){var e,t;this.auth.shouldUseAuth&&((e=this.headerComponent)!=null&&e.actions$)&&((t=this.headerComponent)==null||t.actions$.pipe(Q(n=>n.key==="start-auth"),F(this.disconnected$)).subscribe(n=>{n.key==="start-auth"&&this.authService.handleAuthentication()}))}async handleWelcomeForm(e){this.customerName?(this.user.name=this.customerName,this.startChat({customerName:this.customerName,customData:{}},e)):this.dialogService.showWelcomeForm(e,t=>{this.user.name=t.customerName,this.storageService.set("userName",{name:this.user.name}),this.startChat({customerName:t.customerName,customerEmailAddress:t.customerEmailAddress,visitorQuestion:t.visitorQuestion,customData:t.customData},t.idhubEIDToken)})}startChat(e,t){var s;if(!this.engine)return;const n=((s=e.customData)==null?void 0:s.errand)??this.live.defaultErrand;if(!n)throw new Error("Errand is required but was not configured");this.isThirdPartyWidget?(this.application.root.style.visibility="visible",this.engine.chatJoin({invitationUid:this.invitationUid,customerName:this.customerName??e.customerName}).pipe(F(this.disconnected$),yt(r=>(this.handleChatEngineError(r),Ie))).subscribe()):this.engine.chatRequest({customerName:e.customerName,customerEmailAddress:e.customerEmailAddress??"",visitorQuestion:e.visitorQuestion??"",customData:e.customData,errand:n,...t&&{authToken:t}}).pipe(F(this.disconnected$),yt(r=>(this.handleChatEngineError(r),Ie))).subscribe(),this.component.enableInput(),this.component.enableSkipToLatestMessage(),this.headerMenuService.setEndConversationOption()}restartNewChat(){this.engine&&(this.setSessionId(null),this.component.clearMessages(),this.headerMenuService.removeOptions(),this.connect(this.conversationOptions))}handleChatEngineError(e){console.error(e),this.printSystem(this.textsService.getOrFallback("chat-engine.service-error","We are experiencing issues. Chat is temporarily down.")),this.resetChatState()}resetChatState(){this.component.setAuthenticationBannerStatus(j.NonAuthenticated),this.setSessionId(null),this.authService.resetAuthState(j.NonAuthenticated),this.endConversation(),this.headerMenuService.setStartNewChatOption()}setQueueStatus(e){this.setToastMessage(e)}async endConversation(){var e;this.auth.shouldUseAuth&&this.authService.resetAuthState(j.ChatEnded),await((e=this.engine)==null?void 0:e.chatQuit())}async sendConversationEmail(e){var t;try{await((t=this.engine)==null?void 0:t.chatEmailSession(e)),this.printSystem(this.textsService.getOrFallback("email-form.email-sent-label","An email with the conversation was sent."))}catch(n){this.printSystem(this.textsService.getOrFallback("email-form.error-message","Unable to send email with the conversation.")),n instanceof Te||console.warn("Unhandled error:",n)}}clearPendingMessages(){for(const e of this.pendingMessages)e.remove()}setSessionId(e){this.sessionId=e}async isEntranceOpen(e){var t;try{return await((t=this.engine)==null?void 0:t.isOpenEntrance(e))??!1}catch(n){return console.log(`Failed to check if entrance ${e} is open:`,n),!1}}unescapeHtml(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}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=this.unescapeHtml(e),n=Hn(Nr(t));return this.user.print(n)}printSystem(e){const t=Hn(Nr(e));return this.system.print(t)}showQuitConfirmDialog(){this.dialogService.showQuitConfirmDialog(()=>{this.endConversation()})}}const xp=async i=>{(await us.getInstance(i.container)).registerProvider("ace-chat",t=>Ms.getInstance("ace-chat",t))};exports.ChatProviderPlugin=xp;
|