marketplacepos 3.10.1 → 3.10.2
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/Marketplace/{chunk-QOGXVEGW.js → chunk-223SSA62.js} +1 -1
- package/Marketplace/{chunk-FTHNPPXM.js → chunk-2HHCA3NK.js} +1 -1
- package/Marketplace/{chunk-V3UGRPNZ.js → chunk-2OVWEFCG.js} +1 -1
- package/Marketplace/{chunk-P24WVMWI.js → chunk-2TS2HEE6.js} +1 -1
- package/Marketplace/{chunk-RONMO7FE.js → chunk-3ZPC3DOZ.js} +1 -1
- package/Marketplace/{chunk-IWREFJGX.js → chunk-4R2X6SN5.js} +1 -1
- package/Marketplace/{chunk-36GAH775.js → chunk-5VJQDJRJ.js} +1 -1
- package/Marketplace/{chunk-H57B7P7N.js → chunk-6C4L2S7S.js} +1 -1
- package/Marketplace/{chunk-JUI6EOAN.js → chunk-6NGKE364.js} +1 -1
- package/Marketplace/{chunk-BFNB4J5W.js → chunk-6ORTAB6O.js} +1 -1
- package/Marketplace/{chunk-CNKB33H4.js → chunk-7C4NOK37.js} +1 -1
- package/Marketplace/{chunk-A2WAKRJC.js → chunk-7RZLTDIS.js} +1 -1
- package/Marketplace/{chunk-UCVQS5HR.js → chunk-B6BTNEL5.js} +1 -1
- package/Marketplace/{chunk-MWO3MHRT.js → chunk-C6SMFVRJ.js} +1 -1
- package/Marketplace/{chunk-L35RXBHK.js → chunk-CCMD33HH.js} +1 -1
- package/Marketplace/{chunk-7NZIFRTH.js → chunk-CD5AKGA4.js} +1 -1
- package/Marketplace/{chunk-C3TFPYXX.js → chunk-DDXVCGNF.js} +1 -1
- package/Marketplace/{chunk-QUSBGNEW.js → chunk-DG6KCZ24.js} +1 -1
- package/Marketplace/{chunk-BJBDPG47.js → chunk-DITYFI3U.js} +1 -1
- package/Marketplace/{chunk-C7TRF3SY.js → chunk-EJMJP3AQ.js} +2 -2
- package/Marketplace/{chunk-DHJDNOMM.js → chunk-FGIAQ42H.js} +1 -1
- package/Marketplace/{chunk-LDMABSVE.js → chunk-G7RXTLDR.js} +1 -1
- package/Marketplace/{chunk-Z5U5IBQC.js → chunk-GK4USVUZ.js} +1 -1
- package/Marketplace/{chunk-3CF7HOB3.js → chunk-GRHKW2KQ.js} +1 -1
- package/Marketplace/{chunk-F7TBBOWO.js → chunk-H6M6M4LW.js} +1 -1
- package/Marketplace/{chunk-ODAO6UI4.js → chunk-I2G5J34U.js} +1 -1
- package/Marketplace/{chunk-NIH5QHYK.js → chunk-JN7U2QOU.js} +1 -1
- package/Marketplace/{chunk-JJPZKFSE.js → chunk-L3QJXWW4.js} +1 -1
- package/Marketplace/{chunk-WZCMEPBS.js → chunk-LPSC67EP.js} +1 -1
- package/Marketplace/{chunk-QZFQKQ7J.js → chunk-M4MZ4PBS.js} +1 -1
- package/Marketplace/{chunk-CNCAKULD.js → chunk-MB5EFAFQ.js} +1 -1
- package/Marketplace/{chunk-XDLTNTVT.js → chunk-MFWCFDSI.js} +1 -1
- package/Marketplace/{chunk-PLNXC7LP.js → chunk-MIITW5F3.js} +1 -1
- package/Marketplace/{chunk-GR67GFTL.js → chunk-MQ5YF2EQ.js} +1 -1
- package/Marketplace/{chunk-Z3NC34XH.js → chunk-NNZ2QIAF.js} +1 -1
- package/Marketplace/{chunk-GTSE6GZT.js → chunk-NX7MGO3M.js} +1 -1
- package/Marketplace/{chunk-LDGVYQDZ.js → chunk-NZ5PGMTU.js} +1 -1
- package/Marketplace/chunk-OZAOB2RM.js +1 -0
- package/Marketplace/{chunk-VXL3UMDN.js → chunk-PHYOU4H6.js} +1 -1
- package/Marketplace/{chunk-2RIYYO3I.js → chunk-PIKZDDIU.js} +1 -1
- package/Marketplace/{chunk-ZDNNLDAI.js → chunk-POHGR6GW.js} +1 -1
- package/Marketplace/{chunk-6GF6XSWZ.js → chunk-RS4FBR2B.js} +1 -1
- package/Marketplace/{chunk-OM4EEQPS.js → chunk-RTSSYFK3.js} +1 -1
- package/Marketplace/{chunk-ZQYW374F.js → chunk-TZRTEOJA.js} +1 -1
- package/Marketplace/{chunk-JJLMXJYI.js → chunk-UYBYAC3J.js} +1 -1
- package/Marketplace/{chunk-52UFYFEM.js → chunk-UZO2VDKA.js} +1 -1
- package/Marketplace/chunk-V3BUL62F.js +1 -0
- package/Marketplace/{chunk-F5ZJBCUU.js → chunk-V6IO53G5.js} +1 -1
- package/Marketplace/{chunk-5PIRWI5F.js → chunk-VA2Y75VY.js} +1 -1
- package/Marketplace/{chunk-OIUZMXWP.js → chunk-VGBWD4JQ.js} +1 -1
- package/Marketplace/{chunk-F2X2FB6J.js → chunk-VWCDA6IC.js} +1 -1
- package/Marketplace/{chunk-OIV2KTCZ.js → chunk-WKWDPKZH.js} +1 -1
- package/Marketplace/{chunk-WIQODYPX.js → chunk-WTRYN5E5.js} +1 -1
- package/Marketplace/{chunk-XB2UHCVJ.js → chunk-XT3VATZ2.js} +1 -1
- package/Marketplace/{chunk-23SBJKPP.js → chunk-Y3MMZORK.js} +1 -1
- package/Marketplace/{chunk-U53TPHQS.js → chunk-YBOYS5WI.js} +1 -1
- package/Marketplace/{chunk-ODJ4UZGV.js → chunk-Z24AOV6E.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/main-2KHAM5PJ.js +1 -0
- package/Marketplace/{styles-UF4D57IG.css → styles-U2EKFDJI.css} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-LKQ6EHTZ.js +0 -1
- package/Marketplace/chunk-UWJWLXE2.js +0 -1
- package/Marketplace/main-B2USSC5L.js +0 -1
- /package/Marketplace/{chunk-PUBPICPK.js → chunk-NNG6BZAM.js} +0 -0
- /package/Marketplace/{chunk-UWYERBYV.js → chunk-ODLFLX6Z.js} +0 -0
- /package/Marketplace/{chunk-KG5K5AND.js → chunk-SDNS6DZW.js} +0 -0
- /package/Marketplace/{polyfills-UZ2JZAXP.js → polyfills-OPLU3AGL.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as D,b as ee,j as Cd,k as Oo,l as Ed,m as Id}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.
|
|
1
|
+
import{a as D,b as ee,j as Cd,k as Oo,l as Ed,m as Id}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-NNG6BZAM.js";function M(t){return typeof t=="function"}function da(t){return M(t?.lift)}function b(t){return e=>{if(da(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function jt(t){let r=t(n=>{Error.call(n),n.stack=new Error().stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Po=jt(t=>function(r){t(this),this.message=r?`${r.length} errors occurred during unsubscription:
|
|
2
2
|
${r.map((n,o)=>`${o+1}) ${n.toString()}`).join(`
|
|
3
3
|
`)}`:"",this.name="UnsubscriptionError",this.errors=r});function tn(t,e){if(t){let r=t.indexOf(e);0<=r&&t.splice(r,1)}}var Q=class t{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(let i of r)i.remove(this);else r.remove(this);let{initialTeardown:n}=this;if(M(n))try{n()}catch(i){e=i instanceof Po?i.errors:[i]}let{_finalizers:o}=this;if(o){this._finalizers=null;for(let i of o)try{bd(i)}catch(s){e=e??[],s instanceof Po?e=[...e,...s.errors]:e.push(s)}}if(e)throw new Po(e)}}add(e){var r;if(e&&e!==this)if(this.closed)bd(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}}_hasParent(e){let{_parentage:r}=this;return r===e||Array.isArray(r)&&r.includes(e)}_addParent(e){let{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e}_removeParent(e){let{_parentage:r}=this;r===e?this._parentage=null:Array.isArray(r)&&tn(r,e)}remove(e){let{_finalizers:r}=this;r&&tn(r,e),e instanceof t&&e._removeParent(this)}};Q.EMPTY=(()=>{let t=new Q;return t.closed=!0,t})();var fa=Q.EMPTY;function Fo(t){return t instanceof Q||t&&"closed"in t&&M(t.remove)&&M(t.add)&&M(t.unsubscribe)}function bd(t){M(t)?t():t.unsubscribe()}var Be={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Tn={setTimeout(t,e,...r){let{delegate:n}=Tn;return n?.setTimeout?n.setTimeout(t,e,...r):setTimeout(t,e,...r)},clearTimeout(t){let{delegate:e}=Tn;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function ko(t){Tn.setTimeout(()=>{let{onUnhandledError:e}=Be;if(e)e(t);else throw t})}function He(){}var Md=(()=>ha("C",void 0,void 0))();function Sd(t){return ha("E",void 0,t)}function Td(t){return ha("N",t,void 0)}function ha(t,e,r){return{kind:t,value:e,error:r}}var nn=null;function xn(t){if(Be.useDeprecatedSynchronousErrorHandling){let e=!nn;if(e&&(nn={errorThrown:!1,error:null}),t(),e){let{errorThrown:r,error:n}=nn;if(nn=null,r)throw n}}else t()}function xd(t){Be.useDeprecatedSynchronousErrorHandling&&nn&&(nn.errorThrown=!0,nn.error=t)}var rn=class extends Q{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Fo(e)&&e.add(this)):this.destination=Dv}static create(e,r,n){return new yt(e,r,n)}next(e){this.isStopped?ga(Td(e),this):this._next(e)}error(e){this.isStopped?ga(Sd(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?ga(Md,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},vv=Function.prototype.bind;function pa(t,e){return vv.call(t,e)}var ma=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:r}=this;if(r.next)try{r.next(e)}catch(n){Lo(n)}}error(e){let{partialObserver:r}=this;if(r.error)try{r.error(e)}catch(n){Lo(n)}else Lo(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(r){Lo(r)}}},yt=class extends rn{constructor(e,r,n){super();let o;if(M(e)||!e)o={next:e??void 0,error:r??void 0,complete:n??void 0};else{let i;this&&Be.useDeprecatedNextContext?(i=Object.create(e),i.unsubscribe=()=>this.unsubscribe(),o={next:e.next&&pa(e.next,i),error:e.error&&pa(e.error,i),complete:e.complete&&pa(e.complete,i)}):o=e}this.destination=new ma(o)}};function Lo(t){Be.useDeprecatedSynchronousErrorHandling?xd(t):ko(t)}function yv(t){throw t}function ga(t,e){let{onStoppedNotification:r}=Be;r&&Tn.setTimeout(()=>r(t,e))}var Dv={closed:!0,next:He,error:yv,complete:He};function I(t,e,r,n,o){return new va(t,e,r,n,o)}var va=class extends rn{constructor(e,r,n,o,i,s){super(e),this.onFinalize=i,this.shouldUnsubscribe=s,this._next=r?function(a){try{r(a)}catch(u){e.error(u)}}:super._next,this._error=o?function(a){try{o(a)}catch(u){e.error(u)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:r}=this;super.unsubscribe(),!r&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};function O(t,e){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>{n.next(t.call(e,i,o++))}))})}var _n=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")();function le(t){return t}function ya(...t){return Da(t)}function Da(t){return t.length===0?le:t.length===1?t[0]:function(r){return t.reduce((n,o)=>o(n),r)}}var k=(()=>{class t{constructor(r){r&&(this._subscribe=r)}lift(r){let n=new t;return n.source=this,n.operator=r,n}subscribe(r,n,o){let i=Cv(r)?r:new yt(r,n,o);return xn(()=>{let{operator:s,source:a}=this;i.add(s?s.call(i,a):a?this._subscribe(i):this._trySubscribe(i))}),i}_trySubscribe(r){try{return this._subscribe(r)}catch(n){r.error(n)}}forEach(r,n){return n=_d(n),new n((o,i)=>{let s=new yt({next:a=>{try{r(a)}catch(u){i(u),s.unsubscribe()}},error:i,complete:o});this.subscribe(s)})}_subscribe(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)}[_n](){return this}pipe(...r){return Da(r)(this)}toPromise(r){return r=_d(r),new r((n,o)=>{let i;this.subscribe(s=>i=s,s=>o(s),()=>n(i))})}}return t.create=e=>new t(e),t})();function _d(t){var e;return(e=t??Be.Promise)!==null&&e!==void 0?e:Promise}function wv(t){return t&&M(t.next)&&M(t.error)&&M(t.complete)}function Cv(t){return t&&t instanceof rn||wv(t)&&Fo(t)}var Ad=jt(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var ae=(()=>{class t extends k{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){let n=new jo(this,this);return n.operator=r,n}_throwIfClosed(){if(this.closed)throw new Ad}next(r){xn(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(r)}})}error(r){xn(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;let{observers:n}=this;for(;n.length;)n.shift().error(r)}})}complete(){xn(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){let{hasError:n,isStopped:o,observers:i}=this;return n||o?fa:(this.currentObservers=null,i.push(r),new Q(()=>{this.currentObservers=null,tn(i,r)}))}_checkFinalizedStatuses(r){let{hasError:n,thrownError:o,isStopped:i}=this;n?r.error(o):i&&r.complete()}asObservable(){let r=new k;return r.source=this,r}}return t.create=(e,r)=>new jo(e,r),t})(),jo=class extends ae{constructor(e,r){super(),this.destination=e,this.source=r}next(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.next)===null||n===void 0||n.call(r,e)}error(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.error)===null||n===void 0||n.call(r,e)}complete(){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||r===void 0||r.call(e)}_subscribe(e){var r,n;return(n=(r=this.source)===null||r===void 0?void 0:r.subscribe(e))!==null&&n!==void 0?n:fa}};var Ir={now(){return(Ir.delegate||Date).now()},delegate:void 0};var br=class extends ae{constructor(e=1/0,r=1/0,n=Ir){super(),this._bufferSize=e,this._windowTime=r,this._timestampProvider=n,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=r===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,r)}next(e){let{isStopped:r,_buffer:n,_infiniteTimeWindow:o,_timestampProvider:i,_windowTime:s}=this;r||(n.push(e),!o&&n.push(i.now()+s)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let r=this._innerSubscribe(e),{_infiniteTimeWindow:n,_buffer:o}=this,i=o.slice();for(let s=0;s<i.length&&!e.closed;s+=n?1:2)e.next(i[s]);return this._checkFinalizedStatuses(e),r}_trimBuffer(){let{_bufferSize:e,_timestampProvider:r,_buffer:n,_infiniteTimeWindow:o}=this,i=(o?1:2)*e;if(e<1/0&&i<n.length&&n.splice(0,n.length-i),!o){let s=r.now(),a=0;for(let u=1;u<n.length&&n[u]<=s;u+=2)a=u;a&&n.splice(0,a+1)}}};var An=t=>t&&typeof t.length=="number"&&typeof t!="function";function Vo(t){return M(t?.then)}function $o(t){return M(t[_n])}function Uo(t){return Symbol.asyncIterator&&M(t?.[Symbol.asyncIterator])}function Bo(t){return new TypeError(`You provided ${t!==null&&typeof t=="object"?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function Ev(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ho=Ev();function zo(t){return M(t?.[Ho])}function Wo(t){return Ed(this,arguments,function*(){let r=t.getReader();try{for(;;){let{value:n,done:o}=yield Oo(r.read());if(o)return yield Oo(void 0);yield yield Oo(n)}}finally{r.releaseLock()}})}function Go(t){return M(t?.getReader)}function P(t){if(t instanceof k)return t;if(t!=null){if($o(t))return Iv(t);if(An(t))return bv(t);if(Vo(t))return Mv(t);if(Uo(t))return Nd(t);if(zo(t))return Sv(t);if(Go(t))return Tv(t)}throw Bo(t)}function Iv(t){return new k(e=>{let r=t[_n]();if(M(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function bv(t){return new k(e=>{for(let r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}function Mv(t){return new k(e=>{t.then(r=>{e.closed||(e.next(r),e.complete())},r=>e.error(r)).then(null,ko)})}function Sv(t){return new k(e=>{for(let r of t)if(e.next(r),e.closed)return;e.complete()})}function Nd(t){return new k(e=>{xv(t,e).catch(r=>e.error(r))})}function Tv(t){return Nd(Wo(t))}function xv(t,e){var r,n,o,i;return Cd(this,void 0,void 0,function*(){try{for(r=Id(t);n=yield r.next(),!n.done;){let s=n.value;if(e.next(s),e.closed)return}}catch(s){o={error:s}}finally{try{n&&!n.done&&(i=r.return)&&(yield i.call(r))}finally{if(o)throw o.error}}e.complete()})}function Ca(t={}){let{connector:e=()=>new ae,resetOnError:r=!0,resetOnComplete:n=!0,resetOnRefCountZero:o=!0}=t;return i=>{let s,a,u,c=0,l=!1,d=!1,f=()=>{a?.unsubscribe(),a=void 0},h=()=>{f(),s=u=void 0,l=d=!1},p=()=>{let S=s;h(),S?.unsubscribe()};return b((S,C)=>{c++,!d&&!l&&f();let m=u=u??e();C.add(()=>{c--,c===0&&!d&&!l&&(a=wa(p,o))}),m.subscribe(C),!s&&c>0&&(s=new yt({next:j=>m.next(j),error:j=>{d=!0,f(),a=wa(h,r,j),m.error(j)},complete:()=>{l=!0,f(),a=wa(h,n),m.complete()}}),P(S).subscribe(s))})(i)}}function wa(t,e,...r){if(e===!0){t();return}if(e===!1)return;let n=new yt({next:()=>{n.unsubscribe(),t()}});return P(e(...r)).subscribe(n)}function Rd(t,e,r){let n,o=!1;return t&&typeof t=="object"?{bufferSize:n=1/0,windowTime:e=1/0,refCount:o=!1,scheduler:r}=t:n=t??1/0,Ca({connector:()=>new br(n,e,r),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}function Nn(){return b((t,e)=>{let r=null;t._refCount++;let n=I(e,void 0,void 0,void 0,()=>{if(!t||t._refCount<=0||0<--t._refCount){r=null;return}let o=t._connection,i=r;r=null,o&&(!i||o===i)&&o.unsubscribe(),e.unsubscribe()});t.subscribe(n),n.closed||(r=t.connect())})}var Rn=class extends k{constructor(e,r){super(),this.source=e,this.subjectFactory=r,this._subject=null,this._refCount=0,this._connection=null,da(e)&&(this.lift=e.lift)}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){let e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;let{_connection:e}=this;this._subject=this._connection=null,e?.unsubscribe()}connect(){let e=this._connection;if(!e){e=this._connection=new Q;let r=this.getSubject();e.add(this.source.subscribe(I(r,void 0,()=>{this._teardown(),r.complete()},n=>{this._teardown(),r.error(n)},()=>this._teardown()))),e.closed&&(this._connection=null,e=Q.EMPTY)}return e}refCount(){return Nn()(this)}};var On={schedule(t){let e=requestAnimationFrame,r=cancelAnimationFrame,{delegate:n}=On;n&&(e=n.requestAnimationFrame,r=n.cancelAnimationFrame);let o=e(i=>{r=void 0,t(i)});return new Q(()=>r?.(o))},requestAnimationFrame(...t){let{delegate:e}=On;return(e?.requestAnimationFrame||requestAnimationFrame)(...t)},cancelAnimationFrame(...t){let{delegate:e}=On;return(e?.cancelAnimationFrame||cancelAnimationFrame)(...t)},delegate:void 0};var de=class extends ae{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let r=super._subscribe(e);return!r.closed&&e.next(this._value),r}getValue(){let{hasError:e,thrownError:r,_value:n}=this;if(e)throw r;return this._throwIfClosed(),n}next(e){super.next(this._value=e)}};var qo=class extends Q{constructor(e,r){super()}schedule(e,r=0){return this}};var Mr={setInterval(t,e,...r){let{delegate:n}=Mr;return n?.setInterval?n.setInterval(t,e,...r):setInterval(t,e,...r)},clearInterval(t){let{delegate:e}=Mr;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var Ke=class extends qo{constructor(e,r){super(e,r),this.scheduler=e,this.work=r,this.pending=!1}schedule(e,r=0){var n;if(this.closed)return this;this.state=e;let o=this.id,i=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(i,o,r)),this.pending=!0,this.delay=r,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(i,this.id,r),this}requestAsyncId(e,r,n=0){return Mr.setInterval(e.flush.bind(e,this),n)}recycleAsyncId(e,r,n=0){if(n!=null&&this.delay===n&&this.pending===!1)return r;r!=null&&Mr.clearInterval(r)}execute(e,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let n=this._execute(e,r);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,r){let n=!1,o;try{this.work(e)}catch(i){n=!0,o=i||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),o}unsubscribe(){if(!this.closed){let{id:e,scheduler:r}=this,{actions:n}=r;this.work=this.state=this.scheduler=null,this.pending=!1,tn(n,this),e!=null&&(this.id=this.recycleAsyncId(r,e,null)),this.delay=null,super.unsubscribe()}}};var _v=1,Ea,Ia={};function Od(t){return t in Ia?(delete Ia[t],!0):!1}var Pd={setImmediate(t){let e=_v++;return Ia[e]=!0,Ea||(Ea=Promise.resolve()),Ea.then(()=>Od(e)&&t()),e},clearImmediate(t){Od(t)}};var{setImmediate:Av,clearImmediate:Nv}=Pd,Sr={setImmediate(...t){let{delegate:e}=Sr;return(e?.setImmediate||Av)(...t)},clearImmediate(t){let{delegate:e}=Sr;return(e?.clearImmediate||Nv)(t)},delegate:void 0};var Zo=class extends Ke{constructor(e,r){super(e,r),this.scheduler=e,this.work=r}requestAsyncId(e,r,n=0){return n!==null&&n>0?super.requestAsyncId(e,r,n):(e.actions.push(this),e._scheduled||(e._scheduled=Sr.setImmediate(e.flush.bind(e,void 0))))}recycleAsyncId(e,r,n=0){var o;if(n!=null?n>0:this.delay>0)return super.recycleAsyncId(e,r,n);let{actions:i}=e;r!=null&&((o=i[i.length-1])===null||o===void 0?void 0:o.id)!==r&&(Sr.clearImmediate(r),e._scheduled===r&&(e._scheduled=void 0))}};var Pn=class t{constructor(e,r=t.now){this.schedulerActionCtor=e,this.now=r}schedule(e,r=0,n){return new this.schedulerActionCtor(this,e).schedule(n,r)}};Pn.now=Ir.now;var Je=class extends Pn{constructor(e,r=Pn.now){super(e,r),this.actions=[],this._active=!1}flush(e){let{actions:r}=this;if(this._active){r.push(e);return}let n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=r.shift());if(this._active=!1,n){for(;e=r.shift();)e.unsubscribe();throw n}}};var Yo=class extends Je{flush(e){this._active=!0;let r=this._scheduled;this._scheduled=void 0;let{actions:n}=this,o;e=e||n.shift();do if(o=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===r&&n.shift());if(this._active=!1,o){for(;(e=n[0])&&e.id===r&&n.shift();)e.unsubscribe();throw o}}};var Rv=new Yo(Zo);var Xe=new Je(Ke),ba=Xe;var Qo=class extends Ke{constructor(e,r){super(e,r),this.scheduler=e,this.work=r}schedule(e,r=0){return r>0?super.schedule(e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)}execute(e,r){return r>0||this.closed?super.execute(e,r):this._execute(e,r)}requestAsyncId(e,r,n=0){return n!=null&&n>0||n==null&&this.delay>0?super.requestAsyncId(e,r,n):(e.flush(this),0)}};var Ko=class extends Je{};var Ov=new Ko(Qo);var Jo=class extends Ke{constructor(e,r){super(e,r),this.scheduler=e,this.work=r}requestAsyncId(e,r,n=0){return n!==null&&n>0?super.requestAsyncId(e,r,n):(e.actions.push(this),e._scheduled||(e._scheduled=On.requestAnimationFrame(()=>e.flush(void 0))))}recycleAsyncId(e,r,n=0){var o;if(n!=null?n>0:this.delay>0)return super.recycleAsyncId(e,r,n);let{actions:i}=e;r!=null&&((o=i[i.length-1])===null||o===void 0?void 0:o.id)!==r&&(On.cancelAnimationFrame(r),e._scheduled=void 0)}};var Xo=class extends Je{flush(e){this._active=!0;let r=this._scheduled;this._scheduled=void 0;let{actions:n}=this,o;e=e||n.shift();do if(o=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===r&&n.shift());if(this._active=!1,o){for(;(e=n[0])&&e.id===r&&n.shift();)e.unsubscribe();throw o}}};var Pv=new Xo(Jo);var Ie=new k(t=>t.complete());function ei(t){return t&&M(t.schedule)}function Ma(t){return t[t.length-1]}function Fn(t){return M(Ma(t))?t.pop():void 0}function et(t){return ei(Ma(t))?t.pop():void 0}function Fd(t,e){return typeof Ma(t)=="number"?t.pop():e}function pe(t,e,r,n=0,o=!1){let i=e.schedule(function(){r(),o?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(i),!o)return i}function Tr(t,e=0){return b((r,n)=>{r.subscribe(I(n,o=>pe(n,t,()=>n.next(o),e),()=>pe(n,t,()=>n.complete(),e),o=>pe(n,t,()=>n.error(o),e)))})}function xr(t,e=0){return b((r,n)=>{n.add(t.schedule(()=>r.subscribe(n),e))})}function kd(t,e){return P(t).pipe(xr(e),Tr(e))}function Ld(t,e){return P(t).pipe(xr(e),Tr(e))}function jd(t,e){return new k(r=>{let n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})})}function Vd(t,e){return new k(r=>{let n;return pe(r,e,()=>{n=t[Ho](),pe(r,e,()=>{let o,i;try{({value:o,done:i}=n.next())}catch(s){r.error(s);return}i?r.complete():r.next(o)},0,!0)}),()=>M(n?.return)&&n.return()})}function ti(t,e){if(!t)throw new Error("Iterable cannot be null");return new k(r=>{pe(r,e,()=>{let n=t[Symbol.asyncIterator]();pe(r,e,()=>{n.next().then(o=>{o.done?r.complete():r.next(o.value)})},0,!0)})})}function $d(t,e){return ti(Wo(t),e)}function Ud(t,e){if(t!=null){if($o(t))return kd(t,e);if(An(t))return jd(t,e);if(Vo(t))return Ld(t,e);if(Uo(t))return ti(t,e);if(zo(t))return Vd(t,e);if(Go(t))return $d(t,e)}throw Bo(t)}function G(t,e){return e?Ud(t,e):P(t)}function x(...t){let e=et(t);return G(t,e)}function kn(t,e){let r=M(t)?t:()=>t,n=o=>o.error(r());return new k(e?o=>e.schedule(n,0,o):n)}function Sa(t){return!!t&&(t instanceof k||M(t.lift)&&M(t.subscribe))}var Dt=jt(t=>function(){t(this),this.name="EmptyError",this.message="no elements in sequence"});function ni(t){return t instanceof Date&&!isNaN(t)}var Fv=jt(t=>function(r=null){t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r});function kv(t,e){let{first:r,each:n,with:o=Lv,scheduler:i=e??Xe,meta:s=null}=ni(t)?{first:t}:typeof t=="number"?{each:t}:t;if(r==null&&n==null)throw new TypeError("No timeout provided.");return b((a,u)=>{let c,l,d=null,f=0,h=p=>{l=pe(u,i,()=>{try{c.unsubscribe(),P(o({meta:s,lastValue:d,seen:f})).subscribe(u)}catch(S){u.error(S)}},p)};c=a.subscribe(I(u,p=>{l?.unsubscribe(),f++,u.next(d=p),n>0&&h(n)},void 0,void 0,()=>{l?.closed||l?.unsubscribe(),d=null})),!f&&h(r!=null?typeof r=="number"?r:+r-i.now():n)})}function Lv(t){throw new Fv(t)}var{isArray:jv}=Array;function Vv(t,e){return jv(e)?t(...e):t(e)}function Ln(t){return O(e=>Vv(t,e))}var{isArray:$v}=Array,{getPrototypeOf:Uv,prototype:Bv,keys:Hv}=Object;function ri(t){if(t.length===1){let e=t[0];if($v(e))return{args:e,keys:null};if(zv(e)){let r=Hv(e);return{args:r.map(n=>e[n]),keys:r}}}return{args:t,keys:null}}function zv(t){return t&&typeof t=="object"&&Uv(t)===Bv}function oi(t,e){return t.reduce((r,n,o)=>(r[n]=e[o],r),{})}function _r(...t){let e=et(t),r=Fn(t),{args:n,keys:o}=ri(t);if(n.length===0)return G([],e);let i=new k(Wv(n,e,o?s=>oi(o,s):le));return r?i.pipe(Ln(r)):i}function Wv(t,e,r=le){return n=>{Bd(e,()=>{let{length:o}=t,i=new Array(o),s=o,a=o;for(let u=0;u<o;u++)Bd(e,()=>{let c=G(t[u],e),l=!1;c.subscribe(I(n,d=>{i[u]=d,l||(l=!0,a--),a||n.next(r(i.slice()))},()=>{--s||n.complete()}))},n)},n)}}function Bd(t,e,r){t?pe(r,t,e):e()}function Hd(t,e,r,n,o,i,s,a){let u=[],c=0,l=0,d=!1,f=()=>{d&&!u.length&&!c&&e.complete()},h=S=>c<n?p(S):u.push(S),p=S=>{i&&e.next(S),c++;let C=!1;P(r(S,l++)).subscribe(I(e,m=>{o?.(m),i?h(m):e.next(m)},()=>{C=!0},void 0,()=>{if(C)try{for(c--;u.length&&c<n;){let m=u.shift();s?pe(e,s,()=>p(m)):p(m)}f()}catch(m){e.error(m)}}))};return t.subscribe(I(e,h,()=>{d=!0,f()})),()=>{a?.()}}function K(t,e,r=1/0){return M(e)?K((n,o)=>O((i,s)=>e(n,i,o,s))(P(t(n,o))),r):(typeof e=="number"&&(r=e),b((n,o)=>Hd(n,o,t,r)))}function tt(t=1/0){return K(le,t)}function zd(){return tt(1)}function jn(...t){return zd()(G(t,et(t)))}function ii(t){return new k(e=>{P(t()).subscribe(e)})}function Gv(...t){let e=Fn(t),{args:r,keys:n}=ri(t),o=new k(i=>{let{length:s}=r;if(!s){i.complete();return}let a=new Array(s),u=s,c=s;for(let l=0;l<s;l++){let d=!1;P(r[l]).subscribe(I(i,f=>{d||(d=!0,c--),a[l]=f},()=>u--,void 0,()=>{(!u||!d)&&(c||i.next(n?oi(n,a):a),i.complete())}))}});return e?o.pipe(Ln(e)):o}var qv=["addListener","removeListener"],Zv=["addEventListener","removeEventListener"],Yv=["on","off"];function Ta(t,e,r,n){if(M(r)&&(n=r,r=void 0),n)return Ta(t,e,r).pipe(Ln(n));let[o,i]=Jv(t)?Zv.map(s=>a=>t[s](e,a,r)):Qv(t)?qv.map(Wd(t,e)):Kv(t)?Yv.map(Wd(t,e)):[];if(!o&&An(t))return K(s=>Ta(s,e,r))(P(t));if(!o)throw new TypeError("Invalid event target");return new k(s=>{let a=(...u)=>s.next(1<u.length?u:u[0]);return o(a),()=>i(a)})}function Wd(t,e){return r=>n=>t[r](e,n)}function Qv(t){return M(t.addListener)&&M(t.removeListener)}function Kv(t){return M(t.on)&&M(t.off)}function Jv(t){return M(t.addEventListener)&&M(t.removeEventListener)}function Ar(t=0,e,r=ba){let n=-1;return e!=null&&(ei(e)?r=e:n=e),new k(o=>{let i=ni(t)?+t-r.now():t;i<0&&(i=0);let s=0;return r.schedule(function(){o.closed||(o.next(s++),0<=n?this.schedule(void 0,n):o.complete())},i)})}function Xv(t=0,e=Xe){return t<0&&(t=0),Ar(t,t,e)}function ey(...t){let e=et(t),r=Fd(t,1/0),n=t;return n.length?n.length===1?P(n[0]):tt(r)(G(n,e)):Ie}function Gd(t,e){return(r,n)=>!t.call(e,r,n)}function te(t,e){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>t.call(e,i,o++)&&n.next(i)))})}function ty(t,e,r){return[te(e,r)(P(t)),te(Gd(e,r))(P(t))]}function qd(t){return b((e,r)=>{let n=!1,o=null,i=null,s=!1,a=()=>{if(i?.unsubscribe(),i=null,n){n=!1;let c=o;o=null,r.next(c)}s&&r.complete()},u=()=>{i=null,s&&r.complete()};e.subscribe(I(r,c=>{n=!0,o=c,i||P(t(c)).subscribe(i=I(r,a,u))},()=>{s=!0,(!n||!i||i.closed)&&r.complete()}))})}function ny(t,e=Xe){return qd(()=>Ar(t,e))}function wt(t){return b((e,r)=>{let n=null,o=!1,i;n=e.subscribe(I(r,void 0,void 0,s=>{i=P(t(s,wt(t)(e))),n?(n.unsubscribe(),n=null,i.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(r))})}function Zd(t,e,r,n,o){return(i,s)=>{let a=r,u=e,c=0;i.subscribe(I(s,l=>{let d=c++;u=a?t(u,l,d):(a=!0,l),n&&s.next(u)},o&&(()=>{a&&s.next(u),s.complete()})))}}function nt(t,e){return M(e)?K(t,e,1):K(t,1)}function ry(t){return b((e,r)=>{let n=!1,o=null,i=null,s=()=>{if(i?.unsubscribe(),i=null,n){n=!1;let a=o;o=null,r.next(a)}};e.subscribe(I(r,a=>{i?.unsubscribe(),n=!0,o=a,i=I(r,s,He),P(t(a)).subscribe(i)},()=>{s(),r.complete()},void 0,()=>{o=i=null}))})}function oy(t,e=Xe){return b((r,n)=>{let o=null,i=null,s=null,a=()=>{if(o){o.unsubscribe(),o=null;let c=i;i=null,n.next(c)}};function u(){let c=s+t,l=e.now();if(l<c){o=this.schedule(void 0,c-l),n.add(o);return}a()}r.subscribe(I(n,c=>{i=c,s=e.now(),o||(o=e.schedule(u,t),n.add(o))},()=>{a(),n.complete()},void 0,()=>{i=o=null}))})}function Vt(t){return b((e,r)=>{let n=!1;e.subscribe(I(r,o=>{n=!0,r.next(o)},()=>{n||r.next(t),r.complete()}))})}function Ct(t){return t<=0?()=>Ie:b((e,r)=>{let n=0;e.subscribe(I(r,o=>{++n<=t&&(r.next(o),t<=n&&r.complete())}))})}function iy(){return b((t,e)=>{t.subscribe(I(e,He))})}function xa(t){return O(()=>t)}function sy(t,e=le){return t=t??ay,b((r,n)=>{let o,i=!0;r.subscribe(I(n,s=>{let a=e(s);(i||!t(o,a))&&(i=!1,o=a,n.next(s))}))})}function ay(t,e){return t===e}function si(t=uy){return b((e,r)=>{let n=!1;e.subscribe(I(r,o=>{n=!0,r.next(o)},()=>n?r.complete():r.error(t())))})}function uy(){return new Dt}function cy(t,e){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>{t.call(e,i,o++,r)||(n.next(!1),n.complete())},()=>{n.next(!0),n.complete()}))})}function $t(t){return b((e,r)=>{try{e.subscribe(r)}finally{r.add(t)}})}function rt(t,e){let r=arguments.length>=2;return n=>n.pipe(t?te((o,i)=>t(o,i,n)):le,Ct(1),r?Vt(e):si(()=>new Dt))}function Vn(t){return t<=0?()=>Ie:b((e,r)=>{let n=[];e.subscribe(I(r,o=>{n.push(o),t<n.length&&n.shift()},()=>{for(let o of n)r.next(o);r.complete()},void 0,()=>{n=null}))})}function _a(t,e){let r=arguments.length>=2;return n=>n.pipe(t?te((o,i)=>t(o,i,n)):le,Vn(1),r?Vt(e):si(()=>new Dt))}function ai(t,e){return b(Zd(t,e,arguments.length>=2,!0))}function ly(t){return te((e,r)=>t<=r)}function Aa(...t){let e=et(t);return b((r,n)=>{(e?jn(t,r,e):jn(t,r)).subscribe(n)})}function ue(t,e){return b((r,n)=>{let o=null,i=0,s=!1,a=()=>s&&!o&&n.complete();r.subscribe(I(n,u=>{o?.unsubscribe();let c=0,l=i++;P(t(u,l)).subscribe(o=I(n,d=>n.next(e?e(u,d,l,c++):d),()=>{o=null,a()}))},()=>{s=!0,a()}))})}function dy(t,e){return M(e)?ue(()=>t,e):ue(()=>t)}function ui(t){return b((e,r)=>{P(t).subscribe(I(r,()=>r.complete(),He)),!r.closed&&e.subscribe(r)})}function fy(t,e=!1){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>{let s=t(i,o++);(s||e)&&n.next(i),!s&&n.complete()}))})}function ne(t,e,r){let n=M(t)||e||r?{next:t,error:e,complete:r}:t;return n?b((o,i)=>{var s;(s=n.subscribe)===null||s===void 0||s.call(n);let a=!0;o.subscribe(I(i,u=>{var c;(c=n.next)===null||c===void 0||c.call(n,u),i.next(u)},()=>{var u;a=!1,(u=n.complete)===null||u===void 0||u.call(n),i.complete()},u=>{var c;a=!1,(c=n.error)===null||c===void 0||c.call(n,u),i.error(u)},()=>{var u,c;a&&((u=n.unsubscribe)===null||u===void 0||u.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):le}function hy(...t){let e=Fn(t);return b((r,n)=>{let o=t.length,i=new Array(o),s=t.map(()=>!1),a=!1;for(let u=0;u<o;u++)P(t[u]).subscribe(I(n,c=>{i[u]=c,!a&&!s[u]&&(s[u]=!0,(a=s.every(le))&&(s=null))},He));r.subscribe(I(n,u=>{if(a){let c=[u,...i];n.next(e?e(...c):c)}}))})}var Yd=null;var Na=1;function se(t){let e=Yd;return Yd=t,e}var Qd={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function py(t){if(!(Pa(t)&&!t.dirty)&&!(!t.dirty&&t.lastCleanEpoch===Na)){if(!t.producerMustRecompute(t)&&!Ra(t)){t.dirty=!1,t.lastCleanEpoch=Na;return}t.producerRecomputeValue(t),t.dirty=!1,t.lastCleanEpoch=Na}}function Kd(t){return t&&(t.nextProducerIndex=0),se(t)}function Jd(t,e){if(se(e),!(!t||t.producerNode===void 0||t.producerIndexOfThis===void 0||t.producerLastReadVersion===void 0)){if(Pa(t))for(let r=t.nextProducerIndex;r<t.producerNode.length;r++)Oa(t.producerNode[r],t.producerIndexOfThis[r]);for(;t.producerNode.length>t.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}function Ra(t){ci(t);for(let e=0;e<t.producerNode.length;e++){let r=t.producerNode[e],n=t.producerLastReadVersion[e];if(n!==r.version||(py(r),n!==r.version))return!0}return!1}function Xd(t){if(ci(t),Pa(t))for(let e=0;e<t.producerNode.length;e++)Oa(t.producerNode[e],t.producerIndexOfThis[e]);t.producerNode.length=t.producerLastReadVersion.length=t.producerIndexOfThis.length=0,t.liveConsumerNode&&(t.liveConsumerNode.length=t.liveConsumerIndexOfThis.length=0)}function Oa(t,e){if(gy(t),ci(t),t.liveConsumerNode.length===1)for(let n=0;n<t.producerNode.length;n++)Oa(t.producerNode[n],t.producerIndexOfThis[n]);let r=t.liveConsumerNode.length-1;if(t.liveConsumerNode[e]=t.liveConsumerNode[r],t.liveConsumerIndexOfThis[e]=t.liveConsumerIndexOfThis[r],t.liveConsumerNode.length--,t.liveConsumerIndexOfThis.length--,e<t.liveConsumerNode.length){let n=t.liveConsumerIndexOfThis[e],o=t.liveConsumerNode[e];ci(o),o.producerIndexOfThis[n]=e}}function Pa(t){return t.consumerIsAlwaysLive||(t?.liveConsumerNode?.length??0)>0}function ci(t){t.producerNode??=[],t.producerIndexOfThis??=[],t.producerLastReadVersion??=[]}function gy(t){t.liveConsumerNode??=[],t.liveConsumerIndexOfThis??=[]}function my(){throw new Error}var vy=my;function ef(t){vy=t}function z(t){for(let e in t)if(t[e]===z)return e;throw Error("Could not find renamed property on target object.")}function li(t,e){for(let r in e)e.hasOwnProperty(r)&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function ge(t){if(typeof t=="string")return t;if(Array.isArray(t))return"["+t.map(ge).join(", ")+"]";if(t==null)return""+t;if(t.overriddenName)return`${t.overriddenName}`;if(t.name)return`${t.name}`;let e=t.toString();if(e==null)return""+e;let r=e.indexOf(`
|
|
4
4
|
`);return r===-1?e:e.substring(0,r)}function Ka(t,e){return t==null||t===""?e===null?"":e:e==null||e===""?t:t+" "+e}var yy=z({__forward_ref__:z});function zf(t){return t.__forward_ref__=zf,t.toString=function(){return ge(this())},t}function we(t){return Wf(t)?t():t}function Wf(t){return typeof t=="function"&&t.hasOwnProperty(yy)&&t.__forward_ref__===zf}function Gf(t){return t&&!!t.\u0275providers}var qf="https://g.co/ng/security#xss",v=class extends Error{constructor(e,r){super(Wi(e,r)),this.code=e}};function Wi(t,e){return`${`NG0${Math.abs(t)}`}${e?": "+e:""}`}var Dy=z({\u0275cmp:z}),wy=z({\u0275dir:z}),Cy=z({\u0275pipe:z}),Ey=z({\u0275mod:z}),bi=z({\u0275fac:z}),Nr=z({__NG_ELEMENT_ID__:z}),tf=z({__NG_ENV_ID__:z});function an(t){return typeof t=="string"?t:t==null?"":String(t)}function Iy(t){return typeof t=="function"?t.name||t.toString():typeof t=="object"&&t!=null&&typeof t.type=="function"?t.type.name||t.type.toString():an(t)}function by(t,e){let r=e?`. Dependency path: ${e.join(" > ")} > ${t}`:"";throw new v(-200,`Circular dependency in DI detected for ${t}${r}`)}function cc(t,e){let r=e?` in ${e}`:"";throw new v(-201,!1)}function My(t,e){t==null&&Sy(e,t,null,"!=")}function Sy(t,e,r,n){throw new Error(`ASSERTION ERROR: ${t}`+(n==null?"":` [Expected=> ${r} ${n} ${e} <=Actual]`))}function w(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function St(t){return{providers:t.providers||[],imports:t.imports||[]}}function Gi(t){return nf(t,Yf)||nf(t,Qf)}function Zf(t){return Gi(t)!==null}function nf(t,e){return t.hasOwnProperty(e)?t[e]:null}function Ty(t){let e=t&&(t[Yf]||t[Qf]);return e||null}function rf(t){return t&&(t.hasOwnProperty(of)||t.hasOwnProperty(xy))?t[of]:null}var Yf=z({\u0275prov:z}),of=z({\u0275inj:z}),Qf=z({ngInjectableDef:z}),xy=z({ngInjectorDef:z}),F=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}(F||{}),Ja;function Kf(){return Ja}function be(t){let e=Ja;return Ja=t,e}function Jf(t,e,r){let n=Gi(t);if(n&&n.providedIn=="root")return n.value===void 0?n.value=n.factory():n.value;if(r&F.Optional)return null;if(e!==void 0)return e;cc(ge(t),"Injector")}var X=globalThis;var E=class{constructor(e,r){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,typeof r=="number"?this.__NG_ELEMENT_ID__=r:r!==void 0&&(this.\u0275prov=w({token:this,providedIn:r.providedIn||"root",factory:r.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};var _y={},Or=_y,Xa="__NG_DI_FLAG__",Mi="ngTempTokenPath",Ay="ngTokenPath",Ny=/\n/gm,Ry="\u0275",sf="__source",zn;function Oy(){return zn}function Ut(t){let e=zn;return zn=t,e}function Py(t,e=F.Default){if(zn===void 0)throw new v(-203,!1);return zn===null?Jf(t,void 0,e):zn.get(t,e&F.Optional?null:void 0,e)}function y(t,e=F.Default){return(Kf()||Py)(we(t),e)}function g(t,e=F.Default){return y(t,qi(e))}function qi(t){return typeof t>"u"||typeof t=="number"?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function eu(t){let e=[];for(let r=0;r<t.length;r++){let n=we(t[r]);if(Array.isArray(n)){if(n.length===0)throw new v(900,!1);let o,i=F.Default;for(let s=0;s<n.length;s++){let a=n[s],u=Fy(a);typeof u=="number"?u===-1?o=a.token:i|=u:o=a}e.push(y(o,i))}else e.push(y(n))}return e}function Xf(t,e){return t[Xa]=e,t.prototype[Xa]=e,t}function Fy(t){return t[Xa]}function ky(t,e,r,n){let o=t[Mi];throw e[sf]&&o.unshift(e[sf]),t.message=Ly(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ge,d as ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-C7TRF3SY.js";import{a as he}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-V3UGRPNZ.js";import{$ as le,ca as U,d as ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-P24WVMWI.js";import{a as d,b as R,c as H,h as u}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-PUBPICPK.js";var y=class extends Error{constructor(e,t){let o=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=o}},T=class extends Error{constructor(e="A timeout occurred."){let t=new.target.prototype;super(e),this.__proto__=t}},b=class extends Error{constructor(e="An abort occurred."){let t=new.target.prototype;super(e),this.__proto__=t}},j=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=o}},O=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=o}},B=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=o}},F=class extends Error{constructor(e){let t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}},z=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=o}};var A=class{constructor(e,t,o){this.statusCode=e,this.statusText=t,this.content=o}},v=class{get(e,t){return this.send(R(d({},t),{method:"GET",url:e}))}post(e,t){return this.send(R(d({},t),{method:"POST",url:e}))}delete(e,t){return this.send(R(d({},t),{method:"DELETE",url:e}))}getCookieString(e){return""}};var i=function(r){return r[r.Trace=0]="Trace",r[r.Debug=1]="Debug",r[r.Information=2]="Information",r[r.Warning=3]="Warning",r[r.Error=4]="Error",r[r.Critical=5]="Critical",r[r.None=6]="None",r}(i||{});var k=class{constructor(){}log(e,t){}};k.instance=new k;var me="7.0.11",f=class{static isRequired(e,t){if(e==null)throw new Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw new Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,o){if(!(e in t))throw new Error(`Unknown ${o} value: ${e}.`)}},_=class{static get isBrowser(){return typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return typeof self=="object"&&"importScripts"in self}static get isReactNative(){return typeof window=="object"&&typeof window.document>"u"}static get isNode(){return!this.isBrowser&&!this.isWebWorker&&!this.isReactNative}};function x(r,e){let t="";return P(r)?(t=`Binary data of length ${r.byteLength}`,e&&(t+=`. Content: '${we(r)}'`)):typeof r=="string"&&(t=`String data of length ${r.length}`,e&&(t+=`. Content: '${r}'`)),t}function we(r){let e=new Uint8Array(r),t="";return e.forEach(o=>{let n=o<16?"0":"";t+=`0x${n}${o.toString(16)} `}),t.substr(0,t.length-1)}function P(r){return r&&typeof ArrayBuffer<"u"&&(r instanceof ArrayBuffer||r.constructor&&r.constructor.name==="ArrayBuffer")}function V(r,e,t,o,n,s){return u(this,null,function*(){let c={},[l,a]=E();c[l]=a,r.log(i.Trace,`(${e} transport) sending data. ${x(n,s.logMessageContent)}.`);let h=P(n)?"arraybuffer":"text",g=yield t.post(o,{content:n,headers:d(d({},c),s.headers),responseType:h,timeout:s.timeout,withCredentials:s.withCredentials});r.log(i.Trace,`(${e} transport) request complete. Response status: ${g.statusCode}.`)})}function pe(r){return r===void 0?new D(i.Information):r===null?k.instance:r.log!==void 0?r:new D(r)}var J=class{constructor(e,t){this._subject=e,this._observer=t}dispose(){let e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(t=>{})}},D=class{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){let o=`[${new Date().toISOString()}] ${i[e]}: ${t}`;switch(e){case i.Critical:case i.Error:this.out.error(o);break;case i.Warning:this.out.warn(o);break;case i.Information:this.out.info(o);break;default:this.out.log(o);break}}}};function E(){let r="X-SignalR-User-Agent";return _.isNode&&(r="User-Agent"),[r,be(me,Ce(),ye(),Se())]}function be(r,e,t,o){let n="Microsoft SignalR/",s=r.split(".");return n+=`${s[0]}.${s[1]}`,n+=` (${r}; `,e&&e!==""?n+=`${e}; `:n+="Unknown OS; ",n+=`${t}`,o?n+=`; ${o}`:n+="; Unknown Runtime Version",n+=")",n}function Ce(){if(_.isNode)switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}else return""}function Se(){if(_.isNode)return process.versions.node}function ye(){return _.isNode?"NodeJS":"Browser"}function ie(r){return r.stack?r.stack:r.message?r.message:`${r}`}function de(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("could not find global")}var X=class extends v{constructor(e){if(super(),this._logger=e,typeof fetch>"u"){let t=typeof __webpack_require__=="function"?__non_webpack_require__:H;this._jar=new(t("tough-cookie")).CookieJar,this._fetchType=t("node-fetch"),this._fetchType=t("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(de());if(typeof AbortController>"u"){let t=typeof __webpack_require__=="function"?__non_webpack_require__:H;this._abortControllerType=t("abort-controller")}else this._abortControllerType=AbortController}send(e){return u(this,null,function*(){if(e.abortSignal&&e.abortSignal.aborted)throw new b;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");let t=new this._abortControllerType,o;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),o=new b});let n=null;if(e.timeout){let a=e.timeout;n=setTimeout(()=>{t.abort(),this._logger.log(i.Warning,"Timeout from HTTP request."),o=new T},a)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},P(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");let s;try{s=yield this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:d({"X-Requested-With":"XMLHttpRequest"},e.headers),method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(a){throw o||(this._logger.log(i.Warning,`Error from HTTP request. ${a}.`),a)}finally{n&&clearTimeout(n),e.abortSignal&&(e.abortSignal.onabort=null)}if(!s.ok){let a=yield fe(s,"text");throw new y(a||s.statusText,s.status)}let l=yield fe(s,e.responseType);return new A(s.status,s.statusText,l)})}getCookieString(e){let t="";return _.isNode&&this._jar&&this._jar.getCookies(e,(o,n)=>t=n.join("; ")),t}};function fe(r,e){let t;switch(e){case"arraybuffer":t=r.arrayBuffer();break;case"text":t=r.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`);default:t=r.text();break}return t}var K=class extends v{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new b):e.method?e.url?new Promise((t,o)=>{let n=new XMLHttpRequest;n.open(e.method,e.url,!0),n.withCredentials=e.withCredentials===void 0?!0:e.withCredentials,n.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(P(e.content)?n.setRequestHeader("Content-Type","application/octet-stream"):n.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));let s=e.headers;s&&Object.keys(s).forEach(c=>{n.setRequestHeader(c,s[c])}),e.responseType&&(n.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),o(new b)}),e.timeout&&(n.timeout=e.timeout),n.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),n.status>=200&&n.status<300?t(new A(n.status,n.statusText,n.response||n.responseText)):o(new y(n.response||n.responseText||n.statusText,n.status))},n.onerror=()=>{this._logger.log(i.Warning,`Error from HTTP request. ${n.status}: ${n.statusText}.`),o(new y(n.statusText,n.status))},n.ontimeout=()=>{this._logger.log(i.Warning,"Timeout from HTTP request."),o(new T)},n.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}};var G=class extends v{constructor(e){if(super(),typeof fetch<"u"||_.isNode)this._httpClient=new X(e);else if(typeof XMLHttpRequest<"u")this._httpClient=new K(e);else throw new Error("No usable HttpClient found.")}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new b):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}};var S=class r{static write(e){return`${e}${r.RecordSeparator}`}static parse(e){if(e[e.length-1]!==r.RecordSeparator)throw new Error("Message is incomplete.");let t=e.split(r.RecordSeparator);return t.pop(),t}};S.RecordSeparatorCode=30;S.RecordSeparator=String.fromCharCode(S.RecordSeparatorCode);var Y=class{writeHandshakeRequest(e){return S.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,o;if(P(e)){let l=new Uint8Array(e),a=l.indexOf(S.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");let h=a+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(l.slice(0,h))),o=l.byteLength>h?l.slice(h).buffer:null}else{let l=e,a=l.indexOf(S.RecordSeparator);if(a===-1)throw new Error("Message is incomplete.");let h=a+1;t=l.substring(0,h),o=l.length>h?l.substring(h):null}let n=S.parse(t),s=JSON.parse(n[0]);if(s.type)throw new Error("Expected a handshake response from the server.");return[o,s]}};var p=function(r){return r[r.Invocation=1]="Invocation",r[r.StreamItem=2]="StreamItem",r[r.Completion=3]="Completion",r[r.StreamInvocation=4]="StreamInvocation",r[r.CancelInvocation=5]="CancelInvocation",r[r.Ping=6]="Ping",r[r.Close=7]="Close",r}(p||{});var Q=class{constructor(){this.observers=[]}next(e){for(let t of this.observers)t.next(e)}error(e){for(let t of this.observers)t.error&&t.error(e)}complete(){for(let e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new J(this,e)}};var ve=30*1e3,ke=15*1e3,m=function(r){return r.Disconnected="Disconnected",r.Connecting="Connecting",r.Connected="Connected",r.Disconnecting="Disconnecting",r.Reconnecting="Reconnecting",r}(m||{}),Z=class r{constructor(e,t,o,n){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(i.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},f.isRequired(e,"connection"),f.isRequired(t,"logger"),f.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=ve,this.keepAliveIntervalInMilliseconds=ke,this._logger=t,this._protocol=o,this.connection=e,this._reconnectPolicy=n,this._handshakeProtocol=new Y,this.connection.onreceive=s=>this._processIncomingData(s),this.connection.onclose=s=>this._connectionClosed(s),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=m.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:p.Ping})}static create(e,t,o,n){return new r(e,t,o,n)}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==m.Disconnected&&this._connectionState!==m.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}_startWithStateTransitions(){return u(this,null,function*(){if(this._connectionState!==m.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=m.Connecting,this._logger.log(i.Debug,"Starting HubConnection.");try{yield this._startInternal(),_.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=m.Connected,this._connectionStarted=!0,this._logger.log(i.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=m.Disconnected,this._logger.log(i.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}})}_startInternal(){return u(this,null,function*(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;let e=new Promise((t,o)=>{this._handshakeResolver=t,this._handshakeRejecter=o});yield this.connection.start(this._protocol.transferFormat);try{let t={protocol:this._protocol.name,version:this._protocol.version};if(this._logger.log(i.Debug,"Sending handshake request."),yield this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(t)),this._logger.log(i.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),yield e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.inherentKeepAlive||(yield this._sendMessage(this._cachedPingMessage))}catch(t){throw this._logger.log(i.Debug,`Hub handshake failed with error '${t}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),yield this.connection.stop(t),t}})}stop(){return u(this,null,function*(){let e=this._startPromise;this._stopPromise=this._stopInternal(),yield this._stopPromise;try{yield e}catch{}})}_stopInternal(e){return this._connectionState===m.Disconnected?(this._logger.log(i.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve()):this._connectionState===m.Disconnecting?(this._logger.log(i.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState=m.Disconnecting,this._logger.log(i.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(i.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new b("The connection was stopped before the hub handshake could complete."),this.connection.stop(e)))}stream(e,...t){let[o,n]=this._replaceStreamingParams(t),s=this._createStreamInvocation(e,t,n),c,l=new Q;return l.cancelCallback=()=>{let a=this._createCancelInvocation(s.invocationId);return delete this._callbacks[s.invocationId],c.then(()=>this._sendWithProtocol(a))},this._callbacks[s.invocationId]=(a,h)=>{if(h){l.error(h);return}else a&&(a.type===p.Completion?a.error?l.error(new Error(a.error)):l.complete():l.next(a.item))},c=this._sendWithProtocol(s).catch(a=>{l.error(a),delete this._callbacks[s.invocationId]}),this._launchStreams(o,c),l}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){let[o,n]=this._replaceStreamingParams(t),s=this._sendWithProtocol(this._createInvocation(e,t,!0,n));return this._launchStreams(o,s),s}invoke(e,...t){let[o,n]=this._replaceStreamingParams(t),s=this._createInvocation(e,t,!1,n);return new Promise((l,a)=>{this._callbacks[s.invocationId]=(g,I)=>{if(I){a(I);return}else g&&(g.type===p.Completion?g.error?a(new Error(g.error)):l(g.result):a(new Error(`Unexpected message type: ${g.type}`)))};let h=this._sendWithProtocol(s).catch(g=>{a(g),delete this._callbacks[s.invocationId]});this._launchStreams(o,h)})}on(e,t){!e||!t||(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(t)===-1&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();let o=this._methods[e];if(o)if(t){let n=o.indexOf(t);n!==-1&&(o.splice(n,1),o.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){let t=this._protocol.parseMessages(e,this._logger);for(let o of t)switch(o.type){case p.Invocation:this._invokeClientMethod(o);break;case p.StreamItem:case p.Completion:{let n=this._callbacks[o.invocationId];if(n){o.type===p.Completion&&delete this._callbacks[o.invocationId];try{n(o)}catch(s){this._logger.log(i.Error,`Stream callback threw error: ${ie(s)}`)}}break}case p.Ping:break;case p.Close:{this._logger.log(i.Information,"Close message received from server.");let n=o.error?new Error("Server returned an error on close: "+o.error):void 0;o.allowReconnect===!0?this.connection.stop(n):this._stopPromise=this._stopInternal(n);break}default:this._logger.log(i.Warning,`Invalid message type: ${o.type}.`);break}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,o;try{[o,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(n){let s="Error parsing handshake response: "+n;this._logger.log(i.Error,s);let c=new Error(s);throw this._handshakeRejecter(c),c}if(t.error){let n="Server returned handshake error: "+t.error;this._logger.log(i.Error,n);let s=new Error(n);throw this._handshakeRejecter(s),s}else this._logger.log(i.Debug,"Server handshake complete.");return this._handshakeResolver(),o}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if((!this.connection.features||!this.connection.features.inherentKeepAlive)&&(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle===void 0)){let e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(()=>u(this,null,function*(){if(this._connectionState===m.Connected)try{yield this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(e){return u(this,null,function*(){let t=e.target.toLowerCase(),o=this._methods[t];if(!o){this._logger.log(i.Warning,`No client method with the name '${t}' found.`),e.invocationId&&(this._logger.log(i.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),yield this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)));return}let n=o.slice(),s=!!e.invocationId,c,l,a;for(let h of n)try{let g=c;c=yield h.apply(this,e.arguments),s&&c&&g&&(this._logger.log(i.Error,`Multiple results provided for '${t}'. Sending error to server.`),a=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),l=void 0}catch(g){l=g,this._logger.log(i.Error,`A callback for the method '${t}' threw error '${g}'.`)}a?yield this._sendWithProtocol(a):s?(l?a=this._createCompletionMessage(e.invocationId,`${l}`,null):c!==void 0?a=this._createCompletionMessage(e.invocationId,null,c):(this._logger.log(i.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),a=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),yield this._sendWithProtocol(a)):c&&this._logger.log(i.Error,`Result given for '${t}' method but server is not expecting a result.`)})}_connectionClosed(e){this._logger.log(i.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new b("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===m.Disconnecting?this._completeClose(e):this._connectionState===m.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===m.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=m.Disconnected,this._connectionStarted=!1,_.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(t=>t.apply(this,[e]))}catch(t){this._logger.log(i.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}_reconnect(e){return u(this,null,function*(){let t=Date.now(),o=0,n=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),s=this._getNextRetryDelay(o++,0,n);if(s===null){this._logger.log(i.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),this._completeClose(e);return}if(this._connectionState=m.Reconnecting,e?this._logger.log(i.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(i.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(c=>c.apply(this,[e]))}catch(c){this._logger.log(i.Error,`An onreconnecting callback called with error '${e}' threw error '${c}'.`)}if(this._connectionState!==m.Reconnecting){this._logger.log(i.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.");return}}for(;s!==null;){if(this._logger.log(i.Information,`Reconnect attempt number ${o} will start in ${s} ms.`),yield new Promise(c=>{this._reconnectDelayHandle=setTimeout(c,s)}),this._reconnectDelayHandle=void 0,this._connectionState!==m.Reconnecting){this._logger.log(i.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");return}try{if(yield this._startInternal(),this._connectionState=m.Connected,this._logger.log(i.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(c=>c.apply(this,[this.connection.connectionId]))}catch(c){this._logger.log(i.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${c}'.`)}return}catch(c){if(this._logger.log(i.Information,`Reconnect attempt failed because of error '${c}'.`),this._connectionState!==m.Reconnecting){this._logger.log(i.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),this._connectionState===m.Disconnecting&&this._completeClose();return}n=c instanceof Error?c:new Error(c.toString()),s=this._getNextRetryDelay(o++,Date.now()-t,n)}}this._logger.log(i.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${o} failed attempts. Connection disconnecting.`),this._completeClose()})}_getNextRetryDelay(e,t,o){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:o})}catch(n){return this._logger.log(i.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${n}'.`),null}}_cancelCallbacksWithError(e){let t=this._callbacks;this._callbacks={},Object.keys(t).forEach(o=>{let n=t[o];try{n(null,e)}catch(s){this._logger.log(i.Error,`Stream 'error' callback called with '${e}' threw error: ${ie(s)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,o,n){if(o)return n.length!==0?{arguments:t,streamIds:n,target:e,type:p.Invocation}:{arguments:t,target:e,type:p.Invocation};{let s=this._invocationId;return this._invocationId++,n.length!==0?{arguments:t,invocationId:s.toString(),streamIds:n,target:e,type:p.Invocation}:{arguments:t,invocationId:s.toString(),target:e,type:p.Invocation}}}_launchStreams(e,t){if(e.length!==0){t||(t=Promise.resolve());for(let o in e)e[o].subscribe({complete:()=>{t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(o)))},error:n=>{let s;n instanceof Error?s=n.message:n&&n.toString?s=n.toString():s="Unknown error",t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(o,s)))},next:n=>{t=t.then(()=>this._sendWithProtocol(this._createStreamItemMessage(o,n)))}})}}_replaceStreamingParams(e){let t=[],o=[];for(let n=0;n<e.length;n++){let s=e[n];if(this._isObservable(s)){let c=this._invocationId;this._invocationId++,t[c]=s,o.push(c.toString()),e.splice(n,1)}}return[t,o]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,t,o){let n=this._invocationId;return this._invocationId++,o.length!==0?{arguments:t,invocationId:n.toString(),streamIds:o,target:e,type:p.StreamInvocation}:{arguments:t,invocationId:n.toString(),target:e,type:p.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:p.CancelInvocation}}_createStreamItemMessage(e,t){return{invocationId:e,item:t,type:p.StreamItem}}_createCompletionMessage(e,t,o){return t?{error:t,invocationId:e,type:p.Completion}:{invocationId:e,result:o,type:p.Completion}}};var Ee=[0,2e3,1e4,3e4,null],L=class{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Ee}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}};var $=(()=>{class r{}return r.Authorization="Authorization",r.Cookie="Cookie",r})();var q=class extends v{constructor(e,t){super(),this._innerClient=e,this._accessTokenFactory=t}send(e){return u(this,null,function*(){let t=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(t=!1,this._accessToken=yield this._accessTokenFactory()),this._setAuthorizationHeader(e);let o=yield this._innerClient.send(e);return t&&o.statusCode===401&&this._accessTokenFactory?(this._accessToken=yield this._accessTokenFactory(),this._setAuthorizationHeader(e),yield this._innerClient.send(e)):o})}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[$.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[$.Authorization]&&delete e.headers[$.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}};var C=function(r){return r[r.None=0]="None",r[r.WebSockets=1]="WebSockets",r[r.ServerSentEvents=2]="ServerSentEvents",r[r.LongPolling=4]="LongPolling",r}(C||{}),w=function(r){return r[r.Text=1]="Text",r[r.Binary=2]="Binary",r}(w||{});var ee=class{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}};var W=class{constructor(e,t,o){this._httpClient=e,this._logger=t,this._pollAbort=new ee,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}get pollAborted(){return this._pollAbort.aborted}connect(e,t){return u(this,null,function*(){if(f.isRequired(e,"url"),f.isRequired(t,"transferFormat"),f.isIn(t,w,"transferFormat"),this._url=e,this._logger.log(i.Trace,"(LongPolling transport) Connecting."),t===w.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");let[o,n]=E(),s=d({[o]:n},this._options.headers),c={abortSignal:this._pollAbort.signal,headers:s,timeout:1e5,withCredentials:this._options.withCredentials};t===w.Binary&&(c.responseType="arraybuffer");let l=`${e}&_=${Date.now()}`;this._logger.log(i.Trace,`(LongPolling transport) polling: ${l}.`);let a=yield this._httpClient.get(l,c);a.statusCode!==200?(this._logger.log(i.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new y(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,c)})}_poll(e,t){return u(this,null,function*(){try{for(;this._running;)try{let o=`${e}&_=${Date.now()}`;this._logger.log(i.Trace,`(LongPolling transport) polling: ${o}.`);let n=yield this._httpClient.get(o,t);n.statusCode===204?(this._logger.log(i.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):n.statusCode!==200?(this._logger.log(i.Error,`(LongPolling transport) Unexpected response code: ${n.statusCode}.`),this._closeError=new y(n.statusText||"",n.statusCode),this._running=!1):n.content?(this._logger.log(i.Trace,`(LongPolling transport) data received. ${x(n.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(n.content)):this._logger.log(i.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(o){this._running?o instanceof T?this._logger.log(i.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=o,this._running=!1):this._logger.log(i.Trace,`(LongPolling transport) Poll errored after shutdown: ${o.message}`)}}finally{this._logger.log(i.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}})}send(e){return u(this,null,function*(){return this._running?V(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return u(this,null,function*(){this._logger.log(i.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{yield this._receiving,this._logger.log(i.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);let e={},[t,o]=E();e[t]=o;let n={headers:d(d({},e),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials};yield this._httpClient.delete(this._url,n),this._logger.log(i.Trace,"(LongPolling transport) DELETE request sent.")}finally{this._logger.log(i.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}})}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(i.Trace,e),this.onclose(this._closeError)}}};var te=class{constructor(e,t,o,n){this._httpClient=e,this._accessToken=t,this._logger=o,this._options=n,this.onreceive=null,this.onclose=null}connect(e,t){return u(this,null,function*(){return f.isRequired(e,"url"),f.isRequired(t,"transferFormat"),f.isIn(t,w,"transferFormat"),this._logger.log(i.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((o,n)=>{let s=!1;if(t!==w.Text){n(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));return}let c;if(_.isBrowser||_.isWebWorker)c=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{let l=this._httpClient.getCookieString(e),a={};a.Cookie=l;let[h,g]=E();a[h]=g,c=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:d(d({},a),this._options.headers)})}try{c.onmessage=l=>{if(this.onreceive)try{this._logger.log(i.Trace,`(SSE transport) data received. ${x(l.data,this._options.logMessageContent)}.`),this.onreceive(l.data)}catch(a){this._close(a);return}},c.onerror=l=>{s?this._close():n(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},c.onopen=()=>{this._logger.log(i.Information,`SSE connected to ${this._url}`),this._eventSource=c,s=!0,o()}}catch(l){n(l);return}})})}send(e){return u(this,null,function*(){return this._eventSource?V(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}};var oe=class{constructor(e,t,o,n,s,c){this._logger=o,this._accessTokenFactory=t,this._logMessageContent=n,this._webSocketConstructor=s,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=c}connect(e,t){return u(this,null,function*(){f.isRequired(e,"url"),f.isRequired(t,"transferFormat"),f.isIn(t,w,"transferFormat"),this._logger.log(i.Trace,"(WebSockets transport) Connecting.");let o;return this._accessTokenFactory&&(o=yield this._accessTokenFactory()),new Promise((n,s)=>{e=e.replace(/^http/,"ws");let c,l=this._httpClient.getCookieString(e),a=!1;if(_.isNode||_.isReactNative){let h={},[g,I]=E();h[g]=I,o&&(h[$.Authorization]=`Bearer ${o}`),l&&(h[$.Cookie]=l),c=new this._webSocketConstructor(e,void 0,{headers:d(d({},h),this._headers)})}else o&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);c||(c=new this._webSocketConstructor(e)),t===w.Binary&&(c.binaryType="arraybuffer"),c.onopen=h=>{this._logger.log(i.Information,`WebSocket connected to ${e}.`),this._webSocket=c,a=!0,n()},c.onerror=h=>{let g=null;typeof ErrorEvent<"u"&&h instanceof ErrorEvent?g=h.error:g="There was an error with the transport",this._logger.log(i.Information,`(WebSockets transport) ${g}.`)},c.onmessage=h=>{if(this._logger.log(i.Trace,`(WebSockets transport) data received. ${x(h.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(h.data)}catch(g){this._close(g);return}},c.onclose=h=>{if(a)this._close(h);else{let g=null;typeof ErrorEvent<"u"&&h instanceof ErrorEvent?g=h.error:g="WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",s(new Error(g))}}})})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(i.Trace,`(WebSockets transport) sending data. ${x(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(i.Trace,"(WebSockets transport) socket closed."),this.onclose&&(this._isCloseEvent(e)&&(e.wasClean===!1||e.code!==1e3)?this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)):e instanceof Error?this.onclose(e):this.onclose())}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}};var _e=100,ne=class{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,f.isRequired(e,"url"),this._logger=pe(t.logger),this.baseUrl=this._resolveUrl(e),t=t||{},t.logMessageContent=t.logMessageContent===void 0?!1:t.logMessageContent,typeof t.withCredentials=="boolean"||t.withCredentials===void 0)t.withCredentials=t.withCredentials===void 0?!0:t.withCredentials;else throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.timeout=t.timeout===void 0?100*1e3:t.timeout;let o=null,n=null;if(_.isNode&&typeof H<"u"){let s=typeof __webpack_require__=="function"?__non_webpack_require__:H;o=s("ws"),n=s("eventsource")}!_.isNode&&typeof WebSocket<"u"&&!t.WebSocket?t.WebSocket=WebSocket:_.isNode&&!t.WebSocket&&o&&(t.WebSocket=o),!_.isNode&&typeof EventSource<"u"&&!t.EventSource?t.EventSource=EventSource:_.isNode&&!t.EventSource&&typeof n<"u"&&(t.EventSource=n),this._httpClient=new q(t.httpClient||new G(this._logger),t.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}start(e){return u(this,null,function*(){if(e=e||w.Binary,f.isIn(e,w,"transferFormat"),this._logger.log(i.Debug,`Starting connection with transfer format '${w[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),yield this._startInternalPromise,this._connectionState==="Disconnecting"){let t="Failed to start the HttpConnection before stop() was called.";return this._logger.log(i.Error,t),yield this._stopPromise,Promise.reject(new b(t))}else if(this._connectionState!=="Connected"){let t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(i.Error,t),Promise.reject(new b(t))}this._connectionStarted=!0})}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new se(this.transport)),this._sendQueue.send(e))}stop(e){return u(this,null,function*(){if(this._connectionState==="Disconnected")return this._logger.log(i.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve();if(this._connectionState==="Disconnecting")return this._logger.log(i.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;this._connectionState="Disconnecting",this._stopPromise=new Promise(t=>{this._stopPromiseResolver=t}),yield this._stopInternal(e),yield this._stopPromise})}_stopInternal(e){return u(this,null,function*(){this._stopError=e;try{yield this._startInternalPromise}catch{}if(this.transport){try{yield this.transport.stop()}catch(t){this._logger.log(i.Error,`HttpConnection.transport.stop() threw error '${t}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(i.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")})}_startInternal(e){return u(this,null,function*(){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation)if(this._options.transport===C.WebSockets)this.transport=this._constructTransport(C.WebSockets),yield this._startTransport(t,e);else throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");else{let o=null,n=0;do{if(o=yield this._getNegotiationResponse(t),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new b("The connection was stopped during negotiation.");if(o.error)throw new Error(o.error);if(o.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(o.url&&(t=o.url),o.accessToken){let s=o.accessToken;this._accessTokenFactory=()=>s,this._httpClient._accessToken=s,this._httpClient._accessTokenFactory=void 0}n++}while(o.url&&n<_e);if(n===_e&&o.url)throw new Error("Negotiate redirection limit exceeded.");yield this._createTransport(t,this._options.transport,o,e)}this.transport instanceof W&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(i.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(o){return this._logger.log(i.Error,"Failed to start the connection: "+o),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(o)}})}_getNegotiationResponse(e){return u(this,null,function*(){let t={},[o,n]=E();t[o]=n;let s=this._resolveNegotiateUrl(e);this._logger.log(i.Debug,`Sending negotiation request: ${s}.`);try{let c=yield this._httpClient.post(s,{content:"",headers:d(d({},t),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(c.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${c.statusCode}'`));let l=JSON.parse(c.content);return(!l.negotiateVersion||l.negotiateVersion<1)&&(l.connectionToken=l.connectionId),l}catch(c){let l="Failed to complete negotiation with the server: "+c;return c instanceof y&&c.statusCode===404&&(l=l+" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(i.Error,l),Promise.reject(new F(l))}})}_createConnectUrl(e,t){return t?e+(e.indexOf("?")===-1?"?":"&")+`id=${t}`:e}_createTransport(e,t,o,n){return u(this,null,function*(){let s=this._createConnectUrl(e,o.connectionToken);if(this._isITransport(t)){this._logger.log(i.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,yield this._startTransport(s,n),this.connectionId=o.connectionId;return}let c=[],l=o.availableTransports||[],a=o;for(let h of l){let g=this._resolveTransportOrError(h,t,n);if(g instanceof Error)c.push(`${h.transport} failed:`),c.push(g);else if(this._isITransport(g)){if(this.transport=g,!a){try{a=yield this._getNegotiationResponse(e)}catch(I){return Promise.reject(I)}s=this._createConnectUrl(e,a.connectionToken)}try{yield this._startTransport(s,n),this.connectionId=a.connectionId;return}catch(I){if(this._logger.log(i.Error,`Failed to start the transport '${h.transport}': ${I}`),a=void 0,c.push(new B(`${h.transport} failed: ${I}`,C[h.transport])),this._connectionState!=="Connecting"){let ce="Failed to select transport before stop() was called.";return this._logger.log(i.Debug,ce),Promise.reject(new b(ce))}}}}return c.length>0?Promise.reject(new z(`Unable to connect to the server with any of the available transports. ${c.join(" ")}`,c)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))})}_constructTransport(e){switch(e){case C.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new oe(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case C.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new te(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case C.LongPolling:return new W(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.transport.onclose=o=>this._stopConnection(o),this.transport.connect(e,t)}_resolveTransportOrError(e,t,o){let n=C[e.transport];if(n==null)return this._logger.log(i.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(Ie(t,n))if(e.transferFormats.map(c=>w[c]).indexOf(o)>=0){if(n===C.WebSockets&&!this._options.WebSocket||n===C.ServerSentEvents&&!this._options.EventSource)return this._logger.log(i.Debug,`Skipping transport '${C[n]}' because it is not supported in your environment.'`),new j(`'${C[n]}' is not supported in your environment.`,n);this._logger.log(i.Debug,`Selecting transport '${C[n]}'.`);try{return this._constructTransport(n)}catch(c){return c}}else return this._logger.log(i.Debug,`Skipping transport '${C[n]}' because it does not support the requested transfer format '${w[o]}'.`),new Error(`'${C[n]}' does not support ${w[o]}.`);else return this._logger.log(i.Debug,`Skipping transport '${C[n]}' because it was disabled by the client.`),new O(`'${C[n]}' is disabled by the client.`,n)}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(i.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState==="Disconnected"){this._logger.log(i.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`);return}if(this._connectionState==="Connecting")throw this._logger.log(i.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(i.Error,`Connection disconnected with error '${e}'.`):this._logger.log(i.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(t=>{this._logger.log(i.Error,`TransportSendQueue.stop() threw error '${t}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(i.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!_.isBrowser)throw new Error(`Cannot resolve '${e}'.`);let t=window.document.createElement("a");return t.href=e,this._logger.log(i.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){let t=e.indexOf("?"),o=e.substring(0,t===-1?e.length:t);return o[o.length-1]!=="/"&&(o+="/"),o+="negotiate",o+=t===-1?"":e.substring(t),o.indexOf("negotiateVersion")===-1&&(o+=t===-1?"?":"&",o+="negotiateVersion="+this._negotiateVersion),o}};function Ie(r,e){return!r||(e&r)!==0}var se=class r{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new N,this._transportResult=new N,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new N),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}_sendLoop(){return u(this,null,function*(){for(;;){if(yield this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new N;let e=this._transportResult;this._transportResult=void 0;let t=typeof this._buffer[0]=="string"?this._buffer.join(""):r._concatBuffers(this._buffer);this._buffer.length=0;try{yield this._transport.send(t),e.resolve()}catch(o){e.reject(o)}}})}static _concatBuffers(e){let t=e.map(s=>s.byteLength).reduce((s,c)=>s+c),o=new Uint8Array(t),n=0;for(let s of e)o.set(new Uint8Array(s),n),n+=s.byteLength;return o.buffer}},N=class{constructor(){this.promise=new Promise((e,t)=>[this._resolver,this._rejecter]=[e,t])}resolve(){this._resolver()}reject(e){this._rejecter(e)}};var Te="json",re=class{constructor(){this.name=Te,this.version=1,this.transferFormat=w.Text}parseMessages(e,t){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];t===null&&(t=k.instance);let o=S.parse(e),n=[];for(let s of o){let c=JSON.parse(s);if(typeof c.type!="number")throw new Error("Invalid payload.");switch(c.type){case p.Invocation:this._isInvocationMessage(c);break;case p.StreamItem:this._isStreamItemMessage(c);break;case p.Completion:this._isCompletionMessage(c);break;case p.Ping:break;case p.Close:break;default:t.log(i.Information,"Unknown message type '"+c.type+"' ignored.");continue}n.push(c)}return n}writeMessage(e){return S.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_assertNotEmptyString(e,t){if(typeof e!="string"||e==="")throw new Error(t)}};var xe={trace:i.Trace,debug:i.Debug,info:i.Information,information:i.Information,warn:i.Warning,warning:i.Warning,error:i.Error,critical:i.Critical,none:i.None};function Pe(r){let e=xe[r.toLowerCase()];if(typeof e<"u")return e;throw new Error(`Unknown log level: ${r}`)}var M=class{configureLogging(e){if(f.isRequired(e,"logging"),De(e))this.logger=e;else if(typeof e=="string"){let t=Pe(e);this.logger=new D(t)}else this.logger=new D(e);return this}withUrl(e,t){return f.isRequired(e,"url"),f.isNotEmpty(e,"url"),this.url=e,typeof t=="object"?this.httpConnectionOptions=d(d({},this.httpConnectionOptions),t):this.httpConnectionOptions=R(d({},this.httpConnectionOptions),{transport:t}),this}withHubProtocol(e){return f.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new L(e):this.reconnectPolicy=e:this.reconnectPolicy=new L,this}build(){let e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");let t=new ne(this.url,e);return Z.create(t,this.logger||k.instance,this.protocol||new re,this.reconnectPolicy)}};function De(r){return r.log!==void 0}var Eo=(()=>{let e=class e{constructor(o,n,s){this.decodeTokenService=o,this.toastr=n,this.httpService=s,this.initNotifications(),this.parseToken=this.decodeTokenService.getParseToken(),this.buildConnection()}initNotifications(){let o=JSON.parse(localStorage.getItem("Notifications"));this._notifications=new ae(o||[])}setNotification(o){let s=[...this._notifications.value,o];this.saveNotificationTotal(s),this._notifications.next(s)}saveNotificationTotal(o=[]){localStorage.setItem("Notifications",JSON.stringify(o))}getNotification(){return this._notifications.asObservable()}getNotificationDetail(o){return this.httpService.post("/api/notification/GetByID",{ID:o})}buildConnection(){this.hubConnection=new M().withUrl("/MarketplaceHub").withAutomaticReconnect().configureLogging(i.Information).build(),this.startConnection(),this.onConnectionClose(),this.subscribeNotification()}connectToRegister(){this.hubConnection.invoke("SubscribeGroup",this.parseToken.PID)}startConnection(){this.hubConnection.start().then(()=>{this.connectToRegister()}).catch(o=>console.log("Error while starting connection: "+o))}onConnectionClose(){this.hubConnection.onclose(()=>{this.buildConnection()})}subscribeNotification(){this.hubConnection.on("Notification",o=>{let n=JSON.parse(o);this.setNotification(n),n.ID==this.parseToken.PID&&(n.StatusCode!=200?this.toastr.error(n.Message,n.Title,{enableHtml:!0}):this.toastr.success(n.Message,n.Title,{enableHtml:!0}))})}clearNotification(){localStorage.removeItem("Notifications"),this._notifications.next([])}};e.\u0275fac=function(n){return new(n||e)(U(ge),U(ue),U(he))},e.\u0275prov=le({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();export{Eo as a};
|
|
1
|
+
import{a as ge,d as ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-EJMJP3AQ.js";import{a as he}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-2OVWEFCG.js";import{$ as le,ca as U,d as ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-2TS2HEE6.js";import{a as d,b as R,c as H,h as u}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-NNG6BZAM.js";var y=class extends Error{constructor(e,t){let o=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=o}},T=class extends Error{constructor(e="A timeout occurred."){let t=new.target.prototype;super(e),this.__proto__=t}},b=class extends Error{constructor(e="An abort occurred."){let t=new.target.prototype;super(e),this.__proto__=t}},j=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=o}},O=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=o}},B=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=o}},F=class extends Error{constructor(e){let t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}},z=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=o}};var A=class{constructor(e,t,o){this.statusCode=e,this.statusText=t,this.content=o}},v=class{get(e,t){return this.send(R(d({},t),{method:"GET",url:e}))}post(e,t){return this.send(R(d({},t),{method:"POST",url:e}))}delete(e,t){return this.send(R(d({},t),{method:"DELETE",url:e}))}getCookieString(e){return""}};var i=function(r){return r[r.Trace=0]="Trace",r[r.Debug=1]="Debug",r[r.Information=2]="Information",r[r.Warning=3]="Warning",r[r.Error=4]="Error",r[r.Critical=5]="Critical",r[r.None=6]="None",r}(i||{});var k=class{constructor(){}log(e,t){}};k.instance=new k;var me="7.0.11",f=class{static isRequired(e,t){if(e==null)throw new Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw new Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,o){if(!(e in t))throw new Error(`Unknown ${o} value: ${e}.`)}},_=class{static get isBrowser(){return typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return typeof self=="object"&&"importScripts"in self}static get isReactNative(){return typeof window=="object"&&typeof window.document>"u"}static get isNode(){return!this.isBrowser&&!this.isWebWorker&&!this.isReactNative}};function x(r,e){let t="";return P(r)?(t=`Binary data of length ${r.byteLength}`,e&&(t+=`. Content: '${we(r)}'`)):typeof r=="string"&&(t=`String data of length ${r.length}`,e&&(t+=`. Content: '${r}'`)),t}function we(r){let e=new Uint8Array(r),t="";return e.forEach(o=>{let n=o<16?"0":"";t+=`0x${n}${o.toString(16)} `}),t.substr(0,t.length-1)}function P(r){return r&&typeof ArrayBuffer<"u"&&(r instanceof ArrayBuffer||r.constructor&&r.constructor.name==="ArrayBuffer")}function V(r,e,t,o,n,s){return u(this,null,function*(){let c={},[l,a]=E();c[l]=a,r.log(i.Trace,`(${e} transport) sending data. ${x(n,s.logMessageContent)}.`);let h=P(n)?"arraybuffer":"text",g=yield t.post(o,{content:n,headers:d(d({},c),s.headers),responseType:h,timeout:s.timeout,withCredentials:s.withCredentials});r.log(i.Trace,`(${e} transport) request complete. Response status: ${g.statusCode}.`)})}function pe(r){return r===void 0?new D(i.Information):r===null?k.instance:r.log!==void 0?r:new D(r)}var J=class{constructor(e,t){this._subject=e,this._observer=t}dispose(){let e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(t=>{})}},D=class{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){let o=`[${new Date().toISOString()}] ${i[e]}: ${t}`;switch(e){case i.Critical:case i.Error:this.out.error(o);break;case i.Warning:this.out.warn(o);break;case i.Information:this.out.info(o);break;default:this.out.log(o);break}}}};function E(){let r="X-SignalR-User-Agent";return _.isNode&&(r="User-Agent"),[r,be(me,Ce(),ye(),Se())]}function be(r,e,t,o){let n="Microsoft SignalR/",s=r.split(".");return n+=`${s[0]}.${s[1]}`,n+=` (${r}; `,e&&e!==""?n+=`${e}; `:n+="Unknown OS; ",n+=`${t}`,o?n+=`; ${o}`:n+="; Unknown Runtime Version",n+=")",n}function Ce(){if(_.isNode)switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}else return""}function Se(){if(_.isNode)return process.versions.node}function ye(){return _.isNode?"NodeJS":"Browser"}function ie(r){return r.stack?r.stack:r.message?r.message:`${r}`}function de(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("could not find global")}var X=class extends v{constructor(e){if(super(),this._logger=e,typeof fetch>"u"){let t=typeof __webpack_require__=="function"?__non_webpack_require__:H;this._jar=new(t("tough-cookie")).CookieJar,this._fetchType=t("node-fetch"),this._fetchType=t("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(de());if(typeof AbortController>"u"){let t=typeof __webpack_require__=="function"?__non_webpack_require__:H;this._abortControllerType=t("abort-controller")}else this._abortControllerType=AbortController}send(e){return u(this,null,function*(){if(e.abortSignal&&e.abortSignal.aborted)throw new b;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");let t=new this._abortControllerType,o;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),o=new b});let n=null;if(e.timeout){let a=e.timeout;n=setTimeout(()=>{t.abort(),this._logger.log(i.Warning,"Timeout from HTTP request."),o=new T},a)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},P(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");let s;try{s=yield this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:d({"X-Requested-With":"XMLHttpRequest"},e.headers),method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(a){throw o||(this._logger.log(i.Warning,`Error from HTTP request. ${a}.`),a)}finally{n&&clearTimeout(n),e.abortSignal&&(e.abortSignal.onabort=null)}if(!s.ok){let a=yield fe(s,"text");throw new y(a||s.statusText,s.status)}let l=yield fe(s,e.responseType);return new A(s.status,s.statusText,l)})}getCookieString(e){let t="";return _.isNode&&this._jar&&this._jar.getCookies(e,(o,n)=>t=n.join("; ")),t}};function fe(r,e){let t;switch(e){case"arraybuffer":t=r.arrayBuffer();break;case"text":t=r.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`);default:t=r.text();break}return t}var K=class extends v{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new b):e.method?e.url?new Promise((t,o)=>{let n=new XMLHttpRequest;n.open(e.method,e.url,!0),n.withCredentials=e.withCredentials===void 0?!0:e.withCredentials,n.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(P(e.content)?n.setRequestHeader("Content-Type","application/octet-stream"):n.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));let s=e.headers;s&&Object.keys(s).forEach(c=>{n.setRequestHeader(c,s[c])}),e.responseType&&(n.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),o(new b)}),e.timeout&&(n.timeout=e.timeout),n.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),n.status>=200&&n.status<300?t(new A(n.status,n.statusText,n.response||n.responseText)):o(new y(n.response||n.responseText||n.statusText,n.status))},n.onerror=()=>{this._logger.log(i.Warning,`Error from HTTP request. ${n.status}: ${n.statusText}.`),o(new y(n.statusText,n.status))},n.ontimeout=()=>{this._logger.log(i.Warning,"Timeout from HTTP request."),o(new T)},n.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}};var G=class extends v{constructor(e){if(super(),typeof fetch<"u"||_.isNode)this._httpClient=new X(e);else if(typeof XMLHttpRequest<"u")this._httpClient=new K(e);else throw new Error("No usable HttpClient found.")}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new b):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}};var S=class r{static write(e){return`${e}${r.RecordSeparator}`}static parse(e){if(e[e.length-1]!==r.RecordSeparator)throw new Error("Message is incomplete.");let t=e.split(r.RecordSeparator);return t.pop(),t}};S.RecordSeparatorCode=30;S.RecordSeparator=String.fromCharCode(S.RecordSeparatorCode);var Y=class{writeHandshakeRequest(e){return S.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,o;if(P(e)){let l=new Uint8Array(e),a=l.indexOf(S.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");let h=a+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(l.slice(0,h))),o=l.byteLength>h?l.slice(h).buffer:null}else{let l=e,a=l.indexOf(S.RecordSeparator);if(a===-1)throw new Error("Message is incomplete.");let h=a+1;t=l.substring(0,h),o=l.length>h?l.substring(h):null}let n=S.parse(t),s=JSON.parse(n[0]);if(s.type)throw new Error("Expected a handshake response from the server.");return[o,s]}};var p=function(r){return r[r.Invocation=1]="Invocation",r[r.StreamItem=2]="StreamItem",r[r.Completion=3]="Completion",r[r.StreamInvocation=4]="StreamInvocation",r[r.CancelInvocation=5]="CancelInvocation",r[r.Ping=6]="Ping",r[r.Close=7]="Close",r}(p||{});var Q=class{constructor(){this.observers=[]}next(e){for(let t of this.observers)t.next(e)}error(e){for(let t of this.observers)t.error&&t.error(e)}complete(){for(let e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new J(this,e)}};var ve=30*1e3,ke=15*1e3,m=function(r){return r.Disconnected="Disconnected",r.Connecting="Connecting",r.Connected="Connected",r.Disconnecting="Disconnecting",r.Reconnecting="Reconnecting",r}(m||{}),Z=class r{constructor(e,t,o,n){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(i.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},f.isRequired(e,"connection"),f.isRequired(t,"logger"),f.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=ve,this.keepAliveIntervalInMilliseconds=ke,this._logger=t,this._protocol=o,this.connection=e,this._reconnectPolicy=n,this._handshakeProtocol=new Y,this.connection.onreceive=s=>this._processIncomingData(s),this.connection.onclose=s=>this._connectionClosed(s),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=m.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:p.Ping})}static create(e,t,o,n){return new r(e,t,o,n)}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==m.Disconnected&&this._connectionState!==m.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}_startWithStateTransitions(){return u(this,null,function*(){if(this._connectionState!==m.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=m.Connecting,this._logger.log(i.Debug,"Starting HubConnection.");try{yield this._startInternal(),_.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=m.Connected,this._connectionStarted=!0,this._logger.log(i.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=m.Disconnected,this._logger.log(i.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}})}_startInternal(){return u(this,null,function*(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;let e=new Promise((t,o)=>{this._handshakeResolver=t,this._handshakeRejecter=o});yield this.connection.start(this._protocol.transferFormat);try{let t={protocol:this._protocol.name,version:this._protocol.version};if(this._logger.log(i.Debug,"Sending handshake request."),yield this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(t)),this._logger.log(i.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),yield e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.inherentKeepAlive||(yield this._sendMessage(this._cachedPingMessage))}catch(t){throw this._logger.log(i.Debug,`Hub handshake failed with error '${t}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),yield this.connection.stop(t),t}})}stop(){return u(this,null,function*(){let e=this._startPromise;this._stopPromise=this._stopInternal(),yield this._stopPromise;try{yield e}catch{}})}_stopInternal(e){return this._connectionState===m.Disconnected?(this._logger.log(i.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve()):this._connectionState===m.Disconnecting?(this._logger.log(i.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState=m.Disconnecting,this._logger.log(i.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(i.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new b("The connection was stopped before the hub handshake could complete."),this.connection.stop(e)))}stream(e,...t){let[o,n]=this._replaceStreamingParams(t),s=this._createStreamInvocation(e,t,n),c,l=new Q;return l.cancelCallback=()=>{let a=this._createCancelInvocation(s.invocationId);return delete this._callbacks[s.invocationId],c.then(()=>this._sendWithProtocol(a))},this._callbacks[s.invocationId]=(a,h)=>{if(h){l.error(h);return}else a&&(a.type===p.Completion?a.error?l.error(new Error(a.error)):l.complete():l.next(a.item))},c=this._sendWithProtocol(s).catch(a=>{l.error(a),delete this._callbacks[s.invocationId]}),this._launchStreams(o,c),l}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){let[o,n]=this._replaceStreamingParams(t),s=this._sendWithProtocol(this._createInvocation(e,t,!0,n));return this._launchStreams(o,s),s}invoke(e,...t){let[o,n]=this._replaceStreamingParams(t),s=this._createInvocation(e,t,!1,n);return new Promise((l,a)=>{this._callbacks[s.invocationId]=(g,I)=>{if(I){a(I);return}else g&&(g.type===p.Completion?g.error?a(new Error(g.error)):l(g.result):a(new Error(`Unexpected message type: ${g.type}`)))};let h=this._sendWithProtocol(s).catch(g=>{a(g),delete this._callbacks[s.invocationId]});this._launchStreams(o,h)})}on(e,t){!e||!t||(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(t)===-1&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();let o=this._methods[e];if(o)if(t){let n=o.indexOf(t);n!==-1&&(o.splice(n,1),o.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){let t=this._protocol.parseMessages(e,this._logger);for(let o of t)switch(o.type){case p.Invocation:this._invokeClientMethod(o);break;case p.StreamItem:case p.Completion:{let n=this._callbacks[o.invocationId];if(n){o.type===p.Completion&&delete this._callbacks[o.invocationId];try{n(o)}catch(s){this._logger.log(i.Error,`Stream callback threw error: ${ie(s)}`)}}break}case p.Ping:break;case p.Close:{this._logger.log(i.Information,"Close message received from server.");let n=o.error?new Error("Server returned an error on close: "+o.error):void 0;o.allowReconnect===!0?this.connection.stop(n):this._stopPromise=this._stopInternal(n);break}default:this._logger.log(i.Warning,`Invalid message type: ${o.type}.`);break}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,o;try{[o,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(n){let s="Error parsing handshake response: "+n;this._logger.log(i.Error,s);let c=new Error(s);throw this._handshakeRejecter(c),c}if(t.error){let n="Server returned handshake error: "+t.error;this._logger.log(i.Error,n);let s=new Error(n);throw this._handshakeRejecter(s),s}else this._logger.log(i.Debug,"Server handshake complete.");return this._handshakeResolver(),o}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if((!this.connection.features||!this.connection.features.inherentKeepAlive)&&(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle===void 0)){let e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(()=>u(this,null,function*(){if(this._connectionState===m.Connected)try{yield this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(e){return u(this,null,function*(){let t=e.target.toLowerCase(),o=this._methods[t];if(!o){this._logger.log(i.Warning,`No client method with the name '${t}' found.`),e.invocationId&&(this._logger.log(i.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),yield this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)));return}let n=o.slice(),s=!!e.invocationId,c,l,a;for(let h of n)try{let g=c;c=yield h.apply(this,e.arguments),s&&c&&g&&(this._logger.log(i.Error,`Multiple results provided for '${t}'. Sending error to server.`),a=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),l=void 0}catch(g){l=g,this._logger.log(i.Error,`A callback for the method '${t}' threw error '${g}'.`)}a?yield this._sendWithProtocol(a):s?(l?a=this._createCompletionMessage(e.invocationId,`${l}`,null):c!==void 0?a=this._createCompletionMessage(e.invocationId,null,c):(this._logger.log(i.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),a=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),yield this._sendWithProtocol(a)):c&&this._logger.log(i.Error,`Result given for '${t}' method but server is not expecting a result.`)})}_connectionClosed(e){this._logger.log(i.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new b("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===m.Disconnecting?this._completeClose(e):this._connectionState===m.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===m.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=m.Disconnected,this._connectionStarted=!1,_.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(t=>t.apply(this,[e]))}catch(t){this._logger.log(i.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}_reconnect(e){return u(this,null,function*(){let t=Date.now(),o=0,n=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),s=this._getNextRetryDelay(o++,0,n);if(s===null){this._logger.log(i.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),this._completeClose(e);return}if(this._connectionState=m.Reconnecting,e?this._logger.log(i.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(i.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(c=>c.apply(this,[e]))}catch(c){this._logger.log(i.Error,`An onreconnecting callback called with error '${e}' threw error '${c}'.`)}if(this._connectionState!==m.Reconnecting){this._logger.log(i.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.");return}}for(;s!==null;){if(this._logger.log(i.Information,`Reconnect attempt number ${o} will start in ${s} ms.`),yield new Promise(c=>{this._reconnectDelayHandle=setTimeout(c,s)}),this._reconnectDelayHandle=void 0,this._connectionState!==m.Reconnecting){this._logger.log(i.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");return}try{if(yield this._startInternal(),this._connectionState=m.Connected,this._logger.log(i.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(c=>c.apply(this,[this.connection.connectionId]))}catch(c){this._logger.log(i.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${c}'.`)}return}catch(c){if(this._logger.log(i.Information,`Reconnect attempt failed because of error '${c}'.`),this._connectionState!==m.Reconnecting){this._logger.log(i.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),this._connectionState===m.Disconnecting&&this._completeClose();return}n=c instanceof Error?c:new Error(c.toString()),s=this._getNextRetryDelay(o++,Date.now()-t,n)}}this._logger.log(i.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${o} failed attempts. Connection disconnecting.`),this._completeClose()})}_getNextRetryDelay(e,t,o){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:o})}catch(n){return this._logger.log(i.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${n}'.`),null}}_cancelCallbacksWithError(e){let t=this._callbacks;this._callbacks={},Object.keys(t).forEach(o=>{let n=t[o];try{n(null,e)}catch(s){this._logger.log(i.Error,`Stream 'error' callback called with '${e}' threw error: ${ie(s)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,o,n){if(o)return n.length!==0?{arguments:t,streamIds:n,target:e,type:p.Invocation}:{arguments:t,target:e,type:p.Invocation};{let s=this._invocationId;return this._invocationId++,n.length!==0?{arguments:t,invocationId:s.toString(),streamIds:n,target:e,type:p.Invocation}:{arguments:t,invocationId:s.toString(),target:e,type:p.Invocation}}}_launchStreams(e,t){if(e.length!==0){t||(t=Promise.resolve());for(let o in e)e[o].subscribe({complete:()=>{t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(o)))},error:n=>{let s;n instanceof Error?s=n.message:n&&n.toString?s=n.toString():s="Unknown error",t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(o,s)))},next:n=>{t=t.then(()=>this._sendWithProtocol(this._createStreamItemMessage(o,n)))}})}}_replaceStreamingParams(e){let t=[],o=[];for(let n=0;n<e.length;n++){let s=e[n];if(this._isObservable(s)){let c=this._invocationId;this._invocationId++,t[c]=s,o.push(c.toString()),e.splice(n,1)}}return[t,o]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,t,o){let n=this._invocationId;return this._invocationId++,o.length!==0?{arguments:t,invocationId:n.toString(),streamIds:o,target:e,type:p.StreamInvocation}:{arguments:t,invocationId:n.toString(),target:e,type:p.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:p.CancelInvocation}}_createStreamItemMessage(e,t){return{invocationId:e,item:t,type:p.StreamItem}}_createCompletionMessage(e,t,o){return t?{error:t,invocationId:e,type:p.Completion}:{invocationId:e,result:o,type:p.Completion}}};var Ee=[0,2e3,1e4,3e4,null],L=class{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Ee}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}};var $=(()=>{class r{}return r.Authorization="Authorization",r.Cookie="Cookie",r})();var q=class extends v{constructor(e,t){super(),this._innerClient=e,this._accessTokenFactory=t}send(e){return u(this,null,function*(){let t=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(t=!1,this._accessToken=yield this._accessTokenFactory()),this._setAuthorizationHeader(e);let o=yield this._innerClient.send(e);return t&&o.statusCode===401&&this._accessTokenFactory?(this._accessToken=yield this._accessTokenFactory(),this._setAuthorizationHeader(e),yield this._innerClient.send(e)):o})}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[$.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[$.Authorization]&&delete e.headers[$.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}};var C=function(r){return r[r.None=0]="None",r[r.WebSockets=1]="WebSockets",r[r.ServerSentEvents=2]="ServerSentEvents",r[r.LongPolling=4]="LongPolling",r}(C||{}),w=function(r){return r[r.Text=1]="Text",r[r.Binary=2]="Binary",r}(w||{});var ee=class{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}};var W=class{constructor(e,t,o){this._httpClient=e,this._logger=t,this._pollAbort=new ee,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}get pollAborted(){return this._pollAbort.aborted}connect(e,t){return u(this,null,function*(){if(f.isRequired(e,"url"),f.isRequired(t,"transferFormat"),f.isIn(t,w,"transferFormat"),this._url=e,this._logger.log(i.Trace,"(LongPolling transport) Connecting."),t===w.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");let[o,n]=E(),s=d({[o]:n},this._options.headers),c={abortSignal:this._pollAbort.signal,headers:s,timeout:1e5,withCredentials:this._options.withCredentials};t===w.Binary&&(c.responseType="arraybuffer");let l=`${e}&_=${Date.now()}`;this._logger.log(i.Trace,`(LongPolling transport) polling: ${l}.`);let a=yield this._httpClient.get(l,c);a.statusCode!==200?(this._logger.log(i.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new y(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,c)})}_poll(e,t){return u(this,null,function*(){try{for(;this._running;)try{let o=`${e}&_=${Date.now()}`;this._logger.log(i.Trace,`(LongPolling transport) polling: ${o}.`);let n=yield this._httpClient.get(o,t);n.statusCode===204?(this._logger.log(i.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):n.statusCode!==200?(this._logger.log(i.Error,`(LongPolling transport) Unexpected response code: ${n.statusCode}.`),this._closeError=new y(n.statusText||"",n.statusCode),this._running=!1):n.content?(this._logger.log(i.Trace,`(LongPolling transport) data received. ${x(n.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(n.content)):this._logger.log(i.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(o){this._running?o instanceof T?this._logger.log(i.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=o,this._running=!1):this._logger.log(i.Trace,`(LongPolling transport) Poll errored after shutdown: ${o.message}`)}}finally{this._logger.log(i.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}})}send(e){return u(this,null,function*(){return this._running?V(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return u(this,null,function*(){this._logger.log(i.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{yield this._receiving,this._logger.log(i.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);let e={},[t,o]=E();e[t]=o;let n={headers:d(d({},e),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials};yield this._httpClient.delete(this._url,n),this._logger.log(i.Trace,"(LongPolling transport) DELETE request sent.")}finally{this._logger.log(i.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}})}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(i.Trace,e),this.onclose(this._closeError)}}};var te=class{constructor(e,t,o,n){this._httpClient=e,this._accessToken=t,this._logger=o,this._options=n,this.onreceive=null,this.onclose=null}connect(e,t){return u(this,null,function*(){return f.isRequired(e,"url"),f.isRequired(t,"transferFormat"),f.isIn(t,w,"transferFormat"),this._logger.log(i.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((o,n)=>{let s=!1;if(t!==w.Text){n(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));return}let c;if(_.isBrowser||_.isWebWorker)c=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{let l=this._httpClient.getCookieString(e),a={};a.Cookie=l;let[h,g]=E();a[h]=g,c=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:d(d({},a),this._options.headers)})}try{c.onmessage=l=>{if(this.onreceive)try{this._logger.log(i.Trace,`(SSE transport) data received. ${x(l.data,this._options.logMessageContent)}.`),this.onreceive(l.data)}catch(a){this._close(a);return}},c.onerror=l=>{s?this._close():n(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},c.onopen=()=>{this._logger.log(i.Information,`SSE connected to ${this._url}`),this._eventSource=c,s=!0,o()}}catch(l){n(l);return}})})}send(e){return u(this,null,function*(){return this._eventSource?V(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}};var oe=class{constructor(e,t,o,n,s,c){this._logger=o,this._accessTokenFactory=t,this._logMessageContent=n,this._webSocketConstructor=s,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=c}connect(e,t){return u(this,null,function*(){f.isRequired(e,"url"),f.isRequired(t,"transferFormat"),f.isIn(t,w,"transferFormat"),this._logger.log(i.Trace,"(WebSockets transport) Connecting.");let o;return this._accessTokenFactory&&(o=yield this._accessTokenFactory()),new Promise((n,s)=>{e=e.replace(/^http/,"ws");let c,l=this._httpClient.getCookieString(e),a=!1;if(_.isNode||_.isReactNative){let h={},[g,I]=E();h[g]=I,o&&(h[$.Authorization]=`Bearer ${o}`),l&&(h[$.Cookie]=l),c=new this._webSocketConstructor(e,void 0,{headers:d(d({},h),this._headers)})}else o&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);c||(c=new this._webSocketConstructor(e)),t===w.Binary&&(c.binaryType="arraybuffer"),c.onopen=h=>{this._logger.log(i.Information,`WebSocket connected to ${e}.`),this._webSocket=c,a=!0,n()},c.onerror=h=>{let g=null;typeof ErrorEvent<"u"&&h instanceof ErrorEvent?g=h.error:g="There was an error with the transport",this._logger.log(i.Information,`(WebSockets transport) ${g}.`)},c.onmessage=h=>{if(this._logger.log(i.Trace,`(WebSockets transport) data received. ${x(h.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(h.data)}catch(g){this._close(g);return}},c.onclose=h=>{if(a)this._close(h);else{let g=null;typeof ErrorEvent<"u"&&h instanceof ErrorEvent?g=h.error:g="WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",s(new Error(g))}}})})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(i.Trace,`(WebSockets transport) sending data. ${x(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(i.Trace,"(WebSockets transport) socket closed."),this.onclose&&(this._isCloseEvent(e)&&(e.wasClean===!1||e.code!==1e3)?this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)):e instanceof Error?this.onclose(e):this.onclose())}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}};var _e=100,ne=class{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,f.isRequired(e,"url"),this._logger=pe(t.logger),this.baseUrl=this._resolveUrl(e),t=t||{},t.logMessageContent=t.logMessageContent===void 0?!1:t.logMessageContent,typeof t.withCredentials=="boolean"||t.withCredentials===void 0)t.withCredentials=t.withCredentials===void 0?!0:t.withCredentials;else throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.timeout=t.timeout===void 0?100*1e3:t.timeout;let o=null,n=null;if(_.isNode&&typeof H<"u"){let s=typeof __webpack_require__=="function"?__non_webpack_require__:H;o=s("ws"),n=s("eventsource")}!_.isNode&&typeof WebSocket<"u"&&!t.WebSocket?t.WebSocket=WebSocket:_.isNode&&!t.WebSocket&&o&&(t.WebSocket=o),!_.isNode&&typeof EventSource<"u"&&!t.EventSource?t.EventSource=EventSource:_.isNode&&!t.EventSource&&typeof n<"u"&&(t.EventSource=n),this._httpClient=new q(t.httpClient||new G(this._logger),t.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}start(e){return u(this,null,function*(){if(e=e||w.Binary,f.isIn(e,w,"transferFormat"),this._logger.log(i.Debug,`Starting connection with transfer format '${w[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),yield this._startInternalPromise,this._connectionState==="Disconnecting"){let t="Failed to start the HttpConnection before stop() was called.";return this._logger.log(i.Error,t),yield this._stopPromise,Promise.reject(new b(t))}else if(this._connectionState!=="Connected"){let t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(i.Error,t),Promise.reject(new b(t))}this._connectionStarted=!0})}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new se(this.transport)),this._sendQueue.send(e))}stop(e){return u(this,null,function*(){if(this._connectionState==="Disconnected")return this._logger.log(i.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve();if(this._connectionState==="Disconnecting")return this._logger.log(i.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;this._connectionState="Disconnecting",this._stopPromise=new Promise(t=>{this._stopPromiseResolver=t}),yield this._stopInternal(e),yield this._stopPromise})}_stopInternal(e){return u(this,null,function*(){this._stopError=e;try{yield this._startInternalPromise}catch{}if(this.transport){try{yield this.transport.stop()}catch(t){this._logger.log(i.Error,`HttpConnection.transport.stop() threw error '${t}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(i.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")})}_startInternal(e){return u(this,null,function*(){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation)if(this._options.transport===C.WebSockets)this.transport=this._constructTransport(C.WebSockets),yield this._startTransport(t,e);else throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");else{let o=null,n=0;do{if(o=yield this._getNegotiationResponse(t),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new b("The connection was stopped during negotiation.");if(o.error)throw new Error(o.error);if(o.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(o.url&&(t=o.url),o.accessToken){let s=o.accessToken;this._accessTokenFactory=()=>s,this._httpClient._accessToken=s,this._httpClient._accessTokenFactory=void 0}n++}while(o.url&&n<_e);if(n===_e&&o.url)throw new Error("Negotiate redirection limit exceeded.");yield this._createTransport(t,this._options.transport,o,e)}this.transport instanceof W&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(i.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(o){return this._logger.log(i.Error,"Failed to start the connection: "+o),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(o)}})}_getNegotiationResponse(e){return u(this,null,function*(){let t={},[o,n]=E();t[o]=n;let s=this._resolveNegotiateUrl(e);this._logger.log(i.Debug,`Sending negotiation request: ${s}.`);try{let c=yield this._httpClient.post(s,{content:"",headers:d(d({},t),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(c.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${c.statusCode}'`));let l=JSON.parse(c.content);return(!l.negotiateVersion||l.negotiateVersion<1)&&(l.connectionToken=l.connectionId),l}catch(c){let l="Failed to complete negotiation with the server: "+c;return c instanceof y&&c.statusCode===404&&(l=l+" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(i.Error,l),Promise.reject(new F(l))}})}_createConnectUrl(e,t){return t?e+(e.indexOf("?")===-1?"?":"&")+`id=${t}`:e}_createTransport(e,t,o,n){return u(this,null,function*(){let s=this._createConnectUrl(e,o.connectionToken);if(this._isITransport(t)){this._logger.log(i.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,yield this._startTransport(s,n),this.connectionId=o.connectionId;return}let c=[],l=o.availableTransports||[],a=o;for(let h of l){let g=this._resolveTransportOrError(h,t,n);if(g instanceof Error)c.push(`${h.transport} failed:`),c.push(g);else if(this._isITransport(g)){if(this.transport=g,!a){try{a=yield this._getNegotiationResponse(e)}catch(I){return Promise.reject(I)}s=this._createConnectUrl(e,a.connectionToken)}try{yield this._startTransport(s,n),this.connectionId=a.connectionId;return}catch(I){if(this._logger.log(i.Error,`Failed to start the transport '${h.transport}': ${I}`),a=void 0,c.push(new B(`${h.transport} failed: ${I}`,C[h.transport])),this._connectionState!=="Connecting"){let ce="Failed to select transport before stop() was called.";return this._logger.log(i.Debug,ce),Promise.reject(new b(ce))}}}}return c.length>0?Promise.reject(new z(`Unable to connect to the server with any of the available transports. ${c.join(" ")}`,c)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))})}_constructTransport(e){switch(e){case C.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new oe(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case C.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new te(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case C.LongPolling:return new W(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.transport.onclose=o=>this._stopConnection(o),this.transport.connect(e,t)}_resolveTransportOrError(e,t,o){let n=C[e.transport];if(n==null)return this._logger.log(i.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(Ie(t,n))if(e.transferFormats.map(c=>w[c]).indexOf(o)>=0){if(n===C.WebSockets&&!this._options.WebSocket||n===C.ServerSentEvents&&!this._options.EventSource)return this._logger.log(i.Debug,`Skipping transport '${C[n]}' because it is not supported in your environment.'`),new j(`'${C[n]}' is not supported in your environment.`,n);this._logger.log(i.Debug,`Selecting transport '${C[n]}'.`);try{return this._constructTransport(n)}catch(c){return c}}else return this._logger.log(i.Debug,`Skipping transport '${C[n]}' because it does not support the requested transfer format '${w[o]}'.`),new Error(`'${C[n]}' does not support ${w[o]}.`);else return this._logger.log(i.Debug,`Skipping transport '${C[n]}' because it was disabled by the client.`),new O(`'${C[n]}' is disabled by the client.`,n)}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(i.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState==="Disconnected"){this._logger.log(i.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`);return}if(this._connectionState==="Connecting")throw this._logger.log(i.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(i.Error,`Connection disconnected with error '${e}'.`):this._logger.log(i.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(t=>{this._logger.log(i.Error,`TransportSendQueue.stop() threw error '${t}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(i.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!_.isBrowser)throw new Error(`Cannot resolve '${e}'.`);let t=window.document.createElement("a");return t.href=e,this._logger.log(i.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){let t=e.indexOf("?"),o=e.substring(0,t===-1?e.length:t);return o[o.length-1]!=="/"&&(o+="/"),o+="negotiate",o+=t===-1?"":e.substring(t),o.indexOf("negotiateVersion")===-1&&(o+=t===-1?"?":"&",o+="negotiateVersion="+this._negotiateVersion),o}};function Ie(r,e){return!r||(e&r)!==0}var se=class r{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new N,this._transportResult=new N,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new N),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}_sendLoop(){return u(this,null,function*(){for(;;){if(yield this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new N;let e=this._transportResult;this._transportResult=void 0;let t=typeof this._buffer[0]=="string"?this._buffer.join(""):r._concatBuffers(this._buffer);this._buffer.length=0;try{yield this._transport.send(t),e.resolve()}catch(o){e.reject(o)}}})}static _concatBuffers(e){let t=e.map(s=>s.byteLength).reduce((s,c)=>s+c),o=new Uint8Array(t),n=0;for(let s of e)o.set(new Uint8Array(s),n),n+=s.byteLength;return o.buffer}},N=class{constructor(){this.promise=new Promise((e,t)=>[this._resolver,this._rejecter]=[e,t])}resolve(){this._resolver()}reject(e){this._rejecter(e)}};var Te="json",re=class{constructor(){this.name=Te,this.version=1,this.transferFormat=w.Text}parseMessages(e,t){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];t===null&&(t=k.instance);let o=S.parse(e),n=[];for(let s of o){let c=JSON.parse(s);if(typeof c.type!="number")throw new Error("Invalid payload.");switch(c.type){case p.Invocation:this._isInvocationMessage(c);break;case p.StreamItem:this._isStreamItemMessage(c);break;case p.Completion:this._isCompletionMessage(c);break;case p.Ping:break;case p.Close:break;default:t.log(i.Information,"Unknown message type '"+c.type+"' ignored.");continue}n.push(c)}return n}writeMessage(e){return S.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_assertNotEmptyString(e,t){if(typeof e!="string"||e==="")throw new Error(t)}};var xe={trace:i.Trace,debug:i.Debug,info:i.Information,information:i.Information,warn:i.Warning,warning:i.Warning,error:i.Error,critical:i.Critical,none:i.None};function Pe(r){let e=xe[r.toLowerCase()];if(typeof e<"u")return e;throw new Error(`Unknown log level: ${r}`)}var M=class{configureLogging(e){if(f.isRequired(e,"logging"),De(e))this.logger=e;else if(typeof e=="string"){let t=Pe(e);this.logger=new D(t)}else this.logger=new D(e);return this}withUrl(e,t){return f.isRequired(e,"url"),f.isNotEmpty(e,"url"),this.url=e,typeof t=="object"?this.httpConnectionOptions=d(d({},this.httpConnectionOptions),t):this.httpConnectionOptions=R(d({},this.httpConnectionOptions),{transport:t}),this}withHubProtocol(e){return f.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new L(e):this.reconnectPolicy=e:this.reconnectPolicy=new L,this}build(){let e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");let t=new ne(this.url,e);return Z.create(t,this.logger||k.instance,this.protocol||new re,this.reconnectPolicy)}};function De(r){return r.log!==void 0}var Eo=(()=>{let e=class e{constructor(o,n,s){this.decodeTokenService=o,this.toastr=n,this.httpService=s,this.initNotifications(),this.parseToken=this.decodeTokenService.getParseToken(),this.buildConnection()}initNotifications(){let o=JSON.parse(localStorage.getItem("Notifications"));this._notifications=new ae(o||[])}setNotification(o){let s=[...this._notifications.value,o];this.saveNotificationTotal(s),this._notifications.next(s)}saveNotificationTotal(o=[]){localStorage.setItem("Notifications",JSON.stringify(o))}getNotification(){return this._notifications.asObservable()}getNotificationDetail(o){return this.httpService.post("/api/notification/GetByID",{ID:o})}buildConnection(){this.hubConnection=new M().withUrl("/MarketplaceHub").withAutomaticReconnect().configureLogging(i.Information).build(),this.startConnection(),this.onConnectionClose(),this.subscribeNotification()}connectToRegister(){this.hubConnection.invoke("SubscribeGroup",this.parseToken.PID)}startConnection(){this.hubConnection.start().then(()=>{this.connectToRegister()}).catch(o=>console.log("Error while starting connection: "+o))}onConnectionClose(){this.hubConnection.onclose(()=>{this.buildConnection()})}subscribeNotification(){this.hubConnection.on("Notification",o=>{let n=JSON.parse(o);this.setNotification(n),n.ID==this.parseToken.PID&&(n.StatusCode!=200?this.toastr.error(n.Message,n.Title,{enableHtml:!0}):this.toastr.success(n.Message,n.Title,{enableHtml:!0}))})}clearNotification(){localStorage.removeItem("Notifications"),this._notifications.next([])}};e.\u0275fac=function(n){return new(n||e)(U(ge),U(ue),U(he))},e.\u0275prov=le({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();export{Eo as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.
|
|
1
|
+
import{b as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-7C4NOK37.js";import{a as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-JN7U2QOU.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-MIITW5F3.js";import{a as q,b as x}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-6NGKE364.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-I2G5J34U.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-H6M6M4LW.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-V6IO53G5.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-TZRTEOJA.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-2OVWEFCG.js";import{C as O,D as H}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-5VJQDJRJ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-DDXVCGNF.js";import{c as w,h as B,k as N,u as $}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-MFWCFDSI.js";import{$a as n,Ac as k,Fb as u,Ga as o,Gb as c,Ha as S,Hb as _,Q as h,Qa as m,Ta as I,Wa as M,ab as i,ac as F,ea as C,ec as E,fc as A,hc as T,ic as R,jb as g,q as v,rb as r,tb as f,wb as b,xb as L,yb as P,yc as D}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-2TS2HEE6.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.2/Marketplace/chunk-NNG6BZAM.js";var V=()=>["/menu/log/inventory-async/detail"],G=a=>({ID:a});function J(a,l){if(a&1&&(n(0,"tr")(1,"td")(2,"a",14),r(3),u(4,"date"),i()(),n(5,"td"),r(6),u(7,"number"),i(),n(8,"td")(9,"span",15),r(10),i()()()),a&2){let t=l.$implicit;o(2),m("routerLink",L(13,V))("queryParams",P(14,G,t._id)),o(1),f(" ",_(4,7,t==null?null:t._source["@timestamp"],"dd MMM yyyy HH:mm:ss")," "),o(3),f(" ",_(7,10,t.DurationInSecond,"1.1-1")," s "),o(3),I((t==null||t._source==null||t._source.log==null?null:t._source.log.respCode)===200||(t==null||t._source==null||t._source.log==null?null:t._source.log.respCode)===202?"bg-success":"bg-warning"),o(1),f(" ",t==null||t._source==null||t._source.log==null?null:t._source.log.respCode," ")}}var le=(()=>{let l=class l{constructor(p){this.inventoryAsyncServiceLog=p,this.filters={PageNumber:1,RowCount:100,From:null,To:null,StatusCode:""}}ngOnInit(){this.initInventoryLog()}initInventoryLog(){let p=this.inventoryAsyncServiceLog.getInventoryAsyncLog(this.filters).pipe(h(1));this.inventoryLog$=p.pipe(v(s=>s?.hits)),this.totalPagination$=p.pipe(v(s=>s?.total.value))}onPaginationChange(p){this.filters.PageNumber=p.pageIndex+1,this.initInventoryLog()}onSubmitFilter(){this.initInventoryLog()}};l.\u0275fac=function(s){return new(s||l)(S(j))},l.\u0275cmp=C({type:l,selectors:[["app-inventory-async-log"]],standalone:!0,features:[b],decls:33,vars:16,consts:[["headerTitle","Async Inventory",3,"hideSearchBox","onSubmit"],["container",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"mt-5"],["type","text","name","StatusCode",1,"w-100","mt-2","form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"],[1,"text-white","p-2","rounded","response-desc"]],template:function(s,e){s&1&&(n(0,"mainpanel",0),g("onSubmit",function(){return e.onSubmitFilter()}),n(1,"filters")(2,"div",1)(3,"div")(4,"label"),r(5,"From/To"),i(),n(6,"datepicker",2),g("dateChange",function(d){return e.filters.From=d}),i(),n(7,"datepicker",3),g("dateChange",function(d){return e.filters.To=d}),i()(),n(8,"div",4)(9,"label"),r(10,"Response Code"),i(),n(11,"input",5),g("ngModelChange",function(d){return e.filters.StatusCode=d}),i()()()(),n(12,"content")(13,"div",6)(14,"div",7)(15,"div",8)(16,"div",9)(17,"table",10)(18,"thead")(19,"tr",11)(20,"th"),r(21,"Created"),i(),n(22,"th"),r(23,"Duration"),i(),n(24,"th"),r(25,"Response code"),i()()(),n(26,"tbody"),M(27,J,11,16,"tr",12),u(28,"async"),i()(),n(29,"mat-paginator",13),g("page",function(d){return e.onPaginationChange(d)}),u(30,"async"),u(31,"async"),u(32,"async"),i()()()()()()()),s&2&&(m("hideSearchBox",!0),o(6),m("date",e.filters.From),o(1),m("date",e.filters.To),o(4),m("ngModel",e.filters.StatusCode),o(16),m("ngForOf",c(28,8,e.inventoryLog$)),o(2),m("length",c(30,10,e.totalPagination$))("pageSize",e.filters.RowCount>c(31,12,e.totalPagination$)?c(32,14,e.totalPagination$):e.filters.RowCount)("pageIndex",(e.filters==null?null:e.filters.PageNumber)==0?0:(e.filters==null?null:e.filters.PageNumber)-1))},dependencies:[$,w,B,N,R,F,E,T,A,H,O,x,q,z,k,D]});let a=l;return a})();export{le as InventoryAsyncLogComponent};
|