@telia-ace/widget-core-flamingo 1.1.82-rc.2 → 1.1.82-rc.4

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 +18 -18
  2. package/index.mjs +104 -95
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -1,24 +1,24 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var gt=function(r,t){return gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])},gt(r,t)};function Y(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");gt(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function mt(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 vt(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var i=e.call(r),s,n=[],o;try{for(;(t===void 0||t-- >0)&&!(s=i.next()).done;)n.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return n}function yt(r,t,e){if(e||arguments.length===2)for(var i=0,s=t.length,n;i<s;i++)(n||!(i in t))&&(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return r.concat(n||Array.prototype.slice.call(t))}function _(r){return typeof r=="function"}function ae(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 ot=ae(function(r){return function(e){r(this),this.message=e?e.length+` errors occurred during unsubscription:
2
2
  `+e.map(function(i,s){return s+1+") "+i.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=e}});function bt(r,t){if(r){var e=r.indexOf(t);0<=e&&r.splice(e,1)}}var rt=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,s,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(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 l=this.initialTeardown;if(_(l))try{l()}catch(v){n=v instanceof ot?v.errors:[v]}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{Lt(g)}catch(v){n=n??[],v instanceof ot?n=yt(yt([],vt(n)),vt(v.errors)):n.push(v)}}}catch(v){i={error:v}}finally{try{f&&!f.done&&(s=p.return)&&s.call(p)}finally{if(i)throw i.error}}}if(n)throw new ot(n)}},r.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Lt(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)&&bt(e,t)},r.prototype.remove=function(t){var e=this._finalizers;e&&bt(e,t),t instanceof r&&t._removeParent(this)},r.EMPTY=function(){var t=new r;return t.closed=!0,t}(),r}(),ce=rt.EMPTY;function he(r){return r instanceof rt||r&&"closed"in r&&_(r.remove)&&_(r.add)&&_(r.unsubscribe)}function Lt(r){_(r)?r():r.unsubscribe()}var le={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Ie={setTimeout:function(r,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];return setTimeout.apply(void 0,yt([r,t],vt(e)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function Re(r){Ie.setTimeout(function(){throw r})}function jt(){}function J(r){r()}var de=function(r){Y(t,r);function t(e){var i=r.call(this)||this;return i.isStopped=!1,e?(i.destination=e,he(e)&&e.add(i)):i.destination=Le,i}return t.create=function(e,i,s){return new wt(e,i,s)},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}(rt),Me=Function.prototype.bind;function at(r,t){return Me.call(r,t)}var Ne=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}(),wt=function(r){Y(t,r);function t(e,i,s){var n=r.call(this)||this,o;if(_(e)||!e)o={next:e??void 0,error:i??void 0,complete:s??void 0};else{var a;n&&le.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 Ne(o),n}return t}(de);function Z(r){Re(r)}function Ue(r){throw r}var Le={closed:!0,next:jt,error:Ue,complete:jt},je=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function He(r){return r}function Be(r){return r.length===0?He:r.length===1?r[0]:function(e){return r.reduce(function(i,s){return s(i)},e)}}var Ht=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 s=this,n=ze(t)?t:new wt(t,e,i);return J(function(){var o=s,a=o.operator,c=o.source;n.add(a?a.call(n,c):c?s._subscribe(n):s._trySubscribe(n))}),n},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=Bt(e),new e(function(s,n){var o=new wt({next:function(a){try{t(a)}catch(c){n(c),o.unsubscribe()}},error:n,complete:s});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[je]=function(){return this},r.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Be(t)(this)},r.prototype.toPromise=function(t){var e=this;return t=Bt(t),new t(function(i,s){var n;e.subscribe(function(o){return n=o},function(o){return s(o)},function(){return i(n)})})},r.create=function(t){return new r(t)},r}();function Bt(r){var t;return(t=r??le.Promise)!==null&&t!==void 0?t:Promise}function De(r){return r&&_(r.next)&&_(r.error)&&_(r.complete)}function ze(r){return r&&r instanceof de||De(r)&&he(r)}var Fe=ae(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),xt=function(r){Y(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 Dt(this,this);return i.operator=e,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new Fe},t.prototype.next=function(e){var i=this;J(function(){var s,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){s={error:h}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.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 s=i.observers;s.length;)s.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(),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,s=this,n=s.hasError,o=s.isStopped,a=s.observers;return n||o?ce:(this.currentObservers=null,a.push(e),new rt(function(){i.currentObservers=null,bt(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var i=this,s=i.hasError,n=i.thrownError,o=i.isStopped;s?e.error(n):o&&e.complete()},t.prototype.asObservable=function(){var e=new Ht;return e.source=this,e},t.create=function(e,i){return new Dt(e,i)},t}(Ht),Dt=function(r){Y(t,r);function t(e,i){var s=r.call(this)||this;return s.destination=e,s.source=i,s}return t.prototype.next=function(e){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,e)},t.prototype.error=function(e){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.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,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(e))!==null&&s!==void 0?s:ce},t}(xt),pe=function(r){Y(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,s=e.thrownError,n=e._value;if(i)throw s;return this._throwIfClosed(),n},t.prototype.next=function(e){r.prototype.next.call(this,this._value=e)},t}(xt),ue=(r=>(r.Loading="loading",r.Ready="ready",r))(ue||{});class $t{constructor(t,e){this.state=new pe("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 bt(r,t){if(r){var e=r.indexOf(t);0<=e&&r.splice(e,1)}}var rt=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,s,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(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 l=this.initialTeardown;if(_(l))try{l()}catch(v){n=v instanceof ot?v.errors:[v]}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{Lt(g)}catch(v){n=n??[],v instanceof ot?n=yt(yt([],vt(n)),vt(v.errors)):n.push(v)}}}catch(v){i={error:v}}finally{try{f&&!f.done&&(s=p.return)&&s.call(p)}finally{if(i)throw i.error}}}if(n)throw new ot(n)}},r.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Lt(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)&&bt(e,t)},r.prototype.remove=function(t){var e=this._finalizers;e&&bt(e,t),t instanceof r&&t._removeParent(this)},r.EMPTY=function(){var t=new r;return t.closed=!0,t}(),r}(),ce=rt.EMPTY;function he(r){return r instanceof rt||r&&"closed"in r&&_(r.remove)&&_(r.add)&&_(r.unsubscribe)}function Lt(r){_(r)?r():r.unsubscribe()}var le={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ke={setTimeout:function(r,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];return setTimeout.apply(void 0,yt([r,t],vt(e)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function Re(r){ke.setTimeout(function(){throw r})}function jt(){}function G(r){r()}var de=function(r){Y(t,r);function t(e){var i=r.call(this)||this;return i.isStopped=!1,e?(i.destination=e,he(e)&&e.add(i)):i.destination=Le,i}return t.create=function(e,i,s){return new wt(e,i,s)},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}(rt),Ne=Function.prototype.bind;function at(r,t){return Ne.call(r,t)}var Me=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}(),wt=function(r){Y(t,r);function t(e,i,s){var n=r.call(this)||this,o;if(_(e)||!e)o={next:e??void 0,error:i??void 0,complete:s??void 0};else{var a;n&&le.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 Me(o),n}return t}(de);function Z(r){Re(r)}function Ue(r){throw r}var Le={closed:!0,next:jt,error:Ue,complete:jt},je=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function He(r){return r}function Be(r){return r.length===0?He:r.length===1?r[0]:function(e){return r.reduce(function(i,s){return s(i)},e)}}var Ht=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 s=this,n=ze(t)?t:new wt(t,e,i);return G(function(){var o=s,a=o.operator,c=o.source;n.add(a?a.call(n,c):c?s._subscribe(n):s._trySubscribe(n))}),n},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=Bt(e),new e(function(s,n){var o=new wt({next:function(a){try{t(a)}catch(c){n(c),o.unsubscribe()}},error:n,complete:s});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[je]=function(){return this},r.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Be(t)(this)},r.prototype.toPromise=function(t){var e=this;return t=Bt(t),new t(function(i,s){var n;e.subscribe(function(o){return n=o},function(o){return s(o)},function(){return i(n)})})},r.create=function(t){return new r(t)},r}();function Bt(r){var t;return(t=r??le.Promise)!==null&&t!==void 0?t:Promise}function De(r){return r&&_(r.next)&&_(r.error)&&_(r.complete)}function ze(r){return r&&r instanceof de||De(r)&&he(r)}var Fe=ae(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),xt=function(r){Y(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 Dt(this,this);return i.operator=e,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new Fe},t.prototype.next=function(e){var i=this;G(function(){var s,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){s={error:h}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}}})},t.prototype.error=function(e){var i=this;G(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=e;for(var s=i.observers;s.length;)s.shift().error(e)}})},t.prototype.complete=function(){var e=this;G(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,s=this,n=s.hasError,o=s.isStopped,a=s.observers;return n||o?ce:(this.currentObservers=null,a.push(e),new rt(function(){i.currentObservers=null,bt(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var i=this,s=i.hasError,n=i.thrownError,o=i.isStopped;s?e.error(n):o&&e.complete()},t.prototype.asObservable=function(){var e=new Ht;return e.source=this,e},t.create=function(e,i){return new Dt(e,i)},t}(Ht),Dt=function(r){Y(t,r);function t(e,i){var s=r.call(this)||this;return s.destination=e,s.source=i,s}return t.prototype.next=function(e){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,e)},t.prototype.error=function(e){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.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,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(e))!==null&&s!==void 0?s:ce},t}(xt),pe=function(r){Y(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,s=e.thrownError,n=e._value;if(i)throw s;return this._throwIfClosed(),n},t.prototype.next=function(e){r.prototype.next.call(this,this._value=e)},t}(xt),ue=(r=>(r.Loading="loading",r.Ready="ready",r))(ue||{});class $t{constructor(t,e){this.state=new pe("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,Ct=G.ShadowRoot&&(G.ShadyCSS===void 0||G.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,St=Symbol(),zt=new WeakMap;let fe=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==St)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(Ct&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=zt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&zt.set(e,t))}return t}toString(){return this.cssText}};const Ve=r=>new fe(typeof r=="string"?r:r+"",void 0,St),U=(r,...t)=>{const e=r.length===1?r[0]:t.reduce((i,s,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.")})(s)+r[n+1],r[0]);return new fe(e,r,St)},We=(r,t)=>{if(Ct)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),s=G.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,r.appendChild(i)}},Ft=Ct?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return Ve(e)})(r):r;/**
7
+ */const J=globalThis,Ct=J.ShadowRoot&&(J.ShadyCSS===void 0||J.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,St=Symbol(),zt=new WeakMap;let fe=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==St)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(Ct&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=zt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&zt.set(e,t))}return t}toString(){return this.cssText}};const Ve=r=>new fe(typeof r=="string"?r:r+"",void 0,St),U=(r,...t)=>{const e=r.length===1?r[0]:t.reduce((i,s,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.")})(s)+r[n+1],r[0]);return new fe(e,r,St)},We=(r,t)=>{if(Ct)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),s=J.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,r.appendChild(i)}},Ft=Ct?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return Ve(e)})(r):r;/**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
- */const{is:Ye,defineProperty:qe,getOwnPropertyDescriptor:Ke,getOwnPropertyNames:Ze,getOwnPropertySymbols:Je,getPrototypeOf:Ge}=Object,C=globalThis,Vt=C.trustedTypes,Xe=Vt?Vt.emptyScript:"",ct=C.reactiveElementPolyfillSupport,H=(r,t)=>r,X={toAttribute(r,t){switch(t){case Boolean:r=r?Xe: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}},Et=(r,t)=>!Ye(r,t),Wt={attribute:!0,type:String,converter:X,reflect:!1,hasChanged:Et};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=Wt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);s!==void 0&&qe(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:n}=Ke(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return s==null?void 0:s.call(this)},set(o){const a=s==null?void 0:s.call(this);n.call(this,o),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Wt}static _$Ei(){if(this.hasOwnProperty(H("elementProperties")))return;const t=Ge(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=[...Ze(e),...Je(e)];for(const s of i)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,s]of e)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const s=this._$Eu(e,i);s!==void 0&&this._$Eh.set(s,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 s of i)e.unshift(Ft(s))}else t!==void 0&&e.push(Ft(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 We(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),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){const o=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:X).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){var n;const i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const o=i.getPropertyOptions(s),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:X;this._$Em=s,this[s]=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??Et)(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 s=this.constructor.elementProperties;if(s.size>0)for(const[n,o]of s)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(s=>{var n;return(n=s.hostUpdate)==null?void 0:n.call(s)}),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.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:Ye,defineProperty:qe,getOwnPropertyDescriptor:Ke,getOwnPropertyNames:Ze,getOwnPropertySymbols:Ge,getPrototypeOf:Je}=Object,C=globalThis,Vt=C.trustedTypes,Xe=Vt?Vt.emptyScript:"",ct=C.reactiveElementPolyfillSupport,H=(r,t)=>r,X={toAttribute(r,t){switch(t){case Boolean:r=r?Xe: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}},Et=(r,t)=>!Ye(r,t),Wt={attribute:!0,type:String,converter:X,reflect:!1,hasChanged:Et};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),C.litPropertyMetadata??(C.litPropertyMetadata=new WeakMap);let k=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=Wt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);s!==void 0&&qe(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:n}=Ke(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return s==null?void 0:s.call(this)},set(o){const a=s==null?void 0:s.call(this);n.call(this,o),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Wt}static _$Ei(){if(this.hasOwnProperty(H("elementProperties")))return;const t=Je(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=[...Ze(e),...Ge(e)];for(const s of i)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,s]of e)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const s=this._$Eu(e,i);s!==void 0&&this._$Eh.set(s,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 s of i)e.unshift(Ft(s))}else t!==void 0&&e.push(Ft(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 We(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),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){const o=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:X).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){var n;const i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const o=i.getPropertyOptions(s),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:X;this._$Em=s,this[s]=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??Et)(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 s=this.constructor.elementProperties;if(s.size>0)for(const[n,o]of s)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(s=>{var n;return(n=s.hostUpdate)==null?void 0:n.call(s)}),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.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){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[H("elementProperties")]=new Map,k[H("finalized")]=new Map,ct==null||ct({ReactiveElement:k}),(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
15
  */const B=globalThis,Q=B.trustedTypes,Yt=Q?Q.createPolicy("lit-html",{createHTML:r=>r}):void 0,ge="$lit$",x=`lit$${Math.random().toFixed(9).slice(2)}$`,me="?"+x,Qe=`<${me}>`,O=document,z=()=>O.createComment(""),F=r=>r===null||typeof r!="object"&&typeof r!="function",Pt=Array.isArray,ti=r=>Pt(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",ht=`[
16
16
  \f\r]`,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,qt=/-->/g,Kt=/>/g,S=RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
17
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Zt=/'/g,Jt=/"/g,ve=/^(?:script|style|textarea|title)$/i,ei=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),R=ei(1),T=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Gt=new WeakMap,P=O.createTreeWalker(O,129);function ye(r,t){if(!Pt(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Yt!==void 0?Yt.createHTML(t):t}const ii=(r,t)=>{const e=r.length-1,i=[];let s,n=t===2?"<svg>":t===3?"<math>":"",o=j;for(let a=0;a<e;a++){const c=r[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=qt:l[1]!==void 0?o=Kt:l[2]!==void 0?(ve.test(l[2])&&(s=RegExp("</"+l[2],"g")),o=S):l[3]!==void 0&&(o=S):o===S?l[0]===">"?(o=s??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]==='"'?Jt:Zt):o===Jt||o===Zt?o=S:o===qt||o===Kt?o=j:(o=S,s=void 0);const f=o===S&&r[a+1].startsWith("/>")?" ":"";n+=o===j?c+Qe:d>=0?(i.push(h),c.slice(0,d)+ge+c.slice(d)+x+f):c+x+(d===-2?a:f)}return[ye(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};let _t=class be{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,o=0;const a=t.length-1,c=this.parts,[h,l]=ii(t,e);if(this.el=be.createElement(h,i),P.currentNode=this.el.content,e===2||e===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=P.nextNode())!==null&&c.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(const d of s.getAttributeNames())if(d.endsWith(ge)){const p=l[o++],f=s.getAttribute(d).split(x),g=/([.?@])?(.*)/.exec(p);c.push({type:1,index:n,name:g[2],strings:f,ctor:g[1]==="."?ri:g[1]==="?"?ni:g[1]==="@"?oi:nt}),s.removeAttribute(d)}else d.startsWith(x)&&(c.push({type:6,index:n}),s.removeAttribute(d));if(ve.test(s.tagName)){const d=s.textContent.split(x),p=d.length-1;if(p>0){s.textContent=Q?Q.emptyScript:"";for(let f=0;f<p;f++)s.append(d[f],z()),P.nextNode(),c.push({type:2,index:++n});s.append(d[p],z())}}}else if(s.nodeType===8)if(s.data===me)c.push({type:2,index:n});else{let d=-1;for(;(d=s.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 M(r,t,e=r,i){var o,a;if(t===T)return t;let s=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const n=F(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==n&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),n===void 0?s=void 0:(s=new n(r),s._$AT(r,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=s:e._$Cl=s),s!==void 0&&(t=M(r,s._$AS(r,t.values),s,i)),t}class si{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,s=((t==null?void 0:t.creationScope)??O).importNode(e,!0);P.currentNode=s;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 ai(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,s}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,s){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.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=M(this,t,e),F(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):ti(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==u&&F(this._$AH)?this._$AA.nextSibling.data=t:this.T(O.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:i}=t,s=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=_t.createElement(ye(i.h,i.h[0]),this.options)),i);if(((n=this._$AH)==null?void 0:n._$AD)===s)this._$AH.p(e);else{const o=new si(s,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=Gt.get(t.strings);return e===void 0&&Gt.set(t.strings,e=new _t(t)),e}k(t){Pt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new q(this.O(z()),this.O(z()),this,this.options)):i=e[s],i._$AI(n),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$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 s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class nt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,n){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,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,s){const n=this.strings;let o=!1;if(n===void 0)t=M(this,t,e,0),o=!F(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=M(this,a[i+c],e,c),h===T&&(h=this._$AH[c]),o||(o=!F(h)||h!==this._$AH[c]),h===u?t=u:t!==u&&(t+=(h??"")+n[c+1]),this._$AH[c]=h}o&&!s&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ri extends nt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}}class ni extends nt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}}class oi extends nt{constructor(t,e,i,s,n){super(t,e,i,s,n),this.type=5}_$AI(t,e=this){if((t=M(this,t,e,0)??u)===T)return;const i=this._$AH,s=t===u&&i!==u||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==u&&(i===u||s);s&&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 ai{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){M(this,t)}}const lt=B.litHtmlPolyfillSupport;lt==null||lt(_t,q),(B.litHtmlVersions??(B.litHtmlVersions=[])).push("3.2.1");const ci=(r,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let s=i._$litPart$;if(s===void 0){const n=(e==null?void 0:e.renderBefore)??null;i._$litPart$=s=new q(t.insertBefore(z(),n),n,void 0,e??{})}return s._$AI(r),s};/**
17
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Zt=/'/g,Gt=/"/g,ve=/^(?:script|style|textarea|title)$/i,ei=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),R=ei(1),I=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Jt=new WeakMap,P=O.createTreeWalker(O,129);function ye(r,t){if(!Pt(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Yt!==void 0?Yt.createHTML(t):t}const ii=(r,t)=>{const e=r.length-1,i=[];let s,n=t===2?"<svg>":t===3?"<math>":"",o=j;for(let a=0;a<e;a++){const c=r[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=qt:l[1]!==void 0?o=Kt:l[2]!==void 0?(ve.test(l[2])&&(s=RegExp("</"+l[2],"g")),o=S):l[3]!==void 0&&(o=S):o===S?l[0]===">"?(o=s??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]==='"'?Gt:Zt):o===Gt||o===Zt?o=S:o===qt||o===Kt?o=j:(o=S,s=void 0);const f=o===S&&r[a+1].startsWith("/>")?" ":"";n+=o===j?c+Qe:d>=0?(i.push(h),c.slice(0,d)+ge+c.slice(d)+x+f):c+x+(d===-2?a:f)}return[ye(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};let _t=class be{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,o=0;const a=t.length-1,c=this.parts,[h,l]=ii(t,e);if(this.el=be.createElement(h,i),P.currentNode=this.el.content,e===2||e===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=P.nextNode())!==null&&c.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(const d of s.getAttributeNames())if(d.endsWith(ge)){const p=l[o++],f=s.getAttribute(d).split(x),g=/([.?@])?(.*)/.exec(p);c.push({type:1,index:n,name:g[2],strings:f,ctor:g[1]==="."?ri:g[1]==="?"?ni:g[1]==="@"?oi:nt}),s.removeAttribute(d)}else d.startsWith(x)&&(c.push({type:6,index:n}),s.removeAttribute(d));if(ve.test(s.tagName)){const d=s.textContent.split(x),p=d.length-1;if(p>0){s.textContent=Q?Q.emptyScript:"";for(let f=0;f<p;f++)s.append(d[f],z()),P.nextNode(),c.push({type:2,index:++n});s.append(d[p],z())}}}else if(s.nodeType===8)if(s.data===me)c.push({type:2,index:n});else{let d=-1;for(;(d=s.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 N(r,t,e=r,i){var o,a;if(t===I)return t;let s=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const n=F(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==n&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),n===void 0?s=void 0:(s=new n(r),s._$AT(r,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=s:e._$Cl=s),s!==void 0&&(t=N(r,s._$AS(r,t.values),s,i)),t}class si{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,s=((t==null?void 0:t.creationScope)??O).importNode(e,!0);P.currentNode=s;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 ai(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,s}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,s){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.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=N(this,t,e),F(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==I&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ti(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==u&&F(this._$AH)?this._$AA.nextSibling.data=t:this.T(O.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:i}=t,s=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=_t.createElement(ye(i.h,i.h[0]),this.options)),i);if(((n=this._$AH)==null?void 0:n._$AD)===s)this._$AH.p(e);else{const o=new si(s,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=Jt.get(t.strings);return e===void 0&&Jt.set(t.strings,e=new _t(t)),e}k(t){Pt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new q(this.O(z()),this.O(z()),this,this.options)):i=e[s],i._$AI(n),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$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 s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class nt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,n){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,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,s){const n=this.strings;let o=!1;if(n===void 0)t=N(this,t,e,0),o=!F(t)||t!==this._$AH&&t!==I,o&&(this._$AH=t);else{const a=t;let c,h;for(t=n[0],c=0;c<n.length-1;c++)h=N(this,a[i+c],e,c),h===I&&(h=this._$AH[c]),o||(o=!F(h)||h!==this._$AH[c]),h===u?t=u:t!==u&&(t+=(h??"")+n[c+1]),this._$AH[c]=h}o&&!s&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ri extends nt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}}class ni extends nt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}}class oi extends nt{constructor(t,e,i,s,n){super(t,e,i,s,n),this.type=5}_$AI(t,e=this){if((t=N(this,t,e,0)??u)===I)return;const i=this._$AH,s=t===u&&i!==u||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==u&&(i===u||s);s&&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 ai{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){N(this,t)}}const lt=B.litHtmlPolyfillSupport;lt==null||lt(_t,q),(B.litHtmlVersions??(B.litHtmlVersions=[])).push("3.2.1");const ci=(r,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let s=i._$litPart$;if(s===void 0){const n=(e==null?void 0:e.renderBefore)??null;i._$litPart$=s=new q(t.insertBefore(z(),n),n,void 0,e??{})}return s._$AI(r),s};/**
18
18
  * @license
19
19
  * Copyright 2017 Google LLC
20
20
  * SPDX-License-Identifier: BSD-3-Clause
21
- */let A=class extends I{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=ci(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 T}};var oe;A._$litElement$=!0,A.finalized=!0,(oe=globalThis.litElementHydrateSupport)==null||oe.call(globalThis,{LitElement:A});const dt=globalThis.litElementPolyfillSupport;dt==null||dt({LitElement:A});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
21
+ */let A=class extends k{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=ci(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 I}};var oe;A._$litElement$=!0,A.finalized=!0,(oe=globalThis.litElementHydrateSupport)==null||oe.call(globalThis,{LitElement:A});const dt=globalThis.litElementPolyfillSupport;dt==null||dt({LitElement:A});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
22
22
  * @license
23
23
  * Copyright 2017 Google LLC
24
24
  * SPDX-License-Identifier: BSD-3-Clause
@@ -26,7 +26,7 @@
26
26
  * @license
27
27
  * Copyright 2017 Google LLC
28
28
  * SPDX-License-Identifier: BSD-3-Clause
29
- */function L(r){return m({...r,state:!0,attribute:!1})}var di=Object.defineProperty,pi=(r,t,e,i)=>{for(var s=void 0,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(t,e,s)||s);return s&&di(t,e,s),s};const It=class It 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}};It.styles=[U`
29
+ */function L(r){return m({...r,state:!0,attribute:!1})}var di=Object.defineProperty,pi=(r,t,e,i)=>{for(var s=void 0,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(t,e,s)||s);return s&&di(t,e,s),s};const kt=class kt 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}};kt.styles=[U`
30
30
  :host {
31
31
  position: fixed;
32
32
  display: flex;
@@ -42,11 +42,11 @@
42
42
  bottom: 20px;
43
43
  left: 20px;
44
44
  }
45
- `];let V=It;pi([m({attribute:!0})],V.prototype,"anchor");/**
45
+ `];let V=kt;pi([m({attribute:!0})],V.prototype,"anchor");/**
46
46
  * @license
47
47
  * Copyright 2017 Google LLC
48
48
  * SPDX-License-Identifier: BSD-3-Clause
49
- */const Ot={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Tt=r=>(...t)=>({_$litDirective$:r,values:t});let we=class{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)}};/**
49
+ */const Ot={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},It=r=>(...t)=>({_$litDirective$:r,values:t});let we=class{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)}};/**
50
50
  * @license
51
51
  * Copyright 2020 Google LLC
52
52
  * SPDX-License-Identifier: BSD-3-Clause
@@ -54,15 +54,15 @@
54
54
  * @license
55
55
  * Copyright 2017 Google LLC
56
56
  * SPDX-License-Identifier: BSD-3-Clause
57
- */const D=(r,t)=>{var i;const e=r._$AN;if(e===void 0)return!1;for(const s of e)(i=s._$AO)==null||i.call(s,t,!1),D(s,t);return!0},tt=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)},$e=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),mi(t)}};function fi(r){this._$AN!==void 0?(tt(this),this._$AM=r,$e(this)):this._$AM=r}function gi(r,t=!1,e=0){const i=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(i))for(let n=e;n<i.length;n++)D(i[n],!1),tt(i[n]);else i!=null&&(D(i,!1),tt(i));else D(this,r)}const mi=r=>{r.type==Ot.CHILD&&(r._$AP??(r._$AP=gi),r._$AQ??(r._$AQ=fi))};class _e extends we{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),$e(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,s;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(s=this.disconnected)==null||s.call(this)),e&&(D(this,t),tt(this))}setValue(t){if(ui(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 vi=new WeakMap;let Xt=0;const pt=new Map,Qt=new WeakSet,te=()=>new Promise(r=>requestAnimationFrame(r)),yi=[{transform:"translateX(100%) scale(0)",opacity:0}],ee=(r,t)=>{const e=r-t;return e===0?void 0:e},ie=(r,t)=>{const e=r/t;return e===1?void 0:e},ut={left:(r,t)=>{const e=ee(r,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateX(${e}px)`}},top:(r,t)=>{const e=ee(r,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateY(${e}px)`}},width:(r,t)=>{let e;t===0&&(t=1,e={width:"1px"});const i=ie(r,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleX(${i})`}},height:(r,t)=>{let e;t===0&&(t=1,e={height:"1px"});const i=ie(r,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleY(${i})`}}},bi={duration:333,easing:"ease-in-out"},wi=["left","top","width","height","opacity","color","background"],se=new WeakMap;class $i extends _e{constructor(t){if(super(t),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,t.type===Ot.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 vi.get(this.u)}isDisabled(){var t;return this.options.disabled||((t=this.getController())==null?void 0:t.disabled)}update(t,[e]){var s;const i=this.u===void 0;return i&&(this.u=(s=t.options)==null?void 0:s.host,this.u.addController(this),this.u.updateComplete.then(n=>this.t=!0),this.element=t.element,se.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=wi),this.options=t}m(){const t={},e=this.element.getBoundingClientRect(),i=getComputedStyle(this.element);return this.options.properties.forEach(s=>{const n=e[s]??(ut[s]?void 0:i[s]),o=Number(n);t[s]=isNaN(o)?n+"":o}),t}v(){let t,e=!0;return this.options.guard&&(t=this.options.guard(),e=((i,s)=>{if(Array.isArray(i)){if(Array.isArray(s)&&s.length===i.length&&i.every((n,o)=>n===s[o]))return!1}else if(s===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 te;const e=this.O(),i=this.j(this.options.keyframeOptions,e),s=this.m();if(this.A!==void 0){const{from:n,to:o}=this.N(this.A,s,e);this.log("measured",[this.A,s,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,s,e);t=this.calculateKeyframes(o,a),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,Xt++,t.forEach(c=>c.zIndex=Xt)}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 te(),(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 s=this.m();this.log("stabilizing out");const n=this.A.left-s.left,o=this.A.top-s.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=se.get(e);i&&!i.isDisabled()&&i&&t.push(i)}return t}get isHostRendered(){const t=Qt.has(this.u);return t||this.u.updateComplete.then(()=>{Qt.add(this.u)}),t}j(t,e=this.O()){const i={...bi};return e.forEach(s=>Object.assign(i,s.options.keyframeOptions)),Object.assign(i,t),i}N(t,e,i){t={...t},e={...e};const s=i.map(a=>a.animatingProperties).filter(a=>a!==void 0);let n=1,o=1;return s.length>0&&(s.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 s={},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,s.transform=`${s.transform??""} ${p.transform}`,p.overrideFrom!==void 0&&Object.assign(s,p.overrideFrom))}else h!==l&&h!==void 0&&l!==void 0&&(o=!0,s[c]=h,n[c]=l)}return s.transformOrigin=n.transformOrigin=i?"center center":"top left",this.animatingProperties=a,o?[s,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 s=this.getController();s==null||s.add(this);try{await this.webAnimation.finished}catch{}s==null||s.remove(this)}return this.didFinish(i),i}isAnimating(){var 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 _i=Tt($i),Ai={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=(r,t)=>{var i;const e=r._$AN;if(e===void 0)return!1;for(const s of e)(i=s._$AO)==null||i.call(s,t,!1),D(s,t);return!0},tt=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)},$e=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),mi(t)}};function fi(r){this._$AN!==void 0?(tt(this),this._$AM=r,$e(this)):this._$AM=r}function gi(r,t=!1,e=0){const i=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(i))for(let n=e;n<i.length;n++)D(i[n],!1),tt(i[n]);else i!=null&&(D(i,!1),tt(i));else D(this,r)}const mi=r=>{r.type==Ot.CHILD&&(r._$AP??(r._$AP=gi),r._$AQ??(r._$AQ=fi))};class _e extends we{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),$e(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,s;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(s=this.disconnected)==null||s.call(this)),e&&(D(this,t),tt(this))}setValue(t){if(ui(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 vi=new WeakMap;let Xt=0;const pt=new Map,Qt=new WeakSet,te=()=>new Promise(r=>requestAnimationFrame(r)),yi=[{transform:"translateX(100%) scale(0)",opacity:0}],ee=(r,t)=>{const e=r-t;return e===0?void 0:e},ie=(r,t)=>{const e=r/t;return e===1?void 0:e},ut={left:(r,t)=>{const e=ee(r,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateX(${e}px)`}},top:(r,t)=>{const e=ee(r,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateY(${e}px)`}},width:(r,t)=>{let e;t===0&&(t=1,e={width:"1px"});const i=ie(r,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleX(${i})`}},height:(r,t)=>{let e;t===0&&(t=1,e={height:"1px"});const i=ie(r,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleY(${i})`}}},bi={duration:333,easing:"ease-in-out"},wi=["left","top","width","height","opacity","color","background"],se=new WeakMap;class $i extends _e{constructor(t){if(super(t),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,t.type===Ot.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 vi.get(this.u)}isDisabled(){var t;return this.options.disabled||((t=this.getController())==null?void 0:t.disabled)}update(t,[e]){var s;const i=this.u===void 0;return i&&(this.u=(s=t.options)==null?void 0:s.host,this.u.addController(this),this.u.updateComplete.then(n=>this.t=!0),this.element=t.element,se.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=wi),this.options=t}m(){const t={},e=this.element.getBoundingClientRect(),i=getComputedStyle(this.element);return this.options.properties.forEach(s=>{const n=e[s]??(ut[s]?void 0:i[s]),o=Number(n);t[s]=isNaN(o)?n+"":o}),t}v(){let t,e=!0;return this.options.guard&&(t=this.options.guard(),e=((i,s)=>{if(Array.isArray(i)){if(Array.isArray(s)&&s.length===i.length&&i.every((n,o)=>n===s[o]))return!1}else if(s===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 te;const e=this.O(),i=this.j(this.options.keyframeOptions,e),s=this.m();if(this.A!==void 0){const{from:n,to:o}=this.N(this.A,s,e);this.log("measured",[this.A,s,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,s,e);t=this.calculateKeyframes(o,a),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,Xt++,t.forEach(c=>c.zIndex=Xt)}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 te(),(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 s=this.m();this.log("stabilizing out");const n=this.A.left-s.left,o=this.A.top-s.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=se.get(e);i&&!i.isDisabled()&&i&&t.push(i)}return t}get isHostRendered(){const t=Qt.has(this.u);return t||this.u.updateComplete.then(()=>{Qt.add(this.u)}),t}j(t,e=this.O()){const i={...bi};return e.forEach(s=>Object.assign(i,s.options.keyframeOptions)),Object.assign(i,t),i}N(t,e,i){t={...t},e={...e};const s=i.map(a=>a.animatingProperties).filter(a=>a!==void 0);let n=1,o=1;return s.length>0&&(s.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 s={},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,s.transform=`${s.transform??""} ${p.transform}`,p.overrideFrom!==void 0&&Object.assign(s,p.overrideFrom))}else h!==l&&h!==void 0&&l!==void 0&&(o=!0,s[c]=h,n[c]=l)}return s.transformOrigin=n.transformOrigin=i?"center center":"top left",this.animatingProperties=a,o?[s,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 s=this.getController();s==null||s.add(this);try{await this.webAnimation.finished}catch{}s==null||s.remove(this)}return this.didFinish(i),i}isAnimating(){var 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 _i=It($i),Ai={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
61
- */const re=Tt(class extends we{constructor(r){var t;if(super(r),r.type!==Ot.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,s;if(this.st===void 0){this.st=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in t)t[n]&&!((i=this.nt)!=null&&i.has(n))&&this.st.add(n);return this.render(t)}const e=r.element.classList;for(const n of this.st)n in t||(e.remove(n),this.st.delete(n));for(const n in t){const o=!!t[n];o===this.st.has(n)||(s=this.nt)!=null&&s.has(n)||(o?(e.add(n),this.st.add(n)):(e.remove(n),this.st.delete(n)))}return T}}),w=(r,t,e)=>{r&&e.style.setProperty(t,r)},Ae=(r,t)=>{var e,i,s,n,o,a,c,h,l;w((e=r.colors)==null?void 0:e.primaryBackground,"--primary-background",t),w((i=r.colors)==null?void 0:i.textOnPrimaryBackground,"--text-on-primary-background",t),w((s=r.colors)==null?void 0:s.secondaryBackground,"--secondary-background",t),w((n=r.colors)==null?void 0:n.textOnSecondaryBackground,"--text-on-secondary-background",t),w((o=r.colors)==null?void 0:o.interactiveDestructiveBackground,"--destructive-color",t),w((a=r.colors)==null?void 0:a.interactiveTextOnDestructiveBackground,"--text-on-destructive-color",t),w((c=r.colors)==null?void 0:c.interactivePrimaryBackground,"--interactive-primary-background",t),w((h=r.colors)==null?void 0:h.interactiveTextOnPrimaryBackground,"--interactive-text-on-primary-background",t),w((l=r.colors)==null?void 0:l.focusColor,"--focus-color",t)};/**
61
+ */const re=It(class extends we{constructor(r){var t;if(super(r),r.type!==Ot.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,s;if(this.st===void 0){this.st=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in t)t[n]&&!((i=this.nt)!=null&&i.has(n))&&this.st.add(n);return this.render(t)}const e=r.element.classList;for(const n of this.st)n in t||(e.remove(n),this.st.delete(n));for(const n in t){const o=!!t[n];o===this.st.has(n)||(s=this.nt)!=null&&s.has(n)||(o?(e.add(n),this.st.add(n)):(e.remove(n),this.st.delete(n)))}return I}}),w=(r,t,e)=>{r&&e.style.setProperty(t,r)},Ae=(r,t)=>{var e,i,s,n,o,a,c,h,l;w((e=r.colors)==null?void 0:e.primaryBackground,"--primary-background",t),w((i=r.colors)==null?void 0:i.textOnPrimaryBackground,"--text-on-primary-background",t),w((s=r.colors)==null?void 0:s.secondaryBackground,"--secondary-background",t),w((n=r.colors)==null?void 0:n.textOnSecondaryBackground,"--text-on-secondary-background",t),w((o=r.colors)==null?void 0:o.interactiveDestructiveBackground,"--destructive-color",t),w((a=r.colors)==null?void 0:a.interactiveTextOnDestructiveBackground,"--text-on-destructive-color",t),w((c=r.colors)==null?void 0:c.interactivePrimaryBackground,"--interactive-primary-background",t),w((h=r.colors)==null?void 0:h.interactiveTextOnPrimaryBackground,"--interactive-text-on-primary-background",t),w((l=r.colors)==null?void 0:l.focusColor,"--focus-color",t)};/**
62
62
  * @license
63
63
  * Copyright 2020 Google LLC
64
64
  * SPDX-License-Identifier: BSD-3-Clause
65
- */const xe=()=>new xi;class xi{}const ft=new WeakMap,Ce=Tt(class extends _e{render(r){return u}update(r,[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=r.options)==null?void 0:i.host,this.rt(this.ct=r.element)),u}rt(r){if(this.isConnected||(r=void 0),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,r),r!==void 0&&this.Y.call(this.ht,r)}else this.Y.value=r}get lt(){var r,t;return typeof this.Y=="function"?(r=ft.get(this.ht??globalThis))==null?void 0:r.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 Ci=Object.defineProperty,K=(r,t,e,i)=>{for(var s=void 0,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(t,e,s)||s);return s&&Ci(t,e,s),s};const Rt=class Rt extends A{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=xe(),this.widgetActive$=new pe(!1),this.componentIsDestroyed$=new xt}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.notify("widget-set-active",{widgetId:this.application.id,active:!0}),this.widgetActive$.next(!0),this.hideTrigger()):(this.application.hide(),this.notify("widget-set-active",{widgetId:this.application.id,active:!1}),this.widgetActive$.next(!1),this.showTrigger())}notify(t,e={}){window!=null&&window.parent&&window.parent.postMessage({type:t,data:e},"*")}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&Ae(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 s=async l=>Ai,{type:n,content:o}=i;switch(n){case"Telia":{const l=await s();return l?R`<telia-icon
65
+ */const xe=()=>new xi;class xi{}const ft=new WeakMap,Ce=It(class extends _e{render(r){return u}update(r,[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=r.options)==null?void 0:i.host,this.rt(this.ct=r.element)),u}rt(r){if(this.isConnected||(r=void 0),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,r),r!==void 0&&this.Y.call(this.ht,r)}else this.Y.value=r}get lt(){var r,t;return typeof this.Y=="function"?(r=ft.get(this.ht??globalThis))==null?void 0:r.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 Ci=Object.defineProperty,K=(r,t,e,i)=>{for(var s=void 0,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(t,e,s)||s);return s&&Ci(t,e,s),s};const Rt=class Rt extends A{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=xe(),this.widgetActive$=new pe(!1),this.componentIsDestroyed$=new xt}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.notify("widget-set-active",{widgetId:this.application.id,active:!0}),this.widgetActive$.next(!0),this.hideTrigger()):(this.application.hide(),this.notify("widget-set-active",{widgetId:this.application.id,active:!1}),this.widgetActive$.next(!1),this.showTrigger())}notify(t,e={}){window!=null&&window.parent&&window.parent.postMessage({type:t,data:e},"*")}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&Ae(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 s=async l=>Ai,{type:n,content:o}=i;switch(n){case"Telia":{const l=await s();return l?R`<telia-icon
66
66
  class="trigger-icon"
67
67
  svg=${l.svg}
68
68
  size="lg"
@@ -256,11 +256,11 @@
256
256
  * {
257
257
  box-sizing: border-box;
258
258
  }
259
- `];let t=e;return E([m()],t.prototype,"properties"),E([m()],t.prototype,"context"),E([m()],t.prototype,"layout"),E([m()],t.prototype,"name"),E([m()],t.prototype,"type"),E([m({attribute:!1})],t.prototype,"application"),E([m({attribute:!1})],t.prototype,"parent"),t},Mt=class Mt extends Se(A){render(){return R`Non resolved component`}};Mt.styles=[U`
259
+ `];let t=e;return E([m()],t.prototype,"properties"),E([m()],t.prototype,"context"),E([m()],t.prototype,"layout"),E([m()],t.prototype,"name"),E([m()],t.prototype,"type"),E([m({attribute:!1})],t.prototype,"application"),E([m({attribute:!1})],t.prototype,"parent"),t},Nt=class Nt extends Se(A){render(){return R`Non resolved component`}};Nt.styles=[U`
260
260
  :host {
261
261
  display: block;
262
262
  }
263
- `];let et=Mt;/**
263
+ `];let et=Nt;/**
264
264
  * @license
265
265
  * Copyright 2021 Google LLC
266
266
  * SPDX-License-Identifier: BSD-3-Clause
@@ -280,13 +280,13 @@
280
280
  * @license
281
281
  * Copyright 2021 Google LLC
282
282
  * SPDX-License-Identifier: BSD-3-Clause
283
- */let Ti=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}};class ne extends Oi{constructor(t,e,i){var s,n;super(e.context!==void 0?e.initialValue:i),this.onContextRequest=o=>{const a=o.composedPath()[0];o.context===this.context&&a!==this.host&&(o.stopPropagation(),this.addCallback(o.callback,a,o.subscribe))},this.onProviderRequest=o=>{const a=o.composedPath()[0];if(o.context!==this.context||a===this.host)return;const c=new Set;for(const[h,{consumerHost:l}]of this.subscriptions)c.has(h)||(c.add(h),l.dispatchEvent(new Pi(this.context,h,!0)));o.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(n=(s=this.host).addController)==null||n.call(s,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Ti(this.context))}}/**
283
+ */let Ii=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}};class ne extends Oi{constructor(t,e,i){var s,n;super(e.context!==void 0?e.initialValue:i),this.onContextRequest=o=>{const a=o.composedPath()[0];o.context===this.context&&a!==this.host&&(o.stopPropagation(),this.addCallback(o.callback,a,o.subscribe))},this.onProviderRequest=o=>{const a=o.composedPath()[0];if(o.context!==this.context||a===this.host)return;const c=new Set;for(const[h,{consumerHost:l}]of this.subscriptions)c.has(h)||(c.add(h),l.dispatchEvent(new Pi(this.context,h,!0)));o.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(n=(s=this.host).addController)==null||n.call(s,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Ii(this.context))}}/**
284
284
  * @license
285
285
  * Copyright 2017 Google LLC
286
286
  * SPDX-License-Identifier: BSD-3-Clause
287
- */function ki({context:r}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){i.set(this,new ne(this,{context:r}))}),{get(){return t.get.call(this)},set(s){var n;return(n=i.get(this))==null||n.setValue(s),t.set.call(this,s)},init(s){var n;return(n=i.get(this))==null||n.setValue(s),s}};{t.constructor.addInitializer(o=>{i.set(o,new ne(o,{context:r}))});const s=Object.getOwnPropertyDescriptor(t,e);let n;if(s===void 0){const o=new WeakMap;n={get(){return o.get(this)},set(a){i.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=s.set;n={...s,set(a){i.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(t,e,n)}}}var Ii=Object.defineProperty,Ri=(r,t,e,i)=>{for(var s=void 0,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(t,e,s)||s);return s&&Ii(t,e,s),s};const Ee="application",Nt=class Nt extends A{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=xe()}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(!this.wrapperRef.value)return;const t=this.application.settings;t!=null&&t.branding&&Ae(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,s])=>{e.style.setProperty(`--${i}`,s)})}firstUpdated(t){this.applyBranding(),this.applyStyles()}render(){var i,s;const t=this.application.settings.components.conversation;return((s=(i=t==null?void 0:t.properties)==null?void 0:i.chat)==null?void 0:s.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")),window.self!==window.top&&this.renderRoot.host.classList.add("embedded"),R`<div class="widget-container" ${Ce(this.wrapperRef)}>
287
+ */function Ti({context:r}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){i.set(this,new ne(this,{context:r}))}),{get(){return t.get.call(this)},set(s){var n;return(n=i.get(this))==null||n.setValue(s),t.set.call(this,s)},init(s){var n;return(n=i.get(this))==null||n.setValue(s),s}};{t.constructor.addInitializer(o=>{i.set(o,new ne(o,{context:r}))});const s=Object.getOwnPropertyDescriptor(t,e);let n;if(s===void 0){const o=new WeakMap;n={get(){return o.get(this)},set(a){i.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=s.set;n={...s,set(a){i.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(t,e,n)}}}var ki=Object.defineProperty,Ri=(r,t,e,i)=>{for(var s=void 0,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(t,e,s)||s);return s&&ki(t,e,s),s};const Ee="application",Mt=class Mt extends A{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=xe()}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(!this.wrapperRef.value)return;const t=this.application.settings;t!=null&&t.branding&&Ae(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,s])=>{e.style.setProperty(`--${i}`,s)})}firstUpdated(t){this.applyBranding(),this.applyStyles()}render(){var i,s;const t=this.application.settings.components.conversation;return((s=(i=t==null?void 0:t.properties)==null?void 0:i.chat)==null?void 0:s.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")),window.self!==window.top&&this.renderRoot.host.classList.add("embedded"),R`<div class="widget-container" ${Ce(this.wrapperRef)}>
288
288
  ${Ei(this.nodes,n=>n)}
289
- </div>`}};Nt.styles=U`
289
+ </div>`}};Mt.styles=U`
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
- `;let W=Nt;Ri([m({attribute:!1}),ki({context:Ee})],W.prototype,"application");class Mi{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:[]}},s=(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&&s(a,g,f.children,l))})},{entry:n,components:o}=t;return s(this,this.root,[n],o),this.root}createRoot(){return typeof window<"u"&&(window.customElements.get("ace-wrapper")||window.customElements.define("ace-wrapper",W)),document.createElement("ace-wrapper")}createNode(t,e){if(!this.resolveComponent(e))return console.warn(`Unable to resolve component: ${e}`),new et;const s=document.createElement(`ace-${e}`);return s.type=e,s.name=t,s}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const it=class it{constructor(){this.components=new Map}getComponent(t){const e=this.components.get(t);return e||console.warn(`Unable to resolve component: ${t}. You most likely forgot to register the required plugin.`),e}registerComponent(t,e){this.components.set(t,e)}async loadComponents(){const t=[...this.components.entries()].map(([e,i])=>i.then(s=>{this.defineAsWebComponent(e,s.default)}));await Promise.all(t)}defineAsWebComponent(t,e){const i=it.ResolveWebComponentName(t);customElements.get(i)||customElements.define(i,e)}};it.ResolveWebComponentName=t=>`ace-${t}`;let At=it;var y=(r=>(r.Necessary="necessary",r.Functional="functional",r.Analytics="analytics",r))(y||{});class Pe{constructor(t,e,i,s){this.disallowedKeys=[],this.widgetId=t,this.storage=e==="localStorage"?window.localStorage:window.sessionStorage,this.policy=i,this.storageEntries=s}set(t,e){if(this.disallowedKeys.includes(t))return;const i=this.storageEntries[t];if(!i){console.warn(`Storage key '${t}' is not defined.`);return}const s=i.category;if(this.policy[s]){const n={value:e,category:s};this.storage.setItem(this._prefixKey(t),JSON.stringify(n))}else console.warn(`Storage policy does not allow storing items in category: ${s}`)}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 s=(t=JSON.parse(i))==null?void 0:t.category;this.policy[s]||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 Ni{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 Ui{constructor(t){this.widget=t,this.name=t.name}open(){this.widget.appendToDOM()}close(){this.widget.hide()}setZIndex(t){this.widget.setZIndex(t)}}class Oe{constructor(t,e,i,s,n){this.id=t,this.name=e,this.container=i,this.settings=s,this.options=n,this.platform=new Mi,this.texts=new Ni,this.renderStrategy=$.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new At,this.components=[],this.trigger=null,this.api=new Ui(this),this.onMessageReceived=async a=>{var h;const c=a.data;switch(c.type){case"set-storage-policies":{const{policies:l}=c.data||[],d={[y.Analytics]:l.includes("analytics"),[y.Necessary]:l.includes("necessary"),[y.Functional]:l.includes("functional")};this.storage.updatePolicy(d);return}case"disallow-storage-key":{const{storageKey:l}=c.data||null;l&&this.storage.disallowKey(l);return}case"open":{this.appendToDOM();return}case"close":{this.hide();return}case"set-z-index":{const{zIndex:l}=c.data||null;l&&this.setZIndex(l);return}case"deactivate-widget":{const l=this.storage.get("open");this.hide(),(h=this.trigger)==null||h.hideTrigger(),l&&this.storage.set("open",!0);return}default:return}},this.renderStrategy=this.options.renderStrategy||$.Inline,this.triggerIcon=this.options.triggerIcon;const o={[y.Necessary]:!0,[y.Functional]:!0,[y.Analytics]:!0};this.storage=new Pe(this.id,"sessionStorage",o,this.settings.storage),typeof n.autoActivate=="boolean"&&(this.autoActivate=n.autoActivate),n.anchor&&(this.anchor=n.anchor),this.container.register("$settings",s),this.texts.loadTexts(s.texts||{}),window.addEventListener("message",this.onMessageReceived)}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(ue.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}window!=null&&window.parent&&window.parent.postMessage({type:"widget-activated",data:{widgetId:this.id}},"*")}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)}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded")),this.storage.set("open",!1)}setZIndex(t){this.root&&(this.root.style.zIndex=t.toString())}mute(){this.storage.set("muteAudioNotifications",!0)}unmute(){this.storage.set("muteAudioNotifications",!1)}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 V,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}_isEmbeddedInIFrame(){return window.self!==window.top}render(){if(this._isEmbeddedInIFrame())return this.root;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 Li=r=>new N(r),st=class st{constructor(t=st.endpoint){this._endpoint=t}async getSite(t){const i=await(await fetch(t)).json();return i?{id:i.id,triggers:i.triggers||[],apps:(i.widgets||[]).map(s=>{let n=$.Trigger;s.renderStrategy.toLowerCase()==="inline"&&(n=$.Inline);const o=s.widgetId?s.widgetId:s.id,a=typeof s.autoActivate=="boolean"?s.autoActivate:!1,c=typeof s.anchor=="string"?s.anchor:"BottomRight",h=typeof s.triggerIcon=="string"?s.triggerIcon:"question";return{id:o,widgetId:o,renderStrategy:n,autoActivate:a,anchor:c,triggerIcon:{type:"Telia",content:h}}})}:null}async getWidget(t){const i=await(await fetch(`${this._endpoint}/widget/${t}`)).json();return i?{name:i.name,config:JSON.parse(i.configuration)}:null}};st.endpoint="https://widgets.ace.teliacompany.net/api";let N=st;class ji{constructor(t){this.site=t}storagePolicy(t){var i;(((i=this.site.environment)==null?void 0:i.applications)||[]).forEach(s=>{if(s.storage){const n={[y.Analytics]:t.includes("analytics"),[y.Necessary]:t.includes("necessary"),[y.Functional]:t.includes("functional")};s.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 Te{constructor(){this.applications=[],this.container=new $t("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 s=window.location.pathname,n=i.condition.outputs||[];i.condition.type==="url"&&n.forEach(o=>{const a=o.action.type==="render_widget";if((o.value===s||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(s=>s.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(s=>s.name===t);if(!i){const s=this.widgetAPIHandlers.get(t)||[];s.push(()=>{const n=this.applications.find(o=>o.name===t);e(n==null?void 0:n.api)}),this.widgetAPIHandlers.set(t,s);return}e(i==null?void 0:i.api)}registerApp(t,e,i,s){const n=new $t(e,this),o=new Oe(t,e,n,i,s);this.applications.push(o)}registerSite(t){this.site=t}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class ke{constructor(t){this.configurations=[],this.httpClient=new N,this.api=new ji(this),this.triggers=[],this.httpClient=new N,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 Te,this.addGlobal(this.environment);for await(const i of this.configurations){const s=await this.httpClient.getWidget(i.widgetId);s&&((e=this.environment)==null||e.registerApp(i.widgetId,s.name,s.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,s])=>{t.widget(i,s)}),((e==null?void 0:e._c)||[]).forEach(i=>{t.configure(i)}),globalThis.ace=t}}var Hi=Object.defineProperty,kt=(r,t,e,i)=>{for(var s=void 0,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(t,e,s)||s);return s&&Hi(t,e,s),s};const Ut=class Ut 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()}};Ut.styles=[U`
424
+ `;let W=Mt;Ri([m({attribute:!1}),Ti({context:Ee})],W.prototype,"application");class Ni{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:[]}},s=(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&&s(a,g,f.children,l))})},{entry:n,components:o}=t;return s(this,this.root,[n],o),this.root}createRoot(){return typeof window<"u"&&(window.customElements.get("ace-wrapper")||window.customElements.define("ace-wrapper",W)),document.createElement("ace-wrapper")}createNode(t,e){if(!this.resolveComponent(e))return console.warn(`Unable to resolve component: ${e}`),new et;const s=document.createElement(`ace-${e}`);return s.type=e,s.name=t,s}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const it=class it{constructor(){this.components=new Map}getComponent(t){const e=this.components.get(t);return e||console.warn(`Unable to resolve component: ${t}. You most likely forgot to register the required plugin.`),e}registerComponent(t,e){this.components.set(t,e)}async loadComponents(){const t=[...this.components.entries()].map(([e,i])=>i.then(s=>{this.defineAsWebComponent(e,s.default)}));await Promise.all(t)}defineAsWebComponent(t,e){const i=it.ResolveWebComponentName(t);customElements.get(i)||customElements.define(i,e)}};it.ResolveWebComponentName=t=>`ace-${t}`;let At=it;var y=(r=>(r.Necessary="necessary",r.Functional="functional",r.Analytics="analytics",r))(y||{});class Pe{constructor(t,e,i,s){this.disallowedKeys=[],this.widgetId=t,this.storage=e==="localStorage"?window.localStorage:window.sessionStorage,this.policy=i,this.storageEntries=s}set(t,e){if(this.disallowedKeys.includes(t))return;const i=this.storageEntries[t];if(!i){console.warn(`Storage key '${t}' is not defined.`);return}const s=i.category;if(this.policy[s]){const n={value:e,category:s};this.storage.setItem(this._prefixKey(t),JSON.stringify(n))}else console.warn(`Storage policy does not allow storing items in category: ${s}`)}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 s=(t=JSON.parse(i))==null?void 0:t.category;this.policy[s]||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 Mi{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}}const Ui="1.1.82-rc.4";class Li{constructor(t){this.widget=t,this.name=t.name}open(){this.widget.appendToDOM()}close(){this.widget.hide()}setZIndex(t){this.widget.setZIndex(t)}version(){return{version:Ui}}}class Oe{constructor(t,e,i,s,n){this.id=t,this.name=e,this.container=i,this.settings=s,this.options=n,this.platform=new Ni,this.texts=new Mi,this.renderStrategy=$.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new At,this.components=[],this.trigger=null,this.api=new Li(this),this.onMessageReceived=async a=>{var h;const c=a.data;switch(c.type){case"set-storage-policies":{const{policies:l}=c.data||[],d={[y.Analytics]:l.includes("analytics"),[y.Necessary]:l.includes("necessary"),[y.Functional]:l.includes("functional")};this.storage.updatePolicy(d);return}case"disallow-storage-key":{const{storageKey:l}=c.data||null;l&&this.storage.disallowKey(l);return}case"open":{this.appendToDOM();return}case"close":{this.hide();return}case"set-z-index":{const{zIndex:l}=c.data||null;l&&this.setZIndex(l);return}case"deactivate-widget":{const l=this.storage.get("open");this.hide(),(h=this.trigger)==null||h.hideTrigger(),l&&this.storage.set("open",!0);return}default:return}},this.renderStrategy=this.options.renderStrategy||$.Inline,this.triggerIcon=this.options.triggerIcon;const o={[y.Necessary]:!0,[y.Functional]:!0,[y.Analytics]:!0};this.storage=new Pe(this.id,"sessionStorage",o,this.settings.storage),typeof n.autoActivate=="boolean"&&(this.autoActivate=n.autoActivate),n.anchor&&(this.anchor=n.anchor),this.container.register("$settings",s),this.texts.loadTexts(s.texts||{}),window.addEventListener("message",this.onMessageReceived)}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(ue.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}if(window!=null&&window.parent){const{version:t}=this.api.version();window.parent.postMessage({type:"widget-activated",data:{widgetId:this.id,version: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)}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded")),this.storage.set("open",!1)}setZIndex(t){this.root&&(this.root.style.zIndex=t.toString())}mute(){this.storage.set("muteAudioNotifications",!0)}unmute(){this.storage.set("muteAudioNotifications",!1)}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 V,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}_isEmbeddedInIFrame(){return window.self!==window.top}render(){if(this._isEmbeddedInIFrame())return this.root;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 ji=r=>new M(r),st=class st{constructor(t=st.endpoint){this._endpoint=t}async getSite(t){const i=await(await fetch(t)).json();return i?{id:i.id,triggers:i.triggers||[],apps:(i.widgets||[]).map(s=>{let n=$.Trigger;s.renderStrategy.toLowerCase()==="inline"&&(n=$.Inline);const o=s.widgetId?s.widgetId:s.id,a=typeof s.autoActivate=="boolean"?s.autoActivate:!1,c=typeof s.anchor=="string"?s.anchor:"BottomRight",h=typeof s.triggerIcon=="string"?s.triggerIcon:"question";return{id:o,widgetId:o,renderStrategy:n,autoActivate:a,anchor:c,triggerIcon:{type:"Telia",content:h}}})}:null}async getWidget(t){const i=await(await fetch(`${this._endpoint}/widget/${t}`)).json();return i?{name:i.name,config:JSON.parse(i.configuration)}:null}};st.endpoint="https://widgets.ace.teliacompany.net/api";let M=st;class Hi{constructor(t){this.site=t}storagePolicy(t){var i;(((i=this.site.environment)==null?void 0:i.applications)||[]).forEach(s=>{if(s.storage){const n={[y.Analytics]:t.includes("analytics"),[y.Necessary]:t.includes("necessary"),[y.Functional]:t.includes("functional")};s.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 Ie{constructor(){this.applications=[],this.container=new $t("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 s=window.location.pathname,n=i.condition.outputs||[];i.condition.type==="url"&&n.forEach(o=>{const a=o.action.type==="render_widget";if((o.value===s||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(s=>s.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(s=>s.name===t);if(!i){const s=this.widgetAPIHandlers.get(t)||[];s.push(()=>{const n=this.applications.find(o=>o.name===t);e(n==null?void 0:n.api)}),this.widgetAPIHandlers.set(t,s);return}e(i==null?void 0:i.api)}registerApp(t,e,i,s){const n=new $t(e,this),o=new Oe(t,e,n,i,s);this.applications.push(o)}registerSite(t){this.site=t}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class Te{constructor(t){this.configurations=[],this.httpClient=new M,this.api=new Hi(this),this.triggers=[],this.httpClient=new M,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 Ie,this.addGlobal(this.environment);for await(const i of this.configurations){const s=await this.httpClient.getWidget(i.widgetId);s&&((e=this.environment)==null||e.registerApp(i.widgetId,s.name,s.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,s])=>{t.widget(i,s)}),((e==null?void 0:e._c)||[]).forEach(i=>{t.configure(i)}),globalThis.ace=t}}var Bi=Object.defineProperty,Tt=(r,t,e,i)=>{for(var s=void 0,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(t,e,s)||s);return s&&Bi(t,e,s),s};const Ut=class Ut 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()}};Ut.styles=[U`
425
425
  :host {
426
426
  display: block;
427
427
  }
428
- `];let k=Ut;kt([m({attribute:!0})],k.prototype,"name");kt([L()],k.prototype,"widget");kt([L()],k.prototype,"status");customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",V);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",W);customElements.get("ace-widget")||customElements.define("ace-widget",k);const Bi=async(r,t,e={})=>{const i=new ke(r);e.httpClient&&i.setHttpClient(e.httpClient),await i.bootstrap(t)};exports.AceWidget=k;exports.Application=Oe;exports.Container=$t;exports.Environment=Te;exports.HttpClient=N;exports.Site=ke;exports.StorageCategory=y;exports.StorageService=Pe;exports.Trigger=b;exports.WidgetComponent=Se;exports.applicationContext=Ee;exports.bootstrap=Bi;exports.createHttpClient=Li;
428
+ `];let T=Ut;Tt([m({attribute:!0})],T.prototype,"name");Tt([L()],T.prototype,"widget");Tt([L()],T.prototype,"status");customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",V);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",W);customElements.get("ace-widget")||customElements.define("ace-widget",T);const Di=async(r,t,e={})=>{const i=new Te(r);e.httpClient&&i.setHttpClient(e.httpClient),await i.bootstrap(t)};exports.AceWidget=T;exports.Application=Oe;exports.Container=$t;exports.Environment=Ie;exports.HttpClient=M;exports.Site=Te;exports.StorageCategory=y;exports.StorageService=Pe;exports.Trigger=b;exports.WidgetComponent=Se;exports.applicationContext=Ee;exports.bootstrap=Di;exports.createHttpClient=ji;
package/index.mjs CHANGED
@@ -189,14 +189,14 @@ function Ee(r) {
189
189
  }
190
190
  function Lt() {
191
191
  }
192
- function J(r) {
192
+ function G(r) {
193
193
  r();
194
194
  }
195
195
  var de = function(r) {
196
196
  Y(t, r);
197
197
  function t(e) {
198
198
  var i = r.call(this) || this;
199
- return i.isStopped = !1, e ? (i.destination = e, he(e) && e.add(i)) : i.destination = Ie, i;
199
+ return i.isStopped = !1, e ? (i.destination = e, he(e) && e.add(i)) : i.destination = Te, i;
200
200
  }
201
201
  return t.create = function(e, i, s) {
202
202
  return new wt(e, i, s);
@@ -285,21 +285,21 @@ var Oe = function() {
285
285
  function Z(r) {
286
286
  Ee(r);
287
287
  }
288
- function ke(r) {
288
+ function Ie(r) {
289
289
  throw r;
290
290
  }
291
- var Ie = {
291
+ var Te = {
292
292
  closed: !0,
293
293
  next: Lt,
294
- error: ke,
294
+ error: Ie,
295
295
  complete: Lt
296
- }, Te = function() {
296
+ }, ke = function() {
297
297
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
298
298
  }();
299
299
  function Re(r) {
300
300
  return r;
301
301
  }
302
- function Me(r) {
302
+ function Ne(r) {
303
303
  return r.length === 0 ? Re : r.length === 1 ? r[0] : function(e) {
304
304
  return r.reduce(function(i, s) {
305
305
  return s(i);
@@ -315,7 +315,7 @@ var jt = function() {
315
315
  return e.source = this, e.operator = t, e;
316
316
  }, r.prototype.subscribe = function(t, e, i) {
317
317
  var s = this, n = Ue(t) ? t : new wt(t, e, i);
318
- return J(function() {
318
+ return G(function() {
319
319
  var o = s, a = o.operator, c = o.source;
320
320
  n.add(a ? a.call(n, c) : c ? s._subscribe(n) : s._trySubscribe(n));
321
321
  }), n;
@@ -344,12 +344,12 @@ var jt = function() {
344
344
  }, r.prototype._subscribe = function(t) {
345
345
  var e;
346
346
  return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
347
- }, r.prototype[Te] = function() {
347
+ }, r.prototype[ke] = function() {
348
348
  return this;
349
349
  }, r.prototype.pipe = function() {
350
350
  for (var t = [], e = 0; e < arguments.length; e++)
351
351
  t[e] = arguments[e];
352
- return Me(t)(this);
352
+ return Ne(t)(this);
353
353
  }, r.prototype.toPromise = function(t) {
354
354
  var e = this;
355
355
  return t = Ht(t), new t(function(i, s) {
@@ -370,11 +370,11 @@ function Ht(r) {
370
370
  var t;
371
371
  return (t = r ?? le.Promise) !== null && t !== void 0 ? t : Promise;
372
372
  }
373
- function Ne(r) {
373
+ function Me(r) {
374
374
  return r && _(r.next) && _(r.error) && _(r.complete);
375
375
  }
376
376
  function Ue(r) {
377
- return r && r instanceof de || Ne(r) && he(r);
377
+ return r && r instanceof de || Me(r) && he(r);
378
378
  }
379
379
  var Le = ae(function(r) {
380
380
  return function() {
@@ -394,7 +394,7 @@ var Le = ae(function(r) {
394
394
  throw new Le();
395
395
  }, t.prototype.next = function(e) {
396
396
  var i = this;
397
- J(function() {
397
+ G(function() {
398
398
  var s, n;
399
399
  if (i._throwIfClosed(), !i.isStopped) {
400
400
  i.currentObservers || (i.currentObservers = Array.from(i.observers));
@@ -416,7 +416,7 @@ var Le = ae(function(r) {
416
416
  });
417
417
  }, t.prototype.error = function(e) {
418
418
  var i = this;
419
- J(function() {
419
+ G(function() {
420
420
  if (i._throwIfClosed(), !i.isStopped) {
421
421
  i.hasError = i.isStopped = !0, i.thrownError = e;
422
422
  for (var s = i.observers; s.length; )
@@ -425,7 +425,7 @@ var Le = ae(function(r) {
425
425
  });
426
426
  }, t.prototype.complete = function() {
427
427
  var e = this;
428
- J(function() {
428
+ G(function() {
429
429
  if (e._throwIfClosed(), !e.isStopped) {
430
430
  e.isStopped = !0;
431
431
  for (var i = e.observers; i.length; )
@@ -527,7 +527,7 @@ class Dt {
527
527
  * Copyright 2019 Google LLC
528
528
  * SPDX-License-Identifier: BSD-3-Clause
529
529
  */
530
- const G = globalThis, xt = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ct = Symbol(), zt = /* @__PURE__ */ new WeakMap();
530
+ const J = globalThis, xt = J.ShadowRoot && (J.ShadyCSS === void 0 || J.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ct = Symbol(), zt = /* @__PURE__ */ new WeakMap();
531
531
  let fe = class {
532
532
  constructor(t, e, i) {
533
533
  if (this._$cssResult$ = !0, i !== Ct) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
@@ -546,7 +546,7 @@ let fe = class {
546
546
  return this.cssText;
547
547
  }
548
548
  };
549
- const je = (r) => new fe(typeof r == "string" ? r : r + "", void 0, Ct), N = (r, ...t) => {
549
+ const je = (r) => new fe(typeof r == "string" ? r : r + "", void 0, Ct), M = (r, ...t) => {
550
550
  const e = r.length === 1 ? r[0] : t.reduce((i, s, n) => i + ((o) => {
551
551
  if (o._$cssResult$ === !0) return o.cssText;
552
552
  if (typeof o == "number") return o;
@@ -556,7 +556,7 @@ const je = (r) => new fe(typeof r == "string" ? r : r + "", void 0, Ct), N = (r,
556
556
  }, He = (r, t) => {
557
557
  if (xt) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
558
558
  else for (const e of t) {
559
- const i = document.createElement("style"), s = G.litNonce;
559
+ const i = document.createElement("style"), s = J.litNonce;
560
560
  s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
561
561
  }
562
562
  }, Ft = xt ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
@@ -599,7 +599,7 @@ const { is: Be, defineProperty: De, getOwnPropertyDescriptor: ze, getOwnProperty
599
599
  return e;
600
600
  } }, St = (r, t) => !Be(r, t), Wt = { attribute: !0, type: String, converter: X, reflect: !1, hasChanged: St };
601
601
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), C.litPropertyMetadata ?? (C.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
602
- let I = class extends HTMLElement {
602
+ let T = class extends HTMLElement {
603
603
  static addInitializer(t) {
604
604
  this._$Ei(), (this.l ?? (this.l = [])).push(t);
605
605
  }
@@ -797,7 +797,7 @@ let I = class extends HTMLElement {
797
797
  firstUpdated(t) {
798
798
  }
799
799
  };
800
- I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[j("elementProperties")] = /* @__PURE__ */ new Map(), I[j("finalized")] = /* @__PURE__ */ new Map(), ct == null || ct({ ReactiveElement: I }), (C.reactiveElementVersions ?? (C.reactiveElementVersions = [])).push("2.0.4");
800
+ T.elementStyles = [], T.shadowRootOptions = { mode: "open" }, T[j("elementProperties")] = /* @__PURE__ */ new Map(), T[j("finalized")] = /* @__PURE__ */ new Map(), ct == null || ct({ ReactiveElement: T }), (C.reactiveElementVersions ?? (C.reactiveElementVersions = [])).push("2.0.4");
801
801
  /**
802
802
  * @license
803
803
  * Copyright 2017 Google LLC
@@ -805,18 +805,18 @@ I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[j("elementProper
805
805
  */
806
806
  const H = globalThis, Q = H.trustedTypes, Yt = Q ? Q.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, ge = "$lit$", x = `lit$${Math.random().toFixed(9).slice(2)}$`, me = "?" + x, qe = `<${me}>`, O = document, D = () => O.createComment(""), z = (r) => r === null || typeof r != "object" && typeof r != "function", Et = Array.isArray, Ke = (r) => Et(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", ht = `[
807
807
  \f\r]`, L = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, qt = /-->/g, Kt = />/g, S = RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
808
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Zt = /'/g, Jt = /"/g, ve = /^(?:script|style|textarea|title)$/i, Ze = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), T = Ze(1), k = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), Gt = /* @__PURE__ */ new WeakMap(), P = O.createTreeWalker(O, 129);
808
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Zt = /'/g, Gt = /"/g, ve = /^(?:script|style|textarea|title)$/i, Ze = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), k = Ze(1), I = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), Jt = /* @__PURE__ */ new WeakMap(), P = O.createTreeWalker(O, 129);
809
809
  function ye(r, t) {
810
810
  if (!Et(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
811
811
  return Yt !== void 0 ? Yt.createHTML(t) : t;
812
812
  }
813
- const Je = (r, t) => {
813
+ const Ge = (r, t) => {
814
814
  const e = r.length - 1, i = [];
815
815
  let s, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = L;
816
816
  for (let a = 0; a < e; a++) {
817
817
  const c = r[a];
818
818
  let h, l, d = -1, p = 0;
819
- for (; p < c.length && (o.lastIndex = p, l = o.exec(c), l !== null); ) p = o.lastIndex, o === L ? l[1] === "!--" ? o = qt : l[1] !== void 0 ? o = Kt : l[2] !== void 0 ? (ve.test(l[2]) && (s = RegExp("</" + l[2], "g")), o = S) : l[3] !== void 0 && (o = S) : o === S ? l[0] === ">" ? (o = s ?? L, 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] === '"' ? Jt : Zt) : o === Jt || o === Zt ? o = S : o === qt || o === Kt ? o = L : (o = S, s = void 0);
819
+ for (; p < c.length && (o.lastIndex = p, l = o.exec(c), l !== null); ) p = o.lastIndex, o === L ? l[1] === "!--" ? o = qt : l[1] !== void 0 ? o = Kt : l[2] !== void 0 ? (ve.test(l[2]) && (s = RegExp("</" + l[2], "g")), o = S) : l[3] !== void 0 && (o = S) : o === S ? l[0] === ">" ? (o = s ?? L, 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] === '"' ? Gt : Zt) : o === Gt || o === Zt ? o = S : o === qt || o === Kt ? o = L : (o = S, s = void 0);
820
820
  const f = o === S && r[a + 1].startsWith("/>") ? " " : "";
821
821
  n += o === L ? c + qe : d >= 0 ? (i.push(h), c.slice(0, d) + ge + c.slice(d) + x + f) : c + x + (d === -2 ? a : f);
822
822
  }
@@ -827,7 +827,7 @@ let $t = class be {
827
827
  let s;
828
828
  this.parts = [];
829
829
  let n = 0, o = 0;
830
- const a = t.length - 1, c = this.parts, [h, l] = Je(t, e);
830
+ const a = t.length - 1, c = this.parts, [h, l] = Ge(t, e);
831
831
  if (this.el = be.createElement(h, i), P.currentNode = this.el.content, e === 2 || e === 3) {
832
832
  const d = this.el.content.firstChild;
833
833
  d.replaceWith(...d.childNodes);
@@ -861,12 +861,12 @@ let $t = class be {
861
861
  };
862
862
  function R(r, t, e = r, i) {
863
863
  var o, a;
864
- if (t === k) return t;
864
+ if (t === I) return t;
865
865
  let s = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
866
866
  const n = z(t) ? void 0 : t._$litDirective$;
867
867
  return (s == null ? void 0 : s.constructor) !== n && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), n === void 0 ? s = void 0 : (s = new n(r), s._$AT(r, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = s : e._$Cl = s), s !== void 0 && (t = R(r, s._$AS(r, t.values), s, i)), t;
868
868
  }
869
- class Ge {
869
+ class Je {
870
870
  constructor(t, e) {
871
871
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
872
872
  }
@@ -914,7 +914,7 @@ class q {
914
914
  return this._$AB;
915
915
  }
916
916
  _$AI(t, e = this) {
917
- t = R(this, t, e), z(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== k && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ke(t) ? this.k(t) : this._(t);
917
+ t = R(this, t, e), z(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== I && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ke(t) ? this.k(t) : this._(t);
918
918
  }
919
919
  O(t) {
920
920
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -930,13 +930,13 @@ class q {
930
930
  const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = $t.createElement(ye(i.h, i.h[0]), this.options)), i);
931
931
  if (((n = this._$AH) == null ? void 0 : n._$AD) === s) this._$AH.p(e);
932
932
  else {
933
- const o = new Ge(s, this), a = o.u(this.options);
933
+ const o = new Je(s, this), a = o.u(this.options);
934
934
  o.p(e), this.T(a), this._$AH = o;
935
935
  }
936
936
  }
937
937
  _$AC(t) {
938
- let e = Gt.get(t.strings);
939
- return e === void 0 && Gt.set(t.strings, e = new $t(t)), e;
938
+ let e = Jt.get(t.strings);
939
+ return e === void 0 && Jt.set(t.strings, e = new $t(t)), e;
940
940
  }
941
941
  k(t) {
942
942
  Et(this._$AH) || (this._$AH = [], this._$AR());
@@ -970,11 +970,11 @@ class nt {
970
970
  _$AI(t, e = this, i, s) {
971
971
  const n = this.strings;
972
972
  let o = !1;
973
- if (n === void 0) t = R(this, t, e, 0), o = !z(t) || t !== this._$AH && t !== k, o && (this._$AH = t);
973
+ if (n === void 0) t = R(this, t, e, 0), o = !z(t) || t !== this._$AH && t !== I, o && (this._$AH = t);
974
974
  else {
975
975
  const a = t;
976
976
  let c, h;
977
- for (t = n[0], c = 0; c < n.length - 1; c++) h = R(this, a[i + c], e, c), h === k && (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;
977
+ for (t = n[0], c = 0; c < n.length - 1; c++) h = R(this, a[i + c], e, c), h === I && (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;
978
978
  }
979
979
  o && !s && this.j(t);
980
980
  }
@@ -1003,7 +1003,7 @@ class ti extends nt {
1003
1003
  super(t, e, i, s, n), this.type = 5;
1004
1004
  }
1005
1005
  _$AI(t, e = this) {
1006
- if ((t = R(this, t, e, 0) ?? u) === k) return;
1006
+ if ((t = R(this, t, e, 0) ?? u) === I) return;
1007
1007
  const i = this._$AH, s = t === u && i !== u || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, n = t !== u && (i === u || s);
1008
1008
  s && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
1009
1009
  }
@@ -1039,7 +1039,7 @@ const ii = (r, t, e) => {
1039
1039
  * Copyright 2017 Google LLC
1040
1040
  * SPDX-License-Identifier: BSD-3-Clause
1041
1041
  */
1042
- let A = class extends I {
1042
+ let A = class extends T {
1043
1043
  constructor() {
1044
1044
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
1045
1045
  }
@@ -1061,7 +1061,7 @@ let A = class extends I {
1061
1061
  super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
1062
1062
  }
1063
1063
  render() {
1064
- return k;
1064
+ return I;
1065
1065
  }
1066
1066
  };
1067
1067
  var oe;
@@ -1114,7 +1114,7 @@ var ni = Object.defineProperty, oi = (r, t, e, i) => {
1114
1114
  (o = r[n]) && (s = o(t, e, s) || s);
1115
1115
  return s && ni(t, e, s), s;
1116
1116
  };
1117
- const It = class It extends A {
1117
+ const Tt = class Tt extends A {
1118
1118
  constructor() {
1119
1119
  super(...arguments), this.anchor = "BottomRight";
1120
1120
  }
@@ -1126,8 +1126,8 @@ const It = class It extends A {
1126
1126
  return this.anchor === "BottomLeft" ? this.renderRoot.host.classList.add("bottom-left") : this.anchor === "BottomRight" && this.renderRoot.host.classList.add("bottom-right"), u;
1127
1127
  }
1128
1128
  };
1129
- It.styles = [
1130
- N`
1129
+ Tt.styles = [
1130
+ M`
1131
1131
  :host {
1132
1132
  position: fixed;
1133
1133
  display: flex;
@@ -1145,7 +1145,7 @@ It.styles = [
1145
1145
  }
1146
1146
  `
1147
1147
  ];
1148
- let F = It;
1148
+ let F = Tt;
1149
1149
  oi([
1150
1150
  m({ attribute: !0 })
1151
1151
  ], F.prototype, "anchor");
@@ -1460,7 +1460,7 @@ const re = Ot(class extends we {
1460
1460
  const o = !!t[n];
1461
1461
  o === this.st.has(n) || (s = this.nt) != null && s.has(n) || (o ? (e.add(n), this.st.add(n)) : (e.remove(n), this.st.delete(n)));
1462
1462
  }
1463
- return k;
1463
+ return I;
1464
1464
  }
1465
1465
  }), w = (r, t, e) => {
1466
1466
  r && e.style.setProperty(t, r);
@@ -1536,7 +1536,7 @@ var bi = Object.defineProperty, K = (r, t, e, i) => {
1536
1536
  (o = r[n]) && (s = o(t, e, s) || s);
1537
1537
  return s && bi(t, e, s), s;
1538
1538
  };
1539
- const Tt = class Tt extends A {
1539
+ const kt = class kt extends A {
1540
1540
  constructor() {
1541
1541
  super(...arguments), this.active = !1, this.triggerVisible = !0, this.loaded = !1, this.containerRef = xe(), this.widgetActive$ = new pe(!1), this.componentIsDestroyed$ = new At();
1542
1542
  }
@@ -1579,7 +1579,7 @@ const Tt = class Tt extends A {
1579
1579
  var a, c, h;
1580
1580
  const t = (a = this.application) == null ? void 0 : a.branding(), e = (c = t == null ? void 0 : t.graphics) == null ? void 0 : c.trigger;
1581
1581
  if (e)
1582
- return T` <img src=${e} class="trigger-icon" alt="" /> `;
1582
+ return k` <img src=${e} class="trigger-icon" alt="" /> `;
1583
1583
  const i = (h = this.application) == null ? void 0 : h.triggerIcon;
1584
1584
  if (!i)
1585
1585
  return u;
@@ -1587,7 +1587,7 @@ const Tt = class Tt extends A {
1587
1587
  switch (n) {
1588
1588
  case "Telia": {
1589
1589
  const l = await s();
1590
- return l ? T`<telia-icon
1590
+ return l ? k`<telia-icon
1591
1591
  class="trigger-icon"
1592
1592
  svg=${l.svg}
1593
1593
  size="lg"
@@ -1605,14 +1605,14 @@ const Tt = class Tt extends A {
1605
1605
  }
1606
1606
  render() {
1607
1607
  var t, e, i, s;
1608
- return T`<div
1608
+ return k`<div
1609
1609
  class=${re({
1610
1610
  "trigger-container": !0,
1611
1611
  hidden: !this.triggerVisible
1612
1612
  })}
1613
1613
  ${Ce(this.containerRef)}
1614
1614
  >
1615
- ${!this.active && ((s = (i = (e = (t = this.application) == null ? void 0 : t.settings) == null ? void 0 : e.branding) == null ? void 0 : i.other) != null && s.showButtonLabel) ? T`
1615
+ ${!this.active && ((s = (i = (e = (t = this.application) == null ? void 0 : t.settings) == null ? void 0 : e.branding) == null ? void 0 : i.other) != null && s.showButtonLabel) ? k`
1616
1616
  <button
1617
1617
  label="${this.application.settings.branding.other.buttonLabelText ?? "Widget trigger"}"
1618
1618
  class="trigger-label"
@@ -1669,8 +1669,8 @@ const Tt = class Tt extends A {
1669
1669
  </div>`;
1670
1670
  }
1671
1671
  };
1672
- Tt.styles = [
1673
- N`
1672
+ kt.styles = [
1673
+ M`
1674
1674
  :host {
1675
1675
  --voca-rem-multiplier: 0.625;
1676
1676
  --trigger-label-bg: #f5e0ff;
@@ -1801,7 +1801,7 @@ Tt.styles = [
1801
1801
  }
1802
1802
  `
1803
1803
  ];
1804
- let b = Tt;
1804
+ let b = kt;
1805
1805
  K([
1806
1806
  m({ attribute: !1 })
1807
1807
  ], b.prototype, "application");
@@ -1848,7 +1848,7 @@ const $i = (r) => {
1848
1848
  };
1849
1849
  e.styles = [
1850
1850
  // (superClass as unknown as typeof LitElement).styles ?? [],
1851
- N`
1851
+ M`
1852
1852
  :host {
1853
1853
  font-family: var(--font-family);
1854
1854
  grid-column: span var(--width);
@@ -1880,11 +1880,11 @@ const $i = (r) => {
1880
1880
  ], t.prototype, "parent"), t;
1881
1881
  }, Rt = class Rt extends $i(A) {
1882
1882
  render() {
1883
- return T`Non resolved component`;
1883
+ return k`Non resolved component`;
1884
1884
  }
1885
1885
  };
1886
1886
  Rt.styles = [
1887
- N`
1887
+ M`
1888
1888
  :host {
1889
1889
  display: block;
1890
1890
  }
@@ -2029,7 +2029,7 @@ var Ei = Object.defineProperty, Pi = (r, t, e, i) => {
2029
2029
  (o = r[n]) && (s = o(t, e, s) || s);
2030
2030
  return s && Ei(t, e, s), s;
2031
2031
  };
2032
- const Oi = "application", Mt = class Mt extends A {
2032
+ const Oi = "application", Nt = class Nt extends A {
2033
2033
  constructor() {
2034
2034
  super(...arguments), this.nodes = [], this.wrapperRef = xe();
2035
2035
  }
@@ -2056,12 +2056,12 @@ const Oi = "application", Mt = class Mt extends A {
2056
2056
  render() {
2057
2057
  var i, s;
2058
2058
  const t = this.application.settings.components.conversation;
2059
- return ((s = (i = t == null ? void 0 : t.properties) == null ? void 0 : i.chat) == null ? void 0 : s.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")), window.self !== window.top && this.renderRoot.host.classList.add("embedded"), T`<div class="widget-container" ${Ce(this.wrapperRef)}>
2059
+ return ((s = (i = t == null ? void 0 : t.properties) == null ? void 0 : i.chat) == null ? void 0 : s.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")), window.self !== window.top && this.renderRoot.host.classList.add("embedded"), k`<div class="widget-container" ${Ce(this.wrapperRef)}>
2060
2060
  ${_i(this.nodes, (n) => n)}
2061
2061
  </div>`;
2062
2062
  }
2063
2063
  };
2064
- Mt.styles = N`
2064
+ Nt.styles = M`
2065
2065
  :host {
2066
2066
  --font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
2067
2067
  --spacing-xs: 0.2rem;
@@ -2197,12 +2197,12 @@ Mt.styles = N`
2197
2197
  pointer-events: none;
2198
2198
  }
2199
2199
  `;
2200
- let V = Mt;
2200
+ let V = Nt;
2201
2201
  Pi([
2202
2202
  m({ attribute: !1 }),
2203
2203
  Si({ context: Oi })
2204
2204
  ], V.prototype, "application");
2205
- class ki {
2205
+ class Ii {
2206
2206
  constructor() {
2207
2207
  this.root = this.createRoot();
2208
2208
  }
@@ -2286,7 +2286,7 @@ const it = class it {
2286
2286
  it.ResolveWebComponentName = (t) => `ace-${t}`;
2287
2287
  let _t = it;
2288
2288
  var y = /* @__PURE__ */ ((r) => (r.Necessary = "necessary", r.Functional = "functional", r.Analytics = "analytics", r))(y || {});
2289
- class Ii {
2289
+ class Ti {
2290
2290
  constructor(t, e, i, s) {
2291
2291
  this.disallowedKeys = [], this.widgetId = t, this.storage = e === "localStorage" ? window.localStorage : window.sessionStorage, this.policy = i, this.storageEntries = s;
2292
2292
  }
@@ -2340,7 +2340,7 @@ class Ii {
2340
2340
  return `ace_${this.widgetId.substring(0, 7)}-${t}`;
2341
2341
  }
2342
2342
  }
2343
- class Ti {
2343
+ class ki {
2344
2344
  constructor() {
2345
2345
  this.texts = /* @__PURE__ */ new Map();
2346
2346
  }
@@ -2355,7 +2355,8 @@ class Ti {
2355
2355
  return this.texts.get(t) || e;
2356
2356
  }
2357
2357
  }
2358
- class Ri {
2358
+ const Ri = "1.1.82-rc.4";
2359
+ class Ni {
2359
2360
  constructor(t) {
2360
2361
  this.widget = t, this.name = t.name;
2361
2362
  }
@@ -2368,10 +2369,15 @@ class Ri {
2368
2369
  setZIndex(t) {
2369
2370
  this.widget.setZIndex(t);
2370
2371
  }
2372
+ version() {
2373
+ return {
2374
+ version: Ri
2375
+ };
2376
+ }
2371
2377
  }
2372
2378
  class Mi {
2373
2379
  constructor(t, e, i, s, n) {
2374
- this.id = t, this.name = e, this.container = i, this.settings = s, this.options = n, this.platform = new ki(), this.texts = new Ti(), this.renderStrategy = $.Inline, this.anchor = "BottomRight", this.autoActivate = !1, this.plugins = [], this.componentResolver = new _t(), this.components = [], this.trigger = null, this.api = new Ri(this), this.onMessageReceived = async (a) => {
2380
+ this.id = t, this.name = e, this.container = i, this.settings = s, this.options = n, this.platform = new Ii(), this.texts = new ki(), this.renderStrategy = $.Inline, this.anchor = "BottomRight", this.autoActivate = !1, this.plugins = [], this.componentResolver = new _t(), this.components = [], this.trigger = null, this.api = new Ni(this), this.onMessageReceived = async (a) => {
2375
2381
  var h;
2376
2382
  const c = a.data;
2377
2383
  switch (c.type) {
@@ -2416,7 +2422,7 @@ class Mi {
2416
2422
  [y.Functional]: !0,
2417
2423
  [y.Analytics]: !0
2418
2424
  };
2419
- this.storage = new Ii(
2425
+ this.storage = new Ti(
2420
2426
  this.id,
2421
2427
  "sessionStorage",
2422
2428
  o,
@@ -2428,13 +2434,16 @@ class Mi {
2428
2434
  const t = this.render();
2429
2435
  t && this._getTargetElement().appendChild(t);
2430
2436
  }
2431
- window != null && window.parent && window.parent.postMessage(
2432
- {
2433
- type: "widget-activated",
2434
- data: { widgetId: this.id }
2435
- },
2436
- "*"
2437
- );
2437
+ if (window != null && window.parent) {
2438
+ const { version: t } = this.api.version();
2439
+ window.parent.postMessage(
2440
+ {
2441
+ type: "widget-activated",
2442
+ data: { widgetId: this.id, version: t }
2443
+ },
2444
+ "*"
2445
+ );
2446
+ }
2438
2447
  }
2439
2448
  async loadPlugins() {
2440
2449
  for await (const t of this.plugins)
@@ -2500,7 +2509,7 @@ class Mi {
2500
2509
  return this.root;
2501
2510
  }
2502
2511
  }
2503
- const Wi = (r) => new W(r), st = class st {
2512
+ const Yi = (r) => new W(r), st = class st {
2504
2513
  // TODO:
2505
2514
  // private static endpoint = 'http://localhost:5299/api'; // TODO:
2506
2515
  constructor(t = st.endpoint) {
@@ -2539,7 +2548,7 @@ const Wi = (r) => new W(r), st = class st {
2539
2548
  };
2540
2549
  st.endpoint = "https://widgets.ace.teliacompany.net/api";
2541
2550
  let W = st;
2542
- class Ni {
2551
+ class Ui {
2543
2552
  constructor(t) {
2544
2553
  this.site = t;
2545
2554
  }
@@ -2563,7 +2572,7 @@ class Ni {
2563
2572
  });
2564
2573
  }
2565
2574
  }
2566
- class Ui {
2575
+ class Li {
2567
2576
  constructor() {
2568
2577
  this.applications = [], this.container = new Dt("environment", this), this.bootstrapped = !1, this.site = null, this.widgetAPIHandlers = /* @__PURE__ */ new Map(), this.siteConfigurationHandlers = [], setTimeout(() => {
2569
2578
  this.notifyWidgetsOfCreation();
@@ -2651,9 +2660,9 @@ class Ui {
2651
2660
  }), this;
2652
2661
  }
2653
2662
  }
2654
- class Li {
2663
+ class ji {
2655
2664
  constructor(t) {
2656
- this.configurations = [], this.httpClient = new W(), this.api = new Ni(this), this.triggers = [], this.httpClient = new W(), typeof t == "string" ? this.url = t : (t.httpClient && (this.httpClient = t.httpClient), this.loadFromConfig(t));
2665
+ this.configurations = [], this.httpClient = new W(), this.api = new Ui(this), this.triggers = [], this.httpClient = new W(), typeof t == "string" ? this.url = t : (t.httpClient && (this.httpClient = t.httpClient), this.loadFromConfig(t));
2657
2666
  }
2658
2667
  async load(t) {
2659
2668
  const e = await this.httpClient.getSite(t);
@@ -2681,7 +2690,7 @@ class Li {
2681
2690
  }
2682
2691
  async bootstrap(t) {
2683
2692
  var e;
2684
- this.url && await this.load(this.url), this.environment = new Ui(), this.addGlobal(this.environment);
2693
+ this.url && await this.load(this.url), this.environment = new Li(), this.addGlobal(this.environment);
2685
2694
  for await (const i of this.configurations) {
2686
2695
  const s = await this.httpClient.getWidget(i.widgetId);
2687
2696
  s && ((e = this.environment) == null || e.registerApp(
@@ -2707,12 +2716,12 @@ class Li {
2707
2716
  }), globalThis.ace = t;
2708
2717
  }
2709
2718
  }
2710
- var ji = Object.defineProperty, kt = (r, t, e, i) => {
2719
+ var Hi = Object.defineProperty, It = (r, t, e, i) => {
2711
2720
  for (var s = void 0, n = r.length - 1, o; n >= 0; n--)
2712
2721
  (o = r[n]) && (s = o(t, e, s) || s);
2713
- return s && ji(t, e, s), s;
2722
+ return s && Hi(t, e, s), s;
2714
2723
  };
2715
- const Nt = class Nt extends A {
2724
+ const Mt = class Mt extends A {
2716
2725
  constructor() {
2717
2726
  super(), this.status = "deactivated", this.addEventListener("environment-created", this.onEnvironmentCreated);
2718
2727
  }
@@ -2744,44 +2753,44 @@ const Nt = class Nt extends A {
2744
2753
  return this.widget.render();
2745
2754
  }
2746
2755
  };
2747
- Nt.styles = [
2748
- N`
2756
+ Mt.styles = [
2757
+ M`
2749
2758
  :host {
2750
2759
  display: block;
2751
2760
  }
2752
2761
  `
2753
2762
  ];
2754
- let M = Nt;
2755
- kt([
2763
+ let N = Mt;
2764
+ It([
2756
2765
  m({ attribute: !0 })
2757
- ], M.prototype, "name");
2758
- kt([
2766
+ ], N.prototype, "name");
2767
+ It([
2759
2768
  U()
2760
- ], M.prototype, "widget");
2761
- kt([
2769
+ ], N.prototype, "widget");
2770
+ It([
2762
2771
  U()
2763
- ], M.prototype, "status");
2772
+ ], N.prototype, "status");
2764
2773
  customElements.get("ace-trigger-slot") || customElements.define("ace-trigger-slot", F);
2765
2774
  customElements.get("ace-trigger") || customElements.define("ace-trigger", b);
2766
2775
  customElements.get("ace-unresolved-component") || customElements.define("ace-unresolved-component", et);
2767
2776
  customElements.get("ace-wrapper") || customElements.define("ace-wrapper", V);
2768
- customElements.get("ace-widget") || customElements.define("ace-widget", M);
2769
- const Yi = async (r, t, e = {}) => {
2770
- const i = new Li(r);
2777
+ customElements.get("ace-widget") || customElements.define("ace-widget", N);
2778
+ const qi = async (r, t, e = {}) => {
2779
+ const i = new ji(r);
2771
2780
  e.httpClient && i.setHttpClient(e.httpClient), await i.bootstrap(t);
2772
2781
  };
2773
2782
  export {
2774
- M as AceWidget,
2783
+ N as AceWidget,
2775
2784
  Mi as Application,
2776
2785
  Dt as Container,
2777
- Ui as Environment,
2786
+ Li as Environment,
2778
2787
  W as HttpClient,
2779
- Li as Site,
2788
+ ji as Site,
2780
2789
  y as StorageCategory,
2781
- Ii as StorageService,
2790
+ Ti as StorageService,
2782
2791
  b as Trigger,
2783
2792
  $i as WidgetComponent,
2784
2793
  Oi as applicationContext,
2785
- Yi as bootstrap,
2786
- Wi as createHttpClient
2794
+ qi as bootstrap,
2795
+ Yi as createHttpClient
2787
2796
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-core-flamingo",
3
- "version": "1.1.82-rc.2",
3
+ "version": "1.1.82-rc.4",
4
4
  "dependencies": {
5
5
  "lit": "^3.0.2",
6
6
  "@teliads/icons": "^8.4.0",