@telia-ace/widget-core-flamingo 1.1.76-rc.3 → 1.1.76-rc.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/index.js +16 -16
  2. package/index.mjs +81 -80
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -1,20 +1,20 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var gt=function(s,t){return gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])},gt(s,t)};function Y(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");gt(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function mt(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],i=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&i>=s.length&&(s=void 0),{value:s&&s[i++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function X(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var i=e.call(s),r,n=[],o;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)n.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return n}function Q(s,t,e){if(e||arguments.length===2)for(var i=0,r=t.length,n;i<r;i++)(n||!(i in t))&&(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return s.concat(n||Array.prototype.slice.call(t))}function _(s){return typeof s=="function"}function Qt(s){var t=function(i){Error.call(i),i.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var ot=Qt(function(s){return function(e){s(this),this.message=e?e.length+` errors occurred during unsubscription:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var gt=function(s,t){return gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])},gt(s,t)};function V(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");gt(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function mt(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],i=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&i>=s.length&&(s=void 0),{value:s&&s[i++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function G(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var i=e.call(s),r,n=[],o;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)n.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return n}function X(s,t,e){if(e||arguments.length===2)for(var i=0,r=t.length,n;i<r;i++)(n||!(i in t))&&(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return s.concat(n||Array.prototype.slice.call(t))}function _(s){return typeof s=="function"}function Qt(s){var t=function(i){Error.call(i),i.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var ot=Qt(function(s){return function(e){s(this),this.message=e?e.length+` errors occurred during unsubscription:
2
2
  `+e.map(function(i,r){return r+1+") "+i.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=e}});function vt(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var st=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,i,r,n;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=mt(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(y){t={error:y}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(_(l))try{l()}catch(y){n=y instanceof ot?y.errors:[y]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=mt(d),f=p.next();!f.done;f=p.next()){var g=f.value;try{Ot(g)}catch(y){n=n??[],y instanceof ot?n=Q(Q([],X(n)),X(y.errors)):n.push(y)}}}catch(y){i={error:y}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}}if(n)throw new ot(n)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Ot(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&vt(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&vt(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}(),te=st.EMPTY;function ee(s){return s instanceof st||s&&"closed"in s&&_(s.remove)&&_(s.add)&&_(s.unsubscribe)}function Ot(s){_(s)?s():s.unsubscribe()}var ie={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},yt={setTimeout:function(s,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];var r=yt.delegate;return r!=null&&r.setTimeout?r.setTimeout.apply(r,Q([s,t],X(e))):setTimeout.apply(void 0,Q([s,t],X(e)))},clearTimeout:function(s){var t=yt.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(s)},delegate:void 0};function Ee(s){yt.setTimeout(function(){throw s})}function Tt(){}function J(s){s()}var se=function(s){Y(t,s);function t(e){var i=s.call(this)||this;return i.isStopped=!1,e?(i.destination=e,ee(e)&&e.add(i)):i.destination=Ie,i}return t.create=function(e,i,r){return new bt(e,i,r)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(st),Pe=Function.prototype.bind;function at(s,t){return Pe.call(s,t)}var Oe=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(i){Z(i)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(i){Z(i)}else Z(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){Z(e)}},s}(),bt=function(s){Y(t,s);function t(e,i,r){var n=s.call(this)||this,o;if(_(e)||!e)o={next:e??void 0,error:i??void 0,complete:r??void 0};else{var a;n&&ie.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return n.unsubscribe()},o={next:e.next&&at(e.next,a),error:e.error&&at(e.error,a),complete:e.complete&&at(e.complete,a)}):o=e}return n.destination=new Oe(o),n}return t}(se);function Z(s){Ee(s)}function Te(s){throw s}var Ie={closed:!0,next:Tt,error:Te,complete:Tt},Re=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function ke(s){return s}function Ne(s){return s.length===0?ke:s.length===1?s[0]:function(e){return s.reduce(function(i,r){return r(i)},e)}}var It=function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,i){var r=this,n=Me(t)?t:new bt(t,e,i);return J(function(){var o=r,a=o.operator,c=o.source;n.add(a?a.call(n,c):c?r._subscribe(n):r._trySubscribe(n))}),n},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var i=this;return e=Rt(e),new e(function(r,n){var o=new bt({next:function(a){try{t(a)}catch(c){n(c),o.unsubscribe()}},error:n,complete:r});i.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[Re]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ne(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=Rt(t),new t(function(i,r){var n;e.subscribe(function(o){return n=o},function(o){return r(o)},function(){return i(n)})})},s.create=function(t){return new s(t)},s}();function Rt(s){var t;return(t=s??ie.Promise)!==null&&t!==void 0?t:Promise}function Ue(s){return s&&_(s.next)&&_(s.error)&&_(s.complete)}function Me(s){return s&&s instanceof se||Ue(s)&&ee(s)}var je=Qt(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),$t=function(s){Y(t,s);function t(){var e=s.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var i=new kt(this,this);return i.operator=e,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new je},t.prototype.next=function(e){var i=this;J(function(){var r,n;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var o=mt(i.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(e)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var i=this;J(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=e;for(var r=i.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;J(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var i=e.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var i=this,r=this,n=r.hasError,o=r.isStopped,a=r.observers;return n||o?te:(this.currentObservers=null,a.push(e),new st(function(){i.currentObservers=null,vt(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var i=this,r=i.hasError,n=i.thrownError,o=i.isStopped;r?e.error(n):o&&e.complete()},t.prototype.asObservable=function(){var e=new It;return e.source=this,e},t.create=function(e,i){return new kt(e,i)},t}(It),kt=function(s){Y(t,s);function t(e,i){var r=s.call(this)||this;return r.destination=e,r.source=i,r}return t.prototype.next=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.next)===null||r===void 0||r.call(i,e)},t.prototype.error=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.error)===null||r===void 0||r.call(i,e)},t.prototype.complete=function(){var e,i;(i=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||i===void 0||i.call(e)},t.prototype._subscribe=function(e){var i,r;return(r=(i=this.source)===null||i===void 0?void 0:i.subscribe(e))!==null&&r!==void 0?r:te},t}($t),re=function(s){Y(t,s);function t(e){var i=s.call(this)||this;return i._value=e,i}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var i=s.prototype._subscribe.call(this,e);return!i.closed&&e.next(this._value),i},t.prototype.getValue=function(){var e=this,i=e.hasError,r=e.thrownError,n=e._value;if(i)throw r;return this._throwIfClosed(),n},t.prototype.next=function(e){s.prototype.next.call(this,this._value=e)},t}($t),ne=(s=>(s.Loading="loading",s.Ready="ready",s))(ne||{});class wt{constructor(t,e){this.state=new re("loading"),this.resolvers=new Map,this.name=t,this.environment=e,this.state.next("ready")}setState(t){this.state.next(t)}async register(t,e){this.resolvers.set(t,e)}async get(t){return this.resolvers.get(t)}}/**
3
+ `):"",this.name="UnsubscriptionError",this.errors=e}});function vt(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var it=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,i,r,n;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=mt(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(y){t={error:y}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(_(l))try{l()}catch(y){n=y instanceof ot?y.errors:[y]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=mt(d),f=p.next();!f.done;f=p.next()){var g=f.value;try{Ot(g)}catch(y){n=n??[],y instanceof ot?n=X(X([],G(n)),G(y.errors)):n.push(y)}}}catch(y){i={error:y}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}}if(n)throw new ot(n)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Ot(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&vt(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&vt(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}(),te=it.EMPTY;function ee(s){return s instanceof it||s&&"closed"in s&&_(s.remove)&&_(s.add)&&_(s.unsubscribe)}function Ot(s){_(s)?s():s.unsubscribe()}var ie={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},yt={setTimeout:function(s,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];var r=yt.delegate;return r!=null&&r.setTimeout?r.setTimeout.apply(r,X([s,t],G(e))):setTimeout.apply(void 0,X([s,t],G(e)))},clearTimeout:function(s){var t=yt.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(s)},delegate:void 0};function Ee(s){yt.setTimeout(function(){throw s})}function Tt(){}function Z(s){s()}var se=function(s){V(t,s);function t(e){var i=s.call(this)||this;return i.isStopped=!1,e?(i.destination=e,ee(e)&&e.add(i)):i.destination=Ie,i}return t.create=function(e,i,r){return new bt(e,i,r)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(it),Pe=Function.prototype.bind;function at(s,t){return Pe.call(s,t)}var Oe=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(i){K(i)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(i){K(i)}else K(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){K(e)}},s}(),bt=function(s){V(t,s);function t(e,i,r){var n=s.call(this)||this,o;if(_(e)||!e)o={next:e??void 0,error:i??void 0,complete:r??void 0};else{var a;n&&ie.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return n.unsubscribe()},o={next:e.next&&at(e.next,a),error:e.error&&at(e.error,a),complete:e.complete&&at(e.complete,a)}):o=e}return n.destination=new Oe(o),n}return t}(se);function K(s){Ee(s)}function Te(s){throw s}var Ie={closed:!0,next:Tt,error:Te,complete:Tt},Re=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function ke(s){return s}function Ne(s){return s.length===0?ke:s.length===1?s[0]:function(e){return s.reduce(function(i,r){return r(i)},e)}}var It=function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,i){var r=this,n=Me(t)?t:new bt(t,e,i);return Z(function(){var o=r,a=o.operator,c=o.source;n.add(a?a.call(n,c):c?r._subscribe(n):r._trySubscribe(n))}),n},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var i=this;return e=Rt(e),new e(function(r,n){var o=new bt({next:function(a){try{t(a)}catch(c){n(c),o.unsubscribe()}},error:n,complete:r});i.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[Re]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ne(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=Rt(t),new t(function(i,r){var n;e.subscribe(function(o){return n=o},function(o){return r(o)},function(){return i(n)})})},s.create=function(t){return new s(t)},s}();function Rt(s){var t;return(t=s??ie.Promise)!==null&&t!==void 0?t:Promise}function Ue(s){return s&&_(s.next)&&_(s.error)&&_(s.complete)}function Me(s){return s&&s instanceof se||Ue(s)&&ee(s)}var je=Qt(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),$t=function(s){V(t,s);function t(){var e=s.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var i=new kt(this,this);return i.operator=e,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new je},t.prototype.next=function(e){var i=this;Z(function(){var r,n;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var o=mt(i.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(e)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var i=this;Z(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=e;for(var r=i.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;Z(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var i=e.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var i=this,r=this,n=r.hasError,o=r.isStopped,a=r.observers;return n||o?te:(this.currentObservers=null,a.push(e),new it(function(){i.currentObservers=null,vt(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var i=this,r=i.hasError,n=i.thrownError,o=i.isStopped;r?e.error(n):o&&e.complete()},t.prototype.asObservable=function(){var e=new It;return e.source=this,e},t.create=function(e,i){return new kt(e,i)},t}(It),kt=function(s){V(t,s);function t(e,i){var r=s.call(this)||this;return r.destination=e,r.source=i,r}return t.prototype.next=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.next)===null||r===void 0||r.call(i,e)},t.prototype.error=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.error)===null||r===void 0||r.call(i,e)},t.prototype.complete=function(){var e,i;(i=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||i===void 0||i.call(e)},t.prototype._subscribe=function(e){var i,r;return(r=(i=this.source)===null||i===void 0?void 0:i.subscribe(e))!==null&&r!==void 0?r:te},t}($t),re=function(s){V(t,s);function t(e){var i=s.call(this)||this;return i._value=e,i}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var i=s.prototype._subscribe.call(this,e);return!i.closed&&e.next(this._value),i},t.prototype.getValue=function(){var e=this,i=e.hasError,r=e.thrownError,n=e._value;if(i)throw r;return this._throwIfClosed(),n},t.prototype.next=function(e){s.prototype.next.call(this,this._value=e)},t}($t),ne=(s=>(s.Loading="loading",s.Ready="ready",s))(ne||{});class wt{constructor(t,e){this.state=new re("loading"),this.resolvers=new Map,this.name=t,this.environment=e,this.state.next("ready")}setState(t){this.state.next(t)}async register(t,e){this.resolvers.set(t,e)}async get(t){return this.resolvers.get(t)}}/**
4
4
  * @license
5
5
  * Copyright 2019 Google LLC
6
6
  * SPDX-License-Identifier: BSD-3-Clause
7
- */const G=globalThis,_t=G.ShadowRoot&&(G.ShadyCSS===void 0||G.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol(),Nt=new WeakMap;let oe=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==At)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(_t&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Nt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Nt.set(e,t))}return t}toString(){return this.cssText}};const He=s=>new oe(typeof s=="string"?s:s+"",void 0,At),N=(s,...t)=>{const e=s.length===1?s[0]:t.reduce((i,r,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[n+1],s[0]);return new oe(e,s,At)},Le=(s,t)=>{if(_t)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),r=G.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},Ut=_t?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return He(e)})(s):s;/**
7
+ */const J=globalThis,_t=J.ShadowRoot&&(J.ShadyCSS===void 0||J.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol(),Nt=new WeakMap;let oe=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==At)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(_t&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Nt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Nt.set(e,t))}return t}toString(){return this.cssText}};const He=s=>new oe(typeof s=="string"?s:s+"",void 0,At),N=(s,...t)=>{const e=s.length===1?s[0]:t.reduce((i,r,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[n+1],s[0]);return new oe(e,s,At)},Le=(s,t)=>{if(_t)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),r=J.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},Ut=_t?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return He(e)})(s):s;/**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
- */const{is:De,defineProperty:Be,getOwnPropertyDescriptor:ze,getOwnPropertyNames:We,getOwnPropertySymbols:Fe,getPrototypeOf:Ve}=Object,C=globalThis,Mt=C.trustedTypes,Ye=Mt?Mt.emptyScript:"",ct=C.reactiveElementPolyfillSupport,H=(s,t)=>s,tt={toAttribute(s,t){switch(t){case Boolean:s=s?Ye:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},xt=(s,t)=>!De(s,t),jt={attribute:!0,type:String,converter:tt,reflect:!1,hasChanged:xt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),C.litPropertyMetadata??(C.litPropertyMetadata=new WeakMap);let I=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=jt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&Be(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:n}=ze(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const a=r==null?void 0:r.call(this);n.call(this,o),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??jt}static _$Ei(){if(this.hasOwnProperty(H("elementProperties")))return;const t=Ve(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(H("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(H("properties"))){const e=this.properties,i=[...We(e),...Fe(e)];for(const r of i)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const r of i)e.unshift(Ut(r))}else t!==void 0&&e.push(Ut(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Le(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var n;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const o=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:tt).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var n;const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:tt;this._$Em=r,this[r]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??xt)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,o]of r)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(r=>{var n;return(n=r.hostUpdate)==null?void 0:n.call(r)}),this.update(e)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}};I.elementStyles=[],I.shadowRootOptions={mode:"open"},I[H("elementProperties")]=new Map,I[H("finalized")]=new Map,ct==null||ct({ReactiveElement:I}),(C.reactiveElementVersions??(C.reactiveElementVersions=[])).push("2.0.4");/**
11
+ */const{is:De,defineProperty:Be,getOwnPropertyDescriptor:ze,getOwnPropertyNames:We,getOwnPropertySymbols:Fe,getPrototypeOf:Ve}=Object,C=globalThis,Mt=C.trustedTypes,Ye=Mt?Mt.emptyScript:"",ct=C.reactiveElementPolyfillSupport,H=(s,t)=>s,Q={toAttribute(s,t){switch(t){case Boolean:s=s?Ye:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},xt=(s,t)=>!De(s,t),jt={attribute:!0,type:String,converter:Q,reflect:!1,hasChanged:xt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),C.litPropertyMetadata??(C.litPropertyMetadata=new WeakMap);let I=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=jt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&Be(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:n}=ze(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const a=r==null?void 0:r.call(this);n.call(this,o),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??jt}static _$Ei(){if(this.hasOwnProperty(H("elementProperties")))return;const t=Ve(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(H("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(H("properties"))){const e=this.properties,i=[...We(e),...Fe(e)];for(const r of i)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const r of i)e.unshift(Ut(r))}else t!==void 0&&e.push(Ut(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Le(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var n;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const o=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:Q).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var n;const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:Q;this._$Em=r,this[r]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??xt)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,o]of r)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(r=>{var n;return(n=r.hostUpdate)==null?void 0:n.call(r)}),this.update(e)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}};I.elementStyles=[],I.shadowRootOptions={mode:"open"},I[H("elementProperties")]=new Map,I[H("finalized")]=new Map,ct==null||ct({ReactiveElement:I}),(C.reactiveElementVersions??(C.reactiveElementVersions=[])).push("2.0.4");/**
12
12
  * @license
13
13
  * Copyright 2017 Google LLC
14
14
  * SPDX-License-Identifier: BSD-3-Clause
15
- */const L=globalThis,et=L.trustedTypes,Ht=et?et.createPolicy("lit-html",{createHTML:s=>s}):void 0,ae="$lit$",x=`lit$${(Math.random()+"").slice(9)}$`,ce="?"+x,qe=`<${ce}>`,O=document,B=()=>O.createComment(""),z=s=>s===null||typeof s!="object"&&typeof s!="function",he=Array.isArray,Ke=s=>he(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",ht=`[
15
+ */const L=globalThis,tt=L.trustedTypes,Ht=tt?tt.createPolicy("lit-html",{createHTML:s=>s}):void 0,ae="$lit$",x=`lit$${(Math.random()+"").slice(9)}$`,ce="?"+x,qe=`<${ce}>`,O=document,B=()=>O.createComment(""),z=s=>s===null||typeof s!="object"&&typeof s!="function",he=Array.isArray,Ke=s=>he(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",ht=`[
16
16
  \f\r]`,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Lt=/-->/g,Dt=/>/g,S=RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
17
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Bt=/'/g,zt=/"/g,le=/^(?:script|style|textarea|title)$/i,Ze=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),R=Ze(1),T=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Wt=new WeakMap,P=O.createTreeWalker(O,129);function de(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ht!==void 0?Ht.createHTML(t):t}const Je=(s,t)=>{const e=s.length-1,i=[];let r,n=t===2?"<svg>":"",o=j;for(let a=0;a<e;a++){const c=s[a];let h,l,d=-1,p=0;for(;p<c.length&&(o.lastIndex=p,l=o.exec(c),l!==null);)p=o.lastIndex,o===j?l[1]==="!--"?o=Lt:l[1]!==void 0?o=Dt:l[2]!==void 0?(le.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=S):l[3]!==void 0&&(o=S):o===S?l[0]===">"?(o=r??j,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,h=l[1],o=l[3]===void 0?S:l[3]==='"'?zt:Bt):o===zt||o===Bt?o=S:o===Lt||o===Dt?o=j:(o=S,r=void 0);const f=o===S&&s[a+1].startsWith("/>")?" ":"";n+=o===j?c+qe:d>=0?(i.push(h),c.slice(0,d)+ae+c.slice(d)+x+f):c+x+(d===-2?a:f)}return[de(s,n+(s[e]||"<?>")+(t===2?"</svg>":"")),i]};class W{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,o=0;const a=t.length-1,c=this.parts,[h,l]=Je(t,e);if(this.el=W.createElement(h,i),P.currentNode=this.el.content,e===2){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(r=P.nextNode())!==null&&c.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const d of r.getAttributeNames())if(d.endsWith(ae)){const p=l[o++],f=r.getAttribute(d).split(x),g=/([.?@])?(.*)/.exec(p);c.push({type:1,index:n,name:g[2],strings:f,ctor:g[1]==="."?Xe:g[1]==="?"?Qe:g[1]==="@"?ti:rt}),r.removeAttribute(d)}else d.startsWith(x)&&(c.push({type:6,index:n}),r.removeAttribute(d));if(le.test(r.tagName)){const d=r.textContent.split(x),p=d.length-1;if(p>0){r.textContent=et?et.emptyScript:"";for(let f=0;f<p;f++)r.append(d[f],B()),P.nextNode(),c.push({type:2,index:++n});r.append(d[p],B())}}}else if(r.nodeType===8)if(r.data===ce)c.push({type:2,index:n});else{let d=-1;for(;(d=r.data.indexOf(x,d+1))!==-1;)c.push({type:7,index:n}),d+=x.length-1}n++}}static createElement(t,e){const i=O.createElement("template");return i.innerHTML=t,i}}function k(s,t,e=s,i){var o,a;if(t===T)return t;let r=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const n=z(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),n===void 0?r=void 0:(r=new n(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=k(s,r._$AS(s,t.values),r,i)),t}class Ge{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,r=((t==null?void 0:t.creationScope)??O).importNode(e,!0);P.currentNode=r;let n=P.nextNode(),o=0,a=0,c=i[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new q(n,n.nextSibling,this,t):c.type===1?h=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(h=new ei(n,this,t)),this._$AV.push(h),c=i[++a]}o!==(c==null?void 0:c.index)&&(n=P.nextNode(),o++)}return P.currentNode=O,r}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class q{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=k(this,t,e),z(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==T&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ke(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==u&&z(this._$AH)?this._$AA.nextSibling.data=t:this.T(O.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=W.createElement(de(i.h,i.h[0]),this.options)),i);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(e);else{const o=new Ge(r,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=Wt.get(t.strings);return e===void 0&&Wt.set(t.strings,e=new W(t)),e}k(t){he(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const n of t)r===e.length?e.push(i=new q(this.S(B()),this.S(B()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class rt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,n){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=u}_$AI(t,e=this,i,r){const n=this.strings;let o=!1;if(n===void 0)t=k(this,t,e,0),o=!z(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const a=t;let c,h;for(t=n[0],c=0;c<n.length-1;c++)h=k(this,a[i+c],e,c),h===T&&(h=this._$AH[c]),o||(o=!z(h)||h!==this._$AH[c]),h===u?t=u:t!==u&&(t+=(h??"")+n[c+1]),this._$AH[c]=h}o&&!r&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Xe extends rt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}}class Qe extends rt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}}class ti extends rt{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){if((t=k(this,t,e,0)??u)===T)return;const i=this._$AH,r=t===u&&i!==u||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==u&&(i===u||r);r&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class ei{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){k(this,t)}}const lt=L.litHtmlPolyfillSupport;lt==null||lt(W,q),(L.litHtmlVersions??(L.litHtmlVersions=[])).push("3.1.2");const ii=(s,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let r=i._$litPart$;if(r===void 0){const n=(e==null?void 0:e.renderBefore)??null;i._$litPart$=r=new q(t.insertBefore(B(),n),n,void 0,e??{})}return r._$AI(s),r};/**
17
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Bt=/'/g,zt=/"/g,le=/^(?:script|style|textarea|title)$/i,Ze=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),R=Ze(1),T=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Wt=new WeakMap,P=O.createTreeWalker(O,129);function de(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ht!==void 0?Ht.createHTML(t):t}const Je=(s,t)=>{const e=s.length-1,i=[];let r,n=t===2?"<svg>":"",o=j;for(let a=0;a<e;a++){const c=s[a];let h,l,d=-1,p=0;for(;p<c.length&&(o.lastIndex=p,l=o.exec(c),l!==null);)p=o.lastIndex,o===j?l[1]==="!--"?o=Lt:l[1]!==void 0?o=Dt:l[2]!==void 0?(le.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=S):l[3]!==void 0&&(o=S):o===S?l[0]===">"?(o=r??j,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,h=l[1],o=l[3]===void 0?S:l[3]==='"'?zt:Bt):o===zt||o===Bt?o=S:o===Lt||o===Dt?o=j:(o=S,r=void 0);const f=o===S&&s[a+1].startsWith("/>")?" ":"";n+=o===j?c+qe:d>=0?(i.push(h),c.slice(0,d)+ae+c.slice(d)+x+f):c+x+(d===-2?a:f)}return[de(s,n+(s[e]||"<?>")+(t===2?"</svg>":"")),i]};class W{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,o=0;const a=t.length-1,c=this.parts,[h,l]=Je(t,e);if(this.el=W.createElement(h,i),P.currentNode=this.el.content,e===2){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(r=P.nextNode())!==null&&c.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const d of r.getAttributeNames())if(d.endsWith(ae)){const p=l[o++],f=r.getAttribute(d).split(x),g=/([.?@])?(.*)/.exec(p);c.push({type:1,index:n,name:g[2],strings:f,ctor:g[1]==="."?Xe:g[1]==="?"?Qe:g[1]==="@"?ti:st}),r.removeAttribute(d)}else d.startsWith(x)&&(c.push({type:6,index:n}),r.removeAttribute(d));if(le.test(r.tagName)){const d=r.textContent.split(x),p=d.length-1;if(p>0){r.textContent=tt?tt.emptyScript:"";for(let f=0;f<p;f++)r.append(d[f],B()),P.nextNode(),c.push({type:2,index:++n});r.append(d[p],B())}}}else if(r.nodeType===8)if(r.data===ce)c.push({type:2,index:n});else{let d=-1;for(;(d=r.data.indexOf(x,d+1))!==-1;)c.push({type:7,index:n}),d+=x.length-1}n++}}static createElement(t,e){const i=O.createElement("template");return i.innerHTML=t,i}}function k(s,t,e=s,i){var o,a;if(t===T)return t;let r=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const n=z(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),n===void 0?r=void 0:(r=new n(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=k(s,r._$AS(s,t.values),r,i)),t}class Ge{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,r=((t==null?void 0:t.creationScope)??O).importNode(e,!0);P.currentNode=r;let n=P.nextNode(),o=0,a=0,c=i[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new Y(n,n.nextSibling,this,t):c.type===1?h=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(h=new ei(n,this,t)),this._$AV.push(h),c=i[++a]}o!==(c==null?void 0:c.index)&&(n=P.nextNode(),o++)}return P.currentNode=O,r}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Y{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=k(this,t,e),z(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==T&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ke(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==u&&z(this._$AH)?this._$AA.nextSibling.data=t:this.T(O.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=W.createElement(de(i.h,i.h[0]),this.options)),i);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(e);else{const o=new Ge(r,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=Wt.get(t.strings);return e===void 0&&Wt.set(t.strings,e=new W(t)),e}k(t){he(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const n of t)r===e.length?e.push(i=new Y(this.S(B()),this.S(B()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class st{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,n){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=u}_$AI(t,e=this,i,r){const n=this.strings;let o=!1;if(n===void 0)t=k(this,t,e,0),o=!z(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const a=t;let c,h;for(t=n[0],c=0;c<n.length-1;c++)h=k(this,a[i+c],e,c),h===T&&(h=this._$AH[c]),o||(o=!z(h)||h!==this._$AH[c]),h===u?t=u:t!==u&&(t+=(h??"")+n[c+1]),this._$AH[c]=h}o&&!r&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Xe extends st{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}}class Qe extends st{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}}class ti extends st{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){if((t=k(this,t,e,0)??u)===T)return;const i=this._$AH,r=t===u&&i!==u||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==u&&(i===u||r);r&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class ei{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){k(this,t)}}const lt=L.litHtmlPolyfillSupport;lt==null||lt(W,Y),(L.litHtmlVersions??(L.litHtmlVersions=[])).push("3.1.2");const ii=(s,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let r=i._$litPart$;if(r===void 0){const n=(e==null?void 0:e.renderBefore)??null;i._$litPart$=r=new Y(t.insertBefore(B(),n),n,void 0,e??{})}return r._$AI(s),r};/**
18
18
  * @license
19
19
  * Copyright 2017 Google LLC
20
20
  * SPDX-License-Identifier: BSD-3-Clause
@@ -22,11 +22,11 @@
22
22
  * @license
23
23
  * Copyright 2017 Google LLC
24
24
  * SPDX-License-Identifier: BSD-3-Clause
25
- */const si={attribute:!0,type:String,converter:tt,reflect:!1,hasChanged:xt},ri=(s=si,t,e)=>{const{kind:i,metadata:r}=e;let n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),n.set(e.name,s),i==="accessor"){const{name:o}=e;return{set(a){const c=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,c,s)},init(a){return a!==void 0&&this.P(o,void 0,s),a}}}if(i==="setter"){const{name:o}=e;return function(a){const c=this[o];t.call(this,a),this.requestUpdate(o,c,s)}}throw Error("Unsupported decorator location: "+i)};function m(s){return(t,e)=>typeof e=="object"?ri(s,t,e):((i,r,n)=>{const o=r.hasOwnProperty(n);return r.constructor.createProperty(n,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(r,n):void 0})(s,t,e)}/**
25
+ */const si={attribute:!0,type:String,converter:Q,reflect:!1,hasChanged:xt},ri=(s=si,t,e)=>{const{kind:i,metadata:r}=e;let n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),n.set(e.name,s),i==="accessor"){const{name:o}=e;return{set(a){const c=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,c,s)},init(a){return a!==void 0&&this.P(o,void 0,s),a}}}if(i==="setter"){const{name:o}=e;return function(a){const c=this[o];t.call(this,a),this.requestUpdate(o,c,s)}}throw Error("Unsupported decorator location: "+i)};function m(s){return(t,e)=>typeof e=="object"?ri(s,t,e):((i,r,n)=>{const o=r.hasOwnProperty(n);return r.constructor.createProperty(n,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(r,n):void 0})(s,t,e)}/**
26
26
  * @license
27
27
  * Copyright 2017 Google LLC
28
28
  * SPDX-License-Identifier: BSD-3-Clause
29
- */function U(s){return m({...s,state:!0,attribute:!1})}var ni=Object.defineProperty,oi=Object.getOwnPropertyDescriptor,ai=(s,t,e,i)=>{for(var r=i>1?void 0:i?oi(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ni(t,e,r),r};class nt extends A{constructor(){super(...arguments),this.anchor="BottomRight"}appendChild(t){var e;return(e=this.shadowRoot)==null||e.appendChild(t),t}render(){return this.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right"),u}}nt.styles=[N`
29
+ */function U(s){return m({...s,state:!0,attribute:!1})}var ni=Object.defineProperty,oi=Object.getOwnPropertyDescriptor,ai=(s,t,e,i)=>{for(var r=i>1?void 0:i?oi(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ni(t,e,r),r};class rt extends A{constructor(){super(...arguments),this.anchor="BottomRight"}appendChild(t){var e;return(e=this.shadowRoot)==null||e.appendChild(t),t}render(){return this.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right"),u}}rt.styles=[N`
30
30
  :host {
31
31
  position: fixed;
32
32
  display: flex;
@@ -42,7 +42,7 @@
42
42
  bottom: 20px;
43
43
  left: 20px;
44
44
  }
45
- `];ai([m({attribute:!0})],nt.prototype,"anchor",2);/**
45
+ `];ai([m({attribute:!0})],rt.prototype,"anchor",2);/**
46
46
  * @license
47
47
  * Copyright 2017 Google LLC
48
48
  * SPDX-License-Identifier: BSD-3-Clause
@@ -54,7 +54,7 @@
54
54
  * @license
55
55
  * Copyright 2017 Google LLC
56
56
  * SPDX-License-Identifier: BSD-3-Clause
57
- */const D=(s,t)=>{var i;const e=s._$AN;if(e===void 0)return!1;for(const r of e)(i=r._$AO)==null||i.call(r,t,!1),D(r,t);return!0},it=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while((e==null?void 0:e.size)===0)},ue=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),di(t)}};function hi(s){this._$AN!==void 0?(it(this),this._$AM=s,ue(this)):this._$AM=s}function li(s,t=!1,e=0){const i=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(i))for(let n=e;n<i.length;n++)D(i[n],!1),it(i[n]);else i!=null&&(D(i,!1),it(i));else D(this,s)}const di=s=>{s.type==Ct.CHILD&&(s._$AP??(s._$AP=li),s._$AQ??(s._$AQ=hi))};class fe extends pe{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),ue(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,r;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(r=this.disconnected)==null||r.call(this)),e&&(D(this,t),it(this))}setValue(t){if(ci(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}const pi=new WeakMap;let Ft=0;const pt=new Map,Vt=new WeakSet,Yt=()=>new Promise(s=>requestAnimationFrame(s)),ui=[{transform:"translateX(100%) scale(0)",opacity:0}],qt=(s,t)=>{const e=s-t;return e===0?void 0:e},Kt=(s,t)=>{const e=s/t;return e===1?void 0:e},ut={left:(s,t)=>{const e=qt(s,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateX(${e}px)`}},top:(s,t)=>{const e=qt(s,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateY(${e}px)`}},width:(s,t)=>{let e;t===0&&(t=1,e={width:"1px"});const i=Kt(s,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleX(${i})`}},height:(s,t)=>{let e;t===0&&(t=1,e={height:"1px"});const i=Kt(s,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleY(${i})`}}},fi={duration:333,easing:"ease-in-out"},gi=["left","top","width","height","opacity","color","background"],Zt=new WeakMap;class mi extends fe{constructor(t){if(super(t),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,t.type===Ct.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){var t;(t=this.resolveFinished)==null||t.call(this),this.finished=new Promise(e=>{this.l=e})}async resolveFinished(){var t;(t=this.l)==null||t.call(this),this.l=void 0}render(t){return u}getController(){return pi.get(this.u)}isDisabled(){var t;return this.options.disabled||((t=this.getController())==null?void 0:t.disabled)}update(t,[e]){var r;const i=this.u===void 0;return i&&(this.u=(r=t.options)==null?void 0:r.host,this.u.addController(this),this.u.updateComplete.then(n=>this.t=!0),this.element=t.element,Zt.set(this.element,this)),this.optionsOrCallback=e,(i||typeof e!="function")&&this.p(e),this.render(e)}p(t){t=t??{};const e=this.getController();e!==void 0&&((t={...e.defaultOptions,...t}).keyframeOptions={...e.defaultOptions.keyframeOptions,...t.keyframeOptions}),t.properties??(t.properties=gi),this.options=t}m(){const t={},e=this.element.getBoundingClientRect(),i=getComputedStyle(this.element);return this.options.properties.forEach(r=>{const n=e[r]??(ut[r]?void 0:i[r]),o=Number(n);t[r]=isNaN(o)?n+"":o}),t}v(){let t,e=!0;return this.options.guard&&(t=this.options.guard(),e=((i,r)=>{if(Array.isArray(i)){if(Array.isArray(r)&&r.length===i.length&&i.every((n,o)=>n===r[o]))return!1}else if(r===i)return!1;return!0})(t,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&e&&this.element.isConnected,this.h&&(this._=Array.isArray(t)?Array.from(t):t),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 t;this.prepare(),await Yt;const e=this.O(),i=this.j(this.options.keyframeOptions,e),r=this.m();if(this.A!==void 0){const{from:n,to:o}=this.N(this.A,r,e);this.log("measured",[this.A,r,n,o]),t=this.calculateKeyframes(n,o)}else{const n=pt.get(this.options.inId);if(n){pt.delete(this.options.inId);const{from:o,to:a}=this.N(n,r,e);t=this.calculateKeyframes(o,a),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,Ft++,t.forEach(c=>c.zIndex=Ft)}else this.options.in&&(t=[...this.options.in,{}])}this.animate(t,i)}resetStyles(){this.P!==void 0&&(this.element.setAttribute("style",this.P??""),this.P=void 0)}commitStyles(){var t,e;this.P=this.element.getAttribute("style"),(t=this.webAnimation)==null||t.commitStyles(),(e=this.webAnimation)==null||e.cancel()}reconnected(){}async disconnected(){var e;if(!this.h||(this.options.id!==void 0&&pt.set(this.options.id,this.A),this.options.out===void 0))return;if(this.prepare(),await Yt(),(e=this.i)==null?void 0:e.isConnected){const i=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,i),this.options.stabilizeOut){const r=this.m();this.log("stabilizing out");const n=this.A.left-r.left,o=this.A.top-r.top;getComputedStyle(this.element).position!=="static"||n===0&&o===0||(this.element.style.position="relative"),n!==0&&(this.element.style.left=n+"px"),o!==0&&(this.element.style.top=o+"px")}}const t=this.j(this.options.keyframeOptions);await this.animate(this.options.out,t),this.element.remove()}prepare(){this.createFinished()}start(){var t,e;(e=(t=this.options).onStart)==null||e.call(t,this)}didFinish(t){var e,i;t&&((i=(e=this.options).onComplete)==null||i.call(e,this)),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}O(){const t=[];for(let e=this.element.parentNode;e;e=e==null?void 0:e.parentNode){const i=Zt.get(e);i&&!i.isDisabled()&&i&&t.push(i)}return t}get isHostRendered(){const t=Vt.has(this.u);return t||this.u.updateComplete.then(()=>{Vt.add(this.u)}),t}j(t,e=this.O()){const i={...fi};return e.forEach(r=>Object.assign(i,r.options.keyframeOptions)),Object.assign(i,t),i}N(t,e,i){t={...t},e={...e};const r=i.map(a=>a.animatingProperties).filter(a=>a!==void 0);let n=1,o=1;return r.length>0&&(r.forEach(a=>{a.width&&(n/=a.width),a.height&&(o/=a.height)}),t.left!==void 0&&e.left!==void 0&&(t.left=n*t.left,e.left=n*e.left),t.top!==void 0&&e.top!==void 0&&(t.top=o*t.top,e.top=o*e.top)),{from:t,to:e}}calculateKeyframes(t,e,i=!1){const r={},n={};let o=!1;const a={};for(const c in e){const h=t[c],l=e[c];if(c in ut){const d=ut[c];if(h===void 0||l===void 0)continue;const p=d(h,l);p.transform!==void 0&&(a[c]=p.value,o=!0,r.transform=`${r.transform??""} ${p.transform}`,p.overrideFrom!==void 0&&Object.assign(r,p.overrideFrom))}else h!==l&&h!==void 0&&l!==void 0&&(o=!0,r[c]=h,n[c]=l)}return r.transformOrigin=n.transformOrigin=i?"center center":"top left",this.animatingProperties=a,o?[r,n]:void 0}async animate(t,e=this.options.keyframeOptions){this.start(),this.frames=t;let i=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=t=this.options.onFrames(this),this.log("modified frames",t)),t!==void 0)){this.log("animate",[t,e]),i=!0,this.webAnimation=this.element.animate(t,e);const r=this.getController();r==null||r.add(this);try{await this.webAnimation.finished}catch{}r==null||r.remove(this)}return this.didFinish(i),i}isAnimating(){var t,e;return((t=this.webAnimation)==null?void 0:t.playState)==="running"||((e=this.webAnimation)==null?void 0:e.pending)}log(t,e){this.shouldLog&&!this.isDisabled()&&console.log(t,this.options.id,e)}}const vi=St(mi),yi={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>'};/**
57
+ */const D=(s,t)=>{var i;const e=s._$AN;if(e===void 0)return!1;for(const r of e)(i=r._$AO)==null||i.call(r,t,!1),D(r,t);return!0},et=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while((e==null?void 0:e.size)===0)},ue=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),di(t)}};function hi(s){this._$AN!==void 0?(et(this),this._$AM=s,ue(this)):this._$AM=s}function li(s,t=!1,e=0){const i=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(i))for(let n=e;n<i.length;n++)D(i[n],!1),et(i[n]);else i!=null&&(D(i,!1),et(i));else D(this,s)}const di=s=>{s.type==Ct.CHILD&&(s._$AP??(s._$AP=li),s._$AQ??(s._$AQ=hi))};class fe extends pe{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),ue(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,r;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(r=this.disconnected)==null||r.call(this)),e&&(D(this,t),et(this))}setValue(t){if(ci(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}const pi=new WeakMap;let Ft=0;const pt=new Map,Vt=new WeakSet,Yt=()=>new Promise(s=>requestAnimationFrame(s)),ui=[{transform:"translateX(100%) scale(0)",opacity:0}],qt=(s,t)=>{const e=s-t;return e===0?void 0:e},Kt=(s,t)=>{const e=s/t;return e===1?void 0:e},ut={left:(s,t)=>{const e=qt(s,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateX(${e}px)`}},top:(s,t)=>{const e=qt(s,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateY(${e}px)`}},width:(s,t)=>{let e;t===0&&(t=1,e={width:"1px"});const i=Kt(s,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleX(${i})`}},height:(s,t)=>{let e;t===0&&(t=1,e={height:"1px"});const i=Kt(s,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleY(${i})`}}},fi={duration:333,easing:"ease-in-out"},gi=["left","top","width","height","opacity","color","background"],Zt=new WeakMap;class mi extends fe{constructor(t){if(super(t),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,t.type===Ct.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){var t;(t=this.resolveFinished)==null||t.call(this),this.finished=new Promise(e=>{this.l=e})}async resolveFinished(){var t;(t=this.l)==null||t.call(this),this.l=void 0}render(t){return u}getController(){return pi.get(this.u)}isDisabled(){var t;return this.options.disabled||((t=this.getController())==null?void 0:t.disabled)}update(t,[e]){var r;const i=this.u===void 0;return i&&(this.u=(r=t.options)==null?void 0:r.host,this.u.addController(this),this.u.updateComplete.then(n=>this.t=!0),this.element=t.element,Zt.set(this.element,this)),this.optionsOrCallback=e,(i||typeof e!="function")&&this.p(e),this.render(e)}p(t){t=t??{};const e=this.getController();e!==void 0&&((t={...e.defaultOptions,...t}).keyframeOptions={...e.defaultOptions.keyframeOptions,...t.keyframeOptions}),t.properties??(t.properties=gi),this.options=t}m(){const t={},e=this.element.getBoundingClientRect(),i=getComputedStyle(this.element);return this.options.properties.forEach(r=>{const n=e[r]??(ut[r]?void 0:i[r]),o=Number(n);t[r]=isNaN(o)?n+"":o}),t}v(){let t,e=!0;return this.options.guard&&(t=this.options.guard(),e=((i,r)=>{if(Array.isArray(i)){if(Array.isArray(r)&&r.length===i.length&&i.every((n,o)=>n===r[o]))return!1}else if(r===i)return!1;return!0})(t,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&e&&this.element.isConnected,this.h&&(this._=Array.isArray(t)?Array.from(t):t),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 t;this.prepare(),await Yt;const e=this.O(),i=this.j(this.options.keyframeOptions,e),r=this.m();if(this.A!==void 0){const{from:n,to:o}=this.N(this.A,r,e);this.log("measured",[this.A,r,n,o]),t=this.calculateKeyframes(n,o)}else{const n=pt.get(this.options.inId);if(n){pt.delete(this.options.inId);const{from:o,to:a}=this.N(n,r,e);t=this.calculateKeyframes(o,a),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,Ft++,t.forEach(c=>c.zIndex=Ft)}else this.options.in&&(t=[...this.options.in,{}])}this.animate(t,i)}resetStyles(){this.P!==void 0&&(this.element.setAttribute("style",this.P??""),this.P=void 0)}commitStyles(){var t,e;this.P=this.element.getAttribute("style"),(t=this.webAnimation)==null||t.commitStyles(),(e=this.webAnimation)==null||e.cancel()}reconnected(){}async disconnected(){var e;if(!this.h||(this.options.id!==void 0&&pt.set(this.options.id,this.A),this.options.out===void 0))return;if(this.prepare(),await Yt(),(e=this.i)==null?void 0:e.isConnected){const i=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,i),this.options.stabilizeOut){const r=this.m();this.log("stabilizing out");const n=this.A.left-r.left,o=this.A.top-r.top;getComputedStyle(this.element).position!=="static"||n===0&&o===0||(this.element.style.position="relative"),n!==0&&(this.element.style.left=n+"px"),o!==0&&(this.element.style.top=o+"px")}}const t=this.j(this.options.keyframeOptions);await this.animate(this.options.out,t),this.element.remove()}prepare(){this.createFinished()}start(){var t,e;(e=(t=this.options).onStart)==null||e.call(t,this)}didFinish(t){var e,i;t&&((i=(e=this.options).onComplete)==null||i.call(e,this)),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}O(){const t=[];for(let e=this.element.parentNode;e;e=e==null?void 0:e.parentNode){const i=Zt.get(e);i&&!i.isDisabled()&&i&&t.push(i)}return t}get isHostRendered(){const t=Vt.has(this.u);return t||this.u.updateComplete.then(()=>{Vt.add(this.u)}),t}j(t,e=this.O()){const i={...fi};return e.forEach(r=>Object.assign(i,r.options.keyframeOptions)),Object.assign(i,t),i}N(t,e,i){t={...t},e={...e};const r=i.map(a=>a.animatingProperties).filter(a=>a!==void 0);let n=1,o=1;return r.length>0&&(r.forEach(a=>{a.width&&(n/=a.width),a.height&&(o/=a.height)}),t.left!==void 0&&e.left!==void 0&&(t.left=n*t.left,e.left=n*e.left),t.top!==void 0&&e.top!==void 0&&(t.top=o*t.top,e.top=o*e.top)),{from:t,to:e}}calculateKeyframes(t,e,i=!1){const r={},n={};let o=!1;const a={};for(const c in e){const h=t[c],l=e[c];if(c in ut){const d=ut[c];if(h===void 0||l===void 0)continue;const p=d(h,l);p.transform!==void 0&&(a[c]=p.value,o=!0,r.transform=`${r.transform??""} ${p.transform}`,p.overrideFrom!==void 0&&Object.assign(r,p.overrideFrom))}else h!==l&&h!==void 0&&l!==void 0&&(o=!0,r[c]=h,n[c]=l)}return r.transformOrigin=n.transformOrigin=i?"center center":"top left",this.animatingProperties=a,o?[r,n]:void 0}async animate(t,e=this.options.keyframeOptions){this.start(),this.frames=t;let i=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=t=this.options.onFrames(this),this.log("modified frames",t)),t!==void 0)){this.log("animate",[t,e]),i=!0,this.webAnimation=this.element.animate(t,e);const r=this.getController();r==null||r.add(this);try{await this.webAnimation.finished}catch{}r==null||r.remove(this)}return this.didFinish(i),i}isAnimating(){var t,e;return((t=this.webAnimation)==null?void 0:t.playState)==="running"||((e=this.webAnimation)==null?void 0:e.pending)}log(t,e){this.shouldLog&&!this.isDisabled()&&console.log(t,this.options.id,e)}}const vi=St(mi),yi={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>'};/**
58
58
  * @license
59
59
  * Copyright 2018 Google LLC
60
60
  * SPDX-License-Identifier: BSD-3-Clause
@@ -62,7 +62,7 @@
62
62
  * @license
63
63
  * Copyright 2020 Google LLC
64
64
  * SPDX-License-Identifier: BSD-3-Clause
65
- */const me=()=>new bi;class bi{}const ft=new WeakMap,ve=St(class extends fe{render(s){return u}update(s,[t]){var i;const e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=s.options)==null?void 0:i.host,this.rt(this.ct=s.element)),u}rt(s){if(typeof this.Y=="function"){const t=this.ht??globalThis;let e=ft.get(t);e===void 0&&(e=new WeakMap,ft.set(t,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,t;return typeof this.Y=="function"?(s=ft.get(this.ht??globalThis))==null?void 0:s.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var wi=Object.defineProperty,$i=Object.getOwnPropertyDescriptor,K=(s,t,e,i)=>{for(var r=i>1?void 0:i?$i(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&wi(t,e,r),r};class b extends A{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=me(),this.widgetActive$=new re(!1),this.componentIsDestroyed$=new $t}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 t;if(!((t=this.application)!=null&&t.root)){console.warn("Could not activate widget. No root element assigned to widget.");return}this.active=!this.active,this.active?(this.application.appendToDOM(),this.widgetActive$.next(!0),this.hideTrigger()):(this.application.hide(),this.widgetActive$.next(!1),this.showTrigger())}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&ge(this.application.settings.branding,this)}async _renderSymbol(){var a,c,h;const t=(a=this.application)==null?void 0:a.branding(),e=(c=t==null?void 0:t.graphics)==null?void 0:c.trigger;if(e)return R` <img src=${e} class="trigger-icon" alt="" /> `;const i=(h=this.application)==null?void 0:h.triggerIcon;if(!i)return u;const r=async l=>yi,{type:n,content:o}=i;switch(n){case"Telia":{const l=await r();return l?R`<telia-icon
65
+ */const me=()=>new bi;class bi{}const ft=new WeakMap,ve=St(class extends fe{render(s){return u}update(s,[t]){var i;const e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=s.options)==null?void 0:i.host,this.rt(this.ct=s.element)),u}rt(s){if(typeof this.Y=="function"){const t=this.ht??globalThis;let e=ft.get(t);e===void 0&&(e=new WeakMap,ft.set(t,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,t;return typeof this.Y=="function"?(s=ft.get(this.ht??globalThis))==null?void 0:s.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var wi=Object.defineProperty,$i=Object.getOwnPropertyDescriptor,q=(s,t,e,i)=>{for(var r=i>1?void 0:i?$i(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&wi(t,e,r),r};class b extends A{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=me(),this.widgetActive$=new re(!1),this.componentIsDestroyed$=new $t}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 t;if(!((t=this.application)!=null&&t.root)){console.warn("Could not activate widget. No root element assigned to widget.");return}this.active=!this.active,this.active?(this.application.appendToDOM(),this.widgetActive$.next(!0),this.hideTrigger()):(this.application.hide(),this.widgetActive$.next(!1),this.showTrigger())}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&ge(this.application.settings.branding,this)}async _renderSymbol(){var a,c,h;const t=(a=this.application)==null?void 0:a.branding(),e=(c=t==null?void 0:t.graphics)==null?void 0:c.trigger;if(e)return R` <img src=${e} class="trigger-icon" alt="" /> `;const i=(h=this.application)==null?void 0:h.triggerIcon;if(!i)return u;const r=async l=>yi,{type:n,content:o}=i;switch(n){case"Telia":{const l=await r();return l?R`<telia-icon
66
66
  class="trigger-icon"
67
67
  svg=${l.svg}
68
68
  size="lg"
@@ -244,7 +244,7 @@
244
244
  .trigger-label:hover {
245
245
  opacity: 0.8;
246
246
  }
247
- `];K([m({attribute:!1})],b.prototype,"application",2);K([U()],b.prototype,"active",2);K([U()],b.prototype,"triggerVisible",2);K([U()],b.prototype,"loaded",2);K([U()],b.prototype,"icon",2);var _i=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor,E=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ai(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&_i(t,e,r),r};const ye=s=>{class t extends s{constructor(){super(...arguments),this.properties={},this.context={},this.layout={},this.nodes=[]}writeProperties(i){this.properties=i}writeLayout(i){this.layout=i}writeContext(i){this.context=i}addChild(i){i.parent=this,this.nodes.push(i)}connectedCallback(){super.connectedCallback(),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),this.application.mountComponent(this)}}return t.styles=[N`
247
+ `];q([m({attribute:!1})],b.prototype,"application",2);q([U()],b.prototype,"active",2);q([U()],b.prototype,"triggerVisible",2);q([U()],b.prototype,"loaded",2);q([U()],b.prototype,"icon",2);var _i=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor,E=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ai(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&_i(t,e,r),r};const ye=s=>{class t extends s{constructor(){super(...arguments),this.properties={},this.context={},this.layout={},this.nodes=[]}writeProperties(i){this.properties=i}writeLayout(i){this.layout=i}writeContext(i){this.context=i}addChild(i){i.parent=this,this.nodes.push(i)}connectedCallback(){super.connectedCallback(),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),this.application.mountComponent(this)}}return t.styles=[N`
248
248
  :host {
249
249
  font-family: var(--font-family);
250
250
  grid-column: span var(--width);
@@ -284,9 +284,9 @@
284
284
  * @license
285
285
  * Copyright 2017 Google LLC
286
286
  * SPDX-License-Identifier: BSD-3-Clause
287
- */function Pi({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){i.set(this,new Gt(this,{context:s}))}),{get(){return t.get.call(this)},set(r){var n;return(n=i.get(this))==null||n.setValue(r),t.set.call(this,r)},init(r){var n;return(n=i.get(this))==null||n.setValue(r),r}};{t.constructor.addInitializer(o=>{i.set(o,new Gt(o,{context:s}))});const r=Object.getOwnPropertyDescriptor(t,e);let n;if(r===void 0){const o=new WeakMap;n={get:function(){return o.get(this)},set:function(a){i.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=r.set;n={...r,set:function(a){i.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(t,e,n)}}}var Oi=Object.defineProperty,Ti=Object.getOwnPropertyDescriptor,Ii=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ti(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&Oi(t,e,r),r};const be="application";class F extends A{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=me()}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(!this.wrapperRef.value)return;const t=this.application.settings;t!=null&&t.branding&&ge(t.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const t=this.application.styles(),e=this.wrapperRef.value;Object.entries(t).forEach(([i,r])=>{e.style.setProperty(`--${i}`,r)})}firstUpdated(t){this.applyBranding(),this.applyStyles()}render(){var i,r;const t=this.application.settings.components.conversation;return((r=(i=t==null?void 0:t.properties)==null?void 0:i.chat)==null?void 0:r.isThirdPartyWidget)?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===$.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")),R`<div class="widget-container" ${ve(this.wrapperRef)}>
287
+ */function Pi({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){i.set(this,new Gt(this,{context:s}))}),{get(){return t.get.call(this)},set(r){var n;return(n=i.get(this))==null||n.setValue(r),t.set.call(this,r)},init(r){var n;return(n=i.get(this))==null||n.setValue(r),r}};{t.constructor.addInitializer(o=>{i.set(o,new Gt(o,{context:s}))});const r=Object.getOwnPropertyDescriptor(t,e);let n;if(r===void 0){const o=new WeakMap;n={get:function(){return o.get(this)},set:function(a){i.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=r.set;n={...r,set:function(a){i.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(t,e,n)}}}var Oi=Object.defineProperty,Ti=Object.getOwnPropertyDescriptor,Ii=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ti(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&Oi(t,e,r),r};const be="application";class nt extends A{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=me()}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(!this.wrapperRef.value)return;const t=this.application.settings;t!=null&&t.branding&&ge(t.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const t=this.application.styles(),e=this.wrapperRef.value;Object.entries(t).forEach(([i,r])=>{e.style.setProperty(`--${i}`,r)})}firstUpdated(t){this.applyBranding(),this.applyStyles()}render(){var i,r;const t=this.application.settings.components.conversation;return((r=(i=t==null?void 0:t.properties)==null?void 0:i.chat)==null?void 0:r.isThirdPartyWidget)?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===$.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")),R`<div class="widget-container" ${ve(this.wrapperRef)}>
288
288
  ${xi(this.nodes,n=>n)}
289
- </div>`}}F.styles=N`
289
+ </div>`}}nt.styles=N`
290
290
  :host {
291
291
  --font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
292
292
  --spacing-xs: 0.2rem;
@@ -421,8 +421,8 @@
421
421
  animation: slideDown 0.3s linear;
422
422
  pointer-events: none;
423
423
  }
424
- `;Ii([m({attribute:!1}),Pi({context:be})],F.prototype,"application",2);class Ri{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...h]=a;return{definitionId:c,overrides:h}}return{definitionId:a,overrides:[]}},r=(a,c,h,l)=>{h.forEach(d=>{const p=i(d),f=l[p.definitionId];if(!f){console.error(`No definition found for component type '${p.definitionId}'.`);return}const g=a.createNode(f.type,f.type);g&&(g.name=p.definitionId,g.application=e,f.properties&&g.writeProperties(f.properties),f.context&&g.writeContext(f.context),f.layout&&g.writeLayout(f.layout),c.addChild(g),f.children&&r(a,g,f.children,l))})},{entry:n,components:o}=t;return r(this,this.root,[n],o),this.root}createRoot(){return typeof window<"u"&&(window.customElements.get("ace-wrapper")||window.customElements.define("ace-wrapper",F)),new F}createNode(t,e){const i=this.resolveComponent(e);if(!i)return console.warn(`Unable to resolve component: ${e}`),new Et;const r=new i;return r.type=e,r.name=t,r}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const we=class{constructor(){this.components=new Map}getComponent(s){const t=this.components.get(s);return t||console.warn(`Unable to resolve component: ${s}. You most likely forgot to register the required plugin.`),t}registerComponent(s,t){this.components.set(s,t)}async loadComponents(){const s=[...this.components.entries()].map(([t,e])=>e.then(i=>{this.defineAsWebComponent(t,i.default)}));await Promise.all(s)}defineAsWebComponent(s,t){const e=we.ResolveWebComponentName(s);customElements.get(e)||customElements.define(e,t)}};let $e=we;$e.ResolveWebComponentName=s=>`ace-${s}`;var v=(s=>(s.Necessary="necessary",s.Functional="functional",s.Analytics="analytics",s))(v||{});class _e{constructor(t,e,i){this.disallowedKeys=[],this.widgetId=t,this.storage=e==="localStorage"?window.localStorage:window.sessionStorage,this.policy=i}set(t,e,i){if(!this.disallowedKeys.includes(t))if(this.policy[i]){const r={value:e,category:i};this.storage.setItem(this._prefixKey(t),JSON.stringify(r))}else console.warn(`Storage policy does not allow storing items in category: ${i}`)}get(t){const e=this.storage.getItem(this._prefixKey(t));if(!e)return null;try{const i=JSON.parse(e);return this.policy[i.category]?i.value:(console.warn(`Storage policy does not allow retrieving items from category: ${i.category}`),null)}catch{return null}}removeItem(t){this.storage.removeItem(this._prefixKey(t))}enforcePolicy(){var t;for(const[e,i]of Object.entries(this.storage)){const r=(t=JSON.parse(i))==null?void 0:t.category;this.policy[r]||this.storage.removeItem(e)}}updatePolicy(t){this.policy=t,this.enforcePolicy()}disallowKey(t){this.disallowedKeys.includes(t)||this.disallowedKeys.push(t),this.removeItem(t)}_prefixKey(t){return`ace_${this.widgetId.substring(0,7)}-${t}`}}class ki{constructor(){this.texts=new Map}loadTexts(t){this.texts=new Map(Object.entries(t))}get(t,e){const i=this.texts.get(t);return i||e||null}getOrFallback(t,e){return this.texts.get(t)||e}}class Ni{constructor(t){this.widget=t,this.name=t.name}open(){this.widget.appendToDOM()}close(){this.widget.hide()}setZIndex(t){this.widget.setZIndex(t)}}class Ae{constructor(t,e,i,r,n){this.id=t,this.name=e,this.container=i,this.settings=r,this.options=n,this.platform=new Ri,this.texts=new ki,this.renderStrategy=$.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new $e,this.components=[],this.trigger=null,this.api=new Ni(this),this.renderStrategy=this.options.renderStrategy||$.Inline,this.triggerIcon=this.options.triggerIcon;const o={[v.Necessary]:!0,[v.Functional]:!0,[v.Analytics]:!0};this.storage=new _e(this.id,"sessionStorage",o),typeof n.autoActivate=="boolean"&&(this.autoActivate=n.autoActivate),n.anchor&&(this.anchor=n.anchor),this.container.register("$settings",r),this.texts.loadTexts(r.texts||{})}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(ne.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}}async loadPlugins(){for await(const t of this.plugins)await t(this)}styles(){return this.settings.styles||{}}branding(){return this.settings.branding||{}}plugin(t){return this.plugins.push(t),this}appendToDOM(){this.root&&(this.root.classList.add("expanded"),this.root.classList.remove("hidden"),document.body.appendChild(this.root)),this.storage.set("open",!0,v.Necessary)}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded")),this.storage.set("open",!1,v.Necessary)}setZIndex(t){this.root&&(this.root.style.zIndex=t.toString())}mute(){this.storage.set("muteAudioNotifications",!0,v.Necessary)}unmute(){this.storage.set("muteAudioNotifications",!1,v.Necessary)}registerComponent(t,e){this.componentResolver.registerComponent(t,e)}resolveComponent(t){return this.componentResolver.getComponent(t)}mountComponent(t){this.components.push(t)}getComponent(t){const e=this.components.find(i=>i.type===t);return e||null}_getTargetElement(){let t="bottom-right";if(this.anchor==="BottomRight"?t="bottom-right":this.anchor==="BottomLeft"&&(t="bottom-left"),this.renderStrategy===$.Trigger){let e=document.querySelector(`ace-trigger-slot.${t}`);return e||(e=new nt,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}render(){if(this.renderStrategy===$.Trigger){const t=new b;return t.application=this,this.trigger=t,this.storage.get("open")&&this.trigger.toggleActive(),t}return this.root}}const Ui=s=>new V(s),xe=class{constructor(s=xe.endpoint){this._endpoint=s}async getSite(s){const e=await(await fetch(s)).json();return e?{id:e.id,triggers:e.triggers||[],apps:e.widgets.map(i=>{let r=$.Inline;return i.renderStrategy==="Trigger"&&(r=$.Trigger),{id:i.id,widgetId:i.widgetId,renderStrategy:r,autoActivate:i.autoActivate,anchor:i.anchor,triggerIcon:{type:"Telia",content:i.triggerIcon}}})}:null}async getWidget(s){const e=await(await fetch(`${this._endpoint}/widget/${s}`)).json();return e?{name:e.name,config:JSON.parse(e.configuration)}:null}};let V=xe;V.endpoint="https://widgets.ace.teliacompany.net/api";class Mi{constructor(t){this.site=t}storagePolicy(t){var i;(((i=this.site.environment)==null?void 0:i.applications)||[]).forEach(r=>{if(r.storage){const n={[v.Analytics]:t.includes("analytics"),[v.Necessary]:t.includes("necessary"),[v.Functional]:t.includes("functional")};r.storage.updatePolicy(n)}})}disallowStorageKey(t){var e;(((e=this.site.environment)==null?void 0:e.applications)||[]).forEach(i=>{i.storage&&i.storage.disallowKey(t)})}}class Ce{constructor(){this.applications=[],this.container=new wt("environment",this),this.bootstrapped=!1,this.site=null,this.widgetAPIHandlers=new Map,this.siteConfigurationHandlers=[],setTimeout(()=>{this.notifyWidgetsOfCreation()},1e3)}async bootstrap(){await this.activate(),this.siteConfigurationHandlers.forEach(t=>{this.site&&t(this.site.api)});for(const[t,e]of this.widgetAPIHandlers)e.forEach(i=>{i()});this.bootstrapped=!0}async activate(){var e;const t=this.applications.filter(i=>i.autoActivate);(((e=this.site)==null?void 0:e.triggers)||[]).filter(i=>i.triggerType==="visit").forEach(i=>{const r=window.location.pathname,n=i.condition.outputs||[];i.condition.type==="url"&&n.forEach(o=>{const a=o.action.type==="render_widget";if((o.value===r||o.value==="*")&&a){let h={widgetId:""};try{h=JSON.parse(o.action.data)}catch{h={widgetId:""}}const l=t.findIndex(p=>p.id===h.widgetId)>-1,d=this.applications.find(p=>p.id===h.widgetId);d&&!l&&(d.autoActivate=!0,t.push(d))}})});for await(const i of t)await i.activate()}notifyWidgetsOfCreation(){document.querySelectorAll("ace-widget").forEach(e=>{const i=this.applications.find(r=>r.name===e.name);i&&e.dispatchEvent(new CustomEvent("environment-created",{detail:{widget:i}}))})}configure(t){if(!this.site||!this.bootstrapped){this.siteConfigurationHandlers.push(t);return}t(this.site.api)}widget(t,e){const i=this.applications.find(r=>r.name===t);if(!i){const r=this.widgetAPIHandlers.get(t)||[];r.push(()=>{const n=this.applications.find(o=>o.name===t);e(n==null?void 0:n.api)}),this.widgetAPIHandlers.set(t,r);return}e(i==null?void 0:i.api)}registerApp(t,e,i,r){const n=new wt(e,this),o=new Ae(t,e,n,i,r);this.applications.push(o)}registerSite(t){this.site=t}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class Se{constructor(t){this.configurations=[],this.httpClient=new V,this.api=new Mi(this),this.triggers=[],this.httpClient=new V,typeof t=="string"?this.url=t:(t.httpClient&&(this.httpClient=t.httpClient),this.loadFromConfig(t))}async load(t){const e=await this.httpClient.getSite(t);if(!e){console.warn(`Unable to load site from the url provided: ${t}`);return}this.configurations=e.apps,this.triggers=e.triggers||[]}loadFromConfig(t){this.configurations=t.apps.map(e=>({id:"",renderStrategy:e.renderStrategy,widgetId:e.widgetId,autoActivate:e.autoActivate,anchor:e.anchor,triggerIcon:{type:"Telia",content:e.triggerIcon||"question"}}))}setHttpClient(t){this.httpClient=t}async bootstrap(t){var e;this.url&&await this.load(this.url),this.environment=new Ce,this.addGlobal(this.environment);for await(const i of this.configurations){const r=await this.httpClient.getWidget(i.widgetId);r&&((e=this.environment)==null||e.registerApp(i.widgetId,r.name,r.config,{renderStrategy:i.renderStrategy,triggerIcon:i.triggerIcon,autoActivate:i.autoActivate,anchor:i.anchor}))}t(this.environment),this.environment.registerSite(this),await this.environment.bootstrap()}addGlobal(t){const e=globalThis.ace;((e==null?void 0:e._w)||[]).forEach(([i,r])=>{t.widget(i,r)}),((e==null?void 0:e._c)||[]).forEach(i=>{t.configure(i)}),globalThis.ace=t}}var ji=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,Pt=(s,t,e,i)=>{for(var r=i>1?void 0:i?Hi(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ji(t,e,r),r};class M extends A{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(t){this.widget=t.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const t=globalThis.widgets;t&&(this.widget=t.applications.find(e=>e.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return u;if(this.widget.renderStrategy===$.Trigger){const t=new b;return t.application=this.widget,t}return this.widget.render()}}M.styles=[N`
424
+ `;Ii([m({attribute:!1}),Pi({context:be})],nt.prototype,"application",2);class Ri{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...h]=a;return{definitionId:c,overrides:h}}return{definitionId:a,overrides:[]}},r=(a,c,h,l)=>{h.forEach(d=>{const p=i(d),f=l[p.definitionId];if(!f){console.error(`No definition found for component type '${p.definitionId}'.`);return}const g=a.createNode(f.type,f.type);g&&(g.name=p.definitionId,g.application=e,f.properties&&g.writeProperties(f.properties),f.context&&g.writeContext(f.context),f.layout&&g.writeLayout(f.layout),c.addChild(g),f.children&&r(a,g,f.children,l))})},{entry:n,components:o}=t;return r(this,this.root,[n],o),this.root}createRoot(){return typeof window<"u"&&(window.customElements.get("ace-wrapper")||window.customElements.define("ace-wrapper",nt)),document.createElement("ace-wrapper")}createNode(t,e){if(!this.resolveComponent(e))return console.warn(`Unable to resolve component: ${e}`),new Et;const r=document.createElement(`ace-${e}`);return r.type=e,r.name=t,r}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const we=class{constructor(){this.components=new Map}getComponent(s){const t=this.components.get(s);return t||console.warn(`Unable to resolve component: ${s}. You most likely forgot to register the required plugin.`),t}registerComponent(s,t){this.components.set(s,t)}async loadComponents(){const s=[...this.components.entries()].map(([t,e])=>e.then(i=>{this.defineAsWebComponent(t,i.default)}));await Promise.all(s)}defineAsWebComponent(s,t){const e=we.ResolveWebComponentName(s);customElements.get(e)||customElements.define(e,t)}};let $e=we;$e.ResolveWebComponentName=s=>`ace-${s}`;var v=(s=>(s.Necessary="necessary",s.Functional="functional",s.Analytics="analytics",s))(v||{});class _e{constructor(t,e,i){this.disallowedKeys=[],this.widgetId=t,this.storage=e==="localStorage"?window.localStorage:window.sessionStorage,this.policy=i}set(t,e,i){if(!this.disallowedKeys.includes(t))if(this.policy[i]){const r={value:e,category:i};this.storage.setItem(this._prefixKey(t),JSON.stringify(r))}else console.warn(`Storage policy does not allow storing items in category: ${i}`)}get(t){const e=this.storage.getItem(this._prefixKey(t));if(!e)return null;try{const i=JSON.parse(e);return this.policy[i.category]?i.value:(console.warn(`Storage policy does not allow retrieving items from category: ${i.category}`),null)}catch{return null}}removeItem(t){this.storage.removeItem(this._prefixKey(t))}enforcePolicy(){var t;for(const[e,i]of Object.entries(this.storage)){const r=(t=JSON.parse(i))==null?void 0:t.category;this.policy[r]||this.storage.removeItem(e)}}updatePolicy(t){this.policy=t,this.enforcePolicy()}disallowKey(t){this.disallowedKeys.includes(t)||this.disallowedKeys.push(t),this.removeItem(t)}_prefixKey(t){return`ace_${this.widgetId.substring(0,7)}-${t}`}}class ki{constructor(){this.texts=new Map}loadTexts(t){this.texts=new Map(Object.entries(t))}get(t,e){const i=this.texts.get(t);return i||e||null}getOrFallback(t,e){return this.texts.get(t)||e}}class Ni{constructor(t){this.widget=t,this.name=t.name}open(){this.widget.appendToDOM()}close(){this.widget.hide()}setZIndex(t){this.widget.setZIndex(t)}}class Ae{constructor(t,e,i,r,n){this.id=t,this.name=e,this.container=i,this.settings=r,this.options=n,this.platform=new Ri,this.texts=new ki,this.renderStrategy=$.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new $e,this.components=[],this.trigger=null,this.api=new Ni(this),this.renderStrategy=this.options.renderStrategy||$.Inline,this.triggerIcon=this.options.triggerIcon;const o={[v.Necessary]:!0,[v.Functional]:!0,[v.Analytics]:!0};this.storage=new _e(this.id,"sessionStorage",o),typeof n.autoActivate=="boolean"&&(this.autoActivate=n.autoActivate),n.anchor&&(this.anchor=n.anchor),this.container.register("$settings",r),this.texts.loadTexts(r.texts||{})}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(ne.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}}async loadPlugins(){for await(const t of this.plugins)await t(this)}styles(){return this.settings.styles||{}}branding(){return this.settings.branding||{}}plugin(t){return this.plugins.push(t),this}appendToDOM(){this.root&&(this.root.classList.add("expanded"),this.root.classList.remove("hidden"),document.body.appendChild(this.root)),this.storage.set("open",!0,v.Necessary)}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded")),this.storage.set("open",!1,v.Necessary)}setZIndex(t){this.root&&(this.root.style.zIndex=t.toString())}mute(){this.storage.set("muteAudioNotifications",!0,v.Necessary)}unmute(){this.storage.set("muteAudioNotifications",!1,v.Necessary)}registerComponent(t,e){this.componentResolver.registerComponent(t,e)}resolveComponent(t){return this.componentResolver.getComponent(t)}mountComponent(t){this.components.push(t)}getComponent(t){const e=this.components.find(i=>i.type===t);return e||null}_getTargetElement(){let t="bottom-right";if(this.anchor==="BottomRight"?t="bottom-right":this.anchor==="BottomLeft"&&(t="bottom-left"),this.renderStrategy===$.Trigger){let e=document.querySelector(`ace-trigger-slot.${t}`);return e||(e=new rt,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}render(){if(this.renderStrategy===$.Trigger){const t=new b;return t.application=this,this.trigger=t,this.storage.get("open")&&this.trigger.toggleActive(),t}return this.root}}const Ui=s=>new F(s),xe=class{constructor(s=xe.endpoint){this._endpoint=s}async getSite(s){const e=await(await fetch(s)).json();return e?{id:e.id,triggers:e.triggers||[],apps:e.widgets.map(i=>{let r=$.Inline;return i.renderStrategy==="Trigger"&&(r=$.Trigger),{id:i.id,widgetId:i.widgetId,renderStrategy:r,autoActivate:i.autoActivate,anchor:i.anchor,triggerIcon:{type:"Telia",content:i.triggerIcon}}})}:null}async getWidget(s){const e=await(await fetch(`${this._endpoint}/widget/${s}`)).json();return e?{name:e.name,config:JSON.parse(e.configuration)}:null}};let F=xe;F.endpoint="https://widgets.ace.teliacompany.net/api";class Mi{constructor(t){this.site=t}storagePolicy(t){var i;(((i=this.site.environment)==null?void 0:i.applications)||[]).forEach(r=>{if(r.storage){const n={[v.Analytics]:t.includes("analytics"),[v.Necessary]:t.includes("necessary"),[v.Functional]:t.includes("functional")};r.storage.updatePolicy(n)}})}disallowStorageKey(t){var e;(((e=this.site.environment)==null?void 0:e.applications)||[]).forEach(i=>{i.storage&&i.storage.disallowKey(t)})}}class Ce{constructor(){this.applications=[],this.container=new wt("environment",this),this.bootstrapped=!1,this.site=null,this.widgetAPIHandlers=new Map,this.siteConfigurationHandlers=[],setTimeout(()=>{this.notifyWidgetsOfCreation()},1e3)}async bootstrap(){await this.activate(),this.siteConfigurationHandlers.forEach(t=>{this.site&&t(this.site.api)});for(const[t,e]of this.widgetAPIHandlers)e.forEach(i=>{i()});this.bootstrapped=!0}async activate(){var e;const t=this.applications.filter(i=>i.autoActivate);(((e=this.site)==null?void 0:e.triggers)||[]).filter(i=>i.triggerType==="visit").forEach(i=>{const r=window.location.pathname,n=i.condition.outputs||[];i.condition.type==="url"&&n.forEach(o=>{const a=o.action.type==="render_widget";if((o.value===r||o.value==="*")&&a){let h={widgetId:""};try{h=JSON.parse(o.action.data)}catch{h={widgetId:""}}const l=t.findIndex(p=>p.id===h.widgetId)>-1,d=this.applications.find(p=>p.id===h.widgetId);d&&!l&&(d.autoActivate=!0,t.push(d))}})});for await(const i of t)await i.activate()}notifyWidgetsOfCreation(){document.querySelectorAll("ace-widget").forEach(e=>{const i=this.applications.find(r=>r.name===e.name);i&&e.dispatchEvent(new CustomEvent("environment-created",{detail:{widget:i}}))})}configure(t){if(!this.site||!this.bootstrapped){this.siteConfigurationHandlers.push(t);return}t(this.site.api)}widget(t,e){const i=this.applications.find(r=>r.name===t);if(!i){const r=this.widgetAPIHandlers.get(t)||[];r.push(()=>{const n=this.applications.find(o=>o.name===t);e(n==null?void 0:n.api)}),this.widgetAPIHandlers.set(t,r);return}e(i==null?void 0:i.api)}registerApp(t,e,i,r){const n=new wt(e,this),o=new Ae(t,e,n,i,r);this.applications.push(o)}registerSite(t){this.site=t}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class Se{constructor(t){this.configurations=[],this.httpClient=new F,this.api=new Mi(this),this.triggers=[],this.httpClient=new F,typeof t=="string"?this.url=t:(t.httpClient&&(this.httpClient=t.httpClient),this.loadFromConfig(t))}async load(t){const e=await this.httpClient.getSite(t);if(!e){console.warn(`Unable to load site from the url provided: ${t}`);return}this.configurations=e.apps,this.triggers=e.triggers||[]}loadFromConfig(t){this.configurations=t.apps.map(e=>({id:"",renderStrategy:e.renderStrategy,widgetId:e.widgetId,autoActivate:e.autoActivate,anchor:e.anchor,triggerIcon:{type:"Telia",content:e.triggerIcon||"question"}}))}setHttpClient(t){this.httpClient=t}async bootstrap(t){var e;this.url&&await this.load(this.url),this.environment=new Ce,this.addGlobal(this.environment);for await(const i of this.configurations){const r=await this.httpClient.getWidget(i.widgetId);r&&((e=this.environment)==null||e.registerApp(i.widgetId,r.name,r.config,{renderStrategy:i.renderStrategy,triggerIcon:i.triggerIcon,autoActivate:i.autoActivate,anchor:i.anchor}))}t(this.environment),this.environment.registerSite(this),await this.environment.bootstrap()}addGlobal(t){const e=globalThis.ace;((e==null?void 0:e._w)||[]).forEach(([i,r])=>{t.widget(i,r)}),((e==null?void 0:e._c)||[]).forEach(i=>{t.configure(i)}),globalThis.ace=t}}var ji=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,Pt=(s,t,e,i)=>{for(var r=i>1?void 0:i?Hi(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ji(t,e,r),r};class M extends A{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(t){this.widget=t.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const t=globalThis.widgets;t&&(this.widget=t.applications.find(e=>e.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return u;if(this.widget.renderStrategy===$.Trigger){const t=new b;return t.application=this.widget,t}return this.widget.render()}}M.styles=[N`
425
425
  :host {
426
426
  display: block;
427
427
  }
428
- `];Pt([m({attribute:!0})],M.prototype,"name",2);Pt([U()],M.prototype,"widget",2);Pt([U()],M.prototype,"status",2);customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",nt);customElements.get("ace-trigger")||customElements.define("ace-trigger",b);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",Et);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",F);customElements.get("ace-widget")||customElements.define("ace-widget",M);const Li=async(s,t,e={})=>{const i=new Se(s);e.httpClient&&i.setHttpClient(e.httpClient),await i.bootstrap(t)};exports.AceWidget=M;exports.Application=Ae;exports.Container=wt;exports.Environment=Ce;exports.HttpClient=V;exports.Site=Se;exports.StorageCategory=v;exports.StorageService=_e;exports.Trigger=b;exports.WidgetComponent=ye;exports.applicationContext=be;exports.bootstrap=Li;exports.createHttpClient=Ui;
428
+ `];Pt([m({attribute:!0})],M.prototype,"name",2);Pt([U()],M.prototype,"widget",2);Pt([U()],M.prototype,"status",2);customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",rt);customElements.get("ace-trigger")||customElements.define("ace-trigger",b);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",Et);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",nt);customElements.get("ace-widget")||customElements.define("ace-widget",M);const Li=async(s,t,e={})=>{const i=new Se(s);e.httpClient&&i.setHttpClient(e.httpClient),await i.bootstrap(t)};exports.AceWidget=M;exports.Application=Ae;exports.Container=wt;exports.Environment=Ce;exports.HttpClient=F;exports.Site=Se;exports.StorageCategory=v;exports.StorageService=_e;exports.Trigger=b;exports.WidgetComponent=ye;exports.applicationContext=be;exports.bootstrap=Li;exports.createHttpClient=Ui;
package/index.mjs CHANGED
@@ -6,7 +6,7 @@ var gt = function(s, t) {
6
6
  Object.prototype.hasOwnProperty.call(i, r) && (e[r] = i[r]);
7
7
  }, gt(s, t);
8
8
  };
9
- function F(s, t) {
9
+ function W(s, t) {
10
10
  if (typeof t != "function" && t !== null)
11
11
  throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
12
12
  gt(s, t);
@@ -27,7 +27,7 @@ function mt(s) {
27
27
  };
28
28
  throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
29
29
  }
30
- function G(s, t) {
30
+ function J(s, t) {
31
31
  var e = typeof Symbol == "function" && s[Symbol.iterator];
32
32
  if (!e)
33
33
  return s;
@@ -47,7 +47,7 @@ function G(s, t) {
47
47
  }
48
48
  return n;
49
49
  }
50
- function X(s, t, e) {
50
+ function G(s, t, e) {
51
51
  if (e || arguments.length === 2)
52
52
  for (var i = 0, r = t.length, n; i < r; i++)
53
53
  (n || !(i in t)) && (n || (n = Array.prototype.slice.call(t, 0, i)), n[i] = t[i]);
@@ -77,7 +77,7 @@ function vt(s, t) {
77
77
  0 <= e && s.splice(e, 1);
78
78
  }
79
79
  }
80
- var st = function() {
80
+ var it = function() {
81
81
  function s(t) {
82
82
  this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
83
83
  }
@@ -121,7 +121,7 @@ var st = function() {
121
121
  try {
122
122
  Pt(g);
123
123
  } catch (v) {
124
- n = n ?? [], v instanceof ot ? n = X(X([], G(n)), G(v.errors)) : n.push(v);
124
+ n = n ?? [], v instanceof ot ? n = G(G([], J(n)), J(v.errors)) : n.push(v);
125
125
  }
126
126
  }
127
127
  } catch (v) {
@@ -167,9 +167,9 @@ var st = function() {
167
167
  var t = new s();
168
168
  return t.closed = !0, t;
169
169
  }(), s;
170
- }(), te = st.EMPTY;
170
+ }(), te = it.EMPTY;
171
171
  function ee(s) {
172
- return s instanceof st || s && "closed" in s && $(s.remove) && $(s.add) && $(s.unsubscribe);
172
+ return s instanceof it || s && "closed" in s && $(s.remove) && $(s.add) && $(s.unsubscribe);
173
173
  }
174
174
  function Pt(s) {
175
175
  $(s) ? s() : s.unsubscribe();
@@ -185,7 +185,7 @@ var ie = {
185
185
  for (var e = [], i = 2; i < arguments.length; i++)
186
186
  e[i - 2] = arguments[i];
187
187
  var r = yt.delegate;
188
- return r != null && r.setTimeout ? r.setTimeout.apply(r, X([s, t], G(e))) : setTimeout.apply(void 0, X([s, t], G(e)));
188
+ return r != null && r.setTimeout ? r.setTimeout.apply(r, G([s, t], J(e))) : setTimeout.apply(void 0, G([s, t], J(e)));
189
189
  },
190
190
  clearTimeout: function(s) {
191
191
  var t = yt.delegate;
@@ -200,11 +200,11 @@ function $e(s) {
200
200
  }
201
201
  function Ot() {
202
202
  }
203
- function Z(s) {
203
+ function K(s) {
204
204
  s();
205
205
  }
206
206
  var se = function(s) {
207
- F(t, s);
207
+ W(t, s);
208
208
  function t(e) {
209
209
  var i = s.call(this) || this;
210
210
  return i.isStopped = !1, e ? (i.destination = e, ee(e) && e.add(i)) : i.destination = Ce, i;
@@ -234,7 +234,7 @@ var se = function(s) {
234
234
  this.unsubscribe();
235
235
  }
236
236
  }, t;
237
- }(st), _e = Function.prototype.bind;
237
+ }(it), _e = Function.prototype.bind;
238
238
  function at(s, t) {
239
239
  return _e.call(s, t);
240
240
  }
@@ -248,7 +248,7 @@ var Ae = function() {
248
248
  try {
249
249
  e.next(t);
250
250
  } catch (i) {
251
- K(i);
251
+ q(i);
252
252
  }
253
253
  }, s.prototype.error = function(t) {
254
254
  var e = this.partialObserver;
@@ -256,21 +256,21 @@ var Ae = function() {
256
256
  try {
257
257
  e.error(t);
258
258
  } catch (i) {
259
- K(i);
259
+ q(i);
260
260
  }
261
261
  else
262
- K(t);
262
+ q(t);
263
263
  }, s.prototype.complete = function() {
264
264
  var t = this.partialObserver;
265
265
  if (t.complete)
266
266
  try {
267
267
  t.complete();
268
268
  } catch (e) {
269
- K(e);
269
+ q(e);
270
270
  }
271
271
  }, s;
272
272
  }(), bt = function(s) {
273
- F(t, s);
273
+ W(t, s);
274
274
  function t(e, i, r) {
275
275
  var n = s.call(this) || this, o;
276
276
  if ($(e) || !e)
@@ -293,7 +293,7 @@ var Ae = function() {
293
293
  }
294
294
  return t;
295
295
  }(se);
296
- function K(s) {
296
+ function q(s) {
297
297
  $e(s);
298
298
  }
299
299
  function xe(s) {
@@ -326,7 +326,7 @@ var Tt = function() {
326
326
  return e.source = this, e.operator = t, e;
327
327
  }, s.prototype.subscribe = function(t, e, i) {
328
328
  var r = this, n = Te(t) ? t : new bt(t, e, i);
329
- return Z(function() {
329
+ return K(function() {
330
330
  var o = r, a = o.operator, c = o.source;
331
331
  n.add(a ? a.call(n, c) : c ? r._subscribe(n) : r._trySubscribe(n));
332
332
  }), n;
@@ -392,7 +392,7 @@ var Ie = Qt(function(s) {
392
392
  s(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
393
393
  };
394
394
  }), wt = function(s) {
395
- F(t, s);
395
+ W(t, s);
396
396
  function t() {
397
397
  var e = s.call(this) || this;
398
398
  return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
@@ -405,7 +405,7 @@ var Ie = Qt(function(s) {
405
405
  throw new Ie();
406
406
  }, t.prototype.next = function(e) {
407
407
  var i = this;
408
- Z(function() {
408
+ K(function() {
409
409
  var r, n;
410
410
  if (i._throwIfClosed(), !i.isStopped) {
411
411
  i.currentObservers || (i.currentObservers = Array.from(i.observers));
@@ -428,7 +428,7 @@ var Ie = Qt(function(s) {
428
428
  });
429
429
  }, t.prototype.error = function(e) {
430
430
  var i = this;
431
- Z(function() {
431
+ K(function() {
432
432
  if (i._throwIfClosed(), !i.isStopped) {
433
433
  i.hasError = i.isStopped = !0, i.thrownError = e;
434
434
  for (var r = i.observers; r.length; )
@@ -437,7 +437,7 @@ var Ie = Qt(function(s) {
437
437
  });
438
438
  }, t.prototype.complete = function() {
439
439
  var e = this;
440
- Z(function() {
440
+ K(function() {
441
441
  if (e._throwIfClosed(), !e.isStopped) {
442
442
  e.isStopped = !0;
443
443
  for (var i = e.observers; i.length; )
@@ -459,7 +459,7 @@ var Ie = Qt(function(s) {
459
459
  return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
460
460
  }, t.prototype._innerSubscribe = function(e) {
461
461
  var i = this, r = this, n = r.hasError, o = r.isStopped, a = r.observers;
462
- return n || o ? te : (this.currentObservers = null, a.push(e), new st(function() {
462
+ return n || o ? te : (this.currentObservers = null, a.push(e), new it(function() {
463
463
  i.currentObservers = null, vt(a, e);
464
464
  }));
465
465
  }, t.prototype._checkFinalizedStatuses = function(e) {
@@ -472,7 +472,7 @@ var Ie = Qt(function(s) {
472
472
  return new Rt(e, i);
473
473
  }, t;
474
474
  }(Tt), Rt = function(s) {
475
- F(t, s);
475
+ W(t, s);
476
476
  function t(e, i) {
477
477
  var r = s.call(this) || this;
478
478
  return r.destination = e, r.source = i, r;
@@ -491,7 +491,7 @@ var Ie = Qt(function(s) {
491
491
  return (r = (i = this.source) === null || i === void 0 ? void 0 : i.subscribe(e)) !== null && r !== void 0 ? r : te;
492
492
  }, t;
493
493
  }(wt), re = function(s) {
494
- F(t, s);
494
+ W(t, s);
495
495
  function t(e) {
496
496
  var i = s.call(this) || this;
497
497
  return i._value = e, i;
@@ -539,7 +539,7 @@ class kt {
539
539
  * Copyright 2019 Google LLC
540
540
  * SPDX-License-Identifier: BSD-3-Clause
541
541
  */
542
- const J = globalThis, $t = J.ShadowRoot && (J.ShadyCSS === void 0 || J.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, _t = Symbol(), Nt = /* @__PURE__ */ new WeakMap();
542
+ const Z = globalThis, $t = Z.ShadowRoot && (Z.ShadyCSS === void 0 || Z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, _t = Symbol(), Nt = /* @__PURE__ */ new WeakMap();
543
543
  let oe = class {
544
544
  constructor(t, e, i) {
545
545
  if (this._$cssResult$ = !0, i !== _t)
@@ -573,7 +573,7 @@ const Re = (s) => new oe(typeof s == "string" ? s : s + "", void 0, _t), N = (s,
573
573
  s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
574
574
  else
575
575
  for (const e of t) {
576
- const i = document.createElement("style"), r = J.litNonce;
576
+ const i = document.createElement("style"), r = Z.litNonce;
577
577
  r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
578
578
  }
579
579
  }, Ut = $t ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
@@ -587,7 +587,7 @@ const Re = (s) => new oe(typeof s == "string" ? s : s + "", void 0, _t), N = (s,
587
587
  * Copyright 2017 Google LLC
588
588
  * SPDX-License-Identifier: BSD-3-Clause
589
589
  */
590
- const { is: Ne, defineProperty: Ue, getOwnPropertyDescriptor: Me, getOwnPropertyNames: je, getOwnPropertySymbols: He, getPrototypeOf: Le } = Object, C = globalThis, Mt = C.trustedTypes, De = Mt ? Mt.emptyScript : "", ct = C.reactiveElementPolyfillSupport, j = (s, t) => s, Q = { toAttribute(s, t) {
590
+ const { is: Ne, defineProperty: Ue, getOwnPropertyDescriptor: Me, getOwnPropertyNames: je, getOwnPropertySymbols: He, getPrototypeOf: Le } = Object, C = globalThis, Mt = C.trustedTypes, De = Mt ? Mt.emptyScript : "", ct = C.reactiveElementPolyfillSupport, j = (s, t) => s, X = { toAttribute(s, t) {
591
591
  switch (t) {
592
592
  case Boolean:
593
593
  s = s ? De : null;
@@ -615,7 +615,7 @@ const { is: Ne, defineProperty: Ue, getOwnPropertyDescriptor: Me, getOwnProperty
615
615
  }
616
616
  }
617
617
  return e;
618
- } }, At = (s, t) => !Ne(s, t), jt = { attribute: !0, type: String, converter: Q, reflect: !1, hasChanged: At };
618
+ } }, At = (s, t) => !Ne(s, t), jt = { attribute: !0, type: String, converter: X, reflect: !1, hasChanged: At };
619
619
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), C.litPropertyMetadata ?? (C.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
620
620
  let I = class extends HTMLElement {
621
621
  static addInitializer(t) {
@@ -736,7 +736,7 @@ let I = class extends HTMLElement {
736
736
  var n;
737
737
  const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
738
738
  if (r !== void 0 && i.reflect === !0) {
739
- const o = (((n = i.converter) == null ? void 0 : n.toAttribute) !== void 0 ? i.converter : Q).toAttribute(e, i.type);
739
+ const o = (((n = i.converter) == null ? void 0 : n.toAttribute) !== void 0 ? i.converter : X).toAttribute(e, i.type);
740
740
  this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
741
741
  }
742
742
  }
@@ -744,7 +744,7 @@ let I = class extends HTMLElement {
744
744
  var n;
745
745
  const i = this.constructor, r = i._$Eh.get(t);
746
746
  if (r !== void 0 && this._$Em !== r) {
747
- const o = i.getPropertyOptions(r), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : Q;
747
+ const o = i.getPropertyOptions(r), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : X;
748
748
  this._$Em = r, this[r] = a.fromAttribute(e, o.type), this._$Em = null;
749
749
  }
750
750
  }
@@ -834,7 +834,7 @@ I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[j("elementProper
834
834
  * Copyright 2017 Google LLC
835
835
  * SPDX-License-Identifier: BSD-3-Clause
836
836
  */
837
- const H = globalThis, tt = H.trustedTypes, Ht = tt ? tt.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, ae = "$lit$", x = `lit$${(Math.random() + "").slice(9)}$`, ce = "?" + x, Be = `<${ce}>`, O = document, D = () => O.createComment(""), B = (s) => s === null || typeof s != "object" && typeof s != "function", he = Array.isArray, ze = (s) => he(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", ht = `[
837
+ const H = globalThis, Q = H.trustedTypes, Ht = Q ? Q.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, ae = "$lit$", x = `lit$${(Math.random() + "").slice(9)}$`, ce = "?" + x, Be = `<${ce}>`, O = document, D = () => O.createComment(""), B = (s) => s === null || typeof s != "object" && typeof s != "function", he = Array.isArray, ze = (s) => he(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", ht = `[
838
838
  \f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Lt = /-->/g, Dt = />/g, S = RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
839
839
  \f\r"'\`<>=]|("|')|))|$)`, "g"), Bt = /'/g, zt = /"/g, le = /^(?:script|style|textarea|title)$/i, We = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), R = We(1), T = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), Wt = /* @__PURE__ */ new WeakMap(), P = O.createTreeWalker(O, 129);
840
840
  function de(s, t) {
@@ -871,13 +871,13 @@ class z {
871
871
  for (const d of r.getAttributeNames())
872
872
  if (d.endsWith(ae)) {
873
873
  const p = l[o++], f = r.getAttribute(d).split(x), g = /([.?@])?(.*)/.exec(p);
874
- c.push({ type: 1, index: n, name: g[2], strings: f, ctor: g[1] === "." ? Ye : g[1] === "?" ? qe : g[1] === "@" ? Ke : rt }), r.removeAttribute(d);
874
+ c.push({ type: 1, index: n, name: g[2], strings: f, ctor: g[1] === "." ? Ye : g[1] === "?" ? qe : g[1] === "@" ? Ke : st }), r.removeAttribute(d);
875
875
  } else
876
876
  d.startsWith(x) && (c.push({ type: 6, index: n }), r.removeAttribute(d));
877
877
  if (le.test(r.tagName)) {
878
878
  const d = r.textContent.split(x), p = d.length - 1;
879
879
  if (p > 0) {
880
- r.textContent = tt ? tt.emptyScript : "";
880
+ r.textContent = Q ? Q.emptyScript : "";
881
881
  for (let f = 0; f < p; f++)
882
882
  r.append(d[f], D()), P.nextNode(), c.push({ type: 2, index: ++n });
883
883
  r.append(d[p], D());
@@ -924,7 +924,7 @@ class Ve {
924
924
  for (; c !== void 0; ) {
925
925
  if (o === c.index) {
926
926
  let h;
927
- c.type === 2 ? h = new V(n, n.nextSibling, this, t) : c.type === 1 ? h = new c.ctor(n, c.name, c.strings, this, t) : c.type === 6 && (h = new Ze(n, this, t)), this._$AV.push(h), c = i[++a];
927
+ c.type === 2 ? h = new F(n, n.nextSibling, this, t) : c.type === 1 ? h = new c.ctor(n, c.name, c.strings, this, t) : c.type === 6 && (h = new Ze(n, this, t)), this._$AV.push(h), c = i[++a];
928
928
  }
929
929
  o !== (c == null ? void 0 : c.index) && (n = P.nextNode(), o++);
930
930
  }
@@ -936,7 +936,7 @@ class Ve {
936
936
  i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
937
937
  }
938
938
  }
939
- class V {
939
+ class F {
940
940
  get _$AU() {
941
941
  var t;
942
942
  return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
@@ -986,7 +986,7 @@ class V {
986
986
  const e = this._$AH;
987
987
  let i, r = 0;
988
988
  for (const n of t)
989
- r === e.length ? e.push(i = new V(this.S(D()), this.S(D()), this, this.options)) : i = e[r], i._$AI(n), r++;
989
+ r === e.length ? e.push(i = new F(this.S(D()), this.S(D()), this, this.options)) : i = e[r], i._$AI(n), r++;
990
990
  r < e.length && (this._$AR(i && i._$AB.nextSibling, r), e.length = r);
991
991
  }
992
992
  _$AR(t = this._$AA.nextSibling, e) {
@@ -1001,7 +1001,7 @@ class V {
1001
1001
  this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
1002
1002
  }
1003
1003
  }
1004
- class rt {
1004
+ class st {
1005
1005
  get tagName() {
1006
1006
  return this.element.tagName;
1007
1007
  }
@@ -1028,7 +1028,7 @@ class rt {
1028
1028
  t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
1029
1029
  }
1030
1030
  }
1031
- class Ye extends rt {
1031
+ class Ye extends st {
1032
1032
  constructor() {
1033
1033
  super(...arguments), this.type = 3;
1034
1034
  }
@@ -1036,7 +1036,7 @@ class Ye extends rt {
1036
1036
  this.element[this.name] = t === u ? void 0 : t;
1037
1037
  }
1038
1038
  }
1039
- class qe extends rt {
1039
+ class qe extends st {
1040
1040
  constructor() {
1041
1041
  super(...arguments), this.type = 4;
1042
1042
  }
@@ -1044,7 +1044,7 @@ class qe extends rt {
1044
1044
  this.element.toggleAttribute(this.name, !!t && t !== u);
1045
1045
  }
1046
1046
  }
1047
- class Ke extends rt {
1047
+ class Ke extends st {
1048
1048
  constructor(t, e, i, r, n) {
1049
1049
  super(t, e, i, r, n), this.type = 5;
1050
1050
  }
@@ -1071,13 +1071,13 @@ class Ze {
1071
1071
  }
1072
1072
  }
1073
1073
  const lt = H.litHtmlPolyfillSupport;
1074
- lt == null || lt(z, V), (H.litHtmlVersions ?? (H.litHtmlVersions = [])).push("3.1.2");
1074
+ lt == null || lt(z, F), (H.litHtmlVersions ?? (H.litHtmlVersions = [])).push("3.1.2");
1075
1075
  const Je = (s, t, e) => {
1076
1076
  const i = (e == null ? void 0 : e.renderBefore) ?? t;
1077
1077
  let r = i._$litPart$;
1078
1078
  if (r === void 0) {
1079
1079
  const n = (e == null ? void 0 : e.renderBefore) ?? null;
1080
- i._$litPart$ = r = new V(t.insertBefore(D(), n), n, void 0, e ?? {});
1080
+ i._$litPart$ = r = new F(t.insertBefore(D(), n), n, void 0, e ?? {});
1081
1081
  }
1082
1082
  return r._$AI(s), r;
1083
1083
  };
@@ -1121,7 +1121,7 @@ dt == null || dt({ LitElement: _ });
1121
1121
  * Copyright 2017 Google LLC
1122
1122
  * SPDX-License-Identifier: BSD-3-Clause
1123
1123
  */
1124
- const Ge = { attribute: !0, type: String, converter: Q, reflect: !1, hasChanged: At }, Xe = (s = Ge, t, e) => {
1124
+ const Ge = { attribute: !0, type: String, converter: X, reflect: !1, hasChanged: At }, Xe = (s = Ge, t, e) => {
1125
1125
  const { kind: i, metadata: r } = e;
1126
1126
  let n = globalThis.litPropertyMetadata.get(r);
1127
1127
  if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), n.set(e.name, s), i === "accessor") {
@@ -1161,7 +1161,7 @@ var Qe = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, ei = (s, t
1161
1161
  (o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
1162
1162
  return i && r && Qe(t, e, r), r;
1163
1163
  };
1164
- class nt extends _ {
1164
+ class rt extends _ {
1165
1165
  constructor() {
1166
1166
  super(...arguments), this.anchor = "BottomRight";
1167
1167
  }
@@ -1173,7 +1173,7 @@ class nt extends _ {
1173
1173
  return this.anchor === "BottomLeft" ? this.renderRoot.host.classList.add("bottom-left") : this.anchor === "BottomRight" && this.renderRoot.host.classList.add("bottom-right"), u;
1174
1174
  }
1175
1175
  }
1176
- nt.styles = [
1176
+ rt.styles = [
1177
1177
  N`
1178
1178
  :host {
1179
1179
  position: fixed;
@@ -1194,7 +1194,7 @@ nt.styles = [
1194
1194
  ];
1195
1195
  ei([
1196
1196
  m({ attribute: !0 })
1197
- ], nt.prototype, "anchor", 2);
1197
+ ], rt.prototype, "anchor", 2);
1198
1198
  /**
1199
1199
  * @license
1200
1200
  * Copyright 2017 Google LLC
@@ -1236,7 +1236,7 @@ const L = (s, t) => {
1236
1236
  for (const r of e)
1237
1237
  (i = r._$AO) == null || i.call(r, t, !1), L(r, t);
1238
1238
  return !0;
1239
- }, et = (s) => {
1239
+ }, tt = (s) => {
1240
1240
  let t, e;
1241
1241
  do {
1242
1242
  if ((t = s._$AM) === void 0)
@@ -1254,7 +1254,7 @@ const L = (s, t) => {
1254
1254
  }
1255
1255
  };
1256
1256
  function si(s) {
1257
- this._$AN !== void 0 ? (et(this), this._$AM = s, ue(this)) : this._$AM = s;
1257
+ this._$AN !== void 0 ? (tt(this), this._$AM = s, ue(this)) : this._$AM = s;
1258
1258
  }
1259
1259
  function ri(s, t = !1, e = 0) {
1260
1260
  const i = this._$AH, r = this._$AN;
@@ -1262,9 +1262,9 @@ function ri(s, t = !1, e = 0) {
1262
1262
  if (t)
1263
1263
  if (Array.isArray(i))
1264
1264
  for (let n = e; n < i.length; n++)
1265
- L(i[n], !1), et(i[n]);
1265
+ L(i[n], !1), tt(i[n]);
1266
1266
  else
1267
- i != null && (L(i, !1), et(i));
1267
+ i != null && (L(i, !1), tt(i));
1268
1268
  else
1269
1269
  L(this, s);
1270
1270
  }
@@ -1280,7 +1280,7 @@ class fe extends pe {
1280
1280
  }
1281
1281
  _$AO(t, e = !0) {
1282
1282
  var i, r;
1283
- t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (r = this.disconnected) == null || r.call(this)), e && (L(this, t), et(this));
1283
+ t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (r = this.disconnected) == null || r.call(this)), e && (L(this, t), tt(this));
1284
1284
  }
1285
1285
  setValue(t) {
1286
1286
  if (ii(this._$Ct))
@@ -1601,7 +1601,7 @@ const ft = /* @__PURE__ */ new WeakMap(), ve = Ct(class extends fe {
1601
1601
  this.rt(this.ct);
1602
1602
  }
1603
1603
  });
1604
- var fi = Object.defineProperty, gi = Object.getOwnPropertyDescriptor, Y = (s, t, e, i) => {
1604
+ var fi = Object.defineProperty, gi = Object.getOwnPropertyDescriptor, V = (s, t, e, i) => {
1605
1605
  for (var r = i > 1 ? void 0 : i ? gi(t, e) : t, n = s.length - 1, o; n >= 0; n--)
1606
1606
  (o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
1607
1607
  return i && r && fi(t, e, r), r;
@@ -1856,19 +1856,19 @@ A.styles = [
1856
1856
  }
1857
1857
  `
1858
1858
  ];
1859
- Y([
1859
+ V([
1860
1860
  m({ attribute: !1 })
1861
1861
  ], A.prototype, "application", 2);
1862
- Y([
1862
+ V([
1863
1863
  U()
1864
1864
  ], A.prototype, "active", 2);
1865
- Y([
1865
+ V([
1866
1866
  U()
1867
1867
  ], A.prototype, "triggerVisible", 2);
1868
- Y([
1868
+ V([
1869
1869
  U()
1870
1870
  ], A.prototype, "loaded", 2);
1871
- Y([
1871
+ V([
1872
1872
  U()
1873
1873
  ], A.prototype, "icon", 2);
1874
1874
  var mi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, E = (s, t, e, i) => {
@@ -2088,7 +2088,7 @@ var xi = Object.defineProperty, Ci = Object.getOwnPropertyDescriptor, Si = (s, t
2088
2088
  return i && r && xi(t, e, r), r;
2089
2089
  };
2090
2090
  const Ei = "application";
2091
- class W extends _ {
2091
+ class nt extends _ {
2092
2092
  constructor() {
2093
2093
  super(...arguments), this.nodes = [], this.wrapperRef = me();
2094
2094
  }
@@ -2120,7 +2120,7 @@ class W extends _ {
2120
2120
  </div>`;
2121
2121
  }
2122
2122
  }
2123
- W.styles = N`
2123
+ nt.styles = N`
2124
2124
  :host {
2125
2125
  --font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
2126
2126
  --spacing-xs: 0.2rem;
@@ -2259,7 +2259,7 @@ W.styles = N`
2259
2259
  Si([
2260
2260
  m({ attribute: !1 }),
2261
2261
  Ai({ context: Ei })
2262
- ], W.prototype, "application", 2);
2262
+ ], nt.prototype, "application", 2);
2263
2263
  class Pi {
2264
2264
  constructor() {
2265
2265
  this.root = this.createRoot();
@@ -2300,13 +2300,14 @@ class Pi {
2300
2300
  return r(this, this.root, [n], o), this.root;
2301
2301
  }
2302
2302
  createRoot() {
2303
- return typeof window < "u" && (window.customElements.get("ace-wrapper") || window.customElements.define("ace-wrapper", W)), new W();
2303
+ return typeof window < "u" && (window.customElements.get("ace-wrapper") || window.customElements.define("ace-wrapper", nt)), document.createElement("ace-wrapper");
2304
2304
  }
2305
2305
  createNode(t, e) {
2306
- const i = this.resolveComponent(e);
2307
- if (!i)
2306
+ if (!this.resolveComponent(e))
2308
2307
  return console.warn(`Unable to resolve component: ${e}`), new St();
2309
- const r = new i();
2308
+ const r = document.createElement(
2309
+ `ace-${e}`
2310
+ );
2310
2311
  return r.type = e, r.name = t, r;
2311
2312
  }
2312
2313
  resolveComponent(t) {
@@ -2486,7 +2487,7 @@ class Ri {
2486
2487
  let e = document.querySelector(
2487
2488
  `ace-trigger-slot.${t}`
2488
2489
  );
2489
- return e || (e = new nt(), e.anchor = this.anchor, document.body.appendChild(e)), e;
2490
+ return e || (e = new rt(), e.anchor = this.anchor, document.body.appendChild(e)), e;
2490
2491
  }
2491
2492
  return document.body;
2492
2493
  }
@@ -2498,7 +2499,7 @@ class Ri {
2498
2499
  return this.root;
2499
2500
  }
2500
2501
  }
2501
- const Fi = (s) => new it(s), we = class {
2502
+ const Fi = (s) => new et(s), we = class {
2502
2503
  // TODO:
2503
2504
  // private static endpoint = 'http://localhost:5299/api'; // TODO:
2504
2505
  constructor(s = we.endpoint) {
@@ -2533,8 +2534,8 @@ const Fi = (s) => new it(s), we = class {
2533
2534
  } : null;
2534
2535
  }
2535
2536
  };
2536
- let it = we;
2537
- it.endpoint = "https://widgets.ace.teliacompany.net/api";
2537
+ let et = we;
2538
+ et.endpoint = "https://widgets.ace.teliacompany.net/api";
2538
2539
  class ki {
2539
2540
  constructor(t) {
2540
2541
  this.site = t;
@@ -2649,7 +2650,7 @@ class Ni {
2649
2650
  }
2650
2651
  class Ui {
2651
2652
  constructor(t) {
2652
- this.configurations = [], this.httpClient = new it(), this.api = new ki(this), this.triggers = [], this.httpClient = new it(), typeof t == "string" ? this.url = t : (t.httpClient && (this.httpClient = t.httpClient), this.loadFromConfig(t));
2653
+ this.configurations = [], this.httpClient = new et(), this.api = new ki(this), this.triggers = [], this.httpClient = new et(), typeof t == "string" ? this.url = t : (t.httpClient && (this.httpClient = t.httpClient), this.loadFromConfig(t));
2653
2654
  }
2654
2655
  async load(t) {
2655
2656
  const e = await this.httpClient.getSite(t);
@@ -2708,7 +2709,7 @@ var Mi = Object.defineProperty, ji = Object.getOwnPropertyDescriptor, Et = (s, t
2708
2709
  (o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
2709
2710
  return i && r && Mi(t, e, r), r;
2710
2711
  };
2711
- class q extends _ {
2712
+ class Y extends _ {
2712
2713
  constructor() {
2713
2714
  super(), this.status = "deactivated", this.addEventListener("environment-created", this.onEnvironmentCreated);
2714
2715
  }
@@ -2740,7 +2741,7 @@ class q extends _ {
2740
2741
  return this.widget.render();
2741
2742
  }
2742
2743
  }
2743
- q.styles = [
2744
+ Y.styles = [
2744
2745
  N`
2745
2746
  :host {
2746
2747
  display: block;
@@ -2749,28 +2750,28 @@ q.styles = [
2749
2750
  ];
2750
2751
  Et([
2751
2752
  m({ attribute: !0 })
2752
- ], q.prototype, "name", 2);
2753
+ ], Y.prototype, "name", 2);
2753
2754
  Et([
2754
2755
  U()
2755
- ], q.prototype, "widget", 2);
2756
+ ], Y.prototype, "widget", 2);
2756
2757
  Et([
2757
2758
  U()
2758
- ], q.prototype, "status", 2);
2759
- customElements.get("ace-trigger-slot") || customElements.define("ace-trigger-slot", nt);
2759
+ ], Y.prototype, "status", 2);
2760
+ customElements.get("ace-trigger-slot") || customElements.define("ace-trigger-slot", rt);
2760
2761
  customElements.get("ace-trigger") || customElements.define("ace-trigger", A);
2761
2762
  customElements.get("ace-unresolved-component") || customElements.define("ace-unresolved-component", St);
2762
- customElements.get("ace-wrapper") || customElements.define("ace-wrapper", W);
2763
- customElements.get("ace-widget") || customElements.define("ace-widget", q);
2763
+ customElements.get("ace-wrapper") || customElements.define("ace-wrapper", nt);
2764
+ customElements.get("ace-widget") || customElements.define("ace-widget", Y);
2764
2765
  const Vi = async (s, t, e = {}) => {
2765
2766
  const i = new Ui(s);
2766
2767
  e.httpClient && i.setHttpClient(e.httpClient), await i.bootstrap(t);
2767
2768
  };
2768
2769
  export {
2769
- q as AceWidget,
2770
+ Y as AceWidget,
2770
2771
  Ri as Application,
2771
2772
  kt as Container,
2772
2773
  Ni as Environment,
2773
- it as HttpClient,
2774
+ et as HttpClient,
2774
2775
  Ui as Site,
2775
2776
  y as StorageCategory,
2776
2777
  Oi as StorageService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-core-flamingo",
3
- "version": "1.1.76-rc.3",
3
+ "version": "1.1.76-rc.5",
4
4
  "dependencies": {
5
5
  "lit": "^3.0.2",
6
6
  "@teliads/icons": "^8.4.0",