@telia-ace/widget-core-flamingo 1.1.12-rc.10 → 1.1.12-rc.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,6 +16,6 @@ export declare class AceWidget extends LitElement {
16
16
  onEnvironmentCreated(event: any): Promise<void>;
17
17
  activate(): Promise<void>;
18
18
  getGlobalEnvironment(): Promise<void>;
19
- render(): Trigger | import("./wrapper.component").Wrapper | typeof nothing | undefined;
19
+ render(): typeof nothing | Trigger | import("./wrapper.component").Wrapper | undefined;
20
20
  }
21
21
  export {};
package/index.js CHANGED
@@ -1,45 +1,49 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var ht=function(i,t){return ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])},ht(i,t)};function D(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ht(i,t);function e(){this.constructor=i}i.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function ut(i){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&i[t],r=0;if(e)return e.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&r>=i.length&&(i=void 0),{value:i&&i[r++],done:!i}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function F(i,t){var e=typeof Symbol=="function"&&i[Symbol.iterator];if(!e)return i;var r=e.call(i),n,s=[],o;try{for(;(t===void 0||t-- >0)&&!(n=r.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(o)throw o.error}}return s}function Y(i,t,e){if(e||arguments.length===2)for(var r=0,n=t.length,s;r<n;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return i.concat(s||Array.prototype.slice.call(t))}function m(i){return typeof i=="function"}function Nt(i){var t=function(r){Error.call(r),r.stack=new Error().stack},e=i(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var it=Nt(function(i){return function(e){i(this),this.message=e?e.length+` errors occurred during unsubscription:
2
- `+e.map(function(r,n){return n+1+") "+r.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=e}});function pt(i,t){if(i){var e=i.indexOf(t);0<=e&&i.splice(e,1)}}var X=function(){function i(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return i.prototype.unsubscribe=function(){var t,e,r,n,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=ut(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(v){t={error:v}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var d=this.initialTeardown;if(m(d))try{d()}catch(v){s=v instanceof it?v.errors:[v]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var f=ut(l),u=f.next();!u.done;u=f.next()){var g=u.value;try{wt(g)}catch(v){s=s??[],v instanceof it?s=Y(Y([],F(s)),F(v.errors)):s.push(v)}}}catch(v){r={error:v}}finally{try{u&&!u.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}}if(s)throw new it(s)}},i.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)wt(t);else{if(t instanceof i){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},i.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},i.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},i.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&pt(e,t)},i.prototype.remove=function(t){var e=this._finalizers;e&&pt(e,t),t instanceof i&&t._removeParent(this)},i.EMPTY=function(){var t=new i;return t.closed=!0,t}(),i}(),Dt=X.EMPTY;function Lt(i){return i instanceof X||i&&"closed"in i&&m(i.remove)&&m(i.add)&&m(i.unsubscribe)}function wt(i){m(i)?i():i.unsubscribe()}var Bt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},dt={setTimeout:function(i,t){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];var n=dt.delegate;return n!=null&&n.setTimeout?n.setTimeout.apply(n,Y([i,t],F(e))):setTimeout.apply(void 0,Y([i,t],F(e)))},clearTimeout:function(i){var t=dt.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(i)},delegate:void 0};function le(i){dt.setTimeout(function(){throw i})}function At(){}function V(i){i()}var zt=function(i){D(t,i);function t(e){var r=i.call(this)||this;return r.isStopped=!1,e?(r.destination=e,Lt(e)&&e.add(r)):r.destination=de,r}return t.create=function(e,r,n){return new ft(e,r,n)},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,i.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}(X),he=Function.prototype.bind;function nt(i,t){return he.call(i,t)}var ue=function(){function i(t){this.partialObserver=t}return i.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(r){W(r)}},i.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(r){W(r)}else W(t)},i.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){W(e)}},i}(),ft=function(i){D(t,i);function t(e,r,n){var s=i.call(this)||this,o;if(m(e)||!e)o={next:e??void 0,error:r??void 0,complete:n??void 0};else{var a;s&&Bt.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return s.unsubscribe()},o={next:e.next&&nt(e.next,a),error:e.error&&nt(e.error,a),complete:e.complete&&nt(e.complete,a)}):o=e}return s.destination=new ue(o),s}return t}(zt);function W(i){le(i)}function pe(i){throw i}var de={closed:!0,next:At,error:pe,complete:At},fe=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function ge(i){return i}function ve(i){return i.length===0?ge:i.length===1?i[0]:function(e){return i.reduce(function(r,n){return n(r)},e)}}var St=function(){function i(t){t&&(this._subscribe=t)}return i.prototype.lift=function(t){var e=new i;return e.source=this,e.operator=t,e},i.prototype.subscribe=function(t,e,r){var n=this,s=me(t)?t:new ft(t,e,r);return V(function(){var o=n,a=o.operator,c=o.source;s.add(a?a.call(s,c):c?n._subscribe(s):n._trySubscribe(s))}),s},i.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},i.prototype.forEach=function(t,e){var r=this;return e=Et(e),new e(function(n,s){var o=new ft({next:function(a){try{t(a)}catch(c){s(c),o.unsubscribe()}},error:s,complete:n});r.subscribe(o)})},i.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},i.prototype[fe]=function(){return this},i.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ve(t)(this)},i.prototype.toPromise=function(t){var e=this;return t=Et(t),new t(function(r,n){var s;e.subscribe(function(o){return s=o},function(o){return n(o)},function(){return r(s)})})},i.create=function(t){return new i(t)},i}();function Et(i){var t;return(t=i??Bt.Promise)!==null&&t!==void 0?t:Promise}function ye(i){return i&&m(i.next)&&m(i.error)&&m(i.complete)}function me(i){return i&&i instanceof zt||ye(i)&&Lt(i)}var be=Nt(function(i){return function(){i(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Wt=function(i){D(t,i);function t(){var e=i.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 r=new Ct(this,this);return r.operator=e,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new be},t.prototype.next=function(e){var r=this;V(function(){var n,s;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=ut(r.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(e)}}catch(h){n={error:h}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var r=this;V(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=e;for(var n=r.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;V(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var r=e.observers;r.length;)r.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(),i.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 r=this,n=this,s=n.hasError,o=n.isStopped,a=n.observers;return s||o?Dt:(this.currentObservers=null,a.push(e),new X(function(){r.currentObservers=null,pt(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var r=this,n=r.hasError,s=r.thrownError,o=r.isStopped;n?e.error(s):o&&e.complete()},t.prototype.asObservable=function(){var e=new St;return e.source=this,e},t.create=function(e,r){return new Ct(e,r)},t}(St),Ct=function(i){D(t,i);function t(e,r){var n=i.call(this)||this;return n.destination=e,n.source=r,n}return t.prototype.next=function(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.next)===null||n===void 0||n.call(r,e)},t.prototype.error=function(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.error)===null||n===void 0||n.call(r,e)},t.prototype.complete=function(){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||r===void 0||r.call(e)},t.prototype._subscribe=function(e){var r,n;return(n=(r=this.source)===null||r===void 0?void 0:r.subscribe(e))!==null&&n!==void 0?n:Dt},t}(Wt),_e=function(i){D(t,i);function t(e){var r=i.call(this)||this;return r._value=e,r}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var r=i.prototype._subscribe.call(this,e);return!r.closed&&e.next(this._value),r},t.prototype.getValue=function(){var e=this,r=e.hasError,n=e.thrownError,s=e._value;if(r)throw n;return this._throwIfClosed(),s},t.prototype.next=function(e){i.prototype.next.call(this,this._value=e)},t}(Wt),Gt=(i=>(i.Loading="loading",i.Ready="ready",i))(Gt||{});class gt{constructor(t,e){this.state=new _e("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)}}/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var pt=function(r,t){return pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},pt(r,t)};function N(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");pt(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function ut(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],i=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function F(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var i=e.call(r),n,s=[],o;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return s}function Y(r,t,e){if(e||arguments.length===2)for(var i=0,n=t.length,s;i<n;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return r.concat(s||Array.prototype.slice.call(t))}function m(r){return typeof r=="function"}function kt(r){var t=function(i){Error.call(i),i.stack=new Error().stack},e=r(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var nt=kt(function(r){return function(e){r(this),this.message=e?e.length+` errors occurred during unsubscription:
2
+ `+e.map(function(i,n){return n+1+") "+i.toString()}).join(`
3
+ `):"",this.name="UnsubscriptionError",this.errors=e}});function dt(r,t){if(r){var e=r.indexOf(t);0<=e&&r.splice(e,1)}}var tt=function(){function r(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var t,e,i,n,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=ut(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(v){t={error:v}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var d=this.initialTeardown;if(m(d))try{d()}catch(v){s=v instanceof nt?v.errors:[v]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var f=ut(l),p=f.next();!p.done;p=f.next()){var g=p.value;try{$t(g)}catch(v){s=s??[],v instanceof nt?s=Y(Y([],F(s)),F(v.errors)):s.push(v)}}}catch(v){i={error:v}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(i)throw i.error}}}if(s)throw new nt(s)}},r.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)$t(t);else{if(t instanceof r){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},r.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},r.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},r.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&dt(e,t)},r.prototype.remove=function(t){var e=this._finalizers;e&&dt(e,t),t instanceof r&&t._removeParent(this)},r.EMPTY=function(){var t=new r;return t.closed=!0,t}(),r}(),Nt=tt.EMPTY;function Dt(r){return r instanceof tt||r&&"closed"in r&&m(r.remove)&&m(r.add)&&m(r.unsubscribe)}function $t(r){m(r)?r():r.unsubscribe()}var Lt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ft={setTimeout:function(r,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];var n=ft.delegate;return n!=null&&n.setTimeout?n.setTimeout.apply(n,Y([r,t],F(e))):setTimeout.apply(void 0,Y([r,t],F(e)))},clearTimeout:function(r){var t=ft.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(r)},delegate:void 0};function le(r){ft.setTimeout(function(){throw r})}function wt(){}function V(r){r()}var Bt=function(r){N(t,r);function t(e){var i=r.call(this)||this;return i.isStopped=!1,e?(i.destination=e,Dt(e)&&e.add(i)):i.destination=de,i}return t.create=function(e,i,n){return new gt(e,i,n)},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,r.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}(tt),he=Function.prototype.bind;function st(r,t){return he.call(r,t)}var pe=function(){function r(t){this.partialObserver=t}return r.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(i){z(i)}},r.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(i){z(i)}else z(t)},r.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){z(e)}},r}(),gt=function(r){N(t,r);function t(e,i,n){var s=r.call(this)||this,o;if(m(e)||!e)o={next:e??void 0,error:i??void 0,complete:n??void 0};else{var a;s&&Lt.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return s.unsubscribe()},o={next:e.next&&st(e.next,a),error:e.error&&st(e.error,a),complete:e.complete&&st(e.complete,a)}):o=e}return s.destination=new pe(o),s}return t}(Bt);function z(r){le(r)}function ue(r){throw r}var de={closed:!0,next:wt,error:ue,complete:wt},fe=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function ge(r){return r}function ve(r){return r.length===0?ge:r.length===1?r[0]:function(e){return r.reduce(function(i,n){return n(i)},e)}}var At=function(){function r(t){t&&(this._subscribe=t)}return r.prototype.lift=function(t){var e=new r;return e.source=this,e.operator=t,e},r.prototype.subscribe=function(t,e,i){var n=this,s=me(t)?t:new gt(t,e,i);return V(function(){var o=n,a=o.operator,c=o.source;s.add(a?a.call(s,c):c?n._subscribe(s):n._trySubscribe(s))}),s},r.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},r.prototype.forEach=function(t,e){var i=this;return e=St(e),new e(function(n,s){var o=new gt({next:function(a){try{t(a)}catch(c){s(c),o.unsubscribe()}},error:s,complete:n});i.subscribe(o)})},r.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},r.prototype[fe]=function(){return this},r.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ve(t)(this)},r.prototype.toPromise=function(t){var e=this;return t=St(t),new t(function(i,n){var s;e.subscribe(function(o){return s=o},function(o){return n(o)},function(){return i(s)})})},r.create=function(t){return new r(t)},r}();function St(r){var t;return(t=r??Lt.Promise)!==null&&t!==void 0?t:Promise}function ye(r){return r&&m(r.next)&&m(r.error)&&m(r.complete)}function me(r){return r&&r instanceof Bt||ye(r)&&Dt(r)}var be=kt(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Wt=function(r){N(t,r);function t(){var e=r.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 Et(this,this);return i.operator=e,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new be},t.prototype.next=function(e){var i=this;V(function(){var n,s;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var o=ut(i.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(e)}}catch(h){n={error:h}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var i=this;V(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=e;for(var n=i.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;V(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(),r.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,n=this,s=n.hasError,o=n.isStopped,a=n.observers;return s||o?Nt:(this.currentObservers=null,a.push(e),new tt(function(){i.currentObservers=null,dt(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var i=this,n=i.hasError,s=i.thrownError,o=i.isStopped;n?e.error(s):o&&e.complete()},t.prototype.asObservable=function(){var e=new At;return e.source=this,e},t.create=function(e,i){return new Et(e,i)},t}(At),Et=function(r){N(t,r);function t(e,i){var n=r.call(this)||this;return n.destination=e,n.source=i,n}return t.prototype.next=function(e){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.next)===null||n===void 0||n.call(i,e)},t.prototype.error=function(e){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.error)===null||n===void 0||n.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,n;return(n=(i=this.source)===null||i===void 0?void 0:i.subscribe(e))!==null&&n!==void 0?n:Nt},t}(Wt),_e=function(r){N(t,r);function t(e){var i=r.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=r.prototype._subscribe.call(this,e);return!i.closed&&e.next(this._value),i},t.prototype.getValue=function(){var e=this,i=e.hasError,n=e.thrownError,s=e._value;if(i)throw n;return this._throwIfClosed(),s},t.prototype.next=function(e){r.prototype.next.call(this,this._value=e)},t}(Wt),zt=(r=>(r.Loading="loading",r.Ready="ready",r))(zt||{});class vt{constructor(t,e){this.state=new _e("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 q=globalThis,yt=q.ShadowRoot&&(q.ShadyCSS===void 0||q.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,mt=Symbol(),xt=new WeakMap;let Vt=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==mt)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(yt&&t===void 0){const r=e!==void 0&&e.length===1;r&&(t=xt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&xt.set(e,t))}return t}toString(){return this.cssText}};const $e=i=>new Vt(typeof i=="string"?i:i+"",void 0,mt),L=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((r,n,s)=>r+(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.")})(n)+i[s+1],i[0]);return new Vt(e,i,mt)},we=(i,t)=>{if(yt)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const r=document.createElement("style"),n=q.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=e.cssText,i.appendChild(r)}},Pt=yt?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return $e(e)})(i):i;/**
7
+ */const q=globalThis,mt=q.ShadowRoot&&(q.ShadyCSS===void 0||q.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,bt=Symbol(),Ct=new WeakMap;let Gt=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==bt)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(mt&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Ct.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Ct.set(e,t))}return t}toString(){return this.cssText}};const $e=r=>new Gt(typeof r=="string"?r:r+"",void 0,bt),D=(r,...t)=>{const e=r.length===1?r[0]:t.reduce((i,n,s)=>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.")})(n)+r[s+1],r[0]);return new Gt(e,r,bt)},we=(r,t)=>{if(mt)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),n=q.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=e.cssText,r.appendChild(i)}},xt=mt?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return $e(e)})(r):r;/**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
- */const{is:Ae,defineProperty:Se,getOwnPropertyDescriptor:Ee,getOwnPropertyNames:Ce,getOwnPropertySymbols:xe,getPrototypeOf:Pe}=Object,$=globalThis,Tt=$.trustedTypes,Te=Tt?Tt.emptyScript:"",st=$.reactiveElementPolyfillSupport,I=(i,t)=>i,J={toAttribute(i,t){switch(t){case Boolean:i=i?Te:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},bt=(i,t)=>!Ae(i,t),Ot={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:bt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),$.litPropertyMetadata??($.litPropertyMetadata=new WeakMap);class T 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=Ot){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(t,r,e);n!==void 0&&Se(this.prototype,t,n)}}static getPropertyDescriptor(t,e,r){const{get:n,set:s}=Ee(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return n==null?void 0:n.call(this)},set(o){const a=n==null?void 0:n.call(this);s.call(this,o),this.requestUpdate(t,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Ot}static _$Ei(){if(this.hasOwnProperty(I("elementProperties")))return;const t=Pe(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(I("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(I("properties"))){const e=this.properties,r=[...Ce(e),...xe(e)];for(const n of r)this.createProperty(n,e[n])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[r,n]of e)this.elementProperties.set(r,n)}this._$Eh=new Map;for(const[e,r]of this.elementProperties){const n=this._$Eu(e,r);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const n of r)e.unshift(Pt(n))}else t!==void 0&&e.push(Pt(t));return e}static _$Eu(t,e){const r=e.attribute;return r===!1?void 0:typeof r=="string"?r: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._$Eg=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._$ES??(this._$ES=[])).push(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$ES)==null||e.splice(this._$ES.indexOf(t)>>>0,1)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return we(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)==null||t.forEach(e=>{var r;return(r=e.hostConnected)==null?void 0:r.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)==null||t.forEach(e=>{var r;return(r=e.hostDisconnected)==null?void 0:r.call(e)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EO(t,e){var s;const r=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,r);if(n!==void 0&&r.reflect===!0){const o=(((s=r.converter)==null?void 0:s.toAttribute)!==void 0?r.converter:J).toAttribute(e,r.type);this._$Em=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){var s;const r=this.constructor,n=r._$Eh.get(t);if(n!==void 0&&this._$Em!==n){const o=r.getPropertyOptions(n),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)==null?void 0:s.fromAttribute)!==void 0?o.converter:J;this._$Em=n,this[n]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,r,n=!1,s){if(t!==void 0){if(r??(r=this.constructor.getPropertyOptions(t)),!(r.hasChanged??bt)(n?s:this[t],e))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(t,e,r){this._$AL.has(t)||this._$AL.set(t,e),r.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[s,o]of n)o.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.C(s,this[s],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(r=this._$ES)==null||r.forEach(n=>{var s;return(s=n.hostUpdate)==null?void 0:s.call(n)}),this.update(e)):this._$ET()}catch(n){throw t=!1,this._$ET(),n}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)==null||e.forEach(r=>{var n;return(n=r.hostUpdated)==null?void 0:n.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EO(e,this[e]))),this._$ET()}updated(t){}firstUpdated(t){}}T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[I("elementProperties")]=new Map,T[I("finalized")]=new Map,st==null||st({ReactiveElement:T}),($.reactiveElementVersions??($.reactiveElementVersions=[])).push("2.0.1");/**
11
+ */const{is:Ae,defineProperty:Se,getOwnPropertyDescriptor:Ee,getOwnPropertyNames:Ce,getOwnPropertySymbols:xe,getPrototypeOf:Pe}=Object,_=globalThis,Pt=_.trustedTypes,Te=Pt?Pt.emptyScript:"",ot=_.reactiveElementPolyfillSupport,U=(r,t)=>r,J={toAttribute(r,t){switch(t){case Boolean:r=r?Te:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},_t=(r,t)=>!Ae(r,t),Tt={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:_t};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);class P 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=Tt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,e);n!==void 0&&Se(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){const{get:n,set:s}=Ee(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return n==null?void 0:n.call(this)},set(o){const a=n==null?void 0:n.call(this);s.call(this,o),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Tt}static _$Ei(){if(this.hasOwnProperty(U("elementProperties")))return;const t=Pe(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(U("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(U("properties"))){const e=this.properties,i=[...Ce(e),...xe(e)];for(const n of i)this.createProperty(n,e[n])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,n]of e)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const n=this._$Eu(e,i);n!==void 0&&this._$Eh.set(n,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 n of i)e.unshift(xt(n))}else t!==void 0&&e.push(xt(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._$Eg=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._$ES??(this._$ES=[])).push(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$ES)==null||e.splice(this._$ES.indexOf(t)>>>0,1)}_$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 we(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e){var s;const i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(n!==void 0&&i.reflect===!0){const o=(((s=i.converter)==null?void 0:s.toAttribute)!==void 0?i.converter:J).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){var s;const i=this.constructor,n=i._$Eh.get(t);if(n!==void 0&&this._$Em!==n){const o=i.getPropertyOptions(n),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)==null?void 0:s.fromAttribute)!==void 0?o.converter:J;this._$Em=n,this[n]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i,n=!1,s){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??_t)(n?s:this[t],e))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(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 _$EP(){this.isUpdatePending=!0;try{await this._$Eg}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._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[s,o]of n)o.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.C(s,this[s],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$ES)==null||i.forEach(n=>{var s;return(s=n.hostUpdate)==null?void 0:s.call(n)}),this.update(e)):this._$ET()}catch(n){throw t=!1,this._$ET(),n}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)==null||e.forEach(i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EO(e,this[e]))),this._$ET()}updated(t){}firstUpdated(t){}}P.elementStyles=[],P.shadowRootOptions={mode:"open"},P[U("elementProperties")]=new Map,P[U("finalized")]=new Map,ot==null||ot({ReactiveElement:P}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.0.1");/**
12
12
  * @license
13
13
  * Copyright 2017 Google LLC
14
14
  * SPDX-License-Identifier: BSD-3-Clause
15
- */const M=globalThis,K=M.trustedTypes,Ut=K?K.createPolicy("lit-html",{createHTML:i=>i}):void 0,qt="$lit$",_=`lit$${(Math.random()+"").slice(9)}$`,Ft="?"+_,Oe=`<${Ft}>`,x=document,j=()=>x.createComment(""),H=i=>i===null||typeof i!="object"&&typeof i!="function",Yt=Array.isArray,Ue=i=>Yt(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",ot=`[
16
- \f\r]`,R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Rt=/-->/g,It=/>/g,S=RegExp(`>|${ot}(?:([^\\s"'>=/]+)(${ot}*=${ot}*(?:[^
17
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Mt=/'/g,kt=/"/g,Jt=/^(?:script|style|textarea|title)$/i,Re=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),Z=Re(1),P=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),jt=new WeakMap,C=x.createTreeWalker(x,129);function Kt(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ut!==void 0?Ut.createHTML(t):t}const Ie=(i,t)=>{const e=i.length-1,r=[];let n,s=t===2?"<svg>":"",o=R;for(let a=0;a<e;a++){const c=i[a];let h,d,l=-1,f=0;for(;f<c.length&&(o.lastIndex=f,d=o.exec(c),d!==null);)f=o.lastIndex,o===R?d[1]==="!--"?o=Rt:d[1]!==void 0?o=It:d[2]!==void 0?(Jt.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=S):d[3]!==void 0&&(o=S):o===S?d[0]===">"?(o=n??R,l=-1):d[1]===void 0?l=-2:(l=o.lastIndex-d[2].length,h=d[1],o=d[3]===void 0?S:d[3]==='"'?kt:Mt):o===kt||o===Mt?o=S:o===Rt||o===It?o=R:(o=S,n=void 0);const u=o===S&&i[a+1].startsWith("/>")?" ":"";s+=o===R?c+Oe:l>=0?(r.push(h),c.slice(0,l)+qt+c.slice(l)+_+u):c+_+(l===-2?a:u)}return[Kt(i,s+(i[e]||"<?>")+(t===2?"</svg>":"")),r]};class N{constructor({strings:t,_$litType$:e},r){let n;this.parts=[];let s=0,o=0;const a=t.length-1,c=this.parts,[h,d]=Ie(t,e);if(this.el=N.createElement(h,r),C.currentNode=this.el.content,e===2){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(n=C.nextNode())!==null&&c.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(const l of n.getAttributeNames())if(l.endsWith(qt)){const f=d[o++],u=n.getAttribute(l).split(_),g=/([.?@])?(.*)/.exec(f);c.push({type:1,index:s,name:g[2],strings:u,ctor:g[1]==="."?ke:g[1]==="?"?je:g[1]==="@"?He:tt}),n.removeAttribute(l)}else l.startsWith(_)&&(c.push({type:6,index:s}),n.removeAttribute(l));if(Jt.test(n.tagName)){const l=n.textContent.split(_),f=l.length-1;if(f>0){n.textContent=K?K.emptyScript:"";for(let u=0;u<f;u++)n.append(l[u],j()),C.nextNode(),c.push({type:2,index:++s});n.append(l[f],j())}}}else if(n.nodeType===8)if(n.data===Ft)c.push({type:2,index:s});else{let l=-1;for(;(l=n.data.indexOf(_,l+1))!==-1;)c.push({type:7,index:s}),l+=_.length-1}s++}}static createElement(t,e){const r=x.createElement("template");return r.innerHTML=t,r}}function O(i,t,e=i,r){var o,a;if(t===P)return t;let n=r!==void 0?(o=e._$Co)==null?void 0:o[r]:e._$Cl;const s=H(t)?void 0:t._$litDirective$;return(n==null?void 0:n.constructor)!==s&&((a=n==null?void 0:n._$AO)==null||a.call(n,!1),s===void 0?n=void 0:(n=new s(i),n._$AT(i,e,r)),r!==void 0?(e._$Co??(e._$Co=[]))[r]=n:e._$Cl=n),n!==void 0&&(t=O(i,n._$AS(i,t.values),n,r)),t}class Me{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:r}=this._$AD,n=((t==null?void 0:t.creationScope)??x).importNode(e,!0);C.currentNode=n;let s=C.nextNode(),o=0,a=0,c=r[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new B(s,s.nextSibling,this,t):c.type===1?h=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(h=new Ne(s,this,t)),this._$AV.push(h),c=r[++a]}o!==(c==null?void 0:c.index)&&(s=C.nextNode(),o++)}return C.currentNode=x,n}p(t){let e=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class B{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,r,n){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=n,this._$Cv=(n==null?void 0:n.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=O(this,t,e),H(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==P&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Ue(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==p&&H(this._$AH)?this._$AA.nextSibling.data=t:this.$(x.createTextNode(t)),this._$AH=t}g(t){var s;const{values:e,_$litType$:r}=t,n=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=N.createElement(Kt(r.h,r.h[0]),this.options)),r);if(((s=this._$AH)==null?void 0:s._$AD)===n)this._$AH.p(e);else{const o=new Me(n,this),a=o.u(this.options);o.p(e),this.$(a),this._$AH=o}}_$AC(t){let e=jt.get(t.strings);return e===void 0&&jt.set(t.strings,e=new N(t)),e}T(t){Yt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,n=0;for(const s of t)n===e.length?e.push(r=new B(this.k(j()),this.k(j()),this,this.options)):r=e[n],r._$AI(s),n++;n<e.length&&(this._$AR(r&&r._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t&&t!==this._$AB;){const n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,n,s){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=p}_$AI(t,e=this,r,n){const s=this.strings;let o=!1;if(s===void 0)t=O(this,t,e,0),o=!H(t)||t!==this._$AH&&t!==P,o&&(this._$AH=t);else{const a=t;let c,h;for(t=s[0],c=0;c<s.length-1;c++)h=O(this,a[r+c],e,c),h===P&&(h=this._$AH[c]),o||(o=!H(h)||h!==this._$AH[c]),h===p?t=p:t!==p&&(t+=(h??"")+s[c+1]),this._$AH[c]=h}o&&!n&&this.O(t)}O(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ke extends tt{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===p?void 0:t}}class je extends tt{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}}class He extends tt{constructor(t,e,r,n,s){super(t,e,r,n,s),this.type=5}_$AI(t,e=this){if((t=O(this,t,e,0)??p)===P)return;const r=this._$AH,n=t===p&&r!==p||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,s=t!==p&&(r===p||n);n&&this.element.removeEventListener(this.name,this,r),s&&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 Ne{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){O(this,t)}}const at=M.litHtmlPolyfillSupport;at==null||at(N,B),(M.litHtmlVersions??(M.litHtmlVersions=[])).push("3.0.2");const De=(i,t,e)=>{const r=(e==null?void 0:e.renderBefore)??t;let n=r._$litPart$;if(n===void 0){const s=(e==null?void 0:e.renderBefore)??null;r._$litPart$=n=new B(t.insertBefore(j(),s),s,void 0,e??{})}return n._$AI(i),n};/**
15
+ */const R=globalThis,K=R.trustedTypes,Ot=K?K.createPolicy("lit-html",{createHTML:r=>r}):void 0,Vt="$lit$",b=`lit$${(Math.random()+"").slice(9)}$`,qt="?"+b,Oe=`<${qt}>`,C=document,M=()=>C.createComment(""),j=r=>r===null||typeof r!="object"&&typeof r!="function",Ft=Array.isArray,Ue=r=>Ft(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",at=`[
16
+ \f\r]`,O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ut=/-->/g,Rt=/>/g,A=RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^
17
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),It=/'/g,Mt=/"/g,Yt=/^(?:script|style|textarea|title)$/i,Re=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Z=Re(1),x=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),jt=new WeakMap,E=C.createTreeWalker(C,129);function Jt(r,t){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ot!==void 0?Ot.createHTML(t):t}const Ie=(r,t)=>{const e=r.length-1,i=[];let n,s=t===2?"<svg>":"",o=O;for(let a=0;a<e;a++){const c=r[a];let h,d,l=-1,f=0;for(;f<c.length&&(o.lastIndex=f,d=o.exec(c),d!==null);)f=o.lastIndex,o===O?d[1]==="!--"?o=Ut:d[1]!==void 0?o=Rt:d[2]!==void 0?(Yt.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=A):d[3]!==void 0&&(o=A):o===A?d[0]===">"?(o=n??O,l=-1):d[1]===void 0?l=-2:(l=o.lastIndex-d[2].length,h=d[1],o=d[3]===void 0?A:d[3]==='"'?Mt:It):o===Mt||o===It?o=A:o===Ut||o===Rt?o=O:(o=A,n=void 0);const p=o===A&&r[a+1].startsWith("/>")?" ":"";s+=o===O?c+Oe:l>=0?(i.push(h),c.slice(0,l)+Vt+c.slice(l)+b+p):c+b+(l===-2?a:p)}return[Jt(r,s+(r[e]||"<?>")+(t===2?"</svg>":"")),i]};class H{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let s=0,o=0;const a=t.length-1,c=this.parts,[h,d]=Ie(t,e);if(this.el=H.createElement(h,i),E.currentNode=this.el.content,e===2){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(n=E.nextNode())!==null&&c.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(const l of n.getAttributeNames())if(l.endsWith(Vt)){const f=d[o++],p=n.getAttribute(l).split(b),g=/([.?@])?(.*)/.exec(f);c.push({type:1,index:s,name:g[2],strings:p,ctor:g[1]==="."?je:g[1]==="?"?He:g[1]==="@"?ke:et}),n.removeAttribute(l)}else l.startsWith(b)&&(c.push({type:6,index:s}),n.removeAttribute(l));if(Yt.test(n.tagName)){const l=n.textContent.split(b),f=l.length-1;if(f>0){n.textContent=K?K.emptyScript:"";for(let p=0;p<f;p++)n.append(l[p],M()),E.nextNode(),c.push({type:2,index:++s});n.append(l[f],M())}}}else if(n.nodeType===8)if(n.data===qt)c.push({type:2,index:s});else{let l=-1;for(;(l=n.data.indexOf(b,l+1))!==-1;)c.push({type:7,index:s}),l+=b.length-1}s++}}static createElement(t,e){const i=C.createElement("template");return i.innerHTML=t,i}}function T(r,t,e=r,i){var o,a;if(t===x)return t;let n=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const s=j(t)?void 0:t._$litDirective$;return(n==null?void 0:n.constructor)!==s&&((a=n==null?void 0:n._$AO)==null||a.call(n,!1),s===void 0?n=void 0:(n=new s(r),n._$AT(r,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=n:e._$Cl=n),n!==void 0&&(t=T(r,n._$AS(r,t.values),n,i)),t}class Me{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,n=((t==null?void 0:t.creationScope)??C).importNode(e,!0);E.currentNode=n;let s=E.nextNode(),o=0,a=0,c=i[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new L(s,s.nextSibling,this,t):c.type===1?h=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(h=new Ne(s,this,t)),this._$AV.push(h),c=i[++a]}o!==(c==null?void 0:c.index)&&(s=E.nextNode(),o++)}return E.currentNode=C,n}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 L{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,n){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cv=(n==null?void 0:n.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=T(this,t,e),j(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==x&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Ue(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==u&&j(this._$AH)?this._$AA.nextSibling.data=t:this.$(C.createTextNode(t)),this._$AH=t}g(t){var s;const{values:e,_$litType$:i}=t,n=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=H.createElement(Jt(i.h,i.h[0]),this.options)),i);if(((s=this._$AH)==null?void 0:s._$AD)===n)this._$AH.p(e);else{const o=new Me(n,this),a=o.u(this.options);o.p(e),this.$(a),this._$AH=o}}_$AC(t){let e=jt.get(t.strings);return e===void 0&&jt.set(t.strings,e=new H(t)),e}T(t){Ft(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const s of t)n===e.length?e.push(i=new L(this.k(M()),this.k(M()),this,this.options)):i=e[n],i._$AI(s),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$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 n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class et{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,n,s){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=s,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,n){const s=this.strings;let o=!1;if(s===void 0)t=T(this,t,e,0),o=!j(t)||t!==this._$AH&&t!==x,o&&(this._$AH=t);else{const a=t;let c,h;for(t=s[0],c=0;c<s.length-1;c++)h=T(this,a[i+c],e,c),h===x&&(h=this._$AH[c]),o||(o=!j(h)||h!==this._$AH[c]),h===u?t=u:t!==u&&(t+=(h??"")+s[c+1]),this._$AH[c]=h}o&&!n&&this.O(t)}O(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class je extends et{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===u?void 0:t}}class He extends et{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}}class ke extends et{constructor(t,e,i,n,s){super(t,e,i,n,s),this.type=5}_$AI(t,e=this){if((t=T(this,t,e,0)??u)===x)return;const i=this._$AH,n=t===u&&i!==u||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,s=t!==u&&(i===u||n);n&&this.element.removeEventListener(this.name,this,i),s&&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 Ne{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){T(this,t)}}const ct=R.litHtmlPolyfillSupport;ct==null||ct(H,L),(R.litHtmlVersions??(R.litHtmlVersions=[])).push("3.0.2");const De=(r,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let n=i._$litPart$;if(n===void 0){const s=(e==null?void 0:e.renderBefore)??null;i._$litPart$=n=new L(t.insertBefore(M(),s),s,void 0,e??{})}return n._$AI(r),n};/**
18
18
  * @license
19
19
  * Copyright 2017 Google LLC
20
20
  * SPDX-License-Identifier: BSD-3-Clause
21
- */let w=class extends T{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=De(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return P}};var Ht;w._$litElement$=!0,w.finalized=!0,(Ht=globalThis.litElementHydrateSupport)==null||Ht.call(globalThis,{LitElement:w});const ct=globalThis.litElementPolyfillSupport;ct==null||ct({LitElement:w});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.1");/**
21
+ */let $=class extends P{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=De(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return x}};var Ht;$._$litElement$=!0,$.finalized=!0,(Ht=globalThis.litElementHydrateSupport)==null||Ht.call(globalThis,{LitElement:$});const lt=globalThis.litElementPolyfillSupport;lt==null||lt({LitElement:$});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.1");/**
22
22
  * @license
23
23
  * Copyright 2017 Google LLC
24
24
  * SPDX-License-Identifier: BSD-3-Clause
25
- */const Le={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:bt},Be=(i=Le,t,e)=>{const{kind:r,metadata:n}=e;let s=globalThis.litPropertyMetadata.get(n);if(s===void 0&&globalThis.litPropertyMetadata.set(n,s=new Map),s.set(e.name,i),r==="accessor"){const{name:o}=e;return{set(a){const c=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,c,i)},init(a){return a!==void 0&&this.C(o,void 0,i),a}}}if(r==="setter"){const{name:o}=e;return function(a){const c=this[o];t.call(this,a),this.requestUpdate(o,c,i)}}throw Error("Unsupported decorator location: "+r)};function y(i){return(t,e)=>typeof e=="object"?Be(i,t,e):((r,n,s)=>{const o=n.hasOwnProperty(s);return n.constructor.createProperty(s,o?{...r,wrapped:!0}:r),o?Object.getOwnPropertyDescriptor(n,s):void 0})(i,t,e)}/**
25
+ */const rt=r=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(r,t)}):customElements.define(r,t)};/**
26
26
  * @license
27
27
  * Copyright 2017 Google LLC
28
28
  * SPDX-License-Identifier: BSD-3-Clause
29
- */function z(i){return y({...i,state:!0,attribute:!1})}/**
29
+ */const Le={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:_t},Be=(r=Le,t,e)=>{const{kind:i,metadata:n}=e;let s=globalThis.litPropertyMetadata.get(n);if(s===void 0&&globalThis.litPropertyMetadata.set(n,s=new Map),s.set(e.name,r),i==="accessor"){const{name:o}=e;return{set(a){const c=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,c,r)},init(a){return a!==void 0&&this.C(o,void 0,r),a}}}if(i==="setter"){const{name:o}=e;return function(a){const c=this[o];t.call(this,a),this.requestUpdate(o,c,r)}}throw Error("Unsupported decorator location: "+i)};function y(r){return(t,e)=>typeof e=="object"?Be(r,t,e):((i,n,s)=>{const o=n.hasOwnProperty(s);return n.constructor.createProperty(s,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(n,s):void 0})(r,t,e)}/**
30
30
  * @license
31
31
  * Copyright 2017 Google LLC
32
32
  * SPDX-License-Identifier: BSD-3-Clause
33
- */const Zt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Qt=i=>(...t)=>({_$litDirective$:i,values:t});class Xt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
33
+ */function B(r){return y({...r,state:!0,attribute:!1})}/**
34
+ * @license
35
+ * Copyright 2017 Google LLC
36
+ * SPDX-License-Identifier: BSD-3-Clause
37
+ */const Kt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Zt=r=>(...t)=>({_$litDirective$:r,values:t});class Qt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
34
38
  * @license
35
39
  * Copyright 2018 Google LLC
36
40
  * SPDX-License-Identifier: BSD-3-Clause
37
- */const ze=Qt(class extends Xt{constructor(i){var t;if(super(i),i.type!==Zt.ATTRIBUTE||i.name!=="class"||((t=i.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){var r,n;if(this.it===void 0){this.it=new Set,i.strings!==void 0&&(this.st=new Set(i.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in t)t[s]&&!((r=this.st)!=null&&r.has(s))&&this.it.add(s);return this.render(t)}const e=i.element.classList;for(const s of this.it)s in t||(e.remove(s),this.it.delete(s));for(const s in t){const o=!!t[s];o===this.it.has(s)||(n=this.st)!=null&&n.has(s)||(o?(e.add(s),this.it.add(s)):(e.remove(s),this.it.delete(s)))}return P}}),G=(i,t,e)=>{i&&e.style.setProperty(t,i)},te=(i,t)=>{var e,r,n,s;G((e=i.colors)==null?void 0:e.primaryBackground,"--primary-background",t),G((r=i.colors)==null?void 0:r.textOnPrimaryBackground,"--text-on-primary-background",t),G((n=i.colors)==null?void 0:n.secondaryBackground,"--secondary-background",t),G((s=i.colors)==null?void 0:s.textOnSecondaryBackground,"--text-on-secondary-background",t)};var We=Object.defineProperty,Ge=Object.getOwnPropertyDescriptor,et=(i,t,e,r)=>{for(var n=r>1?void 0:r?Ge(t,e):t,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&We(t,e,n),n};class b extends w{constructor(){super(...arguments),this.active=!1,this.loaded=!1}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}_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.application.removeFromDOM()}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&te(this.application.settings.branding,this)}async _renderSymbol(){var s;const t=(s=this.application)==null?void 0:s.triggerIcon;if(!t)return p;const e=async o=>await Promise.resolve().then(()=>require("./index-6dd00f59.js")).then(c=>c[o]),{type:r,content:n}=t;switch(r){case"Telia":{const o=await e(n);return o?Z`<telia-icon
41
+ */const We=Zt(class extends Qt{constructor(r){var t;if(super(r),r.type!==Kt.ATTRIBUTE||r.name!=="class"||((t=r.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter(t=>r[t]).join(" ")+" "}update(r,[t]){var i,n;if(this.it===void 0){this.it=new Set,r.strings!==void 0&&(this.st=new Set(r.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in t)t[s]&&!((i=this.st)!=null&&i.has(s))&&this.it.add(s);return this.render(t)}const e=r.element.classList;for(const s of this.it)s in t||(e.remove(s),this.it.delete(s));for(const s in t){const o=!!t[s];o===this.it.has(s)||(n=this.st)!=null&&n.has(s)||(o?(e.add(s),this.it.add(s)):(e.remove(s),this.it.delete(s)))}return x}}),G=(r,t,e)=>{r&&e.style.setProperty(t,r)},Xt=(r,t)=>{var e,i,n,s;G((e=r.colors)==null?void 0:e.primaryBackground,"--primary-background",t),G((i=r.colors)==null?void 0:i.textOnPrimaryBackground,"--text-on-primary-background",t),G((n=r.colors)==null?void 0:n.secondaryBackground,"--secondary-background",t),G((s=r.colors)==null?void 0:s.textOnSecondaryBackground,"--text-on-secondary-background",t)};var ze=Object.defineProperty,Ge=Object.getOwnPropertyDescriptor,W=(r,t,e,i)=>{for(var n=i>1?void 0:i?Ge(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(t,e,n):o(n))||n);return i&&n&&ze(t,e,n),n};exports.Trigger=class extends ${constructor(){super(...arguments),this.active=!1,this.loaded=!1}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}_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.application.removeFromDOM()}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&Xt(this.application.settings.branding,this)}async _renderSymbol(){var s;const t=(s=this.application)==null?void 0:s.triggerIcon;if(!t)return u;const e=async o=>await Promise.resolve().then(()=>require("./index-6dd00f59.js")).then(c=>c[o]),{type:i,content:n}=t;switch(i){case"Telia":{const o=await e(n);return o?Z`<telia-icon
38
42
  class="trigger-icon"
39
43
  svg=${o.svg}
40
44
  size="lg"
41
- ></telia-icon>`:p}default:return p}}render(){return Z`<button
42
- class=${ze({trigger:!0,active:this.active,rendered:this.loaded})}
45
+ ></telia-icon>`:u}default:return u}}render(){return Z`<button
46
+ class=${We({trigger:!0,active:this.active,rendered:this.loaded})}
43
47
  @click=${this._toggleActive}
44
48
  >
45
49
  ${this.icon}
@@ -70,7 +74,7 @@
70
74
  />
71
75
  </svg>
72
76
  </span>
73
- </button>`}}b.styles=[L`
77
+ </button>`}};exports.Trigger.styles=[D`
74
78
  :host {
75
79
  --voca-rem-multiplier: 0.625;
76
80
  display: block;
@@ -138,7 +142,7 @@
138
142
  align-items: center;
139
143
  fill: var(--trigger-text-color, var(--text-on-primary-background));
140
144
  }
141
- `];et([y({attribute:!1})],b.prototype,"application",2);et([z()],b.prototype,"active",2);et([z()],b.prototype,"loaded",2);et([z()],b.prototype,"icon",2);var Ve=Object.defineProperty,qe=Object.getOwnPropertyDescriptor,E=(i,t,e,r)=>{for(var n=r>1?void 0:r?qe(t,e):t,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&Ve(t,e,n),n};const ee=i=>{class t extends i{constructor(){super(...arguments),this.properties={},this.context={},this.layout={},this.nodes=[]}writeProperties(r){this.properties=r}writeLayout(r){this.layout=r}writeContext(r){this.context=r}addChild(r){r.parent=this,this.nodes.push(r)}connectedCallback(){super.connectedCallback(),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`)}}return t.styles=[L`
145
+ `];W([y({attribute:!1})],exports.Trigger.prototype,"application",2);W([B()],exports.Trigger.prototype,"active",2);W([B()],exports.Trigger.prototype,"loaded",2);W([B()],exports.Trigger.prototype,"icon",2);exports.Trigger=W([rt("ace-trigger")],exports.Trigger);var Ve=Object.defineProperty,qe=Object.getOwnPropertyDescriptor,S=(r,t,e,i)=>{for(var n=i>1?void 0:i?qe(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(t,e,n):o(n))||n);return i&&n&&Ve(t,e,n),n};const te=r=>{class t extends r{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))`)}}return t.styles=[D`
142
146
  :host {
143
147
  font-family: var(--font-family);
144
148
  grid-column: span var(--width);
@@ -150,29 +154,29 @@
150
154
  * {
151
155
  box-sizing: border-box;
152
156
  }
153
- `],E([y()],t.prototype,"properties",2),E([y()],t.prototype,"context",2),E([y()],t.prototype,"layout",2),E([y()],t.prototype,"name",2),E([y()],t.prototype,"type",2),E([y({attribute:!1})],t.prototype,"application",2),E([y({attribute:!1})],t.prototype,"parent",2),t};class _t extends ee(w){render(){return Z`Non resolved component`}}_t.styles=[L`
157
+ `],S([y()],t.prototype,"properties",2),S([y()],t.prototype,"context",2),S([y()],t.prototype,"layout",2),S([y()],t.prototype,"name",2),S([y()],t.prototype,"type",2),S([y({attribute:!1})],t.prototype,"application",2),S([y({attribute:!1})],t.prototype,"parent",2),t};var Fe=Object.defineProperty,Ye=Object.getOwnPropertyDescriptor,Je=(r,t,e,i)=>{for(var n=i>1?void 0:i?Ye(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(t,e,n):o(n))||n);return i&&n&&Fe(t,e,n),n};let Q=class extends te($){render(){return Z`Non resolved component`}};Q.styles=[D`
154
158
  :host {
155
159
  display: block;
156
160
  }
157
- `];/**
161
+ `];Q=Je([rt("ace-unresolved-component")],Q);/**
158
162
  * @license
159
163
  * Copyright 2020 Google LLC
160
164
  * SPDX-License-Identifier: BSD-3-Clause
161
- */const Fe=i=>i.strings===void 0;/**
165
+ */const Ke=r=>r.strings===void 0;/**
162
166
  * @license
163
167
  * Copyright 2017 Google LLC
164
168
  * SPDX-License-Identifier: BSD-3-Clause
165
- */const k=(i,t)=>{var r;const e=i._$AN;if(e===void 0)return!1;for(const n of e)(r=n._$AO)==null||r.call(n,t,!1),k(n,t);return!0},Q=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while((e==null?void 0:e.size)===0)},re=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),Ke(t)}};function Ye(i){this._$AN!==void 0?(Q(this),this._$AM=i,re(this)):this._$AM=i}function Je(i,t=!1,e=0){const r=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(r))for(let s=e;s<r.length;s++)k(r[s],!1),Q(r[s]);else r!=null&&(k(r,!1),Q(r));else k(this,i)}const Ke=i=>{i.type==Zt.CHILD&&(i._$AP??(i._$AP=Je),i._$AQ??(i._$AQ=Ye))};class Ze extends Xt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),re(this),this.isConnected=t._$AU}_$AO(t,e=!0){var r,n;t!==this.isConnected&&(this.isConnected=t,t?(r=this.reconnected)==null||r.call(this):(n=this.disconnected)==null||n.call(this)),e&&(k(this,t),Q(this))}setValue(t){if(Fe(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(){}}/**
169
+ */const I=(r,t)=>{var i;const e=r._$AN;if(e===void 0)return!1;for(const n of e)(i=n._$AO)==null||i.call(n,t,!1),I(n,t);return!0},X=r=>{let t,e;do{if((t=r._$AM)===void 0)break;e=t._$AN,e.delete(r),r=t}while((e==null?void 0:e.size)===0)},ee=r=>{for(let t;t=r._$AM;r=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(r))break;e.add(r),Xe(t)}};function Ze(r){this._$AN!==void 0?(X(this),this._$AM=r,ee(this)):this._$AM=r}function Qe(r,t=!1,e=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(i))for(let s=e;s<i.length;s++)I(i[s],!1),X(i[s]);else i!=null&&(I(i,!1),X(i));else I(this,r)}const Xe=r=>{r.type==Kt.CHILD&&(r._$AP??(r._$AP=Qe),r._$AQ??(r._$AQ=Ze))};class tr extends Qt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),ee(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,n;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),e&&(I(this,t),X(this))}setValue(t){if(Ke(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(){}}/**
166
170
  * @license
167
171
  * Copyright 2020 Google LLC
168
172
  * SPDX-License-Identifier: BSD-3-Clause
169
- */const Qe=()=>new Xe;class Xe{}const lt=new WeakMap,tr=Qt(class extends Ze{render(i){return p}update(i,[t]){var r;const e=t!==this.G;return e&&this.G!==void 0&&this.ot(void 0),(e||this.rt!==this.lt)&&(this.G=t,this.ct=(r=i.options)==null?void 0:r.host,this.ot(this.lt=i.element)),p}ot(i){if(typeof this.G=="function"){const t=this.ct??globalThis;let e=lt.get(t);e===void 0&&(e=new WeakMap,lt.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ct,void 0),e.set(this.G,i),i!==void 0&&this.G.call(this.ct,i)}else this.G.value=i}get rt(){var i,t;return typeof this.G=="function"?(i=lt.get(this.ct??globalThis))==null?void 0:i.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});/**
173
+ */const er=()=>new rr;class rr{}const ht=new WeakMap,ir=Zt(class extends tr{render(r){return u}update(r,[t]){var i;const e=t!==this.G;return e&&this.G!==void 0&&this.ot(void 0),(e||this.rt!==this.lt)&&(this.G=t,this.ct=(i=r.options)==null?void 0:i.host,this.ot(this.lt=r.element)),u}ot(r){if(typeof this.G=="function"){const t=this.ct??globalThis;let e=ht.get(t);e===void 0&&(e=new WeakMap,ht.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ct,void 0),e.set(this.G,r),r!==void 0&&this.G.call(this.ct,r)}else this.G.value=r}get rt(){var r,t;return typeof this.G=="function"?(r=ht.get(this.ct??globalThis))==null?void 0:r.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});/**
170
174
  * @license
171
175
  * Copyright 2021 Google LLC
172
176
  * SPDX-License-Identifier: BSD-3-Clause
173
- */function*er(i,t){if(i!==void 0){let e=0;for(const r of i)yield t(r,e++)}}var A=(i=>(i.Inline="inline",i.Trigger="trigger",i))(A||{}),rr=Object.defineProperty,ir=Object.getOwnPropertyDescriptor,nr=(i,t,e,r)=>{for(var n=r>1?void 0:r?ir(t,e):t,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&rr(t,e,n),n};class rt extends w{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=Qe()}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(this.wrapperRef.value){const t=this.application.settings;t!=null&&t.branding&&te(t.branding,this.wrapperRef.value)}}firstUpdated(t){this.applyBranding()}render(){return this.application.renderStrategy===A.Trigger&&this.renderRoot.host.classList.add("floating"),Z`<div class="widget-container" ${tr(this.wrapperRef)}>
174
- ${er(this.nodes,t=>t)}
175
- </div>`}}rt.styles=L`
177
+ */function*nr(r,t){if(r!==void 0){let e=0;for(const i of r)yield t(i,e++)}}var w=(r=>(r.Inline="inline",r.Trigger="trigger",r))(w||{}),sr=Object.defineProperty,or=Object.getOwnPropertyDescriptor,re=(r,t,e,i)=>{for(var n=i>1?void 0:i?or(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(t,e,n):o(n))||n);return i&&n&&sr(t,e,n),n};let k=class extends ${constructor(){super(...arguments),this.nodes=[],this.wrapperRef=er()}addChild(r){r.parent=this,this.nodes.push(r)}applyBranding(){if(this.wrapperRef.value){const r=this.application.settings;r!=null&&r.branding&&Xt(r.branding,this.wrapperRef.value)}}firstUpdated(r){this.applyBranding()}render(){return this.application.renderStrategy===w.Trigger&&this.renderRoot.host.classList.add("floating"),Z`<div class="widget-container" ${ir(this.wrapperRef)}>
178
+ ${nr(this.nodes,r=>r)}
179
+ </div>`}};k.styles=D`
176
180
  :host {
177
181
  --font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
178
182
  --spacing-xs: 0.2rem;
@@ -250,8 +254,8 @@
250
254
  opacity: 1;
251
255
  }
252
256
  }
253
- `;nr([y({attribute:!1})],rt.prototype,"application",2);class sr{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const r=a=>{if(Array.isArray(a)){const[c,...h]=a;return{definitionId:c,overrides:h}}return{definitionId:a,overrides:[]}},n=(a,c,h,d)=>{h.forEach(l=>{const f=r(l),u=d[f.definitionId];if(!u){console.error(`No definition found for component type '${f.definitionId}'.`);return}const g=a.createNode(u.type,u.type);g&&(g.name=f.definitionId,g.application=e,u.properties&&g.writeProperties(u.properties),u.context&&g.writeContext(u.context),u.layout&&g.writeLayout(u.layout),c.addChild(g),u.children&&n(a,g,u.children,d))})},{entry:s,components:o}=t;return n(this,this.root,[s],o),this.root}createRoot(){return new rt}createNode(t,e){const r=this.resolveComponent(e);if(!r)return console.warn(`Unable to resolve component: ${e}`),new _t;const n=new r;return n.type=e,n.name=t,n}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const ie=class{constructor(){this.components=new Map}getComponent(i){const t=this.components.get(i);return t||console.warn(`Unable to resolve component: ${i}. You most likely forgot to register the required plugin.`),t}registerComponent(i,t){this.components.set(i,t)}async loadComponents(){const i=[...this.components.entries()].map(([t,e])=>e.then(r=>{this.defineAsWebComponent(t,r.default)}));await Promise.all(i)}defineAsWebComponent(i,t){const e=ie.ResolveWebComponentName(i);customElements.get(e)||customElements.define(e,t)}};let ne=ie;ne.ResolveWebComponentName=i=>`ace-${i}`;class se{constructor(t,e,r,n){this.name=t,this.container=e,this.settings=r,this.options=n,this.platform=new sr,this.renderStrategy=A.Inline,this.autoActivate=!1,this.plugins=[],this.componentResolver=new ne,this.renderStrategy=this.options.renderStrategy||A.Inline,this.triggerIcon=this.options.triggerIcon,typeof n.autoActivate=="boolean"&&(this.autoActivate=n.autoActivate),this.container.register("$settings",r)}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(Gt.Ready),this.autoActivate){const t=this.render();t&&document.body.appendChild(t)}}async loadPlugins(){for await(const t of this.plugins)await t(this)}plugin(t){return this.plugins.push(t),this}appendToDOM(){this.root&&document.body.appendChild(this.root)}removeFromDOM(){this.root&&document.body.removeChild(this.root)}registerComponent(t,e){this.componentResolver.registerComponent(t,e)}resolveComponent(t){return this.componentResolver.getComponent(t)}render(){if(this.renderStrategy===A.Trigger){const t=new b;return t.application=this,t}return this.root}}const oe=class{static async getSite(i){const e=await(await fetch(i)).json();return e?{id:e.id,apps:e.widgets.map(r=>{let n=A.Inline;return r.renderStrategy==="Trigger"&&(n=A.Trigger),{id:r.id,widgetId:r.widgetId,renderStrategy:n,triggerIcon:{type:"Telia",content:r.triggerIcon}}})}:null}static async getWidget(i){const e=await(await fetch(`${oe.endpoint}/widget/${i}`)).json();return e?{name:e.name,config:JSON.parse(e.configuration)}:null}};let vt=oe;vt.endpoint="https://widgets.ace.teliacompany.net/api";class ae{constructor(){this.applications=[],this.container=new gt("environment",this),setTimeout(()=>{this.notifyWidgetsOfCreation()},1e3)}async bootstrap(){await this.activate()}async activate(){const t=this.applications.filter(e=>e.autoActivate);for await(const e of t)await e.activate()}notifyWidgetsOfCreation(){document.querySelectorAll("ace-widget").forEach(e=>{const r=this.applications.find(n=>n.name===e.name);r&&e.dispatchEvent(new CustomEvent("environment-created",{detail:{widget:r}}))})}registerApp(t,e,r){const n=new gt(t,this),s=new se(t,n,e,r);this.applications.push(s)}}class ce{constructor(t){this.configurations=[],typeof t=="string"?this.url=t:this.loadFromConfig(t)}async load(t){const e=await vt.getSite(t);if(!e){console.warn(`Unable to load site from the url provided: ${t}`);return}this.configurations=e.apps}loadFromConfig(t){this.configurations=t.apps.map(e=>({id:"",renderStrategy:e.renderStrategy,widgetId:e.widgetId,autoActivate:e.autoActivate,triggerIcon:{type:"Telia",content:e.triggerIcon||"question"}}))}async bootstrap(t){var e;this.url&&await this.load(this.url),this.environment=new ae,this.addGlobal(this.environment);for await(const r of this.configurations){const n=await vt.getWidget(r.widgetId);n&&((e=this.environment)==null||e.registerApp(n.name,n.config,{renderStrategy:r.renderStrategy,triggerIcon:r.triggerIcon,autoActivate:r.autoActivate}))}t(this.environment),await this.environment.bootstrap()}addGlobal(t){globalThis.widgets=t}}var or=Object.defineProperty,ar=Object.getOwnPropertyDescriptor,$t=(i,t,e,r)=>{for(var n=r>1?void 0:r?ar(t,e):t,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&or(t,e,n),n};class U extends w{constructor(){super(),this.status="deactivated",this.addEventListener("environment-created",this.onEnvironmentCreated)}async connectedCallback(){super.connectedCallback(),await this.getGlobalEnvironment()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("environment-created",this.onEnvironmentCreated)}async onEnvironmentCreated(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 p;if(this.widget.renderStrategy===A.Trigger){const t=new b;return t.application=this.widget,t}return this.widget.render()}}U.styles=[L`
257
+ `;re([y({attribute:!1})],k.prototype,"application",2);k=re([rt("ace-wrapper")],k);class ar{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:[]}},n=(a,c,h,d)=>{h.forEach(l=>{const f=i(l),p=d[f.definitionId];if(!p){console.error(`No definition found for component type '${f.definitionId}'.`);return}const g=a.createNode(p.type,p.type);g&&(g.name=f.definitionId,g.application=e,p.properties&&g.writeProperties(p.properties),p.context&&g.writeContext(p.context),p.layout&&g.writeLayout(p.layout),c.addChild(g),p.children&&n(a,g,p.children,d))})},{entry:s,components:o}=t;return n(this,this.root,[s],o),this.root}createRoot(){return new k}createNode(t,e){const i=this.resolveComponent(e);if(!i)return console.warn(`Unable to resolve component: ${e}`),new Q;const n=new i;return n.type=e,n.name=t,n}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const ie=class{constructor(){this.components=new Map}getComponent(r){const t=this.components.get(r);return t||console.warn(`Unable to resolve component: ${r}. You most likely forgot to register the required plugin.`),t}registerComponent(r,t){this.components.set(r,t)}async loadComponents(){const r=[...this.components.entries()].map(([t,e])=>e.then(i=>{this.defineAsWebComponent(t,i.default)}));await Promise.all(r)}defineAsWebComponent(r,t){const e=ie.ResolveWebComponentName(r);customElements.get(e)||customElements.define(e,t)}};let ne=ie;ne.ResolveWebComponentName=r=>`ace-${r}`;class se{constructor(t,e,i,n){this.name=t,this.container=e,this.settings=i,this.options=n,this.platform=new ar,this.renderStrategy=w.Inline,this.autoActivate=!1,this.plugins=[],this.componentResolver=new ne,this.renderStrategy=this.options.renderStrategy||w.Inline,this.triggerIcon=this.options.triggerIcon,typeof n.autoActivate=="boolean"&&(this.autoActivate=n.autoActivate),this.container.register("$settings",i)}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(zt.Ready),this.autoActivate){const t=this.render();t&&document.body.appendChild(t)}}async loadPlugins(){for await(const t of this.plugins)await t(this)}plugin(t){return this.plugins.push(t),this}appendToDOM(){this.root&&document.body.appendChild(this.root)}removeFromDOM(){this.root&&document.body.removeChild(this.root)}registerComponent(t,e){this.componentResolver.registerComponent(t,e)}resolveComponent(t){return this.componentResolver.getComponent(t)}render(){if(this.renderStrategy===w.Trigger){const t=new exports.Trigger;return t.application=this,t}return this.root}}const oe=class{static async getSite(r){const e=await(await fetch(r)).json();return e?{id:e.id,apps:e.widgets.map(i=>{let n=w.Inline;return i.renderStrategy==="Trigger"&&(n=w.Trigger),{id:i.id,widgetId:i.widgetId,renderStrategy:n,triggerIcon:{type:"Telia",content:i.triggerIcon}}})}:null}static async getWidget(r){const e=await(await fetch(`${oe.endpoint}/widget/${r}`)).json();return e?{name:e.name,config:JSON.parse(e.configuration)}:null}};let yt=oe;yt.endpoint="https://widgets.ace.teliacompany.net/api";class ae{constructor(){this.applications=[],this.container=new vt("environment",this),setTimeout(()=>{this.notifyWidgetsOfCreation()},1e3)}async bootstrap(){await this.activate()}async activate(){const t=this.applications.filter(e=>e.autoActivate);for await(const e of t)await e.activate()}notifyWidgetsOfCreation(){document.querySelectorAll("ace-widget").forEach(e=>{const i=this.applications.find(n=>n.name===e.name);i&&e.dispatchEvent(new CustomEvent("environment-created",{detail:{widget:i}}))})}registerApp(t,e,i){const n=new vt(t,this),s=new se(t,n,e,i);this.applications.push(s)}}class ce{constructor(t){this.configurations=[],typeof t=="string"?this.url=t:this.loadFromConfig(t)}async load(t){const e=await yt.getSite(t);if(!e){console.warn(`Unable to load site from the url provided: ${t}`);return}this.configurations=e.apps}loadFromConfig(t){this.configurations=t.apps.map(e=>({id:"",renderStrategy:e.renderStrategy,widgetId:e.widgetId,autoActivate:e.autoActivate,triggerIcon:{type:"Telia",content:e.triggerIcon||"question"}}))}async bootstrap(t){var e;this.url&&await this.load(this.url),this.environment=new ae,this.addGlobal(this.environment);for await(const i of this.configurations){const n=await yt.getWidget(i.widgetId);n&&((e=this.environment)==null||e.registerApp(n.name,n.config,{renderStrategy:i.renderStrategy,triggerIcon:i.triggerIcon,autoActivate:i.autoActivate}))}t(this.environment),await this.environment.bootstrap()}addGlobal(t){globalThis.widgets=t}}var cr=Object.defineProperty,lr=Object.getOwnPropertyDescriptor,it=(r,t,e,i)=>{for(var n=i>1?void 0:i?lr(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(t,e,n):o(n))||n);return i&&n&&cr(t,e,n),n};exports.AceWidget=class extends ${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===w.Trigger){const t=new exports.Trigger;return t.application=this.widget,t}return this.widget.render()}};exports.AceWidget.styles=[D`
254
258
  :host {
255
259
  display: block;
256
260
  }
257
- `];$t([y({attribute:!0})],U.prototype,"name",2);$t([z()],U.prototype,"widget",2);$t([z()],U.prototype,"status",2);customElements.get("ace-trigger")||customElements.define("ace-trigger",b);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",_t);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",rt);customElements.get("ace-widget")||customElements.define("ace-widget",U);const cr=async(i,t)=>{await new ce(i).bootstrap(t)};exports.AceWidget=U;exports.Application=se;exports.Container=gt;exports.Environment=ae;exports.Site=ce;exports.Trigger=b;exports.WidgetComponent=ee;exports.bootstrap=cr;
261
+ `];it([y({attribute:!0})],exports.AceWidget.prototype,"name",2);it([B()],exports.AceWidget.prototype,"widget",2);it([B()],exports.AceWidget.prototype,"status",2);exports.AceWidget=it([rt("ace-widget")],exports.AceWidget);const hr=async(r,t)=>{await new ce(r).bootstrap(t)};exports.Application=se;exports.Container=vt;exports.Environment=ae;exports.Site=ce;exports.WidgetComponent=te;exports.bootstrap=hr;