@lambforge/agent-chat 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-chat.js +39 -39
- package/dist/agent-chat.js.map +4 -4
- package/dist/index.cjs +289 -492
- package/dist/index.cjs.map +4 -4
- package/dist/index.mjs +286 -495
- package/dist/index.mjs.map +4 -4
- package/package.json +3 -3
package/dist/agent-chat.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
(()=>{var
|
|
2
|
-
`+t.map(function(n,o){return o+1+") "+n.toString()}).join(`
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=t}})});function de(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var mt=l(()=>{});function uo(r){return r instanceof K||r&&"closed"in r&&_(r.remove)&&_(r.add)&&_(r.unsubscribe)}function jl(r){_(r)?r():r.unsubscribe()}var K,va,Ie=l(()=>{T();z();ha();mt();K=(function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,n,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=Q(s),u=a.next();!u.done;u=a.next()){var c=u.value;c.remove(this)}}catch(y){e={error:y}}finally{try{u&&!u.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else s.remove(this);var f=this.initialTeardown;if(_(f))try{f()}catch(y){i=y instanceof dr?y.errors:[y]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var v=Q(p),m=v.next();!m.done;m=v.next()){var b=m.value;try{jl(b)}catch(y){i=i??[],y instanceof dr?i=O(O([],$(i)),$(y.errors)):i.push(y)}}}catch(y){n={error:y}}finally{try{m&&!m.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(i)throw new dr(i)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)jl(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&de(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&de(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=(function(){var e=new r;return e.closed=!0,e})(),r})(),va=K.EMPTY});var Pe,hr=l(()=>{Pe={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}});var vr,ga=l(()=>{T();vr={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var o=vr.delegate;return o?.setTimeout?o.setTimeout.apply(o,O([r,e],$(t))):setTimeout.apply(void 0,O([r,e],$(t)))},clearTimeout:function(r){var e=vr.delegate;return(e?.clearTimeout||clearTimeout)(r)},delegate:void 0}});function co(r){vr.setTimeout(function(){var e=Pe.onUnhandledError;if(e)e(r);else throw r})}var ba=l(()=>{hr();ga()});function j(){}var he=l(()=>{});function Ll(r){return ya("E",void 0,r)}function Fl(r){return ya("N",r,void 0)}function ya(r,e,t){return{kind:r,value:e,error:t}}var Ml,Ul=l(()=>{Ml=(function(){return ya("C",void 0,void 0)})()});function gr(r){if(Pe.useDeprecatedSynchronousErrorHandling){var e=!Ht;if(e&&(Ht={errorThrown:!1,error:null}),r(),e){var t=Ht,n=t.errorThrown,o=t.error;if(Ht=null,n)throw o}}else r()}function ql(r){Pe.useDeprecatedSynchronousErrorHandling&&Ht&&(Ht.errorThrown=!0,Ht.error=r)}var Ht,lo=l(()=>{hr();Ht=null});function xa(r,e){return Rd.call(r,e)}function fo(r){Pe.useDeprecatedSynchronousErrorHandling?ql(r):co(r)}function Md(r){throw r}function wa(r,e){var t=Pe.onStoppedNotification;t&&vr.setTimeout(function(){return t(r,e)})}var Bt,Rd,jd,dt,Ld,br=l(()=>{T();z();Ie();hr();ba();he();Ul();ga();lo();Bt=(function(r){k(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,uo(t)&&t.add(n)):n.destination=Ld,n}return e.create=function(t,n,o){return new dt(t,n,o)},e.prototype.next=function(t){this.isStopped?wa(Fl(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?wa(Ll(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?wa(Ml,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(K),Rd=Function.prototype.bind;jd=(function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){fo(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){fo(n)}else fo(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){fo(t)}},r})(),dt=(function(r){k(e,r);function e(t,n,o){var i=r.call(this)||this,s;if(_(t)||!t)s={next:t??void 0,error:n??void 0,complete:o??void 0};else{var a;i&&Pe.useDeprecatedNextContext?(a=Object.create(t),a.unsubscribe=function(){return i.unsubscribe()},s={next:t.next&&xa(t.next,a),error:t.error&&xa(t.error,a),complete:t.complete&&xa(t.complete,a)}):s=t}return i.destination=new jd(s),i}return e})(Bt);Ld={closed:!0,next:j,error:Md,complete:j}});var At,wn=l(()=>{At=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})()});function U(r){return r}var ve=l(()=>{});function yr(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return _a(r)}function _a(r){return r.length===0?U:r.length===1?r[0]:function(t){return r.reduce(function(n,o){return o(n)},t)}}var _n=l(()=>{ve()});function Dl(r){var e;return(e=r??Pe.Promise)!==null&&e!==void 0?e:Promise}function Fd(r){return r&&_(r.next)&&_(r.error)&&_(r.complete)}function Ud(r){return r&&r instanceof Bt||Fd(r)&&uo(r)}var A,B=l(()=>{br();Ie();wn();_n();hr();z();lo();A=(function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var o=this,i=Ud(e)?e:new dt(e,t,n);return gr(function(){var s=o,a=s.operator,u=s.source;i.add(a?a.call(i,u):u?o._subscribe(i):o._trySubscribe(i))}),i},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=Dl(t),new t(function(o,i){var s=new dt({next:function(a){try{e(a)}catch(u){i(u),s.unsubscribe()}},error:i,complete:o});n.subscribe(s)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[At]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return _a(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=Dl(e),new e(function(n,o){var i;t.subscribe(function(s){return i=s},function(s){return o(s)},function(){return n(i)})})},r.create=function(e){return new r(e)},r})()});function Sa(r){return _(r?.lift)}function d(r){return function(e){if(Sa(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}var S=l(()=>{z()});function h(r,e,t,n,o){return new Sn(r,e,t,n,o)}var Sn,E=l(()=>{T();br();Sn=(function(r){k(e,r);function e(t,n,o,i,s,a){var u=r.call(this,t)||this;return u.onFinalize=s,u.shouldUnsubscribe=a,u._next=n?function(c){try{n(c)}catch(f){t.error(f)}}:r.prototype._next,u._error=i?function(c){try{i(c)}catch(f){t.error(f)}finally{this.unsubscribe()}}:r.prototype._error,u._complete=o?function(){try{o()}catch(c){t.error(c)}finally{this.unsubscribe()}}:r.prototype._complete,u}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e})(Bt)});function xr(){return d(function(r,e){var t=null;r._refCount++;var n=h(e,void 0,void 0,void 0,function(){if(!r||r._refCount<=0||0<--r._refCount){t=null;return}var o=r._connection,i=t;t=null,o&&(!i||o===i)&&o.unsubscribe(),e.unsubscribe()});r.subscribe(n),n.closed||(t=r.connect())})}var po=l(()=>{S();E()});var Et,An=l(()=>{T();B();Ie();po();E();S();Et=(function(r){k(e,r);function e(t,n){var o=r.call(this)||this;return o.source=t,o.subjectFactory=n,o._subject=null,o._refCount=0,o._connection=null,Sa(t)&&(o.lift=t.lift),o}return e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,t?.unsubscribe()},e.prototype.connect=function(){var t=this,n=this._connection;if(!n){n=this._connection=new K;var o=this.getSubject();n.add(this.source.subscribe(h(o,void 0,function(){t._teardown(),o.complete()},function(i){t._teardown(),o.error(i)},function(){return t._teardown()}))),n.closed&&(this._connection=null,n=K.EMPTY)}return n},e.prototype.refCount=function(){return xr()(this)},e})(A)});var Aa,Nl=l(()=>{Aa={now:function(){return(Aa.delegate||performance).now()},delegate:void 0}});var ht,Ea=l(()=>{T();Ie();ht={schedule:function(r){var e=requestAnimationFrame,t=cancelAnimationFrame,n=ht.delegate;n&&(e=n.requestAnimationFrame,t=n.cancelAnimationFrame);var o=e(function(i){t=void 0,r(i)});return new K(function(){return t?.(o)})},requestAnimationFrame:function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=ht.delegate;return(t?.requestAnimationFrame||requestAnimationFrame).apply(void 0,O([],$(r)))},cancelAnimationFrame:function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=ht.delegate;return(t?.cancelAnimationFrame||cancelAnimationFrame).apply(void 0,O([],$(r)))},delegate:void 0}});function Wl(r){return r?Vl(r):qd}function Vl(r){return new A(function(e){var t=r||Aa,n=t.now(),o=0,i=function(){e.closed||(o=ht.requestAnimationFrame(function(s){o=0;var a=t.now();e.next({timestamp:r?a:s,elapsed:a-n}),i()}))};return i(),function(){o&&ht.cancelAnimationFrame(o)}})}var qd,zl=l(()=>{B();Nl();Ea();qd=Vl()});var mo,$a=l(()=>{St();mo=Ae(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})});var R,Hl,ge=l(()=>{T();B();Ie();$a();mt();lo();R=(function(r){k(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var n=new Hl(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new mo},e.prototype.next=function(t){var n=this;gr(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var s=Q(n.currentObservers),a=s.next();!a.done;a=s.next()){var u=a.value;u.next(t)}}catch(c){o={error:c}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}})},e.prototype.error=function(t){var n=this;gr(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var o=n.observers;o.length;)o.shift().error(t)}})},e.prototype.complete=function(){var t=this;gr(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,o=this,i=o.hasError,s=o.isStopped,a=o.observers;return i||s?va:(this.currentObservers=null,a.push(t),new K(function(){n.currentObservers=null,de(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,o=n.hasError,i=n.thrownError,s=n.isStopped;o?t.error(i):s&&t.complete()},e.prototype.asObservable=function(){var t=new A;return t.source=this,t},e.create=function(t,n){return new Hl(t,n)},e})(A),Hl=(function(r){k(e,r);function e(t,n){var o=r.call(this)||this;return o.destination=t,o.source=n,o}return e.prototype.next=function(t){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,t)},e.prototype.error=function(t){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&o!==void 0?o:va},e})(R)});var ho,Oa=l(()=>{T();ge();ho=(function(r){k(e,r);function e(t){var n=r.call(this)||this;return n._value=t,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var n=r.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},e.prototype.getValue=function(){var t=this,n=t.hasError,o=t.thrownError,i=t._value;if(n)throw o;return this._throwIfClosed(),i},e.prototype.next=function(t){r.prototype.next.call(this,this._value=t)},e})(R)});var Kt,vo=l(()=>{Kt={now:function(){return(Kt.delegate||Date).now()},delegate:void 0}});var wr,go=l(()=>{T();ge();vo();wr=(function(r){k(e,r);function e(t,n,o){t===void 0&&(t=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Kt);var i=r.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return e.prototype.next=function(t){var n=this,o=n.isStopped,i=n._buffer,s=n._infiniteTimeWindow,a=n._timestampProvider,u=n._windowTime;o||(i.push(t),!s&&i.push(a.now()+u)),this._trimBuffer(),r.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(t),o=this,i=o._infiniteTimeWindow,s=o._buffer,a=s.slice(),u=0;u<a.length&&!t.closed;u+=i?1:2)t.next(a[u]);return this._checkFinalizedStatuses(t),n},e.prototype._trimBuffer=function(){var t=this,n=t._bufferSize,o=t._timestampProvider,i=t._buffer,s=t._infiniteTimeWindow,a=(s?1:2)*n;if(n<1/0&&a<i.length&&i.splice(0,i.length-a),!s){for(var u=o.now(),c=0,f=1;f<i.length&&i[f]<=u;f+=2)c=f;c&&i.splice(0,c+1)}},e})(R)});var _r,bo=l(()=>{T();ge();_r=(function(r){k(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return e.prototype._checkFinalizedStatuses=function(t){var n=this,o=n.hasError,i=n._hasValue,s=n._value,a=n.thrownError,u=n.isStopped,c=n._isComplete;o?t.error(a):(u||c)&&(i&&t.next(s),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var t=this,n=t._hasValue,o=t._value,i=t._isComplete;i||(this._isComplete=!0,n&&r.prototype.next.call(this,o),r.prototype.complete.call(this))},e})(R)});var Bl,Kl=l(()=>{T();Ie();Bl=(function(r){k(e,r);function e(t,n){return r.call(this)||this}return e.prototype.schedule=function(t,n){return n===void 0&&(n=0),this},e})(K)});var En,Yl=l(()=>{T();En={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var o=En.delegate;return o?.setInterval?o.setInterval.apply(o,O([r,e],$(t))):setInterval.apply(void 0,O([r,e],$(t)))},clearInterval:function(r){var e=En.delegate;return(e?.clearInterval||clearInterval)(r)},delegate:void 0}});var Xe,Sr=l(()=>{T();Kl();Yl();mt();Xe=(function(r){k(e,r);function e(t,n){var o=r.call(this,t,n)||this;return o.scheduler=t,o.work=n,o.pending=!1,o}return e.prototype.schedule=function(t,n){var o;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(t,n,o){return o===void 0&&(o=0),En.setInterval(t.flush.bind(t,this),o)},e.prototype.recycleAsyncId=function(t,n,o){if(o===void 0&&(o=0),o!=null&&this.delay===o&&this.pending===!1)return n;n!=null&&En.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var o=this._execute(t,n);if(o)return o;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var o=!1,i;try{this.work(t)}catch(s){o=!0,i=s||new Error("Scheduled action threw falsy error")}if(o)return this.unsubscribe(),i},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,o=t.scheduler,i=o.actions;this.work=this.state=this.scheduler=null,this.pending=!1,de(i,this),n!=null&&(this.id=this.recycleAsyncId(o,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e})(Bl)});function Gl(r){return r in Ca?(delete Ca[r],!0):!1}var Dd,Ta,Ca,Ia,Jl=l(()=>{Dd=1,Ca={};Ia={setImmediate:function(r){var e=Dd++;return Ca[e]=!0,Ta||(Ta=Promise.resolve()),Ta.then(function(){return Gl(e)&&r()}),e},clearImmediate:function(r){Gl(r)}}});var Nd,Wd,$n,Ql=l(()=>{T();Jl();Nd=Ia.setImmediate,Wd=Ia.clearImmediate,$n={setImmediate:function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=$n.delegate;return(t?.setImmediate||Nd).apply(void 0,O([],$(r)))},clearImmediate:function(r){var e=$n.delegate;return(e?.clearImmediate||Wd)(r)},delegate:void 0}});var Zl,Xl=l(()=>{T();Sr();Ql();Zl=(function(r){k(e,r);function e(t,n){var o=r.call(this,t,n)||this;return o.scheduler=t,o.work=n,o}return e.prototype.requestAsyncId=function(t,n,o){return o===void 0&&(o=0),o!==null&&o>0?r.prototype.requestAsyncId.call(this,t,n,o):(t.actions.push(this),t._scheduled||(t._scheduled=$n.setImmediate(t.flush.bind(t,void 0))))},e.prototype.recycleAsyncId=function(t,n,o){var i;if(o===void 0&&(o=0),o!=null?o>0:this.delay>0)return r.prototype.recycleAsyncId.call(this,t,n,o);var s=t.actions;n!=null&&((i=s[s.length-1])===null||i===void 0?void 0:i.id)!==n&&($n.clearImmediate(n),t._scheduled===n&&(t._scheduled=void 0))},e})(Xe)});var On,Pa=l(()=>{vo();On=(function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=Kt.now,r})()});var et,Ar=l(()=>{T();Pa();et=(function(r){k(e,r);function e(t,n){n===void 0&&(n=On.now);var o=r.call(this,t,n)||this;return o.actions=[],o._active=!1,o}return e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var o;this._active=!0;do if(o=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,o){for(;t=n.shift();)t.unsubscribe();throw o}},e})(On)});var ef,tf=l(()=>{T();Ar();ef=(function(r){k(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.flush=function(t){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var o=this.actions,i;t=t||o.shift();do if(i=t.execute(t.state,t.delay))break;while((t=o[0])&&t.id===n&&o.shift());if(this._active=!1,i){for(;(t=o[0])&&t.id===n&&o.shift();)t.unsubscribe();throw i}},e})(et)});var ka,rf,nf=l(()=>{Xl();tf();ka=new ef(Zl),rf=ka});var Z,Er,Ee=l(()=>{Sr();Ar();Z=new et(Xe),Er=Z});var of,sf=l(()=>{T();Sr();of=(function(r){k(e,r);function e(t,n){var o=r.call(this,t,n)||this;return o.scheduler=t,o.work=n,o}return e.prototype.schedule=function(t,n){return n===void 0&&(n=0),n>0?r.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},e.prototype.execute=function(t,n){return n>0||this.closed?r.prototype.execute.call(this,t,n):this._execute(t,n)},e.prototype.requestAsyncId=function(t,n,o){return o===void 0&&(o=0),o!=null&&o>0||o==null&&this.delay>0?r.prototype.requestAsyncId.call(this,t,n,o):(t.flush(this),0)},e})(Xe)});var af,uf=l(()=>{T();Ar();af=(function(r){k(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e})(et)});var Ra,cf,lf=l(()=>{sf();uf();Ra=new af(of),cf=Ra});var ff,pf=l(()=>{T();Sr();Ea();ff=(function(r){k(e,r);function e(t,n){var o=r.call(this,t,n)||this;return o.scheduler=t,o.work=n,o}return e.prototype.requestAsyncId=function(t,n,o){return o===void 0&&(o=0),o!==null&&o>0?r.prototype.requestAsyncId.call(this,t,n,o):(t.actions.push(this),t._scheduled||(t._scheduled=ht.requestAnimationFrame(function(){return t.flush(void 0)})))},e.prototype.recycleAsyncId=function(t,n,o){var i;if(o===void 0&&(o=0),o!=null?o>0:this.delay>0)return r.prototype.recycleAsyncId.call(this,t,n,o);var s=t.actions;n!=null&&n===t._scheduled&&((i=s[s.length-1])===null||i===void 0?void 0:i.id)!==n&&(ht.cancelAnimationFrame(n),t._scheduled=void 0)},e})(Xe)});var mf,df=l(()=>{T();Ar();mf=(function(r){k(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.flush=function(t){this._active=!0;var n;t?n=t.id:(n=this._scheduled,this._scheduled=void 0);var o=this.actions,i;t=t||o.shift();do if(i=t.execute(t.state,t.delay))break;while((t=o[0])&&t.id===n&&o.shift());if(this._active=!1,i){for(;(t=o[0])&&t.id===n&&o.shift();)t.unsubscribe();throw i}},e})(et)});var ja,hf,vf=l(()=>{pf();df();ja=new mf(ff),hf=ja});var gf,Ma,bf=l(()=>{T();Sr();Ie();Ar();gf=(function(r){k(e,r);function e(t,n){t===void 0&&(t=Ma),n===void 0&&(n=1/0);var o=r.call(this,t,function(){return o.frame})||this;return o.maxFrames=n,o.frame=0,o.index=-1,o}return e.prototype.flush=function(){for(var t=this,n=t.actions,o=t.maxFrames,i,s;(s=n[0])&&s.delay<=o&&(n.shift(),this.frame=s.delay,!(i=s.execute(s.state,s.delay))););if(i){for(;s=n.shift();)s.unsubscribe();throw i}},e.frameTimeFactor=10,e})(et),Ma=(function(r){k(e,r);function e(t,n,o){o===void 0&&(o=t.index+=1);var i=r.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.index=o,i.active=!0,i.index=t.index=o,i}return e.prototype.schedule=function(t,n){if(n===void 0&&(n=0),Number.isFinite(n)){if(!this.id)return r.prototype.schedule.call(this,t,n);this.active=!1;var o=new e(this.scheduler,this.work);return this.add(o),o.schedule(t,n)}else return K.EMPTY},e.prototype.requestAsyncId=function(t,n,o){o===void 0&&(o=0),this.delay=t.frame+o;var i=t.actions;return i.push(this),i.sort(e.sortActions),1},e.prototype.recycleAsyncId=function(t,n,o){o===void 0&&(o=0)},e.prototype._execute=function(t,n){if(this.active===!0)return r.prototype._execute.call(this,t,n)},e.sortActions=function(t,n){return t.delay===n.delay?t.index===n.index?0:t.index>n.index?1:-1:t.delay>n.delay?1:-1},e})(Xe)});function yf(r){return r?Vd(r):X}function Vd(r){return new A(function(e){return r.schedule(function(){return e.complete()})})}var X,We=l(()=>{B();X=new A(function(r){return r.complete()})});function $t(r){return r&&_(r.schedule)}var Tn=l(()=>{z()});function La(r){return r[r.length-1]}function tt(r){return _(La(r))?r.pop():void 0}function pe(r){return $t(La(r))?r.pop():void 0}function yo(r,e){return typeof La(r)=="number"?r.pop():e}var $e=l(()=>{z();Tn()});var $r,xo=l(()=>{$r=(function(r){return r&&typeof r.length=="number"&&typeof r!="function"})});function wo(r){return _(r?.then)}var Fa=l(()=>{z()});function _o(r){return _(r[At])}var Ua=l(()=>{wn();z()});function So(r){return Symbol.asyncIterator&&_(r?.[Symbol.asyncIterator])}var qa=l(()=>{z()});function Ao(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var Da=l(()=>{});function zd(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Eo,Na=l(()=>{Eo=zd()});function $o(r){return _(r?.[Eo])}var Wa=l(()=>{Na();z()});function Oo(r){return kl(this,arguments,function(){var t,n,o,i;return mr(this,function(s){switch(s.label){case 0:t=r.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,zt(t.read())];case 3:return n=s.sent(),o=n.value,i=n.done,i?[4,zt(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,zt(o)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function To(r){return _(r?.getReader)}var Co=l(()=>{T();z()});function x(r){if(r instanceof A)return r;if(r!=null){if(_o(r))return Hd(r);if($r(r))return Bd(r);if(wo(r))return Kd(r);if(So(r))return xf(r);if($o(r))return Yd(r);if(To(r))return Gd(r)}throw Ao(r)}function Hd(r){return new A(function(e){var t=r[At]();if(_(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Bd(r){return new A(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function Kd(r){return new A(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,co)})}function Yd(r){return new A(function(e){var t,n;try{for(var o=Q(r),i=o.next();!i.done;i=o.next()){var s=i.value;if(e.next(s),e.closed)return}}catch(a){t={error:a}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}e.complete()})}function xf(r){return new A(function(e){Jd(r,e).catch(function(t){return e.error(t)})})}function Gd(r){return xf(Oo(r))}function Jd(r,e){var t,n,o,i;return Pl(this,void 0,void 0,function(){var s,a;return mr(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),t=Rl(r),u.label=1;case 1:return[4,t.next()];case 2:if(n=u.sent(),!!n.done)return[3,4];if(s=n.value,e.next(s),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=u.sent(),o={error:a},[3,11];case 6:return u.trys.push([6,,9,10]),n&&!n.done&&(i=t.return)?[4,i.call(t)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}var I=l(()=>{T();xo();Fa();B();Ua();qa();Da();Wa();Co();z();ba();wn()});function re(r,e,t,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var i=e.schedule(function(){t(),o?r.add(this.schedule(null,n)):this.unsubscribe()},n);if(r.add(i),!o)return i}var vt=l(()=>{});function rt(r,e){return e===void 0&&(e=0),d(function(t,n){t.subscribe(h(n,function(o){return re(n,r,function(){return n.next(o)},e)},function(){return re(n,r,function(){return n.complete()},e)},function(o){return re(n,r,function(){return n.error(o)},e)}))})}var Or=l(()=>{vt();S();E()});function nt(r,e){return e===void 0&&(e=0),d(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}var Tr=l(()=>{S()});function wf(r,e){return x(r).pipe(nt(e),rt(e))}var _f=l(()=>{I();Or();Tr()});function Sf(r,e){return x(r).pipe(nt(e),rt(e))}var Af=l(()=>{I();Or();Tr()});function Ef(r,e){return new A(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}var $f=l(()=>{B()});function Io(r,e){return new A(function(t){var n;return re(t,e,function(){n=r[Eo](),re(t,e,function(){var o,i,s;try{o=n.next(),i=o.value,s=o.done}catch(a){t.error(a);return}s?t.complete():t.next(i)},0,!0)}),function(){return _(n?.return)&&n.return()}})}var Va=l(()=>{B();Na();z();vt()});function Po(r,e){if(!r)throw new Error("Iterable cannot be null");return new A(function(t){re(t,e,function(){var n=r[Symbol.asyncIterator]();re(t,e,function(){n.next().then(function(o){o.done?t.complete():t.next(o.value)})},0,!0)})})}var za=l(()=>{B();vt()});function Of(r,e){return Po(Oo(r),e)}var Tf=l(()=>{za();Co()});function ko(r,e){if(r!=null){if(_o(r))return wf(r,e);if($r(r))return Ef(r,e);if(wo(r))return Sf(r,e);if(So(r))return Po(r,e);if($o(r))return Io(r,e);if(To(r))return Of(r,e)}throw Ao(r)}var Ha=l(()=>{_f();Af();$f();Va();za();Ua();Fa();xo();Wa();qa();Da();Co();Tf()});function oe(r,e){return e?ko(r,e):x(r)}var gt=l(()=>{Ha();I()});function xe(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=pe(r);return oe(r,t)}var Ro=l(()=>{$e();gt()});function Ot(r,e){var t=_(r)?r:function(){return r},n=function(o){return o.error(t())};return new A(e?function(o){return e.schedule(n,0,o)}:n)}var Ba=l(()=>{B();z()});function Ka(r,e){var t,n,o,i=r,s=i.kind,a=i.value,u=i.error;if(typeof s!="string")throw new TypeError('Invalid notification, missing "kind"');s==="N"?(t=e.next)===null||t===void 0||t.call(e,a):s==="E"?(n=e.error)===null||n===void 0||n.call(e,u):(o=e.complete)===null||o===void 0||o.call(e)}var jo,Cr,Mo=l(()=>{We();Ro();Ba();z();(function(r){r.NEXT="N",r.ERROR="E",r.COMPLETE="C"})(jo||(jo={}));Cr=(function(){function r(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue=e==="N"}return r.prototype.observe=function(e){return Ka(this,e)},r.prototype.do=function(e,t,n){var o=this,i=o.kind,s=o.value,a=o.error;return i==="N"?e?.(s):i==="E"?t?.(a):n?.()},r.prototype.accept=function(e,t,n){var o;return _((o=e)===null||o===void 0?void 0:o.next)?this.observe(e):this.do(e,t,n)},r.prototype.toObservable=function(){var e=this,t=e.kind,n=e.value,o=e.error,i=t==="N"?xe(n):t==="E"?Ot(function(){return o}):t==="C"?X:0;if(!i)throw new TypeError("Unexpected notification kind "+t);return i},r.createNext=function(e){return new r("N",e)},r.createError=function(e){return new r("E",void 0,e)},r.createComplete=function(){return r.completeNotification},r.completeNotification=new r("C"),r})()});function Lo(r){return!!r&&(r instanceof A||_(r.lift)&&_(r.subscribe))}var Cf=l(()=>{B();z()});var Oe,Tt=l(()=>{St();Oe=Ae(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}})});function If(r,e){var t=typeof e=="object";return new Promise(function(n,o){var i=!1,s;r.subscribe({next:function(a){s=a,i=!0},error:o,complete:function(){i?n(s):t?n(e.defaultValue):o(new Oe)}})})}var Pf=l(()=>{Tt()});function kf(r,e){var t=typeof e=="object";return new Promise(function(n,o){var i=new dt({next:function(s){n(s),i.unsubscribe()},error:o,complete:function(){t?n(e.defaultValue):o(new Oe)}});r.subscribe(i)})}var Rf=l(()=>{Tt();br()});var Cn,Ya=l(()=>{St();Cn=Ae(function(r){return function(){r(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})});var Fo,Ga=l(()=>{St();Fo=Ae(function(r){return function(t){r(this),this.name="NotFoundError",this.message=t}})});var Uo,Ja=l(()=>{St();Uo=Ae(function(r){return function(t){r(this),this.name="SequenceError",this.message=t}})});function Ir(r){return r instanceof Date&&!isNaN(r)}var qo=l(()=>{});function Pr(r,e){var t=Ir(r)?{first:r}:typeof r=="number"?{each:r}:r,n=t.first,o=t.each,i=t.with,s=i===void 0?Qd:i,a=t.scheduler,u=a===void 0?e??Z:a,c=t.meta,f=c===void 0?null:c;if(n==null&&o==null)throw new TypeError("No timeout provided.");return d(function(p,v){var m,b,y=null,g=0,w=function(F){b=re(v,u,function(){try{m.unsubscribe(),x(s({meta:f,lastValue:y,seen:g})).subscribe(v)}catch(ae){v.error(ae)}},F)};m=p.subscribe(h(v,function(F){b?.unsubscribe(),g++,v.next(y=F),o>0&&w(o)},void 0,void 0,function(){b?.closed||b?.unsubscribe(),y=null})),!g&&w(n!=null?typeof n=="number"?n:+n-u.now():o)})}function Qd(r){throw new Qa(r)}var Qa,In=l(()=>{Ee();qo();S();I();St();E();vt();Qa=Ae(function(r){return function(t){t===void 0&&(t=null),r(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}})});function Y(r,e){return d(function(t,n){var o=0;t.subscribe(h(n,function(i){n.next(r.call(e,i,o++))}))})}var bt=l(()=>{S();E()});function Xd(r,e){return Zd(e)?r.apply(void 0,O([],$(e))):r(e)}function Te(r){return Y(function(e){return Xd(r,e)})}var Zd,Ct=l(()=>{T();bt();Zd=Array.isArray});function kr(r,e,t,n){if(t)if($t(t))n=t;else return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return kr(r,e,n).apply(this,o).pipe(Te(t))};return n?function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return kr(r,e).apply(this,o).pipe(nt(n),rt(n))}:function(){for(var o=this,i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];var a=new _r,u=!0;return new A(function(c){var f=a.subscribe(c);if(u){u=!1;var p=!1,v=!1;e.apply(o,O(O([],$(i)),[function(){for(var m=[],b=0;b<arguments.length;b++)m[b]=arguments[b];if(r){var y=m.shift();if(y!=null){a.error(y);return}}a.next(1<m.length?m:m[0]),v=!0,p&&a.complete()}])),v&&a.complete(),p=!0}return f})}}var Za=l(()=>{T();Tn();B();Tr();Ct();Or();bo()});function jf(r,e,t){return kr(!1,r,e,t)}var Mf=l(()=>{Za()});function Lf(r,e,t){return kr(!0,r,e,t)}var Ff=l(()=>{Za()});function Do(r){if(r.length===1){var e=r[0];if(eh(e))return{args:e,keys:null};if(oh(e)){var t=nh(e);return{args:t.map(function(n){return e[n]}),keys:t}}}return{args:r,keys:null}}function oh(r){return r&&typeof r=="object"&&th(r)===rh}var eh,th,rh,nh,Xa=l(()=>{eh=Array.isArray,th=Object.getPrototypeOf,rh=Object.prototype,nh=Object.keys});function No(r,e){return r.reduce(function(t,n,o){return t[n]=e[o],t},{})}var eu=l(()=>{});function Wo(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=pe(r),n=tt(r),o=Do(r),i=o.args,s=o.keys;if(i.length===0)return oe([],t);var a=new A(tu(i,t,s?function(u){return No(s,u)}:U));return n?a.pipe(Te(n)):a}function tu(r,e,t){return t===void 0&&(t=U),function(n){Uf(e,function(){for(var o=r.length,i=new Array(o),s=o,a=o,u=function(f){Uf(e,function(){var p=oe(r[f],e),v=!1;p.subscribe(h(n,function(m){i[f]=m,v||(v=!0,a--),a||n.next(t(i.slice()))},function(){--s||n.complete()}))},n)},c=0;c<o;c++)u(c)},n)}}function Uf(r,e,t){r?re(t,r,e):e()}var Vo=l(()=>{B();Xa();gt();ve();Ct();$e();eu();E();vt()});function Rr(r,e,t,n,o,i,s,a){var u=[],c=0,f=0,p=!1,v=function(){p&&!u.length&&!c&&e.complete()},m=function(y){return c<n?b(y):u.push(y)},b=function(y){i&&e.next(y),c++;var g=!1;x(t(y,f++)).subscribe(h(e,function(w){o?.(w),i?m(w):e.next(w)},function(){g=!0},void 0,function(){if(g)try{c--;for(var w=function(){var F=u.shift();s?re(e,s,function(){return b(F)}):b(F)};u.length&&c<n;)w();v()}catch(F){e.error(F)}}))};return r.subscribe(h(e,m,function(){p=!0,v()})),function(){a?.()}}var zo=l(()=>{I();vt();E()});function J(r,e,t){return t===void 0&&(t=1/0),_(e)?J(function(n,o){return Y(function(i,s){return e(n,i,o,s)})(x(r(n,o)))},t):(typeof e=="number"&&(t=e),d(function(n,o){return Rr(n,o,r,t)}))}var ot=l(()=>{bt();I();S();zo();z()});function it(r){return r===void 0&&(r=1/0),J(U,r)}var jr=l(()=>{ot();ve()});function It(){return it(1)}var Pn=l(()=>{jr()});function Ve(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return It()(oe(r,pe(r)))}var kn=l(()=>{Pn();$e();gt()});function je(r){return new A(function(e){x(r()).subscribe(e)})}var Rn=l(()=>{B();I()});function qf(r,e){e===void 0&&(e=ih);var t=null,n=e.connector,o=e.resetOnDisconnect,i=o===void 0?!0:o,s=n(),a=new A(function(u){return s.subscribe(u)});return a.connect=function(){return(!t||t.closed)&&(t=je(function(){return r}).subscribe(s),i&&t.add(function(){return s=n()})),t},a}var ih,Df=l(()=>{ge();B();Rn();ih={connector:function(){return new R},resetOnDisconnect:!0}});function Nf(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=tt(r),n=Do(r),o=n.args,i=n.keys,s=new A(function(a){var u=o.length;if(!u){a.complete();return}for(var c=new Array(u),f=u,p=u,v=function(b){var y=!1;x(o[b]).subscribe(h(a,function(g){y||(y=!0,p--),c[b]=g},function(){return f--},void 0,function(){(!f||!y)&&(p||a.next(i?No(i,c):c),a.complete())}))},m=0;m<u;m++)v(m)});return t?s.pipe(Te(t)):s}var Wf=l(()=>{B();Xa();I();$e();E();Ct();eu()});function Ho(r,e,t,n){if(_(t)&&(n=t,t=void 0),n)return Ho(r,e,t).pipe(Te(n));var o=$(fh(r)?ah.map(function(a){return function(u){return r[a](e,u,t)}}):ch(r)?sh.map(Vf(r,e)):lh(r)?uh.map(Vf(r,e)):[],2),i=o[0],s=o[1];if(!i&&$r(r))return J(function(a){return Ho(a,e,t)})(x(r));if(!i)throw new TypeError("Invalid event target");return new A(function(a){var u=function(){for(var c=[],f=0;f<arguments.length;f++)c[f]=arguments[f];return a.next(1<c.length?c:c[0])};return i(u),function(){return s(u)}})}function Vf(r,e){return function(t){return function(n){return r[t](e,n)}}}function ch(r){return _(r.addListener)&&_(r.removeListener)}function lh(r){return _(r.on)&&_(r.off)}function fh(r){return _(r.addEventListener)&&_(r.removeEventListener)}var sh,ah,uh,zf=l(()=>{T();I();B();ot();xo();z();Ct();sh=["addListener","removeListener"],ah=["addEventListener","removeEventListener"],uh=["on","off"]});function ru(r,e,t){return t?ru(r,e).pipe(Te(t)):new A(function(n){var o=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return n.next(s.length===1?s[0]:s)},i=r(o);return _(e)?function(){return e(o,i)}:void 0})}var Hf=l(()=>{B();z();Ct()});function Bf(r,e,t,n,o){var i,s,a,u;arguments.length===1?(i=r,u=i.initialState,e=i.condition,t=i.iterate,s=i.resultSelector,a=s===void 0?U:s,o=i.scheduler):(u=r,!n||$t(n)?(a=U,o=n):a=n);function c(){var f;return mr(this,function(p){switch(p.label){case 0:f=u,p.label=1;case 1:return!e||e(f)?[4,a(f)]:[3,4];case 2:p.sent(),p.label=3;case 3:return f=t(f),[3,1];case 4:return[2]}})}return je(o?function(){return Io(c(),o)}:c)}var Kf=l(()=>{T();ve();Tn();Rn();Va()});function Yf(r,e,t){return je(function(){return r()?e:t})}var Gf=l(()=>{Rn()});function be(r,e,t){r===void 0&&(r=0),t===void 0&&(t=Er);var n=-1;return e!=null&&($t(e)?t=e:n=e),new A(function(o){var i=Ir(r)?+r-t.now():r;i<0&&(i=0);var s=0;return t.schedule(function(){o.closed||(o.next(s++),0<=n?this.schedule(void 0,n):o.complete())},i)})}var Pt=l(()=>{B();Ee();Tn();qo()});function Bo(r,e){return r===void 0&&(r=0),e===void 0&&(e=Z),r<0&&(r=0),be(r,r,e)}var nu=l(()=>{Ee();Pt()});function Mr(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=pe(r),n=yo(r,1/0),o=r;return o.length?o.length===1?x(o[0]):it(n)(oe(o,t)):X}var Jf=l(()=>{jr();I();We();$e();gt()});function Qf(){return ou}var ou,iu=l(()=>{B();he();ou=new A(j)});function Me(r){return r.length===1&&ph(r[0])?r[0]:r}var ph,Yt=l(()=>{ph=Array.isArray});function Ko(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Me(r);return new A(function(n){var o=0,i=function(){if(o<t.length){var s=void 0;try{s=x(t[o++])}catch{i();return}var a=new Sn(n,void 0,j,j);s.subscribe(a),a.add(i)}else n.complete()};i()})}var su=l(()=>{B();Yt();E();he();I()});function Zf(r,e){return oe(Object.entries(r),e)}var Xf=l(()=>{gt()});function Yo(r,e){return function(t,n){return!r.call(e,t,n)}}var au=l(()=>{});function ie(r,e){return d(function(t,n){var o=0;t.subscribe(h(n,function(i){return r.call(e,i,o++)&&n.next(i)}))})}var yt=l(()=>{S();E()});function ep(r,e,t){return[ie(e,t)(x(r)),ie(Yo(e,t))(x(r))]}var tp=l(()=>{au();yt();I()});function rp(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return r=Me(r),r.length===1?x(r[0]):new A(uu(r))}function uu(r){return function(e){for(var t=[],n=function(i){t.push(x(r[i]).subscribe(h(e,function(s){if(t){for(var a=0;a<t.length;a++)a!==i&&t[a].unsubscribe();t=null}e.next(s)})))},o=0;t&&!e.closed&&o<r.length;o++)n(o)}}var cu=l(()=>{B();I();Yt();E()});function np(r,e,t){if(e==null&&(e=r,r=0),e<=0)return X;var n=e+r;return new A(t?function(o){var i=r;return t.schedule(function(){i<n?(o.next(i++),this.schedule()):o.complete()})}:function(o){for(var i=r;i<n&&!o.closed;)o.next(i++);o.complete()})}var op=l(()=>{B();We()});function ip(r,e){return new A(function(t){var n=r(),o=e(n),i=o?x(o):X;return i.subscribe(t),function(){n&&n.unsubscribe()}})}var sp=l(()=>{B();I();We()});function Lr(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=tt(r),n=Me(r);return n.length?new A(function(o){var i=n.map(function(){return[]}),s=n.map(function(){return!1});o.add(function(){i=s=null});for(var a=function(c){x(n[c]).subscribe(h(o,function(f){if(i[c].push(f),i.every(function(v){return v.length})){var p=i.map(function(v){return v.shift()});o.next(t?t.apply(void 0,O([],$(p))):p),i.some(function(v,m){return!v.length&&s[m]})&&o.complete()}},function(){s[c]=!0,!i[c].length&&o.complete()}))},u=0;!o.closed&&u<n.length;u++)a(u);return function(){i=s=null}}):X}var Go=l(()=>{T();B();I();Yt();We();E();$e()});var ap=l(()=>{});function Fr(r){return d(function(e,t){var n=!1,o=null,i=null,s=!1,a=function(){if(i?.unsubscribe(),i=null,n){n=!1;var c=o;o=null,t.next(c)}s&&t.complete()},u=function(){i=null,s&&t.complete()};e.subscribe(h(t,function(c){n=!0,o=c,i||x(r(c)).subscribe(i=h(t,a,u))},function(){s=!0,(!n||!i||i.closed)&&t.complete()}))})}var Jo=l(()=>{S();I();E()});function Qo(r,e){return e===void 0&&(e=Z),Fr(function(){return be(r,e)})}var lu=l(()=>{Ee();Jo();Pt()});function Zo(r){return d(function(e,t){var n=[];return e.subscribe(h(t,function(o){return n.push(o)},function(){t.next(n),t.complete()})),x(r).subscribe(h(t,function(){var o=n;n=[],t.next(o)},j)),function(){n=null}})}var fu=l(()=>{S();he();E();I()});function Xo(r,e){return e===void 0&&(e=null),e=e??r,d(function(t,n){var o=[],i=0;t.subscribe(h(n,function(s){var a,u,c,f,p=null;i++%e===0&&o.push([]);try{for(var v=Q(o),m=v.next();!m.done;m=v.next()){var b=m.value;b.push(s),r<=b.length&&(p=p??[],p.push(b))}}catch(w){a={error:w}}finally{try{m&&!m.done&&(u=v.return)&&u.call(v)}finally{if(a)throw a.error}}if(p)try{for(var y=Q(p),g=y.next();!g.done;g=y.next()){var b=g.value;de(o,b),n.next(b)}}catch(w){c={error:w}}finally{try{g&&!g.done&&(f=y.return)&&f.call(y)}finally{if(c)throw c.error}}},function(){var s,a;try{for(var u=Q(o),c=u.next();!c.done;c=u.next()){var f=c.value;n.next(f)}}catch(p){s={error:p}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(s)throw s.error}}n.complete()},void 0,function(){o=null}))})}var pu=l(()=>{T();S();E();mt()});function ei(r){for(var e,t,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var i=(e=pe(n))!==null&&e!==void 0?e:Z,s=(t=n[0])!==null&&t!==void 0?t:null,a=n[1]||1/0;return d(function(u,c){var f=[],p=!1,v=function(y){var g=y.buffer,w=y.subs;w.unsubscribe(),de(f,y),c.next(g),p&&m()},m=function(){if(f){var y=new K;c.add(y);var g=[],w={buffer:g,subs:y};f.push(w),re(y,i,function(){return v(w)},r)}};s!==null&&s>=0?re(c,i,m,s,!0):p=!0,m();var b=h(c,function(y){var g,w,F=f.slice();try{for(var ae=Q(F),Se=ae.next();!Se.done;Se=ae.next()){var Qe=Se.value,Ze=Qe.buffer;Ze.push(y),a<=Ze.length&&v(Qe)}}catch(pr){g={error:pr}}finally{try{Se&&!Se.done&&(w=ae.return)&&w.call(ae)}finally{if(g)throw g.error}}},function(){for(;f?.length;)c.next(f.shift().buffer);b?.unsubscribe(),c.complete(),c.unsubscribe()},void 0,function(){return f=null});u.subscribe(b)})}var mu=l(()=>{T();Ie();S();E();mt();Ee();$e();vt()});function ti(r,e){return d(function(t,n){var o=[];x(r).subscribe(h(n,function(i){var s=[];o.push(s);var a=new K,u=function(){de(o,s),n.next(s),a.unsubscribe()};a.add(x(e(i)).subscribe(h(n,u,j)))},j)),t.subscribe(h(n,function(i){var s,a;try{for(var u=Q(o),c=u.next();!c.done;c=u.next()){var f=c.value;f.push(i)}}catch(p){s={error:p}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(s)throw s.error}}},function(){for(;o.length>0;)n.next(o.shift());n.complete()}))})}var du=l(()=>{T();Ie();S();I();E();he();mt()});function ri(r){return d(function(e,t){var n=null,o=null,i=function(){o?.unsubscribe();var s=n;n=[],s&&t.next(s),x(r()).subscribe(o=h(t,i,j))};i(),e.subscribe(h(t,function(s){return n?.push(s)},function(){n&&t.next(n),t.complete()},void 0,function(){return n=o=null}))})}var hu=l(()=>{S();he();E();I()});function Le(r){return d(function(e,t){var n=null,o=!1,i;n=e.subscribe(h(t,void 0,void 0,function(s){i=x(r(s,Le(r)(e))),n?(n.unsubscribe(),n=null,i.subscribe(t)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(t))})}var vu=l(()=>{I();E();S()});function ni(r,e,t,n,o){return function(i,s){var a=t,u=e,c=0;i.subscribe(h(s,function(f){var p=c++;u=a?r(u,f,p):(a=!0,f),n&&s.next(u)},o&&(function(){a&&s.next(u),s.complete()})))}}var gu=l(()=>{E()});function Fe(r,e){return d(ni(r,e,arguments.length>=2,!1,!0))}var Gt=l(()=>{gu();S()});function Ur(){return d(function(r,e){Fe(mh,[])(r).subscribe(e)})}var mh,oi=l(()=>{Gt();S();mh=function(r,e){return r.push(e),r}});function ii(r,e){return yr(Ur(),J(function(t){return r(t)}),e?Te(e):U)}var bu=l(()=>{ve();Ct();_n();ot();oi()});function qr(r){return ii(Wo,r)}var si=l(()=>{Vo();bu()});var ai,yu=l(()=>{si();ai=qr});function jn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=tt(r);return t?yr(jn.apply(void 0,O([],$(r))),Te(t)):d(function(n,o){tu(O([n],$(Me(r))))(o)})}var xu=l(()=>{T();Vo();S();Yt();Ct();_n();$e()});function ui(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return jn.apply(void 0,O([],$(r)))}var wu=l(()=>{T();xu()});function Jt(r,e){return _(e)?J(r,e,1):J(r,1)}var ci=l(()=>{ot();z()});function li(r,e){return _(e)?Jt(function(){return r},e):Jt(function(){return r})}var _u=l(()=>{ci();z()});function fi(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=pe(r);return d(function(n,o){It()(oe(O([n],$(r)),t)).subscribe(o)})}var Su=l(()=>{T();S();Pn();$e();gt()});function pi(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return fi.apply(void 0,O([],$(r)))}var Au=l(()=>{T();Su()});function up(r){return new A(function(e){return r.subscribe(e)})}var cp=l(()=>{B()});function kt(r,e){e===void 0&&(e=dh);var t=e.connector;return d(function(n,o){var i=t();x(r(up(i))).subscribe(o),o.add(n.subscribe(i))})}var dh,Mn=l(()=>{ge();I();S();cp();dh={connector:function(){return new R}}});function mi(r){return Fe(function(e,t,n){return!r||r(t,n)?e+1:e},0)}var Eu=l(()=>{Gt()});function di(r){return d(function(e,t){var n=!1,o=null,i=null,s=function(){if(i?.unsubscribe(),i=null,n){n=!1;var a=o;o=null,t.next(a)}};e.subscribe(h(t,function(a){i?.unsubscribe(),n=!0,o=a,i=h(t,s,j),x(r(a)).subscribe(i)},function(){s(),t.complete()},void 0,function(){o=i=null}))})}var $u=l(()=>{S();he();E();I()});function hi(r,e){return e===void 0&&(e=Z),d(function(t,n){var o=null,i=null,s=null,a=function(){if(o){o.unsubscribe(),o=null;var c=i;i=null,n.next(c)}};function u(){var c=s+r,f=e.now();if(f<c){o=this.schedule(void 0,c-f),n.add(o);return}a()}t.subscribe(h(n,function(c){i=c,s=e.now(),o||(o=e.schedule(u,r),n.add(o))},function(){a(),n.complete()},void 0,function(){i=o=null}))})}var Ou=l(()=>{Ee();S();E()});function st(r){return d(function(e,t){var n=!1;e.subscribe(h(t,function(o){n=!0,t.next(o)},function(){n||t.next(r),t.complete()}))})}var Dr=l(()=>{S();E()});function ye(r){return r<=0?function(){return X}:d(function(e,t){var n=0;e.subscribe(h(t,function(o){++n<=r&&(t.next(o),r<=n&&t.complete())}))})}var Nr=l(()=>{We();S();E()});function xt(){return d(function(r,e){r.subscribe(h(e,j))})}var vi=l(()=>{S();E();he()});function Wr(r){return Y(function(){return r})}var gi=l(()=>{bt()});function Qt(r,e){return e?function(t){return Ve(e.pipe(ye(1),xt()),t.pipe(Qt(r)))}:J(function(t,n){return x(r(t,n)).pipe(ye(1),Wr(t))})}var bi=l(()=>{kn();Nr();vi();gi();ot();I()});function yi(r,e){e===void 0&&(e=Z);var t=be(r,e);return Qt(function(){return t})}var Tu=l(()=>{Ee();bi();Pt()});function xi(){return d(function(r,e){r.subscribe(h(e,function(t){return Ka(t,e)}))})}var Cu=l(()=>{Mo();S();E()});function wi(r,e){return d(function(t,n){var o=new Set;t.subscribe(h(n,function(i){var s=r?r(i):i;o.has(s)||(o.add(s),n.next(i))})),e&&x(e).subscribe(h(n,function(){return o.clear()},j))})}var Iu=l(()=>{S();E();he();I()});function Rt(r,e){return e===void 0&&(e=U),r=r??hh,d(function(t,n){var o,i=!0;t.subscribe(h(n,function(s){var a=e(s);(i||!r(o,a))&&(i=!1,o=a,n.next(s))}))})}function hh(r,e){return r===e}var _i=l(()=>{ve();S();E()});function Si(r,e){return Rt(function(t,n){return e?e(t[r],n[r]):t[r]===n[r]})}var Pu=l(()=>{_i()});function at(r){return r===void 0&&(r=vh),d(function(e,t){var n=!1;e.subscribe(h(t,function(o){n=!0,t.next(o)},function(){return n?t.complete():t.error(r())}))})}function vh(){return new Oe}var Vr=l(()=>{Tt();S();E()});function Ai(r,e){if(r<0)throw new Cn;var t=arguments.length>=2;return function(n){return n.pipe(ie(function(o,i){return i===r}),ye(1),t?st(e):at(function(){return new Cn}))}}var ku=l(()=>{Ya();yt();Vr();Dr();Nr()});function zr(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return function(t){return Ve(t,xe.apply(void 0,O([],$(r))))}}var Ru=l(()=>{T();kn();Ro()});function Ei(r,e){return d(function(t,n){var o=0;t.subscribe(h(n,function(i){r.call(e,i,o++,t)||(n.next(!1),n.complete())},function(){n.next(!0),n.complete()}))})}var ju=l(()=>{S();E()});function Zt(r,e){return e?function(t){return t.pipe(Zt(function(n,o){return x(r(n,o)).pipe(Y(function(i,s){return e(n,i,o,s)}))}))}:d(function(t,n){var o=0,i=null,s=!1;t.subscribe(h(n,function(a){i||(i=h(n,void 0,function(){i=null,s&&n.complete()}),x(r(a,o++)).subscribe(i))},function(){s=!0,!i&&n.complete()}))})}var $i=l(()=>{bt();I();S();E()});function Hr(){return Zt(U)}var Oi=l(()=>{$i();ve()});var Ti,Mu=l(()=>{Oi();Ti=Hr});function Ci(r,e,t){return e===void 0&&(e=1/0),e=(e||0)<1?1/0:e,d(function(n,o){return Rr(n,o,r,e,void 0,!0,t)})}var Lu=l(()=>{S();zo()});function jt(r){return d(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})}var Fu=l(()=>{S()});function Ii(r,e){return d(Uu(r,e,"value"))}function Uu(r,e,t){var n=t==="index";return function(o,i){var s=0;o.subscribe(h(i,function(a){var u=s++;r.call(e,a,u,o)&&(i.next(n?u:a),i.complete())},function(){i.next(n?-1:void 0),i.complete()}))}}var Pi=l(()=>{S();E()});function ki(r,e){return d(Uu(r,e,"index"))}var qu=l(()=>{S();Pi()});function Ri(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?ie(function(o,i){return r(o,i,n)}):U,ye(1),t?st(e):at(function(){return new Oe}))}}var Du=l(()=>{Tt();yt();Nr();Dr();Vr();ve()});function ji(r,e,t,n){return d(function(o,i){var s;!e||typeof e=="function"?s=e:(t=e.duration,s=e.element,n=e.connector);var a=new Map,u=function(b){a.forEach(b),b(i)},c=function(b){return u(function(y){return y.error(b)})},f=0,p=!1,v=new Sn(i,function(b){try{var y=r(b),g=a.get(y);if(!g){a.set(y,g=n?n():new R);var w=m(y,g);if(i.next(w),t){var F=h(g,function(){g.complete(),F?.unsubscribe()},void 0,void 0,function(){return a.delete(y)});v.add(x(t(w)).subscribe(F))}}g.next(s?s(b):b)}catch(ae){c(ae)}},function(){return u(function(b){return b.complete()})},c,function(){return a.clear()},function(){return p=!0,f===0});o.subscribe(v);function m(b,y){var g=new A(function(w){f++;var F=y.subscribe(w);return function(){F.unsubscribe(),--f===0&&p&&v.unsubscribe()}});return g.key=b,g}})}var Nu=l(()=>{B();I();ge();S();E()});function Mi(){return d(function(r,e){r.subscribe(h(e,function(){e.next(!1),e.complete()},function(){e.next(!0),e.complete()}))})}var Wu=l(()=>{S();E()});function Br(r){return r<=0?function(){return X}:d(function(e,t){var n=[];e.subscribe(h(t,function(o){n.push(o),r<n.length&&n.shift()},function(){var o,i;try{for(var s=Q(n),a=s.next();!a.done;a=s.next()){var u=a.value;t.next(u)}}catch(c){o={error:c}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}t.complete()},void 0,function(){n=null}))})}var Li=l(()=>{T();We();S();E()});function Fi(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?ie(function(o,i){return r(o,i,n)}):U,Br(1),t?st(e):at(function(){return new Oe}))}}var Vu=l(()=>{Tt();yt();Li();Vr();Dr();ve()});function Ui(){return d(function(r,e){r.subscribe(h(e,function(t){e.next(Cr.createNext(t))},function(){e.next(Cr.createComplete()),e.complete()},function(t){e.next(Cr.createError(t)),e.complete()}))})}var zu=l(()=>{Mo();S();E()});function qi(r){return Fe(_(r)?function(e,t){return r(e,t)>0?e:t}:function(e,t){return e>t?e:t})}var Hu=l(()=>{Gt();z()});var Di,Bu=l(()=>{ot();Di=J});function Ni(r,e,t){return t===void 0&&(t=1/0),_(e)?J(function(){return r},e,t):(typeof e=="number"&&(t=e),J(function(){return r},t))}var Ku=l(()=>{ot();z()});function Wi(r,e,t){return t===void 0&&(t=1/0),d(function(n,o){var i=e;return Rr(n,o,function(s,a){return r(i,s,a)},t,function(s){i=s},!1,void 0,function(){return i=null})})}var Yu=l(()=>{S();zo()});function Vi(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=pe(r),n=yo(r,1/0);return d(function(o,i){it(n)(oe(O([o],$(r)),t)).subscribe(i)})}var Gu=l(()=>{T();S();jr();$e();gt()});function zi(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Vi.apply(void 0,O([],$(r)))}var Ju=l(()=>{T();Gu()});function Hi(r){return Fe(_(r)?function(e,t){return r(e,t)<0?e:t}:function(e,t){return e<t?e:t})}var Qu=l(()=>{Gt();z()});function Mt(r,e){var t=_(r)?r:function(){return r};return _(e)?kt(e,{connector:t}):function(n){return new Et(n,t)}}var Ln=l(()=>{An();z();Mn()});function Zu(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Me(r);return function(n){return Ko.apply(void 0,O([n],$(t)))}}var lp,Xu=l(()=>{T();Yt();su();lp=Zu});function Bi(){return d(function(r,e){var t,n=!1;r.subscribe(h(e,function(o){var i=t;t=o,n&&e.next([i,o]),n=!0}))})}var ec=l(()=>{S();E()});function Ki(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=r.length;if(t===0)throw new Error("list of properties cannot be empty.");return Y(function(n){for(var o=n,i=0;i<t;i++){var s=o?.[r[i]];if(typeof s<"u")o=s;else return}return o})}var tc=l(()=>{bt()});function Yi(r){return r?function(e){return kt(r)(e)}:function(e){return Mt(new R)(e)}}var rc=l(()=>{ge();Ln();Mn()});function Gi(r){return function(e){var t=new ho(r);return new Et(e,function(){return t})}}var nc=l(()=>{Oa();An()});function Ji(){return function(r){var e=new _r;return new Et(r,function(){return e})}}var oc=l(()=>{bo();An()});function Qi(r,e,t,n){t&&!_(t)&&(n=t);var o=_(t)?t:void 0;return function(i){return Mt(new wr(r,e,n),o)(i)}}var ic=l(()=>{go();Ln();z()});function Kr(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return r.length?d(function(t,n){uu(O([t],$(r)))(n)}):U}var Zi=l(()=>{T();cu();S();ve()});function Xi(r){var e,t=1/0,n;return r!=null&&(typeof r=="object"?(e=r.count,t=e===void 0?1/0:e,n=r.delay):t=r),t<=0?function(){return X}:d(function(o,i){var s=0,a,u=function(){if(a?.unsubscribe(),a=null,n!=null){var f=typeof n=="number"?be(n):x(n(s)),p=h(i,function(){p.unsubscribe(),c()});f.subscribe(p)}else c()},c=function(){var f=!1;a=o.subscribe(h(i,void 0,function(){++s<t?a?u():f=!0:i.complete()})),f&&u()};c()})}var sc=l(()=>{We();S();E();I();Pt()});function es(r){return d(function(e,t){var n,o=!1,i,s=!1,a=!1,u=function(){return a&&s&&(t.complete(),!0)},c=function(){return i||(i=new R,x(r(i)).subscribe(h(t,function(){n?f():o=!0},function(){s=!0,u()}))),i},f=function(){a=!1,n=e.subscribe(h(t,void 0,function(){a=!0,!u()&&c().next()})),o&&(n.unsubscribe(),n=null,o=!1,f())};f()})}var ac=l(()=>{I();ge();S();E()});function ts(r){r===void 0&&(r=1/0);var e;r&&typeof r=="object"?e=r:e={count:r};var t=e.count,n=t===void 0?1/0:t,o=e.delay,i=e.resetOnSuccess,s=i===void 0?!1:i;return n<=0?U:d(function(a,u){var c=0,f,p=function(){var v=!1;f=a.subscribe(h(u,function(m){s&&(c=0),u.next(m)},void 0,function(m){if(c++<n){var b=function(){f?(f.unsubscribe(),f=null,p()):v=!0};if(o!=null){var y=typeof o=="number"?be(o):x(o(m,c)),g=h(u,function(){g.unsubscribe(),b()},function(){u.complete()});y.subscribe(g)}else b()}else u.error(m)})),v&&(f.unsubscribe(),f=null,p())};p()})}var uc=l(()=>{S();E();ve();Pt();I()});function rs(r){return d(function(e,t){var n,o=!1,i,s=function(){n=e.subscribe(h(t,void 0,void 0,function(a){i||(i=new R,x(r(i)).subscribe(h(t,function(){return n?s():o=!0}))),i&&i.next(a)})),o&&(n.unsubscribe(),n=null,o=!1,s())};s()})}var cc=l(()=>{I();ge();S();E()});function Yr(r){return d(function(e,t){var n=!1,o=null;e.subscribe(h(t,function(i){n=!0,o=i})),x(r).subscribe(h(t,function(){if(n){n=!1;var i=o;o=null,t.next(i)}},j))})}var ns=l(()=>{I();S();he();E()});function os(r,e){return e===void 0&&(e=Z),Yr(Bo(r,e))}var lc=l(()=>{Ee();ns();nu()});function is(r,e){return d(ni(r,e,arguments.length>=2,!0))}var fc=l(()=>{S();gu()});function ss(r,e){return e===void 0&&(e=function(t,n){return t===n}),d(function(t,n){var o=fp(),i=fp(),s=function(u){n.next(u),n.complete()},a=function(u,c){var f=h(n,function(p){var v=c.buffer,m=c.complete;v.length===0?m?s(!1):u.buffer.push(p):!e(p,v.shift())&&s(!1)},function(){u.complete=!0;var p=c.complete,v=c.buffer;p&&s(v.length===0),f?.unsubscribe()});return f};t.subscribe(a(o,i)),x(r).subscribe(a(i,o))})}function fp(){return{buffer:[],complete:!1}}var pc=l(()=>{S();E();I()});function Gr(r){r===void 0&&(r={});var e=r.connector,t=e===void 0?function(){return new R}:e,n=r.resetOnError,o=n===void 0?!0:n,i=r.resetOnComplete,s=i===void 0?!0:i,a=r.resetOnRefCountZero,u=a===void 0?!0:a;return function(c){var f,p,v,m=0,b=!1,y=!1,g=function(){p?.unsubscribe(),p=void 0},w=function(){g(),f=v=void 0,b=y=!1},F=function(){var ae=f;w(),ae?.unsubscribe()};return d(function(ae,Se){m++,!y&&!b&&g();var Qe=v=v??t();Se.add(function(){m--,m===0&&!y&&!b&&(p=mc(F,u))}),Qe.subscribe(Se),!f&&m>0&&(f=new dt({next:function(Ze){return Qe.next(Ze)},error:function(Ze){y=!0,g(),p=mc(w,o,Ze),Qe.error(Ze)},complete:function(){b=!0,g(),p=mc(w,s),Qe.complete()}}),x(ae).subscribe(f))})(c)}}function mc(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];if(e===!0){r();return}if(e!==!1){var o=new dt({next:function(){o.unsubscribe(),r()}});return x(e.apply(void 0,O([],$(t)))).subscribe(o)}}var as=l(()=>{T();I();ge();br();S()});function Jr(r,e,t){var n,o,i,s,a=!1;return r&&typeof r=="object"?(n=r.bufferSize,s=n===void 0?1/0:n,o=r.windowTime,e=o===void 0?1/0:o,i=r.refCount,a=i===void 0?!1:i,t=r.scheduler):s=r??1/0,Gr({connector:function(){return new wr(s,e,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}var dc=l(()=>{go();as()});function us(r){return d(function(e,t){var n=!1,o,i=!1,s=0;e.subscribe(h(t,function(a){i=!0,(!r||r(a,s++,e))&&(n&&t.error(new Uo("Too many matching values")),n=!0,o=a)},function(){n?(t.next(o),t.complete()):t.error(i?new Fo("No matching values"):new Oe)}))})}var hc=l(()=>{Tt();Ja();Ga();S();E()});function cs(r){return ie(function(e,t){return r<=t})}var vc=l(()=>{yt()});function ls(r){return r<=0?U:d(function(e,t){var n=new Array(r),o=0;return e.subscribe(h(t,function(i){var s=o++;if(s<r)n[s]=i;else{var a=s%r,u=n[a];n[a]=i,t.next(u)}})),function(){n=null}})}var gc=l(()=>{ve();S();E()});function fs(r){return d(function(e,t){var n=!1,o=h(t,function(){o?.unsubscribe(),n=!0},j);x(r).subscribe(o),e.subscribe(h(t,function(i){return n&&t.next(i)}))})}var bc=l(()=>{S();E();I();he()});function ps(r){return d(function(e,t){var n=!1,o=0;e.subscribe(h(t,function(i){return(n||(n=!r(i,o++)))&&t.next(i)}))})}var yc=l(()=>{S();E()});function ms(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=pe(r);return d(function(n,o){(t?Ve(r,n,t):Ve(r,n)).subscribe(o)})}var xc=l(()=>{kn();$e();S()});function ee(r,e){return d(function(t,n){var o=null,i=0,s=!1,a=function(){return s&&!o&&n.complete()};t.subscribe(h(n,function(u){o?.unsubscribe();var c=0,f=i++;x(r(u,f)).subscribe(o=h(n,function(p){return n.next(e?e(u,p,f,c++):p)},function(){o=null,a()}))},function(){s=!0,a()}))})}var Qr=l(()=>{I();S();E()});function ds(){return ee(U)}var wc=l(()=>{Qr();ve()});function hs(r,e){return _(e)?ee(function(){return r},e):ee(function(){return r})}var _c=l(()=>{Qr();z()});function vs(r,e){return d(function(t,n){var o=e;return ee(function(i,s){return r(o,i,s)},function(i,s){return o=s,s})(t).subscribe(n),function(){o=null}})}var Sc=l(()=>{Qr();S()});function Zr(r){return d(function(e,t){x(r).subscribe(h(t,function(){return t.complete()},j)),!t.closed&&e.subscribe(t)})}var Ac=l(()=>{S();E();I();he()});function Lt(r,e){return e===void 0&&(e=!1),d(function(t,n){var o=0;t.subscribe(h(n,function(i){var s=r(i,o++);(s||e)&&n.next(i),!s&&n.complete()}))})}var Ec=l(()=>{S();E()});function ut(r,e,t){var n=_(r)||e||t?{next:r,error:e,complete:t}:r;return n?d(function(o,i){var s;(s=n.subscribe)===null||s===void 0||s.call(n);var a=!0;o.subscribe(h(i,function(u){var c;(c=n.next)===null||c===void 0||c.call(n,u),i.next(u)},function(){var u;a=!1,(u=n.complete)===null||u===void 0||u.call(n),i.complete()},function(u){var c;a=!1,(c=n.error)===null||c===void 0||c.call(n,u),i.error(u)},function(){var u,c;a&&((u=n.unsubscribe)===null||u===void 0||u.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):U}var $c=l(()=>{z();S();E();ve()});function Xr(r,e){return d(function(t,n){var o=e??{},i=o.leading,s=i===void 0?!0:i,a=o.trailing,u=a===void 0?!1:a,c=!1,f=null,p=null,v=!1,m=function(){p?.unsubscribe(),p=null,u&&(g(),v&&n.complete())},b=function(){p=null,v&&n.complete()},y=function(w){return p=x(r(w)).subscribe(h(n,m,b))},g=function(){if(c){c=!1;var w=f;f=null,n.next(w),!v&&y(w)}};t.subscribe(h(n,function(w){c=!0,f=w,!(p&&!p.closed)&&(s?g():y(w))},function(){v=!0,!(u&&c&&p&&!p.closed)&&n.complete()}))})}var gs=l(()=>{S();E();I()});function bs(r,e,t){e===void 0&&(e=Z);var n=be(r,e);return Xr(function(){return n},t)}var Oc=l(()=>{Ee();gs();Pt()});function ys(r){return r===void 0&&(r=Z),d(function(e,t){var n=r.now();e.subscribe(h(t,function(o){var i=r.now(),s=i-n;n=i,t.next(new gh(o,s))}))})}var gh,Tc=l(()=>{Ee();S();E();gh=(function(){function r(e,t){this.value=e,this.interval=t}return r})()});function xs(r,e,t){var n,o,i;if(t=t??Er,Ir(r)?n=r:typeof r=="number"&&(o=r),e)i=function(){return e};else throw new TypeError("No observable provided to switch to");if(n==null&&o==null)throw new TypeError("No timeout provided.");return Pr({first:n,each:o,scheduler:t,with:i})}var Cc=l(()=>{Ee();qo();In()});function ws(r){return r===void 0&&(r=Kt),Y(function(e){return{value:e,timestamp:r.now()}})}var Ic=l(()=>{vo();bt()});function _s(r){return d(function(e,t){var n=new R;t.next(n.asObservable());var o=function(i){n.error(i),t.error(i)};return e.subscribe(h(t,function(i){return n?.next(i)},function(){n.complete(),t.complete()},o)),x(r).subscribe(h(t,function(){n.complete(),t.next(n=new R)},j,o)),function(){n?.unsubscribe(),n=null}})}var Pc=l(()=>{ge();S();E();he();I()});function Ss(r,e){e===void 0&&(e=0);var t=e>0?e:r;return d(function(n,o){var i=[new R],s=[],a=0;o.next(i[0].asObservable()),n.subscribe(h(o,function(u){var c,f;try{for(var p=Q(i),v=p.next();!v.done;v=p.next()){var m=v.value;m.next(u)}}catch(g){c={error:g}}finally{try{v&&!v.done&&(f=p.return)&&f.call(p)}finally{if(c)throw c.error}}var b=a-r+1;if(b>=0&&b%t===0&&i.shift().complete(),++a%t===0){var y=new R;i.push(y),o.next(y.asObservable())}},function(){for(;i.length>0;)i.shift().complete();o.complete()},function(u){for(;i.length>0;)i.shift().error(u);o.error(u)},function(){s=null,i=null}))})}var kc=l(()=>{T();ge();S();E()});function As(r){for(var e,t,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var i=(e=pe(n))!==null&&e!==void 0?e:Z,s=(t=n[0])!==null&&t!==void 0?t:null,a=n[1]||1/0;return d(function(u,c){var f=[],p=!1,v=function(g){var w=g.window,F=g.subs;w.complete(),F.unsubscribe(),de(f,g),p&&m()},m=function(){if(f){var g=new K;c.add(g);var w=new R,F={window:w,subs:g,seen:0};f.push(F),c.next(w.asObservable()),re(g,i,function(){return v(F)},r)}};s!==null&&s>=0?re(c,i,m,s,!0):p=!0,m();var b=function(g){return f.slice().forEach(g)},y=function(g){b(function(w){var F=w.window;return g(F)}),g(c),c.unsubscribe()};return u.subscribe(h(c,function(g){b(function(w){w.window.next(g),a<=++w.seen&&v(w)})},function(){return y(function(g){return g.complete()})},function(g){return y(function(w){return w.error(g)})})),function(){f=null}})}var Rc=l(()=>{ge();Ee();Ie();S();E();mt();$e();vt()});function Es(r,e){return d(function(t,n){var o=[],i=function(s){for(;0<o.length;)o.shift().error(s);n.error(s)};x(r).subscribe(h(n,function(s){var a=new R;o.push(a);var u=new K,c=function(){de(o,a),a.complete(),u.unsubscribe()},f;try{f=x(e(s))}catch(p){i(p);return}n.next(a.asObservable()),u.add(f.subscribe(h(n,c,j,i)))},j)),t.subscribe(h(n,function(s){var a,u,c=o.slice();try{for(var f=Q(c),p=f.next();!p.done;p=f.next()){var v=p.value;v.next(s)}}catch(m){a={error:m}}finally{try{p&&!p.done&&(u=f.return)&&u.call(f)}finally{if(a)throw a.error}}},function(){for(;0<o.length;)o.shift().complete();n.complete()},i,function(){for(;0<o.length;)o.shift().unsubscribe()}))})}var jc=l(()=>{T();ge();Ie();S();I();E();he();mt()});function $s(r){return d(function(e,t){var n,o,i=function(a){n.error(a),t.error(a)},s=function(){o?.unsubscribe(),n?.complete(),n=new R,t.next(n.asObservable());var a;try{a=x(r())}catch(u){i(u);return}a.subscribe(o=h(t,s,s,i))};s(),e.subscribe(h(t,function(a){return n.next(a)},function(){n.complete(),t.complete()},i,function(){o?.unsubscribe(),n=null}))})}var Mc=l(()=>{ge();S();E();I()});function Os(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=tt(r);return d(function(n,o){for(var i=r.length,s=new Array(i),a=r.map(function(){return!1}),u=!1,c=function(p){x(r[p]).subscribe(h(o,function(v){s[p]=v,!u&&!a[p]&&(a[p]=!0,(u=a.every(U))&&(a=null))},j))},f=0;f<i;f++)c(f);n.subscribe(h(o,function(p){if(u){var v=O([p],$(s));o.next(t?t.apply(void 0,O([],$(v))):v)}}))})}var Lc=l(()=>{T();S();E();I();ve();he();$e()});function Ts(r){return ii(Lr,r)}var Fc=l(()=>{Go();bu()});function Cs(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return d(function(t,n){Lr.apply(void 0,O([t],$(r))).subscribe(n)})}var Uc=l(()=>{T();Go();S()});function Is(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Cs.apply(void 0,O([],$(r)))}var qc=l(()=>{T();Uc()});var en={};H(en,{ArgumentOutOfRangeError:()=>Cn,AsyncSubject:()=>_r,BehaviorSubject:()=>ho,ConnectableObservable:()=>Et,EMPTY:()=>X,EmptyError:()=>Oe,NEVER:()=>ou,NotFoundError:()=>Fo,Notification:()=>Cr,NotificationKind:()=>jo,ObjectUnsubscribedError:()=>mo,Observable:()=>A,ReplaySubject:()=>wr,Scheduler:()=>On,SequenceError:()=>Uo,Subject:()=>R,Subscriber:()=>Bt,Subscription:()=>K,TimeoutError:()=>Qa,UnsubscriptionError:()=>dr,VirtualAction:()=>Ma,VirtualTimeScheduler:()=>gf,animationFrame:()=>hf,animationFrameScheduler:()=>ja,animationFrames:()=>Wl,asap:()=>rf,asapScheduler:()=>ka,async:()=>Er,asyncScheduler:()=>Z,audit:()=>Fr,auditTime:()=>Qo,bindCallback:()=>jf,bindNodeCallback:()=>Lf,buffer:()=>Zo,bufferCount:()=>Xo,bufferTime:()=>ei,bufferToggle:()=>ti,bufferWhen:()=>ri,catchError:()=>Le,combineAll:()=>ai,combineLatest:()=>Wo,combineLatestAll:()=>qr,combineLatestWith:()=>ui,concat:()=>Ve,concatAll:()=>It,concatMap:()=>Jt,concatMapTo:()=>li,concatWith:()=>pi,config:()=>Pe,connect:()=>kt,connectable:()=>qf,count:()=>mi,debounce:()=>di,debounceTime:()=>hi,defaultIfEmpty:()=>st,defer:()=>je,delay:()=>yi,delayWhen:()=>Qt,dematerialize:()=>xi,distinct:()=>wi,distinctUntilChanged:()=>Rt,distinctUntilKeyChanged:()=>Si,elementAt:()=>Ai,empty:()=>yf,endWith:()=>zr,every:()=>Ei,exhaust:()=>Ti,exhaustAll:()=>Hr,exhaustMap:()=>Zt,expand:()=>Ci,filter:()=>ie,finalize:()=>jt,find:()=>Ii,findIndex:()=>ki,first:()=>Ri,firstValueFrom:()=>kf,flatMap:()=>Di,forkJoin:()=>Nf,from:()=>oe,fromEvent:()=>Ho,fromEventPattern:()=>ru,generate:()=>Bf,groupBy:()=>ji,identity:()=>U,ignoreElements:()=>xt,iif:()=>Yf,interval:()=>Bo,isEmpty:()=>Mi,isObservable:()=>Lo,last:()=>Fi,lastValueFrom:()=>If,map:()=>Y,mapTo:()=>Wr,materialize:()=>Ui,max:()=>qi,merge:()=>Mr,mergeAll:()=>it,mergeMap:()=>J,mergeMapTo:()=>Ni,mergeScan:()=>Wi,mergeWith:()=>zi,min:()=>Hi,multicast:()=>Mt,never:()=>Qf,noop:()=>j,observable:()=>At,observeOn:()=>rt,of:()=>xe,onErrorResumeNext:()=>Ko,onErrorResumeNextWith:()=>Zu,pairs:()=>Zf,pairwise:()=>Bi,partition:()=>ep,pipe:()=>yr,pluck:()=>Ki,publish:()=>Yi,publishBehavior:()=>Gi,publishLast:()=>Ji,publishReplay:()=>Qi,queue:()=>cf,queueScheduler:()=>Ra,race:()=>rp,raceWith:()=>Kr,range:()=>np,reduce:()=>Fe,refCount:()=>xr,repeat:()=>Xi,repeatWhen:()=>es,retry:()=>ts,retryWhen:()=>rs,sample:()=>Yr,sampleTime:()=>os,scan:()=>is,scheduled:()=>ko,sequenceEqual:()=>ss,share:()=>Gr,shareReplay:()=>Jr,single:()=>us,skip:()=>cs,skipLast:()=>ls,skipUntil:()=>fs,skipWhile:()=>ps,startWith:()=>ms,subscribeOn:()=>nt,switchAll:()=>ds,switchMap:()=>ee,switchMapTo:()=>hs,switchScan:()=>vs,take:()=>ye,takeLast:()=>Br,takeUntil:()=>Zr,takeWhile:()=>Lt,tap:()=>ut,throttle:()=>Xr,throttleTime:()=>bs,throwError:()=>Ot,throwIfEmpty:()=>at,timeInterval:()=>ys,timeout:()=>Pr,timeoutWith:()=>xs,timer:()=>be,timestamp:()=>ws,toArray:()=>Ur,using:()=>ip,window:()=>_s,windowCount:()=>Ss,windowTime:()=>As,windowToggle:()=>Es,windowWhen:()=>$s,withLatestFrom:()=>Os,zip:()=>Lr,zipAll:()=>Ts,zipWith:()=>Is});var Ue=l(()=>{B();An();wn();zl();ge();Oa();go();bo();nf();Ee();lf();vf();bf();Pa();Ie();br();Mo();_n();he();ve();Cf();Pf();Rf();Ya();Tt();Ga();$a();Ja();In();ha();Mf();Ff();Vo();kn();Df();Rn();We();Wf();gt();zf();Hf();Kf();Gf();nu();Jf();iu();Ro();su();Xf();tp();cu();op();Ba();Pt();sp();Go();Ha();We();iu();ap();hr();Jo();lu();fu();pu();mu();du();hu();vu();yu();si();wu();Pn();ci();_u();Au();Mn();Eu();$u();Ou();Dr();Tu();bi();Cu();Iu();_i();Pu();ku();Ru();ju();Mu();Oi();$i();Lu();yt();Fu();Pi();qu();Du();Nu();vi();Wu();Vu();bt();gi();zu();Hu();jr();Bu();ot();Ku();Yu();Ju();Qu();Ln();Or();Xu();ec();tc();rc();nc();oc();ic();Zi();Gt();sc();ac();uc();cc();po();ns();lc();fc();pc();as();dc();hc();vc();gc();bc();yc();xc();Tr();wc();Qr();_c();Sc();Nr();Li();Ac();Ec();$c();gs();Oc();Vr();Tc();In();Cc();Ic();oi();Pc();kc();Rc();jc();Mc();Lc();Fc();qc()});function pp(r,e){return function(t){return[ie(r,e)(t),ie(Yo(r,e))(t)]}}var mp=l(()=>{au();yt()});function dp(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Kr.apply(void 0,O([],$(Me(r))))}var hp=l(()=>{T();Yt();Zi()});var Xt={};H(Xt,{audit:()=>Fr,auditTime:()=>Qo,buffer:()=>Zo,bufferCount:()=>Xo,bufferTime:()=>ei,bufferToggle:()=>ti,bufferWhen:()=>ri,catchError:()=>Le,combineAll:()=>ai,combineLatest:()=>jn,combineLatestAll:()=>qr,combineLatestWith:()=>ui,concat:()=>fi,concatAll:()=>It,concatMap:()=>Jt,concatMapTo:()=>li,concatWith:()=>pi,connect:()=>kt,count:()=>mi,debounce:()=>di,debounceTime:()=>hi,defaultIfEmpty:()=>st,delay:()=>yi,delayWhen:()=>Qt,dematerialize:()=>xi,distinct:()=>wi,distinctUntilChanged:()=>Rt,distinctUntilKeyChanged:()=>Si,elementAt:()=>Ai,endWith:()=>zr,every:()=>Ei,exhaust:()=>Ti,exhaustAll:()=>Hr,exhaustMap:()=>Zt,expand:()=>Ci,filter:()=>ie,finalize:()=>jt,find:()=>Ii,findIndex:()=>ki,first:()=>Ri,flatMap:()=>Di,groupBy:()=>ji,ignoreElements:()=>xt,isEmpty:()=>Mi,last:()=>Fi,map:()=>Y,mapTo:()=>Wr,materialize:()=>Ui,max:()=>qi,merge:()=>Vi,mergeAll:()=>it,mergeMap:()=>J,mergeMapTo:()=>Ni,mergeScan:()=>Wi,mergeWith:()=>zi,min:()=>Hi,multicast:()=>Mt,observeOn:()=>rt,onErrorResumeNext:()=>lp,pairwise:()=>Bi,partition:()=>pp,pluck:()=>Ki,publish:()=>Yi,publishBehavior:()=>Gi,publishLast:()=>Ji,publishReplay:()=>Qi,race:()=>dp,raceWith:()=>Kr,reduce:()=>Fe,refCount:()=>xr,repeat:()=>Xi,repeatWhen:()=>es,retry:()=>ts,retryWhen:()=>rs,sample:()=>Yr,sampleTime:()=>os,scan:()=>is,sequenceEqual:()=>ss,share:()=>Gr,shareReplay:()=>Jr,single:()=>us,skip:()=>cs,skipLast:()=>ls,skipUntil:()=>fs,skipWhile:()=>ps,startWith:()=>ms,subscribeOn:()=>nt,switchAll:()=>ds,switchMap:()=>ee,switchMapTo:()=>hs,switchScan:()=>vs,take:()=>ye,takeLast:()=>Br,takeUntil:()=>Zr,takeWhile:()=>Lt,tap:()=>ut,throttle:()=>Xr,throttleTime:()=>bs,throwIfEmpty:()=>at,timeInterval:()=>ys,timeout:()=>Pr,timeoutWith:()=>xs,timestamp:()=>ws,toArray:()=>Ur,window:()=>_s,windowCount:()=>Ss,windowTime:()=>As,windowToggle:()=>Es,windowWhen:()=>$s,withLatestFrom:()=>Os,zip:()=>Cs,zipAll:()=>Ts,zipWith:()=>Is});var ze=l(()=>{Jo();lu();fu();pu();mu();du();hu();vu();yu();si();xu();wu();Su();Pn();ci();_u();Au();Mn();Eu();$u();Ou();Dr();Tu();bi();Cu();Iu();_i();Pu();ku();Ru();ju();Mu();Oi();$i();Lu();yt();Fu();Pi();qu();Du();Nu();vi();Wu();Vu();bt();gi();zu();Hu();Gu();jr();Bu();ot();Ku();Yu();Ju();Qu();Ln();Or();Xu();ec();mp();tc();rc();nc();oc();ic();hp();Zi();Gt();sc();ac();uc();cc();po();ns();lc();fc();pc();as();dc();hc();vc();gc();bc();yc();xc();Tr();wc();Qr();_c();Sc();Nr();Li();Ac();Ec();$c();gs();Oc();Vr();Tc();In();Cc();Ic();oi();Pc();kc();Rc();jc();Mc();Lc();Uc();Fc();qc()});var qs={};H(qs,{_$LH:()=>sn,html:()=>Mp,noChange:()=>L,nothing:()=>q,render:()=>Ft,svg:()=>Lp});function rr(r,e,t=r,n){var o,i,s,a;if(e===L)return e;let u=n!==void 0?(o=t._$Co)===null||o===void 0?void 0:o[n]:t._$Cl,c=Wn(e)?void 0:e._$litDirective$;return u?.constructor!==c&&((i=u?._$AO)===null||i===void 0||i.call(u,!1),c===void 0?u=void 0:(u=new c(r),u._$AT(r,t,n)),n!==void 0?((s=(a=t)._$Co)!==null&&s!==void 0?s:a._$Co=[])[n]=u:t._$Cl=u),u!==void 0&&(e=rr(r,u._$AS(r,e.values),u,n)),e}var Wc,Rs,rn,Ap,wt,Vc,Sh,nn,Nn,Wn,Pp,kp,Dn,Ep,$p,tr,Op,Tp,Rp,jp,Mp,Lp,L,q,Cp,tn,Fp,Vn,js,on,nr,Ms,Ah,Ls,Fs,Us,sn,Ip,Ft,te=l(()=>{Rs=window,rn=Rs.trustedTypes,Ap=rn?rn.createPolicy("lit-html",{createHTML:r=>r}):void 0,wt=`lit$${(Math.random()+"").slice(9)}$`,Vc="?"+wt,Sh=`<${Vc}>`,nn=document,Nn=(r="")=>nn.createComment(r),Wn=r=>r===null||typeof r!="object"&&typeof r!="function",Pp=Array.isArray,kp=r=>Pp(r)||typeof r?.[Symbol.iterator]=="function",Dn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ep=/-->/g,$p=/>/g,tr=RegExp(`>|[
|
|
1
|
+
(()=>{var Qs=Object.create;var wt=Object.defineProperty;var lo=Object.getOwnPropertyDescriptor;var ea=Object.getOwnPropertyNames;var ta=Object.getPrototypeOf,ra=Object.prototype.hasOwnProperty;var y=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(n){throw t=[n],n}};var xe=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},I=(r,e)=>{for(var t in e)wt(r,t,{get:e[t],enumerable:!0})},co=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ea(e))!ra.call(r,o)&&o!==t&&wt(r,o,{get:()=>e[o],enumerable:!(n=lo(e,o))||n.enumerable});return r};var sn=(r,e,t)=>(t=r!=null?Qs(ta(r)):{},co(e||!r||!r.__esModule?wt(t,"default",{value:r,enumerable:!0}):t,r)),C=r=>co(wt({},"__esModule",{value:!0}),r),N=(r,e,t,n)=>{for(var o=n>1?void 0:n?lo(e,t):e,i=r.length-1,s;i>=0;i--)(s=r[i])&&(o=(n?s(e,t,o):s(o))||o);return n&&o&&wt(e,t,o),o};var Mr={};I(Mr,{_$LH:()=>lt,html:()=>li,noChange:()=>A,nothing:()=>E,render:()=>Ce,svg:()=>ci});function ze(r,e,t=r,n){var o,i,s,l;if(e===A)return e;let a=n!==void 0?(o=t._$Co)===null||o===void 0?void 0:o[n]:t._$Cl,c=Ut(e)?void 0:e._$litDirective$;return a?.constructor!==c&&((i=a?._$AO)===null||i===void 0||i.call(a,!1),c===void 0?a=void 0:(a=new c(r),a._$AT(r,t,n)),n!==void 0?((s=(l=t)._$Co)!==null&&s!==void 0?s:l._$Co=[])[n]=a:t._$Cl=a),a!==void 0&&(e=ze(r,a._$AS(r,e.values),a,n)),e}var En,Tr,it,Zo,Se,Cn,Ra,st,Lt,Ut,oi,ii,jt,Xo,Qo,We,ei,ti,si,ai,li,ci,A,E,ri,ot,ui,Dt,Or,at,Ve,kr,Ma,Pr,Ir,Rr,lt,ni,Ce,L=y(()=>{Tr=window,it=Tr.trustedTypes,Zo=it?it.createPolicy("lit-html",{createHTML:r=>r}):void 0,Se=`lit$${(Math.random()+"").slice(9)}$`,Cn="?"+Se,Ra=`<${Cn}>`,st=document,Lt=(r="")=>st.createComment(r),Ut=r=>r===null||typeof r!="object"&&typeof r!="function",oi=Array.isArray,ii=r=>oi(r)||typeof r?.[Symbol.iterator]=="function",jt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Xo=/-->/g,Qo=/>/g,We=RegExp(`>|[
|
|
4
2
|
\f\r](?:([^\\s"'>=/]+)([
|
|
5
3
|
\f\r]*=[
|
|
6
4
|
\f\r]*(?:[^
|
|
7
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
5
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ei=/'/g,ti=/"/g,si=/^(?:script|style|textarea|title)$/i,ai=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),li=ai(1),ci=ai(2),A=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),ri=new WeakMap,ot=st.createTreeWalker(st,129,null,!1),ui=(r,e)=>{let t=r.length-1,n=[],o,i=e===2?"<svg>":"",s=jt;for(let a=0;a<t;a++){let c=r[a],u,p,d=-1,f=0;for(;f<c.length&&(s.lastIndex=f,p=s.exec(c),p!==null);)f=s.lastIndex,s===jt?p[1]==="!--"?s=Xo:p[1]!==void 0?s=Qo:p[2]!==void 0?(si.test(p[2])&&(o=RegExp("</"+p[2],"g")),s=We):p[3]!==void 0&&(s=We):s===We?p[0]===">"?(s=o??jt,d=-1):p[1]===void 0?d=-2:(d=s.lastIndex-p[2].length,u=p[1],s=p[3]===void 0?We:p[3]==='"'?ti:ei):s===ti||s===ei?s=We:s===Xo||s===Qo?s=jt:(s=We,o=void 0);let v=s===We&&r[a+1].startsWith("/>")?" ":"";i+=s===jt?c+Ra:d>=0?(n.push(u),c.slice(0,d)+"$lit$"+c.slice(d)+Se+v):c+Se+(d===-2?(n.push(void 0),a):v)}let l=i+(r[t]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return[Zo!==void 0?Zo.createHTML(l):l,n]},Dt=class r{constructor({strings:e,_$litType$:t},n){let o;this.parts=[];let i=0,s=0,l=e.length-1,a=this.parts,[c,u]=ui(e,t);if(this.el=r.createElement(c,n),ot.currentNode=this.el.content,t===2){let p=this.el.content,d=p.firstChild;d.remove(),p.append(...d.childNodes)}for(;(o=ot.nextNode())!==null&&a.length<l;){if(o.nodeType===1){if(o.hasAttributes()){let p=[];for(let d of o.getAttributeNames())if(d.endsWith("$lit$")||d.startsWith(Se)){let f=u[s++];if(p.push(d),f!==void 0){let v=o.getAttribute(f.toLowerCase()+"$lit$").split(Se),h=/([.?@])?(.*)/.exec(f);a.push({type:1,index:i,name:h[2],strings:v,ctor:h[1]==="."?kr:h[1]==="?"?Pr:h[1]==="@"?Ir:Ve})}else a.push({type:6,index:i})}for(let d of p)o.removeAttribute(d)}if(si.test(o.tagName)){let p=o.textContent.split(Se),d=p.length-1;if(d>0){o.textContent=it?it.emptyScript:"";for(let f=0;f<d;f++)o.append(p[f],Lt()),ot.nextNode(),a.push({type:2,index:++i});o.append(p[d],Lt())}}}else if(o.nodeType===8)if(o.data===Cn)a.push({type:2,index:i});else{let p=-1;for(;(p=o.data.indexOf(Se,p+1))!==-1;)a.push({type:7,index:i}),p+=Se.length-1}i++}}static createElement(e,t){let n=st.createElement("template");return n.innerHTML=e,n}};Or=class{constructor(e,t){this.u=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(e){var t;let{el:{content:n},parts:o}=this._$AD,i=((t=e?.creationScope)!==null&&t!==void 0?t:st).importNode(n,!0);ot.currentNode=i;let s=ot.nextNode(),l=0,a=0,c=o[0];for(;c!==void 0;){if(l===c.index){let u;c.type===2?u=new at(s,s.nextSibling,this,e):c.type===1?u=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(u=new Rr(s,this,e)),this.u.push(u),c=o[++a]}l!==c?.index&&(s=ot.nextNode(),l++)}return i}p(e){let t=0;for(let n of this.u)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},at=class r{constructor(e,t,n,o){var i;this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=o,this._$Cm=(i=o?.isConnected)===null||i===void 0||i}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cm}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=ze(this,e,t),Ut(e)?e===E||e==null||e===""?(this._$AH!==E&&this._$AR(),this._$AH=E):e!==this._$AH&&e!==A&&this.g(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ii(e)?this.k(e):this.g(e)}O(e,t=this._$AB){return this._$AA.parentNode.insertBefore(e,t)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}g(e){this._$AH!==E&&Ut(this._$AH)?this._$AA.nextSibling.data=e:this.T(st.createTextNode(e)),this._$AH=e}$(e){var t;let{values:n,_$litType$:o}=e,i=typeof o=="number"?this._$AC(e):(o.el===void 0&&(o.el=Dt.createElement(o.h,this.options)),o);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===i)this._$AH.p(n);else{let s=new Or(i,this),l=s.v(this.options);s.p(n),this.T(l),this._$AH=s}}_$AC(e){let t=ri.get(e.strings);return t===void 0&&ri.set(e.strings,t=new Dt(e)),t}k(e){oi(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,o=0;for(let i of e)o===t.length?t.push(n=new r(this.O(Lt()),this.O(Lt()),this,this.options)):n=t[o],n._$AI(i),o++;o<t.length&&(this._$AR(n&&n._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,t);e&&e!==this._$AB;){let o=e.nextSibling;e.remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cm=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}},Ve=class{constructor(e,t,n,o,i){this.type=1,this._$AH=E,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=i,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=E}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,o){let i=this.strings,s=!1;if(i===void 0)e=ze(this,e,t,0),s=!Ut(e)||e!==this._$AH&&e!==A,s&&(this._$AH=e);else{let l=e,a,c;for(e=i[0],a=0;a<i.length-1;a++)c=ze(this,l[n+a],t,a),c===A&&(c=this._$AH[a]),s||(s=!Ut(c)||c!==this._$AH[a]),c===E?e=E:e!==E&&(e+=(c??"")+i[a+1]),this._$AH[a]=c}s&&!o&&this.j(e)}j(e){e===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},kr=class extends Ve{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===E?void 0:e}},Ma=it?it.emptyScript:"",Pr=class extends Ve{constructor(){super(...arguments),this.type=4}j(e){e&&e!==E?this.element.setAttribute(this.name,Ma):this.element.removeAttribute(this.name)}},Ir=class extends Ve{constructor(e,t,n,o,i){super(e,t,n,o,i),this.type=5}_$AI(e,t=this){var n;if((e=(n=ze(this,e,t,0))!==null&&n!==void 0?n:E)===A)return;let o=this._$AH,i=e===E&&o!==E||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,s=e!==E&&(o===E||i);i&&this.element.removeEventListener(this.name,this,o),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,n;typeof this._$AH=="function"?this._$AH.call((n=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}},Rr=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ze(this,e)}},lt={P:"$lit$",A:Se,M:Cn,C:1,L:ui,R:Or,D:ii,V:ze,I:at,H:Ve,N:Pr,U:Ir,B:kr,F:Rr},ni=Tr.litHtmlPolyfillSupport;ni?.(Dt,at),((En=Tr.litHtmlVersions)!==null&&En!==void 0?En:Tr.litHtmlVersions=[]).push("2.5.0");Ce=(r,e,t)=>{var n,o;let i=(n=t?.renderBefore)!==null&&n!==void 0?n:e,s=i._$litPart$;if(s===void 0){let l=(o=t?.renderBefore)!==null&&o!==void 0?o:null;i._$litPart$=s=new at(e.insertBefore(Lt(),l),l,void 0,t??{})}return s._$AI(r),s}});var fi=xe(ct=>{"use strict";var ja=ct&&ct.__setFunctionName||function(r,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:t?"".concat(t," ",e):e})};Object.defineProperty(ct,"__esModule",{value:!0});ct.Component=void 0;var pi=(L(),C(Mr)),La=(r,e,t)=>(window.customElements.define(r,e,t),e),Ua=(r,e,t)=>{let{kind:n,elements:o}=e;return{kind:n,elements:o,finisher(i){window.customElements.define(r,i,t)}}},Da=r=>typeof r=="function",qa=(r,e={})=>t=>{var n,o;if(!((n=window._excluded_components)===null||n===void 0)&&n.includes(e.selector))return t;if(!r||r&&r.indexOf("-")<=0)throw new Error(`You need at least 1 dash in the custom element name! ${t}`);e.styles=e.styles||[],e.components=e.components||[];let i=t.prototype.OnInit||function(){},s=t.prototype.OnDestroy||function(){},l=t.prototype.OnUpdate||function(){},a=t.prototype.OnUpdateFirst||function(){},c=t.prototype.connectedCallback||function(){},u=t.prototype.disconnectedCallback||function(){},p=t.prototype.update||function(){},d=t.prototype.firstUpdated||function(){};e.template||(e.template=t.prototype.render||(()=>(0,pi.html)``)),e.style&&e.styles.push(e.style);let f=(o=class extends t{static is(){return r}getTemplateResult(){return this}OnInit(){if(e.container&&((0,pi.render)(e.template.call(this),e.container),e.style)){let h=document.createElement("style");h.type="text/css",h.styleSheet?h.styleSheet.cssText=e.style.toString():h.appendChild(document.createTextNode(e.style.toString())),e.container.prepend(h)}return i.call(this)}disconnectedCallback(){var h;s.call(this),u.call(this),(h=this._registry)===null||h===void 0||h.unsubscribe(),this._registry=null}connectedCallback(){var h,m;if(c.call(this),i.call(this),Da(e.registry)&&(this._registry=e.registry.call(this)),!((h=e.modifiers)===null||h===void 0)&&h.length)for(let b of e.modifiers){if(!b)throw new Error(`Provided null value inside modifiers for component "${e.selector}"`);if(!b.options)throw new Error(`Missing options for attribute inside ${e.selector}`);if(!(!((m=b.options)===null||m===void 0)&&m.selector))throw new Error(`Missing attribute selector inside component "${e.selector}"`);if(!this._registry&&typeof b.options.registry=="function"&&(this._registry=b.options.registry.call(this)),!this._registry)throw new Error(`Missing attribute registry for attribute "${b.options.selector}" and no default registry specified inside component "${e.selector}"`);this._registry.define(b.options.selector,b)}}render(){return e.template.call(this)}update(){p.call(this),l.call(this)}firstUpdated(){d.call(this),a.call(this)}},ja(o,"ModifiedClass"),o.styles=e.styles,o),v=window.customElements.get(r);return v?(console.error(`** IMPORTANT!!! **
|
|
8
6
|
------------------------------------------
|
|
9
7
|
< ${r} > </${r}> Component re-defined multiple times and it is already registered inside customElements registry
|
|
10
8
|
Possible Solutions:
|
|
@@ -14,26 +12,28 @@ Possible Solutions:
|
|
|
14
12
|
|
|
15
13
|
** If this is Server Side Rendering you can ignore this message **
|
|
16
14
|
------------------------------------------
|
|
17
|
-
`),
|
|
18
|
-
`),so.content.appendChild(ao)),e.add(pr),t.delete(pr),window.ShadyCSS.prepareTemplateStyles(so,pr),Tl&&window.ShadyCSS.nativeShadow&&(ao=so.content.querySelector("style"))!==null&&so.content.appendChild(ao)})(F,Qe),c.removeChild(f),(g=window.ShadyCSS)===null||g===void 0?void 0:g.nativeShadow){var Ze=Qe.content.querySelector("style");Ze!==null&&c.appendChild(Ze.cloneNode(!0))}w.insertBefore(c,Se),this._$AA=ae,this._$AB=Se}else v.call(this,m,b)},p._$AC=function(m){var b,y=(b=this.options)===null||b===void 0?void 0:b.scope,g=a.get(y);g===void 0&&a.set(y,g=new Map);var w=g.get(m.strings);return w===void 0&&g.set(m.strings,w=new n(m,this.options)),w}}})}))});var Ws,Gn,Gc,Xp,ln,Jc,em,Vs,Jn,Qc=l(()=>{Ws=window,Gn=Ws.ShadowRoot&&(Ws.ShadyCSS===void 0||Ws.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Gc=Symbol(),Xp=new WeakMap,ln=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Gc)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Gn&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Xp.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Xp.set(t,e))}return e}toString(){return this.cssText}},Jc=r=>new ln(typeof r=="string"?r:r+"",void 0,Gc),em=(r,...e)=>{let t=r.length===1?r[0]:e.reduce(((n,o,i)=>n+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+r[i+1]),r[0]);return new ln(t,r,Gc)},Vs=(r,e)=>{Gn?r.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((t=>{let n=document.createElement("style"),o=Ws.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=t.cssText,r.appendChild(n)}))},Jn=Gn?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Jc(t)})(r):r});var Zc,zs,tm,Jh,rm,Hs,el,Xc,Ke,Bs=l(()=>{Qc();Qc();zs=window,tm=zs.trustedTypes,Jh=tm?tm.emptyScript:"",rm=zs.reactiveElementPolyfillSupport,Hs={toAttribute(r,e){switch(e){case Boolean:r=r?Jh:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},el=(r,e)=>e!==r&&(e==e||r==r),Xc={attribute:!0,type:String,converter:Hs,reflect:!1,hasChanged:el},Ke=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach(((t,n)=>{let o=this._$Ep(n,t);o!==void 0&&(this._$Ev.set(o,n),e.push(o))})),e}static createProperty(e,t=Xc){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,o=this.getPropertyDescriptor(e,n,t);o!==void 0&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(o){let i=this[e];this[t]=o,this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Xc}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let o of n)this.createProperty(o,t[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let o of n)t.unshift(Jn(o))}else e!==void 0&&t.push(Jn(e));return t}static _$Ep(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach((t=>t(this)))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;let t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Vs(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach((t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)}))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach((t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)}))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=Xc){var o;let i=this.constructor._$Ep(e,n);if(i!==void 0&&n.reflect===!0){let s=(((o=n.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?n.converter:Hs).toAttribute(t,n.type);this._$El=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$El=null}}_$AK(e,t){var n;let o=this.constructor,i=o._$Ev.get(e);if(i!==void 0&&this._$El!==i){let s=o.getPropertyOptions(i),a=typeof s.converter=="function"?{fromAttribute:s.converter}:((n=s.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?s.converter:Hs;this._$El=i,this[i]=a.fromAttribute(t,s.type),this._$El=null}}requestUpdate(e,t,n){let o=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||el)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((o,i)=>this[i]=o)),this._$Ei=void 0);let t=!1,n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach((o=>{var i;return(i=o.hostUpdate)===null||i===void 0?void 0:i.call(o)})),this.update(n)):this._$Ek()}catch(o){throw t=!1,this._$Ek(),o}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach((n=>{var o;return(o=n.hostUpdated)===null||o===void 0?void 0:o.call(n)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach(((t,n)=>this._$EO(n,this[n],t))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Ke.finalized=!0,Ke.elementProperties=new Map,Ke.elementStyles=[],Ke.shadowRootOptions={mode:"open"},rm?.({ReactiveElement:Ke}),((Zc=zs.reactiveElementVersions)!==null&&Zc!==void 0?Zc:zs.reactiveElementVersions=[]).push("1.5.0")});var tl,rl,om,Dt,nm,im,sm=l(()=>{Bs();Bs();te();te();om=Ke,Dt=class extends Ke{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let n=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=n.firstChild),n}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ft(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return L}};Dt.finalized=!0,Dt._$litElement$=!0,(tl=globalThis.litElementHydrateSupport)===null||tl===void 0||tl.call(globalThis,{LitElement:Dt});nm=globalThis.litElementPolyfillSupport;nm?.({LitElement:Dt});im={_$AK:(r,e,t)=>{r._$AK(e,t)},_$AL:r=>r._$AL};((rl=globalThis.litElementVersions)!==null&&rl!==void 0?rl:globalThis.litElementVersions=[]).push("3.2.2")});var Qh,Zh,ke,Nt=l(()=>{Qh=(r,e,t)=>{Object.defineProperty(e,t,r)},Zh=(r,e)=>({kind:"method",placement:"prototype",key:e.key,descriptor:r}),ke=({finisher:r,descriptor:e})=>(t,n)=>{var o;if(n===void 0){let i=(o=t.originalKey)!==null&&o!==void 0?o:t.key,s=e!=null?{kind:"method",placement:"prototype",key:i,descriptor:e(t.key)}:{...t,key:i};return r!=null&&(s.finisher=function(a){r(a,i)}),s}{let i=t.constructor;e!==void 0&&Object.defineProperty(t,n,e(n)),r?.(i,n)}}});var Xh,am=l(()=>{Xh=r=>e=>typeof e=="function"?((t,n)=>(customElements.define(t,n),n))(r,e):((t,n)=>{let{kind:o,elements:i}=n;return{kind:o,elements:i,finisher(s){customElements.define(t,s)}}})(r,e)});function nl(r){return(e,t)=>t!==void 0?((n,o,i)=>{o.constructor.createProperty(i,n)})(r,e,t):ev(r,e)}var ev,ol=l(()=>{ev=(r,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,r)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,r)}}});function tv(r){return nl({...r,state:!0})}var um=l(()=>{ol();});function rv(r){return ke({finisher:(e,t)=>{Object.assign(e.prototype[t],r)}})}var cm=l(()=>{Nt();});function nv(r,e){return ke({descriptor:t=>{let n={get(){var o,i;return(i=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(r))!==null&&i!==void 0?i:null},enumerable:!0,configurable:!0};if(e){let o=typeof t=="symbol"?Symbol():"__"+t;n.get=function(){var i,s;return this[o]===void 0&&(this[o]=(s=(i=this.renderRoot)===null||i===void 0?void 0:i.querySelector(r))!==null&&s!==void 0?s:null),this[o]}}return n}})}var lm=l(()=>{Nt();});function ov(r){return ke({descriptor:e=>({get(){var t,n;return(n=(t=this.renderRoot)===null||t===void 0?void 0:t.querySelectorAll(r))!==null&&n!==void 0?n:[]},enumerable:!0,configurable:!0})})}var fm=l(()=>{Nt();});function iv(r){return ke({descriptor:e=>({async get(){var t;return await this.updateComplete,(t=this.renderRoot)===null||t===void 0?void 0:t.querySelector(r)},enumerable:!0,configurable:!0})})}var pm=l(()=>{Nt();});function sl(r){let{slot:e,selector:t}=r??{};return ke({descriptor:n=>({get(){var o;let i="slot"+(e?`[name=${e}]`:":not([name])"),s=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(i),a=s!=null?sv(s,r):[];return t?a.filter((u=>u.matches(t))):a},enumerable:!0,configurable:!0})})}var il,sv,al=l(()=>{Nt();sv=((il=window.HTMLSlotElement)===null||il===void 0?void 0:il.prototype.assignedElements)!=null?(r,e)=>r.assignedElements(e):(r,e)=>r.assignedNodes(e).filter((t=>t.nodeType===Node.ELEMENT_NODE))});function av(r,e,t){let n,o=r;return typeof r=="object"?(o=r.slot,n=r):n={flatten:e},t?sl({slot:o,flatten:e,selector:t}):ke({descriptor:i=>({get(){var s,a;let u="slot"+(o?`[name=${o}]`:":not([name])"),c=(s=this.renderRoot)===null||s===void 0?void 0:s.querySelector(u);return(a=c?.assignedNodes(n))!==null&&a!==void 0?a:[]},enumerable:!0,configurable:!0})})}var mm=l(()=>{Nt();al();});var dm={};H(dm,{CSSResult:()=>ln,LitElement:()=>Dt,ReactiveElement:()=>Ke,UpdatingElement:()=>om,_$LE:()=>im,_$LH:()=>sn,adoptStyles:()=>Vs,css:()=>em,customElement:()=>Xh,decorateProperty:()=>ke,defaultConverter:()=>Hs,eventOptions:()=>rv,getCompatibleStyle:()=>Jn,html:()=>Mp,legacyPrototypeMethod:()=>Qh,noChange:()=>L,notEqual:()=>el,nothing:()=>q,property:()=>nl,query:()=>nv,queryAll:()=>ov,queryAssignedElements:()=>sl,queryAssignedNodes:()=>av,queryAsync:()=>iv,render:()=>Ft,standardPrototypeMethod:()=>Zh,state:()=>tv,supportsAdoptingStyleSheets:()=>Gn,svg:()=>Lp,unsafeCSS:()=>Jc});var hm=l(()=>{Bs();te();sm();Nt();am();ol();um();cm();lm();fm();pm();al();mm();console.warn("The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information.")});var vm={};H(vm,{classMap:()=>uv});var uv,gm=l(()=>{te();ue();uv=D(class extends G{constructor(r){var e;if(super(r),r.type!==N.ATTRIBUTE||r.name!=="class"||((e=r.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter((e=>r[e])).join(" ")+" "}update(r,[e]){var t,n;if(this.nt===void 0){this.nt=new Set,r.strings!==void 0&&(this.st=new Set(r.strings.join(" ").split(/\s/).filter((i=>i!==""))));for(let i in e)e[i]&&!(!((t=this.st)===null||t===void 0)&&t.has(i))&&this.nt.add(i);return this.render(e)}let o=r.element.classList;this.nt.forEach((i=>{i in e||(o.remove(i),this.nt.delete(i))}));for(let i in e){let s=!!e[i];s===this.nt.has(i)||!((n=this.st)===null||n===void 0)&&n.has(i)||(s?(o.add(i),this.nt.add(i)):(o.remove(i),this.nt.delete(i)))}return L}})});var bm,fn,pn,ul=l(()=>{bm=async(r,e)=>{for await(let t of r)if(await e(t)===!1)return},fn=class{constructor(e){this.Y=e}disconnect(){this.Y=void 0}reconnect(e){this.Y=e}deref(){return this.Y}},pn=class{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){var e;(e=this.Z)!==null&&e!==void 0||(this.Z=new Promise((t=>this.q=t)))}resume(){var e;(e=this.q)===null||e===void 0||e.call(this),this.Z=this.q=void 0}}});var ym={};H(ym,{AsyncReplaceDirective:()=>mn,asyncReplace:()=>cv});var mn,cv,cl=l(()=>{te();cn();ul();ue();mn=class extends _t{constructor(){super(...arguments),this._$CK=new fn(this),this._$CX=new pn}render(e,t){return L}update(e,[t,n]){if(this.isConnected||this.disconnected(),t===this._$CJ)return;this._$CJ=t;let o=0,{_$CK:i,_$CX:s}=this;return bm(t,(async a=>{for(;s.get();)await s.get();let u=i.deref();if(u!==void 0){if(u._$CJ!==t)return!1;n!==void 0&&(a=n(a,o)),u.commitValue(a,o),o++}return!0})),L}commitValue(e,t){this.setValue(e)}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},cv=D(mn)});var xm={};H(xm,{asyncAppend:()=>lv});var lv,wm=l(()=>{ue();cl();lt();lv=D(class extends mn{constructor(r){if(super(r),r.type!==N.CHILD)throw Error("asyncAppend can only be used in child expressions")}update(r,e){return this._$Ctt=r,super.update(r,e)}commitValue(r,e){e===0&&Bn(this._$Ctt);let t=qe(this._$Ctt);Be(t,r)}})});var _m={};H(_m,{cache:()=>fv});var fv,Sm=l(()=>{te();ue();lt();fv=D(class extends G{constructor(r){super(r),this.et=new WeakMap}render(r){return[r]}update(r,[e]){if(qt(this.it)&&(!qt(e)||this.it.strings!==e.strings)){let t=un(r).pop(),n=this.et.get(this.it.strings);if(n===void 0){let o=document.createDocumentFragment();n=Ft(q,o),n.setConnected(!1),this.et.set(this.it.strings,n)}ct(n,[t]),qe(n,void 0,t)}if(qt(e)){if(!qt(this.it)||this.it.strings!==e.strings){let t=this.et.get(e.strings);if(t!==void 0){let n=un(t).pop();Bn(r),qe(r,void 0,n),ct(r,[n])}}this.it=e}else this.it=void 0;return this.render(e)}})});var Am={};H(Am,{guard:()=>mv});var pv,mv,Em=l(()=>{te();ue();pv={},mv=D(class extends G{constructor(){super(...arguments),this.ot=pv}render(r,e){return e()}update(r,[e,t]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every(((n,o)=>n===this.ot[o])))return L}else if(this.ot===e)return L;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,t)}})});var $m={};H($m,{ifDefined:()=>dv});var dv,Om=l(()=>{te();dv=r=>r??q});var Tm={};H(Tm,{live:()=>hv});var hv,Cm=l(()=>{te();ue();lt();hv=D(class extends G{constructor(r){if(super(r),r.type!==N.PROPERTY&&r.type!==N.ATTRIBUTE&&r.type!==N.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!or(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(r,[e]){if(e===L||e===q)return e;let t=r.element,n=r.name;if(r.type===N.PROPERTY){if(e===t[n])return L}else if(r.type===N.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(n))return L}else if(r.type===N.ATTRIBUTE&&t.getAttribute(n)===e+"")return L;return ct(r),e}})});var Im={};H(Im,{createRef:()=>vv,ref:()=>gv});var vv,fl,ll,gv,Pm=l(()=>{te();cn();ue();vv=()=>new fl,fl=class{},ll=new WeakMap,gv=D(class extends _t{render(r){return q}update(r,[e]){var t;let n=e!==this.Y;return n&&this.Y!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=e,this.dt=(t=r.options)===null||t===void 0?void 0:t.host,this.rt(this.ct=r.element)),q}rt(r){var e;if(typeof this.Y=="function"){let t=(e=this.dt)!==null&&e!==void 0?e:globalThis,n=ll.get(t);n===void 0&&(n=new WeakMap,ll.set(t,n)),n.get(this.Y)!==void 0&&this.Y.call(this.dt,void 0),n.set(this.Y,r),r!==void 0&&this.Y.call(this.dt,r)}else this.Y.value=r}get lt(){var r,e,t;return typeof this.Y=="function"?(e=ll.get((r=this.dt)!==null&&r!==void 0?r:globalThis))===null||e===void 0?void 0:e.get(this.Y):(t=this.Y)===null||t===void 0?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}})});var Rm={};H(Rm,{repeat:()=>bv});var km,bv,jm=l(()=>{te();ue();lt();km=(r,e,t)=>{let n=new Map;for(let o=e;o<=t;o++)n.set(r[o],o);return n},bv=D(class extends G{constructor(r){if(super(r),r.type!==N.CHILD)throw Error("repeat() can only be used in text expressions")}ht(r,e,t){let n;t===void 0?t=e:e!==void 0&&(n=e);let o=[],i=[],s=0;for(let a of r)o[s]=n?n(a,s):s,i[s]=t(a,s),s++;return{values:i,keys:o}}render(r,e,t){return this.ht(r,e,t).values}update(r,[e,t,n]){var o;let i=un(r),{values:s,keys:a}=this.ht(e,t,n);if(!Array.isArray(i))return this.ut=a,s;let u=(o=this.ut)!==null&&o!==void 0?o:this.ut=[],c=[],f,p,v=0,m=i.length-1,b=0,y=s.length-1;for(;v<=m&&b<=y;)if(i[v]===null)v++;else if(i[m]===null)m--;else if(u[v]===a[b])c[b]=Be(i[v],s[b]),v++,b++;else if(u[m]===a[y])c[y]=Be(i[m],s[y]),m--,y--;else if(u[v]===a[y])c[y]=Be(i[v],s[y]),qe(r,c[y+1],i[v]),v++,y--;else if(u[m]===a[b])c[b]=Be(i[m],s[b]),qe(r,i[v],i[m]),m--,b++;else if(f===void 0&&(f=km(a,b,y),p=km(u,v,m)),f.has(u[v]))if(f.has(u[m])){let g=p.get(a[b]),w=g!==void 0?i[g]:null;if(w===null){let F=qe(r,i[v]);Be(F,s[b]),c[b]=F}else c[b]=Be(w,s[b]),qe(r,i[v],w),i[g]=null;b++}else Hn(i[m]),m--;else Hn(i[v]),v++;for(;b<=y;){let g=qe(r,c[y+1]);Be(g,s[b]),c[b++]=g}for(;v<=m;){let g=i[v++];g!==null&&Hn(g)}return this.ut=a,ct(r,c),L}})});var Mm={};H(Mm,{styleMap:()=>yv});var yv,Lm=l(()=>{te();ue();yv=D(class extends G{constructor(r){var e;if(super(r),r.type!==N.ATTRIBUTE||r.name!=="style"||((e=r.strings)===null||e===void 0?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce(((e,t)=>{let n=r[t];return n==null?e:e+`${t=t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(r,[e]){let{style:t}=r.element;if(this.vt===void 0){this.vt=new Set;for(let n in e)this.vt.add(n);return this.render(e)}this.vt.forEach((n=>{e[n]==null&&(this.vt.delete(n),n.includes("-")?t.removeProperty(n):t[n]="")}));for(let n in e){let o=e[n];o!=null&&(this.vt.add(n),n.includes("-")?t.setProperty(n,o):t[n]=o)}return L}})});var Fm={};H(Fm,{templateContent:()=>xv});var xv,Um=l(()=>{te();ue();xv=D(class extends G{constructor(r){if(super(r),r.type!==N.CHILD)throw Error("templateContent can only be used in child bindings")}render(r){return this.ft===r?L:(this.ft=r,document.importNode(r.content,!0))}})});var qm={};H(qm,{UnsafeHTMLDirective:()=>Wt,unsafeHTML:()=>wv});var Wt,wv,pl=l(()=>{te();ue();Wt=class extends G{constructor(e){if(super(e),this.it=q,e.type!==N.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===q||e==null)return this._t=void 0,this.it=e;if(e===L)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Wt.directiveName="unsafeHTML",Wt.resultType=1;wv=D(Wt)});var Dm={};H(Dm,{unsafeSVG:()=>_v});var Qn,_v,Nm=l(()=>{ue();pl();Qn=class extends Wt{};Qn.directiveName="unsafeSVG",Qn.resultType=2;_v=D(Qn)});var Vm={};H(Vm,{UntilDirective:()=>Ks,until:()=>Sv});var Wm,Ks,Sv,zm=l(()=>{te();lt();cn();ul();ue();Wm=r=>!zn(r)&&typeof r.then=="function",Ks=class extends _t{constructor(){super(...arguments),this._$Cwt=1073741823,this._$Cyt=[],this._$CK=new fn(this),this._$CX=new pn}render(...e){var t;return(t=e.find((n=>!Wm(n))))!==null&&t!==void 0?t:L}update(e,t){let n=this._$Cyt,o=n.length;this._$Cyt=t;let i=this._$CK,s=this._$CX;this.isConnected||this.disconnected();for(let a=0;a<t.length&&!(a>this._$Cwt);a++){let u=t[a];if(!Wm(u))return this._$Cwt=a,u;a<o&&u===n[a]||(this._$Cwt=1073741823,o=0,Promise.resolve(u).then((async c=>{for(;s.get();)await s.get();let f=i.deref();if(f!==void 0){let p=f._$Cyt.indexOf(u);p>-1&&p<f._$Cwt&&(f._$Cwt=p,f.setValue(c))}})))}return L}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},Sv=D(Ks)});var Hm={};H(Hm,{choose:()=>Av});var Av,Bm=l(()=>{Av=(r,e,t)=>{for(let n of e)if(n[0]===r)return(0,n[1])();return t?.()}});var Km={};H(Km,{join:()=>Ev});function*Ev(r,e){let t=typeof e=="function";if(r!==void 0){let n=-1;for(let o of r)n>-1&&(yield t?e(n):e),n++,yield o}}var Ym=l(()=>{});var Gm={};H(Gm,{keyed:()=>$v});var $v,Jm=l(()=>{te();ue();lt();$v=D(class extends G{constructor(){super(...arguments),this.key=q}render(r,e){return this.key=r,e}update(r,[e,t]){return e!==this.key&&(ct(r),this.key=e),t}})});var Qm={};H(Qm,{map:()=>Ov});function*Ov(r,e){if(r!==void 0){let t=0;for(let n of r)yield e(n,t++)}}var Zm=l(()=>{});var Xm={};H(Xm,{range:()=>Tv});function*Tv(r,e,t=1){let n=e===void 0?0:r;e!=null||(e=r);for(let o=n;t>0?o<e:e<o;o+=t)yield o}var ed=l(()=>{});var td={};H(td,{when:()=>Cv});function Cv(r,e,t){return r?e():t?.()}var rd=l(()=>{});var Zn=le(M=>{"use strict";var Iv=M&&M.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var o=Object.getOwnPropertyDescriptor(e,t);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,o)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),W=M&&M.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Iv(e,r,t)};Object.defineProperty(M,"__esModule",{value:!0});W(Vp(),M);W(Kp(),M);W((te(),C(qs)),M);W((ue(),C(zc)),M);W((Yc(),C(Jp)),M);W((Qp(),C(Gh)),M);W(Zp(),M);W((lt(),C(Hp)),M);W((cn(),C(Hc)),M);W((hm(),C(dm)),M);W((gm(),C(vm)),M);W((wm(),C(xm)),M);W((cl(),C(ym)),M);W((Sm(),C(_m)),M);W((Em(),C(Am)),M);W((Om(),C($m)),M);W((Cm(),C(Tm)),M);W((Pm(),C(Im)),M);W((jm(),C(Rm)),M);W((Lm(),C(Mm)),M);W((Um(),C(Fm)),M);W((pl(),C(qm)),M);W((Nm(),C(Dm)),M);W((zm(),C(Vm)),M);W((Bm(),C(Hm)),M);W((Ym(),C(Km)),M);W((Jm(),C(Gm)),M);W((Zm(),C(Qm)),M);W((ed(),C(Xm)),M);W((rd(),C(td)),M)});var nd=le(Ye=>{"use strict";var Xn=Ye&&Ye.__decorate||function(r,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Ys=Ye&&Ye.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Pv=Ye&&Ye.__awaiter||function(r,e,t,n){function o(i){return i instanceof t?i:new t(function(s){s(i)})}return new(t||(t=Promise))(function(i,s){function a(f){try{c(n.next(f))}catch(p){s(p)}}function u(f){try{c(n.throw(f))}catch(p){s(p)}}function c(f){f.done?i(f.value):o(f.value).then(a,u)}c((n=n.apply(r,e||[])).next())})};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.Renderer=void 0;var me=Zn();function kv(r){return function(e){if(!window.customElements.get(r.selector))return(0,me.Component)(r)(e)}}var ir=class extends me.LitElement{constructor(){super(...arguments),this.options={state:{},render:(e,t,n)=>(0,me.html)` ${e} `,style:(0,me.css)``,styles:[],deepCloneState:!1,loading:()=>(0,me.html)``,error:e=>(0,me.html)`${e?.message}`},this.loading=!0,this.state={}}OnUpdateFirst(){var e,t,n;return Pv(this,void 0,void 0,function*(){!((e=this.options)===null||e===void 0)&&e.style&&(0,me.adoptStyles)(this.shadowRoot,[this.options.style]),!((n=(t=this.options)===null||t===void 0?void 0:t.styles)===null||n===void 0)&&n.length&&(0,me.adoptStyles)(this.shadowRoot,this.options.styles),this.options.state=yield this.options.state,this.options.state&&(this.isObservable(this.options.state)?this.subscription=this.options.state.subscribe(o=>{this.state=o,this.loading=!1,this.dispatchEvent(new CustomEvent("onData",{detail:o}))},o=>{this.state=null,this.error=o,this.loading=!1,this.dispatchEvent(new CustomEvent("onError",{detail:o}))}):(this.loading=!1,this.state=this.options.state),yield this.updateComplete,yield new Promise(requestAnimationFrame),this.dispatchEvent(new CustomEvent("loaded")))})}isObservable(e){return this.isFunction(e.lift)&&this.isFunction(e.subscribe)}isFunction(e){return typeof e=="function"}OnDestroy(){this.subscription&&this.subscription.unsubscribe()}renderContent(){if(!this.error&&this.options.render){let e=this.options.render(this.options.deepCloneState?JSON.parse(JSON.stringify(this.state)):this.state,t=>this.state=Object.assign({},t),this.shadowRoot);return e?.strings?e:(0,me.html)``}return this.state}};Ye.Renderer=ir;Xn([(0,me.property)({type:Object}),Ys("design:type",Object)],ir.prototype,"options",void 0);Xn([(0,me.property)({type:Boolean}),Ys("design:type",Object)],ir.prototype,"loading",void 0);Xn([(0,me.property)({type:Object}),Ys("design:type",Error)],ir.prototype,"error",void 0);Xn([(0,me.property)(),Ys("design:type",Object)],ir.prototype,"state",void 0);Ye.Renderer=ir=Xn([kv({selector:"r-renderer",template(){return(0,me.html)`
|
|
15
|
+
`),v):(typeof f=="function"?La(r,f,{extends:e.extends}):Ua(r,f,{extends:e.extends}),f)},Na=r=>qa(r.selector,r);ct.Component=Na});var hi=xe(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0})});var vi=xe(Te=>{"use strict";var Fa=Te&&Te.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var o=Object.getOwnPropertyDescriptor(e,t);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,o)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),mi=Te&&Te.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Fa(e,r,t)};Object.defineProperty(Te,"__esModule",{value:!0});mi(fi(),Te);mi(hi(),Te)});var Tn={};I(Tn,{Directive:()=>M,PartType:()=>O,directive:()=>T});var O,T,M,q=y(()=>{O={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},T=r=>(...e)=>({_$litDirective$:r,values:e}),M=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}});var yi={};I(yi,{TemplateResultType:()=>Wa,clearPart:()=>Ft,getCommittedValue:()=>ut,getDirectiveClass:()=>Va,insertPart:()=>ne,isDirectiveResult:()=>za,isPrimitive:()=>qt,isSingleExpression:()=>Be,isTemplateResult:()=>Oe,removePart:()=>Nt,setChildPartValue:()=>ue,setCommittedValue:()=>ge});var Ha,qt,Wa,Oe,za,Va,Be,gi,ne,ue,Ba,ge,ut,Nt,Ft,ye=y(()=>{L();({I:Ha}=lt),qt=r=>r===null||typeof r!="object"&&typeof r!="function",Wa={HTML:1,SVG:2},Oe=(r,e)=>e===void 0?r?._$litType$!==void 0:r?._$litType$===e,za=r=>r?._$litDirective$!==void 0,Va=r=>r?._$litDirective$,Be=r=>r.strings===void 0,gi=()=>document.createComment(""),ne=(r,e,t)=>{var n;let o=r._$AA.parentNode,i=e===void 0?r._$AB:e._$AA;if(t===void 0){let s=o.insertBefore(gi(),i),l=o.insertBefore(gi(),i);t=new Ha(s,l,r,r.options)}else{let s=t._$AB.nextSibling,l=t._$AM,a=l!==r;if(a){let c;(n=t._$AQ)===null||n===void 0||n.call(t,r),t._$AM=r,t._$AP!==void 0&&(c=r._$AU)!==l._$AU&&t._$AP(c)}if(s!==i||a){let c=t._$AA;for(;c!==s;){let u=c.nextSibling;o.insertBefore(c,i),c=u}}}return t},ue=(r,e,t=r)=>(r._$AI(e,t),r),Ba={},ge=(r,e=Ba)=>r._$AH=e,ut=r=>r._$AH,Nt=r=>{var e;(e=r._$AP)===null||e===void 0||e.call(r,!1,!0);let t=r._$AA,n=r._$AB.nextSibling;for(;t!==n;){let o=t.nextSibling;t.remove(),t=o}},Ft=r=>{r._$AR()}});var On={};I(On,{AsyncDirective:()=>$e,Directive:()=>M,PartType:()=>O,directive:()=>T});function Ka(r){this._$AN!==void 0?(jr(this),this._$AM=r,bi(this)):this._$AM=r}function Ya(r,e=!1,t=0){let n=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(n))for(let i=t;i<n.length;i++)Ht(n[i],!1),jr(n[i]);else n!=null&&(Ht(n,!1),jr(n));else Ht(this,r)}var Ht,jr,bi,Ga,$e,pt=y(()=>{ye();q();q();Ht=(r,e)=>{var t,n;let o=r._$AN;if(o===void 0)return!1;for(let i of o)(n=(t=i)._$AO)===null||n===void 0||n.call(t,e,!1),Ht(i,e);return!0},jr=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while(t?.size===0)},bi=r=>{for(let e;e=r._$AM;r=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(r))break;t.add(r),Ga(e)}};Ga=r=>{var e,t,n,o;r.type==O.CHILD&&((e=(n=r)._$AP)!==null&&e!==void 0||(n._$AP=Ya),(t=(o=r)._$AQ)!==null&&t!==void 0||(o._$AQ=Ka))},$e=class extends M{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),bi(this),this.isConnected=e._$AU}_$AO(e,t=!0){var n,o;e!==this.isConnected&&(this.isConnected=e,e?(n=this.reconnected)===null||n===void 0||n.call(this):(o=this.disconnected)===null||o===void 0||o.call(this)),t&&(Ht(this,e),jr(this))}setValue(e){if(Be(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}});var xi=xe(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.async=void 0;var Ja=(q(),C(Tn)),Za=(pt(),C(On)),Xa=(L(),C(Mr)),kn=class extends Za.AsyncDirective{render(e){return"then"in e?(Promise.resolve(e).then(t=>this.setValue(t)),""):(this.observable!==e&&(this.unsubscribe(),this.observable=e,this.isConnected&&this.subscribe(e)),Xa.noChange)}subscribe(e){this.subscription=e.subscribe(t=>{this.setValue(t)})}disconnected(){this.unsubscribe()}unsubscribe(){this.subscription&&this.subscription.unsubscribe()}reconnected(){this.subscribe(this.observable)}};Lr.async=(0,Ja.directive)(kn)});var Si={};I(Si,{digestForTemplateResult:()=>_i,hydrate:()=>Pn});var Qa,el,wi,Wt,tl,Pn,rl,nl,ol,_i,In=y(()=>{L();q();ye();({R:Qa,D:el,V:wi,I:Wt,F:tl}=lt),Pn=(r,e,t={})=>{if(e._$litPart$!==void 0)throw Error("container already contains a live render");let n,o,i=[],s=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT,null,!1),l;for(;(l=s.nextNode())!==null;){let a=l.data;if(a.startsWith("lit-part")){if(i.length===0&&n!==void 0)throw Error("there must be only one root part per container");o=rl(r,l,i,t),n!=null||(n=o)}else if(a.startsWith("lit-node"))ol(l,i,t);else if(a.startsWith("/lit-part")){if(i.length===1&&o!==n)throw Error("internal error");o=nl(l,o,i)}}console.assert(n!==void 0,"there should be exactly one root part in a render container"),e._$litPart$=n},rl=(r,e,t,n)=>{let o,i;if(t.length===0)i=new Wt(e,null,void 0,n),o=r;else{let s=t[t.length-1];if(s.type==="template-instance")i=new Wt(e,null,s.instance,n),s.instance.u.push(i),o=s.result.values[s.instancePartIndex++],s.templatePartIndex++;else if(s.type==="iterable"){i=new Wt(e,null,s.part,n);let l=s.iterator.next();if(l.done)throw o=void 0,s.done=!0,Error("Unhandled shorter than expected iterable");o=l.value,s.part._$AH.push(i)}else i=new Wt(e,null,s.part,n)}if(o=wi(i,o),o===A)t.push({part:i,type:"leaf"});else if(qt(o))t.push({part:i,type:"leaf"}),i._$AH=o;else if(Oe(o)){let s="lit-part "+_i(o);if(e.data!==s)throw Error("Hydration value mismatch: Unexpected TemplateResult rendered to part");{let l=Wt.prototype._$AC(o),a=new Qa(l,i);t.push({type:"template-instance",instance:a,part:i,templatePartIndex:0,instancePartIndex:0,result:o}),i._$AH=a}}else el(o)?(t.push({part:i,type:"iterable",value:o,iterator:o[Symbol.iterator](),done:!1}),i._$AH=[]):(t.push({part:i,type:"leaf"}),i._$AH=o??"");return i},nl=(r,e,t)=>{if(e===void 0)throw Error("unbalanced part marker");e._$AB=r;let n=t.pop();if(n.type==="iterable"&&!n.iterator.next().done)throw Error("unexpected longer than expected iterable");if(t.length>0)return t[t.length-1].part},ol=(r,e,t)=>{var n;let o=/lit-node (\d+)/.exec(r.data),i=parseInt(o[1]),s=(n=r.previousElementSibling)!==null&&n!==void 0?n:r.parentElement;if(s===null)throw Error("could not find node for attribute parts");s.removeAttribute("defer-hydration");let l=e[e.length-1];if(l.type!=="template-instance")throw Error("internal error");{let a=l.instance;for(;;){let c=a._$AD.parts[l.templatePartIndex];if(c===void 0||c.type!==O.ATTRIBUTE&&c.type!==O.ELEMENT||c.index!==i)break;if(c.type===O.ATTRIBUTE){let u=new c.ctor(s,c.name,c.strings,l.instance,t),p=Be(u)?l.result.values[l.instancePartIndex]:l.result.values,d=!(u.type===O.EVENT||u.type===O.PROPERTY);u._$AI(p,u,l.instancePartIndex,d),l.instancePartIndex+=c.strings.length-1,a.u.push(u)}else{let u=new tl(s,l.instance,t);wi(u,l.result.values[l.instancePartIndex++]),a.u.push(u)}l.templatePartIndex++}}},_i=r=>{let e=new Uint32Array(2).fill(5381);for(let t of r.strings)for(let n=0;n<t.length;n++)e[n%2]=33*e[n%2]^t.charCodeAt(n);return btoa(String.fromCharCode(...new Uint8Array(e.buffer)))}});var il={};var $i=y(()=>{L();In();globalThis.litElementHydrateSupport=({LitElement:r})=>{let e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),"observedAttributes").get;Object.defineProperty(r,"observedAttributes",{get(){return[...e.call(this),"defer-hydration"]}});let t=r.prototype.attributeChangedCallback;r.prototype.attributeChangedCallback=function(s,l,a){s==="defer-hydration"&&a===null&&n.call(this),t.call(this,s,l,a)};let n=r.prototype.connectedCallback;r.prototype.connectedCallback=function(){this.hasAttribute("defer-hydration")||n.call(this)};let o=r.prototype.createRenderRoot;r.prototype.createRenderRoot=function(){return this.shadowRoot?(this._$AG=!0,this.shadowRoot):o.call(this)};let i=Object.getPrototypeOf(r.prototype).update;r.prototype.update=function(s){let l=this.render();i.call(this,s),this._$AG?(this._$AG=!1,Pn(l,this.renderRoot,this.renderOptions)):Ce(l,this.renderRoot,this.renderOptions)}}});var Ai=xe(()=>{(function(r){typeof define=="function"&&define.amd?define(r):r()})((function(){"use strict";var r,e=new Set,t=new Map;(r=globalThis.litHtmlPolyfillSupport)!==null&&r!==void 0||(globalThis.litHtmlPolyfillSupport=function(n,o){if(window.ShadyCSS!==void 0&&(!window.ShadyCSS.nativeShadow||window.ShadyCSS.ApplyShim)){var i=function(f){return f!==void 0&&!e.has(f)},s=function(f){var v=t.get(f);return v===void 0&&t.set(f,v=[]),v},l=new Map,a=n.createElement;n.createElement=function(f,v){var h=a.call(n,f,v),m=v?.scope;if(m!==void 0&&(window.ShadyCSS.nativeShadow||window.ShadyCSS.prepareTemplateDom(h,m),i(m))){var b=s(m),K=h.content.querySelectorAll("style");b.push.apply(b,Array.from(K).map((function(ie){var be;return(be=ie.parentNode)===null||be===void 0||be.removeChild(ie),ie.textContent})))}return h};var c=document.createDocumentFragment(),u=document.createComment(""),p=o.prototype,d=p._$AI;p._$AI=function(f,v){var h,m;v===void 0&&(v=this);var b=this._$AA.parentNode,K=(h=this.options)===null||h===void 0?void 0:h.scope;if(b instanceof ShadowRoot&&i(K)){var ie=this._$AA,be=this._$AB;c.appendChild(u),this._$AA=u,this._$AB=null,d.call(this,f,v);var Me=f?._$litType$?this._$AH._$AD.el:document.createElement("template");if((function(er,tr){var rr,so=s(er),ao=so.length!==0;ao&&((rr=document.createElement("style")).textContent=so.join(`
|
|
16
|
+
`),tr.content.appendChild(rr)),e.add(er),t.delete(er),window.ShadyCSS.prepareTemplateStyles(tr,er),ao&&window.ShadyCSS.nativeShadow&&(rr=tr.content.querySelector("style"))!==null&&tr.content.appendChild(rr)})(K,Me),c.removeChild(u),(m=window.ShadyCSS)===null||m===void 0?void 0:m.nativeShadow){var je=Me.content.querySelector("style");je!==null&&c.appendChild(je.cloneNode(!0))}b.insertBefore(c,be),this._$AA=ie,this._$AB=be}else d.call(this,f,v)},p._$AC=function(f){var v,h=(v=this.options)===null||v===void 0?void 0:v.scope,m=l.get(h);m===void 0&&l.set(h,m=new Map);var b=m.get(f.strings);return b===void 0&&m.set(f.strings,b=new n(f,this.options)),b}}})}))});var Ur,zt,Rn,Ei,ft,Mn,Ci,Dr,Vt,jn=y(()=>{Ur=window,zt=Ur.ShadowRoot&&(Ur.ShadyCSS===void 0||Ur.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rn=Symbol(),Ei=new WeakMap,ft=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Rn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(zt&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Ei.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ei.set(t,e))}return e}toString(){return this.cssText}},Mn=r=>new ft(typeof r=="string"?r:r+"",void 0,Rn),Ci=(r,...e)=>{let t=r.length===1?r[0]:e.reduce(((n,o,i)=>n+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+r[i+1]),r[0]);return new ft(t,r,Rn)},Dr=(r,e)=>{zt?r.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((t=>{let n=document.createElement("style"),o=Ur.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=t.cssText,r.appendChild(n)}))},Vt=zt?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Mn(t)})(r):r});var Ln,qr,Ti,sl,Oi,Nr,Dn,Un,pe,Fr=y(()=>{jn();jn();qr=window,Ti=qr.trustedTypes,sl=Ti?Ti.emptyScript:"",Oi=qr.reactiveElementPolyfillSupport,Nr={toAttribute(r,e){switch(e){case Boolean:r=r?sl:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Dn=(r,e)=>e!==r&&(e==e||r==r),Un={attribute:!0,type:String,converter:Nr,reflect:!1,hasChanged:Dn},pe=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach(((t,n)=>{let o=this._$Ep(n,t);o!==void 0&&(this._$Ev.set(o,n),e.push(o))})),e}static createProperty(e,t=Un){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,o=this.getPropertyDescriptor(e,n,t);o!==void 0&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(o){let i=this[e];this[t]=o,this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Un}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let o of n)this.createProperty(o,t[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let o of n)t.unshift(Vt(o))}else e!==void 0&&t.push(Vt(e));return t}static _$Ep(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach((t=>t(this)))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;let t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Dr(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach((t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)}))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach((t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)}))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=Un){var o;let i=this.constructor._$Ep(e,n);if(i!==void 0&&n.reflect===!0){let s=(((o=n.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?n.converter:Nr).toAttribute(t,n.type);this._$El=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$El=null}}_$AK(e,t){var n;let o=this.constructor,i=o._$Ev.get(e);if(i!==void 0&&this._$El!==i){let s=o.getPropertyOptions(i),l=typeof s.converter=="function"?{fromAttribute:s.converter}:((n=s.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?s.converter:Nr;this._$El=i,this[i]=l.fromAttribute(t,s.type),this._$El=null}}requestUpdate(e,t,n){let o=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Dn)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((o,i)=>this[i]=o)),this._$Ei=void 0);let t=!1,n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach((o=>{var i;return(i=o.hostUpdate)===null||i===void 0?void 0:i.call(o)})),this.update(n)):this._$Ek()}catch(o){throw t=!1,this._$Ek(),o}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach((n=>{var o;return(o=n.hostUpdated)===null||o===void 0?void 0:o.call(n)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach(((t,n)=>this._$EO(n,this[n],t))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};pe.finalized=!0,pe.elementProperties=new Map,pe.elementStyles=[],pe.shadowRootOptions={mode:"open"},Oi?.({ReactiveElement:pe}),((Ln=qr.reactiveElementVersions)!==null&&Ln!==void 0?Ln:qr.reactiveElementVersions=[]).push("1.5.0")});var qn,Nn,Pi,ke,ki,Ii,Ri=y(()=>{Fr();Fr();L();L();Pi=pe,ke=class extends pe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let n=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=n.firstChild),n}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ce(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return A}};ke.finalized=!0,ke._$litElement$=!0,(qn=globalThis.litElementHydrateSupport)===null||qn===void 0||qn.call(globalThis,{LitElement:ke});ki=globalThis.litElementPolyfillSupport;ki?.({LitElement:ke});Ii={_$AK:(r,e,t)=>{r._$AK(e,t)},_$AL:r=>r._$AL};((Nn=globalThis.litElementVersions)!==null&&Nn!==void 0?Nn:globalThis.litElementVersions=[]).push("3.2.2")});var al,ll,Q,Pe=y(()=>{al=(r,e,t)=>{Object.defineProperty(e,t,r)},ll=(r,e)=>({kind:"method",placement:"prototype",key:e.key,descriptor:r}),Q=({finisher:r,descriptor:e})=>(t,n)=>{var o;if(n===void 0){let i=(o=t.originalKey)!==null&&o!==void 0?o:t.key,s=e!=null?{kind:"method",placement:"prototype",key:i,descriptor:e(t.key)}:{...t,key:i};return r!=null&&(s.finisher=function(l){r(l,i)}),s}{let i=t.constructor;e!==void 0&&Object.defineProperty(t,n,e(n)),r?.(i,n)}}});var cl,Mi=y(()=>{cl=r=>e=>typeof e=="function"?((t,n)=>(customElements.define(t,n),n))(r,e):((t,n)=>{let{kind:o,elements:i}=n;return{kind:o,elements:i,finisher(s){customElements.define(t,s)}}})(r,e)});function Fn(r){return(e,t)=>t!==void 0?((n,o,i)=>{o.constructor.createProperty(i,n)})(r,e,t):ul(r,e)}var ul,Hn=y(()=>{ul=(r,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,r)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,r)}}});function pl(r){return Fn({...r,state:!0})}var ji=y(()=>{Hn();});function fl(r){return Q({finisher:(e,t)=>{Object.assign(e.prototype[t],r)}})}var Li=y(()=>{Pe();});function dl(r,e){return Q({descriptor:t=>{let n={get(){var o,i;return(i=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(r))!==null&&i!==void 0?i:null},enumerable:!0,configurable:!0};if(e){let o=typeof t=="symbol"?Symbol():"__"+t;n.get=function(){var i,s;return this[o]===void 0&&(this[o]=(s=(i=this.renderRoot)===null||i===void 0?void 0:i.querySelector(r))!==null&&s!==void 0?s:null),this[o]}}return n}})}var Ui=y(()=>{Pe();});function hl(r){return Q({descriptor:e=>({get(){var t,n;return(n=(t=this.renderRoot)===null||t===void 0?void 0:t.querySelectorAll(r))!==null&&n!==void 0?n:[]},enumerable:!0,configurable:!0})})}var Di=y(()=>{Pe();});function ml(r){return Q({descriptor:e=>({async get(){var t;return await this.updateComplete,(t=this.renderRoot)===null||t===void 0?void 0:t.querySelector(r)},enumerable:!0,configurable:!0})})}var qi=y(()=>{Pe();});function zn(r){let{slot:e,selector:t}=r??{};return Q({descriptor:n=>({get(){var o;let i="slot"+(e?`[name=${e}]`:":not([name])"),s=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(i),l=s!=null?vl(s,r):[];return t?l.filter((a=>a.matches(t))):l},enumerable:!0,configurable:!0})})}var Wn,vl,Vn=y(()=>{Pe();vl=((Wn=window.HTMLSlotElement)===null||Wn===void 0?void 0:Wn.prototype.assignedElements)!=null?(r,e)=>r.assignedElements(e):(r,e)=>r.assignedNodes(e).filter((t=>t.nodeType===Node.ELEMENT_NODE))});function gl(r,e,t){let n,o=r;return typeof r=="object"?(o=r.slot,n=r):n={flatten:e},t?zn({slot:o,flatten:e,selector:t}):Q({descriptor:i=>({get(){var s,l;let a="slot"+(o?`[name=${o}]`:":not([name])"),c=(s=this.renderRoot)===null||s===void 0?void 0:s.querySelector(a);return(l=c?.assignedNodes(n))!==null&&l!==void 0?l:[]},enumerable:!0,configurable:!0})})}var Ni=y(()=>{Pe();Vn();});var Fi={};I(Fi,{CSSResult:()=>ft,LitElement:()=>ke,ReactiveElement:()=>pe,UpdatingElement:()=>Pi,_$LE:()=>Ii,_$LH:()=>lt,adoptStyles:()=>Dr,css:()=>Ci,customElement:()=>cl,decorateProperty:()=>Q,defaultConverter:()=>Nr,eventOptions:()=>fl,getCompatibleStyle:()=>Vt,html:()=>li,legacyPrototypeMethod:()=>al,noChange:()=>A,notEqual:()=>Dn,nothing:()=>E,property:()=>Fn,query:()=>dl,queryAll:()=>hl,queryAssignedElements:()=>zn,queryAssignedNodes:()=>gl,queryAsync:()=>ml,render:()=>Ce,standardPrototypeMethod:()=>ll,state:()=>pl,supportsAdoptingStyleSheets:()=>zt,svg:()=>ci,unsafeCSS:()=>Mn});var Hi=y(()=>{Fr();L();Ri();Pe();Mi();Hn();ji();Li();Ui();Di();qi();Vn();Ni();console.warn("The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information.")});var Wi={};I(Wi,{classMap:()=>yl});var yl,zi=y(()=>{L();q();yl=T(class extends M{constructor(r){var e;if(super(r),r.type!==O.ATTRIBUTE||r.name!=="class"||((e=r.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter((e=>r[e])).join(" ")+" "}update(r,[e]){var t,n;if(this.nt===void 0){this.nt=new Set,r.strings!==void 0&&(this.st=new Set(r.strings.join(" ").split(/\s/).filter((i=>i!==""))));for(let i in e)e[i]&&!(!((t=this.st)===null||t===void 0)&&t.has(i))&&this.nt.add(i);return this.render(e)}let o=r.element.classList;this.nt.forEach((i=>{i in e||(o.remove(i),this.nt.delete(i))}));for(let i in e){let s=!!e[i];s===this.nt.has(i)||!((n=this.st)===null||n===void 0)&&n.has(i)||(s?(o.add(i),this.nt.add(i)):(o.remove(i),this.nt.delete(i)))}return A}})});var Vi,dt,ht,Bn=y(()=>{Vi=async(r,e)=>{for await(let t of r)if(await e(t)===!1)return},dt=class{constructor(e){this.Y=e}disconnect(){this.Y=void 0}reconnect(e){this.Y=e}deref(){return this.Y}},ht=class{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){var e;(e=this.Z)!==null&&e!==void 0||(this.Z=new Promise((t=>this.q=t)))}resume(){var e;(e=this.q)===null||e===void 0||e.call(this),this.Z=this.q=void 0}}});var Bi={};I(Bi,{AsyncReplaceDirective:()=>mt,asyncReplace:()=>bl});var mt,bl,Kn=y(()=>{L();pt();Bn();q();mt=class extends $e{constructor(){super(...arguments),this._$CK=new dt(this),this._$CX=new ht}render(e,t){return A}update(e,[t,n]){if(this.isConnected||this.disconnected(),t===this._$CJ)return;this._$CJ=t;let o=0,{_$CK:i,_$CX:s}=this;return Vi(t,(async l=>{for(;s.get();)await s.get();let a=i.deref();if(a!==void 0){if(a._$CJ!==t)return!1;n!==void 0&&(l=n(l,o)),a.commitValue(l,o),o++}return!0})),A}commitValue(e,t){this.setValue(e)}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},bl=T(mt)});var Ki={};I(Ki,{asyncAppend:()=>xl});var xl,Yi=y(()=>{q();Kn();ye();xl=T(class extends mt{constructor(r){if(super(r),r.type!==O.CHILD)throw Error("asyncAppend can only be used in child expressions")}update(r,e){return this._$Ctt=r,super.update(r,e)}commitValue(r,e){e===0&&Ft(this._$Ctt);let t=ne(this._$Ctt);ue(t,r)}})});var Gi={};I(Gi,{cache:()=>wl});var wl,Ji=y(()=>{L();q();ye();wl=T(class extends M{constructor(r){super(r),this.et=new WeakMap}render(r){return[r]}update(r,[e]){if(Oe(this.it)&&(!Oe(e)||this.it.strings!==e.strings)){let t=ut(r).pop(),n=this.et.get(this.it.strings);if(n===void 0){let o=document.createDocumentFragment();n=Ce(E,o),n.setConnected(!1),this.et.set(this.it.strings,n)}ge(n,[t]),ne(n,void 0,t)}if(Oe(e)){if(!Oe(this.it)||this.it.strings!==e.strings){let t=this.et.get(e.strings);if(t!==void 0){let n=ut(t).pop();Ft(r),ne(r,void 0,n),ge(r,[n])}}this.it=e}else this.it=void 0;return this.render(e)}})});var Zi={};I(Zi,{guard:()=>Sl});var _l,Sl,Xi=y(()=>{L();q();_l={},Sl=T(class extends M{constructor(){super(...arguments),this.ot=_l}render(r,e){return e()}update(r,[e,t]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every(((n,o)=>n===this.ot[o])))return A}else if(this.ot===e)return A;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,t)}})});var Qi={};I(Qi,{ifDefined:()=>$l});var $l,es=y(()=>{L();$l=r=>r??E});var ts={};I(ts,{live:()=>Al});var Al,rs=y(()=>{L();q();ye();Al=T(class extends M{constructor(r){if(super(r),r.type!==O.PROPERTY&&r.type!==O.ATTRIBUTE&&r.type!==O.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Be(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(r,[e]){if(e===A||e===E)return e;let t=r.element,n=r.name;if(r.type===O.PROPERTY){if(e===t[n])return A}else if(r.type===O.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(n))return A}else if(r.type===O.ATTRIBUTE&&t.getAttribute(n)===e+"")return A;return ge(r),e}})});var ns={};I(ns,{createRef:()=>El,ref:()=>Cl});var El,Gn,Yn,Cl,os=y(()=>{L();pt();q();El=()=>new Gn,Gn=class{},Yn=new WeakMap,Cl=T(class extends $e{render(r){return E}update(r,[e]){var t;let n=e!==this.Y;return n&&this.Y!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=e,this.dt=(t=r.options)===null||t===void 0?void 0:t.host,this.rt(this.ct=r.element)),E}rt(r){var e;if(typeof this.Y=="function"){let t=(e=this.dt)!==null&&e!==void 0?e:globalThis,n=Yn.get(t);n===void 0&&(n=new WeakMap,Yn.set(t,n)),n.get(this.Y)!==void 0&&this.Y.call(this.dt,void 0),n.set(this.Y,r),r!==void 0&&this.Y.call(this.dt,r)}else this.Y.value=r}get lt(){var r,e,t;return typeof this.Y=="function"?(e=Yn.get((r=this.dt)!==null&&r!==void 0?r:globalThis))===null||e===void 0?void 0:e.get(this.Y):(t=this.Y)===null||t===void 0?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}})});var ss={};I(ss,{repeat:()=>Tl});var is,Tl,as=y(()=>{L();q();ye();is=(r,e,t)=>{let n=new Map;for(let o=e;o<=t;o++)n.set(r[o],o);return n},Tl=T(class extends M{constructor(r){if(super(r),r.type!==O.CHILD)throw Error("repeat() can only be used in text expressions")}ht(r,e,t){let n;t===void 0?t=e:e!==void 0&&(n=e);let o=[],i=[],s=0;for(let l of r)o[s]=n?n(l,s):s,i[s]=t(l,s),s++;return{values:i,keys:o}}render(r,e,t){return this.ht(r,e,t).values}update(r,[e,t,n]){var o;let i=ut(r),{values:s,keys:l}=this.ht(e,t,n);if(!Array.isArray(i))return this.ut=l,s;let a=(o=this.ut)!==null&&o!==void 0?o:this.ut=[],c=[],u,p,d=0,f=i.length-1,v=0,h=s.length-1;for(;d<=f&&v<=h;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(a[d]===l[v])c[v]=ue(i[d],s[v]),d++,v++;else if(a[f]===l[h])c[h]=ue(i[f],s[h]),f--,h--;else if(a[d]===l[h])c[h]=ue(i[d],s[h]),ne(r,c[h+1],i[d]),d++,h--;else if(a[f]===l[v])c[v]=ue(i[f],s[v]),ne(r,i[d],i[f]),f--,v++;else if(u===void 0&&(u=is(l,v,h),p=is(a,d,f)),u.has(a[d]))if(u.has(a[f])){let m=p.get(l[v]),b=m!==void 0?i[m]:null;if(b===null){let K=ne(r,i[d]);ue(K,s[v]),c[v]=K}else c[v]=ue(b,s[v]),ne(r,i[d],b),i[m]=null;v++}else Nt(i[f]),f--;else Nt(i[d]),d++;for(;v<=h;){let m=ne(r,c[h+1]);ue(m,s[v]),c[v++]=m}for(;d<=f;){let m=i[d++];m!==null&&Nt(m)}return this.ut=l,ge(r,c),A}})});var ls={};I(ls,{styleMap:()=>Ol});var Ol,cs=y(()=>{L();q();Ol=T(class extends M{constructor(r){var e;if(super(r),r.type!==O.ATTRIBUTE||r.name!=="style"||((e=r.strings)===null||e===void 0?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce(((e,t)=>{let n=r[t];return n==null?e:e+`${t=t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(r,[e]){let{style:t}=r.element;if(this.vt===void 0){this.vt=new Set;for(let n in e)this.vt.add(n);return this.render(e)}this.vt.forEach((n=>{e[n]==null&&(this.vt.delete(n),n.includes("-")?t.removeProperty(n):t[n]="")}));for(let n in e){let o=e[n];o!=null&&(this.vt.add(n),n.includes("-")?t.setProperty(n,o):t[n]=o)}return A}})});var us={};I(us,{templateContent:()=>kl});var kl,ps=y(()=>{L();q();kl=T(class extends M{constructor(r){if(super(r),r.type!==O.CHILD)throw Error("templateContent can only be used in child bindings")}render(r){return this.ft===r?A:(this.ft=r,document.importNode(r.content,!0))}})});var fs={};I(fs,{UnsafeHTMLDirective:()=>Ie,unsafeHTML:()=>Pl});var Ie,Pl,Jn=y(()=>{L();q();Ie=class extends M{constructor(e){if(super(e),this.it=E,e.type!==O.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===E||e==null)return this._t=void 0,this.it=e;if(e===A)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Ie.directiveName="unsafeHTML",Ie.resultType=1;Pl=T(Ie)});var ds={};I(ds,{unsafeSVG:()=>Il});var Bt,Il,hs=y(()=>{q();Jn();Bt=class extends Ie{};Bt.directiveName="unsafeSVG",Bt.resultType=2;Il=T(Bt)});var vs={};I(vs,{UntilDirective:()=>Hr,until:()=>Rl});var ms,Hr,Rl,gs=y(()=>{L();ye();pt();Bn();q();ms=r=>!qt(r)&&typeof r.then=="function",Hr=class extends $e{constructor(){super(...arguments),this._$Cwt=1073741823,this._$Cyt=[],this._$CK=new dt(this),this._$CX=new ht}render(...e){var t;return(t=e.find((n=>!ms(n))))!==null&&t!==void 0?t:A}update(e,t){let n=this._$Cyt,o=n.length;this._$Cyt=t;let i=this._$CK,s=this._$CX;this.isConnected||this.disconnected();for(let l=0;l<t.length&&!(l>this._$Cwt);l++){let a=t[l];if(!ms(a))return this._$Cwt=l,a;l<o&&a===n[l]||(this._$Cwt=1073741823,o=0,Promise.resolve(a).then((async c=>{for(;s.get();)await s.get();let u=i.deref();if(u!==void 0){let p=u._$Cyt.indexOf(a);p>-1&&p<u._$Cwt&&(u._$Cwt=p,u.setValue(c))}})))}return A}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},Rl=T(Hr)});var ys={};I(ys,{choose:()=>Ml});var Ml,bs=y(()=>{Ml=(r,e,t)=>{for(let n of e)if(n[0]===r)return(0,n[1])();return t?.()}});var xs={};I(xs,{join:()=>jl});function*jl(r,e){let t=typeof e=="function";if(r!==void 0){let n=-1;for(let o of r)n>-1&&(yield t?e(n):e),n++,yield o}}var ws=y(()=>{});var _s={};I(_s,{keyed:()=>Ll});var Ll,Ss=y(()=>{L();q();ye();Ll=T(class extends M{constructor(){super(...arguments),this.key=E}render(r,e){return this.key=r,e}update(r,[e,t]){return e!==this.key&&(ge(r),this.key=e),t}})});var $s={};I($s,{map:()=>Ul});function*Ul(r,e){if(r!==void 0){let t=0;for(let n of r)yield e(n,t++)}}var As=y(()=>{});var Es={};I(Es,{range:()=>Dl});function*Dl(r,e,t=1){let n=e===void 0?0:r;e!=null||(e=r);for(let o=n;t>0?o<e:e<o;o+=t)yield o}var Cs=y(()=>{});var Ts={};I(Ts,{when:()=>ql});function ql(r,e,t){return r?e():t?.()}var Os=y(()=>{});var Kt=xe($=>{"use strict";var Nl=$&&$.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var o=Object.getOwnPropertyDescriptor(e,t);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,o)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),k=$&&$.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Nl(e,r,t)};Object.defineProperty($,"__esModule",{value:!0});k(vi(),$);k(xi(),$);k((L(),C(Mr)),$);k((q(),C(Tn)),$);k((In(),C(Si)),$);k(($i(),C(il)),$);k(Ai(),$);k((ye(),C(yi)),$);k((pt(),C(On)),$);k((Hi(),C(Fi)),$);k((zi(),C(Wi)),$);k((Yi(),C(Ki)),$);k((Kn(),C(Bi)),$);k((Ji(),C(Gi)),$);k((Xi(),C(Zi)),$);k((es(),C(Qi)),$);k((rs(),C(ts)),$);k((os(),C(ns)),$);k((as(),C(ss)),$);k((cs(),C(ls)),$);k((ps(),C(us)),$);k((Jn(),C(fs)),$);k((hs(),C(ds)),$);k((gs(),C(vs)),$);k((bs(),C(ys)),$);k((ws(),C(xs)),$);k((Ss(),C(_s)),$);k((As(),C($s)),$);k((Cs(),C(Es)),$);k((Os(),C(Ts)),$)});var ks=xe(fe=>{"use strict";var Yt=fe&&fe.__decorate||function(r,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Wr=fe&&fe.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Fl=fe&&fe.__awaiter||function(r,e,t,n){function o(i){return i instanceof t?i:new t(function(s){s(i)})}return new(t||(t=Promise))(function(i,s){function l(u){try{c(n.next(u))}catch(p){s(p)}}function a(u){try{c(n.throw(u))}catch(p){s(p)}}function c(u){u.done?i(u.value):o(u.value).then(l,a)}c((n=n.apply(r,e||[])).next())})};Object.defineProperty(fe,"__esModule",{value:!0});fe.Renderer=void 0;var W=Kt();function Hl(r){return function(e){if(!window.customElements.get(r.selector))return(0,W.Component)(r)(e)}}var Ke=class extends W.LitElement{constructor(){super(...arguments),this.options={state:{},render:(e,t,n)=>(0,W.html)` ${e} `,style:(0,W.css)``,styles:[],deepCloneState:!1,loading:()=>(0,W.html)``,error:e=>(0,W.html)`${e?.message}`},this.loading=!0,this.state={}}OnUpdateFirst(){var e,t,n;return Fl(this,void 0,void 0,function*(){!((e=this.options)===null||e===void 0)&&e.style&&(0,W.adoptStyles)(this.shadowRoot,[this.options.style]),!((n=(t=this.options)===null||t===void 0?void 0:t.styles)===null||n===void 0)&&n.length&&(0,W.adoptStyles)(this.shadowRoot,this.options.styles),this.options.state=yield this.options.state,this.options.state&&(this.isObservable(this.options.state)?this.subscription=this.options.state.subscribe(o=>{this.state=o,this.loading=!1,this.dispatchEvent(new CustomEvent("onData",{detail:o}))},o=>{this.state=null,this.error=o,this.loading=!1,this.dispatchEvent(new CustomEvent("onError",{detail:o}))}):(this.loading=!1,this.state=this.options.state),yield this.updateComplete,yield new Promise(requestAnimationFrame),this.dispatchEvent(new CustomEvent("loaded")))})}isObservable(e){return this.isFunction(e.lift)&&this.isFunction(e.subscribe)}isFunction(e){return typeof e=="function"}OnDestroy(){this.subscription&&this.subscription.unsubscribe()}renderContent(){if(!this.error&&this.options.render){let e=this.options.render(this.options.deepCloneState?JSON.parse(JSON.stringify(this.state)):this.state,t=>this.state=Object.assign({},t),this.shadowRoot);return e?.strings?e:(0,W.html)``}return this.state}};fe.Renderer=Ke;Yt([(0,W.property)({type:Object}),Wr("design:type",Object)],Ke.prototype,"options",void 0);Yt([(0,W.property)({type:Boolean}),Wr("design:type",Object)],Ke.prototype,"loading",void 0);Yt([(0,W.property)({type:Object}),Wr("design:type",Error)],Ke.prototype,"error",void 0);Yt([(0,W.property)(),Wr("design:type",Object)],Ke.prototype,"state",void 0);fe.Renderer=Ke=Yt([Hl({selector:"r-renderer",template(){return(0,W.html)`
|
|
19
17
|
${this.loading?"":this.renderContent()}
|
|
20
|
-
${this.loading?(0,
|
|
21
|
-
${this.isFunction(this.options.loading)?this.options.loading():(0,
|
|
18
|
+
${this.loading?(0,W.html)`
|
|
19
|
+
${this.isFunction(this.options.loading)?this.options.loading():(0,W.html)``}
|
|
22
20
|
`:""}
|
|
23
|
-
${this.error?(0,
|
|
24
|
-
${this.isFunction(this.options.error)?this.options.error(this.error):(0,
|
|
21
|
+
${this.error?(0,W.html)`
|
|
22
|
+
${this.isFunction(this.options.error)?this.options.error(this.error):(0,W.html)` ${this.error} `}
|
|
25
23
|
`:""}
|
|
26
|
-
`}})],
|
|
24
|
+
`}})],Ke)});var Ps=xe(Ye=>{"use strict";var Wl=Ye&&Ye.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var o=Object.getOwnPropertyDescriptor(e,t);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,o)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),zl=Ye&&Ye.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Wl(e,r,t)};Object.defineProperty(Ye,"__esModule",{value:!0});zl(ks(),Ye)});var Rs=xe(de=>{"use strict";var Vl=de&&de.__awaiter||function(r,e,t,n){function o(i){return i instanceof t?i:new t(function(s){s(i)})}return new(t||(t=Promise))(function(i,s){function l(u){try{c(n.next(u))}catch(p){s(p)}}function a(u){try{c(n.throw(u))}catch(p){s(p)}}function c(u){u.done?i(u.value):o(u.value).then(l,a)}c((n=n.apply(r,e||[])).next())})};Object.defineProperty(de,"__esModule",{value:!0});de.Component=de.Partial=de.DefineDependencies=void 0;Ps();var Is=Kt(),Bl=(...r)=>e=>{for(let[t,n]of r.entries())Object.defineProperty(r,t,{get:()=>e?.has(n)?e.get(n):n});return r};de.DefineDependencies=Bl;function Kl(){var r;return Vl(this,void 0,void 0,function*(){yield this.updateComplete,yield new Promise(requestAnimationFrame),(r=this.OnRendererLoaded)===null||r===void 0||r.call(this)})}var Yl=r=>(e=[])=>(t=()=>({}))=>(n=()=>null)=>(o=()=>null)=>(i=()=>t)=>(0,Is.Component)(Object.assign(Object.assign({},r),{template(){return(0,Is.html)`
|
|
27
25
|
<r-renderer
|
|
28
26
|
style="display: contents;"
|
|
29
|
-
@loaded=${
|
|
30
|
-
.options=${{state:t.bind(this).call(this,e),loading:n.bind(this),style:r.style,styles:r.styles,error:o.bind(this),deepCloneState:r.deepCloneState,render:(s,a
|
|
27
|
+
@loaded=${Kl.bind(this)}
|
|
28
|
+
.options=${{state:t.bind(this).call(this,e),loading:n.bind(this),style:r.style,styles:r.styles,error:o.bind(this),deepCloneState:r.deepCloneState,render:(s,l,a)=>(this.shadowRoot.append(a),i(e).bind(this).call(this,s,l,a))}}
|
|
31
29
|
></r-renderer>
|
|
32
|
-
`}}));
|
|
33
|
-
|
|
30
|
+
`}}));de.Partial=Yl;function Gl({Settings:r,Providers:e,State:t,Render:n,Loading:o,Error:i}){return(0,de.Partial)(r)(e)(t)(o)(i)(n)}de.Component=Gl});var an=function(r,e){return an=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},an(r,e)};function z(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");an(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function uo(r,e,t,n){function o(i){return i instanceof t?i:new t(function(s){s(i)})}return new(t||(t=Promise))(function(i,s){function l(u){try{c(n.next(u))}catch(p){s(p)}}function a(u){try{c(n.throw(u))}catch(p){s(p)}}function c(u){u.done?i(u.value):o(u.value).then(l,a)}c((n=n.apply(r,e||[])).next())})}function nr(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=l(0),s.throw=l(1),s.return=l(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(c){return function(u){return a([c,u])}}function a(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(t=0)),t;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,o=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1],i=c;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(c);break}i[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function we(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function F(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(l){s={error:l}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(s)throw s.error}}return i}function H(r,e,t){if(t||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))}function Le(r){return this instanceof Le?(this.v=r,this):new Le(r)}function po(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(f){return function(v){return Promise.resolve(v).then(f,p)}}function l(f,v){n[f]&&(o[f]=function(h){return new Promise(function(m,b){i.push([f,h,m,b])>1||a(f,h)})},v&&(o[f]=v(o[f])))}function a(f,v){try{c(n[f](v))}catch(h){d(i[0][3],h)}}function c(f){f.value instanceof Le?Promise.resolve(f.value.v).then(u,p):d(i[0][2],f)}function u(f){a("next",f)}function p(f){a("throw",f)}function d(f,v){f(v),i.shift(),i.length&&a(i[0][0],i[0][1])}}function fo(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof we=="function"?we(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=r[i]&&function(s){return new Promise(function(l,a){s=r[i](s),o(l,a,s.done,s.value)})}}function o(i,s,l,a){Promise.resolve(a).then(function(c){i({value:c,done:l})},s)}}function g(r){return typeof r=="function"}function or(r){var e=function(n){Error.call(n),n.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var ir=or(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
31
|
+
`+t.map(function(n,o){return o+1+") "+n.toString()}).join(`
|
|
32
|
+
`):"",this.name="UnsubscriptionError",this.errors=t}});function Ue(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var Z=(function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,n,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var l=we(s),a=l.next();!a.done;a=l.next()){var c=a.value;c.remove(this)}}catch(h){e={error:h}}finally{try{a&&!a.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else s.remove(this);var u=this.initialTeardown;if(g(u))try{u()}catch(h){i=h instanceof ir?h.errors:[h]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var d=we(p),f=d.next();!f.done;f=d.next()){var v=f.value;try{ho(v)}catch(h){i=i??[],h instanceof ir?i=H(H([],F(i)),F(h.errors)):i.push(h)}}}catch(h){n={error:h}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}}if(i)throw new ir(i)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)ho(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Ue(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&Ue(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=(function(){var e=new r;return e.closed=!0,e})(),r})();var ln=Z.EMPTY;function sr(r){return r instanceof Z||r&&"closed"in r&&g(r.remove)&&g(r.add)&&g(r.unsubscribe)}function ho(r){g(r)?r():r.unsubscribe()}var se={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Qe={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var o=Qe.delegate;return o?.setTimeout?o.setTimeout.apply(o,H([r,e],F(t))):setTimeout.apply(void 0,H([r,e],F(t)))},clearTimeout:function(r){var e=Qe.delegate;return(e?.clearTimeout||clearTimeout)(r)},delegate:void 0};function ar(r){Qe.setTimeout(function(){var e=se.onUnhandledError;if(e)e(r);else throw r})}function ae(){}var mo=(function(){return cn("C",void 0,void 0)})();function vo(r){return cn("E",void 0,r)}function go(r){return cn("N",r,void 0)}function cn(r,e,t){return{kind:r,value:e,error:t}}var De=null;function et(r){if(se.useDeprecatedSynchronousErrorHandling){var e=!De;if(e&&(De={errorThrown:!1,error:null}),r(),e){var t=De,n=t.errorThrown,o=t.error;if(De=null,n)throw o}}else r()}function yo(r){se.useDeprecatedSynchronousErrorHandling&&De&&(De.errorThrown=!0,De.error=r)}var _t=(function(r){z(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,sr(t)&&t.add(n)):n.destination=sa,n}return e.create=function(t,n,o){return new qe(t,n,o)},e.prototype.next=function(t){this.isStopped?pn(go(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?pn(vo(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?pn(mo,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(Z);var na=Function.prototype.bind;function un(r,e){return na.call(r,e)}var oa=(function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){lr(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){lr(n)}else lr(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){lr(t)}},r})(),qe=(function(r){z(e,r);function e(t,n,o){var i=r.call(this)||this,s;if(g(t)||!t)s={next:t??void 0,error:n??void 0,complete:o??void 0};else{var l;i&&se.useDeprecatedNextContext?(l=Object.create(t),l.unsubscribe=function(){return i.unsubscribe()},s={next:t.next&&un(t.next,l),error:t.error&&un(t.error,l),complete:t.complete&&un(t.complete,l)}):s=t}return i.destination=new oa(s),i}return e})(_t);function lr(r){se.useDeprecatedSynchronousErrorHandling?yo(r):ar(r)}function ia(r){throw r}function pn(r,e){var t=se.onStoppedNotification;t&&Qe.setTimeout(function(){return t(r,e)})}var sa={closed:!0,next:ae,error:ia,complete:ae};var tt=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function X(r){return r}function fn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return dn(r)}function dn(r){return r.length===0?X:r.length===1?r[0]:function(t){return r.reduce(function(n,o){return o(n)},t)}}var _=(function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var o=this,i=la(e)?e:new qe(e,t,n);return et(function(){var s=o,l=s.operator,a=s.source;i.add(l?l.call(i,a):a?o._subscribe(i):o._trySubscribe(i))}),i},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=bo(t),new t(function(o,i){var s=new qe({next:function(l){try{e(l)}catch(a){i(a),s.unsubscribe()}},error:i,complete:o});n.subscribe(s)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[tt]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return dn(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=bo(e),new e(function(n,o){var i;t.subscribe(function(s){return i=s},function(s){return o(s)},function(){return n(i)})})},r.create=function(e){return new r(e)},r})();function bo(r){var e;return(e=r??se.Promise)!==null&&e!==void 0?e:Promise}function aa(r){return r&&g(r.next)&&g(r.error)&&g(r.complete)}function la(r){return r&&r instanceof _t||aa(r)&&sr(r)}function ca(r){return g(r?.lift)}function x(r){return function(e){if(ca(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function S(r,e,t,n,o){return new ua(r,e,t,n,o)}var ua=(function(r){z(e,r);function e(t,n,o,i,s,l){var a=r.call(this,t)||this;return a.onFinalize=s,a.shouldUnsubscribe=l,a._next=n?function(c){try{n(c)}catch(u){t.error(u)}}:r.prototype._next,a._error=i?function(c){try{i(c)}catch(u){t.error(u)}finally{this.unsubscribe()}}:r.prototype._error,a._complete=o?function(){try{o()}catch(c){t.error(c)}finally{this.unsubscribe()}}:r.prototype._complete,a}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e})(_t);var xo=or(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var te=(function(r){z(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var n=new wo(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new xo},e.prototype.next=function(t){var n=this;et(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var s=we(n.currentObservers),l=s.next();!l.done;l=s.next()){var a=l.value;a.next(t)}}catch(c){o={error:c}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}})},e.prototype.error=function(t){var n=this;et(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var o=n.observers;o.length;)o.shift().error(t)}})},e.prototype.complete=function(){var t=this;et(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,o=this,i=o.hasError,s=o.isStopped,l=o.observers;return i||s?ln:(this.currentObservers=null,l.push(t),new Z(function(){n.currentObservers=null,Ue(l,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,o=n.hasError,i=n.thrownError,s=n.isStopped;o?t.error(i):s&&t.complete()},e.prototype.asObservable=function(){var t=new _;return t.source=this,t},e.create=function(t,n){return new wo(t,n)},e})(_);var wo=(function(r){z(e,r);function e(t,n){var o=r.call(this)||this;return o.destination=t,o.source=n,o}return e.prototype.next=function(t){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,t)},e.prototype.error=function(t){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&o!==void 0?o:ln},e})(te);var St={now:function(){return(St.delegate||Date).now()},delegate:void 0};var _o=(function(r){z(e,r);function e(t,n,o){t===void 0&&(t=1/0),n===void 0&&(n=1/0),o===void 0&&(o=St);var i=r.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return e.prototype.next=function(t){var n=this,o=n.isStopped,i=n._buffer,s=n._infiniteTimeWindow,l=n._timestampProvider,a=n._windowTime;o||(i.push(t),!s&&i.push(l.now()+a)),this._trimBuffer(),r.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(t),o=this,i=o._infiniteTimeWindow,s=o._buffer,l=s.slice(),a=0;a<l.length&&!t.closed;a+=i?1:2)t.next(l[a]);return this._checkFinalizedStatuses(t),n},e.prototype._trimBuffer=function(){var t=this,n=t._bufferSize,o=t._timestampProvider,i=t._buffer,s=t._infiniteTimeWindow,l=(s?1:2)*n;if(n<1/0&&l<i.length&&i.splice(0,i.length-l),!s){for(var a=o.now(),c=0,u=1;u<i.length&&i[u]<=a;u+=2)c=u;c&&i.splice(0,c+1)}},e})(te);var So=(function(r){z(e,r);function e(t,n){return r.call(this)||this}return e.prototype.schedule=function(t,n){return n===void 0&&(n=0),this},e})(Z);var $t={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var o=$t.delegate;return o?.setInterval?o.setInterval.apply(o,H([r,e],F(t))):setInterval.apply(void 0,H([r,e],F(t)))},clearInterval:function(r){var e=$t.delegate;return(e?.clearInterval||clearInterval)(r)},delegate:void 0};var $o=(function(r){z(e,r);function e(t,n){var o=r.call(this,t,n)||this;return o.scheduler=t,o.work=n,o.pending=!1,o}return e.prototype.schedule=function(t,n){var o;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(t,n,o){return o===void 0&&(o=0),$t.setInterval(t.flush.bind(t,this),o)},e.prototype.recycleAsyncId=function(t,n,o){if(o===void 0&&(o=0),o!=null&&this.delay===o&&this.pending===!1)return n;n!=null&&$t.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var o=this._execute(t,n);if(o)return o;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var o=!1,i;try{this.work(t)}catch(s){o=!0,i=s||new Error("Scheduled action threw falsy error")}if(o)return this.unsubscribe(),i},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,o=t.scheduler,i=o.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Ue(i,this),n!=null&&(this.id=this.recycleAsyncId(o,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e})(So);var hn=(function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=St.now,r})();var Ao=(function(r){z(e,r);function e(t,n){n===void 0&&(n=hn.now);var o=r.call(this,t,n)||this;return o.actions=[],o._active=!1,o}return e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var o;this._active=!0;do if(o=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,o){for(;t=n.shift();)t.unsubscribe();throw o}},e})(hn);var pa=new Ao($o),Eo=pa;var le=new _(function(r){return r.complete()});function cr(r){return r&&g(r.schedule)}function mn(r){return r[r.length-1]}function ur(r){return g(mn(r))?r.pop():void 0}function me(r){return cr(mn(r))?r.pop():void 0}function Co(r,e){return typeof mn(r)=="number"?r.pop():e}var pr=(function(r){return r&&typeof r.length=="number"&&typeof r!="function"});function fr(r){return g(r?.then)}function dr(r){return g(r[tt])}function hr(r){return Symbol.asyncIterator&&g(r?.[Symbol.asyncIterator])}function mr(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function fa(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var vr=fa();function gr(r){return g(r?.[vr])}function yr(r){return po(this,arguments,function(){var t,n,o,i;return nr(this,function(s){switch(s.label){case 0:t=r.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,Le(t.read())];case 3:return n=s.sent(),o=n.value,i=n.done,i?[4,Le(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,Le(o)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function br(r){return g(r?.getReader)}function P(r){if(r instanceof _)return r;if(r!=null){if(dr(r))return da(r);if(pr(r))return ha(r);if(fr(r))return ma(r);if(hr(r))return To(r);if(gr(r))return va(r);if(br(r))return ga(r)}throw mr(r)}function da(r){return new _(function(e){var t=r[tt]();if(g(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ha(r){return new _(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function ma(r){return new _(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,ar)})}function va(r){return new _(function(e){var t,n;try{for(var o=we(r),i=o.next();!i.done;i=o.next()){var s=i.value;if(e.next(s),e.closed)return}}catch(l){t={error:l}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}e.complete()})}function To(r){return new _(function(e){ya(r,e).catch(function(t){return e.error(t)})})}function ga(r){return To(yr(r))}function ya(r,e){var t,n,o,i;return uo(this,void 0,void 0,function(){var s,l;return nr(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),t=fo(r),a.label=1;case 1:return[4,t.next()];case 2:if(n=a.sent(),!!n.done)return[3,4];if(s=n.value,e.next(s),e.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=a.sent(),o={error:l},[3,11];case 6:return a.trys.push([6,,9,10]),n&&!n.done&&(i=t.return)?[4,i.call(t)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Y(r,e,t,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var i=e.schedule(function(){t(),o?r.add(this.schedule(null,n)):this.unsubscribe()},n);if(r.add(i),!o)return i}function xr(r,e){return e===void 0&&(e=0),x(function(t,n){t.subscribe(S(n,function(o){return Y(n,r,function(){return n.next(o)},e)},function(){return Y(n,r,function(){return n.complete()},e)},function(o){return Y(n,r,function(){return n.error(o)},e)}))})}function wr(r,e){return e===void 0&&(e=0),x(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}function Oo(r,e){return P(r).pipe(wr(e),xr(e))}function ko(r,e){return P(r).pipe(wr(e),xr(e))}function Po(r,e){return new _(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}function Io(r,e){return new _(function(t){var n;return Y(t,e,function(){n=r[vr](),Y(t,e,function(){var o,i,s;try{o=n.next(),i=o.value,s=o.done}catch(l){t.error(l);return}s?t.complete():t.next(i)},0,!0)}),function(){return g(n?.return)&&n.return()}})}function _r(r,e){if(!r)throw new Error("Iterable cannot be null");return new _(function(t){Y(t,e,function(){var n=r[Symbol.asyncIterator]();Y(t,e,function(){n.next().then(function(o){o.done?t.complete():t.next(o.value)})},0,!0)})})}function Ro(r,e){return _r(yr(r),e)}function Mo(r,e){if(r!=null){if(dr(r))return Oo(r,e);if(pr(r))return Po(r,e);if(fr(r))return ko(r,e);if(hr(r))return _r(r,e);if(gr(r))return Io(r,e);if(br(r))return Ro(r,e)}throw mr(r)}function V(r,e){return e?Mo(r,e):P(r)}function R(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=me(r);return V(r,t)}function At(r,e){var t=g(r)?r:function(){return r},n=function(o){return o.error(t())};return new _(e?function(o){return e.schedule(n,0,o)}:n)}function Et(r){return!!r&&(r instanceof _||g(r.lift)&&g(r.subscribe))}function jo(r){return r instanceof Date&&!isNaN(r)}function j(r,e){return x(function(t,n){var o=0;t.subscribe(S(n,function(i){n.next(r.call(e,i,o++))}))})}var ba=Array.isArray;function xa(r,e){return ba(e)?r.apply(void 0,H([],F(e))):r(e)}function Lo(r){return j(function(e){return xa(r,e)})}var wa=Array.isArray,_a=Object.getPrototypeOf,Sa=Object.prototype,$a=Object.keys;function Uo(r){if(r.length===1){var e=r[0];if(wa(e))return{args:e,keys:null};if(Aa(e)){var t=$a(e);return{args:t.map(function(n){return e[n]}),keys:t}}}return{args:r,keys:null}}function Aa(r){return r&&typeof r=="object"&&_a(r)===Sa}function Do(r,e){return r.reduce(function(t,n,o){return t[n]=e[o],t},{})}function vn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=me(r),n=ur(r),o=Uo(r),i=o.args,s=o.keys;if(i.length===0)return V([],t);var l=new _(Ea(i,t,s?function(a){return Do(s,a)}:X));return n?l.pipe(Lo(n)):l}function Ea(r,e,t){return t===void 0&&(t=X),function(n){qo(e,function(){for(var o=r.length,i=new Array(o),s=o,l=o,a=function(u){qo(e,function(){var p=V(r[u],e),d=!1;p.subscribe(S(n,function(f){i[u]=f,d||(d=!0,l--),l||n.next(t(i.slice()))},function(){--s||n.complete()}))},n)},c=0;c<o;c++)a(c)},n)}}function qo(r,e,t){r?Y(t,r,e):e()}function No(r,e,t,n,o,i,s,l){var a=[],c=0,u=0,p=!1,d=function(){p&&!a.length&&!c&&e.complete()},f=function(h){return c<n?v(h):a.push(h)},v=function(h){i&&e.next(h),c++;var m=!1;P(t(h,u++)).subscribe(S(e,function(b){o?.(b),i?f(b):e.next(b)},function(){m=!0},void 0,function(){if(m)try{c--;for(var b=function(){var K=a.shift();s?Y(e,s,function(){return v(K)}):v(K)};a.length&&c<n;)b();d()}catch(K){e.error(K)}}))};return r.subscribe(S(e,f,function(){p=!0,d()})),function(){l?.()}}function re(r,e,t){return t===void 0&&(t=1/0),g(e)?re(function(n,o){return j(function(i,s){return e(n,i,o,s)})(P(r(n,o)))},t):(typeof e=="number"&&(t=e),x(function(n,o){return No(n,o,r,t)}))}function Sr(r){return r===void 0&&(r=1/0),re(X,r)}function Fo(){return Sr(1)}function Ae(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Fo()(V(r,me(r)))}function Ct(r){return new _(function(e){P(r()).subscribe(e)})}function $r(r,e,t){r===void 0&&(r=0),t===void 0&&(t=Eo);var n=-1;return e!=null&&(cr(e)?t=e:n=e),new _(function(o){var i=jo(r)?+r-t.now():r;i<0&&(i=0);var s=0;return t.schedule(function(){o.closed||(o.next(s++),0<=n?this.schedule(void 0,n):o.complete())},i)})}function Ee(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=me(r),n=Co(r,1/0),o=r;return o.length?o.length===1?P(o[0]):Sr(n)(V(o,t)):le}var gn=new _(ae);function ve(r,e){return x(function(t,n){var o=0;t.subscribe(S(n,function(i){return r.call(e,i,o++)&&n.next(i)}))})}function G(r){return x(function(e,t){var n=null,o=!1,i;n=e.subscribe(S(t,void 0,void 0,function(s){i=P(r(s,G(r)(e))),n?(n.unsubscribe(),n=null,i.subscribe(t)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(t))})}function Ho(r,e,t,n,o){return function(i,s){var l=t,a=e,c=0;i.subscribe(S(s,function(u){var p=c++;a=l?r(a,u,p):(l=!0,u),n&&s.next(a)},o&&(function(){l&&s.next(a),s.complete()})))}}function Tt(r,e){return g(e)?re(r,e,1):re(r,1)}function Ne(r){return r<=0?function(){return le}:x(function(e,t){var n=0;e.subscribe(S(t,function(o){++n<=r&&(t.next(o),r<=n&&t.complete())}))})}function rt(){return x(function(r,e){r.subscribe(S(e,ae))})}function yn(r,e){return e===void 0&&(e=X),r=r??Ca,x(function(t,n){var o,i=!0;t.subscribe(S(n,function(s){var l=e(s);(i||!r(o,l))&&(i=!1,o=l,n.next(s))}))})}function Ca(r,e){return r===e}function bn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return function(t){return Ae(t,R.apply(void 0,H([],F(r))))}}function Ar(r,e){return e?function(t){return t.pipe(Ar(function(n,o){return P(r(n,o)).pipe(j(function(i,s){return e(n,i,o,s)}))}))}:x(function(t,n){var o=0,i=null,s=!1;t.subscribe(S(n,function(l){i||(i=S(n,void 0,function(){i=null,s&&n.complete()}),P(r(l,o++)).subscribe(i))},function(){s=!0,!i&&n.complete()}))})}function Ot(r){return x(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})}function xn(r,e){return x(Ho(r,e,arguments.length>=2,!0))}function kt(r){r===void 0&&(r={});var e=r.connector,t=e===void 0?function(){return new te}:e,n=r.resetOnError,o=n===void 0?!0:n,i=r.resetOnComplete,s=i===void 0?!0:i,l=r.resetOnRefCountZero,a=l===void 0?!0:l;return function(c){var u,p,d,f=0,v=!1,h=!1,m=function(){p?.unsubscribe(),p=void 0},b=function(){m(),u=d=void 0,v=h=!1},K=function(){var ie=u;b(),ie?.unsubscribe()};return x(function(ie,be){f++,!h&&!v&&m();var Me=d=d??t();be.add(function(){f--,f===0&&!h&&!v&&(p=wn(K,a))}),Me.subscribe(be),!u&&f>0&&(u=new qe({next:function(je){return Me.next(je)},error:function(je){h=!0,m(),p=wn(b,o,je),Me.error(je)},complete:function(){v=!0,m(),p=wn(b,s),Me.complete()}}),P(ie).subscribe(u))})(c)}}function wn(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];if(e===!0){r();return}if(e!==!1){var o=new qe({next:function(){o.unsubscribe(),r()}});return P(e.apply(void 0,H([],F(t)))).subscribe(o)}}function nt(r,e,t){var n,o,i,s,l=!1;return r&&typeof r=="object"?(n=r.bufferSize,s=n===void 0?1/0:n,o=r.windowTime,e=o===void 0?1/0:o,i=r.refCount,l=i===void 0?!1:i,t=r.scheduler):s=r??1/0,kt({connector:function(){return new _o(s,e,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:l})}function _n(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=me(r);return x(function(n,o){(t?Ae(r,n,t):Ae(r,n)).subscribe(o)})}function B(r,e){return x(function(t,n){var o=null,i=0,s=!1,l=function(){return s&&!o&&n.complete()};t.subscribe(S(n,function(a){o?.unsubscribe();var c=0,u=i++;P(r(a,u)).subscribe(o=S(n,function(p){return n.next(e?e(a,p,u,c++):p)},function(){o=null,l()}))},function(){s=!0,l()}))})}function Fe(r){return x(function(e,t){P(r).subscribe(S(t,function(){return t.complete()},ae)),!t.closed&&e.subscribe(t)})}function Pt(r,e){return e===void 0&&(e=!1),x(function(t,n){var o=0;t.subscribe(S(n,function(i){var s=r(i,o++);(s||e)&&n.next(i),!s&&n.complete()}))})}function _e(r,e,t){var n=g(r)||e||t?{next:r,error:e,complete:t}:r;return n?x(function(o,i){var s;(s=n.subscribe)===null||s===void 0||s.call(n);var l=!0;o.subscribe(S(i,function(a){var c;(c=n.next)===null||c===void 0||c.call(n,a),i.next(a)},function(){var a;l=!1,(a=n.complete)===null||a===void 0||a.call(n),i.complete()},function(a){var c;l=!1,(c=n.error)===null||c===void 0||c.call(n,a),i.error(a)},function(){var a,c;l&&((a=n.unsubscribe)===null||a===void 0||a.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):X}function Sn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=ur(r);return x(function(n,o){for(var i=r.length,s=new Array(i),l=r.map(function(){return!1}),a=!1,c=function(p){P(r[p]).subscribe(S(o,function(d){s[p]=d,!a&&!l[p]&&(l[p]=!0,(a=l.every(X))&&(l=null))},ae))},u=0;u<i;u++)c(u);n.subscribe(S(o,function(p){if(a){var d=H([p],F(s));o.next(t?t.apply(void 0,H([],F(d))):d)}}))})}var It=`id name type description instructions tools isActive modelName mcpLambdaId mcpLambdaName createdAt updatedAt
|
|
33
|
+
embed { published identity allowedOrigins welcome suggestions showToolDetails maxMessagesPerConversation retentionDays publishedAt }`,Vo="id name description welcome suggestions",$n=`token expiresAt agents { ${Vo} }`,Wo="id agentId title messageCount lastSeq answering lastMessageAt createdAt",Ta="id role text toolCalls { name status } createdAt",zo="conversationId seq type runId data createdAt",ce={listAgents:`query ($projectId: String!) { listProjectAgents(projectId: $projectId) { ${It} } }`,getAgent:`query ($id: String!) { getProjectAgent(id: $id) { ${It} } }`,createAgent:`mutation ($projectId: String!, $payload: CreateProjectAgentInput!) { createProjectAgent(projectId: $projectId, payload: $payload) { ${It} } }`,updateAgent:`mutation ($id: String!, $payload: UpdateProjectAgentInput!) { updateProjectAgent(id: $id, payload: $payload) { ${It} } }`,deleteAgent:"mutation ($id: String!) { deleteProjectAgent(id: $id) }",updateEmbed:`mutation ($agentId: String!, $embed: AgentEmbedInput!) { updateAgentEmbed(agentId: $agentId, embed: $embed) { ${It} } }`,createSession:`mutation ($subject: String!, $agents: [String], $claims: JSON, $ttlSeconds: Int, $origin: String) { createAgentSession(subject: $subject, agents: $agents, claims: $claims, ttlSeconds: $ttlSeconds, origin: $origin) { ${$n} } }`,exchangeSession:`mutation ($projectId: String!, $token: String!, $agents: [String]) { exchangeAgentSession(projectId: $projectId, token: $token, agents: $agents) { ${$n} } }`,anonymousSession:`mutation ($deviceId: String!, $turnstileToken: String!, $agents: [String]) { createAnonymousAgentSession(deviceId: $deviceId, turnstileToken: $turnstileToken, agents: $agents) { ${$n} } }`,sessionAgents:`query { sessionAgents { ${Vo} } }`,conversations:`query ($agent: String) { agentConversations(agent: $agent) { ${Wo} } }`,conversation:`query ($id: String!) { agentConversation(id: $id) { ${Wo} messages { ${Ta} } } }`,events:`query ($conversationId: String!, $afterSeq: Int) { agentConversationEvents(conversationId: $conversationId, afterSeq: $afterSeq) { ${zo} } }`,send:"mutation ($agent: String!, $conversationId: String, $text: String!, $credential: String) { sendAgentMessage(agent: $agent, conversationId: $conversationId, text: $text, credential: $credential) { conversationId runId seq } }",abort:"mutation ($conversationId: String!) { abortAgentRun(conversationId: $conversationId) }",liveEvents:`subscription ($conversationId: String!) { agentEvents(conversationId: $conversationId) { ${zo} } }`};var Oa=["limit-reached","cap-reached","agent-unavailable","session-expired","credential-expired","aborted","internal"],U=class extends Error{constructor(t,n,o){super(t);this.code=n;this.status=o;this.name="LambforgeError"}};function Rt(r,e){let t=r?.[0]??{},n=String(t.message??"Request failed"),o=n.match(/^([a-z-]+):/)?.[1];return o&&Oa.includes(o)?new U(n,o,e):n==="session-expired"?new U(n,"session-expired",e):t.extensions?.code==="UNAUTHENTICATED"||/not authorized|unauthorized|invalid sign-in token/i.test(n)?new U(n,"unauthorized",e):new U(n,"bad-request",e)}var Er="https://api.lambforge.com",ka=r=>`${r.replace(/\/+$/,"")}/graphql`,Bo=r=>`${r.replace(/\/+$/,"").replace(/^http/,"ws")}/subscriptions`;function Mt(r,e,t,n,o){return new _(i=>{let s=new AbortController,l=r.fetch??globalThis.fetch;if(!l){i.error(new U("No fetch available","network"));return}return l(ka(r.url),{method:"POST",headers:{"content-type":"application/json",...e?{authorization:e}:{}},body:JSON.stringify({query:t,variables:n}),signal:s.signal}).then(async a=>{let c;try{c=await a.json()}catch{throw new U(`Lambforge answered ${a.status}`,a.status===401?"unauthorized":"network",a.status)}if(c.errors?.length)throw Rt(c.errors,a.status);if(!c.data||!(o in c.data))throw new U(`Lambforge answered ${a.status} without ${o}`,"network",a.status);i.next(c.data[o]),i.complete()}).catch(a=>{s.signal.aborted||i.error(a instanceof U?a:new U(String(a?.message??a),"network"))}),()=>s.abort()})}var Ko=["graphql-ws","graphql-transport-ws"];function Yo(r){return new _(e=>{let n=!1,o=new r.WebSocket(r.url,Ko),i=()=>o.protocol==="graphql-transport-ws",s=a=>{o.readyState===1&&o.send(JSON.stringify(a))},l=a=>{if(!n){n=!0,e.error(a);try{o.close(1e3)}catch{}}};return o.onopen=()=>s({type:"connection_init",payload:r.connectionParams}),o.onmessage=a=>{let c;try{c=JSON.parse(String(a.data))}catch{return}switch(c.type){case"connection_ack":s({id:"1",type:i()?"subscribe":"start",payload:{query:r.query,variables:r.variables}}),r.onStarted?.();return;case"ping":s({type:"pong"});return;case"next":case"data":{let u=c.payload;if(u?.errors?.length){l(Rt(u.errors));return}u?.data&&e.next(u.data[r.field]);return}case"error":l(Rt(Array.isArray(c.payload)?c.payload:[c.payload]));return;case"connection_error":l(new U(String(c.payload?.message??"connection refused"),"unauthorized"));return;case"complete":if(n)return;n=!0,e.complete(),o.close(1e3);return;default:return}},o.onclose=a=>{if(n)return;let c=a?.code===4401||a?.code===4403;l(new U(`connection closed${a?.code?` (${a.code}${a.reason?` ${a.reason}`:""})`:""}`,c?"unauthorized":"network"))},o.onerror=()=>{},()=>{n||(n=!0,s({id:"1",type:i()?"complete":"stop"})),o.onmessage=o.onclose=o.onerror=o.onopen=null;try{o.close(1e3)}catch{}}})}var An=r=>Ct(()=>{let e=r();return Et(e)?e.pipe(Ne(1)):V(Promise.resolve(e))}),Pa=6e4,Go="lambforge.agents.device",Ia=15e3,He=class{constructor(e){this.options=e;this.current=null;this.pending$=null;if([e.getToken,e.exchange,e.anonymous].filter(Boolean).length!==1)throw new U("AgentClient: give exactly one of getToken, exchange or anonymous","bad-request");if(e.anonymous&&!e.anonymous.publishableKey.startsWith("lfp_"))throw new U("AgentClient: anonymous visitors need a publishable key (lfp_...)","bad-request");this.endpoint={url:e.url??Er,fetch:e.fetch}}token$(){return this.current&&Date.now()<this.current.renewAt?R(this.current.token):(this.pending$||(this.pending$=this.session$().pipe(_e(e=>{let t=e.expiresAt?Date.parse(e.expiresAt):NaN;this.current={token:e.token,renewAt:Number.isFinite(t)?Math.max(Date.now()+3e4,t-Pa):Date.now()+50*6e4}}),j(e=>e.token),Ot(()=>this.pending$=null),nt(1))),this.pending$)}invalidate(){this.current=null}session$(){let e=this.options;if(e.getToken)return An(e.getToken).pipe(j(n=>typeof n=="string"?{token:n}:n));if(e.exchange){let{projectId:n,idToken:o,agents:i}=e.exchange;return An(o).pipe(B(s=>Mt(this.endpoint,null,ce.exchangeSession,{projectId:n,token:s,agents:i},"exchangeAgentSession")))}let t=e.anonymous;return An(t.turnstileToken).pipe(B(n=>Mt(this.endpoint,t.publishableKey,ce.anonymousSession,{deviceId:t.deviceId??Jo(),turnstileToken:n,agents:t.agents},"createAnonymousAgentSession")))}call$(e,t,n){let o=()=>this.token$().pipe(B(i=>Mt(this.endpoint,i,e,t,n)));return o().pipe(G(i=>i?.code!=="session-expired"&&i?.code!=="unauthorized"?At(()=>i):(this.invalidate(),o())))}agents(){return this.call$(ce.sessionAgents,{},"sessionAgents")}conversations(e){return this.call$(ce.conversations,{agent:e},"agentConversations")}agent(e){return{conversation:t=>new Cr(this,e,t??null),conversations:()=>this.conversations(e)}}events(e,t=0){return new _(n=>{let o=t,i=new Map,s=new Z,l=!1,a=!1,c=()=>{for(;i.has(o+1);){let m=i.get(o+1);i.delete(o+1),o=m.seq,n.next(m)}},u=m=>{!m||m.seq<=o||(i.set(m.seq,m),c(),i.size&&p())},p=()=>{if(l){a=!0;return}l=!0,s.add(this.call$(ce.events,{conversationId:e,afterSeq:o},"agentConversationEvents").subscribe({next:m=>{m.forEach(b=>i.set(b.seq,b)),c(),i.size&&!m.length&&(o=Math.min(...i.keys())-1,c())},error:m=>{l=!1,n.error(m)},complete:()=>{l=!1,a&&(a=!1,p())}}))},d=this.webSocket();if(!d)return p(),s.add($r(this.options.pollIntervalMs??1500,this.options.pollIntervalMs??1500).subscribe(()=>p())),s;let f=0,v=!1,h=()=>{s.add(this.token$().pipe(B(m=>Yo({url:Bo(this.endpoint.url),WebSocket:d,connectionParams:{agentSession:m},query:ce.liveEvents,variables:{conversationId:e},field:"agentEvents",onStarted:()=>{f=0,v=!1,p()}}))).subscribe({next:u,error:m=>{if(m?.code==="unauthorized"&&!v){v=!0,this.invalidate(),h();return}if(m?.code!=="network"){n.error(m);return}let b=Math.min(Ia,1e3*2**f++);s.add($r(b*(.75+Math.random()/2)).subscribe(h))},complete:()=>n.complete()}))};return h(),s})}webSocket(){return this.options.WebSocket===!1?null:this.options.WebSocket??(globalThis.WebSocket||null)}},Cr=class{constructor(e,t,n){this.client=e;this.agent=t;this.id=n}send(e,t={}){return this.client.call$(ce.send,{agent:this.agent,conversationId:this.id,text:e,credential:t.credential},"sendAgentMessage").pipe(_e(n=>this.id=n.conversationId),B(n=>this.client.events(n.conversationId,Math.max(0,n.seq-2)).pipe(Pt(o=>!((o.type==="done"||o.type==="error")&&o.runId===n.runId),!0))))}events(e){return this.id?e===void 0?this.history().pipe(B(t=>this.client.events(this.id,t.lastSeq??0))):this.client.events(this.id,e):At(()=>new U("No conversation yet - send a message first","bad-request"))}history(){return this.id?this.client.call$(ce.conversation,{id:this.id},"agentConversation"):At(()=>new U("No conversation yet - send a message first","bad-request"))}abort(){return this.id?this.client.call$(ce.abort,{conversationId:this.id},"abortAgentRun"):R(!1)}};function Jo(){let r=globalThis.localStorage;try{let t=r?.getItem(Go);if(t&&/^[A-Za-z0-9_-]{16,128}$/.test(t))return t}catch{}let e=globalThis.crypto.randomUUID().replace(/-/g,"");try{r?.setItem(Go,e)}catch{}return e}var Xs=sn(Rs()),w=sn(Kt());var oe=sn(Kt()),Jl=/^(https?:|mailto:)/i,Zn=/^\s*[-*+]\s+/,zr=/^\s*\d+[.)]\s+/,Zl=/^```\s*([\w+-]*)\s*$/,Ms=/^(#{1,6})\s+(.*)$/;function Vr(r){let e=[],t=String(r??"").replace(/\r\n?/g,`
|
|
34
34
|
`).split(`
|
|
35
|
-
`),n=0;for(;n<t.length;){let o=t[n],i=o.match(
|
|
36
|
-
`)}</code></pre>`);continue}let s=o.match(ad);if(s){e.push(De.html`<p><strong class="h">${ar(s[2])}</strong></p>`),n++;continue}if(ml.test(o)||Gs.test(o)){let u=Gs.test(o),c=u?Gs:ml,f=[];for(;n<t.length&&c.test(t[n]);)f.push(De.html`<li>${ar(t[n++].replace(c,""))}</li>`);e.push(u?De.html`<ol>${f}</ol>`:De.html`<ul>${f}</ul>`);continue}if(!o.trim()){n++;continue}let a=[];for(;n<t.length&&t[n].trim()&&!/^```/.test(t[n])&&!ad.test(t[n])&&!ml.test(t[n])&&!Gs.test(t[n]);)a.push(t[n++]);e.push(De.html`<p>${a.map((u,c)=>c?De.html`<br />${ar(u)}`:ar(u))}</p>`)}return e}var Wv=/(`[^`]+`)|(\*\*[^*]+\*\*)|(__[^_]+__)|(\*[^*\s][^*]*\*)|(\[[^\]]+\]\([^)\s]+\))|(https?:\/\/[^\s<>()]+[^\s<>().,;:!?'"])/;function ar(r){let e=[],t=r;for(;t;){let n=t.match(Wv);if(!n||n.index===void 0){e.push(t);break}n.index&&e.push(t.slice(0,n.index));let o=n[0];if(n[1])e.push(De.html`<code>${o.slice(1,-1)}</code>`);else if(n[2]||n[3])e.push(De.html`<strong>${ar(o.slice(2,-2))}</strong>`);else if(n[4])e.push(De.html`<em>${ar(o.slice(1,-1))}</em>`);else if(n[5]){let[,i,s]=o.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/)??[];e.push(ud(i,s))}else e.push(ud(o,o));t=t.slice(n.index+o.length)}return e}function ud(r,e){return Dv.test(e)?De.html`<a href=${e} target="_blank" rel="noopener noreferrer nofollow">${r}</a>`:r}var dn=function(){return dn=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}return r},dn.apply(this,arguments)};function Ce(r,e){if(typeof e=="function")return eo(r,function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return dn(dn({},e.apply(void 0,n)),{type:r})});var t=e?e._as:"empty";switch(t){case"empty":return eo(r,function(){return{type:r}});case"fsa":return eo(r,function(n,o){return n instanceof Error?{error:!0,meta:o,payload:n,type:r}:{error:!1,meta:o,payload:n,type:r}});case"payload":return eo(r,function(n){return{payload:n,type:r}});case"props":return eo(r,function(n){return dn(dn({},n),{type:r})});default:throw new Error("Unexpected config.")}}function Je(){return{_as:"payload",_p:void 0}}function eo(r,e){return Object.defineProperty(e,"type",{value:r,writable:!1})}var Vv=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),o=0,e=0;e<t;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n};function Re(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=r.pop(),n=r.reduce(function(o,i){return Vv(o,[i.type])},[]);return{reducer:t,types:n}}function cd(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=new Map,o=0,i=e;o<i.length;o++)for(var s=i[o],a=0,u=s.types;a<u.length;a++){var c=u[a];n.has(c)?console.warn(c+" already specified in an 'on' call."):n.set(c,s.reducer)}return function(f,p){f===void 0&&(f=r);var v=n.get(p.type);return v?v(f,p):f}}var Qs=Ce("[chat] shown",Je()),Zs=Ce("[chat] connecting"),hn=Ce("[chat] failed",Je()),to=Ce("[chat] verifying",Je()),ro=Ce("[chat] agents loaded",Je()),ur=Ce("[chat] pick agent",Je()),Xs=Ce("[chat] history loaded",Je()),vn=Ce("[chat] new conversation"),gn=Ce("[chat] send",Je()),dl=Ce("[chat] resume",Je()),ea=Ce("[chat] event",Je()),ta=Ce("[chat] run ended"),cr=Ce("[chat] stop",Je());var _e=xn(wl());Ue();ze();var _g=r=>r?.code||"internal",_l=r=>xe(hn(_g(r)));function Sg(r,e){let t=e.agents.length?r.filter(o=>e.agents.includes(o.id)||e.agents.includes(o.name)):r,n=t.find(o=>o.id===e.agent||o.name===e.agent)??t[0];return{agents:t,agentId:n?.id??null}}var ua=class{constructor(e){this.ctx=e;this.connect$=(0,_e.createEffect)()((e,t)=>t.pipe(ie(n=>n.shown),ye(1),ee(()=>{let n=this.ctx.client;return n?Ve(xe(Zs()),n.agents().pipe(ye(1),Y(o=>ro(Sg(o,this.ctx))),Le(_l))):xe(hn("unauthorized"))})));this.select$=(0,_e.createEffect)()(e=>Mr(e.pipe((0,_e.ofType)(ro),Y(({payload:t})=>t.agentId)),e.pipe((0,_e.ofType)(ur),Y(({payload:t})=>t))).pipe(ie(t=>!!t),ee(t=>{let n=this.ctx.client;return n.conversations(t).pipe(ye(1),ee(o=>{let i=o?.[0];return i?n.agent(t).conversation(i.id).history().pipe(J(s=>oe([Xs({agentId:t,detail:s}),...s.answering?[dl({agentId:t,conversationId:s.id,afterSeq:s.lastSeq??0})]:[]]))):X}),Le(_l))})));this.run$=(0,_e.createEffect)()(e=>Mr(e.pipe((0,_e.ofType)(gn),Y(({payload:t})=>{let{agentId:n,conversationId:o,text:i}=t,s=this.conversation(n,o);return{c:s,events:s.send(i)}})),e.pipe((0,_e.ofType)(dl),Y(({payload:t})=>{let{agentId:n,conversationId:o,afterSeq:i}=t,s=this.conversation(n,o);return{c:s,events:s.events(i)}}))).pipe(ee(({c:t,events:n})=>this.follow$(t,n).pipe(Zr(Mr(e.pipe((0,_e.ofType)(cr)),e.pipe((0,_e.ofType)(ur)),e.pipe((0,_e.ofType)(vn)))),zr(ta())))));this.abort$=(0,_e.createEffect)()(e=>e.pipe((0,_e.ofType)(cr),J(({payload:t})=>{let{agentId:n,conversationId:o}=t;return!o||!this.ctx.client?X:this.conversation(n,o).abort().pipe(xt(),Le(()=>X))})));this.failures$=(0,_e.createEffect)()(e=>e.pipe((0,_e.ofType)(hn),ut(({payload:t})=>this.ctx.emit("error",{code:t})),xt()))}conversation(e,t){return this.ctx.client.agent(e).conversation(t??void 0)}follow$(e,t){let n=new Set;return t.pipe(Lt(o=>o.type!=="done"&&o.type!=="error",!0),ut(o=>{o.type==="message"&&o.data?.role==="assistant"&&!n.has(o.data.id)&&(n.add(o.data.id),this.ctx.emit("answer",{text:o.data.text,agent:e.agent,conversationId:o.conversationId})),o.type==="error"&&this.ctx.emit("error",{code:o.data?.code??"internal"})}),Y(o=>ea(o)),Le(_l))}};var ca={shown:!1,agents:[],agentId:null,conversationId:null,messages:[],answering:!1,notice:null};function Sl(r){let e=(r.toolCalls??[]).map(t=>t?.name).filter(t=>!!t);return{id:r.id,role:r.role,text:r.text??"",tools:Array.from(new Set(e))}}var Ag=/^local:/,_d={conversationId:null,messages:[],answering:!1,notice:null},Sd=cd(ca,Re(Qs,(r,{payload:e})=>r.shown||!e?r:{...r,shown:!0}),Re(Zs,r=>({...r,notice:{kind:"busy",what:"connecting"}})),Re(hn,(r,{payload:e})=>({...r,answering:!1,notice:{kind:"error",code:e}})),Re(to,(r,{payload:e})=>({...r,notice:e?{kind:"busy",what:"verifying"}:r.notice?.kind==="busy"&&r.notice.what==="verifying"?null:r.notice})),Re(ro,(r,{payload:e})=>({...r,agents:e.agents,agentId:e.agentId,notice:e.agentId?null:{kind:"error",code:"agent-unavailable"}})),Re(ur,(r,{payload:e})=>({...r,..._d,agentId:e})),Re(Xs,(r,{payload:e})=>e.agentId!==r.agentId?r:{...r,conversationId:e.detail.id,messages:(e.detail.messages??[]).map(Sl),answering:!!e.detail.answering,notice:e.detail.answering?{kind:"busy",what:"thinking"}:null}),Re(vn,r=>({...r,..._d})),Re(gn,(r,{payload:e})=>({...r,messages:[...r.messages,{id:`local:${r.messages.length}`,role:"user",text:e.text,tools:[]}],answering:!0,notice:{kind:"busy",what:"thinking"}})),Re(ea,(r,{payload:e})=>Eg(r,e)),Re(ta,r=>({...r,answering:!1,notice:r.notice?.kind==="busy"?null:r.notice})),Re(cr,r=>({...r,answering:!1,notice:{kind:"info",what:"stopped"}})));function Eg(r,e){let t=r.conversationId??e.conversationId;if(e.conversationId!==t)return r;if(e.type==="error")return{...r,conversationId:t,notice:{kind:"error",code:e.data?.code??"internal"}};if(e.type!=="message"||!e.data?.id)return{...r,conversationId:t};let n=Sl(e.data);if(r.messages.some(s=>s.id===n.id))return{...r,conversationId:t};let o=[...r.messages],i=n.role==="user"?o.findIndex(s=>Ag.test(s.id)&&s.text===n.text):-1;return i>=0?o[i]=n:o.push(n),{...r,conversationId:t,messages:o}}var fa=xn(wl());Ue();ze();var la=class{constructor(e,t={}){this.destroy$=new R;let n=new ua(e);this.store=(0,fa.createStore)({reducer$:xe(Sd),initialState$:xe({...ca,...t}),epic$:(0,fa.createEpicRegistry)(n.select$,n.run$,n.abort$,n.failures$,n.connect$),destroy$:this.destroy$}),this.state$=this.store.state$.pipe(Rt())}dispatch(e){this.store.dispatch(e)}destroy(){this.destroy$.next(),this.destroy$.complete()}};var Ad={title:"Chat",open:"Open chat",close:"Close chat",newChat:"New conversation",placeholder:"Type a message",send:"Send",stop:"Stop",thinking:"Thinking",connecting:"Connecting",pickAgent:"Assistant",usedTools:"Used",verifying:"Checking that you are human",errors:{"limit-reached":"This conversation is full - start a new one.","cap-reached":"The assistant is not available right now - try again later.","agent-unavailable":"This assistant is not available.","session-expired":"Your session ended - reload the page.","credential-expired":"Please sign in again.",aborted:"Stopped.",internal:"Something went wrong - try again.",unauthorized:"This chat is not allowed here.","bad-request":"That did not work - try again.",network:"No connection - try again.",default:"Something went wrong - try again."}},$g={title:"\u0427\u0430\u0442",open:"\u041E\u0442\u0432\u043E\u0440\u0438 \u0447\u0430\u0442\u0430",close:"\u0417\u0430\u0442\u0432\u043E\u0440\u0438 \u0447\u0430\u0442\u0430",newChat:"\u041D\u043E\u0432 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440",placeholder:"\u041D\u0430\u043F\u0438\u0448\u0435\u0442\u0435 \u0441\u044A\u043E\u0431\u0449\u0435\u043D\u0438\u0435",send:"\u0418\u0437\u043F\u0440\u0430\u0442\u0438",stop:"\u0421\u043F\u0440\u0438",thinking:"\u041C\u0438\u0441\u043B\u044F",connecting:"\u0421\u0432\u044A\u0440\u0437\u0432\u0430\u043D\u0435",pickAgent:"\u0410\u0441\u0438\u0441\u0442\u0435\u043D\u0442",usedTools:"\u0418\u0437\u043F\u043E\u043B\u0437\u0432\u0430\u043D\u043E",verifying:"\u041F\u0440\u043E\u0432\u0435\u0440\u043A\u0430, \u0447\u0435 \u0441\u0442\u0435 \u0447\u043E\u0432\u0435\u043A",errors:{"limit-reached":"\u0420\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u044A\u0442 \u0435 \u043F\u044A\u043B\u0435\u043D - \u0437\u0430\u043F\u043E\u0447\u043D\u0435\u0442\u0435 \u043D\u043E\u0432.","cap-reached":"\u0410\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u044A\u0442 \u043D\u0435 \u0435 \u0434\u043E\u0441\u0442\u044A\u043F\u0435\u043D \u0432 \u043C\u043E\u043C\u0435\u043D\u0442\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043F\u043E-\u043A\u044A\u0441\u043D\u043E.","agent-unavailable":"\u0422\u043E\u0437\u0438 \u0430\u0441\u0438\u0441\u0442\u0435\u043D\u0442 \u043D\u0435 \u0435 \u0434\u043E\u0441\u0442\u044A\u043F\u0435\u043D.","session-expired":"\u0421\u0435\u0441\u0438\u044F\u0442\u0430 \u0438\u0437\u0442\u0435\u0447\u0435 - \u043F\u0440\u0435\u0437\u0430\u0440\u0435\u0434\u0435\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430\u0442\u0430.","credential-expired":"\u041C\u043E\u043B\u044F, \u0432\u043B\u0435\u0437\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",aborted:"\u0421\u043F\u0440\u044F\u043D\u043E.",internal:"\u041D\u0435\u0449\u043E \u0441\u0435 \u043E\u0431\u044A\u0440\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",unauthorized:"\u0422\u043E\u0437\u0438 \u0447\u0430\u0442 \u043D\u0435 \u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D \u0442\u0443\u043A.","bad-request":"\u041D\u0435 \u0441\u0435 \u043F\u043E\u043B\u0443\u0447\u0438 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",network:"\u041D\u044F\u043C\u0430 \u0432\u0440\u044A\u0437\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",default:"\u041D\u0435\u0449\u043E \u0441\u0435 \u043E\u0431\u044A\u0440\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E."}},Ed={en:Ad,bg:$g};function Al(r,e={}){let t=String(r||"en").toLowerCase().split("-")[0],n=Ed[t]??Ad;return{...n,...e,errors:{...n.errors,...e.errors??{}}}}var $d=`
|
|
35
|
+
`),n=0;for(;n<t.length;){let o=t[n],i=o.match(Zl);if(i){let a=[];for(n++;n<t.length&&!/^```\s*$/.test(t[n]);)a.push(t[n++]);n++,e.push(oe.html`<pre><code data-lang=${i[1]||""}>${a.join(`
|
|
36
|
+
`)}</code></pre>`);continue}let s=o.match(Ms);if(s){e.push(oe.html`<p><strong class="h">${Ge(s[2])}</strong></p>`),n++;continue}if(Zn.test(o)||zr.test(o)){let a=zr.test(o),c=a?zr:Zn,u=[];for(;n<t.length&&c.test(t[n]);)u.push(oe.html`<li>${Ge(t[n++].replace(c,""))}</li>`);e.push(a?oe.html`<ol>${u}</ol>`:oe.html`<ul>${u}</ul>`);continue}if(!o.trim()){n++;continue}let l=[];for(;n<t.length&&t[n].trim()&&!/^```/.test(t[n])&&!Ms.test(t[n])&&!Zn.test(t[n])&&!zr.test(t[n]);)l.push(t[n++]);e.push(oe.html`<p>${l.map((a,c)=>c?oe.html`<br />${Ge(a)}`:Ge(a))}</p>`)}return e}var Xl=/(`[^`]+`)|(\*\*[^*]+\*\*)|(__[^_]+__)|(\*[^*\s][^*]*\*)|(\[[^\]]+\]\([^)\s]+\))|(https?:\/\/[^\s<>()]+[^\s<>().,;:!?'"])/;function Ge(r){let e=[],t=r;for(;t;){let n=t.match(Xl);if(!n||n.index===void 0){e.push(t);break}n.index&&e.push(t.slice(0,n.index));let o=n[0];if(n[1])e.push(oe.html`<code>${o.slice(1,-1)}</code>`);else if(n[2]||n[3])e.push(oe.html`<strong>${Ge(o.slice(2,-2))}</strong>`);else if(n[4])e.push(oe.html`<em>${Ge(o.slice(1,-1))}</em>`);else if(n[5]){let[,i,s]=o.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/)??[];e.push(js(i,s))}else e.push(js(o,o));t=t.slice(n.index+o.length)}return e}function js(r,e){return Jl.test(e)?oe.html`<a href=${e} target="_blank" rel="noopener noreferrer nofollow">${r}</a>`:r}var vt=function(){return vt=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}return r},vt.apply(this,arguments)};function J(r,e){if(typeof e=="function")return Gt(r,function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return vt(vt({},e.apply(void 0,n)),{type:r})});var t=e?e._as:"empty";switch(t){case"empty":return Gt(r,function(){return{type:r}});case"fsa":return Gt(r,function(n,o){return n instanceof Error?{error:!0,meta:o,payload:n,type:r}:{error:!1,meta:o,payload:n,type:r}});case"payload":return Gt(r,function(n){return{payload:n,type:r}});case"props":return Gt(r,function(n){return vt(vt({},n),{type:r})});default:throw new Error("Unexpected config.")}}function he(){return{_as:"payload",_p:void 0}}function Gt(r,e){return Object.defineProperty(e,"type",{value:r,writable:!1})}var Ql=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),o=0,e=0;e<t;e++)for(var i=arguments[e],s=0,l=i.length;s<l;s++,o++)n[o]=i[s];return n};function ee(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=r.pop(),n=r.reduce(function(o,i){return Ql(o,[i.type])},[]);return{reducer:t,types:n}}function Ls(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=new Map,o=0,i=e;o<i.length;o++)for(var s=i[o],l=0,a=s.types;l<a.length;l++){var c=a[l];n.has(c)?console.warn(c+" already specified in an 'on' call."):n.set(c,s.reducer)}return function(u,p){u===void 0&&(u=r);var d=n.get(p.type);return d?d(u,p):u}}var Br=J("[chat] shown",he()),Kr=J("[chat] connecting"),gt=J("[chat] failed",he()),Jt=J("[chat] verifying",he()),Zt=J("[chat] agents loaded",he()),Je=J("[chat] pick agent",he()),Yr=J("[chat] history loaded",he()),yt=J("[chat] new conversation"),bt=J("[chat] send",he()),Xn=J("[chat] resume",he()),Gr=J("[chat] event",he()),Jr=J("[chat] run ended"),Ze=J("[chat] stop",he());var Xt;(function(r){r.switchMap="switchMap",r.mergeMap="mergeMap",r.concatMap="concatMap",r.exhaustMap="exhaustMap"})(Xt||(Xt={}));var Us=r=>r!==null&&typeof r=="object";var Ds=r=>r.reduce((e,t)=>(...n)=>e(t(...n))),Xe=fn(G(r=>R(r))),Zr=r=>r.pipe(Xe),Xr=r=>Et(r)?r:r instanceof Promise?V(r):R(r);function qs([r,e,t]){function n(o,i){return t.length>0?Ds(t)(e)(o,i):e(o,i)}return xn(n,r)}var Ns={switchMap:B,mergeMap:re,concatMap:Tt,exhaustMap:Ar};function Fs(r={},e={},t){var n;let o=r&&r.reducer$&&r.reducer$.pipe(Xe)||R((m,b)=>m),i=new te,s=m=>Ee(r&&r.actionStream$&&r.actionStream$.pipe(Xe)||le,t).pipe(ve(Us),j(Xr),u(Zr),_e(i),m,j(Xr)),l=(r&&r.initialState$&&r.initialState$.pipe(Xe)||R({})).pipe(kt()),a=r&&r.middleware$&&r.middleware$.pipe(Xe)||R([]),c=((n=r?.destroy$)===null||n===void 0?void 0:n.pipe(Xe))||gn,u=Ns[e&&e.actionFlatOp||Xt.concatMap],p=Ns[e&&e.stateFlatOp||Xt.switchMap],d=m=>m.pipe(p(Zr),j(Xr),p(Zr)),f=e&&e.bufferSize||1,v=e&&e.windowTime;return{reducer$:o,actions$:i,actionStream$:s,initialState$:l,middleware$:a,destroy$:c,flattenState$:d,shareReplayConfig:{refCount:!1,bufferSize:f,windowTime:v}}}var Qn="@@redux-devtools/JUMP_TO_STATE";function Hs(r){if(!r)return;let e=r===!0?{}:r;return e.enabled===!1?void 0:e}function Ws(r){return(e,t)=>t?.type===Qn?t.state:r(e,t)}function zs(r,e={}){var t,n;let o=globalThis.__REDUX_DEVTOOLS_EXTENSION__;if(e.enabled===!1||!o)return()=>{};let i=o.connect(Object.assign({name:(t=e.name)!==null&&t!==void 0?t:"RxDI Store",maxAge:(n=e.maxAge)!==null&&n!==void 0?n:50},e.extensionOptions)),s=new Z,l;s.add(r.state$.subscribe(c=>{l=c})),i.init(l),s.add(r.state$.pipe(Sn(r.actions$),ve(([,c])=>c.type!==Qn)).subscribe(([c,u])=>i.send(u,c)));let a=i.subscribe(c=>{var u;if(c.type!=="DISPATCH")return;let p=(u=c.payload)===null||u===void 0?void 0:u.type;(p==="JUMP_TO_ACTION"||p==="JUMP_TO_STATE")&&c.state?r.dispatch({type:Qn,state:JSON.parse(c.state)}):p==="COMMIT"&&i.init(l)});return()=>{var c;s.unsubscribe(),typeof a=="function"&&a(),(c=i.unsubscribe)===null||c===void 0||c.call(i)}}var Qr=class{constructor(e,t){var n,o,i,s;this.config=e,this.options=t,this._dispatch$=new te,this.dispatch=m=>{this._dispatch$.next(m)};let l=Hs((n=this.config)===null||n===void 0?void 0:n.devTools);l&&(this.config=Object.assign(Object.assign({},this.config),{reducer$:((i=(o=this.config)===null||o===void 0?void 0:o.reducer$)!==null&&i!==void 0?i:R(m=>m)).pipe(j(m=>Ws(m)))}));let{reducer$:a,actions$:c,actionStream$:u,middleware$:p,initialState$:d,destroy$:f,flattenState$:v,shareReplayConfig:h}=Fs(this.config,this.options,this._dispatch$);if(this.state$=vn([d,a,p]).pipe(j(qs),Tt(u),_n(d),v,Fe(f),nt(h)),this.state$.subscribe(),this.actions$=c.pipe(nt(h)),!((s=this.config)===null||s===void 0)&&s.epic$&&this.config.epic$(this.actions$,this.state$).pipe(Fe(f)).subscribe({next:m=>this.dispatch(m),error:m=>console.error("[Epic] Error:",m)}),l){let m=zs(this,l);f.subscribe(()=>m())}}};function eo(r={},e={}){return new Qr(r,e)}function Re(...r){let e=new Set(r.map(t=>t.type));return t=>t.pipe(ve(n=>e.has(n.type)))}function xt(r={dispatch:!0}){return e=>(t,n)=>{let o=e(t,n);return r.dispatch===!1?o.pipe(rt(),G(i=>(console.error("[Effect] Error:",i),R()))):o.pipe(G(i=>(console.error("[Effect] Error:",i),R())))}}function Vs(...r){return(e,t)=>Ee(...r.map(n=>n(e,t)))}var ec=r=>r?.code||"internal",to=r=>R(gt(ec(r)));function tc(r,e){let t=e.agents.length?r.filter(o=>e.agents.includes(o.id)||e.agents.includes(o.name)):r,n=t.find(o=>o.id===e.agent||o.name===e.agent)??t[0];return{agents:t,agentId:n?.id??null}}var en=class{constructor(e){this.ctx=e;this.connect$=xt()((e,t)=>t.pipe(ve(n=>n.shown),Ne(1),B(()=>{let n=this.ctx.client;return n?Ae(R(Kr()),n.agents().pipe(Ne(1),j(o=>Zt(tc(o,this.ctx))),G(to))):R(gt("unauthorized"))})));this.select$=xt()(e=>Ee(e.pipe(Re(Zt),j(({payload:t})=>t.agentId)),e.pipe(Re(Je),j(({payload:t})=>t))).pipe(ve(t=>!!t),B(t=>{let n=this.ctx.client;return n.conversations(t).pipe(Ne(1),B(o=>{let i=o?.[0];return i?n.agent(t).conversation(i.id).history().pipe(re(s=>V([Yr({agentId:t,detail:s}),...s.answering?[Xn({agentId:t,conversationId:s.id,afterSeq:s.lastSeq??0})]:[]]))):le}),G(to))})));this.run$=xt()(e=>Ee(e.pipe(Re(bt),j(({payload:t})=>{let{agentId:n,conversationId:o,text:i}=t,s=this.conversation(n,o);return{c:s,events:s.send(i)}})),e.pipe(Re(Xn),j(({payload:t})=>{let{agentId:n,conversationId:o,afterSeq:i}=t,s=this.conversation(n,o);return{c:s,events:s.events(i)}}))).pipe(B(({c:t,events:n})=>this.follow$(t,n).pipe(Fe(e.pipe(Re(Ze,Je,yt))),bn(Jr())))));this.abort$=xt()(e=>e.pipe(Re(Ze),re(({payload:t})=>{let{agentId:n,conversationId:o}=t;return!o||!this.ctx.client?le:this.conversation(n,o).abort().pipe(rt(),G(()=>le))})));this.failures$=xt()(e=>e.pipe(Re(gt),_e(({payload:t})=>this.ctx.emit("error",{code:t})),rt()))}conversation(e,t){return this.ctx.client.agent(e).conversation(t??void 0)}follow$(e,t){let n=new Set;return t.pipe(Pt(o=>o.type!=="done"&&o.type!=="error",!0),_e(o=>{o.type==="message"&&o.data?.role==="assistant"&&!n.has(o.data.id)&&(n.add(o.data.id),this.ctx.emit("answer",{text:o.data.text,agent:e.agent,conversationId:o.conversationId})),o.type==="error"&&this.ctx.emit("error",{code:o.data?.code??"internal"})}),j(o=>Gr(o)),G(to))}};var tn={shown:!1,agents:[],agentId:null,conversationId:null,messages:[],answering:!1,notice:null};function ro(r){let e=(r.toolCalls??[]).map(t=>t?.name).filter(t=>!!t);return{id:r.id,role:r.role,text:r.text??"",tools:Array.from(new Set(e))}}var rc=/^local:/,Bs={conversationId:null,messages:[],answering:!1,notice:null},Ks=Ls(tn,ee(Br,(r,{payload:e})=>r.shown||!e?r:{...r,shown:!0}),ee(Kr,r=>({...r,notice:{kind:"busy",what:"connecting"}})),ee(gt,(r,{payload:e})=>({...r,answering:!1,notice:{kind:"error",code:e}})),ee(Jt,(r,{payload:e})=>({...r,notice:e?{kind:"busy",what:"verifying"}:r.notice?.kind==="busy"&&r.notice.what==="verifying"?null:r.notice})),ee(Zt,(r,{payload:e})=>({...r,agents:e.agents,agentId:e.agentId,notice:e.agentId?null:{kind:"error",code:"agent-unavailable"}})),ee(Je,(r,{payload:e})=>({...r,...Bs,agentId:e})),ee(Yr,(r,{payload:e})=>e.agentId!==r.agentId?r:{...r,conversationId:e.detail.id,messages:(e.detail.messages??[]).map(ro),answering:!!e.detail.answering,notice:e.detail.answering?{kind:"busy",what:"thinking"}:null}),ee(yt,r=>({...r,...Bs})),ee(bt,(r,{payload:e})=>({...r,messages:[...r.messages,{id:`local:${r.messages.length}`,role:"user",text:e.text,tools:[]}],answering:!0,notice:{kind:"busy",what:"thinking"}})),ee(Gr,(r,{payload:e})=>nc(r,e)),ee(Jr,r=>({...r,answering:!1,notice:r.notice?.kind==="busy"?null:r.notice})),ee(Ze,r=>({...r,answering:!1,notice:{kind:"info",what:"stopped"}})));function nc(r,e){let t=r.conversationId??e.conversationId;if(e.conversationId!==t)return r;if(e.type==="error")return{...r,conversationId:t,notice:{kind:"error",code:e.data?.code??"internal"}};if(e.type!=="message"||!e.data?.id)return{...r,conversationId:t};let n=ro(e.data);if(r.messages.some(s=>s.id===n.id))return{...r,conversationId:t};let o=[...r.messages],i=n.role==="user"?o.findIndex(s=>rc.test(s.id)&&s.text===n.text):-1;return i>=0?o[i]=n:o.push(n),{...r,conversationId:t,messages:o}}var rn=class{constructor(e,t={}){this.destroy$=new te;let n=new en(e);this.store=eo({reducer$:R(Ks),initialState$:R({...tn,...t}),epic$:Vs(n.select$,n.run$,n.abort$,n.failures$,n.connect$),destroy$:this.destroy$}),this.state$=this.store.state$.pipe(yn())}dispatch(e){this.store.dispatch(e)}destroy(){this.destroy$.next(),this.destroy$.complete()}};var Ys={title:"Chat",open:"Open chat",close:"Close chat",newChat:"New conversation",placeholder:"Type a message",send:"Send",stop:"Stop",thinking:"Thinking",connecting:"Connecting",pickAgent:"Assistant",usedTools:"Used",verifying:"Checking that you are human",errors:{"limit-reached":"This conversation is full - start a new one.","cap-reached":"The assistant is not available right now - try again later.","agent-unavailable":"This assistant is not available.","session-expired":"Your session ended - reload the page.","credential-expired":"Please sign in again.",aborted:"Stopped.",internal:"Something went wrong - try again.",unauthorized:"This chat is not allowed here.","bad-request":"That did not work - try again.",network:"No connection - try again.",default:"Something went wrong - try again."}},oc={title:"\u0427\u0430\u0442",open:"\u041E\u0442\u0432\u043E\u0440\u0438 \u0447\u0430\u0442\u0430",close:"\u0417\u0430\u0442\u0432\u043E\u0440\u0438 \u0447\u0430\u0442\u0430",newChat:"\u041D\u043E\u0432 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440",placeholder:"\u041D\u0430\u043F\u0438\u0448\u0435\u0442\u0435 \u0441\u044A\u043E\u0431\u0449\u0435\u043D\u0438\u0435",send:"\u0418\u0437\u043F\u0440\u0430\u0442\u0438",stop:"\u0421\u043F\u0440\u0438",thinking:"\u041C\u0438\u0441\u043B\u044F",connecting:"\u0421\u0432\u044A\u0440\u0437\u0432\u0430\u043D\u0435",pickAgent:"\u0410\u0441\u0438\u0441\u0442\u0435\u043D\u0442",usedTools:"\u0418\u0437\u043F\u043E\u043B\u0437\u0432\u0430\u043D\u043E",verifying:"\u041F\u0440\u043E\u0432\u0435\u0440\u043A\u0430, \u0447\u0435 \u0441\u0442\u0435 \u0447\u043E\u0432\u0435\u043A",errors:{"limit-reached":"\u0420\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u044A\u0442 \u0435 \u043F\u044A\u043B\u0435\u043D - \u0437\u0430\u043F\u043E\u0447\u043D\u0435\u0442\u0435 \u043D\u043E\u0432.","cap-reached":"\u0410\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u044A\u0442 \u043D\u0435 \u0435 \u0434\u043E\u0441\u0442\u044A\u043F\u0435\u043D \u0432 \u043C\u043E\u043C\u0435\u043D\u0442\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043F\u043E-\u043A\u044A\u0441\u043D\u043E.","agent-unavailable":"\u0422\u043E\u0437\u0438 \u0430\u0441\u0438\u0441\u0442\u0435\u043D\u0442 \u043D\u0435 \u0435 \u0434\u043E\u0441\u0442\u044A\u043F\u0435\u043D.","session-expired":"\u0421\u0435\u0441\u0438\u044F\u0442\u0430 \u0438\u0437\u0442\u0435\u0447\u0435 - \u043F\u0440\u0435\u0437\u0430\u0440\u0435\u0434\u0435\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430\u0442\u0430.","credential-expired":"\u041C\u043E\u043B\u044F, \u0432\u043B\u0435\u0437\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",aborted:"\u0421\u043F\u0440\u044F\u043D\u043E.",internal:"\u041D\u0435\u0449\u043E \u0441\u0435 \u043E\u0431\u044A\u0440\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",unauthorized:"\u0422\u043E\u0437\u0438 \u0447\u0430\u0442 \u043D\u0435 \u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D \u0442\u0443\u043A.","bad-request":"\u041D\u0435 \u0441\u0435 \u043F\u043E\u043B\u0443\u0447\u0438 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",network:"\u041D\u044F\u043C\u0430 \u0432\u0440\u044A\u0437\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",default:"\u041D\u0435\u0449\u043E \u0441\u0435 \u043E\u0431\u044A\u0440\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E."}},Gs={en:Ys,bg:oc};function no(r,e={}){let t=String(r||"en").toLowerCase().split("-")[0],n=Gs[t]??Ys;return{...n,...e,errors:{...n.errors,...e.errors??{}}}}var Js=`
|
|
37
37
|
:host {
|
|
38
38
|
--_accent: var(--lf-chat-accent, #4f46e5);
|
|
39
39
|
--_accent-fg: var(--lf-chat-accent-fg, #ffffff);
|
|
@@ -204,7 +204,7 @@ textarea:focus-visible { outline: 2px solid var(--_accent); outline-offset: 0; b
|
|
|
204
204
|
}
|
|
205
205
|
.send:disabled { opacity: 0.5; cursor: default; }
|
|
206
206
|
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
207
|
-
`;var
|
|
207
|
+
`;var Zs="https://lambforge.com/agent-turnstile.html",ic="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit";var nn=null;function sc(r){let e=r.defaultView;return e?.turnstile?Promise.resolve(e.turnstile):(nn||(nn=new Promise((t,n)=>{let o=r.createElement("script");o.src=ic,o.async=!0,o.onload=()=>e.turnstile?t(e.turnstile):n(new Error("turnstile did not load")),o.onerror=()=>{nn=null,n(new Error("turnstile did not load"))},r.head.append(o)})),nn)}function oo(r){let e=r.host.ownerDocument;if(r.sitekey)return sc(e).then(o=>new Promise((i,s)=>{let l=e.createElement("div");r.host.append(l);let a,c=()=>{try{a&&o.remove(a)}catch{}l.remove()};a=o.render(l,{sitekey:r.sitekey,appearance:"interaction-only",callback:u=>{c(),i(u)},"error-callback":()=>{c(),s(new Error("turnstile failed"))}})}));let t=new URL(r.hostedUrl||Zs),n=e.defaultView;return t.searchParams.set("origin",n.location.origin),new Promise((o,i)=>{let s=e.createElement("iframe");s.title="Bot check",s.src=t.href;let l=setTimeout(()=>c(new Error("turnstile timed out")),12e4),a=u=>{if(u.origin!==t.origin||u.source!==s.contentWindow)return;let p=u.data;p?.type==="lambforge-turnstile"&&(p.token?c(null,p.token):c(new Error(p.error||"turnstile failed")))},c=(u,p)=>{clearTimeout(l),n.removeEventListener("message",a),s.remove(),u?i(u):o(p)};n.addEventListener("message",a),r.host.append(s)})}var Qt="lambforge-agent-chat",ac=w.svg`<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>`,lc=w.svg`<path d="M18 6 6 18M6 6l12 12"/>`,cc=w.svg`<path d="M12 5v14M5 12h14"/>`,io=r=>w.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${r}</svg>`,D=class extends w.LitElement{constructor(){super(...arguments);this.open=!1;this.mode="drawer";this.position="bottom-right";this.theme="light";this.agent="";this.agents="";this.locale="";this.heading="";this.url="";this.publishableKey="";this.tokenUrl="";this.turnstileSitekey="";this.turnstileUrl="";this.strings={};this.lastCount=0}get shown(){return this.mode!=="drawer"||this.open}get t(){return no(this.locale||this.ownerDocument.documentElement.lang||"en",this.strings)}connect(){return Ct(()=>{let t=new rn({client:this.resolveClient(),agent:this.agent,agents:this.agents.split(",").map(n=>n.trim()).filter(Boolean),emit:(n,o)=>this.emit(n,o)},{shown:this.shown});return this.store=t,t.state$.pipe(Ot(()=>{t.destroy(),this.store===t&&(this.store=void 0)}))})}dispatch(t){this.store?.dispatch(t)}OnUpdate(){this.shown&&this.dispatch(Br(!0))}resolveClient(){if(this.client)return this.client;let t=this.url||void 0;if(this.getToken){let n=this.getToken;this.client=new He({url:t,getToken:()=>n()})}else if(this.tokenUrl){let n=this.tokenUrl;this.client=new He({url:t,getToken:()=>fetch(n,{credentials:"include",headers:{accept:"application/json"}}).then(o=>{if(!o.ok)throw new Error(`token-url answered ${o.status}`);return o.json()})})}else if(this.publishableKey)this.client=new He({url:t,anonymous:{publishableKey:this.publishableKey,turnstileToken:()=>this.verifyHuman()}});else return console.error(`[${Qt}] give it a session: token-url, publishable-key, .getToken or .client`),null;return this.client}verifyHuman(){return this.dispatch(Jt(!0)),this.turnstileBox().then(t=>oo({host:t,sitekey:this.turnstileSitekey||null,hostedUrl:this.turnstileUrl||null})).finally(()=>this.dispatch(Jt(!1)))}async turnstileBox(){for(let t=0;t<100;t++){let n=this.shadowRoot?.querySelector(".turnstile");if(n)return n;await new Promise(o=>setTimeout(o,20))}throw new Error("turnstile: the chat is not rendered")}send(t){return([n])=>{let o=String(t??"").trim();!o||n.answering||!n.agentId||this.dispatch(bt({agentId:n.agentId,conversationId:n.conversationId,text:o}))}}stopAnswer(){return([t])=>{t.agentId&&this.dispatch(Ze({agentId:t.agentId,conversationId:t.conversationId}))}}pick(t){this.dispatch(Je(t))}startOver(){this.dispatch(yt()),this.focusInput()}setOpen(t){t!==this.open&&(this.open=t,this.emit("open-change",{open:t}),t?this.focusInput():this.shadowRoot?.querySelector(".launcher")?.focus())}focusInput(){this.updateComplete.then(()=>requestAnimationFrame(()=>this.shadowRoot?.querySelector("textarea")?.focus()))}submit(t,n){if(t.preventDefault(),n.answering)return this.stopAnswer()([n]);let o=this.shadowRoot?.querySelector("textarea");o&&(this.send(o.value)([n]),o.value="",this.autosize(o))}onInputKey(t,n){t.key==="Enter"&&!t.shiftKey&&!t.isComposing&&(t.preventDefault(),n.answering||this.submit(t,n))}autosize(t){t.style.height="auto",t.style.height=`${Math.min(t.scrollHeight,140)}px`}onPanelKey(t){if(t.key==="Escape"&&this.mode==="drawer"){t.stopPropagation(),this.setOpen(!1);return}if(t.key!=="Tab"||this.mode==="inline")return;let n=this.shadowRoot?.querySelector(".panel"),o=Array.from(n?.querySelectorAll("button:not([disabled]), select, textarea, a[href]")??[]).filter(a=>!a.closest("[hidden]"));if(!o.length)return;let i=o[0],s=o[o.length-1],l=this.shadowRoot?.activeElement;t.shiftKey&&l===i?(t.preventDefault(),s.focus()):!t.shiftKey&&l===s&&(t.preventDefault(),i.focus())}emit(t,n){this.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))}noticeText(t){if(!t)return"";let n=this.t;return t.kind==="busy"?n[t.what]:t.kind==="info"?n.errors.aborted:n.errors[t.code]??n.errors.default}view(t){let n=this.t,o=this.mode==="drawer",i=t.agents.find(a=>a.id===t.agentId)??null,s=this.heading||i?.name||n.title,l=t.notice;return t.messages.length!==this.lastCount&&(this.lastCount=t.messages.length,this.updateComplete.then(()=>requestAnimationFrame(()=>this.scrollDown()))),w.html`
|
|
208
208
|
<button
|
|
209
209
|
class="launcher"
|
|
210
210
|
part="launcher"
|
|
@@ -215,7 +215,7 @@ textarea:focus-visible { outline: 2px solid var(--_accent); outline-offset: 0; b
|
|
|
215
215
|
?hidden=${!o}
|
|
216
216
|
@click=${()=>this.setOpen(!this.open)}
|
|
217
217
|
>
|
|
218
|
-
<slot name="launcher">${
|
|
218
|
+
<slot name="launcher">${io(ac)}</slot>
|
|
219
219
|
</button>
|
|
220
220
|
<section
|
|
221
221
|
class="panel"
|
|
@@ -224,7 +224,7 @@ textarea:focus-visible { outline: 2px solid var(--_accent); outline-offset: 0; b
|
|
|
224
224
|
aria-label=${s}
|
|
225
225
|
aria-modal=${String(o)}
|
|
226
226
|
?hidden=${!this.shown}
|
|
227
|
-
@keydown=${
|
|
227
|
+
@keydown=${a=>this.onPanelKey(a)}
|
|
228
228
|
>
|
|
229
229
|
<header part="header">
|
|
230
230
|
<span class="title">${s}</span>
|
|
@@ -233,48 +233,48 @@ textarea:focus-visible { outline: 2px solid var(--_accent); outline-offset: 0; b
|
|
|
233
233
|
part="picker"
|
|
234
234
|
aria-label=${n.pickAgent}
|
|
235
235
|
?hidden=${t.agents.length<2}
|
|
236
|
-
@change=${
|
|
236
|
+
@change=${a=>this.pick(a.target.value)}
|
|
237
237
|
>
|
|
238
|
-
${t.agents.map(
|
|
238
|
+
${t.agents.map(a=>w.html`<option value=${a.id} ?selected=${a.id===t.agentId}>${a.name}</option>`)}
|
|
239
239
|
</select>
|
|
240
240
|
<button class="icon new" part="new" type="button" title=${n.newChat} aria-label=${n.newChat} @click=${()=>this.startOver()}>
|
|
241
|
-
${
|
|
241
|
+
${io(cc)}
|
|
242
242
|
</button>
|
|
243
243
|
<button class="icon close" part="close" type="button" title=${n.close} aria-label=${n.close} @click=${()=>this.setOpen(!1)}>
|
|
244
|
-
${
|
|
244
|
+
${io(lc)}
|
|
245
245
|
</button>
|
|
246
246
|
</header>
|
|
247
247
|
<div class="messages" part="messages" role="log" aria-live="polite" aria-relevant="additions">
|
|
248
|
-
${t.messages.length?t.messages.map(
|
|
248
|
+
${t.messages.length?t.messages.map(a=>this.bubble(a)):this.intro(t)}
|
|
249
249
|
</div>
|
|
250
|
-
<div class="turnstile" ?hidden=${
|
|
250
|
+
<div class="turnstile" ?hidden=${l?.kind!=="busy"||l.what!=="verifying"}></div>
|
|
251
251
|
<div
|
|
252
|
-
class="status ${
|
|
252
|
+
class="status ${l?.kind==="error"?"error":""} ${l?.kind==="busy"?"dots":""}"
|
|
253
253
|
part="status"
|
|
254
254
|
role="status"
|
|
255
|
-
>${this.noticeText(
|
|
256
|
-
<form part="composer" @submit=${
|
|
255
|
+
>${this.noticeText(l)}</div>
|
|
256
|
+
<form part="composer" @submit=${a=>this.submit(a,t)}>
|
|
257
257
|
<label class="sr-only" for="lf-input">${n.placeholder}</label>
|
|
258
258
|
<textarea
|
|
259
259
|
id="lf-input"
|
|
260
260
|
part="input"
|
|
261
261
|
rows="1"
|
|
262
262
|
placeholder=${n.placeholder}
|
|
263
|
-
@keydown=${
|
|
264
|
-
@input=${
|
|
263
|
+
@keydown=${a=>this.onInputKey(a,t)}
|
|
264
|
+
@input=${a=>this.autosize(a.target)}
|
|
265
265
|
></textarea>
|
|
266
266
|
<button class="send" part="send" type="submit" aria-label=${t.answering?n.stop:n.send}>
|
|
267
267
|
${t.answering?n.stop:n.send}
|
|
268
268
|
</button>
|
|
269
269
|
</form>
|
|
270
270
|
</section>
|
|
271
|
-
`}bubble(t){return t.role==="user"?
|
|
272
|
-
${
|
|
273
|
-
${t.tools.length?
|
|
274
|
-
</div>`}intro(t){let n=t.agents.find(o=>o.id===t.agentId);return!n?.welcome&&!n?.suggestions?.length?"":
|
|
275
|
-
${n.welcome?
|
|
276
|
-
${n.suggestions?.length?
|
|
277
|
-
${n.suggestions.map(o=>
|
|
271
|
+
`}bubble(t){return t.role==="user"?w.html`<div class="msg user" part="message user">${t.text}</div>`:w.html`<div class="msg assistant" part="message assistant">
|
|
272
|
+
${Vr(t.text)}
|
|
273
|
+
${t.tools.length?w.html`<div class="tools">${this.t.usedTools}: ${t.tools.join(", ")}</div>`:""}
|
|
274
|
+
</div>`}intro(t){let n=t.agents.find(o=>o.id===t.agentId);return!n?.welcome&&!n?.suggestions?.length?"":w.html`
|
|
275
|
+
${n.welcome?w.html`<div class="msg assistant welcome">${Vr(n.welcome)}</div>`:""}
|
|
276
|
+
${n.suggestions?.length?w.html`<div class="suggestions">
|
|
277
|
+
${n.suggestions.map(o=>w.html`<button type="button" part="suggestion" @click=${()=>this.send(o)([t])}>${o}</button>`)}
|
|
278
278
|
</div>`:""}
|
|
279
|
-
`}scrollDown(){let t=this.shadowRoot?.querySelector(".messages");t&&(t.scrollTop=t.scrollHeight)}};
|
|
279
|
+
`}scrollDown(){let t=this.shadowRoot?.querySelector(".messages");t&&(t.scrollTop=t.scrollHeight)}};N([(0,w.property)({type:Boolean,reflect:!0})],D.prototype,"open",2),N([(0,w.property)({reflect:!0})],D.prototype,"mode",2),N([(0,w.property)({reflect:!0})],D.prototype,"position",2),N([(0,w.property)({reflect:!0})],D.prototype,"theme",2),N([(0,w.property)()],D.prototype,"agent",2),N([(0,w.property)()],D.prototype,"agents",2),N([(0,w.property)()],D.prototype,"locale",2),N([(0,w.property)({attribute:"title"})],D.prototype,"heading",2),N([(0,w.property)()],D.prototype,"url",2),N([(0,w.property)({attribute:"publishable-key"})],D.prototype,"publishableKey",2),N([(0,w.property)({attribute:"token-url"})],D.prototype,"tokenUrl",2),N([(0,w.property)({attribute:"turnstile-sitekey"})],D.prototype,"turnstileSitekey",2),N([(0,w.property)({attribute:"turnstile-url"})],D.prototype,"turnstileUrl",2),N([(0,w.property)({attribute:!1})],D.prototype,"client",2),N([(0,w.property)({attribute:!1})],D.prototype,"getToken",2),N([(0,w.property)({attribute:!1})],D.prototype,"strings",2),D=N([(0,Xs.Component)({Settings:{selector:Qt,styles:[(0,w.unsafeCSS)(Js)]},Loading:()=>w.html``,Error:()=>w.html``,State(){return this.connect()},Render:()=>function(r){return this.view(r)}})],D);var on=document.currentScript,uc={key:"publishable-key",tokenUrl:"token-url",agent:"agent",agents:"agents",url:"url",mode:"mode",position:"position",locale:"locale",title:"title",theme:"theme",open:"open",turnstileSitekey:"turnstile-sitekey",turnstileUrl:"turnstile-url"};if(on&&(on.dataset.key||on.dataset.tokenUrl)){let r=()=>{let e=document.createElement(Qt);for(let[t,n]of Object.entries(uc)){let o=on.dataset[t];o!==void 0&&e.setAttribute(n,o)}document.body.append(e)};document.body?r():document.addEventListener("DOMContentLoaded",r,{once:!0})}})();
|
|
280
280
|
//# sourceMappingURL=agent-chat.js.map
|